@opentiny/vue-hooks 2.19.0 → 2.21.0
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/index.js +678 -689
- package/package.json +2 -2
package/index.js
CHANGED
|
@@ -2,15 +2,12 @@ import { hooks } from '@opentiny/vue-common';
|
|
|
2
2
|
|
|
3
3
|
var _excluded = ["mainAxis", "crossAxis", "fallbackPlacements", "fallbackStrategy", "fallbackAxisSideDirection", "flipAlignment"], _excluded2 = ["strategy"], _excluded3 = ["mainAxis", "crossAxis", "limiter"];
|
|
4
4
|
function _objectWithoutPropertiesLoose(r, e) {
|
|
5
|
-
if (null == r)
|
|
6
|
-
return {};
|
|
5
|
+
if (null == r) return {};
|
|
7
6
|
var t = {};
|
|
8
|
-
for (var n in r)
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
t[n] = r[n];
|
|
13
|
-
}
|
|
7
|
+
for (var n in r) if ({}.hasOwnProperty.call(r, n)) {
|
|
8
|
+
if (e.includes(n)) continue;
|
|
9
|
+
t[n] = r[n];
|
|
10
|
+
}
|
|
14
11
|
return t;
|
|
15
12
|
}
|
|
16
13
|
function _regeneratorRuntime() {
|
|
@@ -94,11 +91,9 @@ function _regeneratorRuntime() {
|
|
|
94
91
|
function makeInvokeMethod(e2, r2, n2) {
|
|
95
92
|
var o2 = h;
|
|
96
93
|
return function(i2, a2) {
|
|
97
|
-
if (o2 === f)
|
|
98
|
-
throw Error("Generator is already running");
|
|
94
|
+
if (o2 === f) throw Error("Generator is already running");
|
|
99
95
|
if (o2 === s) {
|
|
100
|
-
if ("throw" === i2)
|
|
101
|
-
throw a2;
|
|
96
|
+
if ("throw" === i2) throw a2;
|
|
102
97
|
return { value: t, done: true };
|
|
103
98
|
}
|
|
104
99
|
for (n2.method = i2, n2.arg = a2; ; ) {
|
|
@@ -106,24 +101,19 @@ function _regeneratorRuntime() {
|
|
|
106
101
|
if (c2) {
|
|
107
102
|
var u2 = maybeInvokeDelegate(c2, n2);
|
|
108
103
|
if (u2) {
|
|
109
|
-
if (u2 === y)
|
|
110
|
-
continue;
|
|
104
|
+
if (u2 === y) continue;
|
|
111
105
|
return u2;
|
|
112
106
|
}
|
|
113
107
|
}
|
|
114
|
-
if ("next" === n2.method)
|
|
115
|
-
n2.sent = n2._sent = n2.arg;
|
|
108
|
+
if ("next" === n2.method) n2.sent = n2._sent = n2.arg;
|
|
116
109
|
else if ("throw" === n2.method) {
|
|
117
|
-
if (o2 === h)
|
|
118
|
-
throw o2 = s, n2.arg;
|
|
110
|
+
if (o2 === h) throw o2 = s, n2.arg;
|
|
119
111
|
n2.dispatchException(n2.arg);
|
|
120
|
-
} else
|
|
121
|
-
"return" === n2.method && n2.abrupt("return", n2.arg);
|
|
112
|
+
} else "return" === n2.method && n2.abrupt("return", n2.arg);
|
|
122
113
|
o2 = f;
|
|
123
114
|
var p2 = tryCatch(e2, r2, n2);
|
|
124
115
|
if ("normal" === p2.type) {
|
|
125
|
-
if (o2 = n2.done ? s : l, p2.arg === y)
|
|
126
|
-
continue;
|
|
116
|
+
if (o2 = n2.done ? s : l, p2.arg === y) continue;
|
|
127
117
|
return { value: p2.arg, done: n2.done };
|
|
128
118
|
}
|
|
129
119
|
"throw" === p2.type && (o2 = s, n2.method = "throw", n2.arg = p2.arg);
|
|
@@ -132,11 +122,9 @@ function _regeneratorRuntime() {
|
|
|
132
122
|
}
|
|
133
123
|
function maybeInvokeDelegate(e2, r2) {
|
|
134
124
|
var n2 = r2.method, o2 = e2.iterator[n2];
|
|
135
|
-
if (o2 === t)
|
|
136
|
-
return r2.delegate = null, "throw" === n2 && e2.iterator.return && (r2.method = "return", r2.arg = t, maybeInvokeDelegate(e2, r2), "throw" === r2.method) || "return" !== n2 && (r2.method = "throw", r2.arg = new TypeError("The iterator does not provide a '" + n2 + "' method")), y;
|
|
125
|
+
if (o2 === t) return r2.delegate = null, "throw" === n2 && e2.iterator.return && (r2.method = "return", r2.arg = t, maybeInvokeDelegate(e2, r2), "throw" === r2.method) || "return" !== n2 && (r2.method = "throw", r2.arg = new TypeError("The iterator does not provide a '" + n2 + "' method")), y;
|
|
137
126
|
var i2 = tryCatch(o2, e2.iterator, r2.arg);
|
|
138
|
-
if ("throw" === i2.type)
|
|
139
|
-
return r2.method = "throw", r2.arg = i2.arg, r2.delegate = null, y;
|
|
127
|
+
if ("throw" === i2.type) return r2.method = "throw", r2.arg = i2.arg, r2.delegate = null, y;
|
|
140
128
|
var a2 = i2.arg;
|
|
141
129
|
return a2 ? a2.done ? (r2[e2.resultName] = a2.value, r2.next = e2.nextLoc, "return" !== r2.method && (r2.method = "next", r2.arg = t), r2.delegate = null, y) : a2 : (r2.method = "throw", r2.arg = new TypeError("iterator result is not an object"), r2.delegate = null, y);
|
|
142
130
|
}
|
|
@@ -154,15 +142,11 @@ function _regeneratorRuntime() {
|
|
|
154
142
|
function values(e2) {
|
|
155
143
|
if (e2 || "" === e2) {
|
|
156
144
|
var r2 = e2[a];
|
|
157
|
-
if (r2)
|
|
158
|
-
|
|
159
|
-
if ("function" == typeof e2.next)
|
|
160
|
-
return e2;
|
|
145
|
+
if (r2) return r2.call(e2);
|
|
146
|
+
if ("function" == typeof e2.next) return e2;
|
|
161
147
|
if (!isNaN(e2.length)) {
|
|
162
148
|
var o2 = -1, i2 = function next() {
|
|
163
|
-
for (; ++o2 < e2.length; )
|
|
164
|
-
if (n.call(e2, o2))
|
|
165
|
-
return next.value = e2[o2], next.done = false, next;
|
|
149
|
+
for (; ++o2 < e2.length; ) if (n.call(e2, o2)) return next.value = e2[o2], next.done = false, next;
|
|
166
150
|
return next.value = t, next.done = true, next;
|
|
167
151
|
};
|
|
168
152
|
return i2.next = i2;
|
|
@@ -191,52 +175,40 @@ function _regeneratorRuntime() {
|
|
|
191
175
|
return "[object Generator]";
|
|
192
176
|
}), e.keys = function(t2) {
|
|
193
177
|
var e2 = Object(t2), r2 = [];
|
|
194
|
-
for (var n2 in e2)
|
|
195
|
-
r2.push(n2);
|
|
178
|
+
for (var n2 in e2) r2.push(n2);
|
|
196
179
|
return r2.reverse(), function next() {
|
|
197
180
|
for (; r2.length; ) {
|
|
198
181
|
var t3 = r2.pop();
|
|
199
|
-
if (t3 in e2)
|
|
200
|
-
return next.value = t3, next.done = false, next;
|
|
182
|
+
if (t3 in e2) return next.value = t3, next.done = false, next;
|
|
201
183
|
}
|
|
202
184
|
return next.done = true, next;
|
|
203
185
|
};
|
|
204
186
|
}, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e2) {
|
|
205
|
-
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e2)
|
|
206
|
-
for (var r2 in this)
|
|
207
|
-
"t" === r2.charAt(0) && n.call(this, r2) && !isNaN(+r2.slice(1)) && (this[r2] = t);
|
|
187
|
+
if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = false, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e2) for (var r2 in this) "t" === r2.charAt(0) && n.call(this, r2) && !isNaN(+r2.slice(1)) && (this[r2] = t);
|
|
208
188
|
}, stop: function stop() {
|
|
209
189
|
this.done = true;
|
|
210
190
|
var t2 = this.tryEntries[0].completion;
|
|
211
|
-
if ("throw" === t2.type)
|
|
212
|
-
throw t2.arg;
|
|
191
|
+
if ("throw" === t2.type) throw t2.arg;
|
|
213
192
|
return this.rval;
|
|
214
193
|
}, dispatchException: function dispatchException(e2) {
|
|
215
|
-
if (this.done)
|
|
216
|
-
throw e2;
|
|
194
|
+
if (this.done) throw e2;
|
|
217
195
|
var r2 = this;
|
|
218
196
|
function handle(n2, o3) {
|
|
219
197
|
return a2.type = "throw", a2.arg = e2, r2.next = n2, o3 && (r2.method = "next", r2.arg = t), !!o3;
|
|
220
198
|
}
|
|
221
199
|
for (var o2 = this.tryEntries.length - 1; o2 >= 0; --o2) {
|
|
222
200
|
var i2 = this.tryEntries[o2], a2 = i2.completion;
|
|
223
|
-
if ("root" === i2.tryLoc)
|
|
224
|
-
return handle("end");
|
|
201
|
+
if ("root" === i2.tryLoc) return handle("end");
|
|
225
202
|
if (i2.tryLoc <= this.prev) {
|
|
226
203
|
var c2 = n.call(i2, "catchLoc"), u2 = n.call(i2, "finallyLoc");
|
|
227
204
|
if (c2 && u2) {
|
|
228
|
-
if (this.prev < i2.catchLoc)
|
|
229
|
-
|
|
230
|
-
if (this.prev < i2.finallyLoc)
|
|
231
|
-
return handle(i2.finallyLoc);
|
|
205
|
+
if (this.prev < i2.catchLoc) return handle(i2.catchLoc, true);
|
|
206
|
+
if (this.prev < i2.finallyLoc) return handle(i2.finallyLoc);
|
|
232
207
|
} else if (c2) {
|
|
233
|
-
if (this.prev < i2.catchLoc)
|
|
234
|
-
return handle(i2.catchLoc, true);
|
|
208
|
+
if (this.prev < i2.catchLoc) return handle(i2.catchLoc, true);
|
|
235
209
|
} else {
|
|
236
|
-
if (!u2)
|
|
237
|
-
|
|
238
|
-
if (this.prev < i2.finallyLoc)
|
|
239
|
-
return handle(i2.finallyLoc);
|
|
210
|
+
if (!u2) throw Error("try statement without catch or finally");
|
|
211
|
+
if (this.prev < i2.finallyLoc) return handle(i2.finallyLoc);
|
|
240
212
|
}
|
|
241
213
|
}
|
|
242
214
|
}
|
|
@@ -252,14 +224,12 @@ function _regeneratorRuntime() {
|
|
|
252
224
|
var a2 = i2 ? i2.completion : {};
|
|
253
225
|
return a2.type = t2, a2.arg = e2, i2 ? (this.method = "next", this.next = i2.finallyLoc, y) : this.complete(a2);
|
|
254
226
|
}, complete: function complete(t2, e2) {
|
|
255
|
-
if ("throw" === t2.type)
|
|
256
|
-
throw t2.arg;
|
|
227
|
+
if ("throw" === t2.type) throw t2.arg;
|
|
257
228
|
return "break" === t2.type || "continue" === t2.type ? this.next = t2.arg : "return" === t2.type ? (this.rval = this.arg = t2.arg, this.method = "return", this.next = "end") : "normal" === t2.type && e2 && (this.next = e2), y;
|
|
258
229
|
}, finish: function finish(t2) {
|
|
259
230
|
for (var e2 = this.tryEntries.length - 1; e2 >= 0; --e2) {
|
|
260
231
|
var r2 = this.tryEntries[e2];
|
|
261
|
-
if (r2.finallyLoc === t2)
|
|
262
|
-
return this.complete(r2.completion, r2.afterLoc), resetTryEntry(r2), y;
|
|
232
|
+
if (r2.finallyLoc === t2) return this.complete(r2.completion, r2.afterLoc), resetTryEntry(r2), y;
|
|
263
233
|
}
|
|
264
234
|
}, catch: function _catch(t2) {
|
|
265
235
|
for (var e2 = this.tryEntries.length - 1; e2 >= 0; --e2) {
|
|
@@ -305,8 +275,7 @@ function _extends() {
|
|
|
305
275
|
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
306
276
|
for (var e = 1; e < arguments.length; e++) {
|
|
307
277
|
var t = arguments[e];
|
|
308
|
-
for (var r in t)
|
|
309
|
-
({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
278
|
+
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
310
279
|
}
|
|
311
280
|
return n;
|
|
312
281
|
}, _extends.apply(null, arguments);
|
|
@@ -386,8 +355,7 @@ function getSideList(side, isStart, rtl) {
|
|
|
386
355
|
switch (side) {
|
|
387
356
|
case "top":
|
|
388
357
|
case "bottom":
|
|
389
|
-
if (rtl)
|
|
390
|
-
return isStart ? rl : lr;
|
|
358
|
+
if (rtl) return isStart ? rl : lr;
|
|
391
359
|
return isStart ? lr : rl;
|
|
392
360
|
case "left":
|
|
393
361
|
case "right":
|
|
@@ -497,116 +465,115 @@ function computeCoordsFromPlacement(_ref, placement, rtl) {
|
|
|
497
465
|
}
|
|
498
466
|
var computePosition$1 = /* @__PURE__ */ function() {
|
|
499
467
|
var _ref2 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee(reference, floating, config) {
|
|
500
|
-
var _config$placement, placement, _config$strategy, strategy, _config$middleware, middleware, platform2, validMiddleware, rtl, rects, _computeCoordsFromPla, x, y, statefulPlacement, middlewareData, resetCount, i, _extends2, _validMiddleware$
|
|
468
|
+
var _config$placement, placement, _config$strategy, strategy, _config$middleware, middleware, platform2, validMiddleware, rtl, rects, _computeCoordsFromPla, x, y, statefulPlacement, middlewareData, resetCount, i, _extends2, _validMiddleware$i, name, fn, _yield$fn, nextX, nextY, data, reset, _computeCoordsFromPla2;
|
|
501
469
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
502
|
-
while (1)
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
470
|
+
while (1) switch (_context.prev = _context.next) {
|
|
471
|
+
case 0:
|
|
472
|
+
_config$placement = config.placement, placement = _config$placement === void 0 ? "bottom" : _config$placement, _config$strategy = config.strategy, strategy = _config$strategy === void 0 ? "absolute" : _config$strategy, _config$middleware = config.middleware, middleware = _config$middleware === void 0 ? [] : _config$middleware, platform2 = config.platform;
|
|
473
|
+
validMiddleware = middleware.filter(Boolean);
|
|
474
|
+
_context.next = 4;
|
|
475
|
+
return platform2.isRTL == null ? void 0 : platform2.isRTL(floating);
|
|
476
|
+
case 4:
|
|
477
|
+
rtl = _context.sent;
|
|
478
|
+
_context.next = 7;
|
|
479
|
+
return platform2.getElementRects({
|
|
480
|
+
reference,
|
|
481
|
+
floating,
|
|
482
|
+
strategy
|
|
483
|
+
});
|
|
484
|
+
case 7:
|
|
485
|
+
rects = _context.sent;
|
|
486
|
+
_computeCoordsFromPla = computeCoordsFromPlacement(rects, placement, rtl), x = _computeCoordsFromPla.x, y = _computeCoordsFromPla.y;
|
|
487
|
+
statefulPlacement = placement;
|
|
488
|
+
middlewareData = {};
|
|
489
|
+
resetCount = 0;
|
|
490
|
+
i = 0;
|
|
491
|
+
case 13:
|
|
492
|
+
if (!(i < validMiddleware.length)) {
|
|
493
|
+
_context.next = 45;
|
|
494
|
+
break;
|
|
495
|
+
}
|
|
496
|
+
_validMiddleware$i = validMiddleware[i], name = _validMiddleware$i.name, fn = _validMiddleware$i.fn;
|
|
497
|
+
_context.next = 17;
|
|
498
|
+
return fn({
|
|
499
|
+
x,
|
|
500
|
+
y,
|
|
501
|
+
initialPlacement: placement,
|
|
502
|
+
placement: statefulPlacement,
|
|
503
|
+
strategy,
|
|
504
|
+
middlewareData,
|
|
505
|
+
rects,
|
|
506
|
+
platform: platform2,
|
|
507
|
+
elements: {
|
|
513
508
|
reference,
|
|
514
|
-
floating
|
|
515
|
-
strategy
|
|
516
|
-
});
|
|
517
|
-
case 7:
|
|
518
|
-
rects = _context.sent;
|
|
519
|
-
_computeCoordsFromPla = computeCoordsFromPlacement(rects, placement, rtl), x = _computeCoordsFromPla.x, y = _computeCoordsFromPla.y;
|
|
520
|
-
statefulPlacement = placement;
|
|
521
|
-
middlewareData = {};
|
|
522
|
-
resetCount = 0;
|
|
523
|
-
i = 0;
|
|
524
|
-
case 13:
|
|
525
|
-
if (!(i < validMiddleware.length)) {
|
|
526
|
-
_context.next = 45;
|
|
527
|
-
break;
|
|
528
|
-
}
|
|
529
|
-
_validMiddleware$i2 = validMiddleware[i], name = _validMiddleware$i2.name, fn = _validMiddleware$i2.fn;
|
|
530
|
-
_context.next = 17;
|
|
531
|
-
return fn({
|
|
532
|
-
x,
|
|
533
|
-
y,
|
|
534
|
-
initialPlacement: placement,
|
|
535
|
-
placement: statefulPlacement,
|
|
536
|
-
strategy,
|
|
537
|
-
middlewareData,
|
|
538
|
-
rects,
|
|
539
|
-
platform: platform2,
|
|
540
|
-
elements: {
|
|
541
|
-
reference,
|
|
542
|
-
floating
|
|
543
|
-
}
|
|
544
|
-
});
|
|
545
|
-
case 17:
|
|
546
|
-
_yield$fn2 = _context.sent;
|
|
547
|
-
nextX = _yield$fn2.x;
|
|
548
|
-
nextY = _yield$fn2.y;
|
|
549
|
-
data = _yield$fn2.data;
|
|
550
|
-
reset = _yield$fn2.reset;
|
|
551
|
-
x = nextX != null ? nextX : x;
|
|
552
|
-
y = nextY != null ? nextY : y;
|
|
553
|
-
middlewareData = _extends({}, middlewareData, (_extends2 = {}, _extends2[name] = _extends({}, middlewareData[name], data), _extends2));
|
|
554
|
-
if (!(reset && resetCount <= 50)) {
|
|
555
|
-
_context.next = 42;
|
|
556
|
-
break;
|
|
557
|
-
}
|
|
558
|
-
resetCount++;
|
|
559
|
-
if (!(typeof reset === "object")) {
|
|
560
|
-
_context.next = 41;
|
|
561
|
-
break;
|
|
562
|
-
}
|
|
563
|
-
if (reset.placement) {
|
|
564
|
-
statefulPlacement = reset.placement;
|
|
565
|
-
}
|
|
566
|
-
if (!reset.rects) {
|
|
567
|
-
_context.next = 38;
|
|
568
|
-
break;
|
|
569
|
-
}
|
|
570
|
-
if (!(reset.rects === true)) {
|
|
571
|
-
_context.next = 36;
|
|
572
|
-
break;
|
|
509
|
+
floating
|
|
573
510
|
}
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
511
|
+
});
|
|
512
|
+
case 17:
|
|
513
|
+
_yield$fn = _context.sent;
|
|
514
|
+
nextX = _yield$fn.x;
|
|
515
|
+
nextY = _yield$fn.y;
|
|
516
|
+
data = _yield$fn.data;
|
|
517
|
+
reset = _yield$fn.reset;
|
|
518
|
+
x = nextX != null ? nextX : x;
|
|
519
|
+
y = nextY != null ? nextY : y;
|
|
520
|
+
middlewareData = _extends({}, middlewareData, (_extends2 = {}, _extends2[name] = _extends({}, middlewareData[name], data), _extends2));
|
|
521
|
+
if (!(reset && resetCount <= 50)) {
|
|
522
|
+
_context.next = 42;
|
|
583
523
|
break;
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
case 38:
|
|
589
|
-
_computeCoordsFromPla2 = computeCoordsFromPlacement(rects, statefulPlacement, rtl);
|
|
590
|
-
x = _computeCoordsFromPla2.x;
|
|
591
|
-
y = _computeCoordsFromPla2.y;
|
|
592
|
-
case 41:
|
|
593
|
-
i = -1;
|
|
594
|
-
case 42:
|
|
595
|
-
i++;
|
|
596
|
-
_context.next = 13;
|
|
524
|
+
}
|
|
525
|
+
resetCount++;
|
|
526
|
+
if (!(typeof reset === "object")) {
|
|
527
|
+
_context.next = 41;
|
|
597
528
|
break;
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
529
|
+
}
|
|
530
|
+
if (reset.placement) {
|
|
531
|
+
statefulPlacement = reset.placement;
|
|
532
|
+
}
|
|
533
|
+
if (!reset.rects) {
|
|
534
|
+
_context.next = 38;
|
|
535
|
+
break;
|
|
536
|
+
}
|
|
537
|
+
if (!(reset.rects === true)) {
|
|
538
|
+
_context.next = 36;
|
|
539
|
+
break;
|
|
540
|
+
}
|
|
541
|
+
_context.next = 33;
|
|
542
|
+
return platform2.getElementRects({
|
|
543
|
+
reference,
|
|
544
|
+
floating,
|
|
545
|
+
strategy
|
|
546
|
+
});
|
|
547
|
+
case 33:
|
|
548
|
+
_context.t0 = _context.sent;
|
|
549
|
+
_context.next = 37;
|
|
550
|
+
break;
|
|
551
|
+
case 36:
|
|
552
|
+
_context.t0 = reset.rects;
|
|
553
|
+
case 37:
|
|
554
|
+
rects = _context.t0;
|
|
555
|
+
case 38:
|
|
556
|
+
_computeCoordsFromPla2 = computeCoordsFromPlacement(rects, statefulPlacement, rtl);
|
|
557
|
+
x = _computeCoordsFromPla2.x;
|
|
558
|
+
y = _computeCoordsFromPla2.y;
|
|
559
|
+
case 41:
|
|
560
|
+
i = -1;
|
|
561
|
+
case 42:
|
|
562
|
+
i++;
|
|
563
|
+
_context.next = 13;
|
|
564
|
+
break;
|
|
565
|
+
case 45:
|
|
566
|
+
return _context.abrupt("return", {
|
|
567
|
+
x,
|
|
568
|
+
y,
|
|
569
|
+
placement: statefulPlacement,
|
|
570
|
+
strategy,
|
|
571
|
+
middlewareData
|
|
572
|
+
});
|
|
573
|
+
case 46:
|
|
574
|
+
case "end":
|
|
575
|
+
return _context.stop();
|
|
576
|
+
}
|
|
610
577
|
}, _callee);
|
|
611
578
|
}));
|
|
612
579
|
return function computePosition$12(_x, _x2, _x3) {
|
|
@@ -620,139 +587,138 @@ function _detectOverflow() {
|
|
|
620
587
|
_detectOverflow = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee8(state, options) {
|
|
621
588
|
var _await$platform$isEle, x, y, platform2, rects, elements, strategy, _evaluate5, _evaluate5$boundary, boundary, _evaluate5$rootBounda, rootBoundary, _evaluate5$elementCon, elementContext, _evaluate5$altBoundar, altBoundary, _evaluate5$padding, padding, paddingObject, altContext, element, clippingClientRect, rect, offsetParent, offsetScale, elementClientRect;
|
|
622
589
|
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
|
623
|
-
while (1)
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
_context8.next = 15;
|
|
642
|
-
break;
|
|
643
|
-
}
|
|
644
|
-
_context8.t3 = _await$platform$isEle;
|
|
645
|
-
_context8.next = 16;
|
|
590
|
+
while (1) switch (_context8.prev = _context8.next) {
|
|
591
|
+
case 0:
|
|
592
|
+
if (options === void 0) {
|
|
593
|
+
options = {};
|
|
594
|
+
}
|
|
595
|
+
x = state.x, y = state.y, platform2 = state.platform, rects = state.rects, elements = state.elements, strategy = state.strategy;
|
|
596
|
+
_evaluate5 = evaluate(options, state), _evaluate5$boundary = _evaluate5.boundary, boundary = _evaluate5$boundary === void 0 ? "clippingAncestors" : _evaluate5$boundary, _evaluate5$rootBounda = _evaluate5.rootBoundary, rootBoundary = _evaluate5$rootBounda === void 0 ? "viewport" : _evaluate5$rootBounda, _evaluate5$elementCon = _evaluate5.elementContext, elementContext = _evaluate5$elementCon === void 0 ? "floating" : _evaluate5$elementCon, _evaluate5$altBoundar = _evaluate5.altBoundary, altBoundary = _evaluate5$altBoundar === void 0 ? false : _evaluate5$altBoundar, _evaluate5$padding = _evaluate5.padding, padding = _evaluate5$padding === void 0 ? 0 : _evaluate5$padding;
|
|
597
|
+
paddingObject = getPaddingObject(padding);
|
|
598
|
+
altContext = elementContext === "floating" ? "reference" : "floating";
|
|
599
|
+
element = elements[altBoundary ? altContext : elementContext];
|
|
600
|
+
_context8.t0 = rectToClientRect;
|
|
601
|
+
_context8.t1 = platform2;
|
|
602
|
+
_context8.next = 10;
|
|
603
|
+
return platform2.isElement == null ? void 0 : platform2.isElement(element);
|
|
604
|
+
case 10:
|
|
605
|
+
_context8.t2 = _await$platform$isEle = _context8.sent;
|
|
606
|
+
if (!(_context8.t2 != null)) {
|
|
607
|
+
_context8.next = 15;
|
|
646
608
|
break;
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
_context8.next =
|
|
609
|
+
}
|
|
610
|
+
_context8.t3 = _await$platform$isEle;
|
|
611
|
+
_context8.next = 16;
|
|
612
|
+
break;
|
|
613
|
+
case 15:
|
|
614
|
+
_context8.t3 = true;
|
|
615
|
+
case 16:
|
|
616
|
+
if (!_context8.t3) {
|
|
617
|
+
_context8.next = 20;
|
|
656
618
|
break;
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
case 24:
|
|
666
|
-
_context8.t5 = _context8.sent;
|
|
667
|
-
case 25:
|
|
668
|
-
_context8.t4 = _context8.t5;
|
|
669
|
-
case 26:
|
|
670
|
-
_context8.t6 = _context8.t4;
|
|
671
|
-
_context8.t7 = boundary;
|
|
672
|
-
_context8.t8 = rootBoundary;
|
|
673
|
-
_context8.t9 = strategy;
|
|
674
|
-
_context8.t10 = {
|
|
675
|
-
element: _context8.t6,
|
|
676
|
-
boundary: _context8.t7,
|
|
677
|
-
rootBoundary: _context8.t8,
|
|
678
|
-
strategy: _context8.t9
|
|
679
|
-
};
|
|
680
|
-
_context8.next = 33;
|
|
681
|
-
return _context8.t1.getClippingRect.call(_context8.t1, _context8.t10);
|
|
682
|
-
case 33:
|
|
683
|
-
_context8.t11 = _context8.sent;
|
|
684
|
-
clippingClientRect = (0, _context8.t0)(_context8.t11);
|
|
685
|
-
rect = elementContext === "floating" ? {
|
|
686
|
-
x,
|
|
687
|
-
y,
|
|
688
|
-
width: rects.floating.width,
|
|
689
|
-
height: rects.floating.height
|
|
690
|
-
} : rects.reference;
|
|
691
|
-
_context8.next = 38;
|
|
692
|
-
return platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating);
|
|
693
|
-
case 38:
|
|
694
|
-
offsetParent = _context8.sent;
|
|
695
|
-
_context8.next = 41;
|
|
696
|
-
return platform2.isElement == null ? void 0 : platform2.isElement(offsetParent);
|
|
697
|
-
case 41:
|
|
698
|
-
if (!_context8.sent) {
|
|
699
|
-
_context8.next = 50;
|
|
700
|
-
break;
|
|
701
|
-
}
|
|
702
|
-
_context8.next = 44;
|
|
703
|
-
return platform2.getScale == null ? void 0 : platform2.getScale(offsetParent);
|
|
704
|
-
case 44:
|
|
705
|
-
_context8.t13 = _context8.sent;
|
|
706
|
-
if (_context8.t13) {
|
|
707
|
-
_context8.next = 47;
|
|
708
|
-
break;
|
|
709
|
-
}
|
|
710
|
-
_context8.t13 = {
|
|
711
|
-
x: 1,
|
|
712
|
-
y: 1
|
|
713
|
-
};
|
|
714
|
-
case 47:
|
|
715
|
-
_context8.t12 = _context8.t13;
|
|
716
|
-
_context8.next = 51;
|
|
619
|
+
}
|
|
620
|
+
_context8.t4 = element;
|
|
621
|
+
_context8.next = 26;
|
|
622
|
+
break;
|
|
623
|
+
case 20:
|
|
624
|
+
_context8.t5 = element.contextElement;
|
|
625
|
+
if (_context8.t5) {
|
|
626
|
+
_context8.next = 25;
|
|
717
627
|
break;
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
628
|
+
}
|
|
629
|
+
_context8.next = 24;
|
|
630
|
+
return platform2.getDocumentElement == null ? void 0 : platform2.getDocumentElement(elements.floating);
|
|
631
|
+
case 24:
|
|
632
|
+
_context8.t5 = _context8.sent;
|
|
633
|
+
case 25:
|
|
634
|
+
_context8.t4 = _context8.t5;
|
|
635
|
+
case 26:
|
|
636
|
+
_context8.t6 = _context8.t4;
|
|
637
|
+
_context8.t7 = boundary;
|
|
638
|
+
_context8.t8 = rootBoundary;
|
|
639
|
+
_context8.t9 = strategy;
|
|
640
|
+
_context8.t10 = {
|
|
641
|
+
element: _context8.t6,
|
|
642
|
+
boundary: _context8.t7,
|
|
643
|
+
rootBoundary: _context8.t8,
|
|
644
|
+
strategy: _context8.t9
|
|
645
|
+
};
|
|
646
|
+
_context8.next = 33;
|
|
647
|
+
return _context8.t1.getClippingRect.call(_context8.t1, _context8.t10);
|
|
648
|
+
case 33:
|
|
649
|
+
_context8.t11 = _context8.sent;
|
|
650
|
+
clippingClientRect = (0, _context8.t0)(_context8.t11);
|
|
651
|
+
rect = elementContext === "floating" ? {
|
|
652
|
+
x,
|
|
653
|
+
y,
|
|
654
|
+
width: rects.floating.width,
|
|
655
|
+
height: rects.floating.height
|
|
656
|
+
} : rects.reference;
|
|
657
|
+
_context8.next = 38;
|
|
658
|
+
return platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(elements.floating);
|
|
659
|
+
case 38:
|
|
660
|
+
offsetParent = _context8.sent;
|
|
661
|
+
_context8.next = 41;
|
|
662
|
+
return platform2.isElement == null ? void 0 : platform2.isElement(offsetParent);
|
|
663
|
+
case 41:
|
|
664
|
+
if (!_context8.sent) {
|
|
665
|
+
_context8.next = 50;
|
|
740
666
|
break;
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
667
|
+
}
|
|
668
|
+
_context8.next = 44;
|
|
669
|
+
return platform2.getScale == null ? void 0 : platform2.getScale(offsetParent);
|
|
670
|
+
case 44:
|
|
671
|
+
_context8.t13 = _context8.sent;
|
|
672
|
+
if (_context8.t13) {
|
|
673
|
+
_context8.next = 47;
|
|
674
|
+
break;
|
|
675
|
+
}
|
|
676
|
+
_context8.t13 = {
|
|
677
|
+
x: 1,
|
|
678
|
+
y: 1
|
|
679
|
+
};
|
|
680
|
+
case 47:
|
|
681
|
+
_context8.t12 = _context8.t13;
|
|
682
|
+
_context8.next = 51;
|
|
683
|
+
break;
|
|
684
|
+
case 50:
|
|
685
|
+
_context8.t12 = {
|
|
686
|
+
x: 1,
|
|
687
|
+
y: 1
|
|
688
|
+
};
|
|
689
|
+
case 51:
|
|
690
|
+
offsetScale = _context8.t12;
|
|
691
|
+
_context8.t14 = rectToClientRect;
|
|
692
|
+
if (!platform2.convertOffsetParentRelativeRectToViewportRelativeRect) {
|
|
693
|
+
_context8.next = 59;
|
|
694
|
+
break;
|
|
695
|
+
}
|
|
696
|
+
_context8.next = 56;
|
|
697
|
+
return platform2.convertOffsetParentRelativeRectToViewportRelativeRect({
|
|
698
|
+
elements,
|
|
699
|
+
rect,
|
|
700
|
+
offsetParent,
|
|
701
|
+
strategy
|
|
702
|
+
});
|
|
703
|
+
case 56:
|
|
704
|
+
_context8.t15 = _context8.sent;
|
|
705
|
+
_context8.next = 60;
|
|
706
|
+
break;
|
|
707
|
+
case 59:
|
|
708
|
+
_context8.t15 = rect;
|
|
709
|
+
case 60:
|
|
710
|
+
_context8.t16 = _context8.t15;
|
|
711
|
+
elementClientRect = (0, _context8.t14)(_context8.t16);
|
|
712
|
+
return _context8.abrupt("return", {
|
|
713
|
+
top: (clippingClientRect.top - elementClientRect.top + paddingObject.top) / offsetScale.y,
|
|
714
|
+
bottom: (elementClientRect.bottom - clippingClientRect.bottom + paddingObject.bottom) / offsetScale.y,
|
|
715
|
+
left: (clippingClientRect.left - elementClientRect.left + paddingObject.left) / offsetScale.x,
|
|
716
|
+
right: (elementClientRect.right - clippingClientRect.right + paddingObject.right) / offsetScale.x
|
|
717
|
+
});
|
|
718
|
+
case 63:
|
|
719
|
+
case "end":
|
|
720
|
+
return _context8.stop();
|
|
721
|
+
}
|
|
756
722
|
}, _callee8);
|
|
757
723
|
}));
|
|
758
724
|
return _detectOverflow.apply(this, arguments);
|
|
@@ -766,72 +732,71 @@ var arrow$1 = function arrow$12(options) {
|
|
|
766
732
|
var _extends3, _ref4;
|
|
767
733
|
var x, y, placement, rects, platform2, elements, middlewareData, _ref3, element, _ref3$padding, padding, paddingObject, coords, axis, length, arrowDimensions, isYAxis, minProp, maxProp, clientProp, endDiff, startDiff, arrowOffsetParent, clientSize, centerToReference, largestPossiblePadding, minPadding, maxPadding, min$1, max2, center, offset2, shouldAddOffset, alignmentOffset;
|
|
768
734
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
769
|
-
while (1)
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
}
|
|
735
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
736
|
+
case 0:
|
|
737
|
+
x = state.x, y = state.y, placement = state.placement, rects = state.rects, platform2 = state.platform, elements = state.elements, middlewareData = state.middlewareData;
|
|
738
|
+
_ref3 = evaluate(options, state) || {}, element = _ref3.element, _ref3$padding = _ref3.padding, padding = _ref3$padding === void 0 ? 0 : _ref3$padding;
|
|
739
|
+
if (!(element == null)) {
|
|
740
|
+
_context2.next = 4;
|
|
741
|
+
break;
|
|
742
|
+
}
|
|
743
|
+
return _context2.abrupt("return", {});
|
|
744
|
+
case 4:
|
|
745
|
+
paddingObject = getPaddingObject(padding);
|
|
746
|
+
coords = {
|
|
747
|
+
x,
|
|
748
|
+
y
|
|
749
|
+
};
|
|
750
|
+
axis = getAlignmentAxis(placement);
|
|
751
|
+
length = getAxisLength(axis);
|
|
752
|
+
_context2.next = 10;
|
|
753
|
+
return platform2.getDimensions(element);
|
|
754
|
+
case 10:
|
|
755
|
+
arrowDimensions = _context2.sent;
|
|
756
|
+
isYAxis = axis === "y";
|
|
757
|
+
minProp = isYAxis ? "top" : "left";
|
|
758
|
+
maxProp = isYAxis ? "bottom" : "right";
|
|
759
|
+
clientProp = isYAxis ? "clientHeight" : "clientWidth";
|
|
760
|
+
endDiff = rects.reference[length] + rects.reference[axis] - coords[axis] - rects.floating[length];
|
|
761
|
+
startDiff = coords[axis] - rects.reference[axis];
|
|
762
|
+
_context2.next = 19;
|
|
763
|
+
return platform2.getOffsetParent == null ? void 0 : platform2.getOffsetParent(element);
|
|
764
|
+
case 19:
|
|
765
|
+
arrowOffsetParent = _context2.sent;
|
|
766
|
+
clientSize = arrowOffsetParent ? arrowOffsetParent[clientProp] : 0;
|
|
767
|
+
_context2.t0 = !clientSize;
|
|
768
|
+
if (_context2.t0) {
|
|
769
|
+
_context2.next = 26;
|
|
770
|
+
break;
|
|
771
|
+
}
|
|
772
|
+
_context2.next = 25;
|
|
773
|
+
return platform2.isElement == null ? void 0 : platform2.isElement(arrowOffsetParent);
|
|
774
|
+
case 25:
|
|
775
|
+
_context2.t0 = !_context2.sent;
|
|
776
|
+
case 26:
|
|
777
|
+
if (!_context2.t0) {
|
|
778
|
+
_context2.next = 28;
|
|
779
|
+
break;
|
|
780
|
+
}
|
|
781
|
+
clientSize = elements.floating[clientProp] || rects.floating[length];
|
|
782
|
+
case 28:
|
|
783
|
+
centerToReference = endDiff / 2 - startDiff / 2;
|
|
784
|
+
largestPossiblePadding = clientSize / 2 - arrowDimensions[length] / 2 - 1;
|
|
785
|
+
minPadding = min(paddingObject[minProp], largestPossiblePadding);
|
|
786
|
+
maxPadding = min(paddingObject[maxProp], largestPossiblePadding);
|
|
787
|
+
min$1 = minPadding;
|
|
788
|
+
max2 = clientSize - arrowDimensions[length] - maxPadding;
|
|
789
|
+
center = clientSize / 2 - arrowDimensions[length] / 2 + centerToReference;
|
|
790
|
+
offset2 = clamp(min$1, center, max2);
|
|
791
|
+
shouldAddOffset = !middlewareData.arrow && getAlignment(placement) != null && center !== offset2 && rects.reference[length] / 2 - (center < min$1 ? minPadding : maxPadding) - arrowDimensions[length] / 2 < 0;
|
|
792
|
+
alignmentOffset = shouldAddOffset ? center < min$1 ? center - min$1 : center - max2 : 0;
|
|
793
|
+
return _context2.abrupt("return", (_ref4 = {}, _ref4[axis] = coords[axis] + alignmentOffset, _ref4.data = _extends((_extends3 = {}, _extends3[axis] = offset2, _extends3.centerOffset = center - offset2 - alignmentOffset, _extends3), shouldAddOffset && {
|
|
794
|
+
alignmentOffset
|
|
795
|
+
}), _ref4.reset = shouldAddOffset, _ref4));
|
|
796
|
+
case 39:
|
|
797
|
+
case "end":
|
|
798
|
+
return _context2.stop();
|
|
799
|
+
}
|
|
835
800
|
}, _callee2);
|
|
836
801
|
}))();
|
|
837
802
|
}
|
|
@@ -848,122 +813,121 @@ var flip$1 = function flip$12(options) {
|
|
|
848
813
|
return _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee3() {
|
|
849
814
|
var _middlewareData$arrow, _middlewareData$flip, placement, middlewareData, rects, initialPlacement, platform2, elements, _evaluate, _evaluate$mainAxis, checkMainAxis, _evaluate$crossAxis, checkCrossAxis, specifiedFallbackPlacements, _evaluate$fallbackStr, fallbackStrategy, _evaluate$fallbackAxi, fallbackAxisSideDirection, _evaluate$flipAlignme, flipAlignment, detectOverflowOptions, side, initialSideAxis, isBasePlacement, rtl, fallbackPlacements, hasFallbackAxisSideDirection, placements, overflow, overflows, overflowsData, _sides, _middlewareData$flip2, _overflowsData$filter, nextIndex, nextPlacement, resetPlacement, _overflowsData$filter2, _placement;
|
|
850
815
|
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
851
|
-
while (1)
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
placement: nextPlacement
|
|
911
|
-
}
|
|
912
|
-
});
|
|
913
|
-
case 27:
|
|
914
|
-
resetPlacement = (_overflowsData$filter = overflowsData.filter(function(d) {
|
|
915
|
-
return d.overflows[0] <= 0;
|
|
916
|
-
}).sort(function(a, b) {
|
|
917
|
-
return a.overflows[1] - b.overflows[1];
|
|
918
|
-
})[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
919
|
-
if (resetPlacement) {
|
|
920
|
-
_context3.next = 37;
|
|
921
|
-
break;
|
|
816
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
817
|
+
case 0:
|
|
818
|
+
placement = state.placement, middlewareData = state.middlewareData, rects = state.rects, initialPlacement = state.initialPlacement, platform2 = state.platform, elements = state.elements;
|
|
819
|
+
_evaluate = evaluate(options, state), _evaluate$mainAxis = _evaluate.mainAxis, checkMainAxis = _evaluate$mainAxis === void 0 ? true : _evaluate$mainAxis, _evaluate$crossAxis = _evaluate.crossAxis, checkCrossAxis = _evaluate$crossAxis === void 0 ? true : _evaluate$crossAxis, specifiedFallbackPlacements = _evaluate.fallbackPlacements, _evaluate$fallbackStr = _evaluate.fallbackStrategy, fallbackStrategy = _evaluate$fallbackStr === void 0 ? "bestFit" : _evaluate$fallbackStr, _evaluate$fallbackAxi = _evaluate.fallbackAxisSideDirection, fallbackAxisSideDirection = _evaluate$fallbackAxi === void 0 ? "none" : _evaluate$fallbackAxi, _evaluate$flipAlignme = _evaluate.flipAlignment, flipAlignment = _evaluate$flipAlignme === void 0 ? true : _evaluate$flipAlignme, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate, _excluded);
|
|
820
|
+
if (!((_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)) {
|
|
821
|
+
_context3.next = 4;
|
|
822
|
+
break;
|
|
823
|
+
}
|
|
824
|
+
return _context3.abrupt("return", {});
|
|
825
|
+
case 4:
|
|
826
|
+
side = getSide(placement);
|
|
827
|
+
initialSideAxis = getSideAxis(initialPlacement);
|
|
828
|
+
isBasePlacement = getSide(initialPlacement) === initialPlacement;
|
|
829
|
+
_context3.next = 9;
|
|
830
|
+
return platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating);
|
|
831
|
+
case 9:
|
|
832
|
+
rtl = _context3.sent;
|
|
833
|
+
fallbackPlacements = specifiedFallbackPlacements || (isBasePlacement || !flipAlignment ? [getOppositePlacement(initialPlacement)] : getExpandedPlacements(initialPlacement));
|
|
834
|
+
hasFallbackAxisSideDirection = fallbackAxisSideDirection !== "none";
|
|
835
|
+
if (!specifiedFallbackPlacements && hasFallbackAxisSideDirection) {
|
|
836
|
+
fallbackPlacements.push.apply(fallbackPlacements, getOppositeAxisPlacements(initialPlacement, flipAlignment, fallbackAxisSideDirection, rtl));
|
|
837
|
+
}
|
|
838
|
+
placements = [initialPlacement].concat(fallbackPlacements);
|
|
839
|
+
_context3.next = 16;
|
|
840
|
+
return detectOverflow(state, detectOverflowOptions);
|
|
841
|
+
case 16:
|
|
842
|
+
overflow = _context3.sent;
|
|
843
|
+
overflows = [];
|
|
844
|
+
overflowsData = ((_middlewareData$flip = middlewareData.flip) == null ? void 0 : _middlewareData$flip.overflows) || [];
|
|
845
|
+
if (checkMainAxis) {
|
|
846
|
+
overflows.push(overflow[side]);
|
|
847
|
+
}
|
|
848
|
+
if (checkCrossAxis) {
|
|
849
|
+
_sides = getAlignmentSides(placement, rects, rtl);
|
|
850
|
+
overflows.push(overflow[_sides[0]], overflow[_sides[1]]);
|
|
851
|
+
}
|
|
852
|
+
overflowsData = [].concat(overflowsData, [{
|
|
853
|
+
placement,
|
|
854
|
+
overflows
|
|
855
|
+
}]);
|
|
856
|
+
if (overflows.every(function(side2) {
|
|
857
|
+
return side2 <= 0;
|
|
858
|
+
})) {
|
|
859
|
+
_context3.next = 39;
|
|
860
|
+
break;
|
|
861
|
+
}
|
|
862
|
+
nextIndex = (((_middlewareData$flip2 = middlewareData.flip) == null ? void 0 : _middlewareData$flip2.index) || 0) + 1;
|
|
863
|
+
nextPlacement = placements[nextIndex];
|
|
864
|
+
if (!nextPlacement) {
|
|
865
|
+
_context3.next = 27;
|
|
866
|
+
break;
|
|
867
|
+
}
|
|
868
|
+
return _context3.abrupt("return", {
|
|
869
|
+
data: {
|
|
870
|
+
index: nextIndex,
|
|
871
|
+
overflows: overflowsData
|
|
872
|
+
},
|
|
873
|
+
reset: {
|
|
874
|
+
placement: nextPlacement
|
|
922
875
|
}
|
|
923
|
-
|
|
924
|
-
|
|
876
|
+
});
|
|
877
|
+
case 27:
|
|
878
|
+
resetPlacement = (_overflowsData$filter = overflowsData.filter(function(d) {
|
|
879
|
+
return d.overflows[0] <= 0;
|
|
880
|
+
}).sort(function(a, b) {
|
|
881
|
+
return a.overflows[1] - b.overflows[1];
|
|
882
|
+
})[0]) == null ? void 0 : _overflowsData$filter.placement;
|
|
883
|
+
if (resetPlacement) {
|
|
884
|
+
_context3.next = 37;
|
|
925
885
|
break;
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
return
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
return overflow2 > 0;
|
|
938
|
-
}).reduce(function(acc, overflow2) {
|
|
939
|
-
return acc + overflow2;
|
|
940
|
-
}, 0)];
|
|
941
|
-
}).sort(function(a, b) {
|
|
942
|
-
return a[1] - b[1];
|
|
943
|
-
})[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
944
|
-
if (_placement) {
|
|
945
|
-
resetPlacement = _placement;
|
|
886
|
+
}
|
|
887
|
+
_context3.t0 = fallbackStrategy;
|
|
888
|
+
_context3.next = _context3.t0 === "bestFit" ? 32 : _context3.t0 === "initialPlacement" ? 35 : 37;
|
|
889
|
+
break;
|
|
890
|
+
case 32:
|
|
891
|
+
_placement = (_overflowsData$filter2 = overflowsData.filter(function(d) {
|
|
892
|
+
if (hasFallbackAxisSideDirection) {
|
|
893
|
+
var currentSideAxis = getSideAxis(d.placement);
|
|
894
|
+
return currentSideAxis === initialSideAxis || // Create a bias to the `y` side axis due to horizontal
|
|
895
|
+
// reading directions favoring greater width.
|
|
896
|
+
currentSideAxis === "y";
|
|
946
897
|
}
|
|
947
|
-
return
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
898
|
+
return true;
|
|
899
|
+
}).map(function(d) {
|
|
900
|
+
return [d.placement, d.overflows.filter(function(overflow2) {
|
|
901
|
+
return overflow2 > 0;
|
|
902
|
+
}).reduce(function(acc, overflow2) {
|
|
903
|
+
return acc + overflow2;
|
|
904
|
+
}, 0)];
|
|
905
|
+
}).sort(function(a, b) {
|
|
906
|
+
return a[1] - b[1];
|
|
907
|
+
})[0]) == null ? void 0 : _overflowsData$filter2[0];
|
|
908
|
+
if (_placement) {
|
|
909
|
+
resetPlacement = _placement;
|
|
910
|
+
}
|
|
911
|
+
return _context3.abrupt("break", 37);
|
|
912
|
+
case 35:
|
|
913
|
+
resetPlacement = initialPlacement;
|
|
914
|
+
return _context3.abrupt("break", 37);
|
|
915
|
+
case 37:
|
|
916
|
+
if (!(placement !== resetPlacement)) {
|
|
917
|
+
_context3.next = 39;
|
|
918
|
+
break;
|
|
919
|
+
}
|
|
920
|
+
return _context3.abrupt("return", {
|
|
921
|
+
reset: {
|
|
922
|
+
placement: resetPlacement
|
|
955
923
|
}
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
case 40:
|
|
964
|
-
case "end":
|
|
965
|
-
return _context3.stop();
|
|
966
|
-
}
|
|
924
|
+
});
|
|
925
|
+
case 39:
|
|
926
|
+
return _context3.abrupt("return", {});
|
|
927
|
+
case 40:
|
|
928
|
+
case "end":
|
|
929
|
+
return _context3.stop();
|
|
930
|
+
}
|
|
967
931
|
}, _callee3);
|
|
968
932
|
}))();
|
|
969
933
|
}
|
|
@@ -993,48 +957,47 @@ var hide$1 = function hide$12(options) {
|
|
|
993
957
|
return _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee4() {
|
|
994
958
|
var rects, _evaluate2, _evaluate2$strategy, strategy, detectOverflowOptions, overflow, offsets, _overflow, _offsets;
|
|
995
959
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
996
|
-
while (1)
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
}
|
|
960
|
+
while (1) switch (_context4.prev = _context4.next) {
|
|
961
|
+
case 0:
|
|
962
|
+
rects = state.rects;
|
|
963
|
+
_evaluate2 = evaluate(options, state), _evaluate2$strategy = _evaluate2.strategy, strategy = _evaluate2$strategy === void 0 ? "referenceHidden" : _evaluate2$strategy, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate2, _excluded2);
|
|
964
|
+
_context4.t0 = strategy;
|
|
965
|
+
_context4.next = _context4.t0 === "referenceHidden" ? 5 : _context4.t0 === "escaped" ? 10 : 15;
|
|
966
|
+
break;
|
|
967
|
+
case 5:
|
|
968
|
+
_context4.next = 7;
|
|
969
|
+
return detectOverflow(state, _extends({}, detectOverflowOptions, {
|
|
970
|
+
elementContext: "reference"
|
|
971
|
+
}));
|
|
972
|
+
case 7:
|
|
973
|
+
overflow = _context4.sent;
|
|
974
|
+
offsets = getSideOffsets(overflow, rects.reference);
|
|
975
|
+
return _context4.abrupt("return", {
|
|
976
|
+
data: {
|
|
977
|
+
referenceHiddenOffsets: offsets,
|
|
978
|
+
referenceHidden: isAnySideFullyClipped(offsets)
|
|
979
|
+
}
|
|
980
|
+
});
|
|
981
|
+
case 10:
|
|
982
|
+
_context4.next = 12;
|
|
983
|
+
return detectOverflow(state, _extends({}, detectOverflowOptions, {
|
|
984
|
+
altBoundary: true
|
|
985
|
+
}));
|
|
986
|
+
case 12:
|
|
987
|
+
_overflow = _context4.sent;
|
|
988
|
+
_offsets = getSideOffsets(_overflow, rects.floating);
|
|
989
|
+
return _context4.abrupt("return", {
|
|
990
|
+
data: {
|
|
991
|
+
escapedOffsets: _offsets,
|
|
992
|
+
escaped: isAnySideFullyClipped(_offsets)
|
|
993
|
+
}
|
|
994
|
+
});
|
|
995
|
+
case 15:
|
|
996
|
+
return _context4.abrupt("return", {});
|
|
997
|
+
case 16:
|
|
998
|
+
case "end":
|
|
999
|
+
return _context4.stop();
|
|
1000
|
+
}
|
|
1038
1001
|
}, _callee4);
|
|
1039
1002
|
}))();
|
|
1040
1003
|
}
|
|
@@ -1047,43 +1010,42 @@ function _convertValueToCoords() {
|
|
|
1047
1010
|
_convertValueToCoords = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee9(state, options) {
|
|
1048
1011
|
var placement, platform2, elements, rtl, side, alignment, isVertical, mainAxisMulti, crossAxisMulti, rawValue, _ref7, mainAxis, crossAxis, alignmentAxis;
|
|
1049
1012
|
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
|
1050
|
-
while (1)
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
}
|
|
1013
|
+
while (1) switch (_context9.prev = _context9.next) {
|
|
1014
|
+
case 0:
|
|
1015
|
+
placement = state.placement, platform2 = state.platform, elements = state.elements;
|
|
1016
|
+
_context9.next = 3;
|
|
1017
|
+
return platform2.isRTL == null ? void 0 : platform2.isRTL(elements.floating);
|
|
1018
|
+
case 3:
|
|
1019
|
+
rtl = _context9.sent;
|
|
1020
|
+
side = getSide(placement);
|
|
1021
|
+
alignment = getAlignment(placement);
|
|
1022
|
+
isVertical = getSideAxis(placement) === "y";
|
|
1023
|
+
mainAxisMulti = ["left", "top"].includes(side) ? -1 : 1;
|
|
1024
|
+
crossAxisMulti = rtl && isVertical ? -1 : 1;
|
|
1025
|
+
rawValue = evaluate(options, state);
|
|
1026
|
+
_ref7 = typeof rawValue === "number" ? {
|
|
1027
|
+
mainAxis: rawValue,
|
|
1028
|
+
crossAxis: 0,
|
|
1029
|
+
alignmentAxis: null
|
|
1030
|
+
} : {
|
|
1031
|
+
mainAxis: rawValue.mainAxis || 0,
|
|
1032
|
+
crossAxis: rawValue.crossAxis || 0,
|
|
1033
|
+
alignmentAxis: rawValue.alignmentAxis
|
|
1034
|
+
}, mainAxis = _ref7.mainAxis, crossAxis = _ref7.crossAxis, alignmentAxis = _ref7.alignmentAxis;
|
|
1035
|
+
if (alignment && typeof alignmentAxis === "number") {
|
|
1036
|
+
crossAxis = alignment === "end" ? alignmentAxis * -1 : alignmentAxis;
|
|
1037
|
+
}
|
|
1038
|
+
return _context9.abrupt("return", isVertical ? {
|
|
1039
|
+
x: crossAxis * crossAxisMulti,
|
|
1040
|
+
y: mainAxis * mainAxisMulti
|
|
1041
|
+
} : {
|
|
1042
|
+
x: mainAxis * mainAxisMulti,
|
|
1043
|
+
y: crossAxis * crossAxisMulti
|
|
1044
|
+
});
|
|
1045
|
+
case 13:
|
|
1046
|
+
case "end":
|
|
1047
|
+
return _context9.stop();
|
|
1048
|
+
}
|
|
1087
1049
|
}, _callee9);
|
|
1088
1050
|
}));
|
|
1089
1051
|
return _convertValueToCoords.apply(this, arguments);
|
|
@@ -1099,31 +1061,30 @@ var offset$1 = function offset$12(options) {
|
|
|
1099
1061
|
return _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee5() {
|
|
1100
1062
|
var _middlewareData$offse, _middlewareData$arrow, x, y, placement, middlewareData, diffCoords;
|
|
1101
1063
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
1102
|
-
while (1)
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
}
|
|
1064
|
+
while (1) switch (_context5.prev = _context5.next) {
|
|
1065
|
+
case 0:
|
|
1066
|
+
x = state.x, y = state.y, placement = state.placement, middlewareData = state.middlewareData;
|
|
1067
|
+
_context5.next = 3;
|
|
1068
|
+
return convertValueToCoords(state, options);
|
|
1069
|
+
case 3:
|
|
1070
|
+
diffCoords = _context5.sent;
|
|
1071
|
+
if (!(placement === ((_middlewareData$offse = middlewareData.offset) == null ? void 0 : _middlewareData$offse.placement) && (_middlewareData$arrow = middlewareData.arrow) != null && _middlewareData$arrow.alignmentOffset)) {
|
|
1072
|
+
_context5.next = 6;
|
|
1073
|
+
break;
|
|
1074
|
+
}
|
|
1075
|
+
return _context5.abrupt("return", {});
|
|
1076
|
+
case 6:
|
|
1077
|
+
return _context5.abrupt("return", {
|
|
1078
|
+
x: x + diffCoords.x,
|
|
1079
|
+
y: y + diffCoords.y,
|
|
1080
|
+
data: _extends({}, diffCoords, {
|
|
1081
|
+
placement
|
|
1082
|
+
})
|
|
1083
|
+
});
|
|
1084
|
+
case 7:
|
|
1085
|
+
case "end":
|
|
1086
|
+
return _context5.stop();
|
|
1087
|
+
}
|
|
1127
1088
|
}, _callee5);
|
|
1128
1089
|
}))();
|
|
1129
1090
|
}
|
|
@@ -1141,57 +1102,56 @@ var shift$1 = function shift$12(options) {
|
|
|
1141
1102
|
var _extends4, _enabled;
|
|
1142
1103
|
var x, y, placement, _evaluate3, _evaluate3$mainAxis, checkMainAxis, _evaluate3$crossAxis, checkCrossAxis, _evaluate3$limiter, limiter, detectOverflowOptions, coords, overflow, crossAxis, mainAxis, mainAxisCoord, crossAxisCoord, minSide, maxSide, _min, _max, _minSide, _maxSide, _min2, _max2, limitedCoords;
|
|
1143
1104
|
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
|
1144
|
-
while (1)
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
};
|
|
1155
|
-
}
|
|
1156
|
-
} : _evaluate3$limiter, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate3, _excluded3);
|
|
1157
|
-
coords = {
|
|
1158
|
-
x,
|
|
1159
|
-
y
|
|
1160
|
-
};
|
|
1161
|
-
_context6.next = 5;
|
|
1162
|
-
return detectOverflow(state, detectOverflowOptions);
|
|
1163
|
-
case 5:
|
|
1164
|
-
overflow = _context6.sent;
|
|
1165
|
-
crossAxis = getSideAxis(getSide(placement));
|
|
1166
|
-
mainAxis = getOppositeAxis(crossAxis);
|
|
1167
|
-
mainAxisCoord = coords[mainAxis];
|
|
1168
|
-
crossAxisCoord = coords[crossAxis];
|
|
1169
|
-
if (checkMainAxis) {
|
|
1170
|
-
minSide = mainAxis === "y" ? "top" : "left";
|
|
1171
|
-
maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
1172
|
-
_min = mainAxisCoord + overflow[minSide];
|
|
1173
|
-
_max = mainAxisCoord - overflow[maxSide];
|
|
1174
|
-
mainAxisCoord = clamp(_min, mainAxisCoord, _max);
|
|
1105
|
+
while (1) switch (_context6.prev = _context6.next) {
|
|
1106
|
+
case 0:
|
|
1107
|
+
x = state.x, y = state.y, placement = state.placement;
|
|
1108
|
+
_evaluate3 = evaluate(options, state), _evaluate3$mainAxis = _evaluate3.mainAxis, checkMainAxis = _evaluate3$mainAxis === void 0 ? true : _evaluate3$mainAxis, _evaluate3$crossAxis = _evaluate3.crossAxis, checkCrossAxis = _evaluate3$crossAxis === void 0 ? false : _evaluate3$crossAxis, _evaluate3$limiter = _evaluate3.limiter, limiter = _evaluate3$limiter === void 0 ? {
|
|
1109
|
+
fn: function fn2(_ref) {
|
|
1110
|
+
var x2 = _ref.x, y2 = _ref.y;
|
|
1111
|
+
return {
|
|
1112
|
+
x: x2,
|
|
1113
|
+
y: y2
|
|
1114
|
+
};
|
|
1175
1115
|
}
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1116
|
+
} : _evaluate3$limiter, detectOverflowOptions = _objectWithoutPropertiesLoose(_evaluate3, _excluded3);
|
|
1117
|
+
coords = {
|
|
1118
|
+
x,
|
|
1119
|
+
y
|
|
1120
|
+
};
|
|
1121
|
+
_context6.next = 5;
|
|
1122
|
+
return detectOverflow(state, detectOverflowOptions);
|
|
1123
|
+
case 5:
|
|
1124
|
+
overflow = _context6.sent;
|
|
1125
|
+
crossAxis = getSideAxis(getSide(placement));
|
|
1126
|
+
mainAxis = getOppositeAxis(crossAxis);
|
|
1127
|
+
mainAxisCoord = coords[mainAxis];
|
|
1128
|
+
crossAxisCoord = coords[crossAxis];
|
|
1129
|
+
if (checkMainAxis) {
|
|
1130
|
+
minSide = mainAxis === "y" ? "top" : "left";
|
|
1131
|
+
maxSide = mainAxis === "y" ? "bottom" : "right";
|
|
1132
|
+
_min = mainAxisCoord + overflow[minSide];
|
|
1133
|
+
_max = mainAxisCoord - overflow[maxSide];
|
|
1134
|
+
mainAxisCoord = clamp(_min, mainAxisCoord, _max);
|
|
1135
|
+
}
|
|
1136
|
+
if (checkCrossAxis) {
|
|
1137
|
+
_minSide = crossAxis === "y" ? "top" : "left";
|
|
1138
|
+
_maxSide = crossAxis === "y" ? "bottom" : "right";
|
|
1139
|
+
_min2 = crossAxisCoord + overflow[_minSide];
|
|
1140
|
+
_max2 = crossAxisCoord - overflow[_maxSide];
|
|
1141
|
+
crossAxisCoord = clamp(_min2, crossAxisCoord, _max2);
|
|
1142
|
+
}
|
|
1143
|
+
limitedCoords = limiter.fn(_extends({}, state, (_extends4 = {}, _extends4[mainAxis] = mainAxisCoord, _extends4[crossAxis] = crossAxisCoord, _extends4)));
|
|
1144
|
+
return _context6.abrupt("return", _extends({}, limitedCoords, {
|
|
1145
|
+
data: {
|
|
1146
|
+
x: limitedCoords.x - x,
|
|
1147
|
+
y: limitedCoords.y - y,
|
|
1148
|
+
enabled: (_enabled = {}, _enabled[mainAxis] = checkMainAxis, _enabled[crossAxis] = checkCrossAxis, _enabled)
|
|
1182
1149
|
}
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
enabled: (_enabled = {}, _enabled[mainAxis] = checkMainAxis, _enabled[crossAxis] = checkCrossAxis, _enabled)
|
|
1189
|
-
}
|
|
1190
|
-
}));
|
|
1191
|
-
case 14:
|
|
1192
|
-
case "end":
|
|
1193
|
-
return _context6.stop();
|
|
1194
|
-
}
|
|
1150
|
+
}));
|
|
1151
|
+
case 14:
|
|
1152
|
+
case "end":
|
|
1153
|
+
return _context6.stop();
|
|
1154
|
+
}
|
|
1195
1155
|
}, _callee6);
|
|
1196
1156
|
}))();
|
|
1197
1157
|
}
|
|
@@ -1309,7 +1269,9 @@ function isTopLayer(element) {
|
|
|
1309
1269
|
function isContainingBlock(elementOrCss) {
|
|
1310
1270
|
var webkit = isWebKit();
|
|
1311
1271
|
var css = isElement(elementOrCss) ? getComputedStyle(elementOrCss) : elementOrCss;
|
|
1312
|
-
return
|
|
1272
|
+
return ["transform", "translate", "scale", "rotate", "perspective"].some(function(value) {
|
|
1273
|
+
return css[value] ? css[value] !== "none" : false;
|
|
1274
|
+
}) || (css.containerType ? css.containerType !== "normal" : false) || !webkit && (css.backdropFilter ? css.backdropFilter !== "none" : false) || !webkit && (css.filter ? css.filter !== "none" : false) || ["transform", "translate", "scale", "rotate", "perspective", "filter"].some(function(value) {
|
|
1313
1275
|
return (css.willChange || "").includes(value);
|
|
1314
1276
|
}) || ["paint", "layout", "strict", "content"].some(function(value) {
|
|
1315
1277
|
return (css.contain || "").includes(value);
|
|
@@ -1328,8 +1290,7 @@ function getContainingBlock(element) {
|
|
|
1328
1290
|
return null;
|
|
1329
1291
|
}
|
|
1330
1292
|
function isWebKit() {
|
|
1331
|
-
if (typeof CSS === "undefined" || !CSS.supports)
|
|
1332
|
-
return false;
|
|
1293
|
+
if (typeof CSS === "undefined" || !CSS.supports) return false;
|
|
1333
1294
|
return CSS.supports("-webkit-backdrop-filter", "none");
|
|
1334
1295
|
}
|
|
1335
1296
|
function isLastTraversableNode(node) {
|
|
@@ -1506,6 +1467,28 @@ function getBoundingClientRect(element, includeScale, isFixedStrategy, offsetPar
|
|
|
1506
1467
|
y
|
|
1507
1468
|
});
|
|
1508
1469
|
}
|
|
1470
|
+
function getWindowScrollBarX(element, rect) {
|
|
1471
|
+
var leftScroll = getNodeScroll(element).scrollLeft;
|
|
1472
|
+
if (!rect) {
|
|
1473
|
+
return getBoundingClientRect(getDocumentElement(element)).left + leftScroll;
|
|
1474
|
+
}
|
|
1475
|
+
return rect.left + leftScroll;
|
|
1476
|
+
}
|
|
1477
|
+
function getHTMLOffset(documentElement, scroll, ignoreScrollbarX) {
|
|
1478
|
+
if (ignoreScrollbarX === void 0) {
|
|
1479
|
+
ignoreScrollbarX = false;
|
|
1480
|
+
}
|
|
1481
|
+
var htmlRect = documentElement.getBoundingClientRect();
|
|
1482
|
+
var x = htmlRect.left + scroll.scrollLeft - (ignoreScrollbarX ? 0 : (
|
|
1483
|
+
// RTL <body> scrollbar.
|
|
1484
|
+
getWindowScrollBarX(documentElement, htmlRect)
|
|
1485
|
+
));
|
|
1486
|
+
var y = htmlRect.top + scroll.scrollTop;
|
|
1487
|
+
return {
|
|
1488
|
+
x,
|
|
1489
|
+
y
|
|
1490
|
+
};
|
|
1491
|
+
}
|
|
1509
1492
|
function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
1510
1493
|
var elements = _ref.elements, rect = _ref.rect, offsetParent = _ref.offsetParent, strategy = _ref.strategy;
|
|
1511
1494
|
var isFixed = strategy === "fixed";
|
|
@@ -1532,19 +1515,17 @@ function convertOffsetParentRelativeRectToViewportRelativeRect(_ref) {
|
|
|
1532
1515
|
offsets.y = offsetRect.y + offsetParent.clientTop;
|
|
1533
1516
|
}
|
|
1534
1517
|
}
|
|
1518
|
+
var htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll, true) : createCoords(0);
|
|
1535
1519
|
return {
|
|
1536
1520
|
width: rect.width * scale.x,
|
|
1537
1521
|
height: rect.height * scale.y,
|
|
1538
|
-
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x,
|
|
1539
|
-
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y
|
|
1522
|
+
x: rect.x * scale.x - scroll.scrollLeft * scale.x + offsets.x + htmlOffset.x,
|
|
1523
|
+
y: rect.y * scale.y - scroll.scrollTop * scale.y + offsets.y + htmlOffset.y
|
|
1540
1524
|
};
|
|
1541
1525
|
}
|
|
1542
1526
|
function getClientRects(element) {
|
|
1543
1527
|
return Array.from(element.getClientRects());
|
|
1544
1528
|
}
|
|
1545
|
-
function getWindowScrollBarX(element) {
|
|
1546
|
-
return getBoundingClientRect(getDocumentElement(element)).left + getNodeScroll(element).scrollLeft;
|
|
1547
|
-
}
|
|
1548
1529
|
function getDocumentRect(element) {
|
|
1549
1530
|
var html = getDocumentElement(element);
|
|
1550
1531
|
var scroll = getNodeScroll(element);
|
|
@@ -1613,10 +1594,12 @@ function getClientRectFromClippingAncestor(element, clippingAncestor, strategy)
|
|
|
1613
1594
|
rect = getInnerBoundingClientRect(clippingAncestor, strategy);
|
|
1614
1595
|
} else {
|
|
1615
1596
|
var visualOffsets = getVisualOffsets(element);
|
|
1616
|
-
rect =
|
|
1597
|
+
rect = {
|
|
1617
1598
|
x: clippingAncestor.x - visualOffsets.x,
|
|
1618
|
-
y: clippingAncestor.y - visualOffsets.y
|
|
1619
|
-
|
|
1599
|
+
y: clippingAncestor.y - visualOffsets.y,
|
|
1600
|
+
width: clippingAncestor.width,
|
|
1601
|
+
height: clippingAncestor.height
|
|
1602
|
+
};
|
|
1620
1603
|
}
|
|
1621
1604
|
return rectToClientRect(rect);
|
|
1622
1605
|
}
|
|
@@ -1706,8 +1689,9 @@ function getRectRelativeToOffsetParent(element, offsetParent, strategy) {
|
|
|
1706
1689
|
offsets.x = getWindowScrollBarX(documentElement);
|
|
1707
1690
|
}
|
|
1708
1691
|
}
|
|
1709
|
-
var
|
|
1710
|
-
var
|
|
1692
|
+
var htmlOffset = documentElement && !isOffsetParentAnElement && !isFixed ? getHTMLOffset(documentElement, scroll) : createCoords(0);
|
|
1693
|
+
var x = rect.left + scroll.scrollLeft - offsets.x - htmlOffset.x;
|
|
1694
|
+
var y = rect.top + scroll.scrollTop - offsets.y - htmlOffset.y;
|
|
1711
1695
|
return {
|
|
1712
1696
|
x,
|
|
1713
1697
|
y,
|
|
@@ -1725,7 +1709,11 @@ function getTrueOffsetParent(element, polyfill) {
|
|
|
1725
1709
|
if (polyfill) {
|
|
1726
1710
|
return polyfill(element);
|
|
1727
1711
|
}
|
|
1728
|
-
|
|
1712
|
+
var rawOffsetParent = element.offsetParent;
|
|
1713
|
+
if (getDocumentElement(element) === rawOffsetParent) {
|
|
1714
|
+
rawOffsetParent = rawOffsetParent.ownerDocument.body;
|
|
1715
|
+
}
|
|
1716
|
+
return rawOffsetParent;
|
|
1729
1717
|
}
|
|
1730
1718
|
function getOffsetParent(element, polyfill) {
|
|
1731
1719
|
var win = getWindow(element);
|
|
@@ -1755,37 +1743,36 @@ var getElementRects = /* @__PURE__ */ function() {
|
|
|
1755
1743
|
var _ref6 = _asyncToGenerator(/* @__PURE__ */ _regeneratorRuntime().mark(function _callee7(data) {
|
|
1756
1744
|
var getOffsetParentFn, getDimensionsFn, floatingDimensions;
|
|
1757
1745
|
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
|
1758
|
-
while (1)
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
}
|
|
1746
|
+
while (1) switch (_context7.prev = _context7.next) {
|
|
1747
|
+
case 0:
|
|
1748
|
+
getOffsetParentFn = this.getOffsetParent || getOffsetParent;
|
|
1749
|
+
getDimensionsFn = this.getDimensions;
|
|
1750
|
+
_context7.next = 4;
|
|
1751
|
+
return getDimensionsFn(data.floating);
|
|
1752
|
+
case 4:
|
|
1753
|
+
floatingDimensions = _context7.sent;
|
|
1754
|
+
_context7.t0 = getRectRelativeToOffsetParent;
|
|
1755
|
+
_context7.t1 = data.reference;
|
|
1756
|
+
_context7.next = 9;
|
|
1757
|
+
return getOffsetParentFn(data.floating);
|
|
1758
|
+
case 9:
|
|
1759
|
+
_context7.t2 = _context7.sent;
|
|
1760
|
+
_context7.t3 = data.strategy;
|
|
1761
|
+
_context7.t4 = (0, _context7.t0)(_context7.t1, _context7.t2, _context7.t3);
|
|
1762
|
+
_context7.t5 = {
|
|
1763
|
+
x: 0,
|
|
1764
|
+
y: 0,
|
|
1765
|
+
width: floatingDimensions.width,
|
|
1766
|
+
height: floatingDimensions.height
|
|
1767
|
+
};
|
|
1768
|
+
return _context7.abrupt("return", {
|
|
1769
|
+
reference: _context7.t4,
|
|
1770
|
+
floating: _context7.t5
|
|
1771
|
+
});
|
|
1772
|
+
case 14:
|
|
1773
|
+
case "end":
|
|
1774
|
+
return _context7.stop();
|
|
1775
|
+
}
|
|
1789
1776
|
}, _callee7, this);
|
|
1790
1777
|
}));
|
|
1791
1778
|
return function getElementRects2(_x8) {
|
|
@@ -1807,6 +1794,9 @@ var platform = {
|
|
|
1807
1794
|
isElement,
|
|
1808
1795
|
isRTL
|
|
1809
1796
|
};
|
|
1797
|
+
function rectsAreEqual(a, b) {
|
|
1798
|
+
return a.x === b.x && a.y === b.y && a.width === b.width && a.height === b.height;
|
|
1799
|
+
}
|
|
1810
1800
|
function observeMove(element, onMove) {
|
|
1811
1801
|
var io = null;
|
|
1812
1802
|
var timeoutId;
|
|
@@ -1825,7 +1815,8 @@ function observeMove(element, onMove) {
|
|
|
1825
1815
|
threshold = 1;
|
|
1826
1816
|
}
|
|
1827
1817
|
cleanup();
|
|
1828
|
-
var
|
|
1818
|
+
var elementRectForRootMargin = element.getBoundingClientRect();
|
|
1819
|
+
var left = elementRectForRootMargin.left, top = elementRectForRootMargin.top, width = elementRectForRootMargin.width, height = elementRectForRootMargin.height;
|
|
1829
1820
|
if (!skip) {
|
|
1830
1821
|
onMove();
|
|
1831
1822
|
}
|
|
@@ -1856,6 +1847,9 @@ function observeMove(element, onMove) {
|
|
|
1856
1847
|
refresh(false, ratio);
|
|
1857
1848
|
}
|
|
1858
1849
|
}
|
|
1850
|
+
if (ratio === 1 && !rectsAreEqual(elementRectForRootMargin, element.getBoundingClientRect())) {
|
|
1851
|
+
refresh();
|
|
1852
|
+
}
|
|
1859
1853
|
isFirstUpdate = false;
|
|
1860
1854
|
}
|
|
1861
1855
|
try {
|
|
@@ -1912,7 +1906,7 @@ function autoUpdate(reference, floating, update, options) {
|
|
|
1912
1906
|
}
|
|
1913
1907
|
function frameLoop() {
|
|
1914
1908
|
var nextRefRect = getBoundingClientRect(reference);
|
|
1915
|
-
if (prevRefRect && (
|
|
1909
|
+
if (prevRefRect && !rectsAreEqual(prevRefRect, nextRefRect)) {
|
|
1916
1910
|
update();
|
|
1917
1911
|
}
|
|
1918
1912
|
prevRefRect = nextRefRect;
|
|
@@ -1982,18 +1976,15 @@ var oppositeSidesMap = {
|
|
|
1982
1976
|
left: "right"
|
|
1983
1977
|
};
|
|
1984
1978
|
var toMs = function toMs2(s) {
|
|
1985
|
-
if (s === "auto")
|
|
1986
|
-
return 0;
|
|
1979
|
+
if (s === "auto") return 0;
|
|
1987
1980
|
return Number(s.slice(0, -1).replace(",", ".")) * 1e3;
|
|
1988
1981
|
};
|
|
1989
1982
|
var getTransitionInfo = function getTransitionInfo2(el) {
|
|
1990
1983
|
var styles = window.getComputedStyle(el);
|
|
1991
1984
|
var timeout = toMs(styles.transitionDelay) + toMs(styles.transitionDuration);
|
|
1992
|
-
if (timeout)
|
|
1993
|
-
return timeout;
|
|
1985
|
+
if (timeout) return timeout;
|
|
1994
1986
|
timeout = toMs(styles.animationDelay) + toMs(styles.animationDuration);
|
|
1995
|
-
if (timeout)
|
|
1996
|
-
return timeout;
|
|
1987
|
+
if (timeout) return timeout;
|
|
1997
1988
|
return 0;
|
|
1998
1989
|
};
|
|
1999
1990
|
var applyClass = function applyClass2(el, classes, force) {
|
|
@@ -2024,7 +2015,7 @@ var updatePopper = function updatePopper2(state) {
|
|
|
2024
2015
|
var _state$_last;
|
|
2025
2016
|
var x = _ref.x, y = _ref.y, placement = _ref.placement, strategy = _ref.strategy, middlewareData = _ref.middlewareData;
|
|
2026
2017
|
if (state.autoHide && state._last.show) {
|
|
2027
|
-
var timestamp =
|
|
2018
|
+
var timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
2028
2019
|
if (timestamp > state._last.timestamp + 300) {
|
|
2029
2020
|
state.show = false;
|
|
2030
2021
|
return;
|
|
@@ -2063,7 +2054,7 @@ var updatePopper = function updatePopper2(state) {
|
|
|
2063
2054
|
}
|
|
2064
2055
|
if (state.arrowVisible) {
|
|
2065
2056
|
var _arrowStyle;
|
|
2066
|
-
var _middlewareData$
|
|
2057
|
+
var _middlewareData$arrow = middlewareData.arrow, arrowX = _middlewareData$arrow.x, arrowY = _middlewareData$arrow.y;
|
|
2067
2058
|
var arrowElement = state._last.arrowEl;
|
|
2068
2059
|
var staticSide = oppositeSidesMap[placement.split("-")[0]];
|
|
2069
2060
|
var arrowStyle = (_arrowStyle = {
|
|
@@ -2093,8 +2084,7 @@ var autoUpdatePopper = function autoUpdatePopper2(state) {
|
|
|
2093
2084
|
});
|
|
2094
2085
|
};
|
|
2095
2086
|
var appendPopper = function appendPopper2(state) {
|
|
2096
|
-
if (state._last.show && state._last.popper === state.popper)
|
|
2097
|
-
return;
|
|
2087
|
+
if (state._last.show && state._last.popper === state.popper) return;
|
|
2098
2088
|
if (state._last.popper && state._last.popper !== state.popper) {
|
|
2099
2089
|
if (state._last.appendToBody) {
|
|
2100
2090
|
state._last.popper.remove();
|
|
@@ -2133,8 +2123,7 @@ var appendPopper = function appendPopper2(state) {
|
|
|
2133
2123
|
}
|
|
2134
2124
|
};
|
|
2135
2125
|
var closePopper = function closePopper2(state) {
|
|
2136
|
-
if (!state._last.show)
|
|
2137
|
-
return;
|
|
2126
|
+
if (!state._last.show) return;
|
|
2138
2127
|
if (state.popper) {
|
|
2139
2128
|
if (state.animate && state.animateName) {
|
|
2140
2129
|
var leaveName = state.animateName + "-leave-to";
|
|
@@ -2226,7 +2215,7 @@ var useFloating = function useFloating2(option) {
|
|
|
2226
2215
|
state._last.reference = state.reference;
|
|
2227
2216
|
state._last.show = state.show && state.popper && state.reference;
|
|
2228
2217
|
state._last.appendToBody = state.appendToBody;
|
|
2229
|
-
state._last.timestamp =
|
|
2218
|
+
state._last.timestamp = (/* @__PURE__ */ new Date()).getTime();
|
|
2230
2219
|
};
|
|
2231
2220
|
watch$1(state, watchState, {
|
|
2232
2221
|
immediate: true
|