@lavalogic/scoria 0.16.4 → 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/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/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 +3 -3
- 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 +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/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>
|
|
@@ -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">
|
|
@@ -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 { devCatch } from '../../../Helpers/Helpers.svelte.js';
|
|
6
9
|
import { Side } from '../../../Types/Internal/Side.js';
|
|
@@ -21,7 +24,7 @@
|
|
|
21
24
|
[ExpandedPanel.None]: null,
|
|
22
25
|
[ExpandedPanel.Column]: ColumnPanel,
|
|
23
26
|
[ExpandedPanel.Filter]: FilterPanel,
|
|
24
|
-
[ExpandedPanel.Toolbox]: ToolboxPanel
|
|
27
|
+
[ExpandedPanel.Toolbox]: ToolboxPanel,
|
|
25
28
|
};
|
|
26
29
|
|
|
27
30
|
let expandedPanel = $state<ExpandedPanel | null>(null);
|
|
@@ -49,7 +52,10 @@
|
|
|
49
52
|
}
|
|
50
53
|
</script>
|
|
51
54
|
|
|
52
|
-
<svelte:window
|
|
55
|
+
<svelte:window
|
|
56
|
+
onclick={handleClickOutside}
|
|
57
|
+
onkeydown={handleEscKey}
|
|
58
|
+
/>
|
|
53
59
|
|
|
54
60
|
{#if ExpandedPanelElement != null}
|
|
55
61
|
<SidePanel toolbarPosition={tableContext.toolbarPosition}>
|
|
@@ -70,7 +76,7 @@
|
|
|
70
76
|
iconTop={{
|
|
71
77
|
// colour: Colour.$alt,
|
|
72
78
|
name: 'assessment',
|
|
73
|
-
size: Size.Medium
|
|
79
|
+
size: Size.Medium,
|
|
74
80
|
}}
|
|
75
81
|
label="Quick Filter"
|
|
76
82
|
/>
|
|
@@ -85,7 +91,7 @@
|
|
|
85
91
|
iconTop={{
|
|
86
92
|
// colour: Colour.$alt,
|
|
87
93
|
name: 'filter-bars',
|
|
88
|
-
size: Size.Medium
|
|
94
|
+
size: Size.Medium,
|
|
89
95
|
}}
|
|
90
96
|
label="Advanced Filter"
|
|
91
97
|
/>
|
|
@@ -99,7 +105,7 @@
|
|
|
99
105
|
iconTop={{
|
|
100
106
|
// colour: Colour.$alt,
|
|
101
107
|
name: 'columns',
|
|
102
|
-
size: Size.Medium
|
|
108
|
+
size: Size.Medium,
|
|
103
109
|
}}
|
|
104
110
|
label="Modify Columns"
|
|
105
111
|
/>
|
|
@@ -113,7 +119,7 @@
|
|
|
113
119
|
iconTop={{
|
|
114
120
|
// colour: Colour.$alt,
|
|
115
121
|
name: 'category',
|
|
116
|
-
size: Size.Medium
|
|
122
|
+
size: Size.Medium,
|
|
117
123
|
}}
|
|
118
124
|
label="My Tool Box"
|
|
119
125
|
/>
|
|
@@ -130,7 +136,7 @@
|
|
|
130
136
|
iconTop={{
|
|
131
137
|
// colour: Colour.$alt,
|
|
132
138
|
name: 'refresh',
|
|
133
|
-
size: Size.Medium
|
|
139
|
+
size: Size.Medium,
|
|
134
140
|
}}
|
|
135
141
|
label="Refresh"
|
|
136
142
|
/>
|
|
@@ -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 Checkbox from '../../Checkbox.svelte';
|
|
5
8
|
import DesktopModal from '../../DesktopModal.svelte';
|
|
6
9
|
import { getContext } from 'svelte';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ColumnDef } from './Definitions/ColumnDef.svelte.js';
|
|
2
|
-
export interface Column<T extends object, in FilterFnType =
|
|
2
|
+
export interface Column<T extends object, in FilterFnType = never, out FilterOptionsType = unknown> {
|
|
3
3
|
id: string;
|
|
4
|
-
columnDef: ColumnDef<T, FilterFnType,
|
|
4
|
+
columnDef: ColumnDef<T, FilterFnType, FilterOptionsType>;
|
|
5
5
|
getCanSort: () => boolean;
|
|
6
6
|
getToggleSortingHandler: () => ((e: MouseEvent) => void) | undefined;
|
|
7
7
|
getIsSorted: () => 'asc' | 'desc' | 'none';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { ColumnDef, type ColumnDefProps } from '../ColumnDef.svelte.js';
|
|
2
2
|
import type { AccessorType } from './AccessorType.js';
|
|
3
|
-
export interface AccessorDefProps<T extends object, in FilterValueType, out
|
|
3
|
+
export interface AccessorDefProps<T extends object, in FilterValueType, out FilterOptionsType> extends ColumnDefProps<T, FilterValueType, FilterOptionsType> {
|
|
4
4
|
readonly id: string & keyof T;
|
|
5
5
|
}
|
|
6
|
-
export declare abstract class AccessorDef<T extends object, in FilterValueType, out
|
|
7
|
-
constructor(props: AccessorDefProps<T, FilterValueType,
|
|
6
|
+
export declare abstract class AccessorDef<T extends object, in FilterValueType, out FilterOptionsType> extends ColumnDef<T, FilterValueType, FilterOptionsType> {
|
|
7
|
+
constructor(props: AccessorDefProps<T, FilterValueType, FilterOptionsType>);
|
|
8
8
|
readonly columnType: "Accessor";
|
|
9
9
|
abstract readonly accessorType: AccessorType;
|
|
10
10
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
|
|
2
1
|
import type { BoolFilterValueType, FilterFn } from '../../../Filtering/FilterFn.js';
|
|
3
2
|
import { AccessorDef, type AccessorDefProps } from './AccessorDef.svelte.js';
|
|
4
3
|
export interface CheckboxDefProps<T extends object, in FilterValueType = BoolFilterValueType, out SelectValueType = BoolFilterValueType> extends AccessorDefProps<T, FilterValueType, SelectValueType> {
|
|
@@ -7,6 +6,6 @@ export declare class CheckboxDef<T extends object, in FilterValueType = BoolFilt
|
|
|
7
6
|
readonly accessorType: "Checkbox";
|
|
8
7
|
constructor(props: CheckboxDefProps<T, FilterValueType, SelectValueType>);
|
|
9
8
|
private _filterFn;
|
|
10
|
-
get filterFn():
|
|
11
|
-
set filterFn(v:
|
|
9
|
+
get filterFn(): FilterFn<T, FilterValueType> | undefined;
|
|
10
|
+
set filterFn(v: FilterFn<T, FilterValueType> | undefined);
|
|
12
11
|
}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
|
|
2
1
|
import type { DateFilterValueType, FilterFn } from '../../../Filtering/FilterFn.js';
|
|
3
2
|
import { AccessorDef, type AccessorDefProps } from './AccessorDef.svelte.js';
|
|
4
3
|
export interface DateInputDefProps<T extends object, in FilterValueType = DateFilterValueType, out SelectValueType = DateFilterValueType> extends AccessorDefProps<T, FilterValueType, SelectValueType> {
|
|
@@ -8,7 +7,7 @@ export declare class DateInputDef<T extends object, in FilterValueType = DateFil
|
|
|
8
7
|
readonly accessorType: "Date";
|
|
9
8
|
constructor(props: DateInputDefProps<T, FilterValueType, SelectValueType>);
|
|
10
9
|
private _filterFn;
|
|
11
|
-
get filterFn(): FilterFn<T, FilterValueType> |
|
|
12
|
-
set filterFn(v: FilterFn<T, FilterValueType> |
|
|
10
|
+
get filterFn(): FilterFn<T, FilterValueType> | undefined;
|
|
11
|
+
set filterFn(v: FilterFn<T, FilterValueType> | undefined);
|
|
13
12
|
readonly showTime: boolean;
|
|
14
13
|
}
|
package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
|
|
2
1
|
import type { FilterFn, NumberFilterValueType } from '../../../Filtering/FilterFn.js';
|
|
3
2
|
import { AccessorDef, type AccessorDefProps } from './AccessorDef.svelte.js';
|
|
4
3
|
export interface NumberInputDefProps<T extends object, in FilterValueType = NumberFilterValueType, out OptionssValueType = NumberFilterValueType> extends AccessorDefProps<T, FilterValueType, OptionssValueType> {
|
|
@@ -11,6 +10,6 @@ export declare class NumberInputDef<T extends object, in FilterValueType = Numbe
|
|
|
11
10
|
readonly min: number;
|
|
12
11
|
readonly max: number;
|
|
13
12
|
private _filterFn;
|
|
14
|
-
get filterFn():
|
|
15
|
-
set filterFn(v:
|
|
13
|
+
get filterFn(): FilterFn<T, FilterValueType> | undefined;
|
|
14
|
+
set filterFn(v: FilterFn<T, FilterValueType> | undefined);
|
|
16
15
|
}
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import type { SelectOption } from '../../../../../../Types/Internal/SelectOption.js';
|
|
2
|
-
import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
|
|
3
2
|
import type { FilterFn } from '../../../Filtering/FilterFn.js';
|
|
4
3
|
import { AccessorDef, type AccessorDefProps } from './AccessorDef.svelte.js';
|
|
5
|
-
export interface QueryDefProps<T extends object, in FilterValueType = unknown, out
|
|
4
|
+
export interface QueryDefProps<T extends object, in FilterValueType = unknown, out FilterOptionsType = unknown> extends AccessorDefProps<T, FilterValueType, FilterOptionsType> {
|
|
6
5
|
query: (queryString: string, item: T, index: number) => Promise<Array<SelectOption<unknown>>>;
|
|
7
6
|
getDisplayValue: (item: T, index: number) => string | null | Promise<string | null>;
|
|
8
7
|
clearable?: boolean;
|
|
9
8
|
}
|
|
10
|
-
export declare class QueryDef<T extends object, FilterValueType = unknown, out
|
|
9
|
+
export declare class QueryDef<T extends object, FilterValueType = unknown, out FilterOptionsType = unknown> extends AccessorDef<T, FilterValueType, FilterOptionsType> {
|
|
11
10
|
readonly accessorType: "Query";
|
|
12
|
-
constructor(props: QueryDefProps<T, FilterValueType,
|
|
13
|
-
readonly filterFn:
|
|
11
|
+
constructor(props: QueryDefProps<T, FilterValueType, FilterOptionsType>);
|
|
12
|
+
readonly filterFn: FilterFn<T, FilterValueType> | undefined;
|
|
14
13
|
getDisplayValue: (item: T, index: number) => string | null | Promise<string | null>;
|
|
15
14
|
readonly query: (queryString: string, item: T, index: number) => Promise<Array<SelectOption<unknown>>>;
|
|
16
15
|
readonly clearable: boolean;
|