fuma 2.0.48 → 2.0.49

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.
@@ -0,0 +1,10 @@
1
+ export declare function maxHeightScreen(node: HTMLElement, { padding }?: {
2
+ padding?: number;
3
+ }): {
4
+ destroy(): void;
5
+ };
6
+ export declare function heightScreen(node: HTMLElement, { padding }?: {
7
+ padding?: number;
8
+ }): {
9
+ destroy(): void;
10
+ };
@@ -0,0 +1,24 @@
1
+ export function maxHeightScreen(node, { padding = 16 } = {}) {
2
+ function setMaxHeight() {
3
+ node.style.maxHeight = `${window.innerHeight - node.offsetTop - padding}px`;
4
+ }
5
+ setMaxHeight();
6
+ window.addEventListener('resize', setMaxHeight);
7
+ return {
8
+ destroy() {
9
+ window.removeEventListener('resize', setMaxHeight);
10
+ }
11
+ };
12
+ }
13
+ export function heightScreen(node, { padding = 16 } = {}) {
14
+ function setHeight() {
15
+ node.style.height = `${window.innerHeight - node.offsetTop - padding}px`;
16
+ }
17
+ setHeight();
18
+ window.addEventListener('resize', setHeight);
19
+ return {
20
+ destroy() {
21
+ window.removeEventListener('resize', setHeight);
22
+ }
23
+ };
24
+ }
@@ -3,4 +3,4 @@ export * from './tip.js';
3
3
  export * from './portal.js';
4
4
  export * from './list/index.js';
5
5
  export * from './autoSubmit.js';
6
- export * from './maxHeightScreen.js';
6
+ export * from './heightScreen.js';
@@ -3,4 +3,4 @@ export * from './tip.js';
3
3
  export * from './portal.js';
4
4
  export * from './list/index.js';
5
5
  export * from './autoSubmit.js';
6
- export * from './maxHeightScreen.js';
6
+ export * from './heightScreen.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "2.0.48",
3
+ "version": "2.0.49",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",
@@ -1,3 +0,0 @@
1
- export declare function maxHeightScreen(node: HTMLElement, { padding }?: {
2
- padding?: number;
3
- }): void;
@@ -1,3 +0,0 @@
1
- export function maxHeightScreen(node, { padding = 16 } = {}) {
2
- node.style.maxHeight = `${window.innerHeight - node.offsetTop - padding}px`;
3
- }