@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,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 React from 'react';
|
|
16
|
+
const countFormat = new Intl.NumberFormat();
|
|
17
|
+
// Enum-like columns show the group value as the cell does (a tag, a status dot); other types
|
|
18
|
+
// show the label text in the column's display format.
|
|
19
|
+
const RENDERED_TYPES = new Set([
|
|
20
|
+
'tag',
|
|
21
|
+
'status'
|
|
22
|
+
]);
|
|
23
|
+
function ignoreEvent() {}
|
|
24
|
+
function renderValue({ api, item, label, level }) {
|
|
25
|
+
if (item.empty || !RENDERED_TYPES.has(level.column.type)) return label;
|
|
26
|
+
const { Renderer } = level;
|
|
27
|
+
// A client group's first row feeds the renderer's row fields; server groups have no rows here.
|
|
28
|
+
const row = api.grouping.tree ? api.grouping.tree.leaves[item.start].original : {};
|
|
29
|
+
return /*#__PURE__*/ React.createElement(Renderer, {
|
|
30
|
+
column: level.column,
|
|
31
|
+
components: api.components,
|
|
32
|
+
methods: api.methods,
|
|
33
|
+
onEvent: ignoreEvent,
|
|
34
|
+
row: row,
|
|
35
|
+
rowKey: api.config.getKey(row),
|
|
36
|
+
value: item.value
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// The chevron, group value and row count. It sits in a zero-width sticky element after the
|
|
40
|
+
// leading (checkbox) columns, so the label stays in view while the grid scrolls sideways and
|
|
41
|
+
// overlays the cells of the columns without an aggregate.
|
|
42
|
+
function GroupLabel({ api, item, label, left, level }) {
|
|
43
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
44
|
+
className: "lf-table-group-label",
|
|
45
|
+
style: {
|
|
46
|
+
left
|
|
47
|
+
}
|
|
48
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
49
|
+
className: "lf-table-group-label-content",
|
|
50
|
+
style: {
|
|
51
|
+
'--lf-group-depth': item.depth
|
|
52
|
+
}
|
|
53
|
+
}, /*#__PURE__*/ React.createElement("svg", {
|
|
54
|
+
"aria-hidden": "true",
|
|
55
|
+
className: "lf-table-group-toggle",
|
|
56
|
+
viewBox: "0 0 16 16"
|
|
57
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
58
|
+
d: "M6 3.5 10.5 8 6 12.5",
|
|
59
|
+
fill: "none",
|
|
60
|
+
stroke: "currentColor",
|
|
61
|
+
strokeWidth: "1.6"
|
|
62
|
+
})), /*#__PURE__*/ React.createElement("span", {
|
|
63
|
+
className: "lf-table-group-value"
|
|
64
|
+
}, renderValue({
|
|
65
|
+
api,
|
|
66
|
+
item,
|
|
67
|
+
label,
|
|
68
|
+
level
|
|
69
|
+
})), /*#__PURE__*/ React.createElement("span", {
|
|
70
|
+
className: "lf-table-group-count"
|
|
71
|
+
}, countFormat.format(item.count))));
|
|
72
|
+
}
|
|
73
|
+
export default GroupLabel;
|
|
@@ -0,0 +1,103 @@
|
|
|
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, { memo, useMemo } from 'react';
|
|
16
|
+
import countGroupSelection from './countGroupSelection.js';
|
|
17
|
+
import getGroupLabel from './getGroupLabel.js';
|
|
18
|
+
import GroupCell from './GroupCell.js';
|
|
19
|
+
import GroupLabel from './GroupLabel.js';
|
|
20
|
+
import './grouping.css';
|
|
21
|
+
function renderCells({ activeCol, api, cols, item, overlay, selectionCount }) {
|
|
22
|
+
return cols.map((col)=>/*#__PURE__*/ React.createElement(GroupCell, {
|
|
23
|
+
api: api,
|
|
24
|
+
col: col,
|
|
25
|
+
focused: activeCol === col.index,
|
|
26
|
+
item: item,
|
|
27
|
+
key: col.key,
|
|
28
|
+
overlay: overlay,
|
|
29
|
+
selectionCount: selectionCount
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
// A group header item of the flat row list (the `group` row renderer). Same row element, height
|
|
33
|
+
// and cell layout as a data row; it carries `data-group-key` and no `data-row-key`, so row
|
|
34
|
+
// events, rowLink and row selection ignore it. `overlay` renders the sticky copy. Client groups
|
|
35
|
+
// (flattenGroups) and server groups (buildServerItems) are the same items and render here.
|
|
36
|
+
function GroupRow({ activeCol, api, ariaRowIndex, centerCols, className, displayIndex, endCols, item, offset, overlay = false, selectable, selection, startCols, style }) {
|
|
37
|
+
const { grouping } = api;
|
|
38
|
+
const level = grouping.levels[item.depth];
|
|
39
|
+
// Server groups have no leaf rows in the browser to count or select.
|
|
40
|
+
const checkbox = selectable && api.config.rowSelection.type === 'checkbox' && grouping.tree !== null;
|
|
41
|
+
const selectionCount = useMemo(()=>checkbox ? countGroupSelection({
|
|
42
|
+
leaves: grouping.tree.leaves,
|
|
43
|
+
start: item.start,
|
|
44
|
+
end: item.end,
|
|
45
|
+
selection
|
|
46
|
+
}) : null, [
|
|
47
|
+
checkbox,
|
|
48
|
+
item,
|
|
49
|
+
selection
|
|
50
|
+
]);
|
|
51
|
+
const label = getGroupLabel({
|
|
52
|
+
level,
|
|
53
|
+
item
|
|
54
|
+
});
|
|
55
|
+
const leading = startCols.filter((col)=>col.special);
|
|
56
|
+
const pinned = startCols.filter((col)=>!col.special);
|
|
57
|
+
const labelLeft = leading.reduce((width, col)=>width + col.width, 0);
|
|
58
|
+
const positioned = offset !== undefined;
|
|
59
|
+
const cellArgs = {
|
|
60
|
+
activeCol,
|
|
61
|
+
api,
|
|
62
|
+
item,
|
|
63
|
+
overlay,
|
|
64
|
+
selectionCount
|
|
65
|
+
};
|
|
66
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
67
|
+
"aria-expanded": !item.collapsed,
|
|
68
|
+
"aria-rowindex": overlay ? undefined : ariaRowIndex,
|
|
69
|
+
className: `${className} lf-table-group-row`,
|
|
70
|
+
"data-group-depth": item.depth,
|
|
71
|
+
"data-group-index": displayIndex,
|
|
72
|
+
"data-group-key": item.key,
|
|
73
|
+
"data-group-label": label,
|
|
74
|
+
"data-positioned": positioned ? '' : undefined,
|
|
75
|
+
"data-row-index": overlay ? undefined : displayIndex,
|
|
76
|
+
role: overlay ? undefined : 'row',
|
|
77
|
+
style: positioned ? {
|
|
78
|
+
...style,
|
|
79
|
+
transform: `translateY(${offset}px)`
|
|
80
|
+
} : style
|
|
81
|
+
}, renderCells({
|
|
82
|
+
...cellArgs,
|
|
83
|
+
cols: leading
|
|
84
|
+
}), /*#__PURE__*/ React.createElement(GroupLabel, {
|
|
85
|
+
api: api,
|
|
86
|
+
item: item,
|
|
87
|
+
label: label,
|
|
88
|
+
left: labelLeft,
|
|
89
|
+
level: level
|
|
90
|
+
}), renderCells({
|
|
91
|
+
...cellArgs,
|
|
92
|
+
cols: pinned
|
|
93
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
94
|
+
className: "lf-table-center"
|
|
95
|
+
}, renderCells({
|
|
96
|
+
...cellArgs,
|
|
97
|
+
cols: centerCols
|
|
98
|
+
})), renderCells({
|
|
99
|
+
...cellArgs,
|
|
100
|
+
cols: endCols
|
|
101
|
+
}));
|
|
102
|
+
}
|
|
103
|
+
export default /*#__PURE__*/ memo(GroupRow);
|
|
@@ -0,0 +1,136 @@
|
|
|
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, useMemo, useReducer, useRef } from 'react';
|
|
16
|
+
import { flushSync } from 'react-dom';
|
|
17
|
+
import buildStickyLevels from './buildStickyLevels.js';
|
|
18
|
+
import getStickyGroups from './getStickyGroups.js';
|
|
19
|
+
import GroupRow from './GroupRow.js';
|
|
20
|
+
function bump(count) {
|
|
21
|
+
return count + 1;
|
|
22
|
+
}
|
|
23
|
+
function measure({ api, headerHeight, levels, sticky }) {
|
|
24
|
+
const scroller = api.scrollerRef.current;
|
|
25
|
+
if (!api.grouping || !scroller) return [];
|
|
26
|
+
// Body offset of the first row under the header: with a sticky header the body starts where
|
|
27
|
+
// the header sits; a non-sticky header scrolls away first.
|
|
28
|
+
const scrollTop = sticky ? scroller.scrollTop : scroller.scrollTop - headerHeight;
|
|
29
|
+
return getStickyGroups({
|
|
30
|
+
levels,
|
|
31
|
+
rowHeight: api.rowHeight,
|
|
32
|
+
rowOffsets: api.rowOffsets,
|
|
33
|
+
scrollTop
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
function sameIndices(groups, indices) {
|
|
37
|
+
if (groups.length !== indices.length) return false;
|
|
38
|
+
return groups.every((group, level)=>group.index === indices[level]);
|
|
39
|
+
}
|
|
40
|
+
// The sticky group headers (D10.8): one overlay under the column header holding a copy of the
|
|
41
|
+
// current group header of each level, stacked outermost first (EMEA, then its rep), instead of
|
|
42
|
+
// a sticky element per group. It renders only when a level's group changes; the push-ups as the
|
|
43
|
+
// next headers arrive are transforms written on scroll. Inner levels sit under outer ones, so a
|
|
44
|
+
// new outer group pushes them out first.
|
|
45
|
+
function StickyGroupRow({ api, centerCols, headerHeight, layout, rowClassName, rows, selectable, selection, sticky }) {
|
|
46
|
+
const [, forceRender] = useReducer(bump, 0);
|
|
47
|
+
const shiftRefs = useRef([]);
|
|
48
|
+
const renderedIndices = useRef([]);
|
|
49
|
+
// Null while the table is not grouped (the overlay then renders nothing).
|
|
50
|
+
const { grouping } = api;
|
|
51
|
+
const groupIndices = grouping?.groupIndices;
|
|
52
|
+
const levelCount = grouping?.levels.length ?? 0;
|
|
53
|
+
const levels = useMemo(()=>grouping ? buildStickyLevels({
|
|
54
|
+
groupIndices,
|
|
55
|
+
levelCount,
|
|
56
|
+
rows
|
|
57
|
+
}) : [], [
|
|
58
|
+
groupIndices,
|
|
59
|
+
levelCount,
|
|
60
|
+
rows
|
|
61
|
+
]);
|
|
62
|
+
const args = useRef(null);
|
|
63
|
+
args.current = {
|
|
64
|
+
api,
|
|
65
|
+
headerHeight,
|
|
66
|
+
levels,
|
|
67
|
+
sticky
|
|
68
|
+
};
|
|
69
|
+
useEffect(()=>{
|
|
70
|
+
const element = api.scrollerRef.current;
|
|
71
|
+
let frame = 0;
|
|
72
|
+
function onFrame() {
|
|
73
|
+
frame = 0;
|
|
74
|
+
const next = measure(args.current);
|
|
75
|
+
if (!sameIndices(next, renderedIndices.current)) {
|
|
76
|
+
flushSync(forceRender);
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
next.forEach((group, level)=>{
|
|
80
|
+
const shift = shiftRefs.current[level];
|
|
81
|
+
if (shift) shift.style.transform = `translateY(${group.shift}px)`;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
function schedule() {
|
|
85
|
+
if (!frame) frame = requestAnimationFrame(onFrame);
|
|
86
|
+
}
|
|
87
|
+
element.addEventListener('scroll', schedule, {
|
|
88
|
+
passive: true
|
|
89
|
+
});
|
|
90
|
+
return ()=>{
|
|
91
|
+
element.removeEventListener('scroll', schedule);
|
|
92
|
+
if (frame) cancelAnimationFrame(frame);
|
|
93
|
+
};
|
|
94
|
+
}, []);
|
|
95
|
+
// Read in render so the overlay always matches the rows it is rendered with (a collapse changes
|
|
96
|
+
// which list index is the current group without any scroll).
|
|
97
|
+
const groups = measure(args.current);
|
|
98
|
+
renderedIndices.current = groups.map((group)=>group.index);
|
|
99
|
+
if (groups.length === 0) return null;
|
|
100
|
+
// tabIndex: a click on the overlay focuses it rather than the scroller, whose focus handler
|
|
101
|
+
// would scroll back to the active cell before the click lands.
|
|
102
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
103
|
+
"aria-hidden": "true",
|
|
104
|
+
className: "lf-table-group-sticky",
|
|
105
|
+
"data-lf-group-sticky": "",
|
|
106
|
+
style: {
|
|
107
|
+
top: sticky ? headerHeight : 0
|
|
108
|
+
},
|
|
109
|
+
tabIndex: -1
|
|
110
|
+
}, groups.map((group, level)=>/*#__PURE__*/ React.createElement("div", {
|
|
111
|
+
className: "lf-table-group-sticky-shift",
|
|
112
|
+
"data-group-level": level,
|
|
113
|
+
key: level,
|
|
114
|
+
ref: (element)=>{
|
|
115
|
+
shiftRefs.current[level] = element;
|
|
116
|
+
},
|
|
117
|
+
style: {
|
|
118
|
+
top: level * api.rowHeight,
|
|
119
|
+
transform: `translateY(${group.shift}px)`,
|
|
120
|
+
zIndex: groups.length - level
|
|
121
|
+
}
|
|
122
|
+
}, /*#__PURE__*/ React.createElement(GroupRow, {
|
|
123
|
+
activeCol: -1,
|
|
124
|
+
api: api,
|
|
125
|
+
centerCols: centerCols,
|
|
126
|
+
className: rowClassName,
|
|
127
|
+
displayIndex: group.index,
|
|
128
|
+
endCols: layout.end,
|
|
129
|
+
item: rows[group.index],
|
|
130
|
+
overlay: true,
|
|
131
|
+
selectable: selectable,
|
|
132
|
+
selection: selection,
|
|
133
|
+
startCols: layout.start
|
|
134
|
+
}))));
|
|
135
|
+
}
|
|
136
|
+
export default StickyGroupRow;
|
|
@@ -0,0 +1,138 @@
|
|
|
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 computeAggregate from '@lowdefy/blocks-antd/table/computeAggregate.js';
|
|
16
|
+
import orderGroups from './orderGroups.js';
|
|
17
|
+
import toGroupIdentity from './toGroupIdentity.js';
|
|
18
|
+
function createNode({ parent, identity, value, depth, level, last, aggregateCount }) {
|
|
19
|
+
const path = [
|
|
20
|
+
...parent.path,
|
|
21
|
+
identity
|
|
22
|
+
];
|
|
23
|
+
const values = new Array(aggregateCount);
|
|
24
|
+
for(let a = 0; a < aggregateCount; a++)values[a] = [];
|
|
25
|
+
return {
|
|
26
|
+
aggregates: {},
|
|
27
|
+
children: last ? null : [],
|
|
28
|
+
childMap: last ? null : new Map(),
|
|
29
|
+
columnKey: level.key,
|
|
30
|
+
count: 0,
|
|
31
|
+
depth,
|
|
32
|
+
empty: identity === null,
|
|
33
|
+
end: 0,
|
|
34
|
+
key: JSON.stringify(path),
|
|
35
|
+
path,
|
|
36
|
+
rows: last ? [] : null,
|
|
37
|
+
start: 0,
|
|
38
|
+
value: identity === null ? null : value,
|
|
39
|
+
values
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
// Orders each level, lays the leaf rows out in group order (every group owns the leaf range
|
|
43
|
+
// [start, end), so a group's rows are one slice however deep it is), and turns the collected
|
|
44
|
+
// values into aggregates. The build-only fields are dropped so the tree holds no second copy.
|
|
45
|
+
function finalizeGroups({ groups, levels, aggregates, leaves, depth }) {
|
|
46
|
+
const ordered = orderGroups({
|
|
47
|
+
groups,
|
|
48
|
+
level: levels[depth]
|
|
49
|
+
});
|
|
50
|
+
ordered.forEach((group)=>{
|
|
51
|
+
group.start = leaves.length;
|
|
52
|
+
if (group.children === null) {
|
|
53
|
+
for(let i = 0; i < group.rows.length; i++)leaves.push(group.rows[i]);
|
|
54
|
+
} else {
|
|
55
|
+
group.children = finalizeGroups({
|
|
56
|
+
groups: group.children,
|
|
57
|
+
levels,
|
|
58
|
+
aggregates,
|
|
59
|
+
leaves,
|
|
60
|
+
depth: depth + 1
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
group.end = leaves.length;
|
|
64
|
+
group.count = group.end - group.start;
|
|
65
|
+
aggregates.forEach(({ key, fn, column }, a)=>{
|
|
66
|
+
group.aggregates[key] = computeAggregate({
|
|
67
|
+
fn,
|
|
68
|
+
values: group.values[a],
|
|
69
|
+
column
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
group.values = null;
|
|
73
|
+
group.childMap = null;
|
|
74
|
+
group.rows = null;
|
|
75
|
+
});
|
|
76
|
+
return ordered;
|
|
77
|
+
}
|
|
78
|
+
// The group tree in one pass over the filtered, sorted rows: each row walks the levels, creating
|
|
79
|
+
// groups on first sight, counting itself and collecting its aggregate values into every group on
|
|
80
|
+
// its path. Leaves keep the sort order within their group. `rows` are row-model rows
|
|
81
|
+
// ({ id, original }); `levels` come from createGroupLevels and `aggregates` from
|
|
82
|
+
// createAggregateColumns.
|
|
83
|
+
function buildGroupTree({ rows, levels, aggregates }) {
|
|
84
|
+
const root = {
|
|
85
|
+
path: [],
|
|
86
|
+
children: [],
|
|
87
|
+
childMap: new Map()
|
|
88
|
+
};
|
|
89
|
+
const groupsByKey = new Map();
|
|
90
|
+
const lastDepth = levels.length - 1;
|
|
91
|
+
const aggregateCount = aggregates.length;
|
|
92
|
+
const aggregateValues = new Array(aggregateCount);
|
|
93
|
+
for(let i = 0; i < rows.length; i++){
|
|
94
|
+
const row = rows[i];
|
|
95
|
+
const original = row.original;
|
|
96
|
+
for(let a = 0; a < aggregateCount; a++){
|
|
97
|
+
aggregateValues[a] = aggregates[a].accessor(original);
|
|
98
|
+
}
|
|
99
|
+
let parent = root;
|
|
100
|
+
for(let depth = 0; depth <= lastDepth; depth++){
|
|
101
|
+
const level = levels[depth];
|
|
102
|
+
const value = level.accessor(original);
|
|
103
|
+
const identity = toGroupIdentity(value);
|
|
104
|
+
let group = parent.childMap.get(identity);
|
|
105
|
+
if (group === undefined) {
|
|
106
|
+
group = createNode({
|
|
107
|
+
parent,
|
|
108
|
+
identity,
|
|
109
|
+
value,
|
|
110
|
+
depth,
|
|
111
|
+
level,
|
|
112
|
+
last: depth === lastDepth,
|
|
113
|
+
aggregateCount
|
|
114
|
+
});
|
|
115
|
+
parent.childMap.set(identity, group);
|
|
116
|
+
parent.children.push(group);
|
|
117
|
+
groupsByKey.set(group.key, group);
|
|
118
|
+
}
|
|
119
|
+
for(let a = 0; a < aggregateCount; a++)group.values[a].push(aggregateValues[a]);
|
|
120
|
+
parent = group;
|
|
121
|
+
}
|
|
122
|
+
parent.rows.push(row);
|
|
123
|
+
}
|
|
124
|
+
const leaves = [];
|
|
125
|
+
const groups = finalizeGroups({
|
|
126
|
+
groups: root.children,
|
|
127
|
+
levels,
|
|
128
|
+
aggregates,
|
|
129
|
+
leaves,
|
|
130
|
+
depth: 0
|
|
131
|
+
});
|
|
132
|
+
return {
|
|
133
|
+
groups,
|
|
134
|
+
groupsByKey,
|
|
135
|
+
leaves
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
export default buildGroupTree;
|
|
@@ -0,0 +1,35 @@
|
|
|
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
|
+
*/ // Per group level, the list indices of that level's headers (`own`) and of the headers at that
|
|
16
|
+
// level or above (`upTo`, the headers that end a group of that level), for the stacked sticky
|
|
17
|
+
// headers' binary searches. Built once per display list.
|
|
18
|
+
function buildStickyLevels({ groupIndices, levelCount, rows }) {
|
|
19
|
+
const own = Array.from({
|
|
20
|
+
length: levelCount
|
|
21
|
+
}, ()=>[]);
|
|
22
|
+
const upTo = Array.from({
|
|
23
|
+
length: levelCount
|
|
24
|
+
}, ()=>[]);
|
|
25
|
+
for (const index of groupIndices){
|
|
26
|
+
const { depth } = rows[index];
|
|
27
|
+
own[depth].push(index);
|
|
28
|
+
for(let level = depth; level < levelCount; level++)upTo[level].push(index);
|
|
29
|
+
}
|
|
30
|
+
return own.map((indices, level)=>({
|
|
31
|
+
own: Uint32Array.from(indices),
|
|
32
|
+
upTo: Uint32Array.from(upTo[level])
|
|
33
|
+
}));
|
|
34
|
+
}
|
|
35
|
+
export default buildStickyLevels;
|
|
@@ -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
|
+
*/ // How many of a group's leaf rows are selected, for its checkbox (checked, indeterminate).
|
|
16
|
+
function countGroupSelection({ leaves, start, end, selection }) {
|
|
17
|
+
let selected = 0;
|
|
18
|
+
for(let i = start; i < end; i++){
|
|
19
|
+
if (selection[leaves[i].id] === true) selected += 1;
|
|
20
|
+
}
|
|
21
|
+
return {
|
|
22
|
+
selected,
|
|
23
|
+
total: end - start
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export default countGroupSelection;
|
|
@@ -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 resolveAggregates from './resolveAggregates.js';
|
|
16
|
+
// The aggregates in effect with each column's accessor, and a key -> fn map for the header cells.
|
|
17
|
+
function createAggregateColumns({ config, table, aggregates }) {
|
|
18
|
+
const columns = resolveAggregates({
|
|
19
|
+
columns: config.columns,
|
|
20
|
+
aggregates
|
|
21
|
+
}).map(({ key, fn })=>{
|
|
22
|
+
const { accessor, column } = table.getColumn(key).columnDef.meta;
|
|
23
|
+
return {
|
|
24
|
+
key,
|
|
25
|
+
fn,
|
|
26
|
+
accessor,
|
|
27
|
+
column
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
return {
|
|
31
|
+
columns,
|
|
32
|
+
fnByKey: new Map(columns.map(({ key, fn })=>[
|
|
33
|
+
key,
|
|
34
|
+
fn
|
|
35
|
+
]))
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
export default createAggregateColumns;
|
|
@@ -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
|
+
*/ // Collapses every group at every level of the current grouping (server mode: closes every open
|
|
16
|
+
// server group).
|
|
17
|
+
function createCollapseAllGroups(api) {
|
|
18
|
+
return function collapseAllGroups() {
|
|
19
|
+
if (!api.grouping) return false;
|
|
20
|
+
if (api.serverStore) return api.serverStore.collapseAllGroups();
|
|
21
|
+
return api.actions.setCollapsedGroups([
|
|
22
|
+
...api.grouping.tree.groupsByKey.keys()
|
|
23
|
+
]);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
export default createCollapseAllGroups;
|
|
@@ -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
|
+
*/ // Expands every client group. Server groups open one at a time: opening all of them would fetch
|
|
16
|
+
// every group's rows.
|
|
17
|
+
function createExpandAllGroups(api) {
|
|
18
|
+
return function expandAllGroups() {
|
|
19
|
+
if (api.serverStore) return false;
|
|
20
|
+
return api.actions.setCollapsedGroups([]);
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
export default createExpandAllGroups;
|
|
@@ -0,0 +1,46 @@
|
|
|
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 createComparator from '@lowdefy/blocks-antd/table/createComparator.js';
|
|
16
|
+
import getCellRenderer from '@lowdefy/blocks-antd/table/getCellRenderer.js';
|
|
17
|
+
// One entry per group level with what the tree build and the header rows need: the column's
|
|
18
|
+
// compiled accessor, the shared core's value comparator and cell renderer, its options (already
|
|
19
|
+
// normalised by the shared normalizeColumns), and how its groups are ordered ('sort' when the
|
|
20
|
+
// view sorts on the column, 'options' for enum columns, else 'appearance').
|
|
21
|
+
function createGroupLevels({ keys, table, sorting }) {
|
|
22
|
+
return keys.map((key)=>{
|
|
23
|
+
const { accessor, column } = table.getColumn(key).columnDef.meta;
|
|
24
|
+
const sort = sorting.find((entry)=>entry.id === key);
|
|
25
|
+
const { options } = column;
|
|
26
|
+
let order = 'appearance';
|
|
27
|
+
if (sort) {
|
|
28
|
+
order = 'sort';
|
|
29
|
+
} else if (options?.length > 0) {
|
|
30
|
+
order = 'options';
|
|
31
|
+
}
|
|
32
|
+
return {
|
|
33
|
+
key,
|
|
34
|
+
accessor,
|
|
35
|
+
column,
|
|
36
|
+
compare: createComparator({
|
|
37
|
+
column
|
|
38
|
+
}),
|
|
39
|
+
desc: sort?.desc === true,
|
|
40
|
+
options,
|
|
41
|
+
order,
|
|
42
|
+
Renderer: getCellRenderer(column.type)
|
|
43
|
+
};
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
export default createGroupLevels;
|
|
@@ -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
|
+
*/ // Replaces the collapsed group keys. A no-op change never reaches updateSlice, whose pending
|
|
16
|
+
// cause would otherwise attach to the next unrelated state change.
|
|
17
|
+
function createSetCollapsedGroups(api) {
|
|
18
|
+
return function setCollapsedGroups(keys) {
|
|
19
|
+
const current = api.state.collapsedGroups;
|
|
20
|
+
if (keys.length === current.length && keys.every((key, i)=>key === current[i])) return false;
|
|
21
|
+
api.updateSlice('collapsedGroups', ()=>keys, {
|
|
22
|
+
cause: 'expand'
|
|
23
|
+
});
|
|
24
|
+
return true;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export default createSetCollapsedGroups;
|