@rcarls/rc-common 0.3.2 → 0.4.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/README.md +106 -64
- package/dist/rc-common.js +603 -215
- package/dist/rc-common.umd.cjs +14 -14
- package/dist/types/DragController.d.ts +5 -12
- package/dist/types/DragGestureController.d.ts +110 -0
- package/dist/types/DragGestureController.test.d.ts +1 -0
- package/dist/types/NavigationIndicatorController.d.ts +33 -0
- package/dist/types/ResizeController.d.ts +71 -15
- package/dist/types/index.d.ts +3 -0
- package/dist/types/snapUtils.d.ts +10 -0
- package/dist/types/snapUtils.test.d.ts +1 -0
- package/package.json +1 -1
package/dist/rc-common.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { nothing as
|
|
2
|
-
import { PartType as
|
|
3
|
-
import { directive as
|
|
4
|
-
import { state as
|
|
5
|
-
let
|
|
6
|
-
class
|
|
1
|
+
import { nothing as g } from "lit";
|
|
2
|
+
import { PartType as b } from "lit/directive.js";
|
|
3
|
+
import { directive as v, AsyncDirective as y } from "lit/async-directive.js";
|
|
4
|
+
import { state as A } from "lit/decorators.js";
|
|
5
|
+
let C = 0;
|
|
6
|
+
class X {
|
|
7
7
|
constructor(t, e) {
|
|
8
|
-
this._activeItem = null, this._activeIndex = -1, this._itemCounter = 0, this._opts = e, this._instanceId = `rc-adc-${++
|
|
8
|
+
this._activeItem = null, this._activeIndex = -1, this._itemCounter = 0, this._opts = e, this._instanceId = `rc-adc-${++C}`, t.addController(this);
|
|
9
9
|
}
|
|
10
10
|
hostConnected() {
|
|
11
11
|
}
|
|
@@ -30,10 +30,10 @@ class U {
|
|
|
30
30
|
const i = this._opts.wrap ?? !0;
|
|
31
31
|
let s = this._activeIndex < 0 ? t > 0 ? -1 : e.length : this._activeIndex;
|
|
32
32
|
const n = e.length;
|
|
33
|
-
let
|
|
33
|
+
let r = 0;
|
|
34
34
|
do
|
|
35
|
-
if (s += t, i ? s = (s % n + n) % n : s = Math.max(0, Math.min(n - 1, s)),
|
|
36
|
-
while (
|
|
35
|
+
if (s += t, i ? s = (s % n + n) % n : s = Math.max(0, Math.min(n - 1, s)), r++, !this._isSkipped(e[s])) break;
|
|
36
|
+
while (r < n);
|
|
37
37
|
this._setActive(e[s] ?? null, s);
|
|
38
38
|
}
|
|
39
39
|
/** Move the virtual cursor to the first non-skipped item. */
|
|
@@ -86,7 +86,7 @@ class U {
|
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
class
|
|
89
|
+
class N {
|
|
90
90
|
constructor(t, e) {
|
|
91
91
|
this._ul = null, this._options = [], this._liElements = [], this._createLi = null, this._createOption = null, this._selectedValues = /* @__PURE__ */ new Set(), this._filterText = "", this._filterStrategy = "contains", this._checkmark = !1, this._optionsInitialized = !1, this._onPointerDown = (i) => {
|
|
92
92
|
const s = i.target;
|
|
@@ -94,8 +94,8 @@ class V {
|
|
|
94
94
|
const n = s.closest("li[data-value]");
|
|
95
95
|
if (!n || n.getAttribute("role") !== "option" || n.parentElement !== this._ul) return;
|
|
96
96
|
i.preventDefault(), i.stopPropagation();
|
|
97
|
-
const
|
|
98
|
-
|
|
97
|
+
const r = this.optionForElement(n);
|
|
98
|
+
r && this._onActivate(r);
|
|
99
99
|
}, this._host = t, this._idPrefix = e.idPrefix, this._onInitFromDom = e.onInitFromDom, this._onActivate = e.onActivate, t.addController(this);
|
|
100
100
|
}
|
|
101
101
|
hostConnected() {
|
|
@@ -204,8 +204,8 @@ class V {
|
|
|
204
204
|
if (e.length === 0) return;
|
|
205
205
|
const i = [];
|
|
206
206
|
for (let s = 0; s < e.length; s++) {
|
|
207
|
-
const n = e[s],
|
|
208
|
-
i.push({ value:
|
|
207
|
+
const n = e[s], r = n.getAttribute("data-value") ?? n.getAttribute("value") ?? n.textContent?.trim() ?? "", a = n.textContent?.trim() ?? "", l = n.hasAttribute("disabled") || n.getAttribute("aria-disabled") === "true";
|
|
208
|
+
i.push({ value: r, label: a, disabled: l }), n.setAttribute("role", "option"), n.setAttribute("id", `${this._idPrefix}-${s}`), n.setAttribute("part", "option"), n.setAttribute("data-value", r), n.setAttribute("aria-selected", this._selectedValues.has(r) ? "true" : "false"), n.setAttribute("aria-disabled", l ? "true" : "false"), this._checkmark && this._ensureCheckmark(n);
|
|
209
209
|
}
|
|
210
210
|
this._options = i, this._liElements = e, this._onInitFromDom?.(i);
|
|
211
211
|
}
|
|
@@ -268,7 +268,7 @@ class V {
|
|
|
268
268
|
return typeof this._filterStrategy == "function" ? this._filterStrategy(e, i) : this._filterStrategy === "contains" ? e.includes(i) : e.startsWith(i);
|
|
269
269
|
}
|
|
270
270
|
}
|
|
271
|
-
class
|
|
271
|
+
class k extends y {
|
|
272
272
|
constructor(t) {
|
|
273
273
|
if (super(t), this._options = {}, this._isPointerFocus = !1, this._onPointerdown = () => {
|
|
274
274
|
this._isPointerFocus = !0, this._target?.removeAttribute("data-interaction-mode");
|
|
@@ -276,7 +276,7 @@ class T extends E {
|
|
|
276
276
|
this._isPointerFocus ? this._isPointerFocus = !1 : this._target?.setAttribute("data-interaction-mode", "keyboard");
|
|
277
277
|
}, this._onKeydown = () => {
|
|
278
278
|
this._target?.setAttribute("data-interaction-mode", "keyboard");
|
|
279
|
-
}, t.type !==
|
|
279
|
+
}, t.type !== b.ELEMENT)
|
|
280
280
|
throw new Error("The `keyInteraction` directive must be used on an element.");
|
|
281
281
|
}
|
|
282
282
|
get _target() {
|
|
@@ -287,7 +287,7 @@ class T extends E {
|
|
|
287
287
|
t instanceof HTMLElement && (t.addEventListener("pointerdown", this._onPointerdown, { capture: !0 }), t.addEventListener("focusin", this._onFocusin), t.addEventListener("keydown", this._onKeydown));
|
|
288
288
|
}
|
|
289
289
|
render(t) {
|
|
290
|
-
return
|
|
290
|
+
return g;
|
|
291
291
|
}
|
|
292
292
|
update(t, [e]) {
|
|
293
293
|
this.isConnected && this._element?.deref() === void 0 && (this._element = new WeakRef(t.element), this._init()), this._options = e ?? {};
|
|
@@ -300,10 +300,10 @@ class T extends E {
|
|
|
300
300
|
this._init();
|
|
301
301
|
}
|
|
302
302
|
}
|
|
303
|
-
const
|
|
304
|
-
class
|
|
303
|
+
const K = v(k);
|
|
304
|
+
class T extends y {
|
|
305
305
|
constructor(t) {
|
|
306
|
-
if (super(t), this._options = {}, t.type !==
|
|
306
|
+
if (super(t), this._options = {}, t.type !== b.ELEMENT)
|
|
307
307
|
throw new Error(
|
|
308
308
|
"The `keyNavigation` directive must be used on an element."
|
|
309
309
|
);
|
|
@@ -342,9 +342,9 @@ class M extends E {
|
|
|
342
342
|
}
|
|
343
343
|
}
|
|
344
344
|
_onKeydown(t) {
|
|
345
|
-
const e = this._normalizeKey(t.key), i = this.navigationAxis, s = this._element?.deref(), n = i === "horizontal" && s != null && getComputedStyle(s).direction === "rtl",
|
|
345
|
+
const e = this._normalizeKey(t.key), i = this.navigationAxis, s = this._element?.deref(), n = i === "horizontal" && s != null && getComputedStyle(s).direction === "rtl", r = i === "horizontal" ? n ? "ArrowLeft" : "ArrowRight" : "ArrowDown", a = i === "horizontal" ? n ? "ArrowRight" : "ArrowLeft" : "ArrowUp", l = i === "horizontal" ? "ArrowDown" : "ArrowRight", _ = i === "horizontal" ? "ArrowUp" : "ArrowLeft";
|
|
346
346
|
let h;
|
|
347
|
-
this._options.handleNavAxis !== !1 && (e ===
|
|
347
|
+
this._options.handleNavAxis !== !1 && (e === r ? h = t.shiftKey ? "next-large" : "next" : e === a ? h = t.shiftKey ? "prev-large" : "prev" : e === "Home" ? h = "start" : e === "End" && (h = "end")), !h && this._options.handleOpenAxis && (e === l ? h = "open-to-first" : e === _ && (h = "open-to-last")), h || (e === "Enter" ? h = this._options.handleActivate ? "activate" : "toggle" : e === " " && this._options.handleActivate ? h = "activate" : e === "Escape" && this._options.handleEscape && (h = "escape")), h != null && (this._callback(h), t.stopPropagation(), t.preventDefault());
|
|
348
348
|
}
|
|
349
349
|
_init() {
|
|
350
350
|
const t = this._element?.deref();
|
|
@@ -357,7 +357,7 @@ class M extends E {
|
|
|
357
357
|
* Use an options object instead.
|
|
358
358
|
*/
|
|
359
359
|
render(t, e) {
|
|
360
|
-
return
|
|
360
|
+
return g;
|
|
361
361
|
}
|
|
362
362
|
update(t, [e, i]) {
|
|
363
363
|
this.isConnected && this._element?.deref() === void 0 && (this._element = new WeakRef(t.element), this._init()), this._callback = e.bind(t.options?.host ?? t.element), typeof i == "boolean" ? this._options = {} : this._options = { ...i };
|
|
@@ -370,10 +370,10 @@ class M extends E {
|
|
|
370
370
|
this._init();
|
|
371
371
|
}
|
|
372
372
|
}
|
|
373
|
-
const
|
|
374
|
-
class D extends
|
|
373
|
+
const V = v(T);
|
|
374
|
+
class D extends y {
|
|
375
375
|
constructor(t) {
|
|
376
|
-
if (super(t), this._activePointerId = null, t.type !==
|
|
376
|
+
if (super(t), this._activePointerId = null, t.type !== b.ELEMENT)
|
|
377
377
|
throw new Error("The `mouseMove` directive must be used on an element.");
|
|
378
378
|
this._pointerDownHandle = this._onPointerDown.bind(this), this._pointerMoveHandle = this._onPointerMove.bind(this), this._pointerEndHandle = this._onPointerEnd.bind(this);
|
|
379
379
|
}
|
|
@@ -418,7 +418,7 @@ class D extends E {
|
|
|
418
418
|
}
|
|
419
419
|
/** Render no DOM; this directive only wires pointer listeners. */
|
|
420
420
|
render(t) {
|
|
421
|
-
return
|
|
421
|
+
return g;
|
|
422
422
|
}
|
|
423
423
|
update(t, [e]) {
|
|
424
424
|
if (this._callback = e.bind(t.options?.host ?? t.element), !this.isConnected || !(t.element instanceof HTMLElement)) return;
|
|
@@ -433,14 +433,149 @@ class D extends E {
|
|
|
433
433
|
this._init();
|
|
434
434
|
}
|
|
435
435
|
}
|
|
436
|
-
const j =
|
|
436
|
+
const j = v(D);
|
|
437
|
+
class E {
|
|
438
|
+
constructor(t, e) {
|
|
439
|
+
this._$target = null, this._pointerId = null, this._startX = 0, this._startY = 0, this._startTime = 0, this._samples = [], this._activated = !1, this._rejected = !1, this._onPointerDown = (i) => {
|
|
440
|
+
if (this._pointerId !== null || !i.isPrimary && i.pointerId !== 1 || i.pointerType === "mouse" && i.button !== 0 || this._options.canStart?.(i) === !1)
|
|
441
|
+
return;
|
|
442
|
+
this._pointerId = i.pointerId, this._startX = i.clientX, this._startY = i.clientY, this._startTime = i.timeStamp, this._samples = [{ x: i.clientX, y: i.clientY, time: i.timeStamp }], this._activated = !1, this._rejected = !1;
|
|
443
|
+
const s = this._$target;
|
|
444
|
+
s && (s.addEventListener("pointermove", this._onPointerMove), s.addEventListener("pointerup", this._onPointerUp), s.addEventListener("pointercancel", this._onPointerCancel), s.addEventListener("lostpointercapture", this._onLostPointerCapture), this._options.activation === "immediate" && this._activate(i));
|
|
445
|
+
}, this._onPointerMove = (i) => {
|
|
446
|
+
i.pointerId !== this._pointerId || this._rejected || (this._recordSample(i), !(!this._activated && !this._resolveIntent(i)) && (this._options.onMove?.(this._detail(i)), this._options.preventDefault && i.preventDefault()));
|
|
447
|
+
}, this._onPointerUp = (i) => {
|
|
448
|
+
i.pointerId === this._pointerId && (this._recordSample(i), this._activated && this._options.onEnd?.(this._detail(i)), this._finish());
|
|
449
|
+
}, this._onPointerCancel = (i) => {
|
|
450
|
+
this._cancel(i);
|
|
451
|
+
}, this._onLostPointerCapture = (i) => {
|
|
452
|
+
i.pointerId === this._pointerId && this._cancel(i);
|
|
453
|
+
}, this._options = {
|
|
454
|
+
axis: "both",
|
|
455
|
+
activation: "immediate",
|
|
456
|
+
activationDistance: 8,
|
|
457
|
+
axisLockRatio: 1.25,
|
|
458
|
+
velocityWindow: 100,
|
|
459
|
+
minVelocityDuration: 8,
|
|
460
|
+
capture: !1,
|
|
461
|
+
stopPropagation: !1,
|
|
462
|
+
preventDefault: !0,
|
|
463
|
+
focusOnStart: !1,
|
|
464
|
+
...e
|
|
465
|
+
}, t.addController(this);
|
|
466
|
+
}
|
|
467
|
+
/** Updates behavior or the target resolver and safely rebinds listeners. */
|
|
468
|
+
setOptions(t) {
|
|
469
|
+
Object.assign(this._options, t), this._bindTarget();
|
|
470
|
+
}
|
|
471
|
+
hostConnected() {
|
|
472
|
+
this._bindTarget();
|
|
473
|
+
}
|
|
474
|
+
hostUpdated() {
|
|
475
|
+
this._bindTarget();
|
|
476
|
+
}
|
|
477
|
+
hostDisconnected() {
|
|
478
|
+
this._unbindTarget();
|
|
479
|
+
}
|
|
480
|
+
_resolveTarget() {
|
|
481
|
+
const t = typeof this._options.target == "function" ? this._options.target() : this._options.target;
|
|
482
|
+
return t instanceof HTMLElement ? t : null;
|
|
483
|
+
}
|
|
484
|
+
_bindTarget() {
|
|
485
|
+
const t = this._resolveTarget();
|
|
486
|
+
t !== this._$target && (this._unbindTarget(), this._$target = t, this._$target?.addEventListener("pointerdown", this._onPointerDown, {
|
|
487
|
+
capture: this._options.capture
|
|
488
|
+
}));
|
|
489
|
+
}
|
|
490
|
+
_unbindTarget() {
|
|
491
|
+
this._$target && (this._$target.removeEventListener("pointerdown", this._onPointerDown, {
|
|
492
|
+
capture: this._options.capture
|
|
493
|
+
}), this._removeCycleListeners(this._$target), this._reset(), this._$target = null);
|
|
494
|
+
}
|
|
495
|
+
_resolveIntent(t) {
|
|
496
|
+
const e = t.clientX - this._startX, i = t.clientY - this._startY;
|
|
497
|
+
if (Math.hypot(e, i) < this._options.activationDistance)
|
|
498
|
+
return !1;
|
|
499
|
+
const { axis: n, axisLockRatio: r } = this._options, a = Math.abs(e), l = Math.abs(i);
|
|
500
|
+
return n === "x" && a < l * r || n === "y" && l < a * r ? (this._rejected = !0, this._finish(), !1) : (this._activate(t), !0);
|
|
501
|
+
}
|
|
502
|
+
_activate(t) {
|
|
503
|
+
const e = this._$target;
|
|
504
|
+
!e || this._activated || (this._activated = !0, this._capturePointer(e, t.pointerId), this._options.focusOnStart && e.focus(), this._options.stopPropagation && t.stopPropagation(), this._options.preventDefault && t.preventDefault(), this._options.onStart?.(this._detail(t)));
|
|
505
|
+
}
|
|
506
|
+
_cancel(t) {
|
|
507
|
+
t.pointerId === this._pointerId && (this._activated && this._options.onCancel?.(this._detail(t)), this._finish());
|
|
508
|
+
}
|
|
509
|
+
_finish() {
|
|
510
|
+
const t = this._$target, e = this._pointerId;
|
|
511
|
+
t && (this._removeCycleListeners(t), e !== null && this._releasePointer(t, e)), this._reset();
|
|
512
|
+
}
|
|
513
|
+
_removeCycleListeners(t) {
|
|
514
|
+
t.removeEventListener("pointermove", this._onPointerMove), t.removeEventListener("pointerup", this._onPointerUp), t.removeEventListener("pointercancel", this._onPointerCancel), t.removeEventListener("lostpointercapture", this._onLostPointerCapture);
|
|
515
|
+
}
|
|
516
|
+
_recordSample(t) {
|
|
517
|
+
this._samples.push({ x: t.clientX, y: t.clientY, time: t.timeStamp });
|
|
518
|
+
const e = t.timeStamp - this._options.velocityWindow;
|
|
519
|
+
for (; this._samples.length > 2 && this._samples[0].time < e; )
|
|
520
|
+
this._samples.shift();
|
|
521
|
+
}
|
|
522
|
+
_detail(t) {
|
|
523
|
+
const e = this._samples[0], i = this._samples.at(-1) ?? e, s = i.time - e.time, n = s >= this._options.minVelocityDuration;
|
|
524
|
+
return {
|
|
525
|
+
event: t,
|
|
526
|
+
pointerId: t.pointerId,
|
|
527
|
+
pointerType: t.pointerType,
|
|
528
|
+
startX: this._startX,
|
|
529
|
+
startY: this._startY,
|
|
530
|
+
x: t.clientX,
|
|
531
|
+
y: t.clientY,
|
|
532
|
+
deltaX: t.clientX - this._startX,
|
|
533
|
+
deltaY: t.clientY - this._startY,
|
|
534
|
+
duration: Math.max(0, t.timeStamp - this._startTime),
|
|
535
|
+
velocityX: n ? (i.x - e.x) / s * 1e3 : 0,
|
|
536
|
+
velocityY: n ? (i.y - e.y) / s * 1e3 : 0
|
|
537
|
+
};
|
|
538
|
+
}
|
|
539
|
+
_capturePointer(t, e) {
|
|
540
|
+
try {
|
|
541
|
+
t.setPointerCapture(e);
|
|
542
|
+
} catch (i) {
|
|
543
|
+
if (!(i instanceof DOMException) || i.name !== "NotFoundError")
|
|
544
|
+
throw i;
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
_releasePointer(t, e) {
|
|
548
|
+
try {
|
|
549
|
+
t.hasPointerCapture(e) && t.releasePointerCapture(e);
|
|
550
|
+
} catch {
|
|
551
|
+
}
|
|
552
|
+
}
|
|
553
|
+
_reset() {
|
|
554
|
+
this._pointerId = null, this._samples = [], this._activated = !1, this._rejected = !1;
|
|
555
|
+
}
|
|
556
|
+
}
|
|
437
557
|
class q {
|
|
438
558
|
constructor(t, e) {
|
|
439
|
-
this._dragging = !1, this.
|
|
559
|
+
this._dragging = !1, this._startLeft = 0, this._startTop = 0, this._opts = {
|
|
560
|
+
axis: "both",
|
|
561
|
+
step: 4,
|
|
562
|
+
disabled: !1,
|
|
563
|
+
handle: null,
|
|
564
|
+
bounds: "viewport",
|
|
565
|
+
...e
|
|
566
|
+
}, this._onKeyDown = this._handleKeyDown.bind(this), this._gesture = new E(t, {
|
|
567
|
+
target: () => this._handle(),
|
|
568
|
+
axis: this._opts.axis,
|
|
569
|
+
canStart: (i) => this._canStartGesture(i),
|
|
570
|
+
onStart: (i) => this._startDrag(i),
|
|
571
|
+
onMove: (i) => this._moveDrag(i),
|
|
572
|
+
onEnd: () => this._finishDrag(),
|
|
573
|
+
onCancel: () => this._finishDrag()
|
|
574
|
+
}), t.addController(this);
|
|
440
575
|
}
|
|
441
576
|
setOptions(t) {
|
|
442
577
|
const e = this._handle();
|
|
443
|
-
Object.assign(this._opts, t);
|
|
578
|
+
Object.assign(this._opts, t), this._gesture.setOptions({ axis: this._opts.axis, target: () => this._handle() });
|
|
444
579
|
const i = this._handle();
|
|
445
580
|
e !== i && (this._detachFrom(e), this._attachTo(i));
|
|
446
581
|
}
|
|
@@ -457,66 +592,63 @@ class q {
|
|
|
457
592
|
return this._opts.target;
|
|
458
593
|
}
|
|
459
594
|
_attachTo(t) {
|
|
460
|
-
t.addEventListener("
|
|
595
|
+
t.addEventListener("keydown", this._onKeyDown), t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0");
|
|
461
596
|
}
|
|
462
597
|
_detachFrom(t) {
|
|
463
|
-
t.removeEventListener("
|
|
464
|
-
}
|
|
465
|
-
_handlePointerDown(t) {
|
|
466
|
-
if (this._opts.disabled || t.target.closest('button, [role="button"], a')) return;
|
|
467
|
-
const e = this._target(), i = e.getBoundingClientRect();
|
|
468
|
-
getComputedStyle(e).position === "static" && (e.style.position = "fixed"), e.style.translate = "none", e.style.inset = "auto", e.style.margin = "0", e.style.left = `${i.left}px`, e.style.top = `${i.top}px`, this._startX = t.clientX, this._startY = t.clientY, this._startLeft = i.left, this._startTop = i.top, this._dragging = !0;
|
|
469
|
-
const s = this._handle();
|
|
470
|
-
s.setPointerCapture(t.pointerId), s.addEventListener("pointermove", this._onPointerMove), s.addEventListener("pointerup", this._onPointerUp), s.addEventListener("pointercancel", this._onPointerCancel), s.addEventListener("lostpointercapture", this._onLostPointerCapture), t.preventDefault();
|
|
598
|
+
t.removeEventListener("keydown", this._onKeyDown);
|
|
471
599
|
}
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
const e = this._target(), { axis: i } = this._opts, [s, n, o, a] = this._boundsRect(), l = i !== "y" ? Math.min(Math.max(this._startLeft + t.clientX - this._startX, s), o - e.offsetWidth) : parseFloat(e.style.left) || 0, c = i !== "x" ? Math.min(Math.max(this._startTop + t.clientY - this._startY, n), a - e.offsetHeight) : parseFloat(e.style.top) || 0;
|
|
475
|
-
e.style.left = `${l}px`, e.style.top = `${c}px`;
|
|
600
|
+
_canStartGesture(t) {
|
|
601
|
+
return this._opts.disabled ? !1 : !t.target.closest('button, [role="button"], a');
|
|
476
602
|
}
|
|
477
|
-
|
|
478
|
-
this.
|
|
603
|
+
_startDrag(t) {
|
|
604
|
+
const e = this._target(), i = e.getBoundingClientRect();
|
|
605
|
+
getComputedStyle(e).position === "static" && (e.style.position = "fixed"), e.style.translate = "none", e.style.inset = "auto", e.style.margin = "0", e.style.left = `${i.left}px`, e.style.top = `${i.top}px`, this._startLeft = i.left, this._startTop = i.top, this._dragging = !0;
|
|
479
606
|
}
|
|
480
|
-
|
|
481
|
-
this.
|
|
607
|
+
_moveDrag(t) {
|
|
608
|
+
if (!this._dragging)
|
|
609
|
+
return;
|
|
610
|
+
const e = this._target(), { axis: i } = this._opts, [s, n, r, a] = this._boundsRect(), l = i !== "y" ? Math.min(Math.max(this._startLeft + t.deltaX, s), r - e.offsetWidth) : parseFloat(e.style.left) || 0, _ = i !== "x" ? Math.min(Math.max(this._startTop + t.deltaY, n), a - e.offsetHeight) : parseFloat(e.style.top) || 0;
|
|
611
|
+
e.style.left = `${l}px`, e.style.top = `${_}px`;
|
|
482
612
|
}
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
this._dragging = !1;
|
|
486
|
-
const t = this._handle();
|
|
487
|
-
t.removeEventListener("pointermove", this._onPointerMove), t.removeEventListener("pointerup", this._onPointerUp), t.removeEventListener("pointercancel", this._onPointerCancel), t.removeEventListener("lostpointercapture", this._onLostPointerCapture);
|
|
613
|
+
_finishDrag() {
|
|
614
|
+
this._dragging && (this._dragging = !1);
|
|
488
615
|
}
|
|
489
616
|
_handleKeyDown(t) {
|
|
490
|
-
if (this._opts.disabled || t.currentTarget !== t.target)
|
|
617
|
+
if (this._opts.disabled || t.currentTarget !== t.target)
|
|
618
|
+
return;
|
|
491
619
|
const { axis: e } = this._opts, i = t.shiftKey ? this._opts.step * 10 : this._opts.step;
|
|
492
620
|
let s = 0, n = 0;
|
|
493
621
|
switch (t.key) {
|
|
494
622
|
case "ArrowLeft":
|
|
495
|
-
if (e === "y")
|
|
623
|
+
if (e === "y")
|
|
624
|
+
return;
|
|
496
625
|
s = -i;
|
|
497
626
|
break;
|
|
498
627
|
case "ArrowRight":
|
|
499
|
-
if (e === "y")
|
|
628
|
+
if (e === "y")
|
|
629
|
+
return;
|
|
500
630
|
s = i;
|
|
501
631
|
break;
|
|
502
632
|
case "ArrowUp":
|
|
503
|
-
if (e === "x")
|
|
633
|
+
if (e === "x")
|
|
634
|
+
return;
|
|
504
635
|
n = -i;
|
|
505
636
|
break;
|
|
506
637
|
case "ArrowDown":
|
|
507
|
-
if (e === "x")
|
|
638
|
+
if (e === "x")
|
|
639
|
+
return;
|
|
508
640
|
n = i;
|
|
509
641
|
break;
|
|
510
642
|
default:
|
|
511
643
|
return;
|
|
512
644
|
}
|
|
513
|
-
const
|
|
514
|
-
if (getComputedStyle(
|
|
515
|
-
const
|
|
516
|
-
|
|
645
|
+
const r = this._target();
|
|
646
|
+
if (getComputedStyle(r).position === "static") {
|
|
647
|
+
const c = r.getBoundingClientRect();
|
|
648
|
+
r.style.position = "fixed", r.style.translate = "none", r.style.left = `${c.left}px`, r.style.top = `${c.top}px`;
|
|
517
649
|
}
|
|
518
|
-
const [a, l,
|
|
519
|
-
|
|
650
|
+
const [a, l, _, h] = this._boundsRect(), u = parseFloat(r.style.left) || 0, d = parseFloat(r.style.top) || 0;
|
|
651
|
+
r.style.left = `${Math.min(Math.max(u + s, a), _ - r.offsetWidth)}px`, r.style.top = `${Math.min(Math.max(d + n, l), h - r.offsetHeight)}px`, t.preventDefault(), t.stopPropagation();
|
|
520
652
|
}
|
|
521
653
|
_boundsRect() {
|
|
522
654
|
const { bounds: t } = this._opts;
|
|
@@ -524,7 +656,8 @@ class q {
|
|
|
524
656
|
return [0, 0, window.innerWidth, window.innerHeight];
|
|
525
657
|
if (t === "parent") {
|
|
526
658
|
const i = this._opts.target.parentElement;
|
|
527
|
-
if (!i)
|
|
659
|
+
if (!i)
|
|
660
|
+
return [0, 0, window.innerWidth, window.innerHeight];
|
|
528
661
|
const s = i.getBoundingClientRect();
|
|
529
662
|
return [s.left, s.top, s.right, s.bottom];
|
|
530
663
|
}
|
|
@@ -532,9 +665,13 @@ class q {
|
|
|
532
665
|
return [e.left, e.top, e.right, e.bottom];
|
|
533
666
|
}
|
|
534
667
|
}
|
|
535
|
-
|
|
668
|
+
function P(o) {
|
|
669
|
+
const t = o.getBoundingClientRect();
|
|
670
|
+
return getComputedStyle(o).position === "static" && (o.style.position = "fixed"), o.style.translate = "none", o.style.inset = "auto", o.style.margin = "0", o.style.boxSizing = "border-box", o.style.left = `${t.left}px`, o.style.top = `${t.top}px`, o.style.width = `${t.width}px`, o.style.height = `${t.height}px`, t;
|
|
671
|
+
}
|
|
672
|
+
class U {
|
|
536
673
|
constructor(t, e) {
|
|
537
|
-
this._resizing = null, this.
|
|
674
|
+
this._resizing = null, this._startW = 0, this._startH = 0, this._startLeft = 0, this._startTop = 0, this._lastDeltaX = 0, this._lastDeltaY = 0, this._velocityX = 0, this._velocityY = 0, this._pendingEdge = null, this._effectiveMinW = 0, this._effectiveMinH = 0, this._effectiveMaxW = 1 / 0, this._effectiveMaxH = 1 / 0, this._cornerBtn = null, this._opts = {
|
|
538
675
|
direction: "none",
|
|
539
676
|
threshold: 8,
|
|
540
677
|
step: 4,
|
|
@@ -542,27 +679,57 @@ class G {
|
|
|
542
679
|
minWidth: 100,
|
|
543
680
|
minHeight: 60,
|
|
544
681
|
handle: null,
|
|
682
|
+
origin: "",
|
|
545
683
|
bounds: "viewport",
|
|
546
684
|
...e
|
|
547
|
-
}, this._onPointerMove = this._handlePointerMove.bind(this), this.
|
|
685
|
+
}, this._onPointerMove = this._handlePointerMove.bind(this), this._onPointerLeave = this._handlePointerLeave.bind(this), this._onKeyDown = this._handleKeyDown.bind(this), this._gesture = new E(t, {
|
|
686
|
+
target: () => this._handle() ?? this._target(),
|
|
687
|
+
capture: !0,
|
|
688
|
+
stopPropagation: !0,
|
|
689
|
+
canStart: (i) => this._canStartGesture(i),
|
|
690
|
+
onStart: (i) => this._startGestureResize(i),
|
|
691
|
+
onMove: (i) => this._moveGestureResize(i),
|
|
692
|
+
onEnd: (i) => this._endGestureResize(i),
|
|
693
|
+
onCancel: () => this._cancelResize()
|
|
694
|
+
}), t.addController(this);
|
|
548
695
|
}
|
|
549
696
|
setOptions(t) {
|
|
550
|
-
|
|
697
|
+
const e = this._opts.handle;
|
|
698
|
+
Object.assign(this._opts, t), this._gesture.setOptions({ target: () => this._handle() ?? this._target() }), e !== this._opts.handle && (this._detachFromHandle(e), this._attachToHandle(this._opts.handle));
|
|
551
699
|
}
|
|
552
700
|
hostConnected() {
|
|
553
|
-
if (this._opts.direction === "none")
|
|
701
|
+
if (this._opts.direction === "none")
|
|
702
|
+
return;
|
|
703
|
+
if (this._opts.handle) {
|
|
704
|
+
this._attachToHandle(this._opts.handle);
|
|
705
|
+
return;
|
|
706
|
+
}
|
|
554
707
|
const t = this._target();
|
|
555
|
-
t.addEventListener("pointermove", this._onPointerMove), t.addEventListener("
|
|
708
|
+
t.addEventListener("pointermove", this._onPointerMove), t.addEventListener("pointerleave", this._onPointerLeave), this._injectCornerButton();
|
|
556
709
|
}
|
|
557
710
|
hostDisconnected() {
|
|
711
|
+
if (this._opts.handle) {
|
|
712
|
+
this._detachFromHandle(this._opts.handle);
|
|
713
|
+
return;
|
|
714
|
+
}
|
|
558
715
|
const t = this._target();
|
|
559
|
-
t.removeEventListener("pointermove", this._onPointerMove), t.removeEventListener("
|
|
716
|
+
t.removeEventListener("pointermove", this._onPointerMove), t.removeEventListener("pointerleave", this._onPointerLeave), this._removeCornerButton();
|
|
560
717
|
}
|
|
561
718
|
_target() {
|
|
562
719
|
return this._opts.target;
|
|
563
720
|
}
|
|
721
|
+
_handle() {
|
|
722
|
+
return this._opts.handle;
|
|
723
|
+
}
|
|
724
|
+
_attachToHandle(t) {
|
|
725
|
+
!t || this._opts.direction === "none" || (t.addEventListener("keydown", this._onKeyDown), t.style.cursor = this._edgeCursor(this._handleEdge()), t.style.touchAction = "none", t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0"));
|
|
726
|
+
}
|
|
727
|
+
_detachFromHandle(t) {
|
|
728
|
+
t && t.removeEventListener("keydown", this._onKeyDown);
|
|
729
|
+
}
|
|
564
730
|
_injectCornerButton() {
|
|
565
|
-
if (this._opts.handle)
|
|
731
|
+
if (this._opts.handle)
|
|
732
|
+
return;
|
|
566
733
|
const t = this._target();
|
|
567
734
|
getComputedStyle(t).position === "static" && (t.style.position = "relative");
|
|
568
735
|
const e = document.createElement("button");
|
|
@@ -606,106 +773,226 @@ class G {
|
|
|
606
773
|
sw: "sw-resize"
|
|
607
774
|
}[t];
|
|
608
775
|
}
|
|
776
|
+
_handleEdge() {
|
|
777
|
+
return this._edgeForOrigin(this._opts.origin) ?? this._defaultHandleEdge();
|
|
778
|
+
}
|
|
779
|
+
_defaultHandleEdge() {
|
|
780
|
+
switch (this._opts.direction) {
|
|
781
|
+
case "both":
|
|
782
|
+
return "se";
|
|
783
|
+
case "horizontal":
|
|
784
|
+
return "e";
|
|
785
|
+
case "vertical":
|
|
786
|
+
return "s";
|
|
787
|
+
default:
|
|
788
|
+
return "se";
|
|
789
|
+
}
|
|
790
|
+
}
|
|
791
|
+
_edgeForOrigin(t) {
|
|
792
|
+
if (!t)
|
|
793
|
+
return null;
|
|
794
|
+
const e = t.includes("top"), i = t.includes("bottom"), s = t.includes("left"), n = t.includes("right");
|
|
795
|
+
if (this._opts.direction === "vertical")
|
|
796
|
+
return e ? "n" : i ? "s" : null;
|
|
797
|
+
if (this._opts.direction === "horizontal")
|
|
798
|
+
return s ? "w" : n ? "e" : null;
|
|
799
|
+
if (this._opts.direction === "both") {
|
|
800
|
+
if (e && s)
|
|
801
|
+
return "nw";
|
|
802
|
+
if (e && n)
|
|
803
|
+
return "ne";
|
|
804
|
+
if (i && s)
|
|
805
|
+
return "sw";
|
|
806
|
+
if (i && n)
|
|
807
|
+
return "se";
|
|
808
|
+
if (e)
|
|
809
|
+
return "n";
|
|
810
|
+
if (i)
|
|
811
|
+
return "s";
|
|
812
|
+
if (s)
|
|
813
|
+
return "w";
|
|
814
|
+
if (n)
|
|
815
|
+
return "e";
|
|
816
|
+
}
|
|
817
|
+
return null;
|
|
818
|
+
}
|
|
819
|
+
_edgeAllowsPointer(t, e) {
|
|
820
|
+
const { threshold: i } = this._opts, s = this._target().getBoundingClientRect(), n = e.clientX, r = e.clientY, a = n >= s.right - i && n <= s.right + i, l = n >= s.left - i && n <= s.left + i, _ = r >= s.bottom - i && r <= s.bottom + i, h = r >= s.top - i && r <= s.top + i, u = n >= s.left && n <= s.right, d = r >= s.top && r <= s.bottom;
|
|
821
|
+
switch (t) {
|
|
822
|
+
case "n":
|
|
823
|
+
return h && u;
|
|
824
|
+
case "s":
|
|
825
|
+
return _ && u;
|
|
826
|
+
case "e":
|
|
827
|
+
return a && d;
|
|
828
|
+
case "w":
|
|
829
|
+
return l && d;
|
|
830
|
+
case "ne":
|
|
831
|
+
return h && a;
|
|
832
|
+
case "nw":
|
|
833
|
+
return h && l;
|
|
834
|
+
case "se":
|
|
835
|
+
return _ && a;
|
|
836
|
+
case "sw":
|
|
837
|
+
return _ && l;
|
|
838
|
+
}
|
|
839
|
+
}
|
|
609
840
|
_detectEdge(t) {
|
|
610
841
|
const { direction: e, threshold: i } = this._opts;
|
|
611
|
-
if (e === "none")
|
|
612
|
-
|
|
842
|
+
if (e === "none")
|
|
843
|
+
return null;
|
|
844
|
+
const s = this._edgeForOrigin(this._opts.origin);
|
|
845
|
+
if (s)
|
|
846
|
+
return this._edgeAllowsPointer(s, t) ? s : null;
|
|
847
|
+
const n = this._target().getBoundingClientRect(), r = t.clientX, a = t.clientY, l = r >= n.right - i && r <= n.right + i, _ = r >= n.left - i && r <= n.left + i, h = a >= n.bottom - i && a <= n.bottom + i, u = a >= n.top - i && a <= n.top + i, d = r >= n.left && r <= n.right, c = a >= n.top && a <= n.bottom;
|
|
613
848
|
if (e === "both") {
|
|
614
|
-
if (
|
|
615
|
-
|
|
616
|
-
if (
|
|
617
|
-
|
|
618
|
-
if (
|
|
619
|
-
|
|
620
|
-
if (
|
|
621
|
-
|
|
849
|
+
if (l && h)
|
|
850
|
+
return "se";
|
|
851
|
+
if (_ && h)
|
|
852
|
+
return "sw";
|
|
853
|
+
if (l && u)
|
|
854
|
+
return "ne";
|
|
855
|
+
if (_ && u)
|
|
856
|
+
return "nw";
|
|
857
|
+
if (l && c)
|
|
858
|
+
return "e";
|
|
859
|
+
if (_ && c)
|
|
860
|
+
return "w";
|
|
861
|
+
if (h && d)
|
|
862
|
+
return "s";
|
|
863
|
+
if (u && d)
|
|
864
|
+
return "n";
|
|
622
865
|
}
|
|
623
866
|
if (e === "horizontal") {
|
|
624
|
-
if (
|
|
625
|
-
|
|
867
|
+
if (l && c)
|
|
868
|
+
return "e";
|
|
869
|
+
if (_ && c)
|
|
870
|
+
return "w";
|
|
626
871
|
}
|
|
627
872
|
if (e === "vertical") {
|
|
628
|
-
if (
|
|
629
|
-
|
|
873
|
+
if (h && d)
|
|
874
|
+
return "s";
|
|
875
|
+
if (u && d)
|
|
876
|
+
return "n";
|
|
630
877
|
}
|
|
631
878
|
return null;
|
|
632
879
|
}
|
|
880
|
+
_pinPosition(t) {
|
|
881
|
+
return P(t);
|
|
882
|
+
}
|
|
883
|
+
_canStartGesture(t) {
|
|
884
|
+
if (this._opts.disabled)
|
|
885
|
+
return !1;
|
|
886
|
+
const i = this._handle() ? this._handleEdge() : this._detectEdge(t);
|
|
887
|
+
return this._pendingEdge = i, i !== null;
|
|
888
|
+
}
|
|
889
|
+
_startGestureResize(t) {
|
|
890
|
+
this._pendingEdge && (this._velocityX = 0, this._velocityY = 0, this._startResize(this._pendingEdge));
|
|
891
|
+
}
|
|
892
|
+
_moveGestureResize(t) {
|
|
893
|
+
this._resizing && (this._lastDeltaX = t.deltaX, this._lastDeltaY = t.deltaY, this._velocityX = t.velocityX, this._velocityY = t.velocityY, this._applyDelta(this._resizing, t.deltaX, t.deltaY), this._opts.onResize?.(this._lifecycleDetail("pointer")));
|
|
894
|
+
}
|
|
895
|
+
_endGestureResize(t) {
|
|
896
|
+
this._velocityX = t.velocityX, this._velocityY = t.velocityY, this._finishResize("pointer");
|
|
897
|
+
}
|
|
898
|
+
_startResize(t) {
|
|
899
|
+
const e = this._target(), i = this._pinPosition(e);
|
|
900
|
+
this._startW = i.width, this._startH = i.height, this._startLeft = i.left, this._startTop = i.top, this._lastDeltaX = 0, this._lastDeltaY = 0, this._resizing = t, this._computeEffectiveExtents(e), this._opts.onResizeStart?.(this._lifecycleDetail("pointer"));
|
|
901
|
+
}
|
|
633
902
|
/**
|
|
634
|
-
*
|
|
635
|
-
*
|
|
636
|
-
*
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
* - Changing width/height alone doesn't redistribute auto-margins and shift
|
|
640
|
-
* the element for e/s edges.
|
|
641
|
-
* - box-sizing is known, so `style.width = rect.width` is a no-op visually.
|
|
903
|
+
* Computed once per resize gesture (pointer-down or keyboard step) so the
|
|
904
|
+
* browser's enforcement of CSS min/max-width/height doesn't fight the JS
|
|
905
|
+
* math — otherwise a CSS-only max (e.g. a themed `max-block-size`) clips
|
|
906
|
+
* the rendered box while the pinned edge keeps moving, making the whole
|
|
907
|
+
* element appear to slide once dragged past its extent.
|
|
642
908
|
*/
|
|
643
|
-
|
|
644
|
-
const e = t
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
const
|
|
655
|
-
|
|
909
|
+
_computeEffectiveExtents(t) {
|
|
910
|
+
const e = getComputedStyle(t);
|
|
911
|
+
this._effectiveMinW = Math.max(this._opts.minWidth, parseFloat(e.minWidth) || 0), this._effectiveMinH = Math.max(this._opts.minHeight, parseFloat(e.minHeight) || 0), this._effectiveMaxW = Math.min(
|
|
912
|
+
this._opts.maxWidth ?? 1 / 0,
|
|
913
|
+
parseFloat(e.maxWidth) || 1 / 0
|
|
914
|
+
), this._effectiveMaxH = Math.min(
|
|
915
|
+
this._opts.maxHeight ?? 1 / 0,
|
|
916
|
+
parseFloat(e.maxHeight) || 1 / 0
|
|
917
|
+
);
|
|
918
|
+
}
|
|
919
|
+
_lifecycleDetail(t) {
|
|
920
|
+
const e = this._target();
|
|
921
|
+
return {
|
|
922
|
+
edge: this._resizing ?? this._handleEdge(),
|
|
923
|
+
inputType: t,
|
|
924
|
+
startWidth: this._startW,
|
|
925
|
+
startHeight: this._startH,
|
|
926
|
+
width: e.getBoundingClientRect().width,
|
|
927
|
+
height: e.getBoundingClientRect().height,
|
|
928
|
+
deltaX: this._lastDeltaX,
|
|
929
|
+
deltaY: this._lastDeltaY,
|
|
930
|
+
velocityX: t === "pointer" ? this._velocityX : 0,
|
|
931
|
+
velocityY: t === "pointer" ? this._velocityY : 0
|
|
932
|
+
};
|
|
656
933
|
}
|
|
657
934
|
_handlePointerMove(t) {
|
|
658
|
-
if (this._resizing)
|
|
659
|
-
const s = this._target(), [n, o, a, l] = this._boundsRect(), { maxWidth: c, maxHeight: h } = this._opts, p = this._effectiveMinW, d = this._effectiveMinH, _ = t.clientX - this._startX, m = t.clientY - this._startY, u = this._resizing;
|
|
660
|
-
if (u === "e" || u === "se" || u === "ne") {
|
|
661
|
-
const f = Math.min(c ?? 1 / 0, a - this._startLeft);
|
|
662
|
-
s.style.width = `${Math.min(Math.max(this._startW + _, p), f)}px`;
|
|
663
|
-
}
|
|
664
|
-
if (u === "w" || u === "sw" || u === "nw") {
|
|
665
|
-
const f = this._startLeft + this._startW, g = Math.min(
|
|
666
|
-
Math.max(this._startLeft + _, n, c !== void 0 ? f - c : -1 / 0),
|
|
667
|
-
f - p
|
|
668
|
-
);
|
|
669
|
-
s.style.left = `${g}px`, s.style.width = `${f - g}px`;
|
|
670
|
-
}
|
|
671
|
-
if (u === "s" || u === "se" || u === "sw") {
|
|
672
|
-
const f = Math.min(h ?? 1 / 0, l - this._startTop);
|
|
673
|
-
s.style.height = `${Math.min(Math.max(this._startH + m, d), f)}px`;
|
|
674
|
-
}
|
|
675
|
-
if (u === "n" || u === "ne" || u === "nw") {
|
|
676
|
-
const f = this._startTop + this._startH, g = Math.min(
|
|
677
|
-
Math.max(this._startTop + m, o, h !== void 0 ? f - h : -1 / 0),
|
|
678
|
-
f - d
|
|
679
|
-
);
|
|
680
|
-
s.style.top = `${g}px`, s.style.height = `${f - g}px`;
|
|
681
|
-
}
|
|
935
|
+
if (this._resizing || this._opts.handle)
|
|
682
936
|
return;
|
|
683
|
-
}
|
|
684
|
-
if (this._opts.handle) return;
|
|
685
937
|
const e = this._detectEdge(t), i = this._target();
|
|
686
938
|
i.style.cursor = e ? this._edgeCursor(e) : "";
|
|
687
939
|
}
|
|
688
|
-
|
|
689
|
-
this._resizing
|
|
940
|
+
_finishResize(t) {
|
|
941
|
+
if (!this._resizing)
|
|
942
|
+
return;
|
|
943
|
+
const e = this._lifecycleDetail(t);
|
|
944
|
+
this._resizing = null, this._pendingEdge = null, this._opts.onResizeEnd?.(e);
|
|
945
|
+
}
|
|
946
|
+
_cancelResize() {
|
|
947
|
+
this._resizing = null, this._pendingEdge = null;
|
|
690
948
|
}
|
|
691
949
|
_handlePointerLeave(t) {
|
|
692
950
|
this._resizing || (this._target().style.cursor = "");
|
|
693
951
|
}
|
|
694
952
|
_handleKeyDown(t) {
|
|
695
|
-
if (this._opts.disabled)
|
|
953
|
+
if (this._opts.disabled)
|
|
954
|
+
return;
|
|
696
955
|
const { direction: e } = this._opts, i = t.key === "ArrowRight" || t.key === "ArrowLeft", s = t.key === "ArrowDown" || t.key === "ArrowUp";
|
|
697
|
-
if (i && e === "vertical" || s && e === "horizontal" || !i && !s)
|
|
956
|
+
if (i && e === "vertical" || s && e === "horizontal" || !i && !s)
|
|
957
|
+
return;
|
|
698
958
|
t.preventDefault(), t.stopPropagation();
|
|
699
|
-
const n = this._target(),
|
|
700
|
-
if (
|
|
701
|
-
|
|
702
|
-
|
|
959
|
+
const n = this._target(), r = this._pinPosition(n), a = this._keyboardEdge(t.key);
|
|
960
|
+
if (!a)
|
|
961
|
+
return;
|
|
962
|
+
this._resizing = a, this._startW = r.width, this._startH = r.height, this._startLeft = r.left, this._startTop = r.top;
|
|
963
|
+
const l = t.shiftKey ? this._opts.step * 10 : this._opts.step;
|
|
964
|
+
this._computeEffectiveExtents(n);
|
|
965
|
+
const _ = t.key === "ArrowRight" ? l : t.key === "ArrowLeft" ? -l : 0, h = t.key === "ArrowDown" ? l : t.key === "ArrowUp" ? -l : 0;
|
|
966
|
+
this._lastDeltaX = _, this._lastDeltaY = h, this._applyDelta(a, _, h), this._opts.onResize?.(this._lifecycleDetail("keyboard")), this._finishResize("keyboard");
|
|
967
|
+
}
|
|
968
|
+
_keyboardEdge(t) {
|
|
969
|
+
const e = this._edgeForOrigin(this._opts.origin);
|
|
970
|
+
return e || (t === "ArrowRight" || t === "ArrowLeft" ? this._opts.direction === "both" || this._opts.direction === "horizontal" ? "e" : null : (t === "ArrowDown" || t === "ArrowUp") && (this._opts.direction === "both" || this._opts.direction === "vertical") ? "s" : null);
|
|
971
|
+
}
|
|
972
|
+
_applyDelta(t, e, i) {
|
|
973
|
+
const s = this._target(), [n, r, a, l] = this._boundsRect(), _ = this._effectiveMinW, h = this._effectiveMinH, u = this._effectiveMaxW, d = this._effectiveMaxH;
|
|
974
|
+
if (t === "e" || t === "se" || t === "ne") {
|
|
975
|
+
const c = Math.min(u, a - this._startLeft);
|
|
976
|
+
s.style.width = `${Math.min(Math.max(this._startW + e, _), c)}px`;
|
|
703
977
|
}
|
|
704
|
-
if (t
|
|
705
|
-
const
|
|
706
|
-
|
|
978
|
+
if (t === "w" || t === "sw" || t === "nw") {
|
|
979
|
+
const c = this._startLeft + this._startW, p = Math.min(
|
|
980
|
+
Math.max(this._startLeft + e, n, c - u),
|
|
981
|
+
c - _
|
|
982
|
+
);
|
|
983
|
+
s.style.left = `${p}px`, s.style.width = `${c - p}px`;
|
|
984
|
+
}
|
|
985
|
+
if (t === "s" || t === "se" || t === "sw") {
|
|
986
|
+
const c = Math.min(d, l - this._startTop);
|
|
987
|
+
s.style.height = `${Math.min(Math.max(this._startH + i, h), c)}px`;
|
|
988
|
+
}
|
|
989
|
+
if (t === "n" || t === "ne" || t === "nw") {
|
|
990
|
+
const c = this._startTop + this._startH, p = Math.min(
|
|
991
|
+
Math.max(this._startTop + i, r, c - d),
|
|
992
|
+
c - h
|
|
993
|
+
);
|
|
994
|
+
s.style.top = `${p}px`, s.style.height = `${c - p}px`;
|
|
707
995
|
}
|
|
708
|
-
t.key === "ArrowUp" && (n.style.height = `${Math.max(n.offsetHeight - a, m)}px`);
|
|
709
996
|
}
|
|
710
997
|
_boundsRect() {
|
|
711
998
|
const { bounds: t } = this._opts;
|
|
@@ -713,7 +1000,8 @@ class G {
|
|
|
713
1000
|
return [0, 0, window.innerWidth, window.innerHeight];
|
|
714
1001
|
if (t === "parent") {
|
|
715
1002
|
const i = this._opts.target.parentElement;
|
|
716
|
-
if (!i)
|
|
1003
|
+
if (!i)
|
|
1004
|
+
return [0, 0, window.innerWidth, window.innerHeight];
|
|
717
1005
|
const s = i.getBoundingClientRect();
|
|
718
1006
|
return [s.left, s.top, s.right, s.bottom];
|
|
719
1007
|
}
|
|
@@ -721,9 +1009,9 @@ class G {
|
|
|
721
1009
|
return [e.left, e.top, e.right, e.bottom];
|
|
722
1010
|
}
|
|
723
1011
|
}
|
|
724
|
-
function
|
|
1012
|
+
function f(o, t) {
|
|
725
1013
|
const e = `${t}px`;
|
|
726
|
-
switch (
|
|
1014
|
+
switch (o) {
|
|
727
1015
|
case "top":
|
|
728
1016
|
return `position-area: top; margin-bottom: ${e};`;
|
|
729
1017
|
case "top-start":
|
|
@@ -750,7 +1038,7 @@ function v(r, t) {
|
|
|
750
1038
|
return `top: auto; bottom: anchor(bottom); left: anchor(right); right: auto; margin-left: ${e};`;
|
|
751
1039
|
}
|
|
752
1040
|
}
|
|
753
|
-
const
|
|
1041
|
+
const w = {
|
|
754
1042
|
top: "bottom",
|
|
755
1043
|
"top-start": "bottom-start",
|
|
756
1044
|
"top-end": "bottom-end",
|
|
@@ -776,15 +1064,15 @@ const L = {
|
|
|
776
1064
|
right: "right",
|
|
777
1065
|
"right-start": "right-end",
|
|
778
1066
|
"right-end": "right-start"
|
|
779
|
-
},
|
|
780
|
-
let
|
|
1067
|
+
}, L = CSS.supports("position-try-fallbacks: flip-block") && CSS.supports("min-width: anchor-size(width)");
|
|
1068
|
+
let x = null, m = null;
|
|
781
1069
|
function I() {
|
|
782
|
-
return
|
|
1070
|
+
return L ? Promise.resolve(null) : (m || (m = import("./css-anchor-positioning-fn-hFYJeBk4.js").then((o) => (x = o.default, x)).catch(() => null)), m);
|
|
783
1071
|
}
|
|
784
|
-
let
|
|
785
|
-
class
|
|
1072
|
+
let M = 0;
|
|
1073
|
+
class G {
|
|
786
1074
|
constructor(t, e) {
|
|
787
|
-
this._styleEl = null, this._adoptedSheet = null, this._opts = e, this._uid = `rc-anchor-${
|
|
1075
|
+
this._styleEl = null, this._adoptedSheet = null, this._opts = e, this._uid = `rc-anchor-${++M}`, t.addController(this);
|
|
788
1076
|
}
|
|
789
1077
|
setOptions(t) {
|
|
790
1078
|
Object.assign(this._opts, t), this._applyAndPolyfill();
|
|
@@ -812,7 +1100,7 @@ class J {
|
|
|
812
1100
|
return typeof t == "function" ? t() : t ?? null;
|
|
813
1101
|
}
|
|
814
1102
|
_applyAndPolyfill() {
|
|
815
|
-
this._apply(),
|
|
1103
|
+
this._apply(), L || this._applyPolyfillOrFallback();
|
|
816
1104
|
}
|
|
817
1105
|
async _applyPolyfillOrFallback() {
|
|
818
1106
|
const t = await I(), e = this._shadowHost();
|
|
@@ -825,24 +1113,24 @@ class J {
|
|
|
825
1113
|
}
|
|
826
1114
|
const t = this._anchor(), e = this._floating();
|
|
827
1115
|
if (!t || !e) return;
|
|
828
|
-
const i = this._opts.placement ?? "bottom-start", s = this._opts.offset ?? 4, n = this._opts.flip ?? !0,
|
|
829
|
-
t.style.setProperty("anchor-name",
|
|
830
|
-
const l =
|
|
831
|
-
@position-try --${a}-end { ${
|
|
832
|
-
@position-try --${a}-flip { ${
|
|
833
|
-
@position-try --${a}-both { ${
|
|
834
|
-
` : "", d = n ? `position-try-fallbacks: --${a}-end, --${a}-flip, --${a}-both;` : "",
|
|
835
|
-
${
|
|
1116
|
+
const i = this._opts.placement ?? "bottom-start", s = this._opts.offset ?? 4, n = this._opts.flip ?? !0, r = `--${this._uid}`, a = this._uid;
|
|
1117
|
+
t.style.setProperty("anchor-name", r), e.setAttribute("data-rc-anchor", a);
|
|
1118
|
+
const l = w[i], _ = S[i], h = w[_], u = n ? `
|
|
1119
|
+
@position-try --${a}-end { ${f(_, s)} }
|
|
1120
|
+
@position-try --${a}-flip { ${f(l, s)} }
|
|
1121
|
+
@position-try --${a}-both { ${f(h, s)} }
|
|
1122
|
+
` : "", d = n ? `position-try-fallbacks: --${a}-end, --${a}-flip, --${a}-both;` : "", c = `
|
|
1123
|
+
${u}
|
|
836
1124
|
[data-rc-anchor="${a}"] {
|
|
837
1125
|
position: fixed;
|
|
838
|
-
position-anchor: ${
|
|
1126
|
+
position-anchor: ${r};
|
|
839
1127
|
box-sizing: border-box;
|
|
840
1128
|
min-width: anchor-size(width);
|
|
841
|
-
${
|
|
1129
|
+
${f(i, s)}
|
|
842
1130
|
${d}
|
|
843
1131
|
}
|
|
844
1132
|
`;
|
|
845
|
-
this._injectStyles(
|
|
1133
|
+
this._injectStyles(c);
|
|
846
1134
|
}
|
|
847
1135
|
_injectStyles(t) {
|
|
848
1136
|
const e = this._shadowHost();
|
|
@@ -854,13 +1142,13 @@ class J {
|
|
|
854
1142
|
_positionFallback() {
|
|
855
1143
|
const t = this._anchor(), e = this._floating();
|
|
856
1144
|
if (!t || !e) return;
|
|
857
|
-
const i = this._opts.placement ?? "bottom-start", s = this._opts.offset ?? 4, n = t.getBoundingClientRect(),
|
|
1145
|
+
const i = this._opts.placement ?? "bottom-start", s = this._opts.offset ?? 4, n = t.getBoundingClientRect(), r = window.innerWidth, a = window.innerHeight;
|
|
858
1146
|
e.style.position = "fixed", e.style.boxSizing = "border-box", e.style.minWidth = `${n.width}px`;
|
|
859
|
-
const l = i.startsWith("bottom") || i === "bottom",
|
|
860
|
-
l &&
|
|
861
|
-
const
|
|
862
|
-
let
|
|
863
|
-
|
|
1147
|
+
const l = i.startsWith("bottom") || i === "bottom", _ = a - n.bottom;
|
|
1148
|
+
l && _ < 120 && n.top > _ ? (e.style.top = "", e.style.bottom = `${a - n.top + s}px`) : (e.style.bottom = "", e.style.top = `${n.bottom + s}px`);
|
|
1149
|
+
const u = i.endsWith("-end"), d = e.offsetWidth || parseFloat(getComputedStyle(e).minWidth) || 0;
|
|
1150
|
+
let c = u ? n.right - d : n.left;
|
|
1151
|
+
c + d > r - 4 && (c = n.right - d), c = Math.max(4, Math.min(c, r - d - 4)), e.style.left = `${c}px`;
|
|
864
1152
|
}
|
|
865
1153
|
_cleanup() {
|
|
866
1154
|
const t = this._anchor(), e = this._floating();
|
|
@@ -871,7 +1159,7 @@ class J {
|
|
|
871
1159
|
), this._adoptedSheet = null);
|
|
872
1160
|
}
|
|
873
1161
|
}
|
|
874
|
-
class
|
|
1162
|
+
class J {
|
|
875
1163
|
constructor(t, e) {
|
|
876
1164
|
this._attached = null, this._scrolled = !1, this._onScroll = () => this._evaluate(), this._host = t, this._opts = e, t.addController(this);
|
|
877
1165
|
}
|
|
@@ -913,7 +1201,7 @@ class Q {
|
|
|
913
1201
|
i !== this._scrolled && (this._scrolled = i, this._opts.onChange?.(i, t), this._host.requestUpdate());
|
|
914
1202
|
}
|
|
915
1203
|
}
|
|
916
|
-
class
|
|
1204
|
+
class Q {
|
|
917
1205
|
constructor(t, e) {
|
|
918
1206
|
this._attached = null, this._observer = null, this._options = e, t.addController(this);
|
|
919
1207
|
}
|
|
@@ -939,6 +1227,80 @@ class Z {
|
|
|
939
1227
|
this._observer?.disconnect(), this._attached = null;
|
|
940
1228
|
}
|
|
941
1229
|
}
|
|
1230
|
+
class Z {
|
|
1231
|
+
constructor(t, e) {
|
|
1232
|
+
this._frame = 0, this._links = [], this._host = t, this._options = e, t.addController(this);
|
|
1233
|
+
}
|
|
1234
|
+
hostConnected() {
|
|
1235
|
+
this.sync();
|
|
1236
|
+
}
|
|
1237
|
+
hostDisconnected() {
|
|
1238
|
+
this._mutationObserver?.disconnect(), this._resizeObserver?.disconnect(), this._mutationObserver = void 0, this._resizeObserver = void 0, this._frame && cancelAnimationFrame(this._frame), this._frame = 0;
|
|
1239
|
+
}
|
|
1240
|
+
sync() {
|
|
1241
|
+
this._collectLinks(), this._observeLinks(), this.update();
|
|
1242
|
+
}
|
|
1243
|
+
update() {
|
|
1244
|
+
this._frame && cancelAnimationFrame(this._frame), this._frame = requestAnimationFrame(() => {
|
|
1245
|
+
this._frame = 0, this._positionIndicator();
|
|
1246
|
+
});
|
|
1247
|
+
}
|
|
1248
|
+
_collectLinks() {
|
|
1249
|
+
const e = this._options.slot()?.assignedElements({ flatten: !0 }) ?? [], i = /* @__PURE__ */ new Set();
|
|
1250
|
+
for (const s of e)
|
|
1251
|
+
s instanceof HTMLAnchorElement && i.add(s), s.querySelectorAll("a").forEach((n) => i.add(n));
|
|
1252
|
+
this._links = Array.from(i);
|
|
1253
|
+
}
|
|
1254
|
+
_observeLinks() {
|
|
1255
|
+
this._mutationObserver?.disconnect(), this._resizeObserver?.disconnect(), this._mutationObserver = new MutationObserver(() => {
|
|
1256
|
+
this._collectLinks(), this._observeLinks(), this.update();
|
|
1257
|
+
}), this._resizeObserver = new ResizeObserver(() => this.update()), this._resizeObserver.observe(this._host);
|
|
1258
|
+
for (const t of this._links) {
|
|
1259
|
+
this._mutationObserver.observe(t, {
|
|
1260
|
+
attributes: !0,
|
|
1261
|
+
attributeFilter: ["aria-current", "class", "data-active"],
|
|
1262
|
+
childList: !0,
|
|
1263
|
+
subtree: !0
|
|
1264
|
+
}), this._resizeObserver.observe(t);
|
|
1265
|
+
const e = this._targetFor(t);
|
|
1266
|
+
e && e !== t && this._resizeObserver.observe(e);
|
|
1267
|
+
}
|
|
1268
|
+
}
|
|
1269
|
+
_activeLink() {
|
|
1270
|
+
const t = this._options.activeSelector().trim();
|
|
1271
|
+
if (t) {
|
|
1272
|
+
const e = this._links.find((i) => i.matches(t));
|
|
1273
|
+
if (e)
|
|
1274
|
+
return e;
|
|
1275
|
+
}
|
|
1276
|
+
return this._links.find((e) => {
|
|
1277
|
+
const i = e.getAttribute("aria-current");
|
|
1278
|
+
return i !== null && i !== "" && i !== "false";
|
|
1279
|
+
}) ?? null;
|
|
1280
|
+
}
|
|
1281
|
+
_targetFor(t) {
|
|
1282
|
+
const e = this._options.indicatorTargetSelector().trim();
|
|
1283
|
+
if (e) {
|
|
1284
|
+
const i = t.matches(e) ? t : t.querySelector(e);
|
|
1285
|
+
if (i)
|
|
1286
|
+
return i;
|
|
1287
|
+
}
|
|
1288
|
+
return t.querySelector("[data-rc-navigation-indicator]") ?? t.querySelector("[data-rc-navigation-icon]") ?? t;
|
|
1289
|
+
}
|
|
1290
|
+
_positionIndicator() {
|
|
1291
|
+
const t = this._options.container(), e = this._options.indicator(), i = this._activeLink();
|
|
1292
|
+
if (this._host.toggleAttribute("has-active", !!i), !t || !e || !i) {
|
|
1293
|
+
e?.toggleAttribute("hidden", !0);
|
|
1294
|
+
return;
|
|
1295
|
+
}
|
|
1296
|
+
const s = this._targetFor(i), n = t.getBoundingClientRect(), r = s.getBoundingClientRect();
|
|
1297
|
+
if (!r.width || !r.height) {
|
|
1298
|
+
e.toggleAttribute("hidden", !0);
|
|
1299
|
+
return;
|
|
1300
|
+
}
|
|
1301
|
+
e.toggleAttribute("hidden", !1), e.style.inlineSize = `${r.width}px`, e.style.blockSize = `${r.height}px`, e.style.transform = `translate(${r.left - n.left}px, ${r.top - n.top}px)`;
|
|
1302
|
+
}
|
|
1303
|
+
}
|
|
942
1304
|
class tt {
|
|
943
1305
|
constructor(t) {
|
|
944
1306
|
this._callback = null, this._frame = 0, t?.addController(this);
|
|
@@ -978,9 +1340,9 @@ class et {
|
|
|
978
1340
|
if (!e.length) return null;
|
|
979
1341
|
const i = this._options.startIndex?.() ?? 0, s = e.length;
|
|
980
1342
|
for (let n = 1; n <= s; n += 1) {
|
|
981
|
-
const
|
|
1343
|
+
const r = (i + n) % s, a = e[r];
|
|
982
1344
|
if (this._options.text(a).trim().toLocaleLowerCase().startsWith(this._buffer))
|
|
983
|
-
return this._options.onMatch(a,
|
|
1345
|
+
return this._options.onMatch(a, r), a;
|
|
984
1346
|
}
|
|
985
1347
|
return null;
|
|
986
1348
|
}
|
|
@@ -991,8 +1353,8 @@ class et {
|
|
|
991
1353
|
this._timer && (window.clearTimeout(this._timer), this._timer = 0);
|
|
992
1354
|
}
|
|
993
1355
|
}
|
|
994
|
-
function it(
|
|
995
|
-
let t =
|
|
1356
|
+
function it(o) {
|
|
1357
|
+
let t = o.parentElement;
|
|
996
1358
|
for (; t && t !== document.documentElement; ) {
|
|
997
1359
|
const { overflow: e, overflowY: i } = getComputedStyle(t);
|
|
998
1360
|
if (/auto|scroll/.test(i) || /auto|scroll/.test(e)) return t;
|
|
@@ -1000,19 +1362,19 @@ function it(r) {
|
|
|
1000
1362
|
}
|
|
1001
1363
|
return document.scrollingElement ?? document.documentElement;
|
|
1002
1364
|
}
|
|
1003
|
-
function
|
|
1004
|
-
return
|
|
1365
|
+
function z(o) {
|
|
1366
|
+
return o == null || o.hasAttribute("disabled") ? !1 : !!((o instanceof HTMLAnchorElement || o instanceof HTMLAreaElement) && o.hasAttribute("href") || o instanceof HTMLButtonElement || o instanceof HTMLInputElement || o instanceof HTMLTextAreaElement || o instanceof HTMLSelectElement || o.hasAttribute("tabindex") || o.shadowRoot?.delegatesFocus === !0);
|
|
1005
1367
|
}
|
|
1006
|
-
function
|
|
1007
|
-
return
|
|
1368
|
+
function $(o, t) {
|
|
1369
|
+
return o.querySelector(t);
|
|
1008
1370
|
}
|
|
1009
|
-
function
|
|
1010
|
-
return Array.from(
|
|
1371
|
+
function H(o, t) {
|
|
1372
|
+
return Array.from(o.querySelectorAll(t));
|
|
1011
1373
|
}
|
|
1012
|
-
function st(
|
|
1013
|
-
if (
|
|
1014
|
-
const e = t.hostName ??
|
|
1015
|
-
return console.warn(s,
|
|
1374
|
+
function st(o, t) {
|
|
1375
|
+
if (H(o, t.selector).length >= (t.minimum ?? 1)) return !1;
|
|
1376
|
+
const e = t.hostName ?? o.localName, i = t.childDescription ?? t.selector.replace(":scope > ", ""), s = t.message ?? `[${e}] No direct child ${i} found. Place ${i} inside <${e}>.`;
|
|
1377
|
+
return console.warn(s, o), !0;
|
|
1016
1378
|
}
|
|
1017
1379
|
class nt {
|
|
1018
1380
|
constructor(t, e) {
|
|
@@ -1032,22 +1394,22 @@ class nt {
|
|
|
1032
1394
|
}
|
|
1033
1395
|
/** Re-read the child from the host and invoke `onChange` when it changes. */
|
|
1034
1396
|
sync() {
|
|
1035
|
-
const t = this._child, e =
|
|
1397
|
+
const t = this._child, e = $(this._host, this._options.selector);
|
|
1036
1398
|
return this._child = e, e || this._options.onMissing?.(this._host), e !== t && this._options.onChange?.(e, t), e;
|
|
1037
1399
|
}
|
|
1038
1400
|
}
|
|
1039
|
-
var
|
|
1040
|
-
for (var s = void 0, n =
|
|
1041
|
-
(
|
|
1042
|
-
return s &&
|
|
1401
|
+
var F = Object.defineProperty, R = (o, t, e, i) => {
|
|
1402
|
+
for (var s = void 0, n = o.length - 1, r; n >= 0; n--)
|
|
1403
|
+
(r = o[n]) && (s = r(t, e, s) || s);
|
|
1404
|
+
return s && F(t, e, s), s;
|
|
1043
1405
|
};
|
|
1044
|
-
function ot(
|
|
1045
|
-
class t extends
|
|
1406
|
+
function ot(o) {
|
|
1407
|
+
class t extends o {
|
|
1046
1408
|
constructor() {
|
|
1047
1409
|
super(...arguments), this._items = [];
|
|
1048
1410
|
}
|
|
1049
1411
|
get items() {
|
|
1050
|
-
return this._items.map((i) => i.deref()).filter((i) =>
|
|
1412
|
+
return this._items.map((i) => i.deref()).filter((i) => z(i));
|
|
1051
1413
|
}
|
|
1052
1414
|
get firstItem() {
|
|
1053
1415
|
return this.items.at(0);
|
|
@@ -1114,38 +1476,64 @@ function ot(r) {
|
|
|
1114
1476
|
i && i.setAttribute("tabindex", "0");
|
|
1115
1477
|
}
|
|
1116
1478
|
}
|
|
1117
|
-
return
|
|
1118
|
-
|
|
1479
|
+
return R([
|
|
1480
|
+
A()
|
|
1119
1481
|
], t.prototype, "_lastFocused"), t;
|
|
1120
1482
|
}
|
|
1121
|
-
function rt(
|
|
1122
|
-
const s = Math.min(Math.max(
|
|
1483
|
+
function rt(o, t, e, i) {
|
|
1484
|
+
const s = Math.min(Math.max(o, t), e);
|
|
1123
1485
|
if (i <= 0) return s;
|
|
1124
1486
|
const n = Math.round((s - t) / i) * i + t;
|
|
1125
1487
|
return Math.min(Math.max(n, t), e);
|
|
1126
1488
|
}
|
|
1127
|
-
function at(
|
|
1128
|
-
return e === t ? 0 : Math.min(Math.max((
|
|
1489
|
+
function at(o, t, e) {
|
|
1490
|
+
return e === t ? 0 : Math.min(Math.max((o - t) / (e - t), 0), 1);
|
|
1491
|
+
}
|
|
1492
|
+
function ht(o, t) {
|
|
1493
|
+
let e = -1, i = 1 / 0;
|
|
1494
|
+
return o.forEach((s, n) => {
|
|
1495
|
+
const r = Math.abs(s - t);
|
|
1496
|
+
Number.isFinite(s) && r < i && (e = n, i = r);
|
|
1497
|
+
}), e;
|
|
1498
|
+
}
|
|
1499
|
+
function lt(o, t, e) {
|
|
1500
|
+
if (e > 0) {
|
|
1501
|
+
const i = o.findIndex((s) => Number.isFinite(s) && s > t);
|
|
1502
|
+
return i >= 0 ? i : o.length - 1;
|
|
1503
|
+
}
|
|
1504
|
+
for (let i = o.length - 1; i >= 0; i -= 1)
|
|
1505
|
+
if (Number.isFinite(o[i]) && o[i] < t)
|
|
1506
|
+
return i;
|
|
1507
|
+
return o.length > 0 ? 0 : -1;
|
|
1508
|
+
}
|
|
1509
|
+
function ct(o, t) {
|
|
1510
|
+
return o.length === 0 ? -1 : t > 0 ? o.length - 1 : 0;
|
|
1129
1511
|
}
|
|
1130
1512
|
export {
|
|
1131
|
-
|
|
1132
|
-
|
|
1513
|
+
X as ActiveDescendantController,
|
|
1514
|
+
G as AnchorController,
|
|
1133
1515
|
q as DragController,
|
|
1134
|
-
|
|
1135
|
-
|
|
1516
|
+
E as DragGestureController,
|
|
1517
|
+
N as ItemsCollectionController,
|
|
1518
|
+
Q as MutationObserverController,
|
|
1136
1519
|
nt as NativeChildController,
|
|
1520
|
+
Z as NavigationIndicatorController,
|
|
1137
1521
|
tt as RafScheduler,
|
|
1138
|
-
|
|
1522
|
+
U as ResizeController,
|
|
1139
1523
|
ot as RovingTabIndexMixin,
|
|
1140
|
-
|
|
1524
|
+
J as ScrollObserverController,
|
|
1141
1525
|
et as TypeaheadController,
|
|
1526
|
+
ct as findExtremeSnapIndex,
|
|
1142
1527
|
it as findNearestScrollAncestor,
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1528
|
+
ht as findNearestSnapIndex,
|
|
1529
|
+
lt as findNextSnapIndex,
|
|
1530
|
+
$ as getDirectChild,
|
|
1531
|
+
H as getDirectChildren,
|
|
1532
|
+
z as isFocusable,
|
|
1533
|
+
K as keyInteraction,
|
|
1534
|
+
V as keyNavigation,
|
|
1148
1535
|
j as mouseMove,
|
|
1536
|
+
P as pinElementBox,
|
|
1149
1537
|
rt as snapToStep,
|
|
1150
1538
|
at as valueToPercent,
|
|
1151
1539
|
st as warnMissingDirectChild
|