@element-plus/nightly 0.0.20220130 → 0.0.20220131
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.css +1 -1
- package/dist/index.full.js +131 -114
- package/dist/index.full.min.js +7 -7
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +7 -7
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +131 -114
- package/dist/locale/af.js +1 -1
- package/dist/locale/af.min.js +1 -1
- package/dist/locale/af.min.mjs +1 -1
- package/dist/locale/af.mjs +1 -1
- package/dist/locale/ar.js +1 -1
- package/dist/locale/ar.min.js +1 -1
- package/dist/locale/ar.min.mjs +1 -1
- package/dist/locale/ar.mjs +1 -1
- package/dist/locale/bg.js +1 -1
- package/dist/locale/bg.min.js +1 -1
- package/dist/locale/bg.min.mjs +1 -1
- package/dist/locale/bg.mjs +1 -1
- package/dist/locale/bn.js +1 -1
- package/dist/locale/bn.min.js +1 -1
- package/dist/locale/bn.min.mjs +1 -1
- package/dist/locale/bn.mjs +1 -1
- package/dist/locale/ca.js +1 -1
- package/dist/locale/ca.min.js +1 -1
- package/dist/locale/ca.min.mjs +1 -1
- package/dist/locale/ca.mjs +1 -1
- package/dist/locale/cs.js +1 -1
- package/dist/locale/cs.min.js +1 -1
- package/dist/locale/cs.min.mjs +1 -1
- package/dist/locale/cs.mjs +1 -1
- package/dist/locale/da.js +1 -1
- package/dist/locale/da.min.js +1 -1
- package/dist/locale/da.min.mjs +1 -1
- package/dist/locale/da.mjs +1 -1
- package/dist/locale/de.js +1 -1
- package/dist/locale/de.min.js +1 -1
- package/dist/locale/de.min.mjs +1 -1
- package/dist/locale/de.mjs +1 -1
- package/dist/locale/el.js +1 -1
- package/dist/locale/el.min.js +1 -1
- package/dist/locale/el.min.mjs +1 -1
- package/dist/locale/el.mjs +1 -1
- package/dist/locale/en.js +1 -1
- package/dist/locale/en.min.js +1 -1
- package/dist/locale/en.min.mjs +1 -1
- package/dist/locale/en.mjs +1 -1
- package/dist/locale/eo.js +1 -1
- package/dist/locale/eo.min.js +1 -1
- package/dist/locale/eo.min.mjs +1 -1
- package/dist/locale/eo.mjs +1 -1
- package/dist/locale/es.js +1 -1
- package/dist/locale/es.min.js +1 -1
- package/dist/locale/es.min.mjs +1 -1
- package/dist/locale/es.mjs +1 -1
- package/dist/locale/et.js +1 -1
- package/dist/locale/et.min.js +1 -1
- package/dist/locale/et.min.mjs +1 -1
- package/dist/locale/et.mjs +1 -1
- package/dist/locale/eu.js +1 -1
- package/dist/locale/eu.min.js +1 -1
- package/dist/locale/eu.min.mjs +1 -1
- package/dist/locale/eu.mjs +1 -1
- package/dist/locale/fa.js +1 -1
- package/dist/locale/fa.min.js +1 -1
- package/dist/locale/fa.min.mjs +1 -1
- package/dist/locale/fa.mjs +1 -1
- package/dist/locale/fi.js +1 -1
- package/dist/locale/fi.min.js +1 -1
- package/dist/locale/fi.min.mjs +1 -1
- package/dist/locale/fi.mjs +1 -1
- package/dist/locale/fr.js +1 -1
- package/dist/locale/fr.min.js +1 -1
- package/dist/locale/fr.min.mjs +1 -1
- package/dist/locale/fr.mjs +1 -1
- package/dist/locale/he.js +1 -1
- package/dist/locale/he.min.js +1 -1
- package/dist/locale/he.min.mjs +1 -1
- package/dist/locale/he.mjs +1 -1
- package/dist/locale/hr.js +1 -1
- package/dist/locale/hr.min.js +1 -1
- package/dist/locale/hr.min.mjs +1 -1
- package/dist/locale/hr.mjs +1 -1
- package/dist/locale/hu.js +1 -1
- package/dist/locale/hu.min.js +1 -1
- package/dist/locale/hu.min.mjs +1 -1
- package/dist/locale/hu.mjs +1 -1
- package/dist/locale/hy-am.js +1 -1
- package/dist/locale/hy-am.min.js +1 -1
- package/dist/locale/hy-am.min.mjs +1 -1
- package/dist/locale/hy-am.mjs +1 -1
- package/dist/locale/id.js +1 -1
- package/dist/locale/id.min.js +1 -1
- package/dist/locale/id.min.mjs +1 -1
- package/dist/locale/id.mjs +1 -1
- package/dist/locale/it.js +1 -1
- package/dist/locale/it.min.js +1 -1
- package/dist/locale/it.min.mjs +1 -1
- package/dist/locale/it.mjs +1 -1
- package/dist/locale/ja.js +1 -1
- package/dist/locale/ja.min.js +1 -1
- package/dist/locale/ja.min.mjs +1 -1
- package/dist/locale/ja.mjs +1 -1
- package/dist/locale/kk.js +1 -1
- package/dist/locale/kk.min.js +1 -1
- package/dist/locale/kk.min.mjs +1 -1
- package/dist/locale/kk.mjs +1 -1
- package/dist/locale/km.js +1 -1
- package/dist/locale/km.min.js +1 -1
- package/dist/locale/km.min.mjs +1 -1
- package/dist/locale/km.mjs +1 -1
- package/dist/locale/ko.js +1 -1
- package/dist/locale/ko.min.js +1 -1
- package/dist/locale/ko.min.mjs +1 -1
- package/dist/locale/ko.mjs +1 -1
- package/dist/locale/ku.js +1 -1
- package/dist/locale/ku.min.js +1 -1
- package/dist/locale/ku.min.mjs +1 -1
- package/dist/locale/ku.mjs +1 -1
- package/dist/locale/ky.js +1 -1
- package/dist/locale/ky.min.js +1 -1
- package/dist/locale/ky.min.mjs +1 -1
- package/dist/locale/ky.mjs +1 -1
- package/dist/locale/lt.js +1 -1
- package/dist/locale/lt.min.js +1 -1
- package/dist/locale/lt.min.mjs +1 -1
- package/dist/locale/lt.mjs +1 -1
- package/dist/locale/lv.js +1 -1
- package/dist/locale/lv.min.js +1 -1
- package/dist/locale/lv.min.mjs +1 -1
- package/dist/locale/lv.mjs +1 -1
- package/dist/locale/mn.js +1 -1
- package/dist/locale/mn.min.js +1 -1
- package/dist/locale/mn.min.mjs +1 -1
- package/dist/locale/mn.mjs +1 -1
- package/dist/locale/nb-no.js +1 -1
- package/dist/locale/nb-no.min.js +1 -1
- package/dist/locale/nb-no.min.mjs +1 -1
- package/dist/locale/nb-no.mjs +1 -1
- package/dist/locale/nl.js +1 -1
- package/dist/locale/nl.min.js +1 -1
- package/dist/locale/nl.min.mjs +1 -1
- package/dist/locale/nl.mjs +1 -1
- package/dist/locale/pa.js +1 -1
- package/dist/locale/pa.min.js +1 -1
- package/dist/locale/pa.min.mjs +1 -1
- package/dist/locale/pa.mjs +1 -1
- package/dist/locale/pl.js +1 -1
- package/dist/locale/pl.min.js +1 -1
- package/dist/locale/pl.min.mjs +1 -1
- package/dist/locale/pl.mjs +1 -1
- package/dist/locale/pt-br.js +1 -1
- package/dist/locale/pt-br.min.js +1 -1
- package/dist/locale/pt-br.min.mjs +1 -1
- package/dist/locale/pt-br.mjs +1 -1
- package/dist/locale/pt.js +1 -1
- package/dist/locale/pt.min.js +1 -1
- package/dist/locale/pt.min.mjs +1 -1
- package/dist/locale/pt.mjs +1 -1
- package/dist/locale/ro.js +1 -1
- package/dist/locale/ro.min.js +1 -1
- package/dist/locale/ro.min.mjs +1 -1
- package/dist/locale/ro.mjs +1 -1
- package/dist/locale/ru.js +1 -1
- package/dist/locale/ru.min.js +1 -1
- package/dist/locale/ru.min.mjs +1 -1
- package/dist/locale/ru.mjs +1 -1
- package/dist/locale/sk.js +1 -1
- package/dist/locale/sk.min.js +1 -1
- package/dist/locale/sk.min.mjs +1 -1
- package/dist/locale/sk.mjs +1 -1
- package/dist/locale/sl.js +1 -1
- package/dist/locale/sl.min.js +1 -1
- package/dist/locale/sl.min.mjs +1 -1
- package/dist/locale/sl.mjs +1 -1
- package/dist/locale/sr.js +1 -1
- package/dist/locale/sr.min.js +1 -1
- package/dist/locale/sr.min.mjs +1 -1
- package/dist/locale/sr.mjs +1 -1
- package/dist/locale/sv.js +1 -1
- package/dist/locale/sv.min.js +1 -1
- package/dist/locale/sv.min.mjs +1 -1
- package/dist/locale/sv.mjs +1 -1
- package/dist/locale/ta.js +1 -1
- package/dist/locale/ta.min.js +1 -1
- package/dist/locale/ta.min.mjs +1 -1
- package/dist/locale/ta.mjs +1 -1
- package/dist/locale/th.js +1 -1
- package/dist/locale/th.min.js +1 -1
- package/dist/locale/th.min.mjs +1 -1
- package/dist/locale/th.mjs +1 -1
- package/dist/locale/tk.js +1 -1
- package/dist/locale/tk.min.js +1 -1
- package/dist/locale/tk.min.mjs +1 -1
- package/dist/locale/tk.mjs +1 -1
- package/dist/locale/tr.js +1 -1
- package/dist/locale/tr.min.js +1 -1
- package/dist/locale/tr.min.mjs +1 -1
- package/dist/locale/tr.mjs +1 -1
- package/dist/locale/ug-cn.js +1 -1
- package/dist/locale/ug-cn.min.js +1 -1
- package/dist/locale/ug-cn.min.mjs +1 -1
- package/dist/locale/ug-cn.mjs +1 -1
- package/dist/locale/uk.js +1 -1
- package/dist/locale/uk.min.js +1 -1
- package/dist/locale/uk.min.mjs +1 -1
- package/dist/locale/uk.mjs +1 -1
- package/dist/locale/uz-uz.js +1 -1
- package/dist/locale/uz-uz.min.js +1 -1
- package/dist/locale/uz-uz.min.mjs +1 -1
- package/dist/locale/uz-uz.mjs +1 -1
- package/dist/locale/vi.js +1 -1
- package/dist/locale/vi.min.js +1 -1
- package/dist/locale/vi.min.mjs +1 -1
- package/dist/locale/vi.mjs +1 -1
- package/dist/locale/zh-cn.js +1 -1
- package/dist/locale/zh-cn.min.js +1 -1
- package/dist/locale/zh-cn.min.mjs +1 -1
- package/dist/locale/zh-cn.mjs +1 -1
- package/dist/locale/zh-tw.js +1 -1
- package/dist/locale/zh-tw.min.js +1 -1
- package/dist/locale/zh-tw.min.mjs +1 -1
- package/dist/locale/zh-tw.mjs +1 -1
- package/es/components/cascader/index.d.ts +44 -0
- package/es/components/cascader/src/index.mjs +1 -7
- package/es/components/cascader/src/index.mjs.map +1 -1
- package/es/components/cascader/src/index.vue.d.ts +22 -0
- package/es/components/popover/index.d.ts +4 -0
- package/es/components/popover/src/index.mjs +14 -4
- package/es/components/popover/src/index.mjs.map +1 -1
- package/es/components/popover/src/index.vue.d.ts +2 -0
- package/es/components/scrollbar/index.d.ts +11 -0
- package/es/components/scrollbar/src/scrollbar.vue.d.ts +11 -0
- package/es/components/scrollbar/src/scrollbar2.mjs +13 -10
- package/es/components/scrollbar/src/scrollbar2.mjs.map +1 -1
- package/es/components/scrollbar/src/thumb.vue.d.ts +11 -0
- package/es/components/scrollbar/src/thumb2.mjs +11 -5
- package/es/components/scrollbar/src/thumb2.mjs.map +1 -1
- package/es/components/skeleton/index.d.ts +37 -2
- package/es/components/skeleton/src/skeleton-item.vue.d.ts +13 -1
- package/es/components/skeleton/src/skeleton-item2.mjs +10 -2
- package/es/components/skeleton/src/skeleton-item2.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton.vue.d.ts +11 -0
- package/es/components/skeleton/src/skeleton2.mjs +11 -8
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/cascader/index.d.ts +44 -0
- package/lib/components/cascader/src/index.js +1 -7
- package/lib/components/cascader/src/index.js.map +1 -1
- package/lib/components/cascader/src/index.vue.d.ts +22 -0
- package/lib/components/popover/index.d.ts +4 -0
- package/lib/components/popover/src/index.js +14 -4
- package/lib/components/popover/src/index.js.map +1 -1
- package/lib/components/popover/src/index.vue.d.ts +2 -0
- package/lib/components/scrollbar/index.d.ts +11 -0
- package/lib/components/scrollbar/src/scrollbar.vue.d.ts +11 -0
- package/lib/components/scrollbar/src/scrollbar2.js +12 -9
- package/lib/components/scrollbar/src/scrollbar2.js.map +1 -1
- package/lib/components/scrollbar/src/thumb.vue.d.ts +11 -0
- package/lib/components/scrollbar/src/thumb2.js +11 -5
- package/lib/components/scrollbar/src/thumb2.js.map +1 -1
- package/lib/components/skeleton/index.d.ts +37 -2
- package/lib/components/skeleton/src/skeleton-item.vue.d.ts +13 -1
- package/lib/components/skeleton/src/skeleton-item2.js +10 -2
- package/lib/components/skeleton/src/skeleton-item2.js.map +1 -1
- package/lib/components/skeleton/src/skeleton.vue.d.ts +11 -0
- package/lib/components/skeleton/src/skeleton2.js +12 -9
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +2 -2
- package/theme-chalk/el-popper.css +1 -1
- package/theme-chalk/index.css +1 -1
- package/theme-chalk/src/popper.scss +6 -6
- package/web-types.json +1 -1
|
@@ -1505,6 +1505,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1505
1505
|
scrollLeft: number;
|
|
1506
1506
|
}) => any) | undefined;
|
|
1507
1507
|
}, {
|
|
1508
|
+
ns: {
|
|
1509
|
+
namespace: ComputedRef<string>;
|
|
1510
|
+
b: (blockSuffix?: string) => string;
|
|
1511
|
+
e: (element?: string | undefined) => string;
|
|
1512
|
+
m: (modifier?: string | undefined) => string;
|
|
1513
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
1514
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
1515
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
1516
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
1517
|
+
is: (name: string, state?: boolean) => string;
|
|
1518
|
+
};
|
|
1508
1519
|
scrollbar$: Ref<HTMLDivElement | undefined>;
|
|
1509
1520
|
wrap$: Ref<HTMLDivElement | undefined>;
|
|
1510
1521
|
resize$: Ref<HTMLElement | undefined>;
|
|
@@ -1575,6 +1586,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
1575
1586
|
scrollLeft: number;
|
|
1576
1587
|
}) => any) | undefined;
|
|
1577
1588
|
} & import("vue").ShallowUnwrapRef<{
|
|
1589
|
+
ns: {
|
|
1590
|
+
namespace: ComputedRef<string>;
|
|
1591
|
+
b: (blockSuffix?: string) => string;
|
|
1592
|
+
e: (element?: string | undefined) => string;
|
|
1593
|
+
m: (modifier?: string | undefined) => string;
|
|
1594
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
1595
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
1596
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
1597
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
1598
|
+
is: (name: string, state?: boolean) => string;
|
|
1599
|
+
};
|
|
1578
1600
|
scrollbar$: Ref<HTMLDivElement | undefined>;
|
|
1579
1601
|
wrap$: Ref<HTMLDivElement | undefined>;
|
|
1580
1602
|
resize$: Ref<HTMLElement | undefined>;
|
|
@@ -839,6 +839,8 @@ declare const _Popover: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
839
839
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
840
840
|
} & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<import("..").ElPopperInjectionContext> & {} & {} & import("vue").ComponentCustomProperties) | null | undefined>;
|
|
841
841
|
hide: () => void;
|
|
842
|
+
afterEnter: () => void;
|
|
843
|
+
afterLeave: () => void;
|
|
842
844
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
843
845
|
title: StringConstructor;
|
|
844
846
|
width: import("../../utils/props").BuildPropReturn<(StringConstructor | NumberConstructor)[], number, unknown, unknown, unknown>;
|
|
@@ -1783,6 +1785,8 @@ export declare const ElPopover: SFCWithInstall<import("vue").DefineComponent<{
|
|
|
1783
1785
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
1784
1786
|
} & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<import("..").ElPopperInjectionContext> & {} & {} & import("vue").ComponentCustomProperties) | null | undefined>;
|
|
1785
1787
|
hide: () => void;
|
|
1788
|
+
afterEnter: () => void;
|
|
1789
|
+
afterLeave: () => void;
|
|
1786
1790
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
1787
1791
|
title: StringConstructor;
|
|
1788
1792
|
width: import("../../utils/props").BuildPropReturn<(StringConstructor | NumberConstructor)[], number, unknown, unknown, unknown>;
|
|
@@ -14,7 +14,7 @@ const _sfc_main = defineComponent({
|
|
|
14
14
|
},
|
|
15
15
|
props: usePopoverProps,
|
|
16
16
|
emits,
|
|
17
|
-
setup(props) {
|
|
17
|
+
setup(props, { emit }) {
|
|
18
18
|
const tooltipRef = ref(null);
|
|
19
19
|
const popperRef = computed(() => {
|
|
20
20
|
var _a;
|
|
@@ -45,12 +45,20 @@ const _sfc_main = defineComponent({
|
|
|
45
45
|
var _a;
|
|
46
46
|
(_a = tooltipRef.value) == null ? void 0 : _a.hide();
|
|
47
47
|
};
|
|
48
|
+
const afterEnter = () => {
|
|
49
|
+
emit("after-enter");
|
|
50
|
+
};
|
|
51
|
+
const afterLeave = () => {
|
|
52
|
+
emit("after-leave");
|
|
53
|
+
};
|
|
48
54
|
return {
|
|
49
55
|
kls,
|
|
50
56
|
style,
|
|
51
57
|
tooltipRef,
|
|
52
58
|
popperRef,
|
|
53
|
-
hide
|
|
59
|
+
hide,
|
|
60
|
+
afterEnter,
|
|
61
|
+
afterLeave
|
|
54
62
|
};
|
|
55
63
|
}
|
|
56
64
|
});
|
|
@@ -67,7 +75,9 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
67
75
|
enterable: _ctx.enterable,
|
|
68
76
|
"popper-class": _ctx.kls,
|
|
69
77
|
"popper-style": _ctx.style,
|
|
70
|
-
persistent: ""
|
|
78
|
+
persistent: "",
|
|
79
|
+
onShow: _ctx.afterEnter,
|
|
80
|
+
onHide: _ctx.afterLeave
|
|
71
81
|
}), {
|
|
72
82
|
content: withCtx(() => [
|
|
73
83
|
_ctx.title ? (openBlock(), createElementBlock("div", _hoisted_1, toDisplayString(_ctx.title), 1)) : createCommentVNode("v-if", true),
|
|
@@ -79,7 +89,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
79
89
|
_ctx.$slots.reference ? renderSlot(_ctx.$slots, "reference", { key: 0 }) : createCommentVNode("v-if", true)
|
|
80
90
|
]),
|
|
81
91
|
_: 3
|
|
82
|
-
}, 16, ["aria-label", "effect", "enterable", "popper-class", "popper-style"]);
|
|
92
|
+
}, 16, ["aria-label", "effect", "enterable", "popper-class", "popper-style", "onShow", "onHide"]);
|
|
83
93
|
}
|
|
84
94
|
var Popover = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
85
95
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/popover/src/index.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n persistent\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" class=\"el-popover__title\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, unref } from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { isString } from '@element-plus/utils/util'\nimport { usePopoverProps } from './popover'\n\nimport type { StyleValue } from 'vue'\n\nconst emits = ['update:visible', 'after-enter', 'after-leave']\n\nconst NAME = 'ElPopover'\n\nexport default defineComponent({\n name: NAME,\n components: {\n ElTooltip,\n },\n props: usePopoverProps,\n emits,\n setup(props) {\n const tooltipRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n })\n const width = computed(() => {\n if (isString(props.width)) {\n return props.width as string\n }\n return `${props.width}px`\n })\n\n const style = computed(() => {\n return [\n {\n width: width.value,\n },\n props.popperStyle,\n ] as StyleValue\n })\n\n const kls = computed(() => {\n return [\n { 'el-popover--plain': !!props.content },\n 'el-popover',\n props.popperClass,\n ]\n })\n\n const hide = () => {\n tooltipRef.value?.hide()\n }\n\n return {\n kls,\n style,\n tooltipRef,\n popperRef,\n hide,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"index.mjs","sources":["../../../../../../packages/components/popover/src/index.vue"],"sourcesContent":["<template>\n <el-tooltip\n ref=\"tooltipRef\"\n v-bind=\"$attrs\"\n :aria-label=\"title\"\n :effect=\"effect\"\n :enterable=\"enterable\"\n :popper-class=\"kls\"\n :popper-style=\"style\"\n persistent\n @show=\"afterEnter\"\n @hide=\"afterLeave\"\n >\n <template v-if=\"$slots.reference\">\n <slot name=\"reference\" />\n </template>\n\n <template #content>\n <div v-if=\"title\" class=\"el-popover__title\" role=\"title\">\n {{ title }}\n </div>\n <slot>\n {{ content }}\n </slot>\n </template>\n </el-tooltip>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, computed, ref, unref } from 'vue'\nimport ElTooltip from '@element-plus/components/tooltip'\nimport { isString } from '@element-plus/utils/util'\nimport { usePopoverProps } from './popover'\n\nimport type { StyleValue } from 'vue'\n\nconst emits = ['update:visible', 'after-enter', 'after-leave']\n\nconst NAME = 'ElPopover'\n\nexport default defineComponent({\n name: NAME,\n components: {\n ElTooltip,\n },\n props: usePopoverProps,\n emits,\n setup(props, { emit }) {\n const tooltipRef = ref<InstanceType<typeof ElTooltip> | null>(null)\n const popperRef = computed(() => {\n return unref(tooltipRef)?.popperRef\n })\n const width = computed(() => {\n if (isString(props.width)) {\n return props.width as string\n }\n return `${props.width}px`\n })\n\n const style = computed(() => {\n return [\n {\n width: width.value,\n },\n props.popperStyle,\n ] as StyleValue\n })\n\n const kls = computed(() => {\n return [\n { 'el-popover--plain': !!props.content },\n 'el-popover',\n props.popperClass,\n ]\n })\n\n const hide = () => {\n tooltipRef.value?.hide()\n }\n\n const afterEnter = () => {\n emit('after-enter')\n }\n\n const afterLeave = () => {\n emit('after-leave')\n }\n\n return {\n kls,\n style,\n tooltipRef,\n popperRef,\n hide,\n afterEnter,\n afterLeave,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;AAmCA,MAAM,QAAQ,CAAC,kBAAkB,eAAe;AAEhD,MAAM,OAAO;AAEb,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA;AAAA,EAEF,OAAO;AAAA,EACP;AAAA,EACA,MAAM,OAAO,EAAE,QAAQ;AACrB,UAAM,aAAa,IAA2C;AAC9D,UAAM,YAAY,SAAS,MAAM;AAC/B,aAAO;AAAmB;AAE5B;AACE,UAAI,uBAAuB;AACzB;AAAa;AAEf;AAAgB;AAGlB;AACE;AAAO;AACL;AACe;AAAA;AAET;AAAA;AAIV;AACE,aAAO;AAAA;AAC0B,QAC/B;AAAA,QACA;AAAM;AAAA;AAIV;AACE,iBAAW;AAAO;AAGpB,uBAAmB;AACjB;AAAK;AAGP,UAAM;AACJ;AAAK;AAGP,WAAO;AAAA,MACL;AAAA;AACA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;AA5EuB;AAA0B;;;;SAdlD;AAAiB;AACH;AACH,IACX;AAAc,IACd;AAAc,IACf,gBAAU;AAAA,IACT;AAAM,IACN;AAAM;;AAMI;AACO;AAKT;AADF;;;;AATyB;;;;;;;;;;;"}
|
|
@@ -838,6 +838,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
838
838
|
$watch(source: string | Function, cb: Function, options?: import("vue").WatchOptions<boolean> | undefined): import("vue").WatchStopHandle;
|
|
839
839
|
} & Readonly<import("vue").ExtractPropTypes<{}>> & import("vue").ShallowUnwrapRef<import("../..").ElPopperInjectionContext> & {} & {} & import("vue").ComponentCustomProperties) | null | undefined>;
|
|
840
840
|
hide: () => void;
|
|
841
|
+
afterEnter: () => void;
|
|
842
|
+
afterLeave: () => void;
|
|
841
843
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, string[], string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
842
844
|
title: StringConstructor;
|
|
843
845
|
width: import("../../../utils/props").BuildPropReturn<(StringConstructor | NumberConstructor)[], number, unknown, unknown, unknown>;
|
|
@@ -11,6 +11,17 @@ export declare const ElScrollbar: import("../../utils/types").SFCWithInstall<imp
|
|
|
11
11
|
readonly always: import("../../utils/props").BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
12
12
|
readonly minSize: import("../../utils/props").BuildPropReturn<NumberConstructor, 20, unknown, unknown, unknown>;
|
|
13
13
|
}, {
|
|
14
|
+
ns: {
|
|
15
|
+
namespace: import("vue").ComputedRef<string>;
|
|
16
|
+
b: (blockSuffix?: string) => string;
|
|
17
|
+
e: (element?: string | undefined) => string;
|
|
18
|
+
m: (modifier?: string | undefined) => string;
|
|
19
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
20
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
21
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
22
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
23
|
+
is: (name: string, state?: boolean) => string;
|
|
24
|
+
};
|
|
14
25
|
scrollbar$: import("vue").Ref<HTMLDivElement | undefined>;
|
|
15
26
|
wrap$: import("vue").Ref<HTMLDivElement | undefined>;
|
|
16
27
|
resize$: import("vue").Ref<HTMLElement | undefined>;
|
|
@@ -12,6 +12,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
12
12
|
readonly always: import("../../../utils/props").BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
13
13
|
readonly minSize: import("../../../utils/props").BuildPropReturn<NumberConstructor, 20, unknown, unknown, unknown>;
|
|
14
14
|
}, {
|
|
15
|
+
ns: {
|
|
16
|
+
namespace: import("vue").ComputedRef<string>;
|
|
17
|
+
b: (blockSuffix?: string) => string;
|
|
18
|
+
e: (element?: string | undefined) => string;
|
|
19
|
+
m: (modifier?: string | undefined) => string;
|
|
20
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
21
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
22
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
23
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
24
|
+
is: (name: string, state?: boolean) => string;
|
|
25
|
+
};
|
|
15
26
|
scrollbar$: import("vue").Ref<HTMLDivElement | undefined>;
|
|
16
27
|
wrap$: import("vue").Ref<HTMLDivElement | undefined>;
|
|
17
28
|
resize$: import("vue").Ref<HTMLElement | undefined>;
|
|
@@ -1,11 +1,13 @@
|
|
|
1
|
-
import { defineComponent, ref, computed, watch, provide, reactive, onMounted, nextTick, resolveComponent, openBlock, createElementBlock,
|
|
1
|
+
import { defineComponent, ref, computed, watch, provide, reactive, onMounted, nextTick, resolveComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, createBlock, resolveDynamicComponent, withCtx, renderSlot, createCommentVNode } from 'vue';
|
|
2
2
|
import { useResizeObserver, useEventListener } from '@vueuse/core';
|
|
3
3
|
import { addUnit, isNumber } from '../../../utils/util.mjs';
|
|
4
4
|
import { debugWarn } from '../../../utils/error.mjs';
|
|
5
5
|
import '../../../tokens/index.mjs';
|
|
6
|
+
import '../../../hooks/index.mjs';
|
|
6
7
|
import Bar from './bar2.mjs';
|
|
7
8
|
import { scrollbarProps, scrollbarEmits } from './scrollbar.mjs';
|
|
8
9
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
10
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
11
|
import { scrollbarContextKey } from '../../../tokens/scrollbar.mjs';
|
|
10
12
|
|
|
11
13
|
const _sfc_main = defineComponent({
|
|
@@ -16,6 +18,7 @@ const _sfc_main = defineComponent({
|
|
|
16
18
|
props: scrollbarProps,
|
|
17
19
|
emits: scrollbarEmits,
|
|
18
20
|
setup(props, { emit }) {
|
|
21
|
+
const ns = useNamespace("scrollbar");
|
|
19
22
|
let stopResizeObserver = void 0;
|
|
20
23
|
let stopResizeListener = void 0;
|
|
21
24
|
const scrollbar$ = ref();
|
|
@@ -95,6 +98,7 @@ const _sfc_main = defineComponent({
|
|
|
95
98
|
nextTick(() => update());
|
|
96
99
|
});
|
|
97
100
|
return {
|
|
101
|
+
ns,
|
|
98
102
|
scrollbar$,
|
|
99
103
|
wrap$,
|
|
100
104
|
resize$,
|
|
@@ -113,26 +117,25 @@ const _sfc_main = defineComponent({
|
|
|
113
117
|
};
|
|
114
118
|
}
|
|
115
119
|
});
|
|
116
|
-
const _hoisted_1 = {
|
|
117
|
-
ref: "scrollbar$",
|
|
118
|
-
class: "el-scrollbar"
|
|
119
|
-
};
|
|
120
120
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
121
121
|
const _component_bar = resolveComponent("bar");
|
|
122
|
-
return openBlock(), createElementBlock("div",
|
|
122
|
+
return openBlock(), createElementBlock("div", {
|
|
123
|
+
ref: "scrollbar$",
|
|
124
|
+
class: normalizeClass(_ctx.ns.b())
|
|
125
|
+
}, [
|
|
123
126
|
createElementVNode("div", {
|
|
124
127
|
ref: "wrap$",
|
|
125
128
|
class: normalizeClass([
|
|
126
129
|
_ctx.wrapClass,
|
|
127
|
-
"
|
|
128
|
-
_ctx.
|
|
130
|
+
_ctx.ns.e("wrap"),
|
|
131
|
+
{ [_ctx.ns.em("wrap", "hidden-default")]: !_ctx.native }
|
|
129
132
|
]),
|
|
130
133
|
style: normalizeStyle(_ctx.style),
|
|
131
134
|
onScroll: _cache[0] || (_cache[0] = (...args) => _ctx.handleScroll && _ctx.handleScroll(...args))
|
|
132
135
|
}, [
|
|
133
136
|
(openBlock(), createBlock(resolveDynamicComponent(_ctx.tag), {
|
|
134
137
|
ref: "resize$",
|
|
135
|
-
class: normalizeClass(["
|
|
138
|
+
class: normalizeClass([_ctx.ns.e("view"), _ctx.viewClass]),
|
|
136
139
|
style: normalizeStyle(_ctx.viewStyle)
|
|
137
140
|
}, {
|
|
138
141
|
default: withCtx(() => [
|
|
@@ -150,7 +153,7 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
150
153
|
"ratio-x": _ctx.ratioX,
|
|
151
154
|
"ratio-y": _ctx.ratioY
|
|
152
155
|
}, null, 8, ["height", "width", "always", "ratio-x", "ratio-y"])) : createCommentVNode("v-if", true)
|
|
153
|
-
],
|
|
156
|
+
], 2);
|
|
154
157
|
}
|
|
155
158
|
var Scrollbar = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
156
159
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scrollbar2.mjs","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.vue"],"sourcesContent":["<template>\n <div ref=\"scrollbar$\" class=\"
|
|
1
|
+
{"version":3,"file":"scrollbar2.mjs","sources":["../../../../../../packages/components/scrollbar/src/scrollbar.vue"],"sourcesContent":["<template>\n <div ref=\"scrollbar$\" :class=\"ns.b()\">\n <div\n ref=\"wrap$\"\n :class=\"[\n wrapClass,\n ns.e('wrap'),\n { [ns.em('wrap', 'hidden-default')]: !native },\n ]\"\n :style=\"style\"\n @scroll=\"handleScroll\"\n >\n <component\n :is=\"tag\"\n ref=\"resize$\"\n :class=\"[ns.e('view'), viewClass]\"\n :style=\"viewStyle\"\n >\n <slot />\n </component>\n </div>\n <template v-if=\"!native\">\n <bar\n ref=\"barRef\"\n :height=\"sizeHeight\"\n :width=\"sizeWidth\"\n :always=\"always\"\n :ratio-x=\"ratioX\"\n :ratio-y=\"ratioY\"\n ></bar>\n </template>\n </div>\n</template>\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n nextTick,\n onMounted,\n provide,\n ref,\n watch,\n reactive,\n} from 'vue'\nimport { useResizeObserver, useEventListener } from '@vueuse/core'\nimport { addUnit, isNumber } from '@element-plus/utils/util'\nimport { debugWarn } from '@element-plus/utils/error'\nimport { scrollbarContextKey } from '@element-plus/tokens'\nimport { useNamespace } from '@element-plus/hooks'\nimport Bar from './bar.vue'\n\nimport { scrollbarProps, scrollbarEmits } from './scrollbar'\nimport type { StyleValue, CSSProperties } from 'vue'\n\nexport default defineComponent({\n name: 'ElScrollbar',\n components: {\n Bar,\n },\n props: scrollbarProps,\n emits: scrollbarEmits,\n\n setup(props, { emit }) {\n const ns = useNamespace('scrollbar')\n\n let stopResizeObserver: (() => void) | undefined = undefined\n let stopResizeListener: (() => void) | undefined = undefined\n\n const scrollbar$ = ref<HTMLDivElement>()\n const wrap$ = ref<HTMLDivElement>()\n const resize$ = ref<HTMLElement>()\n\n const sizeWidth = ref('0')\n const sizeHeight = ref('0')\n const barRef = ref()\n const moveX = ref(0)\n const moveY = ref(0)\n const ratioY = ref(1)\n const ratioX = ref(1)\n const SCOPE = 'ElScrollbar'\n const GAP = 4 // top 2 + bottom 2 of bar instance\n\n const style = computed<StyleValue>(() => {\n const style: CSSProperties = {}\n if (props.height) style.height = addUnit(props.height)\n if (props.maxHeight) style.maxHeight = addUnit(props.maxHeight)\n return [props.wrapStyle, style]\n })\n\n const handleScroll = () => {\n if (wrap$.value) {\n barRef.value?.handleScroll(wrap$.value)\n\n emit('scroll', {\n scrollTop: wrap$.value.scrollTop,\n scrollLeft: wrap$.value.scrollLeft,\n })\n }\n }\n\n const setScrollTop = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(SCOPE, 'value must be a number')\n return\n }\n wrap$.value!.scrollTop = value\n }\n\n const setScrollLeft = (value: number) => {\n if (!isNumber(value)) {\n debugWarn(SCOPE, 'value must be a number')\n return\n }\n wrap$.value!.scrollLeft = value\n }\n\n const update = () => {\n if (!wrap$.value) return\n\n const offsetHeight = wrap$.value.offsetHeight - GAP\n const offsetWidth = wrap$.value.offsetWidth - GAP\n\n const originalHeight = offsetHeight ** 2 / wrap$.value.scrollHeight\n const originalWidth = offsetWidth ** 2 / wrap$.value.scrollWidth\n const height = Math.max(originalHeight, props.minSize)\n const width = Math.max(originalWidth, props.minSize)\n\n ratioY.value =\n originalHeight /\n (offsetHeight - originalHeight) /\n (height / (offsetHeight - height))\n ratioX.value =\n originalWidth /\n (offsetWidth - originalWidth) /\n (width / (offsetWidth - width))\n\n sizeHeight.value = height + GAP < offsetHeight ? `${height}px` : ''\n sizeWidth.value = width + GAP < offsetWidth ? `${width}px` : ''\n }\n\n watch(\n () => props.noresize,\n (noresize) => {\n if (noresize) {\n stopResizeObserver?.()\n stopResizeListener?.()\n } else {\n ;({ stop: stopResizeObserver } = useResizeObserver(resize$, update))\n stopResizeListener = useEventListener('resize', update)\n }\n },\n { immediate: true }\n )\n\n provide(\n scrollbarContextKey,\n reactive({\n scrollbarElement: scrollbar$,\n wrapElement: wrap$,\n })\n )\n\n onMounted(() => {\n if (!props.native) nextTick(() => update())\n })\n\n return {\n ns,\n scrollbar$,\n wrap$,\n resize$,\n barRef,\n moveX,\n moveY,\n ratioX,\n ratioY,\n sizeWidth,\n sizeHeight,\n style,\n update,\n handleScroll,\n setScrollTop,\n setScrollLeft,\n }\n },\n})\n</script>\n"],"names":["_openBlock"],"mappings":";;;;;;;;;;;;AAsDA,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA;AAAA,EAEF,OAAO;AAAA,EACP,OAAO;AAAA,EAEP,MAAM,OAAO,EAAE,QAAQ;AACrB,UAAM,KAAK,aAAa;AAExB,QAAI,qBAA+C;AACnD,QAAI,qBAA+C;AAEnD,UAAM,aAAa;AACnB,UAAM,QAAQ;AACd,UAAM,UAAU;AAEhB,UAAM,YAAY,IAAI;AACtB,UAAM,aAAa,IAAI;AACvB,UAAM,SAAS;AACf,UAAM,QAAQ,IAAI;AAClB,UAAM,QAAQ,IAAI;AAClB,UAAM,SAAS,IAAI;AACnB,UAAM,SAAS,IAAI;AACnB,UAAM,QAAQ;AACd,UAAM,MAAM;AAEZ,UAAM,QAAQ,SAAqB,MAAM;AACvC,YAAM,SAAuB;AAC7B,UAAI,MAAM;AAAQ,eAAM,SAAS,QAAQ,MAAM;AAC/C,UAAI,MAAM;AAAW,eAAM,YAAY,QAAQ,MAAM;AACrD,aAAO,CAAC,MAAM,WAAW;AAAA;AAG3B,UAAM,eAAe,MAAM;AACzB,UAAI;AACF,eAAO;AAEP;AAAe,qBACF;AAAY,UACvB;AAAwB;AAAA;AAAA;AAK9B;AACE,UAAI;AACF,yBAAiB;AACjB;AAAA;AAEF;AAAyB;AAG3B;AACE,UAAI;AACF,yBAAiB;AACjB;AAAA;AAEF;AAA0B;AAG5B;AACE,UAAI;AAAc;AAElB;AACA,YAAM,oBAAoB,MAAM;AAEhC,YAAM,qCAAqC,MAAM;AACjD,YAAM;AACN,YAAM,wCAAwC;AAC9C,YAAM,aAAa,IAAI,eAAe;AAEtC;AAIA,aAAO,QACL,gDAEC;AAEH,kCAA4B;AAC5B,gBAAU,oCAAoC,GAAG,YAAY;AAAA;AAG/D;AAGI,UAAI;AACF;AACA;AAAA;AAEA;AAAC,QAAC;AACF;AAAgD;AAAA,OAGpD;AAGF;AAEW;AACW,MAClB;AAAa;AAIjB;AACE;AAAmB,iBAAS,MAAM;AAAA;AAGpC;AAAO;AACL,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;AArLiB,SAAOA;AAAA;;AAC1B;AACa;AACL;AAAqB;AAAU,aAAyB;AAAE;;;AAMzD;;;AAIQ;AACP,QACL;AAAgB;;;AAET;;;;OAGK;AAAA;;AAET,MACH;AAAA,MACA;AAAO,MACP,YAAQ;AAAA,MACR;AAAS,MACT;AAAS;;;;;;;;;"}
|
|
@@ -5,6 +5,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5
5
|
readonly ratio: import("../../../utils/props").BuildPropReturn<NumberConstructor, unknown, true, unknown, unknown>;
|
|
6
6
|
readonly always: BooleanConstructor;
|
|
7
7
|
}, {
|
|
8
|
+
ns: {
|
|
9
|
+
namespace: import("vue").ComputedRef<string>;
|
|
10
|
+
b: (blockSuffix?: string) => string;
|
|
11
|
+
e: (element?: string | undefined) => string;
|
|
12
|
+
m: (modifier?: string | undefined) => string;
|
|
13
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
14
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
15
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
16
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
17
|
+
is: (name: string, state?: boolean) => string;
|
|
18
|
+
};
|
|
8
19
|
instance: import("vue").Ref<HTMLDivElement | undefined>;
|
|
9
20
|
thumb: import("vue").Ref<HTMLDivElement | undefined>;
|
|
10
21
|
bar: import("vue").ComputedRef<{
|
|
@@ -2,10 +2,12 @@ import { defineComponent, inject, ref, computed, onBeforeUnmount, toRef, openBlo
|
|
|
2
2
|
import { isClient, useEventListener } from '@vueuse/core';
|
|
3
3
|
import '../../../tokens/index.mjs';
|
|
4
4
|
import { throwError } from '../../../utils/error.mjs';
|
|
5
|
+
import '../../../hooks/index.mjs';
|
|
5
6
|
import { BAR_MAP, renderThumbStyle } from './util.mjs';
|
|
6
7
|
import { thumbProps } from './thumb.mjs';
|
|
7
8
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
8
9
|
import { scrollbarContextKey } from '../../../tokens/scrollbar.mjs';
|
|
10
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
9
11
|
|
|
10
12
|
const COMPONENT_NAME = "Thumb";
|
|
11
13
|
const _sfc_main = defineComponent({
|
|
@@ -13,6 +15,7 @@ const _sfc_main = defineComponent({
|
|
|
13
15
|
props: thumbProps,
|
|
14
16
|
setup(props) {
|
|
15
17
|
const scrollbar = inject(scrollbarContextKey);
|
|
18
|
+
const ns = useNamespace("scrollbar");
|
|
16
19
|
if (!scrollbar)
|
|
17
20
|
throwError(COMPONENT_NAME, "can not inject scrollbar context");
|
|
18
21
|
const instance = ref();
|
|
@@ -98,6 +101,7 @@ const _sfc_main = defineComponent({
|
|
|
98
101
|
useEventListener(toRef(scrollbar, "scrollbarElement"), "mousemove", mouseMoveScrollbarHandler);
|
|
99
102
|
useEventListener(toRef(scrollbar, "scrollbarElement"), "mouseleave", mouseLeaveScrollbarHandler);
|
|
100
103
|
return {
|
|
104
|
+
ns,
|
|
101
105
|
instance,
|
|
102
106
|
thumb,
|
|
103
107
|
bar,
|
|
@@ -109,25 +113,27 @@ const _sfc_main = defineComponent({
|
|
|
109
113
|
}
|
|
110
114
|
});
|
|
111
115
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
112
|
-
return openBlock(), createBlock(Transition, {
|
|
116
|
+
return openBlock(), createBlock(Transition, {
|
|
117
|
+
name: _ctx.ns.b("fade")
|
|
118
|
+
}, {
|
|
113
119
|
default: withCtx(() => [
|
|
114
120
|
withDirectives(createElementVNode("div", {
|
|
115
121
|
ref: "instance",
|
|
116
|
-
class: normalizeClass(["
|
|
122
|
+
class: normalizeClass([_ctx.ns.e("bar"), _ctx.ns.is(_ctx.bar.key)]),
|
|
117
123
|
onMousedown: _cache[1] || (_cache[1] = (...args) => _ctx.clickTrackHandler && _ctx.clickTrackHandler(...args))
|
|
118
124
|
}, [
|
|
119
125
|
createElementVNode("div", {
|
|
120
126
|
ref: "thumb",
|
|
121
|
-
class: "
|
|
127
|
+
class: normalizeClass(_ctx.ns.e("thumb")),
|
|
122
128
|
style: normalizeStyle(_ctx.thumbStyle),
|
|
123
129
|
onMousedown: _cache[0] || (_cache[0] = (...args) => _ctx.clickThumbHandler && _ctx.clickThumbHandler(...args))
|
|
124
|
-
}, null,
|
|
130
|
+
}, null, 38)
|
|
125
131
|
], 34), [
|
|
126
132
|
[vShow, _ctx.always || _ctx.visible]
|
|
127
133
|
])
|
|
128
134
|
]),
|
|
129
135
|
_: 1
|
|
130
|
-
});
|
|
136
|
+
}, 8, ["name"]);
|
|
131
137
|
}
|
|
132
138
|
var Thumb = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
133
139
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thumb2.mjs","sources":["../../../../../../packages/components/scrollbar/src/thumb.vue"],"sourcesContent":["<template>\n <transition name=\"
|
|
1
|
+
{"version":3,"file":"thumb2.mjs","sources":["../../../../../../packages/components/scrollbar/src/thumb.vue"],"sourcesContent":["<template>\n <transition :name=\"ns.b('fade')\">\n <div\n v-show=\"always || visible\"\n ref=\"instance\"\n :class=\"[ns.e('bar'), ns.is(bar.key)]\"\n @mousedown=\"clickTrackHandler\"\n >\n <div\n ref=\"thumb\"\n :class=\"ns.e('thumb')\"\n :style=\"thumbStyle\"\n @mousedown=\"clickThumbHandler\"\n ></div>\n </div>\n </transition>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n inject,\n onBeforeUnmount,\n ref,\n toRef,\n} from 'vue'\nimport { useEventListener, isClient } from '@vueuse/core'\nimport { scrollbarContextKey } from '@element-plus/tokens'\nimport { throwError } from '@element-plus/utils/error'\nimport { useNamespace } from '@element-plus/hooks'\nimport { BAR_MAP, renderThumbStyle } from './util'\n\nimport { thumbProps } from './thumb'\n\nconst COMPONENT_NAME = 'Thumb'\nexport default defineComponent({\n name: COMPONENT_NAME,\n props: thumbProps,\n\n setup(props) {\n const scrollbar = inject(scrollbarContextKey)\n const ns = useNamespace('scrollbar')\n\n if (!scrollbar)\n throwError(COMPONENT_NAME, 'can not inject scrollbar context')\n\n const instance = ref<HTMLDivElement>()\n const thumb = ref<HTMLDivElement>()\n\n const thumbState = ref({})\n const visible = ref(false)\n\n let cursorDown = false\n let cursorLeave = false\n let originalOnSelectStart:\n | ((this: GlobalEventHandlers, ev: Event) => any)\n | null = isClient ? document.onselectstart : null\n\n const bar = computed(\n () => BAR_MAP[props.vertical ? 'vertical' : 'horizontal']\n )\n\n const thumbStyle = computed(() =>\n renderThumbStyle({\n size: props.size,\n move: props.move,\n bar: bar.value,\n })\n )\n\n const offsetRatio = computed(\n () =>\n // offsetRatioX = original width of thumb / current width of thumb / ratioX\n // offsetRatioY = original height of thumb / current height of thumb / ratioY\n // instance height = wrap height - GAP\n instance.value![bar.value.offset] ** 2 /\n scrollbar.wrapElement![bar.value.scrollSize] /\n props.ratio /\n thumb.value![bar.value.offset]\n )\n\n const clickThumbHandler = (e: MouseEvent) => {\n // prevent click event of middle and right button\n e.stopPropagation()\n if (e.ctrlKey || [1, 2].includes(e.button)) return\n\n window.getSelection()?.removeAllRanges()\n startDrag(e)\n\n const el = e.currentTarget as HTMLDivElement\n if (!el) return\n thumbState.value[bar.value.axis] =\n el[bar.value.offset] -\n (e[bar.value.client] - el.getBoundingClientRect()[bar.value.direction])\n }\n\n const clickTrackHandler = (e: MouseEvent) => {\n if (!thumb.value || !instance.value || !scrollbar.wrapElement) return\n\n const offset = Math.abs(\n (e.target as HTMLElement).getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]\n )\n const thumbHalf = thumb.value[bar.value.offset] / 2\n const thumbPositionPercentage =\n ((offset - thumbHalf) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage *\n scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n }\n\n const startDrag = (e: MouseEvent) => {\n e.stopImmediatePropagation()\n cursorDown = true\n document.addEventListener('mousemove', mouseMoveDocumentHandler)\n document.addEventListener('mouseup', mouseUpDocumentHandler)\n originalOnSelectStart = document.onselectstart\n document.onselectstart = () => false\n }\n\n const mouseMoveDocumentHandler = (e: MouseEvent) => {\n if (!instance.value || !thumb.value) return\n if (cursorDown === false) return\n\n const prevPage = thumbState.value[bar.value.axis]\n if (!prevPage) return\n\n const offset =\n (instance.value.getBoundingClientRect()[bar.value.direction] -\n e[bar.value.client]) *\n -1\n const thumbClickPosition = thumb.value[bar.value.offset] - prevPage\n const thumbPositionPercentage =\n ((offset - thumbClickPosition) * 100 * offsetRatio.value) /\n instance.value[bar.value.offset]\n scrollbar.wrapElement[bar.value.scroll] =\n (thumbPositionPercentage *\n scrollbar.wrapElement[bar.value.scrollSize]) /\n 100\n }\n\n const mouseUpDocumentHandler = () => {\n cursorDown = false\n thumbState.value[bar.value.axis] = 0\n document.removeEventListener('mousemove', mouseMoveDocumentHandler)\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n restoreOnselectstart()\n if (cursorLeave) visible.value = false\n }\n\n const mouseMoveScrollbarHandler = () => {\n cursorLeave = false\n visible.value = !!props.size\n }\n\n const mouseLeaveScrollbarHandler = () => {\n cursorLeave = true\n visible.value = cursorDown\n }\n\n onBeforeUnmount(() => {\n restoreOnselectstart()\n document.removeEventListener('mouseup', mouseUpDocumentHandler)\n })\n\n const restoreOnselectstart = () => {\n if (document.onselectstart !== originalOnSelectStart)\n document.onselectstart = originalOnSelectStart\n }\n\n useEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mousemove',\n mouseMoveScrollbarHandler\n )\n useEventListener(\n toRef(scrollbar, 'scrollbarElement'),\n 'mouseleave',\n mouseLeaveScrollbarHandler\n )\n\n return {\n ns,\n instance,\n thumb,\n bar,\n thumbStyle,\n visible,\n clickTrackHandler,\n clickThumbHandler,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;AAmCA,MAAM,iBAAiB;AACvB,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,OAAO;AAAA,EAEP,MAAM,OAAO;AACX,UAAM,YAAY,OAAO;AACzB,UAAM,KAAK,aAAa;AAExB,QAAI,CAAC;AACH,iBAAW,gBAAgB;AAE7B,UAAM,WAAW;AACjB,UAAM,QAAQ;AAEd,UAAM,aAAa,IAAI;AACvB,UAAM,UAAU,IAAI;AAEpB,QAAI,aAAa;AACjB,QAAI,cAAc;AAClB,QAAI,wBAEO,WAAW,SAAS,gBAAgB;AAE/C,UAAM,MAAM,SACV,MAAM,QAAQ,MAAM,WAAW,aAAa;AAG9C,UAAM,aAAa,SAAS,MAC1B,iBAAiB;AAAA,MACf,MAAM,MAAM;AAAA,MACZ,MAAM,MAAM;AAAA,MACZ,KAAK,IAAI;AAAA;AAIb,UAAM,cAAc,SAClB,MAIE,SAAS,MAAO,IAAI,MAAM,WAAW,IACrC,UAAU,YAAa,IAAI,MAAM,cACjC,MAAM,QACN,MAAM,MAAO,IAAI,MAAM;AAG3B,UAAM,oBAAoB,CAAC,MAAkB;AAE3C;AACA,uBAAiB;AAA2B;AAE5C;AACA;AAEA,iBAAW,EAAE;AACb;AAAS;AACT;AAE8D;AAGhE;AACE,UAAI,iBAAiB;AAA0C;AAE/D;AAIA,YAAM,kBAAkB;AACxB,YAAM;AAIN,sCAAgC,UAC7B,oCACW,YAAY,UAAU,cAClC;AAAA;AAGJ;AACE;AACA;AACA;AACA,eAAS,iBAAiB,WAAW;AACrC;AACA;AAA+B;AAGjC;AACE,UAAI;AAAiC;AACrC;AAA0B;AAE1B;AACA;AAAe;AAEf;AAIA,YAAM,qDAAqD;AAC3D,YAAM,0BACF,UAAS;AAEb,sCAAgC,UAC7B,gDACuB,wBACxB;AAAA;AAGJ;AACE;AACA;AACA;AACA,eAAS,oBAAoB,WAAW;AACxC;AACA;AAAiB;AAAgB;AAGnC;AACE;AACA;AAAwB;AAG1B;AACE;AACA;AAAgB;AAGlB;AACE;AACA;AAAwC;AAG1C;AACE,UAAI;AACF;AAAyB;AAG7B;AAKA,qBACE,MAAM,WAAW,qBACjB;AAIF;AAAO;AACL,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;SAhMe;AAAI;;;AACrB,qBAEM;AAAU;AACR,QACL;AAAW;;AAEZ;AACa;AACL,UACL;AAAO,UACP,sBAAS;AAAA;;;AATM;;;;;;;;;;;"}
|
|
@@ -5,6 +5,17 @@ export declare const ElSkeleton: import("../../utils/types").SFCWithInstall<impo
|
|
|
5
5
|
readonly loading: import("../../utils/props").BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
6
6
|
readonly throttle: import("../../utils/props").BuildPropReturn<NumberConstructor, unknown, unknown, unknown, unknown>;
|
|
7
7
|
}, {
|
|
8
|
+
ns: {
|
|
9
|
+
namespace: import("vue").ComputedRef<string>;
|
|
10
|
+
b: (blockSuffix?: string) => string;
|
|
11
|
+
e: (element?: string | undefined) => string;
|
|
12
|
+
m: (modifier?: string | undefined) => string;
|
|
13
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
14
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
15
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
16
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
17
|
+
is: (name: string, state?: boolean) => string;
|
|
18
|
+
};
|
|
8
19
|
uiLoading: import("vue").Ref<boolean>;
|
|
9
20
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
21
|
readonly animated: import("../../utils/props").BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
@@ -21,7 +32,19 @@ export declare const ElSkeleton: import("../../utils/types").SFCWithInstall<impo
|
|
|
21
32
|
}>> & {
|
|
22
33
|
SkeletonItem: import("vue").DefineComponent<{
|
|
23
34
|
readonly variant: import("../../utils/props").BuildPropReturn<StringConstructor, "text", unknown, "text" | "button" | "circle" | "caption" | "h1" | "h3" | "p" | "image" | "rect", unknown>;
|
|
24
|
-
},
|
|
35
|
+
}, {
|
|
36
|
+
ns: {
|
|
37
|
+
namespace: import("vue").ComputedRef<string>;
|
|
38
|
+
b: (blockSuffix?: string) => string;
|
|
39
|
+
e: (element?: string | undefined) => string;
|
|
40
|
+
m: (modifier?: string | undefined) => string;
|
|
41
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
42
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
43
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
44
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
45
|
+
is: (name: string, state?: boolean) => string;
|
|
46
|
+
};
|
|
47
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
25
48
|
readonly variant: import("../../utils/props").BuildPropReturn<StringConstructor, "text", unknown, "text" | "button" | "circle" | "caption" | "h1" | "h3" | "p" | "image" | "rect", unknown>;
|
|
26
49
|
}>>, {
|
|
27
50
|
variant: import("../../utils/props").BuildPropType<StringConstructor, "text" | "button" | "circle" | "caption" | "h1" | "h3" | "p" | "image" | "rect", unknown>;
|
|
@@ -30,7 +53,19 @@ export declare const ElSkeleton: import("../../utils/types").SFCWithInstall<impo
|
|
|
30
53
|
export default ElSkeleton;
|
|
31
54
|
export declare const ElSkeletonItem: import("../../utils/types").SFCWithInstall<import("vue").DefineComponent<{
|
|
32
55
|
readonly variant: import("../../utils/props").BuildPropReturn<StringConstructor, "text", unknown, "text" | "button" | "circle" | "caption" | "h1" | "h3" | "p" | "image" | "rect", unknown>;
|
|
33
|
-
},
|
|
56
|
+
}, {
|
|
57
|
+
ns: {
|
|
58
|
+
namespace: import("vue").ComputedRef<string>;
|
|
59
|
+
b: (blockSuffix?: string) => string;
|
|
60
|
+
e: (element?: string | undefined) => string;
|
|
61
|
+
m: (modifier?: string | undefined) => string;
|
|
62
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
63
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
64
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
65
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
66
|
+
is: (name: string, state?: boolean) => string;
|
|
67
|
+
};
|
|
68
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
34
69
|
readonly variant: import("../../utils/props").BuildPropReturn<StringConstructor, "text", unknown, "text" | "button" | "circle" | "caption" | "h1" | "h3" | "p" | "image" | "rect", unknown>;
|
|
35
70
|
}>>, {
|
|
36
71
|
variant: import("../../utils/props").BuildPropType<StringConstructor, "text" | "button" | "circle" | "caption" | "h1" | "h3" | "p" | "image" | "rect", unknown>;
|
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
declare const _default: import("vue").DefineComponent<{
|
|
2
2
|
readonly variant: import("../../../utils/props").BuildPropReturn<StringConstructor, "text", unknown, "text" | "button" | "circle" | "caption" | "h1" | "h3" | "p" | "image" | "rect", unknown>;
|
|
3
|
-
},
|
|
3
|
+
}, {
|
|
4
|
+
ns: {
|
|
5
|
+
namespace: import("vue").ComputedRef<string>;
|
|
6
|
+
b: (blockSuffix?: string) => string;
|
|
7
|
+
e: (element?: string | undefined) => string;
|
|
8
|
+
m: (modifier?: string | undefined) => string;
|
|
9
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
10
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
11
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
12
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
13
|
+
is: (name: string, state?: boolean) => string;
|
|
14
|
+
};
|
|
15
|
+
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
4
16
|
readonly variant: import("../../../utils/props").BuildPropReturn<StringConstructor, "text", unknown, "text" | "button" | "circle" | "caption" | "h1" | "h3" | "p" | "image" | "rect", unknown>;
|
|
5
17
|
}>>, {
|
|
6
18
|
variant: import("../../../utils/props").BuildPropType<StringConstructor, "text" | "button" | "circle" | "caption" | "h1" | "h3" | "p" | "image" | "rect", unknown>;
|
|
@@ -1,19 +1,27 @@
|
|
|
1
1
|
import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, createBlock, createCommentVNode } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
2
3
|
import ImgPlaceholder from './image-placeholder.mjs';
|
|
3
4
|
import { skeletonItemProps } from './skeleton-item.mjs';
|
|
4
5
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
5
7
|
|
|
6
8
|
const _sfc_main = defineComponent({
|
|
7
9
|
name: "ElSkeletonItem",
|
|
8
10
|
components: {
|
|
9
11
|
ImgPlaceholder
|
|
10
12
|
},
|
|
11
|
-
props: skeletonItemProps
|
|
13
|
+
props: skeletonItemProps,
|
|
14
|
+
setup() {
|
|
15
|
+
const ns = useNamespace("skeleton");
|
|
16
|
+
return {
|
|
17
|
+
ns
|
|
18
|
+
};
|
|
19
|
+
}
|
|
12
20
|
});
|
|
13
21
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
22
|
const _component_img_placeholder = resolveComponent("img-placeholder");
|
|
15
23
|
return openBlock(), createElementBlock("div", {
|
|
16
|
-
class: normalizeClass(["
|
|
24
|
+
class: normalizeClass([_ctx.ns.e("item"), _ctx.ns.e(_ctx.variant)])
|
|
17
25
|
}, [
|
|
18
26
|
_ctx.variant === "image" ? (openBlock(), createBlock(_component_img_placeholder, { key: 0 })) : createCommentVNode("v-if", true)
|
|
19
27
|
], 2);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton-item2.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton-item.vue"],"sourcesContent":["<template>\n <div :class=\"['
|
|
1
|
+
{"version":3,"file":"skeleton-item2.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton-item.vue"],"sourcesContent":["<template>\n <div :class=\"[ns.e('item'), ns.e(variant)]\">\n <img-placeholder v-if=\"variant === 'image'\" />\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport ImgPlaceholder from './image-placeholder.vue'\nimport { skeletonItemProps } from './skeleton-item'\n\nexport default defineComponent({\n name: 'ElSkeletonItem',\n components: {\n ImgPlaceholder,\n },\n props: skeletonItemProps,\n setup() {\n const ns = useNamespace('skeleton')\n return {\n ns,\n }\n },\n})\n</script>\n"],"names":["_openBlock"],"mappings":";;;;;;;AAYA,MAAK,YAAa,gBAAa;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,IACV;AAAA;AAAA,EAEF,OAAO;AAAA,EACP,QAAQ;AACN,UAAM,KAAK,aAAa;AACxB,WAAO;AAAA,MACL;AAAA;AAAA;AAAA;;;SApBOA,gCAAO,OAAU;AAAA;KACH;AAAA;;;;;;;"}
|
|
@@ -5,6 +5,17 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
5
5
|
readonly loading: import("../../../utils/props").BuildPropReturn<BooleanConstructor, true, unknown, unknown, unknown>;
|
|
6
6
|
readonly throttle: import("../../../utils/props").BuildPropReturn<NumberConstructor, unknown, unknown, unknown, unknown>;
|
|
7
7
|
}, {
|
|
8
|
+
ns: {
|
|
9
|
+
namespace: import("vue").ComputedRef<string>;
|
|
10
|
+
b: (blockSuffix?: string) => string;
|
|
11
|
+
e: (element?: string | undefined) => string;
|
|
12
|
+
m: (modifier?: string | undefined) => string;
|
|
13
|
+
be: (blockSuffix?: string | undefined, element?: string | undefined) => string;
|
|
14
|
+
em: (element?: string | undefined, modifier?: string | undefined) => string;
|
|
15
|
+
bm: (blockSuffix?: string | undefined, modifier?: string | undefined) => string;
|
|
16
|
+
bem: (blockSuffix?: string | undefined, element?: string | undefined, modifier?: string | undefined) => string;
|
|
17
|
+
is: (name: string, state?: boolean) => string;
|
|
18
|
+
};
|
|
8
19
|
uiLoading: import("vue").Ref<boolean>;
|
|
9
20
|
}, unknown, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, Record<string, any>, string, import("vue").VNodeProps & import("vue").AllowedComponentProps & import("vue").ComponentCustomProps, Readonly<import("vue").ExtractPropTypes<{
|
|
10
21
|
readonly animated: import("../../../utils/props").BuildPropReturn<BooleanConstructor, false, unknown, unknown, unknown>;
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, mergeProps, Fragment, renderList, renderSlot, createVNode,
|
|
1
|
+
import { defineComponent, computed, resolveComponent, openBlock, createElementBlock, mergeProps, Fragment, renderList, renderSlot, createVNode, normalizeClass, createBlock, createCommentVNode, normalizeProps } from 'vue';
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
3
|
import SkeletonItem from './skeleton-item2.mjs';
|
|
4
4
|
import { skeletonProps } from './skeleton.mjs';
|
|
5
5
|
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
6
7
|
import { useThrottleRender } from '../../../hooks/use-throttle-render/index.mjs';
|
|
7
8
|
|
|
8
9
|
const _sfc_main = defineComponent({
|
|
@@ -12,11 +13,13 @@ const _sfc_main = defineComponent({
|
|
|
12
13
|
},
|
|
13
14
|
props: skeletonProps,
|
|
14
15
|
setup(props) {
|
|
16
|
+
const ns = useNamespace("skeleton");
|
|
15
17
|
const innerLoading = computed(() => {
|
|
16
18
|
return props.loading;
|
|
17
19
|
});
|
|
18
20
|
const uiLoading = useThrottleRender(innerLoading, props.throttle);
|
|
19
21
|
return {
|
|
22
|
+
ns,
|
|
20
23
|
uiLoading
|
|
21
24
|
};
|
|
22
25
|
}
|
|
@@ -25,22 +28,22 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
25
28
|
const _component_el_skeleton_item = resolveComponent("el-skeleton-item");
|
|
26
29
|
return _ctx.uiLoading ? (openBlock(), createElementBlock("div", mergeProps({
|
|
27
30
|
key: 0,
|
|
28
|
-
class: [
|
|
31
|
+
class: [_ctx.ns.b(), _ctx.ns.is("animated", _ctx.animated)]
|
|
29
32
|
}, _ctx.$attrs), [
|
|
30
33
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.count, (i) => {
|
|
31
34
|
return openBlock(), createElementBlock(Fragment, { key: i }, [
|
|
32
35
|
_ctx.loading ? renderSlot(_ctx.$slots, "template", { key: i }, () => [
|
|
33
36
|
createVNode(_component_el_skeleton_item, {
|
|
34
|
-
class: "
|
|
37
|
+
class: normalizeClass(_ctx.ns.is("first")),
|
|
35
38
|
variant: "p"
|
|
36
|
-
}),
|
|
39
|
+
}, null, 8, ["class"]),
|
|
37
40
|
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (item) => {
|
|
38
41
|
return openBlock(), createBlock(_component_el_skeleton_item, {
|
|
39
42
|
key: item,
|
|
40
|
-
class: normalizeClass(
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
|
|
43
|
+
class: normalizeClass([
|
|
44
|
+
_ctx.ns.e("paragraph"),
|
|
45
|
+
_ctx.ns.is("last", item === _ctx.rows && _ctx.rows > 1)
|
|
46
|
+
]),
|
|
44
47
|
variant: "p"
|
|
45
48
|
}, null, 8, ["class"]);
|
|
46
49
|
}), 128))
|