yc-design-vue 2.2.4 → 2.2.6

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 (131) hide show
  1. package/dist/index.umd.js +1 -1
  2. package/dist/style.css +1 -1
  3. package/es/Breadcrumb/BreadcrumbSeparator.vue.js +1 -1
  4. package/es/Calendar/CalendarMonth.vue.js +2 -4
  5. package/es/ColorPicker/ColorPicker.vue.d.ts +1 -1
  6. package/es/ColorPicker/index.d.ts +3 -3
  7. package/es/DatePicker/YcDatePicker.vue.d.ts +69 -1
  8. package/es/DatePicker/YcDatePicker.vue.js +287 -4
  9. package/es/DatePicker/{YcDatePicker.vue2.js → YcDatePicker.vue3.js} +1 -0
  10. package/es/DatePicker/YcMonthPicker.vue.d.ts +2 -2
  11. package/es/DatePicker/YcMonthPicker.vue.js +65 -59
  12. package/es/DatePicker/YcWeekPicker.vue.d.ts +2 -2
  13. package/es/DatePicker/YcWeekPicker.vue.js +292 -4
  14. package/es/DatePicker/YcWeekPicker.vue3.js +5 -0
  15. package/es/DatePicker/YcYearPicker.vue.d.ts +2 -2
  16. package/es/DatePicker/YcYearPicker.vue.js +69 -52
  17. package/es/DatePicker/component/PickerCell.vue.d.ts +2 -2
  18. package/es/DatePicker/component/PickerCell.vue.js +39 -5
  19. package/es/DatePicker/component/PickerCell.vue3.js +5 -0
  20. package/es/DatePicker/component/PickerHeader.vue.d.ts +40 -0
  21. package/es/DatePicker/component/PickerHeader.vue.js +83 -0
  22. package/es/DatePicker/component/PickerHeader.vue3.js +5 -0
  23. package/es/DatePicker/component/PickerInput.vue.d.ts +1 -0
  24. package/es/DatePicker/component/PickerInput.vue.js +121 -5
  25. package/es/DatePicker/component/PickerInput.vue3.js +5 -0
  26. package/es/DatePicker/component/PickerPanel.vue.d.ts +6 -1
  27. package/es/DatePicker/component/PickerPanel.vue.js +47 -6
  28. package/es/DatePicker/component/PickerWeekHeader.vue.d.ts +8 -0
  29. package/es/DatePicker/component/PickerWeekHeader.vue.js +58 -0
  30. package/es/DatePicker/component/PickerWeekHeader.vue3.js +5 -0
  31. package/es/DatePicker/hooks/userPicker.d.ts +7 -15
  32. package/es/DatePicker/hooks/userPicker.js +45 -49
  33. package/es/DatePicker/index.css +2 -2
  34. package/es/DatePicker/index.d.ts +156 -3
  35. package/es/DatePicker/index.js +5 -3
  36. package/es/DatePicker/type.d.ts +1 -0
  37. package/es/InputNumber/InputNumber.vue.d.ts +1 -1
  38. package/es/InputNumber/index.d.ts +3 -3
  39. package/es/Layout/LayoutSider.vue.d.ts +1 -1
  40. package/es/Layout/index.d.ts +3 -3
  41. package/es/Slider/Slider.vue.d.ts +1 -1
  42. package/es/Slider/index.d.ts +3 -3
  43. package/es/Statistic/Countdown.vue.d.ts +1 -1
  44. package/es/Statistic/Statistic.vue.d.ts +1 -1
  45. package/es/Statistic/index.d.ts +6 -6
  46. package/es/Transfer/TransferPanel.vue.js +1 -1
  47. package/es/Upload/UploadFileList.vue.js +1 -1
  48. package/es/Upload/UploadPictureCard.vue.js +1 -1
  49. package/es/_shared/icons/IconDelete.vue.js +24 -1
  50. package/es/_shared/icons/IconDelete.vue2.js +1 -24
  51. package/es/_shared/icons/IconDoubleLeft.vue.js +1 -24
  52. package/es/_shared/icons/IconDoubleLeft.vue2.js +24 -1
  53. package/es/_shared/icons/IconDoubleRight.vue.js +1 -24
  54. package/es/_shared/icons/IconDoubleRight.vue2.js +24 -1
  55. package/es/_shared/icons/IconSeparator.vue.js +24 -1
  56. package/es/_shared/icons/IconSeparator.vue2.js +1 -24
  57. package/es/_shared/utils/time.d.ts +20 -0
  58. package/es/_shared/utils/time.js +74 -0
  59. package/es/index.d.ts +18 -18
  60. package/es/style.css +1 -1
  61. package/lib/Breadcrumb/BreadcrumbSeparator.vue.js +1 -1
  62. package/lib/Calendar/CalendarMonth.vue.js +1 -1
  63. package/lib/ColorPicker/ColorPicker.vue.d.ts +1 -1
  64. package/lib/ColorPicker/index.d.ts +3 -3
  65. package/lib/DatePicker/YcDatePicker.vue.d.ts +69 -1
  66. package/lib/DatePicker/YcDatePicker.vue.js +1 -1
  67. package/lib/DatePicker/{YcDatePicker.vue2.js → YcDatePicker.vue3.js} +1 -1
  68. package/lib/DatePicker/YcMonthPicker.vue.d.ts +2 -2
  69. package/lib/DatePicker/YcMonthPicker.vue.js +1 -1
  70. package/lib/DatePicker/YcWeekPicker.vue.d.ts +2 -2
  71. package/lib/DatePicker/YcWeekPicker.vue.js +1 -1
  72. package/lib/DatePicker/YcWeekPicker.vue3.js +1 -0
  73. package/lib/DatePicker/YcYearPicker.vue.d.ts +2 -2
  74. package/lib/DatePicker/YcYearPicker.vue.js +1 -1
  75. package/lib/DatePicker/component/PickerCell.vue.d.ts +2 -2
  76. package/lib/DatePicker/component/PickerCell.vue.js +1 -1
  77. package/lib/DatePicker/component/PickerCell.vue3.js +1 -0
  78. package/lib/DatePicker/component/PickerHeader.vue.d.ts +40 -0
  79. package/lib/DatePicker/component/PickerHeader.vue.js +1 -0
  80. package/lib/DatePicker/component/PickerHeader.vue3.js +1 -0
  81. package/lib/DatePicker/component/PickerInput.vue.d.ts +1 -0
  82. package/lib/DatePicker/component/PickerInput.vue.js +1 -1
  83. package/lib/DatePicker/component/PickerInput.vue3.js +1 -0
  84. package/lib/DatePicker/component/PickerPanel.vue.d.ts +6 -1
  85. package/lib/DatePicker/component/PickerPanel.vue.js +1 -1
  86. package/lib/DatePicker/component/PickerWeekHeader.vue.d.ts +8 -0
  87. package/lib/DatePicker/component/PickerWeekHeader.vue.js +1 -0
  88. package/lib/DatePicker/component/PickerWeekHeader.vue3.js +1 -0
  89. package/lib/DatePicker/hooks/userPicker.d.ts +7 -15
  90. package/lib/DatePicker/hooks/userPicker.js +1 -1
  91. package/lib/DatePicker/index.css +2 -2
  92. package/lib/DatePicker/index.d.ts +156 -3
  93. package/lib/DatePicker/index.js +1 -1
  94. package/lib/DatePicker/type.d.ts +1 -0
  95. package/lib/InputNumber/InputNumber.vue.d.ts +1 -1
  96. package/lib/InputNumber/index.d.ts +3 -3
  97. package/lib/Layout/LayoutSider.vue.d.ts +1 -1
  98. package/lib/Layout/index.d.ts +3 -3
  99. package/lib/Slider/Slider.vue.d.ts +1 -1
  100. package/lib/Slider/index.d.ts +3 -3
  101. package/lib/Statistic/Countdown.vue.d.ts +1 -1
  102. package/lib/Statistic/Statistic.vue.d.ts +1 -1
  103. package/lib/Statistic/index.d.ts +6 -6
  104. package/lib/Transfer/TransferPanel.vue.js +1 -1
  105. package/lib/Upload/UploadFileList.vue.js +1 -1
  106. package/lib/Upload/UploadPictureCard.vue.js +1 -1
  107. package/lib/_shared/icons/IconDelete.vue.js +1 -1
  108. package/lib/_shared/icons/IconDelete.vue2.js +1 -1
  109. package/lib/_shared/icons/IconDoubleLeft.vue.js +1 -1
  110. package/lib/_shared/icons/IconDoubleLeft.vue2.js +1 -1
  111. package/lib/_shared/icons/IconDoubleRight.vue.js +1 -1
  112. package/lib/_shared/icons/IconDoubleRight.vue2.js +1 -1
  113. package/lib/_shared/icons/IconSeparator.vue.js +1 -1
  114. package/lib/_shared/icons/IconSeparator.vue2.js +1 -1
  115. package/lib/_shared/utils/time.d.ts +20 -0
  116. package/lib/_shared/utils/time.js +1 -1
  117. package/lib/index.d.ts +18 -18
  118. package/lib/style.css +1 -1
  119. package/package.json +1 -1
  120. package/es/Calendar/hooks/useCalendar.d.ts +0 -7
  121. package/es/Calendar/hooks/useCalendar.js +0 -36
  122. package/es/DatePicker/YcWeekPicker.vue2.js +0 -315
  123. package/es/DatePicker/component/PickerCell.vue2.js +0 -41
  124. package/es/DatePicker/component/PickerInput.vue2.js +0 -121
  125. package/es/_virtual/_plugin-vue_export-helper.js +0 -10
  126. package/lib/Calendar/hooks/useCalendar.d.ts +0 -7
  127. package/lib/Calendar/hooks/useCalendar.js +0 -1
  128. package/lib/DatePicker/YcWeekPicker.vue2.js +0 -1
  129. package/lib/DatePicker/component/PickerCell.vue2.js +0 -1
  130. package/lib/DatePicker/component/PickerInput.vue2.js +0 -1
  131. package/lib/_virtual/_plugin-vue_export-helper.js +0 -1
