@carto/ps-react-ui 5.0.0-widgets.8 → 5.0.0-widgets.9
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/{error-G3sy6lw3.js → error-B2IJ9d2h.js} +2 -2
- package/dist/{error-G3sy6lw3.js.map → error-B2IJ9d2h.js.map} +1 -1
- package/dist/markdown-ui-CpNYUPqC.js +68 -0
- package/dist/markdown-ui-CpNYUPqC.js.map +1 -0
- package/dist/{no-data-DfkC_Kc_.js → no-data-C54XJt13.js} +2 -2
- package/dist/{no-data-DfkC_Kc_.js.map → no-data-C54XJt13.js.map} +1 -1
- package/dist/row-DLKZN5aF.js +33 -0
- package/dist/row-DLKZN5aF.js.map +1 -0
- package/dist/{row-B9hTUitn.js → row-DrHwXNvF.js} +2 -2
- package/dist/{row-B9hTUitn.js.map → row-DrHwXNvF.js.map} +1 -1
- package/dist/series-Cf1QPZHV.js +83 -0
- package/dist/series-Cf1QPZHV.js.map +1 -0
- package/dist/{series-DojKkd_o.js → series-Do02NQUF.js} +3 -3
- package/dist/{series-DojKkd_o.js.map → series-Do02NQUF.js.map} +1 -1
- package/dist/styles-CcC5L2cr.js +77 -0
- package/dist/styles-CcC5L2cr.js.map +1 -0
- package/dist/types/widgets/markdown/types.d.ts +1 -1
- package/dist/types/widgets/table/hooks/use-selection.d.ts +3 -3
- package/dist/types/widgets/table/hooks/use-sort.d.ts +1 -5
- package/dist/types/widgets/table/types.d.ts +2 -2
- package/dist/utils-DNtU8q7E.js +144 -0
- package/dist/utils-DNtU8q7E.js.map +1 -0
- package/dist/{widget-store-Dd7_sWZT.js → widget-store-CB6Trp_0.js} +31 -32
- package/dist/{widget-store-Dd7_sWZT.js.map → widget-store-CB6Trp_0.js.map} +1 -1
- package/dist/widget-store-yDO2ul8g.js +44 -0
- package/dist/widget-store-yDO2ul8g.js.map +1 -0
- package/dist/widgets/actions.js +448 -441
- package/dist/widgets/actions.js.map +1 -1
- package/dist/widgets/bar.js +1 -1
- package/dist/widgets/category.js +1 -1
- package/dist/widgets/echart.js +1 -1
- package/dist/widgets/error.js +1 -1
- package/dist/widgets/formula.js +3 -3
- package/dist/widgets/histogram.js +1 -1
- package/dist/widgets/markdown.js +1 -1
- package/dist/widgets/no-data.js +1 -1
- package/dist/widgets/pie.js +1 -1
- package/dist/widgets/range.js +2 -2
- package/dist/widgets/root.js +1 -1
- package/dist/widgets/scatterplot.js +1 -1
- package/dist/widgets/skeleton-loader.js +1 -1
- package/dist/widgets/spread.js +3 -3
- package/dist/widgets/stores.js +1 -1
- package/dist/widgets/table.js +491 -503
- package/dist/widgets/table.js.map +1 -1
- package/dist/widgets/timeseries.js +1 -1
- package/dist/widgets/wrapper.js +1 -1
- package/dist/widgets.js +3 -3
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as d, jsxs as a } from "react/jsx-runtime";
|
|
2
2
|
import { c as f } from "react/compiler-runtime";
|
|
3
3
|
import { AlertTitle as m, Alert as h } from "@mui/material";
|
|
4
|
-
import { u } from "./widget-store-
|
|
4
|
+
import { u } from "./widget-store-CB6Trp_0.js";
|
|
5
5
|
import { useShallow as p } from "zustand/shallow";
|
|
6
6
|
function W(g) {
|
|
7
7
|
const r = f(7), {
|
|
@@ -35,4 +35,4 @@ function W(g) {
|
|
|
35
35
|
export {
|
|
36
36
|
W
|
|
37
37
|
};
|
|
38
|
-
//# sourceMappingURL=error-
|
|
38
|
+
//# sourceMappingURL=error-B2IJ9d2h.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"error-
|
|
1
|
+
{"version":3,"file":"error-B2IJ9d2h.js","sources":["../src/widgets/error/error.tsx"],"sourcesContent":["import { Alert, AlertTitle } from '@mui/material'\nimport { useWidgetStore } from '../stores/widget-store'\nimport { useShallow } from 'zustand/shallow'\nimport type { WidgetErrorProps } from './types'\n\nexport function WidgetError({ id, children }: WidgetErrorProps) {\n const widget = useWidgetStore(\n useShallow((state) => {\n const w = state.widgets[id]\n return {\n isLoading: w?.isLoading,\n isFetching: w?.isFetching,\n error: w?.error,\n }\n }),\n )\n\n // Don't show error during loading/fetching states\n if (widget?.isLoading || widget?.isFetching) {\n return children\n }\n\n // Show error UI if error exists\n if (widget?.error) {\n const errorTitle = widget.error.title ?? 'Error'\n const errorMessage =\n widget.error.message ??\n 'An error occurred while loading the widget. Please try again.'\n\n return (\n <Alert severity='error'>\n <AlertTitle>{errorTitle}</AlertTitle>\n {errorMessage}\n </Alert>\n )\n }\n\n // No error, render children\n return children\n}\n"],"names":["WidgetError","t0","$","_c","id","children","t1","state","w","widgets","isLoading","isFetching","error","widget","useWidgetStore","useShallow","errorTitle","title","errorMessage","message","t2","AlertTitle","t3","jsxs","Alert"],"mappings":";;;;;AAKO,SAAAA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA,GAAqB;AAAA,IAAAC,IAAAA;AAAAA,IAAAC,UAAAA;AAAAA,EAAAA,IAAAJ;AAAkC,MAAAK;AAAA,EAAAJ,SAAAE,KAE/CE,IAAAC,CAAAA,MAAA;AACT,UAAAC,IAAUD,EAAKE,QAASL,CAAE;AAAC,WACpB;AAAA,MAAAM,WACMF,GAACE;AAAAA,MAAWC,YACXH,GAACG;AAAAA,MAAYC,OAClBJ,GAACI;AAAAA,IAAAA;AAAAA,EACT,GACFV,OAAAE,GAAAF,OAAAI,KAAAA,IAAAJ,EAAA,CAAA;AARH,QAAAW,IAAeC,EACbC,EAAWT,CAOV,CACH;AAGA,MAAIO,GAAMH,aAAeG,GAAMF;AAAY,WAClCN;AAIT,MAAIQ,GAAMD,OAAO;AACf,UAAAI,IAAmBH,EAAMD,MAAMK,SAAZ,SACnBC,IACEL,EAAMD,MAAMO,WAAZ;AAC+D,QAAAC;AAAA,IAAAlB,SAAAc,KAI7DI,sBAACC,kBAAuB,GAAanB,OAAAc,GAAAd,OAAAkB,KAAAA,IAAAlB,EAAA,CAAA;AAAA,QAAAoB;AAAA,WAAApB,EAAA,CAAA,MAAAgB,KAAAhB,SAAAkB,KADvCE,IAAA,gBAAAC,EAACC,GAAA,EAAe,UAAA,SACdJ,UAAAA;AAAAA,MAAAA;AAAAA,MACCF;AAAAA,IAAAA,GACH,GAAQhB,OAAAgB,GAAAhB,OAAAkB,GAAAlB,OAAAoB,KAAAA,IAAApB,EAAA,CAAA,GAHRoB;AAAAA,EAGQ;AAEX,SAGMjB;AAAQ;"}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as m } from "react/compiler-runtime";
|
|
3
|
+
import { ListItem as c, List as p, Link as d, Typography as a } from "@mui/material";
|
|
4
|
+
import h from "react-markdown";
|
|
5
|
+
const s = {
|
|
6
|
+
li: {
|
|
7
|
+
display: "list-item",
|
|
8
|
+
paddingTop: 0,
|
|
9
|
+
paddingBottom: 0
|
|
10
|
+
},
|
|
11
|
+
ul: {
|
|
12
|
+
listStyleType: "disc",
|
|
13
|
+
paddingLeft: ({
|
|
14
|
+
spacing: t
|
|
15
|
+
}) => t(2)
|
|
16
|
+
},
|
|
17
|
+
ol: {
|
|
18
|
+
listStyleType: "decimal",
|
|
19
|
+
paddingLeft: ({
|
|
20
|
+
spacing: t
|
|
21
|
+
}) => t(2)
|
|
22
|
+
}
|
|
23
|
+
}, u = {
|
|
24
|
+
h1: ({
|
|
25
|
+
children: t
|
|
26
|
+
}) => /* @__PURE__ */ r(a, { variant: "h4", gutterBottom: !0, color: "inherit", children: t }),
|
|
27
|
+
h2: ({
|
|
28
|
+
children: t
|
|
29
|
+
}) => /* @__PURE__ */ r(a, { variant: "h5", gutterBottom: !0, color: "inherit", children: t }),
|
|
30
|
+
h3: ({
|
|
31
|
+
children: t
|
|
32
|
+
}) => /* @__PURE__ */ r(a, { variant: "h6", gutterBottom: !0, color: "inherit", children: t }),
|
|
33
|
+
p: ({
|
|
34
|
+
children: t
|
|
35
|
+
}) => /* @__PURE__ */ r(a, { paragraph: !0, color: "inherit", children: t }),
|
|
36
|
+
a: ({
|
|
37
|
+
children: t,
|
|
38
|
+
href: o,
|
|
39
|
+
target: i = "_blank",
|
|
40
|
+
rel: n = "noopener noreferrer"
|
|
41
|
+
}) => /* @__PURE__ */ r(d, { href: o, target: i, rel: n, children: t }),
|
|
42
|
+
ul: ({
|
|
43
|
+
children: t
|
|
44
|
+
}) => /* @__PURE__ */ r(p, { sx: s.ul, children: t }),
|
|
45
|
+
ol: ({
|
|
46
|
+
children: t
|
|
47
|
+
}) => /* @__PURE__ */ r(p, { component: "ol", sx: s.ol, children: t }),
|
|
48
|
+
li: ({
|
|
49
|
+
children: t
|
|
50
|
+
}) => /* @__PURE__ */ r(c, { sx: s.li, children: t })
|
|
51
|
+
};
|
|
52
|
+
function L(t) {
|
|
53
|
+
const o = m(5), {
|
|
54
|
+
children: i,
|
|
55
|
+
overrides: n
|
|
56
|
+
} = t;
|
|
57
|
+
let e;
|
|
58
|
+
o[0] !== n ? (e = {
|
|
59
|
+
...u,
|
|
60
|
+
...n
|
|
61
|
+
}, o[0] = n, o[1] = e) : e = o[1];
|
|
62
|
+
let l;
|
|
63
|
+
return o[2] !== i || o[3] !== e ? (l = /* @__PURE__ */ r(h, { components: e, children: i }), o[2] = i, o[3] = e, o[4] = l) : l = o[4], l;
|
|
64
|
+
}
|
|
65
|
+
export {
|
|
66
|
+
L as M
|
|
67
|
+
};
|
|
68
|
+
//# sourceMappingURL=markdown-ui-CpNYUPqC.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markdown-ui-CpNYUPqC.js","sources":["../src/widgets/markdown/style.ts","../src/widgets/markdown/markdown-ui.tsx"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material'\n\nexport const styles: Record<string, SxProps<Theme>> = {\n container: {\n display: 'flex',\n flexDirection: 'column',\n gap: ({ spacing }) => spacing(2),\n },\n markdown: {\n overflow: 'hidden',\n typography: ({ typography }) => ({\n ...typography.body1,\n }),\n },\n li: {\n display: 'list-item',\n paddingTop: 0,\n paddingBottom: 0,\n },\n ul: {\n listStyleType: 'disc',\n paddingLeft: ({ spacing }) => spacing(2),\n },\n ol: {\n listStyleType: 'decimal',\n paddingLeft: ({ spacing }) => spacing(2),\n },\n}\n","import { Link, List, ListItem, Typography } from '@mui/material'\nimport ReactMarkdown, { type Components } from 'react-markdown'\nimport { styles } from '../markdown/style'\nimport type { MarkdownComponentProps } from './types'\n\nconst COMPONENTS: Components = {\n h1: ({ children }) => (\n <Typography variant='h4' gutterBottom color='inherit'>\n {children}\n </Typography>\n ),\n h2: ({ children }) => (\n <Typography variant='h5' gutterBottom color='inherit'>\n {children}\n </Typography>\n ),\n h3: ({ children }) => (\n <Typography variant='h6' gutterBottom color='inherit'>\n {children}\n </Typography>\n ),\n p: ({ children }) => (\n <Typography paragraph color='inherit'>\n {children}\n </Typography>\n ),\n a: ({ children, href, target = '_blank', rel = 'noopener noreferrer' }) => (\n <Link href={href} target={target} rel={rel}>\n {children}\n </Link>\n ),\n ul: ({ children }) => <List sx={styles.ul}>{children}</List>,\n ol: ({ children }) => (\n <List component='ol' sx={styles.ol}>\n {children}\n </List>\n ),\n li: ({ children }) => <ListItem sx={styles.li}>{children}</ListItem>,\n}\n\nexport function MarkdownUI({ children, overrides }: MarkdownComponentProps) {\n return (\n <ReactMarkdown\n components={{\n ...COMPONENTS,\n ...overrides,\n }}\n >\n {children}\n </ReactMarkdown>\n )\n}\n"],"names":["styles","li","display","paddingTop","paddingBottom","ul","listStyleType","paddingLeft","spacing","ol","COMPONENTS","h1","children","Typography","h2","h3","p","jsx","a","href","target","rel","Link","List","ListItem","MarkdownUI","t0","$","_c","overrides","t1","t2","ReactMarkdown"],"mappings":";;;;AAEO,MAAMA,IAAyC;AAAA,EAYpDC,IAAI;AAAA,IACFC,SAAS;AAAA,IACTC,YAAY;AAAA,IACZC,eAAe;AAAA,EAAA;AAAA,EAEjBC,IAAI;AAAA,IACFC,eAAe;AAAA,IACfC,aAAaA,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,GACH;AAAA,EAEFX,IAAIA,CAAC;AAAA,IAAEW,UAAAA;AAAAA,EAAAA,MAAe,gBAAAK,EAACO,GAAA,EAAS,IAAIxB,EAAOC,IAAKW,UAAAA,EAAAA,CAAS;AAC3D;AAEO,SAAAa,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA,GAAoB;AAAA,IAAAhB,UAAAA;AAAAA,IAAAiB,WAAAA;AAAAA,EAAAA,IAAAH;AAA+C,MAAAI;AAAA,EAAAH,SAAAE,KAGxDC,IAAA;AAAA,IAAA,GACPpB;AAAAA,IAAU,GACVmB;AAAAA,EAAAA,GACJF,OAAAE,GAAAF,OAAAG,KAAAA,IAAAH,EAAA,CAAA;AAAA,MAAAI;AAAA,SAAAJ,EAAA,CAAA,MAAAf,KAAAe,SAAAG,KAJHC,IAAA,gBAAAd,EAACe,GAAA,EACa,YAAAF,GAKXlB,UAAAA,GACH,GAAgBe,OAAAf,GAAAe,OAAAG,GAAAH,OAAAI,KAAAA,IAAAJ,EAAA,CAAA,GAPhBI;AAOgB;"}
|
|
@@ -2,7 +2,7 @@ import { jsx as g, jsxs as h } from "react/jsx-runtime";
|
|
|
2
2
|
import { c as x } from "react/compiler-runtime";
|
|
3
3
|
import { Typography as y, Box as v } from "@mui/material";
|
|
4
4
|
import { useShallow as w } from "zustand/shallow";
|
|
5
|
-
import { u as b } from "./widget-store-
|
|
5
|
+
import { u as b } from "./widget-store-CB6Trp_0.js";
|
|
6
6
|
const j = {
|
|
7
7
|
root: {
|
|
8
8
|
display: "flex",
|
|
@@ -58,4 +58,4 @@ function A(i) {
|
|
|
58
58
|
export {
|
|
59
59
|
k as W
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=no-data-
|
|
61
|
+
//# sourceMappingURL=no-data-C54XJt13.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"no-data-
|
|
1
|
+
{"version":3,"file":"no-data-C54XJt13.js","sources":["../src/widgets/no-data/style.ts","../src/widgets/no-data/no-data.tsx"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material'\n\n/**\n * Styles for NoData component matching Figma design specifications\n * Design reference: node 5781-11028\n */\nexport const styles: Record<string, SxProps<Theme>> = {\n root: {\n display: 'flex',\n flexDirection: 'column',\n gap: 1, // 8px\n paddingTop: 1, // 8px\n paddingBottom: 2, // 16px\n paddingX: 2, // 16px\n width: '100%',\n minHeight: '100%',\n },\n}\n","import { Box, Typography } from '@mui/material'\nimport { useShallow } from 'zustand/shallow'\nimport { useWidgetStore } from '../stores/widget-store'\nimport type { WidgetNoDataProps } from './types'\nimport { styles } from './style'\n\n/**\n * NoData wrapper component that displays empty state UI when widget has no data\n *\n * Integrates with widget store to check loading/fetching state and data availability.\n * Works in conjunction with SkeletonLoader for complete loading/empty state handling.\n *\n * @example Basic usage\n * ```tsx\n * <NoData id=\"my-widget\">\n * <WidgetContent id=\"my-widget\" />\n * </NoData>\n * ```\n *\n * @example With SkeletonLoader\n * ```tsx\n * <SkeletonLoader id=\"my-widget\" Skeleton={MySkeleton}>\n * <NoData id=\"my-widget\">\n * <WidgetContent id=\"my-widget\" />\n * </NoData>\n * </SkeletonLoader>\n * ```\n *\n * @example With custom messages\n * ```tsx\n * <NoData\n * id=\"my-widget\"\n * title=\"No results found\"\n * description=\"Try adjusting your filters\"\n * >\n * <WidgetContent id=\"my-widget\" />\n * </NoData>\n * ```\n */\nexport function WidgetNoData({\n id,\n children,\n title = 'No data available',\n description = 'There are no results for the combination of filters applied to your data. Try tweaking your filters, or zoom and pan the map to adjust filters',\n isEmpty = defaultIsEmpty,\n}: WidgetNoDataProps) {\n // Subscribe to widget store with selective subscription for optimal performance\n const widget = useWidgetStore(\n useShallow((state) => {\n const w = state.widgets[id]\n return {\n isLoading: w?.isLoading,\n isFetching: w?.isFetching,\n data: w?.data,\n }\n }),\n )\n\n // If loading or fetching, show children\n // SkeletonLoader handles loading state, this allows proper composition\n if (widget?.isLoading || widget?.isFetching) {\n return children\n }\n\n // Check if data is empty\n if (isEmpty(widget?.data)) {\n return (\n <Box sx={styles.root}>\n <Typography variant='body2' color='text.primary'>\n {title}\n </Typography>\n <Typography variant='caption' color='text.secondary'>\n {description}\n </Typography>\n </Box>\n )\n }\n\n // Data exists, render children\n return children\n}\n\n/**\n * Default function to determine if data is empty\n * Handles various data structures commonly used in widgets\n */\nfunction defaultIsEmpty(data: unknown): boolean {\n // Null or undefined\n if (data == null) {\n return true\n }\n\n // Arrays (most common case)\n if (Array.isArray(data)) {\n // Empty array\n if (data.length === 0) {\n return true\n }\n\n // Array of arrays (CategoryWidget pattern: [[],[]])\n // Check if all inner arrays are empty\n if (data.every((item) => Array.isArray(item) && item.length === 0)) {\n return true\n }\n\n return false\n }\n\n // Objects\n if (typeof data === 'object') {\n return Object.keys(data).length === 0\n }\n\n // Primitives (numbers, strings, booleans) are considered valid data\n return false\n}\n"],"names":["styles","root","display","flexDirection","gap","paddingTop","paddingBottom","paddingX","width","minHeight","WidgetNoData","t0","$","_c","id","children","title","t1","description","t2","isEmpty","t3","undefined","defaultIsEmpty","t4","state","w","widgets","isLoading","isFetching","data","widget","useWidgetStore","useShallow","t5","Typography","t6","t7","Box","Array","isArray","length","every","item","Object","keys"],"mappings":";;;;;AAMO,MAAMA,IAAyC;AAAA,EACpDC,MAAM;AAAA,IACJC,SAAS;AAAA,IACTC,eAAe;AAAA,IACfC,KAAK;AAAA;AAAA,IACLC,YAAY;AAAA;AAAA,IACZC,eAAe;AAAA;AAAA,IACfC,UAAU;AAAA;AAAA,IACVC,OAAO;AAAA,IACPC,WAAW;AAAA,EAAA;AAEf;ACsBO,SAAAC,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA,GAAsB;AAAA,IAAAC,IAAAA;AAAAA,IAAAC,UAAAA;AAAAA,IAAAC,OAAAC;AAAAA,IAAAC,aAAAC;AAAAA,IAAAC,SAAAC;AAAAA,EAAAA,IAAAV,GAG3BK,IAAAC,MAAAK,SAAA,sBAAAL,GACAC,I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A,MAASJ,MAAMC,QAAQG,CAAI,KAAKA,EAAKF,WAAW,CAAC,KAQ/D,OAAOX,KAAS,WACXc,OAAOC,KAAKf,CAAI,EAAEW,WAAW,IAI/B;AACT;"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import { c as o } from "react/compiler-runtime";
|
|
3
|
+
import { Box as l } from "@mui/material";
|
|
4
|
+
import { a as d } from "./widget-store-yDO2ul8g.js";
|
|
5
|
+
const c = {
|
|
6
|
+
item: {
|
|
7
|
+
'&[data-disabled="true"]': {
|
|
8
|
+
color: (t) => t.palette.text.disabled
|
|
9
|
+
}
|
|
10
|
+
},
|
|
11
|
+
row: {
|
|
12
|
+
display: "flex",
|
|
13
|
+
alignItems: "center",
|
|
14
|
+
gap: (t) => t.spacing(1),
|
|
15
|
+
"& + &": {
|
|
16
|
+
marginTop: (t) => t.spacing(1)
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
};
|
|
20
|
+
function x(t) {
|
|
21
|
+
const e = o(3), a = d(t.id);
|
|
22
|
+
if (!a)
|
|
23
|
+
return null;
|
|
24
|
+
let i;
|
|
25
|
+
return e[0] !== t || e[1] !== a.data ? (i = a.data?.map((s, n) => /* @__PURE__ */ r(l, { sx: c.row, children: typeof t.children == "function" ? t.children({
|
|
26
|
+
index: n
|
|
27
|
+
}) : t.children }, n)), e[0] = t, e[1] = a.data, e[2] = i) : i = e[2], i;
|
|
28
|
+
}
|
|
29
|
+
export {
|
|
30
|
+
x as R,
|
|
31
|
+
c as s
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=row-DLKZN5aF.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"row-DLKZN5aF.js","sources":["../src/widgets/formula/style.ts","../src/widgets/formula/components/row.tsx"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n root: {\n display: 'flex',\n flexDirection: 'column',\n gap: (theme: Theme) => theme.spacing(2),\n },\n item: {\n '&[data-disabled=\"true\"]': {\n color: (theme: Theme) => theme.palette.text.disabled,\n },\n },\n row: {\n display: 'flex',\n alignItems: 'center',\n gap: (theme: Theme) => theme.spacing(1),\n\n '& + &': {\n marginTop: (theme: Theme) => theme.spacing(1),\n },\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { Box } from '@mui/material'\nimport { styles } from '../style'\nimport type { FormulaWidgetState, RowProps } from '../types'\nimport { useWidget } from '../../stores/widget-store'\n\nexport function Row(props: RowProps) {\n const widget = useWidget<FormulaWidgetState>(props.id)\n\n if (!widget) {\n return null\n }\n\n return widget.data?.map((_, index) => {\n return (\n <Box sx={styles.row} key={index}>\n {typeof props.children === 'function'\n ? props.children({ index })\n : props.children}\n </Box>\n )\n })\n}\n"],"names":["styles","item","color","theme","palette","text","disabled","row","display","alignItems","gap","spacing","marginTop","Row","props","$","_c","widget","useWidget","id","t0","data","map","_","index","jsx","Box","children"],"mappings":";;;;AAEO,MAAMA,IAAS;AAAA,EAMpBC,MAAM;AAAA,IACJ,2BAA2B;AAAA,MACzBC,OAAOA,CAACC,MAAiBA,EAAMC,QAAQC,KAAKC;AAAAA,IAAAA;AAAAA,EAC9C;AAAA,EAEFC,KAAK;AAAA,IACHC,SAAS;AAAA,IACTC,YAAY;AAAA,IACZC,KAAKA,CAACP,MAAiBA,EAAMQ,QAAQ,CAAC;AAAA,IAEtC,SAAS;AAAA,MACPC,WAAWA,CAACT,MAAiBA,EAAMQ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAC9C;AAEJ;ACjBO,SAAAE,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA,GACLC,IAAeC,EAA8BJ,EAAKK,EAAG;AAErD,MAAI,CAACF;AAAM,WACF;AACR,MAAAG;AAAA,SAAAL,SAAAD,KAAAC,EAAA,CAAA,MAAAE,EAAAI,QAEMD,IAAAH,EAAMI,MAAUC,IAAC,CAAAC,GAAAC,MAEpB,gBAAAC,EAACC,GAAA,EAAQ,IAAA1B,EAAMO,KACZ,UAAA,OAAOO,EAAKa,YAAc,aACvBb,EAAKa,SAAU;AAAA,IAAAH,OAAAA;AAAAA,EAAAA,CACF,IAAbV,EAAKa,SAAAA,GAHeH,CAI1B,CAEH,GAACT,OAAAD,GAAAC,EAAA,CAAA,IAAAE,EAAAI,MAAAN,OAAAK,KAAAA,IAAAL,EAAA,CAAA,GARKK;AAQL;"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as d } from "react/jsx-runtime";
|
|
2
2
|
import { c as n } from "react/compiler-runtime";
|
|
3
3
|
import { Box as c } from "@mui/material";
|
|
4
|
-
import { u as m } from "./widget-store-
|
|
4
|
+
import { u as m } from "./widget-store-CB6Trp_0.js";
|
|
5
5
|
import { useShallow as s } from "zustand/shallow";
|
|
6
6
|
const f = {
|
|
7
7
|
item: {
|
|
@@ -32,4 +32,4 @@ export {
|
|
|
32
32
|
y as R,
|
|
33
33
|
f as s
|
|
34
34
|
};
|
|
35
|
-
//# sourceMappingURL=row-
|
|
35
|
+
//# sourceMappingURL=row-DrHwXNvF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"row-
|
|
1
|
+
{"version":3,"file":"row-DrHwXNvF.js","sources":["../src/widgets/formula/style.ts","../src/widgets/formula/components/row.tsx"],"sourcesContent":["import type { SxProps, Theme } from '@mui/material'\n\nexport const styles = {\n root: {\n display: 'flex',\n flexDirection: 'column',\n gap: (theme: Theme) => theme.spacing(2),\n },\n item: {\n '&[data-disabled=\"true\"]': {\n color: (theme: Theme) => theme.palette.text.disabled,\n },\n },\n row: {\n display: 'flex',\n alignItems: 'center',\n gap: (theme: Theme) => theme.spacing(1),\n\n '& + &': {\n marginTop: (theme: Theme) => theme.spacing(1),\n },\n },\n} satisfies Record<string, SxProps<Theme>>\n","import { Box } from '@mui/material'\nimport { styles } from '../style'\nimport type { FormulaWidgetState, RowProps } from '../types'\nimport { useWidgetStore } from '../../stores/widget-store'\nimport { useShallow } from 'zustand/shallow'\n\nexport function Row(props: RowProps) {\n const data = useWidgetStore(\n useShallow((state) => state.getWidget<FormulaWidgetState>(props.id)?.data),\n )\n\n return data?.map((_, index) => {\n return (\n <Box sx={styles.row} key={index}>\n {typeof props.children === 'function'\n ? props.children({ index })\n : props.children}\n </Box>\n )\n })\n}\n"],"names":["styles","item","color","theme","palette","text","disabled","row","display","alignItems","gap","spacing","marginTop","Row","props","$","_c","t0","id","state","getWidget","data","useWidgetStore","useShallow","t1","map","_","index","jsx","Box","children"],"mappings":";;;;;AAEO,MAAMA,IAAS;AAAA,EAMpBC,MAAM;AAAA,IACJ,2BAA2B;AAAA,MACzBC,OAAOA,CAACC,MAAiBA,EAAMC,QAAQC,KAAKC;AAAAA,IAAAA;AAAAA,EAC9C;AAAA,EAEFC,KAAK;AAAA,IACHC,SAAS;AAAA,IACTC,YAAY;AAAA,IACZC,KAAKA,CAACP,MAAiBA,EAAMQ,QAAQ,CAAC;AAAA,IAEtC,SAAS;AAAA,MACPC,WAAWA,CAACT,MAAiBA,EAAMQ,QAAQ,CAAC;AAAA,IAAA;AAAA,EAC9C;AAEJ;AChBO,SAAAE,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA;AAAA,MAAAC;AAAA,EAAAF,EAAA,CAAA,MAAAD,EAAAI,MAEQD,IAAAE,CAAAA,MAAWA,EAAKC,UAA+BN,EAAKI,EAAS,GAACG,MAAAN,EAAA,CAAA,IAAAD,EAAAI,IAAAH,OAAAE,KAAAA,IAAAF,EAAA,CAAA;AAD3E,QAAAM,IAAaC,EACXC,EAAWN,CAA8D,CAC3E;AAAC,MAAAO;AAAA,SAAAT,EAAA,CAAA,MAAAM,KAAAN,SAAAD,KAEMU,IAAAH,GAAII,IAAM,CAAAC,GAAAC,MAEb,gBAAAC,EAACC,GAAA,EAAQ,IAAA7B,EAAMO,KACZ,UAAA,OAAOO,EAAKgB,YAAc,aACvBhB,EAAKgB,SAAU;AAAA,IAAAH,OAAAA;AAAAA,EAAAA,CACF,IAAbb,EAAKgB,SAAAA,GAHeH,CAI1B,CAEH,GAACZ,OAAAM,GAAAN,OAAAD,GAAAC,OAAAS,KAAAA,IAAAT,EAAA,CAAA,GARKS;AAQL;"}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as m } from "react/jsx-runtime";
|
|
2
|
+
import { c as h } from "react/compiler-runtime";
|
|
3
|
+
import { a as x } from "./widget-store-yDO2ul8g.js";
|
|
4
|
+
import { Typography as y, Avatar as w } from "@mui/material";
|
|
5
|
+
import { s as b } from "./row-DLKZN5aF.js";
|
|
6
|
+
function g(t) {
|
|
7
|
+
const e = h(4);
|
|
8
|
+
let i;
|
|
9
|
+
return e[0] !== t.TypographyProps || e[1] !== t.children || e[2] !== t.disabled ? (i = /* @__PURE__ */ m(y, { sx: b.item, variant: "h5", fontWeight: "medium", "data-disabled": t.disabled, color: "default", ...t.TypographyProps, children: t.children }), e[0] = t.TypographyProps, e[1] = t.children, e[2] = t.disabled, e[3] = i) : i = e[3], i;
|
|
10
|
+
}
|
|
11
|
+
function _(t) {
|
|
12
|
+
const e = h(7);
|
|
13
|
+
let i, n, l;
|
|
14
|
+
e[0] !== t ? ({
|
|
15
|
+
id: i,
|
|
16
|
+
index: l,
|
|
17
|
+
...n
|
|
18
|
+
} = t, e[0] = t, e[1] = i, e[2] = n, e[3] = l) : (i = e[1], n = e[2], l = e[3]);
|
|
19
|
+
const a = l === void 0 ? 0 : l, d = x(i)?.data?.[a];
|
|
20
|
+
if (!d?.prefix)
|
|
21
|
+
return null;
|
|
22
|
+
const r = d?.prefix;
|
|
23
|
+
let o;
|
|
24
|
+
return e[4] !== n || e[5] !== r ? (o = /* @__PURE__ */ m(g, { ...n, children: r }), e[4] = n, e[5] = r, e[6] = o) : o = e[6], o;
|
|
25
|
+
}
|
|
26
|
+
function A(t) {
|
|
27
|
+
const e = h(8);
|
|
28
|
+
let i, n, l;
|
|
29
|
+
e[0] !== t ? ({
|
|
30
|
+
id: i,
|
|
31
|
+
index: l,
|
|
32
|
+
...n
|
|
33
|
+
} = t, e[0] = t, e[1] = i, e[2] = n, e[3] = l) : (i = e[1], n = e[2], l = e[3]);
|
|
34
|
+
const a = l === void 0 ? 0 : l, d = x(i)?.data?.[a];
|
|
35
|
+
if (!d?.suffix)
|
|
36
|
+
return null;
|
|
37
|
+
let r;
|
|
38
|
+
e[4] === Symbol.for("react.memo_cache_sentinel") ? (r = {
|
|
39
|
+
color: P
|
|
40
|
+
}, e[4] = r) : r = e[4];
|
|
41
|
+
const o = d?.suffix;
|
|
42
|
+
let s;
|
|
43
|
+
return e[5] !== n || e[6] !== o ? (s = /* @__PURE__ */ m(g, { TypographyProps: r, ...n, children: o }), e[5] = n, e[6] = o, e[7] = s) : s = e[7], s;
|
|
44
|
+
}
|
|
45
|
+
function P(t) {
|
|
46
|
+
return t.palette.text.secondary;
|
|
47
|
+
}
|
|
48
|
+
function C(t) {
|
|
49
|
+
const e = h(10), {
|
|
50
|
+
id: i,
|
|
51
|
+
index: n
|
|
52
|
+
} = t, l = n === void 0 ? 0 : n, f = x(i)?.series?.[l];
|
|
53
|
+
if (!f)
|
|
54
|
+
return null;
|
|
55
|
+
const {
|
|
56
|
+
name: d,
|
|
57
|
+
color: r
|
|
58
|
+
} = f;
|
|
59
|
+
let o;
|
|
60
|
+
e[0] !== r ? (o = r && {
|
|
61
|
+
color: (p) => p.palette.getContrastText(r)
|
|
62
|
+
}, e[0] = r, e[1] = o) : o = e[1];
|
|
63
|
+
let s;
|
|
64
|
+
e[2] !== r || e[3] !== o ? (s = {
|
|
65
|
+
bgcolor: r,
|
|
66
|
+
width: 32,
|
|
67
|
+
height: 32,
|
|
68
|
+
fontSize: "0.875rem",
|
|
69
|
+
fontWeight: "medium",
|
|
70
|
+
...o
|
|
71
|
+
}, e[2] = r, e[3] = o, e[4] = s) : s = e[4];
|
|
72
|
+
let c;
|
|
73
|
+
e[5] !== d ? (c = d.charAt(0).toUpperCase(), e[5] = d, e[6] = c) : c = e[6];
|
|
74
|
+
let u;
|
|
75
|
+
return e[7] !== s || e[8] !== c ? (u = /* @__PURE__ */ m(w, { sx: s, children: c }), e[7] = s, e[8] = c, e[9] = u) : u = e[9], u;
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
g as I,
|
|
79
|
+
_ as P,
|
|
80
|
+
C as S,
|
|
81
|
+
A as a
|
|
82
|
+
};
|
|
83
|
+
//# sourceMappingURL=series-Cf1QPZHV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"series-Cf1QPZHV.js","sources":["../src/widgets/formula/components/item.tsx","../src/widgets/formula/components/prefix.tsx","../src/widgets/formula/components/suffix.tsx","../src/widgets/formula/components/series.tsx"],"sourcesContent":["import { Typography } from '@mui/material'\nimport type { ItemProps } from '../types'\nimport { styles } from '../style'\n\nexport function Item(props: ItemProps) {\n return (\n <Typography\n sx={styles.item}\n variant='h5'\n fontWeight='medium'\n data-disabled={props.disabled}\n color='default'\n {...props.TypographyProps}\n >\n {props.children}\n </Typography>\n )\n}\n","import { type FormulaWidgetState, type ValueProps } from '../types'\nimport { useWidget } from '../../stores/widget-store'\nimport { Item } from './item'\n\nexport function Prefix({ id, index = 0, ...props }: ValueProps) {\n const widget = useWidget<FormulaWidgetState>(id)\n\n const el = widget?.data?.[index]\n\n if (!el?.prefix) {\n return null\n }\n\n return <Item {...props}>{el?.prefix}</Item>\n}\n","import { type FormulaWidgetState, type ValueProps } from '../types'\nimport { useWidget } from '../../stores/widget-store'\nimport { Item } from './item'\nimport type { Theme } from '@mui/material'\n\nexport function Suffix({ id, index = 0, ...props }: ValueProps) {\n const widget = useWidget<FormulaWidgetState>(id)\n\n const el = widget?.data?.[index]\n\n if (!el?.suffix) {\n return null\n }\n\n return (\n <Item\n TypographyProps={{\n color: (theme: Theme) => theme.palette.text.secondary,\n }}\n {...props}\n >\n {el?.suffix}\n </Item>\n )\n}\n","import { Avatar } from '@mui/material'\nimport type { FormulaWidgetState, ValueProps } from '../types'\nimport { useWidget } from '../../stores/widget-store'\n\nexport function Series({ id, index = 0 }: Pick<ValueProps, 'id' | 'index'>) {\n const widget = useWidget<FormulaWidgetState>(id)\n const currentSeries = widget?.series?.[index]\n\n if (!currentSeries) {\n return null\n }\n\n const { name, color } = currentSeries\n\n return (\n <Avatar\n sx={{\n bgcolor: color,\n width: 32,\n height: 32,\n fontSize: '0.875rem',\n fontWeight: 'medium',\n ...(color && {\n color: (theme) => theme.palette.getContrastText(color),\n }),\n }}\n >\n {name.charAt(0).toUpperCase()}\n </Avatar>\n )\n}\n"],"names":["Item","props","$","_c","t0","TypographyProps","children","disabled","Typography","styles","item","Prefix","id","t1","index","undefined","el","useWidget","data","prefix","t2","t3","jsx","Suffix","suffix","Symbol","for","color","_temp","t4","theme","palette","text","secondary","Series","currentSeries","series","name","getContrastText","bgcolor","width","height","fontSize","fontWeight","charAt","toUpperCase","t5","Avatar"],"mappings":";;;;;AAIO,SAAAA,EAAAC,GAAA;AAAA,QAAAC,IAAAC,EAAA,CAAA;AAAA,MAAAC;AAAA,SAAAF,EAAA,CAAA,MAAAD,EAAAI,mBAAAH,EAAA,CAAA,MAAAD,EAAAK,YAAAJ,EAAA,CAAA,MAAAD,EAAAM,YAEHH,sBAACI,GAAA,EACK,IAAAC,EAAMC,MACF,SAAA,MACG,YAAA,UACI,iBAAAT,EAAKM,UACd,OAAA,WAAS,GACXN,EAAKI,iBAERJ,YAAKK,UACR,GAAaJ,EAAA,CAAA,IAAAD,EAAAI,iBAAAH,EAAA,CAAA,IAAAD,EAAAK,UAAAJ,EAAA,CAAA,IAAAD,EAAAM,UAAAL,OAAAE,KAAAA,IAAAF,EAAA,CAAA,GATbE;AASa;ACXV,SAAAO,EAAAP,GAAA;AAAA,QAAAF,IAAAC,EAAA,CAAA;AAAA,MAAAS,GAAAX,GAAAY;AAAA,EAAAX,SAAAE,KAAgB;AAAA,IAAAQ,IAAAA;AAAAA,IAAAE,O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OAAA2B,KAAAA,IAAA3B,EAAA,CAAA;AAAA,MAAA4C;AAAA,SAAA5C,EAAA,CAAA,MAAAmB,KAAAnB,SAAA2B,KAZ/BiB,IAAA,gBAAAxB,EAACyB,GAAA,EACK,IAAA1B,GAWHQ,UAAAA,GACH,GAAS3B,OAAAmB,GAAAnB,OAAA2B,GAAA3B,OAAA4C,KAAAA,IAAA5C,EAAA,CAAA,GAbT4C;AAaS;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx as m } from "react/jsx-runtime";
|
|
2
2
|
import { c as h } from "react/compiler-runtime";
|
|
3
|
-
import { u as g } from "./widget-store-
|
|
3
|
+
import { u as g } from "./widget-store-CB6Trp_0.js";
|
|
4
4
|
import { useShallow as p } from "zustand/shallow";
|
|
5
5
|
import { Typography as S, Avatar as b } from "@mui/material";
|
|
6
|
-
import { s as P } from "./row-
|
|
6
|
+
import { s as P } from "./row-DrHwXNvF.js";
|
|
7
7
|
function y(i) {
|
|
8
8
|
const e = h(4);
|
|
9
9
|
let t;
|
|
@@ -88,4 +88,4 @@ export {
|
|
|
88
88
|
j as S,
|
|
89
89
|
I as a
|
|
90
90
|
};
|
|
91
|
-
//# sourceMappingURL=series-
|
|
91
|
+
//# sourceMappingURL=series-Do02NQUF.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"series-
|
|
1
|
+
{"version":3,"file":"series-Do02NQUF.js","sources":["../src/widgets/formula/components/item.tsx","../src/widgets/formula/components/prefix.tsx","../src/widgets/formula/components/suffix.tsx","../src/widgets/formula/components/series.tsx"],"sourcesContent":["import { Typography } from '@mui/material'\nimport type { ItemProps } from '../types'\nimport { styles } from '../style'\n\nexport function Item(props: ItemProps) {\n return (\n <Typography\n sx={styles.item}\n variant='h5'\n fontWeight='medium'\n data-disabled={props.disabled}\n color='default'\n {...props.TypographyProps}\n >\n {props.children}\n </Typography>\n )\n}\n","import { type FormulaWidgetState, type ValueProps } from '../types'\nimport { useWidgetStore } from '../../stores/widget-store'\nimport { Item } from './item'\nimport { useShallow } from 'zustand/shallow'\n\nexport function Prefix({ id, index = 0, ...props }: ValueProps) {\n const prefix = useWidgetStore(\n useShallow(\n (state) => state.getWidget<FormulaWidgetState>(id)?.data?.[index]?.prefix,\n ),\n )\n\n if (!prefix) {\n return null\n }\n\n return <Item {...props}>{prefix}</Item>\n}\n","import { type FormulaWidgetState, type ValueProps } from '../types'\nimport { useWidgetStore } from '../../stores/widget-store'\nimport { Item } from './item'\nimport type { Theme } from '@mui/material'\nimport { useShallow } from 'zustand/shallow'\n\nexport function Suffix({ id, index = 0, ...props }: ValueProps) {\n const suffix = useWidgetStore(\n useShallow(\n (state) => state.getWidget<FormulaWidgetState>(id)?.data?.[index]?.suffix,\n ),\n )\n\n if (!suffix) {\n return null\n }\n\n return (\n <Item\n TypographyProps={{\n color: (theme: Theme) => theme.palette.text.secondary,\n }}\n {...props}\n >\n {suffix}\n </Item>\n )\n}\n","import { Avatar } from '@mui/material'\nimport type { FormulaWidgetState, ValueProps } from '../types'\nimport { useWidgetStore } from '../../stores/widget-store'\nimport { useShallow } from 'zustand/shallow'\n\nexport function Series({ id, index = 0 }: Pick<ValueProps, 'id' | 'index'>) {\n const serie = useWidgetStore(\n useShallow(\n (state) => state.getWidget<FormulaWidgetState>(id)?.series?.[index],\n ),\n )\n if (!serie) {\n return null\n }\n\n const { name, color } = serie\n\n return (\n <Avatar\n sx={{\n bgcolor: color,\n width: 32,\n height: 32,\n fontSize: '0.875rem',\n fontWeight: 'medium',\n ...(color && {\n color: (theme) => theme.palette.getContrastText(color),\n }),\n }}\n >\n {name.charAt(0).toUpperCase()}\n </Avatar>\n )\n}\n"],"names":["Item","props","$","_c","t0","TypographyProps","children","disabled","Typography","styles","item","Prefix","id","t1","index","undefined","t2","state","getWidget","data","prefix","useWidgetStore","useShallow","t3","jsx","Suffix","suffix","Symbol","for","color","_temp","t4","theme","palette","text","secondary","Series","series","serie","name","getContrastText","bgcolor","width","height","fontSize","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MAAA6B,KAAA7B,UAAA4C,KAZ/BG,IAAA,gBAAAzB,EAAC0B,GAAA,EACK,IAAAnB,GAWHe,UAAAA,GACH,GAAS5C,QAAA6B,GAAA7B,QAAA4C,GAAA5C,QAAA+C,KAAAA,IAAA/C,EAAA,EAAA,GAbT+C;AAaS;"}
|
|
@@ -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(1))
|
|
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-CcC5L2cr.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"styles-CcC5L2cr.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(1)) }),\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,CAA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QA,CAAC;AAAA,QAAEpB,SAAAA;AAAAA,MAAAA,MAAqBA,EAAQ,EAAE;AAAA,IAAA;AAAA,EAC5C;AAEJ;"}
|
|
@@ -14,5 +14,5 @@ export interface MarkdownDataItem {
|
|
|
14
14
|
}
|
|
15
15
|
export type MarkdownWidgetData = MarkdownDataItem;
|
|
16
16
|
export type MarkdownWidgetState = BaseWidgetState<WrapperState<MarkdownWidgetConfig>>;
|
|
17
|
-
export type MarkdownWidgetConfig = unknown
|
|
17
|
+
export type MarkdownWidgetConfig = Record<string, unknown>;
|
|
18
18
|
export type MarkdownDownloadConfig = DownloadItem<MarkdownWidgetData>[];
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { TableRow } from '../types';
|
|
2
2
|
export interface UseSelectionOptions {
|
|
3
3
|
/** Callback when selection changes */
|
|
4
|
-
onSelectionChange?: (selectedIds:
|
|
4
|
+
onSelectionChange?: (selectedIds: (string | number)[]) => void;
|
|
5
5
|
}
|
|
6
6
|
export interface UseSelectionResult {
|
|
7
|
-
/**
|
|
8
|
-
selectedIds:
|
|
7
|
+
/** Array of selected row IDs */
|
|
8
|
+
selectedIds: (string | number)[];
|
|
9
9
|
/** Check if a row is selected */
|
|
10
10
|
isSelected: (id: string | number) => boolean;
|
|
11
11
|
/** Check if all provided rows are selected */
|
|
@@ -1,8 +1,4 @@
|
|
|
1
1
|
import { TableRow, SortDirection, SortState } from '../types';
|
|
2
|
-
export interface UseSortOptions {
|
|
3
|
-
/** Callback when sort changes (for remote sorting) */
|
|
4
|
-
onSortChange?: (columnId: string, direction: SortDirection) => void;
|
|
5
|
-
}
|
|
6
2
|
export interface UseSortResult<T> extends SortState {
|
|
7
3
|
/** Whether sorting is enabled */
|
|
8
4
|
sortEnabled: boolean;
|
|
@@ -23,4 +19,4 @@ export interface UseSortResult<T> extends SortState {
|
|
|
23
19
|
* Supports both local (client-side) and remote (server-side) sorting
|
|
24
20
|
* State is persisted in the widget store for the given widgetId
|
|
25
21
|
*/
|
|
26
|
-
export declare function useSort<T extends TableRow>(widgetId: string, data: T[]
|
|
22
|
+
export declare function useSort<T extends TableRow>(widgetId: string, data: T[]): UseSortResult<T>;
|
|
@@ -75,7 +75,7 @@ export interface TableWidgetConfig {
|
|
|
75
75
|
/** Enable row selection with checkboxes */
|
|
76
76
|
selectable?: boolean;
|
|
77
77
|
/** Currently selected row IDs */
|
|
78
|
-
selected:
|
|
78
|
+
selected: (string | number)[];
|
|
79
79
|
/** Pagination and sort mode: local (client-side) or remote (server-side) */
|
|
80
80
|
mode: Mode;
|
|
81
81
|
/** Pagination configuration */
|
|
@@ -101,7 +101,7 @@ export interface TableWidgetConfig {
|
|
|
101
101
|
/** Callback when hovering over a row (null when leaving table) */
|
|
102
102
|
onRowHover?: (row: TableRow | null) => void;
|
|
103
103
|
/** Callback when selection changes */
|
|
104
|
-
onSelectionChange?: (selected:
|
|
104
|
+
onSelectionChange?: (selected: (string | number)[]) => void;
|
|
105
105
|
/** Callback when page changes (for remote pagination) */
|
|
106
106
|
onPageChange?: (page: number, rowsPerPage: number) => void;
|
|
107
107
|
/** Callback when sort changes (for remote sorting) */
|