@lavalogic/scoria 0.35.0 → 0.37.0
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 -42
- package/dist/Components/AccordionGroupButton.svelte +106 -106
- package/dist/Components/AccordionGroupButtonProps.d.ts +27 -8
- package/dist/Components/AccordionGroupProps.d.ts +10 -2
- package/dist/Components/Action.svelte +137 -139
- package/dist/Components/ActionProps.d.ts +23 -3
- package/dist/Components/AlertModal.svelte +176 -125
- package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte +1126 -0
- package/dist/Components/AppointmentCalendar/AppointmentCalendar.svelte.d.ts +4 -0
- package/dist/Components/AppointmentCalendar/AppointmentCalendarProps.d.ts +92 -0
- package/dist/Components/AppointmentCalendar/AppointmentCalendarProps.js +12 -0
- package/dist/Components/Base/BaseModal.svelte +172 -0
- package/dist/Components/Base/BaseModal.svelte.d.ts +4 -0
- package/dist/Components/Base/BaseModalProps.d.ts +73 -0
- package/dist/Components/Base/BaseModalProps.js +1 -0
- package/dist/Components/Base/ContextWrapper.svelte +72 -50
- package/dist/Components/Base/ContextWrapper.svelte.d.ts +24 -5
- package/dist/Components/Base/ContextWrapperProps.d.ts +22 -0
- package/dist/Components/Base/Pagination.svelte +198 -190
- package/dist/Components/Base/Pagination.svelte.d.ts +12 -2
- package/dist/Components/Base/PaginationProps.d.ts +60 -3
- package/dist/Components/Base/Snippets.svelte +36 -29
- package/dist/Components/Base/Snippets.svelte.d.ts +5 -1
- package/dist/Components/BigRadioSet.svelte +39 -30
- package/dist/Components/BigRadioSetProps.d.ts +17 -1
- package/dist/Components/Bubble.svelte +110 -77
- package/dist/Components/Bubble.svelte.d.ts +23 -2
- package/dist/Components/BubbleProps.d.ts +55 -4
- package/dist/Components/Button.svelte +209 -197
- package/dist/Components/ButtonProps.d.ts +66 -1
- package/dist/Components/Checkbox.svelte +100 -72
- package/dist/Components/Checkbox.svelte.d.ts +1 -12
- package/dist/Components/CheckboxProps.d.ts +27 -0
- package/dist/Components/CheckboxProps.js +1 -0
- package/dist/Components/CollapsibleCard.svelte +114 -83
- package/dist/Components/CollapsibleCardProps.d.ts +22 -1
- package/dist/Components/Contexts/ContextMenu.svelte +178 -157
- package/dist/Components/Contexts/ContextMenu.svelte.d.ts +26 -0
- package/dist/Components/Contexts/ContextMenuDivider.svelte +19 -11
- package/dist/Components/Contexts/ContextMenuDivider.svelte.d.ts +9 -0
- package/dist/Components/Contexts/ContextMenuOption.svelte +66 -57
- package/dist/Components/Contexts/ContextMenuOption.svelte.d.ts +12 -1
- package/dist/Components/Contexts/ContextMenuOptionProps.d.ts +34 -2
- package/dist/Components/Contexts/Toast.svelte +88 -64
- package/dist/Components/Contexts/Toast.svelte.d.ts +14 -0
- package/dist/Components/Contexts/ToastContainer.svelte +68 -49
- package/dist/Components/Contexts/ToastContainer.svelte.d.ts +14 -0
- package/dist/Components/Contexts/ToastProps.d.ts +14 -1
- package/dist/Components/Contexts/Tooltip.svelte +47 -36
- package/dist/Components/Contexts/Tooltip.svelte.d.ts +10 -0
- package/dist/Components/DataMatrixIcon.svelte +113 -42
- package/dist/Components/DataMatrixIconProps.d.ts +73 -1
- package/dist/Components/DateInput.svelte +144 -109
- package/dist/Components/DateInput.svelte.d.ts +1 -1
- package/dist/Components/DateOnlyInputProps.d.ts +31 -5
- package/dist/Components/DatePicker.svelte +301 -313
- package/dist/Components/DatePickerProps.d.ts +18 -1
- package/dist/Components/DateTimeInputProps.d.ts +30 -5
- package/dist/Components/DesktopModal.svelte +90 -119
- package/dist/Components/DesktopModalProps.d.ts +5 -4
- package/dist/Components/Dial.svelte +213 -151
- package/dist/Components/DialProps.d.ts +74 -2
- package/dist/Components/DimensionInput.svelte +171 -185
- package/dist/Components/DimensionInput.svelte.d.ts +1 -1
- package/dist/Components/DimensionInputProps.d.ts +39 -4
- package/dist/Components/DragMenu/DragMenuHolder.svelte +119 -107
- package/dist/Components/DragMenu/DragMenuHolderProps.d.ts +30 -1
- package/dist/Components/DragMenu/DraggableCard.svelte +77 -41
- package/dist/Components/DragMenu/DraggableCardProps.d.ts +27 -1
- package/dist/Components/FileCard.svelte +24 -20
- package/dist/Components/FileCardProps.d.ts +17 -1
- package/dist/Components/FileUpload.svelte +236 -196
- package/dist/Components/FileUploadProps.d.ts +34 -4
- package/dist/Components/GridInput.svelte +201 -191
- package/dist/Components/GridInput.svelte.d.ts +5 -5
- package/dist/Components/GridInputProps.d.ts +4 -1
- package/dist/Components/GridInputSet.svelte +31 -24
- package/dist/Components/GridInputSet.svelte.d.ts +5 -5
- package/dist/Components/GridInputSetProps.d.ts +4 -2
- package/dist/Components/HorizontalTabGroup.svelte +81 -79
- package/dist/Components/HorizontalTabGroupButton.svelte +51 -103
- package/dist/Components/HorizontalTabGroupProps.d.ts +15 -2
- package/dist/Components/Icon.svelte +144 -103
- package/dist/Components/IconProps.d.ts +54 -6
- package/dist/Components/Icons.d.ts +8 -0
- package/dist/Components/Icons.js +591 -572
- package/dist/Components/LoadingAnimation.svelte +39 -39
- package/dist/Components/LoadingAnimation.svelte.d.ts +1 -3
- package/dist/Components/LoadingAnimationProps.d.ts +16 -0
- package/dist/Components/LoadingAnimationProps.js +1 -0
- package/dist/Components/LoadingModal.svelte +48 -50
- package/dist/Components/LoadingModal.svelte.d.ts +1 -4
- package/dist/Components/LoadingModalProps.d.ts +17 -0
- package/dist/Components/LoadingModalProps.js +1 -0
- package/dist/Components/LoadingOverlay.svelte +28 -30
- package/dist/Components/LoadingOverlay.svelte.d.ts +1 -5
- package/dist/Components/LoadingOverlayProps.d.ts +28 -0
- package/dist/Components/LoadingOverlayProps.js +1 -0
- package/dist/Components/Modal.svelte +250 -255
- package/dist/Components/Modal.svelte.d.ts +1 -25
- package/dist/Components/ModalProps.d.ts +65 -0
- package/dist/Components/ModalProps.js +1 -0
- package/dist/Components/MultiSelect.svelte +238 -226
- package/dist/Components/MultiSelectCommonProps.d.ts +33 -4
- package/dist/Components/MultiSelectPropsAsObject.d.ts +5 -0
- package/dist/Components/MultiSelectPropsAsPrimitive.d.ts +6 -0
- package/dist/Components/Nav/CallbackButtonWithIcon.d.ts +22 -1
- package/dist/Components/Nav/Nav.svelte +115 -110
- package/dist/Components/Nav/Nav.svelte.d.ts +23 -2
- package/dist/Components/Nav/NavProps.d.ts +50 -3
- package/dist/Components/Nav/NavServiceMenuList.svelte +44 -35
- package/dist/Components/Nav/NavServiceMenuListProps.d.ts +25 -1
- package/dist/Components/Nav/NavTab.svelte +62 -91
- package/dist/Components/Nav/NavTab.svelte.d.ts +23 -2
- package/dist/Components/Nav/NavTabProps.d.ts +16 -2
- package/dist/Components/Nav/ServiceMenuItem.svelte +101 -92
- package/dist/Components/Nav/ServicesNav.svelte +96 -70
- package/dist/Components/Nav/ServicesNav.svelte.d.ts +23 -2
- package/dist/Components/Nav/ServicesNavProps.d.ts +20 -4
- package/dist/Components/Nav/SideMenuItemProps.d.ts +16 -0
- package/dist/Components/NumberInput.svelte +155 -145
- package/dist/Components/NumberInputProps.d.ts +37 -0
- package/dist/Components/PageHeading.svelte +25 -36
- package/dist/Components/PageHeading.svelte.d.ts +1 -6
- package/dist/Components/PageHeadingProps.d.ts +23 -0
- package/dist/Components/PageHeadingProps.js +1 -0
- package/dist/Components/PasswordInput.svelte +85 -73
- package/dist/Components/PasswordInput.svelte.d.ts +2 -2
- package/dist/Components/PasswordInputProps.d.ts +21 -0
- package/dist/Components/PasswordInputProps.js +1 -0
- package/dist/Components/Portal.svelte +36 -25
- package/dist/Components/PortalProps.d.ts +20 -1
- package/dist/Components/ProgressBubble.svelte +129 -84
- package/dist/Components/ProgressBubbleProps.d.ts +23 -2
- package/dist/Components/QuerySelect.svelte +384 -440
- package/dist/Components/QuerySelect.svelte.d.ts +2 -29
- package/dist/Components/QuerySelectProps.d.ts +66 -0
- package/dist/Components/QuerySelectProps.js +1 -0
- package/dist/Components/SingleSelect.svelte +268 -290
- package/dist/Components/SingleSelectCommonProps.d.ts +43 -5
- package/dist/Components/SingleSelectPropsAsObject.d.ts +7 -0
- package/dist/Components/SingleSelectPropsAsPrimitive.d.ts +8 -0
- package/dist/Components/StepButton.svelte +70 -120
- package/dist/Components/StepForm.svelte +147 -147
- package/dist/Components/StepFormProps.d.ts +16 -2
- package/dist/Components/Switch.svelte +84 -47
- package/dist/Components/Switch.svelte.d.ts +1 -1
- package/dist/Components/SwitchProps.d.ts +46 -0
- package/dist/Components/Table/Body/HeightData.d.ts +1 -6
- package/dist/Components/Table/Body/HeightData.js +8 -0
- package/dist/Components/Table/Body/QuickSearchCell.svelte +697 -641
- package/dist/Components/Table/Body/QuickSearchCell.svelte.d.ts +12 -11
- package/dist/Components/Table/Body/QuickSearchCellProps.d.ts +6 -0
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +68 -34
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte.d.ts +24 -2
- package/dist/Components/Table/Body/Rows/ColumnHighlightProps.d.ts +3 -0
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +66 -56
- package/dist/Components/Table/Body/Rows/ColumnList.svelte.d.ts +12 -11
- package/dist/Components/Table/Body/Rows/ColumnListProps.d.ts +1 -0
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +515 -182
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte.d.ts +12 -11
- package/dist/Components/Table/Body/Rows/ColumnListRowProps.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +79 -49
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponentProps.d.ts +12 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +203 -191
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte.d.ts +12 -12
- package/dist/Components/Table/Body/Rows/Columns/ActionsColumn.d.ts +9 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsTableCell.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +150 -115
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte.d.ts +14 -13
- package/dist/Components/Table/Body/Rows/Columns/BubbleCellProps.d.ts +12 -0
- package/dist/Components/Table/Body/Rows/Columns/BubbleCellProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +149 -129
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +149 -126
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte.d.ts +12 -11
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCellProps.d.ts +7 -0
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +142 -108
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte.d.ts +17 -11
- package/dist/Components/Table/Body/Rows/Columns/RowSelectionColumn.d.ts +8 -0
- package/dist/Components/Table/Body/Rows/Columns/RowSelectionTableCell.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/SelectColumn.d.ts +11 -0
- package/dist/Components/Table/Body/Rows/Columns/SelectTableCell.d.ts +11 -0
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +87 -72
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte.d.ts +11 -0
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +148 -137
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte.d.ts +13 -18
- package/dist/Components/Table/Body/Rows/Columns/TableCheckboxProps.d.ts +17 -0
- package/dist/Components/Table/Body/Rows/Columns/TableCheckboxProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +159 -144
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte.d.ts +1 -7
- package/dist/Components/Table/Body/Rows/Columns/TableColumnProps.d.ts +16 -0
- package/dist/Components/Table/Body/Rows/Columns/TableColumnProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +279 -249
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte.d.ts +12 -11
- package/dist/Components/Table/Body/Rows/Columns/TableDatePickerProps.d.ts +9 -0
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +249 -370
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte.d.ts +20 -12
- package/dist/Components/Table/Body/Rows/Columns/TableQueryCell.d.ts +8 -0
- package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.d.ts +9 -0
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +291 -354
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte.d.ts +12 -11
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelectProps.d.ts +8 -0
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +201 -189
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte.d.ts +2 -5
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckboxProps.d.ts +14 -0
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckboxProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +263 -325
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte.d.ts +13 -12
- package/dist/Components/Table/Body/Rows/Columns/TableSelectProps.d.ts +6 -0
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +230 -381
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte.d.ts +12 -11
- package/dist/Components/Table/Body/Rows/Columns/TableTextInputProps.d.ts +6 -0
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +187 -177
- package/dist/Components/Table/Body/Rows/Columns/_helpers/useAsyncEditable.svelte.d.ts +104 -0
- package/dist/Components/Table/Body/Rows/Columns/_helpers/useAsyncEditable.svelte.js +215 -0
- package/dist/Components/Table/Body/Rows/TableRow.svelte +331 -263
- package/dist/Components/Table/Body/Rows/TableRow.svelte.d.ts +2 -10
- package/dist/Components/Table/Body/Rows/TableRowProps.d.ts +11 -2
- package/dist/Components/Table/Body/TableBody.svelte +198 -81
- package/dist/Components/Table/Body/TableBody.svelte.d.ts +15 -22
- package/dist/Components/Table/Body/TableBodyProps.d.ts +9 -7
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +18 -12
- package/dist/Components/Table/ColumnFactory.svelte.d.ts +43 -0
- package/dist/Components/Table/ColumnFactory.svelte.js +339 -0
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +41 -39
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte.d.ts +12 -11
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +30 -28
- package/dist/Components/Table/Headers/SelectAllHeader.svelte.d.ts +12 -11
- package/dist/Components/Table/Headers/TableHead.svelte +434 -294
- package/dist/Components/Table/Headers/TableHead.svelte.d.ts +13 -16
- package/dist/Components/Table/Headers/TableHeadProps.d.ts +10 -0
- package/dist/Components/Table/Headers/TableHeadProps.js +1 -0
- package/dist/Components/Table/Misc/ColumnPanel.svelte +154 -96
- package/dist/Components/Table/Misc/ColumnPanel.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +112 -99
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/ColumnPanelModalProps.d.ts +5 -0
- package/dist/Components/Table/Misc/FilterInput.svelte +545 -556
- package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/FilterPanel.svelte +409 -51
- package/dist/Components/Table/Misc/FilterPanel.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +30 -77
- package/dist/Components/Table/Misc/FilterPanelModal.svelte.d.ts +2 -23
- package/dist/Components/Table/Misc/SidePanel.svelte +35 -32
- package/dist/Components/Table/Misc/SidePanel.svelte.d.ts +1 -7
- package/dist/Components/Table/Misc/SidePanelProps.d.ts +17 -0
- package/dist/Components/Table/Misc/SidePanelProps.js +1 -0
- package/dist/Components/Table/Misc/TableFooter.svelte +315 -306
- package/dist/Components/Table/Misc/TableFooter.svelte.d.ts +13 -14
- package/dist/Components/Table/Misc/TableFooterProps.d.ts +8 -0
- package/dist/Components/Table/Misc/TableFooterProps.js +1 -0
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +126 -157
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/TableSidebar.svelte +158 -177
- package/dist/Components/Table/Misc/TableSidebar.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +147 -81
- package/dist/Components/Table/Misc/ToolboxPanel.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +107 -100
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/ToolboxPanelModalProps.d.ts +5 -0
- package/dist/Components/Table/Misc/numberDateFilterTypes.d.ts +7 -4
- package/dist/Components/Table/Misc/numberDateFilterTypes.js +8 -3
- package/dist/Components/Table/Misc/stringFilterTypes.d.ts +6 -4
- package/dist/Components/Table/Misc/stringFilterTypes.js +7 -3
- package/dist/Components/Table/NestedTable.svelte +132 -88
- package/dist/Components/Table/NestedTable.svelte.d.ts +2 -10
- package/dist/Components/Table/NestedTableProps.d.ts +25 -0
- package/dist/Components/Table/NestedTableProps.js +1 -0
- package/dist/Components/Table/SubApis.svelte.d.ts +23 -0
- package/dist/Components/Table/SubApis.svelte.js +359 -0
- package/dist/Components/Table/Table.svelte +694 -519
- package/dist/Components/Table/Table.svelte.d.ts +24 -1
- package/dist/Components/Table/TableHelpers.svelte.d.ts +58 -0
- package/dist/Components/Table/TableHelpers.svelte.js +88 -0
- package/dist/Components/Table/Types/Columns/Column.d.ts +10 -0
- package/dist/Components/Table/Types/Columns/ColumnPinningState.d.ts +12 -0
- package/dist/Components/Table/Types/Columns/ColumnSizingState.d.ts +8 -0
- package/dist/Components/Table/Types/Columns/ColumnType.d.ts +17 -0
- package/dist/Components/Table/Types/Columns/ColumnType.js +18 -1
- package/dist/Components/Table/Types/Columns/DateColumn.d.ts +6 -0
- package/dist/Components/Table/Types/Columns/DateTableCell.d.ts +7 -0
- package/dist/Components/Table/Types/Columns/Definitions/AccessorFn.d.ts +13 -0
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.d.ts +28 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorDef.svelte.js +15 -0
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorType.d.ts +10 -0
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/AccessorType.js +11 -1
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +23 -2
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.js +9 -2
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.d.ts +21 -2
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/DateInputDef.svelte.js +8 -0
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.d.ts +29 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/NumberInputDef.svelte.js +11 -0
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.d.ts +23 -0
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/QueryDef.svelte.js +8 -0
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.d.ts +31 -0
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/SelectDef.svelte.js +17 -3
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.d.ts +21 -2
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/TextInputDef.svelte.js +7 -0
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +29 -1
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.js +17 -3
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +122 -11
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.js +77 -11
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDefSet.d.ts +9 -0
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +41 -1
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +16 -0
- package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +19 -1
- package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js +12 -1
- package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +11 -0
- package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js +6 -3
- package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +19 -0
- package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js +25 -1
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +26 -0
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.js +20 -5
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +43 -7
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.js +18 -3
- package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +19 -5
- package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.js +16 -5
- package/dist/Components/Table/Types/Columns/Definitions/JSONColumnDefSet.d.ts +14 -0
- package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.d.ts +34 -2
- package/dist/Components/Table/Types/Columns/Definitions/RowSelection/RowSelectionDef.svelte.js +30 -7
- package/dist/Components/Table/Types/Columns/Definitions/ValidationFn.d.ts +17 -0
- package/dist/Components/Table/Types/Columns/DefsWrapper.d.ts +10 -0
- package/dist/Components/Table/Types/Columns/DisplayType.d.ts +13 -0
- package/dist/Components/Table/Types/Columns/DisplayType.js +14 -1
- package/dist/Components/Table/Types/Columns/ExpandColumn.d.ts +5 -0
- package/dist/Components/Table/Types/Columns/ExpandTableCell.d.ts +7 -0
- package/dist/Components/Table/Types/Columns/JSONColumnPinningState.d.ts +6 -0
- package/dist/Components/Table/Types/Columns/ProgressBarColumn.d.ts +5 -0
- package/dist/Components/Table/Types/Columns/ProgressBarTableCell.d.ts +9 -0
- package/dist/Components/Table/Types/Columns/TableActionButton.d.ts +12 -0
- package/dist/Components/Table/Types/Columns/TableCell.d.ts +16 -2
- package/dist/Components/Table/Types/Columns/VisibilityState.d.ts +12 -0
- package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.d.ts +173 -0
- package/dist/Components/Table/Types/Context/ColumnLayoutState.svelte.js +241 -0
- package/dist/Components/Table/Types/Context/FilteringState.svelte.d.ts +166 -0
- package/dist/Components/Table/Types/Context/FilteringState.svelte.js +180 -0
- package/dist/Components/Table/Types/Context/FocusState.svelte.d.ts +316 -0
- package/dist/Components/Table/Types/Context/FocusState.svelte.js +751 -0
- package/dist/Components/Table/Types/Context/ITable.d.ts +10 -0
- package/dist/Components/Table/Types/Context/PreferencesState.svelte.d.ts +242 -0
- package/dist/Components/Table/Types/Context/PreferencesState.svelte.js +317 -0
- package/dist/Components/Table/Types/Context/ReadonlyRowModel.d.ts +14 -3
- package/dist/Components/Table/Types/Context/Row.d.ts +18 -0
- package/dist/Components/Table/Types/Context/RowModel.d.ts +11 -0
- package/dist/Components/Table/Types/Context/SelectionState.svelte.d.ts +260 -0
- package/dist/Components/Table/Types/Context/SelectionState.svelte.js +613 -0
- package/dist/Components/Table/Types/Context/SortingState.svelte.d.ts +112 -0
- package/dist/Components/Table/Types/Context/SortingState.svelte.js +272 -0
- package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +547 -53
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +959 -1259
- package/dist/Components/Table/Types/Context/TableInitOptions.d.ts +16 -0
- package/dist/Components/Table/Types/Context/TableSettings.d.ts +20 -0
- package/dist/Components/Table/Types/Context/VirtualisationState.svelte.d.ts +167 -0
- package/dist/Components/Table/Types/Context/VirtualisationState.svelte.js +226 -0
- package/dist/Components/Table/Types/Coordinates/CellCoordinates.d.ts +12 -0
- package/dist/Components/Table/Types/Coordinates/CellCoordinatesWithoutColumn.d.ts +5 -0
- package/dist/Components/Table/Types/Coordinates/ColumnIndices.d.ts +16 -2
- package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.d.ts +143 -0
- package/dist/Components/Table/Types/DataRepository/BuiltInRemoteRepository.svelte.js +454 -0
- package/dist/Components/Table/Types/DataRepository/IDataRepository.d.ts +21 -0
- package/dist/Components/Table/Types/DataRepository/ILocalDataRepository.d.ts +10 -0
- package/dist/Components/Table/Types/DataRepository/IRemoteDataRepository.d.ts +16 -0
- package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.d.ts +87 -3
- package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.js +112 -7
- package/dist/Components/Table/Types/DataRepository/SortingState.d.ts +12 -0
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.d.ts +87 -2
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +74 -1
- package/dist/Components/Table/Types/ExpandedPanel.d.ts +9 -0
- package/dist/Components/Table/Types/ExpandedPanel.js +10 -1
- package/dist/Components/Table/Types/Filtering/ColumnFiltersState.d.ts +17 -0
- package/dist/Components/Table/Types/Filtering/CustomFilter.d.ts +21 -0
- package/dist/Components/Table/Types/Filtering/CustomFilterType.d.ts +5 -0
- package/dist/Components/Table/Types/Filtering/CustomFilterType.js +6 -1
- package/dist/Components/Table/Types/Filtering/CustomRemoteFilters.d.ts +6 -0
- package/dist/Components/Table/Types/Filtering/FilterFn.d.ts +28 -0
- package/dist/Components/Table/Types/Filtering/FilterMode.d.ts +7 -0
- package/dist/Components/Table/Types/Filtering/FilterType.d.ts +8 -0
- package/dist/Components/Table/Types/Filtering/FilterType.js +9 -1
- package/dist/Components/Table/Types/Filtering/FilterValueType.d.ts +11 -0
- package/dist/Components/Table/Types/Filtering/FilterValueType.js +12 -1
- package/dist/Components/Table/Types/Filtering/HasCustomFilterFunction.d.ts +23 -2
- package/dist/Components/Table/Types/Filtering/NumberDateFilterMode.d.ts +19 -12
- package/dist/Components/Table/Types/Filtering/NumberDateFilterMode.js +18 -14
- package/dist/Components/Table/Types/Filtering/StringFilterMode.d.ts +22 -15
- package/dist/Components/Table/Types/Filtering/StringFilterMode.js +22 -16
- package/dist/Components/Table/Types/Focus/MultiFocusEdge.d.ts +8 -0
- package/dist/Components/Table/Types/Focus/MultiFocusEdge.js +9 -1
- package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.d.ts +22 -0
- package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.js +22 -0
- package/dist/Components/Table/Types/Header.d.ts +8 -0
- package/dist/Components/Table/Types/HeaderGroup.d.ts +7 -0
- package/dist/Components/Table/Types/Layout/CellPinning.d.ts +1 -0
- package/dist/Components/Table/Types/Layout/CellPinning.js +8 -0
- package/dist/Components/Table/Types/OnChangeFn.d.ts +11 -0
- package/dist/Components/Table/Types/Pagination/PaginationState.d.ts +9 -0
- package/dist/Components/Table/Types/Pagination/PaginationType.d.ts +10 -0
- package/dist/Components/Table/Types/Pagination/PaginationType.js +11 -1
- package/dist/Components/Table/Types/Public/AnyEditEvent.d.ts +30 -0
- package/dist/Components/Table/Types/Public/AnyEditEvent.js +1 -0
- package/dist/Components/Table/Types/Public/BaseColumnOptions.d.ts +44 -0
- package/dist/Components/Table/Types/Public/BaseColumnOptions.js +1 -0
- package/dist/Components/Table/Types/Public/ColumnFactory.d.ts +35 -0
- package/dist/Components/Table/Types/Public/ColumnFactory.js +1 -0
- package/dist/Components/Table/Types/Public/ColumnOptions.d.ts +238 -0
- package/dist/Components/Table/Types/Public/ColumnOptions.js +1 -0
- package/dist/Components/Table/Types/Public/ColumnSpec.d.ts +39 -0
- package/dist/Components/Table/Types/Public/ColumnSpec.js +1 -0
- package/dist/Components/Table/Types/Public/CreateTableOptions.d.ts +87 -0
- package/dist/Components/Table/Types/Public/CreateTableOptions.js +1 -0
- package/dist/Components/Table/Types/Public/KeyConstraints.d.ts +42 -0
- package/dist/Components/Table/Types/Public/KeyConstraints.js +22 -0
- package/dist/Components/Table/Types/Public/RowSource.d.ts +87 -0
- package/dist/Components/Table/Types/Public/RowSource.js +1 -0
- package/dist/Components/Table/Types/Public/SelectionOptions.d.ts +26 -0
- package/dist/Components/Table/Types/Public/SelectionOptions.js +1 -0
- package/dist/Components/Table/Types/Public/Table.d.ts +39 -0
- package/dist/Components/Table/Types/Public/Table.js +1 -0
- package/dist/Components/Table/Types/Public/TableInitialState.d.ts +26 -0
- package/dist/Components/Table/Types/Public/TableInitialState.js +1 -0
- package/dist/Components/Table/Types/Public/TablePersistence.d.ts +38 -0
- package/dist/Components/Table/Types/Public/TablePersistence.js +1 -0
- package/dist/Components/Table/Types/Public/TableSubApis.d.ts +157 -0
- package/dist/Components/Table/Types/Public/TableSubApis.js +1 -0
- package/dist/Components/Table/Types/Public/index.d.ts +20 -0
- package/dist/Components/Table/Types/Public/index.js +8 -0
- package/dist/Components/Table/Types/Toolbar/ToolbarPosition.d.ts +4 -0
- package/dist/Components/Table/Types/Toolbar/ToolbarPosition.js +5 -1
- package/dist/Components/Table/createTable.svelte.d.ts +53 -0
- package/dist/Components/Table/createTable.svelte.js +269 -0
- package/dist/Components/Test/TestContextConsumer.svelte +13 -13
- package/dist/Components/TextArea.svelte +127 -108
- package/dist/Components/TextAreaProps.d.ts +37 -0
- package/dist/Components/TextInput.svelte +166 -147
- package/dist/Components/TextInputProps.d.ts +58 -1
- package/dist/Components/ThreeStateRadio.svelte +140 -143
- package/dist/Components/ThreeStateRadioProps.d.ts +29 -1
- package/dist/Components/Touch/BoolCard.svelte +45 -52
- package/dist/Components/Touch/BoolCard.svelte.d.ts +1 -10
- package/dist/Components/Touch/BoolCardProps.d.ts +21 -0
- package/dist/Components/Touch/BoolCardProps.js +1 -0
- package/dist/Components/Touch/DateModal.svelte +209 -217
- package/dist/Components/Touch/DateModal.svelte.d.ts +1 -17
- package/dist/Components/Touch/DateModalProps.d.ts +36 -0
- package/dist/Components/Touch/DateModalProps.js +1 -0
- package/dist/Components/Touch/EditCard.svelte +59 -52
- package/dist/Components/Touch/EditCardProps.d.ts +21 -0
- package/dist/Components/Touch/InfoCard.svelte +35 -28
- package/dist/Components/Touch/InfoCardProps.d.ts +9 -0
- package/dist/Components/Touch/InfoTextCard.svelte +28 -21
- package/dist/Components/Touch/InfoTextCardProps.d.ts +8 -0
- package/dist/Components/Touch/ModalExplanation.svelte +17 -20
- package/dist/Components/Touch/ModalExplanation.svelte.d.ts +1 -6
- package/dist/Components/Touch/ModalExplanationProps.d.ts +22 -0
- package/dist/Components/Touch/ModalExplanationProps.js +1 -0
- package/dist/Components/Touch/NumberKeyboard.svelte +225 -268
- package/dist/Components/Touch/NumberKeyboardProps.d.ts +19 -0
- package/dist/Components/Touch/NumberModal.svelte +79 -69
- package/dist/Components/Touch/NumberModalProps.d.ts +23 -1
- package/dist/Components/Touch/PlusMinusCard.svelte +48 -52
- package/dist/Components/Touch/PlusMinusCard.svelte.d.ts +1 -6
- package/dist/Components/Touch/PlusMinusCardProps.d.ts +18 -0
- package/dist/Components/Touch/PlusMinusCardProps.js +1 -0
- package/dist/Components/Touch/SelectModal.svelte +123 -105
- package/dist/Components/Touch/SelectModalProps.d.ts +22 -1
- package/dist/Components/Touch/SummaryCard.svelte +107 -65
- package/dist/Components/Touch/SummaryCardProps.d.ts +16 -3
- package/dist/Components/Touch/TextAreaModal.svelte +95 -86
- package/dist/Components/Touch/TextAreaModalProps.d.ts +21 -0
- package/dist/Components/Touch/TextModal.svelte +106 -123
- package/dist/Components/Touch/TextModalProps.d.ts +28 -1
- package/dist/Components/Touch/TouchCard.svelte +34 -72
- package/dist/Components/Touch/TouchCardProps.d.ts +21 -0
- package/dist/Components/Touch/TouchModal.svelte +265 -259
- package/dist/Components/Touch/TouchModalProps.d.ts +35 -1
- package/dist/Components/Touch/UtilityButton.svelte +116 -98
- package/dist/Components/Touch/UtilityButtonProps.d.ts +16 -0
- package/dist/Components/VerticalTabGroup.svelte +80 -102
- package/dist/Components/VerticalTabGroupButton.svelte +59 -98
- package/dist/Components/VerticalTabGroupProps.d.ts +15 -2
- package/dist/Contexts/AlertContext.svelte.d.ts +92 -8
- package/dist/Contexts/AlertContext.svelte.js +69 -6
- package/dist/Contexts/ContextMenuContext.svelte.d.ts +54 -8
- package/dist/Contexts/ContextMenuContext.svelte.js +48 -2
- package/dist/Contexts/TestContext.svelte.d.ts +27 -1
- package/dist/Contexts/TestContext.svelte.js +29 -1
- package/dist/Contexts/ToastContext.svelte.d.ts +29 -1
- package/dist/Contexts/ToastContext.svelte.js +93 -24
- package/dist/Contexts/TooltipContext.svelte.d.ts +68 -1
- package/dist/Contexts/TooltipContext.svelte.js +70 -7
- package/dist/Contexts/UntypedInputContext.svelte.d.ts +54 -5
- package/dist/Contexts/UntypedInputContext.svelte.js +87 -34
- package/dist/Delay/Delay.js +1 -1
- package/dist/Helpers/AsyncFlag.svelte.d.ts +39 -0
- package/dist/Helpers/AsyncFlag.svelte.js +72 -0
- package/dist/Helpers/Datamatrix.d.ts +19 -10
- package/dist/Helpers/Datamatrix.js +291 -2
- package/dist/Helpers/Helpers.svelte.d.ts +252 -17
- package/dist/Helpers/Helpers.svelte.js +271 -60
- package/dist/Helpers/INamed.d.ts +6 -0
- package/dist/Helpers/Storage.d.ts +67 -0
- package/dist/Helpers/Storage.js +138 -0
- package/dist/Helpers/dropdownPortal.d.ts +52 -0
- package/dist/Helpers/dropdownPortal.js +232 -0
- package/dist/Helpers/dropdownPortal.svelte.d.ts +2 -0
- package/dist/Helpers/dropdownPortal.svelte.js +5 -0
- package/dist/Helpers/memoiseByRow.d.ts +45 -0
- package/dist/Helpers/memoiseByRow.js +78 -0
- package/dist/Helpers/prefersReducedMotion.svelte.d.ts +27 -0
- package/dist/Helpers/prefersReducedMotion.svelte.js +18 -0
- package/dist/Helpers/useTooltip.svelte.d.ts +53 -0
- package/dist/Helpers/useTooltip.svelte.js +62 -0
- package/dist/Types/Examples/ExampleModal.svelte +35 -34
- package/dist/Types/Examples/ExampleSelectEnum.js +1 -1
- package/dist/Types/Internal/AsyncFlag.d.ts +7 -0
- package/dist/Types/Internal/AsyncFlag.js +1 -0
- package/dist/Types/Internal/BigRadioOption.d.ts +8 -0
- package/dist/Types/Internal/ButtonProp.d.ts +24 -2
- package/dist/Types/Internal/CallbackButton.d.ts +12 -0
- package/dist/Types/Internal/DateChange.d.ts +8 -0
- package/dist/Types/Internal/DatePickerType.d.ts +5 -0
- package/dist/Types/Internal/DatePickerType.js +6 -1
- package/dist/Types/Internal/IdentifiableToastMessage.d.ts +8 -0
- package/dist/Types/Internal/InputVariant.d.ts +5 -0
- package/dist/Types/Internal/InputVariant.js +6 -1
- package/dist/Types/Internal/Misc.d.ts +91 -0
- package/dist/Types/Internal/RefWrapper.d.ts +6 -0
- package/dist/Types/Internal/SelectOption.d.ts +8 -0
- package/dist/Types/Internal/Shape.d.ts +1 -0
- package/dist/Types/Internal/Shape.js +2 -1
- package/dist/Types/Internal/Side.d.ts +1 -0
- package/dist/Types/Internal/Side.js +2 -1
- package/dist/Types/Internal/Size.d.ts +5 -0
- package/dist/Types/Internal/Size.js +6 -1
- package/dist/Types/Internal/TabOption.d.ts +15 -5
- package/dist/Types/Internal/Ternary.d.ts +6 -0
- package/dist/Types/Internal/Ternary.js +7 -1
- package/dist/Types/Internal/ToastMessage.d.ts +28 -0
- package/dist/Types/Internal/Validity.d.ts +6 -0
- package/dist/Types/Internal/Validity.js +7 -1
- package/dist/Types/Internal/ValidityWrapper.d.ts +8 -0
- package/dist/Types/Internal/Variant.d.ts +5 -0
- package/dist/Types/Internal/Variant.js +6 -1
- package/dist/index.d.ts +27 -82
- package/dist/index.js +24 -62
- package/dist/scss/_basics.scss +12 -12
- package/dist/scss/_colours.scss +134 -134
- package/dist/scss/_mixins.scss +3300 -3016
- package/dist/scss/_motion.scss +57 -0
- package/dist/scss/_sizing.scss +85 -69
- package/dist/scss/_transitions.scss +8 -8
- package/dist/scss/colours.js +2 -2
- package/dist/scss/sizing.d.ts +9 -0
- package/dist/scss/sizing.js +10 -1
- package/package.json +6 -2
|
@@ -1,6 +1,22 @@
|
|
|
1
1
|
import type { CellCoordinates } from '../Coordinates/CellCoordinates.js';
|
|
2
2
|
import type { ToolbarPosition } from '../Toolbar/ToolbarPosition.js';
|
|
3
|
+
/** Allowable primary-key types for the table's `selectionExtractor`. */
|
|
3
4
|
export type Primitive = string | number;
|
|
5
|
+
/**
|
|
6
|
+
* Consumer-facing init options passed to `createLocalTable` / the `Table`
|
|
7
|
+
* component. All defaults match the values noted in the inline comments.
|
|
8
|
+
*
|
|
9
|
+
* - `selectionExtractor` is mandatory: it returns the unique row id (used by
|
|
10
|
+
* row-selection, focus, and column-preset code). May return a Promise so
|
|
11
|
+
* the id can be derived from an async source.
|
|
12
|
+
* - `getUserId` is currently mandatory (consumers pass `() => undefined` if
|
|
13
|
+
* not applicable). Promoting it to optional with a default of `() =>
|
|
14
|
+
* undefined` is deferred (workorder Types-Context-supporting finding 7).
|
|
15
|
+
* - `onEditCell` is invoked when a cell finishes editing. `value` is typed
|
|
16
|
+
* `unknown` because the table does not statically know which cell shape
|
|
17
|
+
* the edit applies to; consumers narrow it from `coords.id` at the call
|
|
18
|
+
* site.
|
|
19
|
+
*/
|
|
4
20
|
export interface TableInitOptions<T extends object, Identifier extends Primitive> {
|
|
5
21
|
selectionExtractor: (item: T) => Identifier | Promise<Identifier>;
|
|
6
22
|
allowCopy?: boolean;
|
|
@@ -1,3 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* User-controlled visual / behavioural settings for a table. Held in
|
|
3
|
+
* `TableContext` and exposed to the settings panel.
|
|
4
|
+
*
|
|
5
|
+
* - `isCompact` - reduces row padding for higher row density.
|
|
6
|
+
* - `singleClickEditing` - enter edit mode on single click (default is double
|
|
7
|
+
* click).
|
|
8
|
+
* - `alternateRowColours` - zebra striping.
|
|
9
|
+
* - `changeColourOnHover` - hover highlight on body rows.
|
|
10
|
+
* - `copyWithHeaders` - copy operation includes the header row.
|
|
11
|
+
* - `commaSeparatedCopy` - copy operation uses CSV instead of TSV.
|
|
12
|
+
*/
|
|
1
13
|
export interface TableSettings {
|
|
2
14
|
isCompact: boolean;
|
|
3
15
|
singleClickEditing: boolean;
|
|
@@ -6,6 +18,14 @@ export interface TableSettings {
|
|
|
6
18
|
copyWithHeaders: boolean;
|
|
7
19
|
commaSeparatedCopy: boolean;
|
|
8
20
|
}
|
|
21
|
+
/**
|
|
22
|
+
* The persisted-to-localStorage projection of `TableSettings`. Every field is
|
|
23
|
+
* optional because older payloads may be missing the newer fields; the
|
|
24
|
+
* loader fills in defaults from the current `TableSettings` shape.
|
|
25
|
+
*
|
|
26
|
+
* Equivalent to `Partial<TableSettings>`; written out explicitly so the
|
|
27
|
+
* persisted shape is greppable.
|
|
28
|
+
*/
|
|
9
29
|
export interface SavedTableSettings {
|
|
10
30
|
isCompact?: boolean;
|
|
11
31
|
singleClickEditing?: boolean;
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
import type { Row } from './Row.js';
|
|
2
|
+
/**
|
|
3
|
+
* Dependency surface that `VirtualisationState` reads from the
|
|
4
|
+
* surrounding `TableContext`. Every dependency is passed as a thunk so
|
|
5
|
+
* the sub-context never holds a direct reference to the parent;
|
|
6
|
+
* reactivity threads through `$derived` exactly as it does for the
|
|
7
|
+
* other Phase 6 sub-contexts.
|
|
8
|
+
*/
|
|
9
|
+
export interface VirtualisationStateDeps<T extends object> {
|
|
10
|
+
/** The full, ordered list of rows currently in scope (the
|
|
11
|
+
* `paginationRowModel.rows` array from `TableContext`). */
|
|
12
|
+
getRows: () => ReadonlyArray<Row<T>>;
|
|
13
|
+
/** Per-row height lookup. The implementation reads from the
|
|
14
|
+
* `_columnLayout` row-height pool (Phase 7.1 Item B) - whichever
|
|
15
|
+
* side has the tallest registered height for the row. Returning
|
|
16
|
+
* `undefined` (or 0) means "no observation yet" and the
|
|
17
|
+
* estimated-row-height fallback is used. */
|
|
18
|
+
getRowHeight: (rowId: string) => number | undefined;
|
|
19
|
+
/** Estimated row height used when no observed height is available
|
|
20
|
+
* yet for a row. Defaults to 48 (the CSS `--height: 3rem` baseline).
|
|
21
|
+
* Compact tables (`isCompact = true`) pass a smaller estimate via
|
|
22
|
+
* this thunk so the totalHeight is in the right ballpark before
|
|
23
|
+
* any row has been observed. */
|
|
24
|
+
getEstimatedRowHeight: () => number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Phase 7.4 row virtualisation. When the current row count exceeds
|
|
28
|
+
* `_virtualisationThreshold` (default 100) only the rows currently in
|
|
29
|
+
* the viewport (plus a small overscan band above and below) are
|
|
30
|
+
* rendered; the rest of the body height is reserved by two spacer
|
|
31
|
+
* `<tr>` rows in `TableBody.svelte`. Below the threshold every row is
|
|
32
|
+
* rendered directly, matching the legacy behaviour.
|
|
33
|
+
*
|
|
34
|
+
* The state is a sibling to `_columnLayout`, `_filtering`, `_sorting`,
|
|
35
|
+
* etc. Three reasons it lives in its own sub-context rather than on
|
|
36
|
+
* `_columnLayout`:
|
|
37
|
+
*
|
|
38
|
+
* - the threshold + overscan + scroll position are virtualisation-
|
|
39
|
+
* specific concerns the column-layout code does not need;
|
|
40
|
+
* - the heights map on `_columnLayout` is keyed by `(side, rowId)`
|
|
41
|
+
* while virtualisation only ever wants the max across sides
|
|
42
|
+
* (which determines the row's slot height);
|
|
43
|
+
* - the `visibleRange` / `visibleRows` derived chain is read by all
|
|
44
|
+
* three `TableBody` instances; keeping it on its own state object
|
|
45
|
+
* means `_columnLayout` does not become a god-object again.
|
|
46
|
+
*
|
|
47
|
+
* Scroll synchronisation: the three side `<table>` elements sit inside
|
|
48
|
+
* the same `.datatable` overflow container (see `Table.svelte`), so
|
|
49
|
+
* vertical scrolling is already shared. Only ONE scroll listener is
|
|
50
|
+
* needed - it is attached in `Table.svelte` on the outer
|
|
51
|
+
* `.datatable` element and reports both `scrollTop` and
|
|
52
|
+
* `clientHeight` via `registerScrollPosition`.
|
|
53
|
+
*
|
|
54
|
+
* Stability across sort / filter / pagination: rows are keyed by
|
|
55
|
+
* `row.id` (the visible index as a string assigned by
|
|
56
|
+
* `paginationRowModel`), so `{#each visibleRows as { row } (row.id)}`
|
|
57
|
+
* remains the keying surface and Svelte's diffing stays unchanged.
|
|
58
|
+
* The `_selection._keyCache` (Phase 6.5) is keyed by `row.original`,
|
|
59
|
+
* not by index or `row.id`, so virtualisation is transparent to it.
|
|
60
|
+
*/
|
|
61
|
+
export declare class VirtualisationState<T extends object> {
|
|
62
|
+
private readonly _deps;
|
|
63
|
+
private readonly _virtualisationThreshold;
|
|
64
|
+
private readonly _overscan;
|
|
65
|
+
/** Latest scroll position reported by the host. 0 by default so the
|
|
66
|
+
* first paint (before any scroll event) shows the top of the
|
|
67
|
+
* list. */
|
|
68
|
+
private _scrollTop;
|
|
69
|
+
/** Latest viewport height reported by the host. The fallback of
|
|
70
|
+
* 600 is chosen so that virtualisation has SOMETHING to clip
|
|
71
|
+
* against before the first measurement - the overscan band keeps
|
|
72
|
+
* the initial paint reasonable even if the real height is
|
|
73
|
+
* smaller. */
|
|
74
|
+
private _viewportHeight;
|
|
75
|
+
constructor(deps: VirtualisationStateDeps<T>, options?: {
|
|
76
|
+
threshold?: number;
|
|
77
|
+
overscan?: number;
|
|
78
|
+
});
|
|
79
|
+
get virtualisationThreshold(): number;
|
|
80
|
+
get overscan(): number;
|
|
81
|
+
get scrollTop(): number;
|
|
82
|
+
get viewportHeight(): number;
|
|
83
|
+
/**
|
|
84
|
+
* Returns true when the current row count is above the
|
|
85
|
+
* virtualisation threshold. Below threshold the public API still
|
|
86
|
+
* works (visibleRows returns every row, padding spacers are 0),
|
|
87
|
+
* but consumers can short-circuit DOM work that is only needed in
|
|
88
|
+
* the virtualised path by reading this flag.
|
|
89
|
+
*/
|
|
90
|
+
readonly isVirtualised: boolean;
|
|
91
|
+
/**
|
|
92
|
+
* Per-row resolved height. Uses the observed height from the
|
|
93
|
+
* `_columnLayout` row-height pool when available, falling back to
|
|
94
|
+
* the estimated row height (which keeps the totalHeight stable
|
|
95
|
+
* before the first ResizeObserver tick).
|
|
96
|
+
*/
|
|
97
|
+
private _resolveHeight;
|
|
98
|
+
/**
|
|
99
|
+
* Sum of all row heights. This is the height the body container
|
|
100
|
+
* must reserve so the scrollbar matches the un-virtualised height.
|
|
101
|
+
*
|
|
102
|
+
* Below threshold the value is still correct (sum of all observed
|
|
103
|
+
* row heights or fallbacks), but consumers should generally not
|
|
104
|
+
* apply it as `min-height` to the body container when below
|
|
105
|
+
* threshold - the natural row flow does the right thing.
|
|
106
|
+
*/
|
|
107
|
+
readonly totalHeight: number;
|
|
108
|
+
/**
|
|
109
|
+
* Half-open `[start, end)` row-index range that should be rendered
|
|
110
|
+
* in the DOM. Below the virtualisation threshold this is the full
|
|
111
|
+
* `[0, rows.length)`. Above threshold it is the slice covering the
|
|
112
|
+
* viewport (scrollTop -> scrollTop + viewportHeight) widened by
|
|
113
|
+
* `_overscan` rows above and below.
|
|
114
|
+
*
|
|
115
|
+
* The walk over row heights is O(N) per re-derive but only fires
|
|
116
|
+
* when `_scrollTop`, `_viewportHeight`, the rows array, or any
|
|
117
|
+
* relevant row height changes; for N <= a few thousand this is
|
|
118
|
+
* well under a millisecond.
|
|
119
|
+
*/
|
|
120
|
+
readonly visibleRange: {
|
|
121
|
+
start: number;
|
|
122
|
+
end: number;
|
|
123
|
+
};
|
|
124
|
+
/**
|
|
125
|
+
* The slice of rows the body should render. Each entry carries:
|
|
126
|
+
* - `row`: the underlying `Row<T>` (for keying and cell rendering);
|
|
127
|
+
* - `top`: the pixel offset of the row from the top of the body
|
|
128
|
+
* container (used as the spacer-row height directly preceding
|
|
129
|
+
* it, computed cumulatively below);
|
|
130
|
+
* - `height`: the row's resolved height (observed or fallback).
|
|
131
|
+
*
|
|
132
|
+
* The cumulative offset of `visibleRows[0]` equals
|
|
133
|
+
* `topSpacerHeight`; the cumulative offset of `visibleRows[end-1] +
|
|
134
|
+
* its height` plus `bottomSpacerHeight` equals `totalHeight`.
|
|
135
|
+
*/
|
|
136
|
+
readonly visibleRows: ReadonlyArray<{
|
|
137
|
+
row: Row<T>;
|
|
138
|
+
top: number;
|
|
139
|
+
height: number;
|
|
140
|
+
}>;
|
|
141
|
+
/**
|
|
142
|
+
* Top spacer height: sum of heights of all rows BEFORE the visible
|
|
143
|
+
* window. Rendered as an empty `<tr>` of this height in
|
|
144
|
+
* `TableBody.svelte` so the visible rows appear at their correct
|
|
145
|
+
* vertical position.
|
|
146
|
+
*/
|
|
147
|
+
readonly topSpacerHeight: number;
|
|
148
|
+
/**
|
|
149
|
+
* Bottom spacer height: sum of heights of all rows AFTER the
|
|
150
|
+
* visible window. Rendered as an empty `<tr>` of this height in
|
|
151
|
+
* `TableBody.svelte` so the body reserves the full virtualised
|
|
152
|
+
* height and the scrollbar reflects the un-virtualised length.
|
|
153
|
+
*/
|
|
154
|
+
readonly bottomSpacerHeight: number;
|
|
155
|
+
/**
|
|
156
|
+
* Reports the current scroll position and viewport height. Called
|
|
157
|
+
* by `Table.svelte` from a single scroll listener on the outer
|
|
158
|
+
* `.datatable` container; the three side TableBody instances all
|
|
159
|
+
* read the resulting `visibleRows` so they stay in sync without
|
|
160
|
+
* extra plumbing.
|
|
161
|
+
*
|
|
162
|
+
* The setter early-exits when neither value changed so identical
|
|
163
|
+
* back-to-back scroll events (common on macOS rubber-band) do not
|
|
164
|
+
* retrigger the derived chain.
|
|
165
|
+
*/
|
|
166
|
+
readonly registerScrollPosition: (scrollTop: number, viewportHeight: number) => void;
|
|
167
|
+
}
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Phase 7.4 row virtualisation. When the current row count exceeds
|
|
3
|
+
* `_virtualisationThreshold` (default 100) only the rows currently in
|
|
4
|
+
* the viewport (plus a small overscan band above and below) are
|
|
5
|
+
* rendered; the rest of the body height is reserved by two spacer
|
|
6
|
+
* `<tr>` rows in `TableBody.svelte`. Below the threshold every row is
|
|
7
|
+
* rendered directly, matching the legacy behaviour.
|
|
8
|
+
*
|
|
9
|
+
* The state is a sibling to `_columnLayout`, `_filtering`, `_sorting`,
|
|
10
|
+
* etc. Three reasons it lives in its own sub-context rather than on
|
|
11
|
+
* `_columnLayout`:
|
|
12
|
+
*
|
|
13
|
+
* - the threshold + overscan + scroll position are virtualisation-
|
|
14
|
+
* specific concerns the column-layout code does not need;
|
|
15
|
+
* - the heights map on `_columnLayout` is keyed by `(side, rowId)`
|
|
16
|
+
* while virtualisation only ever wants the max across sides
|
|
17
|
+
* (which determines the row's slot height);
|
|
18
|
+
* - the `visibleRange` / `visibleRows` derived chain is read by all
|
|
19
|
+
* three `TableBody` instances; keeping it on its own state object
|
|
20
|
+
* means `_columnLayout` does not become a god-object again.
|
|
21
|
+
*
|
|
22
|
+
* Scroll synchronisation: the three side `<table>` elements sit inside
|
|
23
|
+
* the same `.datatable` overflow container (see `Table.svelte`), so
|
|
24
|
+
* vertical scrolling is already shared. Only ONE scroll listener is
|
|
25
|
+
* needed - it is attached in `Table.svelte` on the outer
|
|
26
|
+
* `.datatable` element and reports both `scrollTop` and
|
|
27
|
+
* `clientHeight` via `registerScrollPosition`.
|
|
28
|
+
*
|
|
29
|
+
* Stability across sort / filter / pagination: rows are keyed by
|
|
30
|
+
* `row.id` (the visible index as a string assigned by
|
|
31
|
+
* `paginationRowModel`), so `{#each visibleRows as { row } (row.id)}`
|
|
32
|
+
* remains the keying surface and Svelte's diffing stays unchanged.
|
|
33
|
+
* The `_selection._keyCache` (Phase 6.5) is keyed by `row.original`,
|
|
34
|
+
* not by index or `row.id`, so virtualisation is transparent to it.
|
|
35
|
+
*/
|
|
36
|
+
export class VirtualisationState {
|
|
37
|
+
_deps;
|
|
38
|
+
_virtualisationThreshold;
|
|
39
|
+
_overscan;
|
|
40
|
+
/** Latest scroll position reported by the host. 0 by default so the
|
|
41
|
+
* first paint (before any scroll event) shows the top of the
|
|
42
|
+
* list. */
|
|
43
|
+
_scrollTop = $state(0);
|
|
44
|
+
/** Latest viewport height reported by the host. The fallback of
|
|
45
|
+
* 600 is chosen so that virtualisation has SOMETHING to clip
|
|
46
|
+
* against before the first measurement - the overscan band keeps
|
|
47
|
+
* the initial paint reasonable even if the real height is
|
|
48
|
+
* smaller. */
|
|
49
|
+
_viewportHeight = $state(600);
|
|
50
|
+
constructor(deps, options = {}) {
|
|
51
|
+
this._deps = deps;
|
|
52
|
+
this._virtualisationThreshold = options.threshold ?? 100;
|
|
53
|
+
this._overscan = options.overscan ?? 10;
|
|
54
|
+
}
|
|
55
|
+
get virtualisationThreshold() {
|
|
56
|
+
return this._virtualisationThreshold;
|
|
57
|
+
}
|
|
58
|
+
get overscan() {
|
|
59
|
+
return this._overscan;
|
|
60
|
+
}
|
|
61
|
+
get scrollTop() {
|
|
62
|
+
return this._scrollTop;
|
|
63
|
+
}
|
|
64
|
+
get viewportHeight() {
|
|
65
|
+
return this._viewportHeight;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Returns true when the current row count is above the
|
|
69
|
+
* virtualisation threshold. Below threshold the public API still
|
|
70
|
+
* works (visibleRows returns every row, padding spacers are 0),
|
|
71
|
+
* but consumers can short-circuit DOM work that is only needed in
|
|
72
|
+
* the virtualised path by reading this flag.
|
|
73
|
+
*/
|
|
74
|
+
isVirtualised = $derived.by(() => this._deps.getRows().length > this._virtualisationThreshold);
|
|
75
|
+
/**
|
|
76
|
+
* Per-row resolved height. Uses the observed height from the
|
|
77
|
+
* `_columnLayout` row-height pool when available, falling back to
|
|
78
|
+
* the estimated row height (which keeps the totalHeight stable
|
|
79
|
+
* before the first ResizeObserver tick).
|
|
80
|
+
*/
|
|
81
|
+
_resolveHeight(rowId) {
|
|
82
|
+
const observed = this._deps.getRowHeight(rowId);
|
|
83
|
+
if (observed && observed > 0) {
|
|
84
|
+
return observed;
|
|
85
|
+
}
|
|
86
|
+
return this._deps.getEstimatedRowHeight();
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Sum of all row heights. This is the height the body container
|
|
90
|
+
* must reserve so the scrollbar matches the un-virtualised height.
|
|
91
|
+
*
|
|
92
|
+
* Below threshold the value is still correct (sum of all observed
|
|
93
|
+
* row heights or fallbacks), but consumers should generally not
|
|
94
|
+
* apply it as `min-height` to the body container when below
|
|
95
|
+
* threshold - the natural row flow does the right thing.
|
|
96
|
+
*/
|
|
97
|
+
totalHeight = $derived.by(() => {
|
|
98
|
+
const rows = this._deps.getRows();
|
|
99
|
+
let total = 0;
|
|
100
|
+
for (let i = 0; i < rows.length; i++) {
|
|
101
|
+
total += this._resolveHeight(rows[i].id);
|
|
102
|
+
}
|
|
103
|
+
return total;
|
|
104
|
+
});
|
|
105
|
+
/**
|
|
106
|
+
* Half-open `[start, end)` row-index range that should be rendered
|
|
107
|
+
* in the DOM. Below the virtualisation threshold this is the full
|
|
108
|
+
* `[0, rows.length)`. Above threshold it is the slice covering the
|
|
109
|
+
* viewport (scrollTop -> scrollTop + viewportHeight) widened by
|
|
110
|
+
* `_overscan` rows above and below.
|
|
111
|
+
*
|
|
112
|
+
* The walk over row heights is O(N) per re-derive but only fires
|
|
113
|
+
* when `_scrollTop`, `_viewportHeight`, the rows array, or any
|
|
114
|
+
* relevant row height changes; for N <= a few thousand this is
|
|
115
|
+
* well under a millisecond.
|
|
116
|
+
*/
|
|
117
|
+
visibleRange = $derived.by(() => {
|
|
118
|
+
const rows = this._deps.getRows();
|
|
119
|
+
if (rows.length === 0) {
|
|
120
|
+
return { start: 0, end: 0 };
|
|
121
|
+
}
|
|
122
|
+
if (rows.length <= this._virtualisationThreshold) {
|
|
123
|
+
return { start: 0, end: rows.length };
|
|
124
|
+
}
|
|
125
|
+
const top = this._scrollTop;
|
|
126
|
+
const bottom = top + this._viewportHeight;
|
|
127
|
+
let offset = 0;
|
|
128
|
+
let start = 0;
|
|
129
|
+
let end = rows.length;
|
|
130
|
+
let foundStart = false;
|
|
131
|
+
for (let i = 0; i < rows.length; i++) {
|
|
132
|
+
const h = this._resolveHeight(rows[i].id);
|
|
133
|
+
const rowTop = offset;
|
|
134
|
+
const rowBottom = offset + h;
|
|
135
|
+
if (!foundStart && rowBottom >= top) {
|
|
136
|
+
start = i;
|
|
137
|
+
foundStart = true;
|
|
138
|
+
}
|
|
139
|
+
if (foundStart && rowTop > bottom) {
|
|
140
|
+
end = i;
|
|
141
|
+
break;
|
|
142
|
+
}
|
|
143
|
+
offset += h;
|
|
144
|
+
}
|
|
145
|
+
const overscanned = {
|
|
146
|
+
start: Math.max(0, start - this._overscan),
|
|
147
|
+
end: Math.min(rows.length, end + this._overscan),
|
|
148
|
+
};
|
|
149
|
+
return overscanned;
|
|
150
|
+
});
|
|
151
|
+
/**
|
|
152
|
+
* The slice of rows the body should render. Each entry carries:
|
|
153
|
+
* - `row`: the underlying `Row<T>` (for keying and cell rendering);
|
|
154
|
+
* - `top`: the pixel offset of the row from the top of the body
|
|
155
|
+
* container (used as the spacer-row height directly preceding
|
|
156
|
+
* it, computed cumulatively below);
|
|
157
|
+
* - `height`: the row's resolved height (observed or fallback).
|
|
158
|
+
*
|
|
159
|
+
* The cumulative offset of `visibleRows[0]` equals
|
|
160
|
+
* `topSpacerHeight`; the cumulative offset of `visibleRows[end-1] +
|
|
161
|
+
* its height` plus `bottomSpacerHeight` equals `totalHeight`.
|
|
162
|
+
*/
|
|
163
|
+
visibleRows = $derived.by(() => {
|
|
164
|
+
const rows = this._deps.getRows();
|
|
165
|
+
const range = this.visibleRange;
|
|
166
|
+
const out = [];
|
|
167
|
+
let offset = 0;
|
|
168
|
+
for (let i = 0; i < range.start; i++) {
|
|
169
|
+
offset += this._resolveHeight(rows[i].id);
|
|
170
|
+
}
|
|
171
|
+
for (let i = range.start; i < range.end; i++) {
|
|
172
|
+
const h = this._resolveHeight(rows[i].id);
|
|
173
|
+
out.push({ row: rows[i], top: offset, height: h });
|
|
174
|
+
offset += h;
|
|
175
|
+
}
|
|
176
|
+
return out;
|
|
177
|
+
});
|
|
178
|
+
/**
|
|
179
|
+
* Top spacer height: sum of heights of all rows BEFORE the visible
|
|
180
|
+
* window. Rendered as an empty `<tr>` of this height in
|
|
181
|
+
* `TableBody.svelte` so the visible rows appear at their correct
|
|
182
|
+
* vertical position.
|
|
183
|
+
*/
|
|
184
|
+
topSpacerHeight = $derived.by(() => {
|
|
185
|
+
const rows = this._deps.getRows();
|
|
186
|
+
const range = this.visibleRange;
|
|
187
|
+
let total = 0;
|
|
188
|
+
for (let i = 0; i < range.start; i++) {
|
|
189
|
+
total += this._resolveHeight(rows[i].id);
|
|
190
|
+
}
|
|
191
|
+
return total;
|
|
192
|
+
});
|
|
193
|
+
/**
|
|
194
|
+
* Bottom spacer height: sum of heights of all rows AFTER the
|
|
195
|
+
* visible window. Rendered as an empty `<tr>` of this height in
|
|
196
|
+
* `TableBody.svelte` so the body reserves the full virtualised
|
|
197
|
+
* height and the scrollbar reflects the un-virtualised length.
|
|
198
|
+
*/
|
|
199
|
+
bottomSpacerHeight = $derived.by(() => {
|
|
200
|
+
const rows = this._deps.getRows();
|
|
201
|
+
const range = this.visibleRange;
|
|
202
|
+
let total = 0;
|
|
203
|
+
for (let i = range.end; i < rows.length; i++) {
|
|
204
|
+
total += this._resolveHeight(rows[i].id);
|
|
205
|
+
}
|
|
206
|
+
return total;
|
|
207
|
+
});
|
|
208
|
+
/**
|
|
209
|
+
* Reports the current scroll position and viewport height. Called
|
|
210
|
+
* by `Table.svelte` from a single scroll listener on the outer
|
|
211
|
+
* `.datatable` container; the three side TableBody instances all
|
|
212
|
+
* read the resulting `visibleRows` so they stay in sync without
|
|
213
|
+
* extra plumbing.
|
|
214
|
+
*
|
|
215
|
+
* The setter early-exits when neither value changed so identical
|
|
216
|
+
* back-to-back scroll events (common on macOS rubber-band) do not
|
|
217
|
+
* retrigger the derived chain.
|
|
218
|
+
*/
|
|
219
|
+
registerScrollPosition = (scrollTop, viewportHeight) => {
|
|
220
|
+
if (scrollTop === this._scrollTop && viewportHeight === this._viewportHeight) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
this._scrollTop = scrollTop;
|
|
224
|
+
this._viewportHeight = viewportHeight;
|
|
225
|
+
};
|
|
226
|
+
}
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
import type { MemoryColumnIndex } from './ColumnIndices.js';
|
|
2
|
+
/**
|
|
3
|
+
* Identifies one cell for focus, edit, and multi-selection operations.
|
|
4
|
+
*
|
|
5
|
+
* - `row` is the visible row index (post-pagination, post-sort). Currently a
|
|
6
|
+
* bare `number`; branding to a `VisibleRowIndex` is deferred because the
|
|
7
|
+
* change ripples through every focus call site.
|
|
8
|
+
* - `id` is the column id (a `string` rather than `keyof T` so synthetic
|
|
9
|
+
* columns can be addressed). Many call sites cast it to `string & keyof T`
|
|
10
|
+
* after constructing a `CellCoordinates`; tightening is deferred to the
|
|
11
|
+
* parent `ColumnDef.id` workorder.
|
|
12
|
+
* - `column` is the memory-order index of the column (see `ColumnIndices`).
|
|
13
|
+
*/
|
|
2
14
|
export interface CellCoordinates {
|
|
3
15
|
row: number;
|
|
4
16
|
id: string;
|
|
@@ -1,2 +1,7 @@
|
|
|
1
1
|
import type { CellCoordinates } from './CellCoordinates.js';
|
|
2
|
+
/**
|
|
3
|
+
* `CellCoordinates` minus the `column` memory-index field. Used by code
|
|
4
|
+
* paths that identify a cell by row + id only (typically column-preset
|
|
5
|
+
* lookups before the visible column array has been resolved).
|
|
6
|
+
*/
|
|
2
7
|
export type CellCoordinatesWithoutColumn = Omit<CellCoordinates, 'column'>;
|
|
@@ -1,8 +1,22 @@
|
|
|
1
|
-
/**
|
|
1
|
+
/**
|
|
2
|
+
* Position of a column in the `columnDefs` array (memory / declaration
|
|
3
|
+
* order). Stable across reorder operations: a column's memory index does not
|
|
4
|
+
* change when the user drags it. Used as the canonical identifier when
|
|
5
|
+
* persisting column-preset state.
|
|
6
|
+
*
|
|
7
|
+
* Branded so it cannot be accidentally swapped with a `VisualColumnIndex`.
|
|
8
|
+
* Note: the brand is a string-literal nominal tag rather than a
|
|
9
|
+
* `unique symbol`; the workorder marks symbol-based brands as a deferred
|
|
10
|
+
* tightening (project-wide change tracked under `Misc.ts`).
|
|
11
|
+
*/
|
|
2
12
|
export type MemoryColumnIndex = number & {
|
|
3
13
|
readonly __brand: 'MemoryColumnIndex';
|
|
4
14
|
};
|
|
5
|
-
/**
|
|
15
|
+
/**
|
|
16
|
+
* Position of a column in the visual display order (pinned-left, then
|
|
17
|
+
* centre, then pinned-right). Mutates as the user drags columns or pins /
|
|
18
|
+
* unpins them. Used for focus-arrow navigation and the cell-render order.
|
|
19
|
+
*/
|
|
6
20
|
export type VisualColumnIndex = number & {
|
|
7
21
|
readonly __brand: 'VisualColumnIndex';
|
|
8
22
|
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in remote data repository used by `createTable({ rows: { kind: 'remote' } })`.
|
|
3
|
+
*
|
|
4
|
+
* Phase 1 of the new Table API: this class absorbs the URL construction,
|
|
5
|
+
* filter encoding, pagination, sort, debouncing, and page-size persistence
|
|
6
|
+
* that every consumer was previously reimplementing for itself (see the
|
|
7
|
+
* FloWMS-owned `RemoteTableDataRepository.svelte.ts` for the prior shape).
|
|
8
|
+
*
|
|
9
|
+
* The default filter-encoding strategy is `'query-string'`, which produces
|
|
10
|
+
* a flat `?filter[<id>]=<value>&page=<n>&pageSize=<m>&sort=<col>&direction=<asc|desc>`
|
|
11
|
+
* URL. Consumers whose backend expects a different shape pass a custom
|
|
12
|
+
* `filterEncoding: { encode }` function. Consumers needing complete
|
|
13
|
+
* control over the request lifecycle drop to `kind: 'custom'`, which
|
|
14
|
+
* bypasses this repository entirely.
|
|
15
|
+
*
|
|
16
|
+
* The repository extends `TableDataRepository` for its pagination-state /
|
|
17
|
+
* filter-modes / force-refresh plumbing and implements
|
|
18
|
+
* `IRemoteDataRepository<TRow>` for the surface `TableContext` consumes.
|
|
19
|
+
*
|
|
20
|
+
* @remarks
|
|
21
|
+
*
|
|
22
|
+
* Out of scope for Phase 1:
|
|
23
|
+
*
|
|
24
|
+
* - Sophisticated filter-mode encoding (`StringFilterMode.NotIn`, the
|
|
25
|
+
* `[min, max]` tuple form for ranges, etc.). The Phase 1 default
|
|
26
|
+
* encoder emits raw `?filter[<id>]=<JSON-encoded-value>`. Consumers
|
|
27
|
+
* needing the rich encoding the FloWMS repo currently does should pass
|
|
28
|
+
* a custom encoder in Phase 1 and we will lift the common encodings
|
|
29
|
+
* into the library in Phase 2 once the audit of the consumer's actual
|
|
30
|
+
* backend shape is complete.
|
|
31
|
+
* - The five filter callbacks (`dateFilter` / `numberFilter` / etc.).
|
|
32
|
+
* These are local-only and not meaningful for a remote source. The
|
|
33
|
+
* interface inherits them as optional; left undefined here.
|
|
34
|
+
*/
|
|
35
|
+
import type { ColumnFiltersState } from '../Filtering/ColumnFiltersState.js';
|
|
36
|
+
import type { FilterMode } from '../Filtering/FilterMode.js';
|
|
37
|
+
import type { IRemoteDataRepository } from './IRemoteDataRepository.js';
|
|
38
|
+
import type { SortingState } from './SortingState.js';
|
|
39
|
+
import { TableDataRepository } from './TableDataRepository.svelte.js';
|
|
40
|
+
import type { RemoteRowSource, CustomRowSource } from '../../Types/Public/RowSource.js';
|
|
41
|
+
/**
|
|
42
|
+
* Options passed to the repository's constructor. Mirrors the consumer's
|
|
43
|
+
* `RemoteRowSource<TRow>` shape minus the `kind` discriminator, with the
|
|
44
|
+
* mandatory `tableName` and `getUserId` fields added (these are passed by
|
|
45
|
+
* `createTable(...)` from the top-level options, not from `RowSource`).
|
|
46
|
+
*/
|
|
47
|
+
export interface BuiltInRemoteRepositoryOptions<TRow extends object> extends Omit<RemoteRowSource<TRow>, 'kind'> {
|
|
48
|
+
tableName: string;
|
|
49
|
+
getUserId: () => string | undefined;
|
|
50
|
+
/** Initial page size. Overridden by the persisted value if one exists. */
|
|
51
|
+
pageSize?: number;
|
|
52
|
+
}
|
|
53
|
+
export declare class BuiltInRemoteRepository<TRow extends object> extends TableDataRepository<TRow, unknown> implements IRemoteDataRepository<TRow> {
|
|
54
|
+
private readonly _options;
|
|
55
|
+
readonly paginationType: "Remote";
|
|
56
|
+
readonly filterType: "Virtual";
|
|
57
|
+
readonly manualSorting = true;
|
|
58
|
+
private _data;
|
|
59
|
+
get data(): Array<TRow>;
|
|
60
|
+
set data(v: Array<TRow>);
|
|
61
|
+
private _totalRows;
|
|
62
|
+
get totalRows(): number;
|
|
63
|
+
private set totalRows(value);
|
|
64
|
+
private _lastPage;
|
|
65
|
+
get lastPage(): number;
|
|
66
|
+
private set lastPage(value);
|
|
67
|
+
private _isLoading;
|
|
68
|
+
get isLoading(): boolean;
|
|
69
|
+
loadingMessage: string | undefined;
|
|
70
|
+
private _sorting;
|
|
71
|
+
get sorting(): SortingState;
|
|
72
|
+
set sorting(v: SortingState);
|
|
73
|
+
private _filtering;
|
|
74
|
+
get filtering(): ColumnFiltersState;
|
|
75
|
+
private _abortController;
|
|
76
|
+
private _debounceTimer;
|
|
77
|
+
private _quickFilterFocusCount;
|
|
78
|
+
constructor(_options: BuiltInRemoteRepositoryOptions<TRow>);
|
|
79
|
+
readonly setFilterMode: (id: string, mode: FilterMode) => void;
|
|
80
|
+
readonly filterBy: (id: string, value: unknown) => void;
|
|
81
|
+
readonly resetFilters: () => void;
|
|
82
|
+
readonly setPage: (page: number) => void;
|
|
83
|
+
readonly nextPage: () => void;
|
|
84
|
+
readonly prevPage: () => void;
|
|
85
|
+
readonly setPageSize: (size: number | string) => void;
|
|
86
|
+
readonly updateSorting: (next: SortingState | ((prev: SortingState) => SortingState)) => void;
|
|
87
|
+
get pageStartIndex(): number;
|
|
88
|
+
get pageEndIndexExclusive(): number;
|
|
89
|
+
/**
|
|
90
|
+
* Fetches a fresh page from the configured endpoint. Cancels any
|
|
91
|
+
* in-flight request first. The `debounced` flag (when true) coalesces
|
|
92
|
+
* rapid calls into a single trailing request after the configured
|
|
93
|
+
* debounce window.
|
|
94
|
+
*/
|
|
95
|
+
readonly reload: (debounced?: boolean) => Promise<void>;
|
|
96
|
+
private scheduleReload;
|
|
97
|
+
private _reloadNow;
|
|
98
|
+
private _buildMergedFilters;
|
|
99
|
+
private _buildUrl;
|
|
100
|
+
private _buildRequestInit;
|
|
101
|
+
private _applyResponseTransform;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Thin adapter for `kind: 'custom'`. Delegates to a consumer-supplied
|
|
105
|
+
* `fetch` function on every page / filter / sort change. Inherits
|
|
106
|
+
* `TableDataRepository` for pagination and filter-mode plumbing.
|
|
107
|
+
*/
|
|
108
|
+
export declare class CustomRemoteRepository<TRow extends object> extends TableDataRepository<TRow, unknown> implements IRemoteDataRepository<TRow> {
|
|
109
|
+
private readonly _fetch;
|
|
110
|
+
readonly paginationType: "Remote";
|
|
111
|
+
readonly filterType: "Virtual";
|
|
112
|
+
readonly manualSorting = true;
|
|
113
|
+
private _data;
|
|
114
|
+
get data(): Array<TRow>;
|
|
115
|
+
set data(v: Array<TRow>);
|
|
116
|
+
private _totalRows;
|
|
117
|
+
get totalRows(): number;
|
|
118
|
+
private set totalRows(value);
|
|
119
|
+
private _lastPage;
|
|
120
|
+
get lastPage(): number;
|
|
121
|
+
private set lastPage(value);
|
|
122
|
+
private _isLoading;
|
|
123
|
+
get isLoading(): boolean;
|
|
124
|
+
loadingMessage: string | undefined;
|
|
125
|
+
private _sorting;
|
|
126
|
+
get sorting(): SortingState;
|
|
127
|
+
set sorting(v: SortingState);
|
|
128
|
+
private _filtering;
|
|
129
|
+
get filtering(): ColumnFiltersState;
|
|
130
|
+
private _abortController;
|
|
131
|
+
constructor(tableName: string, getUserId: () => string | undefined, _fetch: CustomRowSource<TRow>['fetch']);
|
|
132
|
+
readonly setFilterMode: (id: string, mode: FilterMode) => void;
|
|
133
|
+
readonly filterBy: (id: string, value: unknown) => void;
|
|
134
|
+
readonly resetFilters: () => void;
|
|
135
|
+
readonly setPage: (page: number) => void;
|
|
136
|
+
readonly nextPage: () => void;
|
|
137
|
+
readonly prevPage: () => void;
|
|
138
|
+
readonly setPageSize: (size: number | string) => void;
|
|
139
|
+
readonly updateSorting: (next: SortingState | ((prev: SortingState) => SortingState)) => void;
|
|
140
|
+
get pageStartIndex(): number;
|
|
141
|
+
get pageEndIndexExclusive(): number;
|
|
142
|
+
readonly reload: () => Promise<void>;
|
|
143
|
+
}
|