@carto/ps-react-ui 5.0.0-widgets.5 → 5.0.0-widgets.6

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.
Files changed (42) hide show
  1. package/dist/{error-DGzuzmn1.js → error-G3sy6lw3.js} +2 -2
  2. package/dist/{error-DGzuzmn1.js.map → error-G3sy6lw3.js.map} +1 -1
  3. package/dist/{no-data-BBAoT1vK.js → no-data-DfkC_Kc_.js} +2 -2
  4. package/dist/{no-data-BBAoT1vK.js.map → no-data-DfkC_Kc_.js.map} +1 -1
  5. package/dist/{row-C_m1ovHv.js → row-B9hTUitn.js} +2 -2
  6. package/dist/{row-C_m1ovHv.js.map → row-B9hTUitn.js.map} +1 -1
  7. package/dist/{series-6xp-KQ0S.js → series-DojKkd_o.js} +3 -3
  8. package/dist/{series-6xp-KQ0S.js.map → series-DojKkd_o.js.map} +1 -1
  9. package/dist/types/widgets/category/config.d.ts +1 -0
  10. package/dist/types/widgets/category/types.d.ts +1 -0
  11. package/dist/types/widgets/stores/types.d.ts +0 -75
  12. package/dist/types/widgets/table/hooks/use-pagination.d.ts +1 -7
  13. package/dist/types/widgets/table/hooks/use-selection.d.ts +0 -2
  14. package/dist/types/widgets/table/hooks/use-sort.d.ts +1 -7
  15. package/dist/types/widgets/table/types.d.ts +16 -5
  16. package/dist/widget-store-Dd7_sWZT.js +132 -0
  17. package/dist/widget-store-Dd7_sWZT.js.map +1 -0
  18. package/dist/widgets/actions.js +1 -1
  19. package/dist/widgets/bar.js +1 -1
  20. package/dist/widgets/category.js +134 -128
  21. package/dist/widgets/category.js.map +1 -1
  22. package/dist/widgets/echart.js +1 -1
  23. package/dist/widgets/error.js +1 -1
  24. package/dist/widgets/formula.js +3 -3
  25. package/dist/widgets/histogram.js +1 -1
  26. package/dist/widgets/markdown.js +1 -1
  27. package/dist/widgets/no-data.js +1 -1
  28. package/dist/widgets/pie.js +1 -1
  29. package/dist/widgets/range.js +2 -2
  30. package/dist/widgets/root.js +1 -1
  31. package/dist/widgets/scatterplot.js +1 -1
  32. package/dist/widgets/skeleton-loader.js +1 -1
  33. package/dist/widgets/spread.js +3 -3
  34. package/dist/widgets/stores.js +1 -1
  35. package/dist/widgets/table.js +499 -488
  36. package/dist/widgets/table.js.map +1 -1
  37. package/dist/widgets/timeseries.js +1 -1
  38. package/dist/widgets/wrapper.js +1 -1
  39. package/dist/widgets.js +3 -3
  40. package/package.json +1 -1
  41. package/dist/widget-store-DNyVElxd.js +0 -190
  42. package/dist/widget-store-DNyVElxd.js.map +0 -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-DNyVElxd.js";
