@lavalogic/scoria 0.0.46 → 0.0.47

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.
Files changed (44) hide show
  1. package/dist/Components/Table/Body/QuickSearchCell.svelte +14 -8
  2. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +3 -2
  3. package/dist/Components/Table/Body/Rows/TableRow.svelte +55 -17
  4. package/dist/Components/Table/Body/Rows/TableRow.svelte.d.ts +12 -2
  5. package/dist/Components/Table/Body/TableBody.svelte +33 -20
  6. package/dist/Components/Table/Body/TableBody.svelte.d.ts +21 -4
  7. package/dist/Components/Table/Misc/FilterInput.svelte +1 -6
  8. package/dist/Components/Table/Table.svelte +77 -4
  9. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +2 -2
  10. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +6 -2
  11. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.js +8 -0
  12. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.d.ts +6 -2
  13. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.js +8 -0
  14. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts +6 -2
  15. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.js +8 -0
  16. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.d.ts +5 -3
  17. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.js +1 -0
  18. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.d.ts +7 -2
  19. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.js +8 -0
  20. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +6 -2
  21. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.js +8 -0
  22. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +1 -0
  23. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js +3 -1
  24. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +5 -7
  25. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +0 -8
  26. package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +3 -3
  27. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +7 -2
  28. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js +8 -0
  29. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +7 -2
  30. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js +8 -0
  31. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +7 -2
  32. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js +8 -0
  33. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +2 -1
  34. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.js +2 -0
  35. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +2 -1
  36. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.js +3 -0
  37. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +6 -4
  38. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.js +1 -0
  39. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +1 -0
  40. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js +3 -1
  41. package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +1 -1
  42. package/dist/Components/Table/Types/Context/TableContext.svelte.js +47 -25
  43. package/dist/scss/_mixins.scss +2 -0
  44. package/package.json +22 -22
@@ -62,7 +62,7 @@
62
62
  );
63
63
 
64
64
  const isSearchable = $derived(
65
- hasFilterFn || hasAcceptableColumnType || (customFilters?.has(def.id) ?? false)
65
+ hasFilterFn || hasAcceptableColumnType || customFilters?.has(def.id) == true
66
66
  );
67
67
  const isNumeric = $derived(
68
68
  def instanceof NumberInputDef ||
@@ -70,12 +70,7 @@
70
70
  customFilter?.type === CustomFilterType.Number
71
71
  );
72
72
  const options = $derived(
73
- isSelect
74
- ? ((def as SelectDef<T>)?.getOptions?.() ??
75
- (def as SelectDef<T>).getSpecificOptions?.() ??
76
- customFilter?.options ??
77
- [])
78
- : []
73
+ isSelect ? ((def as SelectDef<T>)?.getOptions?.() ?? customFilter?.options ?? []) : []
79
74
  );
80
75
  const isDate = $derived(def instanceof DateInputDef);
81
76
  const isRemoteSelect = $derived(customFilter?.type === CustomFilterType.Select);
@@ -232,7 +227,7 @@
232
227
  let showToDateModal = $state(false);
233
228
  </script>
234
229
 
235
- <td class="input-cell">
230
+ <td class="input-cell {inputId}">
236
231
  {#if isSearchable}
237
232
  <div class="input-wrapper-parent">
238
233
  {#if isDate}
@@ -243,6 +238,7 @@
243
238
  <div class="spaced-around">
244
239
  <Button
245
240
  size={Size.FillHeight}
241
+ fullWidth
246
242
  onclick={() => {
247
243
  showFromDateModal = true;
248
244
  }}>From {fromDate?.toLocaleDateString() ?? 'Any Date'}</Button
@@ -250,6 +246,7 @@
250
246
 
251
247
  <Button
252
248
  size={Size.FillHeight}
249
+ fullWidth
253
250
  onclick={() => {
254
251
  showToDateModal = true;
255
252
  }}>To {toDate?.toLocaleDateString() ?? 'Any Date'}</Button
@@ -501,6 +498,8 @@ td.input-cell {
501
498
  padding-left: 4px;
502
499
  padding-right: 4px;
503
500
  gap: 4px;
501
+ width: 100%;
502
+ justify-content: space-around;
504
503
  }
505
504
 
506
505
  td {
@@ -577,4 +576,11 @@ div.input-wrapper-parent div.input-wrapper.right {
577
576
  min-width: 100px;
578
577
  flex-grow: 2;
579
578
  --input-padding-right: 2.6rem;
579
+ }
580
+
581
+ td {
582
+ --input-width: 100%;
583
+ }
584
+ td .input-wrapper-parent {
585
+ width: 100%;
580
586
  }</style>
@@ -68,13 +68,13 @@
68
68
  }
69
69
  }
70
70
  }}
71
- onkeyup={(e) => {
71
+ onkeyup={(e: KeyboardEvent) => {
72
72
  if (e.key === 'Enter') {
73
73
  e.stopPropagation();
74
74
  tableContext.onEditCell(cell.row.original, focusDetails.coordinates, !value);
75
75
  }
76
76
  }}
77
- onkeydown={(e) => {
77
+ onkeydown={(e: KeyboardEvent) => {
78
78
  if (e.key == 'Enter' || e.key == 'F2') {
79
79
  e.stopPropagation();
80
80
  }
@@ -88,6 +88,7 @@
88
88
  tableContext.endFocus(focusDetails.coordinates);
89
89
  }}
90
90
  >
91
+ &nbsp;
91
92
  <label
92
93
  class:multifocus={focusDetails.isMultiFocused}
93
94
  class:multifocus-start={focusDetails.isMultiFocusStart}
@@ -2,7 +2,7 @@
2
2
 
3
3
  <script lang="ts" module>
4
4
  import { generateShortUUID } from '../../../../Helpers/Helpers.svelte.js';
5
- import { getContext, untrack } from 'svelte';
5
+ import { getContext, onMount, untrack } from 'svelte';
6
6
  import NestedTable from '../../NestedTable.svelte';
7
7
  import type { Row } from '../../Types/Context/Row.js';
8
8
  import { TableContext } from '../../Types/Context/TableContext.svelte.js';
@@ -16,6 +16,8 @@
16
16
  row: Row<T>;
17
17
  side: 'left' | 'right' | 'centre';
18
18
  odd: boolean;
19
+ customHeight: number | undefined;
20
+ includeHighlight: boolean;
19
21
  // oncontextmenu?: (e: MouseEvent) => void
20
22
  }
21
23
  </script>
@@ -23,7 +25,7 @@
23
25
  <script lang="ts" generics="T extends object">
24
26
  const tableContext = getContext<TableContext<T>>(TableContext.identifier);
25
27
 
26
- const { row, side, odd = false }: TableRowProps<T> = $props();
28
+ const { row, side, odd = false, customHeight, includeHighlight }: TableRowProps<T> = $props();
27
29
 
28
30
  const hoverable = $derived(tableContext.changeColourOnHover);
29
31
 
@@ -61,19 +63,7 @@
61
63
  tableContext.highlightedItems.has(tableContext.selectionExtractor(row.original))
62
64
  );
63
65
 
64
- const isAppropriateTableSide = $derived.by(() => {
65
- if (side === 'left') {
66
- return (tableContext.columnPinning.left?.size ?? 0) > 0;
67
- } else if (side === 'centre') {
68
- return (
69
- (tableContext.columnPinning.left?.size ?? 0) == 0 &&
70
- (tableContext.columnPinning.right?.size ?? 0) != tableContext.columnDefs.length
71
- );
72
- } else {
73
- return (tableContext.columnPinning.right?.size ?? 0) == tableContext.columnDefs.length;
74
- }
75
- });
76
- const showHighlightButton = $derived(rowIndex != null && isAppropriateTableSide);
66
+ const showHighlightButton = $derived(rowIndex != null && includeHighlight);
77
67
 
78
68
  const colspan = $derived(cells.length + (showHighlightButton ? 1 : 0));
79
69
 
@@ -111,11 +101,59 @@
111
101
  expandedColumnDef = columnDef;
112
102
  }
113
103
  }
