@lavalogic/scoria 0.11.14 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Components/Action.svelte +7 -32
- package/dist/Components/Action.svelte.d.ts +1 -27
- package/dist/Components/ActionProps.d.ts +27 -0
- package/dist/Components/ActionProps.js +1 -0
- package/dist/Components/AlertModal.svelte +7 -5
- package/dist/Components/Base/ContextWrapper.svelte +4 -9
- package/dist/Components/Base/ContextWrapper.svelte.d.ts +1 -5
- package/dist/Components/Base/ContextWrapperProps.d.ts +5 -0
- package/dist/Components/Base/ContextWrapperProps.js +1 -0
- package/dist/Components/Base/Pagination.svelte +22 -31
- package/dist/Components/Base/Pagination.svelte.d.ts +1 -12
- package/dist/Components/Base/PaginationProps.d.ts +12 -0
- package/dist/Components/Base/PaginationProps.js +1 -0
- package/dist/Components/BigRadioSet.svelte +4 -11
- package/dist/Components/BigRadioSet.svelte.d.ts +1 -6
- package/dist/Components/BigRadioSetProps.d.ts +6 -0
- package/dist/Components/BigRadioSetProps.js +1 -0
- package/dist/Components/Bubble.svelte +4 -21
- package/dist/Components/Bubble.svelte.d.ts +1 -18
- package/dist/Components/BubbleColour.d.ts +5 -0
- package/dist/Components/BubbleColour.js +1 -0
- package/dist/Components/BubbleProps.d.ts +14 -0
- package/dist/Components/BubbleProps.js +1 -0
- package/dist/Components/Button.svelte +21 -48
- package/dist/Components/Button.svelte.d.ts +1 -29
- package/dist/Components/ButtonProps.d.ts +29 -0
- package/dist/Components/ButtonProps.js +1 -0
- package/dist/Components/Checkbox.svelte +4 -21
- package/dist/Components/Checkbox.svelte.d.ts +2 -2
- package/dist/Components/CollapsibleCard.svelte +3 -15
- package/dist/Components/CollapsibleCard.svelte.d.ts +2 -10
- package/dist/Components/CollapsibleCardProps.d.ts +9 -0
- package/dist/Components/CollapsibleCardProps.js +1 -0
- package/dist/Components/Contexts/ContextMenu.svelte +14 -11
- package/dist/Components/Contexts/ContextMenuOption.svelte +2 -11
- package/dist/Components/Contexts/ContextMenuOption.svelte.d.ts +1 -7
- package/dist/Components/Contexts/ContextMenuOptionProps.d.ts +7 -0
- package/dist/Components/Contexts/ContextMenuOptionProps.js +1 -0
- package/dist/Components/Contexts/Toast.svelte +1 -6
- package/dist/Components/Contexts/Toast.svelte.d.ts +1 -5
- package/dist/Components/Contexts/ToastContainer.svelte +4 -1
- package/dist/Components/Contexts/ToastProps.d.ts +5 -0
- package/dist/Components/Contexts/ToastProps.js +1 -0
- package/dist/Components/Contexts/Tooltip.svelte +1 -4
- package/dist/Components/DataMatrixIcon.svelte +3 -11
- package/dist/Components/DataMatrixIcon.svelte.d.ts +1 -6
- package/dist/Components/DataMatrixIconProps.d.ts +6 -0
- package/dist/Components/DataMatrixIconProps.js +1 -0
- package/dist/Components/DateInput.svelte +3 -42
- package/dist/Components/DateInput.svelte.d.ts +1 -40
- package/dist/Components/DateInputProps.d.ts +3 -0
- package/dist/Components/DateInputProps.js +1 -0
- package/dist/Components/DateOnlyInputProps.d.ts +21 -0
- package/dist/Components/DateOnlyInputProps.js +1 -0
- package/dist/Components/DatePicker.svelte +26 -36
- package/dist/Components/DatePicker.svelte.d.ts +1 -8
- package/dist/Components/DatePickerProps.d.ts +8 -0
- package/dist/Components/DatePickerProps.js +1 -0
- package/dist/Components/DateTimeInputProps.d.ts +21 -0
- package/dist/Components/DateTimeInputProps.js +1 -0
- package/dist/Components/DesktopModal.svelte +3 -25
- package/dist/Components/DesktopModal.svelte.d.ts +1 -20
- package/dist/Components/DesktopModalProps.d.ts +20 -0
- package/dist/Components/DesktopModalProps.js +1 -0
- package/dist/Components/Dial.svelte +2 -18
- package/dist/Components/Dial.svelte.d.ts +1 -13
- package/dist/Components/DialProps.d.ts +13 -0
- package/dist/Components/DialProps.js +1 -0
- package/dist/Components/DimensionInput.svelte +21 -48
- package/dist/Components/DimensionInput.svelte.d.ts +1 -29
- package/dist/Components/DimensionInputProps.d.ts +29 -0
- package/dist/Components/DimensionInputProps.js +1 -0
- package/dist/Components/DragMenu/DragMenuHolder.svelte +10 -57
- package/dist/Components/DragMenu/DragMenuHolder.svelte.d.ts +1 -17
- package/dist/Components/DragMenu/DragMenuHolderProps.d.ts +10 -0
- package/dist/Components/DragMenu/DragMenuHolderProps.js +1 -0
- package/dist/Components/DragMenu/Draggable.d.ts +8 -0
- package/dist/Components/DragMenu/Draggable.js +1 -0
- package/dist/Components/DragMenu/DraggableCard.svelte +6 -14
- package/dist/Components/DragMenu/DraggableCard.svelte.d.ts +1 -9
- package/dist/Components/DragMenu/DraggableCardProps.d.ts +9 -0
- package/dist/Components/DragMenu/DraggableCardProps.js +1 -0
- package/dist/Components/FileCard.svelte +1 -7
- package/dist/Components/FileCard.svelte.d.ts +1 -4
- package/dist/Components/FileCardProps.d.ts +4 -0
- package/dist/Components/FileCardProps.js +1 -0
- package/dist/Components/FileUpload.svelte +9 -31
- package/dist/Components/FileUpload.svelte.d.ts +1 -24
- package/dist/Components/FileUploadProps.d.ts +24 -0
- package/dist/Components/FileUploadProps.js +1 -0
- package/dist/Components/GridInput.svelte +30 -28
- package/dist/Components/GridInput.svelte.d.ts +1 -6
- package/dist/Components/GridInputProps.d.ts +7 -0
- package/dist/Components/GridInputProps.js +1 -0
- package/dist/Components/GridInputSet.svelte +2 -11
- package/dist/Components/GridInputSet.svelte.d.ts +1 -6
- package/dist/Components/GridInputSetProps.d.ts +7 -0
- package/dist/Components/GridInputSetProps.js +1 -0
- package/dist/Components/HorizontalTabGroup.svelte +3 -16
- package/dist/Components/HorizontalTabGroup.svelte.d.ts +2 -11
- package/dist/Components/HorizontalTabGroupButton.svelte +11 -15
- package/dist/Components/HorizontalTabGroupButton.svelte.d.ts +2 -6
- package/dist/Components/HorizontalTabGroupProps.d.ts +10 -0
- package/dist/Components/HorizontalTabGroupProps.js +1 -0
- package/dist/Components/Icon.svelte +5 -1257
- package/dist/Components/Icon.svelte.d.ts +1 -884
- package/dist/Components/IconProps.d.ts +24 -0
- package/dist/Components/IconProps.js +1 -0
- package/dist/Components/Icons.d.ts +858 -0
- package/dist/Components/Icons.js +1222 -0
- package/dist/Components/InputProps.d.ts +15 -0
- package/dist/Components/InputProps.js +1 -0
- package/dist/Components/LoadingModal.svelte +2 -2
- package/dist/Components/Modal.svelte +24 -25
- package/dist/Components/Modal.svelte.d.ts +3 -6
- package/dist/Components/MultiSelect.svelte +35 -73
- package/dist/Components/MultiSelect.svelte.d.ts +14 -37
- package/dist/Components/MultiSelectCommonProps.d.ts +16 -0
- package/dist/Components/MultiSelectCommonProps.js +1 -0
- package/dist/Components/MultiSelectProps.d.ts +4 -0
- package/dist/Components/MultiSelectProps.js +1 -0
- package/dist/Components/MultiSelectPropsAsObject.d.ts +6 -0
- package/dist/Components/MultiSelectPropsAsObject.js +1 -0
- package/dist/Components/MultiSelectPropsAsPrimitive.d.ts +6 -0
- package/dist/Components/MultiSelectPropsAsPrimitive.js +1 -0
- package/dist/Components/NumberInput.svelte +8 -37
- package/dist/Components/NumberInput.svelte.d.ts +1 -29
- package/dist/Components/NumberInputProps.d.ts +29 -0
- package/dist/Components/NumberInputProps.js +1 -0
- package/dist/Components/PartialIconProps.d.ts +4 -0
- package/dist/Components/PartialIconProps.js +1 -0
- package/dist/Components/PasswordInput.svelte +4 -22
- package/dist/Components/PasswordInput.svelte.d.ts +1 -15
- package/dist/Components/Portal.svelte +3 -9
- package/dist/Components/Portal.svelte.d.ts +1 -5
- package/dist/Components/PortalProps.d.ts +5 -0
- package/dist/Components/PortalProps.js +1 -0
- package/dist/Components/ProgressBubble.svelte +20 -22
- package/dist/Components/ProgressBubble.svelte.d.ts +2 -6
- package/dist/Components/ProgressBubbleProps.d.ts +5 -0
- package/dist/Components/ProgressBubbleProps.js +1 -0
- package/dist/Components/QuerySelect.svelte +70 -49
- package/dist/Components/QuerySelect.svelte.d.ts +3 -3
- package/dist/Components/SingleSelect.svelte +28 -71
- package/dist/Components/SingleSelect.svelte.d.ts +2 -37
- package/dist/Components/SingleSelectCommonProps.d.ts +27 -0
- package/dist/Components/SingleSelectCommonProps.js +1 -0
- package/dist/Components/SingleSelectProps.d.ts +4 -0
- package/dist/Components/SingleSelectProps.js +1 -0
- package/dist/Components/SingleSelectPropsAsObject.d.ts +6 -0
- package/dist/Components/SingleSelectPropsAsObject.js +1 -0
- package/dist/Components/SingleSelectPropsAsPrimitive.d.ts +6 -0
- package/dist/Components/SingleSelectPropsAsPrimitive.js +1 -0
- package/dist/Components/Switch.svelte +2 -13
- package/dist/Components/Switch.svelte.d.ts +1 -9
- package/dist/Components/SwitchProps.d.ts +9 -0
- package/dist/Components/SwitchProps.js +1 -0
- package/dist/Components/TabGroupButtonProps.d.ts +5 -0
- package/dist/Components/TabGroupButtonProps.js +1 -0
- package/dist/Components/Table/Body/HeightData.d.ts +6 -0
- package/dist/Components/Table/Body/HeightData.js +1 -0
- package/dist/Components/Table/Body/QuickSearchCell.svelte +59 -82
- package/dist/Components/Table/Body/QuickSearchCell.svelte.d.ts +1 -6
- package/dist/Components/Table/Body/QuickSearchCellProps.d.ts +6 -0
- package/dist/Components/Table/Body/QuickSearchCellProps.js +1 -0
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte +4 -9
- package/dist/Components/Table/Body/Rows/ColumnHighlight.svelte.d.ts +1 -5
- package/dist/Components/Table/Body/Rows/ColumnHighlightProps.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/ColumnHighlightProps.js +1 -0
- package/dist/Components/Table/Body/Rows/ColumnList.svelte +5 -10
- package/dist/Components/Table/Body/Rows/ColumnList.svelte.d.ts +1 -3
- package/dist/Components/Table/Body/Rows/ColumnListProps.d.ts +3 -0
- package/dist/Components/Table/Body/Rows/ColumnListProps.js +1 -0
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte +15 -25
- package/dist/Components/Table/Body/Rows/ColumnListRow.svelte.d.ts +1 -4
- package/dist/Components/Table/Body/Rows/ColumnListRowProps.d.ts +4 -0
- package/dist/Components/Table/Body/Rows/ColumnListRowProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte +7 -11
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponent.svelte.d.ts +1 -4
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponentProps.d.ts +4 -0
- package/dist/Components/Table/Body/Rows/Columns/AccessorComponentProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte +39 -48
- package/dist/Components/Table/Body/Rows/Columns/ActionsCell.svelte.d.ts +1 -4
- package/dist/Components/Table/Body/Rows/Columns/ActionsCellProps.d.ts +4 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsCellProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsColumn.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsColumn.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsTableCell.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/ActionsTableCell.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte +26 -25
- package/dist/Components/Table/Body/Rows/Columns/BubbleCell.svelte.d.ts +1 -4
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte +11 -18
- package/dist/Components/Table/Body/Rows/Columns/ExpandCell.svelte.d.ts +13 -19
- package/dist/Components/Table/Body/Rows/Columns/ExpandCellProps.d.ts +7 -0
- package/dist/Components/Table/Body/Rows/Columns/ExpandCellProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte +10 -16
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCell.svelte.d.ts +1 -6
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCellProps.d.ts +6 -0
- package/dist/Components/Table/Body/Rows/Columns/FocusableImmutableCellProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/ProgressCell.svelte +22 -15
- package/dist/Components/Table/Body/Rows/Columns/SelectColumn.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/SelectColumn.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/SelectTableCell.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/SelectTableCell.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte +7 -20
- package/dist/Components/Table/Body/Rows/Columns/TableAction.svelte.d.ts +1 -9
- package/dist/Components/Table/Body/Rows/Columns/TableCheckbox.svelte +17 -20
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte +38 -22
- package/dist/Components/Table/Body/Rows/Columns/TableColumn.svelte.d.ts +2 -2
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte +41 -34
- package/dist/Components/Table/Body/Rows/Columns/TableDatePicker.svelte.d.ts +1 -4
- package/dist/Components/Table/Body/Rows/Columns/TableDatePickerProps.d.ts +4 -0
- package/dist/Components/Table/Body/Rows/Columns/TableDatePickerProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableNumberInput.svelte +67 -46
- package/dist/Components/Table/Body/Rows/Columns/TableQueryCell.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/TableQueryCell.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.d.ts +5 -0
- package/dist/Components/Table/Body/Rows/Columns/TableQueryColumn.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte +93 -105
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelect.svelte.d.ts +1 -12
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelectProps.d.ts +4 -0
- package/dist/Components/Table/Body/Rows/Columns/TableQuerySelectProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableRowSelectionCheckbox.svelte +4 -2
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte +78 -65
- package/dist/Components/Table/Body/Rows/Columns/TableSelect.svelte.d.ts +1 -12
- package/dist/Components/Table/Body/Rows/Columns/TableSelectProps.d.ts +4 -0
- package/dist/Components/Table/Body/Rows/Columns/TableSelectProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte +82 -59
- package/dist/Components/Table/Body/Rows/Columns/TableTextInput.svelte.d.ts +1 -4
- package/dist/Components/Table/Body/Rows/Columns/TableTextInputProps.d.ts +4 -0
- package/dist/Components/Table/Body/Rows/Columns/TableTextInputProps.js +1 -0
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte +10 -15
- package/dist/Components/Table/Body/Rows/Columns/ValidityCell.svelte.d.ts +1 -4
- package/dist/Components/Table/Body/Rows/Columns/ValidityCellProps.d.ts +4 -0
- package/dist/Components/Table/Body/Rows/Columns/ValidityCellProps.js +1 -0
- package/dist/Components/Table/Body/Rows/TableRow.svelte +38 -31
- package/dist/Components/Table/Body/Rows/TableRow.svelte.d.ts +1 -8
- package/dist/Components/Table/Body/Rows/TableRowProps.d.ts +8 -0
- package/dist/Components/Table/Body/Rows/TableRowProps.js +1 -0
- package/dist/Components/Table/Body/TableBody.svelte +10 -21
- package/dist/Components/Table/Body/TableBody.svelte.d.ts +1 -12
- package/dist/Components/Table/Body/TableBodyProps.d.ts +8 -0
- package/dist/Components/Table/Body/TableBodyProps.js +1 -0
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.d.ts +2 -4
- package/dist/Components/Table/ColumnDefinitions/ExampleItemColumnDefRepository.svelte.js +159 -161
- package/dist/Components/Table/Headers/HighlightAllHeader.svelte +8 -5
- package/dist/Components/Table/Headers/SelectAllHeader.svelte +1 -1
- package/dist/Components/Table/Headers/TableHead.svelte +29 -18
- package/dist/Components/Table/Misc/ColumnPanel.svelte +4 -4
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte +5 -10
- package/dist/Components/Table/Misc/ColumnPanelModal.svelte.d.ts +1 -3
- package/dist/Components/Table/Misc/ColumnPanelModalProps.d.ts +3 -0
- package/dist/Components/Table/Misc/ColumnPanelModalProps.js +1 -0
- package/dist/Components/Table/Misc/FilterInput.svelte +75 -145
- package/dist/Components/Table/Misc/FilterInput.svelte.d.ts +1 -16
- package/dist/Components/Table/Misc/FilterInputProps.d.ts +6 -0
- package/dist/Components/Table/Misc/FilterInputProps.js +1 -0
- package/dist/Components/Table/Misc/FilterPanelModal.svelte +2 -5
- package/dist/Components/Table/Misc/TableFooter.svelte +22 -21
- package/dist/Components/Table/Misc/TableHorizontalBar.svelte +7 -5
- package/dist/Components/Table/Misc/TableSidebar.svelte +2 -2
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte +2 -7
- package/dist/Components/Table/Misc/ToolboxPanelModal.svelte.d.ts +1 -3
- package/dist/Components/Table/Misc/ToolboxPanelModalProps.d.ts +3 -0
- package/dist/Components/Table/Misc/ToolboxPanelModalProps.js +1 -0
- package/dist/Components/Table/Misc/numberDateFilterTypes.d.ts +5 -0
- package/dist/Components/Table/Misc/numberDateFilterTypes.js +13 -0
- package/dist/Components/Table/Misc/stringFilterTypes.d.ts +5 -0
- package/dist/Components/Table/Misc/stringFilterTypes.js +15 -0
- package/dist/Components/Table/NestedTable.svelte +5 -3
- package/dist/Components/Table/NestedTable.svelte.d.ts +1 -1
- package/dist/Components/Table/Table.svelte +72 -40
- package/dist/Components/Table/Table.svelte.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Column.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/DateColumn.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.d.ts +1 -2
- package/dist/Components/Table/Types/Columns/Definitions/Accessors/CheckboxDef.svelte.js +2 -0
- package/dist/Components/Table/Types/Columns/Definitions/Actions/ActionsDef.svelte.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/ColumnDef.svelte.d.ts +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/Display/AbstractDisplayDef.svelte.js +3 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.d.ts +3 -3
- package/dist/Components/Table/Types/Columns/Definitions/Display/BubbleDef.svelte.js +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.d.ts +6 -7
- package/dist/Components/Table/Types/Columns/Definitions/Display/DisplayDef.svelte.js +4 -1
- package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/ProgressBarDef.svelte.js +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/Definitions/Display/ValidityDef.svelte.js +1 -1
- package/dist/Components/Table/Types/Columns/Definitions/Expand/ExpandDef.svelte.d.ts +3 -2
- package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.d.ts +1 -3
- package/dist/Components/Table/Types/Columns/Definitions/FilterOnly/FilterOnlyDef.svelte.js +4 -3
- package/dist/Components/Table/Types/Columns/DefsWrapper.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/ExpandColumn.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/ExpandTableCell.d.ts +2 -2
- package/dist/Components/Table/Types/Columns/ProgressBarColumn.d.ts +1 -1
- package/dist/Components/Table/Types/Columns/ProgressBarTableCell.d.ts +2 -1
- package/dist/Components/Table/Types/Columns/VisibilityState.d.ts +1 -1
- package/dist/Components/Table/Types/Context/ITable.d.ts +8 -8
- package/dist/Components/Table/Types/Context/ReadonlyRowModel.d.ts +1 -1
- package/dist/Components/Table/Types/Context/Row.d.ts +4 -4
- package/dist/Components/Table/Types/Context/RowModel.d.ts +1 -1
- package/dist/Components/Table/Types/Context/TableContext.svelte.d.ts +13 -17
- package/dist/Components/Table/Types/Context/TableContext.svelte.js +260 -304
- package/dist/Components/Table/Types/Context/TableSettings.d.ts +8 -0
- package/dist/Components/Table/Types/DataRepository/IDataRepository.d.ts +6 -6
- package/dist/Components/Table/Types/DataRepository/ILocalDataRepository.d.ts +1 -1
- package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.d.ts +2 -2
- package/dist/Components/Table/Types/DataRepository/LocalTableDataRepository.svelte.js +10 -8
- package/dist/Components/Table/Types/DataRepository/SortingState.d.ts +1 -1
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.d.ts +5 -5
- package/dist/Components/Table/Types/DataRepository/TableDataRepository.svelte.js +5 -3
- package/dist/Components/Table/Types/Filtering/ColumnFiltersState.d.ts +1 -1
- package/dist/Components/Table/Types/Filtering/FilterFn.d.ts +1 -1
- package/dist/Components/Table/Types/Focus/TableFocusDetails.svelte.js +3 -2
- package/dist/Components/TextArea.svelte +2 -30
- package/dist/Components/TextArea.svelte.d.ts +1 -26
- package/dist/Components/TextAreaProps.d.ts +26 -0
- package/dist/Components/TextAreaProps.js +1 -0
- package/dist/Components/TextInput.svelte +6 -40
- package/dist/Components/TextInput.svelte.d.ts +1 -31
- package/dist/Components/TextInputProps.d.ts +31 -0
- package/dist/Components/TextInputProps.js +1 -0
- package/dist/Components/ThreeStateRadio.svelte +4 -23
- package/dist/Components/ThreeStateRadio.svelte.d.ts +1 -19
- package/dist/Components/ThreeStateRadioProps.d.ts +19 -0
- package/dist/Components/ThreeStateRadioProps.js +1 -0
- package/dist/Components/Touch/BoolCard.svelte +3 -2
- package/dist/Components/Touch/DateModal.svelte +23 -11
- package/dist/Components/Touch/DefaultTimer.d.ts +5 -0
- package/dist/Components/Touch/DefaultTimer.js +1 -0
- package/dist/Components/Touch/EditCard.svelte +3 -17
- package/dist/Components/Touch/EditCard.svelte.d.ts +1 -12
- package/dist/Components/Touch/EditCardProps.d.ts +12 -0
- package/dist/Components/Touch/EditCardProps.js +1 -0
- package/dist/Components/Touch/InfoCard.svelte +3 -12
- package/dist/Components/Touch/InfoCard.svelte.d.ts +1 -8
- package/dist/Components/Touch/InfoCardProps.d.ts +8 -0
- package/dist/Components/Touch/InfoCardProps.js +1 -0
- package/dist/Components/Touch/InfoTextCard.svelte +3 -12
- package/dist/Components/Touch/InfoTextCard.svelte.d.ts +1 -7
- package/dist/Components/Touch/InfoTextCardProps.d.ts +7 -0
- package/dist/Components/Touch/InfoTextCardProps.js +1 -0
- package/dist/Components/Touch/KeyValuePair.d.ts +4 -0
- package/dist/Components/Touch/KeyValuePair.js +1 -0
- package/dist/Components/Touch/NumberKeyboard.svelte +54 -37
- package/dist/Components/Touch/NumberKeyboard.svelte.d.ts +1 -11
- package/dist/Components/Touch/NumberKeyboardProps.d.ts +11 -0
- package/dist/Components/Touch/NumberKeyboardProps.js +1 -0
- package/dist/Components/Touch/NumberModal.svelte +19 -26
- package/dist/Components/Touch/NumberModal.svelte.d.ts +1 -15
- package/dist/Components/Touch/NumberModalProps.d.ts +15 -0
- package/dist/Components/Touch/NumberModalProps.js +1 -0
- package/dist/Components/Touch/PlusMinusCard.svelte +6 -2
- package/dist/Components/Touch/SelectModal.svelte +26 -27
- package/dist/Components/Touch/SelectModal.svelte.d.ts +1 -8
- package/dist/Components/Touch/SelectModalProps.d.ts +8 -0
- package/dist/Components/Touch/SelectModalProps.js +1 -0
- package/dist/Components/Touch/SummaryCard.svelte +3 -20
- package/dist/Components/Touch/SummaryCard.svelte.d.ts +1 -15
- package/dist/Components/Touch/SummaryCardProps.d.ts +12 -0
- package/dist/Components/Touch/SummaryCardProps.js +1 -0
- package/dist/Components/Touch/TextAreaModal.svelte +20 -23
- package/dist/Components/Touch/TextAreaModal.svelte.d.ts +1 -12
- package/dist/Components/Touch/TextAreaModalProps.d.ts +12 -0
- package/dist/Components/Touch/TextAreaModalProps.js +1 -0
- package/dist/Components/Touch/TextModal.svelte +24 -33
- package/dist/Components/Touch/TextModal.svelte.d.ts +1 -19
- package/dist/Components/Touch/TextModalProps.d.ts +19 -0
- package/dist/Components/Touch/TextModalProps.js +1 -0
- package/dist/Components/Touch/TouchCard.svelte +2 -11
- package/dist/Components/Touch/TouchCard.svelte.d.ts +1 -6
- package/dist/Components/Touch/TouchCardProps.d.ts +6 -0
- package/dist/Components/Touch/TouchCardProps.js +1 -0
- package/dist/Components/Touch/TouchModal.svelte +14 -46
- package/dist/Components/Touch/TouchModal.svelte.d.ts +1 -31
- package/dist/Components/Touch/TouchModalProps.d.ts +27 -0
- package/dist/Components/Touch/TouchModalProps.js +1 -0
- package/dist/Components/Touch/UtilityButton.svelte +5 -23
- package/dist/Components/Touch/UtilityButton.svelte.d.ts +1 -20
- package/dist/Components/Touch/UtilityButtonProps.d.ts +20 -0
- package/dist/Components/Touch/UtilityButtonProps.js +1 -0
- package/dist/Components/VerticalTabGroup.svelte +2 -12
- package/dist/Components/VerticalTabGroup.svelte.d.ts +1 -10
- package/dist/Components/VerticalTabGroupButton.svelte +18 -20
- package/dist/Components/VerticalTabGroupButton.svelte.d.ts +23 -6
- package/dist/Components/VerticalTabGroupProps.d.ts +10 -0
- package/dist/Components/VerticalTabGroupProps.js +1 -0
- package/dist/Contexts/ContextMenuContext.svelte.d.ts +3 -3
- package/dist/Contexts/ToastContext.svelte.d.ts +1 -1
- package/dist/Contexts/ToastContext.svelte.js +4 -2
- package/dist/Contexts/UntypedInputContext.svelte.d.ts +2 -2
- package/dist/Contexts/UntypedInputContext.svelte.js +10 -12
- package/dist/Helpers/Datamatrix.d.ts +1 -2
- package/dist/Helpers/Helpers.svelte.d.ts +8 -3
- package/dist/Helpers/Helpers.svelte.js +44 -8
- package/dist/Types/Examples/ExampleItem.d.ts +1 -1
- package/dist/Types/Examples/ExampleModal.svelte +1 -1
- package/dist/Types/Internal/AttributeOperation.js +0 -2
- package/dist/Types/Internal/CallbackButton.d.ts +1 -1
- package/dist/Types/Internal/GridItem.d.ts +1 -1
- package/dist/Types/Internal/GridMultiSelectItem.d.ts +2 -2
- package/dist/Types/Internal/GridSelectItem.d.ts +1 -1
- package/dist/Types/Internal/TabOption.d.ts +1 -1
- package/dist/index.d.ts +158 -73
- package/dist/index.js +80 -51
- package/package.json +15 -14
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { browser, dev } from '$app/environment';
|
|
2
|
-
import { asyncAll, asyncFilterIndices, asyncSleep, getCanvasContext, getErrorMessage } from '../../../../Helpers/Helpers.svelte.js';
|
|
3
|
-
import { tick
|
|
2
|
+
import { asyncAll, asyncFilterIndices, asyncSleep, devCatch, getCanvasContext, getErrorMessage } from '../../../../Helpers/Helpers.svelte.js';
|
|
3
|
+
import { tick } from 'svelte';
|
|
4
4
|
import { SvelteMap, SvelteSet } from 'svelte/reactivity';
|
|
5
5
|
import { ColumnType } from '../Columns/ColumnType.js';
|
|
6
6
|
import { AccessorDef } from '../Columns/Definitions/Accessors/AccessorDef.svelte.js';
|
|
@@ -45,7 +45,7 @@ export class TableContext {
|
|
|
45
45
|
return context;
|
|
46
46
|
}
|
|
47
47
|
// #region constructor
|
|
48
|
-
constructor(INTERNAL_ONLY, defaultColumnDefs, tableName, dataRepo, allowCopy, enableResize, allowColumnReordering, allowQuickFiltering, showQuickFilterByDefault, allowAdvancedFiltering, toolbarPosition, displayFooter, selectionExtractor, getUserId, _onEditCell =
|
|
48
|
+
constructor(INTERNAL_ONLY, defaultColumnDefs, tableName, dataRepo, allowCopy, enableResize, allowColumnReordering, allowQuickFiltering, showQuickFilterByDefault, allowAdvancedFiltering, toolbarPosition, displayFooter, selectionExtractor, getUserId, _onEditCell = () => {
|
|
49
49
|
console.warn('Cannot edit immutable table');
|
|
50
50
|
}) {
|
|
51
51
|
this.defaultColumnDefs = defaultColumnDefs;
|
|
@@ -66,76 +66,6 @@ export class TableContext {
|
|
|
66
66
|
}
|
|
67
67
|
this._dataRepo = $state(dataRepo);
|
|
68
68
|
// this.dataRepo.forceRefresh = this.forceVisibilityUpdate;
|
|
69
|
-
$effect(() => {
|
|
70
|
-
const fd = (() => {
|
|
71
|
-
if (this.paginationRepo?.paginationType == PaginationType.Local) {
|
|
72
|
-
const data = this.showSelectedOnly
|
|
73
|
-
? // FIXME this will show the selected items by order of insertion to the selectedItems map.
|
|
74
|
-
[...this.selectedItems.values()]
|
|
75
|
-
: (this.filteredIndices.map((index) => {
|
|
76
|
-
return dataRepo.data[index];
|
|
77
|
-
}) ?? []);
|
|
78
|
-
return data;
|
|
79
|
-
}
|
|
80
|
-
return this.showSelectedOnly ? [...this.selectedItems.values()] : (dataRepo?.data ?? []);
|
|
81
|
-
})();
|
|
82
|
-
const sd = (() => {
|
|
83
|
-
if (this.paginationRepo?.paginationType == PaginationType.Local) {
|
|
84
|
-
const state = dataRepo.sorting ?? [];
|
|
85
|
-
const dataToSort = fd.concat();
|
|
86
|
-
dataToSort.sort((a, b) => {
|
|
87
|
-
const end = state.length;
|
|
88
|
-
for (let i = 0; i < end; i++) {
|
|
89
|
-
const { id, desc } = state[i];
|
|
90
|
-
const sortingFn = this.getSortingFn(id, desc);
|
|
91
|
-
if (sortingFn) {
|
|
92
|
-
const result = sortingFn(a, b);
|
|
93
|
-
if (result != 0) {
|
|
94
|
-
return result;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
else if (dev) {
|
|
98
|
-
console.warn('no sorting fn found for ' + id);
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
return 0;
|
|
102
|
-
});
|
|
103
|
-
return dataToSort;
|
|
104
|
-
}
|
|
105
|
-
return fd ?? [];
|
|
106
|
-
})();
|
|
107
|
-
const cpd = (() => {
|
|
108
|
-
if (dataRepo.paginationType != PaginationType.Local) {
|
|
109
|
-
return sd ?? [];
|
|
110
|
-
}
|
|
111
|
-
const x = sd.slice(dataRepo.pageStartIndex, dataRepo.pageEndIndexExclusive);
|
|
112
|
-
if (dev) {
|
|
113
|
-
console.log(x);
|
|
114
|
-
}
|
|
115
|
-
return x;
|
|
116
|
-
})();
|
|
117
|
-
const ori = new Map((dataRepo.data ?? []).map((item, index) => [item, index]));
|
|
118
|
-
this._filteredData = fd;
|
|
119
|
-
this._sortedData = sd;
|
|
120
|
-
this._currentPageData = cpd;
|
|
121
|
-
this._originalRowIndices = ori;
|
|
122
|
-
});
|
|
123
|
-
$effect(() => {
|
|
124
|
-
if (this._currentPageData) {
|
|
125
|
-
void this.selectedItems;
|
|
126
|
-
untrack(() => {
|
|
127
|
-
if (this.paginationRepo?.paginationState.pageIndex != undefined &&
|
|
128
|
-
this.paginationRepo?.paginationState.pageSize != undefined) {
|
|
129
|
-
this.updateSelectedItems();
|
|
130
|
-
this.resetHighlightedRows();
|
|
131
|
-
this.recalculateAllSelectedInCurrentPage();
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
}
|
|
135
|
-
});
|
|
136
|
-
$effect(() => {
|
|
137
|
-
$inspect(this.sortedData, this._currentPageData, this._originalRowIndices);
|
|
138
|
-
});
|
|
139
69
|
if (defaultColumnDefs.remoteFilters) {
|
|
140
70
|
this.remoteFilters = defaultColumnDefs.remoteFilters;
|
|
141
71
|
}
|
|
@@ -193,45 +123,44 @@ export class TableContext {
|
|
|
193
123
|
const preset = presets.find((it) => it.name === savedPresetName);
|
|
194
124
|
if (preset && areDefsEquivalent(this.columnDefs, preset.columnDefs)) {
|
|
195
125
|
this.columnDefs = preset.columnDefs;
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
if (preset.columnPinningState) {
|
|
200
|
-
this.columnPinning = preset.columnPinningState;
|
|
201
|
-
}
|
|
126
|
+
this.columnVisibility = preset.visibilityState;
|
|
127
|
+
this.columnPinning = preset.columnPinningState;
|
|
202
128
|
this.selectedPreset = preset;
|
|
203
129
|
}
|
|
204
130
|
else {
|
|
205
131
|
localStorage.removeItem(`${this.userId}-${tableName}-selected-preset-name`);
|
|
206
132
|
this.selectedPreset = presets[0];
|
|
207
|
-
if (presets
|
|
133
|
+
if (presets.at(0)?.visibilityState) {
|
|
208
134
|
this.columnVisibility = presets[0].visibilityState;
|
|
209
135
|
}
|
|
210
136
|
}
|
|
211
137
|
this.columnPresets = presets;
|
|
212
138
|
}
|
|
213
|
-
})
|
|
139
|
+
})
|
|
140
|
+
.catch(devCatch);
|
|
214
141
|
}
|
|
215
142
|
$effect(() => {
|
|
216
143
|
void this.paginationRepo?.paginationType;
|
|
217
|
-
void this.dataRepo
|
|
218
|
-
void this.dataRepo
|
|
219
|
-
void this.dataRepo
|
|
144
|
+
void this.dataRepo.filtering;
|
|
145
|
+
void this.dataRepo.filterModes.values();
|
|
146
|
+
void this.dataRepo.data;
|
|
220
147
|
(async () => {
|
|
221
148
|
const startTime = Date.now();
|
|
222
149
|
let currentTimerPromise;
|
|
223
150
|
const abortController = new AbortController();
|
|
224
151
|
try {
|
|
225
152
|
if (this.paginationRepo?.paginationType == PaginationType.Local) {
|
|
153
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
226
154
|
const checkedIds = new Set();
|
|
227
|
-
const filterState = this.dataRepo
|
|
155
|
+
const filterState = this.dataRepo.filtering.filter((filter) => {
|
|
228
156
|
const snapshot = $state.snapshot(filter.value);
|
|
229
157
|
checkedIds.add(filter.id);
|
|
230
|
-
const
|
|
231
|
-
return (
|
|
232
|
-
(
|
|
233
|
-
|
|
234
|
-
|
|
158
|
+
const filterMode = this.dataRepo.filterModes.get(filter.id);
|
|
159
|
+
return (!!filterMode &&
|
|
160
|
+
(allowedEmptyFilterModes.has(filterMode) ||
|
|
161
|
+
(snapshot !== '' && (!Array.isArray(snapshot) || snapshot[0] !== ''))));
|
|
162
|
+
});
|
|
163
|
+
const data = this.dataRepo.data;
|
|
235
164
|
// HACK add filter state for filters that don't require a value to function
|
|
236
165
|
// this.dataRepo?.filterModes?.entries().forEach(([key, value]) => {
|
|
237
166
|
// if (!checkedIds.has(key)) {
|
|
@@ -247,11 +176,11 @@ export class TableContext {
|
|
|
247
176
|
// }
|
|
248
177
|
// });
|
|
249
178
|
if (!filterState.length) {
|
|
250
|
-
this.filteredIndices = data.map((_, index) => index)
|
|
179
|
+
this.filteredIndices = data.map((_, index) => index);
|
|
251
180
|
}
|
|
252
181
|
currentTimerPromise = this.filterTimer = this.filterTimer + 1;
|
|
253
182
|
await asyncSleep(150);
|
|
254
|
-
const currentTimer =
|
|
183
|
+
const currentTimer = currentTimerPromise;
|
|
255
184
|
if (currentTimerPromise != this.filterTimer) {
|
|
256
185
|
throw new Error('stale filter');
|
|
257
186
|
}
|
|
@@ -291,8 +220,10 @@ export class TableContext {
|
|
|
291
220
|
if (currentTimerPromise !== this.filterTimer) {
|
|
292
221
|
abortController.abort('stale data');
|
|
293
222
|
}
|
|
223
|
+
// HACK this warning is wrong. We're in an async context and settled is being changed in the finally callback above
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
294
225
|
if (settled) {
|
|
295
|
-
console.log(`iteration ${
|
|
226
|
+
console.log(`iteration ${currentTimerPromise} finished ${Date.now() - startTime}ms`);
|
|
296
227
|
return;
|
|
297
228
|
}
|
|
298
229
|
await tick();
|
|
@@ -305,10 +236,10 @@ export class TableContext {
|
|
|
305
236
|
if (!message.toLocaleLowerCase().startsWith('stale')) {
|
|
306
237
|
console.error(e);
|
|
307
238
|
}
|
|
308
|
-
console.log(`iteration ${
|
|
239
|
+
console.log(`iteration ${currentTimerPromise} cancelled after ${Date.now() - startTime}ms`);
|
|
309
240
|
}
|
|
310
241
|
}
|
|
311
|
-
})();
|
|
242
|
+
})().catch(devCatch);
|
|
312
243
|
});
|
|
313
244
|
}
|
|
314
245
|
// #endregion
|
|
@@ -374,7 +305,12 @@ export class TableContext {
|
|
|
374
305
|
return this._columnDefs;
|
|
375
306
|
}
|
|
376
307
|
set columnDefs(v) {
|
|
308
|
+
// if (this._columnDefs.length > 0 && v != this._columnDefs) {
|
|
309
|
+
// debugger;
|
|
310
|
+
// }
|
|
377
311
|
this._columnDefs = v;
|
|
312
|
+
// this causes an error...?
|
|
313
|
+
// this.table = createTable(this.tableOptions);
|
|
378
314
|
}
|
|
379
315
|
_columnPresets = $state([]);
|
|
380
316
|
get columnPresets() {
|
|
@@ -510,16 +446,13 @@ export class TableContext {
|
|
|
510
446
|
this._openModalCoordinates = v;
|
|
511
447
|
}
|
|
512
448
|
_allSelectedInCurrentPage = $derived.by(() => {
|
|
513
|
-
if (
|
|
449
|
+
if (this.selectedItems.size === 0) {
|
|
514
450
|
return Promise.resolve(false);
|
|
515
451
|
}
|
|
516
452
|
const pageStartIndex = this.paginationRepo ? this.paginationRepo.pageStartIndex : 0;
|
|
517
453
|
const pageEndIndexExclusive = this.paginationRepo
|
|
518
454
|
? Math.min(this.paginationRepo.pageEndIndexExclusive, this.sortedData.length)
|
|
519
455
|
: this.sortedData.length;
|
|
520
|
-
if (pageStartIndex == undefined || pageEndIndexExclusive == undefined) {
|
|
521
|
-
return Promise.resolve(false);
|
|
522
|
-
}
|
|
523
456
|
const selectableMethod = this.columnDefs.find((it) => it instanceof RowSelectionDef)?.isSelectable;
|
|
524
457
|
return this.allSelectedBySelectableMethod(pageStartIndex, pageEndIndexExclusive, selectableMethod);
|
|
525
458
|
});
|
|
@@ -527,9 +460,6 @@ export class TableContext {
|
|
|
527
460
|
return this._allSelectedInCurrentPage;
|
|
528
461
|
}
|
|
529
462
|
async allSelectedBySelectableMethod(pageStartIndex, pageEndIndexExclusive, selectableMethod) {
|
|
530
|
-
if (!this.dataRepo) {
|
|
531
|
-
return Promise.resolve(false);
|
|
532
|
-
}
|
|
533
463
|
if (selectableMethod) {
|
|
534
464
|
for (let index = pageStartIndex; index < pageEndIndexExclusive; index++) {
|
|
535
465
|
const item = this.sortedData[index];
|
|
@@ -550,9 +480,6 @@ export class TableContext {
|
|
|
550
480
|
return Promise.resolve(true);
|
|
551
481
|
}
|
|
552
482
|
async _areAllHighlighted(pageStartIndex, pageEndIndexExclusive) {
|
|
553
|
-
if (!this.dataRepo) {
|
|
554
|
-
return Promise.resolve(false);
|
|
555
|
-
}
|
|
556
483
|
for (let index = pageStartIndex; index < pageEndIndexExclusive; index++) {
|
|
557
484
|
const item = this.sortedData[index];
|
|
558
485
|
if (!this.highlightedItems.has(this.selectionExtractor(item))) {
|
|
@@ -562,16 +489,13 @@ export class TableContext {
|
|
|
562
489
|
return Promise.resolve(true);
|
|
563
490
|
}
|
|
564
491
|
_allHighlighted = $derived.by(() => {
|
|
565
|
-
if (
|
|
492
|
+
if (this.highlightedItems.size === 0) {
|
|
566
493
|
return Promise.resolve(false);
|
|
567
494
|
}
|
|
568
495
|
const pageStartIndex = this.paginationRepo ? this.paginationRepo.pageStartIndex : 0;
|
|
569
496
|
const pageEndIndexExclusive = this.paginationRepo
|
|
570
497
|
? Math.min(this.paginationRepo.pageEndIndexExclusive, this.sortedData.length)
|
|
571
498
|
: this.sortedData.length;
|
|
572
|
-
if (pageStartIndex == undefined || pageEndIndexExclusive == undefined) {
|
|
573
|
-
return Promise.resolve(false);
|
|
574
|
-
}
|
|
575
499
|
return this._areAllHighlighted(pageStartIndex, pageEndIndexExclusive);
|
|
576
500
|
});
|
|
577
501
|
get allHighlighted() {
|
|
@@ -636,12 +560,14 @@ export class TableContext {
|
|
|
636
560
|
set hasInvalidSelectedItems(v) {
|
|
637
561
|
this._hasInvalidSelectedItems = v;
|
|
638
562
|
}
|
|
563
|
+
// FIXME decide
|
|
564
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
639
565
|
columnDefsById = $derived(new Map(this.columnDefs.map((it) => [it.id, it])));
|
|
640
566
|
getSortingFn = (id, desc) => {
|
|
641
|
-
if (this.dataRepo
|
|
567
|
+
if (this.dataRepo.data.length == 0) {
|
|
642
568
|
return undefined;
|
|
643
569
|
}
|
|
644
|
-
const def = this.columnDefsById
|
|
570
|
+
const def = this.columnDefsById.get(id);
|
|
645
571
|
if (!def) {
|
|
646
572
|
return undefined;
|
|
647
573
|
}
|
|
@@ -665,6 +591,10 @@ export class TableContext {
|
|
|
665
591
|
// }
|
|
666
592
|
return comparableSortingFn(id, desc);
|
|
667
593
|
};
|
|
594
|
+
originalRowIndices = $derived(
|
|
595
|
+
// TODO decide
|
|
596
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
597
|
+
new Map(this.dataRepo.data.map((item, index) => [item, index])));
|
|
668
598
|
// private _filterTimer: ReturnType<typeof setTimeout> | undefined;
|
|
669
599
|
_filterTimer = 1;
|
|
670
600
|
get filterTimer() {
|
|
@@ -680,21 +610,49 @@ export class TableContext {
|
|
|
680
610
|
set filteredIndices(v) {
|
|
681
611
|
this._filteredIndices = v;
|
|
682
612
|
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
613
|
+
filteredData = $derived.by(() => {
|
|
614
|
+
if (this.paginationRepo?.paginationType == PaginationType.Local) {
|
|
615
|
+
const data = this.showSelectedOnly
|
|
616
|
+
? // FIXME this will show the selected items by order of insertion to the selectedItems map.
|
|
617
|
+
[...this.selectedItems.values()]
|
|
618
|
+
: this.filteredIndices.map((index) => {
|
|
619
|
+
return this.dataRepo.data[index];
|
|
620
|
+
});
|
|
621
|
+
return data;
|
|
622
|
+
}
|
|
623
|
+
return this.showSelectedOnly ? [...this.selectedItems.values()] : this.dataRepo.data;
|
|
624
|
+
});
|
|
625
|
+
sortedData = $derived.by(() => {
|
|
626
|
+
if (this.paginationRepo?.paginationType == PaginationType.Local) {
|
|
627
|
+
const state = this.dataRepo.sorting;
|
|
628
|
+
const sortedData = this.showSelectedOnly
|
|
629
|
+
? // FIXME this will show the selected items by order of insertion to the selectedItems map.
|
|
630
|
+
[...this.selectedItems.values()]
|
|
631
|
+
: this.filteredData.concat();
|
|
632
|
+
sortedData.sort((a, b) => {
|
|
633
|
+
const end = state.length;
|
|
634
|
+
for (let i = 0; i < end; i++) {
|
|
635
|
+
const { id, desc } = state[i];
|
|
636
|
+
const sortingFn = this.getSortingFn(id, desc);
|
|
637
|
+
if (sortingFn) {
|
|
638
|
+
const result = sortingFn(a, b);
|
|
639
|
+
if (result != 0) {
|
|
640
|
+
return result;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
else {
|
|
644
|
+
console.warn('no sorting fn found for ' + id);
|
|
645
|
+
}
|
|
646
|
+
}
|
|
647
|
+
return 0;
|
|
648
|
+
});
|
|
649
|
+
return sortedData;
|
|
650
|
+
}
|
|
651
|
+
return this.filteredData;
|
|
652
|
+
});
|
|
691
653
|
sortedRowModel = $derived.by(() => {
|
|
692
654
|
const rows = this.sortedData.map((item, index) => {
|
|
693
|
-
const
|
|
694
|
-
const unsortedIndex = originalIndex ?? index;
|
|
695
|
-
if (originalIndex == null) {
|
|
696
|
-
throw new Error(`Sorted Data not found in Original Row Indices: original index ${originalIndex}, index ${index}`);
|
|
697
|
-
}
|
|
655
|
+
const unsortedIndex = this.originalRowIndices.get(item) ?? index;
|
|
698
656
|
return this.createRow(item, index, unsortedIndex);
|
|
699
657
|
});
|
|
700
658
|
return {
|
|
@@ -703,26 +661,16 @@ export class TableContext {
|
|
|
703
661
|
rowsById: new Map(rows.map((it, index) => [index.toString(), it])) //FIXME should this be by sorted id or by original id?
|
|
704
662
|
};
|
|
705
663
|
});
|
|
706
|
-
_currentPageData = $
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
}
|
|
710
|
-
// FIXME this is most likely the cuplrit for add pod not working on receipt. It may be one tick behind the other values
|
|
711
|
-
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
712
|
-
_originalRowIndices = $state(new Map());
|
|
713
|
-
get originalRowIndices() {
|
|
714
|
-
return this._originalRowIndices;
|
|
715
|
-
}
|
|
664
|
+
_currentPageData = $derived(this.dataRepo.paginationType == PaginationType.Local
|
|
665
|
+
? this.sortedData.slice(this.dataRepo.pageStartIndex, this.dataRepo.pageEndIndexExclusive)
|
|
666
|
+
: this.sortedData);
|
|
716
667
|
paginationRowModel = $derived.by(() => {
|
|
717
|
-
const
|
|
718
|
-
const rows =
|
|
719
|
-
const unsortedIndex = this.
|
|
720
|
-
if (!item) {
|
|
721
|
-
throw new Error(`No Item was found at index ${index}`);
|
|
722
|
-
}
|
|
668
|
+
const sortedData = this._currentPageData;
|
|
669
|
+
const rows = sortedData.map((item, index) => {
|
|
670
|
+
const unsortedIndex = this.originalRowIndices.get(item) ?? index;
|
|
723
671
|
const row = {
|
|
724
672
|
getValue: async (key) => {
|
|
725
|
-
const gotValue = this.columnDefsById.get(key)
|
|
673
|
+
const gotValue = await this.columnDefsById.get(key)?.accessorFn?.(item, index);
|
|
726
674
|
if (gotValue !== undefined) {
|
|
727
675
|
return gotValue;
|
|
728
676
|
}
|
|
@@ -771,10 +719,13 @@ export class TableContext {
|
|
|
771
719
|
};
|
|
772
720
|
const makeCellFromId = (columnId) => {
|
|
773
721
|
const def = this.columnDefsById.get(columnId);
|
|
722
|
+
if (!def) {
|
|
723
|
+
throw new Error(`Could not find column with id ${columnId}`);
|
|
724
|
+
}
|
|
774
725
|
return makeRow(def);
|
|
775
726
|
};
|
|
776
|
-
const leftVisibleCells = $derived([...(this.columnPinning.left?.keys() ?? [])].map(makeCellFromId)
|
|
777
|
-
const rightVisibleCells = $derived([...(this.columnPinning.right?.keys() ?? [])].map(makeCellFromId)
|
|
727
|
+
const leftVisibleCells = $derived([...(this.columnPinning.left?.keys() ?? [])].map(makeCellFromId));
|
|
728
|
+
const rightVisibleCells = $derived([...(this.columnPinning.right?.keys() ?? [])].map(makeCellFromId));
|
|
778
729
|
const centerVisibleCells = $derived(this.columnDefs
|
|
779
730
|
.filter((it) => {
|
|
780
731
|
return !(this.columnPinning.left?.has(it.id) || this.columnPinning.right?.has(it.id));
|
|
@@ -788,17 +739,33 @@ export class TableContext {
|
|
|
788
739
|
rowsById: new Map(rows.map((it, index) => [index.toString(), it])) //FIXME should this be by sorted id or by original id?
|
|
789
740
|
};
|
|
790
741
|
});
|
|
742
|
+
get currentPageData() {
|
|
743
|
+
return this._currentPageData;
|
|
744
|
+
}
|
|
791
745
|
// #endregion
|
|
792
746
|
// #region public methods
|
|
793
747
|
selectionContains = (item) => {
|
|
794
|
-
if (!this.selectionExtractor) {
|
|
795
|
-
throw new Error('No selection extractor was supplied');
|
|
796
|
-
}
|
|
797
748
|
if (!this.isSelectable) {
|
|
798
749
|
return true;
|
|
799
750
|
}
|
|
800
751
|
return this.selectedItems.has(this.selectionExtractor(item));
|
|
801
752
|
};
|
|
753
|
+
// public readonly HACK__reselectItem = (item: T) => {
|
|
754
|
+
// if (!this.selectionExtractor) {
|
|
755
|
+
// throw new Error('No selection extractor was supplied');
|
|
756
|
+
// }
|
|
757
|
+
// if (!this.isSelectable) {
|
|
758
|
+
// return true;
|
|
759
|
+
// }
|
|
760
|
+
// const key = this.selectionExtractor(item);
|
|
761
|
+
// if (this.selectedItems.has(key)) {
|
|
762
|
+
// this.selectedItems.delete(key);
|
|
763
|
+
// this.selectedItems.set(key, item);
|
|
764
|
+
// } else {
|
|
765
|
+
// this.selectedItems.set(key, item);
|
|
766
|
+
// this.selectedItems.delete(key);
|
|
767
|
+
// }
|
|
768
|
+
// };
|
|
802
769
|
addInvalidValue = (item) => {
|
|
803
770
|
this.invalidValues.set(this.selectionExtractor(item), item);
|
|
804
771
|
};
|
|
@@ -817,6 +784,13 @@ export class TableContext {
|
|
|
817
784
|
this.highlightedItems.set(key, item);
|
|
818
785
|
}
|
|
819
786
|
};
|
|
787
|
+
// public readonly toggleHighlightedRow = (rowIndex: number) => {
|
|
788
|
+
// if (this.highlightedRowIndexIds.has(rowIndex)) {
|
|
789
|
+
// this.highlightedRowIndexIds.delete(rowIndex);
|
|
790
|
+
// } else {
|
|
791
|
+
// this.highlightedRowIndexIds.add(rowIndex);
|
|
792
|
+
// }
|
|
793
|
+
// };
|
|
820
794
|
resetHighlightedRows = () => {
|
|
821
795
|
this.highlightedItems.clear();
|
|
822
796
|
};
|
|
@@ -828,50 +802,40 @@ export class TableContext {
|
|
|
828
802
|
else {
|
|
829
803
|
this.selectedItems.delete(key);
|
|
830
804
|
}
|
|
805
|
+
this.recalculateAllSelectedInCurrentPage();
|
|
831
806
|
};
|
|
832
807
|
setSelectionMap = (set) => {
|
|
833
808
|
this.selectedItems = set;
|
|
834
809
|
};
|
|
835
810
|
updateSelectedItems = async () => {
|
|
836
|
-
if (!this.dataRepo) {
|
|
837
|
-
return;
|
|
838
|
-
}
|
|
839
811
|
const pageStartIndex = this.paginationRepo ? this.paginationRepo.pageStartIndex : 0;
|
|
840
812
|
const pageEndIndexExclusive = this.paginationRepo
|
|
841
813
|
? Math.min(this.paginationRepo.pageEndIndexExclusive, this.sortedData.length)
|
|
842
814
|
: this.sortedData.length;
|
|
843
815
|
const selectableMethod = this.columnDefs.find((it) => it instanceof RowSelectionDef)?.isSelectable;
|
|
844
|
-
const updateSelectedItem = (item) => {
|
|
845
|
-
const key = this.selectionExtractor(item);
|
|
846
|
-
if (this.selectedItems.has(key)) {
|
|
847
|
-
//replace selected item with newer version of the same identity
|
|
848
|
-
this.selectedItems.set(key, item);
|
|
849
|
-
}
|
|
850
|
-
};
|
|
851
816
|
if (selectableMethod) {
|
|
852
817
|
for (let index = pageStartIndex; index < pageEndIndexExclusive; index++) {
|
|
853
818
|
const item = this.sortedData[index];
|
|
854
|
-
// HACK: Please find why this is happening and fix it properly
|
|
855
|
-
if (!item) {
|
|
856
|
-
console.warn(`skipping update because there is a data mismatch (with selectable method)`);
|
|
857
|
-
return;
|
|
858
|
-
}
|
|
859
819
|
if (await selectableMethod(item, index)) {
|
|
860
|
-
|
|
820
|
+
const key = this.selectionExtractor(item);
|
|
821
|
+
if (this.selectedItems.has(key)) {
|
|
822
|
+
//replace selected item with newer version of the same identity
|
|
823
|
+
this.selectedItems.set(key, item);
|
|
824
|
+
}
|
|
861
825
|
}
|
|
862
826
|
}
|
|
863
827
|
}
|
|
864
828
|
else {
|
|
865
829
|
for (let index = pageStartIndex; index < pageEndIndexExclusive; index++) {
|
|
866
830
|
const item = this.sortedData[index];
|
|
867
|
-
|
|
868
|
-
if (
|
|
869
|
-
|
|
870
|
-
|
|
831
|
+
const key = this.selectionExtractor(item);
|
|
832
|
+
if (this.selectedItems.has(key)) {
|
|
833
|
+
//replace selected item with newer version of the same identity
|
|
834
|
+
this.selectedItems.set(key, item);
|
|
871
835
|
}
|
|
872
|
-
updateSelectedItem(item);
|
|
873
836
|
}
|
|
874
837
|
}
|
|
838
|
+
this.recalculateAllSelectedInCurrentPage();
|
|
875
839
|
};
|
|
876
840
|
resetSelectedItems = () => {
|
|
877
841
|
for (const key of this.selectedItems.keys()) {
|
|
@@ -879,32 +843,16 @@ export class TableContext {
|
|
|
879
843
|
}
|
|
880
844
|
this.recalculateAllSelectedInCurrentPage();
|
|
881
845
|
};
|
|
882
|
-
lastIncrement = Number.MIN_SAFE_INTEGER;
|
|
883
846
|
recalculateAllSelectedInCurrentPage = () => {
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
if (this.lastIncrement == currentIncrement) {
|
|
890
|
-
this.hasInvalidSelectedItems = allSelectedInCurrentPage.some((key) => {
|
|
891
|
-
return invalidValues.has(key);
|
|
892
|
-
});
|
|
893
|
-
}
|
|
894
|
-
else {
|
|
895
|
-
if (dev) {
|
|
896
|
-
console.log('skipping recalculation due to stale data');
|
|
897
|
-
}
|
|
898
|
-
}
|
|
847
|
+
tick()
|
|
848
|
+
.then(() => {
|
|
849
|
+
return this.allSelectedInCurrentPage.then(() => {
|
|
850
|
+
this.hasInvalidSelectedItems = [...this.selectedItems.keys()].some((key) => this._invalidValues.has(key));
|
|
851
|
+
});
|
|
899
852
|
})
|
|
900
|
-
.catch(
|
|
901
|
-
console.log(e);
|
|
902
|
-
});
|
|
853
|
+
.catch(devCatch);
|
|
903
854
|
};
|
|
904
855
|
selectAllInCurrentPage = async () => {
|
|
905
|
-
if (!this.dataRepo) {
|
|
906
|
-
return;
|
|
907
|
-
}
|
|
908
856
|
if (await this.allSelectedInCurrentPage) {
|
|
909
857
|
// this.resetSelectedItems();
|
|
910
858
|
const pageStartIndex = this.paginationRepo ? this.paginationRepo.pageStartIndex : 0;
|
|
@@ -939,12 +887,11 @@ export class TableContext {
|
|
|
939
887
|
}
|
|
940
888
|
}
|
|
941
889
|
}
|
|
890
|
+
this.recalculateAllSelectedInCurrentPage();
|
|
942
891
|
};
|
|
943
892
|
onHighlightAll = () => {
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
}
|
|
947
|
-
this.allHighlighted.then((areAllHighlighted) => {
|
|
893
|
+
this.allHighlighted
|
|
894
|
+
.then((areAllHighlighted) => {
|
|
948
895
|
if (areAllHighlighted) {
|
|
949
896
|
this.highlightedItems.clear();
|
|
950
897
|
}
|
|
@@ -953,17 +900,19 @@ export class TableContext {
|
|
|
953
900
|
this.highlightedItems.set(this.selectionExtractor(item), item);
|
|
954
901
|
});
|
|
955
902
|
}
|
|
956
|
-
})
|
|
903
|
+
})
|
|
904
|
+
.catch(devCatch);
|
|
957
905
|
};
|
|
958
906
|
onEditCell = async (item, coords, value) => {
|
|
959
|
-
const oldKey = this.selectionExtractor
|
|
907
|
+
const oldKey = this.selectionExtractor(item);
|
|
960
908
|
const wasSelected = oldKey != null && this.selectedItems.has(oldKey);
|
|
909
|
+
// debugger;
|
|
961
910
|
if (wasSelected) {
|
|
962
911
|
this.selectedItems.delete(oldKey);
|
|
963
912
|
}
|
|
964
|
-
await this._onEditCell(item, coords, value);
|
|
913
|
+
await this._onEditCell?.(item, coords, value);
|
|
965
914
|
if (wasSelected && this.isSelectable) {
|
|
966
|
-
const newKey = this.selectionExtractor
|
|
915
|
+
const newKey = this.selectionExtractor(item);
|
|
967
916
|
if (newKey) {
|
|
968
917
|
this.selectedItems.set(newKey, item);
|
|
969
918
|
}
|
|
@@ -1002,7 +951,7 @@ export class TableContext {
|
|
|
1002
951
|
switch (e.key) {
|
|
1003
952
|
case 'Enter':
|
|
1004
953
|
case 'F2':
|
|
1005
|
-
if (!e.target?.classList
|
|
954
|
+
if (!e.target?.classList.contains('editable')) {
|
|
1006
955
|
break;
|
|
1007
956
|
}
|
|
1008
957
|
e.preventDefault();
|
|
@@ -1074,10 +1023,10 @@ export class TableContext {
|
|
|
1074
1023
|
}
|
|
1075
1024
|
//these two at the bottom shouldn't happen on a home press
|
|
1076
1025
|
}
|
|
1077
|
-
else if (e.getModifierState('Shift') && this.allowCopy
|
|
1026
|
+
else if (e.getModifierState('Shift') && this.allowCopy) {
|
|
1078
1027
|
this.moveFocusLeft();
|
|
1079
1028
|
}
|
|
1080
|
-
else
|
|
1029
|
+
else {
|
|
1081
1030
|
this.setFocusLeft();
|
|
1082
1031
|
}
|
|
1083
1032
|
return;
|
|
@@ -1096,10 +1045,10 @@ export class TableContext {
|
|
|
1096
1045
|
this.moveToEnd();
|
|
1097
1046
|
}
|
|
1098
1047
|
}
|
|
1099
|
-
else if (e.getModifierState('Shift') && this.allowCopy
|
|
1048
|
+
else if (e.getModifierState('Shift') && this.allowCopy) {
|
|
1100
1049
|
this.moveFocusRight();
|
|
1101
1050
|
}
|
|
1102
|
-
else
|
|
1051
|
+
else {
|
|
1103
1052
|
this.setFocusRight();
|
|
1104
1053
|
}
|
|
1105
1054
|
}
|
|
@@ -1120,9 +1069,7 @@ export class TableContext {
|
|
|
1120
1069
|
case 'C':
|
|
1121
1070
|
if (e.getModifierState('Control')) {
|
|
1122
1071
|
e.preventDefault();
|
|
1123
|
-
|
|
1124
|
-
this.copyDataToClipboard();
|
|
1125
|
-
}
|
|
1072
|
+
this.copyDataToClipboard().catch(devCatch);
|
|
1126
1073
|
}
|
|
1127
1074
|
break;
|
|
1128
1075
|
}
|
|
@@ -1136,11 +1083,13 @@ export class TableContext {
|
|
|
1136
1083
|
? `#${this.tableName}-cell-${fs.row}-${fs.id}`
|
|
1137
1084
|
: `#${this.tableName}-cell-quicksearch-${fs.id}`);
|
|
1138
1085
|
this.showQuickFiltering = !this.showQuickFiltering;
|
|
1139
|
-
tick()
|
|
1086
|
+
tick()
|
|
1087
|
+
.then(() => {
|
|
1140
1088
|
if (idToFocusTo) {
|
|
1141
1089
|
document.querySelector(idToFocusTo)?.focus();
|
|
1142
1090
|
}
|
|
1143
|
-
})
|
|
1091
|
+
})
|
|
1092
|
+
.catch(devCatch);
|
|
1144
1093
|
}
|
|
1145
1094
|
};
|
|
1146
1095
|
setColumnPinning = (updater) => {
|
|
@@ -1172,10 +1121,10 @@ export class TableContext {
|
|
|
1172
1121
|
// public get rowModel() {
|
|
1173
1122
|
// return this._rowModel;
|
|
1174
1123
|
// }
|
|
1175
|
-
lastPage = $derived(this.dataRepo
|
|
1124
|
+
lastPage = $derived(this.dataRepo.lastPage ?? 0);
|
|
1176
1125
|
measureHeaderWidth = (columnDef) => {
|
|
1177
1126
|
const label = columnDef.header;
|
|
1178
|
-
if (typeof label === 'string' &&
|
|
1127
|
+
if (typeof label === 'string' && browser) {
|
|
1179
1128
|
const extraWidth = columnDef.allowSorting ? SORTING_ICON_WIDTH : 0;
|
|
1180
1129
|
const canvasContext = getCanvasContext();
|
|
1181
1130
|
if (canvasContext) {
|
|
@@ -1195,7 +1144,7 @@ export class TableContext {
|
|
|
1195
1144
|
return 0;
|
|
1196
1145
|
};
|
|
1197
1146
|
autoResize = async (columnDef) => {
|
|
1198
|
-
if (!
|
|
1147
|
+
if (!browser) {
|
|
1199
1148
|
return;
|
|
1200
1149
|
}
|
|
1201
1150
|
const ctx = getCanvasContext();
|
|
@@ -1208,16 +1157,13 @@ export class TableContext {
|
|
|
1208
1157
|
if (columnDef.accessorFn) {
|
|
1209
1158
|
for (let i = currentPageContents.length - 1; i > -1; i--) {
|
|
1210
1159
|
const row = currentPageContents[i];
|
|
1211
|
-
const label = (
|
|
1212
|
-
const currentWidth = ctx
|
|
1160
|
+
const label = (await columnDef.accessorFn(row, i))?.toString() ?? '';
|
|
1161
|
+
const currentWidth = ctx?.measureText(label).width ?? 0;
|
|
1213
1162
|
maxWidth = Math.max(maxWidth, currentWidth);
|
|
1214
1163
|
}
|
|
1215
1164
|
}
|
|
1216
1165
|
else {
|
|
1217
|
-
const currentWidth = columnDef.width
|
|
1218
|
-
ctx.measureText(
|
|
1219
|
-
// TODO
|
|
1220
|
-
(typeof columnDef.header == 'string' ? columnDef.header : 'TODO') ?? '-').width;
|
|
1166
|
+
const currentWidth = columnDef.width;
|
|
1221
1167
|
maxWidth = Math.max(maxWidth, currentWidth);
|
|
1222
1168
|
}
|
|
1223
1169
|
this.columnSizing[colId] = maxWidth + 32; //standard extra cell padding
|
|
@@ -1229,16 +1175,17 @@ export class TableContext {
|
|
|
1229
1175
|
if (!this.dragTarget || !dropTarget) {
|
|
1230
1176
|
return;
|
|
1231
1177
|
}
|
|
1178
|
+
const dragTarget = this.dragTarget;
|
|
1232
1179
|
const newDefs = this.columnDefs.concat();
|
|
1233
1180
|
newDefs
|
|
1234
1181
|
.sort((a, b) => a.index - b.index)
|
|
1235
1182
|
.forEach((element, index) => {
|
|
1236
1183
|
element.index = index;
|
|
1237
1184
|
});
|
|
1238
|
-
const originalIndex = newDefs.findIndex((it) => it.id ===
|
|
1185
|
+
const originalIndex = newDefs.findIndex((it) => it.id === dragTarget.id);
|
|
1239
1186
|
if (originalIndex === -1) {
|
|
1240
|
-
console.warn("couldn't find target's original index");
|
|
1241
|
-
return
|
|
1187
|
+
console.warn("couldn't find target's original index", dragTarget);
|
|
1188
|
+
return;
|
|
1242
1189
|
}
|
|
1243
1190
|
newDefs.splice(originalIndex, 1);
|
|
1244
1191
|
const isDraggedToFirst = dropTarget.id === `${this.tableName}-column-settings-top-anchor` ||
|
|
@@ -1283,6 +1230,8 @@ export class TableContext {
|
|
|
1283
1230
|
// this.forceVisibilityUpdate();
|
|
1284
1231
|
};
|
|
1285
1232
|
copyHighlightedRowsToClipboard = async () => {
|
|
1233
|
+
// HACK clipboard does not exist in http environments
|
|
1234
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1286
1235
|
if (!navigator.clipboard) {
|
|
1287
1236
|
alert('cannot copy in an insecure connection');
|
|
1288
1237
|
return;
|
|
@@ -1290,6 +1239,8 @@ export class TableContext {
|
|
|
1290
1239
|
return this._performRowCopy(await this.getHighlightedRowData());
|
|
1291
1240
|
};
|
|
1292
1241
|
copyDataToClipboard = async () => {
|
|
1242
|
+
// HACK clipboard does not exist in http environments
|
|
1243
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
1293
1244
|
if (!navigator.clipboard) {
|
|
1294
1245
|
alert('cannot copy in an insecure connection');
|
|
1295
1246
|
return;
|
|
@@ -1299,13 +1250,16 @@ export class TableContext {
|
|
|
1299
1250
|
_performRowCopy = async ({ items, indicesByItem, focusedElementData, affectedColumns }) => {
|
|
1300
1251
|
const focusedColumnIds = affectedColumns.map((it) => encapsulate(typeof it.header === 'string' ? it.header : it.id));
|
|
1301
1252
|
const value = await (async () => {
|
|
1253
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
1302
1254
|
const selectColumns = new Map();
|
|
1303
1255
|
for (let i = affectedColumns.length - 1; i > -1; i--) {
|
|
1304
1256
|
const columnDef = affectedColumns[i];
|
|
1305
1257
|
if (columnDef instanceof SelectDef) {
|
|
1306
1258
|
const item = items[i];
|
|
1307
|
-
|
|
1308
|
-
|
|
1259
|
+
const defOptions = indicesByItem.get(item);
|
|
1260
|
+
selectColumns.set(i, await (defOptions
|
|
1261
|
+
? (columnDef.getSpecificOptions?.(item, defOptions) ?? columnDef.getOptions())
|
|
1262
|
+
: columnDef.getOptions()));
|
|
1309
1263
|
}
|
|
1310
1264
|
}
|
|
1311
1265
|
const separator = this.commaSeparatedCopy ? ',' : '\t';
|
|
@@ -1315,7 +1269,7 @@ export class TableContext {
|
|
|
1315
1269
|
if (focusedElementData.length === 1 && focusedElementData[0].length === 1) {
|
|
1316
1270
|
if (selectColumns.has(0)) {
|
|
1317
1271
|
const columnOptions = selectColumns.get(0);
|
|
1318
|
-
const value = columnOptions
|
|
1272
|
+
const value = columnOptions?.find((it) => it.value === focusedElementData[0][0])?.label ??
|
|
1319
1273
|
focusedElementData[0][0]?.toString() ??
|
|
1320
1274
|
'';
|
|
1321
1275
|
return value;
|
|
@@ -1333,7 +1287,10 @@ export class TableContext {
|
|
|
1333
1287
|
}
|
|
1334
1288
|
if (selectColumns.has(i)) {
|
|
1335
1289
|
const columnOptions = selectColumns.get(i);
|
|
1336
|
-
|
|
1290
|
+
if (dev && !columnOptions) {
|
|
1291
|
+
console.warn(`could not find colum with index ${i}`);
|
|
1292
|
+
}
|
|
1293
|
+
const value = columnOptions?.find((it) => it.value === toCopy)?.label ??
|
|
1337
1294
|
toCopy?.toString() ??
|
|
1338
1295
|
'';
|
|
1339
1296
|
return encapsulate(value);
|
|
@@ -1346,7 +1303,7 @@ export class TableContext {
|
|
|
1346
1303
|
.join(separator))
|
|
1347
1304
|
.join('\n')}`;
|
|
1348
1305
|
})();
|
|
1349
|
-
navigator.clipboard.writeText(value
|
|
1306
|
+
navigator.clipboard.writeText(value).catch(devCatch);
|
|
1350
1307
|
};
|
|
1351
1308
|
startFocus = (coords) => {
|
|
1352
1309
|
this.isMousingDown = true;
|
|
@@ -1356,9 +1313,11 @@ export class TableContext {
|
|
|
1356
1313
|
this.focusStart = { ...coords };
|
|
1357
1314
|
this.focusEnd = { ...coords };
|
|
1358
1315
|
if (startEditing) {
|
|
1359
|
-
tick()
|
|
1316
|
+
tick()
|
|
1317
|
+
.then(() => {
|
|
1360
1318
|
this.focusStartIsBeingEdited = true;
|
|
1361
|
-
})
|
|
1319
|
+
})
|
|
1320
|
+
.catch(devCatch);
|
|
1362
1321
|
}
|
|
1363
1322
|
};
|
|
1364
1323
|
unfocus = () => {
|
|
@@ -1449,7 +1408,7 @@ export class TableContext {
|
|
|
1449
1408
|
return;
|
|
1450
1409
|
}
|
|
1451
1410
|
if (!this.focusEnd) {
|
|
1452
|
-
return
|
|
1411
|
+
return;
|
|
1453
1412
|
}
|
|
1454
1413
|
const visibility = this.columnVisibility;
|
|
1455
1414
|
const columnDefs = this.columnDefs;
|
|
@@ -1485,8 +1444,9 @@ export class TableContext {
|
|
|
1485
1444
|
if (!this.allowCopy) {
|
|
1486
1445
|
return;
|
|
1487
1446
|
}
|
|
1488
|
-
if (!this.focusEnd)
|
|
1489
|
-
return
|
|
1447
|
+
if (!this.focusEnd) {
|
|
1448
|
+
return;
|
|
1449
|
+
}
|
|
1490
1450
|
const current = this.focusEnd;
|
|
1491
1451
|
const visibility = this.columnVisibility;
|
|
1492
1452
|
const columnDefs = this.columnDefs;
|
|
@@ -1503,8 +1463,9 @@ export class TableContext {
|
|
|
1503
1463
|
this.focusEnd = current;
|
|
1504
1464
|
};
|
|
1505
1465
|
moveToEnd = () => {
|
|
1506
|
-
if (!this.focusStart)
|
|
1466
|
+
if (!this.focusStart) {
|
|
1507
1467
|
return;
|
|
1468
|
+
}
|
|
1508
1469
|
const visibility = this.columnVisibility;
|
|
1509
1470
|
const columnDefs = this.columnDefs;
|
|
1510
1471
|
const current = this.focusStart.column;
|
|
@@ -1546,22 +1507,21 @@ export class TableContext {
|
|
|
1546
1507
|
}
|
|
1547
1508
|
};
|
|
1548
1509
|
setFocusLeft = () => {
|
|
1549
|
-
if (!this.focusStart)
|
|
1510
|
+
if (!this.focusStart) {
|
|
1550
1511
|
return;
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1556
|
-
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
}
|
|
1561
|
-
--index;
|
|
1512
|
+
}
|
|
1513
|
+
const visibility = this.columnVisibility;
|
|
1514
|
+
const columnDefs = this.columnDefs;
|
|
1515
|
+
let index = this.focusStart.column - 1;
|
|
1516
|
+
while (index > -1) {
|
|
1517
|
+
const newId = columnDefs[index].id;
|
|
1518
|
+
if (newId && visibility[newId] !== false) {
|
|
1519
|
+
this.moveFocus({ ...this.focusStart, id: newId, column: index });
|
|
1520
|
+
return;
|
|
1562
1521
|
}
|
|
1563
|
-
|
|
1522
|
+
--index;
|
|
1564
1523
|
}
|
|
1524
|
+
//otherwise return without doing anything
|
|
1565
1525
|
};
|
|
1566
1526
|
moveFocusRight = () => {
|
|
1567
1527
|
if (!this.allowCopy) {
|
|
@@ -1583,23 +1543,22 @@ export class TableContext {
|
|
|
1583
1543
|
}
|
|
1584
1544
|
};
|
|
1585
1545
|
setFocusRight = () => {
|
|
1586
|
-
if (!this.focusStart)
|
|
1546
|
+
if (!this.focusStart) {
|
|
1587
1547
|
return;
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
}
|
|
1599
|
-
++index;
|
|
1548
|
+
}
|
|
1549
|
+
const visibility = this.columnVisibility;
|
|
1550
|
+
const columnDefs = this.columnDefs;
|
|
1551
|
+
const upperBounds = columnDefs.length;
|
|
1552
|
+
let index = this.focusStart.column + 1;
|
|
1553
|
+
while (index < upperBounds) {
|
|
1554
|
+
const newId = columnDefs[index].id;
|
|
1555
|
+
if (newId && visibility[newId] !== false) {
|
|
1556
|
+
this.moveFocus({ ...this.focusStart, id: newId, column: index });
|
|
1557
|
+
return;
|
|
1600
1558
|
}
|
|
1601
|
-
|
|
1559
|
+
++index;
|
|
1602
1560
|
}
|
|
1561
|
+
//otherwise return without doing anything
|
|
1603
1562
|
};
|
|
1604
1563
|
endFocus = (coords) => {
|
|
1605
1564
|
if (this.isMousingDown) {
|
|
@@ -1653,18 +1612,12 @@ export class TableContext {
|
|
|
1653
1612
|
// };
|
|
1654
1613
|
setSelectedPreset = (preset) => {
|
|
1655
1614
|
this.columnDefs = preset.columnDefs;
|
|
1656
|
-
if (
|
|
1657
|
-
|
|
1658
|
-
console.warn('no sorting state found');
|
|
1659
|
-
}
|
|
1660
|
-
this.paginationRepo?.updateSorting?.(preset.sortingState);
|
|
1661
|
-
}
|
|
1662
|
-
if (preset.visibilityState) {
|
|
1663
|
-
this.columnVisibility = preset.visibilityState;
|
|
1664
|
-
}
|
|
1665
|
-
if (preset.columnPinningState) {
|
|
1666
|
-
this.columnPinning = preset.columnPinningState;
|
|
1615
|
+
if (!this.paginationRepo?.updateSorting) {
|
|
1616
|
+
console.warn('no sorting state found');
|
|
1667
1617
|
}
|
|
1618
|
+
this.paginationRepo?.updateSorting?.(preset.sortingState);
|
|
1619
|
+
this.columnVisibility = preset.visibilityState;
|
|
1620
|
+
this.columnPinning = preset.columnPinningState;
|
|
1668
1621
|
this.selectedPreset = preset;
|
|
1669
1622
|
localStorage.setItem(`${this.userId}-${this.tableName}-selected-preset-name`, preset.name);
|
|
1670
1623
|
};
|
|
@@ -1675,7 +1628,7 @@ export class TableContext {
|
|
|
1675
1628
|
const visibilityState = this.columnVisibility;
|
|
1676
1629
|
const columnPinningState = this.columnPinning;
|
|
1677
1630
|
const columnDefs = this.columnDefs;
|
|
1678
|
-
const sortingState =
|
|
1631
|
+
const sortingState = this.paginationRepo?.sorting || [];
|
|
1679
1632
|
const newPreset = { columnDefs, name, visibilityState, columnPinningState, sortingState };
|
|
1680
1633
|
const lowercasePresetname = name.toLocaleLowerCase();
|
|
1681
1634
|
const indexToReplace = this.columnPresets.findIndex((oldPreset) => oldPreset.name.toLocaleLowerCase() === lowercasePresetname);
|
|
@@ -1711,12 +1664,9 @@ export class TableContext {
|
|
|
1711
1664
|
};
|
|
1712
1665
|
// #region private methods
|
|
1713
1666
|
createRow(item, index, unsortedIndex) {
|
|
1714
|
-
if (!item) {
|
|
1715
|
-
throw new Error(`No Item was found at index ${index} (unsorted index ${unsortedIndex})`);
|
|
1716
|
-
}
|
|
1717
1667
|
const row = {
|
|
1718
1668
|
getValue: async (key) => {
|
|
1719
|
-
const gotValue = this.columnDefsById.get(key)
|
|
1669
|
+
const gotValue = await this.columnDefsById.get(key)?.accessorFn?.(item, unsortedIndex);
|
|
1720
1670
|
if (gotValue !== undefined) {
|
|
1721
1671
|
return gotValue;
|
|
1722
1672
|
}
|
|
@@ -1765,10 +1715,13 @@ export class TableContext {
|
|
|
1765
1715
|
};
|
|
1766
1716
|
const makeCellFromId = (columnId) => {
|
|
1767
1717
|
const def = this.columnDefsById.get(columnId);
|
|
1718
|
+
if (!def) {
|
|
1719
|
+
throw new Error(`Could not make cell from id ${columnId}: Coloumn Def was not found`);
|
|
1720
|
+
}
|
|
1768
1721
|
return makeRow(def);
|
|
1769
1722
|
};
|
|
1770
|
-
const leftVisibleCells = $derived([...(this.columnPinning.left?.keys() ?? [])].map(makeCellFromId)
|
|
1771
|
-
const rightVisibleCells = $derived([...(this.columnPinning.right?.keys() ?? [])].map(makeCellFromId)
|
|
1723
|
+
const leftVisibleCells = $derived([...(this.columnPinning.left?.keys() ?? [])].map(makeCellFromId));
|
|
1724
|
+
const rightVisibleCells = $derived([...(this.columnPinning.right?.keys() ?? [])].map(makeCellFromId));
|
|
1772
1725
|
const centerVisibleCells = $derived(this.columnDefs
|
|
1773
1726
|
.filter((it) => {
|
|
1774
1727
|
return !(this.columnPinning.left?.has(it.id) || this.columnPinning.right?.has(it.id));
|
|
@@ -1777,9 +1730,6 @@ export class TableContext {
|
|
|
1777
1730
|
return row;
|
|
1778
1731
|
}
|
|
1779
1732
|
columnDefReturnsTextValue = (it) => {
|
|
1780
|
-
if (!this.dataRepo) {
|
|
1781
|
-
return false;
|
|
1782
|
-
}
|
|
1783
1733
|
return ('index' in it &&
|
|
1784
1734
|
this.columnVisibility[it.id] !== false &&
|
|
1785
1735
|
!uncopyableColumns.has(it.columnType));
|
|
@@ -1809,8 +1759,9 @@ export class TableContext {
|
|
|
1809
1759
|
console.warn('no focusEnd found');
|
|
1810
1760
|
return;
|
|
1811
1761
|
}
|
|
1762
|
+
const focusEnd = this.focusEnd;
|
|
1812
1763
|
const rows = this.paginationRowModel.rows;
|
|
1813
|
-
const endRowIndex = rows.findIndex((row) => row.visibleIndex ===
|
|
1764
|
+
const endRowIndex = rows.findIndex((row) => row.visibleIndex === focusEnd.row);
|
|
1814
1765
|
this.focusEnd = {
|
|
1815
1766
|
...this.focusEnd,
|
|
1816
1767
|
row: rows[Math.max(Math.min(endRowIndex + offset, rows.length - 1), 0)].visibleIndex
|
|
@@ -1819,11 +1770,12 @@ export class TableContext {
|
|
|
1819
1770
|
_moveFocusRow(offset) {
|
|
1820
1771
|
if (!this.focusStart) {
|
|
1821
1772
|
console.warn('no focusStart found');
|
|
1822
|
-
return
|
|
1773
|
+
return;
|
|
1823
1774
|
}
|
|
1775
|
+
const focusStart = this.focusStart;
|
|
1824
1776
|
const newEndRowIndex = (() => {
|
|
1825
1777
|
const rows = this.paginationRowModel.rows;
|
|
1826
|
-
const endRowIndex = rows.findIndex((row) => row.visibleIndex ===
|
|
1778
|
+
const endRowIndex = rows.findIndex((row) => row.visibleIndex === focusStart.row);
|
|
1827
1779
|
return rows[Math.max(Math.min(endRowIndex + offset, rows.length - 1), 0)].visibleIndex;
|
|
1828
1780
|
})();
|
|
1829
1781
|
this.moveFocus({ ...this.focusStart, row: newEndRowIndex });
|
|
@@ -1837,9 +1789,9 @@ export class TableContext {
|
|
|
1837
1789
|
const { row: startRowIndexId, column: startColumnIndex } = this.focusStart;
|
|
1838
1790
|
const { row: endRowIndexId, column: endColumnIndex } = this.focusEnd;
|
|
1839
1791
|
const model = this.sortedRowModel;
|
|
1840
|
-
const startRowIndex = model
|
|
1841
|
-
const endRowIndex = model
|
|
1842
|
-
if (
|
|
1792
|
+
const startRowIndex = model.rows.findIndex((row) => row.visibleIndex === startRowIndexId);
|
|
1793
|
+
const endRowIndex = model.rows.findIndex((row) => row.visibleIndex === endRowIndexId);
|
|
1794
|
+
if (startRowIndex == -1 || endRowIndex == -1) {
|
|
1843
1795
|
return;
|
|
1844
1796
|
}
|
|
1845
1797
|
const minRowIndex = Math.min(startRowIndex, endRowIndex);
|
|
@@ -1866,17 +1818,15 @@ export class TableContext {
|
|
|
1866
1818
|
this.focusedColumnIds = affectedColumns;
|
|
1867
1819
|
}
|
|
1868
1820
|
async getHighlightedRowData() {
|
|
1869
|
-
if (!this.dataRepo) {
|
|
1870
|
-
throw new Error('No data found');
|
|
1871
|
-
}
|
|
1872
1821
|
const affectedColumns = this.columnDefs.filter(this.columnDefReturnsTextValue);
|
|
1822
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
1873
1823
|
const indices = new Map();
|
|
1874
1824
|
const selectedRows = [...this.highlightedItems.values()];
|
|
1875
1825
|
for (const item of selectedRows) {
|
|
1876
1826
|
const rowIndex = this.sortedData.indexOf(item);
|
|
1877
1827
|
if (rowIndex == -1) {
|
|
1878
|
-
|
|
1879
|
-
|
|
1828
|
+
// eslint-disable-next-line no-debugger
|
|
1829
|
+
debugger;
|
|
1880
1830
|
}
|
|
1881
1831
|
indices.set(item, rowIndex);
|
|
1882
1832
|
}
|
|
@@ -1885,7 +1835,7 @@ export class TableContext {
|
|
|
1885
1835
|
const rowLength = selectedRows.length;
|
|
1886
1836
|
for (let rowIndex = 0; rowIndex < rowLength; rowIndex++) {
|
|
1887
1837
|
const item = selectedRows[rowIndex];
|
|
1888
|
-
const key = this.selectionExtractor
|
|
1838
|
+
const key = this.selectionExtractor(item);
|
|
1889
1839
|
selectedCells[rowIndex] = [];
|
|
1890
1840
|
const targetRow = selectedCells[rowIndex];
|
|
1891
1841
|
const colLength = affectedColumns.length;
|
|
@@ -1929,9 +1879,9 @@ export class TableContext {
|
|
|
1929
1879
|
const { row: endRowIndexId, column: endColumnIndex } = this.focusEnd;
|
|
1930
1880
|
// const model = this._currentPageData;
|
|
1931
1881
|
const model = this.paginationRowModel;
|
|
1932
|
-
const startRowIndex = model
|
|
1933
|
-
const endRowIndex = model
|
|
1934
|
-
if (!this._currentPageData
|
|
1882
|
+
const startRowIndex = model.rows.findIndex((row) => row.visibleIndex === startRowIndexId);
|
|
1883
|
+
const endRowIndex = model.rows.findIndex((row) => row.visibleIndex === endRowIndexId);
|
|
1884
|
+
if (!this._currentPageData.length || startRowIndex == -1 || endRowIndex == -1) {
|
|
1935
1885
|
throw new Error(`copy was missing one of the two indices. First: ${startRowIndex}, second: ${endRowIndex}`);
|
|
1936
1886
|
}
|
|
1937
1887
|
const minRowIndex = Math.min(startRowIndex, endRowIndex);
|
|
@@ -1958,7 +1908,7 @@ export class TableContext {
|
|
|
1958
1908
|
const rowLength = selectedRows.length;
|
|
1959
1909
|
for (let rowIndex = 0; rowIndex < rowLength; rowIndex++) {
|
|
1960
1910
|
const item = selectedRows[rowIndex];
|
|
1961
|
-
const key = this.selectionExtractor
|
|
1911
|
+
const key = this.selectionExtractor(item);
|
|
1962
1912
|
selectedCells[rowIndex] = [];
|
|
1963
1913
|
const targetRow = selectedCells[rowIndex];
|
|
1964
1914
|
const colLength = affectedColumns.length;
|
|
@@ -1996,6 +1946,7 @@ export class TableContext {
|
|
|
1996
1946
|
affectedColumns
|
|
1997
1947
|
};
|
|
1998
1948
|
}
|
|
1949
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
1999
1950
|
return { items: [], indicesByItem: new Map(), focusedElementData: [], affectedColumns: [] };
|
|
2000
1951
|
}
|
|
2001
1952
|
updateDefsBasedOnPinning = () => {
|
|
@@ -2023,6 +1974,7 @@ export class TableContext {
|
|
|
2023
1974
|
return allDefs;
|
|
2024
1975
|
};
|
|
2025
1976
|
assertNoDuplicateIds() {
|
|
1977
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
2026
1978
|
const foundIds = new Set();
|
|
2027
1979
|
this.defaultColumnDefs.defs.forEach((def) => {
|
|
2028
1980
|
if (foundIds.has(def.id)) {
|
|
@@ -2031,12 +1983,14 @@ export class TableContext {
|
|
|
2031
1983
|
foundIds.add(def.id);
|
|
2032
1984
|
});
|
|
2033
1985
|
}
|
|
1986
|
+
// FIXME
|
|
1987
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
2034
1988
|
async setupDefaultColumnDefs() {
|
|
2035
1989
|
// const helper = createColumnHelper<T>();
|
|
2036
1990
|
this.assertNoDuplicateIds();
|
|
2037
|
-
const adjustedDefsPromises = this.defaultColumnDefs.defs.map(
|
|
1991
|
+
const adjustedDefsPromises = this.defaultColumnDefs.defs.map((def) => {
|
|
2038
1992
|
if (def instanceof AccessorDef) {
|
|
2039
|
-
if (def.allowFiltering
|
|
1993
|
+
if (!def.allowFiltering) {
|
|
2040
1994
|
if (def.debug) {
|
|
2041
1995
|
console.log(`${def.id}: does not allow filtering`, def);
|
|
2042
1996
|
}
|
|
@@ -2093,7 +2047,7 @@ export class TableContext {
|
|
|
2093
2047
|
else if (
|
|
2094
2048
|
// this.paginationRepo?.paginationType == PaginationType.Local &&
|
|
2095
2049
|
!def.filterFn &&
|
|
2096
|
-
def.allowFiltering
|
|
2050
|
+
def.allowFiltering) {
|
|
2097
2051
|
if (def instanceof DisplayDef) {
|
|
2098
2052
|
if (def.debug) {
|
|
2099
2053
|
console.log(`${def.id}: is a display def`, def);
|
|
@@ -2158,7 +2112,7 @@ export class TableContext {
|
|
|
2158
2112
|
}
|
|
2159
2113
|
return def;
|
|
2160
2114
|
});
|
|
2161
|
-
const adjustedDefs =
|
|
2115
|
+
const adjustedDefs = adjustedDefsPromises
|
|
2162
2116
|
.sort((a, b) => a.index - b.index)
|
|
2163
2117
|
.map((def, index) => {
|
|
2164
2118
|
def.index = index;
|
|
@@ -2199,7 +2153,7 @@ export class TableContext {
|
|
|
2199
2153
|
left: new Map(this.columnPinning.left &&
|
|
2200
2154
|
this.columnDefs
|
|
2201
2155
|
.filter((col) => {
|
|
2202
|
-
this.columnPinning.left?.has(col.id);
|
|
2156
|
+
return this.columnPinning.left?.has(col.id);
|
|
2203
2157
|
})
|
|
2204
2158
|
.map((col, index) => [col.id, index])),
|
|
2205
2159
|
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
@@ -2209,7 +2163,7 @@ export class TableContext {
|
|
|
2209
2163
|
.map((col, index) => [col.id, index]))
|
|
2210
2164
|
}; // TODO
|
|
2211
2165
|
}
|
|
2212
|
-
getToggleSortingHandler = (def) => (
|
|
2166
|
+
getToggleSortingHandler = (def) => () => {
|
|
2213
2167
|
this.paginationRepo?.updateSorting?.((state) => {
|
|
2214
2168
|
const newState = state.concat();
|
|
2215
2169
|
const index = newState.findIndex((it) => it.id === def.id);
|
|
@@ -2231,6 +2185,8 @@ export class TableContext {
|
|
|
2231
2185
|
return newState;
|
|
2232
2186
|
});
|
|
2233
2187
|
};
|
|
2188
|
+
// FIXME
|
|
2189
|
+
// eslint-disable-next-line @typescript-eslint/require-await
|
|
2234
2190
|
async reassignDefsToPresets(presets) {
|
|
2235
2191
|
const adjustedDefs = this.columnDefs;
|
|
2236
2192
|
const asMap = columnDefsToMap(adjustedDefs);
|
|
@@ -2279,6 +2235,7 @@ function areDefsEquivalent(newColumnDefs, oldColumnDefs) {
|
|
|
2279
2235
|
});
|
|
2280
2236
|
}
|
|
2281
2237
|
function columnDefsToMap(defs) {
|
|
2238
|
+
// eslint-disable-next-line svelte/prefer-svelte-reactivity
|
|
2282
2239
|
const map = new Map();
|
|
2283
2240
|
defs.forEach((def) => {
|
|
2284
2241
|
map.set(def.id, def);
|
|
@@ -2299,8 +2256,8 @@ function encapsulate(value) {
|
|
|
2299
2256
|
}
|
|
2300
2257
|
function generateTableOptions(contextObj) {
|
|
2301
2258
|
const _pagination = $derived.by(() => {
|
|
2302
|
-
void contextObj.paginationRepo?.paginationState
|
|
2303
|
-
void contextObj.paginationRepo?.paginationState
|
|
2259
|
+
void contextObj.paginationRepo?.paginationState.pageSize;
|
|
2260
|
+
void contextObj.paginationRepo?.paginationState.pageIndex;
|
|
2304
2261
|
return contextObj.paginationRepo?.paginationState;
|
|
2305
2262
|
});
|
|
2306
2263
|
const makeHeader = (def) => {
|
|
@@ -2318,7 +2275,6 @@ function generateTableOptions(contextObj) {
|
|
|
2318
2275
|
});
|
|
2319
2276
|
let originalWidth = 0;
|
|
2320
2277
|
let mouseStartingPoint = 0;
|
|
2321
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
2322
2278
|
function addOverrideResizeHandler(e) {
|
|
2323
2279
|
originalWidth = def.width;
|
|
2324
2280
|
mouseStartingPoint = e.clientX;
|
|
@@ -2329,7 +2285,7 @@ function generateTableOptions(contextObj) {
|
|
|
2329
2285
|
function onResize(e) {
|
|
2330
2286
|
def.width = originalWidth - (mouseStartingPoint - e.clientX);
|
|
2331
2287
|
}
|
|
2332
|
-
function removeOverrideResizeHandler(
|
|
2288
|
+
function removeOverrideResizeHandler() {
|
|
2333
2289
|
def.isResizing = false;
|
|
2334
2290
|
window.removeEventListener('mousemove', onResize);
|
|
2335
2291
|
}
|