@lavalogic/scoria 0.40.1 → 0.40.2
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/README.md +58 -58
- package/dist/Components/AccordionGroup.svelte +46 -46
- package/dist/Components/AccordionGroupButton.svelte +76 -76
- package/dist/Components/Action.svelte +136 -136
- package/dist/Components/AlertModal.svelte +195 -195
- package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +729 -729
- package/dist/Components/Base/BaseModal.svelte +125 -125
- package/dist/Components/Base/ContextWrapper.svelte +72 -72
- package/dist/Components/Base/Pagination.svelte +198 -198
- package/dist/Components/Base/Snippets.svelte +36 -36
- package/dist/Components/BigRadioSet.svelte +38 -38
- package/dist/Components/Bubble.svelte +101 -101
- package/dist/Components/Button.svelte +209 -209
- package/dist/Components/Checkbox.svelte +86 -86
- package/dist/Components/CollapsibleCard.svelte +78 -78
- package/dist/Components/Contexts/ContextMenu.svelte +164 -164
- package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
- package/dist/Components/Contexts/ContextMenuOption.svelte +60 -60
- package/dist/Components/Contexts/Toast.svelte +86 -86
- package/dist/Components/Contexts/ToastContainer.svelte +65 -65
- package/dist/Components/Contexts/Tooltip.svelte +37 -37
- package/dist/Components/DataMatrixIcon.svelte +112 -112
- package/dist/Components/DateInput.svelte +148 -148
- package/dist/Components/DatePicker.svelte +300 -300
- package/dist/Components/DesktopModal.svelte +90 -90
- package/dist/Components/Dial.svelte +204 -204
- package/dist/Components/DimensionInput.svelte +170 -170
- package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -119
- package/dist/Components/DragMenu/DraggableCard.svelte +77 -77
- package/dist/Components/FileCard.svelte +24 -24
- package/dist/Components/FileUpload.svelte +236 -236
- package/dist/Components/GridInput.svelte +196 -196
- package/dist/Components/GridInputSet.svelte +29 -29
- package/dist/Components/HorizontalTabGroup.svelte +82 -82
- package/dist/Components/HorizontalTabGroupButton.svelte +44 -44
- package/dist/Components/Icon.svelte +128 -128
- package/dist/Components/Icons.js +357 -357
- package/dist/Components/InfoAlert.svelte +35 -35
- package/dist/Components/LoadingAnimation.svelte +29 -29
- package/dist/Components/LoadingModal.svelte +45 -45
- package/dist/Components/LoadingOverlay.svelte +25 -25
- package/dist/Components/Modal.svelte +258 -258
- package/dist/Components/MultiSelect.svelte +220 -220
- package/dist/Components/Nav/Nav.svelte +110 -110
- package/dist/Components/Nav/NavServiceMenuList.svelte +43 -43
- package/dist/Components/Nav/NavTab.svelte +62 -62
- package/dist/Components/Nav/ServiceMenuItem.svelte +112 -112
- package/dist/Components/Nav/ServicesNav.svelte +80 -80
- package/dist/Components/NumberInput.svelte +157 -157
- package/dist/Components/PageHeading.svelte +25 -25
- package/dist/Components/PasswordInput.svelte +88 -88
- package/dist/Components/Portal.svelte +36 -36
- package/dist/Components/ProgressBubble.svelte +107 -107
- package/dist/Components/QuerySelect.svelte +366 -366
- package/dist/Components/SingleSelect.svelte +250 -250
- package/dist/Components/StepButton.svelte +70 -70
- package/dist/Components/StepForm.svelte +140 -140
- package/dist/Components/Switch.svelte +69 -69
- package/dist/Components/Table/ARCHITECTURE.md +298 -298
- package/dist/Components/Table/Body/QuickSearchCell.svelte +679 -679
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +51 -51
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +59 -59
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +454 -454
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -79
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +185 -185
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +124 -124
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +131 -120
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +234 -234
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +105 -105
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -87
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +126 -126
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -159
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +246 -246
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +216 -216
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +252 -252
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +179 -179
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +221 -221
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +197 -197
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +190 -190
- package/dist/Components/Table/Body/Rows/TableRow.svelte +290 -290
- package/dist/Components/Table/Body/TableBody.svelte +155 -155
- package/dist/Components/Table/ColumnFactory.svelte.js +1 -0
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -41
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -30
- package/dist/Components/Table/Headers/TableHead.svelte +415 -415
- package/dist/Components/Table/Misc/ColumnPanel.svelte +39 -39
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +39 -39
- package/dist/Components/Table/Misc/FilterInput.svelte +641 -641
- package/dist/Components/Table/Misc/FilterPanel.svelte +190 -190
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +31 -31
- package/dist/Components/Table/Misc/ShareViewModal.svelte +291 -291
- package/dist/Components/Table/Misc/SidePanel.svelte +35 -35
- package/dist/Components/Table/Misc/TableConfigurationModal.svelte +644 -644
- package/dist/Components/Table/Misc/TableFooter.svelte +340 -340
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +140 -140
- package/dist/Components/Table/Misc/TableSidebar.svelte +200 -200
- package/dist/Components/Table/Misc/TableViewDropdown.svelte +105 -105
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +100 -100
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -107
- package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +192 -192
- package/dist/Components/Table/NestedTable.svelte +130 -130
- package/dist/Components/Table/Table.svelte +692 -692
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +5 -0
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.js +3 -0
- package/dist/Components/Table/Types/Public/ColumnOptions.d.ts +10 -0
- package/dist/Components/Test/TestContextConsumer.svelte +13 -13
- package/dist/Components/TextArea.svelte +130 -130
- package/dist/Components/TextInput.svelte +176 -176
- package/dist/Components/ThreeStateRadio.svelte +131 -131
- package/dist/Components/Touch/BoolCard.svelte +45 -45
- package/dist/Components/Touch/DateModal.svelte +209 -209
- package/dist/Components/Touch/EditCard.svelte +59 -59
- package/dist/Components/Touch/InfoCard.svelte +31 -31
- package/dist/Components/Touch/InfoTextCard.svelte +28 -28
- package/dist/Components/Touch/ModalExplanation.svelte +17 -17
- package/dist/Components/Touch/NumberKeyboard.svelte +225 -225
- package/dist/Components/Touch/NumberModal.svelte +79 -79
- package/dist/Components/Touch/PlusMinusCard.svelte +46 -46
- package/dist/Components/Touch/SelectModal.svelte +127 -127
- package/dist/Components/Touch/SummaryCard.svelte +93 -93
- package/dist/Components/Touch/TextAreaModal.svelte +95 -95
- package/dist/Components/Touch/TextModal.svelte +106 -106
- package/dist/Components/Touch/TouchCard.svelte +33 -33
- package/dist/Components/Touch/TouchModal.svelte +274 -274
- package/dist/Components/Touch/UtilityButton.svelte +109 -109
- package/dist/Components/VerticalTabGroup.svelte +79 -79
- package/dist/Components/VerticalTabGroupButton.svelte +58 -58
- package/dist/Helpers/Datamatrix.d.ts +19 -19
- package/dist/Helpers/Datamatrix.js +291 -291
- package/dist/Types/Examples/ExampleModal.svelte +35 -35
- package/dist/scss/_basics.scss +12 -12
- package/dist/scss/_colours.scss +134 -134
- package/dist/scss/_mixins.scss +3392 -3392
- package/dist/scss/_motion.scss +57 -57
- package/dist/scss/_sizing.scss +85 -85
- package/dist/scss/_transitions.scss +8 -8
- package/package.json +1 -1
|
@@ -1,157 +1,157 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
generics="T extends object, IdType extends Primitive"
|
|
6
|
-
>
|
|
7
|
-
import { getContext } from 'svelte';
|
|
8
|
-
import { TableContext } from '../Types/Context/TableContext.svelte.js';
|
|
9
|
-
import type { Primitive } from '../Types/Context/TableInitOptions.js';
|
|
10
|
-
import QuickSearchCell from './QuickSearchCell.svelte';
|
|
11
|
-
import TableRow from './Rows/TableRow.svelte';
|
|
12
|
-
import type { TableBodyProps } from './TableBodyProps.js';
|
|
13
|
-
|
|
14
|
-
const { oncontextmenu }: TableBodyProps = $props();
|
|
15
|
-
|
|
16
|
-
const tableContext = getContext<TableContext<T, IdType>>(TableContext.identifier);
|
|
17
|
-
|
|
18
|
-
// Visible columns split by pinning side, matching the cell-side
|
|
19
|
-
// arrays used by `TableRow`. Each side is reactive on column
|
|
20
|
-
// visibility and pinning state.
|
|
21
|
-
const leftColumns = $derived(tableContext.table.getLeftVisibleLeafColumns());
|
|
22
|
-
const centreColumns = $derived(tableContext.table.getCenterVisibleLeafColumns());
|
|
23
|
-
const rightColumns = $derived(tableContext.table.getRightVisibleLeafColumns());
|
|
24
|
-
|
|
25
|
-
const showHighlightColumn = $derived(
|
|
26
|
-
leftColumns.length + centreColumns.length + rightColumns.length > 0
|
|
27
|
-
);
|
|
28
|
-
|
|
29
|
-
// Cumulative pinning offsets for the quick-filter row's sticky
|
|
30
|
-
// cells. Reads rendered widths from `_columnRenderedWidths`
|
|
31
|
-
// (populated by the ResizeObserver in TableHead) so filter inputs
|
|
32
|
-
// for pinned columns stay aligned with their column even when the
|
|
33
|
-
// column flexes wider than `columnDef.width`.
|
|
34
|
-
function renderedColumnWidth(columnId: string, declared: number): number {
|
|
35
|
-
return tableContext._columnRenderedWidths.get(columnId) ?? declared;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
const leftOffsets: Array<number> = $derived.by(() => {
|
|
39
|
-
void tableContext._columnRenderedWidths.size;
|
|
40
|
-
const offsets: Array<number> = [];
|
|
41
|
-
let cumulative = showHighlightColumn ? 20 : 0;
|
|
42
|
-
for (const col of leftColumns) {
|
|
43
|
-
offsets.push(cumulative);
|
|
44
|
-
cumulative += renderedColumnWidth(col.id, col.columnDef.width);
|
|
45
|
-
}
|
|
46
|
-
return offsets;
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const rightOffsets: Array<number> = $derived.by(() => {
|
|
50
|
-
void tableContext._columnRenderedWidths.size;
|
|
51
|
-
const offsets = new Array<number>(rightColumns.length).fill(0);
|
|
52
|
-
let cumulative = 0;
|
|
53
|
-
for (let i = rightColumns.length - 1; i >= 0; i--) {
|
|
54
|
-
offsets[i] = cumulative;
|
|
55
|
-
cumulative += renderedColumnWidth(rightColumns[i].id, rightColumns[i].columnDef.width);
|
|
56
|
-
}
|
|
57
|
-
return offsets;
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
// Row virtualisation. When the current row count is above the
|
|
61
|
-
// `_virtualisation` threshold (100 rows by default), only rows in the
|
|
62
|
-
// viewport plus an overscan band are rendered. Two spacer rows (top
|
|
63
|
-
// and bottom) reserve the rest of the body height so the scrollbar
|
|
64
|
-
// matches the un-virtualised length.
|
|
65
|
-
const virtualisation = $derived(tableContext._virtualisation);
|
|
66
|
-
const visibleRows = $derived(virtualisation.visibleRows);
|
|
67
|
-
const topSpacerHeight = $derived(virtualisation.topSpacerHeight);
|
|
68
|
-
const bottomSpacerHeight = $derived(virtualisation.bottomSpacerHeight);
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<div
|
|
72
|
-
role="rowgroup"
|
|
73
|
-
class="datatable-body"
|
|
74
|
-
{oncontextmenu}
|
|
75
|
-
>
|
|
76
|
-
{#if tableContext.allowQuickFiltering && tableContext.showQuickFiltering && showHighlightColumn}
|
|
77
|
-
<div
|
|
78
|
-
role="row"
|
|
79
|
-
class="datatable-row quick-filter-row"
|
|
80
|
-
>
|
|
81
|
-
{#if showHighlightColumn}
|
|
82
|
-
<div
|
|
83
|
-
role="cell"
|
|
84
|
-
class="cell highlight-dud pinned-left"
|
|
85
|
-
style="left: 0px"
|
|
86
|
-
aria-hidden="true"
|
|
87
|
-
>
|
|
88
|
-
|
|
89
|
-
</div>
|
|
90
|
-
{/if}
|
|
91
|
-
{#each leftColumns as column, index (column.id)}
|
|
92
|
-
<div
|
|
93
|
-
role="cell"
|
|
94
|
-
class="cell pinned-left"
|
|
95
|
-
style="left: {leftOffsets[index]}px"
|
|
96
|
-
>
|
|
97
|
-
<QuickSearchCell
|
|
98
|
-
{column}
|
|
99
|
-
customFilters={tableContext.remoteFilters}
|
|
100
|
-
/>
|
|
101
|
-
</div>
|
|
102
|
-
{/each}
|
|
103
|
-
{#each centreColumns as column (column.id)}
|
|
104
|
-
<div
|
|
105
|
-
role="cell"
|
|
106
|
-
class="cell"
|
|
107
|
-
>
|
|
108
|
-
<QuickSearchCell
|
|
109
|
-
{column}
|
|
110
|
-
customFilters={tableContext.remoteFilters}
|
|
111
|
-
/>
|
|
112
|
-
</div>
|
|
113
|
-
{/each}
|
|
114
|
-
{#each rightColumns as column, index (column.id)}
|
|
115
|
-
<div
|
|
116
|
-
role="cell"
|
|
117
|
-
class="cell pinned-right"
|
|
118
|
-
style="right: {rightOffsets[index]}px"
|
|
119
|
-
>
|
|
120
|
-
<QuickSearchCell
|
|
121
|
-
{column}
|
|
122
|
-
customFilters={tableContext.remoteFilters}
|
|
123
|
-
/>
|
|
124
|
-
</div>
|
|
125
|
-
{/each}
|
|
126
|
-
</div>
|
|
127
|
-
{/if}
|
|
128
|
-
|
|
129
|
-
{#if topSpacerHeight > 0}
|
|
130
|
-
<div
|
|
131
|
-
role="presentation"
|
|
132
|
-
class="virtual-spacer"
|
|
133
|
-
style="height: {topSpacerHeight}px;"
|
|
134
|
-
></div>
|
|
135
|
-
{/if}
|
|
136
|
-
|
|
137
|
-
{#each visibleRows as { row } (row.id)}
|
|
138
|
-
{@const originalIndex = row.visibleIndex}
|
|
139
|
-
<TableRow
|
|
140
|
-
{row}
|
|
141
|
-
odd={originalIndex % 2 == 1}
|
|
142
|
-
includeHighlight={showHighlightColumn}
|
|
143
|
-
/>
|
|
144
|
-
{/each}
|
|
145
|
-
|
|
146
|
-
{#if bottomSpacerHeight > 0}
|
|
147
|
-
<div
|
|
148
|
-
role="presentation"
|
|
149
|
-
class="virtual-spacer"
|
|
150
|
-
style="height: {bottomSpacerHeight}px;"
|
|
151
|
-
></div>
|
|
152
|
-
{/if}
|
|
153
|
-
</div>
|
|
154
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object, IdType extends Primitive"
|
|
6
|
+
>
|
|
7
|
+
import { getContext } from 'svelte';
|
|
8
|
+
import { TableContext } from '../Types/Context/TableContext.svelte.js';
|
|
9
|
+
import type { Primitive } from '../Types/Context/TableInitOptions.js';
|
|
10
|
+
import QuickSearchCell from './QuickSearchCell.svelte';
|
|
11
|
+
import TableRow from './Rows/TableRow.svelte';
|
|
12
|
+
import type { TableBodyProps } from './TableBodyProps.js';
|
|
13
|
+
|
|
14
|
+
const { oncontextmenu }: TableBodyProps = $props();
|
|
15
|
+
|
|
16
|
+
const tableContext = getContext<TableContext<T, IdType>>(TableContext.identifier);
|
|
17
|
+
|
|
18
|
+
// Visible columns split by pinning side, matching the cell-side
|
|
19
|
+
// arrays used by `TableRow`. Each side is reactive on column
|
|
20
|
+
// visibility and pinning state.
|
|
21
|
+
const leftColumns = $derived(tableContext.table.getLeftVisibleLeafColumns());
|
|
22
|
+
const centreColumns = $derived(tableContext.table.getCenterVisibleLeafColumns());
|
|
23
|
+
const rightColumns = $derived(tableContext.table.getRightVisibleLeafColumns());
|
|
24
|
+
|
|
25
|
+
const showHighlightColumn = $derived(
|
|
26
|
+
leftColumns.length + centreColumns.length + rightColumns.length > 0
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
// Cumulative pinning offsets for the quick-filter row's sticky
|
|
30
|
+
// cells. Reads rendered widths from `_columnRenderedWidths`
|
|
31
|
+
// (populated by the ResizeObserver in TableHead) so filter inputs
|
|
32
|
+
// for pinned columns stay aligned with their column even when the
|
|
33
|
+
// column flexes wider than `columnDef.width`.
|
|
34
|
+
function renderedColumnWidth(columnId: string, declared: number): number {
|
|
35
|
+
return tableContext._columnRenderedWidths.get(columnId) ?? declared;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
const leftOffsets: Array<number> = $derived.by(() => {
|
|
39
|
+
void tableContext._columnRenderedWidths.size;
|
|
40
|
+
const offsets: Array<number> = [];
|
|
41
|
+
let cumulative = showHighlightColumn ? 20 : 0;
|
|
42
|
+
for (const col of leftColumns) {
|
|
43
|
+
offsets.push(cumulative);
|
|
44
|
+
cumulative += renderedColumnWidth(col.id, col.columnDef.width);
|
|
45
|
+
}
|
|
46
|
+
return offsets;
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const rightOffsets: Array<number> = $derived.by(() => {
|
|
50
|
+
void tableContext._columnRenderedWidths.size;
|
|
51
|
+
const offsets = new Array<number>(rightColumns.length).fill(0);
|
|
52
|
+
let cumulative = 0;
|
|
53
|
+
for (let i = rightColumns.length - 1; i >= 0; i--) {
|
|
54
|
+
offsets[i] = cumulative;
|
|
55
|
+
cumulative += renderedColumnWidth(rightColumns[i].id, rightColumns[i].columnDef.width);
|
|
56
|
+
}
|
|
57
|
+
return offsets;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
// Row virtualisation. When the current row count is above the
|
|
61
|
+
// `_virtualisation` threshold (100 rows by default), only rows in the
|
|
62
|
+
// viewport plus an overscan band are rendered. Two spacer rows (top
|
|
63
|
+
// and bottom) reserve the rest of the body height so the scrollbar
|
|
64
|
+
// matches the un-virtualised length.
|
|
65
|
+
const virtualisation = $derived(tableContext._virtualisation);
|
|
66
|
+
const visibleRows = $derived(virtualisation.visibleRows);
|
|
67
|
+
const topSpacerHeight = $derived(virtualisation.topSpacerHeight);
|
|
68
|
+
const bottomSpacerHeight = $derived(virtualisation.bottomSpacerHeight);
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<div
|
|
72
|
+
role="rowgroup"
|
|
73
|
+
class="datatable-body"
|
|
74
|
+
{oncontextmenu}
|
|
75
|
+
>
|
|
76
|
+
{#if tableContext.allowQuickFiltering && tableContext.showQuickFiltering && showHighlightColumn}
|
|
77
|
+
<div
|
|
78
|
+
role="row"
|
|
79
|
+
class="datatable-row quick-filter-row"
|
|
80
|
+
>
|
|
81
|
+
{#if showHighlightColumn}
|
|
82
|
+
<div
|
|
83
|
+
role="cell"
|
|
84
|
+
class="cell highlight-dud pinned-left"
|
|
85
|
+
style="left: 0px"
|
|
86
|
+
aria-hidden="true"
|
|
87
|
+
>
|
|
88
|
+
|
|
89
|
+
</div>
|
|
90
|
+
{/if}
|
|
91
|
+
{#each leftColumns as column, index (column.id)}
|
|
92
|
+
<div
|
|
93
|
+
role="cell"
|
|
94
|
+
class="cell pinned-left"
|
|
95
|
+
style="left: {leftOffsets[index]}px"
|
|
96
|
+
>
|
|
97
|
+
<QuickSearchCell
|
|
98
|
+
{column}
|
|
99
|
+
customFilters={tableContext.remoteFilters}
|
|
100
|
+
/>
|
|
101
|
+
</div>
|
|
102
|
+
{/each}
|
|
103
|
+
{#each centreColumns as column (column.id)}
|
|
104
|
+
<div
|
|
105
|
+
role="cell"
|
|
106
|
+
class="cell"
|
|
107
|
+
>
|
|
108
|
+
<QuickSearchCell
|
|
109
|
+
{column}
|
|
110
|
+
customFilters={tableContext.remoteFilters}
|
|
111
|
+
/>
|
|
112
|
+
</div>
|
|
113
|
+
{/each}
|
|
114
|
+
{#each rightColumns as column, index (column.id)}
|
|
115
|
+
<div
|
|
116
|
+
role="cell"
|
|
117
|
+
class="cell pinned-right"
|
|
118
|
+
style="right: {rightOffsets[index]}px"
|
|
119
|
+
>
|
|
120
|
+
<QuickSearchCell
|
|
121
|
+
{column}
|
|
122
|
+
customFilters={tableContext.remoteFilters}
|
|
123
|
+
/>
|
|
124
|
+
</div>
|
|
125
|
+
{/each}
|
|
126
|
+
</div>
|
|
127
|
+
{/if}
|
|
128
|
+
|
|
129
|
+
{#if topSpacerHeight > 0}
|
|
130
|
+
<div
|
|
131
|
+
role="presentation"
|
|
132
|
+
class="virtual-spacer"
|
|
133
|
+
style="height: {topSpacerHeight}px;"
|
|
134
|
+
></div>
|
|
135
|
+
{/if}
|
|
136
|
+
|
|
137
|
+
{#each visibleRows as { row } (row.id)}
|
|
138
|
+
{@const originalIndex = row.visibleIndex}
|
|
139
|
+
<TableRow
|
|
140
|
+
{row}
|
|
141
|
+
odd={originalIndex % 2 == 1}
|
|
142
|
+
includeHighlight={showHighlightColumn}
|
|
143
|
+
/>
|
|
144
|
+
{/each}
|
|
145
|
+
|
|
146
|
+
{#if bottomSpacerHeight > 0}
|
|
147
|
+
<div
|
|
148
|
+
role="presentation"
|
|
149
|
+
class="virtual-spacer"
|
|
150
|
+
style="height: {bottomSpacerHeight}px;"
|
|
151
|
+
></div>
|
|
152
|
+
{/if}
|
|
153
|
+
</div>
|
|
154
|
+
|
|
155
155
|
<style>.cell {
|
|
156
156
|
display: block;
|
|
157
157
|
position: relative;
|
|
@@ -213,4 +213,4 @@
|
|
|
213
213
|
pointer-events: none;
|
|
214
214
|
--row-stripe-height: var(--height, 3rem);
|
|
215
215
|
background-image: repeating-linear-gradient(to bottom, #ffffff 0, #ffffff var(--row-stripe-height), #f4f7f9 var(--row-stripe-height), #f4f7f9 calc(2 * var(--row-stripe-height)));
|
|
216
|
-
}</style>
|
|
216
|
+
}</style>
|
|
@@ -521,6 +521,7 @@ export function createColumnFactory() {
|
|
|
521
521
|
enableResize: opts.inner?.allowResize,
|
|
522
522
|
allowCopy: opts.inner?.allowCopy,
|
|
523
523
|
},
|
|
524
|
+
onActivate: opts.onActivate,
|
|
524
525
|
});
|
|
525
526
|
// Expand has no public width option — apply the per-kind default.
|
|
526
527
|
def.width = KIND_DEFAULT_WIDTHS.expand;
|
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
generics="T extends object, IdType extends Primitive"
|
|
6
|
-
>
|
|
7
|
-
import { devCatch } from '../../../Helpers/Helpers.svelte.js';
|
|
8
|
-
import { Colour } from '../../../scss/colours.js';
|
|
9
|
-
import { Size } from '../../../Types/Internal/Size.js';
|
|
10
|
-
import { getContext } from 'svelte';
|
|
11
|
-
import Action from '../../Action.svelte';
|
|
12
|
-
import { TableContext } from '../Types/Context/TableContext.svelte.js';
|
|
13
|
-
import type { Primitive } from '../Types/Context/TableInitOptions.js';
|
|
14
|
-
|
|
15
|
-
const tableContext = getContext<TableContext<T, IdType>>(TableContext.identifier);
|
|
16
|
-
|
|
17
|
-
const backgroundColour = $derived.by(() => {
|
|
18
|
-
return tableContext.sortedData.length > 0 && tableContext.allHighlighted
|
|
19
|
-
? Colour['$brand-primary']
|
|
20
|
-
: Colour['$ui-white'];
|
|
21
|
-
});
|
|
22
|
-
</script>
|
|
23
|
-
|
|
24
|
-
<div class="highlight-header">
|
|
25
|
-
<div class="wrapper">
|
|
26
|
-
<Action
|
|
27
|
-
label="Highlight all rows"
|
|
28
|
-
{backgroundColour}
|
|
29
|
-
hoverBackgroundColour={Colour['$brand-dark']}
|
|
30
|
-
size={Size.FillWidth}
|
|
31
|
-
icon={{
|
|
32
|
-
name: 'nothing',
|
|
33
|
-
}}
|
|
34
|
-
onclick={() => {
|
|
35
|
-
tableContext.onHighlightAll()?.catch(devCatch);
|
|
36
|
-
}}
|
|
37
|
-
/>
|
|
38
|
-
</div>
|
|
39
|
-
</div>
|
|
40
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object, IdType extends Primitive"
|
|
6
|
+
>
|
|
7
|
+
import { devCatch } from '../../../Helpers/Helpers.svelte.js';
|
|
8
|
+
import { Colour } from '../../../scss/colours.js';
|
|
9
|
+
import { Size } from '../../../Types/Internal/Size.js';
|
|
10
|
+
import { getContext } from 'svelte';
|
|
11
|
+
import Action from '../../Action.svelte';
|
|
12
|
+
import { TableContext } from '../Types/Context/TableContext.svelte.js';
|
|
13
|
+
import type { Primitive } from '../Types/Context/TableInitOptions.js';
|
|
14
|
+
|
|
15
|
+
const tableContext = getContext<TableContext<T, IdType>>(TableContext.identifier);
|
|
16
|
+
|
|
17
|
+
const backgroundColour = $derived.by(() => {
|
|
18
|
+
return tableContext.sortedData.length > 0 && tableContext.allHighlighted
|
|
19
|
+
? Colour['$brand-primary']
|
|
20
|
+
: Colour['$ui-white'];
|
|
21
|
+
});
|
|
22
|
+
</script>
|
|
23
|
+
|
|
24
|
+
<div class="highlight-header">
|
|
25
|
+
<div class="wrapper">
|
|
26
|
+
<Action
|
|
27
|
+
label="Highlight all rows"
|
|
28
|
+
{backgroundColour}
|
|
29
|
+
hoverBackgroundColour={Colour['$brand-dark']}
|
|
30
|
+
size={Size.FillWidth}
|
|
31
|
+
icon={{
|
|
32
|
+
name: 'nothing',
|
|
33
|
+
}}
|
|
34
|
+
onclick={() => {
|
|
35
|
+
tableContext.onHighlightAll()?.catch(devCatch);
|
|
36
|
+
}}
|
|
37
|
+
/>
|
|
38
|
+
</div>
|
|
39
|
+
</div>
|
|
40
|
+
|
|
41
41
|
<style>div.wrapper {
|
|
42
42
|
position: absolute;
|
|
43
43
|
top: 0;
|
|
@@ -47,4 +47,4 @@
|
|
|
47
47
|
display: flex;
|
|
48
48
|
align-items: stretch;
|
|
49
49
|
justify-content: stretch;
|
|
50
|
-
}</style>
|
|
50
|
+
}</style>
|
|
@@ -1,32 +1,32 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
generics="T extends object, IdType extends Primitive"
|
|
6
|
-
>
|
|
7
|
-
import { getContext } from 'svelte';
|
|
8
|
-
import { TableContext } from '../Types/Context/TableContext.svelte.js';
|
|
9
|
-
import type { Primitive } from '../Types/Context/TableInitOptions.js';
|
|
10
|
-
|
|
11
|
-
const tableContext = getContext<TableContext<T, IdType>>(TableContext.identifier);
|
|
12
|
-
|
|
13
|
-
const checked: boolean = $derived(
|
|
14
|
-
tableContext.dataRepo.data.length > 0 ? tableContext.allSelectedInCurrentPage : false
|
|
15
|
-
);
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<div class="checkbox-cell">
|
|
19
|
-
<label aria-label="Select all rows on this page">
|
|
20
|
-
<input
|
|
21
|
-
aria-label="Select all rows on this page"
|
|
22
|
-
onchange={tableContext.selectAllInCurrentPage}
|
|
23
|
-
type="checkbox"
|
|
24
|
-
{checked}
|
|
25
|
-
disabled={tableContext.showSelectedOnly}
|
|
26
|
-
/>
|
|
27
|
-
</label>
|
|
28
|
-
</div>
|
|
29
|
-
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object, IdType extends Primitive"
|
|
6
|
+
>
|
|
7
|
+
import { getContext } from 'svelte';
|
|
8
|
+
import { TableContext } from '../Types/Context/TableContext.svelte.js';
|
|
9
|
+
import type { Primitive } from '../Types/Context/TableInitOptions.js';
|
|
10
|
+
|
|
11
|
+
const tableContext = getContext<TableContext<T, IdType>>(TableContext.identifier);
|
|
12
|
+
|
|
13
|
+
const checked: boolean = $derived(
|
|
14
|
+
tableContext.dataRepo.data.length > 0 ? tableContext.allSelectedInCurrentPage : false
|
|
15
|
+
);
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<div class="checkbox-cell">
|
|
19
|
+
<label aria-label="Select all rows on this page">
|
|
20
|
+
<input
|
|
21
|
+
aria-label="Select all rows on this page"
|
|
22
|
+
onchange={tableContext.selectAllInCurrentPage}
|
|
23
|
+
type="checkbox"
|
|
24
|
+
{checked}
|
|
25
|
+
disabled={tableContext.showSelectedOnly}
|
|
26
|
+
/>
|
|
27
|
+
</label>
|
|
28
|
+
</div>
|
|
29
|
+
|
|
30
30
|
<style>input[type=checkbox] {
|
|
31
31
|
height: var(--checkbox-height);
|
|
32
32
|
padding: 1rem;
|
|
@@ -54,4 +54,4 @@ label {
|
|
|
54
54
|
|
|
55
55
|
label {
|
|
56
56
|
cursor: pointer;
|
|
57
|
-
}</style>
|
|
57
|
+
}</style>
|