fuma 2.0.32 → 2.0.34

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.
@@ -3,3 +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';
@@ -3,3 +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';
@@ -0,0 +1,3 @@
1
+ export declare function maxHeightScreen(node: HTMLElement, { padding }?: {
2
+ padding?: number;
3
+ }): void;
@@ -0,0 +1,3 @@
1
+ export function maxHeightScreen(node, { padding = 16 } = {}) {
2
+ node.style.maxHeight = `${window.innerHeight - node.offsetTop - padding}px`;
3
+ }
@@ -1,5 +1,6 @@
1
1
  <script lang="ts" generics="Item extends ItemBase">
2
2
  import { afterNavigate } from '$app/navigation'
3
+ import { maxHeightScreen } from '../../action/maxHeightScreen.js'
3
4
  import { Placeholder } from '../placeholder/index.js'
4
5
 
5
6
  import {
@@ -23,7 +24,8 @@
23
24
  classRow,
24
25
  hideBody = false,
25
26
  onCreateField,
26
- onclick
27
+ onclick,
28
+ screenPadding = 16
27
29
  }: {
28
30
  key?: string
29
31
  fields: TableField<Item>[]
@@ -35,6 +37,7 @@
35
37
  hideBody?: boolean
36
38
  onCreateField?: () => void
37
39
  onclick?: (item?: Item) => void
40
+ screenPadding?: number
38
41
  } = $props()
39
42
 
40
43
  const { KEY_FIELDS_VISIBLE, KEY_FIELDS_HIDDEN, KEY_FIELDS_ORDER } = createKeys(key)
@@ -49,7 +52,11 @@
49
52
  afterNavigate(initFields)
50
53
  </script>
51
54
 
52
- <div class="{klass} bg-base-100 overflow-x-auto rounded-lg border" class:min-h-[320px]={!hideBody}>
55
+ <div
56
+ class="{klass} bg-base-100 overflow-x-auto rounded-lg border"
57
+ class:min-h-[320px]={!hideBody}
58
+ use:maxHeightScreen={{ padding: screenPadding }}
59
+ >
53
60
  <table class="relative table">
54
61
  <TableHead {fields} {key} {onCreateField} />
55
62
  {#if !hideBody && items.length}
@@ -12,6 +12,7 @@ declare function $$render<Item extends ItemBase>(): {
12
12
  hideBody?: boolean;
13
13
  onCreateField?: () => void;
14
14
  onclick?: (item?: Item) => void;
15
+ screenPadding?: number;
15
16
  };
16
17
  exports: {};
17
18
  bindings: "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "2.0.32",
3
+ "version": "2.0.34",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",