@lavalogic/scoria 0.37.44 → 0.37.45

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 (237) hide show
  1. package/README.md +58 -58
  2. package/dist/Components/AccordionGroup.svelte +46 -46
  3. package/dist/Components/AccordionGroupButton.svelte +76 -76
  4. package/dist/Components/Action.svelte +136 -136
  5. package/dist/Components/ActionProps.d.ts +2 -6
  6. package/dist/Components/AlertModal.svelte +195 -183
  7. package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +702 -702
  8. package/dist/Components/Base/BaseModal.svelte +125 -125
  9. package/dist/Components/Base/ContextWrapper.svelte +72 -72
  10. package/dist/Components/Base/Pagination.svelte +198 -198
  11. package/dist/Components/Base/Snippets.svelte +36 -36
  12. package/dist/Components/BigRadioSet.svelte +38 -38
  13. package/dist/Components/Bubble.svelte +101 -101
  14. package/dist/Components/Button.svelte +209 -209
  15. package/dist/Components/ButtonProps.d.ts +2 -6
  16. package/dist/Components/Checkbox.svelte +86 -86
  17. package/dist/Components/CollapsibleCard.svelte +78 -78
  18. package/dist/Components/Contexts/ContextMenu.svelte +164 -164
  19. package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
  20. package/dist/Components/Contexts/ContextMenuOption.svelte +60 -60
  21. package/dist/Components/Contexts/Toast.svelte +83 -83
  22. package/dist/Components/Contexts/ToastContainer.svelte +65 -65
  23. package/dist/Components/Contexts/Tooltip.svelte +37 -37
  24. package/dist/Components/DataMatrixIcon.svelte +112 -112
  25. package/dist/Components/DataMatrixIconProps.d.ts +3 -13
  26. package/dist/Components/DateInput.svelte +148 -148
  27. package/dist/Components/DatePicker.svelte +300 -300
  28. package/dist/Components/DesktopModal.svelte +90 -90
  29. package/dist/Components/Dial.svelte +204 -204
  30. package/dist/Components/DialProps.d.ts +1 -18
  31. package/dist/Components/DimensionInput.svelte +170 -170
  32. package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -119
  33. package/dist/Components/DragMenu/DraggableCard.svelte +77 -77
  34. package/dist/Components/FileCard.svelte +24 -24
  35. package/dist/Components/FileUpload.svelte +236 -236
  36. package/dist/Components/GridInput.svelte +196 -200
  37. package/dist/Components/GridInputSet.svelte +29 -29
  38. package/dist/Components/HorizontalTabGroup.svelte +82 -82
  39. package/dist/Components/HorizontalTabGroupButton.svelte +44 -44
  40. package/dist/Components/Icon.svelte +128 -128
  41. package/dist/Components/IconProps.d.ts +2 -7
  42. package/dist/Components/Icons.js +357 -357
  43. package/dist/Components/LoadingAnimation.svelte +29 -29
  44. package/dist/Components/LoadingModal.svelte +45 -45
  45. package/dist/Components/LoadingOverlay.svelte +25 -25
  46. package/dist/Components/LoadingOverlayProps.d.ts +3 -7
  47. package/dist/Components/Modal.svelte +258 -258
  48. package/dist/Components/ModalProps.d.ts +0 -3
  49. package/dist/Components/MultiSelect.svelte +220 -220
  50. package/dist/Components/MultiSelectCommonProps.d.ts +6 -17
  51. package/dist/Components/Nav/Nav.svelte +99 -99
  52. package/dist/Components/Nav/NavProps.d.ts +4 -11
  53. package/dist/Components/Nav/NavServiceMenuList.svelte +43 -43
  54. package/dist/Components/Nav/NavTab.svelte +62 -62
  55. package/dist/Components/Nav/ServiceMenuItem.svelte +100 -100
  56. package/dist/Components/Nav/ServicesNav.svelte +80 -80
  57. package/dist/Components/NumberInput.svelte +157 -157
  58. package/dist/Components/PageHeading.svelte +25 -25
  59. package/dist/Components/PasswordInput.svelte +88 -88
  60. package/dist/Components/Portal.svelte +36 -36
  61. package/dist/Components/ProgressBubble.svelte +107 -108
  62. package/dist/Components/ProgressBubbleProps.d.ts +3 -3
  63. package/dist/Components/QuerySelect.svelte +366 -366
  64. package/dist/Components/QuerySelectProps.d.ts +4 -14
  65. package/dist/Components/SingleSelect.svelte +250 -250
  66. package/dist/Components/SingleSelectCommonProps.d.ts +3 -19
  67. package/dist/Components/StepButton.svelte +70 -70
  68. package/dist/Components/StepForm.svelte +140 -140
  69. package/dist/Components/Switch.svelte +69 -69
  70. package/dist/Components/Table/ARCHITECTURE.md +298 -0
  71. package/dist/Components/Table/Body/QuickSearchCell.svelte +679 -694
  72. package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +51 -51
  73. package/dist/Components/Table/Body/Rows/ColumnList.svelte +59 -59
  74. package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +456 -478
  75. package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -79
  76. package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +185 -188
  77. package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +124 -124
  78. package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +120 -120
  79. package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +230 -230
  80. package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +105 -105
  81. package/dist/Components/Table/Body/Rows/Columns/SelectColumn.d.ts +12 -9
  82. package/dist/Components/Table/Body/Rows/Columns/SelectTableCell.d.ts +5 -5
  83. package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -87
  84. package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +126 -126
  85. package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -159
  86. package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +246 -246
  87. package/dist/Components/Table/Body/Rows/Columns/TableDatePickerProps.d.ts +4 -4
  88. package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +216 -216
  89. package/dist/Components/Table/Body/Rows/Columns/TableQueryCell.d.ts +6 -5
  90. package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.d.ts +7 -6
  91. package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +252 -257
  92. package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +179 -179
  93. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +221 -229
  94. package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte.d.ts +11 -11
  95. package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +197 -197
  96. package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +190 -190
  97. package/dist/Components/Table/Body/Rows/TableRow.svelte +290 -290
  98. package/dist/Components/Table/Body/TableBody.svelte +155 -155
  99. package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +2 -3
  100. package/dist/Components/Table/ColumnFactory.svelte.d.ts +9 -11
  101. package/dist/Components/Table/ColumnFactory.svelte.js +101 -118
  102. package/dist/Components/Table/ColumnKindRegistry.d.ts +112 -0
  103. package/dist/Components/Table/ColumnKindRegistry.js +63 -0
  104. package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -41
  105. package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -30
  106. package/dist/Components/Table/Headers/TableHead.svelte +415 -413
  107. package/dist/Components/Table/Misc/ColumnPanel.svelte +94 -94
  108. package/dist/Components/Table/Misc/ColumnPanelModal.svelte +112 -112
  109. package/dist/Components/Table/Misc/FilterInput.svelte +620 -644
  110. package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +12 -12
  111. package/dist/Components/Table/Misc/FilterInputProps.d.ts +2 -2
  112. package/dist/Components/Table/Misc/FilterPanel.svelte +257 -257
  113. package/dist/Components/Table/Misc/FilterPanelModal.svelte +30 -30
  114. package/dist/Components/Table/Misc/SidePanel.svelte +35 -35
  115. package/dist/Components/Table/Misc/TableFooter.svelte +311 -311
  116. package/dist/Components/Table/Misc/TableHorizontalBar.svelte +125 -125
  117. package/dist/Components/Table/Misc/TableSidebar.svelte +157 -157
  118. package/dist/Components/Table/Misc/ToolboxPanel.svelte +100 -100
  119. package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -107
  120. package/dist/Components/Table/NestedTable.svelte +130 -133
  121. package/dist/Components/Table/SubApis.svelte.d.ts +1 -5
  122. package/dist/Components/Table/SubApis.svelte.js +33 -32
  123. package/dist/Components/Table/Table.svelte +692 -745
  124. package/dist/Components/Table/TableHelpers.svelte.d.ts +6 -19
  125. package/dist/Components/Table/TableHelpers.svelte.js +6 -14
  126. package/dist/Components/Table/Types/Columns/Column.d.ts +2 -2
  127. package/dist/Components/Table/Types/Columns/DateColumn.d.ts +3 -3
  128. package/dist/Components/Table/Types/Columns/DateTableCell.d.ts +7 -7
  129. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +7 -8
  130. package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.js +4 -5
  131. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +11 -14
  132. package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.js +3 -4
  133. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.d.ts +7 -11
  134. package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.js +3 -3
  135. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts +13 -18
  136. package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.js +4 -5
  137. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.d.ts +5 -5
  138. package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.js +2 -2
  139. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.d.ts +15 -12
  140. package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.js +4 -5
  141. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +8 -12
  142. package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.js +3 -3
  143. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +6 -6
  144. package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js +3 -3
  145. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +49 -16
  146. package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +27 -5
  147. package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +7 -7
  148. package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +4 -4
  149. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +5 -5
  150. package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js +2 -2
  151. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +5 -5
  152. package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js +2 -2
  153. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +5 -5
  154. package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js +2 -2
  155. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +5 -5
  156. package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.js +2 -2
  157. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +11 -19
  158. package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.js +4 -8
  159. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +6 -7
  160. package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.js +3 -4
  161. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +9 -9
  162. package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js +4 -4
  163. package/dist/Components/Table/Types/Columns/ExpandTableCell.d.ts +5 -5
  164. package/dist/Components/Table/Types/Columns/ProgressBarTableCell.d.ts +6 -6
  165. package/dist/Components/Table/Types/Columns/TableCell.d.ts +7 -6
  166. package/dist/Components/Table/Types/Context/ClipboardState.svelte.d.ts +98 -0
  167. package/dist/Components/Table/Types/Context/ClipboardState.svelte.js +290 -0
  168. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.d.ts +17 -45
  169. package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.js +17 -45
  170. package/dist/Components/Table/Types/Context/FilteringState.svelte.d.ts +9 -20
  171. package/dist/Components/Table/Types/Context/FilteringState.svelte.js +9 -20
  172. package/dist/Components/Table/Types/Context/FocusState.svelte.d.ts +23 -42
  173. package/dist/Components/Table/Types/Context/FocusState.svelte.js +32 -59
  174. package/dist/Components/Table/Types/Context/ITable.d.ts +5 -8
  175. package/dist/Components/Table/Types/Context/PreferencesState.svelte.d.ts +29 -56
  176. package/dist/Components/Table/Types/Context/PreferencesState.svelte.js +28 -55
  177. package/dist/Components/Table/Types/Context/QueryValuesState.svelte.d.ts +50 -0
  178. package/dist/Components/Table/Types/Context/QueryValuesState.svelte.js +62 -0
  179. package/dist/Components/Table/Types/Context/SelectionState.svelte.d.ts +17 -28
  180. package/dist/Components/Table/Types/Context/SelectionState.svelte.js +17 -28
  181. package/dist/Components/Table/Types/Context/SortingState.svelte.d.ts +15 -29
  182. package/dist/Components/Table/Types/Context/SortingState.svelte.js +17 -31
  183. package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +212 -325
  184. package/dist/Components/Table/Types/Context/TableContext.svelte.js +292 -706
  185. package/dist/Components/Table/Types/Context/VirtualisationState.svelte.d.ts +62 -79
  186. package/dist/Components/Table/Types/Context/VirtualisationState.svelte.js +54 -73
  187. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.d.ts +16 -27
  188. package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.js +16 -27
  189. package/dist/Components/Table/Types/DataRepository/IDataRepository.d.ts +12 -15
  190. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.d.ts +15 -30
  191. package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +16 -28
  192. package/dist/Components/Table/Types/Header.d.ts +4 -4
  193. package/dist/Components/Table/Types/HeaderGroup.d.ts +5 -5
  194. package/dist/Components/Table/Types/Public/index.d.ts +2 -4
  195. package/dist/Components/Table/Types/Public/index.js +2 -4
  196. package/dist/Components/Table/clipboardEscape.d.ts +32 -0
  197. package/dist/Components/Table/clipboardEscape.js +45 -0
  198. package/dist/Components/Table/createTable.svelte.d.ts +8 -18
  199. package/dist/Components/Table/createTable.svelte.js +19 -47
  200. package/dist/Components/Test/TestContextConsumer.svelte +13 -13
  201. package/dist/Components/TextArea.svelte +130 -130
  202. package/dist/Components/TextInput.svelte +176 -176
  203. package/dist/Components/ThreeStateRadio.svelte +131 -131
  204. package/dist/Components/Touch/BoolCard.svelte +45 -45
  205. package/dist/Components/Touch/DateModal.svelte +209 -209
  206. package/dist/Components/Touch/EditCard.svelte +59 -59
  207. package/dist/Components/Touch/InfoCard.svelte +31 -31
  208. package/dist/Components/Touch/InfoTextCard.svelte +28 -28
  209. package/dist/Components/Touch/ModalExplanation.svelte +17 -17
  210. package/dist/Components/Touch/NumberKeyboard.svelte +225 -225
  211. package/dist/Components/Touch/NumberModal.svelte +79 -79
  212. package/dist/Components/Touch/PlusMinusCard.svelte +46 -46
  213. package/dist/Components/Touch/SelectModal.svelte +123 -123
  214. package/dist/Components/Touch/SummaryCard.svelte +93 -93
  215. package/dist/Components/Touch/TextAreaModal.svelte +95 -95
  216. package/dist/Components/Touch/TextModal.svelte +106 -106
  217. package/dist/Components/Touch/TouchCard.svelte +33 -33
  218. package/dist/Components/Touch/TouchModal.svelte +274 -274
  219. package/dist/Components/Touch/UtilityButton.svelte +109 -109
  220. package/dist/Components/VerticalTabGroup.svelte +79 -79
  221. package/dist/Components/VerticalTabGroupButton.svelte +58 -58
  222. package/dist/Contexts/ToastContext.svelte.js +3 -4
  223. package/dist/Helpers/Datamatrix.d.ts +19 -19
  224. package/dist/Helpers/Datamatrix.js +291 -291
  225. package/dist/Helpers/Helpers.svelte.d.ts +2 -4
  226. package/dist/Helpers/Helpers.svelte.js +2 -4
  227. package/dist/Helpers/dropdownPortal.d.ts +26 -41
  228. package/dist/Helpers/dropdownPortal.js +62 -116
  229. package/dist/Types/Examples/ExampleModal.svelte +35 -35
  230. package/dist/index.d.ts +0 -1
  231. package/dist/scss/_basics.scss +12 -12
  232. package/dist/scss/_colours.scss +134 -134
  233. package/dist/scss/_mixins.scss +3348 -3360
  234. package/dist/scss/_motion.scss +57 -57
  235. package/dist/scss/_sizing.scss +85 -85
  236. package/dist/scss/_transitions.scss +8 -8
  237. package/package.json +2 -1
