@embeddable.com/remarkable-pro 0.0.22 → 0.0.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (115) hide show
  1. package/dist/BarChartDefaultHorizontalPro.js +4 -4
  2. package/dist/BarChartDefaultPro.js +4 -4
  3. package/dist/BarChartGroupedHorizontalPro.js +4 -4
  4. package/dist/BarChartGroupedPro.js +4 -4
  5. package/dist/BarChartStackedHorizontalPro.js +4 -4
  6. package/dist/BarChartStackedPro.js +4 -4
  7. package/dist/{ChartCard-B3B1rFYh.js → ChartCard-BHPN4_tz.js} +22 -22
  8. package/dist/{ChartCard-B3B1rFYh.js.map → ChartCard-BHPN4_tz.js.map} +1 -1
  9. package/dist/{Color.type.emb-sebikYGW.js → Color.type.emb-DWdIUAm5.js} +2600 -2590
  10. package/dist/{Color.type.emb-sebikYGW.js.map → Color.type.emb-DWdIUAm5.js.map} +1 -1
  11. package/dist/ColorEditor.js +1 -1
  12. package/dist/ComparisonPeriodSelectFieldPro.js +3 -3
  13. package/dist/DateRangePickerCustomPro.js +10 -9
  14. package/dist/DateRangePickerCustomPro.js.map +1 -1
  15. package/dist/DateRangeSelectFieldPro.js +3 -3
  16. package/dist/DonutChartPro.js +4 -4
  17. package/dist/DonutLabelChartPro.js +4 -4
  18. package/dist/{EditorCard-DpSCsmZJ.js → EditorCard-ZXwl5-DV.js} +3 -3
  19. package/dist/{EditorCard-DpSCsmZJ.js.map → EditorCard-ZXwl5-DV.js.map} +1 -1
  20. package/dist/GranularitySelectFieldPro.js +20 -19
  21. package/dist/GranularitySelectFieldPro.js.map +1 -1
  22. package/dist/HeatMapPro.js +4 -4
  23. package/dist/{IconCalendarFilled-Bfm3jkzE.js → IconCalendarFilled-Bl7kPqxG.js} +2 -2
  24. package/dist/{IconCalendarFilled-Bfm3jkzE.js.map → IconCalendarFilled-Bl7kPqxG.js.map} +1 -1
  25. package/dist/KpiChartNumberComparisonPro.js +4 -4
  26. package/dist/KpiChartNumberPro.js +4 -4
  27. package/dist/LineChartComparisonDefaultPro.js +4 -4
  28. package/dist/LineChartDefaultPro.js +4 -4
  29. package/dist/LineChartGroupedPro.js +4 -4
  30. package/dist/MultiSelectFieldPro.js +4 -4
  31. package/dist/PieChartPro.js +4 -4
  32. package/dist/PivotTablePro.js +4 -4
  33. package/dist/SingleSelectFieldPro.js +4 -4
  34. package/dist/TableChartPaginated.js +4 -4
  35. package/dist/TableScrollable.js +17 -17
  36. package/dist/TableScrollable.js.map +1 -1
  37. package/dist/{bars.utils-jvwOEGnf.js → bars.utils-Buw9Xk8l.js} +38 -38
  38. package/dist/bars.utils-Buw9Xk8l.js.map +1 -0
  39. package/dist/{charts.utils-Q9qc_Fq5.js → charts.utils-lvlkFPJk.js} +321 -321
  40. package/dist/charts.utils-lvlkFPJk.js.map +1 -0
  41. package/dist/{component.inputs.constants-Ds7YpNhT.js → component.inputs.constants-DO_jX-yc.js} +43 -43
  42. package/dist/{component.inputs.constants-Ds7YpNhT.js.map → component.inputs.constants-DO_jX-yc.js.map} +1 -1
  43. package/dist/components/charts/tables/TableScrollable/TableScrollable.utils.d.ts +1 -1
  44. package/dist/components/editors/ComparisonPeriodSelectFieldPro/index.d.ts.map +1 -1
  45. package/dist/components/editors/GranularitySelectFieldPro/index.d.ts.map +1 -1
  46. package/dist/components/editors/MultiSelectFieldPro/index.d.ts.map +1 -1
  47. package/dist/components/editors/SingleSelectFieldPro/index.d.ts.map +1 -1
  48. package/dist/components/editors/dates/DateRangePickerCustomPro/index.d.ts.map +1 -1
  49. package/dist/components/editors/dates/DateRangePickerPresetsPro/index.d.ts.map +1 -1
  50. package/dist/embeddable-components.json +24 -24
  51. package/dist/embeddable-theme-0137e.js +3 -3
  52. package/dist/{formatter.utils-tS15PLXn.js → formatter.utils-CBCUxVH8.js} +2 -2
  53. package/dist/{formatter.utils-tS15PLXn.js.map → formatter.utils-CBCUxVH8.js.map} +1 -1
  54. package/dist/{index--Dbq1zrZ.js → index-0eDJ_Ho5.js} +5 -5
  55. package/dist/{index--Dbq1zrZ.js.map → index-0eDJ_Ho5.js.map} +1 -1
  56. package/dist/{index-Nj7bJ8tg.js → index-0rHy8NOt.js} +5 -5
  57. package/dist/index-0rHy8NOt.js.map +1 -0
  58. package/dist/index-BRX2mrGM.js +124 -0
  59. package/dist/index-BRX2mrGM.js.map +1 -0
  60. package/dist/{index-t7YCtFvf.js → index-BSK_5Rq3.js} +5 -5
  61. package/dist/{index-t7YCtFvf.js.map → index-BSK_5Rq3.js.map} +1 -1
  62. package/dist/{index-BNZ1R6AK.js → index-BXQNwmFh.js} +5 -5
  63. package/dist/{index-BNZ1R6AK.js.map → index-BXQNwmFh.js.map} +1 -1
  64. package/dist/{index-KxvT6RdK.js → index-BgYPax7r.js} +5 -5
  65. package/dist/{index-KxvT6RdK.js.map → index-BgYPax7r.js.map} +1 -1
  66. package/dist/{index-dv4kCcao.js → index-CBcVtvlk.js} +5 -5
  67. package/dist/{index-dv4kCcao.js.map → index-CBcVtvlk.js.map} +1 -1
  68. package/dist/{index-DbizaE6y.js → index-CJkiIKmB.js} +6 -6
  69. package/dist/{index-DbizaE6y.js.map → index-CJkiIKmB.js.map} +1 -1
  70. package/dist/{index-9_2gSWFU.js → index-CiAXHm8i.js} +5 -5
  71. package/dist/{index-9_2gSWFU.js.map → index-CiAXHm8i.js.map} +1 -1
  72. package/dist/{index-CCdQwMMN.js → index-CpUKjpYd.js} +11 -10
  73. package/dist/{index-CCdQwMMN.js.map → index-CpUKjpYd.js.map} +1 -1
  74. package/dist/{index-BUk63KEk.js → index-CzM9TqMe.js} +6 -6
  75. package/dist/{index-BUk63KEk.js.map → index-CzM9TqMe.js.map} +1 -1
  76. package/dist/{index-C0pj3lvE.js → index-D2oLkkYS.js} +5 -5
  77. package/dist/{index-C0pj3lvE.js.map → index-D2oLkkYS.js.map} +1 -1
  78. package/dist/{index-APU1GD5M.js → index-DEsLQa4J.js} +5 -5
  79. package/dist/index-DEsLQa4J.js.map +1 -0
  80. package/dist/{index-BDRs__KW.js → index-DHHYE6GC.js} +5 -5
  81. package/dist/{index-BDRs__KW.js.map → index-DHHYE6GC.js.map} +1 -1
  82. package/dist/index-DLT2A69c.js +47 -0
  83. package/dist/{index-CBgU-nlM.js.map → index-DLT2A69c.js.map} +1 -1
  84. package/dist/{index-h3GKi8po.js → index-DLfIAAoB.js} +6 -6
  85. package/dist/index-DLfIAAoB.js.map +1 -0
  86. package/dist/{index-t4O5NpPA.js → index-PyqBKn-b.js} +5 -5
  87. package/dist/{index-t4O5NpPA.js.map → index-PyqBKn-b.js.map} +1 -1
  88. package/dist/{index-CTC3YNmw.js → index-Rxsr4tZ-.js} +13 -12
  89. package/dist/{index-CTC3YNmw.js.map → index-Rxsr4tZ-.js.map} +1 -1
  90. package/dist/{index-ClKPfSrQ.js → index-Z5VzRC4L.js} +5 -5
  91. package/dist/{index-ClKPfSrQ.js.map → index-Z5VzRC4L.js.map} +1 -1
  92. package/dist/{index-CDtF3MO_.js → index-s4oA7Iyp.js} +8 -8
  93. package/dist/{index-CDtF3MO_.js.map → index-s4oA7Iyp.js.map} +1 -1
  94. package/dist/{index-Y3ALLAIp.js → index-z7CRXEdV.js} +5 -5
  95. package/dist/{index-Y3ALLAIp.js.map → index-z7CRXEdV.js.map} +1 -1
  96. package/dist/index.js +29 -29
  97. package/dist/{pies.utils-LUs6Ak8R.js → pies.utils-CBJLntml.js} +5 -5
  98. package/dist/{pies.utils-LUs6Ak8R.js.map → pies.utils-CBJLntml.js.map} +1 -1
  99. package/dist/{preview.data.constants-tDMYNi0n.js → preview.data.constants-CXMriS2F.js} +2 -2
  100. package/dist/{preview.data.constants-tDMYNi0n.js.map → preview.data.constants-CXMriS2F.js.map} +1 -1
  101. package/dist/{tables.utils-DzHoBZUS.js → tables.utils-Cxh-FOdo.js} +5 -9
  102. package/dist/tables.utils-Cxh-FOdo.js.map +1 -0
  103. package/dist/theme/formatter/formatter.constants.d.ts.map +1 -1
  104. package/dist/{timeRange.utils-Dz0fdD_b.js → timeRange.utils-C_oRVExZ.js} +2 -2
  105. package/dist/{timeRange.utils-Dz0fdD_b.js.map → timeRange.utils-C_oRVExZ.js.map} +1 -1
  106. package/package.json +2 -2
  107. package/dist/bars.utils-jvwOEGnf.js.map +0 -1
  108. package/dist/charts.utils-Q9qc_Fq5.js.map +0 -1
  109. package/dist/index-APU1GD5M.js.map +0 -1
  110. package/dist/index-BsWftigv.js +0 -123
  111. package/dist/index-BsWftigv.js.map +0 -1
  112. package/dist/index-CBgU-nlM.js +0 -46
  113. package/dist/index-Nj7bJ8tg.js.map +0 -1
  114. package/dist/index-h3GKi8po.js.map +0 -1
  115. package/dist/tables.utils-DzHoBZUS.js.map +0 -1
