@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,111 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
root: {
|
|
4
|
+
position: "relative";
|
|
5
|
+
width: string;
|
|
6
|
+
minWidth: number;
|
|
7
|
+
bgcolor: "background.paper";
|
|
8
|
+
border: "1px solid";
|
|
9
|
+
borderColor: "divider";
|
|
10
|
+
borderRadius: number;
|
|
11
|
+
overflow: "hidden";
|
|
12
|
+
'&::before': {
|
|
13
|
+
display: "none";
|
|
14
|
+
};
|
|
15
|
+
'& .widget-wrapper-actions > *': {
|
|
16
|
+
opacity: number;
|
|
17
|
+
transition: ({ transitions }: Theme) => string;
|
|
18
|
+
'@media (hover: hover)': {
|
|
19
|
+
opacity: number;
|
|
20
|
+
};
|
|
21
|
+
'&.active': {
|
|
22
|
+
opacity: number;
|
|
23
|
+
};
|
|
24
|
+
};
|
|
25
|
+
'&:hover .widget-wrapper-actions > *': {
|
|
26
|
+
opacity: number;
|
|
27
|
+
};
|
|
28
|
+
'&[data-collapsed="true"] .widget-wrapper-actions > *': {
|
|
29
|
+
opacity: number;
|
|
30
|
+
pointerEvents: "none";
|
|
31
|
+
'&.active': {
|
|
32
|
+
opacity: number;
|
|
33
|
+
};
|
|
34
|
+
};
|
|
35
|
+
'&.Mui-disabled': {
|
|
36
|
+
pointerEvents: "none";
|
|
37
|
+
bgcolor: "background.paper";
|
|
38
|
+
'& .MuiAccordionSummary-root.Mui-disabled': {
|
|
39
|
+
opacity: number;
|
|
40
|
+
color: "inherit";
|
|
41
|
+
backgroundColor: "transparent";
|
|
42
|
+
};
|
|
43
|
+
'& .MuiAccordionSummary-expandIconWrapper': {
|
|
44
|
+
display: "none";
|
|
45
|
+
};
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
loading: {
|
|
49
|
+
position: "absolute";
|
|
50
|
+
top: number;
|
|
51
|
+
left: number;
|
|
52
|
+
width: string;
|
|
53
|
+
height: ({ spacing }: Theme) => string;
|
|
54
|
+
zIndex: number;
|
|
55
|
+
};
|
|
56
|
+
summary: {
|
|
57
|
+
minHeight: ({ spacing }: Theme) => string;
|
|
58
|
+
'& .MuiAccordionSummary-content': {
|
|
59
|
+
gap: ({ spacing }: Theme) => string;
|
|
60
|
+
paddingInlineEnd: ({ spacing }: Theme) => string;
|
|
61
|
+
alignItems: "center";
|
|
62
|
+
};
|
|
63
|
+
};
|
|
64
|
+
titleCell: {
|
|
65
|
+
flexGrow: number;
|
|
66
|
+
flexShrink: number;
|
|
67
|
+
minWidth: number;
|
|
68
|
+
display: "flex";
|
|
69
|
+
alignItems: "center";
|
|
70
|
+
minHeight: ({ spacing }: Theme) => string;
|
|
71
|
+
};
|
|
72
|
+
titleText: {
|
|
73
|
+
minWidth: number;
|
|
74
|
+
wordBreak: "break-word";
|
|
75
|
+
overflow: "hidden";
|
|
76
|
+
display: "-webkit-box";
|
|
77
|
+
WebkitLineClamp: number;
|
|
78
|
+
WebkitBoxOrient: "vertical";
|
|
79
|
+
};
|
|
80
|
+
actions: {
|
|
81
|
+
display: "flex";
|
|
82
|
+
alignItems: "center";
|
|
83
|
+
gap: number;
|
|
84
|
+
justifyContent: "flex-end";
|
|
85
|
+
flexShrink: number;
|
|
86
|
+
'& > *': {
|
|
87
|
+
pointerEvents: "auto";
|
|
88
|
+
};
|
|
89
|
+
};
|
|
90
|
+
options: {
|
|
91
|
+
display: "flex";
|
|
92
|
+
alignItems: "center";
|
|
93
|
+
gap: number;
|
|
94
|
+
flexShrink: number;
|
|
95
|
+
};
|
|
96
|
+
detail: {
|
|
97
|
+
display: "flex";
|
|
98
|
+
flexDirection: "column";
|
|
99
|
+
gap: ({ spacing }: Theme) => string;
|
|
100
|
+
paddingTop: ({ spacing }: Theme) => string;
|
|
101
|
+
};
|
|
102
|
+
content: {
|
|
103
|
+
minWidth: number;
|
|
104
|
+
display: "flex";
|
|
105
|
+
flexDirection: "column";
|
|
106
|
+
gap: number;
|
|
107
|
+
};
|
|
108
|
+
footer: {
|
|
109
|
+
pt: number;
|
|
110
|
+
};
|
|
111
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface ActionsProps {
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Slot for the wrapper header's right-side action buttons. The
|
|
9
|
+
* `widget-wrapper-actions` className activates the hover-fade CSS rule on
|
|
10
|
+
* `<Wrapper>`: action children fade in on hover (always visible on coarse-
|
|
11
|
+
* pointer devices), and stay full-opacity when a descendant is marked with
|
|
12
|
+
* `.active` — typically applied by toggled actions.
|
|
13
|
+
*
|
|
14
|
+
* The container also stops click propagation so interacting with an action
|
|
15
|
+
* doesn't toggle the wrapper's collapse.
|
|
16
|
+
*/
|
|
17
|
+
export declare function Actions({ sx, children }: ActionsProps): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export interface OptionsProps {
|
|
19
|
+
sx?: SxProps<Theme>;
|
|
20
|
+
children: ReactNode;
|
|
21
|
+
}
|
|
22
|
+
export declare function Options({ sx, children }: OptionsProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { SxProps, Theme } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface ContentProps {
|
|
4
|
+
sx?: SxProps<Theme>;
|
|
5
|
+
children: ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare function Content({ sx, children }: ContentProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export interface FooterProps {
|
|
9
|
+
sx?: SxProps<Theme>;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}
|
|
12
|
+
export declare function Footer({ sx, children }: FooterProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { ComponentType, ReactNode } from 'react';
|
|
2
|
+
import { SvgIconProps, SxProps, Theme } from '@mui/material';
|
|
3
|
+
import { WrapperLabels } from './labels';
|
|
4
|
+
export interface WrapperProps {
|
|
5
|
+
title: string;
|
|
6
|
+
/**
|
|
7
|
+
* Controlled collapsed state. When supplied, the wrapper is fully
|
|
8
|
+
* controlled — the consumer is responsible for updating it via
|
|
9
|
+
* `onCollapseChange`. Leave undefined to use the uncontrolled mode,
|
|
10
|
+
* which seeds internal state from `defaultCollapsed`.
|
|
11
|
+
*/
|
|
12
|
+
collapsed?: boolean;
|
|
13
|
+
/**
|
|
14
|
+
* Fires whenever the user interacts to toggle the wrapper, with the
|
|
15
|
+
* NEXT collapsed value. Called for both controlled and uncontrolled
|
|
16
|
+
* usage — consumers can subscribe to user-driven toggles even when
|
|
17
|
+
* letting the wrapper manage its own state.
|
|
18
|
+
*/
|
|
19
|
+
onCollapseChange?: (collapsed: boolean) => void;
|
|
20
|
+
/**
|
|
21
|
+
* Initial collapsed state when the wrapper is uncontrolled (i.e.
|
|
22
|
+
* `collapsed` is undefined). Ignored when `collapsed` is supplied.
|
|
23
|
+
*/
|
|
24
|
+
defaultCollapsed?: boolean;
|
|
25
|
+
disabled?: boolean;
|
|
26
|
+
labels?: Partial<WrapperLabels>;
|
|
27
|
+
/**
|
|
28
|
+
* Icon shown at the right edge of the summary row. Accordion rotates it
|
|
29
|
+
* 180° automatically when the wrapper expands. Default: `ExpandMoreIcon`.
|
|
30
|
+
*/
|
|
31
|
+
expandIcon?: ComponentType<SvgIconProps>;
|
|
32
|
+
iconProps?: SvgIconProps;
|
|
33
|
+
sx?: SxProps<Theme>;
|
|
34
|
+
children: ReactNode;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Widget shell — title + collapsible body, built on MUI `<Accordion>` for
|
|
38
|
+
* native click-to-toggle on the summary header and a smooth open/close
|
|
39
|
+
* transition. UX matches v1 `<WrapperUI>`:
|
|
40
|
+
*
|
|
41
|
+
* • hover-fade action buttons (always visible on coarse-pointer devices)
|
|
42
|
+
* • multi-line title clamp (`WebkitLineClamp: 2`, word-break) + SmartTooltip
|
|
43
|
+
* when the text overflows
|
|
44
|
+
* • top-edge `<LinearProgress>` driven by the widget store's `isFetching`
|
|
45
|
+
* • chevron at the right end (rotated by Accordion based on expanded state)
|
|
46
|
+
*
|
|
47
|
+
* Children are partitioned by component identity: `<Actions>` and `<Options>`
|
|
48
|
+
* render inside the summary row; everything else (`<Content>`, `<Footer>`,
|
|
49
|
+
* loose nodes) renders inside the details panel.
|
|
50
|
+
*/
|
|
51
|
+
export declare function Wrapper({ title, collapsed, onCollapseChange, defaultCollapsed, disabled, labels, expandIcon: ExpandIcon, iconProps, sx, children, }: WrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import { c as q } from "react/compiler-runtime";
|
|
2
|
+
import { useSyncExternalStore as H, useEffect as $, useRef as N } from "react";
|
|
3
|
+
import { o as O, h as P, i as W, t as j, k as z } from "./widget-store-registry-_W4Z4xp-.js";
|
|
4
|
+
import { useStore as B } from "zustand";
|
|
5
|
+
const C = () => null;
|
|
6
|
+
function M(a) {
|
|
7
|
+
const r = q(3);
|
|
8
|
+
let f, t;
|
|
9
|
+
return r[0] !== a ? (f = (o) => O(a, o), t = () => P(a), r[0] = a, r[1] = f, r[2] = t) : (f = r[1], t = r[2]), H(f, t, C);
|
|
10
|
+
}
|
|
11
|
+
function D(a, r, f) {
|
|
12
|
+
const t = q(29);
|
|
13
|
+
if (r.length === 0)
|
|
14
|
+
throw new Error("[widgets-v2] useTransform requires at least one pair.");
|
|
15
|
+
let o;
|
|
16
|
+
t[0] !== a ? (o = W(a), t[0] = a, t[1] = o) : o = t[1];
|
|
17
|
+
const e = o, s = r[0].descriptor.id, c = f?.initialEnabled ?? !0;
|
|
18
|
+
let b;
|
|
19
|
+
t[2] !== s ? (b = (n) => n.transformStates[s]?.enabled, t[2] = s, t[3] = b) : b = t[3];
|
|
20
|
+
const u = B(e, b), i = typeof u == "boolean" ? u : c;
|
|
21
|
+
let p, g;
|
|
22
|
+
t[4] !== c || t[5] !== u || t[6] !== s || t[7] !== e ? (p = () => {
|
|
23
|
+
typeof u != "boolean" && e.setState((n) => ({
|
|
24
|
+
transformStates: {
|
|
25
|
+
...n.transformStates,
|
|
26
|
+
[s]: {
|
|
27
|
+
...n.transformStates[s],
|
|
28
|
+
enabled: c
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
}));
|
|
32
|
+
}, g = [e, s, u, c], t[4] = c, t[5] = u, t[6] = s, t[7] = e, t[8] = p, t[9] = g) : (p = t[8], g = t[9]), $(p, g);
|
|
33
|
+
let y;
|
|
34
|
+
t[10] !== c || t[11] !== s || t[12] !== e ? (y = (n) => {
|
|
35
|
+
e.setState((l) => {
|
|
36
|
+
const S = l.transformStates[s]?.enabled ?? c, d = typeof n == "function" ? n(S) : n;
|
|
37
|
+
return d === S ? {} : {
|
|
38
|
+
transformStates: {
|
|
39
|
+
...l.transformStates,
|
|
40
|
+
[s]: {
|
|
41
|
+
...l.transformStates[s],
|
|
42
|
+
enabled: d
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
});
|
|
47
|
+
}, t[10] = c, t[11] = s, t[12] = e, t[13] = y) : y = t[13];
|
|
48
|
+
const m = y;
|
|
49
|
+
let E;
|
|
50
|
+
t[14] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (E = [], t[14] = E) : E = t[14];
|
|
51
|
+
const R = N(E);
|
|
52
|
+
let h, T;
|
|
53
|
+
t[15] !== i || t[16] !== r || t[17] !== e ? (h = () => {
|
|
54
|
+
const n = [];
|
|
55
|
+
for (const {
|
|
56
|
+
descriptor: l,
|
|
57
|
+
fn: S
|
|
58
|
+
} of r) {
|
|
59
|
+
const d = l.type === "data" ? "dataTransforms" : "configTransforms", x = {
|
|
60
|
+
...l,
|
|
61
|
+
fn: S,
|
|
62
|
+
enabled: i
|
|
63
|
+
};
|
|
64
|
+
e.setState((A) => ({
|
|
65
|
+
[d]: j(A[d], x)
|
|
66
|
+
})), n.push({
|
|
67
|
+
key: d,
|
|
68
|
+
id: l.id
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
R.current = n;
|
|
72
|
+
}, T = [e, r, i], t[15] = i, t[16] = r, t[17] = e, t[18] = h, t[19] = T) : (h = t[18], T = t[19]), $(h, T);
|
|
73
|
+
let I, k;
|
|
74
|
+
t[20] !== e ? (I = () => () => {
|
|
75
|
+
for (const {
|
|
76
|
+
key: n,
|
|
77
|
+
id: l
|
|
78
|
+
} of R.current)
|
|
79
|
+
e.setState((S) => ({
|
|
80
|
+
[n]: z(S[n], l)
|
|
81
|
+
}));
|
|
82
|
+
R.current = [];
|
|
83
|
+
}, k = [e], t[20] = e, t[21] = I, t[22] = k) : (I = t[21], k = t[22]), $(I, k);
|
|
84
|
+
let v;
|
|
85
|
+
t[23] !== m ? (v = () => m(F), t[23] = m, t[24] = v) : v = t[24];
|
|
86
|
+
const _ = v;
|
|
87
|
+
let w;
|
|
88
|
+
return t[25] !== i || t[26] !== m || t[27] !== _ ? (w = {
|
|
89
|
+
enabled: i,
|
|
90
|
+
setEnabled: m,
|
|
91
|
+
toggle: _
|
|
92
|
+
}, t[25] = i, t[26] = m, t[27] = _, t[28] = w) : w = t[28], w;
|
|
93
|
+
}
|
|
94
|
+
function F(a) {
|
|
95
|
+
return !a;
|
|
96
|
+
}
|
|
97
|
+
function Q(a, r, f, t) {
|
|
98
|
+
const o = q(3);
|
|
99
|
+
let e;
|
|
100
|
+
return o[0] !== r || o[1] !== f ? (e = [{
|
|
101
|
+
descriptor: r,
|
|
102
|
+
fn: f
|
|
103
|
+
}], o[0] = r, o[1] = f, o[2] = e) : e = o[2], D(a, e, t);
|
|
104
|
+
}
|
|
105
|
+
export {
|
|
106
|
+
Q as a,
|
|
107
|
+
D as b,
|
|
108
|
+
M as u
|
|
109
|
+
};
|
|
110
|
+
//# sourceMappingURL=use-transform-DXPN3nY7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-transform-DXPN3nY7.js","sources":["../src/widgets-v2/stores/use-echart-instance.ts","../src/widgets-v2/stores/use-transform.ts"],"sourcesContent":["import { useSyncExternalStore } from 'react'\nimport type { ECharts } from 'echarts'\nimport {\n getEchartInstance,\n subscribeEchartInstance,\n} from './widget-store-registry'\n\nconst SSR_SNAPSHOT = (): ECharts | null => null\n\n/**\n * Reactive read of the live ECharts instance for a widget. Returns\n * `null` before the `Widget.Echart` bridge has mounted (or after it's\n * disposed); the consumer re-renders when the instance arrives /\n * departs / changes.\n *\n * Wraps {@link subscribeEchartInstance} via `useSyncExternalStore`, so\n * actions can use it inside an effect's deps array to react to chart\n * lifecycle events without polling. Required for actions like\n * `BrushToggle` whose effect needs to dispatch `takeGlobalCursor` the\n * moment the chart exists, then re-dispatch on every `'finished'`\n * event.\n */\nexport function useEchartInstance(id: string): ECharts | null {\n return useSyncExternalStore(\n (cb) => subscribeEchartInstance(id, cb),\n () => getEchartInstance(id),\n SSR_SNAPSHOT,\n )\n}\n","import {\n useCallback,\n useEffect,\n useMemo,\n useRef,\n type Dispatch,\n type SetStateAction,\n} from 'react'\nimport { useStore } from 'zustand'\nimport { getWidgetStore } from './widget-store-registry'\nimport { removeTransform, upsertTransform } from './transforms'\nimport type {\n Transform,\n TransformDescriptor,\n TransformFn,\n TransformPair,\n WidgetState,\n} from './types'\n\nexport interface UseTransformOptions {\n initialEnabled?: boolean\n}\n\nexport interface TransformControls {\n enabled: boolean\n setEnabled: Dispatch<SetStateAction<boolean>>\n toggle: () => void\n}\n\ntype RegistrationKey = 'dataTransforms' | 'configTransforms'\n\ninterface Registration {\n key: RegistrationKey\n id: string\n}\n\nexport function useTransform(\n id: string,\n pairs: readonly TransformPair[],\n options?: UseTransformOptions,\n): TransformControls {\n if (pairs.length === 0) {\n throw new Error('[widgets-v2] useTransform requires at least one pair.')\n }\n\n const store = getWidgetStore(id)\n const primaryId = pairs[0]!.descriptor.id\n const initialEnabled = options?.initialEnabled ?? true\n\n // Read `enabled` reactively from the store. Multiple mounts of the same\n // descriptor (e.g., Toolbox renders ZoomToggle both in the inline preview\n // and inside its overflow Paper) stay in sync because they share the\n // `transformStates[primaryId].enabled` slot.\n const persisted = useStore(\n store,\n (s) => s.transformStates[primaryId]?.enabled,\n )\n const enabled = typeof persisted === 'boolean' ? persisted : initialEnabled\n\n // Seed the store's `transformStates[primaryId].enabled` on first mount so\n // subsequent reads (and a rehydration after `keepAlive` remounts) have a\n // canonical value to read from. Idempotent: skip when already set.\n useEffect(() => {\n if (typeof persisted === 'boolean') return\n store.setState((s: WidgetState) => ({\n transformStates: {\n ...s.transformStates,\n [primaryId]: {\n ...s.transformStates[primaryId],\n enabled: initialEnabled,\n },\n },\n }))\n }, [store, primaryId, persisted, initialEnabled])\n\n const setEnabled = useCallback<Dispatch<SetStateAction<boolean>>>(\n (next) => {\n store.setState((s: WidgetState) => {\n const current = s.transformStates[primaryId]?.enabled ?? initialEnabled\n const value =\n typeof next === 'function'\n ? (next as (v: boolean) => boolean)(current)\n : next\n if (value === current) return {}\n return {\n transformStates: {\n ...s.transformStates,\n [primaryId]: {\n ...s.transformStates[primaryId],\n enabled: value,\n },\n },\n }\n })\n },\n [store, primaryId, initialEnabled],\n )\n\n // Track the latest registrations so the unmount cleanup knows what to remove.\n // Updated inside the register effect (post-render), never during render.\n const registeredRef = useRef<Registration[]>([])\n\n // Register / re-register when `pairs` reference or `enabled` changes.\n // upsertTransform is identity-stable: re-registering with an unchanged\n // descriptor + fn returns the same array reference, and the middleware\n // bypasses the pipeline for unchanged refs. Consumers should memoize\n // `pairs` (useSingleTransform does this internally; multi-pair consumers\n // should wrap the pairs array in useMemo).\n useEffect(() => {\n const next: Registration[] = []\n for (const { descriptor, fn } of pairs) {\n const key: RegistrationKey =\n descriptor.type === 'data' ? 'dataTransforms' : 'configTransforms'\n const transform: Transform = { ...descriptor, fn, enabled }\n store.setState(\n (s: WidgetState) =>\n ({\n [key]: upsertTransform(s[key], transform),\n }) as Partial<WidgetState>,\n )\n next.push({ key, id: descriptor.id })\n }\n registeredRef.current = next\n }, [store, pairs, enabled])\n\n // Unmount cleanup — remove every currently-registered descriptor. Reads from\n // the ref so we always remove the latest registrations, not a stale snapshot.\n useEffect(() => {\n return () => {\n for (const { key, id: descriptorId } of registeredRef.current) {\n store.setState(\n (s: WidgetState) =>\n ({\n [key]: removeTransform(s[key], descriptorId),\n }) as Partial<WidgetState>,\n )\n }\n registeredRef.current = []\n }\n }, [store])\n\n const toggle = useCallback(() => setEnabled((v) => !v), [setEnabled])\n\n return { enabled, setEnabled, toggle }\n}\n\nexport function useSingleTransform(\n id: string,\n descriptor: TransformDescriptor,\n fn: TransformFn,\n options?: UseTransformOptions,\n): TransformControls {\n const pairs = useMemo<readonly TransformPair[]>(\n () => [{ descriptor, fn }],\n [descriptor, fn],\n )\n return useTransform(id, pairs, options)\n}\n"],"names":["SSR_SNAPSHOT","useEchartInstance","id","$","_c","t0","t1","cb","subscribeEchartInstance","getEchartInstance","useSyncExternalStore","useTransform","pairs","options","length","Error","getWidgetStore","store","primaryId","descriptor","initialEnabled","s","transformStates","enabled","persisted","useStore","t2","t3","setState","s_0","useEffect","t4","next","s_1","current","value","setEnabled","t5","Symbol","for","registeredRef","useRef","t6","t7","next_0","fn","key","type","transform","s_2","upsertTransform","push","t8","t9","key_0","descriptorId","s_3","removeTransform","t10","_temp","toggle","t11","v","useSingleTransform"],"mappings":";;;;AAOA,MAAMA,IAAeA,MAAsB;AAepC,SAAAC,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA;AAAA,MAAAC,GAAA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QAAAuD,KAAAA,IAAAvD,EAAA,EAAA;AAAtD,QAAAyD,IAAeF;AAAsD,MAAAG;AAAA,SAAA1D,EAAA,EAAA,MAAAoB,KAAApB,UAAAiC,KAAAjC,EAAA,EAAA,MAAAyD,KAE9DC,IAAA;AAAA,IAAAtC,SAAAA;AAAAA,IAAAa,YAAAA;AAAAA,IAAAwB,QAAAA;AAAAA,EAAAA,GAA+BzD,QAAAoB,GAAApB,QAAAiC,GAAAjC,QAAAyD,GAAAzD,QAAA0D,KAAAA,IAAA1D,EAAA,EAAA,GAA/B0D;AAA+B;AA3GjC,SAAAF,EAAAG,GAAA;AAAA,SAyG8C,CAACA;AAAC;AAKhD,SAAAC,EAAA7D,GAAAiB,GAAA0B,GAAAhC,GAAA;AAAA,QAAAV,IAAAC,EAAA,CAAA;AAAA,MAAAC;AAAA,SAAAF,EAAA,CAAA,MAAAgB,KAAAhB,SAAA0C,KAOGxC,IAAA,CAAC;AAAA,IAAAc,YAAAA;AAAAA,IAAA0B,IAAAA;AAAAA,EAAAA,CAAkB,GAAC1C,OAAAgB,GAAAhB,OAAA0C,GAAA1C,OAAAE,KAAAA,IAAAF,EAAA,CAAA,GAGrBQ,EAAaT,GAHZG,GAGuBQ,CAAO;AAAC;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { createContext as t, useContext as i } from "react";
|
|
2
|
+
const o = t(null);
|
|
3
|
+
function d() {
|
|
4
|
+
const e = i(o);
|
|
5
|
+
if (e == null)
|
|
6
|
+
throw new Error("useWidgetId() must be called inside <Widget.Provider>. If you are calling from outside the Provider tree, use the hooks (useWidget, useWidgetShallow, useTransform) directly with an explicit id.");
|
|
7
|
+
return e;
|
|
8
|
+
}
|
|
9
|
+
export {
|
|
10
|
+
o as W,
|
|
11
|
+
d as u
|
|
12
|
+
};
|
|
13
|
+
//# sourceMappingURL=widget-context-DTGO0Yta.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-context-DTGO0Yta.js","sources":["../src/widgets-v2/stores/widget-context.ts"],"sourcesContent":["import { createContext, useContext } from 'react'\n\nexport const WidgetContext = createContext<string | null>(null)\n\nexport function useWidgetId(): string {\n const id = useContext(WidgetContext)\n if (id == null) {\n throw new Error(\n 'useWidgetId() must be called inside <Widget.Provider>. ' +\n 'If you are calling from outside the Provider tree, use the hooks ' +\n '(useWidget, useWidgetShallow, useTransform) directly with an explicit id.',\n )\n }\n return id\n}\n"],"names":["WidgetContext","createContext","useWidgetId","id","useContext","Error"],"mappings":";AAEO,MAAMA,IAAgBC,EAA6B,IAAI;AAEvD,SAAAC,IAAA;AACL,QAAAC,IAAWC,EAAWJ,CAAa;AACnC,MAAIG,KAAM;AACR,UAAM,IAAIE,MACR,mMAGF;AACD,SACMF;AAAE;"}
|
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
import { c as I } from "react/compiler-runtime";
|
|
2
|
+
import { useStore as A } from "zustand";
|
|
3
|
+
import { createStore as j } from "zustand/vanilla";
|
|
4
|
+
import { devtools as L } from "zustand/middleware";
|
|
5
|
+
import { useShallow as q } from "zustand/react/shallow";
|
|
6
|
+
function K(e, t, r) {
|
|
7
|
+
const n = /* @__PURE__ */ new Set();
|
|
8
|
+
for (const s of t)
|
|
9
|
+
if (s.enabled && s.disables?.length)
|
|
10
|
+
for (const o of s.disables) n.add(o);
|
|
11
|
+
let a = e;
|
|
12
|
+
for (const s of t)
|
|
13
|
+
if (s.enabled && !n.has(s.id))
|
|
14
|
+
try {
|
|
15
|
+
a = s.fn(a);
|
|
16
|
+
} catch (o) {
|
|
17
|
+
const m = o instanceof Error ? o : new Error(String(o));
|
|
18
|
+
console.warn(`[widgets-v2] Transform "${s.id}" failed:`, m), r?.(s.id, m);
|
|
19
|
+
}
|
|
20
|
+
return a;
|
|
21
|
+
}
|
|
22
|
+
function G(e, t) {
|
|
23
|
+
const r = e.find((o) => o.id === t.id);
|
|
24
|
+
if (r?.order === t.order && r?.enabled === t.enabled && r?.fn === t.fn && r?.type === t.type && M(r?.disables, t.disables) && M(r?.replaceMergeKeys, t.replaceMergeKeys))
|
|
25
|
+
return e;
|
|
26
|
+
const n = e.filter((o) => o.id !== t.id), a = n.findIndex((o) => o.order > t.order), s = n.slice();
|
|
27
|
+
return s.splice(a === -1 ? s.length : a, 0, t), s;
|
|
28
|
+
}
|
|
29
|
+
function H(e, t) {
|
|
30
|
+
return e.some((r) => r.id === t) ? e.filter((r) => r.id !== t) : e;
|
|
31
|
+
}
|
|
32
|
+
function M(e, t) {
|
|
33
|
+
if (e === t) return !0;
|
|
34
|
+
if (!e) return !t?.length;
|
|
35
|
+
if (!t) return !e.length;
|
|
36
|
+
if (e.length !== t.length) return !1;
|
|
37
|
+
for (let r = 0; r < e.length; r++) if (e[r] !== t[r]) return !1;
|
|
38
|
+
return !0;
|
|
39
|
+
}
|
|
40
|
+
const g = /* @__PURE__ */ new WeakSet(), P = ((e) => (t, r, n) => {
|
|
41
|
+
const a = n.setState, s = n, o = (E) => ((b, W) => {
|
|
42
|
+
const d = n.getState(), i = typeof b == "function" ? b(d) : b, u = (D) => Object.prototype.hasOwnProperty.call(i, D), v = u("rawData") && !Object.is(i.rawData, d.rawData), T = u("dataTransforms") && i.dataTransforms !== d.dataTransforms;
|
|
43
|
+
if (!v && !T)
|
|
44
|
+
return u("error") && g.delete(s), E(i, W);
|
|
45
|
+
const h = {
|
|
46
|
+
...i
|
|
47
|
+
};
|
|
48
|
+
let S;
|
|
49
|
+
const F = (D, _) => {
|
|
50
|
+
S === void 0 && (S = _);
|
|
51
|
+
}, k = v ? i.rawData : d.rawData, O = T ? i.dataTransforms : d.dataTransforms;
|
|
52
|
+
return h.data = K(k, O, F), S !== void 0 ? (h.error = S, g.add(s)) : g.has(s) && !u("error") ? (h.error = void 0, g.delete(s)) : u("error") && g.delete(s), E(h, W);
|
|
53
|
+
});
|
|
54
|
+
n.setState = o(a);
|
|
55
|
+
const m = o(t);
|
|
56
|
+
return e(m, r, n);
|
|
57
|
+
}), c = /* @__PURE__ */ new Map(), f = /* @__PURE__ */ new Map(), y = /* @__PURE__ */ new Set(), p = /* @__PURE__ */ new Map(), w = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), C = () => {
|
|
58
|
+
try {
|
|
59
|
+
return !1;
|
|
60
|
+
} catch {
|
|
61
|
+
return !1;
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
function $(e) {
|
|
65
|
+
const t = c.get(e);
|
|
66
|
+
if (!t) throw new Error(`[widgets-v2] Widget store "${e}" not found.`);
|
|
67
|
+
return t;
|
|
68
|
+
}
|
|
69
|
+
function J(e) {
|
|
70
|
+
return c.has(e);
|
|
71
|
+
}
|
|
72
|
+
function N(e) {
|
|
73
|
+
c.delete(e);
|
|
74
|
+
}
|
|
75
|
+
function Q(e) {
|
|
76
|
+
const t = c.get(e);
|
|
77
|
+
t && t.setState({
|
|
78
|
+
transformStates: {}
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
function V() {
|
|
82
|
+
c.clear(), f.clear(), y.clear(), p.clear(), w.clear(), l.clear();
|
|
83
|
+
}
|
|
84
|
+
function Y(e, t) {
|
|
85
|
+
t == null ? p.delete(e) : p.set(e, t);
|
|
86
|
+
}
|
|
87
|
+
function Z(e) {
|
|
88
|
+
return p.get(e) ?? null;
|
|
89
|
+
}
|
|
90
|
+
function x() {
|
|
91
|
+
p.clear();
|
|
92
|
+
}
|
|
93
|
+
function ee(e, t) {
|
|
94
|
+
t == null ? w.delete(e) : w.set(e, t), l.get(e)?.forEach((r) => r(t));
|
|
95
|
+
}
|
|
96
|
+
function te(e) {
|
|
97
|
+
return w.get(e) ?? null;
|
|
98
|
+
}
|
|
99
|
+
function re(e, t) {
|
|
100
|
+
let r = l.get(e);
|
|
101
|
+
return r || (r = /* @__PURE__ */ new Set(), l.set(e, r)), r.add(t), () => {
|
|
102
|
+
const n = l.get(e);
|
|
103
|
+
n && (n.delete(t), n.size === 0 && l.delete(e));
|
|
104
|
+
};
|
|
105
|
+
}
|
|
106
|
+
function ne() {
|
|
107
|
+
w.clear(), l.clear();
|
|
108
|
+
}
|
|
109
|
+
function se() {
|
|
110
|
+
return Array.from(c.keys());
|
|
111
|
+
}
|
|
112
|
+
function oe(e, t) {
|
|
113
|
+
c.set(e, t);
|
|
114
|
+
}
|
|
115
|
+
function ae(e, t) {
|
|
116
|
+
const r = P(() => ({
|
|
117
|
+
rawData: t.data,
|
|
118
|
+
data: t.data,
|
|
119
|
+
dataTransforms: [],
|
|
120
|
+
configTransforms: [],
|
|
121
|
+
transformStates: {},
|
|
122
|
+
isLoading: t.isLoading ?? !1,
|
|
123
|
+
isFetching: t.isFetching ?? !1,
|
|
124
|
+
error: t.error,
|
|
125
|
+
rawFormatter: t.formatter,
|
|
126
|
+
formatter: t.formatter,
|
|
127
|
+
labelFormatter: t.labelFormatter
|
|
128
|
+
}));
|
|
129
|
+
return j()(L(r, {
|
|
130
|
+
name: `widget-${e}`,
|
|
131
|
+
enabled: C()
|
|
132
|
+
}));
|
|
133
|
+
}
|
|
134
|
+
function ce(e, t) {
|
|
135
|
+
c.set(e, t);
|
|
136
|
+
const r = (f.get(e) ?? 0) + 1;
|
|
137
|
+
f.set(e, r), r > 1 && C() && !y.has(e) && (console.warn(`[widgets-v2] Duplicate <Widget.Provider id="${e}"> detected. Multiple providers sharing an id will race on prop sync and corrupt the store. Use unique ids per widget instance.`), y.add(e));
|
|
138
|
+
}
|
|
139
|
+
function ie(e, t) {
|
|
140
|
+
const r = (f.get(e) ?? 1) - 1;
|
|
141
|
+
r <= 0 ? (f.delete(e), t.keepAlive || c.delete(e)) : f.set(e, r);
|
|
142
|
+
}
|
|
143
|
+
function le(e, t) {
|
|
144
|
+
const r = I(2);
|
|
145
|
+
let n;
|
|
146
|
+
return r[0] !== e ? (n = $(e), r[0] = e, r[1] = n) : n = r[1], A(n, t);
|
|
147
|
+
}
|
|
148
|
+
function fe(e, t) {
|
|
149
|
+
const r = I(2);
|
|
150
|
+
let n;
|
|
151
|
+
return r[0] !== e ? (n = $(e), r[0] = e, r[1] = n) : n = r[1], A(n, q(t));
|
|
152
|
+
}
|
|
153
|
+
export {
|
|
154
|
+
se as _,
|
|
155
|
+
K as a,
|
|
156
|
+
ne as b,
|
|
157
|
+
x as c,
|
|
158
|
+
V as d,
|
|
159
|
+
ae as e,
|
|
160
|
+
N as f,
|
|
161
|
+
Z as g,
|
|
162
|
+
te as h,
|
|
163
|
+
$ as i,
|
|
164
|
+
J as j,
|
|
165
|
+
H as k,
|
|
166
|
+
Q as l,
|
|
167
|
+
ee as m,
|
|
168
|
+
oe as n,
|
|
169
|
+
re as o,
|
|
170
|
+
P as p,
|
|
171
|
+
ie as q,
|
|
172
|
+
ce as r,
|
|
173
|
+
Y as s,
|
|
174
|
+
G as t,
|
|
175
|
+
fe as u,
|
|
176
|
+
le as v
|
|
177
|
+
};
|
|
178
|
+
//# sourceMappingURL=widget-store-registry-_W4Z4xp-.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"widget-store-registry-_W4Z4xp-.js","sources":["../src/widgets-v2/stores/transforms.ts","../src/widgets-v2/stores/pipeline-middleware.ts","../src/widgets-v2/stores/widget-store-registry.ts"],"sourcesContent":["import type { Transform } from './types'\n\nexport function applyTransforms(\n input: unknown,\n transforms: readonly Transform[],\n onError?: (id: string, error: Error) => void,\n): unknown {\n const disabledIds = new Set<string>()\n for (const t of transforms) {\n if (t.enabled && t.disables?.length) {\n for (const id of t.disables) disabledIds.add(id)\n }\n }\n let acc: unknown = input\n for (const t of transforms) {\n if (!t.enabled) continue\n if (disabledIds.has(t.id)) continue\n try {\n acc = t.fn(acc)\n } catch (e) {\n const err = e instanceof Error ? e : new Error(String(e))\n // eslint-disable-next-line no-console\n console.warn(`[widgets-v2] Transform \"${t.id}\" failed:`, err)\n onError?.(t.id, err)\n }\n }\n return acc\n}\n\nexport function upsertTransform(\n transforms: readonly Transform[],\n next: Transform,\n): readonly Transform[] {\n const existing = transforms.find((t) => t.id === next.id)\n if (\n existing?.order === next.order &&\n existing?.enabled === next.enabled &&\n existing?.fn === next.fn &&\n existing?.type === next.type &&\n sameStringArray(existing?.disables, next.disables) &&\n sameStringArray(existing?.replaceMergeKeys, next.replaceMergeKeys)\n ) {\n return transforms\n }\n const filtered = transforms.filter((t) => t.id !== next.id)\n const idx = filtered.findIndex((t) => t.order > next.order)\n const out = filtered.slice()\n out.splice(idx === -1 ? out.length : idx, 0, next)\n return out\n}\n\nexport function removeTransform(\n transforms: readonly Transform[],\n id: string,\n): readonly Transform[] {\n if (!transforms.some((t) => t.id === id)) return transforms\n return transforms.filter((t) => t.id !== id)\n}\n\nfunction sameStringArray(\n a?: readonly string[],\n b?: readonly string[],\n): boolean {\n if (a === b) return true\n if (!a) return !b?.length\n if (!b) return !a.length\n if (a.length !== b.length) return false\n for (let i = 0; i < a.length; i++) if (a[i] !== b[i]) return false\n return true\n}\n","import type { StateCreator, StoreApi, StoreMutatorIdentifier } from 'zustand'\nimport type { Transform, WidgetState } from './types'\nimport { applyTransforms } from './transforms'\n\ntype PipelineMiddleware = <\n T extends WidgetState,\n Mps extends [StoreMutatorIdentifier, unknown][] = [],\n Mcs extends [StoreMutatorIdentifier, unknown][] = [],\n>(\n config: StateCreator<T, Mps, Mcs>,\n) => StateCreator<T, Mps, Mcs>\n\ntype SetFn<T> = StoreApi<T>['setState']\n\n// Per-store flag: true iff the current `state.error` was authored by the\n// pipeline (a transform threw) rather than by the consumer (Provider's\n// `error` prop or a direct setState). Lets the middleware clear stale\n// pipeline errors on a subsequent clean run without clobbering errors a\n// consumer set out-of-band.\nconst pipelineOwnedError = new WeakSet<StoreApi<WidgetState>>()\n\nexport const pipelineMiddleware: PipelineMiddleware = ((config) =>\n (set, get, api) => {\n const origSetState = api.setState as SetFn<WidgetState>\n const typedApi = api as StoreApi<WidgetState>\n\n const wrap = (delegate: SetFn<WidgetState>): SetFn<WidgetState> =>\n ((partial, replace) => {\n const current = (api.getState as () => WidgetState)()\n const incoming =\n typeof partial === 'function'\n ? (partial as (s: WidgetState) => Partial<WidgetState>)(current)\n : (partial as Partial<WidgetState>)\n\n const has = (key: keyof WidgetState) =>\n Object.prototype.hasOwnProperty.call(incoming, key)\n\n const rawDataChanged =\n has('rawData') && !Object.is(incoming.rawData, current.rawData)\n const dataXfChanged =\n has('dataTransforms') &&\n incoming.dataTransforms !== current.dataTransforms\n\n if (!rawDataChanged && !dataXfChanged) {\n // Consumer-authored writes that don't trigger the pipeline. If the\n // consumer is explicitly touching `error`, the next pipeline run is\n // no longer responsible for it — drop the pipeline-owned marker.\n if (has('error')) pipelineOwnedError.delete(typedApi)\n return delegate(incoming, replace as false)\n }\n\n const augmented: Partial<WidgetState> = { ...incoming }\n let firstError: unknown = undefined\n const onError = (_id: string, err: Error) => {\n if (firstError === undefined) firstError = err\n }\n\n const nextRaw = rawDataChanged ? incoming.rawData : current.rawData\n const nextXf: readonly Transform[] = dataXfChanged\n ? incoming.dataTransforms!\n : current.dataTransforms\n augmented.data = applyTransforms(nextRaw, nextXf, onError)\n\n // Reconcile `error` based on who authored the previous value:\n // - pipeline throw → stamp the new error, mark pipeline-owned.\n // - clean run AND previous error was pipeline-owned → clear it.\n // - clean run AND previous error was consumer-set → leave it.\n // Consumer-authored `error` in `incoming` also wins over the marker\n // (and resets the marker via the early-return branch above).\n if (firstError !== undefined) {\n augmented.error = firstError\n pipelineOwnedError.add(typedApi)\n } else if (pipelineOwnedError.has(typedApi) && !has('error')) {\n augmented.error = undefined\n pipelineOwnedError.delete(typedApi)\n } else if (has('error')) {\n // Consumer set error in the same call that ran the pipeline — honor\n // their write and surrender ownership.\n pipelineOwnedError.delete(typedApi)\n }\n\n return delegate(augmented, replace as false)\n }) as SetFn<WidgetState>\n\n // Wrap both the public setState (used by store.setState() callers) and\n // the inner set passed into the state creator (used by actions inside config).\n api.setState = wrap(origSetState) as typeof api.setState\n const wrappedInnerSet = wrap(set as SetFn<WidgetState>)\n\n return config(wrappedInnerSet as typeof set, get, api)\n }) as PipelineMiddleware\n","import type { ECharts } from 'echarts'\nimport { useStore, type StoreApi } from 'zustand'\nimport { createStore } from 'zustand/vanilla'\nimport { devtools } from 'zustand/middleware'\nimport { useShallow } from 'zustand/react/shallow'\nimport { pipelineMiddleware } from './pipeline-middleware'\nimport type { WidgetInit, WidgetState, WidgetStoreApi } from './types'\n\nconst widgetStores = new Map<string, WidgetStoreApi>()\n\nconst widgetMountCounts = new Map<string, number>()\nconst warnedDuplicates = new Set<string>()\n\n// Per-widget capture-element registry. Held outside the reactive store so\n// publishing the element doesn't trigger any consumer re-renders — these\n// handles are read imperatively by per-widget download configs at click time\n// only. `Widget.State` writes its success-path content wrapper here on mount\n// (auto-cleared on unmount via callback ref), and `create*DownloadConfig`\n// looks it up to feed `html2canvas` for PNG export.\nconst captureEls = new Map<string, HTMLElement>()\n\n// Per-widget live ECharts instance registry. Same imperative-only contract\n// as `captureEls`: published by the `Widget.Echart` bridge on mount /\n// dispose, read at click time by actions that need to dispatch on the live\n// chart (e.g. `ZoomToggle`'s disable handler issuing\n// `setOption({}, { replaceMerge: ['dataZoom'] })` to clear the slider).\n// Held outside the reactive store so publishing never triggers consumer\n// re-renders.\nconst echartInstances = new Map<string, ECharts>()\n\n// Per-id subscribers notified whenever `setEchartInstance` writes a new\n// value. Powers `useEchartInstance(id)` (a `useSyncExternalStore` wrapper)\n// so actions like `BrushToggle` can react when the chart becomes available\n// — required for lifecycle effects that need the instance on mount but\n// arrive in the tree before the `Widget.Echart` bridge has run its init\n// `useEffect`.\ntype EchartInstanceListener = (chart: ECharts | null) => void\nconst echartInstanceSubscribers = new Map<string, Set<EchartInstanceListener>>()\n\nconst isDev = (): boolean => {\n try {\n return Boolean(\n (import.meta as unknown as { env?: { DEV?: boolean } }).env?.DEV,\n )\n } catch {\n return false\n }\n}\n\nexport function getWidgetStore(id: string): WidgetStoreApi {\n const store = widgetStores.get(id)\n if (!store) throw new Error(`[widgets-v2] Widget store \"${id}\" not found.`)\n return store\n}\n\nexport function hasWidgetStore(id: string): boolean {\n return widgetStores.has(id)\n}\n\nexport function deleteWidgetStore(id: string): void {\n widgetStores.delete(id)\n}\n\nexport function resetWidgetStore(id: string): void {\n const store = widgetStores.get(id)\n if (store) store.setState({ transformStates: {} })\n}\n\nexport function clearAllWidgetStores(): void {\n widgetStores.clear()\n widgetMountCounts.clear()\n warnedDuplicates.clear()\n captureEls.clear()\n echartInstances.clear()\n echartInstanceSubscribers.clear()\n}\n\n/**\n * Register or clear the capture element for a widget. Pass `null` to clear.\n * Called by `Widget.State` via a callback ref on its success-path content\n * wrapper. The element is read by per-widget download configs at click time\n * to feed `html2canvas` for PNG export.\n */\nexport function setCaptureEl(id: string, el: HTMLElement | null): void {\n if (el == null) captureEls.delete(id)\n else captureEls.set(id, el)\n}\n\n/**\n * Read the currently registered capture element for a widget. Returns `null`\n * when no `Widget.State` is on its success path (loading / error / empty)\n * or when the widget hasn't mounted.\n */\nexport function getCaptureEl(id: string): HTMLElement | null {\n return captureEls.get(id) ?? null\n}\n\n/** @internal — exposed for tests and debugging only. */\nexport function clearAllCaptureEls(): void {\n captureEls.clear()\n}\n\n/**\n * Register or clear the live ECharts instance for a widget. Pass `null`\n * to clear. Called by the `Widget.Echart` bridge on mount / dispose.\n * Read by actions (e.g. `ZoomToggle`'s disable handler) that need to\n * dispatch on the live chart without going through the pipeline.\n *\n * Notifies subscribers registered via {@link subscribeEchartInstance}\n * after the map mutation, so reactive consumers (the\n * `useEchartInstance` hook) re-render with the new value.\n */\nexport function setEchartInstance(id: string, chart: ECharts | null): void {\n if (chart == null) echartInstances.delete(id)\n else echartInstances.set(id, chart)\n echartInstanceSubscribers.get(id)?.forEach((fn) => fn(chart))\n}\n\n/**\n * Read the currently registered ECharts instance for a widget. Returns\n * `null` when no `Widget.Echart` is mounted, or before the bridge has\n * created the instance.\n */\nexport function getEchartInstance(id: string): ECharts | null {\n return echartInstances.get(id) ?? null\n}\n\n/**\n * Subscribe to changes of the registered ECharts instance for a widget.\n * The listener is called *after* every {@link setEchartInstance} (with\n * the new chart, or `null` when cleared). Returns an unsubscribe\n * function. Used by the `useEchartInstance` hook to drive React effects\n * that need to react to instance arrival / departure (e.g.\n * `BrushToggle`'s `'finished'` re-dispatch loop).\n */\nexport function subscribeEchartInstance(\n id: string,\n listener: EchartInstanceListener,\n): () => void {\n let listeners = echartInstanceSubscribers.get(id)\n if (!listeners) {\n listeners = new Set()\n echartInstanceSubscribers.set(id, listeners)\n }\n listeners.add(listener)\n return () => {\n const set = echartInstanceSubscribers.get(id)\n if (!set) return\n set.delete(listener)\n if (set.size === 0) echartInstanceSubscribers.delete(id)\n }\n}\n\n/** @internal — exposed for tests and debugging only. */\nexport function clearAllEchartInstances(): void {\n echartInstances.clear()\n echartInstanceSubscribers.clear()\n}\n\n/** @internal — exposed for tests and debugging only. */\nexport function __debugListWidgetStores(): string[] {\n return Array.from(widgetStores.keys())\n}\n\n/**\n * Insert or replace a store entry in the registry without refcounting or\n * duplicate-id detection. Used by Provider's lazy `useState` init so the\n * store is reachable from `useWidget(id)` calls in children that render\n * before the Provider's mount effect runs. Refcounting and dev warns happen\n * in {@link registerWidgetStore} during the mount effect.\n *\n * @internal\n */\nexport function setWidgetStoreEntry(id: string, store: WidgetStoreApi): void {\n widgetStores.set(id, store)\n}\n\n/** @internal — used by Provider; not part of the public API. */\nexport function createWidgetStore(\n id: string,\n init: WidgetInit,\n): WidgetStoreApi {\n const builder = pipelineMiddleware<WidgetState>(() => ({\n rawData: init.data,\n data: init.data,\n dataTransforms: [],\n configTransforms: [],\n transformStates: {},\n isLoading: init.isLoading ?? false,\n isFetching: init.isFetching ?? false,\n error: init.error,\n rawFormatter: init.formatter,\n formatter: init.formatter,\n labelFormatter: init.labelFormatter,\n }))\n\n const store = createStore<WidgetState>()(\n devtools(builder, { name: `widget-${id}`, enabled: isDev() }),\n ) as unknown as WidgetStoreApi\n\n return store\n}\n\n/** @internal — registers a Provider mount and tracks/warns on duplicate ids in dev. */\nexport function registerWidgetStore(id: string, store: WidgetStoreApi): void {\n widgetStores.set(id, store)\n const count = (widgetMountCounts.get(id) ?? 0) + 1\n widgetMountCounts.set(id, count)\n if (count > 1 && isDev() && !warnedDuplicates.has(id)) {\n // eslint-disable-next-line no-console\n console.warn(\n `[widgets-v2] Duplicate <Widget.Provider id=\"${id}\"> detected. ` +\n `Multiple providers sharing an id will race on prop sync and corrupt the store. ` +\n `Use unique ids per widget instance.`,\n )\n warnedDuplicates.add(id)\n }\n}\n\n/** @internal — Provider unmount counterpart; on last unmount removes the refcount entry. */\nexport function unregisterWidgetStore(\n id: string,\n options: { keepAlive: boolean },\n): void {\n const count = (widgetMountCounts.get(id) ?? 1) - 1\n if (count <= 0) {\n widgetMountCounts.delete(id)\n if (!options.keepAlive) widgetStores.delete(id)\n } else {\n widgetMountCounts.set(id, count)\n }\n}\n\nexport function useWidget<T, S extends WidgetState = WidgetState>(\n id: string,\n selector: (state: S) => T,\n): T {\n const store = getWidgetStore(id) as unknown as StoreApi<S>\n return useStore(store, selector)\n}\n\nexport function useWidgetShallow<T, S extends WidgetState = WidgetState>(\n id: string,\n selector: (state: S) => T,\n): T {\n const store = getWidgetStore(id) as unknown as StoreApi<S>\n return useStore(store, useShallow(selector))\n}\n"],"names":["applyTransforms","input","transforms","onError","disabledIds","Set","t","enabled","disables","length","id","add","acc","has","fn","e","err","Error","String","console","warn","upsertTransform","next","existing","find","order","type","sameStringArray","replaceMergeKeys","filtered","filter","idx","findIndex","out","slice","splice","removeTransform","some","a","b","i","pipelineOwnedError","WeakSet","pipelineMiddleware","config","set","get","api","origSetState","setState","typedApi","wrap","delegate","partial","replace","current","getState","incoming","key","Object","prototype","hasOwnProperty","call","rawDataChanged","is","rawData","dataXfChanged","dataTransforms","delete","augmented","firstError","_id","undefined","nextRaw","nextXf","data","error","wrappedInnerSet","widgetStores","Map","widgetMountCounts","warnedDuplicates","captureEls","echartInstances","echartInstanceSubscribers","isDev","import","getWidgetStore","store","hasWidgetStore","deleteWidgetStore","resetWidgetStore","transformStates","clearAllWidgetStores","clear","setCaptureEl","el","getCaptureEl","clearAllCaptureEls","setEchartInstance","chart","forEach","getEchartInstance","subscribeEchartInstance","listener","listeners","size","clearAllEchartInstances","__debugListWidgetStores","Array","from","keys","setWidgetStoreEntry","createWidgetStore","init","builder","configTransforms","isLoading","isFetching","rawFormatter","formatter","labelFormatter","createStore","devtools","name","registerWidgetStore","count","unregisterWidgetStore","options","keepAlive","useWidget","selector","$","_c","t0","useStore","useWidgetShallow","useShallow"],"mappings":";;;;;AAEO,SAASA,EACdC,GACAC,GACAC,GACS;AACT,QAAMC,wBAAkBC,IAAAA;AACxB,aAAWC,KAAKJ;AACd,QAAII,EAAEC,WAAWD,EAAEE,UAAUC;AAC3B,iBAAWC,KAAMJ,EAAEE,SAAUJ,CAAAA,EAAYO,IAAID,CAAE;AAGnD,MAAIE,IAAeX;AACnB,aAAWK,KAAKJ;AACd,QAAKI,EAAEC,WACHH,CAAAA,EAAYS,IAAIP,EAAEI,EAAE;AACxB,UAAI;AACFE,QAAAA,IAAMN,EAAEQ,GAAGF,CAAG;AAAA,MAChB,SAASG,GAAG;AACV,cAAMC,IAAMD,aAAaE,QAAQF,IAAI,IAAIE,MAAMC,OAAOH,CAAC,CAAC;AAExDI,gBAAQC,KAAK,2BAA2Bd,EAAEI,EAAE,aAAaM,CAAG,GAC5Db,IAAUG,EAAEI,IAAIM,CAAG;AAAA,MACrB;AAEF,SAAOJ;AACT;AAEO,SAASS,EACdnB,GACAoB,GACsB;AACtB,QAAMC,IAAWrB,EAAWsB,KAAMlB,OAAMA,EAAEI,OAAOY,EAAKZ,EAAE;AACxD,MACEa,GAAUE,UAAUH,EAAKG,SACzBF,GAAUhB,YAAYe,EAAKf,WAC3BgB,GAAUT,OAAOQ,EAAKR,MACtBS,GAAUG,SAASJ,EAAKI,QACxBC,EAAgBJ,GAAUf,UAAUc,EAAKd,QAAQ,KACjDmB,EAAgBJ,GAAUK,kBAAkBN,EAAKM,gBAAgB;AAEjE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AAW,CAACJ,EAAiBpE,IAAIH,CAAE,MAElDS,QAAQC,KACN,+CAA+CV,CAAE,iIAGnD,GACAuE,EAAiBtE,IAAID,CAAE;AAE3B;AAGO,SAASqH,GACdrH,GACAsH,GACM;AACN,QAAMF,KAAS9C,EAAkBlC,IAAIpC,CAAE,KAAK,KAAK;AACjD,EAAIoH,KAAS,KACX9C,EAAkBZ,OAAO1D,CAAE,GACtBsH,EAAQC,aAAWnD,EAAaV,OAAO1D,CAAE,KAE9CsE,EAAkBnC,IAAInC,GAAIoH,CAAK;AAEnC;AAEO,SAAAI,GAAAxH,GAAAyH,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA;AAAA,MAAAC;AAAA,SAAAF,SAAA1H,KAIS4H,IAAA/C,EAAe7E,CAAE,GAAC0H,OAAA1H,GAAA0H,OAAAE,KAAAA,IAAAF,EAAA,CAAA,GACzBG,EADOD,GACSH,CAAQ;AAAC;AAG3B,SAAAK,GAAA9H,GAAAyH,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA;AAAA,MAAAC;AAAA,SAAAF,SAAA1H,KAIS4H,IAAA/C,EAAe7E,CAAE,GAAC0H,OAAA1H,GAAA0H,OAAAE,KAAAA,IAAAF,EAAA,CAAA,GACzBG,EADOD,GACSG,EAAWN,CAAQ,CAAC;AAAC;"}
|
package/dist/widgets/bar.js
CHANGED
|
@@ -7,10 +7,11 @@ import "zustand/shallow";
|
|
|
7
7
|
import { g as w } from "../options-CthfUJDz.js";
|
|
8
8
|
import { m as v } from "../utils-BOhInag6.js";
|
|
9
9
|
import { c as L, f as S } from "../download-config-DNLkypdN.js";
|
|
10
|
-
import {
|
|
10
|
+
import { h as _, f as C, g as M, n as u, a as A, c as I, d as N } from "../option-builders-F-c9ELi1.js";
|
|
11
11
|
import { Box as l, Skeleton as o } from "@mui/material";
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
import { b as T } from "../styles-cohnxh9F.js";
|
|
13
|
+
const R = L(S);
|
|
14
|
+
function U(e) {
|
|
14
15
|
return {
|
|
15
16
|
type: "bar",
|
|
16
17
|
option: v(w(e), j(e)),
|
|
@@ -25,7 +26,7 @@ function j({
|
|
|
25
26
|
labelFormatter: s
|
|
26
27
|
}) {
|
|
27
28
|
const h = (e?.length ?? 0) > 1;
|
|
28
|
-
let c = 0,
|
|
29
|
+
let c = 0, m = 1;
|
|
29
30
|
return {
|
|
30
31
|
legend: N({
|
|
31
32
|
hasLegend: h,
|
|
@@ -51,7 +52,7 @@ function j({
|
|
|
51
52
|
yAxis: {
|
|
52
53
|
type: "value",
|
|
53
54
|
min: (t) => (c = t.min < 0 ? u(t.min) : 0, c),
|
|
54
|
-
max: (t) => (
|
|
55
|
+
max: (t) => (m = t.max <= 0 ? 1 : u(t.max), m),
|
|
55
56
|
axisLabel: {
|
|
56
57
|
fontSize: n.typography.overlineDelicate.fontSize,
|
|
57
58
|
fontFamily: n.typography.overlineDelicate.fontFamily,
|
|
@@ -61,7 +62,7 @@ function j({
|
|
|
61
62
|
showMinLabel: !0,
|
|
62
63
|
verticalAlign: "bottom",
|
|
63
64
|
inside: !0,
|
|
64
|
-
formatter: (t) => t !==
|
|
65
|
+
formatter: (t) => t !== m && t !== c || t === 0 ? "" : i ? i(t) : String(t)
|
|
65
66
|
},
|
|
66
67
|
axisLine: {
|
|
67
68
|
show: !1
|
|
@@ -79,7 +80,7 @@ function j({
|
|
|
79
80
|
tooltip: {
|
|
80
81
|
position: M(n),
|
|
81
82
|
formatter: C((t) => {
|
|
82
|
-
const
|
|
83
|
+
const g = t.value, d = t.dimensionNames?.[t.encode?.y?.at(0) ?? 1], p = g[d ?? ""], x = typeof p == "number" && i ? i(p) : p ?? "", y = typeof t.marker == "string" ? t.marker : "", b = t.seriesName ? `${t.seriesName}: ` : "";
|
|
83
84
|
return {
|
|
84
85
|
name: s ? String(s(t.name ?? "")) : t.name ?? "",
|
|
85
86
|
seriesName: b,
|
|
@@ -88,8 +89,8 @@ function j({
|
|
|
88
89
|
};
|
|
89
90
|
})
|
|
90
91
|
},
|
|
91
|
-
series: e.map((t,
|
|
92
|
-
datasetIndex:
|
|
92
|
+
series: e.map((t, g) => ({
|
|
93
|
+
datasetIndex: g,
|
|
93
94
|
type: "bar",
|
|
94
95
|
barMaxWidth: 100,
|
|
95
96
|
emphasis: {
|
|
@@ -124,7 +125,7 @@ const r = {
|
|
|
124
125
|
}
|
|
125
126
|
}
|
|
126
127
|
};
|
|
127
|
-
function
|
|
128
|
+
function Y() {
|
|
128
129
|
const e = k(2);
|
|
129
130
|
let n;
|
|
130
131
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ f(l, { sx: r.skeleton.graph.grid, children: [
|
|
@@ -174,8 +175,8 @@ function W(e) {
|
|
|
174
175
|
return n(2);
|
|
175
176
|
}
|
|
176
177
|
export {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
178
|
+
Y as BarSkeleton,
|
|
179
|
+
U as barConfig,
|
|
180
|
+
R as barDownloadConfig
|
|
180
181
|
};
|
|
181
182
|
//# sourceMappingURL=bar.js.map
|