@zipify/wysiwyg 4.1.0-1 → 4.1.0-3
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/dist/cli.js +1 -1
- package/dist/wysiwyg.css +11 -11
- package/dist/wysiwyg.mjs +344 -18
- package/lib/components/base/Modal.vue +21 -0
- package/lib/components/base/ModalFloating.vue +25 -7
- package/lib/components/toolbar/ToolbarFloating.vue +3 -2
- package/package.json +1 -1
package/dist/wysiwyg.css
CHANGED
|
@@ -345,37 +345,37 @@
|
|
|
345
345
|
display: none;
|
|
346
346
|
}
|
|
347
347
|
|
|
348
|
-
.zw-modal[data-v-
|
|
348
|
+
.zw-modal[data-v-27bd5280] {
|
|
349
349
|
border-radius: 2px;
|
|
350
350
|
box-shadow: 0 0 4px rgba(var(--zw-color-black), 0.3);
|
|
351
351
|
background-color: rgb(var(--zw-color-n15));
|
|
352
|
-
max-height: var(--
|
|
353
|
-
max-width: var(--
|
|
352
|
+
max-height: var(--63a50094);
|
|
353
|
+
max-width: var(--325bc339);
|
|
354
354
|
z-index: 1000;
|
|
355
355
|
position: fixed;
|
|
356
356
|
will-change: transform;
|
|
357
357
|
}
|
|
358
|
-
.zw-modal--enter-active[data-v-
|
|
358
|
+
.zw-modal--enter-active[data-v-27bd5280] {
|
|
359
359
|
transition: opacity 0.15s ease-out;
|
|
360
360
|
}
|
|
361
|
-
.zw-modal--enter-from[data-v-
|
|
362
|
-
.zw-modal--leave-to[data-v-
|
|
361
|
+
.zw-modal--enter-from[data-v-27bd5280],
|
|
362
|
+
.zw-modal--leave-to[data-v-27bd5280] {
|
|
363
363
|
opacity: 0;
|
|
364
364
|
}
|
|
365
|
-
.zw-modal--leave-active[data-v-
|
|
365
|
+
.zw-modal--leave-active[data-v-27bd5280] {
|
|
366
366
|
transition: opacity 0.1s ease-in;
|
|
367
367
|
}
|
|
368
368
|
|
|
369
369
|
/* Scrollbar overrides in modal */
|
|
370
|
-
.zw-modal[data-v-
|
|
371
|
-
.zw-modal[data-v-
|
|
370
|
+
.zw-modal[data-v-27bd5280] .simplebar-offset,
|
|
371
|
+
.zw-modal[data-v-27bd5280] .simplebar-mask {
|
|
372
372
|
position: initial;
|
|
373
373
|
}
|
|
374
|
-
.zw-modal[data-v-
|
|
374
|
+
.zw-modal[data-v-27bd5280] .simplebar-content {
|
|
375
375
|
max-height: var(--zw-modal-max-height);
|
|
376
376
|
padding: 0 !important;
|
|
377
377
|
}
|
|
378
|
-
.zw-modal[data-v-
|
|
378
|
+
.zw-modal[data-v-27bd5280] .simplebar-content-wrapper {
|
|
379
379
|
overscroll-behavior: contain;
|
|
380
380
|
}
|
|
381
381
|
|
package/dist/wysiwyg.mjs
CHANGED
|
@@ -15201,7 +15201,7 @@ var hash$1 = {
|
|
|
15201
15201
|
bottom: "top",
|
|
15202
15202
|
top: "bottom"
|
|
15203
15203
|
};
|
|
15204
|
-
function getOppositePlacement(placement) {
|
|
15204
|
+
function getOppositePlacement$1(placement) {
|
|
15205
15205
|
return placement.replace(/left|right|bottom|top/g, function(matched) {
|
|
15206
15206
|
return hash$1[matched];
|
|
15207
15207
|
});
|
|
@@ -15470,10 +15470,10 @@ function getExpandedFallbackPlacements(placement) {
|
|
|
15470
15470
|
if (getBasePlacement$1(placement) === auto) {
|
|
15471
15471
|
return [];
|
|
15472
15472
|
}
|
|
15473
|
-
var oppositePlacement = getOppositePlacement(placement);
|
|
15473
|
+
var oppositePlacement = getOppositePlacement$1(placement);
|
|
15474
15474
|
return [getOppositeVariationPlacement(placement), oppositePlacement, getOppositeVariationPlacement(oppositePlacement)];
|
|
15475
15475
|
}
|
|
15476
|
-
function flip(_ref) {
|
|
15476
|
+
function flip$1(_ref) {
|
|
15477
15477
|
var state = _ref.state, options = _ref.options, name = _ref.name;
|
|
15478
15478
|
if (state.modifiersData[name]._skip) {
|
|
15479
15479
|
return;
|
|
@@ -15482,7 +15482,7 @@ function flip(_ref) {
|
|
|
15482
15482
|
var preferredPlacement = state.options.placement;
|
|
15483
15483
|
var basePlacement = getBasePlacement$1(preferredPlacement);
|
|
15484
15484
|
var isBasePlacement = basePlacement === preferredPlacement;
|
|
15485
|
-
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
15485
|
+
var fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipVariations ? [getOppositePlacement$1(preferredPlacement)] : getExpandedFallbackPlacements(preferredPlacement));
|
|
15486
15486
|
var placements2 = [preferredPlacement].concat(fallbackPlacements).reduce(function(acc, placement2) {
|
|
15487
15487
|
return acc.concat(getBasePlacement$1(placement2) === auto ? computeAutoPlacement(state, {
|
|
15488
15488
|
placement: placement2,
|
|
@@ -15513,9 +15513,9 @@ function flip(_ref) {
|
|
|
15513
15513
|
});
|
|
15514
15514
|
var mainVariationSide = isVertical ? isStartVariation ? right : left : isStartVariation ? bottom : top;
|
|
15515
15515
|
if (referenceRect[len] > popperRect[len]) {
|
|
15516
|
-
mainVariationSide = getOppositePlacement(mainVariationSide);
|
|
15516
|
+
mainVariationSide = getOppositePlacement$1(mainVariationSide);
|
|
15517
15517
|
}
|
|
15518
|
-
var altVariationSide = getOppositePlacement(mainVariationSide);
|
|
15518
|
+
var altVariationSide = getOppositePlacement$1(mainVariationSide);
|
|
15519
15519
|
var checks = [];
|
|
15520
15520
|
if (checkMainAxis) {
|
|
15521
15521
|
checks.push(overflow[_basePlacement] <= 0);
|
|
@@ -15560,11 +15560,11 @@ function flip(_ref) {
|
|
|
15560
15560
|
state.reset = true;
|
|
15561
15561
|
}
|
|
15562
15562
|
}
|
|
15563
|
-
const flip$
|
|
15563
|
+
const flip$2 = {
|
|
15564
15564
|
name: "flip",
|
|
15565
15565
|
enabled: true,
|
|
15566
15566
|
phase: "main",
|
|
15567
|
-
fn: flip,
|
|
15567
|
+
fn: flip$1,
|
|
15568
15568
|
requiresIfExists: ["offset"],
|
|
15569
15569
|
data: {
|
|
15570
15570
|
_skip: false
|
|
@@ -16024,7 +16024,7 @@ function popperGenerator(generatorOptions) {
|
|
|
16024
16024
|
return instance;
|
|
16025
16025
|
};
|
|
16026
16026
|
}
|
|
16027
|
-
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$2, flip$
|
|
16027
|
+
var defaultModifiers = [eventListeners, popperOffsets$1, computeStyles$1, applyStyles$1, offset$2, flip$2, preventOverflow$1, arrow$1, hide$1];
|
|
16028
16028
|
var createPopper = /* @__PURE__ */ popperGenerator({
|
|
16029
16029
|
defaultModifiers
|
|
16030
16030
|
});
|
|
@@ -25405,10 +25405,21 @@ const NumberField = /* @__PURE__ */ _export_sfc(_sfc_main$C, [["__scopeId", "dat
|
|
|
25405
25405
|
const min = Math.min;
|
|
25406
25406
|
const max = Math.max;
|
|
25407
25407
|
const round = Math.round;
|
|
25408
|
+
const floor = Math.floor;
|
|
25408
25409
|
const createCoords = (v) => ({
|
|
25409
25410
|
x: v,
|
|
25410
25411
|
y: v
|
|
25411
25412
|
});
|
|
25413
|
+
const oppositeSideMap = {
|
|
25414
|
+
left: "right",
|
|
25415
|
+
right: "left",
|
|
25416
|
+
bottom: "top",
|
|
25417
|
+
top: "bottom"
|
|
25418
|
+
};
|
|
25419
|
+
const oppositeAlignmentMap = {
|
|
25420
|
+
start: "end",
|
|
25421
|
+
end: "start"
|
|
25422
|
+
};
|
|
25412
25423
|
function clamp(start2, value, end2) {
|
|
25413
25424
|
return max(start2, min(value, end2));
|
|
25414
25425
|
}
|
|
@@ -25433,6 +25444,58 @@ function getSideAxis(placement) {
|
|
|
25433
25444
|
function getAlignmentAxis(placement) {
|
|
25434
25445
|
return getOppositeAxis(getSideAxis(placement));
|
|
25435
25446
|
}
|
|
25447
|
+
function getAlignmentSides(placement, rects, rtl) {
|
|
25448
|
+
if (rtl === void 0) {
|
|
25449
|
+
rtl = false;
|
|
25450
|
+
}
|
|
25451
|
+
const alignment = getAlignment(placement);
|
|
25452
|
+
const alignmentAxis = getAlignmentAxis(placement);
|
|
25453
|
+
const length = getAxisLength(alignmentAxis);
|
|
25454
|
+
let mainAlignmentSide = alignmentAxis === "x" ? alignment === (rtl ? "end" : "start") ? "right" : "left" : alignment === "start" ? "bottom" : "top";
|
|
25455
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
25456
|
+
mainAlignmentSide = getOppositePlacement(mainAlignmentSide);
|
|
25457
|
+
}
|
|
25458
|
+
return [mainAlignmentSide, getOppositePlacement(mainAlignmentSide)];
|
|
25459
|
+
}
|
|
25460
|
+
function getExpandedPlacements(placement) {
|
|
25461
|
+
const oppositePlacement = getOppositePlacement(placement);
|
|
25462
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
25463
|
+
}
|
|
25464
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
25465
|
+
return placement.replace(/start|end/g, (alignment) => oppositeAlignmentMap[alignment]);
|
|
25466
|
+
}
|
|
25467
|
+
function getSideList(side, isStart, rtl) {
|
|
25468
|
+
const lr = ["left", "right"];
|
|
25469
|
+
const rl = ["right", "left"];
|
|
25470
|
+
const tb = ["top", "bottom"];
|
|
25471
|
+
const bt = ["bottom", "top"];
|
|
25472
|
+
switch (side) {
|
|
25473
|
+
case "top":
|
|
25474
|
+
case "bottom":
|
|
25475
|
+
if (rtl)
|
|
25476
|
+
return isStart ? rl : lr;
|
|
25477
|
+
return isStart ? lr : rl;
|
|
25478
|
+
case "left":
|
|
25479
|
+
case "right":
|
|
25480
|
+
return isStart ? tb : bt;
|
|
25481
|
+
default:
|
|
25482
|
+
return [];
|
|
25483
|
+
}
|
|
25484
|
+
}
|
|
25485
|
+
function getOppositeAxisPlacements(placement, flipAlignment, direction, rtl) {
|
|
25486
|
+
const alignment = getAlignment(placement);
|
|
25487
|
+
let list = getSideList(getSide(placement), direction === "start", rtl);
|
|
25488
|
+
if (alignment) {
|
|
25489
|
+
list = list.map((side) => side + "-" + alignment);
|
|
25490
|
+
if (flipAlignment) {
|
|
25491
|
+
list = list.concat(list.map(getOppositeAlignmentPlacement));
|
|
25492
|
+
}
|
|
25493
|
+
}
|
|
25494
|
+
return list;
|
|
25495
|
+
}
|
|
25496
|
+
function getOppositePlacement(placement) {
|
|
25497
|
+
return placement.replace(/left|right|bottom|top/g, (side) => oppositeSideMap[side]);
|
|
25498
|
+
}
|
|
25436
25499
|
function expandPaddingObject(padding) {
|
|
25437
25500
|
return {
|
|
25438
25501
|
top: 0,
|
|
@@ -25652,6 +25715,100 @@ async function detectOverflow(state, options) {
|
|
|
25652
25715
|
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
25653
25716
|
};
|
|
25654
25717
|
}
|
|
25718
|
+
const flip = function(options) {
|
|
25719
|
+
if (options === void 0) {
|
|
25720
|
+
options = {};
|
|
25721
|
+
}
|
|
25722
|
+
return {
|
|
25723
|
+
name: "flip",
|
|
25724
|
+
options,
|
|
25725
|
+
async fn(state) {
|
|
25726
|
+
var _middlewareData$arrow, _middlewareData$flip;
|
|
25727
|
+
const {
|
|
25728
|
+
placement,
|
|
25729
|
+
middlewareData,
|
|
25730
|
+
rects,
|
|
25731
|
+
initialPlacement,
|
|
25732
|
+
platform: platform2,
|
|
25733
|
+
elements
|
|
25734
|
+
} = state;
|
|
25735
|
+
const {
|
|
25736
|
+
mainAxis: checkMainAxis = true,
|
|
25737
|
+
crossAxis: checkCrossAxis = true,
|
|
25738
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
25739
|
+
fallbackStrategy = "bestFit",
|
|
25740
|
+
fallbackAxisSideDirection = "none",
|
|
25741
|
+
flipAlignment = true,
|
|
25742
|
+
...detectOverflowOptions
|
|
25743
|
+
} = evaluate(options, state);
|
|
25744
|
+
if ((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset) {
|
|
25745
|
+
return {};
|
|
25746
|
+
}
|
|
25747
|
+
const side = getSide(placement);
|
|
25748
|
+
const isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
25749
|
+
const rtl = await (platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating));
|
|
25750
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
25751
|
+
if (!specifiedFallbackPlacements && fallbackAxisSideDirection !== "none") {
|
|
25752
|
+
fallbackPlacements.push(...getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
25753
|
+
}
|
|
25754
|
+
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
25755
|
+
const overflow = await detectOverflow(state, detectOverflowOptions);
|
|
25756
|
+
const overflows = [];
|
|
25757
|
+
let overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
25758
|
+
if (checkMainAxis) {
|
|
25759
|
+
overflows.push(overflow[side]);
|
|
25760
|
+
}
|
|
25761
|
+
if (checkCrossAxis) {
|
|
25762
|
+
const sides = getAlignmentSides(placement, rects, rtl);
|
|
25763
|
+
overflows.push(overflow[sides[0]], overflow[sides[1]]);
|
|
25764
|
+
}
|
|
25765
|
+
overflowsData = [...overflowsData, {
|
|
25766
|
+
placement,
|
|
25767
|
+
overflows
|
|
25768
|
+
}];
|
|
25769
|
+
if (!overflows.every((side2) => side2 <= 0)) {
|
|
25770
|
+
var _middlewareData$flip2, _overflowsData$filter;
|
|
25771
|
+
const nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
25772
|
+
const nextPlacement = placements2[nextIndex];
|
|
25773
|
+
if (nextPlacement) {
|
|
25774
|
+
return {
|
|
25775
|
+
data: {
|
|
25776
|
+
index: nextIndex,
|
|
25777
|
+
overflows: overflowsData
|
|
25778
|
+
},
|
|
25779
|
+
reset: {
|
|
25780
|
+
placement: nextPlacement
|
|
25781
|
+
}
|
|
25782
|
+
};
|
|
25783
|
+
}
|
|
25784
|
+
let resetPlacement = (_overflowsData$filter = overflowsData.filter((d) => d.overflows[0] <= 0).sort((a, b) => a.overflows[1] - b.overflows[1])[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
25785
|
+
if (!resetPlacement) {
|
|
25786
|
+
switch (fallbackStrategy) {
|
|
25787
|
+
case "bestFit": {
|
|
25788
|
+
var _overflowsData$map$so;
|
|
25789
|
+
const placement2 = (_overflowsData$map$so = overflowsData.map((d) => [d.placement, d.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0)]).sort((a, b) => a[1] - b[1])[0]) == null ? void 0 : _overflowsData$map$so[0];
|
|
25790
|
+
if (placement2) {
|
|
25791
|
+
resetPlacement = placement2;
|
|
25792
|
+
}
|
|
25793
|
+
break;
|
|
25794
|
+
}
|
|
25795
|
+
case "initialPlacement":
|
|
25796
|
+
resetPlacement = initialPlacement;
|
|
25797
|
+
break;
|
|
25798
|
+
}
|
|
25799
|
+
}
|
|
25800
|
+
if (placement !== resetPlacement) {
|
|
25801
|
+
return {
|
|
25802
|
+
reset: {
|
|
25803
|
+
placement: resetPlacement
|
|
25804
|
+
}
|
|
25805
|
+
};
|
|
25806
|
+
}
|
|
25807
|
+
}
|
|
25808
|
+
return {};
|
|
25809
|
+
}
|
|
25810
|
+
};
|
|
25811
|
+
};
|
|
25655
25812
|
async function convertValueToCoords(state, options) {
|
|
25656
25813
|
const {
|
|
25657
25814
|
placement,
|
|
@@ -26340,6 +26497,141 @@ const platform = {
|
|
|
26340
26497
|
isElement,
|
|
26341
26498
|
isRTL
|
|
26342
26499
|
};
|
|
26500
|
+
function observeMove(element, onMove) {
|
|
26501
|
+
let io = null;
|
|
26502
|
+
let timeoutId;
|
|
26503
|
+
const root2 = getDocumentElement(element);
|
|
26504
|
+
function cleanup() {
|
|
26505
|
+
clearTimeout(timeoutId);
|
|
26506
|
+
io && io.disconnect();
|
|
26507
|
+
io = null;
|
|
26508
|
+
}
|
|
26509
|
+
function refresh(skip, threshold) {
|
|
26510
|
+
if (skip === void 0) {
|
|
26511
|
+
skip = false;
|
|
26512
|
+
}
|
|
26513
|
+
if (threshold === void 0) {
|
|
26514
|
+
threshold = 1;
|
|
26515
|
+
}
|
|
26516
|
+
cleanup();
|
|
26517
|
+
const {
|
|
26518
|
+
left: left2,
|
|
26519
|
+
top: top2,
|
|
26520
|
+
width,
|
|
26521
|
+
height
|
|
26522
|
+
} = element.getBoundingClientRect();
|
|
26523
|
+
if (!skip) {
|
|
26524
|
+
onMove();
|
|
26525
|
+
}
|
|
26526
|
+
if (!width || !height) {
|
|
26527
|
+
return;
|
|
26528
|
+
}
|
|
26529
|
+
const insetTop = floor(top2);
|
|
26530
|
+
const insetRight = floor(root2.clientWidth - (left2 + width));
|
|
26531
|
+
const insetBottom = floor(root2.clientHeight - (top2 + height));
|
|
26532
|
+
const insetLeft = floor(left2);
|
|
26533
|
+
const rootMargin = -insetTop + "px " + -insetRight + "px " + -insetBottom + "px " + -insetLeft + "px";
|
|
26534
|
+
const options = {
|
|
26535
|
+
rootMargin,
|
|
26536
|
+
threshold: max(0, min(1, threshold)) || 1
|
|
26537
|
+
};
|
|
26538
|
+
let isFirstUpdate = true;
|
|
26539
|
+
function handleObserve(entries) {
|
|
26540
|
+
const ratio = entries[0].intersectionRatio;
|
|
26541
|
+
if (ratio !== threshold) {
|
|
26542
|
+
if (!isFirstUpdate) {
|
|
26543
|
+
return refresh();
|
|
26544
|
+
}
|
|
26545
|
+
if (!ratio) {
|
|
26546
|
+
timeoutId = setTimeout(() => {
|
|
26547
|
+
refresh(false, 1e-7);
|
|
26548
|
+
}, 100);
|
|
26549
|
+
} else {
|
|
26550
|
+
refresh(false, ratio);
|
|
26551
|
+
}
|
|
26552
|
+
}
|
|
26553
|
+
isFirstUpdate = false;
|
|
26554
|
+
}
|
|
26555
|
+
try {
|
|
26556
|
+
io = new IntersectionObserver(handleObserve, {
|
|
26557
|
+
...options,
|
|
26558
|
+
// Handle <iframe>s
|
|
26559
|
+
root: root2.ownerDocument
|
|
26560
|
+
});
|
|
26561
|
+
} catch (e) {
|
|
26562
|
+
io = new IntersectionObserver(handleObserve, options);
|
|
26563
|
+
}
|
|
26564
|
+
io.observe(element);
|
|
26565
|
+
}
|
|
26566
|
+
refresh(true);
|
|
26567
|
+
return cleanup;
|
|
26568
|
+
}
|
|
26569
|
+
function autoUpdate(reference2, floating, update, options) {
|
|
26570
|
+
if (options === void 0) {
|
|
26571
|
+
options = {};
|
|
26572
|
+
}
|
|
26573
|
+
const {
|
|
26574
|
+
ancestorScroll = true,
|
|
26575
|
+
ancestorResize = true,
|
|
26576
|
+
elementResize = typeof ResizeObserver === "function",
|
|
26577
|
+
layoutShift = typeof IntersectionObserver === "function",
|
|
26578
|
+
animationFrame = false
|
|
26579
|
+
} = options;
|
|
26580
|
+
const referenceEl = unwrapElement$1(reference2);
|
|
26581
|
+
const ancestors = ancestorScroll || ancestorResize ? [...referenceEl ? getOverflowAncestors(referenceEl) : [], ...getOverflowAncestors(floating)] : [];
|
|
26582
|
+
ancestors.forEach((ancestor) => {
|
|
26583
|
+
ancestorScroll && ancestor.addEventListener("scroll", update, {
|
|
26584
|
+
passive: true
|
|
26585
|
+
});
|
|
26586
|
+
ancestorResize && ancestor.addEventListener("resize", update);
|
|
26587
|
+
});
|
|
26588
|
+
const cleanupIo = referenceEl && layoutShift ? observeMove(referenceEl, update) : null;
|
|
26589
|
+
let reobserveFrame = -1;
|
|
26590
|
+
let resizeObserver = null;
|
|
26591
|
+
if (elementResize) {
|
|
26592
|
+
resizeObserver = new ResizeObserver((_ref) => {
|
|
26593
|
+
let [firstEntry] = _ref;
|
|
26594
|
+
if (firstEntry && firstEntry.target === referenceEl && resizeObserver) {
|
|
26595
|
+
resizeObserver.unobserve(floating);
|
|
26596
|
+
cancelAnimationFrame(reobserveFrame);
|
|
26597
|
+
reobserveFrame = requestAnimationFrame(() => {
|
|
26598
|
+
resizeObserver && resizeObserver.observe(floating);
|
|
26599
|
+
});
|
|
26600
|
+
}
|
|
26601
|
+
update();
|
|
26602
|
+
});
|
|
26603
|
+
if (referenceEl && !animationFrame) {
|
|
26604
|
+
resizeObserver.observe(referenceEl);
|
|
26605
|
+
}
|
|
26606
|
+
resizeObserver.observe(floating);
|
|
26607
|
+
}
|
|
26608
|
+
let frameId;
|
|
26609
|
+
let prevRefRect = animationFrame ? getBoundingClientRect(reference2) : null;
|
|
26610
|
+
if (animationFrame) {
|
|
26611
|
+
frameLoop();
|
|
26612
|
+
}
|
|
26613
|
+
function frameLoop() {
|
|
26614
|
+
const nextRefRect = getBoundingClientRect(reference2);
|
|
26615
|
+
if (prevRefRect && (nextRefRect.x !== prevRefRect.x || nextRefRect.y !== prevRefRect.y || nextRefRect.width !== prevRefRect.width || nextRefRect.height !== prevRefRect.height)) {
|
|
26616
|
+
update();
|
|
26617
|
+
}
|
|
26618
|
+
prevRefRect = nextRefRect;
|
|
26619
|
+
frameId = requestAnimationFrame(frameLoop);
|
|
26620
|
+
}
|
|
26621
|
+
update();
|
|
26622
|
+
return () => {
|
|
26623
|
+
ancestors.forEach((ancestor) => {
|
|
26624
|
+
ancestorScroll && ancestor.removeEventListener("scroll", update);
|
|
26625
|
+
ancestorResize && ancestor.removeEventListener("resize", update);
|
|
26626
|
+
});
|
|
26627
|
+
cleanupIo && cleanupIo();
|
|
26628
|
+
resizeObserver && resizeObserver.disconnect();
|
|
26629
|
+
resizeObserver = null;
|
|
26630
|
+
if (animationFrame) {
|
|
26631
|
+
cancelAnimationFrame(frameId);
|
|
26632
|
+
}
|
|
26633
|
+
};
|
|
26634
|
+
}
|
|
26343
26635
|
const computePosition = (reference2, floating, options) => {
|
|
26344
26636
|
const cache = /* @__PURE__ */ new Map();
|
|
26345
26637
|
const mergedOptions = {
|
|
@@ -26495,19 +26787,34 @@ const _sfc_main$B = {
|
|
|
26495
26787
|
referenceRef: {
|
|
26496
26788
|
type: Object,
|
|
26497
26789
|
required: true
|
|
26790
|
+
},
|
|
26791
|
+
placement: {
|
|
26792
|
+
type: String,
|
|
26793
|
+
required: true
|
|
26794
|
+
},
|
|
26795
|
+
placementStrategy: {
|
|
26796
|
+
type: String,
|
|
26797
|
+
required: true
|
|
26798
|
+
},
|
|
26799
|
+
offsets: {
|
|
26800
|
+
type: Array,
|
|
26801
|
+
required: true
|
|
26498
26802
|
}
|
|
26499
26803
|
},
|
|
26500
26804
|
setup(__props) {
|
|
26501
26805
|
const props = __props;
|
|
26502
26806
|
const floatingRef = ref(null);
|
|
26503
26807
|
const referenceRef = toRef(props, "referenceRef");
|
|
26808
|
+
const middlewares = computed(() => [
|
|
26809
|
+
offset({ crossAxis: props.offsets[0], mainAxis: props.offsets[1] }),
|
|
26810
|
+
flip(),
|
|
26811
|
+
shift({ padding: 16, crossAxis: true, limiter: limitShift() })
|
|
26812
|
+
]);
|
|
26504
26813
|
const { floatingStyles } = useFloating(referenceRef, floatingRef, {
|
|
26505
26814
|
placement: "bottom",
|
|
26506
26815
|
strategy: "fixed",
|
|
26507
|
-
middleware:
|
|
26508
|
-
|
|
26509
|
-
offset({ mainAxis: 4 })
|
|
26510
|
-
]
|
|
26816
|
+
middleware: middlewares,
|
|
26817
|
+
whileElementsMounted: autoUpdate
|
|
26511
26818
|
});
|
|
26512
26819
|
return (_ctx, _cache) => {
|
|
26513
26820
|
return openBlock(), createElementBlock("div", {
|
|
@@ -26547,12 +26854,27 @@ const _sfc_main$A = {
|
|
|
26547
26854
|
type: Boolean,
|
|
26548
26855
|
required: false,
|
|
26549
26856
|
default: false
|
|
26857
|
+
},
|
|
26858
|
+
placement: {
|
|
26859
|
+
type: String,
|
|
26860
|
+
required: false,
|
|
26861
|
+
default: "bottom"
|
|
26862
|
+
},
|
|
26863
|
+
placementStrategy: {
|
|
26864
|
+
type: String,
|
|
26865
|
+
required: false,
|
|
26866
|
+
default: "fixed"
|
|
26867
|
+
},
|
|
26868
|
+
offsets: {
|
|
26869
|
+
type: Array,
|
|
26870
|
+
required: false,
|
|
26871
|
+
default: () => [0, 4]
|
|
26550
26872
|
}
|
|
26551
26873
|
},
|
|
26552
26874
|
setup(__props) {
|
|
26553
26875
|
useCssVars((_ctx) => ({
|
|
26554
|
-
"
|
|
26555
|
-
"
|
|
26876
|
+
"63a50094": __props.maxHeight + "px",
|
|
26877
|
+
"325bc339": __props.maxWidth + "px"
|
|
26556
26878
|
}));
|
|
26557
26879
|
const props = __props;
|
|
26558
26880
|
const transitionDuration = {
|
|
@@ -26588,13 +26910,16 @@ const _sfc_main$A = {
|
|
|
26588
26910
|
ref: hostRef,
|
|
26589
26911
|
tabindex: "-1",
|
|
26590
26912
|
"reference-ref": __props.referenceRef,
|
|
26913
|
+
placement: __props.placement,
|
|
26914
|
+
"placement-strategy": __props.placementStrategy,
|
|
26915
|
+
offsets: __props.offsets,
|
|
26591
26916
|
"data-test-selector": "modal"
|
|
26592
26917
|
}, {
|
|
26593
26918
|
default: withCtx(() => [
|
|
26594
26919
|
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
26595
26920
|
], void 0, true),
|
|
26596
26921
|
_: 3
|
|
26597
|
-
}, 8, ["reference-ref"])), [
|
|
26922
|
+
}, 8, ["reference-ref", "placement", "placement-strategy", "offsets"])), [
|
|
26598
26923
|
[unref(outClick), unref(toggler).close]
|
|
26599
26924
|
]) : createCommentVNode("", true)
|
|
26600
26925
|
], void 0, true),
|
|
@@ -26603,7 +26928,7 @@ const _sfc_main$A = {
|
|
|
26603
26928
|
};
|
|
26604
26929
|
}
|
|
26605
26930
|
};
|
|
26606
|
-
const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-
|
|
26931
|
+
const Modal = /* @__PURE__ */ _export_sfc(_sfc_main$A, [["__scopeId", "data-v-27bd5280"]]);
|
|
26607
26932
|
const _hoisted_1$h = { class: "zw-field" };
|
|
26608
26933
|
const _hoisted_2$6 = ["for"];
|
|
26609
26934
|
const _hoisted_3$2 = ["value", "id", "placeholder"];
|
|
@@ -28610,7 +28935,8 @@ const _sfc_main$2 = {
|
|
|
28610
28935
|
const { floatingStyles } = useFloating(referenceRef, floatingRef, {
|
|
28611
28936
|
placement: toRef(props, "placement"),
|
|
28612
28937
|
strategy: "fixed",
|
|
28613
|
-
middleware: middlewares
|
|
28938
|
+
middleware: middlewares,
|
|
28939
|
+
whileElementsMounted: autoUpdate
|
|
28614
28940
|
});
|
|
28615
28941
|
return (_ctx, _cache) => {
|
|
28616
28942
|
return openBlock(), createElementBlock("div", {
|
|
@@ -5,6 +5,9 @@
|
|
|
5
5
|
ref="hostRef"
|
|
6
6
|
tabindex="-1"
|
|
7
7
|
:reference-ref="referenceRef"
|
|
8
|
+
:placement="placement"
|
|
9
|
+
:placement-strategy="placementStrategy"
|
|
10
|
+
:offsets="offsets"
|
|
8
11
|
v-out-click="toggler.close"
|
|
9
12
|
v-if="toggler.isOpened && referenceRef"
|
|
10
13
|
data-test-selector="modal"
|
|
@@ -49,6 +52,24 @@ const props = defineProps({
|
|
|
49
52
|
type: Boolean,
|
|
50
53
|
required: false,
|
|
51
54
|
default: false
|
|
55
|
+
},
|
|
56
|
+
|
|
57
|
+
placement: {
|
|
58
|
+
type: String,
|
|
59
|
+
required: false,
|
|
60
|
+
default: 'bottom'
|
|
61
|
+
},
|
|
62
|
+
|
|
63
|
+
placementStrategy: {
|
|
64
|
+
type: String,
|
|
65
|
+
required: false,
|
|
66
|
+
default: 'fixed'
|
|
67
|
+
},
|
|
68
|
+
|
|
69
|
+
offsets: {
|
|
70
|
+
type: Array,
|
|
71
|
+
required: false,
|
|
72
|
+
default: () => [0, 4]
|
|
52
73
|
}
|
|
53
74
|
});
|
|
54
75
|
|
|
@@ -5,26 +5,44 @@
|
|
|
5
5
|
</template>
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
|
-
import { ref, toRef } from 'vue';
|
|
9
|
-
import { useFloating, limitShift, offset, shift } from '@floating-ui/vue';
|
|
8
|
+
import { computed, ref, toRef } from 'vue';
|
|
9
|
+
import { useFloating, limitShift, offset, shift, autoUpdate, flip } from '@floating-ui/vue';
|
|
10
10
|
|
|
11
11
|
const props = defineProps({
|
|
12
12
|
referenceRef: {
|
|
13
13
|
type: Object,
|
|
14
14
|
required: true
|
|
15
|
+
},
|
|
16
|
+
|
|
17
|
+
placement: {
|
|
18
|
+
type: String,
|
|
19
|
+
required: true
|
|
20
|
+
},
|
|
21
|
+
|
|
22
|
+
placementStrategy: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: true
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
offsets: {
|
|
28
|
+
type: Array,
|
|
29
|
+
required: true
|
|
15
30
|
}
|
|
16
31
|
});
|
|
17
32
|
|
|
18
33
|
const floatingRef = ref(null);
|
|
19
34
|
const referenceRef = toRef(props, 'referenceRef');
|
|
20
35
|
|
|
36
|
+
const middlewares = computed(() => [
|
|
37
|
+
offset({ crossAxis: props.offsets[0], mainAxis: props.offsets[1] }),
|
|
38
|
+
flip(),
|
|
39
|
+
shift({ padding: 16, crossAxis: true, limiter: limitShift() })
|
|
40
|
+
]);
|
|
41
|
+
|
|
21
42
|
const { floatingStyles } = useFloating(referenceRef, floatingRef, {
|
|
22
43
|
placement: 'bottom',
|
|
23
44
|
strategy: 'fixed',
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
shift({ padding: 16, crossAxis: true, limiter: limitShift() }),
|
|
27
|
-
offset({ mainAxis: 4 })
|
|
28
|
-
]
|
|
45
|
+
middleware: middlewares,
|
|
46
|
+
whileElementsMounted: autoUpdate
|
|
29
47
|
});
|
|
30
48
|
</script>
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
<script setup>
|
|
8
8
|
import { computed, ref, toRef } from 'vue';
|
|
9
|
-
import { useFloating, limitShift, offset, shift } from '@floating-ui/vue';
|
|
9
|
+
import { useFloating, limitShift, offset, shift, autoUpdate } from '@floating-ui/vue';
|
|
10
10
|
|
|
11
11
|
const props = defineProps({
|
|
12
12
|
referenceRef: {
|
|
@@ -36,6 +36,7 @@ const middlewares = computed(() => [
|
|
|
36
36
|
const { floatingStyles } = useFloating(referenceRef, floatingRef, {
|
|
37
37
|
placement: toRef(props, 'placement'),
|
|
38
38
|
strategy: 'fixed',
|
|
39
|
-
middleware: middlewares
|
|
39
|
+
middleware: middlewares,
|
|
40
|
+
whileElementsMounted: autoUpdate
|
|
40
41
|
});
|
|
41
42
|
</script>
|