@lavalogic/scoria 0.36.0 → 0.37.1
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/dist/Components/AccordionGroup.svelte +6 -2
- package/dist/Components/AccordionGroupButton.svelte +78 -78
- package/dist/Components/AccordionGroupButtonProps.d.ts +27 -8
- package/dist/Components/AccordionGroupProps.d.ts +10 -2
- package/dist/Components/Action.svelte +31 -33
- package/dist/Components/ActionProps.d.ts +23 -3
- package/dist/Components/AlertModal.svelte +90 -39
- 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 +37 -15
- 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 +70 -62
- 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 +7 -0
- package/dist/Components/Base/Snippets.svelte.d.ts +5 -1
- package/dist/Components/BigRadioSet.svelte +18 -9
- package/dist/Components/BigRadioSetProps.d.ts +17 -1
- package/dist/Components/Bubble.svelte +67 -34
- package/dist/Components/Bubble.svelte.d.ts +23 -2
- package/dist/Components/BubbleProps.d.ts +55 -4
- package/dist/Components/Button.svelte +50 -38
- package/dist/Components/ButtonProps.d.ts +66 -1
- package/dist/Components/Checkbox.svelte +57 -29
- 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 +53 -22
- package/dist/Components/CollapsibleCardProps.d.ts +22 -1
- package/dist/Components/Contexts/ContextMenu.svelte +53 -32
- package/dist/Components/Contexts/ContextMenu.svelte.d.ts +26 -0
- package/dist/Components/Contexts/ContextMenuDivider.svelte +15 -7
- package/dist/Components/Contexts/ContextMenuDivider.svelte.d.ts +9 -0
- package/dist/Components/Contexts/ContextMenuOption.svelte +27 -18
- 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 +28 -4
- package/dist/Components/Contexts/Toast.svelte.d.ts +14 -0
- package/dist/Components/Contexts/ToastContainer.svelte +30 -11
- 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 +21 -10
- package/dist/Components/Contexts/Tooltip.svelte.d.ts +10 -0
- package/dist/Components/DataMatrixIcon.svelte +82 -11
- package/dist/Components/DataMatrixIconProps.d.ts +73 -1
- package/dist/Components/DateInput.svelte +64 -29
- package/dist/Components/DateInput.svelte.d.ts +1 -1
- package/dist/Components/DateOnlyInputProps.d.ts +31 -5
- package/dist/Components/DatePicker.svelte +96 -108
- package/dist/Components/DatePickerProps.d.ts +18 -1
- package/dist/Components/DateTimeInputProps.d.ts +30 -5
- package/dist/Components/DesktopModal.svelte +14 -43
- package/dist/Components/DesktopModalProps.d.ts +5 -4
- package/dist/Components/Dial.svelte +103 -41
- package/dist/Components/DialProps.d.ts +74 -2
- package/dist/Components/DimensionInput.svelte +50 -64
- package/dist/Components/DimensionInput.svelte.d.ts +1 -1
- package/dist/Components/DimensionInputProps.d.ts +39 -4
- package/dist/Components/DragMenu/DragMenuHolder.svelte +41 -29
- package/dist/Components/DragMenu/DragMenuHolderProps.d.ts +30 -1
- package/dist/Components/DragMenu/DraggableCard.svelte +44 -8
- package/dist/Components/DragMenu/DraggableCardProps.d.ts +27 -1
- package/dist/Components/FileCard.svelte +6 -2
- package/dist/Components/FileCardProps.d.ts +17 -1
- package/dist/Components/FileUpload.svelte +82 -42
- package/dist/Components/FileUploadProps.d.ts +34 -4
- package/dist/Components/GridInput.svelte +27 -17
- package/dist/Components/GridInput.svelte.d.ts +5 -5
- package/dist/Components/GridInputProps.d.ts +4 -1
- package/dist/Components/GridInputSet.svelte +12 -5
- package/dist/Components/GridInputSet.svelte.d.ts +5 -5
- package/dist/Components/GridInputSetProps.d.ts +4 -2
- package/dist/Components/HorizontalTabGroup.svelte +13 -11
- package/dist/Components/HorizontalTabGroupButton.svelte +16 -68
- package/dist/Components/HorizontalTabGroupProps.d.ts +15 -2
- package/dist/Components/Icon.svelte +62 -21
- package/dist/Components/IconProps.d.ts +54 -6
- package/dist/Components/Icons.d.ts +8 -0
- package/dist/Components/Icons.js +234 -215
- package/dist/Components/LoadingAnimation.svelte +18 -18
- 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 +18 -20
- 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 +11 -13
- 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 +77 -82
- 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 +88 -76
- 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 +35 -30
- 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 +12 -3
- package/dist/Components/Nav/NavServiceMenuListProps.d.ts +25 -1
- package/dist/Components/Nav/NavTab.svelte +19 -48
- 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 +29 -20
- package/dist/Components/Nav/ServicesNav.svelte +60 -34
- 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 +37 -27
- package/dist/Components/NumberInputProps.d.ts +37 -0
- package/dist/Components/PageHeading.svelte +2 -13
- 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 +27 -15
- 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 +14 -3
- package/dist/Components/PortalProps.d.ts +20 -1
- package/dist/Components/ProgressBubble.svelte +98 -53
- package/dist/Components/ProgressBubbleProps.d.ts +23 -2
- package/dist/Components/QuerySelect.svelte +103 -159
- 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 +86 -108
- 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 +19 -69
- package/dist/Components/StepForm.svelte +52 -52
- package/dist/Components/StepFormProps.d.ts +16 -2
- package/dist/Components/Switch.svelte +68 -31
- 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 +106 -50
- 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 +43 -9
- 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 +15 -5
- 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 +437 -91
- 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 +43 -13
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponentProps.d.ts +12 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +50 -38
- 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 +61 -26
- 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 +36 -16
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +133 -26
- 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 +54 -20
- 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 +55 -40
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte.d.ts +11 -0
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +38 -27
- 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 +22 -7
- 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 +61 -31
- 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 +123 -244
- 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 +126 -189
- 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 +31 -19
- 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 +125 -187
- 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 +119 -270
- 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 +46 -23
- 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 +200 -132
- 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 +170 -53
- 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.d.ts +2 -2
- 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 +5 -3
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte.d.ts +12 -11
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +5 -3
- package/dist/Components/Table/Headers/SelectAllHeader.svelte.d.ts +12 -11
- package/dist/Components/Table/Headers/TableHead.svelte +340 -200
- 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 +108 -50
- package/dist/Components/Table/Misc/ColumnPanel.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +20 -7
- 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 +30 -41
- package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/FilterPanel.svelte +387 -29
- package/dist/Components/Table/Misc/FilterPanel.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +4 -51
- package/dist/Components/Table/Misc/FilterPanelModal.svelte.d.ts +2 -23
- package/dist/Components/Table/Misc/SidePanel.svelte +12 -9
- 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 +44 -35
- 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 +17 -48
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/TableSidebar.svelte +28 -47
- package/dist/Components/Table/Misc/TableSidebar.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/ToolboxPanel.svelte +121 -55
- package/dist/Components/Table/Misc/ToolboxPanel.svelte.d.ts +12 -11
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +31 -24
- 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 +85 -41
- 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 +24 -0
- package/dist/Components/Table/SubApis.svelte.js +380 -0
- package/dist/Components/Table/Table.svelte +345 -172
- 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 +30 -9
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +14 -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 +580 -58
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +984 -1278
- 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 +244 -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 +40 -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 +190 -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 +270 -0
- package/dist/Components/TextArea.svelte +37 -18
- package/dist/Components/TextAreaProps.d.ts +37 -0
- package/dist/Components/TextInput.svelte +41 -22
- package/dist/Components/TextInputProps.d.ts +58 -1
- package/dist/Components/ThreeStateRadio.svelte +61 -64
- package/dist/Components/ThreeStateRadioProps.d.ts +29 -1
- package/dist/Components/Touch/BoolCard.svelte +8 -15
- 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 +17 -25
- 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 +10 -3
- package/dist/Components/Touch/EditCardProps.d.ts +21 -0
- package/dist/Components/Touch/InfoCard.svelte +14 -7
- package/dist/Components/Touch/InfoCardProps.d.ts +9 -0
- package/dist/Components/Touch/InfoTextCard.svelte +9 -2
- package/dist/Components/Touch/InfoTextCardProps.d.ts +8 -0
- package/dist/Components/Touch/ModalExplanation.svelte +9 -12
- 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 +62 -105
- package/dist/Components/Touch/NumberKeyboardProps.d.ts +19 -0
- package/dist/Components/Touch/NumberModal.svelte +16 -6
- package/dist/Components/Touch/NumberModalProps.d.ts +23 -1
- package/dist/Components/Touch/PlusMinusCard.svelte +12 -16
- 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 +33 -15
- package/dist/Components/Touch/SelectModalProps.d.ts +22 -1
- package/dist/Components/Touch/SummaryCard.svelte +56 -14
- package/dist/Components/Touch/SummaryCardProps.d.ts +16 -3
- package/dist/Components/Touch/TextAreaModal.svelte +18 -9
- package/dist/Components/Touch/TextAreaModalProps.d.ts +21 -0
- package/dist/Components/Touch/TextModal.svelte +15 -32
- package/dist/Components/Touch/TextModalProps.d.ts +28 -1
- package/dist/Components/Touch/TouchCard.svelte +9 -47
- package/dist/Components/Touch/TouchCardProps.d.ts +21 -0
- package/dist/Components/Touch/TouchModal.svelte +105 -99
- package/dist/Components/Touch/TouchModalProps.d.ts +35 -1
- package/dist/Components/Touch/UtilityButton.svelte +36 -18
- package/dist/Components/Touch/UtilityButtonProps.d.ts +16 -0
- package/dist/Components/VerticalTabGroup.svelte +18 -40
- package/dist/Components/VerticalTabGroupButton.svelte +11 -50
- 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 +10 -1
- package/dist/Helpers/Datamatrix.js +290 -1
- package/dist/Helpers/Helpers.svelte.d.ts +252 -18
- package/dist/Helpers/Helpers.svelte.js +271 -75
- 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 +12 -11
- package/dist/Types/Examples/ExampleModal.svelte.d.ts +2 -2
- 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/_mixins.scss +451 -167
- package/dist/scss/_motion.scss +57 -0
- package/dist/scss/_sizing.scss +16 -0
- 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 +35 -31
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import type { BoolFilterValueType, DateFilterValueType, FilterFn, NumberFilterValueType, SelectFilterValueType, StringFilterValueType } from '../Filtering/FilterFn.js';
|
|
2
|
+
import type { CustomRemoteFilters } from '../Filtering/CustomRemoteFilters.js';
|
|
3
|
+
import type { ColumnFiltersState } from '../Filtering/ColumnFiltersState.js';
|
|
4
|
+
import type { OnChangeFn } from '../OnChangeFn.js';
|
|
5
|
+
import { PaginationType } from '../Pagination/PaginationType.js';
|
|
6
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
7
|
+
/**
|
|
8
|
+
* Dependency surface that `FilteringState` reads from the surrounding
|
|
9
|
+
* `TableContext`. Every dependency is passed as a thunk so the sub-context
|
|
10
|
+
* never holds a direct reference to the parent; reactivity threads through
|
|
11
|
+
* `$derived` and `$effect` exactly as before the extraction.
|
|
12
|
+
*/
|
|
13
|
+
export interface FilteringStateDeps<T extends object> {
|
|
14
|
+
/** Underlying repository row array (pre-filter). Sourced from
|
|
15
|
+
* `tableContext.dataRepo.data`. */
|
|
16
|
+
getRepoData: () => ReadonlyArray<T>;
|
|
17
|
+
/** Pagination mode of the active data repository; only `Local`
|
|
18
|
+
* triggers in-process filtering of the data slice. */
|
|
19
|
+
getPaginationType: () => PaginationType | undefined;
|
|
20
|
+
/** Per-filter `FilterFn` for date columns, sourced from
|
|
21
|
+
* `paginationRepo.dateFilter`. */
|
|
22
|
+
getDateFilterFn: () => FilterFn<T, DateFilterValueType> | undefined;
|
|
23
|
+
/** Per-filter `FilterFn` for number columns. */
|
|
24
|
+
getNumberFilterFn: () => FilterFn<T, NumberFilterValueType> | undefined;
|
|
25
|
+
/** Per-filter `FilterFn` for select columns. */
|
|
26
|
+
getSelectFilterFn: () => FilterFn<T, SelectFilterValueType<T>> | undefined;
|
|
27
|
+
/** Per-filter `FilterFn` for boolean columns. */
|
|
28
|
+
getBoolFilterFn: () => FilterFn<T, BoolFilterValueType> | undefined;
|
|
29
|
+
/** Per-filter `FilterFn` for string columns. */
|
|
30
|
+
getStringFilterFn: () => FilterFn<T, StringFilterValueType> | undefined;
|
|
31
|
+
/** Map of currently-selected rows keyed by id. Read when
|
|
32
|
+
* `showSelectedOnly` is true so the filtered view bypasses
|
|
33
|
+
* `_filteredIndices` and returns the selection map directly. */
|
|
34
|
+
getSelectedItems: () => SvelteMap<unknown, T>;
|
|
35
|
+
/** Master gate from `TableInitOptions.allowQuickFiltering`. When
|
|
36
|
+
* false, `showQuickFiltering` is forced to `false` regardless of
|
|
37
|
+
* the consumer's setter call. */
|
|
38
|
+
getAllowQuickFiltering: () => boolean;
|
|
39
|
+
/** Logger gate; mirrors the parent `TableContext.debug` field. */
|
|
40
|
+
getDebug: () => boolean;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Phase 6.2 god-object decomposition - sub-context that owns the
|
|
44
|
+
* filtering-related state, the relayed per-type `FilterFn` derived
|
|
45
|
+
* values, the `filteredData` $derived chain, the user-facing toggle
|
|
46
|
+
* flags (`showQuickFiltering`, `showSelectedOnly`), the remote-filter
|
|
47
|
+
* slot, and the `updateFilters` `OnChangeFn` slot.
|
|
48
|
+
*
|
|
49
|
+
* `TableContext` retains delegating getters / setters for every legacy
|
|
50
|
+
* surface (`filteredIndices`, `filteredData`, `showQuickFiltering`,
|
|
51
|
+
* `showSelectedOnly`, `remoteFilters`, `dateFilter`, `numberFilter`,
|
|
52
|
+
* `selectFilter`, `boolFilter`, `stringFilter`, `updateFilters`); future
|
|
53
|
+
* consumers can read `tableContext._filtering` directly once the
|
|
54
|
+
* migration completes (see
|
|
55
|
+
* `src/stories/Concepts/TableContext-decomposition.mdx`).
|
|
56
|
+
*/
|
|
57
|
+
export declare class FilteringState<T extends object> {
|
|
58
|
+
private readonly _deps;
|
|
59
|
+
/** Internal mutable state for the per-row filter result. The
|
|
60
|
+
* population effect lives in `TableContext` (it depends on
|
|
61
|
+
* `createRow` which is a parent concern); the sub-context exposes
|
|
62
|
+
* the read surface and the write hook. */
|
|
63
|
+
private _filteredIndices;
|
|
64
|
+
private _showQuickFiltering;
|
|
65
|
+
private _showSelectedOnly;
|
|
66
|
+
private _remoteFilters;
|
|
67
|
+
private _updateFilters;
|
|
68
|
+
/**
|
|
69
|
+
* @param deps thunks the sub-context reads from the parent.
|
|
70
|
+
* Constructor-only - no implicit setup so the parent
|
|
71
|
+
* remains in control of effect ownership and lifecycle.
|
|
72
|
+
*/
|
|
73
|
+
constructor(deps: FilteringStateDeps<T>);
|
|
74
|
+
/**
|
|
75
|
+
* Per-row filter pass result, addressed by `dataRepo.data` index.
|
|
76
|
+
* Driven by the `filteredIndices` `$effect` that lives in
|
|
77
|
+
* `TableContext` (it calls `this.createRow` to build the row shape
|
|
78
|
+
* each `FilterFn` expects). Use `setFilteredIndices` to write.
|
|
79
|
+
*/
|
|
80
|
+
get filteredIndices(): ReadonlyArray<number>;
|
|
81
|
+
/**
|
|
82
|
+
* Writer for `filteredIndices`. Public so the parent `TableContext`
|
|
83
|
+
* effect that performs the per-row filter pass can publish the
|
|
84
|
+
* result without piercing the sub-context's encapsulation. Not part
|
|
85
|
+
* of the consumer-facing surface.
|
|
86
|
+
*/
|
|
87
|
+
setFilteredIndices(indices: ReadonlyArray<number>): void;
|
|
88
|
+
/**
|
|
89
|
+
* Whether the quick-filter row is currently visible. The setter
|
|
90
|
+
* enforces the `allowQuickFiltering` gate (a master init option):
|
|
91
|
+
* if quick filtering is disabled at the table level, the setter is
|
|
92
|
+
* a no-op except for the debug log. Mirrors the pre-extraction
|
|
93
|
+
* `TableContext.showQuickFiltering` setter verbatim.
|
|
94
|
+
*/
|
|
95
|
+
get showQuickFiltering(): boolean;
|
|
96
|
+
set showQuickFiltering(v: boolean);
|
|
97
|
+
/**
|
|
98
|
+
* Whether the table is currently restricted to the selected-only
|
|
99
|
+
* view. Toggle bypasses pagination (the entire selection map is
|
|
100
|
+
* returned in place of the page slice). Idempotent - reassigning
|
|
101
|
+
* the same value short-circuits to avoid a `$state` write.
|
|
102
|
+
*/
|
|
103
|
+
get showSelectedOnly(): boolean;
|
|
104
|
+
set showSelectedOnly(v: boolean);
|
|
105
|
+
/**
|
|
106
|
+
* Optional caller-supplied remote-filter description (used by the
|
|
107
|
+
* QueryBuilder / advanced-filter dialog when the data repository
|
|
108
|
+
* forwards filters to a remote service). Read-only externally; the
|
|
109
|
+
* parent populates it from `defaultColumnDefs.remoteFilters` during
|
|
110
|
+
* `init()`.
|
|
111
|
+
*/
|
|
112
|
+
get remoteFilters(): CustomRemoteFilters<unknown> | undefined;
|
|
113
|
+
/**
|
|
114
|
+
* Writer for `remoteFilters`. Internal-only at the sub-context
|
|
115
|
+
* level; the parent uses `_filtering.setRemoteFilters` during
|
|
116
|
+
* column-def setup. Marked public so the parent class body can call
|
|
117
|
+
* it, but should not be reached from consumer code.
|
|
118
|
+
*/
|
|
119
|
+
setRemoteFilters(v: CustomRemoteFilters<unknown> | undefined): void;
|
|
120
|
+
/**
|
|
121
|
+
* Caller-supplied `OnChangeFn<ColumnFiltersState>` that observes
|
|
122
|
+
* filter updates issued by `paginationRepo.filterBy`. Plain pass-
|
|
123
|
+
* through slot; this sub-context never invokes it directly - it is
|
|
124
|
+
* read by `generateTableOptions` (the `ITable.onColumnFiltersChange`
|
|
125
|
+
* getter).
|
|
126
|
+
*/
|
|
127
|
+
get updateFilters(): OnChangeFn<ColumnFiltersState> | undefined;
|
|
128
|
+
set updateFilters(v: OnChangeFn<ColumnFiltersState> | undefined);
|
|
129
|
+
/** Relayed `FilterFn` for date-typed columns. Sourced through the
|
|
130
|
+
* parent thunk; the parent in turn reads
|
|
131
|
+
* `paginationRepo.dateFilter`. The `$derived.by` form is required
|
|
132
|
+
* here (over plain `$derived(expr)`) because class-field
|
|
133
|
+
* initialisers run BEFORE the constructor body assigns `_deps`;
|
|
134
|
+
* the function-form wrapper defers the read until the derived is
|
|
135
|
+
* first evaluated. */
|
|
136
|
+
readonly dateFilter: FilterFn<T, DateFilterValueType> | undefined;
|
|
137
|
+
/** Relayed `FilterFn` for number-typed columns. */
|
|
138
|
+
readonly numberFilter: FilterFn<T, NumberFilterValueType> | undefined;
|
|
139
|
+
/** Relayed `FilterFn` for select-typed columns. */
|
|
140
|
+
readonly selectFilter: FilterFn<T, SelectFilterValueType<T>> | undefined;
|
|
141
|
+
/** Relayed `FilterFn` for boolean-typed columns. */
|
|
142
|
+
readonly boolFilter: FilterFn<T, BoolFilterValueType> | undefined;
|
|
143
|
+
/** Relayed `FilterFn` for string-typed columns. */
|
|
144
|
+
readonly stringFilter: FilterFn<T, StringFilterValueType> | undefined;
|
|
145
|
+
/**
|
|
146
|
+
* The filtered view of the upstream `dataRepo.data` array. Three
|
|
147
|
+
* branches:
|
|
148
|
+
*
|
|
149
|
+
* 1. `paginationType === Local && showSelectedOnly`: returns the
|
|
150
|
+
* selection map's values directly (bypasses pagination so the
|
|
151
|
+
* "show selected" mode renders every selected row regardless of
|
|
152
|
+
* the active page).
|
|
153
|
+
* 2. `paginationType === Local`: maps `_filteredIndices` through
|
|
154
|
+
* `dataRepo.data` so the visible row order matches the source.
|
|
155
|
+
* 3. Any other pagination mode (Remote / undefined): returns
|
|
156
|
+
* `dataRepo.data` unchanged (remote filtering already applied
|
|
157
|
+
* upstream).
|
|
158
|
+
*
|
|
159
|
+
* Reactivity note: `selectedItems` is intentionally NOT touched
|
|
160
|
+
* outside the `showSelectedOnly` branches. Reading it unconditionally
|
|
161
|
+
* would invalidate `filteredData` → `sortedData` → `currentPageData`
|
|
162
|
+
* → the entire row model on every single toggle (regression caught
|
|
163
|
+
* during Phase-5 Group 2).
|
|
164
|
+
*/
|
|
165
|
+
readonly filteredData: T[];
|
|
166
|
+
}
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
import { PaginationType } from '../Pagination/PaginationType.js';
|
|
2
|
+
import { SvelteMap } from 'svelte/reactivity';
|
|
3
|
+
/**
|
|
4
|
+
* Phase 6.2 god-object decomposition - sub-context that owns the
|
|
5
|
+
* filtering-related state, the relayed per-type `FilterFn` derived
|
|
6
|
+
* values, the `filteredData` $derived chain, the user-facing toggle
|
|
7
|
+
* flags (`showQuickFiltering`, `showSelectedOnly`), the remote-filter
|
|
8
|
+
* slot, and the `updateFilters` `OnChangeFn` slot.
|
|
9
|
+
*
|
|
10
|
+
* `TableContext` retains delegating getters / setters for every legacy
|
|
11
|
+
* surface (`filteredIndices`, `filteredData`, `showQuickFiltering`,
|
|
12
|
+
* `showSelectedOnly`, `remoteFilters`, `dateFilter`, `numberFilter`,
|
|
13
|
+
* `selectFilter`, `boolFilter`, `stringFilter`, `updateFilters`); future
|
|
14
|
+
* consumers can read `tableContext._filtering` directly once the
|
|
15
|
+
* migration completes (see
|
|
16
|
+
* `src/stories/Concepts/TableContext-decomposition.mdx`).
|
|
17
|
+
*/
|
|
18
|
+
export class FilteringState {
|
|
19
|
+
_deps;
|
|
20
|
+
/** Internal mutable state for the per-row filter result. The
|
|
21
|
+
* population effect lives in `TableContext` (it depends on
|
|
22
|
+
* `createRow` which is a parent concern); the sub-context exposes
|
|
23
|
+
* the read surface and the write hook. */
|
|
24
|
+
_filteredIndices = $state([]);
|
|
25
|
+
_showQuickFiltering = $state(false);
|
|
26
|
+
_showSelectedOnly = $state(false);
|
|
27
|
+
_remoteFilters = $state();
|
|
28
|
+
_updateFilters = $state();
|
|
29
|
+
/**
|
|
30
|
+
* @param deps thunks the sub-context reads from the parent.
|
|
31
|
+
* Constructor-only - no implicit setup so the parent
|
|
32
|
+
* remains in control of effect ownership and lifecycle.
|
|
33
|
+
*/
|
|
34
|
+
constructor(deps) {
|
|
35
|
+
this._deps = deps;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Per-row filter pass result, addressed by `dataRepo.data` index.
|
|
39
|
+
* Driven by the `filteredIndices` `$effect` that lives in
|
|
40
|
+
* `TableContext` (it calls `this.createRow` to build the row shape
|
|
41
|
+
* each `FilterFn` expects). Use `setFilteredIndices` to write.
|
|
42
|
+
*/
|
|
43
|
+
get filteredIndices() {
|
|
44
|
+
return this._filteredIndices;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Writer for `filteredIndices`. Public so the parent `TableContext`
|
|
48
|
+
* effect that performs the per-row filter pass can publish the
|
|
49
|
+
* result without piercing the sub-context's encapsulation. Not part
|
|
50
|
+
* of the consumer-facing surface.
|
|
51
|
+
*/
|
|
52
|
+
setFilteredIndices(indices) {
|
|
53
|
+
this._filteredIndices = indices;
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Whether the quick-filter row is currently visible. The setter
|
|
57
|
+
* enforces the `allowQuickFiltering` gate (a master init option):
|
|
58
|
+
* if quick filtering is disabled at the table level, the setter is
|
|
59
|
+
* a no-op except for the debug log. Mirrors the pre-extraction
|
|
60
|
+
* `TableContext.showQuickFiltering` setter verbatim.
|
|
61
|
+
*/
|
|
62
|
+
get showQuickFiltering() {
|
|
63
|
+
return this._showQuickFiltering;
|
|
64
|
+
}
|
|
65
|
+
set showQuickFiltering(v) {
|
|
66
|
+
if (this._deps.getDebug()) {
|
|
67
|
+
if (!this._deps.getAllowQuickFiltering()) {
|
|
68
|
+
console.log(`attempted to toggle quick filtering when allowQuickFiltering = false`);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
console.log(`setting quick filtering = ${v}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
this._showQuickFiltering = this._deps.getAllowQuickFiltering() && v;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Whether the table is currently restricted to the selected-only
|
|
78
|
+
* view. Toggle bypasses pagination (the entire selection map is
|
|
79
|
+
* returned in place of the page slice). Idempotent - reassigning
|
|
80
|
+
* the same value short-circuits to avoid a `$state` write.
|
|
81
|
+
*/
|
|
82
|
+
get showSelectedOnly() {
|
|
83
|
+
return this._showSelectedOnly;
|
|
84
|
+
}
|
|
85
|
+
set showSelectedOnly(v) {
|
|
86
|
+
if (v === this._showSelectedOnly) {
|
|
87
|
+
return;
|
|
88
|
+
}
|
|
89
|
+
this._showSelectedOnly = v;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Optional caller-supplied remote-filter description (used by the
|
|
93
|
+
* QueryBuilder / advanced-filter dialog when the data repository
|
|
94
|
+
* forwards filters to a remote service). Read-only externally; the
|
|
95
|
+
* parent populates it from `defaultColumnDefs.remoteFilters` during
|
|
96
|
+
* `init()`.
|
|
97
|
+
*/
|
|
98
|
+
get remoteFilters() {
|
|
99
|
+
return this._remoteFilters;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Writer for `remoteFilters`. Internal-only at the sub-context
|
|
103
|
+
* level; the parent uses `_filtering.setRemoteFilters` during
|
|
104
|
+
* column-def setup. Marked public so the parent class body can call
|
|
105
|
+
* it, but should not be reached from consumer code.
|
|
106
|
+
*/
|
|
107
|
+
setRemoteFilters(v) {
|
|
108
|
+
this._remoteFilters = v;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Caller-supplied `OnChangeFn<ColumnFiltersState>` that observes
|
|
112
|
+
* filter updates issued by `paginationRepo.filterBy`. Plain pass-
|
|
113
|
+
* through slot; this sub-context never invokes it directly - it is
|
|
114
|
+
* read by `generateTableOptions` (the `ITable.onColumnFiltersChange`
|
|
115
|
+
* getter).
|
|
116
|
+
*/
|
|
117
|
+
get updateFilters() {
|
|
118
|
+
return this._updateFilters;
|
|
119
|
+
}
|
|
120
|
+
set updateFilters(v) {
|
|
121
|
+
this._updateFilters = v;
|
|
122
|
+
}
|
|
123
|
+
/** Relayed `FilterFn` for date-typed columns. Sourced through the
|
|
124
|
+
* parent thunk; the parent in turn reads
|
|
125
|
+
* `paginationRepo.dateFilter`. The `$derived.by` form is required
|
|
126
|
+
* here (over plain `$derived(expr)`) because class-field
|
|
127
|
+
* initialisers run BEFORE the constructor body assigns `_deps`;
|
|
128
|
+
* the function-form wrapper defers the read until the derived is
|
|
129
|
+
* first evaluated. */
|
|
130
|
+
dateFilter = $derived.by(() => this._deps.getDateFilterFn());
|
|
131
|
+
/** Relayed `FilterFn` for number-typed columns. */
|
|
132
|
+
numberFilter = $derived.by(() => this._deps.getNumberFilterFn());
|
|
133
|
+
/** Relayed `FilterFn` for select-typed columns. */
|
|
134
|
+
selectFilter = $derived.by(() => this._deps.getSelectFilterFn());
|
|
135
|
+
/** Relayed `FilterFn` for boolean-typed columns. */
|
|
136
|
+
boolFilter = $derived.by(() => this._deps.getBoolFilterFn());
|
|
137
|
+
/** Relayed `FilterFn` for string-typed columns. */
|
|
138
|
+
stringFilter = $derived.by(() => this._deps.getStringFilterFn());
|
|
139
|
+
/**
|
|
140
|
+
* The filtered view of the upstream `dataRepo.data` array. Three
|
|
141
|
+
* branches:
|
|
142
|
+
*
|
|
143
|
+
* 1. `paginationType === Local && showSelectedOnly`: returns the
|
|
144
|
+
* selection map's values directly (bypasses pagination so the
|
|
145
|
+
* "show selected" mode renders every selected row regardless of
|
|
146
|
+
* the active page).
|
|
147
|
+
* 2. `paginationType === Local`: maps `_filteredIndices` through
|
|
148
|
+
* `dataRepo.data` so the visible row order matches the source.
|
|
149
|
+
* 3. Any other pagination mode (Remote / undefined): returns
|
|
150
|
+
* `dataRepo.data` unchanged (remote filtering already applied
|
|
151
|
+
* upstream).
|
|
152
|
+
*
|
|
153
|
+
* Reactivity note: `selectedItems` is intentionally NOT touched
|
|
154
|
+
* outside the `showSelectedOnly` branches. Reading it unconditionally
|
|
155
|
+
* would invalidate `filteredData` → `sortedData` → `currentPageData`
|
|
156
|
+
* → the entire row model on every single toggle (regression caught
|
|
157
|
+
* during Phase-5 Group 2).
|
|
158
|
+
*/
|
|
159
|
+
filteredData = $derived.by(() => {
|
|
160
|
+
const repoData = this._deps.getRepoData();
|
|
161
|
+
void this._filteredIndices;
|
|
162
|
+
void this._showSelectedOnly;
|
|
163
|
+
const paginationType = this._deps.getPaginationType();
|
|
164
|
+
if (paginationType == PaginationType.Local) {
|
|
165
|
+
const data = this._showSelectedOnly
|
|
166
|
+
? // FIXME this will show the selected items by order of insertion to the selectedItems map.
|
|
167
|
+
[...this._deps.getSelectedItems().values()]
|
|
168
|
+
: this._filteredIndices.map((index) => {
|
|
169
|
+
return repoData[index];
|
|
170
|
+
});
|
|
171
|
+
return data;
|
|
172
|
+
}
|
|
173
|
+
if (this._deps.getDebug()) {
|
|
174
|
+
console.log(`updating filtered data. Selected only: ${this._showSelectedOnly}`);
|
|
175
|
+
}
|
|
176
|
+
return this._showSelectedOnly
|
|
177
|
+
? [...this._deps.getSelectedItems().values()]
|
|
178
|
+
: repoData;
|
|
179
|
+
});
|
|
180
|
+
}
|
|
@@ -0,0 +1,316 @@
|
|
|
1
|
+
import type { ColumnDef } from '../Columns/Definitions/ColumnDef.svelte.js';
|
|
2
|
+
import type { VisibilityState } from '../Columns/VisibilityState.js';
|
|
3
|
+
import type { TableCell } from '../Columns/TableCell.js';
|
|
4
|
+
import type { CellCoordinates } from '../Coordinates/CellCoordinates.js';
|
|
5
|
+
import type { VisualColumnIndex } from '../Coordinates/ColumnIndices.js';
|
|
6
|
+
import { TableFocusDetails } from '../Focus/TableFocusDetails.svelte.js';
|
|
7
|
+
import type { Primitive } from './TableInitOptions.js';
|
|
8
|
+
import type { RowModel } from './RowModel.js';
|
|
9
|
+
/**
|
|
10
|
+
* Dependency surface that `FocusState` reads from the surrounding
|
|
11
|
+
* `TableContext`. Every dependency is passed as a thunk (or a callback
|
|
12
|
+
* for parent-owned side effects) so the sub-context never holds a
|
|
13
|
+
* direct reference to the parent; reactivity threads through `$state`
|
|
14
|
+
* exactly as before the extraction.
|
|
15
|
+
*
|
|
16
|
+
* Splits cleanly into four groups:
|
|
17
|
+
*
|
|
18
|
+
* 1. Master gates: `getAllowCopy`, `getAllowQuickFiltering`. Gate
|
|
19
|
+
* the range-extension and Ctrl+F keystroke paths.
|
|
20
|
+
*
|
|
21
|
+
* 2. Column-layout thunks (`getColumnDefs`, `getColumnVisibility`,
|
|
22
|
+
* `getVisualColumns`, `getVisualColumnIndexById`) - used by the
|
|
23
|
+
* tab navigation walk and the left/right focus moves. These read
|
|
24
|
+
* through to `_columnLayout` on the parent.
|
|
25
|
+
*
|
|
26
|
+
* 3. Data-shape thunks (`getSortedDataLength`,
|
|
27
|
+
* `getPaginationRowModel`) - bound the row-axis walk.
|
|
28
|
+
*
|
|
29
|
+
* 4. Parent-side actions:
|
|
30
|
+
* - `copyDataToClipboard` (Ctrl+C in `handleKeystroke`),
|
|
31
|
+
* - `toggleQuickFiltering` (Ctrl+F in `handleTdKeydown`).
|
|
32
|
+
*
|
|
33
|
+
* `getDebug` mirrors the parent's logger gate.
|
|
34
|
+
*/
|
|
35
|
+
export interface FocusStateDeps<T extends object> {
|
|
36
|
+
/** Master gate from `TableInitOptions.allowCopy`. When false,
|
|
37
|
+
* every range-extension keystroke (Shift+Arrow / Ctrl+Shift+Arrow /
|
|
38
|
+
* Ctrl+A / Ctrl+C / Tab) is a no-op. */
|
|
39
|
+
getAllowCopy: () => boolean;
|
|
40
|
+
/** Master gate from `TableInitOptions.allowQuickFiltering`. Gates
|
|
41
|
+
* the `Ctrl+F` keystroke that toggles the quick-filter row. */
|
|
42
|
+
getAllowQuickFiltering: () => boolean;
|
|
43
|
+
/** Live column-def array. Used by `tabForward` / `tabBackward`
|
|
44
|
+
* to walk memory-index order. */
|
|
45
|
+
getColumnDefs: () => ReadonlyArray<ColumnDef<T>>;
|
|
46
|
+
/** Live column-visibility map. Used by tab navigation to skip
|
|
47
|
+
* hidden columns. */
|
|
48
|
+
getColumnVisibility: () => VisibilityState;
|
|
49
|
+
/** Visual-order column array from `ColumnLayoutState`. Used by
|
|
50
|
+
* left/right focus moves and Home/End jumps. */
|
|
51
|
+
getVisualColumns: () => ReadonlyArray<ColumnDef<T>>;
|
|
52
|
+
/** O(1) id->visual-index lookup from `ColumnLayoutState`. */
|
|
53
|
+
getVisualColumnIndexById: (id: string) => VisualColumnIndex;
|
|
54
|
+
/** Length of the sorted-and-filtered data array. Used by
|
|
55
|
+
* `tabForward` row-axis bounds. */
|
|
56
|
+
getSortedDataLength: () => number;
|
|
57
|
+
/** Live `paginationRowModel`. Used by the row-axis offset walk
|
|
58
|
+
* in `_moveFocusEndRow` / `_moveFocusRow`. */
|
|
59
|
+
getPaginationRowModel: () => RowModel<T>;
|
|
60
|
+
/** Parent's `copyDataToClipboard` (Ctrl+C path in handleKeystroke).
|
|
61
|
+
* Stays on the parent because it reads `_visualColumns` and the
|
|
62
|
+
* per-row accessor chain. */
|
|
63
|
+
copyDataToClipboard: () => Promise<void>;
|
|
64
|
+
/** Parent's `toggleQuickFiltering` (Ctrl+F path in handleTdKeydown).
|
|
65
|
+
* Stays on the parent because it reads `showQuickFiltering` /
|
|
66
|
+
* `tableName` and synchronously refocuses a DOM element. */
|
|
67
|
+
toggleQuickFiltering: () => void;
|
|
68
|
+
/** Parent's `tabForward` keystroke. Stays on the parent so the
|
|
69
|
+
* sub-context has a single delegation seam for keyboard routing
|
|
70
|
+
* while leaving the column-walk in this class. */
|
|
71
|
+
tabForward: () => void;
|
|
72
|
+
/** Parent's `tabBackward` keystroke. Same rationale as
|
|
73
|
+
* `tabForward`. */
|
|
74
|
+
tabBackward: () => void;
|
|
75
|
+
/** Logger gate; mirrors the parent `TableContext.debug` field. */
|
|
76
|
+
getDebug: () => boolean;
|
|
77
|
+
/** Returns the parent `TableContext`. Used by
|
|
78
|
+
* `getFocusDetailsFor` to construct `TableFocusDetails`
|
|
79
|
+
* lazily on cache-miss (Phase 7.1 Item C). The thunk is
|
|
80
|
+
* used instead of a direct ref so the sub-context never
|
|
81
|
+
* closes over the parent at construction time. */
|
|
82
|
+
getTableContextRef: () => unknown;
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* Phase 6.6 god-object decomposition - sub-context that owns every
|
|
86
|
+
* focus + keyboard-navigation concern previously held directly on
|
|
87
|
+
* `TableContext`:
|
|
88
|
+
*
|
|
89
|
+
* - `focusStart` / `focusEnd` (the two `CellCoordinates` slots that
|
|
90
|
+
* define the focused cell-range);
|
|
91
|
+
* - `focusStartIsBeingEdited` (the editing-mode flag);
|
|
92
|
+
* - `isMousingDown` (drag-select sentinel for mouse-driven multi-cell
|
|
93
|
+
* selection);
|
|
94
|
+
* - the `focusedRowIndices` / `focusedColumnIds` derived sets that
|
|
95
|
+
* power the per-cell `TableFocusDetails` outline computation;
|
|
96
|
+
* - `startFocus` / `moveFocus` / `unfocus` / `endFocus` / `setFocusEnd`
|
|
97
|
+
* (consumer-facing writers - mouse-driven and direct);
|
|
98
|
+
* - `focusToTop` / `focusToBottom` / `moveToTop` / `moveToBottom` /
|
|
99
|
+
* `focusToStart` / `focusToEnd` / `moveToStart` / `moveToEnd`
|
|
100
|
+
* (range jumps);
|
|
101
|
+
* - `moveFocusUp` / `setFocusUp` / `moveFocusDown` / `setFocusDown` /
|
|
102
|
+
* `moveFocusLeft` / `setFocusLeft` / `moveFocusRight` / `setFocusRight`
|
|
103
|
+
* (single-cell vs. range arrow moves);
|
|
104
|
+
* - `handleTdKeydown` (the table-container `onkeydown` router);
|
|
105
|
+
* - `handleKeystroke` (the dispatch into the arrow/Home/End/Ctrl+A/
|
|
106
|
+
* Ctrl+C paths);
|
|
107
|
+
* - `focusStartVisualColumn` / `focusEndVisualColumn` (visual-column
|
|
108
|
+
* getters powered by `getVisualColumnIndexById`).
|
|
109
|
+
*
|
|
110
|
+
* Effect lifecycle: the parent owns the `$effect` that publishes
|
|
111
|
+
* `_focusedRowIndices` / `_focusedColumnIds`. That effect now calls
|
|
112
|
+
* into this sub-context through `setFocusedDerived(rows, cols)`
|
|
113
|
+
* rather than mutating the state slots directly. The effect lives
|
|
114
|
+
* on `TableContext` because it needs the parent's
|
|
115
|
+
* `paginationRowModel` + `_visualColumns` reads.
|
|
116
|
+
*
|
|
117
|
+
* `TableContext` retains delegating getters / setters / methods for
|
|
118
|
+
* every legacy surface (`focusStart`, `focusEnd`, `focusStartIsBeingEdited`,
|
|
119
|
+
* `isMousingDown`, `focusedRowIndices`, `focusedColumnIds`,
|
|
120
|
+
* `focusStartVisualColumn`, `focusEndVisualColumn`, `startFocus`,
|
|
121
|
+
* `moveFocus`, `unfocus`, `endFocus`, `setFocusEnd`, `setFocusUp`,
|
|
122
|
+
* `setFocusDown`, `setFocusLeft`, `setFocusRight`, `moveFocusUp`,
|
|
123
|
+
* `moveFocusDown`, `moveFocusLeft`, `moveFocusRight`, `moveToTop`,
|
|
124
|
+
* `moveToBottom`, `moveToStart`, `moveToEnd`, `focusToTop`,
|
|
125
|
+
* `focusToBottom`, `focusToStart`, `focusToEnd`, `handleTdKeydown`)
|
|
126
|
+
* so existing consumers need no migration.
|
|
127
|
+
*
|
|
128
|
+
* @remarks
|
|
129
|
+
* Group 2 Item C (per-cell `TableFocusDetails` reuse) is deferred for
|
|
130
|
+
* Phase 6.6. The cache would need a `${rowKey}:${columnId}` key, but
|
|
131
|
+
* `selectionExtractor` can be async (the sub-context's `cachedKey`
|
|
132
|
+
* returns `RowIdType | Promise<RowIdType>`), so the cache lookup
|
|
133
|
+
* cannot complete synchronously inside a cell render. The reuse
|
|
134
|
+
* requires a follow-up refactor that either:
|
|
135
|
+
* a) memoises `TableFocusDetails` instances on the row reference
|
|
136
|
+
* (a `WeakMap<TableCell<T>, TableFocusDetails<T, RowIdType>>`),
|
|
137
|
+
* which side-steps the async key entirely, or
|
|
138
|
+
* b) hoists the key resolution into a `$state` slot populated by
|
|
139
|
+
* `updateSelectedItems` so the lookup is sync at render time.
|
|
140
|
+
* Both are larger surface changes than the FocusState extraction;
|
|
141
|
+
* tracked under Phase 6.7 BREAKING-CHANGES.md.
|
|
142
|
+
*/
|
|
143
|
+
export declare class FocusState<T extends object> {
|
|
144
|
+
private readonly _deps;
|
|
145
|
+
/** The anchor cell of the focused range. `null` when the table has no
|
|
146
|
+
* active focus (post-`unfocus`, or before the first mouse / keyboard
|
|
147
|
+
* interaction). */
|
|
148
|
+
private _focusStart;
|
|
149
|
+
/** The opposite-corner cell of the focused range. Equal to
|
|
150
|
+
* `focusStart` when a single cell is focused; differs during
|
|
151
|
+
* Shift+Arrow / mouse-drag selection. */
|
|
152
|
+
private _focusEnd;
|
|
153
|
+
/** `true` while the anchor cell is in edit-mode (the cell's editable
|
|
154
|
+
* child input has focus). Set by `moveFocus(coords, true)` and
|
|
155
|
+
* cleared by `Escape` / `unfocus`. */
|
|
156
|
+
private _focusStartIsBeingEdited;
|
|
157
|
+
/** `true` between `startFocus` (mousedown on a cell) and `endFocus`
|
|
158
|
+
* (mouseup). Drives the `setFocusEnd` mousemove listener attach /
|
|
159
|
+
* detach in the table container. */
|
|
160
|
+
private _isMousingDown;
|
|
161
|
+
/**
|
|
162
|
+
* Set of row visible-indices currently inside the focused range.
|
|
163
|
+
* Populated by the parent's `$effect` through `setFocusedDerived`
|
|
164
|
+
* (the effect reads `paginationRowModel` directly so it stays on
|
|
165
|
+
* `TableContext`).
|
|
166
|
+
*/
|
|
167
|
+
private _focusedRowIndices;
|
|
168
|
+
/**
|
|
169
|
+
* Set of column ids currently inside the focused range. Mirrors
|
|
170
|
+
* `_focusedRowIndices` - populated by the parent's `$effect`.
|
|
171
|
+
*/
|
|
172
|
+
private _focusedColumnIds;
|
|
173
|
+
/**
|
|
174
|
+
* @param deps thunks the sub-context reads from the parent.
|
|
175
|
+
* Constructor-only - no implicit setup so the parent
|
|
176
|
+
* remains in control of effect ownership and lifecycle.
|
|
177
|
+
*/
|
|
178
|
+
constructor(deps: FocusStateDeps<T>);
|
|
179
|
+
/** The anchor cell of the focused range. */
|
|
180
|
+
get focusStart(): CellCoordinates | null;
|
|
181
|
+
/** The opposite-corner cell of the focused range. */
|
|
182
|
+
get focusEnd(): CellCoordinates | null;
|
|
183
|
+
set focusEnd(v: CellCoordinates | null);
|
|
184
|
+
/** `true` while the anchor cell is in edit-mode. */
|
|
185
|
+
get focusStartIsBeingEdited(): boolean;
|
|
186
|
+
set focusStartIsBeingEdited(v: boolean);
|
|
187
|
+
/** `true` between `startFocus` (mousedown) and `endFocus` (mouseup). */
|
|
188
|
+
get isMousingDown(): boolean;
|
|
189
|
+
set isMousingDown(v: boolean);
|
|
190
|
+
/** Set of row visible-indices currently inside the focused range. */
|
|
191
|
+
get focusedRowIndices(): ReadonlySet<number>;
|
|
192
|
+
/** Set of column ids currently inside the focused range. */
|
|
193
|
+
get focusedColumnIds(): ReadonlySet<string>;
|
|
194
|
+
/**
|
|
195
|
+
* Setter for the two derived sets, driven by the parent's
|
|
196
|
+
* `$effect`. The effect lives on `TableContext` because it needs
|
|
197
|
+
* the parent's `paginationRowModel` + `_visualColumns` reads; the
|
|
198
|
+
* sub-context publishes its result through this single seam.
|
|
199
|
+
*/
|
|
200
|
+
setFocusedDerived(rowIndices: ReadonlySet<number>, columnIds: ReadonlySet<string>): void;
|
|
201
|
+
/**
|
|
202
|
+
* Visual-column index of `focusStart`. Returns -1 when there is no
|
|
203
|
+
* active focus. Reads through to the `getVisualColumnIndexById`
|
|
204
|
+
* thunk (which is owned by `ColumnLayoutState`).
|
|
205
|
+
*/
|
|
206
|
+
get focusStartVisualColumn(): VisualColumnIndex;
|
|
207
|
+
/**
|
|
208
|
+
* Visual-column index of `focusEnd`. Returns -1 when there is no
|
|
209
|
+
* active focus.
|
|
210
|
+
*/
|
|
211
|
+
get focusEndVisualColumn(): VisualColumnIndex;
|
|
212
|
+
/** Begins a mouse-driven multi-cell selection at `coords`. */
|
|
213
|
+
readonly startFocus: (coords: CellCoordinates) => void;
|
|
214
|
+
/**
|
|
215
|
+
* Moves the focused cell to `coords`, collapsing any multi-cell
|
|
216
|
+
* range onto the single coordinate. Pass `startEditing` to enter
|
|
217
|
+
* edit mode on the next microtask (after the DOM has caught up to
|
|
218
|
+
* the new focus target).
|
|
219
|
+
*/
|
|
220
|
+
readonly moveFocus: (coords: CellCoordinates, startEditing?: boolean) => void;
|
|
221
|
+
/** Clears focus start, focus end, and editing state. */
|
|
222
|
+
readonly unfocus: () => void;
|
|
223
|
+
/** Ends a mouse-driven multi-cell selection at `coords`. */
|
|
224
|
+
readonly endFocus: (coords: CellCoordinates) => void;
|
|
225
|
+
/**
|
|
226
|
+
* Sets the end-of-range cell for keyboard-driven selection. Bound
|
|
227
|
+
* to mouse-drag start/end via `isMousingDown`; no-op when copy is
|
|
228
|
+
* disabled.
|
|
229
|
+
*/
|
|
230
|
+
readonly setFocusEnd: (coords: CellCoordinates) => void;
|
|
231
|
+
/** Extends the focused range to the topmost row in the current page. */
|
|
232
|
+
readonly focusToTop: () => void;
|
|
233
|
+
/** Extends the focused range to the bottommost row in the current page. */
|
|
234
|
+
readonly focusToBottom: () => void;
|
|
235
|
+
/** Moves the single focus cell to the bottommost row. */
|
|
236
|
+
readonly moveToBottom: () => void;
|
|
237
|
+
/** Moves the single focus cell to the topmost row. */
|
|
238
|
+
readonly moveToTop: () => void;
|
|
239
|
+
/** Extends the focused range to the leftmost visible column. */
|
|
240
|
+
readonly focusToStart: () => void;
|
|
241
|
+
/** Moves the single focus cell to the leftmost visible column. */
|
|
242
|
+
readonly moveToStart: () => void;
|
|
243
|
+
/** Extends the focused range to the rightmost visible column. */
|
|
244
|
+
readonly focusToEnd: () => void;
|
|
245
|
+
/** Moves the single focus cell to the rightmost visible column. */
|
|
246
|
+
readonly moveToEnd: () => void;
|
|
247
|
+
/** Extends the focused range one row up (Shift+ArrowUp). */
|
|
248
|
+
readonly moveFocusUp: () => void;
|
|
249
|
+
/** Moves the single focus cell one row up (ArrowUp). */
|
|
250
|
+
readonly setFocusUp: () => void;
|
|
251
|
+
/** Extends the focused range one row down (Shift+ArrowDown). */
|
|
252
|
+
readonly moveFocusDown: () => void;
|
|
253
|
+
/** Moves the single focus cell one row down (ArrowDown). */
|
|
254
|
+
readonly setFocusDown: () => void;
|
|
255
|
+
/** Extends the focused range one column left (Shift+ArrowLeft). */
|
|
256
|
+
readonly moveFocusLeft: () => void;
|
|
257
|
+
/** Moves the single focus cell one column left (ArrowLeft). */
|
|
258
|
+
readonly setFocusLeft: () => void;
|
|
259
|
+
/** Extends the focused range one column right (Shift+ArrowRight). */
|
|
260
|
+
readonly moveFocusRight: () => void;
|
|
261
|
+
/** Moves the single focus cell one column right (ArrowRight). */
|
|
262
|
+
readonly setFocusRight: () => void;
|
|
263
|
+
/** Tab-key navigation: visit the next visible cell in VISUAL order,
|
|
264
|
+
* wrapping rows. Visual order means left-pinned columns come
|
|
265
|
+
* first (in pin order), then centre columns (in column-def
|
|
266
|
+
* order), then right-pinned columns. The `visualColumns` array
|
|
267
|
+
* on `ColumnLayoutState` is already pre-filtered to visible
|
|
268
|
+
* columns, so no separate visibility check is required here. */
|
|
269
|
+
readonly tabForward: () => void;
|
|
270
|
+
/** Shift+Tab navigation: visit the previous visible cell in VISUAL
|
|
271
|
+
* order, wrapping rows. Mirror of `tabForward`. */
|
|
272
|
+
readonly tabBackward: () => void;
|
|
273
|
+
/**
|
|
274
|
+
* Root-level `onkeydown` handler attached at the table-container
|
|
275
|
+
* level. Owns: Ctrl+F toggle for quick filter, Escape exit-edit,
|
|
276
|
+
* Tab cycle, and dispatch into the arrow-key navigation paths via
|
|
277
|
+
* `handleKeystroke`.
|
|
278
|
+
*
|
|
279
|
+
* The Ctrl+F and Tab branches delegate to parent thunks
|
|
280
|
+
* (`toggleQuickFiltering`, `tabForward`, `tabBackward`) because the
|
|
281
|
+
* parent owns the legacy public surface and may need to coordinate
|
|
282
|
+
* with DOM concerns (the quick-filter toggle synchronously
|
|
283
|
+
* refocuses a `<td>` after the toggle).
|
|
284
|
+
*/
|
|
285
|
+
readonly handleTdKeydown: (e: KeyboardEvent) => void;
|
|
286
|
+
/**
|
|
287
|
+
* Arrow / Home / End / Ctrl+A / Ctrl+C dispatch. Split out from
|
|
288
|
+
* `handleTdKeydown` so the synchronous Ctrl+F / Escape / Tab
|
|
289
|
+
* branches can run before the async copy path.
|
|
290
|
+
*/
|
|
291
|
+
private handleKeystroke;
|
|
292
|
+
/**
|
|
293
|
+
* Shift the focusEnd row by `offset` rows in the current
|
|
294
|
+
* `paginationRowModel`. `Infinity` / `-Infinity` jumps to the last /
|
|
295
|
+
* first row. No-op when `allowCopy` is false or focusEnd is null.
|
|
296
|
+
*/
|
|
297
|
+
private _moveFocusEndRow;
|
|
298
|
+
/**
|
|
299
|
+
* Move the single-cell focus (focusStart + focusEnd) by `offset`
|
|
300
|
+
* rows in the current `paginationRowModel`. Reused for the
|
|
301
|
+
* non-range arrow keys (ArrowDown / ArrowUp without Shift) and the
|
|
302
|
+
* Ctrl+ArrowDown / Ctrl+ArrowUp jumps to the top / bottom row.
|
|
303
|
+
*/
|
|
304
|
+
private _moveFocusRow;
|
|
305
|
+
private readonly _focusDetailsCache;
|
|
306
|
+
/**
|
|
307
|
+
* Returns a `TableFocusDetails` keyed on the supplied cell. The
|
|
308
|
+
* first call for a given cell constructs the instance; subsequent
|
|
309
|
+
* calls return the cached instance.
|
|
310
|
+
*
|
|
311
|
+
* Generic - the returned `TableFocusDetails<T, IdType>` is widened
|
|
312
|
+
* to `Primitive` for the cache, but the typed cast on return keeps
|
|
313
|
+
* the call-site signature clean for cell consumers.
|
|
314
|
+
*/
|
|
315
|
+
getFocusDetailsFor<IdType extends Primitive = Primitive>(cell: TableCell<T>): TableFocusDetails<T, IdType>;
|
|
316
|
+
}
|