@@ -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, w as p, V as u } from "./Color.type.emb-sebikYGW.js";
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-sebikYGW.js";
3
- import { D as i } from "./index-CCdQwMMN.js";
4
- import { b as e, C as a } from "./component.inputs.constants-Ds7YpNhT.js";
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, n as D, V as s } from "./Color.type.emb-sebikYGW.js";
3
- import { u as w, g as V, a as S, b as j } from "./dates.utils-BF32dTLi.js";
4
- import { a as k, r as F, i as M, b as a } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { E as T } from "./EditorCard-DpSCsmZJ.js";
6
- import { I as x } from "./IconCalendarFilled-Bfm3jkzE.js";
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
- k(t);
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 = j(b);
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: S(n, o),
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,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;AAAA,MACE,GAAGA,EAAO;AAAA,MACV,MAAM;AAAA,MACN,OAAO;AAAA,MACP,cAAc;AAAA,MACd,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,MAAM;AAAA,QAAA;AAAA,MACR;AAAA,IACF;AAAA,EACF;AAAA,EAEF,WAAW;AAAA,IACT;AAAA,MACE,MAAM;AAAA,MACN,MAAM;AAAA,MACN,cAAcC,EAAM,SAAA;AAAA,MACpB,QAAQ,CAAC,eAAe;AAAA,MACxB,QAAQ,CAAC,EAAE,MAAM,YAAY,UAAU,SAAS;AAAA,IAAA;AAAA,EAClD;AAEJ,GAEaC,IAAUC,EAAcC,GAAwB;AAAA,EAC3D,UAAU,MAAM;AAClB,CAAC,GAEDC,IAAeC,EAAgBF,GAAwBL,GAAM;AAAA,EAC3D,OAAO,CAACC,OACC;AAAA,IACL,GAAGA;AAAAA,EAAA;AAAA,EAGP,QAAQ;AAAA,IACN,UAAU,CAACO,OAAW;AAAA,MACpB,OAAOA,KAASN,EAAM,SAAA;AAAA,IAAS;AAAA,EACjC;AAEJ,CAAC;"}
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,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AA,MACP,YAAY;AAAA,QACV;AAAA,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,cAAcC,EAAM,SAAA;AAAA,MACpB,QAAQ,CAAC,eAAe;AAAA,MACxB,QAAQ,CAAC,EAAE,MAAM,YAAY,UAAU,SAAS;AAAA,IAAA;AAAA,EAClD;AAEJ,GAEaC,IAAUC,EAAcC,GAAwB;AAAA,EAC3D,UAAU,MAAM;AAClB,CAAC,GAEDC,IAAeC,EAAgBF,GAAwBL,GAAM;AAAA,EAC3D,OAAO,CAACC,OACC;AAAA,IACL,GAAGA;AAAAA,EAAA;AAAA,EAGP,QAAQ;AAAA,IACN,UAAU,CAACO,OAAW;AAAA,MACpB,OAAOA,KAASN,EAAM,SAAA;AAAA,IAAS;AAAA,EACjC;AAEJ,CAAC;"}
@@ -1,7 +1,7 @@
1
1
  import { definePreview as o, defineComponent as l } from "@embeddable.com/react";
