@embeddable.com/remarkable-pro 0.0.12 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChartDefaultHorizontalPro.js +3 -3
- package/dist/BarChartDefaultPro.js +3 -3
- package/dist/BarChartGroupedHorizontalPro.js +3 -3
- package/dist/BarChartGroupedPro.js +3 -3
- package/dist/BarChartStackedHorizontalPro.js +3 -3
- package/dist/BarChartStackedPro.js +3 -3
- package/dist/{ChartCard-F1fMKsD4.js → ChartCard-DaUtlchs.js} +3 -3
- package/dist/{ChartCard-F1fMKsD4.js.map → ChartCard-DaUtlchs.js.map} +1 -1
- package/dist/{Color.type.emb-BmenseN6.js → Color.type.emb-DFhAaPXz.js} +2 -2
- package/dist/{Color.type.emb-BmenseN6.js.map → Color.type.emb-DFhAaPXz.js.map} +1 -1
- package/dist/ColorEditor.js +2 -2
- package/dist/{ComparisonPeriod.type.emb-Bp4VzSqq.js → ComparisonPeriod.type.emb-C-YdNTEB.js} +2 -2
- package/dist/{ComparisonPeriod.type.emb-Bp4VzSqq.js.map → ComparisonPeriod.type.emb-C-YdNTEB.js.map} +1 -1
- package/dist/ComparisonPeriodSelectFieldPro.js +4 -4
- package/dist/DateRangePickerCustomPro.js +3 -3
- package/dist/DateRangeSelectFieldPro.js +3 -3
- package/dist/DonutChartPro.js +3 -3
- package/dist/DonutLabelChartPro.js +3 -3
- package/dist/{EditorCard-CXmogrdI.js → EditorCard-DXQeyo3r.js} +3 -3
- package/dist/{EditorCard-CXmogrdI.js.map → EditorCard-DXQeyo3r.js.map} +1 -1
- package/dist/HeatMapPro.js +4 -4
- package/dist/KpiChartNumberComparisonPro.js +4 -4
- package/dist/KpiChartNumberPro.js +3 -3
- package/dist/LineChartComparisonDefaultPro.js +5 -5
- package/dist/LineChartDefaultPro.js +4 -4
- package/dist/LineChartGroupedPro.js +3 -3
- package/dist/MultiSelectFieldPro.js +3 -3
- package/dist/PieChartPro.js +3 -3
- package/dist/PivotTablePro.js +3 -3
- package/dist/SingleSelectFieldPro.js +3 -3
- package/dist/TableChartPaginated.js +3 -3
- package/dist/{bars.utils-g15uj8cH.js → bars.utils-C45cnEfc.js} +4 -4
- package/dist/{bars.utils-g15uj8cH.js.map → bars.utils-C45cnEfc.js.map} +1 -1
- package/dist/charts.fillGaps.hooks-zCMYcjxz.js +65 -0
- package/dist/charts.fillGaps.hooks-zCMYcjxz.js.map +1 -0
- package/dist/{charts.utils-WjKhtDzm.js → charts.utils-D_9y_kjG.js} +4 -4
- package/dist/{charts.utils-WjKhtDzm.js.map → charts.utils-D_9y_kjG.js.map} +1 -1
- package/dist/{component.constants-5pSEkTqN.js → component.constants-DJqBv0qe.js} +2 -2
- package/dist/{component.constants-5pSEkTqN.js.map → component.constants-DJqBv0qe.js.map} +1 -1
- package/dist/components/charts/charts.fillGaps.hooks.d.ts.map +1 -1
- package/dist/embeddable-components.json +11 -11
- package/dist/{formatter.utils-CU02gBE5.js → formatter.utils-BRMB8qAc.js} +2 -2
- package/dist/{formatter.utils-CU02gBE5.js.map → formatter.utils-BRMB8qAc.js.map} +1 -1
- package/dist/{index-B524G8aR.js → index-BEwcJPua.js} +5 -5
- package/dist/{index-B524G8aR.js.map → index-BEwcJPua.js.map} +1 -1
- package/dist/{index-CIy-fCZE.js → index-BIiign0L.js} +8506 -8505
- package/dist/{index-CIy-fCZE.js.map → index-BIiign0L.js.map} +1 -1
- package/dist/{index-JRFQo8DK.js → index-Ba6ziHiQ.js} +4 -4
- package/dist/{index-JRFQo8DK.js.map → index-Ba6ziHiQ.js.map} +1 -1
- package/dist/{index-BsOU6A4h.js → index-BbypzboN.js} +5 -5
- package/dist/{index-BsOU6A4h.js.map → index-BbypzboN.js.map} +1 -1
- package/dist/{index-a51EknRg.js → index-Bn5j2FLA.js} +6 -6
- package/dist/{index-a51EknRg.js.map → index-Bn5j2FLA.js.map} +1 -1
- package/dist/{index-DDx1tSTE.js → index-BqgkyNm8.js} +6 -6
- package/dist/{index-DDx1tSTE.js.map → index-BqgkyNm8.js.map} +1 -1
- package/dist/{index-Bz-jqsH6.js → index-C4oavwFu.js} +6 -6
- package/dist/{index-Bz-jqsH6.js.map → index-C4oavwFu.js.map} +1 -1
- package/dist/{index-DUn23CxN.js → index-CNjwWCGc.js} +5 -5
- package/dist/{index-DUn23CxN.js.map → index-CNjwWCGc.js.map} +1 -1
- package/dist/{index-1KmRpcj0.js → index-CSdnJs7F.js} +7 -7
- package/dist/{index-1KmRpcj0.js.map → index-CSdnJs7F.js.map} +1 -1
- package/dist/{index-FjCFm3BI.js → index-CVv-xIyp.js} +5 -5
- package/dist/{index-FjCFm3BI.js.map → index-CVv-xIyp.js.map} +1 -1
- package/dist/{index-DZlowRxA.js → index-CYfKRRhL.js} +4 -4
- package/dist/{index-DZlowRxA.js.map → index-CYfKRRhL.js.map} +1 -1
- package/dist/{index-VMsVpFuu.js → index-CfpIN_sB.js} +6 -6
- package/dist/{index-VMsVpFuu.js.map → index-CfpIN_sB.js.map} +1 -1
- package/dist/{index-6ZmZRk63.js → index-DBFwmzJQ.js} +5 -5
- package/dist/{index-6ZmZRk63.js.map → index-DBFwmzJQ.js.map} +1 -1
- package/dist/{index-33BWxRVA.js → index-DD5t0omh.js} +5 -5
- package/dist/{index-33BWxRVA.js.map → index-DD5t0omh.js.map} +1 -1
- package/dist/{index-BvBc86AB.js → index-Df6HY9t3.js} +6 -6
- package/dist/{index-BvBc86AB.js.map → index-Df6HY9t3.js.map} +1 -1
- package/dist/{index-B_zyCSBJ.js → index-Djoz2cf4.js} +6 -6
- package/dist/{index-B_zyCSBJ.js.map → index-Djoz2cf4.js.map} +1 -1
- package/dist/{index-DjX_tMRT.js → index-DkbXF0dN.js} +6 -6
- package/dist/{index-DjX_tMRT.js.map → index-DkbXF0dN.js.map} +1 -1
- package/dist/{index-D8Z7FVYE.js → index-Drxp0RBw.js} +6 -6
- package/dist/{index-D8Z7FVYE.js.map → index-Drxp0RBw.js.map} +1 -1
- package/dist/{index-D67Dqwl6.js → index-GA9m2JpT.js} +6 -6
- package/dist/{index-D67Dqwl6.js.map → index-GA9m2JpT.js.map} +1 -1
- package/dist/{index-CuRuDELE.js → index-QLS7PLnH.js} +6 -6
- package/dist/{index-CuRuDELE.js.map → index-QLS7PLnH.js.map} +1 -1
- package/dist/{index-By4dAXWS.js → index-S5z1sMxW.js} +6 -6
- package/dist/{index-By4dAXWS.js.map → index-S5z1sMxW.js.map} +1 -1
- package/dist/{index-C58x29od.js → index-ifHDbmyw.js} +6 -6
- package/dist/{index-C58x29od.js.map → index-ifHDbmyw.js.map} +1 -1
- package/dist/index.js +29 -29
- package/dist/{pies.utils-ZhJMIog5.js → pies.utils-B_jS454c.js} +5 -5
- package/dist/{pies.utils-ZhJMIog5.js.map → pies.utils-B_jS454c.js.map} +1 -1
- package/dist/remarkable-pro.css +1 -1
- package/dist/{timeRange.utils-CNktS9Lb.js → timeRange.utils-CgLgHA94.js} +2 -2
- package/dist/{timeRange.utils-CNktS9Lb.js.map → timeRange.utils-CgLgHA94.js.map} +1 -1
- package/package.json +2 -2
- package/dist/charts.fillGaps.hooks-Dd-VYdOE.js +0 -66
- package/dist/charts.fillGaps.hooks-Dd-VYdOE.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { V as e, l as s } from "./index-
|
|
1
|
+
import { V as e, l as s } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as o } from "@embeddable.com/react";
|
|
3
|
-
import { B as r } from "./index-
|
|
4
|
-
import { v as i, E as t, z as l, F as n, G as m, I as x, J as u, K as d, M as c, N as f, O as h, R as p, U as D, V as b, X as B } from "./component.constants-
|
|
3
|
+
import { B as r } from "./index-Bn5j2FLA.js";
|
|
4
|
+
import { v as i, E as t, z as l, F as n, G as m, I as x, J as u, K as d, M as c, N as f, O as h, R as p, U as D, V as b, X as B } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const C = {
|
|
6
6
|
name: "BarChartDefaultHorizontalPro",
|
|
7
7
|
label: "Bar Chart - Default Horizontal",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { V as e, l as s } from "./index-
|
|
1
|
+
import { V as e, l as s } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as r } from "@embeddable.com/react";
|
|
3
|
-
import { B as i } from "./index-
|
|
4
|
-
import { v as t, E as o, z as l, F as n, G as m, I as x, J as u, K as d, M as c, N as f, O as h, P as p, S as D, T as b, W as B } from "./component.constants-
|
|
3
|
+
import { B as i } from "./index-GA9m2JpT.js";
|
|
4
|
+
import { v as t, E as o, z as l, F as n, G as m, I as x, J as u, K as d, M as c, N as f, O as h, P as p, S as D, T as b, W as B } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const C = {
|
|
6
6
|
name: "BarChartDefaultPro",
|
|
7
7
|
label: "Bar Chart - Default",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { V as e, l as s } from "./index-
|
|
1
|
+
import { V as e, l as s } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as o } from "@embeddable.com/react";
|
|
3
|
-
import { B as i } from "./index-
|
|
4
|
-
import { v as r, D as n, z as l, w as t, F as m, G as u, H as p, I as d, J as x, K as g, M as c, N as V, O as b, R as h, U as B, V as D } from "./component.constants-
|
|
3
|
+
import { B as i } from "./index-C4oavwFu.js";
|
|
4
|
+
import { v as r, D as n, z as l, w as t, F as m, G as u, H as p, I as d, J as x, K as g, M as c, N as V, O as b, R as h, U as B, V as D } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const C = {
|
|
6
6
|
name: "BarChartGroupedHorizontalPro",
|
|
7
7
|
label: "Bar Chart - Grouped Horizontal",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { V as a, l as s } from "./index-
|
|
1
|
+
import { V as a, l as s } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as i } from "@embeddable.com/react";
|
|
3
|
-
import { B as r } from "./index-
|
|
4
|
-
import { v as o, D as n, z as l, w as t, F as m, G as u, H as p, I as d, J as x, K as g, M as c, N as b, O as V, P as h, S as B, T as D } from "./component.constants-
|
|
3
|
+
import { B as r } from "./index-ifHDbmyw.js";
|
|
4
|
+
import { v as o, D as n, z as l, w as t, F as m, G as u, H as p, I as d, J as x, K as g, M as c, N as b, O as V, P as h, S as B, T as D } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const C = {
|
|
6
6
|
name: "BarChartGroupedPro",
|
|
7
7
|
label: "Bar Chart - Grouped",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { V as e, l as s } from "./index-
|
|
1
|
+
import { V as e, l as s } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as i } from "@embeddable.com/react";
|
|
3
|
-
import { B as o } from "./index-
|
|
4
|
-
import { v as r, D as l, z as n, w as t, F as m, G as u, H as d, I as x, J as c, K as p, M as g, N as b, O as V, R as h, U as B, V as D, L as C } from "./component.constants-
|
|
3
|
+
import { B as o } from "./index-Df6HY9t3.js";
|
|
4
|
+
import { v as r, D as l, z as n, w as t, F as m, G as u, H as d, I as x, J as c, K as p, M as g, N as b, O as V, R as h, U as B, V as D, L as C } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const f = {
|
|
6
6
|
name: "BarChartStackedHorizontalPro",
|
|
7
7
|
label: "Bar Chart - Stacked Horizontal",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { V as e, l as s } from "./index-
|
|
1
|
+
import { V as e, l as s } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as i } from "@embeddable.com/react";
|
|
3
|
-
import { B as o } from "./index-
|
|
4
|
-
import { v as r, D as l, z as n, w as t, F as m, G as u, H as d, I as x, J as c, K as p, M as g, N as b, O as h, P as V, S as B, T as D, L as C } from "./component.constants-
|
|
3
|
+
import { B as o } from "./index-S5z1sMxW.js";
|
|
4
|
+
import { v as r, D as l, z as n, w as t, F as m, G as u, H as d, I as x, J as c, K as p, M as g, N as b, O as h, P as V, S as B, T as D, L as C } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const f = {
|
|
6
6
|
name: "BarChartStackedPro",
|
|
7
7
|
label: "Bar Chart - Stacked",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { t as R, j as t, Q as I, x as S, y as L, z as N, A as k, C as D, q as M, R as x, r as b, U as T, s as _ } from "./index-
|
|
1
|
+
import { t as R, j as t, Q as I, x as S, y as L, z as N, A as k, C as D, q as M, R as x, r as b, U as T, s as _ } from "./index-BIiign0L.js";
|
|
2
2
|
import f, { useRef as w } from "react";
|
|
3
3
|
import { useTheme as j } from "@embeddable.com/react";
|
|
4
|
-
import { a as p, i as m, a0 as A } from "./component.constants-
|
|
4
|
+
import { a as p, i as m, a0 as A } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
/**
|
|
6
6
|
* @license @tabler/icons-react v3.36.0 - MIT
|
|
7
7
|
*
|
|
@@ -121,4 +121,4 @@ G.displayName = "ChartCard";
|
|
|
121
121
|
export {
|
|
122
122
|
G as C
|
|
123
123
|
};
|
|
124
|
-
//# sourceMappingURL=ChartCard-
|
|
124
|
+
//# sourceMappingURL=ChartCard-DaUtlchs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ChartCard-F1fMKsD4.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconDotsVertical.mjs","../src/components/charts/shared/ChartCard/ChartCardLoading/ChartCardLoading.tsx","../src/components/charts/shared/ChartCard/ChartCardMenuPro/ChartCardMenuPro.tsx","../src/components/charts/shared/ChartCard/ChartCard.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.36.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\": \"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-2\" }]];\nconst IconDotsVertical = createReactComponent(\"outline\", \"dots-vertical\", \"DotsVertical\", __iconNode);\n\nexport { __iconNode, IconDotsVertical as default };\n//# sourceMappingURL=IconDotsVertical.mjs.map\n","import { IconLoader2 } from '@tabler/icons-react';\nimport styles from './ChartCardLoading.module.css';\n\nexport const ChartCardLoading = () => <IconLoader2 className={styles.loading} />;\n","import { IconDotsVertical } from '@tabler/icons-react';\nimport React from 'react';\nimport { useTheme } from '@embeddable.com/react';\nimport { ChartCardLoading } from '../ChartCardLoading/ChartCardLoading';\nimport { i18n, i18nSetup } from '../../../../../theme/i18n/i18n';\nimport { Theme } from '../../../../../theme/theme.types';\nimport {\n Dropdown,\n ActionIcon,\n SelectFieldContent,\n SelectListOption,\n} from '@embeddable.com/remarkable-ui';\nimport styles from './ChartCardMenuPro.module.css';\nimport { ChartCardMenuOptionOnClickProps } from '../../../../../theme/defaults/defaults.ChartCardMenu.constants';\n\ntype InlineSvgFromDataProps = React.HTMLAttributes<HTMLSpanElement> & {\n src: string;\n};\n\nexport function InlineSvgFromData({ src, className, ...rest }: InlineSvgFromDataProps) {\n // Remove prefix and URL-decode the SVG markup\n const svgMarkup = decodeURIComponent(src.replace(/^data:image\\/svg\\+xml,/, ''));\n\n return <div className={className} {...rest} dangerouslySetInnerHTML={{ __html: svgMarkup }} />;\n}\n\ntype ChartCardMenuProProps = Omit<ChartCardMenuOptionOnClickProps, 'theme'>;\n\nexport const ChartCardMenuPro: React.FC<ChartCardMenuProProps> = (props) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const [isLoading, setIsLoading] = React.useState(false);\n\n const options = theme.defaults.chartMenuOptions ?? [];\n\n if (options.length === 0) {\n return null;\n }\n\n const startAction = (onClick: () => void | Promise<void>) => {\n setTimeout(() => {\n Promise.resolve(onClick()).finally(() => setIsLoading(false));\n }, 100);\n };\n\n const handleExport = (onClick: (props: ChartCardMenuOptionOnClickProps) => void) => {\n setIsLoading(true);\n if (props.onCustomDownload) {\n props.onCustomDownload((args) => startAction(() => onClick(args)));\n return;\n }\n startAction(() => onClick({ ...props, theme }));\n };\n\n return (\n <Dropdown\n side=\"bottom\"\n align=\"end\"\n triggerComponent={isLoading ? <ChartCardLoading /> : <ActionIcon icon={IconDotsVertical} />}\n >\n <SelectFieldContent className={styles.list} autoFocus>\n {options.map((option, index) => {\n const label = i18n.t(option.labelKey);\n\n return (\n <SelectListOption\n key={index}\n label={label}\n onClick={() => handleExport(option.onClick)}\n startIcon={option.iconSrc ? <InlineSvgFromData src={option.iconSrc} /> : undefined}\n />\n );\n })}\n </SelectFieldContent>\n </Dropdown>\n );\n};\n","import React, { CSSProperties, useRef } from 'react';\nimport { IconAlertCircle } from '@tabler/icons-react';\nimport {\n Card,\n CardContent,\n CardFeedback,\n CardHeader,\n Skeleton,\n} from '@embeddable.com/remarkable-ui';\nimport styles from './ChartCard.module.css';\nimport { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { useTheme } from '@embeddable.com/react';\nimport { ChartCardLoading } from './ChartCardLoading/ChartCardLoading';\nimport { ChartCardMenuPro } from './ChartCardMenuPro/ChartCardMenuPro';\nimport { Theme } from '../../../../theme/theme.types';\nimport { i18n, i18nSetup } from '../../../../theme/i18n/i18n';\nimport clsx from 'clsx';\nimport { ChartCardMenuOptionOnClickProps } from '../../../../theme/defaults/defaults.ChartCardMenu.constants';\n\ntype ChartCardProps = {\n title: string;\n subtitle?: string;\n children: React.ReactNode;\n data: DataResponse;\n errorMessage?: string;\n style?: CSSProperties;\n dimensionsAndMeasures?: (Dimension | Measure)[];\n onCustomDownload?: (props: (props: ChartCardMenuOptionOnClickProps) => void) => void;\n};\n\nexport const ChartCard = React.forwardRef<HTMLDivElement, ChartCardProps>(\n (\n { title, subtitle, children, data, errorMessage, dimensionsAndMeasures = [], onCustomDownload },\n ref,\n ) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const chartRef = useRef<HTMLDivElement>(null);\n\n const hasData = Boolean(data?.data && data.data?.length > 0);\n\n const isLoading = !data || data?.isLoading;\n\n const getDisplay = () => {\n if (isLoading && !hasData) {\n return <Skeleton />;\n }\n\n if (errorMessage) {\n return (\n <CardFeedback\n variant=\"error\"\n icon={IconAlertCircle}\n title={i18n.t('charts.errorTitle')}\n message={errorMessage}\n />\n );\n }\n\n if (!hasData) {\n return (\n <CardFeedback\n title={i18n.t('charts.emptyTitle')}\n message={i18n.t('charts.emptyMessage')}\n />\n );\n }\n\n return children;\n };\n\n return (\n <Card className={styles.chartCard}>\n <CardHeader\n title={title}\n subtitle={subtitle}\n rightContent={\n <div className={styles.chartCardRightContent}>\n <div\n className={clsx(styles.fixedContent, isLoading ? styles.loading : styles.hidden)}\n >\n <ChartCardLoading />\n </div>\n <div\n className={clsx(styles.fixedContent, isLoading ? styles.hidden : styles.visible)}\n >\n <ChartCardMenuPro\n title={title}\n containerRef={chartRef}\n data={data?.data}\n dimensionsAndMeasures={dimensionsAndMeasures}\n onCustomDownload={onCustomDownload}\n />\n </div>\n </div>\n }\n />\n\n <CardContent ref={onCustomDownload ? ref : chartRef}>{getDisplay()}</CardContent>\n </Card>\n );\n },\n);\n\nChartCard.displayName = 'ChartCard';\n"],"names":["__iconNode","IconDotsVertical","createReactComponent","ChartCardLoading","jsx","IconLoader2","styles","InlineSvgFromData","src","className","rest","svgMarkup","ChartCardMenuPro","props","theme","useTheme","i18nSetup","isLoading","setIsLoading","React","options","startAction","onClick","handleExport","args","Dropdown","ActionIcon","SelectFieldContent","option","index","label","i18n","SelectListOption","ChartCard","title","subtitle","children","data","errorMessage","dimensionsAndMeasures","onCustomDownload","ref","chartRef","useRef","hasData","_a","getDisplay","Skeleton","CardFeedback","IconAlertCircle","jsxs","Card","CardHeader","clsx","CardContent"],"mappings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AU,cAAc;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"ChartCard-DaUtlchs.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconDotsVertical.mjs","../src/components/charts/shared/ChartCard/ChartCardLoading/ChartCardLoading.tsx","../src/components/charts/shared/ChartCard/ChartCardMenuPro/ChartCardMenuPro.tsx","../src/components/charts/shared/ChartCard/ChartCard.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.36.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\": \"M12 12m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 19m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M12 5m-1 0a1 1 0 1 0 2 0a1 1 0 1 0 -2 0\", \"key\": \"svg-2\" }]];\nconst IconDotsVertical = createReactComponent(\"outline\", \"dots-vertical\", \"DotsVertical\", __iconNode);\n\nexport { __iconNode, IconDotsVertical as default };\n//# sourceMappingURL=IconDotsVertical.mjs.map\n","import { IconLoader2 } from '@tabler/icons-react';\nimport styles from './ChartCardLoading.module.css';\n\nexport const ChartCardLoading = () => <IconLoader2 className={styles.loading} />;\n","import { IconDotsVertical } from '@tabler/icons-react';\nimport React from 'react';\nimport { useTheme } from '@embeddable.com/react';\nimport { ChartCardLoading } from '../ChartCardLoading/ChartCardLoading';\nimport { i18n, i18nSetup } from '../../../../../theme/i18n/i18n';\nimport { Theme } from '../../../../../theme/theme.types';\nimport {\n Dropdown,\n ActionIcon,\n SelectFieldContent,\n SelectListOption,\n} from '@embeddable.com/remarkable-ui';\nimport styles from './ChartCardMenuPro.module.css';\nimport { ChartCardMenuOptionOnClickProps } from '../../../../../theme/defaults/defaults.ChartCardMenu.constants';\n\ntype InlineSvgFromDataProps = React.HTMLAttributes<HTMLSpanElement> & {\n src: string;\n};\n\nexport function InlineSvgFromData({ src, className, ...rest }: InlineSvgFromDataProps) {\n // Remove prefix and URL-decode the SVG markup\n const svgMarkup = decodeURIComponent(src.replace(/^data:image\\/svg\\+xml,/, ''));\n\n return <div className={className} {...rest} dangerouslySetInnerHTML={{ __html: svgMarkup }} />;\n}\n\ntype ChartCardMenuProProps = Omit<ChartCardMenuOptionOnClickProps, 'theme'>;\n\nexport const ChartCardMenuPro: React.FC<ChartCardMenuProProps> = (props) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const [isLoading, setIsLoading] = React.useState(false);\n\n const options = theme.defaults.chartMenuOptions ?? [];\n\n if (options.length === 0) {\n return null;\n }\n\n const startAction = (onClick: () => void | Promise<void>) => {\n setTimeout(() => {\n Promise.resolve(onClick()).finally(() => setIsLoading(false));\n }, 100);\n };\n\n const handleExport = (onClick: (props: ChartCardMenuOptionOnClickProps) => void) => {\n setIsLoading(true);\n if (props.onCustomDownload) {\n props.onCustomDownload((args) => startAction(() => onClick(args)));\n return;\n }\n startAction(() => onClick({ ...props, theme }));\n };\n\n return (\n <Dropdown\n side=\"bottom\"\n align=\"end\"\n triggerComponent={isLoading ? <ChartCardLoading /> : <ActionIcon icon={IconDotsVertical} />}\n >\n <SelectFieldContent className={styles.list} autoFocus>\n {options.map((option, index) => {\n const label = i18n.t(option.labelKey);\n\n return (\n <SelectListOption\n key={index}\n label={label}\n onClick={() => handleExport(option.onClick)}\n startIcon={option.iconSrc ? <InlineSvgFromData src={option.iconSrc} /> : undefined}\n />\n );\n })}\n </SelectFieldContent>\n </Dropdown>\n );\n};\n","import React, { CSSProperties, useRef } from 'react';\nimport { IconAlertCircle } from '@tabler/icons-react';\nimport {\n Card,\n CardContent,\n CardFeedback,\n CardHeader,\n Skeleton,\n} from '@embeddable.com/remarkable-ui';\nimport styles from './ChartCard.module.css';\nimport { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { useTheme } from '@embeddable.com/react';\nimport { ChartCardLoading } from './ChartCardLoading/ChartCardLoading';\nimport { ChartCardMenuPro } from './ChartCardMenuPro/ChartCardMenuPro';\nimport { Theme } from '../../../../theme/theme.types';\nimport { i18n, i18nSetup } from '../../../../theme/i18n/i18n';\nimport clsx from 'clsx';\nimport { ChartCardMenuOptionOnClickProps } from '../../../../theme/defaults/defaults.ChartCardMenu.constants';\n\ntype ChartCardProps = {\n title: string;\n subtitle?: string;\n children: React.ReactNode;\n data: DataResponse;\n errorMessage?: string;\n style?: CSSProperties;\n dimensionsAndMeasures?: (Dimension | Measure)[];\n onCustomDownload?: (props: (props: ChartCardMenuOptionOnClickProps) => void) => void;\n};\n\nexport const ChartCard = React.forwardRef<HTMLDivElement, ChartCardProps>(\n (\n { title, subtitle, children, data, errorMessage, dimensionsAndMeasures = [], onCustomDownload },\n ref,\n ) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const chartRef = useRef<HTMLDivElement>(null);\n\n const hasData = Boolean(data?.data && data.data?.length > 0);\n\n const isLoading = !data || data?.isLoading;\n\n const getDisplay = () => {\n if (isLoading && !hasData) {\n return <Skeleton />;\n }\n\n if (errorMessage) {\n return (\n <CardFeedback\n variant=\"error\"\n icon={IconAlertCircle}\n title={i18n.t('charts.errorTitle')}\n message={errorMessage}\n />\n );\n }\n\n if (!hasData) {\n return (\n <CardFeedback\n title={i18n.t('charts.emptyTitle')}\n message={i18n.t('charts.emptyMessage')}\n />\n );\n }\n\n return children;\n };\n\n return (\n <Card className={styles.chartCard}>\n <CardHeader\n title={title}\n subtitle={subtitle}\n rightContent={\n <div className={styles.chartCardRightContent}>\n <div\n className={clsx(styles.fixedContent, isLoading ? styles.loading : styles.hidden)}\n >\n <ChartCardLoading />\n </div>\n <div\n className={clsx(styles.fixedContent, isLoading ? styles.hidden : styles.visible)}\n >\n <ChartCardMenuPro\n title={title}\n containerRef={chartRef}\n data={data?.data}\n dimensionsAndMeasures={dimensionsAndMeasures}\n onCustomDownload={onCustomDownload}\n />\n </div>\n </div>\n }\n />\n\n <CardContent ref={onCustomDownload ? ref : chartRef}>{getDisplay()}</CardContent>\n </Card>\n );\n },\n);\n\nChartCard.displayName = 'ChartCard';\n"],"names":["__iconNode","IconDotsVertical","createReactComponent","ChartCardLoading","jsx","IconLoader2","styles","InlineSvgFromData","src","className","rest","svgMarkup","ChartCardMenuPro","props","theme","useTheme","i18nSetup","isLoading","setIsLoading","React","options","startAction","onClick","handleExport","args","Dropdown","ActionIcon","SelectFieldContent","option","index","label","i18n","SelectListOption","ChartCard","title","subtitle","children","data","errorMessage","dimensionsAndMeasures","onCustomDownload","ref","chartRef","useRef","hasData","_a","getDisplay","Skeleton","CardFeedback","IconAlertCircle","jsxs","Card","CardHeader","clsx","CardContent"],"mappings":";;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa,CAAC,CAAC,QAAQ,EAAE,GAAK,4CAA4C,KAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,GAAK,4CAA4C,KAAO,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAK,2CAA2C,KAAO,QAAO,CAAE,CAAC,GACxPC,IAAmBC,EAAqB,WAAW,iBAAiB,gBAAgBF,CAAU;;;;;;;;GCPvFG,IAAmB,MAAMC,gBAAAA,EAAAA,IAACC,GAAA,EAAY,WAAWC,EAAO,SAAS;;;ACgBvE,SAASC,EAAkB,EAAE,KAAAC,GAAK,WAAAC,GAAW,GAAGC,KAAgC;AAErF,QAAMC,IAAY,mBAAmBH,EAAI,QAAQ,0BAA0B,EAAE,CAAC;AAE9E,SAAOJ,gBAAAA,EAAAA,IAAC,SAAI,WAAAK,GAAuB,GAAGC,GAAM,yBAAyB,EAAE,QAAQC,EAAA,GAAa;AAC9F;AAIO,MAAMC,IAAoD,CAACC,MAAU;AAC1E,QAAMC,IAAeC,EAAA;AACrB,EAAAC,EAAUF,CAAK;AAEf,QAAM,CAACG,GAAWC,C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,EAAAA;AAAAA,cAAC;AAAA,cAAA;AAAA,gBACC,WAAWiD,EAAK/C,EAAO,cAAcW,IAAYX,EAAO,SAASA,EAAO,OAAO;AAAA,gBAE/E,UAAAF,gBAAAA,EAAAA;AAAAA,kBAACQ;AAAA,kBAAA;AAAA,oBACC,OAAAsB;AAAA,oBACA,cAAcQ;AAAA,oBACd,MAAML,KAAA,gBAAAA,EAAM;AAAA,oBACZ,uBAAAE;AAAA,oBACA,kBAAAC;AAAA,kBAAA;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UACF,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,4BAIHc,GAAA,EAAY,KAAKd,IAAmBC,IAAMC,GAAW,cAAW,CAAE;AAAA,IAAA,GACrE;AAAA,EAEJ;AACF;AAEAT,EAAU,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as e } from "./index-
|
|
1
|
+
import { d as e } from "./index-BIiign0L.js";
|
|
2
2
|
const r = e("color", {
|
|
3
3
|
label: "Color",
|
|
4
4
|
optionLabel: (o) => o.toUpperCase()
|
|
@@ -6,4 +6,4 @@ const r = e("color", {
|
|
|
6
6
|
export {
|
|
7
7
|
r as C
|
|
8
8
|
};
|
|
9
|
-
//# sourceMappingURL=Color.type.emb-
|
|
9
|
+
//# sourceMappingURL=Color.type.emb-DFhAaPXz.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.type.emb-
|
|
1
|
+
{"version":3,"file":"Color.type.emb-DFhAaPXz.js","sources":["../src/editors/ColorEditor/Color.type.emb.ts"],"sourcesContent":["import { defineType } from '@embeddable.com/core';\n\nconst ColorType = defineType('color', {\n label: 'Color',\n optionLabel: (value: string) => value.toUpperCase(),\n});\n\nexport default ColorType;\n"],"names":["ColorType","defineType","value"],"mappings":";AAEA,MAAMA,IAAYC,EAAW,SAAS;AAAA,EACpC,OAAO;AAAA,EACP,aAAa,CAACC,MAAkBA,EAAM,YAAA;AACxC,CAAC;"}
|
package/dist/ColorEditor.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { defineEditor as l } from "@embeddable.com/react";
|
|
2
|
-
import { C as a } from "./Color.type.emb-
|
|
3
|
-
import { j as n, A as i, I as p, V as u } from "./index-
|
|
2
|
+
import { C as a } from "./Color.type.emb-DFhAaPXz.js";
|
|
3
|
+
import { j as n, A as i, I as p, V as u } from "./index-BIiign0L.js";
|
|
4
4
|
import { useState as m, useEffect as C } from "react";
|
|
5
5
|
const I = "_colorInputContainer_1o1qe_1", d = "_colorInput_1o1qe_1", s = {
|
|
6
6
|
colorInputContainer: I,
|
package/dist/{ComparisonPeriod.type.emb-Bp4VzSqq.js → ComparisonPeriod.type.emb-C-YdNTEB.js}
RENAMED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as i, b as o } from "./index-
|
|
1
|
+
import { d as i, b as o } from "./index-BIiign0L.js";
|
|
2
2
|
const e = i("comparisonPeriod", {
|
|
3
3
|
label: "Comparison Period",
|
|
4
4
|
optionLabel: (r) => r
|
|
@@ -11,4 +11,4 @@ o(e, "Previous year");
|
|
|
11
11
|
export {
|
|
12
12
|
e as C
|
|
13
13
|
};
|
|
14
|
-
//# sourceMappingURL=ComparisonPeriod.type.emb-
|
|
14
|
+
//# sourceMappingURL=ComparisonPeriod.type.emb-C-YdNTEB.js.map
|
package/dist/{ComparisonPeriod.type.emb-Bp4VzSqq.js.map → ComparisonPeriod.type.emb-C-YdNTEB.js.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComparisonPeriod.type.emb-
|
|
1
|
+
{"version":3,"file":"ComparisonPeriod.type.emb-C-YdNTEB.js","sources":["../src/components/types/ComparisonPeriod.type.emb.ts"],"sourcesContent":["import { defineOption, defineType } from '@embeddable.com/core';\n\nconst ComparisonPeriodType = defineType('comparisonPeriod', {\n label: 'Comparison Period',\n optionLabel: (value: string) => value,\n});\n\ndefineOption(ComparisonPeriodType, 'Previous period');\ndefineOption(ComparisonPeriodType, 'Previous week');\ndefineOption(ComparisonPeriodType, 'Previous month');\ndefineOption(ComparisonPeriodType, 'Previous quarter');\ndefineOption(ComparisonPeriodType, 'Previous year');\n\nexport default ComparisonPeriodType;\n"],"names":["ComparisonPeriodType","defineType","value","defineOption"],"mappings":";AAEA,MAAMA,IAAuBC,EAAW,oBAAoB;AAAA,EAC1D,OAAO;AAAA,EACP,aAAa,CAACC,MAAkBA;AAClC,CAAC;AAEDC,EAAaH,GAAsB,iBAAiB;AACpDG,EAAaH,GAAsB,eAAe;AAClDG,EAAaH,GAAsB,gBAAgB;AACnDG,EAAaH,GAAsB,kBAAkB;AACrDG,EAAaH,GAAsB,eAAe;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as r } from "@embeddable.com/react";
|
|
2
|
-
import { V as a } from "./index-
|
|
3
|
-
import { D as i } from "./index-
|
|
4
|
-
import { F as t, G as n, _ as l } from "./component.constants-
|
|
5
|
-
import { C as o } from "./ComparisonPeriod.type.emb-
|
|
2
|
+
import { V as a } from "./index-BIiign0L.js";
|
|
3
|
+
import { D as i } from "./index-Ba6ziHiQ.js";
|
|
4
|
+
import { F as t, G as n, _ as l } from "./component.constants-DJqBv0qe.js";
|
|
5
|
+
import { C as o } from "./ComparisonPeriod.type.emb-C-YdNTEB.js";
|
|
6
6
|
const p = {
|
|
7
7
|
name: "ComparisonPeriodSelectFieldPro",
|
|
8
8
|
label: "Comparison Period Select Field",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useTheme as C, defineComponent as v } from "@embeddable.com/react";
|
|
2
|
-
import { j as l, c as y, V as s } from "./index-
|
|
2
|
+
import { j as l, c as y, V as s } from "./index-BIiign0L.js";
|
|
3
3
|
import { u as D, g as P, a as V, b as w } from "./dates.utils-f-XJ_LBg.js";
|
|
4
|
-
import { a as j, r as k, i as F, F as M, G as T, _ as x, g as o } from "./component.constants-
|
|
5
|
-
import { E as L } from "./EditorCard-
|
|
4
|
+
import { a as j, r as k, i as F, F as M, G as T, _ as x, g as o } from "./component.constants-DJqBv0qe.js";
|
|
5
|
+
import { E as L } from "./EditorCard-DXQeyo3r.js";
|
|
6
6
|
const S = (e) => {
|
|
7
7
|
const a = C();
|
|
8
8
|
j(a);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as l } from "@embeddable.com/react";
|
|
2
|
-
import { V as t } from "./index-
|
|
3
|
-
import { D as n } from "./index-
|
|
4
|
-
import { F as o, G as r, _ as s, g as a } from "./component.constants-
|
|
2
|
+
import { V as t } from "./index-BIiign0L.js";
|
|
3
|
+
import { D as n } from "./index-CYfKRRhL.js";
|
|
4
|
+
import { F as o, G as r, _ as s, g as a } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const u = {
|
|
6
6
|
name: "DateRangeSelectFieldPro",
|
|
7
7
|
label: "Date-Range Picker - Presets",
|
package/dist/DonutChartPro.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { V as a, l as s } from "./index-
|
|
1
|
+
import { V as a, l as s } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as t } from "@embeddable.com/react";
|
|
3
|
-
import { D as o } from "./index-
|
|
4
|
-
import { v as n, D as r, w as i, F as m, G as l, I as d, Z as u, J as p, K as c } from "./component.constants-
|
|
3
|
+
import { D as o } from "./index-CNjwWCGc.js";
|
|
4
|
+
import { v as n, D as r, w as i, F as m, G as l, I as d, Z as u, J as p, K as c } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const C = {
|
|
6
6
|
name: "DonutChartPro",
|
|
7
7
|
label: "Donut Chart",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { D as n } from "./index-
|
|
2
|
-
import { V as s, l as a } from "./index-
|
|
1
|
+
import { D as n } from "./index-Djoz2cf4.js";
|
|
2
|
+
import { V as s, l as a } from "./index-BIiign0L.js";
|
|
3
3
|
import { defineComponent as r } from "@embeddable.com/react";
|
|
4
|
-
import { v as o, D as t, w as l, F as i, G as m, I as d, Z as u, J as b, K as c } from "./component.constants-
|
|
4
|
+
import { v as o, D as t, w as l, F as i, G as m, I as d, Z as u, J as b, K as c } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const p = {
|
|
6
6
|
name: "DonutLabelChartPro",
|
|
7
7
|
label: "Donut Label Chart",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as r, C as c, q as d, r as m, s as l } from "./index-
|
|
1
|
+
import { j as r, C as c, q as d, r as m, s as l } from "./index-BIiign0L.js";
|
|
2
2
|
import { useTheme as C } from "@embeddable.com/react";
|
|
3
|
-
import { a as p, i as x, a0 as j } from "./component.constants-
|
|
3
|
+
import { a as p, i as x, a0 as j } from "./component.constants-DJqBv0qe.js";
|
|
4
4
|
const u = "_card_15bw3_1", f = {
|
|
5
5
|
card: u
|
|
6
6
|
}, b = ({
|
|
@@ -29,4 +29,4 @@ const u = "_card_15bw3_1", f = {
|
|
|
29
29
|
export {
|
|
30
30
|
b as E
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=EditorCard-
|
|
32
|
+
//# sourceMappingURL=EditorCard-DXQeyo3r.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorCard-
|
|
1
|
+
{"version":3,"file":"EditorCard-DXQeyo3r.js","sources":["../src/components/editors/shared/EditorCard/EditorCard.tsx"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { i18n, i18nSetup } from '../../../../theme/i18n/i18n';\nimport styles from './EditorCard.module.css';\nimport { FC } from 'react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { Card, CardContent, CardFeedback, CardHeader } from '@embeddable.com/remarkable-ui';\nimport { IconAlertCircle } from '@tabler/icons-react';\n\ntype EditorCardProps = {\n title?: string;\n subtitle?: string;\n children: React.ReactNode;\n errorMessage?: string;\n};\n\nexport const EditorCard: FC<EditorCardProps> = ({\n title,\n subtitle,\n children,\n errorMessage,\n ...props\n}) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const getDisplay = () => {\n if (errorMessage) {\n return (\n <CardFeedback\n variant=\"error\"\n icon={IconAlertCircle}\n title={i18n.t('editors.errorTitle')}\n message={errorMessage}\n />\n );\n }\n\n return children;\n };\n\n return (\n <Card className={styles.card} {...props}>\n <CardHeader title={title} subtitle={subtitle} />\n <CardContent>{getDisplay()}</CardContent>\n </Card>\n );\n};\n"],"names":["EditorCard","title","subtitle","children","errorMessage","props","theme","useTheme","i18nSetup","getDisplay","jsx","CardFeedback","IconAlertCircle","i18n","Card","styles","CardHeader","CardContent"],"mappings":";;;;;GAeaA,IAAkC,CAAC;AAAA,EAC9C,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAeC,EAAA;AACrB,EAAAC,EAAUF,CAAK;AAEf,QAAMG,IAAa,MACbL,IAEAM,gBAAAA,EAAAA;AAAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAMC;AAAA,MACN,OAAOC,EAAK,EAAE,oBAAoB;AAAA,MAClC,SAAST;AAAA,IAAA;AAAA,EAAA,IAKRD;AAGT,gCACGW,GAAA,EAAK,WAAWC,EAAO,MAAO,GAAGV,GAChC,UAAA;AAAA,IAAAK,gBAAAA,EAAAA,IAACM,GAAA,EAAW,OAAAf,GAAc,UAAAC,EAAA,CAAoB;AAAA,IAC9CQ,gBAAAA,EAAAA,IAACO,GAAA,EAAa,UAAAR,EAAA,EAAW,CAAE;AAAA,EAAA,GAC7B;AAEJ;"}
|
package/dist/HeatMapPro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l } from "./index-
|
|
1
|
+
import { l } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as n } from "@embeddable.com/react";
|
|
3
|
-
import { H as i } from "./index-
|
|
4
|
-
import { v as m, D as s, z as t, F as u, G as d, d as a, g as p, c as r, H as g } from "./component.constants-
|
|
5
|
-
import { C as o } from "./Color.type.emb-
|
|
3
|
+
import { H as i } from "./index-BqgkyNm8.js";
|
|
4
|
+
import { v as m, D as s, z as t, F as u, G as d, d as a, g as p, c as r, H as g } from "./component.constants-DJqBv0qe.js";
|
|
5
|
+
import { C as o } from "./Color.type.emb-DFhAaPXz.js";
|
|
6
6
|
const c = {
|
|
7
7
|
name: "HeatMapPro",
|
|
8
8
|
label: "Heat Map",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as t } from "@embeddable.com/react";
|
|
2
|
-
import { v as l, D as s, y as p, b as c, F as g, G as d, g as o, c as r } from "./component.constants-
|
|
3
|
-
import { K as y } from "./index-
|
|
4
|
-
import { l as i } from "./index-
|
|
5
|
-
import { C } from "./ComparisonPeriod.type.emb-
|
|
2
|
+
import { v as l, D as s, y as p, b as c, F as g, G as d, g as o, c as r } from "./component.constants-DJqBv0qe.js";
|
|
3
|
+
import { K as y } from "./index-CfpIN_sB.js";
|
|
4
|
+
import { l as i } from "./index-BIiign0L.js";
|
|
5
|
+
import { C } from "./ComparisonPeriod.type.emb-C-YdNTEB.js";
|
|
6
6
|
const P = {
|
|
7
7
|
name: "KpiChartNumberComparisonPro",
|
|
8
8
|
label: "Kpi Chart - Number Comparison",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as r } from "@embeddable.com/react";
|
|
2
|
-
import { v as a, D as t, F as o, G as m, c as s } from "./component.constants-
|
|
3
|
-
import { K as i } from "./index-
|
|
4
|
-
import { l as p } from "./index-
|
|
2
|
+
import { v as a, D as t, F as o, G as m, c as s } from "./component.constants-DJqBv0qe.js";
|
|
3
|
+
import { K as i } from "./index-DD5t0omh.js";
|
|
4
|
+
import { l as p } from "./index-BIiign0L.js";
|
|
5
5
|
const n = {
|
|
6
6
|
name: "KpiChartNumberPro",
|
|
7
7
|
label: "Kpi Chart - Number",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { defineComponent as p } from "@embeddable.com/react";
|
|
2
|
-
import { v as c, E as n, g as o, w as d, b as g, y, F as u, G as x, I as C, J as f, K as D, M as b, N as h, O as R, P as L, S as v, T as A, H as P } from "./component.constants-
|
|
3
|
-
import { L as T } from "./index-
|
|
4
|
-
import { V, l as s } from "./index-
|
|
5
|
-
import { C as w } from "./ComparisonPeriod.type.emb-
|
|
6
|
-
import { C as l } from "./Color.type.emb-
|
|
2
|
+
import { v as c, E as n, g as o, w as d, b as g, y, F as u, G as x, I as C, J as f, K as D, M as b, N as h, O as R, P as L, S as v, T as A, H as P } from "./component.constants-DJqBv0qe.js";
|
|
3
|
+
import { L as T } from "./index-CSdnJs7F.js";
|
|
4
|
+
import { V, l as s } from "./index-BIiign0L.js";
|
|
5
|
+
import { C as w } from "./ComparisonPeriod.type.emb-C-YdNTEB.js";
|
|
6
|
+
import { C as l } from "./Color.type.emb-DFhAaPXz.js";
|
|
7
7
|
const F = {
|
|
8
8
|
name: "LineChartComparisonDefaultPro",
|
|
9
9
|
label: "Line Chart Comparison - Default",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { defineComponent as i } from "@embeddable.com/react";
|
|
2
|
-
import { v as l, E as s, g as a, z as n, F as t, G as o, I as r, J as m, K as u, M as d, N as c, O as p, P as x, S as L, T as f, H as C } from "./component.constants-
|
|
3
|
-
import { L as h } from "./index-
|
|
4
|
-
import { V as b, l as g } from "./index-
|
|
5
|
-
import { C as A } from "./Color.type.emb-
|
|
2
|
+
import { v as l, E as s, g as a, z as n, F as t, G as o, I as r, J as m, K as u, M as d, N as c, O as p, P as x, S as L, T as f, H as C } from "./component.constants-DJqBv0qe.js";
|
|
3
|
+
import { L as h } from "./index-QLS7PLnH.js";
|
|
4
|
+
import { V as b, l as g } from "./index-BIiign0L.js";
|
|
5
|
+
import { C as A } from "./Color.type.emb-DFhAaPXz.js";
|
|
6
6
|
const D = {
|
|
7
7
|
name: "LineChartDefaultPro",
|
|
8
8
|
label: "Line Chart - Default",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as n } from "@embeddable.com/react";
|
|
2
|
-
import { v as o, D as a, g as i, z as l, w as r, F as t, G as m, H as u, I as p, J as d, K as g, M as x, N as c, O as L, P as b, S as V, T as h } from "./component.constants-
|
|
3
|
-
import { L as C } from "./index-
|
|
4
|
-
import { V as s, l as D } from "./index-
|
|
2
|
+
import { v as o, D as a, g as i, z as l, w as r, F as t, G as m, H as u, I as p, J as d, K as g, M as x, N as c, O as L, P as b, S as V, T as h } from "./component.constants-DJqBv0qe.js";
|
|
3
|
+
import { L as C } from "./index-Drxp0RBw.js";
|
|
4
|
+
import { V as s, l as D } from "./index-BIiign0L.js";
|
|
5
5
|
const f = {
|
|
6
6
|
name: "LineChartGroupedPro",
|
|
7
7
|
label: "Line Chart - Grouped",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as i } from "@embeddable.com/react";
|
|
2
|
-
import { V as t, l as r } from "./index-
|
|
3
|
-
import { v as s, w as d, F as u, G as m, _ as c } from "./component.constants-
|
|
4
|
-
import { M as p, a as f } from "./index-
|
|
2
|
+
import { V as t, l as r } from "./index-BIiign0L.js";
|
|
3
|
+
import { v as s, w as d, F as u, G as m, _ as c } from "./component.constants-DJqBv0qe.js";
|
|
4
|
+
import { M as p, a as f } from "./index-BbypzboN.js";
|
|
5
5
|
const g = {
|
|
6
6
|
name: "MultiSelectFieldPro",
|
|
7
7
|
label: "Multi Select Field",
|
package/dist/PieChartPro.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { V as a, l as s } from "./index-
|
|
1
|
+
import { V as a, l as s } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as t } from "@embeddable.com/react";
|
|
3
|
-
import { P as o } from "./index-
|
|
4
|
-
import { v as i, D as n, w as r, F as m, G as l, I as d, Z as p, J as c, K as u } from "./component.constants-
|
|
3
|
+
import { P as o } from "./index-BEwcJPua.js";
|
|
4
|
+
import { v as i, D as n, w as r, F as m, G as l, I as d, Z as p, J as c, K as u } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const C = {
|
|
6
6
|
name: "PieChartPro",
|
|
7
7
|
label: "Pie Chart",
|
package/dist/PivotTablePro.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { l as t } from "./index-
|
|
1
|
+
import { l as t } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as n } from "@embeddable.com/react";
|
|
3
|
-
import { P as i } from "./index-
|
|
4
|
-
import { v as m, E as o, k as a, z as l, F as r, G as u, d, c as s, H as b } from "./component.constants-
|
|
3
|
+
import { P as i } from "./index-DkbXF0dN.js";
|
|
4
|
+
import { v as m, E as o, k as a, z as l, F as r, G as u, d, c as s, H as b } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const c = {
|
|
6
6
|
name: "PivotTablePro",
|
|
7
7
|
label: "Pivot Table",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as i } from "@embeddable.com/react";
|
|
2
|
-
import { V as n, l as r } from "./index-
|
|
3
|
-
import { v as s, w as d, F as m, G as c, _ as p } from "./component.constants-
|
|
4
|
-
import { M as u, S as g } from "./index-
|
|
2
|
+
import { V as n, l as r } from "./index-BIiign0L.js";
|
|
3
|
+
import { v as s, w as d, F as m, G as c, _ as p } from "./component.constants-DJqBv0qe.js";
|
|
4
|
+
import { M as u, S as g } from "./index-CVv-xIyp.js";
|
|
5
5
|
const f = {
|
|
6
6
|
name: "SingleSelectFieldPro",
|
|
7
7
|
label: "Single Select Field",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { V as u, l as i, m as t } from "./index-
|
|
1
|
+
import { V as u, l as i, m as t } from "./index-BIiign0L.js";
|
|
2
2
|
import { defineComponent as g } from "@embeddable.com/react";
|
|
3
|
-
import { T as f } from "./index-
|
|
4
|
-
import { v as p, C as d, s as D, e as b, F as C, G as w, g as A, d as R, H as h, x as M } from "./component.constants-
|
|
3
|
+
import { T as f } from "./index-DBFwmzJQ.js";
|
|
4
|
+
import { v as p, C as d, s as D, e as b, F as C, G as w, g as A, d as R, H as h, x as M } from "./component.constants-DJqBv0qe.js";
|
|
5
5
|
const k = {
|
|
6
6
|
name: "TableChartPaginated",
|
|
7
7
|
label: "Table Chart - Paginated",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { r as F, g as P } from "./charts.utils-
|
|
2
|
-
import { g as h } from "./formatter.utils-
|
|
1
|
+
import { r as F, g as P } from "./charts.utils-D_9y_kjG.js";
|
|
2
|
+
import { g as h } from "./formatter.utils-BRMB8qAc.js";
|
|
3
3
|
import { g as p, a as g } from "./object.utils-D_Zzon-H.js";
|
|
4
|
-
import { g as T, a as v } from "./index-
|
|
4
|
+
import { g as T, a as v } from "./index-BIiign0L.js";
|
|
5
5
|
const B = (l, c) => {
|
|
6
6
|
var b;
|
|
7
7
|
const m = h(c), { data: o = [], dimension: i, groupDimension: d, measure: t } = l, r = [...new Set(o.map((n) => n[i.name]).filter((n) => n != null))].sort(), a = `${d.name}${(b = d.inputs) != null && b.granularity ? `.${d.inputs.granularity}` : ""}`, e = [...new Set(o.map((n) => n[a]))].filter((n) => n != null), s = p(c), u = v(), C = e.map((n, k) => {
|
|
@@ -142,4 +142,4 @@ export {
|
|
|
142
142
|
V as b,
|
|
143
143
|
B as g
|
|
144
144
|
};
|
|
145
|
-
//# sourceMappingURL=bars.utils-
|
|
145
|
+
//# sourceMappingURL=bars.utils-C45cnEfc.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bars.utils-g15uj8cH.js","sources":["../src/components/charts/bars/bars.utils.ts"],"sourcesContent":["import { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { Theme } from '../../../theme/theme.types';\nimport { remarkableTheme } from '../../../theme/theme.constants';\nimport { ChartData, ChartOptions } from 'chart.js';\nimport { getThemeFormatter } from '../../../theme/formatter/formatter.utils';\nimport { groupTailAsOther } from '../charts.utils';\nimport { getColor } from '../../../theme/styles/styles.utils';\nimport { getChartColors, getChartContrastColors } from '@embeddable.com/remarkable-ui';\nimport { getObjectStableKey } from '../../../utils.ts/object.utils';\nimport { Context } from 'chartjs-plugin-datalabels';\n\nexport const getBarStackedChartProData = (\n props: {\n data: DataResponse['data'];\n dimension: Dimension;\n groupDimension: Dimension;\n measure: Measure;\n },\n theme: Theme,\n): ChartData<'bar'> => {\n const themeFormatter = getThemeFormatter(theme);\n const { data = [], dimension, groupDimension, measure } = props;\n\n const axis = [...new Set(data.map((d) => d[dimension.name]).filter((d) => d != null))].sort();\n const groupDimensionName = `${groupDimension.name}${groupDimension.inputs?.granularity ? `.${groupDimension.inputs.granularity}` : ''}`;\n const groupBy = [...new Set(data.map((d) => d[groupDimensionName]))].filter((d) => d != null);\n\n const themeKey = getObjectStableKey(theme);\n const chartContrastColors = getChartContrastColors();\n const datasets = groupBy.map((groupByItem, index) => {\n const backgroundColor = getColor(\n `${themeKey}.charts.backgroundColors`,\n `${groupDimension.name}.${groupByItem}`,\n theme.charts.backgroundColors ?? chartContrastColors,\n index,\n );\n\n const borderColor = getColor(\n `${themeKey}.charts.borderColors`,\n `${groupDimension.name}.${groupByItem}`,\n theme.charts.borderColors ?? chartContrastColors,\n index,\n );\n\n return {\n label: themeFormatter.data(groupDimension, groupByItem),\n rawLabel: groupByItem,\n backgroundColor,\n borderColor,\n data: axis.map((axisItem) => {\n const record = data.find(\n (d) => d[groupDimensionName] === groupByItem && d[dimension.name] === axisItem,\n );\n return record ? Number(record[measure.name]) : 0;\n }),\n };\n });\n\n return {\n labels: axis,\n datasets,\n };\n};\n\nexport const getBarChartProData = (\n props: {\n data: DataResponse['data'];\n dimension: Dimension;\n measures: Measure[];\n maxItems?: number;\n },\n theme: Theme = remarkableTheme,\n): ChartData<'bar'> => {\n if (!props.data) {\n return {\n labels: [],\n datasets: [{ data: [] }],\n };\n }\n\n const themeFormatter = getThemeFormatter(theme);\n const themeKey = getObjectStableKey(theme);\n const groupedData = groupTailAsOther(props.data, props.dimension, props.measures, props.maxItems);\n const chartColors = getChartColors();\n\n return {\n labels: groupedData.map((item) => {\n return item[props.dimension.name];\n }),\n datasets: props.measures.map((measure, index) => {\n const backgroundColor = getColor(\n `${themeKey}.charts.backgroundColors`,\n measure.name,\n theme.charts.backgroundColors ?? chartColors,\n index,\n );\n\n const borderColor = getColor(\n `${themeKey}.charts.borderColors`,\n measure.name,\n theme.charts.borderColors ?? chartColors,\n index,\n );\n\n return {\n label: themeFormatter.dimensionOrMeasureTitle(measure),\n data: groupedData.map((item) => item[measure.name] ?? 0),\n backgroundColor,\n borderColor,\n };\n }),\n };\n};\n\nconst getBarChartProDatalabelTotalFormatter = (\n context: Context,\n formatter: (value: number) => string,\n) => {\n const { datasets } = context.chart.data;\n const i = context.dataIndex;\n\n const total = datasets.reduce((sum, ds) => {\n const val = ds.data[i] as number;\n return sum + (val || 0);\n }, 0);\n\n return formatter(total);\n};\n\nexport const getBarChartProOptions = (\n options: {\n onBarClicked: (args: {\n axisDimensionValue: string | null;\n groupingDimensionValue: string | null;\n }) => void;\n measures: Measure[];\n dimension: Dimension;\n horizontal: boolean;\n data: ChartData<'bar'>;\n },\n theme: Theme,\n): Partial<ChartOptions<'bar'>> => {\n const { onBarClicked, measures, dimension, horizontal, data } = options;\n\n const themeFormatter = getThemeFormatter(theme);\n return {\n plugins: {\n legend: { position: theme.charts.legendPosition ?? 'bottom' },\n datalabels: {\n labels: {\n total: {\n formatter: (_value: string | number, context: Context) =>\n getBarChartProDatalabelTotalFormatter(context, (value: number) =>\n themeFormatter.data(measures[0]!, value),\n ),\n },\n value: {\n formatter: (value: string | number, context) => {\n const measure = measures[context.datasetIndex % measures.length]!;\n return themeFormatter.data(measure, value);\n },\n },\n },\n },\n tooltip: {\n callbacks: {\n title: (context) => {\n const label = context[0]?.label;\n return themeFormatter.data(dimension, label);\n },\n label: (context) => {\n const measure = measures[context.datasetIndex % measures.length]!;\n const raw = context.raw as number;\n return `${themeFormatter.data(dimension, context.dataset.label) || ''}: ${themeFormatter.data(measure, raw)}`;\n },\n },\n },\n },\n scales: {\n x: {\n ticks: {\n callback: (value) => {\n if (horizontal) {\n return themeFormatter.data(measures[0]!, value);\n }\n\n if (!data || !data.labels) return undefined;\n\n const label = data.labels[Number(value)] as string;\n\n return themeFormatter.data(dimension, label);\n },\n },\n },\n y: {\n ticks: {\n callback: (value) => {\n if (!horizontal) {\n return themeFormatter.data(measures[0]!, value);\n }\n if (!data || !data.labels) return undefined;\n const label = data.labels[Number(value)] as string;\n return themeFormatter.data(dimension, label);\n },\n },\n },\n },\n onClick: (_event, elements, chart) => {\n const element = elements[0];\n const axisDimensionValue = (element ? chart.data.labels![element.index] : null) as\n | string\n | null;\n const groupingDimensionValue = (\n element\n ? (chart.data.datasets[element.datasetIndex] as { rawLabel?: string | null })?.rawLabel\n : null\n ) as string | null;\n\n onBarClicked({\n axisDimensionValue,\n groupingDimensionValue,\n });\n },\n };\n};\n"],"names":["getBarStackedChartProData","props","theme","themeFormatter","getThemeFormatter","data","dimension","groupDimension","measure","axis","d","groupDimensionName","_a","groupBy","themeKey","getObjectStableKey","chartContrastColors","getChartContrastColors","datasets","groupByItem","index","backgroundColor","getColor","borderColor","axisItem","record","getBarChartProData","remarkableTheme","groupedData","groupTailAsOther","chartColors","getChartColors","item","getBarChartProDatalabelTotalFormatter","context","formatter","i","total","sum","ds","val","getBarChartProOptions","options","onBarClicked","measures","horizontal","_value","value","label","raw","_event","elements","chart","element","axisDimensionValue","groupingDimensionValue"],"mappings":";;;;AAWO,MAAMA,IAA4B,CACvCC,GAMAC,MACqB;;AACrB,QAAMC,IAAiBC,EAAkBF,CAAK,GACxC,EAAE,MAAAG,IAAO,CAAA,GAAI,WAAAC,GAAW,gBAAAC,GAAgB,SAAAC,MAAYP,GAEpDQ,IAAO,CAAC,GAAG,IAAI,IAAIJ,EAAK,IAAI,CAACK,MAAMA,EAAEJ,EA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ACA,EAAK,OAAQ;AAE3B,kBAAM2C,IAAQ3C,EAAK,OAAO,OAAO0C,CAAK,CAAC;AAEvC,mBAAO5C,EAAe,KAAKG,GAAW0C,CAAK;AAAA,UAC7C;AAAA,QAAA;AAAA,MACF;AAAA,MAEF,GAAG;AAAA,QACD,OAAO;AAAA,UACL,UAAU,CAACD,MAAU;AACnB,gBAAI,CAACF;AACH,qBAAO1C,EAAe,KAAKyC,EAAS,CAAC,GAAIG,CAAK;AAEhD,gBAAI,CAAC1C,KAAQ,CAACA,EAAK,OAAQ;AAC3B,kBAAM2C,IAAQ3C,EAAK,OAAO,OAAO0C,CAAK,CAAC;AACvC,mBAAO5C,EAAe,KAAKG,GAAW0C,CAAK;AAAA,UAC7C;AAAA,QAAA;AAAA,MACF;AAAA,IACF;AAAA,IAEF,SAAS,CAACE,GAAQC,GAAUC,MAAU;;AACpC,YAAMC,IAAUF,EAAS,CAAC,GACpBG,IAAsBD,IAAUD,EAAM,KAAK,OAAQC,EAAQ,KAAK,IAAI,MAGpEE,IACJF,KACKzC,IAAAwC,EAAM,KAAK,SAASC,EAAQ,YAAY,MAAxC,gBAAAzC,EAA4E,WAC7E;AAGN,MAAA+B,EAAa;AAAA,QACX,oBAAAW;AAAA,QACA,wBAAAC;AAAA,MAAA,CACD;AAAA,IACH;AAAA,EAAA;AAEJ;"}
|
|
1
|
+
{"version":3,"file":"bars.utils-C45cnEfc.js","sources":["../src/components/charts/bars/bars.utils.ts"],"sourcesContent":["import { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { Theme } from '../../../theme/theme.types';\nimport { remarkableTheme } from '../../../theme/theme.constants';\nimport { ChartData, ChartOptions } from 'chart.js';\nimport { getThemeFormatter } from '../../../theme/formatter/formatter.utils';\nimport { groupTailAsOther } from '../charts.utils';\nimport { getColor } from '../../../theme/styles/styles.utils';\nimport { getChartColors, getChartContrastColors } from '@embeddable.com/remarkable-ui';\nimport { getObjectStableKey } from '../../../utils.ts/object.utils';\nimport { Context } from 'chartjs-plugin-datalabels';\n\nexport const getBarStackedChartProData = (\n props: {\n data: DataResponse['data'];\n dimension: Dimension;\n groupDimension: Dimension;\n measure: Measure;\n },\n theme: Theme,\n): ChartData<'bar'> => {\n const themeFormatter = getThemeFormatter(theme);\n const { data = [], dimension, groupDimension, measure } = props;\n\n const axis = [...new Set(data.map((d) => d[dimension.name]).filter((d) => d != null))].sort();\n const groupDimensionName = `${groupDimension.name}${groupDimension.inputs?.granularity ? `.${groupDimension.inputs.granularity}` : ''}`;\n const groupBy = [...new Set(data.map((d) => d[groupDimensionName]))].filter((d) => d != null);\n\n const themeKey = getObjectStableKey(theme);\n const chartContrastColors = getChartContrastColors();\n const datasets = groupBy.map((groupByItem, index) => {\n const backgroundColor = getColor(\n `${themeKey}.charts.backgroundColors`,\n `${groupDimension.name}.${groupByItem}`,\n theme.charts.backgroundColors ?? chartContrastColors,\n index,\n );\n\n const borderColor = getColor(\n `${themeKey}.charts.borderColors`,\n `${groupDimension.name}.${groupByItem}`,\n theme.charts.borderColors ?? chartContrastColors,\n index,\n );\n\n return {\n label: themeFormatter.data(groupDimension, groupByItem),\n rawLabel: groupByItem,\n backgroundColor,\n borderColor,\n data: axis.map((axisItem) => {\n const record = data.find(\n (d) => d[groupDimensionName] === groupByItem && d[dimension.name] === axisItem,\n );\n return record ? Number(record[measure.name]) : 0;\n }),\n };\n });\n\n return {\n labels: axis,\n datasets,\n };\n};\n\nexport const getBarChartProData = (\n props: {\n data: DataResponse['data'];\n dimension: Dimension;\n measures: Measure[];\n maxItems?: number;\n },\n theme: Theme = remarkableTheme,\n): ChartData<'bar'> => {\n if (!props.data) {\n return {\n labels: [],\n datasets: [{ data: [] }],\n };\n }\n\n const themeFormatter = getThemeFormatter(theme);\n const themeKey = getObjectStableKey(theme);\n const groupedData = groupTailAsOther(props.data, props.dimension, props.measures, props.maxItems);\n const chartColors = getChartColors();\n\n return {\n labels: groupedData.map((item) => {\n return item[props.dimension.name];\n }),\n datasets: props.measures.map((measure, index) => {\n const backgroundColor = getColor(\n `${themeKey}.charts.backgroundColors`,\n measure.name,\n theme.charts.backgroundColors ?? chartColors,\n index,\n );\n\n const borderColor = getColor(\n `${themeKey}.charts.borderColors`,\n measure.name,\n theme.charts.borderColors ?? chartColors,\n index,\n );\n\n return {\n label: themeFormatter.dimensionOrMeasureTitle(measure),\n data: groupedData.map((item) => item[measure.name] ?? 0),\n backgroundColor,\n borderColor,\n };\n }),\n };\n};\n\nconst getBarChartProDatalabelTotalFormatter = (\n context: Context,\n formatter: (value: number) => string,\n) => {\n const { datasets } = context.chart.data;\n const i = context.dataIndex;\n\n const total = datasets.reduce((sum, ds) => {\n const val = ds.data[i] as number;\n return sum + (val || 0);\n }, 0);\n\n return formatter(total);\n};\n\nexport const getBarChartProOptions = (\n options: {\n onBarClicked: (args: {\n axisDimensionValue: string | null;\n groupingDimensionValue: string | null;\n }) => void;\n measures: Measure[];\n dimension: Dimension;\n horizontal: boolean;\n data: ChartData<'bar'>;\n },\n theme: Theme,\n): Partial<ChartOptions<'bar'>> => {\n const { onBarClicked, measures, dimension, horizontal, data } = options;\n\n const themeFormatter = getThemeFormatter(theme);\n return {\n plugins: {\n legend: { position: theme.charts.legendPosition ?? 'bottom' },\n datalabels: {\n labels: {\n total: {\n formatter: (_value: string | number, context: Context) =>\n getBarChartProDatalabelTotalFormatter(context, (value: number) =>\n themeFormatter.data(measures[0]!, value),\n ),\n },\n value: {\n formatter: (value: string | number, context) => {\n const measure = measures[context.datasetIndex % measures.length]!;\n return themeFormatter.data(measure, value);\n },\n },\n },\n },\n tooltip: {\n callbacks: {\n title: (context) => {\n const label = context[0]?.label;\n return themeFormatter.data(dimension, label);\n },\n label: (context) => {\n const measure = measures[context.datasetIndex % measures.length]!;\n const raw = context.raw as number;\n return `${themeFormatter.data(dimension, context.dataset.label) || ''}: ${themeFormatter.data(measure, raw)}`;\n },\n },\n },\n },\n scales: {\n x: {\n ticks: {\n callback: (value) => {\n if (horizontal) {\n return themeFormatter.data(measures[0]!, value);\n }\n\n if (!data || !data.labels) return undefined;\n\n const label = data.labels[Number(value)] as string;\n\n return themeFormatter.data(dimension, label);\n },\n },\n },\n y: {\n ticks: {\n callback: (value) => {\n if (!horizontal) {\n return themeFormatter.data(measures[0]!, value);\n }\n if (!data || !data.labels) return undefined;\n const label = data.labels[Number(value)] as string;\n return themeFormatter.data(dimension, label);\n },\n },\n },\n },\n onClick: (_event, elements, chart) => {\n const element = elements[0];\n const axisDimensionValue = (element ? chart.data.labels![element.index] : null) as\n | string\n | null;\n const groupingDimensionValue = (\n element\n ? (chart.data.datasets[element.datasetIndex] as { rawLabel?: string | null })?.rawLabel\n : null\n ) as string | null;\n\n onBarClicked({\n axisDimensionValue,\n groupingDimensionValue,\n });\n },\n };\n};\n"],"names":["getBarStackedChartProData","props","theme","themeFormatter","getThemeFormatter","data","dimension","groupDimension","measure","axis","d","groupDimensionName","_a","groupBy","themeKey","getObjectStableKey","chartContrastColors","getChartContrastColors","datasets","groupByItem","index","backgroundColor","getColor","borderColor","axisItem","record","getBarChartProData","remarkableTheme","groupedData","groupTailAsOther","chartColors","getChartColors","item","getBarChartProDatalabelTotalFormatter","context","formatter","i","total","sum","ds","val","getBarChartProOptions","options","onBarClicked","measures","horizontal","_value","value","label","raw","_event","elements","chart","element","axisDimensionValue","groupingDimensionValue"],"mappings":";;;;AAWO,MAAMA,IAA4B,CACvCC,GAMAC,MACqB;;AACrB,QAAMC,IAAiBC,EAAkBF,CAAK,GACxC,EAAE,MAAAG,IAAO,CAAA,GAAI,WAAAC,GAAW,gBAAAC,GAAgB,SAAAC,MAAYP,GAEpDQ,IAAO,CAAC,GAAG,IAAI,IAAIJ,EAAK,IAAI,CAACK,MAAMA,EAAEJ,EAAU,IAAI,CAAC,EAAE,OAAO,CAACI,MAAMA,KAAK,IAAI,CAAC,CAAC,EAAE,KAAA,GACjFC,IAAqB,GAAGJ,EAAe,IAAI,IAAGK,IAAAL,EAAe,WAAf,QAAAK,EAAuB,cAAc,I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A,MAEF,GAAG;AAAA,QACD,OAAO;AAAA,UACL,UAAU,CAACD,MAAU;AACnB,gBAAI,CAACF;AACH,qBAAO1C,EAAe,KAAKyC,EAAS,CAAC,GAAIG,CAAK;AAEhD,gBAAI,CAAC1C,KAAQ,CAACA,EAAK,OAAQ;AAC3B,kBAAM2C,IAAQ3C,EAAK,OAAO,OAAO0C,CAAK,CAAC;AACvC,mBAAO5C,EAAe,KAAKG,GAAW0C,CAAK;AAAA,UAC7C;AAAA,QAAA;AAAA,MACF;AAAA,IACF;AAAA,IAEF,SAAS,CAACE,GAAQC,GAAUC,MAAU;;AACpC,YAAMC,IAAUF,EAAS,CAAC,GACpBG,IAAsBD,IAAUD,EAAM,KAAK,OAAQC,EAAQ,KAAK,IAAI,MAGpEE,IACJF,KACKzC,IAAAwC,EAAM,KAAK,SAASC,EAAQ,YAAY,MAAxC,gBAAAzC,EAA4E,WAC7E;AAGN,MAAA+B,EAAa;AAAA,QACX,oBAAAW;AAAA,QACA,wBAAAC;AAAA,MAAA,CACD;AAAA,IACH;AAAA,EAAA;AAEJ;"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import { g as j, d as n, u as B } from "./utc-B2gCnkBk.js";
|
|
2
|
+
import { i as E, q as F } from "./quarterOfYear-wgcl4CRi.js";
|
|
3
|
+
import { useTheme as M } from "@embeddable.com/react";
|
|
4
|
+
import { useMemo as W } from "react";
|
|
5
|
+
var S = { exports: {} }, Z = S.exports, $;
|
|
6
|
+
function b() {
|
|
7
|
+
return $ || ($ = 1, (function(O, h) {
|
|
8
|
+
(function(r, t) {
|
|
9
|
+
O.exports = t();
|
|
10
|
+
})(Z, (function() {
|
|
11
|
+
return function(r, t) {
|
|
12
|
+
t.prototype.isSameOrBefore = function(f, s) {
|
|
13
|
+
return this.isSame(f, s) || this.isBefore(f, s);
|
|
14
|
+
};
|
|
15
|
+
};
|
|
16
|
+
}));
|
|
17
|
+
})(S)), S.exports;
|
|
18
|
+
}
|
|
19
|
+
var C = b();
|
|
20
|
+
const G = /* @__PURE__ */ j(C);
|
|
21
|
+
n.extend(B);
|
|
22
|
+
n.extend(E);
|
|
23
|
+
n.extend(G);
|
|
24
|
+
n.extend(F);
|
|
25
|
+
function A(O) {
|
|
26
|
+
const h = M(), { results: r, dimension: t, orderDirection: f = "asc", externalDateBounds: s } = O;
|
|
27
|
+
return W(() => {
|
|
28
|
+
var k, q, I, R, V, w;
|
|
29
|
+
const m = (k = t.inputs) == null ? void 0 : k.granularity, o = t.name, a = (q = t.inputs) == null ? void 0 : q.dateBounds;
|
|
30
|
+
if (!m || !o || !r || r.isLoading) return r;
|
|
31
|
+
const c = a != null && a.relativeTimeString ? (I = h.defaults.dateRangesOptions.find((e) => e.value === (a == null ? void 0 : a.relativeTimeString))) == null ? void 0 : I.getRange() : a;
|
|
32
|
+
if (t.nativeType !== "time") return r;
|
|
33
|
+
const u = [...(r == null ? void 0 : r.data) ?? []].sort((e, i) => {
|
|
34
|
+
const l = e[o], p = i[o];
|
|
35
|
+
return l == null ? 1 : p == null ? -1 : n.utc(l).diff(n.utc(p));
|
|
36
|
+
}), x = n.utc(
|
|
37
|
+
(s == null ? void 0 : s.from) ?? (c == null ? void 0 : c.from) ?? ((R = u[0]) == null ? void 0 : R[o])
|
|
38
|
+
), y = n.utc(
|
|
39
|
+
(s == null ? void 0 : s.to) ?? (c == null ? void 0 : c.to) ?? ((V = u[u.length - 1]) == null ? void 0 : V[o]) ?? ((w = [...u].reverse().find((e) => (e == null ? void 0 : e[o]) != null)) == null ? void 0 : w[o])
|
|
40
|
+
);
|
|
41
|
+
if (!x.isValid() || !y.isValid())
|
|
42
|
+
return { ...r, data: [] };
|
|
43
|
+
const v = /* @__PURE__ */ new Map();
|
|
44
|
+
for (const e of u) {
|
|
45
|
+
const i = e[o];
|
|
46
|
+
if (i == null) continue;
|
|
47
|
+
const l = n.utc(i).toISOString().split("Z")[0], p = v.get(l) ?? [];
|
|
48
|
+
p.push(e), v.set(l, p);
|
|
49
|
+
}
|
|
50
|
+
const d = [];
|
|
51
|
+
let g = x.startOf(m === "week" ? "isoWeek" : m);
|
|
52
|
+
for (; g.isSameOrBefore(y); ) {
|
|
53
|
+
const e = g.toISOString().split("Z")[0], i = v.get(e);
|
|
54
|
+
i && i.length > 0 ? d.push(...i) : d.push({ [o]: e }), g = g.add(1, m);
|
|
55
|
+
}
|
|
56
|
+
return f === "desc" && d.reverse(), {
|
|
57
|
+
...r,
|
|
58
|
+
data: d
|
|
59
|
+
};
|
|
60
|
+
}, [r, t, f, h]);
|
|
61
|
+
}
|
|
62
|
+
export {
|
|
63
|
+
A as u
|
|
64
|
+
};
|
|
65
|
+
//# sourceMappingURL=charts.fillGaps.hooks-zCMYcjxz.js.map
|