@uzum-tech/ui 1.1.5 → 1.2.1

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.
Files changed (81) hide show
  1. package/README.md +1 -1
  2. package/dist/index.js +310 -353
  3. package/dist/index.prod.js +2 -2
  4. package/es/_utils/uzum/warn.js +3 -3
  5. package/es/alert/src/Alert.js +1 -1
  6. package/es/alert/src/styles/index.cssr.js +1 -1
  7. package/es/date-picker/src/DatePicker.d.ts +1 -0
  8. package/es/date-picker/src/DatePicker.js +10 -8
  9. package/es/date-picker/src/config.d.ts +1 -1
  10. package/es/date-picker/src/config.js +1 -1
  11. package/es/date-picker/src/interface.d.ts +7 -5
  12. package/es/date-picker/src/panel/date.d.ts +23 -8
  13. package/es/date-picker/src/panel/date.js +43 -18
  14. package/es/date-picker/src/panel/daterange.d.ts +18 -7
  15. package/es/date-picker/src/panel/daterange.js +95 -43
  16. package/es/date-picker/src/panel/datetime.d.ts +3 -1
  17. package/es/date-picker/src/panel/datetimerange.d.ts +2 -0
  18. package/es/date-picker/src/panel/panelHeader.d.ts +28 -7
  19. package/es/date-picker/src/panel/panelHeader.js +37 -13
  20. package/es/date-picker/src/panel/panelMonth.d.ts +16 -8
  21. package/es/date-picker/src/panel/panelMonth.js +8 -4
  22. package/es/date-picker/src/panel/panelMonthContent.d.ts +3 -1
  23. package/es/date-picker/src/panel/panelMonthContent.js +2 -5
  24. package/es/date-picker/src/panel/panelYear.d.ts +16 -8
  25. package/es/date-picker/src/panel/panelYear.js +8 -4
  26. package/es/date-picker/src/panel/panelYearContent.d.ts +3 -1
  27. package/es/date-picker/src/panel/panelYearContent.js +2 -1
  28. package/es/date-picker/src/panel/use-calendar.d.ts +4 -3
  29. package/es/date-picker/src/panel/use-dual-calendar.d.ts +1 -0
  30. package/es/date-picker/src/panel/use-panel-common.d.ts +2 -0
  31. package/es/date-picker/src/panel/use-panel-common.js +1 -0
  32. package/es/date-picker/src/styles/index.cssr.js +12 -10
  33. package/es/date-picker/src/utils.d.ts +3 -1
  34. package/es/date-picker/src/utils.js +13 -1
  35. package/es/grid/src/Grid.js +1 -1
  36. package/es/preset.d.ts +2 -2
  37. package/es/preset.js +3 -3
  38. package/es/version.d.ts +1 -1
  39. package/es/version.js +1 -1
  40. package/lib/_utils/uzum/warn.js +3 -3
  41. package/lib/alert/src/Alert.js +1 -1
  42. package/lib/alert/src/styles/index.cssr.js +1 -1
  43. package/lib/date-picker/src/DatePicker.d.ts +1 -0
  44. package/lib/date-picker/src/DatePicker.js +9 -7
  45. package/lib/date-picker/src/config.d.ts +1 -1
  46. package/lib/date-picker/src/config.js +1 -1
  47. package/lib/date-picker/src/interface.d.ts +7 -5
  48. package/lib/date-picker/src/panel/date.d.ts +23 -8
  49. package/lib/date-picker/src/panel/date.js +42 -17
  50. package/lib/date-picker/src/panel/daterange.d.ts +18 -7
  51. package/lib/date-picker/src/panel/daterange.js +94 -42
  52. package/lib/date-picker/src/panel/datetime.d.ts +3 -1
  53. package/lib/date-picker/src/panel/datetimerange.d.ts +2 -0
  54. package/lib/date-picker/src/panel/panelHeader.d.ts +28 -7
  55. package/lib/date-picker/src/panel/panelHeader.js +37 -13
  56. package/lib/date-picker/src/panel/panelMonth.d.ts +16 -8
  57. package/lib/date-picker/src/panel/panelMonth.js +8 -4
  58. package/lib/date-picker/src/panel/panelMonthContent.d.ts +3 -1
  59. package/lib/date-picker/src/panel/panelMonthContent.js +2 -5
  60. package/lib/date-picker/src/panel/panelYear.d.ts +16 -8
  61. package/lib/date-picker/src/panel/panelYear.js +8 -4
  62. package/lib/date-picker/src/panel/panelYearContent.d.ts +3 -1
  63. package/lib/date-picker/src/panel/panelYearContent.js +2 -1
  64. package/lib/date-picker/src/panel/use-calendar.d.ts +4 -3
  65. package/lib/date-picker/src/panel/use-dual-calendar.d.ts +1 -0
  66. package/lib/date-picker/src/panel/use-panel-common.d.ts +2 -0
  67. package/lib/date-picker/src/panel/use-panel-common.js +1 -0
  68. package/lib/date-picker/src/styles/index.cssr.js +12 -10
  69. package/lib/date-picker/src/utils.d.ts +3 -1
  70. package/lib/date-picker/src/utils.js +14 -1
  71. package/lib/grid/src/Grid.js +1 -1
  72. package/lib/preset.d.ts +2 -2
  73. package/lib/preset.js +3 -3
  74. package/lib/version.d.ts +1 -1
  75. package/lib/version.js +1 -1
  76. package/package.json +5 -6
  77. package/web-types.json +9 -9
  78. package/es/date-picker/src/panel/monthrange.d.ts +0 -1303
  79. package/es/date-picker/src/panel/monthrange.js +0 -117
  80. package/lib/date-picker/src/panel/monthrange.d.ts +0 -1303
  81. package/lib/date-picker/src/panel/monthrange.js +0 -119
