@v-c/picker 0.0.7 → 1.0.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 (144) hide show
  1. package/package.json +11 -11
  2. package/dist/PickerInput/Popup/Footer.cjs +0 -115
  3. package/dist/PickerInput/Popup/PopupPanel.cjs +0 -413
  4. package/dist/PickerInput/Popup/PresetPanel.cjs +0 -54
  5. package/dist/PickerInput/Popup/index.cjs +0 -526
  6. package/dist/PickerInput/RangePicker.cjs +0 -1911
  7. package/dist/PickerInput/Selector/Icon.cjs +0 -89
  8. package/dist/PickerInput/Selector/Input.cjs +0 -376
  9. package/dist/PickerInput/Selector/MaskFormat.cjs +0 -72
  10. package/dist/PickerInput/Selector/RangeSelector.cjs +0 -1393
  11. package/dist/PickerInput/Selector/SingleSelector/MultipleDates.cjs +0 -110
  12. package/dist/PickerInput/Selector/SingleSelector/index.cjs +0 -1361
  13. package/dist/PickerInput/Selector/hooks/useClearIcon.cjs +0 -17
  14. package/dist/PickerInput/Selector/hooks/useInputHooks.cjs +0 -125
  15. package/dist/PickerInput/Selector/hooks/useRootProps.cjs +0 -14
  16. package/dist/PickerInput/Selector/util.cjs +0 -32
  17. package/dist/PickerInput/SinglePicker.cjs +0 -1881
  18. package/dist/PickerInput/context.cjs +0 -12
  19. package/dist/PickerInput/hooks/useCellRender.cjs +0 -25
  20. package/dist/PickerInput/hooks/useDelayState.cjs +0 -37
  21. package/dist/PickerInput/hooks/useDisabledBoundary.cjs +0 -15
  22. package/dist/PickerInput/hooks/useFieldFormat.cjs +0 -17
  23. package/dist/PickerInput/hooks/useFieldsInvalidate.cjs +0 -24
  24. package/dist/PickerInput/hooks/useFilledProps.cjs +0 -103
  25. package/dist/PickerInput/hooks/useInputReadOnly.cjs +0 -13
  26. package/dist/PickerInput/hooks/useInvalidate.cjs +0 -34
  27. package/dist/PickerInput/hooks/useLockEffect.cjs +0 -16
  28. package/dist/PickerInput/hooks/useOpen.cjs +0 -15
  29. package/dist/PickerInput/hooks/usePresets.cjs +0 -21
  30. package/dist/PickerInput/hooks/useRangeActive.cjs +0 -57
  31. package/dist/PickerInput/hooks/useRangeDisabledDate.cjs +0 -21
  32. package/dist/PickerInput/hooks/useRangePickerValue.cjs +0 -100
  33. package/dist/PickerInput/hooks/useRangeValue.cjs +0 -135
  34. package/dist/PickerInput/hooks/useShowNow.cjs +0 -15
  35. package/dist/PickerPanel/DatePanel/index.cjs +0 -294
  36. package/dist/PickerPanel/DateTimePanel/index.cjs +0 -180
  37. package/dist/PickerPanel/DecadePanel/index.cjs +0 -230
  38. package/dist/PickerPanel/MonthPanel/index.cjs +0 -219
  39. package/dist/PickerPanel/PanelBody.cjs +0 -157
  40. package/dist/PickerPanel/PanelHeader.cjs +0 -132
  41. package/dist/PickerPanel/QuarterPanel/index.cjs +0 -211
  42. package/dist/PickerPanel/TimePanel/TimePanelBody/TimeColumn.cjs +0 -145
  43. package/dist/PickerPanel/TimePanel/TimePanelBody/index.cjs +0 -286
  44. package/dist/PickerPanel/TimePanel/TimePanelBody/useScrollTo.cjs +0 -65
  45. package/dist/PickerPanel/TimePanel/index.cjs +0 -173
  46. package/dist/PickerPanel/WeekPanel/index.cjs +0 -179
  47. package/dist/PickerPanel/YearPanel/index.cjs +0 -239
  48. package/dist/PickerPanel/context.cjs +0 -61
  49. package/dist/PickerPanel/index.cjs +0 -473
  50. package/dist/PickerTrigger/index.cjs +0 -139
  51. package/dist/PickerTrigger/util.cjs +0 -13
  52. package/dist/_virtual/rolldown_runtime.cjs +0 -21
  53. package/dist/generate/dateFns.cjs +0 -80
  54. package/dist/generate/dayjs.cjs +0 -117
  55. package/dist/generate/index.cjs +0 -1
  56. package/dist/generate/luxon.cjs +0 -75
  57. package/dist/generate/moment.cjs +0 -107
  58. package/dist/hooks/useLocale.cjs +0 -45
  59. package/dist/hooks/useSemantic.cjs +0 -18
  60. package/dist/hooks/useSyncState.cjs +0 -29
  61. package/dist/hooks/useTimeConfig.cjs +0 -161
  62. package/dist/hooks/useTimeInfo.cjs +0 -114
  63. package/dist/hooks/useToggleDates.cjs +0 -16
  64. package/dist/index.cjs +0 -12
  65. package/dist/interface.cjs +0 -1
  66. package/dist/locale/am_ET.cjs +0 -34
  67. package/dist/locale/ar_EG.cjs +0 -32
  68. package/dist/locale/az_AZ.cjs +0 -33
  69. package/dist/locale/bg_BG.cjs +0 -32
  70. package/dist/locale/bn_BD.cjs +0 -33
  71. package/dist/locale/by_BY.cjs +0 -33
  72. package/dist/locale/ca_ES.cjs +0 -32
  73. package/dist/locale/common.cjs +0 -8
  74. package/dist/locale/cs_CZ.cjs +0 -32
  75. package/dist/locale/da_DK.cjs +0 -32
  76. package/dist/locale/de_DE.cjs +0 -32
  77. package/dist/locale/el_GR.cjs +0 -32
  78. package/dist/locale/en_GB.cjs +0 -32
  79. package/dist/locale/en_US.cjs +0 -33
  80. package/dist/locale/es_ES.cjs +0 -32
  81. package/dist/locale/es_MX.cjs +0 -33
  82. package/dist/locale/et_EE.cjs +0 -32
  83. package/dist/locale/eu_ES.cjs +0 -34
  84. package/dist/locale/fa_IR.cjs +0 -32
  85. package/dist/locale/fi_FI.cjs +0 -32
  86. package/dist/locale/fr_BE.cjs +0 -32
  87. package/dist/locale/fr_CA.cjs +0 -33
  88. package/dist/locale/fr_FR.cjs +0 -33
  89. package/dist/locale/ga_IE.cjs +0 -33
  90. package/dist/locale/gl_ES.cjs +0 -32
  91. package/dist/locale/he_IL.cjs +0 -33
  92. package/dist/locale/hi_IN.cjs +0 -33
  93. package/dist/locale/hr_HR.cjs +0 -33
  94. package/dist/locale/hu_HU.cjs +0 -33
  95. package/dist/locale/id_ID.cjs +0 -33
  96. package/dist/locale/is_IS.cjs +0 -32
  97. package/dist/locale/it_IT.cjs +0 -55
  98. package/dist/locale/ja_JP.cjs +0 -35
  99. package/dist/locale/ka_GE.cjs +0 -33
  100. package/dist/locale/kk_KZ.cjs +0 -32
  101. package/dist/locale/km_KH.cjs +0 -34
  102. package/dist/locale/kmr_IQ.cjs +0 -32
  103. package/dist/locale/kn_IN.cjs +0 -33
  104. package/dist/locale/ko_KR.cjs +0 -34
  105. package/dist/locale/lt_LT.cjs +0 -34
  106. package/dist/locale/lv_LV.cjs +0 -32
  107. package/dist/locale/mk_MK.cjs +0 -32
  108. package/dist/locale/ml_IN.cjs +0 -33
  109. package/dist/locale/mn_MN.cjs +0 -34
  110. package/dist/locale/mr_IN.cjs +0 -59
  111. package/dist/locale/ms_MY.cjs +0 -34
  112. package/dist/locale/my_MM.cjs +0 -33
  113. package/dist/locale/nb_NO.cjs +0 -34
  114. package/dist/locale/ne_NP.cjs +0 -33
  115. package/dist/locale/nl_BE.cjs +0 -32
  116. package/dist/locale/nl_NL.cjs +0 -32
  117. package/dist/locale/pl_PL.cjs +0 -32
  118. package/dist/locale/pt_BR.cjs +0 -56
  119. package/dist/locale/pt_PT.cjs +0 -55
  120. package/dist/locale/ro_RO.cjs +0 -33
  121. package/dist/locale/ru_RU.cjs +0 -32
  122. package/dist/locale/si_LK.cjs +0 -34
  123. package/dist/locale/sk_SK.cjs +0 -32
  124. package/dist/locale/sl_SI.cjs +0 -32
  125. package/dist/locale/sr_Cyrl_RS.cjs +0 -32
  126. package/dist/locale/sr_RS.cjs +0 -32
  127. package/dist/locale/sv_SE.cjs +0 -32
  128. package/dist/locale/ta_IN.cjs +0 -33
  129. package/dist/locale/te_IN.cjs +0 -33
  130. package/dist/locale/th_TH.cjs +0 -32
  131. package/dist/locale/tk_TK.cjs +0 -32
  132. package/dist/locale/tr_TR.cjs +0 -55
  133. package/dist/locale/ug_CN.cjs +0 -35
  134. package/dist/locale/uk_UA.cjs +0 -32
  135. package/dist/locale/ur_PK.cjs +0 -33
  136. package/dist/locale/uz_UZ.cjs +0 -33
  137. package/dist/locale/vi_VN.cjs +0 -33
  138. package/dist/locale/zh_CN.cjs +0 -36
  139. package/dist/locale/zh_TW.cjs +0 -36
  140. package/dist/utils/dateUtil.cjs +0 -105
  141. package/dist/utils/getClearIcon.cjs +0 -7
  142. package/dist/utils/miscUtil.cjs +0 -46
  143. package/dist/utils/uiUtil.cjs +0 -6
  144. package/dist/utils/warnUtil.cjs +0 -8
