@embeddable.com/remarkable-ui 0.1.49 → 0.1.51

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 (100) hide show
  1. package/dist/BarChartDefaultHorizontalPro.js +18 -17
  2. package/dist/BarChartDefaultHorizontalPro.js.map +1 -1
  3. package/dist/BarChartDefaultPro.js +18 -17
  4. package/dist/BarChartDefaultPro.js.map +1 -1
  5. package/dist/BarChartGroupedHorizontalPro.js +20 -19
  6. package/dist/BarChartGroupedHorizontalPro.js.map +1 -1
  7. package/dist/BarChartGroupedPro.js +20 -19
  8. package/dist/BarChartGroupedPro.js.map +1 -1
  9. package/dist/BarChartStackedHorizontalPro.js +24 -23
  10. package/dist/BarChartStackedHorizontalPro.js.map +1 -1
  11. package/dist/BarChartStackedPro.js +24 -23
  12. package/dist/BarChartStackedPro.js.map +1 -1
  13. package/dist/{ChartCard-CMgDz_bs.js → ChartCard-D-0O5ugW.js} +37 -37
  14. package/dist/{ChartCard-CMgDz_bs.js.map → ChartCard-D-0O5ugW.js.map} +1 -1
  15. package/dist/{ComparisonPeriod.type.emb-C1o3iM9L.js → ComparisonPeriod.type.emb-CYp3nw-9.js} +2 -2
  16. package/dist/{ComparisonPeriod.type.emb-C1o3iM9L.js.map → ComparisonPeriod.type.emb-CYp3nw-9.js.map} +1 -1
  17. package/dist/ComparisonPeriodSelectFieldPro.js +8 -8
  18. package/dist/DateRangeSelectFieldPro.js +2 -2
  19. package/dist/DonutChartPro.js +2 -2
  20. package/dist/DonutLabelChartPro.js +2 -2
  21. package/dist/{EditorCard-CJoUz4uM.js → EditorCard-BhC7oToX.js} +15 -15
  22. package/dist/{EditorCard-CJoUz4uM.js.map → EditorCard-BhC7oToX.js.map} +1 -1
  23. package/dist/HeatMap-By9_uzV_.js +223 -0
  24. package/dist/HeatMap-By9_uzV_.js.map +1 -0
  25. package/dist/HeatMapPro.js +138 -0
  26. package/dist/HeatMapPro.js.map +1 -0
  27. package/dist/{KpiChart-C6zepuhF.js → KpiChart-CS9s8nJ4.js} +10 -10
  28. package/dist/{KpiChart-C6zepuhF.js.map → KpiChart-CS9s8nJ4.js.map} +1 -1
  29. package/dist/KpiChartNumberComparisonPro.js +29 -29
  30. package/dist/KpiChartNumberPro.js +4 -4
  31. package/dist/LineChartComparisonDefaultPro.js +13 -13
  32. package/dist/LineChartDefaultPro.js +10 -10
  33. package/dist/LineChartGroupedPro.js +6 -6
  34. package/dist/MultiSelectFieldPro.js +2 -2
  35. package/dist/PieChartPro.js +2 -2
  36. package/dist/PivotTable-Cx4WG6MV.js +273 -0
  37. package/dist/PivotTable-Cx4WG6MV.js.map +1 -0
  38. package/dist/PivotTablePro.js +43 -43
  39. package/dist/PivotTablePro.js.map +1 -1
  40. package/dist/{SingleSelectField-CJNiLfee.js → SingleSelectField-DlVCi5Ej.js} +15 -15
  41. package/dist/{SingleSelectField-CJNiLfee.js.map → SingleSelectField-DlVCi5Ej.js.map} +1 -1
  42. package/dist/SingleSelectFieldPro.js +2 -2
  43. package/dist/TableChartPaginated.js +27 -27
  44. package/dist/bars.utils-DTdoPs5N.js +146 -0
  45. package/dist/bars.utils-DTdoPs5N.js.map +1 -0
  46. package/dist/{charts.utils-HfNL9dVl.js → charts.utils-D9TXwxGs.js} +4 -4
  47. package/dist/charts.utils-D9TXwxGs.js.map +1 -0
  48. package/dist/{component.constants-CFaxyNCw.js → component.constants-DCOqCFoY.js} +3286 -3124
  49. package/dist/component.constants-DCOqCFoY.js.map +1 -0
  50. package/dist/embeddable-components.json +12 -11
  51. package/dist/embeddable-theme-2b917.js +1 -1
  52. package/dist/{formatter.utils-Cu4uKJSZ.js → formatter.utils-B80iNq9Q.js} +2 -2
  53. package/dist/{formatter.utils-Cu4uKJSZ.js.map → formatter.utils-B80iNq9Q.js.map} +1 -1
  54. package/dist/{index-BAfVF5iP.js → index--tdFwk_H.js} +7 -7
  55. package/dist/{index-BAfVF5iP.js.map → index--tdFwk_H.js.map} +1 -1
  56. package/dist/{index-DvEWwlqq.js → index-BcPj51g3.js} +23 -23
  57. package/dist/{index-DvEWwlqq.js.map → index-BcPj51g3.js.map} +1 -1
  58. package/dist/{index-CxxeUDMD.js → index-C3o3AQpK.js} +11 -11
  59. package/dist/{index-CxxeUDMD.js.map → index-C3o3AQpK.js.map} +1 -1
  60. package/dist/{index-C4BiW71l.js → index-CmE__sUg.js} +8 -8
  61. package/dist/{index-C4BiW71l.js.map → index-CmE__sUg.js.map} +1 -1
  62. package/dist/{index-DW-LmiPi.js → index-D4oPbYPT.js} +8 -8
  63. package/dist/{index-DW-LmiPi.js.map → index-D4oPbYPT.js.map} +1 -1
  64. package/dist/{index-DvMr1tvf.js → index-DpIR-B0R.js} +18 -18
  65. package/dist/{index-DvMr1tvf.js.map → index-DpIR-B0R.js.map} +1 -1
  66. package/dist/index.js +148 -138
  67. package/dist/index.js.map +1 -1
  68. package/dist/{pies.utils-JpKM3rVw.js → pies.utils-DEkgZgVk.js} +6 -6
  69. package/dist/{pies.utils-JpKM3rVw.js.map → pies.utils-DEkgZgVk.js.map} +1 -1
  70. package/dist/remarkable-pro/components/charts/tables/HeatMapPro/index.d.ts +29 -0
  71. package/dist/remarkable-pro/components/charts/tables/HeatMapPro/index.d.ts.map +1 -0
  72. package/dist/remarkable-pro/components/component.constants.d.ts +7 -0
  73. package/dist/remarkable-pro/components/component.constants.d.ts.map +1 -1
  74. package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.d.ts +3 -0
  75. package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.d.ts.map +1 -0
  76. package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.stories.d.ts +9 -0
  77. package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.stories.d.ts.map +1 -0
  78. package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.types.d.ts +30 -0
  79. package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.types.d.ts.map +1 -0
  80. package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.utils.d.ts +43 -0
  81. package/dist/remarkable-ui/charts/tables/HeatMap/HeatMap.utils.d.ts.map +1 -0
  82. package/dist/remarkable-ui/charts/tables/PivotTable/PivotTable.d.ts.map +1 -1
  83. package/dist/remarkable-ui/charts/tables/PivotTable/PivotTable.types.d.ts +1 -0
  84. package/dist/remarkable-ui/charts/tables/PivotTable/PivotTable.types.d.ts.map +1 -1
  85. package/dist/remarkable-ui/charts/tables/tables.utils.d.ts +6 -0
  86. package/dist/remarkable-ui/charts/tables/tables.utils.d.ts.map +1 -0
  87. package/dist/remarkable-ui/index.d.ts +6 -1
  88. package/dist/remarkable-ui/index.d.ts.map +1 -1
  89. package/dist/remarkable-ui.css +1 -1
  90. package/dist/tables.utils-D7KXdM2S.js +9 -0
  91. package/dist/tables.utils-D7KXdM2S.js.map +1 -0
  92. package/dist/{timeRange.utils-Z2lmKTCB.js → timeRange.utils-u1NZ0u7o.js} +2 -2
  93. package/dist/{timeRange.utils-Z2lmKTCB.js.map → timeRange.utils-u1NZ0u7o.js.map} +1 -1
  94. package/package.json +1 -1
  95. package/dist/PivotTable-SNPquHl0.js +0 -253
  96. package/dist/PivotTable-SNPquHl0.js.map +0 -1
  97. package/dist/bars.utils-vXPRJDGQ.js +0 -311
  98. package/dist/bars.utils-vXPRJDGQ.js.map +0 -1
  99. package/dist/charts.utils-HfNL9dVl.js.map +0 -1
  100. package/dist/component.constants-CFaxyNCw.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"KpiChart-C6zepuhF.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingDown.mjs","../node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingUp.mjs","../src/remarkable-ui/charts/kpis/components/KpiChartChange.tsx","../src/remarkable-ui/charts/kpis/KpiChart.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.35.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 7l6 6l4 -4l8 8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 10l0 7l-7 0\", \"key\": \"svg-1\" }]];\nconst IconTrendingDown = createReactComponent(\"outline\", \"trending-down\", \"TrendingDown\", __iconNode);\n\nexport { __iconNode, IconTrendingDown as default };\n//# sourceMappingURL=IconTrendingDown.mjs.map\n","/**\n * @license @tabler/icons-react v3.35.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 17l6 -6l4 4l8 -8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M14 7l7 0l0 7\", \"key\": \"svg-1\" }]];\nconst IconTrendingUp = createReactComponent(\"outline\", \"trending-up\", \"TrendingUp\", __iconNode);\n\nexport { __iconNode, IconTrendingUp as default };\n//# sourceMappingURL=IconTrendingUp.mjs.map\n","import { FC } from 'react';\nimport styles from './KpiChartChange.module.css';\nimport clsx from 'clsx';\nimport { Typography } from '../../../shared/Typography/Typography';\nimport { IconTrendingDown, IconTrendingUp } from '@tabler/icons-react';\nimport { KpiChartProps } from '../KpiChart.types';\n\nconst getChangeClass = (isPositive: boolean, invertChangeColors: boolean) => {\n if (isPositive) return invertChangeColors ? styles.negative : styles.positive;\n return invertChangeColors ? styles.positive : styles.negative;\n};\n\ntype KpiChartChangeProps = KpiChartProps & { className?: string };\n\nexport const KpiChartChange: FC<KpiChartChangeProps> = ({\n value,\n comparisonValue = 0,\n showChangeAsPercentage,\n invertChangeColors = false,\n comparisonLabel,\n valueFormatter,\n percentageDecimalPlaces = 1,\n className,\n}) => {\n const difference = value - comparisonValue;\n const isPositive = difference > 0;\n\n let differenceLabel: string;\n\n if (showChangeAsPercentage) {\n const percentage = comparisonValue === 0 ? 0 : (difference / comparisonValue) * 100;\n differenceLabel = `${percentage.toFixed(percentageDecimalPlaces)}%`;\n } else {\n differenceLabel = valueFormatter ? valueFormatter(difference) : difference.toString();\n }\n\n const displayValue = `${isPositive ? '+' : ''}${differenceLabel}`;\n\n const Icon = isPositive ? IconTrendingUp : IconTrendingDown;\n\n return (\n <div className={clsx(className, styles.kpiChartChangeContainer)}>\n <div className={clsx(styles.kpiChangeBadge, getChangeClass(isPositive, invertChangeColors))}>\n <Icon />\n <Typography>{displayValue}</Typography>\n </div>\n {comparisonLabel && <Typography>{comparisonLabel}</Typography>}\n </div>\n );\n};\n","import { FC } from 'react';\nimport { Typography } from '../../shared/Typography/Typography';\nimport styles from './KpiChart.module.css';\nimport { KpiChartChange } from './components/KpiChartChange';\nimport { KpiChartProps } from './KpiChart.types';\nimport clsx from 'clsx';\n\nexport const KpiChart: FC<KpiChartProps> = ({\n value,\n changeFontSize,\n comparisonValue,\n comparisonLabel,\n invertChangeColors,\n showChangeAsPercentage,\n percentageDecimalPlaces = 1,\n equalComparisonLabel = 'No change',\n valueFontSize,\n valueFormatter,\n}) => {\n const hasComparisonValue = comparisonValue !== undefined;\n const equalComparison = hasComparisonValue && comparisonValue === value;\n\n const displayValue = value === undefined ? '' : valueFormatter ? valueFormatter(value) : value;\n\n return (\n <div className={styles.kpiChartContainer}>\n <Typography style={{ fontSize: valueFontSize }}>{displayValue}</Typography>\n <div className={styles.kpiComparisonContainer} style={{ fontSize: changeFontSize }}>\n {equalComparison ? (\n <Typography>{equalComparisonLabel}</Typography>\n ) : (\n <KpiChartChange\n changeFontSize={changeFontSize}\n className={clsx(!hasComparisonValue && styles.kpiChangeHidden)}\n comparisonLabel={comparisonLabel}\n comparisonValue={comparisonValue}\n invertChangeColors={invertChangeColors}\n percentageDecimalPlaces={percentageDecimalPlaces}\n showChangeAsPercentage={showChangeAsPercentage}\n value={value}\n valueFormatter={valueFormatter}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["__iconNode","IconTrendingDown","createReactComponent","IconTrendingUp","getChangeClass","isPositive","invertChangeColors","styles","KpiChartChange","value","comparisonValue","showChangeAsPercentage","comparisonLabel","valueFormatter","percentageDecimalPlaces","className","difference","differenceLabel","displayValue","Icon","clsx","jsxs","jsx","Typography","KpiChart","changeFontSize","equalComparisonLabel","valueFontSize","hasComparisonValue","equalComparison"],"mappings":"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","x_google_ignoreList":[0,1]}
