vue-devui 1.6.15 → 1.6.17
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 +41 -4
- package/auto-complete/index.umd.js +12 -12
- package/breadcrumb/index.es.js +40 -3
- package/breadcrumb/index.umd.js +1 -1
- package/category-search/index.es.js +74 -6
- package/category-search/index.umd.js +21 -21
- package/checkbox/index.es.js +41 -4
- package/checkbox/index.umd.js +16 -16
- package/code-review/index.es.js +41 -4
- package/code-review/index.umd.js +17 -17
- package/data-grid/index.es.js +41 -4
- package/data-grid/index.umd.js +14 -14
- package/date-picker-pro/index.es.js +41 -4
- package/date-picker-pro/index.umd.js +8 -8
- package/dropdown/index.es.js +40 -3
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.es.js +48 -8
- package/editable-select/index.umd.js +15 -15
- package/editor-md/index.es.js +50 -6
- package/editor-md/index.umd.js +26 -26
- package/form/index.es.js +41 -4
- package/form/index.umd.js +14 -14
- package/input/index.es.js +40 -3
- package/input/index.umd.js +19 -19
- package/input-number/index.es.js +41 -4
- package/input-number/index.umd.js +18 -18
- package/mention/index.es.js +41 -4
- package/mention/index.umd.js +19 -19
- package/message/index.es.js +13 -13
- package/message/index.umd.js +1 -1
- package/modal/index.es.js +40 -3
- package/modal/index.umd.js +2 -2
- package/overlay/index.es.js +41 -4
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -1
- package/pagination/index.es.js +58 -21
- package/pagination/index.umd.js +17 -17
- package/pagination/style.css +1 -1
- package/popover/index.es.js +41 -4
- package/popover/index.umd.js +9 -9
- package/radio/index.es.js +41 -4
- package/radio/index.umd.js +17 -17
- package/search/index.es.js +41 -4
- package/search/index.umd.js +17 -17
- package/select/index.es.js +58 -21
- package/select/index.umd.js +19 -19
- package/select/style.css +1 -1
- package/splitter/index.es.js +41 -4
- package/splitter/index.umd.js +15 -15
- package/style.css +1 -1
- package/switch/index.es.js +41 -4
- package/switch/index.umd.js +14 -14
- package/table/index.es.js +40 -3
- package/table/index.umd.js +15 -15
- package/textarea/index.es.js +41 -4
- package/textarea/index.umd.js +16 -16
- package/time-picker/index.es.js +40 -3
- package/time-picker/index.umd.js +15 -15
- package/time-select/index.es.js +58 -21
- package/time-select/index.umd.js +17 -17
- package/time-select/style.css +1 -1
- package/tooltip/index.es.js +41 -4
- package/tooltip/index.umd.js +12 -12
- package/tree/index.es.js +40 -3
- package/tree/index.umd.js +10 -10
- package/types/category-search/src/category-search-types.d.ts +5 -0
- package/types/editable-select/src/editable-select-types.d.ts +3 -0
- package/types/overlay/src/flexible-overlay/flexible-overlay-types.d.ts +5 -6
- package/types/overlay/src/flexible-overlay/index.d.ts +9 -0
- package/types/overlay/src/flexible-overlay/use-flexible-overlay.d.ts +11 -2
- package/types/select/src/composables/use-select-content.d.ts +21 -2
- package/types/select/src/select-types.d.ts +7 -44
- package/types/select/src/use-select.d.ts +26 -2
- package/vue-devui.es.js +122 -44
- package/vue-devui.umd.js +74 -74
package/select/index.es.js
CHANGED
|
@@ -33,7 +33,7 @@ var __publicField = (obj, key, value) => {
|
|
|
33
33
|
__defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
|
-
import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode,
|
|
36
|
+
import { defineComponent, watch, provide, reactive, toRefs, createVNode, onUnmounted, Transition, mergeProps, ref, computed, unref, nextTick, withModifiers, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, onMounted, Teleport, createTextVNode, onBeforeUnmount, toRef, onBeforeMount, vShow, resolveComponent, getCurrentInstance, render, resolveDirective } from "vue";
|
|
37
37
|
import { onClickOutside } from "@vueuse/core";
|
|
38
38
|
import "clipboard";
|
|
39
39
|
import { offset, flip, arrow, computePosition } from "@floating-ui/dom";
|
|
@@ -5833,6 +5833,10 @@ const flexibleOverlayProps = {
|
|
|
5833
5833
|
clickEventBubble: {
|
|
5834
5834
|
type: Boolean,
|
|
5835
5835
|
default: false
|
|
5836
|
+
},
|
|
5837
|
+
fitOriginWidth: {
|
|
5838
|
+
type: Boolean,
|
|
5839
|
+
default: false
|
|
5836
5840
|
}
|
|
5837
5841
|
};
|
|
5838
5842
|
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
@@ -5855,9 +5859,18 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
5855
5859
|
return { x, y };
|
|
5856
5860
|
}
|
|
5857
5861
|
function useOverlay(props, emit) {
|
|
5858
|
-
const { position, showArrow } = toRefs(props);
|
|
5862
|
+
const { fitOriginWidth, position, showArrow } = toRefs(props);
|
|
5859
5863
|
const overlayRef = ref();
|
|
5860
5864
|
const arrowRef = ref();
|
|
5865
|
+
const overlayWidth = ref(0);
|
|
5866
|
+
let originObserver;
|
|
5867
|
+
const styles = computed(() => {
|
|
5868
|
+
if (fitOriginWidth.value) {
|
|
5869
|
+
return { width: overlayWidth.value + "px" };
|
|
5870
|
+
} else {
|
|
5871
|
+
return {};
|
|
5872
|
+
}
|
|
5873
|
+
});
|
|
5861
5874
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
5862
5875
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
5863
5876
|
const staticSide = {
|
|
@@ -5902,21 +5915,43 @@ function useOverlay(props, emit) {
|
|
|
5902
5915
|
updatePosition();
|
|
5903
5916
|
}
|
|
5904
5917
|
};
|
|
5918
|
+
const updateWidth = (originEl) => {
|
|
5919
|
+
overlayWidth.value = originEl.getBoundingClientRect().width;
|
|
5920
|
+
updatePosition();
|
|
5921
|
+
};
|
|
5922
|
+
const observeOrigin = () => {
|
|
5923
|
+
var _a, _b;
|
|
5924
|
+
if (fitOriginWidth.value && typeof window !== "undefined") {
|
|
5925
|
+
const originEl = (_b = (_a = props.origin) == null ? void 0 : _a.$el) != null ? _b : props.origin;
|
|
5926
|
+
if (originEl) {
|
|
5927
|
+
originObserver = new window.ResizeObserver(() => updateWidth(originEl));
|
|
5928
|
+
originObserver.observe(originEl);
|
|
5929
|
+
}
|
|
5930
|
+
}
|
|
5931
|
+
};
|
|
5932
|
+
const unobserveOrigin = () => {
|
|
5933
|
+
var _a, _b;
|
|
5934
|
+
const originEl = (_b = (_a = props.origin) == null ? void 0 : _a.$el) != null ? _b : props.origin;
|
|
5935
|
+
originEl && (originObserver == null ? void 0 : originObserver.unobserve(originEl));
|
|
5936
|
+
};
|
|
5905
5937
|
watch(() => props.modelValue, () => {
|
|
5906
5938
|
if (props.modelValue && props.origin) {
|
|
5907
5939
|
nextTick(updatePosition);
|
|
5908
5940
|
window.addEventListener("scroll", scrollCallback, true);
|
|
5909
5941
|
window.addEventListener("resize", updatePosition);
|
|
5942
|
+
observeOrigin();
|
|
5910
5943
|
} else {
|
|
5911
5944
|
window.removeEventListener("scroll", scrollCallback, true);
|
|
5912
5945
|
window.removeEventListener("resize", updatePosition);
|
|
5946
|
+
unobserveOrigin();
|
|
5913
5947
|
}
|
|
5914
5948
|
});
|
|
5915
5949
|
onUnmounted(() => {
|
|
5916
5950
|
window.removeEventListener("scroll", scrollCallback, true);
|
|
5917
5951
|
window.removeEventListener("resize", updatePosition);
|
|
5952
|
+
unobserveOrigin();
|
|
5918
5953
|
});
|
|
5919
|
-
return { arrowRef, overlayRef, updatePosition };
|
|
5954
|
+
return { arrowRef, overlayRef, styles, updatePosition };
|
|
5920
5955
|
}
|
|
5921
5956
|
var flexibleOverlay = "";
|
|
5922
5957
|
const FlexibleOverlay = defineComponent({
|
|
@@ -5937,6 +5972,7 @@ const FlexibleOverlay = defineComponent({
|
|
|
5937
5972
|
const {
|
|
5938
5973
|
arrowRef,
|
|
5939
5974
|
overlayRef,
|
|
5975
|
+
styles,
|
|
5940
5976
|
updatePosition
|
|
5941
5977
|
} = useOverlay(props, emit);
|
|
5942
5978
|
expose({
|
|
@@ -5946,7 +5982,8 @@ const FlexibleOverlay = defineComponent({
|
|
|
5946
5982
|
var _a;
|
|
5947
5983
|
return props.modelValue && createVNode("div", mergeProps({
|
|
5948
5984
|
"ref": overlayRef,
|
|
5949
|
-
"class": ns2.b()
|
|
5985
|
+
"class": ns2.b(),
|
|
5986
|
+
"style": styles.value
|
|
5950
5987
|
}, attrs, {
|
|
5951
5988
|
"onClick": withModifiers(() => ({}), [clickEventBubble.value ? "" : "stop"]),
|
|
5952
5989
|
"onPointerup": withModifiers(() => ({}), ["stop"])
|
|
@@ -8223,6 +8260,13 @@ const selectProps = {
|
|
|
8223
8260
|
showGlowStyle: {
|
|
8224
8261
|
type: Boolean,
|
|
8225
8262
|
default: true
|
|
8263
|
+
},
|
|
8264
|
+
menuClass: {
|
|
8265
|
+
type: String,
|
|
8266
|
+
default: ""
|
|
8267
|
+
},
|
|
8268
|
+
maxLength: {
|
|
8269
|
+
type: Number
|
|
8226
8270
|
}
|
|
8227
8271
|
};
|
|
8228
8272
|
const optionProps = {
|
|
@@ -9213,6 +9257,7 @@ function useSelectContent() {
|
|
|
9213
9257
|
}
|
|
9214
9258
|
};
|
|
9215
9259
|
return {
|
|
9260
|
+
select: select2,
|
|
9216
9261
|
searchQuery,
|
|
9217
9262
|
selectedData,
|
|
9218
9263
|
isSelectDisable,
|
|
@@ -9248,6 +9293,7 @@ var SelectContent = defineComponent({
|
|
|
9248
9293
|
const multipleCls = ns2.e("multiple");
|
|
9249
9294
|
const multipleInputCls = ns2.em("multiple", "input");
|
|
9250
9295
|
const {
|
|
9296
|
+
select: select2,
|
|
9251
9297
|
searchQuery,
|
|
9252
9298
|
selectedData,
|
|
9253
9299
|
isSelectDisable,
|
|
@@ -9311,6 +9357,7 @@ var SelectContent = defineComponent({
|
|
|
9311
9357
|
"placeholder": placeholder.value,
|
|
9312
9358
|
"readonly": isReadOnly.value,
|
|
9313
9359
|
"disabled": isSelectDisable.value,
|
|
9360
|
+
"maxlength": select2 == null ? void 0 : select2.maxLength,
|
|
9314
9361
|
"onInput": queryFilter,
|
|
9315
9362
|
"onFocus": onFocus,
|
|
9316
9363
|
"onBlur": onBlur
|
|
@@ -9322,6 +9369,7 @@ var SelectContent = defineComponent({
|
|
|
9322
9369
|
"placeholder": placeholder.value,
|
|
9323
9370
|
"readonly": isReadOnly.value,
|
|
9324
9371
|
"disabled": isSelectDisable.value,
|
|
9372
|
+
"maxlength": select2 == null ? void 0 : select2.maxLength,
|
|
9325
9373
|
"onFocus": onFocus,
|
|
9326
9374
|
"onBlur": onBlur,
|
|
9327
9375
|
"onInput": queryFilter
|
|
@@ -9620,7 +9668,6 @@ var Select = defineComponent({
|
|
|
9620
9668
|
const isRender = ref(false);
|
|
9621
9669
|
const currentPosition = ref("bottom");
|
|
9622
9670
|
const position = ref(["bottom-start", "top-start"]);
|
|
9623
|
-
const dropdownWidth = ref("0");
|
|
9624
9671
|
const handlePositionChange = (pos) => {
|
|
9625
9672
|
currentPosition.value = pos.split("-")[0] === "top" ? "top" : "bottom";
|
|
9626
9673
|
};
|
|
@@ -9628,14 +9675,9 @@ var Select = defineComponent({
|
|
|
9628
9675
|
transformOrigin: currentPosition.value === "top" ? "0% 100%" : "0% 0%",
|
|
9629
9676
|
"z-index": "var(--devui-z-index-dropdown, 1052)"
|
|
9630
9677
|
}));
|
|
9631
|
-
const updateDropdownWidth = () => {
|
|
9632
|
-
var _a;
|
|
9633
|
-
dropdownWidth.value = ((_a = originRef == null ? void 0 : originRef.value) == null ? void 0 : _a.clientWidth) ? originRef.value.clientWidth + "px" : "100%";
|
|
9634
|
-
};
|
|
9635
9678
|
watch(selectRef, (val) => {
|
|
9636
9679
|
if (val) {
|
|
9637
9680
|
originRef.value = val.$el;
|
|
9638
|
-
updateDropdownWidth();
|
|
9639
9681
|
}
|
|
9640
9682
|
});
|
|
9641
9683
|
const scrollToBottom = () => {
|
|
@@ -9647,15 +9689,11 @@ var Select = defineComponent({
|
|
|
9647
9689
|
};
|
|
9648
9690
|
onMounted(() => {
|
|
9649
9691
|
isRender.value = true;
|
|
9650
|
-
updateDropdownWidth();
|
|
9651
|
-
window.addEventListener("resize", updateDropdownWidth);
|
|
9652
9692
|
nextTick(() => {
|
|
9653
|
-
|
|
9693
|
+
var _a;
|
|
9694
|
+
(_a = dropdownContainer.value) == null ? void 0 : _a.addEventListener("scroll", scrollToBottom);
|
|
9654
9695
|
});
|
|
9655
9696
|
});
|
|
9656
|
-
onUnmounted(() => {
|
|
9657
|
-
window.removeEventListener("resize", updateDropdownWidth);
|
|
9658
|
-
});
|
|
9659
9697
|
provide(SELECT_TOKEN, reactive(__spreadProps(__spreadValues({}, toRefs(props)), {
|
|
9660
9698
|
selectDisabled,
|
|
9661
9699
|
selectSize,
|
|
@@ -9691,17 +9729,16 @@ var Select = defineComponent({
|
|
|
9691
9729
|
"origin": originRef.value,
|
|
9692
9730
|
"align": "start",
|
|
9693
9731
|
"offset": 4,
|
|
9732
|
+
"fit-origin-width": true,
|
|
9694
9733
|
"position": position.value,
|
|
9695
9734
|
"onPositionChange": handlePositionChange,
|
|
9696
|
-
"style": styles.value
|
|
9735
|
+
"style": styles.value,
|
|
9736
|
+
"class": props.menuClass
|
|
9697
9737
|
}, {
|
|
9698
9738
|
default: () => {
|
|
9699
9739
|
var _a, _b, _c, _d;
|
|
9700
9740
|
return [withDirectives(createVNode("div", {
|
|
9701
|
-
"class": dropdownCls
|
|
9702
|
-
"style": {
|
|
9703
|
-
width: `${dropdownWidth.value}`
|
|
9704
|
-
}
|
|
9741
|
+
"class": dropdownCls
|
|
9705
9742
|
}, [withDirectives(createVNode("ul", {
|
|
9706
9743
|
"class": listCls,
|
|
9707
9744
|
"ref": dropdownContainer
|