@@ -44,7 +44,6 @@ declare const __VLS_component: import('vue').DefineComponent<WeekPickerProps, {}
44
44
  allowClear: boolean;
45
45
  readonly: boolean;
46
46
  triggerProps: import('..').TriggerProps;
47
- hideTrigger: boolean;
48
47
  format: string;
49
48
  dayStartOfWeek: import('./type').DayStartOfWeek;
50
49
  pickerValue: import('./type').DatePickerValue;
@@ -52,11 +51,12 @@ declare const __VLS_component: import('vue').DefineComponent<WeekPickerProps, {}
52
51
  valueFormat: import('./type').ValueFormat;
53
52
  showConfirmBtn: boolean;
54
53
  abbreviation: boolean;
54
+ disabledDate: import('./type').DisabledDate;
55
55
  shortcutsPosition: import('./type').ShortcutsPosition;
56
56
  shortcuts: import('./type').ShortcutType[];
57
57
  previewShortcut: boolean;
58
58
  disabledInput: boolean;
59
- disabledDate: import('./type').DisabledDate;
59
+ hideTrigger: boolean;
60
60
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
61
61
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
62
62
  export default _default;
@@ -1,7 +1,295 @@
1
- import _sfc_main from "./YcWeekPicker.vue2.js";
1
+ import { defineComponent, useSlots, ref, watch, createElementBlock, openBlock, Fragment, createVNode, createBlock, unref, withCtx, createSlots, createElementVNode, renderSlot, renderList, normalizeClass, normalizeStyle } from "vue";
2
+ import usePicker from "./hooks/userPicker.js";
3
+ import "../node_modules/b-tween/dist/b-tween.es.js";
4
+ import dayjs from "../node_modules/dayjs/dayjs.min.js";
5
+ import "../node_modules/tinycolor2/esm/tinycolor.js";
6
+ import "../_shared/utils/dom.js";
7
+ import "../_shared/utils/locale.js";
8
+ import "../_shared/utils/time.js";
9
+ import _sfc_main$4 from "./component/PickerHeader.vue.js";
10
+ /* empty css */
11
+ import _sfc_main$5 from "./component/PickerWeekHeader.vue.js";
12
+ /* empty css */
13
+ import _sfc_main$6 from "./component/PickerCell.vue.js";
14
+ /* empty css */
15
+ import _sfc_main$3 from "./component/PickerPanel.vue.js";
16
+ /* empty css */
17
+ import _sfc_main$7 from "./component/PickerInput.vue.js";
18
+ /* empty css */
19
+ import _sfc_main$1 from "./YcYearPicker.vue.js";
2
20
  /* empty css */
