@lavalogic/scoria 0.16.4 → 0.17.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/QuickSearchCell.svelte +4 -4
- 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 -5
- 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 +27 -29
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +29 -9
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +28 -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 +11 -8
- 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/FilterPanel.svelte +12 -3
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +18 -5
- package/dist/Components/Table/Misc/TableSidebar.svelte +14 -8
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +4 -1
- 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 +3 -3
- 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 +1 -1
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +1 -1
- 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/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/Helpers/Helpers.svelte.js +2 -2
- 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
|
+
generics="T extends object,FilterValueType"
|
|
6
|
+
>
|
|
4
7
|
import { dev } from '$app/environment';
|
|
5
8
|
|
|
6
9
|
import { TableContext } from '../../../Types/Context/TableContext.svelte.js';
|
|
@@ -59,7 +62,7 @@
|
|
|
59
62
|
const tableContext = getContext<TableContext<T, never>>(TableContext.identifier);
|
|
60
63
|
const toastContext = getContext<ToastContext>(ToastContext.identifier);
|
|
61
64
|
|
|
62
|
-
const focusDetails: TableFocusDetails<T
|
|
65
|
+
const focusDetails: TableFocusDetails<T> = $derived(
|
|
63
66
|
new TableFocusDetails(cell, tableContext, toastContext.toast)
|
|
64
67
|
);
|
|
65
68
|
|
|
@@ -79,19 +82,17 @@
|
|
|
79
82
|
if (editable) {
|
|
80
83
|
tick()
|
|
81
84
|
.then(() => {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
}
|
|
94
|
-
});
|
|
85
|
+
if (typeof value == 'object' && value instanceof Promise) {
|
|
86
|
+
value
|
|
87
|
+
.then((v: unknown) => {
|
|
88
|
+
tempTextValue = v?.toString() ?? '';
|
|
89
|
+
isBeingEdited = true;
|
|
90
|
+
})
|
|
91
|
+
.catch(devCatch);
|
|
92
|
+
} else {
|
|
93
|
+
tempTextValue = value?.toString() ?? '';
|
|
94
|
+
isBeingEdited = true;
|
|
95
|
+
}
|
|
95
96
|
})
|
|
96
97
|
.catch(devCatch);
|
|
97
98
|
} else {
|
|
@@ -103,17 +104,15 @@
|
|
|
103
104
|
})
|
|
104
105
|
.catch(devCatch);
|
|
105
106
|
}
|
|
106
|
-
} else {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
});
|
|
116
|
-
}
|
|
107
|
+
} else if (isBeingEdited) {
|
|
108
|
+
untrack(() => {
|
|
109
|
+
isBeingEdited = false;
|
|
110
|
+
tick()
|
|
111
|
+
.then(() => {
|
|
112
|
+
onBlur();
|
|
113
|
+
})
|
|
114
|
+
.catch(devCatch);
|
|
115
|
+
});
|
|
117
116
|
}
|
|
118
117
|
});
|
|
119
118
|
|
|
@@ -227,7 +226,7 @@
|
|
|
227
226
|
(e.target as HTMLInputElement).scrollIntoView({
|
|
228
227
|
behavior: 'instant',
|
|
229
228
|
block: 'nearest',
|
|
230
|
-
inline: 'nearest'
|
|
229
|
+
inline: 'nearest',
|
|
231
230
|
});
|
|
232
231
|
}
|
|
233
232
|
|
|
@@ -254,7 +253,6 @@
|
|
|
254
253
|
if (!selectAll) {
|
|
255
254
|
overrideEdit = true;
|
|
256
255
|
|
|
257
|
-
tableContext.isMousingDown = false;
|
|
258
256
|
tick()
|
|
259
257
|
.then(() => {
|
|
260
258
|
inputRef?.focus();
|
|
@@ -298,7 +296,7 @@
|
|
|
298
296
|
if (tdref != prevTdRef) {
|
|
299
297
|
untrack(() => {
|
|
300
298
|
prevTdRef = tdref;
|
|
301
|
-
|
|
299
|
+
tdref?.addEventListener('edit', onEdit);
|
|
302
300
|
unsubscriber = () => {
|
|
303
301
|
prevTdRef?.removeEventListener('edit', onEdit);
|
|
304
302
|
};
|
|
@@ -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
|
|
|
@@ -68,6 +74,12 @@
|
|
|
68
74
|
|
|
69
75
|
let validity = $derived(focusDetails.validityTuple);
|
|
70
76
|
|
|
77
|
+
$effect(() => {
|
|
78
|
+
if (ColumnDef.debug) {
|
|
79
|
+
$inspect(validity);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
|
|
71
83
|
$effect(() => {
|
|
72
84
|
void validity;
|
|
73
85
|
untrack(() => {
|
|
@@ -75,6 +87,10 @@
|
|
|
75
87
|
await tick();
|
|
76
88
|
const [validityValue] = await validity;
|
|
77
89
|
|
|
90
|
+
if (ColumnDef.debug) {
|
|
91
|
+
console.log('validity: ', $state.snapshot(validityValue));
|
|
92
|
+
}
|
|
93
|
+
|
|
78
94
|
if (validityValue === Validity.Invalid) {
|
|
79
95
|
return tableContext.addInvalidValue(cell.row.original);
|
|
80
96
|
} else {
|
|
@@ -140,7 +156,7 @@
|
|
|
140
156
|
icon={{
|
|
141
157
|
name: 'loading',
|
|
142
158
|
colour: Colour['$ui-blue-6'],
|
|
143
|
-
size: Size.Medium
|
|
159
|
+
size: Size.Medium,
|
|
144
160
|
}}
|
|
145
161
|
/>
|
|
146
162
|
{:then maybeTuple}
|
|
@@ -163,7 +179,11 @@
|
|
|
163
179
|
</div>
|
|
164
180
|
{#if showModal}
|
|
165
181
|
<Portal target={document.body}>
|
|
166
|
-
<ColumnDef.modal
|
|
182
|
+
<ColumnDef.modal
|
|
183
|
+
{cell}
|
|
184
|
+
{onclose}
|
|
185
|
+
onsubmit={onclose}
|
|
186
|
+
/>
|
|
167
187
|
</Portal>
|
|
168
188
|
{/if}
|
|
169
189
|
</td>
|
|
@@ -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,29 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
121
121
|
return false;
|
|
122
122
|
}
|
|
123
123
|
return true;
|
|
124
|
-
}
|
|
124
|
+
},
|
|
125
|
+
debug: true,
|
|
126
|
+
// filterValueType: 'Date',
|
|
125
127
|
// defaultHidden: true
|
|
126
128
|
}),
|
|
127
129
|
new DateInputDef({
|
|
128
130
|
header: 'Some Date With Time',
|
|
129
131
|
id: 'someDateWithTime',
|
|
130
132
|
isEditable: () => true,
|
|
131
|
-
showTime: true
|
|
133
|
+
showTime: true,
|
|
132
134
|
}),
|
|
133
135
|
new DateInputDef({
|
|
134
136
|
header: 'Flo Date',
|
|
135
137
|
id: 'floDate',
|
|
136
138
|
isEditable: () => true,
|
|
137
|
-
defaultHidden: true
|
|
139
|
+
defaultHidden: true,
|
|
138
140
|
}),
|
|
139
141
|
new DateInputDef({
|
|
140
142
|
header: 'Flo Date With Time',
|
|
141
143
|
id: 'floDateWithTime',
|
|
142
144
|
isEditable: () => true,
|
|
143
145
|
defaultHidden: true,
|
|
144
|
-
showTime: true
|
|
146
|
+
showTime: true,
|
|
145
147
|
}),
|
|
146
148
|
// altSelectDef,
|
|
147
149
|
new SelectDef({
|
|
@@ -152,24 +154,24 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
152
154
|
return [
|
|
153
155
|
{
|
|
154
156
|
label: 'First Option',
|
|
155
|
-
value: ExampleSelectEnum.FirstOption
|
|
157
|
+
value: ExampleSelectEnum.FirstOption,
|
|
156
158
|
},
|
|
157
159
|
{
|
|
158
160
|
label: 'Second Option',
|
|
159
|
-
value: ExampleSelectEnum.SecondOption
|
|
161
|
+
value: ExampleSelectEnum.SecondOption,
|
|
160
162
|
},
|
|
161
163
|
{
|
|
162
164
|
label: 'Third Option',
|
|
163
|
-
value: ExampleSelectEnum.ThirdOption
|
|
165
|
+
value: ExampleSelectEnum.ThirdOption,
|
|
164
166
|
},
|
|
165
167
|
{
|
|
166
168
|
label: 'Fourth Option',
|
|
167
|
-
value: ExampleSelectEnum.FourthOption
|
|
168
|
-
}
|
|
169
|
+
value: ExampleSelectEnum.FourthOption,
|
|
170
|
+
},
|
|
169
171
|
];
|
|
170
172
|
},
|
|
171
173
|
getDisplayValue: (item) => item.someSelect,
|
|
172
|
-
isEditable: () => true
|
|
174
|
+
isEditable: () => true,
|
|
173
175
|
}),
|
|
174
176
|
new BubbleDef({
|
|
175
177
|
header: 'Generated Bubble',
|
|
@@ -177,12 +179,12 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
177
179
|
accessorFn: () => {
|
|
178
180
|
return ['foo', 'bar', 'baz'];
|
|
179
181
|
},
|
|
180
|
-
defaultHidden: true
|
|
182
|
+
defaultHidden: true,
|
|
181
183
|
}),
|
|
182
184
|
new BubbleDef({
|
|
183
185
|
header: 'Multi Bubbles',
|
|
184
|
-
id: 'someBubbles'
|
|
185
|
-
})
|
|
186
|
+
id: 'someBubbles',
|
|
187
|
+
}),
|
|
186
188
|
]);
|
|
187
189
|
return {
|
|
188
190
|
get defs() {
|
|
@@ -190,7 +192,7 @@ export function generateExampleItemColumnDefs(modal) {
|
|
|
190
192
|
},
|
|
191
193
|
set defs(items) {
|
|
192
194
|
defs = items;
|
|
193
|
-
}
|
|
195
|
+
},
|
|
194
196
|
};
|
|
195
197
|
}
|
|
196
198
|
//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
|
|
|
@@ -397,36 +400,36 @@
|
|
|
397
400
|
<div class="inner-row">
|
|
398
401
|
<label>
|
|
399
402
|
<input
|
|
400
|
-
value={
|
|
403
|
+
value={false}
|
|
401
404
|
type="radio"
|
|
402
405
|
bind:group={value}
|
|
403
406
|
onchange={() => {
|
|
404
407
|
tableContext.paginationRepo?.filterBy(def.id, value);
|
|
405
408
|
}}
|
|
406
409
|
/>
|
|
407
|
-
|
|
410
|
+
No
|
|
408
411
|
</label>
|
|
409
412
|
<label>
|
|
410
413
|
<input
|
|
411
|
-
value={
|
|
414
|
+
value={undefined}
|
|
412
415
|
type="radio"
|
|
413
416
|
bind:group={value}
|
|
414
417
|
onchange={() => {
|
|
415
418
|
tableContext.paginationRepo?.filterBy(def.id, value);
|
|
416
419
|
}}
|
|
417
420
|
/>
|
|
418
|
-
|
|
421
|
+
Any
|
|
419
422
|
</label>
|
|
420
423
|
<label>
|
|
421
424
|
<input
|
|
422
|
-
value={
|
|
425
|
+
value={true}
|
|
423
426
|
type="radio"
|
|
424
427
|
bind:group={value}
|
|
425
428
|
onchange={() => {
|
|
426
429
|
tableContext.paginationRepo?.filterBy(def.id, value);
|
|
427
430
|
}}
|
|
428
431
|
/>
|
|
429
|
-
|
|
432
|
+
Yes
|
|
430
433
|
</label>
|
|
431
434
|
</div>
|
|
432
435
|
{:else if isNumeric}
|
|
@@ -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,10 +1,14 @@
|
|
|
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 { Size } from '../../../Types/Internal/Size.js';
|
|
6
9
|
import { Variant } from '../../../Types/Internal/Variant.js';
|
|
7
10
|
import { getContext } from 'svelte';
|
|
11
|
+
import type { ColumnDef } from '../Types/Columns/Definitions/ColumnDef.svelte.js';
|
|
8
12
|
import { TableContext } from '../Types/Context/TableContext.svelte.js';
|
|
9
13
|
import FilterInput from './FilterInput.svelte';
|
|
10
14
|
|
|
@@ -13,13 +17,18 @@
|
|
|
13
17
|
function reset() {
|
|
14
18
|
tableContext.paginationRepo?.resetFilters();
|
|
15
19
|
}
|
|
20
|
+
|
|
21
|
+
const defs = $derived(tableContext.columnDefs as Array<ColumnDef<T, unknown>>);
|
|
16
22
|
</script>
|
|
17
23
|
|
|
18
24
|
<div class="column-panel">
|
|
19
25
|
<h3>Filter by</h3>
|
|
20
26
|
|
|
21
|
-
{#each
|
|
22
|
-
<FilterInput
|
|
27
|
+
{#each defs as def (def.id)}
|
|
28
|
+
<FilterInput
|
|
29
|
+
{def}
|
|
30
|
+
customFilters={tableContext.remoteFilters}
|
|
31
|
+
/>
|
|
23
32
|
{/each}
|
|
24
33
|
|
|
25
34
|
<div class="reset-button">
|