@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,69 @@
|
|
|
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 yieldToMain from './yieldToMain.js';
|
|
16
|
+
const RUN = 1024;
|
|
17
|
+
function merge({ source, target, start, middle, end, compare }) {
|
|
18
|
+
let left = start;
|
|
19
|
+
let right = middle;
|
|
20
|
+
for(let i = start; i < end; i++){
|
|
21
|
+
if (left < middle && (right >= end || compare(source[left], source[right]) <= 0)) {
|
|
22
|
+
target[i] = source[left];
|
|
23
|
+
left += 1;
|
|
24
|
+
} else {
|
|
25
|
+
target[i] = source[right];
|
|
26
|
+
right += 1;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
// A stable bottom-up merge sort that yields to the browser whenever a slice has run for
|
|
31
|
+
// `budgetMs`, so sorting 100k strings with Intl.Collator never blocks the main thread for long.
|
|
32
|
+
async function sortInSlices({ items, compare, budgetMs = 12 }) {
|
|
33
|
+
const count = items.length;
|
|
34
|
+
let source = items.slice();
|
|
35
|
+
let target = new Array(count);
|
|
36
|
+
let sliceStart = performance.now();
|
|
37
|
+
async function maybeYield() {
|
|
38
|
+
if (performance.now() - sliceStart < budgetMs) return;
|
|
39
|
+
await yieldToMain();
|
|
40
|
+
sliceStart = performance.now();
|
|
41
|
+
}
|
|
42
|
+
for(let start = 0; start < count; start += RUN){
|
|
43
|
+
const end = Math.min(start + RUN, count);
|
|
44
|
+
const run = source.slice(start, end).sort(compare);
|
|
45
|
+
for(let i = 0; i < run.length; i++)source[start + i] = run[i];
|
|
46
|
+
await maybeYield();
|
|
47
|
+
}
|
|
48
|
+
for(let width = RUN; width < count; width *= 2){
|
|
49
|
+
for(let start = 0; start < count; start += 2 * width){
|
|
50
|
+
const middle = Math.min(start + width, count);
|
|
51
|
+
const end = Math.min(start + 2 * width, count);
|
|
52
|
+
merge({
|
|
53
|
+
source,
|
|
54
|
+
target,
|
|
55
|
+
start,
|
|
56
|
+
middle,
|
|
57
|
+
end,
|
|
58
|
+
compare
|
|
59
|
+
});
|
|
60
|
+
await maybeYield();
|
|
61
|
+
}
|
|
62
|
+
[source, target] = [
|
|
63
|
+
target,
|
|
64
|
+
source
|
|
65
|
+
];
|
|
66
|
+
}
|
|
67
|
+
return source;
|
|
68
|
+
}
|
|
69
|
+
export default sortInSlices;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // The display order of `count` rows as a Uint32Array of row indices, sorted over precomputed
|
|
16
|
+
// Float64 keys per sort entry (`[{ keys, desc }]`) instead of row objects. Ties keep source
|
|
17
|
+
// order, and empty values (NaN keys) sort last whichever the direction.
|
|
18
|
+
function sortIndices({ count, entries }) {
|
|
19
|
+
const order = new Uint32Array(count);
|
|
20
|
+
for(let i = 0; i < count; i++)order[i] = i;
|
|
21
|
+
const entryCount = entries.length;
|
|
22
|
+
order.sort((a, b)=>{
|
|
23
|
+
for(let e = 0; e < entryCount; e++){
|
|
24
|
+
const { keys, desc } = entries[e];
|
|
25
|
+
const left = keys[a];
|
|
26
|
+
const right = keys[b];
|
|
27
|
+
if (left !== right) {
|
|
28
|
+
const leftEmpty = Number.isNaN(left);
|
|
29
|
+
const rightEmpty = Number.isNaN(right);
|
|
30
|
+
if (leftEmpty && rightEmpty) continue;
|
|
31
|
+
if (leftEmpty) return 1;
|
|
32
|
+
if (rightEmpty) return -1;
|
|
33
|
+
return desc ? right - left : left - right;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return a - b;
|
|
37
|
+
});
|
|
38
|
+
return order;
|
|
39
|
+
}
|
|
40
|
+
export default sortIndices;
|
|
@@ -0,0 +1,19 @@
|
|
|
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
|
+
*/ // Sort keys only depend on the pre-sorted rows array and the column, so toggling direction or
|
|
16
|
+
// adding a second sort column reuses keys already built for this data. Keyed weakly by the rows
|
|
17
|
+
// array: new data drops its keys with it.
|
|
18
|
+
const sortKeysCache = new WeakMap();
|
|
19
|
+
export default sortKeysCache;
|
|
@@ -0,0 +1,84 @@
|
|
|
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 getSortKeys from './getSortKeys.js';
|
|
16
|
+
import sortIndices from './sortIndices.js';
|
|
17
|
+
// Sort keys are built for the core rows, whatever subset is sorted: a filtered subset (every
|
|
18
|
+
// row still a core row) reads its keys through the rows' core index, so a filter change never
|
|
19
|
+
// rebuilds a column's keys (a text column's collator ranking is the slow part). Rows that are
|
|
20
|
+
// not core rows (grouped rows) get keys of their own.
|
|
21
|
+
function getSubsetKeys({ table, rows }) {
|
|
22
|
+
const coreRows = table.getCoreRowModel().rows;
|
|
23
|
+
if (rows === coreRows) return {
|
|
24
|
+
keyRows: rows,
|
|
25
|
+
positions: null
|
|
26
|
+
};
|
|
27
|
+
const positions = new Uint32Array(rows.length);
|
|
28
|
+
for(let i = 0; i < rows.length; i++){
|
|
29
|
+
const row = rows[i];
|
|
30
|
+
if (coreRows[row.index] !== row) return {
|
|
31
|
+
keyRows: rows,
|
|
32
|
+
positions: null
|
|
33
|
+
};
|
|
34
|
+
positions[i] = row.index;
|
|
35
|
+
}
|
|
36
|
+
return {
|
|
37
|
+
keyRows: coreRows,
|
|
38
|
+
positions
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
// Sorts row indices over precomputed keys (the shared core's sort keys, see buildSortKeys)
|
|
42
|
+
// instead of sorting row objects with a comparator that reads values on every call (D10.7).
|
|
43
|
+
function sortRowModel(table) {
|
|
44
|
+
const preSorted = table.getPreSortedRowModel();
|
|
45
|
+
const sorting = table.atoms.sorting?.get();
|
|
46
|
+
const rows = preSorted.rows;
|
|
47
|
+
if (!rows.length || !sorting?.length) return preSorted;
|
|
48
|
+
const { keyRows, positions } = getSubsetKeys({
|
|
49
|
+
table,
|
|
50
|
+
rows
|
|
51
|
+
});
|
|
52
|
+
const entries = [];
|
|
53
|
+
sorting.forEach((sort)=>{
|
|
54
|
+
const column = table.getColumn(sort.id);
|
|
55
|
+
if (!column || !column.getCanSort()) return;
|
|
56
|
+
const columnKeys = getSortKeys({
|
|
57
|
+
rows: keyRows,
|
|
58
|
+
column
|
|
59
|
+
});
|
|
60
|
+
let keys = columnKeys;
|
|
61
|
+
if (positions !== null) {
|
|
62
|
+
keys = new Float64Array(rows.length);
|
|
63
|
+
for(let i = 0; i < rows.length; i++)keys[i] = columnKeys[positions[i]];
|
|
64
|
+
}
|
|
65
|
+
entries.push({
|
|
66
|
+
keys,
|
|
67
|
+
desc: sort.desc === true
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
if (!entries.length) return preSorted;
|
|
71
|
+
const count = rows.length;
|
|
72
|
+
const order = sortIndices({
|
|
73
|
+
count,
|
|
74
|
+
entries
|
|
75
|
+
});
|
|
76
|
+
const sortedRows = new Array(count);
|
|
77
|
+
for(let i = 0; i < count; i++)sortedRows[i] = rows[order[i]];
|
|
78
|
+
return {
|
|
79
|
+
rows: sortedRows,
|
|
80
|
+
flatRows: sortedRows,
|
|
81
|
+
rowsById: preSorted.rowsById
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
export default sortRowModel;
|
|
@@ -0,0 +1,62 @@
|
|
|
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 { rowSortingFeature } from '@tanstack/react-table';
|
|
16
|
+
import createClearSort from './createClearSort.js';
|
|
17
|
+
import createIndexSortedRowModel from './createIndexSortedRowModel.js';
|
|
18
|
+
import createSetSort from './createSetSort.js';
|
|
19
|
+
import createToggleSort from './createToggleSort.js';
|
|
20
|
+
import getSortHeaderProps from './getSortHeaderProps.js';
|
|
21
|
+
import handleSortClick from './handleSortClick.js';
|
|
22
|
+
import initSorting from './initSorting.js';
|
|
23
|
+
import SortIndicator from './SortIndicator.js';
|
|
24
|
+
import sortingToValue from './sortingToValue.js';
|
|
25
|
+
const sortingFeature = {
|
|
26
|
+
name: 'sorting',
|
|
27
|
+
tableFeatures: {
|
|
28
|
+
rowSortingFeature,
|
|
29
|
+
sortedRowModel: createIndexSortedRowModel()
|
|
30
|
+
},
|
|
31
|
+
viewKeys: [
|
|
32
|
+
'sort'
|
|
33
|
+
],
|
|
34
|
+
slices: {
|
|
35
|
+
// Applied in a transition: the header click paints at once and the old order stays (dimmed)
|
|
36
|
+
// until the sorted rows land.
|
|
37
|
+
sorting: {
|
|
38
|
+
init: initSorting,
|
|
39
|
+
cause: 'sort',
|
|
40
|
+
transition: true
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
tableOptions: ()=>({
|
|
44
|
+
enableMultiSort: true,
|
|
45
|
+
enableSortingRemoval: true,
|
|
46
|
+
isMultiSortEvent: (event)=>event.shiftKey === true
|
|
47
|
+
}),
|
|
48
|
+
toValue: sortingToValue,
|
|
49
|
+
actions: {
|
|
50
|
+
toggleSort: createToggleSort,
|
|
51
|
+
setSort: createSetSort,
|
|
52
|
+
clearSort: createClearSort
|
|
53
|
+
},
|
|
54
|
+
headerParts: [
|
|
55
|
+
SortIndicator
|
|
56
|
+
],
|
|
57
|
+
headerCellProps: getSortHeaderProps,
|
|
58
|
+
gridHandlers: {
|
|
59
|
+
click: handleSortClick
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
export default sortingFeature;
|
|
@@ -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
|
+
*/ function sortingToValue({ state }) {
|
|
16
|
+
return {
|
|
17
|
+
view: {
|
|
18
|
+
sort: state.sorting.map((sort)=>sort.desc ? {
|
|
19
|
+
key: sort.id,
|
|
20
|
+
desc: true
|
|
21
|
+
} : {
|
|
22
|
+
key: sort.id
|
|
23
|
+
})
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export default sortingToValue;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Numeric row keys as Float64 sort keys, empty (null) keys as NaN.
|
|
16
|
+
function toFloatSortKeys(rowKeys) {
|
|
17
|
+
const keys = new Float64Array(rowKeys.length);
|
|
18
|
+
for(let i = 0; i < rowKeys.length; i++){
|
|
19
|
+
const key = rowKeys[i];
|
|
20
|
+
keys[i] = key === null ? NaN : key;
|
|
21
|
+
}
|
|
22
|
+
return keys;
|
|
23
|
+
}
|
|
24
|
+
export default toFloatSortKeys;
|
|
@@ -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
|
+
*/ // Gives the browser a turn (input, paint) between slices of long work. A MessageChannel message
|
|
16
|
+
// is not clamped the way nested setTimeout(0) calls are.
|
|
17
|
+
function yieldToMain() {
|
|
18
|
+
return new Promise((resolve)=>{
|
|
19
|
+
const channel = new MessageChannel();
|
|
20
|
+
channel.port1.onmessage = ()=>{
|
|
21
|
+
channel.port1.close();
|
|
22
|
+
resolve();
|
|
23
|
+
};
|
|
24
|
+
channel.port2.postMessage(null);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
export default yieldToMain;
|
|
@@ -0,0 +1,28 @@
|
|
|
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 { renderHtml } from '@lowdefy/block-utils';
|
|
16
|
+
import htmlToText from '@lowdefy/blocks-antd/table/htmlToText.js';
|
|
17
|
+
import getPlainTitle from '../filtering/getPlainTitle.js';
|
|
18
|
+
// Column titles may be HTML; the toolbar shows them the way the header does. An empty title shows
|
|
19
|
+
// the column's key-based label (getPlainTitle).
|
|
20
|
+
function ColumnTitle({ api, column }) {
|
|
21
|
+
const html = String(column.title ?? '');
|
|
22
|
+
if (htmlToText(html).trim() === '') return getPlainTitle(column);
|
|
23
|
+
return renderHtml({
|
|
24
|
+
html,
|
|
25
|
+
methods: api.methods
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
export default ColumnTitle;
|
|
@@ -0,0 +1,53 @@
|
|
|
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
|
+
import { Button, Segmented } from 'antd';
|
|
17
|
+
const OPTIONS = [
|
|
18
|
+
{
|
|
19
|
+
label: 'Compact',
|
|
20
|
+
value: 'compact'
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
label: 'Default',
|
|
24
|
+
value: 'default'
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
label: 'Comfortable',
|
|
28
|
+
value: 'comfortable'
|
|
29
|
+
}
|
|
30
|
+
];
|
|
31
|
+
// Row density, and the view's Wrap toggle (text-like columns wrap onto several lines).
|
|
32
|
+
function DensityToggle({ api }) {
|
|
33
|
+
const { wrap } = api.state;
|
|
34
|
+
return /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(Segmented, {
|
|
35
|
+
"aria-label": "Row density",
|
|
36
|
+
"data-lf-toolbar-density": "",
|
|
37
|
+
onChange: (density)=>api.updateSlice('density', ()=>density, {
|
|
38
|
+
cause: 'density'
|
|
39
|
+
}),
|
|
40
|
+
options: OPTIONS,
|
|
41
|
+
size: "small",
|
|
42
|
+
value: api.state.density
|
|
43
|
+
}), /*#__PURE__*/ React.createElement(Button, {
|
|
44
|
+
"aria-pressed": wrap,
|
|
45
|
+
"data-lf-toolbar-wrap": "",
|
|
46
|
+
onClick: ()=>api.updateSlice('wrap', (current)=>!current, {
|
|
47
|
+
cause: 'wrap'
|
|
48
|
+
}),
|
|
49
|
+
size: "small",
|
|
50
|
+
type: wrap ? 'primary' : 'default'
|
|
51
|
+
}, "Wrap"));
|
|
52
|
+
}
|
|
53
|
+
export default DensityToggle;
|
|
@@ -0,0 +1,56 @@
|
|
|
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, { Suspense } from 'react';
|
|
16
|
+
import { Button, Popover } from 'antd';
|
|
17
|
+
import countConditions from './countConditions.js';
|
|
18
|
+
import LazyFilterBuilder from '../filtering/LazyFilterBuilder.js';
|
|
19
|
+
import ToolbarCount from './ToolbarCount.js';
|
|
20
|
+
import ToolbarIcon from './ToolbarIcon.js';
|
|
21
|
+
// Opens the filter builder on the whole `view.filter`; the button counts its conditions. Edits go
|
|
22
|
+
// through applyFiltering, the one filter write path.
|
|
23
|
+
function FilterButton({ api }) {
|
|
24
|
+
const filter = api.state.filter ?? null;
|
|
25
|
+
const columns = api.config.columns.filter((column)=>column.filterable);
|
|
26
|
+
const content = /*#__PURE__*/ React.createElement("div", {
|
|
27
|
+
className: "lf-table-toolbar-popover",
|
|
28
|
+
"data-lf-toolbar-filter": ""
|
|
29
|
+
}, /*#__PURE__*/ React.createElement(Suspense, {
|
|
30
|
+
fallback: null
|
|
31
|
+
}, /*#__PURE__*/ React.createElement(LazyFilterBuilder, {
|
|
32
|
+
columns: columns,
|
|
33
|
+
condition: filter,
|
|
34
|
+
onChange: (condition)=>api.actions.applyFiltering({
|
|
35
|
+
filter: condition ?? null
|
|
36
|
+
}),
|
|
37
|
+
user: api.config.user
|
|
38
|
+
})));
|
|
39
|
+
return /*#__PURE__*/ React.createElement(Popover, {
|
|
40
|
+
content: content,
|
|
41
|
+
placement: "bottomLeft",
|
|
42
|
+
trigger: "click"
|
|
43
|
+
}, /*#__PURE__*/ React.createElement(Button, {
|
|
44
|
+
"data-lf-toolbar-button": "filter",
|
|
45
|
+
icon: /*#__PURE__*/ React.createElement(ToolbarIcon, {
|
|
46
|
+
api: api,
|
|
47
|
+
name: "filter"
|
|
48
|
+
}),
|
|
49
|
+
onFocus: LazyFilterBuilder.preload,
|
|
50
|
+
onPointerEnter: LazyFilterBuilder.preload,
|
|
51
|
+
size: "small"
|
|
52
|
+
}, "Filter", /*#__PURE__*/ React.createElement(ToolbarCount, {
|
|
53
|
+
count: countConditions(filter)
|
|
54
|
+
})));
|
|
55
|
+
}
|
|
56
|
+
export default FilterButton;
|
|
@@ -0,0 +1,51 @@
|
|
|
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
|
+
import { Button, Popover } from 'antd';
|
|
17
|
+
import ToolbarCount from './ToolbarCount.js';
|
|
18
|
+
import ToolbarIcon from './ToolbarIcon.js';
|
|
19
|
+
import ToolbarList from './ToolbarList.js';
|
|
20
|
+
// Group levels over the groupable columns, outermost first (grouping's setGroupKeys).
|
|
21
|
+
function GroupButton({ api, groupable }) {
|
|
22
|
+
const keys = api.state.grouping;
|
|
23
|
+
const available = groupable.filter((column)=>!keys.includes(column.key));
|
|
24
|
+
const content = /*#__PURE__*/ React.createElement("div", {
|
|
25
|
+
className: "lf-table-toolbar-popover",
|
|
26
|
+
"data-lf-toolbar-group": ""
|
|
27
|
+
}, /*#__PURE__*/ React.createElement(ToolbarList, {
|
|
28
|
+
addLabel: "Group by",
|
|
29
|
+
api: api,
|
|
30
|
+
available: available,
|
|
31
|
+
emptyText: "No grouping",
|
|
32
|
+
keys: keys,
|
|
33
|
+
name: "group",
|
|
34
|
+
onChange: (next)=>api.actions.setGroupKeys(next)
|
|
35
|
+
}));
|
|
36
|
+
return /*#__PURE__*/ React.createElement(Popover, {
|
|
37
|
+
content: content,
|
|
38
|
+
placement: "bottomLeft",
|
|
39
|
+
trigger: "click"
|
|
40
|
+
}, /*#__PURE__*/ React.createElement(Button, {
|
|
41
|
+
"data-lf-toolbar-button": "group",
|
|
42
|
+
icon: /*#__PURE__*/ React.createElement(ToolbarIcon, {
|
|
43
|
+
api: api,
|
|
44
|
+
name: "list"
|
|
45
|
+
}),
|
|
46
|
+
size: "small"
|
|
47
|
+
}, "Group", /*#__PURE__*/ React.createElement(ToolbarCount, {
|
|
48
|
+
count: keys.length
|
|
49
|
+
})));
|
|
50
|
+
}
|
|
51
|
+
export default GroupButton;
|
|
@@ -0,0 +1,72 @@
|
|
|
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
|
+
import { Button, Checkbox, Popover } from 'antd';
|
|
17
|
+
import ColumnTitle from './ColumnTitle.js';
|
|
18
|
+
import getQuickFilterValues from './getQuickFilterValues.js';
|
|
19
|
+
import setQuickFilterValues from './setQuickFilterValues.js';
|
|
20
|
+
import ToolbarIcon from './ToolbarIcon.js';
|
|
21
|
+
import useSyncedState from '../filtering/useSyncedState.js';
|
|
22
|
+
// The checkbox list of an enum column's chip. Filter writes apply in a transition after the rows
|
|
23
|
+
// are tested, so the checked values are local state (useSyncedState) that the committed filter
|
|
24
|
+
// replaces when it changes from elsewhere.
|
|
25
|
+
function OptionsQuickFilter({ api, column }) {
|
|
26
|
+
const { options } = column;
|
|
27
|
+
const [values, setValues] = useSyncedState({
|
|
28
|
+
value: getQuickFilterValues({
|
|
29
|
+
filter: api.state.filter,
|
|
30
|
+
key: column.key
|
|
31
|
+
}),
|
|
32
|
+
onChange: (next)=>api.actions.applyFiltering({
|
|
33
|
+
filter: (filter)=>setQuickFilterValues({
|
|
34
|
+
filter,
|
|
35
|
+
key: column.key,
|
|
36
|
+
values: next
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
});
|
|
40
|
+
const checked = options.map((option, index)=>values.includes(option.value) ? index : null).filter((index)=>index !== null);
|
|
41
|
+
const content = /*#__PURE__*/ React.createElement(Checkbox.Group, {
|
|
42
|
+
className: "lf-table-quick-filter-options",
|
|
43
|
+
"data-lf-quick-filter-options": column.key,
|
|
44
|
+
onChange: (indices)=>setValues(indices.map((index)=>options[index].value)),
|
|
45
|
+
options: options.map((option, index)=>({
|
|
46
|
+
label: option.label,
|
|
47
|
+
value: index
|
|
48
|
+
})),
|
|
49
|
+
value: checked
|
|
50
|
+
});
|
|
51
|
+
return /*#__PURE__*/ React.createElement(Popover, {
|
|
52
|
+
content: content,
|
|
53
|
+
placement: "bottomLeft",
|
|
54
|
+
trigger: "click"
|
|
55
|
+
}, /*#__PURE__*/ React.createElement(Button, {
|
|
56
|
+
className: "lf-table-quick-filter",
|
|
57
|
+
color: values.length > 0 ? 'primary' : 'default',
|
|
58
|
+
"data-active": values.length > 0 ? '' : undefined,
|
|
59
|
+
"data-lf-quick-filter": column.key,
|
|
60
|
+
size: "small",
|
|
61
|
+
variant: "outlined"
|
|
62
|
+
}, /*#__PURE__*/ React.createElement(ColumnTitle, {
|
|
63
|
+
api: api,
|
|
64
|
+
column: column
|
|
65
|
+
}), values.length > 0 ? /*#__PURE__*/ React.createElement("span", {
|
|
66
|
+
className: "lf-table-toolbar-count lf-table-quick-filter-count"
|
|
67
|
+
}, values.length) : null, /*#__PURE__*/ React.createElement(ToolbarIcon, {
|
|
68
|
+
api: api,
|
|
69
|
+
name: "chevron-down"
|
|
70
|
+
})));
|
|
71
|
+
}
|
|
72
|
+
export default OptionsQuickFilter;
|
|
@@ -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 React from 'react';
|
|
16
|
+
import { Button } from 'antd';
|
|
17
|
+
import ColumnTitle from './ColumnTitle.js';
|
|
18
|
+
import LazyColumnFilterPopover from '../filtering/LazyColumnFilterPopover.js';
|
|
19
|
+
import OptionsQuickFilter from './OptionsQuickFilter.js';
|
|
20
|
+
import ToolbarIcon from './ToolbarIcon.js';
|
|
21
|
+
// A quick filter chip (HubSpot-style) for one column. Enum columns (with `options`, normalised by
|
|
22
|
+
// the shared core) get a checkbox list that writes one `in` leaf through applyFiltering; other
|
|
23
|
+
// columns open the column's own filter.
|
|
24
|
+
function QuickFilter({ api, column }) {
|
|
25
|
+
if (column.options) return /*#__PURE__*/ React.createElement(OptionsQuickFilter, {
|
|
26
|
+
api: api,
|
|
27
|
+
column: column
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/ React.createElement(Button, {
|
|
30
|
+
className: "lf-table-quick-filter",
|
|
31
|
+
"data-lf-quick-filter": column.key,
|
|
32
|
+
onClick: ()=>api.actions.openColumnFilter({
|
|
33
|
+
key: column.key
|
|
34
|
+
}),
|
|
35
|
+
onFocus: LazyColumnFilterPopover.preload,
|
|
36
|
+
onPointerEnter: LazyColumnFilterPopover.preload,
|
|
37
|
+
size: "small"
|
|
38
|
+
}, /*#__PURE__*/ React.createElement(ColumnTitle, {
|
|
39
|
+
api: api,
|
|
40
|
+
column: column
|
|
41
|
+
}), /*#__PURE__*/ React.createElement(ToolbarIcon, {
|
|
42
|
+
api: api,
|
|
43
|
+
name: "chevron-down"
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
export default QuickFilter;
|