vue-devui 1.0.0-rc.9 → 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 -149
- package/alert/index.es.js +12 -7
- package/alert/index.umd.js +1 -1
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +8019 -254
- package/auto-complete/index.umd.js +29 -3
- package/auto-complete/style.css +1 -1
- package/badge/index.es.js +8 -2
- package/badge/index.umd.js +1 -1
- package/badge/style.css +1 -1
- package/button/index.es.js +104 -40
- package/button/index.umd.js +15 -15
- package/button/style.css +1 -1
- package/card/index.es.js +5 -1
- package/card/index.umd.js +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +7772 -81
- 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 +1 -1
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +77 -121
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +324 -104
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +91 -118
- package/form/index.umd.js +14 -14
- package/form/style.css +1 -1
- package/icon/index.es.js +106 -41
- package/icon/index.umd.js +1 -1
- package/icon/style.css +1 -1
- package/image-preview/style.css +1 -1
- package/input/index.es.js +8088 -169
- package/input/index.umd.js +27 -1
- package/input/style.css +1 -1
- package/input-number/index.es.js +8 -9
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/layout/index.es.js +1 -1
- package/layout/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 +275 -185
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +143 -72
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- 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/IconGroup.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/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/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/tableProps.js +3 -0
- package/nuxt/components/timerPickerPanelProps.js +3 -0
- package/nuxt/components/treeNodeProps.js +3 -0
- package/overlay/index.es.js +76 -139
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +6 -3
- package/pagination/index.es.js +175 -7
- package/pagination/index.umd.js +1 -1
- package/pagination/style.css +1 -1
- package/panel/style.css +1 -1
- package/popover/index.es.js +101 -162
- package/popover/index.umd.js +17 -17
- package/popover/style.css +1 -1
- package/progress/style.css +1 -1
- package/radio/index.es.js +7854 -58
- package/radio/index.umd.js +27 -1
- package/radio/style.css +1 -1
- package/rate/style.css +1 -1
- package/result/index.es.js +92 -41
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +3729 -1206
- package/search/index.umd.js +18 -18
- package/search/style.css +1 -1
- package/select/index.es.js +4426 -2501
- package/select/index.umd.js +17 -17
- package/select/style.css +1 -1
- package/skeleton/index.es.js +87 -261
- package/skeleton/index.umd.js +1 -1
- package/skeleton/style.css +1 -1
- package/slider/index.es.js +116 -143
- package/slider/index.umd.js +1 -1
- package/slider/style.css +1 -1
- package/splitter/index.es.js +256 -147
- package/splitter/index.umd.js +16 -16
- 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/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 +7779 -60
- package/switch/index.umd.js +27 -1
- package/switch/style.css +1 -1
- package/table/index.es.js +4092 -1464
- package/table/index.umd.js +17 -17
- package/table/style.css +1 -1
- package/tabs/index.es.js +224 -77
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +5 -1
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +3357 -1064
- package/textarea/index.umd.js +19 -19
- 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 +92 -41
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +100 -163
- package/tooltip/index.umd.js +16 -16
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +11036 -608
- package/tree/index.umd.js +27 -1
- package/tree/style.css +1 -1
- package/upload/index.es.js +389 -105
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +17291 -9726
- package/vue-devui.umd.js +24 -23
- package/date-picker/index.es.js +0 -1298
- 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/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,4 +1,6 @@
|
|
|
1
1
|
var __defProp = Object.defineProperty;
|
|
2
|
+
var __defProps = Object.defineProperties;
|
|
3
|
+
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
2
4
|
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
3
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
4
6
|
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
@@ -14,24 +16,30 @@ var __spreadValues = (a, b) => {
|
|
|
14
16
|
}
|
|
15
17
|
return a;
|
|
16
18
|
};
|
|
19
|
+
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
17
20
|
var __publicField = (obj, key, value) => {
|
|
18
21
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
19
22
|
return value;
|
|
20
23
|
};
|
|
21
|
-
import { defineComponent, ref, createVNode, h, render, computed, nextTick, unref, watch, onUnmounted, mergeProps, withDirectives, withModifiers, resolveComponent, vShow, resolveDirective } from "vue";
|
|
24
|
+
import { defineComponent, ref, createVNode, h, render, computed, nextTick, unref, watch, onUnmounted, mergeProps, reactive, getCurrentInstance, withDirectives, withModifiers, resolveComponent, Teleport, Transition, vShow, resolveDirective } from "vue";
|
|
22
25
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
23
26
|
const editableSelectProps = {
|
|
27
|
+
modelValue: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
24
31
|
options: {
|
|
25
32
|
type: Array,
|
|
26
33
|
default: () => []
|
|
27
34
|
},
|
|
28
|
-
|
|
29
|
-
type: Boolean
|
|
35
|
+
allowClear: {
|
|
36
|
+
type: Boolean,
|
|
37
|
+
default: false
|
|
30
38
|
},
|
|
31
|
-
|
|
39
|
+
disabled: {
|
|
32
40
|
type: Boolean
|
|
33
41
|
},
|
|
34
|
-
|
|
42
|
+
disabledKey: {
|
|
35
43
|
type: String,
|
|
36
44
|
default: ""
|
|
37
45
|
},
|
|
@@ -39,16 +47,22 @@ const editableSelectProps = {
|
|
|
39
47
|
type: String,
|
|
40
48
|
default: "Search"
|
|
41
49
|
},
|
|
42
|
-
modelValue: {
|
|
43
|
-
type: String,
|
|
44
|
-
default: ""
|
|
45
|
-
},
|
|
46
50
|
width: {
|
|
47
51
|
type: Number
|
|
48
52
|
},
|
|
49
53
|
maxHeight: {
|
|
50
54
|
type: Number
|
|
51
55
|
},
|
|
56
|
+
loading: {
|
|
57
|
+
type: Boolean
|
|
58
|
+
},
|
|
59
|
+
enableLazyLoad: {
|
|
60
|
+
type: Boolean,
|
|
61
|
+
default: false
|
|
62
|
+
},
|
|
63
|
+
searchFn: {
|
|
64
|
+
type: Function
|
|
65
|
+
},
|
|
52
66
|
filterOption: {
|
|
53
67
|
type: [Function, Boolean]
|
|
54
68
|
}
|
|
@@ -346,47 +360,63 @@ function className(classStr, classOpt) {
|
|
|
346
360
|
return classname;
|
|
347
361
|
}
|
|
348
362
|
var editableSelect = "";
|
|
349
|
-
|
|
350
|
-
const
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
363
|
+
function useSelect(props) {
|
|
364
|
+
const normalizeOptions = computed(() => {
|
|
365
|
+
return props.options.map((option) => {
|
|
366
|
+
let res;
|
|
367
|
+
if (option !== "null" && typeof option === "object") {
|
|
368
|
+
res = __spreadProps(__spreadValues({}, option), {
|
|
369
|
+
label: option.label || "",
|
|
370
|
+
value: option.value !== void 0 ? option.value : option.label || ""
|
|
371
|
+
});
|
|
372
|
+
} else {
|
|
373
|
+
res = {
|
|
374
|
+
label: String(option),
|
|
375
|
+
value: option
|
|
376
|
+
};
|
|
377
|
+
}
|
|
378
|
+
return res;
|
|
379
|
+
});
|
|
380
|
+
});
|
|
381
|
+
return { normalizeOptions };
|
|
382
|
+
}
|
|
383
|
+
function useFilterOptions(enableLazyLoad, normalizeOptions, inputValue, searchFn) {
|
|
384
|
+
const filteredOptions = computed(() => {
|
|
385
|
+
if (!inputValue.value || enableLazyLoad) {
|
|
386
|
+
return normalizeOptions.value;
|
|
359
387
|
}
|
|
388
|
+
return normalizeOptions.value.filter((option) => {
|
|
389
|
+
return searchFn(option, inputValue.value);
|
|
390
|
+
});
|
|
360
391
|
});
|
|
361
|
-
return filteredOptions;
|
|
362
|
-
}
|
|
363
|
-
|
|
392
|
+
return { filteredOptions };
|
|
393
|
+
}
|
|
394
|
+
function useInput(inputValue, ctx2) {
|
|
364
395
|
const onInputChange = (value) => {
|
|
365
396
|
ctx2.emit("search", value);
|
|
366
397
|
};
|
|
367
398
|
const handleInput = (event) => {
|
|
368
399
|
const value = event.target.value;
|
|
369
400
|
inputValue.value = value;
|
|
370
|
-
ctx2.emit("update:modelValue", value);
|
|
371
401
|
onInputChange(value);
|
|
372
402
|
};
|
|
373
403
|
return {
|
|
374
404
|
handleInput
|
|
375
405
|
};
|
|
376
|
-
}
|
|
377
|
-
|
|
406
|
+
}
|
|
407
|
+
function useLazyLoad(dropdownRef, enableLazyLoad, ctx2) {
|
|
378
408
|
const loadMore = () => {
|
|
379
409
|
const dropdownVal = dropdownRef.value;
|
|
380
|
-
if (
|
|
410
|
+
if (!enableLazyLoad) {
|
|
381
411
|
return;
|
|
382
412
|
}
|
|
383
413
|
if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
|
|
384
|
-
ctx2.emit("loadMore"
|
|
414
|
+
ctx2.emit("loadMore");
|
|
385
415
|
}
|
|
386
416
|
};
|
|
387
417
|
return { loadMore };
|
|
388
|
-
}
|
|
389
|
-
|
|
418
|
+
}
|
|
419
|
+
function useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, optionDisabledKey, filterOption, loading2, handleClick, closeMenu, toggleMenu) {
|
|
390
420
|
const hoverIndex = ref(0);
|
|
391
421
|
const selectedIndex = ref(0);
|
|
392
422
|
const updateHoveringIndex = (index2) => {
|
|
@@ -408,18 +438,15 @@ const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, op
|
|
|
408
438
|
});
|
|
409
439
|
};
|
|
410
440
|
const handleEscape = () => {
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
} else {
|
|
414
|
-
closeMenu();
|
|
415
|
-
}
|
|
441
|
+
inputValue.value = cacheInput.value;
|
|
442
|
+
closeMenu();
|
|
416
443
|
};
|
|
417
444
|
const handleEnter = () => {
|
|
418
445
|
const len = filteredOptions.value.length;
|
|
419
446
|
if (!visible.value || !len) {
|
|
420
447
|
return toggleMenu();
|
|
421
448
|
}
|
|
422
|
-
len && len === 1 ? handleClick(filteredOptions.value[0]) : handleClick(filteredOptions.value[hoverIndex.value]);
|
|
449
|
+
len && len === 1 ? handleClick(filteredOptions.value[0], 1) : handleClick(filteredOptions.value[hoverIndex.value], hoverIndex.value);
|
|
423
450
|
return closeMenu();
|
|
424
451
|
};
|
|
425
452
|
const handleKeyboardNavigation = (direction) => {
|
|
@@ -468,7 +495,7 @@ const useKeyboardSelect = (dropdownRef, visible, inputValue, filteredOptions, op
|
|
|
468
495
|
}
|
|
469
496
|
};
|
|
470
497
|
return { handleKeydown, hoverIndex, selectedIndex };
|
|
471
|
-
}
|
|
498
|
+
}
|
|
472
499
|
const flexibleOverlayProps = {
|
|
473
500
|
modelValue: {
|
|
474
501
|
type: Boolean,
|
|
@@ -634,6 +661,187 @@ const FlexibleOverlay = defineComponent({
|
|
|
634
661
|
};
|
|
635
662
|
}
|
|
636
663
|
});
|
|
664
|
+
function useCacheFilteredOptions(filteredOptions) {
|
|
665
|
+
const cacheFilteredOptions = computed(() => {
|
|
666
|
+
const map = /* @__PURE__ */ new Map();
|
|
667
|
+
filteredOptions.value.forEach((item) => {
|
|
668
|
+
map.set(item, item.value);
|
|
669
|
+
});
|
|
670
|
+
return map;
|
|
671
|
+
});
|
|
672
|
+
const getOptionValue = (option) => cacheFilteredOptions.value.get(option);
|
|
673
|
+
return {
|
|
674
|
+
getOptionValue
|
|
675
|
+
};
|
|
676
|
+
}
|
|
677
|
+
function deepAssign(...objects) {
|
|
678
|
+
const isObject = (obj) => obj && typeof obj === "object";
|
|
679
|
+
return objects.reduce((prev, from) => {
|
|
680
|
+
Object.keys(from).forEach((key) => {
|
|
681
|
+
const pVal = prev[key];
|
|
682
|
+
const oVal = from[key];
|
|
683
|
+
if (Array.isArray(pVal) && Array.isArray(oVal)) {
|
|
684
|
+
prev[key] = Array.from(/* @__PURE__ */ new Set([...oVal, ...pVal]));
|
|
685
|
+
} else if (isObject(pVal) && isObject(oVal)) {
|
|
686
|
+
prev[key] = deepAssign(pVal, oVal);
|
|
687
|
+
} else {
|
|
688
|
+
prev[key] = oVal;
|
|
689
|
+
}
|
|
690
|
+
});
|
|
691
|
+
return prev;
|
|
692
|
+
}, {});
|
|
693
|
+
}
|
|
694
|
+
var zhCN = {
|
|
695
|
+
pagination: {
|
|
696
|
+
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
697
|
+
goToText: "\u8DF3\u81F3"
|
|
698
|
+
},
|
|
699
|
+
accordion: {
|
|
700
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
701
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
702
|
+
},
|
|
703
|
+
autoCompleteDropdown: {
|
|
704
|
+
latestInput: "\u6700\u8FD1\u8F93\u5165"
|
|
705
|
+
},
|
|
706
|
+
cascaderList: {
|
|
707
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
708
|
+
},
|
|
709
|
+
colorPicker: {
|
|
710
|
+
foundationPanel: "\u57FA\u7840\u9762\u677F",
|
|
711
|
+
advancedPanel: "\u9AD8\u7EA7\u9762\u677F"
|
|
712
|
+
},
|
|
713
|
+
datePickerPro: {
|
|
714
|
+
ok: "\u786E\u5B9A",
|
|
715
|
+
placeholder: "\u8BF7\u9009\u62E9\u65E5\u671F",
|
|
716
|
+
month1: "1\u6708",
|
|
717
|
+
month2: "2\u6708",
|
|
718
|
+
month3: "3\u6708",
|
|
719
|
+
month4: "4\u6708",
|
|
720
|
+
month5: "5\u6708",
|
|
721
|
+
month6: "6\u6708",
|
|
722
|
+
month7: "7\u6708",
|
|
723
|
+
month8: "8\u6708",
|
|
724
|
+
month9: "9\u6708",
|
|
725
|
+
month10: "10\u6708",
|
|
726
|
+
month11: "11\u6708",
|
|
727
|
+
month12: "12\u6708",
|
|
728
|
+
year: "\u5E74",
|
|
729
|
+
startPlaceholder: "\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",
|
|
730
|
+
endPlaceholder: "\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",
|
|
731
|
+
getWeekDays() {
|
|
732
|
+
return ["\u65E5", "\u4E00", "\u4E8C", "\u4E09", "\u56DB", "\u4E94", "\u516D"];
|
|
733
|
+
},
|
|
734
|
+
getTimeArr() {
|
|
735
|
+
return ["\u65F6", "\u5206", "\u79D2"];
|
|
736
|
+
},
|
|
737
|
+
getYearMonthStr(year, month) {
|
|
738
|
+
return `${year}\u5E74${month}\u6708`;
|
|
739
|
+
}
|
|
740
|
+
},
|
|
741
|
+
editableSelect: {
|
|
742
|
+
noRelatedRecords: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
743
|
+
noData: "\u6CA1\u6709\u6570\u636E"
|
|
744
|
+
},
|
|
745
|
+
input: {
|
|
746
|
+
placeholder: "\u8BF7\u8F93\u5165"
|
|
747
|
+
},
|
|
748
|
+
splitterBar: {
|
|
749
|
+
collapse: "\u6536\u8D77",
|
|
750
|
+
expand: "\u5C55\u5F00"
|
|
751
|
+
},
|
|
752
|
+
stepsGuide: {
|
|
753
|
+
previous: "\u4E0A\u4E00\u6B65",
|
|
754
|
+
continue: "\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",
|
|
755
|
+
ok: "\u6211\u77E5\u9053\u5566"
|
|
756
|
+
},
|
|
757
|
+
table: {
|
|
758
|
+
selectAll: "\u5168\u9009",
|
|
759
|
+
ok: "\u786E\u5B9A"
|
|
760
|
+
},
|
|
761
|
+
timePopup: {
|
|
762
|
+
ok: "\u786E\u5B9A"
|
|
763
|
+
},
|
|
764
|
+
transfer: {
|
|
765
|
+
unit: "\u9879",
|
|
766
|
+
panelUnit: "\u9879",
|
|
767
|
+
headerUnit: "\u9879",
|
|
768
|
+
noData: "\u6682\u65E0\u6570\u636E",
|
|
769
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"
|
|
770
|
+
},
|
|
771
|
+
tree: {
|
|
772
|
+
loading: "\u52A0\u8F7D\u4E2D",
|
|
773
|
+
newNode: "\u65B0\u8282\u70B9",
|
|
774
|
+
selectPlaceholder: "\u8BF7\u9009\u62E9"
|
|
775
|
+
},
|
|
776
|
+
upload: {
|
|
777
|
+
placeholder: "\u9009\u62E9\u6587\u4EF6",
|
|
778
|
+
getExistSameNameFilesMsg(sameNames) {
|
|
779
|
+
return `\u60A8\u4E0A\u4F20\u7684 "${sameNames}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`;
|
|
780
|
+
},
|
|
781
|
+
getAllFilesBeyondMaximalFileSizeMsg(maximalSize) {
|
|
782
|
+
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`;
|
|
783
|
+
},
|
|
784
|
+
getBeyondMaximalFileSizeMsg(filename, maximalSize) {
|
|
785
|
+
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`;
|
|
786
|
+
},
|
|
787
|
+
getNotAllowedFileTypeMsg(filename, scope) {
|
|
788
|
+
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`;
|
|
789
|
+
}
|
|
790
|
+
},
|
|
791
|
+
search: {
|
|
792
|
+
placeholder: "\u8BF7\u8F93\u5165\u5173\u952E\u5B57"
|
|
793
|
+
},
|
|
794
|
+
select: {
|
|
795
|
+
placeholder: "\u8BF7\u9009\u62E9",
|
|
796
|
+
noDataText: "\u65E0\u6570\u636E",
|
|
797
|
+
noMatchText: "\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",
|
|
798
|
+
loadingText: "\u52A0\u8F7D\u4E2D..."
|
|
799
|
+
},
|
|
800
|
+
tagInput: {
|
|
801
|
+
maxTagsText: "\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"
|
|
802
|
+
},
|
|
803
|
+
timeSelect: {
|
|
804
|
+
placeholder: "\u8BF7\u9009\u62E9\u65F6\u95F4"
|
|
805
|
+
}
|
|
806
|
+
};
|
|
807
|
+
const lang = ref("zh-CN");
|
|
808
|
+
let langMessages = reactive({
|
|
809
|
+
[lang.value]: zhCN
|
|
810
|
+
});
|
|
811
|
+
const Locale = {
|
|
812
|
+
messages() {
|
|
813
|
+
return langMessages[lang.value];
|
|
814
|
+
},
|
|
815
|
+
lang() {
|
|
816
|
+
return lang.value;
|
|
817
|
+
},
|
|
818
|
+
use(newLang, newMessages) {
|
|
819
|
+
lang.value = newLang;
|
|
820
|
+
this.add({ [newLang]: newMessages });
|
|
821
|
+
},
|
|
822
|
+
add(newMessages = {}) {
|
|
823
|
+
langMessages = deepAssign(langMessages, newMessages);
|
|
824
|
+
}
|
|
825
|
+
};
|
|
826
|
+
const camelize = (name) => name.substring(1).replace(/^\S/, (s) => s.toLocaleLowerCase());
|
|
827
|
+
function get(object, path) {
|
|
828
|
+
const keys = path.split(".");
|
|
829
|
+
let result = object;
|
|
830
|
+
keys.forEach((key) => {
|
|
831
|
+
var _a;
|
|
832
|
+
result = (_a = result[key]) != null ? _a : "";
|
|
833
|
+
});
|
|
834
|
+
return result;
|
|
835
|
+
}
|
|
836
|
+
function createI18nTranslate(name, app, newPrefix) {
|
|
837
|
+
const prefix = newPrefix || camelize(name) + ".";
|
|
838
|
+
return (path) => {
|
|
839
|
+
var _a;
|
|
840
|
+
const messages = ((_a = app == null ? void 0 : app.appContext.config.globalProperties.langMessages) == null ? void 0 : _a.value) || Locale.messages();
|
|
841
|
+
const message = get(messages, prefix + path) || get(messages, path);
|
|
842
|
+
return message;
|
|
843
|
+
};
|
|
844
|
+
}
|
|
637
845
|
var EditableSelect = defineComponent({
|
|
638
846
|
name: "DEditableSelect",
|
|
639
847
|
directives: {
|
|
@@ -643,33 +851,32 @@ var EditableSelect = defineComponent({
|
|
|
643
851
|
props: editableSelectProps,
|
|
644
852
|
emits: ["update:modelValue", "search", "loadMore"],
|
|
645
853
|
setup(props, ctx2) {
|
|
854
|
+
const app = getCurrentInstance();
|
|
855
|
+
const t = createI18nTranslate("DEditableSelect", app);
|
|
856
|
+
const ns = useNamespace("editable-select");
|
|
646
857
|
const dropdownRef = ref();
|
|
647
858
|
const origin = ref();
|
|
648
859
|
const position = ref(["bottom"]);
|
|
649
860
|
const visible = ref(false);
|
|
650
861
|
const inputValue = ref(props.modelValue);
|
|
862
|
+
const cacheInput = ref();
|
|
651
863
|
const loading2 = ref(props.loading);
|
|
652
|
-
const
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
value: option
|
|
663
|
-
};
|
|
664
|
-
});
|
|
665
|
-
});
|
|
666
|
-
const filteredOptions = userFilterOptions(normalizeOptions, inputValue, props.filterOption);
|
|
864
|
+
const {
|
|
865
|
+
normalizeOptions
|
|
866
|
+
} = useSelect(props);
|
|
867
|
+
const searchFn = props.searchFn || ((option, term) => option.label.toLocaleLowerCase().includes(term.trim().toLocaleLowerCase()));
|
|
868
|
+
const {
|
|
869
|
+
filteredOptions
|
|
870
|
+
} = useFilterOptions(props.enableLazyLoad, normalizeOptions, inputValue, searchFn);
|
|
871
|
+
const {
|
|
872
|
+
getOptionValue
|
|
873
|
+
} = useCacheFilteredOptions(filteredOptions);
|
|
667
874
|
const emptyText = computed(() => {
|
|
668
|
-
let text
|
|
669
|
-
if (props.
|
|
670
|
-
text = "
|
|
671
|
-
} else
|
|
672
|
-
text = "
|
|
875
|
+
let text;
|
|
876
|
+
if (props.enableLazyLoad) {
|
|
877
|
+
text = t("noData");
|
|
878
|
+
} else {
|
|
879
|
+
text = t("noRelatedRecords");
|
|
673
880
|
}
|
|
674
881
|
return text;
|
|
675
882
|
});
|
|
@@ -684,45 +891,47 @@ var EditableSelect = defineComponent({
|
|
|
684
891
|
};
|
|
685
892
|
const {
|
|
686
893
|
loadMore
|
|
687
|
-
} = useLazyLoad(dropdownRef,
|
|
894
|
+
} = useLazyLoad(dropdownRef, props.enableLazyLoad, ctx2);
|
|
688
895
|
const {
|
|
689
896
|
handleInput
|
|
690
897
|
} = useInput(inputValue, ctx2);
|
|
691
|
-
const handleClick = (option) => {
|
|
898
|
+
const handleClick = (option, index2, curSelectedIndex) => {
|
|
692
899
|
const {
|
|
693
|
-
|
|
900
|
+
disabledKey
|
|
694
901
|
} = props;
|
|
695
902
|
if (disabledKey && !!option[disabledKey]) {
|
|
696
903
|
return;
|
|
697
904
|
}
|
|
698
|
-
|
|
905
|
+
inputValue.value = option.label;
|
|
906
|
+
cacheInput.value = option.label;
|
|
907
|
+
curSelectedIndex.value = index2;
|
|
908
|
+
const value = getOptionValue(option);
|
|
909
|
+
ctx2.emit("update:modelValue", value + "");
|
|
699
910
|
closeMenu();
|
|
700
911
|
};
|
|
912
|
+
const handleClear = () => {
|
|
913
|
+
inputValue.value = "";
|
|
914
|
+
};
|
|
701
915
|
const {
|
|
702
916
|
handleKeydown,
|
|
703
917
|
hoverIndex,
|
|
704
918
|
selectedIndex
|
|
705
|
-
} = useKeyboardSelect(dropdownRef, visible, inputValue, filteredOptions, props.
|
|
706
|
-
watch(() => props.modelValue, (newVal) => {
|
|
707
|
-
if (newVal) {
|
|
708
|
-
inputValue.value = newVal;
|
|
709
|
-
}
|
|
710
|
-
});
|
|
919
|
+
} = useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, props.disabledKey, props.filterOption, loading2, (option, index2) => handleClick(option, index2, selectedIndex), closeMenu, toggleMenu);
|
|
711
920
|
const getItemCls = (option, index2) => {
|
|
712
921
|
const {
|
|
713
|
-
|
|
922
|
+
disabledKey
|
|
714
923
|
} = props;
|
|
715
|
-
return className(
|
|
924
|
+
return className(`devui-dropdown-item`, {
|
|
716
925
|
disabled: disabledKey ? !!option[disabledKey] : false,
|
|
717
926
|
selected: index2 === selectedIndex.value,
|
|
718
|
-
"
|
|
927
|
+
[`${ns.em("dropdown", "bg")}`]: index2 === hoverIndex.value
|
|
719
928
|
});
|
|
720
929
|
};
|
|
721
930
|
return () => {
|
|
722
|
-
const selectCls = className(
|
|
723
|
-
"
|
|
931
|
+
const selectCls = className(`${ns.b()} devui-form-group devui-has-feedback ${inputValue.value && props.allowClear && "allow-clear"}`, {
|
|
932
|
+
[`${ns.m("open")}`]: visible.value === true
|
|
724
933
|
});
|
|
725
|
-
const inputCls = className(
|
|
934
|
+
const inputCls = className(`devui-form-control devui-dropdown-origin`, {
|
|
726
935
|
"devui-dropdown-origin-open": visible.value === true
|
|
727
936
|
});
|
|
728
937
|
return withDirectives(createVNode("div", {
|
|
@@ -743,42 +952,53 @@ var EditableSelect = defineComponent({
|
|
|
743
952
|
}, null), createVNode("span", {
|
|
744
953
|
"class": "devui-form-control-feedback"
|
|
745
954
|
}, [createVNode("span", {
|
|
955
|
+
"class": "devui-select-clear-icon",
|
|
956
|
+
"onClick": handleClear
|
|
957
|
+
}, [createVNode(resolveComponent("d-icon"), {
|
|
958
|
+
"name": "icon-remove"
|
|
959
|
+
}, null)]), createVNode("span", {
|
|
746
960
|
"class": "devui-select-chevron-icon"
|
|
747
961
|
}, [createVNode(resolveComponent("d-icon"), {
|
|
748
962
|
"name": "select-arrow"
|
|
749
|
-
}, null)])]), createVNode(
|
|
750
|
-
"
|
|
751
|
-
"modelValue": visible.value,
|
|
752
|
-
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
753
|
-
"position": position.value,
|
|
754
|
-
"hasBackdrop": false
|
|
963
|
+
}, null)])]), createVNode(Teleport, {
|
|
964
|
+
"to": "body"
|
|
755
965
|
}, {
|
|
756
|
-
default: () => [createVNode(
|
|
757
|
-
"
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
"
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
966
|
+
default: () => [createVNode(Transition, {
|
|
967
|
+
"name": "fade"
|
|
968
|
+
}, {
|
|
969
|
+
default: () => [createVNode(FlexibleOverlay, {
|
|
970
|
+
"origin": origin.value,
|
|
971
|
+
"modelValue": visible.value,
|
|
972
|
+
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
973
|
+
"position": position.value
|
|
974
|
+
}, {
|
|
975
|
+
default: () => [createVNode("div", {
|
|
976
|
+
"style": {
|
|
977
|
+
width: props.width + "px"
|
|
978
|
+
},
|
|
979
|
+
"class": `${ns.e("menu")}`
|
|
980
|
+
}, [withDirectives(createVNode("div", {
|
|
981
|
+
"class": `devui-dropdown-menu`
|
|
982
|
+
}, [createVNode("ul", {
|
|
983
|
+
"ref": dropdownRef,
|
|
984
|
+
"class": `${ns.em("list", "unstyled")} devui-scrollbar scroll-height`,
|
|
985
|
+
"style": {
|
|
986
|
+
maxHeight: props.maxHeight + "px"
|
|
987
|
+
},
|
|
988
|
+
"onScroll": loadMore
|
|
989
|
+
}, [filteredOptions.value.map((option, index2) => {
|
|
990
|
+
return createVNode("li", {
|
|
991
|
+
"class": getItemCls(option, index2),
|
|
992
|
+
"onClick": (e) => {
|
|
993
|
+
e.stopPropagation();
|
|
994
|
+
handleClick(option, index2, selectedIndex);
|
|
995
|
+
}
|
|
996
|
+
}, [ctx2.slots.item ? ctx2.slots.item(option) : option.label]);
|
|
997
|
+
}), withDirectives(createVNode("div", {
|
|
998
|
+
"class": "devui-no-data-tip"
|
|
999
|
+
}, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem(inputValue.value) : emptyText.value]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value], [resolveDirective("d-loading"), props.loading]])])]
|
|
1000
|
+
})]
|
|
1001
|
+
})]
|
|
782
1002
|
})]), [[resolveDirective("click-outside"), closeMenu]]);
|
|
783
1003
|
};
|
|
784
1004
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var be=Object.defineProperty;var G=Object.getOwnPropertySymbols;var Ve=Object.prototype.hasOwnProperty,xe=Object.prototype.propertyIsEnumerable;var T=(d,t,f)=>t in d?be(d,t,{enumerable:!0,configurable:!0,writable:!0,value:f}):d[t]=f,L=(d,t)=>{for(var f in t||(t={}))Ve.call(t,f)&&T(d,f,t[f]);if(G)for(var f of G(t))xe.call(t,f)&&T(d,f,t[f]);return d};var b=(d,t,f)=>(T(d,typeof t!="symbol"?t+"":t,f),f);(function(d,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],t):(d=typeof globalThis!="undefined"?globalThis:d||self,t(d.index={},d.Vue,d.dom))})(this,function(d,t,f){"use strict";const j={options:{type:Array,default:()=>[]},disabled:{type:Boolean},loading:{type:Boolean},optionDisabledKey:{type:String,default:""},placeholder:{type:String,default:"Search"},modelValue:{type:String,default:""},width:{type:Number},maxHeight:{type:Number},filterOption:{type:[Function,Boolean]}},J=typeof window!="undefined";function M(e,o,n){document.addEventListener?e&&o&&n&&e.addEventListener(o,n,!1):e&&o&&n&&e.attachEvent("on"+o,n)}const x=Symbol("@@clickoutside"),I=new Map;let R,D=0,K=!0;function z(e,o,n){return J&&K&&(K=!1,M(document,"mousedown",l=>{R=l}),M(document,"mouseup",l=>{for(const[a,i]of I)i[x].documentHandler(l,R)})),function(l,a){!n||!o.instance||!l.target||!a.target||e.contains(l.target)||e.contains(a.target)||e===l.target||e[x].bindingFn&&e[x].bindingFn()}}const Q={beforeMount:function(e,o,n){D++,I.set(D,e),e[x]={nid:D,documentHandler:z(e,o,n),bindingFn:o.value}},updated:function(e,o,n){e[x].documentHandler=z(e,o,n),e[x].bindingFn=o.value},unmounted:function(e){I.delete(e[x].nid),delete e[x]}};class H{constructor(){b(this,"top","50%");b(this,"left","50%")}}const Z={message:String,backdrop:Boolean,view:{type:Object,default:()=>new H},zIndex:Number,isFull:{type:Boolean,default:!1}};class ee{constructor(){b(this,"target");b(this,"message");b(this,"loadingTemplateRef");b(this,"backdrop",!0);b(this,"positionType","relative");b(this,"view",new H);b(this,"zIndex")}}function k(e,o,n){let l=e;return o&&(l+=`__${o}`),n&&(l+=`--${n}`),l}function $(e,o=!1){const n=o?`.devui-${e}`:`devui-${e}`;return{b:()=>k(n),e:c=>c?k(n,c):"",m:c=>c?k(n,"",c):"",em:(c,m)=>c&&m?k(n,c,m):""}}var Ee="",te=t.defineComponent({name:"DLoading",inheritAttrs:!1,props:Z,setup(e){const o={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(o.background="none");const n=t.ref(!1);return{style:o,isShow:n,open:()=>{n.value=!0},close:()=>{n.value=!1}}},render(){var c;const{isShow:e,isFull:o,backdrop:n,style:l,message:a,$slots:i}=this,s=$("loading");return e&&t.createVNode("div",{class:[s.b(),o?s.m("full"):""]},[((c=i.default)==null?void 0:c.call(i))||t.createVNode("div",{class:s.e("wrapper")},[n?t.createVNode("div",{class:s.e("mask")},null):null,t.createVNode("div",{style:l,class:s.e("area")},[t.createVNode("div",{class:s.e("busy-default-spinner")},[t.createVNode("div",{class:s.e("bar1")},null),t.createVNode("div",{class:s.e("bar2")},null),t.createVNode("div",{class:s.e("bar3")},null),t.createVNode("div",{class:s.e("bar4")},null)]),a?t.createVNode("span",{class:s.e("text")},[a]):null])])])}});const _=Symbol("dev_component_container");function ne(e,o,n=null){const l=t.h(e,L({},o),n),a=document.createElement("div");return l[_]=a,t.render(l,a),l.component}function oe(e){t.render(null,e==null?void 0:e.vnode[_])}const le=t.defineComponent(te),C=new WeakSet,B=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},U=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),ae=e=>{switch(U(e)){case"promise":return[e];case"array":return e.some(n=>U(n)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},Y=e=>{C.delete(e),e.instance.proxy.close(),oe(e.instance)},q=(e,o)=>{var n,l,a;if(o.value){const i=ae(o.value);if(i==="error")return;(a=(l=(n=e==null?void 0:e.instance)==null?void 0:n.proxy)==null?void 0:l.open)==null||a.call(l),e.appendChild(e.mask),C.add(e),i&&Promise.all(i).catch(s=>{console.error(new Error("Promise handling errors"),s)}).finally(()=>{Y(e)})}else Y(e)},X=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},W=(e,o)=>{var i;const n=L(L({},new ee),o),l=n.loadingTemplateRef,a=ne(le,L({},n),l?()=>l:null);e.style.position=n.positionType,e.options=n,e.instance=a,e.mask=(i=a==null?void 0:a.proxy)==null?void 0:i.$el},ie={mounted:function(e,o,n){W(e,n.props),X(e),!B(o.value)&&q(e,o)},updated:function(e,o,n){!B(o.value)&&C.has(e)||B(o.value)&&!C.has(e)||(!C.has(e)&&W(e,n.props),X(e),q(e,o))}};function F(e,o){let n=e;return typeof o=="object"&&Object.keys(o).forEach(l=>{o[l]&&(n+=` ${l}`)}),n}var Ne="";const re=()=>(e,o)=>o.label.toLocaleLowerCase().indexOf(e.toLocaleLowerCase())>-1,se=(e,o,n)=>t.computed(()=>{const l=[];if(!o.value||n===!1)return e.value;const a=typeof n=="function"?n:re();return e.value.forEach(i=>{a(o.value,i)&&l.push(i)}),l}),ce=(e,o)=>{const n=a=>{o.emit("search",a)};return{handleInput:a=>{const i=a.target.value;e.value=i,o.emit("update:modelValue",i),n(i)}}},de=(e,o,n,l)=>({loadMore:()=>{const i=e.value;n===!1&&i.clientHeight+i.scrollTop>=i.scrollHeight&&l.emit("loadMore",o.value)}}),ue=(e,o,n,l,a,i,s,c,m,w)=>{const h=t.ref(0),V=t.ref(0),g=u=>{h.value=u},E=u=>{const y=e.value,r=y.children[u];t.nextTick(()=>{if(r.scrollIntoViewIfNeeded)r.scrollIntoViewIfNeeded(!1);else{const v=y.getBoundingClientRect(),p=r.getBoundingClientRect();(p.bottom>v.bottom||p.top<v.top)&&r.scrollIntoView(!1)}})},S=()=>{n.value?n.value="":m()},N=()=>{const u=l.value.length;return!o.value||!u?w():(c(u&&u===1?l.value[0]:l.value[h.value]),m())},O=u=>{const y=l.value.length;if(!y||y===1||!["ArrowDown","ArrowUp"].includes(u)||i===!1&&s.value)return;let r=0;if(r=h.value,u==="ArrowUp"?(r-=1,r===-1&&(r=y-1)):u==="ArrowDown"&&(r+=1,r===y&&(r=0)),h.value=r,l.value[r][a])return O(u);g(r),E(r)};return{handleKeydown:u=>{const y=u.key||u.code;switch(y){case"Escape":S();break;case"Enter":N();break;default:O(y)}},hoverIndex:h,selectedIndex:V}},fe={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function me(e){const o=/(auto|scroll|hidden)/;for(let n=e;n=n.parentElement;n.parentElement!==document.body){const l=window.getComputedStyle(n);if(o.test(l.overflow+l.overflowX+l.overflowY))return n}return window}function we(e,o,n,l){let{x:a,y:i}=o;if(!e){const{width:s,height:c}=l;a&&n.includes("start")&&(a=12),a&&n.includes("end")&&(a=Math.round(s-24)),i&&n.includes("start")&&(i=10),i&&n.includes("end")&&(i=c-14)}return{x:a,y:i}}function he(e,o){const n=t.ref(),l=t.ref();let a=null;const i=(c,m,w,h)=>{const{x:V,y:g}=we(e.isArrowCenter,w,m,h.getBoundingClientRect()),E={top:"bottom",right:"left",bottom:"top",left:"right"}[m.split("-")[0]];Object.assign(c.style,{left:V?`${V}px`:"",top:g?`${g}px`:"",right:"",bottom:"",[E]:"-4px"})},s=async()=>{const c=e.origin,m=t.unref(n.value),w=t.unref(l.value),h=[f.offset(e.offset),f.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&h.push(f.arrow({element:w})),e.shiftOffset!==void 0&&h.push(f.shift());const{x:V,y:g,placement:E,middlewareData:S}=await f.computePosition(c,m,{strategy:"fixed",middleware:h});let N=V,O=g;if(e.shiftOffset!==void 0){const{x:A,y:u}=S.shift;A<0&&(N-=e.shiftOffset),A>0&&(N+=e.shiftOffset),u<0&&(O-=e.shiftOffset),u>0&&(O+=e.shiftOffset)}o("positionChange",E),Object.assign(m.style,{top:`${O}px`,left:`${N}px`}),e.showArrow&&i(w,E,S.arrow,m)};return t.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(a=me(e.origin),t.nextTick(s),a==null||a.addEventListener("scroll",s),a!==window&&window.addEventListener("scroll",s),window.addEventListener("resize",s)):(a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s))}),t.onUnmounted(()=>{a==null||a.removeEventListener("scroll",s),a!==window&&window.removeEventListener("scroll",s),window.removeEventListener("resize",s)}),{arrowRef:l,overlayRef:n,updatePosition:s}}var Oe="";const ye=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:fe,emits:["update:modelValue","positionChange"],setup(e,{slots:o,attrs:n,emit:l,expose:a}){const i=$("flexible-overlay"),{arrowRef:s,overlayRef:c,updatePosition:m}=he(e,l);return a({updatePosition:m}),()=>{var w;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:c,class:i.b()},n),[(w=o.default)==null?void 0:w.call(o),e.showArrow&&t.createVNode("div",{ref:s,class:i.e("arrow")},null)])}}});var P=t.defineComponent({name:"DEditableSelect",directives:{clickOutside:Q,dLoading:ie},props:j,emits:["update:modelValue","search","loadMore"],setup(e,o){const n=t.ref(),l=t.ref(),a=t.ref(["bottom"]),i=t.ref(!1),s=t.ref(e.modelValue),c=t.ref(e.loading),m=t.computed(()=>e.options.map(r=>typeof r=="object"?Object.assign({},r,{label:r.label?r.label:r.value,value:r.value}):{label:r+"",value:r})),w=se(m,s,e.filterOption),h=t.computed(()=>{let r="";return e.filterOption!==!1&&!w.value.length?r="\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55":e.filterOption===!1&&!w.value.length&&(r="\u6CA1\u6709\u6570\u636E"),r});t.watch(()=>e.loading,r=>{c.value=r});const V=()=>{i.value=!i.value},g=()=>{i.value=!1},{loadMore:E}=de(n,s,e.filterOption,o),{handleInput:S}=ce(s,o),N=r=>{const{optionDisabledKey:v}=e;v&&!!r[v]||(o.emit("update:modelValue",r.label),g())},{handleKeydown:O,hoverIndex:A,selectedIndex:u}=ue(n,i,s,w,e.optionDisabledKey,e.filterOption,c,N,g,V);t.watch(()=>e.modelValue,r=>{r&&(s.value=r)});const y=(r,v)=>{const{optionDisabledKey:p}=e;return F("devui-dropdown-item",{disabled:p?!!r[p]:!1,selected:v===u.value,"devui-dropdown-bg":v===A.value})};return()=>{const r=F("devui-editable-select devui-form-group devui-has-feedback",{"devui-select-open":i.value===!0}),v=F("devui-form-control devui-dropdown-origin",{"devui-dropdown-origin-open":i.value===!0});return t.withDirectives(t.createVNode("div",{class:r,ref:l,style:{width:e.width+"px"}},[t.createVNode("input",{class:v,onClick:t.withModifiers(V,["self"]),onInput:S,onKeydown:O,value:s.value,disabled:e.disabled,placeholder:e.placeholder,type:"text"},null),t.createVNode("span",{class:"devui-form-control-feedback"},[t.createVNode("span",{class:"devui-select-chevron-icon"},[t.createVNode(t.resolveComponent("d-icon"),{name:"select-arrow"},null)])]),t.createVNode(ye,{origin:l.value,modelValue:i.value,"onUpdate:modelValue":p=>i.value=p,position:a.value,hasBackdrop:!1},{default:()=>[t.createVNode("div",{style:{width:e.width+"px"}},[t.withDirectives(t.createVNode("div",{class:"devui-dropdown-menu "},[t.createVNode("ul",{ref:n,class:"devui-list-unstyled scroll-height",style:{maxHeight:e.maxHeight+"px"},onScroll:E},[w.value.map((p,ve)=>t.createVNode("li",{class:y(p,ve),onClick:ge=>{ge.stopPropagation(),N(p)}},[o.slots.item?o.slots.item(p):p.label])),t.withDirectives(t.createVNode("li",{class:"devui-no-result-template"},[t.createVNode("div",{class:"devui-no-data-tip"},[o.slots.noResultItem?o.slots.noResultItem():h.value])]),[[t.vShow,!w.value.length]])])]),[[t.resolveDirective("dLoading"),e.loading],[t.vShow,i.value]])])]})]),[[t.resolveDirective("click-outside"),g]])}}}),pe={title:"EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.component(P.name,P)}};d.EditableSelect=P,d.default=pe,d.editableSelectProps=j,Object.defineProperty(d,"__esModule",{value:!0}),d[Symbol.toStringTag]="Module"});
|
|
1
|
+
var Pe=Object.defineProperty,$e=Object.defineProperties;var ze=Object.getOwnPropertyDescriptors;var re=Object.getOwnPropertySymbols;var Re=Object.prototype.hasOwnProperty,je=Object.prototype.propertyIsEnumerable;var Y=(c,t,d)=>t in c?Pe(c,t,{enumerable:!0,configurable:!0,writable:!0,value:d}):c[t]=d,S=(c,t)=>{for(var d in t||(t={}))Re.call(t,d)&&Y(c,d,t[d]);if(re)for(var d of re(t))je.call(t,d)&&Y(c,d,t[d]);return c},se=(c,t)=>$e(c,ze(t));var b=(c,t,d)=>(Y(c,typeof t!="symbol"?t+"":t,d),d);(function(c,t){typeof exports=="object"&&typeof module!="undefined"?t(exports,require("vue"),require("@floating-ui/dom")):typeof define=="function"&&define.amd?define(["exports","vue","@floating-ui/dom"],t):(c=typeof globalThis!="undefined"?globalThis:c||self,t(c.index={},c.Vue,c.dom))})(this,function(c,t,d){"use strict";const q={modelValue:{type:String,default:""},options:{type:Array,default:()=>[]},allowClear:{type:Boolean,default:!1},disabled:{type:Boolean},disabledKey:{type:String,default:""},placeholder:{type:String,default:"Search"},width:{type:Number},maxHeight:{type:Number},loading:{type:Boolean},enableLazyLoad:{type:Boolean,default:!1},searchFn:{type:Function},filterOption:{type:[Function,Boolean]}},ie=typeof window!="undefined";function X(e,o,n){document.addEventListener?e&&o&&n&&e.addEventListener(o,n,!1):e&&o&&n&&e.attachEvent("on"+o,n)}const A=Symbol("@@clickoutside"),P=new Map;let W,$=0,G=!0;function J(e,o,n){return ie&&G&&(G=!1,X(document,"mousedown",a=>{W=a}),X(document,"mouseup",a=>{for(const[u,l]of P)l[A].documentHandler(a,W)})),function(a,u){!n||!o.instance||!a.target||!u.target||e.contains(a.target)||e.contains(u.target)||e===a.target||e[A].bindingFn&&e[A].bindingFn()}}const ce={beforeMount:function(e,o,n){$++,P.set($,e),e[A]={nid:$,documentHandler:J(e,o,n),bindingFn:o.value}},updated:function(e,o,n){e[A].documentHandler=J(e,o,n),e[A].bindingFn=o.value},unmounted:function(e){P.delete(e[A].nid),delete e[A]}};class Q{constructor(){b(this,"top","50%");b(this,"left","50%")}}const de={message:String,backdrop:Boolean,view:{type:Object,default:()=>new Q},zIndex:Number,isFull:{type:Boolean,default:!1}};class fe{constructor(){b(this,"target");b(this,"message");b(this,"loadingTemplateRef");b(this,"backdrop",!0);b(this,"positionType","relative");b(this,"view",new Q);b(this,"zIndex")}}function I(e,o,n){let a=e;return o&&(a+=`__${o}`),n&&(a+=`--${n}`),a}function z(e,o=!1){const n=o?`.devui-${e}`:`devui-${e}`;return{b:()=>I(n),e:s=>s?I(n,s):"",m:s=>s?I(n,"",s):"",em:(s,i)=>s&&i?I(n,s,i):""}}var He="",me=t.defineComponent({name:"DLoading",inheritAttrs:!1,props:de,setup(e){const o={top:e.view.top,left:e.view.left,zIndex:e.zIndex};e.message||(o.background="none");const n=t.ref(!1);return{style:o,isShow:n,open:()=>{n.value=!0},close:()=>{n.value=!1}}},render(){var s;const{isShow:e,isFull:o,backdrop:n,style:a,message:u,$slots:l}=this,r=z("loading");return e&&t.createVNode("div",{class:[r.b(),o?r.m("full"):""]},[((s=l.default)==null?void 0:s.call(l))||t.createVNode("div",{class:r.e("wrapper")},[n?t.createVNode("div",{class:r.e("mask")},null):null,t.createVNode("div",{style:a,class:r.e("area")},[t.createVNode("div",{class:r.e("busy-default-spinner")},[t.createVNode("div",{class:r.e("bar1")},null),t.createVNode("div",{class:r.e("bar2")},null),t.createVNode("div",{class:r.e("bar3")},null),t.createVNode("div",{class:r.e("bar4")},null)]),u?t.createVNode("span",{class:r.e("text")},[u]):null])])])}});const Z=Symbol("dev_component_container");function he(e,o,n=null){const a=t.h(e,S({},o),n),u=document.createElement("div");return a[Z]=u,t.render(a,u),a.component}function ge(e){t.render(null,e==null?void 0:e.vnode[Z])}const pe=t.defineComponent(me),L=new WeakSet,R=e=>{if(!e)return!0;if(Array.isArray(e))return e.length===0;if(e instanceof Set||e instanceof Map)return e.size===0;if(e instanceof Promise)return!1;if(typeof e=="object")try{return Object.keys(e).length===0}catch{return!1}return!1},ee=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),we=e=>{switch(ee(e)){case"promise":return[e];case"array":return e.some(n=>ee(n)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},te=e=>{L.delete(e),e.instance.proxy.close(),ge(e.instance)},ne=(e,o)=>{var n,a,u;if(o.value){const l=we(o.value);if(l==="error")return;(u=(a=(n=e==null?void 0:e.instance)==null?void 0:n.proxy)==null?void 0:a.open)==null||u.call(a),e.appendChild(e.mask),L.add(e),l&&Promise.all(l).catch(r=>{console.error(new Error("Promise handling errors"),r)}).finally(()=>{te(e)})}else te(e)},oe=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},ue=(e,o)=>{var l;const n=S(S({},new fe),o),a=n.loadingTemplateRef,u=he(pe,S({},n),a?()=>a:null);e.style.position=n.positionType,e.options=n,e.instance=u,e.mask=(l=u==null?void 0:u.proxy)==null?void 0:l.$el},Ee={mounted:function(e,o,n){ue(e,n.props),oe(e),!R(o.value)&&ne(e,o)},updated:function(e,o,n){!R(o.value)&&L.has(e)||R(o.value)&&!L.has(e)||(!L.has(e)&&ue(e,n.props),oe(e),ne(e,o))}};function j(e,o){let n=e;return typeof o=="object"&&Object.keys(o).forEach(a=>{o[a]&&(n+=` ${a}`)}),n}var Ke="";function ye(e){return{normalizeOptions:t.computed(()=>e.options.map(n=>{let a;return n!=="null"&&typeof n=="object"?a=se(S({},n),{label:n.label||"",value:n.value!==void 0?n.value:n.label||""}):a={label:String(n),value:n},a}))}}function Fe(e,o,n,a){return{filteredOptions:t.computed(()=>!n.value||e?o.value:o.value.filter(l=>a(l,n.value)))}}function be(e,o){const n=u=>{o.emit("search",u)};return{handleInput:u=>{const l=u.target.value;e.value=l,n(l)}}}function ve(e,o,n){return{loadMore:()=>{const u=e.value;!o||u.clientHeight+u.scrollTop>=u.scrollHeight&&n.emit("loadMore")}}}function Ae(e,o,n,a,u,l,r,s,i,f,y){const p=t.ref(0),C=t.ref(0),B=g=>{p.value=g},v=g=>{const w=e.value,m=w.children[g];t.nextTick(()=>{if(m.scrollIntoViewIfNeeded)m.scrollIntoViewIfNeeded(!1);else{const O=w.getBoundingClientRect(),M=m.getBoundingClientRect();(M.bottom>O.bottom||M.top<O.top)&&m.scrollIntoView(!1)}})},x=()=>{n.value=a.value,f()},V=()=>{const g=u.value.length;return!o.value||!g?y():(g&&g===1?i(u.value[0],1):i(u.value[p.value],p.value),f())},D=g=>{const w=u.value.length;if(!w||w===1||!["ArrowDown","ArrowUp"].includes(g)||r===!1&&s.value)return;let m=0;if(m=p.value,g==="ArrowUp"?(m-=1,m===-1&&(m=w-1)):g==="ArrowDown"&&(m+=1,m===w&&(m=0)),p.value=m,u.value[m][l])return D(g);B(m),v(m)};return{handleKeydown:g=>{const w=g.key||g.code;switch(w){case"Escape":x();break;case"Enter":V();break;default:D(w)}},hoverIndex:p,selectedIndex:C}}const Ce={modelValue:{type:Boolean,default:!1},origin:{type:Object,require:!0},position:{type:Array,default:["bottom"]},offset:{type:[Number,Object],default:8},shiftOffset:{type:Number},align:{type:String,default:null},showArrow:{type:Boolean,default:!1},isArrowCenter:{type:Boolean,default:!0}};function Be(e){const o=/(auto|scroll|hidden)/;for(let n=e;n=n.parentElement;n.parentElement!==document.body){const a=window.getComputedStyle(n);if(o.test(a.overflow+a.overflowX+a.overflowY))return n}return window}function De(e,o,n,a){let{x:u,y:l}=o;if(!e){const{width:r,height:s}=a;u&&n.includes("start")&&(u=12),u&&n.includes("end")&&(u=Math.round(r-24)),l&&n.includes("start")&&(l=10),l&&n.includes("end")&&(l=s-14)}return{x:u,y:l}}function xe(e,o){const n=t.ref(),a=t.ref();let u=null;const l=(s,i,f,y)=>{const{x:p,y:C}=De(e.isArrowCenter,f,i,y.getBoundingClientRect()),B={top:"bottom",right:"left",bottom:"top",left:"right"}[i.split("-")[0]];Object.assign(s.style,{left:p?`${p}px`:"",top:C?`${C}px`:"",right:"",bottom:"",[B]:"-4px"})},r=async()=>{const s=e.origin,i=t.unref(n.value),f=t.unref(a.value),y=[d.offset(e.offset),d.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&y.push(d.arrow({element:f})),e.shiftOffset!==void 0&&y.push(d.shift());const{x:p,y:C,placement:B,middlewareData:v}=await d.computePosition(s,i,{strategy:"fixed",middleware:y});let x=p,V=C;if(e.shiftOffset!==void 0){const{x:D,y:N}=v.shift;D<0&&(x-=e.shiftOffset),D>0&&(x+=e.shiftOffset),N<0&&(V-=e.shiftOffset),N>0&&(V+=e.shiftOffset)}o("positionChange",B),Object.assign(i.style,{top:`${V}px`,left:`${x}px`}),e.showArrow&&l(f,B,v.arrow,i)};return t.watch(()=>e.modelValue,()=>{e.modelValue&&e.origin?(u=Be(e.origin),t.nextTick(r),u==null||u.addEventListener("scroll",r),u!==window&&window.addEventListener("scroll",r),window.addEventListener("resize",r)):(u==null||u.removeEventListener("scroll",r),u!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r))}),t.onUnmounted(()=>{u==null||u.removeEventListener("scroll",r),u!==window&&window.removeEventListener("scroll",r),window.removeEventListener("resize",r)}),{arrowRef:a,overlayRef:n,updatePosition:r}}var _e="";const Ve=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:Ce,emits:["update:modelValue","positionChange"],setup(e,{slots:o,attrs:n,emit:a,expose:u}){const l=z("flexible-overlay"),{arrowRef:r,overlayRef:s,updatePosition:i}=xe(e,a);return u({updatePosition:i}),()=>{var f;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:s,class:l.b()},n),[(f=o.default)==null?void 0:f.call(o),e.showArrow&&t.createVNode("div",{ref:r,class:l.e("arrow")},null)])}}});function Ne(e){const o=t.computed(()=>{const a=new Map;return e.value.forEach(u=>{a.set(u,u.value)}),a});return{getOptionValue:a=>o.value.get(a)}}function ae(...e){const o=n=>n&&typeof n=="object";return e.reduce((n,a)=>(Object.keys(a).forEach(u=>{const l=n[u],r=a[u];Array.isArray(l)&&Array.isArray(r)?n[u]=Array.from(new Set([...r,...l])):o(l)&&o(r)?n[u]=ae(l,r):n[u]=r}),n),{})}var Se={pagination:{totalItemText:"\u6240\u6709\u6761\u76EE",goToText:"\u8DF3\u81F3"},accordion:{loading:"\u52A0\u8F7D\u4E2D",noData:"\u6CA1\u6709\u6570\u636E"},autoCompleteDropdown:{latestInput:"\u6700\u8FD1\u8F93\u5165"},cascaderList:{noData:"\u6CA1\u6709\u6570\u636E"},colorPicker:{foundationPanel:"\u57FA\u7840\u9762\u677F",advancedPanel:"\u9AD8\u7EA7\u9762\u677F"},datePickerPro:{ok:"\u786E\u5B9A",placeholder:"\u8BF7\u9009\u62E9\u65E5\u671F",month1:"1\u6708",month2:"2\u6708",month3:"3\u6708",month4:"4\u6708",month5:"5\u6708",month6:"6\u6708",month7:"7\u6708",month8:"8\u6708",month9:"9\u6708",month10:"10\u6708",month11:"11\u6708",month12:"12\u6708",year:"\u5E74",startPlaceholder:"\u8BF7\u9009\u62E9\u5F00\u59CB\u65E5\u671F",endPlaceholder:"\u8BF7\u9009\u62E9\u7ED3\u675F\u65E5\u671F",getWeekDays(){return["\u65E5","\u4E00","\u4E8C","\u4E09","\u56DB","\u4E94","\u516D"]},getTimeArr(){return["\u65F6","\u5206","\u79D2"]},getYearMonthStr(e,o){return`${e}\u5E74${o}\u6708`}},editableSelect:{noRelatedRecords:"\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",noData:"\u6CA1\u6709\u6570\u636E"},input:{placeholder:"\u8BF7\u8F93\u5165"},splitterBar:{collapse:"\u6536\u8D77",expand:"\u5C55\u5F00"},stepsGuide:{previous:"\u4E0A\u4E00\u6B65",continue:"\u6211\u77E5\u9053\u5566\uFF0C\u7EE7\u7EED",ok:"\u6211\u77E5\u9053\u5566"},table:{selectAll:"\u5168\u9009",ok:"\u786E\u5B9A"},timePopup:{ok:"\u786E\u5B9A"},transfer:{unit:"\u9879",panelUnit:"\u9879",headerUnit:"\u9879",noData:"\u6682\u65E0\u6570\u636E",placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u8BCD\u641C\u7D22"},tree:{loading:"\u52A0\u8F7D\u4E2D",newNode:"\u65B0\u8282\u70B9",selectPlaceholder:"\u8BF7\u9009\u62E9"},upload:{placeholder:"\u9009\u62E9\u6587\u4EF6",getExistSameNameFilesMsg(e){return`\u60A8\u4E0A\u4F20\u7684 "${e}" \u5B58\u5728\u91CD\u540D\u6587\u4EF6, \u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`},getAllFilesBeyondMaximalFileSizeMsg(e){return`\u6700\u5927\u652F\u6301\u4E0A\u4F20${e}MB\u7684\u6587\u4EF6, \u60A8\u672C\u6B21\u4E0A\u4F20\u7684\u6240\u6709\u6587\u4EF6\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`},getBeyondMaximalFileSizeMsg(e,o){return`\u6700\u5927\u652F\u6301\u4E0A\u4F20${o}MB\u7684\u6587\u4EF6, \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${e}"\u8D85\u8FC7\u53EF\u4E0A\u4F20\u6587\u4EF6\u5927\u5C0F`},getNotAllowedFileTypeMsg(e,o){return`\u652F\u6301\u7684\u6587\u4EF6\u7C7B\u578B: "${o}", \u60A8\u4E0A\u4F20\u7684\u6587\u4EF6"${e}"\u4E0D\u5728\u5141\u8BB8\u8303\u56F4\u5185\uFF0C\u8BF7\u91CD\u65B0\u9009\u62E9\u6587\u4EF6`}},search:{placeholder:"\u8BF7\u8F93\u5165\u5173\u952E\u5B57"},select:{placeholder:"\u8BF7\u9009\u62E9",noDataText:"\u65E0\u6570\u636E",noMatchText:"\u627E\u4E0D\u5230\u76F8\u5173\u8BB0\u5F55",loadingText:"\u52A0\u8F7D\u4E2D..."},tagInput:{maxTagsText:"\u5DF2\u8FBE\u5230\u6700\u5927\u4E2A\u6570\uFF1A"},timeSelect:{placeholder:"\u8BF7\u9009\u62E9\u65F6\u95F4"}};const T=t.ref("zh-CN");let H=t.reactive({[T.value]:Se});const Le={messages(){return H[T.value]},lang(){return T.value},use(e,o){T.value=e,this.add({[e]:o})},add(e={}){H=ae(H,e)}},Oe=e=>e.substring(1).replace(/^\S/,o=>o.toLocaleLowerCase());function le(e,o){const n=o.split(".");let a=e;return n.forEach(u=>{var l;a=(l=a[u])!=null?l:""}),a}function ke(e,o,n){const a=n||Oe(e)+".";return u=>{var s;const l=((s=o==null?void 0:o.appContext.config.globalProperties.langMessages)==null?void 0:s.value)||Le.messages();return le(l,a+u)||le(l,u)}}var K=t.defineComponent({name:"DEditableSelect",directives:{clickOutside:ce,dLoading:Ee},props:q,emits:["update:modelValue","search","loadMore"],setup(e,o){const n=t.getCurrentInstance(),a=ke("DEditableSelect",n),u=z("editable-select"),l=t.ref(),r=t.ref(),s=t.ref(["bottom"]),i=t.ref(!1),f=t.ref(e.modelValue),y=t.ref(),p=t.ref(e.loading),{normalizeOptions:C}=ye(e),B=e.searchFn||((h,F)=>h.label.toLocaleLowerCase().includes(F.trim().toLocaleLowerCase())),{filteredOptions:v}=Fe(e.enableLazyLoad,C,f,B),{getOptionValue:x}=Ne(v),V=t.computed(()=>{let h;return e.enableLazyLoad?h=a("noData"):h=a("noRelatedRecords"),h});t.watch(()=>e.loading,h=>{p.value=h});const D=()=>{i.value=!i.value},N=()=>{i.value=!1},{loadMore:g}=ve(l,e.enableLazyLoad,o),{handleInput:w}=be(f,o),m=(h,F,E)=>{const{disabledKey:k}=e;if(k&&!!h[k])return;f.value=h.label,y.value=h.label,E.value=F;const U=x(h);o.emit("update:modelValue",U+""),N()},O=()=>{f.value=""},{handleKeydown:M,hoverIndex:Te,selectedIndex:_}=Ae(l,i,f,y,v,e.disabledKey,e.filterOption,p,(h,F)=>m(h,F,_),N,D),Me=(h,F)=>{const{disabledKey:E}=e;return j("devui-dropdown-item",{disabled:E?!!h[E]:!1,selected:F===_.value,[`${u.em("dropdown","bg")}`]:F===Te.value})};return()=>{const h=j(`${u.b()} devui-form-group devui-has-feedback ${f.value&&e.allowClear&&"allow-clear"}`,{[`${u.m("open")}`]:i.value===!0}),F=j("devui-form-control devui-dropdown-origin",{"devui-dropdown-origin-open":i.value===!0});return t.withDirectives(t.createVNode("div",{class:h,ref:r,style:{width:e.width+"px"}},[t.createVNode("input",{class:F,onClick:t.withModifiers(D,["self"]),onInput:w,onKeydown:M,value:f.value,disabled:e.disabled,placeholder:e.placeholder,type:"text"},null),t.createVNode("span",{class:"devui-form-control-feedback"},[t.createVNode("span",{class:"devui-select-clear-icon",onClick:O},[t.createVNode(t.resolveComponent("d-icon"),{name:"icon-remove"},null)]),t.createVNode("span",{class:"devui-select-chevron-icon"},[t.createVNode(t.resolveComponent("d-icon"),{name:"select-arrow"},null)])]),t.createVNode(t.Teleport,{to:"body"},{default:()=>[t.createVNode(t.Transition,{name:"fade"},{default:()=>[t.createVNode(Ve,{origin:r.value,modelValue:i.value,"onUpdate:modelValue":E=>i.value=E,position:s.value},{default:()=>[t.createVNode("div",{style:{width:e.width+"px"},class:`${u.e("menu")}`},[t.withDirectives(t.createVNode("div",{class:"devui-dropdown-menu"},[t.createVNode("ul",{ref:l,class:`${u.em("list","unstyled")} devui-scrollbar scroll-height`,style:{maxHeight:e.maxHeight+"px"},onScroll:g},[v.value.map((E,k)=>t.createVNode("li",{class:Me(E,k),onClick:U=>{U.stopPropagation(),m(E,k,_)}},[o.slots.item?o.slots.item(E):E.label])),t.withDirectives(t.createVNode("div",{class:"devui-no-data-tip"},[o.slots.noResultItem?o.slots.noResultItem(f.value):V.value]),[[t.vShow,!v.value.length]])])]),[[t.vShow,i.value],[t.resolveDirective("d-loading"),e.loading]])])]})]})]})]),[[t.resolveDirective("click-outside"),N]])}}}),Ie={title:"EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.component(K.name,K)}};c.EditableSelect=K,c.default=Ie,c.editableSelectProps=q,Object.defineProperty(c,"__esModule",{value:!0}),c[Symbol.toStringTag]="Module"});
|