1
+ {"version":3,"file":"KpiChart-CS9s8nJ4.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingDown.mjs","../node_modules/@tabler/icons-react/dist/esm/icons/IconTrendingUp.mjs","../src/remarkable-ui/charts/kpis/components/KpiChartChange.tsx","../src/remarkable-ui/charts/kpis/KpiChart.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.35.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 7l6 6l4 -4l8 8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 10l0 7l-7 0\", \"key\": \"svg-1\" }]];\nconst IconTrendingDown = createReactComponent(\"outline\", \"trending-down\", \"TrendingDown\", __iconNode);\n\nexport { __iconNode, IconTrendingDown as default };\n//# sourceMappingURL=IconTrendingDown.mjs.map\n","/**\n * @license @tabler/icons-react v3.35.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M3 17l6 -6l4 4l8 -8\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M14 7l7 0l0 7\", \"key\": \"svg-1\" }]];\nconst IconTrendingUp = createReactComponent(\"outline\", \"trending-up\", \"TrendingUp\", __iconNode);\n\nexport { __iconNode, IconTrendingUp as default };\n//# sourceMappingURL=IconTrendingUp.mjs.map\n","import { FC } from 'react';\nimport styles from './KpiChartChange.module.css';\nimport clsx from 'clsx';\nimport { Typography } from '../../../shared/Typography/Typography';\nimport { IconTrendingDown, IconTrendingUp } from '@tabler/icons-react';\nimport { KpiChartProps } from '../KpiChart.types';\n\nconst getChangeClass = (isPositive: boolean, invertChangeColors: boolean) => {\n if (isPositive) return invertChangeColors ? styles.negative : styles.positive;\n return invertChangeColors ? styles.positive : styles.negative;\n};\n\ntype KpiChartChangeProps = KpiChartProps & { className?: string };\n\nexport const KpiChartChange: FC<KpiChartChangeProps> = ({\n value,\n comparisonValue = 0,\n showChangeAsPercentage,\n invertChangeColors = false,\n comparisonLabel,\n valueFormatter,\n percentageDecimalPlaces = 1,\n className,\n}) => {\n const difference = value - comparisonValue;\n const isPositive = difference > 0;\n\n let differenceLabel: string;\n\n if (showChangeAsPercentage) {\n const percentage = comparisonValue === 0 ? 0 : (difference / comparisonValue) * 100;\n differenceLabel = `${percentage.toFixed(percentageDecimalPlaces)}%`;\n } else {\n differenceLabel = valueFormatter ? valueFormatter(difference) : difference.toString();\n }\n\n const displayValue = `${isPositive ? '+' : ''}${differenceLabel}`;\n\n const Icon = isPositive ? IconTrendingUp : IconTrendingDown;\n\n return (\n <div className={clsx(className, styles.kpiChartChangeContainer)}>\n <div className={clsx(styles.kpiChangeBadge, getChangeClass(isPositive, invertChangeColors))}>\n <Icon />\n <Typography>{displayValue}</Typography>\n </div>\n {comparisonLabel && <Typography>{comparisonLabel}</Typography>}\n </div>\n );\n};\n","import { FC } from 'react';\nimport { Typography } from '../../shared/Typography/Typography';\nimport styles from './KpiChart.module.css';\nimport { KpiChartChange } from './components/KpiChartChange';\nimport { KpiChartProps } from './KpiChart.types';\nimport clsx from 'clsx';\n\nexport const KpiChart: FC<KpiChartProps> = ({\n value,\n changeFontSize,\n comparisonValue,\n comparisonLabel,\n invertChangeColors,\n showChangeAsPercentage,\n percentageDecimalPlaces = 1,\n equalComparisonLabel = 'No change',\n valueFontSize,\n valueFormatter,\n}) => {\n const hasComparisonValue = comparisonValue !== undefined;\n const equalComparison = hasComparisonValue && comparisonValue === value;\n\n const displayValue = value === undefined ? '' : valueFormatter ? valueFormatter(value) : value;\n\n return (\n <div className={styles.kpiChartContainer}>\n <Typography style={{ fontSize: valueFontSize }}>{displayValue}</Typography>\n <div className={styles.kpiComparisonContainer} style={{ fontSize: changeFontSize }}>\n {equalComparison ? (\n <Typography>{equalComparisonLabel}</Typography>\n ) : (\n <KpiChartChange\n changeFontSize={changeFontSize}\n className={clsx(!hasComparisonValue && styles.kpiChangeHidden)}\n comparisonLabel={comparisonLabel}\n comparisonValue={comparisonValue}\n invertChangeColors={invertChangeColors}\n percentageDecimalPlaces={percentageDecimalPlaces}\n showChangeAsPercentage={showChangeAsPercentage}\n value={value}\n valueFormatter={valueFormatter}\n />\n )}\n </div>\n </div>\n );\n};\n"],"names":["__iconNode","IconTrendingDown","createReactComponent","IconTrendingUp","getChangeClass","isPositive","invertChangeColors","styles","KpiChartChange","value","comparisonValue","showChangeAsPercentage","comparisonLabel","valueFormatter","percentageDecimalPlaces","className","difference","differenceLabel","displayValue","Icon","clsx","jsxs","jsx","Typography","KpiChart","changeFontSize","equalComparisonLabel","valueFontSize","hasComparisonValue","equalComparison"],"mappings":"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","x_google_ignoreList":[0,1]}
@@ -1,38 +1,38 @@
1
1
  import { useTheme as j, defineComponent as w } from "@embeddable.com/react";
