@carto/ps-react-ui 4.3.0-widgets.0 → 4.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{cjs-D9ro6BXv.js → cjs-D4KH3azB.js} +2 -2
- package/dist/{cjs-D9ro6BXv.js.map → cjs-D4KH3azB.js.map} +1 -1
- package/dist/components.js +59 -64
- package/dist/components.js.map +1 -1
- package/dist/error-B2IJ9d2h.js +38 -0
- package/dist/error-B2IJ9d2h.js.map +1 -0
- package/dist/exports-Cr43OCul.js +51 -0
- package/dist/exports-Cr43OCul.js.map +1 -0
- package/dist/lasso-tool-BwRzEW7k.js +534 -0
- package/dist/lasso-tool-BwRzEW7k.js.map +1 -0
- package/dist/no-data-C54XJt13.js +61 -0
- package/dist/no-data-C54XJt13.js.map +1 -0
- package/dist/note-t51drNe0.js +124 -0
- package/dist/note-t51drNe0.js.map +1 -0
- package/dist/options-D9wflre6.js +49 -0
- package/dist/options-D9wflre6.js.map +1 -0
- package/dist/row-DrHwXNvF.js +35 -0
- package/dist/row-DrHwXNvF.js.map +1 -0
- package/dist/series-D3Pc-kYX.js +91 -0
- package/dist/series-D3Pc-kYX.js.map +1 -0
- package/dist/{smart-tooltip-BSlcAkBM.js → smart-tooltip-BEtBaIdz.js} +2 -2
- package/dist/{smart-tooltip-BSlcAkBM.js.map → smart-tooltip-BEtBaIdz.js.map} +1 -1
- package/dist/styles-CCZnY17y.js +117 -0
- package/dist/styles-CCZnY17y.js.map +1 -0
- package/dist/tooltip-BDnrRKrp.js +25 -0
- package/dist/tooltip-BDnrRKrp.js.map +1 -0
- package/dist/types/components/measurement-tools/styles.d.ts +13 -4
- package/dist/types/hooks/index.d.ts +2 -0
- package/dist/types/hooks/use-debounce.d.ts +19 -0
- package/dist/types/hooks/use-widget-ref.d.ts +17 -0
- package/dist/types/widgets/_shared/chart-config/config-factory.d.ts +5 -11
- package/dist/types/widgets/_shared/chart-config/index.d.ts +1 -1
- package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +54 -8
- package/dist/types/widgets/actions/change-column/change-column-icon.d.ts +1 -0
- package/dist/types/widgets/actions/change-column/change-column.d.ts +16 -0
- package/dist/types/widgets/actions/change-column/sortable-column-item.d.ts +9 -0
- package/dist/types/widgets/actions/change-column/types.d.ts +19 -0
- package/dist/types/widgets/actions/download/download.d.ts +1 -1
- package/dist/types/widgets/actions/download/exports.d.ts +1 -1
- package/dist/types/widgets/actions/download/types.d.ts +3 -11
- package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +1 -1
- package/dist/types/widgets/actions/fullscreen/styles.d.ts +6 -0
- package/dist/types/widgets/actions/fullscreen/types.d.ts +8 -9
- package/dist/types/widgets/actions/index.d.ts +14 -1
- package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +19 -0
- package/dist/types/widgets/actions/lock-selection/types.d.ts +36 -0
- package/dist/types/widgets/actions/relative-data/relative-data.d.ts +18 -0
- package/dist/types/widgets/actions/relative-data/style.d.ts +8 -0
- package/dist/types/widgets/actions/relative-data/types.d.ts +27 -0
- package/dist/types/widgets/actions/relative-data/utils.d.ts +9 -0
- package/dist/types/widgets/actions/relative-data/utils.test.d.ts +1 -0
- package/dist/types/widgets/actions/searcher/searcher-toggle.d.ts +18 -0
- package/dist/types/widgets/actions/searcher/searcher.d.ts +21 -0
- package/dist/types/widgets/actions/searcher/types.d.ts +64 -0
- package/dist/types/widgets/actions/shared/styles.d.ts +11 -0
- package/dist/types/widgets/actions/stack-toggle/grouped-bar-chart-icon.d.ts +1 -0
- package/dist/types/widgets/actions/stack-toggle/stack-toggle.d.ts +16 -0
- package/dist/types/widgets/actions/stack-toggle/types.d.ts +25 -0
- package/dist/types/widgets/actions/zoom-toggle/index.d.ts +2 -0
- package/dist/types/widgets/actions/zoom-toggle/style.d.ts +13 -0
- package/dist/types/widgets/actions/zoom-toggle/types.d.ts +41 -0
- package/dist/types/widgets/actions/zoom-toggle/zoom-toggle.d.ts +18 -0
- package/dist/types/widgets/bar/config.d.ts +5 -4
- package/dist/types/widgets/bar/index.d.ts +2 -2
- package/dist/types/widgets/bar/types.d.ts +6 -12
- package/dist/types/widgets/category/category-ui.d.ts +2 -0
- package/dist/types/widgets/category/components/category-bar.d.ts +7 -0
- package/dist/types/widgets/category/components/category-legend.d.ts +6 -0
- package/dist/types/widgets/category/components/category-row-multi.d.ts +11 -0
- package/dist/types/widgets/category/components/category-row-other.d.ts +6 -0
- package/dist/types/widgets/category/components/category-row-single.d.ts +11 -0
- package/dist/types/widgets/category/components/index.d.ts +10 -0
- package/dist/types/widgets/category/config.d.ts +16 -0
- package/dist/types/widgets/category/index.d.ts +6 -0
- package/dist/types/widgets/category/skeleton.d.ts +1 -0
- package/dist/types/widgets/category/style.d.ts +120 -0
- package/dist/types/widgets/category/types.d.ts +34 -0
- package/dist/types/widgets/echart/echart-ui.d.ts +1 -1
- package/dist/types/widgets/echart/index.d.ts +2 -2
- package/dist/types/widgets/echart/options.d.ts +2 -3
- package/dist/types/widgets/echart/types.d.ts +13 -10
- package/dist/types/widgets/echart/utils.d.ts +22 -16
- package/dist/types/widgets/error/error.d.ts +2 -0
- package/dist/types/widgets/error/index.d.ts +2 -0
- package/dist/types/widgets/error/types.d.ts +12 -0
- package/dist/types/widgets/formula/components/row.d.ts +1 -1
- package/dist/types/widgets/formula/config.d.ts +4 -2
- package/dist/types/widgets/formula/index.d.ts +2 -1
- package/dist/types/widgets/formula/types.d.ts +6 -18
- package/dist/types/widgets/histogram/config.d.ts +5 -4
- package/dist/types/widgets/histogram/index.d.ts +2 -2
- package/dist/types/widgets/histogram/types.d.ts +6 -12
- package/dist/types/widgets/index.d.ts +9 -4
- package/dist/types/widgets/loader/index.d.ts +3 -0
- package/dist/types/widgets/loader/loader.d.ts +2 -0
- package/dist/types/widgets/loader/types.d.ts +9 -0
- package/dist/types/widgets/loader/utils.d.ts +12 -0
- package/dist/types/widgets/loader/utils.test.d.ts +1 -0
- package/dist/types/widgets/markdown/config.d.ts +4 -2
- package/dist/types/widgets/markdown/index.d.ts +2 -2
- package/dist/types/widgets/markdown/markdown-ui.d.ts +1 -1
- package/dist/types/widgets/markdown/types.d.ts +6 -16
- package/dist/types/widgets/no-data/index.d.ts +2 -0
- package/dist/types/widgets/no-data/no-data.d.ts +35 -0
- package/dist/types/widgets/no-data/style.d.ts +6 -0
- package/dist/types/widgets/no-data/types.d.ts +67 -0
- package/dist/types/widgets/note/index.d.ts +2 -2
- package/dist/types/widgets/note/note.d.ts +2 -2
- package/dist/types/widgets/note/style.d.ts +12 -1
- package/dist/types/widgets/note/types.d.ts +4 -3
- package/dist/types/widgets/pie/config.d.ts +5 -4
- package/dist/types/widgets/pie/index.d.ts +2 -2
- package/dist/types/widgets/pie/types.d.ts +6 -12
- package/dist/types/widgets/range/config.d.ts +6 -2
- package/dist/types/widgets/range/index.d.ts +2 -1
- package/dist/types/widgets/range/types.d.ts +6 -17
- package/dist/types/widgets/scatterplot/config.d.ts +5 -4
- package/dist/types/widgets/scatterplot/index.d.ts +2 -2
- package/dist/types/widgets/scatterplot/types.d.ts +6 -12
- package/dist/types/widgets/selection-summary/index.d.ts +2 -0
- package/dist/types/widgets/selection-summary/selection-summary.d.ts +2 -0
- package/dist/types/widgets/{root → selection-summary}/style.d.ts +3 -2
- package/dist/types/widgets/selection-summary/types.d.ts +13 -0
- package/dist/types/widgets/spread/config.d.ts +10 -2
- package/dist/types/widgets/spread/index.d.ts +2 -1
- package/dist/types/widgets/spread/types.d.ts +6 -18
- package/dist/types/widgets/stores/index.d.ts +2 -0
- package/dist/types/widgets/stores/types.d.ts +108 -12
- package/dist/types/widgets/stores/widget-store.d.ts +2 -27
- package/dist/types/widgets/subheader/index.d.ts +2 -0
- package/dist/types/widgets/subheader/style.d.ts +19 -0
- package/dist/types/widgets/subheader/subheader.d.ts +2 -0
- package/dist/types/widgets/subheader/types.d.ts +10 -0
- package/dist/types/widgets/table/components/cell-header.d.ts +5 -0
- package/dist/types/widgets/table/components/cell.d.ts +16 -0
- package/dist/types/widgets/table/components/index.d.ts +4 -0
- package/dist/types/widgets/table/components/pagination-actions.d.ts +5 -0
- package/dist/types/widgets/table/components/pagination.d.ts +5 -0
- package/dist/types/widgets/table/components/row.d.ts +5 -0
- package/dist/types/widgets/table/config.d.ts +17 -0
- package/dist/types/widgets/table/helpers.d.ts +38 -0
- package/dist/types/widgets/table/helpers.test.d.ts +1 -0
- package/dist/types/widgets/table/hooks/index.d.ts +6 -0
- package/dist/types/widgets/table/hooks/use-pagination.d.ts +33 -0
- package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +1 -0
- package/dist/types/widgets/table/hooks/use-selection.d.ts +30 -0
- package/dist/types/widgets/table/hooks/use-selection.test.d.ts +1 -0
- package/dist/types/widgets/table/hooks/use-sort.d.ts +22 -0
- package/dist/types/widgets/table/hooks/use-sort.test.d.ts +1 -0
- package/dist/types/widgets/table/index.d.ts +13 -0
- package/dist/types/widgets/table/serializer.d.ts +16 -0
- package/dist/types/widgets/table/skeleton.d.ts +10 -0
- package/dist/types/widgets/table/style.d.ts +33 -0
- package/dist/types/widgets/table/table-ui.d.ts +32 -0
- package/dist/types/widgets/table/types.d.ts +196 -0
- package/dist/types/widgets/timeseries/config.d.ts +5 -4
- package/dist/types/widgets/timeseries/index.d.ts +2 -2
- package/dist/types/widgets/timeseries/types.d.ts +6 -12
- package/dist/types/widgets/toolbar-actions/index.d.ts +2 -0
- package/dist/types/widgets/toolbar-actions/styles.d.ts +37 -0
- package/dist/types/widgets/toolbar-actions/toolbar-actions.d.ts +8 -0
- package/dist/types/widgets/toolbar-actions/types.d.ts +45 -0
- package/dist/types/widgets/wrapper/index.d.ts +2 -2
- package/dist/types/widgets/wrapper/styles.d.ts +6 -0
- package/dist/types/widgets/wrapper/types.d.ts +7 -5
- package/dist/types/widgets/wrapper/wrapper-ui.d.ts +1 -1
- package/dist/types/widgets/wrapper/wrapper.d.ts +1 -1
- package/dist/use-widget-ref-B0aNCANx.js +19 -0
- package/dist/use-widget-ref-B0aNCANx.js.map +1 -0
- package/dist/utils-D3-eQyDR.js +144 -0
- package/dist/utils-D3-eQyDR.js.map +1 -0
- package/dist/widget-store-CB6Trp_0.js +131 -0
- package/dist/widget-store-CB6Trp_0.js.map +1 -0
- package/dist/widgets/actions.js +869 -6
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/bar.js +185 -4
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +427 -0
- package/dist/widgets/category.js.map +1 -0
- package/dist/widgets/echart.js +112 -8
- package/dist/widgets/echart.js.map +1 -1
- package/dist/widgets/error.js +5 -0
- package/dist/widgets/error.js.map +1 -0
- package/dist/widgets/formula.js +112 -20
- package/dist/widgets/formula.js.map +1 -1
- package/dist/widgets/histogram.js +183 -4
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/loader.js +61 -0
- package/dist/widgets/loader.js.map +1 -0
- package/dist/widgets/markdown.js +127 -0
- package/dist/widgets/markdown.js.map +1 -0
- package/dist/widgets/no-data.js +5 -0
- package/dist/widgets/no-data.js.map +1 -0
- package/dist/widgets/note.js +2 -2
- package/dist/widgets/pie.js +227 -4
- package/dist/widgets/pie.js.map +1 -1
- package/dist/widgets/range.js +210 -12
- package/dist/widgets/range.js.map +1 -1
- package/dist/widgets/scatterplot.js +230 -4
- package/dist/widgets/scatterplot.js.map +1 -1
- package/dist/widgets/selection-summary.js +40 -0
- package/dist/widgets/selection-summary.js.map +1 -0
- package/dist/widgets/skeleton-loader.js +21 -2
- package/dist/widgets/skeleton-loader.js.map +1 -1
- package/dist/widgets/spread.js +158 -18
- package/dist/widgets/spread.js.map +1 -1
- package/dist/widgets/stores.js +5 -0
- package/dist/widgets/stores.js.map +1 -0
- package/dist/widgets/subheader.js +52 -0
- package/dist/widgets/subheader.js.map +1 -0
- package/dist/widgets/table.js +672 -0
- package/dist/widgets/table.js.map +1 -0
- package/dist/widgets/timeseries.js +184 -4
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/toolbar-actions.js +6725 -0
- package/dist/widgets/toolbar-actions.js.map +1 -0
- package/dist/widgets/wrapper.js +292 -6
- package/dist/widgets/wrapper.js.map +1 -1
- package/dist/widgets.js +10 -83
- package/dist/widgets.js.map +1 -1
- package/package.json +51 -11
- package/dist/const-BLV7Tvte.js +0 -758
- package/dist/const-BLV7Tvte.js.map +0 -1
- package/dist/download-KroQ0SWg.js +0 -195
- package/dist/download-KroQ0SWg.js.map +0 -1
- package/dist/echart-CqfROFu3.js +0 -214
- package/dist/echart-CqfROFu3.js.map +0 -1
- package/dist/formula-ui-ChzvMEOG.js +0 -52
- package/dist/formula-ui-ChzvMEOG.js.map +0 -1
- package/dist/lasso-tool-BC-rsMMW.js +0 -552
- package/dist/lasso-tool-BC-rsMMW.js.map +0 -1
- package/dist/markdown-n_tOtoiT.js +0 -27
- package/dist/markdown-n_tOtoiT.js.map +0 -1
- package/dist/markdown-ui-BBrzzd7Y.js +0 -62
- package/dist/markdown-ui-BBrzzd7Y.js.map +0 -1
- package/dist/note-DF-n70TX.js +0 -101
- package/dist/note-DF-n70TX.js.map +0 -1
- package/dist/range-ui-CtUX11Xm.js +0 -146
- package/dist/range-ui-CtUX11Xm.js.map +0 -1
- package/dist/root-L_WZnJY5.js +0 -46
- package/dist/root-L_WZnJY5.js.map +0 -1
- package/dist/row-DQaSxmDV.js +0 -18
- package/dist/row-DQaSxmDV.js.map +0 -1
- package/dist/series-CsyEPq-X.js +0 -83
- package/dist/series-CsyEPq-X.js.map +0 -1
- package/dist/skeleton-BSPcEvfq.js +0 -27
- package/dist/skeleton-BSPcEvfq.js.map +0 -1
- package/dist/skeleton-C4rOYTy-.js +0 -78
- package/dist/skeleton-C4rOYTy-.js.map +0 -1
- package/dist/skeleton-C9Jqc241.js +0 -82
- package/dist/skeleton-C9Jqc241.js.map +0 -1
- package/dist/skeleton-D-zHBBIw.js +0 -64
- package/dist/skeleton-D-zHBBIw.js.map +0 -1
- package/dist/skeleton-DMP-IwaJ.js +0 -109
- package/dist/skeleton-DMP-IwaJ.js.map +0 -1
- package/dist/skeleton-DRorqowB.js +0 -22
- package/dist/skeleton-DRorqowB.js.map +0 -1
- package/dist/skeleton-DsZhv-AH.js +0 -89
- package/dist/skeleton-DsZhv-AH.js.map +0 -1
- package/dist/skeleton-Dx3FCer0.js +0 -13
- package/dist/skeleton-Dx3FCer0.js.map +0 -1
- package/dist/skeleton-QVDdb1c2.js +0 -21
- package/dist/skeleton-QVDdb1c2.js.map +0 -1
- package/dist/skeleton-loader-DWC1-EAx.js +0 -23
- package/dist/skeleton-loader-DWC1-EAx.js.map +0 -1
- package/dist/spread-ui-BjzH190y.js +0 -82
- package/dist/spread-ui-BjzH190y.js.map +0 -1
- package/dist/style-BGeCtQkP.js +0 -19
- package/dist/style-BGeCtQkP.js.map +0 -1
- package/dist/style-C7v1iwqD.js +0 -34
- package/dist/style-C7v1iwqD.js.map +0 -1
- package/dist/styles-cohnxh9F.js +0 -23
- package/dist/styles-cohnxh9F.js.map +0 -1
- package/dist/types/widgets/config-loader/index.d.ts +0 -2
- package/dist/types/widgets/config-loader/types.d.ts +0 -12
- package/dist/types/widgets/config-loader/use-config.d.ts +0 -5
- package/dist/types/widgets/root/index.d.ts +0 -2
- package/dist/types/widgets/root/root.d.ts +0 -2
- package/dist/types/widgets/root/types.d.ts +0 -15
- package/dist/types/widgets/widget/const.d.ts +0 -2
- package/dist/types/widgets/widget/types.d.ts +0 -47
- package/dist/types/widgets/widget/widget.d.ts +0 -2
- package/dist/use-config-BYEOiIcu.js +0 -43
- package/dist/use-config-BYEOiIcu.js.map +0 -1
- package/dist/widget-store-yDO2ul8g.js +0 -44
- package/dist/widget-store-yDO2ul8g.js.map +0 -1
- package/dist/widgets/config-loader.js +0 -5
- package/dist/widgets/config-loader.js.map +0 -1
- package/dist/widgets/root.js +0 -5
- package/dist/widgets/root.js.map +0 -1
- package/dist/wrapper-57csMybC.js +0 -265
- package/dist/wrapper-57csMybC.js.map +0 -1
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IconButtonProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BaseWidgetState } from '../../stores/types';
|
|
4
|
+
export interface RelativeDataProps {
|
|
5
|
+
/** Widget ID to update data in the widget store */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Execution order in the tool pipeline. Lower values execute first. Defaults to 20. */
|
|
8
|
+
order?: number;
|
|
9
|
+
/** Initial toggle state - when true, shows relative (percentage) values */
|
|
10
|
+
defaultIsRelative?: boolean;
|
|
11
|
+
/** Custom labels for the action */
|
|
12
|
+
labels?: {
|
|
13
|
+
/** Tooltip when showing absolute values (button will switch to relative) */
|
|
14
|
+
relative?: string;
|
|
15
|
+
/** Tooltip when showing relative values (button will switch to absolute) */
|
|
16
|
+
absolute?: string;
|
|
17
|
+
/** Accessibility label */
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
};
|
|
20
|
+
/** Props passed to the IconButton component */
|
|
21
|
+
IconButtonProps?: IconButtonProps;
|
|
22
|
+
/** Custom icon to display */
|
|
23
|
+
Icon?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export type RelativeDataState<T = unknown> = BaseWidgetState<T & {
|
|
26
|
+
isRelative?: boolean;
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EchartWidgetData } from '../../echart/types';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the sum of all numeric values in the data
|
|
4
|
+
*/
|
|
5
|
+
export declare function calculateTotal(data: EchartWidgetData): number;
|
|
6
|
+
/**
|
|
7
|
+
* Transforms data to relative (percentage) values
|
|
8
|
+
*/
|
|
9
|
+
export declare function toRelativeData(data: EchartWidgetData, total: number): EchartWidgetData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SearcherToggleProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Widget action button to toggle search functionality.
|
|
4
|
+
*
|
|
5
|
+
* Stores the enabled state in the widget store using the provided id.
|
|
6
|
+
* When search is active, the button shows an active state with a light background.
|
|
7
|
+
* Use in conjunction with the Searcher component to display the search input.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <SearcherToggle id="my-widget" />
|
|
12
|
+
* <Searcher
|
|
13
|
+
* id="my-widget"
|
|
14
|
+
* data={widgetData}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function SearcherToggle({ id, defaultEnabled, labels, Icon, IconButtonProps, }: SearcherToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SearcherProps } from './types';
|
|
2
|
+
export declare const SEARCHER_TOOL_ID = "searcher";
|
|
3
|
+
/**
|
|
4
|
+
* Search input component that works with SearcherToggle.
|
|
5
|
+
*
|
|
6
|
+
* Registers a transformation tool in the widget pipeline when mounted.
|
|
7
|
+
* Reads the enabled state from the widget store using the provided id.
|
|
8
|
+
* Uses a debounced search to filter data via the transformation pipeline.
|
|
9
|
+
* Auto-focuses when enabled becomes true.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <SearcherToggle id="my-widget" />
|
|
14
|
+
* <Searcher
|
|
15
|
+
* id="my-widget"
|
|
16
|
+
* order={10}
|
|
17
|
+
* labels={{ placeholder: 'Search categories...' }}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function Searcher({ id, filterFn, order, labels, TextFieldProps, ClearIcon, debounceDelay, }: SearcherProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { IconButtonProps, TextFieldProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { EchartWidgetData } from '../../echart/types';
|
|
4
|
+
import { BaseWidgetState } from '../../stores/types';
|
|
5
|
+
/**
|
|
6
|
+
* Filter function type for custom search filtering logic.
|
|
7
|
+
* Receives the original data and search text, returns filtered data.
|
|
8
|
+
* Can be synchronous or asynchronous to support remote filtering.
|
|
9
|
+
*/
|
|
10
|
+
export type SearcherFilterFn = (data: EchartWidgetData, searchText: string) => Promise<EchartWidgetData> | EchartWidgetData;
|
|
11
|
+
/**
|
|
12
|
+
* Searcher-specific state properties.
|
|
13
|
+
*/
|
|
14
|
+
export interface SearcherStateProps {
|
|
15
|
+
/** Whether search is currently enabled */
|
|
16
|
+
isSearchEnabled?: boolean;
|
|
17
|
+
/** Current search text */
|
|
18
|
+
searchText?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Widget state extension for searcher functionality.
|
|
22
|
+
* Extends the base widget state with search-specific properties.
|
|
23
|
+
*/
|
|
24
|
+
export type SearcherState<T = object> = BaseWidgetState<T & SearcherStateProps>;
|
|
25
|
+
export interface SearcherToggleProps {
|
|
26
|
+
/** Widget ID to store search enabled state */
|
|
27
|
+
id: string;
|
|
28
|
+
/** Initial search enabled state. Defaults to false */
|
|
29
|
+
defaultEnabled?: boolean;
|
|
30
|
+
/** Custom labels for the action */
|
|
31
|
+
labels?: {
|
|
32
|
+
/** Tooltip when search is disabled (button will enable search) */
|
|
33
|
+
enable?: string;
|
|
34
|
+
/** Tooltip when search is enabled (button will disable search) */
|
|
35
|
+
disable?: string;
|
|
36
|
+
/** Accessibility label */
|
|
37
|
+
ariaLabel?: string;
|
|
38
|
+
};
|
|
39
|
+
/** Props passed to the IconButton component */
|
|
40
|
+
IconButtonProps?: IconButtonProps;
|
|
41
|
+
/** Custom icon to display */
|
|
42
|
+
Icon?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export interface SearcherProps {
|
|
45
|
+
/** Widget ID to update filtered data in the widget store */
|
|
46
|
+
id: string;
|
|
47
|
+
/** Custom filter function. Defaults to case-insensitive search across all string fields */
|
|
48
|
+
filterFn?: SearcherFilterFn;
|
|
49
|
+
/** Execution order in the tool pipeline. Lower values execute first. Defaults to 10. */
|
|
50
|
+
order?: number;
|
|
51
|
+
/** Custom labels for the searcher input */
|
|
52
|
+
labels?: {
|
|
53
|
+
/** Placeholder text for the input */
|
|
54
|
+
placeholder?: string;
|
|
55
|
+
/** Accessibility label for clear button */
|
|
56
|
+
clearAriaLabel?: string;
|
|
57
|
+
};
|
|
58
|
+
/** Props passed to the TextField component */
|
|
59
|
+
TextFieldProps?: Omit<TextFieldProps, 'value' | 'onChange' | 'size'>;
|
|
60
|
+
/** Custom icon for clear button */
|
|
61
|
+
ClearIcon?: ReactNode;
|
|
62
|
+
/** Debounce delay in milliseconds for search input. Defaults to 300ms */
|
|
63
|
+
debounceDelay?: number;
|
|
64
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const GroupedBarChartIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { StackToggleProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Widget action to toggle stacking behavior in ECharts bar and histogram widgets.
|
|
4
|
+
*
|
|
5
|
+
* Stores the stack state in the widget store and updates the ECharts option
|
|
6
|
+
* using getEChartStackConfig to apply stacking to all series.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <StackToggle
|
|
11
|
+
* id="my-widget"
|
|
12
|
+
* defaultIsStacked={false}
|
|
13
|
+
* />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function StackToggle({ id, defaultIsStacked, labels, Icon, IconButtonProps, }: StackToggleProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IconButtonProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BaseWidgetState } from '../../stores/types';
|
|
4
|
+
export interface StackToggleProps {
|
|
5
|
+
/** Widget ID to update stack configuration in the widget store */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Initial toggle state - when true, starts with stacking enabled */
|
|
8
|
+
defaultIsStacked?: boolean;
|
|
9
|
+
/** Custom labels for the action */
|
|
10
|
+
labels?: {
|
|
11
|
+
/** Tooltip when stacking is disabled (button will enable stacking) */
|
|
12
|
+
stacked?: string;
|
|
13
|
+
/** Tooltip when stacking is enabled (button will disable stacking) */
|
|
14
|
+
unstacked?: string;
|
|
15
|
+
/** Accessibility label */
|
|
16
|
+
ariaLabel?: string;
|
|
17
|
+
};
|
|
18
|
+
/** Props passed to the IconButton component */
|
|
19
|
+
IconButtonProps?: IconButtonProps;
|
|
20
|
+
/** Custom icon to display */
|
|
21
|
+
Icon?: ReactNode;
|
|
22
|
+
}
|
|
23
|
+
export type StackToggleState<T = unknown> = BaseWidgetState<T & {
|
|
24
|
+
isStacked?: boolean;
|
|
25
|
+
}>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
container: {
|
|
4
|
+
display: "flex";
|
|
5
|
+
alignItems: "center";
|
|
6
|
+
gap: ({ spacing }: Theme) => string;
|
|
7
|
+
};
|
|
8
|
+
trigger: {
|
|
9
|
+
'&[data-active="true"]': {
|
|
10
|
+
background: (theme: Theme) => string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { IconButtonProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BaseWidgetState } from '../../stores/types';
|
|
4
|
+
/**
|
|
5
|
+
* State stored in widget store for zoom functionality
|
|
6
|
+
*/
|
|
7
|
+
export interface ZoomConfig {
|
|
8
|
+
zoom?: boolean;
|
|
9
|
+
/** Start percentage for zoom range (0-100) */
|
|
10
|
+
zoomStart?: number;
|
|
11
|
+
/** End percentage for zoom range (0-100) */
|
|
12
|
+
zoomEnd?: number;
|
|
13
|
+
}
|
|
14
|
+
export type ZoomState<T = unknown> = BaseWidgetState<T & ZoomConfig>;
|
|
15
|
+
export interface ZoomToggleProps {
|
|
16
|
+
/** Widget ID to update zoom state in the widget store */
|
|
17
|
+
id: string;
|
|
18
|
+
/** Initial zoom state - when true, zoom is enabled */
|
|
19
|
+
defaultZoom?: boolean;
|
|
20
|
+
/** Initial start percentage for zoom range (0-100) */
|
|
21
|
+
defaultZoomStart?: number;
|
|
22
|
+
/** Initial end percentage for zoom range (0-100) */
|
|
23
|
+
defaultZoomEnd?: number;
|
|
24
|
+
/** Custom labels for the action */
|
|
25
|
+
labels?: {
|
|
26
|
+
/** Tooltip when zoom is disabled (button will enable zoom) */
|
|
27
|
+
enable?: string;
|
|
28
|
+
/** Tooltip when zoom is enabled (button will disable zoom) */
|
|
29
|
+
disable?: string;
|
|
30
|
+
/** Tooltip for reset button */
|
|
31
|
+
reset?: string;
|
|
32
|
+
/** Accessibility label */
|
|
33
|
+
ariaLabel?: string;
|
|
34
|
+
};
|
|
35
|
+
/** Props passed to the IconButton component */
|
|
36
|
+
IconButtonProps?: IconButtonProps;
|
|
37
|
+
/** Custom icon to display for zoom toggle */
|
|
38
|
+
Icon?: ReactNode;
|
|
39
|
+
/** Custom icon to display for reset button */
|
|
40
|
+
ResetIcon?: ReactNode;
|
|
41
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ZoomToggleProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Widget action to toggle EChart zoom functionality.
|
|
4
|
+
*
|
|
5
|
+
* When zoom is active, displays an inline reset button to disable zoom.
|
|
6
|
+
* Only intended for use in fullscreen ToolbarActions for bar and histogram widgets.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <ZoomToggle
|
|
11
|
+
* id="my-widget"
|
|
12
|
+
* defaultZoom={false}
|
|
13
|
+
* zoomStart={0}
|
|
14
|
+
* zoomEnd={100}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function ZoomToggle({ id, defaultZoom, defaultZoomStart, defaultZoomEnd, labels, Icon, ResetIcon, IconButtonProps, }: ZoomToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { BarConfig } from './types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { BarConfig, BarWidgetConfig, BarWidgetData } from './types';
|
|
2
|
+
import { DownloadItem } from '../actions';
|
|
3
|
+
import { ConfigProps } from '../loader/types';
|
|
4
|
+
export declare function barDownloadConfig({ refUI, }: ConfigProps): DownloadItem<BarWidgetData>[];
|
|
5
|
+
export declare function barConfig(props: BarConfig): BarWidgetConfig;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export
|
|
2
|
-
export { barConfig } from './config';
|
|
1
|
+
export { barConfig, barDownloadConfig } from './config';
|
|
3
2
|
export { BarSkeleton } from './skeleton';
|
|
3
|
+
export type { BarWidgetData, BarWidgetState, BarConfig, BarWidgetConfig, } from './types';
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export interface BarProps extends BaseWidgetProps<BarWidgetConfig> {
|
|
5
|
-
type: 'bar';
|
|
6
|
-
data: BarWidgetData | undefined;
|
|
7
|
-
}
|
|
1
|
+
import { EchartWidgetData, EchartWidgetState } from '../echart';
|
|
2
|
+
import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
|
|
3
|
+
import { ConfigProps } from '../loader';
|
|
8
4
|
export type BarWidgetData = EchartWidgetData;
|
|
9
5
|
export type BarWidgetState = EchartWidgetState;
|
|
10
|
-
export type BarWidgetConfig =
|
|
11
|
-
type:
|
|
6
|
+
export type BarWidgetConfig = EchartWidgetProps & {
|
|
7
|
+
type: 'bar';
|
|
12
8
|
};
|
|
13
|
-
export
|
|
14
|
-
data?: BarWidgetData;
|
|
15
|
-
}
|
|
9
|
+
export type BarConfig = ConfigProps & EchartWidgetOptionProps<BarWidgetData>;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CategorySeriesConfig } from '../types';
|
|
2
|
+
export interface CategoryLegendProps {
|
|
3
|
+
series: CategorySeriesConfig[];
|
|
4
|
+
colors: string[];
|
|
5
|
+
}
|
|
6
|
+
export declare function CategoryLegend({ series, colors }: CategoryLegendProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CategoryWidgetConfig } from '../types';
|
|
2
|
+
export interface CategoryRowMultiProps {
|
|
3
|
+
name: string;
|
|
4
|
+
values: number[];
|
|
5
|
+
maxValue: number;
|
|
6
|
+
colors: string[];
|
|
7
|
+
formatter: NonNullable<CategoryWidgetConfig['formatter']>;
|
|
8
|
+
onClick?: CategoryWidgetConfig['onRowClick'];
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function CategoryRowMulti({ name, values, maxValue, colors, formatter, onClick, selected, }: CategoryRowMultiProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface CategoryRowOtherProps {
|
|
2
|
+
hiddenCount: number;
|
|
3
|
+
otherLabel?: string;
|
|
4
|
+
otherCountLabel?: string;
|
|
5
|
+
}
|
|
6
|
+
export declare function CategoryRowOther({ hiddenCount, otherLabel, otherCountLabel, }: CategoryRowOtherProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CategoryWidgetConfig } from '../types';
|
|
2
|
+
export interface CategoryRowSingleProps {
|
|
3
|
+
name: string;
|
|
4
|
+
value: number;
|
|
5
|
+
maxValue: number;
|
|
6
|
+
color: string;
|
|
7
|
+
formatter: NonNullable<CategoryWidgetConfig['formatter']>;
|
|
8
|
+
onClick?: CategoryWidgetConfig['onRowClick'];
|
|
9
|
+
selected?: boolean;
|
|
10
|
+
}
|
|
11
|
+
export declare function CategoryRowSingle({ name, value, maxValue, color, formatter, onClick, selected, }: CategoryRowSingleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { CategoryBar } from './category-bar';
|
|
2
|
+
export type { CategoryBarProps } from './category-bar';
|
|
3
|
+
export { CategoryRowSingle } from './category-row-single';
|
|
4
|
+
export type { CategoryRowSingleProps } from './category-row-single';
|
|
5
|
+
export { CategoryRowMulti } from './category-row-multi';
|
|
6
|
+
export type { CategoryRowMultiProps } from './category-row-multi';
|
|
7
|
+
export { CategoryRowOther } from './category-row-other';
|
|
8
|
+
export type { CategoryRowOtherProps } from './category-row-other';
|
|
9
|
+
export { CategoryLegend } from './category-legend';
|
|
10
|
+
export type { CategoryLegendProps } from './category-legend';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DownloadItem } from '../actions';
|
|
2
|
+
import { ConfigProps } from '../loader/types';
|
|
3
|
+
import { CategoryWidgetConfig, CategoryWidgetData, CategorySeriesConfig, CategoryLabels } from './types';
|
|
4
|
+
export interface CategoryDownloadConfigProps extends ConfigProps {
|
|
5
|
+
series?: CategorySeriesConfig[];
|
|
6
|
+
}
|
|
7
|
+
export interface CategoryConfigProps {
|
|
8
|
+
data?: CategoryWidgetData;
|
|
9
|
+
series?: CategorySeriesConfig[];
|
|
10
|
+
formatter?: (value: number) => string;
|
|
11
|
+
maxItems?: number;
|
|
12
|
+
labels?: CategoryLabels;
|
|
13
|
+
max?: number;
|
|
14
|
+
}
|
|
15
|
+
export declare function categoryDownloadConfig({ refUI, series, }: CategoryDownloadConfigProps): DownloadItem<CategoryWidgetData>[];
|
|
16
|
+
export declare function categoryConfig(): CategoryWidgetConfig;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { CategoryUI } from './category-ui';
|
|
2
|
+
export { CategorySkeleton } from './skeleton';
|
|
3
|
+
export { categoryConfig, categoryDownloadConfig } from './config';
|
|
4
|
+
export { CategoryBar, CategoryRowSingle, CategoryRowMulti, CategoryLegend, CategoryRowOther, } from './components';
|
|
5
|
+
export type { CategoryBarProps, CategoryRowSingleProps, CategoryRowMultiProps, CategoryLegendProps, CategoryRowOtherProps, } from './components';
|
|
6
|
+
export type { CategoryUIProps, CategoryWidgetData, CategoryWidgetState, CategoryWidgetConfig, CategoryDownloadConfig, CategoryDataItem, CategorySeriesConfig, CategoryLabels, } from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function CategorySkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
root: {
|
|
4
|
+
display: "flex";
|
|
5
|
+
flexDirection: "column";
|
|
6
|
+
position: "relative";
|
|
7
|
+
};
|
|
8
|
+
list: {
|
|
9
|
+
display: "flex";
|
|
10
|
+
flexDirection: "column";
|
|
11
|
+
gap: (theme: Theme) => string;
|
|
12
|
+
};
|
|
13
|
+
row: {
|
|
14
|
+
display: "flex";
|
|
15
|
+
flexDirection: "column";
|
|
16
|
+
gap: (theme: Theme) => string;
|
|
17
|
+
pointerEvents: "none";
|
|
18
|
+
};
|
|
19
|
+
rowClickable: {
|
|
20
|
+
pointerEvents: "auto";
|
|
21
|
+
};
|
|
22
|
+
rowHeader: {
|
|
23
|
+
display: "flex";
|
|
24
|
+
justifyContent: "space-between";
|
|
25
|
+
alignItems: "center";
|
|
26
|
+
};
|
|
27
|
+
rowLabel: {
|
|
28
|
+
typography: string;
|
|
29
|
+
fontWeight: string;
|
|
30
|
+
color: "text.primary";
|
|
31
|
+
};
|
|
32
|
+
rowValue: {
|
|
33
|
+
typography: string;
|
|
34
|
+
color: "text.secondary";
|
|
35
|
+
};
|
|
36
|
+
barContainer: {
|
|
37
|
+
display: "flex";
|
|
38
|
+
flexDirection: "column";
|
|
39
|
+
};
|
|
40
|
+
bar: {
|
|
41
|
+
height: number;
|
|
42
|
+
borderRadius: number;
|
|
43
|
+
backgroundColor: (theme: Theme) => string;
|
|
44
|
+
overflow: "hidden";
|
|
45
|
+
position: "relative";
|
|
46
|
+
transition: "background-color 0.15s ease-in-out";
|
|
47
|
+
cursor: "pointer";
|
|
48
|
+
'&:hover': {
|
|
49
|
+
backgroundColor: (theme: Theme) => string;
|
|
50
|
+
'& > div': {
|
|
51
|
+
filter: "brightness(1.2)";
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
barFill: {
|
|
56
|
+
height: string;
|
|
57
|
+
borderRadius: number;
|
|
58
|
+
transition: "width 0.3s ease-in-out, background-color 0.15s ease-in-out";
|
|
59
|
+
};
|
|
60
|
+
barFillMuted: {
|
|
61
|
+
backgroundColor: (theme: Theme) => string;
|
|
62
|
+
};
|
|
63
|
+
legend: {
|
|
64
|
+
display: "flex";
|
|
65
|
+
alignItems: "center";
|
|
66
|
+
gap: (theme: Theme) => string;
|
|
67
|
+
flexWrap: "wrap";
|
|
68
|
+
paddingTop: (theme: Theme) => string;
|
|
69
|
+
position: "sticky";
|
|
70
|
+
bottom: number;
|
|
71
|
+
backgroundColor: "background.paper";
|
|
72
|
+
borderTop: (theme: Theme) => string;
|
|
73
|
+
marginTop: (theme: Theme) => string;
|
|
74
|
+
};
|
|
75
|
+
legendItem: {
|
|
76
|
+
display: "flex";
|
|
77
|
+
alignItems: "center";
|
|
78
|
+
gap: (theme: Theme) => string;
|
|
79
|
+
};
|
|
80
|
+
legendDot: {
|
|
81
|
+
width: number;
|
|
82
|
+
height: number;
|
|
83
|
+
borderRadius: string;
|
|
84
|
+
};
|
|
85
|
+
legendLabel: {
|
|
86
|
+
typography: string;
|
|
87
|
+
color: "text.secondary";
|
|
88
|
+
textTransform: "uppercase";
|
|
89
|
+
fontWeight: string;
|
|
90
|
+
};
|
|
91
|
+
multiBarRow: {
|
|
92
|
+
display: "flex";
|
|
93
|
+
alignItems: "center";
|
|
94
|
+
gap: (theme: Theme) => string;
|
|
95
|
+
};
|
|
96
|
+
multiBarValue: {
|
|
97
|
+
typography: string;
|
|
98
|
+
color: "text.secondary";
|
|
99
|
+
minWidth: number;
|
|
100
|
+
textAlign: "right";
|
|
101
|
+
};
|
|
102
|
+
multiBarContainer: {
|
|
103
|
+
flex: number;
|
|
104
|
+
};
|
|
105
|
+
otherRow: {
|
|
106
|
+
display: "flex";
|
|
107
|
+
justifyContent: "space-between";
|
|
108
|
+
alignItems: "center";
|
|
109
|
+
};
|
|
110
|
+
otherLabel: {
|
|
111
|
+
typography: string;
|
|
112
|
+
fontWeight: string;
|
|
113
|
+
color: "text.secondary";
|
|
114
|
+
fontStyle: "italic";
|
|
115
|
+
};
|
|
116
|
+
otherCount: {
|
|
117
|
+
typography: string;
|
|
118
|
+
color: "text.disabled";
|
|
119
|
+
};
|
|
120
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
|
|
2
|
+
import { WrapperState } from '../wrapper/types';
|
|
3
|
+
import { DownloadItem } from '../actions/download/types';
|
|
4
|
+
export interface CategoryUIProps {
|
|
5
|
+
id: WidgetsStoreProps['id'];
|
|
6
|
+
}
|
|
7
|
+
export interface CategorySeriesConfig {
|
|
8
|
+
name: string;
|
|
9
|
+
color?: string;
|
|
10
|
+
}
|
|
11
|
+
export interface CategoryLabels {
|
|
12
|
+
other?: string;
|
|
13
|
+
otherCount?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface CategoryDataItem extends Record<string, string | number> {
|
|
16
|
+
name: string;
|
|
17
|
+
value: number;
|
|
18
|
+
}
|
|
19
|
+
export type CategoryWidgetData = CategoryDataItem[][];
|
|
20
|
+
export type CategoryWidgetState = BaseWidgetState<WrapperState<CategoryWidgetConfig> & {
|
|
21
|
+
data: CategoryWidgetData;
|
|
22
|
+
}>;
|
|
23
|
+
export interface CategoryWidgetConfig {
|
|
24
|
+
formatter?: (value: number) => string;
|
|
25
|
+
series?: CategorySeriesConfig[];
|
|
26
|
+
maxItems?: number;
|
|
27
|
+
labels?: CategoryLabels;
|
|
28
|
+
onRowClick?: ({ name }: {
|
|
29
|
+
name: string;
|
|
30
|
+
}) => void;
|
|
31
|
+
selected?: (name: string) => boolean;
|
|
32
|
+
max?: number;
|
|
33
|
+
}
|
|
34
|
+
export type CategoryDownloadConfig = DownloadItem<CategoryWidgetData>[];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { EchartUIProps } from './types';
|
|
2
|
-
export declare function EchartUI({ ref, init, option, className, style, onEvents, }: EchartUIProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export declare function EchartUI({ id, ref, init, option, className, style, onEvents, }: EchartUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { Echart } from './echart';
|
|
2
2
|
export { EchartUI } from './echart-ui';
|
|
3
|
-
export type { EchartProps, EchartOptionsProps, EchartUIProps, EchartWidgetData, EchartWidgetState,
|
|
3
|
+
export type { EchartProps, EchartOptionsProps, EchartUIProps, EchartWidgetData, EchartWidgetState, } from './types';
|
|
4
4
|
export { getCommonOptions } from './options';
|
|
5
|
-
export {
|
|
5
|
+
export { mergeEchartWidgetConfig, getEChartBrushConfig, getEChartStackConfig, getEChartZoomConfig, } from './utils';
|
|
@@ -1,3 +1,2 @@
|
|
|
1
|
-
import { EchartOptionsProps } from './types';
|
|
2
|
-
|
|
3
|
-
export declare function getCommonOptions(theme: typeof CartoTheme): EchartOptionsProps;
|
|
1
|
+
import { EchartOptionsProps, EchartWidgetOptionProps } from './types';
|
|
2
|
+
export declare function getCommonOptions({ theme, }: EchartWidgetOptionProps<unknown>): EchartOptionsProps;
|
|
@@ -1,14 +1,11 @@
|
|
|
1
1
|
import { EChartsOption } from 'echarts';
|
|
2
2
|
import { BaseWidgetState } from '../stores/types';
|
|
3
|
-
import { WrapperState } from '../wrapper/types';
|
|
4
|
-
import { DownloadState, FullScreenState } from '../actions';
|
|
5
|
-
import { FullScreenConfigProps } from '../actions/fullscreen/types';
|
|
6
|
-
import { DownloadConfigProps } from '../actions/download/types';
|
|
7
|
-
import { ConfigProps } from '../config-loader';
|
|
8
3
|
import { Ref } from 'react';
|
|
4
|
+
import { theme as CartoTheme } from '@carto/meridian-ds/theme';
|
|
9
5
|
import type * as echarts from 'echarts';
|
|
10
6
|
export type EchartOptionsProps = EChartsOption;
|
|
11
7
|
export interface EchartUIProps {
|
|
8
|
+
id: string;
|
|
12
9
|
option: EchartOptionsProps;
|
|
13
10
|
className?: string;
|
|
14
11
|
init?: echarts.EChartsInitOpts;
|
|
@@ -17,15 +14,21 @@ export interface EchartUIProps {
|
|
|
17
14
|
onEvents?: Record<string, Parameters<echarts.ECharts['on']>[2]>;
|
|
18
15
|
}
|
|
19
16
|
export interface EchartProps {
|
|
20
|
-
id:
|
|
17
|
+
id: EchartUIProps['id'];
|
|
21
18
|
}
|
|
22
19
|
export type EchartWidgetData = Record<string, string | number>[][];
|
|
23
|
-
export type EchartWidgetState = BaseWidgetState<
|
|
20
|
+
export type EchartWidgetState = BaseWidgetState<{
|
|
24
21
|
option: EchartUIProps['option'];
|
|
25
22
|
onEvents?: EchartUIProps['onEvents'];
|
|
26
23
|
init?: EchartUIProps['init'];
|
|
27
|
-
}
|
|
28
|
-
export
|
|
24
|
+
}>;
|
|
25
|
+
export interface EchartWidgetOptionProps<D> {
|
|
26
|
+
data?: D;
|
|
27
|
+
theme: typeof CartoTheme;
|
|
28
|
+
formatter?: (value: number) => string;
|
|
29
|
+
}
|
|
29
30
|
export interface EchartWidgetProps {
|
|
30
|
-
|
|
31
|
+
type: string;
|
|
32
|
+
option: EchartUIProps['option'];
|
|
33
|
+
onEvents?: EchartUIProps['onEvents'];
|
|
31
34
|
}
|