3
- import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
4
- const _WeekPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e76c0f2d"]]);
21
+ import _sfc_main$2 from "./YcMonthPicker.vue.js";
22
+ /* empty css */
23
+ const _hoisted_1 = { class: "yc-panel-week" };
24
+ const _hoisted_2 = { class: "yc-picker-body" };
25
+ const _hoisted_3 = ["onClick"];
26
+ const _sfc_main = /* @__PURE__ */ defineComponent({
27
+ ...{
28
+ name: "WeekPicker",
29
+ inheritAttrs: false
30
+ },
31
+ __name: "YcWeekPicker",
32
+ props: {
33
+ modelValue: { default: void 0 },
34
+ defaultValue: { default: "" },
35
+ dayStartOfWeek: { default: 0 },
36
+ locale: { default: () => ({}) },
37
+ hideTrigger: { type: Boolean, default: false },
38
+ allowClear: { type: Boolean, default: false },
39
+ readonly: { type: Boolean, default: false },
40
+ error: { type: Boolean, default: false },
41
+ size: { default: void 0 },
42
+ shortcuts: { default: () => [] },
43
+ shortcutsPosition: { default: "bottom" },
44
+ position: { default: "bl" },
45
+ popupVisible: { type: Boolean, default: void 0 },
46
+ defaultPopupVisible: { type: Boolean, default: false },
47
+ triggerProps: { default: () => ({}) },
48
+ unmountOnClose: { type: Boolean, default: false },
49
+ placeholder: { default: "" },
50
+ disabled: { type: Boolean, default: false },
51
+ disabledDate: { type: Function, default: void 0 },
52
+ disabledTime: {},
53
+ pickerValue: { default: void 0 },
54
+ defaultPickerValue: { default: "" },
55
+ popupContainer: { default: void 0 },
56
+ valueFormat: { default: "YYYY-MM-DD" },
57
+ format: { default: "gggg-wo" },
58
+ previewShortcut: { type: Boolean, default: true },
59
+ showConfirmBtn: { type: Boolean, default: false },
60
+ disabledInput: { type: Boolean, default: false },
61
+ abbreviation: { type: Boolean, default: true }
62
+ },
63
+ emits: ["update:modelValue", "update:popupVisible", "update:pickerValue", "change", "select", "ok", "picker-value-change", "popup-visible-change", "clear", "select-shortcut"],
64
+ setup(__props, { emit: __emit }) {
65
+ const $slots = useSlots();
66
+ const props = __props;
67
+ const emits = __emit;
68
+ const {
69
+ computedValue,
70
+ locale,
71
+ abbreviation,
72
+ dayStartOfWeek,
73
+ curMonth,
74
+ curYear,
75
+ showMonthPicker,
76
+ showYearPicker,
77
+ DefinePanel,
78
+ ReusePanel,
79
+ getDateFromFormat,
80
+ isCellInView,
81
+ isToday,
82
+ isSelected,
83
+ getWeeksOfMonth,
84
+ handleConfirm,
85
+ handleSelect,
86
+ handleShortcut
87
+ } = usePicker({
88
+ props,
89
+ emits
90
+ });
91
+ const weekData = ref([]);
92
+ const handleDateChange = (dateType, type) => {
93
+ if (dateType == "year") {
94
+ curYear.value = type == "pre" ? curYear.value - 1 : curYear.value + 1;
95
+ weekData.value = getWeeksOfMonth(curYear.value, curMonth.value);
96
+ } else {
97
+ const base = dayjs().set("year", curYear.value).set("month", curMonth.value);
98
+ const date = type == "pre" ? base.subtract(1, "month") : base.add(1, "month");
99
+ curYear.value = date.year();
100
+ curMonth.value = date.month();
101
+ weekData.value = getWeeksOfMonth(curYear.value, curMonth.value);
102
+ }
103
+ };
104
+ watch(
105
+ () => computedValue.value,
106
+ (val) => {
107
+ const date = val ? getDateFromFormat(val) : /* @__PURE__ */ new Date();
108
+ curYear.value = date.getFullYear();
109
+ curMonth.value = date.getMonth();
110
+ weekData.value = getWeeksOfMonth(curYear.value, curMonth.value);
111
+ },
112
+ {
113
+ immediate: true
114
+ }
115
+ );
116
+ return (_ctx, _cache) => {
117
+ return openBlock(), createElementBlock(Fragment, null, [
118
+ createVNode(unref(DefinePanel), null, {
119
+ default: withCtx(() => [
120
+ unref(showYearPicker) ? (openBlock(), createBlock(_sfc_main$1, {
121
+ key: 0,
122
+ "model-value": `${unref(curYear)}`,
123
+ "hide-trigger": "",
124
+ "value-format": "YYYY",
125
+ onChange: _cache[0] || (_cache[0] = (_, date) => {
126
+ curYear.value = date.getFullYear();
127
+ weekData.value = unref(getWeeksOfMonth)(unref(curYear), unref(curMonth));
128
+ showYearPicker.value = false;
129
+ })
130
+ }, null, 8, ["model-value"])) : unref(showMonthPicker) ? (openBlock(), createBlock(_sfc_main$2, {
131
+ key: 1,
132
+ "model-value": `${unref(curYear)}-${unref(curMonth) + 1 < 10 ? `0${unref(curMonth) + 1}` : unref(curMonth) + 1}`,
133
+ "hide-trigger": "",
134
+ "value-format": "YYYY-MM",
135
+ onChange: _cache[1] || (_cache[1] = (_, date) => {
136
+ curMonth.value = date.getMonth();
137
+ weekData.value = unref(getWeeksOfMonth)(unref(curYear), unref(curMonth));
138
+ showMonthPicker.value = false;
139
+ })
140
+ }, null, 8, ["model-value"])) : (openBlock(), createBlock(_sfc_main$3, {
141
+ key: 2,
142
+ locale: unref(locale),
143
+ "preview-shortcut": _ctx.previewShortcut,
144
+ shortcuts: _ctx.shortcuts,
145
+ "shortcuts-position": _ctx.shortcutsPosition,
146
+ "confirm-btn-disabled": !unref(computedValue),
147
+ "show-confirm-btn": _ctx.showConfirmBtn,
148
+ onConfirm: unref(handleConfirm),
149
+ onShortcutSelect: unref(handleShortcut)
150
+ }, createSlots({
151
+ default: withCtx(() => [
152
+ createElementVNode("div", _hoisted_1, [
153
+ createVNode(_sfc_main$4, {
154
+ year: unref(curYear),
155
+ month: unref(curMonth),
156
+ type: "week",
157
+ onPrevClick: _cache[2] || (_cache[2] = ($event) => handleDateChange("month", "pre")),
158
+ onNextClick: _cache[3] || (_cache[3] = ($event) => handleDateChange("month", "next")),
159
+ onPrevDoubleClick: _cache[4] || (_cache[4] = ($event) => handleDateChange("year", "pre")),
160
+ onNextDoubleClick: _cache[5] || (_cache[5] = ($event) => handleDateChange("year", "next")),
161
+ onYearClick: _cache[6] || (_cache[6] = ($event) => showYearPicker.value = true),
162
+ onMonthClick: _cache[7] || (_cache[7] = ($event) => showMonthPicker.value = true)
163
+ }, createSlots({ _: 2 }, [
164
+ $slots["icon-prev"] ? {
165
+ name: "icon-prev-double",
166
+ fn: withCtx(() => [
167
+ renderSlot(_ctx.$slots, "icon-next")
168
+ ]),
169
+ key: "0"
170
+ } : void 0,
171
+ $slots["icon-next"] ? {
172
+ name: "icon-next-double",
173
+ fn: withCtx(() => [
174
+ renderSlot(_ctx.$slots, "icon-next")
175
+ ]),
176
+ key: "1"
177
+ } : void 0,
178
+ $slots["icon-prev-double"] ? {
179
+ name: "icon-prev-double",
180
+ fn: withCtx(() => [
181
+ renderSlot(_ctx.$slots, "icon-next-double")
182
+ ]),
183
+ key: "2"
184
+ } : void 0,
185
+ $slots["icon-next-double"] ? {
186
+ name: "icon-next-double",
187
+ fn: withCtx(() => [
188
+ renderSlot(_ctx.$slots, "icon-next-double")
189
+ ]),
190
+ key: "3"
191
+ } : void 0
192
+ ]), 1032, ["year", "month"]),
193
+ createVNode(_sfc_main$5, {
194
+ locale: unref(locale),
195
+ abbreviation: unref(abbreviation),
196
+ "day-start-of-week": unref(dayStartOfWeek)
197
+ }, null, 8, ["locale", "abbreviation", "day-start-of-week"]),
198
+ createElementVNode("div", _hoisted_2, [
199
+ (openBlock(true), createElementBlock(Fragment, null, renderList(weekData.value, ({ label, time, value }, i) => {
200
+ var _a;
201
+ return openBlock(), createElementBlock("div", {
202
+ key: i,
203
+ class: normalizeClass([
204
+ "yc-picker-row",
205
+ "yc-picker-week-row",
206
+ {
207
+ "yc-picker-week-row-disabled": (_a = _ctx.disabledDate) == null ? void 0 : _a.call(_ctx, value),
208
+ "yc-picker-week-row-selected": unref(isSelected)(value, "week")
209
+ }
210
+ ]),
211
+ onClick: ($event) => unref(handleSelect)(value)
212
+ }, [
213
+ createVNode(_sfc_main$6, {
214
+ "cell-in-view": false,
215
+ value: label
216
+ }, null, 8, ["value"]),
217
+ (openBlock(true), createElementBlock(Fragment, null, renderList(time, ({ value: date, label: label2 }, k) => {
218
+ return openBlock(), createBlock(_sfc_main$6, {
219
+ key: k,
220
+ value: label2,
221
+ "cell-in-view": unref(isCellInView)(date, "week"),
222
+ "is-today": unref(isToday)(date, "week"),
223
+ hoverable: false,
224
+ class: normalizeClass({
225
+ "yc-week-picker-cell-first": !i,
226
+ "yc-week-picker-cell-last": i == time.length - 1
227
+ })
228
+ }, createSlots({ _: 2 }, [
229
+ $slots.cell ? {
230
+ name: "cell",
231
+ fn: withCtx(() => [
232
+ renderSlot(_ctx.$slots, "cell", { date })
233
+ ]),
234
+ key: "0"
235
+ } : void 0
236
+ ]), 1032, ["value", "cell-in-view", "is-today", "class"]);
237
+ }), 128))
238
+ ], 10, _hoisted_3);
239
+ }), 128))
240
+ ])
241
+ ])
242
+ ]),
243
+ _: 2
244
+ }, [
245
+ $slots.extra ? {
246
+ name: "extra",
247
+ fn: withCtx(() => [
248
+ renderSlot(_ctx.$slots, "extra")
249
+ ]),
250
+ key: "0"
251
+ } : void 0
252
+ ]), 1032, ["locale", "preview-shortcut", "shortcuts", "shortcuts-position", "confirm-btn-disabled", "show-confirm-btn", "onConfirm", "onShortcutSelect"]))
253
+ ]),
254
+ _: 3
255
+ }),
256
+ !_ctx.hideTrigger ? (openBlock(), createBlock(_sfc_main$7, {
257
+ key: 0,
258
+ class: normalizeClass(_ctx.$attrs.class),
259
+ style: normalizeStyle(_ctx.$attrs.style),
260
+ type: "week"
261
+ }, createSlots({
262
+ content: withCtx(() => [
263
+ createVNode(unref(ReusePanel))
264
+ ]),
265
+ _: 2
266
+ }, [
267
+ $slots.default ? {
268
+ name: "trigger",
269
+ fn: withCtx(() => [
270
+ renderSlot(_ctx.$slots, "default")
271
+ ]),
272
+ key: "0"
273
+ } : void 0,
274
+ $slots["suffix-icon"] ? {
275
+ name: "suffix-icon",
276
+ fn: withCtx(() => [
277
+ renderSlot(_ctx.$slots, "suffix-icon")
278
+ ]),
279
+ key: "1"
280
+ } : void 0,
281
+ $slots.prefix ? {
282
+ name: "prefix",
283
+ fn: withCtx(() => [
284
+ renderSlot(_ctx.$slots, "prefix")
285
+ ]),
286
+ key: "2"
287
+ } : void 0
288
+ ]), 1032, ["class", "style"])) : (openBlock(), createBlock(unref(ReusePanel), { key: 1 }))
289
+ ], 64);
290
+ };
291
+ }
292
+ });
5
293
  export {
6
- _WeekPicker as default
294
+ _sfc_main as default
7
295
  };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./YcWeekPicker.vue.js";
