@lowdefy/blocks-table 0.0.0-experimental-20260929110023
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/LICENSE +201 -0
- package/README.md +12 -0
- package/dist/blocks/Table/Table.js +25 -0
- package/dist/blocks/Table/Table.lazy.js +33 -0
- package/dist/blocks/Table/TableFallback.js +35 -0
- package/dist/blocks/Table/e2e.js +47 -0
- package/dist/blocks/Table/gallery.yaml +836 -0
- package/dist/blocks/Table/meta.js +964 -0
- package/dist/blocks/Table/tests/Table.e2e.yaml +434 -0
- package/dist/blocks/Table/tests/TableFeatures.e2e.yaml +291 -0
- package/dist/blocks/Table/tests/TableLinkTarget.e2e.yaml +25 -0
- package/dist/blocks/Table/tests/TableParity.e2e.yaml +101 -0
- package/dist/blocks/Table/tests/bulk.e2e.yaml +271 -0
- package/dist/blocks/Table/tests/deals.yaml +30 -0
- package/dist/blocks/Table/tests/deals_columns.yaml +37 -0
- package/dist/blocks/Table/tests/editing.e2e.yaml +501 -0
- package/dist/blocks/Table/tests/expandable.e2e.yaml +87 -0
- package/dist/blocks/Table/tests/filtering.e2e.yaml +251 -0
- package/dist/blocks/Table/tests/grouping.e2e.yaml +272 -0
- package/dist/blocks/Table/tests/grouping_deals.yaml +24 -0
- package/dist/blocks/Table/tests/grouping_deals_columns.yaml +32 -0
- package/dist/blocks/Table/tests/headerMenu.e2e.yaml +134 -0
- package/dist/blocks/Table/tests/parity_properties.yaml +144 -0
- package/dist/blocks/Table/tests/people.yaml +39 -0
- package/dist/blocks/Table/tests/people_columns.yaml +22 -0
- package/dist/blocks/Table/tests/polish.e2e.yaml +372 -0
- package/dist/blocks/Table/tests/server-mongodb.e2e.yaml +169 -0
- package/dist/blocks/Table/tests/server.e2e.yaml +267 -0
- package/dist/blocks/Table/tests/toolbar.e2e.yaml +140 -0
- package/dist/blocks/Table/tests/tree.e2e.yaml +245 -0
- package/dist/blocks/Table/tests/views.e2e.yaml +235 -0
- package/dist/blocks/TableInput/TableInput.js +24 -0
- package/dist/blocks/TableInput/TableInput.lazy.js +17 -0
- package/dist/blocks/TableInput/TableInputRoot.js +65 -0
- package/dist/blocks/TableInput/e2e.js +16 -0
- package/dist/blocks/TableInput/gallery.yaml +153 -0
- package/dist/blocks/TableInput/meta.js +93 -0
- package/dist/blocks/TableInput/tests/TableInput.e2e.yaml +272 -0
- package/dist/blocks.js +16 -0
- package/dist/core/Body.js +112 -0
- package/dist/core/Cell.js +86 -0
- package/dist/core/Chevron.js +32 -0
- package/dist/core/EmptyState.js +32 -0
- package/dist/core/Grid.js +219 -0
- package/dist/core/GroupHeaderRow.js +81 -0
- package/dist/core/HeaderCell.js +58 -0
- package/dist/core/HeaderRow.js +76 -0
- package/dist/core/HeaderTitle.js +49 -0
- package/dist/core/LazyCell.js +71 -0
- package/dist/core/LoadingRows.js +38 -0
- package/dist/core/RenderProbeContext.js +19 -0
- package/dist/core/Row.js +98 -0
- package/dist/core/SkeletonRow.js +42 -0
- package/dist/core/SummaryRow.js +86 -0
- package/dist/core/TableRoot.js +195 -0
- package/dist/core/aggregateShortLabels.js +25 -0
- package/dist/core/applyLayoutVars.js +22 -0
- package/dist/core/buildGroupSegments.js +36 -0
- package/dist/core/collectBodyOverlays.js +20 -0
- package/dist/core/collectCellLeads.js +21 -0
- package/dist/core/collectClaimedViewKeys.js +26 -0
- package/dist/core/collectGridHandlers.js +29 -0
- package/dist/core/collectHeaderParts.js +20 -0
- package/dist/core/collectRowRenderers.js +21 -0
- package/dist/core/collectSliceDefinitions.js +29 -0
- package/dist/core/computeLayout.js +133 -0
- package/dist/core/createAccessor.js +39 -0
- package/dist/core/createApi.js +86 -0
- package/dist/core/createCellActivity.js +47 -0
- package/dist/core/createColumnDefs.js +42 -0
- package/dist/core/createFeatureActions.js +24 -0
- package/dist/core/createFeatureSet.js +39 -0
- package/dist/core/createInitialState.js +63 -0
- package/dist/core/createKeyIndex.js +26 -0
- package/dist/core/createMethodStubs.js +30 -0
- package/dist/core/createSliceHandlers.js +26 -0
- package/dist/core/createStableCoreRowModel.js +91 -0
- package/dist/core/createTanstackFeatures.js +24 -0
- package/dist/core/createTextMeasure.js +106 -0
- package/dist/core/densityHeights.js +20 -0
- package/dist/core/deriveValue.js +53 -0
- package/dist/core/dispatchGridEvent.js +21 -0
- package/dist/core/distributeFlex.js +28 -0
- package/dist/core/getCellFit.js +34 -0
- package/dist/core/getHeaderCellProps.js +21 -0
- package/dist/core/getHeaderLevels.js +50 -0
- package/dist/core/getRecordCount.js +23 -0
- package/dist/core/getSummaryLabel.js +35 -0
- package/dist/core/getValueSignature.js +26 -0
- package/dist/core/isDataItem.js +21 -0
- package/dist/core/isDefaultViewColumns.js +36 -0
- package/dist/core/isRowEqual.js +40 -0
- package/dist/core/isSameSignature.js +19 -0
- package/dist/core/lazyCellTypes.js +33 -0
- package/dist/core/lazyComponent.js +30 -0
- package/dist/core/loadOptionalFeature.js +35 -0
- package/dist/core/normalizeViewColumn.js +29 -0
- package/dist/core/pickViewPart.js +23 -0
- package/dist/core/renderRegion.js +21 -0
- package/dist/core/resolveMountValue.js +31 -0
- package/dist/core/resolveViewColumns.js +65 -0
- package/dist/core/someColumnConfig.js +30 -0
- package/dist/core/stabilizeData.js +90 -0
- package/dist/core/table.css +557 -0
- package/dist/core/useFeatureData.js +35 -0
- package/dist/core/useFeatureFragments.js +55 -0
- package/dist/core/useFeatureItems.js +78 -0
- package/dist/core/useFeatureMethods.js +29 -0
- package/dist/core/useFeatureRows.js +36 -0
- package/dist/core/useFeatureSet.js +54 -0
- package/dist/core/useForeignKeys.js +38 -0
- package/dist/core/useGridFeatures.js +26 -0
- package/dist/core/useStableConfig.js +34 -0
- package/dist/core/useSummary.js +73 -0
- package/dist/core/useTableConfig.js +189 -0
- package/dist/core/useTableState.js +150 -0
- package/dist/core/useViewportSize.js +40 -0
- package/dist/e2e.js +16 -0
- package/dist/features/bulk/BulkBar.js +46 -0
- package/dist/features/bulk/bulk.css +57 -0
- package/dist/features/bulk/bulkFeature.js +28 -0
- package/dist/features/bulk/countSelection.js +27 -0
- package/dist/features/bulk/createSelectAllMatching.js +43 -0
- package/dist/features/bulk/useBulkBar.js +42 -0
- package/dist/features/clipboard/clipboardFeature.js +24 -0
- package/dist/features/clipboard/createPasteCells.js +61 -0
- package/dist/features/clipboard/getCopyText.js +57 -0
- package/dist/features/clipboard/handleCopyKeyDown.js +37 -0
- package/dist/features/clipboard/parseTsv.js +70 -0
- package/dist/features/clipboard/pasteFeature.js +26 -0
- package/dist/features/clipboard/planPaste.js +101 -0
- package/dist/features/clipboard/serializeTsv.js +25 -0
- package/dist/features/clipboard/usePasteListener.js +45 -0
- package/dist/features/columnManager/ColumnManager.js +253 -0
- package/dist/features/columnManager/ColumnManagerPopover.js +37 -0
- package/dist/features/columnManager/DragHandleIcon.js +39 -0
- package/dist/features/columnManager/LazyColumnManagerPopover.js +19 -0
- package/dist/features/columnManager/applyManagerRegions.js +43 -0
- package/dist/features/columnManager/boundaryIds.js +21 -0
- package/dist/features/columnManager/buildManagerSequence.js +38 -0
- package/dist/features/columnManager/columnManager.css +155 -0
- package/dist/features/columnManager/columnManagerFeature.js +37 -0
- package/dist/features/columnManager/createCloseColumnManager.js +21 -0
- package/dist/features/columnManager/createOpenColumnManager.js +21 -0
- package/dist/features/columnManager/createResetColumns.js +43 -0
- package/dist/features/columnManager/getColumnManagerMenuItems.js +26 -0
- package/dist/features/columnManager/getListRoom.js +31 -0
- package/dist/features/columnManager/getManagerEntries.js +31 -0
- package/dist/features/columnManager/moveSequenceEntry.js +25 -0
- package/dist/features/columnManager/sequenceToRegions.js +38 -0
- package/dist/features/columnManager/snapListHeight.js +35 -0
- package/dist/features/columnManager/updateScrollHints.js +23 -0
- package/dist/features/columnManager/useColumnManager.js +36 -0
- package/dist/features/density/densityFeature.js +39 -0
- package/dist/features/density/densityToValue.js +23 -0
- package/dist/features/density/getViewWrapColumn.js +53 -0
- package/dist/features/density/initDensity.js +27 -0
- package/dist/features/density/initWrap.js +23 -0
- package/dist/features/editing/AddRowButton.js +28 -0
- package/dist/features/editing/CellEditor.js +284 -0
- package/dist/features/editing/EditMarker.js +38 -0
- package/dist/features/editing/EditingLayer.js +148 -0
- package/dist/features/editing/RowControlsCell.js +89 -0
- package/dist/features/editing/RowControlsHeader.js +18 -0
- package/dist/features/editing/SelectedTag.js +33 -0
- package/dist/features/editing/addChangeRow.js +34 -0
- package/dist/features/editing/applyChangeUpdates.js +28 -0
- package/dist/features/editing/applyChanges.js +90 -0
- package/dist/features/editing/applyMoveOverlay.js +44 -0
- package/dist/features/editing/applyMoveToChanges.js +66 -0
- package/dist/features/editing/applyOverlay.js +41 -0
- package/dist/features/editing/coerceCellValue.js +187 -0
- package/dist/features/editing/collectRawColumns.js +38 -0
- package/dist/features/editing/computeEditTargets.js +108 -0
- package/dist/features/editing/computeRowMove.js +78 -0
- package/dist/features/editing/createAddRow.js +68 -0
- package/dist/features/editing/createCancelEdit.js +29 -0
- package/dist/features/editing/createCommitEdit.js +124 -0
- package/dist/features/editing/createDeleteRow.js +39 -0
- package/dist/features/editing/createEditSpecs.js +80 -0
- package/dist/features/editing/createEmptyChanges.js +23 -0
- package/dist/features/editing/createMoveRow.js +65 -0
- package/dist/features/editing/createNewRow.js +32 -0
- package/dist/features/editing/createResetChanges.js +29 -0
- package/dist/features/editing/createSaveCellEdit.js +113 -0
- package/dist/features/editing/createSaveRowMove.js +90 -0
- package/dist/features/editing/createStartEdit.js +57 -0
- package/dist/features/editing/createStepHistory.js +33 -0
- package/dist/features/editing/createUndoStack.js +67 -0
- package/dist/features/editing/createValueStore.js +34 -0
- package/dist/features/editing/createWriteCell.js +34 -0
- package/dist/features/editing/createWriteChanges.js +43 -0
- package/dist/features/editing/editing.css +223 -0
- package/dist/features/editing/editingFeature.js +66 -0
- package/dist/features/editing/findCellByKey.js +23 -0
- package/dist/features/editing/findInvalidCells.js +41 -0
- package/dist/features/editing/findNextEditableCell.js +54 -0
- package/dist/features/editing/focusCell.js +28 -0
- package/dist/features/editing/fromDateValue.js +29 -0
- package/dist/features/editing/fromEditorDraft.js +45 -0
- package/dist/features/editing/generateRowKey.js +25 -0
- package/dist/features/editing/getDataGap.js +28 -0
- package/dist/features/editing/getEditOptions.js +33 -0
- package/dist/features/editing/getEditorKind.js +36 -0
- package/dist/features/editing/getEventError.js +24 -0
- package/dist/features/editing/getKeyField.js +23 -0
- package/dist/features/editing/getReorderBlock.js +33 -0
- package/dist/features/editing/handleEditDoubleClick.js +34 -0
- package/dist/features/editing/handleEditKeyDown.js +123 -0
- package/dist/features/editing/handleRowControlsClick.js +29 -0
- package/dist/features/editing/handleRowDragPointerDown.js +95 -0
- package/dist/features/editing/isCellEditable.js +20 -0
- package/dist/features/editing/isPrintableKey.js +22 -0
- package/dist/features/editing/isSameTargets.js +19 -0
- package/dist/features/editing/matchOption.js +21 -0
- package/dist/features/editing/needsEditing.js +26 -0
- package/dist/features/editing/normalizeChanges.js +37 -0
- package/dist/features/editing/positionBetween.js +30 -0
- package/dist/features/editing/pruneOverlay.js +39 -0
- package/dist/features/editing/removeChangeRow.js +48 -0
- package/dist/features/editing/reorderByKeys.js +34 -0
- package/dist/features/editing/rowControlsColumn.js +33 -0
- package/dist/features/editing/setChangeField.js +72 -0
- package/dist/features/editing/setRowField.js +23 -0
- package/dist/features/editing/sortByPosition.js +31 -0
- package/dist/features/editing/toDateValue.js +38 -0
- package/dist/features/editing/toEditorDraft.js +56 -0
- package/dist/features/editing/toSelectOptions.js +39 -0
- package/dist/features/editing/useEditingData.js +199 -0
- package/dist/features/editing/useEditingFragments.js +77 -0
- package/dist/features/editing/useEditingGrid.js +25 -0
- package/dist/features/editing/validateCellValue.js +25 -0
- package/dist/features/editing/valuesEqual.js +31 -0
- package/dist/features/editing/warnMissingEvent.js +23 -0
- package/dist/features/events/createActivateRow.js +54 -0
- package/dist/features/events/eventsFeature.js +35 -0
- package/dist/features/events/getBodyTarget.js +27 -0
- package/dist/features/events/getRowIndex.js +24 -0
- package/dist/features/events/handleAuxClick.js +38 -0
- package/dist/features/events/handlePointerDown.js +22 -0
- package/dist/features/events/handleRowClick.js +57 -0
- package/dist/features/events/handleRowDoubleClick.js +45 -0
- package/dist/features/events/isTextDrag.js +30 -0
- package/dist/features/events/openRowLink.js +29 -0
- package/dist/features/expandable/DetailRow.js +57 -0
- package/dist/features/expandable/ExpandToggle.js +34 -0
- package/dist/features/expandable/expandable.css +40 -0
- package/dist/features/expandable/expandableFeature.js +34 -0
- package/dist/features/expandable/handleExpandClick.js +25 -0
- package/dist/features/expandable/needsExpandable.js +20 -0
- package/dist/features/expandable/normalizeExpandable.js +52 -0
- package/dist/features/expandable/useExpandableItems.js +101 -0
- package/dist/features/expansion/createToggleRowExpanded.js +52 -0
- package/dist/features/expansion/expansionFeature.js +31 -0
- package/dist/features/expansion/getExpandedIds.js +26 -0
- package/dist/features/expansion/initExpanded.js +22 -0
- package/dist/features/export/buildCsv.js +39 -0
- package/dist/features/export/createExportCsv.js +59 -0
- package/dist/features/export/exportFeature.js +25 -0
- package/dist/features/export/toCsvField.js +20 -0
- package/dist/features/filtering/ChoiceFilter.js +30 -0
- package/dist/features/filtering/CloseIcon.js +29 -0
- package/dist/features/filtering/ColumnFilter.js +192 -0
- package/dist/features/filtering/ColumnFilterPopover.js +38 -0
- package/dist/features/filtering/DateFilter.js +80 -0
- package/dist/features/filtering/DraftInput.js +37 -0
- package/dist/features/filtering/DraftInputNumber.js +36 -0
- package/dist/features/filtering/FilterBuilder.js +45 -0
- package/dist/features/filtering/FilterGroup.js +116 -0
- package/dist/features/filtering/FilterIcon.js +26 -0
- package/dist/features/filtering/FilterIndicator.js +40 -0
- package/dist/features/filtering/FilterLeaf.js +86 -0
- package/dist/features/filtering/LazyColumnFilterPopover.js +19 -0
- package/dist/features/filtering/LazyFilterBuilder.js +19 -0
- package/dist/features/filtering/NumberFilter.js +43 -0
- package/dist/features/filtering/OptionsFilter.js +72 -0
- package/dist/features/filtering/RelativeDateEditor.js +90 -0
- package/dist/features/filtering/TextFilter.js +51 -0
- package/dist/features/filtering/ValueEditor.js +210 -0
- package/dist/features/filtering/buildColumnFilter.js +95 -0
- package/dist/features/filtering/changeLeafOperator.js +46 -0
- package/dist/features/filtering/createApplyFiltering.js +78 -0
- package/dist/features/filtering/createClearFilters.js +24 -0
- package/dist/features/filtering/createCloseColumnFilter.js +28 -0
- package/dist/features/filtering/createConditionFilteredRowModel.js +40 -0
- package/dist/features/filtering/createDefaultLeaf.js +31 -0
- package/dist/features/filtering/createOpenColumnFilter.js +25 -0
- package/dist/features/filtering/createRowTest.js +32 -0
- package/dist/features/filtering/createSearchMatcher.js +35 -0
- package/dist/features/filtering/createSetFilter.js +27 -0
- package/dist/features/filtering/createSetSearch.js +29 -0
- package/dist/features/filtering/createUpdateColumnFilter.js +29 -0
- package/dist/features/filtering/defaultRelativeDate.js +20 -0
- package/dist/features/filtering/filterRowModel.js +66 -0
- package/dist/features/filtering/filtering.css +151 -0
- package/dist/features/filtering/filteringFeature.js +82 -0
- package/dist/features/filtering/filteringToValue.js +23 -0
- package/dist/features/filtering/formatFilterDate.js +24 -0
- package/dist/features/filtering/getColumnConditions.js +24 -0
- package/dist/features/filtering/getConditionKeys.js +31 -0
- package/dist/features/filtering/getDistinctOptions.js +52 -0
- package/dist/features/filtering/getFilterKind.js +37 -0
- package/dist/features/filtering/getFilterResultKey.js +26 -0
- package/dist/features/filtering/getFilterResults.js +53 -0
- package/dist/features/filtering/getFilteredKeys.js +31 -0
- package/dist/features/filtering/getFilteringHeaderProps.js +22 -0
- package/dist/features/filtering/getFilteringMenuItems.js +42 -0
- package/dist/features/filtering/getFilteringTableOptions.js +33 -0
- package/dist/features/filtering/getGroupOperator.js +23 -0
- package/dist/features/filtering/getOperatorLabel.js +50 -0
- package/dist/features/filtering/getPlainTitle.js +26 -0
- package/dist/features/filtering/getSearchColumns.js +23 -0
- package/dist/features/filtering/getSearchKey.js +19 -0
- package/dist/features/filtering/getSearchText.js +57 -0
- package/dist/features/filtering/getTopLevelConditions.js +25 -0
- package/dist/features/filtering/getValueShape.js +30 -0
- package/dist/features/filtering/handleFilterIndicatorClick.js +25 -0
- package/dist/features/filtering/initFilter.js +25 -0
- package/dist/features/filtering/initSearch.js +24 -0
- package/dist/features/filtering/isColumnCondition.js +22 -0
- package/dist/features/filtering/isCompleteLeaf.js +45 -0
- package/dist/features/filtering/isServerMode.js +21 -0
- package/dist/features/filtering/normalizeSearch.js +21 -0
- package/dist/features/filtering/parseColumnFilter.js +128 -0
- package/dist/features/filtering/parseFilterDate.js +24 -0
- package/dist/features/filtering/prepareFilterResult.js +63 -0
- package/dist/features/filtering/pruneCondition.js +35 -0
- package/dist/features/filtering/setColumnFilter.js +51 -0
- package/dist/features/filtering/textFilterOperators.js +26 -0
- package/dist/features/filtering/toRootGroup.js +34 -0
- package/dist/features/filtering/useDraft.js +65 -0
- package/dist/features/filtering/useFilteringState.js +32 -0
- package/dist/features/filtering/useSyncedState.js +45 -0
- package/dist/features/grouping/GroupCell.js +72 -0
- package/dist/features/grouping/GroupCheckbox.js +38 -0
- package/dist/features/grouping/GroupLabel.js +73 -0
- package/dist/features/grouping/GroupRow.js +103 -0
- package/dist/features/grouping/StickyGroupRow.js +136 -0
- package/dist/features/grouping/buildGroupTree.js +138 -0
- package/dist/features/grouping/buildStickyLevels.js +35 -0
- package/dist/features/grouping/countGroupSelection.js +26 -0
- package/dist/features/grouping/createAggregateColumns.js +38 -0
- package/dist/features/grouping/createCollapseAllGroups.js +26 -0
- package/dist/features/grouping/createExpandAllGroups.js +23 -0
- package/dist/features/grouping/createGroupLevels.js +46 -0
- package/dist/features/grouping/createSetCollapsedGroups.js +27 -0
- package/dist/features/grouping/createSetGroup.js +35 -0
- package/dist/features/grouping/createSetGroupKeys.js +27 -0
- package/dist/features/grouping/createToggleGroup.js +38 -0
- package/dist/features/grouping/createToggleGroupSelected.js +49 -0
- package/dist/features/grouping/findGroupIndices.js +25 -0
- package/dist/features/grouping/flattenGroups.js +58 -0
- package/dist/features/grouping/getGroupLabel.js +34 -0
- package/dist/features/grouping/getStickyGroups.js +60 -0
- package/dist/features/grouping/groupRowsFeature.js +57 -0
- package/dist/features/grouping/grouping.css +128 -0
- package/dist/features/grouping/groupingFeature.js +48 -0
- package/dist/features/grouping/groupingHeaderMenuItems.js +44 -0
- package/dist/features/grouping/groupingToValue.js +26 -0
- package/dist/features/grouping/handleGroupClick.js +51 -0
- package/dist/features/grouping/handleGroupKeyDown.js +60 -0
- package/dist/features/grouping/initAggregates.js +36 -0
- package/dist/features/grouping/initCollapsedGroups.js +29 -0
- package/dist/features/grouping/initGrouping.js +34 -0
- package/dist/features/grouping/needsGroupRows.js +23 -0
- package/dist/features/grouping/orderGroups.js +49 -0
- package/dist/features/grouping/resolveAggregates.js +29 -0
- package/dist/features/grouping/toGroupIdentity.js +24 -0
- package/dist/features/grouping/toGroupKeys.js +24 -0
- package/dist/features/grouping/useGrouping.js +91 -0
- package/dist/features/headerMenu/HeaderMenuDropdown.js +86 -0
- package/dist/features/headerMenu/HeaderMenuTrigger.js +44 -0
- package/dist/features/headerMenu/LazyHeaderMenuDropdown.js +19 -0
- package/dist/features/headerMenu/MenuIcon.js +38 -0
- package/dist/features/headerMenu/collectHeaderMenuItems.js +69 -0
- package/dist/features/headerMenu/createAutosizeColumn.js +35 -0
- package/dist/features/headerMenu/createCloseHeaderMenu.js +28 -0
- package/dist/features/headerMenu/createOpenHeaderMenu.js +30 -0
- package/dist/features/headerMenu/focusHeaderControl.js +31 -0
- package/dist/features/headerMenu/freezeColumns.js +31 -0
- package/dist/features/headerMenu/getChromeMenuItems.js +144 -0
- package/dist/features/headerMenu/getVisibleOrder.js +19 -0
- package/dist/features/headerMenu/handleHeaderButtonPointerDown.js +27 -0
- package/dist/features/headerMenu/handleHeaderMenuClick.js +26 -0
- package/dist/features/headerMenu/handleHeaderMenuKeyDown.js +28 -0
- package/dist/features/headerMenu/headerMenu.css +122 -0
- package/dist/features/headerMenu/headerMenuFeature.js +46 -0
- package/dist/features/headerMenu/measureColumnWidth.js +51 -0
- package/dist/features/headerMenu/pinColumn.js +27 -0
- package/dist/features/headerMenu/sectionOrder.js +25 -0
- package/dist/features/headerMenu/useHeaderMenuState.js +27 -0
- package/dist/features/index.js +149 -0
- package/dist/features/keyboard/findCellElement.js +21 -0
- package/dist/features/keyboard/getNextCell.js +74 -0
- package/dist/features/keyboard/handleGridFocus.js +31 -0
- package/dist/features/keyboard/handleGridKeyDown.js +72 -0
- package/dist/features/keyboard/isCellRendered.js +22 -0
- package/dist/features/keyboard/keyboardFeature.js +26 -0
- package/dist/features/keyboard/useKeyboard.js +84 -0
- package/dist/features/lazyCells/getBodyRowKey.js +19 -0
- package/dist/features/lazyCells/handlePointerLeave.js +21 -0
- package/dist/features/lazyCells/handlePointerOver.js +22 -0
- package/dist/features/lazyCells/handleRowBlur.js +22 -0
- package/dist/features/lazyCells/handleRowFocus.js +26 -0
- package/dist/features/lazyCells/lazyCellsFeature.js +33 -0
- package/dist/features/lazyCells/useFastScroll.js +57 -0
- package/dist/features/ordering/getColumnClientBounds.js +32 -0
- package/dist/features/ordering/handleReorderPointerDown.js +137 -0
- package/dist/features/ordering/initColumnOrder.js +18 -0
- package/dist/features/ordering/moveKeys.js +27 -0
- package/dist/features/ordering/orderingFeature.js +35 -0
- package/dist/features/pagination/TablePagination.js +31 -0
- package/dist/features/pagination/initPageSize.js +28 -0
- package/dist/features/pagination/paginationFeature.js +36 -0
- package/dist/features/pagination/paginationToValue.js +24 -0
- package/dist/features/pagination/usePager.js +32 -0
- package/dist/features/pagination/usePagination.js +58 -0
- package/dist/features/pinning/initColumnPinning.js +21 -0
- package/dist/features/pinning/pinningFeature.js +33 -0
- package/dist/features/pinning/pinningToViewColumn.js +24 -0
- package/dist/features/queue/createAfterRowAction.js +40 -0
- package/dist/features/queue/findNextRowId.js +26 -0
- package/dist/features/queue/findRowAction.js +77 -0
- package/dist/features/queue/handleRowActionKey.js +44 -0
- package/dist/features/queue/queueFeature.js +27 -0
- package/dist/features/selection/SelectAllHeader.js +40 -0
- package/dist/features/selection/SelectCell.js +30 -0
- package/dist/features/selection/countSelectedRows.js +31 -0
- package/dist/features/selection/createClearSelection.js +29 -0
- package/dist/features/selection/createToggleAllRowsSelected.js +60 -0
- package/dist/features/selection/createToggleRowSelected.js +86 -0
- package/dist/features/selection/getRawRowKey.js +23 -0
- package/dist/features/selection/getSelectAllExcept.js +23 -0
- package/dist/features/selection/getSelectAllState.js +42 -0
- package/dist/features/selection/handleSelectionClick.js +30 -0
- package/dist/features/selection/initRowSelection.js +36 -0
- package/dist/features/selection/initSelectionMode.js +19 -0
- package/dist/features/selection/initSelectionView.js +35 -0
- package/dist/features/selection/isSelectAllValue.js +19 -0
- package/dist/features/selection/isSelectionViewCurrent.js +22 -0
- package/dist/features/selection/notifySelectionChange.js +32 -0
- package/dist/features/selection/pruneRowSelection.js +26 -0
- package/dist/features/selection/selectionFeature.js +69 -0
- package/dist/features/selection/selectionToValue.js +48 -0
- package/dist/features/selection/useSelection.js +77 -0
- package/dist/features/serverData/buildServerItems.js +109 -0
- package/dist/features/serverData/createBlockCache.js +205 -0
- package/dist/features/serverData/createRefresh.js +23 -0
- package/dist/features/serverData/createServerStore.js +360 -0
- package/dist/features/serverData/getBlockRange.js +29 -0
- package/dist/features/serverData/getListKey.js +20 -0
- package/dist/features/serverData/getNeededBlocks.js +45 -0
- package/dist/features/serverData/needsServerData.js +20 -0
- package/dist/features/serverData/normalizeServerData.js +41 -0
- package/dist/features/serverData/pickServerView.js +43 -0
- package/dist/features/serverData/readFetchResult.js +36 -0
- package/dist/features/serverData/serverData.css +21 -0
- package/dist/features/serverData/serverDataFeature.js +38 -0
- package/dist/features/serverData/serverRangeFeature.js +22 -0
- package/dist/features/serverData/useServerData.js +48 -0
- package/dist/features/serverData/useServerItems.js +35 -0
- package/dist/features/serverData/useServerRange.js +35 -0
- package/dist/features/serverData/useServerView.js +70 -0
- package/dist/features/sizing/ResizeHandle.js +24 -0
- package/dist/features/sizing/handleResizePointerDown.js +66 -0
- package/dist/features/sizing/initColumnSizing.js +23 -0
- package/dist/features/sizing/sizingFeature.js +39 -0
- package/dist/features/sizing/sizingToViewColumn.js +24 -0
- package/dist/features/sorting/SortIndicator.js +37 -0
- package/dist/features/sorting/buildSortKeys.js +52 -0
- package/dist/features/sorting/collectSortKeys.js +30 -0
- package/dist/features/sorting/createClearSort.js +21 -0
- package/dist/features/sorting/createIndexSortedRowModel.js +33 -0
- package/dist/features/sorting/createSetSort.js +43 -0
- package/dist/features/sorting/createSortKeyCollector.js +59 -0
- package/dist/features/sorting/createToggleSort.js +42 -0
- package/dist/features/sorting/getCachedSortKeys.js +19 -0
- package/dist/features/sorting/getSortHeaderProps.js +25 -0
- package/dist/features/sorting/getSortKeys.js +38 -0
- package/dist/features/sorting/handleSortClick.js +27 -0
- package/dist/features/sorting/initSorting.js +37 -0
- package/dist/features/sorting/isNumericSortType.js +21 -0
- package/dist/features/sorting/prepareSortKeys.js +92 -0
- package/dist/features/sorting/rankSortKeys.js +33 -0
- package/dist/features/sorting/setCachedSortKeys.js +24 -0
- package/dist/features/sorting/sortInSlices.js +69 -0
- package/dist/features/sorting/sortIndices.js +40 -0
- package/dist/features/sorting/sortKeysCache.js +19 -0
- package/dist/features/sorting/sortRowModel.js +84 -0
- package/dist/features/sorting/sortingFeature.js +62 -0
- package/dist/features/sorting/sortingToValue.js +27 -0
- package/dist/features/sorting/toFloatSortKeys.js +24 -0
- package/dist/features/sorting/yieldToMain.js +27 -0
- package/dist/features/toolbar/ColumnTitle.js +28 -0
- package/dist/features/toolbar/DensityToggle.js +53 -0
- package/dist/features/toolbar/FilterButton.js +56 -0
- package/dist/features/toolbar/GroupButton.js +51 -0
- package/dist/features/toolbar/OptionsQuickFilter.js +72 -0
- package/dist/features/toolbar/QuickFilter.js +46 -0
- package/dist/features/toolbar/RecordCount.js +27 -0
- package/dist/features/toolbar/SaveViewAs.js +66 -0
- package/dist/features/toolbar/SortButton.js +94 -0
- package/dist/features/toolbar/Toolbar.js +88 -0
- package/dist/features/toolbar/ToolbarCount.js +25 -0
- package/dist/features/toolbar/ToolbarIcon.js +28 -0
- package/dist/features/toolbar/ToolbarList.js +100 -0
- package/dist/features/toolbar/ToolbarSearch.js +63 -0
- package/dist/features/toolbar/ViewActions.js +41 -0
- package/dist/features/toolbar/ViewTabLabel.js +39 -0
- package/dist/features/toolbar/ViewTabMenu.js +48 -0
- package/dist/features/toolbar/ViewTabs.js +44 -0
- package/dist/features/toolbar/countConditions.js +25 -0
- package/dist/features/toolbar/formatRecordCount.js +19 -0
- package/dist/features/toolbar/getQuickFilterValues.js +25 -0
- package/dist/features/toolbar/getRootConditions.js +25 -0
- package/dist/features/toolbar/handleToolbarKeyDown.js +28 -0
- package/dist/features/toolbar/isDefaultSorting.js +26 -0
- package/dist/features/toolbar/isQuickFilterLeaf.js +20 -0
- package/dist/features/toolbar/moveItem.js +25 -0
- package/dist/features/toolbar/needsToolbar.js +21 -0
- package/dist/features/toolbar/normalizeToolbar.js +61 -0
- package/dist/features/toolbar/setQuickFilterValues.js +35 -0
- package/dist/features/toolbar/toolbar.css +185 -0
- package/dist/features/toolbar/toolbarFeature.js +27 -0
- package/dist/features/toolbar/useToolbar.js +41 -0
- package/dist/features/toolbar/validateQuickFilters.js +28 -0
- package/dist/features/transactions/applyTransactionToRows.js +56 -0
- package/dist/features/transactions/createApplyTransaction.js +26 -0
- package/dist/features/transactions/normalizeTransaction.js +49 -0
- package/dist/features/transactions/transactionsFeature.js +24 -0
- package/dist/features/transactions/useTransactionData.js +44 -0
- package/dist/features/tree/TreeToggle.js +39 -0
- package/dist/features/tree/buildTreeIndex.js +60 -0
- package/dist/features/tree/buildTreeItems.js +96 -0
- package/dist/features/tree/flattenTreeData.js +45 -0
- package/dist/features/tree/getDescendantIds.js +28 -0
- package/dist/features/tree/handleTreeClick.js +25 -0
- package/dist/features/tree/handleTreeKeyDown.js +58 -0
- package/dist/features/tree/needsTree.js +20 -0
- package/dist/features/tree/normalizeTree.js +41 -0
- package/dist/features/tree/rowNeedsChildren.js +25 -0
- package/dist/features/tree/tree.css +55 -0
- package/dist/features/tree/treeFeature.js +35 -0
- package/dist/features/tree/useTreeData.js +33 -0
- package/dist/features/tree/useTreeItems.js +61 -0
- package/dist/features/views/compactView.js +30 -0
- package/dist/features/views/createViewsApi.js +74 -0
- package/dist/features/views/decodeViewParam.js +30 -0
- package/dist/features/views/encodeViewParam.js +25 -0
- package/dist/features/views/findActiveView.js +23 -0
- package/dist/features/views/getStorageKey.js +20 -0
- package/dist/features/views/getViewKey.js +27 -0
- package/dist/features/views/getViewSliceDeps.js +27 -0
- package/dist/features/views/isViewDirty.js +34 -0
- package/dist/features/views/mountViewValue.js +36 -0
- package/dist/features/views/needsViews.js +23 -0
- package/dist/features/views/normalizePersist.js +27 -0
- package/dist/features/views/normalizeViews.js +41 -0
- package/dist/features/views/notifyViewSelect.js +29 -0
- package/dist/features/views/readMountPayload.js +31 -0
- package/dist/features/views/readPersistedView.js +45 -0
- package/dist/features/views/sanitizePersistedView.js +49 -0
- package/dist/features/views/stableStringify.js +27 -0
- package/dist/features/views/useViews.js +136 -0
- package/dist/features/views/viewKeys.js +28 -0
- package/dist/features/views/viewsFeature.js +26 -0
- package/dist/features/views/writePersistedView.js +42 -0
- package/dist/features/virtualization/computeRowOffsets.js +29 -0
- package/dist/features/virtualization/computeWindow.js +92 -0
- package/dist/features/virtualization/createScrollToRow.js +36 -0
- package/dist/features/virtualization/firstIndexAbove.js +30 -0
- package/dist/features/virtualization/getMeasureKey.js +23 -0
- package/dist/features/virtualization/isMeasuredColumn.js +20 -0
- package/dist/features/virtualization/isSameRange.js +18 -0
- package/dist/features/virtualization/positionedRowsFeature.js +22 -0
- package/dist/features/virtualization/scrollToCell.js +49 -0
- package/dist/features/virtualization/shiftRowOffsets.js +35 -0
- package/dist/features/virtualization/usePositionedRows.js +37 -0
- package/dist/features/virtualization/useRowOffsets.js +123 -0
- package/dist/features/virtualization/useScrollWindow.js +114 -0
- package/dist/features/virtualization/useTanstackRowWindow.js +43 -0
- package/dist/features/virtualization/useVirtualization.js +64 -0
- package/dist/features/virtualization/virtualizationFeature.js +24 -0
- package/dist/features/virtualization/writeScrollEdges.js +33 -0
- package/dist/features/visibility/initColumnVisibility.js +22 -0
- package/dist/features/visibility/visibilityFeature.js +31 -0
- package/dist/features/visibility/visibilityToViewColumn.js +20 -0
- package/dist/metas.js +16 -0
- package/dist/types.js +17 -0
- package/package.json +91 -0
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { columnPinningFeature } from '@tanstack/react-table';
|
|
16
|
+
import initColumnPinning from './initColumnPinning.js';
|
|
17
|
+
import pinningToViewColumn from './pinningToViewColumn.js';
|
|
18
|
+
// Pinned columns render outside the column virtual range as position: sticky cells (D10.3); the
|
|
19
|
+
// layout reads the start/end regions from TanStack's pinning state.
|
|
20
|
+
const pinningFeature = {
|
|
21
|
+
name: 'pinning',
|
|
22
|
+
tableFeatures: {
|
|
23
|
+
columnPinningFeature
|
|
24
|
+
},
|
|
25
|
+
slices: {
|
|
26
|
+
columnPinning: {
|
|
27
|
+
init: initColumnPinning,
|
|
28
|
+
cause: 'columns'
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
toViewColumn: pinningToViewColumn
|
|
32
|
+
};
|
|
33
|
+
export default pinningFeature;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ function pinningToViewColumn({ key, state }) {
|
|
16
|
+
if (state.columnPinning.start.includes(key)) return {
|
|
17
|
+
pinned: 'start'
|
|
18
|
+
};
|
|
19
|
+
if (state.columnPinning.end.includes(key)) return {
|
|
20
|
+
pinned: 'end'
|
|
21
|
+
};
|
|
22
|
+
return {};
|
|
23
|
+
}
|
|
24
|
+
export default pinningToViewColumn;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import findNextRowId from './findNextRowId.js';
|
|
16
|
+
import isDataItem from '../../core/isDataItem.js';
|
|
17
|
+
// Action `afterRowAction({ id, result })`, called when a row button, menu item or single-key
|
|
18
|
+
// action fires. With `keyboard.next`, focus moves to the next row once the event's actions
|
|
19
|
+
// finish (triage: act, and the next item is ready). The next row is picked before the actions
|
|
20
|
+
// run: an action that removes the row from the list still lands on the row that followed it.
|
|
21
|
+
function createAfterRowAction(api) {
|
|
22
|
+
return function afterRowAction({ id, result }) {
|
|
23
|
+
if (!api.config.keyboardNext) return;
|
|
24
|
+
const nextId = findNextRowId({
|
|
25
|
+
rows: api.rows,
|
|
26
|
+
id
|
|
27
|
+
});
|
|
28
|
+
const { col } = api.keyboard.activeCell;
|
|
29
|
+
Promise.resolve(result).then((outcome)=>{
|
|
30
|
+
if (outcome?.success === false) return;
|
|
31
|
+
const index = api.rows.findIndex((row)=>isDataItem(row) && row.id === nextId);
|
|
32
|
+
if (index === -1) return;
|
|
33
|
+
api.keyboard.moveTo({
|
|
34
|
+
row: index,
|
|
35
|
+
col
|
|
36
|
+
});
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export default createAfterRowAction;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import isDataItem from '../../core/isDataItem.js';
|
|
16
|
+
// The id of the data row after this one in the display list (group headers, detail rows and rows
|
|
17
|
+
// not loaded yet skipped), or null.
|
|
18
|
+
function findNextRowId({ rows, id }) {
|
|
19
|
+
const index = rows.findIndex((row)=>isDataItem(row) && row.id === id);
|
|
20
|
+
if (index === -1) return null;
|
|
21
|
+
for(let i = index + 1; i < rows.length; i++){
|
|
22
|
+
if (isDataItem(rows[i])) return rows[i].id;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
export default findNextRowId;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { get, type } from '@lowdefy/helpers';
|
|
16
|
+
import resolveControlField from '@lowdefy/blocks-antd/table/resolveControlField.js';
|
|
17
|
+
import resolveControlFlag from '@lowdefy/blocks-antd/table/resolveControlFlag.js';
|
|
18
|
+
const CONTROL_LISTS = {
|
|
19
|
+
buttons: 'buttons',
|
|
20
|
+
menu: 'items'
|
|
21
|
+
};
|
|
22
|
+
// The row button or menu item bound to a key (`key: 'a'`), resolved for one row: the first one
|
|
23
|
+
// in column order that is shown and enabled for that row, with the event payload its click would
|
|
24
|
+
// fire (D5).
|
|
25
|
+
function findRowAction({ columns, key, row, rowKey }) {
|
|
26
|
+
for (const column of columns){
|
|
27
|
+
const listName = CONTROL_LISTS[column.type];
|
|
28
|
+
if (!listName) continue;
|
|
29
|
+
const controls = column.cell[listName];
|
|
30
|
+
if (!type.isArray(controls)) continue;
|
|
31
|
+
const value = get(row, column.field);
|
|
32
|
+
for(let index = 0; index < controls.length; index++){
|
|
33
|
+
const control = controls[index];
|
|
34
|
+
if (!type.isObject(control) || control.key !== key || !type.isString(control.eventName)) {
|
|
35
|
+
continue;
|
|
36
|
+
}
|
|
37
|
+
// `{ when }` flags are compiled with the columns (compileColumns); literal and `*Field`
|
|
38
|
+
// flags resolve without it.
|
|
39
|
+
const compiled = column.compiled?.[listName]?.[index] ?? {};
|
|
40
|
+
const flag = (name)=>resolveControlFlag({
|
|
41
|
+
control,
|
|
42
|
+
name,
|
|
43
|
+
compiled: compiled[name],
|
|
44
|
+
row,
|
|
45
|
+
value
|
|
46
|
+
});
|
|
47
|
+
if (flag('hidden') === true || flag('disabled') === true) continue;
|
|
48
|
+
const described = {
|
|
49
|
+
eventName: control.eventName,
|
|
50
|
+
title: resolveControlField({
|
|
51
|
+
control,
|
|
52
|
+
name: 'title',
|
|
53
|
+
row
|
|
54
|
+
})
|
|
55
|
+
};
|
|
56
|
+
const event = listName === 'buttons' ? {
|
|
57
|
+
row,
|
|
58
|
+
rowKey,
|
|
59
|
+
value,
|
|
60
|
+
button: described,
|
|
61
|
+
buttonIndex: index
|
|
62
|
+
} : {
|
|
63
|
+
row,
|
|
64
|
+
rowKey,
|
|
65
|
+
value,
|
|
66
|
+
item: described,
|
|
67
|
+
itemIndex: index
|
|
68
|
+
};
|
|
69
|
+
return {
|
|
70
|
+
name: control.eventName,
|
|
71
|
+
event
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
}
|
|
77
|
+
export default findRowAction;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import findRowAction from './findRowAction.js';
|
|
16
|
+
// Single-key row actions (Linear-style): a button or menu item with `key: 'a'` fires when `a` is
|
|
17
|
+
// pressed on its focused row. Only a bare key on the cell itself counts: a key typed into an
|
|
18
|
+
// editor or control inside the cell belongs to it, and modified keys are shortcuts.
|
|
19
|
+
function handleRowActionKey(event, api) {
|
|
20
|
+
if (event.metaKey || event.ctrlKey || event.altKey || event.key.length !== 1) return false;
|
|
21
|
+
const cell = event.target.closest('[data-lf-cell]');
|
|
22
|
+
if (!cell || cell !== event.target || !api.contains(cell)) return false;
|
|
23
|
+
const rowElement = cell.closest('[data-row-key]');
|
|
24
|
+
if (!rowElement) return false;
|
|
25
|
+
const id = rowElement.dataset.rowKey;
|
|
26
|
+
const tableRow = api.table.getCoreRowModel().rowsById[id];
|
|
27
|
+
if (!tableRow) return false;
|
|
28
|
+
const visible = api.config.columns.filter((column)=>api.state.columnVisibility[column.key] !== false);
|
|
29
|
+
const action = findRowAction({
|
|
30
|
+
columns: visible,
|
|
31
|
+
key: event.key,
|
|
32
|
+
row: tableRow.original,
|
|
33
|
+
rowKey: api.config.getKey(tableRow.original)
|
|
34
|
+
});
|
|
35
|
+
if (action === null) return false;
|
|
36
|
+
event.preventDefault();
|
|
37
|
+
const result = api.methods.triggerEvent(action);
|
|
38
|
+
api.actions.afterRowAction({
|
|
39
|
+
id,
|
|
40
|
+
result
|
|
41
|
+
});
|
|
42
|
+
return true;
|
|
43
|
+
}
|
|
44
|
+
export default handleRowActionKey;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import createAfterRowAction from './createAfterRowAction.js';
|
|
16
|
+
import handleRowActionKey from './handleRowActionKey.js';
|
|
17
|
+
// Queue and triage behaviour (archetype G): single-key row actions and `keyboard.next`.
|
|
18
|
+
const queueFeature = {
|
|
19
|
+
name: 'queue',
|
|
20
|
+
actions: {
|
|
21
|
+
afterRowAction: createAfterRowAction
|
|
22
|
+
},
|
|
23
|
+
gridHandlers: {
|
|
24
|
+
keydown: handleRowActionKey
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
export default queueFeature;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React, { useEffect, useRef } from 'react';
|
|
16
|
+
import getSelectAllState from './getSelectAllState.js';
|
|
17
|
+
function ignoreChange() {}
|
|
18
|
+
function SelectAllHeader({ api }) {
|
|
19
|
+
const ref = useRef(null);
|
|
20
|
+
const { checked, indeterminate } = getSelectAllState({
|
|
21
|
+
api
|
|
22
|
+
});
|
|
23
|
+
useEffect(()=>{
|
|
24
|
+
if (ref.current) ref.current.indeterminate = indeterminate;
|
|
25
|
+
}, [
|
|
26
|
+
indeterminate
|
|
27
|
+
]);
|
|
28
|
+
if (api.config.rowSelection.type === 'radio') return null;
|
|
29
|
+
return /*#__PURE__*/ React.createElement("input", {
|
|
30
|
+
"aria-label": "Select all rows",
|
|
31
|
+
checked: checked,
|
|
32
|
+
className: "lf-table-checkbox",
|
|
33
|
+
"data-lf-select-all": "",
|
|
34
|
+
onChange: ignoreChange,
|
|
35
|
+
ref: ref,
|
|
36
|
+
tabIndex: -1,
|
|
37
|
+
type: "checkbox"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
export default SelectAllHeader;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React from 'react';
|
|
16
|
+
function ignoreChange() {}
|
|
17
|
+
// A native input styled with antd tokens: an antd Checkbox per row would mount a CSS-in-JS hook
|
|
18
|
+
// per visible row (tier-0 rule, D4/D10.4). The delegated click handler does the toggling.
|
|
19
|
+
function SelectCell({ api, selected }) {
|
|
20
|
+
const inputType = api.config.rowSelection.type === 'radio' ? 'radio' : 'checkbox';
|
|
21
|
+
return /*#__PURE__*/ React.createElement("input", {
|
|
22
|
+
"aria-label": "Select row",
|
|
23
|
+
checked: selected,
|
|
24
|
+
className: "lf-table-checkbox",
|
|
25
|
+
onChange: ignoreChange,
|
|
26
|
+
tabIndex: -1,
|
|
27
|
+
type: inputType
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
export default SelectCell;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Counts against the filtered rows, the set the header checkbox selects (TanStack's select-all
|
|
16
|
+
// toggles the pre-grouped rows, which come after filtering), so "all selected" means all the rows
|
|
17
|
+
// the filter shows. In server mode filtering is manual, so these are the loaded rows; an
|
|
18
|
+
// `{ all: true, except }` selection is told apart by `selectionMode` (getSelectAllState).
|
|
19
|
+
function countSelectedRows({ api }) {
|
|
20
|
+
const { rows, rowsById } = api.table.getFilteredRowModel();
|
|
21
|
+
const selection = api.state.rowSelection;
|
|
22
|
+
let selectedCount = 0;
|
|
23
|
+
Object.keys(selection).forEach((id)=>{
|
|
24
|
+
if (selection[id] === true && rowsById[id]) selectedCount += 1;
|
|
25
|
+
});
|
|
26
|
+
return {
|
|
27
|
+
selectedCount,
|
|
28
|
+
total: rows.length
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
export default countSelectedRows;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ function createClearSelection(api) {
|
|
16
|
+
return function clearSelection() {
|
|
17
|
+
api.selectionExcept.clear();
|
|
18
|
+
api.updateSlice('selectionMode', ()=>'keys', {
|
|
19
|
+
cause: 'select'
|
|
20
|
+
});
|
|
21
|
+
api.updateSlice('selectionView', ()=>null, {
|
|
22
|
+
cause: 'select'
|
|
23
|
+
});
|
|
24
|
+
api.updateSlice('rowSelection', ()=>({}), {
|
|
25
|
+
cause: 'select'
|
|
26
|
+
});
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export default createClearSelection;
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import countSelectedRows from './countSelectedRows.js';
|
|
16
|
+
import getSelectAllState from './getSelectAllState.js';
|
|
17
|
+
// The header checkbox selects every row the filter shows (or clears them when all are selected),
|
|
18
|
+
// as their keys. In server mode most rows are not loaded, so it selects all rows the view matches
|
|
19
|
+
// as `{ all: true, except: [], filter, search }`, which the server resolves. Client mode writes
|
|
20
|
+
// that shape through the bulk bar's "Select all matching" (selectAllMatching) or from outside.
|
|
21
|
+
function createToggleAllRowsSelected(api) {
|
|
22
|
+
return function toggleAllRowsSelected() {
|
|
23
|
+
if (api.config.rowSelection?.type === 'radio') return false;
|
|
24
|
+
if (api.config.server) {
|
|
25
|
+
const { checked } = getSelectAllState({
|
|
26
|
+
api
|
|
27
|
+
});
|
|
28
|
+
api.selectionExcept.clear();
|
|
29
|
+
const selection = {};
|
|
30
|
+
if (!checked) {
|
|
31
|
+
Object.keys(api.table.getCoreRowModel().rowsById).forEach((id)=>{
|
|
32
|
+
selection[id] = true;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
api.updateSlice('selectionMode', ()=>checked ? 'keys' : 'all', {
|
|
36
|
+
cause: 'select'
|
|
37
|
+
});
|
|
38
|
+
api.updateSlice('selectionView', ()=>checked ? null : {
|
|
39
|
+
filter: api.state.filter,
|
|
40
|
+
search: api.state.search
|
|
41
|
+
}, {
|
|
42
|
+
cause: 'select'
|
|
43
|
+
});
|
|
44
|
+
api.updateSlice('rowSelection', ()=>selection, {
|
|
45
|
+
cause: 'select'
|
|
46
|
+
});
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
const { selectedCount, total } = countSelectedRows({
|
|
50
|
+
api
|
|
51
|
+
});
|
|
52
|
+
const selectAll = total > 0 && selectedCount < total;
|
|
53
|
+
api.updateSlice('selectionMode', ()=>'keys', {
|
|
54
|
+
cause: 'select'
|
|
55
|
+
});
|
|
56
|
+
api.table.toggleAllRowsSelected(selectAll);
|
|
57
|
+
return true;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
export default createToggleAllRowsSelected;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import getRawRowKey from './getRawRowKey.js';
|
|
16
|
+
// In an `{ all: true, except }` selection, a row cleared by the user joins `except` and a row
|
|
17
|
+
// selected again leaves it. The exceptions are recorded here, where the user acts, rather than
|
|
18
|
+
// inferred from unselected loaded rows: a row that has just loaded is not selected yet either.
|
|
19
|
+
function recordExceptions({ api, ids, selected }) {
|
|
20
|
+
if (api.state.selectionMode !== 'all') return;
|
|
21
|
+
ids.forEach((rowId)=>{
|
|
22
|
+
if (selected) {
|
|
23
|
+
api.selectionExcept.set(rowId, getRawRowKey({
|
|
24
|
+
id: rowId,
|
|
25
|
+
api
|
|
26
|
+
}));
|
|
27
|
+
} else {
|
|
28
|
+
api.selectionExcept.delete(rowId);
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
// TanStack's row toggle never clears other rows, so radio (single) selection replaces the record.
|
|
33
|
+
// With `rowSelection.cascade` in a tree, a row's descendants follow it.
|
|
34
|
+
function createToggleRowSelected(api) {
|
|
35
|
+
return function toggleRowSelected({ id }) {
|
|
36
|
+
if (!api.config.rowSelection) return false;
|
|
37
|
+
const row = api.table.getRow(id, true);
|
|
38
|
+
if (!row) return false;
|
|
39
|
+
const selected = api.state.rowSelection[id] === true;
|
|
40
|
+
if (api.config.rowSelection.type === 'radio') {
|
|
41
|
+
api.updateSlice('rowSelection', ()=>selected ? {} : {
|
|
42
|
+
[id]: true
|
|
43
|
+
}, {
|
|
44
|
+
cause: 'select'
|
|
45
|
+
});
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
if (api.config.rowSelection.cascade && api.tree) {
|
|
49
|
+
const ids = [
|
|
50
|
+
id,
|
|
51
|
+
...api.tree.getDescendantIds(id)
|
|
52
|
+
];
|
|
53
|
+
recordExceptions({
|
|
54
|
+
api,
|
|
55
|
+
ids,
|
|
56
|
+
selected
|
|
57
|
+
});
|
|
58
|
+
api.updateSlice('rowSelection', (previous)=>{
|
|
59
|
+
const next = {
|
|
60
|
+
...previous
|
|
61
|
+
};
|
|
62
|
+
ids.forEach((rowId)=>{
|
|
63
|
+
if (selected) {
|
|
64
|
+
delete next[rowId];
|
|
65
|
+
} else {
|
|
66
|
+
next[rowId] = true;
|
|
67
|
+
}
|
|
68
|
+
});
|
|
69
|
+
return next;
|
|
70
|
+
}, {
|
|
71
|
+
cause: 'select'
|
|
72
|
+
});
|
|
73
|
+
return true;
|
|
74
|
+
}
|
|
75
|
+
recordExceptions({
|
|
76
|
+
api,
|
|
77
|
+
ids: [
|
|
78
|
+
id
|
|
79
|
+
],
|
|
80
|
+
selected
|
|
81
|
+
});
|
|
82
|
+
row.toggleSelected();
|
|
83
|
+
return true;
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
export default createToggleRowSelected;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Row ids in TanStack state are strings; the value keeps the row key's own type (a numeric `id`
|
|
16
|
+
// stays a number). Keys of rows that are not loaded (`preserve`) fall back to the key the value
|
|
17
|
+
// supplied.
|
|
18
|
+
function getRawRowKey({ id, api }) {
|
|
19
|
+
const row = api.table.getCoreRowModel().rowsById[id];
|
|
20
|
+
if (row) return api.config.getKey(row.original);
|
|
21
|
+
return api.foreignKeys.get(id) ?? id;
|
|
22
|
+
}
|
|
23
|
+
export default getRawRowKey;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // The `except` keys of an `{ all: true, except }` selection: the rows the user cleared since
|
|
16
|
+
// selecting all (recorded by toggleRowSelected), including rows that are not loaded now (server
|
|
17
|
+
// mode evicts and reloads blocks), plus exceptions the value set from outside.
|
|
18
|
+
function getSelectAllExcept({ api }) {
|
|
19
|
+
return [
|
|
20
|
+
...api.selectionExcept.values()
|
|
21
|
+
];
|
|
22
|
+
}
|
|
23
|
+
export default getSelectAllExcept;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import countSelectedRows from './countSelectedRows.js';
|
|
16
|
+
// The header checkbox state. In client mode it reflects the loaded rows. In server mode it is
|
|
17
|
+
// checked only for an `{ all: true }` selection with no exceptions: selecting every loaded row
|
|
18
|
+
// is not selecting every row.
|
|
19
|
+
function getSelectAllState({ api }) {
|
|
20
|
+
const { selectedCount, total } = countSelectedRows({
|
|
21
|
+
api
|
|
22
|
+
});
|
|
23
|
+
if (!api.config.server) {
|
|
24
|
+
const checked = total > 0 && selectedCount === total;
|
|
25
|
+
return {
|
|
26
|
+
checked,
|
|
27
|
+
indeterminate: selectedCount > 0 && !checked
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
if (api.state.selectionMode !== 'all') {
|
|
31
|
+
return {
|
|
32
|
+
checked: false,
|
|
33
|
+
indeterminate: selectedCount > 0
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
const checked = api.selectionExcept.size === 0;
|
|
37
|
+
return {
|
|
38
|
+
checked,
|
|
39
|
+
indeterminate: !checked
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
export default getSelectAllState;
|