@lavalogic/scoria 0.0.28 → 0.0.30
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/Base/Pagination.svelte +237 -0
- package/dist/Components/Base/Pagination.svelte.d.ts +33 -0
- package/dist/Components/Dial.svelte +2 -2
- package/dist/Components/Table/Body/QuickSearchCell.svelte +14 -4
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +25 -14
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +49 -0
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte.d.ts +28 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +1 -1
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +5 -5
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +1 -1
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +16 -45
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +8 -2
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +2 -2
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +3 -1
- package/dist/Components/Table/Body/Rows/TableRow.svelte +8 -8
- package/dist/Components/Table/Body/TableBody.svelte +1 -1
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDef.svelte.js +2 -1
- package/dist/Components/Table/Misc/FilterInput.svelte +6 -0
- package/dist/Components/Table/Types/Columns/ColumnPinningState.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +1 -0
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +8 -3
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +8 -0
- package/dist/Components/Table/Types/Context/Row.d.ts +2 -1
- package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +9 -11
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +170 -155
- package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.js +6 -7
- package/dist/Components/Table/Types/Filtering/FilterValueType.d.ts +8 -0
- package/dist/Components/Table/Types/Filtering/FilterValueType.js +8 -0
- package/dist/Components/Table/Types/Filtering/NumberDateFilterMode.d.ts +0 -1
- package/dist/Components/Table/Types/Filtering/NumberDateFilterMode.js +1 -1
- package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.js +2 -2
- package/dist/Delay/Delay.d.ts +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +1 -0
- package/package.json +22 -21
|
@@ -7,16 +7,9 @@
|
|
|
7
7
|
import type { Component } from 'svelte';
|
|
8
8
|
import ExpandCell from './ExpandCell.svelte';
|
|
9
9
|
import { ExpandDef } from '../../../Types/Columns/Definitions/Expand/ExpandDef.svelte.js';
|
|
10
|
-
import type { ColumnDef } from '../../../Types/Columns/Definitions/ColumnDef.svelte.js';
|
|
11
10
|
import type { TableCell } from '../../../Types/Columns/TableCell.js';
|
|
12
11
|
import { DisplayType } from '../../../Types/Columns/DisplayType.js';
|
|
13
|
-
|
|
14
|
-
import TableDatePicker from './TableDatePicker.svelte';
|
|
15
|
-
import TableSelect from './TableSelect.svelte';
|
|
16
|
-
import TableQuerySelect from './TableQuerySelect.svelte';
|
|
17
|
-
import TableCheckbox from './TableCheckbox.svelte';
|
|
18
|
-
import TableTextInput from './TableTextInput.svelte';
|
|
19
|
-
import { AccessorDef } from '../../../Types/Columns/Definitions/Accessors/AccessorDef.svelte.js';
|
|
12
|
+
|
|
20
13
|
import { ActionsDef } from '../../../Types/Columns/Definitions/Actions/ActionsDef.svelte.js';
|
|
21
14
|
import ValidityCell from './ValidityCell.svelte';
|
|
22
15
|
import TableRowSelectionCheckbox from './TableRowSelectionCheckbox.svelte';
|
|
@@ -28,19 +21,8 @@
|
|
|
28
21
|
import type { ProgressBarTableCell } from '../../../Types/Columns/ProgressBarTableCell.js';
|
|
29
22
|
import { RowSelectionDef } from '../../../Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js';
|
|
30
23
|
import type { ExpandTableCell } from '../../../Types/Columns/ExpandTableCell.js';
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
'Number' | 'Date' | 'Select' | 'Checkbox' | 'Query' | 'Text',
|
|
34
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
35
|
-
Component<any>
|
|
36
|
-
> = {
|
|
37
|
-
Number: TableNumberInput,
|
|
38
|
-
Date: TableDatePicker,
|
|
39
|
-
Select: TableSelect,
|
|
40
|
-
Query: TableQuerySelect,
|
|
41
|
-
Checkbox: TableCheckbox,
|
|
42
|
-
Text: TableTextInput
|
|
43
|
-
} as const;
|
|
24
|
+
import type { ActionsTableCell } from './TableAction.svelte';
|
|
25
|
+
import AccessorComponent from './AccessorComponent.svelte';
|
|
44
26
|
|
|
45
27
|
export interface TableColumnProps<T extends object> {
|
|
46
28
|
cell: TableCell<T>;
|
|
@@ -65,15 +47,9 @@
|
|
|
65
47
|
return typeof valueOrComponent === 'function';
|
|
66
48
|
}
|
|
67
49
|
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
if (columnDef instanceof AccessorDef) {
|
|
71
|
-
return cellTypes[columnDef.accessorType];
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
return FocusableImmutableCell;
|
|
50
|
+
function isActionsDef(cell: TableCell<T>): cell is ActionsTableCell<T> {
|
|
51
|
+
return cell.column.columnDef instanceof ActionsDef;
|
|
75
52
|
}
|
|
76
|
-
|
|
77
53
|
function isExpandTableCell(cell: TableCell<T>): cell is ExpandTableCell<T> {
|
|
78
54
|
return cell.column.columnDef instanceof ExpandDef;
|
|
79
55
|
}
|
|
@@ -86,31 +62,26 @@
|
|
|
86
62
|
<ValidityCell {cell} />
|
|
87
63
|
{:else if columnDef instanceof RowSelectionDef}
|
|
88
64
|
<TableRowSelectionCheckbox {cell} />
|
|
89
|
-
{:else if
|
|
65
|
+
{:else if isActionsDef(cell)}
|
|
90
66
|
<ActionsCell {cell} />
|
|
91
67
|
{:else if isExpandTableCell(cell)}
|
|
92
68
|
<ExpandCell {cell} {expandedColumnDef} {onExpandChange} />
|
|
93
69
|
{:else if columnDef.columnType !== ColumnType.Display}
|
|
94
|
-
{
|
|
95
|
-
<CurrentComponent {cell} />
|
|
70
|
+
<AccessorComponent {cell} />
|
|
96
71
|
{:else}
|
|
97
72
|
{@const valueOrComponentPromise =
|
|
98
|
-
cell.column.columnDef.accessorFn?.(cell.row.original, cell.row.
|
|
73
|
+
cell.column.columnDef.accessorFn?.(cell.row.original, cell.row.originalIndex) ??
|
|
99
74
|
cell.row.original[cell.column.id as keyof typeof cell.row.original] ??
|
|
100
75
|
null}
|
|
101
76
|
|
|
102
|
-
{#
|
|
103
|
-
{
|
|
104
|
-
|
|
105
|
-
{
|
|
106
|
-
|
|
107
|
-
{
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
{/await}
|
|
111
|
-
{:else}
|
|
112
|
-
{@render ValueFallback(valueOrComponentPromise)}
|
|
113
|
-
{/if}
|
|
77
|
+
{#await valueOrComponentPromise}
|
|
78
|
+
<FocusableImmutableCell value={valueOrComponentPromise} {cell} />
|
|
79
|
+
{:then value}
|
|
80
|
+
{@render ValueFallback(value)}
|
|
81
|
+
{:catch e}
|
|
82
|
+
{@debug e}
|
|
83
|
+
<FocusableImmutableCell value={e?.toString()} {cell} />
|
|
84
|
+
{/await}
|
|
114
85
|
{/if}
|
|
115
86
|
{/if}
|
|
116
87
|
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
|
|
28
28
|
const columnDef = $derived(cell.column.columnDef);
|
|
29
29
|
const coordinates: CellCoordinates = $derived({
|
|
30
|
-
row: cell.row.
|
|
30
|
+
row: cell.row.visibleIndex,
|
|
31
31
|
column: columnDef.index,
|
|
32
32
|
id: columnDef.id as string & keyof T
|
|
33
33
|
});
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
let tdref: HTMLTableCellElement | undefined = $state();
|
|
61
61
|
|
|
62
|
-
const id = $derived(`${tableContext.tableName}-cell-${cell.row.
|
|
62
|
+
const id = $derived(`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`);
|
|
63
63
|
function handleSingleClick(event?: Event) {
|
|
64
64
|
if (
|
|
65
65
|
editable &&
|
|
@@ -252,7 +252,7 @@
|
|
|
252
252
|
|
|
253
253
|
<td class="input-cell">
|
|
254
254
|
<NumberInput
|
|
255
|
-
id={`${tableContext.tableName}-cell-${cell.row.
|
|
255
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
256
256
|
min={(cell.column.columnDef as NumberInputDef<T>).min}
|
|
257
257
|
max={(cell.column.columnDef as NumberInputDef<T>).max}
|
|
258
258
|
variant={InputVariant.Table}
|
|
@@ -269,7 +269,7 @@
|
|
|
269
269
|
|
|
270
270
|
<td
|
|
271
271
|
style={focusDetails.outline}
|
|
272
|
-
id={`${tableContext.tableName}-cell-${cell.row.
|
|
272
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
273
273
|
onmousedown={(e) => {
|
|
274
274
|
// start focus only on left click
|
|
275
275
|
if (e.button === 0) {
|
|
@@ -212,7 +212,7 @@
|
|
|
212
212
|
labelProp="label"
|
|
213
213
|
valueAsObject={columnDef.valueAsObject as true}
|
|
214
214
|
selectedValue={value}
|
|
215
|
-
query={(v) => columnDef.query(v, cell.row.original, cell.row.
|
|
215
|
+
query={(v) => columnDef.query(v, cell.row.original, cell.row.originalIndex)}
|
|
216
216
|
bind:options={lastOptions}
|
|
217
217
|
onfocus={addKeydownEvent}
|
|
218
218
|
onchange={(newValue) => {
|
|
@@ -235,7 +235,7 @@
|
|
|
235
235
|
style={focusDetails.outline}
|
|
236
236
|
bind:this={tdref}
|
|
237
237
|
tabIndex="0"
|
|
238
|
-
id={`${tableContext.tableName}-cell-${cell.row.
|
|
238
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
239
239
|
class="focusable editable"
|
|
240
240
|
class:multifocus={focusDetails.isMultiFocused}
|
|
241
241
|
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
const isSelectable = $derived(
|
|
34
34
|
(cell.column.columnDef as RowSelectionDef<T>).isSelectable?.(
|
|
35
35
|
cell.row.original,
|
|
36
|
-
cell.row.
|
|
36
|
+
cell.row.originalIndex
|
|
37
37
|
) ?? true
|
|
38
38
|
);
|
|
39
39
|
|
|
@@ -97,7 +97,7 @@
|
|
|
97
97
|
|
|
98
98
|
{#snippet input(isSelectable: boolean)}
|
|
99
99
|
<input
|
|
100
|
-
id={`${tableContext.tableName}-cell-${cell.row.
|
|
100
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
101
101
|
bind:this={inputRef}
|
|
102
102
|
{onchange}
|
|
103
103
|
type="checkbox"
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
</script>
|
|
8
8
|
|
|
9
9
|
<script lang="ts" generics="T extends object">
|
|
10
|
+
import { dev } from '$app/environment';
|
|
10
11
|
import SingleSelect from '../../../../SingleSelect.svelte';
|
|
11
12
|
import type { SelectDef } from '../../../Types/Columns/Definitions/Accessors/SelectDef.svelte.js';
|
|
12
13
|
import type { TableCell } from '../../../Types/Columns/TableCell.js';
|
|
@@ -87,6 +88,9 @@
|
|
|
87
88
|
optionsPromise: Array<SelectOption<unknown>> | Promise<Array<SelectOption<unknown>>>,
|
|
88
89
|
value: unknown
|
|
89
90
|
): Promise<SelectOption<unknown> | null> {
|
|
91
|
+
void value;
|
|
92
|
+
void optionsPromise;
|
|
93
|
+
|
|
90
94
|
if (value == null) {
|
|
91
95
|
return null;
|
|
92
96
|
}
|
|
@@ -101,7 +105,9 @@
|
|
|
101
105
|
return foundOption ?? null;
|
|
102
106
|
}
|
|
103
107
|
|
|
104
|
-
|
|
108
|
+
if (dev) {
|
|
109
|
+
console.warn('could not match value to any type:', value);
|
|
110
|
+
}
|
|
105
111
|
|
|
106
112
|
return null;
|
|
107
113
|
}
|
|
@@ -249,7 +255,7 @@
|
|
|
249
255
|
bind:this={tdref}
|
|
250
256
|
tabIndex="0"
|
|
251
257
|
style={focusDetails.outline}
|
|
252
|
-
id={`${tableContext.tableName}-cell-${cell.row.
|
|
258
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
253
259
|
class="focusable editable"
|
|
254
260
|
class:multifocus={focusDetails.isMultiFocused}
|
|
255
261
|
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
@@ -258,7 +258,7 @@
|
|
|
258
258
|
<!-- {#if true} -->
|
|
259
259
|
<td class="input-cell">
|
|
260
260
|
<TextInput
|
|
261
|
-
id={`${tableContext.tableName}-cell-${cell.row.
|
|
261
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
262
262
|
onkeydown={handleInputKeydown}
|
|
263
263
|
variant={InputVariant.Table}
|
|
264
264
|
bind:value={tempTextValue}
|
|
@@ -278,7 +278,7 @@
|
|
|
278
278
|
{:else}
|
|
279
279
|
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
280
280
|
<td
|
|
281
|
-
id={`${tableContext.tableName}-cell-${cell.row.
|
|
281
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
282
282
|
style={focusDetails.outline}
|
|
283
283
|
onmousedown={(e) => {
|
|
284
284
|
// start focus only on left click
|
|
@@ -87,7 +87,9 @@
|
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
|
|
90
|
-
const thisId = $derived(
|
|
90
|
+
const thisId = $derived(
|
|
91
|
+
`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`
|
|
92
|
+
);
|
|
91
93
|
|
|
92
94
|
function onclose() {
|
|
93
95
|
tableContext.setOpenModalCoordinates(null);
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
|
|
56
56
|
let prevExpandedColumnDef: ExpandDef<T, object> | undefined = $state();
|
|
57
57
|
|
|
58
|
-
const rowIndex = $derived(cells[0] && cells[0].row.
|
|
58
|
+
const rowIndex = $derived(cells[0] && cells[0].row.visibleIndex);
|
|
59
59
|
const highlighted = $derived(
|
|
60
60
|
rowIndex != undefined &&
|
|
61
61
|
tableContext.highlightedItems.has(tableContext.selectionExtractor(row.original))
|
|
@@ -63,14 +63,14 @@
|
|
|
63
63
|
|
|
64
64
|
const isAppropriateTableSide = $derived.by(() => {
|
|
65
65
|
if (side === 'left') {
|
|
66
|
-
return (tableContext.columnPinning.left?.
|
|
66
|
+
return (tableContext.columnPinning.left?.size ?? 0) > 0;
|
|
67
67
|
} else if (side === 'centre') {
|
|
68
68
|
return (
|
|
69
|
-
(tableContext.columnPinning.left?.
|
|
70
|
-
(tableContext.columnPinning.right?.
|
|
69
|
+
(tableContext.columnPinning.left?.size ?? 0) == 0 &&
|
|
70
|
+
(tableContext.columnPinning.right?.size ?? 0) != tableContext.columnDefs.length
|
|
71
71
|
);
|
|
72
72
|
} else {
|
|
73
|
-
return (tableContext.columnPinning.right?.
|
|
73
|
+
return (tableContext.columnPinning.right?.size ?? 0) == tableContext.columnDefs.length;
|
|
74
74
|
}
|
|
75
75
|
});
|
|
76
76
|
const showHighlightButton = $derived(rowIndex != null && isAppropriateTableSide);
|
|
@@ -85,12 +85,12 @@
|
|
|
85
85
|
prevExpandedColumnDef = expandedColumnDef;
|
|
86
86
|
innerColumnDefs = expandedColumnDef.getInnerColumnDefs(
|
|
87
87
|
cells[0].row.original,
|
|
88
|
-
cells[0].row.
|
|
88
|
+
cells[0].row.originalIndex
|
|
89
89
|
);
|
|
90
90
|
|
|
91
91
|
innerDataPromise = expandedColumnDef.accessorFn!(
|
|
92
92
|
cells[0].row.original,
|
|
93
|
-
cells[0].row.
|
|
93
|
+
cells[0].row.originalIndex
|
|
94
94
|
) as Promise<object[]>;
|
|
95
95
|
innerTableName = expandedColumnDef.innerTableName;
|
|
96
96
|
} else if (
|
|
@@ -125,7 +125,7 @@ onMouseLeave={onMouseLeave} -->
|
|
|
125
125
|
}}
|
|
126
126
|
/>
|
|
127
127
|
{/if}
|
|
128
|
-
{#each cells as cell (
|
|
128
|
+
{#each cells as cell (cell)}
|
|
129
129
|
<TableColumn {cell} {expandedColumnDef} {onExpandChange} />
|
|
130
130
|
{/each}
|
|
131
131
|
</tr>
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
import QuerySelect from '../../QuerySelect.svelte';
|
|
27
27
|
import { AccessorDef } from '../Types/Columns/Definitions/Accessors/AccessorDef.svelte.js';
|
|
28
28
|
import { AbstractDisplayDef } from '../Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js';
|
|
29
|
+
import { dev } from '$app/environment';
|
|
29
30
|
|
|
30
31
|
export const stringFilterTypes = [
|
|
31
32
|
{ value: StringFilterMode.Equals, label: 'Equals' },
|
|
@@ -175,6 +176,11 @@
|
|
|
175
176
|
} else if (def instanceof SelectDef) {
|
|
176
177
|
untrack(async () => {
|
|
177
178
|
try {
|
|
179
|
+
if (dev) {
|
|
180
|
+
// eslint-disable-next-line no-debugger
|
|
181
|
+
debugger;
|
|
182
|
+
}
|
|
183
|
+
// TODO see if we can change the below not to use array.includes
|
|
178
184
|
const x = (await options).filter((it) => {
|
|
179
185
|
return (filteringStateValue as unknown as Array<string | number> | undefined)?.includes(
|
|
180
186
|
it.value
|
|
@@ -3,7 +3,7 @@ import type { AccessorType } from './AccessorType.js';
|
|
|
3
3
|
export interface AccessorDefProps<T extends object> extends ColumnDefProps<T> {
|
|
4
4
|
readonly id: string & keyof T;
|
|
5
5
|
}
|
|
6
|
-
export declare abstract class AccessorDef<T extends object,
|
|
6
|
+
export declare abstract class AccessorDef<T extends object, filterValueType = unknown> extends ColumnDef<T, filterValueType> {
|
|
7
7
|
readonly columnType: "Accessor";
|
|
8
8
|
abstract readonly accessorType: AccessorType;
|
|
9
9
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { StringFilterValueType } from '../../../Filtering/FilterFn.js';
|
|
2
2
|
import { AccessorDef, type AccessorDefProps } from './AccessorDef.svelte.js';
|
|
3
3
|
export interface TextInputDefProps<T extends object> extends AccessorDefProps<T> {
|
|
4
|
+
filterValueType?: 'String';
|
|
4
5
|
}
|
|
5
6
|
export declare class TextInputDef<T extends object> extends AccessorDef<T, StringFilterValueType> {
|
|
6
7
|
readonly accessorType: "Text";
|
|
@@ -5,6 +5,7 @@ import type { FilterFn } from '../../Filtering/FilterFn.js';
|
|
|
5
5
|
import { ColumnType } from '../ColumnType.js';
|
|
6
6
|
import type { AccessorFn } from './AccessorFn.js';
|
|
7
7
|
import type { ValidationFn } from './ValidationFn.js';
|
|
8
|
+
import type { FilterValueType } from '../../Filtering/FilterValueType.js';
|
|
8
9
|
export interface ColumnDefProps<T extends object> {
|
|
9
10
|
id: string;
|
|
10
11
|
header: string | Snippet;
|
|
@@ -17,9 +18,10 @@ export interface ColumnDefProps<T extends object> {
|
|
|
17
18
|
resizable?: boolean;
|
|
18
19
|
isValid?: ValidationFn<T>;
|
|
19
20
|
filterFn?: FilterFn<T, unknown> | CustomFilterFn;
|
|
21
|
+
filterValueType?: FilterValueType;
|
|
20
22
|
accessorFn?: AccessorFn<T>;
|
|
21
23
|
}
|
|
22
|
-
export declare abstract class ColumnDef<T extends object,
|
|
24
|
+
export declare abstract class ColumnDef<T extends object, __filterValueType = unknown> {
|
|
23
25
|
protected constructor(props: ColumnDefProps<T>);
|
|
24
26
|
readonly id: string;
|
|
25
27
|
private _index;
|
|
@@ -31,8 +33,8 @@ export declare abstract class ColumnDef<T extends object, FilterValueType = unkn
|
|
|
31
33
|
readonly isValid: ValidationFn<T> | undefined;
|
|
32
34
|
readonly accessorFn: AccessorFn<T> | undefined;
|
|
33
35
|
private _filterFn;
|
|
34
|
-
get filterFn(): FilterFn<T,
|
|
35
|
-
set filterFn(v: FilterFn<T,
|
|
36
|
+
get filterFn(): FilterFn<T, __filterValueType> | CustomFilterFn | undefined;
|
|
37
|
+
set filterFn(v: FilterFn<T, __filterValueType> | CustomFilterFn | undefined);
|
|
36
38
|
private _minSize;
|
|
37
39
|
get minSize(): Pixels;
|
|
38
40
|
set minSize(v: Pixels);
|
|
@@ -45,6 +47,9 @@ export declare abstract class ColumnDef<T extends object, FilterValueType = unkn
|
|
|
45
47
|
private _visible;
|
|
46
48
|
get visible(): boolean;
|
|
47
49
|
set visible(v: boolean);
|
|
50
|
+
private _filterValueType;
|
|
51
|
+
get filterValueType(): FilterValueType | undefined;
|
|
52
|
+
set filterValueType(v: FilterValueType | undefined);
|
|
48
53
|
toJSON(): object;
|
|
49
54
|
readonly editable: boolean;
|
|
50
55
|
readonly resizable: boolean;
|
|
@@ -13,6 +13,7 @@ export class ColumnDef {
|
|
|
13
13
|
this.editable = $derived(props.editable ?? false);
|
|
14
14
|
this.resizable = $derived(props.resizable ?? true);
|
|
15
15
|
this.header = $derived(props.header);
|
|
16
|
+
this._filterValueType = $derived(props.filterValueType);
|
|
16
17
|
}
|
|
17
18
|
id;
|
|
18
19
|
_index;
|
|
@@ -69,6 +70,13 @@ export class ColumnDef {
|
|
|
69
70
|
}
|
|
70
71
|
this._isResizing = v;
|
|
71
72
|
}
|
|
73
|
+
_filterValueType;
|
|
74
|
+
get filterValueType() {
|
|
75
|
+
return this._filterValueType;
|
|
76
|
+
}
|
|
77
|
+
set filterValueType(v) {
|
|
78
|
+
this._filterValueType = v;
|
|
79
|
+
}
|
|
72
80
|
toJSON() {
|
|
73
81
|
return { columnType: this.columnType, id: this.id, header: this.header };
|
|
74
82
|
}
|
|
@@ -2,7 +2,8 @@ import type { TableCell } from '../Columns/TableCell.js';
|
|
|
2
2
|
export interface Row<T extends object> {
|
|
3
3
|
getValue: (columnId: string) => any;
|
|
4
4
|
original: T;
|
|
5
|
-
|
|
5
|
+
visibleIndex: number;
|
|
6
|
+
originalIndex: number;
|
|
6
7
|
id: string;
|
|
7
8
|
getLeftVisibleCells: () => TableCell<T>[];
|
|
8
9
|
getRightVisibleCells: () => TableCell<T>[];
|
|
@@ -33,7 +33,7 @@ export declare class TableContext<T extends object> {
|
|
|
33
33
|
private _onEditCell;
|
|
34
34
|
static readonly identifier: unique symbol;
|
|
35
35
|
static init<T extends object>(defaultColumnDefs: DefsWrapper<T>, tableName: string, dataRepo: IDataRepository<T>, options: TableInitOptions<T>): TableContext<T>;
|
|
36
|
-
constructor(INTERNAL_ONLY: symbol, defaultColumnDefs: DefsWrapper<T>, tableName: string, dataRepo: IDataRepository<T>, allowCopy: boolean, enableResize: boolean, allowColumnReordering: boolean, allowQuickFiltering: boolean, allowAdvancedFiltering: boolean, toolbarPosition: ToolbarPosition, displayFooter: boolean, selectionExtractor: TableInitOptions<T>['selectionExtractor'], getUserId: () => string | undefined, _onEditCell?: TableInitOptions<T>['onEditCell']);
|
|
36
|
+
protected constructor(INTERNAL_ONLY: symbol, defaultColumnDefs: DefsWrapper<T>, tableName: string, dataRepo: IDataRepository<T>, allowCopy: boolean, enableResize: boolean, allowColumnReordering: boolean, allowQuickFiltering: boolean, allowAdvancedFiltering: boolean, toolbarPosition: ToolbarPosition, displayFooter: boolean, selectionExtractor: TableInitOptions<T>['selectionExtractor'], getUserId: () => string | undefined, _onEditCell?: TableInitOptions<T>['onEditCell']);
|
|
37
37
|
private readonly userId;
|
|
38
38
|
private isSelectable;
|
|
39
39
|
__queryValues: SvelteMap<string, unknown>;
|
|
@@ -52,16 +52,11 @@ export declare class TableContext<T extends object> {
|
|
|
52
52
|
private _showSelectedOnly;
|
|
53
53
|
get showSelectedOnly(): boolean;
|
|
54
54
|
set showSelectedOnly(v: boolean);
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
get selectFilter(): FilterFn<T, SelectFilterValueType<T>> | undefined;
|
|
61
|
-
private readonly _boolFilter;
|
|
62
|
-
get boolFilter(): FilterFn<T, BoolFilterValueType> | undefined;
|
|
63
|
-
private readonly _stringFilter;
|
|
64
|
-
get stringFilter(): FilterFn<T, StringFilterValueType> | undefined;
|
|
55
|
+
readonly dateFilter: FilterFn<T, DateFilterValueType> | undefined;
|
|
56
|
+
readonly numberFilter: FilterFn<T, NumberFilterValueType> | undefined;
|
|
57
|
+
readonly selectFilter: FilterFn<T, SelectFilterValueType<T>> | undefined;
|
|
58
|
+
readonly boolFilter: FilterFn<T, BoolFilterValueType> | undefined;
|
|
59
|
+
readonly stringFilter: FilterFn<T, StringFilterValueType> | undefined;
|
|
65
60
|
private _limitFooter;
|
|
66
61
|
get limitFooter(): boolean;
|
|
67
62
|
set limitFooter(v: boolean);
|
|
@@ -147,6 +142,8 @@ export declare class TableContext<T extends object> {
|
|
|
147
142
|
private columnDefsById;
|
|
148
143
|
private readonly getSortingFn;
|
|
149
144
|
readonly originalRowIndices: Map<T, number>;
|
|
145
|
+
readonly filteredIndeces: number[];
|
|
146
|
+
readonly filteredData: T[];
|
|
150
147
|
readonly sortedData: T[];
|
|
151
148
|
readonly sortedRowModel: RowModel<T>;
|
|
152
149
|
_currentPageData: T[];
|
|
@@ -214,6 +211,7 @@ export declare class TableContext<T extends object> {
|
|
|
214
211
|
* This listener should be added and removed based on isMousingDown
|
|
215
212
|
*/
|
|
216
213
|
readonly setFocusEnd: (coords: CellCoordinates) => void;
|
|
214
|
+
private createRow;
|
|
217
215
|
private columnDefReturnsTextValue;
|
|
218
216
|
private _updateLocalStorageSettings;
|
|
219
217
|
private _moveFocusEndRow;
|