@lavalogic/scoria 0.40.31 → 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.
Files changed (137) hide show
  1. package/README.md +58 -58
  2. package/dist/Components/AccordionGroup.svelte +28 -28
  3. package/dist/Components/AccordionGroupButton.svelte +60 -60
  4. package/dist/Components/Action.svelte +48 -48
  5. package/dist/Components/AlertModal.svelte +102 -102
  6. package/dist/Components/Base/ContextWrapper.svelte +45 -45
  7. package/dist/Components/Base/Pagination.svelte +135 -135
  8. package/dist/Components/Base/Snippets.svelte +25 -25
  9. package/dist/Components/BigRadioSet.svelte +34 -34
  10. package/dist/Components/Bubble.svelte +38 -38
  11. package/dist/Components/Button.svelte +83 -83
  12. package/dist/Components/Checkbox.svelte +71 -71
  13. package/dist/Components/CollapsibleCard.svelte +59 -59
  14. package/dist/Components/CollapsibleMenuGroup.svelte +43 -43
  15. package/dist/Components/ConditionBuilder/ConditionBuilder.svelte +101 -101
  16. package/dist/Components/Contexts/ContextMenu.svelte +76 -76
  17. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  18. package/dist/Components/Contexts/ContextMenuOption.svelte +38 -38
  19. package/dist/Components/Contexts/Toast.svelte +71 -71
  20. package/dist/Components/Contexts/ToastContainer.svelte +34 -34
  21. package/dist/Components/Contexts/Tooltip.svelte +32 -32
  22. package/dist/Components/DataMatrixIcon.svelte +37 -37
  23. package/dist/Components/DateInput.svelte +80 -80
  24. package/dist/Components/DatePicker.svelte +86 -86
  25. package/dist/Components/DesktopModal.svelte +65 -65
  26. package/dist/Components/Dial.svelte +35 -35
  27. package/dist/Components/DimensionInput.svelte +95 -95
  28. package/dist/Components/DragMenu/DragMenuHolder.svelte +53 -53
  29. package/dist/Components/DragMenu/DraggableCard.svelte +49 -49
  30. package/dist/Components/FileCard.svelte +18 -18
  31. package/dist/Components/FileUpload.svelte +115 -115
  32. package/dist/Components/GridInput.svelte +123 -123
  33. package/dist/Components/GridInputSet.svelte +21 -21
  34. package/dist/Components/HorizontalTabGroup.svelte +54 -54
  35. package/dist/Components/HorizontalTabGroupButton.svelte +32 -32
  36. package/dist/Components/Icon.svelte +68 -68
  37. package/dist/Components/Icons.d.ts +3 -3
  38. package/dist/Components/Icons.js +11 -11
  39. package/dist/Components/InfoAlert.svelte +32 -32
  40. package/dist/Components/LoadingAnimation.svelte +228 -227
  41. package/dist/Components/LoadingModal.svelte +19 -19
  42. package/dist/Components/LoadingOverlay.svelte +20 -20
  43. package/dist/Components/Modal.svelte +127 -127
  44. package/dist/Components/MultiSelect.svelte +126 -126
  45. package/dist/Components/Nav/Nav.svelte +71 -71
  46. package/dist/Components/Nav/NavServiceMenuList.svelte +37 -37
  47. package/dist/Components/Nav/NavTab.svelte +46 -46
  48. package/dist/Components/Nav/ServiceMenuItem.svelte +62 -62
  49. package/dist/Components/Nav/ServicesNav.svelte +50 -50
  50. package/dist/Components/NumberInput.svelte +98 -98
  51. package/dist/Components/OptionCards.svelte +58 -58
  52. package/dist/Components/PageHeading.svelte +21 -21
  53. package/dist/Components/PasswordInput.svelte +61 -61
  54. package/dist/Components/PopoverButton.svelte +53 -53
  55. package/dist/Components/Portal.svelte +7 -7
  56. package/dist/Components/ProgressBubble.svelte +42 -42
  57. package/dist/Components/QuerySelect.svelte +102 -102
  58. package/dist/Components/ResourceCalendar/ResourceCalendar.svelte +241 -241
  59. package/dist/Components/SidebarPanel.svelte +32 -32
  60. package/dist/Components/SingleSelect.svelte +122 -122
  61. package/dist/Components/StepButton.svelte +48 -48
  62. package/dist/Components/StepForm.svelte +58 -58
  63. package/dist/Components/Switch.svelte +43 -43
  64. package/dist/Components/Table/ARCHITECTURE.md +298 -298
  65. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +30 -30
  66. package/dist/Components/Table/Body/Rows/ColumnList.svelte +24 -24
  67. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +165 -165
  68. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +13 -13
  69. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +120 -120
  70. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +81 -81
  71. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +92 -92
  72. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +110 -110
  73. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +54 -54
  74. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +35 -35
  75. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +64 -64
  76. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +82 -82
  77. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +88 -88
  78. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +90 -90
  79. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +96 -96
  80. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +71 -71
  81. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +124 -124
  82. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +91 -91
  83. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +88 -88
  84. package/dist/Components/Table/Body/Rows/TableRow.svelte +127 -127
  85. package/dist/Components/Table/Body/TableBody.svelte +92 -92
  86. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +25 -25
  87. package/dist/Components/Table/Headers/SelectAllHeader.svelte +20 -20
  88. package/dist/Components/Table/Headers/TableHead.svelte +175 -175
  89. package/dist/Components/Table/Misc/ColumnPanel.svelte +32 -32
  90. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +29 -29
  91. package/dist/Components/Table/Misc/FilterInput.svelte +326 -326
  92. package/dist/Components/Table/Misc/FilterPanel.svelte +79 -79
  93. package/dist/Components/Table/Misc/FilterPanelModal.svelte +21 -21
  94. package/dist/Components/Table/Misc/ShareViewModal.svelte +118 -118
  95. package/dist/Components/Table/Misc/SidePanel.svelte +24 -24
  96. package/dist/Components/Table/Misc/TableConfigurationModal.svelte +318 -318
  97. package/dist/Components/Table/Misc/TableFooter.svelte +201 -201
  98. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +112 -112
  99. package/dist/Components/Table/Misc/TableSidebar.svelte +116 -116
  100. package/dist/Components/Table/Misc/TableViewDropdown.svelte +25 -25
  101. package/dist/Components/Table/Misc/ToolboxPanel.svelte +60 -60
  102. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +63 -63
  103. package/dist/Components/Table/Misc/UpdateViewOptionsModal.svelte +101 -101
  104. package/dist/Components/Table/NestedTable.svelte +29 -29
  105. package/dist/Components/Table/Table.svelte +140 -140
  106. package/dist/Components/Test/TestContextConsumer.svelte +8 -8
  107. package/dist/Components/TextArea.svelte +92 -90
  108. package/dist/Components/TextInput.svelte +128 -117
  109. package/dist/Components/ThreeStateRadio.svelte +101 -101
  110. package/dist/Components/Touch/BoolCard.svelte +27 -27
  111. package/dist/Components/Touch/DateModal.svelte +98 -98
  112. package/dist/Components/Touch/EditCard.svelte +44 -44
  113. package/dist/Components/Touch/InfoCard.svelte +25 -25
  114. package/dist/Components/Touch/InfoTextCard.svelte +22 -22
  115. package/dist/Components/Touch/ModalExplanation.svelte +13 -13
  116. package/dist/Components/Touch/NumberKeyboard.svelte +81 -81
  117. package/dist/Components/Touch/NumberModal.svelte +49 -49
  118. package/dist/Components/Touch/PlusMinusCard.svelte +40 -40
  119. package/dist/Components/Touch/SelectModal.svelte +86 -86
  120. package/dist/Components/Touch/SummaryCard.svelte +74 -74
  121. package/dist/Components/Touch/TextAreaModal.svelte +53 -53
  122. package/dist/Components/Touch/TextModal.svelte +56 -56
  123. package/dist/Components/Touch/TouchCard.svelte +28 -28
  124. package/dist/Components/Touch/TouchModal.svelte +141 -141
  125. package/dist/Components/Touch/UtilityButton.svelte +63 -63
  126. package/dist/Components/VerticalTabGroup.svelte +38 -38
  127. package/dist/Components/VerticalTabGroupButton.svelte +46 -46
  128. package/dist/Helpers/Datamatrix.d.ts +19 -19
  129. package/dist/Helpers/Datamatrix.js +291 -291
  130. package/dist/Types/Examples/ExampleModal.svelte +27 -27
  131. package/dist/paraglide/README.md +1 -1
  132. package/dist/scss/_basics.scss +12 -12
  133. package/dist/scss/_colours.scss +140 -140
  134. package/dist/scss/_motion.scss +57 -57
  135. package/dist/scss/_sizing.scss +85 -85
  136. package/dist/scss/_transitions.scss +8 -8
  137. 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 { m as i18n } from "../../../../../paraglide/messages.js";
