vue-devui 1.0.0-beta.4 → 1.0.0-beta.8
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/accordion/index.d.ts +7 -0
- package/accordion/index.es.js +186 -139
- package/accordion/index.umd.js +1 -1
- package/accordion/style.css +1 -1
- package/alert/index.d.ts +7 -0
- package/alert/index.es.js +1 -1
- package/alert/index.umd.js +1 -1
- package/anchor/index.d.ts +7 -0
- package/avatar/index.d.ts +7 -0
- package/avatar/index.es.js +1 -1
- package/avatar/index.umd.js +1 -1
- package/back-top/index.d.ts +7 -0
- package/back-top/index.es.js +128 -0
- package/back-top/index.umd.js +1 -0
- package/back-top/package.json +7 -0
- package/back-top/style.css +1 -0
- package/badge/index.d.ts +7 -0
- package/badge/index.es.js +1 -1
- package/badge/index.umd.js +1 -1
- package/breadcrumb/index.d.ts +7 -0
- package/button/index.d.ts +7 -0
- package/button/index.es.js +4 -4
- package/button/index.umd.js +1 -1
- package/card/index.d.ts +7 -0
- package/card/index.es.js +1 -1
- package/card/index.umd.js +1 -1
- package/carousel/index.d.ts +7 -0
- package/carousel/index.es.js +3 -3
- package/carousel/index.umd.js +1 -1
- package/cascader/index.d.ts +7 -0
- package/cascader/index.es.js +1239 -83
- package/cascader/index.umd.js +1 -1
- package/cascader/style.css +1 -1
- package/checkbox/index.d.ts +7 -0
- package/checkbox/index.es.js +1 -1
- package/checkbox/index.umd.js +1 -1
- package/comment/index.d.ts +7 -0
- package/comment/index.es.js +57 -0
- package/comment/index.umd.js +1 -0
- package/comment/package.json +7 -0
- package/comment/style.css +1 -0
- package/countdown/index.d.ts +7 -0
- package/countdown/index.es.js +167 -0
- package/countdown/index.umd.js +1 -0
- package/countdown/package.json +7 -0
- package/countdown/style.css +1 -0
- package/date-picker/index.d.ts +7 -0
- package/date-picker/index.es.js +15 -15
- package/date-picker/index.umd.js +1 -1
- package/dragdrop/index.d.ts +7 -0
- package/drawer/index.d.ts +7 -0
- package/drawer/index.es.js +33 -9
- package/drawer/index.umd.js +1 -1
- package/dropdown/index.d.ts +7 -0
- package/dropdown/index.es.js +61 -61
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.d.ts +7 -0
- package/editable-select/index.es.js +53 -26
- package/editable-select/index.umd.js +9 -9
- package/form/index.d.ts +7 -0
- package/form/index.es.js +175 -80
- package/form/index.umd.js +1 -1
- package/form/style.css +1 -1
- package/fullscreen/index.d.ts +7 -0
- package/fullscreen/index.es.js +1 -1
- package/fullscreen/index.umd.js +1 -1
- package/gantt/index.d.ts +7 -0
- package/grid/index.d.ts +7 -0
- package/grid/index.es.js +2 -2
- package/grid/index.umd.js +1 -1
- package/icon/index.d.ts +7 -0
- package/icon/index.es.js +4 -4
- package/icon/index.umd.js +1 -1
- package/image-preview/index.d.ts +7 -0
- package/image-preview/index.es.js +23 -2
- package/image-preview/index.umd.js +1 -1
- package/index.d.ts +7 -0
- package/input/index.d.ts +7 -0
- package/input/index.es.js +12 -12
- package/input/index.umd.js +1 -1
- package/input-icon/index.d.ts +7 -0
- package/input-icon/index.es.js +331 -0
- package/input-icon/index.umd.js +1 -0
- package/input-icon/package.json +7 -0
- package/input-icon/style.css +1 -0
- package/input-number/index.d.ts +7 -0
- package/input-number/index.es.js +3 -3
- package/input-number/index.umd.js +1 -1
- package/layout/index.d.ts +7 -0
- package/layout/index.es.js +1 -1
- package/layout/index.umd.js +1 -1
- package/loading/index.d.ts +7 -0
- package/loading/index.es.js +1 -1
- package/loading/index.umd.js +1 -1
- package/modal/index.d.ts +7 -0
- package/modal/index.es.js +58 -57
- package/modal/index.umd.js +1 -1
- package/nav-sprite/index.d.ts +7 -0
- package/overlay/index.d.ts +7 -0
- package/overlay/index.es.js +56 -55
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -31
- package/pagination/index.d.ts +7 -0
- package/pagination/index.es.js +3 -3
- package/pagination/index.umd.js +1 -1
- package/panel/index.d.ts +7 -0
- package/popover/index.d.ts +7 -0
- package/popover/index.es.js +1 -1
- package/popover/index.umd.js +1 -1
- package/progress/index.d.ts +7 -0
- package/progress/index.es.js +1 -1
- package/progress/index.umd.js +2 -2
- package/quadrant-diagram/index.d.ts +7 -0
- package/radio/index.d.ts +7 -0
- package/radio/index.es.js +1 -1
- package/radio/index.umd.js +1 -1
- package/rate/index.d.ts +7 -0
- package/rate/index.es.js +1 -1
- package/rate/index.umd.js +1 -1
- package/read-tip/index.d.ts +7 -0
- package/read-tip/index.es.js +61 -24
- package/read-tip/index.umd.js +1 -1
- package/read-tip/style.css +1 -1
- package/result/index.d.ts +7 -0
- package/result/index.es.js +118 -0
- package/result/index.umd.js +1 -0
- package/result/package.json +7 -0
- package/result/style.css +1 -0
- package/ripple/index.d.ts +7 -0
- package/ripple/index.es.js +5 -2
- package/ripple/index.umd.js +1 -1
- package/search/index.d.ts +7 -0
- package/search/index.es.js +14 -14
- package/search/index.umd.js +1 -1
- package/select/index.d.ts +7 -0
- package/select/index.es.js +3 -3
- package/select/index.umd.js +1 -1
- package/skeleton/index.d.ts +7 -0
- package/skeleton/index.es.js +148 -26
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.d.ts +7 -0
- package/slider/index.es.js +1 -1
- package/slider/index.umd.js +1 -1
- package/splitter/index.d.ts +7 -0
- package/splitter/index.es.js +24 -25
- package/splitter/index.umd.js +1 -1
- package/status/index.d.ts +7 -0
- package/status/index.es.js +1 -1
- package/status/index.umd.js +1 -1
- package/steps-guide/index.d.ts +7 -0
- package/steps-guide/index.es.js +97 -74
- package/steps-guide/index.umd.js +1 -1
- package/sticky/index.d.ts +7 -0
- package/style.css +1 -1
- package/switch/index.d.ts +7 -0
- package/switch/index.es.js +1 -1
- package/switch/index.umd.js +1 -1
- package/table/index.d.ts +7 -0
- package/table/index.es.js +1492 -157
- package/table/index.umd.js +1 -1
- package/table/style.css +1 -1
- package/tabs/index.d.ts +7 -0
- package/tabs/index.es.js +1 -0
- package/tabs/index.umd.js +1 -1
- package/tag/index.d.ts +7 -0
- package/tag/index.es.js +94 -12
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/tag-input/index.d.ts +7 -0
- package/tag-input/index.es.js +1 -1
- package/tag-input/index.umd.js +1 -1
- package/textarea/index.d.ts +7 -0
- package/textarea/index.es.js +1 -1
- package/textarea/index.umd.js +1 -1
- package/time-axis/index.d.ts +7 -0
- package/time-axis/index.es.js +240 -21
- package/time-axis/index.umd.js +1 -1
- package/time-axis/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +12 -7
- package/time-picker/index.umd.js +1 -1
- package/time-picker/style.css +1 -1
- package/toast/index.d.ts +7 -0
- package/toast/index.es.js +4 -4
- package/toast/index.umd.js +1 -1
- package/tooltip/index.d.ts +7 -0
- package/transfer/index.d.ts +7 -0
- package/transfer/index.es.js +301 -62
- package/transfer/index.umd.js +1 -1
- package/transfer/style.css +1 -1
- package/tree/index.d.ts +7 -0
- package/tree/index.es.js +160 -31
- package/tree/index.umd.js +1 -1
- package/tree-select/index.d.ts +7 -0
- package/tree-select/index.es.js +435 -110
- package/tree-select/index.umd.js +1 -1
- package/tree-select/style.css +1 -1
- package/upload/index.d.ts +7 -0
- package/upload/index.es.js +4 -4
- package/upload/index.umd.js +1 -1
- package/vue-devui.es.js +14014 -11820
- package/vue-devui.umd.js +19 -19
package/accordion/index.es.js
CHANGED
|
@@ -1,8 +1,111 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
5
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
|
+
var __spreadValues = (a, b) => {
|
|
7
|
+
for (var prop in b || (b = {}))
|
|
8
|
+
if (__hasOwnProp.call(b, prop))
|
|
9
|
+
__defNormalProp(a, prop, b[prop]);
|
|
10
|
+
if (__getOwnPropSymbols)
|
|
11
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
12
|
+
if (__propIsEnum.call(b, prop))
|
|
13
|
+
__defNormalProp(a, prop, b[prop]);
|
|
14
|
+
}
|
|
15
|
+
return a;
|
|
16
|
+
};
|
|
17
|
+
import { defineComponent, toRefs, computed, createVNode, Fragment, mergeProps, resolveComponent, onMounted, watch } from "vue";
|
|
18
|
+
const accordionProps = {
|
|
19
|
+
data: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: null
|
|
22
|
+
},
|
|
23
|
+
titleKey: { type: String, default: "title" },
|
|
24
|
+
loadingKey: { type: String, default: "loading" },
|
|
25
|
+
childrenKey: { type: String, default: "children" },
|
|
26
|
+
disabledKey: { type: String, default: "disabled" },
|
|
27
|
+
activeKey: { type: String, default: "active" },
|
|
28
|
+
openKey: { type: String, default: "open" },
|
|
29
|
+
menuItemTemplate: { type: String, default: "" },
|
|
30
|
+
itemTemplate: { type: String, default: "" },
|
|
31
|
+
menuToggle: {
|
|
32
|
+
type: Function,
|
|
33
|
+
default: null
|
|
34
|
+
},
|
|
35
|
+
itemClick: {
|
|
36
|
+
type: Function,
|
|
37
|
+
default: null
|
|
38
|
+
},
|
|
39
|
+
activeItemChange: {
|
|
40
|
+
type: Function,
|
|
41
|
+
default: null
|
|
42
|
+
},
|
|
43
|
+
restrictOneOpen: { type: Boolean, default: false },
|
|
44
|
+
autoOpenActiveMenu: { type: Boolean, default: false },
|
|
45
|
+
showNoContent: { type: Boolean, default: true },
|
|
46
|
+
noContentTemplate: { type: String, default: "" },
|
|
47
|
+
loadingTemplate: { type: String, default: "" },
|
|
48
|
+
innerListTemplate: { type: String, default: "" },
|
|
49
|
+
linkType: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ""
|
|
52
|
+
},
|
|
53
|
+
linkTypeKey: { type: String, default: "linkType" },
|
|
54
|
+
linkKey: { type: String, default: "link" },
|
|
55
|
+
linkTargetKey: { type: String, default: "target" },
|
|
56
|
+
linkDefaultTarget: { type: String, default: "_self" },
|
|
57
|
+
accordionType: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "normal"
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
var DAccordionMenu = defineComponent({
|
|
63
|
+
name: "DAccordionMenu",
|
|
64
|
+
props: __spreadValues({
|
|
65
|
+
item: Object,
|
|
66
|
+
deepth: {
|
|
67
|
+
type: Number,
|
|
68
|
+
default: 0
|
|
69
|
+
},
|
|
70
|
+
parent: {
|
|
71
|
+
type: Object,
|
|
72
|
+
default: null
|
|
73
|
+
}
|
|
74
|
+
}, accordionProps),
|
|
75
|
+
setup(props) {
|
|
76
|
+
const {
|
|
77
|
+
item,
|
|
78
|
+
deepth
|
|
79
|
+
} = toRefs(props);
|
|
80
|
+
computed(() => {
|
|
81
|
+
return keyOpen === void 0 && props.autoOpenActiveMenu ? childActived : keyOpen;
|
|
82
|
+
});
|
|
83
|
+
const keyOpen = computed(() => {
|
|
84
|
+
return item == null ? void 0 : item.value[props.openKey];
|
|
85
|
+
});
|
|
86
|
+
const childActived = computed(() => {
|
|
87
|
+
});
|
|
88
|
+
return () => {
|
|
89
|
+
return createVNode(Fragment, null, [createVNode("div", {
|
|
90
|
+
"class": ["devui-accordion-item-title", "devui-over-flow-ellipsis", item.value.children ? "open active" : ""],
|
|
91
|
+
"title": item.value.title
|
|
92
|
+
}, [item.value.title]), createVNode(AccordionList, {
|
|
93
|
+
"class": "devui-accordion-submenu devui-accordion-show-animate",
|
|
94
|
+
"style": "opacity: 1; overflow: hidden;",
|
|
95
|
+
"deepth": deepth.value + 1,
|
|
96
|
+
"data": item.value.children || [],
|
|
97
|
+
"parent": item.value
|
|
98
|
+
}, null)]);
|
|
99
|
+
};
|
|
100
|
+
}
|
|
101
|
+
});
|
|
2
102
|
var AccordionList = defineComponent({
|
|
3
103
|
name: "DAccordionList",
|
|
4
104
|
inheritAttrs: false,
|
|
5
|
-
|
|
105
|
+
components: {
|
|
106
|
+
DAccordionMenu
|
|
107
|
+
},
|
|
108
|
+
props: __spreadValues({
|
|
6
109
|
data: {
|
|
7
110
|
type: Array,
|
|
8
111
|
default: null
|
|
@@ -16,158 +119,102 @@ var AccordionList = defineComponent({
|
|
|
16
119
|
default: null
|
|
17
120
|
},
|
|
18
121
|
innerListTemplate: Boolean
|
|
19
|
-
},
|
|
20
|
-
setup(props,
|
|
122
|
+
}, accordionProps),
|
|
123
|
+
setup(props, {
|
|
124
|
+
attrs,
|
|
125
|
+
slots
|
|
126
|
+
}) {
|
|
127
|
+
const {
|
|
128
|
+
childrenKey,
|
|
129
|
+
innerListTemplate,
|
|
130
|
+
deepth
|
|
131
|
+
} = toRefs(props);
|
|
21
132
|
return () => {
|
|
22
|
-
return (!
|
|
133
|
+
return createVNode(Fragment, null, [!innerListTemplate.value && createVNode("ul", mergeProps({
|
|
23
134
|
"class": "devui-accordion-list"
|
|
24
|
-
},
|
|
135
|
+
}, attrs), [props.data.map((item) => {
|
|
25
136
|
return createVNode("li", {
|
|
26
137
|
"class": "devui-accordion-item",
|
|
27
138
|
"key": item.title
|
|
28
|
-
}, [createVNode("
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, [item.title]), createVNode("div", {
|
|
35
|
-
"class": "devui-accordion-submenu devui-accordion-show-animate",
|
|
36
|
-
"style": "opacity: 1; overflow: hidden;"
|
|
37
|
-
}, [createVNode("ul", {
|
|
38
|
-
"class": "devui-accordion-list"
|
|
39
|
-
}, [item.children.map((component) => {
|
|
40
|
-
return createVNode("li", {
|
|
41
|
-
"class": "devui-accordion-item",
|
|
42
|
-
"key": component.title
|
|
43
|
-
}, [createVNode("div", {
|
|
44
|
-
"class": "devui-accordion-item-title devui-over-flow-ellipsis",
|
|
45
|
-
"style": "text-indent: 20px;",
|
|
46
|
-
"title": component.title
|
|
47
|
-
}, [createVNode(resolveComponent("router-link"), {
|
|
48
|
-
"to": component.link
|
|
49
|
-
}, {
|
|
50
|
-
default: () => [createVNode("div", {
|
|
51
|
-
"class": "devui-accordion-splitter",
|
|
52
|
-
"style": "left: 30px;"
|
|
53
|
-
}, null), component.title, component.done && createVNode("span", {
|
|
54
|
-
"class": "tag-done"
|
|
55
|
-
}, [createTextVNode("\u5DF2\u5B8C\u6210")])]
|
|
56
|
-
})])]);
|
|
57
|
-
})])])])]);
|
|
58
|
-
})]);
|
|
139
|
+
}, [childrenKey !== void 0 && createVNode(resolveComponent("d-accordion-menu"), mergeProps({
|
|
140
|
+
"item": item,
|
|
141
|
+
"deepth": props.deepth,
|
|
142
|
+
"parent": props.parent
|
|
143
|
+
}, accordionProps), null)]);
|
|
144
|
+
})]), innerListTemplate.value && deepth.value !== 0 && createVNode("div", null, [slots.default ? slots.innerListTemplate() : ""])]);
|
|
59
145
|
};
|
|
60
146
|
}
|
|
61
147
|
});
|
|
62
148
|
var accordion = "";
|
|
63
149
|
var Accordion = defineComponent({
|
|
64
150
|
name: "DAccordion",
|
|
65
|
-
props:
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
},
|
|
70
|
-
titleKey: {
|
|
71
|
-
type: String,
|
|
72
|
-
default: "title"
|
|
73
|
-
},
|
|
74
|
-
loadingKey: {
|
|
75
|
-
type: String,
|
|
76
|
-
default: "loading"
|
|
77
|
-
},
|
|
78
|
-
childrenKey: {
|
|
79
|
-
type: String,
|
|
80
|
-
default: "children"
|
|
81
|
-
},
|
|
82
|
-
disabledKey: {
|
|
83
|
-
type: String,
|
|
84
|
-
default: "disabled"
|
|
85
|
-
},
|
|
86
|
-
activeKey: {
|
|
87
|
-
type: String,
|
|
88
|
-
default: "active"
|
|
89
|
-
},
|
|
90
|
-
openKey: {
|
|
91
|
-
type: String,
|
|
92
|
-
default: "open"
|
|
93
|
-
},
|
|
94
|
-
menuItemTemplate: {
|
|
95
|
-
type: String,
|
|
96
|
-
default: ""
|
|
97
|
-
},
|
|
98
|
-
itemTemplate: {
|
|
99
|
-
type: String,
|
|
100
|
-
default: ""
|
|
101
|
-
},
|
|
102
|
-
menuToggle: {
|
|
103
|
-
type: Function,
|
|
104
|
-
default: null
|
|
105
|
-
},
|
|
106
|
-
itemClick: {
|
|
107
|
-
type: Function,
|
|
108
|
-
default: null
|
|
109
|
-
},
|
|
110
|
-
activeItemChange: {
|
|
111
|
-
type: Function,
|
|
112
|
-
default: null
|
|
113
|
-
},
|
|
114
|
-
restrictOneOpen: {
|
|
115
|
-
type: Boolean,
|
|
116
|
-
default: false
|
|
117
|
-
},
|
|
118
|
-
autoOpenActiveMenu: {
|
|
119
|
-
type: Boolean,
|
|
120
|
-
default: false
|
|
121
|
-
},
|
|
122
|
-
showNoContent: {
|
|
123
|
-
type: Boolean,
|
|
124
|
-
default: true
|
|
125
|
-
},
|
|
126
|
-
noContentTemplate: {
|
|
127
|
-
type: String,
|
|
128
|
-
default: ""
|
|
129
|
-
},
|
|
130
|
-
loadingTemplate: {
|
|
131
|
-
type: String,
|
|
132
|
-
default: ""
|
|
133
|
-
},
|
|
134
|
-
innerListTemplate: {
|
|
135
|
-
type: String,
|
|
136
|
-
default: ""
|
|
137
|
-
},
|
|
138
|
-
linkType: {
|
|
139
|
-
type: String,
|
|
140
|
-
default: ""
|
|
141
|
-
},
|
|
142
|
-
linkTypeKey: {
|
|
143
|
-
type: String,
|
|
144
|
-
default: "linkType"
|
|
145
|
-
},
|
|
146
|
-
linkKey: {
|
|
147
|
-
type: String,
|
|
148
|
-
default: "link"
|
|
149
|
-
},
|
|
150
|
-
linkTargetKey: {
|
|
151
|
-
type: String,
|
|
152
|
-
default: "target"
|
|
153
|
-
},
|
|
154
|
-
linkDefaultTarget: {
|
|
155
|
-
type: String,
|
|
156
|
-
default: "_self"
|
|
157
|
-
},
|
|
158
|
-
accordionType: {
|
|
159
|
-
type: String,
|
|
160
|
-
default: "normal"
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
setup(props) {
|
|
151
|
+
props: accordionProps,
|
|
152
|
+
setup(props, {
|
|
153
|
+
emit
|
|
154
|
+
}) {
|
|
164
155
|
const {
|
|
165
156
|
data,
|
|
166
|
-
|
|
167
|
-
|
|
157
|
+
childrenKey,
|
|
158
|
+
activeKey,
|
|
159
|
+
openKey,
|
|
160
|
+
accordionType,
|
|
161
|
+
autoOpenActiveMenu,
|
|
162
|
+
restrictOneOpen
|
|
163
|
+
} = toRefs(props);
|
|
164
|
+
let clickActiveItem = void 0;
|
|
165
|
+
const flatten = (arr, childrenKey2 = "children", includeParent = false, includeLeaf = true) => {
|
|
166
|
+
return arr.reduce((acc, cur) => {
|
|
167
|
+
const children = cur[childrenKey2];
|
|
168
|
+
if (children === void 0) {
|
|
169
|
+
if (includeLeaf) {
|
|
170
|
+
acc.push(cur);
|
|
171
|
+
}
|
|
172
|
+
} else {
|
|
173
|
+
if (includeParent) {
|
|
174
|
+
acc.push(cur);
|
|
175
|
+
}
|
|
176
|
+
if (Array.isArray(children)) {
|
|
177
|
+
acc.push(...flatten(children, childrenKey2, includeParent));
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
return acc;
|
|
181
|
+
}, []);
|
|
182
|
+
};
|
|
183
|
+
const initActiveItem = () => {
|
|
184
|
+
const activeItem = flatten(data.value, childrenKey.value).filter((item) => item[activeKey.value]).pop();
|
|
185
|
+
if (activeItem) {
|
|
186
|
+
if (!clickActiveItem) {
|
|
187
|
+
activeItemFn(activeItem);
|
|
188
|
+
}
|
|
189
|
+
} else {
|
|
190
|
+
clickActiveItem = void 0;
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
const activeItemFn = (item) => {
|
|
194
|
+
if (clickActiveItem && clickActiveItem[activeKey.value]) {
|
|
195
|
+
clickActiveItem[activeKey.value] = false;
|
|
196
|
+
}
|
|
197
|
+
item[activeKey.value] = true;
|
|
198
|
+
clickActiveItem = item;
|
|
199
|
+
emit("activeItemChange", clickActiveItem);
|
|
200
|
+
};
|
|
201
|
+
const cleanOpenData = () => {
|
|
202
|
+
flatten(data.value, childrenKey.value, true, false).forEach((item) => item[openKey.value] = void 0);
|
|
203
|
+
};
|
|
204
|
+
onMounted(() => {
|
|
205
|
+
if (data.value) {
|
|
206
|
+
initActiveItem();
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
watch(() => autoOpenActiveMenu.value, (current, preV) => {
|
|
210
|
+
console.log("cur, new", current, preV);
|
|
211
|
+
if (current && preV === false) {
|
|
212
|
+
cleanOpenData();
|
|
213
|
+
}
|
|
214
|
+
});
|
|
168
215
|
return () => {
|
|
169
216
|
return createVNode("div", {
|
|
170
|
-
"class": `devui-accordion-menu devui-scrollbar ${accordionType === "normal" ? "devui-accordion-menu-normal" : ""}`
|
|
217
|
+
"class": `devui-accordion-menu devui-scrollbar ${accordionType.value === "normal" ? "devui-accordion-menu-normal" : ""}`
|
|
171
218
|
}, [createVNode(AccordionList, mergeProps({
|
|
172
219
|
"data": data,
|
|
173
220
|
"deepth": 0,
|
package/accordion/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
var F=Object.defineProperty;var T=Object.getOwnPropertySymbols;var I=Object.prototype.hasOwnProperty,w=Object.prototype.propertyIsEnumerable;var K=(t,e,n)=>e in t?F(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,h=(t,e)=>{for(var n in e||(e={}))I.call(e,n)&&K(t,n,e[n]);if(T)for(var n of T(e))w.call(e,n)&&K(t,n,e[n]);return t};(function(t,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(t=typeof globalThis!="undefined"?globalThis:t||self,e(t.index={},t.Vue))})(this,function(t,e){"use strict";const n={data:{type:Array,default:null},titleKey:{type:String,default:"title"},loadingKey:{type:String,default:"loading"},childrenKey:{type:String,default:"children"},disabledKey:{type:String,default:"disabled"},activeKey:{type:String,default:"active"},openKey:{type:String,default:"open"},menuItemTemplate:{type:String,default:""},itemTemplate:{type:String,default:""},menuToggle:{type:Function,default:null},itemClick:{type:Function,default:null},activeItemChange:{type:Function,default:null},restrictOneOpen:{type:Boolean,default:!1},autoOpenActiveMenu:{type:Boolean,default:!1},showNoContent:{type:Boolean,default:!0},noContentTemplate:{type:String,default:""},loadingTemplate:{type:String,default:""},innerListTemplate:{type:String,default:""},linkType:{type:String,default:""},linkTypeKey:{type:String,default:"linkType"},linkKey:{type:String,default:"link"},linkTargetKey:{type:String,default:"target"},linkDefaultTarget:{type:String,default:"_self"},accordionType:{type:String,default:"normal"}};var N=e.defineComponent({name:"DAccordionMenu",props:h({item:Object,deepth:{type:Number,default:0},parent:{type:Object,default:null}},n),setup(a){const{item:l,deepth:d}=e.toRefs(a);e.computed(()=>r===void 0&&a.autoOpenActiveMenu?o:r);const r=e.computed(()=>l==null?void 0:l.value[a.openKey]),o=e.computed(()=>{});return()=>e.createVNode(e.Fragment,null,[e.createVNode("div",{class:["devui-accordion-item-title","devui-over-flow-ellipsis",l.value.children?"open active":""],title:l.value.title},[l.value.title]),e.createVNode(A,{class:"devui-accordion-submenu devui-accordion-show-animate",style:"opacity: 1; overflow: hidden;",deepth:d.value+1,data:l.value.children||[],parent:l.value},null)])}}),A=e.defineComponent({name:"DAccordionList",inheritAttrs:!1,components:{DAccordionMenu:N},props:h({data:{type:Array,default:null},deepth:{type:Number,default:0},parent:{type:Object,default:null},innerListTemplate:Boolean},n),setup(a,{attrs:l,slots:d}){const{childrenKey:r,innerListTemplate:o,deepth:y}=e.toRefs(a);return()=>e.createVNode(e.Fragment,null,[!o.value&&e.createVNode("ul",e.mergeProps({class:"devui-accordion-list"},l),[a.data.map(f=>e.createVNode("li",{class:"devui-accordion-item",key:f.title},[r!==void 0&&e.createVNode(e.resolveComponent("d-accordion-menu"),e.mergeProps({item:f,deepth:a.deepth,parent:a.parent},n),null)]))]),o.value&&y.value!==0&&e.createVNode("div",null,[d.default?d.innerListTemplate():""])])}}),B="",p=e.defineComponent({name:"DAccordion",props:n,setup(a,{emit:l}){const{data:d,childrenKey:r,activeKey:o,openKey:y,accordionType:f,autoOpenActiveMenu:b,restrictOneOpen:D}=e.toRefs(a);let u;const m=(i,c="children",S=!1,M=!0)=>i.reduce((s,g)=>{const v=g[c];return v===void 0?M&&s.push(g):(S&&s.push(g),Array.isArray(v)&&s.push(...m(v,c,S))),s},[]),k=()=>{const i=m(d.value,r.value).filter(c=>c[o.value]).pop();i?u||C(i):u=void 0},C=i=>{u&&u[o.value]&&(u[o.value]=!1),i[o.value]=!0,u=i,l("activeItemChange",u)},V=()=>{m(d.value,r.value,!0,!1).forEach(i=>i[y.value]=void 0)};return e.onMounted(()=>{d.value&&k()}),e.watch(()=>b.value,(i,c)=>{console.log("cur, new",i,c),i&&c===!1&&V()}),()=>e.createVNode("div",{class:`devui-accordion-menu devui-scrollbar ${f.value==="normal"?"devui-accordion-menu-normal":""}`},[e.createVNode(A,e.mergeProps({data:d,deepth:0,parent:null},a),null)])}});p.install=function(a){a.component(p.name,p)};var O={title:"Accordion \u624B\u98CE\u7434",category:"\u5BFC\u822A",status:"10%",install(a){a.use(p)}};t.Accordion=p,t.default=O,Object.defineProperty(t,"__esModule",{value:!0}),t[Symbol.toStringTag]="Module"});
|
package/accordion/style.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
@charset "UTF-8";:host{display:block}.devui-accordion-menu-item,d-accordion-item,d-accordion-item-hreflink,d-accordion-item-routerlink,.devui-accordion-list{display:block}.devui-accordion-menu{display:block;background:var(--devui-base-bg, #ffffff);width:100%;overflow-y:auto;border-radius:var(--devui-border-radius, 2px);height:100%}.devui-accordion-menu.devui-accordion-menu-normal{box-shadow:var(--devui-shadow-length-base, 0 1px 4px 0) var(--devui-shadow, rgba(0, 0, 0, .2))}.devui-accordion-menu>.devui-accordion-list{padding:10px 0}.devui-accordion-menu .devui-over-flow-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.devui-accordion-submenu{background:var(--devui-base-bg, #ffffff);width:100%}.devui-accordion-item-title{display:block;height:40px;width:100%;padding:0 10px 0 20px;font-weight:400;line-height:40px;color:var(--devui-text-weak, #575d6c);background:transparent;cursor:pointer}.devui-accordion-item-title.disabled{color:var(--devui-disabled-text, #adb0b8);cursor:not-allowed}.devui-accordion-item-title.disabled>a{color:var(--devui-disabled-text, #adb0b8)}.devui-accordion-item-title:not(.disabled):hover{background:var(--devui-list-item-hover-bg, #f2f5fc);color:var(--devui-list-item-hover-text, #526ecc)}.devui-accordion-item-title:not(.disabled).devui-router-active,.devui-accordion-item-title:not(.disabled).active:not(.open){color:var(--devui-brand-active, #526ecc);font-weight:bold}.devui-accordion-item-title:not(.disabled).devui-router-active>a,.devui-accordion-item-title:not(.disabled).active:not(.open)>a{color:var(--devui-brand-active, #526ecc)}.devui-accordion-item-title>a{text-decoration:none;display:block;width:100%;color:var(--devui-text-weak, #575d6c)}.devui-accordion-item-title>a:hover{color:inherit;text-decoration:none}d-accordion-item-hreflink.devui-accordion-item-title,d-accordion-item-routerlink.devui-accordion-item-title{padding:0}d-accordion-item-hreflink.devui-accordion-item-title>a,d-accordion-item-routerlink.devui-accordion-item-title>a{padding:0 10px 0 20px}.devui-accordion-menu-item>.devui-accordion-item-title{position:relative}.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-open-icon{display:inline-block;text-indent:0;pointer-events:none;position:absolute;right:10px;top:12px;width:16px;height:16px;line-height:16px;transition:transform ease-out .3s}.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-open-icon>svg{width:16px;height:16px}.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-open-icon>svg polygon{fill:var(--devui-text-weak, #575d6c)}.devui-accordion-menu-item>.devui-accordion-item-title:not(.open).active svg polygon{fill:var(--devui-icon-fill-active, #5e7ce0)}.devui-accordion-menu-item>.devui-accordion-item-title:not(.open)>.devui-accordion-open-icon{transform:rotate(-180deg);transform-origin:center}.devui-accordion-menu-item>.devui-accordion-item-title.disabled>.devui-accordion-open-icon{color:var(--devui-disabled-text, #adb0b8)}.devui-accordion-menu-item>.devui-accordion-item-title.disabled>.devui-accordion-open-icon svg polygon{fill:var(--devui-disabled-text, #adb0b8)}.devui-accordion-menu-item>.devui-accordion-item-title{padding-right:30px}.devui-accordion-menu-item>.devui-accordion-item-title.active:not(.open){color:var(--devui-brand-active, #526ecc);background:transparent}.devui-accordion-list.devui-accordion-menu-hidden{display:none}.devui-accordion-item-title{position:relative}.devui-accordion-item-title .devui-accordion-splitter{position:absolute;display:inline-block;left:10px;width:2px;height:40px;background:var(--devui-dividing-line, #dfe1e6);vertical-align:middle}.devui-accordion-item-title .devui-accordion-splitter.devui-parent-list{background-color:transparent}.devui-accordion-item-title.devui-router-active:not(.open) .devui-accordion-splitter:before,.devui-accordion-item-title.active:not(.open) .devui-accordion-splitter:before{
|
|
1
|
+
@charset "UTF-8";:host{display:block}.devui-accordion-menu-item,d-accordion-item,d-accordion-item-hreflink,d-accordion-item-routerlink,.devui-accordion-list{display:block}.devui-accordion-menu{display:block;background:var(--devui-base-bg, #ffffff);width:100%;overflow-y:auto;border-radius:var(--devui-border-radius, 2px);height:100%}.devui-accordion-menu.devui-accordion-menu-normal{box-shadow:var(--devui-shadow-length-base, 0 1px 4px 0) var(--devui-shadow, rgba(0, 0, 0, .2))}.devui-accordion-menu>.devui-accordion-list{padding:10px 0}.devui-accordion-menu .devui-over-flow-ellipsis{overflow:hidden;white-space:nowrap;text-overflow:ellipsis}.devui-accordion-submenu{background:var(--devui-base-bg, #ffffff);width:100%}.devui-accordion-item-title{display:block;height:40px;width:100%;padding:0 10px 0 20px;font-weight:400;line-height:40px;color:var(--devui-text-weak, #575d6c);background:transparent;cursor:pointer}.devui-accordion-item-title.disabled{color:var(--devui-disabled-text, #adb0b8);cursor:not-allowed}.devui-accordion-item-title.disabled>a{color:var(--devui-disabled-text, #adb0b8)}.devui-accordion-item-title:not(.disabled):hover{background:var(--devui-list-item-hover-bg, #f2f5fc);color:var(--devui-list-item-hover-text, #526ecc)}.devui-accordion-item-title:not(.disabled).devui-router-active,.devui-accordion-item-title:not(.disabled).active:not(.open){color:var(--devui-brand-active, #526ecc);font-weight:bold}.devui-accordion-item-title:not(.disabled).devui-router-active>a,.devui-accordion-item-title:not(.disabled).active:not(.open)>a{color:var(--devui-brand-active, #526ecc)}.devui-accordion-item-title>a{text-decoration:none;display:block;width:100%;color:var(--devui-text-weak, #575d6c)}.devui-accordion-item-title>a:hover{color:inherit;text-decoration:none}d-accordion-item-hreflink.devui-accordion-item-title,d-accordion-item-routerlink.devui-accordion-item-title{padding:0}d-accordion-item-hreflink.devui-accordion-item-title>a,d-accordion-item-routerlink.devui-accordion-item-title>a{padding:0 10px 0 20px}.devui-accordion-menu-item>.devui-accordion-item-title{position:relative}.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-open-icon{display:inline-block;text-indent:0;pointer-events:none;position:absolute;right:10px;top:12px;width:16px;height:16px;line-height:16px;transition:transform ease-out .3s}.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-open-icon>svg{width:16px;height:16px}.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-open-icon>svg polygon{fill:var(--devui-text-weak, #575d6c)}.devui-accordion-menu-item>.devui-accordion-item-title:not(.open).active svg polygon{fill:var(--devui-icon-fill-active, #5e7ce0)}.devui-accordion-menu-item>.devui-accordion-item-title:not(.open)>.devui-accordion-open-icon{transform:rotate(-180deg);transform-origin:center}.devui-accordion-menu-item>.devui-accordion-item-title.disabled>.devui-accordion-open-icon{color:var(--devui-disabled-text, #adb0b8)}.devui-accordion-menu-item>.devui-accordion-item-title.disabled>.devui-accordion-open-icon svg polygon{fill:var(--devui-disabled-text, #adb0b8)}.devui-accordion-menu-item>.devui-accordion-item-title{padding-right:30px}.devui-accordion-menu-item>.devui-accordion-item-title.active:not(.open){color:var(--devui-brand-active, #526ecc);background:transparent}.devui-accordion-list.devui-accordion-menu-hidden{display:none}.devui-accordion-item-title{position:relative}.devui-accordion-item-title .devui-accordion-splitter{position:absolute;display:inline-block;left:10px;width:2px;height:40px;background:var(--devui-dividing-line, #dfe1e6);vertical-align:middle}.devui-accordion-item-title .devui-accordion-splitter.devui-parent-list{background-color:transparent}.devui-accordion-item-title .devui-accordion-splitter:before{content:"";display:block;width:2px;height:18px;background:var(--devui-form-control-line-active, #5e7ce0);position:absolute;top:11px;left:0;opacity:0}.devui-accordion-item-title.devui-router-active:not(.open) .devui-accordion-splitter:before,.devui-accordion-item-title.active:not(.open) .devui-accordion-splitter:before{opacity:1}.devui-accordion-show-animate .devui-accordion-item-title{transition:font-weight var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-accordion-show-animate .devui-accordion-item-title .devui-accordion-splitter:before{transform:scaleY(0);transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-accordion-show-animate .devui-accordion-item-title.devui-router-active:not(.open) .devui-accordion-splitter:before,.devui-accordion-show-animate .devui-accordion-item-title.active:not(.open) .devui-accordion-splitter:before{transform:scaleY(1)}.devui-accordion-list>.devui-accordion-item:first-child>.devui-accordion-item-title>a>.devui-accordion-splitter,.devui-accordion-list>.devui-accordion-item:first-child>.devui-accordion-item-title>.devui-accordion-splitter,.devui-accordion-list>.devui-accordion-item:first-child>.devui-accordion-menu-item>.devui-accordion-item-title>a>.devui-accordion-splitter,.devui-accordion-list>.devui-accordion-item:first-child>.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-splitter{height:28px;top:12px}.devui-accordion-list>.devui-accordion-item:first-child>.devui-accordion-item-title>a>.devui-accordion-splitter:before,.devui-accordion-list>.devui-accordion-item:first-child>.devui-accordion-item-title>.devui-accordion-splitter:before,.devui-accordion-list>.devui-accordion-item:first-child>.devui-accordion-menu-item>.devui-accordion-item-title>a>.devui-accordion-splitter:before,.devui-accordion-list>.devui-accordion-item:first-child>.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-splitter:before{top:0}.devui-accordion-list>.devui-accordion-item:last-child>.devui-accordion-item-title>a>.devui-accordion-splitter,.devui-accordion-list>.devui-accordion-item:last-child>.devui-accordion-item-title>.devui-accordion-splitter,.devui-accordion-list>.devui-accordion-item:last-child>.devui-accordion-menu-item>.devui-accordion-item-title>a>.devui-accordion-splitter,.devui-accordion-list>.devui-accordion-item:last-child>.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-splitter{height:28px;top:0}.devui-accordion-list>.devui-accordion-item:last-child>.devui-accordion-item-title>a>.devui-accordion-splitter:before,.devui-accordion-list>.devui-accordion-item:last-child>.devui-accordion-item-title>.devui-accordion-splitter:before,.devui-accordion-list>.devui-accordion-item:last-child>.devui-accordion-menu-item>.devui-accordion-item-title>a>.devui-accordion-splitter:before,.devui-accordion-list>.devui-accordion-item:last-child>.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-splitter:before{top:initial;bottom:0}.devui-accordion-list>.devui-accordion-item:last-child:first-child>.devui-accordion-item-title>a>.devui-accordion-splitter,.devui-accordion-list>.devui-accordion-item:last-child:first-child>.devui-accordion-item-title>.devui-accordion-splitter,.devui-accordion-list>.devui-accordion-item:last-child:first-child>.devui-accordion-menu-item>.devui-accordion-item-title>a>.devui-accordion-splitter,.devui-accordion-list>.devui-accordion-item:last-child:first-child>.devui-accordion-menu-item>.devui-accordion-item-title>.devui-accordion-splitter{height:18px;top:11px}.devui-accordion-item>a{padding:0 10px 0 20px;color:var(--devui-text-weak, #575d6c);display:block;text-decoration:none;width:100%}.devui-accordion-item-title .tag-done{display:inline-block;height:18px;min-height:20px;padding:0 10px;margin-left:8px;line-height:18px;color:#fa9841;border:solid 1px #fa9841;background:var(--devui-base-bg, #ffffff);font-size:var(--devui-font-size, 12px);border-radius:var(--devui-border-radius, 2px);text-indent:0;cursor:default}
|
package/alert/index.d.ts
ADDED
package/alert/index.es.js
CHANGED
package/alert/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(l,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(l=typeof globalThis!="undefined"?globalThis:l||self,e(l.index={},l.Vue))})(this,function(l,e){"use strict";const u=()=>e.createVNode("svg",{width:"10px",height:"10px",viewBox:"0 0 10 10",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{transform:"translate(-3.000000, -3.000000)","fill-rule":"nonzero"},[e.createVNode("path",{d:"M11.6426,3.19816936 C11.9239974,2.91574512 12.4131626,2.93784891 12.7352108,3.24751057 C13.0571998,3.5572302 13.0901298,4.03723416 12.8087324,4.31965839 L9.14064666,7.99900183 L12.8087324,11.6803416 C13.0645482,11.9370909 13.0605893,12.3571292 12.8158402,12.6640749 L12.7352108,12.7524894 C12.4131626,13.0621511 11.9239974,13.0842548 11.6426,12.8018306 L8,9.14489021 L4.35740003,12.8018306 C4.10158422,13.05858 3.6740594,13.0636532 3.35648225,12.8298003 L3.26478919,12.7524894 C2.94280021,12.4427698 2.90987023,11.9627658 3.19126762,11.6803416 L6.8583349,7.99900183 L3.19126762,4.31965839 C2.93545181,4.06290908 2.93941068,3.64287076 3.18415975,3.3359251 L3.26478919,3.24751057 C3.58683735,2.93784891 4.07600264,2.91574512 4.35740003,3.19816936 L8,6.85411161 L11.6426,3.19816936 Z"},null)])])]),f=t=>e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",class:`devui-icon ${t.type==="danger"?"devui-icon-error":`devui-icon-${t.type}`}`},[(()=>{switch(t.type){case"success":return e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{"fill-rule":"nonzero",d:"M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z"},null),e.createVNode("polygon",{"stroke-width":"0.3","fill-rule":"nonzero",points:"6.82767602 11.5282799 3 7.24668779 3.89864233 6.37912367 6.82767602 9.04910002 12.2964408 4 13 4.64144383"},null)]);case"warning":return e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:"devui-icon-warning-outer",d:"M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"},null),e.createVNode("path",{class:"devui-icon-warning-inner","stroke-width":"0.3","fill-rule":"nonzero",d:"M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"},null)]);case"info":return e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{"fill-rule":"nonzero"},[e.createVNode("path",{class:"devui-icon-info-outer",d:"M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z"},null),e.createVNode("path",{class:"devui-icon-info-inner",d:"M9.19008504,7 L8.79402696,13 L7.15622605,13 L6.73158434,7 L9.19008504,7 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z","stroke-width":"0.2"},null)])]);case"danger":return e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{"fill-rule":"nonzero"},[e.createVNode("path",{class:"devui-icon-error-outer",d:"M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z"},null),e.createVNode("path",{class:"devui-icon-error-inner",d:"M9,10.6 L9,12.6 L7,12.6 L7,10.6 L9,10.6 Z M9.1,3.1 L8.65924344,9.1 L7.28422786,9.1 L6.9,3.1 L9.1,3.1 Z","stroke-width":"0.2"},null)])]);default:return null}})()]);var C="",o=e.defineComponent({name:"DAlert",props:{type:{type:String,default:"info"},cssClass:{type:String,default:""},closeable:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},dismissTime:{type:Number,default:0}},emits:["close"],setup(t,s){const a=e.ref(!1),r=e.ref(!1),d=e.ref(),c=i=>{const n=d.value;n.style.height=`${n.offsetHeight}px`,n.style.height=`${n.offsetHeight}px`,r.value=!0,s.emit("close",i)},L=()=>{a.value=!0,r.value=!1};return e.onMounted(()=>{t.dismissTime&&setTimeout(()=>{c()},t.dismissTime)}),()=>a.value?null:e.createVNode(e.Transition,{name:"devui-alert",onAfterLeave:L},{default:()=>{var i,n;return[e.withDirectives(e.createVNode("div",{ref:d,class:`devui-alert devui-alert-${t.type} ${t.cssClass} ${r.value?"devui-alter-close":null}`},[t.closeable?e.createVNode("button",{type:"button",class:"devui-close",onClick:c},[e.createVNode(u,null,null)]):null,t.showIcon!==!1&&t.type!=="simple"?e.createVNode("span",{class:"devui-alert-icon"},[e.createVNode(f,{type:t.type},null)]):null,(n=(i=s.slots).default)==null?void 0:n.call(i)]),[[e.vShow,!r.value]])]}})}});o.install=function(t){t.component(o.name,o)};var h={title:"Alert \u8B66\u544A",category:"\u53CD\u9988",status:"
|
|
1
|
+
(function(l,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(l=typeof globalThis!="undefined"?globalThis:l||self,e(l.index={},l.Vue))})(this,function(l,e){"use strict";const u=()=>e.createVNode("svg",{width:"10px",height:"10px",viewBox:"0 0 10 10",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{transform:"translate(-3.000000, -3.000000)","fill-rule":"nonzero"},[e.createVNode("path",{d:"M11.6426,3.19816936 C11.9239974,2.91574512 12.4131626,2.93784891 12.7352108,3.24751057 C13.0571998,3.5572302 13.0901298,4.03723416 12.8087324,4.31965839 L9.14064666,7.99900183 L12.8087324,11.6803416 C13.0645482,11.9370909 13.0605893,12.3571292 12.8158402,12.6640749 L12.7352108,12.7524894 C12.4131626,13.0621511 11.9239974,13.0842548 11.6426,12.8018306 L8,9.14489021 L4.35740003,12.8018306 C4.10158422,13.05858 3.6740594,13.0636532 3.35648225,12.8298003 L3.26478919,12.7524894 C2.94280021,12.4427698 2.90987023,11.9627658 3.19126762,11.6803416 L6.8583349,7.99900183 L3.19126762,4.31965839 C2.93545181,4.06290908 2.93941068,3.64287076 3.18415975,3.3359251 L3.26478919,3.24751057 C3.58683735,2.93784891 4.07600264,2.91574512 4.35740003,3.19816936 L8,6.85411161 L11.6426,3.19816936 Z"},null)])])]),f=t=>e.createVNode("svg",{width:"16px",height:"16px",viewBox:"0 0 16 16",version:"1.1",xmlns:"http://www.w3.org/2000/svg",class:`devui-icon ${t.type==="danger"?"devui-icon-error":`devui-icon-${t.type}`}`},[(()=>{switch(t.type){case"success":return e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{"fill-rule":"nonzero",d:"M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z"},null),e.createVNode("polygon",{"stroke-width":"0.3","fill-rule":"nonzero",points:"6.82767602 11.5282799 3 7.24668779 3.89864233 6.37912367 6.82767602 9.04910002 12.2964408 4 13 4.64144383"},null)]);case"warning":return e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{class:"devui-icon-warning-outer",d:"M8.96244623,0.57254229 L15.8714442,13.4101975 C16.1549662,13.9370117 15.9538562,14.5918482 15.4222523,14.8728158 C15.2642579,14.9563203 15.0879506,15 14.9088903,15 L1.09089441,15 C0.488410063,15 0,14.5159904 0,13.9189343 C0,13.7414873 0.0440768395,13.5667684 0.128340519,13.4101975 L7.03733844,0.57254229 C7.32086049,0.0457280838 7.98165058,-0.153569987 8.51325441,0.127397589 C8.70423071,0.228333932 8.8605922,0.383286648 8.96244623,0.57254229 Z"},null),e.createVNode("path",{class:"devui-icon-warning-inner","stroke-width":"0.3","fill-rule":"nonzero",d:"M8.87894737,13 L7.08947368,13 L7.08947368,11.2105263 L8.87894737,11.2105263 L8.87894737,13 Z M8.62102372,9.86842105 L7.32800539,9.86842105 L7,4.5 L8.96842105,4.5 L8.62102372,9.86842105 Z"},null)]);case"info":return e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{"fill-rule":"nonzero"},[e.createVNode("path",{class:"devui-icon-info-outer",d:"M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z"},null),e.createVNode("path",{class:"devui-icon-info-inner",d:"M9.19008504,7 L8.79402696,13 L7.15622605,13 L6.73158434,7 L9.19008504,7 Z M9,3 L9,5 L7,5 L7,3 L9,3 Z","stroke-width":"0.2"},null)])]);case"danger":return e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("g",{"fill-rule":"nonzero"},[e.createVNode("path",{class:"devui-icon-error-outer",d:"M8,0 C3.6,0 0,3.6 0,8 C0,12.4 3.6,16 8,16 C12.4,16 16,12.4 16,8 C16,3.6 12.4,0 8,0 Z"},null),e.createVNode("path",{class:"devui-icon-error-inner",d:"M9,10.6 L9,12.6 L7,12.6 L7,10.6 L9,10.6 Z M9.1,3.1 L8.65924344,9.1 L7.28422786,9.1 L6.9,3.1 L9.1,3.1 Z","stroke-width":"0.2"},null)])]);default:return null}})()]);var C="",o=e.defineComponent({name:"DAlert",props:{type:{type:String,default:"info"},cssClass:{type:String,default:""},closeable:{type:Boolean,default:!0},showIcon:{type:Boolean,default:!0},dismissTime:{type:Number,default:0}},emits:["close"],setup(t,s){const a=e.ref(!1),r=e.ref(!1),d=e.ref(),c=i=>{const n=d.value;n.style.height=`${n.offsetHeight}px`,n.style.height=`${n.offsetHeight}px`,r.value=!0,s.emit("close",i)},L=()=>{a.value=!0,r.value=!1};return e.onMounted(()=>{t.dismissTime&&setTimeout(()=>{c()},t.dismissTime)}),()=>a.value?null:e.createVNode(e.Transition,{name:"devui-alert",onAfterLeave:L},{default:()=>{var i,n;return[e.withDirectives(e.createVNode("div",{ref:d,class:`devui-alert devui-alert-${t.type} ${t.cssClass} ${r.value?"devui-alter-close":null}`},[t.closeable?e.createVNode("button",{type:"button",class:"devui-close",onClick:c},[e.createVNode(u,null,null)]):null,t.showIcon!==!1&&t.type!=="simple"?e.createVNode("span",{class:"devui-alert-icon"},[e.createVNode(f,{type:t.type},null)]):null,(n=(i=s.slots).default)==null?void 0:n.call(i)]),[[e.vShow,!r.value]])]}})}});o.install=function(t){t.component(o.name,o)};var h={title:"Alert \u8B66\u544A",category:"\u53CD\u9988",status:"100%",install(t){t.use(o)}};l.Alert=o,l.default=h,Object.defineProperty(l,"__esModule",{value:!0}),l[Symbol.toStringTag]="Module"});
|
package/avatar/index.es.js
CHANGED
package/avatar/index.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const M=t=>{const{width:l,height:a}=t;return e.createVNode("svg",{style:{width:`${l}px`,height:`${a}px`,verticalAlign:"middle"},viewBox:"0 0 30 30",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{id:"\u672A\u547D\u540D",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("circle",{id:"Oval",fill:"#CACFD8",cx:"15",cy:"15",r:"15"},null),e.createVNode("path",{d:"M14.9997866,16 C12.5145053,16 10.4997866,13.9852814 10.4997866,11.5 C10.4997866,9.01471863 12.5145053,7 14.9997866,7 C17.485068,7 19.4997866,9.01471863 19.4997866,11.5 C19.4997866,13.9852814 17.485068,16 14.9997866,16 Z M23,23 L7,22.998553 C7,19.0122153 10.8892296,16.5 14.9997866,16.5 C19.1103437,16.5 23,20 23,23 Z",id:"\u5F62\u72B6\u7ED3\u5408",fill:"#FFFFFF"},null)])])};var Z=e.defineComponent({name:"AvatarBodyIcon",props:{width:{type:Number,default:16},height:{type:Number,default:16}},render(){const{width:t,height:l}=this;return e.createVNode(M,{width:t,height:l},null)}});const b=t=>{const{width:l,height:a}=t;return e.createVNode("svg",{style:{width:`${l}px`,height:`${a}px`,verticalAlign:"middle"},viewBox:"0 0 30 30",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M22.31,19.2474562 L22.31,21.9974562 L20.81,21.9974562 L20.81,19.2474562 L18.06,19.2474562 L18.06,17.7474562 L20.81,17.7474562 L20.81,14.9974562 L22.31,14.9974562 L22.31,17.7474562 L25.06,17.7474562 L25.06,19.2474562 L22.31,19.2474562 Z M14.9297866,14.9974562 C12.4445053,14.9974562 10.4297866,12.9827376 10.4297866,10.4974562 C10.4297866,8.01217483 12.4445053,5.9974562 14.9297866,5.9974562 C17.415068,5.9974562 19.4297866,8.01217483 19.4297866,10.4974562 C19.4297866,12.9827376 17.415068,14.9974562 14.9297866,14.9974562 Z M19.6797866,20.2474562 L19.6797866,21.9971623 L6.93,21.9960092 C6.93,18.0096715 10.8192296,15.4974562 14.9297866,15.4974562 C16.4608397,15.4974562 17.9612467,15.983021 19.2414296,16.7474562 L17.06,16.7474562 L17.06,20.2474562 L19.6797866,20.2474562 Z",id:"\u5F62\u72B6\u7ED3\u5408",fill:"#959EB2"},null),e.createVNode("path",{d:"M0,15 L1,15 C1,15.6118966 1.03919561,16.2186526 1.11683409,16.8178549 L0.125124012,16.9463505 C0.0425740367,16.309242 0,15.6595925 0,15 Z M0.503241262,18.867175 L1.46961749,18.6100428 C1.62594651,19.1975718 1.8203704,19.7729973 2.05141295,20.3332823 L1.12693074,20.7145074 C0.880599065,20.1171459 0.67172715,19.500393 0.503241262,18.867175 Z M1.99122134,22.4730778 L2.85786221,21.9741453 C3.16078316,22.5003161 3.49772502,23.0063252 3.86631639,23.4889602 L3.0715754,24.0959089 C2.6777461,23.5802273 2.31659753,23.0382531 1.99122134,22.4730778 Z M4.38894559,25.6021078 L5.09634867,24.8952974 C5.52582519,25.3251341 5.98272136,25.7268214 6.46397085,26.0975793 L5.85367498,26.8897529 C5.33779918,26.4923186 4.84851395,26.0620615 4.38894559,25.6021078 Z M7.4424647,27.9597887 L7.94703323,27.096417 C8.47111119,27.4026968 9.0146817,27.6746032 9.57453904,27.9101878 L9.18668461,28.8319084 C8.58423501,28.5784013 8.00181692,28.2866833 7.4424647,27.9597887 Z M11.0671021,29.4791103 L11.3286494,28.5139196 C11.9126912,28.6721832 12.5080563,28.7925378 13.1119738,28.8738935 L12.9784667,29.8649413 C12.3271613,29.7772019 11.6891102,29.647662 11.0671021,29.4791103 Z M15,30 C14.9951965,30 14.9903936,29.9999977 14.9855912,30 L14.9865313,28.9999937 C14.9929361,28.9999987 14.9929361,28.9999987 14.999296,29 C15.6071552,29 16.2093364,28.9614092 16.8041774,28.8849313 L16.9316965,29.8767674 C16.2992813,29.9580762 15.6545362,30 15,30 Z M18.8545762,29.5001051 L18.5982903,28.5335041 C19.1860387,28.3776677 19.7617059,28.1837179 20.3222555,27.9531286 L20.7026875,28.8779375 C20.1050484,29.123784 19.4880358,29.3321488 18.8545762,29.5001051 Z M22.4608087,28.0158343 L21.9626951,27.1487226 C22.4893928,26.8461604 22.9959399,26.5095265 23.479119,26.1411926 L24.0853678,26.9364676 C23.5691101,27.3300178 23.0265585,27.6908386 22.4608087,28.0158343 Z M25.5921583,25.6209863 L24.8860071,24.9129252 C25.3161421,24.4839504 25.7181674,24.0275419 26.0893023,23.5467621 L26.8808873,24.1578212 C26.4830546,24.6731862 26.0524368,25.1619493 25.5921583,25.6209863 Z M27.9526445,22.5697466 L27.0897495,22.0643633 C27.3964738,21.5406601 27.6688549,20.9974409 27.904942,20.4379104 L28.8262855,20.8266601 C28.5722411,21.4287497 28.2800163,22.0107897 27.9526445,22.5697466 Z M29.4756977,18.9454696 L28.5107363,18.6830777 C28.6695136,18.099165 28.7903877,17.5039035 28.8722662,16.9000659 L29.8631978,17.0344333 C29.7748946,17.6856516 29.6447979,18.3235936 29.4756977,18.9454696 Z M30,15 C30,15.0093541 29.9999914,15.0187063 29.9999743,15.0280564 L28.999976,15.0262257 C28.9999956,15.0134169 28.9999956,15.0134169 29,15.0006466 C29,14.3970304 28.9619395,13.7989704 28.8865088,13.208136 L29.8784576,13.0814959 C29.9586571,13.7096843 30,14.3500145 30,15 Z M29.5038108,11.1594275 L28.5369608,11.4147728 C28.3816616,10.8267413 28.1882232,10.2507676 27.9581175,9.68988857 L28.8832852,9.31033004 C29.1286141,9.90831524 29.3364318,10.5256569 29.5038108,11.1594275 Z M28.0228788,7.55146763 L27.1552968,8.0487618 C26.853241,7.52179373 26.5170958,7.0149453 26.1492295,6.53143425 L26.9450761,5.92593594 C27.3381231,6.44254364 27.6984223,6.98541919 28.0228788,7.55146763 Z M25.6309089,4.41780044 L24.9221905,5.12329189 C24.4935639,4.69270467 24.0374698,4.2902078 23.5569705,3.9185855 L24.1687554,3.12756133 C24.6838129,3.52591118 25.1722392,3.95703271 25.6309089,4.41780044 Z M22.5819506,2.05451093 L22.0757531,2.91692851 C21.5523008,2.60968727 21.0092999,2.33677531 20.4499564,2.10014728 L20.8395722,1.17916981 C21.4414531,1.43379309 22.0232574,1.72658499 22.5819506,2.05451093 Z M18.9594329,0.528106464 L18.696103,1.4928123 C18.1122842,1.33345081 17.517086,1.21199245 16.9132846,1.12953261 L17.0485964,0.138729543 C17.6997753,0.227659622 18.3376514,0.358382523 18.9594329,0.528106464 Z M15,-1.11022302e-16 C15.0139048,-1.11022302e-16 15.0278052,1.892004e-05 15.0417011,5.673578e-05 L15.0389797,1.00005303 C15.0197685,1.00000934 15.0197685,1.00000934 15.0005868,1.00000001 C14.4012162,1 13.8072783,1.03753392 13.2204527,1.11192427 L13.0946918,0.119863691 C13.7186509,0.0407660189 14.3545651,-1.11022302e-16 15,-1.11022302e-16 Z M11.1720354,0.492865376 L11.4265338,1.45993857 C10.8386468,1.61464899 10.2627801,1.80746996 9.70196444,2.03693489 L9.32327455,1.11141127 C9.92118954,0.86676666 10.5384173,0.659610554 11.1720354,0.492865376 Z M7.56375123,1.97008801 L8.06022548,2.83813946 C7.53298826,3.13968806 7.02583975,3.47534367 6.54199783,3.84274131 L5.93725081,3.04632368 C6.4542073,2.65378102 6.99740556,2.29400434 7.56375123,1.97008801 Z M4.42776842,4.35917772 L5.13259949,5.06855291 C4.70156141,5.49682984 4.29859416,5.95260763 3.92648544,6.43282469 L3.13602297,5.82031423 C3.53488885,5.30556625 3.96651291,4.81747851 4.42776842,4.35917772 Z M2.0616775,7.40585279 L2.92361696,7.91286401 C2.61586086,8.43606175 2.34241977,8.97884042 2.10525197,9.53799293 L1.18464153,9.14751063 C1.43984243,8.54584288 1.73319965,7.96427837 2.0616775,7.40585279 Z M0.531541456,11.0280046 L1.49601653,11.2921785 C1.33614878,11.8758413 1.21417484,12.4709081 1.13119244,13.074601 L0.140507978,12.9384235 C0.230001486,12.2873626 0.361276825,11.6496255 0.531541456,11.0280046 Z",id:"\u8499\u7248",fill:"#CACFD8","fill-rule":"nonzero"},null)])])};var x=e.defineComponent({name:"AvatarNobodyIcon",props:{width:{type:Number,default:16},height:{type:Number,default:16}},render(){const{width:t,height:l}=this;return e.createVNode(b,{width:t,height:l},null)}}),S="",L=e.defineComponent({name:"DAvatar",props:{name:{type:String,default:null},gender:{type:String,default:null},width:{type:Number,default:36},height:{type:Number,default:36},isRound:{type:Boolean,default:!0},imgSrc:{type:String,default:""},customText:{type:String,default:null}},setup(t){const{name:l,width:a,height:d,customText:o,gender:u,imgSrc:w,isRound:N}=e.toRefs(t),s=e.ref(!0),C=e.ref(!1),f=e.ref(12),h=e.ref(),n=e.ref(),p=r=>{const c=r,v=Math.min(a.value,d.value);c?(s.value=!1,y(c,v)):c===""?(s.value=!1,n.value=""):s.value=!0,f.value=v/4+3},y=(r,c)=>{if(o.value){n.value=o.value,g(o.value.substr(0,1));return}if(r.length<2)n.value=r;else if(/^[\u4e00-\u9fa5]/.test(r))n.value=r.substr(r.length-2,2);else if(/^[A-Za-z]/.test(r))if(/[_ -]/.test(r)){const v=r.split(/_|-|\s+/)[0],A=r.split(/_|-|\s+/)[1];n.value=v.substr(0,1).toUpperCase()+A.substr(0,1).toUpperCase()}else n.value=r.substr(0,2).toUpperCase();else n.value=r.substr(0,2);c<30&&(n.value=r.substr(0,1).toUpperCase()),g(r.substr(0,1))},g=r=>{if(u.value){if(u.value.toLowerCase()==="male")h.value=1;else if(u.value.toLowerCase()==="female")h.value=0;else throw new Error('gender must be "Male" or "Female"');return}const c=r.charCodeAt(0);h.value=c%2},m=()=>{C.value=!0};return p(o.value?o.value:l.value),e.watch([l,a,d,o,u],()=>{p(o.value?o.value:l.value)}),{showErrorAvatar:m,isErrorImg:C,code:h,fontSize:f,nameDisplay:n,isNobody:s}},render(){const{imgSrc:t,showErrorAvatar:l,height:a,width:d,isRound:o,isErrorImg:u,code:w,fontSize:N,nameDisplay:s,isNobody:C}=this,f=e.createVNode("img",{src:t,alt:"",onError:l,style:{height:`${a}px`,width:`${d}px`,borderRadius:o?"100%":"0"}},null),h=t&&!u?f:null,n=e.createVNode("span",{class:`devui-avatar-style devui-avatar-background-${w}`,style:{height:`${a}px`,width:`${d}px`,lineHeight:`${a}px`,fontSize:`${N}px`,borderRadius:o?"100%":"0"}},[s]),p=!t&&!C&&(s==null?void 0:s.length)!==0?n:null,y=e.createVNode("span",{class:"devui-avatar-style",style:{borderRadius:o?"100%":"0"}},[e.createVNode(Z,{width:d,height:a},null)]),g=!t&&!C&&(s==null?void 0:s.length)===0?y:null,m=e.createVNode("span",{class:"devui-avatar-style",style:{borderRadius:o?"100%":"0"}},[e.createVNode(x,{width:d,height:a},null)]),r=!t&&C||u?m:null;return e.createVNode("span",{class:"devui-avatar"},[h,p,g,r])}});L.install=function(t){t.component(L.name,L)};var V={title:"Avatar \u5934\u50CF",category:"\u6570\u636E\u5C55\u793A",status:"\u5DF2\u5B8C\u6210",install(t){t.use(L)}};i.Avatar=L,i.default=V,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|
|
1
|
+
(function(i,e){typeof exports=="object"&&typeof module!="undefined"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(i=typeof globalThis!="undefined"?globalThis:i||self,e(i.index={},i.Vue))})(this,function(i,e){"use strict";const M=t=>{const{width:l,height:a}=t;return e.createVNode("svg",{style:{width:`${l}px`,height:`${a}px`,verticalAlign:"middle"},viewBox:"0 0 30 30",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{id:"\u672A\u547D\u540D",stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("circle",{id:"Oval",fill:"#CACFD8",cx:"15",cy:"15",r:"15"},null),e.createVNode("path",{d:"M14.9997866,16 C12.5145053,16 10.4997866,13.9852814 10.4997866,11.5 C10.4997866,9.01471863 12.5145053,7 14.9997866,7 C17.485068,7 19.4997866,9.01471863 19.4997866,11.5 C19.4997866,13.9852814 17.485068,16 14.9997866,16 Z M23,23 L7,22.998553 C7,19.0122153 10.8892296,16.5 14.9997866,16.5 C19.1103437,16.5 23,20 23,23 Z",id:"\u5F62\u72B6\u7ED3\u5408",fill:"#FFFFFF"},null)])])};var Z=e.defineComponent({name:"AvatarBodyIcon",props:{width:{type:Number,default:16},height:{type:Number,default:16}},render(){const{width:t,height:l}=this;return e.createVNode(M,{width:t,height:l},null)}});const b=t=>{const{width:l,height:a}=t;return e.createVNode("svg",{style:{width:`${l}px`,height:`${a}px`,verticalAlign:"middle"},viewBox:"0 0 30 30",version:"1.1",xmlns:"http://www.w3.org/2000/svg"},[e.createVNode("g",{stroke:"none","stroke-width":"1",fill:"none","fill-rule":"evenodd"},[e.createVNode("path",{d:"M22.31,19.2474562 L22.31,21.9974562 L20.81,21.9974562 L20.81,19.2474562 L18.06,19.2474562 L18.06,17.7474562 L20.81,17.7474562 L20.81,14.9974562 L22.31,14.9974562 L22.31,17.7474562 L25.06,17.7474562 L25.06,19.2474562 L22.31,19.2474562 Z M14.9297866,14.9974562 C12.4445053,14.9974562 10.4297866,12.9827376 10.4297866,10.4974562 C10.4297866,8.01217483 12.4445053,5.9974562 14.9297866,5.9974562 C17.415068,5.9974562 19.4297866,8.01217483 19.4297866,10.4974562 C19.4297866,12.9827376 17.415068,14.9974562 14.9297866,14.9974562 Z M19.6797866,20.2474562 L19.6797866,21.9971623 L6.93,21.9960092 C6.93,18.0096715 10.8192296,15.4974562 14.9297866,15.4974562 C16.4608397,15.4974562 17.9612467,15.983021 19.2414296,16.7474562 L17.06,16.7474562 L17.06,20.2474562 L19.6797866,20.2474562 Z",id:"\u5F62\u72B6\u7ED3\u5408",fill:"#959EB2"},null),e.createVNode("path",{d:"M0,15 L1,15 C1,15.6118966 1.03919561,16.2186526 1.11683409,16.8178549 L0.125124012,16.9463505 C0.0425740367,16.309242 0,15.6595925 0,15 Z M0.503241262,18.867175 L1.46961749,18.6100428 C1.62594651,19.1975718 1.8203704,19.7729973 2.05141295,20.3332823 L1.12693074,20.7145074 C0.880599065,20.1171459 0.67172715,19.500393 0.503241262,18.867175 Z M1.99122134,22.4730778 L2.85786221,21.9741453 C3.16078316,22.5003161 3.49772502,23.0063252 3.86631639,23.4889602 L3.0715754,24.0959089 C2.6777461,23.5802273 2.31659753,23.0382531 1.99122134,22.4730778 Z M4.38894559,25.6021078 L5.09634867,24.8952974 C5.52582519,25.3251341 5.98272136,25.7268214 6.46397085,26.0975793 L5.85367498,26.8897529 C5.33779918,26.4923186 4.84851395,26.0620615 4.38894559,25.6021078 Z M7.4424647,27.9597887 L7.94703323,27.096417 C8.47111119,27.4026968 9.0146817,27.6746032 9.57453904,27.9101878 L9.18668461,28.8319084 C8.58423501,28.5784013 8.00181692,28.2866833 7.4424647,27.9597887 Z M11.0671021,29.4791103 L11.3286494,28.5139196 C11.9126912,28.6721832 12.5080563,28.7925378 13.1119738,28.8738935 L12.9784667,29.8649413 C12.3271613,29.7772019 11.6891102,29.647662 11.0671021,29.4791103 Z M15,30 C14.9951965,30 14.9903936,29.9999977 14.9855912,30 L14.9865313,28.9999937 C14.9929361,28.9999987 14.9929361,28.9999987 14.999296,29 C15.6071552,29 16.2093364,28.9614092 16.8041774,28.8849313 L16.9316965,29.8767674 C16.2992813,29.9580762 15.6545362,30 15,30 Z M18.8545762,29.5001051 L18.5982903,28.5335041 C19.1860387,28.3776677 19.7617059,28.1837179 20.3222555,27.9531286 L20.7026875,28.8779375 C20.1050484,29.123784 19.4880358,29.3321488 18.8545762,29.5001051 Z M22.4608087,28.0158343 L21.9626951,27.1487226 C22.4893928,26.8461604 22.9959399,26.5095265 23.479119,26.1411926 L24.0853678,26.9364676 C23.5691101,27.3300178 23.0265585,27.6908386 22.4608087,28.0158343 Z M25.5921583,25.6209863 L24.8860071,24.9129252 C25.3161421,24.4839504 25.7181674,24.0275419 26.0893023,23.5467621 L26.8808873,24.1578212 C26.4830546,24.6731862 26.0524368,25.1619493 25.5921583,25.6209863 Z M27.9526445,22.5697466 L27.0897495,22.0643633 C27.3964738,21.5406601 27.6688549,20.9974409 27.904942,20.4379104 L28.8262855,20.8266601 C28.5722411,21.4287497 28.2800163,22.0107897 27.9526445,22.5697466 Z M29.4756977,18.9454696 L28.5107363,18.6830777 C28.6695136,18.099165 28.7903877,17.5039035 28.8722662,16.9000659 L29.8631978,17.0344333 C29.7748946,17.6856516 29.6447979,18.3235936 29.4756977,18.9454696 Z M30,15 C30,15.0093541 29.9999914,15.0187063 29.9999743,15.0280564 L28.999976,15.0262257 C28.9999956,15.0134169 28.9999956,15.0134169 29,15.0006466 C29,14.3970304 28.9619395,13.7989704 28.8865088,13.208136 L29.8784576,13.0814959 C29.9586571,13.7096843 30,14.3500145 30,15 Z M29.5038108,11.1594275 L28.5369608,11.4147728 C28.3816616,10.8267413 28.1882232,10.2507676 27.9581175,9.68988857 L28.8832852,9.31033004 C29.1286141,9.90831524 29.3364318,10.5256569 29.5038108,11.1594275 Z M28.0228788,7.55146763 L27.1552968,8.0487618 C26.853241,7.52179373 26.5170958,7.0149453 26.1492295,6.53143425 L26.9450761,5.92593594 C27.3381231,6.44254364 27.6984223,6.98541919 28.0228788,7.55146763 Z M25.6309089,4.41780044 L24.9221905,5.12329189 C24.4935639,4.69270467 24.0374698,4.2902078 23.5569705,3.9185855 L24.1687554,3.12756133 C24.6838129,3.52591118 25.1722392,3.95703271 25.6309089,4.41780044 Z M22.5819506,2.05451093 L22.0757531,2.91692851 C21.5523008,2.60968727 21.0092999,2.33677531 20.4499564,2.10014728 L20.8395722,1.17916981 C21.4414531,1.43379309 22.0232574,1.72658499 22.5819506,2.05451093 Z M18.9594329,0.528106464 L18.696103,1.4928123 C18.1122842,1.33345081 17.517086,1.21199245 16.9132846,1.12953261 L17.0485964,0.138729543 C17.6997753,0.227659622 18.3376514,0.358382523 18.9594329,0.528106464 Z M15,-1.11022302e-16 C15.0139048,-1.11022302e-16 15.0278052,1.892004e-05 15.0417011,5.673578e-05 L15.0389797,1.00005303 C15.0197685,1.00000934 15.0197685,1.00000934 15.0005868,1.00000001 C14.4012162,1 13.8072783,1.03753392 13.2204527,1.11192427 L13.0946918,0.119863691 C13.7186509,0.0407660189 14.3545651,-1.11022302e-16 15,-1.11022302e-16 Z M11.1720354,0.492865376 L11.4265338,1.45993857 C10.8386468,1.61464899 10.2627801,1.80746996 9.70196444,2.03693489 L9.32327455,1.11141127 C9.92118954,0.86676666 10.5384173,0.659610554 11.1720354,0.492865376 Z M7.56375123,1.97008801 L8.06022548,2.83813946 C7.53298826,3.13968806 7.02583975,3.47534367 6.54199783,3.84274131 L5.93725081,3.04632368 C6.4542073,2.65378102 6.99740556,2.29400434 7.56375123,1.97008801 Z M4.42776842,4.35917772 L5.13259949,5.06855291 C4.70156141,5.49682984 4.29859416,5.95260763 3.92648544,6.43282469 L3.13602297,5.82031423 C3.53488885,5.30556625 3.96651291,4.81747851 4.42776842,4.35917772 Z M2.0616775,7.40585279 L2.92361696,7.91286401 C2.61586086,8.43606175 2.34241977,8.97884042 2.10525197,9.53799293 L1.18464153,9.14751063 C1.43984243,8.54584288 1.73319965,7.96427837 2.0616775,7.40585279 Z M0.531541456,11.0280046 L1.49601653,11.2921785 C1.33614878,11.8758413 1.21417484,12.4709081 1.13119244,13.074601 L0.140507978,12.9384235 C0.230001486,12.2873626 0.361276825,11.6496255 0.531541456,11.0280046 Z",id:"\u8499\u7248",fill:"#CACFD8","fill-rule":"nonzero"},null)])])};var x=e.defineComponent({name:"AvatarNobodyIcon",props:{width:{type:Number,default:16},height:{type:Number,default:16}},render(){const{width:t,height:l}=this;return e.createVNode(b,{width:t,height:l},null)}}),S="",L=e.defineComponent({name:"DAvatar",props:{name:{type:String,default:null},gender:{type:String,default:null},width:{type:Number,default:36},height:{type:Number,default:36},isRound:{type:Boolean,default:!0},imgSrc:{type:String,default:""},customText:{type:String,default:null}},setup(t){const{name:l,width:a,height:d,customText:o,gender:u,imgSrc:w,isRound:N}=e.toRefs(t),s=e.ref(!0),C=e.ref(!1),f=e.ref(12),h=e.ref(),n=e.ref(),p=r=>{const c=r,v=Math.min(a.value,d.value);c?(s.value=!1,y(c,v)):c===""?(s.value=!1,n.value=""):s.value=!0,f.value=v/4+3},y=(r,c)=>{if(o.value){n.value=o.value,g(o.value.substr(0,1));return}if(r.length<2)n.value=r;else if(/^[\u4e00-\u9fa5]/.test(r))n.value=r.substr(r.length-2,2);else if(/^[A-Za-z]/.test(r))if(/[_ -]/.test(r)){const v=r.split(/_|-|\s+/)[0],A=r.split(/_|-|\s+/)[1];n.value=v.substr(0,1).toUpperCase()+A.substr(0,1).toUpperCase()}else n.value=r.substr(0,2).toUpperCase();else n.value=r.substr(0,2);c<30&&(n.value=r.substr(0,1).toUpperCase()),g(r.substr(0,1))},g=r=>{if(u.value){if(u.value.toLowerCase()==="male")h.value=1;else if(u.value.toLowerCase()==="female")h.value=0;else throw new Error('gender must be "Male" or "Female"');return}const c=r.charCodeAt(0);h.value=c%2},m=()=>{C.value=!0};return p(o.value?o.value:l.value),e.watch([l,a,d,o,u],()=>{p(o.value?o.value:l.value)}),{showErrorAvatar:m,isErrorImg:C,code:h,fontSize:f,nameDisplay:n,isNobody:s}},render(){const{imgSrc:t,showErrorAvatar:l,height:a,width:d,isRound:o,isErrorImg:u,code:w,fontSize:N,nameDisplay:s,isNobody:C}=this,f=e.createVNode("img",{src:t,alt:"",onError:l,style:{height:`${a}px`,width:`${d}px`,borderRadius:o?"100%":"0"}},null),h=t&&!u?f:null,n=e.createVNode("span",{class:`devui-avatar-style devui-avatar-background-${w}`,style:{height:`${a}px`,width:`${d}px`,lineHeight:`${a}px`,fontSize:`${N}px`,borderRadius:o?"100%":"0"}},[s]),p=!t&&!C&&(s==null?void 0:s.length)!==0?n:null,y=e.createVNode("span",{class:"devui-avatar-style",style:{borderRadius:o?"100%":"0"}},[e.createVNode(Z,{width:d,height:a},null)]),g=!t&&!C&&(s==null?void 0:s.length)===0?y:null,m=e.createVNode("span",{class:"devui-avatar-style",style:{borderRadius:o?"100%":"0"}},[e.createVNode(x,{width:d,height:a},null)]),r=!t&&C||u?m:null;return e.createVNode("span",{class:"devui-avatar"},[h,p,g,r])}});L.install=function(t){t.component(L.name,L)};var V={title:"Avatar \u5934\u50CF",category:"\u6570\u636E\u5C55\u793A",status:"100%",install(t){t.use(L)}};i.Avatar=L,i.default=V,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|