@@ -1,4 +1,6 @@
1
1
  import { PropType } from 'vue';
2
+ import { OnPanelUpdateValue, PanelValue } from '../interface';
3
+ import { DateCommonItem } from '../utils';
2
4
  declare const _default: import("vue").DefineComponent<{
3
5
  mergedClsPrefix: {
4
6
  type: StringConstructor;
@@ -13,15 +15,24 @@ declare const _default: import("vue").DefineComponent<{
13
15
  type: StringConstructor;
14
16
  required: true;
15
17
  };
16
- onUpdateValue: {
17
- type: PropType<(value: number) => void>;
18
- required: true;
18
+ isMonth: {
19
+ type: BooleanConstructor;
20
+ value: boolean;
21
+ };
22
+ isYear: {
23
+ type: BooleanConstructor;
24
+ value: boolean;
19
25
  };
26
+ onUpdateValue: PropType<OnPanelUpdateValue>;
27
+ onUpdateMonth: PropType<OnPanelUpdateValue>;
28
+ onUpdateYear: PropType<OnPanelUpdateValue>;
20
29
  }, {
21
30
  monthPanelIsActive: import("vue").Ref<boolean>;
22
31
  yearPanelIsActive: import("vue").Ref<boolean>;
23
32
  onUpdateMonthPanelIsActive: (value: boolean) => void;
24
33
  onUpdateYearPanelIsActive: (value: boolean) => void;
34
+ handleUpdateMonth: (value: PanelValue, doUpdate: boolean, item?: DateCommonItem) => void;
35
+ handleUpdateYear: (value: PanelValue, doUpdate: boolean, item?: DateCommonItem) => void;
25
36
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
26
37
  mergedClsPrefix: {
27
38
  type: StringConstructor;
@@ -36,9 +47,19 @@ declare const _default: import("vue").DefineComponent<{
36
47
  type: StringConstructor;
37
48
  required: true;
38
49
  };
39
- onUpdateValue: {
40
- type: PropType<(value: number) => void>;
41
- required: true;
50
+ isMonth: {
51
+ type: BooleanConstructor;
52
+ value: boolean;
53
+ };
54
+ isYear: {
55
+ type: BooleanConstructor;
56
+ value: boolean;
42
57
  };
43
- }>>, {}, {}>;
58
+ onUpdateValue: PropType<OnPanelUpdateValue>;
59
+ onUpdateMonth: PropType<OnPanelUpdateValue>;
60
+ onUpdateYear: PropType<OnPanelUpdateValue>;
61
+ }>>, {
62
+ isMonth: boolean;
63
+ isYear: boolean;
64
+ }, {}>;
44
65
  export default _default;
@@ -16,14 +16,21 @@ export default defineComponent({
16
16
  type: String,
17
17
  required: true
18
18
  },
19
- onUpdateValue: {
20
- type: Function,
21
- required: true
22
- }
19
+ isMonth: {
20
+ type: Boolean,
21
+ value: false
22
+ },
23
+ isYear: {
24
+ type: Boolean,
25
+ value: false
26
+ },
27
+ onUpdateValue: Function,
28
+ onUpdateMonth: Function,
29
+ onUpdateYear: Function
23
30
  },
24
- setup() {
25
- const monthPanelIsActive = ref(false);
26
- const yearPanelIsActive = ref(false);
31
+ setup(props) {
32
+ const monthPanelIsActive = ref(props.isMonth);
33
+ const yearPanelIsActive = ref(props.isYear);
27
34
  function onUpdateMonthPanelIsActive(value) {
28
35
  monthPanelIsActive.value = value;
29
36
  if (value)
@@ -31,20 +38,37 @@ export default defineComponent({
31
38
  }
32
39
  function onUpdateYearPanelIsActive(value) {
33
40
  yearPanelIsActive.value = value;
34
- if (value)
41
+ if (value && !props.isMonth)
35
42
  monthPanelIsActive.value = false;
36
43
  }
44
+ function handleUpdateMonth(value, doUpdate, item) {
45
+ var _a, _b;
46
+ (_a = props.onUpdateMonth) === null || _a === void 0 ? void 0 : _a.call(props, value, doUpdate, item);
47
+ (_b = props.onUpdateValue) === null || _b === void 0 ? void 0 : _b.call(props, value, doUpdate, item);
48
+ }
49
+ function handleUpdateYear(value, doUpdate, item) {
50
+ var _a, _b;
51
+ (_a = props.onUpdateYear) === null || _a === void 0 ? void 0 : _a.call(props, value, doUpdate, item);
52
+ (_b = props.onUpdateValue) === null || _b === void 0 ? void 0 : _b.call(props, value, doUpdate, item);
53
+ }
37
54
  return {
38
55
  monthPanelIsActive,
39
56
  yearPanelIsActive,
40
57
  onUpdateMonthPanelIsActive,
41
- onUpdateYearPanelIsActive
58
+ onUpdateYearPanelIsActive,
59
+ handleUpdateMonth,
60
+ handleUpdateYear
42
61
  };
43
62
  },
44
63
  render() {
45
- const { mergedClsPrefix } = this;
46
- return (h("div", { class: `${mergedClsPrefix}-date-panel-month` },
47
- h(PanelMonth, { panelActive: this.monthPanelIsActive, value: this.value, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.calendarMonth, calendarYear: this.calendarYear, onUpdatePanelActive: this.onUpdateMonthPanelIsActive, onUpdateValue: this.onUpdateValue }),
48
- h(PanelYear, { panelActive: this.yearPanelIsActive, value: this.value, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.calendarMonth, calendarYear: this.calendarYear, onUpdatePanelActive: this.onUpdateYearPanelIsActive, onUpdateValue: this.onUpdateValue })));
64
+ const { mergedClsPrefix, isYear } = this;
65
+ return (h("div", { class: [
66
+ `${mergedClsPrefix}-date-panel-month`,
67
+ {
68
+ [`${mergedClsPrefix}-date-panel-month--justify-end`]: isYear
69
+ }
70
+ ] },
71
+ isYear ? null : (h(PanelMonth, { panelActive: this.monthPanelIsActive, value: this.value, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.calendarMonth, calendarYear: this.calendarYear, disabled: this.isMonth, onUpdatePanelActive: this.onUpdateMonthPanelIsActive, onUpdateValue: this.handleUpdateMonth })),
72
+ h(PanelYear, { panelActive: this.yearPanelIsActive, value: this.value, mergedClsPrefix: mergedClsPrefix, calendarMonth: this.calendarMonth, calendarYear: this.calendarYear, disabled: this.isYear, onUpdatePanelActive: this.onUpdateYearPanelIsActive, onUpdateValue: this.handleUpdateYear })));
49
73
  }
50
74
  });
@@ -1,4 +1,6 @@
1
1
  import { type PropType } from 'vue';
2
+ import { OnPanelUpdateValue, PanelValue } from '../interface';
3
+ import { DateCommonItem } from '../utils';
2
4
  declare const _default: import("vue").DefineComponent<{
3
5
  panelActive: BooleanConstructor;
4
6
  mergedClsPrefix: {
@@ -14,8 +16,9 @@ declare const _default: import("vue").DefineComponent<{
14
16
  type: StringConstructor;
15
17
  required: true;
16
18
  };
19
+ disabled: BooleanConstructor;
17
20
  onUpdateValue: {
18
- type: PropType<(value: number) => void>;
21
+ type: PropType<OnPanelUpdateValue>;
19
22
  required: true;
20
23
  };
21
24
  onUpdatePanelActive: PropType<(value: boolean) => void>;
@@ -30,6 +33,7 @@ declare const _default: import("vue").DefineComponent<{
30
33
  actions?: string[] | undefined;
31
34
  panel?: boolean | undefined;
32
35
  useAsQuickJump?: boolean | undefined;
36
+ readonly type?: import("../config").DatePickerType | undefined;
33
37
  key?: string | number | symbol | undefined;
34
38
  style?: unknown;
35
39
  class?: unknown;
@@ -80,7 +84,7 @@ declare const _default: import("vue").DefineComponent<{
80
84
  readonly onTabOut?: Function | undefined;
81
85
  readonly onClose?: import("../interface").OnClose | undefined;
82
86
  readonly onClear?: Function | undefined;
83
- readonly onUpdateValue: import("../interface").OnPanelUpdateValue;
87
+ readonly onUpdateValue: OnPanelUpdateValue;
84
88
  readonly onConfirm?: ((value: import("../interface").Value | null) => void) | undefined;
85
89
  readonly timeFormat?: string | undefined;
86
90
  readonly shortcuts?: import("../interface").Shortcuts | undefined;
@@ -107,6 +111,7 @@ declare const _default: import("vue").DefineComponent<{
107
111
  };
108
112
  active: BooleanConstructor;
109
113
  dateFormat: StringConstructor;
114
+ type: PropType<import("../config").DatePickerType>;
110
115
  timeFormat: {
111
116
  readonly type: StringConstructor;
112
117
  readonly value: "HH:mm:ss";
@@ -122,7 +127,7 @@ declare const _default: import("vue").DefineComponent<{
122
127
  onClose: PropType<import("../interface").OnClose>;
123
128
  onTabOut: FunctionConstructor;
124
129
  onUpdateValue: {
125
- readonly type: PropType<import("../interface").OnPanelUpdateValue>;
130
+ readonly type: PropType<OnPanelUpdateValue>;
126
131
  readonly required: true;
127
132
  };
128
133
  themeClass: StringConstructor;
@@ -132,7 +137,7 @@ declare const _default: import("vue").DefineComponent<{
132
137
  renderItem: (item: import("../utils").MonthItem, i: number, mergedClsPrefix: string) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
133
138
  [key: string]: any;
134
139
  }>;
135
- handleDateClick: (dateItem: import("../utils").DateItem | import("../utils").MonthItem | import("../utils").YearItem | import("../utils").QuarterItem) => void;
140
+ handleDateClick: (dateItem: DateCommonItem) => void;
136
141
  handleDateInputBlur: () => void;
137
142
  handleDateInput: (value: string) => void;
138
143
  handleTimePickerChange: (value: number | null) => void;
@@ -1350,6 +1355,7 @@ declare const _default: import("vue").DefineComponent<{
1350
1355
  };
1351
1356
  active: BooleanConstructor;
1352
1357
  dateFormat: StringConstructor;
1358
+ type: PropType<import("../config").DatePickerType>;
1353
1359
  timeFormat: {
1354
1360
  readonly type: StringConstructor;
1355
1361
  readonly value: "HH:mm:ss";
@@ -1365,7 +1371,7 @@ declare const _default: import("vue").DefineComponent<{
1365
1371
  onClose: PropType<import("../interface").OnClose>;
1366
1372
  onTabOut: FunctionConstructor;
1367
1373
  onUpdateValue: {
1368
- readonly type: PropType<import("../interface").OnPanelUpdateValue>;
1374
+ readonly type: PropType<OnPanelUpdateValue>;
1369
1375
  readonly required: true;
1370
1376
  };
1371
1377
  themeClass: StringConstructor;
@@ -1375,7 +1381,7 @@ declare const _default: import("vue").DefineComponent<{
1375
1381
  renderItem: (item: import("../utils").MonthItem, i: number, mergedClsPrefix: string) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
1376
1382
  [key: string]: any;
1377
1383
  }>;
1378
- handleDateClick: (dateItem: import("../utils").DateItem | import("../utils").MonthItem | import("../utils").YearItem | import("../utils").QuarterItem) => void;
1384
+ handleDateClick: (dateItem: DateCommonItem) => void;
1379
1385
  handleDateInputBlur: () => void;
1380
1386
  handleDateInput: (value: string) => void;
1381
1387
  handleTimePickerChange: (value: number | null) => void;
@@ -2561,7 +2567,7 @@ declare const _default: import("vue").DefineComponent<{
2561
2567
  handleSingleShortcutClick: (shortcut: number | [number, number] | (() => number) | readonly [number, number] | (() => [number, number] | readonly [number, number])) => void;
2562
2568
  }> & {} & import("vue").ComponentCustomProperties & {}) | null>;
2563
2569
  handleHeaderClick: () => void;
2564
- handleUpdateValue: (value: number) => void;
2570
+ handleUpdateValue: (value: PanelValue, doUpdate: boolean, item?: DateCommonItem) => void;
2565
2571
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
2566
2572
  panelActive: BooleanConstructor;
2567
2573
  mergedClsPrefix: {
@@ -2577,12 +2583,14 @@ declare const _default: import("vue").DefineComponent<{
2577
2583
  type: StringConstructor;
2578
2584
  required: true;
2579
2585
  };
2586
+ disabled: BooleanConstructor;
2580
2587
  onUpdateValue: {
2581
- type: PropType<(value: number) => void>;
2588
+ type: PropType<OnPanelUpdateValue>;
2582
2589
  required: true;
2583
2590
  };
2584
2591
  onUpdatePanelActive: PropType<(value: boolean) => void>;
2585
2592
  }>>, {
2593
+ disabled: boolean;
2586
2594
  panelActive: boolean;
2587
2595
  }, {}>;
2588
2596
  export default _default;
@@ -18,6 +18,7 @@ export default defineComponent({
18
18
  type: String,
19
19
  required: true
20
20
  },
21
+ disabled: Boolean,
21
22
  onUpdateValue: {
22
23
  type: Function,
23
24
  required: true
@@ -34,10 +35,12 @@ export default defineComponent({
34
35
  }
35
36
  });
36
37
  function handleHeaderClick() {
38
+ if (props.disabled)
39
+ return;
37
40
  showRef.value = !showRef.value;
38
41
  }
39
- function handleUpdateValue(value) {
40
- props.onUpdateValue(value);
42
+ function handleUpdateValue(value, doUpdate, item) {
43
+ props.onUpdateValue(value, doUpdate, item);
41
44
  handleHeaderClick();
42
45
  }
43
46
  return {
@@ -48,11 +51,12 @@ export default defineComponent({
48
51
  };
49
52
  },
50
53
  render() {
51
- const { mergedClsPrefix } = this;
54
+ const { mergedClsPrefix, disabled } = this;
52
55
  return (h("div", { class: `${mergedClsPrefix}-date-panel-month__month-year` },
53
56
  h("div", { class: [
54
57
  `${mergedClsPrefix}-date-panel-month__text`,
55
- this.show && `${mergedClsPrefix}-date-panel-month__text--active`
58
+ this.show && `${mergedClsPrefix}-date-panel-month__text--active`,
59
+ disabled && `${mergedClsPrefix}-date-panel-month__text--disabled`
56
60
  ], onClick: this.handleHeaderClick },
57
61
  this.calendarMonth,
58
62
  h(UBaseIcon, { class: `${mergedClsPrefix}-date-panel-month__icon`, clsPrefix: mergedClsPrefix }, {
@@ -14,6 +14,7 @@ declare const _default: import("vue").DefineComponent<{
14
14
  };
15
15
  active: BooleanConstructor;
16
16
  dateFormat: StringConstructor;
17
+ type: import("vue").PropType<import("../config").DatePickerType>;
17
18
  timeFormat: {
18
19
  readonly type: StringConstructor;
19
20
  readonly value: "HH:mm:ss";
@@ -37,7 +38,7 @@ declare const _default: import("vue").DefineComponent<{
37
38
  panel: BooleanConstructor;
38
39
  }, {
39
40
  renderItem: (item: MonthItem, i: number, mergedClsPrefix: string) => VNode;
40
- handleDateClick: (dateItem: import("../utils").DateItem | MonthItem | import("../utils").YearItem | import("../utils").QuarterItem) => void;
41
+ handleDateClick: (dateItem: import("../utils").DateCommonItem) => void;
41
42
  handleDateInputBlur: () => void;
42
43
  handleDateInput: (value: string) => void;
43
44
  handleTimePickerChange: (value: number | null) => void;
@@ -1235,6 +1236,7 @@ declare const _default: import("vue").DefineComponent<{
1235
1236
  };
1236
1237
  active: BooleanConstructor;
1237
1238
  dateFormat: StringConstructor;
1239
+ type: import("vue").PropType<import("../config").DatePickerType>;
1238
1240
  timeFormat: {
1239
1241
  readonly type: StringConstructor;
1240
1242
  readonly value: "HH:mm:ss";
@@ -30,7 +30,7 @@ export default defineComponent({
30
30
  useAsQuickJump
31
31
  ? handleQuickMonthClick(item, (value) => {
32
32
  ;
33
- props.onUpdateValue(value, false);
33
+ props.onUpdateValue(value, false, item);
34
34
  })
35
35
  : handleDateClick(item);
36
36
  } }, getRenderContent(item)));
@@ -49,10 +49,7 @@ export default defineComponent({
49
49
  this.themeClass
50
50
  ], onFocus: this.handlePanelFocus, onKeydown: this.handlePanelKeyDown },
51
51
  h("div", { class: `${mergedClsPrefix}-date-panel-month-calendar` }, {
52
- default: () => [
53
- this.monthArray.map((item, i) => renderItem(item, i, mergedClsPrefix)),
54
- h("div", { class: `${mergedClsPrefix}-date-panel-month-calendar__padding` })
55
- ]
52
+ default: () => this.monthArray.map((item, i) => renderItem(item, i, mergedClsPrefix))
56
53
  }),
57
54
  h(UBaseFocusDetector, { onFocus: this.handleFocusDetectorFocus })));
58
55
  }
@@ -1,4 +1,6 @@
1
1
  import { type PropType } from 'vue';
2
+ import { OnPanelUpdateValue, PanelValue } from '../interface';
3
+ import { DateCommonItem } from '../utils';
2
4
  declare const _default: import("vue").DefineComponent<{
3
5
  panelActive: BooleanConstructor;
4
6
  mergedClsPrefix: {
@@ -14,8 +16,9 @@ declare const _default: import("vue").DefineComponent<{
14
16
  type: StringConstructor;
15
17
  required: true;
16
18
  };
19
+ disabled: BooleanConstructor;
17
20
  onUpdateValue: {
18
- type: PropType<(value: number) => void>;
21
+ type: PropType<OnPanelUpdateValue>;
19
22
  required: true;
20
23
  };
21
24
  onUpdatePanelActive: PropType<(value: boolean) => void>;
@@ -30,6 +33,7 @@ declare const _default: import("vue").DefineComponent<{
30
33
  actions?: string[] | undefined;
31
34
  panel?: boolean | undefined;
32
35
  useAsQuickJump?: boolean | undefined;
36
+ readonly type?: import("../config").DatePickerType | undefined;
33
37
  key?: string | number | symbol | undefined;
34
38
  style?: unknown;
35
39
  class?: unknown;
@@ -80,7 +84,7 @@ declare const _default: import("vue").DefineComponent<{
80
84
  readonly onTabOut?: Function | undefined;
81
85
  readonly onClose?: import("../interface").OnClose | undefined;
82
86
  readonly onClear?: Function | undefined;
83
- readonly onUpdateValue: import("../interface").OnPanelUpdateValue;
87
+ readonly onUpdateValue: OnPanelUpdateValue;
84
88
  readonly onConfirm?: ((value: import("../interface").Value | null) => void) | undefined;
85
89
  readonly timeFormat?: string | undefined;
86
90
  readonly shortcuts?: import("../interface").Shortcuts | undefined;
@@ -107,6 +111,7 @@ declare const _default: import("vue").DefineComponent<{
107
111
  };
108
112
  active: BooleanConstructor;
109
113
  dateFormat: StringConstructor;
114
+ type: PropType<import("../config").DatePickerType>;
110
115
  timeFormat: {
111
116
  readonly type: StringConstructor;
112
117
  readonly value: "HH:mm:ss";
@@ -122,7 +127,7 @@ declare const _default: import("vue").DefineComponent<{
122
127
  onClose: PropType<import("../interface").OnClose>;
123
128
  onTabOut: FunctionConstructor;
124
129
  onUpdateValue: {
125
- readonly type: PropType<import("../interface").OnPanelUpdateValue>;
130
+ readonly type: PropType<OnPanelUpdateValue>;
126
131
  readonly required: true;
127
132
  };
128
133
  themeClass: StringConstructor;
@@ -132,7 +137,7 @@ declare const _default: import("vue").DefineComponent<{
132
137
  renderItem: (item: import("../utils").YearItem, i: number, mergedClsPrefix: string) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
133
138
  [key: string]: any;
134
139
  }>;
135
- handleDateClick: (dateItem: import("../utils").DateItem | import("../utils").MonthItem | import("../utils").YearItem | import("../utils").QuarterItem) => void;
140
+ handleDateClick: (dateItem: DateCommonItem) => void;
136
141
  handleDateInputBlur: () => void;
137
142
  handleDateInput: (value: string) => void;
138
143
  handleTimePickerChange: (value: number | null) => void;
@@ -1350,6 +1355,7 @@ declare const _default: import("vue").DefineComponent<{
1350
1355
  };
1351
1356
  active: BooleanConstructor;
1352
1357
  dateFormat: StringConstructor;
1358
+ type: PropType<import("../config").DatePickerType>;
1353
1359
  timeFormat: {
1354
1360
  readonly type: StringConstructor;
1355
1361
  readonly value: "HH:mm:ss";
@@ -1365,7 +1371,7 @@ declare const _default: import("vue").DefineComponent<{
1365
1371
  onClose: PropType<import("../interface").OnClose>;
1366
1372
  onTabOut: FunctionConstructor;
1367
1373
  onUpdateValue: {
1368
- readonly type: PropType<import("../interface").OnPanelUpdateValue>;
1374
+ readonly type: PropType<OnPanelUpdateValue>;
1369
1375
  readonly required: true;
1370
1376
  };
1371
1377
  themeClass: StringConstructor;
@@ -1375,7 +1381,7 @@ declare const _default: import("vue").DefineComponent<{
1375
1381
  renderItem: (item: import("../utils").YearItem, i: number, mergedClsPrefix: string) => import("vue").VNode<import("vue").RendererNode, import("vue").RendererElement, {
1376
1382
  [key: string]: any;
1377
1383
  }>;
1378
- handleDateClick: (dateItem: import("../utils").DateItem | import("../utils").MonthItem | import("../utils").YearItem | import("../utils").QuarterItem) => void;
1384
+ handleDateClick: (dateItem: DateCommonItem) => void;
1379
1385
  handleDateInputBlur: () => void;
1380
1386
  handleDateInput: (value: string) => void;
1381
1387
  handleTimePickerChange: (value: number | null) => void;
@@ -2561,7 +2567,7 @@ declare const _default: import("vue").DefineComponent<{
2561
2567
  handleSingleShortcutClick: (shortcut: number | [number, number] | (() => number) | readonly [number, number] | (() => [number, number] | readonly [number, number])) => void;
2562
2568
  }> & {} & import("vue").ComponentCustomProperties & {}) | null>;
2563
2569
  handleHeaderClick: () => void;
2564
- handleUpdateValue: (value: number) => void;
2570
+ handleUpdateValue: (value: PanelValue, doUpdate: boolean, item?: DateCommonItem) => void;
2565
2571
  }, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
2566
2572
  panelActive: BooleanConstructor;
2567
2573
  mergedClsPrefix: {
@@ -2577,12 +2583,14 @@ declare const _default: import("vue").DefineComponent<{
2577
2583
  type: StringConstructor;
2578
2584
  required: true;
2579
2585
  };
2586
+ disabled: BooleanConstructor;
2580
2587
  onUpdateValue: {
2581
- type: PropType<(value: number) => void>;
2588
+ type: PropType<OnPanelUpdateValue>;
2582
2589
  required: true;
2583
2590
  };
2584
2591
  onUpdatePanelActive: PropType<(value: boolean) => void>;
2585
2592
  }>>, {
2593
+ disabled: boolean;
2586
2594
  panelActive: boolean;
2587
2595
  }, {}>;
2588
2596
  export default _default;
@@ -18,6 +18,7 @@ export default defineComponent({
18
18
  type: String,
19
19
  required: true
20
20
  },
21
+ disabled: Boolean,
21
22
  onUpdateValue: {
22
23
  type: Function,
23
24
  required: true
@@ -34,10 +35,12 @@ export default defineComponent({
34
35
  }
35
36
  });
36
37
  function handleHeaderClick() {
38
+ if (props.disabled)
39
+ return;
37
40
  showRef.value = !showRef.value;
38
41
  }
39
- function handleUpdateValue(value) {
40
- props.onUpdateValue(value);
42
+ function handleUpdateValue(value, doUpdate, item) {
43
+ props.onUpdateValue(value, doUpdate, item);
41
44
  handleHeaderClick();
42
45
  }
43
46
  return {
@@ -48,11 +51,12 @@ export default defineComponent({
48
51
  };
49
52
  },
50
53
  render() {
51
- const { mergedClsPrefix } = this;
54
+ const { mergedClsPrefix, disabled } = this;
52
55
  return (h("div", { class: `${mergedClsPrefix}-date-panel-month__month-year`, ref: "triggerRef" },
53
56
  h("div", { class: [
54
57
  `${mergedClsPrefix}-date-panel-month__text`,
55
- this.show && `${mergedClsPrefix}-date-panel-month__text--active`
58
+ this.show && `${mergedClsPrefix}-date-panel-month__text--active`,
59
+ disabled && `${mergedClsPrefix}-date-panel-month__text--disabled`
56
60
  ], onClick: this.handleHeaderClick },
57
61
  this.calendarYear,
58
62
  h(UBaseIcon, { class: `${mergedClsPrefix}-date-panel-month__icon`, clsPrefix: mergedClsPrefix }, {
@@ -14,6 +14,7 @@ declare const _default: import("vue").DefineComponent<{
14
14
  };
15
15
  active: BooleanConstructor;
16
16
  dateFormat: StringConstructor;
17
+ type: import("vue").PropType<import("../config").DatePickerType>;
17
18
  timeFormat: {
18
19
  readonly type: StringConstructor;
19
20
  readonly value: "HH:mm:ss";
@@ -37,7 +38,7 @@ declare const _default: import("vue").DefineComponent<{
37
38
  panel: BooleanConstructor;
38
39
  }, {
39
40
  renderItem: (item: YearItem, i: number, mergedClsPrefix: string) => VNode;
40
- handleDateClick: (dateItem: import("../utils").DateItem | import("../utils").MonthItem | YearItem | import("../utils").QuarterItem) => void;
41
+ handleDateClick: (dateItem: import("../utils").DateCommonItem) => void;
41
42
  handleDateInputBlur: () => void;
42
43
  handleDateInput: (value: string) => void;
43
44
  handleTimePickerChange: (value: number | null) => void;
@@ -1247,6 +1248,7 @@ declare const _default: import("vue").DefineComponent<{
1247
1248
  };
1248
1249
  active: BooleanConstructor;
1249
1250
  dateFormat: StringConstructor;
1251
+ type: import("vue").PropType<import("../config").DatePickerType>;
1250
1252
  timeFormat: {
1251
1253
  readonly type: StringConstructor;
1252
1254
  readonly value: "HH:mm:ss";
@@ -27,7 +27,7 @@ export default defineComponent({
27
27
  useAsQuickJump
28
28
  ? handleQuickMonthClick(item, (value) => {
29
29
  ;
30
- props.onUpdateValue(value, false);
30
+ props.onUpdateValue(value, false, item);
31
31
  })
32
32
  : handleDateClick(item);
33
33
  } }, getRenderContent(item)));
@@ -43,6 +43,7 @@ export default defineComponent({
43
43
  return (h("div", { ref: "selfRef", tabindex: 0, class: [
44
44
  `${mergedClsPrefix}-date-panel`,
45
45
  `${mergedClsPrefix}-date-panel--month`,
46
+ `${mergedClsPrefix}-date-panel--year`,
46
47
  this.themeClass
47
48
  ], onFocus: this.handlePanelFocus, onKeydown: this.handlePanelKeyDown },
48
49
  h(UScrollbar, { ref: "yearScrollbarRef", theme: mergedTheme.peers.Scrollbar, themeOverrides: mergedTheme.peerOverrides.Scrollbar, horizontalRailStyle: { zIndex: 1 }, verticalRailStyle: { zIndex: 1 } }, {
@@ -2,7 +2,7 @@ import { type ExtractPropTypes, type PropType } from 'vue';
2
2
  import type { VirtualListInst } from 'vueuc';
3
3
  import type { ScrollbarInst } from '../../../_internal';
4
4
  import type { Shortcuts } from '../interface';
5
- import type { DateItem, MonthItem, YearItem, QuarterItem } from '../utils';
5
+ import type { MonthItem, YearItem, QuarterItem, DateCommonItem } from '../utils';
6
6
  declare const useCalendarProps: {
7
7
  readonly actions: {
8
8
  readonly type: PropType<string[]>;
@@ -10,6 +10,7 @@ declare const useCalendarProps: {
10
10
  };
11
11
  readonly active: BooleanConstructor;
12
12
  readonly dateFormat: StringConstructor;
13
+ readonly type: PropType<import("../config").DatePickerType>;
13
14
  readonly timeFormat: {
14
15
  readonly type: StringConstructor;
15
16
  readonly value: "HH:mm:ss";
@@ -33,7 +34,7 @@ declare const useCalendarProps: {
33
34
  readonly panel: BooleanConstructor;
34
35
  };
35
36
  declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, type: 'date' | 'datetime' | 'month' | 'year' | 'quarter'): {
36
- handleDateClick: (dateItem: DateItem | MonthItem | YearItem | QuarterItem) => void;
37
+ handleDateClick: (dateItem: DateCommonItem) => void;
37
38
  handleDateInputBlur: () => void;
38
39
  handleDateInput: (value: string) => void;
39
40
  handleTimePickerChange: (value: number | null) => void;
@@ -1201,7 +1202,7 @@ declare function useCalendar(props: ExtractPropTypes<typeof useCalendarProps>, t
1201
1202
  isHourDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsHourDisabled | undefined>;
1202
1203
  isMinuteDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsMinuteDisabled | undefined>;
1203
1204
  isSecondDisabled: import("vue").ComputedRef<import("../../../time-picker/src/interface").IsSecondDisabled | undefined>;
1204
- dateArray: import("vue").ComputedRef<DateItem[]>;
1205
+ dateArray: import("vue").ComputedRef<import("../utils").DateItem[]>;
1205
1206
  monthArray: import("vue").ComputedRef<MonthItem[]>;
1206
1207
  yearArray: import("vue").ComputedRef<YearItem[]>;
1207
1208
  quarterArray: import("vue").ComputedRef<QuarterItem[]>;
@@ -13,6 +13,7 @@ declare const useDualCalendarProps: {
13
13
  };
14
14
  readonly active: BooleanConstructor;
15
15
  readonly dateFormat: StringConstructor;
16
+ readonly type: import("vue").PropType<import("../config").DatePickerType>;
16
17
  readonly timeFormat: {
17
18
  readonly type: StringConstructor;
18
19
  readonly value: "HH:mm:ss";
@@ -1,8 +1,10 @@
1
1
  import { type PropType, type ExtractPropTypes } from 'vue';
2
2
  import { type Value, type OnPanelUpdateValue, type OnClose, type Shortcuts, type DefaultTime } from '../interface';
3
+ import { DatePickerType } from '../config';
3
4
  declare const usePanelCommonProps: {
4
5
  readonly active: BooleanConstructor;
5
6
  readonly dateFormat: StringConstructor;
7
+ readonly type: PropType<DatePickerType>;
6
8
  readonly timeFormat: {
7
9
  readonly type: StringConstructor;
8
10
  readonly value: "HH:mm:ss";
@@ -5,6 +5,7 @@ const TIME_FORMAT = 'HH:mm:ss';
5
5
  const usePanelCommonProps = {
6
6
  active: Boolean,
7
7
  dateFormat: String,
8
+ type: String,
8
9
  timeFormat: {
9
10
  type: String,
10
11
  value: TIME_FORMAT
@@ -168,6 +168,8 @@ export default c([cB('date-picker', `
168
168
  margin: 0,
169
169
  padding: '15px 16px',
170
170
  boxSizing: 'border-box'
171
+ }), cM('year', {
172
+ zIndex: '2'
171
173
  }), cB('date-panel-footer', {
172
174
  gridArea: 'footer'
173
175
  }), cB('date-panel-actions', {
@@ -190,21 +192,20 @@ export default c([cB('date-picker', `
190
192
  zIndex: 1
191
193
  })]), c('~ .u-date-panel-calendar', {
192
194
  paddingTop: '16px'
193
- })]), cB('date-panel-month', {
195
+ })]), cB('date-panel-placeholder', {
196
+ width: '266px',
197
+ height: '250px'
198
+ }), cB('date-panel-month', {
194
199
  boxSizing: 'border-box',
195
200
  display: 'flex',
196
201
  alignItems: 'center',
197
202
  justifyContent: 'space-between',
198
203
  padding: 'var(--u-calendar-title-padding)',
199
204
  height: 'var(--u-calendar-title-height)'
200
- }, [cE('icon', `
205
+ }, [cM('justify-end', {
206
+ justifyContent: 'end'
207
+ }), cE('icon', `
201
208
  font-size: var(--u-arrow-size);
202
- `), cE('prev, next, fast-prev, fast-next', `
203
- line-height: 0;
204
- cursor: pointer;
205
- width: var(--u-arrow-size);
206
- height: var(--u-arrow-size);
207
- color: var(--u-arrow-color);
208
209
  `), cE('month-year', {
209
210
  userSelect: 'none',
210
211
  '-webkit-user-select': 'none'
@@ -217,10 +218,11 @@ export default c([cB('date-picker', `
217
218
  padding: 6px 8px;
218
219
  text-align: center;
219
220
  color: var(--u-calendar-title-text-color);
220
- cursor: pointer;
221
221
  transition: .3s var(--u-bezier);
222
222
  border-radius: var(--u-panel-border-radius);
223
- `, [c('.u-icon', {
223
+ `, [cNotM('disabled', {
224
+ cursor: 'pointer'
225
+ }), c('.u-icon', {
224
226
  width: '24px',
225
227
  transition: 'transform .3s var(--u-bezier)'
226
228
  }), cM('active', `
@@ -45,6 +45,7 @@ export interface QuarterItem {
45
45
  selected: boolean;
46
46
  ts: number;
47
47
  }
48
+ export type DateCommonItem = DateItem | MonthItem | YearItem | QuarterItem;
48
49
  /**
49
50
  * Given time to display calendar, given the selected time, given current time,
50
51
  * return the date array of display time's month.
@@ -62,4 +63,5 @@ declare function getDefaultTime(timeValue: string | undefined): {
62
63
  seconds: number;
63
64
  } | undefined;
64
65
  declare function pluckValueFromRange(value: Value | null, type: 'start' | 'end'): number | null;
65
- export { dateArray, monthArray, yearArray, quarterArray, strictParse, getDerivedTimeFromKeyboardEvent, getDefaultTime, pluckValueFromRange };
66
+ declare function getMsByDateCommonItem(item?: DateCommonItem): number;
67
+ export { dateArray, monthArray, yearArray, quarterArray, strictParse, getDerivedTimeFromKeyboardEvent, getDefaultTime, getMsByDateCommonItem, pluckValueFromRange };