element-pe 2.0.6 → 2.0.7
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.full.js +1 -1
- package/dist/index.full.min.js +1 -1
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +1 -1
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +1 -1
- package/es/components/affix/index.mjs +2 -2
- package/es/components/affix/src/affix.mjs +114 -23
- package/es/components/affix/src/affix.mjs.map +1 -1
- package/es/components/affix/src/affix2.mjs +23 -114
- package/es/components/affix/src/affix2.mjs.map +1 -1
- package/es/components/autocomplete/index.mjs +2 -2
- package/es/components/autocomplete/src/autocomplete.mjs +325 -67
- package/es/components/autocomplete/src/autocomplete.mjs.map +1 -1
- package/es/components/autocomplete/src/autocomplete2.mjs +67 -325
- package/es/components/autocomplete/src/autocomplete2.mjs.map +1 -1
- package/es/components/backtop/index.mjs +2 -2
- package/es/components/backtop/src/backtop.mjs +100 -21
- package/es/components/backtop/src/backtop.mjs.map +1 -1
- package/es/components/backtop/src/backtop2.mjs +21 -100
- package/es/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/components/breadcrumb/index.mjs +2 -2
- package/es/components/breadcrumb/src/breadcrumb-item.mjs +11 -57
- package/es/components/breadcrumb/src/breadcrumb-item.mjs.map +1 -1
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs +57 -11
- package/es/components/breadcrumb/src/breadcrumb-item2.mjs.map +1 -1
- package/es/components/button/index.mjs +3 -3
- package/es/components/button/src/button-group.mjs +5 -30
- package/es/components/button/src/button-group.mjs.map +1 -1
- package/es/components/button/src/button-group2.mjs +30 -5
- package/es/components/button/src/button-group2.mjs.map +1 -1
- package/es/components/button/src/button.mjs +106 -51
- package/es/components/button/src/button.mjs.map +1 -1
- package/es/components/button/src/button2.mjs +51 -106
- package/es/components/button/src/button2.mjs.map +1 -1
- package/es/components/carousel/index.mjs +2 -2
- package/es/components/carousel/src/carousel.mjs +48 -319
- package/es/components/carousel/src/carousel.mjs.map +1 -1
- package/es/components/carousel/src/carousel2.mjs +319 -48
- package/es/components/carousel/src/carousel2.mjs.map +1 -1
- package/es/components/dialog/index.mjs +2 -2
- package/es/components/dialog/src/dialog.mjs +113 -70
- package/es/components/dialog/src/dialog.mjs.map +1 -1
- package/es/components/dialog/src/dialog2.mjs +70 -113
- package/es/components/dialog/src/dialog2.mjs.map +1 -1
- package/es/components/drawer/index.mjs +2 -2
- package/es/components/drawer/src/drawer.mjs +21 -126
- package/es/components/drawer/src/drawer.mjs.map +1 -1
- package/es/components/drawer/src/drawer2.mjs +126 -21
- package/es/components/drawer/src/drawer2.mjs.map +1 -1
- package/es/components/empty/index.mjs +2 -2
- package/es/components/empty/src/empty.mjs +11 -56
- package/es/components/empty/src/empty.mjs.map +1 -1
- package/es/components/empty/src/empty2.mjs +56 -11
- package/es/components/empty/src/empty2.mjs.map +1 -1
- package/es/components/form/index.mjs +2 -2
- package/es/components/form/src/form-item.mjs +43 -272
- package/es/components/form/src/form-item.mjs.map +1 -1
- package/es/components/form/src/form-item2.mjs +272 -43
- package/es/components/form/src/form-item2.mjs.map +1 -1
- package/es/components/icon/index.mjs +2 -2
- package/es/components/icon/src/icon.mjs +35 -8
- package/es/components/icon/src/icon.mjs.map +1 -1
- package/es/components/icon/src/icon2.mjs +8 -35
- package/es/components/icon/src/icon2.mjs.map +1 -1
- package/es/components/index.mjs +26 -26
- package/es/components/input/index.mjs +2 -2
- package/es/components/input/src/input.mjs +92 -433
- package/es/components/input/src/input.mjs.map +1 -1
- package/es/components/input/src/input2.mjs +433 -92
- package/es/components/input/src/input2.mjs.map +1 -1
- package/es/components/input-number/index.mjs +2 -2
- package/es/components/input-number/src/input-number.mjs +284 -53
- package/es/components/input-number/src/input-number.mjs.map +1 -1
- package/es/components/input-number/src/input-number2.mjs +53 -284
- package/es/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/components/link/index.mjs +2 -2
- package/es/components/link/src/link.mjs +49 -22
- package/es/components/link/src/link.mjs.map +1 -1
- package/es/components/link/src/link2.mjs +22 -49
- package/es/components/link/src/link2.mjs.map +1 -1
- package/es/components/menu/index.mjs +2 -2
- package/es/components/menu/src/menu-item-group.mjs +4 -51
- package/es/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/components/menu/src/menu-item-group2.mjs +51 -4
- package/es/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/components/page-header/index.mjs +2 -2
- package/es/components/page-header/src/page-header.mjs +60 -17
- package/es/components/page-header/src/page-header.mjs.map +1 -1
- package/es/components/page-header/src/page-header2.mjs +17 -60
- package/es/components/page-header/src/page-header2.mjs.map +1 -1
- package/es/components/popconfirm/index.mjs +2 -2
- package/es/components/popconfirm/src/popconfirm.mjs +52 -119
- package/es/components/popconfirm/src/popconfirm.mjs.map +1 -1
- package/es/components/popconfirm/src/popconfirm2.mjs +119 -52
- package/es/components/popconfirm/src/popconfirm2.mjs.map +1 -1
- package/es/components/popper/index.mjs +2 -2
- package/es/components/popper/src/arrow.mjs +37 -7
- package/es/components/popper/src/arrow.mjs.map +1 -1
- package/es/components/popper/src/arrow2.mjs +7 -37
- package/es/components/popper/src/arrow2.mjs.map +1 -1
- package/es/components/progress/index.mjs +2 -2
- package/es/components/progress/src/progress.mjs +230 -57
- package/es/components/progress/src/progress.mjs.map +1 -1
- package/es/components/progress/src/progress2.mjs +57 -230
- package/es/components/progress/src/progress2.mjs.map +1 -1
- package/es/components/radio/index.mjs +2 -2
- package/es/components/radio/src/radio-group.mjs +20 -84
- package/es/components/radio/src/radio-group.mjs.map +1 -1
- package/es/components/radio/src/radio-group2.mjs +84 -20
- package/es/components/radio/src/radio-group2.mjs.map +1 -1
- package/es/components/rate/index.mjs +2 -2
- package/es/components/rate/src/rate.mjs +239 -88
- package/es/components/rate/src/rate.mjs.map +1 -1
- package/es/components/rate/src/rate2.mjs +88 -239
- package/es/components/rate/src/rate2.mjs.map +1 -1
- package/es/components/skeleton/index.mjs +2 -2
- package/es/components/skeleton/src/skeleton-item.mjs +18 -23
- package/es/components/skeleton/src/skeleton-item.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +23 -18
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton.mjs +1 -1
- package/es/components/switch/index.mjs +2 -2
- package/es/components/switch/src/switch.mjs +250 -87
- package/es/components/switch/src/switch.mjs.map +1 -1
- package/es/components/switch/src/switch2.mjs +87 -250
- package/es/components/switch/src/switch2.mjs.map +1 -1
- package/es/components/tabs/index.mjs +3 -3
- package/es/components/tabs/src/tab-bar.mjs +76 -7
- package/es/components/tabs/src/tab-bar.mjs.map +1 -1
- package/es/components/tabs/src/tab-bar2.mjs +7 -76
- package/es/components/tabs/src/tab-bar2.mjs.map +1 -1
- package/es/components/tabs/src/tab-nav.mjs +1 -1
- package/es/components/tabs/src/tab-pane.mjs +60 -14
- package/es/components/tabs/src/tab-pane.mjs.map +1 -1
- package/es/components/tabs/src/tab-pane2.mjs +14 -60
- package/es/components/tabs/src/tab-pane2.mjs.map +1 -1
- package/es/components/teleport/index.mjs +2 -2
- package/es/components/teleport/src/teleport.mjs +18 -43
- package/es/components/teleport/src/teleport.mjs.map +1 -1
- package/es/components/teleport/src/teleport2.mjs +43 -18
- package/es/components/teleport/src/teleport2.mjs.map +1 -1
- package/es/components/tooltip/src/tooltip2.mjs +2 -2
- package/es/components/tooltip-v2/index.mjs +3 -3
- package/es/components/tooltip-v2/src/arrow.mjs +22 -38
- package/es/components/tooltip-v2/src/arrow.mjs.map +1 -1
- package/es/components/tooltip-v2/src/arrow2.mjs +38 -22
- package/es/components/tooltip-v2/src/arrow2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +20 -73
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +73 -20
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/index.mjs +26 -26
- package/lib/components/affix/index.js +2 -2
- package/lib/components/affix/src/affix.js +114 -24
- package/lib/components/affix/src/affix.js.map +1 -1
- package/lib/components/affix/src/affix2.js +24 -114
- package/lib/components/affix/src/affix2.js.map +1 -1
- package/lib/components/autocomplete/index.js +2 -2
- package/lib/components/autocomplete/src/autocomplete.js +324 -67
- package/lib/components/autocomplete/src/autocomplete.js.map +1 -1
- package/lib/components/autocomplete/src/autocomplete2.js +67 -324
- package/lib/components/autocomplete/src/autocomplete2.js.map +1 -1
- package/lib/components/backtop/index.js +2 -2
- package/lib/components/backtop/src/backtop.js +100 -22
- package/lib/components/backtop/src/backtop.js.map +1 -1
- package/lib/components/backtop/src/backtop2.js +22 -100
- package/lib/components/backtop/src/backtop2.js.map +1 -1
- package/lib/components/breadcrumb/index.js +2 -2
- package/lib/components/breadcrumb/src/breadcrumb-item.js +11 -57
- package/lib/components/breadcrumb/src/breadcrumb-item.js.map +1 -1
- package/lib/components/breadcrumb/src/breadcrumb-item2.js +57 -11
- package/lib/components/breadcrumb/src/breadcrumb-item2.js.map +1 -1
- package/lib/components/button/index.js +3 -3
- package/lib/components/button/src/button-group.js +5 -30
- package/lib/components/button/src/button-group.js.map +1 -1
- package/lib/components/button/src/button-group2.js +30 -5
- package/lib/components/button/src/button-group2.js.map +1 -1
- package/lib/components/button/src/button.js +106 -54
- package/lib/components/button/src/button.js.map +1 -1
- package/lib/components/button/src/button2.js +54 -106
- package/lib/components/button/src/button2.js.map +1 -1
- package/lib/components/carousel/index.js +2 -2
- package/lib/components/carousel/src/carousel.js +49 -319
- package/lib/components/carousel/src/carousel.js.map +1 -1
- package/lib/components/carousel/src/carousel2.js +319 -49
- package/lib/components/carousel/src/carousel2.js.map +1 -1
- package/lib/components/dialog/index.js +2 -2
- package/lib/components/dialog/src/dialog.js +113 -71
- package/lib/components/dialog/src/dialog.js.map +1 -1
- package/lib/components/dialog/src/dialog2.js +71 -113
- package/lib/components/dialog/src/dialog2.js.map +1 -1
- package/lib/components/drawer/index.js +2 -2
- package/lib/components/drawer/src/drawer.js +22 -126
- package/lib/components/drawer/src/drawer.js.map +1 -1
- package/lib/components/drawer/src/drawer2.js +126 -22
- package/lib/components/drawer/src/drawer2.js.map +1 -1
- package/lib/components/empty/index.js +2 -2
- package/lib/components/empty/src/empty.js +11 -56
- package/lib/components/empty/src/empty.js.map +1 -1
- package/lib/components/empty/src/empty2.js +56 -11
- package/lib/components/empty/src/empty2.js.map +1 -1
- package/lib/components/form/index.js +2 -2
- package/lib/components/form/src/form-item.js +44 -276
- package/lib/components/form/src/form-item.js.map +1 -1
- package/lib/components/form/src/form-item2.js +276 -44
- package/lib/components/form/src/form-item2.js.map +1 -1
- package/lib/components/icon/index.js +2 -2
- package/lib/components/icon/src/icon.js +35 -8
- package/lib/components/icon/src/icon.js.map +1 -1
- package/lib/components/icon/src/icon2.js +8 -35
- package/lib/components/icon/src/icon2.js.map +1 -1
- package/lib/components/index.js +26 -26
- package/lib/components/input/index.js +2 -2
- package/lib/components/input/src/input.js +92 -432
- package/lib/components/input/src/input.js.map +1 -1
- package/lib/components/input/src/input2.js +432 -92
- package/lib/components/input/src/input2.js.map +1 -1
- package/lib/components/input-number/index.js +2 -2
- package/lib/components/input-number/src/input-number.js +284 -54
- package/lib/components/input-number/src/input-number.js.map +1 -1
- package/lib/components/input-number/src/input-number2.js +54 -284
- package/lib/components/input-number/src/input-number2.js.map +1 -1
- package/lib/components/link/index.js +2 -2
- package/lib/components/link/src/link.js +49 -23
- package/lib/components/link/src/link.js.map +1 -1
- package/lib/components/link/src/link2.js +23 -49
- package/lib/components/link/src/link2.js.map +1 -1
- package/lib/components/menu/index.js +2 -2
- package/lib/components/menu/src/menu-item-group.js +4 -51
- package/lib/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/components/menu/src/menu-item-group2.js +51 -4
- package/lib/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/components/page-header/index.js +2 -2
- package/lib/components/page-header/src/page-header.js +60 -18
- package/lib/components/page-header/src/page-header.js.map +1 -1
- package/lib/components/page-header/src/page-header2.js +18 -60
- package/lib/components/page-header/src/page-header2.js.map +1 -1
- package/lib/components/popconfirm/index.js +2 -2
- package/lib/components/popconfirm/src/popconfirm.js +52 -119
- package/lib/components/popconfirm/src/popconfirm.js.map +1 -1
- package/lib/components/popconfirm/src/popconfirm2.js +119 -52
- package/lib/components/popconfirm/src/popconfirm2.js.map +1 -1
- package/lib/components/popper/index.js +2 -2
- package/lib/components/popper/src/arrow.js +37 -7
- package/lib/components/popper/src/arrow.js.map +1 -1
- package/lib/components/popper/src/arrow2.js +7 -37
- package/lib/components/popper/src/arrow2.js.map +1 -1
- package/lib/components/progress/index.js +2 -2
- package/lib/components/progress/src/progress.js +230 -57
- package/lib/components/progress/src/progress.js.map +1 -1
- package/lib/components/progress/src/progress2.js +57 -230
- package/lib/components/progress/src/progress2.js.map +1 -1
- package/lib/components/radio/index.js +2 -2
- package/lib/components/radio/src/radio-group.js +21 -84
- package/lib/components/radio/src/radio-group.js.map +1 -1
- package/lib/components/radio/src/radio-group2.js +84 -21
- package/lib/components/radio/src/radio-group2.js.map +1 -1
- package/lib/components/rate/index.js +2 -2
- package/lib/components/rate/src/rate.js +239 -89
- package/lib/components/rate/src/rate.js.map +1 -1
- package/lib/components/rate/src/rate2.js +89 -239
- package/lib/components/rate/src/rate2.js.map +1 -1
- package/lib/components/skeleton/index.js +2 -2
- package/lib/components/skeleton/src/skeleton-item.js +18 -23
- package/lib/components/skeleton/src/skeleton-item.js.map +1 -1
- package/lib/components/skeleton/src/skeleton-item2.js +23 -18
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton.js +1 -1
- package/lib/components/switch/index.js +2 -2
- package/lib/components/switch/src/switch.js +249 -87
- package/lib/components/switch/src/switch.js.map +1 -1
- package/lib/components/switch/src/switch2.js +87 -249
- package/lib/components/switch/src/switch2.js.map +1 -1
- package/lib/components/tabs/index.js +3 -3
- package/lib/components/tabs/src/tab-bar.js +76 -7
- package/lib/components/tabs/src/tab-bar.js.map +1 -1
- package/lib/components/tabs/src/tab-bar2.js +7 -76
- package/lib/components/tabs/src/tab-bar2.js.map +1 -1
- package/lib/components/tabs/src/tab-nav.js +1 -1
- package/lib/components/tabs/src/tab-pane.js +60 -14
- package/lib/components/tabs/src/tab-pane.js.map +1 -1
- package/lib/components/tabs/src/tab-pane2.js +14 -60
- package/lib/components/tabs/src/tab-pane2.js.map +1 -1
- package/lib/components/teleport/index.js +2 -2
- package/lib/components/teleport/src/teleport.js +18 -43
- package/lib/components/teleport/src/teleport.js.map +1 -1
- package/lib/components/teleport/src/teleport2.js +43 -18
- package/lib/components/teleport/src/teleport2.js.map +1 -1
- package/lib/components/tooltip/src/tooltip2.js +2 -2
- package/lib/components/tooltip-v2/index.js +3 -3
- package/lib/components/tooltip-v2/src/arrow.js +23 -38
- package/lib/components/tooltip-v2/src/arrow.js.map +1 -1
- package/lib/components/tooltip-v2/src/arrow2.js +38 -23
- package/lib/components/tooltip-v2/src/arrow2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +20 -73
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +73 -20
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/index.js +26 -26
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1,103 +1,24 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
18
|
-
...__default__,
|
|
19
|
-
props: backtopProps,
|
|
20
|
-
emits: backtopEmits,
|
|
21
|
-
setup(__props, { emit }) {
|
|
22
|
-
const props = __props;
|
|
23
|
-
const COMPONENT_NAME = "ElBacktop";
|
|
24
|
-
const ns = useNamespace("backtop");
|
|
25
|
-
const el = shallowRef();
|
|
26
|
-
const container = shallowRef();
|
|
27
|
-
const visible = ref(false);
|
|
28
|
-
const backTopStyle = computed(() => ({
|
|
29
|
-
right: `${props.right}px`,
|
|
30
|
-
bottom: `${props.bottom}px`
|
|
31
|
-
}));
|
|
32
|
-
const scrollToTop = () => {
|
|
33
|
-
if (!el.value)
|
|
34
|
-
return;
|
|
35
|
-
const beginTime = Date.now();
|
|
36
|
-
const beginValue = el.value.scrollTop;
|
|
37
|
-
const frameFunc = () => {
|
|
38
|
-
if (!el.value)
|
|
39
|
-
return;
|
|
40
|
-
const progress = (Date.now() - beginTime) / 500;
|
|
41
|
-
if (progress < 1) {
|
|
42
|
-
el.value.scrollTop = beginValue * (1 - easeInOutCubic(progress));
|
|
43
|
-
requestAnimationFrame(frameFunc);
|
|
44
|
-
} else {
|
|
45
|
-
el.value.scrollTop = 0;
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
requestAnimationFrame(frameFunc);
|
|
49
|
-
};
|
|
50
|
-
const handleScroll = () => {
|
|
51
|
-
if (el.value)
|
|
52
|
-
visible.value = el.value.scrollTop >= props.visibilityHeight;
|
|
53
|
-
};
|
|
54
|
-
const handleClick = (event) => {
|
|
55
|
-
scrollToTop();
|
|
56
|
-
emit("click", event);
|
|
57
|
-
};
|
|
58
|
-
const handleScrollThrottled = useThrottleFn(handleScroll, 300);
|
|
59
|
-
onMounted(() => {
|
|
60
|
-
var _a;
|
|
61
|
-
container.value = document;
|
|
62
|
-
el.value = document.documentElement;
|
|
63
|
-
if (props.target) {
|
|
64
|
-
el.value = (_a = document.querySelector(props.target)) != null ? _a : void 0;
|
|
65
|
-
if (!el.value) {
|
|
66
|
-
throwError(COMPONENT_NAME, `target is not existed: ${props.target}`);
|
|
67
|
-
}
|
|
68
|
-
container.value = el.value;
|
|
69
|
-
}
|
|
70
|
-
useEventListener(container, "scroll", handleScrollThrottled);
|
|
71
|
-
});
|
|
72
|
-
return (_ctx, _cache) => {
|
|
73
|
-
return openBlock(), createBlock(Transition, {
|
|
74
|
-
name: `${unref(ns).namespace.value}-fade-in`
|
|
75
|
-
}, {
|
|
76
|
-
default: withCtx(() => [
|
|
77
|
-
visible.value ? (openBlock(), createElementBlock("div", {
|
|
78
|
-
key: 0,
|
|
79
|
-
style: normalizeStyle(unref(backTopStyle)),
|
|
80
|
-
class: normalizeClass(unref(ns).b()),
|
|
81
|
-
onClick: withModifiers(handleClick, ["stop"])
|
|
82
|
-
}, [
|
|
83
|
-
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
84
|
-
createVNode(unref(ElIcon), {
|
|
85
|
-
class: normalizeClass(unref(ns).e("icon"))
|
|
86
|
-
}, {
|
|
87
|
-
default: withCtx(() => [
|
|
88
|
-
createVNode(unref(CaretTop))
|
|
89
|
-
]),
|
|
90
|
-
_: 1
|
|
91
|
-
}, 8, ["class"])
|
|
92
|
-
])
|
|
93
|
-
], 14, _hoisted_1)) : createCommentVNode("v-if", true)
|
|
94
|
-
]),
|
|
95
|
-
_: 3
|
|
96
|
-
}, 8, ["name"]);
|
|
97
|
-
};
|
|
1
|
+
const backtopProps = {
|
|
2
|
+
visibilityHeight: {
|
|
3
|
+
type: Number,
|
|
4
|
+
default: 200
|
|
5
|
+
},
|
|
6
|
+
target: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: ""
|
|
9
|
+
},
|
|
10
|
+
right: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 40
|
|
13
|
+
},
|
|
14
|
+
bottom: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 40
|
|
98
17
|
}
|
|
99
|
-
}
|
|
100
|
-
|
|
18
|
+
};
|
|
19
|
+
const backtopEmits = {
|
|
20
|
+
click: (evt) => evt instanceof MouseEvent
|
|
21
|
+
};
|
|
101
22
|
|
|
102
|
-
export {
|
|
23
|
+
export { backtopEmits, backtopProps };
|
|
103
24
|
//# sourceMappingURL=backtop2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backtop2.mjs","sources":["../../../../../../packages/components/backtop/src/backtop.
|
|
1
|
+
{"version":3,"file":"backtop2.mjs","sources":["../../../../../../packages/components/backtop/src/backtop.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const backtopProps = {\n visibilityHeight: {\n type: Number,\n default: 200,\n },\n target: {\n type: String,\n default: '',\n },\n right: {\n type: Number,\n default: 40,\n },\n bottom: {\n type: Number,\n default: 40,\n },\n} as const\nexport type BacktopProps = ExtractPropTypes<typeof backtopProps>\n\nexport const backtopEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\nexport type BacktopEmits = typeof backtopEmits\n"],"names":[],"mappings":"AAAY,MAAC,YAAY,GAAG;AAC5B,EAAE,gBAAgB,EAAE;AACpB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,GAAG;AAChB,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,MAAM,EAAE;AACV,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE;AACU,MAAC,YAAY,GAAG;AAC5B,EAAE,KAAK,EAAE,CAAC,GAAG,KAAK,GAAG,YAAY,UAAU;AAC3C;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
2
|
import Breadcrumb from './src/breadcrumb.mjs';
|
|
3
|
-
import BreadcrumbItem from './src/breadcrumb-
|
|
3
|
+
import BreadcrumbItem from './src/breadcrumb-item2.mjs';
|
|
4
4
|
export { breadcrumbProps } from './src/breadcrumb2.mjs';
|
|
5
|
-
export { breadcrumbItemProps } from './src/breadcrumb-
|
|
5
|
+
export { breadcrumbItemProps } from './src/breadcrumb-item.mjs';
|
|
6
6
|
import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
|
|
7
7
|
|
|
8
8
|
const ElBreadcrumb = withInstall(Breadcrumb, {
|
|
@@ -1,62 +1,16 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import '../../../tokens/index.mjs';
|
|
4
|
-
import '../../../hooks/index.mjs';
|
|
5
|
-
import { breadcrumbItemProps } from './breadcrumb-item2.mjs';
|
|
6
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
-
import { breadcrumbKey } from '../../../tokens/breadcrumb.mjs';
|
|
8
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps, definePropType } from '../../../utils/vue/props.mjs';
|
|
9
3
|
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const instance = getCurrentInstance();
|
|
19
|
-
const router = instance.appContext.config.globalProperties.$router;
|
|
20
|
-
const breadcrumbInjection = inject(breadcrumbKey, {});
|
|
21
|
-
const ns = useNamespace("breadcrumb");
|
|
22
|
-
const { separator, separatorIcon } = breadcrumbInjection;
|
|
23
|
-
const link = ref();
|
|
24
|
-
const onClick = () => {
|
|
25
|
-
if (!props.to || !router)
|
|
26
|
-
return;
|
|
27
|
-
props.replace ? router.replace(props.to) : router.push(props.to);
|
|
28
|
-
};
|
|
29
|
-
return (_ctx, _cache) => {
|
|
30
|
-
return openBlock(), createElementBlock("span", {
|
|
31
|
-
class: normalizeClass(unref(ns).e("item"))
|
|
32
|
-
}, [
|
|
33
|
-
createElementVNode("span", {
|
|
34
|
-
ref_key: "link",
|
|
35
|
-
ref: link,
|
|
36
|
-
class: normalizeClass([unref(ns).e("inner"), unref(ns).is("link", !!_ctx.to)]),
|
|
37
|
-
role: "link",
|
|
38
|
-
onClick
|
|
39
|
-
}, [
|
|
40
|
-
renderSlot(_ctx.$slots, "default")
|
|
41
|
-
], 2),
|
|
42
|
-
unref(separatorIcon) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
43
|
-
key: 0,
|
|
44
|
-
class: normalizeClass(unref(ns).e("separator"))
|
|
45
|
-
}, {
|
|
46
|
-
default: withCtx(() => [
|
|
47
|
-
(openBlock(), createBlock(resolveDynamicComponent(unref(separatorIcon))))
|
|
48
|
-
]),
|
|
49
|
-
_: 1
|
|
50
|
-
}, 8, ["class"])) : (openBlock(), createElementBlock("span", {
|
|
51
|
-
key: 1,
|
|
52
|
-
class: normalizeClass(unref(ns).e("separator")),
|
|
53
|
-
role: "presentation"
|
|
54
|
-
}, toDisplayString(unref(separator)), 3))
|
|
55
|
-
], 2);
|
|
56
|
-
};
|
|
4
|
+
const breadcrumbItemProps = buildProps({
|
|
5
|
+
to: {
|
|
6
|
+
type: definePropType([String, Object]),
|
|
7
|
+
default: ""
|
|
8
|
+
},
|
|
9
|
+
replace: {
|
|
10
|
+
type: Boolean,
|
|
11
|
+
default: false
|
|
57
12
|
}
|
|
58
13
|
});
|
|
59
|
-
var BreadcrumbItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/breadcrumb/src/breadcrumb-item.vue"]]);
|
|
60
14
|
|
|
61
|
-
export {
|
|
15
|
+
export { breadcrumbItemProps };
|
|
62
16
|
//# sourceMappingURL=breadcrumb-item.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb-item.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb-item.
|
|
1
|
+
{"version":3,"file":"breadcrumb-item.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb-item.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type { RouteLocationRaw } from 'vue-router'\nimport type BreadcrumbItem from './breadcrumb-item.vue'\n\nexport const breadcrumbItemProps = buildProps({\n to: {\n type: definePropType<RouteLocationRaw>([String, Object]),\n default: '',\n },\n replace: {\n type: Boolean,\n default: false,\n },\n} as const)\nexport type BreadcrumbItemProps = ExtractPropTypes<typeof breadcrumbItemProps>\n\nexport type BreadcrumbItemInstance = InstanceType<typeof BreadcrumbItem>\n"],"names":[],"mappings":";;;AACY,MAAC,mBAAmB,GAAG,UAAU,CAAC;AAC9C,EAAE,EAAE,EAAE;AACN,IAAI,IAAI,EAAE,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAC1C,IAAI,OAAO,EAAE,EAAE;AACf,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,16 +1,62 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import {
|
|
1
|
+
import { defineComponent, getCurrentInstance, inject, ref, openBlock, createElementBlock, normalizeClass, unref, createElementVNode, renderSlot, createBlock, withCtx, resolveDynamicComponent, toDisplayString } from 'vue';
|
|
2
|
+
import { ElIcon } from '../../icon/index.mjs';
|
|
3
|
+
import '../../../tokens/index.mjs';
|
|
4
|
+
import '../../../hooks/index.mjs';
|
|
5
|
+
import { breadcrumbItemProps } from './breadcrumb-item.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { breadcrumbKey } from '../../../tokens/breadcrumb.mjs';
|
|
8
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
3
9
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
10
|
+
const __default__ = {
|
|
11
|
+
name: "ElBreadcrumbItem"
|
|
12
|
+
};
|
|
13
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
14
|
+
...__default__,
|
|
15
|
+
props: breadcrumbItemProps,
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
const instance = getCurrentInstance();
|
|
19
|
+
const router = instance.appContext.config.globalProperties.$router;
|
|
20
|
+
const breadcrumbInjection = inject(breadcrumbKey, {});
|
|
21
|
+
const ns = useNamespace("breadcrumb");
|
|
22
|
+
const { separator, separatorIcon } = breadcrumbInjection;
|
|
23
|
+
const link = ref();
|
|
24
|
+
const onClick = () => {
|
|
25
|
+
if (!props.to || !router)
|
|
26
|
+
return;
|
|
27
|
+
props.replace ? router.replace(props.to) : router.push(props.to);
|
|
28
|
+
};
|
|
29
|
+
return (_ctx, _cache) => {
|
|
30
|
+
return openBlock(), createElementBlock("span", {
|
|
31
|
+
class: normalizeClass(unref(ns).e("item"))
|
|
32
|
+
}, [
|
|
33
|
+
createElementVNode("span", {
|
|
34
|
+
ref_key: "link",
|
|
35
|
+
ref: link,
|
|
36
|
+
class: normalizeClass([unref(ns).e("inner"), unref(ns).is("link", !!_ctx.to)]),
|
|
37
|
+
role: "link",
|
|
38
|
+
onClick
|
|
39
|
+
}, [
|
|
40
|
+
renderSlot(_ctx.$slots, "default")
|
|
41
|
+
], 2),
|
|
42
|
+
unref(separatorIcon) ? (openBlock(), createBlock(unref(ElIcon), {
|
|
43
|
+
key: 0,
|
|
44
|
+
class: normalizeClass(unref(ns).e("separator"))
|
|
45
|
+
}, {
|
|
46
|
+
default: withCtx(() => [
|
|
47
|
+
(openBlock(), createBlock(resolveDynamicComponent(unref(separatorIcon))))
|
|
48
|
+
]),
|
|
49
|
+
_: 1
|
|
50
|
+
}, 8, ["class"])) : (openBlock(), createElementBlock("span", {
|
|
51
|
+
key: 1,
|
|
52
|
+
class: normalizeClass(unref(ns).e("separator")),
|
|
53
|
+
role: "presentation"
|
|
54
|
+
}, toDisplayString(unref(separator)), 3))
|
|
55
|
+
], 2);
|
|
56
|
+
};
|
|
12
57
|
}
|
|
13
58
|
});
|
|
59
|
+
var BreadcrumbItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/breadcrumb/src/breadcrumb-item.vue"]]);
|
|
14
60
|
|
|
15
|
-
export {
|
|
61
|
+
export { BreadcrumbItem as default };
|
|
16
62
|
//# sourceMappingURL=breadcrumb-item2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breadcrumb-item2.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb-item.
|
|
1
|
+
{"version":3,"file":"breadcrumb-item2.mjs","sources":["../../../../../../packages/components/breadcrumb/src/breadcrumb-item.vue"],"sourcesContent":["<template>\n <span :class=\"ns.e('item')\">\n <span\n ref=\"link\"\n :class=\"[ns.e('inner'), ns.is('link', !!to)]\"\n role=\"link\"\n @click=\"onClick\"\n >\n <slot />\n </span>\n <el-icon v-if=\"separatorIcon\" :class=\"ns.e('separator')\">\n <component :is=\"separatorIcon\" />\n </el-icon>\n <span v-else :class=\"ns.e('separator')\" role=\"presentation\">\n {{ separator }}\n </span>\n </span>\n</template>\n\n<script lang=\"ts\" setup>\nimport { getCurrentInstance, inject, ref } from 'vue'\nimport ElIcon from '@element-plus/components/icon'\nimport { breadcrumbKey } from '@element-plus/tokens'\nimport { useNamespace } from '@element-plus/hooks'\nimport { breadcrumbItemProps } from './breadcrumb-item'\n\nimport type { Router } from 'vue-router'\nimport type { BreadcrumbProps } from './breadcrumb'\n\ndefineOptions({\n name: 'ElBreadcrumbItem',\n})\n\nconst props = defineProps(breadcrumbItemProps)\n\nconst instance = getCurrentInstance()!\nconst router = instance.appContext.config.globalProperties.$router as Router\nconst breadcrumbInjection = inject(breadcrumbKey, {} as BreadcrumbProps)!\n\nconst ns = useNamespace('breadcrumb')\n\nconst { separator, separatorIcon } = breadcrumbInjection\n\nconst link = ref<HTMLSpanElement>()\n\nconst onClick = () => {\n if (!props.to || !router) return\n props.replace ? router.replace(props.to) : router.push(props.to)\n}\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAmCA,IAAA,MAAA,WAAA,kBAAA,EAAA,CAAA;AACA,IAAA,MAAA,MAAA,GAAA,QAAA,CAAA,UAAA,CAAA,MAAA,CAAA,gBAAA,CAAA,OAAA,CAAA;AACA,IAAA,MAAA,mBAAA,GAAA,MAAA,CAAA,aAAA,EAAA,EAAA,CAAA,CAAA;AAEA,IAAA,MAAA,EAAA,GAAA,aAAA,YAAA,CAAA,CAAA;AAEA,IAAA,MAAA,EAAA,WAAA,aAAA,EAAA,GAAA,mBAAA,CAAA;AAEA,IAAA,MAAA,OAAA,GAAA,EAAA,CAAA;AAEA,IAAA,MAAA,UAAA,MAAA;AACA,MAAA,IAAA,CAAA,KAAA,CAAA,EAAA,IAAA,CAAA,MAAA;AAAA,QAAA,OAAA;AACA,MAAA,KAAA,CAAA,OAAA,GAAA,OAAA,OAAA,CAAA,KAAA,CAAA,EAAA,CAAA,GAAA,MAAA,CAAA,IAAA,CAAA,KAAA,CAAA,EAAA,CAAA,CAAA;AAAA,KACA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Button from './src/
|
|
3
|
-
import ButtonGroup from './src/button-
|
|
4
|
-
export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './src/
|
|
2
|
+
import Button from './src/button.mjs';
|
|
3
|
+
import ButtonGroup from './src/button-group2.mjs';
|
|
4
|
+
export { buttonEmits, buttonNativeTypes, buttonProps, buttonTypes } from './src/button2.mjs';
|
|
5
5
|
import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
|
|
6
6
|
|
|
7
7
|
const ElButton = withInstall(Button, {
|
|
@@ -1,34 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '../../../tokens/index.mjs';
|
|
3
|
-
import '../../../hooks/index.mjs';
|
|
4
|
-
import { buttonGroupProps } from './button-group2.mjs';
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { buttonGroupContextKey } from '../../../tokens/button.mjs';
|
|
7
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
1
|
+
import { buttonProps } from './button2.mjs';
|
|
8
2
|
|
|
9
|
-
const
|
|
10
|
-
|
|
3
|
+
const buttonGroupProps = {
|
|
4
|
+
size: buttonProps.size,
|
|
5
|
+
type: buttonProps.type
|
|
11
6
|
};
|
|
12
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
-
...__default__,
|
|
14
|
-
props: buttonGroupProps,
|
|
15
|
-
setup(__props) {
|
|
16
|
-
const props = __props;
|
|
17
|
-
provide(buttonGroupContextKey, reactive({
|
|
18
|
-
size: toRef(props, "size"),
|
|
19
|
-
type: toRef(props, "type")
|
|
20
|
-
}));
|
|
21
|
-
const ns = useNamespace("button");
|
|
22
|
-
return (_ctx, _cache) => {
|
|
23
|
-
return openBlock(), createElementBlock("div", {
|
|
24
|
-
class: normalizeClass(`${unref(ns).b("group")}`)
|
|
25
|
-
}, [
|
|
26
|
-
renderSlot(_ctx.$slots, "default")
|
|
27
|
-
], 2);
|
|
28
|
-
};
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/button/src/button-group.vue"]]);
|
|
32
7
|
|
|
33
|
-
export {
|
|
8
|
+
export { buttonGroupProps };
|
|
34
9
|
//# sourceMappingURL=button-group.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.mjs","sources":["../../../../../../packages/components/button/src/button-group.
|
|
1
|
+
{"version":3,"file":"button-group.mjs","sources":["../../../../../../packages/components/button/src/button-group.ts"],"sourcesContent":["import { buttonProps } from './button'\n\nimport type { ExtractPropTypes } from 'vue'\nimport type buttonGroup from './button-group.vue'\n\nexport const buttonGroupProps = {\n size: buttonProps.size,\n type: buttonProps.type,\n} as const\nexport type ButtonGroupProps = ExtractPropTypes<typeof buttonGroupProps>\n\nexport type ButtonGroupInstance = InstanceType<typeof buttonGroup>\n"],"names":[],"mappings":";;AACY,MAAC,gBAAgB,GAAG;AAChC,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB,EAAE,IAAI,EAAE,WAAW,CAAC,IAAI;AACxB;;;;"}
|
|
@@ -1,9 +1,34 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { defineComponent, provide, reactive, toRef, openBlock, createElementBlock, normalizeClass, unref, renderSlot } from 'vue';
|
|
2
|
+
import '../../../tokens/index.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import { buttonGroupProps } from './button-group.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { buttonGroupContextKey } from '../../../tokens/button.mjs';
|
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
2
8
|
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
type: buttonProps.type
|
|
9
|
+
const __default__ = {
|
|
10
|
+
name: "ElButtonGroup"
|
|
6
11
|
};
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
...__default__,
|
|
14
|
+
props: buttonGroupProps,
|
|
15
|
+
setup(__props) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
provide(buttonGroupContextKey, reactive({
|
|
18
|
+
size: toRef(props, "size"),
|
|
19
|
+
type: toRef(props, "type")
|
|
20
|
+
}));
|
|
21
|
+
const ns = useNamespace("button");
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return openBlock(), createElementBlock("div", {
|
|
24
|
+
class: normalizeClass(`${unref(ns).b("group")}`)
|
|
25
|
+
}, [
|
|
26
|
+
renderSlot(_ctx.$slots, "default")
|
|
27
|
+
], 2);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
var ButtonGroup = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/button/src/button-group.vue"]]);
|
|
7
32
|
|
|
8
|
-
export {
|
|
33
|
+
export { ButtonGroup as default };
|
|
9
34
|
//# sourceMappingURL=button-group2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group2.mjs","sources":["../../../../../../packages/components/button/src/button-group.
|
|
1
|
+
{"version":3,"file":"button-group2.mjs","sources":["../../../../../../packages/components/button/src/button-group.vue"],"sourcesContent":["<template>\n <div :class=\"`${ns.b('group')}`\">\n <slot />\n </div>\n</template>\n<script lang=\"ts\" setup>\nimport { provide, reactive, toRef } from 'vue'\nimport { buttonGroupContextKey } from '@element-plus/tokens'\nimport { useNamespace } from '@element-plus/hooks'\nimport { buttonGroupProps } from './button-group'\n\ndefineOptions({\n name: 'ElButtonGroup',\n})\nconst props = defineProps(buttonGroupProps)\nprovide(\n buttonGroupContextKey,\n reactive({\n size: toRef(props, 'size'),\n type: toRef(props, 'type'),\n })\n)\nconst ns = useNamespace('button')\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAeA,IAAA,OAAA,CACA,uBACA,QAAA,CAAA;AAAA,MACA,IAAA,EAAA,KAAA,CAAA,KAAA,EAAA,MAAA,CAAA;AAAA,MACA,IAAA,EAAA,KAAA,CAAA,KAAA,EAAA,MAAA,CAAA;AAAA,KACA,CACA,CAAA,CAAA;AACA,IAAA,MAAA,EAAA,GAAA,aAAA,QAAA,CAAA,CAAA;;;;;;;;;;;;;;"}
|
|
@@ -1,57 +1,112 @@
|
|
|
1
|
+
import { defineComponent, useSlots, inject, computed, ref, Text, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, Fragment, renderSlot, createBlock, withCtx, resolveDynamicComponent, createCommentVNode } from 'vue';
|
|
2
|
+
import { ElIcon } from '../../icon/index.mjs';
|
|
1
3
|
import '../../../hooks/index.mjs';
|
|
2
|
-
import '../../../
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import
|
|
6
|
-
import {
|
|
4
|
+
import '../../../tokens/index.mjs';
|
|
5
|
+
import { buttonProps, buttonEmits } from './button2.mjs';
|
|
6
|
+
import { useButtonCustomStyle } from './button-custom.mjs';
|
|
7
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
|
+
import { buttonGroupContextKey } from '../../../tokens/button.mjs';
|
|
9
|
+
import { useGlobalConfig } from '../../../hooks/use-global-config/index.mjs';
|
|
10
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
11
|
+
import { useFormItem } from '../../../hooks/use-form-item/index.mjs';
|
|
12
|
+
import { useSize, useDisabled } from '../../../hooks/use-common-props/index.mjs';
|
|
7
13
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
"
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
14
|
+
const _hoisted_1 = ["disabled", "autofocus", "type"];
|
|
15
|
+
const __default__ = {
|
|
16
|
+
name: "ElButton"
|
|
17
|
+
};
|
|
18
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
19
|
+
...__default__,
|
|
20
|
+
props: buttonProps,
|
|
21
|
+
emits: buttonEmits,
|
|
22
|
+
setup(__props, { expose, emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const slots = useSlots();
|
|
25
|
+
const buttonGroupContext = inject(buttonGroupContextKey, void 0);
|
|
26
|
+
const globalConfig = useGlobalConfig("button");
|
|
27
|
+
const ns = useNamespace("button");
|
|
28
|
+
const { form } = useFormItem();
|
|
29
|
+
const _size = useSize(computed(() => buttonGroupContext == null ? void 0 : buttonGroupContext.size));
|
|
30
|
+
const _disabled = useDisabled();
|
|
31
|
+
const _ref = ref();
|
|
32
|
+
const _type = computed(() => props.type || (buttonGroupContext == null ? void 0 : buttonGroupContext.type) || "");
|
|
33
|
+
const autoInsertSpace = computed(() => {
|
|
34
|
+
var _a, _b, _c;
|
|
35
|
+
return (_c = (_b = props.autoInsertSpace) != null ? _b : (_a = globalConfig.value) == null ? void 0 : _a.autoInsertSpace) != null ? _c : false;
|
|
36
|
+
});
|
|
37
|
+
const shouldAddSpace = computed(() => {
|
|
38
|
+
var _a;
|
|
39
|
+
const defaultSlot = (_a = slots.default) == null ? void 0 : _a.call(slots);
|
|
40
|
+
if (autoInsertSpace.value && (defaultSlot == null ? void 0 : defaultSlot.length) === 1) {
|
|
41
|
+
const slot = defaultSlot[0];
|
|
42
|
+
if ((slot == null ? void 0 : slot.type) === Text) {
|
|
43
|
+
const text = slot.children;
|
|
44
|
+
return /^\p{Unified_Ideograph}{2}$/u.test(text.trim());
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return false;
|
|
48
|
+
});
|
|
49
|
+
const buttonStyle = useButtonCustomStyle(props);
|
|
50
|
+
const handleClick = (evt) => {
|
|
51
|
+
if (props.nativeType === "reset") {
|
|
52
|
+
form == null ? void 0 : form.resetFields();
|
|
53
|
+
}
|
|
54
|
+
emit("click", evt);
|
|
55
|
+
};
|
|
56
|
+
expose({
|
|
57
|
+
ref: _ref,
|
|
58
|
+
size: _size,
|
|
59
|
+
type: _type,
|
|
60
|
+
disabled: _disabled,
|
|
61
|
+
shouldAddSpace
|
|
62
|
+
});
|
|
63
|
+
return (_ctx, _cache) => {
|
|
64
|
+
return openBlock(), createElementBlock("button", {
|
|
65
|
+
ref_key: "_ref",
|
|
66
|
+
ref: _ref,
|
|
67
|
+
class: normalizeClass([
|
|
68
|
+
unref(ns).b(),
|
|
69
|
+
unref(ns).m(unref(_type)),
|
|
70
|
+
unref(ns).m(unref(_size)),
|
|
71
|
+
unref(ns).is("disabled", unref(_disabled)),
|
|
72
|
+
unref(ns).is("loading", _ctx.loading),
|
|
73
|
+
unref(ns).is("plain", _ctx.plain),
|
|
74
|
+
unref(ns).is("round", _ctx.round),
|
|
75
|
+
unref(ns).is("circle", _ctx.circle)
|
|
76
|
+
]),
|
|
77
|
+
disabled: unref(_disabled) || _ctx.loading,
|
|
78
|
+
autofocus: _ctx.autofocus,
|
|
79
|
+
type: _ctx.nativeType,
|
|
80
|
+
style: normalizeStyle(unref(buttonStyle)),
|
|
81
|
+
onClick: handleClick
|
|
82
|
+
}, [
|
|
83
|
+
_ctx.loading ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
84
|
+
_ctx.$slots.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }) : (openBlock(), createBlock(unref(ElIcon), {
|
|
85
|
+
key: 1,
|
|
86
|
+
class: normalizeClass(unref(ns).is("loading"))
|
|
87
|
+
}, {
|
|
88
|
+
default: withCtx(() => [
|
|
89
|
+
(openBlock(), createBlock(resolveDynamicComponent(_ctx.loadingIcon)))
|
|
90
|
+
]),
|
|
91
|
+
_: 1
|
|
92
|
+
}, 8, ["class"]))
|
|
93
|
+
], 2112)) : _ctx.icon || _ctx.$slots.icon ? (openBlock(), createBlock(unref(ElIcon), { key: 1 }, {
|
|
94
|
+
default: withCtx(() => [
|
|
95
|
+
_ctx.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icon), { key: 0 })) : renderSlot(_ctx.$slots, "icon", { key: 1 })
|
|
96
|
+
]),
|
|
97
|
+
_: 3
|
|
98
|
+
})) : createCommentVNode("v-if", true),
|
|
99
|
+
_ctx.$slots.default ? (openBlock(), createElementBlock("span", {
|
|
100
|
+
key: 2,
|
|
101
|
+
class: normalizeClass({ [unref(ns).em("text", "expand")]: unref(shouldAddSpace) })
|
|
102
|
+
}, [
|
|
103
|
+
renderSlot(_ctx.$slots, "default")
|
|
104
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
105
|
+
], 14, _hoisted_1);
|
|
106
|
+
};
|
|
50
107
|
}
|
|
51
108
|
});
|
|
52
|
-
|
|
53
|
-
click: (evt) => evt instanceof MouseEvent
|
|
54
|
-
};
|
|
109
|
+
var Button = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "/Users/meng/workspace/element-pe/packages/components/button/src/button.vue"]]);
|
|
55
110
|
|
|
56
|
-
export {
|
|
111
|
+
export { Button as default };
|
|
57
112
|
//# sourceMappingURL=button.mjs.map
|