vue-devui 1.0.0-rc.7 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +163 -146
- package/alert/index.es.js +46 -15
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8230 -231
- package/auto-complete/index.umd.js +29 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +81 -70
- package/avatar/index.umd.js +1 -1
- package/avatar/style.css +1 -1
- package/badge/index.es.js +34 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +5706 -98
- package/button/index.umd.js +27 -1
- package/button/style.css +1 -1
- package/card/index.es.js +38 -13
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8066 -245
- package/checkbox/index.umd.js +27 -1
- package/checkbox/style.css +1 -1
- package/{date-picker → collapse}/index.d.ts +0 -0
- package/collapse/index.es.js +213 -0
- package/collapse/index.umd.js +1 -0
- package/{date-picker → collapse}/package.json +1 -1
- package/collapse/style.css +1 -0
- package/countdown/index.es.js +56 -13
- package/countdown/index.umd.js +1 -1
- package/date-picker-pro/index.d.ts +7 -0
- package/date-picker-pro/index.es.js +12020 -0
- package/date-picker-pro/index.umd.js +27 -0
- package/date-picker-pro/package.json +7 -0
- package/date-picker-pro/style.css +1 -0
- package/drawer/index.es.js +29 -4
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +178 -142
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +742 -107
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +544 -316
- package/form/index.umd.js +17 -17
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +28 -4
- package/fullscreen/index.umd.js +1 -1
- package/fullscreen/style.css +1 -1
- package/grid/index.es.js +71 -50
- package/grid/index.umd.js +1 -1
- package/grid/style.css +1 -1
- package/icon/index.es.js +184 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +34 -11
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8250 -131
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +275 -203
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +34 -6
- package/layout/index.umd.js +1 -1
- package/layout/style.css +1 -1
- package/loading/index.es.js +34 -10
- package/loading/index.umd.js +1 -1
- package/loading/style.css +1 -1
- package/mention/index.d.ts +7 -0
- package/mention/index.es.js +8310 -0
- package/mention/index.umd.js +36 -0
- package/mention/package.json +7 -0
- package/mention/style.css +1 -0
- package/menu/index.d.ts +7 -0
- package/menu/index.es.js +934 -0
- package/menu/index.umd.js +1 -0
- package/menu/package.json +7 -0
- package/menu/style.css +1 -0
- package/message/index.d.ts +7 -0
- package/message/index.es.js +538 -0
- package/message/index.umd.js +1 -0
- package/message/package.json +7 -0
- package/message/style.css +1 -0
- package/modal/index.es.js +359 -170
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +236 -65
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/ButtonGroup.js +3 -0
- package/nuxt/components/CheckboxButton.js +3 -0
- package/nuxt/components/Collapse.js +3 -0
- package/nuxt/components/CollapseItem.js +3 -0
- package/nuxt/components/DRangeDatePickerPro.js +3 -0
- package/nuxt/components/DatePickerPro.js +3 -0
- package/nuxt/components/Icon.js +1 -0
- package/nuxt/components/IconGroup.js +3 -0
- package/nuxt/components/LABEL_DATA.js +3 -0
- package/nuxt/components/Mention.js +3 -0
- package/nuxt/components/Menu.js +3 -0
- package/nuxt/components/MenuItem.js +3 -0
- package/nuxt/components/Message.js +3 -0
- package/nuxt/components/Option.js +3 -0
- package/nuxt/components/OptionGroup.js +3 -0
- package/nuxt/components/RadioButton.js +3 -0
- package/nuxt/components/Step.js +3 -0
- package/nuxt/components/Steps.js +3 -0
- package/nuxt/components/SubMenu.js +3 -0
- package/nuxt/components/TABLE_TOKEN.js +3 -0
- package/nuxt/components/TimePicker.js +3 -0
- package/nuxt/components/TimeSelect.js +3 -0
- package/nuxt/components/animationInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupInjectionKey.js +3 -0
- package/nuxt/components/buttonGroupProps.js +3 -0
- package/nuxt/components/collapseItemProps.js +3 -0
- package/nuxt/components/collapseProps.js +3 -0
- package/nuxt/components/datePickerProCommonProps.js +3 -0
- package/nuxt/components/datePickerProPanelProps.js +3 -0
- package/nuxt/components/datePickerProProps.js +3 -0
- package/nuxt/components/iconProps.js +1 -0
- package/nuxt/components/mentionProps.js +3 -0
- package/nuxt/components/messageProps.js +3 -0
- package/nuxt/components/roundInjectionKey.js +3 -0
- package/nuxt/components/skeletonItemProps.js +3 -0
- package/nuxt/components/stepProps.js +3 -0
- package/nuxt/components/stepsProps.js +3 -0
- package/nuxt/components/svgIconProps.js +3 -0
- package/nuxt/components/tableProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/overlay/index.es.js +84 -125
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +7 -3
- package/pagination/index.es.js +234 -39
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +274 -220
- package/popover/index.umd.js +13 -13
- package/popover/style.css +1 -1
- package/progress/index.es.js +31 -9
- package/progress/index.umd.js +3 -3
- package/progress/style.css +1 -1
- package/radio/index.es.js +7969 -152
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +46 -14
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +169 -22
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +3823 -1090
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9186 -478
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +110 -259
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +143 -146
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +433 -207
- package/splitter/index.umd.js +17 -17
- package/splitter/style.css +1 -1
- package/statistic/index.es.js +34 -16
- package/statistic/index.umd.js +1 -1
- package/statistic/style.css +1 -1
- package/status/index.es.js +26 -2
- package/status/index.umd.js +1 -1
- package/status/style.css +1 -1
- package/steps/index.d.ts +7 -0
- package/steps/index.es.js +386 -0
- package/steps/index.umd.js +1 -0
- package/steps/package.json +7 -0
- package/steps/style.css +1 -0
- package/style.css +1 -1
- package/switch/index.es.js +7802 -59
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +9769 -919
- package/table/index.umd.js +27 -1
- package/table/style.css +1 -1
- package/tabs/index.es.js +309 -96
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +35 -7
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7922 -78
- package/textarea/index.umd.js +35 -1
- package/textarea/style.css +1 -1
- package/time-picker/index.d.ts +7 -0
- package/time-picker/index.es.js +9549 -0
- package/time-picker/index.umd.js +27 -0
- package/time-picker/package.json +7 -0
- package/time-picker/style.css +1 -0
- package/time-select/index.d.ts +7 -0
- package/time-select/index.es.js +9585 -0
- package/time-select/index.umd.js +27 -0
- package/time-select/package.json +7 -0
- package/time-select/style.css +1 -0
- package/timeline/index.es.js +169 -22
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +265 -212
- package/tooltip/index.umd.js +15 -15
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +11343 -795
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +494 -106
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +22849 -13614
- package/vue-devui.umd.js +30 -23
- package/date-picker/index.es.js +0 -1145
- package/date-picker/index.umd.js +0 -1
- package/date-picker/style.css +0 -1
- package/nuxt/components/DatePicker.js +0 -3
- package/nuxt/components/FormControl.js +0 -3
- package/nuxt/components/FormLabel.js +0 -3
- package/nuxt/components/StickSlider.js +0 -3
- package/nuxt/components/formControlProps.js +0 -3
- package/nuxt/components/overlayEmits.js +0 -3
- package/nuxt/components/overlayProps.js +0 -3
package/upload/index.es.js
CHANGED
|
@@ -21,7 +21,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
22
|
return value;
|
|
23
23
|
};
|
|
24
|
-
import { defineComponent, toRefs, createVNode,
|
|
24
|
+
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, watch, Transition, reactive, createApp, onUnmounted, isVNode, ref, getCurrentInstance, withDirectives, resolveComponent, resolveDirective } from "vue";
|
|
25
25
|
const notificationProps = {
|
|
26
26
|
modelValue: {
|
|
27
27
|
type: Boolean,
|
|
@@ -43,6 +43,7 @@ const notificationProps = {
|
|
|
43
43
|
type: Function
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
+
const DEFAULT_PREFIX = "icon";
|
|
46
47
|
const iconProps = {
|
|
47
48
|
name: {
|
|
48
49
|
type: String,
|
|
@@ -50,43 +51,202 @@ const iconProps = {
|
|
|
50
51
|
required: true
|
|
51
52
|
},
|
|
52
53
|
size: {
|
|
53
|
-
type: String,
|
|
54
|
+
type: [Number, String],
|
|
54
55
|
default: "inherit"
|
|
55
56
|
},
|
|
56
57
|
color: {
|
|
57
58
|
type: String,
|
|
58
59
|
default: "inherit"
|
|
59
60
|
},
|
|
61
|
+
component: {
|
|
62
|
+
type: Object,
|
|
63
|
+
default: null
|
|
64
|
+
},
|
|
60
65
|
classPrefix: {
|
|
61
66
|
type: String,
|
|
62
|
-
default:
|
|
67
|
+
default: DEFAULT_PREFIX
|
|
68
|
+
},
|
|
69
|
+
operable: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: false
|
|
72
|
+
},
|
|
73
|
+
disabled: {
|
|
74
|
+
type: Boolean,
|
|
75
|
+
default: false
|
|
76
|
+
},
|
|
77
|
+
rotate: {
|
|
78
|
+
type: [Number, String]
|
|
63
79
|
}
|
|
64
80
|
};
|
|
65
|
-
|
|
66
|
-
name:
|
|
67
|
-
|
|
81
|
+
const svgIconProps = {
|
|
82
|
+
name: {
|
|
83
|
+
type: String,
|
|
84
|
+
default: "",
|
|
85
|
+
required: true
|
|
86
|
+
},
|
|
87
|
+
color: {
|
|
88
|
+
type: String,
|
|
89
|
+
default: "inherit"
|
|
90
|
+
},
|
|
91
|
+
size: {
|
|
92
|
+
type: [Number, String],
|
|
93
|
+
default: "inherit"
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
function createBem(namespace, element, modifier) {
|
|
97
|
+
let cls = namespace;
|
|
98
|
+
if (element) {
|
|
99
|
+
cls += `__${element}`;
|
|
100
|
+
}
|
|
101
|
+
if (modifier) {
|
|
102
|
+
cls += `--${modifier}`;
|
|
103
|
+
}
|
|
104
|
+
return cls;
|
|
105
|
+
}
|
|
106
|
+
function useNamespace(block, needDot = false) {
|
|
107
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
108
|
+
const b = () => createBem(namespace);
|
|
109
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
110
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
111
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
112
|
+
return {
|
|
113
|
+
b,
|
|
114
|
+
e,
|
|
115
|
+
m,
|
|
116
|
+
em
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
var icon = "";
|
|
120
|
+
var svgIcon = defineComponent({
|
|
121
|
+
name: "DSvgIcon",
|
|
122
|
+
props: svgIconProps,
|
|
68
123
|
setup(props) {
|
|
69
124
|
const {
|
|
70
125
|
name,
|
|
71
|
-
size,
|
|
72
126
|
color,
|
|
73
|
-
|
|
127
|
+
size
|
|
74
128
|
} = toRefs(props);
|
|
129
|
+
const ns2 = useNamespace("svg-icon");
|
|
130
|
+
const iconName = computed(() => `#icon-${name.value}`);
|
|
131
|
+
const iconSize = computed(() => {
|
|
132
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
133
|
+
});
|
|
134
|
+
const styles = {
|
|
135
|
+
width: iconSize.value,
|
|
136
|
+
height: iconSize.value
|
|
137
|
+
};
|
|
75
138
|
return () => {
|
|
76
|
-
return
|
|
77
|
-
"
|
|
78
|
-
"
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
139
|
+
return createVNode("svg", {
|
|
140
|
+
"class": ns2.b(),
|
|
141
|
+
"style": styles
|
|
142
|
+
}, [createVNode("use", {
|
|
143
|
+
"xlink:href": iconName.value,
|
|
144
|
+
"fill": color.value
|
|
145
|
+
}, null)]);
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
});
|
|
149
|
+
function isUrl(value) {
|
|
150
|
+
return /^((http|https):)?\/\//.test(value);
|
|
151
|
+
}
|
|
152
|
+
function useIconDom(props, ctx) {
|
|
153
|
+
const {
|
|
154
|
+
component,
|
|
155
|
+
name,
|
|
156
|
+
size,
|
|
157
|
+
color,
|
|
158
|
+
classPrefix,
|
|
159
|
+
rotate
|
|
160
|
+
} = toRefs(props);
|
|
161
|
+
const ns2 = useNamespace("icon");
|
|
162
|
+
const iconSize = computed(() => {
|
|
163
|
+
return typeof size.value === "number" ? `${size.value}px` : size.value;
|
|
164
|
+
});
|
|
165
|
+
const IconComponent = component.value ? resolveDynamicComponent(component.value) : resolveDynamicComponent(svgIcon);
|
|
166
|
+
const imgIconDom = () => {
|
|
167
|
+
return createVNode("img", mergeProps({
|
|
168
|
+
"src": name.value,
|
|
169
|
+
"alt": name.value.split("/")[name.value.split("/").length - 1],
|
|
170
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
171
|
+
"style": {
|
|
172
|
+
width: iconSize.value || "",
|
|
173
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`,
|
|
174
|
+
verticalAlign: "middle"
|
|
175
|
+
}
|
|
176
|
+
}, ctx.attrs), null);
|
|
177
|
+
};
|
|
178
|
+
const svgIconDom = () => {
|
|
179
|
+
return createVNode(IconComponent, mergeProps({
|
|
180
|
+
"name": name.value,
|
|
181
|
+
"color": color.value,
|
|
182
|
+
"size": iconSize.value,
|
|
183
|
+
"class": [(rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
184
|
+
"style": {
|
|
185
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
186
|
+
}
|
|
187
|
+
}, ctx.attrs), null);
|
|
188
|
+
};
|
|
189
|
+
const fontIconDom = () => {
|
|
190
|
+
const fontIconClass = /^icon-/.test(name.value) ? name.value : `${classPrefix.value}-${name.value}`;
|
|
191
|
+
return createVNode("i", mergeProps({
|
|
192
|
+
"class": [classPrefix.value, fontIconClass, (rotate == null ? void 0 : rotate.value) === "infinite" && ns2.m("spin")],
|
|
193
|
+
"style": {
|
|
194
|
+
fontSize: iconSize.value,
|
|
195
|
+
color: color.value,
|
|
196
|
+
transform: `rotate(${rotate == null ? void 0 : rotate.value}deg)`
|
|
197
|
+
}
|
|
198
|
+
}, ctx.attrs), null);
|
|
199
|
+
};
|
|
200
|
+
const iconDom = () => {
|
|
201
|
+
return component.value ? svgIconDom() : isUrl(name.value) ? imgIconDom() : fontIconDom();
|
|
202
|
+
};
|
|
203
|
+
return {
|
|
204
|
+
iconDom
|
|
205
|
+
};
|
|
206
|
+
}
|
|
207
|
+
var Icon = defineComponent({
|
|
208
|
+
name: "DIcon",
|
|
209
|
+
props: iconProps,
|
|
210
|
+
emits: ["click"],
|
|
211
|
+
setup(props, ctx) {
|
|
212
|
+
const {
|
|
213
|
+
disabled,
|
|
214
|
+
operable
|
|
215
|
+
} = toRefs(props);
|
|
216
|
+
const {
|
|
217
|
+
iconDom
|
|
218
|
+
} = useIconDom(props, ctx);
|
|
219
|
+
const ns2 = useNamespace("icon");
|
|
220
|
+
const wrapClassed = computed(() => ({
|
|
221
|
+
[ns2.e("container")]: true,
|
|
222
|
+
[ns2.m("disabled")]: disabled.value,
|
|
223
|
+
[ns2.m("operable")]: operable.value
|
|
224
|
+
}));
|
|
225
|
+
const onClick = (e) => {
|
|
226
|
+
if (disabled.value) {
|
|
227
|
+
return;
|
|
228
|
+
}
|
|
229
|
+
ctx.emit("click", e);
|
|
230
|
+
};
|
|
231
|
+
return () => {
|
|
232
|
+
var _a, _b, _c, _d;
|
|
233
|
+
return createVNode("div", {
|
|
234
|
+
"class": wrapClassed.value,
|
|
235
|
+
"onClick": onClick
|
|
236
|
+
}, [(_b = (_a = ctx.slots).prefix) == null ? void 0 : _b.call(_a), iconDom(), (_d = (_c = ctx.slots).suffix) == null ? void 0 : _d.call(_c)]);
|
|
237
|
+
};
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
var iconGroup = "";
|
|
241
|
+
defineComponent({
|
|
242
|
+
name: "DIconGroup",
|
|
243
|
+
setup(_, ctx) {
|
|
244
|
+
const ns2 = useNamespace("icon-group");
|
|
245
|
+
return () => {
|
|
246
|
+
var _a, _b;
|
|
247
|
+
return createVNode("div", {
|
|
248
|
+
"class": ns2.b()
|
|
249
|
+
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]);
|
|
90
250
|
};
|
|
91
251
|
}
|
|
92
252
|
});
|
|
@@ -95,8 +255,9 @@ var Close = defineComponent({
|
|
|
95
255
|
setup(props, {
|
|
96
256
|
emit
|
|
97
257
|
}) {
|
|
258
|
+
const ns2 = useNamespace("notification");
|
|
98
259
|
return () => createVNode("div", {
|
|
99
|
-
"class": "
|
|
260
|
+
"class": ns2.e("icon-close"),
|
|
100
261
|
"onClick": (e) => emit("click", e)
|
|
101
262
|
}, [createVNode(Icon, {
|
|
102
263
|
"name": "close",
|
|
@@ -104,15 +265,21 @@ var Close = defineComponent({
|
|
|
104
265
|
}, null)]);
|
|
105
266
|
}
|
|
106
267
|
});
|
|
268
|
+
const ns = useNamespace("notification");
|
|
269
|
+
const XLINK = {
|
|
270
|
+
"xmlns:xlink": "http://www.w3.org/1999/xlink"
|
|
271
|
+
};
|
|
272
|
+
const XLINK_HREF = {
|
|
273
|
+
"xlink:href": "#path-s"
|
|
274
|
+
};
|
|
107
275
|
function SuccessIcon() {
|
|
108
|
-
return createVNode("svg", {
|
|
276
|
+
return createVNode("svg", mergeProps({
|
|
109
277
|
"width": "16px",
|
|
110
278
|
"height": "16px",
|
|
111
279
|
"viewBox": "0 0 16 16",
|
|
112
280
|
"version": "1.1",
|
|
113
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
114
|
-
|
|
115
|
-
}, [createVNode("defs", null, [createVNode("polygon", {
|
|
281
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
282
|
+
}, XLINK), [createVNode("defs", null, [createVNode("polygon", {
|
|
116
283
|
"id": "path-s",
|
|
117
284
|
"points": "6.53553391 9.77817459 12.1923882 4.12132034 13.6066017 5.53553391 6.53553391 12.6066017 3 9.07106781 4.41421356 7.65685425 6.53553391 9.77817459"
|
|
118
285
|
}, null)]), createVNode("g", {
|
|
@@ -124,66 +291,60 @@ function SuccessIcon() {
|
|
|
124
291
|
}, [createVNode("mask", {
|
|
125
292
|
"id": "mask-2",
|
|
126
293
|
"fill": "white"
|
|
127
|
-
}, [createVNode("use", {
|
|
128
|
-
"xlink:href": "#path-s"
|
|
129
|
-
}, null)]), createVNode("use", {
|
|
294
|
+
}, [createVNode("use", XLINK_HREF, null)]), createVNode("use", mergeProps({
|
|
130
295
|
"id": "Mask",
|
|
131
|
-
"class": "
|
|
132
|
-
|
|
133
|
-
}, null)])]);
|
|
296
|
+
"class": ns.e("image-success-path")
|
|
297
|
+
}, XLINK_HREF), null)])]);
|
|
134
298
|
}
|
|
135
299
|
function WarningIcon() {
|
|
136
|
-
return createVNode("svg", {
|
|
300
|
+
return createVNode("svg", mergeProps({
|
|
137
301
|
"width": "16px",
|
|
138
302
|
"height": "16px",
|
|
139
303
|
"viewBox": "0 0 16 16",
|
|
140
304
|
"version": "1.1",
|
|
141
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
142
|
-
|
|
143
|
-
}, [createVNode("g", {
|
|
305
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
306
|
+
}, XLINK), [createVNode("g", {
|
|
144
307
|
"stroke": "none",
|
|
145
308
|
"stroke-width": "1",
|
|
146
309
|
"fill": "none",
|
|
147
310
|
"fill-rule": "evenodd"
|
|
148
311
|
}, [createVNode("path", {
|
|
149
|
-
"class": "
|
|
150
|
-
"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"
|
|
312
|
+
"class": ns.e("warning-outer"),
|
|
313
|
+
"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"
|
|
151
314
|
}, null), createVNode("path", {
|
|
152
|
-
"class": "
|
|
315
|
+
"class": ns.e("warning-inner"),
|
|
153
316
|
"stroke-width": "0.3",
|
|
154
317
|
"fill-rule": "nonzero",
|
|
155
318
|
"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"
|
|
156
319
|
}, null)])]);
|
|
157
320
|
}
|
|
158
321
|
function InfoIcon() {
|
|
159
|
-
return createVNode("svg", {
|
|
322
|
+
return createVNode("svg", mergeProps({
|
|
160
323
|
"width": "16px",
|
|
161
324
|
"height": "16px",
|
|
162
325
|
"viewBox": "0 0 16 16",
|
|
163
326
|
"version": "1.1",
|
|
164
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
165
|
-
|
|
166
|
-
}, [createVNode("g", {
|
|
327
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
328
|
+
}, XLINK), [createVNode("g", {
|
|
167
329
|
"id": "info",
|
|
168
330
|
"stroke": "none",
|
|
169
331
|
"stroke-width": "1",
|
|
170
332
|
"fill": "none",
|
|
171
333
|
"fill-rule": "evenodd"
|
|
172
334
|
}, [createVNode("path", {
|
|
173
|
-
"class": "
|
|
335
|
+
"class": ns.e("image-info-path"),
|
|
174
336
|
"d": "M7,13 L7,6 L9,6 L9,13 L7,13 Z M7,5 L7,3 L9,3 L9,5 L7,5 Z",
|
|
175
337
|
"id": "info"
|
|
176
338
|
}, null)])]);
|
|
177
339
|
}
|
|
178
340
|
function ErrorIcon() {
|
|
179
|
-
return createVNode("svg", {
|
|
341
|
+
return createVNode("svg", mergeProps({
|
|
180
342
|
"width": "16px",
|
|
181
343
|
"height": "16px",
|
|
182
344
|
"viewBox": "0 0 16 16",
|
|
183
345
|
"version": "1.1",
|
|
184
|
-
"xmlns": "http://www.w3.org/2000/svg"
|
|
185
|
-
|
|
186
|
-
}, [createVNode("defs", null, [createVNode("polygon", {
|
|
346
|
+
"xmlns": "http://www.w3.org/2000/svg"
|
|
347
|
+
}, XLINK), [createVNode("defs", null, [createVNode("polygon", {
|
|
187
348
|
"id": "path-e",
|
|
188
349
|
"points": "8.07106781 6.65685425 10.8994949 3.82842712 12.3137085 5.24264069 9.48528137 8.07106781 12.3137085 10.8994949 10.8994949 12.3137085 8.07106781 9.48528137 5.24264069 12.3137085 3.82842712 10.8994949 6.65685425 8.07106781 3.82842712 5.24264069 5.24264069 3.82842712"
|
|
189
350
|
}, null)]), createVNode("g", {
|
|
@@ -195,13 +356,10 @@ function ErrorIcon() {
|
|
|
195
356
|
}, [createVNode("mask", {
|
|
196
357
|
"id": "mask-2",
|
|
197
358
|
"fill": "white"
|
|
198
|
-
}, [createVNode("use", {
|
|
199
|
-
"xlink:href": "#path-e"
|
|
200
|
-
}, null)]), createVNode("use", {
|
|
359
|
+
}, [createVNode("use", XLINK_HREF, null)]), createVNode("use", mergeProps({
|
|
201
360
|
"id": "Mask",
|
|
202
|
-
"class": "
|
|
203
|
-
|
|
204
|
-
}, null)])]);
|
|
361
|
+
"class": ns.e("image-error-path")
|
|
362
|
+
}, XLINK_HREF), null)])]);
|
|
205
363
|
}
|
|
206
364
|
var TypeIcon = defineComponent({
|
|
207
365
|
props: {
|
|
@@ -214,9 +372,10 @@ var TypeIcon = defineComponent({
|
|
|
214
372
|
const {
|
|
215
373
|
type
|
|
216
374
|
} = toRefs(props);
|
|
375
|
+
const ns2 = useNamespace("notification");
|
|
217
376
|
const classes = computed(() => ({
|
|
218
|
-
"
|
|
219
|
-
[
|
|
377
|
+
[ns2.e("image")]: true,
|
|
378
|
+
[ns2.em("image", type.value)]: true
|
|
220
379
|
}));
|
|
221
380
|
return () => createVNode("span", {
|
|
222
381
|
"class": classes.value
|
|
@@ -235,7 +394,7 @@ function useEvent(props, emit) {
|
|
|
235
394
|
let timestamp;
|
|
236
395
|
const close2 = () => {
|
|
237
396
|
var _a;
|
|
238
|
-
clearTimeout(timer);
|
|
397
|
+
timer && clearTimeout(timer);
|
|
239
398
|
timer = null;
|
|
240
399
|
(_a = props.onClose) == null ? void 0 : _a.call(props);
|
|
241
400
|
emit("update:modelValue", false);
|
|
@@ -288,6 +447,7 @@ var Notification = defineComponent({
|
|
|
288
447
|
close: close2,
|
|
289
448
|
handleDestroy
|
|
290
449
|
} = useEvent(props, emit);
|
|
450
|
+
const ns2 = useNamespace("notification");
|
|
291
451
|
return () => createVNode(Transition, {
|
|
292
452
|
"name": "notification-fade",
|
|
293
453
|
"onAfterLeave": handleDestroy
|
|
@@ -295,23 +455,23 @@ var Notification = defineComponent({
|
|
|
295
455
|
default: () => {
|
|
296
456
|
var _a;
|
|
297
457
|
return [modelValue.value && createVNode("div", {
|
|
298
|
-
"class":
|
|
458
|
+
"class": ns2.b()
|
|
299
459
|
}, [createVNode("div", {
|
|
300
460
|
"class": classes.value,
|
|
301
461
|
"onMouseenter": interrupt,
|
|
302
462
|
"onMouseleave": removeReset
|
|
303
463
|
}, [createVNode("div", {
|
|
304
|
-
"class": "
|
|
464
|
+
"class": ns2.e("item")
|
|
305
465
|
}, [createVNode(Close, {
|
|
306
466
|
"onClick": close2
|
|
307
467
|
}, null), title.value && createVNode(TypeIcon, {
|
|
308
468
|
"type": type.value
|
|
309
469
|
}, null), createVNode("div", {
|
|
310
|
-
"class": "
|
|
470
|
+
"class": ns2.e("message")
|
|
311
471
|
}, [createVNode("span", {
|
|
312
|
-
"class": "
|
|
472
|
+
"class": ns2.e("title")
|
|
313
473
|
}, [title.value]), createVNode("span", {
|
|
314
|
-
"class": "
|
|
474
|
+
"class": ns2.e("content")
|
|
315
475
|
}, [(_a = slots.default) == null ? void 0 : _a.call(slots)])])])])])];
|
|
316
476
|
}
|
|
317
477
|
});
|
|
@@ -327,13 +487,24 @@ const defaultOptions = {
|
|
|
327
487
|
};
|
|
328
488
|
function initInstance(props, content) {
|
|
329
489
|
const container = document.createElement("div");
|
|
490
|
+
container.classList.add("notification__warpper");
|
|
491
|
+
const lastChild = document.body.lastElementChild;
|
|
492
|
+
let offset_Top = 50;
|
|
493
|
+
if (lastChild == null ? void 0 : lastChild.classList.contains("notification__warpper")) {
|
|
494
|
+
const notification2 = lastChild.lastElementChild;
|
|
495
|
+
const rects = notification2.getBoundingClientRect();
|
|
496
|
+
const height = rects.height;
|
|
497
|
+
const top = rects.top;
|
|
498
|
+
offset_Top = height + top;
|
|
499
|
+
}
|
|
330
500
|
const app = createApp({
|
|
331
501
|
setup() {
|
|
332
502
|
onUnmounted(() => {
|
|
333
503
|
document.body.removeChild(container);
|
|
334
504
|
});
|
|
335
505
|
return () => createVNode(Notification, mergeProps(props, {
|
|
336
|
-
"onDestroy": app.unmount
|
|
506
|
+
"onDestroy": app.unmount,
|
|
507
|
+
"style": [`top: ${offset_Top}px`]
|
|
337
508
|
}), _isSlot(content) ? content : {
|
|
338
509
|
default: () => [content]
|
|
339
510
|
});
|
|
@@ -361,7 +532,7 @@ class NotificationService {
|
|
|
361
532
|
initInstance(props, content);
|
|
362
533
|
props.modelValue = true;
|
|
363
534
|
clearTimeout(timer);
|
|
364
|
-
if (options.duration) {
|
|
535
|
+
if (options.duration && props.onClose) {
|
|
365
536
|
timer = setTimeout(props.onClose, options.duration);
|
|
366
537
|
}
|
|
367
538
|
}
|
|
@@ -416,7 +587,7 @@ const uploadProps = {
|
|
|
416
587
|
},
|
|
417
588
|
placeholder: {
|
|
418
589
|
type: String,
|
|
419
|
-
default: "
|
|
590
|
+
default: ""
|
|
420
591
|
},
|
|
421
592
|
modelValue: {
|
|
422
593
|
type: Array,
|
|
@@ -455,30 +626,40 @@ const uploadProps = {
|
|
|
455
626
|
type: Function,
|
|
456
627
|
default: void 0
|
|
457
628
|
},
|
|
458
|
-
|
|
629
|
+
onError: {
|
|
630
|
+
type: Function,
|
|
631
|
+
default: void 0
|
|
632
|
+
},
|
|
633
|
+
onSuccess: {
|
|
459
634
|
type: Function,
|
|
460
635
|
default: void 0
|
|
461
636
|
},
|
|
462
|
-
|
|
637
|
+
onExceed: {
|
|
638
|
+
type: Function,
|
|
639
|
+
default: void 0
|
|
640
|
+
},
|
|
641
|
+
onProgress: {
|
|
642
|
+
type: Function,
|
|
643
|
+
default: void 0
|
|
644
|
+
},
|
|
645
|
+
onPreview: {
|
|
463
646
|
type: Function,
|
|
464
647
|
default: void 0
|
|
465
648
|
},
|
|
466
649
|
oneTimeUpload: {
|
|
467
650
|
type: Boolean,
|
|
468
651
|
default: false
|
|
652
|
+
},
|
|
653
|
+
limit: {
|
|
654
|
+
type: Number,
|
|
655
|
+
default: 0
|
|
656
|
+
},
|
|
657
|
+
httpRequest: {
|
|
658
|
+
type: Function,
|
|
659
|
+
default: void 0
|
|
469
660
|
}
|
|
470
661
|
};
|
|
471
|
-
const
|
|
472
|
-
const getBeyondMaximalFileSizeMsg = (filename, maximalSize) => {
|
|
473
|
-
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
474
|
-
};
|
|
475
|
-
const getNotAllowedFileTypeMsg = (filename, scope) => {
|
|
476
|
-
return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
477
|
-
};
|
|
478
|
-
const getExistSameNameFilesMsg = (sameNames) => {
|
|
479
|
-
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
480
|
-
};
|
|
481
|
-
const useSelectFiles = () => {
|
|
662
|
+
const useSelectFiles = (t) => {
|
|
482
663
|
const BEYOND_MAXIMAL_FILE_SIZE_MSG = ref("");
|
|
483
664
|
const simulateClickEvent = (input) => {
|
|
484
665
|
const evt = document.createEvent("MouseEvents");
|
|
@@ -539,13 +720,13 @@ const useSelectFiles = () => {
|
|
|
539
720
|
if (!isAllowedFileType(accept, file)) {
|
|
540
721
|
return {
|
|
541
722
|
checkError: true,
|
|
542
|
-
errorMsg: getNotAllowedFileTypeMsg(file.name, accept)
|
|
723
|
+
errorMsg: t("getNotAllowedFileTypeMsg")(file.name, accept)
|
|
543
724
|
};
|
|
544
725
|
}
|
|
545
726
|
if (uploadOptions && beyondMaximalSize(file.size, uploadOptions.maximumSize)) {
|
|
546
727
|
return {
|
|
547
728
|
checkError: true,
|
|
548
|
-
errorMsg: getBeyondMaximalFileSizeMsg(file.name, uploadOptions.maximumSize || 0)
|
|
729
|
+
errorMsg: t("getBeyondMaximalFileSizeMsg")(file.name, uploadOptions.maximumSize || 0)
|
|
549
730
|
};
|
|
550
731
|
}
|
|
551
732
|
return { checkError: false, errorMsg: void 0 };
|
|
@@ -559,7 +740,7 @@ const useSelectFiles = () => {
|
|
|
559
740
|
};
|
|
560
741
|
const checkAllFilesSize = (fileSize, maximumSize) => {
|
|
561
742
|
if (beyondMaximalSize(fileSize, maximumSize)) {
|
|
562
|
-
BEYOND_MAXIMAL_FILE_SIZE_MSG.value = getAllFilesBeyondMaximalFileSizeMsg(maximumSize);
|
|
743
|
+
BEYOND_MAXIMAL_FILE_SIZE_MSG.value = t("getAllFilesBeyondMaximalFileSizeMsg")(maximumSize);
|
|
563
744
|
return { checkError: true, errorMsg: BEYOND_MAXIMAL_FILE_SIZE_MSG.value };
|
|
564
745
|
}
|
|
565
746
|
};
|
|
@@ -765,11 +946,181 @@ const useUpload = () => {
|
|
|
765
946
|
};
|
|
766
947
|
};
|
|
767
948
|
var upload = "";
|
|
949
|
+
function deepAssign(...objects) {
|
|
950
|
+
const isObject = (obj) => obj && typeof obj === "object";
|
|
951
|
+
return objects.reduce((prev, from) => {
|
|
952
|
+
Object.keys(from).forEach((key) => {
|
|
953
|
+
const pVal = prev[key];
|
|
954
|
+
const oVal = from[key];
|
|
955
|
+
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
956
|
+
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
957
|
+
} else if (isObject(pVal) && isObject(oVal)) {
|
|
958
|
+
prev[key] = deepAssign(pVal, oVal);
|
|
959
|
+
} else {
|
|
960
|
+
prev[key] = oVal;
|
|
961
|
+
}
|
|
962
|
+
});
|
|
963
|
+
return prev;
|
|
964
|
+
}, {});
|
|
965
|
+
}
|
|
966
|
+
var zhCN = {
|
|
967
|
+
pagination: {
|
|
968
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
969
|
+
goToText: "\u8DF3\u81F3"
|
|
970
|
+
},
|
|
971
|
+
accordion: {
|
|
972
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
973
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
974
|
+
},
|
|
975
|
+
autoCompleteDropdown: {
|
|
976
|
+
latestInput: "\u6700\u8FD1\u8F93\u5165"
|
|
977
|
+
},
|
|
978
|
+
cascaderList: {
|
|
979
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
980
|
+
},
|
|
981
|
+
colorPicker: {
|
|
982
|
+
foundationPanel: "\u57FA\u7840\u9762\u677F",
|
|
983
|
+
advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
|
|
984
|
+
},
|
|
985
|
+
datePickerPro: {
|
|
986
|
+
ok: "\u786E\u5B9A",
|
|
987
|
+
placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
|
|
988
|
+
month1: "1\u6708",
|
|
989
|
+
month2: "2\u6708",
|
|
990
|
+
month3: "3\u6708",
|
|
991
|
+
month4: "4\u6708",
|
|
992
|
+
month5: "5\u6708",
|
|
993
|
+
month6: "6\u6708",
|
|
994
|
+
month7: "7\u6708",
|
|
995
|
+
month8: "8\u6708",
|
|
996
|
+
month9: "9\u6708",
|
|
997
|
+
month10: "10\u6708",
|
|
998
|
+
month11: "11\u6708",
|
|
999
|
+
month12: "12\u6708",
|
|
1000
|
+
year: "\u5E74",
|
|
1001
|
+
startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
|
|
1002
|
+
endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
|
|
1003
|
+
getWeekDays() {
|
|
1004
|
+
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
1005
|
+
},
|
|
1006
|
+
getTimeArr() {
|
|
1007
|
+
return ["\u65F6", "\u5206", "\u79D2"];
|
|
1008
|
+
},
|
|
1009
|
+
getYearMonthStr(year, month) {
|
|
1010
|
+
return `${year}\u5E74${month}\u6708`;
|
|
1011
|
+
}
|
|
1012
|
+
},
|
|
1013
|
+
editableSelect: {
|
|
1014
|
+
noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
1015
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
1016
|
+
},
|
|
1017
|
+
input: {
|
|
1018
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
1019
|
+
},
|
|
1020
|
+
splitterBar: {
|
|
1021
|
+
collapse: "\u6536\u8D77",
|
|
1022
|
+
expand: "\u5C55\u5F00"
|
|
1023
|
+
},
|
|
1024
|
+
stepsGuide: {
|
|
1025
|
+
previous: "\u4E0A\u4E00\u6B65",
|
|
1026
|
+
continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
|
|
1027
|
+
ok: "\u6211\u77E5\u9053\u5566"
|
|
1028
|
+
},
|
|
1029
|
+
table: {
|
|
1030
|
+
selectAll: "\u5168\u9009",
|
|
1031
|
+
ok: "\u786E\u5B9A"
|
|
1032
|
+
},
|
|
1033
|
+
timePopup: {
|
|
1034
|
+
ok: "\u786E\u5B9A"
|
|
1035
|
+
},
|
|
1036
|
+
transfer: {
|
|
1037
|
+
unit: "\u9879",
|
|
1038
|
+
panelUnit: "\u9879",
|
|
1039
|
+
headerUnit: "\u9879",
|
|
1040
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
1041
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
|
|
1042
|
+
},
|
|
1043
|
+
tree: {
|
|
1044
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
1045
|
+
newNode: "\u65B0\u8282\u70B9",
|
|
1046
|
+
selectPlaceholder: "\u8BF7\u9009\u62E9"
|
|
1047
|
+
},
|
|
1048
|
+
upload: {
|
|
1049
|
+
placeholder: "\u9009\u62E9\u6587\u4EF6",
|
|
1050
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
1051
|
+
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
1052
|
+
},
|
|
1053
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
1054
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
1055
|
+
},
|
|
1056
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
1057
|
+
return `\u6700\u5927\u652F\u6301\u4E0A\u4F20${maximalSize}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`;
|
|
1058
|
+
},
|
|
1059
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
1060
|
+
return `\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${scope}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${filename}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
1061
|
+
}
|
|
1062
|
+
},
|
|
1063
|
+
search: {
|
|
1064
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
1065
|
+
},
|
|
1066
|
+
select: {
|
|
1067
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
1068
|
+
noDataText: "\u65E0\u6570\u636E",
|
|
1069
|
+
noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
1070
|
+
loadingText: "\u52A0\u8F7D\u4E2D..."
|
|
1071
|
+
},
|
|
1072
|
+
tagInput: {
|
|
1073
|
+
maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
1074
|
+
},
|
|
1075
|
+
timeSelect: {
|
|
1076
|
+
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
const lang = ref("zh-CN");
|
|
1080
|
+
let langMessages = reactive({
|
|
1081
|
+
[lang.value]: zhCN
|
|
1082
|
+
});
|
|
1083
|
+
const Locale = {
|
|
1084
|
+
messages() {
|
|
1085
|
+
return langMessages[lang.value];
|
|
1086
|
+
},
|
|
1087
|
+
lang() {
|
|
1088
|
+
return lang.value;
|
|
1089
|
+
},
|
|
1090
|
+
use(newLang, newMessages) {
|
|
1091
|
+
lang.value = newLang;
|
|
1092
|
+
this.add({ [newLang]: newMessages });
|
|
1093
|
+
},
|
|
1094
|
+
add(newMessages = {}) {
|
|
1095
|
+
langMessages = deepAssign(langMessages, newMessages);
|
|
1096
|
+
}
|
|
1097
|
+
};
|
|
1098
|
+
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
1099
|
+
function get(object, path) {
|
|
1100
|
+
const keys = path.split(".");
|
|
1101
|
+
let result = object;
|
|
1102
|
+
keys.forEach((key) => {
|
|
1103
|
+
var _a;
|
|
1104
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
1105
|
+
});
|
|
1106
|
+
return result;
|
|
1107
|
+
}
|
|
1108
|
+
function createI18nTranslate(name, app, newPrefix) {
|
|
1109
|
+
const prefix = newPrefix || camelize(name) + ".";
|
|
1110
|
+
return (path) => {
|
|
1111
|
+
var _a;
|
|
1112
|
+
const messages = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
1113
|
+
const message = get(messages, prefix + path) || get(messages, path);
|
|
1114
|
+
return message;
|
|
1115
|
+
};
|
|
1116
|
+
}
|
|
768
1117
|
var Upload = defineComponent({
|
|
769
1118
|
name: "DUpload",
|
|
770
1119
|
props: uploadProps,
|
|
771
1120
|
emits: ["fileDrop", "fileOver", "fileSelect", "deleteUploadedFile", "update:modelValue"],
|
|
772
1121
|
setup(props, ctx) {
|
|
1122
|
+
const app = getCurrentInstance();
|
|
1123
|
+
const t = createI18nTranslate("DUpload", app);
|
|
773
1124
|
const {
|
|
774
1125
|
uploadOptions,
|
|
775
1126
|
placeholder,
|
|
@@ -781,14 +1132,20 @@ var Upload = defineComponent({
|
|
|
781
1132
|
modelValue,
|
|
782
1133
|
multiple,
|
|
783
1134
|
accept,
|
|
784
|
-
webkitdirectory
|
|
1135
|
+
webkitdirectory,
|
|
1136
|
+
limit,
|
|
1137
|
+
httpRequest
|
|
785
1138
|
} = toRefs(props);
|
|
1139
|
+
const ns2 = useNamespace("upload");
|
|
1140
|
+
const inputGroupNs = useNamespace("input-group");
|
|
1141
|
+
const formControlNs = useNamespace("form-control");
|
|
1142
|
+
const inputGroupAddOnNs = useNamespace("input-group-addon");
|
|
786
1143
|
const {
|
|
787
1144
|
triggerSelectFiles,
|
|
788
1145
|
_validateFiles,
|
|
789
1146
|
triggerDropFiles,
|
|
790
1147
|
checkAllFilesSize
|
|
791
|
-
} = useSelectFiles();
|
|
1148
|
+
} = useSelectFiles(t);
|
|
792
1149
|
const {
|
|
793
1150
|
fileUploaders,
|
|
794
1151
|
addFile,
|
|
@@ -800,7 +1157,8 @@ var Upload = defineComponent({
|
|
|
800
1157
|
_oneTimeUpload,
|
|
801
1158
|
getSameNameFiles
|
|
802
1159
|
} = useUpload();
|
|
803
|
-
const
|
|
1160
|
+
const isDropOver = ref(false);
|
|
1161
|
+
const selectedFiles = ref([]);
|
|
804
1162
|
const alertMsg = (errorMsg) => {
|
|
805
1163
|
NotificationService.open({
|
|
806
1164
|
type: "warning",
|
|
@@ -828,7 +1186,7 @@ var Upload = defineComponent({
|
|
|
828
1186
|
}
|
|
829
1187
|
};
|
|
830
1188
|
const onFileOver = (event) => {
|
|
831
|
-
|
|
1189
|
+
isDropOver.value = event;
|
|
832
1190
|
ctx.emit("fileOver", event);
|
|
833
1191
|
};
|
|
834
1192
|
const deleteUploadedFile = (file) => {
|
|
@@ -839,7 +1197,7 @@ var Upload = defineComponent({
|
|
|
839
1197
|
ctx.emit("update:modelValue", newUploadedFiles);
|
|
840
1198
|
};
|
|
841
1199
|
const onDeleteFile = (event, file, status) => {
|
|
842
|
-
event.stopPropagation();
|
|
1200
|
+
event == null ? void 0 : event.stopPropagation();
|
|
843
1201
|
if (status === UploadStatus.uploaded) {
|
|
844
1202
|
deleteUploadedFile(file);
|
|
845
1203
|
}
|
|
@@ -868,20 +1226,33 @@ var Upload = defineComponent({
|
|
|
868
1226
|
removeFiles();
|
|
869
1227
|
return;
|
|
870
1228
|
}
|
|
1229
|
+
if (typeof (httpRequest == null ? void 0 : httpRequest.value) === "function") {
|
|
1230
|
+
const files = fileUploaders.value.map((tempFileUploader) => tempFileUploader.file);
|
|
1231
|
+
httpRequest.value(files);
|
|
1232
|
+
return;
|
|
1233
|
+
}
|
|
871
1234
|
const uploadObservable = oneTimeUpload.value ? _oneTimeUpload() : upload2(fileUploader);
|
|
1235
|
+
props.onProgress && props.onProgress(selectedFiles.value, modelValue.value);
|
|
872
1236
|
uploadObservable == null ? void 0 : uploadObservable.then((results) => {
|
|
873
|
-
props
|
|
1237
|
+
props.onSuccess && props.onSuccess(results);
|
|
874
1238
|
const newFiles = results.map((result) => result.file);
|
|
875
1239
|
const newUploadedFiles = [...newFiles, ...modelValue.value];
|
|
876
1240
|
ctx.emit("update:modelValue", newUploadedFiles);
|
|
1241
|
+
props.onChange && props.onChange(newFiles, newUploadedFiles);
|
|
877
1242
|
}).catch((error) => {
|
|
878
|
-
props
|
|
1243
|
+
props.onError && props.onError(error);
|
|
1244
|
+
props.onChange && props.onChange([error.file], modelValue.value);
|
|
879
1245
|
});
|
|
880
1246
|
});
|
|
881
1247
|
};
|
|
882
1248
|
const _dealFiles = (promise) => {
|
|
883
1249
|
resetSameNameFiles();
|
|
884
1250
|
promise.then((files) => {
|
|
1251
|
+
if (limit.value && modelValue.value.length + files.length > limit.value) {
|
|
1252
|
+
props.onExceed && props.onExceed(files, modelValue.value);
|
|
1253
|
+
return;
|
|
1254
|
+
}
|
|
1255
|
+
props.onChange && props.onChange(files, modelValue.value);
|
|
885
1256
|
files.forEach((file) => {
|
|
886
1257
|
if (!multiple.value) {
|
|
887
1258
|
removeFiles();
|
|
@@ -891,10 +1262,10 @@ var Upload = defineComponent({
|
|
|
891
1262
|
checkValid();
|
|
892
1263
|
const sameNameFiles = getSameNameFiles();
|
|
893
1264
|
if ((uploadOptions == null ? void 0 : uploadOptions.value) && uploadOptions.value.checkSameName && sameNameFiles.length) {
|
|
894
|
-
alertMsg(getExistSameNameFilesMsg(sameNameFiles));
|
|
1265
|
+
alertMsg(t("getExistSameNameFilesMsg")(sameNameFiles));
|
|
895
1266
|
}
|
|
896
|
-
|
|
897
|
-
ctx.emit("fileSelect", selectedFiles);
|
|
1267
|
+
selectedFiles.value = fileUploaders.value.filter((fileUploader) => fileUploader.status === UploadStatus.preLoad).map((fileUploader) => fileUploader.file);
|
|
1268
|
+
ctx.emit("fileSelect", selectedFiles.value);
|
|
898
1269
|
if (autoUpload.value) {
|
|
899
1270
|
fileUpload();
|
|
900
1271
|
}
|
|
@@ -913,37 +1284,54 @@ var Upload = defineComponent({
|
|
|
913
1284
|
}));
|
|
914
1285
|
};
|
|
915
1286
|
const onFileDrop = (files) => {
|
|
916
|
-
|
|
1287
|
+
isDropOver.value = false;
|
|
917
1288
|
_dealFiles(triggerDropFiles(files));
|
|
918
1289
|
ctx.emit("fileDrop", files);
|
|
919
1290
|
};
|
|
1291
|
+
const submit = (event, fileUploader) => {
|
|
1292
|
+
fileUpload(event, fileUploader);
|
|
1293
|
+
};
|
|
1294
|
+
const clearFiles = (event) => {
|
|
1295
|
+
fileUploaders.value.forEach((fileUploader) => {
|
|
1296
|
+
onDeleteFile(event, fileUploader.file, fileUploader.status);
|
|
1297
|
+
});
|
|
1298
|
+
};
|
|
1299
|
+
const clickSelectedFile = (event, file) => {
|
|
1300
|
+
event == null ? void 0 : event.stopPropagation();
|
|
1301
|
+
props.onPreview && props.onPreview(file);
|
|
1302
|
+
};
|
|
1303
|
+
ctx.expose({
|
|
1304
|
+
submit,
|
|
1305
|
+
clearFiles
|
|
1306
|
+
});
|
|
920
1307
|
return () => {
|
|
921
1308
|
var _a, _b, _c, _d;
|
|
922
1309
|
return createVNode("div", null, [withDirectives(createVNode("div", {
|
|
923
|
-
"class":
|
|
924
|
-
"style": `border: ${
|
|
1310
|
+
"class": ns2.b(),
|
|
1311
|
+
"style": `border: ${isDropOver.value ? "1px solid #15bf15" : "0"}`
|
|
925
1312
|
}, [((_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)) ? createVNode("div", {
|
|
926
1313
|
"onClick": handleClick
|
|
927
1314
|
}, [ctx.slots.default()]) : createVNode("div", {
|
|
928
|
-
"class":
|
|
1315
|
+
"class": [inputGroupNs.b(), disabled.value ? "disabled" : ""],
|
|
929
1316
|
"onClick": handleClick
|
|
930
1317
|
}, [fileUploaders.value.length === 0 && createVNode("div", {
|
|
931
|
-
"class": "
|
|
932
|
-
}, [placeholder.value]), fileUploaders.value.length > 0 && createVNode("ul", {
|
|
933
|
-
"class": "
|
|
1318
|
+
"class": [formControlNs.b(), ns2.e("placeholder")]
|
|
1319
|
+
}, [placeholder.value || t("placeholder")]), fileUploaders.value.length > 0 && createVNode("ul", {
|
|
1320
|
+
"class": [formControlNs.b(), ns2.e("files-list")]
|
|
934
1321
|
}, [fileUploaders.value.map((fileUploader, index2) => createVNode("li", {
|
|
935
1322
|
"key": index2,
|
|
936
|
-
"class": "
|
|
937
|
-
"style": "display: inline-block;
|
|
938
|
-
"title": fileUploader.file.name
|
|
1323
|
+
"class": [ns2.e("file-item"), ns2.e("file-tag")],
|
|
1324
|
+
"style": "display: inline-block;",
|
|
1325
|
+
"title": fileUploader.file.name,
|
|
1326
|
+
"onClick": (event) => clickSelectedFile(event, fileUploader.file)
|
|
939
1327
|
}, [createVNode("span", {
|
|
940
|
-
"class":
|
|
1328
|
+
"class": [ns2.e("filename"), fileUploader.status === UploadStatus.failed ? ns2.m("failed-color") : ""]
|
|
941
1329
|
}, [fileUploader.file.name]), createVNode(resolveComponent("d-icon"), {
|
|
942
1330
|
"name": "close",
|
|
943
|
-
"class":
|
|
1331
|
+
"class": [(fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.failed ? ns2.e("delete-file-button") : "", (fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.uploading || (fileUploader == null ? void 0 : fileUploader.status) === UploadStatus.uploaded ? ns2.e("delete") : ""],
|
|
944
1332
|
"onClick": (event) => onDeleteFile(event, fileUploader.file, fileUploader.status)
|
|
945
1333
|
}, null), fileUploader.status === UploadStatus.uploading && createVNode("div", {
|
|
946
|
-
"class": "icon
|
|
1334
|
+
"class": ["icon", ns2.e("progress")]
|
|
947
1335
|
}, [createVNode(resolveComponent("d-progress"), {
|
|
948
1336
|
"isCircle": true,
|
|
949
1337
|
"percentage": fileUploader.percentage,
|
|
@@ -957,7 +1345,7 @@ var Upload = defineComponent({
|
|
|
957
1345
|
"name": "right",
|
|
958
1346
|
"color": "#50d4ab"
|
|
959
1347
|
}, null)]))]), createVNode("span", {
|
|
960
|
-
"class":
|
|
1348
|
+
"class": inputGroupAddOnNs.b()
|
|
961
1349
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
962
1350
|
"name": "more-operate",
|
|
963
1351
|
"color": "#252b3a"
|