4
+ import { u } from "./widget-store-Dd7_sWZT.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-DGzuzmn1.js.map
38
+ //# sourceMappingURL=error-G3sy6lw3.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-DGzuzmn1.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;"}
1
+ {"version":3,"file":"error-G3sy6lw3.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;"}
@@ -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-DNyVElxd.js";
5
+ import { u as b } from "./widget-store-Dd7_sWZT.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-BBAoT1vK.js.map
61
+ //# sourceMappingURL=no-data-DfkC_Kc_.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"no-data-BBAoT1vK.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,IAAAC,MAAAG,SAAA,mJAAAH,GACAC,IAAAC,MAAAC,SAAAC,IAAAF;AAAwB,MAAAG;AAAA,EAAAZ,SAAAE,KAIXU,IAAAC,CAAAA,MAAA;AACT,UAAAC,IAAUD,EAAKE,QAASb,CAAE;AAAC,WACpB;AAAA,MAAAc,WACMF,GAACE;AAAAA,MAAWC,YACXH,GAACG;AAAAA,MAAYC,MACnBJ,GAACI;AAAAA,IAAAA;AAAAA,EACR,GACFlB,OAAAE,GAAAF,OAAAY,KAAAA,IAAAZ,EAAA,CAAA;AARH,QAAAmB,IAAeC,EACbC,EAAWT,CAOV,CACH;AAIA,MAAIO,GAAMH,aAAeG,GAAMF;AAAY,WAClCd;AAIT,MAAIK,EAAQW,GAAMD,IAAM,GAAC;AAAA,QAAAI;AAAA,IAAAtB,SAAAI,KAGnBkB,sBAACC,GAAA,EAAmB,SAAA,SAAc,OAAA,gBAC/BnB,UAAAA,GACH,GAAaJ,OAAAI,GAAAJ,OAAAsB,KAAAA,IAAAtB,EAAA,CAAA;AAAA,QAAAwB;AAAA,IAAAxB,SAAAM,KACbkB,sBAACD,GAAA,EAAmB,SAAA,WAAgB,OAAA,kBACjCjB,UAAAA,GACH,GAAaN,OAAAM,GAAAN,OAAAwB,KAAAA,IAAAxB,EAAA,CAAA;AAAA,QAAAyB;AAAA,WAAAzB,EAAA,CAAA,MAAAsB,KAAAtB,SAAAwB,KANfC,sBAACC,GAAA,EAAQ,IAAAtC,EAAMC,MACbiC,UAAAA;AAAAA,MAAAA;AAAAA,MAGAE;AAAAA,IAAAA,GAGF,GAAMxB,OAAAsB,GAAAtB,OAAAwB,GAAAxB,OAAAyB,KAAAA,IAAAzB,EAAA,CAAA,GAPNyB;AAAAA,EAOM;AAET,SAGMtB;AAAQ;AAOjB,SAASQ,EAAeO,GAAwB;AAE9C,SAAIA,KAAQ,OACH,KAILS,MAAMC,QAAQV,CAAI,IAEhBA,GAAAA,EAAKW,WAAW,KAMhBX,EAAKY,MAAOC,CAAAA,MAASJ,MAAMC,QAAQG,CAAI,KAAKA,EAAKF,WAAW,CAAC,KAQ/D,OAAOX,KAAS,WACXc,OAAOC,KAAKf,CAAI,EAAEW,WAAW,IAI/B;AACT;"}
1
+ {"version":3,"file":"no-data-DfkC_Kc_.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,IAAAC,MAAAG,SAAA,mJAAAH,GACAC,IAAAC,MAAAC,SAAAC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C,KAQ/D,OAAOX,KAAS,WACXc,OAAOC,KAAKf,CAAI,EAAEW,WAAW,IAI/B;AACT;"}
@@ -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-DNyVElxd.js";
4
+ import { u as m } from "./widget-store-Dd7_sWZT.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-C_m1ovHv.js.map
35
+ //# sourceMappingURL=row-B9hTUitn.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"row-C_m1ovHv.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;"}
1
+ {"version":3,"file":"row-B9hTUitn.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;"}
@@ -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-DNyVElxd.js";
3
+ import { u as g } from "./widget-store-Dd7_sWZT.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-C_m1ovHv.js";
6
+ import { s as P } from "./row-B9hTUitn.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-6xp-KQ0S.js.map
91
+ //# sourceMappingURL=series-DojKkd_o.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"series-6xp-KQ0S.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","fontWeight","t5","charAt","toUpperCase","t6","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;ACVV,SAAAO,EAAAP,GAAA;AAAA,QAAAF,IAAAC,EAAA,EAAA;AAAA,MAAAS,GAAAX,GAAAY;AAAA,EAAAX,SAAAE,KAAgB;AAAA,IAAAQ,IAAAA;AAAAA,IAAAE,OAAAD;AAAAA,IAAA,GAAAZ;AAAAA,EAAAA,IAAAG,GAAuCF,OAAAE,GAAAF,OAAAU,GAAAV,OAAAD,GAAAC,OAAAW,MAAAD,IAAAV,EAAA,CAAA,GAAAD,IAAAC,EAAA,CAAA,GAAAW,IAAAX,EAAA,CAAA;AAAjC,QAAAY,IAAAD,MAAAE,SAAA,IAAAF;AAAS,MAAAG;AAAA,EAAAd,EAAA,CAAA,MAAAU,KAAAV,SAAAY,KAGhCE,IAAAC,OAAWA,EAAKC,UAA+BN,CAAQ,GAACO,OAAGL,CAAK,GAASM,QAAAlB,OAAAU,GAAAV,OAAAY,GAAAZ,OAAAc,KAAAA,IAAAd,EAAA,CAAA;AAF7E,QAAAkB,IAAeC,EACbC,E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Ac9C,OAAAqC,GAAArC,OAAA4C,KAAAA,IAAA5C,EAAA,CAAA;AAAA,MAAA+C;AAAA,SAAA/C,EAAA,EAAA,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;"}
1
+ {"version":3,"file":"series-DojKkd_o.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","fontWeight","t5","charAt","toUpperCase","t6","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;ACVV,SAAAO,EAAAP,GAAA;AAAA,QAAAF,IA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wBS;AAAK,MAAAf;AAAA,EAAArB,SAAA2B,KAUnBN,IAAAM,KAAA;AAAA,IAAAA,OACKG,CAAAA,MAAWA,EAAKC,QAAQO,gBAAiBX,CAAK;AAAA,EAAA,GACtD3B,OAAA2B,GAAA3B,OAAAqB,KAAAA,IAAArB,EAAA,CAAA;AAAA,MAAA6B;AAAA,EAAA7B,EAAA,CAAA,MAAA2B,KAAA3B,SAAAqB,KARCQ,IAAA;AAAA,IAAAU,SACOZ;AAAAA,IAAKa,OACP;AAAA,IAAEC,QACD;AAAA,IAAEC,UACA;AAAA,IAAUC,YACR;AAAA,IAAQ,GAChBtB;AAAAA,EAAAA,GAGLrB,OAAA2B,GAAA3B,OAAAqB,GAAArB,OAAA6B,KAAAA,IAAA7B,EAAA,CAAA;AAAA,MAAA4C;AAAA,EAAA5C,SAAAqC,KAEAO,IAAAP,EAAIQ,OAAQ,CAAC,EAACC,YAAAA,GAAc9C,OAAAqC,GAAArC,OAAA4C,KAAAA,IAAA5C,EAAA,CAAA;AAAA,MAAA+C;AAAA,SAAA/C,EAAA,EAAA,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;"}
@@ -10,6 +10,7 @@ export interface CategoryConfigProps {
10
10
  formatter?: (value: number) => string;
11
11
  maxItems?: number;
12
12
  labels?: CategoryLabels;
13
+ max?: number;
13
14
  }