2
+ /* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -44,17 +44,17 @@ declare const __VLS_component: import('vue').DefineComponent<YearPickerProps, {}
44
44
  allowClear: boolean;
45
45
  readonly: boolean;
46
46
  triggerProps: import('..').TriggerProps;
47
- hideTrigger: boolean;
48
47
  format: string;
49
48
  pickerValue: import('./type').DatePickerValue;
50
49
  defaultPickerValue: import('./type').DatePickerValue;
51
50
  valueFormat: import('./type').ValueFormat;
52
51
  showConfirmBtn: boolean;
52
+ disabledDate: import('./type').DisabledDate;
53
53
  shortcutsPosition: import('./type').ShortcutsPosition;
54
54
  shortcuts: import('./type').ShortcutType[];
55
55
  previewShortcut: boolean;
56
56
  disabledInput: boolean;
57
- disabledDate: import('./type').DisabledDate;
57
+ hideTrigger: boolean;
58
58
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
59
59
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
60
60
  export default _default;
@@ -1,24 +1,15 @@
1
- import { defineComponent, useSlots, ref, watch, createElementBlock, openBlock, Fragment, createVNode, createBlock, unref, withCtx, createSlots, createElementVNode, renderSlot, toDisplayString, renderList, normalizeStyle, normalizeClass } from "vue";
1
+ import { defineComponent, useSlots, ref, watch, createElementBlock, openBlock, Fragment, createVNode, createBlock, unref, withCtx, createSlots, createElementVNode, createTextVNode, toDisplayString, renderSlot, renderList, normalizeStyle, normalizeClass } from "vue";
2
2
  import usePicker from "./hooks/userPicker.js";
3
- import "../node_modules/b-tween/dist/b-tween.es.js";
4
- import dayjs from "../node_modules/dayjs/dayjs.min.js";
5
- import "../node_modules/tinycolor2/esm/tinycolor.js";
6
- import "../_shared/utils/dom.js";
7
- import "../_shared/utils/locale.js";
8
- import "../_shared/utils/time.js";
9
- /* empty css */
10
- /* empty css */
11
- /* empty css */
12
- import _sfc_main$2 from "../_shared/icons/IconDoubleLeft.vue.js";
13
- import _sfc_main$3 from "../_shared/icons/IconDoubleRight.vue.js";
14
- import PickerCell from "./component/PickerCell.vue.js";
3
+ import _sfc_main$2 from "./component/PickerHeader.vue.js";
4
+ /* empty css */
5
+ import _sfc_main$3 from "./component/PickerCell.vue.js";
6
+ /* empty css */
15
7
  import _sfc_main$1 from "./component/PickerPanel.vue.js";
