@ims360/svelte-ivory 0.1.2 → 0.1.4
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/components/layout/hiddenBackground/HiddenBackground.svelte +3 -6
- package/dist/components/layout/hiddenBackground/HiddenBackground.svelte.d.ts +1 -1
- package/dist/components/layout/hiddenBackground/HiddenBackground.svelte.d.ts.map +1 -1
- package/dist/components/table/Table.svelte +25 -27
- package/dist/components/table/Table.svelte.d.ts +0 -4
- package/dist/components/table/Table.svelte.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/lib/components/layout/hiddenBackground/HiddenBackground.svelte +3 -6
- package/src/lib/components/table/Table.svelte +25 -27
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
globalClass = value;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export interface HiddenBackgroundProps
|
|
16
|
-
extends IvoryComponent<HTMLDialogElement>,
|
|
17
|
-
TransitionProps {
|
|
15
|
+
export interface HiddenBackgroundProps extends IvoryComponent<HTMLDivElement>, TransitionProps {
|
|
18
16
|
/** Gets called when the dialog is clicked */
|
|
19
17
|
onclose?: () => void;
|
|
20
18
|
}
|
|
@@ -31,7 +29,7 @@
|
|
|
31
29
|
}: HiddenBackgroundProps = $props();
|
|
32
30
|
</script>
|
|
33
31
|
|
|
34
|
-
<
|
|
32
|
+
<div
|
|
35
33
|
class={twMerge(
|
|
36
34
|
clsx(
|
|
37
35
|
'bg-surface-950-50/40 pointer-events-auto absolute top-0 left-0 z-40 m-0 h-full w-full p-0',
|
|
@@ -39,7 +37,6 @@
|
|
|
39
37
|
clazz
|
|
40
38
|
)
|
|
41
39
|
)}
|
|
42
|
-
open
|
|
43
40
|
use:focusTrap={true}
|
|
44
41
|
{@attach shortcut({
|
|
45
42
|
code: 'Escape',
|
|
@@ -51,4 +48,4 @@
|
|
|
51
48
|
{...rest}
|
|
52
49
|
>
|
|
53
50
|
{@render children?.()}
|
|
54
|
-
</
|
|
51
|
+
</div>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { IvoryComponent, TransitionProps } from '../../../types';
|
|
2
2
|
import type { ClassValue } from 'svelte/elements';
|
|
3
3
|
export declare function setClasses(value: ClassValue): void;
|
|
4
|
-
export interface HiddenBackgroundProps extends IvoryComponent<
|
|
4
|
+
export interface HiddenBackgroundProps extends IvoryComponent<HTMLDivElement>, TransitionProps {
|
|
5
5
|
/** Gets called when the dialog is clicked */
|
|
6
6
|
onclose?: () => void;
|
|
7
7
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HiddenBackground.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/hiddenBackground/HiddenBackground.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAOlD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,QAE3C;AAED,MAAM,WAAW,
|
|
1
|
+
{"version":3,"file":"HiddenBackground.svelte.d.ts","sourceRoot":"","sources":["../../../../src/lib/components/layout/hiddenBackground/HiddenBackground.svelte.ts"],"names":[],"mappings":"AAGI,OAAO,KAAK,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAElE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAOlD,wBAAgB,UAAU,CAAC,KAAK,EAAE,UAAU,QAE3C;AAED,MAAM,WAAW,qBAAsB,SAAQ,cAAc,CAAC,cAAc,CAAC,EAAE,eAAe;IAC1F,6CAA6C;IAC7C,OAAO,CAAC,EAAE,MAAM,IAAI,CAAC;CACxB;AA8BL,QAAA,MAAM,gBAAgB,2DAAwC,CAAC;AAC/D,KAAK,gBAAgB,GAAG,UAAU,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAC5D,eAAe,gBAAgB,CAAC"}
|
|
@@ -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,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAG9C,OAAO,E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,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
|
@@ -12,9 +12,7 @@
|
|
|
12
12
|
globalClass = value;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
export interface HiddenBackgroundProps
|
|
16
|
-
extends IvoryComponent<HTMLDialogElement>,
|
|
17
|
-
TransitionProps {
|
|
15
|
+
export interface HiddenBackgroundProps extends IvoryComponent<HTMLDivElement>, TransitionProps {
|
|
18
16
|
/** Gets called when the dialog is clicked */
|
|
19
17
|
onclose?: () => void;
|
|
20
18
|
}
|
|
@@ -31,7 +29,7 @@
|
|
|
31
29
|
}: HiddenBackgroundProps = $props();
|
|
32
30
|
</script>
|
|
33
31
|
|
|
34
|
-
<
|
|
32
|
+
<div
|
|
35
33
|
class={twMerge(
|
|
36
34
|
clsx(
|
|
37
35
|
'bg-surface-950-50/40 pointer-events-auto absolute top-0 left-0 z-40 m-0 h-full w-full p-0',
|
|
@@ -39,7 +37,6 @@
|
|
|
39
37
|
clazz
|
|
40
38
|
)
|
|
41
39
|
)}
|
|
42
|
-
open
|
|
43
40
|
use:focusTrap={true}
|
|
44
41
|
{@attach shortcut({
|
|
45
42
|
code: 'Escape',
|
|
@@ -51,4 +48,4 @@
|
|
|
51
48
|
{...rest}
|
|
52
49
|
>
|
|
53
50
|
{@render children?.()}
|
|
54
|
-
</
|
|
51
|
+
</div>
|
|
@@ -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}
|