@@ -1,50 +1,35 @@
1
1
  /**
2
2
  * Portal helper for Svelecte-style dropdowns.
3
3
  *
4
- * Svelecte renders its `.sv_dropdown` element inline as a sibling of the
5
- * `.svelecte-control` trigger. That means the dropdown is clipped by
6
- * any ancestor with `overflow: hidden` / `overflow: auto`, sits below
7
- * any ancestor with a higher `z-index`, and is repositioned by any
8
- * `transform` / `filter` / `will-change: transform` on the way up to
9
- * the body.
4
+ * Svelecte renders its `.sv_dropdown` inline as a sibling of the
5
+ * `.svelecte-control` trigger, so the dropdown is clipped by ancestor
6
+ * overflow, sits below higher-z-index ancestors, and is repositioned by
7
+ * any `transform` / `filter` on the way up to the body. This helper fixes
8
+ * those without moving the element in the DOM.
10
9
  *
11
- * This helper does NOT move the dropdown in the DOM. Moving the
12
- * `.sv_dropdown` element to `document.body` (the original strategy)
13
- * broke Svelte 5's per-component event delegation: inline
14
- * `onmousedown` / `onclick` handlers declared in Svelecte's template
15
- * are dispatched by the app's root-level delegated listener, which
16
- * walks the live `parentNode` chain at dispatch time. Once the
17
- * dropdown was a sibling of the app root rather than a descendant,
18
- * the chain no longer reached the selection handler, so mouse clicks
19
- * silently did nothing (keyboard Enter still worked because that
20
- * path is wired on the input, not the dropdown).
10
+ * **Do NOT move the dropdown to `document.body`.** Svelte 5's root-level
11
+ * event delegation walks the live `parentNode` chain at dispatch time;
12
+ * if the dropdown is a sibling of the app root rather than a descendant
13
+ * of the mount target, Svelecte's inline `onmousedown` / `onclick` selection
14
+ * handlers never fire. Mouse selection silently breaks while keyboard Enter
15
+ * (wired on the input) keeps working, making the regression hard to spot.
21
16
  *
22
- * Instead, the helper:
17
+ * Instead, when the dropdown opens this helper:
23
18
  *
24
- * 1. Switches the dropdown to `position: fixed` and sets
25
- * `top` / `left` / `width` / `bottom` from the trigger's
26
- * `getBoundingClientRect()`, so it escapes ancestor
27
- * `overflow: hidden` / `overflow: auto` clipping (which was
28
- * the original motivation for portaling).
29
- * 2. Picks `top` vs `bottom` based on available space below vs
30
- * above the trigger, so the dropdown auto-flips upwards when
31
- * the trigger sits near the bottom of the viewport.
32
- * 3. Listens for capture-phase `scroll` events and for viewport
33
- * `resize` events so the position tracks the trigger while
34
- * the dropdown is open. Repositioning is rAF-throttled.
35
- * 4. Applies a very large `z-index` to the dropdown AND
36
- * temporarily lifts the dropdown's nearest stacking-context
37
- * ancestor (the sticky / isolated table strip that contains
38
- * the trigger) so the dropdown's z-index can actually win
39
- * against other peer stacking contexts in the same parent.
40
- * Without the lift the dropdown's z-index was trapped inside
41
- * its ancestor's own context and could be hidden by an
42
- * adjacent sibling stacking context with even a small
43
- * z-index - which is exactly what happened with the table's
44
- * sticky footer covering open cell dropdowns (or, after the
45
- * initial fix, the table body covering open footer
46
- * dropdowns). The lift is ref-counted so two dropdowns that
47
- * share an ancestor coordinate cleanly.
19
+ * 1. Switches it to `position: fixed` and writes `top` / `left` / `width`
20
+ * from the trigger's `getBoundingClientRect()`, escaping ancestor
21
+ * overflow clipping.
22
+ * 2. Picks `top` vs `bottom` based on available viewport space, so the
23
+ * dropdown flips upwards near the viewport bottom.
24
+ * 3. Listens (rAF-throttled) for capture-phase scroll + viewport resize
25
+ * so the position tracks the trigger.
26
+ * 4. Sets a very large `z-index` on the dropdown AND lifts the dropdown's
27
+ * nearest stacking-context ancestor for the lifetime of the open. The
28
+ * lift is needed because z-index only competes inside the ancestor's
29
+ * own stacking context: without it, a sibling sticky/isolated block
30
+ * (the table footer, the table body) can paint over the dropdown
31
+ * despite the dropdown's higher z-index. The lift is ref-counted so
32
+ * two dropdowns sharing an ancestor coordinate cleanly.
48
33
  */
