element-ps 1.0.3 → 1.0.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.full.js +281 -211
- package/dist/index.full.min.js +4 -4
- package/dist/index.full.min.js.map +1 -1
- package/dist/index.full.min.mjs +4 -4
- package/dist/index.full.min.mjs.map +1 -1
- package/dist/index.full.mjs +282 -212
- package/es/components/button/index.d.ts +4 -0
- package/es/components/button/src/button.d.ts +1 -0
- package/es/components/button/src/button.vue.d.ts +4 -0
- package/es/components/cascader/index.d.ts +18 -2
- package/es/components/cascader/src/index.vue.d.ts +9 -1
- package/es/components/color-picker/index.d.ts +2 -2
- package/es/components/color-picker/src/index.vue.d.ts +1 -1
- package/es/components/input/index.d.ts +4 -0
- package/es/components/input/src/input.d.ts +1 -0
- package/es/components/input/src/input.vue.d.ts +4 -0
- package/es/components/table/index.d.ts +2 -2
- package/es/components/table/src/table-column/index.d.ts +1 -1
- package/es/index.mjs +3 -3
- package/es/packages/components/avatar/index.mjs +2 -2
- package/es/packages/components/avatar/src/avatar.mjs +5 -29
- package/es/packages/components/avatar/src/avatar.mjs.map +1 -1
- package/es/packages/components/avatar/src/avatar.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/avatar/src/avatar2.mjs +29 -5
- package/es/packages/components/avatar/src/avatar2.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/button/index.mjs +1 -1
- package/es/packages/components/button/src/button-group.mjs +5 -7
- package/es/packages/components/button/src/button-group.mjs.map +1 -1
- package/es/packages/components/button/src/button-group.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/button/src/button-group2.mjs +7 -5
- package/es/packages/components/button/src/button-group2.mjs.map +1 -1
- package/es/packages/components/button/src/button.mjs +1 -0
- package/es/packages/components/button/src/button.mjs.map +1 -1
- package/es/packages/components/button/src/button.vue_vue&type=script&lang.mjs +39 -0
- package/es/packages/components/button/src/button.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.mjs +4 -3
- package/es/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.mjs.map +1 -1
- package/es/packages/components/form/src/form-item.vue_vue&type=script&lang.mjs +1 -5
- 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.map +1 -1
- package/es/packages/components/image/index.mjs +2 -2
- package/es/packages/components/image/src/image.mjs +44 -5
- package/es/packages/components/image/src/image.mjs.map +1 -1
- package/es/packages/components/image/src/image.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/image/src/image2.mjs +5 -44
- package/es/packages/components/image/src/image2.mjs.map +1 -1
- package/es/packages/components/index.mjs +3 -3
- package/es/packages/components/input/src/input.mjs +3 -0
- package/es/packages/components/input/src/input.mjs.map +1 -1
- package/es/packages/components/input/src/input.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/input/src/input.vue_vue&type=template&id=3290dcb6&lang.mjs +26 -24
- package/es/packages/components/input/src/input.vue_vue&type=template&id=3290dcb6&lang.mjs.map +1 -1
- package/es/plugin.d.ts +9 -1
- package/es/plugin.mjs +2 -0
- package/es/plugin.mjs.map +1 -1
- package/es/version.d.ts +1 -1
- package/es/version.mjs +1 -1
- package/es/version.mjs.map +1 -1
- package/lib/components/button/index.d.ts +4 -0
- package/lib/components/button/src/button.d.ts +1 -0
- package/lib/components/button/src/button.vue.d.ts +4 -0
- package/lib/components/cascader/index.d.ts +18 -2
- package/lib/components/cascader/src/index.vue.d.ts +9 -1
- package/lib/components/color-picker/index.d.ts +2 -2
- package/lib/components/color-picker/src/index.vue.d.ts +1 -1
- package/lib/components/input/index.d.ts +4 -0
- package/lib/components/input/src/input.d.ts +1 -0
- package/lib/components/input/src/input.vue.d.ts +4 -0
- package/lib/components/table/index.d.ts +2 -2
- package/lib/components/table/src/table-column/index.d.ts +1 -1
- package/lib/index.js +3 -3
- package/lib/packages/components/avatar/index.js +2 -2
- package/lib/packages/components/avatar/src/avatar.js +5 -28
- package/lib/packages/components/avatar/src/avatar.js.map +1 -1
- package/lib/packages/components/avatar/src/avatar.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/avatar/src/avatar2.js +28 -5
- package/lib/packages/components/avatar/src/avatar2.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/button/index.js +1 -1
- package/lib/packages/components/button/src/button-group.js +5 -6
- package/lib/packages/components/button/src/button-group.js.map +1 -1
- package/lib/packages/components/button/src/button-group.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/button/src/button-group2.js +6 -5
- package/lib/packages/components/button/src/button-group2.js.map +1 -1
- package/lib/packages/components/button/src/button.js +1 -0
- package/lib/packages/components/button/src/button.js.map +1 -1
- package/lib/packages/components/button/src/button.vue_vue&type=script&lang.js +39 -0
- package/lib/packages/components/button/src/button.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.js +3 -2
- package/lib/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.js.map +1 -1
- package/lib/packages/components/form/src/form-item.vue_vue&type=script&lang.js +0 -4
- 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.map +1 -1
- package/lib/packages/components/image/index.js +2 -2
- package/lib/packages/components/image/src/image.js +44 -5
- package/lib/packages/components/image/src/image.js.map +1 -1
- package/lib/packages/components/image/src/image.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/image/src/image2.js +5 -44
- package/lib/packages/components/image/src/image2.js.map +1 -1
- package/lib/packages/components/index.js +3 -3
- package/lib/packages/components/input/src/input.js +3 -0
- package/lib/packages/components/input/src/input.js.map +1 -1
- package/lib/packages/components/input/src/input.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/input/src/input.vue_vue&type=template&id=3290dcb6&lang.js +26 -24
- package/lib/packages/components/input/src/input.vue_vue&type=template&id=3290dcb6&lang.js.map +1 -1
- package/lib/plugin.d.ts +9 -1
- package/lib/plugin.js +4 -2
- package/lib/plugin.js.map +1 -1
- package/lib/version.d.ts +1 -1
- package/lib/version.js +1 -1
- package/lib/version.js.map +1 -1
- package/package.json +1 -1
- package/web-types.json +1 -1
|
@@ -105,8 +105,8 @@ declare const _default: import("vue").DefineComponent<{
|
|
|
105
105
|
fixed?: string | boolean | undefined;
|
|
106
106
|
filters?: import("./defaults").Filters | undefined;
|
|
107
107
|
label?: string | undefined;
|
|
108
|
-
filterMethod?: import("./defaults").FilterMethods<any> | undefined;
|
|
109
108
|
widget?: string | undefined;
|
|
109
|
+
filterMethod?: import("./defaults").FilterMethods<any> | undefined;
|
|
110
110
|
index?: number | ((index: number) => number) | undefined;
|
|
111
111
|
align?: string | undefined;
|
|
112
112
|
className?: string | undefined;
|
package/lib/index.js
CHANGED
|
@@ -12,11 +12,11 @@ var index = require('./packages/components/affix/index.js');
|
|
|
12
12
|
var alert = require('./packages/components/alert/src/alert.js');
|
|
13
13
|
var index$1 = require('./packages/components/alert/index.js');
|
|
14
14
|
var index$2 = require('./packages/components/autocomplete/index.js');
|
|
15
|
-
var avatar = require('./packages/components/avatar/src/
|
|
15
|
+
var avatar = require('./packages/components/avatar/src/avatar2.js');
|
|
16
16
|
var index$3 = require('./packages/components/avatar/index.js');
|
|
17
17
|
var backtop = require('./packages/components/backtop/src/backtop.js');
|
|
18
18
|
var index$4 = require('./packages/components/backtop/index.js');
|
|
19
|
-
var badge = require('./packages/components/badge/src/
|
|
19
|
+
var badge = require('./packages/components/badge/src/badge.js');
|
|
20
20
|
var index$5 = require('./packages/components/badge/index.js');
|
|
21
21
|
var breadcrumb = require('./packages/components/breadcrumb/src/breadcrumb.js');
|
|
22
22
|
var breadcrumbItem = require('./packages/components/breadcrumb/src/breadcrumb-item.js');
|
|
@@ -54,7 +54,7 @@ var index$q = require('./packages/components/empty/index.js');
|
|
|
54
54
|
var index$r = require('./packages/components/form/index.js');
|
|
55
55
|
var icon = require('./packages/components/icon/src/icon.js');
|
|
56
56
|
var index$s = require('./packages/components/icon/index.js');
|
|
57
|
-
var image = require('./packages/components/image/src/
|
|
57
|
+
var image = require('./packages/components/image/src/image.js');
|
|
58
58
|
var index$t = require('./packages/components/image/index.js');
|
|
59
59
|
var imageViewer = require('./packages/components/image-viewer/src/image-viewer.js');
|
|
60
60
|
var index$u = require('./packages/components/image-viewer/index.js');
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var withInstall = require('../../utils/with-install.js');
|
|
6
|
-
require('./src/
|
|
7
|
-
var avatar = require('./src/
|
|
6
|
+
require('./src/avatar.js');
|
|
7
|
+
var avatar = require('./src/avatar2.js');
|
|
8
8
|
var avatar_vue_vue_type_script_lang = require('./src/avatar.vue_vue&type=script&lang.js');
|
|
9
9
|
|
|
10
10
|
const PsAvatar = withInstall.withInstall(avatar_vue_vue_type_script_lang["default"]);
|
|
@@ -2,34 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var avatar_vue_vue_type_script_lang = require('./avatar.vue_vue&type=script&lang.js');
|
|
6
|
+
var avatar_vue_vue_type_template_id_46e3f365_lang = require('./avatar.vue_vue&type=template&id=46e3f365&lang.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type: [Number, String],
|
|
10
|
-
values: ["large", "medium", "small"],
|
|
11
|
-
default: "large",
|
|
12
|
-
validator: (val) => typeof val === "number"
|
|
13
|
-
},
|
|
14
|
-
shape: {
|
|
15
|
-
type: String,
|
|
16
|
-
values: ["circle", "square"],
|
|
17
|
-
default: "circle"
|
|
18
|
-
},
|
|
19
|
-
icon: {
|
|
20
|
-
type: props.definePropType([String, Object])
|
|
21
|
-
},
|
|
22
|
-
src: {
|
|
23
|
-
type: String,
|
|
24
|
-
default: ""
|
|
25
|
-
},
|
|
26
|
-
alt: String,
|
|
27
|
-
srcSet: String,
|
|
28
|
-
fit: {
|
|
29
|
-
type: props.definePropType(String),
|
|
30
|
-
default: "cover"
|
|
31
|
-
}
|
|
32
|
-
});
|
|
8
|
+
avatar_vue_vue_type_script_lang["default"].render = avatar_vue_vue_type_template_id_46e3f365_lang.render;
|
|
9
|
+
avatar_vue_vue_type_script_lang["default"].__file = "packages/components/avatar/src/avatar.vue";
|
|
33
10
|
|
|
34
|
-
exports
|
|
11
|
+
exports["default"] = avatar_vue_vue_type_script_lang["default"];
|
|
35
12
|
//# sourceMappingURL=avatar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar.js","sources":[
|
|
1
|
+
{"version":3,"file":"avatar.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
var index = require('../../icon/index.js');
|
|
7
|
-
var avatar = require('./
|
|
7
|
+
var avatar = require('./avatar2.js');
|
|
8
8
|
|
|
9
9
|
var script = vue.defineComponent({
|
|
10
10
|
name: "PsAvatar",
|
|
@@ -2,11 +2,34 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var avatar_vue_vue_type_template_id_46e3f365_lang = require('./avatar.vue_vue&type=template&id=46e3f365&lang.js');
|
|
5
|
+
var props = require('../../../utils/props.js');
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const avatarProps = props.buildProps({
|
|
8
|
+
size: {
|
|
9
|
+
type: [Number, String],
|
|
10
|
+
values: ["large", "medium", "small"],
|
|
11
|
+
default: "large",
|
|
12
|
+
validator: (val) => typeof val === "number"
|
|
13
|
+
},
|
|
14
|
+
shape: {
|
|
15
|
+
type: String,
|
|
16
|
+
values: ["circle", "square"],
|
|
17
|
+
default: "circle"
|
|
18
|
+
},
|
|
19
|
+
icon: {
|
|
20
|
+
type: props.definePropType([String, Object])
|
|
21
|
+
},
|
|
22
|
+
src: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: ""
|
|
25
|
+
},
|
|
26
|
+
alt: String,
|
|
27
|
+
srcSet: String,
|
|
28
|
+
fit: {
|
|
29
|
+
type: props.definePropType(String),
|
|
30
|
+
default: "cover"
|
|
31
|
+
}
|
|
32
|
+
});
|
|
10
33
|
|
|
11
|
-
exports
|
|
34
|
+
exports.avatarProps = avatarProps;
|
|
12
35
|
//# sourceMappingURL=avatar2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"avatar2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"avatar2.js","sources":["../../../../../../../packages/components/avatar/src/avatar.ts"],"sourcesContent":["import { buildProps, definePropType } from '@element-ps/utils/props'\nimport type { ExtractPropTypes, Component } from 'vue'\nimport type { ObjectFitProperty } from 'csstype'\n\nexport const avatarProps = buildProps({\n size: {\n type: [Number, String],\n values: ['large', 'medium', 'small'],\n default: 'large',\n validator: (val: unknown): val is number => typeof val === 'number',\n },\n shape: {\n type: String,\n values: ['circle', 'square'],\n default: 'circle',\n },\n icon: {\n type: definePropType<string | Component>([String, Object]),\n },\n src: {\n type: String,\n default: '',\n },\n alt: String,\n srcSet: String,\n fit: {\n type: definePropType<ObjectFitProperty>(String),\n default: 'cover',\n },\n} as const)\nexport type AvatarProps = ExtractPropTypes<typeof avatarProps>\n"],"names":["buildProps","definePropType"],"mappings":";;;;;;MAIa,cAAcA,iBAAW;AAAA,EACpC,MAAM;AAAA,IACJ,MAAM,CAAC,QAAQ;AAAA,IACf,QAAQ,CAAC,SAAS,UAAU;AAAA,IAC5B,SAAS;AAAA,IACT,WAAW,CAAC,QAAgC,OAAO,QAAQ;AAAA;AAAA,EAE7D,OAAO;AAAA,IACL,MAAM;AAAA,IACN,QAAQ,CAAC,UAAU;AAAA,IACnB,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,IACJ,MAAMC,qBAAmC,CAAC,QAAQ;AAAA;AAAA,EAEpD,KAAK;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,EACL,QAAQ;AAAA,EACR,KAAK;AAAA,IACH,MAAMA,qBAAkC;AAAA,IACxC,SAAS;AAAA;AAAA;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var withInstall = require('../../utils/with-install.js');
|
|
6
|
-
require('./src/
|
|
7
|
-
var badge = require('./src/
|
|
6
|
+
require('./src/badge2.js');
|
|
7
|
+
var badge = require('./src/badge.js');
|
|
8
8
|
var badge_vue_vue_type_script_lang = require('./src/badge.vue_vue&type=script&lang.js');
|
|
9
9
|
|
|
10
10
|
const PsBadge = withInstall.withInstall(badge_vue_vue_type_script_lang["default"]);
|
|
@@ -2,11 +2,25 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var badge_vue_vue_type_template_id_020a5517_lang = require('./badge.vue_vue&type=template&id=020a5517&lang.js');
|
|
5
|
+
var props = require('../../../utils/props.js');
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const badgeProps = props.buildProps({
|
|
8
|
+
value: {
|
|
9
|
+
type: [String, Number],
|
|
10
|
+
default: ""
|
|
11
|
+
},
|
|
12
|
+
max: {
|
|
13
|
+
type: Number,
|
|
14
|
+
default: 99
|
|
15
|
+
},
|
|
16
|
+
isDot: Boolean,
|
|
17
|
+
hidden: Boolean,
|
|
18
|
+
type: {
|
|
19
|
+
type: String,
|
|
20
|
+
values: ["primary", "success", "warning", "info", "danger"],
|
|
21
|
+
default: "danger"
|
|
22
|
+
}
|
|
23
|
+
});
|
|
10
24
|
|
|
11
|
-
exports
|
|
25
|
+
exports.badgeProps = badgeProps;
|
|
12
26
|
//# sourceMappingURL=badge.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"badge.js","sources":["../../../../../../../packages/components/badge/src/badge.ts"],"sourcesContent":["import { buildProps } from '@element-ps/utils/props'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const badgeProps = buildProps({\n value: {\n type: [String, Number],\n default: '',\n },\n max: {\n type: Number,\n default: 99,\n },\n isDot: Boolean,\n hidden: Boolean,\n type: {\n type: String,\n values: ['primary', 'success', 'warning', 'info', 'danger'],\n default: 'danger',\n },\n} as const)\nexport type BadgeProps = ExtractPropTypes<typeof badgeProps>\n"],"names":["buildProps"],"mappings":";;;;;;MAIa,aAAaA,iBAAW;AAAA,EACnC,OAAO;AAAA,IACL,MAAM,CAAC,QAAQ;AAAA,IACf,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ,CAAC,WAAW,WAAW,WAAW,QAAQ;AAAA,IAClD,SAAS;AAAA;AAAA;;;;"}
|
|
@@ -2,25 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var badge_vue_vue_type_script_lang = require('./badge.vue_vue&type=script&lang.js');
|
|
6
|
+
var badge_vue_vue_type_template_id_020a5517_lang = require('./badge.vue_vue&type=template&id=020a5517&lang.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type: [String, Number],
|
|
10
|
-
default: ""
|
|
11
|
-
},
|
|
12
|
-
max: {
|
|
13
|
-
type: Number,
|
|
14
|
-
default: 99
|
|
15
|
-
},
|
|
16
|
-
isDot: Boolean,
|
|
17
|
-
hidden: Boolean,
|
|
18
|
-
type: {
|
|
19
|
-
type: String,
|
|
20
|
-
values: ["primary", "success", "warning", "info", "danger"],
|
|
21
|
-
default: "danger"
|
|
22
|
-
}
|
|
23
|
-
});
|
|
8
|
+
badge_vue_vue_type_script_lang["default"].render = badge_vue_vue_type_template_id_020a5517_lang.render;
|
|
9
|
+
badge_vue_vue_type_script_lang["default"].__file = "packages/components/badge/src/badge.vue";
|
|
24
10
|
|
|
25
|
-
exports
|
|
11
|
+
exports["default"] = badge_vue_vue_type_script_lang["default"];
|
|
26
12
|
//# sourceMappingURL=badge2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"badge2.js","sources":[
|
|
1
|
+
{"version":3,"file":"badge2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var withInstall = require('../../utils/with-install.js');
|
|
6
6
|
require('./src/button2.js');
|
|
7
|
-
require('./src/button-
|
|
7
|
+
require('./src/button-group.js');
|
|
8
8
|
var button = require('./src/button.js');
|
|
9
9
|
var button_vue_vue_type_script_lang = require('./src/button.vue_vue&type=script&lang.js');
|
|
10
10
|
var buttonGroup_vue_vue_type_script_lang = require('./src/button-group.vue_vue&type=script&lang.js');
|
|
@@ -2,12 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var buttonGroup_vue_vue_type_script_lang = require('./button-group.vue_vue&type=script&lang.js');
|
|
6
|
+
var buttonGroup_vue_vue_type_template_id_1bab7d77_lang = require('./button-group.vue_vue&type=template&id=1bab7d77&lang.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type: button.buttonProps.type
|
|
10
|
-
};
|
|
8
|
+
buttonGroup_vue_vue_type_script_lang["default"].render = buttonGroup_vue_vue_type_template_id_1bab7d77_lang.render;
|
|
9
|
+
buttonGroup_vue_vue_type_script_lang["default"].__file = "packages/components/button/src/button-group.vue";
|
|
11
10
|
|
|
12
|
-
exports
|
|
11
|
+
exports["default"] = buttonGroup_vue_vue_type_script_lang["default"];
|
|
13
12
|
//# sourceMappingURL=button-group.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group.js","sources":[
|
|
1
|
+
{"version":3,"file":"button-group.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
6
|
require('../../../tokens/index.js');
|
|
7
|
-
var buttonGroup = require('./button-
|
|
7
|
+
var buttonGroup = require('./button-group2.js');
|
|
8
8
|
var button = require('../../../tokens/button.js');
|
|
9
9
|
|
|
10
10
|
var script = vue.defineComponent({
|
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var buttonGroup_vue_vue_type_template_id_1bab7d77_lang = require('./button-group.vue_vue&type=template&id=1bab7d77&lang.js');
|
|
5
|
+
var button = require('./button.js');
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const buttonGroupProps = {
|
|
8
|
+
size: button.buttonProps.size,
|
|
9
|
+
type: button.buttonProps.type
|
|
10
|
+
};
|
|
10
11
|
|
|
11
|
-
exports
|
|
12
|
+
exports.buttonGroupProps = buttonGroupProps;
|
|
12
13
|
//# sourceMappingURL=button-group2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button-group2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"button-group2.js","sources":["../../../../../../../packages/components/button/src/button-group.ts"],"sourcesContent":["import { buttonProps } from './button'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const buttonGroupProps = {\n size: buttonProps.size,\n type: buttonProps.type,\n} as const\nexport type ButtonGroupProps = ExtractPropTypes<typeof buttonGroupProps>\n"],"names":["buttonProps"],"mappings":";;;;;;MAIa,mBAAmB;AAAA,EAC9B,MAAMA,mBAAY;AAAA,EAClB,MAAMA,mBAAY;AAAA;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.js","sources":["../../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useFormItemProps } from '@element-ps/hooks'\nimport { buildProps, definePropType } from '@element-ps/utils/props'\nimport type { ExtractPropTypes, Component } from 'vue'\n\nexport const buttonType = [\n 'default',\n 'primary',\n 'success',\n 'warning',\n 'info',\n 'danger',\n 'text',\n '',\n] as const\nexport const buttonSize = ['', 'large', 'medium', 'small', 'mini'] as const\nexport const buttonNativeType = ['button', 'submit', 'reset'] as const\n\nexport const buttonProps = buildProps({\n ...useFormItemProps,\n type: {\n type: String,\n values: buttonType,\n default: '',\n },\n icon: {\n type: definePropType<string | Component>([String, Object]),\n default: '',\n },\n nativeType: {\n type: String,\n values: buttonNativeType,\n default: 'button',\n },\n loading: Boolean,\n plain: Boolean,\n autofocus: Boolean,\n round: Boolean,\n circle: Boolean,\n autoInsertSpace: {\n type: Boolean,\n },\n} as const)\n\nexport interface ButtonConfigContext {\n autoInsertSpace?: boolean\n}\n\nexport const buttonEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\n\nexport type ButtonProps = ExtractPropTypes<typeof buttonProps>\nexport type ButtonEmits = typeof buttonEmits\n\nexport type ButtonType = ButtonProps['type']\nexport type ButtonNativeType = ButtonProps['nativeType']\n"],"names":["buildProps","useFormItemProps","definePropType"],"mappings":";;;;;;;;MAIa,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;MAEW,aAAa,CAAC,IAAI,SAAS,UAAU,SAAS;MAC9C,mBAAmB,CAAC,UAAU,UAAU;MAExC,cAAcA,iBAAW;AAAA,KACjCC;AAAA,EACH,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,IACJ,MAAMC,qBAAmC,CAAC,QAAQ;AAAA,IAClD,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,IACV,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA;AAAA,EAEX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,iBAAiB;AAAA,IACf,MAAM;AAAA;AAAA;MAQG,cAAc;AAAA,EACzB,OAAO,CAAC,QAAoB,eAAe;AAAA;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"button.js","sources":["../../../../../../../packages/components/button/src/button.ts"],"sourcesContent":["import { useFormItemProps } from '@element-ps/hooks'\nimport { buildProps, definePropType } from '@element-ps/utils/props'\nimport type { ExtractPropTypes, Component } from 'vue'\n\nexport const buttonType = [\n 'default',\n 'primary',\n 'success',\n 'warning',\n 'info',\n 'danger',\n 'text',\n '',\n] as const\nexport const buttonSize = ['', 'large', 'medium', 'small', 'mini'] as const\nexport const buttonNativeType = ['button', 'submit', 'reset'] as const\n\nexport const buttonProps = buildProps({\n ...useFormItemProps,\n type: {\n type: String,\n values: buttonType,\n default: '',\n },\n icon: {\n type: definePropType<string | Component>([String, Object]),\n default: '',\n },\n nativeType: {\n type: String,\n values: buttonNativeType,\n default: 'button',\n },\n loading: Boolean,\n plain: Boolean,\n autofocus: Boolean,\n round: Boolean,\n circle: Boolean,\n color: String,\n autoInsertSpace: {\n type: Boolean,\n },\n} as const)\n\nexport interface ButtonConfigContext {\n autoInsertSpace?: boolean\n}\n\nexport const buttonEmits = {\n click: (evt: MouseEvent) => evt instanceof MouseEvent,\n}\n\nexport type ButtonProps = ExtractPropTypes<typeof buttonProps>\nexport type ButtonEmits = typeof buttonEmits\n\nexport type ButtonType = ButtonProps['type']\nexport type ButtonNativeType = ButtonProps['nativeType']\n"],"names":["buildProps","useFormItemProps","definePropType"],"mappings":";;;;;;;;MAIa,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA;MAEW,aAAa,CAAC,IAAI,SAAS,UAAU,SAAS;MAC9C,mBAAmB,CAAC,UAAU,UAAU;MAExC,cAAcA,iBAAW;AAAA,KACjCC;AAAA,EACH,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,IACJ,MAAMC,qBAAmC,CAAC,QAAQ;AAAA,IAClD,SAAS;AAAA;AAAA,EAEX,YAAY;AAAA,IACV,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,SAAS;AAAA;AAAA,EAEX,SAAS;AAAA,EACT,OAAO;AAAA,EACP,WAAW;AAAA,EACX,OAAO;AAAA,EACP,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,iBAAiB;AAAA,IACf,MAAM;AAAA;AAAA;MAQG,cAAc;AAAA,EACzB,OAAO,CAAC,QAAoB,eAAe;AAAA;;;;;;;;"}
|
|
@@ -3,10 +3,12 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var vue = require('vue');
|
|
6
|
+
var core = require('@vueuse/core');
|
|
6
7
|
require('../../../hooks/index.js');
|
|
7
8
|
require('../../../tokens/index.js');
|
|
8
9
|
var index = require('../../icon/index.js');
|
|
9
10
|
var icons = require('@element-plus/icons');
|
|
11
|
+
var color = require('../../../utils/color.js');
|
|
10
12
|
var button = require('./button.js');
|
|
11
13
|
var button$1 = require('../../../tokens/button.js');
|
|
12
14
|
var index$1 = require('../../../hooks/use-global-config/index.js');
|
|
@@ -42,7 +44,44 @@ var script = vue.defineComponent({
|
|
|
42
44
|
size: vue.computed(() => elBtnGroup == null ? void 0 : elBtnGroup.size)
|
|
43
45
|
});
|
|
44
46
|
const buttonType = vue.computed(() => props.type || (elBtnGroup == null ? void 0 : elBtnGroup.type) || "default");
|
|
47
|
+
const typeColor = vue.computed(() => core.useCssVar(`--el-color-${props.type}`).value);
|
|
48
|
+
const buttonStyle = vue.computed(() => {
|
|
49
|
+
let styles = {};
|
|
50
|
+
const buttonColor = props.color || typeColor.value;
|
|
51
|
+
if (buttonColor) {
|
|
52
|
+
const darkenBgColor = color.darken(buttonColor, 0.1);
|
|
53
|
+
if (props.plain) {
|
|
54
|
+
styles = {
|
|
55
|
+
"--el-button-bg-color": color.lighten(buttonColor, 0.9),
|
|
56
|
+
"--el-button-text-color": buttonColor,
|
|
57
|
+
"--el-button-hover-text-color": "var(--el-color-white)",
|
|
58
|
+
"--el-button-hover-bg-color": buttonColor,
|
|
59
|
+
"--el-button-hover-border-color": buttonColor,
|
|
60
|
+
"--el-button-active-bg-color": darkenBgColor,
|
|
61
|
+
"--el-button-active-text-color": "var(--el-color-white)",
|
|
62
|
+
"--el-button-active-border-color": darkenBgColor
|
|
63
|
+
};
|
|
64
|
+
} else {
|
|
65
|
+
const lightenBgColor = color.lighten(buttonColor);
|
|
66
|
+
styles = {
|
|
67
|
+
"--el-button-bg-color": buttonColor,
|
|
68
|
+
"--el-button-border-color": buttonColor,
|
|
69
|
+
"--el-button-hover-bg-color": lightenBgColor,
|
|
70
|
+
"--el-button-hover-border-color": lightenBgColor,
|
|
71
|
+
"--el-button-active-bg-color": darkenBgColor,
|
|
72
|
+
"--el-button-active-border-color": darkenBgColor
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
if (buttonDisabled.value) {
|
|
76
|
+
const disabledButtonColor = color.lighten(buttonColor, 0.5);
|
|
77
|
+
styles["--el-button-disabled-bg-color"] = disabledButtonColor;
|
|
78
|
+
styles["--el-button-disabled-border-color"] = disabledButtonColor;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
return styles;
|
|
82
|
+
});
|
|
45
83
|
return {
|
|
84
|
+
buttonStyle,
|
|
46
85
|
buttonSize,
|
|
47
86
|
buttonType,
|
|
48
87
|
buttonDisabled,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n :class=\"[\n 'el-button',\n buttonType ? 'el-button--' + buttonType : '',\n buttonSize ? 'el-button--' + buttonSize : '',\n {\n 'is-disabled': buttonDisabled,\n 'is-loading': loading,\n 'is-plain': plain,\n 'is-round': round,\n 'is-circle': circle,\n },\n ]\"\n :disabled=\"buttonDisabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n >\n <ps-icon v-if=\"loading\" class=\"is-loading\"><loading /></ps-icon>\n <ps-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </ps-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ 'el-button__text--expand': shouldAddSpace }\"\n >\n <slot></slot>\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport { computed, inject, defineComponent } from 'vue'\nimport { useFormItem, useGlobalConfig } from '@element-ps/hooks'\nimport { elButtonGroupKey } from '@element-ps/tokens'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { Loading } from '@element-plus/icons'\
|
|
1
|
+
{"version":3,"file":"button.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/button/src/button.vue"],"sourcesContent":["<template>\n <button\n :class=\"[\n 'el-button',\n buttonType ? 'el-button--' + buttonType : '',\n buttonSize ? 'el-button--' + buttonSize : '',\n {\n 'is-disabled': buttonDisabled,\n 'is-loading': loading,\n 'is-plain': plain,\n 'is-round': round,\n 'is-circle': circle,\n },\n ]\"\n :disabled=\"buttonDisabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n :style=\"buttonStyle\"\n >\n <ps-icon v-if=\"loading\" class=\"is-loading\"><loading /></ps-icon>\n <ps-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </ps-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ 'el-button__text--expand': shouldAddSpace }\"\n >\n <slot></slot>\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport { computed, inject, defineComponent } from 'vue'\nimport { useCssVar } from '@vueuse/core'\nimport { useFormItem, useGlobalConfig } from '@element-ps/hooks'\nimport { elButtonGroupKey } from '@element-ps/tokens'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { Loading } from '@element-plus/icons'\nimport { lighten, darken } from '@element-ps/utils/color'\nimport { buttonProps } from './button'\n\nexport default defineComponent({\n name: 'PsButton',\n components: {\n PsIcon,\n Loading,\n },\n props: buttonProps,\n\n setup(props, { slots }) {\n const elBtnGroup = inject(elButtonGroupKey, undefined)\n const globalConfig = useGlobalConfig()\n const autoInsertSpace = computed(() => {\n return props.autoInsertSpace ?? globalConfig?.button.autoInsertSpace\n })\n\n // add space between two characters in Chinese\n const shouldAddSpace = computed(() => {\n const defaultSlot = slots.default?.()\n if (autoInsertSpace.value && defaultSlot?.length === 1) {\n const slot = defaultSlot[0]\n if (slot?.type === Text) {\n const text = slot.children\n return /^\\p{Unified_Ideograph}{2}$/u.test(text as string)\n }\n }\n return false\n })\n const { size: buttonSize, disabled: buttonDisabled } = useFormItem({\n size: computed(() => elBtnGroup?.size),\n })\n const buttonType = computed(\n () => props.type || elBtnGroup?.type || 'default'\n )\n\n // calculate hover & active color by color\n const typeColor = computed(\n () => useCssVar(`--el-color-${props.type}`).value\n )\n const buttonStyle = computed(() => {\n let styles = {}\n\n const buttonColor = props.color || typeColor.value\n\n if (buttonColor) {\n const darkenBgColor = darken(buttonColor, 0.1)\n if (props.plain) {\n styles = {\n '--el-button-bg-color': lighten(buttonColor, 0.9),\n '--el-button-text-color': buttonColor,\n '--el-button-hover-text-color': 'var(--el-color-white)',\n '--el-button-hover-bg-color': buttonColor,\n '--el-button-hover-border-color': buttonColor,\n '--el-button-active-bg-color': darkenBgColor,\n '--el-button-active-text-color': 'var(--el-color-white)',\n '--el-button-active-border-color': darkenBgColor,\n }\n } else {\n const lightenBgColor = lighten(buttonColor)\n styles = {\n '--el-button-bg-color': buttonColor,\n '--el-button-border-color': buttonColor,\n '--el-button-hover-bg-color': lightenBgColor,\n '--el-button-hover-border-color': lightenBgColor,\n '--el-button-active-bg-color': darkenBgColor,\n '--el-button-active-border-color': darkenBgColor,\n }\n }\n\n if (buttonDisabled.value) {\n const disabledButtonColor = lighten(buttonColor, 0.5)\n styles['--el-button-disabled-bg-color'] = disabledButtonColor\n styles['--el-button-disabled-border-color'] = disabledButtonColor\n }\n }\n\n return styles\n })\n\n return {\n buttonStyle,\n buttonSize,\n buttonType,\n buttonDisabled,\n\n shouldAddSpace,\n }\n },\n})\n</script>\n"],"names":["defineComponent","PsIcon","Loading","buttonProps","inject","elButtonGroupKey","useGlobalConfig","computed","useFormItem","useCssVar","darken","lighten"],"mappings":";;;;;;;;;;;;;;;;AA0CA,aAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,YACVC;AAAA,a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YAAI,eAAe,OAAO;AACxB,gBAAM,sBAAsBA,cAAQ,aAAa;AACjD,iBAAO,mCAAmC;AAC1C,iBAAO,uCAAuC;AAAA;AAAA;AAIlD,aAAO;AAAA;AAGT,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA;AAAA;AAAA;;;;"}
|
|
@@ -23,7 +23,8 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
23
23
|
]),
|
|
24
24
|
disabled: _ctx.buttonDisabled || _ctx.loading,
|
|
25
25
|
autofocus: _ctx.autofocus,
|
|
26
|
-
type: _ctx.nativeType
|
|
26
|
+
type: _ctx.nativeType,
|
|
27
|
+
style: vue.normalizeStyle(_ctx.buttonStyle)
|
|
27
28
|
}, [
|
|
28
29
|
_ctx.loading ? (vue.openBlock(), vue.createBlock(_component_ps_icon, {
|
|
29
30
|
key: 0,
|
|
@@ -45,7 +46,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
45
46
|
}, [
|
|
46
47
|
vue.renderSlot(_ctx.$slots, "default")
|
|
47
48
|
], 2)) : vue.createCommentVNode("v-if", true)
|
|
48
|
-
],
|
|
49
|
+
], 14, _hoisted_1);
|
|
49
50
|
}
|
|
50
51
|
|
|
51
52
|
exports.render = render;
|
package/lib/packages/components/button/src/button.vue_vue&type=template&id=802c5c76&lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"button.vue_vue&type=template&id=802c5c76&lang.js","sources":["../../../../../../../packages/components/button/src/button.vue?vue&type=template&id=802c5c76&lang.js"],"sourcesContent":["<template>\n <button\n :class=\"[\n 'el-button',\n buttonType ? 'el-button--' + buttonType : '',\n buttonSize ? 'el-button--' + buttonSize : '',\n {\n 'is-disabled': buttonDisabled,\n 'is-loading': loading,\n 'is-plain': plain,\n 'is-round': round,\n 'is-circle': circle,\n },\n ]\"\n :disabled=\"buttonDisabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n >\n <ps-icon v-if=\"loading\" class=\"is-loading\"><loading /></ps-icon>\n <ps-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </ps-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ 'el-button__text--expand': shouldAddSpace }\"\n >\n <slot></slot>\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport { computed, inject, defineComponent } from 'vue'\nimport { useFormItem, useGlobalConfig } from '@element-ps/hooks'\nimport { elButtonGroupKey } from '@element-ps/tokens'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { Loading } from '@element-plus/icons'\
|
|
1
|
+
{"version":3,"file":"button.vue_vue&type=template&id=802c5c76&lang.js","sources":["../../../../../../../packages/components/button/src/button.vue?vue&type=template&id=802c5c76&lang.js"],"sourcesContent":["<template>\n <button\n :class=\"[\n 'el-button',\n buttonType ? 'el-button--' + buttonType : '',\n buttonSize ? 'el-button--' + buttonSize : '',\n {\n 'is-disabled': buttonDisabled,\n 'is-loading': loading,\n 'is-plain': plain,\n 'is-round': round,\n 'is-circle': circle,\n },\n ]\"\n :disabled=\"buttonDisabled || loading\"\n :autofocus=\"autofocus\"\n :type=\"nativeType\"\n :style=\"buttonStyle\"\n >\n <ps-icon v-if=\"loading\" class=\"is-loading\"><loading /></ps-icon>\n <ps-icon v-else-if=\"icon\">\n <component :is=\"icon\" />\n </ps-icon>\n <span\n v-if=\"$slots.default\"\n :class=\"{ 'el-button__text--expand': shouldAddSpace }\"\n >\n <slot></slot>\n </span>\n </button>\n</template>\n\n<script lang=\"ts\">\nimport { computed, inject, defineComponent } from 'vue'\nimport { useCssVar } from '@vueuse/core'\nimport { useFormItem, useGlobalConfig } from '@element-ps/hooks'\nimport { elButtonGroupKey } from '@element-ps/tokens'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { Loading } from '@element-plus/icons'\nimport { lighten, darken } from '@element-ps/utils/color'\nimport { buttonProps } from './button'\n\nexport default defineComponent({\n name: 'PsButton',\n components: {\n PsIcon,\n Loading,\n },\n props: buttonProps,\n\n setup(props, { slots }) {\n const elBtnGroup = inject(elButtonGroupKey, undefined)\n const globalConfig = useGlobalConfig()\n const autoInsertSpace = computed(() => {\n return props.autoInsertSpace ?? globalConfig?.button.autoInsertSpace\n })\n\n // add space between two characters in Chinese\n const shouldAddSpace = computed(() => {\n const defaultSlot = slots.default?.()\n if (autoInsertSpace.value && defaultSlot?.length === 1) {\n const slot = defaultSlot[0]\n if (slot?.type === Text) {\n const text = slot.children\n return /^\\p{Unified_Ideograph}{2}$/u.test(text as string)\n }\n }\n return false\n })\n const { size: buttonSize, disabled: buttonDisabled } = useFormItem({\n size: computed(() => elBtnGroup?.size),\n })\n const buttonType = computed(\n () => props.type || elBtnGroup?.type || 'default'\n )\n\n // calculate hover & active color by color\n const typeColor = computed(\n () => useCssVar(`--el-color-${props.type}`).value\n )\n const buttonStyle = computed(() => {\n let styles = {}\n\n const buttonColor = props.color || typeColor.value\n\n if (buttonColor) {\n const darkenBgColor = darken(buttonColor, 0.1)\n if (props.plain) {\n styles = {\n '--el-button-bg-color': lighten(buttonColor, 0.9),\n '--el-button-text-color': buttonColor,\n '--el-button-hover-text-color': 'var(--el-color-white)',\n '--el-button-hover-bg-color': buttonColor,\n '--el-button-hover-border-color': buttonColor,\n '--el-button-active-bg-color': darkenBgColor,\n '--el-button-active-text-color': 'var(--el-color-white)',\n '--el-button-active-border-color': darkenBgColor,\n }\n } else {\n const lightenBgColor = lighten(buttonColor)\n styles = {\n '--el-button-bg-color': buttonColor,\n '--el-button-border-color': buttonColor,\n '--el-button-hover-bg-color': lightenBgColor,\n '--el-button-hover-border-color': lightenBgColor,\n '--el-button-active-bg-color': darkenBgColor,\n '--el-button-active-border-color': darkenBgColor,\n }\n }\n\n if (buttonDisabled.value) {\n const disabledButtonColor = lighten(buttonColor, 0.5)\n styles['--el-button-disabled-bg-color'] = disabledButtonColor\n styles['--el-button-disabled-border-color'] = disabledButtonColor\n }\n }\n\n return styles\n })\n\n return {\n buttonStyle,\n buttonSize,\n buttonType,\n buttonDisabled,\n\n shouldAddSpace,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createBlock","_createVNode","_renderSlot"],"mappings":";;;;;;;;;;0BACEA;IACG;;;;;;;;;;;;IAYA,UAAU,uBAAkB;IAC5B,WAAW;IACX,MAAM;IACN,0BAAO;;IAEO,iCAAfC;;MAAwB,OAAM;AAAA;2BAAa;QAAAC,gBAAW;AAAA;AAAA;UAClC,8BAApBD;2BACE;0BAAAA,4CAAgB;;;;IAGV,YAAO,4BADfD;;MAEG,uDAAoC;;MAErCG;;;;;;;"}
|
|
@@ -138,14 +138,10 @@ var script = vue.defineComponent({
|
|
|
138
138
|
});
|
|
139
139
|
vue.onMounted(() => {
|
|
140
140
|
if (props.prop) {
|
|
141
|
-
elForm == null ? void 0 : elForm.addField(elFormItem);
|
|
142
141
|
const value = fieldValue.value;
|
|
143
142
|
initialValue = Array.isArray(value) ? [...value] : value;
|
|
144
143
|
}
|
|
145
144
|
});
|
|
146
|
-
vue.onBeforeUnmount(() => {
|
|
147
|
-
elForm == null ? void 0 : elForm.removeField(elFormItem);
|
|
148
|
-
});
|
|
149
145
|
vue.provide(form.elFormItemKey, elFormItem);
|
|
150
146
|
const formItemClass = vue.computed(() => [
|
|
151
147
|
{
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\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\"\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\" :widget=\"widget\">\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 elForm?.addField(elFormItem)\n\n const value = fieldValue.value\n initialValue = Array.isArray(value) ? [...value] : value\n }\n })\n onBeforeUnmount(() => {\n elForm?.removeField(elFormItem)\n })\n\n provide(elFormItemKey, elFormItem)\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":["defineComponent","LabelWrap","isValidComponentSize","useGlobalConfig","inject","elFormKey","ref","getCurrentInstance","computed","addUnit","getPropByPath","reactive","toRefs","elFormItemKey"],"mappings":";;;;;;;;;;;AA8DA,aAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,eAAe;AAAA,EACf,YAAY;AAAA,eACVC;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,WAAWC;AAAA;AAAA,IAEb,QAAQ;AAAA,MACN,MAAM;AAAA;AAAA;AAAA,EAGV,MA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cAAc,cAAc,UAAU;AAAA,QACtC,eAAe,WAAW,SAAS,MAAM;AAAA,QACzC,kBAAkB,OAAO;AAAA;AAAA,MAE3B,UAAU,QAAQ,iBAAiB,UAAU,UAAU;AAAA;AAGzD,UAAM,kBAAkBA,aAAS,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.js","sources":["../../../../../../../packages/components/form/src/form-item.vue"],"sourcesContent":["<template>\n <div ref=\"formItemRef\" class=\"el-form-item\" :class=\"formItemClass\">\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\"\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\" :widget=\"widget\">\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":["defineComponent","LabelWrap","isValidComponentSize","useGlobalConfig","inject","elFormKey","ref","getCurrentInstance","computed","addUnit","getPropByPath","reactive","toRefs","elFormItemKey"],"mappings":";;;;;;;;;;;AA8DA,aAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,eAAe;AAAA,EACf,YAAY;AAAA,eACVC;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,WAAWC;AAAA;AAAA,IAEb,QAAQ;AAAA,MACN,MAAM;AAAA;AAAA;AAAA,EAGV,MAAM,OAAO,EAAE,SAAS;AACtB,UAAM,WAAWC;AAEjB,UAAM,SAASC,WAAOC,gBAAW;AACjC,UAAM,gBAAgBC,QAAI;AAC1B,UAAM,kBAAkBA,QAAI;AAE5B,UAAM,qBAAqBA,QAAI;AAE/B,UAAM,cAAcA;AAEpB,UAAM,KAAKC;AACX,UAAM,WAAWC,aAAS,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,WAAWA,aAAS,MAAM,MAAM,OAAO,MAAM;AACnD,UAAM,aAAaA,aAAS,MAAM;AAChC,YAAM,MAAqB;AAC3B,UAAI,OAA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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,aAAaC,aAAS;AAAA,SACvBC,WAAO;AAAA,MACV,MAAM;AAAA,MACN,KAAK;AAAA,MACL;AAAA;AAGF,kBAAU,MAAM;AACd,UAAI,MAAM,MAAM;AACd,cAAM,QAAQ,WAAW;AACzB,uBAAgB,MAAM,QAAQ,SAAS,CAAC,GAAG,SAAS;AAAA;AAAA;AAIxD,gBAAQC,oBAAe;AAEvB,UAAM,gBAAgBL,aAAS,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,kBAAkBA,aAAS,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/lib/packages/components/form/src/form-item.vue_vue&type=template&id=24eda48b&lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.js","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 <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\"\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\" :widget=\"widget\">\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
|
|
1
|
+
{"version":3,"file":"form-item.vue_vue&type=template&id=24eda48b&lang.js","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 <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\"\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\" :widget=\"widget\">\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":";;;;;;;;;;0BACEA;IAAK,KAAI;AAAA,IAAc,2BAAM,gBAAuB;;IAClDC;MACG,iBAAe,gBAAW;MAC1B,cAAY,YAAO;;2BAEpB;QACQ,cAAS,YAAO,0BADxBD;;UAEG,KAAK;UACN,OAAM;AAAA,UACL,0BAAO;UACP,QAAQ;;UAETE;YAAoB,OAAO,aAAQ,YAAO;AAAA,aAA1C;oDACK,aAAQ,YAAO;;;;;;IAIxBC;MAAK,OAAM;AAAA,MAAyB,0BAAO;MAAe,QAAQ;;MAChED;MACAD,kCAAY,MAAK;6BACf;UAAY,uBAAZC;;YAA2C,OAAO;aAAlD;YACEC;cACE,2BAAM;;;mCAQH;;;;;;;;;;;"}
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var withInstall = require('../../utils/with-install.js');
|
|
6
|
-
require('./src/
|
|
7
|
-
var image = require('./src/
|
|
6
|
+
require('./src/image2.js');
|
|
7
|
+
var image = require('./src/image.js');
|
|
8
8
|
var image_vue_vue_type_script_lang = require('./src/image.vue_vue&type=script&lang.js');
|
|
9
9
|
|
|
10
10
|
const PsImage = withInstall.withInstall(image_vue_vue_type_script_lang["default"]);
|