@lavalogic/scoria 0.10.0 → 0.10.1
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/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +14 -23
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte.d.ts +0 -1
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +28 -30
- package/dist/Components/Table/Types/Columns/DisplayType.d.ts +0 -1
- package/dist/Components/Table/Types/Columns/DisplayType.js +1 -1
- package/package.json +1 -1
|
@@ -10,13 +10,12 @@
|
|
|
10
10
|
|
|
11
11
|
export interface FocusableImmutableCellProps<T extends object> {
|
|
12
12
|
cell: TableCell<T>;
|
|
13
|
-
value?: unknown;
|
|
14
13
|
children?: Snippet;
|
|
15
14
|
}
|
|
16
15
|
</script>
|
|
17
16
|
|
|
18
17
|
<script lang="ts" generics="T extends object">
|
|
19
|
-
const { cell,
|
|
18
|
+
const { cell, children }: FocusableImmutableCellProps<T> = $props();
|
|
20
19
|
|
|
21
20
|
const value = $derived(cell.getValue());
|
|
22
21
|
|
|
@@ -72,27 +71,19 @@ class:bottom={focusDetails.bottomEdge} -->
|
|
|
72
71
|
}}
|
|
73
72
|
>
|
|
74
73
|
{#if hasValue}
|
|
75
|
-
{#
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
{
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
? options.find((it) => it.value === value)?.label
|
|
89
|
-
: value) ??
|
|
90
|
-
value ??
|
|
91
|
-
''}
|
|
92
|
-
{:catch e}
|
|
93
|
-
{e?.toString()}
|
|
94
|
-
{/await}
|
|
95
|
-
{/if}
|
|
74
|
+
{#await visibleValue}
|
|
75
|
+
loading…
|
|
76
|
+
{:then visibleValue}
|
|
77
|
+
{(visibleValue instanceof Date
|
|
78
|
+
? visibleValue.toLocaleDateString()
|
|
79
|
+
: options.length
|
|
80
|
+
? options.find((it) => it.value === visibleValue)?.label
|
|
81
|
+
: visibleValue) ??
|
|
82
|
+
visibleValue ??
|
|
83
|
+
''}
|
|
84
|
+
{:catch e}
|
|
85
|
+
{e?.toString()}
|
|
86
|
+
{/await}
|
|
96
87
|
{:else if children}
|
|
97
88
|
<div
|
|
98
89
|
class="slot-wrapper"
|
|
@@ -2,7 +2,6 @@ import { type Snippet } from 'svelte';
|
|
|
2
2
|
import type { TableCell } from '../../../Types/Columns/TableCell.js';
|
|
3
3
|
export interface FocusableImmutableCellProps<T extends object> {
|
|
4
4
|
cell: TableCell<T>;
|
|
5
|
-
value?: unknown;
|
|
6
5
|
children?: Snippet;
|
|
7
6
|
}
|
|
8
7
|
declare function $$render<T extends object>(): {
|
|
@@ -58,9 +58,7 @@
|
|
|
58
58
|
{#if cell.column.getIsVisible()}
|
|
59
59
|
{@const columnDef = cell.column.columnDef}
|
|
60
60
|
|
|
61
|
-
{#if
|
|
62
|
-
<ValidityCell {cell} />
|
|
63
|
-
{:else if columnDef instanceof RowSelectionDef}
|
|
61
|
+
{#if columnDef instanceof RowSelectionDef}
|
|
64
62
|
<TableRowSelectionCheckbox {cell} />
|
|
65
63
|
{:else if isActionsDef(cell)}
|
|
66
64
|
<ActionsCell {cell} />
|
|
@@ -68,6 +66,18 @@
|
|
|
68
66
|
<ExpandCell {cell} {expandedColumnDef} {onExpandChange} />
|
|
69
67
|
{:else if columnDef.columnType !== ColumnType.Display}
|
|
70
68
|
<AccessorComponent {cell} />
|
|
69
|
+
{:else if cell.column.columnDef instanceof AbstractDisplayDef}
|
|
70
|
+
{#if cell.column.columnDef.displayType === DisplayType.Bubbles}
|
|
71
|
+
<BubbleCell {cell} />
|
|
72
|
+
{:else if cell.column.columnDef.displayType === DisplayType.Validity}
|
|
73
|
+
<ValidityCell {cell} />
|
|
74
|
+
{:else if isProgressBarTableCell(cell)}
|
|
75
|
+
<ProgressCell {cell} />
|
|
76
|
+
{:else if cell.column.columnDef.displayType === DisplayType.Normal}
|
|
77
|
+
<FocusableImmutableCell {cell} />
|
|
78
|
+
{:else}
|
|
79
|
+
{@debug cell}
|
|
80
|
+
{/if}
|
|
71
81
|
{:else}
|
|
72
82
|
{@const valueOrComponentPromise =
|
|
73
83
|
cell.column.columnDef.accessorFn?.(cell.row.original, cell.row.originalIndex) ??
|
|
@@ -75,35 +85,23 @@
|
|
|
75
85
|
null}
|
|
76
86
|
|
|
77
87
|
{#await valueOrComponentPromise}
|
|
78
|
-
<FocusableImmutableCell
|
|
79
|
-
{:then
|
|
80
|
-
{
|
|
88
|
+
<FocusableImmutableCell {cell} />
|
|
89
|
+
{:then Value}
|
|
90
|
+
{#if Value == null || typeof Value === 'string' || typeof Value == 'number'}
|
|
91
|
+
<FocusableImmutableCell {cell} />
|
|
92
|
+
{:else if valueOrComponentIsConstructor(Value)}
|
|
93
|
+
<FocusableImmutableCell {cell}>
|
|
94
|
+
<Value {cell} />
|
|
95
|
+
</FocusableImmutableCell>
|
|
96
|
+
{:else if typeof Value === 'function'}
|
|
97
|
+
<FocusableImmutableCell {cell}>
|
|
98
|
+
{@render Value(cell)}
|
|
99
|
+
</FocusableImmutableCell>
|
|
100
|
+
{:else}
|
|
101
|
+
{@debug cell}
|
|
102
|
+
{/if}
|
|
81
103
|
{:catch e}
|
|
82
104
|
<FocusableImmutableCell value={e?.toString()} {cell} />
|
|
83
105
|
{/await}
|
|
84
106
|
{/if}
|
|
85
107
|
{/if}
|
|
86
|
-
|
|
87
|
-
{#snippet ValueFallback(Value: unknown)}
|
|
88
|
-
{#if cell.column.columnDef instanceof AbstractDisplayDef && Array.isArray(Value)}
|
|
89
|
-
{#if cell.column.columnDef.displayType === DisplayType.Bubbles}
|
|
90
|
-
<BubbleCell {cell} />
|
|
91
|
-
{:else if isProgressBarTableCell(cell)}
|
|
92
|
-
<ProgressCell {cell} />
|
|
93
|
-
{:else}
|
|
94
|
-
{@debug cell}
|
|
95
|
-
{/if}
|
|
96
|
-
{:else if Value == null || typeof Value === 'string' || typeof Value == 'number'}
|
|
97
|
-
<FocusableImmutableCell value={Value} {cell} />
|
|
98
|
-
{:else if valueOrComponentIsConstructor(Value)}
|
|
99
|
-
<FocusableImmutableCell {cell}>
|
|
100
|
-
<Value {cell} />
|
|
101
|
-
</FocusableImmutableCell>
|
|
102
|
-
{:else if typeof Value === 'function'}
|
|
103
|
-
<FocusableImmutableCell {cell}>
|
|
104
|
-
{@render Value(cell)}
|
|
105
|
-
</FocusableImmutableCell>
|
|
106
|
-
{:else}
|
|
107
|
-
{@debug cell}
|
|
108
|
-
{/if}
|
|
109
|
-
{/snippet}
|