vue-devui 1.6.14 → 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 +18 -37
- package/breadcrumb/index.umd.js +1 -1
- package/category-search/index.es.js +20 -39
- package/category-search/index.umd.js +12 -12
- 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 +20 -39
- package/data-grid/index.umd.js +9 -9
- package/date-picker-pro/index.es.js +20 -39
- package/date-picker-pro/index.umd.js +13 -13
- package/dropdown/index.es.js +18 -37
- 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 +20 -39
- package/editor-md/index.umd.js +22 -22
- 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 +20 -39
- package/pagination/index.umd.js +10 -10
- 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/switch/index.es.js +20 -39
- package/switch/index.umd.js +12 -12
- package/table/index.es.js +20 -39
- package/table/index.umd.js +10 -10
- 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/vue-devui.es.js +19 -38
- package/vue-devui.umd.js +63 -63
package/data-grid/index.es.js
CHANGED
|
@@ -34,7 +34,7 @@ var __publicField = (obj, key, value) => {
|
|
|
34
34
|
return value;
|
|
35
35
|
};
|
|
36
36
|
import { watch, onUnmounted, defineComponent, toRefs, createVNode, Transition, mergeProps, ref, unref, nextTick, withModifiers, provide, reactive, Comment, Text, h, Fragment, inject, withDirectives, cloneVNode, computed, onMounted, Teleport, createTextVNode, onBeforeUnmount, toRef, vShow, resolveDynamicComponent, render, resolveComponent, getCurrentInstance, isVNode, onBeforeMount } from "vue";
|
|
37
|
-
import { offset,
|
|
37
|
+
import { offset, flip, arrow, computePosition } from "@floating-ui/dom";
|
|
38
38
|
import "clipboard";
|
|
39
39
|
import { onClickOutside } from "@vueuse/core";
|
|
40
40
|
function createBem$1(namespace, element, modifier) {
|
|
@@ -180,16 +180,6 @@ const flexibleOverlayProps = {
|
|
|
180
180
|
default: false
|
|
181
181
|
}
|
|
182
182
|
};
|
|
183
|
-
function getScrollParent(element) {
|
|
184
|
-
const overflowRegex = /(auto|scroll|hidden)/;
|
|
185
|
-
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
186
|
-
const style = window.getComputedStyle(parent);
|
|
187
|
-
if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
|
|
188
|
-
return parent;
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
return window;
|
|
192
|
-
}
|
|
193
183
|
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
194
184
|
let { x, y } = point;
|
|
195
185
|
if (!isArrowCenter) {
|
|
@@ -210,9 +200,9 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
210
200
|
return { x, y };
|
|
211
201
|
}
|
|
212
202
|
function useOverlay(props, emit) {
|
|
203
|
+
const { position, showArrow } = toRefs(props);
|
|
213
204
|
const overlayRef = ref();
|
|
214
205
|
const arrowRef = ref();
|
|
215
|
-
let originParent = null;
|
|
216
206
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
217
207
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
218
208
|
const staticSide = {
|
|
@@ -233,51 +223,42 @@ function useOverlay(props, emit) {
|
|
|
233
223
|
const hostEl = props.origin;
|
|
234
224
|
const overlayEl = unref(overlayRef.value);
|
|
235
225
|
const arrowEl = unref(arrowRef.value);
|
|
236
|
-
const
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
})
|
|
242
|
-
];
|
|
243
|
-
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
244
|
-
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
245
|
-
if (!overlayEl) {
|
|
246
|
-
return;
|
|
226
|
+
const [mainPosition, ...fallbackPosition] = position.value;
|
|
227
|
+
const middleware = [offset(props.offset)];
|
|
228
|
+
middleware.push(fallbackPosition.length ? flip({ fallbackPlacements: fallbackPosition }) : flip());
|
|
229
|
+
if (showArrow.value) {
|
|
230
|
+
middleware.push(arrow({ element: arrowRef.value }));
|
|
247
231
|
}
|
|
248
232
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
249
233
|
strategy: "fixed",
|
|
234
|
+
placement: mainPosition,
|
|
250
235
|
middleware
|
|
251
236
|
});
|
|
252
237
|
let applyX = x;
|
|
253
238
|
let applyY = y;
|
|
254
|
-
if (props.shiftOffset !== void 0) {
|
|
255
|
-
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
256
|
-
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
257
|
-
shiftX > 0 && (applyX += props.shiftOffset);
|
|
258
|
-
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
259
|
-
shiftY > 0 && (applyY += props.shiftOffset);
|
|
260
|
-
}
|
|
261
239
|
emit("positionChange", placement);
|
|
262
240
|
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
263
241
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
264
242
|
};
|
|
243
|
+
const scrollCallback = (e) => {
|
|
244
|
+
var _a, _b;
|
|
245
|
+
const scrollElement = e.target;
|
|
246
|
+
if (scrollElement == null ? void 0 : scrollElement.contains((_b = (_a = props.origin) == null ? void 0 : _a.$el) != null ? _b : props.origin)) {
|
|
247
|
+
updatePosition();
|
|
248
|
+
}
|
|
249
|
+
};
|
|
265
250
|
watch(() => props.modelValue, () => {
|
|
266
251
|
if (props.modelValue && props.origin) {
|
|
267
|
-
originParent = getScrollParent(props.origin);
|
|
268
252
|
nextTick(updatePosition);
|
|
269
|
-
|
|
270
|
-
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
253
|
+
window.addEventListener("scroll", scrollCallback, true);
|
|
271
254
|
window.addEventListener("resize", updatePosition);
|
|
272
255
|
} else {
|
|
273
|
-
|
|
274
|
-
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
256
|
+
window.removeEventListener("scroll", scrollCallback, true);
|
|
275
257
|
window.removeEventListener("resize", updatePosition);
|
|
276
258
|
}
|
|
277
259
|
});
|
|
278
260
|
onUnmounted(() => {
|
|
279
|
-
|
|
280
|
-
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
261
|
+
window.removeEventListener("scroll", scrollCallback, true);
|
|
281
262
|
window.removeEventListener("resize", updatePosition);
|
|
282
263
|
});
|
|
283
264
|
return { arrowRef, overlayRef, updatePosition };
|
|
@@ -4381,7 +4362,7 @@ var lodash = { exports: {} };
|
|
|
4381
4362
|
var delay = baseRest(function(func, wait, args) {
|
|
4382
4363
|
return baseDelay(func, toNumber(wait) || 0, args);
|
|
4383
4364
|
});
|
|
4384
|
-
function
|
|
4365
|
+
function flip2(func) {
|
|
4385
4366
|
return createWrap(func, WRAP_FLIP_FLAG);
|
|
4386
4367
|
}
|
|
4387
4368
|
function memoize(func, resolver) {
|
|
@@ -5505,7 +5486,7 @@ var lodash = { exports: {} };
|
|
|
5505
5486
|
lodash2.flatten = flatten;
|
|
5506
5487
|
lodash2.flattenDeep = flattenDeep;
|
|
5507
5488
|
lodash2.flattenDepth = flattenDepth;
|
|
5508
|
-
lodash2.flip =
|
|
5489
|
+
lodash2.flip = flip2;
|
|
5509
5490
|
lodash2.flow = flow;
|
|
5510
5491
|
lodash2.flowRight = flowRight;
|
|
5511
5492
|
lodash2.fromPairs = fromPairs;
|