@isoftdata/svelte-table 2.6.5 → 2.6.6

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/Td.svelte CHANGED
@@ -1,150 +1,150 @@
1
- <script lang="ts">
2
- import type { UuidRowProps } from './'
3
- import type { ColumnInfoRunicStore } from './column-info-store.svelte'
4
- import type { HTMLTdAttributes, ClassValue } from 'svelte/elements'
5
- import type { Writable } from 'svelte/store'
6
- import { getContext, onMount, type Snippet } from 'svelte'
7
-
8
- // Get the columnInfo store from the Table component
9
- const columnInfo = getContext<ColumnInfoRunicStore<UuidRowProps>>('columnInfo')
10
- const columnResizingEnabled = getContext<Writable<boolean>>('columnResizingEnabled')
11
- const bs5 = getContext<boolean>('bs5')
12
-
13
- interface Props extends Omit<HTMLTdAttributes, 'align'> {
14
- class?: ClassValue
15
- property: string
16
- /** Direction to align the column's contents
17
- *
18
- * `start` and `end` are only available in Bootstrap 5+
19
- *
20
- * `left` and `right`should only be used while you transition to Boostrap 5+
21
- */
22
- align?: 'start' | 'left' | 'center' | 'right' | 'end'
23
- /** If enabled, pressing enter while focused in this Td will focus the next non-disabled input/select/textarea in the column. Holding shift will go up instead of down.
24
- *
25
- * Can also be a callback that is fired when the enter key is used to move between rows.
26
- */
27
- enterGoesDown?: boolean | ((ctx: { event: KeyboardEvent; tr: HTMLTableRowElement }) => void)
28
- /** If enabled, keypress (enter only) and click events on the Td's contents will have `stopPropagation`/`preventDefault` called on them. */
29
- stopPropagation?: boolean
30
- children?: Snippet
31
- }
32
-
33
- let {
34
- //
35
- class: classNames = '',
36
- property,
37
- align = $bindable(columnInfo.current[property]?.align),
38
- enterGoesDown = false,
39
- stopPropagation = false,
40
- children,
41
- ...rest
42
- }: Props = $props()
43
-
44
- const thisColumnInfo = $derived(columnInfo.current[property])
45
- const alignClass = $derived.by(() => {
46
- let alignment = align || thisColumnInfo?.align || (thisColumnInfo?.numeric ? 'right' : undefined)
47
- if (bs5 && alignment === 'right') {
48
- alignment = 'end'
49
- } else if (bs5 && alignment === 'left') {
50
- alignment = 'start'
51
- }
52
- return alignment ? (`text-${alignment}` as const) : ''
53
- })
54
- const visible = $derived(thisColumnInfo?.visible ?? true)
55
-
56
- /** Handle `stopPropagation` and `enterGoesDown` props */
57
- function onkeypress(event: KeyboardEvent) {
58
- if (event.key === 'Enter') {
59
- event.stopPropagation()
60
- event.preventDefault()
61
- }
62
-
63
- if (event.key === 'Enter' && enterGoesDown) {
64
- const target = event.target
65
- if (!(target instanceof HTMLElement)) {
66
- return
67
- }
68
- const tr = target?.closest('tr') ?? null
69
- const td = target?.closest('td') ?? null
70
- const tdIndex = td ? Array.from(tr?.children ?? []).indexOf(td) : -1
71
- const allTrs = Array.from(tr?.parentElement?.children ?? [])
72
-
73
- // if they're holding shift, reverse the tr list
74
- if (event.shiftKey) {
75
- allTrs.reverse()
76
- }
77
- // Find the next Td in the column with a non-disabled input, select, or textarea
78
- const lastTrIndex = tr ? allTrs.indexOf(tr) : -1
79
- const newTrIndex = allTrs.findIndex(
80
- (tr, index) =>
81
- index > lastTrIndex &&
82
- tr.children[tdIndex]?.querySelector('input:enabled, select:enabled, textarea:enabled') &&
83
- tr instanceof HTMLTableRowElement &&
84
- tr.offsetParent !== null,
85
- )
86
- const theTd = allTrs[newTrIndex]?.children[tdIndex] ?? null
87
- theTd?.querySelector<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>('input,select,textarea')?.focus()
88
- if (typeof enterGoesDown === 'function') {
89
- enterGoesDown({
90
- tr: allTrs[newTrIndex] as HTMLTableRowElement,
91
- event,
92
- })
93
- }
94
- }
95
- }
96
-
97
- onMount(() => {
98
- if (!(property in columnInfo.current)) {
99
- console.warn(
100
- `Column "${property}" does not exist in its parent Table component's list of columns.\r\n\r\nPlease check that this Td's "property" prop matches the "property" prop of one of the columns in the parent Table component.`,
101
- )
102
- }
103
- })
104
- </script>
105
-
106
- {#if visible}
107
- <td
108
- class={[classNames, alignClass]}
109
- {...rest}
110
- style:font-variant-numeric={thisColumnInfo?.numeric ? 'tabular-nums' : undefined}
111
- style:overflow={$columnResizingEnabled ? 'hidden' : undefined}
112
- style:text-overflow={$columnResizingEnabled ? 'ellipsis' : undefined}
113
- >
114
- <!--
115
- Don't listen to events that the user hasn't turned on the features for.
116
- Also, put them on a span so they can still click in the td to click the row but not the td's child content
117
- -->
118
- {#if stopPropagation || enterGoesDown}
119
- <!-- svelte-ignore a11y_no_static_element_interactions -->
120
- <span
121
- onclick={stopPropagation ? e => e.stopPropagation() : undefined}
122
- {onkeypress}
123
- >
124
- {@render children?.()}
125
- </span>
126
- {:else}
127
- {@render children?.()}
128
- {/if}
129
- </td>
130
- {/if}
131
-
132
- <style>
133
- td.text-right :global(input),
134
- td.text-end :global(input) {
135
- text-align: right;
136
- }
137
- td.text-right :global(select),
138
- td.text-end :global(select) {
139
- text-align: right;
140
- }
141
- td.text-right :global(textarea),
142
- td.text-end :global(textarea) {
143
- text-align: right;
144
- }
145
-
146
- /* BS5 uses floats for checkbox alignment, which overrides the text align classes, so undo that here. */
147
- td:where(.text-start, .text-center, .text-end) :global(.form-check-input) {
148
- float: unset;
149
- }
150
- </style>
1
+ <script lang="ts">
2
+ import type { UuidRowProps } from './'
3
+ import type { ColumnInfoRunicStore } from './column-info-store.svelte'
4
+ import type { HTMLTdAttributes, ClassValue } from 'svelte/elements'
5
+ import type { Writable } from 'svelte/store'
6
+ import { getContext, onMount, type Snippet } from 'svelte'
7
+
8
+ // Get the columnInfo store from the Table component
9
+ const columnInfo = getContext<ColumnInfoRunicStore<UuidRowProps>>('columnInfo')
10
+ const columnResizingEnabled = getContext<Writable<boolean>>('columnResizingEnabled')
11
+ const bs5 = getContext<boolean>('bs5')
12
+
13
+ interface Props extends Omit<HTMLTdAttributes, 'align'> {
14
+ class?: ClassValue
15
+ property: string
16
+ /** Direction to align the column's contents
17
+ *
18
+ * `start` and `end` are only available in Bootstrap 5+
19
+ *
20
+ * `left` and `right`should only be used while you transition to Boostrap 5+
21
+ */
22
+ align?: 'start' | 'left' | 'center' | 'right' | 'end'
23
+ /** If enabled, pressing enter while focused in this Td will focus the next non-disabled input/select/textarea in the column. Holding shift will go up instead of down.
24
+ *
25
+ * Can also be a callback that is fired when the enter key is used to move between rows.
26
+ */
27
+ enterGoesDown?: boolean | ((ctx: { event: KeyboardEvent; tr: HTMLTableRowElement }) => void)
28
+ /** If enabled, keypress (enter only) and click events on the Td's contents will have `stopPropagation`/`preventDefault` called on them. */
29
+ stopPropagation?: boolean
30
+ children?: Snippet
31
+ }
32
+
33
+ let {
34
+ //
35
+ class: classNames = '',
36
+ property,
37
+ align = $bindable(columnInfo.current[property]?.align),
38
+ enterGoesDown = false,
39
+ stopPropagation = false,
40
+ children,
41
+ ...rest
42
+ }: Props = $props()
43
+
44
+ const thisColumnInfo = $derived(columnInfo.current[property])
45
+ const alignClass = $derived.by(() => {
46
+ let alignment = align || thisColumnInfo?.align || (thisColumnInfo?.numeric ? 'right' : undefined)
47
+ if (bs5 && alignment === 'right') {
48
+ alignment = 'end'
49
+ } else if (bs5 && alignment === 'left') {
50
+ alignment = 'start'
51
+ }
52
+ return alignment ? (`text-${alignment}` as const) : ''
53
+ })
54
+ const visible = $derived(thisColumnInfo?.visible ?? true)
55
+
56
+ /** Handle `stopPropagation` and `enterGoesDown` props */
57
+ function onkeypress(event: KeyboardEvent) {
58
+ if (event.key === 'Enter') {
59
+ event.stopPropagation()
60
+ event.preventDefault()
61
+ }
62
+
63
+ if (event.key === 'Enter' && enterGoesDown) {
64
+ const target = event.target
65
+ if (!(target instanceof HTMLElement)) {
66
+ return
67
+ }
68
+ const tr = target?.closest('tr') ?? null
69
+ const td = target?.closest('td') ?? null
70
+ const tdIndex = td ? Array.from(tr?.children ?? []).indexOf(td) : -1
71
+ const allTrs = Array.from(tr?.parentElement?.children ?? [])
72
+
73
+ // if they're holding shift, reverse the tr list
74
+ if (event.shiftKey) {
75
+ allTrs.reverse()
76
+ }
77
+ // Find the next Td in the column with a non-disabled input, select, or textarea
78
+ const lastTrIndex = tr ? allTrs.indexOf(tr) : -1
79
+ const newTrIndex = allTrs.findIndex(
80
+ (tr, index) =>
81
+ index > lastTrIndex &&
82
+ tr.children[tdIndex]?.querySelector('input:enabled, select:enabled, textarea:enabled') &&
83
+ tr instanceof HTMLTableRowElement &&
84
+ tr.offsetParent !== null,
85
+ )
86
+ const theTd = allTrs[newTrIndex]?.children[tdIndex] ?? null
87
+ theTd?.querySelector<HTMLInputElement | HTMLSelectElement | HTMLTextAreaElement>('input,select,textarea')?.focus()
88
+ if (typeof enterGoesDown === 'function') {
89
+ enterGoesDown({
90
+ tr: allTrs[newTrIndex] as HTMLTableRowElement,
91
+ event,
92
+ })
93
+ }
94
+ }
95
+ }
96
+
97
+ onMount(() => {
98
+ if (!(property in columnInfo.current)) {
99
+ console.warn(
100
+ `Column "${property}" does not exist in its parent Table component's list of columns.\r\n\r\nPlease check that this Td's "property" prop matches the "property" prop of one of the columns in the parent Table component.`,
101
+ )
102
+ }
103
+ })
104
+ </script>
105
+
106
+ {#if visible}
107
+ <td
108
+ class={[classNames, alignClass]}
109
+ {...rest}
110
+ style:font-variant-numeric={thisColumnInfo?.numeric ? 'tabular-nums' : undefined}
111
+ style:overflow={$columnResizingEnabled ? 'hidden' : undefined}
112
+ style:text-overflow={$columnResizingEnabled ? 'ellipsis' : undefined}
113
+ >
114
+ <!--
115
+ Don't listen to events that the user hasn't turned on the features for.
116
+ Also, put them on a span so they can still click in the td to click the row but not the td's child content
117
+ -->
118
+ {#if stopPropagation || enterGoesDown}
119
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
120
+ <span
121
+ onclick={stopPropagation ? e => e.stopPropagation() : undefined}
122
+ {onkeypress}
123
+ >
124
+ {@render children?.()}
125
+ </span>
126
+ {:else}
127
+ {@render children?.()}
128
+ {/if}
129
+ </td>
130
+ {/if}
131
+
132
+ <style>
133
+ td.text-right :global(input),
134
+ td.text-end :global(input) {
135
+ text-align: right;
136
+ }
137
+ td.text-right :global(select),
138
+ td.text-end :global(select) {
139
+ text-align: right;
140
+ }
141
+ td.text-right :global(textarea),
142
+ td.text-end :global(textarea) {
143
+ text-align: right;
144
+ }
145
+
146
+ /* BS5 uses floats for checkbox alignment, which overrides the text align classes, so undo that here. */
147
+ td:where(.text-start, .text-center, .text-end) :global(.form-check-input) {
148
+ float: unset;
149
+ }
150
+ </style>
@@ -1,170 +1,170 @@
1
- <script
2
- lang="ts"
3
- generics="T"
4
- >
5
- import type { Snippet } from 'svelte'
6
- import type { Writable } from 'svelte/store'
7
- import type { ClassValue } from 'svelte/elements'
8
- import type { TreeNode, IdKeyType, ParentIdKeyType } from './tree-utility.js'
9
- import TreeRow from './TreeRow.svelte'
10
-
11
- type Key = IdKeyType<T>
12
- type ParentKey = ParentIdKeyType<T>
13
- type Node = TreeNode<T, Key, ParentKey>
14
-
15
- import Button from '@isoftdata/svelte-button'
16
- import Td from './Td.svelte'
17
- import { getContext, hasContext, onMount } from 'svelte'
18
-
19
- // 2 rem nest padding -> ml-2
20
- // 1.5 rem leaf padding -> ml-3
21
- const NEST_PADDING = 1.5 // rem
22
- const LEAF_MARGIN_CLASS = 'ml-3'
23
-
24
- interface Props {
25
- property: keyof T
26
- idProp: Key
27
- parentIdProp: ParentKey
28
- node: Node
29
- depth?: number
30
- showLabel?: boolean
31
- class?: ClassValue
32
- // Snippets
33
- button?: Snippet<[{ node: Node }]>
34
- first?: Snippet<[{ node: Node }]>
35
- children?: Snippet<[{ node: Node }]>
36
- // Callbacks
37
- rowClick?: (context: { node: Node }) => void
38
- toggleFold?: (context: { expanded: boolean }) => void
39
- }
40
-
41
- let {
42
- //
43
- property,
44
- idProp,
45
- parentIdProp,
46
- node,
47
- depth = 0,
48
- showLabel = true,
49
- class: className = '',
50
- button,
51
- first,
52
- children,
53
- rowClick,
54
- toggleFold,
55
- }: Props = $props()
56
-
57
- function pad(depth: number) {
58
- return depth * NEST_PADDING + 'rem'
59
- }
60
-
61
- const selectedRowIds = getContext<Writable<(number | string)[]>>('selectedRowIds')
62
- if (!hasContext('expandedRows')) {
63
- throw new Error('TreeRow requires that the `tree` prop is set to true on a parent Table component.')
64
- }
65
- const expandedRows = getContext<Writable<Record<number | string, boolean>>>('expandedRows')
66
-
67
- let expanded = $derived($expandedRows[node[idProp] as number | string] ?? false)
68
- let icon: 'caret-down' | 'caret-right' = $derived(expanded ? 'caret-down' : 'caret-right')
69
- let buttonPadding = $derived(pad(depth))
70
- let leafPadding = $derived(pad(depth + 1))
71
- let childRows = $derived(node ? node.children : [])
72
-
73
- let selected = $derived($selectedRowIds ? $selectedRowIds.includes(node[idProp] as number | string) : false)
74
- let stringProperty = $derived(typeof property === 'string' ? property : property.toString())
75
-
76
- function setExpanded(expanded: boolean) {
77
- $expandedRows[node[idProp] as number | string] = expanded
78
- toggleFold?.({ expanded })
79
- }
80
-
81
- function onFoldClick(event: MouseEvent) {
82
- event.preventDefault()
83
- event.stopPropagation()
84
- setExpanded(!expanded)
85
- }
86
- onMount(() => {
87
- // Run this on mount so on page load, the selected row is expanded.
88
- function isExpanded(expandedRows: Record<number | string, boolean>, node: Node): boolean {
89
- if (expandedRows[node[idProp] as number | string]) {
90
- return true
91
- }
92
- if (node.children) {
93
- return node.children.some(
94
- child => isExpanded(expandedRows, child) || $selectedRowIds.includes(child[idProp] as number | string),
95
- )
96
- }
97
- return false
98
- }
99
- if (!expanded && node.children) {
100
- $expandedRows[node[idProp] as number | string] = isExpanded($expandedRows, node)
101
- }
102
- })
103
- </script>
104
-
105
- <tr
106
- class={className}
107
- class:table-primary={selected}
108
- data-id={node[idProp]}
109
- data-parentid={node[parentIdProp]}
110
- onclick={() => rowClick?.({ node })}
111
- ondblclick={onFoldClick}
112
- >
113
- <Td property={stringProperty}>
114
- {#if childRows.length}
115
- <Button
116
- size="xs"
117
- color="link"
118
- style="padding-left: {buttonPadding}; box-shadow: none!important; font-size: 1rem; text-wrap: nowrap;"
119
- icon={{ icon: icon, class: 'fa-xl', fixedWidth: true, prefix: 'fas' }}
120
- disabled={!childRows.length}
121
- colorGreyDisabled={false}
122
- onclick={onFoldClick}
123
- onkeydown={e => {
124
- if (e.key === 'ArrowRight') {
125
- setExpanded(true)
126
- } else if (e.key === 'ArrowLeft') {
127
- setExpanded(false)
128
- }
129
- }}
130
- >{@render button?.({ node })}
131
- {#if showLabel}
132
- {node[property]}
133
- {/if}
134
- </Button>
135
- {:else if showLabel}
136
- <span
137
- class={LEAF_MARGIN_CLASS}
138
- style="padding-left: {leafPadding}; text-wrap: nowrap;">{node[property]}</span
139
- >
140
- {/if}
141
- {@render first?.({ node })}
142
- </Td>
143
- <!-- The rest of the Row -->
144
- {@render children?.({ node })}
145
- </tr>
146
-
147
- {#if expanded}
148
- {#each childRows as child}
149
- <TreeRow
150
- node={child}
151
- depth={depth + 1}
152
- {property}
153
- {idProp}
154
- {parentIdProp}
155
- {showLabel}
156
- {rowClick}
157
- class={className}
158
- >
159
- {#snippet children(args)}
160
- {@render children?.(args)}
161
- {/snippet}
162
- {#snippet first(args)}
163
- {@render first?.(args)}
164
- {/snippet}
165
- {#snippet button(args)}
166
- {@render button?.(args)}
167
- {/snippet}
168
- </TreeRow>
169
- {/each}
170
- {/if}
1
+ <script
2
+ lang="ts"
3
+ generics="T"
4
+ >
5
+ import type { Snippet } from 'svelte'
6
+ import type { Writable } from 'svelte/store'
7
+ import type { ClassValue } from 'svelte/elements'
8
+ import type { TreeNode, IdKeyType, ParentIdKeyType } from './tree-utility.js'
9
+ import TreeRow from './TreeRow.svelte'
10
+
11
+ type Key = IdKeyType<T>
12
+ type ParentKey = ParentIdKeyType<T>
13
+ type Node = TreeNode<T, Key, ParentKey>
14
+
15
+ import Button from '@isoftdata/svelte-button'
16
+ import Td from './Td.svelte'
17
+ import { getContext, hasContext, onMount } from 'svelte'
18
+
19
+ // 2 rem nest padding -> ml-2
20
+ // 1.5 rem leaf padding -> ml-3
21
+ const NEST_PADDING = 1.5 // rem
22
+ const LEAF_MARGIN_CLASS = 'ml-3'
23
+
24
+ interface Props {
25
+ property: keyof T
26
+ idProp: Key
27
+ parentIdProp: ParentKey
28
+ node: Node
29
+ depth?: number
30
+ showLabel?: boolean
31
+ class?: ClassValue
32
+ // Snippets
33
+ button?: Snippet<[{ node: Node }]>
34
+ first?: Snippet<[{ node: Node }]>
35
+ children?: Snippet<[{ node: Node }]>
36
+ // Callbacks
37
+ rowClick?: (context: { node: Node }) => void
38
+ toggleFold?: (context: { expanded: boolean }) => void
39
+ }
40
+
41
+ let {
42
+ //
43
+ property,
44
+ idProp,
45
+ parentIdProp,
46
+ node,
47
+ depth = 0,
48
+ showLabel = true,
49
+ class: className = '',
50
+ button,
51
+ first,
52
+ children,
53
+ rowClick,
54
+ toggleFold,
55
+ }: Props = $props()
56
+
57
+ function pad(depth: number) {
58
+ return depth * NEST_PADDING + 'rem'
59
+ }
60
+
61
+ const selectedRowIds = getContext<Writable<(number | string)[]>>('selectedRowIds')
62
+ if (!hasContext('expandedRows')) {
63
+ throw new Error('TreeRow requires that the `tree` prop is set to true on a parent Table component.')
64
+ }
65
+ const expandedRows = getContext<Writable<Record<number | string, boolean>>>('expandedRows')
66
+
67
+ let expanded = $derived($expandedRows[node[idProp] as number | string] ?? false)
68
+ let icon: 'caret-down' | 'caret-right' = $derived(expanded ? 'caret-down' : 'caret-right')
69
+ let buttonPadding = $derived(pad(depth))
70
+ let leafPadding = $derived(pad(depth + 1))
71
+ let childRows = $derived(node ? node.children : [])
72
+
73
+ let selected = $derived($selectedRowIds ? $selectedRowIds.includes(node[idProp] as number | string) : false)
74
+ let stringProperty = $derived(typeof property === 'string' ? property : property.toString())
75
+
76
+ function setExpanded(expanded: boolean) {
77
+ $expandedRows[node[idProp] as number | string] = expanded
78
+ toggleFold?.({ expanded })
79
+ }
80
+
81
+ function onFoldClick(event: MouseEvent) {
82
+ event.preventDefault()
83
+ event.stopPropagation()
84
+ setExpanded(!expanded)
85
+ }
86
+ onMount(() => {
87
+ // Run this on mount so on page load, the selected row is expanded.
88
+ function isExpanded(expandedRows: Record<number | string, boolean>, node: Node): boolean {
89
+ if (expandedRows[node[idProp] as number | string]) {
90
+ return true
91
+ }
92
+ if (node.children) {
93
+ return node.children.some(
94
+ child => isExpanded(expandedRows, child) || $selectedRowIds.includes(child[idProp] as number | string),
95
+ )
96
+ }
97
+ return false
98
+ }
99
+ if (!expanded && node.children) {
100
+ $expandedRows[node[idProp] as number | string] = isExpanded($expandedRows, node)
101
+ }
102
+ })
103
+ </script>
104
+
105
+ <tr
106
+ class={className}
107
+ class:table-primary={selected}
108
+ data-id={node[idProp]}
109
+ data-parentid={node[parentIdProp]}
110
+ onclick={() => rowClick?.({ node })}
111
+ ondblclick={onFoldClick}
112
+ >
113
+ <Td property={stringProperty}>
114
+ {#if childRows.length}
115
+ <Button
116
+ size="xs"
117
+ color="link"
118
+ style="padding-left: {buttonPadding}; box-shadow: none!important; font-size: 1rem; text-wrap: nowrap;"
119
+ icon={{ icon: icon, class: 'fa-xl', fixedWidth: true, prefix: 'fas' }}
120
+ disabled={!childRows.length}
121
+ colorGreyDisabled={false}
122
+ onclick={onFoldClick}
123
+ onkeydown={e => {
124
+ if (e.key === 'ArrowRight') {
125
+ setExpanded(true)
126
+ } else if (e.key === 'ArrowLeft') {
127
+ setExpanded(false)
128
+ }
129
+ }}
130
+ >{@render button?.({ node })}
131
+ {#if showLabel}
132
+ {node[property]}
133
+ {/if}
134
+ </Button>
135
+ {:else if showLabel}
136
+ <span
137
+ class={LEAF_MARGIN_CLASS}
138
+ style="padding-left: {leafPadding}; text-wrap: nowrap;">{node[property]}</span
139
+ >
140
+ {/if}
141
+ {@render first?.({ node })}
142
+ </Td>
143
+ <!-- The rest of the Row -->
144
+ {@render children?.({ node })}
145
+ </tr>
146
+
147
+ {#if expanded}
148
+ {#each childRows as child}
149
+ <TreeRow
150
+ node={child}
151
+ depth={depth + 1}
152
+ {property}
153
+ {idProp}
154
+ {parentIdProp}
155
+ {showLabel}
156
+ {rowClick}
157
+ class={className}
158
+ >
159
+ {#snippet children(args)}
160
+ {@render children?.(args)}
161
+ {/snippet}
162
+ {#snippet first(args)}
163
+ {@render first?.(args)}
164
+ {/snippet}
165
+ {#snippet button(args)}
166
+ {@render button?.(args)}
167
+ {/snippet}
168
+ </TreeRow>
169
+ {/each}
170
+ {/if}
package/package.json CHANGED
@@ -1,6 +1,17 @@
1
1
  {
2
2
  "name": "@isoftdata/svelte-table",
3
- "version": "2.6.5",
3
+ "version": "2.6.6",
4
+ "scripts": {
5
+ "dev": "vite dev",
6
+ "build": "vite build && npm run package",
7
+ "preview": "vite preview",
8
+ "package": "svelte-kit sync && svelte-package && publint",
9
+ "prepublishOnly": "npm run package",
10
+ "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
11
+ "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
12
+ "lint": "prettier --plugin-search-dir . --check . && eslint .",
13
+ "format": "prettier --plugin-search-dir . --write ."
14
+ },
4
15
  "exports": {
5
16
  ".": {
6
17
  "types": "./dist/index.d.ts",
@@ -64,15 +75,5 @@
64
75
  },
65
76
  "engines": {
66
77
  "pnpm": "10.x"
67
- },
68
- "scripts": {
69
- "dev": "vite dev",
70
- "build": "vite build && npm run package",
71
- "preview": "vite preview",
72
- "package": "svelte-kit sync && svelte-package && publint",
73
- "check": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json",
74
- "check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
75
- "lint": "prettier --plugin-search-dir . --check . && eslint .",
76
- "format": "prettier --plugin-search-dir . --write ."
77
78
  }
78
- }
79
+ }