@embeddable.com/remarkable-pro 0.0.23 → 0.0.25
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 +5 -5
- package/dist/BarChartDefaultHorizontalPro.js.map +1 -1
- package/dist/BarChartDefaultPro.js +5 -5
- package/dist/BarChartDefaultPro.js.map +1 -1
- package/dist/BarChartGroupedHorizontalPro.js +4 -4
- package/dist/BarChartGroupedPro.js +4 -4
- package/dist/BarChartStackedHorizontalPro.js +4 -4
- package/dist/BarChartStackedPro.js +4 -4
- package/dist/{ChartCard-B3B1rFYh.js → ChartCard-BHPN4_tz.js} +22 -22
- package/dist/{ChartCard-B3B1rFYh.js.map → ChartCard-BHPN4_tz.js.map} +1 -1
- package/dist/{Color.type.emb-sebikYGW.js → Color.type.emb-DWdIUAm5.js} +2600 -2590
- package/dist/{Color.type.emb-sebikYGW.js.map → Color.type.emb-DWdIUAm5.js.map} +1 -1
- package/dist/ColorEditor.js +1 -1
- package/dist/ComparisonPeriodSelectFieldPro.js +3 -3
- package/dist/DateRangePickerCustomPro.js +10 -9
- package/dist/DateRangePickerCustomPro.js.map +1 -1
- package/dist/DateRangeSelectFieldPro.js +3 -3
- package/dist/DonutChartPro.js +4 -4
- package/dist/DonutLabelChartPro.js +4 -4
- package/dist/{EditorCard-DpSCsmZJ.js → EditorCard-ZXwl5-DV.js} +3 -3
- package/dist/{EditorCard-DpSCsmZJ.js.map → EditorCard-ZXwl5-DV.js.map} +1 -1
- package/dist/GranularitySelectFieldPro.js +20 -19
- package/dist/GranularitySelectFieldPro.js.map +1 -1
- package/dist/HeatMapPro.js +4 -4
- package/dist/{IconCalendarFilled-Bfm3jkzE.js → IconCalendarFilled-Bl7kPqxG.js} +2 -2
- package/dist/{IconCalendarFilled-Bfm3jkzE.js.map → IconCalendarFilled-Bl7kPqxG.js.map} +1 -1
- package/dist/KpiChartNumberComparisonPro.js +4 -4
- package/dist/KpiChartNumberPro.js +4 -4
- package/dist/LineChartComparisonDefaultPro.js +4 -4
- package/dist/LineChartDefaultPro.js +4 -4
- package/dist/LineChartGroupedPro.js +4 -4
- package/dist/MultiSelectFieldPro.js +4 -4
- package/dist/PieChartPro.js +4 -4
- package/dist/PivotTablePro.js +4 -4
- package/dist/SingleSelectFieldPro.js +4 -4
- package/dist/TableChartPaginated.js +4 -4
- package/dist/TableScrollable.js +17 -17
- package/dist/bars.utils-DLqiVSYV.js +154 -0
- package/dist/bars.utils-DLqiVSYV.js.map +1 -0
- package/dist/{charts.utils-udVhj9f6.js → charts.utils-lvlkFPJk.js} +4 -4
- package/dist/{charts.utils-udVhj9f6.js.map → charts.utils-lvlkFPJk.js.map} +1 -1
- package/dist/{component.inputs.constants-Ds7YpNhT.js → component.inputs.constants-DO_jX-yc.js} +43 -43
- package/dist/{component.inputs.constants-Ds7YpNhT.js.map → component.inputs.constants-DO_jX-yc.js.map} +1 -1
- package/dist/components/charts/bars/bars.utils.d.ts.map +1 -1
- package/dist/components/charts/lines/LineChartComparisonDefaultPro/LineChartComparisonDefaultPro.utils.d.ts.map +1 -1
- package/dist/components/charts/lines/LineChartDefaultPro/LineChartDefaultPro.utils.d.ts.map +1 -1
- package/dist/components/charts/lines/LineChartGroupedPro/LineChartGroupedPro.utils.d.ts.map +1 -1
- package/dist/components/charts/pies/pies.utils.d.ts.map +1 -1
- package/dist/components/charts/tables/tables.utils.d.ts.map +1 -1
- package/dist/components/editors/ComparisonPeriodSelectFieldPro/index.d.ts.map +1 -1
- package/dist/components/editors/GranularitySelectFieldPro/index.d.ts.map +1 -1
- package/dist/components/editors/MultiSelectFieldPro/index.d.ts.map +1 -1
- package/dist/components/editors/SingleSelectFieldPro/index.d.ts.map +1 -1
- package/dist/components/editors/dates/DateRangePickerCustomPro/index.d.ts.map +1 -1
- package/dist/components/editors/dates/DateRangePickerPresetsPro/index.d.ts.map +1 -1
- package/dist/embeddable-components.json +28 -28
- package/dist/{formatter.utils-tS15PLXn.js → formatter.utils-CBCUxVH8.js} +2 -2
- package/dist/{formatter.utils-tS15PLXn.js.map → formatter.utils-CBCUxVH8.js.map} +1 -1
- package/dist/{index--Dbq1zrZ.js → index-0eDJ_Ho5.js} +5 -5
- package/dist/{index--Dbq1zrZ.js.map → index-0eDJ_Ho5.js.map} +1 -1
- package/dist/index-BRX2mrGM.js +124 -0
- package/dist/index-BRX2mrGM.js.map +1 -0
- package/dist/{index-CbL0nET2.js → index-BRuc7lF2.js} +5 -5
- package/dist/{index-CbL0nET2.js.map → index-BRuc7lF2.js.map} +1 -1
- package/dist/{index-t7YCtFvf.js → index-BSK_5Rq3.js} +5 -5
- package/dist/{index-t7YCtFvf.js.map → index-BSK_5Rq3.js.map} +1 -1
- package/dist/{index-BWbZ-eYD.js → index-ByFoIwAq.js} +5 -5
- package/dist/{index-BWbZ-eYD.js.map → index-ByFoIwAq.js.map} +1 -1
- package/dist/{index-Bqp4yCd3.js → index-CRWWARnB.js} +5 -5
- package/dist/{index-Bqp4yCd3.js.map → index-CRWWARnB.js.map} +1 -1
- package/dist/{index-DzPftkGV.js → index-CVIirzal.js} +5 -5
- package/dist/{index-DzPftkGV.js.map → index-CVIirzal.js.map} +1 -1
- package/dist/index-Cj1Zuh74.js +165 -0
- package/dist/index-Cj1Zuh74.js.map +1 -0
- package/dist/{index-DxpfQVmG.js → index-Cn_Rs8nk.js} +5 -5
- package/dist/{index-DxpfQVmG.js.map → index-Cn_Rs8nk.js.map} +1 -1
- package/dist/{index-CCdQwMMN.js → index-CpUKjpYd.js} +11 -10
- package/dist/{index-CCdQwMMN.js.map → index-CpUKjpYd.js.map} +1 -1
- package/dist/{index-BUk63KEk.js → index-CzM9TqMe.js} +6 -6
- package/dist/{index-BUk63KEk.js.map → index-CzM9TqMe.js.map} +1 -1
- package/dist/{index-D9J4M9sd.js → index-D9LxkwlG.js} +5 -5
- package/dist/{index-D9J4M9sd.js.map → index-D9LxkwlG.js.map} +1 -1
- package/dist/index-DDeRZxp1.js +334 -0
- package/dist/index-DDeRZxp1.js.map +1 -0
- package/dist/index-DLT2A69c.js +47 -0
- package/dist/{index-CBgU-nlM.js.map → index-DLT2A69c.js.map} +1 -1
- package/dist/index-DMtpdR9I.js +170 -0
- package/dist/index-DMtpdR9I.js.map +1 -0
- package/dist/{index-DxpjYqqB.js → index-DZYPPNrI.js} +5 -5
- package/dist/{index-DxpjYqqB.js.map → index-DZYPPNrI.js.map} +1 -1
- package/dist/{index-BMiribI6.js → index-EOl5XOZN.js} +6 -6
- package/dist/{index-BMiribI6.js.map → index-EOl5XOZN.js.map} +1 -1
- package/dist/{index-DtGheuiZ.js → index-L5_Ts7FG.js} +5 -5
- package/dist/{index-DtGheuiZ.js.map → index-L5_Ts7FG.js.map} +1 -1
- package/dist/{index-CTC3YNmw.js → index-Rxsr4tZ-.js} +13 -12
- package/dist/{index-CTC3YNmw.js.map → index-Rxsr4tZ-.js.map} +1 -1
- package/dist/{index-D6h8s36F.js → index-Uhz2U4Dp.js} +5 -5
- package/dist/{index-D6h8s36F.js.map → index-Uhz2U4Dp.js.map} +1 -1
- package/dist/{index-CDtF3MO_.js → index-s4oA7Iyp.js} +8 -8
- package/dist/{index-CDtF3MO_.js.map → index-s4oA7Iyp.js.map} +1 -1
- package/dist/index.js +30 -30
- package/dist/pies.utils-BxCBtjpf.js +77 -0
- package/dist/pies.utils-BxCBtjpf.js.map +1 -0
- package/dist/{preview.data.constants-tDMYNi0n.js → preview.data.constants-CXMriS2F.js} +2 -2
- package/dist/{preview.data.constants-tDMYNi0n.js.map → preview.data.constants-CXMriS2F.js.map} +1 -1
- package/dist/styles.utils-u6uj51UE.js +59 -0
- package/dist/styles.utils-u6uj51UE.js.map +1 -0
- package/dist/{tables.utils-33eWJN_a.js → tables.utils-DMLGNJ4g.js} +5 -4
- package/dist/{tables.utils-33eWJN_a.js.map → tables.utils-DMLGNJ4g.js.map} +1 -1
- package/dist/theme/styles/styles.utils.d.ts +12 -0
- package/dist/theme/styles/styles.utils.d.ts.map +1 -1
- package/dist/theme/theme.types.d.ts +10 -0
- package/dist/theme/theme.types.d.ts.map +1 -1
- package/dist/{timeRange.utils-Dz0fdD_b.js → timeRange.utils-C_oRVExZ.js} +2 -2
- package/dist/{timeRange.utils-Dz0fdD_b.js.map → timeRange.utils-C_oRVExZ.js.map} +1 -1
- package/package.json +2 -2
- package/dist/bars.utils-DJnFf-V0.js +0 -146
- package/dist/bars.utils-DJnFf-V0.js.map +0 -1
- package/dist/index-APU1GD5M.js +0 -166
- package/dist/index-APU1GD5M.js.map +0 -1
- package/dist/index-BsWftigv.js +0 -123
- package/dist/index-BsWftigv.js.map +0 -1
- package/dist/index-CBgU-nlM.js +0 -46
- package/dist/index-Nj7bJ8tg.js +0 -161
- package/dist/index-Nj7bJ8tg.js.map +0 -1
- package/dist/index-h3GKi8po.js +0 -332
- package/dist/index-h3GKi8po.js.map +0 -1
- package/dist/object.utils-D_Zzon-H.js +0 -37
- package/dist/object.utils-D_Zzon-H.js.map +0 -1
- package/dist/pies.utils-Dgs6TAkX.js +0 -73
- package/dist/pies.utils-Dgs6TAkX.js.map +0 -1
package/dist/ColorEditor.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { defineEditor as l } from "@embeddable.com/react";
|
|
2
|
-
import { j as r, A as a, I as i,
|
|
2
|
+
import { j as r, A as a, I as i, v as p, V as u } from "./Color.type.emb-DWdIUAm5.js";
|
|
3
3
|
import { useState as m, useEffect as C } from "react";
|
|
4
4
|
const I = "_colorInputContainer_1o1qe_1", d = "_colorInput_1o1qe_1", s = {
|
|
5
5
|
colorInputContainer: I,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { definePreview as n, defineComponent as t } from "@embeddable.com/react";
|
|
2
|
-
import { V as r } from "./Color.type.emb-
|
|
3
|
-
import { D as i } from "./index-
|
|
4
|
-
import { b as e, C as a } from "./component.inputs.constants-
|
|
2
|
+
import { V as r } from "./Color.type.emb-DWdIUAm5.js";
|
|
3
|
+
import { D as i } from "./index-CpUKjpYd.js";
|
|
4
|
+
import { b as e, C as a } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
5
|
const l = {
|
|
6
6
|
name: "ComparisonPeriodSelectFieldPro",
|
|
7
7
|
label: "Comparison Period Select Field",
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { useTheme as C, definePreview as P, defineComponent as y } from "@embeddable.com/react";
|
|
2
|
-
import { j as l,
|
|
3
|
-
import { u as w, g as V, a as
|
|
4
|
-
import { a as
|
|
5
|
-
import { E as T } from "./EditorCard-
|
|
6
|
-
import { I as x } from "./IconCalendarFilled-
|
|
2
|
+
import { j as l, k as D, V as s } from "./Color.type.emb-DWdIUAm5.js";
|
|
3
|
+
import { u as w, g as V, a as k, b as S } from "./dates.utils-BF32dTLi.js";
|
|
4
|
+
import { a as j, r as F, i as M, b as a } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { E as T } from "./EditorCard-ZXwl5-DV.js";
|
|
6
|
+
import { I as x } from "./IconCalendarFilled-Bl7kPqxG.js";
|
|
7
7
|
const r = (e) => {
|
|
8
8
|
const t = C();
|
|
9
|
-
|
|
9
|
+
j(t);
|
|
10
10
|
const { dayjsLocaleReady: i } = w();
|
|
11
11
|
if (!i)
|
|
12
12
|
return null;
|
|
13
13
|
const { onChange: c, clearable: d, selectedValue: n, showTwoMonths: u } = e, { description: m, placeholder: g, title: p } = F(e), h = (b) => {
|
|
14
|
-
const v =
|
|
14
|
+
const v = S(b);
|
|
15
15
|
c(v);
|
|
16
16
|
}, o = t.defaults.dateRangesOptions, f = V(n, "MMM DD", o), R = t.i18n.language ?? t.formatter.locale;
|
|
17
17
|
return /* @__PURE__ */ l.jsx(T, { title: p, subtitle: m, children: /* @__PURE__ */ l.jsx(
|
|
@@ -23,9 +23,10 @@ const r = (e) => {
|
|
|
23
23
|
placeholder: g,
|
|
24
24
|
displayValue: f,
|
|
25
25
|
numberOfMonths: u ? 2 : 1,
|
|
26
|
-
value:
|
|
26
|
+
value: k(n, o),
|
|
27
27
|
onChange: h,
|
|
28
|
-
submitLabel: M.t("editors.dateRangePicker.apply")
|
|
28
|
+
submitLabel: M.t("editors.dateRangePicker.apply"),
|
|
29
|
+
avoidCollisions: !1
|
|
29
30
|
}
|
|
30
31
|
) });
|
|
31
32
|
}, L = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DateRangePickerCustomPro.js","sources":["../src/components/editors/dates/DateRangePickerCustomPro/index.tsx","../src/components/editors/dates/DateRangePickerCustomPro/DateRangePickerCustomPro.emb.ts"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { DateRange, DateRangePickerField } from '@embeddable.com/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 { i18n, i18nSetup } from '../../../../theme/i18n/i18n';\nimport {\n getDateRangeFromTimeRange,\n getTimeRangeFromDateRange,\n getTimeRangeLabel,\n} from '../dates.utils';\nimport { IconCalendarFilled } from '@tabler/icons-react';\nimport { ChartCardHeaderProps } from '../../../charts/shared/ChartCard/ChartCard';\n\ntype DateRangePickerPresetsProps = {\n onChange: (newDateRange: TimeRange) => void;\n placeholder?: string;\n selectedValue?: TimeRange;\n clearable?: boolean;\n showTwoMonths?: boolean;\n} & ChartCardHeaderProps;\n\nconst DateRangePickerPresets = (props: DateRangePickerPresetsProps) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { dayjsLocaleReady } = useLoadDayjsLocale();\n\n if (!dayjsLocaleReady) {\n return null;\n }\n\n const { onChange, clearable, selectedValue, showTwoMonths } = props;\n\n const { description, placeholder, title } = resolveI18nProps(props);\n\n const handleChange = (newDateRange: DateRange | undefined) => {\n const timeRange: TimeRange = getTimeRangeFromDateRange(newDateRange);\n onChange(timeRange);\n };\n\n const dateRangeOptions = theme.defaults.dateRangesOptions;\n const displayValue = getTimeRangeLabel(selectedValue, 'MMM DD', dateRangeOptions);\n\n const locale = theme.i18n.language ?? theme.formatter.locale;\n\n return (\n <EditorCard title={title} subtitle={description}>\n <DateRangePickerField\n startIcon={IconCalendarFilled}\n locale={locale}\n clearable={clearable}\n placeholder={placeholder}\n displayValue={displayValue}\n numberOfMonths={showTwoMonths ? 2 : 1}\n value={getDateRangeFromTimeRange(selectedValue, dateRangeOptions)}\n onChange={handleChange}\n submitLabel={i18n.t('editors.dateRangePicker.apply')}\n />\n </EditorCard>\n );\n};\n\nexport default DateRangePickerPresets;\n","import {\n defineComponent,\n definePreview,\n EmbeddedComponentMeta,\n Inputs,\n} from '@embeddable.com/react';\nimport { Value } from '@embeddable.com/core';\nimport DateTimeSelectFieldPro from './index';\nimport { inputs } from '../../../component.inputs.constants';\n\nexport const meta = {\n name: 'DateRangePickerCustomPro',\n label: 'Date-Range Picker - Custom',\n category: 'Dropdowns',\n defaultWidth: 300,\n defaultHeight: 120,\n inputs: [\n inputs.title,\n inputs.description,\n { ...inputs.placeholder, defaultValue: 'Select a date-range' },\n inputs.clearable,\n {\n ...inputs.timeRange,\n name: 'selectedValue',\n label: 'Selected value',\n category: 'Pre-configured variables',\n },\n {\n ...inputs.boolean,\n name: 'showTwoMonths',\n label: 'Show two months',\n defaultValue: false,\n category: 'Component Settings',\n },\n ],\n events: [\n {\n name: 'onChange',\n label: 'Selected date-range updated',\n properties: [\n {\n name: 'value',\n label: 'Selected date-range',\n type: 'timeRange',\n },\n ],\n },\n ],\n variables: [\n {\n name: 'date-range value',\n type: 'timeRange',\n defaultValue: Value.noFilter(),\n inputs: ['selectedValue'],\n events: [{ name: 'onChange', property: 'value' }],\n },\n ],\n} as const satisfies EmbeddedComponentMeta;\n\nexport const preview = definePreview(DateTimeSelectFieldPro, {\n onChange: () => null,\n});\n\nexport default defineComponent(DateTimeSelectFieldPro, meta, {\n props: (inputs: Inputs<typeof meta>) => {\n return {\n ...inputs,\n };\n },\n events: {\n onChange: (range) => ({\n value: range ?? Value.noFilter(),\n }),\n },\n});\n"],"names":["DateRangePickerPresets","props","theme","useTheme","i18nSetup","dayjsLocaleReady","useLoadDayjsLocale","onChange","clearable","selectedValue","showTwoMonths","description","placeholder","title","resolveI18nProps","handleChange","newDateRange","timeRange","getTimeRangeFromDateRange","dateRangeOptions","displayValue","getTimeRangeLabel","locale","jsx","EditorCard","DateRangePickerField","IconCalendarFilled","getDateRangeFromTimeRange","i18n","meta","inputs","Value","preview","definePreview","DateTimeSelectFieldPro","DateRangePickerCustomPro_emb","defineComponent","range"],"mappings":";;;;;;AAwBA,MAAMA,IAAyB,CAACC,MAAuC;AACrE,QAAMC,IAAeC,EAAA;AACrB,EAAAC,EAAUF,CAAK;AAEf,QAAM,EAAE,kBAAAG,EAAA,IAAqBC,EAAA;AAE7B,MAAI,CAACD;AACH,WAAO;AAGT,QAAM,EAAE,UAAAE,GAAU,WAAAC,GAAW,eAAAC,GAAe,eAAAC,MAAkBT,GAExD,EAAE,aAAAU,GAAa,aAAAC,GAAa,OAAAC,EAAA,IAAUC,EAAiBb,CAAK,GAE5Dc,IAAe,CAACC,MAAwC;AAC5D,UAAMC,IAAuBC,EAA0BF,CAAY;AACnE,IAAAT,EAASU,CAAS;AAAA,EACpB,GAEME,IAAmBjB,EAAM,SAAS,mBAClCkB,IAAeC,EAAkBZ,GAAe,UAAUU,CAAgB,GAE1EG,IAASpB,EAAM,KAAK,YAAYA,EAAM,UAAU;AAEtD,SACEqB,gBAAAA,EAAAA,IAACC,GAAA,EAAW,OAAAX,GAAc,UAAUF,GAClC,UAAAY,gBAAAA,EAAAA;AAAAA,IAACE;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,MACX,QAAAJ;AAAA,MACA,WAAAd;AAAA,MACA,aAAAI;AAAA,MACA,cAAAQ;AAAA,MACA,gBAAgBV,IAAgB,IAAI;AAAA,MACpC,OAAOiB,EAA0BlB,GAAeU,CAAgB;AAAA,MAChE,UAAUJ;AAAA,MACV,aAAaa,EAAK,EAAE,+BAA+B;AAAA,IAAA;AAAA,EAAA,
|
|
1
|
+
{"version":3,"file":"DateRangePickerCustomPro.js","sources":["../src/components/editors/dates/DateRangePickerCustomPro/index.tsx","../src/components/editors/dates/DateRangePickerCustomPro/DateRangePickerCustomPro.emb.ts"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { DateRange, DateRangePickerField } from '@embeddable.com/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 { i18n, i18nSetup } from '../../../../theme/i18n/i18n';\nimport {\n getDateRangeFromTimeRange,\n getTimeRangeFromDateRange,\n getTimeRangeLabel,\n} from '../dates.utils';\nimport { IconCalendarFilled } from '@tabler/icons-react';\nimport { ChartCardHeaderProps } from '../../../charts/shared/ChartCard/ChartCard';\n\ntype DateRangePickerPresetsProps = {\n onChange: (newDateRange: TimeRange) => void;\n placeholder?: string;\n selectedValue?: TimeRange;\n clearable?: boolean;\n showTwoMonths?: boolean;\n} & ChartCardHeaderProps;\n\nconst DateRangePickerPresets = (props: DateRangePickerPresetsProps) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { dayjsLocaleReady } = useLoadDayjsLocale();\n\n if (!dayjsLocaleReady) {\n return null;\n }\n\n const { onChange, clearable, selectedValue, showTwoMonths } = props;\n\n const { description, placeholder, title } = resolveI18nProps(props);\n\n const handleChange = (newDateRange: DateRange | undefined) => {\n const timeRange: TimeRange = getTimeRangeFromDateRange(newDateRange);\n onChange(timeRange);\n };\n\n const dateRangeOptions = theme.defaults.dateRangesOptions;\n const displayValue = getTimeRangeLabel(selectedValue, 'MMM DD', dateRangeOptions);\n\n const locale = theme.i18n.language ?? theme.formatter.locale;\n\n return (\n <EditorCard title={title} subtitle={description}>\n <DateRangePickerField\n startIcon={IconCalendarFilled}\n locale={locale}\n clearable={clearable}\n placeholder={placeholder}\n displayValue={displayValue}\n numberOfMonths={showTwoMonths ? 2 : 1}\n value={getDateRangeFromTimeRange(selectedValue, dateRangeOptions)}\n onChange={handleChange}\n submitLabel={i18n.t('editors.dateRangePicker.apply')}\n avoidCollisions={false}\n />\n </EditorCard>\n );\n};\n\nexport default DateRangePickerPresets;\n","import {\n defineComponent,\n definePreview,\n EmbeddedComponentMeta,\n Inputs,\n} from '@embeddable.com/react';\nimport { Value } from '@embeddable.com/core';\nimport DateTimeSelectFieldPro from './index';\nimport { inputs } from '../../../component.inputs.constants';\n\nexport const meta = {\n name: 'DateRangePickerCustomPro',\n label: 'Date-Range Picker - Custom',\n category: 'Dropdowns',\n defaultWidth: 300,\n defaultHeight: 120,\n inputs: [\n inputs.title,\n inputs.description,\n { ...inputs.placeholder, defaultValue: 'Select a date-range' },\n inputs.clearable,\n {\n ...inputs.timeRange,\n name: 'selectedValue',\n label: 'Selected value',\n category: 'Pre-configured variables',\n },\n {\n ...inputs.boolean,\n name: 'showTwoMonths',\n label: 'Show two months',\n defaultValue: false,\n category: 'Component Settings',\n },\n ],\n events: [\n {\n name: 'onChange',\n label: 'Selected date-range updated',\n properties: [\n {\n name: 'value',\n label: 'Selected date-range',\n type: 'timeRange',\n },\n ],\n },\n ],\n variables: [\n {\n name: 'date-range value',\n type: 'timeRange',\n defaultValue: Value.noFilter(),\n inputs: ['selectedValue'],\n events: [{ name: 'onChange', property: 'value' }],\n },\n ],\n} as const satisfies EmbeddedComponentMeta;\n\nexport const preview = definePreview(DateTimeSelectFieldPro, {\n onChange: () => null,\n});\n\nexport default defineComponent(DateTimeSelectFieldPro, meta, {\n props: (inputs: Inputs<typeof meta>) => {\n return {\n ...inputs,\n };\n },\n events: {\n onChange: (range) => ({\n value: range ?? Value.noFilter(),\n }),\n },\n});\n"],"names":["DateRangePickerPresets","props","theme","useTheme","i18nSetup","dayjsLocaleReady","useLoadDayjsLocale","onChange","clearable","selectedValue","showTwoMonths","description","placeholder","title","resolveI18nProps","handleChange","newDateRange","timeRange","getTimeRangeFromDateRange","dateRangeOptions","displayValue","getTimeRangeLabel","locale","jsx","EditorCard","DateRangePickerField","IconCalendarFilled","getDateRangeFromTimeRange","i18n","meta","inputs","Value","preview","definePreview","DateTimeSelectFieldPro","DateRangePickerCustomPro_emb","defineComponent","range"],"mappings":";;;;;;AAwBA,MAAMA,IAAyB,CAACC,MAAuC;AACrE,QAAMC,IAAeC,EAAA;AACrB,EAAAC,EAAUF,CAAK;AAEf,QAAM,EAAE,kBAAAG,EAAA,IAAqBC,EAAA;AAE7B,MAAI,CAACD;AACH,WAAO;AAGT,QAAM,EAAE,UAAAE,GAAU,WAAAC,GAAW,eAAAC,GAAe,eAAAC,MAAkBT,GAExD,EAAE,aAAAU,GAAa,aAAAC,GAAa,OAAAC,EAAA,IAAUC,EAAiBb,CAAK,GAE5Dc,IAAe,CAACC,MAAwC;AAC5D,UAAMC,IAAuBC,EAA0BF,CAAY;AACnE,IAAAT,EAASU,CAAS;AAAA,EACpB,GAEME,IAAmBjB,EAAM,SAAS,mBAClCkB,IAAeC,EAAkBZ,GAAe,UAAUU,CAAgB,GAE1EG,IAASpB,EAAM,KAAK,YAAYA,EAAM,UAAU;AAEtD,SACEqB,gBAAAA,EAAAA,IAACC,GAAA,EAAW,OAAAX,GAAc,UAAUF,GAClC,UAAAY,gBAAAA,EAAAA;AAAAA,IAACE;AAAA,IAAA;AAAA,MACC,WAAWC;AAAA,MACX,QAAAJ;AAAA,MACA,WAAAd;AAAA,MACA,aAAAI;AAAA,MACA,cAAAQ;AAAA,MACA,gBAAgBV,IAAgB,IAAI;AAAA,MACpC,OAAOiB,EAA0BlB,GAAeU,CAAgB;AAAA,MAChE,UAAUJ;AAAA,MACV,aAAaa,EAAK,EAAE,+BAA+B;AAAA,MACnD,iBAAiB;AAAA,IAAA;AAAA,EAA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2
|
-
import { V as t } from "./Color.type.emb-
|
|
3
|
-
import { D as n } from "./index-
|
|
4
|
-
import { b as e } from "./component.inputs.constants-
|
|
2
|
+
import { V as t } from "./Color.type.emb-DWdIUAm5.js";
|
|
3
|
+
import { D as n } from "./index-BRX2mrGM.js";
|
|
4
|
+
import { b as e } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
5
|
const r = {
|
|
6
6
|
name: "DateRangeSelectFieldPro",
|
|
7
7
|
label: "Date-Range Picker - Presets",
|
package/dist/DonutChartPro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { V as n, l as a } from "./Color.type.emb-
|
|
1
|
+
import { V as n, l as a } from "./Color.type.emb-DWdIUAm5.js";
|
|
2
2
|
import { definePreview as r, defineComponent as i } from "@embeddable.com/react";
|
|
3
|
-
import { D as o } from "./index-
|
|
4
|
-
import { b as e } from "./component.inputs.constants-
|
|
5
|
-
import { p as t } from "./preview.data.constants-
|
|
3
|
+
import { D as o } from "./index-DZYPPNrI.js";
|
|
4
|
+
import { b as e } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as t } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const m = {
|
|
7
7
|
name: "DonutChartPro",
|
|
8
8
|
label: "Donut Chart",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { D as s } from "./index-
|
|
2
|
-
import { V as t, l as r } from "./Color.type.emb-
|
|
1
|
+
import { D as s } from "./index-EOl5XOZN.js";
|
|
2
|
+
import { V as t, l as r } from "./Color.type.emb-DWdIUAm5.js";
|
|
3
3
|
import { definePreview as o, defineComponent as i } from "@embeddable.com/react";
|
|
4
|
-
import { b as e } from "./component.inputs.constants-
|
|
5
|
-
import { p as n } from "./preview.data.constants-
|
|
4
|
+
import { b as e } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as n } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const l = {
|
|
7
7
|
name: "DonutLabelChartPro",
|
|
8
8
|
label: "Donut Label Chart",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { j as r,
|
|
1
|
+
import { j as r, q as c, r as d, s as m, t as l } from "./Color.type.emb-DWdIUAm5.js";
|
|
2
2
|
import { useTheme as p } from "@embeddable.com/react";
|
|
3
|
-
import { a as x, i as C, I as j } from "./component.inputs.constants-
|
|
3
|
+
import { a as x, i as C, I as j } from "./component.inputs.constants-DO_jX-yc.js";
|
|
4
4
|
const u = "_card_15bw3_1", f = {
|
|
5
5
|
card: u
|
|
6
6
|
}, b = ({
|
|
@@ -29,4 +29,4 @@ const u = "_card_15bw3_1", f = {
|
|
|
29
29
|
export {
|
|
30
30
|
b as E
|
|
31
31
|
};
|
|
32
|
-
//# sourceMappingURL=EditorCard-
|
|
32
|
+
//# sourceMappingURL=EditorCard-ZXwl5-DV.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditorCard-
|
|
1
|
+
{"version":3,"file":"EditorCard-ZXwl5-DV.js","sources":["../src/components/editors/shared/EditorCard/EditorCard.tsx"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { i18n, i18nSetup } from '../../../../theme/i18n/i18n';\nimport styles from './EditorCard.module.css';\nimport { FC } from 'react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { Card, CardContent, CardFeedback, CardHeader } from '@embeddable.com/remarkable-ui';\nimport { IconAlertCircle } from '@tabler/icons-react';\n\ntype EditorCardProps = {\n title?: string;\n subtitle?: string;\n children: React.ReactNode;\n errorMessage?: string;\n};\n\nexport const EditorCard: FC<EditorCardProps> = ({\n title,\n subtitle,\n children,\n errorMessage,\n ...props\n}) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const getDisplay = () => {\n if (errorMessage) {\n return (\n <CardFeedback\n variant=\"error\"\n icon={IconAlertCircle}\n title={i18n.t('editors.errorTitle')}\n message={errorMessage}\n />\n );\n }\n\n return children;\n };\n\n return (\n <Card className={styles.card} {...props}>\n <CardHeader title={title} subtitle={subtitle} />\n <CardContent>{getDisplay()}</CardContent>\n </Card>\n );\n};\n"],"names":["EditorCard","title","subtitle","children","errorMessage","props","theme","useTheme","i18nSetup","getDisplay","jsx","CardFeedback","IconAlertCircle","i18n","Card","styles","CardHeader","CardContent"],"mappings":";;;;;GAeaA,IAAkC,CAAC;AAAA,EAC9C,OAAAC;AAAA,EACA,UAAAC;AAAA,EACA,UAAAC;AAAA,EACA,cAAAC;AAAA,EACA,GAAGC;AACL,MAAM;AACJ,QAAMC,IAAeC,EAAA;AACrB,EAAAC,EAAUF,CAAK;AAEf,QAAMG,IAAa,MACbL,IAEAM,gBAAAA,EAAAA;AAAAA,IAACC;AAAA,IAAA;AAAA,MACC,SAAQ;AAAA,MACR,MAAMC;AAAA,MACN,OAAOC,EAAK,EAAE,oBAAoB;AAAA,MAClC,SAAST;AAAA,IAAA;AAAA,EAAA,IAKRD;AAGT,gCACGW,GAAA,EAAK,WAAWC,EAAO,MAAO,GAAGV,GAChC,UAAA;AAAA,IAAAK,gBAAAA,EAAAA,IAACM,GAAA,EAAW,OAAAf,GAAc,UAAAC,EAAA,CAAoB;AAAA,IAC9CQ,gBAAAA,EAAAA,IAACO,GAAA,EAAa,UAAAR,EAAA,EAAW,CAAE;AAAA,EAAA,GAC7B;AAEJ;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useTheme as T, definePreview as C, defineComponent as F } from "@embeddable.com/react";
|
|
2
|
-
import { j as m, S as k, V as E } from "./Color.type.emb-
|
|
3
|
-
import { c as G, a as P, r as D, b as i } from "./component.inputs.constants-
|
|
2
|
+
import { j as m, S as k, V as E } from "./Color.type.emb-DWdIUAm5.js";
|
|
3
|
+
import { c as G, a as P, r as D, b as i } from "./component.inputs.constants-DO_jX-yc.js";
|
|
4
4
|
import { useMemo as O, useEffect as V } from "react";
|
|
5
|
-
import { E as q } from "./EditorCard-
|
|
5
|
+
import { E as q } from "./EditorCard-ZXwl5-DV.js";
|
|
6
6
|
const a = {
|
|
7
7
|
second: "second",
|
|
8
8
|
minute: "minute",
|
|
@@ -31,28 +31,28 @@ const a = {
|
|
|
31
31
|
return isNaN(r.getTime()) ? null : r;
|
|
32
32
|
}
|
|
33
33
|
return null;
|
|
34
|
-
}, l = (e) => new Date(e.getTime() + 1),
|
|
34
|
+
}, l = (e) => new Date(e.getTime() + 1), o = (e, r, t) => (r.getTime() - e.getTime()) / t;
|
|
35
35
|
function U(e, r, t) {
|
|
36
36
|
if (e > r) return 0;
|
|
37
37
|
switch (t) {
|
|
38
38
|
case a.second:
|
|
39
|
-
return
|
|
39
|
+
return o(e, l(r), 1e3);
|
|
40
40
|
case a.minute:
|
|
41
|
-
return
|
|
41
|
+
return o(e, l(r), 60 * 1e3);
|
|
42
42
|
case a.hour:
|
|
43
|
-
return
|
|
43
|
+
return o(e, l(r), 3600 * 1e3);
|
|
44
44
|
case a.day:
|
|
45
|
-
return
|
|
45
|
+
return o(e, l(r), 1440 * 60 * 1e3);
|
|
46
46
|
case a.week:
|
|
47
|
-
return
|
|
47
|
+
return o(e, l(r), 10080 * 60 * 1e3);
|
|
48
48
|
case a.month:
|
|
49
|
-
return
|
|
49
|
+
return o(e, l(r), 672 * 60 * 60 * 1e3);
|
|
50
50
|
// shortest month
|
|
51
51
|
case a.quarter:
|
|
52
|
-
return
|
|
52
|
+
return o(e, l(r), 2160 * 60 * 60 * 1e3);
|
|
53
53
|
// shortest quarter
|
|
54
54
|
case a.year:
|
|
55
|
-
return
|
|
55
|
+
return o(e, l(r), 365 * 24 * 60 * 60 * 1e3);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
const _ = (e, r, t) => {
|
|
@@ -63,11 +63,11 @@ const _ = (e, r, t) => {
|
|
|
63
63
|
const t = p(e == null ? void 0 : e.from), n = p(e == null ? void 0 : e.to);
|
|
64
64
|
if (!t || !n) return r;
|
|
65
65
|
const s = /* @__PURE__ */ new Set();
|
|
66
|
-
for (const
|
|
67
|
-
const d =
|
|
66
|
+
for (const u of r) {
|
|
67
|
+
const d = u.value;
|
|
68
68
|
_(t, n, d) && s.add(d);
|
|
69
69
|
}
|
|
70
|
-
return r.filter((
|
|
70
|
+
return r.filter((u) => s.has(u.value));
|
|
71
71
|
}, g = (e, r) => {
|
|
72
72
|
var n;
|
|
73
73
|
if (!r)
|
|
@@ -79,7 +79,7 @@ const _ = (e, r, t) => {
|
|
|
79
79
|
}, b = (e) => {
|
|
80
80
|
const r = T();
|
|
81
81
|
P(r);
|
|
82
|
-
const { granularity: t, granularities: n, clearable: s, onChange:
|
|
82
|
+
const { granularity: t, granularities: n, clearable: s, onChange: u } = e, { description: d, placeholder: h, title: v, primaryTimeRange: f } = D(e), S = N(), y = O(() => j(
|
|
83
83
|
f,
|
|
84
84
|
S.filter(
|
|
85
85
|
(c) => n == null ? void 0 : n.includes(c.value)
|
|
@@ -88,9 +88,9 @@ const _ = (e, r, t) => {
|
|
|
88
88
|
V(() => {
|
|
89
89
|
if (t && !y.some((c) => c.value === t)) {
|
|
90
90
|
const c = g(y, t);
|
|
91
|
-
c &&
|
|
91
|
+
c && u(c);
|
|
92
92
|
}
|
|
93
|
-
}, [y, t,
|
|
93
|
+
}, [y, t, u]);
|
|
94
94
|
const w = g(y, t);
|
|
95
95
|
return /* @__PURE__ */ m.jsx(q, { title: v, subtitle: d, children: /* @__PURE__ */ m.jsx(
|
|
96
96
|
k,
|
|
@@ -99,7 +99,8 @@ const _ = (e, r, t) => {
|
|
|
99
99
|
placeholder: h,
|
|
100
100
|
value: w,
|
|
101
101
|
options: y,
|
|
102
|
-
onChange:
|
|
102
|
+
onChange: u,
|
|
103
|
+
avoidCollisions: !1
|
|
103
104
|
}
|
|
104
105
|
) });
|
|
105
106
|
}, B = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GranularitySelectFieldPro.js","sources":["../src/theme/defaults/defaults.GranularityOptions.constants.ts","../src/components/editors/GranularitySelectFieldPro/GranularitySelectFieldPro.utils.ts","../src/components/editors/GranularitySelectFieldPro/index.tsx","../src/components/editors/GranularitySelectFieldPro/GranularitySelectFieldPro.emb.ts"],"sourcesContent":["import { SelectListOptionProps } from '@embeddable.com/remarkable-ui';\n\nexport const Granularity = {\n second: 'second',\n minute: 'minute',\n hour: 'hour',\n day: 'day',\n week: 'week',\n month: 'month',\n quarter: 'quarter',\n year: 'year',\n} as const;\n\nexport type TGranularity = keyof typeof Granularity;\nexport type TGranularityValue = (typeof Granularity)[TGranularity];\n\nexport const defaultGranularitySelectFieldOptions: SelectListOptionProps[] = [\n { value: Granularity.second, label: 'defaults.granularityOptions.second|Second' },\n { value: Granularity.minute, label: 'defaults.granularityOptions.minute|Minute' },\n { value: Granularity.hour, label: 'defaults.granularityOptions.hour|Hour' },\n { value: Granularity.day, label: 'defaults.granularityOptions.day|Day' },\n { value: Granularity.week, label: 'defaults.granularityOptions.week|Week' },\n { value: Granularity.month, label: 'defaults.granularityOptions.month|Month' },\n { value: Granularity.quarter, label: 'defaults.granularityOptions.quarter|Quarter' },\n { value: Granularity.year, label: 'defaults.granularityOptions.year|Year' },\n];\n","import { SelectListOptionProps } from '@embeddable.com/remarkable-ui';\nimport { TimeRange } from '@embeddable.com/core';\nimport {\n defaultGranularitySelectFieldOptions,\n Granularity,\n TGranularity,\n TGranularityValue,\n} from '../../../theme/defaults/defaults.GranularityOptions.constants';\nimport { resolveI18nString } from '../../component.utils';\n\nconst DEFAULT_MIN_BUCKETS = 1;\nconst DEFAULT_MAX_BUCKETS = 100;\n\nexport const getGranularitySelectFieldOptions = (): SelectListOptionProps[] => {\n return defaultGranularitySelectFieldOptions.map((opt) => ({\n ...opt,\n label: resolveI18nString(opt.label),\n }));\n};\n\n// Convert possibly-string timestamps to Date safely.\nconst toDate = (d: unknown): Date | null => {\n if (d instanceof Date) return isNaN(d.getTime()) ? null : d;\n if (typeof d === 'string' || typeof d === 'number') {\n const parsed = new Date(d);\n return isNaN(parsed.getTime()) ? null : parsed;\n }\n return null;\n};\n\n// Inclusive end -> Exclusive end helper (only used for sub-day diffs)\nconst toExclusiveEnd = (endInclusive: Date): Date => new Date(endInclusive.getTime() + 1);\n\nconst bucketCountByUnit = (start: Date, endExclusive: Date, unitMs: number): number => {\n return (endExclusive.getTime() - start.getTime()) / unitMs;\n};\n\n// Bucket counting (treat end as INCLUSIVE)\nfunction bucketCount(start: Date, endInclusive: Date, granularity: TGranularity): number {\n if (start > endInclusive) return 0;\n\n switch (granularity) {\n case Granularity.second:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 1000);\n\n case Granularity.minute:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 60 * 1000);\n\n case Granularity.hour:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 60 * 60 * 1000);\n\n case Granularity.day:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 24 * 60 * 60 * 1000);\n\n case Granularity.week:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 7 * 24 * 60 * 60 * 1000);\n\n case Granularity.month:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 28 * 24 * 60 * 60 * 1000); // shortest month\n\n case Granularity.quarter:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 90 * 24 * 60 * 60 * 1000); // shortest quarter\n\n case Granularity.year:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 365 * 24 * 60 * 60 * 1000); // shortest year\n }\n}\n\nconst isGranularityValid = (\n start: Date,\n endInclusive: Date,\n granularity: TGranularityValue,\n): boolean => {\n const buckets = bucketCount(start, endInclusive, granularity);\n return buckets >= DEFAULT_MIN_BUCKETS && buckets <= DEFAULT_MAX_BUCKETS;\n};\n\nexport const getAvailableGranularityOptionsFromTimeRange = (\n timeRange: TimeRange,\n allOptions: SelectListOptionProps[],\n): SelectListOptionProps[] => {\n if (!timeRange) return allOptions;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const from = toDate((timeRange as any)?.from);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const to = toDate((timeRange as any)?.to);\n\n // If we can’t parse range, don’t hide anything (fail open)\n if (!from || !to) return allOptions;\n\n const validSet = new Set<TGranularityValue>();\n\n for (const opt of allOptions) {\n const g = opt.value as TGranularityValue;\n if (isGranularityValid(from, to, g)) {\n validSet.add(g);\n }\n }\n\n // preserve original UI ordering\n return allOptions.filter((opt) => validSet.has(opt.value as TGranularityValue));\n};\n\nexport const getSafeSelection = (\n availableOptions: SelectListOptionProps[],\n granularity?: string,\n): string | undefined => {\n if (!granularity) {\n return undefined;\n }\n\n if (availableOptions.some((opt) => opt.value === granularity)) {\n return granularity;\n }\n\n const optionToSelect = availableOptions.length > 2 ? 1 : 0;\n\n return availableOptions[optionToSelect]?.value as string;\n};\n","import { useEffect, useMemo } from 'react';\nimport { useTheme } from '@embeddable.com/react';\nimport { SingleSelectField } from '@embeddable.com/remarkable-ui';\nimport { TimeRange } from '@embeddable.com/core';\nimport { Theme } from '../../../theme/theme.types';\nimport { i18nSetup } from '../../../theme/i18n/i18n';\nimport { resolveI18nProps } from '../../component.utils';\nimport { EditorCard } from '../shared/EditorCard/EditorCard';\nimport {\n getAvailableGranularityOptionsFromTimeRange,\n getGranularitySelectFieldOptions,\n getSafeSelection,\n} from './GranularitySelectFieldPro.utils';\nimport { TGranularityValue } from '../../../theme/defaults/defaults.GranularityOptions.constants';\nimport { ChartCardHeaderProps } from '../../charts/shared/ChartCard/ChartCard';\n\ntype GranularitySelectFieldProProps = {\n onChange: (newGranularity: string) => void;\n placeholder?: string;\n primaryTimeRange?: TimeRange;\n granularity?: TGranularityValue;\n granularities?: TGranularityValue[];\n clearable?: boolean;\n} & ChartCardHeaderProps;\n\nconst GranularitySelectFieldPro = (props: GranularitySelectFieldProProps) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { granularity, granularities, clearable, onChange } = props;\n const { description, placeholder, title, primaryTimeRange } = resolveI18nProps(props);\n\n const granularitySelectFieldOptions = getGranularitySelectFieldOptions();\n\n const availableOptions = useMemo(() => {\n return getAvailableGranularityOptionsFromTimeRange(\n primaryTimeRange,\n granularitySelectFieldOptions.filter((opt) =>\n granularities?.includes(opt.value as TGranularityValue),\n ),\n );\n }, [primaryTimeRange, granularities]);\n\n useEffect(() => {\n if (granularity) {\n // Selected granularity is not available\n // Select 1st available option when number of options is =< 2\n // Select 2nd option to avoid when number of options > 2\n if (!availableOptions.some((opt) => opt.value === granularity)) {\n const newGranularity = getSafeSelection(availableOptions, granularity);\n if (newGranularity) {\n onChange(newGranularity);\n }\n }\n }\n }, [availableOptions, granularity, onChange]);\n\n const safeValue = getSafeSelection(availableOptions, granularity);\n\n return (\n <EditorCard title={title} subtitle={description}>\n <SingleSelectField\n clearable={clearable}\n placeholder={placeholder}\n value={safeValue}\n options={availableOptions}\n onChange={onChange}\n />\n </EditorCard>\n );\n};\n\nexport default GranularitySelectFieldPro;\n","import {\n defineComponent,\n definePreview,\n EmbeddedComponentMeta,\n Inputs,\n} from '@embeddable.com/react';\nimport { Value } from '@embeddable.com/core';\nimport { inputs } from '../../component.inputs.constants';\nimport { Granularity } from '../../../theme/defaults/defaults.GranularityOptions.constants';\nimport GranularitySelectFieldPro from './index';\n\nexport const meta = {\n name: 'GranularitySelectFieldPro',\n label: 'Granularity Select Field',\n category: 'Dropdowns',\n defaultWidth: 300,\n defaultHeight: 120,\n inputs: [\n inputs.title,\n inputs.description,\n { ...inputs.placeholder, defaultValue: 'Select a granularity' },\n {\n ...inputs.granularities,\n label: 'Available granularities',\n category: 'Pre-configured variables',\n // Ignore seconds and minutes\n defaultValue: [\n Granularity.hour,\n Granularity.day,\n Granularity.week,\n Granularity.month,\n Granularity.quarter,\n Granularity.year,\n ],\n },\n {\n ...inputs.granularity,\n label: 'Selected granularity',\n category: 'Pre-configured variables',\n },\n {\n ...inputs.timeRange,\n name: 'primaryTimeRange',\n label: 'Primary date-range',\n description:\n 'Connect your primary date-range variable to enable automatic selection of the most appropriate granularity',\n category: 'Pre-configured variables',\n },\n { ...inputs.clearable, defaultValue: false },\n ],\n events: [\n {\n name: 'onChange',\n label: 'Selected granularity updated',\n properties: [\n {\n name: 'value',\n label: 'Selected granularity',\n type: 'granularity',\n },\n ],\n },\n ],\n variables: [\n {\n name: 'granularity value',\n type: 'granularity',\n defaultValue: 'day',\n inputs: ['granularity'],\n events: [{ name: 'onChange', property: 'value' }],\n },\n ],\n} as const satisfies EmbeddedComponentMeta;\n\nexport const preview = definePreview(GranularitySelectFieldPro, {\n granularities: [\n Granularity.second,\n Granularity.minute,\n Granularity.hour,\n Granularity.day,\n Granularity.week,\n Granularity.month,\n Granularity.quarter,\n Granularity.year,\n ],\n onChange: () => null,\n});\n\nexport default defineComponent(GranularitySelectFieldPro, meta, {\n props: (inputs: Inputs<typeof meta>) => {\n return {\n ...inputs,\n };\n },\n events: {\n onChange: (granularity) => ({\n value: granularity ?? Value.noFilter(),\n }),\n },\n});\n"],"names":["Granularity","defaultGranularitySelectFieldOptions","DEFAULT_MIN_BUCKETS","DEFAULT_MAX_BUCKETS","getGranularitySelectFieldOptions","opt","resolveI18nString","toDate","d","parsed","toExclusiveEnd","endInclusive","bucketCountByUnit","start","endExclusive","unitMs","bucketCount","granularity","isGranularityValid","buckets","getAvailableGranularityOptionsFromTimeRange","timeRange","allOptions","from","to","validSet","g","getSafeSelection","availableOptions","optionToSelect","_a","GranularitySelectFieldPro","props","theme","useTheme","i18nSetup","granularities","clearable","onChange","description","placeholder","title","primaryTimeRange","resolveI18nProps","granularitySelectFieldOptions","useMemo","useEffect","newGranularity","safeValue","jsx","EditorCard","SingleSelectField","meta","inputs","preview","definePreview","GranularitySelectFieldPro_emb","defineComponent","Value"],"mappings":";;;;;AAEO,MAAMA,IAAc;AAAA,EACzB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AACR,GAKaC,IAAgE;AAAA,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EAAY;AAAA,IACZA,EAAY;AAAA,EAAA;AAAA,EAEd,UAAU,MAAM;AAClB,CAAC,GAEDwD,IAAeC,EAAgB1B,GAA2BqB,GAAM;AAAA,EAC9D,OAAO,CAACC,OACC;AAAA,IACL,GAAGA;AAAAA,EAAA;AAAA,EAGP,QAAQ;AAAA,IACN,UAAU,CAACpC,OAAiB;AAAA,MAC1B,OAAOA,KAAeyC,EAAM,SAAA;AAAA,IAAS;AAAA,EACvC;AAEJ,CAAC;"}
|
|
1
|
+
{"version":3,"file":"GranularitySelectFieldPro.js","sources":["../src/theme/defaults/defaults.GranularityOptions.constants.ts","../src/components/editors/GranularitySelectFieldPro/GranularitySelectFieldPro.utils.ts","../src/components/editors/GranularitySelectFieldPro/index.tsx","../src/components/editors/GranularitySelectFieldPro/GranularitySelectFieldPro.emb.ts"],"sourcesContent":["import { SelectListOptionProps } from '@embeddable.com/remarkable-ui';\n\nexport const Granularity = {\n second: 'second',\n minute: 'minute',\n hour: 'hour',\n day: 'day',\n week: 'week',\n month: 'month',\n quarter: 'quarter',\n year: 'year',\n} as const;\n\nexport type TGranularity = keyof typeof Granularity;\nexport type TGranularityValue = (typeof Granularity)[TGranularity];\n\nexport const defaultGranularitySelectFieldOptions: SelectListOptionProps[] = [\n { value: Granularity.second, label: 'defaults.granularityOptions.second|Second' },\n { value: Granularity.minute, label: 'defaults.granularityOptions.minute|Minute' },\n { value: Granularity.hour, label: 'defaults.granularityOptions.hour|Hour' },\n { value: Granularity.day, label: 'defaults.granularityOptions.day|Day' },\n { value: Granularity.week, label: 'defaults.granularityOptions.week|Week' },\n { value: Granularity.month, label: 'defaults.granularityOptions.month|Month' },\n { value: Granularity.quarter, label: 'defaults.granularityOptions.quarter|Quarter' },\n { value: Granularity.year, label: 'defaults.granularityOptions.year|Year' },\n];\n","import { SelectListOptionProps } from '@embeddable.com/remarkable-ui';\nimport { TimeRange } from '@embeddable.com/core';\nimport {\n defaultGranularitySelectFieldOptions,\n Granularity,\n TGranularity,\n TGranularityValue,\n} from '../../../theme/defaults/defaults.GranularityOptions.constants';\nimport { resolveI18nString } from '../../component.utils';\n\nconst DEFAULT_MIN_BUCKETS = 1;\nconst DEFAULT_MAX_BUCKETS = 100;\n\nexport const getGranularitySelectFieldOptions = (): SelectListOptionProps[] => {\n return defaultGranularitySelectFieldOptions.map((opt) => ({\n ...opt,\n label: resolveI18nString(opt.label),\n }));\n};\n\n// Convert possibly-string timestamps to Date safely.\nconst toDate = (d: unknown): Date | null => {\n if (d instanceof Date) return isNaN(d.getTime()) ? null : d;\n if (typeof d === 'string' || typeof d === 'number') {\n const parsed = new Date(d);\n return isNaN(parsed.getTime()) ? null : parsed;\n }\n return null;\n};\n\n// Inclusive end -> Exclusive end helper (only used for sub-day diffs)\nconst toExclusiveEnd = (endInclusive: Date): Date => new Date(endInclusive.getTime() + 1);\n\nconst bucketCountByUnit = (start: Date, endExclusive: Date, unitMs: number): number => {\n return (endExclusive.getTime() - start.getTime()) / unitMs;\n};\n\n// Bucket counting (treat end as INCLUSIVE)\nfunction bucketCount(start: Date, endInclusive: Date, granularity: TGranularity): number {\n if (start > endInclusive) return 0;\n\n switch (granularity) {\n case Granularity.second:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 1000);\n\n case Granularity.minute:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 60 * 1000);\n\n case Granularity.hour:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 60 * 60 * 1000);\n\n case Granularity.day:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 24 * 60 * 60 * 1000);\n\n case Granularity.week:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 7 * 24 * 60 * 60 * 1000);\n\n case Granularity.month:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 28 * 24 * 60 * 60 * 1000); // shortest month\n\n case Granularity.quarter:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 90 * 24 * 60 * 60 * 1000); // shortest quarter\n\n case Granularity.year:\n return bucketCountByUnit(start, toExclusiveEnd(endInclusive), 365 * 24 * 60 * 60 * 1000); // shortest year\n }\n}\n\nconst isGranularityValid = (\n start: Date,\n endInclusive: Date,\n granularity: TGranularityValue,\n): boolean => {\n const buckets = bucketCount(start, endInclusive, granularity);\n return buckets >= DEFAULT_MIN_BUCKETS && buckets <= DEFAULT_MAX_BUCKETS;\n};\n\nexport const getAvailableGranularityOptionsFromTimeRange = (\n timeRange: TimeRange,\n allOptions: SelectListOptionProps[],\n): SelectListOptionProps[] => {\n if (!timeRange) return allOptions;\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const from = toDate((timeRange as any)?.from);\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const to = toDate((timeRange as any)?.to);\n\n // If we can’t parse range, don’t hide anything (fail open)\n if (!from || !to) return allOptions;\n\n const validSet = new Set<TGranularityValue>();\n\n for (const opt of allOptions) {\n const g = opt.value as TGranularityValue;\n if (isGranularityValid(from, to, g)) {\n validSet.add(g);\n }\n }\n\n // preserve original UI ordering\n return allOptions.filter((opt) => validSet.has(opt.value as TGranularityValue));\n};\n\nexport const getSafeSelection = (\n availableOptions: SelectListOptionProps[],\n granularity?: string,\n): string | undefined => {\n if (!granularity) {\n return undefined;\n }\n\n if (availableOptions.some((opt) => opt.value === granularity)) {\n return granularity;\n }\n\n const optionToSelect = availableOptions.length > 2 ? 1 : 0;\n\n return availableOptions[optionToSelect]?.value as string;\n};\n","import { useEffect, useMemo } from 'react';\nimport { useTheme } from '@embeddable.com/react';\nimport { SingleSelectField } from '@embeddable.com/remarkable-ui';\nimport { TimeRange } from '@embeddable.com/core';\nimport { Theme } from '../../../theme/theme.types';\nimport { i18nSetup } from '../../../theme/i18n/i18n';\nimport { resolveI18nProps } from '../../component.utils';\nimport { EditorCard } from '../shared/EditorCard/EditorCard';\nimport {\n getAvailableGranularityOptionsFromTimeRange,\n getGranularitySelectFieldOptions,\n getSafeSelection,\n} from './GranularitySelectFieldPro.utils';\nimport { TGranularityValue } from '../../../theme/defaults/defaults.GranularityOptions.constants';\nimport { ChartCardHeaderProps } from '../../charts/shared/ChartCard/ChartCard';\n\ntype GranularitySelectFieldProProps = {\n onChange: (newGranularity: string) => void;\n placeholder?: string;\n primaryTimeRange?: TimeRange;\n granularity?: TGranularityValue;\n granularities?: TGranularityValue[];\n clearable?: boolean;\n} & ChartCardHeaderProps;\n\nconst GranularitySelectFieldPro = (props: GranularitySelectFieldProProps) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { granularity, granularities, clearable, onChange } = props;\n const { description, placeholder, title, primaryTimeRange } = resolveI18nProps(props);\n\n const granularitySelectFieldOptions = getGranularitySelectFieldOptions();\n\n const availableOptions = useMemo(() => {\n return getAvailableGranularityOptionsFromTimeRange(\n primaryTimeRange,\n granularitySelectFieldOptions.filter((opt) =>\n granularities?.includes(opt.value as TGranularityValue),\n ),\n );\n }, [primaryTimeRange, granularities]);\n\n useEffect(() => {\n if (granularity) {\n // Selected granularity is not available\n // Select 1st available option when number of options is =< 2\n // Select 2nd option to avoid when number of options > 2\n if (!availableOptions.some((opt) => opt.value === granularity)) {\n const newGranularity = getSafeSelection(availableOptions, granularity);\n if (newGranularity) {\n onChange(newGranularity);\n }\n }\n }\n }, [availableOptions, granularity, onChange]);\n\n const safeValue = getSafeSelection(availableOptions, granularity);\n\n return (\n <EditorCard title={title} subtitle={description}>\n <SingleSelectField\n clearable={clearable}\n placeholder={placeholder}\n value={safeValue}\n options={availableOptions}\n onChange={onChange}\n avoidCollisions={false}\n />\n </EditorCard>\n );\n};\n\nexport default GranularitySelectFieldPro;\n","import {\n defineComponent,\n definePreview,\n EmbeddedComponentMeta,\n Inputs,\n} from '@embeddable.com/react';\nimport { Value } from '@embeddable.com/core';\nimport { inputs } from '../../component.inputs.constants';\nimport { Granularity } from '../../../theme/defaults/defaults.GranularityOptions.constants';\nimport GranularitySelectFieldPro from './index';\n\nexport const meta = {\n name: 'GranularitySelectFieldPro',\n label: 'Granularity Select Field',\n category: 'Dropdowns',\n defaultWidth: 300,\n defaultHeight: 120,\n inputs: [\n inputs.title,\n inputs.description,\n { ...inputs.placeholder, defaultValue: 'Select a granularity' },\n {\n ...inputs.granularities,\n label: 'Available granularities',\n category: 'Pre-configured variables',\n // Ignore seconds and minutes\n defaultValue: [\n Granularity.hour,\n Granularity.day,\n Granularity.week,\n Granularity.month,\n Granularity.quarter,\n Granularity.year,\n ],\n },\n {\n ...inputs.granularity,\n label: 'Selected granularity',\n category: 'Pre-configured variables',\n },\n {\n ...inputs.timeRange,\n name: 'primaryTimeRange',\n label: 'Primary date-range',\n description:\n 'Connect your primary date-range variable to enable automatic selection of the most appropriate granularity',\n category: 'Pre-configured variables',\n },\n { ...inputs.clearable, defaultValue: false },\n ],\n events: [\n {\n name: 'onChange',\n label: 'Selected granularity updated',\n properties: [\n {\n name: 'value',\n label: 'Selected granularity',\n type: 'granularity',\n },\n ],\n },\n ],\n variables: [\n {\n name: 'granularity value',\n type: 'granularity',\n defaultValue: 'day',\n inputs: ['granularity'],\n events: [{ name: 'onChange', property: 'value' }],\n },\n ],\n} as const satisfies EmbeddedComponentMeta;\n\nexport const preview = definePreview(GranularitySelectFieldPro, {\n granularities: [\n Granularity.second,\n Granularity.minute,\n Granularity.hour,\n Granularity.day,\n Granularity.week,\n Granularity.month,\n Granularity.quarter,\n Granularity.year,\n ],\n onChange: () => null,\n});\n\nexport default defineComponent(GranularitySelectFieldPro, meta, {\n props: (inputs: Inputs<typeof meta>) => {\n return {\n ...inputs,\n };\n },\n events: {\n onChange: (granularity) => ({\n value: granularity ?? Value.noFilter(),\n }),\n },\n});\n"],"names":["Granularity","defaultGranularitySelectFieldOptions","DEFAULT_MIN_BUCKETS","DEFAULT_MAX_BUCKETS","getGranularitySelectFieldOptions","opt","resolveI18nString","toDate","d","parsed","toExclusiveEnd","endInclusive","bucketCountByUnit","start","endExclusive","unitMs","bucketCount","granularity","isGranularityValid","buckets","getAvailableGranularityOptionsFromTimeRange","timeRange","allOptions","from","to","validSet","g","getSafeSelection","availableOptions","optionToSelect","_a","GranularitySelectFieldPro","props","theme","useTheme","i18nSetup","granularities","clearable","onChange","description","placeholder","title","primaryTimeRange","resolveI18nProps","granularitySelectFieldOptions","useMemo","useEffect","newGranularity","safeValue","jsx","EditorCard","SingleSelectField","meta","inputs","preview","definePreview","GranularitySelectFieldPro_emb","defineComponent","Value"],"mappings":";;;;;AAEO,MAAMA,IAAc;AAAA,EACzB,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,MAAM;AAAA,EACN,KAAK;AAAA,EACL,MAAM;AAAA,EACN,OAAO;AAAA,EACP,SAAS;AAAA,EACT,MAAM;AACR,GAKaC,IAAgE;AAAA,EAC3E,EAAE,OAAOD,EAAY,QAAQ,OAAO,4CAAA;AAAA,EACpC,EAAE,OAAOA,EAAY,QAAQ,OAAO,4CAAA;AAAA,EACpC,EAAE,OAAOA,EAAY,MAAM,OAAO,wCAAA;AAAA,EAClC,EAAE,OAAOA,EAAY,KAAK,OAAO,sCAAA;AAAA,EACjC,EAAE,OAAOA,EAAY,MAAM,OAAO,wCAAA;AAAA,EAClC,EAAE,OAAOA,EAAY,OAAO,OAAO,0CAAA;AAAA,EACnC,EAAE,OAAOA,EAAY,SAAS,OAAO,8CAAA;AAAA,EACrC,EAAE,OAAOA,EAAY,MAAM,OAAO,wCAAA;AACpC,GCfME,IAAsB,GACtBC,IAAsB,KAEfC,IAAmC,MACvCH,EAAqC,IAAI,CAACI,OAAS;AAAA,EACxD,GAAGA;AAAA,EACH,OAAOC,EAAkBD,EAAI,KAAK;AAAA,EAClC,GAIEE,IAAS,CAACC,MAA4B;AAC1C,MAAIA,aAAa,KAAM,QAAO,MAAMA,EAAE,QAAA,CAAS,IAAI,OAAOA;AAC1D,MAAI,OAAOA,KAAM,YAAY,OAAOA,KAAM,UAAU;AAClD,UAAMC,IAAS,IAAI,KAAKD,CAAC;AACzB,WAAO,MAAMC,EAAO,QAAA,CAAS,IAAI,OAAOA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AAA,UACE,MAAM;AAAA,UACN,OAAO;AAAA,UACP,MAAM;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EAEF,WAAW;AAAA,IACT;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,cAAc;AAAA,MACd,QAAQ,CAAC,aAAa;AAAA,MACtB,QAAQ,CAAC,EAAE,MAAM,YAAY,UAAU,SAAS;AAAA,IAAA;AAAA,EAClD;AAEJ,GAEaC,IAAUC,EAAcxB,GAA2B;AAAA,EAC9D,eAAe;AAAA,IACb/B,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,IACZA,EAAY;AAAA,EAAA;AAAA,EAEd,UAAU,MAAM;AAClB,CAAC,GAEDwD,IAAeC,EAAgB1B,GAA2BqB,GAAM;AAAA,EAC9D,OAAO,CAACC,OACC;AAAA,IACL,GAAGA;AAAAA,EAAA;AAAA,EAGP,QAAQ;AAAA,IACN,UAAU,CAACpC,OAAiB;AAAA,MAC1B,OAAOA,KAAeyC,EAAM,SAAA;AAAA,IAAS;AAAA,EACvC;AAEJ,CAAC;"}
|
package/dist/HeatMapPro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { g as a, l as i } from "./Color.type.emb-
|
|
1
|
+
import { g as a, l as i } from "./Color.type.emb-DWdIUAm5.js";
|
|
2
2
|
import { definePreview as r, defineComponent as l } from "@embeddable.com/react";
|
|
3
|
-
import { H as n } from "./index-
|
|
4
|
-
import { b as e } from "./component.inputs.constants-
|
|
5
|
-
import { p as t } from "./preview.data.constants-
|
|
3
|
+
import { H as n } from "./index-BSK_5Rq3.js";
|
|
4
|
+
import { b as e } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as t } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const m = {
|
|
7
7
|
name: "HeatMapPro",
|
|
8
8
|
label: "Heat Map",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { i as a } from "./Color.type.emb-DWdIUAm5.js";
|
|
2
2
|
/**
|
|
3
3
|
* @license @tabler/icons-react v3.36.1 - MIT
|
|
4
4
|
*
|
|
@@ -9,4 +9,4 @@ const l = [["path", { d: "M16 2a1 1 0 0 1 .993 .883l.007 .117v1h1a3 3 0 0 1 2.99
|
|
|
9
9
|
export {
|
|
10
10
|
v as I
|
|
11
11
|
};
|
|
12
|
-
//# sourceMappingURL=IconCalendarFilled-
|
|
12
|
+
//# sourceMappingURL=IconCalendarFilled-Bl7kPqxG.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconCalendarFilled-
|
|
1
|
+
{"version":3,"file":"IconCalendarFilled-Bl7kPqxG.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconCalendarFilled.mjs"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.36.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\": \"M16 2a1 1 0 0 1 .993 .883l.007 .117v1h1a3 3 0 0 1 2.995 2.824l.005 .176v12a3 3 0 0 1 -2.824 2.995l-.176 .005h-12a3 3 0 0 1 -2.995 -2.824l-.005 -.176v-12a3 3 0 0 1 2.824 -2.995l.176 -.005h1v-1a1 1 0 0 1 1.993 -.117l.007 .117v1h6v-1a1 1 0 0 1 1 -1zm3 7h-14v9.625c0 .705 .386 1.286 .883 1.366l.117 .009h12c.513 0 .936 -.53 .993 -1.215l.007 -.16v-9.625z\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M12 12a1 1 0 0 1 .993 .883l.007 .117v3a1 1 0 0 1 -1.993 .117l-.007 -.117v-2a1 1 0 0 1 -.117 -1.993l.117 -.007h1z\", \"key\": \"svg-1\" }]];\nconst IconCalendarFilled = createReactComponent(\"filled\", \"calendar-filled\", \"CalendarFilled\", __iconNode);\n\nexport { __iconNode, IconCalendarFilled as default };\n//# sourceMappingURL=IconCalendarFilled.mjs.map\n"],"names":["__iconNode","IconCalendarFilled","createReactComponent"],"mappings":";AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AASA,MAAMA,IAAa,CAAC,CAAC,QAAQ,EAAE,GAAK,iWAAiW,KAAO,QAAO,CAAE,GAAG,CAAC,QAAQ,EAAE,GAAK,oHAAoH,KAAO,QAAO,CAAE,CAAC,GACviBC,IAAqBC,EAAqB,UAAU,mBAAmB,kBAAkBF,CAAU;","x_google_ignoreList":[0]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { definePreview as s, defineComponent as l } from "@embeddable.com/react";
|
|
2
|
-
import { K as t } from "./index-
|
|
3
|
-
import { l as i } from "./Color.type.emb-
|
|
4
|
-
import { b as a } from "./component.inputs.constants-
|
|
5
|
-
import { p as o } from "./preview.data.constants-
|
|
2
|
+
import { K as t } from "./index-CzM9TqMe.js";
|
|
3
|
+
import { l as i } from "./Color.type.emb-DWdIUAm5.js";
|
|
4
|
+
import { b as a } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as o } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const p = {
|
|
7
7
|
name: "KpiChartNumberComparisonPro",
|
|
8
8
|
label: "Kpi Chart - Number Comparison",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { definePreview as o, defineComponent as s } from "@embeddable.com/react";
|
|
2
|
-
import { K as a } from "./index
|
|
3
|
-
import { l as m } from "./Color.type.emb-
|
|
4
|
-
import { b as e } from "./component.inputs.constants-
|
|
5
|
-
import { p as t } from "./preview.data.constants-
|
|
2
|
+
import { K as a } from "./index-0eDJ_Ho5.js";
|
|
3
|
+
import { l as m } from "./Color.type.emb-DWdIUAm5.js";
|
|
4
|
+
import { b as e } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as t } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const i = {
|
|
7
7
|
name: "KpiChartNumberPro",
|
|
8
8
|
label: "Kpi Chart - Number",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { definePreview as d, defineComponent as u } from "@embeddable.com/react";
|
|
2
|
-
import { L as l } from "./index-
|
|
3
|
-
import { V as c, l as t } from "./Color.type.emb-
|
|
4
|
-
import { b as e, s as i } from "./component.inputs.constants-
|
|
5
|
-
import { p as n } from "./preview.data.constants-
|
|
2
|
+
import { L as l } from "./index-DDeRZxp1.js";
|
|
3
|
+
import { V as c, l as t } from "./Color.type.emb-DWdIUAm5.js";
|
|
4
|
+
import { b as e, s as i } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as n } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const g = {
|
|
7
7
|
name: "LineChartComparisonDefaultPro",
|
|
8
8
|
label: "Line Chart Comparison - Default",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { definePreview as l, defineComponent as o } from "@embeddable.com/react";
|
|
2
|
-
import { L as n } from "./index-
|
|
3
|
-
import { V as t, l as r } from "./Color.type.emb-
|
|
4
|
-
import { b as e, s } from "./component.inputs.constants-
|
|
5
|
-
import { p as i } from "./preview.data.constants-
|
|
2
|
+
import { L as n } from "./index-DMtpdR9I.js";
|
|
3
|
+
import { V as t, l as r } from "./Color.type.emb-DWdIUAm5.js";
|
|
4
|
+
import { b as e, s } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as i } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const m = {
|
|
7
7
|
name: "LineChartDefaultPro",
|
|
8
8
|
label: "Line Chart - Default",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { definePreview as s, defineComponent as r } from "@embeddable.com/react";
|
|
2
|
-
import { L as o } from "./index-
|
|
3
|
-
import { V as a, l as t } from "./Color.type.emb-
|
|
4
|
-
import { b as e } from "./component.inputs.constants-
|
|
5
|
-
import { p as n } from "./preview.data.constants-
|
|
2
|
+
import { L as o } from "./index-Cj1Zuh74.js";
|
|
3
|
+
import { V as a, l as t } from "./Color.type.emb-DWdIUAm5.js";
|
|
4
|
+
import { b as e } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as n } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const l = {
|
|
7
7
|
name: "LineChartGroupedPro",
|
|
8
8
|
label: "Line Chart - Grouped",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { definePreview as d, defineComponent as u } from "@embeddable.com/react";
|
|
2
|
-
import { V as t, l as m } from "./Color.type.emb-
|
|
3
|
-
import { M as p, a as o } from "./index-
|
|
4
|
-
import { b as a } from "./component.inputs.constants-
|
|
5
|
-
import { p as l } from "./preview.data.constants-
|
|
2
|
+
import { V as t, l as m } from "./Color.type.emb-DWdIUAm5.js";
|
|
3
|
+
import { M as p, a as o } from "./index-DLT2A69c.js";
|
|
4
|
+
import { b as a } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as l } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const c = {
|
|
7
7
|
name: "MultiSelectFieldPro",
|
|
8
8
|
label: "Multi Select Field",
|
package/dist/PieChartPro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { V as t, l as o } from "./Color.type.emb-
|
|
1
|
+
import { V as t, l as o } from "./Color.type.emb-DWdIUAm5.js";
|
|
2
2
|
import { definePreview as r, defineComponent as n } from "@embeddable.com/react";
|
|
3
|
-
import { P as a } from "./index-
|
|
4
|
-
import { b as e } from "./component.inputs.constants-
|
|
5
|
-
import { p as i } from "./preview.data.constants-
|
|
3
|
+
import { P as a } from "./index-BRuc7lF2.js";
|
|
4
|
+
import { b as e } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as i } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const m = {
|
|
7
7
|
name: "PieChartPro",
|
|
8
8
|
label: "Pie Chart",
|
package/dist/PivotTablePro.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { l as a } from "./Color.type.emb-
|
|
1
|
+
import { l as a } from "./Color.type.emb-DWdIUAm5.js";
|
|
2
2
|
import { definePreview as i, defineComponent as l } from "@embeddable.com/react";
|
|
3
|
-
import { P as s } from "./index-
|
|
4
|
-
import { b as e, s as n } from "./component.inputs.constants-
|
|
5
|
-
import { p as t } from "./preview.data.constants-
|
|
3
|
+
import { P as s } from "./index-s4oA7Iyp.js";
|
|
4
|
+
import { b as e, s as n } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as t } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const m = {
|
|
7
7
|
name: "PivotTablePro",
|
|
8
8
|
label: "Pivot Table",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { definePreview as d, defineComponent as m } from "@embeddable.com/react";
|
|
2
|
-
import { V as o, l as u } from "./Color.type.emb-
|
|
3
|
-
import { M as c, S as i } from "./index-
|
|
4
|
-
import { b as a } from "./component.inputs.constants-
|
|
5
|
-
import { p as l } from "./preview.data.constants-
|
|
2
|
+
import { V as o, l as u } from "./Color.type.emb-DWdIUAm5.js";
|
|
3
|
+
import { M as c, S as i } from "./index-Rxsr4tZ-.js";
|
|
4
|
+
import { b as a } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as l } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const p = {
|
|
7
7
|
name: "SingleSelectFieldPro",
|
|
8
8
|
label: "Single Select Field",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { V as D, l, m as b } from "./Color.type.emb-
|
|
1
|
+
import { V as D, l, m as b } from "./Color.type.emb-DWdIUAm5.js";
|
|
2
2
|
import { definePreview as w, defineComponent as M } from "@embeddable.com/react";
|
|
3
|
-
import { T as p } from "./index-
|
|
4
|
-
import { b as i, s as r } from "./component.inputs.constants-
|
|
5
|
-
import { p as s } from "./preview.data.constants-
|
|
3
|
+
import { T as p } from "./index-Cn_Rs8nk.js";
|
|
4
|
+
import { b as i, s as r } from "./component.inputs.constants-DO_jX-yc.js";
|
|
5
|
+
import { p as s } from "./preview.data.constants-CXMriS2F.js";
|
|
6
6
|
const h = {
|
|
7
7
|
name: "TableChartPaginated",
|
|
8
8
|
label: "Table Chart - Paginated",
|
package/dist/TableScrollable.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { j as N,
|
|
1
|
+
import { j as N, R as ie, V as se, l as F, m as ue } from "./Color.type.emb-DWdIUAm5.js";
|
|
2
2
|
import { useTheme as le, definePreview as ce, defineComponent as fe } from "@embeddable.com/react";
|
|
3
|
-
import { a as de, r as me, i as pe, b as w, s as M } from "./component.inputs.constants-
|
|
4
|
-
import { C as ge } from "./ChartCard-
|
|
3
|
+
import { a as de, r as me, i as pe, b as w, s as M } from "./component.inputs.constants-DO_jX-yc.js";
|
|
4
|
+
import { C as ge } from "./ChartCard-BHPN4_tz.js";
|
|
5
5
|
import { useState as z, useRef as R, useEffect as k, useCallback as he } from "react";
|
|
6
|
-
import { b as be, c as Ee } from "./tables.utils-
|
|
7
|
-
import { p as x } from "./preview.data.constants-
|
|
8
|
-
const
|
|
9
|
-
function
|
|
6
|
+
import { b as be, c as Ee } from "./tables.utils-DMLGNJ4g.js";
|
|
7
|
+
import { p as x } from "./preview.data.constants-CXMriS2F.js";
|
|
8
|
+
const U = 50, { getOwnPropertyNames: we, getOwnPropertySymbols: ye } = Object, { hasOwnProperty: je } = Object.prototype;
|
|
9
|
+
function P(n, e) {
|
|
10
10
|
return function(r, a, s) {
|
|
11
11
|
return n(r, a, s) && e(r, a, s);
|
|
12
12
|
};
|
|
@@ -147,13 +147,13 @@ function S(n, e) {
|
|
|
147
147
|
return !1;
|
|
148
148
|
return !0;
|
|
149
149
|
}
|
|
150
|
-
function
|
|
150
|
+
function Pe(n, e) {
|
|
151
151
|
return n.hostname === e.hostname && n.pathname === e.pathname && n.protocol === e.protocol && n.port === e.port && n.hash === e.hash && n.username === e.username && n.password === e.password;
|
|
152
152
|
}
|
|
153
153
|
function Q(n, e, t, r) {
|
|
154
154
|
return (r === De || r === qe || r === Ae) && (n.$$typeof || e.$$typeof) ? !0 : Ce(e, r) && t.equals(n[r], e[r], r, r, n, e, t);
|
|
155
155
|
}
|
|
156
|
-
const
|
|
156
|
+
const Ue = Object.prototype.toString;
|
|
157
157
|
function _e(n) {
|
|
158
158
|
const e = Ne(n), { areArraysEqual: t, areDatesEqual: r, areFunctionsEqual: a, areMapsEqual: s, areNumbersEqual: u, areObjectsEqual: o, areRegExpsEqual: c, areSetsEqual: p, getUnsupportedCustomComparator: l } = n;
|
|
159
159
|
return function(i, f, d) {
|
|
@@ -185,7 +185,7 @@ function _e(n) {
|
|
|
185
185
|
return !1;
|
|
186
186
|
if (Array.isArray(i))
|
|
187
187
|
return t(i, f, d);
|
|
188
|
-
const E =
|
|
188
|
+
const E = Ue.call(i), A = e[E];
|
|
189
189
|
if (A)
|
|
190
190
|
return A(i, f, d);
|
|
191
191
|
const I = l && l(i, f, d, E);
|
|
@@ -200,14 +200,14 @@ function Be({ circular: n, createCustomConfig: e, strict: t }) {
|
|
|
200
200
|
areDatesEqual: Re,
|
|
201
201
|
areErrorsEqual: Le,
|
|
202
202
|
areFunctionsEqual: xe,
|
|
203
|
-
areMapsEqual: t ?
|
|
203
|
+
areMapsEqual: t ? P(K, O) : K,
|
|
204
204
|
areNumbersEqual: C,
|
|
205
205
|
areObjectsEqual: t ? O : Se,
|
|
206
206
|
arePrimitiveWrappersEqual: ve,
|
|
207
207
|
areRegExpsEqual: ke,
|
|
208
|
-
areSetsEqual: t ?
|
|
209
|
-
areTypedArraysEqual: t ?
|
|
210
|
-
areUrlsEqual:
|
|
208
|
+
areSetsEqual: t ? P(H, O) : H,
|
|
209
|
+
areTypedArraysEqual: t ? P(S, O) : S,
|
|
210
|
+
areUrlsEqual: Pe,
|
|
211
211
|
getUnsupportedCustomComparator: void 0
|
|
212
212
|
};
|
|
213
213
|
if (e && (r = Object.assign({}, r, e(r))), n) {
|
|
@@ -391,7 +391,7 @@ const X = (n) => {
|
|
|
391
391
|
l.isLoading || D({ page: ((m == null ? void 0 : m.page) ?? 0) + 1 });
|
|
392
392
|
}, re = (b) => {
|
|
393
393
|
q.current = !0, D({ sort: b, page: 0 });
|
|
394
|
-
}, te = (l == null ? void 0 : l.data) && l.data.length ===
|
|
394
|
+
}, te = (l == null ? void 0 : l.data) && l.data.length === U, oe = !!(l != null && l.isLoading || g != null && g.isLoading), ae = (l == null ? void 0 : l.isLoading) && !q.current;
|
|
395
395
|
return /* @__PURE__ */ N.jsx(
|
|
396
396
|
ge,
|
|
397
397
|
{
|
|
@@ -512,8 +512,8 @@ const X = (n) => {
|
|
|
512
512
|
results: F({
|
|
513
513
|
from: n.dataset,
|
|
514
514
|
select: u,
|
|
515
|
-
offset: (e != null && e.page ? e.page : J.page) *
|
|
516
|
-
limit:
|
|
515
|
+
offset: (e != null && e.page ? e.page : J.page) * U,
|
|
516
|
+
limit: U,
|
|
517
517
|
orderBy: a
|
|
518
518
|
}),
|
|
519
519
|
allResults: e != null && e.isLoadingDownloadData ? F({
|