aha-components 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,6 +3,10 @@ export interface DateRange {
3
3
  startDate: Date | null;
4
4
  endDate: Date | null;
5
5
  }
6
+ export interface PresetRange {
7
+ label: string;
8
+ range: DateRange;
9
+ }
6
10
  export interface DatePickerBaseProps {
7
11
  /** 是否禁用 */
8
12
  disabled?: boolean;
@@ -44,8 +48,8 @@ export interface DatePickerBaseProps {
44
48
  maxDate?: Date;
45
49
  /** 分隔符(范围模式) */
46
50
  separator?: string;
47
- /** 是否显示预设日期范围(仅在范围模式下有效) */
48
- presetRanges?: boolean;
51
+ /** 预设日期范围列表(仅在范围模式下有效) */
52
+ presetRanges?: PresetRange[] | boolean;
49
53
  /** 显示日历数量:1=单月,2=双月(仅在范围模式下有效,默认1) */
50
54
  calendarCount?: 1 | 2;
51
55
  /** 是否显示 Apply/Cancel 按钮(仅在范围模式下有效) */
package/dist/index.d.ts CHANGED
@@ -546,6 +546,10 @@ interface DateRange {
546
546
  startDate: Date | null;
547
547
  endDate: Date | null;
548
548
  }
549
+ interface PresetRange {
550
+ label: string;
551
+ range: DateRange;
552
+ }
549
553
  interface DatePickerBaseProps {
550
554
  /** 是否禁用 */
551
555
  disabled?: boolean;
@@ -587,8 +591,8 @@ interface DatePickerBaseProps {
587
591
  maxDate?: Date;
588
592
  /** 分隔符(范围模式) */
589
593
  separator?: string;
590
- /** 是否显示预设日期范围(仅在范围模式下有效) */
591
- presetRanges?: boolean;
594
+ /** 预设日期范围列表(仅在范围模式下有效) */
595
+ presetRanges?: PresetRange[] | boolean;
592
596
  /** 显示日历数量:1=单月,2=双月(仅在范围模式下有效,默认1) */
593
597
  calendarCount?: 1 | 2;
594
598
  /** 是否显示 Apply/Cancel 按钮(仅在范围模式下有效) */