@embeddable.com/remarkable-pro 0.0.0 → 0.0.2
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 +30 -31
- package/dist/BarChartDefaultHorizontalPro.js.map +1 -1
- package/dist/BarChartDefaultPro.js +22 -23
- package/dist/BarChartDefaultPro.js.map +1 -1
- package/dist/BarChartGroupedHorizontalPro.js +24 -25
- package/dist/BarChartGroupedHorizontalPro.js.map +1 -1
- package/dist/BarChartGroupedPro.js +31 -32
- package/dist/BarChartGroupedPro.js.map +1 -1
- package/dist/BarChartStackedHorizontalPro.js +28 -29
- package/dist/BarChartStackedHorizontalPro.js.map +1 -1
- package/dist/BarChartStackedPro.js +35 -36
- package/dist/BarChartStackedPro.js.map +1 -1
- package/dist/ChartCard-CsKQOusx.js +124 -0
- package/dist/ChartCard-CsKQOusx.js.map +1 -0
- package/dist/{Color.type.emb-BaH90Spr.js → Color.type.emb-9H0O-uuD.js} +2 -2
- package/dist/{Color.type.emb-BaH90Spr.js.map → Color.type.emb-9H0O-uuD.js.map} +1 -1
- package/dist/ColorEditor.js +16 -22
- package/dist/ColorEditor.js.map +1 -1
- package/dist/{ComparisonPeriod.type.emb-BhZKPqEG.js → ComparisonPeriod.type.emb-C3XjaFoD.js} +2 -2
- package/dist/{ComparisonPeriod.type.emb-BhZKPqEG.js.map → ComparisonPeriod.type.emb-C3XjaFoD.js.map} +1 -1
- package/dist/ComparisonPeriodSelectFieldPro.js +5 -5
- package/dist/ComparisonPeriodSelectFieldPro.js.map +1 -1
- package/dist/DateRangeSelectFieldPro.js +3 -3
- package/dist/DonutChartPro.js +3 -3
- package/dist/DonutLabelChartPro.js +3 -3
- package/dist/{EditorCard-VYZUBvXV.js → EditorCard-BMEwnQuU.js} +3 -3
- package/dist/EditorCard-BMEwnQuU.js.map +1 -0
- package/dist/HeatMapPro.js +6 -6
- package/dist/HeatMapPro.js.map +1 -1
- package/dist/KpiChartNumberComparisonPro.js +6 -6
- package/dist/KpiChartNumberComparisonPro.js.map +1 -1
- package/dist/KpiChartNumberPro.js +4 -4
- package/dist/KpiChartNumberPro.js.map +1 -1
- package/dist/LineChartComparisonDefaultPro.js +20 -21
- package/dist/LineChartComparisonDefaultPro.js.map +1 -1
- package/dist/LineChartDefaultPro.js +23 -24
- package/dist/LineChartDefaultPro.js.map +1 -1
- package/dist/LineChartGroupedPro.js +33 -34
- package/dist/LineChartGroupedPro.js.map +1 -1
- package/dist/MultiSelectFieldPro.js +3 -3
- package/dist/PieChartPro.js +3 -3
- package/dist/PivotTablePro.js +5 -5
- package/dist/PivotTablePro.js.map +1 -1
- package/dist/SingleSelectFieldPro.js +3 -3
- package/dist/TableChartPaginated.js +24 -25
- package/dist/TableChartPaginated.js.map +1 -1
- package/dist/{ar-Csxpn9Sb.js → ar-Crg6bIiJ.js} +16 -16
- package/dist/ar-Crg6bIiJ.js.map +1 -0
- package/dist/{bars.utils-CPKeOYHg.js → bars.utils-BU_k5fia.js} +4 -4
- package/dist/bars.utils-BU_k5fia.js.map +1 -0
- package/dist/be-cv77rX62.js +57 -0
- package/dist/be-cv77rX62.js.map +1 -0
- package/dist/{charts.fillGaps.hooks-5WclK2CD.js → charts.fillGaps.hooks-YayOXVmt.js} +13 -13
- package/dist/{charts.fillGaps.hooks-5WclK2CD.js.map → charts.fillGaps.hooks-YayOXVmt.js.map} +1 -1
- package/dist/{charts.utils-QVS79CrC.js → charts.utils-rO92wRxO.js} +6 -6
- package/dist/charts.utils-rO92wRxO.js.map +1 -0
- package/dist/color.utils-BSg_DFOh.js +1645 -0
- package/dist/color.utils-BSg_DFOh.js.map +1 -0
- package/dist/{component.constants-DZwEQb2v.js → component.constants-uP1WYyUb.js} +83 -83
- package/dist/component.constants-uP1WYyUb.js.map +1 -0
- package/dist/components/charts/tables/HeatMapPro/index.d.ts +1 -1
- package/dist/components/charts/tables/HeatMapPro/index.d.ts.map +1 -1
- package/dist/components/charts/tables/PivotTablePro/PivotPro.utils.d.ts +1 -1
- package/dist/components/charts/tables/PivotTablePro/PivotPro.utils.d.ts.map +1 -1
- package/dist/components/charts/tables/tables.utils.d.ts +1 -1
- package/dist/components/charts/tables/tables.utils.d.ts.map +1 -1
- package/dist/components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.utils.d.ts +1 -1
- package/dist/components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.utils.d.ts.map +1 -1
- package/dist/components/editors/DateRangeSelectFieldPro/DateRangeSelectFieldPro.utils.d.ts +1 -1
- package/dist/components/editors/DateRangeSelectFieldPro/DateRangeSelectFieldPro.utils.d.ts.map +1 -1
- package/dist/{editors.timeRange.utils-D9m6B3r1.js → editors.timeRange.utils-DTtRGaCo.js} +4 -4
- package/dist/{editors.timeRange.utils-D9m6B3r1.js.map → editors.timeRange.utils-DTtRGaCo.js.map} +1 -1
- package/dist/embeddable-components.json +15 -15
- package/dist/{embeddable-theme-4271d.js → embeddable-theme-0137e.js} +1029 -1032
- package/dist/{formatter.utils-BbPzfaw8.js → formatter.utils-CeEdL8uQ.js} +2 -2
- package/dist/{formatter.utils-BbPzfaw8.js.map → formatter.utils-CeEdL8uQ.js.map} +1 -1
- package/dist/globalHooks.json +1 -1
- package/dist/{index-DqkDSVr0.js → index-B8bT85NR.js} +20 -21
- package/dist/index-B8bT85NR.js.map +1 -0
- package/dist/{index-BcSuns5b.js → index-BWpUwKTH.js} +5 -5
- package/dist/index-BWpUwKTH.js.map +1 -0
- package/dist/index-Brb617sy.js +62 -0
- package/dist/index-Brb617sy.js.map +1 -0
- package/dist/{index-CJMug46v.js → index-DLFOG9Ar.js} +19 -20
- package/dist/index-DLFOG9Ar.js.map +1 -0
- package/dist/{index-BpXo_FjW.js → index-DedIqjbn.js} +12581 -12636
- package/dist/index-DedIqjbn.js.map +1 -0
- package/dist/{index-B3N7aoDJ.js → index-DrosyYQD.js} +13 -13
- package/dist/index-DrosyYQD.js.map +1 -0
- package/dist/{index-CxXN32qg.js → index-Dwl9clc9.js} +5 -5
- package/dist/index-Dwl9clc9.js.map +1 -0
- package/dist/index.js +14 -14
- package/dist/{it-CA9ooIqN.js → it-BaO88QsF.js} +2 -2
- package/dist/it-BaO88QsF.js.map +1 -0
- package/dist/{pies.utils-DbzeVrCQ.js → pies.utils-Dap7Duqb.js} +5 -5
- package/dist/pies.utils-Dap7Duqb.js.map +1 -0
- package/dist/{quarterOfYear-C0maIilJ.js → quarterOfYear-wgcl4CRi.js} +5 -5
- package/dist/{quarterOfYear-C0maIilJ.js.map → quarterOfYear-wgcl4CRi.js.map} +1 -1
- package/dist/remarkable-pro.css +1 -1
- package/dist/theme/styles/styles.constants.d.ts +1 -1
- package/dist/theme/styles/styles.constants.d.ts.map +1 -1
- package/dist/theme/styles/styles.types.d.ts +1 -1
- package/dist/theme/styles/styles.types.d.ts.map +1 -1
- package/dist/{timeRange.utils-B3BJBCvs.js → timeRange.utils-J3a4XL64.js} +2 -2
- package/dist/{timeRange.utils-B3BJBCvs.js.map → timeRange.utils-J3a4XL64.js.map} +1 -1
- package/package.json +2 -2
- package/dist/ChartCard-BaCPgMtI.js +0 -145
- package/dist/ChartCard-BaCPgMtI.js.map +0 -1
- package/dist/EditorCard-VYZUBvXV.js.map +0 -1
- package/dist/ar-Csxpn9Sb.js.map +0 -1
- package/dist/bars.utils-CPKeOYHg.js.map +0 -1
- package/dist/be-DcRqzG_0.js +0 -42
- package/dist/be-DcRqzG_0.js.map +0 -1
- package/dist/charts.utils-QVS79CrC.js.map +0 -1
- package/dist/color.utils-CVyp-fGP.js +0 -1645
- package/dist/color.utils-CVyp-fGP.js.map +0 -1
- package/dist/component.constants-DZwEQb2v.js.map +0 -1
- package/dist/index-B3N7aoDJ.js.map +0 -1
- package/dist/index-BcSuns5b.js.map +0 -1
- package/dist/index-BpXo_FjW.js.map +0 -1
- package/dist/index-CJMug46v.js.map +0 -1
- package/dist/index-CPSyJe2a.js +0 -63
- package/dist/index-CPSyJe2a.js.map +0 -1
- package/dist/index-CxXN32qg.js.map +0 -1
- package/dist/index-DqkDSVr0.js.map +0 -1
- package/dist/it-CA9ooIqN.js.map +0 -1
- package/dist/mergician.esm-CIFzMAK7.js +0 -395
- package/dist/mergician.esm-CIFzMAK7.js.map +0 -1
- package/dist/pies.utils-DbzeVrCQ.js.map +0 -1
|
@@ -1,14 +1,13 @@
|
|
|
1
|
-
import { j as m, B as
|
|
2
|
-
import { useTheme as
|
|
3
|
-
import { a as
|
|
4
|
-
import { C as
|
|
5
|
-
import { b as
|
|
6
|
-
import {
|
|
7
|
-
import { u as Z } from "./charts.fillGaps.hooks-5WclK2CD.js";
|
|
1
|
+
import { m as L, j as m, B as f, V as u, l as w } from "./index-DedIqjbn.js";
|
|
2
|
+
import { useTheme as S, defineComponent as z } from "@embeddable.com/react";
|
|
3
|
+
import { a as R, r as M, v as P, D as H, z as v, w as T, F as j, G as F, H as G, I as Y, J as I, K as O, M as E, N as J, O as K, R as N, U, V as W, L as _ } from "./component.constants-uP1WYyUb.js";
|
|
4
|
+
import { C as q } from "./ChartCard-CsKQOusx.js";
|
|
5
|
+
import { b as Q, a as X } from "./bars.utils-BU_k5fia.js";
|
|
6
|
+
import { u as Z } from "./charts.fillGaps.hooks-YayOXVmt.js";
|
|
8
7
|
const $ = (a) => {
|
|
9
8
|
var n, l;
|
|
10
|
-
const e =
|
|
11
|
-
|
|
9
|
+
const e = S();
|
|
10
|
+
R(e);
|
|
12
11
|
const {
|
|
13
12
|
description: d,
|
|
14
13
|
groupBy: i,
|
|
@@ -16,8 +15,8 @@ const $ = (a) => {
|
|
|
16
15
|
reverseYAxis: x,
|
|
17
16
|
showLegend: c,
|
|
18
17
|
showLogarithmicScale: h,
|
|
19
|
-
showTooltips:
|
|
20
|
-
showTotalLabels:
|
|
18
|
+
showTooltips: g,
|
|
19
|
+
showTotalLabels: p,
|
|
21
20
|
showValueLabels: b,
|
|
22
21
|
title: C,
|
|
23
22
|
yAxis: o,
|
|
@@ -26,10 +25,10 @@ const $ = (a) => {
|
|
|
26
25
|
xAxisRangeMax: V,
|
|
27
26
|
xAxisRangeMin: k,
|
|
28
27
|
onBarClicked: y
|
|
29
|
-
} =
|
|
28
|
+
} = M(a), r = Z({
|
|
30
29
|
results: a.results,
|
|
31
30
|
dimension: a.yAxis
|
|
32
|
-
}), t =
|
|
31
|
+
}), t = Q(
|
|
33
32
|
{
|
|
34
33
|
data: r.data,
|
|
35
34
|
dimension: o,
|
|
@@ -37,15 +36,15 @@ const $ = (a) => {
|
|
|
37
36
|
measure: s
|
|
38
37
|
},
|
|
39
38
|
e
|
|
40
|
-
), D =
|
|
41
|
-
|
|
39
|
+
), D = L(
|
|
40
|
+
X(
|
|
42
41
|
{ measures: [s], horizontal: !0, onBarClicked: y, data: t, dimension: o },
|
|
43
42
|
e
|
|
44
43
|
),
|
|
45
44
|
((l = (n = e.charts) == null ? void 0 : n.barChartStackedHorizontalPro) == null ? void 0 : l.options) || {}
|
|
46
45
|
);
|
|
47
46
|
return /* @__PURE__ */ m.jsx(
|
|
48
|
-
|
|
47
|
+
q,
|
|
49
48
|
{
|
|
50
49
|
data: r,
|
|
51
50
|
dimensionsAndMeasures: [s, o, i],
|
|
@@ -53,11 +52,11 @@ const $ = (a) => {
|
|
|
53
52
|
subtitle: d,
|
|
54
53
|
title: C,
|
|
55
54
|
children: /* @__PURE__ */ m.jsx(
|
|
56
|
-
|
|
55
|
+
f,
|
|
57
56
|
{
|
|
58
57
|
data: t,
|
|
59
58
|
showLegend: c,
|
|
60
|
-
showTooltips:
|
|
59
|
+
showTooltips: g,
|
|
61
60
|
showValueLabels: b,
|
|
62
61
|
showLogarithmicScale: h,
|
|
63
62
|
xAxisLabel: A,
|
|
@@ -65,7 +64,7 @@ const $ = (a) => {
|
|
|
65
64
|
reverseYAxis: x,
|
|
66
65
|
xAxisRangeMin: k,
|
|
67
66
|
xAxisRangeMax: V,
|
|
68
|
-
showTotalLabels:
|
|
67
|
+
showTotalLabels: p,
|
|
69
68
|
options: D,
|
|
70
69
|
stacked: !0,
|
|
71
70
|
horizontal: !0
|
|
@@ -78,23 +77,23 @@ const $ = (a) => {
|
|
|
78
77
|
label: "Bar Chart - Stacked Horizontal",
|
|
79
78
|
category: "Bar Charts",
|
|
80
79
|
inputs: [
|
|
81
|
-
M,
|
|
82
80
|
P,
|
|
83
|
-
|
|
84
|
-
{ ...v, name: "
|
|
85
|
-
T,
|
|
81
|
+
H,
|
|
82
|
+
{ ...v, name: "yAxis", label: "Y-axis" },
|
|
83
|
+
{ ...T, name: "groupBy", label: "Group by" },
|
|
86
84
|
j,
|
|
87
85
|
F,
|
|
88
86
|
G,
|
|
89
87
|
Y,
|
|
90
|
-
|
|
91
|
-
O,
|
|
88
|
+
I,
|
|
89
|
+
{ ...O, defaultValue: !1 },
|
|
92
90
|
E,
|
|
93
91
|
J,
|
|
94
92
|
K,
|
|
95
93
|
N,
|
|
96
94
|
U,
|
|
97
|
-
W
|
|
95
|
+
W,
|
|
96
|
+
_
|
|
98
97
|
],
|
|
99
98
|
events: [
|
|
100
99
|
{
|
|
@@ -114,10 +113,10 @@ const $ = (a) => {
|
|
|
114
113
|
]
|
|
115
114
|
}
|
|
116
115
|
]
|
|
117
|
-
},
|
|
116
|
+
}, na = z($, aa, {
|
|
118
117
|
props: (a) => ({
|
|
119
118
|
...a,
|
|
120
|
-
results:
|
|
119
|
+
results: w({
|
|
121
120
|
limit: a.maxResults,
|
|
122
121
|
from: a.dataset,
|
|
123
122
|
select: [a.yAxis, a.groupBy, a.measure]
|
|
@@ -131,7 +130,7 @@ const $ = (a) => {
|
|
|
131
130
|
}
|
|
132
131
|
});
|
|
133
132
|
export {
|
|
134
|
-
|
|
133
|
+
na as default,
|
|
135
134
|
aa as meta
|
|
136
135
|
};
|
|
137
136
|
//# sourceMappingURL=BarChartStackedHorizontalPro.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChartStackedHorizontalPro.js","sources":["../src/components/charts/bars/BarChartStackedHorizontalPro/index.tsx","../src/components/charts/bars/BarChartStackedHorizontalPro/BarChartStackedHorizontalPro.emb.ts"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { i18nSetup } from '../../../../theme/i18n/i18n';\nimport { ChartCard } from '../../shared/ChartCard/ChartCard';\nimport { resolveI18nProps } from '../../../component.utils';\nimport { BarChart } from '@embeddable.com/remarkable-ui
|
|
1
|
+
{"version":3,"file":"BarChartStackedHorizontalPro.js","sources":["../src/components/charts/bars/BarChartStackedHorizontalPro/index.tsx","../src/components/charts/bars/BarChartStackedHorizontalPro/BarChartStackedHorizontalPro.emb.ts"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { i18nSetup } from '../../../../theme/i18n/i18n';\nimport { ChartCard } from '../../shared/ChartCard/ChartCard';\nimport { resolveI18nProps } from '../../../component.utils';\nimport { BarChart } from '@embeddable.com/remarkable-ui';\nimport { getBarChartProOptions, getBarStackedChartProData } from '../bars.utils';\nimport { mergician } from 'mergician';\nimport { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { useFillGaps } from '../../charts.fillGaps.hooks';\n\ntype BarChartHorizontalStackedProProps = {\n description: string;\n groupBy: Dimension;\n measure: Measure;\n results: DataResponse;\n reverseYAxis: boolean;\n showLegend: boolean;\n showLogarithmicScale: boolean;\n showTooltips: boolean;\n showTotalLabels?: boolean;\n showValueLabels: boolean;\n title: string;\n yAxis: Dimension;\n xAxisLabel: string;\n yAxisLabel: string;\n xAxisRangeMax?: number;\n xAxisRangeMin?: number;\n onBarClicked: (args: {\n axisDimensionValue: string | null;\n groupingDimensionValue: string | null;\n }) => void;\n};\n\nconst BarChartHorizontalStackedPro = (props: BarChartHorizontalStackedProProps) => {\n const theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const {\n description,\n groupBy,\n measure,\n reverseYAxis,\n showLegend,\n showLogarithmicScale,\n showTooltips,\n showTotalLabels,\n showValueLabels,\n title,\n yAxis,\n xAxisLabel,\n yAxisLabel,\n xAxisRangeMax,\n xAxisRangeMin,\n onBarClicked,\n } = resolveI18nProps(props);\n\n const results = useFillGaps({\n results: props.results,\n dimension: props.yAxis,\n });\n\n const data = getBarStackedChartProData(\n {\n data: results.data,\n dimension: yAxis,\n groupDimension: groupBy,\n measure,\n },\n theme,\n );\n\n const options = mergician(\n getBarChartProOptions(\n { measures: [measure], horizontal: true, onBarClicked, data, dimension: yAxis },\n theme,\n ),\n theme.charts?.barChartStackedHorizontalPro?.options || {},\n );\n\n return (\n <ChartCard\n data={results}\n dimensionsAndMeasures={[measure, yAxis, groupBy]}\n errorMessage={results.error}\n subtitle={description}\n title={title}\n >\n <BarChart\n data={data}\n showLegend={showLegend}\n showTooltips={showTooltips}\n showValueLabels={showValueLabels}\n showLogarithmicScale={showLogarithmicScale}\n xAxisLabel={xAxisLabel}\n yAxisLabel={yAxisLabel}\n reverseYAxis={reverseYAxis}\n xAxisRangeMin={xAxisRangeMin}\n xAxisRangeMax={xAxisRangeMax}\n showTotalLabels={showTotalLabels}\n options={options}\n stacked\n horizontal\n />\n </ChartCard>\n );\n};\n\nexport default BarChartHorizontalStackedPro;\n","import { Value, loadData } from '@embeddable.com/core';\nimport { defineComponent, EmbeddedComponentMeta, Inputs } from '@embeddable.com/react';\nimport BarChartStackedHorizontalPro from './index';\nimport {\n dataset,\n description,\n dimensionWithDateBounds,\n dimension,\n showLegend,\n showTooltips,\n showValueLabels,\n title,\n measure,\n showLogarithmicScale,\n xAxisLabel,\n yAxisLabel,\n showTotalLabels,\n reverseYAxis,\n xAxisRangeMin,\n xAxisRangeMax,\n maxResults,\n} from '../../../component.constants';\n\nexport const meta = {\n name: 'BarChartStackedHorizontalPro',\n label: 'Bar Chart - Stacked Horizontal',\n category: 'Bar Charts',\n inputs: [\n dataset,\n measure,\n { ...dimensionWithDateBounds, name: 'yAxis', label: 'Y-axis' },\n { ...dimension, name: 'groupBy', label: 'Group by' },\n title,\n description,\n maxResults,\n showLegend,\n showTooltips,\n { ...showValueLabels, defaultValue: false },\n showLogarithmicScale,\n xAxisLabel,\n yAxisLabel,\n reverseYAxis,\n xAxisRangeMin,\n xAxisRangeMax,\n showTotalLabels,\n ],\n events: [\n {\n name: 'onBarClicked',\n label: 'A bar is clicked',\n properties: [\n {\n name: 'axisDimensionValue',\n label: 'Clicked Axis Dimension Value',\n type: 'string',\n },\n {\n name: 'groupingDimensionValue',\n label: 'Clicked Grouping Dimension Value',\n type: 'string',\n },\n ],\n },\n ],\n} as const satisfies EmbeddedComponentMeta;\n\nexport default defineComponent(BarChartStackedHorizontalPro, meta, {\n props: (inputs: Inputs<typeof meta>) => {\n return {\n ...inputs,\n results: loadData({\n limit: inputs.maxResults,\n from: inputs.dataset,\n select: [inputs.yAxis, inputs.groupBy, inputs.measure],\n }),\n };\n },\n events: {\n onBarClicked: (value) => {\n return {\n axisDimensionValue: value.axisDimensionValue || Value.noFilter(),\n groupingDimensionValue: value.groupingDimensionValue || Value.noFilter(),\n };\n },\n },\n});\n"],"names":["BarChartHorizontalStackedPro","props","theme","useTheme","i18nSetup","description","groupBy","measure","reverseYAxis","showLegend","showLogarithmicScale","showTooltips","showTotalLabels","showValueLabels","title","yAxis","xAxisLabel","yAxisLabel","xAxisRangeMax","xAxisRangeMin","onBarClicked","resolveI18nProps","results","useFillGaps","data","getBarStackedChartProData","options","mergician","getBarChartProOptions","_b","_a","jsx","ChartCard","BarChart","meta","dataset","dimensionWithDateBounds","dimension","maxResults","BarChartStackedHorizontalPro_emb","defineComponent","BarChartStackedHorizontalPro","inputs","loadData","value","Value"],"mappings":";;;;;;AAkCA,MAAMA,IAA+B,CAACC,MAA6C;;AACjF,QAAMC,IAAQC,EAAA;AACd,EAAAC,EAAUF,CAAK;AAEf,QAAM;AAAA,IACJ,aAAAG;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA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|
-
import { useTheme as
|
|
3
|
-
import { a as
|
|
4
|
-
import { C as
|
|
5
|
-
import { b as
|
|
6
|
-
import {
|
|
7
|
-
import { u as Z } from "./charts.fillGaps.hooks-5WclK2CD.js";
|
|
1
|
+
import { m as V, j as m, B as f, V as u, l as w } from "./index-DedIqjbn.js";
|
|
2
|
+
import { useTheme as S, defineComponent as P } from "@embeddable.com/react";
|
|
3
|
+
import { a as M, r as R, v as T, D as v, z as j, w as F, F as G, G as X, H as z, I, J as O, K as E, M as H, N as J, O as K, P as N, S as W, T as _, L as q } from "./component.constants-uP1WYyUb.js";
|
|
4
|
+
import { C as Q } from "./ChartCard-CsKQOusx.js";
|
|
5
|
+
import { b as U, a as Y } from "./bars.utils-BU_k5fia.js";
|
|
6
|
+
import { u as Z } from "./charts.fillGaps.hooks-YayOXVmt.js";
|
|
8
7
|
const $ = (a) => {
|
|
9
8
|
var n, l;
|
|
10
|
-
const e =
|
|
11
|
-
|
|
9
|
+
const e = S();
|
|
10
|
+
M(e);
|
|
12
11
|
const {
|
|
13
12
|
description: d,
|
|
14
13
|
groupBy: o,
|
|
@@ -16,20 +15,20 @@ const $ = (a) => {
|
|
|
16
15
|
reverseXAxis: x,
|
|
17
16
|
showLegend: c,
|
|
18
17
|
showLogarithmicScale: h,
|
|
19
|
-
showTooltips:
|
|
20
|
-
showTotalLabels:
|
|
18
|
+
showTooltips: g,
|
|
19
|
+
showTotalLabels: p,
|
|
21
20
|
showValueLabels: b,
|
|
22
21
|
title: C,
|
|
23
22
|
xAxis: r,
|
|
24
23
|
xAxisLabel: A,
|
|
25
24
|
yAxisLabel: B,
|
|
26
|
-
yAxisRangeMax:
|
|
27
|
-
yAxisRangeMin:
|
|
28
|
-
onBarClicked:
|
|
29
|
-
} =
|
|
25
|
+
yAxisRangeMax: k,
|
|
26
|
+
yAxisRangeMin: y,
|
|
27
|
+
onBarClicked: D
|
|
28
|
+
} = R(a), i = Z({
|
|
30
29
|
results: a.results,
|
|
31
30
|
dimension: a.xAxis
|
|
32
|
-
}), t =
|
|
31
|
+
}), t = U(
|
|
33
32
|
{
|
|
34
33
|
data: i.data,
|
|
35
34
|
dimension: r,
|
|
@@ -37,15 +36,15 @@ const $ = (a) => {
|
|
|
37
36
|
measure: s
|
|
38
37
|
},
|
|
39
38
|
e
|
|
40
|
-
),
|
|
41
|
-
|
|
42
|
-
{ measures: [s], horizontal: !1, onBarClicked:
|
|
39
|
+
), L = V(
|
|
40
|
+
Y(
|
|
41
|
+
{ measures: [s], horizontal: !1, onBarClicked: D, data: t, dimension: r },
|
|
43
42
|
e
|
|
44
43
|
),
|
|
45
44
|
((l = (n = e.charts) == null ? void 0 : n.barChartStackedPro) == null ? void 0 : l.options) || {}
|
|
46
45
|
);
|
|
47
46
|
return /* @__PURE__ */ m.jsx(
|
|
48
|
-
|
|
47
|
+
Q,
|
|
49
48
|
{
|
|
50
49
|
data: i,
|
|
51
50
|
dimensionsAndMeasures: [s, r, o],
|
|
@@ -53,20 +52,20 @@ const $ = (a) => {
|
|
|
53
52
|
subtitle: d,
|
|
54
53
|
title: C,
|
|
55
54
|
children: /* @__PURE__ */ m.jsx(
|
|
56
|
-
|
|
55
|
+
f,
|
|
57
56
|
{
|
|
58
57
|
data: t,
|
|
59
58
|
showLegend: c,
|
|
60
|
-
showTooltips:
|
|
59
|
+
showTooltips: g,
|
|
61
60
|
showValueLabels: b,
|
|
62
61
|
showLogarithmicScale: h,
|
|
63
62
|
xAxisLabel: A,
|
|
64
63
|
yAxisLabel: B,
|
|
65
64
|
reverseXAxis: x,
|
|
66
|
-
yAxisRangeMin:
|
|
67
|
-
yAxisRangeMax:
|
|
68
|
-
showTotalLabels:
|
|
69
|
-
options:
|
|
65
|
+
yAxisRangeMin: y,
|
|
66
|
+
yAxisRangeMax: k,
|
|
67
|
+
showTotalLabels: p,
|
|
68
|
+
options: L,
|
|
70
69
|
stacked: !0
|
|
71
70
|
}
|
|
72
71
|
)
|
|
@@ -77,23 +76,23 @@ const $ = (a) => {
|
|
|
77
76
|
label: "Bar Chart - Stacked",
|
|
78
77
|
category: "Bar Charts",
|
|
79
78
|
inputs: [
|
|
80
|
-
R,
|
|
81
79
|
T,
|
|
82
|
-
|
|
83
|
-
{ ...j, name: "
|
|
84
|
-
F,
|
|
80
|
+
v,
|
|
81
|
+
{ ...j, name: "xAxis", label: "X-axis" },
|
|
82
|
+
{ ...F, name: "groupBy", label: "Group by" },
|
|
85
83
|
G,
|
|
86
84
|
X,
|
|
87
85
|
z,
|
|
88
86
|
I,
|
|
89
|
-
|
|
90
|
-
E,
|
|
87
|
+
O,
|
|
88
|
+
{ ...E, defaultValue: !1 },
|
|
91
89
|
H,
|
|
92
90
|
J,
|
|
93
91
|
K,
|
|
94
92
|
N,
|
|
95
93
|
W,
|
|
96
|
-
_
|
|
94
|
+
_,
|
|
95
|
+
q
|
|
97
96
|
],
|
|
98
97
|
events: [
|
|
99
98
|
{
|
|
@@ -113,10 +112,10 @@ const $ = (a) => {
|
|
|
113
112
|
]
|
|
114
113
|
}
|
|
115
114
|
]
|
|
116
|
-
},
|
|
115
|
+
}, na = P($, aa, {
|
|
117
116
|
props: (a) => ({
|
|
118
117
|
...a,
|
|
119
|
-
results:
|
|
118
|
+
results: w({
|
|
120
119
|
limit: a.maxResults,
|
|
121
120
|
from: a.dataset,
|
|
122
121
|
select: [a.xAxis, a.groupBy, a.measure]
|
|
@@ -130,7 +129,7 @@ const $ = (a) => {
|
|
|
130
129
|
}
|
|
131
130
|
});
|
|
132
131
|
export {
|
|
133
|
-
|
|
132
|
+
na as default,
|
|
134
133
|
aa as meta
|
|
135
134
|
};
|
|
136
135
|
//# sourceMappingURL=BarChartStackedPro.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BarChartStackedPro.js","sources":["../src/components/charts/bars/BarChartStackedPro/index.tsx","../src/components/charts/bars/BarChartStackedPro/BarChartStackedPro.emb.ts"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { i18nSetup } from '../../../../theme/i18n/i18n';\nimport { ChartCard } from '../../shared/ChartCard/ChartCard';\nimport { resolveI18nProps } from '../../../component.utils';\nimport { BarChart } from '@embeddable.com/remarkable-ui
|
|
1
|
+
{"version":3,"file":"BarChartStackedPro.js","sources":["../src/components/charts/bars/BarChartStackedPro/index.tsx","../src/components/charts/bars/BarChartStackedPro/BarChartStackedPro.emb.ts"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { i18nSetup } from '../../../../theme/i18n/i18n';\nimport { ChartCard } from '../../shared/ChartCard/ChartCard';\nimport { resolveI18nProps } from '../../../component.utils';\nimport { BarChart } from '@embeddable.com/remarkable-ui';\nimport { getBarChartProOptions, getBarStackedChartProData } from '../bars.utils';\nimport { mergician } from 'mergician';\nimport { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { useFillGaps } from '../../charts.fillGaps.hooks';\n\ntype BarChartStackedProProps = {\n description: string;\n groupBy: Dimension;\n maxLegendItems?: number;\n measure: Measure;\n results: DataResponse;\n reverseXAxis: boolean;\n showLegend: boolean;\n showLogarithmicScale: boolean;\n showTotalLabels?: boolean;\n showTooltips: boolean;\n showValueLabels: boolean;\n title: string;\n xAxis: Dimension;\n xAxisLabel: string;\n yAxisLabel: string;\n yAxisRangeMax?: number;\n yAxisRangeMin?: number;\n onBarClicked: (args: {\n axisDimensionValue: string | null;\n groupingDimensionValue: string | null;\n }) => void;\n};\n\nconst BarChartStackedPro = (props: BarChartStackedProProps) => {\n const theme = useTheme() as Theme;\n i18nSetup(theme);\n const {\n description,\n groupBy,\n measure,\n reverseXAxis,\n showLegend,\n showLogarithmicScale,\n showTooltips,\n showTotalLabels,\n showValueLabels,\n title,\n xAxis,\n xAxisLabel,\n yAxisLabel,\n yAxisRangeMax,\n yAxisRangeMin,\n onBarClicked,\n } = resolveI18nProps(props);\n\n const results = useFillGaps({\n results: props.results,\n dimension: props.xAxis,\n });\n\n const data = getBarStackedChartProData(\n {\n data: results.data,\n dimension: xAxis,\n groupDimension: groupBy,\n measure,\n },\n theme,\n );\n\n const options = mergician(\n getBarChartProOptions(\n { measures: [measure], horizontal: false, onBarClicked, data, dimension: xAxis },\n theme,\n ),\n theme.charts?.barChartStackedPro?.options || {},\n );\n\n return (\n <ChartCard\n data={results}\n dimensionsAndMeasures={[measure, xAxis, groupBy]}\n errorMessage={results.error}\n subtitle={description}\n title={title}\n >\n <BarChart\n data={data}\n showLegend={showLegend}\n showTooltips={showTooltips}\n showValueLabels={showValueLabels}\n showLogarithmicScale={showLogarithmicScale}\n xAxisLabel={xAxisLabel}\n yAxisLabel={yAxisLabel}\n reverseXAxis={reverseXAxis}\n yAxisRangeMin={yAxisRangeMin}\n yAxisRangeMax={yAxisRangeMax}\n showTotalLabels={showTotalLabels}\n options={options}\n stacked\n />\n </ChartCard>\n );\n};\n\nexport default BarChartStackedPro;\n","import { Value, loadData } from '@embeddable.com/core';\nimport { defineComponent, EmbeddedComponentMeta, Inputs } from '@embeddable.com/react';\nimport BarChartStackedPro from './index';\nimport {\n dataset,\n description,\n dimensionWithDateBounds,\n dimension,\n showLegend,\n showTooltips,\n showValueLabels,\n title,\n measure,\n showLogarithmicScale,\n xAxisLabel,\n yAxisLabel,\n reverseXAxis,\n yAxisRangeMin,\n yAxisRangeMax,\n showTotalLabels,\n maxResults,\n} from '../../../component.constants';\n\nexport const meta = {\n name: 'BarChartStackedPro',\n label: 'Bar Chart - Stacked',\n category: 'Bar Charts',\n inputs: [\n dataset,\n measure,\n { ...dimensionWithDateBounds, name: 'xAxis', label: 'X-axis' },\n { ...dimension, name: 'groupBy', label: 'Group by' },\n title,\n description,\n maxResults,\n showLegend,\n showTooltips,\n { ...showValueLabels, defaultValue: false },\n showLogarithmicScale,\n xAxisLabel,\n yAxisLabel,\n reverseXAxis,\n yAxisRangeMin,\n yAxisRangeMax,\n showTotalLabels,\n ],\n events: [\n {\n name: 'onBarClicked',\n label: 'A bar is clicked',\n properties: [\n {\n name: 'axisDimensionValue',\n label: 'Clicked Axis Dimension Value',\n type: 'string',\n },\n {\n name: 'groupingDimensionValue',\n label: 'Clicked Grouping Dimension Value',\n type: 'string',\n },\n ],\n },\n ],\n} as const satisfies EmbeddedComponentMeta;\n\nexport default defineComponent(BarChartStackedPro, meta, {\n props: (inputs: Inputs<typeof meta>) => {\n return {\n ...inputs,\n results: loadData({\n limit: inputs.maxResults,\n from: inputs.dataset,\n select: [inputs.xAxis, inputs.groupBy, inputs.measure],\n }),\n };\n },\n events: {\n onBarClicked: (value) => {\n return {\n axisDimensionValue: value.axisDimensionValue || Value.noFilter(),\n groupingDimensionValue: value.groupingDimensionValue || Value.noFilter(),\n };\n },\n },\n});\n"],"names":["BarChartStackedPro","props","theme","useTheme","i18nSetup","description","groupBy","measure","reverseXAxis","showLegend","showLogarithmicScale","showTooltips","showTotalLabels","showValueLabels","title","xAxis","xAxisLabel","yAxisLabel","yAxisRangeMax","yAxisRangeMin","onBarClicked","resolveI18nProps","results","useFillGaps","data","getBarStackedChartProData","options","mergician","getBarChartProOptions","_b","_a","jsx","ChartCard","BarChart","meta","dataset","dimensionWithDateBounds","dimension","maxResults","BarChartStackedPro_emb","defineComponent","inputs","loadData","value","Value"],"mappings":";;;;;;AAmCA,MAAMA,IAAqB,CAACC,MAAmC;;AAC7D,QAAMC,IAAQC,EAAA;AACd,EAAAC,EAAUF,CAAK;AACf,QAAM;AAAA,IACJ,aAAAG;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,IACEC,EAAiBpB,CAAK,GAEpBqB,IAAUC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AAAA,IACxCvB;AAAA,IACAT;AAAA,IACAiC;AAAA,IACA7B;AAAA,IACAE;AAAA,IACA,EAAE,GAAGE,GAAiB,cAAc,GAAA;AAAA,IACpCH;AAAA,IACAM;AAAA,IACAC;AAAA,IACAT;AAAA,IACAW;AAAA,IACAD;AAAA,IACAN;AAAA,EAAA;AAAA,EAEF,QAAQ;AAAA,IACN;AAAA,MACE,MAAM;AAAA,MACN,OAAO;AAAA,MACP,YAAY;AAAA,QACV;AAAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,UACP,MAAM;AAAA,QAAA;AAAA,QAER;AAAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,UACP,MAAM;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAEJ,GAEA2B,KAAeC,EAAgBxC,GAAoBkC,IAAM;AAAA,EACvD,OAAO,CAACO,OACC;AAAA,IACL,GAAGA;AAAA,IACH,SAASC,EAAS;AAAA,MAChB,OAAOD,EAAO;AAAA,MACd,MAAMA,EAAO;AAAA,MACb,QAAQ,CAACA,EAAO,OAAOA,EAAO,SAASA,EAAO,OAAO;AAAA,IAAA,CACtD;AAAA,EAAA;AAAA,EAGL,QAAQ;AAAA,IACN,cAAc,CAACE,OACN;AAAA,MACL,oBAAoBA,EAAM,sBAAsBC,EAAM,SAAA;AAAA,MACtD,wBAAwBD,EAAM,0BAA0BC,EAAM,SAAA;AAAA,IAAS;AAAA,EAE3E;AAEJ,CAAC;"}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import { s as R, j as t, t as D, v as w, w as I, x as S, A as k, C as L, c as N, y as x, e as M, z as b, f } from "./index-DedIqjbn.js";
|
|
2
|
+
import _, { useRef as T } from "react";
|
|
3
|
+
import { useTheme as j } from "@embeddable.com/react";
|
|
4
|
+
import { a as v, i as C, a0 as A } from "./component.constants-uP1WYyUb.js";
|
|
5
|
+
/**
|
|
6
|
+
* @license @tabler/icons-react v3.35.0 - MIT
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license.
|
|
9
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/
|
|
11
|
+
const F = [["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" }]], $ = R("outline", "dots-vertical", "DotsVertical", F), E = "_chartCard_84eo6_1", H = "_fixedContent_84eo6_6", O = "_loading_84eo6_13", P = "_hidden_84eo6_18", V = "_chartCardRightContent_84eo6_22", o = {
|
|
12
|
+
chartCard: E,
|
|
13
|
+
fixedContent: H,
|
|
14
|
+
loading: O,
|
|
15
|
+
hidden: P,
|
|
16
|
+
chartCardRightContent: V
|
|
17
|
+
}, z = "_loading_k5y8w_7", B = {
|
|
18
|
+
loading: z
|
|
19
|
+
}, y = () => /* @__PURE__ */ t.jsx(D, { className: B.loading }), K = "_list_mwshn_1", U = {
|
|
20
|
+
list: K
|
|
21
|
+
};
|
|
22
|
+
function q({ src: s, className: a, ...r }) {
|
|
23
|
+
const e = decodeURIComponent(s.replace(/^data:image\/svg\+xml,/, ""));
|
|
24
|
+
return /* @__PURE__ */ t.jsx("div", { className: a, ...r, dangerouslySetInnerHTML: { __html: e } });
|
|
25
|
+
}
|
|
26
|
+
const G = (s) => {
|
|
27
|
+
const a = j();
|
|
28
|
+
v(a);
|
|
29
|
+
const [r, e] = _.useState(!1), i = a.defaults.chartMenuOptions ?? [];
|
|
30
|
+
if (i.length === 0)
|
|
31
|
+
return null;
|
|
32
|
+
const d = (n) => {
|
|
33
|
+
setTimeout(() => {
|
|
34
|
+
Promise.resolve(n()).finally(() => e(!1));
|
|
35
|
+
}, 100);
|
|
36
|
+
}, c = (n) => {
|
|
37
|
+
if (e(!0), s.onCustomDownload) {
|
|
38
|
+
s.onCustomDownload((l) => d(() => n(l)));
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
d(() => n({ ...s, theme: a }));
|
|
42
|
+
};
|
|
43
|
+
return /* @__PURE__ */ t.jsx(
|
|
44
|
+
w,
|
|
45
|
+
{
|
|
46
|
+
side: "bottom",
|
|
47
|
+
align: "end",
|
|
48
|
+
triggerComponent: r ? /* @__PURE__ */ t.jsx(y, {}) : /* @__PURE__ */ t.jsx(k, { icon: $ }),
|
|
49
|
+
children: /* @__PURE__ */ t.jsx(I, { className: U.list, autoFocus: !0, children: i.map((n, l) => {
|
|
50
|
+
const h = C.t(n.labelKey);
|
|
51
|
+
return /* @__PURE__ */ t.jsx(
|
|
52
|
+
S,
|
|
53
|
+
{
|
|
54
|
+
label: h,
|
|
55
|
+
onClick: () => c(n.onClick),
|
|
56
|
+
startIcon: n.iconSrc ? /* @__PURE__ */ t.jsx(q, { src: n.iconSrc }) : void 0
|
|
57
|
+
},
|
|
58
|
+
l
|
|
59
|
+
);
|
|
60
|
+
}) })
|
|
61
|
+
}
|
|
62
|
+
);
|
|
63
|
+
}, J = _.forwardRef(
|
|
64
|
+
({ title: s, subtitle: a, children: r, data: e, errorMessage: i, dimensionsAndMeasures: d = [], ...c }, n) => {
|
|
65
|
+
var g;
|
|
66
|
+
const l = j();
|
|
67
|
+
v(l);
|
|
68
|
+
const h = T(null), u = !!(e != null && e.data && ((g = e.data) == null ? void 0 : g.length) > 0), m = !e || (e == null ? void 0 : e.isLoading), p = () => m && !u ? /* @__PURE__ */ t.jsx(b, {}) : i ? /* @__PURE__ */ t.jsx(
|
|
69
|
+
f,
|
|
70
|
+
{
|
|
71
|
+
variant: "error",
|
|
72
|
+
icon: A,
|
|
73
|
+
title: C.t("charts.errorTitle"),
|
|
74
|
+
message: i
|
|
75
|
+
}
|
|
76
|
+
) : u ? r : /* @__PURE__ */ t.jsx(
|
|
77
|
+
f,
|
|
78
|
+
{
|
|
79
|
+
title: C.t("charts.emptyTitle"),
|
|
80
|
+
message: C.t("charts.emptyMessage")
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
return /* @__PURE__ */ t.jsxs(L, { className: o.chartCard, ...c, children: [
|
|
84
|
+
/* @__PURE__ */ t.jsx(
|
|
85
|
+
N,
|
|
86
|
+
{
|
|
87
|
+
title: s,
|
|
88
|
+
subtitle: a,
|
|
89
|
+
rightContent: /* @__PURE__ */ t.jsxs("div", { className: o.chartCardRightContent, children: [
|
|
90
|
+
/* @__PURE__ */ t.jsx(
|
|
91
|
+
"div",
|
|
92
|
+
{
|
|
93
|
+
className: x(o.fixedContent, m ? o.loading : o.hidden),
|
|
94
|
+
children: /* @__PURE__ */ t.jsx(y, {})
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ t.jsx(
|
|
98
|
+
"div",
|
|
99
|
+
{
|
|
100
|
+
className: x(o.fixedContent, m ? o.hidden : o.visible),
|
|
101
|
+
children: /* @__PURE__ */ t.jsx(
|
|
102
|
+
G,
|
|
103
|
+
{
|
|
104
|
+
title: s,
|
|
105
|
+
containerRef: h,
|
|
106
|
+
data: e == null ? void 0 : e.data,
|
|
107
|
+
dimensionsAndMeasures: d,
|
|
108
|
+
onCustomDownload: c.onCustomDownload
|
|
109
|
+
}
|
|
110
|
+
)
|
|
111
|
+
}
|
|
112
|
+
)
|
|
113
|
+
] })
|
|
114
|
+
}
|
|
115
|
+
),
|
|
116
|
+
/* @__PURE__ */ t.jsx(M, { ref: c.onCustomDownload ? n : h, children: p() })
|
|
117
|
+
] });
|
|
118
|
+
}
|
|
119
|
+
);
|
|
120
|
+
J.displayName = "ChartCard";
|
|
121
|
+
export {
|
|
122
|
+
J as C
|
|
123
|
+
};
|
|
124
|
+
//# sourceMappingURL=ChartCard-CsKQOusx.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartCard-CsKQOusx.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.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\": \"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 isLoading?: boolean;\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 = [], ...props },\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} {...props}>\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={props.onCustomDownload}\n />\n </div>\n </div>\n }\n />\n\n <CardContent ref={props.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","ref","chartRef","useRef","hasData","_a","getDisplay","Skeleton","CardFeedback","IconAlertCircle","Card","CardHeader","jsxs","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,CAAY,IAAIC,EAAM,SAAS,EAAK,GAEhDC,IAAUN,EAAM,SAAS,oBAAoB,CAAA;AAEnD,MAAIM,EAAQ,WAAW;AACrB,WAAO;AAGT,QAAMC,IAA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AA,EAAAA;AAAAA,kBAACQ;AAAA,kBAAA;AAAA,oBACC,OAAAsB;AAAA,oBACA,cAAcO;AAAA,oBACd,MAAMJ,KAAA,gBAAAA,EAAM;AAAA,oBACZ,uBAAAE;AAAA,oBACA,kBAAkB1B,EAAM;AAAA,kBAAA;AAAA,gBAAA;AAAA,cAC1B;AAAA,YAAA;AAAA,UACF,EAAA,CACF;AAAA,QAAA;AAAA,MAAA;AAAA,MAIJT,gBAAAA,MAACiD,KAAY,KAAKxC,EAAM,mBAAmB2B,IAAMC,GAAW,cAAW,CAAE;AAAA,IAAA,GAC3E;AAAA,EAEJ;AACF;AAEAR,EAAU,cAAc;","x_google_ignoreList":[0]}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { d as e } from "./index-
|
|
1
|
+
import { d as e } from "./index-DedIqjbn.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-9H0O-uuD.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Color.type.emb-
|
|
1
|
+
{"version":3,"file":"Color.type.emb-9H0O-uuD.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,44 +1,38 @@
|
|
|
1
1
|
import { defineEditor as l } from "@embeddable.com/react";
|
|
2
|
-
import { C as a } from "./Color.type.emb-
|
|
3
|
-
import {
|
|
2
|
+
import { C as a } from "./Color.type.emb-9H0O-uuD.js";
|
|
3
|
+
import { j as n, A as i, I as p, V as u } from "./index-DedIqjbn.js";
|
|
4
4
|
import { useState as m, useEffect as C } from "react";
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
*/
|
|
11
|
-
const d = [["path", { d: "M18 6l-12 12", key: "svg-0" }], ["path", { d: "M6 6l12 12", key: "svg-1" }]], I = i("outline", "x", "X", d), f = "_colorInputContainer_1o1qe_1", _ = "_colorInput_1o1qe_1", s = {
|
|
12
|
-
colorInputContainer: f,
|
|
13
|
-
colorInput: _
|
|
14
|
-
}, x = ({ value: o, onChange: t }) => {
|
|
15
|
-
const [n, e] = m(o);
|
|
5
|
+
const I = "_colorInputContainer_1o1qe_1", d = "_colorInput_1o1qe_1", s = {
|
|
6
|
+
colorInputContainer: I,
|
|
7
|
+
colorInput: d
|
|
8
|
+
}, f = ({ value: o, onChange: t }) => {
|
|
9
|
+
const [r, e] = m(o);
|
|
16
10
|
return C(() => {
|
|
17
11
|
e(o);
|
|
18
|
-
}, [o, e]), /* @__PURE__ */
|
|
19
|
-
/* @__PURE__ */
|
|
12
|
+
}, [o, e]), /* @__PURE__ */ n.jsxs("div", { className: s.colorInputContainer, children: [
|
|
13
|
+
/* @__PURE__ */ n.jsx(
|
|
20
14
|
"input",
|
|
21
15
|
{
|
|
22
16
|
type: "color",
|
|
23
17
|
className: s.colorInput,
|
|
24
|
-
value:
|
|
18
|
+
value: r ?? "#FFFFFF",
|
|
25
19
|
onChange: (c) => t(c.target.value)
|
|
26
20
|
}
|
|
27
21
|
),
|
|
28
|
-
|
|
22
|
+
r && /* @__PURE__ */ n.jsx(i, { icon: p, onClick: () => t(void 0) })
|
|
29
23
|
] });
|
|
30
|
-
},
|
|
24
|
+
}, _ = {
|
|
31
25
|
name: "ColorEditor",
|
|
32
26
|
label: "Color Editor",
|
|
33
27
|
type: a
|
|
34
|
-
},
|
|
28
|
+
}, y = l(f, _, {
|
|
35
29
|
inputs: (o, t) => ({
|
|
36
30
|
value: o,
|
|
37
|
-
onChange: (
|
|
31
|
+
onChange: (r) => t(u.of(r))
|
|
38
32
|
})
|
|
39
33
|
});
|
|
40
34
|
export {
|
|
41
|
-
|
|
42
|
-
|
|
35
|
+
y as default,
|
|
36
|
+
_ as meta
|
|
43
37
|
};
|
|
44
38
|
//# sourceMappingURL=ColorEditor.js.map
|
package/dist/ColorEditor.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ColorEditor.js","sources":["../
|
|
1
|
+
{"version":3,"file":"ColorEditor.js","sources":["../src/editors/ColorEditor/index.tsx","../src/editors/ColorEditor/ColorEditor.emb.ts"],"sourcesContent":["import { useState, useEffect, FC } from 'react';\nimport styles from './ColorEditor.module.css';\nimport { ActionIcon } from '@embeddable.com/remarkable-ui';\nimport { IconX } from '@tabler/icons-react';\n\ntype ColorInputProps = {\n value: string;\n onChange: (color?: string) => void;\n};\n\nconst ColorInput: FC<ColorInputProps> = ({ value, onChange }) => {\n const [color, setColor] = useState<string>(value);\n\n useEffect(() => {\n setColor(value);\n }, [value, setColor]);\n\n return (\n <div className={styles.colorInputContainer}>\n <input\n type=\"color\"\n className={styles.colorInput}\n value={color ?? '#FFFFFF'}\n onChange={(e) => onChange(e.target.value)}\n />\n {color && <ActionIcon icon={IconX} onClick={() => onChange(undefined)} />}\n </div>\n );\n};\n\nexport default ColorInput;\n","import { defineEditor } from '@embeddable.com/react';\nimport ColorType from './Color.type.emb';\nimport { Value } from '@embeddable.com/core';\n\nimport Component from './index';\n\nexport const meta = {\n name: 'ColorEditor',\n label: 'Color Editor',\n type: ColorType,\n};\n\n/* @ts-expect-error - to be fixed in @embeddable.com/react */\nexport default defineEditor(Component, meta, {\n inputs: (value, setter) => {\n return {\n value,\n onChange: (val: string) => setter(Value.of(val)),\n };\n },\n});\n"],"names":["ColorInput","value","onChange","color","setColor","useState","useEffect","jsxs","styles","jsx","e","ActionIcon","IconX","meta","ColorType","ColorEditor_emb","defineEditor","Component","setter","val","Value"],"mappings":";;;;;;;GAUMA,IAAkC,CAAC,EAAE,OAAAC,GAAO,UAAAC,QAAe;AAC/D,QAAM,CAACC,GAAOC,CAAQ,IAAIC,EAAiBJ,CAAK;AAEhD,SAAAK,EAAU,MAAM;AACd,IAAAF,EAASH,CAAK;AAAA,EAChB,GAAG,CAACA,GAAOG,CAAQ,CAAC,GAGlBG,gBAAAA,EAAAA,KAAC,OAAA,EAAI,WAAWC,EAAO,qBACrB,UAAA;AAAA,IAAAC,gBAAAA,EAAAA;AAAAA,MAAC;AAAA,MAAA;AAAA,QACC,MAAK;AAAA,QACL,WAAWD,EAAO;AAAA,QAClB,OAAOL,KAAS;AAAA,QAChB,UAAU,CAACO,MAAMR,EAASQ,EAAE,OAAO,KAAK;AAAA,MAAA;AAAA,IAAA;AAAA,IAEzCP,2BAAUQ,GAAA,EAAW,MAAMC,GAAO,SAAS,MAAMV,EAAS,MAAS,EAAA,CAAG;AAAA,EAAA,GACzE;AAEJ,GCtBaW,IAAO;AAAA,EAClB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,MAAMC;AACR,GAGAC,IAAeC,EAAaC,GAAWJ,GAAM;AAAA,EAC3C,QAAQ,CAACZ,GAAOiB,OACP;AAAA,IACL,OAAAjB;AAAA,IACA,UAAU,CAACkB,MAAgBD,EAAOE,EAAM,GAAGD,CAAG,CAAC;AAAA,EAAA;AAGrD,CAAC;"}
|
package/dist/{ComparisonPeriod.type.emb-BhZKPqEG.js → ComparisonPeriod.type.emb-C3XjaFoD.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-DedIqjbn.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-C3XjaFoD.js.map
|