react-antd-admin-panel
Version:
Modern TypeScript-first React admin panel builder with Ant Design 6
83 lines • 2.35 kB
TypeScript
import React from 'react';
import type { Dayjs } from 'dayjs';
import { FormFieldBuilder, FormFieldBuilderConfig } from '../base/FormFieldBuilder';
export interface DatePickerConfig extends FormFieldBuilderConfig {
format?: string;
showTime?: boolean;
showToday?: boolean;
picker?: 'date' | 'week' | 'month' | 'quarter' | 'year';
disabledDate?: (current: Dayjs) => boolean;
allowClear?: boolean;
}
/**
* DatePicker Field Builder
* Wrapper for Ant Design DatePicker component with dayjs
*/
export declare class DatePicker extends FormFieldBuilder<DatePickerConfig, Dayjs | null> {
/**
* Set date format
*/
format(fmt: string): this;
/**
* Enable time selection
*/
showTime(value?: boolean): this;
/**
* Show today button
*/
showToday(value?: boolean): this;
/**
* Set picker type (date, week, month, quarter, year)
*/
picker(type: 'date' | 'week' | 'month' | 'quarter' | 'year'): this;
/**
* Set function to disable specific dates
*/
disabledDate(fn: (current: Dayjs) => boolean): this;
/**
* Enable clear button
*/
allowClear(value?: boolean): this;
/**
* Render the date picker component
*/
render(): React.ReactNode;
}
export interface RangePickerConfig extends FormFieldBuilderConfig {
format?: string;
showTime?: boolean;
picker?: 'date' | 'week' | 'month' | 'quarter' | 'year';
disabledDate?: (current: Dayjs) => boolean;
allowClear?: boolean;
}
/**
* RangePicker Field Builder
* Wrapper for Ant Design RangePicker component
*/
export declare class RangePicker extends FormFieldBuilder<RangePickerConfig, [Dayjs | null, Dayjs | null] | null> {
/**
* Set date format
*/
format(fmt: string): this;
/**
* Enable time selection
*/
showTime(value?: boolean): this;
/**
* Set picker type (date, week, month, quarter, year)
*/
picker(type: 'date' | 'week' | 'month' | 'quarter' | 'year'): this;
/**
* Set function to disable specific dates
*/
disabledDate(fn: (current: Dayjs) => boolean): this;
/**
* Enable clear button
*/
allowClear(value?: boolean): this;
/**
* Render the range picker component
*/
render(): React.ReactNode;
}
//# sourceMappingURL=DatePicker.d.ts.map