@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,78 @@
|
|
|
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 { useMemo, useRef } from 'react';
|
|
16
|
+
import isDataItem from './isDataItem.js';
|
|
17
|
+
function combineHeights(heightFns) {
|
|
18
|
+
if (heightFns.length === 0) return null;
|
|
19
|
+
if (heightFns.length === 1) return heightFns[0];
|
|
20
|
+
return function rowHeights(item, index) {
|
|
21
|
+
for(let f = 0; f < heightFns.length; f++){
|
|
22
|
+
const height = heightFns[f](item, index);
|
|
23
|
+
if (height !== undefined) return height;
|
|
24
|
+
}
|
|
25
|
+
return undefined;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
// Stage 5 of the data pipeline (see TableRoot): the display list the body windows over. It starts
|
|
29
|
+
// as TanStack's row model rows; each `useItems(ctx)` hook, in registry order, may return
|
|
30
|
+
// `{ rows }` to replace it with display items: server mode's rows, group headers and `undefined`
|
|
31
|
+
// holes for rows not loaded yet; client grouping's group headers; tree rows with a depth;
|
|
32
|
+
// expanded detail rows after their row; and last the current page. A TanStack row is a data item
|
|
33
|
+
// as it is; other items carry `kind` ('row' for wrapped data rows, 'group', 'detail') and `key`
|
|
34
|
+
// (wrapped rows: `id` and `original`). A hook returns null when it has nothing to change.
|
|
35
|
+
//
|
|
36
|
+
// A hook may also return:
|
|
37
|
+
// - `dataRows`: the view's data rows in display order when the list leaves some out (rows in
|
|
38
|
+
// collapsed groups, other pages). The first hook's wins (it saw the most); export and the
|
|
39
|
+
// summary read `api.dataRows`. By default it is the list's data items.
|
|
40
|
+
// - `rowHeights(item, index)`: the height estimate of items that are not one row high (a detail
|
|
41
|
+
// row before it is measured), or undefined. The window then positions items by offsets built
|
|
42
|
+
// from measured heights and these estimates (virtualization's useRowOffsets).
|
|
43
|
+
function useFeatureItems(ctx) {
|
|
44
|
+
let rows = ctx.rows;
|
|
45
|
+
let dataRows = null;
|
|
46
|
+
const heightFns = [];
|
|
47
|
+
ctx.api.features.list.forEach((feature)=>{
|
|
48
|
+
if (!feature.useItems) return;
|
|
49
|
+
const result = feature.useItems({
|
|
50
|
+
...ctx,
|
|
51
|
+
rows
|
|
52
|
+
});
|
|
53
|
+
if (!result) return;
|
|
54
|
+
if (!dataRows && result.dataRows) dataRows = result.dataRows;
|
|
55
|
+
rows = result.rows;
|
|
56
|
+
if (result.rowHeights) heightFns.push(result.rowHeights);
|
|
57
|
+
});
|
|
58
|
+
const listDataRows = useMemo(()=>rows === ctx.rows ? rows : rows.filter(isDataItem), [
|
|
59
|
+
rows,
|
|
60
|
+
ctx.rows
|
|
61
|
+
]);
|
|
62
|
+
// Memoised by hand: the number of height functions changes with config.
|
|
63
|
+
const memo = useRef({
|
|
64
|
+
heightFns: [],
|
|
65
|
+
rowHeights: null
|
|
66
|
+
});
|
|
67
|
+
const same = heightFns.length === memo.current.heightFns.length && heightFns.every((fn, index)=>fn === memo.current.heightFns[index]);
|
|
68
|
+
if (!same) memo.current = {
|
|
69
|
+
heightFns,
|
|
70
|
+
rowHeights: combineHeights(heightFns)
|
|
71
|
+
};
|
|
72
|
+
return {
|
|
73
|
+
dataRows: dataRows ?? listDataRows,
|
|
74
|
+
rowHeights: memo.current.rowHeights,
|
|
75
|
+
rows
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export default useFeatureItems;
|
|
@@ -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
|
+
*/ import { useEffect } from 'react';
|
|
16
|
+
// Registers the features' block methods (exportCsv, scrollToRow, clearSelection, ...) once per
|
|
17
|
+
// engine methods object. Each method reads the live table through the API object.
|
|
18
|
+
function useFeatureMethods({ api, methods }) {
|
|
19
|
+
useEffect(()=>{
|
|
20
|
+
api.features.list.forEach((feature)=>{
|
|
21
|
+
Object.entries(feature.methods ?? {}).forEach(([name, create])=>{
|
|
22
|
+
methods.registerMethod(name, create(api));
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}, [
|
|
26
|
+
methods
|
|
27
|
+
]);
|
|
28
|
+
}
|
|
29
|
+
export default useFeatureMethods;
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
*/ // Stage 3 of the data pipeline (see TableRoot): the rows TanStack sees, after they are diffed by
|
|
16
|
+
// key. Each `useRows(ctx)` hook, in registry order, returns the rows the next one sees:
|
|
17
|
+
// transactions keep `applyTransaction` results over the rows until the app's data changes, then
|
|
18
|
+
// editing lays its optimistic overlay (Table) or its changeset (TableInput) over them, never
|
|
19
|
+
// writing `data`. These hooks see rows whose identity only changes when their content does, so
|
|
20
|
+
// they can hold state on them. A hook returns its input rows (the same array) when it has nothing
|
|
21
|
+
// to add, which keeps every row model memo warm.
|
|
22
|
+
function useFeatureRows({ api, config, input, properties, rows }) {
|
|
23
|
+
let result = rows;
|
|
24
|
+
api.features.list.forEach((feature)=>{
|
|
25
|
+
if (!feature.useRows) return;
|
|
26
|
+
result = feature.useRows({
|
|
27
|
+
api,
|
|
28
|
+
config,
|
|
29
|
+
input,
|
|
30
|
+
properties,
|
|
31
|
+
rows: result
|
|
32
|
+
});
|
|
33
|
+
});
|
|
34
|
+
return result;
|
|
35
|
+
}
|
|
36
|
+
export default useFeatureRows;
|
|
@@ -0,0 +1,54 @@
|
|
|
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 createFeatureSet from './createFeatureSet.js';
|
|
16
|
+
import createMethodStubs from './createMethodStubs.js';
|
|
17
|
+
import features from '../features/index.js';
|
|
18
|
+
import loadOptionalFeature from './loadOptionalFeature.js';
|
|
19
|
+
const sets = new Map();
|
|
20
|
+
// The feature set a table renders with (`TableRoot`'s `features`, then `api.features`): the
|
|
21
|
+
// always-on features and the optional ones its config needs (editing, server mode, group rows,
|
|
22
|
+
// trees, expandable rows, the toolbar, saved views), in registry order. Until the needed chunks
|
|
23
|
+
// have loaded this suspends, so the lazy block's fallback stays up and its methods are registered
|
|
24
|
+
// only once the whole table is there. Sets are shared by signature (the needed optional names);
|
|
25
|
+
// the table remounts when its signature changes (Table.lazy keys TableRoot on it).
|
|
26
|
+
function useFeatureSet({ content, input, properties, rowWindowStrategy }) {
|
|
27
|
+
const context = {
|
|
28
|
+
content,
|
|
29
|
+
input: input === true,
|
|
30
|
+
properties,
|
|
31
|
+
rowWindowStrategy
|
|
32
|
+
};
|
|
33
|
+
const needed = features.filter((entry)=>entry.optional && entry.needs(context));
|
|
34
|
+
const signature = needed.map((entry)=>entry.name).join(',');
|
|
35
|
+
const existing = sets.get(signature);
|
|
36
|
+
if (existing !== undefined) return existing;
|
|
37
|
+
const records = needed.map(loadOptionalFeature);
|
|
38
|
+
const failed = records.find((record)=>record.error !== null);
|
|
39
|
+
if (failed) throw failed.error;
|
|
40
|
+
const pending = records.filter((record)=>record.feature === null);
|
|
41
|
+
if (pending.length > 0) throw Promise.all(pending.map((record)=>record.promise));
|
|
42
|
+
const list = features.map((entry)=>{
|
|
43
|
+
if (!entry.optional) return entry;
|
|
44
|
+
const index = needed.indexOf(entry);
|
|
45
|
+
return index === -1 ? createMethodStubs(entry) : records[index].feature;
|
|
46
|
+
});
|
|
47
|
+
const set = {
|
|
48
|
+
...createFeatureSet(list),
|
|
49
|
+
signature
|
|
50
|
+
};
|
|
51
|
+
sets.set(signature, set);
|
|
52
|
+
return set;
|
|
53
|
+
}
|
|
54
|
+
export default useFeatureSet;
|
|
@@ -0,0 +1,38 @@
|
|
|
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 { useEffect } from 'react';
|
|
16
|
+
import { type } from '@lowdefy/helpers';
|
|
17
|
+
import isSelectAllValue from '../features/selection/isSelectAllValue.js';
|
|
18
|
+
// Selected keys can name rows that are not loaded (`rowSelection.preserve`). TanStack keeps them
|
|
19
|
+
// as string ids; this remembers each key's own value so the selection writes back unchanged. The
|
|
20
|
+
// same holds for the `except` keys of an `{ all: true, except }` selection.
|
|
21
|
+
function useForeignKeys({ api, selected }) {
|
|
22
|
+
useEffect(()=>{
|
|
23
|
+
if (isSelectAllValue(selected)) {
|
|
24
|
+
api.selectionExcept = new Map((selected.except ?? []).filter((key)=>!type.isNone(key)).map((key)=>[
|
|
25
|
+
String(key),
|
|
26
|
+
key
|
|
27
|
+
]));
|
|
28
|
+
return;
|
|
29
|
+
}
|
|
30
|
+
if (!type.isArray(selected)) return;
|
|
31
|
+
selected.forEach((key)=>{
|
|
32
|
+
if (!type.isNone(key)) api.foreignKeys.set(String(key), key);
|
|
33
|
+
});
|
|
34
|
+
}, [
|
|
35
|
+
selected
|
|
36
|
+
]);
|
|
37
|
+
}
|
|
38
|
+
export default useForeignKeys;
|
|
@@ -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
|
+
*/ // Grid-level feature hooks (virtualisation, keyboard, ...) in registry order. Each receives the
|
|
16
|
+
// grid context with the earlier hooks' results merged in (keyboard reads virtualisation's
|
|
17
|
+
// `range`). The registry is a module constant, so the hook order never changes between renders.
|
|
18
|
+
function useGridFeatures(gridCtx) {
|
|
19
|
+
const ctx = gridCtx;
|
|
20
|
+
ctx.api.features.list.forEach((feature)=>{
|
|
21
|
+
if (!feature.useGridFeature) return;
|
|
22
|
+
Object.assign(ctx, feature.useGridFeature(ctx));
|
|
23
|
+
});
|
|
24
|
+
return ctx;
|
|
25
|
+
}
|
|
26
|
+
export default useGridFeatures;
|
|
@@ -0,0 +1,34 @@
|
|
|
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 { useRef } from 'react';
|
|
16
|
+
// Config objects (columns, defaultView, rowSelection, ...) are small but the engine hands the
|
|
17
|
+
// block a fresh copy whenever any property is re-evaluated. Comparing their JSON keeps downstream
|
|
18
|
+
// memos (column model, TanStack column defs) from rebuilding for identical config. Never use this
|
|
19
|
+
// for `data`, which is diffed by row key instead.
|
|
20
|
+
function useStableConfig(value) {
|
|
21
|
+
const ref = useRef({
|
|
22
|
+
json: undefined,
|
|
23
|
+
value: undefined
|
|
24
|
+
});
|
|
25
|
+
const json = JSON.stringify(value ?? null);
|
|
26
|
+
if (ref.current.json !== json) {
|
|
27
|
+
ref.current = {
|
|
28
|
+
json,
|
|
29
|
+
value
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
return ref.current.value;
|
|
33
|
+
}
|
|
34
|
+
export default useStableConfig;
|
|
@@ -0,0 +1,73 @@
|
|
|
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 { useMemo } from 'react';
|
|
16
|
+
import computeAggregate from '@lowdefy/blocks-antd/table/computeAggregate.js';
|
|
17
|
+
import getAggregateText from '@lowdefy/blocks-antd/table/getAggregateText.js';
|
|
18
|
+
import createAccessor from './createAccessor.js';
|
|
19
|
+
import resolveAggregates from '../features/grouping/resolveAggregates.js';
|
|
20
|
+
function computeClientValue({ column, fn, rows }) {
|
|
21
|
+
const accessor = createAccessor(column.field);
|
|
22
|
+
const values = new Array(rows.length);
|
|
23
|
+
for(let i = 0; i < rows.length; i++)values[i] = accessor(rows[i].original);
|
|
24
|
+
return computeAggregate({
|
|
25
|
+
fn,
|
|
26
|
+
values,
|
|
27
|
+
column
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
// The summary footer's values: the aggregates in effect (the view's `aggregates` over each
|
|
31
|
+
// column's `aggregate` default, the same ones the group headers show), over all the table's
|
|
32
|
+
// filtered rows (not a page, not the rendered window) with the shared column core, as TableLight
|
|
33
|
+
// does. Keyed on the unsorted row model, so a sort never recomputes them. In server mode the
|
|
34
|
+
// browser holds only some rows, so the values are the root list's `aggregates` from the
|
|
35
|
+
// server's responses. Null when there is nothing to show (`summary: false`, or no aggregates).
|
|
36
|
+
function useSummary({ api, config, state, table }) {
|
|
37
|
+
const rows = table.getPreSortedRowModel().rows;
|
|
38
|
+
const store = api.serverStore;
|
|
39
|
+
const serverAggregates = store ? store.getAggregates() : null;
|
|
40
|
+
return useMemo(()=>{
|
|
41
|
+
if (!config.summary) return null;
|
|
42
|
+
const resolved = resolveAggregates({
|
|
43
|
+
columns: config.columns,
|
|
44
|
+
aggregates: state.aggregates
|
|
45
|
+
});
|
|
46
|
+
if (resolved.length === 0) return null;
|
|
47
|
+
const byKey = new Map();
|
|
48
|
+
resolved.forEach(({ key, fn })=>{
|
|
49
|
+
const column = config.columnsByKey.get(key);
|
|
50
|
+
const value = store ? serverAggregates?.[key] ?? null : computeClientValue({
|
|
51
|
+
column,
|
|
52
|
+
fn,
|
|
53
|
+
rows
|
|
54
|
+
});
|
|
55
|
+
byKey.set(key, {
|
|
56
|
+
fn,
|
|
57
|
+
text: getAggregateText({
|
|
58
|
+
fn,
|
|
59
|
+
value,
|
|
60
|
+
column
|
|
61
|
+
})
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
return byKey;
|
|
65
|
+
}, [
|
|
66
|
+
config,
|
|
67
|
+
rows,
|
|
68
|
+
state.aggregates,
|
|
69
|
+
store,
|
|
70
|
+
serverAggregates
|
|
71
|
+
]);
|
|
72
|
+
}
|
|
73
|
+
export default useSummary;
|
|
@@ -0,0 +1,189 @@
|
|
|
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 { useMemo } from 'react';
|
|
16
|
+
import { type } from '@lowdefy/helpers';
|
|
17
|
+
import compileColumns from '@lowdefy/blocks-antd/table/compileColumns.js';
|
|
18
|
+
import compileRules from '@lowdefy/blocks-antd/table/compileRules.js';
|
|
19
|
+
import createRowKeyGetter from '@lowdefy/blocks-antd/table/createRowKeyGetter.js';
|
|
20
|
+
import normalizeColumns from '@lowdefy/blocks-antd/table/normalizeColumns.js';
|
|
21
|
+
import createColumnDefs from './createColumnDefs.js';
|
|
22
|
+
import densityHeights from './densityHeights.js';
|
|
23
|
+
import getHeaderLevels from './getHeaderLevels.js';
|
|
24
|
+
import normalizeExpandable from '../features/expandable/normalizeExpandable.js';
|
|
25
|
+
import normalizeServerData from '../features/serverData/normalizeServerData.js';
|
|
26
|
+
import normalizeTree from '../features/tree/normalizeTree.js';
|
|
27
|
+
import normalizePersist from '../features/views/normalizePersist.js';
|
|
28
|
+
import normalizeToolbar from '../features/toolbar/normalizeToolbar.js';
|
|
29
|
+
import useStableConfig from './useStableConfig.js';
|
|
30
|
+
const DEFAULT_PAGE_SIZE = 50;
|
|
31
|
+
// In server mode rows leave the block cache while they stay selected, so selection is always
|
|
32
|
+
// preserved there.
|
|
33
|
+
function normalizeRowSelection({ rowSelection, server }) {
|
|
34
|
+
if (!type.isObject(rowSelection)) return null;
|
|
35
|
+
return {
|
|
36
|
+
type: rowSelection.type === 'radio' ? 'radio' : 'checkbox',
|
|
37
|
+
preserve: rowSelection.preserve === true || Boolean(server),
|
|
38
|
+
cascade: rowSelection.cascade === true
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// Pagination has TableLight's meaning when it is set (`true` always shows the pager), but it is
|
|
42
|
+
// off unless asked for: the Table scrolls any number of rows virtually. Server mode loads rows in
|
|
43
|
+
// blocks as they scroll into view, which is its own paging.
|
|
44
|
+
function normalizePagination({ pagination, pageSize, server }) {
|
|
45
|
+
if (pagination !== true) return null;
|
|
46
|
+
if (server) {
|
|
47
|
+
throw new Error('Table "pagination" needs client data; server mode loads rows in blocks while scrolling.');
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
pageSize: type.isInt(pageSize) && pageSize > 0 ? pageSize : DEFAULT_PAGE_SIZE
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
// Everything derived from properties except `data`, memoised on config content rather than
|
|
54
|
+
// identity, so a re-evaluated but unchanged property set leaves the column model alone. Columns
|
|
55
|
+
// go through the shared column core (`@lowdefy/blocks-antd/table`), the same normalisation and
|
|
56
|
+
// compiled rules, tooltips and templates TableLight uses.
|
|
57
|
+
function useTableConfig({ properties }) {
|
|
58
|
+
const columnsConfig = useStableConfig(properties.columns);
|
|
59
|
+
const defaultColumn = useStableConfig(properties.defaultColumn);
|
|
60
|
+
const defaultView = useStableConfig(properties.defaultView);
|
|
61
|
+
const rowSelection = useStableConfig(properties.rowSelection);
|
|
62
|
+
const rowLink = useStableConfig(properties.rowLink);
|
|
63
|
+
const rowRules = useStableConfig(properties.rowRules);
|
|
64
|
+
const user = useStableConfig(properties.user);
|
|
65
|
+
// Client `data` is an array of rows, never compared here; server mode is a small object.
|
|
66
|
+
const serverData = useStableConfig(type.isObject(properties.data) ? properties.data : null);
|
|
67
|
+
const tree = useStableConfig(properties.tree);
|
|
68
|
+
const expandable = useStableConfig(properties.expandable);
|
|
69
|
+
const toolbar = useStableConfig(properties.toolbar);
|
|
70
|
+
const persist = useStableConfig(properties.persist);
|
|
71
|
+
const keyboard = useStableConfig(properties.keyboard);
|
|
72
|
+
const getKey = useMemo(()=>createRowKeyGetter({
|
|
73
|
+
rowKey: properties.rowKey
|
|
74
|
+
}), [
|
|
75
|
+
properties.rowKey
|
|
76
|
+
]);
|
|
77
|
+
const columnModel = useMemo(()=>{
|
|
78
|
+
const normalized = normalizeColumns({
|
|
79
|
+
columns: columnsConfig,
|
|
80
|
+
defaultColumn
|
|
81
|
+
});
|
|
82
|
+
// `$user` values resolve from an empty user when the app sets none.
|
|
83
|
+
const configUser = user ?? {};
|
|
84
|
+
const columns = compileColumns({
|
|
85
|
+
columns: normalized.columns,
|
|
86
|
+
columnsByKey: normalized.columnsByKey,
|
|
87
|
+
user: configUser
|
|
88
|
+
});
|
|
89
|
+
return {
|
|
90
|
+
columns,
|
|
91
|
+
columnsByKey: new Map(columns.map((column)=>[
|
|
92
|
+
column.key,
|
|
93
|
+
column
|
|
94
|
+
])),
|
|
95
|
+
columnDefs: createColumnDefs({
|
|
96
|
+
columns
|
|
97
|
+
}),
|
|
98
|
+
expandable: normalizeExpandable({
|
|
99
|
+
expandable,
|
|
100
|
+
columns,
|
|
101
|
+
user: configUser
|
|
102
|
+
}),
|
|
103
|
+
headerLevels: getHeaderLevels({
|
|
104
|
+
headerGroups: normalized.headerGroups
|
|
105
|
+
}),
|
|
106
|
+
rowRules: compileRules({
|
|
107
|
+
rules: rowRules,
|
|
108
|
+
columnsByKey: normalized.columnsByKey,
|
|
109
|
+
user: configUser
|
|
110
|
+
}),
|
|
111
|
+
user: configUser
|
|
112
|
+
};
|
|
113
|
+
}, [
|
|
114
|
+
columnsConfig,
|
|
115
|
+
defaultColumn,
|
|
116
|
+
expandable,
|
|
117
|
+
rowRules,
|
|
118
|
+
user
|
|
119
|
+
]);
|
|
120
|
+
return useMemo(()=>{
|
|
121
|
+
const server = normalizeServerData(serverData);
|
|
122
|
+
return {
|
|
123
|
+
...columnModel,
|
|
124
|
+
bordered: properties.bordered === true,
|
|
125
|
+
defaultDensity: type.isUndefined(densityHeights[properties.size]) ? 'default' : properties.size,
|
|
126
|
+
defaultView: defaultView ?? {},
|
|
127
|
+
emptyText: properties.emptyText ?? 'No data',
|
|
128
|
+
getId: (row)=>String(getKey(row)),
|
|
129
|
+
getKey,
|
|
130
|
+
headerMenu: properties.headerMenu !== false,
|
|
131
|
+
height: properties.height,
|
|
132
|
+
keyboard: keyboard !== false,
|
|
133
|
+
keyboardNext: keyboard?.next === true,
|
|
134
|
+
maxHeight: properties.maxHeight ?? 600,
|
|
135
|
+
pagination: normalizePagination({
|
|
136
|
+
pagination: properties.pagination,
|
|
137
|
+
pageSize: properties.pageSize,
|
|
138
|
+
server
|
|
139
|
+
}),
|
|
140
|
+
persist: normalizePersist(persist),
|
|
141
|
+
reorderable: properties.reorderable !== false,
|
|
142
|
+
rowHeight: properties.rowHeight,
|
|
143
|
+
rowLink: type.isObject(rowLink) ? rowLink : null,
|
|
144
|
+
rowSelection: normalizeRowSelection({
|
|
145
|
+
rowSelection,
|
|
146
|
+
server
|
|
147
|
+
}),
|
|
148
|
+
rowVersionField: properties.rowVersionField,
|
|
149
|
+
server,
|
|
150
|
+
stickyHeader: properties.stickyHeader !== false,
|
|
151
|
+
summary: properties.summary !== false,
|
|
152
|
+
tree: normalizeTree({
|
|
153
|
+
tree,
|
|
154
|
+
server
|
|
155
|
+
}),
|
|
156
|
+
toolbar: normalizeToolbar({
|
|
157
|
+
toolbar,
|
|
158
|
+
columnsByKey: columnModel.columnsByKey
|
|
159
|
+
}),
|
|
160
|
+
virtual: properties.virtual ?? 'auto'
|
|
161
|
+
};
|
|
162
|
+
}, [
|
|
163
|
+
columnModel,
|
|
164
|
+
defaultView,
|
|
165
|
+
getKey,
|
|
166
|
+
properties.bordered,
|
|
167
|
+
keyboard,
|
|
168
|
+
persist,
|
|
169
|
+
properties.emptyText,
|
|
170
|
+
properties.headerMenu,
|
|
171
|
+
properties.height,
|
|
172
|
+
properties.maxHeight,
|
|
173
|
+
properties.pageSize,
|
|
174
|
+
properties.pagination,
|
|
175
|
+
properties.reorderable,
|
|
176
|
+
properties.rowHeight,
|
|
177
|
+
properties.rowVersionField,
|
|
178
|
+
properties.size,
|
|
179
|
+
properties.stickyHeader,
|
|
180
|
+
properties.summary,
|
|
181
|
+
properties.virtual,
|
|
182
|
+
rowLink,
|
|
183
|
+
rowSelection,
|
|
184
|
+
serverData,
|
|
185
|
+
tree,
|
|
186
|
+
toolbar
|
|
187
|
+
]);
|
|
188
|
+
}
|
|
189
|
+
export default useTableConfig;
|