Files
gsfdc/demo-dify/dify/web/app/components/base/date-time-picker/date-picker.tsx
T
wuzilongandCursor 6519682885 chore: 纳入本地 Dify 1.19.0 源码及品牌与免登改动
演示目录只保留可重建的源码。运行密钥、数据卷、依赖和带口令的本地配置不进入仓库。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-18 13:59:25 +08:00

41 lines
1.2 KiB
TypeScript

'use client'
import type { DatePickerProps } from '@langgenius/dify-ui/date-picker'
import { DatePicker as BaseDatePicker } from '@langgenius/dify-ui/date-picker'
import { getCalendarLocale } from './calendar-locales'
import { usePickerLabels } from './use-picker-labels'
export function DatePicker(props: DatePickerProps) {
const defaults = usePickerLabels()
return (
<BaseDatePicker
{...defaults}
{...props}
placeholder={props.placeholder ?? defaults.labels.backToDate}
locale={getCalendarLocale(defaults.locale, props.locale)}
labels={{ ...defaults.labels, ...props.labels }}
/>
)
}
/* oxlint-disable no-barrel-files/no-barrel-files -- Keep this localized picker and its unchanged parts/types in one component entry. */
export {
DatePickerClear,
DatePickerContent,
DatePickerLabel,
DatePickerTrigger,
DatePickerValue,
} from '@langgenius/dify-ui/date-picker'
/** @public */
export type {
DatePickerChangeEventDetails,
DatePickerChangeEventReason,
DatePickerClearProps,
DatePickerContentProps,
DatePickerLabelProps,
DatePickerProps,
DatePickerTriggerProps,
DatePickerValueProps,
} from '@langgenius/dify-ui/date-picker'
/* oxlint-enable no-barrel-files/no-barrel-files */