16
8
  /* empty css */
17
- import PickerInput from "./component/PickerInput.vue.js";
9
+ import _sfc_main$4 from "./component/PickerInput.vue.js";
10
+ /* empty css */
18
11
  const _hoisted_1 = { class: "yc-panel-year" };
19
- const _hoisted_2 = { class: "yc-picker-header" };
20
- const _hoisted_3 = { class: "yc-picker-header-title" };
21
- const _hoisted_4 = { class: "yc-picker-body" };
12
+ const _hoisted_2 = { class: "yc-picker-body" };
22
13
  const _sfc_main = /* @__PURE__ */ defineComponent({
23
14
  ...{
24
15
  name: "YearPicker",
@@ -65,6 +56,9 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
65
56
  DefinePanel,
66
57
  ReusePanel,
67
58
  curYear,
59
+ isToday,
60
+ isCellInView,
61
+ isSelected,
68
62
  getDateFromFormat,
69
63
  getRangeOfYear,
70
64
  handleConfirm,
@@ -75,11 +69,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
75
69
  emits
76
70
  });
77
71
  const yearData = ref([]);
78
- const isSelected = (val) => {
79
- const date = getDateFromFormat(computedValue.value);
80
- if (!date) return false;
81
- return date.getFullYear() == val.getFullYear();
82
- };
83
72
  const handleYearChange = (type) => {
84
73
  curYear.value = type == "pre" ? curYear.value - 10 : curYear.value + 10;
85
74
  const { range } = getRangeOfYear(curYear.value);
@@ -113,26 +102,32 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
113
102
  }, createSlots({
114
103
  default: withCtx(() => [
115
104
  createElementVNode("div", _hoisted_1, [
116
- createElementVNode("div", _hoisted_2, [
117
- createElementVNode("div", {
118
- class: "yc-picker-header-icon",
119
- onClick: _cache[0] || (_cache[0] = ($event) => handleYearChange("pre"))
120
- }, [
121
- renderSlot(_ctx.$slots, "icon-prev-double", {}, () => [
122
- createVNode(unref(_sfc_main$2))
123
- ])
105
+ createVNode(_sfc_main$2, {
106
+ type: "year",
107
+ onPrevDoubleClick: _cache[0] || (_cache[0] = ($event) => handleYearChange("pre")),
108
+ onNextDoubleClick: _cache[1] || (_cache[1] = ($event) => handleYearChange("next"))
109
+ }, createSlots({
110
+ default: withCtx(() => [
111
+ createTextVNode(toDisplayString(unref(curYear)) + "-" + toDisplayString(unref(curYear) + 10) + " ", 1)
124
112
  ]),
125
- createElementVNode("div", _hoisted_3, toDisplayString(unref(curYear)) + "-" + toDisplayString(unref(curYear) + 10), 1),
126
- createElementVNode("div", {
127
- class: "yc-picker-header-icon",
128
- onClick: _cache[1] || (_cache[1] = ($event) => handleYearChange("next"))
129
- }, [
130
- renderSlot(_ctx.$slots, "icon-next-double", {}, () => [
131
- createVNode(unref(_sfc_main$3))
132
- ])
133
- ])
134
- ]),
135
- createElementVNode("div", _hoisted_4, [
113
+ _: 2
114
+ }, [
115
+ $slots["icon-prev-double"] ? {
116
+ name: "icon-prev-double",
117
+ fn: withCtx(() => [
118
+ renderSlot(_ctx.$slots, "icon-next-double")
119
+ ]),
120
+ key: "0"
121
+ } : void 0,
122
+ $slots["icon-next-double"] ? {
123
+ name: "icon-next-double",
124
+ fn: withCtx(() => [
125
+ renderSlot(_ctx.$slots, "icon-next-double")
126
+ ]),
127
+ key: "1"
128
+ } : void 0
129
+ ]), 1024),
130
+ createElementVNode("div", _hoisted_2, [
136
131
  (openBlock(true), createElementBlock(Fragment, null, renderList(yearData.value, (row, i) => {
137
132
  return openBlock(), createElementBlock("div", {
138
133
  key: i,
@@ -140,13 +135,13 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
140
135
  }, [
141
136
  (openBlock(true), createElementBlock(Fragment, null, renderList(row, ({ value: date, label }, k) => {
142
137
  var _a;
143
- return openBlock(), createBlock(PickerCell, {
144
- key: date.getFullYear(),
145
- "cell-in-view": !!(i || k),
146
- "is-today": date.getFullYear() == unref(dayjs)().year(),
147
- "is-selected": isSelected(date),
148
- disabled: (_a = _ctx.disabledDate) == null ? void 0 : _a.call(_ctx, date),
138
+ return openBlock(), createBlock(_sfc_main$3, {
139
+ key: k,
149
140
  value: label,
141
+ "cell-in-view": unref(isCellInView)(date, "year"),
142
+ "is-today": unref(isToday)(date, "year"),
143
+ "is-selected": unref(isSelected)(date, "year"),
144
+ disabled: (_a = _ctx.disabledDate) == null ? void 0 : _a.call(_ctx, date),
150
145
  onClick: ($event) => unref(handleSelect)(date)
151
146
  }, createSlots({ _: 2 }, [
152
147
  $slots.cell ? {
@@ -156,7 +151,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
156
151
  ]),
157
152
  key: "0"
158
153
  } : void 0
159
- ]), 1032, ["cell-in-view", "is-today", "is-selected", "disabled", "value", "onClick"]);
154
+ ]), 1032, ["value", "cell-in-view", "is-today", "is-selected", "disabled", "onClick"]);
160
155
  }), 128))
161
156
  ]);
162
157
  }), 128))
@@ -176,17 +171,39 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
176
171
  ]),
177
172
  _: 3
178
173
  }),
179
- !_ctx.hideTrigger ? (openBlock(), createBlock(PickerInput, {
174
+ !_ctx.hideTrigger ? (openBlock(), createBlock(_sfc_main$4, {
180
175
  key: 0,
181
176
  class: normalizeClass(_ctx.$attrs.class),
182
177
  style: normalizeStyle(_ctx.$attrs.style),
183
178
  type: "year"
184
- }, {
179
+ }, createSlots({
185
180
  content: withCtx(() => [
186
181
  createVNode(unref(ReusePanel))
187
182
  ]),
188
- _: 1
189
- }, 8, ["class", "style"])) : (openBlock(), createBlock(unref(ReusePanel), { key: 1 }))
183
+ _: 2
184
+ }, [
185
+ $slots.default ? {
186
+ name: "trigger",
187
+ fn: withCtx(() => [
188
+ renderSlot(_ctx.$slots, "default")
189
+ ]),
190
+ key: "0"
191
+ } : void 0,
192
+ $slots["suffix-icon"] ? {
193
+ name: "suffix-icon",
194
+ fn: withCtx(() => [
195
+ renderSlot(_ctx.$slots, "suffix-icon")
196
+ ]),
197
+ key: "1"
198
+ } : void 0,
199
+ $slots.prefix ? {
200
+ name: "prefix",
201
+ fn: withCtx(() => [
202
+ renderSlot(_ctx.$slots, "prefix")
203
+ ]),
204
+ key: "2"
205
+ } : void 0
206
+ ]), 1032, ["class", "style"])) : (openBlock(), createBlock(unref(ReusePanel), { key: 1 }))
190
207
  ], 64);
191
208
  };
192
209
  }
@@ -23,9 +23,9 @@ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}
23
23
  disabled: boolean;
24
24
  value: number | string;
25
25
  hoverable: boolean;
26
- isSelected: boolean;
27
- isToday: boolean;
28
26
  cellInView: boolean;
27
+ isToday: boolean;
28
+ isSelected: boolean;
29
29
  }, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