7
7
  import { dev } from "$app/environment";
8
8
  import { TableContext } from "../../../Types/Context/TableContext.svelte.js";
@@ -90,91 +90,91 @@ function onInputFocus(e) {
90
90
  * lives in the shared `useAsyncEditable` helper.
91
91
  */
92
92
  $effect(() => editable.attachEditListener(tdref));
93
- </script>
94
-
95
- {#if editable.isBeingEdited}
96
- <div class="input-cell">
97
- <TextInput
98
- id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
99
- onkeydown={handleInputKeydown}
100
- variant={InputVariant.Table}
101
- bind:value={tempTextValue}
102
- onfocus={onInputFocus}
103
- bind:inputRef
104
- onblur={onBlur}
105
- />
106
- <!-- HACK this onBlur is now being called by an effect because otherwise it fires twice -->
107
- </div>
108
- {:else}
109
- <!-- svelte-ignore a11y_mouse_events_have_key_events -->
110
- <!-- svelte-ignore a11y_no_static_element_interactions -->
111
- <div
112
- id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
113
- style={editable.focusDetails.outline}
114
- onmousedown={(e) => {
115
- // start focus only on left click
116
- if (e.button === 0) {
117
- if (e.shiftKey) {
118
- e.preventDefault();
119
- tableContext.setFocusEnd(editable.focusDetails.coordinates);
120
- } else {
121
- tableContext.startFocus(editable.focusDetails.coordinates);
122
- }
123
- }
124
- }}
125
- onmouseover={() => {
126
- if (tableContext.isMousingDown) {
127
- tableContext.setFocusEnd(editable.focusDetails.coordinates);
128
- }
129
- }}
130
- bind:this={tdref}
131
- tabIndex="0"
132
- class:editable={editable.editable}
133
- class="focusable"
134
- class:multifocus={editable.focusDetails.isMultiFocused}
135
- class:multifocus-start={editable.focusDetails.isMultiFocusStart}
136
- class:info={editable.validity == Validity.Info}
137
- class:success={editable.validity == Validity.Valid}
138
- class:warning={editable.validity == Validity.Warning}
139
- class:error={editable.validity == Validity.Invalid}
140
- onmouseup={() => {
141
- const wasHandled = editable.handleSingleClickFocus();
142
- if (wasHandled) {
143
- tick()
144
- .then(() => {
145
- inputRef?.focus();
146
- })
147
- .catch(devCatch);
148
- } else {
149
- tableContext.endFocus(editable.focusDetails.coordinates);
150
- }
151
- }}
152
- ondblclick={() => {
153
- const wasHandled = editable.handleDoubleClickFocus();
154
- if (wasHandled) {
155
- tick()
156
- .then(() => {
157
- inputRef?.focus();
158
- })
159
- .catch(devCatch);
160
- }
161
- }}
162
- >
163
- {#await visibleValue}
164
- {loadingText()}
165
- {:then value}
166
- {value}
167
- {:catch error}
168
- {#if dev}
169
- error: {error}
170
- <!-- eslint-disable-next-line svelte/no-at-debug-tags -->
171
- {@debug error}
172
- {/if}
173
- {i18n['scoria.text.error_getting_value']()}
174
- {/await}
175
- </div>
176
- {/if}
177
-
93
+ </script>
94
+
95
+ {#if editable.isBeingEdited}
96
+ <div class="input-cell">
97
+ <TextInput
98
+ id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
99
+ onkeydown={handleInputKeydown}
100
+ variant={InputVariant.Table}
101
+ bind:value={tempTextValue}
102
+ onfocus={onInputFocus}
103
+ bind:inputRef
104
+ onblur={onBlur}
105
+ />
106
+ <!-- HACK this onBlur is now being called by an effect because otherwise it fires twice -->
107
+ </div>
108
+ {:else}
109
+ <!-- svelte-ignore a11y_mouse_events_have_key_events -->
110
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
111
+ <div
112
+ id={`${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`}
113
+ style={editable.focusDetails.outline}
114
+ onmousedown={(e) => {
115
+ // start focus only on left click
116
+ if (e.button === 0) {
117
+ if (e.shiftKey) {
118
+ e.preventDefault();
119
+ tableContext.setFocusEnd(editable.focusDetails.coordinates);
120
+ } else {
121
+ tableContext.startFocus(editable.focusDetails.coordinates);
122
+ }
123
+ }
124
+ }}
125
+ onmouseover={() => {
126
+ if (tableContext.isMousingDown) {
127
+ tableContext.setFocusEnd(editable.focusDetails.coordinates);
128
+ }
129
+ }}
130
+ bind:this={tdref}
131
+ tabIndex="0"
132
+ class:editable={editable.editable}
133
+ class="focusable"
134
+ class:multifocus={editable.focusDetails.isMultiFocused}
135
+ class:multifocus-start={editable.focusDetails.isMultiFocusStart}
136
+ class:info={editable.validity == Validity.Info}
137
+ class:success={editable.validity == Validity.Valid}
138
+ class:warning={editable.validity == Validity.Warning}
139
+ class:error={editable.validity == Validity.Invalid}
140
+ onmouseup={() => {
141
+ const wasHandled = editable.handleSingleClickFocus();
142
+ if (wasHandled) {
143
+ tick()
144
+ .then(() => {
145
+ inputRef?.focus();
146
+ })
147
+ .catch(devCatch);
148
+ } else {
149
+ tableContext.endFocus(editable.focusDetails.coordinates);
150
+ }
151
+ }}
152
+ ondblclick={() => {
153
+ const wasHandled = editable.handleDoubleClickFocus();
154
+ if (wasHandled) {
155
+ tick()
156
+ .then(() => {
157
+ inputRef?.focus();
158
+ })
159
+ .catch(devCatch);
160
+ }
161
+ }}
162
+ >
163
+ {#await visibleValue}
164
+ {loadingText()}
165
+ {:then value}
166
+ {value}
167
+ {:catch error}
168
+ {#if dev}
169
+ error: {error}
170
+ <!-- eslint-disable-next-line svelte/no-at-debug-tags -->
171
+ {@debug error}
172
+ {/if}
173
+ {i18n['scoria.text.error_getting_value']()}
174
+ {/await}
175
+ </div>
176
+ {/if}
177
+
178
178
  <style>.focusable,
179
179
  .checkbox-cell,
180
180
  .input-cell,
@@ -241,4 +241,4 @@ $effect(() => editable.attachEditListener(tdref));
241
241
  .input-cell {
242
242
  padding: unset;
243
243
  box-sizing: border-box;
244
- }</style>
244
+ }</style>
@@ -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 { TableContext } from "../../../Types/Context/TableContext.svelte.js";
8
8
  import { devCatch, isValidityTuple } from "../../../../../Helpers/Helpers.svelte.js";
@@ -36,11 +36,11 @@ const iconSets = {
36
36
  size: Size.Medium
37
37
  }
38
38
  };
39
- </script>
40
-
41
- <script
42
- lang="ts"
43
- generics="T extends object, FilterValueType, RowIdType extends Primitive"
39
+ </script>
40
+
41
+ <script
42
+ lang="ts"
43
+ generics="T extends object, FilterValueType, RowIdType extends Primitive"
44
44
  >import "../../../Types/Context/TableInitOptions.js";
45
45
  import { getContext, tick } from "svelte";
46
46
  const { cell } = $props();
@@ -89,83 +89,83 @@ function onclose() {
89
89
  }
90
90
  }
91
91
  const icon = $derived(iconSets[validity]);
92
- </script>
93
-
94
- <!-- svelte-ignore a11y_mouse_events_have_key_events -->
95
- <!-- svelte-ignore a11y_no_static_element_interactions -->
96
- <div
97
- class="focusable"
98
- onmousedown={(e) => {
99
- // start focus only on left click
100
- if (e.button === 0) {
101
- if (e.shiftKey) {
102
- e.preventDefault();
103
- tableContext.setFocusEnd(focusDetails.coordinates);
104
- } else {
105
- tableContext.startFocus(focusDetails.coordinates);
106
- }
107
- }
108
- }}
109
- onmouseover={() => {
110
- if (tableContext.isMousingDown) {
111
- tableContext.setFocusEnd(focusDetails.coordinates);
112
- }
113
- }}
114
- onmouseup={() => {
115
- tableContext.endFocus(focusDetails.coordinates);
116
- }}
117
- >
118
- <div
119
- class="slot-wrapper"
120
- class:multifocus={focusDetails.isMultiFocused}
121
- class:multifocus-start={focusDetails.isMultiFocusStart}
122
- >
123
- <Action
124
- id={thisId}
125
- style={focusDetails.outline}
126
- border={false}
127
- colourSet={ColourSet.Auxiliary}
128
- label={reason}
129
- size={Size.FillWidth}
130
- {icon}
131
- onclick={() => {
132
- if (ColumnDef.modal) {
133
- tableContext.setOpenModalCell({
134
- row: cell.row.original,
135
- columnId: cell.column.id,
136
- });
137
- }
138
- }}
139
- />
140
- </div>
141
- {#if showModal}
142
- <!--
143
- `ColumnDef.modal` is declared as
144
- `Component<DisplayModalProps<TRow>>` on the public column
145
- options, which exposes a stable `{ row, close }` prop
146
- shape. Cell renderers used to hand a legacy
147
- `{ cell, onclose, onsubmit }` triple here, which made the
148
- public type lie about the runtime shape - migrated to
149
- `{ row, close }` so consumer-authored modals can rely on
150
- the documented type.
151
-
152
- The dialog is NOT wrapped in `<Portal target={document.body}>`
153
- any more. `<dialog>` opened via `showModal()` enters the
154
- browser's top layer, so it already escapes overflow:hidden /
155
- sticky / transform ancestors without needing to be re-parented.
156
- Moving the `<div>` ancestor mid-mount (Portal's $effect runs
157
- during the same microtask round as BaseModal's `tick().then`
158
- `dialog.showModal()`) was popping the dialog out of the top
159
- layer and leaving it to render inline at the bottom of the
160
- page.
161
- -->
162
- <ColumnDef.modal
163
- row={cell.row.original}
164
- close={onclose}
165
- />
166
- {/if}
167
- </div>
168
-
92
+ </script>
93
+
94
+ <!-- svelte-ignore a11y_mouse_events_have_key_events -->
95
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
96
+ <div
97
+ class="focusable"
98
+ onmousedown={(e) => {
99
+ // start focus only on left click
100
+ if (e.button === 0) {
101
+ if (e.shiftKey) {
102
+ e.preventDefault();
103
+ tableContext.setFocusEnd(focusDetails.coordinates);
104
+ } else {
105
+ tableContext.startFocus(focusDetails.coordinates);
106
+ }
107
+ }
108
+ }}
109
+ onmouseover={() => {
110
+ if (tableContext.isMousingDown) {
111
+ tableContext.setFocusEnd(focusDetails.coordinates);
112
+ }
113
+ }}
114
+ onmouseup={() => {
115
+ tableContext.endFocus(focusDetails.coordinates);
116
+ }}
117
+ >
118
+ <div
119
+ class="slot-wrapper"
120
+ class:multifocus={focusDetails.isMultiFocused}
121
+ class:multifocus-start={focusDetails.isMultiFocusStart}
122
+ >
123
+ <Action
124
+ id={thisId}
125
+ style={focusDetails.outline}
126
+ border={false}
127
+ colourSet={ColourSet.Auxiliary}
128
+ label={reason}
129
+ size={Size.FillWidth}
130
+ {icon}
131
+ onclick={() => {
132
+ if (ColumnDef.modal) {
133
+ tableContext.setOpenModalCell({
134
+ row: cell.row.original,
135
+ columnId: cell.column.id,
136
+ });
137
+ }
138
+ }}
139
+ />
140
+ </div>
141
+ {#if showModal}
142
+ <!--
143
+ `ColumnDef.modal` is declared as
144
+ `Component<DisplayModalProps<TRow>>` on the public column
145
+ options, which exposes a stable `{ row, close }` prop
146
+ shape. Cell renderers used to hand a legacy
147
+ `{ cell, onclose, onsubmit }` triple here, which made the
148
+ public type lie about the runtime shape - migrated to
149
+ `{ row, close }` so consumer-authored modals can rely on
150
+ the documented type.
151
+
152
+ The dialog is NOT wrapped in `<Portal target={document.body}>`
153
+ any more. `<dialog>` opened via `showModal()` enters the
154
+ browser's top layer, so it already escapes overflow:hidden /
155
+ sticky / transform ancestors without needing to be re-parented.
156
+ Moving the `<div>` ancestor mid-mount (Portal's $effect runs
157
+ during the same microtask round as BaseModal's `tick().then`
158
+ `dialog.showModal()`) was popping the dialog out of the top
159
+ layer and leaving it to render inline at the bottom of the
160
+ page.
161
+ -->
162
+ <ColumnDef.modal
163
+ row={cell.row.original}
164
+ close={onclose}
165
+ />
166
+ {/if}
167
+ </div>
168
+
169
169
  <style>.focusable,
170
170
  .checkbox-cell,
171
171
  .input-cell,
@@ -223,4 +223,4 @@ div.slot-wrapper {
223
223
  display: flex;
224
224
  align-items: center;
225
225
  justify-content: center;
226
- }</style>
226
+ }</style>
@@ -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 { m as i18n } from "../../../../paraglide/messages.js";
7
7
  import { dev } from "$app/environment";
8
8
  import { devCatch, generateWeakId } from "../../../../Helpers/Helpers.svelte.js";
@@ -129,127 +129,127 @@ const fallbackInnerTableName = generateWeakId();
129
129
  function cellWrapStyle(cell) {
130
130
  return cell.column.columnDef.wrapValue ? "--cell-white-space: normal; --cell-overflow-x: visible; --cell-height: auto; --cell-min-height: var(--height);" : "";
131
131
  }
132
- </script>
133
-
134
- <div
135
- role="row"
136
- class="datatable-row"
137
- class:hoverable
138
- class:alt={tableContext.alternateRowColours && odd}
139
- class:highlighted
140
- >
141
- {#if showHighlightButton}
142
- <div
143
- role="cell"
144
- class="cell highlight-cell pinned-left"
145
- style="left: 0px"
146
- >
147
- <ColumnHighlight
148
- rowIndex={rowIndex ??
149
- (() => {
150
- if (dev) {
151
- console.error(`column had invalid row index: ${rowIndex}`);
152
- }
153
- return -1;
154
- })()}
155
- {highlighted}
156
- toggleHighlightedRow={() => {
157
- tableContext.toggleHighlightedRow(row.original)?.catch(devCatch);
158
- }}
159
- />
160
- </div>
161
- {/if}
162
- {#each leftCells as cell, index (cell.column.id)}
163
- <div
164
- role="cell"
165
- class="cell pinned-left"
166
- style="left: {leftOffsets[index]}px; {cellWrapStyle(cell)}"
167
- >
168
- <TableColumn
169
- {cell}
170
- {expandedColumnDef}
171
- {onExpandChange}
172
- />
173
- </div>
174
- {/each}
175
- {#each centreCells as cell (cell.column.id)}
176
- <div
177
- role="cell"
178
- class="cell"
179
- style={cellWrapStyle(cell)}
180
- >
181
- <TableColumn
182
- {cell}
183
- {expandedColumnDef}
184
- {onExpandChange}
185
- />
186
- </div>
187
- {/each}
188
- {#each rightCells as cell, index (cell.column.id)}
189
- <div
190
- role="cell"
191
- class="cell pinned-right"
192
- style="right: {rightOffsets[index]}px; {cellWrapStyle(cell)}"
193
- >
194
- <TableColumn
195
- {cell}
196
- {expandedColumnDef}
197
- {onExpandChange}
198
- />
199
- </div>
200
- {/each}
201
- </div>
202
-
203
- {#if expandedColumnDef}
204
- <div
205
- role="row"
206
- class="datatable-row expand-row"
207
- >
208
- <div
209
- role="cell"
210
- class="cell expand-cell"
211
- >
212
- {#await innerDataPromise}
213
- {i18n['scoria.text.loading_inline']()}
214
- {:then data}
215
- {#if data && data.length}
216
- {@const options = expandedColumnDef.innerTableOptions}
217
- {#if innerTableName}
218
- {#key innerTableName}
219
- <NestedTable
220
- tableName={innerTableName}
221
- {data}
222
- columnDefWrapper={innerColumnDefs}
223
- {options}
224
- getUserId={tableContext.getUserId}
225
- />
226
- {/key}
227
- {:else}
228
- <NestedTable
229
- tableName={fallbackInnerTableName}
230
- {data}
231
- columnDefWrapper={innerColumnDefs}
232
- {options}
233
- getUserId={tableContext.getUserId}
234
- />
235
- {/if}
236
- {:else if !data}
237
- {i18n['scoria.text.error_fetching_data']()}
238
- {:else}
239
- {i18n['scoria.text.no_data']()}
240
- {/if}
241
- {:catch e}
242
- {#if dev}
243
- error: {e}
244
- <!-- eslint-disable-next-line svelte/no-at-debug-tags -->
245
- {@debug e}
246
- {/if}
247
- {i18n['scoria.text.error_fetching_data']()}
248
- {/await}
249
- </div>
250
- </div>
251
- {/if}
252
-
132
+ </script>
133
+
134
+ <div
135
+ role="row"
136
+ class="datatable-row"
137
+ class:hoverable
138
+ class:alt={tableContext.alternateRowColours && odd}
139
+ class:highlighted
140
+ >
141
+ {#if showHighlightButton}
142
+ <div
143
+ role="cell"
144
+ class="cell highlight-cell pinned-left"
145
+ style="left: 0px"
146
+ >
147
+ <ColumnHighlight
148
+ rowIndex={rowIndex ??
149
+ (() => {
150
+ if (dev) {
151
+ console.error(`column had invalid row index: ${rowIndex}`);
152
+ }
153
+ return -1;
154
+ })()}
155
+ {highlighted}
156
+ toggleHighlightedRow={() => {
157
+ tableContext.toggleHighlightedRow(row.original)?.catch(devCatch);
158
+ }}
159
+ />
160
+ </div>
161
+ {/if}
162
+ {#each leftCells as cell, index (cell.column.id)}
163
+ <div
164
+ role="cell"
165
+ class="cell pinned-left"
166
+ style="left: {leftOffsets[index]}px; {cellWrapStyle(cell)}"
167
+ >
168
+ <TableColumn
169
+ {cell}
170
+ {expandedColumnDef}
171
+ {onExpandChange}
172
+ />
173
+ </div>
174
+ {/each}
175
+ {#each centreCells as cell (cell.column.id)}
176
+ <div
177
+ role="cell"
178
+ class="cell"
179
+ style={cellWrapStyle(cell)}
180
+ >
181
+ <TableColumn
182
+ {cell}
183
+ {expandedColumnDef}
184
+ {onExpandChange}
185
+ />
186
+ </div>
187
+ {/each}
188
+ {#each rightCells as cell, index (cell.column.id)}
189
+ <div
190
+ role="cell"
191
+ class="cell pinned-right"
192
+ style="right: {rightOffsets[index]}px; {cellWrapStyle(cell)}"
193
+ >
194
+ <TableColumn
195
+ {cell}
196
+ {expandedColumnDef}
197
+ {onExpandChange}
198
+ />
199
+ </div>
200
+ {/each}
201
+ </div>
202
+
203
+ {#if expandedColumnDef}
204
+ <div
205
+ role="row"
206
+ class="datatable-row expand-row"
207
+ >
208
+ <div
209
+ role="cell"
210
+ class="cell expand-cell"
211
+ >
212
+ {#await innerDataPromise}
213
+ {i18n['scoria.text.loading_inline']()}
214
+ {:then data}
215
+ {#if data && data.length}
216
+ {@const options = expandedColumnDef.innerTableOptions}
217
+ {#if innerTableName}
218
+ {#key innerTableName}
219
+ <NestedTable
220
+ tableName={innerTableName}
221
+ {data}
222
+ columnDefWrapper={innerColumnDefs}
223
+ {options}
224
+ getUserId={tableContext.getUserId}
225
+ />
226
+ {/key}
227
+ {:else}
228
+ <NestedTable
229
+ tableName={fallbackInnerTableName}
230
+ {data}
231
+ columnDefWrapper={innerColumnDefs}
232
+ {options}
233
+ getUserId={tableContext.getUserId}
234
+ />
235
+ {/if}
236
+ {:else if !data}
237
+ {i18n['scoria.text.error_fetching_data']()}
238
+ {:else}
239
+ {i18n['scoria.text.no_data']()}
240
+ {/if}
241
+ {:catch e}
242
+ {#if dev}
243
+ error: {e}
244
+ <!-- eslint-disable-next-line svelte/no-at-debug-tags -->
245
+ {@debug e}
246
+ {/if}
247
+ {i18n['scoria.text.error_fetching_data']()}
248
+ {/await}
249
+ </div>
250
+ </div>
251
+ {/if}
252
+
253
253
  <style>.datatable-row {
254
254
  display: grid;
255
255
  grid-template-columns: var(--cols);
@@ -314,4 +314,4 @@ function cellWrapStyle(cell) {
314
314
  padding: 0;
315
315
  display: block;
316
316
  width: 100%;
317
- }</style>
317
+ }</style>