@element-plus/nightly 0.0.20240506 → 0.0.20240507
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/README.md +1 -1
- package/dist/index.full.js +4 -3
- package/dist/index.full.min.js +2 -2
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +2 -2
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +4 -3
- 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-eg.js +1 -1
- package/dist/locale/ar-eg.min.js +1 -1
- package/dist/locale/ar-eg.min.mjs +1 -1
- package/dist/locale/ar-eg.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/az.js +1 -1
- package/dist/locale/az.min.js +1 -1
- package/dist/locale/az.min.mjs +1 -1
- package/dist/locale/az.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/ckb.js +1 -1
- package/dist/locale/ckb.min.js +1 -1
- package/dist/locale/ckb.min.mjs +1 -1
- package/dist/locale/ckb.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/mg.js +1 -1
- package/dist/locale/mg.min.js +1 -1
- package/dist/locale/mg.min.mjs +1 -1
- package/dist/locale/mg.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/sw.js +1 -1
- package/dist/locale/sw.min.js +1 -1
- package/dist/locale/sw.min.mjs +1 -1
- package/dist/locale/sw.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/divider/index.mjs +2 -2
- package/es/components/divider/src/divider.mjs +17 -35
- package/es/components/divider/src/divider.mjs.map +1 -1
- package/es/components/divider/src/divider2.mjs +35 -17
- package/es/components/divider/src/divider2.mjs.map +1 -1
- package/es/components/form/src/form2.mjs +2 -1
- package/es/components/form/src/form2.mjs.map +1 -1
- package/es/components/index.mjs +3 -3
- package/es/components/skeleton/index.mjs +4 -4
- 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 +22 -49
- package/es/components/skeleton/src/skeleton.mjs.map +1 -1
- package/es/components/skeleton/src/skeleton2.mjs +49 -22
- package/es/components/skeleton/src/skeleton2.mjs.map +1 -1
- package/es/components/slider/src/button.mjs +93 -21
- package/es/components/slider/src/button.mjs.map +1 -1
- package/es/components/slider/src/button2.mjs +21 -93
- package/es/components/slider/src/button2.mjs.map +1 -1
- package/es/components/slider/src/slider2.mjs +1 -1
- package/es/components/tooltip-v2/index.mjs +3 -3
- package/es/components/tooltip-v2/src/content2.mjs +1 -1
- package/es/components/tooltip-v2/src/root.mjs +80 -17
- package/es/components/tooltip-v2/src/root.mjs.map +1 -1
- package/es/components/tooltip-v2/src/root2.mjs +17 -80
- package/es/components/tooltip-v2/src/root2.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip.mjs +73 -20
- package/es/components/tooltip-v2/src/tooltip.mjs.map +1 -1
- package/es/components/tooltip-v2/src/tooltip2.mjs +20 -73
- package/es/components/tooltip-v2/src/tooltip2.mjs.map +1 -1
- package/es/components/visual-hidden/index.mjs +3 -3
- package/es/components/visual-hidden/src/visual-hidden.mjs +35 -7
- package/es/components/visual-hidden/src/visual-hidden.mjs.map +1 -1
- package/es/components/visual-hidden/src/visual-hidden2.mjs +7 -35
- package/es/components/visual-hidden/src/visual-hidden2.mjs.map +1 -1
- package/es/index.mjs +3 -3
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/divider/index.js +2 -2
- package/lib/components/divider/src/divider.js +17 -35
- package/lib/components/divider/src/divider.js.map +1 -1
- package/lib/components/divider/src/divider2.js +35 -17
- package/lib/components/divider/src/divider2.js.map +1 -1
- package/lib/components/form/src/form2.js +2 -1
- package/lib/components/form/src/form2.js.map +1 -1
- package/lib/components/index.js +3 -3
- package/lib/components/skeleton/index.js +4 -4
- 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 +22 -49
- package/lib/components/skeleton/src/skeleton.js.map +1 -1
- package/lib/components/skeleton/src/skeleton2.js +49 -22
- package/lib/components/skeleton/src/skeleton2.js.map +1 -1
- package/lib/components/slider/src/button.js +93 -22
- package/lib/components/slider/src/button.js.map +1 -1
- package/lib/components/slider/src/button2.js +22 -93
- package/lib/components/slider/src/button2.js.map +1 -1
- package/lib/components/slider/src/slider2.js +1 -1
- package/lib/components/tooltip-v2/index.js +3 -3
- package/lib/components/tooltip-v2/src/content2.js +1 -1
- package/lib/components/tooltip-v2/src/root.js +80 -17
- package/lib/components/tooltip-v2/src/root.js.map +1 -1
- package/lib/components/tooltip-v2/src/root2.js +17 -80
- package/lib/components/tooltip-v2/src/root2.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip.js +73 -20
- package/lib/components/tooltip-v2/src/tooltip.js.map +1 -1
- package/lib/components/tooltip-v2/src/tooltip2.js +20 -73
- package/lib/components/tooltip-v2/src/tooltip2.js.map +1 -1
- package/lib/components/visual-hidden/index.js +2 -2
- package/lib/components/visual-hidden/src/visual-hidden.js +35 -7
- package/lib/components/visual-hidden/src/visual-hidden.js.map +1 -1
- package/lib/components/visual-hidden/src/visual-hidden2.js +7 -35
- package/lib/components/visual-hidden/src/visual-hidden2.js.map +1 -1
- package/lib/index.js +3 -3
- 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/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.mjs","sources":["../../../../../../packages/components/divider/src/divider.
|
|
1
|
+
{"version":3,"file":"divider.mjs","sources":["../../../../../../packages/components/divider/src/divider.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-plus/utils'\nimport type { ExtractPropTypes } from 'vue'\nimport type Divider from './divider.vue'\n\nexport type BorderStyle = CSSStyleDeclaration['borderStyle']\n\nexport const dividerProps = buildProps({\n /**\n * @description Set divider's direction\n */\n direction: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'horizontal',\n },\n /**\n * @description Set the style of divider\n */\n contentPosition: {\n type: String,\n values: ['left', 'center', 'right'],\n default: 'center',\n },\n /**\n * @description the position of the customized content on the divider line\n */\n borderStyle: {\n type: definePropType<BorderStyle>(String),\n default: 'solid',\n },\n} as const)\nexport type DividerProps = ExtractPropTypes<typeof dividerProps>\n\nexport type DividerInstance = InstanceType<typeof Divider>\n"],"names":[],"mappings":";;;AACY,MAAC,YAAY,GAAG,UAAU,CAAC;AACvC,EAAE,SAAS,EAAE;AACb,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,YAAY,EAAE,UAAU,CAAC;AACtC,IAAI,OAAO,EAAE,YAAY;AACzB,GAAG;AACH,EAAE,eAAe,EAAE;AACnB,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE,CAAC,MAAM,EAAE,QAAQ,EAAE,OAAO,CAAC;AACvC,IAAI,OAAO,EAAE,QAAQ;AACrB,GAAG;AACH,EAAE,WAAW,EAAE;AACf,IAAI,IAAI,EAAE,cAAc,CAAC,MAAM,CAAC;AAChC,IAAI,OAAO,EAAE,OAAO;AACpB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,22 +1,40 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, renderSlot, createCommentVNode } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import { dividerProps } from './divider.mjs';
|
|
4
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
5
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
3
6
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
7
|
+
const __default__ = defineComponent({
|
|
8
|
+
name: "ElDivider"
|
|
9
|
+
});
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
...__default__,
|
|
12
|
+
props: dividerProps,
|
|
13
|
+
setup(__props) {
|
|
14
|
+
const props = __props;
|
|
15
|
+
const ns = useNamespace("divider");
|
|
16
|
+
const dividerStyle = computed(() => {
|
|
17
|
+
return ns.cssVar({
|
|
18
|
+
"border-style": props.borderStyle
|
|
19
|
+
});
|
|
20
|
+
});
|
|
21
|
+
return (_ctx, _cache) => {
|
|
22
|
+
return openBlock(), createElementBlock("div", {
|
|
23
|
+
class: normalizeClass([unref(ns).b(), unref(ns).m(_ctx.direction)]),
|
|
24
|
+
style: normalizeStyle(unref(dividerStyle)),
|
|
25
|
+
role: "separator"
|
|
26
|
+
}, [
|
|
27
|
+
_ctx.$slots.default && _ctx.direction !== "vertical" ? (openBlock(), createElementBlock("div", {
|
|
28
|
+
key: 0,
|
|
29
|
+
class: normalizeClass([unref(ns).e("text"), unref(ns).is(_ctx.contentPosition)])
|
|
30
|
+
}, [
|
|
31
|
+
renderSlot(_ctx.$slots, "default")
|
|
32
|
+
], 2)) : createCommentVNode("v-if", true)
|
|
33
|
+
], 6);
|
|
34
|
+
};
|
|
18
35
|
}
|
|
19
36
|
});
|
|
37
|
+
var Divider = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "divider.vue"]]);
|
|
20
38
|
|
|
21
|
-
export {
|
|
39
|
+
export { Divider as default };
|
|
22
40
|
//# sourceMappingURL=divider2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider2.mjs","sources":["../../../../../../packages/components/divider/src/divider.
|
|
1
|
+
{"version":3,"file":"divider2.mjs","sources":["../../../../../../packages/components/divider/src/divider.vue"],"sourcesContent":["<template>\n <div\n :class=\"[ns.b(), ns.m(direction)]\"\n :style=\"dividerStyle\"\n role=\"separator\"\n >\n <div\n v-if=\"$slots.default && direction !== 'vertical'\"\n :class=\"[ns.e('text'), ns.is(contentPosition)]\"\n >\n <slot />\n </div>\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed } from 'vue'\nimport { useNamespace } from '@element-plus/hooks'\nimport { dividerProps } from './divider'\nimport type { CSSProperties } from 'vue'\n\ndefineOptions({\n name: 'ElDivider',\n})\nconst props = defineProps(dividerProps)\nconst ns = useNamespace('divider')\nconst dividerStyle = computed(() => {\n return ns.cssVar({\n 'border-style': props.borderStyle,\n }) as CSSProperties\n})\n</script>\n"],"names":[],"mappings":";;;;;;mCAqBc,CAAA;AAAA,EACZ,IAAM,EAAA,WAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAEA,IAAM,MAAA,EAAA,GAAK,aAAa,SAAS,CAAA,CAAA;AACjC,IAAM,MAAA,YAAA,GAAe,SAAS,MAAM;AAClC,MAAA,OAAO,GAAG,MAAO,CAAA;AAAA,QACf,gBAAgB,KAAM,CAAA,WAAA;AAAA,OACvB,CAAA,CAAA;AAAA,KACF,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form2.mjs","sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <form :class=\"formClasses\">\n <slot />\n </form>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, reactive, toRefs, watch } from 'vue'\nimport { debugWarn, isFunction } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport { formContextKey } from './constants'\nimport { formEmits, formProps } from './form'\nimport { filterFields, useFormLabelWidth } from './utils'\n\nimport type { ValidateFieldsError } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type {\n FormContext,\n FormItemContext,\n FormValidateCallback,\n FormValidationResult,\n} from './types'\nimport type { FormItemProp } from './form-item'\n\nconst COMPONENT_NAME = 'ElForm'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = defineProps(formProps)\nconst emit = defineEmits(formEmits)\n\nconst fields: FormItemContext[] = []\n\nconst formSize = useFormSize()\nconst ns = useNamespace('form')\nconst formClasses = computed(() => {\n const { labelPosition, inline } = props\n return [\n ns.b(),\n // todo: in v2.2.0, we can remove default\n // in fact, remove it doesn't affect the final style\n ns.m(formSize.value || 'default'),\n {\n [ns.m(`label-${labelPosition}`)]: labelPosition,\n [ns.m('inline')]: inline,\n },\n ]\n})\n\nconst getField: FormContext['getField'] = (prop) => {\n return fields.find((field) => field.prop === prop)\n}\n\nconst addField: FormContext['addField'] = (field) => {\n fields.push(field)\n}\n\nconst removeField: FormContext['removeField'] = (field) => {\n if (field.prop) {\n fields.splice(fields.indexOf(field), 1)\n }\n}\n\nconst resetFields: FormContext['resetFields'] = (properties = []) => {\n if (!props.model) {\n debugWarn(COMPONENT_NAME, 'model is required for resetFields to work.')\n return\n }\n filterFields(fields, properties).forEach((field) => field.resetField())\n}\n\nconst clearValidate: FormContext['clearValidate'] = (props = []) => {\n filterFields(fields, props).forEach((field) => field.clearValidate())\n}\n\nconst isValidatable = computed(() => {\n const hasModel = !!props.model\n if (!hasModel) {\n debugWarn(COMPONENT_NAME, 'model is required for validate to work.')\n }\n return hasModel\n})\n\nconst obtainValidateFields = (props: Arrayable<FormItemProp>) => {\n if (fields.length === 0) return []\n\n const filteredFields = filterFields(fields, props)\n if (!filteredFields.length) {\n debugWarn(COMPONENT_NAME, 'please pass correct props!')\n return []\n }\n return filteredFields\n}\n\nconst validate = async (\n callback?: FormValidateCallback\n): FormValidationResult => validateField(undefined, callback)\n\nconst doValidateField = async (\n props: Arrayable<FormItemProp> = []\n): Promise<boolean> => {\n if (!isValidatable.value) return false\n\n const fields = obtainValidateFields(props)\n if (fields.length === 0) return true\n\n let validationErrors: ValidateFieldsError = {}\n for (const field of fields) {\n try {\n await field.validate('')\n } catch (fields) {\n validationErrors = {\n ...validationErrors,\n ...(fields as ValidateFieldsError),\n }\n }\n }\n\n if (Object.keys(validationErrors).length === 0) return true\n return Promise.reject(validationErrors)\n}\n\nconst validateField: FormContext['validateField'] = async (\n modelProps = [],\n callback\n) => {\n const shouldThrow = !isFunction(callback)\n try {\n const result = await doValidateField(modelProps)\n // When result is false meaning that the fields are not validatable\n if (result === true) {\n await callback?.(result)\n }\n return result\n } catch (e) {\n if (e instanceof Error) throw e\n\n const invalidFields = e as ValidateFieldsError\n\n if (props.scrollToError) {\n scrollToField(Object.keys(invalidFields)[0])\n }\n await callback?.(false, invalidFields)\n return shouldThrow && Promise.reject(invalidFields)\n }\n}\n\nconst scrollToField = (prop: FormItemProp) => {\n const field = filterFields(fields, prop)[0]\n if (field) {\n field.$el?.scrollIntoView(props.scrollIntoViewOptions)\n }\n}\n\nwatch(\n () => props.rules,\n () => {\n if (props.validateOnRuleChange) {\n validate().catch((err) => debugWarn(err))\n }\n },\n { deep: true }\n)\n\nprovide(\n formContextKey,\n reactive({\n ...toRefs(props),\n emit,\n\n resetFields,\n clearValidate,\n validateField,\n getField,\n addField,\n removeField,\n\n ...useFormLabelWidth(),\n })\n)\n\ndefineExpose({\n /**\n * @description Validate the whole form. Receives a callback or returns `Promise`.\n */\n validate,\n /**\n * @description Validate specified fields.\n */\n validateField,\n /**\n * @description Reset specified fields and remove validation result.\n */\n resetFields,\n /**\n * @description Clear validation message for specified fields.\n */\n clearValidate,\n /**\n * @description Scroll to the specified fields.\n */\n scrollToField,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;mCA0Bc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAIA,IAAA,MAAM,SAA4B,EAAC,CAAA;AAEnC,IAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,IAAM,MAAA,EAAA,GAAK,aAAa,MAAM,CAAA,CAAA;AAC9B,IAAM,MAAA,WAAA,GAAc,SAAS,MAAM;AACjC,MAAM,MAAA,EAAE,eAAe,MAAW,EAAA,GAAA,KAAA,CAAA;AAClC,MAAO,OAAA;AAAA,QACL,GAAG,CAAE,EAAA;AAAA,QAGL,EAAG,CAAA,CAAA,CAAE,QAAS,CAAA,KAAA,IAAS,SAAS,CAAA;AAAA,QAChC;AAAA,UACE,CAAC,EAAA,CAAG,CAAE,CAAA,CAAA,MAAA,EAAS,eAAe,CAAI,GAAA,aAAA;AAAA,UAClC,CAAC,EAAA,CAAG,CAAE,CAAA,QAAQ,CAAI,GAAA,MAAA;AAAA,SACpB;AAAA,OACF,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,QAAA,GAAoC,CAAC,IAAS,KAAA;AAClD,MAAA,OAAO,OAAO,IAAK,CAAA,CAAC,KAAU,KAAA,KAAA,CAAM,SAAS,IAAI,CAAA,CAAA;AAAA,KACnD,CAAA;AAEA,IAAM,MAAA,QAAA,GAAoC,CAAC,KAAU,KAAA;AACnD,MAAA,MAAA,CAAO,KAAK,KAAK,CAAA,CAAA;AAAA,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AA,CAAA;AAAA,MACf,GAAA,MAAA,CAAA,KAAA,CAAA;AAAA,MAEA,IAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MAEA,WAAqB;AAAA,MAEzB,GAAA,iBAAA,EAAA;AAEA,KAAa,CAAA,CAAA,CAAA;AAAA,IAIX,MAAA,CAAA;AAAA,MAIA,QAAA;AAAA,MAIA,aAAA;AAAA,MAIA,WAAA;AAAA,MAIA,aAAA;AAAA,MACD,
|
|
1
|
+
{"version":3,"file":"form2.mjs","sources":["../../../../../../packages/components/form/src/form.vue"],"sourcesContent":["<template>\n <form :class=\"formClasses\">\n <slot />\n </form>\n</template>\n\n<script lang=\"ts\" setup>\nimport { computed, provide, reactive, toRefs, watch } from 'vue'\nimport { debugWarn, isFunction } from '@element-plus/utils'\nimport { useNamespace } from '@element-plus/hooks'\nimport { useFormSize } from './hooks'\nimport { formContextKey } from './constants'\nimport { formEmits, formProps } from './form'\nimport { filterFields, useFormLabelWidth } from './utils'\n\nimport type { ValidateFieldsError } from 'async-validator'\nimport type { Arrayable } from '@element-plus/utils'\nimport type {\n FormContext,\n FormItemContext,\n FormValidateCallback,\n FormValidationResult,\n} from './types'\nimport type { FormItemProp } from './form-item'\n\nconst COMPONENT_NAME = 'ElForm'\ndefineOptions({\n name: COMPONENT_NAME,\n})\nconst props = defineProps(formProps)\nconst emit = defineEmits(formEmits)\n\nconst fields: FormItemContext[] = []\n\nconst formSize = useFormSize()\nconst ns = useNamespace('form')\nconst formClasses = computed(() => {\n const { labelPosition, inline } = props\n return [\n ns.b(),\n // todo: in v2.2.0, we can remove default\n // in fact, remove it doesn't affect the final style\n ns.m(formSize.value || 'default'),\n {\n [ns.m(`label-${labelPosition}`)]: labelPosition,\n [ns.m('inline')]: inline,\n },\n ]\n})\n\nconst getField: FormContext['getField'] = (prop) => {\n return fields.find((field) => field.prop === prop)\n}\n\nconst addField: FormContext['addField'] = (field) => {\n fields.push(field)\n}\n\nconst removeField: FormContext['removeField'] = (field) => {\n if (field.prop) {\n fields.splice(fields.indexOf(field), 1)\n }\n}\n\nconst resetFields: FormContext['resetFields'] = (properties = []) => {\n if (!props.model) {\n debugWarn(COMPONENT_NAME, 'model is required for resetFields to work.')\n return\n }\n filterFields(fields, properties).forEach((field) => field.resetField())\n}\n\nconst clearValidate: FormContext['clearValidate'] = (props = []) => {\n filterFields(fields, props).forEach((field) => field.clearValidate())\n}\n\nconst isValidatable = computed(() => {\n const hasModel = !!props.model\n if (!hasModel) {\n debugWarn(COMPONENT_NAME, 'model is required for validate to work.')\n }\n return hasModel\n})\n\nconst obtainValidateFields = (props: Arrayable<FormItemProp>) => {\n if (fields.length === 0) return []\n\n const filteredFields = filterFields(fields, props)\n if (!filteredFields.length) {\n debugWarn(COMPONENT_NAME, 'please pass correct props!')\n return []\n }\n return filteredFields\n}\n\nconst validate = async (\n callback?: FormValidateCallback\n): FormValidationResult => validateField(undefined, callback)\n\nconst doValidateField = async (\n props: Arrayable<FormItemProp> = []\n): Promise<boolean> => {\n if (!isValidatable.value) return false\n\n const fields = obtainValidateFields(props)\n if (fields.length === 0) return true\n\n let validationErrors: ValidateFieldsError = {}\n for (const field of fields) {\n try {\n await field.validate('')\n } catch (fields) {\n validationErrors = {\n ...validationErrors,\n ...(fields as ValidateFieldsError),\n }\n }\n }\n\n if (Object.keys(validationErrors).length === 0) return true\n return Promise.reject(validationErrors)\n}\n\nconst validateField: FormContext['validateField'] = async (\n modelProps = [],\n callback\n) => {\n const shouldThrow = !isFunction(callback)\n try {\n const result = await doValidateField(modelProps)\n // When result is false meaning that the fields are not validatable\n if (result === true) {\n await callback?.(result)\n }\n return result\n } catch (e) {\n if (e instanceof Error) throw e\n\n const invalidFields = e as ValidateFieldsError\n\n if (props.scrollToError) {\n scrollToField(Object.keys(invalidFields)[0])\n }\n await callback?.(false, invalidFields)\n return shouldThrow && Promise.reject(invalidFields)\n }\n}\n\nconst scrollToField = (prop: FormItemProp) => {\n const field = filterFields(fields, prop)[0]\n if (field) {\n field.$el?.scrollIntoView(props.scrollIntoViewOptions)\n }\n}\n\nwatch(\n () => props.rules,\n () => {\n if (props.validateOnRuleChange) {\n validate().catch((err) => debugWarn(err))\n }\n },\n { deep: true }\n)\n\nprovide(\n formContextKey,\n reactive({\n ...toRefs(props),\n emit,\n\n resetFields,\n clearValidate,\n validateField,\n getField,\n addField,\n removeField,\n\n ...useFormLabelWidth(),\n })\n)\n\ndefineExpose({\n /**\n * @description Validate the whole form. Receives a callback or returns `Promise`.\n */\n validate,\n /**\n * @description Validate specified fields.\n */\n validateField,\n /**\n * @description Reset specified fields and remove validation result.\n */\n resetFields,\n /**\n * @description Clear validation message for specified fields.\n */\n clearValidate,\n /**\n * @description Scroll to the specified fields.\n */\n scrollToField,\n /**\n * @description All fields context.\n */\n fields,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;;;;;;;mCA0Bc,CAAA;AAAA,EACZ,IAAM,EAAA,cAAA;AACR;;;;;;;AAIA,IAAA,MAAM,SAA4B,EAAC,CAAA;AAEnC,IAAA,MAAM,WAAW,WAAY,EAAA,CAAA;AAC7B,IAAM,MAAA,EAAA,GAAK,aAAa,MAAM,CAAA,CAAA;AAC9B,IAAM,MAAA,WAAA,GAAc,SAAS,MAAM;AACjC,MAAM,MAAA,EAAE,eAAe,MAAW,EAAA,GAAA,KAAA,CAAA;AAClC,MAAO,OAAA;AAAA,QACL,GAAG,CAAE,EAAA;AAAA,QAGL,EAAG,CAAA,CAAA,CAAE,QAAS,CAAA,KAAA,IAAS,SAAS,CAAA;AAAA,QAChC;AAAA,UACE,CAAC,EAAA,CAAG,CAAE,CAAA,CAAA,MAAA,EAAS,eAAe,CAAI,GAAA,aAAA;AAAA,UAClC,CAAC,EAAA,CAAG,CAAE,CAAA,QAAQ,CAAI,GAAA,MAAA;AAAA,SACpB;AAAA,OACF,CAAA;AAAA,KACD,CAAA,CAAA;AAED,IAAM,MAAA,QA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AM,KAAsB,CAAA,KAAA,EAAA,MAAA;AAC9B,MAAA,IAAA,KAAA,CAAA,oBAA0B,EAAA;AAAc,QAC1C,QAAA,EAAA,CAAA,KAAA,CAAA,CAAA,GAAA,KAAA,SAAA,CAAA,GAAA,CAAA,CAAA,CAAA;AAAA,OAEF;AAGF,KAAA,EAAA,EAAA;AAEW,IACP,sBAAe,EAAA,QAAA,CAAA;AAAA,MACf,GAAA,MAAA,CAAA,KAAA,CAAA;AAAA,MAEA,IAAA;AAAA,MACA,WAAA;AAAA,MACA,aAAA;AAAA,MACA,aAAA;AAAA,MACA,QAAA;AAAA,MACA,QAAA;AAAA,MAEA,WAAqB;AAAA,MAEzB,GAAA,iBAAA,EAAA;AAEA,KAAa,CAAA,CAAA,CAAA;AAAA,IAIX,MAAA,CAAA;AAAA,MAIA,QAAA;AAAA,MAIA,aAAA;AAAA,MAIA,WAAA;AAAA,MAIA,aAAA;AAAA,MAIA,aAAA;AAAA,MACD,MAAA;;;;;;;;;;;;;;;"}
|
package/es/components/index.mjs
CHANGED
|
@@ -119,7 +119,7 @@ export { descriptionItemProps } from './descriptions/src/description-item.mjs';
|
|
|
119
119
|
export { useDialog } from './dialog/src/use-dialog.mjs';
|
|
120
120
|
export { dialogEmits, dialogProps } from './dialog/src/dialog.mjs';
|
|
121
121
|
export { dialogInjectionKey } from './dialog/src/constants.mjs';
|
|
122
|
-
export { dividerProps } from './divider/src/
|
|
122
|
+
export { dividerProps } from './divider/src/divider.mjs';
|
|
123
123
|
export { drawerEmits, drawerProps } from './drawer/src/drawer.mjs';
|
|
124
124
|
export { DROPDOWN_COLLECTION_INJECTION_KEY, DROPDOWN_COLLECTION_ITEM_INJECTION_KEY, ElCollection, ElCollectionItem, FIRST_KEYS, FIRST_LAST_KEYS, LAST_KEYS, dropdownItemProps, dropdownMenuProps, dropdownProps } from './dropdown/src/dropdown.mjs';
|
|
125
125
|
export { DROPDOWN_INJECTION_KEY } from './dropdown/src/tokens.mjs';
|
|
@@ -167,8 +167,8 @@ export { thumbProps } from './scrollbar/src/thumb.mjs';
|
|
|
167
167
|
export { scrollbarContextKey } from './scrollbar/src/constants.mjs';
|
|
168
168
|
export { selectGroupKey, selectKey } from './select/src/token.mjs';
|
|
169
169
|
export { selectV2InjectionKey } from './select-v2/src/token.mjs';
|
|
170
|
-
export { skeletonProps } from './skeleton/src/
|
|
171
|
-
export { skeletonItemProps } from './skeleton/src/skeleton-
|
|
170
|
+
export { skeletonProps } from './skeleton/src/skeleton.mjs';
|
|
171
|
+
export { skeletonItemProps } from './skeleton/src/skeleton-item.mjs';
|
|
172
172
|
export { sliderEmits, sliderProps } from './slider/src/slider.mjs';
|
|
173
173
|
export { sliderContextKey } from './slider/src/constants.mjs';
|
|
174
174
|
export { spaceProps } from './space/src/space.mjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import '../../utils/index.mjs';
|
|
2
|
-
import Skeleton from './src/
|
|
3
|
-
import SkeletonItem from './src/skeleton-
|
|
4
|
-
export { skeletonProps } from './src/
|
|
5
|
-
export { skeletonItemProps } from './src/skeleton-
|
|
2
|
+
import Skeleton from './src/skeleton2.mjs';
|
|
3
|
+
import SkeletonItem from './src/skeleton-item2.mjs';
|
|
4
|
+
export { skeletonProps } from './src/skeleton.mjs';
|
|
5
|
+
export { skeletonItemProps } from './src/skeleton-item.mjs';
|
|
6
6
|
import { withInstall, withNoopInstall } from '../../utils/vue/install.mjs';
|
|
7
7
|
|
|
8
8
|
const ElSkeleton = withInstall(Skeleton, {
|
|
@@ -1,28 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../
|
|
3
|
-
import { PictureFilled } from '@element-plus/icons-vue';
|
|
4
|
-
import { skeletonItemProps } from './skeleton-item2.mjs';
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
7
3
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
4
|
+
const skeletonItemProps = buildProps({
|
|
5
|
+
variant: {
|
|
6
|
+
type: String,
|
|
7
|
+
values: [
|
|
8
|
+
"circle",
|
|
9
|
+
"rect",
|
|
10
|
+
"h1",
|
|
11
|
+
"h3",
|
|
12
|
+
"text",
|
|
13
|
+
"caption",
|
|
14
|
+
"p",
|
|
15
|
+
"image",
|
|
16
|
+
"button"
|
|
17
|
+
],
|
|
18
|
+
default: "text"
|
|
23
19
|
}
|
|
24
20
|
});
|
|
25
|
-
var SkeletonItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "skeleton-item.vue"]]);
|
|
26
21
|
|
|
27
|
-
export {
|
|
22
|
+
export { skeletonItemProps };
|
|
28
23
|
//# sourceMappingURL=skeleton-item.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton-item.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton-item.
|
|
1
|
+
{"version":3,"file":"skeleton-item.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton-item.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type SkeletonItem from './skeleton-item.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const skeletonItemProps = buildProps({\n /**\n * @description the current rendering skeleton type\n */\n variant: {\n type: String,\n values: [\n 'circle',\n 'rect',\n 'h1',\n 'h3',\n 'text',\n 'caption',\n 'p',\n 'image',\n 'button',\n ],\n default: 'text',\n },\n} as const)\nexport type SkeletonItemProps = ExtractPropTypes<typeof skeletonItemProps>\n\nexport type SkeletonItemInstance = InstanceType<typeof SkeletonItem>\n"],"names":[],"mappings":";;;AACY,MAAC,iBAAiB,GAAG,UAAU,CAAC;AAC5C,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,MAAM,EAAE;AACZ,MAAM,QAAQ;AACd,MAAM,MAAM;AACZ,MAAM,IAAI;AACV,MAAM,IAAI;AACV,MAAM,MAAM;AACZ,MAAM,SAAS;AACf,MAAM,GAAG;AACT,MAAM,OAAO;AACb,MAAM,QAAQ;AACd,KAAK;AACL,IAAI,OAAO,EAAE,MAAM;AACnB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,23 +1,28 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, unref, createBlock, createCommentVNode } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import { PictureFilled } from '@element-plus/icons-vue';
|
|
4
|
+
import { skeletonItemProps } from './skeleton-item.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
3
7
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
8
|
+
const __default__ = defineComponent({
|
|
9
|
+
name: "ElSkeletonItem"
|
|
10
|
+
});
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
12
|
+
...__default__,
|
|
13
|
+
props: skeletonItemProps,
|
|
14
|
+
setup(__props) {
|
|
15
|
+
const ns = useNamespace("skeleton");
|
|
16
|
+
return (_ctx, _cache) => {
|
|
17
|
+
return openBlock(), createElementBlock("div", {
|
|
18
|
+
class: normalizeClass([unref(ns).e("item"), unref(ns).e(_ctx.variant)])
|
|
19
|
+
}, [
|
|
20
|
+
_ctx.variant === "image" ? (openBlock(), createBlock(unref(PictureFilled), { key: 0 })) : createCommentVNode("v-if", true)
|
|
21
|
+
], 2);
|
|
22
|
+
};
|
|
19
23
|
}
|
|
20
24
|
});
|
|
25
|
+
var SkeletonItem = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "skeleton-item.vue"]]);
|
|
21
26
|
|
|
22
|
-
export {
|
|
27
|
+
export { SkeletonItem as default };
|
|
23
28
|
//# sourceMappingURL=skeleton-item2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton-item2.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton-item.
|
|
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 <picture-filled v-if=\"variant === 'image'\" />\n </div>\n</template>\n\n<script lang=\"ts\" setup>\nimport { useNamespace } from '@element-plus/hooks'\nimport { PictureFilled } from '@element-plus/icons-vue'\nimport { skeletonItemProps } from './skeleton-item'\n\ndefineOptions({\n name: 'ElSkeletonItem',\n})\ndefineProps(skeletonItemProps)\nconst ns = useNamespace('skeleton')\n</script>\n"],"names":[],"mappings":";;;;;;;mCAWc,CAAA;AAAA,EACZ,IAAM,EAAA,gBAAA;AACR,CAAA,CAAA,CAAA;;;;;AAEA,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;;;;;;;;;;;;;;"}
|
|
@@ -1,54 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
import '../../../
|
|
3
|
-
import { skeletonProps } from './skeleton2.mjs';
|
|
4
|
-
import SkeletonItem from './skeleton-item.mjs';
|
|
5
|
-
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
-
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
7
|
-
import { useThrottleRender } from '../../../hooks/use-throttle-render/index.mjs';
|
|
1
|
+
import '../../../utils/index.mjs';
|
|
2
|
+
import { buildProps } from '../../../utils/vue/props/runtime.mjs';
|
|
8
3
|
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
return openBlock(), createElementBlock(Fragment, { key: i }, [
|
|
29
|
-
_ctx.loading ? renderSlot(_ctx.$slots, "template", { key: i }, () => [
|
|
30
|
-
createVNode(SkeletonItem, {
|
|
31
|
-
class: normalizeClass(unref(ns).is("first")),
|
|
32
|
-
variant: "p"
|
|
33
|
-
}, null, 8, ["class"]),
|
|
34
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (item) => {
|
|
35
|
-
return openBlock(), createBlock(SkeletonItem, {
|
|
36
|
-
key: item,
|
|
37
|
-
class: normalizeClass([
|
|
38
|
-
unref(ns).e("paragraph"),
|
|
39
|
-
unref(ns).is("last", item === _ctx.rows && _ctx.rows > 1)
|
|
40
|
-
]),
|
|
41
|
-
variant: "p"
|
|
42
|
-
}, null, 8, ["class"]);
|
|
43
|
-
}), 128))
|
|
44
|
-
]) : createCommentVNode("v-if", true)
|
|
45
|
-
], 64);
|
|
46
|
-
}), 128))
|
|
47
|
-
], 16)) : renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)));
|
|
48
|
-
};
|
|
4
|
+
const skeletonProps = buildProps({
|
|
5
|
+
animated: {
|
|
6
|
+
type: Boolean,
|
|
7
|
+
default: false
|
|
8
|
+
},
|
|
9
|
+
count: {
|
|
10
|
+
type: Number,
|
|
11
|
+
default: 1
|
|
12
|
+
},
|
|
13
|
+
rows: {
|
|
14
|
+
type: Number,
|
|
15
|
+
default: 3
|
|
16
|
+
},
|
|
17
|
+
loading: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: true
|
|
20
|
+
},
|
|
21
|
+
throttle: {
|
|
22
|
+
type: Number
|
|
49
23
|
}
|
|
50
24
|
});
|
|
51
|
-
var Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "skeleton.vue"]]);
|
|
52
25
|
|
|
53
|
-
export {
|
|
26
|
+
export { skeletonProps };
|
|
54
27
|
//# sourceMappingURL=skeleton.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.
|
|
1
|
+
{"version":3,"file":"skeleton.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.ts"],"sourcesContent":["import { buildProps } from '@element-plus/utils'\nimport type Skeleton from './skeleton.vue'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const skeletonProps = buildProps({\n /**\n * @description whether showing the animation\n */\n animated: {\n type: Boolean,\n default: false,\n },\n /**\n * @description how many fake items to render to the DOM\n */\n count: {\n type: Number,\n default: 1,\n },\n /**\n * @description whether showing the real DOM\n */\n rows: {\n type: Number,\n default: 3,\n },\n /**\n * @description numbers of the row, only useful when no template slot were given\n */\n loading: {\n type: Boolean,\n default: true,\n },\n /**\n * @description rendering delay in milliseconds\n */\n throttle: {\n type: Number,\n },\n} as const)\nexport type SkeletonProps = ExtractPropTypes<typeof skeletonProps>\n\nexport type SkeletonInstance = InstanceType<typeof Skeleton>\n"],"names":[],"mappings":";;;AACY,MAAC,aAAa,GAAG,UAAU,CAAC;AACxC,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,KAAK;AAClB,GAAG;AACH,EAAE,KAAK,EAAE;AACT,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,IAAI,EAAE;AACR,IAAI,IAAI,EAAE,MAAM;AAChB,IAAI,OAAO,EAAE,CAAC;AACd,GAAG;AACH,EAAE,OAAO,EAAE;AACX,IAAI,IAAI,EAAE,OAAO;AACjB,IAAI,OAAO,EAAE,IAAI;AACjB,GAAG;AACH,EAAE,QAAQ,EAAE;AACZ,IAAI,IAAI,EAAE,MAAM;AAChB,GAAG;AACH,CAAC;;;;"}
|
|
@@ -1,27 +1,54 @@
|
|
|
1
|
-
import '
|
|
2
|
-
import
|
|
1
|
+
import { defineComponent, toRef, unref, openBlock, createElementBlock, mergeProps, Fragment, renderList, renderSlot, createVNode, normalizeClass, createBlock, createCommentVNode, normalizeProps } from 'vue';
|
|
2
|
+
import '../../../hooks/index.mjs';
|
|
3
|
+
import { skeletonProps } from './skeleton.mjs';
|
|
4
|
+
import SkeletonItem from './skeleton-item2.mjs';
|
|
5
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
6
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
7
|
+
import { useThrottleRender } from '../../../hooks/use-throttle-render/index.mjs';
|
|
3
8
|
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
9
|
+
const __default__ = defineComponent({
|
|
10
|
+
name: "ElSkeleton"
|
|
11
|
+
});
|
|
12
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
13
|
+
...__default__,
|
|
14
|
+
props: skeletonProps,
|
|
15
|
+
setup(__props, { expose }) {
|
|
16
|
+
const props = __props;
|
|
17
|
+
const ns = useNamespace("skeleton");
|
|
18
|
+
const uiLoading = useThrottleRender(toRef(props, "loading"), props.throttle);
|
|
19
|
+
expose({
|
|
20
|
+
uiLoading
|
|
21
|
+
});
|
|
22
|
+
return (_ctx, _cache) => {
|
|
23
|
+
return unref(uiLoading) ? (openBlock(), createElementBlock("div", mergeProps({
|
|
24
|
+
key: 0,
|
|
25
|
+
class: [unref(ns).b(), unref(ns).is("animated", _ctx.animated)]
|
|
26
|
+
}, _ctx.$attrs), [
|
|
27
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.count, (i) => {
|
|
28
|
+
return openBlock(), createElementBlock(Fragment, { key: i }, [
|
|
29
|
+
_ctx.loading ? renderSlot(_ctx.$slots, "template", { key: i }, () => [
|
|
30
|
+
createVNode(SkeletonItem, {
|
|
31
|
+
class: normalizeClass(unref(ns).is("first")),
|
|
32
|
+
variant: "p"
|
|
33
|
+
}, null, 8, ["class"]),
|
|
34
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.rows, (item) => {
|
|
35
|
+
return openBlock(), createBlock(SkeletonItem, {
|
|
36
|
+
key: item,
|
|
37
|
+
class: normalizeClass([
|
|
38
|
+
unref(ns).e("paragraph"),
|
|
39
|
+
unref(ns).is("last", item === _ctx.rows && _ctx.rows > 1)
|
|
40
|
+
]),
|
|
41
|
+
variant: "p"
|
|
42
|
+
}, null, 8, ["class"]);
|
|
43
|
+
}), 128))
|
|
44
|
+
]) : createCommentVNode("v-if", true)
|
|
45
|
+
], 64);
|
|
46
|
+
}), 128))
|
|
47
|
+
], 16)) : renderSlot(_ctx.$slots, "default", normalizeProps(mergeProps({ key: 1 }, _ctx.$attrs)));
|
|
48
|
+
};
|
|
23
49
|
}
|
|
24
50
|
});
|
|
51
|
+
var Skeleton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "skeleton.vue"]]);
|
|
25
52
|
|
|
26
|
-
export {
|
|
53
|
+
export { Skeleton as default };
|
|
27
54
|
//# sourceMappingURL=skeleton2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"skeleton2.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.
|
|
1
|
+
{"version":3,"file":"skeleton2.mjs","sources":["../../../../../../packages/components/skeleton/src/skeleton.vue"],"sourcesContent":["<template>\n <template v-if=\"uiLoading\">\n <div :class=\"[ns.b(), ns.is('animated', animated)]\" v-bind=\"$attrs\">\n <template v-for=\"i in count\" :key=\"i\">\n <slot v-if=\"loading\" :key=\"i\" name=\"template\">\n <el-skeleton-item :class=\"ns.is('first')\" variant=\"p\" />\n <el-skeleton-item\n v-for=\"item in rows\"\n :key=\"item\"\n :class=\"[\n ns.e('paragraph'),\n ns.is('last', item === rows && rows > 1),\n ]\"\n variant=\"p\"\n />\n </slot>\n </template>\n </div>\n </template>\n <template v-else>\n <slot v-bind=\"$attrs\" />\n </template>\n</template>\n\n<script lang=\"ts\" setup>\nimport { toRef } from 'vue'\nimport { useNamespace, useThrottleRender } from '@element-plus/hooks'\nimport { skeletonProps } from './skeleton'\nimport ElSkeletonItem from './skeleton-item.vue'\n\ndefineOptions({\n name: 'ElSkeleton',\n})\nconst props = defineProps(skeletonProps)\n\nconst ns = useNamespace('skeleton')\nconst uiLoading = useThrottleRender(toRef(props, 'loading'), props.throttle)\n\ndefineExpose({\n /** @description loading state */\n uiLoading,\n})\n</script>\n"],"names":[],"mappings":";;;;;;;;mCA8Bc,CAAA;AAAA,EACZ,IAAM,EAAA,YAAA;AACR,CAAA,CAAA,CAAA;;;;;;AAGA,IAAM,MAAA,EAAA,GAAK,aAAa,UAAU,CAAA,CAAA;AAClC,IAAA,MAAM,YAAY,iBAAkB,CAAA,KAAA,CAAM,OAAO,SAAS,CAAA,EAAG,MAAM,QAAQ,CAAA,CAAA;AAE3E,IAAa,MAAA,CAAA;AAAA,MAEX,SAAA;AAAA,KACD,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,26 +1,98 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import '
|
|
3
|
-
import '../../../
|
|
4
|
-
import
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
1
|
+
import { defineComponent, reactive, toRefs, openBlock, createElementBlock, normalizeClass, unref, normalizeStyle, createVNode, withCtx, createElementVNode, toDisplayString } from 'vue';
|
|
2
|
+
import { ElTooltip } from '../../tooltip/index.mjs';
|
|
3
|
+
import '../../../hooks/index.mjs';
|
|
4
|
+
import './composables/index.mjs';
|
|
5
|
+
import { sliderButtonProps, sliderButtonEmits } from './button2.mjs';
|
|
6
|
+
import _export_sfc from '../../../_virtual/plugin-vue_export-helper.mjs';
|
|
7
|
+
import { useNamespace } from '../../../hooks/use-namespace/index.mjs';
|
|
8
|
+
import { useSliderButton } from './composables/use-slider-button.mjs';
|
|
7
9
|
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
10
|
+
const _hoisted_1 = ["tabindex"];
|
|
11
|
+
const __default__ = defineComponent({
|
|
12
|
+
name: "ElSliderButton"
|
|
13
|
+
});
|
|
14
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
15
|
+
...__default__,
|
|
16
|
+
props: sliderButtonProps,
|
|
17
|
+
emits: sliderButtonEmits,
|
|
18
|
+
setup(__props, { expose, emit }) {
|
|
19
|
+
const props = __props;
|
|
20
|
+
const ns = useNamespace("slider");
|
|
21
|
+
const initData = reactive({
|
|
22
|
+
hovering: false,
|
|
23
|
+
dragging: false,
|
|
24
|
+
isClick: false,
|
|
25
|
+
startX: 0,
|
|
26
|
+
currentX: 0,
|
|
27
|
+
startY: 0,
|
|
28
|
+
currentY: 0,
|
|
29
|
+
startPosition: 0,
|
|
30
|
+
newPosition: 0,
|
|
31
|
+
oldValue: props.modelValue
|
|
32
|
+
});
|
|
33
|
+
const {
|
|
34
|
+
disabled,
|
|
35
|
+
button,
|
|
36
|
+
tooltip,
|
|
37
|
+
showTooltip,
|
|
38
|
+
tooltipVisible,
|
|
39
|
+
wrapperStyle,
|
|
40
|
+
formatValue,
|
|
41
|
+
handleMouseEnter,
|
|
42
|
+
handleMouseLeave,
|
|
43
|
+
onButtonDown,
|
|
44
|
+
onKeyDown,
|
|
45
|
+
setPosition
|
|
46
|
+
} = useSliderButton(props, initData, emit);
|
|
47
|
+
const { hovering, dragging } = toRefs(initData);
|
|
48
|
+
expose({
|
|
49
|
+
onButtonDown,
|
|
50
|
+
onKeyDown,
|
|
51
|
+
setPosition,
|
|
52
|
+
hovering,
|
|
53
|
+
dragging
|
|
54
|
+
});
|
|
55
|
+
return (_ctx, _cache) => {
|
|
56
|
+
return openBlock(), createElementBlock("div", {
|
|
57
|
+
ref_key: "button",
|
|
58
|
+
ref: button,
|
|
59
|
+
class: normalizeClass([unref(ns).e("button-wrapper"), { hover: unref(hovering), dragging: unref(dragging) }]),
|
|
60
|
+
style: normalizeStyle(unref(wrapperStyle)),
|
|
61
|
+
tabindex: unref(disabled) ? -1 : 0,
|
|
62
|
+
onMouseenter: _cache[0] || (_cache[0] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
|
|
63
|
+
onMouseleave: _cache[1] || (_cache[1] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)),
|
|
64
|
+
onMousedown: _cache[2] || (_cache[2] = (...args) => unref(onButtonDown) && unref(onButtonDown)(...args)),
|
|
65
|
+
onTouchstart: _cache[3] || (_cache[3] = (...args) => unref(onButtonDown) && unref(onButtonDown)(...args)),
|
|
66
|
+
onFocus: _cache[4] || (_cache[4] = (...args) => unref(handleMouseEnter) && unref(handleMouseEnter)(...args)),
|
|
67
|
+
onBlur: _cache[5] || (_cache[5] = (...args) => unref(handleMouseLeave) && unref(handleMouseLeave)(...args)),
|
|
68
|
+
onKeydown: _cache[6] || (_cache[6] = (...args) => unref(onKeyDown) && unref(onKeyDown)(...args))
|
|
69
|
+
}, [
|
|
70
|
+
createVNode(unref(ElTooltip), {
|
|
71
|
+
ref_key: "tooltip",
|
|
72
|
+
ref: tooltip,
|
|
73
|
+
visible: unref(tooltipVisible),
|
|
74
|
+
placement: _ctx.placement,
|
|
75
|
+
"fallback-placements": ["top", "bottom", "right", "left"],
|
|
76
|
+
"stop-popper-mouse-event": false,
|
|
77
|
+
"popper-class": _ctx.tooltipClass,
|
|
78
|
+
disabled: !unref(showTooltip),
|
|
79
|
+
persistent: ""
|
|
80
|
+
}, {
|
|
81
|
+
content: withCtx(() => [
|
|
82
|
+
createElementVNode("span", null, toDisplayString(unref(formatValue)), 1)
|
|
83
|
+
]),
|
|
84
|
+
default: withCtx(() => [
|
|
85
|
+
createElementVNode("div", {
|
|
86
|
+
class: normalizeClass([unref(ns).e("button"), { hover: unref(hovering), dragging: unref(dragging) }])
|
|
87
|
+
}, null, 2)
|
|
88
|
+
]),
|
|
89
|
+
_: 1
|
|
90
|
+
}, 8, ["visible", "placement", "popper-class", "disabled"])
|
|
91
|
+
], 46, _hoisted_1);
|
|
92
|
+
};
|
|
19
93
|
}
|
|
20
94
|
});
|
|
21
|
-
|
|
22
|
-
[UPDATE_MODEL_EVENT]: (value) => isNumber(value)
|
|
23
|
-
};
|
|
95
|
+
var SliderButton = /* @__PURE__ */ _export_sfc(_sfc_main, [["__file", "button.vue"]]);
|
|
24
96
|
|
|
25
|
-
export {
|
|
97
|
+
export { SliderButton as default };
|
|
26
98
|
//# sourceMappingURL=button.mjs.map
|