2
- import { V as t } from "./Color.type.emb-sebikYGW.js";
3
- import { D as n } from "./index-BsWftigv.js";
4
- import { b as e } from "./component.inputs.constants-Ds7YpNhT.js";
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",
@@ -1,8 +1,8 @@
1
- import { V as n, l as a } from "./Color.type.emb-sebikYGW.js";
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-ClKPfSrQ.js";
4
- import { b as e } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as t } from "./preview.data.constants-tDMYNi0n.js";
3
+ import { D as o } from "./index-Z5VzRC4L.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-DbizaE6y.js";
2
- import { V as t, l as r } from "./Color.type.emb-sebikYGW.js";
1
+ import { D as s } from "./index-CJkiIKmB.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-Ds7YpNhT.js";
5
- import { p as n } from "./preview.data.constants-tDMYNi0n.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: "DonutLabelChartPro",
8
8
  label: "Donut Label Chart",
@@ -1,6 +1,6 @@
1
- import { j as r, r as c, s as d, t as m, v as l } from "./Color.type.emb-sebikYGW.js";
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-Ds7YpNhT.js";
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-DpSCsmZJ.js.map
32
+ //# sourceMappingURL=EditorCard-ZXwl5-DV.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"EditorCard-DpSCsmZJ.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
+ {"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-sebikYGW.js";
3
- import { c as G, a as P, r as D, b as i } from "./component.inputs.constants-Ds7YpNhT.js";
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-DpSCsmZJ.js";
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), u = (e, r, t) => (r.getTime() - e.getTime()) / t;
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 u(e, l(r), 1e3);
39
+ return o(e, l(r), 1e3);
40
40
  case a.minute:
41
- return u(e, l(r), 60 * 1e3);
41
+ return o(e, l(r), 60 * 1e3);
42
42
  case a.hour:
43
- return u(e, l(r), 3600 * 1e3);
43
+ return o(e, l(r), 3600 * 1e3);
44
44
  case a.day:
45
- return u(e, l(r), 1440 * 60 * 1e3);
45
+ return o(e, l(r), 1440 * 60 * 1e3);
46
46
  case a.week:
47
- return u(e, l(r), 10080 * 60 * 1e3);
47
+ return o(e, l(r), 10080 * 60 * 1e3);
48
48
  case a.month:
49
- return u(e, l(r), 672 * 60 * 60 * 1e3);
49
+ return o(e, l(r), 672 * 60 * 60 * 1e3);
50
50
  // shortest month
51
51
  case a.quarter:
52
- return u(e, l(r), 2160 * 60 * 60 * 1e3);
52
+ return o(e, l(r), 2160 * 60 * 60 * 1e3);
53
53
  // shortest quarter
54
54
  case a.year:
55
- return u(e, l(r), 365 * 24 * 60 * 60 * 1e3);
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 o of r) {
67
- const d = o.value;
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((o) => s.has(o.value));
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: o } = e, { description: d, placeholder: h, title: v, primaryTimeRange: f } = D(e), S = N(), y = O(() => j(
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 && o(c);
91
+ c && u(c);
92
92
  }
93
- }, [y, t, o]);
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: o
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,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;AAAA,EAC1C;AACA,SAAO;AACT,GAGMC,I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AAA;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;"}
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,OAA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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-t7YCtFvf.js";
4
- import { b as e } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as t } from "./preview.data.constants-tDMYNi0n.js";
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 { k as a } from "./Color.type.emb-sebikYGW.js";
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-Bfm3jkzE.js.map
12
+ //# sourceMappingURL=IconCalendarFilled-Bl7kPqxG.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconCalendarFilled-Bfm3jkzE.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
+ {"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-BUk63KEk.js";
3
- import { l as i } from "./Color.type.emb-sebikYGW.js";
4
- import { b as a } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as o } from "./preview.data.constants-tDMYNi0n.js";
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--Dbq1zrZ.js";
3
- import { l as m } from "./Color.type.emb-sebikYGW.js";
4
- import { b as e } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as t } from "./preview.data.constants-tDMYNi0n.js";
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-h3GKi8po.js";
3
- import { V as c, l as t } from "./Color.type.emb-sebikYGW.js";
4
- import { b as e, s as i } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as n } from "./preview.data.constants-tDMYNi0n.js";
2
+ import { L as l } from "./index-DLfIAAoB.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-APU1GD5M.js";
3
- import { V as t, l as r } from "./Color.type.emb-sebikYGW.js";
4
- import { b as e, s } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as i } from "./preview.data.constants-tDMYNi0n.js";
2
+ import { L as n } from "./index-DEsLQa4J.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-Nj7bJ8tg.js";
3
- import { V as a, l as t } from "./Color.type.emb-sebikYGW.js";
4
- import { b as e } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as n } from "./preview.data.constants-tDMYNi0n.js";
2
+ import { L as o } from "./index-0rHy8NOt.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-sebikYGW.js";
3
- import { M as p, a as o } from "./index-CBgU-nlM.js";
4
- import { b as a } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as l } from "./preview.data.constants-tDMYNi0n.js";
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",
@@ -1,8 +1,8 @@
1
- import { V as t, l as o } from "./Color.type.emb-sebikYGW.js";
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-KxvT6RdK.js";
4
- import { b as e } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as i } from "./preview.data.constants-tDMYNi0n.js";
3
+ import { P as a } from "./index-BgYPax7r.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",
@@ -1,8 +1,8 @@
1
- import { l as a } from "./Color.type.emb-sebikYGW.js";
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-CDtF3MO_.js";
4
- import { b as e, s as n } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as t } from "./preview.data.constants-tDMYNi0n.js";
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-sebikYGW.js";
3
- import { M as c, S as i } from "./index-CTC3YNmw.js";
4
- import { b as a } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as l } from "./preview.data.constants-tDMYNi0n.js";
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-sebikYGW.js";
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-BDRs__KW.js";
4
- import { b as i, s as r } from "./component.inputs.constants-Ds7YpNhT.js";
5
- import { p as s } from "./preview.data.constants-tDMYNi0n.js";
3
+ import { T as p } from "./index-DHHYE6GC.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",
@@ -1,12 +1,12 @@
1
- import { j as N, U as ie, V as se, l as F, m as ue } from "./Color.type.emb-sebikYGW.js";
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-Ds7YpNhT.js";
4
- import { C as ge } from "./ChartCard-B3B1rFYh.js";
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-DzHoBZUS.js";
7
- import { p as x } from "./preview.data.constants-tDMYNi0n.js";
8
- const P = 25, { getOwnPropertyNames: we, getOwnPropertySymbols: ye } = Object, { hasOwnProperty: je } = Object.prototype;
9
- function U(n, e) {
6
+ import { b as be, c as Ee } from "./tables.utils-Cxh-FOdo.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 Ue(n, e) {
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 Pe = Object.prototype.toString;
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 = Pe.call(i), A = e[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 ? U(K, O) : K,
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 ? U(H, O) : H,
209
- areTypedArraysEqual: t ? U(S, O) : S,
210
- areUrlsEqual: Ue,
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 === P, oe = !!(l != null && l.isLoading || g != null && g.isLoading), ae = (l == null ? void 0 : l.isLoading) && !q.current;
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) * P,
516
- limit: P,
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({