@lavalogic/scoria 0.40.32 → 0.40.33
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 +28 -28
- package/dist/Components/AccordionGroupButton.svelte +60 -60
- package/dist/Components/Action.svelte +48 -48
- package/dist/Components/AlertModal.svelte +102 -102
- package/dist/Components/Base/ContextWrapper.svelte +45 -45
- package/dist/Components/Base/Pagination.svelte +135 -135
- package/dist/Components/Base/Snippets.svelte +25 -25
- package/dist/Components/BigRadioSet.svelte +34 -34
- package/dist/Components/Bubble.svelte +38 -38
- package/dist/Components/Button.svelte +83 -83
- package/dist/Components/Checkbox.svelte +71 -71
- package/dist/Components/CollapsibleCard.svelte +59 -59
- package/dist/Components/CollapsibleMenuGroup.svelte +43 -43
- package/dist/Components/ConditionBuilder/ConditionBuilder.svelte +101 -101
- package/dist/Components/Contexts/ContextMenu.svelte +76 -76
- package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
- package/dist/Components/Contexts/ContextMenuOption.svelte +38 -38
- package/dist/Components/Contexts/Toast.svelte +71 -71
- package/dist/Components/Contexts/ToastContainer.svelte +34 -34
- package/dist/Components/Contexts/Tooltip.svelte +32 -32
- package/dist/Components/DataMatrixIcon.svelte +37 -37
- package/dist/Components/DateInput.svelte +80 -80
- package/dist/Components/DatePicker.svelte +86 -86
- package/dist/Components/DesktopModal.svelte +65 -65
- package/dist/Components/Dial.svelte +35 -35
- package/dist/Components/DimensionInput.svelte +95 -95
- package/dist/Components/DragMenu/DragMenuHolder.svelte +53 -53
- package/dist/Components/DragMenu/DraggableCard.svelte +49 -49
- package/dist/Components/FileCard.svelte +18 -18
- package/dist/Components/FileUpload.svelte +115 -115
- package/dist/Components/GridInput.svelte +123 -123
- package/dist/Components/GridInputSet.svelte +21 -21
- package/dist/Components/HorizontalTabGroup.svelte +54 -54
- package/dist/Components/HorizontalTabGroupButton.svelte +32 -32
- package/dist/Components/Icon.svelte +68 -68
- package/dist/Components/InfoAlert.svelte +32 -32
- package/dist/Components/LoadingAnimation.svelte +228 -227
- package/dist/Components/LoadingModal.svelte +19 -19
- package/dist/Components/LoadingOverlay.svelte +20 -20
- package/dist/Components/Modal.svelte +127 -127
- package/dist/Components/MultiSelect.svelte +126 -126
- package/dist/Components/Nav/Nav.svelte +71 -71
- package/dist/Components/Nav/NavServiceMenuList.svelte +37 -37
- package/dist/Components/Nav/NavTab.svelte +46 -46
- package/dist/Components/Nav/ServiceMenuItem.svelte +62 -62
- package/dist/Components/Nav/ServicesNav.svelte +50 -50
- package/dist/Components/NumberInput.svelte +98 -98
- package/dist/Components/OptionCards.svelte +58 -58
- package/dist/Components/PageHeading.svelte +21 -21
- package/dist/Components/PasswordInput.svelte +61 -61
- package/dist/Components/PopoverButton.svelte +53 -53
- package/dist/Components/Portal.svelte +7 -7
- package/dist/Components/ProgressBubble.svelte +42 -42
- package/dist/Components/QuerySelect.svelte +102 -102
- package/dist/Components/ResourceCalendar/ResourceCalendar.svelte +241 -241
- package/dist/Components/SidebarPanel.svelte +32 -32
- package/dist/Components/SingleSelect.svelte +122 -122
- package/dist/Components/StepButton.svelte +48 -48
- package/dist/Components/StepForm.svelte +58 -58
- package/dist/Components/Switch.svelte +43 -43
- package/dist/Components/Table/ARCHITECTURE.md +298 -298
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +30 -30
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +24 -24
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +165 -165
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +13 -13
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +120 -120
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +81 -81
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +92 -92
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +110 -110
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +54 -54
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +35 -35
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +64 -64
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +82 -82
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +88 -88
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +90 -90
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +96 -96
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +71 -71
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +124 -124
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +91 -91
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +88 -88
- package/dist/Components/Table/Body/Rows/TableRow.svelte +127 -127
- package/dist/Components/Table/Body/TableBody.svelte +92 -92
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +25 -25
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +20 -20
- package/dist/Components/Table/Headers/TableHead.svelte +175 -175
- package/dist/Components/Table/Misc/ColumnPanel.svelte +32 -32
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +29 -29
- package/dist/Components/Table/Misc/FilterInput.svelte +326 -326
- package/dist/Components/Table/Misc/FilterPanel.svelte +79 -79
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +21 -21
- package/dist/Components/Table/Misc/ShareViewModal.svelte +118 -118
- package/dist/Components/Table/Misc/SidePanel.svelte +24 -24
- package/dist/Components/Table/Misc/TableConfigurationModal.svelte +318 -318
- package/dist/Components/Table/Misc/TableFooter.svelte +201 -201
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +112 -112
- package/dist/Components/Table/Misc/TableSidebar.svelte +116 -116
- package/dist/Components/Table/Misc/TableViewDropdown.svelte +25 -25
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +60 -60
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +63 -63
- package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +101 -101
- package/dist/Components/Table/NestedTable.svelte +29 -29
- package/dist/Components/Table/Table.svelte +140 -140
- package/dist/Components/Test/TestContextConsumer.svelte +8 -8
- package/dist/Components/TextArea.svelte +92 -90
- package/dist/Components/TextInput.svelte +128 -117
- package/dist/Components/ThreeStateRadio.svelte +101 -101
- package/dist/Components/Touch/BoolCard.svelte +27 -27
- package/dist/Components/Touch/DateModal.svelte +98 -98
- package/dist/Components/Touch/EditCard.svelte +44 -44
- package/dist/Components/Touch/InfoCard.svelte +25 -25
- package/dist/Components/Touch/InfoTextCard.svelte +22 -22
- package/dist/Components/Touch/ModalExplanation.svelte +13 -13
- package/dist/Components/Touch/NumberKeyboard.svelte +81 -81
- package/dist/Components/Touch/NumberModal.svelte +49 -49
- package/dist/Components/Touch/PlusMinusCard.svelte +40 -40
- package/dist/Components/Touch/SelectModal.svelte +86 -86
- package/dist/Components/Touch/SummaryCard.svelte +74 -74
- package/dist/Components/Touch/TextAreaModal.svelte +53 -53
- package/dist/Components/Touch/TextModal.svelte +56 -56
- package/dist/Components/Touch/TouchCard.svelte +28 -28
- package/dist/Components/Touch/TouchModal.svelte +141 -141
- package/dist/Components/Touch/UtilityButton.svelte +63 -63
- package/dist/Components/VerticalTabGroup.svelte +38 -38
- package/dist/Components/VerticalTabGroupButton.svelte +46 -46
- package/dist/Helpers/Datamatrix.d.ts +19 -19
- package/dist/Helpers/Datamatrix.js +291 -291
- package/dist/Types/Examples/ExampleModal.svelte +27 -27
- package/dist/paraglide/README.md +1 -1
- package/dist/scss/_basics.scss +12 -12
- package/dist/scss/_colours.scss +140 -140
- 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,8 +1,8 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
generics="T extends object, FilterValueType, RowIdType extends Primitive"
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object, FilterValueType, RowIdType extends Primitive"
|
|
6
6
|
>import { TableContext } from "../../../Types/Context/TableContext.svelte.js";
|
|
7
7
|
import "../../../Types/Context/TableInitOptions.js";
|
|
8
8
|
import { devCatch, formatDateTime, isValidityTuple, loadingText } from "../../../../../Helpers/Helpers.svelte.js";
|
|
@@ -86,110 +86,110 @@ $effect(() => {
|
|
|
86
86
|
}
|
|
87
87
|
}).catch(devCatch);
|
|
88
88
|
});
|
|
89
|
-
</script>
|
|
90
|
-
|
|
91
|
-
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
92
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
93
|
-
<div
|
|
94
|
-
id={thisId}
|
|
95
|
-
class:info={validity == Validity.Info}
|
|
96
|
-
class:success={validity == Validity.Valid}
|
|
97
|
-
class:warning={validity == Validity.Warning}
|
|
98
|
-
class:error={validity == Validity.Invalid}
|
|
99
|
-
class:has-modal={!!modalComponent}
|
|
100
|
-
tabIndex={hasValue ? 0 : undefined}
|
|
101
|
-
class="focusable"
|
|
102
|
-
title={dateTooltip}
|
|
103
|
-
style={focusDetails.outline}
|
|
104
|
-
class:multifocus={hasValue && focusDetails.isMultiFocused}
|
|
105
|
-
class:multifocus-start={hasValue && focusDetails.isMultiFocusStart}
|
|
106
|
-
onmousedown={(e) => {
|
|
107
|
-
// start focus only on left click
|
|
108
|
-
if (e.button === 0) {
|
|
109
|
-
if (e.shiftKey) {
|
|
110
|
-
e.preventDefault();
|
|
111
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
112
|
-
} else {
|
|
113
|
-
tableContext.startFocus(focusDetails.coordinates);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
}}
|
|
117
|
-
onmouseover={() => {
|
|
118
|
-
if (tableContext.isMousingDown) {
|
|
119
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
120
|
-
}
|
|
121
|
-
}}
|
|
122
|
-
onmouseup={() => {
|
|
123
|
-
tableContext.endFocus(focusDetails.coordinates);
|
|
124
|
-
}}
|
|
125
|
-
onclick={() => {
|
|
126
|
-
// Open the per-cell modal if the column declares one. Click is
|
|
127
|
-
// the right trigger here (focus already started on mousedown);
|
|
128
|
-
// modal-less display cells fall through to the default focus
|
|
129
|
-
// behaviour with no extra handler.
|
|
130
|
-
if (modalComponent) {
|
|
131
|
-
tableContext.setOpenModalCell({
|
|
132
|
-
row: cell.row.original,
|
|
133
|
-
columnId: cell.column.id,
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}}
|
|
137
|
-
onkeydown={(e) => {
|
|
138
|
-
// Keyboard parity with `onclick` above: when the cell has DOM
|
|
139
|
-
// focus (via `tabIndex`), Enter / Space opens the modal. Only
|
|
140
|
-
// fires for columns that declare a `modal`; non-modal display
|
|
141
|
-
// cells defer to the table's global keyboard navigation.
|
|
142
|
-
if (modalComponent && (e.key === 'Enter' || e.key === ' ')) {
|
|
143
|
-
e.preventDefault();
|
|
144
|
-
tableContext.setOpenModalCell({
|
|
145
|
-
row: cell.row.original,
|
|
146
|
-
columnId: cell.column.id,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
}}
|
|
150
|
-
>
|
|
151
|
-
{#if hasValue}
|
|
152
|
-
{#await visibleValue}
|
|
153
|
-
{loadingText()}
|
|
154
|
-
{:then v}
|
|
155
|
-
{(v instanceof Date
|
|
156
|
-
? v.toLocaleDateString()
|
|
157
|
-
: options.length
|
|
158
|
-
? options.find((it) => it.value === v)?.label
|
|
159
|
-
: v) ??
|
|
160
|
-
v ??
|
|
161
|
-
''}
|
|
162
|
-
{/await}
|
|
163
|
-
{:else if children}
|
|
164
|
-
<div
|
|
165
|
-
class="slot-wrapper"
|
|
166
|
-
class:multifocus={focusDetails.isMultiFocused}
|
|
167
|
-
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
168
|
-
>
|
|
169
|
-
{@render children()}
|
|
170
|
-
</div>
|
|
171
|
-
{/if}
|
|
172
|
-
</div>
|
|
173
|
-
{#if showModal && modalComponent}
|
|
174
|
-
<!--
|
|
175
|
-
The component receives the public `DisplayModalProps<T>` shape
|
|
176
|
-
`{ row, close }`. The dialog is NOT wrapped in
|
|
177
|
-
`<Portal target={document.body}>` any more. `<dialog>` opened
|
|
178
|
-
via `showModal()` enters the browser's top layer, so it already
|
|
179
|
-
escapes overflow:hidden / sticky / transform ancestors without
|
|
180
|
-
needing to be re-parented. Moving the `<div>` ancestor mid-mount
|
|
181
|
-
(Portal's $effect runs during the same microtask round as
|
|
182
|
-
BaseModal's `tick().then` `dialog.showModal()`) was popping the
|
|
183
|
-
dialog out of the top layer and leaving it to render inline at
|
|
184
|
-
the bottom of the page.
|
|
185
|
-
-->
|
|
186
|
-
{@const ModalComponent = modalComponent}
|
|
187
|
-
<ModalComponent
|
|
188
|
-
row={cell.row.original}
|
|
189
|
-
close={onclose}
|
|
190
|
-
/>
|
|
191
|
-
{/if}
|
|
192
|
-
|
|
89
|
+
</script>
|
|
90
|
+
|
|
91
|
+
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
92
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
93
|
+
<div
|
|
94
|
+
id={thisId}
|
|
95
|
+
class:info={validity == Validity.Info}
|
|
96
|
+
class:success={validity == Validity.Valid}
|
|
97
|
+
class:warning={validity == Validity.Warning}
|
|
98
|
+
class:error={validity == Validity.Invalid}
|
|
99
|
+
class:has-modal={!!modalComponent}
|
|
100
|
+
tabIndex={hasValue ? 0 : undefined}
|
|
101
|
+
class="focusable"
|
|
102
|
+
title={dateTooltip}
|
|
103
|
+
style={focusDetails.outline}
|
|
104
|
+
class:multifocus={hasValue && focusDetails.isMultiFocused}
|
|
105
|
+
class:multifocus-start={hasValue && focusDetails.isMultiFocusStart}
|
|
106
|
+
onmousedown={(e) => {
|
|
107
|
+
// start focus only on left click
|
|
108
|
+
if (e.button === 0) {
|
|
109
|
+
if (e.shiftKey) {
|
|
110
|
+
e.preventDefault();
|
|
111
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
112
|
+
} else {
|
|
113
|
+
tableContext.startFocus(focusDetails.coordinates);
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
}}
|
|
117
|
+
onmouseover={() => {
|
|
118
|
+
if (tableContext.isMousingDown) {
|
|
119
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
120
|
+
}
|
|
121
|
+
}}
|
|
122
|
+
onmouseup={() => {
|
|
123
|
+
tableContext.endFocus(focusDetails.coordinates);
|
|
124
|
+
}}
|
|
125
|
+
onclick={() => {
|
|
126
|
+
// Open the per-cell modal if the column declares one. Click is
|
|
127
|
+
// the right trigger here (focus already started on mousedown);
|
|
128
|
+
// modal-less display cells fall through to the default focus
|
|
129
|
+
// behaviour with no extra handler.
|
|
130
|
+
if (modalComponent) {
|
|
131
|
+
tableContext.setOpenModalCell({
|
|
132
|
+
row: cell.row.original,
|
|
133
|
+
columnId: cell.column.id,
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
}}
|
|
137
|
+
onkeydown={(e) => {
|
|
138
|
+
// Keyboard parity with `onclick` above: when the cell has DOM
|
|
139
|
+
// focus (via `tabIndex`), Enter / Space opens the modal. Only
|
|
140
|
+
// fires for columns that declare a `modal`; non-modal display
|
|
141
|
+
// cells defer to the table's global keyboard navigation.
|
|
142
|
+
if (modalComponent && (e.key === 'Enter' || e.key === ' ')) {
|
|
143
|
+
e.preventDefault();
|
|
144
|
+
tableContext.setOpenModalCell({
|
|
145
|
+
row: cell.row.original,
|
|
146
|
+
columnId: cell.column.id,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
}}
|
|
150
|
+
>
|
|
151
|
+
{#if hasValue}
|
|
152
|
+
{#await visibleValue}
|
|
153
|
+
{loadingText()}
|
|
154
|
+
{:then v}
|
|
155
|
+
{(v instanceof Date
|
|
156
|
+
? v.toLocaleDateString()
|
|
157
|
+
: options.length
|
|
158
|
+
? options.find((it) => it.value === v)?.label
|
|
159
|
+
: v) ??
|
|
160
|
+
v ??
|
|
161
|
+
''}
|
|
162
|
+
{/await}
|
|
163
|
+
{:else if children}
|
|
164
|
+
<div
|
|
165
|
+
class="slot-wrapper"
|
|
166
|
+
class:multifocus={focusDetails.isMultiFocused}
|
|
167
|
+
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
168
|
+
>
|
|
169
|
+
{@render children()}
|
|
170
|
+
</div>
|
|
171
|
+
{/if}
|
|
172
|
+
</div>
|
|
173
|
+
{#if showModal && modalComponent}
|
|
174
|
+
<!--
|
|
175
|
+
The component receives the public `DisplayModalProps<T>` shape
|
|
176
|
+
`{ row, close }`. The dialog is NOT wrapped in
|
|
177
|
+
`<Portal target={document.body}>` any more. `<dialog>` opened
|
|
178
|
+
via `showModal()` enters the browser's top layer, so it already
|
|
179
|
+
escapes overflow:hidden / sticky / transform ancestors without
|
|
180
|
+
needing to be re-parented. Moving the `<div>` ancestor mid-mount
|
|
181
|
+
(Portal's $effect runs during the same microtask round as
|
|
182
|
+
BaseModal's `tick().then` `dialog.showModal()`) was popping the
|
|
183
|
+
dialog out of the top layer and leaving it to render inline at
|
|
184
|
+
the bottom of the page.
|
|
185
|
+
-->
|
|
186
|
+
{@const ModalComponent = modalComponent}
|
|
187
|
+
<ModalComponent
|
|
188
|
+
row={cell.row.original}
|
|
189
|
+
close={onclose}
|
|
190
|
+
/>
|
|
191
|
+
{/if}
|
|
192
|
+
|
|
193
193
|
<style>.focusable,
|
|
194
194
|
.checkbox-cell,
|
|
195
195
|
.input-cell,
|
|
@@ -279,4 +279,4 @@ div.slot-wrapper {
|
|
|
279
279
|
.input-cell.error,
|
|
280
280
|
.select-cell.error {
|
|
281
281
|
background-color: #f9e9e9;
|
|
282
|
-
}</style>
|
|
282
|
+
}</style>
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
module
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
module
|
|
6
6
|
>import ProgressBubble from "../../../../ProgressBubble.svelte";
|
|
7
7
|
import { TableContext } from "../../../Types/Context/TableContext.svelte.js";
|
|
8
8
|
import "../../../Types/Context/TableInitOptions.js";
|
|
9
9
|
import { devCatch, isValidityTuple } from "../../../../../Helpers/Helpers.svelte.js";
|
|
10
10
|
import { Validity } from "../../../../../Types/Internal/Validity.js";
|
|
11
11
|
import { getContext } from "svelte";
|
|
12
|
-
</script>
|
|
13
|
-
|
|
14
|
-
<script
|
|
15
|
-
lang="ts"
|
|
16
|
-
generics="T extends object, FilterValueType, RowIdType extends Primitive"
|
|
12
|
+
</script>
|
|
13
|
+
|
|
14
|
+
<script
|
|
15
|
+
lang="ts"
|
|
16
|
+
generics="T extends object, FilterValueType, RowIdType extends Primitive"
|
|
17
17
|
>const { cell } = $props();
|
|
18
18
|
/**
|
|
19
19
|
* Tuple of `[done, total]`. The cast is unavoidable until `ProgressBarDef`
|
|
@@ -37,49 +37,49 @@ $effect(() => {
|
|
|
37
37
|
}).catch(devCatch);
|
|
38
38
|
});
|
|
39
39
|
const colours = $derived(cell.column.columnDef.getColour(cell.row.original, cell.row.originalIndex, value));
|
|
40
|
-
</script>
|
|
41
|
-
|
|
42
|
-
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
43
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
44
|
-
<div
|
|
45
|
-
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
46
|
-
tabIndex={0}
|
|
47
|
-
class="focusable"
|
|
48
|
-
class:multifocus={focusDetails.isMultiFocused}
|
|
49
|
-
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
50
|
-
style={focusDetails.outline}
|
|
51
|
-
class:info={validity == Validity.Info}
|
|
52
|
-
class:success={validity == Validity.Valid}
|
|
53
|
-
class:warning={validity == Validity.Warning}
|
|
54
|
-
class:error={validity == Validity.Invalid}
|
|
55
|
-
onmousedown={(e) => {
|
|
56
|
-
// start focus only on left click
|
|
57
|
-
if (e.button === 0) {
|
|
58
|
-
if (e.shiftKey) {
|
|
59
|
-
e.preventDefault();
|
|
60
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
61
|
-
} else {
|
|
62
|
-
tableContext.startFocus(focusDetails.coordinates);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
}}
|
|
66
|
-
onmouseover={() => {
|
|
67
|
-
if (tableContext.isMousingDown) {
|
|
68
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
69
|
-
}
|
|
70
|
-
}}
|
|
71
|
-
onmouseup={() => {
|
|
72
|
-
tableContext.endFocus(focusDetails.coordinates);
|
|
73
|
-
}}
|
|
74
|
-
>
|
|
75
|
-
<div class="bubble-parent">
|
|
76
|
-
<ProgressBubble
|
|
77
|
-
{value}
|
|
78
|
-
{colours}
|
|
79
|
-
/>
|
|
80
|
-
</div>
|
|
81
|
-
</div>
|
|
82
|
-
|
|
40
|
+
</script>
|
|
41
|
+
|
|
42
|
+
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
43
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
44
|
+
<div
|
|
45
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
46
|
+
tabIndex={0}
|
|
47
|
+
class="focusable"
|
|
48
|
+
class:multifocus={focusDetails.isMultiFocused}
|
|
49
|
+
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
50
|
+
style={focusDetails.outline}
|
|
51
|
+
class:info={validity == Validity.Info}
|
|
52
|
+
class:success={validity == Validity.Valid}
|
|
53
|
+
class:warning={validity == Validity.Warning}
|
|
54
|
+
class:error={validity == Validity.Invalid}
|
|
55
|
+
onmousedown={(e) => {
|
|
56
|
+
// start focus only on left click
|
|
57
|
+
if (e.button === 0) {
|
|
58
|
+
if (e.shiftKey) {
|
|
59
|
+
e.preventDefault();
|
|
60
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
61
|
+
} else {
|
|
62
|
+
tableContext.startFocus(focusDetails.coordinates);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}}
|
|
66
|
+
onmouseover={() => {
|
|
67
|
+
if (tableContext.isMousingDown) {
|
|
68
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
69
|
+
}
|
|
70
|
+
}}
|
|
71
|
+
onmouseup={() => {
|
|
72
|
+
tableContext.endFocus(focusDetails.coordinates);
|
|
73
|
+
}}
|
|
74
|
+
>
|
|
75
|
+
<div class="bubble-parent">
|
|
76
|
+
<ProgressBubble
|
|
77
|
+
{value}
|
|
78
|
+
{colours}
|
|
79
|
+
/>
|
|
80
|
+
</div>
|
|
81
|
+
</div>
|
|
82
|
+
|
|
83
83
|
<style>.focusable,
|
|
84
84
|
.checkbox-cell,
|
|
85
85
|
.input-cell,
|
|
@@ -166,4 +166,4 @@ div.bubble-parent {
|
|
|
166
166
|
align-items: center;
|
|
167
167
|
gap: 0.75rem;
|
|
168
168
|
--line-height: 1;
|
|
169
|
-
}</style>
|
|
169
|
+
}</style>
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
module
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
module
|
|
6
6
|
>import { m as i18n } from "../../../../../paraglide/messages.js";
|
|
7
7
|
import Button from "../../../../Button.svelte";
|
|
8
8
|
import { getErrorMessage } from "../../../../../Helpers/Helpers.svelte.js";
|
|
9
9
|
import { ColourSet } from "../../../../../scss/colours.js";
|
|
10
10
|
import { Size } from "../../../../../Types/Internal/Size.js";
|
|
11
|
-
</script>
|
|
12
|
-
|
|
13
|
-
<script
|
|
14
|
-
lang="ts"
|
|
15
|
-
generics="T extends object, FilterValueType"
|
|
11
|
+
</script>
|
|
12
|
+
|
|
13
|
+
<script
|
|
14
|
+
lang="ts"
|
|
15
|
+
generics="T extends object, FilterValueType"
|
|
16
16
|
>import { dev } from "$app/environment";
|
|
17
17
|
const { action, cell } = $props();
|
|
18
18
|
/**
|
|
@@ -26,28 +26,28 @@ const buttonStatePromise = $derived.by(() => {
|
|
|
26
26
|
const labelPromise = Promise.resolve(action.getLabel(cell.row.original, cell.row.originalIndex));
|
|
27
27
|
return Promise.all([labelPromise, isEnabledPromise]);
|
|
28
28
|
});
|
|
29
|
-
</script>
|
|
30
|
-
|
|
31
|
-
{#await buttonStatePromise}
|
|
32
|
-
<!-- intentionally empty: the actions popover frame already conveys the loading state -->
|
|
33
|
-
{:then [label, isEnabled]}
|
|
34
|
-
<Button
|
|
35
|
-
fullWidth
|
|
36
|
-
size={Size.Medium}
|
|
37
|
-
colourSet={cell.column.columnDef.getColourSet?.(
|
|
38
|
-
cell.row.original,
|
|
39
|
-
cell.row.originalIndex,
|
|
40
|
-
action
|
|
41
|
-
) ?? ColourSet.Secondary}
|
|
42
|
-
disabled={!isEnabled}
|
|
43
|
-
onclick={() => {
|
|
44
|
-
action.callback(cell.row.original, cell.row.originalIndex);
|
|
45
|
-
}}>{label}</Button
|
|
46
|
-
>
|
|
47
|
-
{:catch e}
|
|
48
|
-
{#if dev}
|
|
49
|
-
Error Loading Button: {getErrorMessage(e)}
|
|
50
|
-
{:else}
|
|
51
|
-
{i18n['scoria.text.error_loading_button']()}
|
|
52
|
-
{/if}
|
|
53
|
-
{/await}
|
|
29
|
+
</script>
|
|
30
|
+
|
|
31
|
+
{#await buttonStatePromise}
|
|
32
|
+
<!-- intentionally empty: the actions popover frame already conveys the loading state -->
|
|
33
|
+
{:then [label, isEnabled]}
|
|
34
|
+
<Button
|
|
35
|
+
fullWidth
|
|
36
|
+
size={Size.Medium}
|
|
37
|
+
colourSet={cell.column.columnDef.getColourSet?.(
|
|
38
|
+
cell.row.original,
|
|
39
|
+
cell.row.originalIndex,
|
|
40
|
+
action
|
|
41
|
+
) ?? ColourSet.Secondary}
|
|
42
|
+
disabled={!isEnabled}
|
|
43
|
+
onclick={() => {
|
|
44
|
+
action.callback(cell.row.original, cell.row.originalIndex);
|
|
45
|
+
}}>{label}</Button
|
|
46
|
+
>
|
|
47
|
+
{:catch e}
|
|
48
|
+
{#if dev}
|
|
49
|
+
Error Loading Button: {getErrorMessage(e)}
|
|
50
|
+
{:else}
|
|
51
|
+
{i18n['scoria.text.error_loading_button']()}
|
|
52
|
+
{/if}
|
|
53
|
+
{/await}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
generics="T extends object, RowIdType extends Primitive"
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object, RowIdType extends Primitive"
|
|
6
6
|
>import { TableContext } from "../../../Types/Context/TableContext.svelte.js";
|
|
7
7
|
import "../../../Types/Context/TableInitOptions.js";
|
|
8
8
|
import { devCatch, isValidityTuple } from "../../../../../Helpers/Helpers.svelte.js";
|
|
@@ -66,64 +66,64 @@ $effect(() => {
|
|
|
66
66
|
}
|
|
67
67
|
}).catch(devCatch);
|
|
68
68
|
});
|
|
69
|
-
</script>
|
|
70
|
-
|
|
71
|
-
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
72
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
73
|
-
<div
|
|
74
|
-
class="checkbox-cell"
|
|
75
|
-
onmousedown={(e) => {
|
|
76
|
-
// start focus only on left click
|
|
77
|
-
if (e.button === 0) {
|
|
78
|
-
if (e.shiftKey) {
|
|
79
|
-
e.preventDefault();
|
|
80
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
81
|
-
} else {
|
|
82
|
-
tableContext.startFocus(focusDetails.coordinates);
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
}}
|
|
86
|
-
onkeyup={(e: KeyboardEvent) => {
|
|
87
|
-
if (e.key === 'Enter' && editable) {
|
|
88
|
-
e.stopPropagation();
|
|
89
|
-
tableContext.onEditCell(cell.row.original, focusDetails.coordinates, !value).catch(devCatch);
|
|
90
|
-
}
|
|
91
|
-
}}
|
|
92
|
-
onkeydown={(e: KeyboardEvent) => {
|
|
93
|
-
if (e.key == 'Enter' || e.key == 'F2') {
|
|
94
|
-
e.stopPropagation();
|
|
95
|
-
}
|
|
96
|
-
}}
|
|
97
|
-
onmouseover={() => {
|
|
98
|
-
if (tableContext.isMousingDown) {
|
|
99
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
100
|
-
}
|
|
101
|
-
}}
|
|
102
|
-
onmouseup={() => {
|
|
103
|
-
tableContext.endFocus(focusDetails.coordinates);
|
|
104
|
-
}}
|
|
105
|
-
class:info={validity == Validity.Info}
|
|
106
|
-
class:success={validity == Validity.Valid}
|
|
107
|
-
class:warning={validity == Validity.Warning}
|
|
108
|
-
class:error={validity == Validity.Invalid}
|
|
109
|
-
>
|
|
110
|
-
|
|
111
|
-
<label
|
|
112
|
-
class:multifocus={focusDetails.isMultiFocused}
|
|
113
|
-
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
114
|
-
style={focusDetails.outline}
|
|
115
|
-
>
|
|
116
|
-
<input
|
|
117
|
-
bind:this={inputRef}
|
|
118
|
-
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
119
|
-
{onchange}
|
|
120
|
-
type="checkbox"
|
|
121
|
-
checked={value}
|
|
122
|
-
disabled={!editable}
|
|
123
|
-
/>
|
|
124
|
-
</label>
|
|
125
|
-
</div>
|
|
126
|
-
|
|
69
|
+
</script>
|
|
70
|
+
|
|
71
|
+
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
72
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
73
|
+
<div
|
|
74
|
+
class="checkbox-cell"
|
|
75
|
+
onmousedown={(e) => {
|
|
76
|
+
// start focus only on left click
|
|
77
|
+
if (e.button === 0) {
|
|
78
|
+
if (e.shiftKey) {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
81
|
+
} else {
|
|
82
|
+
tableContext.startFocus(focusDetails.coordinates);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}}
|
|
86
|
+
onkeyup={(e: KeyboardEvent) => {
|
|
87
|
+
if (e.key === 'Enter' && editable) {
|
|
88
|
+
e.stopPropagation();
|
|
89
|
+
tableContext.onEditCell(cell.row.original, focusDetails.coordinates, !value).catch(devCatch);
|
|
90
|
+
}
|
|
91
|
+
}}
|
|
92
|
+
onkeydown={(e: KeyboardEvent) => {
|
|
93
|
+
if (e.key == 'Enter' || e.key == 'F2') {
|
|
94
|
+
e.stopPropagation();
|
|
95
|
+
}
|
|
96
|
+
}}
|
|
97
|
+
onmouseover={() => {
|
|
98
|
+
if (tableContext.isMousingDown) {
|
|
99
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
100
|
+
}
|
|
101
|
+
}}
|
|
102
|
+
onmouseup={() => {
|
|
103
|
+
tableContext.endFocus(focusDetails.coordinates);
|
|
104
|
+
}}
|
|
105
|
+
class:info={validity == Validity.Info}
|
|
106
|
+
class:success={validity == Validity.Valid}
|
|
107
|
+
class:warning={validity == Validity.Warning}
|
|
108
|
+
class:error={validity == Validity.Invalid}
|
|
109
|
+
>
|
|
110
|
+
|
|
111
|
+
<label
|
|
112
|
+
class:multifocus={focusDetails.isMultiFocused}
|
|
113
|
+
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
114
|
+
style={focusDetails.outline}
|
|
115
|
+
>
|
|
116
|
+
<input
|
|
117
|
+
bind:this={inputRef}
|
|
118
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
119
|
+
{onchange}
|
|
120
|
+
type="checkbox"
|
|
121
|
+
checked={value}
|
|
122
|
+
disabled={!editable}
|
|
123
|
+
/>
|
|
124
|
+
</label>
|
|
125
|
+
</div>
|
|
126
|
+
|
|
127
127
|
<style>.focusable,
|
|
128
128
|
.checkbox-cell,
|
|
129
129
|
.input-cell,
|
|
@@ -204,4 +204,4 @@ label.multifocus.multifocus-start {
|
|
|
204
204
|
input:disabled {
|
|
205
205
|
cursor: not-allowed;
|
|
206
206
|
opacity: 0.45;
|
|
207
|
-
}</style>
|
|
207
|
+
}</style>
|