vue-devui 1.0.0-rc.8 → 1.0.1
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 +188 -149
- package/alert/index.es.js +14 -9
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8392 -418
- package/auto-complete/index.umd.js +29 -5
- package/auto-complete/style.css +1 -1
- package/avatar/index.es.js +59 -74
- package/avatar/index.umd.js +1 -1
- package/badge/index.es.js +10 -4
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +191 -53
- package/button/index.umd.js +17 -17
- package/button/style.css +1 -1
- package/card/index.es.js +7 -3
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +8050 -241
- 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 +12022 -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 +24 -7
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +190 -165
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +785 -145
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +399 -300
- package/form/index.umd.js +16 -16
- package/form/style.css +1 -1
- package/fullscreen/index.es.js +2 -2
- package/fullscreen/index.umd.js +1 -1
- package/grid/index.es.js +8 -6
- package/grid/index.umd.js +1 -1
- package/icon/index.es.js +185 -23
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -0
- package/image-preview/index.es.js +2 -2
- package/image-preview/index.umd.js +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8220 -45
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +279 -204
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +3 -3
- package/layout/index.umd.js +1 -1
- package/loading/index.es.js +53 -53
- 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 +8319 -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 +921 -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 +539 -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 +451 -173
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +212 -70
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- 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/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/paginationInjectionKey.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 +89 -142
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +8 -4
- package/pagination/index.es.js +10180 -129
- package/pagination/index.umd.js +27 -1
- package/pagination/style.css +1 -1
- package/panel/index.es.js +4 -0
- package/panel/index.umd.js +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +262 -229
- package/popover/index.umd.js +15 -15
- package/popover/style.css +1 -1
- package/progress/index.es.js +2 -2
- package/progress/index.umd.js +2 -2
- package/progress/style.css +1 -1
- package/radio/index.es.js +7954 -156
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/index.es.js +16 -8
- package/rate/index.umd.js +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +170 -22
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +3829 -1042
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +9202 -495
- package/select/index.umd.js +27 -1
- package/select/style.css +1 -1
- package/skeleton/index.es.js +89 -263
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +118 -145
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +454 -233
- package/splitter/index.umd.js +13 -13
- 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 +6 -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 +387 -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 +7787 -62
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +5225 -1726
- package/table/index.umd.js +18 -18
- package/table/style.css +1 -1
- package/tabs/index.es.js +303 -102
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +11 -8
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +7876 -41
- 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 +9607 -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 +170 -22
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +286 -238
- package/tooltip/index.umd.js +14 -14
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +11342 -793
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +458 -102
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +20475 -11072
- package/vue-devui.umd.js +31 -24
- package/date-picker/index.es.js +0 -1097
- 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/Loading.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
|
@@ -1,16 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
4
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
7
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
8
|
+
var __spreadValues = (a, b) => {
|
|
9
|
+
for (var prop in b || (b = {}))
|
|
10
|
+
if (__hasOwnProp.call(b, prop))
|
|
11
|
+
__defNormalProp(a, prop, b[prop]);
|
|
12
|
+
if (__getOwnPropSymbols)
|
|
13
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
14
|
+
if (__propIsEnum.call(b, prop))
|
|
15
|
+
__defNormalProp(a, prop, b[prop]);
|
|
16
|
+
}
|
|
17
|
+
return a;
|
|
18
|
+
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
+
var __publicField = (obj, key, value) => {
|
|
21
|
+
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
|
+
return value;
|
|
23
|
+
};
|
|
24
|
+
import { defineComponent, ref, createVNode, h, render, computed, nextTick, unref, watch, onUnmounted, toRefs, mergeProps, withModifiers, reactive, getCurrentInstance, withDirectives, resolveComponent, Teleport, Transition, vShow, resolveDirective } from "vue";
|
|
25
|
+
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
2
26
|
const editableSelectProps = {
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
3
31
|
options: {
|
|
4
32
|
type: Array,
|
|
5
33
|
default: () => []
|
|
6
34
|
},
|
|
7
|
-
|
|
8
|
-
type: Boolean
|
|
35
|
+
allowClear: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
9
38
|
},
|
|
10
|
-
|
|
39
|
+
disabled: {
|
|
11
40
|
type: Boolean
|
|
12
41
|
},
|
|
13
|
-
|
|
42
|
+
disabledKey: {
|
|
14
43
|
type: String,
|
|
15
44
|
default: ""
|
|
16
45
|
},
|
|
@@ -18,18 +47,21 @@ const editableSelectProps = {
|
|
|
18
47
|
type: String,
|
|
19
48
|
default: "Search"
|
|
20
49
|
},
|
|
21
|
-
modelValue: {
|
|
22
|
-
type: String,
|
|
23
|
-
default: ""
|
|
24
|
-
},
|
|
25
50
|
width: {
|
|
26
51
|
type: Number
|
|
27
52
|
},
|
|
28
53
|
maxHeight: {
|
|
29
54
|
type: Number
|
|
30
55
|
},
|
|
31
|
-
|
|
32
|
-
type:
|
|
56
|
+
loading: {
|
|
57
|
+
type: Boolean
|
|
58
|
+
},
|
|
59
|
+
enableLazyLoad: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
searchFn: {
|
|
64
|
+
type: Function
|
|
33
65
|
}
|
|
34
66
|
};
|
|
35
67
|
const inBrowser = typeof window !== "undefined";
|
|
@@ -87,6 +119,234 @@ const clickoutsideDirective = {
|
|
|
87
119
|
delete el[ctx];
|
|
88
120
|
}
|
|
89
121
|
};
|
|
122
|
+
class View {
|
|
123
|
+
constructor() {
|
|
124
|
+
__publicField(this, "top", "50%");
|
|
125
|
+
__publicField(this, "left", "50%");
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
const loadingProps = {
|
|
129
|
+
message: String,
|
|
130
|
+
backdrop: Boolean,
|
|
131
|
+
view: {
|
|
132
|
+
type: Object,
|
|
133
|
+
default: () => new View()
|
|
134
|
+
},
|
|
135
|
+
zIndex: Number,
|
|
136
|
+
isFull: {
|
|
137
|
+
type: Boolean,
|
|
138
|
+
default: false
|
|
139
|
+
}
|
|
140
|
+
};
|
|
141
|
+
class LoadingOptions {
|
|
142
|
+
constructor() {
|
|
143
|
+
__publicField(this, "target");
|
|
144
|
+
__publicField(this, "message");
|
|
145
|
+
__publicField(this, "loadingTemplateRef");
|
|
146
|
+
__publicField(this, "backdrop", true);
|
|
147
|
+
__publicField(this, "positionType", "relative");
|
|
148
|
+
__publicField(this, "view", new View());
|
|
149
|
+
__publicField(this, "zIndex");
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
function createBem(namespace, element, modifier) {
|
|
153
|
+
let cls = namespace;
|
|
154
|
+
if (element) {
|
|
155
|
+
cls += `__${element}`;
|
|
156
|
+
}
|
|
157
|
+
if (modifier) {
|
|
158
|
+
cls += `--${modifier}`;
|
|
159
|
+
}
|
|
160
|
+
return cls;
|
|
161
|
+
}
|
|
162
|
+
function useNamespace(block, needDot = false) {
|
|
163
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
164
|
+
const b = () => createBem(namespace);
|
|
165
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
166
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
167
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
168
|
+
return {
|
|
169
|
+
b,
|
|
170
|
+
e,
|
|
171
|
+
m,
|
|
172
|
+
em
|
|
173
|
+
};
|
|
174
|
+
}
|
|
175
|
+
var loading = "";
|
|
176
|
+
var Loading = defineComponent({
|
|
177
|
+
name: "Loading",
|
|
178
|
+
inheritAttrs: false,
|
|
179
|
+
props: loadingProps,
|
|
180
|
+
setup(props) {
|
|
181
|
+
const style = {
|
|
182
|
+
top: props.view.top,
|
|
183
|
+
left: props.view.left,
|
|
184
|
+
zIndex: props.zIndex
|
|
185
|
+
};
|
|
186
|
+
if (!props.message) {
|
|
187
|
+
style.background = "none";
|
|
188
|
+
}
|
|
189
|
+
const isShow = ref(false);
|
|
190
|
+
const open = () => {
|
|
191
|
+
isShow.value = true;
|
|
192
|
+
};
|
|
193
|
+
const close = () => {
|
|
194
|
+
isShow.value = false;
|
|
195
|
+
};
|
|
196
|
+
return {
|
|
197
|
+
style,
|
|
198
|
+
isShow,
|
|
199
|
+
open,
|
|
200
|
+
close
|
|
201
|
+
};
|
|
202
|
+
},
|
|
203
|
+
render() {
|
|
204
|
+
var _a;
|
|
205
|
+
const {
|
|
206
|
+
isShow,
|
|
207
|
+
isFull,
|
|
208
|
+
backdrop,
|
|
209
|
+
style,
|
|
210
|
+
message,
|
|
211
|
+
$slots
|
|
212
|
+
} = this;
|
|
213
|
+
const ns = useNamespace("loading");
|
|
214
|
+
return isShow && createVNode("div", {
|
|
215
|
+
"class": [ns.b(), isFull ? ns.m("full") : ""]
|
|
216
|
+
}, [((_a = $slots.default) == null ? void 0 : _a.call($slots)) || createVNode("div", {
|
|
217
|
+
"class": ns.e("wrapper")
|
|
218
|
+
}, [backdrop ? createVNode("div", {
|
|
219
|
+
"class": ns.e("mask")
|
|
220
|
+
}, null) : null, createVNode("div", {
|
|
221
|
+
"style": style,
|
|
222
|
+
"class": ns.e("area")
|
|
223
|
+
}, [createVNode("div", {
|
|
224
|
+
"class": ns.e("busy-default-spinner")
|
|
225
|
+
}, [createVNode("div", {
|
|
226
|
+
"class": ns.e("bar1")
|
|
227
|
+
}, null), createVNode("div", {
|
|
228
|
+
"class": ns.e("bar2")
|
|
229
|
+
}, null), createVNode("div", {
|
|
230
|
+
"class": ns.e("bar3")
|
|
231
|
+
}, null), createVNode("div", {
|
|
232
|
+
"class": ns.e("bar4")
|
|
233
|
+
}, null)]), message ? createVNode("span", {
|
|
234
|
+
"class": ns.e("text")
|
|
235
|
+
}, [message]) : null])])]);
|
|
236
|
+
}
|
|
237
|
+
});
|
|
238
|
+
const COMPONENT_CONTAINER_SYMBOL = Symbol("dev_component_container");
|
|
239
|
+
function createComponent(component, props, children = null) {
|
|
240
|
+
const vnode = h(component, __spreadValues({}, props), children);
|
|
241
|
+
const container = document.createElement("div");
|
|
242
|
+
vnode[COMPONENT_CONTAINER_SYMBOL] = container;
|
|
243
|
+
render(vnode, container);
|
|
244
|
+
return vnode.component;
|
|
245
|
+
}
|
|
246
|
+
function unmountComponent(ComponnetInstance) {
|
|
247
|
+
render(null, ComponnetInstance == null ? void 0 : ComponnetInstance.vnode[COMPONENT_CONTAINER_SYMBOL]);
|
|
248
|
+
}
|
|
249
|
+
const loadingConstructor = defineComponent(Loading);
|
|
250
|
+
const cacheInstance = /* @__PURE__ */ new WeakSet();
|
|
251
|
+
const isEmpty = (val) => {
|
|
252
|
+
if (!val) {
|
|
253
|
+
return true;
|
|
254
|
+
}
|
|
255
|
+
if (Array.isArray(val)) {
|
|
256
|
+
return val.length === 0;
|
|
257
|
+
}
|
|
258
|
+
if (val instanceof Set || val instanceof Map) {
|
|
259
|
+
return val.size === 0;
|
|
260
|
+
}
|
|
261
|
+
if (val instanceof Promise) {
|
|
262
|
+
return false;
|
|
263
|
+
}
|
|
264
|
+
if (typeof val === "object") {
|
|
265
|
+
try {
|
|
266
|
+
return Object.keys(val).length === 0;
|
|
267
|
+
} catch (e) {
|
|
268
|
+
return false;
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return false;
|
|
272
|
+
};
|
|
273
|
+
const getType = (vari) => {
|
|
274
|
+
return Object.prototype.toString.call(vari).slice(8, -1).toLowerCase();
|
|
275
|
+
};
|
|
276
|
+
const isPromise = (value) => {
|
|
277
|
+
const type = getType(value);
|
|
278
|
+
switch (type) {
|
|
279
|
+
case "promise":
|
|
280
|
+
return [value];
|
|
281
|
+
case "array":
|
|
282
|
+
if (value.some((val) => getType(val) !== "promise")) {
|
|
283
|
+
console.error(new TypeError("Binding values should all be of type Promise"));
|
|
284
|
+
return "error";
|
|
285
|
+
}
|
|
286
|
+
return value;
|
|
287
|
+
default:
|
|
288
|
+
return false;
|
|
289
|
+
}
|
|
290
|
+
};
|
|
291
|
+
const unmount = (el) => {
|
|
292
|
+
cacheInstance.delete(el);
|
|
293
|
+
el.instance.proxy.close();
|
|
294
|
+
unmountComponent(el.instance);
|
|
295
|
+
};
|
|
296
|
+
const toggleLoading = (el, binding) => {
|
|
297
|
+
var _a, _b, _c;
|
|
298
|
+
if (binding.value) {
|
|
299
|
+
const vals = isPromise(binding.value);
|
|
300
|
+
if (vals === "error") {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
(_c = (_b = (_a = el == null ? void 0 : el.instance) == null ? void 0 : _a.proxy) == null ? void 0 : _b.open) == null ? void 0 : _c.call(_b);
|
|
304
|
+
el.appendChild(el.mask);
|
|
305
|
+
cacheInstance.add(el);
|
|
306
|
+
if (vals) {
|
|
307
|
+
Promise.all(vals).catch((err) => {
|
|
308
|
+
console.error(new Error("Promise handling errors"), err);
|
|
309
|
+
}).finally(() => {
|
|
310
|
+
unmount(el);
|
|
311
|
+
});
|
|
312
|
+
}
|
|
313
|
+
} else {
|
|
314
|
+
unmount(el);
|
|
315
|
+
}
|
|
316
|
+
};
|
|
317
|
+
const removeAttribute = (el) => {
|
|
318
|
+
el.removeAttribute("zindex");
|
|
319
|
+
el.removeAttribute("positiontype");
|
|
320
|
+
el.removeAttribute("backdrop");
|
|
321
|
+
el.removeAttribute("message");
|
|
322
|
+
el.removeAttribute("view");
|
|
323
|
+
el.removeAttribute("loadingtemplateref");
|
|
324
|
+
};
|
|
325
|
+
const handleProps = (el, vprops) => {
|
|
326
|
+
var _a;
|
|
327
|
+
const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
|
|
328
|
+
const loadingTemplateRef = props.loadingTemplateRef;
|
|
329
|
+
const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
330
|
+
el.style.position = props.positionType || "relative";
|
|
331
|
+
el.options = props;
|
|
332
|
+
el.instance = loadingInstance;
|
|
333
|
+
el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
|
|
334
|
+
};
|
|
335
|
+
const LoadingDirective = {
|
|
336
|
+
mounted: function(el, binding, vnode) {
|
|
337
|
+
handleProps(el, vnode.props);
|
|
338
|
+
removeAttribute(el);
|
|
339
|
+
!isEmpty(binding.value) && toggleLoading(el, binding);
|
|
340
|
+
},
|
|
341
|
+
updated: function(el, binding, vnode) {
|
|
342
|
+
if (!isEmpty(binding.value) && cacheInstance.has(el) || isEmpty(binding.value) && !cacheInstance.has(el)) {
|
|
343
|
+
return;
|
|
344
|
+
}
|
|
345
|
+
!cacheInstance.has(el) && handleProps(el, vnode.props);
|
|
346
|
+
removeAttribute(el);
|
|
347
|
+
toggleLoading(el, binding);
|
|
348
|
+
}
|
|
349
|
+
};
|
|
90
350
|
function className(classStr, classOpt) {
|
|
91
351
|
let classname = classStr;
|
|
92
352
|
if (typeof classOpt === "object") {
|
|
@@ -97,51 +357,68 @@ function className(classStr, classOpt) {
|
|
|
97
357
|
return classname;
|
|
98
358
|
}
|
|
99
359
|
var editableSelect = "";
|
|
100
|
-
|
|
101
|
-
const
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
360
|
+
function useSelect(props) {
|
|
361
|
+
const normalizeOptions = computed(() => {
|
|
362
|
+
return props.options.map((option) => {
|
|
363
|
+
let res;
|
|
364
|
+
if (option !== "null" && typeof option === "object") {
|
|
365
|
+
res = __spreadProps(__spreadValues({}, option), {
|
|
366
|
+
label: option.label || "",
|
|
367
|
+
value: option.value !== void 0 ? option.value : option.label || ""
|
|
368
|
+
});
|
|
369
|
+
} else {
|
|
370
|
+
res = {
|
|
371
|
+
label: String(option),
|
|
372
|
+
value: option
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
return res;
|
|
376
|
+
});
|
|
377
|
+
});
|
|
378
|
+
return { normalizeOptions };
|
|
379
|
+
}
|
|
380
|
+
function useFilterOptions(enableLazyLoad, normalizeOptions, inputValue, searchFn) {
|
|
381
|
+
const filteredOptions = computed(() => {
|
|
382
|
+
if (!inputValue.value || enableLazyLoad) {
|
|
383
|
+
return normalizeOptions.value;
|
|
110
384
|
}
|
|
385
|
+
return normalizeOptions.value.filter((option) => {
|
|
386
|
+
return searchFn(option, inputValue.value);
|
|
387
|
+
});
|
|
111
388
|
});
|
|
112
|
-
return filteredOptions;
|
|
113
|
-
}
|
|
114
|
-
|
|
389
|
+
return { filteredOptions };
|
|
390
|
+
}
|
|
391
|
+
function useInput(inputValue, ctx2) {
|
|
115
392
|
const onInputChange = (value) => {
|
|
116
393
|
ctx2.emit("search", value);
|
|
117
394
|
};
|
|
118
395
|
const handleInput = (event) => {
|
|
119
396
|
const value = event.target.value;
|
|
120
397
|
inputValue.value = value;
|
|
121
|
-
ctx2.emit("update:modelValue", value);
|
|
122
398
|
onInputChange(value);
|
|
123
399
|
};
|
|
124
400
|
return {
|
|
125
401
|
handleInput
|
|
126
402
|
};
|
|
127
|
-
}
|
|
128
|
-
|
|
403
|
+
}
|
|
404
|
+
function useLazyLoad(dropdownRef, enableLazyLoad, ctx2) {
|
|
129
405
|
const loadMore = () => {
|
|
130
406
|
const dropdownVal = dropdownRef.value;
|
|
131
|
-
if (
|
|
407
|
+
if (!enableLazyLoad) {
|
|
132
408
|
return;
|
|
133
409
|
}
|
|
134
|
-
if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
|
|
135
|
-
ctx2.emit("loadMore"
|
|
410
|
+
if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight - 12) {
|
|
411
|
+
ctx2.emit("loadMore");
|
|
136
412
|
}
|
|
137
413
|
};
|
|
138
414
|
return { loadMore };
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
const
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
415
|
+
}
|
|
416
|
+
function useKeyboardSelect(dropdownRef, hoverIndex, filteredOptions, disabledKey, visible, loading2, handleClick, toggleMenu, closeMenu) {
|
|
417
|
+
const handleEscape = () => {
|
|
418
|
+
closeMenu();
|
|
419
|
+
};
|
|
420
|
+
const handleEnter = () => {
|
|
421
|
+
handleClick(filteredOptions.value[hoverIndex.value], hoverIndex.value);
|
|
145
422
|
};
|
|
146
423
|
const scrollToItem = (index2) => {
|
|
147
424
|
const ul = dropdownRef.value;
|
|
@@ -158,55 +435,43 @@ const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, op
|
|
|
158
435
|
}
|
|
159
436
|
});
|
|
160
437
|
};
|
|
161
|
-
const
|
|
162
|
-
|
|
163
|
-
inputValue.value = "";
|
|
164
|
-
} else {
|
|
165
|
-
closeMenu();
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
const handleEnter = () => {
|
|
169
|
-
const len = filteredOptions.value.length;
|
|
170
|
-
if (!visible.value || !len) {
|
|
171
|
-
return toggleMenu();
|
|
172
|
-
}
|
|
173
|
-
len && len === 1 ? handleClick(filteredOptions.value[0]) : handleClick(filteredOptions.value[hoverIndex.value]);
|
|
174
|
-
return closeMenu();
|
|
438
|
+
const updateIndex = (index2) => {
|
|
439
|
+
hoverIndex.value = index2;
|
|
175
440
|
};
|
|
176
|
-
const handleKeyboardNavigation = (direction) => {
|
|
441
|
+
const handleKeyboardNavigation = (direction, index2 = hoverIndex.value) => {
|
|
177
442
|
const len = filteredOptions.value.length;
|
|
178
|
-
if (
|
|
179
|
-
return;
|
|
180
|
-
}
|
|
181
|
-
if (!["ArrowDown", "ArrowUp"].includes(direction)) {
|
|
443
|
+
if (len === 0) {
|
|
182
444
|
return;
|
|
183
445
|
}
|
|
184
|
-
if (
|
|
446
|
+
if (!["ArrowUp", "ArrowDown"].includes(direction)) {
|
|
185
447
|
return;
|
|
186
448
|
}
|
|
187
|
-
let newIndex = 0;
|
|
188
|
-
newIndex = hoverIndex.value;
|
|
189
449
|
if (direction === "ArrowUp") {
|
|
190
|
-
|
|
191
|
-
if (
|
|
192
|
-
|
|
450
|
+
index2 -= 1;
|
|
451
|
+
if (index2 === -1) {
|
|
452
|
+
index2 = len - 1;
|
|
193
453
|
}
|
|
194
454
|
} else if (direction === "ArrowDown") {
|
|
195
|
-
|
|
196
|
-
if (
|
|
197
|
-
|
|
455
|
+
index2 += 1;
|
|
456
|
+
if (index2 === len) {
|
|
457
|
+
index2 = 0;
|
|
198
458
|
}
|
|
199
459
|
}
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return handleKeyboardNavigation(direction);
|
|
460
|
+
const option = filteredOptions.value[index2];
|
|
461
|
+
if (option[disabledKey]) {
|
|
462
|
+
return handleKeyboardNavigation(direction, index2);
|
|
204
463
|
}
|
|
205
|
-
|
|
206
|
-
scrollToItem(
|
|
464
|
+
updateIndex(index2);
|
|
465
|
+
scrollToItem(index2);
|
|
207
466
|
};
|
|
208
467
|
const handleKeydown = (event) => {
|
|
209
468
|
const keyCode = event.key || event.code;
|
|
469
|
+
if (loading2.value) {
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
if (!visible.value) {
|
|
473
|
+
return toggleMenu();
|
|
474
|
+
}
|
|
210
475
|
switch (keyCode) {
|
|
211
476
|
case "Escape":
|
|
212
477
|
handleEscape();
|
|
@@ -218,48 +483,408 @@ const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, op
|
|
|
218
483
|
handleKeyboardNavigation(keyCode);
|
|
219
484
|
}
|
|
220
485
|
};
|
|
221
|
-
return {
|
|
486
|
+
return {
|
|
487
|
+
handleKeydown
|
|
488
|
+
};
|
|
489
|
+
}
|
|
490
|
+
const flexibleOverlayProps = {
|
|
491
|
+
modelValue: {
|
|
492
|
+
type: Boolean,
|
|
493
|
+
default: false
|
|
494
|
+
},
|
|
495
|
+
origin: {
|
|
496
|
+
type: Object,
|
|
497
|
+
require: true
|
|
498
|
+
},
|
|
499
|
+
position: {
|
|
500
|
+
type: Array,
|
|
501
|
+
default: ["bottom"]
|
|
502
|
+
},
|
|
503
|
+
offset: {
|
|
504
|
+
type: [Number, Object],
|
|
505
|
+
default: 8
|
|
506
|
+
},
|
|
507
|
+
shiftOffset: {
|
|
508
|
+
type: Number
|
|
509
|
+
},
|
|
510
|
+
align: {
|
|
511
|
+
type: String,
|
|
512
|
+
default: null
|
|
513
|
+
},
|
|
514
|
+
showArrow: {
|
|
515
|
+
type: Boolean,
|
|
516
|
+
default: false
|
|
517
|
+
},
|
|
518
|
+
isArrowCenter: {
|
|
519
|
+
type: Boolean,
|
|
520
|
+
default: true
|
|
521
|
+
},
|
|
522
|
+
clickEventBubble: {
|
|
523
|
+
type: Boolean,
|
|
524
|
+
default: false
|
|
525
|
+
}
|
|
222
526
|
};
|
|
527
|
+
function getScrollParent(element) {
|
|
528
|
+
const overflowRegex = /(auto|scroll|hidden)/;
|
|
529
|
+
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
530
|
+
const style = window.getComputedStyle(parent);
|
|
531
|
+
if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
|
|
532
|
+
return parent;
|
|
533
|
+
}
|
|
534
|
+
}
|
|
535
|
+
return window;
|
|
536
|
+
}
|
|
537
|
+
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
538
|
+
let { x, y } = point;
|
|
539
|
+
if (!isArrowCenter) {
|
|
540
|
+
const { width, height } = originRect;
|
|
541
|
+
if (x && placement.includes("start")) {
|
|
542
|
+
x = 12;
|
|
543
|
+
}
|
|
544
|
+
if (x && placement.includes("end")) {
|
|
545
|
+
x = Math.round(width - 24);
|
|
546
|
+
}
|
|
547
|
+
if (y && placement.includes("start")) {
|
|
548
|
+
y = 10;
|
|
549
|
+
}
|
|
550
|
+
if (y && placement.includes("end")) {
|
|
551
|
+
y = height - 14;
|
|
552
|
+
}
|
|
553
|
+
}
|
|
554
|
+
return { x, y };
|
|
555
|
+
}
|
|
556
|
+
function useOverlay(props, emit) {
|
|
557
|
+
const overlayRef = ref();
|
|
558
|
+
const arrowRef = ref();
|
|
559
|
+
let originParent = null;
|
|
560
|
+
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
561
|
+
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
562
|
+
const staticSide = {
|
|
563
|
+
top: "bottom",
|
|
564
|
+
right: "left",
|
|
565
|
+
bottom: "top",
|
|
566
|
+
left: "right"
|
|
567
|
+
}[placement.split("-")[0]];
|
|
568
|
+
Object.assign(arrowEl.style, {
|
|
569
|
+
left: x ? `${x}px` : "",
|
|
570
|
+
top: y ? `${y}px` : "",
|
|
571
|
+
right: "",
|
|
572
|
+
bottom: "",
|
|
573
|
+
[staticSide]: "-4px"
|
|
574
|
+
});
|
|
575
|
+
};
|
|
576
|
+
const updatePosition = async () => {
|
|
577
|
+
const hostEl = props.origin;
|
|
578
|
+
const overlayEl = unref(overlayRef.value);
|
|
579
|
+
const arrowEl = unref(arrowRef.value);
|
|
580
|
+
const middleware = [
|
|
581
|
+
offset(props.offset),
|
|
582
|
+
autoPlacement({
|
|
583
|
+
alignment: props.align,
|
|
584
|
+
allowedPlacements: props.position
|
|
585
|
+
})
|
|
586
|
+
];
|
|
587
|
+
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
588
|
+
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
589
|
+
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
590
|
+
strategy: "fixed",
|
|
591
|
+
middleware
|
|
592
|
+
});
|
|
593
|
+
let applyX = x;
|
|
594
|
+
let applyY = y;
|
|
595
|
+
if (props.shiftOffset !== void 0) {
|
|
596
|
+
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
597
|
+
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
598
|
+
shiftX > 0 && (applyX += props.shiftOffset);
|
|
599
|
+
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
600
|
+
shiftY > 0 && (applyY += props.shiftOffset);
|
|
601
|
+
}
|
|
602
|
+
emit("positionChange", placement);
|
|
603
|
+
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
604
|
+
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
605
|
+
};
|
|
606
|
+
watch(() => props.modelValue, () => {
|
|
607
|
+
if (props.modelValue && props.origin) {
|
|
608
|
+
originParent = getScrollParent(props.origin);
|
|
609
|
+
nextTick(updatePosition);
|
|
610
|
+
originParent == null ? void 0 : originParent.addEventListener("scroll", updatePosition);
|
|
611
|
+
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
612
|
+
window.addEventListener("resize", updatePosition);
|
|
613
|
+
} else {
|
|
614
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
615
|
+
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
616
|
+
window.removeEventListener("resize", updatePosition);
|
|
617
|
+
}
|
|
618
|
+
});
|
|
619
|
+
onUnmounted(() => {
|
|
620
|
+
originParent == null ? void 0 : originParent.removeEventListener("scroll", updatePosition);
|
|
621
|
+
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
622
|
+
window.removeEventListener("resize", updatePosition);
|
|
623
|
+
});
|
|
624
|
+
return { arrowRef, overlayRef, updatePosition };
|
|
625
|
+
}
|
|
626
|
+
var flexibleOverlay = "";
|
|
627
|
+
const FlexibleOverlay = defineComponent({
|
|
628
|
+
name: "DFlexibleOverlay",
|
|
629
|
+
inheritAttrs: false,
|
|
630
|
+
props: flexibleOverlayProps,
|
|
631
|
+
emits: ["update:modelValue", "positionChange"],
|
|
632
|
+
setup(props, {
|
|
633
|
+
slots,
|
|
634
|
+
attrs,
|
|
635
|
+
emit,
|
|
636
|
+
expose
|
|
637
|
+
}) {
|
|
638
|
+
const ns = useNamespace("flexible-overlay");
|
|
639
|
+
const {
|
|
640
|
+
clickEventBubble
|
|
641
|
+
} = toRefs(props);
|
|
642
|
+
const {
|
|
643
|
+
arrowRef,
|
|
644
|
+
overlayRef,
|
|
645
|
+
updatePosition
|
|
646
|
+
} = useOverlay(props, emit);
|
|
647
|
+
expose({
|
|
648
|
+
updatePosition
|
|
649
|
+
});
|
|
650
|
+
return () => {
|
|
651
|
+
var _a;
|
|
652
|
+
return props.modelValue && createVNode("div", mergeProps({
|
|
653
|
+
"ref": overlayRef,
|
|
654
|
+
"class": ns.b()
|
|
655
|
+
}, attrs, {
|
|
656
|
+
"onClick": withModifiers(() => ({}), [clickEventBubble.value ? "" : "stop"]),
|
|
657
|
+
"onPointerup": withModifiers(() => ({}), ["stop"])
|
|
658
|
+
}), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
659
|
+
"ref": arrowRef,
|
|
660
|
+
"class": ns.e("arrow")
|
|
661
|
+
}, null)]);
|
|
662
|
+
};
|
|
663
|
+
}
|
|
664
|
+
});
|
|
665
|
+
function useCacheFilteredOptions(filteredOptions) {
|
|
666
|
+
const cacheFilteredOptions = computed(() => {
|
|
667
|
+
const map = /* @__PURE__ */ new Map();
|
|
668
|
+
filteredOptions.value.forEach((item) => {
|
|
669
|
+
map.set(item, item.value);
|
|
670
|
+
});
|
|
671
|
+
return map;
|
|
672
|
+
});
|
|
673
|
+
const getOptionValue = (option) => cacheFilteredOptions.value.get(option);
|
|
674
|
+
return {
|
|
675
|
+
getOptionValue
|
|
676
|
+
};
|
|
677
|
+
}
|
|
678
|
+
function deepAssign(...objects) {
|
|
679
|
+
const isObject = (obj) => obj && typeof obj === "object";
|
|
680
|
+
return objects.reduce((prev, from) => {
|
|
681
|
+
Object.keys(from).forEach((key) => {
|
|
682
|
+
const pVal = prev[key];
|
|
683
|
+
const oVal = from[key];
|
|
684
|
+
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
685
|
+
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
686
|
+
} else if (isObject(pVal) && isObject(oVal)) {
|
|
687
|
+
prev[key] = deepAssign(pVal, oVal);
|
|
688
|
+
} else {
|
|
689
|
+
prev[key] = oVal;
|
|
690
|
+
}
|
|
691
|
+
});
|
|
692
|
+
return prev;
|
|
693
|
+
}, {});
|
|
694
|
+
}
|
|
695
|
+
var zhCN = {
|
|
696
|
+
pagination: {
|
|
697
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
698
|
+
goToText: "\u8DF3\u81F3",
|
|
699
|
+
perPage: "\u6761/\u9875"
|
|
700
|
+
},
|
|
701
|
+
accordion: {
|
|
702
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
703
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
704
|
+
},
|
|
705
|
+
autoCompleteDropdown: {
|
|
706
|
+
latestInput: "\u6700\u8FD1\u8F93\u5165"
|
|
707
|
+
},
|
|
708
|
+
cascaderList: {
|
|
709
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
710
|
+
},
|
|
711
|
+
colorPicker: {
|
|
712
|
+
foundationPanel: "\u57FA\u7840\u9762\u677F",
|
|
713
|
+
advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
|
|
714
|
+
},
|
|
715
|
+
datePickerPro: {
|
|
716
|
+
ok: "\u786E\u5B9A",
|
|
717
|
+
placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
|
|
718
|
+
month1: "1\u6708",
|
|
719
|
+
month2: "2\u6708",
|
|
720
|
+
month3: "3\u6708",
|
|
721
|
+
month4: "4\u6708",
|
|
722
|
+
month5: "5\u6708",
|
|
723
|
+
month6: "6\u6708",
|
|
724
|
+
month7: "7\u6708",
|
|
725
|
+
month8: "8\u6708",
|
|
726
|
+
month9: "9\u6708",
|
|
727
|
+
month10: "10\u6708",
|
|
728
|
+
month11: "11\u6708",
|
|
729
|
+
month12: "12\u6708",
|
|
730
|
+
year: "\u5E74",
|
|
731
|
+
startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
|
|
732
|
+
endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
|
|
733
|
+
getWeekDays() {
|
|
734
|
+
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
735
|
+
},
|
|
736
|
+
getTimeArr() {
|
|
737
|
+
return ["\u65F6", "\u5206", "\u79D2"];
|
|
738
|
+
},
|
|
739
|
+
getYearMonthStr(year, month) {
|
|
740
|
+
return `${year}\u5E74${month}\u6708`;
|
|
741
|
+
}
|
|
742
|
+
},
|
|
743
|
+
editableSelect: {
|
|
744
|
+
noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
745
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
746
|
+
},
|
|
747
|
+
input: {
|
|
748
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
749
|
+
},
|
|
750
|
+
splitterBar: {
|
|
751
|
+
collapse: "\u6536\u8D77",
|
|
752
|
+
expand: "\u5C55\u5F00"
|
|
753
|
+
},
|
|
754
|
+
stepsGuide: {
|
|
755
|
+
previous: "\u4E0A\u4E00\u6B65",
|
|
756
|
+
continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
|
|
757
|
+
ok: "\u6211\u77E5\u9053\u5566"
|
|
758
|
+
},
|
|
759
|
+
table: {
|
|
760
|
+
selectAll: "\u5168\u9009",
|
|
761
|
+
ok: "\u786E\u5B9A"
|
|
762
|
+
},
|
|
763
|
+
timePopup: {
|
|
764
|
+
ok: "\u786E\u5B9A"
|
|
765
|
+
},
|
|
766
|
+
transfer: {
|
|
767
|
+
unit: "\u9879",
|
|
768
|
+
panelUnit: "\u9879",
|
|
769
|
+
headerUnit: "\u9879",
|
|
770
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
771
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
|
|
772
|
+
},
|
|
773
|
+
tree: {
|
|
774
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
775
|
+
newNode: "\u65B0\u8282\u70B9",
|
|
776
|
+
selectPlaceholder: "\u8BF7\u9009\u62E9"
|
|
777
|
+
},
|
|
778
|
+
upload: {
|
|
779
|
+
placeholder: "\u9009\u62E9\u6587\u4EF6",
|
|
780
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
781
|
+
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
782
|
+
},
|
|
783
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
784
|
+
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`;
|
|
785
|
+
},
|
|
786
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
787
|
+
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`;
|
|
788
|
+
},
|
|
789
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
790
|
+
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`;
|
|
791
|
+
}
|
|
792
|
+
},
|
|
793
|
+
search: {
|
|
794
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
795
|
+
},
|
|
796
|
+
select: {
|
|
797
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
798
|
+
noDataText: "\u65E0\u6570\u636E",
|
|
799
|
+
noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
800
|
+
loadingText: "\u52A0\u8F7D\u4E2D..."
|
|
801
|
+
},
|
|
802
|
+
tagInput: {
|
|
803
|
+
maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
804
|
+
},
|
|
805
|
+
timeSelect: {
|
|
806
|
+
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
807
|
+
}
|
|
808
|
+
};
|
|
809
|
+
const lang = ref("zh-CN");
|
|
810
|
+
let langMessages = reactive({
|
|
811
|
+
[lang.value]: zhCN
|
|
812
|
+
});
|
|
813
|
+
const Locale = {
|
|
814
|
+
messages() {
|
|
815
|
+
return langMessages[lang.value];
|
|
816
|
+
},
|
|
817
|
+
lang() {
|
|
818
|
+
return lang.value;
|
|
819
|
+
},
|
|
820
|
+
use(newLang, newMessages) {
|
|
821
|
+
lang.value = newLang;
|
|
822
|
+
this.add({ [newLang]: newMessages });
|
|
823
|
+
},
|
|
824
|
+
add(newMessages = {}) {
|
|
825
|
+
langMessages = deepAssign(langMessages, newMessages);
|
|
826
|
+
}
|
|
827
|
+
};
|
|
828
|
+
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
829
|
+
function get(object, path) {
|
|
830
|
+
const keys = path.split(".");
|
|
831
|
+
let result = object;
|
|
832
|
+
keys.forEach((key) => {
|
|
833
|
+
var _a;
|
|
834
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
835
|
+
});
|
|
836
|
+
return result;
|
|
837
|
+
}
|
|
838
|
+
function createI18nTranslate(name, app, newPrefix) {
|
|
839
|
+
const prefix = newPrefix || camelize(name) + ".";
|
|
840
|
+
return (path) => {
|
|
841
|
+
var _a;
|
|
842
|
+
const messages = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
843
|
+
const message = get(messages, prefix + path) || get(messages, path);
|
|
844
|
+
return message;
|
|
845
|
+
};
|
|
846
|
+
}
|
|
223
847
|
var EditableSelect = defineComponent({
|
|
224
848
|
name: "DEditableSelect",
|
|
225
849
|
directives: {
|
|
226
|
-
|
|
850
|
+
ClickOutside: clickoutsideDirective,
|
|
851
|
+
Loading: LoadingDirective
|
|
227
852
|
},
|
|
228
853
|
props: editableSelectProps,
|
|
229
854
|
emits: ["update:modelValue", "search", "loadMore"],
|
|
230
855
|
setup(props, ctx2) {
|
|
856
|
+
const app = getCurrentInstance();
|
|
857
|
+
const t = createI18nTranslate("DEditableSelect", app);
|
|
858
|
+
const ns = useNamespace("editable-select");
|
|
231
859
|
const dropdownRef = ref();
|
|
232
860
|
const origin = ref();
|
|
861
|
+
const hoverIndex = ref(0);
|
|
862
|
+
const selectedIndex = ref(0);
|
|
233
863
|
const position = ref(["bottom"]);
|
|
234
864
|
const visible = ref(false);
|
|
235
865
|
const inputValue = ref(props.modelValue);
|
|
236
|
-
const
|
|
237
|
-
const
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
value: option
|
|
248
|
-
};
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
|
-
const filteredOptions = userFilterOptions(normalizeOptions, inputValue, props.filterOption);
|
|
866
|
+
const loading2 = ref(props.loading);
|
|
867
|
+
const {
|
|
868
|
+
normalizeOptions
|
|
869
|
+
} = useSelect(props);
|
|
870
|
+
const searchFn = props.searchFn || ((option, term) => option.label.toLocaleLowerCase().includes(term.trim().toLocaleLowerCase()));
|
|
871
|
+
const {
|
|
872
|
+
filteredOptions
|
|
873
|
+
} = useFilterOptions(props.enableLazyLoad, normalizeOptions, inputValue, searchFn);
|
|
874
|
+
const {
|
|
875
|
+
getOptionValue
|
|
876
|
+
} = useCacheFilteredOptions(filteredOptions);
|
|
252
877
|
const emptyText = computed(() => {
|
|
253
|
-
let text
|
|
254
|
-
if (props.
|
|
255
|
-
text = "
|
|
256
|
-
} else
|
|
257
|
-
text = "
|
|
878
|
+
let text;
|
|
879
|
+
if (props.enableLazyLoad) {
|
|
880
|
+
text = t("noData");
|
|
881
|
+
} else {
|
|
882
|
+
text = t("noRelatedRecords");
|
|
258
883
|
}
|
|
259
884
|
return text;
|
|
260
885
|
});
|
|
261
886
|
watch(() => props.loading, (newVal) => {
|
|
262
|
-
|
|
887
|
+
loading2.value = newVal;
|
|
263
888
|
});
|
|
264
889
|
const toggleMenu = () => {
|
|
265
890
|
visible.value = !visible.value;
|
|
@@ -269,45 +894,46 @@ var EditableSelect = defineComponent({
|
|
|
269
894
|
};
|
|
270
895
|
const {
|
|
271
896
|
loadMore
|
|
272
|
-
} = useLazyLoad(dropdownRef,
|
|
897
|
+
} = useLazyLoad(dropdownRef, props.enableLazyLoad, ctx2);
|
|
273
898
|
const {
|
|
274
899
|
handleInput
|
|
275
900
|
} = useInput(inputValue, ctx2);
|
|
276
|
-
const handleClick = (option) => {
|
|
901
|
+
const handleClick = (option, index2) => {
|
|
277
902
|
const {
|
|
278
|
-
|
|
903
|
+
disabledKey
|
|
279
904
|
} = props;
|
|
280
905
|
if (disabledKey && !!option[disabledKey]) {
|
|
281
906
|
return;
|
|
282
907
|
}
|
|
283
|
-
|
|
908
|
+
inputValue.value = option.label;
|
|
909
|
+
hoverIndex.value = selectedIndex.value;
|
|
910
|
+
selectedIndex.value = index2;
|
|
911
|
+
const value = getOptionValue(option);
|
|
912
|
+
ctx2.emit("update:modelValue", value + "");
|
|
284
913
|
closeMenu();
|
|
285
914
|
};
|
|
286
915
|
const {
|
|
287
|
-
handleKeydown
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
inputValue.value = newVal;
|
|
294
|
-
}
|
|
295
|
-
});
|
|
916
|
+
handleKeydown
|
|
917
|
+
} = useKeyboardSelect(dropdownRef, hoverIndex, filteredOptions, props.disabledKey, visible, loading2, handleClick, toggleMenu, closeMenu);
|
|
918
|
+
const handleClear = () => {
|
|
919
|
+
inputValue.value = "";
|
|
920
|
+
ctx2.emit("update:modelValue", "");
|
|
921
|
+
};
|
|
296
922
|
const getItemCls = (option, index2) => {
|
|
297
923
|
const {
|
|
298
|
-
|
|
924
|
+
disabledKey
|
|
299
925
|
} = props;
|
|
300
|
-
return className(
|
|
926
|
+
return className(`devui-dropdown-item`, {
|
|
301
927
|
disabled: disabledKey ? !!option[disabledKey] : false,
|
|
302
|
-
selected: index2 === selectedIndex.value,
|
|
303
|
-
"
|
|
928
|
+
selected: filteredOptions.value.length === 1 || index2 === selectedIndex.value,
|
|
929
|
+
[`${ns.em("dropdown", "bg")}`]: index2 === hoverIndex.value
|
|
304
930
|
});
|
|
305
931
|
};
|
|
306
932
|
return () => {
|
|
307
|
-
const selectCls = className(
|
|
308
|
-
"
|
|
933
|
+
const selectCls = className(`${ns.b()} devui-form-group devui-has-feedback ${inputValue.value && props.allowClear && "allow-clear"}`, {
|
|
934
|
+
[`${ns.m("open")}`]: visible.value === true
|
|
309
935
|
});
|
|
310
|
-
const inputCls = className(
|
|
936
|
+
const inputCls = className(`devui-form-control devui-dropdown-origin`, {
|
|
311
937
|
"devui-dropdown-origin-open": visible.value === true
|
|
312
938
|
});
|
|
313
939
|
return withDirectives(createVNode("div", {
|
|
@@ -328,42 +954,56 @@ var EditableSelect = defineComponent({
|
|
|
328
954
|
}, null), createVNode("span", {
|
|
329
955
|
"class": "devui-form-control-feedback"
|
|
330
956
|
}, [createVNode("span", {
|
|
957
|
+
"class": "devui-select-clear-icon",
|
|
958
|
+
"onClick": handleClear
|
|
959
|
+
}, [createVNode(resolveComponent("d-icon"), {
|
|
960
|
+
"name": "icon-remove"
|
|
961
|
+
}, null)]), createVNode("span", {
|
|
331
962
|
"class": "devui-select-chevron-icon"
|
|
332
963
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
333
964
|
"name": "select-arrow"
|
|
334
|
-
}, null)])]), createVNode(
|
|
335
|
-
"
|
|
336
|
-
"modelValue": visible.value,
|
|
337
|
-
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
338
|
-
"position": position.value,
|
|
339
|
-
"hasBackdrop": false
|
|
965
|
+
}, null)])]), createVNode(Teleport, {
|
|
966
|
+
"to": "body"
|
|
340
967
|
}, {
|
|
341
|
-
default: () => [createVNode(
|
|
342
|
-
"
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
maxHeight: props.maxHeight + "px"
|
|
352
|
-
},
|
|
353
|
-
"onScroll": loadMore
|
|
354
|
-
}, [filteredOptions.value.map((option, index2) => {
|
|
355
|
-
return createVNode("li", {
|
|
356
|
-
"class": getItemCls(option, index2),
|
|
357
|
-
"onClick": (e) => {
|
|
358
|
-
e.stopPropagation();
|
|
359
|
-
handleClick(option);
|
|
968
|
+
default: () => [createVNode(Transition, {
|
|
969
|
+
"name": "fade"
|
|
970
|
+
}, {
|
|
971
|
+
default: () => [createVNode(FlexibleOverlay, {
|
|
972
|
+
"origin": origin.value,
|
|
973
|
+
"modelValue": visible.value,
|
|
974
|
+
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
975
|
+
"position": position.value,
|
|
976
|
+
"style": {
|
|
977
|
+
zIndex: "var(--devui-z-index-dropdown, 1052)"
|
|
360
978
|
}
|
|
361
|
-
},
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
979
|
+
}, {
|
|
980
|
+
default: () => [createVNode("div", {
|
|
981
|
+
"style": {
|
|
982
|
+
width: props.width + "px"
|
|
983
|
+
},
|
|
984
|
+
"class": `${ns.e("menu")}`
|
|
985
|
+
}, [withDirectives(createVNode("div", {
|
|
986
|
+
"class": `devui-dropdown-menu`
|
|
987
|
+
}, [createVNode("ul", {
|
|
988
|
+
"ref": dropdownRef,
|
|
989
|
+
"class": `${ns.em("list", "unstyled")} devui-scrollbar scroll-height`,
|
|
990
|
+
"style": {
|
|
991
|
+
maxHeight: props.maxHeight + "px"
|
|
992
|
+
},
|
|
993
|
+
"onScroll": loadMore
|
|
994
|
+
}, [filteredOptions.value.map((option, index2) => {
|
|
995
|
+
return createVNode("li", {
|
|
996
|
+
"class": getItemCls(option, index2),
|
|
997
|
+
"onClick": (e) => {
|
|
998
|
+
e.stopPropagation();
|
|
999
|
+
handleClick(option, index2);
|
|
1000
|
+
}
|
|
1001
|
+
}, [ctx2.slots.item ? ctx2.slots.item(option) : option.label]);
|
|
1002
|
+
}), withDirectives(createVNode("div", {
|
|
1003
|
+
"class": "devui-no-data-tip"
|
|
1004
|
+
}, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem(inputValue.value) : emptyText.value]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value], [resolveDirective("loading"), props.loading]])])]
|
|
1005
|
+
})]
|
|
1006
|
+
})]
|
|
367
1007
|
})]), [[resolveDirective("click-outside"), closeMenu]]);
|
|
368
1008
|
};
|
|
369
1009
|
}
|