@@ -1,219 +0,0 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_rolldown_runtime = require("../../_virtual/rolldown_runtime.cjs");
6
- const require_dateUtil = require("../../utils/dateUtil.cjs");
7
- const require_context = require("../context.cjs");
8
- const require_PanelBody = require("../PanelBody.cjs");
9
- const require_PanelHeader = require("../PanelHeader.cjs");
10
- let vue = require("vue");
11
- function _isSlot(s) {
12
- return typeof s === "function" || Object.prototype.toString.call(s) === "[object Object]" && !(0, vue.isVNode)(s);
13
- }
14
- var MonthPanel = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
15
- const sharedContext = require_context.useSharedPanelContext();
16
- require_context.providePanelContext((0, vue.computed)(() => {
17
- const [info] = require_context.useInfo(props, "month", sharedContext);
18
- return info;
19
- }));
20
- return () => {
21
- const { prefixCls, locale = {}, generateConfig = {}, pickerValue, disabledDate, onPickerValueChange, onModeChange } = props;
22
- const panelPrefixCls = `${prefixCls}-month-panel`;
23
- const baseDate = generateConfig.setMonth(pickerValue, 0);
24
- const yearFormat = locale.yearFormat || "YYYY";
25
- const monthsLocale = locale.shortMonths || (generateConfig.locale.getShortMonths ? generateConfig.locale.getShortMonths(locale.locale) : []);
26
- const getCellDate = (date, offset) => {
27
- return generateConfig.addMonth(date, offset);
28
- };
29
- const getCellText = (date) => {
30
- const month = generateConfig.getMonth(date);
31
- return locale.monthFormat ? require_dateUtil.formatValue(date, {
32
- locale,
33
- format: locale.monthFormat,
34
- generateConfig
35
- }) : monthsLocale[month];
36
- };
37
- const getCellClassName = () => ({ [`${prefixCls}-cell-in-view`]: true });
38
- const mergedDisabledDate = disabledDate ? (currentDate, disabledInfo) => {
39
- const startDate = generateConfig.setDate(currentDate, 1);
40
- const nextMonthStartDate = generateConfig.setMonth(startDate, generateConfig.getMonth(startDate) + 1);
41
- const endDate = generateConfig.addDate(nextMonthStartDate, -1);
42
- return disabledDate(startDate, disabledInfo) && disabledDate(endDate, disabledInfo);
43
- } : void 0;
44
- const yearNode = (0, vue.createVNode)("button", {
45
- "type": "button",
46
- "key": "year",
47
- "aria-label": locale.yearSelect,
48
- "onClick": () => {
49
- onModeChange?.("year");
50
- },
51
- "tabindex": -1,
52
- "class": `${prefixCls}-year-btn`
53
- }, [require_dateUtil.formatValue(pickerValue, {
54
- locale,
55
- format: yearFormat,
56
- generateConfig
57
- })]);
58
- return (0, vue.createVNode)("div", { "class": panelPrefixCls }, [(0, vue.createVNode)(require_PanelHeader.default, {
59
- "superOffset": (distance, date) => generateConfig.addYear(date, distance),
60
- "onChange": onPickerValueChange,
61
- "getStart": (date) => generateConfig.setMonth(date, 0),
62
- "getEnd": (date) => generateConfig.setMonth(date, 11)
63
- }, _isSlot(yearNode) ? yearNode : { default: () => [yearNode] }), (0, vue.createVNode)(require_PanelBody.default, (0, vue.mergeProps)(props, {
64
- "disabledDate": mergedDisabledDate,
65
- "titleFormat": locale.fieldMonthFormat,
66
- "colNum": 3,
67
- "rowNum": 4,
68
- "baseDate": baseDate,
69
- "getCellDate": getCellDate,
70
- "getCellText": getCellText,
71
- "getCellClassName": getCellClassName
72
- }), null)]);
73
- };
74
- }, {
75
- props: {
76
- prefixCls: {
77
- type: String,
78
- required: true,
79
- default: void 0
80
- },
81
- locale: {
82
- type: Object,
83
- required: false,
84
- default: void 0
85
- },
86
- generateConfig: {
87
- type: Object,
88
- required: false,
89
- default: void 0
90
- },
91
- pickerValue: {
92
- required: true,
93
- default: void 0
94
- },
95
- onPickerValueChange: {
96
- type: Function,
97
- required: true,
98
- default: void 0
99
- },
100
- value: {
101
- required: false,
102
- default: void 0
103
- },
104
- onSelect: {
105
- type: Function,
106
- required: true,
107
- default: void 0
108
- },
109
- values: {
110
- type: Array,
111
- required: false,
112
- default: void 0
113
- },
114
- onModeChange: {
115
- type: Function,
116
- required: true,
117
- default: void 0
118
- },
119
- disabledDate: {
120
- type: Function,
121
- required: false,
122
- default: void 0
123
- },
124
- minDate: {
125
- required: false,
126
- default: void 0
127
- },
128
- maxDate: {
129
- required: false,
130
- default: void 0
131
- },
132
- cellRender: {
133
- type: Function,
134
- required: false,
135
- default: void 0
136
- },
137
- hoverRangeValue: {
138
- type: [Array, null],
139
- required: true,
140
- default: void 0
141
- },
142
- hoverValue: {
143
- type: [Array, null],
144
- required: false,
145
- default: void 0
146
- },
147
- onHover: {
148
- type: Function,
149
- required: false,
150
- default: void 0
151
- },
152
- showTime: {
153
- type: Object,
154
- required: false,
155
- default: void 0
156
- },
157
- showWeek: {
158
- type: Boolean,
159
- required: false,
160
- default: void 0
161
- },
162
- prevIcon: {
163
- type: [
164
- Object,
165
- Function,
166
- String,
167
- Number,
168
- null,
169
- Boolean,
170
- Array
171
- ],
172
- required: false,
173
- default: void 0
174
- },
175
- nextIcon: {
176
- type: [
177
- Object,
178
- Function,
179
- String,
180
- Number,
181
- null,
182
- Boolean,
183
- Array
184
- ],
185
- required: false,
186
- default: void 0
187
- },
188
- superPrevIcon: {
189
- type: [
190
- Object,
191
- Function,
192
- String,
193
- Number,
194
- null,
195
- Boolean,
196
- Array
197
- ],
198
- required: false,
199
- default: void 0
200
- },
201
- superNextIcon: {
202
- type: [
203
- Object,
204
- Function,
205
- String,
206
- Number,
207
- null,
208
- Boolean,
209
- Array
210
- ],
211
- required: false,
212
- default: void 0
213
- }
214
- },
215
- name: "MonthPanel",
216
- inheritAttrs: false
217
- });
218
- var MonthPanel_default = MonthPanel;
219
- exports.default = MonthPanel_default;
@@ -1,157 +0,0 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
6
- const require_dateUtil = require("../utils/dateUtil.cjs");
7
- const require_context = require("./context.cjs");
8
- let vue = require("vue");
9
- let _v_c_util = require("@v-c/util");
10
- var PanelBody = /* @__PURE__ */ (0, vue.defineComponent)((props) => {
11
- const context = require_context.usePanelContext();
12
- const pickerHackContext = require_context.usePickerHackContext();
13
- return () => {
14
- const { prefixCls, classNames: panelClassNames, styles, panelType, now, disabledDate: contextDisabledDate, cellRender, onHover, hoverValue, hoverRangeValue, generateConfig = {}, values, locale = {}, onSelect } = context.value;
15
- const { rowNum, colNum, baseDate, getCellDate, prefixColumn, rowClassName, titleFormat, getCellText, getCellClassName, headerCells, cellSelection = true, disabledDate } = props;
16
- const { onCellDblClick } = pickerHackContext?.value || {};
17
- const mergedDisabledDate = disabledDate || contextDisabledDate;
18
- const cellPrefixCls = `${prefixCls}-cell`;
19
- const matchValues = (date) => (values || []).some((singleValue) => singleValue && require_dateUtil.isSame(generateConfig, locale, date, singleValue, panelType));
20
- const rows = [];
21
- for (let row = 0; row < rowNum; row += 1) {
22
- const rowNode = [];
23
- let rowStartDate;
24
- for (let col = 0; col < colNum; col += 1) {
25
- const currentDate = getCellDate(baseDate, row * colNum + col);
26
- const disabled = mergedDisabledDate?.(currentDate, { type: panelType });
27
- if (col === 0) {
28
- rowStartDate = currentDate;
29
- if (prefixColumn) rowNode.push(prefixColumn(rowStartDate));
30
- }
31
- let inRange = false;
32
- let rangeStart = false;
33
- let rangeEnd = false;
34
- if (cellSelection && hoverRangeValue) {
35
- const [hoverStart, hoverEnd] = hoverRangeValue;
36
- inRange = require_dateUtil.isInRange(generateConfig, hoverStart, hoverEnd, currentDate);
37
- rangeStart = require_dateUtil.isSame(generateConfig, locale, currentDate, hoverStart, panelType);
38
- rangeEnd = require_dateUtil.isSame(generateConfig, locale, currentDate, hoverEnd, panelType);
39
- }
40
- const title = titleFormat ? require_dateUtil.formatValue(currentDate, {
41
- locale,
42
- format: titleFormat,
43
- generateConfig
44
- }) : void 0;
45
- const inner = (0, vue.createVNode)("div", { "class": `${cellPrefixCls}-inner` }, [getCellText(currentDate)]);
46
- rowNode.push((0, vue.createVNode)("td", {
47
- "key": col,
48
- "title": title,
49
- "class": (0, _v_c_util.clsx)(cellPrefixCls, panelClassNames?.item, {
50
- [`${cellPrefixCls}-disabled`]: disabled,
51
- [`${cellPrefixCls}-hover`]: (hoverValue || []).some((date) => require_dateUtil.isSame(generateConfig, locale, currentDate, date, panelType)),
52
- [`${cellPrefixCls}-in-range`]: inRange && !rangeStart && !rangeEnd,
53
- [`${cellPrefixCls}-range-start`]: rangeStart,
54
- [`${cellPrefixCls}-range-end`]: rangeEnd,
55
- [`${prefixCls}-cell-selected`]: !hoverRangeValue && panelType !== "week" && matchValues(currentDate),
56
- ...getCellClassName(currentDate)
57
- }),
58
- "style": styles?.item,
59
- "onClick": () => {
60
- if (!disabled) onSelect(currentDate);
61
- },
62
- "onDblclick": () => {
63
- if (!disabled && onCellDblClick) onCellDblClick();
64
- },
65
- "onMouseenter": () => {
66
- if (!disabled) onHover?.(currentDate);
67
- },
68
- "onMouseleave": () => {
69
- if (!disabled) onHover?.(null);
70
- }
71
- }, [cellRender ? cellRender(currentDate, {
72
- prefixCls,
73
- originNode: inner,
74
- today: now,
75
- type: panelType,
76
- locale
77
- }) : inner]));
78
- }
79
- rows.push((0, vue.createVNode)("tr", {
80
- "key": row,
81
- "class": rowClassName?.(rowStartDate)
82
- }, [rowNode]));
83
- }
84
- return (0, vue.createVNode)("div", {
85
- "class": (0, _v_c_util.clsx)(`${prefixCls}-body`, panelClassNames?.body),
86
- "style": styles?.body
87
- }, [(0, vue.createVNode)("table", {
88
- "class": (0, _v_c_util.clsx)(`${prefixCls}-content`, panelClassNames?.content),
89
- "style": styles?.content
90
- }, [headerCells && (0, vue.createVNode)("thead", null, [(0, vue.createVNode)("tr", null, [headerCells])]), (0, vue.createVNode)("tbody", null, [rows])])]);
91
- };
92
- }, {
93
- props: {
94
- rowNum: {
95
- type: Number,
96
- required: true,
97
- default: void 0
98
- },
99
- colNum: {
100
- type: Number,
101
- required: true,
102
- default: void 0
103
- },
104
- baseDate: {
105
- required: true,
106
- default: void 0
107
- },
108
- titleFormat: {
109
- type: String,
110
- required: false,
111
- default: void 0
112
- },
113
- getCellDate: {
114
- type: Function,
115
- required: true,
116
- default: void 0
117
- },
118
- getCellText: {
119
- type: Function,
120
- required: true,
121
- default: void 0
122
- },
123
- getCellClassName: {
124
- type: Function,
125
- required: true,
126
- default: void 0
127
- },
128
- disabledDate: {
129
- type: Function,
130
- required: false,
131
- default: void 0
132
- },
133
- headerCells: {
134
- type: Array,
135
- required: false,
136
- default: void 0
137
- },
138
- prefixColumn: {
139
- type: Function,
140
- required: false,
141
- default: void 0
142
- },
143
- rowClassName: {
144
- type: Function,
145
- required: false,
146
- default: void 0
147
- },
148
- cellSelection: {
149
- type: Boolean,
150
- required: false,
151
- default: void 0
152
- }
153
- },
154
- name: "PanelBody"
155
- });
156
- var PanelBody_default = PanelBody;
157
- exports.default = PanelBody_default;
@@ -1,132 +0,0 @@
1
- Object.defineProperties(exports, {
2
- __esModule: { value: true },
3
- [Symbol.toStringTag]: { value: "Module" }
4
- });
5
- const require_rolldown_runtime = require("../_virtual/rolldown_runtime.cjs");
6
- const require_dateUtil = require("../utils/dateUtil.cjs");
7
- const require_context = require("./context.cjs");
8
- let vue = require("vue");
9
- let _v_c_util = require("@v-c/util");
10
- var HIDDEN_STYLE = { visibility: "hidden" };
11
- var PanelHeader = /* @__PURE__ */ (0, vue.defineComponent)((props, { slots }) => {
12
- const context = require_context.usePanelContext();
13
- const pickerHackContext = require_context.usePickerHackContext();
14
- const disabledOffsetPrev = (0, vue.computed)(() => {
15
- const { minDate, generateConfig, locale, pickerValue, panelType } = context.value;
16
- const { offset, getEnd } = props;
17
- if (!minDate || !offset || !getEnd) return false;
18
- return !require_dateUtil.isSameOrAfter(generateConfig, locale, getEnd(offset(-1, pickerValue)), minDate, panelType);
19
- });
20
- const disabledSuperOffsetPrev = (0, vue.computed)(() => {
21
- const { minDate, generateConfig, locale, pickerValue, panelType } = context.value;
22
- const { superOffset, getEnd } = props;
23
- if (!minDate || !superOffset || !getEnd) return false;
24
- return !require_dateUtil.isSameOrAfter(generateConfig, locale, getEnd(superOffset(-1, pickerValue)), minDate, panelType);
25
- });
26
- const disabledOffsetNext = (0, vue.computed)(() => {
27
- const { maxDate, generateConfig, locale, pickerValue, panelType } = context.value;
28
- const { offset, getStart } = props;
29
- if (!maxDate || !offset || !getStart) return false;
30
- return !require_dateUtil.isSameOrAfter(generateConfig, locale, maxDate, getStart(offset(1, pickerValue)), panelType);
31
- });
32
- const disabledSuperOffsetNext = (0, vue.computed)(() => {
33
- const { maxDate, generateConfig, locale, pickerValue, panelType } = context.value;
34
- const { superOffset, getStart } = props;
35
- if (!maxDate || !superOffset || !getStart) return false;
36
- return !require_dateUtil.isSameOrAfter(generateConfig, locale, maxDate, getStart(superOffset(1, pickerValue)), panelType);
37
- });
38
- const onOffset = (distance) => {
39
- const { offset, onChange } = props;
40
- const { pickerValue } = context.value;
41
- if (offset && onChange) onChange(offset(distance, pickerValue));
42
- };
43
- const onSuperOffset = (distance) => {
44
- const { superOffset, onChange } = props;
45
- const { pickerValue } = context.value;
46
- if (superOffset && onChange) onChange(superOffset(distance, pickerValue));
47
- };
48
- return () => {
49
- const { prefixCls, classNames: panelClassNames, styles, prevIcon = "‹", nextIcon = "›", superPrevIcon = "«", superNextIcon = "»", locale } = context.value;
50
- const { hidePrev, hideNext, hideHeader } = pickerHackContext?.value || {};
51
- const { offset, superOffset } = props;
52
- if (hideHeader) return null;
53
- const headerPrefixCls = `${prefixCls}-header`;
54
- const prevBtnCls = `${headerPrefixCls}-prev-btn`;
55
- const nextBtnCls = `${headerPrefixCls}-next-btn`;
56
- const superPrevBtnCls = `${headerPrefixCls}-super-prev-btn`;
57
- const superNextBtnCls = `${headerPrefixCls}-super-next-btn`;
58
- return (0, vue.createVNode)("div", {
59
- "class": (0, _v_c_util.clsx)(headerPrefixCls, panelClassNames?.header),
60
- "style": styles?.header
61
- }, [
62
- superOffset && (0, vue.createVNode)("button", {
63
- "type": "button",
64
- "aria-label": locale?.previousYear,
65
- "onClick": () => onSuperOffset(-1),
66
- "tabindex": -1,
67
- "class": (0, _v_c_util.clsx)(superPrevBtnCls, disabledSuperOffsetPrev.value && `${superPrevBtnCls}-disabled`),
68
- "disabled": disabledSuperOffsetPrev.value,
69
- "style": hidePrev ? HIDDEN_STYLE : {}
70
- }, [superPrevIcon]),
71
- offset && (0, vue.createVNode)("button", {
72
- "type": "button",
73
- "aria-label": locale?.previousMonth,
74
- "onClick": () => onOffset(-1),
75
- "tabindex": -1,
76
- "class": (0, _v_c_util.clsx)(prevBtnCls, disabledOffsetPrev.value && `${prevBtnCls}-disabled`),
77
- "disabled": disabledOffsetPrev.value,
78
- "style": hidePrev ? HIDDEN_STYLE : {}
79
- }, [prevIcon]),
80
- (0, vue.createVNode)("div", { "class": `${headerPrefixCls}-view` }, [slots.default?.()]),
81
- offset && (0, vue.createVNode)("button", {
82
- "type": "button",
83
- "aria-label": locale?.nextMonth,
84
- "onClick": () => onOffset(1),
85
- "tabindex": -1,
86
- "class": (0, _v_c_util.clsx)(nextBtnCls, disabledOffsetNext.value && `${nextBtnCls}-disabled`),
87
- "disabled": disabledOffsetNext.value,
88
- "style": hideNext ? HIDDEN_STYLE : {}
89
- }, [nextIcon]),
90
- superOffset && (0, vue.createVNode)("button", {
91
- "type": "button",
92
- "aria-label": locale?.nextYear,
93
- "onClick": () => onSuperOffset(1),
94
- "tabindex": -1,
95
- "class": (0, _v_c_util.clsx)(superNextBtnCls, disabledSuperOffsetNext.value && `${superNextBtnCls}-disabled`),
96
- "disabled": disabledSuperOffsetNext.value,
97
- "style": hideNext ? HIDDEN_STYLE : {}
98
- }, [superNextIcon])
99
- ]);
100
- };
101
- }, {
102
- props: {
103
- offset: {
104
- type: Function,
105
- required: false,
106
- default: void 0
107
- },
108
- superOffset: {
109
- type: Function,
110
- required: false,
111
- default: void 0
112
- },
113
- onChange: {
114
- type: Function,
115
- required: false,
116
- default: void 0
117
- },
118
- getStart: {
119
- type: Function,
120
- required: false,
121
- default: void 0
122
- },
123
- getEnd: {
124
- type: Function,
125
- required: false,
126
- default: void 0
127
- }
128
- },
129
- name: "PanelHeader"
130
- });
131
- var PanelHeader_default = PanelHeader;
132
- exports.default = PanelHeader_default;