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
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const EpInfiniteScroll: import("@element-plus/utils").SFCWithInstall<import("vue").ObjectDirective<HTMLElement & {
|
|
2
|
+
ElInfiniteScroll: {
|
|
3
|
+
container: HTMLElement | Window;
|
|
4
|
+
containerEl: HTMLElement;
|
|
5
|
+
instance: import("vue").ComponentPublicInstance;
|
|
6
|
+
delay: number;
|
|
7
|
+
lastScrollTop: number;
|
|
8
|
+
cb: () => void;
|
|
9
|
+
onScroll: () => void;
|
|
10
|
+
observer?: MutationObserver;
|
|
11
|
+
};
|
|
12
|
+
}, () => void, string, any>>;
|
|
13
|
+
/** 同一 InfiniteScroll 指令对象的第二个公开名(需求 6.1)。 */
|
|
14
|
+
export declare const vInfiniteScroll: import("@element-plus/utils").SFCWithInstall<import("vue").ObjectDirective<HTMLElement & {
|
|
15
|
+
ElInfiniteScroll: {
|
|
16
|
+
container: HTMLElement | Window;
|
|
17
|
+
containerEl: HTMLElement;
|
|
18
|
+
instance: import("vue").ComponentPublicInstance;
|
|
19
|
+
delay: number;
|
|
20
|
+
lastScrollTop: number;
|
|
21
|
+
cb: () => void;
|
|
22
|
+
onScroll: () => void;
|
|
23
|
+
observer?: MutationObserver;
|
|
24
|
+
};
|
|
25
|
+
}, () => void, string, any>>;
|
|
26
|
+
export default EpInfiniteScroll;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "@element-plus/icons-vue";
|
|
5
|
+
import "vue";
|
|
6
|
+
import { withInstallDirective as i } from "../../utils/vue/install.js";
|
|
7
|
+
import t from "./src/index.js";
|
|
8
|
+
const o = i(
|
|
9
|
+
t,
|
|
10
|
+
"InfiniteScroll"
|
|
11
|
+
), f = o;
|
|
12
|
+
export {
|
|
13
|
+
o as EpInfiniteScroll,
|
|
14
|
+
f as vInfiniteScroll
|
|
15
|
+
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { ComponentPublicInstance, ObjectDirective } from 'vue';
|
|
2
|
+
export declare const SCOPE = "ElInfiniteScroll";
|
|
3
|
+
export declare const CHECK_INTERVAL = 50;
|
|
4
|
+
export declare const DEFAULT_DELAY = 200;
|
|
5
|
+
export declare const DEFAULT_DISTANCE = 0;
|
|
6
|
+
type InfiniteScrollCallback = () => void;
|
|
7
|
+
type InfiniteScrollEl = HTMLElement & {
|
|
8
|
+
[SCOPE]: {
|
|
9
|
+
container: HTMLElement | Window;
|
|
10
|
+
containerEl: HTMLElement;
|
|
11
|
+
instance: ComponentPublicInstance;
|
|
12
|
+
delay: number;
|
|
13
|
+
lastScrollTop: number;
|
|
14
|
+
cb: InfiniteScrollCallback;
|
|
15
|
+
onScroll: () => void;
|
|
16
|
+
observer?: MutationObserver;
|
|
17
|
+
};
|
|
18
|
+
};
|
|
19
|
+
declare const InfiniteScroll: ObjectDirective<InfiniteScrollEl, InfiniteScrollCallback>;
|
|
20
|
+
export default InfiniteScroll;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { nextTick as b } from "vue";
|
|
2
|
+
import { throttle as v } from "lodash-unified";
|
|
3
|
+
import { isFunction as H } from "@vue/shared";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { throwError as L } from "../../../utils/error.js";
|
|
6
|
+
import { getOffsetTopDistance as N } from "../../../utils/dom/position.js";
|
|
7
|
+
import { getScrollContainer as w } from "../../../utils/dom/scroll.js";
|
|
8
|
+
import "@element-plus/icons-vue";
|
|
9
|
+
import "../../../hooks/use-size/index.js";
|
|
10
|
+
import { useDeprecated as A } from "../../../hooks/use-deprecated/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
|
+
const i = "ElInfiniteScroll", D = 50, O = 200, C = 0, F = {
|
|
18
|
+
delay: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: O
|
|
21
|
+
},
|
|
22
|
+
distance: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: C
|
|
25
|
+
},
|
|
26
|
+
disabled: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: !1
|
|
29
|
+
},
|
|
30
|
+
immediate: {
|
|
31
|
+
type: Boolean,
|
|
32
|
+
default: !0
|
|
33
|
+
}
|
|
34
|
+
}, p = (t, e) => Object.entries(F).reduce((r, [o, c]) => {
|
|
35
|
+
const { type: a, default: s } = c, l = t.getAttribute(`infinite-scroll-${o}`);
|
|
36
|
+
let n = e[l] ?? l ?? s;
|
|
37
|
+
return n = n === "false" ? !1 : n, n = a(n), r[o] = Number.isNaN(n) ? s : n, r;
|
|
38
|
+
}, {}), h = (t) => {
|
|
39
|
+
const { observer: e } = t[i];
|
|
40
|
+
e && (e.disconnect(), delete t[i].observer);
|
|
41
|
+
}, I = (t, e) => {
|
|
42
|
+
const { container: r, containerEl: o, instance: c, observer: a, lastScrollTop: s } = t[i], { disabled: l, distance: n } = p(t, c), { clientHeight: u, scrollHeight: g, scrollTop: f } = o, E = f - s;
|
|
43
|
+
if (t[i].lastScrollTop = f, a || l || E < 0) return;
|
|
44
|
+
let d = !1;
|
|
45
|
+
if (r === t)
|
|
46
|
+
d = g - (u + f) <= n;
|
|
47
|
+
else {
|
|
48
|
+
const { clientTop: T, scrollHeight: S } = t, y = N(t, o);
|
|
49
|
+
d = f + u >= y + T + S - n;
|
|
50
|
+
}
|
|
51
|
+
d && e.call(c);
|
|
52
|
+
};
|
|
53
|
+
function m(t, e) {
|
|
54
|
+
const { containerEl: r, instance: o } = t[i], { disabled: c } = p(t, o);
|
|
55
|
+
c || r.clientHeight === 0 || (r.scrollHeight <= r.clientHeight ? e.call(o) : h(t));
|
|
56
|
+
}
|
|
57
|
+
const J = {
|
|
58
|
+
async mounted(t, e) {
|
|
59
|
+
const { instance: r, value: o } = e;
|
|
60
|
+
A(
|
|
61
|
+
{
|
|
62
|
+
scope: i,
|
|
63
|
+
from: "the directive v-infinite-scroll",
|
|
64
|
+
replacement: "the el-scrollbar infinite scroll",
|
|
65
|
+
version: "3.0.0",
|
|
66
|
+
ref: "https://element-plus.org/en-US/component/scrollbar#infinite-scroll"
|
|
67
|
+
},
|
|
68
|
+
!0
|
|
69
|
+
), H(o) || L(i, "'v-infinite-scroll' binding value must be a function"), await b();
|
|
70
|
+
const { delay: c, immediate: a } = p(t, r), s = w(t, !0), l = s === window ? document.documentElement : s, n = v(I.bind(null, t, o), c);
|
|
71
|
+
if (s) {
|
|
72
|
+
if (t[i] = {
|
|
73
|
+
instance: r,
|
|
74
|
+
container: s,
|
|
75
|
+
containerEl: l,
|
|
76
|
+
delay: c,
|
|
77
|
+
cb: o,
|
|
78
|
+
onScroll: n,
|
|
79
|
+
lastScrollTop: l.scrollTop
|
|
80
|
+
}, a) {
|
|
81
|
+
const u = new MutationObserver(
|
|
82
|
+
v(m.bind(null, t, o), D)
|
|
83
|
+
);
|
|
84
|
+
t[i].observer = u, u.observe(t, { childList: !0, subtree: !0 }), m(t, o);
|
|
85
|
+
}
|
|
86
|
+
s.addEventListener("scroll", n);
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
unmounted(t) {
|
|
90
|
+
if (!t[i]) return;
|
|
91
|
+
const { container: e, onScroll: r } = t[i];
|
|
92
|
+
e == null || e.removeEventListener("scroll", r), h(t);
|
|
93
|
+
},
|
|
94
|
+
async updated(t) {
|
|
95
|
+
if (!t[i])
|
|
96
|
+
await b();
|
|
97
|
+
else {
|
|
98
|
+
const { containerEl: e, cb: r, observer: o } = t[i];
|
|
99
|
+
e.clientHeight && o && m(t, r);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
export {
|
|
104
|
+
D as CHECK_INTERVAL,
|
|
105
|
+
O as DEFAULT_DELAY,
|
|
106
|
+
C as DEFAULT_DISTANCE,
|
|
107
|
+
i as SCOPE,
|
|
108
|
+
J as default
|
|
109
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import vLoading from './src/directive';
|
|
2
|
+
import type { App, AppContext, Directive } from 'vue';
|
|
3
|
+
import type { ElementLoading, LoadingBinding } from './src/directive';
|
|
4
|
+
export declare const EpLoading: {
|
|
5
|
+
install(app: App): void;
|
|
6
|
+
directive: Directive<ElementLoading, LoadingBinding>;
|
|
7
|
+
service: {
|
|
8
|
+
(options?: import(".").LoadingOptions, context?: AppContext | null): import(".").LoadingInstance;
|
|
9
|
+
_context: AppContext | null;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
export default EpLoading;
|
|
13
|
+
export { vLoading };
|
|
14
|
+
export * from './src/types';
|
|
15
|
+
export type { LoadingInstance } from './src/loading';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import t from "./src/service.js";
|
|
2
|
+
import i from "./src/directive.js";
|
|
3
|
+
const r = {
|
|
4
|
+
install(o) {
|
|
5
|
+
t._context = o._context, i._context = o._context, o.directive("loading", i), o.config.globalProperties.$loading = t;
|
|
6
|
+
},
|
|
7
|
+
directive: i,
|
|
8
|
+
service: t
|
|
9
|
+
};
|
|
10
|
+
export {
|
|
11
|
+
r as EpLoading,
|
|
12
|
+
i as vLoading
|
|
13
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Directive, UnwrapRef } from 'vue';
|
|
2
|
+
import type { LoadingOptions } from './types';
|
|
3
|
+
import type { LoadingInstance } from './loading';
|
|
4
|
+
declare const INSTANCE_KEY: unique symbol;
|
|
5
|
+
export type LoadingBinding = boolean | UnwrapRef<LoadingOptions>;
|
|
6
|
+
export interface ElementLoading extends HTMLElement {
|
|
7
|
+
[INSTANCE_KEY]?: {
|
|
8
|
+
instance: LoadingInstance;
|
|
9
|
+
options: LoadingOptions;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare const vLoading: Directive<ElementLoading, LoadingBinding>;
|
|
13
|
+
export default vLoading;
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import { isRef as d, ref as x } from "vue";
|
|
2
|
+
import { isObject as m, hyphenate as b, isString as A } from "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import "@element-plus/icons-vue";
|
|
6
|
+
import k from "./service.js";
|
|
7
|
+
const u = Symbol("ElLoading"), r = (t) => `element-loading-${b(t)}`, g = (t, e) => {
|
|
8
|
+
const o = e.instance, n = (s) => m(e.value) ? e.value[s] : void 0, p = (s) => {
|
|
9
|
+
const v = A(s) && (o == null ? void 0 : o[s]) || s;
|
|
10
|
+
return x(v);
|
|
11
|
+
}, c = (s) => p(
|
|
12
|
+
n(s) || t.getAttribute(r(s))
|
|
13
|
+
), a = n("fullscreen") ?? e.modifiers.fullscreen, i = {
|
|
14
|
+
text: c("text"),
|
|
15
|
+
svg: c("svg"),
|
|
16
|
+
svgViewBox: c("svgViewBox"),
|
|
17
|
+
spinner: c("spinner"),
|
|
18
|
+
background: c("background"),
|
|
19
|
+
customClass: c("customClass"),
|
|
20
|
+
fullscreen: a,
|
|
21
|
+
target: n("target") ?? (a ? void 0 : t),
|
|
22
|
+
body: n("body") ?? e.modifiers.body,
|
|
23
|
+
lock: n("lock") ?? e.modifiers.lock
|
|
24
|
+
}, l = k(i);
|
|
25
|
+
l._context = f._context, t[u] = {
|
|
26
|
+
options: i,
|
|
27
|
+
instance: l
|
|
28
|
+
};
|
|
29
|
+
}, y = (t, e) => {
|
|
30
|
+
for (const o of Object.keys(t))
|
|
31
|
+
d(t[o]) && (t[o].value = e[o]);
|
|
32
|
+
}, f = {
|
|
33
|
+
mounted(t, e) {
|
|
34
|
+
e.value && g(t, e);
|
|
35
|
+
},
|
|
36
|
+
updated(t, e) {
|
|
37
|
+
const o = t[u];
|
|
38
|
+
if (!e.value) {
|
|
39
|
+
o == null || o.instance.close(), t[u] = null;
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
o ? y(
|
|
43
|
+
o.options,
|
|
44
|
+
m(e.value) ? e.value : {
|
|
45
|
+
text: t.getAttribute(r("text")),
|
|
46
|
+
svg: t.getAttribute(r("svg")),
|
|
47
|
+
svgViewBox: t.getAttribute(r("svgViewBox")),
|
|
48
|
+
spinner: t.getAttribute(r("spinner")),
|
|
49
|
+
background: t.getAttribute(r("background")),
|
|
50
|
+
customClass: t.getAttribute(r("customClass"))
|
|
51
|
+
}
|
|
52
|
+
) : g(t, e);
|
|
53
|
+
},
|
|
54
|
+
unmounted(t) {
|
|
55
|
+
var e;
|
|
56
|
+
(e = t[u]) == null || e.instance.close(), t[u] = null;
|
|
57
|
+
}
|
|
58
|
+
};
|
|
59
|
+
f._context = null;
|
|
60
|
+
export {
|
|
61
|
+
f as default
|
|
62
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { AppContext, VNode } from 'vue';
|
|
2
|
+
import type { LoadingOptionsResolved } from './types';
|
|
3
|
+
export declare function createLoadingComponent(options: LoadingOptionsResolved, appContext: AppContext | null): {
|
|
4
|
+
setText: (text: string | VNode | VNode[]) => void;
|
|
5
|
+
removeElLoadingChild: () => void;
|
|
6
|
+
close: () => void;
|
|
7
|
+
handleAfterLeave: () => void;
|
|
8
|
+
vm: import("vue").ComponentPublicInstance<{}, {}, {}, {}, {}, {}, {}, {}, false, import("vue").ComponentOptionsBase<any, any, any, any, any, any, any, any, any, {}, {}, string, {}, {}, {}, string, import("vue").ComponentProvideOptions>, {}, {}, "", {}, any>;
|
|
9
|
+
$el: HTMLElement;
|
|
10
|
+
originalPosition: import("vue").Ref<string, string>;
|
|
11
|
+
originalOverflow: import("vue").Ref<string, string>;
|
|
12
|
+
visible: import("vue").Ref<boolean, boolean>;
|
|
13
|
+
parent: import("vue").Ref<import("./types").LoadingParentElement, import("./types").LoadingParentElement>;
|
|
14
|
+
background: import("vue").Ref<string, string>;
|
|
15
|
+
svg: import("vue").Ref<string, string>;
|
|
16
|
+
svgViewBox: import("vue").Ref<string, string>;
|
|
17
|
+
spinner: import("vue").Ref<string | boolean, string | boolean>;
|
|
18
|
+
text: import("vue").Ref<string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
19
|
+
[key: string]: any;
|
|
20
|
+
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
21
|
+
[key: string]: any;
|
|
22
|
+
}>[], string | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
23
|
+
[key: string]: any;
|
|
24
|
+
}> | VNode<import("vue").RendererNode, import("vue").RendererElement, {
|
|
25
|
+
[key: string]: any;
|
|
26
|
+
}>[]>;
|
|
27
|
+
fullscreen: import("vue").Ref<boolean, boolean>;
|
|
28
|
+
lock: import("vue").Ref<boolean, boolean>;
|
|
29
|
+
customClass: import("vue").Ref<string, string>;
|
|
30
|
+
target: import("vue").Ref<HTMLElement, HTMLElement>;
|
|
31
|
+
beforeClose?: import("vue").Ref<(() => boolean) | undefined, (() => boolean) | undefined> | undefined;
|
|
32
|
+
closed?: import("vue").Ref<(() => void) | undefined, (() => void) | undefined> | undefined;
|
|
33
|
+
};
|
|
34
|
+
export type LoadingInstance = ReturnType<typeof createLoadingComponent>;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { ref as A, reactive as w, defineComponent as T, h as s, Transition as N, withCtx as S, withDirectives as $, createVNode as k, vShow as y, createApp as B, toRefs as E } from "vue";
|
|
2
|
+
import "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import "@vueuse/core";
|
|
5
|
+
import { removeClass as f } from "../../../utils/dom/style.js";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import "../../config-provider/index.js";
|
|
8
|
+
import { useGlobalComponentSettings as I } from "../../config-provider/src/hooks/use-global-config.js";
|
|
9
|
+
function H(o, v) {
|
|
10
|
+
let u;
|
|
11
|
+
const a = A(!1), t = w({
|
|
12
|
+
...o,
|
|
13
|
+
originalPosition: "",
|
|
14
|
+
originalOverflow: "",
|
|
15
|
+
visible: !1
|
|
16
|
+
});
|
|
17
|
+
function g(e) {
|
|
18
|
+
t.text = e;
|
|
19
|
+
}
|
|
20
|
+
function b() {
|
|
21
|
+
const e = t.parent, r = i.ns;
|
|
22
|
+
if (!e.vLoadingAddClassList) {
|
|
23
|
+
let n = e.getAttribute("loading-number");
|
|
24
|
+
n = Number.parseInt(n) - 1, n ? e.setAttribute("loading-number", n.toString()) : (f(e, r.bm("parent", "relative")), e.removeAttribute("loading-number")), f(e, r.bm("parent", "hidden"));
|
|
25
|
+
}
|
|
26
|
+
d(), c.unmount();
|
|
27
|
+
}
|
|
28
|
+
function d() {
|
|
29
|
+
var e, r;
|
|
30
|
+
(r = (e = i.$el) == null ? void 0 : e.parentNode) == null || r.removeChild(i.$el);
|
|
31
|
+
}
|
|
32
|
+
function p() {
|
|
33
|
+
var e;
|
|
34
|
+
o.beforeClose && !o.beforeClose() || (a.value = !0, clearTimeout(u), u = setTimeout(l, 400), t.visible = !1, (e = o.closed) == null || e.call(o));
|
|
35
|
+
}
|
|
36
|
+
function l() {
|
|
37
|
+
if (!a.value) return;
|
|
38
|
+
const e = t.parent;
|
|
39
|
+
a.value = !1, e.vLoadingAddClassList = void 0, b();
|
|
40
|
+
}
|
|
41
|
+
const x = T({
|
|
42
|
+
name: "ElLoading",
|
|
43
|
+
setup(e, { expose: r }) {
|
|
44
|
+
const { ns: n, zIndex: C } = I("loading");
|
|
45
|
+
return r({
|
|
46
|
+
ns: n,
|
|
47
|
+
zIndex: C
|
|
48
|
+
}), () => {
|
|
49
|
+
const m = t.spinner || t.svg, L = s(
|
|
50
|
+
"svg",
|
|
51
|
+
{
|
|
52
|
+
class: "circular",
|
|
53
|
+
viewBox: t.svgViewBox ? t.svgViewBox : "0 0 50 50",
|
|
54
|
+
...m ? { innerHTML: m } : {}
|
|
55
|
+
},
|
|
56
|
+
[
|
|
57
|
+
s("circle", {
|
|
58
|
+
class: "path",
|
|
59
|
+
cx: "25",
|
|
60
|
+
cy: "25",
|
|
61
|
+
r: "20",
|
|
62
|
+
fill: "none"
|
|
63
|
+
})
|
|
64
|
+
]
|
|
65
|
+
), h = t.text ? s("p", { class: n.b("text") }, [t.text]) : void 0;
|
|
66
|
+
return s(
|
|
67
|
+
N,
|
|
68
|
+
{
|
|
69
|
+
name: n.b("fade"),
|
|
70
|
+
onAfterLeave: l
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
default: S(() => [
|
|
74
|
+
$(
|
|
75
|
+
k(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
style: {
|
|
79
|
+
backgroundColor: t.background || ""
|
|
80
|
+
},
|
|
81
|
+
class: [
|
|
82
|
+
n.b("mask"),
|
|
83
|
+
t.customClass,
|
|
84
|
+
n.is("fullscreen", t.fullscreen)
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
[
|
|
88
|
+
s(
|
|
89
|
+
"div",
|
|
90
|
+
{
|
|
91
|
+
class: n.b("spinner")
|
|
92
|
+
},
|
|
93
|
+
[L, h]
|
|
94
|
+
)
|
|
95
|
+
]
|
|
96
|
+
),
|
|
97
|
+
[[y, t.visible]]
|
|
98
|
+
)
|
|
99
|
+
])
|
|
100
|
+
}
|
|
101
|
+
);
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
}), c = B(x);
|
|
105
|
+
Object.assign(c._context, v ?? {});
|
|
106
|
+
const i = c.mount(document.createElement("div"));
|
|
107
|
+
return {
|
|
108
|
+
...E(t),
|
|
109
|
+
setText: g,
|
|
110
|
+
removeElLoadingChild: d,
|
|
111
|
+
close: p,
|
|
112
|
+
handleAfterLeave: l,
|
|
113
|
+
vm: i,
|
|
114
|
+
get $el() {
|
|
115
|
+
return i.$el;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
H as createLoadingComponent
|
|
121
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { LoadingInstance } from './loading';
|
|
2
|
+
import type { LoadingOptions } from './types';
|
|
3
|
+
import type { AppContext } from 'vue';
|
|
4
|
+
declare const Loading: {
|
|
5
|
+
(options?: LoadingOptions, context?: AppContext | null): LoadingInstance;
|
|
6
|
+
_context: AppContext | null;
|
|
7
|
+
};
|
|
8
|
+
export default Loading;
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { nextTick as m } from "vue";
|
|
2
|
+
import { isString as b } from "@vue/shared";
|
|
3
|
+
import "lodash-unified";
|
|
4
|
+
import { isClient as g } from "@vueuse/core";
|
|
5
|
+
import { getStyle as d, addClass as a, removeClass as c } from "../../../utils/dom/style.js";
|
|
6
|
+
import "@element-plus/icons-vue";
|
|
7
|
+
import { createLoadingComponent as v } from "./loading.js";
|
|
8
|
+
let i;
|
|
9
|
+
const f = function(t = {}, o) {
|
|
10
|
+
if (!g) return;
|
|
11
|
+
const e = p(t);
|
|
12
|
+
if (e.fullscreen && i)
|
|
13
|
+
return i;
|
|
14
|
+
const l = v(
|
|
15
|
+
{
|
|
16
|
+
...e,
|
|
17
|
+
closed: () => {
|
|
18
|
+
var r;
|
|
19
|
+
(r = e.closed) == null || r.call(e), e.fullscreen && (i = void 0);
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
o ?? f._context
|
|
23
|
+
);
|
|
24
|
+
y(e, e.parent, l), u(e, e.parent, l), e.parent.vLoadingAddClassList = () => u(e, e.parent, l);
|
|
25
|
+
let n = e.parent.getAttribute("loading-number");
|
|
26
|
+
return n ? n = `${Number.parseInt(n) + 1}` : n = "1", e.parent.setAttribute("loading-number", n), e.parent.appendChild(l.$el), m(() => l.visible.value = e.visible), e.fullscreen && (i = l), l;
|
|
27
|
+
}, p = (t) => {
|
|
28
|
+
let o;
|
|
29
|
+
return b(t.target) ? o = document.querySelector(t.target) ?? document.body : o = t.target || document.body, {
|
|
30
|
+
parent: o === document.body || t.body ? document.body : o,
|
|
31
|
+
background: t.background || "",
|
|
32
|
+
svg: t.svg || "",
|
|
33
|
+
svgViewBox: t.svgViewBox || "",
|
|
34
|
+
spinner: t.spinner || !1,
|
|
35
|
+
text: t.text || "",
|
|
36
|
+
fullscreen: o === document.body && (t.fullscreen ?? !0),
|
|
37
|
+
lock: t.lock ?? !1,
|
|
38
|
+
customClass: t.customClass || "",
|
|
39
|
+
visible: t.visible ?? !0,
|
|
40
|
+
beforeClose: t.beforeClose,
|
|
41
|
+
closed: t.closed,
|
|
42
|
+
target: o
|
|
43
|
+
};
|
|
44
|
+
}, y = async (t, o, e) => {
|
|
45
|
+
const { nextZIndex: l } = e.vm.zIndex || e.vm._.exposed.zIndex, n = {};
|
|
46
|
+
if (t.fullscreen)
|
|
47
|
+
e.originalPosition.value = d(document.body, "position"), e.originalOverflow.value = d(document.body, "overflow"), n.zIndex = l();
|
|
48
|
+
else if (t.parent === document.body) {
|
|
49
|
+
e.originalPosition.value = d(document.body, "position"), await m();
|
|
50
|
+
for (const r of ["top", "left"]) {
|
|
51
|
+
const s = r === "top" ? "scrollTop" : "scrollLeft";
|
|
52
|
+
n[r] = `${t.target.getBoundingClientRect()[r] + document.body[s] + document.documentElement[s] - Number.parseInt(d(document.body, `margin-${r}`), 10)}px`;
|
|
53
|
+
}
|
|
54
|
+
for (const r of ["height", "width"])
|
|
55
|
+
n[r] = `${t.target.getBoundingClientRect()[r]}px`;
|
|
56
|
+
} else
|
|
57
|
+
e.originalPosition.value = d(o, "position");
|
|
58
|
+
for (const [r, s] of Object.entries(n))
|
|
59
|
+
e.$el.style[r] = s;
|
|
60
|
+
}, u = (t, o, e) => {
|
|
61
|
+
const l = e.vm.ns || e.vm._.exposed.ns;
|
|
62
|
+
["absolute", "fixed", "sticky"].includes(e.originalPosition.value) ? c(o, l.bm("parent", "relative")) : a(o, l.bm("parent", "relative")), t.fullscreen && t.lock ? a(o, l.bm("parent", "hidden")) : c(o, l.bm("parent", "hidden"));
|
|
63
|
+
};
|
|
64
|
+
f._context = null;
|
|
65
|
+
export {
|
|
66
|
+
f as default
|
|
67
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type { MaybeRef, VNode } from 'vue';
|
|
2
|
+
export type LoadingOptionsResolved = {
|
|
3
|
+
parent: LoadingParentElement;
|
|
4
|
+
/**
|
|
5
|
+
* @description background color of the mask
|
|
6
|
+
*/
|
|
7
|
+
background: MaybeRef<string>;
|
|
8
|
+
svg: MaybeRef<string>;
|
|
9
|
+
svgViewBox: MaybeRef<string>;
|
|
10
|
+
/**
|
|
11
|
+
* @description class name of the custom spinner
|
|
12
|
+
*/
|
|
13
|
+
spinner: MaybeRef<boolean | string>;
|
|
14
|
+
/**
|
|
15
|
+
* @description loading text that displays under the spinner
|
|
16
|
+
*/
|
|
17
|
+
text: MaybeRef<string | VNode | VNode[]>;
|
|
18
|
+
/**
|
|
19
|
+
* @description same as the `fullscreen` modifier of `v-loading`
|
|
20
|
+
*/
|
|
21
|
+
fullscreen: boolean;
|
|
22
|
+
/**
|
|
23
|
+
* @description same as the `lock` modifier of `v-loading`
|
|
24
|
+
*/
|
|
25
|
+
lock: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* @description custom class name for Loading
|
|
28
|
+
*/
|
|
29
|
+
customClass: MaybeRef<string>;
|
|
30
|
+
visible: boolean;
|
|
31
|
+
target: HTMLElement;
|
|
32
|
+
beforeClose?: () => boolean;
|
|
33
|
+
closed?: () => void;
|
|
34
|
+
};
|
|
35
|
+
export type LoadingOptions = Partial<Omit<LoadingOptionsResolved, 'parent' | 'target'> & {
|
|
36
|
+
/**
|
|
37
|
+
* @description the DOM node Loading needs to cover. Accepts a DOM object or a string. If it's a string, it will be passed to `document.querySelector` to get the corresponding DOM node
|
|
38
|
+
*/
|
|
39
|
+
target: HTMLElement | string;
|
|
40
|
+
/**
|
|
41
|
+
* @description same as the `body` modifier of `v-loading`
|
|
42
|
+
*/
|
|
43
|
+
body: boolean;
|
|
44
|
+
}>;
|
|
45
|
+
export interface LoadingParentElement extends HTMLElement {
|
|
46
|
+
vLoadingAddClassList?: () => void;
|
|
47
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import "@vue/shared";
|
|
2
|
+
import "lodash-unified";
|
|
3
|
+
import "@vueuse/core";
|
|
4
|
+
import "@element-plus/icons-vue";
|
|
5
|
+
import "vue";
|
|
6
|
+
import { withInstallFunction as e } from "../../utils/vue/install.js";
|
|
7
|
+
import s from "./src/method.js";
|
|
8
|
+
import { MESSAGE_DEFAULT_PLACEMENT as f, messageDefaults as l, messageEmits as c, messagePlacement as A, messageProps as M, messageTypes as P } from "./src/message.js";
|
|
9
|
+
const g = e(s, "$message");
|
|
10
|
+
export {
|
|
11
|
+
g as EpMessage,
|
|
12
|
+
f as MESSAGE_DEFAULT_PLACEMENT,
|
|
13
|
+
l as messageDefaults,
|
|
14
|
+
c as messageEmits,
|
|
15
|
+
A as messagePlacement,
|
|
16
|
+
M as messageProps,
|
|
17
|
+
P as messageTypes
|
|
18
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ComponentInternalInstance, VNode } from 'vue';
|
|
2
|
+
import type { Mutable } from '@element-plus/utils';
|
|
3
|
+
import type { MessageHandler, MessagePlacement, MessageProps } from './message';
|
|
4
|
+
export type MessageContext = {
|
|
5
|
+
id: string;
|
|
6
|
+
vnode: VNode;
|
|
7
|
+
handler: MessageHandler;
|
|
8
|
+
vm: ComponentInternalInstance;
|
|
9
|
+
props: Mutable<MessageProps>;
|
|
10
|
+
};
|
|
11
|
+
export declare const placementInstances: import("vue").ShallowReactive<Record<"bottom" | "top" | "top-left" | "top-right" | "bottom-left" | "bottom-right", MessageContext[]>>;
|
|
12
|
+
export declare const getOrCreatePlacementInstances: (placement: MessagePlacement) => MessageContext[];
|
|
13
|
+
export declare const getInstance: (id: string, placement: MessagePlacement) => {
|
|
14
|
+
current: MessageContext;
|
|
15
|
+
prev: MessageContext | undefined;
|
|
16
|
+
};
|
|
17
|
+
export declare const getLastOffset: (id: string, placement: MessagePlacement) => number;
|
|
18
|
+
export declare const getOffsetOrSpace: (id: string, offset: number, placement: MessagePlacement) => number;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { shallowReactive as i } from "vue";
|
|
2
|
+
const s = i(
|
|
3
|
+
{}
|
|
4
|
+
), u = (t) => (s[t] || (s[t] = i([])), s[t]), d = (t, e) => {
|
|
5
|
+
const n = s[e] || [], c = n.findIndex((a) => a.id === t), o = n[c];
|
|
6
|
+
let r;
|
|
7
|
+
return c > 0 && (r = n[c - 1]), { current: o, prev: r };
|
|
8
|
+
}, x = (t, e) => {
|
|
9
|
+
const { prev: n } = d(t, e);
|
|
10
|
+
return n ? n.vm.exposed.bottom.value : 0;
|
|
11
|
+
}, p = (t, e, n) => (s[n] || []).findIndex((r) => r.id === t) > 0 ? 16 : e;
|
|
12
|
+
export {
|
|
13
|
+
d as getInstance,
|
|
14
|
+
x as getLastOffset,
|
|
15
|
+
p as getOffsetOrSpace,
|
|
16
|
+
u as getOrCreatePlacementInstances,
|
|
17
|
+
s as placementInstances
|
|
18
|
+
};
|