@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.
- 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 -694
- 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 -644
- 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 -745
- 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 -41
- package/dist/Helpers/dropdownPortal.js +62 -116
- 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,50 +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
|
-
* 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`
|
|
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
|
-
* 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
|
|
51
|
-
*
|
|
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
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
*
|
|
61
|
-
*
|
|
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
|
|
77
|
-
*
|
|
78
|
-
*
|
|
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`
|
|
95
|
-
*
|
|
96
|
-
*
|
|
97
|
-
*
|
|
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
|
|
160
|
-
*
|
|
161
|
-
*
|
|
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
|
-
*
|
|
168
|
-
*
|
|
169
|
-
*
|
|
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
|
-
*
|
|
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
|
|
237
|
-
//
|
|
238
|
-
//
|
|
239
|
-
// the
|
|
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`
|
|
256
|
-
//
|
|
257
|
-
//
|
|
258
|
-
//
|
|
259
|
-
//
|
|
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
|
|
287
|
-
//
|
|
288
|
-
//
|
|
289
|
-
//
|
|
290
|
-
//
|
|
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';
|
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;
|