@surdeddd/bottom-sheet 0.4.0 → 0.5.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/dist/{BottomSheetEngine-L05jGZvU.d.ts → BottomSheetEngine-BHjKFtnM.d.ts} +2 -0
- package/dist/{BottomSheetEngine-BJrH7qY3.d.cts → BottomSheetEngine-CqiCz64W.d.cts} +2 -0
- package/dist/element.cjs +120 -13
- 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 +120 -13
- package/dist/index.cjs +97 -8
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +97 -8
- 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/preact.d.cts +1 -1
- package/dist/preact.d.ts +1 -1
- package/dist/qwik.cjs +100 -10
- package/dist/qwik.d.cts +2 -2
- package/dist/qwik.d.ts +2 -2
- package/dist/qwik.js +100 -10
- package/dist/react.cjs +119 -12
- package/dist/react.d.cts +4 -2
- package/dist/react.d.ts +4 -2
- package/dist/react.js +119 -12
- package/dist/solid.cjs +128 -18
- package/dist/solid.d.cts +3 -0
- package/dist/solid.d.ts +3 -0
- package/dist/solid.js +130 -20
- package/dist/solid.source.jsx +106 -12
- package/dist/styles.css +34 -5
- package/dist/svelte-core.cjs +97 -8
- package/dist/svelte-core.js +97 -8
- package/dist/svelte-src/BottomSheet.svelte +15 -13
- package/dist/svelte.cjs +159 -53
- package/dist/svelte.d.cts +1 -0
- package/dist/svelte.d.ts +1 -0
- package/dist/svelte.js +159 -53
- package/dist/vue.cjs +126 -30
- package/dist/vue.js +126 -30
- package/package.json +3 -3
package/dist/vue.cjs
CHANGED
|
@@ -2897,11 +2897,54 @@ var BottomSheetEngine = class {
|
|
|
2897
2897
|
this.updateAriaSlider();
|
|
2898
2898
|
}
|
|
2899
2899
|
}
|
|
2900
|
+
contentTargets() {
|
|
2901
|
+
const scroller = this.scrollContainer;
|
|
2902
|
+
if (!scroller) return [];
|
|
2903
|
+
const hasSlot = typeof HTMLSlotElement !== "undefined";
|
|
2904
|
+
const out = [];
|
|
2905
|
+
for (const child of Array.from(scroller.children)) {
|
|
2906
|
+
if (hasSlot && child instanceof HTMLSlotElement) {
|
|
2907
|
+
for (const el of child.assignedElements()) out.push(el);
|
|
2908
|
+
} else {
|
|
2909
|
+
out.push(child);
|
|
2910
|
+
}
|
|
2911
|
+
}
|
|
2912
|
+
return out;
|
|
2913
|
+
}
|
|
2914
|
+
measureContentExtent(vertical) {
|
|
2915
|
+
const content = this.scrollContainer;
|
|
2916
|
+
if (!content) return 0;
|
|
2917
|
+
const targets = this.contentTargets();
|
|
2918
|
+
if (targets.length === 0) {
|
|
2919
|
+
return vertical ? content.scrollHeight : content.scrollWidth;
|
|
2920
|
+
}
|
|
2921
|
+
let min = Infinity;
|
|
2922
|
+
let max = -Infinity;
|
|
2923
|
+
for (const el of targets) {
|
|
2924
|
+
const r = el.getBoundingClientRect();
|
|
2925
|
+
if (vertical) {
|
|
2926
|
+
if (r.top < min) min = r.top;
|
|
2927
|
+
if (r.bottom > max) max = r.bottom;
|
|
2928
|
+
} else {
|
|
2929
|
+
if (r.left < min) min = r.left;
|
|
2930
|
+
if (r.right > max) max = r.right;
|
|
2931
|
+
}
|
|
2932
|
+
}
|
|
2933
|
+
if (!isFinite(min) || !isFinite(max) || max <= min) {
|
|
2934
|
+
return vertical ? content.scrollHeight : content.scrollWidth;
|
|
2935
|
+
}
|
|
2936
|
+
let pad = 0;
|
|
2937
|
+
if (typeof getComputedStyle !== "undefined") {
|
|
2938
|
+
const cs = getComputedStyle(content);
|
|
2939
|
+
pad = vertical ? (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0) : (parseFloat(cs.paddingLeft) || 0) + (parseFloat(cs.paddingRight) || 0);
|
|
2940
|
+
}
|
|
2941
|
+
return max - min + pad;
|
|
2942
|
+
}
|
|
2900
2943
|
measureFitSize() {
|
|
2901
2944
|
const vertical = layoutAxis(this.mode) === "height";
|
|
2902
2945
|
const handleSize = vertical ? this.handle.offsetHeight : this.handle.offsetWidth;
|
|
2903
2946
|
const content = this.scrollContainer;
|
|
2904
|
-
const natural = content ? handleSize + (vertical
|
|
2947
|
+
const natural = content ? handleSize + this.measureContentExtent(vertical) : handleSize;
|
|
2905
2948
|
if (typeof window === "undefined") return natural;
|
|
2906
2949
|
const viewport = vertical ? window.innerHeight : window.innerWidth;
|
|
2907
2950
|
return viewport > 0 ? Math.min(natural, viewport) : natural;
|
|
@@ -2910,22 +2953,62 @@ var BottomSheetEngine = class {
|
|
|
2910
2953
|
if (typeof ResizeObserver === "undefined") return;
|
|
2911
2954
|
if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
|
|
2912
2955
|
return;
|
|
2913
|
-
const targets = [this.handle];
|
|
2914
|
-
if (this.scrollContainer && this.scrollContainer !== this.handle) {
|
|
2915
|
-
targets.push(this.scrollContainer);
|
|
2916
|
-
}
|
|
2917
2956
|
let raf = 0;
|
|
2918
|
-
const
|
|
2957
|
+
const schedule = () => {
|
|
2919
2958
|
if (raf) return;
|
|
2920
2959
|
raf = requestAnimationFrame(() => {
|
|
2921
2960
|
raf = 0;
|
|
2922
2961
|
if (this.destroyed || this.gesture?.isDragging) return;
|
|
2923
2962
|
this.recompute();
|
|
2924
2963
|
});
|
|
2925
|
-
}
|
|
2926
|
-
|
|
2964
|
+
};
|
|
2965
|
+
const ro = new ResizeObserver(schedule);
|
|
2966
|
+
ro.observe(this.handle);
|
|
2967
|
+
const scroller = this.scrollContainer;
|
|
2968
|
+
const observed = /* @__PURE__ */ new Set();
|
|
2969
|
+
const slots = /* @__PURE__ */ new Set();
|
|
2970
|
+
const hasSlot = typeof HTMLSlotElement !== "undefined";
|
|
2971
|
+
const onSlotChange = () => resync();
|
|
2972
|
+
const trackSlots = () => {
|
|
2973
|
+
if (!scroller || !hasSlot) return;
|
|
2974
|
+
for (const child of Array.from(scroller.children)) {
|
|
2975
|
+
if (child instanceof HTMLSlotElement && !slots.has(child)) {
|
|
2976
|
+
child.addEventListener("slotchange", onSlotChange);
|
|
2977
|
+
slots.add(child);
|
|
2978
|
+
}
|
|
2979
|
+
}
|
|
2980
|
+
};
|
|
2981
|
+
const resync = () => {
|
|
2982
|
+
trackSlots();
|
|
2983
|
+
const targets = this.contentTargets();
|
|
2984
|
+
for (const el of observed) {
|
|
2985
|
+
if (!targets.includes(el)) {
|
|
2986
|
+
ro.unobserve(el);
|
|
2987
|
+
observed.delete(el);
|
|
2988
|
+
}
|
|
2989
|
+
}
|
|
2990
|
+
for (const el of targets) {
|
|
2991
|
+
if (!observed.has(el)) {
|
|
2992
|
+
ro.observe(el);
|
|
2993
|
+
observed.add(el);
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
schedule();
|
|
2997
|
+
};
|
|
2998
|
+
let mo;
|
|
2999
|
+
if (scroller) {
|
|
3000
|
+
resync();
|
|
3001
|
+
if (typeof MutationObserver !== "undefined") {
|
|
3002
|
+
mo = new MutationObserver(resync);
|
|
3003
|
+
mo.observe(scroller, { childList: true });
|
|
3004
|
+
}
|
|
3005
|
+
}
|
|
2927
3006
|
this.teardowns.add(() => {
|
|
2928
3007
|
ro.disconnect();
|
|
3008
|
+
mo?.disconnect();
|
|
3009
|
+
for (const slot of slots) {
|
|
3010
|
+
slot.removeEventListener("slotchange", onSlotChange);
|
|
3011
|
+
}
|
|
2929
3012
|
if (raf) cancelAnimationFrame(raf);
|
|
2930
3013
|
});
|
|
2931
3014
|
}
|
|
@@ -3273,6 +3356,9 @@ var BottomSheetEngine = class {
|
|
|
3273
3356
|
if (this.anchorHost && this.anchorHost !== this.scrimParent) {
|
|
3274
3357
|
this.anchorHost.style.setProperty("--bs-size", `${size}px`);
|
|
3275
3358
|
}
|
|
3359
|
+
if (this.rootEl && this.rootEl !== this.scrimParent && this.rootEl !== this.anchorHost) {
|
|
3360
|
+
this.rootEl.style.setProperty("--bs-size", `${size}px`);
|
|
3361
|
+
}
|
|
3276
3362
|
}
|
|
3277
3363
|
const progress = this.computeProgress(size);
|
|
3278
3364
|
const progressChanged = this.progressWriteSentinel.shouldWrite(
|
|
@@ -3284,6 +3370,9 @@ var BottomSheetEngine = class {
|
|
|
3284
3370
|
if (this.anchorHost) {
|
|
3285
3371
|
this.anchorHost.style.setProperty("--bs-progress", String(progress));
|
|
3286
3372
|
}
|
|
3373
|
+
if (this.rootEl && this.rootEl !== this.anchorHost) {
|
|
3374
|
+
this.rootEl.style.setProperty("--bs-progress", String(progress));
|
|
3375
|
+
}
|
|
3287
3376
|
}
|
|
3288
3377
|
this.scrim.applyOpacity(progress, progressChanged);
|
|
3289
3378
|
if (progressChanged && this.bus.listenerCount("progress") > 0) {
|
|
@@ -3887,38 +3976,34 @@ var _hoisted_3 = [
|
|
|
3887
3976
|
"aria-modal",
|
|
3888
3977
|
"aria-label"
|
|
3889
3978
|
];
|
|
3890
|
-
var _hoisted_4 =
|
|
3891
|
-
key: 0,
|
|
3892
|
-
class: "bs-button-slot",
|
|
3893
|
-
"data-side": "left"
|
|
3894
|
-
};
|
|
3895
|
-
var _hoisted_5 = {
|
|
3896
|
-
key: 1,
|
|
3897
|
-
class: "bs-button-slot",
|
|
3898
|
-
"data-side": "right"
|
|
3899
|
-
};
|
|
3900
|
-
var _hoisted_6 = [
|
|
3979
|
+
var _hoisted_4 = [
|
|
3901
3980
|
"aria-orientation",
|
|
3902
3981
|
"aria-valuemax",
|
|
3903
3982
|
"aria-valuenow",
|
|
3904
3983
|
"aria-valuetext"
|
|
3905
3984
|
];
|
|
3906
|
-
var
|
|
3985
|
+
var _hoisted_5 = {
|
|
3986
|
+
key: 0,
|
|
3987
|
+
class: "bs-header"
|
|
3988
|
+
};
|
|
3989
|
+
var _hoisted_6 = {
|
|
3907
3990
|
ref: "contentRef",
|
|
3908
3991
|
class: "bs-content",
|
|
3909
3992
|
tabindex: "0",
|
|
3910
3993
|
role: "region",
|
|
3911
3994
|
"aria-label": "Sheet content"
|
|
3912
3995
|
};
|
|
3913
|
-
var
|
|
3914
|
-
key:
|
|
3996
|
+
var _hoisted_7 = {
|
|
3997
|
+
key: 1,
|
|
3915
3998
|
class: "bs-footer"
|
|
3916
3999
|
};
|
|
3917
|
-
var
|
|
4000
|
+
var _hoisted_8 = {
|
|
3918
4001
|
class: "bs-sr-only",
|
|
3919
4002
|
role: "status",
|
|
3920
4003
|
"aria-live": "polite"
|
|
3921
4004
|
};
|
|
4005
|
+
var _hoisted_9 = ["data-mode"];
|
|
4006
|
+
var _hoisted_10 = ["data-mode"];
|
|
3922
4007
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3923
4008
|
return vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
3924
4009
|
to: $props.teleportTo,
|
|
@@ -3953,8 +4038,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3953
4038
|
"aria-modal": $setup.ariaModal ? "true" : void 0,
|
|
3954
4039
|
"aria-label": $props.ariaLabel
|
|
3955
4040
|
}, [
|
|
3956
|
-
_ctx.$slots["button-left"] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_4, [vue.renderSlot(_ctx.$slots, "button-left")])) : vue.createCommentVNode("v-if", true),
|
|
3957
|
-
_ctx.$slots["button-right"] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [vue.renderSlot(_ctx.$slots, "button-right")])) : vue.createCommentVNode("v-if", true),
|
|
3958
4041
|
vue.createElementVNode("div", {
|
|
3959
4042
|
ref: "handleRef",
|
|
3960
4043
|
class: "bs-handle",
|
|
@@ -3966,23 +4049,36 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3966
4049
|
"aria-valuenow": $setup.activeIdx,
|
|
3967
4050
|
"aria-valuetext": $setup.state.activeId,
|
|
3968
4051
|
"aria-label": "Resize sheet"
|
|
3969
|
-
},
|
|
4052
|
+
}, null, 8, _hoisted_4),
|
|
4053
|
+
_ctx.$slots.header ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, [vue.renderSlot(_ctx.$slots, "header", { state: $setup.state })])) : vue.createCommentVNode("v-if", true),
|
|
3970
4054
|
vue.createElementVNode(
|
|
3971
4055
|
"div",
|
|
3972
|
-
|
|
4056
|
+
_hoisted_6,
|
|
3973
4057
|
[vue.renderSlot(_ctx.$slots, "default")],
|
|
3974
4058
|
512
|
|
3975
4059
|
/* NEED_PATCH */
|
|
3976
4060
|
),
|
|
3977
|
-
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div",
|
|
4061
|
+
_ctx.$slots.footer ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [vue.renderSlot(_ctx.$slots, "footer", { state: $setup.state })])) : vue.createCommentVNode("v-if", true),
|
|
3978
4062
|
vue.createElementVNode(
|
|
3979
4063
|
"span",
|
|
3980
|
-
|
|
4064
|
+
_hoisted_8,
|
|
3981
4065
|
vue.toDisplayString($setup.state.activeId),
|
|
3982
4066
|
1
|
|
3983
4067
|
/* TEXT */
|
|
3984
4068
|
)
|
|
3985
|
-
], 8, _hoisted_3)
|
|
4069
|
+
], 8, _hoisted_3),
|
|
4070
|
+
_ctx.$slots["button-left"] ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4071
|
+
key: 1,
|
|
4072
|
+
class: "bs-button-slot",
|
|
4073
|
+
"data-side": "left",
|
|
4074
|
+
"data-mode": $setup.props.mode ?? "bottom"
|
|
4075
|
+
}, [vue.renderSlot(_ctx.$slots, "button-left")], 8, _hoisted_9)) : vue.createCommentVNode("v-if", true),
|
|
4076
|
+
_ctx.$slots["button-right"] ? (vue.openBlock(), vue.createElementBlock("div", {
|
|
4077
|
+
key: 2,
|
|
4078
|
+
class: "bs-button-slot",
|
|
4079
|
+
"data-side": "right",
|
|
4080
|
+
"data-mode": $setup.props.mode ?? "bottom"
|
|
4081
|
+
}, [vue.renderSlot(_ctx.$slots, "button-right")], 8, _hoisted_10)) : vue.createCommentVNode("v-if", true)
|
|
3986
4082
|
]), (vue.openBlock(true), vue.createElementBlock(
|
|
3987
4083
|
vue.Fragment,
|
|
3988
4084
|
null,
|
package/dist/vue.js
CHANGED
|
@@ -2895,11 +2895,54 @@ var BottomSheetEngine = class {
|
|
|
2895
2895
|
this.updateAriaSlider();
|
|
2896
2896
|
}
|
|
2897
2897
|
}
|
|
2898
|
+
contentTargets() {
|
|
2899
|
+
const scroller = this.scrollContainer;
|
|
2900
|
+
if (!scroller) return [];
|
|
2901
|
+
const hasSlot = typeof HTMLSlotElement !== "undefined";
|
|
2902
|
+
const out = [];
|
|
2903
|
+
for (const child of Array.from(scroller.children)) {
|
|
2904
|
+
if (hasSlot && child instanceof HTMLSlotElement) {
|
|
2905
|
+
for (const el of child.assignedElements()) out.push(el);
|
|
2906
|
+
} else {
|
|
2907
|
+
out.push(child);
|
|
2908
|
+
}
|
|
2909
|
+
}
|
|
2910
|
+
return out;
|
|
2911
|
+
}
|
|
2912
|
+
measureContentExtent(vertical) {
|
|
2913
|
+
const content = this.scrollContainer;
|
|
2914
|
+
if (!content) return 0;
|
|
2915
|
+
const targets = this.contentTargets();
|
|
2916
|
+
if (targets.length === 0) {
|
|
2917
|
+
return vertical ? content.scrollHeight : content.scrollWidth;
|
|
2918
|
+
}
|
|
2919
|
+
let min = Infinity;
|
|
2920
|
+
let max = -Infinity;
|
|
2921
|
+
for (const el of targets) {
|
|
2922
|
+
const r = el.getBoundingClientRect();
|
|
2923
|
+
if (vertical) {
|
|
2924
|
+
if (r.top < min) min = r.top;
|
|
2925
|
+
if (r.bottom > max) max = r.bottom;
|
|
2926
|
+
} else {
|
|
2927
|
+
if (r.left < min) min = r.left;
|
|
2928
|
+
if (r.right > max) max = r.right;
|
|
2929
|
+
}
|
|
2930
|
+
}
|
|
2931
|
+
if (!isFinite(min) || !isFinite(max) || max <= min) {
|
|
2932
|
+
return vertical ? content.scrollHeight : content.scrollWidth;
|
|
2933
|
+
}
|
|
2934
|
+
let pad = 0;
|
|
2935
|
+
if (typeof getComputedStyle !== "undefined") {
|
|
2936
|
+
const cs = getComputedStyle(content);
|
|
2937
|
+
pad = vertical ? (parseFloat(cs.paddingTop) || 0) + (parseFloat(cs.paddingBottom) || 0) : (parseFloat(cs.paddingLeft) || 0) + (parseFloat(cs.paddingRight) || 0);
|
|
2938
|
+
}
|
|
2939
|
+
return max - min + pad;
|
|
2940
|
+
}
|
|
2898
2941
|
measureFitSize() {
|
|
2899
2942
|
const vertical = layoutAxis(this.mode) === "height";
|
|
2900
2943
|
const handleSize = vertical ? this.handle.offsetHeight : this.handle.offsetWidth;
|
|
2901
2944
|
const content = this.scrollContainer;
|
|
2902
|
-
const natural = content ? handleSize + (vertical
|
|
2945
|
+
const natural = content ? handleSize + this.measureContentExtent(vertical) : handleSize;
|
|
2903
2946
|
if (typeof window === "undefined") return natural;
|
|
2904
2947
|
const viewport = vertical ? window.innerHeight : window.innerWidth;
|
|
2905
2948
|
return viewport > 0 ? Math.min(natural, viewport) : natural;
|
|
@@ -2908,22 +2951,62 @@ var BottomSheetEngine = class {
|
|
|
2908
2951
|
if (typeof ResizeObserver === "undefined") return;
|
|
2909
2952
|
if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
|
|
2910
2953
|
return;
|
|
2911
|
-
const targets = [this.handle];
|
|
2912
|
-
if (this.scrollContainer && this.scrollContainer !== this.handle) {
|
|
2913
|
-
targets.push(this.scrollContainer);
|
|
2914
|
-
}
|
|
2915
2954
|
let raf = 0;
|
|
2916
|
-
const
|
|
2955
|
+
const schedule = () => {
|
|
2917
2956
|
if (raf) return;
|
|
2918
2957
|
raf = requestAnimationFrame(() => {
|
|
2919
2958
|
raf = 0;
|
|
2920
2959
|
if (this.destroyed || this.gesture?.isDragging) return;
|
|
2921
2960
|
this.recompute();
|
|
2922
2961
|
});
|
|
2923
|
-
}
|
|
2924
|
-
|
|
2962
|
+
};
|
|
2963
|
+
const ro = new ResizeObserver(schedule);
|
|
2964
|
+
ro.observe(this.handle);
|
|
2965
|
+
const scroller = this.scrollContainer;
|
|
2966
|
+
const observed = /* @__PURE__ */ new Set();
|
|
2967
|
+
const slots = /* @__PURE__ */ new Set();
|
|
2968
|
+
const hasSlot = typeof HTMLSlotElement !== "undefined";
|
|
2969
|
+
const onSlotChange = () => resync();
|
|
2970
|
+
const trackSlots = () => {
|
|
2971
|
+
if (!scroller || !hasSlot) return;
|
|
2972
|
+
for (const child of Array.from(scroller.children)) {
|
|
2973
|
+
if (child instanceof HTMLSlotElement && !slots.has(child)) {
|
|
2974
|
+
child.addEventListener("slotchange", onSlotChange);
|
|
2975
|
+
slots.add(child);
|
|
2976
|
+
}
|
|
2977
|
+
}
|
|
2978
|
+
};
|
|
2979
|
+
const resync = () => {
|
|
2980
|
+
trackSlots();
|
|
2981
|
+
const targets = this.contentTargets();
|
|
2982
|
+
for (const el of observed) {
|
|
2983
|
+
if (!targets.includes(el)) {
|
|
2984
|
+
ro.unobserve(el);
|
|
2985
|
+
observed.delete(el);
|
|
2986
|
+
}
|
|
2987
|
+
}
|
|
2988
|
+
for (const el of targets) {
|
|
2989
|
+
if (!observed.has(el)) {
|
|
2990
|
+
ro.observe(el);
|
|
2991
|
+
observed.add(el);
|
|
2992
|
+
}
|
|
2993
|
+
}
|
|
2994
|
+
schedule();
|
|
2995
|
+
};
|
|
2996
|
+
let mo;
|
|
2997
|
+
if (scroller) {
|
|
2998
|
+
resync();
|
|
2999
|
+
if (typeof MutationObserver !== "undefined") {
|
|
3000
|
+
mo = new MutationObserver(resync);
|
|
3001
|
+
mo.observe(scroller, { childList: true });
|
|
3002
|
+
}
|
|
3003
|
+
}
|
|
2925
3004
|
this.teardowns.add(() => {
|
|
2926
3005
|
ro.disconnect();
|
|
3006
|
+
mo?.disconnect();
|
|
3007
|
+
for (const slot of slots) {
|
|
3008
|
+
slot.removeEventListener("slotchange", onSlotChange);
|
|
3009
|
+
}
|
|
2927
3010
|
if (raf) cancelAnimationFrame(raf);
|
|
2928
3011
|
});
|
|
2929
3012
|
}
|
|
@@ -3271,6 +3354,9 @@ var BottomSheetEngine = class {
|
|
|
3271
3354
|
if (this.anchorHost && this.anchorHost !== this.scrimParent) {
|
|
3272
3355
|
this.anchorHost.style.setProperty("--bs-size", `${size}px`);
|
|
3273
3356
|
}
|
|
3357
|
+
if (this.rootEl && this.rootEl !== this.scrimParent && this.rootEl !== this.anchorHost) {
|
|
3358
|
+
this.rootEl.style.setProperty("--bs-size", `${size}px`);
|
|
3359
|
+
}
|
|
3274
3360
|
}
|
|
3275
3361
|
const progress = this.computeProgress(size);
|
|
3276
3362
|
const progressChanged = this.progressWriteSentinel.shouldWrite(
|
|
@@ -3282,6 +3368,9 @@ var BottomSheetEngine = class {
|
|
|
3282
3368
|
if (this.anchorHost) {
|
|
3283
3369
|
this.anchorHost.style.setProperty("--bs-progress", String(progress));
|
|
3284
3370
|
}
|
|
3371
|
+
if (this.rootEl && this.rootEl !== this.anchorHost) {
|
|
3372
|
+
this.rootEl.style.setProperty("--bs-progress", String(progress));
|
|
3373
|
+
}
|
|
3285
3374
|
}
|
|
3286
3375
|
this.scrim.applyOpacity(progress, progressChanged);
|
|
3287
3376
|
if (progressChanged && this.bus.listenerCount("progress") > 0) {
|
|
@@ -3885,38 +3974,34 @@ var _hoisted_3 = [
|
|
|
3885
3974
|
"aria-modal",
|
|
3886
3975
|
"aria-label"
|
|
3887
3976
|
];
|
|
3888
|
-
var _hoisted_4 =
|
|
3889
|
-
key: 0,
|
|
3890
|
-
class: "bs-button-slot",
|
|
3891
|
-
"data-side": "left"
|
|
3892
|
-
};
|
|
3893
|
-
var _hoisted_5 = {
|
|
3894
|
-
key: 1,
|
|
3895
|
-
class: "bs-button-slot",
|
|
3896
|
-
"data-side": "right"
|
|
3897
|
-
};
|
|
3898
|
-
var _hoisted_6 = [
|
|
3977
|
+
var _hoisted_4 = [
|
|
3899
3978
|
"aria-orientation",
|
|
3900
3979
|
"aria-valuemax",
|
|
3901
3980
|
"aria-valuenow",
|
|
3902
3981
|
"aria-valuetext"
|
|
3903
3982
|
];
|
|
3904
|
-
var
|
|
3983
|
+
var _hoisted_5 = {
|
|
3984
|
+
key: 0,
|
|
3985
|
+
class: "bs-header"
|
|
3986
|
+
};
|
|
3987
|
+
var _hoisted_6 = {
|
|
3905
3988
|
ref: "contentRef",
|
|
3906
3989
|
class: "bs-content",
|
|
3907
3990
|
tabindex: "0",
|
|
3908
3991
|
role: "region",
|
|
3909
3992
|
"aria-label": "Sheet content"
|
|
3910
3993
|
};
|
|
3911
|
-
var
|
|
3912
|
-
key:
|
|
3994
|
+
var _hoisted_7 = {
|
|
3995
|
+
key: 1,
|
|
3913
3996
|
class: "bs-footer"
|
|
3914
3997
|
};
|
|
3915
|
-
var
|
|
3998
|
+
var _hoisted_8 = {
|
|
3916
3999
|
class: "bs-sr-only",
|
|
3917
4000
|
role: "status",
|
|
3918
4001
|
"aria-live": "polite"
|
|
3919
4002
|
};
|
|
4003
|
+
var _hoisted_9 = ["data-mode"];
|
|
4004
|
+
var _hoisted_10 = ["data-mode"];
|
|
3920
4005
|
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
3921
4006
|
return openBlock(), createBlock(Teleport, {
|
|
3922
4007
|
to: $props.teleportTo,
|
|
@@ -3951,8 +4036,6 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3951
4036
|
"aria-modal": $setup.ariaModal ? "true" : void 0,
|
|
3952
4037
|
"aria-label": $props.ariaLabel
|
|
3953
4038
|
}, [
|
|
3954
|
-
_ctx.$slots["button-left"] ? (openBlock(), createElementBlock("div", _hoisted_4, [renderSlot(_ctx.$slots, "button-left")])) : createCommentVNode("v-if", true),
|
|
3955
|
-
_ctx.$slots["button-right"] ? (openBlock(), createElementBlock("div", _hoisted_5, [renderSlot(_ctx.$slots, "button-right")])) : createCommentVNode("v-if", true),
|
|
3956
4039
|
createElementVNode("div", {
|
|
3957
4040
|
ref: "handleRef",
|
|
3958
4041
|
class: "bs-handle",
|
|
@@ -3964,23 +4047,36 @@ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
3964
4047
|
"aria-valuenow": $setup.activeIdx,
|
|
3965
4048
|
"aria-valuetext": $setup.state.activeId,
|
|
3966
4049
|
"aria-label": "Resize sheet"
|
|
3967
|
-
},
|
|
4050
|
+
}, null, 8, _hoisted_4),
|
|
4051
|
+
_ctx.$slots.header ? (openBlock(), createElementBlock("div", _hoisted_5, [renderSlot(_ctx.$slots, "header", { state: $setup.state })])) : createCommentVNode("v-if", true),
|
|
3968
4052
|
createElementVNode(
|
|
3969
4053
|
"div",
|
|
3970
|
-
|
|
4054
|
+
_hoisted_6,
|
|
3971
4055
|
[renderSlot(_ctx.$slots, "default")],
|
|
3972
4056
|
512
|
|
3973
4057
|
/* NEED_PATCH */
|
|
3974
4058
|
),
|
|
3975
|
-
_ctx.$slots.footer ? (openBlock(), createElementBlock("div",
|
|
4059
|
+
_ctx.$slots.footer ? (openBlock(), createElementBlock("div", _hoisted_7, [renderSlot(_ctx.$slots, "footer", { state: $setup.state })])) : createCommentVNode("v-if", true),
|
|
3976
4060
|
createElementVNode(
|
|
3977
4061
|
"span",
|
|
3978
|
-
|
|
4062
|
+
_hoisted_8,
|
|
3979
4063
|
toDisplayString($setup.state.activeId),
|
|
3980
4064
|
1
|
|
3981
4065
|
/* TEXT */
|
|
3982
4066
|
)
|
|
3983
|
-
], 8, _hoisted_3)
|
|
4067
|
+
], 8, _hoisted_3),
|
|
4068
|
+
_ctx.$slots["button-left"] ? (openBlock(), createElementBlock("div", {
|
|
4069
|
+
key: 1,
|
|
4070
|
+
class: "bs-button-slot",
|
|
4071
|
+
"data-side": "left",
|
|
4072
|
+
"data-mode": $setup.props.mode ?? "bottom"
|
|
4073
|
+
}, [renderSlot(_ctx.$slots, "button-left")], 8, _hoisted_9)) : createCommentVNode("v-if", true),
|
|
4074
|
+
_ctx.$slots["button-right"] ? (openBlock(), createElementBlock("div", {
|
|
4075
|
+
key: 2,
|
|
4076
|
+
class: "bs-button-slot",
|
|
4077
|
+
"data-side": "right",
|
|
4078
|
+
"data-mode": $setup.props.mode ?? "bottom"
|
|
4079
|
+
}, [renderSlot(_ctx.$slots, "button-right")], 8, _hoisted_10)) : createCommentVNode("v-if", true)
|
|
3984
4080
|
]), (openBlock(true), createElementBlock(
|
|
3985
4081
|
Fragment,
|
|
3986
4082
|
null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surdeddd/bottom-sheet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.5.0",
|
|
4
4
|
"description": "Universal, headless bottom sheet — framework-agnostic core with React, Vue 3, Svelte, Solid, Qwik, Preact, Lit and Custom Element adapters. Pointer Events, snap points, momentum, a11y, SSR-safe.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -187,7 +187,7 @@
|
|
|
187
187
|
{
|
|
188
188
|
"name": "vue adapter",
|
|
189
189
|
"path": "dist/vue.js",
|
|
190
|
-
"limit": "
|
|
190
|
+
"limit": "21 KB",
|
|
191
191
|
"gzip": true
|
|
192
192
|
},
|
|
193
193
|
{
|
|
@@ -205,7 +205,7 @@
|
|
|
205
205
|
{
|
|
206
206
|
"name": "qwik adapter",
|
|
207
207
|
"path": "dist/qwik.js",
|
|
208
|
-
"limit": "
|
|
208
|
+
"limit": "19 KB",
|
|
209
209
|
"gzip": true
|
|
210
210
|
},
|
|
211
211
|
{
|