2
- import { i as A, r as Y, U as l, j as y, d as q, w as B, W as E, X as M, t as I, c as J, Y as b, Z as c, o as v } from "./component.constants-CFaxyNCw.js";
3
- import { C as O } from "./ChartCard-CMgDz_bs.js";
4
- import { useEffect as U } from "react";
5
- import { K as W } from "./KpiChart-C6zepuhF.js";
6
- import { g as X } from "./formatter.utils-Cu4uKJSZ.js";
7
- import { g as Z, a as $ } from "./timeRange.utils-Z2lmKTCB.js";
8
- import { C as k } from "./ComparisonPeriod.type.emb-C1o3iM9L.js";
9
- const G = (e) => {
2
+ import { i as A, r as q, F as l, j as y, d as B, w as E, G as I, H as J, t as M, c as Y, I as b, J as c, o as v } from "./component.constants-DCOqCFoY.js";
3
+ import { C as G } from "./ChartCard-D-0O5ugW.js";
4
+ import { useEffect as H } from "react";
5
+ import { K as O } from "./KpiChart-CS9s8nJ4.js";
6
+ import { g as $ } from "./formatter.utils-B80iNq9Q.js";
7
+ import { g as k, a as Q } from "./timeRange.utils-u1NZ0u7o.js";
8
+ import { C as U } from "./ComparisonPeriod.type.emb-CYp3nw-9.js";
9
+ const W = (e) => {
10
10
  var d, C, P, h, u, f;
11
11
  const a = j();
12
12
  A(a);
13
- const { title: i, description: n } = Y(e), {
13
+ const { title: i, description: n } = q(e), {
14
14
  changeFontSize: D,
15
15
  comparisonPeriod: s,
16
16
  comparisonDateRange: R,
17
- displayChangeAsPercentage: N,
18
- fontSize: S,
17
+ displayChangeAsPercentage: F,
18
+ fontSize: N,
19
19
  measure: t,
20
20
  primaryDateRange: p,
21
21
  results: r,
22
22
  resultsComparison: o,
23
- reversePositiveNegativeColors: F,
23
+ reversePositiveNegativeColors: S,
24
24
  percentageDecimalPlaces: z,
25
25
  setComparisonDateRange: K
26
26
  } = e;
27
- U(() => {
28
- const m = Z(
27
+ H(() => {
28
+ const m = k(
29
29
  p,
30
30
  s,
31
31
  a
32
32
  );
33
33
  K(m);
34
34
  }, [s, JSON.stringify(p), a]);
35
- const L = (C = (d = r.data) == null ? void 0 : d[0]) == null ? void 0 : C[t.name], T = R ? (h = (P = o == null ? void 0 : o.data) == null ? void 0 : P[0]) == null ? void 0 : h[t.name] : void 0, V = X(a), x = (m) => V.data(t, m), _ = `vs ${$(s, a).toLowerCase()}`, g = {
35
+ const L = (C = (d = r.data) == null ? void 0 : d[0]) == null ? void 0 : C[t.name], T = R ? (h = (P = o == null ? void 0 : o.data) == null ? void 0 : P[0]) == null ? void 0 : h[t.name] : void 0, V = $(a), x = (m) => V.data(t, m), _ = `vs ${Q(s, a).toLowerCase()}`, g = {
36
36
  isLoading: !!(r.isLoading || o != null && o.isLoading),
37
37
  data: !(r != null && r.data) && !(o != null && o.data) ? void 0 : [
38
38
  ...(u = r.data) != null && u.length ? [{ label: l.t("charts.primaryPeriod"), ...r.data[0] }] : [],
@@ -40,7 +40,7 @@ const G = (e) => {
40
40
  ]
41
41
  };
42
42
  return /* @__PURE__ */ y.jsx(
43
- O,
43
+ G,
44
44
  {
45
45
  data: g,
46
46
  dimensionsAndMeasures: [
@@ -57,31 +57,31 @@ const G = (e) => {
57
57
  subtitle: n,
58
58
  title: i,
59
59
  children: /* @__PURE__ */ y.jsx(
60
- W,
60
+ O,
61
61
  {
62
62
  value: L,
63
63
  comparisonValue: g.isLoading ? void 0 : T,
64
64
  valueFormatter: x,
65
- valueFontSize: S,
65
+ valueFontSize: N,
66
66
  changeFontSize: D,
67
- invertChangeColors: F,
68
- showChangeAsPercentage: N,
67
+ invertChangeColors: S,
68
+ showChangeAsPercentage: F,
69
69
  comparisonLabel: _,
70
70
  percentageDecimalPlaces: z
71
71
  }
72
72
  )
73
73
  }
74
74
  );
75
- }, H = {
75
+ }, X = {
76
76
  name: "KpiChartNumberComparisonPro",
77
77
  label: "Kpi Chart - Number Comparison",
78
78
  category: "Kpi Charts",
79
79
  inputs: [
80
- q,
81
80
  B,
82
- { ...E, name: "timeProperty", label: "Time Property" },
81
+ E,
82
+ { ...I, name: "timeProperty", label: "Time Property" },
83
83
  {
84
- ...M,
84
+ ...J,
85
85
  name: "primaryDateRange",
86
86
  label: "Primary Date Range",
87
87
  description: "You can also connect this to a date range selector using its variable",
@@ -89,13 +89,13 @@ const G = (e) => {
89
89
  },
90
90
  {
91
91
  name: "comparisonPeriod",
92
- type: k,
92
+ type: U,
93
93
  label: "Comparison Period",
94
94
  description: "You can also connect this to a comparison period selector using its variable",
95
95
  category: "Component Data"
96
96
  },
97
- I,
98
- J,
97
+ M,
98
+ Y,
99
99
  {
100
100
  ...b,
101
101
  name: "displayChangeAsPercentage",
@@ -123,7 +123,7 @@ const G = (e) => {
123
123
  required: !0
124
124
  }
125
125
  ]
126
- }, se = w(G, H, {
126
+ }, se = w(W, X, {
127
127
  /* @ts-expect-error - to be fixed in @embeddable.com/react */
128
128
  props: (e, [a, i]) => ({
129
129
  ...e,
@@ -157,6 +157,6 @@ const G = (e) => {
157
157
  });
158
158
  export {
159
159
  se as default,
160
- H as meta
160
+ X as meta
161
161
  };
162
162
  //# sourceMappingURL=KpiChartNumberComparisonPro.js.map
@@ -1,9 +1,9 @@
1
1
  import { useTheme as h, defineComponent as f } from "@embeddable.com/react";
2
- import { i as C, r as b, j as m, d as K, w as g, t as x, c as F, Z as N, o as S } from "./component.constants-CFaxyNCw.js";
3
- import { C as j } from "./ChartCard-CMgDz_bs.js";
2
+ import { i as C, r as b, j as m, d as K, w as g, t as x, c as F, J as N, o as S } from "./component.constants-DCOqCFoY.js";
3
+ import { C as j } from "./ChartCard-D-0O5ugW.js";
4
4
  import "react";
5
- import { K as v } from "./KpiChart-C6zepuhF.js";
6
- import { g as z } from "./formatter.utils-Cu4uKJSZ.js";
5
+ import { K as v } from "./KpiChart-CS9s8nJ4.js";
6
+ import { g as z } from "./formatter.utils-B80iNq9Q.js";
7
7
  const P = (e) => {
8
8
  var s, o;
9
9
  const a = h();
@@ -1,14 +1,14 @@
1
1
  import { useTheme as Y, defineComponent as _ } from "@embeddable.com/react";
2
- import { m as E, E as G, C as w, U, _ as I, $ as O, i as q, r as z, j as V, a0 as K, d as J, a as B, Y as A, a1 as S, z as W, X as H, W as Q, t as Z, c as ee, s as ae, e as se, f as ne, g as te, x as ie, y as oe, p as re, q as le, u as me, A as de, V as ce, o as F } from "./component.constants-CFaxyNCw.js";
3
- import { C as pe } from "./ChartCard-CMgDz_bs.js";
2
+ import { m as G, E, K as w, F as K, L as I, M as O, i as q, r as z, j as V, N as U, d as H, a as B, I as A, O as S, z as J, H as Q, G as W, t as Z, c as ee, s as ae, e as se, f as ne, g as te, x as ie, y as oe, p as re, q as le, u as me, A as de, V as ce, o as F } from "./component.constants-DCOqCFoY.js";
3
+ import { C as pe } from "./ChartCard-D-0O5ugW.js";
4
4
  import { useEffect as ue } from "react";
5
- import { g as ge } from "./timeRange.utils-Z2lmKTCB.js";
6
- import { g as M } from "./formatter.utils-Cu4uKJSZ.js";
5
+ import { g as ge } from "./timeRange.utils-u1NZ0u7o.js";
6
+ import { g as M } from "./formatter.utils-B80iNq9Q.js";
7
7
  import { g as xe, a as he } from "./object.utils-D_Zzon-H.js";
8
8
  import { i as be, s as Ce } from "./color.utils-CVyp-fGP.js";
9
9
  import { g as fe } from "./lines.utils-CFEUUo4k.js";
10
10
  import { u as N } from "./charts.fillGaps.hooks-5WclK2CD.js";
11
- import { C as ye } from "./ComparisonPeriod.type.emb-C1o3iM9L.js";
11
+ import { C as ye } from "./ComparisonPeriod.type.emb-CYp3nw-9.js";
12
12
  const L = "mainAxis", v = "comparisonAxis", $ = (a, t) => {
13
13
  var P, k, h, u;
14
14
  const { data: n, measure: i, dimension: s, index: c, isPreviousPeriod: r, hasMinMaxYAxisRange: b, labels: e } = a, p = n == null ? void 0 : n.map((C) => C[s.name]), l = !!((P = i.inputs) != null && P.connectGaps), g = e ? e.map((C) => {
@@ -17,14 +17,14 @@ const L = "mainAxis", v = "comparisonAxis", $ = (a, t) => {
17
17
  }) : n == null ? void 0 : n.map((C) => C[i.name] ?? (l ? 0 : null)), x = M(t), f = xe(t), o = !!((k = i.inputs) != null && k[r ? "previousLineDashed" : "lineDashed"]), m = (h = i.inputs) == null ? void 0 : h[r ? "previousLineColor" : "lineColor"], d = be(m) ? m : he(
18
18
  `${f}.charts.backgroundColors`,
19
19
  i.name,
20
- t.charts.backgroundColors ?? G,
20
+ t.charts.backgroundColors ?? E,
21
21
  c
22
22
  ), y = x.dimensionOrMeasureTitle(i);
23
23
  return {
24
24
  xAxisID: r ? v : L,
25
25
  labels: p,
26
26
  rawLabel: y,
27
- label: (r ? `${U.t("common.compared")} ` : "") + y,
27
+ label: (r ? `${K.t("common.compared")} ` : "") + y,
28
28
  data: g,
29
29
  backgroundColor: Ce(
30
30
  d,
@@ -229,7 +229,7 @@ const L = "mainAxis", v = "comparisonAxis", $ = (a, t) => {
229
229
  }, ve = (a, t) => {
230
230
  var c, r;
231
231
  const { onLineClicked: n, dimension: i } = a, s = i.nativeType === "time" ? Le : Ae;
232
- return E(
232
+ return G(
233
233
  fe({ onLineClicked: n }),
234
234
  s(a, t),
235
235
  ((r = (c = t.charts) == null ? void 0 : c.lineChartComparisonDefaultPro) == null ? void 0 : r.options) || {}
@@ -299,7 +299,7 @@ const L = "mainAxis", v = "comparisonAxis", $ = (a, t) => {
299
299
  subtitle: i,
300
300
  title: n,
301
301
  children: /* @__PURE__ */ V.jsx(
302
- K,
302
+ U,
303
303
  {
304
304
  data: D,
305
305
  reverseXAxis: p,
@@ -321,7 +321,7 @@ const L = "mainAxis", v = "comparisonAxis", $ = (a, t) => {
321
321
  label: "Line Chart Comparison - Default",
322
322
  category: "Line Charts",
323
323
  inputs: [
324
- J,
324
+ H,
325
325
  {
326
326
  ...B,
327
327
  inputs: [
@@ -348,9 +348,9 @@ const L = "mainAxis", v = "comparisonAxis", $ = (a, t) => {
348
348
  { ...A, name: "connectGaps", label: "Connect gaps", defaultValue: !0 }
349
349
  ]
350
350
  },
351
- { ...W, label: "X-axis", name: "xAxis" },
351
+ { ...J, label: "X-axis", name: "xAxis" },
352
352
  {
353
- ...H,
353
+ ...Q,
354
354
  name: "primaryDateRange",
355
355
  label: "Primary Date Range",
356
356
  description: "You can also connect this to a date range selector using its variable",
@@ -364,7 +364,7 @@ const L = "mainAxis", v = "comparisonAxis", $ = (a, t) => {
364
364
  category: "Component Data"
365
365
  },
366
366
  {
367
- ...Q,
367
+ ...W,
368
368
  name: "timePropertyForNonTimeDimensions",
369
369
  label: "Time property for non time dimensions",
370
370
  description: "Choose the time property used for filtering comparison ranges. This will be ignored if your x-axis is already time-based.",
@@ -1,7 +1,7 @@
1
1
  import { useTheme as v, defineComponent as w } from "@embeddable.com/react";
2
- import { E as f, C as g, m as R, i as F, r as P, j as A, a0 as B, d as j, a as k, Y as p, a1 as O, b as S, t as T, c as I, s as $, e as G, f as X, g as Y, x as E, y as K, p as N, q as U, u as _, A as q, V as z, o as W } from "./component.constants-CFaxyNCw.js";
3
- import { C as H } from "./ChartCard-CMgDz_bs.js";
4
- import { g as V } from "./formatter.utils-Cu4uKJSZ.js";
2
+ import { E as f, K as g, m as R, i as F, r as P, j as A, N as B, d as O, a as k, I as p, O as j, b as I, t as S, c as T, s as $, e as G, f as K, g as N, x as X, y as E, p as U, q as Y, u as _, A as q, V as z, o as W } from "./component.constants-DCOqCFoY.js";
3
+ import { C as H } from "./ChartCard-D-0O5ugW.js";
4
+ import { g as V } from "./formatter.utils-B80iNq9Q.js";
5
5
  import { g as J, a as y } from "./object.utils-D_Zzon-H.js";
6
6
  import "react";
7
7
  import { i as D, s as Q } from "./color.utils-CVyp-fGP.js";
@@ -158,14 +158,14 @@ const ee = (e, o) => {
158
158
  label: "Line Chart - Default",
159
159
  category: "Line Charts",
160
160
  inputs: [
161
- j,
161
+ O,
162
162
  {
163
163
  ...k,
164
164
  inputs: [
165
165
  ...k.inputs,
166
166
  { ...p, name: "fillUnderLine", label: "Fill under line" },
167
167
  {
168
- ...O,
168
+ ...j,
169
169
  name: "lineColor",
170
170
  label: "Line color"
171
171
  },
@@ -173,17 +173,17 @@ const ee = (e, o) => {
173
173
  { ...p, name: "dashedLine", label: "Dashed line", defaultValue: !1 }
174
174
  ]
175
175
  },
176
- { ...S, label: "X-axis", name: "xAxis" },
176
+ { ...I, label: "X-axis", name: "xAxis" },
177
+ S,
177
178
  T,
178
- I,
179
179
  $,
180
180
  G,
181
- X,
182
- Y,
183
- E,
184
181
  K,
185
182
  N,
183
+ X,
184
+ E,
186
185
  U,
186
+ Y,
187
187
  _,
188
188
  q
189
189
  ],
@@ -1,7 +1,7 @@
1
1
  import { useTheme as R, defineComponent as P } from "@embeddable.com/react";
2
- import { E as k, C as $, m as F, i as S, r as v, j as y, a0 as B, d as j, w, Y as V, b as O, z as T, t as X, c as Y, A as E, s as K, e as N, f as U, g as q, x as z, y as W, p as _, q as H, u as J, V as D, o as Q } from "./component.constants-CFaxyNCw.js";
3
- import { C as Z } from "./ChartCard-CMgDz_bs.js";
4
- import { g as M } from "./formatter.utils-Cu4uKJSZ.js";
2
+ import { E as k, K as $, m as F, i as S, r as v, j as y, N as B, d as j, w, I as V, b as O, z as T, t as K, c as N, A as X, s as E, e as U, f as Y, g as q, x as z, y as W, p as _, q as H, u as J, V as D, o as Q } from "./component.constants-DCOqCFoY.js";
3
+ import { C as Z } from "./ChartCard-D-0O5ugW.js";
4
+ import { g as M } from "./formatter.utils-B80iNq9Q.js";
5
5
  import { g as I, a as G } from "./object.utils-D_Zzon-H.js";
6
6
  import { s as ee } from "./color.utils-CVyp-fGP.js";
7
7
  import "react";
@@ -165,12 +165,12 @@ const ne = (e, o) => {
165
165
  },
166
166
  { ...O, name: "xAxis", label: "X-axis" },
167
167
  { ...T, name: "groupBy", label: "Group by" },
168
- X,
169
- Y,
170
- E,
171
168
  K,
172
169
  N,
170
+ X,
171
+ E,
173
172
  U,
173
+ Y,
174
174
  q,
175
175
  z,
176
176
  W,
@@ -1,6 +1,6 @@
1
1
  import { defineComponent as i } from "@embeddable.com/react";
2
- import { d as r, z as s, t as d, c as u, ae as m, V as t, o as c } from "./component.constants-CFaxyNCw.js";
3
- import { M as p, a as f } from "./index-DvEWwlqq.js";
2
+ import { d as r, z as s, t as d, c as u, a1 as m, V as t, o as c } from "./component.constants-DCOqCFoY.js";
3
+ import { M as p, a as f } from "./index-BcPj51g3.js";
4
4
  const g = {
5
5
  name: "MultiSelectFieldPro",
6
6
  label: "Multi Select Field",
@@ -1,6 +1,6 @@
1
- import { d as a, w as s, z as t, t as o, c as n, s as i, a3 as r, e as m, f as l, V as d, o as c } from "./component.constants-CFaxyNCw.js";
1
+ import { d as a, w as s, z as t, t as o, c as n, s as i, Q as r, e as m, f as l, V as d, o as c } from "./component.constants-DCOqCFoY.js";
2
2
  import { defineComponent as p } from "@embeddable.com/react";
3
- import { P as u } from "./index-DW-LmiPi.js";
3
+ import { P as u } from "./index-D4oPbYPT.js";
4
4
  const C = {
5
5
  name: "PieChartPro",
6
6
  label: "Pie Chart",
@@ -0,0 +1,273 @@
1
+ import { j as c, a3 as i, a4 as d } from "./component.constants-DCOqCFoY.js";
2
+ import { useMemo as N, useState as Y, useEffect as Z } from "react";
3
+ import { g as I } from "./tables.utils-D7KXdM2S.js";
4
+ const L = "_pivotTableContainer_1tysn_2", D = "_tableContainer_1tysn_7", m = "_fullWidth_1tysn_23", tt = "_table_1tysn_7", lt = "_cell_1tysn_87", et = "_header_1tysn_112", ct = "_bold_1tysn_117", n = {
5
+ pivotTableContainer: L,
6
+ tableContainer: D,
7
+ fullWidth: m,
8
+ table: tt,
9
+ cell: lt,
10
+ header: et,
11
+ bold: ct
12
+ }, z = (j) => typeof j == "number" && !Number.isNaN(j), E = (j, _) => `${j.toFixed(_)}%`, it = ({
13
+ columnWidth: j,
14
+ firstColumnWidth: _,
15
+ data: b,
16
+ measures: o,
17
+ rowDimension: y,
18
+ columnDimension: p,
19
+ progressive: P = !0,
20
+ batchSize: v = 100,
21
+ batchDelayMs: A = 0,
22
+ rowTotalsFor: R = [],
23
+ columnTotalsFor: F = [],
24
+ totalLabel: C = "Total",
25
+ className: G
26
+ }) => {
27
+ const x = N(() => {
28
+ const t = /* @__PURE__ */ new Set();
29
+ for (const l of b) {
30
+ const e = l[y.key];
31
+ e && t.add(e);
32
+ }
33
+ return Array.from(t);
34
+ }, [b, y.key]), w = N(() => {
35
+ const t = /* @__PURE__ */ new Set();
36
+ for (const l of b) {
37
+ const e = l[p.key];
38
+ e && t.add(e);
39
+ }
40
+ return Array.from(t);
41
+ }, [b, p.key]), H = N(() => {
42
+ const t = /* @__PURE__ */ new Map();
43
+ for (const l of b) {
44
+ const e = String(l[y.key]), s = String(l[p.key]);
45
+ t.has(e) || t.set(e, /* @__PURE__ */ new Map()), t.get(e).set(s, l);
46
+ }
47
+ return t;
48
+ }, [b, y.key, p.key]), $ = N(() => new Set(R), [R]), W = N(() => new Set(F), [F]), V = $.size > 0, J = W.size > 0, B = N(() => {
49
+ const t = /* @__PURE__ */ new Map();
50
+ return o.forEach((l, e) => t.set(String(l.key), e)), t;
51
+ }, [o]), { colTotals: K, rowTotals: O, grandTotals: q } = N(() => {
52
+ const t = /* @__PURE__ */ new Map(), l = /* @__PURE__ */ new Map(), e = o.map(() => 0);
53
+ for (const s of b) {
54
+ const r = String(s[y.key]), a = String(s[p.key]), h = t.get(a) ?? o.map(() => 0), g = l.get(r) ?? o.map(() => 0);
55
+ o.forEach((f, k) => {
56
+ const T = s == null ? void 0 : s[f.key], S = Number(T);
57
+ Number.isNaN(S) || (h[k] += S, g[k] += S, e[k] += S);
58
+ }), t.set(a, h), l.set(r, g);
59
+ }
60
+ for (const s of w)
61
+ t.has(String(s)) || t.set(
62
+ String(s),
63
+ o.map(() => 0)
64
+ );
65
+ for (const s of x)
66
+ l.has(String(s)) || l.set(
67
+ String(s),
68
+ o.map(() => 0)
69
+ );
70
+ return { colTotals: t, rowTotals: l, grandTotals: e };
71
+ }, [b, o, y.key, p.key, w, x]), [Q, M] = Y(
72
+ () => P ? Math.min(v, x.length) : x.length
73
+ );
74
+ Z(() => {
75
+ if (!P) {
76
+ M(x.length);
77
+ return;
78
+ }
79
+ let t = !1, l = null;
80
+ M(0);
81
+ const e = () => {
82
+ M((s) => {
83
+ const r = Math.min(s + v, x.length);
84
+ return r < x.length && !t && (l = window.setTimeout(e, A)), r;
85
+ });
86
+ };
87
+ return l = window.setTimeout(e, A), () => {
88
+ t = !0, l !== null && window.clearTimeout(l);
89
+ };
90
+ }, [P, v, A, x.length, b]);
91
+ const U = P ? x.slice(0, Q) : x;
92
+ return /* @__PURE__ */ c.jsx("div", { className: i(n.pivotTableContainer, G), children: /* @__PURE__ */ c.jsx(
93
+ "div",
94
+ {
95
+ className: i(
96
+ n.tableContainer,
97
+ (!j || !_) && n.fullWidth
98
+ ),
99
+ children: /* @__PURE__ */ c.jsxs(
100
+ "table",
101
+ {
102
+ className: n.table,
103
+ "aria-label": `${y.label} by ${p.label}`,
104
+ children: [
105
+ /* @__PURE__ */ c.jsxs("thead", { children: [
106
+ /* @__PURE__ */ c.jsxs("tr", { children: [
107
+ /* @__PURE__ */ c.jsx(
108
+ "th",
109
+ {
110
+ scope: "col",
111
+ rowSpan: 1,
112
+ className: i(n.cell, n.header),
113
+ title: p.label,
114
+ children: /* @__PURE__ */ c.jsx(d, { children: p.label })
115
+ }
116
+ ),
117
+ w.map((t) => {
118
+ const l = p.formatValue ? p.formatValue(t) : t;
119
+ return /* @__PURE__ */ c.jsx(
120
+ "th",
121
+ {
122
+ scope: "colgroup",
123
+ colSpan: o.length,
124
+ className: i(n.cell, n.header),
125
+ title: l,
126
+ children: /* @__PURE__ */ c.jsx(d, { children: l })
127
+ },
128
+ `col-${t}`
129
+ );
130
+ }),
131
+ V && /* @__PURE__ */ c.jsx(
132
+ "th",
133
+ {
134
+ scope: "colgroup",
135
+ colSpan: Array.from($).length,
136
+ className: i(n.cell, n.bold),
137
+ title: C,
138
+ children: /* @__PURE__ */ c.jsx(d, { children: C })
139
+ },
140
+ "col-total-group"
141
+ )
142
+ ] }),
143
+ /* @__PURE__ */ c.jsxs("tr", { children: [
144
+ /* @__PURE__ */ c.jsx(
145
+ "th",
146
+ {
147
+ scope: "col",
148
+ rowSpan: 1,
149
+ className: i(n.cell, n.header),
150
+ title: y.label,
151
+ style: I(_),
152
+ children: /* @__PURE__ */ c.jsx(d, { children: y.label })
153
+ }
154
+ ),
155
+ w.flatMap(
156
+ (t) => o.map((l, e) => /* @__PURE__ */ c.jsx(
157
+ "th",
158
+ {
159
+ scope: "col",
160
+ className: i(n.cell, n.header),
161
+ title: l.label,
162
+ style: I(j),
163
+ children: /* @__PURE__ */ c.jsx(d, { children: l.label })
164
+ },
165
+ `sub-${String(t)}-${l.key}-${e}`
166
+ ))
167
+ ),
168
+ V && o.filter((t) => $.has(t.key)).map((t, l) => /* @__PURE__ */ c.jsx(
169
+ "th",
170
+ {
171
+ scope: "col",
172
+ className: i(n.cell, n.bold),
173
+ title: t.label,
174
+ style: I(j),
175
+ children: /* @__PURE__ */ c.jsx(d, { children: t.label })
176
+ },
177
+ `sub-total-${t.key}-${l}`
178
+ ))
179
+ ] })
180
+ ] }),
181
+ /* @__PURE__ */ c.jsx("tbody", { children: U.map((t) => {
182
+ const l = y.formatValue ? y.formatValue(t) : t;
183
+ return /* @__PURE__ */ c.jsxs("tr", { children: [
184
+ /* @__PURE__ */ c.jsx(
185
+ "th",
186
+ {
187
+ scope: "row",
188
+ className: i(n.cell, n.header),
189
+ title: l,
190
+ children: /* @__PURE__ */ c.jsx(d, { children: l })
191
+ }
192
+ ),
193
+ w.flatMap(
194
+ (e) => o.map((s, r) => {
195
+ var T;
196
+ const a = ((T = H.get(t)) == null ? void 0 : T.get(e)) ?? {}, h = a == null ? void 0 : a[s.key], g = `cell-${t}-${e}-${s.key}-${r}`, k = (() => {
197
+ if (s.showAsPercentage) {
198
+ const S = B.get(String(s.key)) ?? -1, X = K.get(String(e)) ?? o.map(() => 0), u = S >= 0 ? X[S] ?? 0 : 0;
199
+ if (s.showAsPercentage && z(Number(h)) && z(u) && u > 0)
200
+ return `${(h / u * 100).toFixed(s.percentageDecimalPlaces ?? 0)}%`;
201
+ }
202
+ return s.accessor ? s.accessor(a) : h;
203
+ })();
204
+ return /* @__PURE__ */ c.jsx("td", { className: i(n.cell), title: k, children: /* @__PURE__ */ c.jsx(d, { children: k }) }, g);
205
+ })
206
+ ),
207
+ V && o.filter((e) => $.has(e.key)).map((e, s) => {
208
+ const r = O.get(t) ?? o.map(() => 0), a = B.get(e.key) ?? -1, h = `row-total-${String(t)}-${e.key}-${s}`, g = a >= 0 ? r[a] ?? 0 : 0;
209
+ let f = g;
210
+ return e.showAsPercentage ? f = E(
211
+ g / (q[a] || 1) * 100,
212
+ e.percentageDecimalPlaces ?? 0
213
+ ) : e.accessor && (f = e.accessor({ [e.key]: g })), /* @__PURE__ */ c.jsx(
214
+ "td",
215
+ {
216
+ className: i(n.cell, n.bold),
217
+ title: f,
218
+ children: /* @__PURE__ */ c.jsx(d, { children: f })
219
+ },
220
+ h
221
+ );
222
+ })
223
+ ] }, `row-${t}`);
224
+ }) }),
225
+ /* @__PURE__ */ c.jsx("tfoot", { children: J && /* @__PURE__ */ c.jsxs("tr", { children: [
226
+ /* @__PURE__ */ c.jsx("th", { scope: "row", className: i(n.cell, n.bold), title: C, children: /* @__PURE__ */ c.jsx(d, { children: C }) }),
227
+ w.flatMap(
228
+ (t) => o.map((l, e) => {
229
+ const s = W.has(String(l.key)), r = K.get(String(t)) ?? o.map(() => 0), a = o.findIndex((T) => String(T.key) === String(l.key)), h = `col-total-${String(t)}-${l.key}-${e}`, g = r[a] ?? 0;
230
+ let f = g;
231
+ l.showAsPercentage ? f = E(
232
+ 100,
233
+ l.percentageDecimalPlaces ?? 0
234
+ ) : l.accessor && (f = l.accessor({ [l.key]: g }));
235
+ const k = s ? f : "";
236
+ return /* @__PURE__ */ c.jsx(
237
+ "td",
238
+ {
239
+ className: i(n.cell, n.bold),
240
+ title: k,
241
+ children: /* @__PURE__ */ c.jsx(d, { children: k })
242
+ },
243
+ h
244
+ );
245
+ })
246
+ ),
247
+ V && o.filter((t) => $.has(t.key)).map((t, l) => {
248
+ const e = o.findIndex((h) => String(h.key) === t.key), s = `grand-total-${t.key}-${l}`, r = q[e] ?? 0;
249
+ let a = r;
250
+ return t.showAsPercentage ? a = E(
251
+ 100,
252
+ t.percentageDecimalPlaces ?? 0
253
+ ) : t.accessor && (a = t.accessor({ [t.key]: r })), /* @__PURE__ */ c.jsx(
254
+ "td",
255
+ {
256
+ className: i(n.cell, n.bold),
257
+ title: a,
258
+ children: /* @__PURE__ */ c.jsx(d, { children: a })
259
+ },
260
+ s
261
+ );
262
+ })
263
+ ] }, "totals-row") })
264
+ ]
265
+ }
266
+ )
267
+ }
268
+ ) });
269
+ };
270
+ export {
271
+ it as P
272
+ };
273
+ //# sourceMappingURL=PivotTable-Cx4WG6MV.js.map