@multiplatform.one/table 7.7.6 → 7.8.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/ColumnHeaderFilter/index.cjs +74 -38
- package/dist/cjs/components/ColumnHeaderFilter/index.native.js +97 -51
- package/dist/cjs/components/ColumnHeaderFilter/index.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableCardControls.cjs +0 -1
- package/dist/cjs/components/DataTable/DataTableCardControls.native.js +0 -1
- package/dist/cjs/components/DataTable/DataTableCardControls.native.js.map +1 -1
- package/dist/cjs/components/DataTable/DataTableRoot.cjs +33 -6
- package/dist/cjs/components/DataTable/DataTableRoot.native.js +29 -4
- 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/DataTableBulkActions/index.cjs +0 -4
- package/dist/cjs/components/DataTableBulkActions/index.native.js +0 -4
- package/dist/cjs/components/DataTableBulkActions/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableCell/index.cjs +16 -1
- package/dist/cjs/components/DataTableCell/index.native.js +16 -1
- package/dist/cjs/components/DataTableCell/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableDateFilter/index.cjs +0 -7
- package/dist/cjs/components/DataTableDateFilter/index.native.js +0 -7
- package/dist/cjs/components/DataTableDateFilter/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilterButton/index.cjs +0 -1
- package/dist/cjs/components/DataTableFilterButton/index.native.js +0 -1
- package/dist/cjs/components/DataTableFilterChips/FilterChip.cjs +2 -1
- package/dist/cjs/components/DataTableFilterChips/FilterChip.native.js +4 -1
- package/dist/cjs/components/DataTableFilterChips/FilterChip.native.js.map +1 -1
- package/dist/cjs/components/DataTableFilters/index.cjs +0 -1
- package/dist/cjs/components/DataTableFilters/index.native.js +0 -1
- package/dist/cjs/components/DataTableGrouping/index.cjs +0 -8
- package/dist/cjs/components/DataTableGrouping/index.native.js +0 -8
- package/dist/cjs/components/DataTableGrouping/index.native.js.map +1 -1
- package/dist/cjs/components/DataTablePagination/index.cjs +29 -13
- package/dist/cjs/components/DataTablePagination/index.native.js +30 -14
- package/dist/cjs/components/DataTablePagination/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableSearch/index.cjs +0 -3
- package/dist/cjs/components/DataTableSearch/index.native.js +0 -3
- 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 +0 -1
- package/dist/cjs/components/DataTableToolbar/index.native.js.map +1 -1
- package/dist/cjs/components/DataTableViewOptions/index.cjs +0 -5
- package/dist/cjs/components/DataTableViewOptions/index.native.js +0 -5
- package/dist/cjs/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/cjs/components/FilterManager.cjs +0 -1
- package/dist/cjs/components/FilterManager.native.js +0 -1
- package/dist/cjs/components/FilterManager.native.js.map +1 -1
- package/dist/cjs/components/FilterOperatorValueEditor/index.cjs +2 -2
- package/dist/cjs/components/FilterOperatorValueEditor/index.native.js +2 -2
- package/dist/cjs/components/FilterOperatorValueEditor/index.native.js.map +1 -1
- package/dist/cjs/components/TableInput/index.cjs +2 -1
- package/dist/cjs/components/TableInput/index.native.js +4 -2
- package/dist/cjs/components/TableInput/index.native.js.map +1 -1
- package/dist/cjs/hooks/useDataTable.cjs +24 -8
- package/dist/cjs/hooks/useDataTable.native.js +28 -8
- package/dist/cjs/hooks/useDataTable.native.js.map +1 -1
- package/dist/cjs/index.cjs +12 -0
- package/dist/cjs/index.native.js +12 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/shared/devWarn.cjs +70 -0
- package/dist/cjs/shared/devWarn.native.js +84 -0
- package/dist/cjs/shared/devWarn.native.js.map +1 -0
- package/dist/cjs/utils/columnAlign.cjs +4 -1
- package/dist/cjs/utils/columnAlign.native.js +4 -1
- package/dist/cjs/utils/columnAlign.native.js.map +1 -1
- package/dist/cjs/utils/filterFields.cjs +5 -0
- package/dist/cjs/utils/filterFields.native.js +5 -0
- package/dist/cjs/utils/filterFields.native.js.map +1 -1
- package/dist/cjs/utils/filterUtils.cjs +30 -0
- package/dist/cjs/utils/filterUtils.native.js +50 -0
- package/dist/cjs/utils/filterUtils.native.js.map +1 -1
- package/dist/cjs/utils/money.cjs +137 -0
- package/dist/cjs/utils/money.native.js +165 -0
- package/dist/cjs/utils/money.native.js.map +1 -0
- package/dist/cjs/utils/rowAccumulator.cjs +48 -0
- package/dist/cjs/utils/rowAccumulator.native.js +51 -0
- package/dist/cjs/utils/rowAccumulator.native.js.map +1 -0
- package/dist/esm/components/ColumnHeaderFilter/index.mjs +78 -42
- package/dist/esm/components/ColumnHeaderFilter/index.mjs.map +1 -1
- package/dist/esm/components/ColumnHeaderFilter/index.native.js +101 -55
- package/dist/esm/components/ColumnHeaderFilter/index.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableCardControls.mjs +0 -1
- package/dist/esm/components/DataTable/DataTableCardControls.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableCardControls.native.js +0 -1
- package/dist/esm/components/DataTable/DataTableCardControls.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.mjs +33 -6
- package/dist/esm/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableRoot.native.js +29 -4
- package/dist/esm/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/esm/components/DataTable/DataTableStateContext.mjs.map +1 -1
- package/dist/esm/components/DataTable/DataTableStateContext.native.js.map +1 -1
- package/dist/esm/components/DataTableBulkActions/index.mjs +0 -4
- package/dist/esm/components/DataTableBulkActions/index.mjs.map +1 -1
- package/dist/esm/components/DataTableBulkActions/index.native.js +0 -4
- package/dist/esm/components/DataTableBulkActions/index.native.js.map +1 -1
- package/dist/esm/components/DataTableCell/index.mjs +17 -2
- package/dist/esm/components/DataTableCell/index.mjs.map +1 -1
- package/dist/esm/components/DataTableCell/index.native.js +17 -2
- package/dist/esm/components/DataTableCell/index.native.js.map +1 -1
- package/dist/esm/components/DataTableDateFilter/index.mjs +0 -7
- package/dist/esm/components/DataTableDateFilter/index.mjs.map +1 -1
- package/dist/esm/components/DataTableDateFilter/index.native.js +0 -7
- package/dist/esm/components/DataTableDateFilter/index.native.js.map +1 -1
- package/dist/esm/components/DataTableFilterButton/index.mjs +0 -1
- package/dist/esm/components/DataTableFilterButton/index.mjs.map +1 -1
- package/dist/esm/components/DataTableFilterButton/index.native.js +0 -1
- package/dist/esm/components/DataTableFilterChips/FilterChip.mjs +3 -2
- package/dist/esm/components/DataTableFilterChips/FilterChip.mjs.map +1 -1
- package/dist/esm/components/DataTableFilterChips/FilterChip.native.js +5 -2
- package/dist/esm/components/DataTableFilterChips/FilterChip.native.js.map +1 -1
- package/dist/esm/components/DataTableFilters/index.mjs +0 -1
- package/dist/esm/components/DataTableFilters/index.mjs.map +1 -1
- package/dist/esm/components/DataTableFilters/index.native.js +0 -1
- package/dist/esm/components/DataTableGrouping/index.mjs +0 -8
- package/dist/esm/components/DataTableGrouping/index.mjs.map +1 -1
- package/dist/esm/components/DataTableGrouping/index.native.js +0 -8
- package/dist/esm/components/DataTableGrouping/index.native.js.map +1 -1
- package/dist/esm/components/DataTablePagination/index.mjs +30 -14
- package/dist/esm/components/DataTablePagination/index.mjs.map +1 -1
- package/dist/esm/components/DataTablePagination/index.native.js +31 -15
- package/dist/esm/components/DataTablePagination/index.native.js.map +1 -1
- package/dist/esm/components/DataTableSearch/index.mjs +0 -3
- package/dist/esm/components/DataTableSearch/index.mjs.map +1 -1
- package/dist/esm/components/DataTableSearch/index.native.js +0 -3
- 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.mjs +0 -5
- package/dist/esm/components/DataTableViewOptions/index.mjs.map +1 -1
- package/dist/esm/components/DataTableViewOptions/index.native.js +0 -5
- package/dist/esm/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/esm/components/FilterManager.mjs +0 -1
- package/dist/esm/components/FilterManager.mjs.map +1 -1
- package/dist/esm/components/FilterManager.native.js +0 -1
- package/dist/esm/components/FilterManager.native.js.map +1 -1
- package/dist/esm/components/FilterOperatorValueEditor/index.mjs +2 -2
- package/dist/esm/components/FilterOperatorValueEditor/index.mjs.map +1 -1
- package/dist/esm/components/FilterOperatorValueEditor/index.native.js +2 -2
- package/dist/esm/components/FilterOperatorValueEditor/index.native.js.map +1 -1
- package/dist/esm/components/TableInput/index.mjs +3 -2
- package/dist/esm/components/TableInput/index.mjs.map +1 -1
- package/dist/esm/components/TableInput/index.native.js +5 -3
- package/dist/esm/components/TableInput/index.native.js.map +1 -1
- package/dist/esm/hooks/useDataTable.mjs +24 -8
- package/dist/esm/hooks/useDataTable.mjs.map +1 -1
- package/dist/esm/hooks/useDataTable.native.js +28 -8
- package/dist/esm/hooks/useDataTable.native.js.map +1 -1
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +3 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/shared/devWarn.mjs +43 -0
- package/dist/esm/shared/devWarn.mjs.map +1 -0
- package/dist/esm/shared/devWarn.native.js +54 -0
- package/dist/esm/shared/devWarn.native.js.map +1 -0
- package/dist/esm/utils/columnAlign.mjs +4 -1
- package/dist/esm/utils/columnAlign.mjs.map +1 -1
- package/dist/esm/utils/columnAlign.native.js +4 -1
- package/dist/esm/utils/columnAlign.native.js.map +1 -1
- package/dist/esm/utils/filterFields.mjs +5 -0
- package/dist/esm/utils/filterFields.mjs.map +1 -1
- package/dist/esm/utils/filterFields.native.js +5 -0
- package/dist/esm/utils/filterFields.native.js.map +1 -1
- package/dist/esm/utils/filterUtils.mjs +30 -0
- package/dist/esm/utils/filterUtils.mjs.map +1 -1
- package/dist/esm/utils/filterUtils.native.js +50 -0
- package/dist/esm/utils/filterUtils.native.js.map +1 -1
- package/dist/esm/utils/money.mjs +104 -0
- package/dist/esm/utils/money.mjs.map +1 -0
- package/dist/esm/utils/money.native.js +129 -0
- package/dist/esm/utils/money.native.js.map +1 -0
- package/dist/esm/utils/rowAccumulator.mjs +23 -0
- package/dist/esm/utils/rowAccumulator.mjs.map +1 -0
- package/dist/esm/utils/rowAccumulator.native.js +23 -0
- package/dist/esm/utils/rowAccumulator.native.js.map +1 -0
- package/dist/jsx/components/ColumnHeaderFilter/index.mjs +78 -42
- package/dist/jsx/components/ColumnHeaderFilter/index.mjs.map +1 -1
- package/dist/jsx/components/ColumnHeaderFilter/index.native.js +97 -51
- package/dist/jsx/components/ColumnHeaderFilter/index.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableCardControls.mjs +0 -1
- package/dist/jsx/components/DataTable/DataTableCardControls.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableCardControls.native.js +0 -1
- package/dist/jsx/components/DataTable/DataTableCardControls.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.mjs +33 -6
- package/dist/jsx/components/DataTable/DataTableRoot.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableRoot.native.js +29 -4
- package/dist/jsx/components/DataTable/DataTableRoot.native.js.map +1 -1
- package/dist/jsx/components/DataTable/DataTableStateContext.mjs.map +1 -1
- package/dist/jsx/components/DataTable/DataTableStateContext.native.js.map +1 -1
- package/dist/jsx/components/DataTableBulkActions/index.mjs +0 -4
- package/dist/jsx/components/DataTableBulkActions/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableBulkActions/index.native.js +0 -4
- package/dist/jsx/components/DataTableBulkActions/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableCell/index.mjs +17 -2
- package/dist/jsx/components/DataTableCell/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableCell/index.native.js +16 -1
- package/dist/jsx/components/DataTableCell/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableDateFilter/index.mjs +0 -7
- package/dist/jsx/components/DataTableDateFilter/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableDateFilter/index.native.js +0 -7
- package/dist/jsx/components/DataTableDateFilter/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilterButton/index.mjs +0 -1
- package/dist/jsx/components/DataTableFilterButton/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableFilterButton/index.native.js +0 -1
- package/dist/jsx/components/DataTableFilterChips/FilterChip.mjs +3 -2
- package/dist/jsx/components/DataTableFilterChips/FilterChip.mjs.map +1 -1
- package/dist/jsx/components/DataTableFilterChips/FilterChip.native.js +4 -1
- package/dist/jsx/components/DataTableFilterChips/FilterChip.native.js.map +1 -1
- package/dist/jsx/components/DataTableFilters/index.mjs +0 -1
- package/dist/jsx/components/DataTableFilters/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableFilters/index.native.js +0 -1
- package/dist/jsx/components/DataTableGrouping/index.mjs +0 -8
- package/dist/jsx/components/DataTableGrouping/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableGrouping/index.native.js +0 -8
- package/dist/jsx/components/DataTableGrouping/index.native.js.map +1 -1
- package/dist/jsx/components/DataTablePagination/index.mjs +30 -14
- package/dist/jsx/components/DataTablePagination/index.mjs.map +1 -1
- package/dist/jsx/components/DataTablePagination/index.native.js +30 -14
- package/dist/jsx/components/DataTablePagination/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableSearch/index.mjs +0 -3
- package/dist/jsx/components/DataTableSearch/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableSearch/index.native.js +0 -3
- 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 +0 -1
- package/dist/jsx/components/DataTableToolbar/index.native.js.map +1 -1
- package/dist/jsx/components/DataTableViewOptions/index.mjs +0 -5
- package/dist/jsx/components/DataTableViewOptions/index.mjs.map +1 -1
- package/dist/jsx/components/DataTableViewOptions/index.native.js +0 -5
- package/dist/jsx/components/DataTableViewOptions/index.native.js.map +1 -1
- package/dist/jsx/components/FilterManager.mjs +0 -1
- package/dist/jsx/components/FilterManager.mjs.map +1 -1
- package/dist/jsx/components/FilterManager.native.js +0 -1
- package/dist/jsx/components/FilterManager.native.js.map +1 -1
- package/dist/jsx/components/FilterOperatorValueEditor/index.mjs +2 -2
- package/dist/jsx/components/FilterOperatorValueEditor/index.mjs.map +1 -1
- package/dist/jsx/components/FilterOperatorValueEditor/index.native.js +2 -2
- package/dist/jsx/components/FilterOperatorValueEditor/index.native.js.map +1 -1
- package/dist/jsx/components/TableInput/index.mjs +3 -2
- package/dist/jsx/components/TableInput/index.mjs.map +1 -1
- package/dist/jsx/components/TableInput/index.native.js +4 -2
- package/dist/jsx/components/TableInput/index.native.js.map +1 -1
- package/dist/jsx/hooks/useDataTable.mjs +24 -8
- package/dist/jsx/hooks/useDataTable.mjs.map +1 -1
- package/dist/jsx/hooks/useDataTable.native.js +28 -8
- package/dist/jsx/hooks/useDataTable.native.js.map +1 -1
- package/dist/jsx/index.js +3 -1
- package/dist/jsx/index.js.map +1 -1
- package/dist/jsx/index.mjs +3 -1
- package/dist/jsx/index.mjs.map +1 -1
- package/dist/jsx/index.native.js +12 -0
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/shared/devWarn.mjs +43 -0
- package/dist/jsx/shared/devWarn.mjs.map +1 -0
- package/dist/jsx/shared/devWarn.native.js +84 -0
- package/dist/jsx/shared/devWarn.native.js.map +1 -0
- package/dist/jsx/utils/columnAlign.mjs +4 -1
- package/dist/jsx/utils/columnAlign.mjs.map +1 -1
- package/dist/jsx/utils/columnAlign.native.js +4 -1
- package/dist/jsx/utils/columnAlign.native.js.map +1 -1
- package/dist/jsx/utils/filterFields.mjs +5 -0
- package/dist/jsx/utils/filterFields.mjs.map +1 -1
- package/dist/jsx/utils/filterFields.native.js +5 -0
- package/dist/jsx/utils/filterFields.native.js.map +1 -1
- package/dist/jsx/utils/filterUtils.mjs +30 -0
- package/dist/jsx/utils/filterUtils.mjs.map +1 -1
- package/dist/jsx/utils/filterUtils.native.js +50 -0
- package/dist/jsx/utils/filterUtils.native.js.map +1 -1
- package/dist/jsx/utils/money.mjs +104 -0
- package/dist/jsx/utils/money.mjs.map +1 -0
- package/dist/jsx/utils/money.native.js +165 -0
- package/dist/jsx/utils/money.native.js.map +1 -0
- package/dist/jsx/utils/rowAccumulator.mjs +23 -0
- package/dist/jsx/utils/rowAccumulator.mjs.map +1 -0
- package/dist/jsx/utils/rowAccumulator.native.js +51 -0
- package/dist/jsx/utils/rowAccumulator.native.js.map +1 -0
- package/package.json +12 -12
- package/src/components/ColumnHeaderFilter/ColumnHeaderFilter.spec.tsx +142 -7
- package/src/components/ColumnHeaderFilter/ColumnHeaderFilter.stories.tsx +46 -9
- package/src/components/ColumnHeaderFilter/index.tsx +104 -47
- package/src/components/DataTable/DataTable.stories.tsx +186 -14
- package/src/components/DataTable/DataTableCardControls.tsx +11 -13
- package/src/components/DataTable/DataTableRoot.tsx +40 -14
- package/src/components/DataTable/DataTableStateContext.ts +7 -0
- package/src/components/DataTable/columnWidthLayout.spec.tsx +195 -0
- package/src/components/DataTable/headerSorting.spec.tsx +25 -0
- package/src/components/DataTable/moneyColumn.spec.tsx +151 -0
- package/src/components/DataTable/rowAccumulator.spec.tsx +171 -0
- package/src/components/DataTableBulkActions/index.tsx +0 -4
- package/src/components/DataTableCell/index.tsx +28 -2
- package/src/components/DataTableColumnPinning/DataTableColumnPinning.stories.tsx +0 -4
- package/src/components/DataTableDateFilter/index.tsx +0 -7
- package/src/components/DataTableFilterButton/index.tsx +1 -1
- package/src/components/DataTableFilterChips/FilterChip.spec.tsx +6 -0
- package/src/components/DataTableFilterChips/FilterChip.tsx +3 -2
- package/src/components/DataTableFilters/index.tsx +1 -1
- package/src/components/DataTableGrouping/DataTableGrouping.stories.tsx +0 -4
- package/src/components/DataTableGrouping/index.tsx +1 -13
- package/src/components/DataTablePagination/DataTablePagination.stories.tsx +14 -1
- package/src/components/DataTablePagination/DataTablePagination.width.spec.tsx +51 -0
- package/src/components/DataTablePagination/index.tsx +60 -16
- package/src/components/DataTableSearch/index.tsx +2 -3
- package/src/components/DataTableToolbar/DataTableToolbar.stories.tsx +2 -4
- package/src/components/DataTableToolbar/index.tsx +1 -5
- package/src/components/DataTableViewOptions/index.tsx +2 -13
- package/src/components/FilterManager.tsx +1 -3
- package/src/components/FilterOperatorValueEditor/FilterOperatorValueEditor.spec.tsx +1 -1
- package/src/components/FilterOperatorValueEditor/FilterOperatorValueEditor.stories.tsx +1 -0
- package/src/components/FilterOperatorValueEditor/index.tsx +10 -2
- package/src/components/TableInput/index.native.tsx +3 -2
- package/src/components/TableInput/index.tsx +3 -2
- package/src/hooks/useDataTable.ts +43 -7
- package/src/index.ts +13 -0
- package/src/shared/devWarn.ts +97 -0
- package/src/types.ts +71 -2
- package/src/utils/columnAlign.ts +9 -1
- package/src/utils/filterFields.ts +23 -1
- package/src/utils/filterUtils.ts +50 -1
- package/src/utils/money.spec.ts +156 -0
- package/src/utils/money.ts +202 -0
- package/src/utils/rowAccumulator.ts +136 -0
- package/types/components/ColumnHeaderFilter/index.d.ts +9 -2
- package/types/components/ColumnHeaderFilter/index.d.ts.map +1 -1
- package/types/components/DataTable/DataTableCardControls.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/DataTableStateContext.d.ts +7 -0
- package/types/components/DataTable/DataTableStateContext.d.ts.map +1 -1
- package/types/components/DataTableBulkActions/index.d.ts.map +1 -1
- package/types/components/DataTableCell/index.d.ts.map +1 -1
- package/types/components/DataTableDateFilter/index.d.ts.map +1 -1
- package/types/components/DataTableFilterChips/FilterChip.d.ts.map +1 -1
- package/types/components/DataTableGrouping/index.d.ts.map +1 -1
- package/types/components/DataTablePagination/index.d.ts.map +1 -1
- package/types/components/DataTableSearch/index.d.ts.map +1 -1
- package/types/components/DataTableToolbar/index.d.ts.map +1 -1
- package/types/components/DataTableViewOptions/index.d.ts.map +1 -1
- package/types/components/FilterManager.d.ts.map +1 -1
- package/types/components/FilterOperatorValueEditor/index.d.ts.map +1 -1
- package/types/components/TableInput/index.d.ts.map +1 -1
- package/types/components/TableInput/index.native.d.ts.map +1 -1
- package/types/hooks/useDataTable.d.ts +1 -1
- package/types/hooks/useDataTable.d.ts.map +1 -1
- package/types/index.d.ts +3 -0
- package/types/index.d.ts.map +1 -1
- package/types/shared/devWarn.d.ts +50 -0
- package/types/shared/devWarn.d.ts.map +1 -0
- package/types/types.d.ts +71 -3
- package/types/types.d.ts.map +1 -1
- package/types/utils/columnAlign.d.ts.map +1 -1
- package/types/utils/filterFields.d.ts.map +1 -1
- package/types/utils/filterUtils.d.ts +1 -1
- package/types/utils/filterUtils.d.ts.map +1 -1
- package/types/utils/money.d.ts +94 -0
- package/types/utils/money.d.ts.map +1 -0
- package/types/utils/rowAccumulator.d.ts +107 -0
- package/types/utils/rowAccumulator.d.ts.map +1 -0
|
@@ -326,7 +326,6 @@ export function DataTableDateFilter({
|
|
|
326
326
|
<Popover.Trigger asChild>
|
|
327
327
|
<Button
|
|
328
328
|
size={knobProps.sizeToken}
|
|
329
|
-
variant="outlined"
|
|
330
329
|
disabled={disabled}
|
|
331
330
|
icon={<CalendarIcon size={iconPx} />}
|
|
332
331
|
justifyContent="flex-start"
|
|
@@ -370,7 +369,6 @@ export function DataTableDateFilter({
|
|
|
370
369
|
{value && (
|
|
371
370
|
<Button
|
|
372
371
|
size={knobProps.sizeToken}
|
|
373
|
-
variant="outlined"
|
|
374
372
|
onPress={handleClear}
|
|
375
373
|
icon={<XIcon size={iconPx} />}
|
|
376
374
|
>
|
|
@@ -391,7 +389,6 @@ export function DataTableDateFilter({
|
|
|
391
389
|
<Button
|
|
392
390
|
key={preset.id}
|
|
393
391
|
size={knobProps.sizeToken}
|
|
394
|
-
variant="outlined"
|
|
395
392
|
justifyContent="flex-start"
|
|
396
393
|
onPress={() => handlePresetSelect(preset)}
|
|
397
394
|
{...(activePresetId === preset.id
|
|
@@ -418,7 +415,6 @@ export function DataTableDateFilter({
|
|
|
418
415
|
<Button
|
|
419
416
|
flex={1}
|
|
420
417
|
size={knobProps.sizeToken}
|
|
421
|
-
variant="outlined"
|
|
422
418
|
onPress={() => handleCustomDateSelect(new Date().toISOString(), "is")}
|
|
423
419
|
>
|
|
424
420
|
{t("Today")}
|
|
@@ -426,7 +422,6 @@ export function DataTableDateFilter({
|
|
|
426
422
|
<Button
|
|
427
423
|
flex={1}
|
|
428
424
|
size={knobProps.sizeToken}
|
|
429
|
-
variant="outlined"
|
|
430
425
|
onPress={() =>
|
|
431
426
|
handleCustomDateSelect(
|
|
432
427
|
new Date(Date.now() - 24 * 60 * 60 * 1000).toISOString(),
|
|
@@ -447,7 +442,6 @@ export function DataTableDateFilter({
|
|
|
447
442
|
<Button
|
|
448
443
|
flex={1}
|
|
449
444
|
size={knobProps.sizeToken}
|
|
450
|
-
variant="outlined"
|
|
451
445
|
onPress={() =>
|
|
452
446
|
handleDateRangeSelect(
|
|
453
447
|
new Date(Date.now() - 7 * 24 * 60 * 60 * 1000).toISOString(),
|
|
@@ -460,7 +454,6 @@ export function DataTableDateFilter({
|
|
|
460
454
|
<Button
|
|
461
455
|
flex={1}
|
|
462
456
|
size={knobProps.sizeToken}
|
|
463
|
-
variant="outlined"
|
|
464
457
|
onPress={() =>
|
|
465
458
|
handleDateRangeSelect(
|
|
466
459
|
new Date(Date.now() - 30 * 24 * 60 * 60 * 1000).toISOString(),
|
|
@@ -348,7 +348,7 @@ export function DataTableFilterButton() {
|
|
|
348
348
|
|
|
349
349
|
{editingExisting && (
|
|
350
350
|
<XStack justifyContent="flex-end">
|
|
351
|
-
<Button size="$2"
|
|
351
|
+
<Button size="$2" onPress={handleRemoveCurrent}>
|
|
352
352
|
{t("Remove filter")}
|
|
353
353
|
</Button>
|
|
354
354
|
</XStack>
|
|
@@ -18,6 +18,12 @@ describe("FilterChip", () => {
|
|
|
18
18
|
renderWithProviders(<FilterChip label="Email: contains corp" onRemove={vi.fn()} />);
|
|
19
19
|
expect(screen.getByText("Email: contains corp")).toBeTruthy();
|
|
20
20
|
expect(screen.getByRole("button", { name: "Remove" })).toBeTruthy();
|
|
21
|
+
const fill = screen
|
|
22
|
+
.getByRole("button", { name: "Remove" })
|
|
23
|
+
.querySelector("svg")
|
|
24
|
+
?.getAttribute("fill");
|
|
25
|
+
expect(fill).toBeTruthy();
|
|
26
|
+
expect(fill?.startsWith("$")).toBe(false);
|
|
21
27
|
});
|
|
22
28
|
|
|
23
29
|
it("with onPress the pill is an edit button; both focusables are tab stops (LC-71)", () => {
|
|
@@ -16,7 +16,7 @@ import {
|
|
|
16
16
|
pressTargetStyle,
|
|
17
17
|
useResolvedKnobs,
|
|
18
18
|
} from "@multiplatform.one/theme";
|
|
19
|
-
import { View, styled } from "tamagui";
|
|
19
|
+
import { View, styled, useTheme } from "tamagui";
|
|
20
20
|
import { t } from "../../shared/t";
|
|
21
21
|
|
|
22
22
|
export interface FilterChipProps {
|
|
@@ -49,6 +49,7 @@ const DismissRing = styled(View, {
|
|
|
49
49
|
|
|
50
50
|
export function FilterChip({ label, onRemove, onPress }: FilterChipProps) {
|
|
51
51
|
const { knobProps } = useResolvedKnobs();
|
|
52
|
+
const theme = useTheme();
|
|
52
53
|
if (typeof document !== "undefined") ensureCompositeFocusRing();
|
|
53
54
|
|
|
54
55
|
const resolvedSize = (knobProps.sizeToken as ChipSize) || "$3";
|
|
@@ -114,7 +115,7 @@ export function FilterChip({ label, onRemove, onPress }: FilterChipProps) {
|
|
|
114
115
|
}
|
|
115
116
|
>
|
|
116
117
|
<DismissRing className="mp-chip-dismiss-ring" borderRadius={knobProps.pointy ? 0 : 1000}>
|
|
117
|
-
<XIcon size={iconSize} color=
|
|
118
|
+
<XIcon size={iconSize} color={theme.color12?.val ?? "currentColor"} />
|
|
118
119
|
</DismissRing>
|
|
119
120
|
</DismissButton>
|
|
120
121
|
</ChipFrame>
|
|
@@ -255,7 +255,7 @@ function FilterBuilder({
|
|
|
255
255
|
) : null}
|
|
256
256
|
|
|
257
257
|
<XStack gap="$2" justifyContent="flex-end">
|
|
258
|
-
<Button size="$3" compact
|
|
258
|
+
<Button size="$3" compact onPress={onCancel}>
|
|
259
259
|
{t("Cancel")}
|
|
260
260
|
</Button>
|
|
261
261
|
<Button
|
|
@@ -366,7 +366,6 @@ export const WithGroupingControls = () => {
|
|
|
366
366
|
<XStack gap="$3" flexWrap="wrap">
|
|
367
367
|
<Button
|
|
368
368
|
size="$3"
|
|
369
|
-
variant="outlined"
|
|
370
369
|
onPress={() =>
|
|
371
370
|
setGroupingConfig({
|
|
372
371
|
columns: ["region"],
|
|
@@ -378,7 +377,6 @@ export const WithGroupingControls = () => {
|
|
|
378
377
|
</Button>
|
|
379
378
|
<Button
|
|
380
379
|
size="$3"
|
|
381
|
-
variant="outlined"
|
|
382
380
|
onPress={() =>
|
|
383
381
|
setGroupingConfig({
|
|
384
382
|
columns: ["category"],
|
|
@@ -390,7 +388,6 @@ export const WithGroupingControls = () => {
|
|
|
390
388
|
</Button>
|
|
391
389
|
<Button
|
|
392
390
|
size="$3"
|
|
393
|
-
variant="outlined"
|
|
394
391
|
onPress={() =>
|
|
395
392
|
setGroupingConfig({
|
|
396
393
|
columns: ["region", "category"],
|
|
@@ -405,7 +402,6 @@ export const WithGroupingControls = () => {
|
|
|
405
402
|
</Button>
|
|
406
403
|
<Button
|
|
407
404
|
size="$3"
|
|
408
|
-
variant="outlined"
|
|
409
405
|
onPress={() =>
|
|
410
406
|
setGroupingConfig({
|
|
411
407
|
columns: [],
|
|
@@ -637,7 +637,6 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
637
637
|
<Popover.Trigger asChild>
|
|
638
638
|
<Button
|
|
639
639
|
size={knobProps.sizeToken}
|
|
640
|
-
variant="outlined"
|
|
641
640
|
icon={<GearIcon size={iconSize} />}
|
|
642
641
|
disabled={disabled}
|
|
643
642
|
aria-label="Grouping configuration"
|
|
@@ -716,7 +715,6 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
716
715
|
</Text>
|
|
717
716
|
<Button
|
|
718
717
|
size={knobProps.sizeToken}
|
|
719
|
-
variant="outlined"
|
|
720
718
|
icon={<ArrowUpIcon size={iconSize} />}
|
|
721
719
|
disabled={disabled || index === 0}
|
|
722
720
|
onPress={() => handleMoveGroupBy(index, -1)}
|
|
@@ -724,7 +722,6 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
724
722
|
/>
|
|
725
723
|
<Button
|
|
726
724
|
size={knobProps.sizeToken}
|
|
727
|
-
variant="outlined"
|
|
728
725
|
icon={<ArrowDownIcon size={iconSize} />}
|
|
729
726
|
disabled={disabled || index === currentConfig.columns.length - 1}
|
|
730
727
|
onPress={() => handleMoveGroupBy(index, 1)}
|
|
@@ -732,7 +729,6 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
732
729
|
/>
|
|
733
730
|
<Button
|
|
734
731
|
size={knobProps.sizeToken}
|
|
735
|
-
variant="outlined"
|
|
736
732
|
icon={<MinusIcon size={iconSize} />}
|
|
737
733
|
disabled={disabled}
|
|
738
734
|
onPress={() => handleRemoveGroupBy(columnKey)}
|
|
@@ -756,7 +752,6 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
756
752
|
<Button
|
|
757
753
|
key={key}
|
|
758
754
|
size={knobProps.sizeToken}
|
|
759
|
-
variant="outlined"
|
|
760
755
|
onPress={() => handleAddGroupBy(key)}
|
|
761
756
|
>
|
|
762
757
|
{column.header || key}
|
|
@@ -803,7 +798,6 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
803
798
|
</Text>
|
|
804
799
|
<Button
|
|
805
800
|
size={knobProps.sizeToken}
|
|
806
|
-
variant="outlined"
|
|
807
801
|
icon={<MinusIcon size={iconSize} />}
|
|
808
802
|
disabled={disabled}
|
|
809
803
|
onPress={() => handleRemoveAggregation(index)}
|
|
@@ -828,7 +822,6 @@ export function DataTableGroupingConfig<T = any>(props: DataTableGroupingConfigP
|
|
|
828
822
|
<Separator />
|
|
829
823
|
<Button
|
|
830
824
|
size={knobProps.sizeToken}
|
|
831
|
-
variant="outlined"
|
|
832
825
|
error
|
|
833
826
|
onPress={() => onConfigChange({ columns: [], aggregations: [] })}
|
|
834
827
|
aria-label="Clear all grouping and aggregation"
|
|
@@ -946,12 +939,7 @@ function AggregationSelector<T = any>({ columns, onAddAggregation }: Aggregation
|
|
|
946
939
|
/>
|
|
947
940
|
</View>
|
|
948
941
|
|
|
949
|
-
<Button
|
|
950
|
-
size={knobProps.sizeToken}
|
|
951
|
-
variant="outlined"
|
|
952
|
-
disabled={!selectedColumn}
|
|
953
|
-
onPress={handleAdd}
|
|
954
|
-
>
|
|
942
|
+
<Button size={knobProps.sizeToken} disabled={!selectedColumn} onPress={handleAdd}>
|
|
955
943
|
Add
|
|
956
944
|
</Button>
|
|
957
945
|
</XStack>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { action } from "@multiplatform.one/storybook";
|
|
2
2
|
import type { GuardrailSpecimenParameter } from "@multiplatform.one/theme";
|
|
3
|
+
import { Preset } from "@multiplatform.one/theme";
|
|
3
4
|
import type { Meta, StoryObj } from "@storybook/react-native-web-vite";
|
|
4
5
|
import React from "react";
|
|
5
6
|
// Catalog Button + Input (LC-56 STORY-HONESTY — no raw interactive primitives).
|
|
@@ -782,7 +783,7 @@ export const InfiniteVirtualized: Story = {
|
|
|
782
783
|
};
|
|
783
784
|
|
|
784
785
|
export const NarrowPanel: Story = {
|
|
785
|
-
render: () => {
|
|
786
|
+
render: (args) => {
|
|
786
787
|
const [pagination, setPagination] = React.useState({ pageIndex: 0, pageSize: 25 });
|
|
787
788
|
return (
|
|
788
789
|
<YStack width={249}>
|
|
@@ -794,8 +795,20 @@ export const NarrowPanel: Story = {
|
|
|
794
795
|
totalPages: Math.ceil(1000 / pagination.pageSize),
|
|
795
796
|
}}
|
|
796
797
|
onPaginationChange={setPagination}
|
|
798
|
+
{...args}
|
|
797
799
|
/>
|
|
798
800
|
</YStack>
|
|
799
801
|
);
|
|
800
802
|
},
|
|
801
803
|
};
|
|
804
|
+
|
|
805
|
+
export const LargeSpaceNarrow: Story = {
|
|
806
|
+
...NarrowPanel,
|
|
807
|
+
decorators: [
|
|
808
|
+
(Story) => (
|
|
809
|
+
<Preset overrides={{ space: "large" }}>
|
|
810
|
+
<Story />
|
|
811
|
+
</Preset>
|
|
812
|
+
),
|
|
813
|
+
],
|
|
814
|
+
};
|
|
@@ -3,16 +3,22 @@ import { renderWithProviders } from "@multiplatform.one/test-utils";
|
|
|
3
3
|
import { act, fireEvent, screen, within } from "@testing-library/react";
|
|
4
4
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
5
5
|
import type { LayoutChangeEvent } from "react-native";
|
|
6
|
+
import { Preset } from "@multiplatform.one/theme";
|
|
6
7
|
|
|
7
8
|
const observed = vi.hoisted(() => ({
|
|
8
9
|
onLayout: undefined as undefined | ((event: LayoutChangeEvent) => void),
|
|
9
10
|
change: vi.fn(),
|
|
11
|
+
sizeWidth: 0,
|
|
10
12
|
}));
|
|
11
13
|
vi.mock("tamagui", async (importOriginal) => {
|
|
12
14
|
const actual = await importOriginal<typeof import("tamagui")>();
|
|
13
15
|
return {
|
|
14
16
|
...actual,
|
|
15
17
|
useMedia: () => ({ sm: true }),
|
|
18
|
+
View: forwardRef((props: any, ref) => {
|
|
19
|
+
if (props["data-pagination-control"] === "size") observed.sizeWidth = props.width;
|
|
20
|
+
return createElement(actual.View, { ...props, ref });
|
|
21
|
+
}),
|
|
16
22
|
XStack: forwardRef((props: any, ref) => {
|
|
17
23
|
if (props["aria-label"] === "Table pagination") observed.onLayout = props.onLayout;
|
|
18
24
|
return createElement(actual.XStack, { ...props, ref });
|
|
@@ -42,6 +48,26 @@ beforeEach(() => {
|
|
|
42
48
|
});
|
|
43
49
|
|
|
44
50
|
describe("bounded compact table pagination", () => {
|
|
51
|
+
it("preserves the default footprint and grows for wide numeric options", () => {
|
|
52
|
+
const { rerender } = renderWithProviders(<DataTablePagination compact />);
|
|
53
|
+
expect(observed.sizeWidth).toBe(80);
|
|
54
|
+
rerender(<DataTablePagination compact pageSizeOptions={[10, 25, 1000000]} />);
|
|
55
|
+
expect(observed.sizeWidth).toBeGreaterThan(80);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it("budgets the always-compact Select independently from footer spacing", () => {
|
|
59
|
+
const renderPager = (compact: boolean) => (
|
|
60
|
+
<Preset overrides={{ space: "large" }}>
|
|
61
|
+
<DataTablePagination compact={compact} />
|
|
62
|
+
</Preset>
|
|
63
|
+
);
|
|
64
|
+
const { rerender } = renderWithProviders(renderPager(false));
|
|
65
|
+
const width = observed.sizeWidth;
|
|
66
|
+
expect(width).toBeGreaterThan(80);
|
|
67
|
+
rerender(renderPager(true));
|
|
68
|
+
expect(observed.sizeWidth).toBe(width);
|
|
69
|
+
});
|
|
70
|
+
|
|
45
71
|
it("starts safely and responds to container width even on a desktop viewport", () => {
|
|
46
72
|
renderWithProviders(<DataTablePagination compact />);
|
|
47
73
|
const pager = () => within(screen.getByRole("navigation", { name: "Page" }));
|
|
@@ -55,4 +81,29 @@ describe("bounded compact table pagination", () => {
|
|
|
55
81
|
fireEvent.click(pager().getByLabelText("Go to next page"));
|
|
56
82
|
expect(observed.change).toHaveBeenCalledExactlyOnceWith({ pageIndex: 1, pageSize: 25 });
|
|
57
83
|
});
|
|
84
|
+
|
|
85
|
+
it("preserves the presentation when a container reports its width again", () => {
|
|
86
|
+
renderWithProviders(<DataTablePagination compact />);
|
|
87
|
+
measure(249);
|
|
88
|
+
const pager = screen.getByRole("navigation", { name: "Page" });
|
|
89
|
+
const buttons = within(pager).getAllByRole("button");
|
|
90
|
+
measure(249);
|
|
91
|
+
expect(within(pager).getAllByRole("button")).toEqual(buttons);
|
|
92
|
+
expect(observed.change).not.toHaveBeenCalled();
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it("resets to the first page when rows per page changes in a narrow table", async () => {
|
|
96
|
+
renderWithProviders(
|
|
97
|
+
<DataTablePagination
|
|
98
|
+
compact
|
|
99
|
+
pagination={{ pageIndex: 5, pageSize: 25, totalPages: 40, totalCount: 1000 }}
|
|
100
|
+
/>,
|
|
101
|
+
);
|
|
102
|
+
measure(249);
|
|
103
|
+
fireEvent.click(screen.getByLabelText("Select rows per page"));
|
|
104
|
+
fireEvent.keyDown(await screen.findByRole("option", { name: "50" }), {
|
|
105
|
+
key: "Enter",
|
|
106
|
+
});
|
|
107
|
+
expect(observed.change).toHaveBeenCalledExactlyOnceWith({ pageIndex: 0, pageSize: 50 });
|
|
108
|
+
});
|
|
58
109
|
});
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ensureCompositeFocusRing,
|
|
3
|
+
isTouchSurface,
|
|
3
4
|
MIN_PRESS_TARGET,
|
|
5
|
+
sizeRecipeForToken,
|
|
6
|
+
textFieldInset,
|
|
4
7
|
useResolvedKnobs,
|
|
5
8
|
} from "@multiplatform.one/theme";
|
|
6
9
|
import { Pagination, getPaginationItems } from "@multiplatform.one/components";
|
|
@@ -28,8 +31,10 @@ export interface DataTablePaginationProps {
|
|
|
28
31
|
compact?: boolean;
|
|
29
32
|
}
|
|
30
33
|
|
|
31
|
-
function controlWidth(chars: number,
|
|
32
|
-
|
|
34
|
+
function controlWidth(chars: number, fontSize: number, inset: number, trailingChrome = 0) {
|
|
35
|
+
// Conservative $body digit width, checked against rendered ink in Storybook.
|
|
36
|
+
// Include the Box's two hairline borders after its single horizontal inset.
|
|
37
|
+
return Math.ceil(chars * fontSize * 0.65) + inset * 2 + trailingChrome + 2;
|
|
33
38
|
}
|
|
34
39
|
|
|
35
40
|
function formatRange(start: number, end: number, total: number) {
|
|
@@ -87,7 +92,14 @@ export function DataTablePagination(props: DataTablePaginationProps) {
|
|
|
87
92
|
|
|
88
93
|
const { sm } = useMedia();
|
|
89
94
|
const { knobProps } = useResolvedKnobs(compact === undefined ? undefined : { compact });
|
|
95
|
+
// The fields are always compact, independently of the footer's layout.
|
|
96
|
+
const { knobProps: fieldKnobs } = useResolvedKnobs({ compact: true });
|
|
97
|
+
const fieldRecipe = sizeRecipeForToken(knobProps.sizeToken, { touch: isTouchSurface() });
|
|
98
|
+
const selectInset = Number(
|
|
99
|
+
getTokenValue(fieldKnobs.panelPadding.padding as Parameters<typeof getTokenValue>[0], "space"),
|
|
100
|
+
);
|
|
90
101
|
const isMobile = !sm;
|
|
102
|
+
const packed = compact && insideTable;
|
|
91
103
|
const [availableWidth, setAvailableWidth] = useState<number | undefined>();
|
|
92
104
|
const measureWidth = (event: import("react-native").LayoutChangeEvent) => {
|
|
93
105
|
const width = event.nativeEvent.layout.width;
|
|
@@ -132,9 +144,14 @@ export function DataTablePagination(props: DataTablePaginationProps) {
|
|
|
132
144
|
const gapPixels = Number(
|
|
133
145
|
getTokenValue(knobProps.gap.gap as Parameters<typeof getTokenValue>[0], "space"),
|
|
134
146
|
);
|
|
135
|
-
const paddingPixels =
|
|
136
|
-
|
|
137
|
-
|
|
147
|
+
const paddingPixels = packed
|
|
148
|
+
? 0
|
|
149
|
+
: Number(
|
|
150
|
+
getTokenValue(
|
|
151
|
+
knobProps.panelPadding.padding as Parameters<typeof getTokenValue>[0],
|
|
152
|
+
"space",
|
|
153
|
+
),
|
|
154
|
+
);
|
|
138
155
|
const measuredBudget =
|
|
139
156
|
pageControls * controlBudget + Math.max(0, pageControls - 1) * gapPixels + paddingPixels * 2;
|
|
140
157
|
const numberedBudget = Number.isFinite(measuredBudget) ? measuredBudget : Infinity;
|
|
@@ -166,15 +183,30 @@ export function DataTablePagination(props: DataTablePaginationProps) {
|
|
|
166
183
|
|
|
167
184
|
const helperText = {
|
|
168
185
|
...knobProps.label,
|
|
169
|
-
color:
|
|
186
|
+
color: knobProps.textAccentColor,
|
|
170
187
|
userSelect: "none" as const,
|
|
171
188
|
};
|
|
172
189
|
|
|
173
190
|
const sizeControl = showSize ? (
|
|
174
|
-
<XStack
|
|
191
|
+
<XStack
|
|
192
|
+
alignItems="center"
|
|
193
|
+
gap="$2"
|
|
194
|
+
flexShrink={0}
|
|
195
|
+
flexWrap="wrap"
|
|
196
|
+
minWidth={0}
|
|
197
|
+
maxWidth="100%"
|
|
198
|
+
>
|
|
175
199
|
<Text {...helperText}>Rows per page:</Text>
|
|
176
200
|
<View
|
|
177
|
-
width={
|
|
201
|
+
width={Math.max(
|
|
202
|
+
80,
|
|
203
|
+
controlWidth(
|
|
204
|
+
Math.max(2, ...sizeOptions.map((n) => String(n).length)),
|
|
205
|
+
fieldKnobs.controlType.fontSize,
|
|
206
|
+
selectInset,
|
|
207
|
+
fieldRecipe.gap + 16, // Select's fixed 16px caret.
|
|
208
|
+
),
|
|
209
|
+
)}
|
|
178
210
|
overflow="visible"
|
|
179
211
|
flexShrink={0}
|
|
180
212
|
{...({ "data-pagination-control": "size" } as object)}
|
|
@@ -206,6 +238,7 @@ export function DataTablePagination(props: DataTablePaginationProps) {
|
|
|
206
238
|
onPageChange={(page) => handlePageChange(page - 1)}
|
|
207
239
|
showFirstLast={!simplePager && !compact && !isMobile}
|
|
208
240
|
aria-label="Page"
|
|
241
|
+
padding={0}
|
|
209
242
|
/>
|
|
210
243
|
) : null;
|
|
211
244
|
|
|
@@ -213,7 +246,14 @@ export function DataTablePagination(props: DataTablePaginationProps) {
|
|
|
213
246
|
<XStack alignItems="center" gap="$2" flexShrink={0} aria-label="Jump to page">
|
|
214
247
|
<Text {...helperText}>Go to page:</Text>
|
|
215
248
|
<View
|
|
216
|
-
width={
|
|
249
|
+
width={Math.max(
|
|
250
|
+
48,
|
|
251
|
+
controlWidth(
|
|
252
|
+
String(totalPages).length,
|
|
253
|
+
fieldRecipe.fontSize,
|
|
254
|
+
textFieldInset(fieldRecipe),
|
|
255
|
+
),
|
|
256
|
+
)}
|
|
217
257
|
overflow="visible"
|
|
218
258
|
flexShrink={0}
|
|
219
259
|
{...({ "data-pagination-control": "jump" } as object)}
|
|
@@ -249,8 +289,6 @@ export function DataTablePagination(props: DataTablePaginationProps) {
|
|
|
249
289
|
</Text>
|
|
250
290
|
) : null;
|
|
251
291
|
|
|
252
|
-
const packed = compact && insideTable;
|
|
253
|
-
|
|
254
292
|
if (packed) {
|
|
255
293
|
return (
|
|
256
294
|
<XStack
|
|
@@ -273,9 +311,9 @@ export function DataTablePagination(props: DataTablePaginationProps) {
|
|
|
273
311
|
}
|
|
274
312
|
|
|
275
313
|
return (
|
|
276
|
-
//
|
|
277
|
-
//
|
|
278
|
-
//
|
|
314
|
+
// LC-10: intrinsic cluster widths participate in wrapping. Zero flex
|
|
315
|
+
// bases let the controls overlap while the footer itself still fits.
|
|
316
|
+
// A constrained size cluster can also wrap its label above the field.
|
|
279
317
|
<XStack
|
|
280
318
|
role="group"
|
|
281
319
|
aria-label="Table pagination"
|
|
@@ -290,7 +328,14 @@ export function DataTablePagination(props: DataTablePaginationProps) {
|
|
|
290
328
|
paddingHorizontal={knobProps.panelPadding.padding}
|
|
291
329
|
paddingVertical="$2"
|
|
292
330
|
>
|
|
293
|
-
<XStack
|
|
331
|
+
<XStack
|
|
332
|
+
alignItems="center"
|
|
333
|
+
flexGrow={1}
|
|
334
|
+
flexShrink={1}
|
|
335
|
+
minWidth={0}
|
|
336
|
+
maxWidth="100%"
|
|
337
|
+
justifyContent="flex-start"
|
|
338
|
+
>
|
|
294
339
|
{sizeControl}
|
|
295
340
|
</XStack>
|
|
296
341
|
|
|
@@ -305,7 +350,6 @@ export function DataTablePagination(props: DataTablePaginationProps) {
|
|
|
305
350
|
alignItems="center"
|
|
306
351
|
{...knobProps.gap}
|
|
307
352
|
flexGrow={1}
|
|
308
|
-
flexBasis={0}
|
|
309
353
|
flexShrink={0}
|
|
310
354
|
justifyContent="flex-end"
|
|
311
355
|
>
|
|
@@ -253,7 +253,6 @@ function SearchOptionsPopover({
|
|
|
253
253
|
<Popover.Trigger asChild>
|
|
254
254
|
<Button
|
|
255
255
|
size={knobProps.sizeToken}
|
|
256
|
-
variant="outlined"
|
|
257
256
|
accent={optionsActive}
|
|
258
257
|
icon={<SlidersHorizontalIcon size={iconPx} weight={optionsActive ? "fill" : "regular"} />}
|
|
259
258
|
disabled={disabled}
|
|
@@ -326,10 +325,10 @@ function SearchOptionsPopover({
|
|
|
326
325
|
</XStack>
|
|
327
326
|
|
|
328
327
|
<XStack {...knobProps.gap}>
|
|
329
|
-
<Button size="$2" compact
|
|
328
|
+
<Button size="$2" compact onPress={handleSelectAllColumns}>
|
|
330
329
|
{t("All")}
|
|
331
330
|
</Button>
|
|
332
|
-
<Button size="$2" compact
|
|
331
|
+
<Button size="$2" compact onPress={handleSelectNoColumns}>
|
|
333
332
|
{t("None")}
|
|
334
333
|
</Button>
|
|
335
334
|
</XStack>
|
|
@@ -71,9 +71,7 @@ const MainStory = () => {
|
|
|
71
71
|
enableGlobalSearch
|
|
72
72
|
enableViews
|
|
73
73
|
initialState={{ pagination: { pageIndex: 1, pageSize: 3 } }}
|
|
74
|
-
renderToolbar={(props) =>
|
|
75
|
-
<DataTableToolbar {...props} enableViews enableExport />
|
|
76
|
-
)}
|
|
74
|
+
renderToolbar={(props) => <DataTableToolbar {...props} enableViews enableExport />}
|
|
77
75
|
aria-label="Employee table with toolbar"
|
|
78
76
|
/>
|
|
79
77
|
</YStack>
|
|
@@ -154,7 +152,7 @@ const WithCustomActionsStory = () => {
|
|
|
154
152
|
onClearFilters={() => setSearch("")}
|
|
155
153
|
customActions={
|
|
156
154
|
<XStack gap="$2">
|
|
157
|
-
<Button size="$2"
|
|
155
|
+
<Button size="$2" onPress={() => action("refresh")()}>
|
|
158
156
|
Refresh
|
|
159
157
|
</Button>
|
|
160
158
|
<Button size="$2" onPress={() => action("export")()}>
|
|
@@ -228,11 +228,7 @@ export function DataTableToolbar(props: DataTableToolbarProps) {
|
|
|
228
228
|
}}
|
|
229
229
|
/>
|
|
230
230
|
<XStack {...knobProps.gap} justifyContent="flex-end">
|
|
231
|
-
<Button
|
|
232
|
-
size={controlSize}
|
|
233
|
-
variant="outlined"
|
|
234
|
-
onPress={() => setShowSaveViewDialog(false)}
|
|
235
|
-
>
|
|
231
|
+
<Button size={controlSize} onPress={() => setShowSaveViewDialog(false)}>
|
|
236
232
|
{t("Cancel")}
|
|
237
233
|
</Button>
|
|
238
234
|
<Button
|
|
@@ -119,7 +119,6 @@ export function DataTableViewOptions(props: DataTableViewOptionsProps) {
|
|
|
119
119
|
<DropdownMenu.Trigger asChild>
|
|
120
120
|
<Button
|
|
121
121
|
size={knobProps.sizeToken}
|
|
122
|
-
variant="outlined"
|
|
123
122
|
icon={<GearIcon size={iconPx} />}
|
|
124
123
|
aria-label={t("Open table view options")}
|
|
125
124
|
>
|
|
@@ -176,7 +175,6 @@ export function DataTableViewOptions(props: DataTableViewOptionsProps) {
|
|
|
176
175
|
|
|
177
176
|
<Button
|
|
178
177
|
size={knobProps.sizeToken}
|
|
179
|
-
variant="outlined"
|
|
180
178
|
onPress={onResetToDefault}
|
|
181
179
|
icon={<ArrowCounterClockwiseIcon size={iconPx} />}
|
|
182
180
|
>
|
|
@@ -419,11 +417,7 @@ function ViewManagementSection({
|
|
|
419
417
|
{/* Save Current View */}
|
|
420
418
|
<Popover open={showSaveDialog} onOpenChange={setShowSaveDialog}>
|
|
421
419
|
<Popover.Trigger asChild>
|
|
422
|
-
<Button
|
|
423
|
-
size={knobProps.sizeToken}
|
|
424
|
-
variant="outlined"
|
|
425
|
-
icon={<FloppyDiskIcon size={iconPx} />}
|
|
426
|
-
>
|
|
420
|
+
<Button size={knobProps.sizeToken} icon={<FloppyDiskIcon size={iconPx} />}>
|
|
427
421
|
{t("Save Current View")}
|
|
428
422
|
</Button>
|
|
429
423
|
</Popover.Trigger>
|
|
@@ -448,11 +442,7 @@ function ViewManagementSection({
|
|
|
448
442
|
}}
|
|
449
443
|
/>
|
|
450
444
|
<XStack gap="$2" justifyContent="flex-end">
|
|
451
|
-
<Button
|
|
452
|
-
size={knobProps.sizeToken}
|
|
453
|
-
variant="outlined"
|
|
454
|
-
onPress={() => setShowSaveDialog(false)}
|
|
455
|
-
>
|
|
445
|
+
<Button size={knobProps.sizeToken} onPress={() => setShowSaveDialog(false)}>
|
|
456
446
|
{t("Cancel")}
|
|
457
447
|
</Button>
|
|
458
448
|
<Button
|
|
@@ -489,7 +479,6 @@ function ViewManagementSection({
|
|
|
489
479
|
<Text fontSize="$3">{view.name}</Text>
|
|
490
480
|
<Button
|
|
491
481
|
size={knobProps.sizeToken}
|
|
492
|
-
variant="outlined"
|
|
493
482
|
onPress={() => onLoadView(view.id)}
|
|
494
483
|
disabled={activeViewId === view.id}
|
|
495
484
|
>
|
|
@@ -136,9 +136,7 @@ export function FilterManager({
|
|
|
136
136
|
<XStack gap="$3" justifyContent="flex-end">
|
|
137
137
|
<KnobDialogClose asChild>
|
|
138
138
|
{/* DG-ACT-05: the cancel action never renders disabled. */}
|
|
139
|
-
<Button size={knobProps.sizeToken}
|
|
140
|
-
{t("Cancel")}
|
|
141
|
-
</Button>
|
|
139
|
+
<Button size={knobProps.sizeToken}>{t("Cancel")}</Button>
|
|
142
140
|
</KnobDialogClose>
|
|
143
141
|
{/* Stays pressable on an empty name — handleSave surfaces the
|
|
144
142
|
inline "Filter name is required" instead of a bare-disabled
|
|
@@ -19,7 +19,7 @@ const statusOptions = [
|
|
|
19
19
|
{ label: "Done", value: "done" },
|
|
20
20
|
];
|
|
21
21
|
|
|
22
|
-
const fieldTypes: DataTableColumnType[] = ["text", "number", "date", "boolean", "select"];
|
|
22
|
+
const fieldTypes: DataTableColumnType[] = ["text", "number", "money", "date", "boolean", "select"];
|
|
23
23
|
|
|
24
24
|
/** Every forms Select trigger in the tree, in render order (Condition first). */
|
|
25
25
|
const selectTriggers = (container: HTMLElement) =>
|
|
@@ -111,10 +111,18 @@ export function FilterOperatorValueEditor({
|
|
|
111
111
|
label={t("Value")}
|
|
112
112
|
value={value}
|
|
113
113
|
onChangeText={onValueChange}
|
|
114
|
-
placeholder={
|
|
114
|
+
placeholder={
|
|
115
|
+
fieldType === "date"
|
|
116
|
+
? t("YYYY-MM-DD")
|
|
117
|
+
: fieldType === "money"
|
|
118
|
+
? t("0.00")
|
|
119
|
+
: t("Enter value...")
|
|
120
|
+
}
|
|
115
121
|
size="$3"
|
|
116
122
|
compact
|
|
117
|
-
{...(fieldType === "number"
|
|
123
|
+
{...((fieldType === "number" || fieldType === "money") && {
|
|
124
|
+
keyboardType: "numeric",
|
|
125
|
+
})}
|
|
118
126
|
/>
|
|
119
127
|
)}
|
|
120
128
|
</YStack>
|