@multiplatform.one/table 7.70.0 → 7.71.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.native.js +1 -1
- package/dist/cjs/components/ColumnHeaderFilter/index.native.js.map +1 -1
- package/dist/cjs/components/DataTable/CellContent.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableCardControls.cjs +74 -12
- package/dist/cjs/components/DataTable/DataTableCardControls.native.js +84 -13
- 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 +180 -114
- package/dist/cjs/components/DataTable/DataTableDocumentList.native.js +193 -124
- package/dist/cjs/components/DataTable/DataTableDocumentList.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableInfiniteTail.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableMobileCards.cjs +260 -127
- package/dist/cjs/components/DataTable/DataTableMobileCards.native.js +287 -156
- package/dist/cjs/components/DataTable/DataTableMobileCards.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableRoot.cjs +34 -5
- package/dist/cjs/components/DataTable/DataTableRoot.native.js +43 -12
- 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.native.js.map +1 -1
- package/dist/cjs/components/DataTable/NativeInfiniteSentinel.native.js.map +1 -1
- package/dist/cjs/components/DataTable/PhonePager.cjs +56 -0
- package/dist/cjs/components/DataTable/PhonePager.native.js +60 -0
- package/dist/cjs/components/DataTable/PhonePager.native.js.map +1 -0
- 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 +74 -17
- package/dist/cjs/components/DataTable/index.native.js.map +1 -1
- package/dist/cjs/components/DataTable/rowSlotParts.cjs +158 -0
- package/dist/cjs/components/DataTable/rowSlotParts.native.js +170 -0
- package/dist/cjs/components/DataTable/rowSlotParts.native.js.map +1 -0
- package/dist/cjs/components/DataTable/rowSlots.cjs +150 -0
- package/dist/cjs/components/DataTable/rowSlots.native.js +239 -0
- package/dist/cjs/components/DataTable/rowSlots.native.js.map +1 -0
- 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.native.js.map +1 -1
- package/dist/cjs/components/DataTableFacetMenu/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilterButton/index.cjs +25 -3
- package/dist/cjs/components/DataTableFilterButton/index.native.js +26 -4
- 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.native.js.map +1 -1
- package/dist/cjs/components/DataTablePagination/index.cjs +23 -0
- package/dist/cjs/components/DataTablePagination/index.native.js +25 -0
- 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/glyph.cjs +54 -0
- package/dist/cjs/components/DataTableToolbar/glyph.native.js +57 -0
- package/dist/cjs/components/DataTableToolbar/glyph.native.js.map +1 -0
- package/dist/cjs/components/DataTableToolbar/index.cjs +206 -114
- package/dist/cjs/components/DataTableToolbar/index.native.js +219 -114
- 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/columnSizing.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.cjs +5 -1
- package/dist/cjs/index.native.js +5 -1
- 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.native.js.map +1 -1
- package/dist/esm/components/DataTable/CellContent.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableCardControls.mjs +74 -13
- package/dist/esm/components/DataTable/DataTableCardControls.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableCardControls.native.js +83 -13
- 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 +179 -113
- package/dist/esm/components/DataTable/DataTableDocumentList.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableDocumentList.native.js +192 -123
- package/dist/esm/components/DataTable/DataTableDocumentList.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableInfiniteTail.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableMobileCards.mjs +261 -129
- package/dist/esm/components/DataTable/DataTableMobileCards.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableMobileCards.native.js +288 -158
- package/dist/esm/components/DataTable/DataTableMobileCards.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.mjs +36 -7
- package/dist/esm/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.native.js +38 -7
- 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.native.js.map +1 -1
- package/dist/esm/components/DataTable/NativeInfiniteSentinel.native.js.map +1 -1
- package/dist/esm/components/DataTable/PhonePager.mjs +31 -0
- package/dist/esm/components/DataTable/PhonePager.mjs.map +1 -0
- package/dist/esm/components/DataTable/PhonePager.native.js +32 -0
- package/dist/esm/components/DataTable/PhonePager.native.js.map +1 -0
- 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 +67 -10
- package/dist/esm/components/DataTable/index.native.js.map +1 -1
- package/dist/esm/components/DataTable/rowSlotParts.mjs +130 -0
- package/dist/esm/components/DataTable/rowSlotParts.mjs.map +1 -0
- package/dist/esm/components/DataTable/rowSlotParts.native.js +139 -0
- package/dist/esm/components/DataTable/rowSlotParts.native.js.map +1 -0
- package/dist/esm/components/DataTable/rowSlots.mjs +121 -0
- package/dist/esm/components/DataTable/rowSlots.mjs.map +1 -0
- package/dist/esm/components/DataTable/rowSlots.native.js +207 -0
- package/dist/esm/components/DataTable/rowSlots.native.js.map +1 -0
- 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.native.js.map +1 -1
- package/dist/esm/components/DataTableFacetMenu/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFilterButton/index.mjs +24 -3
- package/dist/esm/components/DataTableFilterButton/index.mjs.map +1 -1
- package/dist/esm/components/DataTableFilterButton/index.native.js +24 -3
- 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.native.js.map +1 -1
- package/dist/esm/components/DataTablePagination/index.mjs +23 -0
- package/dist/esm/components/DataTablePagination/index.mjs.map +1 -1
- package/dist/esm/components/DataTablePagination/index.native.js +25 -0
- 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/glyph.mjs +27 -0
- package/dist/esm/components/DataTableToolbar/glyph.mjs.map +1 -0
- package/dist/esm/components/DataTableToolbar/glyph.native.js +27 -0
- package/dist/esm/components/DataTableToolbar/glyph.native.js.map +1 -0
- package/dist/esm/components/DataTableToolbar/index.mjs +211 -119
- package/dist/esm/components/DataTableToolbar/index.mjs.map +1 -1
- package/dist/esm/components/DataTableToolbar/index.native.js +222 -117
- 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/columnSizing.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.mjs +2 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +2 -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/DataTable/DataTableCardControls.mjs +74 -13
- package/dist/jsx/components/DataTable/DataTableCardControls.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableCardControls.native.js +83 -12
- package/dist/jsx/components/DataTable/DataTableCardControls.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableDocumentList.mjs +179 -113
- package/dist/jsx/components/DataTable/DataTableDocumentList.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableDocumentList.native.js +193 -124
- package/dist/jsx/components/DataTable/DataTableDocumentList.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableMobileCards.mjs +261 -129
- package/dist/jsx/components/DataTable/DataTableMobileCards.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableMobileCards.native.js +287 -156
- package/dist/jsx/components/DataTable/DataTableMobileCards.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.mjs +36 -7
- package/dist/jsx/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.native.js +36 -5
- package/dist/jsx/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/jsx/components/DataTable/PhonePager.mjs +31 -0
- package/dist/jsx/components/DataTable/PhonePager.mjs.map +1 -0
- package/dist/jsx/components/DataTable/PhonePager.native.js +60 -0
- package/dist/jsx/components/DataTable/PhonePager.native.js.map +1 -0
- package/dist/jsx/components/DataTable/index.native.js +64 -7
- package/dist/jsx/components/DataTable/index.native.js.map +1 -1
- package/dist/jsx/components/DataTable/rowSlotParts.mjs +130 -0
- package/dist/jsx/components/DataTable/rowSlotParts.mjs.map +1 -0
- package/dist/jsx/components/DataTable/rowSlotParts.native.js +170 -0
- package/dist/jsx/components/DataTable/rowSlotParts.native.js.map +1 -0
- package/dist/jsx/components/DataTable/rowSlots.mjs +121 -0
- package/dist/jsx/components/DataTable/rowSlots.mjs.map +1 -0
- package/dist/jsx/components/DataTable/rowSlots.native.js +239 -0
- package/dist/jsx/components/DataTable/rowSlots.native.js.map +1 -0
- package/dist/jsx/components/DataTableFilterButton/index.mjs +24 -3
- package/dist/jsx/components/DataTableFilterButton/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableFilterButton/index.native.js +25 -3
- package/dist/jsx/components/DataTableFilterButton/index.native.js.map +1 -1
- package/dist/jsx/components/DataTablePagination/index.mjs +23 -0
- package/dist/jsx/components/DataTablePagination/index.mjs.map +1 -1
- package/dist/jsx/components/DataTablePagination/index.native.js +25 -0
- package/dist/jsx/components/DataTablePagination/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableToolbar/glyph.mjs +27 -0
- package/dist/jsx/components/DataTableToolbar/glyph.mjs.map +1 -0
- package/dist/jsx/components/DataTableToolbar/glyph.native.js +57 -0
- package/dist/jsx/components/DataTableToolbar/glyph.native.js.map +1 -0
- package/dist/jsx/components/DataTableToolbar/index.mjs +211 -119
- package/dist/jsx/components/DataTableToolbar/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableToolbar/index.native.js +217 -112
- package/dist/jsx/components/DataTableToolbar/index.native.js.map +1 -1
- package/dist/jsx/index.js +2 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +2 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +5 -1
- package/dist/jsx/index.native.js.map +1 -1
- package/package.json +12 -12
- package/src/components/DataTable/DataTable.spec.tsx +12 -9
- package/src/components/DataTable/DataTable.stories.tsx +110 -43
- package/src/components/DataTable/DataTableCardControls.tsx +103 -24
- package/src/components/DataTable/DataTableDocumentList.stories.tsx +113 -0
- package/src/components/DataTable/DataTableDocumentList.tsx +210 -120
- package/src/components/DataTable/DataTableMobileCards.tsx +280 -147
- package/src/components/DataTable/DataTableRoot.tsx +56 -5
- package/src/components/DataTable/PhonePager.tsx +44 -0
- package/src/components/DataTable/cardLayout.spec.tsx +20 -12
- package/src/components/DataTable/cardToolbar.spec.tsx +31 -26
- package/src/components/DataTable/dataTableCardControls.spec.tsx +10 -9
- package/src/components/DataTable/dataTableDocumentList.spec.tsx +98 -10
- package/src/components/DataTable/dataTableMobileCards.spec.tsx +29 -14
- package/src/components/DataTable/index.native.tsx +90 -9
- package/src/components/DataTable/nativeCardParity.spec.tsx +15 -0
- package/src/components/DataTable/pageRange.spec.tsx +12 -1
- package/src/components/DataTable/rowSlotParts.tsx +184 -0
- package/src/components/DataTable/rowSlots.ts +239 -0
- package/src/components/DataTable/smallTableFooter.spec.tsx +10 -0
- package/src/components/DataTableFilterButton/DataTableFilterButton.spec.tsx +3 -3
- package/src/components/DataTableFilterButton/index.tsx +30 -2
- package/src/components/DataTablePagination/index.tsx +30 -0
- package/src/components/DataTableToolbar/DataTableToolbar.spec.tsx +10 -0
- package/src/components/DataTableToolbar/DataTableToolbar.stories.tsx +16 -7
- package/src/components/DataTableToolbar/compactRow.spec.tsx +197 -0
- package/src/components/DataTableToolbar/glyph.ts +33 -0
- package/src/components/DataTableToolbar/index.tsx +269 -131
- package/src/components/Table/accessibility.spec.tsx +4 -3
- package/src/components/noMiddotJoin.spec.tsx +315 -0
- package/src/components/phoneBottomAccessory.spec.tsx +218 -0
- package/src/components/phoneCardPolish.spec.tsx +214 -0
- package/src/components/phoneCardsDefault.spec.tsx +34 -6
- package/src/components/phonePager.spec.tsx +141 -0
- package/src/components/tableDropdowns.spec.tsx +4 -3
- package/src/index.ts +5 -0
- package/src/types.ts +23 -0
- package/types/components/DataTable/DataTableCardControls.d.ts +12 -0
- package/types/components/DataTable/DataTableCardControls.d.ts.map +1 -1
- package/types/components/DataTable/DataTableDocumentList.d.ts +13 -7
- package/types/components/DataTable/DataTableDocumentList.d.ts.map +1 -1
- package/types/components/DataTable/DataTableMobileCards.d.ts +38 -12
- package/types/components/DataTable/DataTableMobileCards.d.ts.map +1 -1
- package/types/components/DataTable/DataTableRoot.d.ts +1 -1
- package/types/components/DataTable/DataTableRoot.d.ts.map +1 -1
- package/types/components/DataTable/PhonePager.d.ts +24 -0
- package/types/components/DataTable/PhonePager.d.ts.map +1 -0
- package/types/components/DataTable/index.native.d.ts +1 -1
- package/types/components/DataTable/index.native.d.ts.map +1 -1
- package/types/components/DataTable/rowSlotParts.d.ts +30 -0
- package/types/components/DataTable/rowSlotParts.d.ts.map +1 -0
- package/types/components/DataTable/rowSlots.d.ts +74 -0
- package/types/components/DataTable/rowSlots.d.ts.map +1 -0
- package/types/components/DataTableFilterButton/index.d.ts +1 -0
- package/types/components/DataTableFilterButton/index.d.ts.map +1 -1
- package/types/components/DataTablePagination/index.d.ts +5 -0
- package/types/components/DataTablePagination/index.d.ts.map +1 -1
- package/types/components/DataTableToolbar/glyph.d.ts +65 -0
- package/types/components/DataTableToolbar/glyph.d.ts.map +1 -0
- package/types/components/DataTableToolbar/index.d.ts +24 -0
- package/types/components/DataTableToolbar/index.d.ts.map +1 -1
- package/types/index.d.ts +1 -0
- package/types/index.d.ts.map +1 -1
- package/types/types.d.ts +23 -0
- package/types/types.d.ts.map +1 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-7889, Clay's review of the FZ-7816 phone cards (`rv_ff32d3e741fbf100`):
|
|
3
|
+
* a card is the LC-155 Mail row on a card, not the grid's first column in a
|
|
4
|
+
* box.
|
|
5
|
+
*
|
|
6
|
+
* - The title is the first text column. A numeric column ahead of it (an id)
|
|
7
|
+
* is the card's key, a caption at the top right, never the title.
|
|
8
|
+
* - No rule inside a card, and no rule under the card toolbar: the cards are
|
|
9
|
+
* their own surfaces and the toolbar's bottom padding is the gap.
|
|
10
|
+
* - Filter and Sort in the card toolbar are one height (LC-153).
|
|
11
|
+
* - On the page line the card list adds no side inset of its own, so a card
|
|
12
|
+
* sits one gutter from the screen edge, under the page title; the
|
|
13
|
+
* DataTable stories' padding decorator steps aside for a story that is a
|
|
14
|
+
* whole page.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
18
|
+
import { PageGutter } from "@multiplatform.one/theme";
|
|
19
|
+
import { cleanup, screen } from "@testing-library/react";
|
|
20
|
+
import type React from "react";
|
|
21
|
+
import { afterEach, describe, expect, it } from "vitest";
|
|
22
|
+
import type { DataTableColumn } from "../types";
|
|
23
|
+
import { DataTable } from "./DataTable";
|
|
24
|
+
import meta, { OnPhonePage } from "./DataTable/DataTable.stories";
|
|
25
|
+
import { pickCardTitle } from "./DataTable/DataTableMobileCards";
|
|
26
|
+
|
|
27
|
+
afterEach(cleanup);
|
|
28
|
+
|
|
29
|
+
type Person = { id: number; name: string; role: string; active: string; age: number };
|
|
30
|
+
|
|
31
|
+
const people: Person[] = [
|
|
32
|
+
{ id: 1, name: "Ada Lovelace", role: "Engineer", active: "yes", age: 36 },
|
|
33
|
+
{ id: 2, name: "Grace Hopper", role: "Admiral", active: "yes", age: 85 },
|
|
34
|
+
{ id: 3, name: "Alan Turing", role: "Scientist", active: "no", age: 41 },
|
|
35
|
+
];
|
|
36
|
+
|
|
37
|
+
const columns: DataTableColumn<Person>[] = [
|
|
38
|
+
{ accessorKey: "id", header: "ID" },
|
|
39
|
+
{ accessorKey: "name", header: "Name" },
|
|
40
|
+
{ accessorKey: "role", header: "Role" },
|
|
41
|
+
{ accessorKey: "active", header: "Active" },
|
|
42
|
+
{ accessorKey: "age", header: "Age" },
|
|
43
|
+
];
|
|
44
|
+
|
|
45
|
+
function onPage(ui: React.ReactElement) {
|
|
46
|
+
return renderWithProviders(<PageGutter inset="$4">{ui}</PageGutter>);
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
const cards = (container: HTMLElement) =>
|
|
50
|
+
Array.from(container.querySelectorAll<HTMLElement>('[data-testid="data-table-card"]'));
|
|
51
|
+
|
|
52
|
+
function atoms(el: Element, prefix: string): string[] {
|
|
53
|
+
return String((el as HTMLElement).className || "")
|
|
54
|
+
.split(/\s+/)
|
|
55
|
+
.filter((c) => c.startsWith(prefix))
|
|
56
|
+
.sort();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
function cell(id: string, value: unknown, columnMeta?: DataTableColumn["meta"]) {
|
|
60
|
+
return {
|
|
61
|
+
id: `0_${id}`,
|
|
62
|
+
column: { id, columnDef: { id, header: id, meta: columnMeta } },
|
|
63
|
+
getValue: () => value,
|
|
64
|
+
};
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
describe("phone card title (FZ-7889, LC-155)", () => {
|
|
68
|
+
it("skips a leading numeric column: the first text column is the title, the number is the key", () => {
|
|
69
|
+
const id = cell("id", 1);
|
|
70
|
+
const name = cell("name", "Ada Lovelace");
|
|
71
|
+
const role = cell("role", "Engineer");
|
|
72
|
+
const parts = pickCardTitle([id, name, role]);
|
|
73
|
+
expect(parts.title).toBe(name);
|
|
74
|
+
expect(parts.keys).toEqual([id]);
|
|
75
|
+
expect(parts.details).toEqual([role]);
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("a numeric string id is a number too", () => {
|
|
79
|
+
const id = cell("code", "0042");
|
|
80
|
+
const name = cell("name", "Ada");
|
|
81
|
+
expect(pickCardTitle([id, name]).title).toBe(name);
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("skips dates, states and controls when looking for the title", () => {
|
|
85
|
+
const date = cell("created", "2026-10-26");
|
|
86
|
+
const status = cell("status", "Open");
|
|
87
|
+
const action = cell("_actions", "x", { role: "actions" });
|
|
88
|
+
const subject = cell("subject", "Fix the cards");
|
|
89
|
+
const parts = pickCardTitle([date, status, action, subject]);
|
|
90
|
+
expect(parts.title).toBe(subject);
|
|
91
|
+
expect(parts.keys).toEqual([]);
|
|
92
|
+
expect(parts.details).toEqual([date, status, action]);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it("an explicit title role wins", () => {
|
|
96
|
+
const name = cell("name", "Ada");
|
|
97
|
+
const nick = cell("nick", "Countess", { role: "title" });
|
|
98
|
+
expect(pickCardTitle([name, nick]).title).toBe(nick);
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
it("with no text column the first column stays the title", () => {
|
|
102
|
+
const a = cell("a", 1);
|
|
103
|
+
const b = cell("b", 2);
|
|
104
|
+
expect(pickCardTitle([a, b])).toEqual({ title: a, keys: [], details: [b] });
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("renders the name as the card title, the id as a trailing key, one subtitle and a glyph fact (LC-261)", () => {
|
|
108
|
+
const { container } = onPage(<DataTable data={people} columns={columns} />);
|
|
109
|
+
const [first] = cards(container);
|
|
110
|
+
expect(first.querySelector('[data-card-slot="title"]')?.textContent).toBe("Ada Lovelace");
|
|
111
|
+
const key = first.querySelector('[data-card-slot="key"]');
|
|
112
|
+
expect(key?.textContent).toContain("1");
|
|
113
|
+
expect(key?.textContent).toContain("ID:");
|
|
114
|
+
const subtitle = first.querySelector('[data-card-slot="subtitle"]')!;
|
|
115
|
+
expect(subtitle.textContent).toBe("Role: Engineer");
|
|
116
|
+
const fact = first.querySelector('[data-card-slot="fact"]')!;
|
|
117
|
+
expect(fact.textContent).toBe("Age: 36");
|
|
118
|
+
});
|
|
119
|
+
});
|
|
120
|
+
|
|
121
|
+
describe("no stray rules (FZ-7889)", () => {
|
|
122
|
+
it("no hairline divides a card's title from its subtitle", () => {
|
|
123
|
+
const { container } = onPage(<DataTable data={people} columns={columns} />);
|
|
124
|
+
for (const card of cards(container)) {
|
|
125
|
+
// The one rule a row carries is its body's top edge, between rows (FZ-8039).
|
|
126
|
+
for (const line of card.querySelectorAll("[data-card-body] > *")) {
|
|
127
|
+
expect(line.querySelector('[class*="mp-hairline"]')).toBeNull();
|
|
128
|
+
expect(String((line as HTMLElement).className)).not.toContain("mp-hairline");
|
|
129
|
+
}
|
|
130
|
+
for (const el of card.querySelectorAll("*")) {
|
|
131
|
+
expect(atoms(el, "_bbw-").filter((a) => a !== "_bbw-0px")).toEqual([]);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
|
|
136
|
+
it("the card toolbar draws no rule above the cards", () => {
|
|
137
|
+
onPage(<DataTable data={people} columns={columns} />);
|
|
138
|
+
const toolbar = screen.getByRole("toolbar", { name: "Table toolbar" });
|
|
139
|
+
expect(String(toolbar.className)).not.toContain("mp-hairline-b");
|
|
140
|
+
expect(atoms(toolbar, "_bbw-").filter((a) => a !== "_bbw-0px")).toEqual([]);
|
|
141
|
+
});
|
|
142
|
+
|
|
143
|
+
it("the grid toolbar keeps its rule over the header row", () => {
|
|
144
|
+
onPage(<DataTable data={people} columns={columns} layout="table" />);
|
|
145
|
+
const toolbar = screen.getByRole("toolbar", { name: "Table toolbar" });
|
|
146
|
+
expect(String(toolbar.className)).toContain("mp-hairline-b");
|
|
147
|
+
});
|
|
148
|
+
});
|
|
149
|
+
|
|
150
|
+
describe("card toolbar controls are one height (FZ-7889, LC-153)", () => {
|
|
151
|
+
it("Filter and Sort share the toolbar's size token", () => {
|
|
152
|
+
onPage(
|
|
153
|
+
<DataTable
|
|
154
|
+
data={people}
|
|
155
|
+
columns={columns}
|
|
156
|
+
filterableFields={[{ id: "role", label: "Role", type: "text" }] as any}
|
|
157
|
+
/>,
|
|
158
|
+
);
|
|
159
|
+
const filter = screen.getByRole("button", { name: "Filter" });
|
|
160
|
+
const sort = screen.getByLabelText("Sort rows");
|
|
161
|
+
const filterHeight = atoms(filter, "_h-");
|
|
162
|
+
expect(filterHeight.length).toBeGreaterThan(0);
|
|
163
|
+
expect(atoms(sort, "_h-")).toEqual(filterHeight);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
describe("card search spans the toolbar (FZ-7889)", () => {
|
|
168
|
+
// A row wrapper let the field shrink to its content: on iOS a TextInput has
|
|
169
|
+
// no intrinsic width, so Search drew as a lone icon box above Filter/Sort.
|
|
170
|
+
it("the search field's wrapper is a column, so the field stretches to the row", () => {
|
|
171
|
+
onPage(<DataTable data={people} columns={columns} enableGlobalSearch />);
|
|
172
|
+
const toolbar = screen.getByRole("toolbar", { name: "Table toolbar" });
|
|
173
|
+
let wrapper: HTMLElement | null = screen.getByLabelText("Search table data");
|
|
174
|
+
while (wrapper && wrapper.parentElement !== toolbar) wrapper = wrapper.parentElement;
|
|
175
|
+
expect(wrapper).not.toBeNull();
|
|
176
|
+
expect(atoms(wrapper!, "_fd-")).toEqual(["_fd-column"]);
|
|
177
|
+
});
|
|
178
|
+
});
|
|
179
|
+
|
|
180
|
+
describe("one gutter (FZ-7889, LC-151)", () => {
|
|
181
|
+
it("on the page line the card list adds no side inset of its own", () => {
|
|
182
|
+
const { container } = onPage(<DataTable data={people} columns={columns} />);
|
|
183
|
+
const list = container.querySelector('[data-testid="data-table-cards"]')!;
|
|
184
|
+
let el: Element | null = list;
|
|
185
|
+
while (el && el !== container) {
|
|
186
|
+
for (const prefix of ["_pl-", "_pr-", "_ml-", "_mr-"]) {
|
|
187
|
+
expect(
|
|
188
|
+
atoms(el, prefix).filter((a) => !a.endsWith("-0px")),
|
|
189
|
+
`${prefix} on ${el.getAttribute("data-testid") ?? el.tagName}`,
|
|
190
|
+
).toEqual([]);
|
|
191
|
+
}
|
|
192
|
+
el = el.parentElement;
|
|
193
|
+
}
|
|
194
|
+
});
|
|
195
|
+
|
|
196
|
+
it("the stories' padding decorator steps aside for a story that is a whole page", () => {
|
|
197
|
+
const decorate = meta.decorators![0] as any;
|
|
198
|
+
const Story = () => null;
|
|
199
|
+
expect(OnPhonePage.parameters?.pageShell).toBe(true);
|
|
200
|
+
const page = decorate(Story, { parameters: { pageShell: true } });
|
|
201
|
+
expect(page.type).toBe(Story);
|
|
202
|
+
const Probe = () => <span data-testid="story-probe" />;
|
|
203
|
+
const loose = renderWithProviders(decorate(Probe, { parameters: {} }));
|
|
204
|
+
const pad = loose.getByTestId("story-probe").parentElement!;
|
|
205
|
+
expect(pad.className).toMatch(/(^|\s)_p[lt]?-/);
|
|
206
|
+
loose.unmount();
|
|
207
|
+
const onPage = renderWithProviders(
|
|
208
|
+
<PageGutter inset="$4">
|
|
209
|
+
<div data-testid="page">{decorate(Probe, { parameters: {} })}</div>
|
|
210
|
+
</PageGutter>,
|
|
211
|
+
);
|
|
212
|
+
expect(onPage.getByTestId("story-probe").parentElement).toBe(onPage.getByTestId("page"));
|
|
213
|
+
});
|
|
214
|
+
});
|
|
@@ -89,14 +89,42 @@ describe("phone DataTable: cards by default (FZ-7816)", () => {
|
|
|
89
89
|
expect(new Set(fills.map((f) => f.join(" "))).size).toBe(1);
|
|
90
90
|
});
|
|
91
91
|
|
|
92
|
-
it("
|
|
92
|
+
it("records keep the page gutter as one inset group that takes the table card frame", () => {
|
|
93
93
|
const { container } = onPage(<DataTable data={rows} columns={columns} />);
|
|
94
94
|
expect(container.querySelectorAll("[data-phone-bleed]").length).toBe(0);
|
|
95
|
-
const
|
|
96
|
-
// The `surface` border: not the bled row's hairline-only bottom rule.
|
|
97
|
-
expect(classes(
|
|
98
|
-
expect(classes(
|
|
99
|
-
expect(classes(
|
|
95
|
+
const group = container.querySelector('[data-testid="data-table-card-group"]') as HTMLElement;
|
|
96
|
+
// The `surface` border sits on the group: not the bled row's hairline-only bottom rule.
|
|
97
|
+
expect(classes(group)).toMatch(/_btw-/);
|
|
98
|
+
expect(classes(group)).toMatch(/_blw-/);
|
|
99
|
+
expect(classes(group)).not.toMatch(/_btlr-0px|_borderTopLeftRadius-0px/);
|
|
100
|
+
// The group takes the theme's card lift and nothing of its own, so
|
|
101
|
+
// the theme decides it per scheme (none in dark, FZ-8103).
|
|
102
|
+
expect(/_bxsh-|_shadow/.test(classes(group)) || (group.style.boxShadow || "") !== "").toBe(
|
|
103
|
+
true,
|
|
104
|
+
);
|
|
105
|
+
// FZ-8039: a record is a row of the group, not a card of its own. No edge, no lift.
|
|
106
|
+
const records = container.querySelectorAll('[data-testid="data-table-card"]');
|
|
107
|
+
expect(records.length).toBe(rows.length);
|
|
108
|
+
for (const record of records) {
|
|
109
|
+
expect(classes(record)).not.toMatch(/_btw-|_blw-|_shadow|_bxsh-/);
|
|
110
|
+
expect((record as HTMLElement).style.boxShadow || "").toBe("");
|
|
111
|
+
}
|
|
112
|
+
expect(
|
|
113
|
+
container.querySelectorAll(
|
|
114
|
+
'[data-testid="data-table-card-group"] > [data-testid="data-table-card"]',
|
|
115
|
+
).length,
|
|
116
|
+
).toBe(rows.length);
|
|
117
|
+
// The rule between rows starts at the text, past the avatar (Mail,
|
|
118
|
+
// Contacts), and is a container edge rule: a filled 0.5px line rounded
|
|
119
|
+
// away between some rows in Blink.
|
|
120
|
+
const bodies = Array.from(records).map(
|
|
121
|
+
(record) => record.querySelector("[data-card-body]") as HTMLElement,
|
|
122
|
+
);
|
|
123
|
+
expect(String(bodies[0].className)).not.toContain("mp-hairline-t");
|
|
124
|
+
for (const body of bodies.slice(1)) expect(String(body.className)).toContain("mp-hairline-t");
|
|
125
|
+
for (const record of records) {
|
|
126
|
+
expect(String((record as HTMLElement).className)).not.toContain("mp-hairline");
|
|
127
|
+
}
|
|
100
128
|
});
|
|
101
129
|
|
|
102
130
|
it("SimpleTable's and the Table primitive's cards do not stripe or bleed either", () => {
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* FZ-7889 round 3, Clay on the Kitchen Sink pager at phone width: "why do we
|
|
3
|
+
* have three rows of pagination". At the compact width class a DataTable's
|
|
4
|
+
* footer is ONE row, the dot pager between its chevrons, and nothing else:
|
|
5
|
+
* no page numbers, no "Rows per page" Select, no range readout. Rows per page
|
|
6
|
+
* moves into the toolbar's "…" view menu. A wide screen keeps today's footer.
|
|
7
|
+
*
|
|
8
|
+
* Tamagui's useMedia resolves `{ sm: false }` (a phone) in this env; `wide`
|
|
9
|
+
* flips it to a desktop.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
13
|
+
import { cleanup, fireEvent, screen, waitFor } from "@testing-library/react";
|
|
14
|
+
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
15
|
+
import type { DataTableColumn } from "../types";
|
|
16
|
+
import { DataTable } from "./DataTable";
|
|
17
|
+
|
|
18
|
+
const media = vi.hoisted(() => ({ wide: false }));
|
|
19
|
+
|
|
20
|
+
vi.mock("tamagui", async (importOriginal) => {
|
|
21
|
+
const actual = await importOriginal<typeof import("tamagui")>();
|
|
22
|
+
return {
|
|
23
|
+
...actual,
|
|
24
|
+
useMedia: (...args: any[]) => {
|
|
25
|
+
const resolved = (actual.useMedia as any)(...args);
|
|
26
|
+
return media.wide ? { ...resolved, sm: true } : resolved;
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
afterEach(() => {
|
|
32
|
+
media.wide = false;
|
|
33
|
+
cleanup();
|
|
34
|
+
});
|
|
35
|
+
|
|
36
|
+
type Person = { id: number; name: string; role: string };
|
|
37
|
+
|
|
38
|
+
const people: Person[] = Array.from({ length: 5 }, (_, i) => ({
|
|
39
|
+
id: i + 1,
|
|
40
|
+
name: `Person ${i + 1}`,
|
|
41
|
+
role: i % 2 ? "Engineer" : "Admiral",
|
|
42
|
+
}));
|
|
43
|
+
|
|
44
|
+
const columns: DataTableColumn<Person>[] = [
|
|
45
|
+
{ accessorKey: "id", header: "ID" },
|
|
46
|
+
{ accessorKey: "name", header: "Name" },
|
|
47
|
+
{ accessorKey: "role", header: "Role" },
|
|
48
|
+
];
|
|
49
|
+
|
|
50
|
+
function table() {
|
|
51
|
+
return renderWithProviders(
|
|
52
|
+
<DataTable
|
|
53
|
+
data={people}
|
|
54
|
+
columns={columns}
|
|
55
|
+
enablePagination
|
|
56
|
+
pageSizeOptions={[2, 5, 10]}
|
|
57
|
+
initialState={{ pagination: { pageIndex: 1, pageSize: 2 } }}
|
|
58
|
+
/>,
|
|
59
|
+
);
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
describe("compact DataTable pager (FZ-7889)", () => {
|
|
63
|
+
it("is one row: the dot pager, with no numbers, size Select or range", () => {
|
|
64
|
+
const { container } = table();
|
|
65
|
+
const footer = container.querySelector<HTMLElement>("[data-pagination-compact='true']");
|
|
66
|
+
expect(footer).not.toBeNull();
|
|
67
|
+
expect(footer!.querySelectorAll("[data-pagination-dot]")).toHaveLength(3);
|
|
68
|
+
expect(container.querySelector("[aria-current='page']")?.getAttribute("aria-label")).toBe(
|
|
69
|
+
"Go to page 2",
|
|
70
|
+
);
|
|
71
|
+
expect(screen.queryByText(/Rows per page/)).toBeNull();
|
|
72
|
+
expect(container.querySelector("[data-pagination-control='size']")).toBeNull();
|
|
73
|
+
expect(container.querySelector('[data-table-range="true"]')).toBeNull();
|
|
74
|
+
expect(screen.queryByText(/of 5/)).toBeNull();
|
|
75
|
+
expect(screen.queryByText("2 of 3")).toBeNull();
|
|
76
|
+
});
|
|
77
|
+
|
|
78
|
+
it("a dot pages the table", () => {
|
|
79
|
+
const { container } = table();
|
|
80
|
+
fireEvent.click(container.querySelector("[aria-label='Go to page 3']")!);
|
|
81
|
+
expect(screen.getByText("Person 5")).toBeTruthy();
|
|
82
|
+
});
|
|
83
|
+
|
|
84
|
+
it("rows per page lives in the toolbar's view menu", () => {
|
|
85
|
+
const { container } = table();
|
|
86
|
+
const menu = container.querySelector("[data-table-view-menu]");
|
|
87
|
+
expect(menu).not.toBeNull();
|
|
88
|
+
expect(menu!.querySelector("[aria-label='View options']")).not.toBeNull();
|
|
89
|
+
});
|
|
90
|
+
|
|
91
|
+
it("with a More menu, rows per page rides it and the field keeps three glyphs (FZ-8039)", async () => {
|
|
92
|
+
const { container } = renderWithProviders(
|
|
93
|
+
<DataTable
|
|
94
|
+
data={people}
|
|
95
|
+
columns={columns}
|
|
96
|
+
enablePagination
|
|
97
|
+
enableViews
|
|
98
|
+
pageSizeOptions={[2, 5, 10]}
|
|
99
|
+
initialState={{ pagination: { pageIndex: 0, pageSize: 2 } }}
|
|
100
|
+
/>,
|
|
101
|
+
);
|
|
102
|
+
expect(container.querySelector("[data-table-view-menu]")).toBeNull();
|
|
103
|
+
fireEvent.click(screen.getByLabelText("More table actions"));
|
|
104
|
+
await waitFor(() => expect(screen.getByText(/Rows per page/)).toBeTruthy());
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it("a table that fits its smallest page has no view menu", () => {
|
|
108
|
+
const { container } = renderWithProviders(
|
|
109
|
+
<DataTable data={people} columns={columns} enablePagination pageSizeOptions={[5, 10]} />,
|
|
110
|
+
);
|
|
111
|
+
expect(container.querySelector("[data-table-view-menu]")).toBeNull();
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
it("the menu offers the footer's default sizes", async () => {
|
|
115
|
+
const many = Array.from({ length: 40 }, (_, i) => ({
|
|
116
|
+
id: i + 1,
|
|
117
|
+
name: `P${i + 1}`,
|
|
118
|
+
role: "x",
|
|
119
|
+
}));
|
|
120
|
+
const { container } = renderWithProviders(
|
|
121
|
+
<DataTable data={many} columns={columns} enablePagination />,
|
|
122
|
+
);
|
|
123
|
+
fireEvent.click(container.querySelector("[aria-label='View options']")!);
|
|
124
|
+
await waitFor(() => {
|
|
125
|
+
expect(document.querySelectorAll('[role="menuitemcheckbox"]')).toHaveLength(4);
|
|
126
|
+
});
|
|
127
|
+
const sizes = [...document.querySelectorAll('[role="menuitemcheckbox"]')].map((item) =>
|
|
128
|
+
(item.textContent ?? "").replace(/\D/g, ""),
|
|
129
|
+
);
|
|
130
|
+
expect(sizes).toEqual(["10", "25", "50", "100"]);
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
it("a wide screen keeps the numbered footer, the size Select and the range", () => {
|
|
134
|
+
media.wide = true;
|
|
135
|
+
const { container } = table();
|
|
136
|
+
expect(container.querySelector("[data-pagination-compact='true']")).toBeNull();
|
|
137
|
+
expect(container.querySelector("[data-table-view-menu]")).toBeNull();
|
|
138
|
+
expect(container.querySelector('[data-pagination-control="size"]')).not.toBeNull();
|
|
139
|
+
expect(container.querySelector('[data-table-range="true"]')).not.toBeNull();
|
|
140
|
+
});
|
|
141
|
+
});
|
|
@@ -79,7 +79,8 @@ const surfaces: Surface[] = [
|
|
|
79
79
|
content: "Search Options",
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
|
-
|
|
82
|
+
// FZ-8039: on a phone (happy-dom's default media) Save view rides "…".
|
|
83
|
+
name: "toolbar more (save view)",
|
|
83
84
|
ui: (
|
|
84
85
|
<DataTableToolbar
|
|
85
86
|
onSaveView={vi.fn()}
|
|
@@ -89,7 +90,7 @@ const surfaces: Surface[] = [
|
|
|
89
90
|
showViewSelector
|
|
90
91
|
/>
|
|
91
92
|
),
|
|
92
|
-
trigger: () => screen.getByRole("button", { name: "
|
|
93
|
+
trigger: () => screen.getByRole("button", { name: "More table actions" }),
|
|
93
94
|
content: "",
|
|
94
95
|
},
|
|
95
96
|
{
|
|
@@ -138,7 +139,7 @@ describe("table dropdowns open FloatingPanel (MPO-221)", () => {
|
|
|
138
139
|
showViewSelector
|
|
139
140
|
/>,
|
|
140
141
|
);
|
|
141
|
-
fireEvent.click(screen.getByRole("button", { name: "
|
|
142
|
+
fireEvent.click(screen.getByRole("button", { name: "More table actions" }));
|
|
142
143
|
await waitFor(() => expect(panel()).not.toBeNull());
|
|
143
144
|
fireEvent.change(screen.getByLabelText("View name"), { target: { value: "Mine" } });
|
|
144
145
|
fireEvent.click(screen.getByRole("button", { name: "Save" }));
|
package/src/index.ts
CHANGED
|
@@ -63,6 +63,11 @@ export type { SimpleTableProps, SimpleTableColumn } from "./components/SimpleTab
|
|
|
63
63
|
|
|
64
64
|
// Export sub-components (for standalone usage)
|
|
65
65
|
export { DataTableToolbar } from "./components/DataTableToolbar";
|
|
66
|
+
export {
|
|
67
|
+
ToolbarGlyphFieldHeight,
|
|
68
|
+
toolbarGlyphProps,
|
|
69
|
+
useToolbarGlyphProps,
|
|
70
|
+
} from "./components/DataTableToolbar/glyph";
|
|
66
71
|
export { DataTableFilters } from "./components/DataTableFilters";
|
|
67
72
|
export { DataTableFilterButton } from "./components/DataTableFilterButton";
|
|
68
73
|
export { DataTableFilterChips } from "./components/DataTableFilterChips";
|
package/src/types.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { RowAccumulator } from "./utils/rowAccumulator";
|
|
|
3
3
|
import type { UrlStateStrategy } from "./hooks/useDataTable";
|
|
4
4
|
import type { AnyFormApi } from "@multiplatform.one/forms";
|
|
5
5
|
import type React from "react";
|
|
6
|
+
import type { ComponentType } from "react";
|
|
6
7
|
import type { SizeTokens } from "tamagui";
|
|
7
8
|
|
|
8
9
|
// Core Data Types
|
|
@@ -221,7 +222,22 @@ export type DataTableColumn<TData extends DataTableData = DataTableData> = Colum
|
|
|
221
222
|
meta?: {
|
|
222
223
|
label?: string;
|
|
223
224
|
align?: "left" | "center" | "right";
|
|
225
|
+
/**
|
|
226
|
+
* Where the value goes. In the grid it feeds alignment; on a phone row
|
|
227
|
+
* or card it picks the LC-261 slot (`title`, `media`, `indicator`,
|
|
228
|
+
* `subtitle`, `fact`, `stamp`, `key`, `trailing`, `actions`, `hidden`).
|
|
229
|
+
* Unset, the slot comes from the field, `fieldtype`, `options` and value
|
|
230
|
+
* (see `resolveRowSlots`).
|
|
231
|
+
*/
|
|
224
232
|
role?: string;
|
|
233
|
+
/** The Frappe fieldtype behind the column ("Int", "Datetime", "Select"). */
|
|
234
|
+
fieldtype?: string;
|
|
235
|
+
/** The Frappe field options ("Email", "Phone" on a Data field). */
|
|
236
|
+
options?: string;
|
|
237
|
+
/** A fact's glyph on a phone row or card, in place of its label (LC-260). */
|
|
238
|
+
icon?: ComponentType<any>;
|
|
239
|
+
/** A status value's tone for its dot (LC-169); a word map when unset. */
|
|
240
|
+
statusTone?: (value: unknown) => "positive" | "warning" | "critical" | "neutral";
|
|
225
241
|
};
|
|
226
242
|
};
|
|
227
243
|
|
|
@@ -661,6 +677,13 @@ export interface DataTableProps<TData extends DataTableData = DataTableData> {
|
|
|
661
677
|
// Row selection + bulk actions (DG-TBL-02, DG-TBL-03)
|
|
662
678
|
/** Enable row checkboxes and automatic selection toolbar. */
|
|
663
679
|
enableRowSelection?: boolean;
|
|
680
|
+
/**
|
|
681
|
+
* Select mode for a phone list (`layout="list"` at the compact size): rows
|
|
682
|
+
* show their selection marks before anything is selected, as when the
|
|
683
|
+
* screen's Select entry is chosen. A long press on a row enters it too,
|
|
684
|
+
* and a selected row keeps it on.
|
|
685
|
+
*/
|
|
686
|
+
selectMode?: boolean;
|
|
664
687
|
/**
|
|
665
688
|
* Scope for the header select-all checkbox.
|
|
666
689
|
* - `page`: current page only (default)
|
|
@@ -28,5 +28,17 @@ export interface DataTableCardControlsProps {
|
|
|
28
28
|
export declare function DataTableCardSortControl({ table, disabled, contained, }: Pick<DataTableCardControlsProps, "table" | "disabled"> & {
|
|
29
29
|
contained?: boolean;
|
|
30
30
|
}): import("react/jsx-runtime").JSX.Element | null;
|
|
31
|
+
/**
|
|
32
|
+
* The compact toolbar's view menu (FZ-7889). At the compact width class the
|
|
33
|
+
* pager is one row of dots, so the rows-per-page choice moves here. Its
|
|
34
|
+
* trigger is a bare rows glyph inside the search field with Filter and Sort
|
|
35
|
+
* (FZ-8039, LC-176), so it never reads as a second "…" beside More.
|
|
36
|
+
*/
|
|
37
|
+
export declare function DataTableViewMenu({ pageSize, pageSizeOptions, onPageSizeChange, disabled, }: {
|
|
38
|
+
pageSize: number;
|
|
39
|
+
pageSizeOptions: number[];
|
|
40
|
+
onPageSizeChange: (pageSize: number) => void;
|
|
41
|
+
disabled?: boolean;
|
|
42
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
31
43
|
export declare function DataTableCardControls({ table, enableSorting, enableFiltering, availableColumns, disabled, }: DataTableCardControlsProps): import("react/jsx-runtime").JSX.Element | null;
|
|
32
44
|
//# sourceMappingURL=DataTableCardControls.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableCardControls.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableCardControls.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;
|
|
1
|
+
{"version":3,"file":"DataTableCardControls.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableCardControls.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAeH,OAAO,KAAK,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAM5E,MAAM,WAAW,0BAA0B;IACzC,mDAAmD;IACnD,KAAK,EAAE,GAAG,CAAC;IACX,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,6DAA6D;IAC7D,gBAAgB,CAAC,EAAE,KAAK,CAAC;QACvB,EAAE,EAAE,MAAM,CAAC;QACX,KAAK,EAAE,MAAM,CAAC;QACd,IAAI,EAAE,mBAAmB,CAAC;QAC1B,OAAO,CAAC,EAAE,mBAAmB,EAAE,CAAC;KACjC,CAAC,CAAC;IACH,kFAAkF;IAClF,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAOD,wBAAgB,wBAAwB,CAAC,EACvC,KAAK,EACL,QAAgB,EAChB,SAAiB,GAClB,EAAE,IAAI,CAAC,0BAA0B,EAAE,OAAO,GAAG,UAAU,CAAC,GAAG;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAE,kDA6FlF;AAED;;;;;GAKG;AACH,wBAAgB,iBAAiB,CAAC,EAChC,QAAQ,EACR,eAAe,EACf,gBAAgB,EAChB,QAAgB,GACjB,EAAE;IACD,QAAQ,EAAE,MAAM,CAAC;IACjB,eAAe,EAAE,MAAM,EAAE,CAAC;IAC1B,gBAAgB,EAAE,CAAC,QAAQ,EAAE,MAAM,KAAK,IAAI,CAAC;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB,2CA8CA;AAED,wBAAgB,qBAAqB,CAAC,EACpC,KAAK,EACL,aAAqB,EACrB,eAAuB,EACvB,gBAAqB,EACrB,QAAgB,GACjB,EAAE,0BAA0B,kDA2B5B"}
|
|
@@ -7,16 +7,20 @@
|
|
|
7
7
|
* no wrapping into a column grid (Polaris Index / Frappe list). Stacked-group
|
|
8
8
|
* radius (LC-72): first row top corners, last row bottom, interiors square.
|
|
9
9
|
* A `media` column (the doctype's image) leads the row as a thumbnail. In
|
|
10
|
-
* the compact size class
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
10
|
+
* the compact size class each value takes its LC-261 slot (`resolveRowSlots`):
|
|
11
|
+
* one descriptor and its glyph-and-value facts (two, or one beside a
|
|
12
|
+
* descriptor) under the subject, the status as a tone dot and a word beside
|
|
13
|
+
* it, the time at the top right
|
|
14
|
+
* and the actions on the right like desk's phone row (FZ-7684). Nothing is
|
|
15
|
+
* strung together with separators or column labels ("Poke ID 25"); a value
|
|
16
|
+
* with no slot stays off the row. An empty field is left out (FZ-7374).
|
|
14
17
|
* LC-71: selected = fill; keyboard ring rides the row when it is the tab stop.
|
|
15
18
|
*
|
|
16
19
|
* LC-155 ROW-ANATOMY (compact): the subject paints the headline role, the
|
|
17
20
|
* meta line the meta role, and the row is a two-line Mail row. Selection
|
|
18
|
-
*
|
|
19
|
-
*
|
|
21
|
+
* marks (Mail's round check, centred before the thumbnail) appear only in
|
|
22
|
+
* select mode: the screen's Select entry or a long-press enters it, a tap
|
|
23
|
+
* then toggles rows, and clearing the selection leaves it. No stripes.
|
|
20
24
|
*/
|
|
21
25
|
import { type PhoneTableBleed } from "@multiplatform.one/theme";
|
|
22
26
|
import type React from "react";
|
|
@@ -40,6 +44,8 @@ export interface DataTableDocumentListProps<TData> {
|
|
|
40
44
|
queryInFlight?: boolean;
|
|
41
45
|
/** LC-146: rows run edge to edge and take the gutter as their inset. */
|
|
42
46
|
bleed?: PhoneTableBleed | null;
|
|
47
|
+
/** Compact select mode before any row is selected (the screen's Select entry). */
|
|
48
|
+
selectMode?: boolean;
|
|
43
49
|
}
|
|
44
50
|
/**
|
|
45
51
|
* LC-155: wide rows always carry their selection checkbox; a compact row
|
|
@@ -50,5 +56,5 @@ export declare function documentListShowsCheckboxes({ enableRowSelection, compac
|
|
|
50
56
|
compact: boolean;
|
|
51
57
|
selectMode: boolean;
|
|
52
58
|
}): boolean;
|
|
53
|
-
export declare function DataTableDocumentList<TData extends Record<string, any>>({ tableRows, enableRowSelection, disabled, hasActiveFilters, renderCellContent, selectRowLabel, getRowPressProps, queryInFlight, bleed, }: DataTableDocumentListProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
export declare function DataTableDocumentList<TData extends Record<string, any>>({ tableRows, enableRowSelection, disabled, hasActiveFilters, renderCellContent, selectRowLabel, getRowPressProps, queryInFlight, bleed, selectMode: selectModeOn, }: DataTableDocumentListProps<TData>): import("react/jsx-runtime").JSX.Element;
|
|
54
60
|
//# sourceMappingURL=DataTableDocumentList.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DataTableDocumentList.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableDocumentList.tsx"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"DataTableDocumentList.d.ts","sourceRoot":"","sources":["../../../src/components/DataTable/DataTableDocumentList.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AAKH,OAAO,EAML,KAAK,eAAe,EACrB,MAAM,0BAA0B,CAAC;AAElC,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAY/B,iFAAiF;AACjF,wBAAgB,yBAAyB,CACvC,KAAK,SAAS;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE;QAAE,EAAE,EAAE,MAAM,CAAC;QAAC,SAAS,EAAE,OAAO,CAAA;KAAE,CAAA;CAAE,EACxE,YAAY,EAAE,KAAK,EAAE,GAAG,KAAK,GAAG,SAAS,CAY1C;AAED,MAAM,WAAW,0BAA0B,CAAC,KAAK;IAC/C,SAAS,EAAE,GAAG,EAAE,CAAC;IACjB,kBAAkB,CAAC,EAAE,OAAO,CAAC;IAC7B,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,gBAAgB,EAAE,OAAO,CAAC;IAC1B,iBAAiB,EAAE,CAAC,IAAI,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,KAAK,KAAK,CAAC,SAAS,CAAC;IACpF,cAAc,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,KAAK,MAAM,CAAC;IACxD,gBAAgB,CAAC,EAAE,CAAC,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,GAAG,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IACjG,qEAAqE;IACrE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,wEAAwE;IACxE,KAAK,CAAC,EAAE,eAAe,GAAG,IAAI,CAAC;IAC/B,kFAAkF;IAClF,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB;AAOD;;;GAGG;AACH,wBAAgB,2BAA2B,CAAC,EAC1C,kBAAkB,EAClB,OAAO,EACP,UAAU,GACX,EAAE;IACD,kBAAkB,EAAE,OAAO,CAAC;IAC5B,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;CACrB,GAAG,OAAO,CAEV;AAgBD,wBAAgB,qBAAqB,CAAC,KAAK,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,EACvE,SAAS,EACT,kBAA0B,EAC1B,QAAgB,EAChB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,aAAqB,EACrB,KAAY,EACZ,UAAU,EAAE,YAAoB,GACjC,EAAE,0BAA0B,CAAC,KAAK,CAAC,2CAwWnC"}
|
|
@@ -5,23 +5,33 @@
|
|
|
5
5
|
* resolved layout is "cards" (below the `$sm` breakpoint with
|
|
6
6
|
* layout="auto", or forced via layout="cards").
|
|
7
7
|
*
|
|
8
|
-
* Card anatomy
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
8
|
+
* Card anatomy is the LC-155 Mail row on a card (FZ-7889), two lines with
|
|
9
|
+
* every value in its own slot (LC-261, `resolveRowSlots`): the media leads
|
|
10
|
+
* as a circle beside both lines; line 1 is the title in the headline role,
|
|
11
|
+
* the status as a tone dot and one word, the time as a caption at the top
|
|
12
|
+
* right (LC-155), the key (#n) and the row's actions; line 2 is the one
|
|
13
|
+
* descriptor with the facts, glyph and value, in its trailing slot. No
|
|
14
|
+
* number gets a row of its own, no value is strung to another with a
|
|
15
|
+
* separator, and a value with no slot stays off the card. No rule divides
|
|
16
|
+
* the lines. Column visibility and order from table state apply
|
|
12
17
|
* unchanged — cells come from `row.getVisibleCells()`. Values render
|
|
13
18
|
* through the same cell renderers as the grid, inside `TableCellContext`
|
|
14
19
|
* so fields stay chromeless (useIsInTableCell).
|
|
15
20
|
*
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
* the
|
|
21
|
-
* elevation
|
|
21
|
+
* The records are rows of ONE inset grouped list (Settings, Mail, Contacts),
|
|
22
|
+
* not a stack of lifted cards (FZ-8039, rv_2951972109d90970: "the shadows
|
|
23
|
+
* are atrocious", "rows taking up tons of space"). The group takes the Card
|
|
24
|
+
* theme, so its `cardSurface` fill steps off the page as a grouped cell does,
|
|
25
|
+
* with the card radius, edge and the theme's card lift, and nothing of its
|
|
26
|
+
* own: no Tamagui `elevation`, so light mode shows the theme shadow alone
|
|
27
|
+
* and dark mode, where the theme drops it, shows none. No `overflow`
|
|
28
|
+
* clip either, which would hide that shadow on iOS. A hairline from
|
|
29
|
+
* the text's leading edge parts the rows, past the avatar. Each row paints
|
|
30
|
+
* the group's fill with its own corners (first and last), so its press fill
|
|
31
|
+
* stays inside the group's radius.
|
|
22
32
|
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
33
|
+
* The group keeps the page gutter (LC-146 bleeds table rows, not this list)
|
|
34
|
+
* and never stripes (LC-144 stripes table rows).
|
|
25
35
|
*/
|
|
26
36
|
import type React from "react";
|
|
27
37
|
/**
|
|
@@ -54,6 +64,22 @@ export type CardFieldKind = "skip" | "control" | "bare" | "figure";
|
|
|
54
64
|
* 40%-wide column of its own.
|
|
55
65
|
*/
|
|
56
66
|
export declare function classifyCardField(cell: any): CardFieldKind;
|
|
67
|
+
export interface CardTitleParts<TCell> {
|
|
68
|
+
/** The headline: a `meta.role: "title"` column, else the first text column. */
|
|
69
|
+
title: TCell | undefined;
|
|
70
|
+
/** Numeric columns ahead of the title (an id): a caption at the top right. */
|
|
71
|
+
keys: TCell[];
|
|
72
|
+
/** Every other visible column, in order, for the subtitle and controls. */
|
|
73
|
+
details: TCell[];
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* LC-155 on a card: a number is not a subject. The first visible column used
|
|
77
|
+
* to be the title whatever it held, so a table that leads with its id
|
|
78
|
+
* titled every card "1", "2", "3" (FZ-7889). The title is the explicit
|
|
79
|
+
* `title` role, else the first text column; numeric columns that come
|
|
80
|
+
* before it are the card's key.
|
|
81
|
+
*/
|
|
82
|
+
export declare function pickCardTitle<TCell>(cells: TCell[]): CardTitleParts<TCell>;
|
|
57
83
|
export interface DataTableMobileCardsProps<TData> {
|
|
58
84
|
tableRows: any[];
|
|
59
85
|
enableRowSelection?: boolean;
|