49
34
  export interface DropdownPortalOptions {
50
35
  /** The Svelecte root wrapper `<div class="svelecte">`. Used as the
@@ -1,84 +1,53 @@
1
1
  /**
2
2
  * Portal helper for Svelecte-style dropdowns.
3
3
  *
4
- * Svelecte renders its `.sv_dropdown` element inline as a sibling of the
5
- * `.svelecte-control` trigger. That means the dropdown is clipped by
6
- * any ancestor with `overflow: hidden` / `overflow: auto`, sits below
7
- * any ancestor with a higher `z-index`, and is repositioned by any
8
- * `transform` / `filter` / `will-change: transform` on the way up to
9
- * the body.
4
+ * Svelecte renders its `.sv_dropdown` inline as a sibling of the
5
+ * `.svelecte-control` trigger, so the dropdown is clipped by ancestor
6
+ * overflow, sits below higher-z-index ancestors, and is repositioned by
7
+ * any `transform` / `filter` on the way up to the body. This helper fixes
8
+ * those without moving the element in the DOM.
10
9
  *
11
- * This helper does NOT move the dropdown in the DOM. Moving the
12
- * `.sv_dropdown` element to `document.body` (the original strategy)
13
- * broke Svelte 5's per-component event delegation: inline
14
- * `onmousedown` / `onclick` handlers declared in Svelecte's template
15
- * are dispatched by the app's root-level delegated listener, which
16
- * walks the live `parentNode` chain at dispatch time. Once the
17
- * dropdown was a sibling of the app root rather than a descendant,
18
- * the chain no longer reached the selection handler, so mouse clicks
19
- * silently did nothing (keyboard Enter still worked because that
20
- * path is wired on the input, not the dropdown).
10
+ * **Do NOT move the dropdown to `document.body`.** Svelte 5's root-level
11
+ * event delegation walks the live `parentNode` chain at dispatch time;
12
+ * if the dropdown is a sibling of the app root rather than a descendant
13
+ * of the mount target, Svelecte's inline `onmousedown` / `onclick` selection
14
+ * handlers never fire. Mouse selection silently breaks while keyboard Enter
15
+ * (wired on the input) keeps working, making the regression hard to spot.
21
16
  *
22
- * Instead, the helper:
17
+ * Instead, when the dropdown opens this helper:
23
18
  *
24
- * 1. Switches the dropdown to `position: fixed` and sets
25
- * `top` / `left` / `width` / `bottom` from the trigger's
26
- * `getBoundingClientRect()`, so it escapes ancestor
27
- * `overflow: hidden` / `overflow: auto` clipping (which was
28
- * the original motivation for portaling).
29
- * 2. Picks `top` vs `bottom` based on available space below vs
30
- * above the trigger, so the dropdown auto-flips upwards when
31
- * the trigger sits near the bottom of the viewport.
32
- * 3. Listens for capture-phase `scroll` events and for viewport
33
- * `resize` events so the position tracks the trigger while
34
- * the dropdown is open. Repositioning is rAF-throttled.
35
- * 4. Applies a very large `z-index` to the dropdown AND
36
- * temporarily lifts the dropdown's nearest stacking-context
37
- * ancestor (the sticky / isolated table strip that contains
38
- * the trigger) so the dropdown's z-index can actually win
39
- * against other peer stacking contexts in the same parent.
40
- * Without the lift the dropdown's z-index was trapped inside
41
- * its ancestor's own context and could be hidden by an
42
- * adjacent sibling stacking context with even a small
43
- * z-index - which is exactly what happened with the table's
44
- * sticky footer covering open cell dropdowns (or, after the
45
- * initial fix, the table body covering open footer
46
- * dropdowns). The lift is ref-counted so two dropdowns that
47
- * share an ancestor coordinate cleanly.
19
+ * 1. Switches it to `position: fixed` and writes `top` / `left` / `width`
20
+ * from the trigger's `getBoundingClientRect()`, escaping ancestor
21
+ * overflow clipping.
22
+ * 2. Picks `top` vs `bottom` based on available viewport space, so the
23
+ * dropdown flips upwards near the viewport bottom.
24
+ * 3. Listens (rAF-throttled) for capture-phase scroll + viewport resize
25
+ * so the position tracks the trigger.
26
+ * 4. Sets a very large `z-index` on the dropdown AND lifts the dropdown's
27
+ * nearest stacking-context ancestor for the lifetime of the open. The
28
+ * lift is needed because z-index only competes inside the ancestor's
29
+ * own stacking context: without it, a sibling sticky/isolated block
30
+ * (the table footer, the table body) can paint over the dropdown
31
+ * despite the dropdown's higher z-index. The lift is ref-counted so
32
+ * two dropdowns sharing an ancestor coordinate cleanly.
48
33
  */
49
34
  /**
50
- * Z-index applied to the open dropdown. Picked very high so the
51
- * dropdown sits above sticky table strips (`z 5-11` in the table
52
- * grid), the table footer (`z 10`), and the side-panel chrome, but
53
- * stays below modal overlays (`z 99999` in `Action`-based popovers).
35
+ * Z-index for the open dropdown. Above sticky table strips and the table
36
+ * footer, below modal overlays (`Action`-based popovers use `99999`).
54
37
  */
55
38
  const PORTAL_Z_INDEX = 99998;
56
39
  /**
57
- * Z-index applied to the dropdown's nearest stacking-context ancestor
58
- * while the dropdown is open. One below `PORTAL_Z_INDEX` so the
59
- * dropdown still wins inside its own stacking context, but high
60
- * enough that the whole ancestor block paints above its peer stacking
61
- * contexts (e.g. the table footer's `position: sticky; z-index: 10`
62
- * row, or the table body's `isolation: isolate; z-index: 20`
63
- * container). Without this lift, the dropdown's `z-index: 99998` was
64
- * trapped inside the ancestor's own stacking context and could not
65
- * paint above a sibling stacking context with even a small z-index.
66
- *
67
- * The previous workaround pinned `.datatable-grid` at `z-index: 20`
68
- * so its cell dropdowns sat above the footer; that fixed the cell
69
- * case but reversed the failure for the footer's `Records-per-Page`
70
- * select, whose dropdown opens upwards into the rows. Lifting the
71
- * dropdown's actual ancestor at open time means both cases work
72
- * without either side needing a hard-coded z-index bias.
40
+ * Z-index applied to the dropdown's stacking-context ancestor while open.
41
+ * One below `PORTAL_Z_INDEX` so the dropdown still wins inside its own
42
+ * context, but high enough that the ancestor block paints above sibling
43
+ * stacking contexts (e.g. the sticky footer at `z-index: 10`, the body's
44
+ * `isolation: isolate` container).
73
45
  */
74
46
  const STACKING_LIFT_Z_INDEX = 99997;
75
47
  /**
76
- * Walk up the DOM from `el` and return the first ancestor that
77
- * establishes a new CSS stacking context. The dropdown's z-index
78
- * only competes inside this ancestor's context, so lifting this
79
- * element is what determines whether the dropdown can paint above a
80
- * sibling sticky / isolated block. Stops at `document.body` (which
81
- * doesn't form a useful pivot for the lift).
48
+ * Walk up from `el` and return the first ancestor that establishes a new
49
+ * CSS stacking context. The dropdown's z-index only competes inside this
50
+ * ancestor's context, so this is the element to lift. Stops at `body`.
82
51
  */
83
52
  function findStackingContextAncestor(el) {
84
53
  let current = el.parentElement;
@@ -91,11 +60,10 @@ function findStackingContextAncestor(el) {
91
60
  return null;
92
61
  }
93
62
  /**
94
- * True when the computed style of `el` causes the browser to
95
- * establish a new stacking context. Covers the cases that actually
96
- * appear in scoria today (sticky / isolated table strips, fixed
97
- * popover ancestors). Not exhaustive against every CSS feature that
98
- * triggers a stacking context, but tuned for our tree.
63
+ * True when the computed style of `el` establishes a new stacking context.
64
+ * Covers the cases scoria's tree actually produces (sticky / isolated
65
+ * strips, fixed popover ancestors). Not exhaustive against every CSS
66
+ * feature that triggers one extend if a new case surfaces.
99
67
  */
100
68
  function createsStackingContext(el) {
101
69
  const cs = getComputedStyle(el);
@@ -156,24 +124,19 @@ function liftStackingContext(el) {
156
124
  };
157
125
  }
158
126
  /**
159
- * Minimum free vertical space below the trigger before the dropdown
160
- * is flipped to open upwards. Picked to fit the default Svelecte
161
- * dropdown (six rows + search input + padding) plus a little air;
162
- * dropdowns with longer option lists will still scroll internally
163
- * inside their fixed-height box.
127
+ * Minimum free space below the trigger before the dropdown flips upwards.
128
+ * Sized for the default Svelecte dropdown (six rows + search + padding);
129
+ * longer lists scroll internally.
164
130
  */
165
131
  const FLIP_THRESHOLD_PX = 240;
166
132
  /**
167
- * Hard cap on the dropdown's open height, regardless of how much
168
- * vertical space the trigger leaves between itself and the viewport
169
- * edge. Matches Svelecte's own `--sv-dropdown-height` default (320px)
170
- * so a typical dropdown opens at a sensible "six rows plus search
171
- * input" size and only shrinks below that when the trigger is genuinely
172
- * close to the viewport edge.
133
+ * Cap on the dropdown's open height. Matches Svelecte's own
134
+ * `--sv-dropdown-height` default so typical dropdowns open at six rows plus
135
+ * search input and only shrink when the trigger is near a viewport edge.
173
136
  */
174
137
  const MAX_DROPDOWN_HEIGHT_PX = 320;
175
- /** Run a function on the next animation frame, coalescing repeat
176
- * calls so we don't queue dozens of layout reads per scroll burst. */
138
+ /** Run a function on the next animation frame, coalescing repeat calls so
139
+ * we don't queue dozens of layout reads per scroll burst. */
177
140
  function rafThrottle(fn) {
178
141
  let handle = null;
179
142
  return {
@@ -233,13 +196,10 @@ export function attachDropdownPortal(options) {
233
196
  dropdown.style.minWidth = `${tr.width}px`;
234
197
  dropdown.style.maxWidth = `${tr.width}px`;
235
198
  dropdown.style.zIndex = String(PORTAL_Z_INDEX);
236
- // Cap the dropdown height at `MAX_DROPDOWN_HEIGHT_PX` regardless
237
- // of how much space the trigger has below / above it - we never
238
- // want the dropdown to be as tall as the viewport just because
239
- // the option list could fit. The `Math.max(..., 64)` floor
240
- // stops the dropdown from collapsing to a single-row sliver
241
- // when the trigger is genuinely pinned against the viewport
242
- // edge; the inner scroll handles the rest.
199
+ // Cap at `MAX_DROPDOWN_HEIGHT_PX` so a long option list never paints
200
+ // at viewport height. The 64px floor keeps the dropdown legible when
201
+ // the trigger is pinned against a viewport edge; the inner scroll
202
+ // handles the rest.
243
203
  const availableHeightPx = openUp
244
204
  ? Math.min(MAX_DROPDOWN_HEIGHT_PX, Math.max(spaceAbove - 8, 64))
245
205
  : Math.min(MAX_DROPDOWN_HEIGHT_PX, Math.max(spaceBelow - 8, 64));
@@ -252,22 +212,11 @@ export function attachDropdownPortal(options) {
252
212
  dropdown.style.bottom = '';
253
213
  }
254
214
  dropdown.style.maxHeight = `${availableHeightPx}px`;
255
- // Svelecte's inner `.sv-dropdown-scroll` element has its own
256
- // `max-height: var(--sv-dropdown-height, 320px); overflow-y:
257
- // auto` rule, AND the outer `.sv_dropdown` element has
258
- // `overflow-y: auto` by default. When the trigger is near the
259
- // viewport edge our outer `max-height` is forced below 320px,
260
- // so both ended up with their own scrollbars (the visible "two
261
- // scrollbars stacked" symptom). Two complementary fixes:
262
- // 1. Override `--sv-dropdown-height` to match the outer's
263
- // max-height so the inner scroll container shrinks in
264
- // lockstep instead of staying at its 320px default.
265
- // 2. Force the outer to `overflow: hidden` so even if the
266
- // inner's actual rendered height nudges a pixel or two
267
- // past the outer's content box (border / padding
268
- // rounding), the outer doesn't sprout its own scrollbar
269
- // on top of the inner's. The inner remains the single
270
- // scroll surface.
215
+ // Svelecte's outer `.sv_dropdown` and inner `.sv-dropdown-scroll`
216
+ // both default to scrolling, so when the outer's max-height is
217
+ // forced below the inner's 320px default the user sees two stacked
218
+ // scrollbars. Sync the inner's CSS variable to the outer's height
219
+ // and hide the outer's overflow so only the inner scrolls.
271
220
  dropdown.style.setProperty('--sv-dropdown-height', `${availableHeightPx}px`);
272
221
  dropdown.style.overflow = 'hidden';
273
222
  };
@@ -283,14 +232,11 @@ export function attachDropdownPortal(options) {
283
232
  return;
284
233
  }
285
234
  isOpen = true;
286
- // Lift the dropdown's nearest stacking-context ancestor so the
287
- // whole block paints above any sibling stacking contexts that
288
- // would otherwise hide it. Without this, the dropdown's high
289
- // z-index is trapped inside the ancestor's own stacking context.
290
- // Resolved from `trigger` rather than `dropdown` because the
291
- // dropdown's `position: fixed` makes it its own stacking
292
- // context; we want to lift the surrounding sticky / isolated
293
- // table strip, not the dropdown itself.
235
+ // Lift the dropdown's stacking-context ancestor so the whole block
236
+ // paints above sibling stacking contexts. Resolved from `trigger`
237
+ // rather than `dropdown` because `position: fixed` makes the
238
+ // dropdown its own stacking context we want to lift the
239
+ // surrounding sticky / isolated strip, not the dropdown itself.
294
240
  const stackingAncestor = findStackingContextAncestor(trigger);
295
241
  if (stackingAncestor) {
296
242
  releaseStackingLift = liftStackingContext(stackingAncestor);
@@ -1,39 +1,39 @@
1
- <svelte:options runes />
2
-
3
- <script lang="ts">
4
- import DesktopModal from '../../Components/DesktopModal.svelte';
5
- import { cssLength } from '../../Helpers/Helpers.svelte.js';
6
- import Switch from '../../Components/Switch.svelte';
7
- import type { DisplayModalProps } from '../../Components/Table/Types/Public/ColumnOptions.js';
8
- import type { ExampleItem } from './ExampleItem.js';
9
-
10
- const { row, close }: DisplayModalProps<ExampleItem> = $props();
11
- </script>
12
-
13
- <DesktopModal
14
- width={cssLength('1220px')}
15
- headerLabel="Hello World"
16
- onclose={close}
17
- onsubmit={close}
18
- buttons={[{ label: 'Close', callback: close }]}
19
- >
20
- <div class="wrapper">
21
- This is an Example modal where you can do additional work through the `row` prop or a custom
22
- context.
23
- <div>
24
- <Switch
25
- label="{row.id} checked?"
26
- value={row.isChecked}
27
- onchange={() => {
28
- row.isChecked = !row.isChecked;
29
- }}
30
- />
31
- </div>
32
- </div>
33
- </DesktopModal>
34
-
1
+ <svelte:options runes />
2
+
3
+ <script lang="ts">
4
+ import DesktopModal from '../../Components/DesktopModal.svelte';
5
+ import { cssLength } from '../../Helpers/Helpers.svelte.js';
6
+ import Switch from '../../Components/Switch.svelte';
7
+ import type { DisplayModalProps } from '../../Components/Table/Types/Public/ColumnOptions.js';
8
+ import type { ExampleItem } from './ExampleItem.js';
9
+
10
+ const { row, close }: DisplayModalProps<ExampleItem> = $props();
11
+ </script>
12
+
13
+ <DesktopModal
14
+ width={cssLength('1220px')}
15
+ headerLabel="Hello World"
16
+ onclose={close}
17
+ onsubmit={close}
18
+ buttons={[{ label: 'Close', callback: close }]}
19
+ >
20
+ <div class="wrapper">
21
+ This is an Example modal where you can do additional work through the `row` prop or a custom
22
+ context.
23
+ <div>
24
+ <Switch
25
+ label="{row.id} checked?"
26
+ value={row.isChecked}
27
+ onchange={() => {
28
+ row.isChecked = !row.isChecked;
29
+ }}
30
+ />
31
+ </div>
32
+ </div>
33
+ </DesktopModal>
34
+
35
35
  <style>.wrapper div {
36
36
  box-sizing: border-box;
37
37
  margin-top: 1rem;
38
38
  width: 300px;
39
- }</style>
39
+ }</style>
package/dist/index.d.ts CHANGED
@@ -103,7 +103,6 @@ export { type SwitchProps } from './Components/SwitchProps.js';
103
103
  export type { TabGroupButtonProps } from './Components/TabGroupButtonProps.js';
104
104
  export { default as Table, type TableProps } from './Components/Table/Table.svelte';
105
105
  export { createTable, customRows, localRows, remoteRows, } from './Components/Table/createTable.svelte.js';
106
- export type { ColumnSpecInternals } from './Components/Table/ColumnFactory.svelte.js';
107
106
  export type { ActionsColumnOptions, AnyEditEvent, BaseColumnOptions, BooleanKeyOf, BubbleColumnOptions, CheckboxColumnOptions, ClipboardApi, ColumnFactory as TableColumnFactory, ColumnKind, ColumnSpec, ColumnsApi, CreateTableOptions, CustomRowSource, DateColumnOptions, DateKeyOf, DisplayColumnOptions, DisplayModalProps, ExpandColumnOptions, ExpandInnerTableOptions, FilterOnlyColumnOptions, FilteringApi, FocusApi, LiteralRowIdKey, LocalRowSource, ModalApi, NumberColumnOptions, NumberKeyOf, PaginationApi, PreferencesApi, ProgressColumnOptions, QueryColumnOptions, RemoteRowSource, RowAction, RowFetchRequest, RowFetchResponse, RowSelectionColumnOptions, RowSource, SavedPreset, SelectColumnOptions, SelectionApi, SelectionOptions, SortingApi, StringKeyOf, Table as TableInstance, TableInitialState, TablePersistence, TablePersistenceObject, TableStorageAdapter, TextColumnOptions, ValidityColumnOptions, } from './Components/Table/Types/Public/index.js';
108
107
  export { type CellCoordinates } from './Components/Table/Types/Coordinates/CellCoordinates.js';
109
108
  export { type ColumnPinningState } from './Components/Table/Types/Columns/ColumnPinningState.js';
@@ -1,12 +1,12 @@
1
- @use './colours.scss';
2
-
3
- //border
4
- $border: solid 1px colours.$ui-blue-4;
5
- $border-mid: solid 2px colours.$ui-blue-4;
6
- $border-thick: solid 3px colours.$ui-blue-4;
7
-
8
- //box-shadow
9
- $table-focus: 0px 0px 1px 1px colours.$brand-primary inset;
10
-
11
- $box-shadow: 0px 0px 5px 0px #0002;
12
- $error-box-shadow: 0px 0px 5px 0px #aa141422;
1
+ @use './colours.scss';
2
+
3
+ //border
4
+ $border: solid 1px colours.$ui-blue-4;
5
+ $border-mid: solid 2px colours.$ui-blue-4;
6
+ $border-thick: solid 3px colours.$ui-blue-4;
7
+
8
+ //box-shadow
9
+ $table-focus: 0px 0px 1px 1px colours.$brand-primary inset;
10
+
11
+ $box-shadow: 0px 0px 5px 0px #0002;
12
+ $error-box-shadow: 0px 0px 5px 0px #aa141422;