vue-devui 1.6.13 → 1.6.15
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 +20 -39
- package/auto-complete/index.umd.js +10 -10
- package/breadcrumb/index.es.js +25 -39
- package/breadcrumb/index.umd.js +1 -1
- package/category-search/index.es.js +27 -41
- package/category-search/index.umd.js +13 -13
- package/category-search/style.css +1 -1
- package/checkbox/index.es.js +20 -39
- package/checkbox/index.umd.js +11 -11
- package/code-review/index.es.js +20 -39
- package/code-review/index.umd.js +17 -17
- package/data-grid/index.es.js +27 -41
- package/data-grid/index.umd.js +12 -12
- package/date-picker-pro/index.es.js +20 -39
- package/date-picker-pro/index.umd.js +13 -13
- package/dropdown/index.es.js +25 -39
- package/dropdown/index.umd.js +1 -1
- package/editable-select/index.es.js +20 -39
- package/editable-select/index.umd.js +14 -14
- package/editor-md/index.es.js +27 -41
- package/editor-md/index.umd.js +23 -23
- package/form/index.es.js +20 -39
- package/form/index.umd.js +12 -12
- package/input/index.es.js +20 -39
- package/input/index.umd.js +10 -10
- package/input-number/index.es.js +20 -39
- package/input-number/index.umd.js +18 -18
- package/mention/index.es.js +20 -39
- package/mention/index.umd.js +18 -18
- package/modal/index.es.js +18 -37
- package/modal/index.umd.js +2 -2
- package/overlay/index.es.js +18 -37
- package/overlay/index.umd.js +1 -1
- package/package.json +2 -2
- package/pagination/index.es.js +27 -41
- package/pagination/index.umd.js +13 -13
- package/popover/index.es.js +20 -39
- package/popover/index.umd.js +14 -14
- package/radio/index.es.js +20 -39
- package/radio/index.umd.js +17 -17
- package/search/index.es.js +20 -39
- package/search/index.umd.js +12 -12
- package/select/index.es.js +20 -39
- package/select/index.umd.js +16 -16
- package/splitter/index.es.js +20 -39
- package/splitter/index.umd.js +16 -16
- package/style.css +1 -1
- package/switch/index.es.js +20 -39
- package/switch/index.umd.js +12 -12
- package/table/index.es.js +27 -41
- package/table/index.umd.js +14 -14
- package/textarea/index.es.js +20 -39
- package/textarea/index.umd.js +15 -15
- package/time-picker/index.es.js +20 -39
- package/time-picker/index.umd.js +16 -16
- package/time-select/index.es.js +20 -39
- package/time-select/index.umd.js +10 -10
- package/tooltip/index.es.js +20 -39
- package/tooltip/index.umd.js +17 -17
- package/tree/index.es.js +20 -39
- package/tree/index.umd.js +12 -12
- package/types/dropdown/src/dropdown-types.d.ts +4 -0
- package/types/dropdown/src/dropdown.d.ts +9 -0
- package/types/tooltip/src/tooltip.d.ts +1 -1
- package/vue-devui.es.js +26 -40
- package/vue-devui.umd.js +63 -63
package/select/index.es.js
CHANGED
|
@@ -36,7 +36,7 @@ var __publicField = (obj, key, value) => {
|
|
|
36
36
|
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, toRef, onBeforeMount, vShow, resolveComponent, getCurrentInstance, render, resolveDirective } from "vue";
|
|
37
37
|
import { onClickOutside } from "@vueuse/core";
|
|
38
38
|
import "clipboard";
|
|
39
|
-
import { offset,
|
|
39
|
+
import { offset, flip, arrow, computePosition } from "@floating-ui/dom";
|
|
40
40
|
function className(classStr, classOpt) {
|
|
41
41
|
let classname = classStr;
|
|
42
42
|
if (typeof classOpt === "object") {
|
|
@@ -3916,7 +3916,7 @@ var lodash = { exports: {} };
|
|
|
3916
3916
|
var delay = baseRest(function(func, wait, args) {
|
|
3917
3917
|
return baseDelay(func, toNumber(wait) || 0, args);
|
|
3918
3918
|
});
|
|
3919
|
-
function
|
|
3919
|
+
function flip2(func) {
|
|
3920
3920
|
return createWrap(func, WRAP_FLIP_FLAG);
|
|
3921
3921
|
}
|
|
3922
3922
|
function memoize(func, resolver) {
|
|
@@ -5040,7 +5040,7 @@ var lodash = { exports: {} };
|
|
|
5040
5040
|
lodash2.flatten = flatten;
|
|
5041
5041
|
lodash2.flattenDeep = flattenDeep;
|
|
5042
5042
|
lodash2.flattenDepth = flattenDepth;
|
|
5043
|
-
lodash2.flip =
|
|
5043
|
+
lodash2.flip = flip2;
|
|
5044
5044
|
lodash2.flow = flow;
|
|
5045
5045
|
lodash2.flowRight = flowRight;
|
|
5046
5046
|
lodash2.fromPairs = fromPairs;
|
|
@@ -5835,16 +5835,6 @@ const flexibleOverlayProps = {
|
|
|
5835
5835
|
default: false
|
|
5836
5836
|
}
|
|
5837
5837
|
};
|
|
5838
|
-
function getScrollParent(element) {
|
|
5839
|
-
const overflowRegex = /(auto|scroll|hidden)/;
|
|
5840
|
-
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
5841
|
-
const style = window.getComputedStyle(parent);
|
|
5842
|
-
if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
|
|
5843
|
-
return parent;
|
|
5844
|
-
}
|
|
5845
|
-
}
|
|
5846
|
-
return window;
|
|
5847
|
-
}
|
|
5848
5838
|
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
5849
5839
|
let { x, y } = point;
|
|
5850
5840
|
if (!isArrowCenter) {
|
|
@@ -5865,9 +5855,9 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
5865
5855
|
return { x, y };
|
|
5866
5856
|
}
|
|
5867
5857
|
function useOverlay(props, emit) {
|
|
5858
|
+
const { position, showArrow } = toRefs(props);
|
|
5868
5859
|
const overlayRef = ref();
|
|
5869
5860
|
const arrowRef = ref();
|
|
5870
|
-
let originParent = null;
|
|
5871
5861
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
5872
5862
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
5873
5863
|
const staticSide = {
|
|
@@ -5888,51 +5878,42 @@ function useOverlay(props, emit) {
|
|
|
5888
5878
|
const hostEl = props.origin;
|
|
5889
5879
|
const overlayEl = unref(overlayRef.value);
|
|
5890
5880
|
const arrowEl = unref(arrowRef.value);
|
|
5891
|
-
const
|
|
5892
|
-
|
|
5893
|
-
|
|
5894
|
-
|
|
5895
|
-
|
|
5896
|
-
})
|
|
5897
|
-
];
|
|
5898
|
-
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
5899
|
-
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
5900
|
-
if (!overlayEl) {
|
|
5901
|
-
return;
|
|
5881
|
+
const [mainPosition, ...fallbackPosition] = position.value;
|
|
5882
|
+
const middleware = [offset(props.offset)];
|
|
5883
|
+
middleware.push(fallbackPosition.length ? flip({ fallbackPlacements: fallbackPosition }) : flip());
|
|
5884
|
+
if (showArrow.value) {
|
|
5885
|
+
middleware.push(arrow({ element: arrowRef.value }));
|
|
5902
5886
|
}
|
|
5903
5887
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
5904
5888
|
strategy: "fixed",
|
|
5889
|
+
placement: mainPosition,
|
|
5905
5890
|
middleware
|
|
5906
5891
|
});
|
|
5907
5892
|
let applyX = x;
|
|
5908
5893
|
let applyY = y;
|
|
5909
|
-
if (props.shiftOffset !== void 0) {
|
|
5910
|
-
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
5911
|
-
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
5912
|
-
shiftX > 0 && (applyX += props.shiftOffset);
|
|
5913
|
-
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
5914
|
-
shiftY > 0 && (applyY += props.shiftOffset);
|
|
5915
|
-
}
|
|
5916
5894
|
emit("positionChange", placement);
|
|
5917
5895
|
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
5918
5896
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
5919
5897
|
};
|
|
5898
|
+
const scrollCallback = (e) => {
|
|
5899
|
+
var _a, _b;
|
|
5900
|
+
const scrollElement = e.target;
|
|
5901
|
+
if (scrollElement == null ? void 0 : scrollElement.contains((_b = (_a = props.origin) == null ? void 0 : _a.$el) != null ? _b : props.origin)) {
|
|
5902
|
+
updatePosition();
|
|
5903
|
+
}
|
|
5904
|
+
};
|
|
5920
5905
|
watch(() => props.modelValue, () => {
|
|
5921
5906
|
if (props.modelValue && props.origin) {
|
|
5922
|
-
originParent = getScrollParent(props.origin);
|
|
5923
5907
|
nextTick(updatePosition);
|
|
5924
|
-
|
|
5925
|
-
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
5908
|
+
window.addEventListener("scroll", scrollCallback, true);
|
|
5926
5909
|
window.addEventListener("resize", updatePosition);
|
|
5927
5910
|
} else {
|
|
5928
|
-
|
|
5929
|
-
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
5911
|
+
window.removeEventListener("scroll", scrollCallback, true);
|
|
5930
5912
|
window.removeEventListener("resize", updatePosition);
|
|
5931
5913
|
}
|
|
5932
5914
|
});
|
|
5933
5915
|
onUnmounted(() => {
|
|
5934
|
-
|
|
5935
|
-
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
5916
|
+
window.removeEventListener("scroll", scrollCallback, true);
|
|
5936
5917
|
window.removeEventListener("resize", updatePosition);
|
|
5937
5918
|
});
|
|
5938
5919
|
return { arrowRef, overlayRef, updatePosition };
|