fuma 2.0.33 → 2.0.35

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';
@@ -25,7 +25,7 @@
25
25
  hideBody = false,
26
26
  onCreateField,
27
27
  onclick,
28
- screenPadding = 16
28
+ screenPadding
29
29
  }: {
30
30
  key?: string
31
31
  fields: TableField<Item>[]
@@ -52,15 +52,11 @@
52
52
  afterNavigate(initFields)
53
53
  </script>
54
54
 
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
- >
55
+ <div class="{klass} bg-base-100 overflow-x-auto rounded-lg border" class:min-h-[320px]={!hideBody}>
60
56
  <table class="relative table">
61
57
  <TableHead {fields} {key} {onCreateField} />
62
58
  {#if !hideBody && items.length}
63
- <TableBody {fields} {items} {actions} {classRow} {onclick} />
59
+ <TableBody {fields} {items} {actions} {classRow} {onclick} {screenPadding} />
64
60
  {/if}
65
61
  </table>
66
62
 
@@ -1,4 +1,5 @@
1
1
  <script lang="ts" generics="Item extends ItemBase">
2
+ import { maxHeightScreen } from '../../action/maxHeightScreen.js'
2
3
  import { TableCell, type ItemBase, type TableField } from './index.js'
3
4
  import type { Snippet } from 'svelte'
4
5
 
@@ -7,19 +8,21 @@
7
8
  fields,
8
9
  actions,
9
10
  classRow,
10
- onclick
11
+ onclick,
12
+ screenPadding
11
13
  }: {
12
14
  items: Item[]
13
15
  fields: TableField<Item>[]
14
16
  actions?: Snippet<[item: Item]>
15
17
  classRow?: string
16
18
  onclick?: (item?: Item) => void
19
+ screenPadding?: number
17
20
  } = $props()
18
21
 
19
22
  let fieldsVisible = $derived(fields.filter((f) => f._visible))
20
23
  </script>
21
24
 
22
- <tbody>
25
+ <tbody use:maxHeightScreen={{ padding: screenPadding }}>
23
26
  {#each items as item (item.id)}
24
27
  <tr class={classRow} onclick={() => onclick?.(item)}>
25
28
  {#each fieldsVisible as field (field.key)}
@@ -7,6 +7,7 @@ declare function $$render<Item extends ItemBase>(): {
7
7
  actions?: Snippet<[item: Item]>;
8
8
  classRow?: string;
9
9
  onclick?: (item?: Item) => void;
10
+ screenPadding?: number;
10
11
  };
11
12
  exports: {};
12
13
  bindings: "";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fuma",
3
- "version": "2.0.33",
3
+ "version": "2.0.35",
4
4
  "description": "My fullstack material build with sveltekit, daisyui, zod, prisma, lucia",
5
5
  "author": {
6
6
  "name": "Jonas Voisard",