yc-design-vue 2.2.2 → 2.2.3
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.
- package/dist/index.umd.js +1 -1
- package/dist/lang-es/zh-cn.js +26 -26
- package/dist/style.css +1 -1
- package/es/Anchor/hooks/useContext.d.ts +1 -1
- package/es/Anchor/hooks/useContext.js +5 -9
- package/es/Carousel/hooks/useContext.d.ts +11 -2
- package/es/Carousel/hooks/useContext.js +4 -4
- package/es/Cascader/hooks/useContext.d.ts +69 -8
- package/es/Cascader/hooks/useContext.js +5 -13
- package/es/Cascader/index.css +1 -1
- package/es/ColorPicker/hooks/useContext.d.ts +12 -1
- package/es/ColorPicker/hooks/useContext.js +5 -5
- package/es/DatePicker/PickerRange.vue.d.ts +2 -0
- package/es/DatePicker/PickerRange.vue.js +15 -0
- package/es/DatePicker/PickerRange.vue2.js +4 -0
- package/es/DatePicker/YcDatePicker.vue.d.ts +2 -0
- package/es/DatePicker/YcDatePicker.vue.js +15 -0
- package/es/DatePicker/YcDatePicker.vue2.js +4 -0
- package/es/DatePicker/YcMonthPicker.vue.d.ts +64 -0
- package/es/DatePicker/YcMonthPicker.vue.js +234 -0
- package/es/DatePicker/YcMonthPicker.vue3.js +5 -0
- package/es/DatePicker/YcWeekPicker.vue.d.ts +65 -0
- package/es/DatePicker/YcWeekPicker.vue.js +7 -0
- package/es/DatePicker/YcWeekPicker.vue2.js +319 -0
- package/es/DatePicker/YcYearPicker.vue.d.ts +63 -0
- package/es/DatePicker/YcYearPicker.vue.js +200 -0
- package/es/DatePicker/YcYearPicker.vue3.js +5 -0
- package/es/DatePicker/component/PickerCell.vue.d.ts +36 -0
- package/es/DatePicker/component/PickerCell.vue.js +7 -0
- package/es/DatePicker/component/PickerCell.vue2.js +41 -0
- package/es/DatePicker/component/PickerInput.vue.d.ts +297 -0
- package/es/DatePicker/component/PickerInput.vue.js +7 -0
- package/es/DatePicker/component/PickerInput.vue2.js +125 -0
- package/es/DatePicker/component/PickerPanel.vue.d.ts +33 -0
- package/es/DatePicker/component/PickerPanel.vue.js +108 -0
- package/es/DatePicker/component/PickerPanel.vue3.js +5 -0
- package/es/DatePicker/hooks/useContext.d.ts +19 -0
- package/es/DatePicker/hooks/useContext.js +37 -0
- package/es/DatePicker/hooks/userPicker.d.ts +44 -0
- package/es/DatePicker/hooks/userPicker.js +221 -0
- package/es/DatePicker/index.css +3 -0
- package/es/DatePicker/index.d.ts +38 -0
- package/es/DatePicker/index.js +23 -0
- package/es/DatePicker/type.d.ts +104 -0
- package/es/Drawer/DrawerService.vue.js +1 -1
- package/es/Grid/hooks/useContext.d.ts +6 -2
- package/es/Grid/hooks/useContext.js +5 -7
- package/es/Menu/hooks/useContext.d.ts +17 -2
- package/es/Menu/hooks/useContext.js +5 -7
- package/es/Message/Message.vue.js +1 -1
- package/es/Modal/ModalService.vue.js +2 -2
- package/es/Notification/Notification.vue.js +2 -2
- package/es/Select/hooks/useContext.d.ts +2 -2
- package/es/Select/hooks/useSelectOptions.d.ts +2 -2
- package/es/Slider/hooks/useContext.d.ts +12 -6
- package/es/Slider/hooks/useContext.js +5 -12
- package/es/Statistic/Statistic.vue.js +3 -3
- package/es/Steps/hooks/useContext.d.ts +9 -1
- package/es/Steps/hooks/useContext.js +3 -6
- package/es/Tabs/hooks/useContext.d.ts +9 -2
- package/es/Tabs/hooks/useContext.js +5 -9
- package/es/TimePicker/TimePicker.vue.js +1 -1
- package/es/TimePicker/hooks/useContext.d.ts +17 -7
- package/es/TimePicker/hooks/useContext.js +4 -9
- package/es/Timeline/hooks/useContext.d.ts +4 -2
- package/es/Timeline/hooks/useContext.js +3 -6
- package/es/Transfer/TransferPanel.vue.js +1 -1
- package/es/Transfer/hooks/useContext.d.ts +1 -6
- package/es/Transfer/hooks/useContext.js +3 -7
- package/es/Typography/TypographyBase.vue.js +2 -2
- package/es/Upload/Upload.vue.js +6 -4
- package/es/Upload/UploadFileList.vue.js +129 -5
- package/es/Upload/UploadFileList.vue3.js +5 -0
- package/es/Upload/UploadPictureCard.vue.js +135 -5
- package/es/Upload/UploadPictureCard.vue3.js +5 -0
- package/es/_shared/icons/IconCalendar.vue.d.ts +2 -0
- package/es/_shared/icons/IconCalendar.vue.js +4 -0
- package/es/_shared/icons/IconCalendar.vue2.js +31 -0
- package/es/_shared/icons/IconCopy.vue.js +1 -28
- package/es/_shared/icons/IconCopy.vue2.js +28 -1
- package/es/_shared/icons/IconDelete.vue.js +1 -28
- package/es/_shared/icons/IconDelete.vue2.js +28 -1
- package/es/_shared/icons/IconDoubleLeft.vue.d.ts +2 -0
- package/es/_shared/icons/IconDoubleLeft.vue.js +31 -0
- package/es/_shared/icons/IconDoubleLeft.vue2.js +4 -0
- package/es/_shared/icons/IconDoubleRight.vue.d.ts +2 -0
- package/es/_shared/icons/IconDoubleRight.vue.js +31 -0
- package/es/_shared/icons/IconDoubleRight.vue2.js +4 -0
- package/es/_shared/icons/IconEdit.vue.js +1 -28
- package/es/_shared/icons/IconEdit.vue2.js +28 -1
- package/es/_shared/icons/index.d.ts +3 -0
- package/es/_shared/type/index.d.ts +1 -1
- package/es/_shared/utils/hooks.js +1 -1
- package/es/_shared/utils/time.d.ts +0 -1
- package/es/_shared/utils/time.js +0 -4
- package/es/_shared/utils/vue-utils.d.ts +1 -1
- package/es/_virtual/isoWeek.js +4 -0
- package/es/index.d.ts +295 -1
- package/es/index.js +42 -33
- package/es/lang-es/zh-cn.js +26 -26
- package/es/node_modules/dayjs/plugin/isoWeek.js +33 -0
- package/es/src/lang/lang-es/zh-cn.js +26 -26
- package/es/style.css +1 -1
- package/lib/Anchor/hooks/useContext.d.ts +1 -1
- package/lib/Anchor/hooks/useContext.js +1 -1
- package/lib/Carousel/hooks/useContext.d.ts +11 -2
- package/lib/Carousel/hooks/useContext.js +1 -1
- package/lib/Cascader/hooks/useContext.d.ts +69 -8
- package/lib/Cascader/hooks/useContext.js +1 -1
- package/lib/Cascader/index.css +1 -1
- package/lib/ColorPicker/hooks/useContext.d.ts +12 -1
- package/lib/ColorPicker/hooks/useContext.js +1 -1
- package/lib/DatePicker/PickerRange.vue.d.ts +2 -0
- package/lib/DatePicker/PickerRange.vue.js +1 -0
- package/lib/DatePicker/PickerRange.vue2.js +1 -0
- package/lib/DatePicker/YcDatePicker.vue.d.ts +2 -0
- package/lib/DatePicker/YcDatePicker.vue.js +1 -0
- package/lib/DatePicker/YcDatePicker.vue2.js +1 -0
- package/lib/DatePicker/YcMonthPicker.vue.d.ts +64 -0
- package/lib/DatePicker/YcMonthPicker.vue.js +1 -0
- package/lib/DatePicker/YcMonthPicker.vue3.js +1 -0
- package/lib/DatePicker/YcWeekPicker.vue.d.ts +65 -0
- package/lib/DatePicker/YcWeekPicker.vue.js +1 -0
- package/lib/DatePicker/YcWeekPicker.vue2.js +1 -0
- package/lib/DatePicker/YcYearPicker.vue.d.ts +63 -0
- package/lib/DatePicker/YcYearPicker.vue.js +1 -0
- package/lib/DatePicker/YcYearPicker.vue3.js +1 -0
- package/lib/DatePicker/component/PickerCell.vue.d.ts +36 -0
- package/lib/DatePicker/component/PickerCell.vue.js +1 -0
- package/lib/DatePicker/component/PickerCell.vue2.js +1 -0
- package/lib/DatePicker/component/PickerInput.vue.d.ts +297 -0
- package/lib/DatePicker/component/PickerInput.vue.js +1 -0
- package/lib/DatePicker/component/PickerInput.vue2.js +1 -0
- package/lib/DatePicker/component/PickerPanel.vue.d.ts +33 -0
- package/lib/DatePicker/component/PickerPanel.vue.js +1 -0
- package/lib/DatePicker/component/PickerPanel.vue3.js +1 -0
- package/lib/DatePicker/hooks/useContext.d.ts +19 -0
- package/lib/DatePicker/hooks/useContext.js +1 -0
- package/lib/DatePicker/hooks/userPicker.d.ts +44 -0
- package/lib/DatePicker/hooks/userPicker.js +1 -0
- package/lib/DatePicker/index.css +3 -0
- package/lib/DatePicker/index.d.ts +38 -0
- package/lib/DatePicker/index.js +1 -0
- package/lib/DatePicker/type.d.ts +104 -0
- package/lib/Drawer/DrawerService.vue.js +1 -1
- package/lib/Grid/hooks/useContext.d.ts +6 -2
- package/lib/Grid/hooks/useContext.js +1 -1
- package/lib/Menu/hooks/useContext.d.ts +17 -2
- package/lib/Menu/hooks/useContext.js +1 -1
- package/lib/Message/Message.vue.js +1 -1
- package/lib/Modal/ModalService.vue.js +1 -1
- package/lib/Notification/Notification.vue.js +1 -1
- package/lib/Select/hooks/useContext.d.ts +2 -2
- package/lib/Select/hooks/useSelectOptions.d.ts +2 -2
- package/lib/Slider/hooks/useContext.d.ts +12 -6
- package/lib/Slider/hooks/useContext.js +1 -1
- package/lib/Statistic/Statistic.vue.js +1 -1
- package/lib/Steps/hooks/useContext.d.ts +9 -1
- package/lib/Steps/hooks/useContext.js +1 -1
- package/lib/Tabs/hooks/useContext.d.ts +9 -2
- package/lib/Tabs/hooks/useContext.js +1 -1
- package/lib/TimePicker/TimePicker.vue.js +1 -1
- package/lib/TimePicker/hooks/useContext.d.ts +17 -7
- package/lib/TimePicker/hooks/useContext.js +1 -1
- package/lib/Timeline/hooks/useContext.d.ts +4 -2
- package/lib/Timeline/hooks/useContext.js +1 -1
- package/lib/Transfer/TransferPanel.vue.js +1 -1
- package/lib/Transfer/hooks/useContext.d.ts +1 -6
- package/lib/Transfer/hooks/useContext.js +1 -1
- package/lib/Typography/TypographyBase.vue.js +1 -1
- package/lib/Upload/Upload.vue.js +1 -1
- package/lib/Upload/UploadFileList.vue.js +1 -1
- package/lib/Upload/UploadFileList.vue3.js +1 -0
- package/lib/Upload/UploadPictureCard.vue.js +1 -1
- package/lib/Upload/UploadPictureCard.vue3.js +1 -0
- package/lib/_shared/icons/IconCalendar.vue.d.ts +2 -0
- package/lib/_shared/icons/IconCalendar.vue.js +1 -0
- package/lib/_shared/icons/IconCalendar.vue2.js +1 -0
- package/lib/_shared/icons/IconCopy.vue.js +1 -1
- package/lib/_shared/icons/IconCopy.vue2.js +1 -1
- package/lib/_shared/icons/IconDelete.vue.js +1 -1
- package/lib/_shared/icons/IconDelete.vue2.js +1 -1
- package/lib/_shared/icons/IconDoubleLeft.vue.d.ts +2 -0
- package/lib/_shared/icons/IconDoubleLeft.vue.js +1 -0
- package/lib/_shared/icons/IconDoubleLeft.vue2.js +1 -0
- package/lib/_shared/icons/IconDoubleRight.vue.d.ts +2 -0
- package/lib/_shared/icons/IconDoubleRight.vue.js +1 -0
- package/lib/_shared/icons/IconDoubleRight.vue2.js +1 -0
- package/lib/_shared/icons/IconEdit.vue.js +1 -1
- package/lib/_shared/icons/IconEdit.vue2.js +1 -1
- package/lib/_shared/icons/index.d.ts +3 -0
- package/lib/_shared/type/index.d.ts +1 -1
- package/lib/_shared/utils/hooks.js +1 -1
- package/lib/_shared/utils/time.d.ts +0 -1
- package/lib/_shared/utils/time.js +1 -1
- package/lib/_shared/utils/vue-utils.d.ts +1 -1
- package/lib/_virtual/isoWeek.js +1 -0
- package/lib/index.d.ts +295 -1
- package/lib/index.js +1 -1
- package/lib/lang-es/zh-cn.js +26 -26
- package/lib/node_modules/dayjs/plugin/isoWeek.js +1 -0
- package/lib/src/lang/lang-es/zh-cn.js +1 -1
- package/lib/style.css +1 -1
- package/package.json +1 -1
- package/es/Upload/UploadFileList.vue2.js +0 -131
- package/es/Upload/UploadPictureCard.vue2.js +0 -137
- package/lib/Upload/UploadFileList.vue2.js +0 -1
- package/lib/Upload/UploadPictureCard.vue2.js +0 -1
@@ -0,0 +1,65 @@
|
|
1
|
+
import { WeekPickerProps } 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<WeekPickerProps, {}, {}, {}, {}, 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<WeekPickerProps> & 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
|
+
hideTrigger: boolean;
|
48
|
+
format: string;
|
49
|
+
dayStartOfWeek: import('./type').DayStartOfWeek;
|
50
|
+
valueFormat: import('./type').ValueFormat;
|
51
|
+
showConfirmBtn: boolean;
|
52
|
+
abbreviation: boolean;
|
53
|
+
shortcutsPosition: import('./type').ShortcutsPosition;
|
54
|
+
shortcuts: import('./type').ShortcutType[];
|
55
|
+
previewShortcut: boolean;
|
56
|
+
disabledInput: boolean;
|
57
|
+
disabledDate: import('./type').DisabledDate;
|
58
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
59
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
60
|
+
export default _default;
|
61
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
62
|
+
new (): {
|
63
|
+
$slots: S;
|
64
|
+
};
|
65
|
+
};
|
@@ -0,0 +1,7 @@
|
|
1
|
+
import _sfc_main from "./YcWeekPicker.vue2.js";
|
2
|
+
/* empty css */
|
3
|
+
import _export_sfc from "../_virtual/_plugin-vue_export-helper.js";
|
4
|
+
const _WeekPicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-a96c5df4"]]);
|
5
|
+
export {
|
6
|
+
_WeekPicker as default
|
7
|
+
};
|
@@ -0,0 +1,319 @@
|
|
1
|
+
import { defineComponent, useSlots, ref, computed, watch, createElementBlock, openBlock, Fragment, createVNode, createBlock, unref, withCtx, createSlots, createElementVNode, renderSlot, toDisplayString, 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 "../node_modules/dayjs/plugin/duration.js";
|
7
|
+
import "../node_modules/dayjs/plugin/toObject.js";
|
8
|
+
import "../node_modules/dayjs/plugin/isSameOrAfter.js";
|
9
|
+
import "../node_modules/dayjs/plugin/isSameOrBefore.js";
|
10
|
+
import "../_shared/utils/dom.js";
|
11
|
+
import "../_shared/utils/locale.js";
|
12
|
+
import "../_shared/utils/time.js";
|
13
|
+
/* empty css */
|
14
|
+
/* empty css */
|
15
|
+
/* empty css */
|
16
|
+
import _sfc_main$5 from "../_shared/icons/IconArrowRight.vue.js";
|
17
|
+
import _sfc_main$4 from "../_shared/icons/IconDoubleLeft.vue.js";
|
18
|
+
import _sfc_main$6 from "../_shared/icons/IconDoubleRight.vue.js";
|
19
|
+
import PickerCell from "./component/PickerCell.vue.js";
|
20
|
+
import _sfc_main$3 from "./component/PickerPanel.vue.js";
|
21
|
+
/* empty css */
|
22
|
+
import PickerInput from "./component/PickerInput.vue.js";
|
23
|
+
import _sfc_main$1 from "./YcYearPicker.vue.js";
|
24
|
+
/* empty css */
|
25
|
+
import _sfc_main$2 from "./YcMonthPicker.vue.js";
|
26
|
+
/* empty css */
|
27
|
+
const _hoisted_1 = { class: "yc-panel-week" };
|
28
|
+
const _hoisted_2 = { class: "yc-picker-header" };
|
29
|
+
const _hoisted_3 = { class: "yc-picker-header-title" };
|
30
|
+
const _hoisted_4 = { class: "yc-picker-week-list" };
|
31
|
+
const _hoisted_5 = { class: "yc-picker-body" };
|
32
|
+
const _hoisted_6 = ["onClick"];
|
33
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
34
|
+
...{
|
35
|
+
name: "WeekPicker",
|
36
|
+
inheritAttrs: false
|
37
|
+
},
|
38
|
+
__name: "YcWeekPicker",
|
39
|
+
props: {
|
40
|
+
modelValue: { default: void 0 },
|
41
|
+
defaultValue: { default: "" },
|
42
|
+
dayStartOfWeek: { default: 0 },
|
43
|
+
locale: { default: () => ({}) },
|
44
|
+
hideTrigger: { type: Boolean, default: false },
|
45
|
+
allowClear: { type: Boolean, default: false },
|
46
|
+
readonly: { type: Boolean, default: false },
|
47
|
+
error: { type: Boolean, default: false },
|
48
|
+
size: { default: void 0 },
|
49
|
+
shortcuts: { default: () => [] },
|
50
|
+
shortcutsPosition: { default: "bottom" },
|
51
|
+
position: { default: "bl" },
|
52
|
+
popupVisible: { type: Boolean, default: void 0 },
|
53
|
+
defaultPopupVisible: { type: Boolean, default: false },
|
54
|
+
triggerProps: { default: () => ({}) },
|
55
|
+
unmountOnClose: { type: Boolean, default: false },
|
56
|
+
placeholder: { default: "" },
|
57
|
+
disabled: { type: Boolean, default: false },
|
58
|
+
disabledDate: { type: Function, default: void 0 },
|
59
|
+
disabledTime: {},
|
60
|
+
pickerValue: {},
|
61
|
+
defaultPickerValue: {},
|
62
|
+
popupContainer: { default: void 0 },
|
63
|
+
valueFormat: { default: "YYYY-MM-DD" },
|
64
|
+
format: { default: "gggg-wo" },
|
65
|
+
previewShortcut: { type: Boolean, default: true },
|
66
|
+
showConfirmBtn: { type: Boolean, default: false },
|
67
|
+
disabledInput: { type: Boolean, default: false },
|
68
|
+
abbreviation: { type: Boolean, default: true }
|
69
|
+
},
|
70
|
+
emits: ["update:modelValue", "update:popupVisible", "update:pickerValue", "change", "select", "ok", "picker-value-change", "popup-visible-change", "clear", "select-shortcut"],
|
71
|
+
setup(__props, { emit: __emit }) {
|
72
|
+
const $slots = useSlots();
|
73
|
+
const props = __props;
|
74
|
+
const emits = __emit;
|
75
|
+
const {
|
76
|
+
computedValue,
|
77
|
+
locale,
|
78
|
+
abbreviation,
|
79
|
+
dayStartOfWeek,
|
80
|
+
curMonth,
|
81
|
+
curYear,
|
82
|
+
showMonthPicker,
|
83
|
+
showYearPicker,
|
84
|
+
DefinePanel,
|
85
|
+
ReusePanel,
|
86
|
+
t,
|
87
|
+
getDateFromFormat,
|
88
|
+
getWeeksOfMonth,
|
89
|
+
handleConfirm,
|
90
|
+
handleSelect,
|
91
|
+
handleShortcut
|
92
|
+
} = usePicker({
|
93
|
+
props,
|
94
|
+
emits
|
95
|
+
});
|
96
|
+
const weekDate = ref([]);
|
97
|
+
const weekHeaders = computed(() => {
|
98
|
+
const baseDays = [0, 1, 2, 3, 4, 5, 6];
|
99
|
+
const days = [
|
100
|
+
...baseDays.slice(dayStartOfWeek.value || 0),
|
101
|
+
...baseDays.slice(0, dayStartOfWeek.value || 0)
|
102
|
+
];
|
103
|
+
const map = Object.fromEntries(
|
104
|
+
[
|
105
|
+
"sunday",
|
106
|
+
"monday",
|
107
|
+
"tuesday",
|
108
|
+
"wednesday",
|
109
|
+
"thursday",
|
110
|
+
"friday",
|
111
|
+
"saturday"
|
112
|
+
].map((v, i) => [i, v])
|
113
|
+
);
|
114
|
+
return days.map((v) => {
|
115
|
+
var _a;
|
116
|
+
const key = `datePicker.week.${abbreviation.value ? "short" : "long"}.${map[v]}`;
|
117
|
+
return ((_a = locale.value) == null ? void 0 : _a[key]) || t(key);
|
118
|
+
});
|
119
|
+
});
|
120
|
+
const isCellInView = (day) => {
|
121
|
+
const { value } = day;
|
122
|
+
return value.getFullYear() == curYear.value && value.getMonth() == curMonth.value;
|
123
|
+
};
|
124
|
+
const isToday = (day) => {
|
125
|
+
const { value } = day;
|
126
|
+
const date = dayjs();
|
127
|
+
return value.getFullYear() == date.year() && value.getMonth() == date.month() && value.getDate() == date.day();
|
128
|
+
};
|
129
|
+
const isSelected = (v) => {
|
130
|
+
const date = getDateFromFormat(computedValue.value);
|
131
|
+
if (!date) return false;
|
132
|
+
return date.getFullYear() == v.getFullYear() && date.getMonth() == v.getMonth() && date.getDate() == v.getDate();
|
133
|
+
};
|
134
|
+
const handleDateChange = (dateType, type) => {
|
135
|
+
if (dateType == "year") {
|
136
|
+
curYear.value = type == "pre" ? curYear.value - 1 : curYear.value + 1;
|
137
|
+
weekDate.value = getWeeksOfMonth(curYear.value, curMonth.value);
|
138
|
+
} else {
|
139
|
+
const base = dayjs().set("year", curYear.value).set("month", curMonth.value);
|
140
|
+
const date = type == "pre" ? base.subtract(1, "month") : base.add(1, "month");
|
141
|
+
curYear.value = date.year();
|
142
|
+
curMonth.value = date.month();
|
143
|
+
weekDate.value = getWeeksOfMonth(curYear.value, curMonth.value);
|
144
|
+
}
|
145
|
+
};
|
146
|
+
watch(
|
147
|
+
() => computedValue.value,
|
148
|
+
(val) => {
|
149
|
+
const date = val ? getDateFromFormat(val) : /* @__PURE__ */ new Date();
|
150
|
+
curYear.value = date.getFullYear();
|
151
|
+
curMonth.value = date.getMonth();
|
152
|
+
weekDate.value = getWeeksOfMonth(curYear.value, curMonth.value);
|
153
|
+
},
|
154
|
+
{
|
155
|
+
immediate: true
|
156
|
+
}
|
157
|
+
);
|
158
|
+
return (_ctx, _cache) => {
|
159
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
160
|
+
createVNode(unref(DefinePanel), null, {
|
161
|
+
default: withCtx(() => [
|
162
|
+
unref(showYearPicker) ? (openBlock(), createBlock(_sfc_main$1, {
|
163
|
+
key: 0,
|
164
|
+
"model-value": `${unref(curYear)}`,
|
165
|
+
"hide-trigger": "",
|
166
|
+
"value-format": "YYYY",
|
167
|
+
onChange: _cache[0] || (_cache[0] = (_, date) => {
|
168
|
+
curYear.value = date.getFullYear();
|
169
|
+
weekDate.value = unref(getWeeksOfMonth)(unref(curYear), unref(curMonth));
|
170
|
+
showYearPicker.value = false;
|
171
|
+
})
|
172
|
+
}, null, 8, ["model-value"])) : unref(showMonthPicker) ? (openBlock(), createBlock(_sfc_main$2, {
|
173
|
+
key: 1,
|
174
|
+
"model-value": `${unref(curYear)}-${unref(curMonth) + 1 < 10 ? `0${unref(curMonth) + 1}` : unref(curMonth) + 1}`,
|
175
|
+
"hide-trigger": "",
|
176
|
+
"value-format": "YYYY-MM",
|
177
|
+
onChange: _cache[1] || (_cache[1] = (_, date) => {
|
178
|
+
curMonth.value = date.getMonth();
|
179
|
+
weekDate.value = unref(getWeeksOfMonth)(unref(curYear), unref(curMonth));
|
180
|
+
showMonthPicker.value = false;
|
181
|
+
})
|
182
|
+
}, null, 8, ["model-value"])) : (openBlock(), createBlock(_sfc_main$3, {
|
183
|
+
key: 2,
|
184
|
+
locale: unref(locale),
|
185
|
+
"preview-shortcut": _ctx.previewShortcut,
|
186
|
+
shortcuts: _ctx.shortcuts,
|
187
|
+
"shortcuts-position": _ctx.shortcutsPosition,
|
188
|
+
"confirm-btn-disabled": !unref(computedValue),
|
189
|
+
"show-confirm-btn": _ctx.showConfirmBtn,
|
190
|
+
onConfirm: unref(handleConfirm),
|
191
|
+
onShortcutSelect: unref(handleShortcut)
|
192
|
+
}, createSlots({
|
193
|
+
default: withCtx(() => [
|
194
|
+
createElementVNode("div", _hoisted_1, [
|
195
|
+
createElementVNode("div", _hoisted_2, [
|
196
|
+
createElementVNode("div", {
|
197
|
+
class: "yc-picker-header-icon",
|
198
|
+
onClick: _cache[2] || (_cache[2] = ($event) => handleDateChange("year", "pre"))
|
199
|
+
}, [
|
200
|
+
renderSlot(_ctx.$slots, "icon-prev-double", {}, () => [
|
201
|
+
createVNode(unref(_sfc_main$4))
|
202
|
+
], true)
|
203
|
+
]),
|
204
|
+
createElementVNode("div", {
|
205
|
+
class: "yc-picker-header-icon",
|
206
|
+
onClick: _cache[3] || (_cache[3] = ($event) => handleDateChange("month", "pre"))
|
207
|
+
}, [
|
208
|
+
renderSlot(_ctx.$slots, "icon-prev", {}, () => [
|
209
|
+
createVNode(unref(_sfc_main$5), { rotate: 180 })
|
210
|
+
], true)
|
211
|
+
]),
|
212
|
+
createElementVNode("div", _hoisted_3, [
|
213
|
+
createElementVNode("span", {
|
214
|
+
class: "yc-picker-header-label",
|
215
|
+
onClick: _cache[4] || (_cache[4] = ($event) => showYearPicker.value = true)
|
216
|
+
}, toDisplayString(unref(curYear)), 1),
|
217
|
+
_cache[8] || (_cache[8] = createElementVNode("span", null, "-", -1)),
|
218
|
+
createElementVNode("span", {
|
219
|
+
class: "yc-picker-header-label",
|
220
|
+
onClick: _cache[5] || (_cache[5] = ($event) => showMonthPicker.value = true)
|
221
|
+
}, toDisplayString(unref(curMonth) < 9 ? `0${unref(curMonth) + 1}` : unref(curMonth) + 1), 1)
|
222
|
+
]),
|
223
|
+
createElementVNode("div", {
|
224
|
+
class: "yc-picker-header-icon",
|
225
|
+
onClick: _cache[6] || (_cache[6] = ($event) => handleDateChange("month", "next"))
|
226
|
+
}, [
|
227
|
+
renderSlot(_ctx.$slots, "icon-next", {}, () => [
|
228
|
+
createVNode(unref(_sfc_main$5))
|
229
|
+
], true)
|
230
|
+
]),
|
231
|
+
createElementVNode("div", {
|
232
|
+
class: "yc-picker-header-icon",
|
233
|
+
onClick: _cache[7] || (_cache[7] = ($event) => handleDateChange("year", "next"))
|
234
|
+
}, [
|
235
|
+
renderSlot(_ctx.$slots, "icon-next-double", {}, () => [
|
236
|
+
createVNode(unref(_sfc_main$6))
|
237
|
+
], true)
|
238
|
+
])
|
239
|
+
]),
|
240
|
+
createElementVNode("div", _hoisted_4, [
|
241
|
+
_cache[9] || (_cache[9] = createElementVNode("div", { class: "yc-picker-week-list-item" }, null, -1)),
|
242
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(weekHeaders.value, (v) => {
|
243
|
+
return openBlock(), createElementBlock("div", {
|
244
|
+
key: v,
|
245
|
+
class: "yc-picker-week-list-item"
|
246
|
+
}, toDisplayString(v), 1);
|
247
|
+
}), 128))
|
248
|
+
]),
|
249
|
+
createElementVNode("div", _hoisted_5, [
|
250
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(weekDate.value, ({ label, time, value }, i) => {
|
251
|
+
var _a;
|
252
|
+
return openBlock(), createElementBlock("div", {
|
253
|
+
key: i,
|
254
|
+
class: normalizeClass([
|
255
|
+
"yc-picker-row",
|
256
|
+
"yc-picker-week-row",
|
257
|
+
{
|
258
|
+
"yc-picker-week-row-disabled": (_a = _ctx.disabledDate) == null ? void 0 : _a.call(_ctx, value),
|
259
|
+
"yc-picker-week-row-selected": isSelected(value)
|
260
|
+
}
|
261
|
+
]),
|
262
|
+
onClick: ($event) => {
|
263
|
+
var _a2;
|
264
|
+
return !((_a2 = _ctx.disabledDate) == null ? void 0 : _a2.call(_ctx, value)) && unref(handleSelect)(value);
|
265
|
+
}
|
266
|
+
}, [
|
267
|
+
createVNode(PickerCell, {
|
268
|
+
"cell-in-view": false,
|
269
|
+
value: label
|
270
|
+
}, null, 8, ["value"]),
|
271
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(time, (day, i2) => {
|
272
|
+
return openBlock(), createBlock(PickerCell, {
|
273
|
+
key: i2,
|
274
|
+
value: day.label,
|
275
|
+
"cell-in-view": isCellInView(day),
|
276
|
+
"is-today": isToday(day),
|
277
|
+
hoverable: false,
|
278
|
+
class: normalizeClass({
|
279
|
+
"yc-week-picker-cell-first": !i2,
|
280
|
+
"yc-week-picker-cell-last": i2 == time.length - 1
|
281
|
+
})
|
282
|
+
}, null, 8, ["value", "cell-in-view", "is-today", "class"]);
|
283
|
+
}), 128))
|
284
|
+
], 10, _hoisted_6);
|
285
|
+
}), 128))
|
286
|
+
])
|
287
|
+
])
|
288
|
+
]),
|
289
|
+
_: 2
|
290
|
+
}, [
|
291
|
+
$slots.extra ? {
|
292
|
+
name: "extra",
|
293
|
+
fn: withCtx(() => [
|
294
|
+
renderSlot(_ctx.$slots, "extra", {}, void 0, true)
|
295
|
+
]),
|
296
|
+
key: "0"
|
297
|
+
} : void 0
|
298
|
+
]), 1032, ["locale", "preview-shortcut", "shortcuts", "shortcuts-position", "confirm-btn-disabled", "show-confirm-btn", "onConfirm", "onShortcutSelect"]))
|
299
|
+
]),
|
300
|
+
_: 3
|
301
|
+
}),
|
302
|
+
!_ctx.hideTrigger ? (openBlock(), createBlock(PickerInput, {
|
303
|
+
key: 0,
|
304
|
+
class: normalizeClass(_ctx.$attrs.class),
|
305
|
+
style: normalizeStyle(_ctx.$attrs.style),
|
306
|
+
type: "week"
|
307
|
+
}, {
|
308
|
+
content: withCtx(() => [
|
309
|
+
createVNode(unref(ReusePanel))
|
310
|
+
]),
|
311
|
+
_: 1
|
312
|
+
}, 8, ["class", "style"])) : (openBlock(), createBlock(unref(ReusePanel), { key: 1 }))
|
313
|
+
], 64);
|
314
|
+
};
|
315
|
+
}
|
316
|
+
});
|
317
|
+
export {
|
318
|
+
_sfc_main as default
|
319
|
+
};
|
@@ -0,0 +1,63 @@
|
|
1
|
+
import { YearPickerProps } 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<YearPickerProps, {}, {}, {}, {}, 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<YearPickerProps> & 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
|
+
hideTrigger: boolean;
|
48
|
+
format: string;
|
49
|
+
valueFormat: import('./type').ValueFormat;
|
50
|
+
showConfirmBtn: boolean;
|
51
|
+
shortcutsPosition: import('./type').ShortcutsPosition;
|
52
|
+
shortcuts: import('./type').ShortcutType[];
|
53
|
+
previewShortcut: boolean;
|
54
|
+
disabledInput: boolean;
|
55
|
+
disabledDate: import('./type').DisabledDate;
|
56
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
57
|
+
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
58
|
+
export default _default;
|
59
|
+
type __VLS_WithTemplateSlots<T, S> = T & {
|
60
|
+
new (): {
|
61
|
+
$slots: S;
|
62
|
+
};
|
63
|
+
};
|
@@ -0,0 +1,200 @@
|
|
1
|
+
import { defineComponent, useSlots, ref, watch, createElementBlock, openBlock, Fragment, createVNode, createBlock, unref, withCtx, createSlots, createElementVNode, renderSlot, toDisplayString, 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 "../node_modules/dayjs/plugin/duration.js";
|
7
|
+
import "../node_modules/dayjs/plugin/toObject.js";
|
8
|
+
import "../node_modules/dayjs/plugin/isSameOrAfter.js";
|
9
|
+
import "../node_modules/dayjs/plugin/isSameOrBefore.js";
|
10
|
+
import "../_shared/utils/dom.js";
|
11
|
+
import "../_shared/utils/locale.js";
|
12
|
+
import "../_shared/utils/time.js";
|
13
|
+
/* empty css */
|
14
|
+
/* empty css */
|
15
|
+
/* empty css */
|
16
|
+
import _sfc_main$2 from "../_shared/icons/IconDoubleLeft.vue.js";
|
17
|
+
import _sfc_main$3 from "../_shared/icons/IconDoubleRight.vue.js";
|
18
|
+
import PickerCell from "./component/PickerCell.vue.js";
|
19
|
+
import _sfc_main$1 from "./component/PickerPanel.vue.js";
|
20
|
+
/* empty css */
|
21
|
+
import PickerInput from "./component/PickerInput.vue.js";
|
22
|
+
const _hoisted_1 = { class: "yc-panel-year" };
|
23
|
+
const _hoisted_2 = { class: "yc-picker-header" };
|
24
|
+
const _hoisted_3 = { class: "yc-picker-header-title" };
|
25
|
+
const _hoisted_4 = { class: "yc-picker-body" };
|
26
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
27
|
+
...{
|
28
|
+
name: "YearPicker",
|
29
|
+
inheritAttrs: false
|
30
|
+
},
|
31
|
+
__name: "YcYearPicker",
|
32
|
+
props: {
|
33
|
+
modelValue: { default: void 0 },
|
34
|
+
defaultValue: { default: "" },
|
35
|
+
locale: { default: () => ({}) },
|
36
|
+
hideTrigger: { type: Boolean, default: false },
|
37
|
+
allowClear: { type: Boolean, default: false },
|
38
|
+
readonly: { type: Boolean, default: false },
|
39
|
+
error: { type: Boolean, default: false },
|
40
|
+
size: { default: void 0 },
|
41
|
+
shortcuts: { default: () => [] },
|
42
|
+
shortcutsPosition: { default: "bottom" },
|
43
|
+
position: { default: "bl" },
|
44
|
+
popupVisible: { type: Boolean, default: void 0 },
|
45
|
+
defaultPopupVisible: { type: Boolean, default: false },
|
46
|
+
triggerProps: { default: () => ({}) },
|
47
|
+
unmountOnClose: { type: Boolean, default: false },
|
48
|
+
placeholder: { default: "" },
|
49
|
+
disabled: { type: Boolean, default: false },
|
50
|
+
disabledDate: { type: Function, default: void 0 },
|
51
|
+
disabledTime: {},
|
52
|
+
pickerValue: {},
|
53
|
+
defaultPickerValue: {},
|
54
|
+
popupContainer: { default: void 0 },
|
55
|
+
valueFormat: { default: "YYYY" },
|
56
|
+
format: { default: "YYYY" },
|
57
|
+
previewShortcut: { type: Boolean, default: true },
|
58
|
+
showConfirmBtn: { type: Boolean, default: false },
|
59
|
+
disabledInput: { type: Boolean, default: false },
|
60
|
+
abbreviation: { type: Boolean }
|
61
|
+
},
|
62
|
+
emits: ["update:modelValue", "update:popupVisible", "update:pickerValue", "change", "select", "ok", "picker-value-change", "popup-visible-change", "clear", "select-shortcut"],
|
63
|
+
setup(__props, { emit: __emit }) {
|
64
|
+
const $slots = useSlots();
|
65
|
+
const props = __props;
|
66
|
+
const emits = __emit;
|
67
|
+
const {
|
68
|
+
computedValue,
|
69
|
+
DefinePanel,
|
70
|
+
ReusePanel,
|
71
|
+
curYear,
|
72
|
+
getDateFromFormat,
|
73
|
+
getRangeOfYear,
|
74
|
+
handleConfirm,
|
75
|
+
handleSelect,
|
76
|
+
handleShortcut
|
77
|
+
} = usePicker({
|
78
|
+
props,
|
79
|
+
emits
|
80
|
+
});
|
81
|
+
const yearData = ref([]);
|
82
|
+
const isSelected = (val) => {
|
83
|
+
const date = getDateFromFormat(computedValue.value);
|
84
|
+
if (!date) return false;
|
85
|
+
return date.getFullYear() == val.getFullYear();
|
86
|
+
};
|
87
|
+
const handleYearChange = (type) => {
|
88
|
+
curYear.value = type == "pre" ? curYear.value - 10 : curYear.value + 10;
|
89
|
+
const { range } = getRangeOfYear(curYear.value);
|
90
|
+
yearData.value = range;
|
91
|
+
};
|
92
|
+
watch(
|
93
|
+
() => computedValue.value,
|
94
|
+
(val) => {
|
95
|
+
const date = val ? getDateFromFormat(val) : /* @__PURE__ */ new Date();
|
96
|
+
const { range, startYear } = getRangeOfYear(date.getFullYear());
|
97
|
+
curYear.value = startYear;
|
98
|
+
yearData.value = range;
|
99
|
+
},
|
100
|
+
{
|
101
|
+
immediate: true
|
102
|
+
}
|
103
|
+
);
|
104
|
+
return (_ctx, _cache) => {
|
105
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
106
|
+
createVNode(unref(DefinePanel), null, {
|
107
|
+
default: withCtx(() => [
|
108
|
+
createVNode(_sfc_main$1, {
|
109
|
+
locale: _ctx.locale,
|
110
|
+
"preview-shortcut": _ctx.previewShortcut,
|
111
|
+
shortcuts: _ctx.shortcuts,
|
112
|
+
"shortcuts-position": _ctx.shortcutsPosition,
|
113
|
+
"confirm-btn-disabled": !unref(computedValue),
|
114
|
+
"show-confirm-btn": _ctx.showConfirmBtn,
|
115
|
+
onConfirm: unref(handleConfirm),
|
116
|
+
onShortcutSelect: unref(handleShortcut)
|
117
|
+
}, createSlots({
|
118
|
+
default: withCtx(() => [
|
119
|
+
createElementVNode("div", _hoisted_1, [
|
120
|
+
createElementVNode("div", _hoisted_2, [
|
121
|
+
createElementVNode("div", {
|
122
|
+
class: "yc-picker-header-icon",
|
123
|
+
onClick: _cache[0] || (_cache[0] = ($event) => handleYearChange("pre"))
|
124
|
+
}, [
|
125
|
+
renderSlot(_ctx.$slots, "icon-prev-double", {}, () => [
|
126
|
+
createVNode(unref(_sfc_main$2))
|
127
|
+
])
|
128
|
+
]),
|
129
|
+
createElementVNode("div", _hoisted_3, toDisplayString(unref(curYear)) + "-" + toDisplayString(unref(curYear) + 10), 1),
|
130
|
+
createElementVNode("div", {
|
131
|
+
class: "yc-picker-header-icon",
|
132
|
+
onClick: _cache[1] || (_cache[1] = ($event) => handleYearChange("next"))
|
133
|
+
}, [
|
134
|
+
renderSlot(_ctx.$slots, "icon-next-double", {}, () => [
|
135
|
+
createVNode(unref(_sfc_main$3))
|
136
|
+
])
|
137
|
+
])
|
138
|
+
]),
|
139
|
+
createElementVNode("div", _hoisted_4, [
|
140
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(yearData.value, (row, i) => {
|
141
|
+
return openBlock(), createElementBlock("div", {
|
142
|
+
key: i,
|
143
|
+
class: "yc-picker-row"
|
144
|
+
}, [
|
145
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(row, ({ value: date, label }, k) => {
|
146
|
+
var _a;
|
147
|
+
return openBlock(), createBlock(PickerCell, {
|
148
|
+
key: date.getFullYear(),
|
149
|
+
"cell-in-view": !!(i || k),
|
150
|
+
"is-today": date.getFullYear() == unref(dayjs)().year(),
|
151
|
+
"is-selected": isSelected(date),
|
152
|
+
disabled: (_a = _ctx.disabledDate) == null ? void 0 : _a.call(_ctx, date),
|
153
|
+
value: label,
|
154
|
+
onClick: ($event) => unref(handleSelect)(date)
|
155
|
+
}, createSlots({ _: 2 }, [
|
156
|
+
$slots.cell ? {
|
157
|
+
name: "cell",
|
158
|
+
fn: withCtx(() => [
|
159
|
+
renderSlot(_ctx.$slots, "cell", { date })
|
160
|
+
]),
|
161
|
+
key: "0"
|
162
|
+
} : void 0
|
163
|
+
]), 1032, ["cell-in-view", "is-today", "is-selected", "disabled", "value", "onClick"]);
|
164
|
+
}), 128))
|
165
|
+
]);
|
166
|
+
}), 128))
|
167
|
+
])
|
168
|
+
])
|
169
|
+
]),
|
170
|
+
_: 2
|
171
|
+
}, [
|
172
|
+
$slots.extra ? {
|
173
|
+
name: "extra",
|
174
|
+
fn: withCtx(() => [
|
175
|
+
renderSlot(_ctx.$slots, "extra")
|
176
|
+
]),
|
177
|
+
key: "0"
|
178
|
+
} : void 0
|
179
|
+
]), 1032, ["locale", "preview-shortcut", "shortcuts", "shortcuts-position", "confirm-btn-disabled", "show-confirm-btn", "onConfirm", "onShortcutSelect"])
|
180
|
+
]),
|
181
|
+
_: 3
|
182
|
+
}),
|
183
|
+
!_ctx.hideTrigger ? (openBlock(), createBlock(PickerInput, {
|
184
|
+
key: 0,
|
185
|
+
class: normalizeClass(_ctx.$attrs.class),
|
186
|
+
style: normalizeStyle(_ctx.$attrs.style),
|
187
|
+
type: "year"
|
188
|
+
}, {
|
189
|
+
content: withCtx(() => [
|
190
|
+
createVNode(unref(ReusePanel))
|
191
|
+
]),
|
192
|
+
_: 1
|
193
|
+
}, 8, ["class", "style"])) : (openBlock(), createBlock(unref(ReusePanel), { key: 1 }))
|
194
|
+
], 64);
|
195
|
+
};
|
196
|
+
}
|
197
|
+
});
|
198
|
+
export {
|
199
|
+
_sfc_main as default
|
200
|
+
};
|