@carto/ps-react-ui 4.7.1 → 4.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/category-DwaeYjpX.js +656 -0
- package/dist/category-DwaeYjpX.js.map +1 -0
- package/dist/change-column-Cidl_M-4.js +1110 -0
- package/dist/change-column-Cidl_M-4.js.map +1 -0
- package/dist/data-zoom-layout-BH0LPwSy.js +28 -0
- package/dist/data-zoom-layout-BH0LPwSy.js.map +1 -0
- package/dist/echart-CU0KmClP.js +176 -0
- package/dist/echart-CU0KmClP.js.map +1 -0
- package/dist/exports-Cx-f6m6U.js +63 -0
- package/dist/exports-Cx-f6m6U.js.map +1 -0
- package/dist/formula-DuC0NQLH.js +79 -0
- package/dist/formula-DuC0NQLH.js.map +1 -0
- package/dist/markdown-BD1jcknS.js +8326 -0
- package/dist/markdown-BD1jcknS.js.map +1 -0
- package/dist/merge-options-DCkkHZIf.js +34 -0
- package/dist/merge-options-DCkkHZIf.js.map +1 -0
- package/dist/{styles-BYTyKQFP.js → option-builders-F-c9ELi1.js} +25 -45
- package/dist/option-builders-F-c9ELi1.js.map +1 -0
- package/dist/png-item-CS4z1iSH.js +45 -0
- package/dist/png-item-CS4z1iSH.js.map +1 -0
- package/dist/range-DsqTjSpg.js +186 -0
- package/dist/range-DsqTjSpg.js.map +1 -0
- package/dist/spread-CTuIXZSM.js +67 -0
- package/dist/spread-CTuIXZSM.js.map +1 -0
- package/dist/style-DVnT6HC1.js +131 -0
- package/dist/style-DVnT6HC1.js.map +1 -0
- package/dist/styles-cohnxh9F.js +23 -0
- package/dist/styles-cohnxh9F.js.map +1 -0
- package/dist/table-HIpXuq4G.js +390 -0
- package/dist/table-HIpXuq4G.js.map +1 -0
- package/dist/transforms-Cdx4fkU5.js +106 -0
- package/dist/transforms-Cdx4fkU5.js.map +1 -0
- package/dist/types/widgets/echart/utils.test.d.ts +1 -0
- package/dist/types/widgets/formula/config.test.d.ts +1 -0
- package/dist/types/widgets/stores/widget-store-branches.test.d.ts +1 -0
- package/dist/types/widgets/table/config.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/brush-toggle/brush-toggle.d.ts +56 -0
- package/dist/types/widgets-v2/actions/brush-toggle/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/brush-toggle/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/brush-toggle/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/brush-toggle/transforms.d.ts +11 -0
- package/dist/types/widgets-v2/actions/brush-toggle/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/change-column/change-column-icon.d.ts +2 -0
- package/dist/types/widgets-v2/actions/change-column/change-column.d.ts +29 -0
- package/dist/types/widgets-v2/actions/change-column/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/change-column/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/change-column/sortable-column-item.d.ts +14 -0
- package/dist/types/widgets-v2/actions/change-column/style.d.ts +33 -0
- package/dist/types/widgets-v2/actions/change-column/types.d.ts +10 -0
- package/dist/types/widgets-v2/actions/download/download.d.ts +18 -0
- package/dist/types/widgets-v2/actions/download/exports.d.ts +37 -0
- package/dist/types/widgets-v2/actions/download/icons.d.ts +12 -0
- package/dist/types/widgets-v2/actions/download/index.d.ts +6 -0
- package/dist/types/widgets-v2/actions/download/labels.d.ts +11 -0
- package/dist/types/widgets-v2/actions/download/png-item.d.ts +24 -0
- package/dist/types/widgets-v2/actions/download/style.d.ts +1 -0
- package/dist/types/widgets-v2/actions/download/types.d.ts +35 -0
- package/dist/types/widgets-v2/actions/fullscreen/fullscreen.d.ts +59 -0
- package/dist/types/widgets-v2/actions/fullscreen/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/fullscreen/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/fullscreen/style.d.ts +48 -0
- package/dist/types/widgets-v2/actions/fullscreen/types.d.ts +14 -0
- package/dist/types/widgets-v2/actions/index.d.ts +9 -0
- package/dist/types/widgets-v2/actions/lock-selection/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/lock-selection/labels.d.ts +6 -0
- package/dist/types/widgets-v2/actions/lock-selection/lock-selection.d.ts +36 -0
- package/dist/types/widgets-v2/actions/lock-selection/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/lock-selection/transforms.d.ts +6 -0
- package/dist/types/widgets-v2/actions/relative-data/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/relative-data/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/relative-data/relative-data.d.ts +39 -0
- package/dist/types/widgets-v2/actions/relative-data/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/relative-data/transforms.d.ts +30 -0
- package/dist/types/widgets-v2/actions/relative-data/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/searcher/filter.d.ts +6 -0
- package/dist/types/widgets-v2/actions/searcher/index.d.ts +4 -0
- package/dist/types/widgets-v2/actions/searcher/labels.d.ts +7 -0
- package/dist/types/widgets-v2/actions/searcher/searcher-toggle.d.ts +23 -0
- package/dist/types/widgets-v2/actions/searcher/searcher.d.ts +11 -0
- package/dist/types/widgets-v2/actions/searcher/style.d.ts +16 -0
- package/dist/types/widgets-v2/actions/stack-toggle/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/stack-toggle/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/stack-toggle/stack-toggle.d.ts +10 -0
- package/dist/types/widgets-v2/actions/stack-toggle/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/stack-toggle/transforms.d.ts +13 -0
- package/dist/types/widgets-v2/actions/stack-toggle/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/index.d.ts +3 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/labels.d.ts +5 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/style.d.ts +12 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/transforms.d.ts +51 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/actions/zoom-toggle/zoom-toggle.d.ts +35 -0
- package/dist/types/widgets-v2/bar/download.d.ts +24 -0
- package/dist/types/widgets-v2/bar/index.d.ts +4 -0
- package/dist/types/widgets-v2/bar/options.d.ts +43 -0
- package/dist/types/widgets-v2/bar/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/bar/skeleton.d.ts +6 -0
- package/dist/types/widgets-v2/bar/types.d.ts +41 -0
- package/dist/types/widgets-v2/category/category-ui.d.ts +81 -0
- package/dist/types/widgets-v2/category/category.d.ts +48 -0
- package/dist/types/widgets-v2/category/components/category-bar-stacked.d.ts +28 -0
- package/dist/types/widgets-v2/category/components/category-bar.d.ts +23 -0
- package/dist/types/widgets-v2/category/components/category-legend.d.ts +18 -0
- package/dist/types/widgets-v2/category/components/category-row-multi.d.ts +31 -0
- package/dist/types/widgets-v2/category/components/category-row-other.d.ts +13 -0
- package/dist/types/widgets-v2/category/components/category-row-single.d.ts +28 -0
- package/dist/types/widgets-v2/category/components/category-row-stacked.d.ts +38 -0
- package/dist/types/widgets-v2/category/download.d.ts +16 -0
- package/dist/types/widgets-v2/category/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/category/index.d.ts +10 -0
- package/dist/types/widgets-v2/category/skeleton.d.ts +11 -0
- package/dist/types/widgets-v2/category/style.d.ts +166 -0
- package/dist/types/widgets-v2/category/types.d.ts +49 -0
- package/dist/types/widgets-v2/echart/echart-ui.d.ts +44 -0
- package/dist/types/widgets-v2/echart/echart.d.ts +75 -0
- package/dist/types/widgets-v2/echart/index.d.ts +4 -0
- package/dist/types/widgets-v2/echart/shared-resize-observer.d.ts +5 -0
- package/dist/types/widgets-v2/echart/shared-resize-observer.test.d.ts +1 -0
- package/dist/types/widgets-v2/echart/style.d.ts +6 -0
- package/dist/types/widgets-v2/echart/use-chart-selection.d.ts +51 -0
- package/dist/types/widgets-v2/formula/delta.d.ts +22 -0
- package/dist/types/widgets-v2/formula/download.d.ts +20 -0
- package/dist/types/widgets-v2/formula/formula-ui.d.ts +20 -0
- package/dist/types/widgets-v2/formula/formula.d.ts +8 -0
- package/dist/types/widgets-v2/formula/index.d.ts +11 -0
- package/dist/types/widgets-v2/formula/note.d.ts +11 -0
- package/dist/types/widgets-v2/formula/prefix.d.ts +12 -0
- package/dist/types/widgets-v2/formula/series.d.ts +16 -0
- package/dist/types/widgets-v2/formula/skeleton.d.ts +4 -0
- package/dist/types/widgets-v2/formula/style.d.ts +29 -0
- package/dist/types/widgets-v2/formula/suffix.d.ts +12 -0
- package/dist/types/widgets-v2/formula/types.d.ts +40 -0
- package/dist/types/widgets-v2/formula/value.d.ts +14 -0
- package/dist/types/widgets-v2/histogram/download.d.ts +17 -0
- package/dist/types/widgets-v2/histogram/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/histogram/index.d.ts +5 -0
- package/dist/types/widgets-v2/histogram/options.d.ts +42 -0
- package/dist/types/widgets-v2/histogram/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/histogram/skeleton.d.ts +9 -0
- package/dist/types/widgets-v2/histogram/transforms.d.ts +17 -0
- package/dist/types/widgets-v2/histogram/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/histogram/types.d.ts +47 -0
- package/dist/types/widgets-v2/index.d.ts +107 -0
- package/dist/types/widgets-v2/markdown/download.d.ts +16 -0
- package/dist/types/widgets-v2/markdown/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/markdown/index.d.ts +6 -0
- package/dist/types/widgets-v2/markdown/markdown-content.d.ts +34 -0
- package/dist/types/widgets-v2/markdown/markdown-ui.d.ts +12 -0
- package/dist/types/widgets-v2/markdown/markdown.d.ts +6 -0
- package/dist/types/widgets-v2/markdown/skeleton.d.ts +4 -0
- package/dist/types/widgets-v2/markdown/style.d.ts +61 -0
- package/dist/types/widgets-v2/markdown/types.d.ts +4 -0
- package/dist/types/widgets-v2/note/labels.d.ts +5 -0
- package/dist/types/widgets-v2/note/style.d.ts +26 -0
- package/dist/types/widgets-v2/note/widget-note.d.ts +46 -0
- package/dist/types/widgets-v2/pie/download.d.ts +17 -0
- package/dist/types/widgets-v2/pie/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/pie/index.d.ts +4 -0
- package/dist/types/widgets-v2/pie/options.d.ts +35 -0
- package/dist/types/widgets-v2/pie/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/pie/skeleton.d.ts +4 -0
- package/dist/types/widgets-v2/pie/types.d.ts +50 -0
- package/dist/types/widgets-v2/provider/widget-provider.d.ts +32 -0
- package/dist/types/widgets-v2/range/index.d.ts +4 -0
- package/dist/types/widgets-v2/range/range-ui.d.ts +19 -0
- package/dist/types/widgets-v2/range/range.d.ts +19 -0
- package/dist/types/widgets-v2/range/skeleton.d.ts +9 -0
- package/dist/types/widgets-v2/range/style.d.ts +40 -0
- package/dist/types/widgets-v2/range/types.d.ts +37 -0
- package/dist/types/widgets-v2/scatterplot/download.d.ts +16 -0
- package/dist/types/widgets-v2/scatterplot/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/scatterplot/index.d.ts +5 -0
- package/dist/types/widgets-v2/scatterplot/options.d.ts +42 -0
- package/dist/types/widgets-v2/scatterplot/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/scatterplot/skeleton.d.ts +12 -0
- package/dist/types/widgets-v2/scatterplot/transforms.d.ts +17 -0
- package/dist/types/widgets-v2/scatterplot/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/scatterplot/types.d.ts +50 -0
- package/dist/types/widgets-v2/selection-summary/labels.d.ts +6 -0
- package/dist/types/widgets-v2/selection-summary/selection-summary.d.ts +22 -0
- package/dist/types/widgets-v2/selection-summary/style.d.ts +23 -0
- package/dist/types/widgets-v2/spread/download.d.ts +15 -0
- package/dist/types/widgets-v2/spread/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/spread/index.d.ts +6 -0
- package/dist/types/widgets-v2/spread/separator.d.ts +7 -0
- package/dist/types/widgets-v2/spread/skeleton.d.ts +9 -0
- package/dist/types/widgets-v2/spread/spread-ui.d.ts +18 -0
- package/dist/types/widgets-v2/spread/spread.d.ts +5 -0
- package/dist/types/widgets-v2/spread/types.d.ts +25 -0
- package/dist/types/widgets-v2/state/labels.d.ts +7 -0
- package/dist/types/widgets-v2/state/labels.test.d.ts +1 -0
- package/dist/types/widgets-v2/state/style.d.ts +19 -0
- package/dist/types/widgets-v2/state/widget-state.d.ts +19 -0
- package/dist/types/widgets-v2/stores/index.d.ts +8 -0
- package/dist/types/widgets-v2/stores/pipeline-middleware.d.ts +5 -0
- package/dist/types/widgets-v2/stores/pipeline-middleware.test.d.ts +1 -0
- package/dist/types/widgets-v2/stores/transforms.d.ts +4 -0
- package/dist/types/widgets-v2/stores/transforms.test.d.ts +1 -0
- package/dist/types/widgets-v2/stores/types.d.ts +55 -0
- package/dist/types/widgets-v2/stores/use-echart-instance.d.ts +15 -0
- package/dist/types/widgets-v2/stores/use-transform-enabled.d.ts +17 -0
- package/dist/types/widgets-v2/stores/use-transform.d.ts +12 -0
- package/dist/types/widgets-v2/stores/widget-context.d.ts +2 -0
- package/dist/types/widgets-v2/stores/widget-store-registry.d.ts +74 -0
- package/dist/types/widgets-v2/stores/widget-store-registry.test.d.ts +1 -0
- package/dist/types/widgets-v2/subheader/style.d.ts +10 -0
- package/dist/types/widgets-v2/subheader/subheader.d.ts +11 -0
- package/dist/types/widgets-v2/table/download.d.ts +18 -0
- package/dist/types/widgets-v2/table/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/table/helpers.d.ts +32 -0
- package/dist/types/widgets-v2/table/helpers.test.d.ts +1 -0
- package/dist/types/widgets-v2/table/index.d.ts +7 -0
- package/dist/types/widgets-v2/table/labels.d.ts +22 -0
- package/dist/types/widgets-v2/table/skeleton.d.ts +22 -0
- package/dist/types/widgets-v2/table/style.d.ts +44 -0
- package/dist/types/widgets-v2/table/table-ui.d.ts +38 -0
- package/dist/types/widgets-v2/table/table.d.ts +50 -0
- package/dist/types/widgets-v2/table/types.d.ts +37 -0
- package/dist/types/widgets-v2/test-utils.d.ts +52 -0
- package/dist/types/widgets-v2/timeseries/download.d.ts +17 -0
- package/dist/types/widgets-v2/timeseries/download.test.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/index.d.ts +4 -0
- package/dist/types/widgets-v2/timeseries/options.d.ts +39 -0
- package/dist/types/widgets-v2/timeseries/options.test.d.ts +1 -0
- package/dist/types/widgets-v2/timeseries/skeleton.d.ts +8 -0
- package/dist/types/widgets-v2/timeseries/types.d.ts +56 -0
- package/dist/types/widgets-v2/toolbox/labels.d.ts +5 -0
- package/dist/types/widgets-v2/toolbox/style.d.ts +30 -0
- package/dist/types/widgets-v2/toolbox/toolbox.d.ts +49 -0
- package/dist/types/widgets-v2/utils/data-zoom-layout.d.ts +11 -0
- package/dist/types/widgets-v2/utils/index.d.ts +2 -0
- package/dist/types/widgets-v2/utils/merge-options.d.ts +12 -0
- package/dist/types/widgets-v2/utils/merge-options.test.d.ts +1 -0
- package/dist/types/widgets-v2/wrapper/index.d.ts +4 -0
- package/dist/types/widgets-v2/wrapper/labels.d.ts +6 -0
- package/dist/types/widgets-v2/wrapper/style.d.ts +111 -0
- package/dist/types/widgets-v2/wrapper/widget-actions.d.ts +22 -0
- package/dist/types/widgets-v2/wrapper/widget-content.d.ts +12 -0
- package/dist/types/widgets-v2/wrapper/widget-wrapper.d.ts +51 -0
- package/dist/use-transform-DXPN3nY7.js +110 -0
- package/dist/use-transform-DXPN3nY7.js.map +1 -0
- package/dist/widget-context-DTGO0Yta.js +13 -0
- package/dist/widget-context-DTGO0Yta.js.map +1 -0
- package/dist/widget-store-registry-_W4Z4xp-.js +178 -0
- package/dist/widget-store-registry-_W4Z4xp-.js.map +1 -0
- package/dist/widgets/bar.js +14 -13
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/histogram.js +8 -7
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/pie.js +19 -18
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/scatterplot.js +8 -7
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/timeseries.js +11 -10
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/utils.js +8 -7
- package/dist/widgets/utils.js.map +1 -1
- package/dist/widgets-v2/actions.js +43 -0
- package/dist/widgets-v2/actions.js.map +1 -0
- package/dist/widgets-v2/bar.js +327 -0
- package/dist/widgets-v2/bar.js.map +1 -0
- package/dist/widgets-v2/category.js +104 -0
- package/dist/widgets-v2/category.js.map +1 -0
- package/dist/widgets-v2/echart.js +57 -0
- package/dist/widgets-v2/echart.js.map +1 -0
- package/dist/widgets-v2/formula.js +74 -0
- package/dist/widgets-v2/formula.js.map +1 -0
- package/dist/widgets-v2/histogram.js +350 -0
- package/dist/widgets-v2/histogram.js.map +1 -0
- package/dist/widgets-v2/markdown.js +68 -0
- package/dist/widgets-v2/markdown.js.map +1 -0
- package/dist/widgets-v2/pie.js +381 -0
- package/dist/widgets-v2/pie.js.map +1 -0
- package/dist/widgets-v2/range.js +52 -0
- package/dist/widgets-v2/range.js.map +1 -0
- package/dist/widgets-v2/scatterplot.js +405 -0
- package/dist/widgets-v2/scatterplot.js.map +1 -0
- package/dist/widgets-v2/spread.js +72 -0
- package/dist/widgets-v2/spread.js.map +1 -0
- package/dist/widgets-v2/stores.js +42 -0
- package/dist/widgets-v2/stores.js.map +1 -0
- package/dist/widgets-v2/table.js +78 -0
- package/dist/widgets-v2/table.js.map +1 -0
- package/dist/widgets-v2/timeseries.js +352 -0
- package/dist/widgets-v2/timeseries.js.map +1 -0
- package/dist/widgets-v2/utils.js +7 -0
- package/dist/widgets-v2/utils.js.map +1 -0
- package/dist/widgets-v2.js +953 -0
- package/dist/widgets-v2.js.map +1 -0
- package/package.json +73 -5
- package/src/components/lasso-tool/chip.test.tsx +176 -0
- package/src/components/lasso-tool/lasso-tool-inline.test.tsx +171 -0
- package/src/components/lasso-tool/lasso-tool.test.tsx +198 -0
- package/src/components/list-data/list-data.test.tsx +73 -0
- package/src/components/no-data-alert/no-data-alert.test.tsx +38 -0
- package/src/components/responsive-drawer/responsive-drawer.test.tsx +68 -0
- package/src/widgets/actions/brush-toggle/brush-overlay.test.tsx +465 -0
- package/src/widgets/actions/brush-toggle/brush-toggle.test.tsx +208 -0
- package/src/widgets/actions/change-column/change-column-dnd.test.tsx +193 -0
- package/src/widgets/actions/change-column/sortable-column-item.test.tsx +124 -0
- package/src/widgets/actions/zoom-toggle/zoom-toggle.test.tsx +322 -0
- package/src/widgets/category/components/category-rows.test.tsx +213 -0
- package/src/widgets/echart/utils.test.ts +277 -0
- package/src/widgets/formula/config.test.ts +37 -0
- package/src/widgets/range/components/range-item.test.tsx +243 -0
- package/src/widgets/stores/widget-store-branches.test.ts +275 -0
- package/src/widgets/table/config.test.ts +65 -0
- package/src/widgets/utils/chart-config/option-builders.test.ts +188 -0
- package/src/widgets-v2/PERFORMANCE.md +189 -0
- package/src/widgets-v2/actions/brush-toggle/brush-toggle.test.tsx +180 -0
- package/src/widgets-v2/actions/brush-toggle/brush-toggle.tsx +154 -0
- package/src/widgets-v2/actions/brush-toggle/index.ts +3 -0
- package/src/widgets-v2/actions/brush-toggle/labels.ts +9 -0
- package/src/widgets-v2/actions/brush-toggle/style.ts +11 -0
- package/src/widgets-v2/actions/brush-toggle/transforms.test.ts +47 -0
- package/src/widgets-v2/actions/brush-toggle/transforms.ts +31 -0
- package/src/widgets-v2/actions/change-column/change-column-icon.tsx +14 -0
- package/src/widgets-v2/actions/change-column/change-column.test.tsx +59 -0
- package/src/widgets-v2/actions/change-column/change-column.tsx +180 -0
- package/src/widgets-v2/actions/change-column/index.ts +7 -0
- package/src/widgets-v2/actions/change-column/labels.ts +9 -0
- package/src/widgets-v2/actions/change-column/sortable-column-item.tsx +56 -0
- package/src/widgets-v2/actions/change-column/style.ts +32 -0
- package/src/widgets-v2/actions/change-column/types.ts +11 -0
- package/src/widgets-v2/actions/download/download.test.tsx +327 -0
- package/src/widgets-v2/actions/download/download.tsx +144 -0
- package/src/widgets-v2/actions/download/exports.test.tsx +198 -0
- package/src/widgets-v2/actions/download/exports.ts +115 -0
- package/src/widgets-v2/actions/download/icons.tsx +26 -0
- package/src/widgets-v2/actions/download/index.ts +13 -0
- package/src/widgets-v2/actions/download/labels.ts +16 -0
- package/src/widgets-v2/actions/download/png-item.test.tsx +72 -0
- package/src/widgets-v2/actions/download/png-item.tsx +52 -0
- package/src/widgets-v2/actions/download/style.ts +3 -0
- package/src/widgets-v2/actions/download/types.ts +32 -0
- package/src/widgets-v2/actions/fullscreen/fullscreen.test.tsx +150 -0
- package/src/widgets-v2/actions/fullscreen/fullscreen.tsx +230 -0
- package/src/widgets-v2/actions/fullscreen/index.ts +7 -0
- package/src/widgets-v2/actions/fullscreen/labels.ts +9 -0
- package/src/widgets-v2/actions/fullscreen/style.ts +59 -0
- package/src/widgets-v2/actions/fullscreen/types.ts +15 -0
- package/src/widgets-v2/actions/index.ts +82 -0
- package/src/widgets-v2/actions/lock-selection/index.ts +10 -0
- package/src/widgets-v2/actions/lock-selection/labels.ts +11 -0
- package/src/widgets-v2/actions/lock-selection/lock-selection.test.tsx +187 -0
- package/src/widgets-v2/actions/lock-selection/lock-selection.tsx +130 -0
- package/src/widgets-v2/actions/lock-selection/style.ts +11 -0
- package/src/widgets-v2/actions/lock-selection/transforms.ts +27 -0
- package/src/widgets-v2/actions/relative-data/index.ts +3 -0
- package/src/widgets-v2/actions/relative-data/labels.ts +9 -0
- package/src/widgets-v2/actions/relative-data/relative-data.test.tsx +71 -0
- package/src/widgets-v2/actions/relative-data/relative-data.tsx +107 -0
- package/src/widgets-v2/actions/relative-data/style.ts +11 -0
- package/src/widgets-v2/actions/relative-data/transforms.test.ts +151 -0
- package/src/widgets-v2/actions/relative-data/transforms.ts +70 -0
- package/src/widgets-v2/actions/searcher/filter.ts +28 -0
- package/src/widgets-v2/actions/searcher/index.ts +8 -0
- package/src/widgets-v2/actions/searcher/labels.ts +13 -0
- package/src/widgets-v2/actions/searcher/searcher-toggle.tsx +91 -0
- package/src/widgets-v2/actions/searcher/searcher.test.tsx +92 -0
- package/src/widgets-v2/actions/searcher/searcher.tsx +112 -0
- package/src/widgets-v2/actions/searcher/style.ts +15 -0
- package/src/widgets-v2/actions/stack-toggle/index.ts +3 -0
- package/src/widgets-v2/actions/stack-toggle/labels.ts +9 -0
- package/src/widgets-v2/actions/stack-toggle/stack-toggle.test.tsx +61 -0
- package/src/widgets-v2/actions/stack-toggle/stack-toggle.tsx +54 -0
- package/src/widgets-v2/actions/stack-toggle/style.ts +11 -0
- package/src/widgets-v2/actions/stack-toggle/transforms.test.ts +43 -0
- package/src/widgets-v2/actions/stack-toggle/transforms.ts +25 -0
- package/src/widgets-v2/actions/zoom-toggle/index.ts +9 -0
- package/src/widgets-v2/actions/zoom-toggle/labels.ts +9 -0
- package/src/widgets-v2/actions/zoom-toggle/style.ts +11 -0
- package/src/widgets-v2/actions/zoom-toggle/transforms.test.ts +148 -0
- package/src/widgets-v2/actions/zoom-toggle/transforms.ts +171 -0
- package/src/widgets-v2/actions/zoom-toggle/zoom-toggle.test.tsx +107 -0
- package/src/widgets-v2/actions/zoom-toggle/zoom-toggle.tsx +106 -0
- package/src/widgets-v2/bar/download.test.tsx +91 -0
- package/src/widgets-v2/bar/download.tsx +66 -0
- package/src/widgets-v2/bar/index.ts +10 -0
- package/src/widgets-v2/bar/options.test.ts +317 -0
- package/src/widgets-v2/bar/options.ts +326 -0
- package/src/widgets-v2/bar/skeleton.test.tsx +19 -0
- package/src/widgets-v2/bar/skeleton.tsx +69 -0
- package/src/widgets-v2/bar/types.ts +46 -0
- package/src/widgets-v2/category/category-ui.test.tsx +746 -0
- package/src/widgets-v2/category/category-ui.tsx +389 -0
- package/src/widgets-v2/category/category.relative-data.test.tsx +107 -0
- package/src/widgets-v2/category/category.stack-toggle.test.tsx +85 -0
- package/src/widgets-v2/category/category.test.tsx +305 -0
- package/src/widgets-v2/category/category.tsx +121 -0
- package/src/widgets-v2/category/components/category-bar-stacked.test.tsx +121 -0
- package/src/widgets-v2/category/components/category-bar-stacked.tsx +73 -0
- package/src/widgets-v2/category/components/category-bar.test.tsx +64 -0
- package/src/widgets-v2/category/components/category-bar.tsx +49 -0
- package/src/widgets-v2/category/components/category-legend.test.tsx +51 -0
- package/src/widgets-v2/category/components/category-legend.tsx +39 -0
- package/src/widgets-v2/category/components/category-row-multi.tsx +86 -0
- package/src/widgets-v2/category/components/category-row-other.test.tsx +28 -0
- package/src/widgets-v2/category/components/category-row-other.tsx +33 -0
- package/src/widgets-v2/category/components/category-row-single.tsx +76 -0
- package/src/widgets-v2/category/components/category-row-stacked.test.tsx +244 -0
- package/src/widgets-v2/category/components/category-row-stacked.tsx +99 -0
- package/src/widgets-v2/category/download.test.ts +71 -0
- package/src/widgets-v2/category/download.ts +54 -0
- package/src/widgets-v2/category/index.ts +32 -0
- package/src/widgets-v2/category/skeleton.test.tsx +26 -0
- package/src/widgets-v2/category/skeleton.tsx +74 -0
- package/src/widgets-v2/category/style.ts +290 -0
- package/src/widgets-v2/category/types.ts +54 -0
- package/src/widgets-v2/echart/echart-ui.test.tsx +232 -0
- package/src/widgets-v2/echart/echart-ui.tsx +184 -0
- package/src/widgets-v2/echart/echart.test.tsx +229 -0
- package/src/widgets-v2/echart/echart.tsx +199 -0
- package/src/widgets-v2/echart/index.ts +22 -0
- package/src/widgets-v2/echart/shared-resize-observer.test.ts +91 -0
- package/src/widgets-v2/echart/shared-resize-observer.ts +56 -0
- package/src/widgets-v2/echart/style.ts +8 -0
- package/src/widgets-v2/echart/use-chart-selection.test.tsx +118 -0
- package/src/widgets-v2/echart/use-chart-selection.ts +115 -0
- package/src/widgets-v2/formula/delta.tsx +61 -0
- package/src/widgets-v2/formula/download.test.tsx +65 -0
- package/src/widgets-v2/formula/download.tsx +69 -0
- package/src/widgets-v2/formula/formula-ui.test.tsx +91 -0
- package/src/widgets-v2/formula/formula-ui.tsx +66 -0
- package/src/widgets-v2/formula/formula.test.tsx +50 -0
- package/src/widgets-v2/formula/formula.tsx +34 -0
- package/src/widgets-v2/formula/index.ts +17 -0
- package/src/widgets-v2/formula/note.tsx +25 -0
- package/src/widgets-v2/formula/prefix.tsx +25 -0
- package/src/widgets-v2/formula/series.tsx +67 -0
- package/src/widgets-v2/formula/skeleton.test.tsx +21 -0
- package/src/widgets-v2/formula/skeleton.tsx +27 -0
- package/src/widgets-v2/formula/style.ts +31 -0
- package/src/widgets-v2/formula/subcomponents.test.tsx +107 -0
- package/src/widgets-v2/formula/suffix.tsx +25 -0
- package/src/widgets-v2/formula/types.ts +44 -0
- package/src/widgets-v2/formula/value.tsx +31 -0
- package/src/widgets-v2/histogram/download.test.ts +94 -0
- package/src/widgets-v2/histogram/download.ts +60 -0
- package/src/widgets-v2/histogram/index.ts +10 -0
- package/src/widgets-v2/histogram/options.test.ts +304 -0
- package/src/widgets-v2/histogram/options.ts +337 -0
- package/src/widgets-v2/histogram/skeleton.test.tsx +16 -0
- package/src/widgets-v2/histogram/skeleton.tsx +70 -0
- package/src/widgets-v2/histogram/transforms.test.ts +46 -0
- package/src/widgets-v2/histogram/transforms.ts +30 -0
- package/src/widgets-v2/histogram/types.ts +51 -0
- package/src/widgets-v2/index.ts +201 -0
- package/src/widgets-v2/markdown/download.test.ts +66 -0
- package/src/widgets-v2/markdown/download.ts +53 -0
- package/src/widgets-v2/markdown/index.ts +6 -0
- package/src/widgets-v2/markdown/markdown-content.test.tsx +155 -0
- package/src/widgets-v2/markdown/markdown-content.tsx +72 -0
- package/src/widgets-v2/markdown/markdown-ui.test.tsx +75 -0
- package/src/widgets-v2/markdown/markdown-ui.tsx +55 -0
- package/src/widgets-v2/markdown/markdown.test.tsx +39 -0
- package/src/widgets-v2/markdown/markdown.tsx +17 -0
- package/src/widgets-v2/markdown/skeleton.test.tsx +15 -0
- package/src/widgets-v2/markdown/skeleton.tsx +32 -0
- package/src/widgets-v2/markdown/style.ts +53 -0
- package/src/widgets-v2/markdown/types.ts +4 -0
- package/src/widgets-v2/note/labels.ts +9 -0
- package/src/widgets-v2/note/style.ts +26 -0
- package/src/widgets-v2/note/widget-note.test.tsx +158 -0
- package/src/widgets-v2/note/widget-note.tsx +172 -0
- package/src/widgets-v2/pie/download.test.ts +78 -0
- package/src/widgets-v2/pie/download.ts +55 -0
- package/src/widgets-v2/pie/index.ts +10 -0
- package/src/widgets-v2/pie/options.test.ts +585 -0
- package/src/widgets-v2/pie/options.ts +509 -0
- package/src/widgets-v2/pie/skeleton.test.tsx +17 -0
- package/src/widgets-v2/pie/skeleton.tsx +32 -0
- package/src/widgets-v2/pie/types.ts +55 -0
- package/src/widgets-v2/provider/widget-provider.test.tsx +119 -0
- package/src/widgets-v2/provider/widget-provider.tsx +111 -0
- package/src/widgets-v2/range/index.ts +4 -0
- package/src/widgets-v2/range/range-ui.test.tsx +130 -0
- package/src/widgets-v2/range/range-ui.tsx +211 -0
- package/src/widgets-v2/range/range.test.tsx +68 -0
- package/src/widgets-v2/range/range.tsx +46 -0
- package/src/widgets-v2/range/skeleton.test.tsx +17 -0
- package/src/widgets-v2/range/skeleton.tsx +47 -0
- package/src/widgets-v2/range/style.ts +41 -0
- package/src/widgets-v2/range/types.ts +37 -0
- package/src/widgets-v2/scatterplot/download.test.ts +71 -0
- package/src/widgets-v2/scatterplot/download.ts +54 -0
- package/src/widgets-v2/scatterplot/index.ts +11 -0
- package/src/widgets-v2/scatterplot/options.test.ts +399 -0
- package/src/widgets-v2/scatterplot/options.ts +421 -0
- package/src/widgets-v2/scatterplot/skeleton.test.tsx +17 -0
- package/src/widgets-v2/scatterplot/skeleton.tsx +84 -0
- package/src/widgets-v2/scatterplot/transforms.test.ts +97 -0
- package/src/widgets-v2/scatterplot/transforms.ts +38 -0
- package/src/widgets-v2/scatterplot/types.ts +55 -0
- package/src/widgets-v2/selection-summary/labels.ts +11 -0
- package/src/widgets-v2/selection-summary/selection-summary.test.tsx +53 -0
- package/src/widgets-v2/selection-summary/selection-summary.tsx +62 -0
- package/src/widgets-v2/selection-summary/style.ts +23 -0
- package/src/widgets-v2/spread/download.test.ts +64 -0
- package/src/widgets-v2/spread/download.ts +59 -0
- package/src/widgets-v2/spread/index.ts +6 -0
- package/src/widgets-v2/spread/separator.tsx +11 -0
- package/src/widgets-v2/spread/skeleton.test.tsx +17 -0
- package/src/widgets-v2/spread/skeleton.tsx +38 -0
- package/src/widgets-v2/spread/spread-ui.test.tsx +108 -0
- package/src/widgets-v2/spread/spread-ui.tsx +52 -0
- package/src/widgets-v2/spread/spread.test.tsx +50 -0
- package/src/widgets-v2/spread/spread.tsx +31 -0
- package/src/widgets-v2/spread/types.ts +27 -0
- package/src/widgets-v2/state/labels.test.ts +33 -0
- package/src/widgets-v2/state/labels.ts +20 -0
- package/src/widgets-v2/state/style.ts +25 -0
- package/src/widgets-v2/state/widget-state.test.tsx +294 -0
- package/src/widgets-v2/state/widget-state.tsx +184 -0
- package/src/widgets-v2/stores/index.ts +49 -0
- package/src/widgets-v2/stores/pipeline-middleware.test.ts +187 -0
- package/src/widgets-v2/stores/pipeline-middleware.ts +91 -0
- package/src/widgets-v2/stores/transforms.test.ts +162 -0
- package/src/widgets-v2/stores/transforms.ts +70 -0
- package/src/widgets-v2/stores/types.ts +64 -0
- package/src/widgets-v2/stores/use-echart-instance.test.tsx +91 -0
- package/src/widgets-v2/stores/use-echart-instance.ts +29 -0
- package/src/widgets-v2/stores/use-transform-enabled.test.tsx +127 -0
- package/src/widgets-v2/stores/use-transform-enabled.ts +25 -0
- package/src/widgets-v2/stores/use-transform.test.tsx +262 -0
- package/src/widgets-v2/stores/use-transform.ts +158 -0
- package/src/widgets-v2/stores/widget-context.test.tsx +58 -0
- package/src/widgets-v2/stores/widget-context.ts +15 -0
- package/src/widgets-v2/stores/widget-store-registry.test.ts +292 -0
- package/src/widgets-v2/stores/widget-store-registry.ts +248 -0
- package/src/widgets-v2/subheader/style.ts +12 -0
- package/src/widgets-v2/subheader/subheader.test.tsx +30 -0
- package/src/widgets-v2/subheader/subheader.tsx +16 -0
- package/src/widgets-v2/table/download.test.ts +75 -0
- package/src/widgets-v2/table/download.ts +47 -0
- package/src/widgets-v2/table/helpers.test.ts +214 -0
- package/src/widgets-v2/table/helpers.ts +136 -0
- package/src/widgets-v2/table/index.ts +23 -0
- package/src/widgets-v2/table/labels.tsx +41 -0
- package/src/widgets-v2/table/skeleton.test.tsx +26 -0
- package/src/widgets-v2/table/skeleton.tsx +65 -0
- package/src/widgets-v2/table/style.ts +46 -0
- package/src/widgets-v2/table/table-ui.test.tsx +200 -0
- package/src/widgets-v2/table/table-ui.tsx +331 -0
- package/src/widgets-v2/table/table.test.tsx +119 -0
- package/src/widgets-v2/table/table.tsx +174 -0
- package/src/widgets-v2/table/types.ts +44 -0
- package/src/widgets-v2/test-utils.ts +107 -0
- package/src/widgets-v2/timeseries/download.test.ts +95 -0
- package/src/widgets-v2/timeseries/download.ts +86 -0
- package/src/widgets-v2/timeseries/index.ts +10 -0
- package/src/widgets-v2/timeseries/options.test.ts +379 -0
- package/src/widgets-v2/timeseries/options.ts +341 -0
- package/src/widgets-v2/timeseries/skeleton.test.tsx +13 -0
- package/src/widgets-v2/timeseries/skeleton.tsx +76 -0
- package/src/widgets-v2/timeseries/types.ts +61 -0
- package/src/widgets-v2/toolbox/labels.ts +9 -0
- package/src/widgets-v2/toolbox/style.ts +33 -0
- package/src/widgets-v2/toolbox/toolbox.test.tsx +200 -0
- package/src/widgets-v2/toolbox/toolbox.tsx +309 -0
- package/src/widgets-v2/utils/data-zoom-layout.ts +26 -0
- package/src/widgets-v2/utils/index.ts +2 -0
- package/src/widgets-v2/utils/merge-options.test.ts +52 -0
- package/src/widgets-v2/utils/merge-options.ts +50 -0
- package/src/widgets-v2/wrapper/index.ts +14 -0
- package/src/widgets-v2/wrapper/labels.ts +11 -0
- package/src/widgets-v2/wrapper/style.ts +134 -0
- package/src/widgets-v2/wrapper/widget-actions.test.tsx +52 -0
- package/src/widgets-v2/wrapper/widget-actions.tsx +43 -0
- package/src/widgets-v2/wrapper/widget-content.test.tsx +27 -0
- package/src/widgets-v2/wrapper/widget-content.tsx +29 -0
- package/src/widgets-v2/wrapper/widget-wrapper.test.tsx +159 -0
- package/src/widgets-v2/wrapper/widget-wrapper.tsx +178 -0
- package/dist/styles-BYTyKQFP.js.map +0 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { buildPngDownloadItem, type DownloadItem } from '../actions/download'
|
|
2
|
+
import { tableDataToCsv } from './helpers'
|
|
3
|
+
import type { TableColumn, TableWidgetData } from './types'
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Download menu items for the Table widget. Always includes a CSV item
|
|
7
|
+
* that pulls the latest data from the widget store via `getData()` (so
|
|
8
|
+
* locked / sorted / filtered state is honored); headers come from
|
|
9
|
+
* `column.label`, cells from `row[column.id]`. When `getCaptureEl` is
|
|
10
|
+
* supplied, prepends a PNG item that rasterises the captured element via
|
|
11
|
+
* `html2canvas`.
|
|
12
|
+
*/
|
|
13
|
+
export function createTableDownloadConfig(opts: {
|
|
14
|
+
filename: string
|
|
15
|
+
getData: () => TableWidgetData
|
|
16
|
+
columns: readonly TableColumn[]
|
|
17
|
+
getCaptureEl?: () => HTMLElement | null
|
|
18
|
+
pngPixelRatio?: number
|
|
19
|
+
pngBackgroundColor?: string | null
|
|
20
|
+
}): DownloadItem[] {
|
|
21
|
+
const items: DownloadItem[] = []
|
|
22
|
+
if (opts.getCaptureEl) {
|
|
23
|
+
items.push(
|
|
24
|
+
buildPngDownloadItem({
|
|
25
|
+
filename: opts.filename,
|
|
26
|
+
getCaptureEl: opts.getCaptureEl,
|
|
27
|
+
pixelRatio: opts.pngPixelRatio,
|
|
28
|
+
backgroundColor: opts.pngBackgroundColor,
|
|
29
|
+
}),
|
|
30
|
+
)
|
|
31
|
+
}
|
|
32
|
+
items.push({
|
|
33
|
+
id: 'csv',
|
|
34
|
+
label: 'Download as CSV',
|
|
35
|
+
resolve: () => {
|
|
36
|
+
const csv = tableDataToCsv(opts.getData(), opts.columns)
|
|
37
|
+
const blob = new Blob([csv], { type: 'text/csv;charset=utf-8;' })
|
|
38
|
+
const url = URL.createObjectURL(blob)
|
|
39
|
+
return Promise.resolve({
|
|
40
|
+
url,
|
|
41
|
+
filename: `${opts.filename}.csv`,
|
|
42
|
+
revoke: () => URL.revokeObjectURL(url),
|
|
43
|
+
})
|
|
44
|
+
},
|
|
45
|
+
})
|
|
46
|
+
return items
|
|
47
|
+
}
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import {
|
|
3
|
+
compareValues,
|
|
4
|
+
deriveVisibleRows,
|
|
5
|
+
paginateRows,
|
|
6
|
+
resolveColumns,
|
|
7
|
+
sortRows,
|
|
8
|
+
tableDataToCsv,
|
|
9
|
+
} from './helpers'
|
|
10
|
+
import type { TableColumn, TableRow } from './types'
|
|
11
|
+
|
|
12
|
+
const ROWS: TableRow[] = [
|
|
13
|
+
{ id: 1, name: 'Alpha', score: 12 },
|
|
14
|
+
{ id: 2, name: 'beta', score: 7 },
|
|
15
|
+
{ id: 3, name: 'Gamma', score: 25 },
|
|
16
|
+
{ id: 4, name: null, score: null },
|
|
17
|
+
]
|
|
18
|
+
|
|
19
|
+
describe('compareValues', () => {
|
|
20
|
+
it('orders strings via locale compare', () => {
|
|
21
|
+
expect(compareValues('a', 'b', 'asc')).toBeLessThan(0)
|
|
22
|
+
expect(compareValues('b', 'a', 'asc')).toBeGreaterThan(0)
|
|
23
|
+
})
|
|
24
|
+
|
|
25
|
+
it('orders numbers numerically', () => {
|
|
26
|
+
expect(compareValues(1, 10, 'asc')).toBeLessThan(0)
|
|
27
|
+
expect(compareValues(10, 1, 'asc')).toBeGreaterThan(0)
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
it('flips comparison for desc', () => {
|
|
31
|
+
expect(compareValues(1, 10, 'desc')).toBeGreaterThan(0)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
it('sorts null/undefined to the end', () => {
|
|
35
|
+
expect(compareValues(null, 5, 'asc')).toBeGreaterThan(0)
|
|
36
|
+
expect(compareValues(5, null, 'asc')).toBeLessThan(0)
|
|
37
|
+
})
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
describe('sortRows', () => {
|
|
41
|
+
it('sorts numeric column ascending and descending', () => {
|
|
42
|
+
expect(sortRows(ROWS, 'score', 'asc').map((r) => r.id)).toEqual([
|
|
43
|
+
2, 1, 3, 4,
|
|
44
|
+
])
|
|
45
|
+
expect(sortRows(ROWS, 'score', 'desc').map((r) => r.id)).toEqual([
|
|
46
|
+
3, 1, 2, 4,
|
|
47
|
+
])
|
|
48
|
+
})
|
|
49
|
+
|
|
50
|
+
it('does not mutate the input', () => {
|
|
51
|
+
const before = [...ROWS]
|
|
52
|
+
sortRows(ROWS, 'score', 'asc')
|
|
53
|
+
expect(ROWS).toEqual(before)
|
|
54
|
+
})
|
|
55
|
+
})
|
|
56
|
+
|
|
57
|
+
describe('paginateRows', () => {
|
|
58
|
+
it('returns the requested slice', () => {
|
|
59
|
+
expect(paginateRows([1, 2, 3, 4, 5], 0, 2)).toEqual([1, 2])
|
|
60
|
+
expect(paginateRows([1, 2, 3, 4, 5], 1, 2)).toEqual([3, 4])
|
|
61
|
+
expect(paginateRows([1, 2, 3, 4, 5], 2, 2)).toEqual([5])
|
|
62
|
+
})
|
|
63
|
+
|
|
64
|
+
it('returns empty for out-of-range pages', () => {
|
|
65
|
+
expect(paginateRows([1, 2, 3], 5, 2)).toEqual([])
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
|
|
69
|
+
describe('resolveColumns', () => {
|
|
70
|
+
const cols: TableColumn[] = [
|
|
71
|
+
{ id: 'a', label: 'A' },
|
|
72
|
+
{ id: 'b', label: 'B' },
|
|
73
|
+
{ id: 'c', label: 'C' },
|
|
74
|
+
]
|
|
75
|
+
|
|
76
|
+
it('returns input unchanged when no order is provided', () => {
|
|
77
|
+
expect(resolveColumns(cols, undefined)).toBe(cols)
|
|
78
|
+
})
|
|
79
|
+
|
|
80
|
+
it('reorders by id', () => {
|
|
81
|
+
expect(resolveColumns(cols, ['c', 'a', 'b']).map((c) => c.id)).toEqual([
|
|
82
|
+
'c',
|
|
83
|
+
'a',
|
|
84
|
+
'b',
|
|
85
|
+
])
|
|
86
|
+
})
|
|
87
|
+
|
|
88
|
+
it('skips unknown ids and appends columns missing from the order', () => {
|
|
89
|
+
expect(resolveColumns(cols, ['c', 'unknown']).map((c) => c.id)).toEqual([
|
|
90
|
+
'c',
|
|
91
|
+
'a',
|
|
92
|
+
'b',
|
|
93
|
+
])
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
|
|
97
|
+
describe('deriveVisibleRows', () => {
|
|
98
|
+
it('paginates without sort when sort columnId is null', () => {
|
|
99
|
+
const out = deriveVisibleRows(ROWS, {
|
|
100
|
+
sort: { columnId: null, direction: 'asc' },
|
|
101
|
+
page: 0,
|
|
102
|
+
pageSize: 2,
|
|
103
|
+
})
|
|
104
|
+
expect(out.visible.map((r) => r.id)).toEqual([1, 2])
|
|
105
|
+
expect(out.sorted.length).toBe(4)
|
|
106
|
+
})
|
|
107
|
+
|
|
108
|
+
it('sorts then paginates', () => {
|
|
109
|
+
const out = deriveVisibleRows(ROWS, {
|
|
110
|
+
sort: { columnId: 'score', direction: 'asc' },
|
|
111
|
+
page: 0,
|
|
112
|
+
pageSize: 2,
|
|
113
|
+
})
|
|
114
|
+
expect(out.visible.map((r) => r.id)).toEqual([2, 1])
|
|
115
|
+
})
|
|
116
|
+
})
|
|
117
|
+
|
|
118
|
+
describe('compareValues — broader types', () => {
|
|
119
|
+
it('ranks booleans (false < true)', () => {
|
|
120
|
+
expect(compareValues(false, true, 'asc')).toBeLessThan(0)
|
|
121
|
+
expect(compareValues(true, false, 'asc')).toBeGreaterThan(0)
|
|
122
|
+
expect(compareValues(true, true, 'asc')).toBe(0)
|
|
123
|
+
})
|
|
124
|
+
|
|
125
|
+
it('compares objects/arrays via JSON serialization', () => {
|
|
126
|
+
expect(compareValues({ a: 1 }, { a: 2 }, 'asc')).toBeLessThan(0)
|
|
127
|
+
expect(compareValues([1, 2], [1, 1], 'desc')).toBeLessThan(0)
|
|
128
|
+
})
|
|
129
|
+
|
|
130
|
+
it('returns 0 when both sides are null/undefined', () => {
|
|
131
|
+
expect(compareValues(null, undefined, 'asc')).toBe(0)
|
|
132
|
+
expect(compareValues(undefined, null, 'desc')).toBe(0)
|
|
133
|
+
})
|
|
134
|
+
|
|
135
|
+
it('returns 0 for mismatched primitive types it does not know how to order', () => {
|
|
136
|
+
// Not a documented contract but the implementation falls through to cmp = 0
|
|
137
|
+
// when types don't match — guard the fallthrough behavior so future
|
|
138
|
+
// refactors notice if they change it.
|
|
139
|
+
expect(compareValues(1, 'a', 'asc')).toBe(0)
|
|
140
|
+
})
|
|
141
|
+
})
|
|
142
|
+
|
|
143
|
+
describe('paginateRows — edge cases', () => {
|
|
144
|
+
it('returns a copy when pageSize is 0 or negative', () => {
|
|
145
|
+
const rows = [1, 2, 3]
|
|
146
|
+
const out = paginateRows(rows, 0, 0)
|
|
147
|
+
expect(out).toEqual(rows)
|
|
148
|
+
expect(out).not.toBe(rows)
|
|
149
|
+
expect(paginateRows(rows, 0, -5)).toEqual(rows)
|
|
150
|
+
})
|
|
151
|
+
})
|
|
152
|
+
|
|
153
|
+
describe('resolveColumns — edge cases', () => {
|
|
154
|
+
const cols: TableColumn[] = [
|
|
155
|
+
{ id: 'a', label: 'A' },
|
|
156
|
+
{ id: 'b', label: 'B' },
|
|
157
|
+
]
|
|
158
|
+
it('returns input unchanged when order is empty', () => {
|
|
159
|
+
expect(resolveColumns(cols, [])).toBe(cols)
|
|
160
|
+
})
|
|
161
|
+
|
|
162
|
+
it('deduplicates repeated ids in the order', () => {
|
|
163
|
+
expect(resolveColumns(cols, ['a', 'a', 'b']).map((c) => c.id)).toEqual([
|
|
164
|
+
'a',
|
|
165
|
+
'b',
|
|
166
|
+
])
|
|
167
|
+
})
|
|
168
|
+
})
|
|
169
|
+
|
|
170
|
+
describe('tableDataToCsv', () => {
|
|
171
|
+
const cols: TableColumn[] = [
|
|
172
|
+
{ id: 'name', label: 'Name' },
|
|
173
|
+
{ id: 'score', label: 'Score' },
|
|
174
|
+
]
|
|
175
|
+
|
|
176
|
+
it('emits header row + cell rows', () => {
|
|
177
|
+
const csv = tableDataToCsv(ROWS, cols)
|
|
178
|
+
const lines = csv.split('\n')
|
|
179
|
+
expect(lines[0]).toBe('Name,Score')
|
|
180
|
+
expect(lines[1]).toBe('Alpha,12')
|
|
181
|
+
expect(lines[2]).toBe('beta,7')
|
|
182
|
+
})
|
|
183
|
+
|
|
184
|
+
it('escapes commas, newlines, and quotes', () => {
|
|
185
|
+
const csv = tableDataToCsv([{ id: 1, name: 'a, b "c"\nd', score: 1 }], cols)
|
|
186
|
+
expect(csv).toContain('"a, b ""c""\nd",1')
|
|
187
|
+
})
|
|
188
|
+
|
|
189
|
+
it('renders null cells as empty strings', () => {
|
|
190
|
+
const csv = tableDataToCsv([ROWS[3]!], cols)
|
|
191
|
+
expect(csv.split('\n')[1]).toBe(',')
|
|
192
|
+
})
|
|
193
|
+
|
|
194
|
+
it('coerces numeric/boolean header labels and skips ReactNode labels', () => {
|
|
195
|
+
const numericLabel: TableColumn[] = [
|
|
196
|
+
{ id: 'a', label: 7 as unknown as TableColumn['label'] },
|
|
197
|
+
{ id: 'b', label: true as unknown as TableColumn['label'] },
|
|
198
|
+
// ReactNode (object) labels degrade to empty string by design.
|
|
199
|
+
{ id: 'c', label: { type: 'span' } as unknown as TableColumn['label'] },
|
|
200
|
+
]
|
|
201
|
+
const csv = tableDataToCsv([], numericLabel)
|
|
202
|
+
expect(csv).toBe('7,true,')
|
|
203
|
+
})
|
|
204
|
+
|
|
205
|
+
it('serialises array and object cell values as JSON', () => {
|
|
206
|
+
const csv = tableDataToCsv(
|
|
207
|
+
[{ id: 1, name: ['x', 'y'], score: { z: 1 } }],
|
|
208
|
+
cols,
|
|
209
|
+
)
|
|
210
|
+
// The JSON contains quotes so the cell wraps + escapes.
|
|
211
|
+
expect(csv).toContain('"[""x"",""y""]"')
|
|
212
|
+
expect(csv).toContain('"{""z"":1}"')
|
|
213
|
+
})
|
|
214
|
+
})
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
TableColumn,
|
|
3
|
+
TableRow,
|
|
4
|
+
TableSortDirection,
|
|
5
|
+
TableWidgetData,
|
|
6
|
+
} from './types'
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Compares two values with a consistent ordering across primitive types.
|
|
10
|
+
* Strings use locale comparison; numbers subtract; booleans rank false < true;
|
|
11
|
+
* objects/arrays compare by JSON serialization. Null/undefined sort to the end
|
|
12
|
+
* regardless of direction.
|
|
13
|
+
*/
|
|
14
|
+
export function compareValues(
|
|
15
|
+
a: unknown,
|
|
16
|
+
b: unknown,
|
|
17
|
+
direction: TableSortDirection,
|
|
18
|
+
): number {
|
|
19
|
+
if (a == null && b == null) return 0
|
|
20
|
+
if (a == null) return 1
|
|
21
|
+
if (b == null) return -1
|
|
22
|
+
let cmp = 0
|
|
23
|
+
if (typeof a === 'string' && typeof b === 'string') {
|
|
24
|
+
cmp = a.localeCompare(b)
|
|
25
|
+
} else if (typeof a === 'number' && typeof b === 'number') {
|
|
26
|
+
cmp = a - b
|
|
27
|
+
} else if (typeof a === 'boolean' && typeof b === 'boolean') {
|
|
28
|
+
cmp = a === b ? 0 : a ? 1 : -1
|
|
29
|
+
} else if (typeof a === 'object' || typeof b === 'object') {
|
|
30
|
+
cmp = JSON.stringify(a).localeCompare(JSON.stringify(b))
|
|
31
|
+
}
|
|
32
|
+
return direction === 'asc' ? cmp : -cmp
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** Returns a new array sorted by the named column. Does not mutate the input. */
|
|
36
|
+
export function sortRows<T extends TableRow>(
|
|
37
|
+
rows: readonly T[],
|
|
38
|
+
columnId: string,
|
|
39
|
+
direction: TableSortDirection,
|
|
40
|
+
): T[] {
|
|
41
|
+
return [...rows].sort((a, b) =>
|
|
42
|
+
compareValues(a[columnId], b[columnId], direction),
|
|
43
|
+
)
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Returns the slice for the requested page. Out-of-range pages return []. */
|
|
47
|
+
export function paginateRows<T>(
|
|
48
|
+
rows: readonly T[],
|
|
49
|
+
page: number,
|
|
50
|
+
pageSize: number,
|
|
51
|
+
): T[] {
|
|
52
|
+
if (pageSize <= 0) return rows.slice()
|
|
53
|
+
const start = page * pageSize
|
|
54
|
+
return rows.slice(start, start + pageSize)
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Resolves the effective column list. When the widget store has a
|
|
59
|
+
* `columnOrder` set (e.g. ChangeColumn was used), the column array is
|
|
60
|
+
* reordered to match. Unknown ids in the order are skipped; columns not
|
|
61
|
+
* present in the order keep their original relative position at the end.
|
|
62
|
+
*/
|
|
63
|
+
export function resolveColumns(
|
|
64
|
+
columns: readonly TableColumn[],
|
|
65
|
+
columnOrder: readonly string[] | undefined,
|
|
66
|
+
): readonly TableColumn[] {
|
|
67
|
+
if (!columnOrder || columnOrder.length === 0) return columns
|
|
68
|
+
const byId = new Map(columns.map((c) => [c.id, c]))
|
|
69
|
+
const ordered: TableColumn[] = []
|
|
70
|
+
const seen = new Set<string>()
|
|
71
|
+
for (const id of columnOrder) {
|
|
72
|
+
const c = byId.get(id)
|
|
73
|
+
if (c && !seen.has(id)) {
|
|
74
|
+
ordered.push(c)
|
|
75
|
+
seen.add(id)
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
for (const c of columns) {
|
|
79
|
+
if (!seen.has(c.id)) ordered.push(c)
|
|
80
|
+
}
|
|
81
|
+
return ordered
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** Applies sort and pagination to the input data. Pure. */
|
|
85
|
+
export function deriveVisibleRows<T extends TableRow>(
|
|
86
|
+
rows: readonly T[],
|
|
87
|
+
options: {
|
|
88
|
+
sort?: { columnId: string | null; direction: TableSortDirection }
|
|
89
|
+
page: number
|
|
90
|
+
pageSize: number
|
|
91
|
+
},
|
|
92
|
+
): { sorted: readonly T[]; visible: T[] } {
|
|
93
|
+
const sorted =
|
|
94
|
+
options.sort?.columnId != null
|
|
95
|
+
? sortRows(rows, options.sort.columnId, options.sort.direction)
|
|
96
|
+
: rows
|
|
97
|
+
const visible = paginateRows(sorted, options.page, options.pageSize)
|
|
98
|
+
return { sorted, visible }
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export function tableDataToCsv(
|
|
102
|
+
data: TableWidgetData,
|
|
103
|
+
columns: readonly TableColumn[],
|
|
104
|
+
): string {
|
|
105
|
+
const head = columns.map((c) => csvEscape(stringifyHeader(c.label))).join(',')
|
|
106
|
+
const lines = [head]
|
|
107
|
+
for (const row of data) {
|
|
108
|
+
const cells = columns.map((c) => csvEscape(stringifyCell(row[c.id])))
|
|
109
|
+
lines.push(cells.join(','))
|
|
110
|
+
}
|
|
111
|
+
return lines.join('\n')
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
function csvEscape(value: string): string {
|
|
115
|
+
if (/[",\n\r]/.test(value)) {
|
|
116
|
+
return `"${value.replace(/"/g, '""')}"`
|
|
117
|
+
}
|
|
118
|
+
return value
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
function stringifyHeader(label: unknown): string {
|
|
122
|
+
if (typeof label === 'string') return label
|
|
123
|
+
if (typeof label === 'number' || typeof label === 'boolean')
|
|
124
|
+
return String(label)
|
|
125
|
+
return ''
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
function stringifyCell(value: unknown): string {
|
|
129
|
+
if (value == null) return ''
|
|
130
|
+
if (typeof value === 'string') return value
|
|
131
|
+
if (typeof value === 'number' || typeof value === 'boolean')
|
|
132
|
+
return String(value)
|
|
133
|
+
if (Array.isArray(value) || typeof value === 'object')
|
|
134
|
+
return JSON.stringify(value)
|
|
135
|
+
return ''
|
|
136
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export { Table, type TableProps } from './table'
|
|
2
|
+
export { TableUI, type TableUIProps } from './table-ui'
|
|
3
|
+
export { TableSkeleton, type TableSkeletonProps } from './skeleton'
|
|
4
|
+
export { createTableDownloadConfig } from './download'
|
|
5
|
+
export {
|
|
6
|
+
compareValues,
|
|
7
|
+
sortRows,
|
|
8
|
+
paginateRows,
|
|
9
|
+
resolveColumns,
|
|
10
|
+
deriveVisibleRows,
|
|
11
|
+
tableDataToCsv,
|
|
12
|
+
} from './helpers'
|
|
13
|
+
export { DEFAULT_TABLE_LABELS, type TableLabels } from './labels'
|
|
14
|
+
export {
|
|
15
|
+
DEFAULT_TABLE_PAGE_SIZE,
|
|
16
|
+
DEFAULT_TABLE_PAGE_SIZE_OPTIONS,
|
|
17
|
+
type TableColumn,
|
|
18
|
+
type TableRow,
|
|
19
|
+
type TableWidgetData,
|
|
20
|
+
type TableWidgetState,
|
|
21
|
+
type TableSortDirection,
|
|
22
|
+
type TableSortState,
|
|
23
|
+
} from './types'
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Box, type SxProps, type Theme } from '@mui/material'
|
|
2
|
+
import type { ReactNode } from 'react'
|
|
3
|
+
|
|
4
|
+
export interface TableLabels {
|
|
5
|
+
selectAll: string
|
|
6
|
+
selectRow: (rowId: string | number) => string
|
|
7
|
+
rowsPerPage: string
|
|
8
|
+
/**
|
|
9
|
+
* Renders the displayed-rows summary in the pagination footer. Returns
|
|
10
|
+
* a `ReactNode` so the default can emphasise the active range
|
|
11
|
+
* (`from-to`) with a bolder weight while keeping the trailing
|
|
12
|
+
* ` of total` muted. Override to localise wording or restyle.
|
|
13
|
+
*/
|
|
14
|
+
paginationOf: (from: number, to: number, total: number) => ReactNode
|
|
15
|
+
/** aria-label for the first-page pagination button. */
|
|
16
|
+
firstPage: string
|
|
17
|
+
/** aria-label for the previous-page pagination button. */
|
|
18
|
+
previousPage: string
|
|
19
|
+
/** aria-label for the next-page pagination button. */
|
|
20
|
+
nextPage: string
|
|
21
|
+
/** aria-label for the last-page pagination button. */
|
|
22
|
+
lastPage: string
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const boldRange: SxProps<Theme> = { fontWeight: 600, color: 'text.primary' }
|
|
26
|
+
|
|
27
|
+
export const DEFAULT_TABLE_LABELS: TableLabels = {
|
|
28
|
+
selectAll: 'Select all rows',
|
|
29
|
+
selectRow: (id) => `Select row ${id}`,
|
|
30
|
+
rowsPerPage: 'Rows per page:',
|
|
31
|
+
paginationOf: (from, to, total) => (
|
|
32
|
+
<>
|
|
33
|
+
<Box component='span' sx={boldRange}>{`${from}–${to}`}</Box>
|
|
34
|
+
{` of ${total}`}
|
|
35
|
+
</>
|
|
36
|
+
),
|
|
37
|
+
firstPage: 'First page',
|
|
38
|
+
previousPage: 'Previous page',
|
|
39
|
+
nextPage: 'Next page',
|
|
40
|
+
lastPage: 'Last page',
|
|
41
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { describe, it, expect } from 'vitest'
|
|
2
|
+
import { render } from '@testing-library/react'
|
|
3
|
+
import { TableSkeleton } from './skeleton'
|
|
4
|
+
|
|
5
|
+
describe('<TableSkeleton>', () => {
|
|
6
|
+
it('renders the default 5×4 grid of skeleton cells', () => {
|
|
7
|
+
const { container, getByLabelText } = render(<TableSkeleton />)
|
|
8
|
+
expect(getByLabelText('Table skeleton')).toBeTruthy()
|
|
9
|
+
// 4 header + (5×4) body = 24 cells, each containing one Skeleton.
|
|
10
|
+
expect(container.querySelectorAll('.MuiSkeleton-root').length).toBe(24)
|
|
11
|
+
})
|
|
12
|
+
|
|
13
|
+
it('honours custom rows × columns', () => {
|
|
14
|
+
const { container } = render(<TableSkeleton rows={2} columns={3} />)
|
|
15
|
+
// 3 header + (2×3) body = 9.
|
|
16
|
+
expect(container.querySelectorAll('.MuiSkeleton-root').length).toBe(9)
|
|
17
|
+
})
|
|
18
|
+
|
|
19
|
+
it('forwards the size prop to MUI Table', () => {
|
|
20
|
+
const { container } = render(<TableSkeleton size='small' />)
|
|
21
|
+
// MUI Table doesn't apply a `sizeSmall` class but does set `padding=none`
|
|
22
|
+
// on header cells when size='small'. Confirm a TableCell got the small
|
|
23
|
+
// padding class so we know the size prop propagated.
|
|
24
|
+
expect(container.querySelector('.MuiTableCell-sizeSmall')).not.toBeNull()
|
|
25
|
+
})
|
|
26
|
+
})
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Box,
|
|
3
|
+
Skeleton,
|
|
4
|
+
Table as MuiTable,
|
|
5
|
+
TableBody,
|
|
6
|
+
TableCell,
|
|
7
|
+
TableHead,
|
|
8
|
+
TableRow as MuiTableRow,
|
|
9
|
+
type TableProps as MuiTableProps,
|
|
10
|
+
} from '@mui/material'
|
|
11
|
+
import { styles } from './style'
|
|
12
|
+
|
|
13
|
+
export interface TableSkeletonProps {
|
|
14
|
+
/** Number of body rows to render. Defaults to `5` (matches v1). */
|
|
15
|
+
rows?: number
|
|
16
|
+
/** Number of columns to render. Defaults to `4` (matches v1). */
|
|
17
|
+
columns?: number
|
|
18
|
+
/**
|
|
19
|
+
* Forwarded to MUI's `<Table size>` so the loading layout matches the
|
|
20
|
+
* size you'll render in {@link TableUI}. Leave `undefined` (the
|
|
21
|
+
* default) to use MUI's own default density.
|
|
22
|
+
*/
|
|
23
|
+
size?: MuiTableProps['size']
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Loading placeholder for the Table widget. Renders the same MUI table
|
|
28
|
+
* primitives that {@link TableUI} uses so the loading layout (column
|
|
29
|
+
* widths, header band, row density) doesn't shift when data resolves.
|
|
30
|
+
*
|
|
31
|
+
* Mirrors the v1 widget's `<TableSkeleton>` structure with v2's themed
|
|
32
|
+
* `styles.headerCell`.
|
|
33
|
+
*/
|
|
34
|
+
export function TableSkeleton({
|
|
35
|
+
rows = 5,
|
|
36
|
+
columns = 4,
|
|
37
|
+
size,
|
|
38
|
+
}: TableSkeletonProps) {
|
|
39
|
+
return (
|
|
40
|
+
<Box sx={styles.container} aria-label='Table skeleton'>
|
|
41
|
+
<MuiTable size={size} sx={styles.table} stickyHeader>
|
|
42
|
+
<TableHead>
|
|
43
|
+
<MuiTableRow>
|
|
44
|
+
{Array.from({ length: columns }).map((_, c) => (
|
|
45
|
+
<TableCell key={`head-${c}`} sx={styles.headerCell}>
|
|
46
|
+
<Skeleton variant='text' width='80%' height={24} />
|
|
47
|
+
</TableCell>
|
|
48
|
+
))}
|
|
49
|
+
</MuiTableRow>
|
|
50
|
+
</TableHead>
|
|
51
|
+
<TableBody>
|
|
52
|
+
{Array.from({ length: rows }).map((_, r) => (
|
|
53
|
+
<MuiTableRow key={`row-${r}`} sx={styles.row}>
|
|
54
|
+
{Array.from({ length: columns }).map((__, c) => (
|
|
55
|
+
<TableCell key={`cell-${r}-${c}`}>
|
|
56
|
+
<Skeleton variant='text' width='70%' height={20} />
|
|
57
|
+
</TableCell>
|
|
58
|
+
))}
|
|
59
|
+
</MuiTableRow>
|
|
60
|
+
))}
|
|
61
|
+
</TableBody>
|
|
62
|
+
</MuiTable>
|
|
63
|
+
</Box>
|
|
64
|
+
)
|
|
65
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { SxProps, Theme } from '@mui/material'
|
|
2
|
+
|
|
3
|
+
export const styles = {
|
|
4
|
+
container: {
|
|
5
|
+
width: '100%',
|
|
6
|
+
overflowX: 'auto',
|
|
7
|
+
},
|
|
8
|
+
/**
|
|
9
|
+
* Minimum table width so columns don't collapse to unreadable widths on
|
|
10
|
+
* narrow widget shells. Mirrors v1.
|
|
11
|
+
*/
|
|
12
|
+
table: {
|
|
13
|
+
minWidth: 650,
|
|
14
|
+
},
|
|
15
|
+
headerCell: {
|
|
16
|
+
fontWeight: 600,
|
|
17
|
+
backgroundColor: 'background.paper',
|
|
18
|
+
},
|
|
19
|
+
/**
|
|
20
|
+
* Strip the bottom border from the last body row so the body flushes
|
|
21
|
+
* against the pagination border instead of doubling it up. Mirrors v1.
|
|
22
|
+
*/
|
|
23
|
+
row: {
|
|
24
|
+
'&:last-child td, &:last-child th': {
|
|
25
|
+
border: 0,
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
rowClickable: {
|
|
29
|
+
cursor: 'pointer',
|
|
30
|
+
},
|
|
31
|
+
pagination: {
|
|
32
|
+
borderTop: '1px solid',
|
|
33
|
+
borderColor: 'divider',
|
|
34
|
+
},
|
|
35
|
+
paginationActions: {
|
|
36
|
+
display: 'flex',
|
|
37
|
+
alignItems: 'center',
|
|
38
|
+
gap: 0.25,
|
|
39
|
+
ml: 1,
|
|
40
|
+
},
|
|
41
|
+
empty: {
|
|
42
|
+
textAlign: 'center',
|
|
43
|
+
color: 'text.secondary',
|
|
44
|
+
py: 3,
|
|
45
|
+
},
|
|
46
|
+
} satisfies Record<string, SxProps<Theme>>
|