@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,210 @@
|
|
|
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 { DatePicker, Select, Space, Tag } from 'antd';
|
|
17
|
+
import { get, type } from '@lowdefy/helpers';
|
|
18
|
+
import CELL_TYPE_FAMILIES from '@lowdefy/blocks-antd/table/cellTypeFamilies.js';
|
|
19
|
+
import DraftInput from './DraftInput.js';
|
|
20
|
+
import DraftInputNumber from './DraftInputNumber.js';
|
|
21
|
+
import formatFilterDate from './formatFilterDate.js';
|
|
22
|
+
import getValueShape from './getValueShape.js';
|
|
23
|
+
import parseFilterDate from './parseFilterDate.js';
|
|
24
|
+
import RelativeDateEditor from './RelativeDateEditor.js';
|
|
25
|
+
const BOOLEAN_OPTIONS = [
|
|
26
|
+
{
|
|
27
|
+
value: true,
|
|
28
|
+
label: 'true'
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
value: false,
|
|
32
|
+
label: 'false'
|
|
33
|
+
}
|
|
34
|
+
];
|
|
35
|
+
function UserValue({ path, user, onClear }) {
|
|
36
|
+
const resolved = get(user, path);
|
|
37
|
+
const title = type.isNone(resolved) ? path : `${path}: ${resolved}`;
|
|
38
|
+
return /*#__PURE__*/ React.createElement(Tag, {
|
|
39
|
+
closable: true,
|
|
40
|
+
onClose: onClear,
|
|
41
|
+
title: title
|
|
42
|
+
}, "Current user");
|
|
43
|
+
}
|
|
44
|
+
function RangeNumbers({ value, onChange, size }) {
|
|
45
|
+
const [from, to] = type.isArray(value) ? value : [
|
|
46
|
+
null,
|
|
47
|
+
null
|
|
48
|
+
];
|
|
49
|
+
return /*#__PURE__*/ React.createElement(Space.Compact, {
|
|
50
|
+
size: size
|
|
51
|
+
}, /*#__PURE__*/ React.createElement(DraftInputNumber, {
|
|
52
|
+
"aria-label": "From",
|
|
53
|
+
onChange: (next)=>onChange([
|
|
54
|
+
next ?? null,
|
|
55
|
+
to ?? null
|
|
56
|
+
]),
|
|
57
|
+
placeholder: "From",
|
|
58
|
+
value: from
|
|
59
|
+
}), /*#__PURE__*/ React.createElement(DraftInputNumber, {
|
|
60
|
+
"aria-label": "To",
|
|
61
|
+
onChange: (next)=>onChange([
|
|
62
|
+
from ?? null,
|
|
63
|
+
next ?? null
|
|
64
|
+
]),
|
|
65
|
+
placeholder: "To",
|
|
66
|
+
value: to
|
|
67
|
+
}));
|
|
68
|
+
}
|
|
69
|
+
function RangeDates({ column, value, onChange, size }) {
|
|
70
|
+
const [from, to] = type.isArray(value) ? value : [
|
|
71
|
+
null,
|
|
72
|
+
null
|
|
73
|
+
];
|
|
74
|
+
return /*#__PURE__*/ React.createElement(DatePicker.RangePicker, {
|
|
75
|
+
allowEmpty: [
|
|
76
|
+
true,
|
|
77
|
+
true
|
|
78
|
+
],
|
|
79
|
+
onChange: (dates)=>onChange([
|
|
80
|
+
formatFilterDate({
|
|
81
|
+
column,
|
|
82
|
+
date: dates?.[0],
|
|
83
|
+
edge: 'start'
|
|
84
|
+
}),
|
|
85
|
+
formatFilterDate({
|
|
86
|
+
column,
|
|
87
|
+
date: dates?.[1],
|
|
88
|
+
edge: 'end'
|
|
89
|
+
})
|
|
90
|
+
]),
|
|
91
|
+
size: size,
|
|
92
|
+
value: [
|
|
93
|
+
parseFilterDate(from),
|
|
94
|
+
parseFilterDate(to)
|
|
95
|
+
]
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
// The value input for one condition, by the operator's value shape and the column's type family.
|
|
99
|
+
function ValueEditor({ column, op, value, onChange, user, size = 'small' }) {
|
|
100
|
+
const shape = getValueShape(op);
|
|
101
|
+
if (shape === 'none') return null;
|
|
102
|
+
if (type.isObject(value) && type.isString(value.$user)) {
|
|
103
|
+
return /*#__PURE__*/ React.createElement(UserValue, {
|
|
104
|
+
onClear: ()=>onChange(undefined),
|
|
105
|
+
path: value.$user,
|
|
106
|
+
user: user
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
const family = CELL_TYPE_FAMILIES[column.type];
|
|
110
|
+
// Columns come normalised by the shared core: options are [{ value, label, ... }].
|
|
111
|
+
const { options } = column;
|
|
112
|
+
const selectOptions = options?.map((option)=>({
|
|
113
|
+
value: option.value,
|
|
114
|
+
label: option.label
|
|
115
|
+
}));
|
|
116
|
+
if (shape === 'relative') {
|
|
117
|
+
return /*#__PURE__*/ React.createElement(RelativeDateEditor, {
|
|
118
|
+
onChange: onChange,
|
|
119
|
+
size: size,
|
|
120
|
+
value: value
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
if (shape === 'range') {
|
|
124
|
+
if (family === 'date') {
|
|
125
|
+
return /*#__PURE__*/ React.createElement(RangeDates, {
|
|
126
|
+
column: column,
|
|
127
|
+
onChange: onChange,
|
|
128
|
+
size: size,
|
|
129
|
+
value: value
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
return /*#__PURE__*/ React.createElement(RangeNumbers, {
|
|
133
|
+
onChange: onChange,
|
|
134
|
+
size: size,
|
|
135
|
+
value: value
|
|
136
|
+
});
|
|
137
|
+
}
|
|
138
|
+
if (shape === 'list') {
|
|
139
|
+
return /*#__PURE__*/ React.createElement(Select, {
|
|
140
|
+
"aria-label": "Values",
|
|
141
|
+
className: "lf-filter-value",
|
|
142
|
+
mode: selectOptions ? 'multiple' : 'tags',
|
|
143
|
+
onChange: (next)=>onChange(next.length ? next : undefined),
|
|
144
|
+
optionFilterProp: "label",
|
|
145
|
+
options: selectOptions,
|
|
146
|
+
placeholder: "Values",
|
|
147
|
+
size: size,
|
|
148
|
+
tokenSeparators: selectOptions ? undefined : [
|
|
149
|
+
','
|
|
150
|
+
],
|
|
151
|
+
value: type.isArray(value) ? value : []
|
|
152
|
+
});
|
|
153
|
+
}
|
|
154
|
+
if (selectOptions && (op === 'eq' || op === 'ne')) {
|
|
155
|
+
return /*#__PURE__*/ React.createElement(Select, {
|
|
156
|
+
"aria-label": "Value",
|
|
157
|
+
className: "lf-filter-value",
|
|
158
|
+
onChange: onChange,
|
|
159
|
+
optionFilterProp: "label",
|
|
160
|
+
options: selectOptions,
|
|
161
|
+
placeholder: "Value",
|
|
162
|
+
showSearch: true,
|
|
163
|
+
size: size,
|
|
164
|
+
value: value
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
if (family === 'boolean') {
|
|
168
|
+
return /*#__PURE__*/ React.createElement(Select, {
|
|
169
|
+
"aria-label": "Value",
|
|
170
|
+
className: "lf-filter-value",
|
|
171
|
+
onChange: onChange,
|
|
172
|
+
options: BOOLEAN_OPTIONS,
|
|
173
|
+
placeholder: "Value",
|
|
174
|
+
size: size,
|
|
175
|
+
value: value
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
if (family === 'number') {
|
|
179
|
+
return /*#__PURE__*/ React.createElement(DraftInputNumber, {
|
|
180
|
+
"aria-label": "Value",
|
|
181
|
+
className: "lf-filter-value",
|
|
182
|
+
onChange: onChange,
|
|
183
|
+
placeholder: "Value",
|
|
184
|
+
size: size,
|
|
185
|
+
value: value
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
if (family === 'date') {
|
|
189
|
+
return /*#__PURE__*/ React.createElement(DatePicker, {
|
|
190
|
+
"aria-label": "Value",
|
|
191
|
+
className: "lf-filter-value",
|
|
192
|
+
onChange: (date)=>onChange(formatFilterDate({
|
|
193
|
+
column,
|
|
194
|
+
date,
|
|
195
|
+
edge: op === 'after' ? 'end' : 'start'
|
|
196
|
+
}) ?? undefined),
|
|
197
|
+
size: size,
|
|
198
|
+
value: parseFilterDate(value)
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
return /*#__PURE__*/ React.createElement(DraftInput, {
|
|
202
|
+
"aria-label": "Value",
|
|
203
|
+
className: "lf-filter-value",
|
|
204
|
+
onChange: onChange,
|
|
205
|
+
placeholder: "Value",
|
|
206
|
+
size: size,
|
|
207
|
+
value: value
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
export default ValueEditor;
|
|
@@ -0,0 +1,95 @@
|
|
|
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 { type } from '@lowdefy/helpers';
|
|
16
|
+
import isEmptyValue from '@lowdefy/blocks-antd/table/isEmptyValue.js';
|
|
17
|
+
function buildNumber({ key, min, max }) {
|
|
18
|
+
const hasMin = !isEmptyValue(min);
|
|
19
|
+
const hasMax = !isEmptyValue(max);
|
|
20
|
+
if (hasMin && hasMax) return {
|
|
21
|
+
key,
|
|
22
|
+
op: 'between',
|
|
23
|
+
value: [
|
|
24
|
+
min,
|
|
25
|
+
max
|
|
26
|
+
]
|
|
27
|
+
};
|
|
28
|
+
if (hasMin) return {
|
|
29
|
+
key,
|
|
30
|
+
op: 'gte',
|
|
31
|
+
value: min
|
|
32
|
+
};
|
|
33
|
+
if (hasMax) return {
|
|
34
|
+
key,
|
|
35
|
+
op: 'lte',
|
|
36
|
+
value: max
|
|
37
|
+
};
|
|
38
|
+
return null;
|
|
39
|
+
}
|
|
40
|
+
function buildDate({ key, state }) {
|
|
41
|
+
if (state.mode === 'relative') return {
|
|
42
|
+
key,
|
|
43
|
+
op: 'within',
|
|
44
|
+
value: state.relative
|
|
45
|
+
};
|
|
46
|
+
if (isEmptyValue(state.from) && isEmptyValue(state.to)) return null;
|
|
47
|
+
// An open end stays null: `between` treats a missing bound as unbounded.
|
|
48
|
+
return {
|
|
49
|
+
key,
|
|
50
|
+
op: 'between',
|
|
51
|
+
value: [
|
|
52
|
+
state.from ?? null,
|
|
53
|
+
state.to ?? null
|
|
54
|
+
]
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
// The condition the simple column filter writes for its state, or null for "no filter".
|
|
58
|
+
function buildColumnFilter({ kind, key, state }) {
|
|
59
|
+
switch(kind){
|
|
60
|
+
case 'options':
|
|
61
|
+
return state.selected.length ? {
|
|
62
|
+
key,
|
|
63
|
+
op: 'in',
|
|
64
|
+
value: state.selected
|
|
65
|
+
} : null;
|
|
66
|
+
case 'text':
|
|
67
|
+
if (state.op === 'empty' || state.op === 'notEmpty') return {
|
|
68
|
+
key,
|
|
69
|
+
op: state.op
|
|
70
|
+
};
|
|
71
|
+
return isEmptyValue(state.value) ? null : {
|
|
72
|
+
key,
|
|
73
|
+
op: state.op,
|
|
74
|
+
value: state.value
|
|
75
|
+
};
|
|
76
|
+
case 'number':
|
|
77
|
+
return buildNumber({
|
|
78
|
+
key,
|
|
79
|
+
min: state.min,
|
|
80
|
+
max: state.max
|
|
81
|
+
});
|
|
82
|
+
case 'date':
|
|
83
|
+
return buildDate({
|
|
84
|
+
key,
|
|
85
|
+
state
|
|
86
|
+
});
|
|
87
|
+
default:
|
|
88
|
+
if (!type.isString(state.choice) || state.choice === 'any') return null;
|
|
89
|
+
return {
|
|
90
|
+
key,
|
|
91
|
+
op: state.choice
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
export default buildColumnFilter;
|
|
@@ -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 { type } from '@lowdefy/helpers';
|
|
16
|
+
import defaultRelativeDate from './defaultRelativeDate.js';
|
|
17
|
+
import getValueShape from './getValueShape.js';
|
|
18
|
+
// A new operator keeps the value when it has the same shape, turns a scalar into a one-item list
|
|
19
|
+
// (and back), and otherwise starts empty.
|
|
20
|
+
function changeLeafOperator({ leaf, op }) {
|
|
21
|
+
const from = getValueShape(leaf.op);
|
|
22
|
+
const to = getValueShape(op);
|
|
23
|
+
const next = {
|
|
24
|
+
key: leaf.key,
|
|
25
|
+
op
|
|
26
|
+
};
|
|
27
|
+
if (to === 'none') return next;
|
|
28
|
+
if (to === 'relative') {
|
|
29
|
+
next.value = from === 'relative' ? leaf.value : defaultRelativeDate;
|
|
30
|
+
return next;
|
|
31
|
+
}
|
|
32
|
+
if (from === to) {
|
|
33
|
+
if (!type.isUndefined(leaf.value)) next.value = leaf.value;
|
|
34
|
+
return next;
|
|
35
|
+
}
|
|
36
|
+
if (from === 'scalar' && to === 'list' && !type.isNone(leaf.value) && leaf.value !== '') {
|
|
37
|
+
next.value = [
|
|
38
|
+
leaf.value
|
|
39
|
+
];
|
|
40
|
+
}
|
|
41
|
+
if (from === 'list' && to === 'scalar' && type.isArray(leaf.value) && leaf.value.length > 0) {
|
|
42
|
+
next.value = leaf.value[0];
|
|
43
|
+
}
|
|
44
|
+
return next;
|
|
45
|
+
}
|
|
46
|
+
export default changeLeafOperator;
|
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import getSearchColumns from './getSearchColumns.js';
|
|
16
|
+
import isServerMode from './isServerMode.js';
|
|
17
|
+
import prepareFilterResult from './prepareFilterResult.js';
|
|
18
|
+
import pruneCondition from './pruneCondition.js';
|
|
19
|
+
function resolveFilter({ filter, current }) {
|
|
20
|
+
if (filter === undefined) return current;
|
|
21
|
+
if (typeof filter === 'function') return filter(current);
|
|
22
|
+
return filter;
|
|
23
|
+
}
|
|
24
|
+
// Action `applyFiltering({ filter, search })`, the one write path for `view.filter` and
|
|
25
|
+
// `view.search` from inside the table (methods, column filters, the toolbar). `filter` is a
|
|
26
|
+
// condition, null, or an updater of the current condition; `search` is text or null; either may
|
|
27
|
+
// be left out. The rows are tested first in time slices (prepareFilterResult, the table marked
|
|
28
|
+
// pending), then the state applies in a transition and the row model reads the prepared result.
|
|
29
|
+
// Edits build on the latest requested filter rather than the committed one, which lags while a
|
|
30
|
+
// transition is pending, and only the latest call applies when calls overlap.
|
|
31
|
+
function createApplyFiltering(api) {
|
|
32
|
+
let latest = 0;
|
|
33
|
+
return function applyFiltering({ filter, search }) {
|
|
34
|
+
const current = api.filtering.target ?? {
|
|
35
|
+
filter: api.state.filter,
|
|
36
|
+
search: api.state.search
|
|
37
|
+
};
|
|
38
|
+
const next = {
|
|
39
|
+
filter: resolveFilter({
|
|
40
|
+
filter,
|
|
41
|
+
current: current.filter
|
|
42
|
+
}),
|
|
43
|
+
search: search === undefined ? current.search : search
|
|
44
|
+
};
|
|
45
|
+
api.filtering.target = next;
|
|
46
|
+
latest += 1;
|
|
47
|
+
const call = latest;
|
|
48
|
+
function apply() {
|
|
49
|
+
const filterChanged = next.filter !== api.state.filter;
|
|
50
|
+
const searchChanged = next.search !== api.state.search;
|
|
51
|
+
if (filterChanged) api.updateSlice('filter', ()=>next.filter);
|
|
52
|
+
if (searchChanged) api.updateSlice('search', ()=>next.search);
|
|
53
|
+
// Nothing to commit means nothing will catch up with the request: drop it now.
|
|
54
|
+
if (!filterChanged && !searchChanged) api.filtering.target = null;
|
|
55
|
+
}
|
|
56
|
+
if (isServerMode(api.config)) {
|
|
57
|
+
apply();
|
|
58
|
+
return;
|
|
59
|
+
}
|
|
60
|
+
const root = api.rootRef.current;
|
|
61
|
+
root?.setAttribute('data-pending', '');
|
|
62
|
+
prepareFilterResult({
|
|
63
|
+
rows: api.table.getPreFilteredRowModel().rows,
|
|
64
|
+
condition: pruneCondition(next.filter),
|
|
65
|
+
search: next.search,
|
|
66
|
+
context: api.table.options.lowdefyFiltering,
|
|
67
|
+
searchColumns: getSearchColumns({
|
|
68
|
+
columns: api.config.columns,
|
|
69
|
+
columnVisibility: api.state.columnVisibility
|
|
70
|
+
})
|
|
71
|
+
}).then(()=>{
|
|
72
|
+
if (call !== latest) return;
|
|
73
|
+
root?.removeAttribute('data-pending');
|
|
74
|
+
apply();
|
|
75
|
+
});
|
|
76
|
+
};
|
|
77
|
+
}
|
|
78
|
+
export default createApplyFiltering;
|
|
@@ -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
|
+
*/ // Block method `clearFilters()`: removes every filter condition. The search stays; clear it with
|
|
16
|
+
// `setSearch(null)`.
|
|
17
|
+
function createClearFilters(api) {
|
|
18
|
+
return function clearFilters() {
|
|
19
|
+
api.actions.applyFiltering({
|
|
20
|
+
filter: null
|
|
21
|
+
});
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
export default createClearFilters;
|
|
@@ -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 focusHeaderControl from '../headerMenu/focusHeaderControl.js';
|
|
16
|
+
// Action `closeColumnFilter({ restoreFocus })`: closes the popover; after Escape, focus returns to
|
|
17
|
+
// the column's menu button (or its header cell) so keyboard users stay where they were.
|
|
18
|
+
function createCloseColumnFilter(api) {
|
|
19
|
+
return function closeColumnFilter({ restoreFocus } = {}) {
|
|
20
|
+
const key = api.columnFilter.openKey;
|
|
21
|
+
api.columnFilter.setOpenKey(null);
|
|
22
|
+
if (restoreFocus && key !== null) focusHeaderControl({
|
|
23
|
+
api,
|
|
24
|
+
key
|
|
25
|
+
});
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export default createCloseColumnFilter;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { tableMemo } from '@tanstack/react-table';
|
|
16
|
+
import filterRowModel from './filterRowModel.js';
|
|
17
|
+
// TanStack's `filteredRowModel` slot, the first stage after the core rows (filter, then sort).
|
|
18
|
+
// It recomputes only when the rows, the filter or the search change (and, while searching, the
|
|
19
|
+
// visible columns), so an unchanged filter never re-runs.
|
|
20
|
+
function createConditionFilteredRowModel() {
|
|
21
|
+
return function getFilteredRowModel(table) {
|
|
22
|
+
return tableMemo({
|
|
23
|
+
feature: 'columnFilteringFeature',
|
|
24
|
+
table,
|
|
25
|
+
fnName: 'table.getFilteredRowModel',
|
|
26
|
+
memoDeps: ()=>{
|
|
27
|
+
const { filter, search } = table.options.state;
|
|
28
|
+
return [
|
|
29
|
+
table.getPreFilteredRowModel(),
|
|
30
|
+
filter,
|
|
31
|
+
search,
|
|
32
|
+
search ? table.atoms.columnVisibility.get() : null,
|
|
33
|
+
table.options.lowdefyFiltering
|
|
34
|
+
];
|
|
35
|
+
},
|
|
36
|
+
fn: ()=>filterRowModel(table)
|
|
37
|
+
});
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export default createConditionFilteredRowModel;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
import getOperators from '@lowdefy/blocks-antd/table/getOperators.js';
|
|
17
|
+
import defaultRelativeDate from './defaultRelativeDate.js';
|
|
18
|
+
// A new filter condition for a column: `in` for columns with options (pick values), otherwise the
|
|
19
|
+
// type's first operator. It has no value yet, so it filters nothing until one is chosen.
|
|
20
|
+
function createDefaultLeaf({ column }) {
|
|
21
|
+
const operators = getOperators(column.type);
|
|
22
|
+
let op = operators[0];
|
|
23
|
+
if (!type.isNone(column.options) && operators.includes('in')) op = 'in';
|
|
24
|
+
const leaf = {
|
|
25
|
+
key: column.key,
|
|
26
|
+
op
|
|
27
|
+
};
|
|
28
|
+
if (op === 'within') leaf.value = defaultRelativeDate;
|
|
29
|
+
return leaf;
|
|
30
|
+
}
|
|
31
|
+
export default createDefaultLeaf;
|
|
@@ -0,0 +1,25 @@
|
|
|
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
|
+
*/ // Action `openColumnFilter({ key })`: opens the filter popover under a column's header. The
|
|
16
|
+
// popover state lives in the filtering feature's hook (useFilteringState).
|
|
17
|
+
function createOpenColumnFilter(api) {
|
|
18
|
+
return function openColumnFilter({ key }) {
|
|
19
|
+
const column = api.config.columns.find((entry)=>entry.key === key);
|
|
20
|
+
if (!column.filterable) return false;
|
|
21
|
+
api.columnFilter.setOpenKey(key);
|
|
22
|
+
return true;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
export default createOpenColumnFilter;
|
|
@@ -0,0 +1,32 @@
|
|
|
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 compileCondition from '@lowdefy/blocks-antd/table/compileCondition.js';
|
|
16
|
+
import createSearchMatcher from './createSearchMatcher.js';
|
|
17
|
+
// The filter and the search as one row test, or null when neither constrains anything.
|
|
18
|
+
function createRowTest({ condition, search, context, searchColumns }) {
|
|
19
|
+
const matchesSearch = createSearchMatcher({
|
|
20
|
+
search,
|
|
21
|
+
columns: searchColumns
|
|
22
|
+
});
|
|
23
|
+
const matchesFilter = condition === null ? null : compileCondition({
|
|
24
|
+
condition,
|
|
25
|
+
columnsByKey: context.columnsByKey,
|
|
26
|
+
user: context.user
|
|
27
|
+
});
|
|
28
|
+
if (matchesFilter === null) return matchesSearch;
|
|
29
|
+
if (matchesSearch === null) return matchesFilter;
|
|
30
|
+
return (row)=>matchesFilter(row) && matchesSearch(row);
|
|
31
|
+
}
|
|
32
|
+
export default createRowTest;
|
|
@@ -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
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
import getSearchText from './getSearchText.js';
|
|
17
|
+
// `view.search` as a row test: case-insensitive, every word must appear in the display text of
|
|
18
|
+
// one of the searched columns (the same rule MongoDBTableQuery applies in server mode). Null when
|
|
19
|
+
// there is nothing to search for.
|
|
20
|
+
function createSearchMatcher({ search, columns }) {
|
|
21
|
+
if (!type.isString(search) || columns.length === 0) return null;
|
|
22
|
+
const words = search.trim().toLowerCase().split(/\s+/).filter(Boolean);
|
|
23
|
+
if (words.length === 0) return null;
|
|
24
|
+
return function matchesSearch(row) {
|
|
25
|
+
const text = getSearchText({
|
|
26
|
+
columns,
|
|
27
|
+
row
|
|
28
|
+
});
|
|
29
|
+
for(let i = 0; i < words.length; i++){
|
|
30
|
+
if (!text.includes(words[i])) return false;
|
|
31
|
+
}
|
|
32
|
+
return true;
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
export default createSearchMatcher;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { type } from '@lowdefy/helpers';
|
|
16
|
+
// Block method `setFilter(condition)`: replaces `view.filter` (a Condition, or null to clear).
|
|
17
|
+
function createSetFilter(api) {
|
|
18
|
+
return function setFilter(condition) {
|
|
19
|
+
if (!type.isNone(condition) && !type.isObject(condition)) {
|
|
20
|
+
throw new Error(`Table setFilter requires a condition object or null. Received ${JSON.stringify(condition)}.`);
|
|
21
|
+
}
|
|
22
|
+
api.actions.applyFiltering({
|
|
23
|
+
filter: condition ?? null
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export default createSetFilter;
|