@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,751 @@
|
|
|
1
|
+
import { tick } from 'svelte';
|
|
2
|
+
import { devCatch } from '../../../../Helpers/Helpers.svelte.js';
|
|
3
|
+
import { TableFocusDetails } from '../Focus/TableFocusDetails.svelte.js';
|
|
4
|
+
/**
|
|
5
|
+
* Phase 6.6 god-object decomposition - sub-context that owns every
|
|
6
|
+
* focus + keyboard-navigation concern previously held directly on
|
|
7
|
+
* `TableContext`:
|
|
8
|
+
*
|
|
9
|
+
* - `focusStart` / `focusEnd` (the two `CellCoordinates` slots that
|
|
10
|
+
* define the focused cell-range);
|
|
11
|
+
* - `focusStartIsBeingEdited` (the editing-mode flag);
|
|
12
|
+
* - `isMousingDown` (drag-select sentinel for mouse-driven multi-cell
|
|
13
|
+
* selection);
|
|
14
|
+
* - the `focusedRowIndices` / `focusedColumnIds` derived sets that
|
|
15
|
+
* power the per-cell `TableFocusDetails` outline computation;
|
|
16
|
+
* - `startFocus` / `moveFocus` / `unfocus` / `endFocus` / `setFocusEnd`
|
|
17
|
+
* (consumer-facing writers - mouse-driven and direct);
|
|
18
|
+
* - `focusToTop` / `focusToBottom` / `moveToTop` / `moveToBottom` /
|
|
19
|
+
* `focusToStart` / `focusToEnd` / `moveToStart` / `moveToEnd`
|
|
20
|
+
* (range jumps);
|
|
21
|
+
* - `moveFocusUp` / `setFocusUp` / `moveFocusDown` / `setFocusDown` /
|
|
22
|
+
* `moveFocusLeft` / `setFocusLeft` / `moveFocusRight` / `setFocusRight`
|
|
23
|
+
* (single-cell vs. range arrow moves);
|
|
24
|
+
* - `handleTdKeydown` (the table-container `onkeydown` router);
|
|
25
|
+
* - `handleKeystroke` (the dispatch into the arrow/Home/End/Ctrl+A/
|
|
26
|
+
* Ctrl+C paths);
|
|
27
|
+
* - `focusStartVisualColumn` / `focusEndVisualColumn` (visual-column
|
|
28
|
+
* getters powered by `getVisualColumnIndexById`).
|
|
29
|
+
*
|
|
30
|
+
* Effect lifecycle: the parent owns the `$effect` that publishes
|
|
31
|
+
* `_focusedRowIndices` / `_focusedColumnIds`. That effect now calls
|
|
32
|
+
* into this sub-context through `setFocusedDerived(rows, cols)`
|
|
33
|
+
* rather than mutating the state slots directly. The effect lives
|
|
34
|
+
* on `TableContext` because it needs the parent's
|
|
35
|
+
* `paginationRowModel` + `_visualColumns` reads.
|
|
36
|
+
*
|
|
37
|
+
* `TableContext` retains delegating getters / setters / methods for
|
|
38
|
+
* every legacy surface (`focusStart`, `focusEnd`, `focusStartIsBeingEdited`,
|
|
39
|
+
* `isMousingDown`, `focusedRowIndices`, `focusedColumnIds`,
|
|
40
|
+
* `focusStartVisualColumn`, `focusEndVisualColumn`, `startFocus`,
|
|
41
|
+
* `moveFocus`, `unfocus`, `endFocus`, `setFocusEnd`, `setFocusUp`,
|
|
42
|
+
* `setFocusDown`, `setFocusLeft`, `setFocusRight`, `moveFocusUp`,
|
|
43
|
+
* `moveFocusDown`, `moveFocusLeft`, `moveFocusRight`, `moveToTop`,
|
|
44
|
+
* `moveToBottom`, `moveToStart`, `moveToEnd`, `focusToTop`,
|
|
45
|
+
* `focusToBottom`, `focusToStart`, `focusToEnd`, `handleTdKeydown`)
|
|
46
|
+
* so existing consumers need no migration.
|
|
47
|
+
*
|
|
48
|
+
* @remarks
|
|
49
|
+
* Group 2 Item C (per-cell `TableFocusDetails` reuse) is deferred for
|
|
50
|
+
* Phase 6.6. The cache would need a `${rowKey}:${columnId}` key, but
|
|
51
|
+
* `selectionExtractor` can be async (the sub-context's `cachedKey`
|
|
52
|
+
* returns `RowIdType | Promise<RowIdType>`), so the cache lookup
|
|
53
|
+
* cannot complete synchronously inside a cell render. The reuse
|
|
54
|
+
* requires a follow-up refactor that either:
|
|
55
|
+
* a) memoises `TableFocusDetails` instances on the row reference
|
|
56
|
+
* (a `WeakMap<TableCell<T>, TableFocusDetails<T, RowIdType>>`),
|
|
57
|
+
* which side-steps the async key entirely, or
|
|
58
|
+
* b) hoists the key resolution into a `$state` slot populated by
|
|
59
|
+
* `updateSelectedItems` so the lookup is sync at render time.
|
|
60
|
+
* Both are larger surface changes than the FocusState extraction;
|
|
61
|
+
* tracked under Phase 6.7 BREAKING-CHANGES.md.
|
|
62
|
+
*/
|
|
63
|
+
export class FocusState {
|
|
64
|
+
_deps;
|
|
65
|
+
/** The anchor cell of the focused range. `null` when the table has no
|
|
66
|
+
* active focus (post-`unfocus`, or before the first mouse / keyboard
|
|
67
|
+
* interaction). */
|
|
68
|
+
_focusStart = $state(null);
|
|
69
|
+
/** The opposite-corner cell of the focused range. Equal to
|
|
70
|
+
* `focusStart` when a single cell is focused; differs during
|
|
71
|
+
* Shift+Arrow / mouse-drag selection. */
|
|
72
|
+
_focusEnd = $state(null);
|
|
73
|
+
/** `true` while the anchor cell is in edit-mode (the cell's editable
|
|
74
|
+
* child input has focus). Set by `moveFocus(coords, true)` and
|
|
75
|
+
* cleared by `Escape` / `unfocus`. */
|
|
76
|
+
_focusStartIsBeingEdited = $state(false);
|
|
77
|
+
/** `true` between `startFocus` (mousedown on a cell) and `endFocus`
|
|
78
|
+
* (mouseup). Drives the `setFocusEnd` mousemove listener attach /
|
|
79
|
+
* detach in the table container. */
|
|
80
|
+
_isMousingDown = $state(false);
|
|
81
|
+
/**
|
|
82
|
+
* Set of row visible-indices currently inside the focused range.
|
|
83
|
+
* Populated by the parent's `$effect` through `setFocusedDerived`
|
|
84
|
+
* (the effect reads `paginationRowModel` directly so it stays on
|
|
85
|
+
* `TableContext`).
|
|
86
|
+
*/
|
|
87
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
88
|
+
_focusedRowIndices = $state(new Set());
|
|
89
|
+
/**
|
|
90
|
+
* Set of column ids currently inside the focused range. Mirrors
|
|
91
|
+
* `_focusedRowIndices` - populated by the parent's `$effect`.
|
|
92
|
+
*/
|
|
93
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
94
|
+
_focusedColumnIds = $state(new Set());
|
|
95
|
+
/**
|
|
96
|
+
* @param deps thunks the sub-context reads from the parent.
|
|
97
|
+
* Constructor-only - no implicit setup so the parent
|
|
98
|
+
* remains in control of effect ownership and lifecycle.
|
|
99
|
+
*/
|
|
100
|
+
constructor(deps) {
|
|
101
|
+
this._deps = deps;
|
|
102
|
+
}
|
|
103
|
+
// -----------------------------------------------------------------
|
|
104
|
+
// state accessors (delegating-friendly: each slot is exposed
|
|
105
|
+
// through a public get/set pair so the parent's legacy getters
|
|
106
|
+
// can forward without piercing the boundary)
|
|
107
|
+
// -----------------------------------------------------------------
|
|
108
|
+
/** The anchor cell of the focused range. */
|
|
109
|
+
get focusStart() {
|
|
110
|
+
return this._focusStart;
|
|
111
|
+
}
|
|
112
|
+
/** The opposite-corner cell of the focused range. */
|
|
113
|
+
get focusEnd() {
|
|
114
|
+
return this._focusEnd;
|
|
115
|
+
}
|
|
116
|
+
set focusEnd(v) {
|
|
117
|
+
this._focusEnd = v;
|
|
118
|
+
}
|
|
119
|
+
/** `true` while the anchor cell is in edit-mode. */
|
|
120
|
+
get focusStartIsBeingEdited() {
|
|
121
|
+
return this._focusStartIsBeingEdited;
|
|
122
|
+
}
|
|
123
|
+
set focusStartIsBeingEdited(v) {
|
|
124
|
+
this._focusStartIsBeingEdited = v;
|
|
125
|
+
}
|
|
126
|
+
/** `true` between `startFocus` (mousedown) and `endFocus` (mouseup). */
|
|
127
|
+
get isMousingDown() {
|
|
128
|
+
return this._isMousingDown;
|
|
129
|
+
}
|
|
130
|
+
set isMousingDown(v) {
|
|
131
|
+
this._isMousingDown = v;
|
|
132
|
+
}
|
|
133
|
+
/** Set of row visible-indices currently inside the focused range. */
|
|
134
|
+
get focusedRowIndices() {
|
|
135
|
+
return this._focusedRowIndices;
|
|
136
|
+
}
|
|
137
|
+
/** Set of column ids currently inside the focused range. */
|
|
138
|
+
get focusedColumnIds() {
|
|
139
|
+
return this._focusedColumnIds;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* Setter for the two derived sets, driven by the parent's
|
|
143
|
+
* `$effect`. The effect lives on `TableContext` because it needs
|
|
144
|
+
* the parent's `paginationRowModel` + `_visualColumns` reads; the
|
|
145
|
+
* sub-context publishes its result through this single seam.
|
|
146
|
+
*/
|
|
147
|
+
setFocusedDerived(rowIndices, columnIds) {
|
|
148
|
+
this._focusedRowIndices = rowIndices;
|
|
149
|
+
this._focusedColumnIds = columnIds;
|
|
150
|
+
}
|
|
151
|
+
/**
|
|
152
|
+
* Visual-column index of `focusStart`. Returns -1 when there is no
|
|
153
|
+
* active focus. Reads through to the `getVisualColumnIndexById`
|
|
154
|
+
* thunk (which is owned by `ColumnLayoutState`).
|
|
155
|
+
*/
|
|
156
|
+
get focusStartVisualColumn() {
|
|
157
|
+
if (!this._focusStart) {
|
|
158
|
+
return -1;
|
|
159
|
+
}
|
|
160
|
+
return this._deps.getVisualColumnIndexById(this._focusStart.id);
|
|
161
|
+
}
|
|
162
|
+
/**
|
|
163
|
+
* Visual-column index of `focusEnd`. Returns -1 when there is no
|
|
164
|
+
* active focus.
|
|
165
|
+
*/
|
|
166
|
+
get focusEndVisualColumn() {
|
|
167
|
+
if (!this._focusEnd) {
|
|
168
|
+
return -1;
|
|
169
|
+
}
|
|
170
|
+
return this._deps.getVisualColumnIndexById(this._focusEnd.id);
|
|
171
|
+
}
|
|
172
|
+
// -----------------------------------------------------------------
|
|
173
|
+
// mouse-driven multi-cell selection (startFocus / endFocus /
|
|
174
|
+
// setFocusEnd) and the primary range writers (moveFocus / unfocus)
|
|
175
|
+
// -----------------------------------------------------------------
|
|
176
|
+
/** Begins a mouse-driven multi-cell selection at `coords`. */
|
|
177
|
+
startFocus = (coords) => {
|
|
178
|
+
this._isMousingDown = true;
|
|
179
|
+
this.moveFocus(coords);
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Moves the focused cell to `coords`, collapsing any multi-cell
|
|
183
|
+
* range onto the single coordinate. Pass `startEditing` to enter
|
|
184
|
+
* edit mode on the next microtask (after the DOM has caught up to
|
|
185
|
+
* the new focus target).
|
|
186
|
+
*/
|
|
187
|
+
moveFocus = (coords, startEditing = false) => {
|
|
188
|
+
this._focusStart = { ...coords };
|
|
189
|
+
this._focusEnd = { ...coords };
|
|
190
|
+
if (startEditing) {
|
|
191
|
+
tick()
|
|
192
|
+
.then(() => {
|
|
193
|
+
this._focusStartIsBeingEdited = true;
|
|
194
|
+
})
|
|
195
|
+
.catch(devCatch);
|
|
196
|
+
}
|
|
197
|
+
};
|
|
198
|
+
/** Clears focus start, focus end, and editing state. */
|
|
199
|
+
unfocus = () => {
|
|
200
|
+
this._focusStartIsBeingEdited = false;
|
|
201
|
+
this._focusStart = null;
|
|
202
|
+
this._focusEnd = null;
|
|
203
|
+
};
|
|
204
|
+
/** Ends a mouse-driven multi-cell selection at `coords`. */
|
|
205
|
+
endFocus = (coords) => {
|
|
206
|
+
if (this._isMousingDown) {
|
|
207
|
+
this._isMousingDown = false;
|
|
208
|
+
if (!this._deps.getAllowCopy()) {
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
this._focusEnd = { ...coords };
|
|
212
|
+
}
|
|
213
|
+
};
|
|
214
|
+
/**
|
|
215
|
+
* Sets the end-of-range cell for keyboard-driven selection. Bound
|
|
216
|
+
* to mouse-drag start/end via `isMousingDown`; no-op when copy is
|
|
217
|
+
* disabled.
|
|
218
|
+
*/
|
|
219
|
+
setFocusEnd = (coords) => {
|
|
220
|
+
if (!this._deps.getAllowCopy()) {
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
this._focusEnd = coords;
|
|
224
|
+
};
|
|
225
|
+
// -----------------------------------------------------------------
|
|
226
|
+
// range jumps (top / bottom / start / end)
|
|
227
|
+
// -----------------------------------------------------------------
|
|
228
|
+
/** Extends the focused range to the topmost row in the current page. */
|
|
229
|
+
focusToTop = () => {
|
|
230
|
+
if (!this._deps.getAllowCopy()) {
|
|
231
|
+
return;
|
|
232
|
+
}
|
|
233
|
+
this._moveFocusEndRow(-Infinity);
|
|
234
|
+
};
|
|
235
|
+
/** Extends the focused range to the bottommost row in the current page. */
|
|
236
|
+
focusToBottom = () => {
|
|
237
|
+
if (!this._deps.getAllowCopy()) {
|
|
238
|
+
return;
|
|
239
|
+
}
|
|
240
|
+
this._moveFocusEndRow(Infinity);
|
|
241
|
+
};
|
|
242
|
+
/** Moves the single focus cell to the bottommost row. */
|
|
243
|
+
moveToBottom = () => {
|
|
244
|
+
this._moveFocusRow(Infinity);
|
|
245
|
+
};
|
|
246
|
+
/** Moves the single focus cell to the topmost row. */
|
|
247
|
+
moveToTop = () => {
|
|
248
|
+
this._moveFocusRow(-Infinity);
|
|
249
|
+
};
|
|
250
|
+
/** Extends the focused range to the leftmost visible column. */
|
|
251
|
+
focusToStart = () => {
|
|
252
|
+
if (!this._deps.getAllowCopy()) {
|
|
253
|
+
return;
|
|
254
|
+
}
|
|
255
|
+
if (!this._focusEnd) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const visualCols = this._deps.getVisualColumns();
|
|
259
|
+
if (visualCols.length > 0) {
|
|
260
|
+
const first = visualCols[0];
|
|
261
|
+
this._focusEnd = {
|
|
262
|
+
...this._focusEnd,
|
|
263
|
+
id: first.id,
|
|
264
|
+
column: first.index,
|
|
265
|
+
};
|
|
266
|
+
}
|
|
267
|
+
};
|
|
268
|
+
/** Moves the single focus cell to the leftmost visible column. */
|
|
269
|
+
moveToStart = () => {
|
|
270
|
+
if (!this._focusStart) {
|
|
271
|
+
return;
|
|
272
|
+
}
|
|
273
|
+
const visualCols = this._deps.getVisualColumns();
|
|
274
|
+
if (visualCols.length > 0) {
|
|
275
|
+
const first = visualCols[0];
|
|
276
|
+
this.moveFocus({
|
|
277
|
+
...this._focusStart,
|
|
278
|
+
id: first.id,
|
|
279
|
+
column: first.index,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
};
|
|
283
|
+
/** Extends the focused range to the rightmost visible column. */
|
|
284
|
+
focusToEnd = () => {
|
|
285
|
+
if (!this._deps.getAllowCopy()) {
|
|
286
|
+
return;
|
|
287
|
+
}
|
|
288
|
+
if (!this._focusEnd) {
|
|
289
|
+
return;
|
|
290
|
+
}
|
|
291
|
+
const visualCols = this._deps.getVisualColumns();
|
|
292
|
+
if (visualCols.length > 0) {
|
|
293
|
+
const last = visualCols[visualCols.length - 1];
|
|
294
|
+
this._focusEnd = {
|
|
295
|
+
...this._focusEnd,
|
|
296
|
+
id: last.id,
|
|
297
|
+
column: last.index,
|
|
298
|
+
};
|
|
299
|
+
}
|
|
300
|
+
};
|
|
301
|
+
/** Moves the single focus cell to the rightmost visible column. */
|
|
302
|
+
moveToEnd = () => {
|
|
303
|
+
if (!this._focusStart) {
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
306
|
+
const visualCols = this._deps.getVisualColumns();
|
|
307
|
+
if (visualCols.length > 0) {
|
|
308
|
+
const last = visualCols[visualCols.length - 1];
|
|
309
|
+
this.moveFocus({
|
|
310
|
+
...this._focusStart,
|
|
311
|
+
id: last.id,
|
|
312
|
+
column: last.index,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
};
|
|
316
|
+
// -----------------------------------------------------------------
|
|
317
|
+
// arrow-key moves (single-cell + range)
|
|
318
|
+
// -----------------------------------------------------------------
|
|
319
|
+
/** Extends the focused range one row up (Shift+ArrowUp). */
|
|
320
|
+
moveFocusUp = () => {
|
|
321
|
+
if (!this._deps.getAllowCopy()) {
|
|
322
|
+
return;
|
|
323
|
+
}
|
|
324
|
+
this._moveFocusEndRow(-1);
|
|
325
|
+
};
|
|
326
|
+
/** Moves the single focus cell one row up (ArrowUp). */
|
|
327
|
+
setFocusUp = () => {
|
|
328
|
+
this._moveFocusRow(-1);
|
|
329
|
+
};
|
|
330
|
+
/** Extends the focused range one row down (Shift+ArrowDown). */
|
|
331
|
+
moveFocusDown = () => {
|
|
332
|
+
if (!this._deps.getAllowCopy()) {
|
|
333
|
+
return;
|
|
334
|
+
}
|
|
335
|
+
this._moveFocusEndRow(1);
|
|
336
|
+
};
|
|
337
|
+
/** Moves the single focus cell one row down (ArrowDown). */
|
|
338
|
+
setFocusDown = () => {
|
|
339
|
+
this._moveFocusRow(1);
|
|
340
|
+
};
|
|
341
|
+
/** Extends the focused range one column left (Shift+ArrowLeft). */
|
|
342
|
+
moveFocusLeft = () => {
|
|
343
|
+
if (!this._deps.getAllowCopy()) {
|
|
344
|
+
return;
|
|
345
|
+
}
|
|
346
|
+
if (this._focusEnd != null) {
|
|
347
|
+
const visualCols = this._deps.getVisualColumns();
|
|
348
|
+
const visualIndex = this._deps.getVisualColumnIndexById(this._focusEnd.id);
|
|
349
|
+
if (visualIndex > 0) {
|
|
350
|
+
const prev = visualCols[visualIndex - 1];
|
|
351
|
+
this._focusEnd = {
|
|
352
|
+
...this._focusEnd,
|
|
353
|
+
id: prev.id,
|
|
354
|
+
column: prev.index,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
};
|
|
359
|
+
/** Moves the single focus cell one column left (ArrowLeft). */
|
|
360
|
+
setFocusLeft = () => {
|
|
361
|
+
if (!this._focusStart) {
|
|
362
|
+
return;
|
|
363
|
+
}
|
|
364
|
+
const visualCols = this._deps.getVisualColumns();
|
|
365
|
+
const visualIndex = this._deps.getVisualColumnIndexById(this._focusStart.id);
|
|
366
|
+
if (visualIndex > 0) {
|
|
367
|
+
const prev = visualCols[visualIndex - 1];
|
|
368
|
+
this.moveFocus({
|
|
369
|
+
...this._focusStart,
|
|
370
|
+
id: prev.id,
|
|
371
|
+
column: prev.index,
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
};
|
|
375
|
+
/** Extends the focused range one column right (Shift+ArrowRight). */
|
|
376
|
+
moveFocusRight = () => {
|
|
377
|
+
if (!this._deps.getAllowCopy()) {
|
|
378
|
+
return;
|
|
379
|
+
}
|
|
380
|
+
if (this._focusEnd != null) {
|
|
381
|
+
const visualCols = this._deps.getVisualColumns();
|
|
382
|
+
const visualIndex = this._deps.getVisualColumnIndexById(this._focusEnd.id);
|
|
383
|
+
if (visualIndex < visualCols.length - 1) {
|
|
384
|
+
const next = visualCols[visualIndex + 1];
|
|
385
|
+
this._focusEnd = {
|
|
386
|
+
...this._focusEnd,
|
|
387
|
+
id: next.id,
|
|
388
|
+
column: next.index,
|
|
389
|
+
};
|
|
390
|
+
}
|
|
391
|
+
}
|
|
392
|
+
};
|
|
393
|
+
/** Moves the single focus cell one column right (ArrowRight). */
|
|
394
|
+
setFocusRight = () => {
|
|
395
|
+
if (!this._focusStart) {
|
|
396
|
+
return;
|
|
397
|
+
}
|
|
398
|
+
const visualCols = this._deps.getVisualColumns();
|
|
399
|
+
const visualIndex = this._deps.getVisualColumnIndexById(this._focusStart.id);
|
|
400
|
+
if (visualIndex < visualCols.length - 1) {
|
|
401
|
+
const next = visualCols[visualIndex + 1];
|
|
402
|
+
this.moveFocus({
|
|
403
|
+
...this._focusStart,
|
|
404
|
+
id: next.id,
|
|
405
|
+
column: next.index,
|
|
406
|
+
});
|
|
407
|
+
}
|
|
408
|
+
};
|
|
409
|
+
// -----------------------------------------------------------------
|
|
410
|
+
// Tab navigation (memory-order walk, skipping hidden columns)
|
|
411
|
+
// -----------------------------------------------------------------
|
|
412
|
+
/** Tab-key navigation: visit the next visible cell in VISUAL order,
|
|
413
|
+
* wrapping rows. Visual order means left-pinned columns come
|
|
414
|
+
* first (in pin order), then centre columns (in column-def
|
|
415
|
+
* order), then right-pinned columns. The `visualColumns` array
|
|
416
|
+
* on `ColumnLayoutState` is already pre-filtered to visible
|
|
417
|
+
* columns, so no separate visibility check is required here. */
|
|
418
|
+
tabForward = () => {
|
|
419
|
+
if (!this._deps.getAllowCopy()) {
|
|
420
|
+
return;
|
|
421
|
+
}
|
|
422
|
+
const visualCols = this._deps.getVisualColumns();
|
|
423
|
+
const rowBounds = this._deps.getSortedDataLength();
|
|
424
|
+
if (!this._focusStart || !rowBounds || visualCols.length === 0) {
|
|
425
|
+
return;
|
|
426
|
+
}
|
|
427
|
+
let { row, id: currentId } = this._focusStart;
|
|
428
|
+
let visualIndex = visualCols.findIndex((c) => c.id === currentId);
|
|
429
|
+
if (visualIndex < 0) {
|
|
430
|
+
return;
|
|
431
|
+
}
|
|
432
|
+
++visualIndex;
|
|
433
|
+
while (row < rowBounds) {
|
|
434
|
+
if (visualIndex < visualCols.length) {
|
|
435
|
+
const def = visualCols[visualIndex];
|
|
436
|
+
this.moveFocus({ id: def.id, row, column: def.index }, this._focusStartIsBeingEdited);
|
|
437
|
+
return;
|
|
438
|
+
}
|
|
439
|
+
visualIndex = 0;
|
|
440
|
+
++row;
|
|
441
|
+
}
|
|
442
|
+
};
|
|
443
|
+
/** Shift+Tab navigation: visit the previous visible cell in VISUAL
|
|
444
|
+
* order, wrapping rows. Mirror of `tabForward`. */
|
|
445
|
+
tabBackward = () => {
|
|
446
|
+
if (!this._deps.getAllowCopy()) {
|
|
447
|
+
return;
|
|
448
|
+
}
|
|
449
|
+
const visualCols = this._deps.getVisualColumns();
|
|
450
|
+
if (!this._focusStart || visualCols.length === 0) {
|
|
451
|
+
return;
|
|
452
|
+
}
|
|
453
|
+
let { row, id: currentId } = this._focusStart;
|
|
454
|
+
let visualIndex = visualCols.findIndex((c) => c.id === currentId);
|
|
455
|
+
if (visualIndex < 0) {
|
|
456
|
+
return;
|
|
457
|
+
}
|
|
458
|
+
--visualIndex;
|
|
459
|
+
while (row > -1) {
|
|
460
|
+
if (visualIndex > -1) {
|
|
461
|
+
const def = visualCols[visualIndex];
|
|
462
|
+
this.moveFocus({ id: def.id, row, column: def.index }, this._focusStartIsBeingEdited);
|
|
463
|
+
return;
|
|
464
|
+
}
|
|
465
|
+
visualIndex = visualCols.length - 1;
|
|
466
|
+
--row;
|
|
467
|
+
}
|
|
468
|
+
};
|
|
469
|
+
// -----------------------------------------------------------------
|
|
470
|
+
// keystroke routing
|
|
471
|
+
// -----------------------------------------------------------------
|
|
472
|
+
/**
|
|
473
|
+
* Root-level `onkeydown` handler attached at the table-container
|
|
474
|
+
* level. Owns: Ctrl+F toggle for quick filter, Escape exit-edit,
|
|
475
|
+
* Tab cycle, and dispatch into the arrow-key navigation paths via
|
|
476
|
+
* `handleKeystroke`.
|
|
477
|
+
*
|
|
478
|
+
* The Ctrl+F and Tab branches delegate to parent thunks
|
|
479
|
+
* (`toggleQuickFiltering`, `tabForward`, `tabBackward`) because the
|
|
480
|
+
* parent owns the legacy public surface and may need to coordinate
|
|
481
|
+
* with DOM concerns (the quick-filter toggle synchronously
|
|
482
|
+
* refocuses a `<td>` after the toggle).
|
|
483
|
+
*/
|
|
484
|
+
handleTdKeydown = (e) => {
|
|
485
|
+
e.stopPropagation();
|
|
486
|
+
if (e.key.toLocaleUpperCase() === 'F' && e.ctrlKey && this._deps.getAllowQuickFiltering()) {
|
|
487
|
+
e.preventDefault();
|
|
488
|
+
this._deps.toggleQuickFiltering();
|
|
489
|
+
}
|
|
490
|
+
else if (e.key === 'Escape') {
|
|
491
|
+
e.preventDefault();
|
|
492
|
+
this._focusStartIsBeingEdited = false;
|
|
493
|
+
}
|
|
494
|
+
else if (e.key === 'Tab') {
|
|
495
|
+
//allow regular operation in side panels
|
|
496
|
+
const target = e.target;
|
|
497
|
+
if (target?.closest('.side-panel') != null ||
|
|
498
|
+
target?.attributes.getNamedItem('data-type')?.value === 'quicksearch') {
|
|
499
|
+
return;
|
|
500
|
+
}
|
|
501
|
+
e.preventDefault();
|
|
502
|
+
if (e.getModifierState('Shift')) {
|
|
503
|
+
this._deps.tabBackward();
|
|
504
|
+
}
|
|
505
|
+
else {
|
|
506
|
+
this._deps.tabForward();
|
|
507
|
+
}
|
|
508
|
+
}
|
|
509
|
+
if (e.target.tagName === 'INPUT' &&
|
|
510
|
+
e.target.attributes.getNamedItem('type')?.value !== 'checkbox') {
|
|
511
|
+
return;
|
|
512
|
+
}
|
|
513
|
+
this.handleKeystroke(e).catch(devCatch);
|
|
514
|
+
};
|
|
515
|
+
/**
|
|
516
|
+
* Arrow / Home / End / Ctrl+A / Ctrl+C dispatch. Split out from
|
|
517
|
+
* `handleTdKeydown` so the synchronous Ctrl+F / Escape / Tab
|
|
518
|
+
* branches can run before the async copy path.
|
|
519
|
+
*/
|
|
520
|
+
async handleKeystroke(e) {
|
|
521
|
+
const allowCopy = this._deps.getAllowCopy();
|
|
522
|
+
switch (e.key) {
|
|
523
|
+
case 'Enter':
|
|
524
|
+
case 'F2':
|
|
525
|
+
if (!e.target?.classList.contains('editable')) {
|
|
526
|
+
break;
|
|
527
|
+
}
|
|
528
|
+
e.preventDefault();
|
|
529
|
+
e.target?.dispatchEvent(new CustomEvent('edit', { detail: { selectAll: e.key === 'Enter' } }));
|
|
530
|
+
// focusStartIsBeingEdited.set(true);
|
|
531
|
+
break;
|
|
532
|
+
case 'ArrowUp': {
|
|
533
|
+
e.preventDefault();
|
|
534
|
+
if (e.getModifierState('Control')) {
|
|
535
|
+
if (e.getModifierState('Shift')) {
|
|
536
|
+
if (!allowCopy) {
|
|
537
|
+
return;
|
|
538
|
+
}
|
|
539
|
+
this.focusToTop();
|
|
540
|
+
}
|
|
541
|
+
else {
|
|
542
|
+
this.moveToTop();
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
else if (e.getModifierState('Shift')) {
|
|
546
|
+
if (!allowCopy) {
|
|
547
|
+
return;
|
|
548
|
+
}
|
|
549
|
+
this.moveFocusUp();
|
|
550
|
+
}
|
|
551
|
+
else {
|
|
552
|
+
this.setFocusUp();
|
|
553
|
+
}
|
|
554
|
+
return;
|
|
555
|
+
}
|
|
556
|
+
case 'ArrowDown': {
|
|
557
|
+
e.preventDefault();
|
|
558
|
+
if (e.getModifierState('Control')) {
|
|
559
|
+
if (e.getModifierState('Shift')) {
|
|
560
|
+
if (!allowCopy) {
|
|
561
|
+
return;
|
|
562
|
+
}
|
|
563
|
+
this.focusToBottom();
|
|
564
|
+
}
|
|
565
|
+
else {
|
|
566
|
+
this.moveToBottom();
|
|
567
|
+
}
|
|
568
|
+
}
|
|
569
|
+
else if (e.getModifierState('Shift')) {
|
|
570
|
+
if (!allowCopy) {
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
this.moveFocusDown();
|
|
574
|
+
}
|
|
575
|
+
else {
|
|
576
|
+
this.setFocusDown();
|
|
577
|
+
}
|
|
578
|
+
return;
|
|
579
|
+
}
|
|
580
|
+
// TODO add ctrl-home and ctrl-end as ways to get to top-left/bottom-right
|
|
581
|
+
case 'ArrowLeft':
|
|
582
|
+
case 'Home': {
|
|
583
|
+
e.preventDefault();
|
|
584
|
+
if (e.getModifierState('Control') || e.key === 'Home') {
|
|
585
|
+
if (e.getModifierState('Shift')) {
|
|
586
|
+
if (!allowCopy) {
|
|
587
|
+
return;
|
|
588
|
+
}
|
|
589
|
+
this.focusToStart();
|
|
590
|
+
}
|
|
591
|
+
else {
|
|
592
|
+
this.moveToStart();
|
|
593
|
+
}
|
|
594
|
+
//these two at the bottom shouldn't happen on a home press
|
|
595
|
+
}
|
|
596
|
+
else if (e.getModifierState('Shift') && allowCopy) {
|
|
597
|
+
this.moveFocusLeft();
|
|
598
|
+
}
|
|
599
|
+
else {
|
|
600
|
+
this.setFocusLeft();
|
|
601
|
+
}
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
604
|
+
case 'ArrowRight':
|
|
605
|
+
case 'End': {
|
|
606
|
+
e.preventDefault();
|
|
607
|
+
if (e.getModifierState('Control') || e.key === 'End') {
|
|
608
|
+
if (e.getModifierState('Shift')) {
|
|
609
|
+
if (!allowCopy) {
|
|
610
|
+
return;
|
|
611
|
+
}
|
|
612
|
+
this.focusToEnd();
|
|
613
|
+
}
|
|
614
|
+
else {
|
|
615
|
+
this.moveToEnd();
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
else if (e.getModifierState('Shift') && allowCopy) {
|
|
619
|
+
this.moveFocusRight();
|
|
620
|
+
}
|
|
621
|
+
else {
|
|
622
|
+
this.setFocusRight();
|
|
623
|
+
}
|
|
624
|
+
return;
|
|
625
|
+
}
|
|
626
|
+
default: {
|
|
627
|
+
if (this._deps.getDebug()) {
|
|
628
|
+
console.log(`handleKeystroke: ignoring key ${e.key}`);
|
|
629
|
+
}
|
|
630
|
+
break;
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
if (allowCopy) {
|
|
634
|
+
switch (e.key) {
|
|
635
|
+
case 'a': {
|
|
636
|
+
if (e.ctrlKey) {
|
|
637
|
+
e.preventDefault();
|
|
638
|
+
this.moveToTop();
|
|
639
|
+
this.moveToStart();
|
|
640
|
+
this.focusToBottom();
|
|
641
|
+
this.focusToEnd();
|
|
642
|
+
}
|
|
643
|
+
break;
|
|
644
|
+
}
|
|
645
|
+
case 'c':
|
|
646
|
+
case 'C':
|
|
647
|
+
if (e.getModifierState('Control')) {
|
|
648
|
+
e.preventDefault();
|
|
649
|
+
await this._deps.copyDataToClipboard();
|
|
650
|
+
}
|
|
651
|
+
break;
|
|
652
|
+
default: {
|
|
653
|
+
//nothing
|
|
654
|
+
break;
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
// -----------------------------------------------------------------
|
|
660
|
+
// private row-axis offset walk
|
|
661
|
+
// -----------------------------------------------------------------
|
|
662
|
+
/**
|
|
663
|
+
* Shift the focusEnd row by `offset` rows in the current
|
|
664
|
+
* `paginationRowModel`. `Infinity` / `-Infinity` jumps to the last /
|
|
665
|
+
* first row. No-op when `allowCopy` is false or focusEnd is null.
|
|
666
|
+
*/
|
|
667
|
+
_moveFocusEndRow(offset) {
|
|
668
|
+
if (!this._deps.getAllowCopy()) {
|
|
669
|
+
return;
|
|
670
|
+
}
|
|
671
|
+
if (!this._focusEnd) {
|
|
672
|
+
console.warn('no focusEnd found');
|
|
673
|
+
return;
|
|
674
|
+
}
|
|
675
|
+
const focusEnd = this._focusEnd;
|
|
676
|
+
const prm = this._deps.getPaginationRowModel();
|
|
677
|
+
const rows = prm.rows;
|
|
678
|
+
const endRowIndex = rows.findIndex((row) => row.visibleIndex === focusEnd.row);
|
|
679
|
+
this._focusEnd = {
|
|
680
|
+
...this._focusEnd,
|
|
681
|
+
row: rows[Math.max(Math.min(endRowIndex + offset, rows.length - 1), 0)].visibleIndex,
|
|
682
|
+
};
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* Move the single-cell focus (focusStart + focusEnd) by `offset`
|
|
686
|
+
* rows in the current `paginationRowModel`. Reused for the
|
|
687
|
+
* non-range arrow keys (ArrowDown / ArrowUp without Shift) and the
|
|
688
|
+
* Ctrl+ArrowDown / Ctrl+ArrowUp jumps to the top / bottom row.
|
|
689
|
+
*/
|
|
690
|
+
_moveFocusRow(offset) {
|
|
691
|
+
if (!this._focusStart) {
|
|
692
|
+
console.warn('no focusStart found');
|
|
693
|
+
return;
|
|
694
|
+
}
|
|
695
|
+
const focusStart = this._focusStart;
|
|
696
|
+
const newEndRowIndex = (() => {
|
|
697
|
+
const prm = this._deps.getPaginationRowModel();
|
|
698
|
+
const rows = prm.rows;
|
|
699
|
+
const endRowIndex = rows.findIndex((row) => row.visibleIndex === focusStart.row);
|
|
700
|
+
return rows[Math.max(Math.min(endRowIndex + offset, rows.length - 1), 0)].visibleIndex;
|
|
701
|
+
})();
|
|
702
|
+
this.moveFocus({ ...this._focusStart, row: newEndRowIndex });
|
|
703
|
+
}
|
|
704
|
+
// -----------------------------------------------------------------
|
|
705
|
+
// Per-cell TableFocusDetails reuse (Phase 7.1 Item C)
|
|
706
|
+
//
|
|
707
|
+
// Prior to Phase 7.1, every cell component (TableTextInput,
|
|
708
|
+
// FocusableImmutableCell, TableNumberInput, etc.) wrote
|
|
709
|
+
// `$derived(new TableFocusDetails(cell, tableContext))`. The
|
|
710
|
+
// `$derived` re-runs on each reactive dep change, so a freshly
|
|
711
|
+
// constructed `TableFocusDetails` was the dominant per-cell cost.
|
|
712
|
+
//
|
|
713
|
+
// Phase 6.6 deferred this because the natural cache key
|
|
714
|
+
// `${rowKey}:${columnId}` cannot be computed synchronously inside
|
|
715
|
+
// a cell render (SelectionState.cachedKey can return a Promise).
|
|
716
|
+
//
|
|
717
|
+
// Approach: use the cell reference ITSELF as the WeakMap key. Cell
|
|
718
|
+
// objects are constructed by `createRow` / `rowsPromise`; within a
|
|
719
|
+
// single render pass the same cell instance is passed through to
|
|
720
|
+
// each cell component, so the cache hits across the $derived
|
|
721
|
+
// re-evaluations that fire while the cell is mounted. When Item G
|
|
722
|
+
// stabilises Row references across pagination changes, cell refs
|
|
723
|
+
// also become stable and the cache hits across page flips too.
|
|
724
|
+
//
|
|
725
|
+
// `WeakMap` ensures cell objects do not pin TableFocusDetails
|
|
726
|
+
// after the row is dropped; GC reclaims both together.
|
|
727
|
+
// -----------------------------------------------------------------
|
|
728
|
+
_focusDetailsCache = new WeakMap();
|
|
729
|
+
/**
|
|
730
|
+
* Returns a `TableFocusDetails` keyed on the supplied cell. The
|
|
731
|
+
* first call for a given cell constructs the instance; subsequent
|
|
732
|
+
* calls return the cached instance.
|
|
733
|
+
*
|
|
734
|
+
* Generic - the returned `TableFocusDetails<T, IdType>` is widened
|
|
735
|
+
* to `Primitive` for the cache, but the typed cast on return keeps
|
|
736
|
+
* the call-site signature clean for cell consumers.
|
|
737
|
+
*/
|
|
738
|
+
getFocusDetailsFor(cell) {
|
|
739
|
+
let details = this._focusDetailsCache.get(cell);
|
|
740
|
+
if (!details) {
|
|
741
|
+
// The TableContext ref is supplied via a thunk to keep this
|
|
742
|
+
// sub-context decoupled from the parent. The thunk is
|
|
743
|
+
// expected to return the *current* parent reference; in
|
|
744
|
+
// practice the parent never recycles its TableContext.
|
|
745
|
+
const parent = this._deps.getTableContextRef();
|
|
746
|
+
details = new TableFocusDetails(cell, parent);
|
|
747
|
+
this._focusDetailsCache.set(cell, details);
|
|
748
|
+
}
|
|
749
|
+
return details;
|
|
750
|
+
}
|
|
751
|
+
}
|