@carto/ps-react-ui 4.3.0-widgets.0 → 5.0.0-widgets.10
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/components.js +25 -23
- 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-BC-rsMMW.js → lasso-tool-CYn3ivf-.js} +165 -183
- package/dist/lasso-tool-CYn3ivf-.js.map +1 -0
- package/dist/no-data-C54XJt13.js +61 -0
- package/dist/no-data-C54XJt13.js.map +1 -0
- package/dist/note-Clng2ej6.js +124 -0
- package/dist/note-Clng2ej6.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-Do02NQUF.js +91 -0
- package/dist/series-Do02NQUF.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-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 +5 -11
- package/dist/types/widgets/_shared/chart-config/option-builders.d.ts +3 -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 +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 +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 +121 -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 +12 -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 +8 -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 +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 +104 -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/utils-Dv5Z47UQ.js +144 -0
- package/dist/utils-Dv5Z47UQ.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 +834 -6
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/bar.js +190 -4
- package/dist/widgets/bar.js.map +1 -1
- package/dist/widgets/category.js +467 -0
- package/dist/widgets/category.js.map +1 -0
- package/dist/widgets/echart.js +120 -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 +118 -20
- package/dist/widgets/formula.js.map +1 -1
- package/dist/widgets/histogram.js +173 -4
- package/dist/widgets/histogram.js.map +1 -1
- package/dist/widgets/loader.js +57 -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 +214 -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 +220 -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 +163 -17
- 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 +683 -0
- package/dist/widgets/table.js.map +1 -0
- package/dist/widgets/timeseries.js +172 -4
- package/dist/widgets/timeseries.js.map +1 -1
- package/dist/widgets/toolbar-actions.js +6106 -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 +8 -83
- package/dist/widgets.js.map +1 -1
- package/package.json +49 -9
- 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.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,77 @@
|
|
|
1
|
+
function c(t) {
|
|
2
|
+
const n = [];
|
|
3
|
+
if (t.length > 0 && (t[0]?.length ?? 0) > 0) {
|
|
4
|
+
const o = t?.[0]?.[0] ?? {}, e = Object.keys(o);
|
|
5
|
+
n.push(e);
|
|
6
|
+
}
|
|
7
|
+
return t.forEach((o) => {
|
|
8
|
+
o.forEach((e) => {
|
|
9
|
+
const i = Object.values(e).map((r) => String(r));
|
|
10
|
+
n.push(i);
|
|
11
|
+
});
|
|
12
|
+
}), n;
|
|
13
|
+
}
|
|
14
|
+
function a(t) {
|
|
15
|
+
const n = [];
|
|
16
|
+
return n.push(["x", "y"]), t.forEach((o) => {
|
|
17
|
+
o.forEach((e) => {
|
|
18
|
+
n.push([String(e[0]), String(e[1])]);
|
|
19
|
+
});
|
|
20
|
+
}), n;
|
|
21
|
+
}
|
|
22
|
+
function l(t) {
|
|
23
|
+
return {
|
|
24
|
+
show: t,
|
|
25
|
+
icon: "circle",
|
|
26
|
+
left: 0,
|
|
27
|
+
bottom: 0,
|
|
28
|
+
orient: "horizontal",
|
|
29
|
+
type: "scroll"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
function f(t, n) {
|
|
33
|
+
return {
|
|
34
|
+
...!t && {
|
|
35
|
+
bottom: parseInt(n.spacing(3))
|
|
36
|
+
},
|
|
37
|
+
...t && {
|
|
38
|
+
bottom: parseInt(n.spacing(7))
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
function u(t) {
|
|
43
|
+
return function(n, o, e, i, r) {
|
|
44
|
+
const s = {
|
|
45
|
+
top: parseInt(t.spacing(0.5))
|
|
46
|
+
};
|
|
47
|
+
return r.contentSize[0] < r.viewSize[0] - n[0] ? s.left = n[0] : s.right = r.viewSize[0] - n[0], s;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
const p = {
|
|
51
|
+
graph: {
|
|
52
|
+
/**
|
|
53
|
+
* Common container style for chart widget skeletons
|
|
54
|
+
*/
|
|
55
|
+
container: {
|
|
56
|
+
display: "flex",
|
|
57
|
+
alignItems: "center",
|
|
58
|
+
justifyContent: "space-between",
|
|
59
|
+
flexDirection: "column",
|
|
60
|
+
gap: ({
|
|
61
|
+
spacing: t
|
|
62
|
+
}) => t(1),
|
|
63
|
+
height: ({
|
|
64
|
+
spacing: t
|
|
65
|
+
}) => t(38)
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
export {
|
|
70
|
+
l as a,
|
|
71
|
+
f as b,
|
|
72
|
+
u as c,
|
|
73
|
+
p as d,
|
|
74
|
+
c as f,
|
|
75
|
+
a as s
|
|
76
|
+
};
|
|
77
|
+
//# sourceMappingURL=styles-dOu_pRNb.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles-dOu_pRNb.js","sources":["../src/widgets/_shared/chart-config/csv-modifiers.ts","../src/widgets/_shared/chart-config/option-builders.ts","../src/widgets/_shared/skeleton/styles.ts"],"sourcesContent":["/**\n * Shared CSV export modifiers for chart widgets\n */\n\n/**\n * Flattens object array data into CSV-ready rows.\n * Used by bar, pie, histogram, and timeseries widgets.\n *\n * @param data - Array of series, where each series is an array of data objects\n * @returns CSV rows with headers and values\n */\nexport function flattenObjectArrayToCSV<T extends Record<string, unknown>>(\n data: T[][],\n): string[][] {\n const rows: string[][] = []\n\n // Add headers from first data point if available\n if (data.length > 0 && (data[0]?.length ?? 0) > 0) {\n const firstDataPoint = data?.[0]?.[0] ?? {}\n const headers = Object.keys(firstDataPoint)\n rows.push(headers)\n }\n\n // Add data rows from all series\n data.forEach((series) => {\n series.forEach((dataPoint) => {\n const values = Object.values(dataPoint).map((v) => String(v))\n rows.push(values)\n })\n })\n\n return rows\n}\n\n/**\n * Creates CSV rows for scatterplot data.\n * Scatterplot uses array format [x, y] instead of objects.\n *\n * @param data - Array of series, where each series is an array of [x, y] tuples\n * @returns CSV rows with ['x', 'y'] headers\n */\nexport function scatterplotDataToCSV(data: number[][][]): string[][] {\n const rows: string[][] = []\n\n // Add headers\n rows.push(['x', 'y'])\n\n // Add data rows from all series\n data.forEach((series) => {\n series.forEach((dataPoint) => {\n rows.push([String(dataPoint[0]), String(dataPoint[1])])\n })\n })\n\n return rows\n}\n","import type { Theme } from '@mui/material'\nimport type { LegendComponentOption } from 'echarts'\n\n/**\n * Shared EChart configuration builders for chart widgets\n */\n\n/**\n * Builds standard legend configuration for chart widgets\n *\n * @param hasLegend - Whether to show the legend\n * @returns Legend configuration object\n */\nexport function buildLegendConfig(hasLegend: boolean): LegendComponentOption {\n return {\n show: hasLegend,\n icon: 'circle' as const,\n left: 0,\n bottom: 0,\n orient: 'horizontal',\n type: 'scroll',\n }\n}\n\n/**\n * Builds standard grid configuration with legend-aware spacing\n *\n * @param hasLegend - Whether the chart has a legend\n * @param theme - MUI theme for spacing\n * @param additionalConfig - Additional grid configuration to merge\n * @returns Grid configuration object\n */\nexport function buildGridConfig(hasLegend: boolean, theme: Theme) {\n return {\n ...(!hasLegend && { bottom: parseInt(theme.spacing(3)) }),\n ...(hasLegend && { bottom: parseInt(theme.spacing(7)) }),\n }\n}\n\n/**\n * Creates a tooltip position calculator that handles overflow\n * Used by bar, histogram, and scatterplot widgets\n *\n * @param theme - MUI theme for spacing\n * @returns Tooltip position function\n */\nexport function createTooltipPositioner(theme: Theme) {\n return function (\n point: [number, number],\n _params: unknown,\n _dom: unknown,\n _rect: unknown,\n size: { contentSize: [number, number]; viewSize: [number, number] },\n ) {\n const position = { top: parseInt(theme.spacing(0.5)) } as Record<\n string,\n number\n >\n\n // Position tooltip left or right based on available space\n if (size.contentSize[0] < size.viewSize[0] - point[0]) {\n position.left = point[0]\n } else {\n position.right = size.viewSize[0] - point[0]\n }\n\n return position\n }\n}\n","import type { Theme } from '@mui/material'\n\n/**\n * Base skeleton styles shared across all chart widgets\n */\nexport const baseSkeletonStyles = {\n graph: {\n /**\n * Common container style for chart widget skeletons\n */\n container: {\n display: 'flex',\n alignItems: 'center',\n justifyContent: 'space-between',\n flexDirection: 'column',\n gap: ({ spacing }: Theme) => spacing(1),\n height: ({ spacing }: Theme) => spacing(38),\n },\n },\n} as const\n"],"names":["flattenObjectArrayToCSV","data","rows","length","firstDataPoint","headers","Object","keys","push","forEach","series","dataPoint","values","map","v","String","scatterplotDataToCSV","buildLegendConfig","hasLegend","show","icon","left","bottom","orient","type","buildGridConfig","theme","parseInt","spacing","createTooltipPositioner","point","_params","_dom","_rect","size","position","top","contentSize","viewSize","right","baseSkeletonStyles","graph","container","display","alignItems","justifyContent","flexDirection","gap","height"],"mappings":"AAWO,SAASA,EACdC,GACY;AACZ,QAAMC,IAAmB,CAAA;AAGzB,MAAID,EAAKE,SAAS,MAAMF,EAAK,CAAC,GAAGE,UAAU,KAAK,GAAG;AACjD,UAAMC,IAAiBH,IAAO,CAAC,IAAI,CAAC,KAAK,CAAA,GACnCI,IAAUC,OAAOC,KAAKH,CAAc;AAC1CF,IAAAA,EAAKM,KAAKH,CAAO;AAAA,EACnB;AAGAJ,SAAAA,EAAKQ,QAASC,CAAAA,MAAW;AACvBA,IAAAA,EAAOD,QAASE,CAAAA,MAAc;AAC5B,YAAMC,IAASN,OAAOM,OAAOD,CAAS,EAAEE,IAAKC,CAAAA,MAAMC,OAAOD,CAAC,CAAC;AAC5DZ,MAAAA,EAAKM,KAAKI,CAAM;AAAA,IAClB,CAAC;AAAA,EACH,CAAC,GAEMV;AACT;AASO,SAASc,EAAqBf,GAAgC;AACnE,QAAMC,IAAmB,CAAA;AAGzBA,SAAAA,EAAKM,KAAK,CAAC,KAAK,GAAG,CAAC,GAGpBP,EAAKQ,QAASC,CAAAA,MAAW;AACvBA,IAAAA,EAAOD,QAASE,CAAAA,MAAc;AAC5BT,MAAAA,EAAKM,KAAK,CAACO,OAAOJ,EAAU,CAAC,CAAC,GAAGI,OAAOJ,EAAU,CAAC,CAAC,CAAC,CAAC;AAAA,IACxD,CAAC;AAAA,EACH,CAAC,GAEMT;AACT;AC1CO,SAASe,EAAkBC,GAA2C;AAC3E,SAAO;AAAA,IACLC,MAAMD;AAAAA,IACNE,MAAM;AAAA,IACNC,MAAM;AAAA,IACNC,QAAQ;AAAA,IACRC,QAAQ;AAAA,IACRC,MAAM;AAAA,EAAA;AAEV;AAUO,SAASC,EAAgBP,GAAoBQ,GAAc;AAChE,SAAO;AAAA,IACL,GAAI,CAACR,KAAa;AAAA,MAAEI,QAAQK,SAASD,EAAME,QAAQ,CAAC,CAAC;AAAA,IAAA;AAAA,IACrD,GAAIV,KAAa;AAAA,MAAEI,QAAQK,SAASD,EAAME,QAAQ,CAAC,CAAC;AAAA,IAAA;AAAA,EAAE;AAE1D;AASO,SAASC,EAAwBH,GAAc;AACpD,SAAO,SACLI,GACAC,GACAC,GACAC,GACAC,GACA;AACA,UAAMC,IAAW;AAAA,MAAEC,KAAKT,SAASD,EAAME,QAAQ,GAAG,CAAC;AAAA,IAAA;AAMnD,WAAIM,EAAKG,YAAY,CAAC,IAAIH,EAAKI,SAAS,CAAC,IAAIR,EAAM,CAAC,IAClDK,EAASd,OAAOS,EAAM,CAAC,IAEvBK,EAASI,QAAQL,EAAKI,SAAS,CAAC,IAAIR,EAAM,CAAC,GAGtCK;AAAAA,EACT;AACF;AC/DO,MAAMK,IAAqB;AAAA,EAChCC,OAAO;AAAA;AAAA;AAAA;AAAA,IAILC,WAAW;AAAA,MACTC,SAAS;AAAA,MACTC,YAAY;AAAA,MACZC,gBAAgB;AAAA,MAChBC,eAAe;AAAA,MACfC,KAAKA,CAAC;AAAA,QAAEnB,SAAAA;AAAAA,MAAAA,MAAqBA,EAAQ,CAAC;AAAA,MACtCoB,QAAQA,CAAC;AAAA,QAAEpB,SAAAA;AAAAA,MAAAA,MAAqBA,EAAQ,EAAE;AAAA,IAAA;AAAA,EAC5C;AAEJ;"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { c as f } from "react/compiler-runtime";
|
|
3
|
+
import { Tooltip as c } from "@mui/material";
|
|
4
|
+
let s = 500;
|
|
5
|
+
function y(i) {
|
|
6
|
+
const t = f(10);
|
|
7
|
+
let e, o, r, l;
|
|
8
|
+
t[0] !== i ? ({
|
|
9
|
+
children: e,
|
|
10
|
+
title: l,
|
|
11
|
+
enterNextDelay: r,
|
|
12
|
+
...o
|
|
13
|
+
} = i, t[0] = i, t[1] = e, t[2] = o, t[3] = r, t[4] = l) : (e = t[1], o = t[2], r = t[3], l = t[4]);
|
|
14
|
+
const p = r === void 0 ? s : r;
|
|
15
|
+
let n;
|
|
16
|
+
return t[5] !== e || t[6] !== p || t[7] !== o || t[8] !== l ? (n = /* @__PURE__ */ a(c, { title: l, enterNextDelay: p, ...o, children: e }), t[5] = e, t[6] = p, t[7] = o, t[8] = l, t[9] = n) : n = t[9], n;
|
|
17
|
+
}
|
|
18
|
+
function D(i) {
|
|
19
|
+
s = i;
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
y as T,
|
|
23
|
+
D as s
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=tooltip-BDnrRKrp.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tooltip-BDnrRKrp.js","sources":["../src/components/tooltip/tooltip.tsx"],"sourcesContent":["import { Tooltip as MuiTooltip, type TooltipProps } from '@mui/material'\n\nlet tooltipEnterDelay = 500\n\n/**\n * A wrapper around MUI's Tooltip component with enterNextDelay set to 1000ms by default.\n *\n * This component ensures consistent tooltip behavior across the application.\n *\n * @example\n * <Tooltip title=\"This is a tooltip\">\n * <Button>Hover me</Button>\n * </Tooltip>\n */\nexport function Tooltip({\n children,\n title,\n enterNextDelay = tooltipEnterDelay,\n ...props\n}: TooltipProps) {\n return (\n <MuiTooltip title={title} enterNextDelay={enterNextDelay} {...props}>\n {children}\n </MuiTooltip>\n )\n}\n\nexport function setTooltipEnterDelay(delay: number) {\n tooltipEnterDelay = delay\n}\n"],"names":["tooltipEnterDelay","Tooltip","t0","$","_c","children","props","t1","title","enterNextDelay","undefined","t2","MuiTooltip","setTooltipEnterDelay","delay"],"mappings":";;;AAEA,IAAIA,IAAoB;AAYjB,SAAAC,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,EAAA;AAAA,MAAAC,GAAAC,GAAAC,GAAAC;AAAA,EAAAL,SAAAD,KAAiB;AAAA,IAAAG,UAAAA;AAAAA,IAAAG,OAAAA;AAAAA,IAAAC,gBAAAF;AAAAA,IAAA,GAAAD;AAAAA,EAAAA,IAAAJ,GAKTC,OAAAD,GAAAC,OAAAE,GAAAF,OAAAG,GAAAH,OAAAI,GAAAJ,OAAAK,MAAAH,IAAAF,EAAA,CAAA,GAAAG,IAAAH,EAAA,CAAA,GAAAI,IAAAJ,EAAA,CAAA,GAAAK,IAAAL,EAAA,CAAA;AAFb,QAAAM,IAAAF,MAAAG,SAAAV,IAAAO;AAAkC,MAAAI;AAAA,SAAAR,EAAA,CAAA,MAAAE,KAAAF,EAAA,CAAA,MAAAM,KAAAN,EAAA,CAAA,MAAAG,KAAAH,SAAAK,KAIhCG,sBAACC,GAAA,EAAkBJ,OAAAA,GAAuBC,gBAAAA,MAAoBH,gBAE9D,GAAaH,OAAAE,GAAAF,OAAAM,GAAAN,OAAAG,GAAAH,OAAAK,GAAAL,OAAAQ,KAAAA,IAAAR,EAAA,CAAA,GAFbQ;AAEa;AAIV,SAASE,EAAqBC,GAAe;AAClDd,EAAAA,IAAoBc;AACtB;"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook for debouncing a callback function.
|
|
3
|
+
*
|
|
4
|
+
* @param callback - The function to debounce
|
|
5
|
+
* @param delay - The delay in milliseconds (default: 300ms)
|
|
6
|
+
* @returns A debounced version of the callback
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* const debouncedSearch = useDebounce((searchText: string) => {
|
|
11
|
+
* // Perform search
|
|
12
|
+
* console.log('Searching for:', searchText)
|
|
13
|
+
* }, 300)
|
|
14
|
+
*
|
|
15
|
+
* // Call it anywhere
|
|
16
|
+
* debouncedSearch('react')
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function useDebounce<TArgs extends unknown[], TReturn = void>(callback: (...args: TArgs) => TReturn, delay?: number): (...args: TArgs) => void;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Custom hook for registering a DOM element ref with the widget store.
|
|
3
|
+
* This allows other parts of the application to access the widget's DOM element.
|
|
4
|
+
*
|
|
5
|
+
* @param widgetId - The widget ID to register the ref under
|
|
6
|
+
* @returns A ref object to attach to the DOM element
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* function MyWidget({ id }: { id: string }) {
|
|
11
|
+
* const ref = useWidgetRef<HTMLDivElement>(id)
|
|
12
|
+
*
|
|
13
|
+
* return <div ref={ref}>Widget content</div>
|
|
14
|
+
* }
|
|
15
|
+
* ```
|
|
16
|
+
*/
|
|
17
|
+
export declare function useWidgetRef<T extends HTMLElement = HTMLElement>(widgetId: string): import('react').RefObject<T | null>;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { EchartOptionsProps, EchartWidgetData
|
|
2
|
-
import { BaseConfig } from '../../config-loader';
|
|
3
|
-
import { Ref } from 'react';
|
|
1
|
+
import { EchartOptionsProps, EchartWidgetData } from '../../echart';
|
|
4
2
|
/**
|
|
5
3
|
* Base configuration interface for chart widgets
|
|
6
4
|
*/
|
|
7
|
-
export interface ChartWidgetBaseConfig<TData = EchartWidgetData>
|
|
5
|
+
export interface ChartWidgetBaseConfig<TData = EchartWidgetData> {
|
|
8
6
|
data?: TData;
|
|
9
7
|
}
|
|
10
8
|
/**
|
|
@@ -14,14 +12,12 @@ export interface CreateChartWidgetConfigParams<TData = EchartWidgetData, TConfig
|
|
|
14
12
|
/** Widget type identifier (e.g., 'bar', 'pie', 'histogram') */
|
|
15
13
|
type: TType;
|
|
16
14
|
/** Function to get EChart options from config */
|
|
17
|
-
getOptions: (config:
|
|
18
|
-
/** Function to create CSV data from widget data */
|
|
19
|
-
csvModifier: (data: TData) => string[][];
|
|
15
|
+
getOptions: (config: TConfig) => EchartOptionsProps;
|
|
20
16
|
}
|
|
21
17
|
/**
|
|
22
18
|
* Return type of the chart widget config function
|
|
23
19
|
*/
|
|
24
|
-
export type ChartWidgetConfigResult<TData = EchartWidgetData, TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>, TType extends string = string> =
|
|
20
|
+
export type ChartWidgetConfigResult<TData = EchartWidgetData, TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>, TType extends string = string> = TConfig & {
|
|
25
21
|
type: TType;
|
|
26
22
|
};
|
|
27
23
|
/**
|
|
@@ -39,6 +35,4 @@ export type ChartWidgetConfigResult<TData = EchartWidgetData, TConfig extends Ch
|
|
|
39
35
|
* })
|
|
40
36
|
* ```
|
|
41
37
|
*/
|
|
42
|
-
export declare function createChartWidgetConfig<TData = EchartWidgetData, TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>, TType extends string = string>({ type, getOptions,
|
|
43
|
-
refUI?: Ref<HTMLElement | null>;
|
|
44
|
-
}) => ChartWidgetConfigResult<TData, TConfig, TType>;
|
|
38
|
+
export declare function createChartWidgetConfig<TData = EchartWidgetData, TConfig extends ChartWidgetBaseConfig<TData> = ChartWidgetBaseConfig<TData>, TType extends string = string>({ type, getOptions, }: CreateChartWidgetConfigParams<TData, TConfig, TType>): (config: TConfig) => ChartWidgetConfigResult<TData, TConfig, TType>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Theme } from '@mui/material';
|
|
2
|
-
import {
|
|
2
|
+
import { LegendComponentOption } from 'echarts';
|
|
3
3
|
/**
|
|
4
4
|
* Shared EChart configuration builders for chart widgets
|
|
5
5
|
*/
|
|
@@ -9,12 +9,7 @@ import { GridComponentOption } from 'echarts';
|
|
|
9
9
|
* @param hasLegend - Whether to show the legend
|
|
10
10
|
* @returns Legend configuration object
|
|
11
11
|
*/
|
|
12
|
-
export declare function buildLegendConfig(hasLegend: boolean):
|
|
13
|
-
show: boolean;
|
|
14
|
-
icon: "circle";
|
|
15
|
-
left: number;
|
|
16
|
-
bottom: number;
|
|
17
|
-
};
|
|
12
|
+
export declare function buildLegendConfig(hasLegend: boolean): LegendComponentOption;
|
|
18
13
|
/**
|
|
19
14
|
* Builds standard grid configuration with legend-aware spacing
|
|
20
15
|
*
|
|
@@ -23,7 +18,7 @@ export declare function buildLegendConfig(hasLegend: boolean): {
|
|
|
23
18
|
* @param additionalConfig - Additional grid configuration to merge
|
|
24
19
|
* @returns Grid configuration object
|
|
25
20
|
*/
|
|
26
|
-
export declare function buildGridConfig(hasLegend: boolean, theme: Theme
|
|
21
|
+
export declare function buildGridConfig(hasLegend: boolean, theme: Theme): {
|
|
27
22
|
bottom?: number | undefined;
|
|
28
23
|
};
|
|
29
24
|
/**
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ChangeColumnIcon: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ChangeColumnProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Widget action to reorder columns in a table widget via drag-and-drop.
|
|
4
|
+
*
|
|
5
|
+
* This action reads the columns from the widget store and allows users to
|
|
6
|
+
* drag and drop columns to reorder them. All columns are displayed and
|
|
7
|
+
* can be reordered.
|
|
8
|
+
*
|
|
9
|
+
* Returns null if there are fewer than 2 columns.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <ChangeColumn id="my-table-widget" />
|
|
14
|
+
* ```
|
|
15
|
+
*/
|
|
16
|
+
export declare function ChangeColumn({ id, labels, Icon, IconButtonProps, MenuProps, }: ChangeColumnProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TableColumn } from '../../table/types';
|
|
2
|
+
export interface SortableColumnItemProps {
|
|
3
|
+
column: TableColumn;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* A draggable menu item for column reordering.
|
|
7
|
+
* Uses @dnd-kit/sortable for drag-and-drop functionality.
|
|
8
|
+
*/
|
|
9
|
+
export declare function SortableColumnItem({ column }: SortableColumnItemProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { IconButtonProps, MenuProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
export interface ChangeColumnProps {
|
|
4
|
+
/** Widget ID to update column configuration in the widget store */
|
|
5
|
+
id: string;
|
|
6
|
+
/** Custom labels for the action */
|
|
7
|
+
labels?: {
|
|
8
|
+
/** Tooltip label */
|
|
9
|
+
tooltip?: string;
|
|
10
|
+
/** Accessibility label */
|
|
11
|
+
ariaLabel?: string;
|
|
12
|
+
};
|
|
13
|
+
/** Props passed to the IconButton component */
|
|
14
|
+
IconButtonProps?: IconButtonProps;
|
|
15
|
+
/** Props passed to the Menu component */
|
|
16
|
+
MenuProps?: Partial<MenuProps>;
|
|
17
|
+
/** Custom icon to display */
|
|
18
|
+
Icon?: ReactNode;
|
|
19
|
+
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { DownloadProps } from './types';
|
|
2
|
-
export declare function Download({ id, labels, Icon, IconButtonProps, }: DownloadProps): import("react/jsx-runtime").JSX.Element
|
|
2
|
+
export declare function Download({ id, items, labels, Icon, IconButtonProps, }: DownloadProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { DownloadItem } from './types';
|
|
3
3
|
export declare const downloadToCSV: DownloadItem<unknown[][]>;
|
|
4
|
-
export declare const downloadToPNG: Omit<DownloadItem
|
|
4
|
+
export declare const downloadToPNG: Omit<DownloadItem, 'modifier'> & {
|
|
5
5
|
modifier: (ref: Ref<HTMLElement | null> | undefined) => Promise<string | undefined>;
|
|
6
6
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { JSX, ReactNode } from 'react';
|
|
2
|
-
import { BaseWidgetState } from '../../stores/types';
|
|
3
2
|
import { IconButtonProps } from '@mui/material';
|
|
3
|
+
import { WidgetState } from '../../stores/types';
|
|
4
4
|
export interface DownloadItem<D = unknown> {
|
|
5
5
|
id: string;
|
|
6
6
|
label: string;
|
|
@@ -10,17 +10,9 @@ export interface DownloadItem<D = unknown> {
|
|
|
10
10
|
modifier: (data: D) => Promise<string | undefined>;
|
|
11
11
|
callback?: (data: string) => void;
|
|
12
12
|
}
|
|
13
|
-
export type DownloadState<T = unknown, D = unknown> = BaseWidgetState<T & DownloadConfigProps<D>>;
|
|
14
|
-
export interface DownloadConfig<D = unknown> {
|
|
15
|
-
enabled?: boolean;
|
|
16
|
-
isDownloading: boolean;
|
|
17
|
-
items: DownloadItem<D>[];
|
|
18
|
-
}
|
|
19
|
-
export interface DownloadConfigProps<D = unknown> {
|
|
20
|
-
downloadConfig: DownloadConfig<D>;
|
|
21
|
-
}
|
|
22
13
|
export interface DownloadProps {
|
|
23
|
-
id:
|
|
14
|
+
id: WidgetState['id'];
|
|
15
|
+
items: DownloadItem[];
|
|
24
16
|
labels?: {
|
|
25
17
|
ariaLabel?: string;
|
|
26
18
|
};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import { FullScreenProps } from './types';
|
|
2
|
-
export declare function FullScreen({ id, labels, children, Icon, IconButtonProps, }: FullScreenProps): import("react/jsx-runtime").JSX.Element
|
|
2
|
+
export declare function FullScreen({ id, labels, children, Icon, IconButtonProps, DialogContentProps: { sx, ...DialogContentProps }, }: FullScreenProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { Theme } from '@mui/material';
|
|
1
2
|
export declare const styles: {
|
|
2
3
|
title: {
|
|
3
4
|
container: {
|
|
@@ -7,4 +8,9 @@ export declare const styles: {
|
|
|
7
8
|
gap: number;
|
|
8
9
|
};
|
|
9
10
|
};
|
|
11
|
+
content: {
|
|
12
|
+
display: "flex";
|
|
13
|
+
flexDirection: "column";
|
|
14
|
+
gap: ({ spacing }: Theme) => string;
|
|
15
|
+
};
|
|
10
16
|
};
|
|
@@ -1,21 +1,20 @@
|
|
|
1
|
-
import { IconButtonProps } from '@mui/material';
|
|
1
|
+
import { DialogContentProps, IconButtonProps } from '@mui/material';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
|
-
import { BaseWidgetState } from '
|
|
4
|
-
export type FullScreenState<T = unknown> = BaseWidgetState<T & FullScreenConfigProps
|
|
3
|
+
import { BaseWidgetState } from '../../../widgets/stores/types';
|
|
4
|
+
export type FullScreenState<T = unknown> = BaseWidgetState<T & FullScreenConfigProps & {
|
|
5
|
+
title: string;
|
|
6
|
+
}>;
|
|
5
7
|
export interface FullScreenConfig {
|
|
6
|
-
enabled?: boolean;
|
|
7
8
|
isFullScreen?: boolean;
|
|
8
9
|
}
|
|
9
|
-
export
|
|
10
|
-
fullScreenConfig: FullScreenConfig;
|
|
11
|
-
}
|
|
10
|
+
export type FullScreenConfigProps = FullScreenConfig;
|
|
12
11
|
export interface FullScreenProps {
|
|
13
12
|
id: FullScreenState['id'];
|
|
14
|
-
labels
|
|
15
|
-
title: string;
|
|
13
|
+
labels?: {
|
|
16
14
|
ariaLabel?: string;
|
|
17
15
|
};
|
|
18
16
|
children: ReactNode;
|
|
17
|
+
DialogContentProps?: DialogContentProps;
|
|
19
18
|
IconButtonProps?: IconButtonProps;
|
|
20
19
|
Icon?: ReactNode;
|
|
21
20
|
}
|
|
@@ -1,5 +1,18 @@
|
|
|
1
1
|
export { FullScreen } from './fullscreen/fullscreen';
|
|
2
2
|
export type { FullScreenState, FullScreenConfig } from './fullscreen/types';
|
|
3
3
|
export { Download } from './download/download';
|
|
4
|
-
export type {
|
|
4
|
+
export type { DownloadItem, DownloadProps } from './download/types';
|
|
5
5
|
export { downloadToCSV, downloadToPNG } from './download/exports';
|
|
6
|
+
export { RelativeData, RELATIVE_DATA_TOOL_ID, } from './relative-data/relative-data';
|
|
7
|
+
export type { RelativeDataProps } from './relative-data/types';
|
|
8
|
+
export { ZoomToggle } from './zoom-toggle/zoom-toggle';
|
|
9
|
+
export type { ZoomToggleProps, ZoomState, ZoomConfig, } from './zoom-toggle/types';
|
|
10
|
+
export { StackToggle } from './stack-toggle/stack-toggle';
|
|
11
|
+
export type { StackToggleProps, StackToggleState } from './stack-toggle/types';
|
|
12
|
+
export { Searcher, SEARCHER_TOOL_ID } from './searcher/searcher';
|
|
13
|
+
export { SearcherToggle } from './searcher/searcher-toggle';
|
|
14
|
+
export type { SearcherToggleProps, SearcherProps, SearcherFilterFn, SearcherState, } from './searcher/types';
|
|
15
|
+
export { ChangeColumn } from './change-column/change-column';
|
|
16
|
+
export type { ChangeColumnProps } from './change-column/types';
|
|
17
|
+
export { LockSelection, LOCK_SELECTION_TOOL_ID, } from './lock-selection/lock-selection';
|
|
18
|
+
export type { LockSelectionProps, LockSelectionState, } from './lock-selection/types';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { LockSelectionProps } from './types';
|
|
2
|
+
export declare const LOCK_SELECTION_TOOL_ID = "lock-selection";
|
|
3
|
+
/**
|
|
4
|
+
* Widget action button to lock the current selection.
|
|
5
|
+
*
|
|
6
|
+
* When locked, the widget data is filtered to only show the selected items.
|
|
7
|
+
* The button is only visible when there are selected items.
|
|
8
|
+
* Registers a transformation tool in the widget pipeline when mounted.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```tsx
|
|
12
|
+
* <LockSelection
|
|
13
|
+
* id="my-widget"
|
|
14
|
+
* order={30}
|
|
15
|
+
* selectedItems={selectedItems}
|
|
16
|
+
* />
|
|
17
|
+
* ```
|
|
18
|
+
*/
|
|
19
|
+
export declare function LockSelection({ id, selectedItems, order, labels, Icon, IconButtonProps, }: LockSelectionProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { IconButtonProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BaseWidgetState } from '../../stores/types';
|
|
4
|
+
/**
|
|
5
|
+
* Lock selection specific state properties.
|
|
6
|
+
*/
|
|
7
|
+
export interface LockSelectionStateProps {
|
|
8
|
+
/** Whether the selection is currently locked */
|
|
9
|
+
isLocked?: boolean;
|
|
10
|
+
/** The items that are locked (by name) */
|
|
11
|
+
lockedItems?: string[];
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Widget state extension for lock selection functionality.
|
|
15
|
+
* Extends the base widget state with lock-specific properties.
|
|
16
|
+
*/
|
|
17
|
+
export type LockSelectionState<T = object> = BaseWidgetState<T & LockSelectionStateProps>;
|
|
18
|
+
export interface LockSelectionProps {
|
|
19
|
+
/** Widget ID to store lock selection state */
|
|
20
|
+
id: string;
|
|
21
|
+
/** Currently selected items (by name) */
|
|
22
|
+
selectedItems: string[];
|
|
23
|
+
/** Execution order in the tool pipeline. Lower values execute first. Defaults to 30. */
|
|
24
|
+
order?: number;
|
|
25
|
+
/** Custom labels for the action */
|
|
26
|
+
labels?: {
|
|
27
|
+
/** Tooltip when unlocked (button will lock selection) */
|
|
28
|
+
lock?: string;
|
|
29
|
+
/** Tooltip when locked (button will unlock selection) */
|
|
30
|
+
unlock?: string;
|
|
31
|
+
/** Accessibility label */
|
|
32
|
+
ariaLabel?: string;
|
|
33
|
+
};
|
|
34
|
+
/** Props passed to the IconButton component */
|
|
35
|
+
IconButtonProps?: IconButtonProps;
|
|
36
|
+
/** Custom icon to display */
|
|
37
|
+
Icon?: ReactNode;
|
|
38
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { RelativeDataProps } from './types';
|
|
2
|
+
export declare const RELATIVE_DATA_TOOL_ID = "relative-data";
|
|
3
|
+
/**
|
|
4
|
+
* Widget action to toggle between relative (percentage) and absolute data display.
|
|
5
|
+
*
|
|
6
|
+
* Registers a transformation tool in the widget pipeline when mounted.
|
|
7
|
+
* When relative mode is active, transforms data to percentages via the pipeline.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <RelativeData
|
|
12
|
+
* id="my-widget"
|
|
13
|
+
* order={20}
|
|
14
|
+
* defaultIsRelative={false}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function RelativeData({ id, order, defaultIsRelative, labels, Icon, IconButtonProps, }: RelativeDataProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { IconButtonProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { BaseWidgetState } from '../../stores/types';
|
|
4
|
+
export interface RelativeDataProps {
|
|
5
|
+
/** Widget ID to update data in the widget store */
|
|
6
|
+
id: string;
|
|
7
|
+
/** Execution order in the tool pipeline. Lower values execute first. Defaults to 20. */
|
|
8
|
+
order?: number;
|
|
9
|
+
/** Initial toggle state - when true, shows relative (percentage) values */
|
|
10
|
+
defaultIsRelative?: boolean;
|
|
11
|
+
/** Custom labels for the action */
|
|
12
|
+
labels?: {
|
|
13
|
+
/** Tooltip when showing absolute values (button will switch to relative) */
|
|
14
|
+
relative?: string;
|
|
15
|
+
/** Tooltip when showing relative values (button will switch to absolute) */
|
|
16
|
+
absolute?: string;
|
|
17
|
+
/** Accessibility label */
|
|
18
|
+
ariaLabel?: string;
|
|
19
|
+
};
|
|
20
|
+
/** Props passed to the IconButton component */
|
|
21
|
+
IconButtonProps?: IconButtonProps;
|
|
22
|
+
/** Custom icon to display */
|
|
23
|
+
Icon?: ReactNode;
|
|
24
|
+
}
|
|
25
|
+
export type RelativeDataState<T = unknown> = BaseWidgetState<T & {
|
|
26
|
+
isRelative?: boolean;
|
|
27
|
+
}>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { EchartWidgetData } from '../../echart/types';
|
|
2
|
+
/**
|
|
3
|
+
* Calculates the sum of all numeric values in the data
|
|
4
|
+
*/
|
|
5
|
+
export declare function calculateTotal(data: EchartWidgetData): number;
|
|
6
|
+
/**
|
|
7
|
+
* Transforms data to relative (percentage) values
|
|
8
|
+
*/
|
|
9
|
+
export declare function toRelativeData(data: EchartWidgetData, total: number): EchartWidgetData;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SearcherToggleProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Widget action button to toggle search functionality.
|
|
4
|
+
*
|
|
5
|
+
* Stores the enabled state in the widget store using the provided id.
|
|
6
|
+
* When search is active, the button shows an active state with a light background.
|
|
7
|
+
* Use in conjunction with the Searcher component to display the search input.
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* ```tsx
|
|
11
|
+
* <SearcherToggle id="my-widget" />
|
|
12
|
+
* <Searcher
|
|
13
|
+
* id="my-widget"
|
|
14
|
+
* data={widgetData}
|
|
15
|
+
* />
|
|
16
|
+
* ```
|
|
17
|
+
*/
|
|
18
|
+
export declare function SearcherToggle({ id, defaultEnabled, labels, Icon, IconButtonProps, }: SearcherToggleProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SearcherProps } from './types';
|
|
2
|
+
export declare const SEARCHER_TOOL_ID = "searcher";
|
|
3
|
+
/**
|
|
4
|
+
* Search input component that works with SearcherToggle.
|
|
5
|
+
*
|
|
6
|
+
* Registers a transformation tool in the widget pipeline when mounted.
|
|
7
|
+
* Reads the enabled state from the widget store using the provided id.
|
|
8
|
+
* Uses a debounced search to filter data via the transformation pipeline.
|
|
9
|
+
* Auto-focuses when enabled becomes true.
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* ```tsx
|
|
13
|
+
* <SearcherToggle id="my-widget" />
|
|
14
|
+
* <Searcher
|
|
15
|
+
* id="my-widget"
|
|
16
|
+
* order={10}
|
|
17
|
+
* labels={{ placeholder: 'Search categories...' }}
|
|
18
|
+
* />
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
export declare function Searcher({ id, filterFn, order, labels, TextFieldProps, ClearIcon, debounceDelay, }: SearcherProps): import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { IconButtonProps, TextFieldProps } from '@mui/material';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
3
|
+
import { EchartWidgetData } from '../../echart/types';
|
|
4
|
+
import { BaseWidgetState } from '../../stores/types';
|
|
5
|
+
/**
|
|
6
|
+
* Filter function type for custom search filtering logic.
|
|
7
|
+
* Receives the original data and search text, returns filtered data.
|
|
8
|
+
* Can be synchronous or asynchronous to support remote filtering.
|
|
9
|
+
*/
|
|
10
|
+
export type SearcherFilterFn = (data: EchartWidgetData, searchText: string) => Promise<EchartWidgetData> | EchartWidgetData;
|
|
11
|
+
/**
|
|
12
|
+
* Searcher-specific state properties.
|
|
13
|
+
*/
|
|
14
|
+
export interface SearcherStateProps {
|
|
15
|
+
/** Whether search is currently enabled */
|
|
16
|
+
isSearchEnabled?: boolean;
|
|
17
|
+
/** Current search text */
|
|
18
|
+
searchText?: string;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Widget state extension for searcher functionality.
|
|
22
|
+
* Extends the base widget state with search-specific properties.
|
|
23
|
+
*/
|
|
24
|
+
export type SearcherState<T = object> = BaseWidgetState<T & SearcherStateProps>;
|
|
25
|
+
export interface SearcherToggleProps {
|
|
26
|
+
/** Widget ID to store search enabled state */
|
|
27
|
+
id: string;
|
|
28
|
+
/** Initial search enabled state. Defaults to false */
|
|
29
|
+
defaultEnabled?: boolean;
|
|
30
|
+
/** Custom labels for the action */
|
|
31
|
+
labels?: {
|
|
32
|
+
/** Tooltip when search is disabled (button will enable search) */
|
|
33
|
+
enable?: string;
|
|
34
|
+
/** Tooltip when search is enabled (button will disable search) */
|
|
35
|
+
disable?: string;
|
|
36
|
+
/** Accessibility label */
|
|
37
|
+
ariaLabel?: string;
|
|
38
|
+
};
|
|
39
|
+
/** Props passed to the IconButton component */
|
|
40
|
+
IconButtonProps?: IconButtonProps;
|
|
41
|
+
/** Custom icon to display */
|
|
42
|
+
Icon?: ReactNode;
|
|
43
|
+
}
|
|
44
|
+
export interface SearcherProps {
|
|
45
|
+
/** Widget ID to update filtered data in the widget store */
|
|
46
|
+
id: string;
|
|
47
|
+
/** Custom filter function. Defaults to case-insensitive search across all string fields */
|
|
48
|
+
filterFn?: SearcherFilterFn;
|
|
49
|
+
/** Execution order in the tool pipeline. Lower values execute first. Defaults to 10. */
|
|
50
|
+
order?: number;
|
|
51
|
+
/** Custom labels for the searcher input */
|
|
52
|
+
labels?: {
|
|
53
|
+
/** Placeholder text for the input */
|
|
54
|
+
placeholder?: string;
|
|
55
|
+
/** Accessibility label for clear button */
|
|
56
|
+
clearAriaLabel?: string;
|
|
57
|
+
};
|
|
58
|
+
/** Props passed to the TextField component */
|
|
59
|
+
TextFieldProps?: Omit<TextFieldProps, 'value' | 'onChange' | 'size'>;
|
|
60
|
+
/** Custom icon for clear button */
|
|
61
|
+
ClearIcon?: ReactNode;
|
|
62
|
+
/** Debounce delay in milliseconds for search input. Defaults to 300ms */
|
|
63
|
+
debounceDelay?: number;
|
|
64
|
+
}
|