@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
|
-
module
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
module
|
|
6
6
|
>import Action from "../../../../Action.svelte";
|
|
7
7
|
import Portal from "../../../../Portal.svelte";
|
|
8
8
|
import { TableContext } from "../../../Types/Context/TableContext.svelte.js";
|
|
@@ -13,11 +13,11 @@ import { Size } from "../../../../../Types/Internal/Size.js";
|
|
|
13
13
|
import { Validity } from "../../../../../Types/Internal/Validity.js";
|
|
14
14
|
import { getContext, untrack } from "svelte";
|
|
15
15
|
import TableAction from "./TableAction.svelte";
|
|
16
|
-
</script>
|
|
17
|
-
|
|
18
|
-
<script
|
|
19
|
-
lang="ts"
|
|
20
|
-
generics="T extends object, FilterValueType, RowIdType extends Primitive"
|
|
16
|
+
</script>
|
|
17
|
+
|
|
18
|
+
<script
|
|
19
|
+
lang="ts"
|
|
20
|
+
generics="T extends object, FilterValueType, RowIdType extends Primitive"
|
|
21
21
|
>const { cell } = $props();
|
|
22
22
|
const value = $derived(cell.getValue());
|
|
23
23
|
const tableContext = getContext(TableContext.identifier);
|
|
@@ -54,115 +54,115 @@ $effect(() => {
|
|
|
54
54
|
}
|
|
55
55
|
}).catch(devCatch);
|
|
56
56
|
});
|
|
57
|
-
</script>
|
|
58
|
-
|
|
59
|
-
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
60
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
61
|
-
<div
|
|
62
|
-
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
63
|
-
tabIndex={hasValue ? 0 : undefined}
|
|
64
|
-
class="focusable"
|
|
65
|
-
class:multifocus={hasValue && focusDetails.isMultiFocused}
|
|
66
|
-
class:multifocus-start={hasValue && focusDetails.isMultiFocusStart}
|
|
67
|
-
class:left={edge === MultiFocusEdge.Left}
|
|
68
|
-
class:top-left={edge === MultiFocusEdge.TopLeft}
|
|
69
|
-
class:top={edge === MultiFocusEdge.Top}
|
|
70
|
-
class:top-right={edge === MultiFocusEdge.TopRight}
|
|
71
|
-
class:right={edge === MultiFocusEdge.Right}
|
|
72
|
-
class:bottom-right={edge === MultiFocusEdge.BottomRight}
|
|
73
|
-
class:bottom={edge === MultiFocusEdge.Bottom}
|
|
74
|
-
class:bottom-left={edge === MultiFocusEdge.BottomLeft}
|
|
75
|
-
class:info={validity == Validity.Info}
|
|
76
|
-
class:success={validity == Validity.Valid}
|
|
77
|
-
class:warning={validity == Validity.Warning}
|
|
78
|
-
class:error={validity == Validity.Invalid}
|
|
79
|
-
onmousedown={(e) => {
|
|
80
|
-
// start focus only on left click
|
|
81
|
-
if (e.button === 0) {
|
|
82
|
-
if (e.shiftKey) {
|
|
83
|
-
e.preventDefault();
|
|
84
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
85
|
-
} else {
|
|
86
|
-
tableContext.startFocus(focusDetails.coordinates);
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}}
|
|
90
|
-
onmouseover={() => {
|
|
91
|
-
if (tableContext.isMousingDown) {
|
|
92
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
93
|
-
}
|
|
94
|
-
}}
|
|
95
|
-
onmouseup={() => {
|
|
96
|
-
tableContext.endFocus(focusDetails.coordinates);
|
|
97
|
-
}}
|
|
98
|
-
>
|
|
99
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
100
|
-
<div
|
|
101
|
-
class="slot-wrapper"
|
|
102
|
-
class:multifocus={focusDetails.isMultiFocused}
|
|
103
|
-
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
104
|
-
bind:this={cellRef}
|
|
105
|
-
onmousedown={(e) => {
|
|
106
|
-
// Suppress click side effects that jump the table horizontally
|
|
107
|
-
// on Action clicks:
|
|
108
|
-
// 1. `preventDefault()` cancels the default mousedown ->
|
|
109
|
-
// focus on the inner `<button>`, which would otherwise
|
|
110
|
-
// call `scrollIntoView` against the button's position
|
|
111
|
-
// at the far right (the Actions column is sticky-pinned
|
|
112
|
-
// right).
|
|
113
|
-
// 2. `stopPropagation()` keeps the event out of the outer
|
|
114
|
-
// `.focusable` cell handler, which would otherwise call
|
|
115
|
-
// `tableContext.startFocus(...)` and trigger another
|
|
116
|
-
// `scrollIntoView` via Table.svelte's focusStart effect.
|
|
117
|
-
// The Action's `onclick` still fires (click is dispatched on
|
|
118
|
-
// mouseup independent of mousedown), so the popup toggle works.
|
|
119
|
-
e.preventDefault();
|
|
120
|
-
e.stopPropagation();
|
|
121
|
-
}}
|
|
122
|
-
>
|
|
123
|
-
<!-- TODO {isMultiFocusStart} -->
|
|
124
|
-
<Action
|
|
125
|
-
style={focusDetails.outline}
|
|
126
|
-
border={false}
|
|
127
|
-
size={Size.FillWidth}
|
|
128
|
-
icon={{ name: 'ellipsis', size: Size.Medium, colour: Colour['$brand-primary'] }}
|
|
129
|
-
colourSet={ColourSet.Auxiliary}
|
|
130
|
-
onclick={() => {
|
|
131
|
-
if (tableContext.shownActionsPopup === thisPopup) {
|
|
132
|
-
tableContext.shownActionsPopup = undefined;
|
|
133
|
-
} else {
|
|
134
|
-
tableContext.shownActionsPopup = thisPopup;
|
|
135
|
-
}
|
|
136
|
-
}}
|
|
137
|
-
/>
|
|
138
|
-
</div>
|
|
139
|
-
{#if thisPopupIsVisibile}
|
|
140
|
-
{@const awaitedActions = asyncMap<TableActionButton<T>, [TableActionButton<T>, string]>(
|
|
141
|
-
actions,
|
|
142
|
-
async (item) => {
|
|
143
|
-
return [item, await item.getLabel(cell.row.original, cell.row.visibleIndex)];
|
|
144
|
-
}
|
|
145
|
-
)}
|
|
146
|
-
{#await awaitedActions then actions}
|
|
147
|
-
<Portal>
|
|
148
|
-
<div
|
|
149
|
-
class="popup"
|
|
150
|
-
style="--y: {y}px; --x: {x}px;"
|
|
151
|
-
>
|
|
152
|
-
<div class="action-container">
|
|
153
|
-
{#each actions as [action, label] (label)}
|
|
154
|
-
<TableAction
|
|
155
|
-
{action}
|
|
156
|
-
{cell}
|
|
157
|
-
/>
|
|
158
|
-
{/each}
|
|
159
|
-
</div>
|
|
160
|
-
</div>
|
|
161
|
-
</Portal>
|
|
162
|
-
{/await}
|
|
163
|
-
{/if}
|
|
164
|
-
</div>
|
|
165
|
-
|
|
57
|
+
</script>
|
|
58
|
+
|
|
59
|
+
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
60
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
61
|
+
<div
|
|
62
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
63
|
+
tabIndex={hasValue ? 0 : undefined}
|
|
64
|
+
class="focusable"
|
|
65
|
+
class:multifocus={hasValue && focusDetails.isMultiFocused}
|
|
66
|
+
class:multifocus-start={hasValue && focusDetails.isMultiFocusStart}
|
|
67
|
+
class:left={edge === MultiFocusEdge.Left}
|
|
68
|
+
class:top-left={edge === MultiFocusEdge.TopLeft}
|
|
69
|
+
class:top={edge === MultiFocusEdge.Top}
|
|
70
|
+
class:top-right={edge === MultiFocusEdge.TopRight}
|
|
71
|
+
class:right={edge === MultiFocusEdge.Right}
|
|
72
|
+
class:bottom-right={edge === MultiFocusEdge.BottomRight}
|
|
73
|
+
class:bottom={edge === MultiFocusEdge.Bottom}
|
|
74
|
+
class:bottom-left={edge === MultiFocusEdge.BottomLeft}
|
|
75
|
+
class:info={validity == Validity.Info}
|
|
76
|
+
class:success={validity == Validity.Valid}
|
|
77
|
+
class:warning={validity == Validity.Warning}
|
|
78
|
+
class:error={validity == Validity.Invalid}
|
|
79
|
+
onmousedown={(e) => {
|
|
80
|
+
// start focus only on left click
|
|
81
|
+
if (e.button === 0) {
|
|
82
|
+
if (e.shiftKey) {
|
|
83
|
+
e.preventDefault();
|
|
84
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
85
|
+
} else {
|
|
86
|
+
tableContext.startFocus(focusDetails.coordinates);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}}
|
|
90
|
+
onmouseover={() => {
|
|
91
|
+
if (tableContext.isMousingDown) {
|
|
92
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
93
|
+
}
|
|
94
|
+
}}
|
|
95
|
+
onmouseup={() => {
|
|
96
|
+
tableContext.endFocus(focusDetails.coordinates);
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
100
|
+
<div
|
|
101
|
+
class="slot-wrapper"
|
|
102
|
+
class:multifocus={focusDetails.isMultiFocused}
|
|
103
|
+
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
104
|
+
bind:this={cellRef}
|
|
105
|
+
onmousedown={(e) => {
|
|
106
|
+
// Suppress click side effects that jump the table horizontally
|
|
107
|
+
// on Action clicks:
|
|
108
|
+
// 1. `preventDefault()` cancels the default mousedown ->
|
|
109
|
+
// focus on the inner `<button>`, which would otherwise
|
|
110
|
+
// call `scrollIntoView` against the button's position
|
|
111
|
+
// at the far right (the Actions column is sticky-pinned
|
|
112
|
+
// right).
|
|
113
|
+
// 2. `stopPropagation()` keeps the event out of the outer
|
|
114
|
+
// `.focusable` cell handler, which would otherwise call
|
|
115
|
+
// `tableContext.startFocus(...)` and trigger another
|
|
116
|
+
// `scrollIntoView` via Table.svelte's focusStart effect.
|
|
117
|
+
// The Action's `onclick` still fires (click is dispatched on
|
|
118
|
+
// mouseup independent of mousedown), so the popup toggle works.
|
|
119
|
+
e.preventDefault();
|
|
120
|
+
e.stopPropagation();
|
|
121
|
+
}}
|
|
122
|
+
>
|
|
123
|
+
<!-- TODO {isMultiFocusStart} -->
|
|
124
|
+
<Action
|
|
125
|
+
style={focusDetails.outline}
|
|
126
|
+
border={false}
|
|
127
|
+
size={Size.FillWidth}
|
|
128
|
+
icon={{ name: 'ellipsis', size: Size.Medium, colour: Colour['$brand-primary'] }}
|
|
129
|
+
colourSet={ColourSet.Auxiliary}
|
|
130
|
+
onclick={() => {
|
|
131
|
+
if (tableContext.shownActionsPopup === thisPopup) {
|
|
132
|
+
tableContext.shownActionsPopup = undefined;
|
|
133
|
+
} else {
|
|
134
|
+
tableContext.shownActionsPopup = thisPopup;
|
|
135
|
+
}
|
|
136
|
+
}}
|
|
137
|
+
/>
|
|
138
|
+
</div>
|
|
139
|
+
{#if thisPopupIsVisibile}
|
|
140
|
+
{@const awaitedActions = asyncMap<TableActionButton<T>, [TableActionButton<T>, string]>(
|
|
141
|
+
actions,
|
|
142
|
+
async (item) => {
|
|
143
|
+
return [item, await item.getLabel(cell.row.original, cell.row.visibleIndex)];
|
|
144
|
+
}
|
|
145
|
+
)}
|
|
146
|
+
{#await awaitedActions then actions}
|
|
147
|
+
<Portal>
|
|
148
|
+
<div
|
|
149
|
+
class="popup"
|
|
150
|
+
style="--y: {y}px; --x: {x}px;"
|
|
151
|
+
>
|
|
152
|
+
<div class="action-container">
|
|
153
|
+
{#each actions as [action, label] (label)}
|
|
154
|
+
<TableAction
|
|
155
|
+
{action}
|
|
156
|
+
{cell}
|
|
157
|
+
/>
|
|
158
|
+
{/each}
|
|
159
|
+
</div>
|
|
160
|
+
</div>
|
|
161
|
+
</Portal>
|
|
162
|
+
{/await}
|
|
163
|
+
{/if}
|
|
164
|
+
</div>
|
|
165
|
+
|
|
166
166
|
<style>.focusable,
|
|
167
167
|
.checkbox-cell,
|
|
168
168
|
.input-cell,
|
|
@@ -313,4 +313,4 @@ div.slot-wrapper {
|
|
|
313
313
|
display: flex;
|
|
314
314
|
align-items: center;
|
|
315
315
|
justify-content: center;
|
|
316
|
-
}</style>
|
|
316
|
+
}</style>
|
|
@@ -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 { m as i18n } from "../../../../../paraglide/messages.js";
|
|
7
7
|
import Bubble from "../../../../Bubble.svelte";
|
|
8
8
|
import { BubbleDef } from "../../../Types/Columns/Definitions/Display/BubbleDef.svelte.js";
|
|
@@ -34,81 +34,81 @@ $effect(() => {
|
|
|
34
34
|
}
|
|
35
35
|
}).catch(devCatch);
|
|
36
36
|
});
|
|
37
|
-
</script>
|
|
38
|
-
|
|
39
|
-
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
40
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
41
|
-
<div
|
|
42
|
-
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
43
|
-
tabIndex={0}
|
|
44
|
-
class="focusable"
|
|
45
|
-
class:multifocus={focusDetails.isMultiFocused}
|
|
46
|
-
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
47
|
-
style={focusDetails.outline}
|
|
48
|
-
class:info={validity == Validity.Info}
|
|
49
|
-
class:success={validity == Validity.Valid}
|
|
50
|
-
class:warning={validity == Validity.Warning}
|
|
51
|
-
class:error={validity == Validity.Invalid}
|
|
52
|
-
onmousedown={(e) => {
|
|
53
|
-
// start focus only on left click
|
|
54
|
-
if (e.button === 0) {
|
|
55
|
-
if (e.shiftKey) {
|
|
56
|
-
e.preventDefault();
|
|
57
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
58
|
-
} else {
|
|
59
|
-
tableContext.startFocus(focusDetails.coordinates);
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
}}
|
|
63
|
-
onmouseover={() => {
|
|
64
|
-
if (tableContext.isMousingDown) {
|
|
65
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
66
|
-
}
|
|
67
|
-
}}
|
|
68
|
-
onmouseup={() => {
|
|
69
|
-
tableContext.endFocus(focusDetails.coordinates);
|
|
70
|
-
}}
|
|
71
|
-
>
|
|
72
|
-
<div class="bubble-parent">
|
|
73
|
-
{#await values then values}
|
|
74
|
-
<!-- `maxBubbles` (default 3) caps how many pills render inline;
|
|
75
|
-
anything beyond gets a single `"+N more"` overflow chip with
|
|
76
|
-
the hidden labels as a hover tooltip. Key combines index and
|
|
77
|
-
value because duplicate labels would otherwise collapse and
|
|
78
|
-
reordering with identical labels would force unrelated
|
|
79
|
-
bubbles to swap. -->
|
|
80
|
-
{@const maxBubbles = (cell.column.columnDef as BubbleDef<T>).maxBubbles ?? 3}
|
|
81
|
-
{@const visibleBubbles = values.slice(0, maxBubbles)}
|
|
82
|
-
{@const overflowCount = Math.max(0, values.length - maxBubbles)}
|
|
83
|
-
{@const overflowTitle = values.slice(maxBubbles).join(', ')}
|
|
84
|
-
{#each visibleBubbles as value, index (`${index}:${value}`)}
|
|
85
|
-
{@const colourPromise = (cell.column.columnDef as BubbleDef<T>).getColour?.(
|
|
86
|
-
cell.row.original,
|
|
87
|
-
cell.row.originalIndex,
|
|
88
|
-
value
|
|
89
|
-
)}
|
|
90
|
-
|
|
91
|
-
{#if colourPromise == undefined}
|
|
92
|
-
<Bubble {value} />
|
|
93
|
-
{:else}
|
|
94
|
-
{#await colourPromise then colour}
|
|
95
|
-
<Bubble
|
|
96
|
-
{value}
|
|
97
|
-
colours={colour ?? undefined}
|
|
98
|
-
/>
|
|
99
|
-
{/await}
|
|
100
|
-
{/if}
|
|
101
|
-
{/each}
|
|
102
|
-
{#if overflowCount > 0}
|
|
103
|
-
<span
|
|
104
|
-
class="bubble-overflow"
|
|
105
|
-
title={overflowTitle}
|
|
106
|
-
>{i18n['scoria.text.bubble_overflow']({ count: overflowCount })}</span>
|
|
107
|
-
{/if}
|
|
108
|
-
{/await}
|
|
109
|
-
</div>
|
|
110
|
-
</div>
|
|
111
|
-
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
40
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
41
|
+
<div
|
|
42
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
43
|
+
tabIndex={0}
|
|
44
|
+
class="focusable"
|
|
45
|
+
class:multifocus={focusDetails.isMultiFocused}
|
|
46
|
+
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
47
|
+
style={focusDetails.outline}
|
|
48
|
+
class:info={validity == Validity.Info}
|
|
49
|
+
class:success={validity == Validity.Valid}
|
|
50
|
+
class:warning={validity == Validity.Warning}
|
|
51
|
+
class:error={validity == Validity.Invalid}
|
|
52
|
+
onmousedown={(e) => {
|
|
53
|
+
// start focus only on left click
|
|
54
|
+
if (e.button === 0) {
|
|
55
|
+
if (e.shiftKey) {
|
|
56
|
+
e.preventDefault();
|
|
57
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
58
|
+
} else {
|
|
59
|
+
tableContext.startFocus(focusDetails.coordinates);
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}}
|
|
63
|
+
onmouseover={() => {
|
|
64
|
+
if (tableContext.isMousingDown) {
|
|
65
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
66
|
+
}
|
|
67
|
+
}}
|
|
68
|
+
onmouseup={() => {
|
|
69
|
+
tableContext.endFocus(focusDetails.coordinates);
|
|
70
|
+
}}
|
|
71
|
+
>
|
|
72
|
+
<div class="bubble-parent">
|
|
73
|
+
{#await values then values}
|
|
74
|
+
<!-- `maxBubbles` (default 3) caps how many pills render inline;
|
|
75
|
+
anything beyond gets a single `"+N more"` overflow chip with
|
|
76
|
+
the hidden labels as a hover tooltip. Key combines index and
|
|
77
|
+
value because duplicate labels would otherwise collapse and
|
|
78
|
+
reordering with identical labels would force unrelated
|
|
79
|
+
bubbles to swap. -->
|
|
80
|
+
{@const maxBubbles = (cell.column.columnDef as BubbleDef<T>).maxBubbles ?? 3}
|
|
81
|
+
{@const visibleBubbles = values.slice(0, maxBubbles)}
|
|
82
|
+
{@const overflowCount = Math.max(0, values.length - maxBubbles)}
|
|
83
|
+
{@const overflowTitle = values.slice(maxBubbles).join(', ')}
|
|
84
|
+
{#each visibleBubbles as value, index (`${index}:${value}`)}
|
|
85
|
+
{@const colourPromise = (cell.column.columnDef as BubbleDef<T>).getColour?.(
|
|
86
|
+
cell.row.original,
|
|
87
|
+
cell.row.originalIndex,
|
|
88
|
+
value
|
|
89
|
+
)}
|
|
90
|
+
|
|
91
|
+
{#if colourPromise == undefined}
|
|
92
|
+
<Bubble {value} />
|
|
93
|
+
{:else}
|
|
94
|
+
{#await colourPromise then colour}
|
|
95
|
+
<Bubble
|
|
96
|
+
{value}
|
|
97
|
+
colours={colour ?? undefined}
|
|
98
|
+
/>
|
|
99
|
+
{/await}
|
|
100
|
+
{/if}
|
|
101
|
+
{/each}
|
|
102
|
+
{#if overflowCount > 0}
|
|
103
|
+
<span
|
|
104
|
+
class="bubble-overflow"
|
|
105
|
+
title={overflowTitle}
|
|
106
|
+
>{i18n['scoria.text.bubble_overflow']({ count: overflowCount })}</span>
|
|
107
|
+
{/if}
|
|
108
|
+
{/await}
|
|
109
|
+
</div>
|
|
110
|
+
</div>
|
|
111
|
+
|
|
112
112
|
<style>.focusable,
|
|
113
113
|
.checkbox-cell,
|
|
114
114
|
.input-cell,
|
|
@@ -206,4 +206,4 @@ div.bubble-parent {
|
|
|
206
206
|
font-weight: 500;
|
|
207
207
|
white-space: nowrap;
|
|
208
208
|
cursor: default;
|
|
209
|
-
}</style>
|
|
209
|
+
}</style>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<svelte:options runes />
|
|
2
|
-
|
|
3
|
-
<script
|
|
4
|
-
lang="ts"
|
|
5
|
-
generics="T extends object, R extends object,FilterValueType, IdType extends Primitive"
|
|
1
|
+
<svelte:options runes />
|
|
2
|
+
|
|
3
|
+
<script
|
|
4
|
+
lang="ts"
|
|
5
|
+
generics="T extends object, R extends object,FilterValueType, IdType extends Primitive"
|
|
6
6
|
>import { m as i18n } from "../../../../../paraglide/messages.js";
|
|
7
7
|
import Action from "../../../../Action.svelte";
|
|
8
8
|
import { TableContext } from "../../../Types/Context/TableContext.svelte.js";
|
|
@@ -51,92 +51,92 @@ $effect(() => {
|
|
|
51
51
|
}
|
|
52
52
|
}).catch(devCatch);
|
|
53
53
|
});
|
|
54
|
-
</script>
|
|
55
|
-
|
|
56
|
-
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
57
|
-
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
58
|
-
<div
|
|
59
|
-
class:info={validity == Validity.Info}
|
|
60
|
-
class:success={validity == Validity.Valid}
|
|
61
|
-
class:warning={validity == Validity.Warning}
|
|
62
|
-
class:error={validity == Validity.Invalid}
|
|
63
|
-
class="focusable"
|
|
64
|
-
onmousedown={(e) => {
|
|
65
|
-
// start focus only on left click
|
|
66
|
-
if (e.button === 0) {
|
|
67
|
-
if (e.shiftKey) {
|
|
68
|
-
e.preventDefault();
|
|
69
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
70
|
-
} else {
|
|
71
|
-
tableContext.startFocus(focusDetails.coordinates);
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}}
|
|
75
|
-
onmouseover={() => {
|
|
76
|
-
if (tableContext.isMousingDown) {
|
|
77
|
-
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
78
|
-
}
|
|
79
|
-
}}
|
|
80
|
-
onmouseup={() => {
|
|
81
|
-
tableContext.endFocus(focusDetails.coordinates);
|
|
82
|
-
}}
|
|
83
|
-
>
|
|
84
|
-
<div
|
|
85
|
-
class="slot-wrapper"
|
|
86
|
-
class:multifocus={focusDetails.isMultiFocused}
|
|
87
|
-
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
88
|
-
>
|
|
89
|
-
{#if visible}
|
|
90
|
-
{#await enabled}
|
|
91
|
-
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
92
|
-
{@render action(false)}
|
|
93
|
-
{:then enabled}
|
|
94
|
-
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
95
|
-
{@render action(enabled)}
|
|
96
|
-
{/await}
|
|
97
|
-
{/if}
|
|
98
|
-
</div>
|
|
99
|
-
</div>
|
|
100
|
-
|
|
101
|
-
{#snippet action(enabled: boolean)}
|
|
102
|
-
<div class="noninteractive">
|
|
103
|
-
<Action
|
|
104
|
-
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
105
|
-
style={focusDetails.outline}
|
|
106
|
-
disabled={!enabled}
|
|
107
|
-
border={false}
|
|
108
|
-
label={cell.column.columnDef.onActivate
|
|
109
|
-
? i18n['scoria.action.open_related_table']()
|
|
110
|
-
: i18n['scoria.action.expand_nested_table']()}
|
|
111
|
-
size={Size.FillWidth}
|
|
112
|
-
icon={{
|
|
113
|
-
name:
|
|
114
|
-
!cell.column.columnDef.onActivate &&
|
|
115
|
-
expandedColumnDef?.id === cell.column.columnDef.id
|
|
116
|
-
? 'minus'
|
|
117
|
-
: 'plus',
|
|
118
|
-
size: Size.Medium,
|
|
119
|
-
}}
|
|
120
|
-
colourSet={expandedColumnDef?.id === cell.column.columnDef.id && !cell.column.columnDef.onActivate
|
|
121
|
-
? ColourSet.Primary
|
|
122
|
-
: ColourSet.Auxiliary}
|
|
123
|
-
onclick={(e: MouseEvent) => {
|
|
124
|
-
// FIXME why is this required? svelte bug?
|
|
125
|
-
e.stopImmediatePropagation();
|
|
126
|
-
// Navigate-instead-of-expand: when the column carries an
|
|
127
|
-
// `onActivate`, drive the consumer's drill-down rather than
|
|
128
|
-
// mounting an inner table.
|
|
129
|
-
const onActivate = cell.column.columnDef.onActivate;
|
|
130
|
-
if (onActivate) {
|
|
131
|
-
void onActivate(cell.row.original);
|
|
132
|
-
} else {
|
|
133
|
-
onExpandChange(cell.column.columnDef);
|
|
134
|
-
}
|
|
135
|
-
}}
|
|
136
|
-
/>
|
|
137
|
-
</div>
|
|
138
|
-
{/snippet}
|
|
139
|
-
|
|
54
|
+
</script>
|
|
55
|
+
|
|
56
|
+
<!-- svelte-ignore a11y_mouse_events_have_key_events -->
|
|
57
|
+
<!-- svelte-ignore a11y_no_static_element_interactions -->
|
|
58
|
+
<div
|
|
59
|
+
class:info={validity == Validity.Info}
|
|
60
|
+
class:success={validity == Validity.Valid}
|
|
61
|
+
class:warning={validity == Validity.Warning}
|
|
62
|
+
class:error={validity == Validity.Invalid}
|
|
63
|
+
class="focusable"
|
|
64
|
+
onmousedown={(e) => {
|
|
65
|
+
// start focus only on left click
|
|
66
|
+
if (e.button === 0) {
|
|
67
|
+
if (e.shiftKey) {
|
|
68
|
+
e.preventDefault();
|
|
69
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
70
|
+
} else {
|
|
71
|
+
tableContext.startFocus(focusDetails.coordinates);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}}
|
|
75
|
+
onmouseover={() => {
|
|
76
|
+
if (tableContext.isMousingDown) {
|
|
77
|
+
tableContext.setFocusEnd(focusDetails.coordinates);
|
|
78
|
+
}
|
|
79
|
+
}}
|
|
80
|
+
onmouseup={() => {
|
|
81
|
+
tableContext.endFocus(focusDetails.coordinates);
|
|
82
|
+
}}
|
|
83
|
+
>
|
|
84
|
+
<div
|
|
85
|
+
class="slot-wrapper"
|
|
86
|
+
class:multifocus={focusDetails.isMultiFocused}
|
|
87
|
+
class:multifocus-start={focusDetails.isMultiFocusStart}
|
|
88
|
+
>
|
|
89
|
+
{#if visible}
|
|
90
|
+
{#await enabled}
|
|
91
|
+
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
92
|
+
{@render action(false)}
|
|
93
|
+
{:then enabled}
|
|
94
|
+
<!-- eslint-disable-next-line @typescript-eslint/no-confusing-void-expression -->
|
|
95
|
+
{@render action(enabled)}
|
|
96
|
+
{/await}
|
|
97
|
+
{/if}
|
|
98
|
+
</div>
|
|
99
|
+
</div>
|
|
100
|
+
|
|
101
|
+
{#snippet action(enabled: boolean)}
|
|
102
|
+
<div class="noninteractive">
|
|
103
|
+
<Action
|
|
104
|
+
id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
|
|
105
|
+
style={focusDetails.outline}
|
|
106
|
+
disabled={!enabled}
|
|
107
|
+
border={false}
|
|
108
|
+
label={cell.column.columnDef.onActivate
|
|
109
|
+
? i18n['scoria.action.open_related_table']()
|
|
110
|
+
: i18n['scoria.action.expand_nested_table']()}
|
|
111
|
+
size={Size.FillWidth}
|
|
112
|
+
icon={{
|
|
113
|
+
name:
|
|
114
|
+
!cell.column.columnDef.onActivate &&
|
|
115
|
+
expandedColumnDef?.id === cell.column.columnDef.id
|
|
116
|
+
? 'minus'
|
|
117
|
+
: 'plus',
|
|
118
|
+
size: Size.Medium,
|
|
119
|
+
}}
|
|
120
|
+
colourSet={expandedColumnDef?.id === cell.column.columnDef.id && !cell.column.columnDef.onActivate
|
|
121
|
+
? ColourSet.Primary
|
|
122
|
+
: ColourSet.Auxiliary}
|
|
123
|
+
onclick={(e: MouseEvent) => {
|
|
124
|
+
// FIXME why is this required? svelte bug?
|
|
125
|
+
e.stopImmediatePropagation();
|
|
126
|
+
// Navigate-instead-of-expand: when the column carries an
|
|
127
|
+
// `onActivate`, drive the consumer's drill-down rather than
|
|
128
|
+
// mounting an inner table.
|
|
129
|
+
const onActivate = cell.column.columnDef.onActivate;
|
|
130
|
+
if (onActivate) {
|
|
131
|
+
void onActivate(cell.row.original);
|
|
132
|
+
} else {
|
|
133
|
+
onExpandChange(cell.column.columnDef);
|
|
134
|
+
}
|
|
135
|
+
}}
|
|
136
|
+
/>
|
|
137
|
+
</div>
|
|
138
|
+
{/snippet}
|
|
139
|
+
|
|
140
140
|
<style>.focusable,
|
|
141
141
|
.checkbox-cell,
|
|
142
142
|
.input-cell,
|
|
@@ -218,4 +218,4 @@ div.slot-wrapper {
|
|
|
218
218
|
.noninteractive {
|
|
219
219
|
display: contents;
|
|
220
220
|
user-select: none;
|
|
221
|
-
}</style>
|
|
221
|
+
}</style>
|