@embeddable.com/remarkable-ui 0.1.12 → 0.1.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/{BaseButton-8lCm-nHV.js → BaseButton-BbhHQD9t.js} +2 -2
- package/dist/{BaseButton-8lCm-nHV.js.map → BaseButton-BbhHQD9t.js.map} +1 -1
- package/dist/ChartCard-11lQWjXq.js +106 -0
- package/dist/ChartCard-11lQWjXq.js.map +1 -0
- package/dist/ComparisonPeriod.type.emb-D51Sg3wt.js +15 -0
- package/dist/ComparisonPeriod.type.emb-D51Sg3wt.js.map +1 -0
- package/dist/ComparisonPeriodSelectFieldPro.js +45 -53
- package/dist/ComparisonPeriodSelectFieldPro.js.map +1 -1
- package/dist/DateRangeSelectFieldPro.js +3 -3
- package/dist/DonutChartPro.js +2 -2
- package/dist/DonutLabelChartPro.js +2 -2
- package/dist/{EditorCard-_U0it3Eb.js → EditorCard-BriyqUva.js} +17 -17
- package/dist/{EditorCard-_U0it3Eb.js.map → EditorCard-BriyqUva.js.map} +1 -1
- package/dist/KpiChart-BLMULQMh.js +77 -0
- package/dist/KpiChart-BLMULQMh.js.map +1 -0
- package/dist/KpiChartNumberComparisonPro.js +156 -0
- package/dist/KpiChartNumberComparisonPro.js.map +1 -0
- package/dist/KpiChartNumberPro.js +47 -0
- package/dist/KpiChartNumberPro.js.map +1 -0
- package/dist/MultiSelectFieldPro.js +2 -3
- package/dist/MultiSelectFieldPro.js.map +1 -1
- package/dist/PieChartPro.js +2 -2
- package/dist/{SingleSelectField-Coqlrz4l.js → SingleSelectField-D1E9OJxC.js} +3 -3
- package/dist/{SingleSelectField-Coqlrz4l.js.map → SingleSelectField-D1E9OJxC.js.map} +1 -1
- package/dist/SingleSelectFieldPro.js +2 -2
- package/dist/{charts.fillGaps.hooks-dHYClR1D.js → charts.fillGaps.hooks-lZwsRfDF.js} +4 -4
- package/dist/{charts.fillGaps.hooks-dHYClR1D.js.map → charts.fillGaps.hooks-lZwsRfDF.js.map} +1 -1
- package/dist/{component.constants-6skM25Z_.js → component.constants-DIhZCTG3.js} +120 -84
- package/dist/component.constants-DIhZCTG3.js.map +1 -0
- package/dist/{editors.timeRange.utils-Dv6T01Ys.js → date.utils-CNVHSCO8.js} +18 -31
- package/dist/date.utils-CNVHSCO8.js.map +1 -0
- package/dist/editors.timeRange.utils-CG333N7U.js +18 -0
- package/dist/editors.timeRange.utils-CG333N7U.js.map +1 -0
- package/dist/embeddable-components.json +7 -5
- package/dist/embeddable-theme-2b917.js +974 -966
- package/dist/{formatter.utils-DMMBiLDD.js → formatter.utils-CuZlh4EL.js} +2 -2
- package/dist/{formatter.utils-DMMBiLDD.js.map → formatter.utils-CuZlh4EL.js.map} +1 -1
- package/dist/{index-rQcWoTcg.js → index-B7KNswsW.js} +8 -8
- package/dist/{index-rQcWoTcg.js.map → index-B7KNswsW.js.map} +1 -1
- package/dist/{index-j6OFGLY6.js → index-B_4rK6tI.js} +12 -11
- package/dist/{index-j6OFGLY6.js.map → index-B_4rK6tI.js.map} +1 -1
- package/dist/{index-DUWz6JXu.js → index-Bgj2EBb8.js} +10 -10
- package/dist/{index-DUWz6JXu.js.map → index-Bgj2EBb8.js.map} +1 -1
- package/dist/{index-B3vcfrrk.js → index-C-zjH8iP.js} +5 -5
- package/dist/{index-B3vcfrrk.js.map → index-C-zjH8iP.js.map} +1 -1
- package/dist/{index-Btli_FdH.js → index-C8pGCEGw.js} +5 -5
- package/dist/{index-Btli_FdH.js.map → index-C8pGCEGw.js.map} +1 -1
- package/dist/{index-B9XcOUp_.js → index-DqKfDjMs.js} +25 -25
- package/dist/{index-B9XcOUp_.js.map → index-DqKfDjMs.js.map} +1 -1
- package/dist/index.js +190 -247
- package/dist/index.js.map +1 -1
- package/dist/{object.utils-B52mECQg.js → object.utils-CMJleY-P.js} +2511 -2604
- package/dist/object.utils-CMJleY-P.js.map +1 -0
- package/dist/{pies.utils-BpooJ8CU.js → pies.utils-DluC4GlY.js} +4 -4
- package/dist/{pies.utils-BpooJ8CU.js.map → pies.utils-DluC4GlY.js.map} +1 -1
- package/dist/remarkable-pro/components/charts/kpis/KpiChartNumberComparisonPro/index.d.ts +19 -0
- package/dist/remarkable-pro/components/charts/kpis/KpiChartNumberComparisonPro/index.d.ts.map +1 -0
- package/dist/remarkable-pro/components/charts/kpis/KpiChartNumberPro/index.d.ts +11 -0
- package/dist/remarkable-pro/components/charts/kpis/KpiChartNumberPro/index.d.ts.map +1 -0
- package/dist/remarkable-pro/components/component.constants.d.ts +35 -0
- package/dist/remarkable-pro/components/component.constants.d.ts.map +1 -1
- package/dist/remarkable-pro/components/utils/timeRange.utils.d.ts +5 -0
- package/dist/remarkable-pro/components/utils/timeRange.utils.d.ts.map +1 -0
- package/dist/remarkable-pro/theme/defaults/defaults.ComparisonPeriods.constants.d.ts +9 -0
- package/dist/remarkable-pro/theme/defaults/defaults.ComparisonPeriods.constants.d.ts.map +1 -0
- package/dist/remarkable-pro/theme/defaults/defaults.DateRanges.constants.d.ts +9 -0
- package/dist/remarkable-pro/theme/defaults/defaults.DateRanges.constants.d.ts.map +1 -0
- package/dist/remarkable-pro/theme/i18n/translations/de.d.ts.map +1 -1
- package/dist/remarkable-pro/theme/i18n/translations/en.d.ts.map +1 -1
- package/dist/remarkable-pro/theme/theme.constants.d.ts.map +1 -1
- package/dist/remarkable-pro/theme/theme.types.d.ts +7 -0
- package/dist/remarkable-pro/theme/theme.types.d.ts.map +1 -1
- package/dist/remarkable-ui/charts/kpis/KpiChart.d.ts.map +1 -1
- package/dist/remarkable-ui/charts/kpis/KpiChart.stories.d.ts +7 -0
- package/dist/remarkable-ui/charts/kpis/KpiChart.stories.d.ts.map +1 -1
- package/dist/remarkable-ui/charts/kpis/KpiChart.types.d.ts +4 -0
- package/dist/remarkable-ui/charts/kpis/KpiChart.types.d.ts.map +1 -1
- package/dist/remarkable-ui/charts/kpis/components/KpiChartChange.d.ts.map +1 -1
- package/dist/remarkable-ui/shared/Typography/Typography.d.ts +2 -1
- package/dist/remarkable-ui/shared/Typography/Typography.d.ts.map +1 -1
- package/dist/remarkable-ui/types/css.types.d.ts +2 -0
- package/dist/remarkable-ui/types/css.types.d.ts.map +1 -0
- package/dist/remarkable-ui.css +1 -1
- package/package.json +1 -1
- package/dist/component.constants-6skM25Z_.js.map +0 -1
- package/dist/editors.timeRange.utils-Dv6T01Ys.js.map +0 -1
- package/dist/object.utils-B52mECQg.js.map +0 -1
- package/dist/remarkable-pro/components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.constants.d.ts +0 -3
- package/dist/remarkable-pro/components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.constants.d.ts.map +0 -1
- package/dist/remarkable-pro/components/editors/DateRangeSelectFieldPro/DateRangeSelectFieldPro.constants.d.ts +0 -3
- package/dist/remarkable-pro/components/editors/DateRangeSelectFieldPro/DateRangeSelectFieldPro.constants.d.ts.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as L, r as w, m as M, j as n, d as V, a as y, b as z, t as P, c as k, s as v, e as H, f as R, g as j, x as I, y as S, h as T, k as F, l as W, n as Y, V as E, o as G } from "./component.constants-
|
|
1
|
+
import { i as L, r as w, m as M, j as n, d as V, a as y, b as z, t as P, c as k, s as v, e as H, f as R, g as j, x as I, y as S, h as T, k as F, l as W, n as Y, V as E, o as G } from "./component.constants-DIhZCTG3.js";
|
|
2
2
|
import { useTheme as O, defineComponent as _ } from "@embeddable.com/react";
|
|
3
|
-
import { C as q } from "./
|
|
4
|
-
import { u as J, g as K, a as N, B as Q } from "./charts.fillGaps.hooks-
|
|
3
|
+
import { C as q } from "./ChartCard-11lQWjXq.js";
|
|
4
|
+
import { u as J, g as K, a as N, B as Q } from "./charts.fillGaps.hooks-lZwsRfDF.js";
|
|
5
5
|
const U = (a) => {
|
|
6
6
|
var o, i;
|
|
7
7
|
const e = O();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as L, r as y, m as w, j as n, d as M, a as V, b as P, t as v, c as k, s as R, e as j, f as I, g as S, x as T, y as F, p as W, q as X, u as q, v as z, V as E, o as G } from "./component.constants-
|
|
1
|
+
import { i as L, r as y, m as w, j as n, d as M, a as V, b as P, t as v, c as k, s as R, e as j, f as I, g as S, x as T, y as F, p as W, q as X, u as q, v as z, V as E, o as G } from "./component.constants-DIhZCTG3.js";
|
|
2
2
|
import { useTheme as O, defineComponent as _ } from "@embeddable.com/react";
|
|
3
|
-
import { C as H } from "./
|
|
4
|
-
import { u as J, g as K, a as N, B as Q } from "./charts.fillGaps.hooks-
|
|
3
|
+
import { C as H } from "./ChartCard-11lQWjXq.js";
|
|
4
|
+
import { u as J, g as K, a as N, B as Q } from "./charts.fillGaps.hooks-lZwsRfDF.js";
|
|
5
5
|
const U = (a) => {
|
|
6
6
|
var i, o;
|
|
7
7
|
const s = O();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as f, r as w, m as k, j as l, d as z, w as G, b as P, z as M, t as H, c as R, s as j, e as v, f as S, g as T, x as F, y as Y, h as W, k as E, l as I, V as u, o as O } from "./component.constants-
|
|
1
|
+
import { i as f, r as w, m as k, j as l, d as z, w as G, b as P, z as M, t as H, c as R, s as j, e as v, f as S, g as T, x as F, y as Y, h as W, k as E, l as I, V as u, o as O } from "./component.constants-DIhZCTG3.js";
|
|
2
2
|
import { useTheme as _, defineComponent as q } from "@embeddable.com/react";
|
|
3
|
-
import { C as J } from "./
|
|
4
|
-
import { u as K, b as N, a as Q, B as U } from "./charts.fillGaps.hooks-
|
|
3
|
+
import { C as J } from "./ChartCard-11lQWjXq.js";
|
|
4
|
+
import { u as K, b as N, a as Q, B as U } from "./charts.fillGaps.hooks-lZwsRfDF.js";
|
|
5
5
|
const X = (a) => {
|
|
6
6
|
var t, n;
|
|
7
7
|
const e = _();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as L, r as w, m as G, j as l, d as k, w as P, b as M, z as R, t as j, c as v, s as S, e as T, f as F, g as X, x as z, y as W, p as q, q as E, u as I, V as u, o as O } from "./component.constants-
|
|
1
|
+
import { i as L, r as w, m as G, j as l, d as k, w as P, b as M, z as R, t as j, c as v, s as S, e as T, f as F, g as X, x as z, y as W, p as q, q as E, u as I, V as u, o as O } from "./component.constants-DIhZCTG3.js";
|
|
2
2
|
import { useTheme as _, defineComponent as H } from "@embeddable.com/react";
|
|
3
|
-
import { C as J } from "./
|
|
4
|
-
import { u as K, b as N, a as Q, B as U } from "./charts.fillGaps.hooks-
|
|
3
|
+
import { C as J } from "./ChartCard-11lQWjXq.js";
|
|
4
|
+
import { u as K, b as N, a as Q, B as U } from "./charts.fillGaps.hooks-lZwsRfDF.js";
|
|
5
5
|
const Y = (e) => {
|
|
6
6
|
var t, n;
|
|
7
7
|
const a = _();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as L, r as w, m as f, j as l, d as S, w as z, b as P, z as M, t as H, c as R, s as T, e as j, f as v, g as F, x as G, y as Y, h as W, k as E, l as I, A as O, V as m, o as _ } from "./component.constants-
|
|
1
|
+
import { i as L, r as w, m as f, j as l, d as S, w as z, b as P, z as M, t as H, c as R, s as T, e as j, f as v, g as F, x as G, y as Y, h as W, k as E, l as I, A as O, V as m, o as _ } from "./component.constants-DIhZCTG3.js";
|
|
2
2
|
import { useTheme as q, defineComponent as J } from "@embeddable.com/react";
|
|
3
|
-
import { C as K } from "./
|
|
4
|
-
import { u as N, b as Q, a as U, B as X } from "./charts.fillGaps.hooks-
|
|
3
|
+
import { C as K } from "./ChartCard-11lQWjXq.js";
|
|
4
|
+
import { u as N, b as Q, a as U, B as X } from "./charts.fillGaps.hooks-lZwsRfDF.js";
|
|
5
5
|
const Z = (a) => {
|
|
6
6
|
var i, n;
|
|
7
7
|
const e = q();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { i as L, r as f, m as w, j as l, d as S, w as P, b as M, z as R, t as T, c as j, s as v, e as F, f as G, g as X, x as z, y as W, p as q, q as E, u as I, A as O, V as m, o as _ } from "./component.constants-
|
|
1
|
+
import { i as L, r as f, m as w, j as l, d as S, w as P, b as M, z as R, t as T, c as j, s as v, e as F, f as G, g as X, x as z, y as W, p as q, q as E, u as I, A as O, V as m, o as _ } from "./component.constants-DIhZCTG3.js";
|
|
2
2
|
import { useTheme as H, defineComponent as J } from "@embeddable.com/react";
|
|
3
|
-
import { C as K } from "./
|
|
4
|
-
import { u as N, b as Q, a as U, B as Y } from "./charts.fillGaps.hooks-
|
|
3
|
+
import { C as K } from "./ChartCard-11lQWjXq.js";
|
|
4
|
+
import { u as N, b as Q, a as U, B as Y } from "./charts.fillGaps.hooks-lZwsRfDF.js";
|
|
5
5
|
const Z = (a) => {
|
|
6
6
|
var o, n;
|
|
7
7
|
const e = H();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { j as c,
|
|
1
|
+
import { j as c, a1 as e } from "./component.constants-DIhZCTG3.js";
|
|
2
2
|
const i = "_baseButton_1tlim_1", m = "_primary_1tlim_15", _ = "_secondary_1tlim_35", u = "_icon_1tlim_56", t = {
|
|
3
3
|
baseButton: i,
|
|
4
4
|
primary: m,
|
|
@@ -21,4 +21,4 @@ const i = "_baseButton_1tlim_1", m = "_primary_1tlim_15", _ = "_secondary_1tlim_
|
|
|
21
21
|
export {
|
|
22
22
|
l as B
|
|
23
23
|
};
|
|
24
|
-
//# sourceMappingURL=BaseButton-
|
|
24
|
+
//# sourceMappingURL=BaseButton-BbhHQD9t.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"BaseButton-
|
|
1
|
+
{"version":3,"file":"BaseButton-BbhHQD9t.js","sources":["../src/remarkable-ui/shared/BaseButton/BaseButton.tsx"],"sourcesContent":["import clsx from 'clsx';\nimport React from 'react';\nimport styles from './BaseButton.module.css';\n\nexport type BaseButtonProps = {\n variant?: 'primary' | 'secondary';\n size?: 'small' | 'medium';\n ref?: React.Ref<HTMLButtonElement>;\n} & React.ButtonHTMLAttributes<HTMLButtonElement>;\n\nexport const BaseButton: React.FC<BaseButtonProps> = ({\n variant = 'primary',\n size = 'medium',\n className,\n children,\n ...props\n}) => {\n return (\n <button\n className={clsx(styles.baseButton, styles[variant], styles[size], className)}\n {...props}\n >\n {children}\n </button>\n );\n};\n"],"names":["BaseButton","variant","size","className","children","props","jsx","clsx","styles"],"mappings":";;;;;;GAUaA,IAAwC,CAAC;AAAA,EACpD,SAAAC,IAAU;AAAA,EACV,MAAAC,IAAO;AAAA,EACP,WAAAC;AAAA,EACA,UAAAC;AAAA,EACA,GAAGC;AACL,MAEIC,gBAAAA,EAAAA;AAAAA,EAAC;AAAA,EAAA;AAAA,IACC,WAAWC,EAAKC,EAAO,YAAYA,EAAOP,CAAO,GAAGO,EAAON,CAAI,GAAGC,CAAS;AAAA,IAC1E,GAAGE;AAAA,IAEH,UAAAD;AAAA,EAAA;AAAA;"}
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { Z as p, j as t, a1 as k, av as y, i as x, a8 as v, ab as N, R as d, a9 as B, a2 as I, a3 as L, a5 as S, a7 as C, aw as R } from "./component.constants-DIhZCTG3.js";
|
|
2
|
+
import D, { useRef as M } from "react";
|
|
3
|
+
import { useTheme as f } from "@embeddable.com/react";
|
|
4
|
+
import { B as $ } from "./BaseButton-BbhHQD9t.js";
|
|
5
|
+
/**
|
|
6
|
+
* @license @tabler/icons-react v3.34.1 - 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 b = [["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" }]], T = p("outline", "dots-vertical", "DotsVertical", b), w = "_skeleton_12e7h_10", z = {
|
|
12
|
+
skeleton: w
|
|
13
|
+
}, P = () => /* @__PURE__ */ t.jsx("div", { className: z.skeleton }), A = "_iconButton_134uf_1", E = "_icon_134uf_1", _ = {
|
|
14
|
+
iconButton: A,
|
|
15
|
+
icon: E
|
|
16
|
+
}, V = ({ icon: a, className: e, ...o }) => /* @__PURE__ */ t.jsx($, { variant: "secondary", className: k(_.iconButton, e), ...o, children: /* @__PURE__ */ t.jsx(a, { className: _.icon }) }), F = "_chartCard_zkf3k_1", H = "_error_zkf3k_6", K = "_rightContent_zkf3k_12", u = {
|
|
17
|
+
chartCard: F,
|
|
18
|
+
error: H,
|
|
19
|
+
rightContent: K
|
|
20
|
+
}, O = "_loading_7lgag_7", Z = {
|
|
21
|
+
loading: O
|
|
22
|
+
}, j = () => /* @__PURE__ */ t.jsx(y, { className: Z.loading }), q = "_list_mwshn_1", G = {
|
|
23
|
+
list: q
|
|
24
|
+
}, J = (a) => {
|
|
25
|
+
var l, r;
|
|
26
|
+
const e = f();
|
|
27
|
+
x(e);
|
|
28
|
+
const [o, n] = D.useState(!1), c = (s) => {
|
|
29
|
+
n(!0), setTimeout(() => {
|
|
30
|
+
Promise.resolve(s()).finally(() => n(!1));
|
|
31
|
+
}, 100);
|
|
32
|
+
}, h = (s) => {
|
|
33
|
+
c(() => s({ ...a, theme: e }));
|
|
34
|
+
}, i = ((r = (l = e.charts) == null ? void 0 : l.chartCardMenuPro) == null ? void 0 : r.options) ?? [];
|
|
35
|
+
return i.length === 0 ? null : /* @__PURE__ */ t.jsx(
|
|
36
|
+
v,
|
|
37
|
+
{
|
|
38
|
+
side: "bottom",
|
|
39
|
+
align: "end",
|
|
40
|
+
triggerComponent: o ? /* @__PURE__ */ t.jsx(j, {}) : /* @__PURE__ */ t.jsx(V, { icon: T }),
|
|
41
|
+
children: /* @__PURE__ */ t.jsx(N, { className: G.list, autoFocus: !0, children: i.map((s, m) => {
|
|
42
|
+
const g = d.t(s.labelKey);
|
|
43
|
+
return /* @__PURE__ */ t.jsx(
|
|
44
|
+
B,
|
|
45
|
+
{
|
|
46
|
+
label: g,
|
|
47
|
+
onClick: () => h(s.onClick),
|
|
48
|
+
startIcon: s.iconSrc ? /* @__PURE__ */ t.jsx("img", { src: s.iconSrc, alt: `${g} icon` }) : void 0
|
|
49
|
+
},
|
|
50
|
+
m
|
|
51
|
+
);
|
|
52
|
+
}) })
|
|
53
|
+
}
|
|
54
|
+
);
|
|
55
|
+
}, Y = ({
|
|
56
|
+
title: a,
|
|
57
|
+
subtitle: e,
|
|
58
|
+
children: o,
|
|
59
|
+
data: n,
|
|
60
|
+
errorMessage: c,
|
|
61
|
+
dimensionsAndMeasures: h = [],
|
|
62
|
+
...i
|
|
63
|
+
}) => {
|
|
64
|
+
const l = f();
|
|
65
|
+
x(l);
|
|
66
|
+
const r = M(null), s = n.data && n.data.length > 0, m = () => !s && n.isLoading ? /* @__PURE__ */ t.jsx(P, {}) : c ? /* @__PURE__ */ t.jsx(
|
|
67
|
+
C,
|
|
68
|
+
{
|
|
69
|
+
className: u.error,
|
|
70
|
+
icon: R,
|
|
71
|
+
title: d.t("charts.errorTitle"),
|
|
72
|
+
message: c
|
|
73
|
+
}
|
|
74
|
+
) : s ? o : /* @__PURE__ */ t.jsx(
|
|
75
|
+
C,
|
|
76
|
+
{
|
|
77
|
+
title: d.t("charts.emptyTitle"),
|
|
78
|
+
message: d.t("charts.emptyMessage")
|
|
79
|
+
}
|
|
80
|
+
);
|
|
81
|
+
return /* @__PURE__ */ t.jsxs(I, { ref: r, className: u.chartCard, ...i, children: [
|
|
82
|
+
/* @__PURE__ */ t.jsx(
|
|
83
|
+
L,
|
|
84
|
+
{
|
|
85
|
+
title: a,
|
|
86
|
+
subtitle: e,
|
|
87
|
+
rightContent: /* @__PURE__ */ t.jsx("div", { "data-no-export": !0, className: u.rightContent, children: n.isLoading ? /* @__PURE__ */ t.jsx(j, {}) : /* @__PURE__ */ t.jsx(
|
|
88
|
+
J,
|
|
89
|
+
{
|
|
90
|
+
title: a,
|
|
91
|
+
containerRef: r,
|
|
92
|
+
data: n.data,
|
|
93
|
+
dimensionsAndMeasures: h
|
|
94
|
+
}
|
|
95
|
+
) })
|
|
96
|
+
}
|
|
97
|
+
),
|
|
98
|
+
/* @__PURE__ */ t.jsx(S, { children: m() })
|
|
99
|
+
] });
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
Y as C,
|
|
103
|
+
V as I,
|
|
104
|
+
P as S
|
|
105
|
+
};
|
|
106
|
+
//# sourceMappingURL=ChartCard-11lQWjXq.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ChartCard-11lQWjXq.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconDotsVertical.mjs","../src/remarkable-ui/shared/Skeleton/Skeleton.tsx","../src/remarkable-ui/shared/IconButton/IconButton.tsx","../src/remarkable-pro/components/charts/shared/ChartCard/ChartCardLoading/ChartCardLoading.tsx","../src/remarkable-pro/components/charts/shared/ChartCard/ChartCardMenuPro/ChartCardMenuPro.tsx","../src/remarkable-pro/components/charts/shared/ChartCard/ChartCard.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.34.1 - 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 styles from './Skeleton.module.css';\n\nexport const Skeleton = () => {\n return <div className={styles.skeleton} />;\n};\n","import clsx from 'clsx';\nimport React from 'react';\nimport styles from './IconButton.module.css';\nimport { TablerIcon } from '@tabler/icons-react';\nimport { BaseButton, type BaseButtonProps } from '../BaseButton';\n\ntype IconButtonProps = Omit<BaseButtonProps, 'variant'> & {\n className?: string;\n icon: TablerIcon;\n};\n\nexport const IconButton: React.FC<IconButtonProps> = ({ icon: Icon, className, ...props }) => {\n return (\n <BaseButton variant=\"secondary\" className={clsx(styles.iconButton, className)} {...props}>\n <Icon className={styles.icon} />\n </BaseButton>\n );\n};\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 IconButton,\n SelectList,\n SelectListOption,\n} from '../../../../../../remarkable-ui';\nimport { ChartCardMenuProOptionOnClickProps } from './ChartCardMenuPro.types';\nimport styles from './ChartCardMenuPro.module.css';\n\ntype ChartCardMenuProProps = Omit<ChartCardMenuProOptionOnClickProps, '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 startAction = (onClick: () => void | Promise<void>) => {\n setIsLoading(true);\n setTimeout(() => {\n Promise.resolve(onClick()).finally(() => setIsLoading(false));\n }, 100);\n };\n\n const handleExport = (onClick: (props: ChartCardMenuProOptionOnClickProps) => void) => {\n startAction(() => onClick({ ...props, theme }));\n };\n\n const options = theme.charts?.chartCardMenuPro?.options ?? [];\n\n if (options.length === 0) {\n return null;\n }\n\n return (\n <Dropdown\n side=\"bottom\"\n align=\"end\"\n triggerComponent={isLoading ? <ChartCardLoading /> : <IconButton icon={IconDotsVertical} />}\n >\n <SelectList 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={\n option.iconSrc ? <img src={option.iconSrc} alt={`${label} icon`} /> : undefined\n }\n />\n );\n })}\n </SelectList>\n </Dropdown>\n );\n};\n","import React, { CSSProperties, FC, useRef } from 'react';\nimport { IconAlertCircle } from '@tabler/icons-react';\nimport {\n Card,\n CardContent,\n CardContentInfo,\n CardHeader,\n Skeleton,\n} from '../../../../../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';\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};\n\nexport const ChartCard: FC<ChartCardProps> = ({\n title,\n subtitle,\n children,\n data,\n errorMessage,\n dimensionsAndMeasures = [],\n ...props\n}) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const chartRef = useRef<HTMLDivElement>(null);\n\n const hasData = data.data && data.data.length > 0;\n\n const getDisplay = () => {\n if (!hasData && data.isLoading) {\n return <Skeleton />;\n }\n\n if (errorMessage) {\n return (\n <CardContentInfo\n className={styles.error}\n icon={IconAlertCircle}\n title={i18n.t('charts.errorTitle')}\n message={errorMessage}\n />\n );\n }\n\n if (!hasData) {\n return (\n <CardContentInfo\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 ref={chartRef} className={styles.chartCard} {...props}>\n <CardHeader\n title={title}\n subtitle={subtitle}\n rightContent={\n <div data-no-export className={styles.rightContent}>\n {data.isLoading ? (\n <ChartCardLoading />\n ) : (\n <ChartCardMenuPro\n title={title}\n containerRef={chartRef}\n data={data.data}\n dimensionsAndMeasures={dimensionsAndMeasures}\n />\n )}\n </div>\n }\n />\n\n <CardContent>{getDisplay()}</CardContent>\n </Card>\n );\n};\n"],"names":["__iconNode","IconDotsVertical","createReactComponent","Skeleton","jsx","styles","IconButton","Icon","className","props","BaseButton","clsx","ChartCardLoading","IconLoader2","ChartCardMenuPro","theme","useTheme","i18nSetup","isLoading","setIsLoading","React","startAction","onClick","handleExport","options","_b","_a","Dropdown","SelectList","option","index","label","i18n","SelectListOption","ChartCard","title","subtitle","children","data","errorMessage","dimensionsAndMeasures","chartRef","useRef","hasData","getDisplay","CardContentInfo","IconAlertCircle","jsxs","Card","CardHeader","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;;GCRvFG,IAAW,MACfC,gBAAAA,EAAAA,IAAC,OAAA,EAAI,WAAWC,EAAO,SAAA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A,UAAAC;AAAA,QACA,cACEhC,gBAAAA,EAAAA,IAAC,OAAA,EAAI,kBAAc,IAAC,WAAWC,EAAO,cACnC,UAAAiC,EAAK,YACJlC,gBAAAA,EAAAA,IAACQ,GAAA,CAAA,CAAiB,IAElBR,gBAAAA,EAAAA;AAAAA,UAACU;AAAA,UAAA;AAAA,YACC,OAAAqB;AAAA,YACA,cAAcM;AAAA,YACd,MAAMH,EAAK;AAAA,YACX,uBAAAE;AAAA,UAAA;AAAA,QAAA,EACF,CAEJ;AAAA,MAAA;AAAA,IAAA;AAAA,IAIJpC,gBAAAA,EAAAA,IAAC8C,GAAA,EAAa,UAAAN,EAAA,EAAW,CAAE;AAAA,EAAA,GAC7B;AAEJ;","x_google_ignoreList":[0]}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { $ as i, a0 as e } from "./component.constants-DIhZCTG3.js";
|
|
2
|
+
const o = i("comparisonPeriod", {
|
|
3
|
+
label: "Comparison Period",
|
|
4
|
+
optionLabel: (r) => r
|
|
5
|
+
});
|
|
6
|
+
e(o, "summer");
|
|
7
|
+
e(o, "Previous period");
|
|
8
|
+
e(o, "Previous week");
|
|
9
|
+
e(o, "Previous month");
|
|
10
|
+
e(o, "Previous quarter");
|
|
11
|
+
e(o, "Previous year");
|
|
12
|
+
export {
|
|
13
|
+
o as C
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=ComparisonPeriod.type.emb-D51Sg3wt.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ComparisonPeriod.type.emb-D51Sg3wt.js","sources":["../src/remarkable-pro/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, 'summer');\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,QAAQ;AAC3CG,EAAaH,GAAsB,iBAAiB;AACpDG,EAAaH,GAAsB,eAAe;AAClDG,EAAaH,GAAsB,gBAAgB;AACnDG,EAAaH,GAAsB,kBAAkB;AACrDG,EAAaH,GAAsB,eAAe;"}
|
|
@@ -1,68 +1,60 @@
|
|
|
1
|
-
import { useTheme as
|
|
2
|
-
import {
|
|
3
|
-
import { useMemo as M, useEffect as
|
|
4
|
-
import { S as
|
|
5
|
-
import {
|
|
6
|
-
import { E } from "./EditorCard-
|
|
1
|
+
import { useTheme as v, defineComponent as h } from "@embeddable.com/react";
|
|
2
|
+
import { Z as P, S as y, i as f, r as b, j as l, R as C, t as S, c as F, _ as R, V as m } from "./component.constants-DIhZCTG3.js";
|
|
3
|
+
import { useMemo as M, useEffect as k } from "react";
|
|
4
|
+
import { S as D } from "./SingleSelectField-D1E9OJxC.js";
|
|
5
|
+
import { u as T } from "./date.utils-CNVHSCO8.js";
|
|
6
|
+
import { E as j } from "./EditorCard-BriyqUva.js";
|
|
7
|
+
import { g as x, a as L } from "./editors.timeRange.utils-CG333N7U.js";
|
|
8
|
+
import { C as s } from "./ComparisonPeriod.type.emb-D51Sg3wt.js";
|
|
7
9
|
/**
|
|
8
10
|
* @license @tabler/icons-react v3.34.1 - MIT
|
|
9
11
|
*
|
|
10
12
|
* This source code is licensed under the MIT license.
|
|
11
13
|
* See the LICENSE file in the root directory of this source tree.
|
|
12
14
|
*/
|
|
13
|
-
const
|
|
14
|
-
rightLabel:
|
|
15
|
-
value:
|
|
16
|
-
label:
|
|
17
|
-
})),
|
|
18
|
-
const
|
|
19
|
-
f(
|
|
20
|
-
const { description:
|
|
21
|
-
() =>
|
|
22
|
-
[
|
|
15
|
+
const E = [["path", { d: "M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4", key: "svg-0" }], ["path", { d: "M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0", key: "svg-1" }], ["path", { d: "M15 3v4", key: "svg-2" }], ["path", { d: "M7 3v4", key: "svg-3" }], ["path", { d: "M3 11h16", key: "svg-4" }], ["path", { d: "M18 16.496v1.504l1 1", key: "svg-5" }]], I = P("outline", "calendar-time", "CalendarTime", E), O = (e, a) => !e || a.some((o) => o.value === e), V = (e, a) => e.map((o) => ({
|
|
16
|
+
rightLabel: a ? x(o.getRange(a), o.dateFormat) : "",
|
|
17
|
+
value: o.value,
|
|
18
|
+
label: y(o.label)
|
|
19
|
+
})), _ = (e) => {
|
|
20
|
+
const a = v();
|
|
21
|
+
f(a);
|
|
22
|
+
const { description: o, placeholder: d, title: p, comparisonPeriod: r, onChange: t } = b(e), i = a.editors.comparisonPeriodSelectFieldPro.options, n = M(
|
|
23
|
+
() => O(r, i),
|
|
24
|
+
[r, i]
|
|
23
25
|
);
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}, [
|
|
27
|
-
const { dayjsLocaleReady:
|
|
28
|
-
if (!
|
|
26
|
+
k(() => {
|
|
27
|
+
n || t(void 0);
|
|
28
|
+
}, [n, t]);
|
|
29
|
+
const { dayjsLocaleReady: c } = T(), u = L(e.primaryDateRange, a);
|
|
30
|
+
if (!c)
|
|
29
31
|
return null;
|
|
30
|
-
const g =
|
|
31
|
-
|
|
32
|
-
|
|
32
|
+
const g = V(
|
|
33
|
+
i,
|
|
34
|
+
u
|
|
33
35
|
);
|
|
34
|
-
return /* @__PURE__ */
|
|
35
|
-
|
|
36
|
+
return /* @__PURE__ */ l.jsx(j, { title: p, subtitle: o, children: /* @__PURE__ */ l.jsx(
|
|
37
|
+
D,
|
|
36
38
|
{
|
|
37
|
-
startIcon:
|
|
39
|
+
startIcon: I,
|
|
38
40
|
isClearable: !0,
|
|
39
|
-
placeholder:
|
|
40
|
-
value:
|
|
41
|
-
onChange:
|
|
41
|
+
placeholder: d,
|
|
42
|
+
value: n ? r : void 0,
|
|
43
|
+
onChange: t,
|
|
42
44
|
options: g,
|
|
43
|
-
noOptionsMessage:
|
|
45
|
+
noOptionsMessage: C.t("common.noOptionsAvailable")
|
|
44
46
|
}
|
|
45
47
|
) });
|
|
46
|
-
},
|
|
47
|
-
label: "Comparison Period",
|
|
48
|
-
optionLabel: (e) => e
|
|
49
|
-
});
|
|
50
|
-
i(a, "summer");
|
|
51
|
-
i(a, "Previous period");
|
|
52
|
-
i(a, "Previous week");
|
|
53
|
-
i(a, "Previous month");
|
|
54
|
-
i(a, "Previous quarter");
|
|
55
|
-
i(a, "Previous year");
|
|
56
|
-
const W = {
|
|
48
|
+
}, A = {
|
|
57
49
|
name: "ComparisonPeriodSelectFieldPro",
|
|
58
50
|
label: "Comparison Period Select Field",
|
|
59
51
|
category: "Dropdowns",
|
|
60
52
|
defaultWidth: 300,
|
|
61
53
|
defaultHeight: 120,
|
|
62
54
|
inputs: [
|
|
63
|
-
{ ...
|
|
64
|
-
{ ...
|
|
65
|
-
{ ...
|
|
55
|
+
{ ...S },
|
|
56
|
+
{ ...F },
|
|
57
|
+
{ ...R, defaultValue: "Select a date-comparison" },
|
|
66
58
|
{
|
|
67
59
|
name: "primaryDateRange",
|
|
68
60
|
type: "timeRange",
|
|
@@ -72,7 +64,7 @@ const W = {
|
|
|
72
64
|
},
|
|
73
65
|
{
|
|
74
66
|
name: "comparisonPeriod",
|
|
75
|
-
type:
|
|
67
|
+
type: s,
|
|
76
68
|
label: "Selected Comparison Period",
|
|
77
69
|
category: "Pre-configured variables"
|
|
78
70
|
}
|
|
@@ -85,7 +77,7 @@ const W = {
|
|
|
85
77
|
{
|
|
86
78
|
name: "value",
|
|
87
79
|
label: "selected comparison-period",
|
|
88
|
-
type:
|
|
80
|
+
type: s
|
|
89
81
|
}
|
|
90
82
|
]
|
|
91
83
|
}
|
|
@@ -93,23 +85,23 @@ const W = {
|
|
|
93
85
|
variables: [
|
|
94
86
|
{
|
|
95
87
|
name: "comparison-period value",
|
|
96
|
-
type:
|
|
97
|
-
defaultValue:
|
|
88
|
+
type: s,
|
|
89
|
+
defaultValue: m.noFilter(),
|
|
98
90
|
inputs: ["comparisonPeriod"],
|
|
99
91
|
events: [{ name: "onChange", property: "value" }]
|
|
100
92
|
}
|
|
101
93
|
]
|
|
102
|
-
},
|
|
94
|
+
}, G = h(_, A, {
|
|
103
95
|
/* @ts-expect-error - to be fixed in @embeddable.com/react */
|
|
104
96
|
props: (e) => e,
|
|
105
97
|
events: {
|
|
106
98
|
onChange: (e) => ({
|
|
107
|
-
value: e ||
|
|
99
|
+
value: e || m.noFilter()
|
|
108
100
|
})
|
|
109
101
|
}
|
|
110
102
|
});
|
|
111
103
|
export {
|
|
112
|
-
|
|
113
|
-
|
|
104
|
+
G as default,
|
|
105
|
+
A as meta
|
|
114
106
|
};
|
|
115
107
|
//# sourceMappingURL=ComparisonPeriodSelectFieldPro.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ComparisonPeriodSelectFieldPro.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconCalendarTime.mjs","../src/remarkable-pro/components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.utils.ts","../src/remarkable-pro/components/editors/ComparisonPeriodSelectFieldPro/index.tsx","../src/remarkable-pro/components/types/ComparisonPeriod.type.emb.ts","../src/remarkable-pro/components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.emb.ts"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.34.1 - 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\": \"M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M15 3v4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M7 3v4\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M3 11h16\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M18 16.496v1.504l1 1\", \"key\": \"svg-5\" }]];\nconst IconCalendarTime = createReactComponent(\"outline\", \"calendar-time\", \"CalendarTime\", __iconNode);\n\nexport { __iconNode, IconCalendarTime as default };\n//# sourceMappingURL=IconCalendarTime.mjs.map\n","import { SelectListOptionProps } from '../../../../remarkable-ui';\nimport { TimeRange } from '@embeddable.com/core';\nimport { ComparisonPeriodSelectFieldProOption } from './ComparisonPeriodSelectFieldPro.types';\nimport { getTimeRangeLabel } from '../editors.timeRange.utils';\nimport { resolveI18nString } from '../../component.utils';\n\n// Checks if the comparison period type is available in the embeddable types\nexport const isComparisonPeriodAvailable = (\n option: string | undefined,\n comparisonPeriodSelectFieldProOptions: ComparisonPeriodSelectFieldProOption[],\n): boolean => {\n return !option || comparisonPeriodSelectFieldProOptions.some((opt) => opt.value === option);\n};\n\nexport const getComparisonPeriodSelectFieldProOptions = (\n comparisonPeriodSelectFieldProOptions: ComparisonPeriodSelectFieldProOption[],\n toCompareTimeRange: TimeRange,\n): SelectListOptionProps[] => {\n return comparisonPeriodSelectFieldProOptions.map((option) => {\n return {\n rightLabel: toCompareTimeRange\n ? getTimeRangeLabel(option.getRange(toCompareTimeRange), option.dateFormat)\n : '',\n value: option.value,\n label: resolveI18nString(option.label),\n };\n });\n};\n","import { useTheme } from '@embeddable.com/react';\nimport { SingleSelectField } from '../../../../remarkable-ui';\nimport { Theme } from '../../../theme/theme.types';\nimport { useLoadDayjsLocale } from '../../../utils.ts/date.utils';\nimport { TimeRange } from '@embeddable.com/core';\nimport { resolveI18nProps } from '../../component.utils';\nimport { EditorCard } from '../shared/EditorCard/EditorCard';\nimport { IconCalendarTime } from '@tabler/icons-react';\nimport { i18n, i18nSetup } from '../../../theme/i18n/i18n';\nimport {\n getComparisonPeriodSelectFieldProOptions,\n isComparisonPeriodAvailable,\n} from './ComparisonPeriodSelectFieldPro.utils';\nimport { getTimeRangeFromTo } from '../editors.timeRange.utils';\nimport { useEffect, useMemo } from 'react';\n\ntype DateComparisonSelectFieldPro = {\n title?: string;\n description?: string;\n placeholder?: string;\n primaryDateRange?: TimeRange;\n comparisonPeriod?: string;\n onChange: (newComparisonPeriod?: string) => void;\n};\n\nconst DateComparisonSelectFieldPro = (props: DateComparisonSelectFieldPro) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { description, placeholder, title, comparisonPeriod, onChange } = resolveI18nProps(props);\n\n const comparisonPeriodOptions = theme.editors.comparisonPeriodSelectFieldPro.options;\n\n const comparisonPeriodAvailable = useMemo(\n () => isComparisonPeriodAvailable(comparisonPeriod, comparisonPeriodOptions),\n [comparisonPeriod, comparisonPeriodOptions],\n );\n\n // If the current comparison period is not available, reset the field\n useEffect(() => {\n if (!comparisonPeriodAvailable) {\n onChange(undefined);\n }\n }, [comparisonPeriodAvailable, onChange]);\n\n const { dayjsLocaleReady } = useLoadDayjsLocale();\n\n // Obtain the actual range for the selected primaryDateRange\n const primaryDateRange = getTimeRangeFromTo(props.primaryDateRange, theme);\n\n if (!dayjsLocaleReady) {\n return null;\n }\n\n const options = getComparisonPeriodSelectFieldProOptions(\n comparisonPeriodOptions,\n primaryDateRange,\n );\n\n return (\n <EditorCard title={title} subtitle={description}>\n <SingleSelectField\n startIcon={IconCalendarTime}\n isClearable\n placeholder={placeholder}\n value={comparisonPeriodAvailable ? comparisonPeriod : undefined}\n onChange={onChange}\n options={options}\n noOptionsMessage={i18n.t('common.noOptionsAvailable')}\n />\n </EditorCard>\n );\n};\n\nexport default DateComparisonSelectFieldPro;\n","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, 'summer');\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","import { defineComponent, EmbeddedComponentMeta, Inputs } from '@embeddable.com/react';\nimport { Value } from '@embeddable.com/core';\nimport ComparisonPeriodSelectFieldPro from './index';\nimport { description, placeholder, title } from '../../component.constants';\nimport ComparisonPeriodType from '../../types/ComparisonPeriod.type.emb';\n\nexport const meta = {\n name: 'ComparisonPeriodSelectFieldPro',\n label: 'Comparison Period Select Field',\n category: 'Dropdowns',\n defaultWidth: 300,\n defaultHeight: 120,\n inputs: [\n { ...title },\n { ...description },\n { ...placeholder, defaultValue: 'Select a date-comparison' },\n {\n name: 'primaryDateRange',\n type: 'timeRange',\n label: 'Primary Date Range',\n category: 'Pre-configured variables',\n description: 'Pick the main time period. The comparison range is based on this selection.',\n },\n {\n name: 'comparisonPeriod',\n type: ComparisonPeriodType,\n label: 'Selected Comparison Period',\n category: 'Pre-configured variables',\n },\n ],\n events: [\n {\n name: 'onChange',\n label: 'selected comparison-period updated',\n properties: [\n {\n name: 'value',\n label: 'selected comparison-period',\n type: ComparisonPeriodType,\n },\n ],\n },\n ],\n variables: [\n {\n name: 'comparison-period value',\n type: ComparisonPeriodType,\n defaultValue: Value.noFilter(),\n inputs: ['comparisonPeriod'],\n events: [{ name: 'onChange', property: 'value' }],\n },\n ],\n} as const satisfies EmbeddedComponentMeta;\n\nexport default defineComponent(ComparisonPeriodSelectFieldPro, meta, {\n /* @ts-expect-error - to be fixed in @embeddable.com/react */\n props: (inputs: Inputs<typeof meta>) => inputs,\n events: {\n onChange: (value) => {\n return {\n value: value || Value.noFilter(),\n };\n },\n },\n});\n"],"names":["__iconNode","IconCalendarTime","createReactComponent","isComparisonPeriodAvailable","option","comparisonPeriodSelectFieldProOptions","opt","getComparisonPeriodSelectFieldProOptions","toCompareTimeRange","getTimeRangeLabel","resolveI18nString","DateComparisonSelectFieldPro","props","theme","useTheme","i18nSetup","description","placeholder","title","comparisonPeriod","onChange","resolveI18nProps","comparisonPeriodOptions","comparisonPeriodAvailable","useMemo","useEffect","dayjsLocaleReady","useLoadDayjsLocale","primaryDateRange","getTimeRangeFromTo","options","jsx","EditorCard","SingleSelectField","i18n","ComparisonPeriodType","defineType","value","defineOption","meta","Value","ComparisonPeriodSelectFieldPro_emb","defineComponent","ComparisonPeriodSelectFieldPro","inputs"],"mappings":";;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa,CAAC,CAAC,QAAQ,EAAE,GAAK,2EAA2E,KAAO,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAK,4CAA4C,KAAO,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAK,WAAW,KAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,GAAK,UAAU,KAAO,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAK,YAAY,KAAO,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAK,wBAAwB,KAAO,QAAO,CAAE,CAAC,GAC9YC,IAAmBC,EAAqB,WAAW,iBAAiB,gBAAgBF,CAAU,GCHvFG,IAA8B,CACzCC,GACAC,MAEO,CAACD,KAAUC,EAAsC,KAAK,CAACC,MAAQA,EAAI,UAAUF,CAAM,GAG/EG,IAA2C,CACtDF,GACAG,MAEOH,EAAsC,IAAI,CAACD,OACzC;AAAA,EACL,YAAYI,IACRC,EAAkBL,EAAO,SAASI,CAAkB,GAAGJ,EAAO,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GAAsB,gBAAgB;AACnDG,EAAaH,GAAsB,kBAAkB;AACrDG,EAAaH,GAAsB,eAAe;ACN3C,MAAMI,IAAO;AAAA,EAClB,MAAM;AAAA,EACN,OAAO;AAAA,EACP,UAAU;AAAA,EACV,cAAc;AAAA,EACd,eAAe;AAAA,EACf,QAAQ;AAAA,IACN,EAAE,GAAGrB,EAAA;AAAA,IACL,EAAE,GAAGF,EAAA;AAAA,IACL,EAAE,GAAGC,GAAa,cAAc,2BAAA;AAAA,IAChC;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,MACV,aAAa;AAAA,IAAA;AAAA,IAEf;AAAA,MACE,MAAM;AAAA,MACN,MAAMkB;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,IAAA;AAAA,EACZ;AAAA,EAEF,QAAQ;AAAA,IACN;AAAA,MACE,MAAM;AAAA,MACN,OAAO;AAAA,MACP,YAAY;AAAA,QACV;AAAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,UACP,MAAMA;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EAEF,WAAW;AAAA,IACT;AAAA,MACE,MAAM;AAAA,MACN,MAAMA;AAAA,MACN,cAAcK,EAAM,SAAA;AAAA,MACpB,QAAQ,CAAC,kBAAkB;AAAA,MAC3B,QAAQ,CAAC,EAAE,MAAM,YAAY,UAAU,SAAS;AAAA,IAAA;AAAA,EAClD;AAEJ,GAEAC,IAAeC,EAAgBC,GAAgCJ,GAAM;AAAA;AAAA,EAEnE,OAAO,CAACK,MAAgCA;AAAA,EACxC,QAAQ;AAAA,IACN,UAAU,CAACP,OACF;AAAA,MACL,OAAOA,KAASG,EAAM,SAAA;AAAA,IAAS;AAAA,EAEnC;AAEJ,CAAC;","x_google_ignoreList":[0]}
|
|
1
|
+
{"version":3,"file":"ComparisonPeriodSelectFieldPro.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconCalendarTime.mjs","../src/remarkable-pro/components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.utils.ts","../src/remarkable-pro/components/editors/ComparisonPeriodSelectFieldPro/index.tsx","../src/remarkable-pro/components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.emb.ts"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.34.1 - 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\": \"M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M15 3v4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M7 3v4\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M3 11h16\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M18 16.496v1.504l1 1\", \"key\": \"svg-5\" }]];\nconst IconCalendarTime = createReactComponent(\"outline\", \"calendar-time\", \"CalendarTime\", __iconNode);\n\nexport { __iconNode, IconCalendarTime as default };\n//# sourceMappingURL=IconCalendarTime.mjs.map\n","import { SelectListOptionProps } from '../../../../remarkable-ui';\nimport { TimeRange } from '@embeddable.com/core';\nimport { ComparisonPeriodSelectFieldProOption } from './ComparisonPeriodSelectFieldPro.types';\nimport { getTimeRangeLabel } from '../editors.timeRange.utils';\nimport { resolveI18nString } from '../../component.utils';\n\n// Checks if the comparison period type is available in the embeddable types\nexport const isComparisonPeriodAvailable = (\n option: string | undefined,\n comparisonPeriodSelectFieldProOptions: ComparisonPeriodSelectFieldProOption[],\n): boolean => {\n return !option || comparisonPeriodSelectFieldProOptions.some((opt) => opt.value === option);\n};\n\nexport const getComparisonPeriodSelectFieldProOptions = (\n comparisonPeriodSelectFieldProOptions: ComparisonPeriodSelectFieldProOption[],\n toCompareTimeRange: TimeRange,\n): SelectListOptionProps[] => {\n return comparisonPeriodSelectFieldProOptions.map((option) => {\n return {\n rightLabel: toCompareTimeRange\n ? getTimeRangeLabel(option.getRange(toCompareTimeRange), option.dateFormat)\n : '',\n value: option.value,\n label: resolveI18nString(option.label),\n };\n });\n};\n","import { useTheme } from '@embeddable.com/react';\nimport { SingleSelectField } from '../../../../remarkable-ui';\nimport { Theme } from '../../../theme/theme.types';\nimport { useLoadDayjsLocale } from '../../../utils.ts/date.utils';\nimport { TimeRange } from '@embeddable.com/core';\nimport { resolveI18nProps } from '../../component.utils';\nimport { EditorCard } from '../shared/EditorCard/EditorCard';\nimport { IconCalendarTime } from '@tabler/icons-react';\nimport { i18n, i18nSetup } from '../../../theme/i18n/i18n';\nimport {\n getComparisonPeriodSelectFieldProOptions,\n isComparisonPeriodAvailable,\n} from './ComparisonPeriodSelectFieldPro.utils';\nimport { getTimeRangeFromTo } from '../editors.timeRange.utils';\nimport { useEffect, useMemo } from 'react';\n\ntype DateComparisonSelectFieldPro = {\n title?: string;\n description?: string;\n placeholder?: string;\n primaryDateRange?: TimeRange;\n comparisonPeriod?: string;\n onChange: (newComparisonPeriod?: string) => void;\n};\n\nconst DateComparisonSelectFieldPro = (props: DateComparisonSelectFieldPro) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { description, placeholder, title, comparisonPeriod, onChange } = resolveI18nProps(props);\n\n const comparisonPeriodOptions = theme.editors.comparisonPeriodSelectFieldPro.options;\n\n const comparisonPeriodAvailable = useMemo(\n () => isComparisonPeriodAvailable(comparisonPeriod, comparisonPeriodOptions),\n [comparisonPeriod, comparisonPeriodOptions],\n );\n\n // If the current comparison period is not available, reset the field\n useEffect(() => {\n if (!comparisonPeriodAvailable) {\n onChange(undefined);\n }\n }, [comparisonPeriodAvailable, onChange]);\n\n const { dayjsLocaleReady } = useLoadDayjsLocale();\n\n // Obtain the actual range for the selected primaryDateRange\n const primaryDateRange = getTimeRangeFromTo(props.primaryDateRange, theme);\n\n if (!dayjsLocaleReady) {\n return null;\n }\n\n const options = getComparisonPeriodSelectFieldProOptions(\n comparisonPeriodOptions,\n primaryDateRange,\n );\n\n return (\n <EditorCard title={title} subtitle={description}>\n <SingleSelectField\n startIcon={IconCalendarTime}\n isClearable\n placeholder={placeholder}\n value={comparisonPeriodAvailable ? comparisonPeriod : undefined}\n onChange={onChange}\n options={options}\n noOptionsMessage={i18n.t('common.noOptionsAvailable')}\n />\n </EditorCard>\n );\n};\n\nexport default DateComparisonSelectFieldPro;\n","import { defineComponent, EmbeddedComponentMeta, Inputs } from '@embeddable.com/react';\nimport { Value } from '@embeddable.com/core';\nimport ComparisonPeriodSelectFieldPro from './index';\nimport { description, placeholder, title } from '../../component.constants';\nimport ComparisonPeriodType from '../../types/ComparisonPeriod.type.emb';\n\nexport const meta = {\n name: 'ComparisonPeriodSelectFieldPro',\n label: 'Comparison Period Select Field',\n category: 'Dropdowns',\n defaultWidth: 300,\n defaultHeight: 120,\n inputs: [\n { ...title },\n { ...description },\n { ...placeholder, defaultValue: 'Select a date-comparison' },\n {\n name: 'primaryDateRange',\n type: 'timeRange',\n label: 'Primary Date Range',\n category: 'Pre-configured variables',\n description: 'Pick the main time period. The comparison range is based on this selection.',\n },\n {\n name: 'comparisonPeriod',\n type: ComparisonPeriodType,\n label: 'Selected Comparison Period',\n category: 'Pre-configured variables',\n },\n ],\n events: [\n {\n name: 'onChange',\n label: 'selected comparison-period updated',\n properties: [\n {\n name: 'value',\n label: 'selected comparison-period',\n type: ComparisonPeriodType,\n },\n ],\n },\n ],\n variables: [\n {\n name: 'comparison-period value',\n type: ComparisonPeriodType,\n defaultValue: Value.noFilter(),\n inputs: ['comparisonPeriod'],\n events: [{ name: 'onChange', property: 'value' }],\n },\n ],\n} as const satisfies EmbeddedComponentMeta;\n\nexport default defineComponent(ComparisonPeriodSelectFieldPro, meta, {\n /* @ts-expect-error - to be fixed in @embeddable.com/react */\n props: (inputs: Inputs<typeof meta>) => inputs,\n events: {\n onChange: (value) => {\n return {\n value: value || Value.noFilter(),\n };\n },\n },\n});\n"],"names":["__iconNode","IconCalendarTime","createReactComponent","isComparisonPeriodAvailable","option","comparisonPeriodSelectFieldProOptions","opt","getComparisonPeriodSelectFieldProOptions","toCompareTimeRange","getTimeRangeLabel","resolveI18nString","DateComparisonSelectFieldPro","props","theme","useTheme","i18nSetup","description","placeholder","title","comparisonPeriod","onChange","resolveI18nProps","comparisonPeriodOptions","comparisonPeriodAvailable","useMemo","useEffect","dayjsLocaleReady","useLoadDayjsLocale","primaryDateRange","getTimeRangeFromTo","options","jsx","EditorCard","SingleSelectField","i18n","meta","ComparisonPeriodType","Value","ComparisonPeriodSelectFieldPro_emb","defineComponent","ComparisonPeriodSelectFieldPro","inputs","value"],"mappings":";;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa,CAAC,CAAC,QAAQ,EAAE,GAAK,2EAA2E,KAAO,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAK,4CAA4C,KAAO,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAK,WAAW,KAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,GAAK,UAAU,KAAO,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAK,YAAY,KAAO,SAAS,GAAG,CAAC,QAAQ,EAAE,GAAK,wBAAwB,KAAO,QAAO,CAAE,CAAC,GAC9YC,IAAmBC,EAAqB,WAAW,iBAAiB,gBAAgBF,CAAU,GCHvFG,IAA8B,CACzCC,GACAC,MAEO,CAACD,KAAUC,EAAsC,KAAK,CAACC,MAAQA,EAAI,UAAUF,CAAM,GAG/EG,IAA2C,CACtDF,GACAG,MAEOH,EAAsC,IAAI,CAACD,OACzC;AAAA,EACL,YAAYI,IACRC,EAAkBL,EAAO,SAASI,CAAkB,GAAGJ,EAAO,UAAU,IACxE;AAAA,EACJ,OAA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AA,IAChC;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,MACV,aAAa;AAAA,IAAA;AAAA,IAEf;AAAA,MACE,MAAM;AAAA,MACN,MAAMmB;AAAA,MACN,OAAO;AAAA,MACP,UAAU;AAAA,IAAA;AAAA,EACZ;AAAA,EAEF,QAAQ;AAAA,IACN;AAAA,MACE,MAAM;AAAA,MACN,OAAO;AAAA,MACP,YAAY;AAAA,QACV;AAAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,UACP,MAAMA;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EAEF,WAAW;AAAA,IACT;AAAA,MACE,MAAM;AAAA,MACN,MAAMA;AAAA,MACN,cAAcC,EAAM,SAAA;AAAA,MACpB,QAAQ,CAAC,kBAAkB;AAAA,MAC3B,QAAQ,CAAC,EAAE,MAAM,YAAY,UAAU,SAAS;AAAA,IAAA;AAAA,EAClD;AAEJ,GAEAC,IAAeC,EAAgBC,GAAgCL,GAAM;AAAA;AAAA,EAEnE,OAAO,CAACM,MAAgCA;AAAA,EACxC,QAAQ;AAAA,IACN,UAAU,CAACC,OACF;AAAA,MACL,OAAOA,KAASL,EAAM,SAAA;AAAA,IAAS;AAAA,EAEnC;AAEJ,CAAC;","x_google_ignoreList":[0]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { defineComponent as l } from "@embeddable.com/react";
|
|
2
|
-
import { t as o, c as n,
|
|
3
|
-
import { D as i } from "./index-
|
|
4
|
-
import { l as t } from "./
|
|
2
|
+
import { t as o, c as n, _ as r, V as a } from "./component.constants-DIhZCTG3.js";
|
|
3
|
+
import { D as i } from "./index-B_4rK6tI.js";
|
|
4
|
+
import { l as t } from "./date.utils-CNVHSCO8.js";
|
|
5
5
|
const d = {
|
|
6
6
|
name: "DateRangeSelectFieldPro",
|
|
7
7
|
label: "Date Range Select Field",
|
package/dist/DonutChartPro.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { d as a, w as s, z as t, t as o, c as n, s as r,
|
|
1
|
+
import { d as a, w as s, z as t, t as o, c as n, s as r, Y as i, e as m, f as l, V as d, o as u } from "./component.constants-DIhZCTG3.js";
|
|
2
2
|
import { defineComponent as c } from "@embeddable.com/react";
|
|
3
|
-
import { D as p } from "./index-
|
|
3
|
+
import { D as p } from "./index-Bgj2EBb8.js";
|
|
4
4
|
const C = {
|
|
5
5
|
name: "DonutChartPro",
|
|
6
6
|
label: "Donut Chart",
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { D as n } from "./index-
|
|
2
|
-
import { d as s, w as a, z as r, t as o, c as l, s as i,
|
|
1
|
+
import { D as n } from "./index-C8pGCEGw.js";
|
|
2
|
+
import { d as s, w as a, z as r, t as o, c as l, s as i, Y as m, e as d, f as u, V as b, o as t } from "./component.constants-DIhZCTG3.js";
|
|
3
3
|
import { defineComponent as c } from "@embeddable.com/react";
|
|
4
4
|
const p = {
|
|
5
5
|
name: "DonutLabelChartPro",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Z as l, j as r, a1 as u, i as m, a2 as p, a3 as _, a5 as x, a7 as f, R as h, aw as C } from "./component.constants-DIhZCTG3.js";
|
|
2
2
|
import { useEffect as j } from "react";
|
|
3
3
|
import { useTheme as S } from "@embeddable.com/react";
|
|
4
4
|
/**
|
|
@@ -7,44 +7,44 @@ import { useTheme as S } from "@embeddable.com/react";
|
|
|
7
7
|
* This source code is licensed under the MIT license.
|
|
8
8
|
* See the LICENSE file in the root directory of this source tree.
|
|
9
9
|
*/
|
|
10
|
-
const
|
|
11
|
-
listOptions:
|
|
12
|
-
disabled:
|
|
13
|
-
}, k = ({ children: t, disabled: e, ...s }) => /* @__PURE__ */ r.jsx("div", { className: u(
|
|
10
|
+
const b = [["path", { d: "M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0", key: "svg-0" }], ["path", { d: "M21 21l-6 -6", key: "svg-1" }]], g = l("outline", "search", "Search", b), v = "_listOptions_2o1ip_1", y = "_disabled_2o1ip_6", o = {
|
|
11
|
+
listOptions: v,
|
|
12
|
+
disabled: y
|
|
13
|
+
}, k = ({ children: t, disabled: e, ...s }) => /* @__PURE__ */ r.jsx("div", { className: u(o.listOptions, e && o.disabled), ...s, children: t });
|
|
14
14
|
function R(t, e = 300) {
|
|
15
15
|
let s;
|
|
16
|
-
return (...
|
|
16
|
+
return (...a) => {
|
|
17
17
|
clearTimeout(s), s = setTimeout(() => {
|
|
18
|
-
t(...
|
|
18
|
+
t(...a);
|
|
19
19
|
}, e);
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
const
|
|
22
|
+
const w = (t, e) => {
|
|
23
23
|
j(() => {
|
|
24
24
|
t && setTimeout(() => {
|
|
25
25
|
var s;
|
|
26
26
|
(s = e.current) == null || s.focus();
|
|
27
27
|
}, 100);
|
|
28
28
|
}, [t, e]);
|
|
29
|
-
},
|
|
30
|
-
error:
|
|
29
|
+
}, T = "_error_1xvr5_1", E = "_card_1xvr5_7", n = {
|
|
30
|
+
error: T,
|
|
31
31
|
card: E
|
|
32
|
-
},
|
|
32
|
+
}, A = ({
|
|
33
33
|
title: t,
|
|
34
34
|
subtitle: e,
|
|
35
35
|
children: s,
|
|
36
|
-
errorMessage:
|
|
36
|
+
errorMessage: a,
|
|
37
37
|
...c
|
|
38
38
|
}) => {
|
|
39
39
|
const i = S();
|
|
40
40
|
m(i);
|
|
41
|
-
const d = () =>
|
|
41
|
+
const d = () => a ? /* @__PURE__ */ r.jsx(
|
|
42
42
|
f,
|
|
43
43
|
{
|
|
44
44
|
className: n.error,
|
|
45
45
|
icon: C,
|
|
46
46
|
title: h.t("editors.errorTitle"),
|
|
47
|
-
message:
|
|
47
|
+
message: a
|
|
48
48
|
}
|
|
49
49
|
) : s;
|
|
50
50
|
return /* @__PURE__ */ r.jsxs(p, { className: n.card, ...c, children: [
|
|
@@ -53,10 +53,10 @@ const $ = (t, e) => {
|
|
|
53
53
|
] });
|
|
54
54
|
};
|
|
55
55
|
export {
|
|
56
|
-
|
|
56
|
+
A as E,
|
|
57
57
|
g as I,
|
|
58
58
|
k as S,
|
|
59
59
|
R as d,
|
|
60
|
-
|
|
60
|
+
w as u
|
|
61
61
|
};
|
|
62
|
-
//# sourceMappingURL=EditorCard-
|
|
62
|
+
//# sourceMappingURL=EditorCard-BriyqUva.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorCard-
|
|
1
|
+
{"version":3,"file":"EditorCard-BriyqUva.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconSearch.mjs","../src/remarkable-ui/editors/select/shared/SelectList/SelectListOptions/SelectListOptions.tsx","../src/remarkable-ui/utils/debounce.utils.ts","../src/remarkable-ui/editors/select/shared/useSelectSearchFocus.hook.ts","../src/remarkable-pro/components/editors/shared/EditorCard/EditorCard.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.34.1 - 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\": \"M10 10m-7 0a7 7 0 1 0 14 0a7 7 0 1 0 -14 0\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M21 21l-6 -6\", \"key\": \"svg-1\" }]];\nconst IconSearch = createReactComponent(\"outline\", \"search\", \"Search\", __iconNode);\n\nexport { __iconNode, IconSearch as default };\n//# sourceMappingURL=IconSearch.mjs.map\n","import { FC } from 'react';\nimport styles from './SelectListOptions.module.css';\nimport clsx from 'clsx';\n\nexport type SelectListOptionsProps = React.HTMLAttributes<HTMLDivElement> & {\n children: React.ReactNode;\n disabled?: boolean;\n};\n\nexport const SelectListOptions: FC<SelectListOptionsProps> = ({ children, disabled, ...props }) => {\n return (\n <div className={clsx(styles.listOptions, disabled && styles.disabled)} {...props}>\n {children}\n </div>\n );\n};\n","// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport function debounce<T extends (...args: any[]) => void>(\n fn: T,\n delay = 300,\n): (...args: Parameters<T>) => void {\n let timer: NodeJS.Timeout;\n return (...args: Parameters<T>) => {\n clearTimeout(timer);\n timer = setTimeout(() => {\n fn(...args);\n }, delay);\n };\n}\n","import { useEffect } from 'react';\n\nexport const useSelectSearchFocus = (\n isOpen: boolean,\n searchFieldRef: React.RefObject<HTMLInputElement | null>,\n) => {\n useEffect(() => {\n if (isOpen) {\n setTimeout(() => {\n (searchFieldRef.current as unknown as HTMLInputElement)?.focus();\n }, 100);\n }\n }, [isOpen, searchFieldRef]);\n};\n","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, CardContentInfo, CardHeader } from '../../../../../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 <CardContentInfo\n className={styles.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":["__iconNode","IconSearch","createReactComponent","SelectListOptions","children","disabled","props","jsx","clsx","styles","debounce","fn","delay","timer","args","useSelectSearchFocus","isOpen","searchFieldRef","useEffect","_a","EditorCard","title","subtitle","errorMessage","theme","useTheme","i18nSetup","getDisplay","CardContentInfo","IconAlertCircle","i18n","Card","CardHeader","C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