@ims360/svelte-ivory 0.1.2 → 0.1.3
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.
|
@@ -21,8 +21,6 @@
|
|
|
21
21
|
rowHeight?: number;
|
|
22
22
|
/** Renders the rows */
|
|
23
23
|
children?: Snippet<[{ row: T; nestingLevel?: number; index: number }]>;
|
|
24
|
-
/** Add columns in front of the tree-indicator */
|
|
25
|
-
firstColumn?: Snippet<[{ row: T }]>;
|
|
26
24
|
rowClass?: ClassValue;
|
|
27
25
|
headerClass?: ClassValue;
|
|
28
26
|
search?: {
|
|
@@ -68,7 +66,6 @@
|
|
|
68
66
|
class: clazz,
|
|
69
67
|
data,
|
|
70
68
|
children: passedChildren,
|
|
71
|
-
firstColumn,
|
|
72
69
|
rowClass = 'hover:bg-surface-950-50/10 transition-colors',
|
|
73
70
|
headerClass,
|
|
74
71
|
rowHeight = 64,
|
|
@@ -216,7 +213,7 @@
|
|
|
216
213
|
)
|
|
217
214
|
)}
|
|
218
215
|
>
|
|
219
|
-
{#if
|
|
216
|
+
{#if results.someHaveChildren}
|
|
220
217
|
<ColumnHead column={treeIndicatorColumn}></ColumnHead>
|
|
221
218
|
{/if}
|
|
222
219
|
{#each externalColumns || columns as column (column.id)}
|
|
@@ -236,30 +233,31 @@
|
|
|
236
233
|
{/snippet}
|
|
237
234
|
{#snippet children({ row: { node, id, nestingLevel }, index })}
|
|
238
235
|
<Row href={href?.(node)} onclick={onclick ? () => onclick(node) : undefined}>
|
|
239
|
-
{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
>
|
|
248
|
-
<div
|
|
249
|
-
class="flex h-full items-center justify-end"
|
|
250
|
-
style="width: calc(var(--spacing) * {nestingLevel * nestingInset -
|
|
251
|
-
2} + {treeIndicatorInset}px);"
|
|
236
|
+
{#if results.someHaveChildren}
|
|
237
|
+
<ColumnComponent
|
|
238
|
+
{...treeIndicatorColumnConfig}
|
|
239
|
+
onclick={() => {
|
|
240
|
+
toggleExpansion(node.id);
|
|
241
|
+
}}
|
|
242
|
+
width={treeIndicatorInset}
|
|
243
|
+
ignoreWidth
|
|
252
244
|
>
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
245
|
+
<div
|
|
246
|
+
class="flex h-full items-center justify-end"
|
|
247
|
+
style="width: calc(var(--spacing) * {nestingLevel * nestingInset -
|
|
248
|
+
2} + {treeIndicatorInset}px);"
|
|
249
|
+
>
|
|
250
|
+
{#if node.children}
|
|
251
|
+
<ChevronRight
|
|
252
|
+
class={[
|
|
253
|
+
'ml-auto aspect-square shrink-0 transition-transform duration-100',
|
|
254
|
+
expanded.has(id) && 'rotate-90'
|
|
255
|
+
]}
|
|
256
|
+
/>
|
|
257
|
+
{/if}
|
|
258
|
+
</div>
|
|
259
|
+
</ColumnComponent>
|
|
260
|
+
{/if}
|
|
263
261
|
{@render passedChildren?.({ row: node, nestingLevel, index })}
|
|
264
262
|
</Row>
|
|
265
263
|
{/snippet}
|
|
@@ -15,10 +15,6 @@ export interface TableProps<T extends TableRow<T>> {
|
|
|
15
15
|
nestingLevel?: number;
|
|
16
16
|
index: number;
|
|
17
17
|
}]>;
|
|
18
|
-
/** Add columns in front of the tree-indicator */
|
|
19
|
-
firstColumn?: Snippet<[{
|
|
20
|
-
row: T;
|
|
21
|
-
}]>;
|
|
22
18
|
rowClass?: ClassValue;
|
|
23
19
|
headerClass?: ClassValue;
|
|
24
20
|
search?: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.svelte.d.ts","sourceRoot":"","sources":["../../../src/lib/components/table/Table.svelte.ts"],"names":[],"mappings":"AAKI,OAAO,EAAmC,KAAK,OAAO,EAAE,MAAM,QAAQ,CAAC;AACvE,OA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C,CAAC,CAAA;KAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAChZ,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC;IAC/I,YAAY,CAAC,EAAE,UAAU,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;CACjE;AACD,QAAA,MAAM,KAAK,EAAE,qBAAmC,CAAC;AAC/B,KAAK,KAAK,CAAC,CAAC,SAAS,QAAQ,CAAC,CAAC,CAAC,IAAI,YAAY,CAAC,OAAO,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;AACpE,eAAe,KAAK,CAAC"}
|
package/package.json
CHANGED
|
@@ -21,8 +21,6 @@
|
|
|
21
21
|
rowHeight?: number;
|
|
22
22
|
/** Renders the rows */
|
|
23
23
|
children?: Snippet<[{ row: T; nestingLevel?: number; index: number }]>;
|
|
24
|
-
/** Add columns in front of the tree-indicator */
|
|
25
|
-
firstColumn?: Snippet<[{ row: T }]>;
|
|
26
24
|
rowClass?: ClassValue;
|
|
27
25
|
headerClass?: ClassValue;
|
|
28
26
|
search?: {
|
|
@@ -68,7 +66,6 @@
|
|
|
68
66
|
class: clazz,
|
|
69
67
|
data,
|
|
70
68
|
children: passedChildren,
|
|
71
|
-
firstColumn,
|
|
72
69
|
rowClass = 'hover:bg-surface-950-50/10 transition-colors',
|
|
73
70
|
headerClass,
|
|
74
71
|
rowHeight = 64,
|
|
@@ -216,7 +213,7 @@
|
|
|
216
213
|
)
|
|
217
214
|
)}
|
|
218
215
|
>
|
|
219
|
-
{#if
|
|
216
|
+
{#if results.someHaveChildren}
|
|
220
217
|
<ColumnHead column={treeIndicatorColumn}></ColumnHead>
|
|
221
218
|
{/if}
|
|
222
219
|
{#each externalColumns || columns as column (column.id)}
|
|
@@ -236,30 +233,31 @@
|
|
|
236
233
|
{/snippet}
|
|
237
234
|
{#snippet children({ row: { node, id, nestingLevel }, index })}
|
|
238
235
|
<Row href={href?.(node)} onclick={onclick ? () => onclick(node) : undefined}>
|
|
239
|
-
{
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
>
|
|
248
|
-
<div
|
|
249
|
-
class="flex h-full items-center justify-end"
|
|
250
|
-
style="width: calc(var(--spacing) * {nestingLevel * nestingInset -
|
|
251
|
-
2} + {treeIndicatorInset}px);"
|
|
236
|
+
{#if results.someHaveChildren}
|
|
237
|
+
<ColumnComponent
|
|
238
|
+
{...treeIndicatorColumnConfig}
|
|
239
|
+
onclick={() => {
|
|
240
|
+
toggleExpansion(node.id);
|
|
241
|
+
}}
|
|
242
|
+
width={treeIndicatorInset}
|
|
243
|
+
ignoreWidth
|
|
252
244
|
>
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
245
|
+
<div
|
|
246
|
+
class="flex h-full items-center justify-end"
|
|
247
|
+
style="width: calc(var(--spacing) * {nestingLevel * nestingInset -
|
|
248
|
+
2} + {treeIndicatorInset}px);"
|
|
249
|
+
>
|
|
250
|
+
{#if node.children}
|
|
251
|
+
<ChevronRight
|
|
252
|
+
class={[
|
|
253
|
+
'ml-auto aspect-square shrink-0 transition-transform duration-100',
|
|
254
|
+
expanded.has(id) && 'rotate-90'
|
|
255
|
+
]}
|
|
256
|
+
/>
|
|
257
|
+
{/if}
|
|
258
|
+
</div>
|
|
259
|
+
</ColumnComponent>
|
|
260
|
+
{/if}
|
|
263
261
|
{@render passedChildren?.({ row: node, nestingLevel, index })}
|
|
264
262
|
</Row>
|
|
265
263
|
{/snippet}
|