@multiplatform.one/table 7.23.1 → 7.24.0
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/dist/cjs/components/ChildTable/index.native.js +1 -1
- package/dist/cjs/components/ChildTable/index.native.js.map +1 -1
- package/dist/cjs/components/ColumnHeaderFilter/index.cjs +4 -1
- package/dist/cjs/components/ColumnHeaderFilter/index.native.js +5 -2
- package/dist/cjs/components/ColumnHeaderFilter/index.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableCardControls.native.js +1 -1
- package/dist/cjs/components/DataTable/DataTableCardControls.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableContext.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableDocumentList.cjs +2 -1
- package/dist/cjs/components/DataTable/DataTableDocumentList.native.js +2 -1
- package/dist/cjs/components/DataTable/DataTableDocumentList.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableMobileCards.cjs +10 -4
- package/dist/cjs/components/DataTable/DataTableMobileCards.native.js +12 -6
- package/dist/cjs/components/DataTable/DataTableMobileCards.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableRoot.cjs +16 -9
- package/dist/cjs/components/DataTable/DataTableRoot.native.js +28 -20
- package/dist/cjs/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableStateContext.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableVirtualized.cjs +2 -1
- package/dist/cjs/components/DataTable/DataTableVirtualized.native.js +2 -1
- package/dist/cjs/components/DataTable/DataTableVirtualized.native.js.map +1 -1
- package/dist/cjs/components/DataTable/dataTableChrome.native.js.map +1 -1
- package/dist/cjs/components/DataTable/documentListSlots.native.js.map +1 -1
- package/dist/cjs/components/DataTable/index.native.js +15 -17
- package/dist/cjs/components/DataTable/index.native.js.map +1 -1
- package/dist/cjs/components/DataTable/rowStateChrome.cjs +10 -3
- package/dist/cjs/components/DataTable/rowStateChrome.native.js +10 -3
- package/dist/cjs/components/DataTable/rowStateChrome.native.js.map +1 -1
- package/dist/cjs/components/DataTableBulkActions/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableCell/CellOptionsEditor.native.js.map +1 -1
- package/dist/cjs/components/DataTableCell/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableColumnPinning/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableDateFilter/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableExport/index.cjs +16 -10
- package/dist/cjs/components/DataTableExport/index.native.js +16 -10
- package/dist/cjs/components/DataTableExport/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFacetMenu/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilterButton/index.native.js +1 -1
- package/dist/cjs/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilterChips/FilterChip.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilterChips/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilters/index.native.js +2 -2
- package/dist/cjs/components/DataTableFilters/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableGrouping/index.cjs +2 -2
- package/dist/cjs/components/DataTableGrouping/index.native.js +2 -2
- package/dist/cjs/components/DataTableGrouping/index.native.js.map +1 -1
- package/dist/cjs/components/DataTablePagination/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableSearch/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableToolbar/index.cjs +0 -1
- package/dist/cjs/components/DataTableToolbar/index.native.js +2 -3
- package/dist/cjs/components/DataTableToolbar/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/cjs/components/FilterManager.native.js.map +1 -1
- package/dist/cjs/components/FilterOperatorValueEditor/index.native.js.map +1 -1
- package/dist/cjs/components/KnobDialog.native.js.map +1 -1
- package/dist/cjs/components/SavedFilterDropdown.native.js.map +1 -1
- package/dist/cjs/components/SimpleTable/index.native.js.map +1 -1
- package/dist/cjs/components/TableInput/RowDetailEditor.native.js +1 -1
- package/dist/cjs/components/TableInput/index.native.js +1 -1
- package/dist/cjs/components/TableInput/shared.native.js.map +1 -1
- package/dist/cjs/hooks/useDataTable.native.js.map +1 -1
- package/dist/cjs/hooks/useDataTableKeyboard.native.js.map +1 -1
- package/dist/cjs/hooks/useDragScroll.native.js.map +1 -1
- package/dist/cjs/hooks/useInfiniteRows.native.js.map +1 -1
- package/dist/cjs/hooks/useSavedFilters.native.js.map +1 -1
- package/dist/cjs/hooks/useTableColumnPinning.native.js.map +1 -1
- package/dist/cjs/hooks/useTableFiltering.native.js.map +1 -1
- package/dist/cjs/hooks/useTableGrouping.native.js.map +1 -1
- package/dist/cjs/hooks/useTableKeyboard.native.js.map +1 -1
- package/dist/cjs/hooks/useTablePagination.native.js.map +1 -1
- package/dist/cjs/hooks/useTableSearch.native.js.map +1 -1
- package/dist/cjs/hooks/useTableSelection.native.js.map +1 -1
- package/dist/cjs/hooks/useTableSorting.native.js.map +1 -1
- package/dist/cjs/hooks/useTableUrlSync.native.js.map +1 -1
- package/dist/cjs/hooks/useTableViews.native.js.map +1 -1
- package/dist/cjs/index.native.js +20 -20
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/devWarn.native.js.map +1 -1
- package/dist/cjs/shared/t.native.js.map +1 -1
- package/dist/cjs/shims/primitives.native.js.map +1 -1
- package/dist/cjs/shims/tableCellContext.native.js.map +1 -1
- package/dist/cjs/types.native.js.map +1 -1
- package/dist/cjs/utils/chromeIcons.native.js.map +1 -1
- package/dist/cjs/utils/columnAlign.native.js.map +1 -1
- package/dist/cjs/utils/filterFields.native.js.map +1 -1
- package/dist/cjs/utils/filterUtils.native.js.map +1 -1
- package/dist/cjs/utils/money.native.js.map +1 -1
- package/dist/cjs/utils/paginationDefaults.native.js.map +1 -1
- package/dist/cjs/utils/rowAccumulator.native.js.map +1 -1
- package/dist/cjs/utils/rowPress.native.js.map +1 -1
- package/dist/cjs/utils/urlStateUtils.native.js.map +1 -1
- package/dist/cjs/utils/viewData.native.js.map +1 -1
- package/dist/cjs/utils/withInterp.native.js.map +1 -1
- package/dist/esm/components/ChildTable/index.native.js.map +1 -1
- package/dist/esm/components/ColumnHeaderFilter/index.mjs +5 -2
- package/dist/esm/components/ColumnHeaderFilter/index.mjs.map +1 -1
- package/dist/esm/components/ColumnHeaderFilter/index.native.js +5 -2
- package/dist/esm/components/ColumnHeaderFilter/index.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableCardControls.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableContext.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableDocumentList.mjs +2 -1
- package/dist/esm/components/DataTable/DataTableDocumentList.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableDocumentList.native.js +2 -1
- package/dist/esm/components/DataTable/DataTableDocumentList.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableMobileCards.mjs +11 -5
- package/dist/esm/components/DataTable/DataTableMobileCards.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableMobileCards.native.js +13 -7
- package/dist/esm/components/DataTable/DataTableMobileCards.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.mjs +16 -9
- package/dist/esm/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.native.js +21 -13
- package/dist/esm/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableStateContext.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableVirtualized.mjs +2 -1
- package/dist/esm/components/DataTable/DataTableVirtualized.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableVirtualized.native.js +2 -1
- package/dist/esm/components/DataTable/DataTableVirtualized.native.js.map +1 -1
- package/dist/esm/components/DataTable/dataTableChrome.native.js.map +1 -1
- package/dist/esm/components/DataTable/documentListSlots.native.js.map +1 -1
- package/dist/esm/components/DataTable/index.native.js +5 -7
- package/dist/esm/components/DataTable/index.native.js.map +1 -1
- package/dist/esm/components/DataTable/rowStateChrome.mjs +11 -4
- package/dist/esm/components/DataTable/rowStateChrome.mjs.map +1 -1
- package/dist/esm/components/DataTable/rowStateChrome.native.js +11 -4
- package/dist/esm/components/DataTable/rowStateChrome.native.js.map +1 -1
- package/dist/esm/components/DataTableBulkActions/index.native.js.map +1 -1
- package/dist/esm/components/DataTableCell/CellOptionsEditor.native.js.map +1 -1
- package/dist/esm/components/DataTableCell/index.native.js.map +1 -1
- package/dist/esm/components/DataTableColumnPinning/index.native.js.map +1 -1
- package/dist/esm/components/DataTableDateFilter/index.native.js.map +1 -1
- package/dist/esm/components/DataTableExport/index.mjs +16 -10
- package/dist/esm/components/DataTableExport/index.mjs.map +1 -1
- package/dist/esm/components/DataTableExport/index.native.js +16 -10
- package/dist/esm/components/DataTableExport/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFacetMenu/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFilterChips/FilterChip.native.js.map +1 -1
- package/dist/esm/components/DataTableFilterChips/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFilters/index.native.js.map +1 -1
- package/dist/esm/components/DataTableGrouping/index.mjs +2 -2
- package/dist/esm/components/DataTableGrouping/index.mjs.map +1 -1
- package/dist/esm/components/DataTableGrouping/index.native.js +2 -2
- package/dist/esm/components/DataTableGrouping/index.native.js.map +1 -1
- package/dist/esm/components/DataTablePagination/index.native.js.map +1 -1
- package/dist/esm/components/DataTableSearch/index.native.js.map +1 -1
- package/dist/esm/components/DataTableToolbar/index.mjs +0 -1
- package/dist/esm/components/DataTableToolbar/index.mjs.map +1 -1
- package/dist/esm/components/DataTableToolbar/index.native.js +0 -1
- package/dist/esm/components/DataTableToolbar/index.native.js.map +1 -1
- package/dist/esm/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/esm/components/FilterManager.native.js.map +1 -1
- package/dist/esm/components/FilterOperatorValueEditor/index.native.js.map +1 -1
- package/dist/esm/components/KnobDialog.native.js.map +1 -1
- package/dist/esm/components/SavedFilterDropdown.native.js.map +1 -1
- package/dist/esm/components/SimpleTable/index.native.js.map +1 -1
- package/dist/esm/components/TableInput/shared.native.js.map +1 -1
- package/dist/esm/hooks/useDataTable.native.js.map +1 -1
- package/dist/esm/hooks/useDataTableKeyboard.native.js.map +1 -1
- package/dist/esm/hooks/useDragScroll.native.js.map +1 -1
- package/dist/esm/hooks/useInfiniteRows.native.js.map +1 -1
- package/dist/esm/hooks/useSavedFilters.native.js.map +1 -1
- package/dist/esm/hooks/useTableColumnPinning.native.js.map +1 -1
- package/dist/esm/hooks/useTableFiltering.native.js.map +1 -1
- package/dist/esm/hooks/useTableGrouping.native.js.map +1 -1
- package/dist/esm/hooks/useTableKeyboard.native.js.map +1 -1
- package/dist/esm/hooks/useTablePagination.native.js.map +1 -1
- package/dist/esm/hooks/useTableSearch.native.js.map +1 -1
- package/dist/esm/hooks/useTableSelection.native.js.map +1 -1
- package/dist/esm/hooks/useTableSorting.native.js.map +1 -1
- package/dist/esm/hooks/useTableUrlSync.native.js.map +1 -1
- package/dist/esm/hooks/useTableViews.native.js.map +1 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/shared/devWarn.native.js.map +1 -1
- package/dist/esm/shared/t.native.js.map +1 -1
- package/dist/esm/shims/primitives.native.js.map +1 -1
- package/dist/esm/shims/tableCellContext.native.js.map +1 -1
- package/dist/esm/types.native.js.map +1 -1
- package/dist/esm/utils/chromeIcons.native.js.map +1 -1
- package/dist/esm/utils/columnAlign.native.js.map +1 -1
- package/dist/esm/utils/filterFields.native.js.map +1 -1
- package/dist/esm/utils/filterUtils.native.js.map +1 -1
- package/dist/esm/utils/money.native.js.map +1 -1
- package/dist/esm/utils/paginationDefaults.native.js.map +1 -1
- package/dist/esm/utils/rowAccumulator.native.js.map +1 -1
- package/dist/esm/utils/rowPress.native.js.map +1 -1
- package/dist/esm/utils/urlStateUtils.native.js.map +1 -1
- package/dist/esm/utils/viewData.native.js.map +1 -1
- package/dist/esm/utils/withInterp.native.js.map +1 -1
- package/dist/jsx/components/ChildTable/index.native.js +1 -1
- package/dist/jsx/components/ChildTable/index.native.js.map +1 -1
- package/dist/jsx/components/ColumnHeaderFilter/index.mjs +5 -2
- package/dist/jsx/components/ColumnHeaderFilter/index.mjs.map +1 -1
- package/dist/jsx/components/ColumnHeaderFilter/index.native.js +5 -2
- package/dist/jsx/components/ColumnHeaderFilter/index.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableCardControls.native.js +1 -1
- package/dist/jsx/components/DataTable/DataTableCardControls.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableContext.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableDocumentList.mjs +2 -1
- package/dist/jsx/components/DataTable/DataTableDocumentList.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableDocumentList.native.js +2 -1
- package/dist/jsx/components/DataTable/DataTableDocumentList.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableMobileCards.mjs +11 -5
- package/dist/jsx/components/DataTable/DataTableMobileCards.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableMobileCards.native.js +12 -6
- package/dist/jsx/components/DataTable/DataTableMobileCards.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.mjs +16 -9
- package/dist/jsx/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.native.js +28 -20
- package/dist/jsx/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableStateContext.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableVirtualized.mjs +2 -1
- package/dist/jsx/components/DataTable/DataTableVirtualized.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableVirtualized.native.js +2 -1
- package/dist/jsx/components/DataTable/DataTableVirtualized.native.js.map +1 -1
- package/dist/jsx/components/DataTable/dataTableChrome.native.js.map +1 -1
- package/dist/jsx/components/DataTable/documentListSlots.native.js.map +1 -1
- package/dist/jsx/components/DataTable/index.native.js +15 -17
- package/dist/jsx/components/DataTable/index.native.js.map +1 -1
- package/dist/jsx/components/DataTable/rowStateChrome.mjs +11 -4
- package/dist/jsx/components/DataTable/rowStateChrome.mjs.map +1 -1
- package/dist/jsx/components/DataTable/rowStateChrome.native.js +10 -3
- package/dist/jsx/components/DataTable/rowStateChrome.native.js.map +1 -1
- package/dist/jsx/components/DataTableBulkActions/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableCell/CellOptionsEditor.native.js.map +1 -1
- package/dist/jsx/components/DataTableCell/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableColumnPinning/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableDateFilter/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableExport/index.mjs +16 -10
- package/dist/jsx/components/DataTableExport/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableExport/index.native.js +16 -10
- package/dist/jsx/components/DataTableExport/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableFacetMenu/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilterButton/index.native.js +1 -1
- package/dist/jsx/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilterChips/FilterChip.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilterChips/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilters/index.native.js +2 -2
- package/dist/jsx/components/DataTableFilters/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableGrouping/index.mjs +2 -2
- package/dist/jsx/components/DataTableGrouping/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableGrouping/index.native.js +2 -2
- package/dist/jsx/components/DataTableGrouping/index.native.js.map +1 -1
- package/dist/jsx/components/DataTablePagination/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableSearch/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableToolbar/index.mjs +0 -1
- package/dist/jsx/components/DataTableToolbar/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableToolbar/index.native.js +2 -3
- package/dist/jsx/components/DataTableToolbar/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/jsx/components/FilterManager.native.js.map +1 -1
- package/dist/jsx/components/FilterOperatorValueEditor/index.native.js.map +1 -1
- package/dist/jsx/components/KnobDialog.native.js.map +1 -1
- package/dist/jsx/components/SavedFilterDropdown.native.js.map +1 -1
- package/dist/jsx/components/SimpleTable/index.native.js.map +1 -1
- package/dist/jsx/components/TableInput/RowDetailEditor.native.js +1 -1
- package/dist/jsx/components/TableInput/index.native.js +1 -1
- package/dist/jsx/components/TableInput/shared.native.js.map +1 -1
- package/dist/jsx/hooks/useDataTable.native.js.map +1 -1
- package/dist/jsx/hooks/useDataTableKeyboard.native.js.map +1 -1
- package/dist/jsx/hooks/useDragScroll.native.js.map +1 -1
- package/dist/jsx/hooks/useInfiniteRows.native.js.map +1 -1
- package/dist/jsx/hooks/useSavedFilters.native.js.map +1 -1
- package/dist/jsx/hooks/useTableColumnPinning.native.js.map +1 -1
- package/dist/jsx/hooks/useTableFiltering.native.js.map +1 -1
- package/dist/jsx/hooks/useTableGrouping.native.js.map +1 -1
- package/dist/jsx/hooks/useTableKeyboard.native.js.map +1 -1
- package/dist/jsx/hooks/useTablePagination.native.js.map +1 -1
- package/dist/jsx/hooks/useTableSearch.native.js.map +1 -1
- package/dist/jsx/hooks/useTableSelection.native.js.map +1 -1
- package/dist/jsx/hooks/useTableSorting.native.js.map +1 -1
- package/dist/jsx/hooks/useTableUrlSync.native.js.map +1 -1
- package/dist/jsx/hooks/useTableViews.native.js.map +1 -1
- package/dist/jsx/index.native.js +20 -20
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/devWarn.native.js.map +1 -1
- package/dist/jsx/shared/t.native.js.map +1 -1
- package/dist/jsx/shims/primitives.native.js.map +1 -1
- package/dist/jsx/shims/tableCellContext.native.js.map +1 -1
- package/dist/jsx/types.native.js.map +1 -1
- package/dist/jsx/utils/chromeIcons.native.js.map +1 -1
- package/dist/jsx/utils/columnAlign.native.js.map +1 -1
- package/dist/jsx/utils/filterFields.native.js.map +1 -1
- package/dist/jsx/utils/filterUtils.native.js.map +1 -1
- package/dist/jsx/utils/money.native.js.map +1 -1
- package/dist/jsx/utils/paginationDefaults.native.js.map +1 -1
- package/dist/jsx/utils/rowAccumulator.native.js.map +1 -1
- package/dist/jsx/utils/rowPress.native.js.map +1 -1
- package/dist/jsx/utils/urlStateUtils.native.js.map +1 -1
- package/dist/jsx/utils/viewData.native.js.map +1 -1
- package/dist/jsx/utils/withInterp.native.js.map +1 -1
- package/package.json +12 -12
- package/src/components/ChildTable/ChildTable.stories.tsx +106 -0
- package/src/components/ColumnHeaderFilter/index.tsx +5 -3
- package/src/components/DataTable/DataTable.stories.tsx +27 -1
- package/src/components/DataTable/DataTableDocumentList.tsx +1 -0
- package/src/components/DataTable/DataTableMobileCards.stories.tsx +12 -0
- package/src/components/DataTable/DataTableMobileCards.tsx +15 -6
- package/src/components/DataTable/DataTableRoot.tsx +21 -12
- package/src/components/DataTable/DataTableVirtualized.tsx +1 -0
- package/src/components/DataTable/dataTableMobileCards.spec.tsx +127 -0
- package/src/components/DataTable/index.native.tsx +3 -3
- package/src/components/DataTable/rowStateChrome.ts +8 -4
- package/src/components/DataTable/rowStateFill.spec.tsx +220 -0
- package/src/components/DataTableExport/index.tsx +10 -6
- package/src/components/DataTableGrouping/index.tsx +1 -1
- package/src/components/DataTablePagination/DataTablePagination.stories.tsx +10 -7
- package/src/components/DataTableToolbar/index.tsx +1 -6
- package/types/components/ColumnHeaderFilter/index.d.ts.map +1 -1
- package/types/components/DataTable/DataTableDocumentList.d.ts.map +1 -1
- package/types/components/DataTable/DataTableMobileCards.d.ts +2 -1
- package/types/components/DataTable/DataTableMobileCards.d.ts.map +1 -1
- package/types/components/DataTable/DataTableRoot.d.ts.map +1 -1
- package/types/components/DataTable/DataTableVirtualized.d.ts.map +1 -1
- package/types/components/DataTable/rowStateChrome.d.ts +1 -0
- package/types/components/DataTable/rowStateChrome.d.ts.map +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value"],"sources":["
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","viewData_exports","getViewLeafRows","module","exports","table","leaves","walk","walk1","rows","_iteratorNormalCompletion","_didIteratorError","_iteratorError","_iterator","Symbol","iterator","_step","next","done","row","_row_getIsGrouped","getIsGrouped","_row_subRows","subRows","push","original","err","return","getSortedRowModel","unused"],"sources":["viewData.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar viewData_exports = {};\n__export(viewData_exports, {\n getViewLeafRows: () => getViewLeafRows\n});\nmodule.exports = __toCommonJS(viewData_exports);\nfunction getViewLeafRows(table) {\n try {\n var leaves = [];\n var walk = function walk1(rows) {\n var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;\n try {\n for (var _iterator = rows[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var row = _step.value;\n var _row_getIsGrouped;\n if ((_row_getIsGrouped = row.getIsGrouped) === null || _row_getIsGrouped === void 0 ? void 0 : _row_getIsGrouped.call(row)) {\n var _row_subRows;\n walk((_row_subRows = row.subRows) !== null && _row_subRows !== void 0 ? _row_subRows : []);\n } else {\n leaves.push(row.original);\n }\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n };\n walk(table.getSortedRowModel().rows);\n return leaves;\n } catch (unused) {\n return [];\n }\n}\n//# sourceMappingURL=viewData.js.map\n"],"mappings":"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","ignoreList":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc"],"sources":["
|
|
1
|
+
{"version":3,"names":["__defProp","Object","defineProperty","__getOwnPropDesc","getOwnPropertyDescriptor","__getOwnPropNames","getOwnPropertyNames","__hasOwnProp","prototype","hasOwnProperty","__export","target","all","name","get","enumerable","__copyProps","to","from","except","desc","key","call","__toCommonJS","mod","value","withInterp_exports","bidiIsolate","withInterp","module","exports","translated","options","includes","replace","_","String","text"],"sources":["withInterp.native.js"],"sourcesContent":["\"use strict\";\nvar __defProp = Object.defineProperty;\nvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\nvar __getOwnPropNames = Object.getOwnPropertyNames;\nvar __hasOwnProp = Object.prototype.hasOwnProperty;\nvar __export = (target, all) => {\n for (var name in all)\n __defProp(target, name, { get: all[name], enumerable: true });\n};\nvar __copyProps = (to, from, except, desc) => {\n if (from && typeof from === \"object\" || typeof from === \"function\") {\n for (let key of __getOwnPropNames(from))\n if (!__hasOwnProp.call(to, key) && key !== except)\n __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });\n }\n return to;\n};\nvar __toCommonJS = (mod) => __copyProps(__defProp({}, \"__esModule\", { value: true }), mod);\nvar withInterp_exports = {};\n__export(withInterp_exports, {\n bidiIsolate: () => bidiIsolate,\n withInterp: () => withInterp\n});\nmodule.exports = __toCommonJS(withInterp_exports);\nfunction withInterp(translated, options) {\n if (!translated.includes(\"{{\")) return translated;\n return translated.replace(/\\{\\{(\\w+)\\}\\}/g, function(_, key) {\n var value = options[key];\n return value === void 0 || value === null ? `{{${key}}}` : String(value);\n });\n}\nfunction bidiIsolate(text) {\n if (!text) return text;\n return `\\u2068${text}\\u2069`;\n}\n//# sourceMappingURL=withInterp.js.map\n"],"mappings":"AAAA,YAAY;;AACZ,IAAIA,SAAS,GAAGC,MAAM,CAACC,cAAc;AACrC,IAAIC,gBAAgB,GAAGF,MAAM,CAACG,wBAAwB;AACtD,IAAIC,iBAAiB,GAAGJ,MAAM,CAACK,mBAAmB;AAClD,IAAIC,YAAY,GAAGN,MAAM,CAACO,SAAS,CAACC,cAAc;AAClD,IAAIC,QAAQ,GAAGA,CAACC,MAAM,EAAEC,GAAG,KAAK;EAC9B,KAAK,IAAIC,IAAI,IAAID,GAAG,EAClBZ,SAAS,CAACW,MAAM,EAAEE,IAAI,EAAE;IAAEC,GAAG,EAAEF,GAAG,CAACC,IAAI,CAAC;IAAEE,UAAU,EAAE;EAAK,CAAC,CAAC;AACjE,CAAC;AACD,IAAIC,WAAW,GAAGA,CAACC,EAAE,EAAEC,IAAI,EAAEC,MAAM,EAAEC,IAAI,KAAK;EAC5C,IAAIF,IAAI,IAAI,OAAOA,IAAI,KAAK,QAAQ,IAAI,OAAOA,IAAI,KAAK,UAAU,EAAE;IAClE,KAAK,IAAIG,GAAG,IAAIhB,iBAAiB,CAACa,IAAI,CAAC,EACrC,IAAI,CAACX,YAAY,CAACe,IAAI,CAACL,EAAE,EAAEI,GAAG,CAAC,IAAIA,GAAG,KAAKF,MAAM,EAC/CnB,SAAS,CAACiB,EAAE,EAAEI,GAAG,EAAE;MAAEP,GAAG,EAAEA,CAAA,KAAMI,IAAI,CAACG,GAAG,CAAC;MAAEN,UAAU,EAAE,EAAEK,IAAI,GAAGjB,gBAAgB,CAACe,IAAI,EAAEG,GAAG,CAAC,CAAC,IAAID,IAAI,CAACL;IAAW,CAAC,CAAC;EACxH;EACA,OAAOE,EAAE;AACX,CAAC;AACD,IAAIM,YAAY,GAAIC,GAAG,IAAKR,WAAW,CAAChB,SAAS,CAAC,CAAC,CAAC,EAAE,YAAY,EAAE;EAAEyB,KAAK,EAAE;AAAK,CAAC,CAAC,EAAED,GAAG,CAAC;AAC1F,IAAIE,kBAAkB,GAAG,CAAC,CAAC;AAC3BhB,QAAQ,CAACgB,kBAAkB,EAAE;EAC3BC,WAAW,EAAEA,CAAA,KAAMA,WAAW;EAC9BC,UAAU,EAAEA,CAAA,KAAMA;AACpB,CAAC,CAAC;AACFC,MAAM,CAACC,OAAO,GAAGP,YAAY,CAACG,kBAAkB,CAAC;AACjD,SAASE,UAAUA,CAACG,UAAU,EAAEC,OAAO,EAAE;EACvC,IAAI,CAACD,UAAU,CAACE,QAAQ,CAAC,IAAI,CAAC,EAAE,OAAOF,UAAU;EACjD,OAAOA,UAAU,CAACG,OAAO,CAAC,gBAAgB,EAAE,UAASC,CAAC,EAAEd,GAAG,EAAE;IAC3D,IAAII,KAAK,GAAGO,OAAO,CAACX,GAAG,CAAC;IACxB,OAAOI,KAAK,KAAK,KAAK,CAAC,IAAIA,KAAK,KAAK,IAAI,GAAG,KAAKJ,GAAG,IAAI,GAAGe,MAAM,CAACX,KAAK,CAAC;EAC1E,CAAC,CAAC;AACJ;AACA,SAASE,WAAWA,CAACU,IAAI,EAAE;EACzB,IAAI,CAACA,IAAI,EAAE,OAAOA,IAAI;EACtB,OAAO,SAASA,IAAI,QAAQ;AAC9B","ignoreList":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@multiplatform.one/table",
|
|
3
|
-
"version": "7.
|
|
3
|
+
"version": "7.24.0",
|
|
4
4
|
"description": "Advanced table components with filtering, pagination, sorting, and URL state management",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"cross-platform",
|
|
@@ -74,13 +74,13 @@
|
|
|
74
74
|
"access": "public"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@multiplatform.one/components": "7.
|
|
78
|
-
"@multiplatform.one/forms": "7.
|
|
79
|
-
"@multiplatform.one/platform": "7.
|
|
80
|
-
"@multiplatform.one/rich-text": "7.
|
|
81
|
-
"@multiplatform.one/router": "7.
|
|
82
|
-
"@multiplatform.one/table-primitives": "7.
|
|
83
|
-
"@multiplatform.one/theme": "7.
|
|
77
|
+
"@multiplatform.one/components": "7.24.0",
|
|
78
|
+
"@multiplatform.one/forms": "7.24.0",
|
|
79
|
+
"@multiplatform.one/platform": "7.24.0",
|
|
80
|
+
"@multiplatform.one/rich-text": "7.24.0",
|
|
81
|
+
"@multiplatform.one/router": "7.24.0",
|
|
82
|
+
"@multiplatform.one/table-primitives": "7.24.0",
|
|
83
|
+
"@multiplatform.one/theme": "7.24.0",
|
|
84
84
|
"@phosphor-icons/react": "^2.1.10",
|
|
85
85
|
"@shopify/flash-list": "^2.3.1",
|
|
86
86
|
"@tamagui/roving-focus": "2.7.6",
|
|
@@ -90,10 +90,10 @@
|
|
|
90
90
|
"tamagui": "2.7.6"
|
|
91
91
|
},
|
|
92
92
|
"devDependencies": {
|
|
93
|
-
"@multiplatform.one/config": "7.
|
|
94
|
-
"@multiplatform.one/router": "7.
|
|
95
|
-
"@multiplatform.one/storybook": "7.
|
|
96
|
-
"@multiplatform.one/test-utils": "7.
|
|
93
|
+
"@multiplatform.one/config": "7.24.0",
|
|
94
|
+
"@multiplatform.one/router": "7.24.0",
|
|
95
|
+
"@multiplatform.one/storybook": "7.24.0",
|
|
96
|
+
"@multiplatform.one/test-utils": "7.24.0",
|
|
97
97
|
"@tamagui/build": "2.7.6",
|
|
98
98
|
"@testing-library/react": "^16.3.2",
|
|
99
99
|
"@types/react-dom": "^19.2.3",
|
|
@@ -145,3 +145,109 @@ const InsideFormStory = () => {
|
|
|
145
145
|
export const InsideForm: Story = {
|
|
146
146
|
render: () => <InsideFormStory />,
|
|
147
147
|
};
|
|
148
|
+
|
|
149
|
+
interface OrderLine extends DataTableData {
|
|
150
|
+
id: string;
|
|
151
|
+
idx: number;
|
|
152
|
+
item: string;
|
|
153
|
+
qty: number;
|
|
154
|
+
status: string;
|
|
155
|
+
deliverBy: string;
|
|
156
|
+
rate: number;
|
|
157
|
+
urgent: boolean;
|
|
158
|
+
notes: string;
|
|
159
|
+
}
|
|
160
|
+
|
|
161
|
+
const orderLines: OrderLine[] = [
|
|
162
|
+
{
|
|
163
|
+
id: "line-1",
|
|
164
|
+
idx: 1,
|
|
165
|
+
item: "Steel bracket",
|
|
166
|
+
qty: 12,
|
|
167
|
+
status: "ordered",
|
|
168
|
+
deliverBy: "2026-10-20",
|
|
169
|
+
rate: 4.5,
|
|
170
|
+
urgent: false,
|
|
171
|
+
notes: "",
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
id: "line-2",
|
|
175
|
+
idx: 2,
|
|
176
|
+
item: "M6 bolts (100pk)",
|
|
177
|
+
qty: 3,
|
|
178
|
+
status: "draft",
|
|
179
|
+
deliverBy: "2026-10-12",
|
|
180
|
+
rate: 11.25,
|
|
181
|
+
urgent: true,
|
|
182
|
+
notes: "Split across two pallets",
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
id: "line-3",
|
|
186
|
+
idx: 3,
|
|
187
|
+
item: "Powder coat, black",
|
|
188
|
+
qty: 1,
|
|
189
|
+
status: "received",
|
|
190
|
+
deliverBy: "2026-11-01",
|
|
191
|
+
rate: 89,
|
|
192
|
+
urgent: false,
|
|
193
|
+
notes: "",
|
|
194
|
+
},
|
|
195
|
+
];
|
|
196
|
+
|
|
197
|
+
const statusOptions = [
|
|
198
|
+
{ label: "Draft", value: "draft" },
|
|
199
|
+
{ label: "Ordered", value: "ordered" },
|
|
200
|
+
{ label: "Received", value: "received" },
|
|
201
|
+
{ label: "Cancelled", value: "cancelled" },
|
|
202
|
+
{ label: "Shipped", value: "shipped" },
|
|
203
|
+
{ label: "Returned", value: "returned" },
|
|
204
|
+
];
|
|
205
|
+
|
|
206
|
+
const gridColumns: DataTableColumn<OrderLine>[] = [
|
|
207
|
+
{ accessorKey: "item", header: "Item", field: "input" },
|
|
208
|
+
{ accessorKey: "qty", header: "Qty", field: "stepper", fieldProps: { min: 0 } },
|
|
209
|
+
{
|
|
210
|
+
accessorKey: "status",
|
|
211
|
+
header: "Status",
|
|
212
|
+
field: "select",
|
|
213
|
+
fieldProps: { options: statusOptions },
|
|
214
|
+
},
|
|
215
|
+
{ accessorKey: "deliverBy", header: "Deliver by", field: "datepicker" },
|
|
216
|
+
];
|
|
217
|
+
|
|
218
|
+
const detailColumns: DataTableColumn<OrderLine>[] = [
|
|
219
|
+
...gridColumns,
|
|
220
|
+
{
|
|
221
|
+
accessorKey: "rate",
|
|
222
|
+
header: "Rate",
|
|
223
|
+
field: "stepper",
|
|
224
|
+
fieldProps: { min: 0, step: 0.25, precision: 2, currency: "USD" },
|
|
225
|
+
},
|
|
226
|
+
{ accessorKey: "urgent", header: "Urgent", field: "checkbox" },
|
|
227
|
+
{ accessorKey: "notes", header: "Notes", field: "textarea" },
|
|
228
|
+
];
|
|
229
|
+
|
|
230
|
+
const RowDetailStory = (args: Record<string, unknown>) => {
|
|
231
|
+
const [rows, setRows] = React.useState<OrderLine[]>(orderLines);
|
|
232
|
+
return (
|
|
233
|
+
<YStack gap="$3">
|
|
234
|
+
<ChildTable<OrderLine>
|
|
235
|
+
{...args}
|
|
236
|
+
label="Order lines"
|
|
237
|
+
helperText="The grid shows the list columns; the pencil opens the whole row."
|
|
238
|
+
value={rows}
|
|
239
|
+
columns={gridColumns}
|
|
240
|
+
detailColumns={detailColumns}
|
|
241
|
+
rowDetail
|
|
242
|
+
onChange={setRows}
|
|
243
|
+
/>
|
|
244
|
+
<Text testID="childtable-idx" fontSize="$2" color="$color10" fontFamily="$mono">
|
|
245
|
+
idx: {rows.map((row) => `${row.idx}:${row.item}`).join(" | ")}
|
|
246
|
+
</Text>
|
|
247
|
+
</YStack>
|
|
248
|
+
);
|
|
249
|
+
};
|
|
250
|
+
|
|
251
|
+
export const RowDetail: Story = {
|
|
252
|
+
render: (args) => <RowDetailStory {...args} />,
|
|
253
|
+
};
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
} from "@multiplatform.one/theme";
|
|
17
17
|
import { useState } from "react";
|
|
18
18
|
import { Tooltip } from "@multiplatform.one/components";
|
|
19
|
-
import { Text, View, XStack, YStack } from "tamagui";
|
|
19
|
+
import { Text, View, XStack, YStack, styled } from "tamagui";
|
|
20
20
|
import { t } from "../../shared/t";
|
|
21
21
|
import type { DataTableColumnType, FilterOperator } from "../../types";
|
|
22
22
|
import { iconSizeForToken } from "../../utils/chromeIcons";
|
|
@@ -54,6 +54,8 @@ const FILTER_TRIGGER_OUTSET = Math.max(
|
|
|
54
54
|
Math.ceil((MIN_PRESS_TARGET - FILTER_TRIGGER_VISUAL) / 2),
|
|
55
55
|
);
|
|
56
56
|
|
|
57
|
+
const FilterTriggerTarget = styled(View, { name: "FilterTriggerTarget" });
|
|
58
|
+
|
|
57
59
|
export function ColumnHeaderFilter({
|
|
58
60
|
columnId: _columnId,
|
|
59
61
|
columnLabel,
|
|
@@ -116,7 +118,7 @@ export function ColumnHeaderFilter({
|
|
|
116
118
|
negative outsets. Painted hover and keyboard focus feedback
|
|
117
119
|
ride the glyph-scale ring inside
|
|
118
120
|
(Chip dismiss anatomy). */}
|
|
119
|
-
<
|
|
121
|
+
<FilterTriggerTarget
|
|
120
122
|
cursor="pointer"
|
|
121
123
|
{...pressTargetStyle()}
|
|
122
124
|
alignItems="center"
|
|
@@ -156,7 +158,7 @@ export function ColumnHeaderFilter({
|
|
|
156
158
|
>
|
|
157
159
|
<FunnelIcon size={iconPx} color={glyphColor} weight={isFiltered ? "fill" : "regular"} />
|
|
158
160
|
</View>
|
|
159
|
-
</
|
|
161
|
+
</FilterTriggerTarget>
|
|
160
162
|
</Tooltip>
|
|
161
163
|
);
|
|
162
164
|
|
|
@@ -2979,7 +2979,7 @@ export const CompoundComposition: Story = {
|
|
|
2979
2979
|
* selection checkboxes and the per-row Edit button here — stay isolated:
|
|
2980
2980
|
* pressing them never fires the row press.
|
|
2981
2981
|
*/
|
|
2982
|
-
const RowPressStory = () => {
|
|
2982
|
+
const RowPressStory = ({ body }: { body?: "virtual" | "list" }) => {
|
|
2983
2983
|
const data = useMemo(() => generateUsers(8), []);
|
|
2984
2984
|
const rowPressColumns = useMemo<DataTableColumn<User>[]>(
|
|
2985
2985
|
() => [
|
|
@@ -3018,6 +3018,8 @@ const RowPressStory = () => {
|
|
|
3018
3018
|
onRowPress={fn()}
|
|
3019
3019
|
rowLabel={(row) => (row as User).firstName}
|
|
3020
3020
|
aria-label="Row press table"
|
|
3021
|
+
{...(body === "list" ? { layout: "list" as const } : {})}
|
|
3022
|
+
{...(body === "virtual" ? { enableVirtualization: true, virtualizationHeight: 400 } : {})}
|
|
3021
3023
|
/>
|
|
3022
3024
|
);
|
|
3023
3025
|
};
|
|
@@ -3034,6 +3036,30 @@ export const RowPress: Story = {
|
|
|
3034
3036
|
},
|
|
3035
3037
|
};
|
|
3036
3038
|
|
|
3039
|
+
export const RowPressVirtualized: Story = {
|
|
3040
|
+
render: () => <RowPressStory body="virtual" />,
|
|
3041
|
+
parameters: {
|
|
3042
|
+
docs: {
|
|
3043
|
+
description: {
|
|
3044
|
+
story:
|
|
3045
|
+
"The RowPress contract on virtual rows. A selected row hovers and presses off the fill it rests on, as in the grid (MPO-408).",
|
|
3046
|
+
},
|
|
3047
|
+
},
|
|
3048
|
+
},
|
|
3049
|
+
};
|
|
3050
|
+
|
|
3051
|
+
export const RowPressList: Story = {
|
|
3052
|
+
render: () => <RowPressStory body="list" />,
|
|
3053
|
+
parameters: {
|
|
3054
|
+
docs: {
|
|
3055
|
+
description: {
|
|
3056
|
+
story:
|
|
3057
|
+
"The RowPress contract on the document list. A selected row hovers and presses off the fill it rests on, as in the grid (MPO-408).",
|
|
3058
|
+
},
|
|
3059
|
+
},
|
|
3060
|
+
},
|
|
3061
|
+
};
|
|
3062
|
+
|
|
3037
3063
|
// ============================================================================
|
|
3038
3064
|
// CUSTOM-CELL ALIGNMENT (DG-TBL-01 for custom renderers)
|
|
3039
3065
|
// ============================================================================
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
|
|
13
13
|
import type { Meta } from "@storybook/react-native-web-vite";
|
|
14
14
|
import { useState } from "react";
|
|
15
|
+
import { fn } from "storybook/test";
|
|
15
16
|
import { YStack } from "tamagui";
|
|
16
17
|
import type { DataTableColumn } from "../../types";
|
|
17
18
|
import { DataTable } from "./index";
|
|
@@ -79,6 +80,17 @@ export const Selection = {
|
|
|
79
80
|
render: () => <CardTable enableRowSelection />,
|
|
80
81
|
};
|
|
81
82
|
|
|
83
|
+
/**
|
|
84
|
+
* `onRowPress` makes each card one pressable unit. A pressed card paints one
|
|
85
|
+
* ramp step above the fill it rests on, never below `$color4`, so the press
|
|
86
|
+
* shows at every elevation and on a zebra stripe.
|
|
87
|
+
*/
|
|
88
|
+
export const Pressable = {
|
|
89
|
+
render: () => (
|
|
90
|
+
<CardTable onRowPress={fn()} rowLabel={(row: Person) => `${row.firstName} ${row.lastName}`} />
|
|
91
|
+
),
|
|
92
|
+
};
|
|
93
|
+
|
|
82
94
|
function DeletableCards() {
|
|
83
95
|
const [rows, setRows] = useState(people);
|
|
84
96
|
return (
|
|
@@ -27,7 +27,11 @@ import type React from "react";
|
|
|
27
27
|
import { useCallback } from "react";
|
|
28
28
|
import { Text, View, VisuallyHidden, XStack } from "tamagui";
|
|
29
29
|
import { useTranslation } from "react-i18next";
|
|
30
|
-
import {
|
|
30
|
+
import {
|
|
31
|
+
TableCellContext,
|
|
32
|
+
tablePressFill,
|
|
33
|
+
tableZebraFill,
|
|
34
|
+
} from "@multiplatform.one/table-primitives";
|
|
31
35
|
import type { DataTableColumn, DataTableField } from "../../types";
|
|
32
36
|
import { withInterp } from "../../utils/withInterp";
|
|
33
37
|
import { rowIntentProps } from "./dataTableChrome";
|
|
@@ -132,7 +136,8 @@ export interface DataTableMobileCardsProps<TData> {
|
|
|
132
136
|
* onRowPress support: press/keyboard/AT props for one pressable row
|
|
133
137
|
* (built by DataTableRoot). Cards live outside the table tree, so they
|
|
134
138
|
* take the `card` variant (role="button") with the same activation,
|
|
135
|
-
* roving focus, and inner-control isolation as grid rows.
|
|
139
|
+
* roving focus, and inner-control isolation as grid rows. The card paints
|
|
140
|
+
* its own press fill, off the fill it rests on (MPO-404).
|
|
136
141
|
*/
|
|
137
142
|
getRowPressProps?: (row: any, rowIndex: number, variant?: "row" | "card") => Record<string, any>;
|
|
138
143
|
/** In-flight refetch: do not paint empty-state over a blank body. */
|
|
@@ -189,19 +194,23 @@ export function DataTableMobileCards<TData extends Record<string, any>>({
|
|
|
189
194
|
else if (kind === "control") controls.push(cell);
|
|
190
195
|
}
|
|
191
196
|
const hasBody = bare.length > 0 || figures.length > 0 || controls.length > 0;
|
|
197
|
+
const cardFill = knobProps.cardSurface.backgroundColor;
|
|
198
|
+
const restFill = tableZebraOn && index % 2 === 1 ? tableZebraFill(cardFill) : cardFill;
|
|
199
|
+
const pressProps = getRowPressProps?.(row, index, "card") ?? {};
|
|
192
200
|
|
|
193
201
|
return (
|
|
194
202
|
<View
|
|
195
203
|
key={`${row.id}-${index}`}
|
|
196
204
|
testID="data-table-card"
|
|
197
205
|
{...knobProps.cardSurface}
|
|
198
|
-
{
|
|
199
|
-
? { backgroundColor: tableZebraFill(knobProps.cardSurface.backgroundColor) }
|
|
200
|
-
: {})}
|
|
206
|
+
backgroundColor={restFill}
|
|
201
207
|
{...({
|
|
202
208
|
"data-table-zebra": tableZebraOn ? (index % 2 === 0 ? "even" : "odd") : "off",
|
|
203
209
|
} as any)}
|
|
204
|
-
{...(
|
|
210
|
+
{...(pressProps as any)}
|
|
211
|
+
{...(pressProps.onPress
|
|
212
|
+
? { pressStyle: { backgroundColor: tablePressFill(restFill) } }
|
|
213
|
+
: {})}
|
|
205
214
|
{...(rowIntentProps(rowData) as any)}
|
|
206
215
|
>
|
|
207
216
|
{/* Card header: selection + primary-column title + row number + delete */}
|
|
@@ -609,7 +609,6 @@ export function DataTableRoot<TData extends Record<string, any> = Record<string,
|
|
|
609
609
|
"aria-label": deriveRowLabel(row, rowIndex),
|
|
610
610
|
onPress: handlePress,
|
|
611
611
|
cursor: "pointer" as const,
|
|
612
|
-
pressStyle: { backgroundColor: "$color4" },
|
|
613
612
|
...(variant === "card" ? { role: "button" as const } : {}),
|
|
614
613
|
...(isWeb && !isSSR
|
|
615
614
|
? {
|
|
@@ -1963,6 +1962,7 @@ export function DataTableRoot<TData extends Record<string, any> = Record<string,
|
|
|
1963
1962
|
keyboardFocused: false,
|
|
1964
1963
|
zebraOn: tableZebraOn,
|
|
1965
1964
|
index,
|
|
1965
|
+
pressable: rowPressActive,
|
|
1966
1966
|
}) as any)}
|
|
1967
1967
|
{...({ animation: "quick" } as any)}
|
|
1968
1968
|
flexShrink={0}
|
|
@@ -2098,10 +2098,11 @@ export function DataTableRoot<TData extends Record<string, any> = Record<string,
|
|
|
2098
2098
|
cut off below the fold, so the frame says so with a
|
|
2099
2099
|
bottom fade that clears once the last row is reached.
|
|
2100
2100
|
Sticky inside the scroll container; zero layout cost
|
|
2101
|
-
(
|
|
2102
|
-
Rendered as a Table.Row
|
|
2103
|
-
|
|
2104
|
-
|
|
2101
|
+
(a zero-height row whose cell paints the fade upward
|
|
2102
|
+
over the last visible row). Rendered as a Table.Row
|
|
2103
|
+
and a <td>: a <div> is not a valid child of the real
|
|
2104
|
+
<tbody> or <tr> (SSR parsers foster-parent it out of
|
|
2105
|
+
the table). Only reachable in the flex displayMode
|
|
2105
2106
|
(bodyClipped needs a scrollable body), where the row
|
|
2106
2107
|
renders display:flex like the old View. */}
|
|
2107
2108
|
{isWeb && bodyClipped && (
|
|
@@ -2110,17 +2111,25 @@ export function DataTableRoot<TData extends Record<string, any> = Record<string,
|
|
|
2110
2111
|
role="presentation"
|
|
2111
2112
|
position={"sticky" as any}
|
|
2112
2113
|
bottom={0}
|
|
2113
|
-
height={
|
|
2114
|
-
marginTop={-28}
|
|
2114
|
+
height={0}
|
|
2115
2115
|
flexShrink={0}
|
|
2116
2116
|
zIndex={2}
|
|
2117
2117
|
pointerEvents="none"
|
|
2118
2118
|
{...({ "data-table-clip-affordance": "true" } as any)}
|
|
2119
|
-
|
|
2120
|
-
|
|
2121
|
-
|
|
2122
|
-
|
|
2123
|
-
|
|
2119
|
+
>
|
|
2120
|
+
<View
|
|
2121
|
+
{...({ render: "td" } as Record<string, unknown>)}
|
|
2122
|
+
position="absolute"
|
|
2123
|
+
left={0}
|
|
2124
|
+
right={0}
|
|
2125
|
+
bottom={0}
|
|
2126
|
+
height={28}
|
|
2127
|
+
style={{
|
|
2128
|
+
background:
|
|
2129
|
+
"linear-gradient(to bottom, rgba(0,0,0,0), var(--background))",
|
|
2130
|
+
}}
|
|
2131
|
+
/>
|
|
2132
|
+
</Table.Row>
|
|
2124
2133
|
)}
|
|
2125
2134
|
</Table.Body>
|
|
2126
2135
|
|
|
@@ -19,7 +19,9 @@ import { Preset } from "@multiplatform.one/theme";
|
|
|
19
19
|
import { fireEvent, screen, waitFor, within } from "@testing-library/react";
|
|
20
20
|
import { Theme } from "tamagui";
|
|
21
21
|
import { describe, expect, it, vi } from "vitest";
|
|
22
|
+
import type React from "react";
|
|
22
23
|
import type { DataTableColumn, TableFilter } from "../../types";
|
|
24
|
+
import { DataTableMobileCards } from "./DataTableMobileCards";
|
|
23
25
|
import { DataTable } from "./index";
|
|
24
26
|
|
|
25
27
|
type Person = {
|
|
@@ -221,4 +223,129 @@ describe("DataTableMobileCards", () => {
|
|
|
221
223
|
expect(cardFills("light").slice(0, 2)).toEqual([["_bg-background"], ["_bg-color2"]]);
|
|
222
224
|
});
|
|
223
225
|
});
|
|
226
|
+
|
|
227
|
+
describe("a pressed card steps off the fill it rests on (MPO-404)", () => {
|
|
228
|
+
type Scheme = "light" | "dark";
|
|
229
|
+
type Elevation = "none" | "small" | "medium" | "large";
|
|
230
|
+
const schemes: Scheme[] = ["light", "dark"];
|
|
231
|
+
const elevations: Elevation[] = ["none", "small", "medium", "large"];
|
|
232
|
+
const zebras = ["off", "on"] as const;
|
|
233
|
+
|
|
234
|
+
/** `rest>press` for one card, read off its atomic classes. */
|
|
235
|
+
function paint(card: Element): string {
|
|
236
|
+
const classes = Array.from(card.classList);
|
|
237
|
+
const rest = classes.find((name) => /^_bg-(?!0)/.test(name))?.slice("_bg-".length);
|
|
238
|
+
const press = classes
|
|
239
|
+
.find((name) => name.startsWith("_bg-0active-"))
|
|
240
|
+
?.slice("_bg-0active-".length);
|
|
241
|
+
return `${rest}>${press}`;
|
|
242
|
+
}
|
|
243
|
+
|
|
244
|
+
function wrap(scheme: Scheme, ui: React.ReactElement) {
|
|
245
|
+
return renderWithProviders(scheme === "dark" ? <Theme name="dark">{ui}</Theme> : ui);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
function pressedCards(scheme: Scheme, elevation: Elevation, zebra: "on" | "off") {
|
|
249
|
+
const { container, unmount } = wrap(
|
|
250
|
+
scheme,
|
|
251
|
+
<Preset overrides={{ tableZebra: zebra, elevation }}>
|
|
252
|
+
<DataTable
|
|
253
|
+
data={people}
|
|
254
|
+
columns={columns}
|
|
255
|
+
layout="cards"
|
|
256
|
+
onRowPress={vi.fn()}
|
|
257
|
+
onStateChange={vi.fn()}
|
|
258
|
+
/>
|
|
259
|
+
</Preset>,
|
|
260
|
+
);
|
|
261
|
+
const painted = cards(container).slice(0, 2).map(paint);
|
|
262
|
+
unmount();
|
|
263
|
+
return painted;
|
|
264
|
+
}
|
|
265
|
+
|
|
266
|
+
let rendered: Record<string, string[]> | undefined;
|
|
267
|
+
const matrix = () =>
|
|
268
|
+
(rendered ??= Object.fromEntries(
|
|
269
|
+
schemes.flatMap((scheme) =>
|
|
270
|
+
elevations.flatMap((elevation) =>
|
|
271
|
+
zebras.map((zebra) => [
|
|
272
|
+
`${scheme} ${elevation} zebra-${zebra}`,
|
|
273
|
+
pressedCards(scheme, elevation, zebra),
|
|
274
|
+
]),
|
|
275
|
+
),
|
|
276
|
+
),
|
|
277
|
+
));
|
|
278
|
+
|
|
279
|
+
it("an even and an odd card change fill on press at every elevation, zebra on and off, both schemes", () => {
|
|
280
|
+
const unchanged = Object.entries(matrix()).flatMap(([cell, pair]) =>
|
|
281
|
+
pair
|
|
282
|
+
.filter((rp) => {
|
|
283
|
+
const [rest, press] = rp.split(">");
|
|
284
|
+
return !press || press === "undefined" || press === rest;
|
|
285
|
+
})
|
|
286
|
+
.map((rp) => `${cell}: ${rp}`),
|
|
287
|
+
);
|
|
288
|
+
expect(unchanged).toEqual([]);
|
|
289
|
+
});
|
|
290
|
+
|
|
291
|
+
it("presses one ramp step above the rest fill, floored at $color4", () => {
|
|
292
|
+
expect(matrix()).toEqual({
|
|
293
|
+
"light none zebra-off": ["background>color4", "background>color4"],
|
|
294
|
+
"light none zebra-on": ["background>color4", "color2>color4"],
|
|
295
|
+
"light small zebra-off": ["background>color4", "background>color4"],
|
|
296
|
+
"light small zebra-on": ["background>color4", "color2>color4"],
|
|
297
|
+
"light medium zebra-off": ["background>color4", "background>color4"],
|
|
298
|
+
"light medium zebra-on": ["background>color4", "color2>color4"],
|
|
299
|
+
"light large zebra-off": ["background>color4", "background>color4"],
|
|
300
|
+
"light large zebra-on": ["background>color4", "color2>color4"],
|
|
301
|
+
"dark none zebra-off": ["background>color4", "background>color4"],
|
|
302
|
+
"dark none zebra-on": ["background>color4", "color2>color4"],
|
|
303
|
+
"dark small zebra-off": ["color2>color4", "color2>color4"],
|
|
304
|
+
"dark small zebra-on": ["color2>color4", "color3>color4"],
|
|
305
|
+
"dark medium zebra-off": ["color3>color4", "color3>color4"],
|
|
306
|
+
"dark medium zebra-on": ["color3>color4", "color4>color5"],
|
|
307
|
+
"dark large zebra-off": ["color4>color5", "color4>color5"],
|
|
308
|
+
"dark large zebra-on": ["color4>color5", "color5>color6"],
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
it("owns its press fill whatever press props a root hands it (the native root's shape)", () => {
|
|
313
|
+
const nativeRootPressProps = () => ({
|
|
314
|
+
onPress: vi.fn(),
|
|
315
|
+
role: "button",
|
|
316
|
+
"aria-label": "Row",
|
|
317
|
+
pressStyle: { backgroundColor: "$color4" },
|
|
318
|
+
});
|
|
319
|
+
const rows = people.map((person, index) => ({
|
|
320
|
+
id: String(index),
|
|
321
|
+
original: person,
|
|
322
|
+
getIsSelected: () => false,
|
|
323
|
+
getVisibleCells: () => [
|
|
324
|
+
{
|
|
325
|
+
id: `${index}_firstName`,
|
|
326
|
+
column: { id: "firstName", columnDef: { header: "First Name" } },
|
|
327
|
+
getValue: () => person.firstName,
|
|
328
|
+
},
|
|
329
|
+
],
|
|
330
|
+
}));
|
|
331
|
+
const { container } = wrap(
|
|
332
|
+
"dark",
|
|
333
|
+
<Preset overrides={{ tableZebra: "on", elevation: "large" }}>
|
|
334
|
+
<DataTableMobileCards
|
|
335
|
+
tableRows={rows}
|
|
336
|
+
showRowNumbers={false}
|
|
337
|
+
showDeleteRow={false}
|
|
338
|
+
readOnly
|
|
339
|
+
dataLength={rows.length}
|
|
340
|
+
minRows={0}
|
|
341
|
+
hasActiveFilters={false}
|
|
342
|
+
renderCellContent={(cell) => cell.getValue()}
|
|
343
|
+
onDeleteRow={vi.fn()}
|
|
344
|
+
getRowPressProps={nativeRootPressProps}
|
|
345
|
+
/>
|
|
346
|
+
</Preset>,
|
|
347
|
+
);
|
|
348
|
+
expect(cards(container).slice(0, 2).map(paint)).toEqual(["color4>color5", "color5>color6"]);
|
|
349
|
+
});
|
|
350
|
+
});
|
|
224
351
|
});
|
|
@@ -567,7 +567,6 @@ function DataTableRoot<TData extends Record<string, any> = Record<string, any>>(
|
|
|
567
567
|
onPress: () => onRowPress?.(row.original as TData, index),
|
|
568
568
|
role: "button" as const,
|
|
569
569
|
"aria-label": deriveRowLabel(row, index),
|
|
570
|
-
pressStyle: { backgroundColor: "$color4" },
|
|
571
570
|
};
|
|
572
571
|
},
|
|
573
572
|
[rowPressActive, onRowPress, deriveRowLabel],
|
|
@@ -580,6 +579,7 @@ function DataTableRoot<TData extends Record<string, any> = Record<string, any>>(
|
|
|
580
579
|
selected: Boolean(row.getIsSelected?.()),
|
|
581
580
|
zebraOn: tableZebraOn,
|
|
582
581
|
index,
|
|
582
|
+
pressable: rowPressActive,
|
|
583
583
|
}) as any)}
|
|
584
584
|
rowLocation="middle"
|
|
585
585
|
key={`${row.id}-${index}`}
|
|
@@ -594,7 +594,7 @@ function DataTableRoot<TData extends Record<string, any> = Record<string, any>>(
|
|
|
594
594
|
{renderRowContent(row, index)}
|
|
595
595
|
</Table.Row>
|
|
596
596
|
),
|
|
597
|
-
[renderRowContent, tableZebraOn, t, getRowPressProps],
|
|
597
|
+
[renderRowContent, tableZebraOn, t, getRowPressProps, rowPressActive],
|
|
598
598
|
);
|
|
599
599
|
|
|
600
600
|
const renderToolbarComponent = () => {
|
|
@@ -771,6 +771,7 @@ function DataTableRoot<TData extends Record<string, any> = Record<string, any>>(
|
|
|
771
771
|
flex={1}
|
|
772
772
|
flexDirection="column"
|
|
773
773
|
width="100%"
|
|
774
|
+
paddingBottom={enablePagination ? "$10" : undefined}
|
|
774
775
|
aria-label={`${ariaLabel || "Data table"} content`}
|
|
775
776
|
>
|
|
776
777
|
<Table
|
|
@@ -779,7 +780,6 @@ function DataTableRoot<TData extends Record<string, any> = Record<string, any>>(
|
|
|
779
780
|
cellHeight={cellHeight}
|
|
780
781
|
{...knobProps.borderRadiusOuter}
|
|
781
782
|
width="100%"
|
|
782
|
-
marginBottom={enablePagination ? "$10" : undefined}
|
|
783
783
|
aria-label={ariaLabel || "Data table"}
|
|
784
784
|
aria-rowcount={computed.totalPages * state.pagination.pageSize}
|
|
785
785
|
aria-colcount={
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
* cell when Excel-mode keyboard nav is on the cell).
|
|
7
7
|
*/
|
|
8
8
|
|
|
9
|
-
import { tableZebraFill } from "@multiplatform.one/table-primitives";
|
|
9
|
+
import { tablePressFill, tableZebraFill } from "@multiplatform.one/table-primitives";
|
|
10
10
|
import { ensureFocusVisibleRing, keyboardFocusRingProps } from "@multiplatform.one/theme";
|
|
11
11
|
|
|
12
12
|
export const tableRowFocusVisibleStyle = ensureFocusVisibleRing({ outlineOffset: -2 });
|
|
@@ -16,14 +16,18 @@ export function tableRowStateProps(opts: {
|
|
|
16
16
|
keyboardFocused?: boolean;
|
|
17
17
|
zebraOn?: boolean;
|
|
18
18
|
index?: number;
|
|
19
|
+
pressable?: boolean;
|
|
19
20
|
}): Record<string, unknown> {
|
|
20
21
|
const selected = Boolean(opts.selected);
|
|
21
22
|
const keyboardFocused = Boolean(opts.keyboardFocused);
|
|
22
23
|
const zebra = Boolean(opts.zebraOn) && (opts.index ?? 0) % 2 === 1;
|
|
23
|
-
const rest = zebra ? tableZebraFill("$color1") : "$color1";
|
|
24
|
+
const rest = selected ? "$color4" : zebra ? tableZebraFill("$color1") : "$color1";
|
|
25
|
+
const hover = selected ? tablePressFill(rest) : "$color3";
|
|
24
26
|
return {
|
|
25
|
-
backgroundColor:
|
|
26
|
-
hoverStyle: { backgroundColor:
|
|
27
|
+
backgroundColor: rest,
|
|
28
|
+
hoverStyle: { backgroundColor: hover },
|
|
29
|
+
// A pointer press is hovered too, so the press steps off the hover fill.
|
|
30
|
+
...(opts.pressable ? { pressStyle: { backgroundColor: tablePressFill(hover) } } : {}),
|
|
27
31
|
...(keyboardFocused ? keyboardFocusRingProps : {}),
|
|
28
32
|
"aria-selected": selected ? true : undefined,
|
|
29
33
|
"data-row-selected": selected ? "true" : "false",
|