@lavalogic/scoria 0.38.12 → 0.38.13

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 (94) hide show
  1. package/dist/Components/AccordionGroup.svelte +46 -46
  2. package/dist/Components/AccordionGroupButton.svelte +76 -76
  3. package/dist/Components/Action.svelte +136 -136
  4. package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +712 -702
  5. package/dist/Components/Base/BaseModal.svelte +125 -125
  6. package/dist/Components/Base/ContextWrapper.svelte +72 -72
  7. package/dist/Components/Base/Pagination.svelte +198 -198
  8. package/dist/Components/Base/Snippets.svelte +36 -36
  9. package/dist/Components/BigRadioSet.svelte +38 -38
  10. package/dist/Components/Bubble.svelte +101 -101
  11. package/dist/Components/Button.svelte +209 -209
  12. package/dist/Components/Checkbox.svelte +86 -86
  13. package/dist/Components/Contexts/ContextMenu.svelte +164 -164
  14. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  15. package/dist/Components/Contexts/ContextMenuOption.svelte +60 -60
  16. package/dist/Components/Contexts/ToastContainer.svelte +65 -65
  17. package/dist/Components/Contexts/Tooltip.svelte +37 -37
  18. package/dist/Components/DataMatrixIcon.svelte +112 -112
  19. package/dist/Components/DateInput.svelte +148 -148
  20. package/dist/Components/DatePicker.svelte +300 -300
  21. package/dist/Components/DesktopModal.svelte +90 -90
  22. package/dist/Components/Dial.svelte +204 -204
  23. package/dist/Components/DimensionInput.svelte +170 -170
  24. package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -119
  25. package/dist/Components/DragMenu/DraggableCard.svelte +77 -77
  26. package/dist/Components/FileCard.svelte +24 -24
  27. package/dist/Components/FileUpload.svelte +236 -236
  28. package/dist/Components/GridInputSet.svelte +29 -29
  29. package/dist/Components/HorizontalTabGroup.svelte +82 -82
  30. package/dist/Components/HorizontalTabGroupButton.svelte +44 -44
  31. package/dist/Components/Icon.svelte +128 -128
  32. package/dist/Components/Icons.js +357 -357
  33. package/dist/Components/LoadingAnimation.svelte +29 -29
  34. package/dist/Components/LoadingModal.svelte +45 -45
  35. package/dist/Components/LoadingOverlay.svelte +25 -25
  36. package/dist/Components/Modal.svelte +258 -258
  37. package/dist/Components/MultiSelect.svelte +220 -220
  38. package/dist/Components/Nav/NavServiceMenuList.svelte +43 -43
  39. package/dist/Components/Nav/NavTab.svelte +62 -62
  40. package/dist/Components/Nav/ServicesNav.svelte +80 -80
  41. package/dist/Components/NumberInput.svelte +157 -157
  42. package/dist/Components/PageHeading.svelte +25 -25
  43. package/dist/Components/PasswordInput.svelte +88 -88
  44. package/dist/Components/Portal.svelte +36 -36
  45. package/dist/Components/QuerySelect.svelte +366 -366
  46. package/dist/Components/SingleSelect.svelte +250 -250
  47. package/dist/Components/StepButton.svelte +70 -70
  48. package/dist/Components/StepForm.svelte +140 -140
  49. package/dist/Components/Switch.svelte +69 -69
  50. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +51 -51
  51. package/dist/Components/Table/Body/Rows/ColumnList.svelte +59 -59
  52. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -79
  53. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +120 -120
  54. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +105 -105
  55. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -87
  56. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +126 -126
  57. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -159
  58. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +246 -246
  59. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +216 -216
  60. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +179 -179
  61. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +197 -197
  62. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +190 -190
  63. package/dist/Components/Table/Body/Rows/TableRow.svelte +290 -290
  64. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -41
  65. package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -30
  66. package/dist/Components/Table/Misc/SidePanel.svelte +35 -35
  67. package/dist/Components/Table/Misc/ToolboxPanel.svelte +100 -100
  68. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -107
  69. package/dist/Components/TextArea.svelte +130 -130
  70. package/dist/Components/TextInput.svelte +176 -176
  71. package/dist/Components/ThreeStateRadio.svelte +131 -131
  72. package/dist/Components/Touch/BoolCard.svelte +45 -45
  73. package/dist/Components/Touch/DateModal.svelte +209 -209
  74. package/dist/Components/Touch/EditCard.svelte +59 -59
  75. package/dist/Components/Touch/InfoCard.svelte +31 -31
  76. package/dist/Components/Touch/InfoTextCard.svelte +28 -28
  77. package/dist/Components/Touch/ModalExplanation.svelte +17 -17
  78. package/dist/Components/Touch/NumberKeyboard.svelte +225 -225
  79. package/dist/Components/Touch/NumberModal.svelte +79 -79
  80. package/dist/Components/Touch/PlusMinusCard.svelte +46 -46
  81. package/dist/Components/Touch/SummaryCard.svelte +93 -93
  82. package/dist/Components/Touch/TextAreaModal.svelte +95 -95
  83. package/dist/Components/Touch/TextModal.svelte +106 -106
  84. package/dist/Components/Touch/TouchCard.svelte +33 -33
  85. package/dist/Components/Touch/TouchModal.svelte +274 -274
  86. package/dist/Components/Touch/UtilityButton.svelte +109 -109
  87. package/dist/Components/VerticalTabGroup.svelte +79 -79
  88. package/dist/Components/VerticalTabGroupButton.svelte +58 -58
  89. package/dist/Helpers/Datamatrix.d.ts +19 -19
  90. package/dist/Helpers/Datamatrix.js +291 -291
  91. package/dist/Types/Examples/ExampleModal.svelte +35 -35
  92. package/dist/scss/_motion.scss +57 -57
  93. package/dist/scss/_sizing.scss +85 -85
  94. package/package.json +30 -30