30
30
  declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
31
31
  export default _default;
@@ -1,7 +1,41 @@
1
- import _sfc_main from "./PickerCell.vue2.js";
2
- /* empty css */
3
- import _export_sfc from "../../_virtual/_plugin-vue_export-helper.js";
4
- const PickerCell = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-20192805"]]);
1
+ import { defineComponent, createElementBlock, openBlock, normalizeClass, renderSlot, createElementVNode, toDisplayString } from "vue";
2
+ const _hoisted_1 = { class: "yc-picker-date" };
3
+ const _hoisted_2 = { class: "yc-picker-date-value" };
4
+ const _sfc_main = /* @__PURE__ */ defineComponent({
5
+ __name: "PickerCell",
6
+ props: {
7
+ cellInView: { type: Boolean, default: false },
8
+ isToday: { type: Boolean, default: false },
9
+ isSelected: { type: Boolean, default: false },
10
+ disabled: { type: Boolean, default: false },
11
+ value: { default: "" },
12
+ hoverable: { type: Boolean, default: true }
13
+ },
14
+ emits: ["click"],
15
+ setup(__props) {
16
+ return (_ctx, _cache) => {
17
+ return openBlock(), createElementBlock("div", {
18
+ class: normalizeClass([
19
+ "yc-picker-cell",
20
+ {
21
+ "yc-picker-cell-in-view": _ctx.cellInView,
22
+ "yc-picker-cell-today": _ctx.isToday,
23
+ "yc-picker-cell-selected": _ctx.isSelected,
24
+ "yc-picker-cell-disabled": _ctx.disabled,
25
+ "yc-picker-cell-hoverable": _ctx.hoverable
26
+ }
27
+ ]),
28
+ onClick: _cache[0] || (_cache[0] = ($event) => !_ctx.disabled && _ctx.$emit("click", $event))
29
+ }, [
30
+ renderSlot(_ctx.$slots, "cell", {}, () => [
31
+ createElementVNode("div", _hoisted_1, [
32
+ createElementVNode("div", _hoisted_2, toDisplayString(_ctx.value), 1)
33
+ ])
34
+ ])
35
+ ], 2);
36
+ };
37
+ }
38
+ });
5
39
  export {
6
- PickerCell as default
40
+ _sfc_main as default
7
41
  };
