element-ps 1.0.13 → 1.0.16
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 +149 -128
- 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 +148 -129
- package/es/components/descriptions/index.d.ts +14 -2
- package/es/components/descriptions/src/description-item.d.ts +7 -1
- package/es/components/descriptions/src/descriptions.type.d.ts +1 -0
- package/es/components/input-number/index.d.ts +2 -0
- package/es/components/input-number/src/input-number.vue.d.ts +2 -0
- package/es/components/rate/index.d.ts +75 -246
- package/es/components/rate/src/rate.d.ts +26 -0
- package/es/components/rate/src/rate.vue.d.ts +108 -0
- package/es/index.mjs +13 -12
- package/es/index.mjs.map +1 -1
- 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/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/backtop/index.mjs +2 -2
- package/es/packages/components/backtop/src/backtop.mjs +5 -19
- 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 +19 -5
- 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 +5 -20
- 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 +20 -5
- package/es/packages/components/badge/src/badge2.mjs.map +1 -1
- package/es/packages/components/button/index.mjs +3 -3
- 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 +46 -5
- package/es/packages/components/button/src/button.mjs.map +1 -1
- package/es/packages/components/button/src/button.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/button/src/button2.mjs +5 -46
- package/es/packages/components/button/src/button2.mjs.map +1 -1
- package/es/packages/components/cascader/src/index.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.mjs +8 -6
- package/es/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.mjs.map +1 -1
- package/es/packages/components/descriptions/src/description-item.mjs +3 -0
- package/es/packages/components/descriptions/src/description-item.mjs.map +1 -1
- package/es/packages/components/descriptions/src/descriptions-cell.mjs +2 -1
- package/es/packages/components/descriptions/src/descriptions-cell.mjs.map +1 -1
- package/es/packages/components/icon/index.mjs +2 -2
- package/es/packages/components/icon/src/icon.mjs +5 -11
- 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 +11 -5
- 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 +5 -25
- 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 +25 -5
- package/es/packages/components/image-viewer/src/image-viewer2.mjs.map +1 -1
- package/es/packages/components/index.mjs +13 -12
- package/es/packages/components/index.mjs.map +1 -1
- package/es/packages/components/input/index.mjs +2 -2
- package/es/packages/components/input/src/input.mjs +5 -79
- 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 +79 -5
- package/es/packages/components/input/src/input2.mjs.map +1 -1
- package/es/packages/components/input-number/index.mjs +2 -2
- package/es/packages/components/input-number/src/input-number.mjs +5 -49
- package/es/packages/components/input-number/src/input-number.mjs.map +1 -1
- package/es/packages/components/input-number/src/input-number.vue_vue&type=script&lang.mjs +5 -3
- package/es/packages/components/input-number/src/input-number.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/input-number/src/input-number.vue_vue&type=template&id=dec60af6&lang.mjs.map +1 -1
- package/es/packages/components/input-number/src/input-number2.mjs +49 -5
- package/es/packages/components/input-number/src/input-number2.mjs.map +1 -1
- package/es/packages/components/link/index.mjs +2 -2
- package/es/packages/components/link/src/link.mjs +5 -20
- package/es/packages/components/link/src/link.mjs.map +1 -1
- package/es/packages/components/link/src/link.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/link/src/link2.mjs +20 -5
- package/es/packages/components/link/src/link2.mjs.map +1 -1
- package/es/packages/components/menu/index.mjs +2 -2
- package/es/packages/components/menu/src/menu-item-group.mjs +5 -4
- package/es/packages/components/menu/src/menu-item-group.mjs.map +1 -1
- package/es/packages/components/menu/src/menu-item-group.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/menu/src/menu-item-group2.mjs +4 -5
- package/es/packages/components/menu/src/menu-item-group2.mjs.map +1 -1
- package/es/packages/components/popconfirm/src/popconfirm.mjs +1 -1
- package/es/packages/components/rate/index.mjs +6 -8
- package/es/packages/components/rate/index.mjs.map +1 -1
- package/es/packages/components/rate/src/rate.mjs +87 -0
- package/es/packages/components/rate/src/rate.mjs.map +1 -0
- package/es/packages/components/rate/src/{index.vue_vue&type=script&lang.mjs → rate.vue_vue&type=script&lang.mjs} +19 -88
- package/es/packages/components/rate/src/rate.vue_vue&type=script&lang.mjs.map +1 -0
- package/es/packages/components/rate/src/{index.vue_vue&type=template&id=55b4fa7d&lang.mjs → rate.vue_vue&type=template&id=38c42df6&lang.mjs} +1 -1
- package/es/packages/components/rate/src/rate.vue_vue&type=template&id=38c42df6&lang.mjs.map +1 -0
- package/es/packages/components/rate/src/rate2.mjs +7 -0
- package/es/packages/components/rate/src/rate2.mjs.map +1 -0
- package/es/packages/components/table/src/table.vue_vue&type=script&lang.mjs.map +1 -1
- package/es/packages/components/table/src/table.vue_vue&type=template&id=4a1660ad&lang.mjs +8 -4
- package/es/packages/components/table/src/table.vue_vue&type=template&id=4a1660ad&lang.mjs.map +1 -1
- package/es/packages/components/tag/index.mjs +2 -2
- package/es/packages/components/tag/src/tag.mjs +5 -26
- package/es/packages/components/tag/src/tag.mjs.map +1 -1
- package/es/packages/components/tag/src/tag.vue_vue&type=script&lang.mjs +1 -1
- package/es/packages/components/tag/src/tag2.mjs +26 -5
- package/es/packages/components/tag/src/tag2.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/descriptions/index.d.ts +14 -2
- package/lib/components/descriptions/src/description-item.d.ts +7 -1
- package/lib/components/descriptions/src/descriptions.type.d.ts +1 -0
- package/lib/components/input-number/index.d.ts +2 -0
- package/lib/components/input-number/src/input-number.vue.d.ts +2 -0
- package/lib/components/rate/index.d.ts +75 -246
- package/lib/components/rate/src/rate.d.ts +26 -0
- package/lib/components/rate/src/rate.vue.d.ts +108 -0
- package/lib/index.js +15 -12
- package/lib/index.js.map +1 -1
- 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/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/backtop/index.js +2 -2
- package/lib/packages/components/backtop/src/backtop.js +6 -19
- 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 +19 -6
- 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 +5 -19
- 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 +19 -5
- package/lib/packages/components/badge/src/badge2.js.map +1 -1
- package/lib/packages/components/button/index.js +3 -3
- 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 +49 -5
- package/lib/packages/components/button/src/button.js.map +1 -1
- package/lib/packages/components/button/src/button.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/button/src/button2.js +5 -49
- package/lib/packages/components/button/src/button2.js.map +1 -1
- package/lib/packages/components/cascader/src/index.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.js +8 -6
- package/lib/packages/components/cascader/src/index.vue_vue&type=template&id=0429c2db&lang.js.map +1 -1
- package/lib/packages/components/descriptions/src/description-item.js +3 -0
- package/lib/packages/components/descriptions/src/description-item.js.map +1 -1
- package/lib/packages/components/descriptions/src/descriptions-cell.js +2 -1
- package/lib/packages/components/descriptions/src/descriptions-cell.js.map +1 -1
- package/lib/packages/components/icon/index.js +2 -2
- package/lib/packages/components/icon/src/icon.js +5 -10
- 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 +10 -5
- 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 +5 -24
- 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 +24 -5
- package/lib/packages/components/image-viewer/src/image-viewer2.js.map +1 -1
- package/lib/packages/components/index.js +15 -12
- package/lib/packages/components/index.js.map +1 -1
- package/lib/packages/components/input/index.js +2 -2
- package/lib/packages/components/input/src/input.js +5 -78
- 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 +78 -5
- package/lib/packages/components/input/src/input2.js.map +1 -1
- package/lib/packages/components/input-number/index.js +2 -2
- package/lib/packages/components/input-number/src/input-number.js +5 -48
- package/lib/packages/components/input-number/src/input-number.js.map +1 -1
- package/lib/packages/components/input-number/src/input-number.vue_vue&type=script&lang.js +5 -3
- package/lib/packages/components/input-number/src/input-number.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/input-number/src/input-number.vue_vue&type=template&id=dec60af6&lang.js.map +1 -1
- package/lib/packages/components/input-number/src/input-number2.js +48 -5
- package/lib/packages/components/input-number/src/input-number2.js.map +1 -1
- package/lib/packages/components/link/index.js +2 -2
- package/lib/packages/components/link/src/link.js +5 -19
- package/lib/packages/components/link/src/link.js.map +1 -1
- package/lib/packages/components/link/src/link.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/link/src/link2.js +19 -5
- package/lib/packages/components/link/src/link2.js.map +1 -1
- package/lib/packages/components/menu/index.js +2 -2
- package/lib/packages/components/menu/src/menu-item-group.js +6 -4
- package/lib/packages/components/menu/src/menu-item-group.js.map +1 -1
- package/lib/packages/components/menu/src/menu-item-group.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/menu/src/menu-item-group2.js +4 -6
- package/lib/packages/components/menu/src/menu-item-group2.js.map +1 -1
- package/lib/packages/components/popconfirm/src/popconfirm.js +1 -1
- package/lib/packages/components/rate/index.js +8 -8
- package/lib/packages/components/rate/index.js.map +1 -1
- package/lib/packages/components/rate/src/rate.js +92 -0
- package/lib/packages/components/rate/src/rate.js.map +1 -0
- package/lib/packages/components/rate/src/{index.vue_vue&type=script&lang.js → rate.vue_vue&type=script&lang.js} +19 -88
- package/lib/packages/components/rate/src/rate.vue_vue&type=script&lang.js.map +1 -0
- package/lib/packages/components/rate/src/{index.vue_vue&type=template&id=55b4fa7d&lang.js → rate.vue_vue&type=template&id=38c42df6&lang.js} +1 -1
- package/lib/packages/components/rate/src/rate.vue_vue&type=template&id=38c42df6&lang.js.map +1 -0
- package/lib/packages/components/rate/src/rate2.js +12 -0
- package/lib/packages/components/rate/src/rate2.js.map +1 -0
- package/lib/packages/components/table/src/table.vue_vue&type=script&lang.js.map +1 -1
- package/lib/packages/components/table/src/table.vue_vue&type=template&id=4a1660ad&lang.js +8 -4
- package/lib/packages/components/table/src/table.vue_vue&type=template&id=4a1660ad&lang.js.map +1 -1
- package/lib/packages/components/tag/index.js +2 -2
- package/lib/packages/components/tag/src/tag.js +5 -25
- package/lib/packages/components/tag/src/tag.js.map +1 -1
- package/lib/packages/components/tag/src/tag.vue_vue&type=script&lang.js +1 -1
- package/lib/packages/components/tag/src/tag2.js +25 -5
- package/lib/packages/components/tag/src/tag2.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
- package/es/components/rate/src/index.vue.d.ts +0 -141
- package/es/packages/components/rate/src/index.mjs +0 -7
- package/es/packages/components/rate/src/index.mjs.map +0 -1
- package/es/packages/components/rate/src/index.vue_vue&type=script&lang.mjs.map +0 -1
- package/es/packages/components/rate/src/index.vue_vue&type=template&id=55b4fa7d&lang.mjs.map +0 -1
- package/lib/components/rate/src/index.vue.d.ts +0 -141
- package/lib/packages/components/rate/src/index.js +0 -12
- package/lib/packages/components/rate/src/index.js.map +0 -1
- package/lib/packages/components/rate/src/index.vue_vue&type=script&lang.js.map +0 -1
- package/lib/packages/components/rate/src/index.vue_vue&type=template&id=55b4fa7d&lang.js.map +0 -1
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var icons = require('@element-plus/icons');
|
|
6
|
+
var constants = require('../../../utils/constants.js');
|
|
7
|
+
var props = require('../../../utils/props.js');
|
|
8
|
+
|
|
9
|
+
const rateProps = props.buildProps({
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: Number,
|
|
12
|
+
default: 0
|
|
13
|
+
},
|
|
14
|
+
lowThreshold: {
|
|
15
|
+
type: Number,
|
|
16
|
+
default: 2
|
|
17
|
+
},
|
|
18
|
+
highThreshold: {
|
|
19
|
+
type: Number,
|
|
20
|
+
default: 4
|
|
21
|
+
},
|
|
22
|
+
max: {
|
|
23
|
+
type: Number,
|
|
24
|
+
default: 5
|
|
25
|
+
},
|
|
26
|
+
colors: {
|
|
27
|
+
type: props.definePropType([Array, Object]),
|
|
28
|
+
default: () => props.mutable(["#F7BA2A", "#F7BA2A", "#F7BA2A"])
|
|
29
|
+
},
|
|
30
|
+
voidColor: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: "#C6D1DE"
|
|
33
|
+
},
|
|
34
|
+
disabledVoidColor: {
|
|
35
|
+
type: String,
|
|
36
|
+
default: "#EFF2F7"
|
|
37
|
+
},
|
|
38
|
+
icons: {
|
|
39
|
+
type: props.definePropType([Array, Object]),
|
|
40
|
+
default: () => [icons.StarFilled, icons.StarFilled, icons.StarFilled]
|
|
41
|
+
},
|
|
42
|
+
voidIcon: {
|
|
43
|
+
type: props.definePropType([String, Object]),
|
|
44
|
+
default: () => icons.Star
|
|
45
|
+
},
|
|
46
|
+
disabledvoidIcon: {
|
|
47
|
+
type: props.definePropType([String, Object]),
|
|
48
|
+
default: () => icons.StarFilled
|
|
49
|
+
},
|
|
50
|
+
disabled: {
|
|
51
|
+
type: Boolean,
|
|
52
|
+
default: false
|
|
53
|
+
},
|
|
54
|
+
allowHalf: {
|
|
55
|
+
type: Boolean,
|
|
56
|
+
default: false
|
|
57
|
+
},
|
|
58
|
+
showText: {
|
|
59
|
+
type: Boolean,
|
|
60
|
+
default: false
|
|
61
|
+
},
|
|
62
|
+
showScore: {
|
|
63
|
+
type: Boolean,
|
|
64
|
+
default: false
|
|
65
|
+
},
|
|
66
|
+
textColor: {
|
|
67
|
+
type: String,
|
|
68
|
+
default: "#1f2d3d"
|
|
69
|
+
},
|
|
70
|
+
texts: {
|
|
71
|
+
type: props.definePropType([Array]),
|
|
72
|
+
default: () => props.mutable([
|
|
73
|
+
"Extremely bad",
|
|
74
|
+
"Disappointed",
|
|
75
|
+
"Fair",
|
|
76
|
+
"Satisfied",
|
|
77
|
+
"Surprise"
|
|
78
|
+
])
|
|
79
|
+
},
|
|
80
|
+
scoreTemplate: {
|
|
81
|
+
type: String,
|
|
82
|
+
default: "{value}"
|
|
83
|
+
}
|
|
84
|
+
});
|
|
85
|
+
const rateEmits = {
|
|
86
|
+
change: (value) => typeof value === "number",
|
|
87
|
+
[constants.UPDATE_MODEL_EVENT]: (value) => typeof value === "number"
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
exports.rateEmits = rateEmits;
|
|
91
|
+
exports.rateProps = rateProps;
|
|
92
|
+
//# sourceMappingURL=rate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate.js","sources":["../../../../../../../packages/components/rate/src/rate.ts"],"sourcesContent":["import { Star, StarFilled } from '@element-plus/icons'\nimport { UPDATE_MODEL_EVENT } from '@element-ps/utils/constants'\nimport { buildProps, definePropType, mutable } from '@element-ps/utils/props'\nimport type { Component, ExtractPropTypes } from 'vue'\n\nexport const rateProps = buildProps({\n modelValue: {\n type: Number,\n default: 0,\n },\n lowThreshold: {\n type: Number,\n default: 2,\n },\n highThreshold: {\n type: Number,\n default: 4,\n },\n max: {\n type: Number,\n default: 5,\n },\n colors: {\n type: definePropType<string[] | Record<number, string>>([Array, Object]),\n default: () => mutable(['#F7BA2A', '#F7BA2A', '#F7BA2A'] as const),\n },\n voidColor: {\n type: String,\n default: '#C6D1DE',\n },\n disabledVoidColor: {\n type: String,\n default: '#EFF2F7',\n },\n icons: {\n type: definePropType<\n Array<string | Component> | Record<number, string | Component>\n >([Array, Object]),\n default: () => [StarFilled, StarFilled, StarFilled],\n },\n voidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => Star,\n },\n disabledvoidIcon: {\n type: definePropType<string | Component>([String, Object]),\n default: () => StarFilled,\n },\n disabled: {\n type: Boolean,\n default: false,\n },\n allowHalf: {\n type: Boolean,\n default: false,\n },\n showText: {\n type: Boolean,\n default: false,\n },\n showScore: {\n type: Boolean,\n default: false,\n },\n textColor: {\n type: String,\n default: '#1f2d3d',\n },\n texts: {\n type: definePropType<string[]>([Array]),\n default: () =>\n mutable([\n 'Extremely bad',\n 'Disappointed',\n 'Fair',\n 'Satisfied',\n 'Surprise',\n ] as const),\n },\n scoreTemplate: {\n type: String,\n default: '{value}',\n },\n} as const)\n\nexport type RateProps = ExtractPropTypes<typeof rateProps>\n\nexport const rateEmits = {\n change: (value: number) => typeof value === 'number',\n [UPDATE_MODEL_EVENT]: (value: number) => typeof value === 'number',\n}\nexport type RateEmits = typeof rateEmits\n"],"names":["buildProps","definePropType","mutable","StarFilled","Star","UPDATE_MODEL_EVENT"],"mappings":";;;;;;;;MAKa,YAAYA,iBAAW;AAAA,EAClC,YAAY;AAAA,IACV,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,cAAc;AAAA,IACZ,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,eAAe;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,IACH,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,QAAQ;AAAA,IACN,MAAMC,qBAAkD,CAAC,OAAO;AAAA,IAChE,SAAS,MAAMC,cAAQ,CAAC,WAAW,WAAW;AAAA;AAAA,EAEhD,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,mBAAmB;AAAA,IACjB,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAMD,qBAEJ,CAAC,OAAO;AAAA,IACV,SAAS,MAAM,CAACE,kBAAYA,kBAAYA;AAAA;AAAA,EAE1C,UAAU;AAAA,IACR,MAAMF,qBAAmC,CAAC,QAAQ;AAAA,IAClD,SAAS,MAAMG;AAAA;AAAA,EAEjB,kBAAkB;AAAA,IAChB,MAAMH,qBAAmC,CAAC,QAAQ;AAAA,IAClD,SAAS,MAAME;AAAA;AAAA,EAEjB,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,UAAU;AAAA,IACR,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,WAAW;AAAA,IACT,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,OAAO;AAAA,IACL,MAAMF,qBAAyB,CAAC;AAAA,IAChC,SAAS,MACPC,cAAQ;AAAA,MACN;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAAA;AAAA,EAGN,eAAe;AAAA,IACb,MAAM;AAAA,IACN,SAAS;AAAA;AAAA;MAMA,YAAY;AAAA,EACvB,QAAQ,CAAC,UAAkB,OAAO,UAAU;AAAA,GAC3CG,+BAAqB,CAAC,UAAkB,OAAO,UAAU;AAAA;;;;;"}
|
|
@@ -7,90 +7,32 @@ var shared = require('@vue/shared');
|
|
|
7
7
|
require('../../../tokens/index.js');
|
|
8
8
|
var index = require('../../icon/index.js');
|
|
9
9
|
var icons = require('@element-plus/icons');
|
|
10
|
+
var rate = require('./rate.js');
|
|
10
11
|
var form = require('../../../tokens/form.js');
|
|
11
12
|
|
|
13
|
+
function getValueFromMap(value, map) {
|
|
14
|
+
const isExcludedObject = (val) => shared.isObject(val);
|
|
15
|
+
const matchedKeys = Object.keys(map).map((key) => +key).filter((key) => {
|
|
16
|
+
const val = map[key];
|
|
17
|
+
const excluded = isExcludedObject(val) ? val.excluded : false;
|
|
18
|
+
return excluded ? value < key : value <= key;
|
|
19
|
+
}).sort((a, b) => a - b);
|
|
20
|
+
const matchedValue = map[matchedKeys[0]];
|
|
21
|
+
return isExcludedObject(matchedValue) && matchedValue.value || matchedValue;
|
|
22
|
+
}
|
|
12
23
|
var script = vue.defineComponent({
|
|
13
24
|
name: "PsRate",
|
|
14
|
-
components: {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
default: 0
|
|
19
|
-
},
|
|
20
|
-
lowThreshold: {
|
|
21
|
-
type: Number,
|
|
22
|
-
default: 2
|
|
23
|
-
},
|
|
24
|
-
highThreshold: {
|
|
25
|
-
type: Number,
|
|
26
|
-
default: 4
|
|
27
|
-
},
|
|
28
|
-
max: {
|
|
29
|
-
type: Number,
|
|
30
|
-
default: 5
|
|
31
|
-
},
|
|
32
|
-
colors: {
|
|
33
|
-
type: [Array, Object],
|
|
34
|
-
default: () => ["#F7BA2A", "#F7BA2A", "#F7BA2A"]
|
|
35
|
-
},
|
|
36
|
-
voidColor: {
|
|
37
|
-
type: String,
|
|
38
|
-
default: "#C6D1DE"
|
|
39
|
-
},
|
|
40
|
-
disabledVoidColor: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: "#EFF2F7"
|
|
43
|
-
},
|
|
44
|
-
icons: {
|
|
45
|
-
type: [Array, Object],
|
|
46
|
-
default: () => [icons.StarFilled, icons.StarFilled, icons.StarFilled]
|
|
47
|
-
},
|
|
48
|
-
voidIcon: {
|
|
49
|
-
type: [String, Object],
|
|
50
|
-
default: icons.Star
|
|
51
|
-
},
|
|
52
|
-
disabledvoidIcon: {
|
|
53
|
-
type: [String, Object],
|
|
54
|
-
default: icons.StarFilled
|
|
55
|
-
},
|
|
56
|
-
disabled: {
|
|
57
|
-
type: Boolean,
|
|
58
|
-
default: false
|
|
59
|
-
},
|
|
60
|
-
allowHalf: {
|
|
61
|
-
type: Boolean,
|
|
62
|
-
default: false
|
|
63
|
-
},
|
|
64
|
-
showText: {
|
|
65
|
-
type: Boolean,
|
|
66
|
-
default: false
|
|
67
|
-
},
|
|
68
|
-
showScore: {
|
|
69
|
-
type: Boolean,
|
|
70
|
-
default: false
|
|
71
|
-
},
|
|
72
|
-
textColor: {
|
|
73
|
-
type: String,
|
|
74
|
-
default: "#1f2d3d"
|
|
75
|
-
},
|
|
76
|
-
texts: {
|
|
77
|
-
type: Array,
|
|
78
|
-
default: () => [
|
|
79
|
-
"Extremely bad",
|
|
80
|
-
"Disappointed",
|
|
81
|
-
"Fair",
|
|
82
|
-
"Satisfied",
|
|
83
|
-
"Surprise"
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
scoreTemplate: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: "{value}"
|
|
89
|
-
}
|
|
25
|
+
components: {
|
|
26
|
+
PsIcon: index.PsIcon,
|
|
27
|
+
StarFilled: icons.StarFilled,
|
|
28
|
+
Star: icons.Star
|
|
90
29
|
},
|
|
30
|
+
props: rate.rateProps,
|
|
91
31
|
setup(props) {
|
|
92
32
|
const elForm = vue.inject(form.elFormKey, {});
|
|
93
33
|
const currentValue = vue.ref(props.modelValue);
|
|
34
|
+
const hoverIndex = vue.ref(-1);
|
|
35
|
+
const pointerAtLeftHalf = vue.ref(true);
|
|
94
36
|
const rateDisabled = vue.computed(() => props.disabled || elForm.disabled);
|
|
95
37
|
const text = vue.computed(() => {
|
|
96
38
|
let result = "";
|
|
@@ -101,15 +43,6 @@ var script = vue.defineComponent({
|
|
|
101
43
|
}
|
|
102
44
|
return result;
|
|
103
45
|
});
|
|
104
|
-
function getValueFromMap(value, map) {
|
|
105
|
-
const matchedKeys = Object.keys(map).filter((key) => {
|
|
106
|
-
const val = map[key];
|
|
107
|
-
const excluded = shared.isObject(val) ? val.excluded : false;
|
|
108
|
-
return excluded ? value < key : value <= key;
|
|
109
|
-
}).sort((a, b) => a - b);
|
|
110
|
-
const matchedValue = map[matchedKeys[0]];
|
|
111
|
-
return shared.isObject(matchedValue) ? matchedValue.value || matchedValue : matchedValue || "";
|
|
112
|
-
}
|
|
113
46
|
const valueDecimal = vue.computed(() => props.modelValue * 100 - Math.floor(props.modelValue) * 100);
|
|
114
47
|
const colorMap = vue.computed(() => shared.isArray(props.colors) ? {
|
|
115
48
|
[props.lowThreshold]: props.colors[0],
|
|
@@ -147,7 +80,6 @@ var script = vue.defineComponent({
|
|
|
147
80
|
result.fill(voidComponent.value, threshold, props.max);
|
|
148
81
|
return result;
|
|
149
82
|
});
|
|
150
|
-
const pointerAtLeftHalf = vue.ref(true);
|
|
151
83
|
function showDecimalIcon(item) {
|
|
152
84
|
const showWhenDisabled = rateDisabled.value && valueDecimal.value > 0 && item - 1 < props.modelValue && item > props.modelValue;
|
|
153
85
|
const showWhenAllowHalf = props.allowHalf && pointerAtLeftHalf.value && item - 0.5 <= currentValue.value && item > currentValue.value;
|
|
@@ -159,7 +91,6 @@ var script = vue.defineComponent({
|
|
|
159
91
|
color: item <= currentValue.value ? activeColor.value : voidColor
|
|
160
92
|
};
|
|
161
93
|
}
|
|
162
|
-
const hoverIndex = vue.ref(-1);
|
|
163
94
|
return {
|
|
164
95
|
hoverIndex,
|
|
165
96
|
currentValue,
|
|
@@ -175,4 +106,4 @@ var script = vue.defineComponent({
|
|
|
175
106
|
});
|
|
176
107
|
|
|
177
108
|
exports["default"] = script;
|
|
178
|
-
//# sourceMappingURL=
|
|
109
|
+
//# sourceMappingURL=rate.vue_vue&type=script&lang.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/rate/src/rate.vue"],"sourcesContent":["<template>\n <div\n class=\"el-rate\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n >\n <ps-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <ps-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </ps-icon>\n </ps-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-ps/tokens'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-ps/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'PsRate',\n components: {\n PsIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n setup(props) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n\n showDecimalIcon,\n getIconStyle,\n }\n },\n})\n</script>\n"],"names":["isObject","defineComponent","PsIcon","StarFilled","Star","rateProps","inject","elFormKey","ref","computed","isArray"],"mappings":";;;;;;;;;;;;AAiDA,yBACE,OACA,KACA;AACA,QAAM,mBAAmB,CACvB,QACyDA,gBAAS;AAEpE,QAAM,cAAc,OAAO,KAAK,KAC7B,IAAI,CAAC,QAAQ,CAAC,KACd,OAAO,CAAC,QAAQ;AACf,UAAM,MAAM,IAAI;AAChB,UAAM,WAAW,iBAAiB,OAAO,IAAI,WAAW;AACxD,WAAO,WAAW,QAAQ,MAAM,SAAS;AAAA,KAE1C,KAAK,CAAC,GAAG,MAAM,IAAI;AACtB,QAAM,eAAe,IAAI,YAAY;AACrC,SAAQ,iBAAiB,iBAAiB,aAAa,SAAU;AAAA;AAGnE,aAAeC,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,YACVC;AAAA,gBACAC;AAAA,UACAC;AAAA;AAAA,EAEF,OAAOC;AAAA,EACP,MAAM,OAAO;AACX,UAAM,SAASC,WAAOC,gBAAW;AAEjC,UAAM,eAAeC,QAAI,MAAM;AAC/B,UAAM,aAAaA,QAAI;AACvB,UAAM,oBAAoBA,QAAI;AAE9B,UAAM,eAAeC,aAAS,MAAM,MAAM,YAAY,OAAO;AAC7D,UAAM,OAAOA,aAAS,MAAM;AAC1B,UAAI,SAAS;AACb,UAAI,MAAM,WAAW;AACnB,iBAAS,MAAM,cAAc,QAC3B,mBACA,aAAa,QAAQ,GAAG,MAAM,eAAe,GAAG,aAAa;AAAA,iBAEtD,MAAM,UAAU;AACzB,iBAAS,MAAM,MAAM,KAAK,KAAK,aAAa,SAAS;AAAA;AAEvD,aAAO;AAAA;AAET,UAAM,eAAeA,aACnB,MAAM,MAAM,aAAa,MAAM,KAAK,MAAM,MAAM,cAAc;AAEhE,UAAM,WAAWA,aAAS,MACxBC,eAAQ,MAAM,UACV;AAAA,OACG,MAAM,eAAe,MAAM,OAAO;AAAA,OAClC,MAAM,gBAAgB,EAAE,OAAO,MAAM,OAAO,IAAI,UAAU;AAAA,OAC1D,MAAM,MAAM,MAAM,OAAO;AAAA,QAE5B,MAAM;AAEZ,UAAM,cAAcD,aAAS,MAC3B,gBAAgB,aAAa,OAAO,SAAS;AAE/C,UAAM,eAAeA,aAAS,MAAM;AAClC,UAAI,QAAQ;AACZ,UAAI,aAAa,OAAO;AACtB,gBAAQ,GAAG,aAAa;AAAA,iBACf,MAAM,WAAW;AAC1B,gBAAQ;AAAA;AAEV,aAAO;AAAA,QACL,OAAO,YAAY;AAAA,QACnB;AAAA;AAAA;AAGJ,UAAM,eAAeA,aAAS,MAC5BC,eAAQ,MAAM,SACV;AAAA,OACG,MAAM,eAAe,MAAM,MAAM;AAAA,OACjC,MAAM,gBAAgB;AAAA,QACrB,OAAO,MAAM,MAAM;AAAA,QACnB,UAAU;AAAA;AAAA,OAEX,MAAM,MAAM,MAAM,MAAM;AAAA,QAE3B,MAAM;AAEZ,UAAM,uBAAuBD,aAAS,MACpC,gBAAgB,MAAM,YAAY,aAAa;AAEjD,UAAM,gBAAgBA,aAAS,MAC7B,aAAa,QAAQ,MAAM,mBAAmB,MAAM;AAEtD,UAAM,kBAAkBA,aAAS,MAC/B,gBAAgB,aAAa,OAAO,aAAa;AAEnD,UAAM,iBAAiBA,aAAS,MAAM;AACpC,YAAM,SAAS,MAAM,MAAM;AAC3B,YAAM,YAAY,aAAa;AAC/B,aAAO,KAAK,gBAAgB,OAAO,GAAG;AACtC,aAAO,KAAK,cAAc,OAAO,WAAW,MAAM;AAClD,aAAO;AAAA;AAGT,6BAAyB,MAAc;AACrC,YAAM,mBACJ,aAAa,SACb,aAAa,QAAQ,KACrB,OAAO,IAAI,MAAM,cACjB,OAAO,MAAM;AACf,YAAM,oBACJ,MAAM,aACN,kBAAkB,SAClB,OAAO,OAAO,aAAa,SAC3B,OAAO,aAAa;AACtB,aAAO,oBAAoB;AAAA;AAG7B,0BAAsB,MAAc;AAClC,YAAM,YAAY,aAAa,QAC3B,MAAM,oBACN,MAAM;AACV,aAAO;AAAA,QACL,OAAO,QAAQ,aAAa,QAAQ,YAAY,QAAQ;AAAA;AAAA;AAI5D,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MAEA;AAAA,MACA;AAAA;AAAA;AAAA;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate.vue_vue&type=template&id=38c42df6&lang.js","sources":["../../../../../../../packages/components/rate/src/rate.vue?vue&type=template&id=38c42df6&lang.js"],"sourcesContent":["<template>\n <div\n class=\"el-rate\"\n role=\"slider\"\n :aria-valuenow=\"currentValue\"\n :aria-valuetext=\"text\"\n aria-valuemin=\"0\"\n :aria-valuemax=\"max\"\n tabindex=\"0\"\n >\n <span\n v-for=\"(item, key) in max\"\n :key=\"key\"\n class=\"el-rate__item\"\n :style=\"{ cursor: rateDisabled ? 'auto' : 'pointer' }\"\n >\n <ps-icon\n :class=\"[{ hover: hoverIndex === item }]\"\n class=\"el-rate__icon\"\n :style=\"getIconStyle(item)\"\n >\n <component :is=\"iconComponents[item - 1]\" />\n <ps-icon\n v-if=\"showDecimalIcon(item)\"\n :style=\"decimalStyle\"\n class=\"el-rate__icon el-rate__decimal\"\n >\n <component :is=\"decimalIconComponent\" />\n </ps-icon>\n </ps-icon>\n </span>\n <span\n v-if=\"showText || showScore\"\n class=\"el-rate__text\"\n :style=\"{ color: textColor }\"\n >\n {{ text }}\n </span>\n </div>\n</template>\n<script lang=\"ts\">\nimport { defineComponent, inject, computed, ref, watch } from 'vue'\nimport { isObject, isArray } from '@vue/shared'\nimport { elFormKey } from '@element-ps/tokens'\nimport { PsIcon } from '@element-ps/components/icon'\nimport { StarFilled, Star } from '@element-plus/icons'\nimport { rateProps, rateEmits } from './rate'\nimport type { ElFormContext } from '@element-ps/tokens'\n\nfunction getValueFromMap<T>(\n value: number,\n map: Record<string, T | { excluded?: boolean; value: T }>\n) {\n const isExcludedObject = (\n val: unknown\n ): val is { excluded?: boolean } & Record<any, unknown> => isObject(val)\n\n const matchedKeys = Object.keys(map)\n .map((key) => +key)\n .filter((key) => {\n const val = map[key]\n const excluded = isExcludedObject(val) ? val.excluded : false\n return excluded ? value < key : value <= key\n })\n .sort((a, b) => a - b)\n const matchedValue = map[matchedKeys[0]]\n return (isExcludedObject(matchedValue) && matchedValue.value) || matchedValue\n}\n\nexport default defineComponent({\n name: 'PsRate',\n components: {\n PsIcon,\n StarFilled,\n Star,\n },\n props: rateProps,\n setup(props) {\n const elForm = inject(elFormKey, {} as ElFormContext)\n\n const currentValue = ref(props.modelValue)\n const hoverIndex = ref(-1)\n const pointerAtLeftHalf = ref(true)\n\n const rateDisabled = computed(() => props.disabled || elForm.disabled)\n const text = computed(() => {\n let result = ''\n if (props.showScore) {\n result = props.scoreTemplate.replace(\n /\\{\\s*value\\s*\\}/,\n rateDisabled.value ? `${props.modelValue}` : `${currentValue.value}`\n )\n } else if (props.showText) {\n result = props.texts[Math.ceil(currentValue.value) - 1]\n }\n return result\n })\n const valueDecimal = computed(\n () => props.modelValue * 100 - Math.floor(props.modelValue) * 100\n )\n const colorMap = computed(() =>\n isArray(props.colors)\n ? {\n [props.lowThreshold]: props.colors[0],\n [props.highThreshold]: { value: props.colors[1], excluded: true },\n [props.max]: props.colors[2],\n }\n : props.colors\n )\n const activeColor = computed(() =>\n getValueFromMap(currentValue.value, colorMap.value)\n )\n const decimalStyle = computed(() => {\n let width = ''\n if (rateDisabled.value) {\n width = `${valueDecimal.value}%`\n } else if (props.allowHalf) {\n width = '50%'\n }\n return {\n color: activeColor.value,\n width,\n }\n })\n const componentMap = computed(() =>\n isArray(props.icons)\n ? {\n [props.lowThreshold]: props.icons[0],\n [props.highThreshold]: {\n value: props.icons[1],\n excluded: true,\n },\n [props.max]: props.icons[2],\n }\n : props.icons\n )\n const decimalIconComponent = computed(() =>\n getValueFromMap(props.modelValue, componentMap.value)\n )\n const voidComponent = computed(() =>\n rateDisabled.value ? props.disabledvoidIcon : props.voidIcon\n )\n const activeComponent = computed(() =>\n getValueFromMap(currentValue.value, componentMap.value)\n )\n const iconComponents = computed(() => {\n const result = Array(props.max)\n const threshold = currentValue.value\n result.fill(activeComponent.value, 0, threshold)\n result.fill(voidComponent.value, threshold, props.max)\n return result\n })\n\n function showDecimalIcon(item: number) {\n const showWhenDisabled =\n rateDisabled.value &&\n valueDecimal.value > 0 &&\n item - 1 < props.modelValue &&\n item > props.modelValue\n const showWhenAllowHalf =\n props.allowHalf &&\n pointerAtLeftHalf.value &&\n item - 0.5 <= currentValue.value &&\n item > currentValue.value\n return showWhenDisabled || showWhenAllowHalf\n }\n\n function getIconStyle(item: number) {\n const voidColor = rateDisabled.value\n ? props.disabledVoidColor\n : props.voidColor\n return {\n color: item <= currentValue.value ? activeColor.value : voidColor,\n }\n }\n\n return {\n hoverIndex,\n currentValue,\n rateDisabled,\n text,\n decimalStyle,\n decimalIconComponent,\n iconComponents,\n\n showDecimalIcon,\n getIconStyle,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createVNode","_createBlock"],"mappings":";;;;;;;;;0BACEA;IACE,OAAM;AAAA,IACN,MAAK;AAAA,IACJ,iBAAe;IACf,kBAAgB;IACjB,iBAAc;AAAA,IACb,iBAAe;IAChB,UAAS;AAAA;0BAETA,0DACwB,WAAd,MAAM;8BADhBA;QAEG;AAAA,QACD,OAAM;AAAA,QACL,oCAAiB;;QAElBC;UACG,qCAAiB,oBAAe,SAC3B;AAAA,UACL,0BAAO,kBAAa;AAAA;+BAErB;8BAAAC,4CAAgB,oBAAe;YAEvB,qBAAgB,0BADxBA;;cAEG,0BAAO;cACR,OAAM;AAAA;mCAEN;kCAAAA,4CAAgB;;;;;;;;;IAKd,iBAAY,mCADpBF;;MAEE,OAAM;AAAA,MACL,mCAAgB;2BAEd;;;;;;"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var rate_vue_vue_type_script_lang = require('./rate.vue_vue&type=script&lang.js');
|
|
6
|
+
var rate_vue_vue_type_template_id_38c42df6_lang = require('./rate.vue_vue&type=template&id=38c42df6&lang.js');
|
|
7
|
+
|
|
8
|
+
rate_vue_vue_type_script_lang["default"].render = rate_vue_vue_type_template_id_38c42df6_lang.render;
|
|
9
|
+
rate_vue_vue_type_script_lang["default"].__file = "packages/components/rate/src/rate.vue";
|
|
10
|
+
|
|
11
|
+
exports["default"] = rate_vue_vue_type_script_lang["default"];
|
|
12
|
+
//# sourceMappingURL=rate2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rate2.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/table/src/table.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n {\n 'el-table--fit': fit,\n 'el-table--striped': stripe,\n 'el-table--border': border || isGroup,\n 'el-table--hidden': isHidden,\n 'el-table--group': isGroup,\n 'el-table--fluid-height': maxHeight,\n 'el-table--scrollable-x': layout.scrollX.value,\n 'el-table--scrollable-y': layout.scrollY.value,\n 'el-table--enable-row-hover': !store.states.isComplex.value,\n 'el-table--enable-row-transition':\n (store.states.data.value || []).length !== 0 &&\n (store.states.data.value || []).length < 100,\n },\n tableSize ? `el-table--${tableSize}` : '',\n className,\n 'el-table',\n ]\"\n :style=\"style\"\n >\n <div ref=\"hiddenColumns\" class=\"hidden-columns\">\n <slot></slot>\n </div>\n <div v-if=\"showHeader\" ref=\"headerWrapper\" class=\"el-table__header-wrapper\">\n <table-header\n ref=\"tableHeader\"\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n style=\"width: 100%\"\n />\n </div>\n <div ref=\"bodyWrapper\" :style=\"[bodyHeight]\" class=\"el-table__body-wrapper\">\n <table-body\n :context=\"context\"\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n style=\"width: 100%\"\n />\n <div\n v-if=\"isEmpty\"\n ref=\"emptyBlock\"\n :style=\"emptyBlockStyle\"\n class=\"el-table__empty-block\"\n >\n <span class=\"el-table__empty-text\">\n <slot name=\"empty\">{{ emptyText || t('el.table.emptyText') }}</slot>\n </span>\n </div>\n <div\n v-if=\"$slots.append\"\n ref=\"appendWrapper\"\n class=\"el-table__append-wrapper\"\n >\n <slot name=\"append\"></slot>\n </div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"footerWrapper\"\n class=\"el-table__footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :style=\"{\n width: layout.bodyWidth.value ? layout.bodyWidth.value + 'px' : '',\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n />\n </div>\n <div\n v-if=\"store.states.fixedColumns.value.length > 0\"\n ref=\"fixedWrapper\"\n :style=\"[\n {\n width: layout.fixedWidth.value ? layout.fixedWidth.value + 'px' : '',\n },\n fixedHeight,\n ]\"\n class=\"el-table__fixed\"\n >\n <div\n v-if=\"showHeader\"\n ref=\"fixedHeaderWrapper\"\n class=\"el-table__fixed-header-wrapper\"\n >\n <table-header\n ref=\"fixedTableHeader\"\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"left\"\n />\n </div>\n <div\n ref=\"fixedBodyWrapper\"\n :style=\"[\n {\n top: layout.headerHeight.value + 'px',\n },\n fixedBodyHeight,\n ]\"\n class=\"el-table__fixed-body-wrapper\"\n >\n <table-body\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"left\"\n />\n <div\n v-if=\"$slots.append\"\n :style=\"{ height: layout.appendHeight.value + 'px' }\"\n class=\"el-table__append-gutter\"\n ></div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"fixedFooterWrapper\"\n class=\"el-table__fixed-footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n fixed=\"left\"\n />\n </div>\n </div>\n <div\n v-if=\"store.states.rightFixedColumns.value.length > 0\"\n ref=\"rightFixedWrapper\"\n :style=\"[\n {\n width: layout.rightFixedWidth.value\n ? layout.rightFixedWidth.value + 'px'\n : '',\n right: layout.scrollY.value\n ? (border ? layout.gutterWidth : layout.gutterWidth || 0) + 'px'\n : '',\n },\n fixedHeight,\n ]\"\n class=\"el-table__fixed-right\"\n >\n <div\n v-if=\"showHeader\"\n ref=\"rightFixedHeaderWrapper\"\n class=\"el-table__fixed-header-wrapper\"\n >\n <table-header\n ref=\"rightFixedTableHeader\"\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"right\"\n />\n </div>\n <div\n ref=\"rightFixedBodyWrapper\"\n :style=\"[{ top: layout.headerHeight.value + 'px' }, fixedBodyHeight]\"\n class=\"el-table__fixed-body-wrapper\"\n >\n <table-body\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"right\"\n />\n <div\n v-if=\"$slots.append\"\n :style=\"{ height: layout.appendHeight.value + 'px' }\"\n class=\"el-table__append-gutter\"\n ></div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"rightFixedFooterWrapper\"\n class=\"el-table__fixed-footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n fixed=\"right\"\n />\n </div>\n </div>\n <div\n v-if=\"store.states.rightFixedColumns.value.length > 0\"\n ref=\"rightFixedPatch\"\n :style=\"{\n width: layout.scrollY.value ? layout.gutterWidth + 'px' : '0',\n height: layout.headerHeight.value + 'px',\n }\"\n class=\"el-table__fixed-right-patch\"\n ></div>\n <div\n v-show=\"resizeProxyVisible\"\n ref=\"resizeProxy\"\n class=\"el-table__column-resize-proxy\"\n ></div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, getCurrentInstance, computed } from 'vue'\nimport debounce from 'lodash/debounce'\nimport { useLocaleInject } from '@element-ps/hooks'\nimport { createStore } from './store/helper'\nimport TableLayout from './table-layout'\nimport TableHeader from './table-header'\nimport TableBody from './table-body'\nimport TableFooter from './table-footer'\nimport useUtils from './table/utils-helper'\nimport useStyle from './table/style-helper'\nimport defaultProps from './table/defaults'\n\nimport type { Table } from './table/defaults'\n\nlet tableIdSeed = 1\nexport default defineComponent({\n name: 'PsTable',\n components: {\n TableHeader,\n TableBody,\n TableFooter,\n },\n props: defaultProps,\n setup(props) {\n type Row = typeof props.data[number]\n const { t } = useLocaleInject()\n const table = getCurrentInstance() as Table<Row>\n const store = createStore<Row>(table, props)\n table.store = store\n const layout = new TableLayout<Row>({\n store: table.store,\n table,\n fit: props.fit,\n showHeader: props.showHeader,\n })\n table.layout = layout\n\n const isEmpty = computed(() => (store.states.data.value || []).length === 0)\n\n /**\n * open functions\n */\n const {\n setCurrentRow,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n sort,\n } = useUtils<Row>(store)\n const {\n isHidden,\n renderExpanded,\n isGroup,\n tableSize,\n bodyHeight,\n emptyBlockStyle,\n fixedHeight,\n fixedBodyHeight,\n resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n } = useStyle<Row>(props, layout, store, table)\n\n const debouncedUpdateLayout = debounce(doLayout, 50)\n\n const tableId = `el-table_${tableIdSeed++}`\n table.tableId = tableId\n table.state = {\n isGroup,\n resizeState,\n doLayout,\n debouncedUpdateLayout,\n }\n return {\n layout,\n store,\n tableId,\n tableSize,\n isHidden,\n isEmpty,\n renderExpanded,\n resizeProxyVisible,\n resizeState,\n isGroup,\n bodyWidth,\n bodyHeight,\n emptyBlockStyle,\n debouncedUpdateLayout,\n fixedHeight,\n fixedBodyHeight,\n setCurrentRow,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n doLayout,\n sort,\n t,\n context: table,\n }\n },\n})\n</script>\n"],"names":["defineComponent","TableHeader","TableBody","TableFooter","defaultProps","useLocaleInject","getCurrentInstance","createStore","TableLayout","computed","useUtils","useStyle","debounce"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAiQA,IAAI,cAAc;AAClB,aAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,iBACVC;AAAA,eACAC;AAAA,iBACAC;AAAA;AAAA,EAEF,OAAOC;AAAA,EACP,MAAM,OAAO;AAEX,UAAM,EAAE,MAAMC;AACd,UAAM,QAAQC;AACd,UAAM,QAAQC,mBAAiB,OAAO;AACtC,UAAM,QAAQ;AACd,UAAM,SAAS,IAAIC,uBAAiB;AAAA,MAClC,OAAO,MAAM;AAAA,MACb;AAAA,MACA,KAAK,MAAM;AAAA,MACX,YAAY,MAAM;AAAA;AAEpB,UAAM,SAAS;AAEf,UAAM,UAAUC,aAAS,MAAO,OAAM,OAAO,KAAK,SAAS,IAAI,WAAW;AAK1E,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACEC,uBAAc;AAClB,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACEC,uBAAc,OAAO,QAAQ,OAAO;AAExC,UAAM,wBAAwBC,6BAAS,UAAU;AAEjD,UAAM,UAAU,YAAY;AAC5B,UAAM,UAAU;AAChB,UAAM,QAAQ;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAEF,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA;AAAA;AAAA;;;;"}
|
|
1
|
+
{"version":3,"file":"table.vue_vue&type=script&lang.js","sources":["../../../../../../../packages/components/table/src/table.vue"],"sourcesContent":["<template>\n <div\n :class=\"[\n {\n 'el-table--fit': fit,\n 'el-table--striped': stripe,\n 'el-table--border': border || isGroup,\n 'el-table--hidden': isHidden,\n 'el-table--group': isGroup,\n 'el-table--fluid-height': maxHeight,\n 'el-table--scrollable-x': layout.scrollX.value,\n 'el-table--scrollable-y': layout.scrollY.value,\n 'el-table--enable-row-hover': !store.states.isComplex.value,\n 'el-table--enable-row-transition':\n (store.states.data.value || []).length !== 0 &&\n (store.states.data.value || []).length < 100,\n },\n tableSize ? `el-table--${tableSize}` : '',\n className,\n 'el-table',\n ]\"\n :style=\"style\"\n >\n <div ref=\"hiddenColumns\" class=\"hidden-columns\">\n <slot></slot>\n </div>\n <div v-if=\"showHeader\" ref=\"headerWrapper\" class=\"el-table__header-wrapper\">\n <table-header\n ref=\"tableHeader\"\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :style=\"{\n width: layout.bodyWidth.value ? layout.bodyWidth.value + 'px' : '',\n }\"\n />\n </div>\n <div ref=\"bodyWrapper\" :style=\"[bodyHeight]\" class=\"el-table__body-wrapper\">\n <table-body\n :context=\"context\"\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n />\n <div\n v-if=\"isEmpty\"\n ref=\"emptyBlock\"\n :style=\"emptyBlockStyle\"\n class=\"el-table__empty-block\"\n >\n <span class=\"el-table__empty-text\">\n <slot name=\"empty\">{{ emptyText || t('el.table.emptyText') }}</slot>\n </span>\n </div>\n <div\n v-if=\"$slots.append\"\n ref=\"appendWrapper\"\n class=\"el-table__append-wrapper\"\n >\n <slot name=\"append\"></slot>\n </div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"footerWrapper\"\n class=\"el-table__footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :style=\"{\n width: layout.bodyWidth.value ? layout.bodyWidth.value + 'px' : '',\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n />\n </div>\n <div\n v-if=\"store.states.fixedColumns.value.length > 0\"\n ref=\"fixedWrapper\"\n :style=\"[\n {\n width: layout.fixedWidth.value ? layout.fixedWidth.value + 'px' : '',\n },\n fixedHeight,\n ]\"\n class=\"el-table__fixed\"\n >\n <div\n v-if=\"showHeader\"\n ref=\"fixedHeaderWrapper\"\n class=\"el-table__fixed-header-wrapper\"\n >\n <table-header\n ref=\"fixedTableHeader\"\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"left\"\n />\n </div>\n <div\n ref=\"fixedBodyWrapper\"\n :style=\"[\n {\n top: layout.headerHeight.value + 'px',\n },\n fixedBodyHeight,\n ]\"\n class=\"el-table__fixed-body-wrapper\"\n >\n <table-body\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"left\"\n />\n <div\n v-if=\"$slots.append\"\n :style=\"{ height: layout.appendHeight.value + 'px' }\"\n class=\"el-table__append-gutter\"\n ></div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"fixedFooterWrapper\"\n class=\"el-table__fixed-footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n fixed=\"left\"\n />\n </div>\n </div>\n <div\n v-if=\"store.states.rightFixedColumns.value.length > 0\"\n ref=\"rightFixedWrapper\"\n :style=\"[\n {\n width: layout.rightFixedWidth.value\n ? layout.rightFixedWidth.value + 'px'\n : '',\n right: layout.scrollY.value\n ? (border ? layout.gutterWidth : layout.gutterWidth || 0) + 'px'\n : '',\n },\n fixedHeight,\n ]\"\n class=\"el-table__fixed-right\"\n >\n <div\n v-if=\"showHeader\"\n ref=\"rightFixedHeaderWrapper\"\n class=\"el-table__fixed-header-wrapper\"\n >\n <table-header\n ref=\"rightFixedTableHeader\"\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"right\"\n />\n </div>\n <div\n ref=\"rightFixedBodyWrapper\"\n :style=\"[{ top: layout.headerHeight.value + 'px' }, fixedBodyHeight]\"\n class=\"el-table__fixed-body-wrapper\"\n >\n <table-body\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"right\"\n />\n <div\n v-if=\"$slots.append\"\n :style=\"{ height: layout.appendHeight.value + 'px' }\"\n class=\"el-table__append-gutter\"\n ></div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"rightFixedFooterWrapper\"\n class=\"el-table__fixed-footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n fixed=\"right\"\n />\n </div>\n </div>\n <div\n v-if=\"store.states.rightFixedColumns.value.length > 0\"\n ref=\"rightFixedPatch\"\n :style=\"{\n width: layout.scrollY.value ? layout.gutterWidth + 'px' : '0',\n height: layout.headerHeight.value + 'px',\n }\"\n class=\"el-table__fixed-right-patch\"\n ></div>\n <div\n v-show=\"resizeProxyVisible\"\n ref=\"resizeProxy\"\n class=\"el-table__column-resize-proxy\"\n ></div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, getCurrentInstance, computed } from 'vue'\nimport debounce from 'lodash/debounce'\nimport { useLocaleInject } from '@element-ps/hooks'\nimport { createStore } from './store/helper'\nimport TableLayout from './table-layout'\nimport TableHeader from './table-header'\nimport TableBody from './table-body'\nimport TableFooter from './table-footer'\nimport useUtils from './table/utils-helper'\nimport useStyle from './table/style-helper'\nimport defaultProps from './table/defaults'\n\nimport type { Table } from './table/defaults'\n\nlet tableIdSeed = 1\nexport default defineComponent({\n name: 'PsTable',\n components: {\n TableHeader,\n TableBody,\n TableFooter,\n },\n props: defaultProps,\n setup(props) {\n type Row = typeof props.data[number]\n const { t } = useLocaleInject()\n const table = getCurrentInstance() as Table<Row>\n const store = createStore<Row>(table, props)\n table.store = store\n const layout = new TableLayout<Row>({\n store: table.store,\n table,\n fit: props.fit,\n showHeader: props.showHeader,\n })\n table.layout = layout\n\n const isEmpty = computed(() => (store.states.data.value || []).length === 0)\n\n /**\n * open functions\n */\n const {\n setCurrentRow,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n sort,\n } = useUtils<Row>(store)\n const {\n isHidden,\n renderExpanded,\n isGroup,\n tableSize,\n bodyHeight,\n emptyBlockStyle,\n fixedHeight,\n fixedBodyHeight,\n resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n } = useStyle<Row>(props, layout, store, table)\n\n const debouncedUpdateLayout = debounce(doLayout, 50)\n\n const tableId = `el-table_${tableIdSeed++}`\n table.tableId = tableId\n table.state = {\n isGroup,\n resizeState,\n doLayout,\n debouncedUpdateLayout,\n }\n return {\n layout,\n store,\n tableId,\n tableSize,\n isHidden,\n isEmpty,\n renderExpanded,\n resizeProxyVisible,\n resizeState,\n isGroup,\n bodyWidth,\n bodyHeight,\n emptyBlockStyle,\n debouncedUpdateLayout,\n fixedHeight,\n fixedBodyHeight,\n setCurrentRow,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n doLayout,\n sort,\n t,\n context: table,\n }\n },\n})\n</script>\n"],"names":["defineComponent","TableHeader","TableBody","TableFooter","defaultProps","useLocaleInject","getCurrentInstance","createStore","TableLayout","computed","useUtils","useStyle","debounce"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqQA,IAAI,cAAc;AAClB,aAAeA,oBAAgB;AAAA,EAC7B,MAAM;AAAA,EACN,YAAY;AAAA,iBACVC;AAAA,eACAC;AAAA,iBACAC;AAAA;AAAA,EAEF,OAAOC;AAAA,EACP,MAAM,OAAO;AAEX,UAAM,EAAE,MAAMC;AACd,UAAM,QAAQC;AACd,UAAM,QAAQC,mBAAiB,OAAO;AACtC,UAAM,QAAQ;AACd,UAAM,SAAS,IAAIC,uBAAiB;AAAA,MAClC,OAAO,MAAM;AAAA,MACb;AAAA,MACA,KAAK,MAAM;AAAA,MACX,YAAY,MAAM;AAAA;AAEpB,UAAM,SAAS;AAEf,UAAM,UAAUC,aAAS,MAAO,OAAM,OAAO,KAAK,SAAS,IAAI,WAAW;AAK1E,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACEC,uBAAc;AAClB,UAAM;AAAA,MACJ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,QACEC,uBAAc,OAAO,QAAQ,OAAO;AAExC,UAAM,wBAAwBC,6BAAS,UAAU;AAEjD,UAAM,UAAU,YAAY;AAC5B,UAAM,UAAU;AAChB,UAAM,QAAQ;AAAA,MACZ;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA;AAEF,WAAO;AAAA,MACL;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA;AAAA,MACA,SAAS;AAAA;AAAA;AAAA;;;;"}
|
|
@@ -81,8 +81,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
81
81
|
border: _ctx.border,
|
|
82
82
|
"default-sort": _ctx.defaultSort,
|
|
83
83
|
store: _ctx.store,
|
|
84
|
-
style: {
|
|
85
|
-
|
|
84
|
+
style: vue.normalizeStyle({
|
|
85
|
+
width: _ctx.layout.bodyWidth.value ? _ctx.layout.bodyWidth.value + "px" : ""
|
|
86
|
+
})
|
|
87
|
+
}, null, 8, ["border", "default-sort", "store", "style"])
|
|
86
88
|
], 512)) : vue.createCommentVNode("v-if", true),
|
|
87
89
|
vue.createElementVNode("div", {
|
|
88
90
|
ref: "bodyWrapper",
|
|
@@ -97,8 +99,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
97
99
|
"row-style": _ctx.rowStyle,
|
|
98
100
|
store: _ctx.store,
|
|
99
101
|
stripe: _ctx.stripe,
|
|
100
|
-
style: {
|
|
101
|
-
|
|
102
|
+
style: vue.normalizeStyle({
|
|
103
|
+
width: _ctx.bodyWidth
|
|
104
|
+
})
|
|
105
|
+
}, null, 8, ["context", "highlight", "row-class-name", "tooltip-effect", "row-style", "store", "stripe", "style"]),
|
|
102
106
|
_ctx.isEmpty ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
103
107
|
key: 0,
|
|
104
108
|
ref: "emptyBlock",
|
package/lib/packages/components/table/src/table.vue_vue&type=template&id=4a1660ad&lang.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"table.vue_vue&type=template&id=4a1660ad&lang.js","sources":["../../../../../../../packages/components/table/src/table.vue?vue&type=template&id=4a1660ad&lang.js"],"sourcesContent":["<template>\n <div\n :class=\"[\n {\n 'el-table--fit': fit,\n 'el-table--striped': stripe,\n 'el-table--border': border || isGroup,\n 'el-table--hidden': isHidden,\n 'el-table--group': isGroup,\n 'el-table--fluid-height': maxHeight,\n 'el-table--scrollable-x': layout.scrollX.value,\n 'el-table--scrollable-y': layout.scrollY.value,\n 'el-table--enable-row-hover': !store.states.isComplex.value,\n 'el-table--enable-row-transition':\n (store.states.data.value || []).length !== 0 &&\n (store.states.data.value || []).length < 100,\n },\n tableSize ? `el-table--${tableSize}` : '',\n className,\n 'el-table',\n ]\"\n :style=\"style\"\n >\n <div ref=\"hiddenColumns\" class=\"hidden-columns\">\n <slot></slot>\n </div>\n <div v-if=\"showHeader\" ref=\"headerWrapper\" class=\"el-table__header-wrapper\">\n <table-header\n ref=\"tableHeader\"\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n style=\"width: 100%\"\n />\n </div>\n <div ref=\"bodyWrapper\" :style=\"[bodyHeight]\" class=\"el-table__body-wrapper\">\n <table-body\n :context=\"context\"\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n style=\"width: 100%\"\n />\n <div\n v-if=\"isEmpty\"\n ref=\"emptyBlock\"\n :style=\"emptyBlockStyle\"\n class=\"el-table__empty-block\"\n >\n <span class=\"el-table__empty-text\">\n <slot name=\"empty\">{{ emptyText || t('el.table.emptyText') }}</slot>\n </span>\n </div>\n <div\n v-if=\"$slots.append\"\n ref=\"appendWrapper\"\n class=\"el-table__append-wrapper\"\n >\n <slot name=\"append\"></slot>\n </div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"footerWrapper\"\n class=\"el-table__footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :style=\"{\n width: layout.bodyWidth.value ? layout.bodyWidth.value + 'px' : '',\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n />\n </div>\n <div\n v-if=\"store.states.fixedColumns.value.length > 0\"\n ref=\"fixedWrapper\"\n :style=\"[\n {\n width: layout.fixedWidth.value ? layout.fixedWidth.value + 'px' : '',\n },\n fixedHeight,\n ]\"\n class=\"el-table__fixed\"\n >\n <div\n v-if=\"showHeader\"\n ref=\"fixedHeaderWrapper\"\n class=\"el-table__fixed-header-wrapper\"\n >\n <table-header\n ref=\"fixedTableHeader\"\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"left\"\n />\n </div>\n <div\n ref=\"fixedBodyWrapper\"\n :style=\"[\n {\n top: layout.headerHeight.value + 'px',\n },\n fixedBodyHeight,\n ]\"\n class=\"el-table__fixed-body-wrapper\"\n >\n <table-body\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"left\"\n />\n <div\n v-if=\"$slots.append\"\n :style=\"{ height: layout.appendHeight.value + 'px' }\"\n class=\"el-table__append-gutter\"\n ></div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"fixedFooterWrapper\"\n class=\"el-table__fixed-footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n fixed=\"left\"\n />\n </div>\n </div>\n <div\n v-if=\"store.states.rightFixedColumns.value.length > 0\"\n ref=\"rightFixedWrapper\"\n :style=\"[\n {\n width: layout.rightFixedWidth.value\n ? layout.rightFixedWidth.value + 'px'\n : '',\n right: layout.scrollY.value\n ? (border ? layout.gutterWidth : layout.gutterWidth || 0) + 'px'\n : '',\n },\n fixedHeight,\n ]\"\n class=\"el-table__fixed-right\"\n >\n <div\n v-if=\"showHeader\"\n ref=\"rightFixedHeaderWrapper\"\n class=\"el-table__fixed-header-wrapper\"\n >\n <table-header\n ref=\"rightFixedTableHeader\"\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"right\"\n />\n </div>\n <div\n ref=\"rightFixedBodyWrapper\"\n :style=\"[{ top: layout.headerHeight.value + 'px' }, fixedBodyHeight]\"\n class=\"el-table__fixed-body-wrapper\"\n >\n <table-body\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"right\"\n />\n <div\n v-if=\"$slots.append\"\n :style=\"{ height: layout.appendHeight.value + 'px' }\"\n class=\"el-table__append-gutter\"\n ></div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"rightFixedFooterWrapper\"\n class=\"el-table__fixed-footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n fixed=\"right\"\n />\n </div>\n </div>\n <div\n v-if=\"store.states.rightFixedColumns.value.length > 0\"\n ref=\"rightFixedPatch\"\n :style=\"{\n width: layout.scrollY.value ? layout.gutterWidth + 'px' : '0',\n height: layout.headerHeight.value + 'px',\n }\"\n class=\"el-table__fixed-right-patch\"\n ></div>\n <div\n v-show=\"resizeProxyVisible\"\n ref=\"resizeProxy\"\n class=\"el-table__column-resize-proxy\"\n ></div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, getCurrentInstance, computed } from 'vue'\nimport debounce from 'lodash/debounce'\nimport { useLocaleInject } from '@element-ps/hooks'\nimport { createStore } from './store/helper'\nimport TableLayout from './table-layout'\nimport TableHeader from './table-header'\nimport TableBody from './table-body'\nimport TableFooter from './table-footer'\nimport useUtils from './table/utils-helper'\nimport useStyle from './table/style-helper'\nimport defaultProps from './table/defaults'\n\nimport type { Table } from './table/defaults'\n\nlet tableIdSeed = 1\nexport default defineComponent({\n name: 'PsTable',\n components: {\n TableHeader,\n TableBody,\n TableFooter,\n },\n props: defaultProps,\n setup(props) {\n type Row = typeof props.data[number]\n const { t } = useLocaleInject()\n const table = getCurrentInstance() as Table<Row>\n const store = createStore<Row>(table, props)\n table.store = store\n const layout = new TableLayout<Row>({\n store: table.store,\n table,\n fit: props.fit,\n showHeader: props.showHeader,\n })\n table.layout = layout\n\n const isEmpty = computed(() => (store.states.data.value || []).length === 0)\n\n /**\n * open functions\n */\n const {\n setCurrentRow,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n sort,\n } = useUtils<Row>(store)\n const {\n isHidden,\n renderExpanded,\n isGroup,\n tableSize,\n bodyHeight,\n emptyBlockStyle,\n fixedHeight,\n fixedBodyHeight,\n resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n } = useStyle<Row>(props, layout, store, table)\n\n const debouncedUpdateLayout = debounce(doLayout, 50)\n\n const tableId = `el-table_${tableIdSeed++}`\n table.tableId = tableId\n table.state = {\n isGroup,\n resizeState,\n doLayout,\n debouncedUpdateLayout,\n }\n return {\n layout,\n store,\n tableId,\n tableSize,\n isHidden,\n isEmpty,\n renderExpanded,\n resizeProxyVisible,\n resizeState,\n isGroup,\n bodyWidth,\n bodyHeight,\n emptyBlockStyle,\n debouncedUpdateLayout,\n fixedHeight,\n fixedBodyHeight,\n setCurrentRow,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n doLayout,\n sort,\n t,\n context: table,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createElementVNode","_renderSlot","_createVNode"],"mappings":";;;;;;;EAuBS,KAAI;AAAA,EAAgB,OAAM;AAAA;;;EAGR,KAAI;AAAA,EAAgB,OAAM;AAAA;qBA0BvC,OAAM;;;EAMZ,KAAI;AAAA,EACJ,OAAM;AAAA;;;EAQR,KAAI;AAAA,EACJ,OAAM;AAAA;;;EA0BJ,KAAI;AAAA,EACJ,OAAM;AAAA;;;EA2CN,KAAI;AAAA,EACJ,OAAM;AAAA;;;EAgCN,KAAI;AAAA,EACJ,OAAM;AAAA;;;EAsCN,KAAI;AAAA,EACJ,OAAM;AAAA;;EAyBR,KAAI;AAAA,EACJ,OAAM;AAAA;;;;;0BA5OVA;IACG;;;;;;;;;;;;;;;;;IAmBA,0BAAO;;IAERC,8BAAA;MACEC;;IAES,oCAAXF,8BAAA;MACEG;QACE,KAAI;AAAA,QACH,QAAQ;QACR,gBAAc;QACd,OAAO;QACR,OAAA;;;IAGJF;MAAK,KAAI;AAAA,MAAe,2BAAQ;MAAa,OAAM;AAAA;MACjDE;QACG,SAAS;QACT,WAAW;QACX,kBAAgB;QAChB,kBAAgB;QAChB,aAAW;QACX,OAAO;QACP,QAAQ;QACT,OAAA;;MAGM,iCADRH;;QAEE,KAAI;AAAA,QACH,0BAAO;QACR,OAAM;AAAA;QAENC,+BAAA;UACEC,yCAAA;oDAAsB,kBAAa;;;;MAI/B,YAAO,2BADfF,8BAAA;QAKEE;;;IAII,wDADRF,8BAAA;MAMEG;QACG,QAAQ;QACR,gBAAc;QACd,OAAO;QACP;;;QAGA,YAAU,gBAAW;QACrB,kBAAgB;;;mBAZV;;IAgBH,WAAM,OAAO,aAAa,MAAM,+BADxCH;;MAEE,KAAI;AAAA,MACH;;;;;;MAMD,OAAM;AAAA;MAGE,oCADRA,8BAAA;QAKEG;UACE,KAAI;AAAA,UACH,QAAQ;UACR,OAAO;UACP;;;UAGD,OAAM;AAAA;;MAGVF;QACE,KAAI;AAAA,QACH;;;;;;QAMD,OAAM;AAAA;QAENE;UACG,WAAW;UACX,kBAAgB;UAChB,kBAAgB;UAChB,aAAW;UACX,OAAO;UACP,QAAQ;UACR;;;UAGD,OAAM;AAAA;QAGA,YAAO,2BADfH;;UAEG,oCAAiB,YAAO,aAAa;UACtC,OAAM;AAAA;;MAIF,wDADRA,8BAAA;QAMEG;UACG,QAAQ;UACR,OAAO;UACP;;;UAGA,YAAU,gBAAW;UACrB,kBAAgB;UACjB,OAAM;AAAA;;qBAZC;;;IAiBL,WAAM,OAAO,kBAAkB,MAAM,+BAD7CH;;MAEE,KAAI;AAAA,MACH;;;;;;;MAWD,OAAM;AAAA;MAGE,oCADRA,8BAAA;QAKEG;UACE,KAAI;AAAA,UACH,QAAQ;UACR,OAAO;UACP;;;UAGD,OAAM;AAAA;;MAGVF;QACE,KAAI;AAAA,QACH,kCAAe,YAAO,aAAa,gBAAgB;QACpD,OAAM;AAAA;QAENE;UACG,WAAW;UACX,kBAAgB;UAChB,kBAAgB;UAChB,aAAW;UACX,OAAO;UACP,QAAQ;UACR;;;UAGD,OAAM;AAAA;QAGA,YAAO,2BADfH;;UAEG,oCAAiB,YAAO,aAAa;UACtC,OAAM;AAAA;;MAIF,wDADRA,8BAAA;QAMEG;UACG,QAAQ;UACR,OAAO;UACP;;;UAGA,YAAU,gBAAW;UACrB,kBAAgB;UACjB,OAAM;AAAA;;qBAZC;;;IAiBL,WAAM,OAAO,kBAAkB,MAAM,+BAD7CH;;MAEE,KAAI;AAAA,MACH;;;;MAID,OAAM;AAAA;uBAERC,8BAAA;kBACU;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"table.vue_vue&type=template&id=4a1660ad&lang.js","sources":["../../../../../../../packages/components/table/src/table.vue?vue&type=template&id=4a1660ad&lang.js"],"sourcesContent":["<template>\n <div\n :class=\"[\n {\n 'el-table--fit': fit,\n 'el-table--striped': stripe,\n 'el-table--border': border || isGroup,\n 'el-table--hidden': isHidden,\n 'el-table--group': isGroup,\n 'el-table--fluid-height': maxHeight,\n 'el-table--scrollable-x': layout.scrollX.value,\n 'el-table--scrollable-y': layout.scrollY.value,\n 'el-table--enable-row-hover': !store.states.isComplex.value,\n 'el-table--enable-row-transition':\n (store.states.data.value || []).length !== 0 &&\n (store.states.data.value || []).length < 100,\n },\n tableSize ? `el-table--${tableSize}` : '',\n className,\n 'el-table',\n ]\"\n :style=\"style\"\n >\n <div ref=\"hiddenColumns\" class=\"hidden-columns\">\n <slot></slot>\n </div>\n <div v-if=\"showHeader\" ref=\"headerWrapper\" class=\"el-table__header-wrapper\">\n <table-header\n ref=\"tableHeader\"\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :style=\"{\n width: layout.bodyWidth.value ? layout.bodyWidth.value + 'px' : '',\n }\"\n />\n </div>\n <div ref=\"bodyWrapper\" :style=\"[bodyHeight]\" class=\"el-table__body-wrapper\">\n <table-body\n :context=\"context\"\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n />\n <div\n v-if=\"isEmpty\"\n ref=\"emptyBlock\"\n :style=\"emptyBlockStyle\"\n class=\"el-table__empty-block\"\n >\n <span class=\"el-table__empty-text\">\n <slot name=\"empty\">{{ emptyText || t('el.table.emptyText') }}</slot>\n </span>\n </div>\n <div\n v-if=\"$slots.append\"\n ref=\"appendWrapper\"\n class=\"el-table__append-wrapper\"\n >\n <slot name=\"append\"></slot>\n </div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"footerWrapper\"\n class=\"el-table__footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :default-sort=\"defaultSort\"\n :store=\"store\"\n :style=\"{\n width: layout.bodyWidth.value ? layout.bodyWidth.value + 'px' : '',\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n />\n </div>\n <div\n v-if=\"store.states.fixedColumns.value.length > 0\"\n ref=\"fixedWrapper\"\n :style=\"[\n {\n width: layout.fixedWidth.value ? layout.fixedWidth.value + 'px' : '',\n },\n fixedHeight,\n ]\"\n class=\"el-table__fixed\"\n >\n <div\n v-if=\"showHeader\"\n ref=\"fixedHeaderWrapper\"\n class=\"el-table__fixed-header-wrapper\"\n >\n <table-header\n ref=\"fixedTableHeader\"\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"left\"\n />\n </div>\n <div\n ref=\"fixedBodyWrapper\"\n :style=\"[\n {\n top: layout.headerHeight.value + 'px',\n },\n fixedBodyHeight,\n ]\"\n class=\"el-table__fixed-body-wrapper\"\n >\n <table-body\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"left\"\n />\n <div\n v-if=\"$slots.append\"\n :style=\"{ height: layout.appendHeight.value + 'px' }\"\n class=\"el-table__append-gutter\"\n ></div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"fixedFooterWrapper\"\n class=\"el-table__fixed-footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n fixed=\"left\"\n />\n </div>\n </div>\n <div\n v-if=\"store.states.rightFixedColumns.value.length > 0\"\n ref=\"rightFixedWrapper\"\n :style=\"[\n {\n width: layout.rightFixedWidth.value\n ? layout.rightFixedWidth.value + 'px'\n : '',\n right: layout.scrollY.value\n ? (border ? layout.gutterWidth : layout.gutterWidth || 0) + 'px'\n : '',\n },\n fixedHeight,\n ]\"\n class=\"el-table__fixed-right\"\n >\n <div\n v-if=\"showHeader\"\n ref=\"rightFixedHeaderWrapper\"\n class=\"el-table__fixed-header-wrapper\"\n >\n <table-header\n ref=\"rightFixedTableHeader\"\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"right\"\n />\n </div>\n <div\n ref=\"rightFixedBodyWrapper\"\n :style=\"[{ top: layout.headerHeight.value + 'px' }, fixedBodyHeight]\"\n class=\"el-table__fixed-body-wrapper\"\n >\n <table-body\n :highlight=\"highlightCurrentRow\"\n :row-class-name=\"rowClassName\"\n :tooltip-effect=\"tooltipEffect\"\n :row-style=\"rowStyle\"\n :store=\"store\"\n :stripe=\"stripe\"\n :style=\"{\n width: bodyWidth,\n }\"\n fixed=\"right\"\n />\n <div\n v-if=\"$slots.append\"\n :style=\"{ height: layout.appendHeight.value + 'px' }\"\n class=\"el-table__append-gutter\"\n ></div>\n </div>\n <div\n v-if=\"showSummary\"\n v-show=\"!isEmpty\"\n ref=\"rightFixedFooterWrapper\"\n class=\"el-table__fixed-footer-wrapper\"\n >\n <table-footer\n :border=\"border\"\n :store=\"store\"\n :style=\"{\n width: bodyWidth,\n }\"\n :sum-text=\"sumText || t('el.table.sumText')\"\n :summary-method=\"summaryMethod\"\n fixed=\"right\"\n />\n </div>\n </div>\n <div\n v-if=\"store.states.rightFixedColumns.value.length > 0\"\n ref=\"rightFixedPatch\"\n :style=\"{\n width: layout.scrollY.value ? layout.gutterWidth + 'px' : '0',\n height: layout.headerHeight.value + 'px',\n }\"\n class=\"el-table__fixed-right-patch\"\n ></div>\n <div\n v-show=\"resizeProxyVisible\"\n ref=\"resizeProxy\"\n class=\"el-table__column-resize-proxy\"\n ></div>\n </div>\n</template>\n\n<script lang=\"ts\">\nimport { defineComponent, getCurrentInstance, computed } from 'vue'\nimport debounce from 'lodash/debounce'\nimport { useLocaleInject } from '@element-ps/hooks'\nimport { createStore } from './store/helper'\nimport TableLayout from './table-layout'\nimport TableHeader from './table-header'\nimport TableBody from './table-body'\nimport TableFooter from './table-footer'\nimport useUtils from './table/utils-helper'\nimport useStyle from './table/style-helper'\nimport defaultProps from './table/defaults'\n\nimport type { Table } from './table/defaults'\n\nlet tableIdSeed = 1\nexport default defineComponent({\n name: 'PsTable',\n components: {\n TableHeader,\n TableBody,\n TableFooter,\n },\n props: defaultProps,\n setup(props) {\n type Row = typeof props.data[number]\n const { t } = useLocaleInject()\n const table = getCurrentInstance() as Table<Row>\n const store = createStore<Row>(table, props)\n table.store = store\n const layout = new TableLayout<Row>({\n store: table.store,\n table,\n fit: props.fit,\n showHeader: props.showHeader,\n })\n table.layout = layout\n\n const isEmpty = computed(() => (store.states.data.value || []).length === 0)\n\n /**\n * open functions\n */\n const {\n setCurrentRow,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n sort,\n } = useUtils<Row>(store)\n const {\n isHidden,\n renderExpanded,\n isGroup,\n tableSize,\n bodyHeight,\n emptyBlockStyle,\n fixedHeight,\n fixedBodyHeight,\n resizeProxyVisible,\n bodyWidth,\n resizeState,\n doLayout,\n } = useStyle<Row>(props, layout, store, table)\n\n const debouncedUpdateLayout = debounce(doLayout, 50)\n\n const tableId = `el-table_${tableIdSeed++}`\n table.tableId = tableId\n table.state = {\n isGroup,\n resizeState,\n doLayout,\n debouncedUpdateLayout,\n }\n return {\n layout,\n store,\n tableId,\n tableSize,\n isHidden,\n isEmpty,\n renderExpanded,\n resizeProxyVisible,\n resizeState,\n isGroup,\n bodyWidth,\n bodyHeight,\n emptyBlockStyle,\n debouncedUpdateLayout,\n fixedHeight,\n fixedBodyHeight,\n setCurrentRow,\n toggleRowSelection,\n clearSelection,\n clearFilter,\n toggleAllSelection,\n toggleRowExpansion,\n clearSort,\n doLayout,\n sort,\n t,\n context: table,\n }\n },\n})\n</script>\n"],"names":["_createElementBlock","_createElementVNode","_renderSlot","_createVNode"],"mappings":";;;;;;;EAuBS,KAAI;AAAA,EAAgB,OAAM;AAAA;;;EAGR,KAAI;AAAA,EAAgB,OAAM;AAAA;qBA8BvC,OAAM;;;EAMZ,KAAI;AAAA,EACJ,OAAM;AAAA;;;EAQR,KAAI;AAAA,EACJ,OAAM;AAAA;;;EA0BJ,KAAI;AAAA,EACJ,OAAM;AAAA;;;EA2CN,KAAI;AAAA,EACJ,OAAM;AAAA;;;EAgCN,KAAI;AAAA,EACJ,OAAM;AAAA;;;EAsCN,KAAI;AAAA,EACJ,OAAM;AAAA;;EAyBR,KAAI;AAAA,EACJ,OAAM;AAAA;;;;;0BAhPVA;IACG;;;;;;;;;;;;;;;;;IAmBA,0BAAO;;IAERC,8BAAA;MACEC;;IAES,oCAAXF,8BAAA;MACEG;QACE,KAAI;AAAA,QACH,QAAQ;QACR,gBAAc;QACd,OAAO;QACP;;;;;IAKLF;MAAK,KAAI;AAAA,MAAe,2BAAQ;MAAa,OAAM;AAAA;MACjDE;QACG,SAAS;QACT,WAAW;QACX,kBAAgB;QAChB,kBAAgB;QAChB,aAAW;QACX,OAAO;QACP,QAAQ;QACR;;;;MAKK,iCADRH;;QAEE,KAAI;AAAA,QACH,0BAAO;QACR,OAAM;AAAA;QAENC,+BAAA;UACEC,yCAAA;oDAAsB,kBAAa;;;;MAI/B,YAAO,2BADfF,8BAAA;QAKEE;;;IAII,wDADRF,8BAAA;MAMEG;QACG,QAAQ;QACR,gBAAc;QACd,OAAO;QACP;;;QAGA,YAAU,gBAAW;QACrB,kBAAgB;;;mBAZV;;IAgBH,WAAM,OAAO,aAAa,MAAM,+BADxCH;;MAEE,KAAI;AAAA,MACH;;;;;;MAMD,OAAM;AAAA;MAGE,oCADRA,8BAAA;QAKEG;UACE,KAAI;AAAA,UACH,QAAQ;UACR,OAAO;UACP;;;UAGD,OAAM;AAAA;;MAGVF;QACE,KAAI;AAAA,QACH;;;;;;QAMD,OAAM;AAAA;QAENE;UACG,WAAW;UACX,kBAAgB;UAChB,kBAAgB;UAChB,aAAW;UACX,OAAO;UACP,QAAQ;UACR;;;UAGD,OAAM;AAAA;QAGA,YAAO,2BADfH;;UAEG,oCAAiB,YAAO,aAAa;UACtC,OAAM;AAAA;;MAIF,wDADRA,8BAAA;QAMEG;UACG,QAAQ;UACR,OAAO;UACP;;;UAGA,YAAU,gBAAW;UACrB,kBAAgB;UACjB,OAAM;AAAA;;qBAZC;;;IAiBL,WAAM,OAAO,kBAAkB,MAAM,+BAD7CH;;MAEE,KAAI;AAAA,MACH;;;;;;;MAWD,OAAM;AAAA;MAGE,oCADRA,8BAAA;QAKEG;UACE,KAAI;AAAA,UACH,QAAQ;UACR,OAAO;UACP;;;UAGD,OAAM;AAAA;;MAGVF;QACE,KAAI;AAAA,QACH,kCAAe,YAAO,aAAa,gBAAgB;QACpD,OAAM;AAAA;QAENE;UACG,WAAW;UACX,kBAAgB;UAChB,kBAAgB;UAChB,aAAW;UACX,OAAO;UACP,QAAQ;UACR;;;UAGD,OAAM;AAAA;QAGA,YAAO,2BADfH;;UAEG,oCAAiB,YAAO,aAAa;UACtC,OAAM;AAAA;;MAIF,wDADRA,8BAAA;QAMEG;UACG,QAAQ;UACR,OAAO;UACP;;;UAGA,YAAU,gBAAW;UACrB,kBAAgB;UACjB,OAAM;AAAA;;qBAZC;;;IAiBL,WAAM,OAAO,kBAAkB,MAAM,+BAD7CH;;MAEE,KAAI;AAAA,MACH;;;;MAID,OAAM;AAAA;uBAERC,8BAAA;kBACU;;;;;;;"}
|
|
@@ -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 tag = require('./src/
|
|
6
|
+
require('./src/tag.js');
|
|
7
|
+
var tag = require('./src/tag2.js');
|
|
8
8
|
var tag_vue_vue_type_script_lang = require('./src/tag.vue_vue&type=script&lang.js');
|
|
9
9
|
|
|
10
10
|
const PsTag = withInstall.withInstall(tag_vue_vue_type_script_lang["default"]);
|
|
@@ -2,31 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var tag_vue_vue_type_script_lang = require('./tag.vue_vue&type=script&lang.js');
|
|
6
|
+
var tag_vue_vue_type_template_id_525996c5_lang = require('./tag.vue_vue&type=template&id=525996c5&lang.js');
|
|
6
7
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
type: {
|
|
10
|
-
type: String,
|
|
11
|
-
values: ["success", "info", "warning", "danger", ""],
|
|
12
|
-
default: ""
|
|
13
|
-
},
|
|
14
|
-
hit: Boolean,
|
|
15
|
-
disableTransitions: Boolean,
|
|
16
|
-
color: {
|
|
17
|
-
type: String,
|
|
18
|
-
default: ""
|
|
19
|
-
},
|
|
20
|
-
size: {
|
|
21
|
-
type: String,
|
|
22
|
-
values: ["large", "medium", "small", "mini"]
|
|
23
|
-
},
|
|
24
|
-
effect: {
|
|
25
|
-
type: String,
|
|
26
|
-
values: ["dark", "light", "plain"],
|
|
27
|
-
default: "light"
|
|
28
|
-
}
|
|
29
|
-
});
|
|
8
|
+
tag_vue_vue_type_script_lang["default"].render = tag_vue_vue_type_template_id_525996c5_lang.render;
|
|
9
|
+
tag_vue_vue_type_script_lang["default"].__file = "packages/components/tag/src/tag.vue";
|
|
30
10
|
|
|
31
|
-
exports
|
|
11
|
+
exports["default"] = tag_vue_vue_type_script_lang["default"];
|
|
32
12
|
//# sourceMappingURL=tag.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag.js","sources":[
|
|
1
|
+
{"version":3,"file":"tag.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;"}
|
|
@@ -6,7 +6,7 @@ var vue = require('vue');
|
|
|
6
6
|
var index = require('../../icon/index.js');
|
|
7
7
|
var util = require('../../../utils/util.js');
|
|
8
8
|
var icons = require('@element-plus/icons');
|
|
9
|
-
var tag = require('./
|
|
9
|
+
var tag = require('./tag2.js');
|
|
10
10
|
|
|
11
11
|
var script = vue.defineComponent({
|
|
12
12
|
name: "PsTag",
|
|
@@ -2,11 +2,31 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
6
|
-
var tag_vue_vue_type_template_id_525996c5_lang = require('./tag.vue_vue&type=template&id=525996c5&lang.js');
|
|
5
|
+
var props = require('../../../utils/props.js');
|
|
7
6
|
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const tagProps = props.buildProps({
|
|
8
|
+
closable: Boolean,
|
|
9
|
+
type: {
|
|
10
|
+
type: String,
|
|
11
|
+
values: ["success", "info", "warning", "danger", ""],
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
hit: Boolean,
|
|
15
|
+
disableTransitions: Boolean,
|
|
16
|
+
color: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
size: {
|
|
21
|
+
type: String,
|
|
22
|
+
values: ["large", "medium", "small", "mini"]
|
|
23
|
+
},
|
|
24
|
+
effect: {
|
|
25
|
+
type: String,
|
|
26
|
+
values: ["dark", "light", "plain"],
|
|
27
|
+
default: "light"
|
|
28
|
+
}
|
|
29
|
+
});
|
|
10
30
|
|
|
11
|
-
exports
|
|
31
|
+
exports.tagProps = tagProps;
|
|
12
32
|
//# sourceMappingURL=tag2.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tag2.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"tag2.js","sources":["../../../../../../../packages/components/tag/src/tag.ts"],"sourcesContent":["import { buildProps } from '@element-ps/utils/props'\n\nimport type { ExtractPropTypes } from 'vue'\n\nexport const tagProps = buildProps({\n closable: Boolean,\n type: {\n type: String,\n values: ['success', 'info', 'warning', 'danger', ''],\n default: '',\n },\n hit: Boolean,\n disableTransitions: Boolean,\n color: {\n type: String,\n default: '',\n },\n size: {\n type: String,\n values: ['large', 'medium', 'small', 'mini'],\n },\n effect: {\n type: String,\n values: ['dark', 'light', 'plain'],\n default: 'light',\n },\n} as const)\nexport type TagProps = ExtractPropTypes<typeof tagProps>\n"],"names":["buildProps"],"mappings":";;;;;;MAIa,WAAWA,iBAAW;AAAA,EACjC,UAAU;AAAA,EACV,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ,CAAC,WAAW,QAAQ,WAAW,UAAU;AAAA,IACjD,SAAS;AAAA;AAAA,EAEX,KAAK;AAAA,EACL,oBAAoB;AAAA,EACpB,OAAO;AAAA,IACL,MAAM;AAAA,IACN,SAAS;AAAA;AAAA,EAEX,MAAM;AAAA,IACJ,MAAM;AAAA,IACN,QAAQ,CAAC,SAAS,UAAU,SAAS;AAAA;AAAA,EAEvC,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,QAAQ,CAAC,QAAQ,SAAS;AAAA,IAC1B,SAAS;AAAA;AAAA;;;;"}
|
package/lib/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const version = "1.0.
|
|
1
|
+
export declare const version = "1.0.15";
|
package/lib/version.js
CHANGED
package/lib/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sources":["../../../packages/element-ps/version.ts"],"sourcesContent":["export const version = '1.0.
|
|
1
|
+
{"version":3,"file":"version.js","sources":["../../../packages/element-ps/version.ts"],"sourcesContent":["export const version = '1.0.15'\n"],"names":[],"mappings":";;;;MAAa,UAAU;;;;"}
|
package/package.json
CHANGED
package/web-types.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"$schema":"https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json","framework":"vue","name":"element-ps","version":"1.0.
|
|
1
|
+
{"$schema":"https://raw.githubusercontent.com/JetBrains/web-types/master/schema/web-types.json","framework":"vue","name":"element-ps","version":"1.0.16","contributions":{"html":{"types-syntax":"typescript","description-markup":"markdown"}}}
|