@@ -1,192 +1,192 @@
1
- <svelte:options runes />
2
-
3
- <script
4
- lang="ts"
5
- module
6
- >
7
- import Action from '../../../../Action.svelte';
8
- import type { IconProps } from '../../../../IconProps.js';
9
- import type { AbstractDisplayDef } from '../../../Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js';
10
- import { TableContext } from '../../../Types/Context/TableContext.svelte.js';
11
- import type { TableFocusDetails } from '../../../Types/Focus/TableFocusDetails.svelte.js';
12
- import { devCatch, isValidityTuple } from '../../../../../Helpers/Helpers.svelte.js';
13
- import { Colour, ColourSet } from '../../../../../scss/colours.js';
14
- import { Size } from '../../../../../Types/Internal/Size.js';
15
- import { Validity } from '../../../../../Types/Internal/Validity.js';
16
-
17
- const iconSets: Record<Validity, IconProps> = {
18
- [Validity.Invalid]: {
19
- name: 'circle-cross',
20
- colour: Colour['$error-border'],
21
- size: Size.Medium,
22
- },
23
- [Validity.Valid]: { name: 'circle-tick', colour: Colour['$brand-primary'], size: Size.Medium },
24
- [Validity.Info]: {
25
- name: 'circle-information',
26
- colour: Colour['$ui-blue-6'],
27
- size: Size.Medium,
28
- },
29
- [Validity.Warning]: {
30
- name: 'circle-exclamation',
31
- colour: Colour['$warning-border'],
32
- size: Size.Medium,
33
- },
34
- [Validity.Neutral]: { name: 'circle-minus', colour: Colour['$ui-blue-6'], size: Size.Medium },
35
- };
36
- </script>
37
-
38
- <script
39
- lang="ts"
40
- generics="T extends object, FilterValueType, RowIdType extends Primitive"
41
- >
42
- import { type Primitive } from '../../../Types/Context/TableInitOptions.js';
43
- import { getContext, tick } from 'svelte';
44
- import type { ValidityCellProps } from './ValidityCellProps.js';
45
-
46
- const { cell }: ValidityCellProps<T, FilterValueType> = $props();
47
-
48
- const tableContext = getContext<TableContext<T, RowIdType>>(TableContext.identifier);
49
-
50
- const ColumnDef = $derived(cell.column.columnDef as AbstractDisplayDef<T, FilterValueType>);
51
-
52
- const focusDetails: TableFocusDetails<T, RowIdType> = $derived(
53
- tableContext._focus.getFocusDetailsFor(cell)
54
- );
55
-
56
- let previousFocusElement: HTMLElement | undefined = $state();
57
- let showModal = $state(false);
58
-
59
- // Match the open-modal state by row-object identity and column id.
60
- // Identity-based comparison keeps the modal locked to the row it was
61
- // opened on even when pagination / sort / filter changes the visible
62
- // index of that row.
63
- $effect(() => {
64
- const target = tableContext.openModalCell;
65
- if (target !== null && target.row === cell.row.original && target.columnId === cell.column.id) {
66
- previousFocusElement = document.activeElement as HTMLElement | undefined;
67
- showModal = true;
68
- } else {
69
- showModal = false;
70
- }
71
- });
72
-
73
- let validity: Validity = $state(Validity.Valid);
74
- let reason = $state<string | undefined>();
75
-
76
- $effect(() => {
77
- const validityPromise = focusDetails.validity;
78
-
79
- validityPromise
80
- .then((v) => {
81
- if (!v) {
82
- validity = Validity.Neutral;
83
- reason = undefined;
84
- } else if (isValidityTuple(v)) {
85
- validity = v.value;
86
- reason = v.reason;
87
- } else {
88
- validity = v;
89
-
90
- reason = undefined;
91
- }
92
- })
93
- .catch(devCatch);
94
- });
95
-
96
- const thisId = $derived(
97
- `${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`
98
- );
99
-
100
- function onclose() {
101
- tableContext.setOpenModalCell(null);
102
-
103
- if (previousFocusElement?.id != thisId) {
104
- tick()
105
- .then(() => {
106
- previousFocusElement?.focus();
107
- })
108
- .catch(devCatch);
109
- }
110
- }
111
-
112
- const icon = $derived(iconSets[validity]);
113
- </script>
114
-
115
- <!-- svelte-ignore a11y_mouse_events_have_key_events -->
116
- <!-- svelte-ignore a11y_no_static_element_interactions -->
117
- <div
118
- class="focusable"
119
- onmousedown={(e) => {
120
- // start focus only on left click
121
- if (e.button === 0) {
122
- if (e.shiftKey) {
123
- e.preventDefault();
124
- tableContext.setFocusEnd(focusDetails.coordinates);
125
- } else {
126
- tableContext.startFocus(focusDetails.coordinates);
127
- }
128
- }
129
- }}
130
- onmouseover={() => {
131
- if (tableContext.isMousingDown) {
132
- tableContext.setFocusEnd(focusDetails.coordinates);
133
- }
134
- }}
135
- onmouseup={() => {
136
- tableContext.endFocus(focusDetails.coordinates);
137
- }}
138
- >
139
- <div
140
- class="slot-wrapper"
141
- class:multifocus={focusDetails.isMultiFocused}
142
- class:multifocus-start={focusDetails.isMultiFocusStart}
143
- >
144
- <Action
145
- id={thisId}
146
- style={focusDetails.outline}
147
- border={false}
148
- colourSet={ColourSet.Auxiliary}
149
- label={reason}
150
- size={Size.FillWidth}
151
- {icon}
152
- onclick={() => {
153
- if (ColumnDef.modal) {
154
- tableContext.setOpenModalCell({
155
- row: cell.row.original,
156
- columnId: cell.column.id,
157
- });
158
- }
159
- }}
160
- />
161
- </div>
162
- {#if showModal}
163
- <!--
164
- `ColumnDef.modal` is declared as
165
- `Component<DisplayModalProps<TRow>>` on the public column
166
- options, which exposes a stable `{ row, close }` prop
167
- shape. Cell renderers used to hand a legacy
168
- `{ cell, onclose, onsubmit }` triple here, which made the
169
- public type lie about the runtime shape - migrated to
170
- `{ row, close }` so consumer-authored modals can rely on
171
- the documented type.
172
-
173
- The dialog is NOT wrapped in `<Portal target={document.body}>`
174
- any more. `<dialog>` opened via `showModal()` enters the
175
- browser's top layer, so it already escapes overflow:hidden /
176
- sticky / transform ancestors without needing to be re-parented.
177
- Moving the `<div>` ancestor mid-mount (Portal's $effect runs
178
- during the same microtask round as BaseModal's `tick().then`
179
- `dialog.showModal()`) was popping the dialog out of the top
180
- layer and leaving it to render inline at the bottom of the
181
- page.
182
- -->
183
- <ColumnDef.modal
184
- row={cell.row.original}
185
- close={onclose}
186
- />
187
- {/if}
188
- </div>
189
-
1
+ <svelte:options runes />
2
+
3
+ <script
4
+ lang="ts"
5
+ module
6
+ >
7
+ import Action from '../../../../Action.svelte';
8
+ import type { IconProps } from '../../../../IconProps.js';
9
+ import type { AbstractDisplayDef } from '../../../Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js';
10
+ import { TableContext } from '../../../Types/Context/TableContext.svelte.js';
11
+ import type { TableFocusDetails } from '../../../Types/Focus/TableFocusDetails.svelte.js';
12
+ import { devCatch, isValidityTuple } from '../../../../../Helpers/Helpers.svelte.js';
13
+ import { Colour, ColourSet } from '../../../../../scss/colours.js';
14
+ import { Size } from '../../../../../Types/Internal/Size.js';
15
+ import { Validity } from '../../../../../Types/Internal/Validity.js';
16
+
17
+ const iconSets: Record<Validity, IconProps> = {
18
+ [Validity.Invalid]: {
19
+ name: 'circle-cross',
20
+ colour: Colour['$error-border'],
21
+ size: Size.Medium,
22
+ },
23
+ [Validity.Valid]: { name: 'circle-tick', colour: Colour['$brand-primary'], size: Size.Medium },
24
+ [Validity.Info]: {
25
+ name: 'circle-information',
26
+ colour: Colour['$ui-blue-6'],
27
+ size: Size.Medium,
28
+ },
29
+ [Validity.Warning]: {
30
+ name: 'circle-exclamation',
31
+ colour: Colour['$warning-border'],
32
+ size: Size.Medium,
33
+ },
34
+ [Validity.Neutral]: { name: 'circle-minus', colour: Colour['$ui-blue-6'], size: Size.Medium },
35
+ };
36
+ </script>
37
+
38
+ <script
39
+ lang="ts"
40
+ generics="T extends object, FilterValueType, RowIdType extends Primitive"
41
+ >
42
+ import { type Primitive } from '../../../Types/Context/TableInitOptions.js';
43
+ import { getContext, tick } from 'svelte';
44
+ import type { ValidityCellProps } from './ValidityCellProps.js';
45
+
46
+ const { cell }: ValidityCellProps<T, FilterValueType> = $props();
47
+
48
+ const tableContext = getContext<TableContext<T, RowIdType>>(TableContext.identifier);
49
+
50
+ const ColumnDef = $derived(cell.column.columnDef as AbstractDisplayDef<T, FilterValueType>);
51
+
52
+ const focusDetails: TableFocusDetails<T, RowIdType> = $derived(
53
+ tableContext._focus.getFocusDetailsFor(cell)
54
+ );
55
+
56
+ let previousFocusElement: HTMLElement | undefined = $state();
57
+ let showModal = $state(false);
58
+
59
+ // Match the open-modal state by row-object identity and column id.
60
+ // Identity-based comparison keeps the modal locked to the row it was
61
+ // opened on even when pagination / sort / filter changes the visible
62
+ // index of that row.
63
+ $effect(() => {
64
+ const target = tableContext.openModalCell;
65
+ if (target !== null && target.row === cell.row.original && target.columnId === cell.column.id) {
66
+ previousFocusElement = document.activeElement as HTMLElement | undefined;
67
+ showModal = true;
68
+ } else {
69
+ showModal = false;
70
+ }
71
+ });
72
+
73
+ let validity: Validity = $state(Validity.Valid);
74
+ let reason = $state<string | undefined>();
75
+
76
+ $effect(() => {
77
+ const validityPromise = focusDetails.validity;
78
+
79
+ validityPromise
80
+ .then((v) => {
81
+ if (!v) {
82
+ validity = Validity.Neutral;
83
+ reason = undefined;
84
+ } else if (isValidityTuple(v)) {
85
+ validity = v.value;
86
+ reason = v.reason;
87
+ } else {
88
+ validity = v;
89
+
90
+ reason = undefined;
91
+ }
92
+ })
93
+ .catch(devCatch);
94
+ });
95
+
96
+ const thisId = $derived(
97
+ `${tableContext.tableName}-cell-${cell.row.visibleIndex}-${cell.column.id}`
98
+ );
99
+
100
+ function onclose() {
101
+ tableContext.setOpenModalCell(null);
102
+
103
+ if (previousFocusElement?.id != thisId) {
104
+ tick()
105
+ .then(() => {
106
+ previousFocusElement?.focus();
107
+ })
108
+ .catch(devCatch);
109
+ }
110
+ }
111
+
112
+ const icon = $derived(iconSets[validity]);
113
+ </script>
114
+
115
+ <!-- svelte-ignore a11y_mouse_events_have_key_events -->
116
+ <!-- svelte-ignore a11y_no_static_element_interactions -->
117
+ <div
118
+ class="focusable"
119
+ onmousedown={(e) => {
120
+ // start focus only on left click
121
+ if (e.button === 0) {
122
+ if (e.shiftKey) {
123
+ e.preventDefault();
124
+ tableContext.setFocusEnd(focusDetails.coordinates);
125
+ } else {
126
+ tableContext.startFocus(focusDetails.coordinates);
127
+ }
128
+ }
129
+ }}
130
+ onmouseover={() => {
131
+ if (tableContext.isMousingDown) {
132
+ tableContext.setFocusEnd(focusDetails.coordinates);
133
+ }
134
+ }}
135
+ onmouseup={() => {
136
+ tableContext.endFocus(focusDetails.coordinates);
137
+ }}
138
+ >
139
+ <div
140
+ class="slot-wrapper"
141
+ class:multifocus={focusDetails.isMultiFocused}
142
+ class:multifocus-start={focusDetails.isMultiFocusStart}
143
+ >
144
+ <Action
145
+ id={thisId}
146
+ style={focusDetails.outline}
147
+ border={false}
148
+ colourSet={ColourSet.Auxiliary}
149
+ label={reason}
150
+ size={Size.FillWidth}
151
+ {icon}
152
+ onclick={() => {
153
+ if (ColumnDef.modal) {
154
+ tableContext.setOpenModalCell({
155
+ row: cell.row.original,
156
+ columnId: cell.column.id,
157
+ });
158
+ }
159
+ }}
160
+ />
161
+ </div>
162
+ {#if showModal}
163
+ <!--
164
+ `ColumnDef.modal` is declared as
165
+ `Component<DisplayModalProps<TRow>>` on the public column
166
+ options, which exposes a stable `{ row, close }` prop
167
+ shape. Cell renderers used to hand a legacy
168
+ `{ cell, onclose, onsubmit }` triple here, which made the
169
+ public type lie about the runtime shape - migrated to
170
+ `{ row, close }` so consumer-authored modals can rely on
171
+ the documented type.
172
+
173
+ The dialog is NOT wrapped in `<Portal target={document.body}>`
174
+ any more. `<dialog>` opened via `showModal()` enters the
175
+ browser's top layer, so it already escapes overflow:hidden /
176
+ sticky / transform ancestors without needing to be re-parented.
177
+ Moving the `<div>` ancestor mid-mount (Portal's $effect runs
178
+ during the same microtask round as BaseModal's `tick().then`
179
+ `dialog.showModal()`) was popping the dialog out of the top
180
+ layer and leaving it to render inline at the bottom of the
181
+ page.
182
+ -->
183
+ <ColumnDef.modal
184
+ row={cell.row.original}
185
+ close={onclose}
186
+ />
187
+ {/if}
188
+ </div>
189
+
190
190
  <style>.focusable,
191
191
  .checkbox-cell,
192
192
  .input-cell,
@@ -245,4 +245,4 @@ div.slot-wrapper {
245
245
  display: flex;
246
246
  align-items: center;
247
247
  justify-content: center;
248
- }</style>
248
+ }</style>