@@ -0,0 +1,5 @@
1
+ import _sfc_main from "./PickerCell.vue.js";
2
+ /* empty css */
3
+ export {
4
+ _sfc_main as default
5
+ };
@@ -0,0 +1,40 @@
1
+ type __VLS_Props = {
2
+ type: 'year' | 'month' | 'week' | 'date';
3
+ year?: number;
4
+ month?: number;
5
+ };
6
+ declare function __VLS_template(): {
7
+ attrs: Partial<{}>;
8
+ slots: {
9
+ 'icon-prev-double'?(_: {}): any;
10
+ 'icon-prev'?(_: {}): any;
11
+ default?(_: {}): any;
12
+ 'icon-next'?(_: {}): any;
13
+ 'icon-next-double'?(_: {}): any;
14
+ };
15
+ refs: {};
16
+ rootEl: HTMLDivElement;
17
+ };
18
+ type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
19
+ declare const __VLS_component: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
20
+ "prev-double-click": () => any;
21
+ "prev-click": () => any;
22
+ "next-double-click": () => any;
23
+ "next-click": () => any;
24
+ "year-click": () => any;
25
+ "month-click": () => any;
26
+ }, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{
27
+ "onPrev-double-click"?: (() => any) | undefined;
28
+ "onPrev-click"?: (() => any) | undefined;
29
+ "onNext-double-click"?: (() => any) | undefined;
30
+ "onNext-click"?: (() => any) | undefined;
31
+ "onYear-click"?: (() => any) | undefined;
32
+ "onMonth-click"?: (() => any) | undefined;
33
+ }>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
34
+ declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
35
+ export default _default;
36
+ type __VLS_WithTemplateSlots<T, S> = T & {
37
+ new (): {
38
+ $slots: S;
39
+ };
40
+ };