@lavalogic/scoria 0.37.43 → 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.
- package/README.md +58 -58
- package/dist/Components/AccordionGroup.svelte +46 -46
- package/dist/Components/AccordionGroupButton.svelte +76 -76
- package/dist/Components/Action.svelte +136 -136
- package/dist/Components/ActionProps.d.ts +2 -6
- package/dist/Components/AlertModal.svelte +195 -183
- package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +702 -702
- package/dist/Components/Base/BaseModal.svelte +125 -125
- package/dist/Components/Base/ContextWrapper.svelte +72 -72
- package/dist/Components/Base/Pagination.svelte +198 -198
- package/dist/Components/Base/Snippets.svelte +36 -36
- package/dist/Components/BigRadioSet.svelte +38 -38
- package/dist/Components/Bubble.svelte +101 -101
- package/dist/Components/Button.svelte +209 -209
- package/dist/Components/ButtonProps.d.ts +2 -6
- package/dist/Components/Checkbox.svelte +86 -86
- package/dist/Components/CollapsibleCard.svelte +78 -78
- package/dist/Components/Contexts/ContextMenu.svelte +164 -164
- package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -15
- package/dist/Components/Contexts/ContextMenuOption.svelte +60 -60
- package/dist/Components/Contexts/Toast.svelte +83 -83
- package/dist/Components/Contexts/ToastContainer.svelte +65 -65
- package/dist/Components/Contexts/Tooltip.svelte +37 -37
- package/dist/Components/DataMatrixIcon.svelte +112 -112
- package/dist/Components/DataMatrixIconProps.d.ts +3 -13
- package/dist/Components/DateInput.svelte +148 -148
- package/dist/Components/DatePicker.svelte +300 -300
- package/dist/Components/DesktopModal.svelte +90 -90
- package/dist/Components/Dial.svelte +204 -204
- package/dist/Components/DialProps.d.ts +1 -18
- package/dist/Components/DimensionInput.svelte +170 -170
- package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -119
- package/dist/Components/DragMenu/DraggableCard.svelte +77 -77
- package/dist/Components/FileCard.svelte +24 -24
- package/dist/Components/FileUpload.svelte +236 -236
- package/dist/Components/GridInput.svelte +196 -200
- package/dist/Components/GridInputSet.svelte +29 -29
- package/dist/Components/HorizontalTabGroup.svelte +82 -82
- package/dist/Components/HorizontalTabGroupButton.svelte +44 -44
- package/dist/Components/Icon.svelte +128 -128
- package/dist/Components/IconProps.d.ts +2 -7
- package/dist/Components/Icons.js +357 -357
- package/dist/Components/LoadingAnimation.svelte +29 -29
- package/dist/Components/LoadingModal.svelte +45 -45
- package/dist/Components/LoadingOverlay.svelte +25 -25
- package/dist/Components/LoadingOverlayProps.d.ts +3 -7
- package/dist/Components/Modal.svelte +258 -258
- package/dist/Components/ModalProps.d.ts +0 -3
- package/dist/Components/MultiSelect.svelte +220 -220
- package/dist/Components/MultiSelectCommonProps.d.ts +6 -17
- package/dist/Components/Nav/Nav.svelte +99 -99
- package/dist/Components/Nav/NavProps.d.ts +4 -11
- package/dist/Components/Nav/NavServiceMenuList.svelte +43 -43
- package/dist/Components/Nav/NavTab.svelte +62 -62
- package/dist/Components/Nav/ServiceMenuItem.svelte +100 -100
- package/dist/Components/Nav/ServicesNav.svelte +80 -80
- package/dist/Components/NumberInput.svelte +157 -157
- package/dist/Components/PageHeading.svelte +25 -25
- package/dist/Components/PasswordInput.svelte +88 -88
- package/dist/Components/Portal.svelte +36 -36
- package/dist/Components/ProgressBubble.svelte +107 -108
- package/dist/Components/ProgressBubbleProps.d.ts +3 -3
- package/dist/Components/QuerySelect.svelte +366 -366
- package/dist/Components/QuerySelectProps.d.ts +4 -14
- package/dist/Components/SingleSelect.svelte +250 -250
- package/dist/Components/SingleSelectCommonProps.d.ts +3 -19
- package/dist/Components/StepButton.svelte +70 -70
- package/dist/Components/StepForm.svelte +140 -140
- package/dist/Components/Switch.svelte +69 -69
- package/dist/Components/Table/ARCHITECTURE.md +298 -0
- package/dist/Components/Table/Body/QuickSearchCell.svelte +679 -686
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +51 -51
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +59 -59
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +456 -478
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -79
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +185 -188
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +124 -124
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +120 -120
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +230 -230
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +105 -105
- package/dist/Components/Table/Body/Rows/Columns/SelectColumn.d.ts +12 -9
- package/dist/Components/Table/Body/Rows/Columns/SelectTableCell.d.ts +5 -5
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -87
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +126 -126
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -159
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +246 -246
- package/dist/Components/Table/Body/Rows/Columns/TableDatePickerProps.d.ts +4 -4
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +216 -216
- package/dist/Components/Table/Body/Rows/Columns/TableQueryCell.d.ts +6 -5
- package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.d.ts +7 -6
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +252 -257
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +179 -179
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +221 -229
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte.d.ts +11 -11
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +197 -197
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +190 -190
- package/dist/Components/Table/Body/Rows/TableRow.svelte +290 -290
- package/dist/Components/Table/Body/TableBody.svelte +155 -155
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +2 -3
- package/dist/Components/Table/ColumnFactory.svelte.d.ts +9 -11
- package/dist/Components/Table/ColumnFactory.svelte.js +101 -118
- package/dist/Components/Table/ColumnKindRegistry.d.ts +112 -0
- package/dist/Components/Table/ColumnKindRegistry.js +63 -0
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -41
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -30
- package/dist/Components/Table/Headers/TableHead.svelte +415 -413
- package/dist/Components/Table/Misc/ColumnPanel.svelte +94 -94
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +112 -112
- package/dist/Components/Table/Misc/FilterInput.svelte +620 -635
- package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +12 -12
- package/dist/Components/Table/Misc/FilterInputProps.d.ts +2 -2
- package/dist/Components/Table/Misc/FilterPanel.svelte +257 -257
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +30 -30
- package/dist/Components/Table/Misc/SidePanel.svelte +35 -35
- package/dist/Components/Table/Misc/TableFooter.svelte +311 -311
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +125 -125
- package/dist/Components/Table/Misc/TableSidebar.svelte +157 -157
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +100 -100
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -107
- package/dist/Components/Table/NestedTable.svelte +130 -133
- package/dist/Components/Table/SubApis.svelte.d.ts +1 -5
- package/dist/Components/Table/SubApis.svelte.js +33 -32
- package/dist/Components/Table/Table.svelte +692 -747
- package/dist/Components/Table/TableHelpers.svelte.d.ts +6 -19
- package/dist/Components/Table/TableHelpers.svelte.js +6 -14
- package/dist/Components/Table/Types/Columns/Column.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/DateColumn.d.ts +3 -3
- package/dist/Components/Table/Types/Columns/DateTableCell.d.ts +7 -7
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +7 -8
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.js +4 -5
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +11 -14
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.js +3 -4
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.d.ts +7 -11
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.js +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts +13 -18
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.js +4 -5
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.d.ts +15 -12
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.js +4 -5
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +8 -12
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.js +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +6 -6
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +49 -16
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +27 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +7 -7
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +4 -4
- package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.js +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +11 -19
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.js +4 -8
- package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +6 -7
- package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.js +3 -4
- package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +9 -9
- package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js +4 -4
- package/dist/Components/Table/Types/Columns/ExpandTableCell.d.ts +5 -5
- package/dist/Components/Table/Types/Columns/ProgressBarTableCell.d.ts +6 -6
- package/dist/Components/Table/Types/Columns/TableCell.d.ts +7 -6
- package/dist/Components/Table/Types/Context/ClipboardState.svelte.d.ts +98 -0
- package/dist/Components/Table/Types/Context/ClipboardState.svelte.js +290 -0
- package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.d.ts +17 -45
- package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.js +17 -45
- package/dist/Components/Table/Types/Context/FilteringState.svelte.d.ts +9 -20
- package/dist/Components/Table/Types/Context/FilteringState.svelte.js +9 -20
- package/dist/Components/Table/Types/Context/FocusState.svelte.d.ts +23 -42
- package/dist/Components/Table/Types/Context/FocusState.svelte.js +32 -59
- package/dist/Components/Table/Types/Context/ITable.d.ts +5 -8
- package/dist/Components/Table/Types/Context/PreferencesState.svelte.d.ts +29 -56
- package/dist/Components/Table/Types/Context/PreferencesState.svelte.js +28 -55
- package/dist/Components/Table/Types/Context/QueryValuesState.svelte.d.ts +50 -0
- package/dist/Components/Table/Types/Context/QueryValuesState.svelte.js +62 -0
- package/dist/Components/Table/Types/Context/SelectionState.svelte.d.ts +17 -28
- package/dist/Components/Table/Types/Context/SelectionState.svelte.js +17 -28
- package/dist/Components/Table/Types/Context/SortingState.svelte.d.ts +15 -29
- package/dist/Components/Table/Types/Context/SortingState.svelte.js +17 -31
- package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +212 -325
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +292 -706
- package/dist/Components/Table/Types/Context/VirtualisationState.svelte.d.ts +62 -79
- package/dist/Components/Table/Types/Context/VirtualisationState.svelte.js +54 -73
- package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.d.ts +16 -27
- package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.js +16 -27
- package/dist/Components/Table/Types/DataRepository/IDataRepository.d.ts +12 -15
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.d.ts +15 -30
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +16 -28
- package/dist/Components/Table/Types/Header.d.ts +4 -4
- package/dist/Components/Table/Types/HeaderGroup.d.ts +5 -5
- package/dist/Components/Table/Types/Public/index.d.ts +2 -4
- package/dist/Components/Table/Types/Public/index.js +2 -4
- package/dist/Components/Table/clipboardEscape.d.ts +32 -0
- package/dist/Components/Table/clipboardEscape.js +45 -0
- package/dist/Components/Table/createTable.svelte.d.ts +8 -18
- package/dist/Components/Table/createTable.svelte.js +19 -47
- package/dist/Components/Test/TestContextConsumer.svelte +13 -13
- package/dist/Components/TextArea.svelte +130 -130
- package/dist/Components/TextInput.svelte +176 -176
- package/dist/Components/ThreeStateRadio.svelte +131 -131
- package/dist/Components/Touch/BoolCard.svelte +45 -45
- package/dist/Components/Touch/DateModal.svelte +209 -209
- package/dist/Components/Touch/EditCard.svelte +59 -59
- package/dist/Components/Touch/InfoCard.svelte +31 -31
- package/dist/Components/Touch/InfoTextCard.svelte +28 -28
- package/dist/Components/Touch/ModalExplanation.svelte +17 -17
- package/dist/Components/Touch/NumberKeyboard.svelte +225 -225
- package/dist/Components/Touch/NumberModal.svelte +79 -79
- package/dist/Components/Touch/PlusMinusCard.svelte +46 -46
- package/dist/Components/Touch/SelectModal.svelte +123 -123
- package/dist/Components/Touch/SummaryCard.svelte +93 -93
- package/dist/Components/Touch/TextAreaModal.svelte +95 -95
- package/dist/Components/Touch/TextModal.svelte +106 -106
- package/dist/Components/Touch/TouchCard.svelte +33 -33
- package/dist/Components/Touch/TouchModal.svelte +274 -274
- package/dist/Components/Touch/UtilityButton.svelte +109 -109
- package/dist/Components/VerticalTabGroup.svelte +79 -79
- package/dist/Components/VerticalTabGroupButton.svelte +58 -58
- package/dist/Contexts/ToastContext.svelte.js +3 -4
- package/dist/Helpers/Datamatrix.d.ts +19 -19
- package/dist/Helpers/Datamatrix.js +291 -291
- package/dist/Helpers/Helpers.svelte.d.ts +2 -4
- package/dist/Helpers/Helpers.svelte.js +2 -4
- package/dist/Helpers/dropdownPortal.d.ts +26 -36
- package/dist/Helpers/dropdownPortal.js +146 -76
- package/dist/Types/Examples/ExampleModal.svelte +35 -35
- package/dist/index.d.ts +0 -1
- package/dist/scss/_basics.scss +12 -12
- package/dist/scss/_colours.scss +134 -134
- package/dist/scss/_mixins.scss +3348 -3360
- package/dist/scss/_motion.scss +57 -57
- package/dist/scss/_sizing.scss +85 -85
- package/dist/scss/_transitions.scss +8 -8
- package/package.json +2 -1
|
@@ -1,45 +1,35 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Portal helper for Svelecte-style dropdowns.
|
|
3
3
|
*
|
|
4
|
-
* Svelecte renders its `.sv_dropdown`
|
|
5
|
-
* `.svelecte-control` trigger
|
|
6
|
-
*
|
|
7
|
-
* any
|
|
8
|
-
*
|
|
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
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `onmousedown` / `onclick`
|
|
15
|
-
*
|
|
16
|
-
*
|
|
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
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* `z-index` only competes within a shared stacking context;
|
|
39
|
-
* the dropdown's `position: fixed` + `z-index` makes it its
|
|
40
|
-
* own stacking context, but ancestor stacking contexts can
|
|
41
|
-
* still constrain it. See `_mixins.scss` `table-cell-svelecte`
|
|
42
|
-
* for the per-cell rules that avoid creating such ancestors.
|
|
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.
|
|
43
33
|
*/
|
|
44
34
|
export interface DropdownPortalOptions {
|
|
45
35
|
/** The Svelecte root wrapper `<div class="svelecte">`. Used as the
|
|
@@ -1,72 +1,142 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Portal helper for Svelecte-style dropdowns.
|
|
3
3
|
*
|
|
4
|
-
* Svelecte renders its `.sv_dropdown`
|
|
5
|
-
* `.svelecte-control` trigger
|
|
6
|
-
*
|
|
7
|
-
* any
|
|
8
|
-
*
|
|
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
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
* `onmousedown` / `onclick`
|
|
15
|
-
*
|
|
16
|
-
*
|
|
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
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
38
|
-
* `z-index` only competes within a shared stacking context;
|
|
39
|
-
* the dropdown's `position: fixed` + `z-index` makes it its
|
|
40
|
-
* own stacking context, but ancestor stacking contexts can
|
|
41
|
-
* still constrain it. See `_mixins.scss` `table-cell-svelecte`
|
|
42
|
-
* for the per-cell rules that avoid creating such ancestors.
|
|
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.
|
|
43
33
|
*/
|
|
44
34
|
/**
|
|
45
|
-
* Z-index
|
|
46
|
-
*
|
|
47
|
-
* grid), the table footer (`z 10`), and the side-panel chrome, but
|
|
48
|
-
* 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`).
|
|
49
37
|
*/
|
|
50
38
|
const PORTAL_Z_INDEX = 99998;
|
|
51
39
|
/**
|
|
52
|
-
*
|
|
53
|
-
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
*
|
|
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).
|
|
45
|
+
*/
|
|
46
|
+
const STACKING_LIFT_Z_INDEX = 99997;
|
|
47
|
+
/**
|
|
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`.
|
|
51
|
+
*/
|
|
52
|
+
function findStackingContextAncestor(el) {
|
|
53
|
+
let current = el.parentElement;
|
|
54
|
+
while (current && current !== document.body) {
|
|
55
|
+
if (createsStackingContext(current)) {
|
|
56
|
+
return current;
|
|
57
|
+
}
|
|
58
|
+
current = current.parentElement;
|
|
59
|
+
}
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
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.
|
|
67
|
+
*/
|
|
68
|
+
function createsStackingContext(el) {
|
|
69
|
+
const cs = getComputedStyle(el);
|
|
70
|
+
if (cs.position === 'fixed' || cs.position === 'sticky') {
|
|
71
|
+
return true;
|
|
72
|
+
}
|
|
73
|
+
if ((cs.position === 'relative' || cs.position === 'absolute') &&
|
|
74
|
+
cs.zIndex !== 'auto') {
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if (cs.isolation === 'isolate') {
|
|
78
|
+
return true;
|
|
79
|
+
}
|
|
80
|
+
if (cs.transform !== 'none') {
|
|
81
|
+
return true;
|
|
82
|
+
}
|
|
83
|
+
if (cs.filter !== 'none') {
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
if (cs.perspective !== 'none') {
|
|
87
|
+
return true;
|
|
88
|
+
}
|
|
89
|
+
if (cs.mixBlendMode !== 'normal') {
|
|
90
|
+
return true;
|
|
91
|
+
}
|
|
92
|
+
if (Number.parseFloat(cs.opacity) < 1) {
|
|
93
|
+
return true;
|
|
94
|
+
}
|
|
95
|
+
if (cs.willChange && cs.willChange !== 'auto') {
|
|
96
|
+
return true;
|
|
97
|
+
}
|
|
98
|
+
return false;
|
|
99
|
+
}
|
|
100
|
+
const raiseCounts = new WeakMap();
|
|
101
|
+
function liftStackingContext(el) {
|
|
102
|
+
let info = raiseCounts.get(el);
|
|
103
|
+
if (!info) {
|
|
104
|
+
info = { count: 0, originalInlineZIndex: el.style.zIndex };
|
|
105
|
+
raiseCounts.set(el, info);
|
|
106
|
+
el.style.zIndex = String(STACKING_LIFT_Z_INDEX);
|
|
107
|
+
}
|
|
108
|
+
info.count++;
|
|
109
|
+
let released = false;
|
|
110
|
+
return () => {
|
|
111
|
+
if (released) {
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
released = true;
|
|
115
|
+
const current = raiseCounts.get(el);
|
|
116
|
+
if (!current) {
|
|
117
|
+
return;
|
|
118
|
+
}
|
|
119
|
+
current.count--;
|
|
120
|
+
if (current.count <= 0) {
|
|
121
|
+
el.style.zIndex = current.originalInlineZIndex;
|
|
122
|
+
raiseCounts.delete(el);
|
|
123
|
+
}
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
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.
|
|
57
130
|
*/
|
|
58
131
|
const FLIP_THRESHOLD_PX = 240;
|
|
59
132
|
/**
|
|
60
|
-
*
|
|
61
|
-
*
|
|
62
|
-
*
|
|
63
|
-
* so a typical dropdown opens at a sensible "six rows plus search
|
|
64
|
-
* input" size and only shrinks below that when the trigger is genuinely
|
|
65
|
-
* 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.
|
|
66
136
|
*/
|
|
67
137
|
const MAX_DROPDOWN_HEIGHT_PX = 320;
|
|
68
|
-
/** Run a function on the next animation frame, coalescing repeat
|
|
69
|
-
*
|
|
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. */
|
|
70
140
|
function rafThrottle(fn) {
|
|
71
141
|
let handle = null;
|
|
72
142
|
return {
|
|
@@ -109,6 +179,7 @@ export function attachDropdownPortal(options) {
|
|
|
109
179
|
};
|
|
110
180
|
}
|
|
111
181
|
let isOpen = false;
|
|
182
|
+
let releaseStackingLift = null;
|
|
112
183
|
const reposition = () => {
|
|
113
184
|
if (!isOpen) {
|
|
114
185
|
return;
|
|
@@ -125,13 +196,10 @@ export function attachDropdownPortal(options) {
|
|
|
125
196
|
dropdown.style.minWidth = `${tr.width}px`;
|
|
126
197
|
dropdown.style.maxWidth = `${tr.width}px`;
|
|
127
198
|
dropdown.style.zIndex = String(PORTAL_Z_INDEX);
|
|
128
|
-
// Cap
|
|
129
|
-
//
|
|
130
|
-
//
|
|
131
|
-
// the
|
|
132
|
-
// stops the dropdown from collapsing to a single-row sliver
|
|
133
|
-
// when the trigger is genuinely pinned against the viewport
|
|
134
|
-
// 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.
|
|
135
203
|
const availableHeightPx = openUp
|
|
136
204
|
? Math.min(MAX_DROPDOWN_HEIGHT_PX, Math.max(spaceAbove - 8, 64))
|
|
137
205
|
: Math.min(MAX_DROPDOWN_HEIGHT_PX, Math.max(spaceBelow - 8, 64));
|
|
@@ -144,22 +212,11 @@ export function attachDropdownPortal(options) {
|
|
|
144
212
|
dropdown.style.bottom = '';
|
|
145
213
|
}
|
|
146
214
|
dropdown.style.maxHeight = `${availableHeightPx}px`;
|
|
147
|
-
// Svelecte's inner `.sv-dropdown-scroll`
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
// so both ended up with their own scrollbars (the visible "two
|
|
153
|
-
// scrollbars stacked" symptom). Two complementary fixes:
|
|
154
|
-
// 1. Override `--sv-dropdown-height` to match the outer's
|
|
155
|
-
// max-height so the inner scroll container shrinks in
|
|
156
|
-
// lockstep instead of staying at its 320px default.
|
|
157
|
-
// 2. Force the outer to `overflow: hidden` so even if the
|
|
158
|
-
// inner's actual rendered height nudges a pixel or two
|
|
159
|
-
// past the outer's content box (border / padding
|
|
160
|
-
// rounding), the outer doesn't sprout its own scrollbar
|
|
161
|
-
// on top of the inner's. The inner remains the single
|
|
162
|
-
// 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.
|
|
163
220
|
dropdown.style.setProperty('--sv-dropdown-height', `${availableHeightPx}px`);
|
|
164
221
|
dropdown.style.overflow = 'hidden';
|
|
165
222
|
};
|
|
@@ -175,6 +232,15 @@ export function attachDropdownPortal(options) {
|
|
|
175
232
|
return;
|
|
176
233
|
}
|
|
177
234
|
isOpen = true;
|
|
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.
|
|
240
|
+
const stackingAncestor = findStackingContextAncestor(trigger);
|
|
241
|
+
if (stackingAncestor) {
|
|
242
|
+
releaseStackingLift = liftStackingContext(stackingAncestor);
|
|
243
|
+
}
|
|
178
244
|
dropdown.style.display = '';
|
|
179
245
|
dropdown.setAttribute('data-scoria-portal-dropdown', '');
|
|
180
246
|
reposition();
|
|
@@ -189,6 +255,10 @@ export function attachDropdownPortal(options) {
|
|
|
189
255
|
throttled.cancel();
|
|
190
256
|
window.removeEventListener('scroll', handleScroll, { capture: true });
|
|
191
257
|
window.removeEventListener('resize', handleResize);
|
|
258
|
+
if (releaseStackingLift) {
|
|
259
|
+
releaseStackingLift();
|
|
260
|
+
releaseStackingLift = null;
|
|
261
|
+
}
|
|
192
262
|
dropdown.style.position = '';
|
|
193
263
|
dropdown.style.top = '';
|
|
194
264
|
dropdown.style.left = '';
|
|
@@ -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';
|
package/dist/scss/_basics.scss
CHANGED
|
@@ -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;
|