vue-devui 1.0.0 → 1.1.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 +36 -5
- package/alert/style.css +1 -1
- package/auto-complete/index.es.js +27 -16
- package/auto-complete/index.umd.js +11 -11
- package/auto-complete/style.css +1 -1
- package/button/index.es.js +7 -6
- package/button/index.umd.js +5 -5
- package/button/style.css +1 -1
- package/card/style.css +1 -1
- package/checkbox/index.es.js +19 -14
- package/checkbox/index.umd.js +8 -8
- package/checkbox/style.css +1 -1
- package/date-picker-pro/index.es.js +138 -133
- package/date-picker-pro/index.umd.js +13 -13
- package/date-picker-pro/style.css +1 -1
- package/drawer/index.es.js +22 -5
- package/drawer/index.umd.js +1 -1
- package/drawer/style.css +1 -1
- package/dropdown/index.es.js +16 -3
- package/dropdown/index.umd.js +1 -1
- package/dropdown/style.css +1 -1
- package/editable-select/index.es.js +67 -62
- package/editable-select/index.umd.js +1 -1
- package/editable-select/style.css +1 -1
- package/form/index.es.js +14 -8
- package/form/index.umd.js +5 -5
- package/form/style.css +1 -1
- package/icon/index.es.js +2 -1
- 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 +22 -11
- package/input/index.umd.js +4 -4
- package/input/style.css +1 -1
- package/input-number/index.es.js +26 -23
- package/input-number/index.umd.js +1 -1
- package/input-number/style.css +1 -1
- package/loading/index.es.js +51 -51
- package/loading/index.umd.js +1 -1
- package/mention/index.es.js +33 -17
- package/mention/index.umd.js +10 -10
- package/mention/style.css +1 -1
- package/message/index.es.js +2 -1
- package/message/index.umd.js +1 -1
- package/message/style.css +1 -1
- package/modal/index.es.js +158 -43
- package/modal/index.umd.js +1 -1
- package/modal/style.css +1 -1
- package/notification/index.es.js +7 -9
- package/notification/index.umd.js +1 -1
- package/notification/style.css +1 -1
- package/nuxt/components/paginationInjectionKey.js +3 -0
- package/overlay/index.es.js +12 -2
- package/overlay/index.umd.js +1 -1
- package/overlay/style.css +1 -1
- package/package.json +2 -2
- package/pagination/index.es.js +10160 -278
- 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/popover/index.es.js +13 -5
- package/popover/index.umd.js +9 -9
- package/popover/style.css +1 -1
- package/radio/index.es.js +14 -8
- package/radio/index.umd.js +4 -4
- package/radio/style.css +1 -1
- package/result/index.es.js +2 -1
- package/result/index.umd.js +1 -1
- package/result/style.css +1 -1
- package/search/index.es.js +23 -12
- package/search/index.umd.js +4 -4
- package/search/style.css +1 -1
- package/select/index.es.js +134 -113
- package/select/index.umd.js +10 -10
- package/select/style.css +1 -1
- package/skeleton/style.css +1 -1
- package/splitter/index.es.js +30 -7
- package/splitter/index.umd.js +16 -16
- package/splitter/style.css +1 -1
- package/status/index.es.js +4 -0
- package/status/index.umd.js +1 -1
- package/steps/index.es.js +2 -1
- package/steps/index.umd.js +1 -1
- package/steps/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +14 -8
- package/switch/index.umd.js +13 -13
- package/switch/style.css +1 -1
- package/table/index.es.js +159 -66
- package/table/index.umd.js +7 -7
- package/table/style.css +1 -1
- package/tabs/index.es.js +95 -44
- package/tabs/index.umd.js +1 -1
- package/tabs/style.css +1 -1
- package/tag/index.es.js +1 -1
- package/tag/index.umd.js +1 -1
- package/tag/style.css +1 -1
- package/textarea/index.es.js +17 -9
- package/textarea/index.umd.js +13 -13
- package/textarea/style.css +1 -1
- package/time-picker/index.es.js +154 -151
- package/time-picker/index.umd.js +14 -14
- package/time-picker/style.css +1 -1
- package/time-select/index.es.js +141 -117
- package/time-select/index.umd.js +13 -13
- package/time-select/style.css +1 -1
- package/timeline/index.es.js +2 -1
- package/timeline/index.umd.js +1 -1
- package/timeline/style.css +1 -1
- package/tooltip/index.es.js +28 -6
- package/tooltip/index.umd.js +7 -7
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +47 -38
- package/tree/index.umd.js +7 -7
- package/tree/style.css +1 -1
- package/upload/index.es.js +9 -10
- package/upload/index.umd.js +1 -1
- package/upload/style.css +1 -1
- package/vue-devui.es.js +3496 -3121
- package/vue-devui.umd.js +21 -21
- package/alert/index.d.ts +0 -7
- package/auto-complete/index.d.ts +0 -7
- package/avatar/index.d.ts +0 -7
- package/badge/index.d.ts +0 -7
- package/button/index.d.ts +0 -7
- package/card/index.d.ts +0 -7
- package/checkbox/index.d.ts +0 -7
- package/collapse/index.d.ts +0 -7
- package/countdown/index.d.ts +0 -7
- package/date-picker-pro/index.d.ts +0 -7
- package/drawer/index.d.ts +0 -7
- package/dropdown/index.d.ts +0 -7
- package/editable-select/index.d.ts +0 -7
- package/form/index.d.ts +0 -7
- package/fullscreen/index.d.ts +0 -7
- package/grid/index.d.ts +0 -7
- package/icon/index.d.ts +0 -7
- package/image-preview/index.d.ts +0 -7
- package/index.d.ts +0 -7
- package/input/index.d.ts +0 -7
- package/input-number/index.d.ts +0 -7
- package/layout/index.d.ts +0 -7
- package/loading/index.d.ts +0 -7
- package/mention/index.d.ts +0 -7
- package/menu/index.d.ts +0 -7
- package/message/index.d.ts +0 -7
- package/modal/index.d.ts +0 -7
- package/notification/index.d.ts +0 -7
- package/nuxt/components/Loading.js +0 -3
- package/overlay/index.d.ts +0 -7
- package/pagination/index.d.ts +0 -7
- package/panel/index.d.ts +0 -7
- package/popover/index.d.ts +0 -7
- package/progress/index.d.ts +0 -7
- package/radio/index.d.ts +0 -7
- package/rate/index.d.ts +0 -7
- package/result/index.d.ts +0 -7
- package/ripple/index.d.ts +0 -7
- package/search/index.d.ts +0 -7
- package/select/index.d.ts +0 -7
- package/skeleton/index.d.ts +0 -7
- package/slider/index.d.ts +0 -7
- package/splitter/index.d.ts +0 -7
- package/statistic/index.d.ts +0 -7
- package/status/index.d.ts +0 -7
- package/steps/index.d.ts +0 -7
- package/switch/index.d.ts +0 -7
- package/table/index.d.ts +0 -7
- package/tabs/index.d.ts +0 -7
- package/tag/index.d.ts +0 -7
- package/textarea/index.d.ts +0 -7
- package/time-picker/index.d.ts +0 -7
- package/time-select/index.d.ts +0 -7
- package/timeline/index.d.ts +0 -7
- package/tooltip/index.d.ts +0 -7
- package/tree/index.d.ts +0 -7
- package/upload/index.d.ts +0 -7
|
@@ -21,7 +21,7 @@ var __publicField = (obj, key, value) => {
|
|
|
21
21
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
22
22
|
return value;
|
|
23
23
|
};
|
|
24
|
-
import { defineComponent, ref, createVNode, h, render, computed, nextTick, unref, watch, onUnmounted, mergeProps, reactive, getCurrentInstance, withDirectives,
|
|
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
25
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
26
26
|
const editableSelectProps = {
|
|
27
27
|
modelValue: {
|
|
@@ -62,9 +62,6 @@ const editableSelectProps = {
|
|
|
62
62
|
},
|
|
63
63
|
searchFn: {
|
|
64
64
|
type: Function
|
|
65
|
-
},
|
|
66
|
-
filterOption: {
|
|
67
|
-
type: [Function, Boolean]
|
|
68
65
|
}
|
|
69
66
|
};
|
|
70
67
|
const inBrowser = typeof window !== "undefined";
|
|
@@ -177,7 +174,7 @@ function useNamespace(block, needDot = false) {
|
|
|
177
174
|
}
|
|
178
175
|
var loading = "";
|
|
179
176
|
var Loading = defineComponent({
|
|
180
|
-
name: "
|
|
177
|
+
name: "Loading",
|
|
181
178
|
inheritAttrs: false,
|
|
182
179
|
props: loadingProps,
|
|
183
180
|
setup(props) {
|
|
@@ -330,12 +327,12 @@ const handleProps = (el, vprops) => {
|
|
|
330
327
|
const props = __spreadValues(__spreadValues({}, new LoadingOptions()), vprops);
|
|
331
328
|
const loadingTemplateRef = props.loadingTemplateRef;
|
|
332
329
|
const loadingInstance = createComponent(loadingConstructor, __spreadValues({}, props), loadingTemplateRef ? () => loadingTemplateRef : null);
|
|
333
|
-
el.style.position = props.positionType;
|
|
330
|
+
el.style.position = props.positionType || "relative";
|
|
334
331
|
el.options = props;
|
|
335
332
|
el.instance = loadingInstance;
|
|
336
333
|
el.mask = (_a = loadingInstance == null ? void 0 : loadingInstance.proxy) == null ? void 0 : _a.$el;
|
|
337
334
|
};
|
|
338
|
-
const
|
|
335
|
+
const LoadingDirective = {
|
|
339
336
|
mounted: function(el, binding, vnode) {
|
|
340
337
|
handleProps(el, vnode.props);
|
|
341
338
|
removeAttribute(el);
|
|
@@ -410,17 +407,18 @@ function useLazyLoad(dropdownRef, enableLazyLoad, ctx2) {
|
|
|
410
407
|
if (!enableLazyLoad) {
|
|
411
408
|
return;
|
|
412
409
|
}
|
|
413
|
-
if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight) {
|
|
410
|
+
if (dropdownVal.clientHeight + dropdownVal.scrollTop >= dropdownVal.scrollHeight - 12) {
|
|
414
411
|
ctx2.emit("loadMore");
|
|
415
412
|
}
|
|
416
413
|
};
|
|
417
414
|
return { loadMore };
|
|
418
415
|
}
|
|
419
|
-
function useKeyboardSelect(dropdownRef,
|
|
420
|
-
const
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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);
|
|
424
422
|
};
|
|
425
423
|
const scrollToItem = (index2) => {
|
|
426
424
|
const ul = dropdownRef.value;
|
|
@@ -437,52 +435,43 @@ function useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filtere
|
|
|
437
435
|
}
|
|
438
436
|
});
|
|
439
437
|
};
|
|
440
|
-
const
|
|
441
|
-
|
|
442
|
-
closeMenu();
|
|
443
|
-
};
|
|
444
|
-
const handleEnter = () => {
|
|
445
|
-
const len = filteredOptions.value.length;
|
|
446
|
-
if (!visible.value || !len) {
|
|
447
|
-
return toggleMenu();
|
|
448
|
-
}
|
|
449
|
-
len && len === 1 ? handleClick(filteredOptions.value[0], 1) : handleClick(filteredOptions.value[hoverIndex.value], hoverIndex.value);
|
|
450
|
-
return closeMenu();
|
|
438
|
+
const updateIndex = (index2) => {
|
|
439
|
+
hoverIndex.value = index2;
|
|
451
440
|
};
|
|
452
|
-
const handleKeyboardNavigation = (direction) => {
|
|
441
|
+
const handleKeyboardNavigation = (direction, index2 = hoverIndex.value) => {
|
|
453
442
|
const len = filteredOptions.value.length;
|
|
454
|
-
if (
|
|
443
|
+
if (len === 0) {
|
|
455
444
|
return;
|
|
456
445
|
}
|
|
457
|
-
if (!["
|
|
446
|
+
if (!["ArrowUp", "ArrowDown"].includes(direction)) {
|
|
458
447
|
return;
|
|
459
448
|
}
|
|
460
|
-
if (filterOption === false && loading2.value) {
|
|
461
|
-
return;
|
|
462
|
-
}
|
|
463
|
-
let newIndex = 0;
|
|
464
|
-
newIndex = hoverIndex.value;
|
|
465
449
|
if (direction === "ArrowUp") {
|
|
466
|
-
|
|
467
|
-
if (
|
|
468
|
-
|
|
450
|
+
index2 -= 1;
|
|
451
|
+
if (index2 === -1) {
|
|
452
|
+
index2 = len - 1;
|
|
469
453
|
}
|
|
470
454
|
} else if (direction === "ArrowDown") {
|
|
471
|
-
|
|
472
|
-
if (
|
|
473
|
-
|
|
455
|
+
index2 += 1;
|
|
456
|
+
if (index2 === len) {
|
|
457
|
+
index2 = 0;
|
|
474
458
|
}
|
|
475
459
|
}
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
return handleKeyboardNavigation(direction);
|
|
460
|
+
const option = filteredOptions.value[index2];
|
|
461
|
+
if (option[disabledKey]) {
|
|
462
|
+
return handleKeyboardNavigation(direction, index2);
|
|
480
463
|
}
|
|
481
|
-
|
|
482
|
-
scrollToItem(
|
|
464
|
+
updateIndex(index2);
|
|
465
|
+
scrollToItem(index2);
|
|
483
466
|
};
|
|
484
467
|
const handleKeydown = (event) => {
|
|
485
468
|
const keyCode = event.key || event.code;
|
|
469
|
+
if (loading2.value) {
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
if (!visible.value) {
|
|
473
|
+
return toggleMenu();
|
|
474
|
+
}
|
|
486
475
|
switch (keyCode) {
|
|
487
476
|
case "Escape":
|
|
488
477
|
handleEscape();
|
|
@@ -494,7 +483,9 @@ function useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filtere
|
|
|
494
483
|
handleKeyboardNavigation(keyCode);
|
|
495
484
|
}
|
|
496
485
|
};
|
|
497
|
-
return {
|
|
486
|
+
return {
|
|
487
|
+
handleKeydown
|
|
488
|
+
};
|
|
498
489
|
}
|
|
499
490
|
const flexibleOverlayProps = {
|
|
500
491
|
modelValue: {
|
|
@@ -527,6 +518,10 @@ const flexibleOverlayProps = {
|
|
|
527
518
|
isArrowCenter: {
|
|
528
519
|
type: Boolean,
|
|
529
520
|
default: true
|
|
521
|
+
},
|
|
522
|
+
clickEventBubble: {
|
|
523
|
+
type: Boolean,
|
|
524
|
+
default: false
|
|
530
525
|
}
|
|
531
526
|
};
|
|
532
527
|
function getScrollParent(element) {
|
|
@@ -641,6 +636,9 @@ const FlexibleOverlay = defineComponent({
|
|
|
641
636
|
expose
|
|
642
637
|
}) {
|
|
643
638
|
const ns = useNamespace("flexible-overlay");
|
|
639
|
+
const {
|
|
640
|
+
clickEventBubble
|
|
641
|
+
} = toRefs(props);
|
|
644
642
|
const {
|
|
645
643
|
arrowRef,
|
|
646
644
|
overlayRef,
|
|
@@ -654,7 +652,10 @@ const FlexibleOverlay = defineComponent({
|
|
|
654
652
|
return props.modelValue && createVNode("div", mergeProps({
|
|
655
653
|
"ref": overlayRef,
|
|
656
654
|
"class": ns.b()
|
|
657
|
-
}, attrs
|
|
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", {
|
|
658
659
|
"ref": arrowRef,
|
|
659
660
|
"class": ns.e("arrow")
|
|
660
661
|
}, null)]);
|
|
@@ -694,7 +695,8 @@ function deepAssign(...objects) {
|
|
|
694
695
|
var zhCN = {
|
|
695
696
|
pagination: {
|
|
696
697
|
totalItemText: "\u6240\u6709\u6761\u76EE",
|
|
697
|
-
goToText: "\u8DF3\u81F3"
|
|
698
|
+
goToText: "\u8DF3\u81F3",
|
|
699
|
+
perPage: "\u6761/\u9875"
|
|
698
700
|
},
|
|
699
701
|
accordion: {
|
|
700
702
|
loading: "\u52A0\u8F7D\u4E2D",
|
|
@@ -845,8 +847,8 @@ function createI18nTranslate(name, app, newPrefix) {
|
|
|
845
847
|
var EditableSelect = defineComponent({
|
|
846
848
|
name: "DEditableSelect",
|
|
847
849
|
directives: {
|
|
848
|
-
|
|
849
|
-
|
|
850
|
+
ClickOutside: clickoutsideDirective,
|
|
851
|
+
Loading: LoadingDirective
|
|
850
852
|
},
|
|
851
853
|
props: editableSelectProps,
|
|
852
854
|
emits: ["update:modelValue", "search", "loadMore"],
|
|
@@ -856,10 +858,11 @@ var EditableSelect = defineComponent({
|
|
|
856
858
|
const ns = useNamespace("editable-select");
|
|
857
859
|
const dropdownRef = ref();
|
|
858
860
|
const origin = ref();
|
|
861
|
+
const hoverIndex = ref(0);
|
|
862
|
+
const selectedIndex = ref(0);
|
|
859
863
|
const position = ref(["bottom"]);
|
|
860
864
|
const visible = ref(false);
|
|
861
865
|
const inputValue = ref(props.modelValue);
|
|
862
|
-
const cacheInput = ref();
|
|
863
866
|
const loading2 = ref(props.loading);
|
|
864
867
|
const {
|
|
865
868
|
normalizeOptions
|
|
@@ -895,7 +898,7 @@ var EditableSelect = defineComponent({
|
|
|
895
898
|
const {
|
|
896
899
|
handleInput
|
|
897
900
|
} = useInput(inputValue, ctx2);
|
|
898
|
-
const handleClick = (option, index2
|
|
901
|
+
const handleClick = (option, index2) => {
|
|
899
902
|
const {
|
|
900
903
|
disabledKey
|
|
901
904
|
} = props;
|
|
@@ -903,27 +906,26 @@ var EditableSelect = defineComponent({
|
|
|
903
906
|
return;
|
|
904
907
|
}
|
|
905
908
|
inputValue.value = option.label;
|
|
906
|
-
|
|
907
|
-
|
|
909
|
+
hoverIndex.value = selectedIndex.value;
|
|
910
|
+
selectedIndex.value = index2;
|
|
908
911
|
const value = getOptionValue(option);
|
|
909
912
|
ctx2.emit("update:modelValue", value + "");
|
|
910
913
|
closeMenu();
|
|
911
914
|
};
|
|
915
|
+
const {
|
|
916
|
+
handleKeydown
|
|
917
|
+
} = useKeyboardSelect(dropdownRef, hoverIndex, filteredOptions, props.disabledKey, visible, loading2, handleClick, toggleMenu, closeMenu);
|
|
912
918
|
const handleClear = () => {
|
|
913
919
|
inputValue.value = "";
|
|
920
|
+
ctx2.emit("update:modelValue", "");
|
|
914
921
|
};
|
|
915
|
-
const {
|
|
916
|
-
handleKeydown,
|
|
917
|
-
hoverIndex,
|
|
918
|
-
selectedIndex
|
|
919
|
-
} = useKeyboardSelect(dropdownRef, visible, inputValue, cacheInput, filteredOptions, props.disabledKey, props.filterOption, loading2, (option, index2) => handleClick(option, index2, selectedIndex), closeMenu, toggleMenu);
|
|
920
922
|
const getItemCls = (option, index2) => {
|
|
921
923
|
const {
|
|
922
924
|
disabledKey
|
|
923
925
|
} = props;
|
|
924
926
|
return className(`devui-dropdown-item`, {
|
|
925
927
|
disabled: disabledKey ? !!option[disabledKey] : false,
|
|
926
|
-
selected: index2 === selectedIndex.value,
|
|
928
|
+
selected: filteredOptions.value.length === 1 || index2 === selectedIndex.value,
|
|
927
929
|
[`${ns.em("dropdown", "bg")}`]: index2 === hoverIndex.value
|
|
928
930
|
});
|
|
929
931
|
};
|
|
@@ -970,7 +972,10 @@ var EditableSelect = defineComponent({
|
|
|
970
972
|
"origin": origin.value,
|
|
971
973
|
"modelValue": visible.value,
|
|
972
974
|
"onUpdate:modelValue": ($event) => visible.value = $event,
|
|
973
|
-
"position": position.value
|
|
975
|
+
"position": position.value,
|
|
976
|
+
"style": {
|
|
977
|
+
zIndex: "var(--devui-z-index-dropdown, 1052)"
|
|
978
|
+
}
|
|
974
979
|
}, {
|
|
975
980
|
default: () => [createVNode("div", {
|
|
976
981
|
"style": {
|
|
@@ -991,12 +996,12 @@ var EditableSelect = defineComponent({
|
|
|
991
996
|
"class": getItemCls(option, index2),
|
|
992
997
|
"onClick": (e) => {
|
|
993
998
|
e.stopPropagation();
|
|
994
|
-
handleClick(option, index2
|
|
999
|
+
handleClick(option, index2);
|
|
995
1000
|
}
|
|
996
1001
|
}, [ctx2.slots.item ? ctx2.slots.item(option) : option.label]);
|
|
997
1002
|
}), withDirectives(createVNode("div", {
|
|
998
1003
|
"class": "devui-no-data-tip"
|
|
999
|
-
}, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem(inputValue.value) : emptyText.value]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value], [resolveDirective("
|
|
1004
|
+
}, [ctx2.slots.noResultItem ? ctx2.slots.noResultItem(inputValue.value) : emptyText.value]), [[vShow, !filteredOptions.value.length]])])]), [[vShow, visible.value], [resolveDirective("loading"), props.loading]])])]
|
|
1000
1005
|
})]
|
|
1001
1006
|
})]
|
|
1002
1007
|
})]), [[resolveDirective("click-outside"), closeMenu]]);
|
|
@@ -1 +1 @@
|
|
|
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"});
|
|
1
|
+
var Pe=Object.defineProperty,Ie=Object.defineProperties;var ze=Object.getOwnPropertyDescriptors;var ne=Object.getOwnPropertySymbols;var $e=Object.prototype.hasOwnProperty,Re=Object.prototype.propertyIsEnumerable;var R=(i,t,m)=>t in i?Pe(i,t,{enumerable:!0,configurable:!0,writable:!0,value:m}):i[t]=m,D=(i,t)=>{for(var m in t||(t={}))$e.call(t,m)&&R(i,m,t[m]);if(ne)for(var m of ne(t))Re.call(t,m)&&R(i,m,t[m]);return i},oe=(i,t)=>Ie(i,ze(t));var b=(i,t,m)=>(R(i,typeof t!="symbol"?t+"":t,m),m);(function(i,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):(i=typeof globalThis!="undefined"?globalThis:i||self,t(i.index={},i.Vue,i.dom))})(this,function(i,t,m){"use strict";const j={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}},ue=typeof window!="undefined";function K(e,o,n){document.addEventListener?e&&o&&n&&e.addEventListener(o,n,!1):e&&o&&n&&e.attachEvent("on"+o,n)}const C=Symbol("@@clickoutside"),k=new Map;let H,M=0,_=!0;function U(e,o,n){return ue&&_&&(_=!1,K(document,"mousedown",a=>{H=a}),K(document,"mouseup",a=>{for(const[u,l]of k)l[C].documentHandler(a,H)})),function(a,u){!n||!o.instance||!a.target||!u.target||e.contains(a.target)||e.contains(u.target)||e===a.target||e[C].bindingFn&&e[C].bindingFn()}}const ae={beforeMount:function(e,o,n){M++,k.set(M,e),e[C]={nid:M,documentHandler:U(e,o,n),bindingFn:o.value}},updated:function(e,o,n){e[C].documentHandler=U(e,o,n),e[C].bindingFn=o.value},unmounted:function(e){k.delete(e[C].nid),delete e[C]}};class Y{constructor(){b(this,"top","50%");b(this,"left","50%")}}const le={message:String,backdrop:Boolean,view:{type:Object,default:()=>new Y},zIndex:Number,isFull:{type:Boolean,default:!1}};class re{constructor(){b(this,"target");b(this,"message");b(this,"loadingTemplateRef");b(this,"backdrop",!0);b(this,"positionType","relative");b(this,"view",new Y);b(this,"zIndex")}}function L(e,o,n){let a=e;return o&&(a+=`__${o}`),n&&(a+=`--${n}`),a}function T(e,o=!1){const n=o?`.devui-${e}`:`devui-${e}`;return{b:()=>L(n),e:s=>s?L(n,s):"",m:s=>s?L(n,"",s):"",em:(s,p)=>s&&p?L(n,s,p):""}}var je="",se=t.defineComponent({name:"Loading",inheritAttrs:!1,props:le,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=T("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 q=Symbol("dev_component_container");function ie(e,o,n=null){const a=t.h(e,D({},o),n),u=document.createElement("div");return a[q]=u,t.render(a,u),a.component}function ce(e){t.render(null,e==null?void 0:e.vnode[q])}const de=t.defineComponent(se),N=new WeakSet,P=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},X=e=>Object.prototype.toString.call(e).slice(8,-1).toLowerCase(),fe=e=>{switch(X(e)){case"promise":return[e];case"array":return e.some(n=>X(n)!=="promise")?(console.error(new TypeError("Binding values should all be of type Promise")),"error"):e;default:return!1}},W=e=>{N.delete(e),e.instance.proxy.close(),ce(e.instance)},G=(e,o)=>{var n,a,u;if(o.value){const l=fe(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),N.add(e),l&&Promise.all(l).catch(r=>{console.error(new Error("Promise handling errors"),r)}).finally(()=>{W(e)})}else W(e)},J=e=>{e.removeAttribute("zindex"),e.removeAttribute("positiontype"),e.removeAttribute("backdrop"),e.removeAttribute("message"),e.removeAttribute("view"),e.removeAttribute("loadingtemplateref")},Q=(e,o)=>{var l;const n=D(D({},new re),o),a=n.loadingTemplateRef,u=ie(de,D({},n),a?()=>a:null);e.style.position=n.positionType||"relative",e.options=n,e.instance=u,e.mask=(l=u==null?void 0:u.proxy)==null?void 0:l.$el},me={mounted:function(e,o,n){Q(e,n.props),J(e),!P(o.value)&&G(e,o)},updated:function(e,o,n){!P(o.value)&&N.has(e)||P(o.value)&&!N.has(e)||(!N.has(e)&&Q(e,n.props),J(e),G(e,o))}};function I(e,o){let n=e;return typeof o=="object"&&Object.keys(o).forEach(a=>{o[a]&&(n+=` ${a}`)}),n}var Ke="";function pe(e){return{normalizeOptions:t.computed(()=>e.options.map(n=>{let a;return n!=="null"&&typeof n=="object"?a=oe(D({},n),{label:n.label||"",value:n.value!==void 0?n.value:n.label||""}):a={label:String(n),value:n},a}))}}function he(e,o,n,a){return{filteredOptions:t.computed(()=>!n.value||e?o.value:o.value.filter(l=>a(l,n.value)))}}function ge(e,o){const n=u=>{o.emit("search",u)};return{handleInput:u=>{const l=u.target.value;e.value=l,n(l)}}}function we(e,o,n){return{loadMore:()=>{const u=e.value;!o||u.clientHeight+u.scrollTop>=u.scrollHeight-12&&n.emit("loadMore")}}}function Ee(e,o,n,a,u,l,r,s,p){const y=()=>{p()},f=()=>{r(n.value[o.value],o.value)},g=d=>{const c=e.value,w=c.children[d];t.nextTick(()=>{if(w.scrollIntoViewIfNeeded)w.scrollIntoViewIfNeeded(!1);else{const A=c.getBoundingClientRect(),V=w.getBoundingClientRect();(V.bottom>A.bottom||V.top<A.top)&&w.scrollIntoView(!1)}})},F=d=>{o.value=d},v=(d,c=o.value)=>{const w=n.value.length;if(w===0||!["ArrowUp","ArrowDown"].includes(d))return;if(d==="ArrowUp"?(c-=1,c===-1&&(c=w-1)):d==="ArrowDown"&&(c+=1,c===w&&(c=0)),n.value[c][a])return v(d,c);F(c),g(c)};return{handleKeydown:d=>{const c=d.key||d.code;if(!l.value){if(!u.value)return s();switch(c){case"Escape":y();break;case"Enter":f();break;default:v(c)}}}}}const ye={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},clickEventBubble:{type:Boolean,default:!1}};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 Fe(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 ve(e,o){const n=t.ref(),a=t.ref();let u=null;const l=(s,p,y,f)=>{const{x:g,y:F}=Fe(e.isArrowCenter,y,p,f.getBoundingClientRect()),v={top:"bottom",right:"left",bottom:"top",left:"right"}[p.split("-")[0]];Object.assign(s.style,{left:g?`${g}px`:"",top:F?`${F}px`:"",right:"",bottom:"",[v]:"-4px"})},r=async()=>{const s=e.origin,p=t.unref(n.value),y=t.unref(a.value),f=[m.offset(e.offset),m.autoPlacement({alignment:e.align,allowedPlacements:e.position})];e.showArrow&&f.push(m.arrow({element:y})),e.shiftOffset!==void 0&&f.push(m.shift());const{x:g,y:F,placement:v,middlewareData:S}=await m.computePosition(s,p,{strategy:"fixed",middleware:f});let d=g,c=F;if(e.shiftOffset!==void 0){const{x:w,y:A}=S.shift;w<0&&(d-=e.shiftOffset),w>0&&(d+=e.shiftOffset),A<0&&(c-=e.shiftOffset),A>0&&(c+=e.shiftOffset)}o("positionChange",v),Object.assign(p.style,{top:`${c}px`,left:`${d}px`}),e.showArrow&&l(y,v,S.arrow,p)};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 He="";const Ae=t.defineComponent({name:"DFlexibleOverlay",inheritAttrs:!1,props:ye,emits:["update:modelValue","positionChange"],setup(e,{slots:o,attrs:n,emit:a,expose:u}){const l=T("flexible-overlay"),{clickEventBubble:r}=t.toRefs(e),{arrowRef:s,overlayRef:p,updatePosition:y}=ve(e,a);return u({updatePosition:y}),()=>{var f;return e.modelValue&&t.createVNode("div",t.mergeProps({ref:p,class:l.b()},n,{onClick:t.withModifiers(()=>({}),[r.value?"":"stop"]),onPointerup:t.withModifiers(()=>({}),["stop"])}),[(f=o.default)==null?void 0:f.call(o),e.showArrow&&t.createVNode("div",{ref:s,class:l.e("arrow")},null)])}}});function Ce(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 Z(...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]=Z(l,r):n[u]=r}),n),{})}var Be={pagination:{totalItemText:"\u6240\u6709\u6761\u76EE",goToText:"\u8DF3\u81F3",perPage:"\u6761/\u9875"},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 O=t.ref("zh-CN");let z=t.reactive({[O.value]:Be});const Ve={messages(){return z[O.value]},lang(){return O.value},use(e,o){O.value=e,this.add({[e]:o})},add(e={}){z=Z(z,e)}},De=e=>e.substring(1).replace(/^\S/,o=>o.toLocaleLowerCase());function ee(e,o){const n=o.split(".");let a=e;return n.forEach(u=>{var l;a=(l=a[u])!=null?l:""}),a}function Ne(e,o,n){const a=n||De(e)+".";return u=>{var s;const l=((s=o==null?void 0:o.appContext.config.globalProperties.langMessages)==null?void 0:s.value)||Ve.messages();return ee(l,a+u)||ee(l,u)}}var $=t.defineComponent({name:"DEditableSelect",directives:{ClickOutside:ae,Loading:me},props:j,emits:["update:modelValue","search","loadMore"],setup(e,o){const n=t.getCurrentInstance(),a=Ne("DEditableSelect",n),u=T("editable-select"),l=t.ref(),r=t.ref(),s=t.ref(0),p=t.ref(0),y=t.ref(["bottom"]),f=t.ref(!1),g=t.ref(e.modelValue),F=t.ref(e.loading),{normalizeOptions:v}=pe(e),S=e.searchFn||((h,B)=>h.label.toLocaleLowerCase().includes(B.trim().toLocaleLowerCase())),{filteredOptions:d}=he(e.enableLazyLoad,v,g,S),{getOptionValue:c}=Ce(d),w=t.computed(()=>{let h;return e.enableLazyLoad?h=a("noData"):h=a("noRelatedRecords"),h});t.watch(()=>e.loading,h=>{F.value=h});const A=()=>{f.value=!f.value},V=()=>{f.value=!1},{loadMore:Le}=we(l,e.enableLazyLoad,o),{handleInput:Oe}=ge(g,o),te=(h,B)=>{const{disabledKey:E}=e;if(E&&!!h[E])return;g.value=h.label,s.value=p.value,p.value=B;const x=c(h);o.emit("update:modelValue",x+""),V()},{handleKeydown:xe}=Ee(l,s,d,e.disabledKey,f,F,te,A,V),ke=()=>{g.value="",o.emit("update:modelValue","")},Me=(h,B)=>{const{disabledKey:E}=e;return I("devui-dropdown-item",{disabled:E?!!h[E]:!1,selected:d.value.length===1||B===p.value,[`${u.em("dropdown","bg")}`]:B===s.value})};return()=>{const h=I(`${u.b()} devui-form-group devui-has-feedback ${g.value&&e.allowClear&&"allow-clear"}`,{[`${u.m("open")}`]:f.value===!0}),B=I("devui-form-control devui-dropdown-origin",{"devui-dropdown-origin-open":f.value===!0});return t.withDirectives(t.createVNode("div",{class:h,ref:r,style:{width:e.width+"px"}},[t.createVNode("input",{class:B,onClick:t.withModifiers(A,["self"]),onInput:Oe,onKeydown:xe,value:g.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:ke},[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(Ae,{origin:r.value,modelValue:f.value,"onUpdate:modelValue":E=>f.value=E,position:y.value,style:{zIndex:"var(--devui-z-index-dropdown, 1052)"}},{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:Le},[d.value.map((E,x)=>t.createVNode("li",{class:Me(E,x),onClick:Te=>{Te.stopPropagation(),te(E,x)}},[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(g.value):w.value]),[[t.vShow,!d.value.length]])])]),[[t.vShow,f.value],[t.resolveDirective("loading"),e.loading]])])]})]})]})]),[[t.resolveDirective("click-outside"),V]])}}}),Se={title:"EditableSelect \u53EF\u8F93\u5165\u4E0B\u62C9\u9009\u62E9\u6846",category:"\u6570\u636E\u5F55\u5165",status:"100%",install(e){e.component($.name,$)}};i.EditableSelect=$,i.default=Se,i.editableSelectProps=j,Object.defineProperty(i,"__esModule",{value:!0}),i[Symbol.toStringTag]="Module"});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
@keyframes devui-busy-spinner-anim{0%{transform:rotate(0) scale(1)}50%{transform:rotate(180deg) scale(1.5)}to{transform:rotate(360deg) scale(1)}}.devui-loading__mask{z-index:var(--devui-z-index-full-page-overlay, 1080);position:absolute;left:0;right:0;bottom:0;top:0;background-color:var(--devui-line, #d7d8da);opacity:.3}.devui-loading__wrapper{text-align:center}.devui-loading--full{position:fixed;left:0;right:0;bottom:0;top:0;z-index:var(--devui-z-index-full-page-overlay, 1080)}.devui-loading--hidden{overflow:hidden}.devui-loading__text{margin-left:10px}.devui-loading__area{position:absolute;transform:translate(-50%,-50%);padding:12px 14px;background:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px)}.devui-loading__busy-default-spinner{position:relative;display:inline-block;width:15px;height:15px;animation:devui-busy-spinner-anim 1s linear infinite}.devui-loading__busy-default-spinner div{position:absolute;left:44.5%;top:37%;width:6px;height:6px;border-radius:50%}.devui-loading__busy-default-spinner .devui-loading__bar1{top:0;left:0;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}.devui-loading__busy-default-spinner .devui-loading__bar2{top:0;left:9px;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar3{top:9px;left:0;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar4{top:9px;left:9px;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}.devui-editable-select.devui-form-group.devui-has-feedback>.devui-form-control-feedback{height:100%;display:inline-flex;align-items:center;justify-content:center;padding:0;font-size:var(--devui-font-size, 14px);z-index:10;line-height:0}.devui-editable-select.devui-form-group.devui-has-feedback>.devui-form-control-feedback>span{align-items:center}.devui-editable-select.devui-form-group.devui-has-feedback>.devui-form-control-feedback>span>svg{width:1em;height:1em}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-clear-icon{pointer-events:auto;display:none;cursor:pointer}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-clear-icon path{fill:var(--devui-shape-icon-fill, #d7d8da);transition:all var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)) var(--devui-animation-duration-slow, .3s)}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-clear-icon:hover path{fill:var(--devui-shape-icon-fill-hover, #babbc0)}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-chevron-icon{display:flex;transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-chevron-icon svg path{fill:var(--devui-text-weak, #575d6c)}.devui-editable-select.allow-clear:hover .devui-select-chevron-icon{display:none}.devui-editable-select.allow-clear:hover .devui-select-clear-icon{display:flex}.devui-editable-select.devui-editable-select--open .devui-select-chevron-icon{transform:rotate(180deg)}.devui-editable-select .devui-form-control{outline:none;padding-right:24px}.devui-editable-select input::-ms-clear{display:none}.devui-editable-select__menu .devui-dropdown-menu{width:100%;display:block;top:auto!important;left:auto!important;box-shadow:none}.devui-editable-select__menu .devui-dropdown-menu .devui-scrollbar{overflow-y:overlay}.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item{cursor:pointer;display:block;width:100%;min-height:36px;line-height:20px;padding:8px 12px;border:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--devui-border-radius,
|
|
1
|
+
@keyframes devui-busy-spinner-anim{0%{transform:rotate(0) scale(1)}50%{transform:rotate(180deg) scale(1.5)}to{transform:rotate(360deg) scale(1)}}.devui-loading__mask{z-index:var(--devui-z-index-full-page-overlay, 1080);position:absolute;left:0;right:0;bottom:0;top:0;background-color:var(--devui-line, #d7d8da);opacity:.3}.devui-loading__wrapper{text-align:center}.devui-loading--full{position:fixed;left:0;right:0;bottom:0;top:0;z-index:var(--devui-z-index-full-page-overlay, 1080)}.devui-loading--hidden{overflow:hidden}.devui-loading__text{margin-left:10px}.devui-loading__area{position:absolute;transform:translate(-50%,-50%);padding:12px 14px;background:var(--devui-base-bg, #ffffff);border-radius:var(--devui-border-radius-card, 6px)}.devui-loading__busy-default-spinner{position:relative;display:inline-block;width:15px;height:15px;animation:devui-busy-spinner-anim 1s linear infinite}.devui-loading__busy-default-spinner div{position:absolute;left:44.5%;top:37%;width:6px;height:6px;border-radius:50%}.devui-loading__busy-default-spinner .devui-loading__bar1{top:0;left:0;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}.devui-loading__busy-default-spinner .devui-loading__bar2{top:0;left:9px;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar3{top:9px;left:0;background:#859bff;background:var(--devui-brand-foil, #859bff)}.devui-loading__busy-default-spinner .devui-loading__bar4{top:9px;left:9px;background:#5e7ce0;background:var(--devui-brand, #5e7ce0)}.devui-editable-select.devui-form-group.devui-has-feedback>.devui-form-control-feedback{height:100%;display:inline-flex;align-items:center;justify-content:center;padding:0;font-size:var(--devui-font-size, 14px);z-index:10;line-height:0}.devui-editable-select.devui-form-group.devui-has-feedback>.devui-form-control-feedback>span{align-items:center}.devui-editable-select.devui-form-group.devui-has-feedback>.devui-form-control-feedback>span>svg{width:1em;height:1em}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-clear-icon{pointer-events:auto;display:none;cursor:pointer}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-clear-icon path{fill:var(--devui-shape-icon-fill, #d7d8da);transition:all var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)) var(--devui-animation-duration-slow, .3s)}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-clear-icon:hover path{fill:var(--devui-shape-icon-fill-hover, #babbc0)}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-chevron-icon{display:flex;transition:transform var(--devui-animation-duration-slow, .3s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-editable-select.devui-form-group.devui-has-feedback .devui-select-chevron-icon svg path{fill:var(--devui-text-weak, #575d6c)}.devui-editable-select.allow-clear:hover .devui-select-chevron-icon{display:none}.devui-editable-select.allow-clear:hover .devui-select-clear-icon{display:flex}.devui-editable-select.devui-editable-select--open .devui-select-chevron-icon{transform:rotate(180deg)}.devui-editable-select .devui-form-control{outline:none;padding-right:24px}.devui-editable-select input::-ms-clear{display:none}.devui-editable-select__menu .devui-dropdown-menu{width:100%;display:block;top:auto!important;left:auto!important;padding-bottom:0;box-shadow:none}.devui-editable-select__menu .devui-dropdown-menu .devui-scrollbar{overflow-y:overlay;margin:0}.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item{cursor:pointer;display:block;width:100%;min-height:36px;line-height:20px;padding:8px 12px;border:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;border-radius:var(--devui-border-radius, 2px);transition:color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1)),background-color var(--devui-animation-duration-fast, .1s) var(--devui-animation-ease-in-out-smooth, cubic-bezier(.645, .045, .355, 1))}.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item:not(:first-child){margin-top:4px}.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item.disabled{cursor:not-allowed;color:var(--devui-disabled-text, #adb0b8)}.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item:not(.disabled):hover:not(.selected):not(.active){background-color:var(--devui-list-item-hover-bg, #f2f2f3);color:var(--devui-list-item-hover-text, #252b3a)}.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item:not(.disabled).devui-editable-select__dropdown--bg{background-color:var(--devui-list-item-hover-bg, #f2f2f3);color:var(--devui-list-item-hover-text, #252b3a)}.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item:not(.disabled).selected,.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item:not(.disabled).active{background-color:var(--devui-list-item-active-bg, #f2f5fc);color:var(--devui-list-item-active-text, #252b3a)}.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item:not(.disabled).selected:hover,.devui-editable-select__menu .devui-dropdown-menu .devui-dropdown-item:not(.disabled).active:hover{background-color:var(--devui-list-item-active-bg, #f2f5fc);color:var(--devui-list-item-active-text, #252b3a)}.devui-editable-select__menu ul.devui-editable-select__list-unstyled{margin:0}.devui-editable-select__menu .devui-popup-tips{color:var(--devui-text-weak, #575d6c);padding:4px 12px}.devui-flexible-overlay{position:fixed;border-radius:var(--devui-border-radius, 2px);background-color:var(--devui-connected-overlay-bg, #ffffff);box-shadow:var(--devui-shadow-length-connected-overlay, 0 4px 8px 0) var(--devui-shadow, rgba(37, 43, 58, .2));z-index:1000}.devui-flexible-overlay__arrow{position:absolute;width:8px;height:8px;transform:rotate(45deg);background-color:inherit}
|
package/form/index.es.js
CHANGED
|
@@ -29,7 +29,7 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, unref, nextTick, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport,
|
|
32
|
+
import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount } from "vue";
|
|
33
33
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
34
34
|
const formProps = {
|
|
35
35
|
data: {
|
|
@@ -5779,6 +5779,10 @@ const flexibleOverlayProps = {
|
|
|
5779
5779
|
isArrowCenter: {
|
|
5780
5780
|
type: Boolean,
|
|
5781
5781
|
default: true
|
|
5782
|
+
},
|
|
5783
|
+
clickEventBubble: {
|
|
5784
|
+
type: Boolean,
|
|
5785
|
+
default: false
|
|
5782
5786
|
}
|
|
5783
5787
|
};
|
|
5784
5788
|
function getScrollParent(element) {
|
|
@@ -5893,6 +5897,9 @@ const FlexibleOverlay = defineComponent({
|
|
|
5893
5897
|
expose
|
|
5894
5898
|
}) {
|
|
5895
5899
|
const ns2 = useNamespace("flexible-overlay");
|
|
5900
|
+
const {
|
|
5901
|
+
clickEventBubble
|
|
5902
|
+
} = toRefs(props);
|
|
5896
5903
|
const {
|
|
5897
5904
|
arrowRef,
|
|
5898
5905
|
overlayRef,
|
|
@@ -5906,7 +5913,10 @@ const FlexibleOverlay = defineComponent({
|
|
|
5906
5913
|
return props.modelValue && createVNode("div", mergeProps({
|
|
5907
5914
|
"ref": overlayRef,
|
|
5908
5915
|
"class": ns2.b()
|
|
5909
|
-
}, attrs
|
|
5916
|
+
}, attrs, {
|
|
5917
|
+
"onClick": withModifiers(() => ({}), [clickEventBubble.value ? "" : "stop"]),
|
|
5918
|
+
"onPointerup": withModifiers(() => ({}), ["stop"])
|
|
5919
|
+
}), [(_a = slots.default) == null ? void 0 : _a.call(slots), props.showArrow && createVNode("div", {
|
|
5910
5920
|
"ref": arrowRef,
|
|
5911
5921
|
"class": ns2.e("arrow")
|
|
5912
5922
|
}, null)]);
|
|
@@ -6024,7 +6034,7 @@ const TransformOriginMap = {
|
|
|
6024
6034
|
function usePopover(props, visible, placement, origin, popoverRef) {
|
|
6025
6035
|
const { trigger, isOpen } = toRefs(props);
|
|
6026
6036
|
const overlayStyles = computed(() => ({
|
|
6027
|
-
zIndex: 1060,
|
|
6037
|
+
zIndex: "var(--devui-z-index-pop-up, 1060)",
|
|
6028
6038
|
transformOrigin: TransformOriginMap[placement.value]
|
|
6029
6039
|
}));
|
|
6030
6040
|
const onDocumentClick = (e) => {
|
|
@@ -6267,8 +6277,6 @@ var Popover = defineComponent({
|
|
|
6267
6277
|
"style": overlayStyles.value
|
|
6268
6278
|
}, attrs, {
|
|
6269
6279
|
"onPositionChange": handlePositionChange,
|
|
6270
|
-
"onClick": withModifiers(() => ({}), ["stop"]),
|
|
6271
|
-
"onPointerup": withModifiers(() => ({}), ["stop"]),
|
|
6272
6280
|
"onMouseenter": onMouseenter,
|
|
6273
6281
|
"onMouseleave": onMouseleave
|
|
6274
6282
|
}), {
|
|
@@ -6467,9 +6475,7 @@ var FormControl = defineComponent({
|
|
|
6467
6475
|
}, {
|
|
6468
6476
|
default: () => {
|
|
6469
6477
|
var _a, _b;
|
|
6470
|
-
return [
|
|
6471
|
-
"class": ns2.e("control-content")
|
|
6472
|
-
}, [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)]), createTextVNode(",")];
|
|
6478
|
+
return [(_b = (_a = ctx.slots).default) == null ? void 0 : _b.call(_a)];
|
|
6473
6479
|
}
|
|
6474
6480
|
}), showFeedback.value && createVNode("span", {
|
|
6475
6481
|
"class": [ns2.e("feedback-icon"), ns2.em("feedback-icon", feedbackStatus.value)]
|