@surdeddd/bottom-sheet 0.8.0 → 0.8.1
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-BD1mSExI.d.cts → BottomSheetEngine-7BDK2OWX.d.cts} +1 -0
- package/dist/{BottomSheetEngine-BDGRWa2i.d.ts → BottomSheetEngine-BFTb0-4Z.d.ts} +1 -0
- package/dist/element.cjs +17 -2
- 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 +17 -2
- package/dist/index.cjs +17 -2
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +17 -2
- 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 +17 -2
- package/dist/qwik.d.cts +2 -2
- package/dist/qwik.d.ts +2 -2
- package/dist/qwik.js +17 -2
- package/dist/react.cjs +17 -2
- package/dist/react.d.cts +2 -2
- package/dist/react.d.ts +2 -2
- package/dist/react.js +17 -2
- package/dist/solid.cjs +17 -2
- package/dist/solid.d.cts +1 -0
- package/dist/solid.d.ts +1 -0
- package/dist/solid.js +17 -2
- package/dist/solid.source.jsx +17 -2
- package/dist/svelte-core.cjs +17 -2
- package/dist/svelte-core.js +17 -2
- package/dist/svelte-src/BottomSheet.svelte +3 -0
- package/dist/svelte.cjs +18 -3
- package/dist/svelte.js +18 -3
- package/dist/vue.cjs +17 -2
- package/dist/vue.js +17 -2
- package/package.json +1 -1
package/dist/vue.js
CHANGED
|
@@ -2926,7 +2926,10 @@ var BottomSheetEngine = class {
|
|
|
2926
2926
|
cs.flex = "none";
|
|
2927
2927
|
if (vertical) cs.height = "auto";
|
|
2928
2928
|
else cs.width = "auto";
|
|
2929
|
-
const
|
|
2929
|
+
const poked = vertical ? el.offsetHeight : el.offsetWidth;
|
|
2930
|
+
const contentBox = vertical ? content.clientHeight : content.clientWidth;
|
|
2931
|
+
const contentScroll = vertical ? content.scrollHeight : content.scrollWidth;
|
|
2932
|
+
const natural = Math.max(poked, poked - contentBox + contentScroll);
|
|
2930
2933
|
sheetStyle[axis] = prevSheet;
|
|
2931
2934
|
cs.flex = prevFlex;
|
|
2932
2935
|
if (vertical) cs.height = prevContent;
|
|
@@ -2938,9 +2941,21 @@ var BottomSheetEngine = class {
|
|
|
2938
2941
|
const natural = this.measureSheetNatural(vertical);
|
|
2939
2942
|
const capped = this.maxHeightCap !== void 0 ? Math.min(natural, this.maxHeightCap) : natural;
|
|
2940
2943
|
if (typeof window === "undefined") return capped;
|
|
2941
|
-
const viewport = vertical
|
|
2944
|
+
const viewport = this.containingExtent(vertical);
|
|
2942
2945
|
return viewport > 0 ? Math.min(capped, viewport) : capped;
|
|
2943
2946
|
}
|
|
2947
|
+
// The fit cap is the sheet's containing block, not always the window: a
|
|
2948
|
+
// position:fixed sheet nested under a transform/filter/will-change ancestor
|
|
2949
|
+
// is clipped to that ancestor, so capping by window.innerHeight oversizes the
|
|
2950
|
+
// sheet and the content/footer get clipped. offsetParent resolves to that
|
|
2951
|
+
// ancestor when present, and is null (→ viewport) for a plain fixed sheet.
|
|
2952
|
+
containingExtent(vertical) {
|
|
2953
|
+
const op = this.element.offsetParent;
|
|
2954
|
+
if (op && op !== document.body && op !== document.documentElement) {
|
|
2955
|
+
return vertical ? op.clientHeight : op.clientWidth;
|
|
2956
|
+
}
|
|
2957
|
+
return vertical ? window.innerHeight : window.innerWidth;
|
|
2958
|
+
}
|
|
2944
2959
|
installFitObserver() {
|
|
2945
2960
|
if (typeof ResizeObserver === "undefined") return;
|
|
2946
2961
|
if (!this.snapPointsRaw.some((p) => p.size === "fit" || p.size === "content"))
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@surdeddd/bottom-sheet",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.1",
|
|
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",
|