@surdeddd/bottom-sheet 0.10.0 → 0.12.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 +52 -35
- package/dist/{BottomSheetEngine-DzsIwD28.d.cts → BottomSheetEngine-D6oiEfZ4.d.cts} +1 -0
- package/dist/{BottomSheetEngine-DRjCU73e.d.ts → BottomSheetEngine-Dhy0X_e9.d.ts} +1 -0
- package/dist/element.cjs +250 -136
- package/dist/element.d.cts +1 -1
- package/dist/element.d.ts +1 -1
- package/dist/element.iife.global.js +2 -2
- package/dist/element.js +250 -136
- package/dist/index.cjs +257 -164
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +257 -164
- package/dist/integrations/formik.d.cts +1 -1
- package/dist/integrations/formik.d.ts +1 -1
- package/dist/integrations/react-hook-form.d.cts +1 -1
- package/dist/integrations/react-hook-form.d.ts +1 -1
- package/dist/overlay.cjs +161 -33
- package/dist/overlay.d.cts +1 -3
- package/dist/overlay.d.ts +1 -3
- package/dist/overlay.js +161 -33
- package/dist/preact.d.cts +1 -1
- package/dist/preact.d.ts +1 -1
- package/dist/qwik.cjs +240 -131
- package/dist/qwik.d.cts +2 -2
- package/dist/qwik.d.ts +2 -2
- package/dist/qwik.js +240 -131
- package/dist/react.cjs +257 -164
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +257 -164
- package/dist/solid.cjs +240 -131
- package/dist/solid.d.cts +1 -0
- package/dist/solid.d.ts +1 -0
- package/dist/solid.js +240 -131
- package/dist/solid.source.jsx +240 -131
- package/dist/svelte-core.cjs +240 -131
- package/dist/svelte-core.js +240 -131
- package/dist/svelte.cjs +252 -143
- package/dist/svelte.js +252 -143
- package/dist/vue.cjs +240 -131
- package/dist/vue.js +240 -131
- package/package.json +10 -8
package/dist/svelte.cjs
CHANGED
|
@@ -462,46 +462,202 @@ function notifyLinkedSheets(sheets, self) {
|
|
|
462
462
|
}
|
|
463
463
|
}
|
|
464
464
|
|
|
465
|
-
// src/core/features/
|
|
466
|
-
var
|
|
467
|
-
var
|
|
465
|
+
// src/core/features/history-coordinator.ts
|
|
466
|
+
var entries = [];
|
|
467
|
+
var subscribers = /* @__PURE__ */ new Set();
|
|
468
468
|
var suppress = 0;
|
|
469
|
-
var
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
469
|
+
var internalDepth = 0;
|
|
470
|
+
var pendingRebrand = null;
|
|
471
|
+
var listenerInstalled = false;
|
|
472
|
+
var patchInstalled = false;
|
|
473
|
+
var origPushState = null;
|
|
474
|
+
var origReplaceState = null;
|
|
475
|
+
var patchedPushState = null;
|
|
476
|
+
var patchedReplaceState = null;
|
|
477
|
+
var hasWindow = () => typeof window !== "undefined";
|
|
478
|
+
var hasHistory = () => typeof history !== "undefined";
|
|
479
|
+
var brandMarker = (surface) => ({
|
|
480
|
+
...surface.markerState(),
|
|
481
|
+
__bs: true
|
|
482
|
+
});
|
|
483
|
+
var runInternal = (fn) => {
|
|
484
|
+
internalDepth += 1;
|
|
485
|
+
try {
|
|
486
|
+
fn();
|
|
487
|
+
} finally {
|
|
488
|
+
internalDepth -= 1;
|
|
489
|
+
}
|
|
490
|
+
};
|
|
491
|
+
var notifyRouteChange = () => {
|
|
492
|
+
const snapshot = Array.from(subscribers);
|
|
493
|
+
for (const fn of snapshot) fn();
|
|
494
|
+
};
|
|
495
|
+
var ensureListener = () => {
|
|
496
|
+
if (listenerInstalled || !hasWindow()) return;
|
|
497
|
+
window.addEventListener("popstate", onPopState);
|
|
498
|
+
listenerInstalled = true;
|
|
499
|
+
};
|
|
500
|
+
var maybeTeardownListener = () => {
|
|
501
|
+
if (!listenerInstalled) return;
|
|
502
|
+
if (entries.length > 0 || subscribers.size > 0 || suppress > 0) return;
|
|
503
|
+
if (hasWindow()) window.removeEventListener("popstate", onPopState);
|
|
504
|
+
listenerInstalled = false;
|
|
505
|
+
};
|
|
506
|
+
var installPatch = () => {
|
|
507
|
+
if (patchInstalled || !hasHistory()) return;
|
|
508
|
+
origPushState = history.pushState;
|
|
509
|
+
origReplaceState = history.replaceState;
|
|
510
|
+
patchedPushState = function(...args) {
|
|
511
|
+
origPushState.apply(this, args);
|
|
512
|
+
if (internalDepth === 0) notifyRouteChange();
|
|
513
|
+
};
|
|
514
|
+
patchedReplaceState = function(...args) {
|
|
515
|
+
origReplaceState.apply(this, args);
|
|
516
|
+
if (internalDepth === 0) notifyRouteChange();
|
|
517
|
+
};
|
|
518
|
+
history.pushState = patchedPushState;
|
|
519
|
+
history.replaceState = patchedReplaceState;
|
|
520
|
+
patchInstalled = true;
|
|
521
|
+
};
|
|
522
|
+
var removePatch = () => {
|
|
523
|
+
if (!patchInstalled) return;
|
|
524
|
+
if (history.pushState === patchedPushState && origPushState) {
|
|
525
|
+
history.pushState = origPushState;
|
|
526
|
+
}
|
|
527
|
+
if (history.replaceState === patchedReplaceState && origReplaceState) {
|
|
528
|
+
history.replaceState = origReplaceState;
|
|
529
|
+
}
|
|
530
|
+
origPushState = null;
|
|
531
|
+
origReplaceState = null;
|
|
532
|
+
patchedPushState = null;
|
|
533
|
+
patchedReplaceState = null;
|
|
534
|
+
patchInstalled = false;
|
|
535
|
+
};
|
|
536
|
+
function onPopState() {
|
|
537
|
+
if (suppress > 0) {
|
|
538
|
+
suppress -= 1;
|
|
539
|
+
const rebrand = pendingRebrand;
|
|
540
|
+
pendingRebrand = null;
|
|
541
|
+
if (rebrand) rebrand();
|
|
542
|
+
maybeTeardownListener();
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
if (entries.length === 0) {
|
|
546
|
+
notifyRouteChange();
|
|
547
|
+
maybeTeardownListener();
|
|
548
|
+
return;
|
|
549
|
+
}
|
|
550
|
+
let target = null;
|
|
551
|
+
let targetIdx = -1;
|
|
552
|
+
for (let i = entries.length - 1; i >= 0; i -= 1) {
|
|
553
|
+
const entry = entries[i];
|
|
554
|
+
if (!entry.surface.isOpen()) continue;
|
|
555
|
+
if (!target) {
|
|
556
|
+
target = entry;
|
|
557
|
+
targetIdx = i;
|
|
476
558
|
}
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
if (!target) target = c;
|
|
482
|
-
if (c.isTop()) {
|
|
483
|
-
target = c;
|
|
484
|
-
break;
|
|
485
|
-
}
|
|
559
|
+
if (entry.surface.isTop()) {
|
|
560
|
+
target = entry;
|
|
561
|
+
targetIdx = i;
|
|
562
|
+
break;
|
|
486
563
|
}
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
const
|
|
490
|
-
if (
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
564
|
+
}
|
|
565
|
+
if (!target) {
|
|
566
|
+
const removed = entries.pop();
|
|
567
|
+
if (removed) removed.live = false;
|
|
568
|
+
maybeTeardownListener();
|
|
569
|
+
return;
|
|
570
|
+
}
|
|
571
|
+
target.live = false;
|
|
572
|
+
entries.splice(targetIdx, 1);
|
|
573
|
+
const settled = target;
|
|
574
|
+
void Promise.resolve(settled.surface.close()).then(() => {
|
|
575
|
+
if (settled.surface.isOpen()) restore(settled);
|
|
495
576
|
});
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
577
|
+
maybeTeardownListener();
|
|
578
|
+
}
|
|
579
|
+
function restore(entry) {
|
|
580
|
+
if (!hasWindow() || !hasHistory()) return;
|
|
581
|
+
entry.live = true;
|
|
582
|
+
runInternal(() => {
|
|
583
|
+
try {
|
|
584
|
+
history.pushState(brandMarker(entry.surface), "", entry.surface.url);
|
|
585
|
+
} catch {
|
|
586
|
+
entry.live = false;
|
|
587
|
+
}
|
|
588
|
+
});
|
|
589
|
+
if (entry.live) {
|
|
590
|
+
entries.push(entry);
|
|
591
|
+
ensureListener();
|
|
503
592
|
}
|
|
504
|
-
}
|
|
593
|
+
}
|
|
594
|
+
function pushBackMarker(surface) {
|
|
595
|
+
const entry = { surface, priorUrl: void 0, live: false };
|
|
596
|
+
if (!hasWindow() || !hasHistory()) {
|
|
597
|
+
return entry;
|
|
598
|
+
}
|
|
599
|
+
entry.priorUrl = surface.url !== void 0 ? location.href : void 0;
|
|
600
|
+
runInternal(() => {
|
|
601
|
+
try {
|
|
602
|
+
history.pushState(brandMarker(surface), "", surface.url);
|
|
603
|
+
entry.live = true;
|
|
604
|
+
} catch {
|
|
605
|
+
entry.live = false;
|
|
606
|
+
}
|
|
607
|
+
});
|
|
608
|
+
if (entry.live) {
|
|
609
|
+
entries.push(entry);
|
|
610
|
+
ensureListener();
|
|
611
|
+
}
|
|
612
|
+
return entry;
|
|
613
|
+
}
|
|
614
|
+
function popBackMarker(handle) {
|
|
615
|
+
if (!hasWindow() || !hasHistory()) return;
|
|
616
|
+
const entry = handle;
|
|
617
|
+
const idx = entries.indexOf(entry);
|
|
618
|
+
if (idx === -1 || !entry.live) return;
|
|
619
|
+
const last = entries.length - 1;
|
|
620
|
+
entry.live = false;
|
|
621
|
+
entries.splice(idx, 1);
|
|
622
|
+
if (idx !== last) {
|
|
623
|
+
const rebrandSurface = entries[entries.length - 1].surface;
|
|
624
|
+
const rebrandUrl = entry.priorUrl;
|
|
625
|
+
pendingRebrand = () => {
|
|
626
|
+
runInternal(() => {
|
|
627
|
+
history.replaceState(
|
|
628
|
+
brandMarker(rebrandSurface),
|
|
629
|
+
"",
|
|
630
|
+
rebrandUrl !== void 0 ? rebrandUrl : location.href
|
|
631
|
+
);
|
|
632
|
+
});
|
|
633
|
+
};
|
|
634
|
+
}
|
|
635
|
+
suppress += 1;
|
|
636
|
+
runInternal(() => {
|
|
637
|
+
try {
|
|
638
|
+
history.back();
|
|
639
|
+
} catch {
|
|
640
|
+
suppress = Math.max(0, suppress - 1);
|
|
641
|
+
pendingRebrand = null;
|
|
642
|
+
}
|
|
643
|
+
});
|
|
644
|
+
maybeTeardownListener();
|
|
645
|
+
}
|
|
646
|
+
function subscribeRouteChange(fn) {
|
|
647
|
+
if (!hasWindow() || !hasHistory()) return () => {
|
|
648
|
+
};
|
|
649
|
+
subscribers.add(fn);
|
|
650
|
+
if (subscribers.size === 1) installPatch();
|
|
651
|
+
ensureListener();
|
|
652
|
+
return () => {
|
|
653
|
+
if (!subscribers.has(fn)) return;
|
|
654
|
+
subscribers.delete(fn);
|
|
655
|
+
if (subscribers.size === 0) removePatch();
|
|
656
|
+
maybeTeardownListener();
|
|
657
|
+
};
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
// src/core/features/route.ts
|
|
505
661
|
function installRoute(deps) {
|
|
506
662
|
if (typeof window === "undefined") {
|
|
507
663
|
return () => {
|
|
@@ -511,92 +667,39 @@ function installRoute(deps) {
|
|
|
511
667
|
return () => {
|
|
512
668
|
};
|
|
513
669
|
}
|
|
514
|
-
let
|
|
515
|
-
let closer = null;
|
|
516
|
-
const teardownEntry = () => {
|
|
517
|
-
if (closer) {
|
|
518
|
-
const idx = closers.indexOf(closer);
|
|
519
|
-
if (idx !== -1) closers.splice(idx, 1);
|
|
520
|
-
}
|
|
521
|
-
const wasConsumed = closer?.consumed ?? false;
|
|
522
|
-
closer = null;
|
|
523
|
-
if (pushed && !wasConsumed) {
|
|
524
|
-
pushed = false;
|
|
525
|
-
programmaticBack();
|
|
526
|
-
} else {
|
|
527
|
-
pushed = false;
|
|
528
|
-
}
|
|
529
|
-
};
|
|
530
|
-
const pushEntry = () => {
|
|
531
|
-
try {
|
|
532
|
-
if (deps.routedTo !== void 0) {
|
|
533
|
-
history.pushState({ __bsRouted: deps.sheetId }, "", deps.routedTo);
|
|
534
|
-
} else {
|
|
535
|
-
history.pushState({ __bsSheet: deps.sheetId }, "");
|
|
536
|
-
}
|
|
537
|
-
pushed = true;
|
|
538
|
-
} catch {
|
|
539
|
-
pushed = false;
|
|
540
|
-
}
|
|
541
|
-
};
|
|
670
|
+
let handle = null;
|
|
542
671
|
const onOpen = () => {
|
|
543
|
-
if (
|
|
544
|
-
|
|
672
|
+
if (handle) return;
|
|
673
|
+
handle = pushBackMarker({
|
|
545
674
|
isOpen: () => !deps.isDestroyed() && deps.getSize() > 0,
|
|
546
|
-
isTop:
|
|
547
|
-
close:
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
closer = self;
|
|
557
|
-
ensureHandler();
|
|
558
|
-
closers.push(self);
|
|
559
|
-
pushEntry();
|
|
675
|
+
isTop: deps.isTopSheet,
|
|
676
|
+
close: deps.close,
|
|
677
|
+
markerState: () => deps.routedTo !== void 0 ? { __bsRouted: deps.sheetId } : { __bsSheet: deps.sheetId },
|
|
678
|
+
url: deps.routedTo
|
|
679
|
+
});
|
|
680
|
+
};
|
|
681
|
+
const onClose = () => {
|
|
682
|
+
if (!handle) return;
|
|
683
|
+
popBackMarker(handle);
|
|
684
|
+
handle = null;
|
|
560
685
|
};
|
|
561
686
|
const unsubscribeOpen = deps.on("open", onOpen);
|
|
562
|
-
const unsubscribeClose = deps.on("close",
|
|
687
|
+
const unsubscribeClose = deps.on("close", onClose);
|
|
563
688
|
if (deps.getSize() > 0) onOpen();
|
|
564
689
|
return () => {
|
|
565
690
|
unsubscribeOpen();
|
|
566
691
|
unsubscribeClose();
|
|
567
|
-
|
|
692
|
+
if (handle) {
|
|
693
|
+
popBackMarker(handle);
|
|
694
|
+
handle = null;
|
|
695
|
+
}
|
|
568
696
|
};
|
|
569
697
|
}
|
|
570
698
|
function installRouteChange(deps) {
|
|
571
|
-
|
|
572
|
-
return () => {
|
|
573
|
-
};
|
|
574
|
-
}
|
|
575
|
-
const onChange = () => {
|
|
699
|
+
return subscribeRouteChange(() => {
|
|
576
700
|
if (deps.isDestroyed() || deps.getSize() <= 0) return;
|
|
577
701
|
void deps.close();
|
|
578
|
-
};
|
|
579
|
-
const wrap = (key) => {
|
|
580
|
-
const original = history[key];
|
|
581
|
-
const patched = function(...args) {
|
|
582
|
-
original.apply(this, args);
|
|
583
|
-
onChange();
|
|
584
|
-
};
|
|
585
|
-
history[key] = patched;
|
|
586
|
-
return () => {
|
|
587
|
-
if (history[key] === patched) {
|
|
588
|
-
history[key] = original;
|
|
589
|
-
}
|
|
590
|
-
};
|
|
591
|
-
};
|
|
592
|
-
window.addEventListener("popstate", onChange);
|
|
593
|
-
const restorePush = wrap("pushState");
|
|
594
|
-
const restoreReplace = wrap("replaceState");
|
|
595
|
-
return () => {
|
|
596
|
-
window.removeEventListener("popstate", onChange);
|
|
597
|
-
restorePush();
|
|
598
|
-
restoreReplace();
|
|
599
|
-
};
|
|
702
|
+
});
|
|
600
703
|
}
|
|
601
704
|
|
|
602
705
|
// src/core/features/content-swipe.ts
|
|
@@ -866,11 +969,15 @@ function createMaxHeightController(deps) {
|
|
|
866
969
|
|
|
867
970
|
// src/core/features/fit-measurement.ts
|
|
868
971
|
var measureSheetNatural = (element, content, vertical) => {
|
|
869
|
-
if (!content) {
|
|
870
|
-
return vertical ? element.offsetHeight : element.offsetWidth;
|
|
871
|
-
}
|
|
872
972
|
const axis = vertical ? "height" : "width";
|
|
873
973
|
const sheetStyle = element.style;
|
|
974
|
+
if (!content) {
|
|
975
|
+
const prev = sheetStyle[axis];
|
|
976
|
+
sheetStyle[axis] = "auto";
|
|
977
|
+
const poked2 = vertical ? element.offsetHeight : element.offsetWidth;
|
|
978
|
+
sheetStyle[axis] = prev;
|
|
979
|
+
return poked2;
|
|
980
|
+
}
|
|
874
981
|
const cs = content.style;
|
|
875
982
|
const prevSheet = sheetStyle[axis];
|
|
876
983
|
const prevFlex = cs.flex;
|
|
@@ -2449,7 +2556,7 @@ var matchesRange = (def, progress) => {
|
|
|
2449
2556
|
};
|
|
2450
2557
|
function installScrimStages(deps, opts) {
|
|
2451
2558
|
const doc = deps.host.ownerDocument;
|
|
2452
|
-
const
|
|
2559
|
+
const entries2 = opts.stages.map((def) => {
|
|
2453
2560
|
const wrapper = doc.createElement("div");
|
|
2454
2561
|
wrapper.className = "bs-scrim-stage";
|
|
2455
2562
|
const ws = wrapper.style;
|
|
@@ -2470,9 +2577,9 @@ function installScrimStages(deps, opts) {
|
|
|
2470
2577
|
const resolveActive = () => {
|
|
2471
2578
|
const state2 = deps.getState();
|
|
2472
2579
|
if (state2.size === 0) {
|
|
2473
|
-
return
|
|
2580
|
+
return entries2.find((e) => matchesId(e.def, state2.activeId)) ?? null;
|
|
2474
2581
|
}
|
|
2475
|
-
return
|
|
2582
|
+
return entries2.find((e) => matchesId(e.def, state2.activeId)) ?? entries2.find((e) => matchesRange(e.def, state2.progress)) ?? null;
|
|
2476
2583
|
};
|
|
2477
2584
|
const hide = (entry, animate) => {
|
|
2478
2585
|
entry.inFlight?.cancel();
|
|
@@ -2521,13 +2628,13 @@ function installScrimStages(deps, opts) {
|
|
|
2521
2628
|
deps.on("open", () => update(true)),
|
|
2522
2629
|
deps.on("close", () => update(true))
|
|
2523
2630
|
];
|
|
2524
|
-
if (
|
|
2631
|
+
if (entries2.some((e) => e.def.forRange)) {
|
|
2525
2632
|
offs.push(deps.on("progress", () => update(true)));
|
|
2526
2633
|
}
|
|
2527
2634
|
update(false);
|
|
2528
2635
|
return () => {
|
|
2529
2636
|
offs.forEach((off) => off());
|
|
2530
|
-
for (const entry of
|
|
2637
|
+
for (const entry of entries2) {
|
|
2531
2638
|
entry.inFlight?.cancel();
|
|
2532
2639
|
entry.inFlight = null;
|
|
2533
2640
|
if (entry.wrapper.parentNode) {
|
|
@@ -2786,17 +2893,12 @@ var BottomSheetEngine = class {
|
|
|
2786
2893
|
this.attach();
|
|
2787
2894
|
this.registerInStack();
|
|
2788
2895
|
if (this.snaps.getMaxAxisSize() === 0 && typeof IntersectionObserver !== "undefined" && typeof document !== "undefined") {
|
|
2789
|
-
const io = new IntersectionObserver((
|
|
2790
|
-
for (const entry of
|
|
2896
|
+
const io = new IntersectionObserver((entries2) => {
|
|
2897
|
+
for (const entry of entries2) {
|
|
2791
2898
|
if (!entry.isIntersecting) continue;
|
|
2792
2899
|
if (this.destroyed) return;
|
|
2793
2900
|
this.snaps.recompute();
|
|
2794
|
-
|
|
2795
|
-
if (current) {
|
|
2796
|
-
this.size = current.size;
|
|
2797
|
-
this.applySize(this.size);
|
|
2798
|
-
this.updateAriaSlider();
|
|
2799
|
-
}
|
|
2901
|
+
this.healActiveSnap();
|
|
2800
2902
|
io.disconnect();
|
|
2801
2903
|
return;
|
|
2802
2904
|
}
|
|
@@ -2960,6 +3062,8 @@ var BottomSheetEngine = class {
|
|
|
2960
3062
|
const vt = document.startViewTransition(() => {
|
|
2961
3063
|
this.applySize(target.size);
|
|
2962
3064
|
});
|
|
3065
|
+
vt.ready?.catch(() => {
|
|
3066
|
+
});
|
|
2963
3067
|
this.currentViewTransition = vt;
|
|
2964
3068
|
try {
|
|
2965
3069
|
await vt.finished;
|
|
@@ -3211,11 +3315,16 @@ var BottomSheetEngine = class {
|
|
|
3211
3315
|
this.maxHeight.clampTo();
|
|
3212
3316
|
this.scrim.invalidateOpacityCache();
|
|
3213
3317
|
if (this.gesture?.isDragging) return;
|
|
3318
|
+
this.healActiveSnap();
|
|
3319
|
+
}
|
|
3320
|
+
healActiveSnap() {
|
|
3214
3321
|
const current = this.snaps.findById(this.activeId);
|
|
3215
|
-
if (current)
|
|
3216
|
-
|
|
3217
|
-
|
|
3218
|
-
|
|
3322
|
+
if (!current) return;
|
|
3323
|
+
this.size = current.size;
|
|
3324
|
+
this.applySize(this.size);
|
|
3325
|
+
this.updateAriaSlider();
|
|
3326
|
+
if (this.size > 0 && !this.lifecycle.isInstalled && !this.opening && !this.animation.isAnimating) {
|
|
3327
|
+
this.emitOpenSequence(this.activeId);
|
|
3219
3328
|
}
|
|
3220
3329
|
}
|
|
3221
3330
|
destroy() {
|
|
@@ -3504,9 +3613,9 @@ var BottomSheetEngine = class {
|
|
|
3504
3613
|
return;
|
|
3505
3614
|
}
|
|
3506
3615
|
if (this.emitBeforeSnap(target, previousId)) {
|
|
3507
|
-
const
|
|
3508
|
-
if (
|
|
3509
|
-
void this.animation.animateTo(
|
|
3616
|
+
const restore2 = this.snaps.findById(previousId);
|
|
3617
|
+
if (restore2) {
|
|
3618
|
+
void this.animation.animateTo(restore2.size, 0);
|
|
3510
3619
|
}
|
|
3511
3620
|
return;
|
|
3512
3621
|
}
|
|
@@ -3744,12 +3853,12 @@ function createBottomSheet(opts) {
|
|
|
3744
3853
|
getEngine: () => engine
|
|
3745
3854
|
};
|
|
3746
3855
|
}
|
|
3747
|
-
var
|
|
3748
|
-
var
|
|
3749
|
-
var
|
|
3750
|
-
var
|
|
3751
|
-
var
|
|
3752
|
-
var
|
|
3856
|
+
var root = $2__namespace.from_html(`<div class="bs-backdrop" aria-hidden="true"></div>`);
|
|
3857
|
+
var root_1 = $2__namespace.from_html(`<div class="bs-header"><!></div>`);
|
|
3858
|
+
var root_2 = $2__namespace.from_html(`<div class="bs-footer"><!></div>`);
|
|
3859
|
+
var root_3 = $2__namespace.from_html(`<div class="bs-button-slot" data-side="left"><!></div>`);
|
|
3860
|
+
var root_4 = $2__namespace.from_html(`<div class="bs-button-slot" data-side="right"><!></div>`);
|
|
3861
|
+
var root_5 = $2__namespace.from_html(`<div class="bs-root"><!> <div class="bs-screen"><!></div> <section class="bs-sheet" role="dialog"><div class="bs-handle" role="slider" tabindex="0" aria-label="Resize sheet" aria-valuemin="0" aria-valuemax="0" aria-valuenow="0"></div> <!> <div class="bs-content" tabindex="0" role="region" aria-label="Sheet content"><!></div> <!> <span class="bs-sr-only" role="status" aria-live="polite"> </span></section> <!> <!></div>`);
|
|
3753
3862
|
function BottomSheet($$anchor, $$props) {
|
|
3754
3863
|
$2__namespace.push($$props, true);
|
|
3755
3864
|
let mode = $2__namespace.prop($$props, "mode", 3, "bottom"), animation = $2__namespace.prop($$props, "animation", 3, "spring"), focusTrap = $2__namespace.prop($$props, "focusTrap", 3, false), closeOnEscape = $2__namespace.prop($$props, "closeOnEscape", 3, true), closeOnBack = $2__namespace.prop($$props, "closeOnBack", 3, false), lockBodyScroll2 = $2__namespace.prop($$props, "lockBodyScroll", 3, true), rubberBand2 = $2__namespace.prop($$props, "rubberBand", 3, true), backdrop = $2__namespace.prop($$props, "backdrop", 3, true), closeOnBackdrop = $2__namespace.prop($$props, "closeOnBackdrop", 3, true), persistent = $2__namespace.prop($$props, "persistent", 3, false), disableClose = $2__namespace.prop($$props, "disableClose", 3, false), disableDrag = $2__namespace.prop($$props, "disableDrag", 3, false), closeOnRouteChange = $2__namespace.prop($$props, "closeOnRouteChange", 3, false), stackEffect = $2__namespace.prop($$props, "stackEffect", 3, false), teleport = $2__namespace.prop($$props, "teleport", 3, false), openProp = $2__namespace.prop($$props, "open", 15), snap = $2__namespace.prop($$props, "snap", 15), ariaLabel = $2__namespace.prop($$props, "ariaLabel", 3, "Bottom sheet");
|
|
@@ -3931,11 +4040,11 @@ function BottomSheet($$anchor, $$props) {
|
|
|
3931
4040
|
getState,
|
|
3932
4041
|
getEngine
|
|
3933
4042
|
};
|
|
3934
|
-
var div =
|
|
4043
|
+
var div = root_5();
|
|
3935
4044
|
var node = $2__namespace.child(div);
|
|
3936
4045
|
{
|
|
3937
4046
|
var consequent = ($$anchor2) => {
|
|
3938
|
-
var div_1 =
|
|
4047
|
+
var div_1 = root();
|
|
3939
4048
|
$2__namespace.bind_this(div_1, ($$value) => $2__namespace.set(backdropEl, $$value), () => $2__namespace.get(backdropEl));
|
|
3940
4049
|
$2__namespace.delegated("click", div_1, function(...$$args) {
|
|
3941
4050
|
(closeOnBackdrop() ? () => {
|
|
@@ -3969,7 +4078,7 @@ function BottomSheet($$anchor, $$props) {
|
|
|
3969
4078
|
var node_3 = $2__namespace.sibling(div_3, 2);
|
|
3970
4079
|
{
|
|
3971
4080
|
var consequent_2 = ($$anchor2) => {
|
|
3972
|
-
var div_4 =
|
|
4081
|
+
var div_4 = root_1();
|
|
3973
4082
|
var node_4 = $2__namespace.child(div_4);
|
|
3974
4083
|
$2__namespace.snippet(node_4, () => $$props.header, () => $2__namespace.get(viewState));
|
|
3975
4084
|
$2__namespace.reset(div_4);
|
|
@@ -3997,7 +4106,7 @@ function BottomSheet($$anchor, $$props) {
|
|
|
3997
4106
|
var node_7 = $2__namespace.sibling(div_5, 2);
|
|
3998
4107
|
{
|
|
3999
4108
|
var consequent_4 = ($$anchor2) => {
|
|
4000
|
-
var div_6 =
|
|
4109
|
+
var div_6 = root_2();
|
|
4001
4110
|
var node_8 = $2__namespace.child(div_6);
|
|
4002
4111
|
$2__namespace.snippet(node_8, () => $$props.footer, () => $2__namespace.get(viewState));
|
|
4003
4112
|
$2__namespace.reset(div_6);
|
|
@@ -4015,7 +4124,7 @@ function BottomSheet($$anchor, $$props) {
|
|
|
4015
4124
|
var node_9 = $2__namespace.sibling(section, 2);
|
|
4016
4125
|
{
|
|
4017
4126
|
var consequent_5 = ($$anchor2) => {
|
|
4018
|
-
var div_7 =
|
|
4127
|
+
var div_7 = root_3();
|
|
4019
4128
|
var node_10 = $2__namespace.child(div_7);
|
|
4020
4129
|
$2__namespace.snippet(node_10, () => $$props.leftButton);
|
|
4021
4130
|
$2__namespace.reset(div_7);
|
|
@@ -4029,7 +4138,7 @@ function BottomSheet($$anchor, $$props) {
|
|
|
4029
4138
|
var node_11 = $2__namespace.sibling(node_9, 2);
|
|
4030
4139
|
{
|
|
4031
4140
|
var consequent_6 = ($$anchor2) => {
|
|
4032
|
-
var div_8 =
|
|
4141
|
+
var div_8 = root_4();
|
|
4033
4142
|
var node_12 = $2__namespace.child(div_8);
|
|
4034
4143
|
$2__namespace.snippet(node_12, () => $$props.rightButton);
|
|
4035
4144
|
$2__namespace.reset(div_8);
|