104
+
105
+ let trRef: HTMLTableRowElement | undefined = $state();
106
+ let _trHeight = $state(0);
107
+ export const trHeight = {
108
+ get value() {
109
+ return _trHeight;
110
+ }
111
+ };
112
+ $effect(() => {
113
+ if (trRef) {
114
+ const observer = new ResizeObserver((entries) => {
115
+ if (customHeight) {
116
+ _trHeight = 0;
117
+ } else {
118
+ _trHeight = entries[0].borderBoxSize[0].blockSize;
119
+ }
120
+ });
121
+ observer.observe(trRef);
122
+
123
+ const currentTrRef = trRef;
124
+ return () => observer.unobserve(currentTrRef);
125
+ }
126
+ });
127
+
128
+ let innerTrRef: HTMLTableRowElement | undefined = $state();
129
+ // let _innerTrHeight = $state(0);
130
+ // export const innerTrHeight = {
131
+ // get value() {
132
+ // return _innerTrHeight;
133
+ // }
134
+ // };
135
+ // $effect(() => {
136
+ // if (innerTrRef) {
137
+ // const observer = new ResizeObserver((entries) => {
138
+ // _innerTrHeight = entries[0].borderBoxSize[0].blockSize;
139
+ // });
140
+ // observer.observe(innerTrRef);
141
+
142
+ // const currentinnerTrRef = innerTrRef;
143
+ // return () => observer.unobserve(currentTrRef);
144
+ // }
145
+ // });
114
146
  </script>
115
147
 
116
148
  <!-- onMouseEnter={onMouseEnter}
117
149
  onMouseLeave={onMouseLeave} -->
