ep-craft 0.1.37 → 0.1.38
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/components/badge/index.js +6 -5
- package/dist/components/calendar/EpCalendar.vue.d.ts +50 -0
- package/dist/components/calendar/EpCalendar.vue.js +154 -0
- package/dist/components/calendar/EpCalendar2.vue.js +4 -0
- package/dist/components/calendar/EpDateTable.vue.d.ts +27 -0
- package/dist/components/calendar/EpDateTable.vue.js +89 -0
- package/dist/components/calendar/EpDateTable2.vue.js +4 -0
- package/dist/components/calendar/EpSelectController.vue.d.ts +8 -0
- package/dist/components/calendar/EpSelectController.vue.js +88 -0
- package/dist/components/calendar/EpSelectController2.vue.js +4 -0
- package/dist/components/calendar/calendar.d.ts +54 -0
- package/dist/components/calendar/calendar.js +45 -0
- package/dist/components/calendar/date-table.d.ts +53 -0
- package/dist/components/calendar/date-table.js +41 -0
- package/dist/components/calendar/index.d.ts +13 -2
- package/dist/components/calendar/index.js +9 -4
- package/dist/components/calendar/instance.d.ts +5 -0
- package/dist/components/calendar/select-controller.d.ts +31 -0
- package/dist/components/calendar/select-controller.js +21 -0
- package/dist/components/calendar/use-calendar.d.ts +13 -0
- package/dist/components/calendar/use-calendar.js +84 -0
- package/dist/components/calendar/use-date-table.d.ts +18 -0
- package/dist/components/calendar/use-date-table.js +99 -0
- package/dist/components/carousel/EpCarousel.vue.d.ts +1 -1
- package/dist/components/cascader/EpCascader.vue.d.ts +4 -4
- package/dist/components/config-provider/index.js +5 -4
- package/dist/components/config-provider/src/config-provider-props.d.ts +3 -6
- package/dist/components/config-provider/src/config-provider-props.js +1 -1
- package/dist/components/config-provider/src/hooks/use-global-config.js +75 -47
- package/dist/components/date-picker-panel/src/composables/use-basic-date-table.d.ts +1 -1
- package/dist/components/date-picker-panel/src/date-picker-panel.d.ts +1 -1
- package/dist/components/dialog/EpDialog.vue.d.ts +61 -0
- package/dist/components/dialog/EpDialog.vue.js +214 -0
- package/dist/components/dialog/EpDialog2.vue.js +4 -0
- package/dist/components/dialog/EpDialogContent.vue.d.ts +31 -0
- package/dist/components/dialog/EpDialogContent.vue.js +108 -0
- package/dist/components/dialog/EpDialogContent2.vue.js +4 -0
- package/dist/components/dialog/constants.d.ts +12 -0
- package/dist/components/dialog/constants.js +5 -0
- package/dist/components/dialog/dialog-content.d.ts +84 -0
- package/dist/components/dialog/dialog-content.js +90 -0
- package/dist/components/dialog/dialog.d.ts +173 -0
- package/dist/components/dialog/dialog.js +156 -0
- package/dist/components/dialog/index.d.ts +20 -2
- package/dist/components/dialog/index.js +24 -4
- package/dist/components/dialog/instance.d.ts +2 -0
- package/dist/components/dialog/use-dialog.d.ts +35 -0
- package/dist/components/dialog/use-dialog.js +176 -0
- package/dist/components/drawer/EpDrawer.vue.d.ts +67 -0
- package/dist/components/drawer/EpDrawer.vue.js +234 -0
- package/dist/components/drawer/EpDrawer2.vue.js +4 -0
- package/dist/components/drawer/drawer.d.ts +105 -0
- package/dist/components/drawer/drawer.js +42 -0
- package/dist/components/drawer/index.d.ts +14 -2
- package/dist/components/drawer/index.js +9 -4
- package/dist/components/drawer/instance.d.ts +2 -0
- package/dist/components/drawer/useResizable.d.ts +7 -0
- package/dist/components/drawer/useResizable.js +50 -0
- package/dist/components/dropdown/src/dropdown-item-impl2.vue.js +2 -2
- package/dist/components/dropdown/src/dropdown-item2.vue.js +2 -2
- package/dist/components/dropdown/src/dropdown-menu2.vue.js +2 -2
- package/dist/components/dropdown/src/dropdown2.vue.js +2 -2
- package/dist/components/empty/index.js +2 -1
- package/dist/components/form/index.js +11 -9
- package/dist/components/form/src/form-item.js +5 -5
- package/dist/components/form/src/form.js +5 -6
- package/dist/components/form-item/index.js +6 -5
- package/dist/components/infinite-scroll/index.d.ts +26 -0
- package/dist/components/infinite-scroll/index.js +15 -0
- package/dist/components/infinite-scroll/src/index.d.ts +20 -0
- package/dist/components/infinite-scroll/src/index.js +109 -0
- package/dist/components/loading/index.d.ts +15 -0
- package/dist/components/loading/index.js +13 -0
- package/dist/components/loading/src/directive.d.ts +13 -0
- package/dist/components/loading/src/directive.js +62 -0
- package/dist/components/loading/src/loading.d.ts +34 -0
- package/dist/components/loading/src/loading.js +121 -0
- package/dist/components/loading/src/service.d.ts +8 -0
- package/dist/components/loading/src/service.js +67 -0
- package/dist/components/loading/src/types.d.ts +47 -0
- package/dist/components/message/index.d.ts +3 -0
- package/dist/components/message/index.js +18 -0
- package/dist/components/message/src/instance.d.ts +18 -0
- package/dist/components/message/src/instance.js +18 -0
- package/dist/components/message/src/message.d.ts +175 -0
- package/dist/components/message/src/message.js +160 -0
- package/dist/components/message/src/message.vue.d.ts +38 -0
- package/dist/components/message/src/message.vue.js +156 -0
- package/dist/components/message/src/message2.vue.js +4 -0
- package/dist/components/message/src/method.d.ts +5 -0
- package/dist/components/message/src/method.js +123 -0
- package/dist/components/message-box/index.d.ts +6 -0
- package/dist/components/message-box/index.js +9 -0
- package/dist/components/message-box/src/index.vue.d.ts +5517 -0
- package/dist/components/message-box/src/index.vue.js +203 -0
- package/dist/components/message-box/src/index2.vue.js +237 -0
- package/dist/components/message-box/src/message-box.type.d.ts +167 -0
- package/dist/components/message-box/src/messageBox.d.ts +3 -0
- package/dist/components/message-box/src/messageBox.js +102 -0
- package/dist/components/notification/index.d.ts +3 -0
- package/dist/components/notification/index.js +15 -0
- package/dist/components/notification/src/notification.d.ts +157 -0
- package/dist/components/notification/src/notification.js +127 -0
- package/dist/components/notification/src/notification.vue.d.ts +34 -0
- package/dist/components/notification/src/notification.vue.js +146 -0
- package/dist/components/notification/src/notification2.vue.js +4 -0
- package/dist/components/notification/src/notify.d.ts +15 -0
- package/dist/components/notification/src/notify.js +100 -0
- package/dist/components/option/index.js +3 -3
- package/dist/components/overlay/index.d.ts +8 -0
- package/dist/components/overlay/overlay.d.ts +73 -0
- package/dist/components/overlay/overlay.js +80 -0
- package/dist/components/page-header/EpPageHeader.vue.d.ts +30 -0
- package/dist/components/page-header/EpPageHeader.vue.js +109 -0
- package/dist/components/page-header/EpPageHeader2.vue.js +4 -0
- package/dist/components/page-header/index.d.ts +13 -2
- package/dist/components/page-header/index.js +9 -4
- package/dist/components/page-header/instance.d.ts +2 -0
- package/dist/components/page-header/page-header.d.ts +26 -0
- package/dist/components/page-header/page-header.js +33 -0
- package/dist/components/popconfirm/EpPopconfirm.vue.d.ts +36 -0
- package/dist/components/popconfirm/EpPopconfirm.vue.js +146 -0
- package/dist/components/popconfirm/EpPopconfirm2.vue.js +4 -0
- package/dist/components/popconfirm/index.d.ts +14 -2
- package/dist/components/popconfirm/index.js +9 -4
- package/dist/components/popconfirm/instance.d.ts +2 -0
- package/dist/components/popconfirm/popconfirm.d.ts +106 -0
- package/dist/components/popconfirm/popconfirm.js +103 -0
- package/dist/components/progress/src/progress.vue.d.ts +1 -1
- package/dist/components/roving-focus-group/index.js +2 -2
- package/dist/components/roving-focus-group/src/roving-focus-group.vue.js +19 -11
- package/dist/components/roving-focus-group/src/roving-focus-group2.vue.js +11 -19
- package/dist/components/roving-focus-group/src/roving-focus-item.vue.js +76 -18
- package/dist/components/roving-focus-group/src/roving-focus-item2.vue.js +18 -76
- package/dist/components/select/index.d.ts +21 -21
- package/dist/components/select/select.vue.d.ts +7 -7
- package/dist/components/select/select2.vue.js +12 -12
- package/dist/components/select/src/option.vue.js +5 -5
- package/dist/components/select-v2/src/select.vue.d.ts +8 -8
- package/dist/components/table-v2/index.d.ts +21 -2
- package/dist/components/table-v2/index.js +11 -4
- package/dist/components/table-v2/src/EpTableV2.d.ts +359 -0
- package/dist/components/table-v2/src/EpTableV2.js +287 -0
- package/dist/components/table-v2/src/cell.d.ts +27 -0
- package/dist/components/table-v2/src/common.d.ts +42 -0
- package/dist/components/table-v2/src/common.js +38 -0
- package/dist/components/table-v2/src/components/cell.d.ts +4 -0
- package/dist/components/table-v2/src/components/cell.js +20 -0
- package/dist/components/table-v2/src/components/expand-icon.d.ts +15 -0
- package/dist/components/table-v2/src/components/expand-icon.js +30 -0
- package/dist/components/table-v2/src/components/header-cell.d.ts +4 -0
- package/dist/components/table-v2/src/components/header-cell.js +15 -0
- package/dist/components/table-v2/src/components/header-row.d.ts +59 -0
- package/dist/components/table-v2/src/components/header-row.js +41 -0
- package/dist/components/table-v2/src/components/header.d.ts +105 -0
- package/dist/components/table-v2/src/components/header.js +98 -0
- package/dist/components/table-v2/src/components/index.d.ts +11 -0
- package/dist/components/table-v2/src/components/row.d.ts +166 -0
- package/dist/components/table-v2/src/components/row.js +176 -0
- package/dist/components/table-v2/src/components/sort-icon.d.ts +9 -0
- package/dist/components/table-v2/src/components/sort-icon.js +21 -0
- package/dist/components/table-v2/src/composables/index.d.ts +11 -0
- package/dist/components/table-v2/src/composables/use-columns.d.ts +128 -0
- package/dist/components/table-v2/src/composables/use-columns.js +73 -0
- package/dist/components/table-v2/src/composables/use-data.d.ts +14 -0
- package/dist/components/table-v2/src/composables/use-data.js +33 -0
- package/dist/components/table-v2/src/composables/use-row.d.ts +31 -0
- package/dist/components/table-v2/src/composables/use-row.js +83 -0
- package/dist/components/table-v2/src/composables/use-scrollbar.d.ts +31 -0
- package/dist/components/table-v2/src/composables/use-scrollbar.js +53 -0
- package/dist/components/table-v2/src/composables/use-styles.d.ts +23 -0
- package/dist/components/table-v2/src/composables/use-styles.js +66 -0
- package/dist/components/table-v2/src/composables/utils.d.ts +3 -0
- package/dist/components/table-v2/src/composables/utils.js +19 -0
- package/dist/components/table-v2/src/constants.d.ts +18 -0
- package/dist/components/table-v2/src/constants.js +12 -0
- package/dist/components/table-v2/src/grid.d.ts +105 -0
- package/dist/components/table-v2/src/grid.js +56 -0
- package/dist/components/table-v2/src/header-cell.d.ts +13 -0
- package/dist/components/table-v2/src/header-row.d.ts +26 -0
- package/dist/components/table-v2/src/header-row.js +20 -0
- package/dist/components/table-v2/src/header.d.ts +44 -0
- package/dist/components/table-v2/src/header.js +35 -0
- package/dist/components/table-v2/src/private.d.ts +1 -0
- package/dist/components/table-v2/src/private.js +4 -0
- package/dist/components/table-v2/src/renderers/cell.d.ts +11 -0
- package/dist/components/table-v2/src/renderers/cell.js +101 -0
- package/dist/components/table-v2/src/renderers/empty.d.ts +7 -0
- package/dist/components/table-v2/src/renderers/empty.js +15 -0
- package/dist/components/table-v2/src/renderers/footer.d.ts +7 -0
- package/dist/components/table-v2/src/renderers/footer.js +14 -0
- package/dist/components/table-v2/src/renderers/header-cell.d.ts +14 -0
- package/dist/components/table-v2/src/renderers/header-cell.js +77 -0
- package/dist/components/table-v2/src/renderers/header.d.ts +9 -0
- package/dist/components/table-v2/src/renderers/header.js +53 -0
- package/dist/components/table-v2/src/renderers/left-table.d.ts +8 -0
- package/dist/components/table-v2/src/renderers/left-table.js +22 -0
- package/dist/components/table-v2/src/renderers/main-table.d.ts +8 -0
- package/dist/components/table-v2/src/renderers/main-table.js +21 -0
- package/dist/components/table-v2/src/renderers/overlay.d.ts +3 -0
- package/dist/components/table-v2/src/renderers/overlay.js +14 -0
- package/dist/components/table-v2/src/renderers/right-table.d.ts +8 -0
- package/dist/components/table-v2/src/renderers/right-table.js +22 -0
- package/dist/components/table-v2/src/renderers/row.d.ts +11 -0
- package/dist/components/table-v2/src/renderers/row.js +98 -0
- package/dist/components/table-v2/src/row.d.ts +101 -0
- package/dist/components/table-v2/src/row.js +53 -0
- package/dist/components/table-v2/src/table-grid.d.ts +236 -0
- package/dist/components/table-v2/src/table-grid.js +240 -0
- package/dist/components/table-v2/src/table.d.ts +194 -0
- package/dist/components/table-v2/src/table.js +134 -0
- package/dist/components/table-v2/src/tokens.d.ts +9 -0
- package/dist/components/table-v2/src/tokens.js +5 -0
- package/dist/components/table-v2/src/types.d.ts +99 -0
- package/dist/components/table-v2/src/use-table.d.ts +98 -0
- package/dist/components/table-v2/src/use-table.js +162 -0
- package/dist/components/table-v2/src/utils.d.ts +8 -0
- package/dist/components/table-v2/src/utils.js +15 -0
- package/dist/components/time-picker/src/time-picker-com/panel-time-pick.vue.d.ts +2 -2
- package/dist/components/time-picker/src/time-picker-com/panel-time-range.vue.d.ts +2 -2
- package/dist/components/tour/EpTour.vue.d.ts +1 -1
- package/dist/components/tree-select/src/tree-select.vue.d.ts +10 -10
- package/dist/components/tree-v2/EpTreeNode.vue.d.ts +17 -0
- package/dist/components/tree-v2/EpTreeNode.vue.js +127 -0
- package/dist/components/tree-v2/EpTreeNode2.vue.js +4 -0
- package/dist/components/tree-v2/EpTreeV2.vue.d.ts +61 -0
- package/dist/components/tree-v2/EpTreeV2.vue.js +168 -0
- package/dist/components/tree-v2/EpTreeV22.vue.js +4 -0
- package/dist/components/tree-v2/composables/useCheck.d.ts +15 -0
- package/dist/components/tree-v2/composables/useCheck.js +142 -0
- package/dist/components/tree-v2/composables/useFilter.d.ts +8 -0
- package/dist/components/tree-v2/composables/useFilter.js +50 -0
- package/dist/components/tree-v2/composables/useTree.d.ts +404 -0
- package/dist/components/tree-v2/composables/useTree.js +228 -0
- package/dist/components/tree-v2/index.d.ts +11 -2
- package/dist/components/tree-v2/index.js +5 -2
- package/dist/components/tree-v2/instance.d.ts +2 -0
- package/dist/components/tree-v2/tree-node-content.d.ts +20 -0
- package/dist/components/tree-v2/tree-node-content.js +33 -0
- package/dist/components/tree-v2/types.d.ts +97 -0
- package/dist/components/tree-v2/virtual-tree.d.ts +122 -0
- package/dist/components/tree-v2/virtual-tree.js +140 -0
- package/dist/components/virtual-list/src/builders/build-grid.d.ts +211 -0
- package/dist/components/virtual-list/src/builders/build-grid.js +449 -0
- package/dist/components/virtual-list/src/components/dynamic-size-grid.d.ts +212 -0
- package/dist/components/virtual-list/src/components/dynamic-size-grid.js +200 -0
- package/dist/components/virtual-list/src/components/fixed-size-grid.d.ts +199 -0
- package/dist/components/virtual-list/src/components/fixed-size-grid.js +126 -0
- package/dist/components/virtual-list/src/hooks/use-grid-touch.d.ts +8 -0
- package/dist/components/virtual-list/src/hooks/use-grid-touch.js +40 -0
- package/dist/components/virtual-list/src/hooks/use-grid-wheel.d.ts +13 -0
- package/dist/components/virtual-list/src/hooks/use-grid-wheel.js +30 -0
- package/dist/components/virtual-list/src/props.js +16 -17
- package/dist/components/virtual-list/src/utils.js +14 -13
- package/dist/components/watermark/EpWatermark.vue.d.ts +18 -0
- package/dist/components/watermark/EpWatermark.vue.js +174 -0
- package/dist/components/watermark/EpWatermark2.vue.js +4 -0
- package/dist/components/watermark/index.d.ts +13 -2
- package/dist/components/watermark/index.js +8 -4
- package/dist/components/watermark/instance.d.ts +2 -0
- package/dist/components/watermark/useClips.d.ts +6 -0
- package/dist/components/watermark/useClips.js +91 -0
- package/dist/components/watermark/utils.d.ts +8 -0
- package/dist/components/watermark/utils.js +21 -0
- package/dist/components/watermark/watermark.d.ts +71 -0
- package/dist/components/watermark/watermark.js +60 -0
- package/dist/constants/date.js +9 -0
- package/dist/directives/index.d.ts +11 -0
- package/dist/directives/index.js +25 -0
- package/dist/directives/trap-focus/index.js +40 -0
- package/dist/ep-craft.js +410 -373
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/use-draggable/index.d.ts +6 -0
- package/dist/hooks/use-draggable/index.js +51 -0
- package/dist/hooks/use-locale/index.js +12 -12
- package/dist/hooks/use-namespace/index.js +23 -23
- package/dist/hooks/use-same-target/index.d.ts +5 -0
- package/dist/hooks/use-same-target/index.js +20 -0
- package/dist/hooks/use-z-index/index.js +15 -15
- package/dist/index.d.ts +32 -2
- package/dist/utils/dom/aria.js +16 -12
- package/dist/utils/vue/icon.js +10 -6
- package/dist/utils/vue/install.js +23 -20
- package/dist/vendored-components.d.ts +1 -1
- package/dist/vendored-components.js +23 -3
- package/package.json +1 -1
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { withInstall as
|
|
2
|
-
import
|
|
1
|
+
import { withInstall as t } from "../../utils/with-install.js";
|
|
2
|
+
import o from "./EpBadge.vue.js";
|
|
3
3
|
import "./badge.js";
|
|
4
|
-
const
|
|
5
|
-
|
|
4
|
+
const r = t(
|
|
5
|
+
o,
|
|
6
6
|
"ep-badge"
|
|
7
7
|
);
|
|
8
8
|
export {
|
|
9
|
-
|
|
9
|
+
r as EpBadge,
|
|
10
|
+
r as default
|
|
10
11
|
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { CalendarProps } from './calendar';
|
|
2
|
+
declare var __VLS_1: {
|
|
3
|
+
date: string;
|
|
4
|
+
}, __VLS_45: {
|
|
5
|
+
data: {
|
|
6
|
+
isSelected: boolean;
|
|
7
|
+
type: string;
|
|
8
|
+
day: string;
|
|
9
|
+
date: Date;
|
|
10
|
+
};
|
|
11
|
+
}, __VLS_54: {
|
|
12
|
+
data: {
|
|
13
|
+
isSelected: boolean;
|
|
14
|
+
type: string;
|
|
15
|
+
day: string;
|
|
16
|
+
date: Date;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
type __VLS_Slots = {} & {
|
|
20
|
+
header?: (props: typeof __VLS_1) => any;
|
|
21
|
+
} & {
|
|
22
|
+
'date-cell'?: (props: typeof __VLS_45) => any;
|
|
23
|
+
} & {
|
|
24
|
+
'date-cell'?: (props: typeof __VLS_54) => any;
|
|
25
|
+
};
|
|
26
|
+
declare const __VLS_component: import("vue").DefineComponent<CalendarProps, {
|
|
27
|
+
/** @description currently selected date */
|
|
28
|
+
selectedDay: import("vue").WritableComputedRef<import("dayjs").Dayjs | undefined, import("dayjs").Dayjs | undefined>;
|
|
29
|
+
/** @description select a specific date */
|
|
30
|
+
pickDay: (day: import("dayjs").Dayjs) => void;
|
|
31
|
+
/** @description select date */
|
|
32
|
+
selectDate: (type: import("./calendar").CalendarDateType) => void;
|
|
33
|
+
/** @description Calculate the validate date range according to the start and end dates */
|
|
34
|
+
calculateValidatedDateRange: (startDayjs: import("dayjs").Dayjs, endDayjs: import("dayjs").Dayjs) => [import("dayjs").Dayjs, import("dayjs").Dayjs][];
|
|
35
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
36
|
+
"update:modelValue": (value: Date) => void;
|
|
37
|
+
input: (value: Date) => void;
|
|
38
|
+
}, string, import("vue").PublicProps, Readonly<CalendarProps> & Readonly<{
|
|
39
|
+
"onUpdate:modelValue"?: ((value: Date) => any) | undefined;
|
|
40
|
+
onInput?: ((value: Date) => any) | undefined;
|
|
41
|
+
}>, {
|
|
42
|
+
controllerType: "button" | "select";
|
|
43
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
44
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
45
|
+
export default _default;
|
|
46
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
47
|
+
new (): {
|
|
48
|
+
$slots: S;
|
|
49
|
+
};
|
|
50
|
+
};
|
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
import { defineComponent as L, computed as O, openBlock as r, createElementBlock as d, normalizeClass as l, unref as e, createElementVNode as E, renderSlot as g, toDisplayString as k, createVNode as s, withCtx as i, createTextVNode as h, createCommentVNode as w, createSlots as N, normalizeProps as x, guardReactiveProps as A, Fragment as F, renderList as G, createBlock as j, mergeProps as q } from "vue";
|
|
2
|
+
import { EpButton as C } from "../button/index.js";
|
|
3
|
+
import { EpButtonGroup as H } from "../button-group/index.js";
|
|
4
|
+
import { useNamespace as I } from "../../hooks/use-namespace/index.js";
|
|
5
|
+
import "@vue/shared";
|
|
6
|
+
import "lodash-unified";
|
|
7
|
+
import "@vueuse/core";
|
|
8
|
+
import "@element-plus/icons-vue";
|
|
9
|
+
import { useLocale as J } from "../../hooks/use-locale/index.js";
|
|
10
|
+
import "../../hooks/use-size/index.js";
|
|
11
|
+
import "@popperjs/core";
|
|
12
|
+
import "../../hooks/use-z-index/index.js";
|
|
13
|
+
import "../../hooks/use-delayed-toggle/index.js";
|
|
14
|
+
import "../../hooks/use-aria/index.js";
|
|
15
|
+
import "../../hooks/use-model-toggle/index.js";
|
|
16
|
+
import "../../hooks/use-empty-values/index.js";
|
|
17
|
+
import P from "./EpDateTable.vue.js";
|
|
18
|
+
import { useCalendar as K } from "./use-calendar.js";
|
|
19
|
+
import { calendarEmits as Q } from "./calendar.js";
|
|
20
|
+
import U from "./EpSelectController.vue.js";
|
|
21
|
+
const b = "EpCalendar", ke = /* @__PURE__ */ L({
|
|
22
|
+
name: b,
|
|
23
|
+
__name: "EpCalendar",
|
|
24
|
+
props: {
|
|
25
|
+
modelValue: {},
|
|
26
|
+
range: {},
|
|
27
|
+
controllerType: { default: "button" },
|
|
28
|
+
formatter: {}
|
|
29
|
+
},
|
|
30
|
+
emits: Q,
|
|
31
|
+
setup(c, { expose: M, emit: V }) {
|
|
32
|
+
const t = I("calendar"), z = c, B = V, {
|
|
33
|
+
calculateValidatedDateRange: T,
|
|
34
|
+
date: p,
|
|
35
|
+
pickDay: y,
|
|
36
|
+
realSelectedDay: v,
|
|
37
|
+
selectDate: u,
|
|
38
|
+
validatedRange: f,
|
|
39
|
+
handleDateChange: S
|
|
40
|
+
} = K(z, B, b), { t: m } = J(), $ = O(() => {
|
|
41
|
+
const a = `el.datepicker.month${p.value.format("M")}`;
|
|
42
|
+
return `${p.value.year()} ${m("el.datepicker.year")} ${m(a)}`;
|
|
43
|
+
});
|
|
44
|
+
return M({
|
|
45
|
+
/** @description currently selected date */
|
|
46
|
+
selectedDay: v,
|
|
47
|
+
/** @description select a specific date */
|
|
48
|
+
pickDay: y,
|
|
49
|
+
/** @description select date */
|
|
50
|
+
selectDate: u,
|
|
51
|
+
/** @description Calculate the validate date range according to the start and end dates */
|
|
52
|
+
calculateValidatedDateRange: T
|
|
53
|
+
}), (a, n) => (r(), d("div", {
|
|
54
|
+
class: l(e(t).b())
|
|
55
|
+
}, [
|
|
56
|
+
E("div", {
|
|
57
|
+
class: l(e(t).e("header"))
|
|
58
|
+
}, [
|
|
59
|
+
g(a.$slots, "header", { date: $.value }, () => [
|
|
60
|
+
E("div", {
|
|
61
|
+
class: l(e(t).e("title"))
|
|
62
|
+
}, k($.value), 3),
|
|
63
|
+
e(f).length === 0 && c.controllerType === "button" ? (r(), d("div", {
|
|
64
|
+
key: 0,
|
|
65
|
+
class: l(e(t).e("button-group"))
|
|
66
|
+
}, [
|
|
67
|
+
s(e(H), null, {
|
|
68
|
+
default: i(() => [
|
|
69
|
+
s(e(C), {
|
|
70
|
+
size: "small",
|
|
71
|
+
onClick: n[0] || (n[0] = (o) => e(u)("prev-month"))
|
|
72
|
+
}, {
|
|
73
|
+
default: i(() => [
|
|
74
|
+
h(k(e(m)("el.datepicker.prevMonth")), 1)
|
|
75
|
+
]),
|
|
76
|
+
_: 1
|
|
77
|
+
}),
|
|
78
|
+
s(e(C), {
|
|
79
|
+
size: "small",
|
|
80
|
+
onClick: n[1] || (n[1] = (o) => e(u)("today"))
|
|
81
|
+
}, {
|
|
82
|
+
default: i(() => [
|
|
83
|
+
h(k(e(m)("el.datepicker.today")), 1)
|
|
84
|
+
]),
|
|
85
|
+
_: 1
|
|
86
|
+
}),
|
|
87
|
+
s(e(C), {
|
|
88
|
+
size: "small",
|
|
89
|
+
onClick: n[2] || (n[2] = (o) => e(u)("next-month"))
|
|
90
|
+
}, {
|
|
91
|
+
default: i(() => [
|
|
92
|
+
h(k(e(m)("el.datepicker.nextMonth")), 1)
|
|
93
|
+
]),
|
|
94
|
+
_: 1
|
|
95
|
+
})
|
|
96
|
+
]),
|
|
97
|
+
_: 1
|
|
98
|
+
})
|
|
99
|
+
], 2)) : e(f).length === 0 && c.controllerType === "select" ? (r(), d("div", {
|
|
100
|
+
key: 1,
|
|
101
|
+
class: l(e(t).e("select-controller"))
|
|
102
|
+
}, [
|
|
103
|
+
s(U, {
|
|
104
|
+
date: e(p),
|
|
105
|
+
formatter: c.formatter,
|
|
106
|
+
onDateChange: e(S)
|
|
107
|
+
}, null, 8, ["date", "formatter", "onDateChange"])
|
|
108
|
+
], 2)) : w("", !0)
|
|
109
|
+
])
|
|
110
|
+
], 2),
|
|
111
|
+
e(f).length === 0 ? (r(), d("div", {
|
|
112
|
+
key: 0,
|
|
113
|
+
class: l(e(t).e("body"))
|
|
114
|
+
}, [
|
|
115
|
+
s(P, {
|
|
116
|
+
date: e(p),
|
|
117
|
+
"selected-day": e(v),
|
|
118
|
+
onPick: e(y)
|
|
119
|
+
}, N({ _: 2 }, [
|
|
120
|
+
a.$slots["date-cell"] ? {
|
|
121
|
+
name: "date-cell",
|
|
122
|
+
fn: i((o) => [
|
|
123
|
+
g(a.$slots, "date-cell", x(A(o)))
|
|
124
|
+
]),
|
|
125
|
+
key: "0"
|
|
126
|
+
} : void 0
|
|
127
|
+
]), 1032, ["date", "selected-day", "onPick"])
|
|
128
|
+
], 2)) : (r(), d("div", {
|
|
129
|
+
key: 1,
|
|
130
|
+
class: l(e(t).e("body"))
|
|
131
|
+
}, [
|
|
132
|
+
(r(!0), d(F, null, G(e(f), (o, D) => (r(), j(P, {
|
|
133
|
+
key: D,
|
|
134
|
+
date: o[0],
|
|
135
|
+
"selected-day": e(v),
|
|
136
|
+
range: o,
|
|
137
|
+
"hide-header": D !== 0,
|
|
138
|
+
onPick: e(y)
|
|
139
|
+
}, N({ _: 2 }, [
|
|
140
|
+
a.$slots["date-cell"] ? {
|
|
141
|
+
name: "date-cell",
|
|
142
|
+
fn: i((R) => [
|
|
143
|
+
g(a.$slots, "date-cell", q({ ref_for: !0 }, R))
|
|
144
|
+
]),
|
|
145
|
+
key: "0"
|
|
146
|
+
} : void 0
|
|
147
|
+
]), 1032, ["date", "selected-day", "range", "hide-header", "onPick"]))), 128))
|
|
148
|
+
], 2))
|
|
149
|
+
], 2));
|
|
150
|
+
}
|
|
151
|
+
});
|
|
152
|
+
export {
|
|
153
|
+
ke as default
|
|
154
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import type { DateTableProps } from './date-table';
|
|
2
|
+
declare var __VLS_1: {
|
|
3
|
+
data: {
|
|
4
|
+
isSelected: boolean;
|
|
5
|
+
type: string;
|
|
6
|
+
day: string;
|
|
7
|
+
date: Date;
|
|
8
|
+
};
|
|
9
|
+
};
|
|
10
|
+
type __VLS_Slots = {} & {
|
|
11
|
+
'date-cell'?: (props: typeof __VLS_1) => any;
|
|
12
|
+
};
|
|
13
|
+
declare const __VLS_component: import("vue").DefineComponent<DateTableProps, {
|
|
14
|
+
/** @description toggle date panel */
|
|
15
|
+
getFormattedDate: (day: number, type: import("./date-table").CalendarDateCellType) => import("dayjs").Dayjs;
|
|
16
|
+
}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
pick: (value: import("dayjs").Dayjs) => void;
|
|
18
|
+
}, string, import("vue").PublicProps, Readonly<DateTableProps> & Readonly<{
|
|
19
|
+
onPick?: ((value: import("dayjs").Dayjs) => any) | undefined;
|
|
20
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
21
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
22
|
+
export default _default;
|
|
23
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
24
|
+
new (): {
|
|
25
|
+
$slots: S;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
import { defineComponent as v, openBlock as a, createElementBlock as r, normalizeClass as i, unref as e, createElementVNode as m, Fragment as u, renderList as h, toDisplayString as f, createCommentVNode as x, renderSlot as F } from "vue";
|
|
2
|
+
import { useNamespace as D } from "../../hooks/use-namespace/index.js";
|
|
3
|
+
import "@vue/shared";
|
|
4
|
+
import "lodash-unified";
|
|
5
|
+
import "@vueuse/core";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import "../../hooks/use-size/index.js";
|
|
8
|
+
import "@popperjs/core";
|
|
9
|
+
import "../../hooks/use-z-index/index.js";
|
|
10
|
+
import "../../hooks/use-delayed-toggle/index.js";
|
|
11
|
+
import "../../hooks/use-aria/index.js";
|
|
12
|
+
import "../../hooks/use-model-toggle/index.js";
|
|
13
|
+
import "../../hooks/use-empty-values/index.js";
|
|
14
|
+
import { dateTableEmits as V } from "./date-table.js";
|
|
15
|
+
import { useDateTable as $ } from "./use-date-table.js";
|
|
16
|
+
const z = { key: 0 }, I = ["onClick"], Z = /* @__PURE__ */ v({
|
|
17
|
+
name: "EpDateTable",
|
|
18
|
+
__name: "EpDateTable",
|
|
19
|
+
props: {
|
|
20
|
+
selectedDay: {},
|
|
21
|
+
range: {},
|
|
22
|
+
date: {},
|
|
23
|
+
hideHeader: { type: Boolean }
|
|
24
|
+
},
|
|
25
|
+
emits: V,
|
|
26
|
+
setup(c, { expose: g, emit: k }) {
|
|
27
|
+
const y = c, C = k, {
|
|
28
|
+
isInRange: w,
|
|
29
|
+
now: E,
|
|
30
|
+
rows: S,
|
|
31
|
+
weekDays: T,
|
|
32
|
+
getFormattedDate: b,
|
|
33
|
+
handlePickDay: _,
|
|
34
|
+
getSlotData: B
|
|
35
|
+
} = $(y, C), s = D("calendar-table"), d = D("calendar-day"), H = ({ text: p, type: n }) => {
|
|
36
|
+
const t = [n];
|
|
37
|
+
if (n === "current") {
|
|
38
|
+
const o = b(p, n);
|
|
39
|
+
o.isSame(y.selectedDay, "day") && t.push(d.is("selected")), o.isSame(E, "day") && t.push(d.is("today"));
|
|
40
|
+
}
|
|
41
|
+
return t;
|
|
42
|
+
};
|
|
43
|
+
return g({
|
|
44
|
+
/** @description toggle date panel */
|
|
45
|
+
getFormattedDate: b
|
|
46
|
+
}), (p, n) => (a(), r("table", {
|
|
47
|
+
class: i([e(s).b(), e(s).is("range", e(w))]),
|
|
48
|
+
cellspacing: "0",
|
|
49
|
+
cellpadding: "0"
|
|
50
|
+
}, [
|
|
51
|
+
c.hideHeader ? x("", !0) : (a(), r("thead", z, [
|
|
52
|
+
m("tr", null, [
|
|
53
|
+
(a(!0), r(u, null, h(e(T), (t) => (a(), r("th", {
|
|
54
|
+
key: t,
|
|
55
|
+
scope: "col"
|
|
56
|
+
}, f(t), 1))), 128))
|
|
57
|
+
])
|
|
58
|
+
])),
|
|
59
|
+
m("tbody", null, [
|
|
60
|
+
(a(!0), r(u, null, h(e(S), (t, o) => (a(), r("tr", {
|
|
61
|
+
key: o,
|
|
62
|
+
class: i({
|
|
63
|
+
[e(s).e("row")]: !0,
|
|
64
|
+
[e(s).em("row", "hide-border")]: o === 0 && c.hideHeader
|
|
65
|
+
})
|
|
66
|
+
}, [
|
|
67
|
+
(a(!0), r(u, null, h(t, (l, N) => (a(), r("td", {
|
|
68
|
+
key: N,
|
|
69
|
+
class: i(H(l)),
|
|
70
|
+
onClick: (L) => e(_)(l)
|
|
71
|
+
}, [
|
|
72
|
+
m("div", {
|
|
73
|
+
class: i(e(d).b())
|
|
74
|
+
}, [
|
|
75
|
+
F(p.$slots, "date-cell", {
|
|
76
|
+
data: e(B)(l)
|
|
77
|
+
}, () => [
|
|
78
|
+
m("span", null, f(l.text), 1)
|
|
79
|
+
])
|
|
80
|
+
], 2)
|
|
81
|
+
], 10, I))), 128))
|
|
82
|
+
], 2))), 128))
|
|
83
|
+
])
|
|
84
|
+
], 2));
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
export {
|
|
88
|
+
Z as default
|
|
89
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
import type { SelectControllerProps } from './select-controller';
|
|
3
|
+
declare const _default: import("vue").DefineComponent<SelectControllerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
4
|
+
"date-change": (date: "today" | dayjs.Dayjs) => void;
|
|
5
|
+
}, string, import("vue").PublicProps, Readonly<SelectControllerProps> & Readonly<{
|
|
6
|
+
"onDate-change"?: ((date: "today" | dayjs.Dayjs) => any) | undefined;
|
|
7
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
8
|
+
export default _default;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
import { defineComponent as z, computed as m, openBlock as V, createElementBlock as w, Fragment as B, createVNode as c, unref as o, normalizeClass as d, withCtx as D, createTextVNode as F, toDisplayString as N } from "vue";
|
|
2
|
+
import f from "dayjs";
|
|
3
|
+
import { useNamespace as b } from "../../hooks/use-namespace/index.js";
|
|
4
|
+
import { isFunction as h } from "@vue/shared";
|
|
5
|
+
import "lodash-unified";
|
|
6
|
+
import "@vueuse/core";
|
|
7
|
+
import "@element-plus/icons-vue";
|
|
8
|
+
import { useLocale as M } from "../../hooks/use-locale/index.js";
|
|
9
|
+
import "../../hooks/use-size/index.js";
|
|
10
|
+
import "@popperjs/core";
|
|
11
|
+
import "../../hooks/use-z-index/index.js";
|
|
12
|
+
import "../../hooks/use-delayed-toggle/index.js";
|
|
13
|
+
import "../../hooks/use-aria/index.js";
|
|
14
|
+
import "../../hooks/use-model-toggle/index.js";
|
|
15
|
+
import "../../hooks/use-empty-values/index.js";
|
|
16
|
+
import { EpSelect as v } from "../select/index.js";
|
|
17
|
+
import { EpButton as O } from "../button/index.js";
|
|
18
|
+
import { selectControllerEmits as T } from "./select-controller.js";
|
|
19
|
+
const ee = /* @__PURE__ */ z({
|
|
20
|
+
name: "EpSelectController",
|
|
21
|
+
__name: "EpSelectController",
|
|
22
|
+
props: {
|
|
23
|
+
date: {},
|
|
24
|
+
formatter: { type: Function }
|
|
25
|
+
},
|
|
26
|
+
emits: T,
|
|
27
|
+
setup(y, { emit: g }) {
|
|
28
|
+
const a = y, n = g, i = b("calendar-select"), { t: C, lang: p } = M(), _ = Array.from({ length: 12 }, (e, l) => {
|
|
29
|
+
const t = l + 1, s = h(a.formatter) ? a.formatter(t, "month") : t;
|
|
30
|
+
return {
|
|
31
|
+
value: t,
|
|
32
|
+
label: s
|
|
33
|
+
};
|
|
34
|
+
}), r = m(() => a.date.year()), u = m(() => a.date.month() + 1), E = m(() => {
|
|
35
|
+
const e = [];
|
|
36
|
+
for (let l = -10; l < 10; l++) {
|
|
37
|
+
const t = r.value + l;
|
|
38
|
+
if (t > 0) {
|
|
39
|
+
const s = h(a.formatter) ? a.formatter(t, "year") : t;
|
|
40
|
+
e.push({ value: t, label: s });
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
return e;
|
|
44
|
+
}), S = (e) => {
|
|
45
|
+
n(
|
|
46
|
+
"date-change",
|
|
47
|
+
f(new Date(e, u.value - 1, 1)).locale(p.value)
|
|
48
|
+
);
|
|
49
|
+
}, k = (e) => {
|
|
50
|
+
n(
|
|
51
|
+
"date-change",
|
|
52
|
+
f(new Date(r.value, e - 1, 1)).locale(p.value)
|
|
53
|
+
);
|
|
54
|
+
}, x = () => {
|
|
55
|
+
n("date-change", "today");
|
|
56
|
+
};
|
|
57
|
+
return (e, l) => (V(), w(B, null, [
|
|
58
|
+
c(o(v), {
|
|
59
|
+
"model-value": r.value,
|
|
60
|
+
size: "small",
|
|
61
|
+
class: d(o(i).e("year")),
|
|
62
|
+
"validate-event": !1,
|
|
63
|
+
options: E.value,
|
|
64
|
+
onChange: S
|
|
65
|
+
}, null, 8, ["model-value", "class", "options"]),
|
|
66
|
+
c(o(v), {
|
|
67
|
+
"model-value": u.value,
|
|
68
|
+
size: "small",
|
|
69
|
+
class: d(o(i).e("month")),
|
|
70
|
+
"validate-event": !1,
|
|
71
|
+
options: o(_),
|
|
72
|
+
onChange: k
|
|
73
|
+
}, null, 8, ["model-value", "class", "options"]),
|
|
74
|
+
c(o(O), {
|
|
75
|
+
size: "small",
|
|
76
|
+
onClick: x
|
|
77
|
+
}, {
|
|
78
|
+
default: D(() => [
|
|
79
|
+
F(N(o(C)("el.datepicker.today")), 1)
|
|
80
|
+
]),
|
|
81
|
+
_: 1
|
|
82
|
+
})
|
|
83
|
+
], 64));
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
export {
|
|
87
|
+
ee as default
|
|
88
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
export type CalendarDateType = 'prev-month' | 'next-month' | 'prev-year' | 'next-year' | 'today';
|
|
3
|
+
export interface CalendarProps {
|
|
4
|
+
/**
|
|
5
|
+
* @description binding value
|
|
6
|
+
*/
|
|
7
|
+
modelValue?: Date;
|
|
8
|
+
/**
|
|
9
|
+
* @description time range, including start time and end time.
|
|
10
|
+
* Start time must be start day of week, end time must be end day of week, the time span cannot exceed two months.
|
|
11
|
+
*/
|
|
12
|
+
range?: [Date, Date];
|
|
13
|
+
/**
|
|
14
|
+
* @description type of the controller for the Calendar header
|
|
15
|
+
*/
|
|
16
|
+
controllerType?: 'button' | 'select';
|
|
17
|
+
/**
|
|
18
|
+
* @description format label when `controller-type` is 'select'
|
|
19
|
+
*/
|
|
20
|
+
formatter?: (value: number, type: 'year' | 'month') => string | number;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @deprecated Removed after 3.0.0, Use `CalendarProps` instead.
|
|
24
|
+
*/
|
|
25
|
+
export declare const calendarProps: {
|
|
26
|
+
readonly modelValue: {
|
|
27
|
+
readonly type: import("vue").PropType<Date>;
|
|
28
|
+
readonly required: false;
|
|
29
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
30
|
+
__epPropKey: true;
|
|
31
|
+
};
|
|
32
|
+
readonly range: {
|
|
33
|
+
readonly type: import("vue").PropType<[Date, Date]>;
|
|
34
|
+
readonly required: false;
|
|
35
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
36
|
+
__epPropKey: true;
|
|
37
|
+
};
|
|
38
|
+
readonly controllerType: import("../../utils").EpPropFinalized<StringConstructor, "button" | "select", unknown, "button", boolean>;
|
|
39
|
+
readonly formatter: {
|
|
40
|
+
readonly type: import("vue").PropType<(value: number, type: "year" | "month") => string | number>;
|
|
41
|
+
readonly required: false;
|
|
42
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
43
|
+
__epPropKey: true;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Removed after 3.0.0, Use `CalendarProps` instead.
|
|
48
|
+
*/
|
|
49
|
+
export type CalendarPropsPublic = ExtractPublicPropTypes<typeof calendarProps>;
|
|
50
|
+
export declare const calendarEmits: {
|
|
51
|
+
"update:modelValue": (value: Date) => boolean;
|
|
52
|
+
input: (value: Date) => boolean;
|
|
53
|
+
};
|
|
54
|
+
export type CalendarEmits = typeof calendarEmits;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { isArray as i, isDate as r } from "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import { INPUT_EVENT as p, UPDATE_MODEL_EVENT as a } from "../../constants/event.js";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import { buildProps as m, definePropType as e } from "../../utils/vue/props/runtime.js";
|
|
7
|
+
import "vue";
|
|
8
|
+
const l = (t) => i(t) && t.length === 2 && t.every((o) => r(o));
|
|
9
|
+
m({
|
|
10
|
+
/**
|
|
11
|
+
* @description binding value
|
|
12
|
+
*/
|
|
13
|
+
modelValue: {
|
|
14
|
+
type: Date
|
|
15
|
+
},
|
|
16
|
+
/**
|
|
17
|
+
* @description time range, including start time and end time.
|
|
18
|
+
* Start time must be start day of week, end time must be end day of week, the time span cannot exceed two months.
|
|
19
|
+
*/
|
|
20
|
+
range: {
|
|
21
|
+
type: e(Array),
|
|
22
|
+
validator: l
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* @description type of the controller for the Calendar header
|
|
26
|
+
*/
|
|
27
|
+
controllerType: {
|
|
28
|
+
type: String,
|
|
29
|
+
values: ["button", "select"],
|
|
30
|
+
default: "button"
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* @description format label when `controller-type` is 'select'
|
|
34
|
+
*/
|
|
35
|
+
formatter: {
|
|
36
|
+
type: e(Function)
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
const f = {
|
|
40
|
+
[a]: (t) => r(t),
|
|
41
|
+
[p]: (t) => r(t)
|
|
42
|
+
};
|
|
43
|
+
export {
|
|
44
|
+
f as calendarEmits
|
|
45
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import type { ExtractPublicPropTypes } from 'vue';
|
|
2
|
+
import type { Dayjs } from 'dayjs';
|
|
3
|
+
export type CalendarDateCellType = 'next' | 'prev' | 'current';
|
|
4
|
+
export type CalendarDateCell = {
|
|
5
|
+
text: number;
|
|
6
|
+
type: CalendarDateCellType;
|
|
7
|
+
};
|
|
8
|
+
export declare const getPrevMonthLastDays: (date: Dayjs, count: number) => number[];
|
|
9
|
+
export declare const getMonthDays: (date: Dayjs) => number[];
|
|
10
|
+
export declare const toNestedArr: (days: CalendarDateCell[]) => CalendarDateCell[][];
|
|
11
|
+
export interface DateTableProps {
|
|
12
|
+
selectedDay?: Dayjs;
|
|
13
|
+
range?: [Dayjs, Dayjs];
|
|
14
|
+
date: Dayjs;
|
|
15
|
+
hideHeader?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* @deprecated Removed after 3.0.0, Use `DateTableProps` instead.
|
|
19
|
+
*/
|
|
20
|
+
export declare const dateTableProps: {
|
|
21
|
+
readonly selectedDay: {
|
|
22
|
+
readonly type: import("vue").PropType<Dayjs>;
|
|
23
|
+
readonly required: false;
|
|
24
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
25
|
+
__epPropKey: true;
|
|
26
|
+
};
|
|
27
|
+
readonly range: {
|
|
28
|
+
readonly type: import("vue").PropType<[Dayjs, Dayjs]>;
|
|
29
|
+
readonly required: false;
|
|
30
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
31
|
+
__epPropKey: true;
|
|
32
|
+
};
|
|
33
|
+
readonly date: {
|
|
34
|
+
readonly type: import("vue").PropType<Dayjs>;
|
|
35
|
+
readonly required: true;
|
|
36
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
37
|
+
__epPropKey: true;
|
|
38
|
+
};
|
|
39
|
+
readonly hideHeader: {
|
|
40
|
+
readonly type: import("vue").PropType<import("../../utils").EpPropMergeType<BooleanConstructor, unknown, unknown>>;
|
|
41
|
+
readonly required: false;
|
|
42
|
+
readonly validator: ((val: unknown) => boolean) | undefined;
|
|
43
|
+
__epPropKey: true;
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
/**
|
|
47
|
+
* @deprecated Removed after 3.0.0, Use `DateTableProps` instead.
|
|
48
|
+
*/
|
|
49
|
+
export type DateTablePropsPublic = ExtractPublicPropTypes<typeof dateTableProps>;
|
|
50
|
+
export declare const dateTableEmits: {
|
|
51
|
+
pick: (value: Dayjs) => boolean;
|
|
52
|
+
};
|
|
53
|
+
export type DateTableEmits = typeof dateTableEmits;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { isObject as p } from "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "@element-plus/icons-vue";
|
|
5
|
+
import { buildProps as m, definePropType as o } from "../../utils/vue/props/runtime.js";
|
|
6
|
+
import "vue";
|
|
7
|
+
import { rangeArr as a } from "../time-picker/src/utils.js";
|
|
8
|
+
const u = (t, e) => {
|
|
9
|
+
const r = t.subtract(1, "month").endOf("month").date();
|
|
10
|
+
return a(e).map((n, s) => r - (e - s - 1));
|
|
11
|
+
}, f = (t) => {
|
|
12
|
+
const e = t.daysInMonth();
|
|
13
|
+
return a(e).map((r, n) => n + 1);
|
|
14
|
+
}, g = (t) => a(t.length / 7).map((e) => {
|
|
15
|
+
const r = e * 7;
|
|
16
|
+
return t.slice(r, r + 7);
|
|
17
|
+
});
|
|
18
|
+
m({
|
|
19
|
+
selectedDay: {
|
|
20
|
+
type: o(Object)
|
|
21
|
+
},
|
|
22
|
+
range: {
|
|
23
|
+
type: o(Array)
|
|
24
|
+
},
|
|
25
|
+
date: {
|
|
26
|
+
type: o(Object),
|
|
27
|
+
required: !0
|
|
28
|
+
},
|
|
29
|
+
hideHeader: {
|
|
30
|
+
type: Boolean
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const D = {
|
|
34
|
+
pick: (t) => p(t)
|
|
35
|
+
};
|
|
36
|
+
export {
|
|
37
|
+
D as dateTableEmits,
|
|
38
|
+
f as getMonthDays,
|
|
39
|
+
u as getPrevMonthLastDays,
|
|
40
|
+
g as toNestedArr
|
|
41
|
+
};
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
|
-
import
|
|
3
|
-
|
|
2
|
+
import _EpCalendar from './EpCalendar.vue';
|
|
3
|
+
/**
|
|
4
|
+
* calendar 自持 barrel:用本地安装辅助把搬运来的日历本体注册为 `ep-calendar`。
|
|
5
|
+
*
|
|
6
|
+
* - 必须使用 `../../utils/with-install`(本地版):第二参是显式注册名;
|
|
7
|
+
* 上游版会把字符串按 `Object.values()` 逐字符展开。
|
|
8
|
+
* - 不导出 `ElCalendar` 别名:本体已自持,别名只会与 `EpCalendar` 争抢 `.install`。
|
|
9
|
+
* - `calendarProps` / `calendarEmits` 与各类型保持迁移前的导出名与签名。
|
|
10
|
+
*/
|
|
11
|
+
export declare const EpCalendar: typeof _EpCalendar & Plugin;
|
|
4
12
|
export default EpCalendar;
|
|
13
|
+
export { calendarEmits, calendarProps } from './calendar';
|
|
14
|
+
export type { CalendarDateType, CalendarEmits, CalendarProps, CalendarPropsPublic, } from './calendar';
|
|
15
|
+
export type { CalendarDateTableInstance, CalendarInstance, DateTableInstance, } from './instance';
|