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