@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,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 { type } from '@lowdefy/helpers';
|
|
16
|
+
import fromDateValue from './fromDateValue.js';
|
|
17
|
+
// Rounds away the float noise of x100 (0.07 * 100 = 7.000000000000001).
|
|
18
|
+
function scalePercent(value) {
|
|
19
|
+
return Math.round(value * 100 * 1e8) / 1e8;
|
|
20
|
+
}
|
|
21
|
+
// The editor's starting value for a cell value. A printable key that opened the editor seeds text
|
|
22
|
+
// and number editors (a digit replaces the number); percents edit as the number shown (12 for
|
|
23
|
+
// 0.12) and dates as the picker's dayjs.
|
|
24
|
+
function toEditorDraft({ spec, value, seed }) {
|
|
25
|
+
switch(spec.kind){
|
|
26
|
+
case 'text':
|
|
27
|
+
if (type.isString(seed)) return seed;
|
|
28
|
+
return type.isNone(value) ? '' : String(value);
|
|
29
|
+
case 'number':
|
|
30
|
+
{
|
|
31
|
+
if (type.isString(seed) && /^\d$/.test(seed)) return Number(seed);
|
|
32
|
+
if (type.isNone(value) || value === '' || Number.isNaN(Number(value))) return null;
|
|
33
|
+
return spec.type === 'percent' ? scalePercent(Number(value)) : Number(value);
|
|
34
|
+
}
|
|
35
|
+
case 'date':
|
|
36
|
+
case 'datetime':
|
|
37
|
+
return fromDateValue({
|
|
38
|
+
value,
|
|
39
|
+
kind: spec.kind
|
|
40
|
+
});
|
|
41
|
+
case 'boolean':
|
|
42
|
+
return value === true;
|
|
43
|
+
case 'select':
|
|
44
|
+
return type.isNone(value) || value === '' ? undefined : value;
|
|
45
|
+
case 'multiSelect':
|
|
46
|
+
if (type.isArray(value)) return value;
|
|
47
|
+
return type.isNone(value) || value === '' ? [] : [
|
|
48
|
+
value
|
|
49
|
+
];
|
|
50
|
+
case 'rating':
|
|
51
|
+
return type.isNone(value) ? 0 : Number(value);
|
|
52
|
+
default:
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
export default toEditorDraft;
|
|
@@ -0,0 +1,39 @@
|
|
|
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 StatusCell from '@lowdefy/blocks-antd/table/cells/StatusCell.js';
|
|
17
|
+
import TagCell from '@lowdefy/blocks-antd/table/cells/TagCell.js';
|
|
18
|
+
// The select editor's options with the look of the cell: a status dot or a tag chip in the
|
|
19
|
+
// value's colour (the shared cell renderers, for one value), with the label as `text` for search
|
|
20
|
+
// and as the option's `title`.
|
|
21
|
+
function toSelectOptions({ components, spec, row }) {
|
|
22
|
+
const { column } = spec;
|
|
23
|
+
return (spec.options ?? []).map((option)=>({
|
|
24
|
+
label: column.type === 'status' ? /*#__PURE__*/ React.createElement(StatusCell, {
|
|
25
|
+
column: column,
|
|
26
|
+
row: row,
|
|
27
|
+
value: option.value
|
|
28
|
+
}) : /*#__PURE__*/ React.createElement(TagCell, {
|
|
29
|
+
column: column,
|
|
30
|
+
components: components,
|
|
31
|
+
row: row,
|
|
32
|
+
value: option.value
|
|
33
|
+
}),
|
|
34
|
+
text: option.label,
|
|
35
|
+
title: option.label,
|
|
36
|
+
value: option.value
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
export default toSelectOptions;
|
|
@@ -0,0 +1,199 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import { useEffect, useMemo, useRef, useState } from 'react';
|
|
16
|
+
import applyChanges from './applyChanges.js';
|
|
17
|
+
import applyMoveOverlay from './applyMoveOverlay.js';
|
|
18
|
+
import applyOverlay from './applyOverlay.js';
|
|
19
|
+
import createEditSpecs from './createEditSpecs.js';
|
|
20
|
+
import createUndoStack from './createUndoStack.js';
|
|
21
|
+
import createValueStore from './createValueStore.js';
|
|
22
|
+
import findInvalidCells from './findInvalidCells.js';
|
|
23
|
+
import getEditOptions from './getEditOptions.js';
|
|
24
|
+
import getKeyField from './getKeyField.js';
|
|
25
|
+
import pruneOverlay from './pruneOverlay.js';
|
|
26
|
+
const EMPTY_MAP = new Map();
|
|
27
|
+
const UNDO_LIMIT = 100;
|
|
28
|
+
function createEditingState() {
|
|
29
|
+
const editing = {
|
|
30
|
+
changeCache: new WeakMap(),
|
|
31
|
+
changes: null,
|
|
32
|
+
dataIndex: null,
|
|
33
|
+
layer: null,
|
|
34
|
+
pendingStart: null,
|
|
35
|
+
reorderBlock: createValueStore(null),
|
|
36
|
+
seenChanges: null,
|
|
37
|
+
sources: new WeakMap(),
|
|
38
|
+
undo: createUndoStack({
|
|
39
|
+
limit: UNDO_LIMIT
|
|
40
|
+
}),
|
|
41
|
+
warned: new Set()
|
|
42
|
+
};
|
|
43
|
+
// The unchanged data rows by key (as a string), built on the first write after a data change.
|
|
44
|
+
editing.getDataByKey = ()=>{
|
|
45
|
+
if (editing.dataIndex?.data !== editing.data) {
|
|
46
|
+
const map = new Map(editing.data.map((row)=>[
|
|
47
|
+
String(editing.getKey(row)),
|
|
48
|
+
row
|
|
49
|
+
]));
|
|
50
|
+
editing.dataIndex = {
|
|
51
|
+
data: editing.data,
|
|
52
|
+
map
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return editing.dataIndex.map;
|
|
56
|
+
};
|
|
57
|
+
return editing;
|
|
58
|
+
}
|
|
59
|
+
// Rows the user changed in TableInput (updated or added); inline validation checks these only,
|
|
60
|
+
// since rows as they came from `data` are the app's, and a large table stays cheap to edit.
|
|
61
|
+
function getTouchedRows({ rows, changes, getKey }) {
|
|
62
|
+
const touched = new Set([
|
|
63
|
+
...Object.keys(changes.updated),
|
|
64
|
+
...changes.added.map((entry)=>String(entry.rowKey))
|
|
65
|
+
]);
|
|
66
|
+
if (touched.size === 0) return [];
|
|
67
|
+
return rows.filter((row)=>touched.has(String(getKey(row))));
|
|
68
|
+
}
|
|
69
|
+
// The editing feature's `useRows` hook (after the rows are diffed by key, before TanStack sees
|
|
70
|
+
// them). Row identity is stable here, which the overlay relies on: an entry applies until its
|
|
71
|
+
// row in `data` is a different object. It compiles the edit
|
|
72
|
+
// specs, and then per block:
|
|
73
|
+
// - Table: lays the optimistic overlays over `data` (cell edits and a row move that are saving,
|
|
74
|
+
// or saved and not yet replaced by new data) and prunes them once `data` catches up.
|
|
75
|
+
// - TableInput: shows `data` with its value (the changeset) applied, and finds the touched cells
|
|
76
|
+
// that fail inline validation.
|
|
77
|
+
// `data` is never written. The per-table editing state lives on `api.editing` for handlers,
|
|
78
|
+
// actions and the editing layer.
|
|
79
|
+
function useEditingData({ api, config, input, properties, rows: data }) {
|
|
80
|
+
const specs = useMemo(()=>createEditSpecs({
|
|
81
|
+
columns: config.columns,
|
|
82
|
+
rawColumns: properties.columns,
|
|
83
|
+
defaultColumn: properties.defaultColumn
|
|
84
|
+
}), [
|
|
85
|
+
config
|
|
86
|
+
]);
|
|
87
|
+
const options = getEditOptions({
|
|
88
|
+
input,
|
|
89
|
+
properties
|
|
90
|
+
});
|
|
91
|
+
const { positionField } = options;
|
|
92
|
+
const [overlay, setOverlay] = useState(EMPTY_MAP);
|
|
93
|
+
const [moveOverlay, setMoveOverlay] = useState(null);
|
|
94
|
+
const stateRef = useRef(null);
|
|
95
|
+
if (stateRef.current === null) stateRef.current = createEditingState();
|
|
96
|
+
const editing = stateRef.current;
|
|
97
|
+
const { getKey } = config;
|
|
98
|
+
const changes = input?.changes ?? null;
|
|
99
|
+
if (changes !== editing.seenChanges) {
|
|
100
|
+
editing.seenChanges = changes;
|
|
101
|
+
editing.changes = changes;
|
|
102
|
+
}
|
|
103
|
+
// Only TableInput adds rows, so only it needs the key field (and the scan of `data` for it).
|
|
104
|
+
const keyField = useMemo(()=>input ? getKeyField({
|
|
105
|
+
rowKey: properties.rowKey,
|
|
106
|
+
rows: data
|
|
107
|
+
}) : null, [
|
|
108
|
+
Boolean(input),
|
|
109
|
+
data,
|
|
110
|
+
properties.rowKey
|
|
111
|
+
]);
|
|
112
|
+
const rows = useMemo(()=>{
|
|
113
|
+
if (changes) {
|
|
114
|
+
return applyChanges({
|
|
115
|
+
rows: data,
|
|
116
|
+
changes,
|
|
117
|
+
getKey,
|
|
118
|
+
keyField,
|
|
119
|
+
positionField,
|
|
120
|
+
cache: editing.changeCache
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
const edited = applyOverlay({
|
|
124
|
+
rows: data,
|
|
125
|
+
overlay,
|
|
126
|
+
getKey,
|
|
127
|
+
sources: editing.sources
|
|
128
|
+
});
|
|
129
|
+
return applyMoveOverlay({
|
|
130
|
+
rows: edited,
|
|
131
|
+
move: moveOverlay,
|
|
132
|
+
data,
|
|
133
|
+
getKey,
|
|
134
|
+
positionField,
|
|
135
|
+
sources: editing.sources
|
|
136
|
+
});
|
|
137
|
+
}, [
|
|
138
|
+
data,
|
|
139
|
+
changes,
|
|
140
|
+
overlay,
|
|
141
|
+
moveOverlay,
|
|
142
|
+
getKey,
|
|
143
|
+
keyField,
|
|
144
|
+
positionField
|
|
145
|
+
]);
|
|
146
|
+
const invalid = useMemo(()=>{
|
|
147
|
+
if (!changes) return EMPTY_MAP;
|
|
148
|
+
return findInvalidCells({
|
|
149
|
+
rows: getTouchedRows({
|
|
150
|
+
rows,
|
|
151
|
+
changes,
|
|
152
|
+
getKey
|
|
153
|
+
}),
|
|
154
|
+
specs,
|
|
155
|
+
getKey
|
|
156
|
+
});
|
|
157
|
+
}, [
|
|
158
|
+
rows,
|
|
159
|
+
changes,
|
|
160
|
+
specs,
|
|
161
|
+
getKey
|
|
162
|
+
]);
|
|
163
|
+
useEffect(()=>{
|
|
164
|
+
if (changes) return;
|
|
165
|
+
setOverlay((previous)=>pruneOverlay({
|
|
166
|
+
overlay: previous,
|
|
167
|
+
rows: data,
|
|
168
|
+
getKey
|
|
169
|
+
}));
|
|
170
|
+
setMoveOverlay((previous)=>{
|
|
171
|
+
if (!previous || previous.status === 'saving' || previous.source === data) return previous;
|
|
172
|
+
return null;
|
|
173
|
+
});
|
|
174
|
+
}, [
|
|
175
|
+
data
|
|
176
|
+
]);
|
|
177
|
+
const anyEditable = useMemo(()=>[
|
|
178
|
+
...specs.values()
|
|
179
|
+
].some((spec)=>spec.editable), [
|
|
180
|
+
specs
|
|
181
|
+
]);
|
|
182
|
+
Object.assign(editing, {
|
|
183
|
+
data,
|
|
184
|
+
enabled: Boolean(input) || anyEditable || options.rowDrag,
|
|
185
|
+
getKey,
|
|
186
|
+
input: input ?? null,
|
|
187
|
+
invalid,
|
|
188
|
+
keyField,
|
|
189
|
+
moveOverlay,
|
|
190
|
+
options,
|
|
191
|
+
overlay,
|
|
192
|
+
setMoveOverlay,
|
|
193
|
+
setOverlay,
|
|
194
|
+
specs
|
|
195
|
+
});
|
|
196
|
+
api.editing = editing;
|
|
197
|
+
return rows;
|
|
198
|
+
}
|
|
199
|
+
export default useEditingData;
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React, { useEffect, useMemo } from 'react';
|
|
16
|
+
import AddRowButton from './AddRowButton.js';
|
|
17
|
+
import EditingLayer from './EditingLayer.js';
|
|
18
|
+
import getReorderBlock from './getReorderBlock.js';
|
|
19
|
+
import rowControlsColumn from './rowControlsColumn.js';
|
|
20
|
+
const EMPTY = [];
|
|
21
|
+
// Block-level editing fragment: the row controls column (`rowDrag`, or TableInput's
|
|
22
|
+
// `rowActions.delete`), and under the grid the editing layer (editor and status markers,
|
|
23
|
+
// portalled into cells) plus TableInput's "+ Add row". It also registers TableInput's
|
|
24
|
+
// `resetChanges` method. Nothing mounts for a table without editing.
|
|
25
|
+
function useEditingFragments({ api, config, data, state, table }) {
|
|
26
|
+
const { editing } = api;
|
|
27
|
+
const { addRow, addRowText, deleteButton, positionField, rowDrag } = editing.options;
|
|
28
|
+
const leadingColumns = useMemo(()=>rowDrag || deleteButton ? [
|
|
29
|
+
rowControlsColumn({
|
|
30
|
+
rowDrag,
|
|
31
|
+
deleteButton
|
|
32
|
+
})
|
|
33
|
+
] : EMPTY, [
|
|
34
|
+
rowDrag,
|
|
35
|
+
deleteButton
|
|
36
|
+
]);
|
|
37
|
+
const block = rowDrag ? getReorderBlock({
|
|
38
|
+
config,
|
|
39
|
+
data,
|
|
40
|
+
positionField,
|
|
41
|
+
state,
|
|
42
|
+
table
|
|
43
|
+
}) : null;
|
|
44
|
+
useEffect(()=>{
|
|
45
|
+
editing.reorderBlock.set(block);
|
|
46
|
+
}, [
|
|
47
|
+
block
|
|
48
|
+
]);
|
|
49
|
+
useEffect(()=>{
|
|
50
|
+
// Load the editor chunk while the user reads, so the first edit opens without a wait.
|
|
51
|
+
if (editing.enabled) import('./CellEditor.js');
|
|
52
|
+
}, [
|
|
53
|
+
editing.enabled
|
|
54
|
+
]);
|
|
55
|
+
const inputMethods = editing.input?.methods;
|
|
56
|
+
useEffect(()=>{
|
|
57
|
+
if (!inputMethods) return;
|
|
58
|
+
inputMethods.registerMethod('resetChanges', api.actions.resetChanges);
|
|
59
|
+
}, [
|
|
60
|
+
inputMethods
|
|
61
|
+
]);
|
|
62
|
+
if (!editing.enabled) return {
|
|
63
|
+
leadingColumns
|
|
64
|
+
};
|
|
65
|
+
return {
|
|
66
|
+
leadingColumns,
|
|
67
|
+
regions: {
|
|
68
|
+
bottom: /*#__PURE__*/ React.createElement(React.Fragment, null, /*#__PURE__*/ React.createElement(EditingLayer, {
|
|
69
|
+
api: api
|
|
70
|
+
}), addRow ? /*#__PURE__*/ React.createElement(AddRowButton, {
|
|
71
|
+
api: api,
|
|
72
|
+
text: addRowText
|
|
73
|
+
}) : null)
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
export default useEditingFragments;
|
|
@@ -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
|
+
*/ import { useLayoutEffect } from 'react';
|
|
16
|
+
const NONE = {};
|
|
17
|
+
// After every grid render (scroll, resize, a new row window), cells may have mounted or
|
|
18
|
+
// unmounted: the editing layer finds the cells for its editor and markers again.
|
|
19
|
+
function useEditingGrid({ api }) {
|
|
20
|
+
useLayoutEffect(()=>{
|
|
21
|
+
api.editing?.layer?.sync();
|
|
22
|
+
});
|
|
23
|
+
return NONE;
|
|
24
|
+
}
|
|
25
|
+
export default useEditingGrid;
|
|
@@ -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
|
+
*/ import isEmptyValue from '@lowdefy/blocks-antd/table/isEmptyValue.js';
|
|
16
|
+
// The first failing message for a cell value, or null when it passes. `row` is the row with the
|
|
17
|
+
// new value already in it, so a `pass` condition with a `key` reads the edited row.
|
|
18
|
+
function validateCellValue({ spec, row, value }) {
|
|
19
|
+
if (spec.required && isEmptyValue(value)) return 'Required.';
|
|
20
|
+
for (const rule of spec.validate){
|
|
21
|
+
if (rule.test(row, value) !== true) return rule.message;
|
|
22
|
+
}
|
|
23
|
+
return null;
|
|
24
|
+
}
|
|
25
|
+
export default validateCellValue;
|
|
@@ -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
|
+
// Whether an edit changed nothing, so no event fires and no write happens. Empty values (null,
|
|
17
|
+
// undefined, '') are one value: opening and closing an editor on an empty cell is not an edit.
|
|
18
|
+
function valuesEqual(a, b) {
|
|
19
|
+
const aEmpty = type.isNone(a) || a === '';
|
|
20
|
+
const bEmpty = type.isNone(b) || b === '';
|
|
21
|
+
if (aEmpty || bEmpty) return aEmpty && bEmpty;
|
|
22
|
+
if (type.isDate(a) || type.isDate(b)) {
|
|
23
|
+
return type.isDate(a) && type.isDate(b) && a.getTime() === b.getTime();
|
|
24
|
+
}
|
|
25
|
+
if (type.isArray(a) || type.isArray(b)) {
|
|
26
|
+
return type.isArray(a) && type.isArray(b) && a.length === b.length && a.every((item, i)=>valuesEqual(item, b[i]));
|
|
27
|
+
}
|
|
28
|
+
if (type.isObject(a) || type.isObject(b)) return JSON.stringify(a) === JSON.stringify(b);
|
|
29
|
+
return a === b;
|
|
30
|
+
}
|
|
31
|
+
export default valuesEqual;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ // Development warning, once per table and event: an edit or move shows in the table but nothing
|
|
16
|
+
// saves it.
|
|
17
|
+
function warnMissingEvent({ api, name, what }) {
|
|
18
|
+
if (process.env.NODE_ENV === 'production' || api.editing.warned.has(name)) return;
|
|
19
|
+
api.editing.warned.add(name);
|
|
20
|
+
// eslint-disable-next-line no-console
|
|
21
|
+
console.warn(`Table "${api.blockId}" allows ${what} but has no ${name} event, so they only show in the table and are never saved. Add an ${name} event that saves them.`);
|
|
22
|
+
}
|
|
23
|
+
export default warnMissingEvent;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import getRowIndex from './getRowIndex.js';
|
|
16
|
+
import openRowLink from './openRowLink.js';
|
|
17
|
+
// A row "activation" (click, or Enter on a focused cell), with TableLight's semantics: onRowClick
|
|
18
|
+
// fires, and rowLink is followed unless onRowClick is defined too, in which case a plain click is
|
|
19
|
+
// the app's (a peek, say) and only a modified click (Cmd/Ctrl/Shift) follows the link, in a new
|
|
20
|
+
// tab.
|
|
21
|
+
function createActivateRow(api) {
|
|
22
|
+
return function activateRow({ id, event, newTab }) {
|
|
23
|
+
const row = api.table.getRow(id, true);
|
|
24
|
+
if (!row) return false;
|
|
25
|
+
const hasRowClick = Boolean(api.events.onRowClick);
|
|
26
|
+
if (hasRowClick) {
|
|
27
|
+
const rowKey = api.config.getKey(row.original);
|
|
28
|
+
api.methods.triggerEvent({
|
|
29
|
+
name: 'onRowClick',
|
|
30
|
+
event: {
|
|
31
|
+
row: row.original,
|
|
32
|
+
rowKey,
|
|
33
|
+
index: getRowIndex({
|
|
34
|
+
api,
|
|
35
|
+
rowKey
|
|
36
|
+
})
|
|
37
|
+
}
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const { rowLink } = api.config;
|
|
41
|
+
if (!rowLink) return true;
|
|
42
|
+
const modified = event?.metaKey || event?.ctrlKey || event?.shiftKey;
|
|
43
|
+
const openInNewTab = newTab === true || modified === true;
|
|
44
|
+
if (openInNewTab || !hasRowClick) {
|
|
45
|
+
openRowLink({
|
|
46
|
+
rowLink,
|
|
47
|
+
row: row.original,
|
|
48
|
+
newTab: openInNewTab
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
};
|
|
53
|
+
}
|
|
54
|
+
export default createActivateRow;
|
|
@@ -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 createActivateRow from './createActivateRow.js';
|
|
16
|
+
import handleAuxClick from './handleAuxClick.js';
|
|
17
|
+
import handlePointerDown from './handlePointerDown.js';
|
|
18
|
+
import handleRowClick from './handleRowClick.js';
|
|
19
|
+
import handleRowDoubleClick from './handleRowDoubleClick.js';
|
|
20
|
+
// Row and cell events through the grid's one delegated listener (D5): onRowClick,
|
|
21
|
+
// onRowDoubleClick, onCellClick and rowLink. Cell renderers fire their own events (buttons, menus,
|
|
22
|
+
// onCellLink) with full payloads through `api.onCellEvent`.
|
|
23
|
+
const eventsFeature = {
|
|
24
|
+
name: 'events',
|
|
25
|
+
actions: {
|
|
26
|
+
activateRow: createActivateRow
|
|
27
|
+
},
|
|
28
|
+
gridHandlers: {
|
|
29
|
+
auxclick: handleAuxClick,
|
|
30
|
+
click: handleRowClick,
|
|
31
|
+
dblclick: handleRowDoubleClick,
|
|
32
|
+
pointerdown: handlePointerDown
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
export default eventsFeature;
|
|
@@ -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
|
+
*/ // The body row and cell an event targets, or null for header and non-row targets.
|
|
16
|
+
function getBodyTarget({ event, api }) {
|
|
17
|
+
const rowElement = event.target.closest('[data-row-key]');
|
|
18
|
+
if (!rowElement || !api.contains(rowElement)) return null;
|
|
19
|
+
const row = api.table.getRow(rowElement.dataset.rowKey, true);
|
|
20
|
+
if (!row) return null;
|
|
21
|
+
return {
|
|
22
|
+
cell: event.target.closest('[data-lf-cell]'),
|
|
23
|
+
row,
|
|
24
|
+
rowElement
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export default getBodyTarget;
|
|
@@ -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
|
+
*/ // The `index` of row events (onRowClick, onRowDoubleClick). Client data: the row's index in
|
|
16
|
+
// `data` (with `childrenField`, in the depth-first list of every node). Server mode: the row's
|
|
17
|
+
// index on the server in its list (the root list, or its group's), its block's startRow plus its
|
|
18
|
+
// place in the block. Rows that are not in `data`, added by applyTransaction or in a TableInput,
|
|
19
|
+
// have no index: null.
|
|
20
|
+
function getRowIndex({ api, rowKey }) {
|
|
21
|
+
if (api.serverStore) return api.serverStore.getRowIndex(rowKey);
|
|
22
|
+
return api.getSourceIndex(rowKey);
|
|
23
|
+
}
|
|
24
|
+
export default getRowIndex;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import isControlTarget from '@lowdefy/blocks-antd/table/isControlTarget.js';
|
|
16
|
+
import getBodyTarget from './getBodyTarget.js';
|
|
17
|
+
import openRowLink from './openRowLink.js';
|
|
18
|
+
// Middle click opens the row link in a new tab, like a middle-clicked link.
|
|
19
|
+
function handleAuxClick(event, api) {
|
|
20
|
+
if (event.button !== 1 || !api.config.rowLink) return false;
|
|
21
|
+
const target = getBodyTarget({
|
|
22
|
+
event,
|
|
23
|
+
api
|
|
24
|
+
});
|
|
25
|
+
if (!target) return false;
|
|
26
|
+
if (isControlTarget({
|
|
27
|
+
target: event.target,
|
|
28
|
+
container: target.rowElement
|
|
29
|
+
})) return false;
|
|
30
|
+
event.preventDefault();
|
|
31
|
+
openRowLink({
|
|
32
|
+
rowLink: api.config.rowLink,
|
|
33
|
+
row: target.row.original,
|
|
34
|
+
newTab: true
|
|
35
|
+
});
|
|
36
|
+
return true;
|
|
37
|
+
}
|
|
38
|
+
export default handleAuxClick;
|