@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,32 @@
|
|
|
1
|
+
import { TableCell, TableProps as MuiTableProps } from '@mui/material';
|
|
2
|
+
import { Ref } from 'react';
|
|
3
|
+
import { TableUIProps } from './types';
|
|
4
|
+
/**
|
|
5
|
+
* Props for the base Table component
|
|
6
|
+
*/
|
|
7
|
+
export interface TableComponentProps extends MuiTableProps {
|
|
8
|
+
/** Table element ref */
|
|
9
|
+
ref?: Ref<HTMLTableElement>;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Base Table component with compound component pattern
|
|
13
|
+
* Provides Table.Head, Table.Body, Table.Row, Table.Cell, Table.CellHeader, Table.Pagination
|
|
14
|
+
*/
|
|
15
|
+
declare function Table({ children, ref, stickyHeader, ...props }: TableComponentProps): import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
declare namespace Table {
|
|
17
|
+
var Head: import("node_modules/@mui/material/OverridableComponent").OverridableComponent<import("node_modules/@mui/material").TableHeadTypeMap<{}, "thead">>;
|
|
18
|
+
var CellHeader: typeof import(".").CellHeader;
|
|
19
|
+
var Body: import("node_modules/@mui/material/OverridableComponent").OverridableComponent<import("node_modules/@mui/material").TableBodyTypeMap<{}, "tbody">>;
|
|
20
|
+
var Row: typeof import(".").Row;
|
|
21
|
+
var Cell: typeof TableCell;
|
|
22
|
+
var Container: typeof TableContainer;
|
|
23
|
+
var Paper: import("node_modules/@mui/material/OverridableComponent").OverridableComponent<import("node_modules/@mui/material").PaperTypeMap<{}, "div">>;
|
|
24
|
+
var Pagination: typeof import(".").Pagination;
|
|
25
|
+
var PaginationActions: typeof import(".").PaginationActions;
|
|
26
|
+
}
|
|
27
|
+
export { Table };
|
|
28
|
+
/**
|
|
29
|
+
* TableContainer widget component
|
|
30
|
+
* Integrates with widget store and provides ref registration using custom hook
|
|
31
|
+
*/
|
|
32
|
+
declare function TableContainer(props: TableUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import { ReactNode, Ref } from 'react';
|
|
2
|
+
import { TableProps as MuiTableProps } from '@mui/material';
|
|
3
|
+
import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
|
|
4
|
+
import { WrapperState } from '../wrapper/types';
|
|
5
|
+
import { DownloadItem } from '../actions/download/types';
|
|
6
|
+
/**
|
|
7
|
+
* Table UI component props
|
|
8
|
+
*/
|
|
9
|
+
export interface TableUIProps {
|
|
10
|
+
id: WidgetsStoreProps['id'];
|
|
11
|
+
children?: ReactNode;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Table column definition
|
|
15
|
+
*/
|
|
16
|
+
export interface TableColumn {
|
|
17
|
+
/** Unique column identifier, matches key in row data */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Column header label */
|
|
20
|
+
label: string | ReactNode;
|
|
21
|
+
/** Text alignment */
|
|
22
|
+
align?: 'left' | 'center' | 'right';
|
|
23
|
+
/** Column width (number for px, string for CSS value) */
|
|
24
|
+
width?: number | string;
|
|
25
|
+
/** Enable sorting for this column */
|
|
26
|
+
sortable?: boolean;
|
|
27
|
+
/** Custom cell value formatter */
|
|
28
|
+
formatter?: (value: unknown) => ReactNode;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Table row data - extends Record for flexible data
|
|
32
|
+
*/
|
|
33
|
+
export interface TableRow extends Record<string, unknown> {
|
|
34
|
+
/** Unique row identifier */
|
|
35
|
+
id: string | number;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* Table widget data type - array of row records
|
|
39
|
+
*/
|
|
40
|
+
export type TableWidgetData = TableRow[];
|
|
41
|
+
/**
|
|
42
|
+
* Pagination state
|
|
43
|
+
*/
|
|
44
|
+
export interface TablePaginationState {
|
|
45
|
+
/** Current page (0-indexed) */
|
|
46
|
+
page: number;
|
|
47
|
+
/** Rows per page */
|
|
48
|
+
rowsPerPage: number;
|
|
49
|
+
/** Total number of rows (for remote pagination) */
|
|
50
|
+
total: number;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Sort direction
|
|
54
|
+
*/
|
|
55
|
+
export type SortDirection = 'asc' | 'desc';
|
|
56
|
+
/**
|
|
57
|
+
* Sort state for single-column sorting
|
|
58
|
+
*/
|
|
59
|
+
export interface SortState {
|
|
60
|
+
/** Column ID being sorted */
|
|
61
|
+
columnId: string | null;
|
|
62
|
+
/** Sort direction */
|
|
63
|
+
direction: SortDirection;
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Pagination and sort mode
|
|
67
|
+
*/
|
|
68
|
+
export type Mode = 'local' | 'remote';
|
|
69
|
+
/**
|
|
70
|
+
* Table widget configuration
|
|
71
|
+
*/
|
|
72
|
+
export interface TableWidgetConfig {
|
|
73
|
+
/** Column definitions */
|
|
74
|
+
columns?: TableColumn[];
|
|
75
|
+
/** Enable row selection with checkboxes */
|
|
76
|
+
selectable?: boolean;
|
|
77
|
+
/** Currently selected row IDs */
|
|
78
|
+
selected: (string | number)[];
|
|
79
|
+
/** Pagination and sort mode: local (client-side) or remote (server-side) */
|
|
80
|
+
mode: Mode;
|
|
81
|
+
/** Pagination configuration */
|
|
82
|
+
pagination?: {
|
|
83
|
+
/** Current page (0-indexed) */
|
|
84
|
+
page?: number;
|
|
85
|
+
/** Available rows per page options */
|
|
86
|
+
rowsPerPageOptions?: number[];
|
|
87
|
+
/** Default rows per page */
|
|
88
|
+
rowsPerPage?: number;
|
|
89
|
+
/** Total rows for remote pagination */
|
|
90
|
+
total?: number;
|
|
91
|
+
};
|
|
92
|
+
/** Sort configuration */
|
|
93
|
+
sort?: {
|
|
94
|
+
/** Default sort column */
|
|
95
|
+
columnId: string | null;
|
|
96
|
+
/** Default sort direction */
|
|
97
|
+
direction?: SortDirection;
|
|
98
|
+
};
|
|
99
|
+
/** Callback when a row is clicked */
|
|
100
|
+
onRowClick?: (row: TableRow) => void;
|
|
101
|
+
/** Callback when hovering over a row (null when leaving table) */
|
|
102
|
+
onRowHover?: (row: TableRow | null) => void;
|
|
103
|
+
/** Callback when selection changes */
|
|
104
|
+
onSelectionChange?: (selected: (string | number)[]) => void;
|
|
105
|
+
/** Callback when page changes (for remote pagination) */
|
|
106
|
+
onPageChange?: (page: number, rowsPerPage: number) => void;
|
|
107
|
+
/** Callback when sort changes (for remote sorting) */
|
|
108
|
+
onSortChange?: (columnId: string, direction: SortDirection) => void;
|
|
109
|
+
}
|
|
110
|
+
/**
|
|
111
|
+
* Table widget state - includes both configuration and runtime state
|
|
112
|
+
*/
|
|
113
|
+
export type TableWidgetState = BaseWidgetState<WrapperState<TableWidgetConfig & {}> & {
|
|
114
|
+
data: TableWidgetData;
|
|
115
|
+
}>;
|
|
116
|
+
/**
|
|
117
|
+
* Table download configuration
|
|
118
|
+
*/
|
|
119
|
+
export type TableDownloadConfig = DownloadItem<TableWidgetData>[];
|
|
120
|
+
/**
|
|
121
|
+
* Props for the base Table component
|
|
122
|
+
*/
|
|
123
|
+
export interface TableProps extends MuiTableProps {
|
|
124
|
+
/** Table element ref */
|
|
125
|
+
ref?: Ref<HTMLTableElement>;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Props for CellHeader component
|
|
129
|
+
*/
|
|
130
|
+
export interface CellHeaderProps {
|
|
131
|
+
/** Column definition */
|
|
132
|
+
column: TableColumn;
|
|
133
|
+
/** Current sort state */
|
|
134
|
+
sortState?: SortState;
|
|
135
|
+
/** Callback when sort is triggered */
|
|
136
|
+
onSort?: (columnId: string) => void;
|
|
137
|
+
/** Whether this is a select-all checkbox header */
|
|
138
|
+
isSelectAll?: boolean;
|
|
139
|
+
/** Whether all rows are selected */
|
|
140
|
+
isAllSelected?: boolean;
|
|
141
|
+
/** Whether some rows are selected (indeterminate state) */
|
|
142
|
+
isIndeterminate?: boolean;
|
|
143
|
+
/** Callback for select-all toggle */
|
|
144
|
+
onSelectAll?: () => void;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Props for Row component
|
|
148
|
+
*/
|
|
149
|
+
export interface RowProps {
|
|
150
|
+
/** Row data */
|
|
151
|
+
row: TableRow;
|
|
152
|
+
/** Column definitions */
|
|
153
|
+
columns: TableColumn[];
|
|
154
|
+
/** Whether row is selected */
|
|
155
|
+
isSelected?: boolean;
|
|
156
|
+
/** Whether selection is enabled */
|
|
157
|
+
selectable?: boolean;
|
|
158
|
+
/** Callback when row is clicked */
|
|
159
|
+
onClick?: (row: TableRow) => void;
|
|
160
|
+
/** Callback when row selection is toggled */
|
|
161
|
+
onSelect?: (row: TableRow) => void;
|
|
162
|
+
/** Callback when mouse enters row */
|
|
163
|
+
onMouseEnter?: (row: TableRow) => void;
|
|
164
|
+
/** Callback when mouse leaves row */
|
|
165
|
+
onMouseLeave?: () => void;
|
|
166
|
+
}
|
|
167
|
+
/**
|
|
168
|
+
* Props for Pagination component
|
|
169
|
+
*/
|
|
170
|
+
export interface PaginationProps {
|
|
171
|
+
/** Current page (0-indexed) */
|
|
172
|
+
page: number;
|
|
173
|
+
/** Rows per page */
|
|
174
|
+
rowsPerPage: number;
|
|
175
|
+
/** Total row count */
|
|
176
|
+
total: number;
|
|
177
|
+
/** Available rows per page options */
|
|
178
|
+
rowsPerPageOptions?: number[];
|
|
179
|
+
/** Callback when page changes */
|
|
180
|
+
onPageChange: (page: number) => void;
|
|
181
|
+
/** Callback when rows per page changes */
|
|
182
|
+
onRowsPerPageChange: (rowsPerPage: number) => void;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Props for PaginationActions component
|
|
186
|
+
*/
|
|
187
|
+
export interface PaginationActionsProps {
|
|
188
|
+
/** Current page (0-indexed) */
|
|
189
|
+
page: number;
|
|
190
|
+
/** Total row count */
|
|
191
|
+
count: number;
|
|
192
|
+
/** Rows per page */
|
|
193
|
+
rowsPerPage: number;
|
|
194
|
+
/** Callback when page changes */
|
|
195
|
+
onPageChange: (event: React.MouseEvent<HTMLButtonElement> | null, newPage: number) => void;
|
|
196
|
+
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { TimeseriesConfig } from './types';
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { TimeseriesConfig, TimeseriesWidgetConfig, TimeseriesWidgetData } from './types';
|
|
2
|
+
import { DownloadItem } from '../actions';
|
|
3
|
+
import { ConfigProps } from '../loader/types';
|
|
4
|
+
export declare function timeseriesDownloadConfig({ refUI, }: ConfigProps): DownloadItem<TimeseriesWidgetData>[];
|
|
5
|
+
export declare function timeseriesConfig(props: TimeseriesConfig): TimeseriesWidgetConfig;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type {
|
|
2
|
-
export { timeseriesConfig } from './config';
|
|
1
|
+
export type { TimeseriesWidgetData, TimeseriesWidgetState, TimeseriesWidgetConfig, TimeseriesConfig, } from './types';
|
|
2
|
+
export { timeseriesConfig, timeseriesDownloadConfig } from './config';
|
|
3
3
|
export { TimeseriesSkeleton } from './skeleton';
|
|
@@ -1,15 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
export interface TimeseriesProps extends Omit<BaseWidgetProps<TimeseriesWidgetConfig>, 'data'> {
|
|
5
|
-
type: 'timeseries';
|
|
6
|
-
data: TimeseriesWidgetData | undefined;
|
|
7
|
-
}
|
|
1
|
+
import { EchartWidgetData, EchartWidgetState } from '../echart';
|
|
2
|
+
import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
|
|
3
|
+
import { ConfigProps } from '../loader';
|
|
8
4
|
export type TimeseriesWidgetData = EchartWidgetData;
|
|
9
5
|
export type TimeseriesWidgetState = EchartWidgetState;
|
|
10
|
-
export type TimeseriesWidgetConfig =
|
|
11
|
-
type:
|
|
6
|
+
export type TimeseriesWidgetConfig = EchartWidgetProps & {
|
|
7
|
+
type: 'timeseries';
|
|
12
8
|
};
|
|
13
|
-
export
|
|
14
|
-
data?: TimeseriesWidgetData;
|
|
15
|
-
}
|
|
9
|
+
export type TimeseriesConfig = ConfigProps & EchartWidgetOptionProps<TimeseriesWidgetData>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
root: {
|
|
4
|
+
display: "flex";
|
|
5
|
+
alignItems: "center";
|
|
6
|
+
width: string;
|
|
7
|
+
overflow: "hidden";
|
|
8
|
+
borderRadius: ({ spacing }: Theme) => string;
|
|
9
|
+
gap: ({ spacing }: Theme) => string;
|
|
10
|
+
};
|
|
11
|
+
preview: {
|
|
12
|
+
display: "flex";
|
|
13
|
+
alignItems: "center";
|
|
14
|
+
gap: ({ spacing }: Theme) => string;
|
|
15
|
+
};
|
|
16
|
+
actionsContainer: {
|
|
17
|
+
position: "absolute";
|
|
18
|
+
display: "flex";
|
|
19
|
+
alignItems: "center";
|
|
20
|
+
backgroundColor: ({ palette }: Theme) => string;
|
|
21
|
+
padding: ({ spacing }: Theme) => string;
|
|
22
|
+
gap: ({ spacing }: Theme) => string;
|
|
23
|
+
};
|
|
24
|
+
iconButton: {
|
|
25
|
+
width: ({ spacing }: Theme) => string;
|
|
26
|
+
height: ({ spacing }: Theme) => string;
|
|
27
|
+
borderRadius: number;
|
|
28
|
+
'.MuiTouchRipple-ripple .MuiTouchRipple-child': {
|
|
29
|
+
borderRadius: number;
|
|
30
|
+
};
|
|
31
|
+
};
|
|
32
|
+
triggerButton: {
|
|
33
|
+
'&[data-active="true"]': {
|
|
34
|
+
backgroundColor: ({ palette }: Theme) => string;
|
|
35
|
+
};
|
|
36
|
+
};
|
|
37
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { JSX } from 'react';
|
|
2
|
+
import { ToolbarActionsProps } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* A floating toolbar component that displays action buttons.
|
|
5
|
+
* Shows a trigger button when there are 3+ actions, which expands
|
|
6
|
+
* to reveal all actions with a close button.
|
|
7
|
+
*/
|
|
8
|
+
export declare function ToolbarActions({ children: _children, full, direction, labels, sx, IconButtonProps, TooltipProps, }: ToolbarActionsProps): JSX.Element | null;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { IconButtonProps, SxProps, Theme, TooltipProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
/**
|
|
4
|
+
* Represents a single action in the toolbar
|
|
5
|
+
*/
|
|
6
|
+
export interface ToolbarAction {
|
|
7
|
+
/** Unique identifier for the action */
|
|
8
|
+
id: string;
|
|
9
|
+
/** Icon to display for the action */
|
|
10
|
+
icon: ReactNode;
|
|
11
|
+
/** Label displayed in tooltip */
|
|
12
|
+
label: string;
|
|
13
|
+
/** Callback when action is clicked */
|
|
14
|
+
onClick: () => void;
|
|
15
|
+
/** Whether the action is disabled */
|
|
16
|
+
disabled?: boolean;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Labels for toolbar UI elements
|
|
20
|
+
*/
|
|
21
|
+
export interface ToolbarActionsLabels {
|
|
22
|
+
/** Tooltip for the trigger button */
|
|
23
|
+
trigger?: string;
|
|
24
|
+
/** Tooltip for the close button */
|
|
25
|
+
close?: string;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Props for the ToolbarActions component
|
|
29
|
+
*/
|
|
30
|
+
export interface ToolbarActionsProps {
|
|
31
|
+
/** Array of React elements (typically IconButtons) to display in the toolbar */
|
|
32
|
+
children: ReactNode[] | ReactNode;
|
|
33
|
+
/** Direction in which the toolbar expands */
|
|
34
|
+
direction?: 'left' | 'right';
|
|
35
|
+
/** Whether the toolbar is in full mode */
|
|
36
|
+
full?: boolean;
|
|
37
|
+
/** Custom labels for UI elements */
|
|
38
|
+
labels?: ToolbarActionsLabels;
|
|
39
|
+
/** Custom styles for the root container */
|
|
40
|
+
sx?: SxProps<Theme>;
|
|
41
|
+
/** Props passed to action IconButtons */
|
|
42
|
+
IconButtonProps?: Omit<IconButtonProps, 'onClick' | 'disabled'>;
|
|
43
|
+
/** Props passed to Tooltips */
|
|
44
|
+
TooltipProps?: Omit<TooltipProps, 'title' | 'children'>;
|
|
45
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { Actions } from './components/actions';
|
|
2
2
|
export { Options } from './components/options';
|
|
3
3
|
export { Title } from './components/title';
|
|
4
|
-
export {
|
|
4
|
+
export { WidgetWrapper } from './wrapper';
|
|
5
5
|
export { WrapperUI } from './wrapper-ui';
|
|
6
|
-
export type { WrapperProps, WrapperUIProps,
|
|
6
|
+
export type { WrapperActionsProps, WrapperOption, WrapperOptionsProps, WrapperProps, WrapperState, WrapperUIProps, } from './types';
|
|
@@ -1,17 +1,19 @@
|
|
|
1
1
|
import { ReactNode, SyntheticEvent } from 'react';
|
|
2
2
|
import { SxProps, Theme } from '@mui/material';
|
|
3
3
|
import { BaseWidgetState } from '../stores/types';
|
|
4
|
-
export interface WrapperProps extends Pick<WrapperUIProps, 'sx' | 'actions' | 'options' | 'labels' | 'children' | 'onChangeCollapsed'> {
|
|
4
|
+
export interface WrapperProps extends Pick<WrapperUIProps, 'sx' | 'actions' | 'options' | 'labels' | 'children' | 'onChangeCollapsed'>, Pick<WrapperState, 'disabled' | 'title'> {
|
|
5
5
|
id: WrapperState['id'];
|
|
6
|
-
|
|
6
|
+
defaultCollapsed?: boolean;
|
|
7
7
|
}
|
|
8
|
-
export type WrapperState<T = unknown> = BaseWidgetState<T &
|
|
9
|
-
export interface WrapperUIProps extends WrapperActionsProps, Omit<WrapperOptionsProps, 'labels' | ''> {
|
|
10
|
-
children: ReactNode;
|
|
8
|
+
export type WrapperState<T = unknown> = BaseWidgetState<T & {
|
|
11
9
|
title: string;
|
|
12
10
|
disabled?: boolean;
|
|
13
11
|
collapsed?: boolean;
|
|
14
12
|
isLoading?: boolean;
|
|
13
|
+
}>;
|
|
14
|
+
export interface WrapperUIProps extends WrapperActionsProps, Omit<WrapperOptionsProps, 'labels' | ''> {
|
|
15
|
+
id: WrapperState['id'];
|
|
16
|
+
children: ReactNode;
|
|
15
17
|
sx?: SxProps<Theme>;
|
|
16
18
|
labels?: {
|
|
17
19
|
options?: WrapperOptionsProps['labels'];
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WrapperUIProps } from './types';
|
|
2
|
-
export declare function WrapperUI({ children,
|
|
2
|
+
export declare function WrapperUI({ children, id, actions, sx, labels, options, onChangeCollapsed, }: WrapperUIProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { WrapperProps } from './types';
|
|
2
|
-
export declare function
|
|
2
|
+
export declare function WidgetWrapper({ id, title, defaultCollapsed, disabled, sx, actions, options, labels, children, onChangeCollapsed, }: WrapperProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { c as u } from "react/compiler-runtime";
|
|
2
|
+
import { useRef as n, useEffect as c } from "react";
|
|
3
|
+
import { u as i } from "./widget-store-CB6Trp_0.js";
|
|
4
|
+
function a(t) {
|
|
5
|
+
const e = u(4), s = n(null), r = i(m);
|
|
6
|
+
let f, o;
|
|
7
|
+
return e[0] !== r || e[1] !== t ? (f = () => {
|
|
8
|
+
s.current && r(t, {
|
|
9
|
+
refUI: s
|
|
10
|
+
});
|
|
11
|
+
}, o = [t, r], e[0] = r, e[1] = t, e[2] = f, e[3] = o) : (f = e[2], o = e[3]), c(f, o), s;
|
|
12
|
+
}
|
|
13
|
+
function m(t) {
|
|
14
|
+
return t.setWidget;
|
|
15
|
+
}
|
|
16
|
+
export {
|
|
17
|
+
a as u
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=use-widget-ref-B0aNCANx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"use-widget-ref-B0aNCANx.js","sources":["../src/hooks/use-widget-ref.ts"],"sourcesContent":["import { useEffect, useRef } from 'react'\nimport { useWidgetStore } from '../widgets/stores/widget-store'\n\n/**\n * Custom hook for registering a DOM element ref with the widget store.\n * This allows other parts of the application to access the widget's DOM element.\n *\n * @param widgetId - The widget ID to register the ref under\n * @returns A ref object to attach to the DOM element\n *\n * @example\n * ```tsx\n * function MyWidget({ id }: { id: string }) {\n * const ref = useWidgetRef<HTMLDivElement>(id)\n *\n * return <div ref={ref}>Widget content</div>\n * }\n * ```\n */\nexport function useWidgetRef<T extends HTMLElement = HTMLElement>(\n widgetId: string,\n) {\n const ref = useRef<T | null>(null)\n const setWidget = useWidgetStore((store) => store.setWidget)\n\n useEffect(() => {\n if (ref.current) {\n setWidget(widgetId, { refUI: ref })\n }\n }, [widgetId, setWidget])\n\n return ref\n}\n"],"names":["useWidgetRef","widgetId","$","_c","ref","useRef","setWidget","useWidgetStore","_temp","t0","t1","current","refUI","useEffect","store"],"mappings":";;;AAmBO,SAAAA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA,GAGLC,IAAYC,EAAiB,IAAI,GACjCC,IAAkBC,EAAeC,CAA0B;AAAC,MAAAC,GAAAC;AAAA,SAAAR,EAAA,CAAA,MAAAI,KAAAJ,SAAAD,KAElDQ,IAAAA,MAAA;AACR,IAAIL,EAAGO,WACLL,EAAUL,GAAU;AAAA,MAAAW,OAASR;AAAAA,IAAAA,CAAK;AAAA,EACnC,GACAM,IAAA,CAACT,GAAUK,CAAS,GAACJ,OAAAI,GAAAJ,OAAAD,GAAAC,OAAAO,GAAAP,OAAAQ,MAAAD,IAAAP,EAAA,CAAA,GAAAQ,IAAAR,EAAA,CAAA,IAJxBW,EAAUJ,GAIPC,CAAqB,GAEjBN;AAAG;AAZL,SAAAI,EAAAM,GAAA;AAAA,SAIuCA,EAAKR;AAAU;"}
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import { d as n } from "./cjs-D4KH3azB.js";
|
|
2
|
+
const s = "stacked";
|
|
3
|
+
function S(...e) {
|
|
4
|
+
return n(e[0] ?? {}, e[1] ?? {}, {
|
|
5
|
+
customMerge: (i) => {
|
|
6
|
+
if (i === "color")
|
|
7
|
+
return (I, a) => a;
|
|
8
|
+
if (i === "series")
|
|
9
|
+
return (I, a) => I.length ? a?.map((t, r) => {
|
|
10
|
+
const l = I?.[r] ?? {};
|
|
11
|
+
return n(l, t);
|
|
12
|
+
}) : I;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
function h(e, {
|
|
17
|
+
start: i,
|
|
18
|
+
end: I
|
|
19
|
+
} = {
|
|
20
|
+
start: 0,
|
|
21
|
+
end: 100
|
|
22
|
+
}, {
|
|
23
|
+
inside: a = !0,
|
|
24
|
+
xSlider: g = !0,
|
|
25
|
+
ySlider: t = !1,
|
|
26
|
+
showSliders: r = !0,
|
|
27
|
+
xAxisLabelFormatter: l
|
|
28
|
+
} = {}, o) {
|
|
29
|
+
const d = o ? y(o) : {};
|
|
30
|
+
return {
|
|
31
|
+
dataZoom: [a && {
|
|
32
|
+
throttle: 0,
|
|
33
|
+
type: "inside",
|
|
34
|
+
xAxisIndex: g ? [0] : [],
|
|
35
|
+
yAxisIndex: t ? [0] : [],
|
|
36
|
+
show: e,
|
|
37
|
+
zoomLock: !e,
|
|
38
|
+
start: i,
|
|
39
|
+
end: I
|
|
40
|
+
}, a && t && {
|
|
41
|
+
throttle: 0,
|
|
42
|
+
type: "inside",
|
|
43
|
+
show: e,
|
|
44
|
+
zoomLock: !e,
|
|
45
|
+
start: i,
|
|
46
|
+
end: I,
|
|
47
|
+
orientation: "vertical"
|
|
48
|
+
}, g && {
|
|
49
|
+
throttle: 0,
|
|
50
|
+
type: "slider",
|
|
51
|
+
xAxisIndex: [0],
|
|
52
|
+
bottom: 0,
|
|
53
|
+
height: parseInt(o?.spacing?.(4) ?? "32"),
|
|
54
|
+
show: e && r,
|
|
55
|
+
zoomLock: !e,
|
|
56
|
+
start: i,
|
|
57
|
+
end: I,
|
|
58
|
+
labelFormatter: l,
|
|
59
|
+
showDetail: !1,
|
|
60
|
+
...d,
|
|
61
|
+
brushSelect: !1,
|
|
62
|
+
moveHandleSize: 8,
|
|
63
|
+
handleSize: "100%",
|
|
64
|
+
handleIcon: "image://data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOSIgaGVpZ2h0PSIzNiIgdmlld0JveD0iMCAwIDkgMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHg9IjAuNSIgeT0iLTAuNSIgd2lkdGg9IjgiIGhlaWdodD0iMTgiIHJ4PSI0IiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDI3KSIgZmlsbD0id2hpdGUiIHN0cm9rZT0iIzM1OEJFNyIvPgo8cmVjdCB3aWR0aD0iMyIgaGVpZ2h0PSIyIiByeD0iMSIgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMyAyMykiIGZpbGw9IiMzNThCRTciLz4KPHJlY3Qgd2lkdGg9IjMiIGhlaWdodD0iMiIgcng9IjEiIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIC0xIDMgMTkpIiBmaWxsPSIjMzU4QkU3Ii8+CjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjIiIHJ4PSIxIiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAzIDE1KSIgZmlsbD0iIzM1OEJFNyIvPgo8L3N2Zz4="
|
|
65
|
+
}, t && {
|
|
66
|
+
throttle: 0,
|
|
67
|
+
type: "slider",
|
|
68
|
+
left: parseInt(o?.spacing?.(6) ?? "48"),
|
|
69
|
+
width: parseInt(o?.spacing?.(4) ?? "32"),
|
|
70
|
+
yAxisIndex: [0],
|
|
71
|
+
show: e && r,
|
|
72
|
+
zoomLock: !e,
|
|
73
|
+
start: i,
|
|
74
|
+
end: I,
|
|
75
|
+
...d,
|
|
76
|
+
brushSelect: !1,
|
|
77
|
+
moveHandleSize: 8,
|
|
78
|
+
handleSize: "100%",
|
|
79
|
+
handleIcon: "image://data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDM2IDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHg9IjAuNSIgeT0iMC41IiB3aWR0aD0iOCIgaGVpZ2h0PSIxOCIgcng9IjQiIHRyYW5zZm9ybT0icm90YXRlKC05MCAwLjUgMC41KSIgZmlsbD0id2hpdGUiIHN0cm9rZT0iIzM1OEJFNyIvPgo8cmVjdCB3aWR0aD0iMyIgaGVpZ2h0PSIyIiByeD0iMSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDEzIDYpIiBmaWxsPSIjMzU4QkU3Ii8+CjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjIiIHJ4PSIxIiB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgMTcgNikiIGZpbGw9IiMzNThCRTciLz4KPHJlY3Qgd2lkdGg9IjMiIGhlaWdodD0iMiIgcng9IjEiIHRyYW5zZm9ybT0icm90YXRlKC05MCAyMSA2KSIgZmlsbD0iIzM1OEJFNyIvPgo8L3N2Zz4="
|
|
80
|
+
}].filter((c) => !!c)
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
function y(e) {
|
|
84
|
+
return {
|
|
85
|
+
fillerColor: "rgba(53, 139, 231, 0.25)",
|
|
86
|
+
borderColor: "rgba(53, 139, 231, 0.3)",
|
|
87
|
+
borderWidth: 0.5,
|
|
88
|
+
backgroundColor: "transparent",
|
|
89
|
+
borderRadius: 4,
|
|
90
|
+
dataBackground: {
|
|
91
|
+
lineStyle: {
|
|
92
|
+
opacity: 0
|
|
93
|
+
},
|
|
94
|
+
areaStyle: {
|
|
95
|
+
opacity: 1,
|
|
96
|
+
color: e.palette.secondary.main
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
selectedDataBackground: {
|
|
100
|
+
lineStyle: {
|
|
101
|
+
opacity: 0
|
|
102
|
+
},
|
|
103
|
+
areaStyle: {
|
|
104
|
+
opacity: 1,
|
|
105
|
+
color: e.palette.secondary.main
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
handleStyle: {
|
|
109
|
+
color: e.palette.common.white,
|
|
110
|
+
borderColor: "rgba(3, 111, 226, 0.08)",
|
|
111
|
+
borderWidth: 1,
|
|
112
|
+
shadowBlur: 3,
|
|
113
|
+
shadowColor: "rgba(0, 0, 0, 0.1)",
|
|
114
|
+
shadowOffsetX: 0,
|
|
115
|
+
shadowOffsetY: 1
|
|
116
|
+
},
|
|
117
|
+
textStyle: {
|
|
118
|
+
color: e.palette.black[60],
|
|
119
|
+
fontSize: parseInt(e.typography.overlineDelicate.fontSize),
|
|
120
|
+
fontFamily: e.typography.overlineDelicate.fontFamily
|
|
121
|
+
}
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
function p(e) {
|
|
125
|
+
return e ? {
|
|
126
|
+
brush: {
|
|
127
|
+
brushType: "rect",
|
|
128
|
+
brushMode: "single"
|
|
129
|
+
}
|
|
130
|
+
} : {};
|
|
131
|
+
}
|
|
132
|
+
function b(e, i = s) {
|
|
133
|
+
return {
|
|
134
|
+
stack: e ? i : void 0
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
export {
|
|
138
|
+
s as D,
|
|
139
|
+
b as a,
|
|
140
|
+
h as b,
|
|
141
|
+
p as g,
|
|
142
|
+
S as m
|
|
143
|
+
};
|
|
144
|
+
//# sourceMappingURL=utils-D3-eQyDR.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils-D3-eQyDR.js","sources":["../src/widgets/echart/const.ts","../src/widgets/echart/utils.ts"],"sourcesContent":["export const DEFAULT_STACK_GROUP = 'stacked'\n","import deepmerge from 'deepmerge'\nimport type { EchartOptionsProps } from './types'\nimport type { Theme } from '@mui/material'\nimport { DEFAULT_STACK_GROUP } from './const'\n\nexport function mergeEchartWidgetConfig<T extends EchartOptionsProps>(\n ...options: [T | undefined, T | undefined]\n): T {\n return deepmerge(options[0] ?? {}, options[1] ?? {}, {\n customMerge: (key) => {\n if (key === 'color') {\n return (_, b: T['color']) => b\n }\n if (key === 'series') {\n return (a: T['series'][], b: T['series'][]) => {\n if (!a.length) return a // If there is no series in a, return a as is\n\n const mergedSeries = b?.map((bItem, index) => {\n const aItem = a?.[index] ?? {}\n return deepmerge(aItem, bItem as object)\n })\n return mergedSeries\n }\n }\n },\n }) as T\n}\n\nexport function getEChartZoomConfig(\n zoom: boolean,\n { start, end }: { start: number; end: number } = { start: 0, end: 100 },\n {\n inside = true,\n xSlider = true,\n ySlider = false,\n showSliders = true,\n xAxisLabelFormatter,\n } = {} as {\n inside?: boolean\n xSlider?: boolean\n ySlider?: boolean\n showSliders?: boolean\n xAxisLabelFormatter?: (value: number) => string\n },\n theme?: Theme,\n) {\n const sliderStyles = theme ? getEChartZoomSliderStyles(theme) : {}\n\n return {\n dataZoom: [\n inside && {\n throttle: 0,\n type: 'inside',\n xAxisIndex: xSlider ? [0] : [],\n yAxisIndex: ySlider ? [0] : [],\n show: zoom,\n zoomLock: !zoom,\n start,\n end,\n },\n inside &&\n ySlider && {\n throttle: 0,\n type: 'inside',\n show: zoom,\n zoomLock: !zoom,\n start,\n end,\n orientation: 'vertical',\n },\n xSlider && {\n throttle: 0,\n type: 'slider',\n xAxisIndex: [0],\n bottom: 0,\n height: parseInt(theme?.spacing?.(4) ?? '32'),\n show: zoom && showSliders,\n zoomLock: !zoom,\n start,\n end,\n labelFormatter: xAxisLabelFormatter,\n showDetail: false,\n ...sliderStyles,\n brushSelect: false,\n moveHandleSize: 8,\n handleSize: '100%',\n handleIcon:\n 'image://data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iOSIgaGVpZ2h0PSIzNiIgdmlld0JveD0iMCAwIDkgMzYiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHg9IjAuNSIgeT0iLTAuNSIgd2lkdGg9IjgiIGhlaWdodD0iMTgiIHJ4PSI0IiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAwIDI3KSIgZmlsbD0id2hpdGUiIHN0cm9rZT0iIzM1OEJFNyIvPgo8cmVjdCB3aWR0aD0iMyIgaGVpZ2h0PSIyIiByeD0iMSIgdHJhbnNmb3JtPSJtYXRyaXgoMSAwIDAgLTEgMyAyMykiIGZpbGw9IiMzNThCRTciLz4KPHJlY3Qgd2lkdGg9IjMiIGhlaWdodD0iMiIgcng9IjEiIHRyYW5zZm9ybT0ibWF0cml4KDEgMCAwIC0xIDMgMTkpIiBmaWxsPSIjMzU4QkU3Ii8+CjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjIiIHJ4PSIxIiB0cmFuc2Zvcm09Im1hdHJpeCgxIDAgMCAtMSAzIDE1KSIgZmlsbD0iIzM1OEJFNyIvPgo8L3N2Zz4=',\n },\n ySlider && {\n throttle: 0,\n type: 'slider',\n left: parseInt(theme?.spacing?.(6) ?? '48'),\n width: parseInt(theme?.spacing?.(4) ?? '32'),\n yAxisIndex: [0],\n show: zoom && showSliders,\n zoomLock: !zoom,\n start,\n end,\n ...sliderStyles,\n brushSelect: false,\n moveHandleSize: 8,\n handleSize: '100%',\n handleIcon:\n 'image://data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzYiIGhlaWdodD0iOSIgdmlld0JveD0iMCAwIDM2IDkiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+CjxyZWN0IHg9IjAuNSIgeT0iMC41IiB3aWR0aD0iOCIgaGVpZ2h0PSIxOCIgcng9IjQiIHRyYW5zZm9ybT0icm90YXRlKC05MCAwLjUgMC41KSIgZmlsbD0id2hpdGUiIHN0cm9rZT0iIzM1OEJFNyIvPgo8cmVjdCB3aWR0aD0iMyIgaGVpZ2h0PSIyIiByeD0iMSIgdHJhbnNmb3JtPSJyb3RhdGUoLTkwIDEzIDYpIiBmaWxsPSIjMzU4QkU3Ii8+CjxyZWN0IHdpZHRoPSIzIiBoZWlnaHQ9IjIiIHJ4PSIxIiB0cmFuc2Zvcm09InJvdGF0ZSgtOTAgMTcgNikiIGZpbGw9IiMzNThCRTciLz4KPHJlY3Qgd2lkdGg9IjMiIGhlaWdodD0iMiIgcng9IjEiIHRyYW5zZm9ybT0icm90YXRlKC05MCAyMSA2KSIgZmlsbD0iIzM1OEJFNyIvPgo8L3N2Zz4=',\n },\n ].filter((d) => !!d),\n }\n}\n\nfunction getEChartZoomSliderStyles(theme: Theme) {\n return {\n fillerColor: 'rgba(53, 139, 231, 0.25)',\n borderColor: 'rgba(53, 139, 231, 0.3)',\n borderWidth: 0.5,\n backgroundColor: 'transparent',\n borderRadius: 4,\n dataBackground: {\n lineStyle: {\n opacity: 0,\n },\n areaStyle: {\n opacity: 1,\n color: theme.palette.secondary.main,\n },\n },\n selectedDataBackground: {\n lineStyle: {\n opacity: 0,\n },\n areaStyle: {\n opacity: 1,\n color: theme.palette.secondary.main,\n },\n },\n handleStyle: {\n color: theme.palette.common.white,\n borderColor: 'rgba(3, 111, 226, 0.08)',\n borderWidth: 1,\n shadowBlur: 3,\n shadowColor: 'rgba(0, 0, 0, 0.1)',\n shadowOffsetX: 0,\n shadowOffsetY: 1,\n },\n textStyle: {\n color: theme.palette.black[60],\n fontSize: parseInt(theme.typography.overlineDelicate.fontSize as string),\n fontFamily: theme.typography.overlineDelicate.fontFamily,\n },\n } as const\n}\n\nexport function getEChartBrushConfig(brush: boolean) {\n return brush\n ? {\n brush: {\n brushType: 'rect',\n brushMode: 'single',\n },\n }\n : {}\n}\n\nexport function getEChartStackConfig(\n stack: boolean,\n stackGroup: string = DEFAULT_STACK_GROUP,\n) {\n return { stack: stack ? stackGroup : undefined }\n}\n"],"names":["DEFAULT_STACK_GROUP","mergeEchartWidgetConfig","options","deepmerge","customMerge","key","_","b","a","length","map","bItem","index","aItem","getEChartZoomConfig","zoom","start","end","inside","xSlider","ySlider","showSliders","xAxisLabelFormatter","theme","sliderStyles","getEChartZoomSliderStyles","dataZoom","throttle","type","xAxisIndex","yAxisIndex","show","zoomLock","orientation","bottom","height","parseInt","spacing","labelFormatter","showDetail","brushSelect","moveHandleSize","handleSize","handleIcon","left","width","filter","d","fillerColor","borderColor","borderWidth","backgroundColor","borderRadius","dataBackground","lineStyle","opacity","areaStyle","color","palette","secondary","main","selectedDataBackground","handleStyle","common","white","shadowBlur","shadowColor","shadowOffsetX","shadowOffsetY","textStyle","black","fontSize","typography","overlineDelicate","fontFamily","getEChartBrushConfig","brush","brushType","brushMode","getEChartStackConfig","stack","stackGroup","undefined"],"mappings":"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"}
|