14
15
  export declare function categoryDownloadConfig({ refUI, series, }: CategoryDownloadConfigProps): DownloadItem<CategoryWidgetData>[];
15
16
  export declare function categoryConfig(): CategoryWidgetConfig;
@@ -29,5 +29,6 @@ export interface CategoryWidgetConfig {
29
29
  name: string;
30
30
  }) => void;
31
31
  selected?: (name: string) => boolean;
32
+ max?: number;
32
33
  }
33
34
  export type CategoryDownloadConfig = DownloadItem<CategoryWidgetData>[];
@@ -1,55 +1,4 @@
1
1
  import { RefObject } from 'react';
2
- /**
3
- * Sort direction for table columns
4
- */
5
- export type StoreSortDirection = 'asc' | 'desc';
6
- /**
7
- * Pagination mode for tables
8
- */
9
- export type StorePaginationMode = 'local' | 'remote';
10
- /**
11
- * Sort mode for tables
12
- */
13
- export type StoreSortMode = 'local' | 'remote';
14
- /**
15
- * Table pagination state stored in widget store
16
- */
17
- export interface TablePaginationStoreState {
18
- /** Current page (0-indexed) */
19
- page: number;
20
- /** Rows per page */
21
- rowsPerPage: number;
22
- /** Available rows per page options */
23
- rowsPerPageOptions: number[];
24
- /** Pagination mode: local or remote */
25
- mode: StorePaginationMode;
26
- }
27
- /**
28
- * Table sort state stored in widget store
29
- */
30
- export interface TableSortStoreState {
31
- /** Column ID being sorted */
32
- columnId: string | null;
33
- /** Sort direction */
34
- direction: StoreSortDirection;
35
- /** Sort mode: local or remote */
36
- mode: StoreSortMode;
37
- }
38
- /**
39
- * Table selection state stored in widget store
40
- */
41
- export interface TableSelectionStoreState {
42
- /** Set of selected row IDs */
43
- selectedIds: Set<string | number>;
44
- }
45
- /**
46
- * Combined table state for widget store
47
- */
48
- export interface TableStoreState {
49
- pagination?: TablePaginationStoreState;
50
- sort?: TableSortStoreState;
51
- selection?: TableSelectionStoreState;
52
- }
53
2
  export interface WidgetsStoreProps {
54
3
  /** Unique identifier for the widget */
55
4
  id: string;
@@ -172,30 +121,6 @@ export interface WidgetStoreActions {
172
121
  * @returns Widget state or undefined if not found
173
122
  */
174
123
  getWidget: <T extends WidgetState = WidgetState>(id: WidgetState['id']) => T | undefined;
175
- /**
176
- * Set table pagination state for a widget
177
- * @param id - Widget ID
178
- * @param pagination - Partial pagination state to merge
179
- */
180
- setTablePagination: (id: WidgetState['id'], pagination: Partial<TablePaginationStoreState>) => void;
181
- /**
182
- * Set table sort state for a widget
183
- * @param id - Widget ID
184
- * @param sort - Partial sort state to merge
185
- */
186
- setTableSort: (id: WidgetState['id'], sort: Partial<TableSortStoreState>) => void;
187
- /**
188
- * Set table selection state for a widget
189
- * @param id - Widget ID
190
- * @param selection - Partial selection state to merge
191
- */
192
- setTableSelection: (id: WidgetState['id'], selection: Partial<TableSelectionStoreState>) => void;
193
- /**
194
- * Get table state for a widget
195
- * @param id - Widget ID
196
- * @returns Table state or undefined if not found
197
- */
198
- getTableState: (id: WidgetState['id']) => TableStoreState | undefined;
199
124
  /**
200
125
  * Register a tool with the widget's transformation pipeline
201
126
  * @param widgetId - Widget ID
@@ -1,11 +1,5 @@
1
- import { TableRow, PaginationMode } from '../types';
1
+ import { TableRow } from '../types';
2
2
  export interface UsePaginationOptions {
3
- /** Pagination mode: local or remote */
4
- mode: PaginationMode;
5
- /** Initial page (0-indexed) */
6
- initialPage?: number;
7
- /** Initial rows per page */
8
- initialRowsPerPage?: number;
9
3
  /** Available rows per page options */
10
4
  rowsPerPageOptions?: number[];
11
5
  /** Total rows (for remote pagination) */
@@ -1,7 +1,5 @@
1
1
  import { TableRow } from '../types';
2
2
  export interface UseSelectionOptions {
3
- /** Initial selected IDs */
4
- initialSelectedIds?: Set<string | number>;
5
3
  /** Callback when selection changes */
6
4
  onSelectionChange?: (selectedIds: Set<string | number>) => void;
7
5
  }
@@ -1,11 +1,5 @@
1
- import { TableRow, SortMode, SortDirection, SortState } from '../types';
1
+ import { TableRow, SortDirection, SortState } from '../types';
2
2
  export interface UseSortOptions {
3
- /** Sort mode: local or remote */
4
- mode: SortMode;
5
- /** Initial sort column ID */
6
- initialColumnId?: string | null;
7
- /** Initial sort direction */
8
- initialDirection?: SortDirection;
9
3
  /** Callback when sort changes (for remote sorting) */
10
4
  onSortChange?: (columnId: string, direction: SortDirection) => void;
11
5
  }
@@ -78,6 +78,8 @@ export interface TableWidgetConfig {
78
78
  columns?: TableColumn[];
79
79
  /** Enable row selection with checkboxes */
80
80
  selectable?: boolean;
81
+ /** Currently selected row IDs */
82
+ selected: Set<string | number>;
81
83
  /** Pagination configuration */
82
84
  pagination?: {
83
85
  /** Pagination mode: local (client-side) or remote (server-side) */
@@ -103,20 +105,29 @@ export interface TableWidgetConfig {
103
105
  /** Callback when hovering over a row (null when leaving table) */
104
106
  onRowHover?: (row: TableRow | null) => void;
105
107
  /** Callback when selection changes */
106
- onSelectionChange?: (selectedIds: Set<string | number>) => void;
108
+ onSelectionChange?: (selected: Set<string | number>) => void;
107
109
  /** Callback when page changes (for remote pagination) */
108
110
  onPageChange?: (page: number, rowsPerPage: number) => void;
109
111
  /** Callback when sort changes (for remote sorting) */
110
112
  onSortChange?: (columnId: string, direction: SortDirection) => void;
111
113
  }
112
114
  /**
113
- * Table widget state
115
+ * Table widget state - includes both configuration and runtime state
114
116
  */
115
117
  export type TableWidgetState = BaseWidgetState<WrapperState<TableWidgetConfig> & {
116
118
  data: TableWidgetData;
117
- paginationState?: TablePaginationState;
118
- sortState?: SortState;
119
- selectedIds?: Set<string | number>;
119
+ pagination?: {
120
+ page: number;
121
+ rowsPerPage: number;
122
+ rowsPerPageOptions: number[];
123
+ mode: PaginationMode;
124
+ total?: number;
125
+ };
126
+ sort?: {
127
+ columnId: string | null;
128
+ direction: SortDirection;
129
+ mode: SortMode;
130
+ };
120
131
  }>;
121
132
  /**
122
133
  * Table download configuration
@@ -0,0 +1,132 @@
1
+ import { create as f } from "zustand";
2
+ const u = /* @__PURE__ */ new Map(), w = f()((c, T) => ({
3
+ // State
4
+ widgets: {},
5
+ // Actions
6
+ setWidget: (e, t) => c((o) => {
7
+ const r = o.widgets[e] ?? {};
8
+ return {
9
+ widgets: {
10
+ ...o.widgets,
11
+ [e]: {
12
+ ...r,
13
+ ...t,
14
+ id: e
15
+ }
16
+ }
17
+ };
18
+ }),
19
+ removeWidget: (e) => c((t) => {
20
+ const o = {
21
+ ...t.widgets
22
+ };
23
+ return delete o[e], {
24
+ widgets: o
25
+ };
26
+ }),
27
+ clearWidgets: () => c({
28
+ widgets: {}
29
+ }),
30
+ getWidget: (e) => T().widgets[e],
31
+ registerTool: (e, t) => c((o) => {
32
+ const r = o.widgets[e] ?? {}, l = (r.registeredTools ?? []).filter((g) => g.id !== t.id);
33
+ return {
34
+ widgets: {
35
+ ...o.widgets,
36
+ [e]: {
37
+ ...r,
38
+ id: e,
39
+ registeredTools: [...l, t]
40
+ }
41
+ }
42
+ };
43
+ }),
44
+ unregisterTool: (e, t) => c((o) => {
45
+ const r = o.widgets[e];
46
+ if (!r) return o;
47
+ const l = (r.registeredTools ?? []).filter((g) => g.id !== t);
48
+ return {
49
+ widgets: {
50
+ ...o.widgets,
51
+ [e]: {
52
+ ...r,
53
+ registeredTools: l
54
+ }
55
+ }
56
+ };
57
+ }),
58
+ updateToolConfig: (e, t, o) => c((r) => {
59
+ const i = r.widgets[e];
60
+ if (!i) return r;
61
+ const g = (i.registeredTools ?? []).map((n) => n.id === t ? {
62
+ ...n,
63
+ config: {
64
+ ...n.config,
65
+ ...o
66
+ }
67
+ } : n);
68
+ return {
69
+ widgets: {
70
+ ...r.widgets,
71
+ [e]: {
72
+ ...i,
73
+ registeredTools: g
74
+ }
75
+ }
76
+ };
77
+ }),
78
+ setToolEnabled: (e, t, o) => c((r) => {
79
+ const i = r.widgets[e];
80
+ if (!i) return r;
81
+ const g = (i.registeredTools ?? []).map((n) => n.id === t ? {
82
+ ...n,
83
+ enabled: o
84
+ } : n);
85
+ return {
86
+ widgets: {
87
+ ...r.widgets,
88
+ [e]: {
89
+ ...i,
90
+ registeredTools: g
91
+ }
92
+ }
93
+ };
94
+ }),
95
+ executeToolPipeline: async (e, t) => {
96
+ const o = T().widgets[e];
97
+ if (!o) return;
98
+ const r = (u.get(e) ?? 0) + 1;
99
+ u.set(e, r);
100
+ const i = o, l = /* @__PURE__ */ new Set();
101
+ for (const s of i.registeredTools ?? [])
102
+ s.enabled && s.disables && s.disables.forEach((d) => l.add(d));
103
+ const g = [...i.registeredTools ?? []].filter((s) => s.enabled && !l.has(s.id)).sort((s, d) => s.order - d.order);
104
+ let n = t;
105
+ for (const s of g) {
106
+ if (u.get(e) !== r)
107
+ return;
108
+ try {
109
+ const d = s.fn(n, s.config);
110
+ n = d instanceof Promise ? await d : d;
111
+ } catch (d) {
112
+ console.error(`Tool ${s.id} failed for widget ${e}:`, d);
113
+ }
114
+ }
115
+ u.get(e) === r && (c((s) => {
116
+ const d = s.widgets[e];
117
+ return d ? {
118
+ widgets: {
119
+ ...s.widgets,
120
+ [e]: {
121
+ ...d,
122
+ data: n
123
+ }
124
+ }
125
+ } : s;
126
+ }), u.get(e) === r && u.delete(e));
127
+ }
128
+ }));
129
+ export {
130
+ w as u
131
+ };
132
+ //# sourceMappingURL=widget-store-Dd7_sWZT.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"widget-store-Dd7_sWZT.js","sources":["../src/widgets/stores/widget-store.ts"],"sourcesContent":["import { create } from 'zustand'\nimport type { WidgetState, WidgetStore, ToolRegistration } from './types'\n\n// Track active pipeline executions for cancellation\nconst activePipelines = new Map<string, number>()\n\n/**\n * Zustand store for managing widget state across the application.\n *\n * This store provides centralized state management for all widget UI components\n *\n * @example\n * ```tsx\n * // Import the store\n * import { useWidgetStore } from '@carto/ps-react-ui/widgets'\n *\n * // Use in a component\n * function MyWidget() {\n * const setWidget = useWidgetStore((state) => state.setWidget)\n * const widget = useWidgetStore((state) => state.widgets['my-widget'])\n *\n * useEffect(() => {\n * setWidget({\n * id: 'my-widget',\n * type: 'formula',\n * title: 'Total Sales',\n * isLoading: false,\n * visible: true,\n * data: { value: 1000, prefix: '$' }\n * })\n * }, [setWidget])\n *\n * return <div>{widget?.data?.value}</div>\n * }\n * ```\n *\n * @example\n * ```tsx\n * // Get widgets by type\n * const getWidgetsByType = useWidgetStore((state) => state.getWidgetsByType)\n * const formulaWidgets = getWidgetsByType('formula')\n * ```\n */\nexport const useWidgetStore = create<WidgetStore>()((set, get) => ({\n // State\n widgets: {},\n\n // Actions\n setWidget: (id, widget) =>\n set((state) => {\n const current =\n state.widgets[id] ?? ({} as WidgetStore['widgets'][string])\n return {\n widgets: {\n ...state.widgets,\n [id]: {\n ...current,\n ...widget,\n id,\n },\n },\n }\n }),\n\n removeWidget: (id) =>\n set((state) => {\n const widgets = { ...state.widgets }\n\n delete widgets[id]\n\n return { widgets }\n }),\n\n clearWidgets: () =>\n set({\n widgets: {},\n }),\n\n getWidget: <T extends WidgetState>(id: string) => {\n return get().widgets[id] as T | undefined\n },\n\n registerTool: (widgetId: string, tool: ToolRegistration) =>\n set((state) => {\n const current = state.widgets[widgetId] ?? ({} as WidgetState)\n const registeredTools = current.registeredTools ?? []\n\n // Remove existing tool with same id if present\n const filteredTools = registeredTools.filter(\n (t: ToolRegistration) => t.id !== tool.id,\n )\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...current,\n id: widgetId,\n registeredTools: [...filteredTools, tool],\n },\n },\n }\n }),\n\n unregisterTool: (widgetId: string, toolId: string) =>\n set((state) => {\n const current = state.widgets[widgetId]\n if (!current) return state\n\n const registeredTools = current.registeredTools ?? []\n const filteredTools = registeredTools.filter(\n (t: ToolRegistration) => t.id !== toolId,\n )\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...current,\n registeredTools: filteredTools,\n },\n },\n }\n }),\n\n updateToolConfig: (\n widgetId: string,\n toolId: string,\n config: Record<string, unknown>,\n ) =>\n set((state) => {\n const current = state.widgets[widgetId]\n if (!current) return state\n\n const registeredTools = current.registeredTools ?? []\n const updatedTools = registeredTools.map((tool: ToolRegistration) =>\n tool.id === toolId\n ? {\n ...tool,\n config: { ...tool.config, ...config },\n }\n : tool,\n )\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...current,\n registeredTools: updatedTools,\n },\n },\n }\n }),\n\n setToolEnabled: (widgetId: string, toolId: string, enabled: boolean) =>\n set((state) => {\n const current = state.widgets[widgetId]\n if (!current) return state\n\n const registeredTools = current.registeredTools ?? []\n const updatedTools = registeredTools.map((tool: ToolRegistration) =>\n tool.id === toolId ? { ...tool, enabled } : tool,\n )\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...current,\n registeredTools: updatedTools,\n },\n },\n }\n }),\n\n executeToolPipeline: async (widgetId: string, sourceData: unknown) => {\n const widget = get().widgets[widgetId]\n if (!widget) return\n\n // Cancel any in-progress pipeline for this widget\n const currentExecution = (activePipelines.get(widgetId) ?? 0) + 1\n activePipelines.set(widgetId, currentExecution)\n\n const widgetWithTools = widget\n\n // Build set of tool IDs that should be disabled\n const disabledToolIds = new Set<string>()\n for (const tool of widgetWithTools.registeredTools ?? []) {\n if (tool.enabled && tool.disables) {\n tool.disables.forEach((id) => disabledToolIds.add(id))\n }\n }\n\n // Sort tools by order and filter enabled only, excluding disabled tools\n const sortedTools = [...(widgetWithTools.registeredTools ?? [])]\n .filter((tool) => tool.enabled && !disabledToolIds.has(tool.id))\n .sort((a, b) => a.order - b.order)\n\n // Execute pipeline - handle both sync and async tools\n let transformedData = sourceData\n for (const tool of sortedTools) {\n // Check if this execution was cancelled\n if (activePipelines.get(widgetId) !== currentExecution) {\n return\n }\n\n try {\n // Call tool function (may return Promise or direct value)\n const result = tool.fn(transformedData, tool.config)\n\n // Await if Promise, otherwise use directly\n transformedData = result instanceof Promise ? await result : result\n } catch (error) {\n // eslint-disable-next-line no-console\n console.error(`Tool ${tool.id} failed for widget ${widgetId}:`, error)\n // Continue with current data to prevent one tool from breaking all\n }\n }\n\n // Final check before updating store (in case cancelled during async operation)\n if (activePipelines.get(widgetId) !== currentExecution) {\n return\n }\n\n // Single store update with final transformed data\n set((state) => {\n const currentWidget = state.widgets[widgetId]\n if (!currentWidget) return state\n\n return {\n widgets: {\n ...state.widgets,\n [widgetId]: {\n ...currentWidget,\n data: transformedData,\n },\n },\n }\n })\n\n // Clean up tracking\n if (activePipelines.get(widgetId) === currentExecution) {\n activePipelines.delete(widgetId)\n }\n },\n}))\n"],"names":["activePipelines","Map","useWidgetStore","create","set","get","widgets","setWidget","id","widget","state","current","removeWidget","clearWidgets","getWidget","registerTool","widgetId","tool","filteredTools","registeredTools","filter","t","unregisterTool","toolId","updateToolConfig","config","updatedTools","map","setToolEnabled","enabled","executeToolPipeline","sourceData","currentExecution","widgetWithTools","disabledToolIds","Set","disables","forEach","add","sortedTools","has","sort","a","b","order","transformedData","result","fn","Promise","error","console","currentWidget","data","delete"],"mappings":";AAIA,MAAMA,wBAAsBC,IAAAA,GAuCfC,IAAiBC,EAAAA,EAAsB,CAACC,GAAKC,OAAS;AAAA;AAAA,EAEjEC,SAAS,CAAA;AAAA;AAAA,EAGTC,WAAWA,CAACC,GAAIC,MACdL,EAAKM,CAAAA,MAAU;AACb,UAAMC,IACJD,EAAMJ,QAAQE,CAAE,KAAM,CAAA;AACxB,WAAO;AAAA,MACLF,SAAS;AAAA,QACP,GAAGI,EAAMJ;AAAAA,QACT,CAACE,CAAE,GAAG;AAAA,UACJ,GAAGG;AAAAA,UACH,GAAGF;AAAAA,UACHD,IAAAA;AAAAA,QAAAA;AAAAA,MACF;AAAA,IACF;AAAA,EAEJ,CAAC;AAAA,EAEHI,cAAeJ,CAAAA,MACbJ,EAAKM,CAAAA,MAAU;AACb,UAAMJ,IAAU;AAAA,MAAE,GAAGI,EAAMJ;AAAAA,IAAAA;AAE3B,kBAAOA,EAAQE,CAAE,GAEV;AAAA,MAAEF,SAAAA;AAAAA,IAAAA;AAAAA,EACX,CAAC;AAAA,EAEHO,cAAcA,MACZT,EAAI;AAAA,IACFE,SAAS,CAAA;AAAA,EAAC,CACX;AAAA,EAEHQ,WAAW,CAAwBN,MAC1BH,EAAAA,EAAMC,QAAQE,CAAE;AAAA,EAGzBO,cAAcA,CAACC,GAAkBC,MAC/Bb,EAAKM,CAAAA,MAAU;AACb,UAAMC,IAAUD,EAAMJ,QAAQU,CAAQ,KAAM,CAAA,GAItCE,KAHkBP,EAAQQ,mBAAmB,CAAA,GAGbC,OACpC,CAACC,MAAwBA,EAAEb,OAAOS,EAAKT,EACzC;AAEA,WAAO;AAAA,MACLF,SAAS;AAAA,QACP,GAAGI,EAAMJ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AM;AAGnDoB,QAAAA,IAAkBC,aAAkBE,UAAU,MAAMF,IAASA;AAAAA,MAC/D,SAASG,GAAO;AAEdC,gBAAQD,MAAM,QAAQhC,EAAKT,EAAE,sBAAsBQ,CAAQ,KAAKiC,CAAK;AAAA,MAEvE;AAAA,IACF;AAGA,IAAIjD,EAAgBK,IAAIW,CAAQ,MAAMgB,MAKtC5B,EAAKM,CAAAA,MAAU;AACb,YAAMyC,IAAgBzC,EAAMJ,QAAQU,CAAQ;AAC5C,aAAKmC,IAEE;AAAA,QACL7C,SAAS;AAAA,UACP,GAAGI,EAAMJ;AAAAA,UACT,CAACU,CAAQ,GAAG;AAAA,YACV,GAAGmC;AAAAA,YACHC,MAAMP;AAAAA,UAAAA;AAAAA,QACR;AAAA,MACF,IATyBnC;AAAAA,IAW7B,CAAC,GAGGV,EAAgBK,IAAIW,CAAQ,MAAMgB,KACpChC,EAAgBqD,OAAOrC,CAAQ;AAAA,EAEnC;AACF,EAAE;"}
@@ -1,7 +1,7 @@
1
1
  import { jsx as g, jsxs as X, Fragment as ce } from "react/jsx-runtime";
2
2
  import { c as K } from "react/compiler-runtime";
3
3
  import { IconButton as q, DialogContent as Se, Typography as ve, DialogTitle as Ie, Dialog as Ce, CircularProgress as _e, MenuItem as ge, ListItemIcon as Te, ListItemText as pe, Menu as he, useTheme as ke, Box as ye, TextField as xe, InputAdornment as de, SvgIcon as Ee } from "@mui/material";
4
- import { u as O } from "../widget-store-DNyVElxd.js";
4
+ import { u as O } from "../widget-store-Dd7_sWZT.js";
5
5
  import { FullscreenOutlined as Le, Close as we, FileDownloadOutlined as ze, PercentOutlined as $e, SubdirectoryArrowLeftOutlined as We, ZoomInOutlined as De, CheckBoxOutlined as Oe, SearchOutlined as be, ClearOutlined as Re } from "@mui/icons-material";
6
6
  import { useShallow as Q } from "zustand/shallow";
7
7
  import { useState as re, useEffect as j, useRef as se } from "react";
@@ -2,7 +2,7 @@ import { jsxs as s, jsx as n } from "react/jsx-runtime";
2
2
  import { c as m } from "react/compiler-runtime";
3
3
  import "react";
4
4
  import "echarts";
5
- import "../widget-store-DNyVElxd.js";
5
+ import "../widget-store-Dd7_sWZT.js";
6
6
  import "zustand/shallow";
7
7
  import { g } from "../options-D9wflre6.js";
8
8
  import { m as f } from "../utils-Dv5Z47UQ.js";