@carto/ps-react-ui 4.2.6 → 4.3.0-widgets.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs-D9ro6BXv.js +85 -0
- package/dist/cjs-D9ro6BXv.js.map +1 -0
- package/dist/components.js +775 -1409
- package/dist/components.js.map +1 -1
- package/dist/const-BLV7Tvte.js +758 -0
- package/dist/const-BLV7Tvte.js.map +1 -0
- package/dist/download-KroQ0SWg.js +195 -0
- package/dist/download-KroQ0SWg.js.map +1 -0
- package/dist/echart-CqfROFu3.js +214 -0
- package/dist/echart-CqfROFu3.js.map +1 -0
- package/dist/formula-ui-ChzvMEOG.js +52 -0
- package/dist/formula-ui-ChzvMEOG.js.map +1 -0
- package/dist/lasso-tool-BC-rsMMW.js +552 -0
- package/dist/lasso-tool-BC-rsMMW.js.map +1 -0
- package/dist/markdown-n_tOtoiT.js +27 -0
- package/dist/markdown-n_tOtoiT.js.map +1 -0
- package/dist/markdown-ui-BBrzzd7Y.js +62 -0
- package/dist/markdown-ui-BBrzzd7Y.js.map +1 -0
- package/dist/note-DF-n70TX.js +101 -0
- package/dist/note-DF-n70TX.js.map +1 -0
- package/dist/range-ui-CtUX11Xm.js +146 -0
- package/dist/range-ui-CtUX11Xm.js.map +1 -0
- package/dist/root-L_WZnJY5.js +46 -0
- package/dist/root-L_WZnJY5.js.map +1 -0
- package/dist/row-DQaSxmDV.js +18 -0
- package/dist/row-DQaSxmDV.js.map +1 -0
- package/dist/series-CsyEPq-X.js +83 -0
- package/dist/series-CsyEPq-X.js.map +1 -0
- package/dist/skeleton-BSPcEvfq.js +27 -0
- package/dist/skeleton-BSPcEvfq.js.map +1 -0
- package/dist/skeleton-C4rOYTy-.js +78 -0
- package/dist/skeleton-C4rOYTy-.js.map +1 -0
- package/dist/skeleton-C9Jqc241.js +82 -0
- package/dist/skeleton-C9Jqc241.js.map +1 -0
- package/dist/skeleton-D-zHBBIw.js +64 -0
- package/dist/skeleton-D-zHBBIw.js.map +1 -0
- package/dist/skeleton-DMP-IwaJ.js +109 -0
- package/dist/skeleton-DMP-IwaJ.js.map +1 -0
- package/dist/skeleton-DRorqowB.js +22 -0
- package/dist/skeleton-DRorqowB.js.map +1 -0
- package/dist/skeleton-DsZhv-AH.js +89 -0
- package/dist/skeleton-DsZhv-AH.js.map +1 -0
- package/dist/skeleton-Dx3FCer0.js +13 -0
- package/dist/skeleton-Dx3FCer0.js.map +1 -0
- package/dist/skeleton-QVDdb1c2.js +21 -0
- package/dist/skeleton-QVDdb1c2.js.map +1 -0
- package/dist/skeleton-loader-DWC1-EAx.js +23 -0
- package/dist/skeleton-loader-DWC1-EAx.js.map +1 -0
- package/dist/smart-tooltip-BSlcAkBM.js +39 -0
- package/dist/smart-tooltip-BSlcAkBM.js.map +1 -0
- package/dist/spread-ui-BjzH190y.js +82 -0
- package/dist/spread-ui-BjzH190y.js.map +1 -0
- package/dist/style-BGeCtQkP.js +19 -0
- package/dist/style-BGeCtQkP.js.map +1 -0
- package/dist/style-C7v1iwqD.js +34 -0
- package/dist/style-C7v1iwqD.js.map +1 -0
- package/dist/styles-cohnxh9F.js +23 -0
- package/dist/styles-cohnxh9F.js.map +1 -0
- package/dist/types/widgets/_shared/chart-config/config-factory.d.ts +44 -0
- package/dist/types/widgets/_shared/chart-config/csv-modifiers.d.ts +19 -0
- package/dist/types/widgets/_shared/chart-config/index.d.ts +7 -0
- package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +39 -0
- package/dist/types/widgets/_shared/skeleton/index.d.ts +4 -0
- package/dist/types/widgets/_shared/skeleton/styles.d.ts +19 -0
- package/dist/types/widgets/actions/download/download.d.ts +2 -0
- package/dist/types/widgets/actions/download/exports.d.ts +6 -0
- package/dist/types/widgets/actions/download/types.d.ts +29 -0
- package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +2 -0
- package/dist/types/widgets/actions/fullscreen/styles.d.ts +10 -0
- package/dist/types/widgets/actions/fullscreen/types.d.ts +21 -0
- package/dist/types/widgets/actions/index.d.ts +5 -0
- package/dist/types/widgets/bar/config.d.ts +4 -0
- package/dist/types/widgets/bar/index.d.ts +3 -0
- package/dist/types/widgets/bar/skeleton.d.ts +1 -0
- package/dist/types/widgets/bar/style.d.ts +37 -0
- package/dist/types/widgets/bar/types.d.ts +15 -0
- package/dist/types/widgets/config-loader/index.d.ts +2 -0
- package/dist/types/widgets/config-loader/types.d.ts +12 -0
- package/dist/types/widgets/config-loader/use-config.d.ts +5 -0
- package/dist/types/widgets/echart/const.d.ts +1 -0
- package/dist/types/widgets/echart/echart-ui.d.ts +2 -0
- package/dist/types/widgets/echart/echart.d.ts +2 -0
- package/dist/types/widgets/echart/index.d.ts +5 -0
- package/dist/types/widgets/echart/options.d.ts +3 -0
- package/dist/types/widgets/echart/types.d.ts +31 -0
- package/dist/types/widgets/echart/utils.d.ts +74 -0
- package/dist/types/widgets/formula/components/item.d.ts +2 -0
- package/dist/types/widgets/formula/components/prefix.d.ts +2 -0
- package/dist/types/widgets/formula/components/row.d.ts +2 -0
- package/dist/types/widgets/formula/components/series.d.ts +2 -0
- package/dist/types/widgets/formula/components/suffix.d.ts +2 -0
- package/dist/types/widgets/formula/components/value.d.ts +2 -0
- package/dist/types/widgets/formula/config.d.ts +2 -0
- package/dist/types/widgets/formula/formula-ui.d.ts +2 -0
- package/dist/types/widgets/formula/index.d.ts +10 -0
- package/dist/types/widgets/formula/serializer.d.ts +16 -0
- package/dist/types/widgets/formula/skeleton.d.ts +1 -0
- package/dist/types/widgets/formula/style.d.ts +21 -0
- package/dist/types/widgets/formula/types.d.ts +54 -0
- package/dist/types/widgets/histogram/config.d.ts +4 -0
- package/dist/types/widgets/histogram/index.d.ts +3 -0
- package/dist/types/widgets/histogram/skeleton.d.ts +1 -0
- package/dist/types/widgets/histogram/style.d.ts +15 -0
- package/dist/types/widgets/histogram/types.d.ts +15 -0
- package/dist/types/widgets/index.d.ts +4 -1
- package/dist/types/widgets/markdown/config.d.ts +2 -0
- package/dist/types/widgets/markdown/index.d.ts +5 -0
- package/dist/types/widgets/markdown/markdown-ui.d.ts +2 -0
- package/dist/types/widgets/markdown/markdown.d.ts +2 -0
- package/dist/types/widgets/markdown/skeleton.d.ts +1 -0
- package/dist/types/widgets/markdown/style.d.ts +2 -0
- package/dist/types/widgets/markdown/types.d.ts +28 -0
- package/dist/types/widgets/note/index.d.ts +2 -0
- package/dist/types/widgets/note/note.d.ts +2 -0
- package/dist/types/widgets/note/style.d.ts +17 -0
- package/dist/types/widgets/note/types.d.ts +7 -0
- package/dist/types/widgets/pie/config.d.ts +4 -0
- package/dist/types/widgets/pie/index.d.ts +3 -0
- package/dist/types/widgets/pie/skeleton.d.ts +1 -0
- package/dist/types/widgets/pie/style.d.ts +15 -0
- package/dist/types/widgets/pie/types.d.ts +15 -0
- package/dist/types/widgets/range/components/range-item.d.ts +2 -0
- package/dist/types/widgets/range/config.d.ts +2 -0
- package/dist/types/widgets/range/index.d.ts +5 -0
- package/dist/types/widgets/range/range-ui.d.ts +2 -0
- package/dist/types/widgets/range/serializer.d.ts +16 -0
- package/dist/types/widgets/range/serializer.test.d.ts +1 -0
- package/dist/types/widgets/range/skeleton.d.ts +1 -0
- package/dist/types/widgets/range/style.d.ts +2 -0
- package/dist/types/widgets/range/types.d.ts +44 -0
- package/dist/types/widgets/root/index.d.ts +2 -0
- package/dist/types/widgets/root/root.d.ts +2 -0
- package/dist/types/widgets/root/style.d.ts +8 -0
- package/dist/types/widgets/root/types.d.ts +15 -0
- package/dist/types/widgets/scatterplot/config.d.ts +4 -0
- package/dist/types/widgets/scatterplot/index.d.ts +3 -0
- package/dist/types/widgets/scatterplot/skeleton.d.ts +1 -0
- package/dist/types/widgets/scatterplot/style.d.ts +24 -0
- package/dist/types/widgets/scatterplot/types.d.ts +15 -0
- package/dist/types/widgets/skeleton-loader/index.d.ts +2 -0
- package/dist/types/widgets/skeleton-loader/skeleton-loader.d.ts +2 -0
- package/dist/types/widgets/skeleton-loader/types.d.ts +7 -0
- package/dist/types/widgets/spread/components/max-value.d.ts +2 -0
- package/dist/types/widgets/spread/components/min-value.d.ts +2 -0
- package/dist/types/widgets/spread/components/separator.d.ts +2 -0
- package/dist/types/widgets/spread/config.d.ts +2 -0
- package/dist/types/widgets/spread/index.d.ts +8 -0
- package/dist/types/widgets/spread/skeleton.d.ts +1 -0
- package/dist/types/widgets/spread/spread-ui.d.ts +2 -0
- package/dist/types/widgets/spread/style.d.ts +21 -0
- package/dist/types/widgets/spread/types.d.ts +52 -0
- package/dist/types/widgets/stores/types.d.ts +69 -0
- package/dist/types/widgets/stores/widget-store.d.ts +64 -0
- package/dist/types/widgets/stores/widget-store.test.d.ts +1 -0
- package/dist/types/widgets/timeseries/config.d.ts +4 -0
- package/dist/types/widgets/timeseries/index.d.ts +3 -0
- package/dist/types/widgets/timeseries/skeleton.d.ts +1 -0
- package/dist/types/widgets/timeseries/style.d.ts +38 -0
- package/dist/types/widgets/timeseries/types.d.ts +15 -0
- package/dist/types/widgets/widget/const.d.ts +2 -0
- package/dist/types/widgets/widget/types.d.ts +47 -0
- package/dist/types/widgets/widget/widget.d.ts +2 -0
- package/dist/types/widgets/wrapper/components/actions.d.ts +2 -0
- package/dist/types/widgets/wrapper/components/options.d.ts +2 -0
- package/dist/types/widgets/wrapper/components/title.d.ts +6 -0
- package/dist/types/widgets/wrapper/index.d.ts +6 -0
- package/dist/types/widgets/wrapper/styles.d.ts +83 -0
- package/dist/types/widgets/wrapper/types.d.ts +35 -0
- package/dist/types/widgets/wrapper/wrapper-ui.d.ts +2 -0
- package/dist/types/widgets/wrapper/wrapper.d.ts +2 -0
- package/dist/use-config-BYEOiIcu.js +43 -0
- package/dist/use-config-BYEOiIcu.js.map +1 -0
- package/dist/widget-store-yDO2ul8g.js +44 -0
- package/dist/widget-store-yDO2ul8g.js.map +1 -0
- package/dist/widgets/actions.js +9 -0
- package/dist/widgets/actions.js.map +1 -0
- package/dist/widgets/bar.js +7 -0
- package/dist/widgets/bar.js.map +1 -0
- package/dist/widgets/config-loader.js +5 -0
- package/dist/widgets/config-loader.js.map +1 -0
- package/dist/widgets/echart.js +11 -0
- package/dist/widgets/echart.js.map +1 -0
- package/dist/widgets/formula.js +27 -0
- package/dist/widgets/formula.js.map +1 -0
- package/dist/widgets/histogram.js +7 -0
- package/dist/widgets/histogram.js.map +1 -0
- package/dist/widgets/note.js +5 -0
- package/dist/widgets/note.js.map +1 -0
- package/dist/widgets/pie.js +7 -0
- package/dist/widgets/pie.js.map +1 -0
- package/dist/widgets/range.js +19 -0
- package/dist/widgets/range.js.map +1 -0
- package/dist/widgets/root.js +5 -0
- package/dist/widgets/root.js.map +1 -0
- package/dist/widgets/scatterplot.js +7 -0
- package/dist/widgets/scatterplot.js.map +1 -0
- package/dist/widgets/skeleton-loader.js +5 -0
- package/dist/widgets/skeleton-loader.js.map +1 -0
- package/dist/widgets/spread.js +21 -0
- package/dist/widgets/spread.js.map +1 -0
- package/dist/widgets/timeseries.js +7 -0
- package/dist/widgets/timeseries.js.map +1 -0
- package/dist/widgets/wrapper.js +9 -0
- package/dist/widgets/wrapper.js.map +1 -0
- package/dist/widgets.js +85 -1
- package/dist/widgets.js.map +1 -1
- package/dist/wrapper-57csMybC.js +265 -0
- package/dist/wrapper-57csMybC.js.map +1 -0
- package/package.json +73 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const DEFAULT_STACK_GROUP = "stacked";
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Echart } from './echart';
|
|
2
|
+
export { EchartUI } from './echart-ui';
|
|
3
|
+
export type { EchartProps, EchartOptionsProps, EchartUIProps, EchartWidgetData, EchartWidgetState, EchartWidgetConfig, EchartWidgetProps, } from './types';
|
|
4
|
+
export { getCommonOptions } from './options';
|
|
5
|
+
export { mergeWidgetConfig, getEChartBrushConfig, getEChartStackConfig, getEChartZoomConfig, } from './utils';
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { EChartsOption } from 'echarts';
|
|
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
|
+
import { Ref } from 'react';
|
|
9
|
+
import type * as echarts from 'echarts';
|
|
10
|
+
export type EchartOptionsProps = EChartsOption;
|
|
11
|
+
export interface EchartUIProps {
|
|
12
|
+
option: EchartOptionsProps;
|
|
13
|
+
className?: string;
|
|
14
|
+
init?: echarts.EChartsInitOpts;
|
|
15
|
+
style?: React.CSSProperties;
|
|
16
|
+
ref?: Ref<echarts.ECharts>;
|
|
17
|
+
onEvents?: Record<string, Parameters<echarts.ECharts['on']>[2]>;
|
|
18
|
+
}
|
|
19
|
+
export interface EchartProps {
|
|
20
|
+
id: string;
|
|
21
|
+
}
|
|
22
|
+
export type EchartWidgetData = Record<string, string | number>[][];
|
|
23
|
+
export type EchartWidgetState = BaseWidgetState<WrapperState<FullScreenState<DownloadState<EchartWidgetProps, EchartWidgetData> & {
|
|
24
|
+
option: EchartUIProps['option'];
|
|
25
|
+
onEvents?: EchartUIProps['onEvents'];
|
|
26
|
+
init?: EchartUIProps['init'];
|
|
27
|
+
}>>>;
|
|
28
|
+
export type EchartWidgetConfig<D = EchartWidgetData> = FullScreenConfigProps & DownloadConfigProps<D> & EchartUIProps;
|
|
29
|
+
export interface EchartWidgetProps {
|
|
30
|
+
config?: ConfigProps<EchartWidgetConfig>['config'];
|
|
31
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { EchartOptionsProps } from './types';
|
|
2
|
+
import { Theme } from '@mui/material';
|
|
3
|
+
export declare function mergeWidgetConfig<T extends EchartOptionsProps>(...options: [T, T]): T;
|
|
4
|
+
export declare function getEChartZoomConfig(zoom: boolean, { start, end }: {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
} | undefined, { inside, xSlider, ySlider }: {
|
|
8
|
+
inside?: boolean | undefined;
|
|
9
|
+
xSlider?: boolean | undefined;
|
|
10
|
+
ySlider?: boolean | undefined;
|
|
11
|
+
} | undefined, theme: Theme): {
|
|
12
|
+
dataZoom: ({
|
|
13
|
+
throttle: number;
|
|
14
|
+
type: string;
|
|
15
|
+
xAxisIndex: number[];
|
|
16
|
+
yAxisIndex: number[];
|
|
17
|
+
show: boolean;
|
|
18
|
+
zoomLock: boolean;
|
|
19
|
+
start: number;
|
|
20
|
+
end: number;
|
|
21
|
+
orientation?: undefined;
|
|
22
|
+
bottom?: undefined;
|
|
23
|
+
left?: undefined;
|
|
24
|
+
} | {
|
|
25
|
+
throttle: number;
|
|
26
|
+
type: string;
|
|
27
|
+
show: boolean;
|
|
28
|
+
zoomLock: boolean;
|
|
29
|
+
start: number;
|
|
30
|
+
end: number;
|
|
31
|
+
orientation: string;
|
|
32
|
+
xAxisIndex?: undefined;
|
|
33
|
+
yAxisIndex?: undefined;
|
|
34
|
+
bottom?: undefined;
|
|
35
|
+
left?: undefined;
|
|
36
|
+
} | {
|
|
37
|
+
throttle: number;
|
|
38
|
+
type: string;
|
|
39
|
+
xAxisIndex: number[];
|
|
40
|
+
bottom: number;
|
|
41
|
+
show: boolean;
|
|
42
|
+
zoomLock: boolean;
|
|
43
|
+
start: number;
|
|
44
|
+
end: number;
|
|
45
|
+
yAxisIndex?: undefined;
|
|
46
|
+
orientation?: undefined;
|
|
47
|
+
left?: undefined;
|
|
48
|
+
} | {
|
|
49
|
+
throttle: number;
|
|
50
|
+
type: string;
|
|
51
|
+
left: number;
|
|
52
|
+
yAxisIndex: number[];
|
|
53
|
+
show: boolean;
|
|
54
|
+
zoomLock: boolean;
|
|
55
|
+
start: number;
|
|
56
|
+
end: number;
|
|
57
|
+
xAxisIndex?: undefined;
|
|
58
|
+
orientation?: undefined;
|
|
59
|
+
bottom?: undefined;
|
|
60
|
+
})[];
|
|
61
|
+
};
|
|
62
|
+
export declare function getEChartBrushConfig(brush: boolean): {
|
|
63
|
+
brush: {
|
|
64
|
+
brushType: string;
|
|
65
|
+
brushMode: string;
|
|
66
|
+
};
|
|
67
|
+
} | {
|
|
68
|
+
brush?: undefined;
|
|
69
|
+
};
|
|
70
|
+
export declare function getEChartStackConfig(stack: boolean, stackGroup?: string): {
|
|
71
|
+
stack: string;
|
|
72
|
+
} | {
|
|
73
|
+
stack?: undefined;
|
|
74
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { Item } from './components/item';
|
|
2
|
+
export { Value } from './components/value';
|
|
3
|
+
export { Prefix } from './components/prefix';
|
|
4
|
+
export { Suffix } from './components/suffix';
|
|
5
|
+
export { Series } from './components/series';
|
|
6
|
+
export { Row } from './components/row';
|
|
7
|
+
export { FormulaUI } from './formula-ui';
|
|
8
|
+
export { FormulaSkeleton } from './skeleton';
|
|
9
|
+
export type { RowProps, ValueProps, FormulaWidgetState, ItemProps, DataItem, FormulaUIProps, SeriesConfig, } from './types';
|
|
10
|
+
export { sanitizeDataItem, sanitizeDataItems } from './serializer';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { DataItem } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sanitizes DataItem by converting ReactNode prefix/suffix values to undefined.
|
|
4
|
+
* This ensures only string values are stored in the widget state.
|
|
5
|
+
*
|
|
6
|
+
* @param item - The DataItem to sanitize
|
|
7
|
+
* @returns A new DataItem with ReactNode prefix/suffix values converted to undefined
|
|
8
|
+
*/
|
|
9
|
+
export declare function sanitizeDataItem(item: DataItem): DataItem;
|
|
10
|
+
/**
|
|
11
|
+
* Sanitizes an array of DataItems by converting ReactNode prefix/suffix values to undefined.
|
|
12
|
+
*
|
|
13
|
+
* @param items - Array of DataItems to sanitize
|
|
14
|
+
* @returns A new array with sanitized DataItems
|
|
15
|
+
*/
|
|
16
|
+
export declare function sanitizeDataItems(items: DataItem[] | undefined): DataItem[] | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function FormulaSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
root: {
|
|
4
|
+
display: "flex";
|
|
5
|
+
flexDirection: "column";
|
|
6
|
+
gap: (theme: Theme) => string;
|
|
7
|
+
};
|
|
8
|
+
item: {
|
|
9
|
+
'&[data-disabled="true"]': {
|
|
10
|
+
color: (theme: Theme) => string;
|
|
11
|
+
};
|
|
12
|
+
};
|
|
13
|
+
row: {
|
|
14
|
+
display: "flex";
|
|
15
|
+
alignItems: "center";
|
|
16
|
+
gap: (theme: Theme) => string;
|
|
17
|
+
'& + &': {
|
|
18
|
+
marginTop: (theme: Theme) => string;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
};
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
|
|
4
|
+
import { DownloadState } from '../actions';
|
|
5
|
+
import { DownloadConfigProps } from '../actions/download/types';
|
|
6
|
+
import { WrapperState } from '../wrapper/types';
|
|
7
|
+
import { BaseWidgetProps } from '../widget/types';
|
|
8
|
+
import { BaseConfig } from '../config-loader';
|
|
9
|
+
export interface FormulaProps extends BaseWidgetProps<FormulaWidgetConfig> {
|
|
10
|
+
type: 'formula';
|
|
11
|
+
data: FormulaWidgetData | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface FormulaUIProps {
|
|
14
|
+
id: WidgetsStoreProps['id'];
|
|
15
|
+
}
|
|
16
|
+
export interface DataItem {
|
|
17
|
+
value: number;
|
|
18
|
+
prefix?: string | ReactNode;
|
|
19
|
+
suffix?: string | ReactNode;
|
|
20
|
+
color?: string;
|
|
21
|
+
}
|
|
22
|
+
export interface RowProps {
|
|
23
|
+
id: WidgetsStoreProps['id'];
|
|
24
|
+
children: ReactNode | ((props: {
|
|
25
|
+
index: number;
|
|
26
|
+
}) => ReactNode);
|
|
27
|
+
}
|
|
28
|
+
export interface ValueProps extends Omit<ItemProps, 'children'> {
|
|
29
|
+
id: WidgetsStoreProps['id'];
|
|
30
|
+
index?: number;
|
|
31
|
+
}
|
|
32
|
+
export interface ItemProps {
|
|
33
|
+
children: ReactNode;
|
|
34
|
+
disabled?: boolean;
|
|
35
|
+
TypographyProps?: TypographyProps;
|
|
36
|
+
}
|
|
37
|
+
export type FormulaWidgetData = DataItem[];
|
|
38
|
+
export interface SeriesConfig {
|
|
39
|
+
name: string;
|
|
40
|
+
color?: string;
|
|
41
|
+
}
|
|
42
|
+
export type FormulaWidgetState = BaseWidgetState<WrapperState<DownloadState<FormulaProps & {
|
|
43
|
+
formatter?: (value: number) => string;
|
|
44
|
+
series?: SeriesConfig[];
|
|
45
|
+
}, FormulaWidgetData>>>;
|
|
46
|
+
export type FormulaWidgetConfig = BaseConfig & DownloadConfigProps<FormulaWidgetData> & {
|
|
47
|
+
type: FormulaProps['type'];
|
|
48
|
+
formatter?: FormulaWidgetState['formatter'];
|
|
49
|
+
series?: SeriesConfig[];
|
|
50
|
+
};
|
|
51
|
+
export interface FormulaConfig extends Omit<BaseConfig, 'data'> {
|
|
52
|
+
data?: FormulaWidgetData;
|
|
53
|
+
series?: SeriesConfig[];
|
|
54
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { HistogramConfig } from './types';
|
|
2
|
+
export declare const histogramConfig: (config: HistogramConfig & {
|
|
3
|
+
refUI?: import('react').Ref<HTMLElement | null>;
|
|
4
|
+
}) => import('../_shared/chart-config/config-factory').ChartWidgetConfigResult<import('../echart').EchartWidgetData, HistogramConfig, "histogram">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function HistogramSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
skeleton: {
|
|
4
|
+
graph: {
|
|
5
|
+
readonly container: {
|
|
6
|
+
readonly display: "flex";
|
|
7
|
+
readonly alignItems: "center";
|
|
8
|
+
readonly justifyContent: "space-between";
|
|
9
|
+
readonly flexDirection: "column";
|
|
10
|
+
readonly gap: ({ spacing }: Theme) => string;
|
|
11
|
+
readonly height: ({ spacing }: Theme) => string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseWidgetProps } from '../widget/types';
|
|
2
|
+
import { BaseConfig } from '../config-loader';
|
|
3
|
+
import { EchartWidgetConfig, EchartWidgetData, EchartWidgetState } from '../echart';
|
|
4
|
+
export interface HistogramProps extends BaseWidgetProps<HistogramWidgetConfig> {
|
|
5
|
+
type: 'histogram';
|
|
6
|
+
data: HistogramWidgetData | undefined;
|
|
7
|
+
}
|
|
8
|
+
export type HistogramWidgetData = EchartWidgetData;
|
|
9
|
+
export type HistogramWidgetState = EchartWidgetState;
|
|
10
|
+
export type HistogramWidgetConfig = HistogramConfig & EchartWidgetConfig & {
|
|
11
|
+
type: HistogramProps['type'];
|
|
12
|
+
};
|
|
13
|
+
export interface HistogramConfig extends Omit<BaseConfig, 'data'> {
|
|
14
|
+
data?: HistogramWidgetData;
|
|
15
|
+
}
|
|
@@ -1 +1,4 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { useWidgetStore, useWidget } from './stores/widget-store';
|
|
2
|
+
export type { BaseWidgetState, WidgetState, WidgetStoreState, WidgetStoreActions, WidgetStore, } from './stores/types';
|
|
3
|
+
export { Widget } from './widget/widget';
|
|
4
|
+
export type { WidgetProps, WidgetConfig, BaseWidgetProps, WidgetBaseComponentConfig, WidgetComponentConfig, } from './widget/types';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Markdown } from './markdown';
|
|
2
|
+
export { MarkdownUI } from './markdown-ui';
|
|
3
|
+
export { MarkdownSkeleton } from './skeleton';
|
|
4
|
+
export { markdownConfig } from './config';
|
|
5
|
+
export type { MarkdownComponentProps, MarkdownProps, MarkdownUIProps, MarkdownWidgetData, MarkdownWidgetState, MarkdownWidgetConfig, MarkdownConfig, MarkdownDataItem, } from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MarkdownSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
|
|
2
|
+
import { DownloadState } from '../actions';
|
|
3
|
+
import { DownloadConfigProps } from '../actions/download/types';
|
|
4
|
+
import { WrapperState } from '../wrapper/types';
|
|
5
|
+
import { BaseWidgetProps } from '../widget/types';
|
|
6
|
+
import { BaseConfig } from '../config-loader';
|
|
7
|
+
import { FullScreenConfigProps } from '../actions/fullscreen/types';
|
|
8
|
+
export interface MarkdownComponentProps {
|
|
9
|
+
children: string;
|
|
10
|
+
}
|
|
11
|
+
export interface MarkdownProps extends BaseWidgetProps<MarkdownWidgetConfig> {
|
|
12
|
+
type: 'markdown';
|
|
13
|
+
data: MarkdownWidgetData | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface MarkdownUIProps {
|
|
16
|
+
id: WidgetsStoreProps['id'];
|
|
17
|
+
}
|
|
18
|
+
export interface MarkdownDataItem {
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
21
|
+
export type MarkdownWidgetData = MarkdownDataItem;
|
|
22
|
+
export type MarkdownWidgetState = BaseWidgetState<WrapperState<DownloadState<MarkdownProps, MarkdownWidgetData>>>;
|
|
23
|
+
export type MarkdownWidgetConfig = BaseConfig & FullScreenConfigProps & DownloadConfigProps<MarkdownWidgetData> & {
|
|
24
|
+
type: MarkdownProps['type'];
|
|
25
|
+
};
|
|
26
|
+
export interface MarkdownConfig extends Omit<BaseConfig, 'data'> {
|
|
27
|
+
data?: MarkdownWidgetData;
|
|
28
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
root: {
|
|
4
|
+
typography: string;
|
|
5
|
+
marginBlockStart: ({ spacing }: Theme) => string;
|
|
6
|
+
color: (theme: Theme) => string;
|
|
7
|
+
};
|
|
8
|
+
clamped: {
|
|
9
|
+
display: "-webkit-box";
|
|
10
|
+
WebkitLineClamp: number;
|
|
11
|
+
WebkitBoxOrient: "vertical";
|
|
12
|
+
overflow: "hidden";
|
|
13
|
+
};
|
|
14
|
+
expanded: {
|
|
15
|
+
display: "block";
|
|
16
|
+
};
|
|
17
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { PieConfig } from './types';
|
|
2
|
+
export declare const pieConfig: (config: PieConfig & {
|
|
3
|
+
refUI?: import('react').Ref<HTMLElement | null>;
|
|
4
|
+
}) => import('../_shared/chart-config/config-factory').ChartWidgetConfigResult<import('../echart').EchartWidgetData, PieConfig, "pie">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function PieSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
skeleton: {
|
|
4
|
+
graph: {
|
|
5
|
+
readonly container: {
|
|
6
|
+
readonly display: "flex";
|
|
7
|
+
readonly alignItems: "center";
|
|
8
|
+
readonly justifyContent: "space-between";
|
|
9
|
+
readonly flexDirection: "column";
|
|
10
|
+
readonly gap: ({ spacing }: Theme) => string;
|
|
11
|
+
readonly height: ({ spacing }: Theme) => string;
|
|
12
|
+
};
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { BaseWidgetProps } from '../widget/types';
|
|
2
|
+
import { BaseConfig } from '../config-loader';
|
|
3
|
+
import { EchartWidgetConfig, EchartWidgetData, EchartWidgetState } from '../echart';
|
|
4
|
+
export interface PieProps extends BaseWidgetProps<PieWidgetConfig> {
|
|
5
|
+
type: 'pie';
|
|
6
|
+
data: PieWidgetData | undefined;
|
|
7
|
+
}
|
|
8
|
+
export type PieWidgetData = EchartWidgetData;
|
|
9
|
+
export type PieWidgetState = EchartWidgetState;
|
|
10
|
+
export type PieWidgetConfig = PieConfig & EchartWidgetConfig & {
|
|
11
|
+
type: PieProps['type'];
|
|
12
|
+
};
|
|
13
|
+
export interface PieConfig extends Omit<BaseConfig, 'data'> {
|
|
14
|
+
data?: PieWidgetData;
|
|
15
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { RangeUI } from './range-ui';
|
|
2
|
+
export { RangeSkeleton } from './skeleton';
|
|
3
|
+
export { RangeItem } from './components/range-item';
|
|
4
|
+
export type { RangeWidgetState, RangeUIProps, RangeDataItem, RangeWidgetData, RangeItemProps, } from './types';
|
|
5
|
+
export { sanitizeRangeDataItem, sanitizeRangeDataItems } from './serializer';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RangeDataItem } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Sanitizes RangeDataItem by converting ReactNode note values to undefined.
|
|
4
|
+
* This ensures only string values are stored in the widget state.
|
|
5
|
+
*
|
|
6
|
+
* @param item - The RangeDataItem to sanitize
|
|
7
|
+
* @returns A new RangeDataItem with ReactNode note values converted to undefined
|
|
8
|
+
*/
|
|
9
|
+
export declare function sanitizeRangeDataItem(item: RangeDataItem): RangeDataItem;
|
|
10
|
+
/**
|
|
11
|
+
* Sanitizes an array of RangeDataItems by converting ReactNode note values to undefined.
|
|
12
|
+
*
|
|
13
|
+
* @param items - Array of RangeDataItems to sanitize
|
|
14
|
+
* @returns A new array with sanitized RangeDataItems
|
|
15
|
+
*/
|
|
16
|
+
export declare function sanitizeRangeDataItems(items: RangeDataItem[] | undefined): RangeDataItem[] | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function RangeSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
|
|
3
|
+
import { DownloadState } from '../actions';
|
|
4
|
+
import { DownloadConfigProps } from '../actions/download/types';
|
|
5
|
+
import { WrapperState } from '../wrapper/types';
|
|
6
|
+
import { BaseWidgetProps } from '../widget/types';
|
|
7
|
+
import { BaseConfig } from '../config-loader';
|
|
8
|
+
export interface RangeProps extends BaseWidgetProps<RangeWidgetConfig> {
|
|
9
|
+
type: 'range';
|
|
10
|
+
data: RangeWidgetData | undefined;
|
|
11
|
+
}
|
|
12
|
+
export interface RangeUIProps {
|
|
13
|
+
id: WidgetsStoreProps['id'];
|
|
14
|
+
}
|
|
15
|
+
export interface RangeDataItem {
|
|
16
|
+
min: number;
|
|
17
|
+
max: number;
|
|
18
|
+
value?: number[];
|
|
19
|
+
step?: number;
|
|
20
|
+
marks?: boolean | {
|
|
21
|
+
value: number;
|
|
22
|
+
label?: string;
|
|
23
|
+
}[];
|
|
24
|
+
disabled?: boolean;
|
|
25
|
+
color?: string;
|
|
26
|
+
note?: string | ReactNode;
|
|
27
|
+
}
|
|
28
|
+
export interface RangeItemProps {
|
|
29
|
+
id: WidgetsStoreProps['id'];
|
|
30
|
+
index: number;
|
|
31
|
+
}
|
|
32
|
+
export type RangeWidgetData = RangeDataItem[];
|
|
33
|
+
export type RangeWidgetState = BaseWidgetState<WrapperState<DownloadState<RangeProps & {
|
|
34
|
+
formatter?: (value: number) => string;
|
|
35
|
+
onChange?: (value: number[], index: number) => void;
|
|
36
|
+
}, RangeWidgetData>>>;
|
|
37
|
+
export type RangeWidgetConfig = BaseConfig & DownloadConfigProps<RangeWidgetData> & {
|
|
38
|
+
type: RangeProps['type'];
|
|
39
|
+
formatter?: RangeWidgetState['formatter'];
|
|
40
|
+
onChange?: RangeWidgetState['onChange'];
|
|
41
|
+
};
|
|
42
|
+
export interface RangeConfig extends Omit<BaseConfig, 'data'> {
|
|
43
|
+
data?: RangeWidgetData;
|
|
44
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { WrapperUIProps } from '../wrapper';
|
|
3
|
+
import { WidgetsStoreProps } from '../stores/types';
|
|
4
|
+
export interface RootProps {
|
|
5
|
+
id: WidgetsStoreProps['id'];
|
|
6
|
+
type: WidgetsStoreProps['type'];
|
|
7
|
+
children: ReactNode;
|
|
8
|
+
title: WrapperUIProps['title'];
|
|
9
|
+
data?: unknown;
|
|
10
|
+
isLoading?: WidgetsStoreProps['isLoading'];
|
|
11
|
+
isFetching?: WidgetsStoreProps['isFetching'];
|
|
12
|
+
collapsed?: WrapperUIProps['collapsed'];
|
|
13
|
+
collapsible?: WrapperUIProps['disabled'];
|
|
14
|
+
disabled?: WrapperUIProps['disabled'];
|
|
15
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ScatterplotConfig, ScatterplotWidgetData } from './types';
|
|
2
|
+
export declare const scatterplotConfig: (config: ScatterplotConfig & {
|
|
3
|
+
refUI?: import('react').Ref<HTMLElement | null>;
|
|
4
|
+
}) => import('../_shared/chart-config/config-factory').ChartWidgetConfigResult<ScatterplotWidgetData, ScatterplotConfig, "scatterplot">;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function ScatterplotSkeleton(): import("react/jsx-runtime").JSX.Element;
|