@carto/ps-react-ui 4.2.7 → 5.0.0-widgets.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 +85 -0
- package/dist/cjs-D9ro6BXv.js.map +1 -0
- package/dist/components.js +760 -1398
- package/dist/components.js.map +1 -1
- package/dist/exports-Cr43OCul.js +51 -0
- package/dist/exports-Cr43OCul.js.map +1 -0
- package/dist/lasso-tool-CYn3ivf-.js +534 -0
- package/dist/lasso-tool-CYn3ivf-.js.map +1 -0
- package/dist/options-D9wflre6.js +49 -0
- package/dist/options-D9wflre6.js.map +1 -0
- package/dist/row-C_m1ovHv.js +35 -0
- package/dist/row-C_m1ovHv.js.map +1 -0
- package/dist/series-6xp-KQ0S.js +91 -0
- package/dist/series-6xp-KQ0S.js.map +1 -0
- package/dist/smart-tooltip-BEtBaIdz.js +39 -0
- package/dist/smart-tooltip-BEtBaIdz.js.map +1 -0
- package/dist/styles-dOu_pRNb.js +77 -0
- package/dist/styles-dOu_pRNb.js.map +1 -0
- package/dist/tooltip-BDnrRKrp.js +25 -0
- package/dist/tooltip-BDnrRKrp.js.map +1 -0
- 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 +38 -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 +34 -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/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 +2 -0
- package/dist/types/widgets/actions/download/exports.d.ts +6 -0
- package/dist/types/widgets/actions/download/types.d.ts +21 -0
- package/dist/types/widgets/actions/fullscreen/fullscreen.d.ts +2 -0
- package/dist/types/widgets/actions/fullscreen/styles.d.ts +16 -0
- package/dist/types/widgets/actions/fullscreen/types.d.ts +20 -0
- package/dist/types/widgets/actions/index.d.ts +18 -0
- package/dist/types/widgets/actions/lock-selection/lock-selection.d.ts +19 -0
- package/dist/types/widgets/actions/lock-selection/types.d.ts +38 -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 +62 -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 -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 +9 -0
- 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 +15 -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 +121 -0
- package/dist/types/widgets/category/types.d.ts +33 -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 +2 -0
- package/dist/types/widgets/echart/types.d.ts +32 -0
- package/dist/types/widgets/echart/utils.d.ts +80 -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 +4 -0
- package/dist/types/widgets/formula/formula-ui.d.ts +2 -0
- package/dist/types/widgets/formula/index.d.ts +11 -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 +42 -0
- package/dist/types/widgets/histogram/config.d.ts +5 -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 +9 -0
- package/dist/types/widgets/index.d.ts +2 -1
- package/dist/types/widgets/markdown/config.d.ts +4 -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 +18 -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 +28 -0
- package/dist/types/widgets/note/types.d.ts +8 -0
- package/dist/types/widgets/pie/config.d.ts +5 -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 +9 -0
- package/dist/types/widgets/range/components/range-item.d.ts +2 -0
- package/dist/types/widgets/range/config.d.ts +6 -0
- package/dist/types/widgets/range/index.d.ts +6 -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 +33 -0
- package/dist/types/widgets/root/index.d.ts +3 -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 +9 -0
- package/dist/types/widgets/root/utils.d.ts +1 -0
- package/dist/types/widgets/scatterplot/config.d.ts +5 -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 +9 -0
- 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/selection-summary/style.d.ts +9 -0
- package/dist/types/widgets/selection-summary/types.d.ts +13 -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 +10 -0
- package/dist/types/widgets/spread/index.d.ts +9 -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 +40 -0
- package/dist/types/widgets/stores/index.d.ts +2 -0
- package/dist/types/widgets/stores/types.d.ts +233 -0
- package/dist/types/widgets/stores/widget-store.d.ts +39 -0
- package/dist/types/widgets/stores/widget-store.test.d.ts +1 -0
- 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 +11 -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 +45 -0
- package/dist/types/widgets/table/hooks/use-pagination.test.d.ts +1 -0
- package/dist/types/widgets/table/hooks/use-selection.d.ts +32 -0
- package/dist/types/widgets/table/hooks/use-selection.test.d.ts +1 -0
- package/dist/types/widgets/table/hooks/use-sort.d.ts +29 -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 +201 -0
- package/dist/types/widgets/timeseries/config.d.ts +5 -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 +9 -0
- 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/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 +89 -0
- package/dist/types/widgets/wrapper/types.d.ts +37 -0
- package/dist/types/widgets/wrapper/wrapper-ui.d.ts +2 -0
- package/dist/types/widgets/wrapper/wrapper.d.ts +2 -0
- package/dist/utils-Dv5Z47UQ.js +144 -0
- package/dist/utils-Dv5Z47UQ.js.map +1 -0
- package/dist/widget-store-DNyVElxd.js +190 -0
- package/dist/widget-store-DNyVElxd.js.map +1 -0
- package/dist/widgets/actions.js +828 -0
- package/dist/widgets/actions.js.map +1 -0
- package/dist/widgets/bar.js +192 -0
- package/dist/widgets/bar.js.map +1 -0
- package/dist/widgets/category.js +460 -0
- package/dist/widgets/category.js.map +1 -0
- package/dist/widgets/echart.js +123 -0
- package/dist/widgets/echart.js.map +1 -0
- package/dist/widgets/formula.js +124 -0
- package/dist/widgets/formula.js.map +1 -0
- package/dist/widgets/histogram.js +175 -0
- package/dist/widgets/histogram.js.map +1 -0
- package/dist/widgets/markdown.js +127 -0
- package/dist/widgets/markdown.js.map +1 -0
- package/dist/widgets/note.js +124 -0
- package/dist/widgets/note.js.map +1 -0
- package/dist/widgets/pie.js +216 -0
- package/dist/widgets/pie.js.map +1 -0
- package/dist/widgets/range.js +217 -0
- package/dist/widgets/range.js.map +1 -0
- package/dist/widgets/root.js +68 -0
- package/dist/widgets/root.js.map +1 -0
- package/dist/widgets/scatterplot.js +222 -0
- package/dist/widgets/scatterplot.js.map +1 -0
- package/dist/widgets/selection-summary.js +40 -0
- package/dist/widgets/selection-summary.js.map +1 -0
- package/dist/widgets/skeleton-loader.js +24 -0
- package/dist/widgets/skeleton-loader.js.map +1 -0
- package/dist/widgets/spread.js +166 -0
- package/dist/widgets/spread.js.map +1 -0
- 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 +691 -0
- package/dist/widgets/table.js.map +1 -0
- package/dist/widgets/timeseries.js +174 -0
- package/dist/widgets/timeseries.js.map +1 -0
- package/dist/widgets/toolbar-actions.js +6106 -0
- package/dist/widgets/toolbar-actions.js.map +1 -0
- package/dist/widgets/wrapper.js +295 -0
- package/dist/widgets/wrapper.js.map +1 -0
- package/dist/widgets.js +4 -1
- package/dist/widgets.js.map +1 -1
- package/package.json +105 -3
|
@@ -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,15 @@
|
|
|
1
|
+
import { DownloadItem } from '../actions';
|
|
2
|
+
import { ConfigProps } from '../root/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
|
+
}
|
|
14
|
+
export declare function categoryDownloadConfig({ refUI, series, }: CategoryDownloadConfigProps): DownloadItem<CategoryWidgetData>[];
|
|
15
|
+
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,121 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
2
|
+
export declare const styles: {
|
|
3
|
+
root: {
|
|
4
|
+
display: "flex";
|
|
5
|
+
flexDirection: "column";
|
|
6
|
+
position: "relative";
|
|
7
|
+
overflow: "auto";
|
|
8
|
+
};
|
|
9
|
+
list: {
|
|
10
|
+
display: "flex";
|
|
11
|
+
flexDirection: "column";
|
|
12
|
+
gap: (theme: Theme) => string;
|
|
13
|
+
};
|
|
14
|
+
row: {
|
|
15
|
+
display: "flex";
|
|
16
|
+
flexDirection: "column";
|
|
17
|
+
gap: (theme: Theme) => string;
|
|
18
|
+
pointerEvents: "none";
|
|
19
|
+
};
|
|
20
|
+
rowClickable: {
|
|
21
|
+
pointerEvents: "auto";
|
|
22
|
+
};
|
|
23
|
+
rowHeader: {
|
|
24
|
+
display: "flex";
|
|
25
|
+
justifyContent: "space-between";
|
|
26
|
+
alignItems: "center";
|
|
27
|
+
};
|
|
28
|
+
rowLabel: {
|
|
29
|
+
typography: string;
|
|
30
|
+
fontWeight: string;
|
|
31
|
+
color: "text.primary";
|
|
32
|
+
};
|
|
33
|
+
rowValue: {
|
|
34
|
+
typography: string;
|
|
35
|
+
color: "text.secondary";
|
|
36
|
+
};
|
|
37
|
+
barContainer: {
|
|
38
|
+
display: "flex";
|
|
39
|
+
flexDirection: "column";
|
|
40
|
+
};
|
|
41
|
+
bar: {
|
|
42
|
+
height: number;
|
|
43
|
+
borderRadius: number;
|
|
44
|
+
backgroundColor: (theme: Theme) => string;
|
|
45
|
+
overflow: "hidden";
|
|
46
|
+
position: "relative";
|
|
47
|
+
transition: "background-color 0.15s ease-in-out";
|
|
48
|
+
cursor: "pointer";
|
|
49
|
+
'&:hover': {
|
|
50
|
+
backgroundColor: (theme: Theme) => string;
|
|
51
|
+
'& > div': {
|
|
52
|
+
filter: "brightness(1.2)";
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
barFill: {
|
|
57
|
+
height: string;
|
|
58
|
+
borderRadius: number;
|
|
59
|
+
transition: "width 0.3s ease-in-out, background-color 0.15s ease-in-out";
|
|
60
|
+
};
|
|
61
|
+
barFillMuted: {
|
|
62
|
+
backgroundColor: (theme: Theme) => string;
|
|
63
|
+
};
|
|
64
|
+
legend: {
|
|
65
|
+
display: "flex";
|
|
66
|
+
alignItems: "center";
|
|
67
|
+
gap: (theme: Theme) => string;
|
|
68
|
+
flexWrap: "wrap";
|
|
69
|
+
paddingTop: (theme: Theme) => string;
|
|
70
|
+
position: "sticky";
|
|
71
|
+
bottom: number;
|
|
72
|
+
backgroundColor: "background.paper";
|
|
73
|
+
borderTop: (theme: Theme) => string;
|
|
74
|
+
marginTop: (theme: Theme) => string;
|
|
75
|
+
};
|
|
76
|
+
legendItem: {
|
|
77
|
+
display: "flex";
|
|
78
|
+
alignItems: "center";
|
|
79
|
+
gap: (theme: Theme) => string;
|
|
80
|
+
};
|
|
81
|
+
legendDot: {
|
|
82
|
+
width: number;
|
|
83
|
+
height: number;
|
|
84
|
+
borderRadius: string;
|
|
85
|
+
};
|
|
86
|
+
legendLabel: {
|
|
87
|
+
typography: string;
|
|
88
|
+
color: "text.secondary";
|
|
89
|
+
textTransform: "uppercase";
|
|
90
|
+
fontWeight: string;
|
|
91
|
+
};
|
|
92
|
+
multiBarRow: {
|
|
93
|
+
display: "flex";
|
|
94
|
+
alignItems: "center";
|
|
95
|
+
gap: (theme: Theme) => string;
|
|
96
|
+
};
|
|
97
|
+
multiBarValue: {
|
|
98
|
+
typography: string;
|
|
99
|
+
color: "text.secondary";
|
|
100
|
+
minWidth: number;
|
|
101
|
+
textAlign: "right";
|
|
102
|
+
};
|
|
103
|
+
multiBarContainer: {
|
|
104
|
+
flex: number;
|
|
105
|
+
};
|
|
106
|
+
otherRow: {
|
|
107
|
+
display: "flex";
|
|
108
|
+
justifyContent: "space-between";
|
|
109
|
+
alignItems: "center";
|
|
110
|
+
};
|
|
111
|
+
otherLabel: {
|
|
112
|
+
typography: string;
|
|
113
|
+
fontWeight: string;
|
|
114
|
+
color: "text.secondary";
|
|
115
|
+
fontStyle: "italic";
|
|
116
|
+
};
|
|
117
|
+
otherCount: {
|
|
118
|
+
typography: string;
|
|
119
|
+
color: "text.disabled";
|
|
120
|
+
};
|
|
121
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
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
|
+
}
|
|
33
|
+
export type CategoryDownloadConfig = DownloadItem<CategoryWidgetData>[];
|
|
@@ -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, } from './types';
|
|
4
|
+
export { getCommonOptions } from './options';
|
|
5
|
+
export { mergeEchartWidgetConfig, getEChartBrushConfig, getEChartStackConfig, getEChartZoomConfig, } from './utils';
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { EChartsOption } from 'echarts';
|
|
2
|
+
import { BaseWidgetState } from '../stores/types';
|
|
3
|
+
import { Ref } from 'react';
|
|
4
|
+
import { theme as CartoTheme } from '@carto/meridian-ds/theme';
|
|
5
|
+
import type * as echarts from 'echarts';
|
|
6
|
+
export type EchartOptionsProps = EChartsOption;
|
|
7
|
+
export interface EchartUIProps {
|
|
8
|
+
id: string;
|
|
9
|
+
option: EchartOptionsProps;
|
|
10
|
+
className?: string;
|
|
11
|
+
init?: echarts.EChartsInitOpts;
|
|
12
|
+
style?: React.CSSProperties;
|
|
13
|
+
ref?: Ref<echarts.ECharts>;
|
|
14
|
+
onEvents?: Record<string, Parameters<echarts.ECharts['on']>[2]>;
|
|
15
|
+
}
|
|
16
|
+
export interface EchartProps {
|
|
17
|
+
id: EchartUIProps['id'];
|
|
18
|
+
}
|
|
19
|
+
export type EchartWidgetData = Record<string, string | number>[][];
|
|
20
|
+
export type EchartWidgetState = BaseWidgetState<{
|
|
21
|
+
option: EchartUIProps['option'];
|
|
22
|
+
onEvents?: EchartUIProps['onEvents'];
|
|
23
|
+
init?: EchartUIProps['init'];
|
|
24
|
+
}>;
|
|
25
|
+
export interface EchartWidgetOptionProps<D> {
|
|
26
|
+
data?: D;
|
|
27
|
+
theme: typeof CartoTheme;
|
|
28
|
+
}
|
|
29
|
+
export interface EchartWidgetProps {
|
|
30
|
+
type: string;
|
|
31
|
+
option: EchartUIProps['option'];
|
|
32
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { EchartOptionsProps } from './types';
|
|
2
|
+
import { Theme } from '@mui/material';
|
|
3
|
+
export declare function mergeEchartWidgetConfig<T extends EchartOptionsProps>(...options: [T | undefined, T | undefined]): T;
|
|
4
|
+
export declare function getEChartZoomConfig(zoom: boolean, { start, end }?: {
|
|
5
|
+
start: number;
|
|
6
|
+
end: number;
|
|
7
|
+
}, { inside, xSlider, ySlider, showSliders, xAxisLabelFormatter, }?: {
|
|
8
|
+
inside?: boolean;
|
|
9
|
+
xSlider?: boolean;
|
|
10
|
+
ySlider?: boolean;
|
|
11
|
+
showSliders?: boolean;
|
|
12
|
+
xAxisLabelFormatter?: (value: number) => string;
|
|
13
|
+
}, theme?: Theme): {
|
|
14
|
+
dataZoom: ({
|
|
15
|
+
throttle: number;
|
|
16
|
+
type: string;
|
|
17
|
+
xAxisIndex: number[];
|
|
18
|
+
yAxisIndex: number[];
|
|
19
|
+
show: boolean;
|
|
20
|
+
zoomLock: boolean;
|
|
21
|
+
start: number;
|
|
22
|
+
end: number;
|
|
23
|
+
orientation?: 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
|
+
} | {
|
|
35
|
+
brushSelect: boolean;
|
|
36
|
+
moveHandleSize: number;
|
|
37
|
+
handleSize: string;
|
|
38
|
+
handleIcon: string;
|
|
39
|
+
throttle: number;
|
|
40
|
+
type: string;
|
|
41
|
+
xAxisIndex: number[];
|
|
42
|
+
bottom: number;
|
|
43
|
+
height: number;
|
|
44
|
+
show: boolean;
|
|
45
|
+
zoomLock: boolean;
|
|
46
|
+
start: number;
|
|
47
|
+
end: number;
|
|
48
|
+
labelFormatter: ((value: number) => string) | undefined;
|
|
49
|
+
showDetail: boolean;
|
|
50
|
+
yAxisIndex?: undefined;
|
|
51
|
+
orientation?: undefined;
|
|
52
|
+
} | {
|
|
53
|
+
brushSelect: boolean;
|
|
54
|
+
moveHandleSize: number;
|
|
55
|
+
handleSize: string;
|
|
56
|
+
handleIcon: string;
|
|
57
|
+
throttle: number;
|
|
58
|
+
type: string;
|
|
59
|
+
left: number;
|
|
60
|
+
width: number;
|
|
61
|
+
yAxisIndex: number[];
|
|
62
|
+
show: boolean;
|
|
63
|
+
zoomLock: boolean;
|
|
64
|
+
start: number;
|
|
65
|
+
end: number;
|
|
66
|
+
xAxisIndex?: undefined;
|
|
67
|
+
orientation?: undefined;
|
|
68
|
+
})[];
|
|
69
|
+
};
|
|
70
|
+
export declare function getEChartBrushConfig(brush: boolean): {
|
|
71
|
+
brush: {
|
|
72
|
+
brushType: string;
|
|
73
|
+
brushMode: string;
|
|
74
|
+
};
|
|
75
|
+
} | {
|
|
76
|
+
brush?: undefined;
|
|
77
|
+
};
|
|
78
|
+
export declare function getEChartStackConfig(stack: boolean, stackGroup?: string): {
|
|
79
|
+
stack: string | undefined;
|
|
80
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ConfigProps } from '../root/types';
|
|
2
|
+
import { FormulaDownloadConfig, FormulaWidgetConfig } from './types';
|
|
3
|
+
export declare function formulaDownloadConfig({ refUI, }: ConfigProps): FormulaDownloadConfig;
|
|
4
|
+
export declare function formulaConfig(): FormulaWidgetConfig;
|
|
@@ -0,0 +1,11 @@
|
|
|
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 { formulaConfig, formulaDownloadConfig } from './config';
|
|
8
|
+
export { FormulaUI } from './formula-ui';
|
|
9
|
+
export { FormulaSkeleton } from './skeleton';
|
|
10
|
+
export { sanitizeDataItem, sanitizeDataItems } from './serializer';
|
|
11
|
+
export type { DataItem, FormulaDownloadConfig, FormulaUIProps, FormulaWidgetConfig, FormulaWidgetData, FormulaWidgetState, ItemProps, RowProps, SeriesConfig, ValueProps, } from './types';
|
|
@@ -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,42 @@
|
|
|
1
|
+
import { TypographyProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
|
|
4
|
+
import { WrapperState } from '../wrapper/types';
|
|
5
|
+
import { DownloadItem } from '../actions/download/types';
|
|
6
|
+
export interface FormulaUIProps {
|
|
7
|
+
id: WidgetsStoreProps['id'];
|
|
8
|
+
}
|
|
9
|
+
export interface DataItem {
|
|
10
|
+
value: number;
|
|
11
|
+
prefix?: string | ReactNode;
|
|
12
|
+
suffix?: string | ReactNode;
|
|
13
|
+
color?: string;
|
|
14
|
+
}
|
|
15
|
+
export interface RowProps {
|
|
16
|
+
id: WidgetsStoreProps['id'];
|
|
17
|
+
children: ReactNode | ((props: {
|
|
18
|
+
index: number;
|
|
19
|
+
}) => ReactNode);
|
|
20
|
+
}
|
|
21
|
+
export interface ValueProps extends Omit<ItemProps, 'children'> {
|
|
22
|
+
id: WidgetsStoreProps['id'];
|
|
23
|
+
index?: number;
|
|
24
|
+
}
|
|
25
|
+
export interface ItemProps {
|
|
26
|
+
children: ReactNode;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
TypographyProps?: TypographyProps;
|
|
29
|
+
}
|
|
30
|
+
export type FormulaWidgetData = DataItem[];
|
|
31
|
+
export interface SeriesConfig {
|
|
32
|
+
name: string;
|
|
33
|
+
color?: string;
|
|
34
|
+
}
|
|
35
|
+
export type FormulaWidgetState = BaseWidgetState<WrapperState<FormulaWidgetConfig> & {
|
|
36
|
+
data: FormulaWidgetData;
|
|
37
|
+
}>;
|
|
38
|
+
export interface FormulaWidgetConfig {
|
|
39
|
+
formatter?: (value: number) => string;
|
|
40
|
+
series?: SeriesConfig[];
|
|
41
|
+
}
|
|
42
|
+
export type FormulaDownloadConfig = DownloadItem<FormulaWidgetData>[];
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { HistogramConfig, HistogramWidgetConfig, HistogramWidgetData } from './types';
|
|
2
|
+
import { DownloadItem } from '../actions';
|
|
3
|
+
import { ConfigProps } from '../root/types';
|
|
4
|
+
export declare function histogramDownloadConfig({ refUI, }: ConfigProps): DownloadItem<HistogramWidgetData>[];
|
|
5
|
+
export declare function histogramConfig(props: HistogramConfig): HistogramWidgetConfig;
|
|
@@ -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,9 @@
|
|
|
1
|
+
import { EchartWidgetData, EchartWidgetState } from '../echart';
|
|
2
|
+
import { EchartWidgetOptionProps, EchartWidgetProps } from '../echart/types';
|
|
3
|
+
import { ConfigProps } from '../root';
|
|
4
|
+
export type HistogramWidgetData = EchartWidgetData;
|
|
5
|
+
export type HistogramWidgetState = EchartWidgetState;
|
|
6
|
+
export type HistogramWidgetConfig = EchartWidgetProps & {
|
|
7
|
+
type: 'histogram';
|
|
8
|
+
};
|
|
9
|
+
export type HistogramConfig = ConfigProps & EchartWidgetOptionProps<HistogramWidgetData>;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {};
|
|
1
|
+
export { useWidgetStore } from './stores/widget-store';
|
|
2
|
+
export type { BaseWidgetState, WidgetsStoreProps, WidgetState, WidgetStore, WidgetStoreActions, WidgetStoreState, } from './stores/types';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { Markdown } from './markdown';
|
|
2
|
+
export { MarkdownUI } from './markdown-ui';
|
|
3
|
+
export { MarkdownSkeleton } from './skeleton';
|
|
4
|
+
export { markdownConfig, markdownDownloadConfig } from './config';
|
|
5
|
+
export type { MarkdownComponentProps, MarkdownUIProps, MarkdownWidgetData, MarkdownWidgetState, MarkdownWidgetConfig, MarkdownDownloadConfig, MarkdownDataItem, } from './types';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function MarkdownSkeleton(): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { BaseWidgetState, WidgetsStoreProps } from '../stores/types';
|
|
2
|
+
import { WrapperState } from '../wrapper/types';
|
|
3
|
+
import { DownloadItem } from '../actions/download/types';
|
|
4
|
+
import { Components } from 'react-markdown';
|
|
5
|
+
export interface MarkdownComponentProps {
|
|
6
|
+
children: string;
|
|
7
|
+
overrides?: Components;
|
|
8
|
+
}
|
|
9
|
+
export interface MarkdownUIProps {
|
|
10
|
+
id: WidgetsStoreProps['id'];
|
|
11
|
+
}
|
|
12
|
+
export interface MarkdownDataItem {
|
|
13
|
+
content: string;
|
|
14
|
+
}
|
|
15
|
+
export type MarkdownWidgetData = MarkdownDataItem;
|
|
16
|
+
export type MarkdownWidgetState = BaseWidgetState<WrapperState<MarkdownWidgetConfig>>;
|
|
17
|
+
export type MarkdownWidgetConfig = unknown;
|
|
18
|
+
export type MarkdownDownloadConfig = DownloadItem<MarkdownWidgetData>[];
|