@lavalogic/scoria 0.16.3 → 0.17.0
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/QuickSearchCell.svelte +2 -2
- package/dist/Components/Table/Body/QuickSearchCell.svelte.d.ts +12 -12
- package/dist/Components/Table/Body/QuickSearchCellProps.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +9 -3
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +10 -4
- package/dist/Components/Table/Body/Rows/ColumnListRowProps.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +17 -5
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +9 -3
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +3 -3
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +5 -2
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +13 -6
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +9 -3
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +13 -3
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +6 -4
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +10 -4
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +11 -5
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +10 -5
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte.d.ts +1 -2
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +14 -5
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +6 -3
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +19 -9
- package/dist/Components/Table/Body/Rows/TableRow.svelte +9 -8
- package/dist/Components/Table/Body/Rows/TableRow.svelte.d.ts +2 -10
- package/dist/Components/Table/Body/TableBody.svelte +32 -21
- package/dist/Components/Table/Body/TableBody.svelte.d.ts +2 -10
- package/dist/Components/Table/Body/TableBodyProps.d.ts +0 -2
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +26 -26
- package/dist/Components/Table/Headers/TableHead.svelte +20 -6
- package/dist/Components/Table/Misc/ColumnPanel.svelte +13 -4
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +9 -2
- package/dist/Components/Table/Misc/FilterInput.svelte +5 -2
- package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +12 -12
- package/dist/Components/Table/Misc/FilterInputProps.d.ts +2 -2
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +14 -4
- package/dist/Components/Table/Misc/TableSidebar.svelte +14 -8
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +4 -1
- package/dist/Components/Table/Table.svelte +107 -67
- package/dist/Components/Table/Types/Columns/Column.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +2 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.d.ts +2 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts +2 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.d.ts +4 -5
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.d.ts +2 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +2 -3
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +3 -4
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDefSet.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +7 -6
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +1 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +5 -6
- package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +6 -6
- package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +5 -6
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +4 -5
- package/dist/Components/Table/Types/Columns/Definitions/JSONColumnDefSet.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +2 -1
- package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js +1 -1
- package/dist/Components/Table/Types/Columns/DefsWrapper.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/TableCell.d.ts +2 -2
- package/dist/Components/Table/Types/Context/Row.d.ts +3 -3
- package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +2 -2
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +32 -32
- package/dist/Components/Table/Types/DataRepository/IDataRepository.d.ts +1 -1
- package/dist/Components/Table/Types/DataRepository/ILocalDataRepository.d.ts +1 -1
- package/dist/Components/Table/Types/DataRepository/IRemoteDataRepository.d.ts +1 -1
- package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.d.ts +3 -3
- package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.js +5 -5
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.d.ts +2 -2
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +1 -1
- package/dist/Components/Table/Types/Filtering/ColumnFiltersState.d.ts +2 -2
- package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.d.ts +4 -4
- package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.js +1 -1
- package/dist/Components/Table/Types/Header.d.ts +2 -2
- package/dist/Components/Table/Types/HeaderGroup.d.ts +1 -1
- package/dist/Types/Examples/ExampleModal.svelte.d.ts +1 -1
- package/dist/index.d.ts +48 -49
- package/dist/index.js +42 -50
- package/package.json +1 -1
- package/dist/Components/Table/Types/Filtering/CustomFilterFn.d.ts +0 -2
- package/dist/Components/Table/Types/Filtering/CustomFilterFn.js +0 -1
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
module
|
|
6
|
+
>
|
|
4
7
|
import Action from '../../../../Action.svelte';
|
|
5
8
|
import type { IconProps } from '../../../../IconProps.js';
|
|
6
9
|
import Portal from '../../../../Portal.svelte';
|
|
@@ -17,26 +20,29 @@
|
|
|
17
20
|
[Validity.Invalid]: {
|
|
18
21
|
name: 'circle-cross',
|
|
19
22
|
colour: Colour['$error-border'],
|
|
20
|
-
size: Size.Medium
|
|
23
|
+
size: Size.Medium,
|
|
21
24
|
},
|
|
22
25
|
[Validity.Valid]: { name: 'circle-tick', colour: Colour['$brand-primary'], size: Size.Medium },
|
|
23
26
|
[Validity.Info]: {
|
|
24
27
|
name: 'circle-information',
|
|
25
28
|
colour: Colour['$ui-blue-6'],
|
|
26
|
-
size: Size.Medium
|
|
29
|
+
size: Size.Medium,
|
|
27
30
|
},
|
|
28
31
|
[Validity.Warning]: {
|
|
29
32
|
name: 'circle-exclamation',
|
|
30
33
|
colour: Colour['$warning-border'],
|
|
31
|
-
size: Size.Medium
|
|
34
|
+
size: Size.Medium,
|
|
32
35
|
},
|
|
33
|
-
[Validity.Neutral]: { name: 'circle-minus', colour: Colour['$ui-blue-6'], size: Size.Medium }
|
|
36
|
+
[Validity.Neutral]: { name: 'circle-minus', colour: Colour['$ui-blue-6'], size: Size.Medium },
|
|
34
37
|
};
|
|
35
38
|
|
|
36
39
|
let previousFocusElement: HTMLElement | undefined = $state();
|
|
37
40
|
</script>
|
|
38
41
|
|
|
39
|
-
<script
|
|
42
|
+
<script
|
|
43
|
+
lang="ts"
|
|
44
|
+
generics="T extends object, FilterValueType"
|
|
45
|
+
>
|
|
40
46
|
import { getContext, tick, untrack } from 'svelte';
|
|
41
47
|
import type { ValidityCellProps } from './ValidityCellProps.js';
|
|
42
48
|
|
|
@@ -47,7 +53,7 @@
|
|
|
47
53
|
|
|
48
54
|
const ColumnDef = $derived(cell.column.columnDef as AbstractDisplayDef<T, FilterValueType>);
|
|
49
55
|
|
|
50
|
-
const focusDetails: TableFocusDetails<T
|
|
56
|
+
const focusDetails: TableFocusDetails<T> = $derived(
|
|
51
57
|
new TableFocusDetails(cell, tableContext, toast)
|
|
52
58
|
);
|
|
53
59
|
|
|
@@ -140,7 +146,7 @@
|
|
|
140
146
|
icon={{
|
|
141
147
|
name: 'loading',
|
|
142
148
|
colour: Colour['$ui-blue-6'],
|
|
143
|
-
size: Size.Medium
|
|
149
|
+
size: Size.Medium,
|
|
144
150
|
}}
|
|
145
151
|
/>
|
|
146
152
|
{:then maybeTuple}
|
|
@@ -163,7 +169,11 @@
|
|
|
163
169
|
</div>
|
|
164
170
|
{#if showModal}
|
|
165
171
|
<Portal target={document.body}>
|
|
166
|
-
<ColumnDef.modal
|
|
172
|
+
<ColumnDef.modal
|
|
173
|
+
{cell}
|
|
174
|
+
{onclose}
|
|
175
|
+
onsubmit={onclose}
|
|
176
|
+
/>
|
|
167
177
|
</Portal>
|
|
168
178
|
{/if}
|
|
169
179
|
</td>
|
|
@@ -94,13 +94,14 @@
|
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
|
|
98
|
-
let
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
}
|
|
97
|
+
//FIXME the below threw errors before. Please investigate
|
|
98
|
+
// let trRef: HTMLTableRowElement | undefined = $state();
|
|
99
|
+
// let _trHeight = $state(0);
|
|
100
|
+
// export const trHeight = {
|
|
101
|
+
// get value() {
|
|
102
|
+
// return _trHeight;
|
|
103
|
+
// },
|
|
104
|
+
// };
|
|
104
105
|
|
|
105
106
|
// $effect(() => {
|
|
106
107
|
// void trRef;
|
|
@@ -151,8 +152,8 @@ onMouseLeave={onMouseLeave} -->
|
|
|
151
152
|
class:alt={tableContext.alternateRowColours && odd}
|
|
152
153
|
class:highlighted
|
|
153
154
|
style={customHeight ? `height: ${customHeight}px !important;` : null}
|
|
154
|
-
bind:this={trRef}
|
|
155
155
|
>
|
|
156
|
+
<!-- bind:this={trRef} -->
|
|
156
157
|
{#if showHighlightButton}
|
|
157
158
|
<ColumnHighlight
|
|
158
159
|
rowIndex={rowIndex ??
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { TableRowProps } from './TableRowProps.js';
|
|
2
2
|
declare function $$render<T extends object>(): {
|
|
3
3
|
props: TableRowProps<T>;
|
|
4
|
-
exports: {
|
|
5
|
-
trHeight: {
|
|
6
|
-
readonly value: number;
|
|
7
|
-
};
|
|
8
|
-
};
|
|
4
|
+
exports: {};
|
|
9
5
|
bindings: "";
|
|
10
6
|
slots: {};
|
|
11
7
|
events: {};
|
|
@@ -15,11 +11,7 @@ declare class __sveltets_Render<T extends object> {
|
|
|
15
11
|
events(): ReturnType<typeof $$render<T>>['events'];
|
|
16
12
|
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
17
13
|
bindings(): "";
|
|
18
|
-
exports(): {
|
|
19
|
-
trHeight: {
|
|
20
|
-
readonly value: number;
|
|
21
|
-
};
|
|
22
|
-
};
|
|
14
|
+
exports(): {};
|
|
23
15
|
}
|
|
24
16
|
interface $$IsomorphicComponent {
|
|
25
17
|
new <T extends object>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
@@ -1,30 +1,37 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script
|
|
4
|
-
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object"
|
|
6
|
+
>
|
|
5
7
|
import { getContext } from 'svelte';
|
|
6
8
|
import { TableContext } from '../Types/Context/TableContext.svelte.js';
|
|
7
9
|
import QuickSearchCell from './QuickSearchCell.svelte';
|
|
8
10
|
import TableRow from './Rows/TableRow.svelte';
|
|
9
11
|
import type { TableBodyProps } from './TableBodyProps.js';
|
|
10
12
|
|
|
11
|
-
let {
|
|
13
|
+
let {
|
|
14
|
+
side,
|
|
15
|
+
// heights,
|
|
16
|
+
columns,
|
|
17
|
+
includeHighlight,
|
|
18
|
+
}: TableBodyProps<T> = $props();
|
|
12
19
|
|
|
13
20
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
14
21
|
|
|
15
|
-
type HasHeight = {
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
const rows: Array<TableRow<T>> = $state([]);
|
|
19
|
-
const _rowHeights = $derived(
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
);
|
|
23
|
-
export const rowHeights = {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
};
|
|
22
|
+
// type HasHeight = {
|
|
23
|
+
// trHeight: RefWrapper<number>;
|
|
24
|
+
// };
|
|
25
|
+
// const rows: Array<TableRow<T>> = $state([]);
|
|
26
|
+
// const _rowHeights = $derived(
|
|
27
|
+
// // HACK terrible type casting due to svelte type gen not being liked by eslint
|
|
28
|
+
// rows.map((it) => (it as HasHeight | undefined)?.trHeight.value ?? 0)
|
|
29
|
+
// );
|
|
30
|
+
// export const rowHeights = {
|
|
31
|
+
// get value() {
|
|
32
|
+
// return _rowHeights;
|
|
33
|
+
// }
|
|
34
|
+
// };
|
|
28
35
|
</script>
|
|
29
36
|
|
|
30
37
|
<tbody>
|
|
@@ -34,24 +41,28 @@
|
|
|
34
41
|
<td class="highlight-dud"><!-- accomodating for row marking --></td>
|
|
35
42
|
{/if}
|
|
36
43
|
{#each columns as column (column.id)}
|
|
37
|
-
<QuickSearchCell
|
|
44
|
+
<QuickSearchCell
|
|
45
|
+
{column}
|
|
46
|
+
customFilters={tableContext.remoteFilters}
|
|
47
|
+
/>
|
|
38
48
|
{/each}
|
|
39
49
|
</tr>
|
|
40
50
|
{/if}
|
|
41
51
|
<svelte:boundary>
|
|
42
52
|
{#await tableContext.paginationRowModel then prm}
|
|
43
53
|
{#each prm.rows as row, index (row)}
|
|
44
|
-
{@const customHeight = heights[index]?.applyTo.includes(side)
|
|
54
|
+
<!-- {@const customHeight = heights[index]?.applyTo.includes(side)
|
|
45
55
|
? heights[index].maxHeight
|
|
46
|
-
: undefined}
|
|
56
|
+
: undefined} -->
|
|
57
|
+
<!-- {customHeight} -->
|
|
47
58
|
<TableRow
|
|
59
|
+
customHeight={undefined}
|
|
48
60
|
{includeHighlight}
|
|
49
|
-
{customHeight}
|
|
50
61
|
{row}
|
|
51
62
|
{side}
|
|
52
63
|
odd={index % 2 == 1}
|
|
53
|
-
bind:this={rows[index]}
|
|
54
64
|
/>
|
|
65
|
+
<!-- bind:this={rows[index]} -->
|
|
55
66
|
{/each}
|
|
56
67
|
{/await}
|
|
57
68
|
</svelte:boundary>
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
import type { TableBodyProps } from './TableBodyProps.js';
|
|
2
2
|
declare function $$render<T extends object>(): {
|
|
3
3
|
props: TableBodyProps<T>;
|
|
4
|
-
exports: {
|
|
5
|
-
rowHeights: {
|
|
6
|
-
readonly value: number[];
|
|
7
|
-
};
|
|
8
|
-
};
|
|
4
|
+
exports: {};
|
|
9
5
|
bindings: "";
|
|
10
6
|
slots: {};
|
|
11
7
|
events: {};
|
|
@@ -15,11 +11,7 @@ declare class __sveltets_Render<T extends object> {
|
|
|
15
11
|
events(): ReturnType<typeof $$render<T>>['events'];
|
|
16
12
|
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
17
13
|
bindings(): "";
|
|
18
|
-
exports(): {
|
|
19
|
-
rowHeights: {
|
|
20
|
-
readonly value: number[];
|
|
21
|
-
};
|
|
22
|
-
};
|
|
14
|
+
exports(): {};
|
|
23
15
|
}
|
|
24
16
|
interface $$IsomorphicComponent {
|
|
25
17
|
new <T extends object>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Column } from '../Types/Columns/Column.js';
|
|
2
|
-
import type { HeightData } from './HeightData.js';
|
|
3
2
|
export interface TableBodyProps<T extends object> {
|
|
4
3
|
side: 'left' | 'centre' | 'right';
|
|
5
|
-
heights: Array<HeightData<T>>;
|
|
6
4
|
columns: Array<Column<T>>;
|
|
7
5
|
includeHighlight: boolean;
|
|
8
6
|
}
|
|
@@ -24,9 +24,9 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
24
24
|
innerTableName: 'expand-inner',
|
|
25
25
|
innerTableOptions: {
|
|
26
26
|
selectionExtractor: (item) => Promise.resolve(item.id),
|
|
27
|
-
getUserId: () => '1'
|
|
27
|
+
getUserId: () => '1',
|
|
28
28
|
},
|
|
29
|
-
isEnabled: () => true
|
|
29
|
+
isEnabled: () => true,
|
|
30
30
|
}));
|
|
31
31
|
let defs = $state([
|
|
32
32
|
expandDef,
|
|
@@ -43,12 +43,12 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
43
43
|
}
|
|
44
44
|
return {
|
|
45
45
|
value: Validity.Warning,
|
|
46
|
-
reason: 'Example item is not checked.'
|
|
46
|
+
reason: 'Example item is not checked.',
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
49
|
return { value: Validity.Neutral, reason: 'row not selected' };
|
|
50
50
|
},
|
|
51
|
-
modal
|
|
51
|
+
modal,
|
|
52
52
|
}),
|
|
53
53
|
new DisplayDef({
|
|
54
54
|
header: 'ID',
|
|
@@ -60,7 +60,7 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
60
60
|
await asyncSleep(10);
|
|
61
61
|
return item.id;
|
|
62
62
|
},
|
|
63
|
-
debug: true
|
|
63
|
+
debug: true,
|
|
64
64
|
}),
|
|
65
65
|
new QueryDef({
|
|
66
66
|
header: 'simulated query def',
|
|
@@ -76,37 +76,37 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
76
76
|
? new Array(5).fill(0).map((it, index) => {
|
|
77
77
|
return {
|
|
78
78
|
label: (it + index).toString(),
|
|
79
|
-
value: { value: (it + index).toString() }
|
|
79
|
+
value: { value: (it + index).toString() },
|
|
80
80
|
};
|
|
81
81
|
})
|
|
82
82
|
: [];
|
|
83
|
-
}
|
|
83
|
+
},
|
|
84
84
|
}),
|
|
85
85
|
new TextInputDef({
|
|
86
86
|
header: 'Name',
|
|
87
87
|
id: 'name',
|
|
88
|
-
isEditable: () => true
|
|
88
|
+
isEditable: () => true,
|
|
89
89
|
}),
|
|
90
90
|
new NumberInputDef({
|
|
91
91
|
header: 'Some Number',
|
|
92
92
|
id: 'someNumber',
|
|
93
93
|
isEditable: () => true,
|
|
94
94
|
min: 0,
|
|
95
|
-
max: 12345
|
|
95
|
+
max: 12345,
|
|
96
96
|
}),
|
|
97
97
|
new ProgressBarDef({
|
|
98
98
|
getColour: () => {
|
|
99
99
|
return {
|
|
100
100
|
colour: Colour['$ui-white'],
|
|
101
|
-
backgroundColour: Colour['$brand-primary']
|
|
101
|
+
backgroundColour: Colour['$brand-primary'],
|
|
102
102
|
};
|
|
103
103
|
},
|
|
104
104
|
header: 'Progress',
|
|
105
|
-
id: 'progress'
|
|
105
|
+
id: 'progress',
|
|
106
106
|
}),
|
|
107
107
|
new CheckboxDef({
|
|
108
108
|
header: 'Checkbox',
|
|
109
|
-
id: 'isChecked'
|
|
109
|
+
id: 'isChecked',
|
|
110
110
|
}),
|
|
111
111
|
new DateInputDef({
|
|
112
112
|
header: 'Some Date',
|
|
@@ -121,27 +121,27 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
121
121
|
return false;
|
|
122
122
|
}
|
|
123
123
|
return true;
|
|
124
|
-
}
|
|
124
|
+
},
|
|
125
125
|
// defaultHidden: true
|
|
126
126
|
}),
|
|
127
127
|
new DateInputDef({
|
|
128
128
|
header: 'Some Date With Time',
|
|
129
129
|
id: 'someDateWithTime',
|
|
130
130
|
isEditable: () => true,
|
|
131
|
-
showTime: true
|
|
131
|
+
showTime: true,
|
|
132
132
|
}),
|
|
133
133
|
new DateInputDef({
|
|
134
134
|
header: 'Flo Date',
|
|
135
135
|
id: 'floDate',
|
|
136
136
|
isEditable: () => true,
|
|
137
|
-
defaultHidden: true
|
|
137
|
+
defaultHidden: true,
|
|
138
138
|
}),
|
|
139
139
|
new DateInputDef({
|
|
140
140
|
header: 'Flo Date With Time',
|
|
141
141
|
id: 'floDateWithTime',
|
|
142
142
|
isEditable: () => true,
|
|
143
143
|
defaultHidden: true,
|
|
144
|
-
showTime: true
|
|
144
|
+
showTime: true,
|
|
145
145
|
}),
|
|
146
146
|
// altSelectDef,
|
|
147
147
|
new SelectDef({
|
|
@@ -152,24 +152,24 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
152
152
|
return [
|
|
153
153
|
{
|
|
154
154
|
label: 'First Option',
|
|
155
|
-
value: ExampleSelectEnum.FirstOption
|
|
155
|
+
value: ExampleSelectEnum.FirstOption,
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
label: 'Second Option',
|
|
159
|
-
value: ExampleSelectEnum.SecondOption
|
|
159
|
+
value: ExampleSelectEnum.SecondOption,
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
162
|
label: 'Third Option',
|
|
163
|
-
value: ExampleSelectEnum.ThirdOption
|
|
163
|
+
value: ExampleSelectEnum.ThirdOption,
|
|
164
164
|
},
|
|
165
165
|
{
|
|
166
166
|
label: 'Fourth Option',
|
|
167
|
-
value: ExampleSelectEnum.FourthOption
|
|
168
|
-
}
|
|
167
|
+
value: ExampleSelectEnum.FourthOption,
|
|
168
|
+
},
|
|
169
169
|
];
|
|
170
170
|
},
|
|
171
171
|
getDisplayValue: (item) => item.someSelect,
|
|
172
|
-
isEditable: () => true
|
|
172
|
+
isEditable: () => true,
|
|
173
173
|
}),
|
|
174
174
|
new BubbleDef({
|
|
175
175
|
header: 'Generated Bubble',
|
|
@@ -177,12 +177,12 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
177
177
|
accessorFn: () => {
|
|
178
178
|
return ['foo', 'bar', 'baz'];
|
|
179
179
|
},
|
|
180
|
-
defaultHidden: true
|
|
180
|
+
defaultHidden: true,
|
|
181
181
|
}),
|
|
182
182
|
new BubbleDef({
|
|
183
183
|
header: 'Multi Bubbles',
|
|
184
|
-
id: 'someBubbles'
|
|
185
|
-
})
|
|
184
|
+
id: 'someBubbles',
|
|
185
|
+
}),
|
|
186
186
|
]);
|
|
187
187
|
return {
|
|
188
188
|
get defs() {
|
|
@@ -190,7 +190,7 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
190
190
|
},
|
|
191
191
|
set defs(items) {
|
|
192
192
|
defs = items;
|
|
193
|
-
}
|
|
193
|
+
},
|
|
194
194
|
};
|
|
195
195
|
}
|
|
196
196
|
//sanity check
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script
|
|
3
|
+
<script
|
|
4
|
+
module
|
|
5
|
+
lang="ts"
|
|
6
|
+
>
|
|
4
7
|
import Icon from '../../Icon.svelte';
|
|
5
8
|
import { TooltipContext } from '../../../Contexts/TooltipContext.svelte.js';
|
|
6
9
|
import { Delay } from '../../../Delay/Delay.js';
|
|
@@ -25,7 +28,10 @@
|
|
|
25
28
|
}
|
|
26
29
|
</script>
|
|
27
30
|
|
|
28
|
-
<script
|
|
31
|
+
<script
|
|
32
|
+
lang="ts"
|
|
33
|
+
generics="T extends object"
|
|
34
|
+
>
|
|
29
35
|
const { showHighlight, side = 'centre', oncontextmenu }: TableHeadProps = $props();
|
|
30
36
|
|
|
31
37
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
@@ -50,7 +56,7 @@
|
|
|
50
56
|
const iconNames = {
|
|
51
57
|
asc: 'sort-asc',
|
|
52
58
|
desc: 'sort-desc',
|
|
53
|
-
none: 'sort-none'
|
|
59
|
+
none: 'sort-none',
|
|
54
60
|
} as const;
|
|
55
61
|
|
|
56
62
|
let currentDropTarget: HTMLTableCellElement | null = $state(null);
|
|
@@ -73,7 +79,7 @@
|
|
|
73
79
|
text: `Show ${typeof columnDef.header === 'string' ? columnDef.header : columnDef.id}`,
|
|
74
80
|
arrow: Side.Bottom,
|
|
75
81
|
delay: Delay.Default,
|
|
76
|
-
rect
|
|
82
|
+
rect,
|
|
77
83
|
});
|
|
78
84
|
}
|
|
79
85
|
}
|
|
@@ -119,7 +125,12 @@
|
|
|
119
125
|
{#each groups as group (group)}
|
|
120
126
|
<tr>
|
|
121
127
|
{#if showHighlight && group.headers.length}
|
|
122
|
-
<th
|
|
128
|
+
<th
|
|
129
|
+
id="highlight-header"
|
|
130
|
+
draggable={false}
|
|
131
|
+
colspan="1"
|
|
132
|
+
class="highlight-column"
|
|
133
|
+
>
|
|
123
134
|
<div class="th">
|
|
124
135
|
<HighlightAllHeader />
|
|
125
136
|
</div>
|
|
@@ -203,7 +214,10 @@
|
|
|
203
214
|
}}
|
|
204
215
|
class="contents"
|
|
205
216
|
>
|
|
206
|
-
<div
|
|
217
|
+
<div
|
|
218
|
+
class="th"
|
|
219
|
+
class:nopadding={isRowSelect}
|
|
220
|
+
>
|
|
207
221
|
<div class="header-text-wrapper no-sort cursor-pointer select-none">
|
|
208
222
|
{#if isRowSelect}
|
|
209
223
|
<SelectAllHeader />
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object"
|
|
6
|
+
>
|
|
4
7
|
import Button from '../../Button.svelte';
|
|
5
8
|
import SingleSelect from '../../SingleSelect.svelte';
|
|
6
9
|
import ColumnList from '../Body/Rows/ColumnList.svelte';
|
|
@@ -60,9 +63,15 @@
|
|
|
60
63
|
}}
|
|
61
64
|
>
|
|
62
65
|
<!-- size={Size.MediumSmall} -->
|
|
63
|
-
<TextInput
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
<TextInput
|
|
67
|
+
placeholder="name"
|
|
68
|
+
bind:value={pendingPresetName}
|
|
69
|
+
/>
|
|
70
|
+
<Button
|
|
71
|
+
type="submit"
|
|
72
|
+
variant={Variant.Secondary}
|
|
73
|
+
nowrap
|
|
74
|
+
size={Size.MediumSmall}>Save Layout</Button
|
|
66
75
|
>
|
|
67
76
|
</form>
|
|
68
77
|
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object"
|
|
6
|
+
>
|
|
4
7
|
import Button from '../../Button.svelte';
|
|
5
8
|
import SingleSelect from '../../SingleSelect.svelte';
|
|
6
9
|
import ColumnList from '../Body/Rows/ColumnList.svelte';
|
|
@@ -77,7 +80,11 @@
|
|
|
77
80
|
</div>
|
|
78
81
|
<div class="column-panel bottom save-preset-wrapper">
|
|
79
82
|
<!-- size={Size.MediumSmall} -->
|
|
80
|
-
<TextInput
|
|
83
|
+
<TextInput
|
|
84
|
+
placeholder="name"
|
|
85
|
+
bind:value={pendingPresetName}
|
|
86
|
+
onkeydown={trySavePreset}
|
|
87
|
+
/>
|
|
81
88
|
<Button
|
|
82
89
|
type="submit"
|
|
83
90
|
variant={Variant.Secondary}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object, FilterValueType, FilterOptionsType"
|
|
6
|
+
>
|
|
4
7
|
import { dev } from '$app/environment';
|
|
5
8
|
import Button from '../../Button.svelte';
|
|
6
9
|
import MultiSelect from '../../MultiSelect.svelte';
|
|
@@ -26,7 +29,7 @@
|
|
|
26
29
|
|
|
27
30
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
28
31
|
|
|
29
|
-
const { def, customFilters }: FilterInputProps<T,
|
|
32
|
+
const { def, customFilters }: FilterInputProps<T, FilterValueType, FilterOptionsType> = $props();
|
|
30
33
|
|
|
31
34
|
const customFilter = $derived(customFilters?.get(def.id));
|
|
32
35
|
|
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
import type { FilterInputProps } from './FilterInputProps.js';
|
|
2
|
-
declare function $$render<T extends object>(): {
|
|
3
|
-
props: FilterInputProps<T,
|
|
2
|
+
declare function $$render<T extends object, FilterValueType, FilterOptionsType>(): {
|
|
3
|
+
props: FilterInputProps<T, FilterValueType, FilterOptionsType>;
|
|
4
4
|
exports: {};
|
|
5
5
|
bindings: "";
|
|
6
6
|
slots: {};
|
|
7
7
|
events: {};
|
|
8
8
|
};
|
|
9
|
-
declare class __sveltets_Render<T extends object> {
|
|
10
|
-
props(): ReturnType<typeof $$render<T>>['props'];
|
|
11
|
-
events(): ReturnType<typeof $$render<T>>['events'];
|
|
12
|
-
slots(): ReturnType<typeof $$render<T>>['slots'];
|
|
9
|
+
declare class __sveltets_Render<T extends object, FilterValueType, FilterOptionsType> {
|
|
10
|
+
props(): ReturnType<typeof $$render<T, FilterValueType, FilterOptionsType>>['props'];
|
|
11
|
+
events(): ReturnType<typeof $$render<T, FilterValueType, FilterOptionsType>>['events'];
|
|
12
|
+
slots(): ReturnType<typeof $$render<T, FilterValueType, FilterOptionsType>>['slots'];
|
|
13
13
|
bindings(): "";
|
|
14
14
|
exports(): {};
|
|
15
15
|
}
|
|
16
16
|
interface $$IsomorphicComponent {
|
|
17
|
-
new <T extends object>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T>['props']>, ReturnType<__sveltets_Render<T>['events']>, ReturnType<__sveltets_Render<T>['slots']>> & {
|
|
18
|
-
$$bindings?: ReturnType<__sveltets_Render<T>['bindings']>;
|
|
19
|
-
} & ReturnType<__sveltets_Render<T>['exports']>;
|
|
20
|
-
<T extends object>(internal: unknown, props: ReturnType<__sveltets_Render<T>['props']> & {}): ReturnType<__sveltets_Render<T>['exports']>;
|
|
21
|
-
z_$$bindings?: ReturnType<__sveltets_Render<any>['bindings']>;
|
|
17
|
+
new <T extends object, FilterValueType, FilterOptionsType>(options: import('svelte').ComponentConstructorOptions<ReturnType<__sveltets_Render<T, FilterValueType, FilterOptionsType>['props']>>): import('svelte').SvelteComponent<ReturnType<__sveltets_Render<T, FilterValueType, FilterOptionsType>['props']>, ReturnType<__sveltets_Render<T, FilterValueType, FilterOptionsType>['events']>, ReturnType<__sveltets_Render<T, FilterValueType, FilterOptionsType>['slots']>> & {
|
|
18
|
+
$$bindings?: ReturnType<__sveltets_Render<T, FilterValueType, FilterOptionsType>['bindings']>;
|
|
19
|
+
} & ReturnType<__sveltets_Render<T, FilterValueType, FilterOptionsType>['exports']>;
|
|
20
|
+
<T extends object, FilterValueType, FilterOptionsType>(internal: unknown, props: ReturnType<__sveltets_Render<T, FilterValueType, FilterOptionsType>['props']> & {}): ReturnType<__sveltets_Render<T, FilterValueType, FilterOptionsType>['exports']>;
|
|
21
|
+
z_$$bindings?: ReturnType<__sveltets_Render<any, any, any>['bindings']>;
|
|
22
22
|
}
|
|
23
23
|
declare const FilterInput: $$IsomorphicComponent;
|
|
24
|
-
type FilterInput<T extends object> = InstanceType<typeof FilterInput<T>>;
|
|
24
|
+
type FilterInput<T extends object, FilterValueType, FilterOptionsType> = InstanceType<typeof FilterInput<T, FilterValueType, FilterOptionsType>>;
|
|
25
25
|
export default FilterInput;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ColumnDef } from '../Types/Columns/Definitions/ColumnDef.svelte.js';
|
|
2
2
|
import type { CustomRemoteFilters } from '../Types/Filtering/CustomRemoteFilters.js';
|
|
3
|
-
export interface FilterInputProps<T extends object, FilterValueType> {
|
|
4
|
-
def: ColumnDef<T, FilterValueType>;
|
|
3
|
+
export interface FilterInputProps<T extends object, FilterValueType, out FilterOptionsType> {
|
|
4
|
+
def: ColumnDef<T, FilterValueType, FilterOptionsType>;
|
|
5
5
|
customFilters?: CustomRemoteFilters<FilterValueType> | undefined;
|
|
6
6
|
}
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
<svelte:options runes />
|
|
2
2
|
|
|
3
|
-
<script
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
module
|
|
6
|
+
>
|
|
4
7
|
import Button from '../../Button.svelte';
|
|
5
8
|
import TouchModal from '../../Touch/TouchModal.svelte';
|
|
6
9
|
import { Size } from '../../../Types/Internal/Size.js';
|
|
@@ -14,11 +17,14 @@
|
|
|
14
17
|
}
|
|
15
18
|
</script>
|
|
16
19
|
|
|
17
|
-
<script
|
|
20
|
+
<script
|
|
21
|
+
lang="ts"
|
|
22
|
+
generics="T extends object"
|
|
23
|
+
>
|
|
18
24
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
19
25
|
|
|
20
26
|
const { onclose }: FilterPanelModalProps = $props();
|
|
21
|
-
const refs: Array<FilterInput<T>> = $state([]);
|
|
27
|
+
const refs: Array<FilterInput<T, never, unknown>> = $state([]);
|
|
22
28
|
|
|
23
29
|
function reset() {
|
|
24
30
|
tableContext.paginationRepo?.resetFilters();
|
|
@@ -34,7 +40,11 @@
|
|
|
34
40
|
<div class="flex">
|
|
35
41
|
<div class="column-panel">
|
|
36
42
|
{#each tableContext.columnDefs as def, index (def)}
|
|
37
|
-
<FilterInput
|
|
43
|
+
<FilterInput
|
|
44
|
+
bind:this={refs[index]}
|
|
45
|
+
{def}
|
|
46
|
+
customFilters={tableContext.remoteFilters}
|
|
47
|
+
/>
|
|
38
48
|
{/each}
|
|
39
49
|
|
|
40
50
|
<div class="reset-button">
|