element-ps 1.0.21 → 1.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +2 -2
- package/dist/index.full.min.js +1 -1
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +1 -1
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +2 -2
- package/es/index.mjs +9 -9
- package/es/packages/components/affix/index.mjs +2 -2
- package/es/packages/components/affix/src/affix.mjs +5 -22
- package/es/packages/components/affix/src/affix.mjs.map +1 -1
- package/es/packages/components/affix/src/affix.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/affix/src/affix2.mjs +22 -5
- package/es/packages/components/affix/src/affix2.mjs.map +1 -1
- package/es/packages/components/backtop/index.mjs +2 -2
- package/es/packages/components/backtop/src/backtop.mjs +19 -5
- package/es/packages/components/backtop/src/backtop.mjs.map +1 -1
- package/es/packages/components/backtop/src/backtop.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/backtop/src/backtop2.mjs +5 -19
- package/es/packages/components/backtop/src/backtop2.mjs.map +1 -1
- package/es/packages/components/badge/index.mjs +2 -2
- package/es/packages/components/badge/src/badge.mjs +20 -5
- package/es/packages/components/badge/src/badge.mjs.map +1 -1
- package/es/packages/components/badge/src/badge.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/badge/src/badge2.mjs +5 -20
- package/es/packages/components/badge/src/badge2.mjs.map +1 -1
- package/es/packages/components/card/index.mjs +2 -2
- package/es/packages/components/card/src/card.mjs +17 -5
- package/es/packages/components/card/src/card.mjs.map +1 -1
- package/es/packages/components/card/src/card.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/card/src/card2.mjs +5 -17
- package/es/packages/components/card/src/card2.mjs.map +1 -1
- package/es/packages/components/cascader-panel/src/config.mjs +1 -1
- package/es/packages/components/cascader-panel/src/index.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/cascader-panel/src/menu.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/cascader-panel/src/node.mjs +72 -5
- package/es/packages/components/cascader-panel/src/node.mjs.map +1 -1
- package/es/packages/components/cascader-panel/src/node2.mjs +5 -72
- package/es/packages/components/cascader-panel/src/node2.mjs.map +1 -1
- package/es/packages/components/cascader-panel/src/store.mjs +1 -1
- package/es/packages/components/divider/index.mjs +2 -2
- package/es/packages/components/divider/src/divider.mjs +15 -5
- package/es/packages/components/divider/src/divider.mjs.map +1 -1
- package/es/packages/components/divider/src/divider.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/divider/src/divider2.mjs +5 -15
- package/es/packages/components/divider/src/divider2.mjs.map +1 -1
- package/es/packages/components/dropdown/index.mjs +1 -1
- package/es/packages/components/dropdown/src/dropdown.mjs +0 -5
- package/es/packages/components/dropdown/src/dropdown.mjs.map +1 -1
- package/es/packages/components/dropdown/src/dropdown2.mjs +5 -0
- package/es/packages/components/dropdown/src/dropdown2.mjs.map +1 -1
- package/es/packages/components/empty/index.mjs +2 -2
- package/es/packages/components/empty/src/empty.mjs +12 -5
- package/es/packages/components/empty/src/empty.mjs.map +1 -1
- package/es/packages/components/empty/src/empty.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/empty/src/empty2.mjs +5 -12
- package/es/packages/components/empty/src/empty2.mjs.map +1 -1
- package/es/packages/components/form/src/form-item.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs +2 -2
- package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs.map +1 -1
- package/es/packages/components/icon/index.mjs +2 -2
- package/es/packages/components/icon/src/icon.mjs +11 -5
- package/es/packages/components/icon/src/icon.mjs.map +1 -1
- package/es/packages/components/icon/src/icon.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/icon/src/icon2.mjs +5 -11
- package/es/packages/components/icon/src/icon2.mjs.map +1 -1
- package/es/packages/components/image-viewer/index.mjs +2 -2
- package/es/packages/components/image-viewer/src/image-viewer.mjs +25 -5
- package/es/packages/components/image-viewer/src/image-viewer.mjs.map +1 -1
- package/es/packages/components/image-viewer/src/image-viewer.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/image-viewer/src/image-viewer2.mjs +5 -25
- package/es/packages/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/packages/components/index.mjs +9 -9
- package/es/packages/components/input/index.mjs +2 -2
- package/es/packages/components/input/src/input.mjs +79 -5
- package/es/packages/components/input/src/input.mjs.map +1 -1
- package/es/packages/components/input/src/input.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/input/src/input2.mjs +5 -79
- package/es/packages/components/input/src/input2.mjs.map +1 -1
- package/lib/index.js +9 -9
- package/lib/packages/components/affix/index.js +2 -2
- package/lib/packages/components/affix/src/affix.js +5 -21
- package/lib/packages/components/affix/src/affix.js.map +1 -1
- package/lib/packages/components/affix/src/affix.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/affix/src/affix2.js +21 -5
- package/lib/packages/components/affix/src/affix2.js.map +1 -1
- package/lib/packages/components/backtop/index.js +2 -2
- package/lib/packages/components/backtop/src/backtop.js +19 -6
- package/lib/packages/components/backtop/src/backtop.js.map +1 -1
- package/lib/packages/components/backtop/src/backtop.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/backtop/src/backtop2.js +6 -19
- package/lib/packages/components/backtop/src/backtop2.js.map +1 -1
- package/lib/packages/components/badge/index.js +2 -2
- package/lib/packages/components/badge/src/badge.js +19 -5
- package/lib/packages/components/badge/src/badge.js.map +1 -1
- package/lib/packages/components/badge/src/badge.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/badge/src/badge2.js +5 -19
- package/lib/packages/components/badge/src/badge2.js.map +1 -1
- package/lib/packages/components/card/index.js +2 -2
- package/lib/packages/components/card/src/card.js +16 -5
- package/lib/packages/components/card/src/card.js.map +1 -1
- package/lib/packages/components/card/src/card.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/card/src/card2.js +5 -16
- package/lib/packages/components/card/src/card2.js.map +1 -1
- package/lib/packages/components/cascader-panel/src/config.js +1 -1
- package/lib/packages/components/cascader-panel/src/index.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/cascader-panel/src/menu.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/cascader-panel/src/node.js +71 -5
- package/lib/packages/components/cascader-panel/src/node.js.map +1 -1
- package/lib/packages/components/cascader-panel/src/node2.js +5 -71
- package/lib/packages/components/cascader-panel/src/node2.js.map +1 -1
- package/lib/packages/components/cascader-panel/src/store.js +1 -1
- package/lib/packages/components/divider/index.js +2 -2
- package/lib/packages/components/divider/src/divider.js +14 -5
- package/lib/packages/components/divider/src/divider.js.map +1 -1
- package/lib/packages/components/divider/src/divider.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/divider/src/divider2.js +5 -14
- package/lib/packages/components/divider/src/divider2.js.map +1 -1
- package/lib/packages/components/dropdown/index.js +1 -1
- package/lib/packages/components/dropdown/src/dropdown.js +0 -9
- package/lib/packages/components/dropdown/src/dropdown.js.map +1 -1
- package/lib/packages/components/dropdown/src/dropdown2.js +9 -0
- package/lib/packages/components/dropdown/src/dropdown2.js.map +1 -1
- package/lib/packages/components/empty/index.js +2 -2
- package/lib/packages/components/empty/src/empty.js +12 -6
- package/lib/packages/components/empty/src/empty.js.map +1 -1
- package/lib/packages/components/empty/src/empty.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/empty/src/empty2.js +6 -12
- package/lib/packages/components/empty/src/empty2.js.map +1 -1
- package/lib/packages/components/form/src/form-item.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.js +2 -2
- package/lib/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.js.map +1 -1
- package/lib/packages/components/icon/index.js +2 -2
- package/lib/packages/components/icon/src/icon.js +10 -5
- package/lib/packages/components/icon/src/icon.js.map +1 -1
- package/lib/packages/components/icon/src/icon.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/icon/src/icon2.js +5 -10
- package/lib/packages/components/icon/src/icon2.js.map +1 -1
- package/lib/packages/components/image-viewer/index.js +2 -2
- package/lib/packages/components/image-viewer/src/image-viewer.js +24 -5
- package/lib/packages/components/image-viewer/src/image-viewer.js.map +1 -1
- package/lib/packages/components/image-viewer/src/image-viewer.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/image-viewer/src/image-viewer2.js +5 -24
- package/lib/packages/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/packages/components/index.js +9 -9
- package/lib/packages/components/input/index.js +2 -2
- package/lib/packages/components/input/src/input.js +78 -5
- package/lib/packages/components/input/src/input.js.map +1 -1
- package/lib/packages/components/input/src/input.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/input/src/input2.js +5 -78
- package/lib/packages/components/input/src/input2.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"node2.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"node2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/
|
|
3
|
-
export { dividerProps } from './src/
|
|
2
|
+
import './src/divider2.mjs';
|
|
3
|
+
export { dividerProps } from './src/divider.mjs';
|
|
4
4
|
import script from './src/divider.vue_vue&type=script&lang.mjs';
|
|
5
5
|
|
|
6
6
|
const PsDivider = withInstall(script);
|
|
@@ -1,7 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { default } from './divider.vue_vue&type=script&lang.mjs';
|
|
3
|
-
import { render } from './divider.vue_vue&type=template&id=6ddd3543&lang.mjs';
|
|
1
|
+
import { buildProps } from '../../../utils/props.mjs';
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const dividerProps = buildProps({
|
|
4
|
+
direction: {
|
|
5
|
+
type: String,
|
|
6
|
+
values: ["horizontal", "vertical"],
|
|
7
|
+
default: "horizontal"
|
|
8
|
+
},
|
|
9
|
+
contentPosition: {
|
|
10
|
+
type: String,
|
|
11
|
+
values: ["left", "center", "right"],
|
|
12
|
+
default: "center"
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export { dividerProps };
|
|
7
17
|
//# sourceMappingURL=divider.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"divider.mjs","sources":["../../../../../../../packages/components/divider/src/divider.ts"],"sourcesContent":["import { buildProps } from '@element-ps/utils/props'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const dividerProps = buildProps({\n direction: {\n type: String,\n values: ['horizontal', 'vertical'],\n default: 'horizontal',\n },\n contentPosition: {\n type: String,\n values: ['left', 'center', 'right'],\n default: 'center',\n },\n} as const)\nexport type DividerProps = ExtractPropTypes<typeof dividerProps>\n"],"names":[],"mappings":";;MAIa,eAAe,WAAW;AAAA,EACrC,WAAW;AAAA,IACT,MAAM;AAAA,IACN,QAAQ,CAAC,cAAc;AAAA,IACvB,SAAS;AAAA;AAAA,EAEX,iBAAiB;AAAA,IACf,MAAM;AAAA,IACN,QAAQ,CAAC,QAAQ,UAAU;AAAA,IAC3B,SAAS;AAAA;AAAA;;;;"}
|
|
@@ -1,17 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import script from './divider.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './divider.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './divider.vue_vue&type=template&id=6ddd3543&lang.mjs';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type: String,
|
|
6
|
-
values: ["horizontal", "vertical"],
|
|
7
|
-
default: "horizontal"
|
|
8
|
-
},
|
|
9
|
-
contentPosition: {
|
|
10
|
-
type: String,
|
|
11
|
-
values: ["left", "center", "right"],
|
|
12
|
-
default: "center"
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
|
|
16
|
-
export { dividerProps };
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/divider/src/divider.vue";
|
|
17
7
|
//# sourceMappingURL=divider2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"divider2.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"divider2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { withInstall, withNoopInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/
|
|
2
|
+
import './src/dropdown2.mjs';
|
|
3
3
|
import './src/dropdown-item.mjs';
|
|
4
4
|
import './src/dropdown-menu.mjs';
|
|
5
5
|
import script from './src/dropdown.vue_vue&type=script&lang.mjs';
|
|
@@ -1,7 +1,2 @@
|
|
|
1
|
-
import script from './dropdown.vue_vue&type=script&lang.mjs';
|
|
2
|
-
export { default } from './dropdown.vue_vue&type=script&lang.mjs';
|
|
3
|
-
import { render } from './dropdown.vue_vue&type=template&id=3ed790a5&lang.mjs';
|
|
4
1
|
|
|
5
|
-
script.render = render;
|
|
6
|
-
script.__file = "packages/components/dropdown/src/dropdown.vue";
|
|
7
2
|
//# sourceMappingURL=dropdown.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"dropdown.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
+
import script from './dropdown.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './dropdown.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './dropdown.vue_vue&type=template&id=3ed790a5&lang.mjs';
|
|
1
4
|
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/dropdown/src/dropdown.vue";
|
|
2
7
|
//# sourceMappingURL=dropdown2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"dropdown2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
1
|
+
{"version":3,"file":"dropdown2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/
|
|
3
|
-
export { emptyProps } from './src/
|
|
2
|
+
import './src/empty2.mjs';
|
|
3
|
+
export { emptyProps } from './src/empty.mjs';
|
|
4
4
|
import script from './src/empty.vue_vue&type=script&lang.mjs';
|
|
5
5
|
|
|
6
6
|
const PsEmpty = withInstall(script);
|
|
@@ -1,7 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
const emptyProps = {
|
|
2
|
+
image: {
|
|
3
|
+
type: String,
|
|
4
|
+
default: ""
|
|
5
|
+
},
|
|
6
|
+
imageSize: Number,
|
|
7
|
+
description: {
|
|
8
|
+
type: String,
|
|
9
|
+
default: ""
|
|
10
|
+
}
|
|
11
|
+
};
|
|
4
12
|
|
|
5
|
-
|
|
6
|
-
script.__file = "packages/components/empty/src/empty.vue";
|
|
13
|
+
export { emptyProps };
|
|
7
14
|
//# sourceMappingURL=empty.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"empty.mjs","sources":["../../../../../../../packages/components/empty/src/empty.ts"],"sourcesContent":["import type { ExtractPropTypes } from 'vue'\n\nexport const emptyProps = {\n image: {\n type: String,\n default: '',\n },\n imageSize: Number,\n description: {\n type: String,\n default: '',\n },\n} as const\nexport type EmptyProps = ExtractPropTypes<typeof emptyProps>\n"],"names":[],"mappings":"MAEa,aAAa;AAAA,EACxB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,EACX,aAAa;AAAA,IACX,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;;;;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent, computed } from 'vue';
|
|
2
2
|
import '../../../hooks/index.mjs';
|
|
3
3
|
import './img-empty.mjs';
|
|
4
|
-
import { emptyProps } from './
|
|
4
|
+
import { emptyProps } from './empty.mjs';
|
|
5
5
|
import script$1 from './img-empty.vue_vue&type=script&lang.mjs';
|
|
6
6
|
import { useLocaleInject } from '../../../hooks/use-locale/index.mjs';
|
|
7
7
|
|
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
default: ""
|
|
5
|
-
},
|
|
6
|
-
imageSize: Number,
|
|
7
|
-
description: {
|
|
8
|
-
type: String,
|
|
9
|
-
default: ""
|
|
10
|
-
}
|
|
11
|
-
};
|
|
1
|
+
import script from './empty.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './empty.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './empty.vue_vue&type=template&id=10d211eb&lang.mjs';
|
|
12
4
|
|
|
13
|
-
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/empty/src/empty.vue";
|
|
14
7
|
//# sourceMappingURL=empty2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"empty2.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"empty2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item.vue_vue&type=script&lang.mjs","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\"\n :widget=\"widget\"\n >\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"`${widget ? 'form-item:label:' + widget.split(':')[1] : undefined}`\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\"\n :widget=\"`${widget ? 'form-item:default:' + widget.split(':')[1] : undefined}`\"\n >\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;AAkEA,aAAe,gBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,eAAe;AAAA,EACf,YAAY;AAAA,IACV;AAAA;AAAA,EAEF,OAAO;AAAA,IACL,OAAO;AAAA,IACP,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,IACN,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,OAAO,CAAC,QAAQ;AAAA,IAChB,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,eAAe;AAAA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,SAAS,MAAM;AAAA,MACnC;AAAA,QACE,0BAA0B,OAAO;AAAA,QACjC,YAAY,cAAc,UAAU;AAAA,QACpC,iBAAiB,cAAc,UAAU;AAAA,QACzC,cAAc,cAAc,UAAU;AAAA,QACtC,eAAe,WAAW,SAAS,MAAM;AAAA,QACzC,kBAAkB,OAAO;AAAA;AAAA,MAE3B,UAAU,QAAQ,iBAAiB,UAAU,UAAU;AAAA;AAGzD,UAAM,kBAAkB,SAAS,MAAM;AACrC,aACE,cAAc,UAAU,WACxB,MAAM,eACN,OAAO;AAAA;AAIX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"form-item.vue_vue&type=script&lang.mjs","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\"\n :widget=\"widget\"\n >\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget ? 'form-item:label:' + widget.split(':')[1] : undefined\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\"\n :widget=\"widget ? 'form-item:default:' + widget.split(':')[1] : undefined\"\n >\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":[],"mappings":";;;;;;;AAkEA,aAAe,gBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,eAAe;AAAA,EACf,YAAY;AAAA,IACV;AAAA;AAAA,EAEF,OAAO;AAAA,IACL,OAAO;AAAA,IACP,YAAY;AAAA,MACV,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,IACN,UAAU;AAAA,MACR,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,OAAO,CAAC,QAAQ;AAAA,IAChB,OAAO;AAAA,IACP,gBAAgB;AAAA,IAChB,KAAK;AAAA,IACL,eAAe;AAAA,MACb,MAAM,CAAC,QAAQ;AAAA,MACf,SAAS;AAAA;AAAA,IAEX,aAAa;AAAA,MACX,MAAM;AAAA,MACN,SAAS;AAAA;AAAA,IAEX,MAAM;AAAA,MACJ,MAAM;AAAA,MACN,WAAW;AAAA;AAAA,IAEb,QAAQ;AAAA,MACN,MAAM;AAAA;AAAA;AAAA,EAGV,MAAM,OAAO,EAAE,SAAS;AACtB,UAAM,WAAW;AAEjB,UAAM,SAAS,OAAO,WAAW;AACjC,UAAM,gBAAgB,IAAI;AAC1B,UAAM,kBAAkB,IAAI;AAE5B,UAAM,qBAAqB,IAAI;AAE/B,UAAM,cAAc;AAEpB,UAAM,KAAK;AACX,UAAM,WAAW,SAAS,MAAM;AAC9B,UAAI,SAAS,GAAG;AAChB,aAAO,UAAU,OAAO,KAAK,SAAS,UAAU;AAC9C,YAAI,OAAO,KAAK,SAAS,cAAc;AACrC,iBAAO;AAAA;AAET,iBAAS,OAAO;AAAA;AAElB,aAAO;AAAA;AAGT,QAAI,eAAe;AAEnB,UAAM,WAAW,SAAS,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AAM,aAAa,SAAY,EAAE,UAAU,CAAC,CAAC,MAAM,aAAa;AAElE,YAAM,OAAO,cAAc,WAAW,MAAM,QAAQ,IAAI;AACxD,YAAM,iBAAiB,YAAY,KAAK,EAAE,MAAM,QAAQ,OAAO,KAAK,IAAI;AAExE,aAAO,GAAG,OAAO,aAAa,kBAAkB,IAAI,OAAO;AAAA;AAG7D,UAAM,2BAA2B,CAAC,UAA2B;AAC3D,yBAAmB,QAAQ,QAAQ,GAAG,YAAY;AAAA;AAGpD,UAAM,aAAa,SAAS;AAAA,SACvB,OAAO;AAAA,MACV,MAAM;AAAA,MACN,KAAK;AAAA,MACL;AAAA;AAGF,cAAU,MAAM;AACd,UAAI,MAAM,MAAM;AACd,cAAM,QAAQ,WAAW;AACzB,uBAAgB,MAAM,QAAQ,SAAS,CAAC,GAAG,SAAS;AAAA;AAAA;AAIxD,YAAQ,eAAe;AAEvB,UAAM,gBAAgB,SAAS,MAAM;AAAA,MACnC;AAAA,QACE,0BAA0B,OAAO;AAAA,QACjC,YAAY,cAAc,UAAU;AAAA,QACpC,iBAAiB,cAAc,UAAU;AAAA,QACzC,cAAc,cAAc,UAAU;AAAA,QACtC,eAAe,WAAW,SAAS,MAAM;AAAA,QACzC,kBAAkB,OAAO;AAAA;AAAA,MAE3B,UAAU,QAAQ,iBAAiB,UAAU,UAAU;AAAA;AAGzD,UAAM,kBAAkB,SAAS,MAAM;AACrC,aACE,cAAc,UAAU,WACxB,MAAM,eACN,OAAO;AAAA;AAIX,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA;;;;"}
|
package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs
CHANGED
|
@@ -20,7 +20,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
20
20
|
for: _ctx.labelFor,
|
|
21
21
|
class: "el-form-item__label",
|
|
22
22
|
style: normalizeStyle(_ctx.labelStyle),
|
|
23
|
-
widget:
|
|
23
|
+
widget: _ctx.widget ? "form-item:label:" + _ctx.widget.split(":")[1] : void 0
|
|
24
24
|
}, [
|
|
25
25
|
renderSlot(_ctx.$slots, "label", {
|
|
26
26
|
label: _ctx.label + _ctx.elForm.labelSuffix
|
|
@@ -34,7 +34,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
34
34
|
createElementVNode("div", {
|
|
35
35
|
class: "el-form-item__content",
|
|
36
36
|
style: normalizeStyle(_ctx.contentStyle),
|
|
37
|
-
widget:
|
|
37
|
+
widget: _ctx.widget ? "form-item:default:" + _ctx.widget.split(":")[1] : void 0
|
|
38
38
|
}, [
|
|
39
39
|
renderSlot(_ctx.$slots, "default"),
|
|
40
40
|
createVNode(Transition, { name: "el-zoom-in-top" }, {
|
package/es/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.mjs","sources":["../../../../../../../packages/components/form/src/form-item.vue?vue&type=template&id=24eda48b&lang.js"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\"\n :widget=\"widget\"\n >\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"
|
|
1
|
+
{"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.mjs","sources":["../../../../../../../packages/components/form/src/form-item.vue?vue&type=template&id=24eda48b&lang.js"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\"\n :widget=\"widget\"\n >\n <LabelWrap\n :is-auto-width=\"labelStyle.width === 'auto'\"\n :update-all=\"elForm.labelWidth === 'auto'\"\n >\n <label\n v-if=\"label || $slots.label\"\n :for=\"labelFor\"\n class=\"el-form-item__label\"\n :style=\"labelStyle\"\n :widget=\"widget ? 'form-item:label:' + widget.split(':')[1] : undefined\"\n >\n <slot name=\"label\" :label=\"label + elForm.labelSuffix\">\n {{ label + elForm.labelSuffix }}\n </slot>\n </label>\n </LabelWrap>\n <div class=\"el-form-item__content\" :style=\"contentStyle\"\n :widget=\"widget ? 'form-item:default:' + widget.split(':')[1] : undefined\"\n >\n <slot></slot>\n <transition name=\"el-zoom-in-top\">\n <slot v-if=\"shouldShowError\" name=\"error\" :error=\"validateMessage\">\n <div\n class=\"el-form-item__error\"\n :class=\"{\n 'el-form-item__error--inline':\n typeof inlineMessage === 'boolean'\n ? inlineMessage\n : elForm.inlineMessage || false,\n }\"\n >\n {{ validateMessage }}\n </div>\n </slot>\n </transition>\n </div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport {\n computed,\n defineComponent,\n getCurrentInstance,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n reactive,\n ref,\n toRefs,\n} from 'vue'\nimport { addUnit, getPropByPath, useGlobalConfig } from '@element-ps/utils/util'\nimport { isValidComponentSize } from '@element-ps/utils/validators'\nimport { elFormItemKey, elFormKey } from '@element-ps/tokens'\nimport LabelWrap from './label-wrap'\n\nimport type { PropType, CSSProperties } from 'vue'\nimport type { ComponentSize } from '@element-ps/utils/types'\nimport type { ElFormContext } from '@element-ps/tokens'\nimport type { FormItemRule } from './form.type'\n\nexport default defineComponent({\n name: 'PsFormItem',\n componentName: 'PsFormItem',\n components: {\n LabelWrap,\n },\n props: {\n label: String,\n labelWidth: {\n type: [String, Number],\n default: '',\n },\n prop: String,\n required: {\n type: Boolean,\n default: undefined,\n },\n rules: [Object, Array] as PropType<FormItemRule | FormItemRule[]>,\n error: String,\n validateStatus: String,\n for: String,\n inlineMessage: {\n type: [String, Boolean],\n default: '',\n },\n showMessage: {\n type: Boolean,\n default: true,\n },\n size: {\n type: String as PropType<ComponentSize>,\n validator: isValidComponentSize,\n },\n widget: {\n type: String,\n },\n },\n setup(props, { slots }) {\n const $ELEMENT = useGlobalConfig()\n\n const elForm = inject(elFormKey, {} as ElFormContext)\n const validateState = ref('')\n const validateMessage = ref('')\n\n const computedLabelWidth = ref('')\n\n const formItemRef = ref<HTMLDivElement>()\n\n const vm = getCurrentInstance()\n const isNested = computed(() => {\n let parent = vm.parent\n while (parent && parent.type.name !== 'PsForm') {\n if (parent.type.name === 'PsFormItem') {\n return true\n }\n parent = parent.parent\n }\n return false\n })\n\n let initialValue = undefined\n\n const labelFor = computed(() => props.for || props.prop)\n const labelStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top') return ret\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (labelWidth) {\n ret.width = labelWidth\n }\n return ret\n })\n const contentStyle = computed(() => {\n const ret: CSSProperties = {}\n if (elForm.labelPosition === 'top' || elForm.inline) {\n return ret\n }\n if (!props.label && !props.labelWidth && isNested.value) {\n return ret\n }\n const labelWidth = addUnit(props.labelWidth || elForm.labelWidth)\n if (!props.label && !slots.label) {\n ret.marginLeft = labelWidth\n }\n return ret\n })\n const fieldValue = computed(() => {\n const model = elForm.model\n if (!model || !props.prop) {\n return\n }\n\n let path = props.prop\n if (path.indexOf(':') !== -1) {\n path = path.replace(/:/, '.')\n }\n\n return getPropByPath(model, path, true).v\n })\n const isRequired = computed(() => {\n const rules = getRules()\n let required = false\n\n if (rules && rules.length) {\n rules.every((rule) => {\n if (rule.required) {\n required = true\n return false\n }\n return true\n })\n }\n return required\n })\n const elFormItemSize = computed(() => props.size || elForm.size)\n const sizeClass = computed<ComponentSize>(() => {\n return elFormItemSize.value || $ELEMENT.size\n })\n\n const getRules = () => {\n const formRules = elForm.rules\n const selfRules = props.rules\n const requiredRule =\n props.required !== undefined ? { required: !!props.required } : []\n\n const prop = getPropByPath(formRules, props.prop || '', false)\n const normalizedRule = formRules ? prop.o[props.prop || ''] || prop.v : []\n\n return [].concat(selfRules || normalizedRule || []).concat(requiredRule)\n }\n\n const updateComputedLabelWidth = (width: string | number) => {\n computedLabelWidth.value = width ? `${width}px` : ''\n }\n\n const elFormItem = reactive({\n ...toRefs(props),\n size: sizeClass,\n $el: formItemRef,\n updateComputedLabelWidth,\n })\n\n onMounted(() => {\n if (props.prop) {\n const value = fieldValue.value\n initialValue = (Array.isArray(value) ? [...value] : value) as any\n }\n })\n\n provide(elFormItemKey, elFormItem as any)\n\n const formItemClass = computed(() => [\n {\n 'el-form-item--feedback': elForm.statusIcon,\n 'is-error': validateState.value === 'error',\n 'is-validating': validateState.value === 'validating',\n 'is-success': validateState.value === 'success',\n 'is-required': isRequired.value || props.required,\n 'is-no-asterisk': elForm.hideRequiredAsterisk,\n },\n sizeClass.value ? `el-form-item--${sizeClass.value}` : '',\n ])\n\n const shouldShowError = computed(() => {\n return (\n validateState.value === 'error' &&\n props.showMessage &&\n elForm.showMessage\n )\n })\n\n return {\n formItemRef,\n formItemClass,\n shouldShowError,\n elForm,\n labelStyle,\n contentStyle,\n validateMessage,\n labelFor,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_renderSlot","_createElementVNode"],"mappings":";;;;;;;sBACEA;IAAK,KAAI;AAAA,IAAc,uBAAM,gBAAuB;IAC9C,QAAQ;;IAEZC;MACG,iBAAe,gBAAW;MAC1B,cAAY,YAAO;;uBAEpB;QACQ,cAAS,YAAO,sBADxBD;;UAEG,KAAK;UACN,OAAM;AAAA,UACL,sBAAO;UACP,QAAQ,mCAA8B,YAAO,gBAAgB;AAAA;UAE9DE;YAAoB,OAAO,aAAQ,YAAO;AAAA,aAA1C;4CACK,aAAQ,YAAO;;;;;;IAIxBC;MAAK,OAAM;AAAA,MAAyB,sBAAO;MACrC,QAAQ,qCAAgC,YAAO,gBAAgB;AAAA;MAEnED;MACAD,0BAAY,MAAK;yBACf;UAAY,uBAAZC;;YAA2C,OAAO;aAAlD;YACEC;cACE,uBAAM;;;+BAQH;;;;;;;;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/
|
|
3
|
-
export { iconProps } from './src/
|
|
2
|
+
import './src/icon2.mjs';
|
|
3
|
+
export { iconProps } from './src/icon.mjs';
|
|
4
4
|
import script from './src/icon.vue_vue&type=script&lang.mjs';
|
|
5
5
|
|
|
6
6
|
const PsIcon = withInstall(script);
|
|
@@ -1,7 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { default } from './icon.vue_vue&type=script&lang.mjs';
|
|
3
|
-
import { render } from './icon.vue_vue&type=template&id=89b755b6&lang.mjs';
|
|
1
|
+
import { buildProps, definePropType } from '../../../utils/props.mjs';
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const iconProps = buildProps({
|
|
4
|
+
size: {
|
|
5
|
+
type: definePropType([Number, String])
|
|
6
|
+
},
|
|
7
|
+
color: {
|
|
8
|
+
type: String
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export { iconProps };
|
|
7
13
|
//# sourceMappingURL=icon.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"icon.mjs","sources":["../../../../../../../packages/components/icon/src/icon.ts"],"sourcesContent":["import { definePropType, buildProps } from '@element-ps/utils/props'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const iconProps = buildProps({\n size: {\n type: definePropType<number | string>([Number, String]),\n },\n color: {\n type: String,\n },\n} as const)\nexport type IconProps = ExtractPropTypes<typeof iconProps>\n"],"names":[],"mappings":";;MAGa,YAAY,WAAW;AAAA,EAClC,MAAM;AAAA,IACJ,MAAM,eAAgC,CAAC,QAAQ;AAAA;AAAA,EAEjD,OAAO;AAAA,IACL,MAAM;AAAA;AAAA;;;;"}
|
|
@@ -1,13 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import script from './icon.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './icon.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './icon.vue_vue&type=template&id=89b755b6&lang.mjs';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type: definePropType([Number, String])
|
|
6
|
-
},
|
|
7
|
-
color: {
|
|
8
|
-
type: String
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
export { iconProps };
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/icon/src/icon.vue";
|
|
13
7
|
//# sourceMappingURL=icon2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"icon2.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"icon2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/image-
|
|
3
|
-
export { imageViewerProps } from './src/image-
|
|
2
|
+
import './src/image-viewer2.mjs';
|
|
3
|
+
export { imageViewerProps } from './src/image-viewer.mjs';
|
|
4
4
|
import script from './src/image-viewer.vue_vue&type=script&lang.mjs';
|
|
5
5
|
|
|
6
6
|
const PsImageViewer = withInstall(script);
|
|
@@ -1,7 +1,27 @@
|
|
|
1
|
-
import
|
|
2
|
-
export { default } from './image-viewer.vue_vue&type=script&lang.mjs';
|
|
3
|
-
import { render } from './image-viewer.vue_vue&type=template&id=4b22ad85&lang.mjs';
|
|
1
|
+
import { buildProps, definePropType, mutable } from '../../../utils/props.mjs';
|
|
4
2
|
|
|
5
|
-
|
|
6
|
-
|
|
3
|
+
const imageViewerProps = buildProps({
|
|
4
|
+
urlList: {
|
|
5
|
+
type: definePropType(Array),
|
|
6
|
+
default: () => mutable([])
|
|
7
|
+
},
|
|
8
|
+
zIndex: {
|
|
9
|
+
type: Number,
|
|
10
|
+
default: 2e3
|
|
11
|
+
},
|
|
12
|
+
initialIndex: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 0
|
|
15
|
+
},
|
|
16
|
+
infinite: {
|
|
17
|
+
type: Boolean,
|
|
18
|
+
default: true
|
|
19
|
+
},
|
|
20
|
+
hideOnClickModal: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
|
|
26
|
+
export { imageViewerProps };
|
|
7
27
|
//# sourceMappingURL=image-viewer.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-viewer.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"image-viewer.mjs","sources":["../../../../../../../packages/components/image-viewer/src/image-viewer.ts"],"sourcesContent":["import { buildProps, definePropType, mutable } from '@element-ps/utils/props'\nimport type { ExtractPropTypes } from 'vue'\n\nexport const imageViewerProps = buildProps({\n urlList: {\n type: definePropType<string[]>(Array),\n default: () => mutable([] as const),\n },\n zIndex: {\n type: Number,\n default: 2000,\n },\n initialIndex: {\n type: Number,\n default: 0,\n },\n infinite: {\n type: Boolean,\n default: true,\n },\n hideOnClickModal: {\n type: Boolean,\n default: false,\n },\n} as const)\nexport type ImageViewerProps = ExtractPropTypes<typeof imageViewerProps>\n"],"names":[],"mappings":";;MAGa,mBAAmB,WAAW;AAAA,EACzC,SAAS;AAAA,IACP,MAAM,eAAyB;AAAA,IAC/B,SAAS,MAAM,QAAQ;AAAA;AAAA,EAEzB,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,kBAAkB;AAAA,IAChB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;;;;"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineComponent, ref, computed, onMounted } from 'vue';
|
|
2
|
-
import { imageViewerProps } from './image-
|
|
2
|
+
import { imageViewerProps } from './image-viewer.mjs';
|
|
3
3
|
import { PsIcon } from '../../icon/index.mjs';
|
|
4
4
|
import { FullScreen, ScaleToOriginal, Close, ArrowLeft, ArrowRight, ZoomOut, ZoomIn, RefreshLeft, RefreshRight } from '@element-plus/icons';
|
|
5
5
|
|
|
@@ -1,27 +1,7 @@
|
|
|
1
|
-
import
|
|
1
|
+
import script from './image-viewer.vue_vue&type=script&lang.mjs';
|
|
2
|
+
export { default } from './image-viewer.vue_vue&type=script&lang.mjs';
|
|
3
|
+
import { render } from './image-viewer.vue_vue&type=template&id=4b22ad85&lang.mjs';
|
|
2
4
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
type: definePropType(Array),
|
|
6
|
-
default: () => mutable([])
|
|
7
|
-
},
|
|
8
|
-
zIndex: {
|
|
9
|
-
type: Number,
|
|
10
|
-
default: 2e3
|
|
11
|
-
},
|
|
12
|
-
initialIndex: {
|
|
13
|
-
type: Number,
|
|
14
|
-
default: 0
|
|
15
|
-
},
|
|
16
|
-
infinite: {
|
|
17
|
-
type: Boolean,
|
|
18
|
-
default: true
|
|
19
|
-
},
|
|
20
|
-
hideOnClickModal: {
|
|
21
|
-
type: Boolean,
|
|
22
|
-
default: false
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
export { imageViewerProps };
|
|
5
|
+
script.render = render;
|
|
6
|
+
script.__file = "packages/components/image-viewer/src/image-viewer.vue";
|
|
27
7
|
//# sourceMappingURL=image-viewer2.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"image-viewer2.mjs","sources":[
|
|
1
|
+
{"version":3,"file":"image-viewer2.mjs","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;"}
|
|
@@ -66,27 +66,27 @@ export { PsUpload } from './upload/index.mjs';
|
|
|
66
66
|
import './virtual-list/index.mjs';
|
|
67
67
|
export { default as PsLoading, PsLoadingDirective, PsLoadingService } from './loading/index.mjs';
|
|
68
68
|
export { PsPopover, PsPopoverDirective } from './popover/index.mjs';
|
|
69
|
-
export { affixProps } from './affix/src/
|
|
69
|
+
export { affixProps } from './affix/src/affix2.mjs';
|
|
70
70
|
export { alertProps } from './alert/src/alert2.mjs';
|
|
71
71
|
export { avatarProps } from './avatar/src/avatar.mjs';
|
|
72
|
-
export { backtopProps } from './backtop/src/
|
|
73
|
-
export { badgeProps } from './badge/src/
|
|
72
|
+
export { backtopProps } from './backtop/src/backtop.mjs';
|
|
73
|
+
export { badgeProps } from './badge/src/badge.mjs';
|
|
74
74
|
export { breadcrumbProps } from './breadcrumb/src/breadcrumb.mjs';
|
|
75
75
|
export { breadcrumbItemProps } from './breadcrumb/src/breadcrumb-item.mjs';
|
|
76
76
|
export { buttonEmits, buttonNativeType, buttonProps, buttonSize, buttonType } from './button/src/button.mjs';
|
|
77
|
-
export { cardProps } from './card/src/
|
|
77
|
+
export { cardProps } from './card/src/card.mjs';
|
|
78
78
|
export { CASCADER_PANEL_INJECTION_KEY, ExpandTrigger } from './cascader-panel/src/types.mjs';
|
|
79
79
|
export { CommonProps, DefaultProps, useCascaderConfig } from './cascader-panel/src/config.mjs';
|
|
80
80
|
export { colProps } from './col/src/col.mjs';
|
|
81
81
|
export { configProviderProps } from './config-provider/src/config-provider.mjs';
|
|
82
82
|
export { useDialog } from './dialog/src/use-dialog.mjs';
|
|
83
83
|
export { dialogProps } from './dialog/src/dialog.mjs';
|
|
84
|
-
export { dividerProps } from './divider/src/
|
|
85
|
-
export { emptyProps } from './empty/src/
|
|
86
|
-
export { iconProps } from './icon/src/
|
|
84
|
+
export { dividerProps } from './divider/src/divider.mjs';
|
|
85
|
+
export { emptyProps } from './empty/src/empty.mjs';
|
|
86
|
+
export { iconProps } from './icon/src/icon.mjs';
|
|
87
87
|
export { imageEmits, imageProps } from './image/src/image.mjs';
|
|
88
|
-
export { imageViewerProps } from './image-viewer/src/image-
|
|
89
|
-
export { inputProps } from './input/src/
|
|
88
|
+
export { imageViewerProps } from './image-viewer/src/image-viewer.mjs';
|
|
89
|
+
export { inputProps } from './input/src/input.mjs';
|
|
90
90
|
export { inputNumberProps } from './input-number/src/input-number.mjs';
|
|
91
91
|
export { linkProps } from './link/src/link.mjs';
|
|
92
92
|
export { menuEmits, menuProps } from './menu/src/menu.mjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { withInstall } from '../../utils/with-install.mjs';
|
|
2
|
-
import './src/
|
|
3
|
-
export { inputProps } from './src/
|
|
2
|
+
import './src/input2.mjs';
|
|
3
|
+
export { inputProps } from './src/input.mjs';
|
|
4
4
|
import script from './src/input.vue_vue&type=script&lang.mjs';
|
|
5
5
|
|
|
6
6
|
const PsInput = withInstall(script);
|