vue-devui 1.5.13 → 1.5.15-feat.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/auto-complete/index.es.js +3 -0
- package/auto-complete/index.umd.js +1 -1
- package/breadcrumb/index.es.js +3 -0
- package/breadcrumb/index.umd.js +1 -1
- package/checkbox/index.es.js +3 -0
- package/checkbox/index.umd.js +1 -1
- package/code-review/index.es.js +39 -14
- package/code-review/index.umd.js +14 -14
- package/date-picker-pro/index.es.js +3 -0
- package/date-picker-pro/index.umd.js +8 -8
- package/dropdown/index.es.js +3 -0
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.es.js +5 -1
- package/editable-select/index.umd.js +7 -7
- package/editor-md/index.es.js +1428 -1213
- package/editor-md/index.umd.js +45 -45
- package/editor-md/style.css +1 -1
- package/form/index.es.js +3 -0
- package/form/index.umd.js +1 -1
- package/git-graph/index.es.js +3 -0
- package/git-graph/index.umd.js +12 -12
- package/input/index.es.js +3 -0
- package/input/index.umd.js +6 -6
- package/input-number/index.es.js +3 -0
- package/input-number/index.umd.js +1 -1
- package/mention/index.es.js +3 -0
- package/mention/index.umd.js +1 -1
- package/menu/index.es.js +6 -2
- package/menu/index.umd.js +1 -1
- package/modal/index.es.js +3 -0
- package/modal/index.umd.js +1 -1
- package/nuxt/components/checkbox.js +3 -0
- package/overlay/index.es.js +3 -0
- package/overlay/index.umd.js +1 -1
- package/package.json +1 -1
- package/pagination/index.es.js +156 -292
- package/pagination/index.umd.js +18 -18
- package/pagination/style.css +1 -1
- package/popover/index.es.js +3 -0
- package/popover/index.umd.js +6 -6
- package/radio/index.es.js +3 -0
- package/radio/index.umd.js +1 -1
- package/search/index.es.js +3 -0
- package/search/index.umd.js +1 -1
- package/select/index.es.js +120 -265
- package/select/index.umd.js +17 -17
- package/select/style.css +1 -1
- package/splitter/index.es.js +14 -6
- package/splitter/index.umd.js +4 -4
- package/splitter/style.css +1 -1
- package/style.css +1 -1
- package/switch/index.es.js +3 -0
- package/switch/index.umd.js +1 -1
- package/table/index.es.js +14 -6
- package/table/index.umd.js +2 -2
- package/table/style.css +1 -1
- package/textarea/index.es.js +3 -0
- package/textarea/index.umd.js +1 -1
- package/time-picker/index.es.js +3 -0
- package/time-picker/index.umd.js +1 -1
- package/time-select/index.es.js +120 -265
- package/time-select/index.umd.js +18 -18
- package/time-select/style.css +1 -1
- package/tooltip/index.es.js +14 -6
- package/tooltip/index.umd.js +9 -9
- package/tooltip/style.css +1 -1
- package/tree/index.es.js +3 -0
- package/tree/index.umd.js +1 -1
- package/types/code-review/src/utils.d.ts +3 -3
- package/types/editable-select/src/editable-select.d.ts +1 -1
- package/types/editor-md/index.d.ts +1 -0
- package/types/editor-md/src/components/md-render.d.ts +1 -1
- package/types/editor-md/src/composables/use-editor-md.d.ts +3 -0
- package/types/editor-md/src/editor-md-types.d.ts +9 -1
- package/types/editor-md/src/editor-md.d.ts +6 -3
- package/types/editor-md/src/plugins/checkbox.d.ts +1 -0
- package/types/menu/src/menu-types.d.ts +4 -0
- package/types/menu/src/menu.d.ts +9 -0
- package/types/pagination/src/pagination-types.d.ts +4 -13
- package/types/pagination/src/pagination.d.ts +218 -0
- package/types/select/src/select-types.d.ts +4 -23
- package/types/select/src/select.d.ts +1 -19
- package/types/select/src/use-select.d.ts +1 -1
- package/types/tag/src/tag.d.ts +2 -2
- package/vue-devui.es.js +283 -263
- package/vue-devui.umd.js +50 -50
package/time-select/index.es.js
CHANGED
|
@@ -29,9 +29,9 @@ var __objRest = (source, exclude) => {
|
|
|
29
29
|
}
|
|
30
30
|
return target;
|
|
31
31
|
};
|
|
32
|
-
import { ref, reactive, defineComponent, watch, provide, toRefs, createVNode, onUnmounted, Transition, mergeProps, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, toRef, onBeforeMount, vShow, resolveComponent, getCurrentInstance
|
|
33
|
-
import "clipboard";
|
|
32
|
+
import { ref, reactive, defineComponent, watch, provide, toRefs, createVNode, onUnmounted, Transition, mergeProps, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, toRef, onBeforeMount, vShow, resolveComponent, getCurrentInstance } from "vue";
|
|
34
33
|
import { onClickOutside } from "@vueuse/core";
|
|
34
|
+
import "clipboard";
|
|
35
35
|
import { offset, autoPlacement, arrow, shift, computePosition } from "@floating-ui/dom";
|
|
36
36
|
function deepAssign(...objects) {
|
|
37
37
|
const isObject2 = (obj) => obj && typeof obj === "object";
|
|
@@ -211,25 +211,6 @@ function className(classStr, classOpt) {
|
|
|
211
211
|
}
|
|
212
212
|
return classname;
|
|
213
213
|
}
|
|
214
|
-
function lockScroll() {
|
|
215
|
-
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
216
|
-
const scrollTop = document.documentElement.scrollTop;
|
|
217
|
-
const style = document.documentElement.getAttribute("style");
|
|
218
|
-
document.documentElement.style.position = "fixed";
|
|
219
|
-
document.documentElement.style.top = `-${scrollTop}px`;
|
|
220
|
-
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
221
|
-
document.documentElement.style.overflowY = "scroll";
|
|
222
|
-
return () => {
|
|
223
|
-
if (style) {
|
|
224
|
-
document.documentElement.setAttribute("style", style);
|
|
225
|
-
} else {
|
|
226
|
-
document.documentElement.removeAttribute("style");
|
|
227
|
-
}
|
|
228
|
-
document.documentElement.scrollTop = scrollTop;
|
|
229
|
-
};
|
|
230
|
-
}
|
|
231
|
-
return;
|
|
232
|
-
}
|
|
233
214
|
function createBem$1(namespace, element, modifier) {
|
|
234
215
|
let cls = namespace;
|
|
235
216
|
if (element) {
|
|
@@ -5723,6 +5704,48 @@ const formProps = {
|
|
|
5723
5704
|
};
|
|
5724
5705
|
const FORM_TOKEN = Symbol("dForm");
|
|
5725
5706
|
const STYLE_TOKEN = Symbol("dForm");
|
|
5707
|
+
function lockScroll() {
|
|
5708
|
+
if (document.documentElement.scrollHeight > document.documentElement.clientHeight) {
|
|
5709
|
+
const scrollTop = document.documentElement.scrollTop;
|
|
5710
|
+
const style = document.documentElement.getAttribute("style");
|
|
5711
|
+
document.documentElement.style.position = "fixed";
|
|
5712
|
+
document.documentElement.style.top = `-${scrollTop}px`;
|
|
5713
|
+
document.documentElement.style.width = document.documentElement.style.width || "100%";
|
|
5714
|
+
document.documentElement.style.overflowY = "scroll";
|
|
5715
|
+
return () => {
|
|
5716
|
+
if (style) {
|
|
5717
|
+
document.documentElement.setAttribute("style", style);
|
|
5718
|
+
} else {
|
|
5719
|
+
document.documentElement.removeAttribute("style");
|
|
5720
|
+
}
|
|
5721
|
+
document.documentElement.scrollTop = scrollTop;
|
|
5722
|
+
};
|
|
5723
|
+
}
|
|
5724
|
+
return;
|
|
5725
|
+
}
|
|
5726
|
+
function createBem(namespace, element, modifier) {
|
|
5727
|
+
let cls = namespace;
|
|
5728
|
+
if (element) {
|
|
5729
|
+
cls += `__${element}`;
|
|
5730
|
+
}
|
|
5731
|
+
if (modifier) {
|
|
5732
|
+
cls += `--${modifier}`;
|
|
5733
|
+
}
|
|
5734
|
+
return cls;
|
|
5735
|
+
}
|
|
5736
|
+
function useNamespace(block, needDot = false) {
|
|
5737
|
+
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
5738
|
+
const b = () => createBem(namespace);
|
|
5739
|
+
const e = (element) => element ? createBem(namespace, element) : "";
|
|
5740
|
+
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
5741
|
+
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
5742
|
+
return {
|
|
5743
|
+
b,
|
|
5744
|
+
e,
|
|
5745
|
+
m,
|
|
5746
|
+
em
|
|
5747
|
+
};
|
|
5748
|
+
}
|
|
5726
5749
|
function useFieldCollection() {
|
|
5727
5750
|
const itemContexts = [];
|
|
5728
5751
|
const addItemContext = (field) => {
|
|
@@ -5790,7 +5813,7 @@ defineComponent({
|
|
|
5790
5813
|
props: formProps,
|
|
5791
5814
|
emits: ["validate"],
|
|
5792
5815
|
setup(props, ctx) {
|
|
5793
|
-
const ns2 = useNamespace
|
|
5816
|
+
const ns2 = useNamespace("form");
|
|
5794
5817
|
const {
|
|
5795
5818
|
itemContexts,
|
|
5796
5819
|
addItemContext,
|
|
@@ -5908,29 +5931,6 @@ function useFixedOverlay(props, ctx) {
|
|
|
5908
5931
|
onUnmounted(removeBodyAdditions);
|
|
5909
5932
|
return { onClick };
|
|
5910
5933
|
}
|
|
5911
|
-
function createBem(namespace, element, modifier) {
|
|
5912
|
-
let cls = namespace;
|
|
5913
|
-
if (element) {
|
|
5914
|
-
cls += `__${element}`;
|
|
5915
|
-
}
|
|
5916
|
-
if (modifier) {
|
|
5917
|
-
cls += `--${modifier}`;
|
|
5918
|
-
}
|
|
5919
|
-
return cls;
|
|
5920
|
-
}
|
|
5921
|
-
function useNamespace(block, needDot = false) {
|
|
5922
|
-
const namespace = needDot ? `.devui-${block}` : `devui-${block}`;
|
|
5923
|
-
const b = () => createBem(namespace);
|
|
5924
|
-
const e = (element) => element ? createBem(namespace, element) : "";
|
|
5925
|
-
const m = (modifier) => modifier ? createBem(namespace, "", modifier) : "";
|
|
5926
|
-
const em = (element, modifier) => element && modifier ? createBem(namespace, element, modifier) : "";
|
|
5927
|
-
return {
|
|
5928
|
-
b,
|
|
5929
|
-
e,
|
|
5930
|
-
m,
|
|
5931
|
-
em
|
|
5932
|
-
};
|
|
5933
|
-
}
|
|
5934
5934
|
var fixedOverlay = "";
|
|
5935
5935
|
defineComponent({
|
|
5936
5936
|
name: "DFixedOverlay",
|
|
@@ -5941,7 +5941,7 @@ defineComponent({
|
|
|
5941
5941
|
const {
|
|
5942
5942
|
modelValue
|
|
5943
5943
|
} = toRefs(props);
|
|
5944
|
-
const ns2 = useNamespace("fixed-overlay");
|
|
5944
|
+
const ns2 = useNamespace$1("fixed-overlay");
|
|
5945
5945
|
const {
|
|
5946
5946
|
onClick
|
|
5947
5947
|
} = useFixedOverlay(props, ctx);
|
|
@@ -6058,6 +6058,9 @@ function useOverlay(props, emit) {
|
|
|
6058
6058
|
];
|
|
6059
6059
|
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
6060
6060
|
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
6061
|
+
if (!overlayEl) {
|
|
6062
|
+
return;
|
|
6063
|
+
}
|
|
6061
6064
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
6062
6065
|
strategy: "fixed",
|
|
6063
6066
|
middleware
|
|
@@ -6107,7 +6110,7 @@ const FlexibleOverlay = defineComponent({
|
|
|
6107
6110
|
emit,
|
|
6108
6111
|
expose
|
|
6109
6112
|
}) {
|
|
6110
|
-
const ns2 = useNamespace("flexible-overlay");
|
|
6113
|
+
const ns2 = useNamespace$1("flexible-overlay");
|
|
6111
6114
|
const {
|
|
6112
6115
|
clickEventBubble
|
|
6113
6116
|
} = toRefs(props);
|
|
@@ -6136,7 +6139,7 @@ const FlexibleOverlay = defineComponent({
|
|
|
6136
6139
|
});
|
|
6137
6140
|
const POPPER_TRIGGER_TOKEN = Symbol("popper-trigger");
|
|
6138
6141
|
const isObject = (val) => val !== null && typeof val === "object";
|
|
6139
|
-
const ns$1 = useNamespace("popper-trigger");
|
|
6142
|
+
const ns$1 = useNamespace$1("popper-trigger");
|
|
6140
6143
|
function wrapContent(content) {
|
|
6141
6144
|
return h("span", { class: ns$1.b() }, content);
|
|
6142
6145
|
}
|
|
@@ -6323,7 +6326,7 @@ function usePopoverEvent(props, visible, origin) {
|
|
|
6323
6326
|
});
|
|
6324
6327
|
return { placement, handlePositionChange, onMouseenter, onMouseleave };
|
|
6325
6328
|
}
|
|
6326
|
-
const ns = useNamespace("popover");
|
|
6329
|
+
const ns = useNamespace$1("popover");
|
|
6327
6330
|
function SuccessIcon$1() {
|
|
6328
6331
|
return createVNode("svg", {
|
|
6329
6332
|
"class": [ns.e("icon"), ns.em("icon", "success")],
|
|
@@ -6425,7 +6428,7 @@ var PopoverIcon = defineComponent({
|
|
|
6425
6428
|
}
|
|
6426
6429
|
},
|
|
6427
6430
|
setup(props) {
|
|
6428
|
-
const ns2 = useNamespace("popover");
|
|
6431
|
+
const ns2 = useNamespace$1("popover");
|
|
6429
6432
|
return () => props.type && props.type !== "default" && createVNode("span", {
|
|
6430
6433
|
"class": ns2.e("icon-wrap")
|
|
6431
6434
|
}, [props.type === "success" && createVNode(SuccessIcon$1, null, null), props.type === "warning" && createVNode(WarningIcon, null, null), props.type === "info" && createVNode(InfoIcon, null, null), props.type === "error" && createVNode(ErrorIcon$1, null, null)]);
|
|
@@ -6462,7 +6465,7 @@ var Popover = defineComponent({
|
|
|
6462
6465
|
const {
|
|
6463
6466
|
overlayStyles
|
|
6464
6467
|
} = usePopover(props, visible, placement, origin, popoverRef);
|
|
6465
|
-
const ns2 = useNamespace("popover");
|
|
6468
|
+
const ns2 = useNamespace$1("popover");
|
|
6466
6469
|
provide(POPPER_TRIGGER_TOKEN, origin);
|
|
6467
6470
|
watch(visible, (newVal) => {
|
|
6468
6471
|
if (newVal) {
|
|
@@ -6595,7 +6598,7 @@ function useFormLabel() {
|
|
|
6595
6598
|
const formContext = inject(FORM_TOKEN);
|
|
6596
6599
|
const formItemContext = inject(FORM_ITEM_TOKEN);
|
|
6597
6600
|
const labelData = inject(LABEL_DATA);
|
|
6598
|
-
const ns2 = useNamespace
|
|
6601
|
+
const ns2 = useNamespace("form");
|
|
6599
6602
|
const defaultTipsPopover = {
|
|
6600
6603
|
content: "",
|
|
6601
6604
|
position: ["top"],
|
|
@@ -6626,7 +6629,7 @@ var formLabel = "";
|
|
|
6626
6629
|
var FormLabel = defineComponent({
|
|
6627
6630
|
name: "DFormLabel",
|
|
6628
6631
|
setup(_, ctx) {
|
|
6629
|
-
const ns2 = useNamespace
|
|
6632
|
+
const ns2 = useNamespace("form");
|
|
6630
6633
|
const {
|
|
6631
6634
|
labelClasses,
|
|
6632
6635
|
labelInnerClasses,
|
|
@@ -6659,7 +6662,7 @@ const formControlProps = {
|
|
|
6659
6662
|
};
|
|
6660
6663
|
function useFormControl(props) {
|
|
6661
6664
|
const labelData = inject(LABEL_DATA);
|
|
6662
|
-
const ns2 = useNamespace
|
|
6665
|
+
const ns2 = useNamespace("form");
|
|
6663
6666
|
const { feedbackStatus } = toRefs(props);
|
|
6664
6667
|
const controlClasses = computed(() => ({
|
|
6665
6668
|
[ns2.e("control")]: true,
|
|
@@ -6691,7 +6694,7 @@ var FormControl = defineComponent({
|
|
|
6691
6694
|
const formContext = inject(FORM_TOKEN);
|
|
6692
6695
|
const formControl2 = ref();
|
|
6693
6696
|
const popoverRef = ref();
|
|
6694
|
-
const ns2 = useNamespace
|
|
6697
|
+
const ns2 = useNamespace("form");
|
|
6695
6698
|
const showPopoverClick = ref(true);
|
|
6696
6699
|
const {
|
|
6697
6700
|
controlClasses,
|
|
@@ -7782,7 +7785,7 @@ function getFieldValue(obj, path) {
|
|
|
7782
7785
|
}
|
|
7783
7786
|
function useFormItem(messageType, _rules, validateState) {
|
|
7784
7787
|
const formContext = inject(FORM_TOKEN);
|
|
7785
|
-
const ns2 = useNamespace
|
|
7788
|
+
const ns2 = useNamespace("form");
|
|
7786
7789
|
const itemClasses = computed(() => ({
|
|
7787
7790
|
[`${ns2.em("item", "horizontal")}`]: formContext.layout === "horizontal",
|
|
7788
7791
|
[`${ns2.em("item", "vertical")}`]: formContext.layout === "vertical",
|
|
@@ -8021,6 +8024,7 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8021
8024
|
const selectDisabled = computed(() => (formContext == null ? void 0 : formContext.disabled) || props.disabled);
|
|
8022
8025
|
const selectSize = computed(() => props.size || (formContext == null ? void 0 : formContext.size) || "md");
|
|
8023
8026
|
const isObjectOption = ref(false);
|
|
8027
|
+
const originRef = ref();
|
|
8024
8028
|
const isOpen = ref(false);
|
|
8025
8029
|
const toggleChange = (bool) => {
|
|
8026
8030
|
if (selectDisabled.value) {
|
|
@@ -8030,14 +8034,7 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8030
8034
|
ctx.emit("toggle-change", bool);
|
|
8031
8035
|
};
|
|
8032
8036
|
onClickOutside(dropdownRef, () => {
|
|
8033
|
-
|
|
8034
|
-
if (props.multiple && isOpen.value) {
|
|
8035
|
-
(_a = selectRef.value) == null ? void 0 : _a.clearMultipleSearchKey();
|
|
8036
|
-
onBlur();
|
|
8037
|
-
}
|
|
8038
|
-
if (isOpen.value) {
|
|
8039
|
-
toggleChange(false);
|
|
8040
|
-
}
|
|
8037
|
+
toggleChange(false);
|
|
8041
8038
|
}, { ignore: [selectRef] });
|
|
8042
8039
|
const dropdownMenuMultipleNs = useNamespace$1("dropdown-menu-multiple");
|
|
8043
8040
|
const selectCls = computed(() => {
|
|
@@ -8150,11 +8147,8 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8150
8147
|
}
|
|
8151
8148
|
};
|
|
8152
8149
|
const valueChange = (item) => {
|
|
8153
|
-
var _a;
|
|
8154
8150
|
const { multiple } = props;
|
|
8155
8151
|
let { modelValue } = props;
|
|
8156
|
-
filterQuery.value = "";
|
|
8157
|
-
handlerQueryFunc("");
|
|
8158
8152
|
if (multiple) {
|
|
8159
8153
|
const checkedItems = Array.isArray(modelValue) ? modelValue.slice() : [];
|
|
8160
8154
|
const index2 = checkedItems.indexOf(item.value);
|
|
@@ -8181,7 +8175,6 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8181
8175
|
}
|
|
8182
8176
|
getMultipleSelected(checkedItems);
|
|
8183
8177
|
} else {
|
|
8184
|
-
(_a = selectRef.value) == null ? void 0 : _a.clearSingleSearchKey();
|
|
8185
8178
|
ctx.emit("update:modelValue", item.value);
|
|
8186
8179
|
getSingleSelected(item);
|
|
8187
8180
|
toggleChange(false);
|
|
@@ -8192,8 +8185,6 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8192
8185
|
ctx.emit("toggle-change", false);
|
|
8193
8186
|
};
|
|
8194
8187
|
const handleClear = () => {
|
|
8195
|
-
filterQuery.value = "";
|
|
8196
|
-
handlerQueryFunc("");
|
|
8197
8188
|
if (props.multiple) {
|
|
8198
8189
|
ctx.emit("update:modelValue", []);
|
|
8199
8190
|
ctx.emit("value-change", []);
|
|
@@ -8206,6 +8197,7 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8206
8197
|
handleClose();
|
|
8207
8198
|
blur();
|
|
8208
8199
|
}
|
|
8200
|
+
filterQuery.value = "";
|
|
8209
8201
|
};
|
|
8210
8202
|
const tagDelete = (data) => {
|
|
8211
8203
|
let { modelValue } = props;
|
|
@@ -8223,22 +8215,21 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8223
8215
|
ctx.emit("remove-tag", data.value);
|
|
8224
8216
|
getMultipleSelected(checkedItems);
|
|
8225
8217
|
};
|
|
8226
|
-
const onFocus = () => {
|
|
8218
|
+
const onFocus = (e) => {
|
|
8219
|
+
ctx.emit("focus", e);
|
|
8227
8220
|
if (!selectDisabled.value) {
|
|
8228
8221
|
isSelectFocus.value = true;
|
|
8229
8222
|
}
|
|
8230
8223
|
};
|
|
8231
|
-
const onBlur = () => {
|
|
8224
|
+
const onBlur = (e) => {
|
|
8225
|
+
ctx.emit("blur", e);
|
|
8232
8226
|
if (!selectDisabled.value) {
|
|
8233
|
-
setTimeout(() => {
|
|
8234
|
-
filterQuery.value = "";
|
|
8235
|
-
handlerQueryFunc("");
|
|
8236
|
-
}, 150);
|
|
8237
8227
|
isSelectFocus.value = false;
|
|
8238
8228
|
}
|
|
8239
8229
|
};
|
|
8240
8230
|
const queryChange = (query) => {
|
|
8241
8231
|
filterQuery.value = query;
|
|
8232
|
+
ctx.emit("input-change", query);
|
|
8242
8233
|
};
|
|
8243
8234
|
const isLoading = computed(() => typeof props.loading === "boolean" && props.loading);
|
|
8244
8235
|
const debounceTime = computed(() => props.remote ? 300 : 0);
|
|
@@ -8266,7 +8257,7 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8266
8257
|
const emptyText = computed(() => {
|
|
8267
8258
|
const visibleOptionsCount = injectOptionsArray.value.filter((item) => {
|
|
8268
8259
|
const label = item.name || item.value;
|
|
8269
|
-
return label.toString().toLocaleLowerCase().includes(filterQuery.value.
|
|
8260
|
+
return label.toString().toLocaleLowerCase().includes(filterQuery.value.toLocaleLowerCase().trim());
|
|
8270
8261
|
}).length;
|
|
8271
8262
|
if (isLoading.value) {
|
|
8272
8263
|
return props.loadingText || t("loadingText");
|
|
@@ -8293,8 +8284,7 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8293
8284
|
}
|
|
8294
8285
|
};
|
|
8295
8286
|
watch(() => props.modelValue, () => {
|
|
8296
|
-
formItemContext == null ? void 0 : formItemContext.validate("change").catch(() =>
|
|
8297
|
-
});
|
|
8287
|
+
formItemContext == null ? void 0 : formItemContext.validate("change").catch((err) => console.warn(err));
|
|
8298
8288
|
updateInjectOptionsStatus();
|
|
8299
8289
|
}, { deep: true });
|
|
8300
8290
|
watch(injectOptions, () => {
|
|
@@ -8309,17 +8299,10 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8309
8299
|
(_a = dropdownRef.value) == null ? void 0 : _a.updatePosition();
|
|
8310
8300
|
}
|
|
8311
8301
|
}, { flush: "post" });
|
|
8312
|
-
watch(isSelectFocus, (val) => {
|
|
8313
|
-
if (val) {
|
|
8314
|
-
ctx.emit("focus");
|
|
8315
|
-
} else {
|
|
8316
|
-
ctx.emit("blur");
|
|
8317
|
-
}
|
|
8318
|
-
});
|
|
8319
|
-
onMounted(updateInjectOptionsStatus);
|
|
8320
8302
|
return {
|
|
8321
8303
|
selectDisabled,
|
|
8322
8304
|
selectSize,
|
|
8305
|
+
originRef,
|
|
8323
8306
|
dropdownRef,
|
|
8324
8307
|
isOpen,
|
|
8325
8308
|
selectCls,
|
|
@@ -8344,7 +8327,7 @@ function useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t) {
|
|
|
8344
8327
|
}
|
|
8345
8328
|
const selectProps = {
|
|
8346
8329
|
modelValue: {
|
|
8347
|
-
type: [String, Number, Array
|
|
8330
|
+
type: [String, Number, Array],
|
|
8348
8331
|
default: ""
|
|
8349
8332
|
},
|
|
8350
8333
|
"onUpdate:modelValue": {
|
|
@@ -8359,10 +8342,6 @@ const selectProps = {
|
|
|
8359
8342
|
type: String,
|
|
8360
8343
|
default: ""
|
|
8361
8344
|
},
|
|
8362
|
-
position: {
|
|
8363
|
-
type: Array,
|
|
8364
|
-
default: () => ["bottom", "top"]
|
|
8365
|
-
},
|
|
8366
8345
|
overview: {
|
|
8367
8346
|
type: String,
|
|
8368
8347
|
default: "border"
|
|
@@ -8434,10 +8413,6 @@ const selectProps = {
|
|
|
8434
8413
|
multipleLimit: {
|
|
8435
8414
|
type: Number,
|
|
8436
8415
|
default: 0
|
|
8437
|
-
},
|
|
8438
|
-
showEmptyWhenUnmatched: {
|
|
8439
|
-
type: Boolean,
|
|
8440
|
-
default: true
|
|
8441
8416
|
}
|
|
8442
8417
|
};
|
|
8443
8418
|
const optionProps = {
|
|
@@ -8734,7 +8709,7 @@ var Checkbox = defineComponent({
|
|
|
8734
8709
|
props: checkboxProps,
|
|
8735
8710
|
emits: ["change", "update:checked", "update:modelValue"],
|
|
8736
8711
|
setup(props, ctx) {
|
|
8737
|
-
const ns2 = useNamespace
|
|
8712
|
+
const ns2 = useNamespace("checkbox");
|
|
8738
8713
|
const {
|
|
8739
8714
|
mergedChecked,
|
|
8740
8715
|
mergedDisabled,
|
|
@@ -8835,7 +8810,7 @@ defineComponent({
|
|
|
8835
8810
|
props: checkboxGroupProps,
|
|
8836
8811
|
emits: ["change", "update:modelValue"],
|
|
8837
8812
|
setup(props, ctx) {
|
|
8838
|
-
const ns2 = useNamespace
|
|
8813
|
+
const ns2 = useNamespace("checkbox");
|
|
8839
8814
|
const {
|
|
8840
8815
|
defaultOpt
|
|
8841
8816
|
} = useCheckboxGroup(props, ctx);
|
|
@@ -8881,7 +8856,7 @@ defineComponent({
|
|
|
8881
8856
|
props: checkboxProps,
|
|
8882
8857
|
emits: ["change", "update:checked", "update:modelValue"],
|
|
8883
8858
|
setup(props, ctx) {
|
|
8884
|
-
const ns2 = useNamespace
|
|
8859
|
+
const ns2 = useNamespace("checkbox-button");
|
|
8885
8860
|
const {
|
|
8886
8861
|
mergedChecked,
|
|
8887
8862
|
mergedDisabled,
|
|
@@ -8944,23 +8919,20 @@ function useOption(props) {
|
|
|
8944
8919
|
return select2.modelValue === props.value;
|
|
8945
8920
|
}
|
|
8946
8921
|
});
|
|
8947
|
-
const isDisabled = computed(() => props.disabled || ((optionGroup == null ? void 0 : optionGroup.disabled) ? true : false));
|
|
8948
8922
|
const optionItem = computed(() => {
|
|
8949
8923
|
return {
|
|
8950
8924
|
name: props.name || props.value + "" || "",
|
|
8951
8925
|
value: props.value,
|
|
8952
8926
|
create: props.create,
|
|
8953
|
-
_checked: false
|
|
8954
|
-
disabled: isDisabled.value
|
|
8927
|
+
_checked: false
|
|
8955
8928
|
};
|
|
8956
8929
|
});
|
|
8930
|
+
const isDisabled = computed(() => props.disabled || ((optionGroup == null ? void 0 : optionGroup.disabled) ? true : false));
|
|
8957
8931
|
const isObjectOption = ref(!!props.name);
|
|
8958
8932
|
const selectOptionCls = computed(() => {
|
|
8959
8933
|
return className(ns2.e("item"), {
|
|
8960
8934
|
active: isOptionSelected.value,
|
|
8961
|
-
disabled: isDisabled.value
|
|
8962
|
-
[ns2.em("item", "sm")]: (select2 == null ? void 0 : select2.selectSize) === "sm",
|
|
8963
|
-
[ns2.em("item", "lg")]: (select2 == null ? void 0 : select2.selectSize) === "lg"
|
|
8935
|
+
disabled: isDisabled.value
|
|
8964
8936
|
});
|
|
8965
8937
|
});
|
|
8966
8938
|
const optionSelect = () => {
|
|
@@ -9076,7 +9048,7 @@ const tagProps = {
|
|
|
9076
9048
|
}
|
|
9077
9049
|
};
|
|
9078
9050
|
function useClass(props) {
|
|
9079
|
-
const ns2 = useNamespace("tag");
|
|
9051
|
+
const ns2 = useNamespace$1("tag");
|
|
9080
9052
|
return computed(() => {
|
|
9081
9053
|
const { type: type4, color, deletable } = props;
|
|
9082
9054
|
return `${ns2.e("item")} ${ns2.m(type4 || (color ? "colorful" : "") || "default")} ${deletable ? ns2.m("deletable") : ""} ${ns2.m(props.size)}`;
|
|
@@ -9118,7 +9090,7 @@ var Tag = defineComponent({
|
|
|
9118
9090
|
slots,
|
|
9119
9091
|
emit
|
|
9120
9092
|
}) {
|
|
9121
|
-
const ns2 = useNamespace("tag");
|
|
9093
|
+
const ns2 = useNamespace$1("tag");
|
|
9122
9094
|
const {
|
|
9123
9095
|
type: type4,
|
|
9124
9096
|
color,
|
|
@@ -9176,13 +9148,9 @@ function useSelectContent() {
|
|
|
9176
9148
|
const ns2 = useNamespace$1("select");
|
|
9177
9149
|
const select2 = inject(SELECT_TOKEN);
|
|
9178
9150
|
const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
|
|
9179
|
-
const styleType = inject(STYLE_TOKEN, void 0);
|
|
9180
9151
|
const app = getCurrentInstance();
|
|
9181
9152
|
const t = createI18nTranslate("DSelect", app);
|
|
9182
9153
|
const searchQuery = ref("");
|
|
9183
|
-
const singleSearchKey = ref("");
|
|
9184
|
-
const singleInputRef = ref();
|
|
9185
|
-
const singlePlaceholderWidth = computed(() => (select2 == null ? void 0 : select2.dropdownWidth) ? `${(select2 == null ? void 0 : select2.dropdownWidth) - 40}px` : "auto");
|
|
9186
9154
|
const selectedData = computed(() => {
|
|
9187
9155
|
return (select2 == null ? void 0 : select2.selectedOptions) || [];
|
|
9188
9156
|
});
|
|
@@ -9200,37 +9168,21 @@ function useSelectContent() {
|
|
|
9200
9168
|
const displayInputValue = computed(() => {
|
|
9201
9169
|
var _a;
|
|
9202
9170
|
if (select2 == null ? void 0 : select2.selectedOptions) {
|
|
9203
|
-
return select2.selectedOptions.length > 1 ? select2.selectedOptions.map((item) => (item == null ? void 0 : item.name) || (item == null ? void 0 : item.value) || "").join(",") : ((_a = select2.selectedOptions[0]) == null ? void 0 : _a.name) ||
|
|
9171
|
+
return select2.selectedOptions.length > 1 ? select2.selectedOptions.map((item) => (item == null ? void 0 : item.name) || (item == null ? void 0 : item.value) || "").join(",") : ((_a = select2.selectedOptions[0]) == null ? void 0 : _a.name) || "";
|
|
9204
9172
|
} else {
|
|
9205
9173
|
return "";
|
|
9206
9174
|
}
|
|
9207
9175
|
});
|
|
9208
|
-
const isPlaceholderDark = computed(() => {
|
|
9209
|
-
if (!singleSearchKey.value) {
|
|
9210
|
-
if (isSelectDisable.value) {
|
|
9211
|
-
return false;
|
|
9212
|
-
}
|
|
9213
|
-
if (!displayInputValue.value) {
|
|
9214
|
-
return true;
|
|
9215
|
-
} else {
|
|
9216
|
-
return select2 == null ? void 0 : select2.isSelectFocus;
|
|
9217
|
-
}
|
|
9218
|
-
} else {
|
|
9219
|
-
return false;
|
|
9220
|
-
}
|
|
9221
|
-
});
|
|
9222
9176
|
const mergeClearable = computed(() => {
|
|
9223
9177
|
return !isSelectDisable.value && !!(select2 == null ? void 0 : select2.allowClear) && (displayInputValue.value ? true : false);
|
|
9224
9178
|
});
|
|
9225
9179
|
const isDisabledTooltip = computed(() => {
|
|
9226
9180
|
return !isSupportTagsTooltip.value || !!(select2 == null ? void 0 : select2.isOpen);
|
|
9227
9181
|
});
|
|
9228
|
-
const isSupportFilter = computed(() => lodash.exports.isFunction(select2 == null ? void 0 : select2.filter) || typeof (select2 == null ? void 0 : select2.filter) === "boolean" && (select2 == null ? void 0 : select2.filter));
|
|
9229
9182
|
const selectionCls = computed(() => {
|
|
9230
9183
|
return className(ns2.e("selection"), {
|
|
9231
9184
|
[ns2.e("clearable")]: mergeClearable.value,
|
|
9232
|
-
[ns2.em("selection", "error")]: isValidateError.value
|
|
9233
|
-
[ns2.em("selection", "gray-style")]: styleType === "gray"
|
|
9185
|
+
[ns2.em("selection", "error")]: isValidateError.value
|
|
9234
9186
|
});
|
|
9235
9187
|
});
|
|
9236
9188
|
const inputCls = computed(() => {
|
|
@@ -9241,20 +9193,12 @@ function useSelectContent() {
|
|
|
9241
9193
|
});
|
|
9242
9194
|
const tagSize = computed(() => (select2 == null ? void 0 : select2.selectSize) || "sm");
|
|
9243
9195
|
const placeholder = computed(() => displayInputValue.value ? "" : (select2 == null ? void 0 : select2.placeholder) || t("placeholder"));
|
|
9244
|
-
const singlePlaceholder = computed(() => (select2 == null ? void 0 : select2.placeholder) || t("placeholder"));
|
|
9245
9196
|
const isMultiple = computed(() => !!(select2 == null ? void 0 : select2.multiple));
|
|
9246
9197
|
const handleClear = (e) => {
|
|
9247
9198
|
e.preventDefault();
|
|
9248
9199
|
e.stopPropagation();
|
|
9249
|
-
searchQuery.value = "";
|
|
9250
|
-
singleSearchKey.value = "";
|
|
9251
9200
|
select2 == null ? void 0 : select2.handleClear();
|
|
9252
9201
|
};
|
|
9253
|
-
const onSingleInputWrapClick = () => {
|
|
9254
|
-
if (!(select2 == null ? void 0 : select2.selectDisabled)) {
|
|
9255
|
-
singleInputRef.value.focus();
|
|
9256
|
-
}
|
|
9257
|
-
};
|
|
9258
9202
|
const tagDelete = (data) => {
|
|
9259
9203
|
if (data && (data.value || data.value === 0)) {
|
|
9260
9204
|
select2 == null ? void 0 : select2.tagDelete(data);
|
|
@@ -9264,67 +9208,39 @@ function useSelectContent() {
|
|
|
9264
9208
|
select2 == null ? void 0 : select2.onFocus(e);
|
|
9265
9209
|
};
|
|
9266
9210
|
const onBlur = (e) => {
|
|
9267
|
-
singleSearchKey.value = "";
|
|
9268
9211
|
select2 == null ? void 0 : select2.onBlur(e);
|
|
9269
9212
|
};
|
|
9270
|
-
const onMultipleClick = () => {
|
|
9271
|
-
if (select2 == null ? void 0 : select2.selectDisabled) {
|
|
9272
|
-
return;
|
|
9273
|
-
}
|
|
9274
|
-
if (select2 == null ? void 0 : select2.isOpen) {
|
|
9275
|
-
searchQuery.value = "";
|
|
9276
|
-
select2 == null ? void 0 : select2.onBlur();
|
|
9277
|
-
} else {
|
|
9278
|
-
select2 == null ? void 0 : select2.onFocus();
|
|
9279
|
-
}
|
|
9280
|
-
};
|
|
9281
|
-
const onArrowClick = () => {
|
|
9282
|
-
if (isMultiple.value) {
|
|
9283
|
-
onMultipleClick();
|
|
9284
|
-
}
|
|
9285
|
-
};
|
|
9286
9213
|
const queryFilter = (e) => {
|
|
9287
9214
|
e.preventDefault();
|
|
9288
9215
|
e.stopPropagation();
|
|
9289
9216
|
const query = e.target.value;
|
|
9290
|
-
singleSearchKey.value = query;
|
|
9291
|
-
searchQuery.value = query;
|
|
9292
9217
|
if (!isReadOnly.value && (select2 == null ? void 0 : select2.debounceQueryFilter)) {
|
|
9293
9218
|
select2 == null ? void 0 : select2.debounceQueryFilter(query);
|
|
9294
9219
|
}
|
|
9295
9220
|
};
|
|
9296
9221
|
return {
|
|
9297
|
-
singleInputRef,
|
|
9298
9222
|
searchQuery,
|
|
9299
|
-
singleSearchKey,
|
|
9300
9223
|
selectedData,
|
|
9301
9224
|
isSelectDisable,
|
|
9302
9225
|
isSupportCollapseTags,
|
|
9303
9226
|
isDisabledTooltip,
|
|
9304
|
-
isSupportFilter,
|
|
9305
9227
|
isReadOnly,
|
|
9306
9228
|
selectionCls,
|
|
9307
9229
|
inputCls,
|
|
9308
9230
|
tagSize,
|
|
9309
9231
|
placeholder,
|
|
9310
|
-
singlePlaceholder,
|
|
9311
|
-
singlePlaceholderWidth,
|
|
9312
9232
|
isMultiple,
|
|
9313
9233
|
displayInputValue,
|
|
9314
|
-
isPlaceholderDark,
|
|
9315
|
-
onSingleInputWrapClick,
|
|
9316
9234
|
handleClear,
|
|
9317
9235
|
tagDelete,
|
|
9318
9236
|
onFocus,
|
|
9319
9237
|
onBlur,
|
|
9320
|
-
onMultipleClick,
|
|
9321
|
-
onArrowClick,
|
|
9322
9238
|
queryFilter
|
|
9323
9239
|
};
|
|
9324
9240
|
}
|
|
9325
9241
|
var SelectContent = defineComponent({
|
|
9326
9242
|
name: "SelectContent",
|
|
9327
|
-
setup(
|
|
9243
|
+
setup() {
|
|
9328
9244
|
const formItemContext = inject(FORM_ITEM_TOKEN, void 0);
|
|
9329
9245
|
const ns2 = useNamespace$1("select");
|
|
9330
9246
|
const clearCls = computed(() => ({
|
|
@@ -9338,71 +9254,44 @@ var SelectContent = defineComponent({
|
|
|
9338
9254
|
const multipleCls = ns2.e("multiple");
|
|
9339
9255
|
const multipleInputCls = ns2.em("multiple", "input");
|
|
9340
9256
|
const {
|
|
9341
|
-
singleInputRef,
|
|
9342
9257
|
searchQuery,
|
|
9343
|
-
singleSearchKey,
|
|
9344
9258
|
selectedData,
|
|
9345
9259
|
isSelectDisable,
|
|
9346
9260
|
isSupportCollapseTags,
|
|
9347
9261
|
isDisabledTooltip,
|
|
9348
9262
|
isReadOnly,
|
|
9349
|
-
isSupportFilter,
|
|
9350
9263
|
selectionCls,
|
|
9351
9264
|
inputCls,
|
|
9352
9265
|
tagSize,
|
|
9353
9266
|
placeholder,
|
|
9354
|
-
singlePlaceholder,
|
|
9355
|
-
singlePlaceholderWidth,
|
|
9356
9267
|
isMultiple,
|
|
9357
|
-
isPlaceholderDark,
|
|
9358
9268
|
displayInputValue,
|
|
9359
|
-
onSingleInputWrapClick,
|
|
9360
|
-
onMultipleClick,
|
|
9361
|
-
onArrowClick,
|
|
9362
9269
|
handleClear,
|
|
9363
9270
|
tagDelete,
|
|
9364
9271
|
onFocus,
|
|
9365
9272
|
onBlur,
|
|
9366
9273
|
queryFilter
|
|
9367
9274
|
} = useSelectContent();
|
|
9368
|
-
const clearSingleSearchKey = () => {
|
|
9369
|
-
singleSearchKey.value = "";
|
|
9370
|
-
};
|
|
9371
|
-
const clearMultipleSearchKey = () => {
|
|
9372
|
-
searchQuery.value = "";
|
|
9373
|
-
};
|
|
9374
|
-
ctx.expose({
|
|
9375
|
-
clearSingleSearchKey,
|
|
9376
|
-
clearMultipleSearchKey
|
|
9377
|
-
});
|
|
9378
9275
|
return () => {
|
|
9379
9276
|
return createVNode("div", {
|
|
9380
9277
|
"class": selectionCls.value
|
|
9381
9278
|
}, [isMultiple.value ? createVNode("div", {
|
|
9382
|
-
"class": multipleCls
|
|
9383
|
-
"onClick": onMultipleClick
|
|
9279
|
+
"class": multipleCls
|
|
9384
9280
|
}, [!isSupportCollapseTags.value && selectedData.value.length >= 1 && selectedData.value.map((item) => createVNode(Tag, {
|
|
9385
|
-
"deletable":
|
|
9281
|
+
"deletable": true,
|
|
9386
9282
|
"onTagDelete": withModifiers(() => tagDelete(item), ["prevent", "stop"]),
|
|
9387
9283
|
"key": item.value,
|
|
9388
|
-
"maxWidth": "78%",
|
|
9389
|
-
"class": ["multiple-tag", {
|
|
9390
|
-
disabled: isSelectDisable.value || item.disabled
|
|
9391
|
-
}],
|
|
9392
9284
|
"size": tagSize.value
|
|
9393
9285
|
}, {
|
|
9394
9286
|
default: () => [item.name]
|
|
9395
9287
|
})), isSupportCollapseTags.value && selectedData.value.length >= 1 && createVNode(Tag, {
|
|
9396
9288
|
"deletable": true,
|
|
9397
|
-
"maxWidth": "75%",
|
|
9398
|
-
"class": "multiple-tag",
|
|
9399
9289
|
"onTagDelete": withModifiers(() => tagDelete(selectedData.value[0]), ["prevent", "stop"]),
|
|
9400
9290
|
"size": tagSize.value
|
|
9401
9291
|
}, {
|
|
9402
9292
|
default: () => [selectedData.value[0].name]
|
|
9403
9293
|
}), isSupportCollapseTags.value && selectedData.value.length > 1 && createVNode(Popover, {
|
|
9404
9294
|
"trigger": "hover",
|
|
9405
|
-
"auto-update-position": true,
|
|
9406
9295
|
"disabled": isDisabledTooltip.value
|
|
9407
9296
|
}, {
|
|
9408
9297
|
default: () => createVNode(Tag, {
|
|
@@ -9414,49 +9303,39 @@ var SelectContent = defineComponent({
|
|
|
9414
9303
|
"deletable": true,
|
|
9415
9304
|
"onTagDelete": withModifiers(() => tagDelete(item), ["prevent", "stop"]),
|
|
9416
9305
|
"key": item.value,
|
|
9417
|
-
"class": "popover-tag",
|
|
9418
9306
|
"size": tagSize.value
|
|
9419
9307
|
}, {
|
|
9420
9308
|
default: () => [item.name]
|
|
9421
9309
|
}))])
|
|
9422
9310
|
}), createVNode("div", {
|
|
9423
9311
|
"class": multipleInputCls
|
|
9424
|
-
}, [
|
|
9312
|
+
}, [createVNode("input", {
|
|
9425
9313
|
"ref": "input",
|
|
9426
9314
|
"value": searchQuery.value,
|
|
9427
9315
|
"type": "text",
|
|
9428
9316
|
"class": inputCls.value,
|
|
9429
9317
|
"placeholder": placeholder.value,
|
|
9430
|
-
"readonly": isReadOnly.value
|
|
9318
|
+
"readonly": isReadOnly.value,
|
|
9431
9319
|
"disabled": isSelectDisable.value,
|
|
9432
|
-
"onInput": queryFilter
|
|
9433
|
-
|
|
9434
|
-
"
|
|
9435
|
-
|
|
9436
|
-
|
|
9437
|
-
"
|
|
9438
|
-
"placeholder-dark": isPlaceholderDark.value
|
|
9439
|
-
}],
|
|
9440
|
-
"style": {
|
|
9441
|
-
width: singlePlaceholderWidth.value
|
|
9442
|
-
},
|
|
9443
|
-
"title": displayInputValue.value || singlePlaceholder.value
|
|
9444
|
-
}, [displayInputValue.value || singlePlaceholder.value]), withDirectives(createVNode("input", {
|
|
9445
|
-
"ref": singleInputRef,
|
|
9320
|
+
"onInput": queryFilter,
|
|
9321
|
+
"onFocus": onFocus,
|
|
9322
|
+
"onBlur": onBlur
|
|
9323
|
+
}, null)])]) : createVNode("input", {
|
|
9324
|
+
"ref": "input",
|
|
9325
|
+
"value": displayInputValue.value,
|
|
9446
9326
|
"type": "text",
|
|
9447
|
-
"onUpdate:modelValue": ($event) => singleSearchKey.value = $event,
|
|
9448
9327
|
"class": inputCls.value,
|
|
9328
|
+
"placeholder": placeholder.value,
|
|
9449
9329
|
"readonly": isReadOnly.value,
|
|
9450
9330
|
"disabled": isSelectDisable.value,
|
|
9451
9331
|
"onFocus": onFocus,
|
|
9452
9332
|
"onBlur": onBlur,
|
|
9453
9333
|
"onInput": queryFilter
|
|
9454
|
-
}, null),
|
|
9334
|
+
}, null), createVNode("span", {
|
|
9455
9335
|
"onClick": handleClear,
|
|
9456
9336
|
"class": clearCls.value
|
|
9457
9337
|
}, [createVNode(AlertCloseIcon, null, null)]), createVNode("span", {
|
|
9458
|
-
"class": arrowCls.value
|
|
9459
|
-
"onClick": onArrowClick
|
|
9338
|
+
"class": arrowCls.value
|
|
9460
9339
|
}, [createVNode(SelectArrowIcon, null, null)])]);
|
|
9461
9340
|
};
|
|
9462
9341
|
}
|
|
@@ -9484,38 +9363,11 @@ function useSelectFunction(props, selectRef) {
|
|
|
9484
9363
|
};
|
|
9485
9364
|
return { isSelectFocus, focus, blur };
|
|
9486
9365
|
}
|
|
9487
|
-
function useSelectMenuSize(selectRef, dropdownRef, isOpen) {
|
|
9488
|
-
const originRef = ref();
|
|
9489
|
-
const dropdownWidth = ref(0);
|
|
9490
|
-
let observer;
|
|
9491
|
-
const updateDropdownWidth = () => {
|
|
9492
|
-
var _a;
|
|
9493
|
-
dropdownWidth.value = ((_a = originRef.value) == null ? void 0 : _a.getBoundingClientRect().width) || 0;
|
|
9494
|
-
if (isOpen.value) {
|
|
9495
|
-
dropdownRef.value.updatePosition();
|
|
9496
|
-
}
|
|
9497
|
-
};
|
|
9498
|
-
const watchInputSize = () => {
|
|
9499
|
-
if (window) {
|
|
9500
|
-
observer = new window.ResizeObserver(updateDropdownWidth);
|
|
9501
|
-
observer.observe(originRef.value);
|
|
9502
|
-
}
|
|
9503
|
-
};
|
|
9504
|
-
onMounted(() => {
|
|
9505
|
-
originRef.value = selectRef.value.$el;
|
|
9506
|
-
watchInputSize();
|
|
9507
|
-
updateDropdownWidth();
|
|
9508
|
-
});
|
|
9509
|
-
onBeforeUnmount(() => {
|
|
9510
|
-
observer == null ? void 0 : observer.unobserve(originRef.value);
|
|
9511
|
-
});
|
|
9512
|
-
return { originRef, dropdownWidth };
|
|
9513
|
-
}
|
|
9514
9366
|
var select = "";
|
|
9515
9367
|
var Select = defineComponent({
|
|
9516
9368
|
name: "DSelect",
|
|
9517
9369
|
props: selectProps,
|
|
9518
|
-
emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear", "
|
|
9370
|
+
emits: ["toggle-change", "value-change", "update:modelValue", "focus", "blur", "remove-tag", "clear", "input-change"],
|
|
9519
9371
|
setup(props, ctx) {
|
|
9520
9372
|
const app = getCurrentInstance();
|
|
9521
9373
|
const t = createI18nTranslate("DSelect", app);
|
|
@@ -9528,6 +9380,7 @@ var Select = defineComponent({
|
|
|
9528
9380
|
const {
|
|
9529
9381
|
selectDisabled,
|
|
9530
9382
|
selectSize,
|
|
9383
|
+
originRef,
|
|
9531
9384
|
dropdownRef,
|
|
9532
9385
|
isOpen,
|
|
9533
9386
|
selectCls,
|
|
@@ -9549,16 +9402,9 @@ var Select = defineComponent({
|
|
|
9549
9402
|
isShowCreateOption
|
|
9550
9403
|
} = useSelect(props, selectRef, ctx, focus, blur, isSelectFocus, t);
|
|
9551
9404
|
const dropdownContainer = ref();
|
|
9552
|
-
const {
|
|
9553
|
-
originRef,
|
|
9554
|
-
dropdownWidth
|
|
9555
|
-
} = useSelectMenuSize(selectRef, dropdownRef, isOpen);
|
|
9556
9405
|
const scrollbarNs = useNamespace$1("scrollbar");
|
|
9557
9406
|
const ns2 = useNamespace$1("select");
|
|
9558
|
-
const dropdownCls =
|
|
9559
|
-
[ns2.e("dropdown")]: true,
|
|
9560
|
-
[ns2.em("dropdown", "multiple")]: props.multiple
|
|
9561
|
-
};
|
|
9407
|
+
const dropdownCls = ns2.e("dropdown");
|
|
9562
9408
|
const listCls = {
|
|
9563
9409
|
[ns2.e("dropdown-list")]: true,
|
|
9564
9410
|
[scrollbarNs.b()]: true
|
|
@@ -9570,8 +9416,17 @@ var Select = defineComponent({
|
|
|
9570
9416
|
toggleChange
|
|
9571
9417
|
});
|
|
9572
9418
|
const isRender = ref(false);
|
|
9573
|
-
|
|
9574
|
-
|
|
9419
|
+
const position = ref(["bottom-start", "top-start"]);
|
|
9420
|
+
const dropdownWidth = ref("0");
|
|
9421
|
+
const updateDropdownWidth = () => {
|
|
9422
|
+
var _a;
|
|
9423
|
+
dropdownWidth.value = ((_a = originRef == null ? void 0 : originRef.value) == null ? void 0 : _a.clientWidth) ? originRef.value.clientWidth + "px" : "100%";
|
|
9424
|
+
};
|
|
9425
|
+
watch(selectRef, (val) => {
|
|
9426
|
+
if (val) {
|
|
9427
|
+
originRef.value = val.$el;
|
|
9428
|
+
updateDropdownWidth();
|
|
9429
|
+
}
|
|
9575
9430
|
});
|
|
9576
9431
|
const scrollToBottom = () => {
|
|
9577
9432
|
const compareHeight = dropdownContainer.value.scrollHeight - dropdownContainer.value.clientHeight;
|
|
@@ -9581,18 +9436,22 @@ var Select = defineComponent({
|
|
|
9581
9436
|
}
|
|
9582
9437
|
};
|
|
9583
9438
|
onMounted(() => {
|
|
9439
|
+
isRender.value = true;
|
|
9440
|
+
updateDropdownWidth();
|
|
9441
|
+
window.addEventListener("resize", updateDropdownWidth);
|
|
9584
9442
|
nextTick(() => {
|
|
9585
9443
|
dropdownContainer.value.addEventListener("scroll", scrollToBottom);
|
|
9586
9444
|
});
|
|
9587
9445
|
});
|
|
9446
|
+
onUnmounted(() => {
|
|
9447
|
+
window.removeEventListener("resize", updateDropdownWidth);
|
|
9448
|
+
});
|
|
9588
9449
|
provide(SELECT_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
|
|
9589
9450
|
selectDisabled,
|
|
9590
9451
|
selectSize,
|
|
9591
9452
|
isOpen,
|
|
9592
|
-
isSelectFocus,
|
|
9593
9453
|
selectedOptions,
|
|
9594
9454
|
filterQuery,
|
|
9595
|
-
dropdownWidth,
|
|
9596
9455
|
valueChange,
|
|
9597
9456
|
handleClear,
|
|
9598
9457
|
updateInjectOptions,
|
|
@@ -9606,7 +9465,7 @@ var Select = defineComponent({
|
|
|
9606
9465
|
"class": selectCls.value,
|
|
9607
9466
|
"onClick": withModifiers(() => {
|
|
9608
9467
|
toggleChange(!isOpen.value);
|
|
9609
|
-
}, [])
|
|
9468
|
+
}, ["stop"])
|
|
9610
9469
|
}, [createVNode(SelectContent, {
|
|
9611
9470
|
"ref": selectRef
|
|
9612
9471
|
}, null), createVNode(Teleport, {
|
|
@@ -9620,9 +9479,9 @@ var Select = defineComponent({
|
|
|
9620
9479
|
"onUpdate:modelValue": ($event) => isRender.value = $event,
|
|
9621
9480
|
"ref": dropdownRef,
|
|
9622
9481
|
"origin": originRef.value,
|
|
9482
|
+
"align": "start",
|
|
9623
9483
|
"offset": 4,
|
|
9624
|
-
"
|
|
9625
|
-
"position": props.position,
|
|
9484
|
+
"position": position.value,
|
|
9626
9485
|
"style": {
|
|
9627
9486
|
visibility: isOpen.value ? "visible" : "hidden",
|
|
9628
9487
|
"z-index": isOpen.value ? "var(--devui-z-index-dropdown, 1052)" : -1
|
|
@@ -9633,14 +9492,11 @@ var Select = defineComponent({
|
|
|
9633
9492
|
return [createVNode("div", {
|
|
9634
9493
|
"class": dropdownCls,
|
|
9635
9494
|
"style": {
|
|
9636
|
-
width: `${dropdownWidth.value}
|
|
9495
|
+
width: `${dropdownWidth.value}`,
|
|
9637
9496
|
visibility: isOpen.value ? "visible" : "hidden"
|
|
9638
9497
|
}
|
|
9639
9498
|
}, [withDirectives(createVNode("ul", {
|
|
9640
9499
|
"class": listCls,
|
|
9641
|
-
"style": {
|
|
9642
|
-
padding: isShowEmptyText.value ? "0" : "12px"
|
|
9643
|
-
},
|
|
9644
9500
|
"ref": dropdownContainer
|
|
9645
9501
|
}, [isShowCreateOption.value && createVNode(Option, {
|
|
9646
9502
|
"value": filterQuery.value,
|
|
@@ -9660,8 +9516,7 @@ var Select = defineComponent({
|
|
|
9660
9516
|
default: () => [props.multiple ? createVNode(Checkbox, {
|
|
9661
9517
|
"modelValue": item._checked,
|
|
9662
9518
|
"label": item.name,
|
|
9663
|
-
"disabled": isDisabled(item)
|
|
9664
|
-
"class": "select-checkbox"
|
|
9519
|
+
"disabled": isDisabled(item)
|
|
9665
9520
|
}, null) : item.name || item.value]
|
|
9666
9521
|
}))]), [[vShow, !isLoading.value]]), isShowEmptyText.value && createVNode("div", null, [((_c = ctx.slots) == null ? void 0 : _c.empty) && ctx.slots.empty(), !((_d = ctx.slots) == null ? void 0 : _d.empty) && createVNode("p", {
|
|
9667
9522
|
"class": dropdownEmptyCls
|