118
- <tr class:hoverable class:alt={tableContext.alternateRowColours && odd} class:highlighted>
150
+ <tr
151
+ class:hoverable
152
+ class:alt={tableContext.alternateRowColours && odd}
153
+ class:highlighted
154
+ style={customHeight ? `height: ${customHeight}px !important;` : null}
155
+ bind:this={trRef}
156
+ >
119
157
  {#if showHighlightButton}
120
158
  <ColumnHighlight
121
159
  {rowIndex}
@@ -132,7 +170,7 @@ onMouseLeave={onMouseLeave} -->
132
170
 
133
171
  {#if expandedColumnDef}
134
172
  <!-- transition:slide={{ duration: 150, axis: 'y', delay: 0 }} -->
135
- <tr class="inner-table">
173
+ <tr class="inner-table" bind:this={innerTrRef}>
136
174
  {#await innerDataPromise}
137
175
  <td {colspan}>loading&hellip;</td>
138
176
  {:then data}
@@ -3,10 +3,16 @@ export interface TableRowProps<T extends object> {
3
3
  row: Row<T>;
4
4
  side: 'left' | 'right' | 'centre';
5
5
  odd: boolean;
6
+ customHeight: number | undefined;
7
+ includeHighlight: boolean;
6
8
  }
7
9
  declare function $$render<T extends object>(): {
8
10
  props: TableRowProps<T>;
9
- exports: {};
11
+ exports: {
12
+ trHeight: {
13
+ readonly value: number;
14
+ };
15
+ };
10
16
  bindings: "";
11
17
  slots: {};
12
18
  events: {};
@@ -16,7 +22,11 @@ declare class __sveltets_Render<T extends object> {
16
22
  events(): ReturnType<typeof $$render<T>>['events'];
17
23
  slots(): ReturnType<typeof $$render<T>>['slots'];
18
24
  bindings(): "";
19
- exports(): {};
25
+ exports(): {
26
+ trHeight: {
27
+ readonly value: number;
28
+ };
29
+ };
20
30
  }
21
31
  interface $$IsomorphicComponent {
22
32
  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,16 @@
1
1
  <svelte:options runes />
2
2
 
3
3
  <script lang="ts" module>
4
- export interface TableBodyProps {
4
+ export interface HeightData<T extends object> {
5
+ index: number;
6
+ applyTo: Array<TableBodyProps<T>['side']>;
7
+ maxHeight: number;
8
+ }
9
+ export interface TableBodyProps<T extends object> {
5
10
  side: 'left' | 'centre' | 'right';
11
+ heights: Array<HeightData<T>>;
12
+ columns: Array<Column<T>>;
13
+ includeHighlight: boolean;
6
14
  }
7
15
  </script>
8
16
 
@@ -10,40 +18,45 @@
10
18
  import { getContext } from 'svelte';
11
19
  import { TableContext } from '../Types/Context/TableContext.svelte.js';
12
20
  import QuickSearchCell from './QuickSearchCell.svelte';
13
- import type { Column } from '../Types/Columns/Column.js';
14
21
  import TableRow from './Rows/TableRow.svelte';
22
+ import type { Column } from '../Types/Columns/Column.js';
15
23
 
16
- let { side }: TableBodyProps = $props();
24
+ let { side, heights, columns, includeHighlight }: TableBodyProps<T> = $props();
17
25
 
18
26
  const tableContext = getContext<TableContext<T>>(TableContext.identifier);
19
27
 
20
- let quickFilterColumns: Column<T>[] = $state([]);
21
-
22
- $effect(() => {
23
- if (tableContext.showQuickFiltering && tableContext.table) {
24
- const columns =
25
- side === 'left'
26
- ? tableContext.table.getLeftVisibleLeafColumns()
27
- : side === 'right'
28
- ? tableContext.table.getRightVisibleLeafColumns()
29
- : tableContext.table.getCenterVisibleLeafColumns();
30
-
31
- quickFilterColumns = columns;
28
+ const rows: Array<TableRow<T>> = $state([]);
29
+ const _rowHeights = $derived(rows.map((it) => it?.trHeight.value ?? 0));
30
+ export const rowHeights = {
31
+ get value() {
32
+ return _rowHeights;
32
33
  }
33
- });
34
+ };
34
35
  </script>
35
36
 
36
37
  <tbody>
37
- {#if tableContext.allowQuickFiltering && tableContext.showQuickFiltering && quickFilterColumns.length}
38
+ {#if tableContext.allowQuickFiltering && tableContext.showQuickFiltering && columns.length}
38
39
  <tr class="sticky">
39
- <td><!-- accomodating for row marking --></td>
40
- {#each quickFilterColumns as column (column)}
40
+ {#if includeHighlight}
41
+ <td class="highlight-dud"><!-- accomodating for row marking --></td>
42
+ {/if}
43
+ {#each columns as column (column)}
41
44
  <QuickSearchCell {column} customFilters={tableContext.remoteFilters} />
42
45
  {/each}
43
46
  </tr>
44
47
  {/if}
45
48
  {#each tableContext.paginationRowModel.rows ?? [] as row, index (row)}
46
- <TableRow {row} {side} odd={index % 2 == 1} />
49
+ {@const customHeight = heights[index]?.applyTo.includes(side)
50
+ ? heights[index].maxHeight
51
+ : undefined}
52
+ <TableRow
53
+ {includeHighlight}
54
+ {customHeight}
55
+ {row}
56
+ {side}
57
+ odd={index % 2 == 1}
58
+ bind:this={rows[index]}
59
+ />
47
60
  {/each}
48
61
  </tbody>
49
62
 
@@ -1,9 +1,22 @@
1
- export interface TableBodyProps {
1
+ export interface HeightData<T extends object> {
2
+ index: number;
3
+ applyTo: Array<TableBodyProps<T>['side']>;
4
+ maxHeight: number;
5
+ }
6
+ export interface TableBodyProps<T extends object> {
2
7
  side: 'left' | 'centre' | 'right';
8
+ heights: Array<HeightData<T>>;
9
+ columns: Array<Column<T>>;
10
+ includeHighlight: boolean;
3
11
  }
12
+ import type { Column } from '../Types/Columns/Column.js';
4
13
  declare function $$render<T extends object>(): {
5
- props: TableBodyProps;
6
- exports: {};
14
+ props: TableBodyProps<T>;
15
+ exports: {
16
+ rowHeights: {
17
+ readonly value: number[];
18
+ };
19
+ };
7
20
  bindings: "";
8
21
  slots: {};
9
22
  events: {};
@@ -13,7 +26,11 @@ declare class __sveltets_Render<T extends object> {
13
26
  events(): ReturnType<typeof $$render<T>>['events'];
14
27
  slots(): ReturnType<typeof $$render<T>>['slots'];
15
28
  bindings(): "";
16
- exports(): {};
29
+ exports(): {
30
+ rowHeights: {
31
+ readonly value: number[];
32
+ };
33
+ };
17
34
  }
18
35
  interface $$IsomorphicComponent {
19
36
  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']>> & {
@@ -119,12 +119,7 @@
119
119
  );
120
120
 
121
121
  const options = $derived(
122
- isSelect
123
- ? ((def as SelectDef<T>)?.getOptions?.() ??
124
- (def as SelectDef<T>).getSpecificOptions?.() ??
125
- customFilter?.options ??
126
- [])
127
- : []
122
+ isSelect ? ((def as SelectDef<T>)?.getOptions?.() ?? customFilter?.options ?? []) : []
128
123
  );
129
124
 
130
125
  let optionsPromise: Array<SelectOption<unknown>> | Promise<Array<SelectOption<unknown>>> = $state(
@@ -15,7 +15,7 @@
15
15
  import TableSidebar from './Misc/TableSidebar.svelte';
16
16
  import TableFooter from './Misc/TableFooter.svelte';
17
17
  import TableHead from './Headers/TableHead.svelte';
18
- import TableBody from './Body/TableBody.svelte';
18
+ import TableBody, { type HeightData } from './Body/TableBody.svelte';
19
19
  import { shownPopup } from './Body/Rows/Columns/ActionsCell.svelte';
20
20
 
21
21
  declare global {
@@ -264,6 +264,57 @@
264
264
  const leftTotalSize = $derived(tableContext.table.getLeftTotalSize());
265
265
  const centreTotalSize = $derived(tableContext.table.getCenterTotalSize());
266
266
  const rightTotalSize = $derived(tableContext.table.getRightTotalSize());
267
+
268
+ const leftColumns = $derived(tableContext.table.getLeftVisibleLeafColumns());
269
+ const centreColumns = $derived(tableContext.table.getCenterVisibleLeafColumns());
270
+ const rightColumns = $derived(tableContext.table.getRightVisibleLeafColumns());
271
+
272
+ const appropriateSide = $derived.by(() => {
273
+ if (leftColumns.length > 0) {
274
+ return 'left';
275
+ } else if ((rightColumns.length ?? 0) != tableContext.columnDefs.length) {
276
+ return 'centre';
277
+ } else {
278
+ return 'right';
279
+ }
280
+ });
281
+
282
+ let leftTable: TableBody<T> | undefined = $state();
283
+ let centreTable: TableBody<T> | undefined = $state();
284
+ let rightTable: TableBody<T> | undefined = $state();
285
+
286
+ const totalRowSizes: Array<HeightData<T>> = $derived.by(() => {
287
+ if (!leftTable || !centreTable || !rightTable) {
288
+ return [];
289
+ }
290
+ const centre = centreTable.rowHeights.value;
291
+ const right = rightTable.rowHeights.value;
292
+
293
+ return leftTable?.rowHeights.value.map((_leftHeight, index) => {
294
+ const leftHeight = _leftHeight || 0;
295
+ const centreHeight = centre[index] || 0;
296
+ const rightHeight = right[index] || 0;
297
+
298
+ const maxHeight = Math.max(leftHeight, centreHeight, rightHeight);
299
+ const applyTo: HeightData<T>['applyTo'] = [];
300
+
301
+ if (leftHeight < maxHeight) {
302
+ applyTo.push('left');
303
+ }
304
+ if (centreHeight < maxHeight) {
305
+ applyTo.push('centre');
306
+ }
307
+ if (rightHeight < maxHeight) {
308
+ applyTo.push('right');
309
+ }
310
+
311
+ return {
312
+ index,
313
+ applyTo,
314
+ maxHeight
315
+ };
316
+ });
317
+ });
267
318
  </script>
268
319
 
269
320
  <svelte:window
@@ -349,7 +400,13 @@
349
400
  <!-- {#if leftTotalSize > 0} -->
350
401
  <table class="datatable__table left" style="min-width: {leftTotalSize}px">
351
402
  <TableHead showHighlight={leftTotalSize > 0} side="left" />
352
- <TableBody side="left" />
403
+ <TableBody
404
+ includeHighlight={appropriateSide == 'left'}
405
+ columns={leftColumns}
406
+ heights={totalRowSizes}
407
+ side="left"
408
+ bind:this={leftTable}
409
+ />
353
410
  </table>
354
411
  <!-- {/if} -->
355
412
 
@@ -357,14 +414,26 @@
357
414
 
358
415
  <table class="datatable__table centre" style="min-width: {centreTotalSize}px">
359
416
  <TableHead showHighlight={leftTotalSize == 0} side="centre" />
360
- <TableBody side="centre" />
417
+ <TableBody
418
+ includeHighlight={appropriateSide == 'centre'}
419
+ columns={centreColumns}
420
+ heights={totalRowSizes}
421
+ side="centre"
422
+ bind:this={centreTable}
423
+ />
361
424
  </table>
362
425
  <!-- {/if} -->
363
426
 
364
427
  <!-- {#if rightTotalSize > 0} -->
365
428
  <table class="datatable__table right" style="min-width: {rightTotalSize}px">
366
429
  <TableHead showHighlight={false} side="right" />
367
- <TableBody side="right" />
430
+ <TableBody
431
+ includeHighlight={appropriateSide == 'right'}
432
+ columns={rightColumns}
433
+ heights={totalRowSizes}
434
+ side="right"
435
+ bind:this={rightTable}
436
+ />
368
437
  </table>
369
438
  <!-- {/if} -->
370
439
  </div>
@@ -449,6 +518,10 @@ div.resizer.isResizing {
449
518
  opacity: 1;
450
519
  }
451
520
 
521
+ .left {
522
+ border-right: solid 2px #3a4952;
523
+ }
524
+
452
525
  .right {
453
526
  border-left: solid 2px #3a4952;
454
527
  }
@@ -1,9 +1,9 @@
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> extends ColumnDefProps<T> {
3
+ export interface AccessorDefProps<T extends object, FilterFnType> extends ColumnDefProps<T, FilterFnType> {
4
4
  readonly id: string & keyof T;
5
5
  }
6
- export declare abstract class AccessorDef<T extends object, filterValueType = unknown> extends ColumnDef<T, filterValueType> {
6
+ export declare abstract class AccessorDef<T extends object, FilterFnType> extends ColumnDef<T, FilterFnType> {
7
7
  readonly columnType: "Accessor";
8
8
  abstract readonly accessorType: AccessorType;
9
9
  }
@@ -1,8 +1,12 @@
1
- import type { BoolFilterValueType } from '../../../Filtering/FilterFn.js';
1
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
2
+ import type { BoolFilterValueType, FilterFn } from '../../../Filtering/FilterFn.js';
2
3
  import { AccessorDef, type AccessorDefProps } from './AccessorDef.svelte.js';
3
- export interface CheckboxDefProps<T extends object> extends AccessorDefProps<T> {
4
+ export interface CheckboxDefProps<T extends object> extends AccessorDefProps<T, BoolFilterValueType> {
4
5
  }
5
6
  export declare class CheckboxDef<T extends object> extends AccessorDef<T, BoolFilterValueType> {
6
7
  readonly accessorType: "Checkbox";
7
8
  constructor(props: CheckboxDefProps<T>);
9
+ private _filterFn;
10
+ get filterFn(): CustomFilterFn | FilterFn<T, BoolFilterValueType> | undefined;
11
+ set filterFn(v: CustomFilterFn | FilterFn<T, BoolFilterValueType> | undefined);
8
12
  }
@@ -4,5 +4,13 @@ export class CheckboxDef extends AccessorDef {
4
4
  accessorType = AccessorType.Checkbox;
5
5
  constructor(props) {
6
6
  super(props);
7
+ this._filterFn = $state(props.filterFn);
8
+ }
9
+ _filterFn;
10
+ get filterFn() {
11
+ return this._filterFn;
12
+ }
13
+ set filterFn(v) {
14
+ this._filterFn = v;
7
15
  }
8
16
  }
@@ -1,10 +1,14 @@
1
- import type { DateFilterValueType } from '../../../Filtering/FilterFn.js';
1
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
2
+ import type { DateFilterValueType, FilterFn } from '../../../Filtering/FilterFn.js';
2
3
  import { AccessorDef, type AccessorDefProps } from './AccessorDef.svelte.js';
3
- export interface DateInputDefProps<T extends object> extends AccessorDefProps<T> {
4
+ export interface DateInputDefProps<T extends object> extends AccessorDefProps<T, DateFilterValueType> {
4
5
  showTime?: boolean;
5
6
  }
6
7
  export declare class DateInputDef<T extends object> extends AccessorDef<T, DateFilterValueType> {
7
8
  readonly accessorType: "Date";
8
9
  constructor(props: DateInputDefProps<T>);
10
+ private _filterFn;
11
+ get filterFn(): FilterFn<T, DateFilterValueType> | CustomFilterFn | undefined;
12
+ set filterFn(v: FilterFn<T, DateFilterValueType> | CustomFilterFn | undefined);
9
13
  readonly showTime: boolean;
10
14
  }
@@ -5,6 +5,14 @@ export class DateInputDef extends AccessorDef {
5
5
  constructor(props) {
6
6
  super(props);
7
7
  this.showTime = $derived(props.showTime ?? false);
8
+ this._filterFn = $state(props.filterFn);
9
+ }
10
+ _filterFn;
11
+ get filterFn() {
12
+ return this._filterFn;
13
+ }
14
+ set filterFn(v) {
15
+ this._filterFn = v;
8
16
  }
9
17
  showTime;
10
18
  }
@@ -1,7 +1,8 @@
1
1
  import { AccessorDef } from './AccessorDef.svelte.js';
2
2
  import { type ColumnDefProps } from '../ColumnDef.svelte.js';
3
- import type { NumberFilterValueType } from '../../../Filtering/FilterFn.js';
4
- export interface NumberInputDefProps<T extends object> extends ColumnDefProps<T> {
3
+ import type { FilterFn, NumberFilterValueType } from '../../../Filtering/FilterFn.js';
4
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
5
+ export interface NumberInputDefProps<T extends object> extends ColumnDefProps<T, NumberFilterValueType> {
5
6
  min: number;
6
7
  max: number;
7
8
  }
@@ -10,4 +11,7 @@ export declare class NumberInputDef<T extends object> extends AccessorDef<T, Num
10
11
  constructor(props: NumberInputDefProps<T>);
11
12
  readonly min: number;
12
13
  readonly max: number;
14
+ private _filterFn;
15
+ get filterFn(): CustomFilterFn | FilterFn<T, NumberFilterValueType> | undefined;
16
+ set filterFn(v: CustomFilterFn | FilterFn<T, NumberFilterValueType> | undefined);
13
17
  }
@@ -7,7 +7,15 @@ export class NumberInputDef extends AccessorDef {
7
7
  super(props);
8
8
  this.min = $derived(props.min);
9
9
  this.max = $derived(props.max);
10
+ this._filterFn = $state(props.filterFn);
10
11
  }
11
12
  min;
12
13
  max;
14
+ _filterFn;
15
+ get filterFn() {
16
+ return this._filterFn;
17
+ }
18
+ set filterFn(v) {
19
+ this._filterFn = v;
20
+ }
13
21
  }
@@ -1,16 +1,18 @@
1
1
  import type { SelectOption } from '../../../../../../Types/Internal/SelectOption.js';
2
- import type { StringFilterValueType } from '../../../Filtering/FilterFn.js';
2
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
3
+ import type { FilterFn, SelectFilterValueType } from '../../../Filtering/FilterFn.js';
3
4
  import type { ColumnDefProps } from '../ColumnDef.svelte.js';
4
5
  import { AccessorDef } from './AccessorDef.svelte.js';
5
- export interface QueryDefProps<T extends object> extends ColumnDefProps<T> {
6
+ export interface QueryDefProps<T extends object> extends ColumnDefProps<T, SelectFilterValueType<T>> {
6
7
  valueAsObject: boolean;
7
8
  query: (queryString: string, item: T, index: number) => Promise<Array<SelectOption<unknown>>>;
8
9
  getDisplayValue: (item: T, index: number) => string | null | Promise<string | null>;
9
10
  clearable?: boolean;
10
11
  }
11
- export declare class QueryDef<T extends object> extends AccessorDef<T, StringFilterValueType> {
12
+ export declare class QueryDef<T extends object> extends AccessorDef<T, SelectFilterValueType<T>> {
12
13
  readonly accessorType: "Query";
13
14
  constructor(props: QueryDefProps<T>);
15
+ readonly filterFn: CustomFilterFn | FilterFn<T, SelectFilterValueType<T>> | undefined;
14
16
  readonly valueAsObject: boolean;
15
17
  readonly getDisplayValue: (item: T, index: number) => string | null | Promise<string | null>;
16
18
  readonly query: (queryString: string, item: T, index: number) => Promise<Array<SelectOption<unknown>>>;
@@ -9,6 +9,7 @@ export class QueryDef extends AccessorDef {
9
9
  this.getDisplayValue = $derived(props.getDisplayValue);
10
10
  this.clearable = $derived(props.clearable ?? true);
11
11
  }
12
+ filterFn;
12
13
  valueAsObject;
13
14
  getDisplayValue;
14
15
  query;
@@ -1,7 +1,9 @@
1
1
  import type { SelectOption } from '../../../../../../Types/Internal/SelectOption.js';
2
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
3
+ import type { FilterFn, SelectFilterValueType } from '../../../Filtering/FilterFn.js';
2
4
  import type { ColumnDefProps } from '../ColumnDef.svelte.js';
3
5
  import { AccessorDef } from './AccessorDef.svelte.js';
4
- export interface SelectDefProps<T extends object> extends ColumnDefProps<T> {
6
+ export interface SelectDefProps<T extends object> extends ColumnDefProps<T, SelectFilterValueType<T>> {
5
7
  getOptions: () => Array<SelectOption<unknown>> | Promise<Array<SelectOption<unknown>>>;
6
8
  getDisplayValue: (item: T, index: number) => string | null | Promise<string | null>;
7
9
  sortingFn?: (a: T, b: T) => 1 | -1 | 0;
@@ -9,9 +11,12 @@ export interface SelectDefProps<T extends object> extends ColumnDefProps<T> {
9
11
  optional?: boolean;
10
12
  clearable?: boolean;
11
13
  }
12
- export declare class SelectDef<T extends object> extends AccessorDef<T, T> {
14
+ export declare class SelectDef<T extends object> extends AccessorDef<T, SelectFilterValueType<T>> {
13
15
  constructor(props: SelectDefProps<T>);
14
16
  readonly accessorType: "Select";
17
+ private _filterFn;
18
+ get filterFn(): FilterFn<T, SelectFilterValueType<T>> | CustomFilterFn | undefined;
19
+ set filterFn(v: FilterFn<T, SelectFilterValueType<T>> | CustomFilterFn | undefined);
15
20
  readonly sortingFn?: (a: T, b: T) => 1 | -1 | 0;
16
21
  readonly getDisplayValue: (item: T, index: number) => string | null | Promise<string | null>;
17
22
  readonly optional: boolean;
@@ -9,8 +9,16 @@ export class SelectDef extends AccessorDef {
9
9
  this.optional = $derived(props.optional ?? false);
10
10
  this.clearable = $derived(props.clearable ?? true);
11
11
  this.getDisplayValue = $derived(props.getDisplayValue);
12
+ this._filterFn = $state(props.filterFn);
12
13
  }
13
14
  accessorType = AccessorType.Select;
15
+ _filterFn;
16
+ get filterFn() {
17
+ return this._filterFn;
18
+ }
19
+ set filterFn(v) {
20
+ this._filterFn = v;
21
+ }
14
22
  sortingFn;
15
23
  getDisplayValue;
16
24
  optional;
@@ -1,9 +1,13 @@
1
- import type { StringFilterValueType } from '../../../Filtering/FilterFn.js';
1
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
2
+ import type { FilterFn, StringFilterValueType } from '../../../Filtering/FilterFn.js';
2
3
  import { AccessorDef, type AccessorDefProps } from './AccessorDef.svelte.js';
3
- export interface TextInputDefProps<T extends object> extends AccessorDefProps<T> {
4
+ export interface TextInputDefProps<T extends object> extends AccessorDefProps<T, StringFilterValueType> {
4
5
  filterValueType?: 'String';
5
6
  }
6
7
  export declare class TextInputDef<T extends object> extends AccessorDef<T, StringFilterValueType> {
7
8
  readonly accessorType: "Text";
8
9
  constructor(props: TextInputDefProps<T>);
10
+ private _filterFn;
11
+ get filterFn(): CustomFilterFn | FilterFn<T, StringFilterValueType> | undefined;
12
+ set filterFn(v: CustomFilterFn | FilterFn<T, StringFilterValueType> | undefined);
9
13
  }
@@ -4,5 +4,13 @@ export class TextInputDef extends AccessorDef {
4
4
  accessorType = AccessorType.Text;
5
5
  constructor(props) {
6
6
  super(props);
7
+ this._filterFn = $state(props.filterFn);
8
+ }
9
+ _filterFn;
10
+ get filterFn() {
11
+ return this._filterFn;
12
+ }
13
+ set filterFn(v) {
14
+ this._filterFn = v;
7
15
  }
8
16
  }
@@ -12,4 +12,5 @@ export declare class ActionsDef<T extends object> extends ColumnDef<T> {
12
12
  readonly actions: TableActionButton<T>[];
13
13
  readonly isEnabled?: (item: T, index: number, button: TableActionButton<T>) => boolean | Promise<boolean>;
14
14
  readonly getColourSet?: (item: T, index: number, button: TableActionButton<T>) => ColourSet;
15
+ readonly filterFn: undefined;
15
16
  }
@@ -6,7 +6,8 @@ export class ActionsDef extends ColumnDef {
6
6
  super({
7
7
  id: `actions-${generateUUID()}`,
8
8
  header: 'Actions',
9
- allowSorting: false
9
+ allowSorting: false,
10
+ allowFiltering: false
10
11
  });
11
12
  this.actions = $derived(props.actions);
12
13
  this.isEnabled = $derived(props.isEnabled);
@@ -16,4 +17,5 @@ export class ActionsDef extends ColumnDef {
16
17
  actions;
17
18
  isEnabled; // assumed true if missing
18
19
  getColourSet;
20
+ filterFn = undefined;
19
21
  }
@@ -6,7 +6,7 @@ import { ColumnType } from '../ColumnType.js';
6
6
  import type { AccessorFn } from './AccessorFn.js';
7
7
  import type { ValidationFn } from './ValidationFn.js';
8
8
  import type { FilterValueType } from '../../Filtering/FilterValueType.js';
9
- export interface ColumnDefProps<T extends object> {
9
+ export interface ColumnDefProps<T extends object, FilterFnType = undefined> {
10
10
  id: string;
11
11
  header: string | Snippet;
12
12
  index?: number;
@@ -18,12 +18,12 @@ export interface ColumnDefProps<T extends object> {
18
18
  editable?: boolean;
19
19
  resizable?: boolean;
20
20
  isValid?: ValidationFn<T>;
21
- filterFn?: FilterFn<T, unknown> | CustomFilterFn;
21
+ filterFn?: FilterFn<T, FilterFnType> | CustomFilterFn;
22
22
  filterValueType?: FilterValueType;
23
23
  accessorFn?: AccessorFn<T>;
24
24
  }
25
- export declare abstract class ColumnDef<T extends object, __filterValueType = unknown> {
26
- protected constructor(props: ColumnDefProps<T>);
25
+ export declare abstract class ColumnDef<T extends object, FilterFnType = undefined> {
26
+ protected constructor(props: ColumnDefProps<T, FilterFnType>);
27
27
  readonly id: string;
28
28
  private _index;
29
29
  get index(): number;
@@ -34,9 +34,7 @@ export declare abstract class ColumnDef<T extends object, __filterValueType = un
34
34
  readonly allowFiltering: boolean;
35
35
  readonly isValid: ValidationFn<T> | undefined;
36
36
  readonly accessorFn: AccessorFn<T> | undefined;
37
- private _filterFn;
38
- get filterFn(): FilterFn<T, __filterValueType> | CustomFilterFn | undefined;
39
- set filterFn(v: FilterFn<T, __filterValueType> | CustomFilterFn | undefined);
37
+ abstract filterFn: FilterFn<T, FilterFnType> | CustomFilterFn | undefined;
40
38
  private _minSize;
41
39
  get minSize(): Pixels;
42
40
  set minSize(v: Pixels);
@@ -7,7 +7,6 @@ export class ColumnDef {
7
7
  this.allowFiltering = $derived(props.allowFiltering ?? true);
8
8
  this.allowSorting = $derived(props.allowSorting ?? true);
9
9
  this.isValid = $derived(props.isValid);
10
- this._filterFn = $state(props.filterFn);
11
10
  this.accessorFn = $derived(props.accessorFn);
12
11
  this._minSize = $state(props.minSize ?? 48);
13
12
  this._width = $state(props.width ?? props.minSize ?? 48);
@@ -29,13 +28,6 @@ export class ColumnDef {
29
28
  allowFiltering;
30
29
  isValid;
31
30
  accessorFn;
32
- _filterFn;
33
- get filterFn() {
34
- return this._filterFn;
35
- }
36
- set filterFn(v) {
37
- this._filterFn = v;
38
- }
39
31
  _minSize;
40
32
  get minSize() {
41
33
  return this._minSize;
@@ -7,12 +7,12 @@ export interface DisplayDefModalProps<T extends object> {
7
7
  onclose: () => void;
8
8
  onsubmit: () => void;
9
9
  }
10
- export interface AbstractDisplayDefProps<T extends object> extends ColumnDefProps<T> {
10
+ export interface AbstractDisplayDefProps<T extends object, FilterFnType = undefined> extends ColumnDefProps<T, FilterFnType> {
11
11
  modal?: Component<any, any, any>;
12
12
  }
13
- export declare abstract class AbstractDisplayDef<T extends object> extends ColumnDef<T> {
13
+ export declare abstract class AbstractDisplayDef<T extends object, FilterFnType = undefined> extends ColumnDef<T, FilterFnType> {
14
14
  abstract readonly displayType: DisplayType;
15
- constructor(props: AbstractDisplayDefProps<T>);
15
+ constructor(props: AbstractDisplayDefProps<T, FilterFnType>);
16
16
  readonly columnType: "Display";
17
17
  readonly modal: Component<DisplayDefModalProps<T>, any, any> | undefined;
18
18
  }
@@ -1,10 +1,15 @@
1
1
  import type { BubbleColour } from '../../../../../Bubble.svelte';
2
2
  import { AbstractDisplayDef, type AbstractDisplayDefProps } from './AbstractDisplayDef.svelte.js';
3
- export interface BubbleDefProps<T extends object> extends AbstractDisplayDefProps<T> {
3
+ import type { FilterFn, StringFilterValueType } from '../../../Filtering/FilterFn.js';
4
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
5
+ export interface BubbleDefProps<T extends object> extends AbstractDisplayDefProps<T, StringFilterValueType> {
4
6
  getColour?: (item: T, index: number, value: string) => BubbleColour | Promise<BubbleColour | null | undefined>;
5
7
  }
6
- export declare class BubbleDef<T extends object> extends AbstractDisplayDef<T> {
8
+ export declare class BubbleDef<T extends object> extends AbstractDisplayDef<T, StringFilterValueType> {
7
9
  readonly displayType: "Bubbles";
8
10
  constructor(props: BubbleDefProps<T>);
11
+ private _filterFn;
12
+ get filterFn(): FilterFn<T, StringFilterValueType> | CustomFilterFn | undefined;
13
+ set filterFn(v: FilterFn<T, StringFilterValueType> | CustomFilterFn | undefined);
9
14
  getColour: ((item: T, index: number, value: string) => BubbleColour | Promise<BubbleColour | null | undefined>) | undefined;
10
15
  }
@@ -5,6 +5,14 @@ export class BubbleDef extends AbstractDisplayDef {
5
5
  constructor(props) {
6
6
  super(props);
7
7
  this.getColour = $derived(props.getColour);
8
+ this._filterFn = $state(props.filterFn);
9
+ }
10
+ _filterFn;
11
+ get filterFn() {
12
+ return this._filterFn;
13
+ }
14
+ set filterFn(v) {
15
+ this._filterFn = v;
8
16
  }
9
17
  getColour;
10
18
  }
@@ -1,8 +1,13 @@
1
1
  import { AbstractDisplayDef, type AbstractDisplayDefProps } from './AbstractDisplayDef.svelte.js';
2
2
  import { DisplayType } from '../../DisplayType.js';
3
- export interface DisplayDefProps<T extends object> extends AbstractDisplayDefProps<T> {
3
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
4
+ import type { FilterFn } from '../../../Filtering/FilterFn.js';
5
+ export interface DisplayDefProps<T extends object> extends AbstractDisplayDefProps<T, any> {
4
6
  }
5
- export declare class DisplayDef<T extends object> extends AbstractDisplayDef<T> {
7
+ export declare class DisplayDef<T extends object> extends AbstractDisplayDef<T, any> {
6
8
  readonly displayType: DisplayType;
7
9
  constructor(props: DisplayDefProps<T>);
10
+ private _filterFn;
11
+ get filterFn(): CustomFilterFn | FilterFn<T, any> | undefined;
12
+ set filterFn(v: CustomFilterFn | FilterFn<T, any> | undefined);
8
13
  }
@@ -4,5 +4,13 @@ export class DisplayDef extends AbstractDisplayDef {
4
4
  displayType = DisplayType.Normal;
5
5
  constructor(props) {
6
6
  super(props);
7
+ this._filterFn = $state(props.filterFn);
8
+ }
9
+ _filterFn;
10
+ get filterFn() {
11
+ return this._filterFn;
12
+ }
13
+ set filterFn(v) {
14
+ this._filterFn = v;
7
15
  }
8
16
  }
@@ -1,10 +1,15 @@
1
1
  import type { BubbleColour } from '../../../../../Bubble.svelte';
2
2
  import { AbstractDisplayDef, type AbstractDisplayDefProps } from './AbstractDisplayDef.svelte.js';
3
- export interface ProgressBarDefProps<T extends object> extends AbstractDisplayDefProps<T> {
3
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
4
+ import type { FilterFn, NumberFilterValueType } from '../../../Filtering/FilterFn.js';
5
+ export interface ProgressBarDefProps<T extends object> extends AbstractDisplayDefProps<T, NumberFilterValueType> {
4
6
  getColour: (item: T, index: number, value: [number, number]) => BubbleColour | Promise<BubbleColour> | undefined;
5
7
  }
6
- export declare class ProgressBarDef<T extends object> extends AbstractDisplayDef<T> {
8
+ export declare class ProgressBarDef<T extends object> extends AbstractDisplayDef<T, NumberFilterValueType> {
7
9
  readonly displayType: "Progress";
8
10
  constructor(props: ProgressBarDefProps<T>);
9
11
  readonly getColour: (item: T, index: number, value: [number, number]) => BubbleColour | Promise<BubbleColour> | undefined;
12
+ private _filterFn;
13
+ get filterFn(): FilterFn<T, NumberFilterValueType> | CustomFilterFn | undefined;
14
+ set filterFn(v: FilterFn<T, NumberFilterValueType> | CustomFilterFn | undefined);
10
15
  }
@@ -5,6 +5,14 @@ export class ProgressBarDef extends AbstractDisplayDef {
5
5
  constructor(props) {
6
6
  super(props);
7
7
  this.getColour = $derived(props.getColour);
8
+ this._filterFn = $state(props.filterFn);
8
9
  }
9
10
  getColour;
11
+ _filterFn;
12
+ get filterFn() {
13
+ return this._filterFn;
14
+ }
15
+ set filterFn(v) {
16
+ this._filterFn = v;
17
+ }
10
18
  }
@@ -3,8 +3,9 @@ import type { ValidationFn } from '../ValidationFn.js';
3
3
  export interface ValidityDefProps<T extends object> extends AbstractDisplayDefProps<T> {
4
4
  isValid: ValidationFn<T>;
5
5
  }
6
- export declare class ValidityDef<T extends object> extends AbstractDisplayDef<T> {
6
+ export declare class ValidityDef<T extends object> extends AbstractDisplayDef<T, undefined> {
7
7
  readonly displayType: "Validity";
8
8
  constructor(props: ValidityDefProps<T>);
9
+ readonly filterFn: undefined;
9
10
  readonly isValid: ValidationFn<T>;
10
11
  }
@@ -4,8 +4,10 @@ export class ValidityDef extends AbstractDisplayDef {
4
4
  displayType = DisplayType.Validity;
5
5
  constructor(props) {
6
6
  props.allowSorting = false;
7
+ props.allowFiltering = false;
7
8
  super(props);
8
9
  this.isValid = $derived(props.isValid);
9
10
  }
11
+ filterFn = undefined;
10
12
  isValid;
11
13
  }
@@ -10,9 +10,10 @@ export interface ExpandDefProps<T extends object, R extends object> extends Colu
10
10
  innerTableOptions: TableInitOptions<R>;
11
11
  accessorFn: (item: T, index: number) => R[] | Promise<R[]>;
12
12
  }
13
- export declare class ExpandDef<T extends object, R extends object = object> extends ColumnDef<T> {
13
+ export declare class ExpandDef<T extends object, R extends object = object> extends ColumnDef<T, undefined> {
14
14
  readonly columnType: "Expand";
15
15
  constructor(props: ExpandDefProps<T, R>);
16
+ readonly filterFn: undefined;
16
17
  readonly innerTableName: string;
17
18
  readonly getInnerColumnDefs: (item: T, index: number) => DefsWrapper<R>;
18
19
  readonly headerIcon: IconProps['name'];
@@ -3,6 +3,8 @@ import { ColumnDef } from '../ColumnDef.svelte.js';
3
3
  export class ExpandDef extends ColumnDef {
4
4
  columnType = ColumnType.Expand;
5
5
  constructor(props) {
6
+ props.allowFiltering = false;
7
+ props.allowSorting = false;
6
8
  super(props);
7
9
  this.isEnabled = $derived(props.isEnabled);
8
10
  this.headerIcon = $derived(props.headerIcon);
@@ -10,6 +12,7 @@ export class ExpandDef extends ColumnDef {
10
12
  this.innerTableName = $derived(props.innerTableName);
11
13
  this.innerTableOptions = $derived(props.innerTableOptions);
12
14
  }
15
+ filterFn = undefined;
13
16
  innerTableName;
14
17
  getInnerColumnDefs;
15
18
  headerIcon;
@@ -1,9 +1,11 @@
1
- import type { StringFilterValueType } from '../../../Filtering/FilterFn.js';
1
+ import type { CustomFilterFn } from '../../../Filtering/CustomFilterFn.js';
2
+ import type { FilterFn } from '../../../Filtering/FilterFn.js';
2
3
  import { ColumnType } from '../../ColumnType.js';
3
4
  import { ColumnDef, type ColumnDefProps } from '../ColumnDef.svelte.js';
4
- export interface FilterOnlyDefProps<T extends object> extends ColumnDefProps<T> {
5
+ export interface FilterOnlyDefProps<T extends object, FilterFnType> extends ColumnDefProps<T, FilterFnType> {
5
6
  }
6
- export declare class FilterOnlyDef<T extends object> extends ColumnDef<T, StringFilterValueType> {
7
+ export declare class FilterOnlyDef<T extends object, FilterFnType> extends ColumnDef<T, FilterFnType> {
7
8
  readonly columnType: ColumnType;
8
- constructor(props: FilterOnlyDefProps<T>);
9
+ constructor(props: FilterOnlyDefProps<T, FilterFnType>);
10
+ readonly filterFn: CustomFilterFn | FilterFn<T, FilterFnType> | undefined;
9
11
  }
@@ -5,4 +5,5 @@ export class FilterOnlyDef extends ColumnDef {
5
5
  constructor(props) {
6
6
  super(props);
7
7
  }
8
+ filterFn;
8
9
  }
@@ -4,4 +4,5 @@ export declare class RowSelectionDef<T extends object> extends ColumnDef<T> {
4
4
  readonly isSelectable: (item: T, index: number) => boolean | Promise<boolean>;
5
5
  readonly columnType: ColumnType;
6
6
  constructor(isSelectable: (item: T, index: number) => boolean | Promise<boolean>);
7
+ readonly filterFn: undefined;
7
8
  }
@@ -8,8 +8,10 @@ export class RowSelectionDef extends ColumnDef {
8
8
  super({
9
9
  id: `is-selectable-${generateUUID()}`,
10
10
  header: 'Row Selected',
11
- allowSorting: false
11
+ allowSorting: false,
12
+ allowFiltering: false
12
13
  });
13
14
  this.isSelectable = isSelectable;
14
15
  }
16
+ filterFn;
15
17
  }
@@ -174,7 +174,7 @@ export declare class TableContext<T extends object> {
174
174
  readonly lastPage: number;
175
175
  readonly measureHeaderWidth: (columnDef: ColumnDef<T>) => number;
176
176
  readonly autoResize: (columnDef: ColumnDef<T>) => Promise<void>;
177
- reorderColumn: (dropTarget: HTMLLIElement | HTMLTableCellElement | null) => ColumnDef<T, unknown>[] | undefined;
177
+ reorderColumn: (dropTarget: HTMLLIElement | HTMLTableCellElement | null) => ColumnDef<T, undefined>[] | undefined;
178
178
  copyHighlightedRowsToClipboard: () => Promise<void>;
179
179
  copyDataToClipboard: () => Promise<void>;
180
180
  private _performRowCopy;
@@ -14,6 +14,8 @@ import { DateInputDef } from '../Columns/Definitions/Accessors/DateInputDef.svel
14
14
  import { ProgressBarDef } from '../Columns/Definitions/Display/ProgressBarDef.svelte.js';
15
15
  import { DisplayDef } from '../Columns/Definitions/Display/DisplayDef.svelte.js';
16
16
  import { browser } from '$app/environment';
17
+ import { ActionsDef } from '../Columns/Definitions/Actions/ActionsDef.svelte.js';
18
+ import { BubbleDef } from '../Columns/Definitions/Display/BubbleDef.svelte.js';
17
19
  const SORTING_ICON_WIDTH = 24;
18
20
  const InternalSymbol = Symbol();
19
21
  export class TableContext {
@@ -1551,7 +1553,16 @@ export class TableContext {
1551
1553
  newPresets.push(newPreset);
1552
1554
  }
1553
1555
  this.columnPresets = newPresets;
1554
- const stringified = JSON.stringify(newPresets);
1556
+ const jsonFriendly = newPresets.map((preset) => {
1557
+ return {
1558
+ ...preset,
1559
+ columnPinningState: {
1560
+ left: [...(preset.columnPinningState.left?.entries() ?? [])],
1561
+ right: [...(preset.columnPinningState.right?.entries() ?? [])]
1562
+ }
1563
+ };
1564
+ });
1565
+ const stringified = JSON.stringify(jsonFriendly);
1555
1566
  localStorage.setItem(`${this.userId}-${this.tableName}-presets`, stringified);
1556
1567
  this.setSelectedPreset(newPreset);
1557
1568
  };
@@ -1899,30 +1910,40 @@ export class TableContext {
1899
1910
  def.filterFn = this.dateFilter;
1900
1911
  }
1901
1912
  }
1902
- else if (this.paginationRepo?.paginationType == PaginationType.Local && !def.filterFn) {
1903
- switch (def.filterValueType) {
1904
- case undefined:
1905
- case 'String': {
1906
- def.filterFn = this.stringFilter;
1907
- break;
1908
- }
1909
- case 'Bool': {
1910
- def.filterFn = this.boolFilter;
1911
- break;
1912
- }
1913
- case 'Date': {
1914
- def.filterFn = this.dateFilter;
1915
- break;
1916
- }
1917
- case 'Number': {
1918
- def.filterFn = this.numberFilter;
1919
- break;
1920
- }
1921
- case 'Select': {
1922
- def.filterFn = this.selectFilter;
1923
- break;
1913
+ else if (this.paginationRepo?.paginationType == PaginationType.Local &&
1914
+ !def.filterFn &&
1915
+ def.allowFiltering != false) {
1916
+ if (def instanceof DisplayDef) {
1917
+ switch (def.filterValueType) {
1918
+ case undefined:
1919
+ case 'String': {
1920
+ def.filterFn = this.stringFilter;
1921
+ break;
1922
+ }
1923
+ case 'Bool': {
1924
+ def.filterFn = this.boolFilter;
1925
+ break;
1926
+ }
1927
+ case 'Date': {
1928
+ def.filterFn = this.dateFilter;
1929
+ break;
1930
+ }
1931
+ case 'Number': {
1932
+ def.filterFn = this.numberFilter;
1933
+ break;
1934
+ }
1935
+ case 'Select': {
1936
+ def.filterFn = this.selectFilter;
1937
+ break;
1938
+ }
1924
1939
  }
1925
1940
  }
1941
+ else if (def instanceof BubbleDef) {
1942
+ def.filterFn = this.stringFilter;
1943
+ }
1944
+ else if (def instanceof ProgressBarDef) {
1945
+ def.filterFn = this.numberFilter;
1946
+ }
1926
1947
  }
1927
1948
  return def;
1928
1949
  });
@@ -2331,9 +2352,10 @@ function progressSortingFn(id, desc) {
2331
2352
  };
2332
2353
  }
2333
2354
  function adaptJSONPinningState(state) {
2355
+ //HACK ignore previously broken pinning states
2334
2356
  return {
2335
- left: new Map(state.left),
2336
- right: new Map(state.right)
2357
+ left: new Map(Array.isArray(state.left) ? state.left : []),
2358
+ right: new Map(Array.isArray(state.right) ? state.right : [])
2337
2359
  };
2338
2360
  }
2339
2361
  // #endregion
@@ -1782,6 +1782,8 @@
1782
1782
  padding-left: 4px;
1783
1783
  padding-right: 4px;
1784
1784
  gap: 4px;
1785
+ width: 100%;
1786
+ justify-content: space-around;
1785
1787
  }
1786
1788
  td {
1787
1789
  background-color: colours.$ui-blue-1;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@lavalogic/scoria",
3
3
  "description": "Svelte components used for the FloWMS Web Frontend",
4
- "version": "0.0.46",
4
+ "version": "0.0.47",
5
5
  "publishConfig": {
6
6
  "access": "restricted"
7
7
  },
@@ -29,42 +29,42 @@
29
29
  "svelte": "^5.0.0"
30
30
  },
31
31
  "devDependencies": {
32
- "@chromatic-com/storybook": "^4.1.1",
33
- "@eslint/compat": "^1.4.0",
34
- "@eslint/js": "^9.38.0",
32
+ "@chromatic-com/storybook": "^4.1.2",
33
+ "@eslint/compat": "^1.4.1",
34
+ "@eslint/js": "^9.39.1",
35
35
  "@playwright/test": "^1.56.1",
36
- "@storybook/addon-a11y": "^9.1.13",
37
- "@storybook/addon-docs": "^9.1.13",
36
+ "@storybook/addon-a11y": "^9.1.16",
37
+ "@storybook/addon-docs": "^9.1.16",
38
38
  "@storybook/addon-svelte-csf": "^5.0.10",
39
- "@storybook/addon-vitest": "^9.1.13",
40
- "@storybook/sveltekit": "^9.1.13",
39
+ "@storybook/addon-vitest": "^9.1.16",
40
+ "@storybook/sveltekit": "^9.1.16",
41
41
  "@sveltejs/adapter-node": "^5.4.0",
42
- "@sveltejs/kit": "^2.47.3",
42
+ "@sveltejs/kit": "^2.48.4",
43
43
  "@sveltejs/package": "^2.5.4",
44
44
  "@sveltejs/vite-plugin-svelte": "^6.2.1",
45
45
  "@types/eslint": "^9.6.1",
46
- "@types/node": "^20.19.23",
47
- "@typescript-eslint/eslint-plugin": "^8.46.2",
48
- "@typescript-eslint/parser": "^8.46.2",
46
+ "@types/node": "^20.19.25",
47
+ "@typescript-eslint/eslint-plugin": "^8.46.4",
48
+ "@typescript-eslint/parser": "^8.46.4",
49
49
  "@vitest/browser": "^3.2.4",
50
- "eslint": "^9.38.0",
50
+ "eslint": "^9.39.1",
51
51
  "eslint-config-prettier": "^10.1.8",
52
- "eslint-plugin-storybook": "^9.1.13",
53
- "eslint-plugin-svelte": "^3.12.5",
54
- "globals": "^16.4.0",
52
+ "eslint-plugin-storybook": "^9.1.16",
53
+ "eslint-plugin-svelte": "^3.13.0",
54
+ "globals": "^16.5.0",
55
55
  "mdsvex": "^0.12.6",
56
56
  "playwright": "^1.56.1",
57
57
  "prettier": "^3.6.2",
58
58
  "prettier-plugin-svelte": "^3.4.0",
59
59
  "publint": "^0.3.15",
60
- "sass-embedded": "^1.93.2",
61
- "storybook": "^9.1.13",
62
- "svelte": "^5.41.3",
63
- "svelte-check": "^4.3.3",
60
+ "sass-embedded": "^1.93.3",
61
+ "storybook": "^9.1.16",
62
+ "svelte": "~5.40.2",
63
+ "svelte-check": "^4.3.4",
64
64
  "svelte-render-scan": "^1.1.0",
65
65
  "typescript": "^5.9.3",
66
- "typescript-eslint": "^8.46.2",
67
- "vite": "^7.1.12",
66
+ "typescript-eslint": "^8.46.4",
67
+ "vite": "^7.2.2",
68
68
  "vite-plugin-devtools-json": "^1.0.0",
69
69
  "vitest": "^3.2.4",
70
70
  "vitest-browser-svelte": "^1.1.0"