@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,86 @@
|
|
|
1
|
+
/*
|
|
2
|
+
Copyright 2020-2026 Lowdefy, Inc
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
you may not use this file except in compliance with the License.
|
|
6
|
+
You may obtain a copy of the License at
|
|
7
|
+
|
|
8
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
|
|
10
|
+
Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
See the License for the specific language governing permissions and
|
|
14
|
+
limitations under the License.
|
|
15
|
+
*/ import React, { memo } from 'react';
|
|
16
|
+
import renderCell from '@lowdefy/blocks-antd/table/renderCell.js';
|
|
17
|
+
import LAZY_CELL_TYPES from './lazyCellTypes.js';
|
|
18
|
+
import LazyCell from './LazyCell.js';
|
|
19
|
+
function renderContent({ api, col, lead, original }) {
|
|
20
|
+
const rowKey = api.config.getKey(original);
|
|
21
|
+
if (LAZY_CELL_TYPES.has(col.column.type)) {
|
|
22
|
+
return /*#__PURE__*/ React.createElement(LazyCell, {
|
|
23
|
+
api: api,
|
|
24
|
+
col: col,
|
|
25
|
+
lead: lead,
|
|
26
|
+
original: original,
|
|
27
|
+
rowKey: rowKey
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
return renderCell({
|
|
31
|
+
column: col.column,
|
|
32
|
+
row: original,
|
|
33
|
+
rowKey,
|
|
34
|
+
methods: api.methods,
|
|
35
|
+
components: api.components,
|
|
36
|
+
onEvent: api.onCellEvent
|
|
37
|
+
});
|
|
38
|
+
}
|
|
39
|
+
// One grid cell. Memoised on the row object and the layout column, so a horizontal range change
|
|
40
|
+
// only mounts the cells that came into range. The content is the shared column core's cell
|
|
41
|
+
// (`renderCell`, the same renderers TableLight uses); renderers build their own event payloads
|
|
42
|
+
// and `api.onCellEvent` passes them to the block's triggerEvent. Rich cell types mount on demand
|
|
43
|
+
// through LazyCell (placeholders during fast scrolls, hover-only buttons on hover). `lead` (the
|
|
44
|
+
// tree indent and chevron, the expand chevron) goes before the content in a row's first data
|
|
45
|
+
// cell.
|
|
46
|
+
function Cell({ api, col, focused, lead, original, selected }) {
|
|
47
|
+
if (col.special) {
|
|
48
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
49
|
+
"aria-colindex": col.ariaIndex,
|
|
50
|
+
className: "lf-table-gridcell lf-table-select",
|
|
51
|
+
"data-col-index": col.index,
|
|
52
|
+
"data-col-key": col.key,
|
|
53
|
+
"data-focused": focused ? '' : undefined,
|
|
54
|
+
"data-lf-cell": "",
|
|
55
|
+
"data-lf-select-cell": "",
|
|
56
|
+
"data-pinned": col.region === 'center' ? undefined : col.region,
|
|
57
|
+
"data-pinned-edge": col.pinnedEdge ? '' : undefined,
|
|
58
|
+
role: "gridcell",
|
|
59
|
+
style: col.style,
|
|
60
|
+
tabIndex: focused ? 0 : -1
|
|
61
|
+
}, /*#__PURE__*/ React.createElement(col.Cell, {
|
|
62
|
+
api: api,
|
|
63
|
+
selected: selected
|
|
64
|
+
}));
|
|
65
|
+
}
|
|
66
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
67
|
+
"aria-colindex": col.ariaIndex,
|
|
68
|
+
className: "lf-table-gridcell",
|
|
69
|
+
"data-align": col.column.align,
|
|
70
|
+
"data-col-index": col.index,
|
|
71
|
+
"data-col-key": col.key,
|
|
72
|
+
"data-focused": focused ? '' : undefined,
|
|
73
|
+
"data-lf-cell": "",
|
|
74
|
+
"data-pinned": col.region === 'center' ? undefined : col.region,
|
|
75
|
+
"data-pinned-edge": col.pinnedEdge ? '' : undefined,
|
|
76
|
+
role: "gridcell",
|
|
77
|
+
style: col.style,
|
|
78
|
+
tabIndex: focused ? 0 : -1
|
|
79
|
+
}, lead, renderContent({
|
|
80
|
+
api,
|
|
81
|
+
col,
|
|
82
|
+
lead,
|
|
83
|
+
original
|
|
84
|
+
}));
|
|
85
|
+
}
|
|
86
|
+
export default /*#__PURE__*/ memo(Cell);
|
|
@@ -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 React from 'react';
|
|
16
|
+
function Chevron() {
|
|
17
|
+
return /*#__PURE__*/ React.createElement("svg", {
|
|
18
|
+
"aria-hidden": "true",
|
|
19
|
+
focusable: "false",
|
|
20
|
+
height: "12",
|
|
21
|
+
viewBox: "0 0 16 16",
|
|
22
|
+
width: "12"
|
|
23
|
+
}, /*#__PURE__*/ React.createElement("path", {
|
|
24
|
+
d: "M6 3.5 10.5 8 6 12.5",
|
|
25
|
+
fill: "none",
|
|
26
|
+
stroke: "currentColor",
|
|
27
|
+
strokeLinecap: "round",
|
|
28
|
+
strokeLinejoin: "round",
|
|
29
|
+
strokeWidth: "1.8"
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
export default Chevron;
|
|
@@ -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 React from 'react';
|
|
16
|
+
import { Empty } from 'antd';
|
|
17
|
+
import { renderHtml } from '@lowdefy/block-utils';
|
|
18
|
+
// Blocks in the `empty` slot replace the default empty state; otherwise `emptyText` (html, as in
|
|
19
|
+
// TableLight).
|
|
20
|
+
function EmptyState({ content, methods, text }) {
|
|
21
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
22
|
+
className: "lf-table-empty-state",
|
|
23
|
+
"data-lf-empty": ""
|
|
24
|
+
}, content.empty ? content.empty() : /*#__PURE__*/ React.createElement(Empty, {
|
|
25
|
+
description: renderHtml({
|
|
26
|
+
html: text,
|
|
27
|
+
methods
|
|
28
|
+
}),
|
|
29
|
+
image: Empty.PRESENTED_IMAGE_SIMPLE
|
|
30
|
+
}));
|
|
31
|
+
}
|
|
32
|
+
export default EmptyState;
|
|
@@ -0,0 +1,219 @@
|
|
|
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, { useMemo } from 'react';
|
|
16
|
+
import { cn } from '@lowdefy/block-utils';
|
|
17
|
+
import applyLayoutVars from './applyLayoutVars.js';
|
|
18
|
+
import Body from './Body.js';
|
|
19
|
+
import computeLayout from './computeLayout.js';
|
|
20
|
+
import dispatchGridEvent from './dispatchGridEvent.js';
|
|
21
|
+
import EmptyState from './EmptyState.js';
|
|
22
|
+
import HeaderRow from './HeaderRow.js';
|
|
23
|
+
import LoadingRows from './LoadingRows.js';
|
|
24
|
+
import renderRegion from './renderRegion.js';
|
|
25
|
+
import SummaryRow from './SummaryRow.js';
|
|
26
|
+
import useGridFeatures from './useGridFeatures.js';
|
|
27
|
+
import useViewportSize from './useViewportSize.js';
|
|
28
|
+
function toCssSize(size) {
|
|
29
|
+
return typeof size === 'number' ? `${size}px` : size;
|
|
30
|
+
}
|
|
31
|
+
function hasSummary({ layout, summary }) {
|
|
32
|
+
if (summary === null) return false;
|
|
33
|
+
return layout.cols.some((col)=>!col.special && summary.has(col.key));
|
|
34
|
+
}
|
|
35
|
+
// The window component: one scroll container for header, body and summary footer (native scroll,
|
|
36
|
+
// sticky header and footer). It owns the scroll-driven state (rendered ranges, active cell), so
|
|
37
|
+
// scrolling renders the grid and never the block above it.
|
|
38
|
+
function Grid({ api, blockId, classNames, clickable, config, headerHeight, isPending, leadingColumns, loading, regions, rowHeight, rowHeights, rows, state, strategy, styles, summary }) {
|
|
39
|
+
const { rootRef, scrollerRef } = api;
|
|
40
|
+
const levels = config.headerLevels;
|
|
41
|
+
const viewport = useViewportSize(scrollerRef);
|
|
42
|
+
const layout = useMemo(()=>computeLayout({
|
|
43
|
+
table: api.table,
|
|
44
|
+
leadingColumns,
|
|
45
|
+
viewportWidth: viewport.width,
|
|
46
|
+
wrap: state.wrap
|
|
47
|
+
}), [
|
|
48
|
+
config,
|
|
49
|
+
leadingColumns,
|
|
50
|
+
state.wrap,
|
|
51
|
+
state.columnOrder,
|
|
52
|
+
state.columnPinning,
|
|
53
|
+
state.columnSizing,
|
|
54
|
+
state.columnVisibility,
|
|
55
|
+
viewport.width
|
|
56
|
+
]);
|
|
57
|
+
// Header group rows stack above the leaf header row, each one header row high.
|
|
58
|
+
const headerRowsHeight = headerHeight * (levels.depth + 1);
|
|
59
|
+
const showSummary = rows.length > 0 && hasSummary({
|
|
60
|
+
layout,
|
|
61
|
+
summary
|
|
62
|
+
});
|
|
63
|
+
const footerHeight = showSummary ? rowHeight : 0;
|
|
64
|
+
Object.assign(api, {
|
|
65
|
+
footerHeight,
|
|
66
|
+
headerHeight: headerRowsHeight,
|
|
67
|
+
layout,
|
|
68
|
+
rowHeight,
|
|
69
|
+
rows
|
|
70
|
+
});
|
|
71
|
+
api.previewLayout = ({ widths })=>applyLayoutVars({
|
|
72
|
+
element: rootRef.current,
|
|
73
|
+
layout: computeLayout({
|
|
74
|
+
table: api.table,
|
|
75
|
+
leadingColumns,
|
|
76
|
+
viewportWidth: viewport.width,
|
|
77
|
+
widths,
|
|
78
|
+
wrap: state.wrap
|
|
79
|
+
})
|
|
80
|
+
});
|
|
81
|
+
const { activeCell, measuredColumns, measureRows, range, rowOffsets, scrollerTabIndex } = useGridFeatures({
|
|
82
|
+
api,
|
|
83
|
+
config,
|
|
84
|
+
headerHeight: headerRowsHeight,
|
|
85
|
+
layout,
|
|
86
|
+
rowHeight,
|
|
87
|
+
rowHeights,
|
|
88
|
+
rows,
|
|
89
|
+
scrollerRef,
|
|
90
|
+
state,
|
|
91
|
+
strategy,
|
|
92
|
+
viewport
|
|
93
|
+
});
|
|
94
|
+
const centerCols = useMemo(()=>layout.center.slice(range.colStart, range.colEnd), [
|
|
95
|
+
layout,
|
|
96
|
+
range.colStart,
|
|
97
|
+
range.colEnd
|
|
98
|
+
]);
|
|
99
|
+
const rootStyle = useMemo(()=>({
|
|
100
|
+
...layout.vars,
|
|
101
|
+
'--lf-row-h': `${rowHeight}px`,
|
|
102
|
+
'--lf-header-h': `${headerHeight}px`,
|
|
103
|
+
...styles.element
|
|
104
|
+
}), [
|
|
105
|
+
layout,
|
|
106
|
+
rowHeight,
|
|
107
|
+
headerHeight,
|
|
108
|
+
styles.element
|
|
109
|
+
]);
|
|
110
|
+
const scrollerStyle = {
|
|
111
|
+
'--lf-center-before': `${layout.centerStarts[range.colStart] ?? 0}px`,
|
|
112
|
+
'--lf-viewport-w': `${viewport.width}px`
|
|
113
|
+
};
|
|
114
|
+
const fixedHeight = config.height !== undefined && config.height !== null;
|
|
115
|
+
if (fixedHeight) {
|
|
116
|
+
scrollerStyle.height = toCssSize(config.height);
|
|
117
|
+
} else {
|
|
118
|
+
scrollerStyle.maxHeight = toCssSize(config.maxHeight);
|
|
119
|
+
}
|
|
120
|
+
const rowClassName = cn('lf-table-row', classNames.row);
|
|
121
|
+
const dispatch = (eventType)=>(event)=>dispatchGridEvent({
|
|
122
|
+
api,
|
|
123
|
+
event,
|
|
124
|
+
eventType
|
|
125
|
+
});
|
|
126
|
+
// Body rows follow the header rows in aria-rowindex (1-based).
|
|
127
|
+
const ariaRowOffset = levels.depth + 2;
|
|
128
|
+
let body;
|
|
129
|
+
if (rows.length > 0) {
|
|
130
|
+
body = /*#__PURE__*/ React.createElement(Body, {
|
|
131
|
+
activeCell: activeCell,
|
|
132
|
+
api: api,
|
|
133
|
+
ariaRowOffset: ariaRowOffset,
|
|
134
|
+
centerCols: centerCols,
|
|
135
|
+
layout: layout,
|
|
136
|
+
measuredRows: measuredColumns,
|
|
137
|
+
measureRows: measureRows,
|
|
138
|
+
range: range,
|
|
139
|
+
rowClassName: rowClassName,
|
|
140
|
+
rowHeight: rowHeight,
|
|
141
|
+
rowOffsets: rowOffsets,
|
|
142
|
+
rowStyle: styles.row,
|
|
143
|
+
rows: rows,
|
|
144
|
+
selectable: Boolean(config.rowSelection),
|
|
145
|
+
selection: state.rowSelection
|
|
146
|
+
});
|
|
147
|
+
} else if (loading) {
|
|
148
|
+
body = /*#__PURE__*/ React.createElement(LoadingRows, {
|
|
149
|
+
layout: layout
|
|
150
|
+
});
|
|
151
|
+
} else {
|
|
152
|
+
body = /*#__PURE__*/ React.createElement(EmptyState, {
|
|
153
|
+
content: api.content,
|
|
154
|
+
methods: api.methods,
|
|
155
|
+
text: config.emptyText
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
159
|
+
className: cn('lf-table', classNames.element),
|
|
160
|
+
"data-bordered": config.bordered ? '' : undefined,
|
|
161
|
+
"data-clickable": clickable ? '' : undefined,
|
|
162
|
+
"data-pending": isPending ? '' : undefined,
|
|
163
|
+
id: blockId,
|
|
164
|
+
onAuxClick: dispatch('auxclick'),
|
|
165
|
+
onBlur: dispatch('blur'),
|
|
166
|
+
onClick: dispatch('click'),
|
|
167
|
+
onDoubleClick: dispatch('dblclick'),
|
|
168
|
+
onFocus: dispatch('focus'),
|
|
169
|
+
onKeyDown: dispatch('keydown'),
|
|
170
|
+
onPointerDown: dispatch('pointerdown'),
|
|
171
|
+
onPointerLeave: dispatch('pointerleave'),
|
|
172
|
+
onPointerOver: dispatch('pointerover'),
|
|
173
|
+
ref: rootRef,
|
|
174
|
+
style: rootStyle
|
|
175
|
+
}, loading && rows.length > 0 ? /*#__PURE__*/ React.createElement("div", {
|
|
176
|
+
className: "lf-table-loading-bar"
|
|
177
|
+
}) : null, renderRegion(regions.top), /*#__PURE__*/ React.createElement("div", {
|
|
178
|
+
"aria-busy": loading ? true : undefined,
|
|
179
|
+
"aria-colcount": layout.cols.length,
|
|
180
|
+
"aria-multiselectable": config.rowSelection?.type === 'checkbox' ? true : undefined,
|
|
181
|
+
"aria-rowcount": rows.length + levels.depth + 1 + (showSummary ? 1 : 0),
|
|
182
|
+
className: "lf-table-scroller",
|
|
183
|
+
"data-autoheight": fixedHeight ? undefined : '',
|
|
184
|
+
ref: scrollerRef,
|
|
185
|
+
role: config.tree ? 'treegrid' : 'grid',
|
|
186
|
+
style: scrollerStyle,
|
|
187
|
+
tabIndex: scrollerTabIndex
|
|
188
|
+
}, /*#__PURE__*/ React.createElement("div", {
|
|
189
|
+
className: "lf-table-canvas"
|
|
190
|
+
}, /*#__PURE__*/ React.createElement(HeaderRow, {
|
|
191
|
+
activeCol: activeCell.row === -1 ? activeCell.col : -1,
|
|
192
|
+
api: api,
|
|
193
|
+
centerCols: centerCols,
|
|
194
|
+
className: cn('lf-table-header', classNames.header),
|
|
195
|
+
layout: layout,
|
|
196
|
+
levels: levels,
|
|
197
|
+
state: state,
|
|
198
|
+
sticky: config.stickyHeader,
|
|
199
|
+
style: styles.header
|
|
200
|
+
}), rows.length > 0 ? api.features.bodyOverlays.map((Overlay, i)=>/*#__PURE__*/ React.createElement(Overlay, {
|
|
201
|
+
api: api,
|
|
202
|
+
centerCols: centerCols,
|
|
203
|
+
headerHeight: headerRowsHeight,
|
|
204
|
+
key: i,
|
|
205
|
+
layout: layout,
|
|
206
|
+
rowClassName: rowClassName,
|
|
207
|
+
rows: rows,
|
|
208
|
+
selectable: Boolean(config.rowSelection),
|
|
209
|
+
selection: state.rowSelection,
|
|
210
|
+
sticky: config.stickyHeader
|
|
211
|
+
})) : null, body, showSummary ? /*#__PURE__*/ React.createElement(SummaryRow, {
|
|
212
|
+
api: api,
|
|
213
|
+
ariaRowIndex: rows.length + ariaRowOffset,
|
|
214
|
+
centerCols: centerCols,
|
|
215
|
+
layout: layout,
|
|
216
|
+
summary: summary
|
|
217
|
+
}) : null)), renderRegion(regions.bottom));
|
|
218
|
+
}
|
|
219
|
+
export default Grid;
|
|
@@ -0,0 +1,81 @@
|
|
|
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 buildGroupSegments from './buildGroupSegments.js';
|
|
17
|
+
import HeaderTitle from './HeaderTitle.js';
|
|
18
|
+
function segmentStyle(cols) {
|
|
19
|
+
const first = cols[0];
|
|
20
|
+
const last = cols[cols.length - 1];
|
|
21
|
+
const widths = cols.map((col)=>`var(--lf-w${col.index})`);
|
|
22
|
+
// Widths are the columns' own CSS variables, so a resize drag moves the group edges too.
|
|
23
|
+
const style = {
|
|
24
|
+
width: widths.length === 1 ? widths[0] : `calc(${widths.join(' + ')})`
|
|
25
|
+
};
|
|
26
|
+
if (first.region === 'start') style.left = `var(--lf-l${first.index})`;
|
|
27
|
+
if (last.region === 'end') style.right = `var(--lf-r${last.index})`;
|
|
28
|
+
return style;
|
|
29
|
+
}
|
|
30
|
+
function renderSegments({ api, cols, level, levels }) {
|
|
31
|
+
return buildGroupSegments({
|
|
32
|
+
cols,
|
|
33
|
+
level,
|
|
34
|
+
ancestorsByKey: levels.ancestorsByKey
|
|
35
|
+
}).map((segment)=>{
|
|
36
|
+
const first = segment.cols[0];
|
|
37
|
+
const { node } = segment;
|
|
38
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
39
|
+
"aria-colindex": first.ariaIndex,
|
|
40
|
+
"aria-colspan": segment.cols.length,
|
|
41
|
+
className: "lf-table-gridcell lf-table-group-header",
|
|
42
|
+
"data-group": node ? node.key : undefined,
|
|
43
|
+
"data-pinned": first.region === 'center' ? undefined : first.region,
|
|
44
|
+
key: `${node ? node.key : '~'}:${first.key}`,
|
|
45
|
+
role: "columnheader",
|
|
46
|
+
style: segmentStyle(segment.cols)
|
|
47
|
+
}, node ? /*#__PURE__*/ React.createElement(HeaderTitle, {
|
|
48
|
+
api: api,
|
|
49
|
+
headerTooltip: node.headerTooltip,
|
|
50
|
+
title: node.title
|
|
51
|
+
}) : null);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
// One row of header groups (`children` columns) above the leaf headers. Pinned groups stick with
|
|
55
|
+
// their columns; centre groups follow column virtualisation (only rendered columns are spanned,
|
|
56
|
+
// after the same spacer the leaf row uses).
|
|
57
|
+
function GroupHeaderRow({ api, centerCols, layout, level, levels }) {
|
|
58
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
59
|
+
"aria-rowindex": level + 1,
|
|
60
|
+
className: "lf-table-row lf-table-group-row",
|
|
61
|
+
role: "row"
|
|
62
|
+
}, renderSegments({
|
|
63
|
+
api,
|
|
64
|
+
cols: layout.start,
|
|
65
|
+
level,
|
|
66
|
+
levels
|
|
67
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
68
|
+
className: "lf-table-center"
|
|
69
|
+
}, renderSegments({
|
|
70
|
+
api,
|
|
71
|
+
cols: centerCols,
|
|
72
|
+
level,
|
|
73
|
+
levels
|
|
74
|
+
})), renderSegments({
|
|
75
|
+
api,
|
|
76
|
+
cols: layout.end,
|
|
77
|
+
level,
|
|
78
|
+
levels
|
|
79
|
+
}));
|
|
80
|
+
}
|
|
81
|
+
export default GroupHeaderRow;
|
|
@@ -0,0 +1,58 @@
|
|
|
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 getHeaderCellProps from './getHeaderCellProps.js';
|
|
17
|
+
import HeaderTitle from './HeaderTitle.js';
|
|
18
|
+
function HeaderCell({ api, col, focused, state }) {
|
|
19
|
+
const props = {
|
|
20
|
+
'aria-colindex': col.ariaIndex,
|
|
21
|
+
className: 'lf-table-gridcell',
|
|
22
|
+
'data-align': col.column?.align,
|
|
23
|
+
'data-col-index': col.index,
|
|
24
|
+
'data-col-key': col.key,
|
|
25
|
+
'data-focused': focused ? '' : undefined,
|
|
26
|
+
'data-lf-cell': '',
|
|
27
|
+
'data-lf-header': '',
|
|
28
|
+
'data-pinned': col.region === 'center' ? undefined : col.region,
|
|
29
|
+
'data-pinned-edge': col.pinnedEdge ? '' : undefined,
|
|
30
|
+
'data-special': col.special,
|
|
31
|
+
role: 'columnheader',
|
|
32
|
+
style: col.style,
|
|
33
|
+
tabIndex: focused ? 0 : -1,
|
|
34
|
+
...col.special ? {} : getHeaderCellProps({
|
|
35
|
+
col,
|
|
36
|
+
features: api.features.list,
|
|
37
|
+
state
|
|
38
|
+
})
|
|
39
|
+
};
|
|
40
|
+
if (col.special) {
|
|
41
|
+
return /*#__PURE__*/ React.createElement('div', props, /*#__PURE__*/ React.createElement(col.Header, {
|
|
42
|
+
api: api,
|
|
43
|
+
state: state
|
|
44
|
+
}));
|
|
45
|
+
}
|
|
46
|
+
return /*#__PURE__*/ React.createElement('div', props, /*#__PURE__*/ React.createElement(HeaderTitle, {
|
|
47
|
+
api: api,
|
|
48
|
+
headerTooltip: col.column.headerTooltip,
|
|
49
|
+
title: col.column.title
|
|
50
|
+
}), ...api.features.headerParts.map((Part, i)=>/*#__PURE__*/ React.createElement(Part, {
|
|
51
|
+
api: api,
|
|
52
|
+
col: col,
|
|
53
|
+
focused: focused,
|
|
54
|
+
key: i,
|
|
55
|
+
state: state
|
|
56
|
+
})));
|
|
57
|
+
}
|
|
58
|
+
export default HeaderCell;
|
|
@@ -0,0 +1,76 @@
|
|
|
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 GroupHeaderRow from './GroupHeaderRow.js';
|
|
17
|
+
import HeaderCell from './HeaderCell.js';
|
|
18
|
+
function renderHeaderCells({ api, cols, activeCol, state }) {
|
|
19
|
+
return cols.map((col)=>/*#__PURE__*/ React.createElement(HeaderCell, {
|
|
20
|
+
api: api,
|
|
21
|
+
col: col,
|
|
22
|
+
focused: activeCol === col.index,
|
|
23
|
+
key: col.key,
|
|
24
|
+
state: state
|
|
25
|
+
}));
|
|
26
|
+
}
|
|
27
|
+
function renderGroupRows({ api, centerCols, layout, levels }) {
|
|
28
|
+
const groupRows = [];
|
|
29
|
+
for(let level = 0; level < levels.depth; level++){
|
|
30
|
+
groupRows.push(/*#__PURE__*/ React.createElement(GroupHeaderRow, {
|
|
31
|
+
api: api,
|
|
32
|
+
centerCols: centerCols,
|
|
33
|
+
key: level,
|
|
34
|
+
layout: layout,
|
|
35
|
+
level: level,
|
|
36
|
+
levels: levels
|
|
37
|
+
}));
|
|
38
|
+
}
|
|
39
|
+
return groupRows;
|
|
40
|
+
}
|
|
41
|
+
function HeaderRow({ activeCol, api, centerCols, className, layout, levels, state, sticky, style }) {
|
|
42
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
43
|
+
className: className,
|
|
44
|
+
"data-sticky": sticky ? undefined : 'false',
|
|
45
|
+
role: "rowgroup",
|
|
46
|
+
style: style
|
|
47
|
+
}, renderGroupRows({
|
|
48
|
+
api,
|
|
49
|
+
centerCols,
|
|
50
|
+
layout,
|
|
51
|
+
levels
|
|
52
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
53
|
+
"aria-rowindex": levels.depth + 1,
|
|
54
|
+
className: "lf-table-row",
|
|
55
|
+
"data-row-index": -1,
|
|
56
|
+
role: "row"
|
|
57
|
+
}, renderHeaderCells({
|
|
58
|
+
api,
|
|
59
|
+
cols: layout.start,
|
|
60
|
+
activeCol,
|
|
61
|
+
state
|
|
62
|
+
}), /*#__PURE__*/ React.createElement("div", {
|
|
63
|
+
className: "lf-table-center"
|
|
64
|
+
}, renderHeaderCells({
|
|
65
|
+
api,
|
|
66
|
+
cols: centerCols,
|
|
67
|
+
activeCol,
|
|
68
|
+
state
|
|
69
|
+
})), renderHeaderCells({
|
|
70
|
+
api,
|
|
71
|
+
cols: layout.end,
|
|
72
|
+
activeCol,
|
|
73
|
+
state
|
|
74
|
+
})));
|
|
75
|
+
}
|
|
76
|
+
export default HeaderRow;
|
|
@@ -0,0 +1,49 @@
|
|
|
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 { Tooltip } from 'antd';
|
|
17
|
+
import { type } from '@lowdefy/helpers';
|
|
18
|
+
import { renderHtml } from '@lowdefy/block-utils';
|
|
19
|
+
function renderTitle({ api, title }) {
|
|
20
|
+
// Titles may hold HTML; plain titles skip the sanitiser.
|
|
21
|
+
if (type.isString(title) && title.includes('<')) {
|
|
22
|
+
return renderHtml({
|
|
23
|
+
className: 'lf-table-header-title',
|
|
24
|
+
html: title,
|
|
25
|
+
methods: api.methods
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
return /*#__PURE__*/ React.createElement("span", {
|
|
29
|
+
className: "lf-table-header-title"
|
|
30
|
+
}, title);
|
|
31
|
+
}
|
|
32
|
+
// A header title, with the column's (or group's) `headerTooltip` as an antd Tooltip, as in
|
|
33
|
+
// TableLight. Headers are few, so the tooltip mounts with the header.
|
|
34
|
+
function HeaderTitle({ api, headerTooltip, title }) {
|
|
35
|
+
const element = renderTitle({
|
|
36
|
+
api,
|
|
37
|
+
title
|
|
38
|
+
});
|
|
39
|
+
if (type.isNone(headerTooltip)) return element;
|
|
40
|
+
return /*#__PURE__*/ React.createElement(Tooltip, {
|
|
41
|
+
title: renderHtml({
|
|
42
|
+
html: headerTooltip,
|
|
43
|
+
methods: api.methods
|
|
44
|
+
})
|
|
45
|
+
}, /*#__PURE__*/ React.createElement("span", {
|
|
46
|
+
className: "lf-table-header-tooltip"
|
|
47
|
+
}, element));
|
|
48
|
+
}
|
|
49
|
+
export default HeaderTitle;
|