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/table/index.es.js
CHANGED
|
@@ -35,7 +35,7 @@ var __publicField = (obj, key, value) => {
|
|
|
35
35
|
};
|
|
36
36
|
import { computed, ref, watchEffect, watch, getCurrentInstance, unref, defineComponent, inject, createVNode, mergeProps, toRefs, onMounted, onUnmounted, Transition, nextTick, withModifiers, Comment, Text, h, Fragment, withDirectives, cloneVNode, provide, Teleport, vShow, resolveDynamicComponent, render, reactive, resolveComponent, toRef, createTextVNode, onBeforeUnmount, isVNode, onBeforeMount, onUpdated, resolveDirective } from "vue";
|
|
37
37
|
import "clipboard";
|
|
38
|
-
import { offset,
|
|
38
|
+
import { offset, flip, arrow, computePosition } from "@floating-ui/dom";
|
|
39
39
|
import { onClickOutside } from "@vueuse/core";
|
|
40
40
|
const tableProps = {
|
|
41
41
|
data: {
|
|
@@ -923,6 +923,10 @@ const dropdownProps = {
|
|
|
923
923
|
destroyOnHide: {
|
|
924
924
|
type: Boolean,
|
|
925
925
|
default: true
|
|
926
|
+
},
|
|
927
|
+
teleport: {
|
|
928
|
+
type: [String, Object],
|
|
929
|
+
default: "body"
|
|
926
930
|
}
|
|
927
931
|
};
|
|
928
932
|
const POPPER_TRIGGER_TOKEN = Symbol("popper-trigger");
|
|
@@ -1167,16 +1171,6 @@ const flexibleOverlayProps = {
|
|
|
1167
1171
|
default: false
|
|
1168
1172
|
}
|
|
1169
1173
|
};
|
|
1170
|
-
function getScrollParent(element) {
|
|
1171
|
-
const overflowRegex = /(auto|scroll|hidden)/;
|
|
1172
|
-
for (let parent = element; parent = parent.parentElement; parent.parentElement !== document.body) {
|
|
1173
|
-
const style = window.getComputedStyle(parent);
|
|
1174
|
-
if (overflowRegex.test(style.overflow + style.overflowX + style.overflowY)) {
|
|
1175
|
-
return parent;
|
|
1176
|
-
}
|
|
1177
|
-
}
|
|
1178
|
-
return window;
|
|
1179
|
-
}
|
|
1180
1174
|
function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
1181
1175
|
let { x, y } = point;
|
|
1182
1176
|
if (!isArrowCenter) {
|
|
@@ -1197,9 +1191,9 @@ function adjustArrowPosition(isArrowCenter, point, placement, originRect) {
|
|
|
1197
1191
|
return { x, y };
|
|
1198
1192
|
}
|
|
1199
1193
|
function useOverlay(props, emit) {
|
|
1194
|
+
const { position, showArrow } = toRefs(props);
|
|
1200
1195
|
const overlayRef = ref();
|
|
1201
1196
|
const arrowRef = ref();
|
|
1202
|
-
let originParent = null;
|
|
1203
1197
|
const updateArrowPosition = (arrowEl, placement, point, overlayEl) => {
|
|
1204
1198
|
const { x, y } = adjustArrowPosition(props.isArrowCenter, point, placement, overlayEl.getBoundingClientRect());
|
|
1205
1199
|
const staticSide = {
|
|
@@ -1220,51 +1214,42 @@ function useOverlay(props, emit) {
|
|
|
1220
1214
|
const hostEl = props.origin;
|
|
1221
1215
|
const overlayEl = unref(overlayRef.value);
|
|
1222
1216
|
const arrowEl = unref(arrowRef.value);
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
})
|
|
1229
|
-
];
|
|
1230
|
-
props.showArrow && middleware.push(arrow({ element: arrowEl }));
|
|
1231
|
-
props.shiftOffset !== void 0 && middleware.push(shift());
|
|
1232
|
-
if (!overlayEl) {
|
|
1233
|
-
return;
|
|
1217
|
+
const [mainPosition, ...fallbackPosition] = position.value;
|
|
1218
|
+
const middleware = [offset(props.offset)];
|
|
1219
|
+
middleware.push(fallbackPosition.length ? flip({ fallbackPlacements: fallbackPosition }) : flip());
|
|
1220
|
+
if (showArrow.value) {
|
|
1221
|
+
middleware.push(arrow({ element: arrowRef.value }));
|
|
1234
1222
|
}
|
|
1235
1223
|
const { x, y, placement, middlewareData } = await computePosition(hostEl, overlayEl, {
|
|
1236
1224
|
strategy: "fixed",
|
|
1225
|
+
placement: mainPosition,
|
|
1237
1226
|
middleware
|
|
1238
1227
|
});
|
|
1239
1228
|
let applyX = x;
|
|
1240
1229
|
let applyY = y;
|
|
1241
|
-
if (props.shiftOffset !== void 0) {
|
|
1242
|
-
const { x: shiftX, y: shiftY } = middlewareData.shift;
|
|
1243
|
-
shiftX < 0 && (applyX -= props.shiftOffset);
|
|
1244
|
-
shiftX > 0 && (applyX += props.shiftOffset);
|
|
1245
|
-
shiftY < 0 && (applyY -= props.shiftOffset);
|
|
1246
|
-
shiftY > 0 && (applyY += props.shiftOffset);
|
|
1247
|
-
}
|
|
1248
1230
|
emit("positionChange", placement);
|
|
1249
1231
|
Object.assign(overlayEl.style, { top: `${applyY}px`, left: `${applyX}px` });
|
|
1250
1232
|
props.showArrow && updateArrowPosition(arrowEl, placement, middlewareData.arrow, overlayEl);
|
|
1251
1233
|
};
|
|
1234
|
+
const scrollCallback = (e) => {
|
|
1235
|
+
var _a, _b;
|
|
1236
|
+
const scrollElement = e.target;
|
|
1237
|
+
if (scrollElement == null ? void 0 : scrollElement.contains((_b = (_a = props.origin) == null ? void 0 : _a.$el) != null ? _b : props.origin)) {
|
|
1238
|
+
updatePosition();
|
|
1239
|
+
}
|
|
1240
|
+
};
|
|
1252
1241
|
watch(() => props.modelValue, () => {
|
|
1253
1242
|
if (props.modelValue && props.origin) {
|
|
1254
|
-
originParent = getScrollParent(props.origin);
|
|
1255
1243
|
nextTick(updatePosition);
|
|
1256
|
-
|
|
1257
|
-
originParent !== window && window.addEventListener("scroll", updatePosition);
|
|
1244
|
+
window.addEventListener("scroll", scrollCallback, true);
|
|
1258
1245
|
window.addEventListener("resize", updatePosition);
|
|
1259
1246
|
} else {
|
|
1260
|
-
|
|
1261
|
-
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
1247
|
+
window.removeEventListener("scroll", scrollCallback, true);
|
|
1262
1248
|
window.removeEventListener("resize", updatePosition);
|
|
1263
1249
|
}
|
|
1264
1250
|
});
|
|
1265
1251
|
onUnmounted(() => {
|
|
1266
|
-
|
|
1267
|
-
originParent !== window && window.removeEventListener("scroll", updatePosition);
|
|
1252
|
+
window.removeEventListener("scroll", scrollCallback, true);
|
|
1268
1253
|
window.removeEventListener("resize", updatePosition);
|
|
1269
1254
|
});
|
|
1270
1255
|
return { arrowRef, overlayRef, updatePosition };
|
|
@@ -1383,7 +1368,8 @@ var Dropdown = defineComponent({
|
|
|
1383
1368
|
offset: offset2,
|
|
1384
1369
|
destroyOnHide,
|
|
1385
1370
|
shiftOffset,
|
|
1386
|
-
showAnimation
|
|
1371
|
+
showAnimation,
|
|
1372
|
+
teleport
|
|
1387
1373
|
} = toRefs(props);
|
|
1388
1374
|
const origin = ref();
|
|
1389
1375
|
const dropdownRef = ref();
|
|
@@ -1425,7 +1411,7 @@ var Dropdown = defineComponent({
|
|
|
1425
1411
|
return [(_a = slots.default) == null ? void 0 : _a.call(slots)];
|
|
1426
1412
|
}
|
|
1427
1413
|
}), createVNode(Teleport, {
|
|
1428
|
-
"to":
|
|
1414
|
+
"to": teleport.value
|
|
1429
1415
|
}, {
|
|
1430
1416
|
default: () => [createVNode(Transition, {
|
|
1431
1417
|
"name": showAnimation.value ? ns2.m(`fade-${currentPosition.value}`) : ""
|
|
@@ -5826,7 +5812,7 @@ var lodash = { exports: {} };
|
|
|
5826
5812
|
var delay = baseRest(function(func, wait, args) {
|
|
5827
5813
|
return baseDelay(func, toNumber(wait) || 0, args);
|
|
5828
5814
|
});
|
|
5829
|
-
function
|
|
5815
|
+
function flip2(func) {
|
|
5830
5816
|
return createWrap(func, WRAP_FLIP_FLAG);
|
|
5831
5817
|
}
|
|
5832
5818
|
function memoize(func, resolver) {
|
|
@@ -6950,7 +6936,7 @@ var lodash = { exports: {} };
|
|
|
6950
6936
|
lodash2.flatten = flatten;
|
|
6951
6937
|
lodash2.flattenDeep = flattenDeep;
|
|
6952
6938
|
lodash2.flattenDepth = flattenDepth;
|
|
6953
|
-
lodash2.flip =
|
|
6939
|
+
lodash2.flip = flip2;
|
|
6954
6940
|
lodash2.flow = flow;
|
|
6955
6941
|
lodash2.flowRight = flowRight;
|
|
6956
6942
|
lodash2.fromPairs = fromPairs;
|