cleek 2.3.49 → 2.3.52
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/cleek.es.js +2734 -53
- package/dist/cleek.umd.js +10 -10
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/cleek.es.js
CHANGED
|
@@ -17,7 +17,2662 @@ var __spreadValues = (a, b) => {
|
|
|
17
17
|
return a;
|
|
18
18
|
};
|
|
19
19
|
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
20
|
-
|
|
20
|
+
var __objRest = (source, exclude) => {
|
|
21
|
+
var target = {};
|
|
22
|
+
for (var prop in source)
|
|
23
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
24
|
+
target[prop] = source[prop];
|
|
25
|
+
if (source != null && __getOwnPropSymbols)
|
|
26
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
27
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
28
|
+
target[prop] = source[prop];
|
|
29
|
+
}
|
|
30
|
+
return target;
|
|
31
|
+
};
|
|
32
|
+
import { pushScopeId, popScopeId, defineComponent, nextTick as nextTick$1, openBlock, createBlock, withScopeId, resolveComponent, createElementBlock, normalizeClass, normalizeStyle, withKeys, createElementVNode, Fragment, renderSlot, createCommentVNode, mergeProps, withCtx, createVNode, ref, createApp, h, toDisplayString, computed as computed$2, unref as unref$1, watch, Teleport, createTextVNode, onMounted, onBeforeUnmount, getCurrentInstance, withDirectives, isRef as isRef$1, vModelDynamic, renderList, withModifiers, vModelRadio, vModelSelect, vModelCheckbox, vModelText } from "vue";
|
|
33
|
+
function getBasePlacement$2(placement) {
|
|
34
|
+
return placement.split("-")[0];
|
|
35
|
+
}
|
|
36
|
+
function getAlignment(placement) {
|
|
37
|
+
return placement.split("-")[1];
|
|
38
|
+
}
|
|
39
|
+
function getMainAxisFromPlacement$1(placement) {
|
|
40
|
+
return ["top", "bottom"].includes(getBasePlacement$2(placement)) ? "x" : "y";
|
|
41
|
+
}
|
|
42
|
+
function getLengthFromAxis(axis) {
|
|
43
|
+
return axis === "y" ? "height" : "width";
|
|
44
|
+
}
|
|
45
|
+
function computeCoordsFromPlacement(_ref2) {
|
|
46
|
+
let {
|
|
47
|
+
reference: reference2,
|
|
48
|
+
floating,
|
|
49
|
+
placement
|
|
50
|
+
} = _ref2;
|
|
51
|
+
const commonX = reference2.x + reference2.width / 2 - floating.width / 2;
|
|
52
|
+
const commonY = reference2.y + reference2.height / 2 - floating.height / 2;
|
|
53
|
+
let coords;
|
|
54
|
+
switch (getBasePlacement$2(placement)) {
|
|
55
|
+
case "top":
|
|
56
|
+
coords = {
|
|
57
|
+
x: commonX,
|
|
58
|
+
y: reference2.y - floating.height
|
|
59
|
+
};
|
|
60
|
+
break;
|
|
61
|
+
case "bottom":
|
|
62
|
+
coords = {
|
|
63
|
+
x: commonX,
|
|
64
|
+
y: reference2.y + reference2.height
|
|
65
|
+
};
|
|
66
|
+
break;
|
|
67
|
+
case "right":
|
|
68
|
+
coords = {
|
|
69
|
+
x: reference2.x + reference2.width,
|
|
70
|
+
y: commonY
|
|
71
|
+
};
|
|
72
|
+
break;
|
|
73
|
+
case "left":
|
|
74
|
+
coords = {
|
|
75
|
+
x: reference2.x - floating.width,
|
|
76
|
+
y: commonY
|
|
77
|
+
};
|
|
78
|
+
break;
|
|
79
|
+
default:
|
|
80
|
+
coords = {
|
|
81
|
+
x: reference2.x,
|
|
82
|
+
y: reference2.y
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
const mainAxis = getMainAxisFromPlacement$1(placement);
|
|
86
|
+
const length = getLengthFromAxis(mainAxis);
|
|
87
|
+
switch (getAlignment(placement)) {
|
|
88
|
+
case "start":
|
|
89
|
+
coords[mainAxis] = coords[mainAxis] - (reference2[length] / 2 - floating[length] / 2);
|
|
90
|
+
break;
|
|
91
|
+
case "end":
|
|
92
|
+
coords[mainAxis] = coords[mainAxis] + (reference2[length] / 2 - floating[length] / 2);
|
|
93
|
+
break;
|
|
94
|
+
}
|
|
95
|
+
return coords;
|
|
96
|
+
}
|
|
97
|
+
const computePosition$1 = async (reference2, floating, config2) => {
|
|
98
|
+
const {
|
|
99
|
+
placement = "bottom",
|
|
100
|
+
strategy = "absolute",
|
|
101
|
+
middleware = [],
|
|
102
|
+
platform: platform2
|
|
103
|
+
} = config2;
|
|
104
|
+
let rects = await platform2.getElementRects({
|
|
105
|
+
reference: reference2,
|
|
106
|
+
floating,
|
|
107
|
+
strategy
|
|
108
|
+
});
|
|
109
|
+
let {
|
|
110
|
+
x,
|
|
111
|
+
y
|
|
112
|
+
} = computeCoordsFromPlacement(__spreadProps(__spreadValues({}, rects), {
|
|
113
|
+
placement
|
|
114
|
+
}));
|
|
115
|
+
let statefulPlacement = placement;
|
|
116
|
+
let middlewareData = {};
|
|
117
|
+
for (let i = 0; i < middleware.length; i++) {
|
|
118
|
+
const {
|
|
119
|
+
name,
|
|
120
|
+
fn: fn2
|
|
121
|
+
} = middleware[i];
|
|
122
|
+
const {
|
|
123
|
+
x: nextX,
|
|
124
|
+
y: nextY,
|
|
125
|
+
data,
|
|
126
|
+
reset
|
|
127
|
+
} = await fn2({
|
|
128
|
+
x,
|
|
129
|
+
y,
|
|
130
|
+
initialPlacement: placement,
|
|
131
|
+
placement: statefulPlacement,
|
|
132
|
+
strategy,
|
|
133
|
+
middlewareData,
|
|
134
|
+
rects,
|
|
135
|
+
platform: platform2,
|
|
136
|
+
elements: {
|
|
137
|
+
reference: reference2,
|
|
138
|
+
floating
|
|
139
|
+
}
|
|
140
|
+
});
|
|
141
|
+
x = nextX != null ? nextX : x;
|
|
142
|
+
y = nextY != null ? nextY : y;
|
|
143
|
+
middlewareData = __spreadProps(__spreadValues({}, middlewareData), {
|
|
144
|
+
[name]: data != null ? data : {}
|
|
145
|
+
});
|
|
146
|
+
if (reset) {
|
|
147
|
+
if (typeof reset === "object") {
|
|
148
|
+
if (reset.placement) {
|
|
149
|
+
statefulPlacement = reset.placement;
|
|
150
|
+
}
|
|
151
|
+
if (reset.rects) {
|
|
152
|
+
rects = reset.rects === true ? await platform2.getElementRects({
|
|
153
|
+
reference: reference2,
|
|
154
|
+
floating,
|
|
155
|
+
strategy
|
|
156
|
+
}) : reset.rects;
|
|
157
|
+
}
|
|
158
|
+
({
|
|
159
|
+
x,
|
|
160
|
+
y
|
|
161
|
+
} = computeCoordsFromPlacement(__spreadProps(__spreadValues({}, rects), {
|
|
162
|
+
placement: statefulPlacement
|
|
163
|
+
})));
|
|
164
|
+
}
|
|
165
|
+
i = -1;
|
|
166
|
+
continue;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return {
|
|
170
|
+
x,
|
|
171
|
+
y,
|
|
172
|
+
placement: statefulPlacement,
|
|
173
|
+
strategy,
|
|
174
|
+
middlewareData
|
|
175
|
+
};
|
|
176
|
+
};
|
|
177
|
+
function expandPaddingObject(padding) {
|
|
178
|
+
return __spreadValues({
|
|
179
|
+
top: 0,
|
|
180
|
+
right: 0,
|
|
181
|
+
bottom: 0,
|
|
182
|
+
left: 0
|
|
183
|
+
}, padding);
|
|
184
|
+
}
|
|
185
|
+
function getSideObjectFromPadding(padding) {
|
|
186
|
+
return typeof padding !== "number" ? expandPaddingObject(padding) : {
|
|
187
|
+
top: padding,
|
|
188
|
+
right: padding,
|
|
189
|
+
bottom: padding,
|
|
190
|
+
left: padding
|
|
191
|
+
};
|
|
192
|
+
}
|
|
193
|
+
function rectToClientRect$1(rect) {
|
|
194
|
+
return __spreadProps(__spreadValues({}, rect), {
|
|
195
|
+
top: rect.y,
|
|
196
|
+
left: rect.x,
|
|
197
|
+
right: rect.x + rect.width,
|
|
198
|
+
bottom: rect.y + rect.height
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
async function detectOverflow$1(middlewareArguments, options) {
|
|
202
|
+
if (options === void 0) {
|
|
203
|
+
options = {};
|
|
204
|
+
}
|
|
205
|
+
const {
|
|
206
|
+
x,
|
|
207
|
+
y,
|
|
208
|
+
platform: platform2,
|
|
209
|
+
rects,
|
|
210
|
+
elements,
|
|
211
|
+
strategy
|
|
212
|
+
} = middlewareArguments;
|
|
213
|
+
const {
|
|
214
|
+
boundary = "clippingParents",
|
|
215
|
+
rootBoundary = "viewport",
|
|
216
|
+
elementContext = "floating",
|
|
217
|
+
altBoundary = false,
|
|
218
|
+
padding = 0
|
|
219
|
+
} = options;
|
|
220
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
221
|
+
const altContext = elementContext === "floating" ? "reference" : "floating";
|
|
222
|
+
const element = elements[altBoundary ? altContext : elementContext];
|
|
223
|
+
const clippingClientRect = await platform2.getClippingClientRect({
|
|
224
|
+
element: await platform2.isElement(element) ? element : element.contextElement || await platform2.getDocumentElement({
|
|
225
|
+
element: elements.floating
|
|
226
|
+
}),
|
|
227
|
+
boundary,
|
|
228
|
+
rootBoundary
|
|
229
|
+
});
|
|
230
|
+
const elementClientRect = rectToClientRect$1(await platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
231
|
+
rect: elementContext === "floating" ? __spreadProps(__spreadValues({}, rects.floating), {
|
|
232
|
+
x,
|
|
233
|
+
y
|
|
234
|
+
}) : rects.reference,
|
|
235
|
+
offsetParent: await platform2.getOffsetParent({
|
|
236
|
+
element: elements.floating
|
|
237
|
+
}),
|
|
238
|
+
strategy
|
|
239
|
+
}));
|
|
240
|
+
return {
|
|
241
|
+
top: clippingClientRect.top - elementClientRect.top + paddingObject.top,
|
|
242
|
+
bottom: elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom,
|
|
243
|
+
left: clippingClientRect.left - elementClientRect.left + paddingObject.left,
|
|
244
|
+
right: elementClientRect.right - clippingClientRect.right + paddingObject.right
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
const min$2 = Math.min;
|
|
248
|
+
const max$2 = Math.max;
|
|
249
|
+
function within$1(min$12, value, max$12) {
|
|
250
|
+
return max$2(min$12, min$2(value, max$12));
|
|
251
|
+
}
|
|
252
|
+
const arrow$2 = (options) => ({
|
|
253
|
+
name: "arrow",
|
|
254
|
+
options,
|
|
255
|
+
async fn(middlewareArguments) {
|
|
256
|
+
const {
|
|
257
|
+
element,
|
|
258
|
+
padding = 0
|
|
259
|
+
} = options != null ? options : {};
|
|
260
|
+
const {
|
|
261
|
+
x,
|
|
262
|
+
y,
|
|
263
|
+
placement,
|
|
264
|
+
rects,
|
|
265
|
+
platform: platform2
|
|
266
|
+
} = middlewareArguments;
|
|
267
|
+
if (element == null) {
|
|
268
|
+
return {};
|
|
269
|
+
}
|
|
270
|
+
const paddingObject = getSideObjectFromPadding(padding);
|
|
271
|
+
const coords = {
|
|
272
|
+
x,
|
|
273
|
+
y
|
|
274
|
+
};
|
|
275
|
+
const basePlacement = getBasePlacement$2(placement);
|
|
276
|
+
const axis = getMainAxisFromPlacement$1(basePlacement);
|
|
277
|
+
const length = getLengthFromAxis(axis);
|
|
278
|
+
const arrowDimensions = await platform2.getDimensions({
|
|
279
|
+
element
|
|
280
|
+
});
|
|
281
|
+
const minProp = axis === "y" ? "top" : "left";
|
|
282
|
+
const maxProp = axis === "y" ? "bottom" : "right";
|
|
283
|
+
const endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
284
|
+
const startDiff = coords[axis] - rects.reference[axis];
|
|
285
|
+
const arrowOffsetParent = await platform2.getOffsetParent({
|
|
286
|
+
element
|
|
287
|
+
});
|
|
288
|
+
const clientSize = arrowOffsetParent ? axis === "y" ? arrowOffsetParent.clientHeight || 0 : arrowOffsetParent.clientWidth || 0 : 0;
|
|
289
|
+
const centerToReference = endDiff / 2 - startDiff / 2;
|
|
290
|
+
const min2 = paddingObject[minProp];
|
|
291
|
+
const max2 = clientSize - arrowDimensions[length] - paddingObject[maxProp];
|
|
292
|
+
const center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
293
|
+
const offset2 = within$1(min2, center, max2);
|
|
294
|
+
return {
|
|
295
|
+
data: {
|
|
296
|
+
[axis]: offset2,
|
|
297
|
+
centerOffset: center - offset2
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
const hash$1$1 = {
|
|
303
|
+
left: "right",
|
|
304
|
+
right: "left",
|
|
305
|
+
bottom: "top",
|
|
306
|
+
top: "bottom"
|
|
307
|
+
};
|
|
308
|
+
function getOppositePlacement$1(placement) {
|
|
309
|
+
return placement.replace(/left|right|bottom|top/g, (matched) => hash$1$1[matched]);
|
|
310
|
+
}
|
|
311
|
+
function getAlignmentSides(placement, rects) {
|
|
312
|
+
const isStart = getAlignment(placement) === "start";
|
|
313
|
+
const mainAxis = getMainAxisFromPlacement$1(placement);
|
|
314
|
+
const length = getLengthFromAxis(mainAxis);
|
|
315
|
+
let mainAlignmentSide = mainAxis === "x" ? isStart ? "right" : "left" : isStart ? "bottom" : "top";
|
|
316
|
+
if (rects.reference[length] > rects.floating[length]) {
|
|
317
|
+
mainAlignmentSide = getOppositePlacement$1(mainAlignmentSide);
|
|
318
|
+
}
|
|
319
|
+
return {
|
|
320
|
+
main: mainAlignmentSide,
|
|
321
|
+
cross: getOppositePlacement$1(mainAlignmentSide)
|
|
322
|
+
};
|
|
323
|
+
}
|
|
324
|
+
const hash$2 = {
|
|
325
|
+
start: "end",
|
|
326
|
+
end: "start"
|
|
327
|
+
};
|
|
328
|
+
function getOppositeAlignmentPlacement(placement) {
|
|
329
|
+
return placement.replace(/start|end/g, (matched) => hash$2[matched]);
|
|
330
|
+
}
|
|
331
|
+
const basePlacements$1 = ["top", "right", "bottom", "left"];
|
|
332
|
+
const allPlacements = /* @__PURE__ */ basePlacements$1.reduce((acc, basePlacement) => acc.concat(basePlacement, basePlacement + "-start", basePlacement + "-end"), []);
|
|
333
|
+
function getPlacementList(alignment, autoAlignment, allowedPlacements) {
|
|
334
|
+
const allowedPlacementsSortedByAlignment = alignment ? [...allowedPlacements.filter((placement) => getAlignment(placement) === alignment), ...allowedPlacements.filter((placement) => getAlignment(placement) !== alignment)] : allowedPlacements.filter((placement) => getBasePlacement$2(placement) === placement);
|
|
335
|
+
return allowedPlacementsSortedByAlignment.filter((placement) => {
|
|
336
|
+
if (alignment) {
|
|
337
|
+
return getAlignment(placement) === alignment || (autoAlignment ? getOppositeAlignmentPlacement(placement) !== placement : false);
|
|
338
|
+
}
|
|
339
|
+
return true;
|
|
340
|
+
});
|
|
341
|
+
}
|
|
342
|
+
const autoPlacement = function(options) {
|
|
343
|
+
if (options === void 0) {
|
|
344
|
+
options = {};
|
|
345
|
+
}
|
|
346
|
+
return {
|
|
347
|
+
name: "autoPlacement",
|
|
348
|
+
options,
|
|
349
|
+
async fn(middlewareArguments) {
|
|
350
|
+
var _middlewareData$autoP, _middlewareData$autoP2, _middlewareData$autoP3, _middlewareData$autoP4, _middlewareData$autoP5, _placementsSortedByLe;
|
|
351
|
+
const {
|
|
352
|
+
x,
|
|
353
|
+
y,
|
|
354
|
+
rects,
|
|
355
|
+
middlewareData,
|
|
356
|
+
placement
|
|
357
|
+
} = middlewareArguments;
|
|
358
|
+
const _a = options, {
|
|
359
|
+
alignment = null,
|
|
360
|
+
allowedPlacements = allPlacements,
|
|
361
|
+
autoAlignment = true
|
|
362
|
+
} = _a, detectOverflowOptions = __objRest(_a, [
|
|
363
|
+
"alignment",
|
|
364
|
+
"allowedPlacements",
|
|
365
|
+
"autoAlignment"
|
|
366
|
+
]);
|
|
367
|
+
if ((_middlewareData$autoP = middlewareData.autoPlacement) != null && _middlewareData$autoP.skip) {
|
|
368
|
+
return {};
|
|
369
|
+
}
|
|
370
|
+
const placements2 = getPlacementList(alignment, autoAlignment, allowedPlacements);
|
|
371
|
+
const overflow = await detectOverflow$1(middlewareArguments, detectOverflowOptions);
|
|
372
|
+
const currentIndex = (_middlewareData$autoP2 = (_middlewareData$autoP3 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP3.index) != null ? _middlewareData$autoP2 : 0;
|
|
373
|
+
const currentPlacement = placements2[currentIndex];
|
|
374
|
+
const {
|
|
375
|
+
main: main2,
|
|
376
|
+
cross
|
|
377
|
+
} = getAlignmentSides(currentPlacement, rects);
|
|
378
|
+
if (placement !== currentPlacement) {
|
|
379
|
+
return {
|
|
380
|
+
x,
|
|
381
|
+
y,
|
|
382
|
+
reset: {
|
|
383
|
+
placement: placements2[0]
|
|
384
|
+
}
|
|
385
|
+
};
|
|
386
|
+
}
|
|
387
|
+
const currentOverflows = [overflow[getBasePlacement$2(currentPlacement)], overflow[main2], overflow[cross]];
|
|
388
|
+
const allOverflows = [...(_middlewareData$autoP4 = (_middlewareData$autoP5 = middlewareData.autoPlacement) == null ? void 0 : _middlewareData$autoP5.overflows) != null ? _middlewareData$autoP4 : [], {
|
|
389
|
+
placement: currentPlacement,
|
|
390
|
+
overflows: currentOverflows
|
|
391
|
+
}];
|
|
392
|
+
const nextPlacement = placements2[currentIndex + 1];
|
|
393
|
+
if (nextPlacement) {
|
|
394
|
+
return {
|
|
395
|
+
data: {
|
|
396
|
+
index: currentIndex + 1,
|
|
397
|
+
overflows: allOverflows
|
|
398
|
+
},
|
|
399
|
+
reset: {
|
|
400
|
+
placement: nextPlacement
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
const placementsSortedByLeastOverflow = allOverflows.slice().sort((a, b) => a.overflows[0] - b.overflows[0]);
|
|
405
|
+
const placementThatFitsOnAllSides = (_placementsSortedByLe = placementsSortedByLeastOverflow.find((_ref2) => {
|
|
406
|
+
let {
|
|
407
|
+
overflows
|
|
408
|
+
} = _ref2;
|
|
409
|
+
return overflows.every((overflow2) => overflow2 <= 0);
|
|
410
|
+
})) == null ? void 0 : _placementsSortedByLe.placement;
|
|
411
|
+
return {
|
|
412
|
+
data: {
|
|
413
|
+
skip: true
|
|
414
|
+
},
|
|
415
|
+
reset: {
|
|
416
|
+
placement: placementThatFitsOnAllSides != null ? placementThatFitsOnAllSides : placementsSortedByLeastOverflow[0].placement
|
|
417
|
+
}
|
|
418
|
+
};
|
|
419
|
+
}
|
|
420
|
+
};
|
|
421
|
+
};
|
|
422
|
+
function getExpandedPlacements(placement) {
|
|
423
|
+
const oppositePlacement = getOppositePlacement$1(placement);
|
|
424
|
+
return [getOppositeAlignmentPlacement(placement), oppositePlacement, getOppositeAlignmentPlacement(oppositePlacement)];
|
|
425
|
+
}
|
|
426
|
+
const flip$2 = function(options) {
|
|
427
|
+
if (options === void 0) {
|
|
428
|
+
options = {};
|
|
429
|
+
}
|
|
430
|
+
return {
|
|
431
|
+
name: "flip",
|
|
432
|
+
options,
|
|
433
|
+
async fn(middlewareArguments) {
|
|
434
|
+
var _middlewareData$flip, _middlewareData$flip2;
|
|
435
|
+
const {
|
|
436
|
+
placement,
|
|
437
|
+
middlewareData,
|
|
438
|
+
rects,
|
|
439
|
+
initialPlacement
|
|
440
|
+
} = middlewareArguments;
|
|
441
|
+
if ((_middlewareData$flip = middlewareData.flip) != null && _middlewareData$flip.skip) {
|
|
442
|
+
return {};
|
|
443
|
+
}
|
|
444
|
+
const _a = options, {
|
|
445
|
+
mainAxis: checkMainAxis = true,
|
|
446
|
+
crossAxis: checkCrossAxis = true,
|
|
447
|
+
fallbackPlacements: specifiedFallbackPlacements,
|
|
448
|
+
fallbackStrategy = "bestFit",
|
|
449
|
+
flipAlignment = true
|
|
450
|
+
} = _a, detectOverflowOptions = __objRest(_a, [
|
|
451
|
+
"mainAxis",
|
|
452
|
+
"crossAxis",
|
|
453
|
+
"fallbackPlacements",
|
|
454
|
+
"fallbackStrategy",
|
|
455
|
+
"flipAlignment"
|
|
456
|
+
]);
|
|
457
|
+
const basePlacement = getBasePlacement$2(placement);
|
|
458
|
+
const isBasePlacement = basePlacement === initialPlacement;
|
|
459
|
+
const fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement$1(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
460
|
+
const placements2 = [initialPlacement, ...fallbackPlacements];
|
|
461
|
+
const overflow = await detectOverflow$1(middlewareArguments, detectOverflowOptions);
|
|
462
|
+
const overflows = [];
|
|
463
|
+
let overflowsData = ((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.overflows) || [];
|
|
464
|
+
if (checkMainAxis) {
|
|
465
|
+
overflows.push(overflow[basePlacement]);
|
|
466
|
+
}
|
|
467
|
+
if (checkCrossAxis) {
|
|
468
|
+
const {
|
|
469
|
+
main: main2,
|
|
470
|
+
cross
|
|
471
|
+
} = getAlignmentSides(placement, rects);
|
|
472
|
+
overflows.push(overflow[main2], overflow[cross]);
|
|
473
|
+
}
|
|
474
|
+
overflowsData = [...overflowsData, {
|
|
475
|
+
placement,
|
|
476
|
+
overflows
|
|
477
|
+
}];
|
|
478
|
+
if (!overflows.every((side) => side <= 0)) {
|
|
479
|
+
var _middlewareData$flip$, _middlewareData$flip3;
|
|
480
|
+
const nextIndex = ((_middlewareData$flip$ = (_middlewareData$flip3 = middlewareData.flip) == null ? void 0 : _middlewareData$flip3.index) != null ? _middlewareData$flip$ : 0) + 1;
|
|
481
|
+
const nextPlacement = placements2[nextIndex];
|
|
482
|
+
if (nextPlacement) {
|
|
483
|
+
return {
|
|
484
|
+
data: {
|
|
485
|
+
index: nextIndex,
|
|
486
|
+
overflows: overflowsData
|
|
487
|
+
},
|
|
488
|
+
reset: {
|
|
489
|
+
placement: nextPlacement
|
|
490
|
+
}
|
|
491
|
+
};
|
|
492
|
+
}
|
|
493
|
+
let resetPlacement = "bottom";
|
|
494
|
+
switch (fallbackStrategy) {
|
|
495
|
+
case "bestFit": {
|
|
496
|
+
var _overflowsData$slice$;
|
|
497
|
+
const placement2 = (_overflowsData$slice$ = overflowsData.slice().sort((a, b) => a.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0) - b.overflows.filter((overflow2) => overflow2 > 0).reduce((acc, overflow2) => acc + overflow2, 0))[0]) == null ? void 0 : _overflowsData$slice$.placement;
|
|
498
|
+
if (placement2) {
|
|
499
|
+
resetPlacement = placement2;
|
|
500
|
+
}
|
|
501
|
+
break;
|
|
502
|
+
}
|
|
503
|
+
case "initialPlacement":
|
|
504
|
+
resetPlacement = initialPlacement;
|
|
505
|
+
break;
|
|
506
|
+
}
|
|
507
|
+
return {
|
|
508
|
+
data: {
|
|
509
|
+
skip: true
|
|
510
|
+
},
|
|
511
|
+
reset: {
|
|
512
|
+
placement: resetPlacement
|
|
513
|
+
}
|
|
514
|
+
};
|
|
515
|
+
}
|
|
516
|
+
return {};
|
|
517
|
+
}
|
|
518
|
+
};
|
|
519
|
+
};
|
|
520
|
+
function convertValueToCoords(_ref2) {
|
|
521
|
+
let {
|
|
522
|
+
placement,
|
|
523
|
+
rects,
|
|
524
|
+
value
|
|
525
|
+
} = _ref2;
|
|
526
|
+
const basePlacement = getBasePlacement$2(placement);
|
|
527
|
+
const multiplier = ["left", "top"].includes(basePlacement) ? -1 : 1;
|
|
528
|
+
const rawValue = typeof value === "function" ? value(__spreadProps(__spreadValues({}, rects), {
|
|
529
|
+
placement
|
|
530
|
+
})) : value;
|
|
531
|
+
const {
|
|
532
|
+
mainAxis,
|
|
533
|
+
crossAxis
|
|
534
|
+
} = typeof rawValue === "number" ? {
|
|
535
|
+
mainAxis: rawValue,
|
|
536
|
+
crossAxis: 0
|
|
537
|
+
} : __spreadValues({
|
|
538
|
+
mainAxis: 0,
|
|
539
|
+
crossAxis: 0
|
|
540
|
+
}, rawValue);
|
|
541
|
+
return getMainAxisFromPlacement$1(basePlacement) === "x" ? {
|
|
542
|
+
x: crossAxis,
|
|
543
|
+
y: mainAxis * multiplier
|
|
544
|
+
} : {
|
|
545
|
+
x: mainAxis * multiplier,
|
|
546
|
+
y: crossAxis
|
|
547
|
+
};
|
|
548
|
+
}
|
|
549
|
+
const offset$2 = function(value) {
|
|
550
|
+
if (value === void 0) {
|
|
551
|
+
value = 0;
|
|
552
|
+
}
|
|
553
|
+
return {
|
|
554
|
+
name: "offset",
|
|
555
|
+
options: value,
|
|
556
|
+
fn(middlewareArguments) {
|
|
557
|
+
const {
|
|
558
|
+
x,
|
|
559
|
+
y,
|
|
560
|
+
placement,
|
|
561
|
+
rects
|
|
562
|
+
} = middlewareArguments;
|
|
563
|
+
const diffCoords = convertValueToCoords({
|
|
564
|
+
placement,
|
|
565
|
+
rects,
|
|
566
|
+
value
|
|
567
|
+
});
|
|
568
|
+
return {
|
|
569
|
+
x: x + diffCoords.x,
|
|
570
|
+
y: y + diffCoords.y,
|
|
571
|
+
data: diffCoords
|
|
572
|
+
};
|
|
573
|
+
}
|
|
574
|
+
};
|
|
575
|
+
};
|
|
576
|
+
function getCrossAxis(axis) {
|
|
577
|
+
return axis === "x" ? "y" : "x";
|
|
578
|
+
}
|
|
579
|
+
const shift = function(options) {
|
|
580
|
+
if (options === void 0) {
|
|
581
|
+
options = {};
|
|
582
|
+
}
|
|
583
|
+
return {
|
|
584
|
+
name: "shift",
|
|
585
|
+
options,
|
|
586
|
+
async fn(middlewareArguments) {
|
|
587
|
+
const {
|
|
588
|
+
x,
|
|
589
|
+
y,
|
|
590
|
+
placement
|
|
591
|
+
} = middlewareArguments;
|
|
592
|
+
const _a = options, {
|
|
593
|
+
mainAxis: checkMainAxis = true,
|
|
594
|
+
crossAxis: checkCrossAxis = false,
|
|
595
|
+
limiter = {
|
|
596
|
+
fn: (_ref2) => {
|
|
597
|
+
let {
|
|
598
|
+
x: x2,
|
|
599
|
+
y: y2
|
|
600
|
+
} = _ref2;
|
|
601
|
+
return {
|
|
602
|
+
x: x2,
|
|
603
|
+
y: y2
|
|
604
|
+
};
|
|
605
|
+
}
|
|
606
|
+
}
|
|
607
|
+
} = _a, detectOverflowOptions = __objRest(_a, [
|
|
608
|
+
"mainAxis",
|
|
609
|
+
"crossAxis",
|
|
610
|
+
"limiter"
|
|
611
|
+
]);
|
|
612
|
+
const coords = {
|
|
613
|
+
x,
|
|
614
|
+
y
|
|
615
|
+
};
|
|
616
|
+
const overflow = await detectOverflow$1(middlewareArguments, detectOverflowOptions);
|
|
617
|
+
const mainAxis = getMainAxisFromPlacement$1(getBasePlacement$2(placement));
|
|
618
|
+
const crossAxis = getCrossAxis(mainAxis);
|
|
619
|
+
let mainAxisCoord = coords[mainAxis];
|
|
620
|
+
let crossAxisCoord = coords[crossAxis];
|
|
621
|
+
if (checkMainAxis) {
|
|
622
|
+
const minSide = mainAxis === "y" ? "top" : "left";
|
|
623
|
+
const maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
624
|
+
const min2 = mainAxisCoord + overflow[minSide];
|
|
625
|
+
const max2 = mainAxisCoord - overflow[maxSide];
|
|
626
|
+
mainAxisCoord = within$1(min2, mainAxisCoord, max2);
|
|
627
|
+
}
|
|
628
|
+
if (checkCrossAxis) {
|
|
629
|
+
const minSide = crossAxis === "y" ? "top" : "left";
|
|
630
|
+
const maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
631
|
+
const min2 = crossAxisCoord + overflow[minSide];
|
|
632
|
+
const max2 = crossAxisCoord - overflow[maxSide];
|
|
633
|
+
crossAxisCoord = within$1(min2, crossAxisCoord, max2);
|
|
634
|
+
}
|
|
635
|
+
const limitedCoords = limiter.fn(__spreadProps(__spreadValues({}, middlewareArguments), {
|
|
636
|
+
[mainAxis]: mainAxisCoord,
|
|
637
|
+
[crossAxis]: crossAxisCoord
|
|
638
|
+
}));
|
|
639
|
+
return __spreadProps(__spreadValues({}, limitedCoords), {
|
|
640
|
+
data: {
|
|
641
|
+
x: limitedCoords.x - x,
|
|
642
|
+
y: limitedCoords.y - y
|
|
643
|
+
}
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
};
|
|
647
|
+
};
|
|
648
|
+
const size = function(options) {
|
|
649
|
+
if (options === void 0) {
|
|
650
|
+
options = {};
|
|
651
|
+
}
|
|
652
|
+
return {
|
|
653
|
+
name: "size",
|
|
654
|
+
options,
|
|
655
|
+
async fn(middlewareArguments) {
|
|
656
|
+
var _middlewareData$size;
|
|
657
|
+
const {
|
|
658
|
+
placement,
|
|
659
|
+
rects,
|
|
660
|
+
middlewareData
|
|
661
|
+
} = middlewareArguments;
|
|
662
|
+
const _a = options, {
|
|
663
|
+
apply
|
|
664
|
+
} = _a, detectOverflowOptions = __objRest(_a, [
|
|
665
|
+
"apply"
|
|
666
|
+
]);
|
|
667
|
+
if ((_middlewareData$size = middlewareData.size) != null && _middlewareData$size.skip) {
|
|
668
|
+
return {};
|
|
669
|
+
}
|
|
670
|
+
const overflow = await detectOverflow$1(middlewareArguments, detectOverflowOptions);
|
|
671
|
+
const basePlacement = getBasePlacement$2(placement);
|
|
672
|
+
const isEnd = getAlignment(placement) === "end";
|
|
673
|
+
let heightSide;
|
|
674
|
+
let widthSide;
|
|
675
|
+
if (basePlacement === "top" || basePlacement === "bottom") {
|
|
676
|
+
heightSide = basePlacement;
|
|
677
|
+
widthSide = isEnd ? "left" : "right";
|
|
678
|
+
} else {
|
|
679
|
+
widthSide = basePlacement;
|
|
680
|
+
heightSide = isEnd ? "top" : "bottom";
|
|
681
|
+
}
|
|
682
|
+
const xMin = max$2(overflow.left, 0);
|
|
683
|
+
const xMax = max$2(overflow.right, 0);
|
|
684
|
+
const yMin = max$2(overflow.top, 0);
|
|
685
|
+
const yMax = max$2(overflow.bottom, 0);
|
|
686
|
+
const dimensions = {
|
|
687
|
+
height: rects.floating.height - (["left", "right"].includes(placement) ? 2 * (yMin !== 0 || yMax !== 0 ? yMin + yMax : max$2(overflow.top, overflow.bottom)) : overflow[heightSide]),
|
|
688
|
+
width: rects.floating.width - (["top", "bottom"].includes(placement) ? 2 * (xMin !== 0 || xMax !== 0 ? xMin + xMax : max$2(overflow.left, overflow.right)) : overflow[widthSide])
|
|
689
|
+
};
|
|
690
|
+
apply == null ? void 0 : apply(__spreadValues(__spreadValues({}, dimensions), rects));
|
|
691
|
+
return {
|
|
692
|
+
data: {
|
|
693
|
+
skip: true
|
|
694
|
+
},
|
|
695
|
+
reset: {
|
|
696
|
+
rects: true
|
|
697
|
+
}
|
|
698
|
+
};
|
|
699
|
+
}
|
|
700
|
+
};
|
|
701
|
+
};
|
|
702
|
+
function isWindow(value) {
|
|
703
|
+
return (value == null ? void 0 : value.toString()) === "[object Window]";
|
|
704
|
+
}
|
|
705
|
+
function getWindow$1(node) {
|
|
706
|
+
if (node == null) {
|
|
707
|
+
return window;
|
|
708
|
+
}
|
|
709
|
+
if (!isWindow(node)) {
|
|
710
|
+
const ownerDocument = node.ownerDocument;
|
|
711
|
+
return ownerDocument ? ownerDocument.defaultView || window : window;
|
|
712
|
+
}
|
|
713
|
+
return node;
|
|
714
|
+
}
|
|
715
|
+
function getComputedStyle$1$1(element) {
|
|
716
|
+
return getWindow$1(element).getComputedStyle(element);
|
|
717
|
+
}
|
|
718
|
+
function getNodeName$1(node) {
|
|
719
|
+
return isWindow(node) ? "" : node ? (node.nodeName || "").toLowerCase() : "";
|
|
720
|
+
}
|
|
721
|
+
function isHTMLElement$1(value) {
|
|
722
|
+
return value instanceof getWindow$1(value).HTMLElement;
|
|
723
|
+
}
|
|
724
|
+
function isElement$2(value) {
|
|
725
|
+
return value instanceof getWindow$1(value).Element;
|
|
726
|
+
}
|
|
727
|
+
function isNode(value) {
|
|
728
|
+
return value instanceof getWindow$1(value).Node;
|
|
729
|
+
}
|
|
730
|
+
function isShadowRoot$1(node) {
|
|
731
|
+
const OwnElement = getWindow$1(node).ShadowRoot;
|
|
732
|
+
return node instanceof OwnElement || node instanceof ShadowRoot;
|
|
733
|
+
}
|
|
734
|
+
function isScrollParent$1(element) {
|
|
735
|
+
const {
|
|
736
|
+
overflow,
|
|
737
|
+
overflowX,
|
|
738
|
+
overflowY
|
|
739
|
+
} = getComputedStyle$1$1(element);
|
|
740
|
+
return /auto|scroll|overlay|hidden/.test(overflow + overflowY + overflowX);
|
|
741
|
+
}
|
|
742
|
+
function isTableElement$1(element) {
|
|
743
|
+
return ["table", "td", "th"].includes(getNodeName$1(element));
|
|
744
|
+
}
|
|
745
|
+
function isContainingBlock(element) {
|
|
746
|
+
const isFirefox = navigator.userAgent.toLowerCase().includes("firefox");
|
|
747
|
+
const css2 = getComputedStyle$1$1(element);
|
|
748
|
+
return css2.transform !== "none" || css2.perspective !== "none" || css2.contain === "paint" || ["transform", "perspective"].includes(css2.willChange) || isFirefox && css2.willChange === "filter" || isFirefox && (css2.filter ? css2.filter !== "none" : false);
|
|
749
|
+
}
|
|
750
|
+
const min$1 = Math.min;
|
|
751
|
+
const max$1 = Math.max;
|
|
752
|
+
const round$1 = Math.round;
|
|
753
|
+
function getBoundingClientRect$1(element, includeScale) {
|
|
754
|
+
if (includeScale === void 0) {
|
|
755
|
+
includeScale = false;
|
|
756
|
+
}
|
|
757
|
+
const clientRect = element.getBoundingClientRect();
|
|
758
|
+
let scaleX = 1;
|
|
759
|
+
let scaleY = 1;
|
|
760
|
+
if (includeScale && isHTMLElement$1(element)) {
|
|
761
|
+
scaleX = element.offsetWidth > 0 ? round$1(clientRect.width) / element.offsetWidth || 1 : 1;
|
|
762
|
+
scaleY = element.offsetHeight > 0 ? round$1(clientRect.height) / element.offsetHeight || 1 : 1;
|
|
763
|
+
}
|
|
764
|
+
return {
|
|
765
|
+
width: clientRect.width / scaleX,
|
|
766
|
+
height: clientRect.height / scaleY,
|
|
767
|
+
top: clientRect.top / scaleY,
|
|
768
|
+
right: clientRect.right / scaleX,
|
|
769
|
+
bottom: clientRect.bottom / scaleY,
|
|
770
|
+
left: clientRect.left / scaleX,
|
|
771
|
+
x: clientRect.left / scaleX,
|
|
772
|
+
y: clientRect.top / scaleY
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
function getDocumentElement$1(node) {
|
|
776
|
+
return ((isNode(node) ? node.ownerDocument : node.document) || window.document).documentElement;
|
|
777
|
+
}
|
|
778
|
+
function getNodeScroll$1(element) {
|
|
779
|
+
if (isWindow(element)) {
|
|
780
|
+
return {
|
|
781
|
+
scrollLeft: element.pageXOffset,
|
|
782
|
+
scrollTop: element.pageYOffset
|
|
783
|
+
};
|
|
784
|
+
}
|
|
785
|
+
return {
|
|
786
|
+
scrollLeft: element.scrollLeft,
|
|
787
|
+
scrollTop: element.scrollTop
|
|
788
|
+
};
|
|
789
|
+
}
|
|
790
|
+
function getWindowScrollBarX$1(element) {
|
|
791
|
+
return getBoundingClientRect$1(getDocumentElement$1(element)).left + getNodeScroll$1(element).scrollLeft;
|
|
792
|
+
}
|
|
793
|
+
function isScaled(element) {
|
|
794
|
+
const rect = getBoundingClientRect$1(element);
|
|
795
|
+
return round$1(rect.width) !== element.offsetWidth || round$1(rect.height) !== element.offsetHeight;
|
|
796
|
+
}
|
|
797
|
+
function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
798
|
+
const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
|
|
799
|
+
const documentElement = getDocumentElement$1(offsetParent);
|
|
800
|
+
const rect = getBoundingClientRect$1(element, isOffsetParentAnElement && isScaled(offsetParent));
|
|
801
|
+
let scroll = {
|
|
802
|
+
scrollLeft: 0,
|
|
803
|
+
scrollTop: 0
|
|
804
|
+
};
|
|
805
|
+
const offsets = {
|
|
806
|
+
x: 0,
|
|
807
|
+
y: 0
|
|
808
|
+
};
|
|
809
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
|
810
|
+
if (getNodeName$1(offsetParent) !== "body" || isScrollParent$1(documentElement)) {
|
|
811
|
+
scroll = getNodeScroll$1(offsetParent);
|
|
812
|
+
}
|
|
813
|
+
if (isHTMLElement$1(offsetParent)) {
|
|
814
|
+
const offsetRect = getBoundingClientRect$1(offsetParent, true);
|
|
815
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
816
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
817
|
+
} else if (documentElement) {
|
|
818
|
+
offsets.x = getWindowScrollBarX$1(documentElement);
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
return {
|
|
822
|
+
x: rect.left + scroll.scrollLeft - offsets.x,
|
|
823
|
+
y: rect.top + scroll.scrollTop - offsets.y,
|
|
824
|
+
width: rect.width,
|
|
825
|
+
height: rect.height
|
|
826
|
+
};
|
|
827
|
+
}
|
|
828
|
+
function getParentNode$1(node) {
|
|
829
|
+
if (getNodeName$1(node) === "html") {
|
|
830
|
+
return node;
|
|
831
|
+
}
|
|
832
|
+
return node.assignedSlot || node.parentNode || (isShadowRoot$1(node) ? node.host : null) || getDocumentElement$1(node);
|
|
833
|
+
}
|
|
834
|
+
function getTrueOffsetParent$1(element) {
|
|
835
|
+
if (!isHTMLElement$1(element) || getComputedStyle(element).position === "fixed") {
|
|
836
|
+
return null;
|
|
837
|
+
}
|
|
838
|
+
return element.offsetParent;
|
|
839
|
+
}
|
|
840
|
+
function getContainingBlock$1(element) {
|
|
841
|
+
let currentNode = getParentNode$1(element);
|
|
842
|
+
while (isHTMLElement$1(currentNode) && !["html", "body"].includes(getNodeName$1(currentNode))) {
|
|
843
|
+
if (isContainingBlock(currentNode)) {
|
|
844
|
+
return currentNode;
|
|
845
|
+
} else {
|
|
846
|
+
currentNode = currentNode.parentNode;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
return null;
|
|
850
|
+
}
|
|
851
|
+
function getOffsetParent$1(element) {
|
|
852
|
+
const window2 = getWindow$1(element);
|
|
853
|
+
let offsetParent = getTrueOffsetParent$1(element);
|
|
854
|
+
while (offsetParent && isTableElement$1(offsetParent) && getComputedStyle(offsetParent).position === "static") {
|
|
855
|
+
offsetParent = getTrueOffsetParent$1(offsetParent);
|
|
856
|
+
}
|
|
857
|
+
if (offsetParent && (getNodeName$1(offsetParent) === "html" || getNodeName$1(offsetParent) === "body" && getComputedStyle(offsetParent).position === "static" && !isContainingBlock(offsetParent))) {
|
|
858
|
+
return window2;
|
|
859
|
+
}
|
|
860
|
+
return offsetParent || getContainingBlock$1(element) || window2;
|
|
861
|
+
}
|
|
862
|
+
function getDimensions(element) {
|
|
863
|
+
return {
|
|
864
|
+
width: element.offsetWidth,
|
|
865
|
+
height: element.offsetHeight
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref2) {
|
|
869
|
+
let {
|
|
870
|
+
rect,
|
|
871
|
+
offsetParent,
|
|
872
|
+
strategy
|
|
873
|
+
} = _ref2;
|
|
874
|
+
const isOffsetParentAnElement = isHTMLElement$1(offsetParent);
|
|
875
|
+
const documentElement = getDocumentElement$1(offsetParent);
|
|
876
|
+
if (offsetParent === documentElement) {
|
|
877
|
+
return rect;
|
|
878
|
+
}
|
|
879
|
+
let scroll = {
|
|
880
|
+
scrollLeft: 0,
|
|
881
|
+
scrollTop: 0
|
|
882
|
+
};
|
|
883
|
+
const offsets = {
|
|
884
|
+
x: 0,
|
|
885
|
+
y: 0
|
|
886
|
+
};
|
|
887
|
+
if (isOffsetParentAnElement || !isOffsetParentAnElement && strategy !== "fixed") {
|
|
888
|
+
if (getNodeName$1(offsetParent) !== "body" || isScrollParent$1(documentElement)) {
|
|
889
|
+
scroll = getNodeScroll$1(offsetParent);
|
|
890
|
+
}
|
|
891
|
+
if (isHTMLElement$1(offsetParent)) {
|
|
892
|
+
const offsetRect = getBoundingClientRect$1(offsetParent, true);
|
|
893
|
+
offsets.x = offsetRect.x + offsetParent.clientLeft;
|
|
894
|
+
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
return __spreadProps(__spreadValues({}, rect), {
|
|
898
|
+
x: rect.x - scroll.scrollLeft + offsets.x,
|
|
899
|
+
y: rect.y - scroll.scrollTop + offsets.y
|
|
900
|
+
});
|
|
901
|
+
}
|
|
902
|
+
function getViewportRect$1(element) {
|
|
903
|
+
const win = getWindow$1(element);
|
|
904
|
+
const html = getDocumentElement$1(element);
|
|
905
|
+
const visualViewport = win.visualViewport;
|
|
906
|
+
let width = html.clientWidth;
|
|
907
|
+
let height = html.clientHeight;
|
|
908
|
+
let x = 0;
|
|
909
|
+
let y = 0;
|
|
910
|
+
if (visualViewport) {
|
|
911
|
+
width = visualViewport.width;
|
|
912
|
+
height = visualViewport.height;
|
|
913
|
+
if (Math.abs(win.innerWidth / visualViewport.scale - visualViewport.width) < 0.01) {
|
|
914
|
+
x = visualViewport.offsetLeft;
|
|
915
|
+
y = visualViewport.offsetTop;
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
return {
|
|
919
|
+
width,
|
|
920
|
+
height,
|
|
921
|
+
x,
|
|
922
|
+
y
|
|
923
|
+
};
|
|
924
|
+
}
|
|
925
|
+
function getDocumentRect$1(element) {
|
|
926
|
+
var _element$ownerDocumen;
|
|
927
|
+
const html = getDocumentElement$1(element);
|
|
928
|
+
const scroll = getNodeScroll$1(element);
|
|
929
|
+
const body = (_element$ownerDocumen = element.ownerDocument) == null ? void 0 : _element$ownerDocumen.body;
|
|
930
|
+
const width = max$1(html.scrollWidth, html.clientWidth, body ? body.scrollWidth : 0, body ? body.clientWidth : 0);
|
|
931
|
+
const height = max$1(html.scrollHeight, html.clientHeight, body ? body.scrollHeight : 0, body ? body.clientHeight : 0);
|
|
932
|
+
let x = -scroll.scrollLeft + getWindowScrollBarX$1(element);
|
|
933
|
+
const y = -scroll.scrollTop;
|
|
934
|
+
if (getComputedStyle$1$1(body || html).direction === "rtl") {
|
|
935
|
+
x += max$1(html.clientWidth, body ? body.clientWidth : 0) - width;
|
|
936
|
+
}
|
|
937
|
+
return {
|
|
938
|
+
width,
|
|
939
|
+
height,
|
|
940
|
+
x,
|
|
941
|
+
y
|
|
942
|
+
};
|
|
943
|
+
}
|
|
944
|
+
function getScrollParent$1(node) {
|
|
945
|
+
if (["html", "body", "#document"].includes(getNodeName$1(node))) {
|
|
946
|
+
return node.ownerDocument.body;
|
|
947
|
+
}
|
|
948
|
+
if (isHTMLElement$1(node) && isScrollParent$1(node)) {
|
|
949
|
+
return node;
|
|
950
|
+
}
|
|
951
|
+
return getScrollParent$1(getParentNode$1(node));
|
|
952
|
+
}
|
|
953
|
+
function getScrollParents(node, list) {
|
|
954
|
+
var _node$ownerDocument;
|
|
955
|
+
if (list === void 0) {
|
|
956
|
+
list = [];
|
|
957
|
+
}
|
|
958
|
+
const scrollParent = getScrollParent$1(node);
|
|
959
|
+
const isBody = scrollParent === ((_node$ownerDocument = node.ownerDocument) == null ? void 0 : _node$ownerDocument.body);
|
|
960
|
+
const win = getWindow$1(scrollParent);
|
|
961
|
+
const target = isBody ? [win].concat(win.visualViewport || [], isScrollParent$1(scrollParent) ? scrollParent : []) : scrollParent;
|
|
962
|
+
const updatedList = list.concat(target);
|
|
963
|
+
return isBody ? updatedList : updatedList.concat(getScrollParents(getParentNode$1(target)));
|
|
964
|
+
}
|
|
965
|
+
function contains$1(parent, child) {
|
|
966
|
+
const rootNode = child.getRootNode == null ? void 0 : child.getRootNode();
|
|
967
|
+
if (parent.contains(child)) {
|
|
968
|
+
return true;
|
|
969
|
+
} else if (rootNode && isShadowRoot$1(rootNode)) {
|
|
970
|
+
let next = child;
|
|
971
|
+
do {
|
|
972
|
+
if (next && parent === next) {
|
|
973
|
+
return true;
|
|
974
|
+
}
|
|
975
|
+
next = next.parentNode || next.host;
|
|
976
|
+
} while (next);
|
|
977
|
+
}
|
|
978
|
+
return false;
|
|
979
|
+
}
|
|
980
|
+
function getInnerBoundingClientRect$1(element) {
|
|
981
|
+
const clientRect = getBoundingClientRect$1(element);
|
|
982
|
+
const top2 = clientRect.top + element.clientTop;
|
|
983
|
+
const left2 = clientRect.left + element.clientLeft;
|
|
984
|
+
return {
|
|
985
|
+
top: top2,
|
|
986
|
+
left: left2,
|
|
987
|
+
x: left2,
|
|
988
|
+
y: top2,
|
|
989
|
+
right: left2 + element.clientWidth,
|
|
990
|
+
bottom: top2 + element.clientHeight,
|
|
991
|
+
width: element.clientWidth,
|
|
992
|
+
height: element.clientHeight
|
|
993
|
+
};
|
|
994
|
+
}
|
|
995
|
+
function getClientRectFromClippingParent(element, clippingParent) {
|
|
996
|
+
if (clippingParent === "viewport") {
|
|
997
|
+
return rectToClientRect$1(getViewportRect$1(element));
|
|
998
|
+
}
|
|
999
|
+
if (isElement$2(clippingParent)) {
|
|
1000
|
+
return getInnerBoundingClientRect$1(clippingParent);
|
|
1001
|
+
}
|
|
1002
|
+
return rectToClientRect$1(getDocumentRect$1(getDocumentElement$1(element)));
|
|
1003
|
+
}
|
|
1004
|
+
function getClippingParents$1(element) {
|
|
1005
|
+
const clippingParents2 = getScrollParents(getParentNode$1(element));
|
|
1006
|
+
const canEscapeClipping = ["absolute", "fixed"].includes(getComputedStyle$1$1(element).position);
|
|
1007
|
+
const clipperElement = canEscapeClipping && isHTMLElement$1(element) ? getOffsetParent$1(element) : element;
|
|
1008
|
+
if (!isElement$2(clipperElement)) {
|
|
1009
|
+
return [];
|
|
1010
|
+
}
|
|
1011
|
+
return clippingParents2.filter((clippingParent) => isElement$2(clippingParent) && contains$1(clippingParent, clipperElement) && getNodeName$1(clippingParent) !== "body");
|
|
1012
|
+
}
|
|
1013
|
+
function getClippingClientRect(_ref2) {
|
|
1014
|
+
let {
|
|
1015
|
+
element,
|
|
1016
|
+
boundary,
|
|
1017
|
+
rootBoundary
|
|
1018
|
+
} = _ref2;
|
|
1019
|
+
const mainClippingParents = boundary === "clippingParents" ? getClippingParents$1(element) : [].concat(boundary);
|
|
1020
|
+
const clippingParents2 = [...mainClippingParents, rootBoundary];
|
|
1021
|
+
const firstClippingParent = clippingParents2[0];
|
|
1022
|
+
const clippingRect = clippingParents2.reduce((accRect, clippingParent) => {
|
|
1023
|
+
const rect = getClientRectFromClippingParent(element, clippingParent);
|
|
1024
|
+
accRect.top = max$1(rect.top, accRect.top);
|
|
1025
|
+
accRect.right = min$1(rect.right, accRect.right);
|
|
1026
|
+
accRect.bottom = min$1(rect.bottom, accRect.bottom);
|
|
1027
|
+
accRect.left = max$1(rect.left, accRect.left);
|
|
1028
|
+
return accRect;
|
|
1029
|
+
}, getClientRectFromClippingParent(element, firstClippingParent));
|
|
1030
|
+
clippingRect.width = clippingRect.right - clippingRect.left;
|
|
1031
|
+
clippingRect.height = clippingRect.bottom - clippingRect.top;
|
|
1032
|
+
clippingRect.x = clippingRect.left;
|
|
1033
|
+
clippingRect.y = clippingRect.top;
|
|
1034
|
+
return clippingRect;
|
|
1035
|
+
}
|
|
1036
|
+
const platform = {
|
|
1037
|
+
getElementRects: (_ref2) => {
|
|
1038
|
+
let {
|
|
1039
|
+
reference: reference2,
|
|
1040
|
+
floating,
|
|
1041
|
+
strategy
|
|
1042
|
+
} = _ref2;
|
|
1043
|
+
return {
|
|
1044
|
+
reference: getRectRelativeToOffsetParent(reference2, getOffsetParent$1(floating), strategy),
|
|
1045
|
+
floating: __spreadProps(__spreadValues({}, getDimensions(floating)), {
|
|
1046
|
+
x: 0,
|
|
1047
|
+
y: 0
|
|
1048
|
+
})
|
|
1049
|
+
};
|
|
1050
|
+
},
|
|
1051
|
+
convertOffsetParentRelativeRectToViewportRelativeRect: (args) => convertOffsetParentRelativeRectToViewportRelativeRect(args),
|
|
1052
|
+
getOffsetParent: (_ref2) => {
|
|
1053
|
+
let {
|
|
1054
|
+
element
|
|
1055
|
+
} = _ref2;
|
|
1056
|
+
return getOffsetParent$1(element);
|
|
1057
|
+
},
|
|
1058
|
+
isElement: (value) => isElement$2(value),
|
|
1059
|
+
getDocumentElement: (_ref3) => {
|
|
1060
|
+
let {
|
|
1061
|
+
element
|
|
1062
|
+
} = _ref3;
|
|
1063
|
+
return getDocumentElement$1(element);
|
|
1064
|
+
},
|
|
1065
|
+
getClippingClientRect: (args) => getClippingClientRect(args),
|
|
1066
|
+
getDimensions: (_ref4) => {
|
|
1067
|
+
let {
|
|
1068
|
+
element
|
|
1069
|
+
} = _ref4;
|
|
1070
|
+
return getDimensions(element);
|
|
1071
|
+
},
|
|
1072
|
+
getClientRects: (_ref5) => {
|
|
1073
|
+
let {
|
|
1074
|
+
element
|
|
1075
|
+
} = _ref5;
|
|
1076
|
+
return element.getClientRects();
|
|
1077
|
+
}
|
|
1078
|
+
};
|
|
1079
|
+
const computePosition = (reference2, floating, options) => computePosition$1(reference2, floating, __spreadValues({
|
|
1080
|
+
platform
|
|
1081
|
+
}, options));
|
|
1082
|
+
var __defProp2 = Object.defineProperty;
|
|
1083
|
+
var __defProps2 = Object.defineProperties;
|
|
1084
|
+
var __getOwnPropDescs2 = Object.getOwnPropertyDescriptors;
|
|
1085
|
+
var __getOwnPropSymbols2 = Object.getOwnPropertySymbols;
|
|
1086
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
1087
|
+
var __propIsEnum2 = Object.prototype.propertyIsEnumerable;
|
|
1088
|
+
var __defNormalProp2 = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
1089
|
+
var __spreadValues2 = (a, b) => {
|
|
1090
|
+
for (var prop in b || (b = {}))
|
|
1091
|
+
if (__hasOwnProp2.call(b, prop))
|
|
1092
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
1093
|
+
if (__getOwnPropSymbols2)
|
|
1094
|
+
for (var prop of __getOwnPropSymbols2(b)) {
|
|
1095
|
+
if (__propIsEnum2.call(b, prop))
|
|
1096
|
+
__defNormalProp2(a, prop, b[prop]);
|
|
1097
|
+
}
|
|
1098
|
+
return a;
|
|
1099
|
+
};
|
|
1100
|
+
var __spreadProps2 = (a, b) => __defProps2(a, __getOwnPropDescs2(b));
|
|
1101
|
+
function assign(to, from) {
|
|
1102
|
+
for (const key in from) {
|
|
1103
|
+
if (Object.prototype.hasOwnProperty.call(from, key)) {
|
|
1104
|
+
if (typeof from[key] === "object" && to[key]) {
|
|
1105
|
+
assign(to[key], from[key]);
|
|
1106
|
+
} else {
|
|
1107
|
+
to[key] = from[key];
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
}
|
|
1111
|
+
}
|
|
1112
|
+
const config$2 = {
|
|
1113
|
+
disabled: false,
|
|
1114
|
+
distance: 5,
|
|
1115
|
+
skidding: 0,
|
|
1116
|
+
container: "body",
|
|
1117
|
+
boundary: void 0,
|
|
1118
|
+
instantMove: false,
|
|
1119
|
+
disposeTimeout: 5e3,
|
|
1120
|
+
popperTriggers: [],
|
|
1121
|
+
strategy: "absolute",
|
|
1122
|
+
preventOverflow: true,
|
|
1123
|
+
flip: true,
|
|
1124
|
+
shift: true,
|
|
1125
|
+
overflowPadding: 0,
|
|
1126
|
+
arrowPadding: 0,
|
|
1127
|
+
arrowOverflow: true,
|
|
1128
|
+
themes: {
|
|
1129
|
+
tooltip: {
|
|
1130
|
+
placement: "top",
|
|
1131
|
+
triggers: ["hover", "focus", "touch"],
|
|
1132
|
+
hideTriggers: (events2) => [...events2, "click"],
|
|
1133
|
+
delay: {
|
|
1134
|
+
show: 200,
|
|
1135
|
+
hide: 0
|
|
1136
|
+
},
|
|
1137
|
+
handleResize: false,
|
|
1138
|
+
html: false,
|
|
1139
|
+
loadingContent: "..."
|
|
1140
|
+
},
|
|
1141
|
+
dropdown: {
|
|
1142
|
+
placement: "bottom",
|
|
1143
|
+
triggers: ["click"],
|
|
1144
|
+
delay: 0,
|
|
1145
|
+
handleResize: true,
|
|
1146
|
+
autoHide: true
|
|
1147
|
+
},
|
|
1148
|
+
menu: {
|
|
1149
|
+
$extend: "dropdown",
|
|
1150
|
+
triggers: ["hover", "focus"],
|
|
1151
|
+
popperTriggers: ["hover", "focus"],
|
|
1152
|
+
delay: {
|
|
1153
|
+
show: 0,
|
|
1154
|
+
hide: 400
|
|
1155
|
+
}
|
|
1156
|
+
}
|
|
1157
|
+
}
|
|
1158
|
+
};
|
|
1159
|
+
function getDefaultConfig(theme, key) {
|
|
1160
|
+
let themeConfig = config$2.themes[theme] || {};
|
|
1161
|
+
let value;
|
|
1162
|
+
do {
|
|
1163
|
+
value = themeConfig[key];
|
|
1164
|
+
if (typeof value === "undefined") {
|
|
1165
|
+
if (themeConfig.$extend) {
|
|
1166
|
+
themeConfig = config$2.themes[themeConfig.$extend] || {};
|
|
1167
|
+
} else {
|
|
1168
|
+
themeConfig = null;
|
|
1169
|
+
value = config$2[key];
|
|
1170
|
+
}
|
|
1171
|
+
} else {
|
|
1172
|
+
themeConfig = null;
|
|
1173
|
+
}
|
|
1174
|
+
} while (themeConfig);
|
|
1175
|
+
return value;
|
|
1176
|
+
}
|
|
1177
|
+
function getThemeClasses(theme) {
|
|
1178
|
+
const result = [theme];
|
|
1179
|
+
let themeConfig = config$2.themes[theme] || {};
|
|
1180
|
+
do {
|
|
1181
|
+
if (themeConfig.$extend && !themeConfig.$resetCss) {
|
|
1182
|
+
result.push(themeConfig.$extend);
|
|
1183
|
+
themeConfig = config$2.themes[themeConfig.$extend] || {};
|
|
1184
|
+
} else {
|
|
1185
|
+
themeConfig = null;
|
|
1186
|
+
}
|
|
1187
|
+
} while (themeConfig);
|
|
1188
|
+
return result.map((c) => `v-popper--theme-${c}`);
|
|
1189
|
+
}
|
|
1190
|
+
let supportsPassive = false;
|
|
1191
|
+
if (typeof window !== "undefined") {
|
|
1192
|
+
supportsPassive = false;
|
|
1193
|
+
try {
|
|
1194
|
+
const opts = Object.defineProperty({}, "passive", {
|
|
1195
|
+
get() {
|
|
1196
|
+
supportsPassive = true;
|
|
1197
|
+
}
|
|
1198
|
+
});
|
|
1199
|
+
window.addEventListener("test", null, opts);
|
|
1200
|
+
} catch (e) {
|
|
1201
|
+
}
|
|
1202
|
+
}
|
|
1203
|
+
let isIOS = false;
|
|
1204
|
+
if (typeof window !== "undefined" && typeof navigator !== "undefined") {
|
|
1205
|
+
isIOS = /iPad|iPhone|iPod/.test(navigator.userAgent) && !window.MSStream;
|
|
1206
|
+
}
|
|
1207
|
+
const placements$1 = ["auto", "top", "bottom", "left", "right"].reduce((acc, base) => acc.concat([
|
|
1208
|
+
base,
|
|
1209
|
+
`${base}-start`,
|
|
1210
|
+
`${base}-end`
|
|
1211
|
+
]), []);
|
|
1212
|
+
const SHOW_EVENT_MAP = {
|
|
1213
|
+
hover: "mouseenter",
|
|
1214
|
+
focus: "focus",
|
|
1215
|
+
click: "click",
|
|
1216
|
+
touch: "touchstart"
|
|
1217
|
+
};
|
|
1218
|
+
const HIDE_EVENT_MAP = {
|
|
1219
|
+
hover: "mouseleave",
|
|
1220
|
+
focus: "blur",
|
|
1221
|
+
click: "click",
|
|
1222
|
+
touch: "touchend"
|
|
1223
|
+
};
|
|
1224
|
+
function removeFromArray(array, item) {
|
|
1225
|
+
const index = array.indexOf(item);
|
|
1226
|
+
if (index !== -1) {
|
|
1227
|
+
array.splice(index, 1);
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
function nextFrame() {
|
|
1231
|
+
return new Promise((resolve) => requestAnimationFrame(() => {
|
|
1232
|
+
requestAnimationFrame(resolve);
|
|
1233
|
+
}));
|
|
1234
|
+
}
|
|
1235
|
+
const shownPoppers = [];
|
|
1236
|
+
let hidingPopper = null;
|
|
1237
|
+
let Element$1 = function() {
|
|
1238
|
+
};
|
|
1239
|
+
if (typeof window !== "undefined") {
|
|
1240
|
+
Element$1 = window.Element;
|
|
1241
|
+
}
|
|
1242
|
+
function defaultPropFactory(prop) {
|
|
1243
|
+
return function(props) {
|
|
1244
|
+
return getDefaultConfig(props.theme, prop);
|
|
1245
|
+
};
|
|
1246
|
+
}
|
|
1247
|
+
var PrivatePopper = () => defineComponent({
|
|
1248
|
+
name: "VPopper",
|
|
1249
|
+
props: {
|
|
1250
|
+
theme: {
|
|
1251
|
+
type: String,
|
|
1252
|
+
required: true
|
|
1253
|
+
},
|
|
1254
|
+
targetNodes: {
|
|
1255
|
+
type: Function,
|
|
1256
|
+
required: true
|
|
1257
|
+
},
|
|
1258
|
+
referenceNode: {
|
|
1259
|
+
type: Function,
|
|
1260
|
+
required: true
|
|
1261
|
+
},
|
|
1262
|
+
popperNode: {
|
|
1263
|
+
type: Function,
|
|
1264
|
+
required: true
|
|
1265
|
+
},
|
|
1266
|
+
shown: {
|
|
1267
|
+
type: Boolean,
|
|
1268
|
+
default: false
|
|
1269
|
+
},
|
|
1270
|
+
showGroup: {
|
|
1271
|
+
type: String,
|
|
1272
|
+
default: null
|
|
1273
|
+
},
|
|
1274
|
+
ariaId: {
|
|
1275
|
+
default: null
|
|
1276
|
+
},
|
|
1277
|
+
disabled: {
|
|
1278
|
+
type: Boolean,
|
|
1279
|
+
default: defaultPropFactory("disabled")
|
|
1280
|
+
},
|
|
1281
|
+
positioningDisabled: {
|
|
1282
|
+
type: Boolean,
|
|
1283
|
+
default: defaultPropFactory("positioningDisabled")
|
|
1284
|
+
},
|
|
1285
|
+
placement: {
|
|
1286
|
+
type: String,
|
|
1287
|
+
default: defaultPropFactory("placement"),
|
|
1288
|
+
validator: (value) => placements$1.includes(value)
|
|
1289
|
+
},
|
|
1290
|
+
delay: {
|
|
1291
|
+
type: [String, Number, Object],
|
|
1292
|
+
default: defaultPropFactory("delay")
|
|
1293
|
+
},
|
|
1294
|
+
distance: {
|
|
1295
|
+
type: [Number, String],
|
|
1296
|
+
default: defaultPropFactory("distance")
|
|
1297
|
+
},
|
|
1298
|
+
skidding: {
|
|
1299
|
+
type: [Number, String],
|
|
1300
|
+
default: defaultPropFactory("skidding")
|
|
1301
|
+
},
|
|
1302
|
+
triggers: {
|
|
1303
|
+
type: Array,
|
|
1304
|
+
default: defaultPropFactory("triggers")
|
|
1305
|
+
},
|
|
1306
|
+
showTriggers: {
|
|
1307
|
+
type: [Array, Function],
|
|
1308
|
+
default: defaultPropFactory("showTriggers")
|
|
1309
|
+
},
|
|
1310
|
+
hideTriggers: {
|
|
1311
|
+
type: [Array, Function],
|
|
1312
|
+
default: defaultPropFactory("hideTriggers")
|
|
1313
|
+
},
|
|
1314
|
+
popperTriggers: {
|
|
1315
|
+
type: Array,
|
|
1316
|
+
default: defaultPropFactory("popperTriggers")
|
|
1317
|
+
},
|
|
1318
|
+
popperShowTriggers: {
|
|
1319
|
+
type: [Array, Function],
|
|
1320
|
+
default: defaultPropFactory("popperShowTriggers")
|
|
1321
|
+
},
|
|
1322
|
+
popperHideTriggers: {
|
|
1323
|
+
type: [Array, Function],
|
|
1324
|
+
default: defaultPropFactory("popperHideTriggers")
|
|
1325
|
+
},
|
|
1326
|
+
container: {
|
|
1327
|
+
type: [String, Object, Element$1, Boolean],
|
|
1328
|
+
default: defaultPropFactory("container")
|
|
1329
|
+
},
|
|
1330
|
+
boundary: {
|
|
1331
|
+
type: [String, Element$1],
|
|
1332
|
+
default: defaultPropFactory("boundary")
|
|
1333
|
+
},
|
|
1334
|
+
strategy: {
|
|
1335
|
+
type: String,
|
|
1336
|
+
validator: (value) => ["absolute", "fixed"].includes(value),
|
|
1337
|
+
default: defaultPropFactory("strategy")
|
|
1338
|
+
},
|
|
1339
|
+
autoHide: {
|
|
1340
|
+
type: Boolean,
|
|
1341
|
+
default: defaultPropFactory("autoHide")
|
|
1342
|
+
},
|
|
1343
|
+
handleResize: {
|
|
1344
|
+
type: Boolean,
|
|
1345
|
+
default: defaultPropFactory("handleResize")
|
|
1346
|
+
},
|
|
1347
|
+
instantMove: {
|
|
1348
|
+
type: Boolean,
|
|
1349
|
+
default: defaultPropFactory("instantMove")
|
|
1350
|
+
},
|
|
1351
|
+
eagerMount: {
|
|
1352
|
+
type: Boolean,
|
|
1353
|
+
default: defaultPropFactory("eagerMount")
|
|
1354
|
+
},
|
|
1355
|
+
popperClass: {
|
|
1356
|
+
type: [String, Array, Object],
|
|
1357
|
+
default: defaultPropFactory("popperClass")
|
|
1358
|
+
},
|
|
1359
|
+
computeTransformOrigin: {
|
|
1360
|
+
type: Boolean,
|
|
1361
|
+
default: defaultPropFactory("computeTransformOrigin")
|
|
1362
|
+
},
|
|
1363
|
+
autoMinSize: {
|
|
1364
|
+
type: Boolean,
|
|
1365
|
+
default: defaultPropFactory("autoMinSize")
|
|
1366
|
+
},
|
|
1367
|
+
autoMaxSize: {
|
|
1368
|
+
type: Boolean,
|
|
1369
|
+
default: defaultPropFactory("autoMaxSize")
|
|
1370
|
+
},
|
|
1371
|
+
preventOverflow: {
|
|
1372
|
+
type: Boolean,
|
|
1373
|
+
default: defaultPropFactory("preventOverflow")
|
|
1374
|
+
},
|
|
1375
|
+
overflowPadding: {
|
|
1376
|
+
type: [Number, String],
|
|
1377
|
+
default: defaultPropFactory("overflowPadding")
|
|
1378
|
+
},
|
|
1379
|
+
arrowPadding: {
|
|
1380
|
+
type: [Number, String],
|
|
1381
|
+
default: defaultPropFactory("arrowPadding")
|
|
1382
|
+
},
|
|
1383
|
+
arrowOverflow: {
|
|
1384
|
+
type: Boolean,
|
|
1385
|
+
default: defaultPropFactory("arrowOverflow")
|
|
1386
|
+
},
|
|
1387
|
+
flip: {
|
|
1388
|
+
type: Boolean,
|
|
1389
|
+
default: defaultPropFactory("flip")
|
|
1390
|
+
},
|
|
1391
|
+
shift: {
|
|
1392
|
+
type: Boolean,
|
|
1393
|
+
default: defaultPropFactory("shift")
|
|
1394
|
+
},
|
|
1395
|
+
shiftCrossAxis: {
|
|
1396
|
+
type: Boolean,
|
|
1397
|
+
default: defaultPropFactory("shiftCrossAxis")
|
|
1398
|
+
}
|
|
1399
|
+
},
|
|
1400
|
+
emits: [
|
|
1401
|
+
"show",
|
|
1402
|
+
"hide",
|
|
1403
|
+
"update:shown",
|
|
1404
|
+
"apply-show",
|
|
1405
|
+
"apply-hide",
|
|
1406
|
+
"close-group",
|
|
1407
|
+
"close-directive",
|
|
1408
|
+
"auto-hide",
|
|
1409
|
+
"resize",
|
|
1410
|
+
"dispose"
|
|
1411
|
+
],
|
|
1412
|
+
data() {
|
|
1413
|
+
return {
|
|
1414
|
+
isShown: false,
|
|
1415
|
+
isMounted: false,
|
|
1416
|
+
skipTransition: false,
|
|
1417
|
+
classes: {
|
|
1418
|
+
showFrom: false,
|
|
1419
|
+
showTo: false,
|
|
1420
|
+
hideFrom: false,
|
|
1421
|
+
hideTo: true
|
|
1422
|
+
},
|
|
1423
|
+
result: {
|
|
1424
|
+
x: 0,
|
|
1425
|
+
y: 0,
|
|
1426
|
+
placement: "",
|
|
1427
|
+
strategy: this.strategy,
|
|
1428
|
+
arrow: {
|
|
1429
|
+
x: 0,
|
|
1430
|
+
y: 0,
|
|
1431
|
+
centerOffset: 0
|
|
1432
|
+
},
|
|
1433
|
+
transformOrigin: null
|
|
1434
|
+
}
|
|
1435
|
+
};
|
|
1436
|
+
},
|
|
1437
|
+
computed: {
|
|
1438
|
+
popperId() {
|
|
1439
|
+
return this.ariaId != null ? this.ariaId : this.randomId;
|
|
1440
|
+
},
|
|
1441
|
+
shouldMountContent() {
|
|
1442
|
+
return this.eagerMount || this.isMounted;
|
|
1443
|
+
},
|
|
1444
|
+
slotData() {
|
|
1445
|
+
return {
|
|
1446
|
+
popperId: this.popperId,
|
|
1447
|
+
isShown: this.isShown,
|
|
1448
|
+
shouldMountContent: this.shouldMountContent,
|
|
1449
|
+
skipTransition: this.skipTransition,
|
|
1450
|
+
autoHide: this.autoHide,
|
|
1451
|
+
show: this.show,
|
|
1452
|
+
hide: this.hide,
|
|
1453
|
+
handleResize: this.handleResize,
|
|
1454
|
+
onResize: this.onResize,
|
|
1455
|
+
classes: __spreadProps2(__spreadValues2({}, this.classes), {
|
|
1456
|
+
popperClass: this.popperClass
|
|
1457
|
+
}),
|
|
1458
|
+
result: this.positioningDisabled ? null : this.result
|
|
1459
|
+
};
|
|
1460
|
+
}
|
|
1461
|
+
},
|
|
1462
|
+
watch: __spreadValues2(__spreadValues2({
|
|
1463
|
+
shown: "$_autoShowHide",
|
|
1464
|
+
disabled(value) {
|
|
1465
|
+
if (value) {
|
|
1466
|
+
this.dispose();
|
|
1467
|
+
} else {
|
|
1468
|
+
this.init();
|
|
1469
|
+
}
|
|
1470
|
+
},
|
|
1471
|
+
async container() {
|
|
1472
|
+
if (this.isShown) {
|
|
1473
|
+
this.$_ensureTeleport();
|
|
1474
|
+
await this.$_computePosition();
|
|
1475
|
+
}
|
|
1476
|
+
}
|
|
1477
|
+
}, [
|
|
1478
|
+
"triggers",
|
|
1479
|
+
"positioningDisabled"
|
|
1480
|
+
].reduce((acc, prop) => {
|
|
1481
|
+
acc[prop] = "$_refreshListeners";
|
|
1482
|
+
return acc;
|
|
1483
|
+
}, {})), [
|
|
1484
|
+
"placement",
|
|
1485
|
+
"distance",
|
|
1486
|
+
"skidding",
|
|
1487
|
+
"boundary",
|
|
1488
|
+
"strategy",
|
|
1489
|
+
"overflowPadding",
|
|
1490
|
+
"arrowPadding",
|
|
1491
|
+
"preventOverflow",
|
|
1492
|
+
"shift",
|
|
1493
|
+
"shiftCrossAxis",
|
|
1494
|
+
"flip"
|
|
1495
|
+
].reduce((acc, prop) => {
|
|
1496
|
+
acc[prop] = "$_computePosition";
|
|
1497
|
+
return acc;
|
|
1498
|
+
}, {})),
|
|
1499
|
+
created() {
|
|
1500
|
+
this.$_isDisposed = true;
|
|
1501
|
+
this.randomId = `popper_${[Math.random(), Date.now()].map((n) => n.toString(36).substring(2, 10)).join("_")}`;
|
|
1502
|
+
},
|
|
1503
|
+
mounted() {
|
|
1504
|
+
this.init();
|
|
1505
|
+
this.$_detachPopperNode();
|
|
1506
|
+
},
|
|
1507
|
+
activated() {
|
|
1508
|
+
this.$_autoShowHide();
|
|
1509
|
+
},
|
|
1510
|
+
deactivated() {
|
|
1511
|
+
this.hide();
|
|
1512
|
+
},
|
|
1513
|
+
beforeUnmount() {
|
|
1514
|
+
this.dispose();
|
|
1515
|
+
},
|
|
1516
|
+
methods: {
|
|
1517
|
+
show({ event = null, skipDelay = false, force = false } = {}) {
|
|
1518
|
+
if (force || !this.disabled) {
|
|
1519
|
+
this.$_scheduleShow(event, skipDelay);
|
|
1520
|
+
this.$emit("show");
|
|
1521
|
+
this.$_showFrameLocked = true;
|
|
1522
|
+
requestAnimationFrame(() => {
|
|
1523
|
+
this.$_showFrameLocked = false;
|
|
1524
|
+
});
|
|
1525
|
+
}
|
|
1526
|
+
this.$emit("update:shown", true);
|
|
1527
|
+
},
|
|
1528
|
+
hide({ event = null, skipDelay = false } = {}) {
|
|
1529
|
+
this.$_scheduleHide(event, skipDelay);
|
|
1530
|
+
this.$emit("hide");
|
|
1531
|
+
this.$emit("update:shown", false);
|
|
1532
|
+
},
|
|
1533
|
+
init() {
|
|
1534
|
+
if (!this.$_isDisposed)
|
|
1535
|
+
return;
|
|
1536
|
+
this.$_isDisposed = false;
|
|
1537
|
+
this.isMounted = false;
|
|
1538
|
+
this.$_events = [];
|
|
1539
|
+
this.$_preventShow = false;
|
|
1540
|
+
this.$_referenceNode = this.referenceNode();
|
|
1541
|
+
this.$_targetNodes = this.targetNodes().filter((e) => e.nodeType === e.ELEMENT_NODE);
|
|
1542
|
+
this.$_popperNode = this.popperNode();
|
|
1543
|
+
this.$_innerNode = this.$_popperNode.querySelector(".v-popper__inner");
|
|
1544
|
+
this.$_arrowNode = this.$_popperNode.querySelector(".v-popper__arrow-container");
|
|
1545
|
+
this.$_swapTargetAttrs("title", "data-original-title");
|
|
1546
|
+
this.$_detachPopperNode();
|
|
1547
|
+
if (this.triggers.length) {
|
|
1548
|
+
this.$_addEventListeners();
|
|
1549
|
+
}
|
|
1550
|
+
if (this.shown) {
|
|
1551
|
+
this.show();
|
|
1552
|
+
}
|
|
1553
|
+
},
|
|
1554
|
+
dispose() {
|
|
1555
|
+
if (this.$_isDisposed)
|
|
1556
|
+
return;
|
|
1557
|
+
this.$_isDisposed = true;
|
|
1558
|
+
this.$_removeEventListeners();
|
|
1559
|
+
this.hide({ skipDelay: true });
|
|
1560
|
+
this.$_detachPopperNode();
|
|
1561
|
+
this.isMounted = false;
|
|
1562
|
+
this.isShown = false;
|
|
1563
|
+
this.$_swapTargetAttrs("data-original-title", "title");
|
|
1564
|
+
this.$emit("dispose");
|
|
1565
|
+
},
|
|
1566
|
+
async onResize() {
|
|
1567
|
+
if (this.isShown) {
|
|
1568
|
+
await this.$_computePosition();
|
|
1569
|
+
this.$emit("resize");
|
|
1570
|
+
}
|
|
1571
|
+
},
|
|
1572
|
+
async $_computePosition() {
|
|
1573
|
+
var _a;
|
|
1574
|
+
if (this.$_isDisposed || this.positioningDisabled)
|
|
1575
|
+
return;
|
|
1576
|
+
const options2 = {
|
|
1577
|
+
strategy: this.strategy,
|
|
1578
|
+
middleware: []
|
|
1579
|
+
};
|
|
1580
|
+
if (this.distance || this.skidding) {
|
|
1581
|
+
options2.middleware.push(offset$2({
|
|
1582
|
+
mainAxis: this.distance,
|
|
1583
|
+
crossAxis: this.skidding
|
|
1584
|
+
}));
|
|
1585
|
+
}
|
|
1586
|
+
const isPlacementAuto = this.placement.startsWith("auto");
|
|
1587
|
+
if (isPlacementAuto) {
|
|
1588
|
+
options2.middleware.push(autoPlacement({
|
|
1589
|
+
alignment: (_a = this.placement.split("-")[1]) != null ? _a : ""
|
|
1590
|
+
}));
|
|
1591
|
+
} else {
|
|
1592
|
+
options2.placement = this.placement;
|
|
1593
|
+
}
|
|
1594
|
+
if (this.preventOverflow) {
|
|
1595
|
+
if (this.shift) {
|
|
1596
|
+
options2.middleware.push(shift({
|
|
1597
|
+
padding: this.overflowPadding,
|
|
1598
|
+
boundary: this.boundary,
|
|
1599
|
+
crossAxis: this.shiftCrossAxis
|
|
1600
|
+
}));
|
|
1601
|
+
}
|
|
1602
|
+
if (!isPlacementAuto && this.flip) {
|
|
1603
|
+
options2.middleware.push(flip$2({
|
|
1604
|
+
padding: this.overflowPadding,
|
|
1605
|
+
boundary: this.boundary
|
|
1606
|
+
}));
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
options2.middleware.push(arrow$2({
|
|
1610
|
+
element: this.$_arrowNode,
|
|
1611
|
+
padding: this.arrowPadding
|
|
1612
|
+
}));
|
|
1613
|
+
if (this.arrowOverflow) {
|
|
1614
|
+
options2.middleware.push({
|
|
1615
|
+
name: "arrowOverflow",
|
|
1616
|
+
fn: ({ placement, rects, middlewareData }) => {
|
|
1617
|
+
let overflow;
|
|
1618
|
+
const { centerOffset } = middlewareData.arrow;
|
|
1619
|
+
if (placement.startsWith("top") || placement.startsWith("bottom")) {
|
|
1620
|
+
overflow = Math.abs(centerOffset) > rects.reference.width / 2;
|
|
1621
|
+
} else {
|
|
1622
|
+
overflow = Math.abs(centerOffset) > rects.reference.height / 2;
|
|
1623
|
+
}
|
|
1624
|
+
return {
|
|
1625
|
+
data: {
|
|
1626
|
+
overflow
|
|
1627
|
+
}
|
|
1628
|
+
};
|
|
1629
|
+
}
|
|
1630
|
+
});
|
|
1631
|
+
}
|
|
1632
|
+
if (this.autoMinSize) {
|
|
1633
|
+
options2.middleware.push({
|
|
1634
|
+
name: "autoMinSize",
|
|
1635
|
+
fn: ({ rects, placement, middlewareData }) => {
|
|
1636
|
+
var _a2;
|
|
1637
|
+
if ((_a2 = middlewareData.autoMinSize) == null ? void 0 : _a2.skip) {
|
|
1638
|
+
return {};
|
|
1639
|
+
}
|
|
1640
|
+
let width;
|
|
1641
|
+
let height;
|
|
1642
|
+
if (placement.startsWith("top") || placement.startsWith("bottom")) {
|
|
1643
|
+
width = rects.reference.width;
|
|
1644
|
+
} else {
|
|
1645
|
+
height = rects.reference.height;
|
|
1646
|
+
}
|
|
1647
|
+
this.$_innerNode.style.minWidth = width != null ? `${width}px` : null;
|
|
1648
|
+
this.$_innerNode.style.minHeight = height != null ? `${height}px` : null;
|
|
1649
|
+
return {
|
|
1650
|
+
data: {
|
|
1651
|
+
skip: true
|
|
1652
|
+
},
|
|
1653
|
+
reset: {
|
|
1654
|
+
rects: true
|
|
1655
|
+
}
|
|
1656
|
+
};
|
|
1657
|
+
}
|
|
1658
|
+
});
|
|
1659
|
+
}
|
|
1660
|
+
if (this.autoMaxSize) {
|
|
1661
|
+
this.$_innerNode.style.maxWidth = null;
|
|
1662
|
+
this.$_innerNode.style.maxHeight = null;
|
|
1663
|
+
options2.middleware.push(size({
|
|
1664
|
+
boundary: this.boundary,
|
|
1665
|
+
padding: this.overflowPadding,
|
|
1666
|
+
apply: ({ width, height }) => {
|
|
1667
|
+
this.$_innerNode.style.maxWidth = width != null ? `${width}px` : null;
|
|
1668
|
+
this.$_innerNode.style.maxHeight = height != null ? `${height}px` : null;
|
|
1669
|
+
}
|
|
1670
|
+
}));
|
|
1671
|
+
}
|
|
1672
|
+
const data = await computePosition(this.$_referenceNode, this.$_popperNode, options2);
|
|
1673
|
+
Object.assign(this.result, {
|
|
1674
|
+
x: data.x,
|
|
1675
|
+
y: data.y,
|
|
1676
|
+
placement: data.placement,
|
|
1677
|
+
strategy: data.strategy,
|
|
1678
|
+
arrow: __spreadValues2(__spreadValues2({}, data.middlewareData.arrow), data.middlewareData.arrowOverflow)
|
|
1679
|
+
});
|
|
1680
|
+
},
|
|
1681
|
+
$_scheduleShow(event = null, skipDelay = false) {
|
|
1682
|
+
this.$_hideInProgress = false;
|
|
1683
|
+
clearTimeout(this.$_scheduleTimer);
|
|
1684
|
+
if (hidingPopper && this.instantMove && hidingPopper.instantMove) {
|
|
1685
|
+
hidingPopper.$_applyHide(true);
|
|
1686
|
+
this.$_applyShow(true);
|
|
1687
|
+
return;
|
|
1688
|
+
}
|
|
1689
|
+
if (skipDelay) {
|
|
1690
|
+
this.$_applyShow();
|
|
1691
|
+
} else {
|
|
1692
|
+
this.$_scheduleTimer = setTimeout(this.$_applyShow.bind(this), this.$_computeDelay("show"));
|
|
1693
|
+
}
|
|
1694
|
+
},
|
|
1695
|
+
$_scheduleHide(event = null, skipDelay = false) {
|
|
1696
|
+
this.$_hideInProgress = true;
|
|
1697
|
+
clearTimeout(this.$_scheduleTimer);
|
|
1698
|
+
if (this.isShown) {
|
|
1699
|
+
hidingPopper = this;
|
|
1700
|
+
}
|
|
1701
|
+
if (skipDelay) {
|
|
1702
|
+
this.$_applyHide();
|
|
1703
|
+
} else {
|
|
1704
|
+
this.$_scheduleTimer = setTimeout(this.$_applyHide.bind(this), this.$_computeDelay("hide"));
|
|
1705
|
+
}
|
|
1706
|
+
},
|
|
1707
|
+
$_computeDelay(type) {
|
|
1708
|
+
const delay = this.delay;
|
|
1709
|
+
return parseInt(delay && delay[type] || delay || 0);
|
|
1710
|
+
},
|
|
1711
|
+
async $_applyShow(skipTransition = false) {
|
|
1712
|
+
clearTimeout(this.$_disposeTimer);
|
|
1713
|
+
clearTimeout(this.$_scheduleTimer);
|
|
1714
|
+
this.skipTransition = skipTransition;
|
|
1715
|
+
if (this.isShown) {
|
|
1716
|
+
return;
|
|
1717
|
+
}
|
|
1718
|
+
this.$_ensureTeleport();
|
|
1719
|
+
await nextFrame();
|
|
1720
|
+
await this.$_computePosition();
|
|
1721
|
+
await this.$_applyShowEffect();
|
|
1722
|
+
},
|
|
1723
|
+
async $_applyShowEffect() {
|
|
1724
|
+
if (this.$_hideInProgress)
|
|
1725
|
+
return;
|
|
1726
|
+
if (this.computeTransformOrigin) {
|
|
1727
|
+
const bounds = this.$_referenceNode.getBoundingClientRect();
|
|
1728
|
+
const popperWrapper = this.$_popperNode.querySelector(".v-popper__wrapper");
|
|
1729
|
+
const parentBounds = popperWrapper.parentNode.getBoundingClientRect();
|
|
1730
|
+
const x = bounds.x + bounds.width / 2 - (parentBounds.left + popperWrapper.offsetLeft);
|
|
1731
|
+
const y = bounds.y + bounds.height / 2 - (parentBounds.top + popperWrapper.offsetTop);
|
|
1732
|
+
this.result.transformOrigin = `${x}px ${y}px`;
|
|
1733
|
+
}
|
|
1734
|
+
this.isShown = true;
|
|
1735
|
+
this.$_applyAttrsToTarget({
|
|
1736
|
+
"aria-describedby": this.popperId,
|
|
1737
|
+
"data-popper-shown": ""
|
|
1738
|
+
});
|
|
1739
|
+
const showGroup = this.showGroup;
|
|
1740
|
+
if (showGroup) {
|
|
1741
|
+
let popover;
|
|
1742
|
+
for (let i = 0; i < shownPoppers.length; i++) {
|
|
1743
|
+
popover = shownPoppers[i];
|
|
1744
|
+
if (popover.showGroup !== showGroup) {
|
|
1745
|
+
popover.hide();
|
|
1746
|
+
popover.$emit("close-group");
|
|
1747
|
+
}
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
shownPoppers.push(this);
|
|
1751
|
+
this.$emit("apply-show");
|
|
1752
|
+
this.classes.showFrom = true;
|
|
1753
|
+
this.classes.showTo = false;
|
|
1754
|
+
this.classes.hideFrom = false;
|
|
1755
|
+
this.classes.hideTo = false;
|
|
1756
|
+
await nextFrame();
|
|
1757
|
+
this.classes.showFrom = false;
|
|
1758
|
+
this.classes.showTo = true;
|
|
1759
|
+
},
|
|
1760
|
+
async $_applyHide(skipTransition = false) {
|
|
1761
|
+
clearTimeout(this.$_scheduleTimer);
|
|
1762
|
+
if (!this.isShown) {
|
|
1763
|
+
return;
|
|
1764
|
+
}
|
|
1765
|
+
this.skipTransition = skipTransition;
|
|
1766
|
+
removeFromArray(shownPoppers, this);
|
|
1767
|
+
if (hidingPopper === this) {
|
|
1768
|
+
hidingPopper = null;
|
|
1769
|
+
}
|
|
1770
|
+
this.isShown = false;
|
|
1771
|
+
this.$_applyAttrsToTarget({
|
|
1772
|
+
"aria-describedby": void 0,
|
|
1773
|
+
"data-popper-shown": void 0
|
|
1774
|
+
});
|
|
1775
|
+
clearTimeout(this.$_disposeTimer);
|
|
1776
|
+
const disposeTime = getDefaultConfig(this.theme, "disposeTimeout");
|
|
1777
|
+
if (disposeTime !== null) {
|
|
1778
|
+
this.$_disposeTimer = setTimeout(() => {
|
|
1779
|
+
if (this.$_popperNode) {
|
|
1780
|
+
this.$_detachPopperNode();
|
|
1781
|
+
this.isMounted = false;
|
|
1782
|
+
}
|
|
1783
|
+
}, disposeTime);
|
|
1784
|
+
}
|
|
1785
|
+
this.$emit("apply-hide");
|
|
1786
|
+
this.classes.showFrom = false;
|
|
1787
|
+
this.classes.showTo = false;
|
|
1788
|
+
this.classes.hideFrom = true;
|
|
1789
|
+
this.classes.hideTo = false;
|
|
1790
|
+
await nextFrame();
|
|
1791
|
+
this.classes.hideFrom = false;
|
|
1792
|
+
this.classes.hideTo = true;
|
|
1793
|
+
},
|
|
1794
|
+
$_autoShowHide() {
|
|
1795
|
+
if (this.shown) {
|
|
1796
|
+
this.show();
|
|
1797
|
+
} else {
|
|
1798
|
+
this.hide();
|
|
1799
|
+
}
|
|
1800
|
+
},
|
|
1801
|
+
$_ensureTeleport() {
|
|
1802
|
+
if (this.$_isDisposed)
|
|
1803
|
+
return;
|
|
1804
|
+
let container = this.container;
|
|
1805
|
+
if (typeof container === "string") {
|
|
1806
|
+
container = window.document.querySelector(container);
|
|
1807
|
+
} else if (container === false) {
|
|
1808
|
+
container = this.$_targetNodes[0].parentNode;
|
|
1809
|
+
}
|
|
1810
|
+
if (!container) {
|
|
1811
|
+
throw new Error("No container for popover: " + this.container);
|
|
1812
|
+
}
|
|
1813
|
+
container.appendChild(this.$_popperNode);
|
|
1814
|
+
this.isMounted = true;
|
|
1815
|
+
},
|
|
1816
|
+
$_addEventListeners() {
|
|
1817
|
+
const addListeners2 = (targetNodes, eventType, handler) => {
|
|
1818
|
+
this.$_events.push({ targetNodes, eventType, handler });
|
|
1819
|
+
targetNodes.forEach((node) => node.addEventListener(eventType, handler, supportsPassive ? {
|
|
1820
|
+
passive: true
|
|
1821
|
+
} : void 0));
|
|
1822
|
+
};
|
|
1823
|
+
const addEvents = (targetNodes, eventMap, commonTriggers, customTrigger, handler) => {
|
|
1824
|
+
let triggers = commonTriggers;
|
|
1825
|
+
if (customTrigger != null) {
|
|
1826
|
+
triggers = typeof customTrigger === "function" ? customTrigger(triggers) : customTrigger;
|
|
1827
|
+
}
|
|
1828
|
+
triggers.forEach((trigger) => {
|
|
1829
|
+
const eventType = eventMap[trigger];
|
|
1830
|
+
if (eventType) {
|
|
1831
|
+
addListeners2(targetNodes, eventType, handler);
|
|
1832
|
+
}
|
|
1833
|
+
});
|
|
1834
|
+
};
|
|
1835
|
+
const handleShow = (event) => {
|
|
1836
|
+
if (this.isShown && !this.$_hideInProgress) {
|
|
1837
|
+
return;
|
|
1838
|
+
}
|
|
1839
|
+
event.usedByTooltip = true;
|
|
1840
|
+
!this.$_preventShow && this.show({ event });
|
|
1841
|
+
};
|
|
1842
|
+
addEvents(this.$_targetNodes, SHOW_EVENT_MAP, this.triggers, this.showTriggers, handleShow);
|
|
1843
|
+
addEvents([this.$_popperNode], SHOW_EVENT_MAP, this.popperTriggers, this.popperShowTriggers, handleShow);
|
|
1844
|
+
const handleHide = (event) => {
|
|
1845
|
+
if (event.usedByTooltip) {
|
|
1846
|
+
return;
|
|
1847
|
+
}
|
|
1848
|
+
this.hide({ event });
|
|
1849
|
+
};
|
|
1850
|
+
addEvents(this.$_targetNodes, HIDE_EVENT_MAP, this.triggers, this.hideTriggers, handleHide);
|
|
1851
|
+
addEvents([this.$_popperNode], HIDE_EVENT_MAP, this.popperTriggers, this.popperHideTriggers, handleHide);
|
|
1852
|
+
if (!this.positioningDisabled) {
|
|
1853
|
+
addListeners2([
|
|
1854
|
+
...getScrollParents(this.$_referenceNode),
|
|
1855
|
+
...getScrollParents(this.$_popperNode)
|
|
1856
|
+
], "scroll", () => {
|
|
1857
|
+
this.$_computePosition();
|
|
1858
|
+
});
|
|
1859
|
+
}
|
|
1860
|
+
},
|
|
1861
|
+
$_removeEventListeners() {
|
|
1862
|
+
this.$_events.forEach(({ targetNodes, eventType, handler }) => {
|
|
1863
|
+
targetNodes.forEach((node) => node.removeEventListener(eventType, handler));
|
|
1864
|
+
});
|
|
1865
|
+
this.$_events = [];
|
|
1866
|
+
},
|
|
1867
|
+
$_refreshListeners() {
|
|
1868
|
+
if (!this.$_isDisposed) {
|
|
1869
|
+
this.$_removeEventListeners();
|
|
1870
|
+
this.$_addEventListeners();
|
|
1871
|
+
}
|
|
1872
|
+
},
|
|
1873
|
+
$_handleGlobalClose(event, touch = false) {
|
|
1874
|
+
if (this.$_showFrameLocked)
|
|
1875
|
+
return;
|
|
1876
|
+
this.hide({ event });
|
|
1877
|
+
if (event.closePopover) {
|
|
1878
|
+
this.$emit("close-directive");
|
|
1879
|
+
} else {
|
|
1880
|
+
this.$emit("auto-hide");
|
|
1881
|
+
}
|
|
1882
|
+
if (touch) {
|
|
1883
|
+
this.$_preventShow = true;
|
|
1884
|
+
setTimeout(() => {
|
|
1885
|
+
this.$_preventShow = false;
|
|
1886
|
+
}, 300);
|
|
1887
|
+
}
|
|
1888
|
+
},
|
|
1889
|
+
$_detachPopperNode() {
|
|
1890
|
+
this.$_popperNode.parentNode && this.$_popperNode.parentNode.removeChild(this.$_popperNode);
|
|
1891
|
+
},
|
|
1892
|
+
$_swapTargetAttrs(attrFrom, attrTo) {
|
|
1893
|
+
for (const el of this.$_targetNodes) {
|
|
1894
|
+
const value = el.getAttribute(attrFrom);
|
|
1895
|
+
if (value) {
|
|
1896
|
+
el.removeAttribute(attrFrom);
|
|
1897
|
+
el.setAttribute(attrTo, value);
|
|
1898
|
+
}
|
|
1899
|
+
}
|
|
1900
|
+
},
|
|
1901
|
+
$_applyAttrsToTarget(attrs) {
|
|
1902
|
+
for (const el of this.$_targetNodes) {
|
|
1903
|
+
for (const n in attrs) {
|
|
1904
|
+
const value = attrs[n];
|
|
1905
|
+
if (value == null) {
|
|
1906
|
+
el.removeAttribute(n);
|
|
1907
|
+
} else {
|
|
1908
|
+
el.setAttribute(n, value);
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
}
|
|
1912
|
+
}
|
|
1913
|
+
},
|
|
1914
|
+
render() {
|
|
1915
|
+
return this.$slots.default(this.slotData);
|
|
1916
|
+
}
|
|
1917
|
+
});
|
|
1918
|
+
if (typeof document !== "undefined" && typeof window !== "undefined") {
|
|
1919
|
+
if (isIOS) {
|
|
1920
|
+
document.addEventListener("touchstart", handleGlobalMousedown, supportsPassive ? {
|
|
1921
|
+
passive: true,
|
|
1922
|
+
capture: true
|
|
1923
|
+
} : true);
|
|
1924
|
+
document.addEventListener("touchend", handleGlobalTouchend, supportsPassive ? {
|
|
1925
|
+
passive: true,
|
|
1926
|
+
capture: true
|
|
1927
|
+
} : true);
|
|
1928
|
+
} else {
|
|
1929
|
+
window.addEventListener("mousedown", handleGlobalMousedown, true);
|
|
1930
|
+
window.addEventListener("click", handleGlobalClick, true);
|
|
1931
|
+
}
|
|
1932
|
+
window.addEventListener("resize", computePositionAllShownPoppers);
|
|
1933
|
+
}
|
|
1934
|
+
function handleGlobalMousedown(event) {
|
|
1935
|
+
for (let i = 0; i < shownPoppers.length; i++) {
|
|
1936
|
+
const popper2 = shownPoppers[i];
|
|
1937
|
+
const popperContent = popper2.popperNode();
|
|
1938
|
+
popper2.$_mouseDownContains = popperContent.contains(event.target);
|
|
1939
|
+
}
|
|
1940
|
+
}
|
|
1941
|
+
function handleGlobalClick(event) {
|
|
1942
|
+
handleGlobalClose(event);
|
|
1943
|
+
}
|
|
1944
|
+
function handleGlobalTouchend(event) {
|
|
1945
|
+
handleGlobalClose(event, true);
|
|
1946
|
+
}
|
|
1947
|
+
function handleGlobalClose(event, touch = false) {
|
|
1948
|
+
for (let i = 0; i < shownPoppers.length; i++) {
|
|
1949
|
+
const popper2 = shownPoppers[i];
|
|
1950
|
+
const popperContent = popper2.popperNode();
|
|
1951
|
+
const contains2 = popper2.$_mouseDownContains || popperContent.contains(event.target);
|
|
1952
|
+
requestAnimationFrame(() => {
|
|
1953
|
+
if (event.closeAllPopover || event.closePopover && contains2 || popper2.autoHide && !contains2) {
|
|
1954
|
+
popper2.$_handleGlobalClose(event, touch);
|
|
1955
|
+
}
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
function computePositionAllShownPoppers(event) {
|
|
1960
|
+
for (let i = 0; i < shownPoppers.length; i++) {
|
|
1961
|
+
const popper2 = shownPoppers[i];
|
|
1962
|
+
popper2.$_computePosition(event);
|
|
1963
|
+
}
|
|
1964
|
+
}
|
|
1965
|
+
function getInternetExplorerVersion() {
|
|
1966
|
+
var ua = window.navigator.userAgent;
|
|
1967
|
+
var msie = ua.indexOf("MSIE ");
|
|
1968
|
+
if (msie > 0) {
|
|
1969
|
+
return parseInt(ua.substring(msie + 5, ua.indexOf(".", msie)), 10);
|
|
1970
|
+
}
|
|
1971
|
+
var trident = ua.indexOf("Trident/");
|
|
1972
|
+
if (trident > 0) {
|
|
1973
|
+
var rv = ua.indexOf("rv:");
|
|
1974
|
+
return parseInt(ua.substring(rv + 3, ua.indexOf(".", rv)), 10);
|
|
1975
|
+
}
|
|
1976
|
+
var edge = ua.indexOf("Edge/");
|
|
1977
|
+
if (edge > 0) {
|
|
1978
|
+
return parseInt(ua.substring(edge + 5, ua.indexOf(".", edge)), 10);
|
|
1979
|
+
}
|
|
1980
|
+
return -1;
|
|
1981
|
+
}
|
|
1982
|
+
let isIE;
|
|
1983
|
+
function initCompat() {
|
|
1984
|
+
if (!initCompat.init) {
|
|
1985
|
+
initCompat.init = true;
|
|
1986
|
+
isIE = getInternetExplorerVersion() !== -1;
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
var script = {
|
|
1990
|
+
name: "ResizeObserver",
|
|
1991
|
+
props: {
|
|
1992
|
+
emitOnMount: {
|
|
1993
|
+
type: Boolean,
|
|
1994
|
+
default: false
|
|
1995
|
+
},
|
|
1996
|
+
ignoreWidth: {
|
|
1997
|
+
type: Boolean,
|
|
1998
|
+
default: false
|
|
1999
|
+
},
|
|
2000
|
+
ignoreHeight: {
|
|
2001
|
+
type: Boolean,
|
|
2002
|
+
default: false
|
|
2003
|
+
}
|
|
2004
|
+
},
|
|
2005
|
+
emits: [
|
|
2006
|
+
"notify"
|
|
2007
|
+
],
|
|
2008
|
+
mounted() {
|
|
2009
|
+
initCompat();
|
|
2010
|
+
nextTick$1(() => {
|
|
2011
|
+
this._w = this.$el.offsetWidth;
|
|
2012
|
+
this._h = this.$el.offsetHeight;
|
|
2013
|
+
if (this.emitOnMount) {
|
|
2014
|
+
this.emitSize();
|
|
2015
|
+
}
|
|
2016
|
+
});
|
|
2017
|
+
const object = document.createElement("object");
|
|
2018
|
+
this._resizeObject = object;
|
|
2019
|
+
object.setAttribute("aria-hidden", "true");
|
|
2020
|
+
object.setAttribute("tabindex", -1);
|
|
2021
|
+
object.onload = this.addResizeHandlers;
|
|
2022
|
+
object.type = "text/html";
|
|
2023
|
+
if (isIE) {
|
|
2024
|
+
this.$el.appendChild(object);
|
|
2025
|
+
}
|
|
2026
|
+
object.data = "about:blank";
|
|
2027
|
+
if (!isIE) {
|
|
2028
|
+
this.$el.appendChild(object);
|
|
2029
|
+
}
|
|
2030
|
+
},
|
|
2031
|
+
beforeUnmount() {
|
|
2032
|
+
this.removeResizeHandlers();
|
|
2033
|
+
},
|
|
2034
|
+
methods: {
|
|
2035
|
+
compareAndNotify() {
|
|
2036
|
+
if (!this.ignoreWidth && this._w !== this.$el.offsetWidth || !this.ignoreHeight && this._h !== this.$el.offsetHeight) {
|
|
2037
|
+
this._w = this.$el.offsetWidth;
|
|
2038
|
+
this._h = this.$el.offsetHeight;
|
|
2039
|
+
this.emitSize();
|
|
2040
|
+
}
|
|
2041
|
+
},
|
|
2042
|
+
emitSize() {
|
|
2043
|
+
this.$emit("notify", {
|
|
2044
|
+
width: this._w,
|
|
2045
|
+
height: this._h
|
|
2046
|
+
});
|
|
2047
|
+
},
|
|
2048
|
+
addResizeHandlers() {
|
|
2049
|
+
this._resizeObject.contentDocument.defaultView.addEventListener("resize", this.compareAndNotify);
|
|
2050
|
+
this.compareAndNotify();
|
|
2051
|
+
},
|
|
2052
|
+
removeResizeHandlers() {
|
|
2053
|
+
if (this._resizeObject && this._resizeObject.onload) {
|
|
2054
|
+
if (!isIE && this._resizeObject.contentDocument) {
|
|
2055
|
+
this._resizeObject.contentDocument.defaultView.removeEventListener("resize", this.compareAndNotify);
|
|
2056
|
+
}
|
|
2057
|
+
this.$el.removeChild(this._resizeObject);
|
|
2058
|
+
this._resizeObject.onload = null;
|
|
2059
|
+
this._resizeObject = null;
|
|
2060
|
+
}
|
|
2061
|
+
}
|
|
2062
|
+
}
|
|
2063
|
+
};
|
|
2064
|
+
const _withId = /* @__PURE__ */ withScopeId("data-v-b329ee4c");
|
|
2065
|
+
pushScopeId("data-v-b329ee4c");
|
|
2066
|
+
const _hoisted_1$2$1 = {
|
|
2067
|
+
class: "resize-observer",
|
|
2068
|
+
tabindex: "-1"
|
|
2069
|
+
};
|
|
2070
|
+
popScopeId();
|
|
2071
|
+
const render$3 = /* @__PURE__ */ _withId((_ctx, _cache, $props, $setup, $data, $options) => {
|
|
2072
|
+
return openBlock(), createBlock("div", _hoisted_1$2$1);
|
|
2073
|
+
});
|
|
2074
|
+
script.render = render$3;
|
|
2075
|
+
script.__scopeId = "data-v-b329ee4c";
|
|
2076
|
+
script.__file = "src/components/ResizeObserver.vue";
|
|
2077
|
+
var PrivateThemeClass = {
|
|
2078
|
+
computed: {
|
|
2079
|
+
themeClass() {
|
|
2080
|
+
return getThemeClasses(this.theme);
|
|
2081
|
+
}
|
|
2082
|
+
}
|
|
2083
|
+
};
|
|
2084
|
+
var _export_sfc$1 = (sfc, props) => {
|
|
2085
|
+
const target = sfc.__vccOpts || sfc;
|
|
2086
|
+
for (const [key, val] of props) {
|
|
2087
|
+
target[key] = val;
|
|
2088
|
+
}
|
|
2089
|
+
return target;
|
|
2090
|
+
};
|
|
2091
|
+
const _sfc_main$5$1 = defineComponent({
|
|
2092
|
+
name: "VPopperContent",
|
|
2093
|
+
components: {
|
|
2094
|
+
ResizeObserver: script
|
|
2095
|
+
},
|
|
2096
|
+
mixins: [
|
|
2097
|
+
PrivateThemeClass
|
|
2098
|
+
],
|
|
2099
|
+
props: {
|
|
2100
|
+
popperId: String,
|
|
2101
|
+
theme: String,
|
|
2102
|
+
shown: Boolean,
|
|
2103
|
+
mounted: Boolean,
|
|
2104
|
+
skipTransition: Boolean,
|
|
2105
|
+
autoHide: Boolean,
|
|
2106
|
+
handleResize: Boolean,
|
|
2107
|
+
classes: Object,
|
|
2108
|
+
result: Object
|
|
2109
|
+
},
|
|
2110
|
+
emits: [
|
|
2111
|
+
"hide",
|
|
2112
|
+
"resize"
|
|
2113
|
+
],
|
|
2114
|
+
methods: {
|
|
2115
|
+
toPx(value) {
|
|
2116
|
+
if (value != null && !isNaN(value)) {
|
|
2117
|
+
return `${value}px`;
|
|
2118
|
+
}
|
|
2119
|
+
return null;
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
});
|
|
2123
|
+
const _hoisted_1$1$1 = ["id", "aria-hidden", "tabindex", "data-popper-placement"];
|
|
2124
|
+
const _hoisted_2$1$1 = {
|
|
2125
|
+
ref: "inner",
|
|
2126
|
+
class: "v-popper__inner"
|
|
2127
|
+
};
|
|
2128
|
+
const _hoisted_3$7 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-outer" }, null, -1);
|
|
2129
|
+
const _hoisted_4$5 = /* @__PURE__ */ createElementVNode("div", { class: "v-popper__arrow-inner" }, null, -1);
|
|
2130
|
+
const _hoisted_5$2 = [
|
|
2131
|
+
_hoisted_3$7,
|
|
2132
|
+
_hoisted_4$5
|
|
2133
|
+
];
|
|
2134
|
+
function _sfc_render$2(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2135
|
+
const _component_ResizeObserver = resolveComponent("ResizeObserver");
|
|
2136
|
+
return openBlock(), createElementBlock("div", {
|
|
2137
|
+
id: _ctx.popperId,
|
|
2138
|
+
ref: "popover",
|
|
2139
|
+
class: normalizeClass(["v-popper__popper", [
|
|
2140
|
+
_ctx.themeClass,
|
|
2141
|
+
_ctx.classes.popperClass,
|
|
2142
|
+
{
|
|
2143
|
+
"v-popper__popper--shown": _ctx.shown,
|
|
2144
|
+
"v-popper__popper--hidden": !_ctx.shown,
|
|
2145
|
+
"v-popper__popper--show-from": _ctx.classes.showFrom,
|
|
2146
|
+
"v-popper__popper--show-to": _ctx.classes.showTo,
|
|
2147
|
+
"v-popper__popper--hide-from": _ctx.classes.hideFrom,
|
|
2148
|
+
"v-popper__popper--hide-to": _ctx.classes.hideTo,
|
|
2149
|
+
"v-popper__popper--skip-transition": _ctx.skipTransition,
|
|
2150
|
+
"v-popper__popper--arrow-overflow": _ctx.result && _ctx.result.arrow.overflow,
|
|
2151
|
+
"v-popper__popper--no-positioning": !_ctx.result
|
|
2152
|
+
}
|
|
2153
|
+
]]),
|
|
2154
|
+
style: normalizeStyle(_ctx.result ? {
|
|
2155
|
+
position: _ctx.result.strategy,
|
|
2156
|
+
transform: `translate3d(${Math.round(_ctx.result.x)}px,${Math.round(_ctx.result.y)}px,0)`
|
|
2157
|
+
} : void 0),
|
|
2158
|
+
"aria-hidden": _ctx.shown ? "false" : "true",
|
|
2159
|
+
tabindex: _ctx.autoHide ? 0 : void 0,
|
|
2160
|
+
"data-popper-placement": _ctx.result ? _ctx.result.placement : void 0,
|
|
2161
|
+
onKeyup: _cache[2] || (_cache[2] = withKeys(($event) => _ctx.autoHide && _ctx.$emit("hide"), ["esc"]))
|
|
2162
|
+
}, [
|
|
2163
|
+
createElementVNode("div", {
|
|
2164
|
+
class: "v-popper__backdrop",
|
|
2165
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.autoHide && _ctx.$emit("hide"))
|
|
2166
|
+
}),
|
|
2167
|
+
createElementVNode("div", {
|
|
2168
|
+
class: "v-popper__wrapper",
|
|
2169
|
+
style: normalizeStyle(_ctx.result ? {
|
|
2170
|
+
transformOrigin: _ctx.result.transformOrigin
|
|
2171
|
+
} : void 0)
|
|
2172
|
+
}, [
|
|
2173
|
+
createElementVNode("div", _hoisted_2$1$1, [
|
|
2174
|
+
_ctx.mounted ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
2175
|
+
createElementVNode("div", null, [
|
|
2176
|
+
renderSlot(_ctx.$slots, "default")
|
|
2177
|
+
]),
|
|
2178
|
+
_ctx.handleResize ? (openBlock(), createBlock(_component_ResizeObserver, {
|
|
2179
|
+
key: 0,
|
|
2180
|
+
onNotify: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("resize", $event))
|
|
2181
|
+
})) : createCommentVNode("", true)
|
|
2182
|
+
], 64)) : createCommentVNode("", true)
|
|
2183
|
+
], 512),
|
|
2184
|
+
createElementVNode("div", {
|
|
2185
|
+
ref: "arrow",
|
|
2186
|
+
class: "v-popper__arrow-container",
|
|
2187
|
+
style: normalizeStyle(_ctx.result ? {
|
|
2188
|
+
left: _ctx.toPx(_ctx.result.arrow.x),
|
|
2189
|
+
top: _ctx.toPx(_ctx.result.arrow.y)
|
|
2190
|
+
} : void 0)
|
|
2191
|
+
}, _hoisted_5$2, 4)
|
|
2192
|
+
], 4)
|
|
2193
|
+
], 46, _hoisted_1$1$1);
|
|
2194
|
+
}
|
|
2195
|
+
var PrivatePopperContent = /* @__PURE__ */ _export_sfc$1(_sfc_main$5$1, [["render", _sfc_render$2]]);
|
|
2196
|
+
var PrivatePopperMethods = {
|
|
2197
|
+
methods: {
|
|
2198
|
+
show(...args) {
|
|
2199
|
+
return this.$refs.popper.show(...args);
|
|
2200
|
+
},
|
|
2201
|
+
hide(...args) {
|
|
2202
|
+
return this.$refs.popper.hide(...args);
|
|
2203
|
+
},
|
|
2204
|
+
dispose(...args) {
|
|
2205
|
+
return this.$refs.popper.dispose(...args);
|
|
2206
|
+
},
|
|
2207
|
+
onResize(...args) {
|
|
2208
|
+
return this.$refs.popper.onResize(...args);
|
|
2209
|
+
}
|
|
2210
|
+
}
|
|
2211
|
+
};
|
|
2212
|
+
const _sfc_main$4$1 = defineComponent({
|
|
2213
|
+
name: "VPopperWrapper",
|
|
2214
|
+
components: {
|
|
2215
|
+
Popper: PrivatePopper(),
|
|
2216
|
+
PopperContent: PrivatePopperContent
|
|
2217
|
+
},
|
|
2218
|
+
mixins: [
|
|
2219
|
+
PrivatePopperMethods,
|
|
2220
|
+
PrivateThemeClass
|
|
2221
|
+
],
|
|
2222
|
+
inheritAttrs: false,
|
|
2223
|
+
props: {
|
|
2224
|
+
theme: {
|
|
2225
|
+
type: String,
|
|
2226
|
+
default: null
|
|
2227
|
+
}
|
|
2228
|
+
},
|
|
2229
|
+
computed: {
|
|
2230
|
+
finalTheme() {
|
|
2231
|
+
var _a;
|
|
2232
|
+
return (_a = this.theme) != null ? _a : this.$options.vPopperTheme;
|
|
2233
|
+
},
|
|
2234
|
+
popperAttrs() {
|
|
2235
|
+
const result = __spreadValues2({}, this.$attrs);
|
|
2236
|
+
delete result.class;
|
|
2237
|
+
delete result.style;
|
|
2238
|
+
return result;
|
|
2239
|
+
}
|
|
2240
|
+
},
|
|
2241
|
+
methods: {
|
|
2242
|
+
getTargetNodes() {
|
|
2243
|
+
return Array.from(this.$refs.reference.children).filter((node) => node !== this.$refs.popperContent.$el);
|
|
2244
|
+
}
|
|
2245
|
+
}
|
|
2246
|
+
});
|
|
2247
|
+
function _sfc_render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2248
|
+
const _component_PopperContent = resolveComponent("PopperContent");
|
|
2249
|
+
const _component_Popper = resolveComponent("Popper");
|
|
2250
|
+
return openBlock(), createBlock(_component_Popper, mergeProps({ ref: "popper" }, _ctx.popperAttrs, {
|
|
2251
|
+
theme: _ctx.finalTheme,
|
|
2252
|
+
"target-nodes": _ctx.getTargetNodes,
|
|
2253
|
+
"reference-node": () => _ctx.$refs.reference,
|
|
2254
|
+
"popper-node": () => _ctx.$refs.popperContent.$el
|
|
2255
|
+
}), {
|
|
2256
|
+
default: withCtx(({
|
|
2257
|
+
popperId,
|
|
2258
|
+
isShown,
|
|
2259
|
+
shouldMountContent,
|
|
2260
|
+
skipTransition,
|
|
2261
|
+
autoHide,
|
|
2262
|
+
show,
|
|
2263
|
+
hide: hide2,
|
|
2264
|
+
handleResize,
|
|
2265
|
+
onResize,
|
|
2266
|
+
classes,
|
|
2267
|
+
result
|
|
2268
|
+
}) => [
|
|
2269
|
+
createElementVNode("div", {
|
|
2270
|
+
ref: "reference",
|
|
2271
|
+
class: normalizeClass(["v-popper", [
|
|
2272
|
+
_ctx.$attrs.class,
|
|
2273
|
+
_ctx.themeClass,
|
|
2274
|
+
{
|
|
2275
|
+
"v-popper--shown": isShown
|
|
2276
|
+
}
|
|
2277
|
+
]]),
|
|
2278
|
+
style: normalizeStyle(_ctx.$attrs.style)
|
|
2279
|
+
}, [
|
|
2280
|
+
renderSlot(_ctx.$slots, "default", {
|
|
2281
|
+
shown: isShown,
|
|
2282
|
+
show,
|
|
2283
|
+
hide: hide2
|
|
2284
|
+
}),
|
|
2285
|
+
createVNode(_component_PopperContent, {
|
|
2286
|
+
ref: "popperContent",
|
|
2287
|
+
"popper-id": popperId,
|
|
2288
|
+
theme: _ctx.finalTheme,
|
|
2289
|
+
shown: isShown,
|
|
2290
|
+
mounted: shouldMountContent,
|
|
2291
|
+
"skip-transition": skipTransition,
|
|
2292
|
+
"auto-hide": autoHide,
|
|
2293
|
+
"handle-resize": handleResize,
|
|
2294
|
+
classes,
|
|
2295
|
+
result,
|
|
2296
|
+
onHide: hide2,
|
|
2297
|
+
onResize
|
|
2298
|
+
}, {
|
|
2299
|
+
default: withCtx(() => [
|
|
2300
|
+
renderSlot(_ctx.$slots, "popper", {
|
|
2301
|
+
shown: isShown,
|
|
2302
|
+
hide: hide2
|
|
2303
|
+
})
|
|
2304
|
+
]),
|
|
2305
|
+
_: 2
|
|
2306
|
+
}, 1032, ["popper-id", "theme", "shown", "mounted", "skip-transition", "auto-hide", "handle-resize", "classes", "result", "onHide", "onResize"])
|
|
2307
|
+
], 6)
|
|
2308
|
+
]),
|
|
2309
|
+
_: 3
|
|
2310
|
+
}, 16, ["theme", "target-nodes", "reference-node", "popper-node"]);
|
|
2311
|
+
}
|
|
2312
|
+
var PrivatePopperWrapper = /* @__PURE__ */ _export_sfc$1(_sfc_main$4$1, [["render", _sfc_render$1]]);
|
|
2313
|
+
const _sfc_main$3$1 = defineComponent(__spreadProps2(__spreadValues2({}, PrivatePopperWrapper), {
|
|
2314
|
+
name: "VDropdown",
|
|
2315
|
+
vPopperTheme: "dropdown"
|
|
2316
|
+
}));
|
|
2317
|
+
const _sfc_main$2$1 = defineComponent(__spreadProps2(__spreadValues2({}, PrivatePopperWrapper), {
|
|
2318
|
+
name: "VMenu",
|
|
2319
|
+
vPopperTheme: "menu"
|
|
2320
|
+
}));
|
|
2321
|
+
const _sfc_main$1$1 = defineComponent(__spreadProps2(__spreadValues2({}, PrivatePopperWrapper), {
|
|
2322
|
+
name: "VTooltip",
|
|
2323
|
+
vPopperTheme: "tooltip"
|
|
2324
|
+
}));
|
|
2325
|
+
const _sfc_main$q = defineComponent({
|
|
2326
|
+
name: "VTooltipDirective",
|
|
2327
|
+
components: {
|
|
2328
|
+
Popper: PrivatePopper(),
|
|
2329
|
+
PopperContent: PrivatePopperContent
|
|
2330
|
+
},
|
|
2331
|
+
mixins: [
|
|
2332
|
+
PrivatePopperMethods
|
|
2333
|
+
],
|
|
2334
|
+
inheritAttrs: false,
|
|
2335
|
+
props: {
|
|
2336
|
+
theme: {
|
|
2337
|
+
type: String,
|
|
2338
|
+
default: "tooltip"
|
|
2339
|
+
},
|
|
2340
|
+
html: {
|
|
2341
|
+
type: Boolean,
|
|
2342
|
+
default: (props) => getDefaultConfig(props.theme, "html")
|
|
2343
|
+
},
|
|
2344
|
+
content: {
|
|
2345
|
+
type: [String, Number, Function],
|
|
2346
|
+
default: null
|
|
2347
|
+
},
|
|
2348
|
+
loadingContent: {
|
|
2349
|
+
type: String,
|
|
2350
|
+
default: (props) => getDefaultConfig(props.theme, "loadingContent")
|
|
2351
|
+
}
|
|
2352
|
+
},
|
|
2353
|
+
data() {
|
|
2354
|
+
return {
|
|
2355
|
+
asyncContent: null
|
|
2356
|
+
};
|
|
2357
|
+
},
|
|
2358
|
+
computed: {
|
|
2359
|
+
isContentAsync() {
|
|
2360
|
+
return typeof this.content === "function";
|
|
2361
|
+
},
|
|
2362
|
+
loading() {
|
|
2363
|
+
return this.isContentAsync && this.asyncContent == null;
|
|
2364
|
+
},
|
|
2365
|
+
finalContent() {
|
|
2366
|
+
if (this.isContentAsync) {
|
|
2367
|
+
return this.loading ? this.loadingContent : this.asyncContent;
|
|
2368
|
+
}
|
|
2369
|
+
return this.content;
|
|
2370
|
+
}
|
|
2371
|
+
},
|
|
2372
|
+
watch: {
|
|
2373
|
+
content: {
|
|
2374
|
+
handler() {
|
|
2375
|
+
this.fetchContent(true);
|
|
2376
|
+
},
|
|
2377
|
+
immediate: true
|
|
2378
|
+
},
|
|
2379
|
+
async finalContent() {
|
|
2380
|
+
await this.$nextTick();
|
|
2381
|
+
this.$refs.popper.onResize();
|
|
2382
|
+
}
|
|
2383
|
+
},
|
|
2384
|
+
created() {
|
|
2385
|
+
this.$_fetchId = 0;
|
|
2386
|
+
},
|
|
2387
|
+
methods: {
|
|
2388
|
+
fetchContent(force) {
|
|
2389
|
+
if (typeof this.content === "function" && this.$_isShown && (force || !this.$_loading && this.asyncContent == null)) {
|
|
2390
|
+
this.asyncContent = null;
|
|
2391
|
+
this.$_loading = true;
|
|
2392
|
+
const fetchId = ++this.$_fetchId;
|
|
2393
|
+
const result = this.content(this);
|
|
2394
|
+
if (result.then) {
|
|
2395
|
+
result.then((res) => this.onResult(fetchId, res));
|
|
2396
|
+
} else {
|
|
2397
|
+
this.onResult(fetchId, result);
|
|
2398
|
+
}
|
|
2399
|
+
}
|
|
2400
|
+
},
|
|
2401
|
+
onResult(fetchId, result) {
|
|
2402
|
+
if (fetchId !== this.$_fetchId)
|
|
2403
|
+
return;
|
|
2404
|
+
this.$_loading = false;
|
|
2405
|
+
this.asyncContent = result;
|
|
2406
|
+
},
|
|
2407
|
+
onShow() {
|
|
2408
|
+
this.$_isShown = true;
|
|
2409
|
+
this.fetchContent();
|
|
2410
|
+
},
|
|
2411
|
+
onHide() {
|
|
2412
|
+
this.$_isShown = false;
|
|
2413
|
+
}
|
|
2414
|
+
}
|
|
2415
|
+
});
|
|
2416
|
+
const _hoisted_1$l = ["innerHTML"];
|
|
2417
|
+
const _hoisted_2$a = ["textContent"];
|
|
2418
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
2419
|
+
const _component_PopperContent = resolveComponent("PopperContent");
|
|
2420
|
+
const _component_Popper = resolveComponent("Popper");
|
|
2421
|
+
return openBlock(), createBlock(_component_Popper, mergeProps({ ref: "popper" }, _ctx.$attrs, {
|
|
2422
|
+
theme: _ctx.theme,
|
|
2423
|
+
"popper-node": () => _ctx.$refs.popperContent.$el,
|
|
2424
|
+
onApplyShow: _ctx.onShow,
|
|
2425
|
+
onApplyHide: _ctx.onHide
|
|
2426
|
+
}), {
|
|
2427
|
+
default: withCtx(({
|
|
2428
|
+
popperId,
|
|
2429
|
+
isShown,
|
|
2430
|
+
shouldMountContent,
|
|
2431
|
+
skipTransition,
|
|
2432
|
+
autoHide,
|
|
2433
|
+
hide: hide2,
|
|
2434
|
+
handleResize,
|
|
2435
|
+
onResize,
|
|
2436
|
+
classes,
|
|
2437
|
+
result
|
|
2438
|
+
}) => [
|
|
2439
|
+
createVNode(_component_PopperContent, {
|
|
2440
|
+
ref: "popperContent",
|
|
2441
|
+
class: normalizeClass({
|
|
2442
|
+
"v-popper--tooltip-loading": _ctx.loading
|
|
2443
|
+
}),
|
|
2444
|
+
"popper-id": popperId,
|
|
2445
|
+
theme: _ctx.theme,
|
|
2446
|
+
shown: isShown,
|
|
2447
|
+
mounted: shouldMountContent,
|
|
2448
|
+
"skip-transition": skipTransition,
|
|
2449
|
+
"auto-hide": autoHide,
|
|
2450
|
+
"handle-resize": handleResize,
|
|
2451
|
+
classes,
|
|
2452
|
+
result,
|
|
2453
|
+
onHide: hide2,
|
|
2454
|
+
onResize
|
|
2455
|
+
}, {
|
|
2456
|
+
default: withCtx(() => [
|
|
2457
|
+
_ctx.html ? (openBlock(), createElementBlock("div", {
|
|
2458
|
+
key: 0,
|
|
2459
|
+
innerHTML: _ctx.finalContent
|
|
2460
|
+
}, null, 8, _hoisted_1$l)) : (openBlock(), createElementBlock("div", {
|
|
2461
|
+
key: 1,
|
|
2462
|
+
textContent: toDisplayString(_ctx.finalContent)
|
|
2463
|
+
}, null, 8, _hoisted_2$a))
|
|
2464
|
+
]),
|
|
2465
|
+
_: 2
|
|
2466
|
+
}, 1032, ["class", "popper-id", "theme", "shown", "mounted", "skip-transition", "auto-hide", "handle-resize", "classes", "result", "onHide", "onResize"])
|
|
2467
|
+
]),
|
|
2468
|
+
_: 1
|
|
2469
|
+
}, 16, ["theme", "popper-node", "onApplyShow", "onApplyHide"]);
|
|
2470
|
+
}
|
|
2471
|
+
var PrivateTooltipDirective = /* @__PURE__ */ _export_sfc$1(_sfc_main$q, [["render", _sfc_render]]);
|
|
2472
|
+
const TARGET_CLASS = "v-popper--has-tooltip";
|
|
2473
|
+
function getPlacement(options2, modifiers) {
|
|
2474
|
+
let result = options2.placement;
|
|
2475
|
+
if (!result && modifiers) {
|
|
2476
|
+
for (const pos of placements$1) {
|
|
2477
|
+
if (modifiers[pos]) {
|
|
2478
|
+
result = pos;
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
}
|
|
2482
|
+
if (!result) {
|
|
2483
|
+
result = getDefaultConfig(options2.theme || "tooltip", "placement");
|
|
2484
|
+
}
|
|
2485
|
+
return result;
|
|
2486
|
+
}
|
|
2487
|
+
function getOptions(el, value, modifiers) {
|
|
2488
|
+
let options2;
|
|
2489
|
+
const type = typeof value;
|
|
2490
|
+
if (type === "string") {
|
|
2491
|
+
options2 = { content: value };
|
|
2492
|
+
} else if (value && type === "object") {
|
|
2493
|
+
options2 = value;
|
|
2494
|
+
} else {
|
|
2495
|
+
options2 = { content: false };
|
|
2496
|
+
}
|
|
2497
|
+
options2.placement = getPlacement(options2, modifiers);
|
|
2498
|
+
options2.targetNodes = () => [el];
|
|
2499
|
+
options2.referenceNode = () => el;
|
|
2500
|
+
return options2;
|
|
2501
|
+
}
|
|
2502
|
+
let directiveApp;
|
|
2503
|
+
let directives;
|
|
2504
|
+
let uid = 0;
|
|
2505
|
+
function ensureDirectiveApp() {
|
|
2506
|
+
if (directiveApp)
|
|
2507
|
+
return;
|
|
2508
|
+
directives = ref([]);
|
|
2509
|
+
directiveApp = createApp({
|
|
2510
|
+
name: "VTooltipDirectiveApp",
|
|
2511
|
+
setup() {
|
|
2512
|
+
return {
|
|
2513
|
+
directives
|
|
2514
|
+
};
|
|
2515
|
+
},
|
|
2516
|
+
render() {
|
|
2517
|
+
return this.directives.map((directive) => {
|
|
2518
|
+
return h(PrivateTooltipDirective, __spreadProps2(__spreadValues2({}, directive.options), {
|
|
2519
|
+
shown: directive.shown.value || directive.options.shown,
|
|
2520
|
+
key: directive.id
|
|
2521
|
+
}));
|
|
2522
|
+
});
|
|
2523
|
+
},
|
|
2524
|
+
devtools: {
|
|
2525
|
+
hide: true
|
|
2526
|
+
}
|
|
2527
|
+
});
|
|
2528
|
+
const mountTarget = document.createElement("div");
|
|
2529
|
+
document.body.appendChild(mountTarget);
|
|
2530
|
+
directiveApp.mount(mountTarget);
|
|
2531
|
+
}
|
|
2532
|
+
function createTooltip(el, value, modifiers) {
|
|
2533
|
+
ensureDirectiveApp();
|
|
2534
|
+
const options2 = ref(getOptions(el, value, modifiers));
|
|
2535
|
+
const shown = ref(false);
|
|
2536
|
+
const item = {
|
|
2537
|
+
id: uid++,
|
|
2538
|
+
options: options2,
|
|
2539
|
+
shown
|
|
2540
|
+
};
|
|
2541
|
+
directives.value.push(item);
|
|
2542
|
+
if (el.classList) {
|
|
2543
|
+
el.classList.add(TARGET_CLASS);
|
|
2544
|
+
}
|
|
2545
|
+
const result = el.$_popper = {
|
|
2546
|
+
options: options2,
|
|
2547
|
+
item,
|
|
2548
|
+
show() {
|
|
2549
|
+
shown.value = true;
|
|
2550
|
+
},
|
|
2551
|
+
hide() {
|
|
2552
|
+
shown.value = false;
|
|
2553
|
+
}
|
|
2554
|
+
};
|
|
2555
|
+
return result;
|
|
2556
|
+
}
|
|
2557
|
+
function destroyTooltip(el) {
|
|
2558
|
+
if (el.$_popper) {
|
|
2559
|
+
const index = directives.value.indexOf(el.$_popper.item);
|
|
2560
|
+
if (index !== -1)
|
|
2561
|
+
directives.value.splice(index, 1);
|
|
2562
|
+
delete el.$_popper;
|
|
2563
|
+
delete el.$_popperOldShown;
|
|
2564
|
+
delete el.$_popperMountTarget;
|
|
2565
|
+
}
|
|
2566
|
+
if (el.classList) {
|
|
2567
|
+
el.classList.remove(TARGET_CLASS);
|
|
2568
|
+
}
|
|
2569
|
+
}
|
|
2570
|
+
function bind(el, { value, oldValue, modifiers }) {
|
|
2571
|
+
const options2 = getOptions(el, value, modifiers);
|
|
2572
|
+
if (!options2.content || getDefaultConfig(options2.theme || "tooltip", "disabled")) {
|
|
2573
|
+
destroyTooltip(el);
|
|
2574
|
+
} else {
|
|
2575
|
+
let directive;
|
|
2576
|
+
if (el.$_popper) {
|
|
2577
|
+
directive = el.$_popper;
|
|
2578
|
+
directive.options.value = options2;
|
|
2579
|
+
} else {
|
|
2580
|
+
directive = createTooltip(el, value, modifiers);
|
|
2581
|
+
}
|
|
2582
|
+
if (typeof value.shown !== "undefined" && value.shown !== el.$_popperOldShown) {
|
|
2583
|
+
el.$_popperOldShown = value.shown;
|
|
2584
|
+
value.shown ? directive.show() : directive.hide();
|
|
2585
|
+
}
|
|
2586
|
+
}
|
|
2587
|
+
}
|
|
2588
|
+
var PrivateVTooltip = {
|
|
2589
|
+
beforeMount: bind,
|
|
2590
|
+
updated: bind,
|
|
2591
|
+
beforeUnmount(el) {
|
|
2592
|
+
destroyTooltip(el);
|
|
2593
|
+
}
|
|
2594
|
+
};
|
|
2595
|
+
function addListeners(el) {
|
|
2596
|
+
el.addEventListener("click", onClick);
|
|
2597
|
+
el.addEventListener("touchstart", onTouchStart, supportsPassive ? {
|
|
2598
|
+
passive: true
|
|
2599
|
+
} : false);
|
|
2600
|
+
}
|
|
2601
|
+
function removeListeners(el) {
|
|
2602
|
+
el.removeEventListener("click", onClick);
|
|
2603
|
+
el.removeEventListener("touchstart", onTouchStart);
|
|
2604
|
+
el.removeEventListener("touchend", onTouchEnd);
|
|
2605
|
+
el.removeEventListener("touchcancel", onTouchCancel);
|
|
2606
|
+
}
|
|
2607
|
+
function onClick(event) {
|
|
2608
|
+
const el = event.currentTarget;
|
|
2609
|
+
event.closePopover = !el.$_vclosepopover_touch;
|
|
2610
|
+
event.closeAllPopover = el.$_closePopoverModifiers && !!el.$_closePopoverModifiers.all;
|
|
2611
|
+
}
|
|
2612
|
+
function onTouchStart(event) {
|
|
2613
|
+
if (event.changedTouches.length === 1) {
|
|
2614
|
+
const el = event.currentTarget;
|
|
2615
|
+
el.$_vclosepopover_touch = true;
|
|
2616
|
+
const touch = event.changedTouches[0];
|
|
2617
|
+
el.$_vclosepopover_touchPoint = touch;
|
|
2618
|
+
el.addEventListener("touchend", onTouchEnd);
|
|
2619
|
+
el.addEventListener("touchcancel", onTouchCancel);
|
|
2620
|
+
}
|
|
2621
|
+
}
|
|
2622
|
+
function onTouchEnd(event) {
|
|
2623
|
+
const el = event.currentTarget;
|
|
2624
|
+
el.$_vclosepopover_touch = false;
|
|
2625
|
+
if (event.changedTouches.length === 1) {
|
|
2626
|
+
const touch = event.changedTouches[0];
|
|
2627
|
+
const firstTouch = el.$_vclosepopover_touchPoint;
|
|
2628
|
+
event.closePopover = Math.abs(touch.screenY - firstTouch.screenY) < 20 && Math.abs(touch.screenX - firstTouch.screenX) < 20;
|
|
2629
|
+
event.closeAllPopover = el.$_closePopoverModifiers && !!el.$_closePopoverModifiers.all;
|
|
2630
|
+
}
|
|
2631
|
+
}
|
|
2632
|
+
function onTouchCancel(event) {
|
|
2633
|
+
const el = event.currentTarget;
|
|
2634
|
+
el.$_vclosepopover_touch = false;
|
|
2635
|
+
}
|
|
2636
|
+
var PrivateVClosePopper = {
|
|
2637
|
+
beforeMount(el, { value, modifiers }) {
|
|
2638
|
+
el.$_closePopoverModifiers = modifiers;
|
|
2639
|
+
if (typeof value === "undefined" || value) {
|
|
2640
|
+
addListeners(el);
|
|
2641
|
+
}
|
|
2642
|
+
},
|
|
2643
|
+
updated(el, { value, oldValue, modifiers }) {
|
|
2644
|
+
el.$_closePopoverModifiers = modifiers;
|
|
2645
|
+
if (value !== oldValue) {
|
|
2646
|
+
if (typeof value === "undefined" || value) {
|
|
2647
|
+
addListeners(el);
|
|
2648
|
+
} else {
|
|
2649
|
+
removeListeners(el);
|
|
2650
|
+
}
|
|
2651
|
+
}
|
|
2652
|
+
},
|
|
2653
|
+
beforeUnmount(el) {
|
|
2654
|
+
removeListeners(el);
|
|
2655
|
+
}
|
|
2656
|
+
};
|
|
2657
|
+
function install$1(app, options2 = {}) {
|
|
2658
|
+
if (app.$_vTooltipInstalled)
|
|
2659
|
+
return;
|
|
2660
|
+
app.$_vTooltipInstalled = true;
|
|
2661
|
+
assign(config$2, options2);
|
|
2662
|
+
app.directive("tooltip", PrivateVTooltip);
|
|
2663
|
+
app.directive("close-popper", PrivateVClosePopper);
|
|
2664
|
+
app.component("v-tooltip", _sfc_main$1$1);
|
|
2665
|
+
app.component("VTooltip", _sfc_main$1$1);
|
|
2666
|
+
app.component("v-dropdown", _sfc_main$3$1);
|
|
2667
|
+
app.component("VDropdown", _sfc_main$3$1);
|
|
2668
|
+
app.component("v-menu", _sfc_main$2$1);
|
|
2669
|
+
app.component("VMenu", _sfc_main$2$1);
|
|
2670
|
+
}
|
|
2671
|
+
const plugin = {
|
|
2672
|
+
version: "2.0.0-beta.6",
|
|
2673
|
+
install: install$1,
|
|
2674
|
+
options: config$2
|
|
2675
|
+
};
|
|
21
2676
|
var defaultCleekOptions = {
|
|
22
2677
|
colors: {
|
|
23
2678
|
primary: "#559933",
|
|
@@ -488,9 +3143,9 @@ function insertCss(css2) {
|
|
|
488
3143
|
}
|
|
489
3144
|
var idPool = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
490
3145
|
function nextUniqueId() {
|
|
491
|
-
var
|
|
3146
|
+
var size2 = 12;
|
|
492
3147
|
var id = "";
|
|
493
|
-
while (
|
|
3148
|
+
while (size2-- > 0) {
|
|
494
3149
|
id += idPool[Math.random() * 62 | 0];
|
|
495
3150
|
}
|
|
496
3151
|
return id;
|
|
@@ -694,10 +3349,10 @@ function toHex(unicode) {
|
|
|
694
3349
|
return decoded.length === 1 ? decoded[0].toString(16) : null;
|
|
695
3350
|
}
|
|
696
3351
|
function codePointAt(string, index) {
|
|
697
|
-
var
|
|
3352
|
+
var size2 = string.length;
|
|
698
3353
|
var first = string.charCodeAt(index);
|
|
699
3354
|
var second;
|
|
700
|
-
if (first >= 55296 && first <= 56319 &&
|
|
3355
|
+
if (first >= 55296 && first <= 56319 && size2 > index + 1) {
|
|
701
3356
|
second = string.charCodeAt(index + 1);
|
|
702
3357
|
if (second >= 56320 && second <= 57343) {
|
|
703
3358
|
return (first - 55296) * 1024 + second - 56320 + 65536;
|
|
@@ -970,8 +3625,8 @@ function registerPlugins(nextPlugins, _ref2) {
|
|
|
970
3625
|
delete providers[k];
|
|
971
3626
|
}
|
|
972
3627
|
});
|
|
973
|
-
_plugins.forEach(function(
|
|
974
|
-
var mixout8 =
|
|
3628
|
+
_plugins.forEach(function(plugin2) {
|
|
3629
|
+
var mixout8 = plugin2.mixout ? plugin2.mixout() : {};
|
|
975
3630
|
Object.keys(mixout8).forEach(function(tk) {
|
|
976
3631
|
if (typeof mixout8[tk] === "function") {
|
|
977
3632
|
obj[tk] = mixout8[tk];
|
|
@@ -985,8 +3640,8 @@ function registerPlugins(nextPlugins, _ref2) {
|
|
|
985
3640
|
});
|
|
986
3641
|
}
|
|
987
3642
|
});
|
|
988
|
-
if (
|
|
989
|
-
var hooks8 =
|
|
3643
|
+
if (plugin2.hooks) {
|
|
3644
|
+
var hooks8 = plugin2.hooks();
|
|
990
3645
|
Object.keys(hooks8).forEach(function(hook) {
|
|
991
3646
|
if (!_hooks[hook]) {
|
|
992
3647
|
_hooks[hook] = [];
|
|
@@ -994,8 +3649,8 @@ function registerPlugins(nextPlugins, _ref2) {
|
|
|
994
3649
|
_hooks[hook].push(hooks8[hook]);
|
|
995
3650
|
});
|
|
996
3651
|
}
|
|
997
|
-
if (
|
|
998
|
-
|
|
3652
|
+
if (plugin2.provides) {
|
|
3653
|
+
plugin2.provides(providers);
|
|
999
3654
|
}
|
|
1000
3655
|
});
|
|
1001
3656
|
return obj;
|
|
@@ -16436,14 +19091,14 @@ const _sfc_main$n = /* @__PURE__ */ defineComponent({
|
|
|
16436
19091
|
}
|
|
16437
19092
|
return list;
|
|
16438
19093
|
});
|
|
16439
|
-
function
|
|
19094
|
+
function onClick2(event) {
|
|
16440
19095
|
emits("click", event);
|
|
16441
19096
|
}
|
|
16442
19097
|
return (_ctx, _cache) => {
|
|
16443
19098
|
return openBlock(), createElementBlock("div", {
|
|
16444
19099
|
class: normalizeClass(["ck-icon", unref$1(computedClass)]),
|
|
16445
19100
|
style: normalizeStyle(unref$1(computedStyle)),
|
|
16446
|
-
onClick: _cache[0] || (_cache[0] = ($event) =>
|
|
19101
|
+
onClick: _cache[0] || (_cache[0] = ($event) => onClick2($event))
|
|
16447
19102
|
}, [
|
|
16448
19103
|
unref$1(computediconPack) === "font-awesome" ? (openBlock(), createBlock(unref$1(FontAwesomeIcon), {
|
|
16449
19104
|
key: 0,
|
|
@@ -16795,7 +19450,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
16795
19450
|
list.push({ width: props.width });
|
|
16796
19451
|
return list;
|
|
16797
19452
|
});
|
|
16798
|
-
function
|
|
19453
|
+
function onClick2(event) {
|
|
16799
19454
|
emits("click", event);
|
|
16800
19455
|
}
|
|
16801
19456
|
onMounted(() => {
|
|
@@ -16810,7 +19465,7 @@ const _sfc_main$h = /* @__PURE__ */ defineComponent({
|
|
|
16810
19465
|
"aria-label": __props.title,
|
|
16811
19466
|
disabled: __props.disabled,
|
|
16812
19467
|
style: normalizeStyle(unref$1(computedStyle)),
|
|
16813
|
-
onClick: _cache[0] || (_cache[0] = ($event) =>
|
|
19468
|
+
onClick: _cache[0] || (_cache[0] = ($event) => onClick2($event))
|
|
16814
19469
|
}, [
|
|
16815
19470
|
__props.icon ? (openBlock(), createBlock(ckIcon, {
|
|
16816
19471
|
key: 0,
|
|
@@ -16907,7 +19562,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16907
19562
|
return props.align;
|
|
16908
19563
|
return "left";
|
|
16909
19564
|
});
|
|
16910
|
-
const
|
|
19565
|
+
const onClick2 = (event) => {
|
|
16911
19566
|
if (props.autoSelect)
|
|
16912
19567
|
event.target.select();
|
|
16913
19568
|
emits("click", event);
|
|
@@ -16992,7 +19647,7 @@ const _sfc_main$f = /* @__PURE__ */ defineComponent({
|
|
|
16992
19647
|
disabled: __props.disabled,
|
|
16993
19648
|
onChange: _cache[1] || (_cache[1] = ($event) => onChange2($event)),
|
|
16994
19649
|
onInput: _cache[2] || (_cache[2] = ($event) => onInput($event)),
|
|
16995
|
-
onClick: _cache[3] || (_cache[3] = ($event) =>
|
|
19650
|
+
onClick: _cache[3] || (_cache[3] = ($event) => onClick2($event))
|
|
16996
19651
|
}, null, 42, _hoisted_1$e), [
|
|
16997
19652
|
[vModelDynamic, unref$1(value)]
|
|
16998
19653
|
]),
|
|
@@ -18104,6 +20759,7 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
18104
20759
|
notCloseBtn: { type: Boolean, default: false },
|
|
18105
20760
|
notCloseByBg: { type: Boolean, default: false },
|
|
18106
20761
|
preventCloseOnCancel: { type: Boolean, default: false },
|
|
20762
|
+
width: { type: String, default: void 0 },
|
|
18107
20763
|
maxWidth: { type: String, default: void 0 }
|
|
18108
20764
|
},
|
|
18109
20765
|
emits: ["update:modelValue", "cancel", "accept"],
|
|
@@ -18121,6 +20777,8 @@ const _sfc_main$b = /* @__PURE__ */ defineComponent({
|
|
|
18121
20777
|
const list = [];
|
|
18122
20778
|
if (props.maxWidth)
|
|
18123
20779
|
list.push({ maxWidth: props.maxWidth });
|
|
20780
|
+
if (props.width)
|
|
20781
|
+
list.push({ width: props.width });
|
|
18124
20782
|
return list;
|
|
18125
20783
|
});
|
|
18126
20784
|
function onCancel() {
|
|
@@ -18383,8 +21041,8 @@ const qmStr = {
|
|
|
18383
21041
|
}
|
|
18384
21042
|
return result;
|
|
18385
21043
|
},
|
|
18386
|
-
padZeros(num,
|
|
18387
|
-
return `000000000${num}`.substr(-
|
|
21044
|
+
padZeros(num, size2 = 2) {
|
|
21045
|
+
return `000000000${num}`.substr(-size2);
|
|
18388
21046
|
},
|
|
18389
21047
|
removeDiacritics(str) {
|
|
18390
21048
|
return str.normalize("NFD").replace(/([^n\u0300-\u036f]|n(?!\u0303(?![\u0300-\u036f])))[\u0300-\u036f]+/gi, "$1").normalize();
|
|
@@ -18999,7 +21657,7 @@ const _hoisted_1$4 = ["disabled"];
|
|
|
18999
21657
|
const _hoisted_2$2 = ["value"];
|
|
19000
21658
|
const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
19001
21659
|
props: {
|
|
19002
|
-
modelValue: { default: null
|
|
21660
|
+
modelValue: { default: null },
|
|
19003
21661
|
prop: { type: String, default: void 0 },
|
|
19004
21662
|
reduceValueProp: { type: String, default: "id" },
|
|
19005
21663
|
reduceNameProp: { type: String, default: "name" },
|
|
@@ -19050,9 +21708,18 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
19050
21708
|
});
|
|
19051
21709
|
return list;
|
|
19052
21710
|
});
|
|
21711
|
+
const isClearBtnVisible = computed$2(() => {
|
|
21712
|
+
if (props.notClearable)
|
|
21713
|
+
return false;
|
|
21714
|
+
if (valueIsDefault.value)
|
|
21715
|
+
return false;
|
|
21716
|
+
return true;
|
|
21717
|
+
});
|
|
19053
21718
|
const computedClassSelect = computed$2(() => {
|
|
19054
21719
|
const list = [];
|
|
19055
21720
|
list.push(functions.getGroupClass(props, windowWidth.value));
|
|
21721
|
+
if (isClearBtnVisible.value)
|
|
21722
|
+
list.push("clear-able");
|
|
19056
21723
|
return list;
|
|
19057
21724
|
});
|
|
19058
21725
|
const computedStyle = computed$2(() => {
|
|
@@ -19079,12 +21746,16 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
19079
21746
|
return props.searchable;
|
|
19080
21747
|
});
|
|
19081
21748
|
const realClearValue = computed$2(() => {
|
|
21749
|
+
if (props.clearValue !== "auto")
|
|
21750
|
+
return props.clearValue;
|
|
19082
21751
|
switch (typeof props.modelValue) {
|
|
19083
21752
|
case "number":
|
|
19084
21753
|
return 0;
|
|
19085
21754
|
case "string":
|
|
19086
21755
|
return "";
|
|
19087
21756
|
case "object":
|
|
21757
|
+
if (!props.modelValue)
|
|
21758
|
+
return null;
|
|
19088
21759
|
if (props.modelValue.constructor === Array)
|
|
19089
21760
|
return [];
|
|
19090
21761
|
return {};
|
|
@@ -19092,7 +21763,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
19092
21763
|
return null;
|
|
19093
21764
|
}
|
|
19094
21765
|
});
|
|
19095
|
-
computed$2(() => {
|
|
21766
|
+
const valueIsDefault = computed$2(() => {
|
|
21767
|
+
if (props.clearValue !== "auto")
|
|
21768
|
+
return value.value === props.clearValue;
|
|
19096
21769
|
switch (typeof props.modelValue) {
|
|
19097
21770
|
case "number":
|
|
19098
21771
|
return props.modelValue === 0;
|
|
@@ -19109,7 +21782,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
19109
21782
|
return props.modelValue === null;
|
|
19110
21783
|
}
|
|
19111
21784
|
});
|
|
19112
|
-
function
|
|
21785
|
+
function onClick2(event) {
|
|
19113
21786
|
emits("click", event);
|
|
19114
21787
|
}
|
|
19115
21788
|
function onChange2(event) {
|
|
@@ -19136,8 +21809,15 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
19136
21809
|
class: "ck-select",
|
|
19137
21810
|
style: normalizeStyle(unref$1(computedStyle))
|
|
19138
21811
|
}, [
|
|
19139
|
-
|
|
21812
|
+
unref$1(isClearBtnVisible) ? (openBlock(), createElementBlock("div", {
|
|
19140
21813
|
key: 0,
|
|
21814
|
+
class: "ck-select__clear-btn",
|
|
21815
|
+
onClick: _cache[0] || (_cache[0] = ($event) => value.value = unref$1(realClearValue))
|
|
21816
|
+
}, [
|
|
21817
|
+
createVNode(ckIcon, { icon: "times" })
|
|
21818
|
+
])) : createCommentVNode("", true),
|
|
21819
|
+
__props.label ? (openBlock(), createBlock(ckLabel, {
|
|
21820
|
+
key: 1,
|
|
19141
21821
|
align: __props.labelAlign,
|
|
19142
21822
|
for: "ck-input"
|
|
19143
21823
|
}, {
|
|
@@ -19147,11 +21827,11 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
19147
21827
|
_: 1
|
|
19148
21828
|
}, 8, ["align"])) : createCommentVNode("", true),
|
|
19149
21829
|
withDirectives(createElementVNode("select", {
|
|
19150
|
-
"onUpdate:modelValue": _cache[
|
|
21830
|
+
"onUpdate:modelValue": _cache[1] || (_cache[1] = ($event) => isRef$1(value) ? value.value = $event : null),
|
|
19151
21831
|
class: normalizeClass(unref$1(computedClassSelect)),
|
|
19152
21832
|
disabled: __props.disabled,
|
|
19153
|
-
onClick: _cache[
|
|
19154
|
-
onChange: _cache[
|
|
21833
|
+
onClick: _cache[2] || (_cache[2] = ($event) => onClick2($event)),
|
|
21834
|
+
onChange: _cache[3] || (_cache[3] = ($event) => onChange2($event))
|
|
19155
21835
|
}, [
|
|
19156
21836
|
(openBlock(true), createElementBlock(Fragment, null, renderList(unref$1(filteredOptions), (option) => {
|
|
19157
21837
|
return openBlock(), createElementBlock("option", {
|
|
@@ -19166,7 +21846,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
19166
21846
|
};
|
|
19167
21847
|
}
|
|
19168
21848
|
});
|
|
19169
|
-
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-
|
|
21849
|
+
var ckSelect = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-bf9787dc"]]);
|
|
19170
21850
|
var ckSwitch_vue_vue_type_style_index_0_scoped_true_lang = "";
|
|
19171
21851
|
const _withScopeId = (n) => (pushScopeId("data-v-7e2f20c4"), n = n(), popScopeId(), n);
|
|
19172
21852
|
const _hoisted_1$3 = ["disabled"];
|
|
@@ -19203,10 +21883,10 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
19203
21883
|
list.push("is-squared");
|
|
19204
21884
|
if (props.outlined)
|
|
19205
21885
|
list.push("is-outlined");
|
|
19206
|
-
let
|
|
21886
|
+
let size2 = "s";
|
|
19207
21887
|
if (props.size === "xs" || props.size === "m" || props.size === "l")
|
|
19208
|
-
|
|
19209
|
-
list.push(`ck-switch--size-${
|
|
21888
|
+
size2 = props.size;
|
|
21889
|
+
list.push(`ck-switch--size-${size2}`);
|
|
19210
21890
|
return list;
|
|
19211
21891
|
});
|
|
19212
21892
|
const computedAttributes = computed$2(() => {
|
|
@@ -19593,8 +22273,8 @@ function getTrueOffsetParent(element) {
|
|
|
19593
22273
|
}
|
|
19594
22274
|
function getContainingBlock(element) {
|
|
19595
22275
|
var isFirefox = navigator.userAgent.toLowerCase().indexOf("firefox") !== -1;
|
|
19596
|
-
var
|
|
19597
|
-
if (
|
|
22276
|
+
var isIE2 = navigator.userAgent.indexOf("Trident") !== -1;
|
|
22277
|
+
if (isIE2 && isHTMLElement(element)) {
|
|
19598
22278
|
var elementCss = getComputedStyle$1(element);
|
|
19599
22279
|
if (elementCss.position === "fixed") {
|
|
19600
22280
|
return null;
|
|
@@ -19625,8 +22305,8 @@ function getOffsetParent(element) {
|
|
|
19625
22305
|
function getMainAxisFromPlacement(placement) {
|
|
19626
22306
|
return ["top", "bottom"].indexOf(placement) >= 0 ? "x" : "y";
|
|
19627
22307
|
}
|
|
19628
|
-
function within(min$
|
|
19629
|
-
return max(min$
|
|
22308
|
+
function within(min$12, value, max$12) {
|
|
22309
|
+
return max(min$12, min(value, max$12));
|
|
19630
22310
|
}
|
|
19631
22311
|
function withinMaxClamp(min2, value, max2) {
|
|
19632
22312
|
var v = within(min2, value, max2);
|
|
@@ -20107,14 +22787,14 @@ function computeAutoPlacement(state, options) {
|
|
|
20107
22787
|
}
|
|
20108
22788
|
var _options = options, placement = _options.placement, boundary = _options.boundary, rootBoundary = _options.rootBoundary, padding = _options.padding, flipVariations = _options.flipVariations, _options$allowedAutoP = _options.allowedAutoPlacements, allowedAutoPlacements = _options$allowedAutoP === void 0 ? placements : _options$allowedAutoP;
|
|
20109
22789
|
var variation = getVariation(placement);
|
|
20110
|
-
var placements$
|
|
22790
|
+
var placements$12 = variation ? flipVariations ? variationPlacements : variationPlacements.filter(function(placement2) {
|
|
20111
22791
|
return getVariation(placement2) === variation;
|
|
20112
22792
|
}) : basePlacements;
|
|
20113
|
-
var allowedPlacements = placements$
|
|
22793
|
+
var allowedPlacements = placements$12.filter(function(placement2) {
|
|
20114
22794
|
return allowedAutoPlacements.indexOf(placement2) >= 0;
|
|
20115
22795
|
});
|
|
20116
22796
|
if (allowedPlacements.length === 0) {
|
|
20117
|
-
allowedPlacements = placements$
|
|
22797
|
+
allowedPlacements = placements$12;
|
|
20118
22798
|
}
|
|
20119
22799
|
var overflows = allowedPlacements.reduce(function(acc, placement2) {
|
|
20120
22800
|
acc[placement2] = detectOverflow(state, {
|
|
@@ -20382,8 +23062,8 @@ function preventOverflow(_ref2) {
|
|
|
20382
23062
|
var altSide = mainAxis === "y" ? bottom : right;
|
|
20383
23063
|
var len = mainAxis === "y" ? "height" : "width";
|
|
20384
23064
|
var offset2 = popperOffsets2[mainAxis];
|
|
20385
|
-
var min$
|
|
20386
|
-
var max$
|
|
23065
|
+
var min$12 = offset2 + overflow[mainSide];
|
|
23066
|
+
var max$12 = offset2 - overflow[altSide];
|
|
20387
23067
|
var additive = tether ? -popperRect[len] / 2 : 0;
|
|
20388
23068
|
var minLen = variation === start ? referenceRect[len] : popperRect[len];
|
|
20389
23069
|
var maxLen = variation === start ? -popperRect[len] : -referenceRect[len];
|
|
@@ -20403,7 +23083,7 @@ function preventOverflow(_ref2) {
|
|
|
20403
23083
|
var offsetModifierValue = (_offsetModifierState$ = offsetModifierState == null ? void 0 : offsetModifierState[mainAxis]) != null ? _offsetModifierState$ : 0;
|
|
20404
23084
|
var tetherMin = offset2 + minOffset - offsetModifierValue - clientOffset;
|
|
20405
23085
|
var tetherMax = offset2 + maxOffset - offsetModifierValue;
|
|
20406
|
-
var preventedOffset = within(tether ? min(min$
|
|
23086
|
+
var preventedOffset = within(tether ? min(min$12, tetherMin) : min$12, offset2, tether ? max(max$12, tetherMax) : max$12);
|
|
20407
23087
|
popperOffsets2[mainAxis] = preventedOffset;
|
|
20408
23088
|
data[mainAxis] = preventedOffset - offset2;
|
|
20409
23089
|
}
|
|
@@ -20948,8 +23628,8 @@ var setDefaultProps = function setDefaultProps2(partialProps) {
|
|
|
20948
23628
|
};
|
|
20949
23629
|
function getExtendedPassedProps(passedProps) {
|
|
20950
23630
|
var plugins2 = passedProps.plugins || [];
|
|
20951
|
-
var pluginProps2 = plugins2.reduce(function(acc,
|
|
20952
|
-
var name =
|
|
23631
|
+
var pluginProps2 = plugins2.reduce(function(acc, plugin2) {
|
|
23632
|
+
var name = plugin2.name, defaultValue = plugin2.defaultValue;
|
|
20953
23633
|
if (name) {
|
|
20954
23634
|
var _name;
|
|
20955
23635
|
acc[name] = passedProps[name] !== void 0 ? passedProps[name] : (_name = defaultProps[name]) != null ? _name : defaultValue;
|
|
@@ -21151,11 +23831,11 @@ function createTippy(reference2, passedProps) {
|
|
|
21151
23831
|
instance.popper = popper2;
|
|
21152
23832
|
reference2._tippy = instance;
|
|
21153
23833
|
popper2._tippy = instance;
|
|
21154
|
-
var pluginsHooks = plugins2.map(function(
|
|
21155
|
-
return
|
|
23834
|
+
var pluginsHooks = plugins2.map(function(plugin2) {
|
|
23835
|
+
return plugin2.fn(instance);
|
|
21156
23836
|
});
|
|
21157
23837
|
var hasAriaExpanded = reference2.hasAttribute("aria-expanded");
|
|
21158
|
-
|
|
23838
|
+
addListeners2();
|
|
21159
23839
|
handleAriaExpandedAttribute();
|
|
21160
23840
|
handleStyles();
|
|
21161
23841
|
invokeHook("onCreate", [instance]);
|
|
@@ -21299,21 +23979,21 @@ function createTippy(reference2, passedProps) {
|
|
|
21299
23979
|
function onTouchMove() {
|
|
21300
23980
|
didTouchMove = true;
|
|
21301
23981
|
}
|
|
21302
|
-
function
|
|
23982
|
+
function onTouchStart2() {
|
|
21303
23983
|
didTouchMove = false;
|
|
21304
23984
|
}
|
|
21305
23985
|
function addDocumentPress() {
|
|
21306
23986
|
var doc = getDocument();
|
|
21307
23987
|
doc.addEventListener("mousedown", onDocumentPress, true);
|
|
21308
23988
|
doc.addEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
|
|
21309
|
-
doc.addEventListener("touchstart",
|
|
23989
|
+
doc.addEventListener("touchstart", onTouchStart2, TOUCH_OPTIONS);
|
|
21310
23990
|
doc.addEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
|
|
21311
23991
|
}
|
|
21312
23992
|
function removeDocumentPress() {
|
|
21313
23993
|
var doc = getDocument();
|
|
21314
23994
|
doc.removeEventListener("mousedown", onDocumentPress, true);
|
|
21315
23995
|
doc.removeEventListener("touchend", onDocumentPress, TOUCH_OPTIONS);
|
|
21316
|
-
doc.removeEventListener("touchstart",
|
|
23996
|
+
doc.removeEventListener("touchstart", onTouchStart2, TOUCH_OPTIONS);
|
|
21317
23997
|
doc.removeEventListener("touchmove", onTouchMove, TOUCH_OPTIONS);
|
|
21318
23998
|
}
|
|
21319
23999
|
function onTransitionedOut(duration, callback) {
|
|
@@ -21356,7 +24036,7 @@ function createTippy(reference2, passedProps) {
|
|
|
21356
24036
|
});
|
|
21357
24037
|
});
|
|
21358
24038
|
}
|
|
21359
|
-
function
|
|
24039
|
+
function addListeners2() {
|
|
21360
24040
|
if (getIsCustomTouchBehavior()) {
|
|
21361
24041
|
on("touchstart", onTrigger2, {
|
|
21362
24042
|
passive: true
|
|
@@ -21383,7 +24063,7 @@ function createTippy(reference2, passedProps) {
|
|
|
21383
24063
|
}
|
|
21384
24064
|
});
|
|
21385
24065
|
}
|
|
21386
|
-
function
|
|
24066
|
+
function removeListeners2() {
|
|
21387
24067
|
listeners.forEach(function(_ref2) {
|
|
21388
24068
|
var node = _ref2.node, eventType = _ref2.eventType, handler = _ref2.handler, options = _ref2.options;
|
|
21389
24069
|
node.removeEventListener(eventType, handler, options);
|
|
@@ -21621,13 +24301,13 @@ function createTippy(reference2, passedProps) {
|
|
|
21621
24301
|
return;
|
|
21622
24302
|
}
|
|
21623
24303
|
invokeHook("onBeforeUpdate", [instance, partialProps]);
|
|
21624
|
-
|
|
24304
|
+
removeListeners2();
|
|
21625
24305
|
var prevProps = instance.props;
|
|
21626
24306
|
var nextProps = evaluateProps(reference2, Object.assign({}, prevProps, removeUndefinedProps(partialProps), {
|
|
21627
24307
|
ignoreAttributes: true
|
|
21628
24308
|
}));
|
|
21629
24309
|
instance.props = nextProps;
|
|
21630
|
-
|
|
24310
|
+
addListeners2();
|
|
21631
24311
|
if (prevProps.interactiveDebounce !== nextProps.interactiveDebounce) {
|
|
21632
24312
|
cleanupInteractiveMouseListeners();
|
|
21633
24313
|
debouncedOnMouseMove = debounce(onMouseMove, nextProps.interactiveDebounce);
|
|
@@ -21783,7 +24463,7 @@ function createTippy(reference2, passedProps) {
|
|
|
21783
24463
|
}
|
|
21784
24464
|
instance.clearDelayTimeouts();
|
|
21785
24465
|
instance.unmount();
|
|
21786
|
-
|
|
24466
|
+
removeListeners2();
|
|
21787
24467
|
delete reference2._tippy;
|
|
21788
24468
|
instance.state.isDestroyed = true;
|
|
21789
24469
|
invokeHook("onDestroy", [instance]);
|
|
@@ -22042,6 +24722,7 @@ function getCleekOptions(userOptions) {
|
|
|
22042
24722
|
}
|
|
22043
24723
|
const install = function installCleek(app, options) {
|
|
22044
24724
|
app.config.globalProperties.$cleekOptions = getCleekOptions(options);
|
|
24725
|
+
app.use(plugin);
|
|
22045
24726
|
Object.entries(components).forEach(([componentName, component]) => {
|
|
22046
24727
|
app.component(componentName, component);
|
|
22047
24728
|
});
|