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/time-picker/index.es.js
CHANGED
|
@@ -36,7 +36,7 @@ var __publicField = (obj, key, value) => {
|
|
|
36
36
|
import { defineComponent, toRefs, computed, createVNode, resolveDynamicComponent, mergeProps, ref, reactive, onMounted, onBeforeUnmount, onUnmounted, Fragment, h, render, inject, withDirectives, resolveComponent, vShow, provide, toRef, getCurrentInstance, watch, withModifiers, isVNode, Transition, unref, nextTick, Comment, Text, cloneVNode, Teleport, createTextVNode, shallowRef, 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
|
const timePickerProps = {
|
|
41
41
|
modelValue: {
|
|
42
42
|
type: String,
|
|
@@ -5047,7 +5047,7 @@ var lodash = { exports: {} };
|
|
|
5047
5047
|
var delay = baseRest(function(func, wait, args) {
|
|
5048
5048
|
return baseDelay(func, toNumber(wait) || 0, args);
|
|
5049
5049
|
});
|
|
5050
|
-
function
|
|
5050
|
+
function flip2(func) {
|
|
5051
5051
|
return createWrap(func, WRAP_FLIP_FLAG);
|
|
5052
5052
|
}
|
|
5053
5053
|
function memoize(func, resolver) {
|
|
@@ -6171,7 +6171,7 @@ var lodash = { exports: {} };
|
|
|
6171
6171
|
lodash2.flatten = flatten;
|
|
6172
6172
|
lodash2.flattenDeep = flattenDeep;
|
|
6173
6173
|
lodash2.flattenDepth = flattenDepth;
|
|
6174
|
-
lodash2.flip =
|
|
6174
|
+
lodash2.flip = flip2;
|
|
6175
6175
|
lodash2.flow = flow;
|
|
6176
6176
|
lodash2.flowRight = flowRight;
|
|
6177
6177
|
lodash2.fromPairs = fromPairs;
|
|
@@ -7407,16 +7407,6 @@ const flexibleOverlayProps = {
|
|
|
7407
7407
|
default: false
|
|
7408
7408
|
}
|
|
7409
7409
|
};
|
|
7410
|
-
function getScrollParent(element) {
|
|
7411
|
-
const overflowRegex = /(auto|scroll|hidden)/;
|
|
7412
|
-
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
7413
|
-
const style = window.getComputedStyle(parent);
|
|
7414
|
-
if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
|
|
7415
|
-
return parent;
|
|
7416
|
-
}
|
|
7417
|
-
}
|
|
7418
|
-
return window;
|
|
7419
|
-
}
|
|
7420
7410
|
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
7421
7411
|
let { x, y } = point;
|
|
7422
7412
|
if (!isArrowCenter) {
|
|
@@ -7437,9 +7427,9 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
7437
7427
|
return { x, y };
|
|
7438
7428
|
}
|
|
7439
7429
|
function useOverlay(props, emit) {
|
|
7430
|
+
const { position, showArrow } = toRefs(props);
|
|
7440
7431
|
const overlayRef = ref();
|
|
7441
7432
|
const arrowRef = ref();
|
|
7442
|
-
let originParent = null;
|
|
7443
7433
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
7444
7434
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
7445
7435
|
const staticSide = {
|
|
@@ -7460,51 +7450,42 @@ function useOverlay(props, emit) {
|
|
|
7460
7450
|
const hostEl = props.origin;
|
|
7461
7451
|
const overlayEl = unref(overlayRef.value);
|
|
7462
7452
|
const arrowEl = unref(arrowRef.value);
|
|
7463
|
-
const
|
|
7464
|
-
|
|
7465
|
-
|
|
7466
|
-
|
|
7467
|
-
|
|
7468
|
-
})
|
|
7469
|
-
];
|
|
7470
|
-
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
7471
|
-
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
7472
|
-
if (!overlayEl) {
|
|
7473
|
-
return;
|
|
7453
|
+
const [mainPosition, ...fallbackPosition] = position.value;
|
|
7454
|
+
const middleware = [offset(props.offset)];
|
|
7455
|
+
middleware.push(fallbackPosition.length ? flip({ fallbackPlacements: fallbackPosition }) : flip());
|
|
7456
|
+
if (showArrow.value) {
|
|
7457
|
+
middleware.push(arrow({ element: arrowRef.value }));
|
|
7474
7458
|
}
|
|
7475
7459
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
7476
7460
|
strategy: "fixed",
|
|
7461
|
+
placement: mainPosition,
|
|
7477
7462
|
middleware
|
|
7478
7463
|
});
|
|
7479
7464
|
let applyX = x;
|
|
7480
7465
|
let applyY = y;
|
|
7481
|
-
if (props.shiftOffset !== void 0) {
|
|
7482
|
-
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
7483
|
-
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
7484
|
-
shiftX > 0 && (applyX += props.shiftOffset);
|
|
7485
|
-
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
7486
|
-
shiftY > 0 && (applyY += props.shiftOffset);
|
|
7487
|
-
}
|
|
7488
7466
|
emit("positionChange", placement);
|
|
7489
7467
|
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
7490
7468
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
7491
7469
|
};
|
|
7470
|
+
const scrollCallback = (e) => {
|
|
7471
|
+
var _a, _b;
|
|
7472
|
+
const scrollElement = e.target;
|
|
7473
|
+
if (scrollElement == null ? void 0 : scrollElement.contains((_b = (_a = props.origin) == null ? void 0 : _a.$el) != null ? _b : props.origin)) {
|
|
7474
|
+
updatePosition();
|
|
7475
|
+
}
|
|
7476
|
+
};
|
|
7492
7477
|
watch(() => props.modelValue, () => {
|
|
7493
7478
|
if (props.modelValue && props.origin) {
|
|
7494
|
-
originParent = getScrollParent(props.origin);
|
|
7495
7479
|
nextTick(updatePosition);
|
|
7496
|
-
|
|
7497
|
-
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
7480
|
+
window.addEventListener("scroll", scrollCallback, true);
|
|
7498
7481
|
window.addEventListener("resize", updatePosition);
|
|
7499
7482
|
} else {
|
|
7500
|
-
|
|
7501
|
-
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
7483
|
+
window.removeEventListener("scroll", scrollCallback, true);
|
|
7502
7484
|
window.removeEventListener("resize", updatePosition);
|
|
7503
7485
|
}
|
|
7504
7486
|
});
|
|
7505
7487
|
onUnmounted(() => {
|
|
7506
|
-
|
|
7507
|
-
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
7488
|
+
window.removeEventListener("scroll", scrollCallback, true);
|
|
7508
7489
|
window.removeEventListener("resize", updatePosition);
|
|
7509
7490
|
});
|
|
7510
7491
|
return { arrowRef, overlayRef, updatePosition };
|