@embeddable.com/remarkable-pro 0.0.15 → 0.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/BarChartDefaultHorizontalPro.js +3 -3
- package/dist/BarChartDefaultPro.js +3 -3
- package/dist/BarChartGroupedHorizontalPro.js +3 -3
- package/dist/BarChartGroupedPro.js +3 -3
- package/dist/BarChartStackedHorizontalPro.js +3 -3
- package/dist/BarChartStackedPro.js +3 -3
- package/dist/{ChartCard-BEIVgW77.js → ChartCard-DWq8ltZe.js} +3 -3
- package/dist/{ChartCard-BEIVgW77.js.map → ChartCard-DWq8ltZe.js.map} +1 -1
- package/dist/{Color.type.emb-ByiNbaI7.js → Color.type.emb-CLYI-rua.js} +282 -283
- package/dist/{Color.type.emb-ByiNbaI7.js.map → Color.type.emb-CLYI-rua.js.map} +1 -1
- package/dist/ColorEditor.js +1 -1
- package/dist/ComparisonPeriodSelectFieldPro.js +3 -3
- package/dist/DateRangePickerCustomPro.js +3 -3
- package/dist/DateRangeSelectFieldPro.js +3 -3
- package/dist/DonutChartPro.js +3 -3
- package/dist/DonutLabelChartPro.js +3 -3
- package/dist/{EditorCard-NEIuygkP.js → EditorCard-GIL6-rb_.js} +3 -3
- package/dist/{EditorCard-NEIuygkP.js.map → EditorCard-GIL6-rb_.js.map} +1 -1
- package/dist/HeatMapPro.js +3 -3
- package/dist/KpiChartNumberComparisonPro.js +3 -3
- package/dist/KpiChartNumberPro.js +3 -3
- package/dist/LineChartComparisonDefaultPro.js +3 -3
- package/dist/LineChartDefaultPro.js +3 -3
- package/dist/LineChartGroupedPro.js +3 -3
- package/dist/MultiSelectFieldPro.js +3 -3
- package/dist/PieChartPro.js +3 -3
- package/dist/PivotTablePro.js +3 -3
- package/dist/SingleSelectFieldPro.js +3 -3
- package/dist/TableChartPaginated.js +3 -3
- package/dist/{bars.utils-D12lq8bm.js → bars.utils-fkN2-HS9.js} +4 -4
- package/dist/{bars.utils-D12lq8bm.js.map → bars.utils-fkN2-HS9.js.map} +1 -1
- package/dist/{charts.utils-Bq6c6ccK.js → charts.utils-BiED7HDM.js} +6 -5
- package/dist/charts.utils-BiED7HDM.js.map +1 -0
- package/dist/{component.inputs.constants-FaX3B1CO.js → component.inputs.constants-BYwiwFNH.js} +257 -231
- package/dist/{component.inputs.constants-FaX3B1CO.js.map → component.inputs.constants-BYwiwFNH.js.map} +1 -1
- package/dist/embeddable-components.json +13 -13
- package/dist/embeddable-theme-0137e.js +2 -1
- package/dist/{formatter.utils-IGbSBsIu.js → formatter.utils-C6e5AE1P.js} +2 -2
- package/dist/{formatter.utils-IGbSBsIu.js.map → formatter.utils-C6e5AE1P.js.map} +1 -1
- package/dist/{index-Dhj9KjfQ.js → index-AkhRDk1Q.js} +5 -5
- package/dist/{index-Dhj9KjfQ.js.map → index-AkhRDk1Q.js.map} +1 -1
- package/dist/{index-EAQjfjEJ.js → index-B6Sxhv5V.js} +4 -4
- package/dist/{index-EAQjfjEJ.js.map → index-B6Sxhv5V.js.map} +1 -1
- package/dist/{index-B15C4kTf.js → index-B7ZOvR_0.js} +5 -5
- package/dist/{index-B15C4kTf.js.map → index-B7ZOvR_0.js.map} +1 -1
- package/dist/{index-BjaJdNzu.js → index-BKe5XLWq.js} +5 -5
- package/dist/{index-BjaJdNzu.js.map → index-BKe5XLWq.js.map} +1 -1
- package/dist/{index-BiTSd5Wd.js → index-BLrDwmLF.js} +5 -5
- package/dist/{index-BiTSd5Wd.js.map → index-BLrDwmLF.js.map} +1 -1
- package/dist/{index-hHVOyy6e.js → index-BPWmQIUP.js} +5 -5
- package/dist/{index-hHVOyy6e.js.map → index-BPWmQIUP.js.map} +1 -1
- package/dist/{index-CdjbmThq.js → index-BiJMrvpt.js} +5 -5
- package/dist/{index-CdjbmThq.js.map → index-BiJMrvpt.js.map} +1 -1
- package/dist/{index-RHaWI3AH.js → index-Bvnqafeu.js} +5 -5
- package/dist/{index-RHaWI3AH.js.map → index-Bvnqafeu.js.map} +1 -1
- package/dist/{index-CR69kGQc.js → index-CBauec4T.js} +5 -5
- package/dist/{index-CR69kGQc.js.map → index-CBauec4T.js.map} +1 -1
- package/dist/{index-DRIH3L5J.js → index-CdT1o7ra.js} +5 -5
- package/dist/{index-DRIH3L5J.js.map → index-CdT1o7ra.js.map} +1 -1
- package/dist/{index-CQZhGtUT.js → index-DGoq-GmG.js} +6 -6
- package/dist/{index-CQZhGtUT.js.map → index-DGoq-GmG.js.map} +1 -1
- package/dist/{index-BzF8GFHy.js → index-DJy_zcds.js} +5 -5
- package/dist/{index-BzF8GFHy.js.map → index-DJy_zcds.js.map} +1 -1
- package/dist/{index-oK1pn0Vk.js → index-DP-lVPuh.js} +5 -5
- package/dist/{index-oK1pn0Vk.js.map → index-DP-lVPuh.js.map} +1 -1
- package/dist/{index-DdeFtB5C.js → index-De2fu_3w.js} +6 -6
- package/dist/{index-DdeFtB5C.js.map → index-De2fu_3w.js.map} +1 -1
- package/dist/{index-BDPQ_c46.js → index-Do4E11C9.js} +5 -5
- package/dist/{index-BDPQ_c46.js.map → index-Do4E11C9.js.map} +1 -1
- package/dist/{index-BNFqHQr3.js → index-IERhvJoR.js} +6 -6
- package/dist/{index-BNFqHQr3.js.map → index-IERhvJoR.js.map} +1 -1
- package/dist/{index-DLCspqkx.js → index-PV9-pvEj.js} +5 -5
- package/dist/{index-DLCspqkx.js.map → index-PV9-pvEj.js.map} +1 -1
- package/dist/{index-_fEx7Sbh.js → index-Ybpp0kam.js} +4 -4
- package/dist/{index-_fEx7Sbh.js.map → index-Ybpp0kam.js.map} +1 -1
- package/dist/{index-CwiND2Ct.js → index-agIiR5E8.js} +5 -5
- package/dist/{index-CwiND2Ct.js.map → index-agIiR5E8.js.map} +1 -1
- package/dist/{index-DNXqnRoE.js → index-hHZCF8mP.js} +5 -5
- package/dist/{index-DNXqnRoE.js.map → index-hHZCF8mP.js.map} +1 -1
- package/dist/{index-BKcWHLSf.js → index-za3bNggu.js} +5 -5
- package/dist/{index-BKcWHLSf.js.map → index-za3bNggu.js.map} +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +80 -77
- package/dist/{pies.utils-C5DxeS68.js → pies.utils--MuyzEyP.js} +5 -5
- package/dist/{pies.utils-C5DxeS68.js.map → pies.utils--MuyzEyP.js.map} +1 -1
- package/dist/remarkable-pro.css +1 -1
- package/dist/{timeRange.utils-CTEHTF97.js → timeRange.utils-Cf2JBR0j.js} +2 -2
- package/dist/{timeRange.utils-CTEHTF97.js.map → timeRange.utils-Cf2JBR0j.js.map} +1 -1
- package/package.json +2 -2
- package/dist/charts.utils-Bq6c6ccK.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-Ybpp0kam.js","sources":["../node_modules/@tabler/icons-react/dist/esm/icons/IconCalendarTime.mjs","../src/components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.utils.ts","../src/components/editors/ComparisonPeriodSelectFieldPro/index.tsx"],"sourcesContent":["/**\n * @license @tabler/icons-react v3.36.0 - MIT\n *\n * This source code is licensed under the MIT license.\n * See the LICENSE file in the root directory of this source tree.\n */\n\nimport createReactComponent from '../createReactComponent.mjs';\n\nconst __iconNode = [[\"path\", { \"d\": \"M11.795 21h-6.795a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h12a2 2 0 0 1 2 2v4\", \"key\": \"svg-0\" }], [\"path\", { \"d\": \"M18 18m-4 0a4 4 0 1 0 8 0a4 4 0 1 0 -8 0\", \"key\": \"svg-1\" }], [\"path\", { \"d\": \"M15 3v4\", \"key\": \"svg-2\" }], [\"path\", { \"d\": \"M7 3v4\", \"key\": \"svg-3\" }], [\"path\", { \"d\": \"M3 11h16\", \"key\": \"svg-4\" }], [\"path\", { \"d\": \"M18 16.496v1.504l1 1\", \"key\": \"svg-5\" }]];\nconst IconCalendarTime = createReactComponent(\"outline\", \"calendar-time\", \"CalendarTime\", __iconNode);\n\nexport { __iconNode, IconCalendarTime as default };\n//# sourceMappingURL=IconCalendarTime.mjs.map\n","import { SelectListOptionProps } from '@embeddable.com/remarkable-ui';\nimport { TimeRange } from '@embeddable.com/core';\nimport { ComparisonPeriodSelectFieldProOption } from './ComparisonPeriodSelectFieldPro.types';\nimport { resolveI18nString } from '../../component.utils';\nimport { getTimeRangeLabel } from '../dates/dates.utils';\n\n// Checks if the comparison period type is available in the embeddable types\nexport const isComparisonPeriodAvailable = (\n option: string | undefined,\n comparisonPeriodSelectFieldProOptions: ComparisonPeriodSelectFieldProOption[],\n): boolean => {\n return !option || comparisonPeriodSelectFieldProOptions.some((opt) => opt.value === option);\n};\n\nexport const getComparisonPeriodSelectFieldProOptions = (\n comparisonPeriodSelectFieldProOptions: ComparisonPeriodSelectFieldProOption[],\n toCompareTimeRange: TimeRange,\n): SelectListOptionProps[] => {\n return comparisonPeriodSelectFieldProOptions.map((option) => {\n return {\n rightLabel: toCompareTimeRange\n ? getTimeRangeLabel(option.getRange(toCompareTimeRange), option.dateFormat)\n : '',\n value: option.value,\n label: resolveI18nString(option.label),\n };\n });\n};\n","import { useTheme } from '@embeddable.com/react';\nimport { SingleSelectField } from '@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 { IconCalendarTime } from '@tabler/icons-react';\nimport { i18n, i18nSetup } from '../../../theme/i18n/i18n';\nimport {\n getComparisonPeriodSelectFieldProOptions,\n isComparisonPeriodAvailable,\n} from './ComparisonPeriodSelectFieldPro.utils';\nimport { useEffect, useMemo } from 'react';\nimport { getTimeRangeFromPresets } from '../dates/dates.utils';\n\ntype DateComparisonSelectFieldPro = {\n title?: string;\n description?: string;\n placeholder?: string;\n primaryDateRange?: TimeRange;\n comparisonPeriod?: string;\n onChange: (newComparisonPeriod?: string) => void;\n};\n\nconst DateComparisonSelectFieldPro = (props: DateComparisonSelectFieldPro) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { description, placeholder, title, comparisonPeriod, onChange } = resolveI18nProps(props);\n\n const comparisonPeriodOptions = theme.defaults.comparisonPeriodsOptions;\n\n const comparisonPeriodAvailable = useMemo(\n () => isComparisonPeriodAvailable(comparisonPeriod, comparisonPeriodOptions),\n [comparisonPeriod, comparisonPeriodOptions],\n );\n\n // If the current comparison period is not available, reset the field\n useEffect(() => {\n if (!comparisonPeriodAvailable) {\n onChange(undefined);\n }\n }, [comparisonPeriodAvailable, onChange]);\n\n const { dayjsLocaleReady } = useLoadDayjsLocale();\n\n // Obtain the actual range for the selected primaryDateRange\n const primaryDateRange = getTimeRangeFromPresets(\n props.primaryDateRange,\n theme.defaults.dateRangesOptions,\n );\n\n if (!dayjsLocaleReady) {\n return null;\n }\n\n const options = getComparisonPeriodSelectFieldProOptions(\n comparisonPeriodOptions,\n primaryDateRange,\n );\n\n return (\n <EditorCard title={title} subtitle={description}>\n <SingleSelectField\n startIcon={IconCalendarTime}\n clearable\n placeholder={placeholder}\n value={comparisonPeriodAvailable ? comparisonPeriod : undefined}\n onChange={onChange}\n options={options}\n noOptionsMessage={i18n.t('common.noOptionsAvailable')}\n />\n </EditorCard>\n );\n};\n\nexport default DateComparisonSelectFieldPro;\n"],"names":["__iconNode","IconCalendarTime","createReactComponent","isComparisonPeriodAvailable","option","comparisonPeriodSelectFieldProOptions","opt","getComparisonPeriodSelectFieldProOptions","toCompareTimeRange","getTimeRangeLabel","resolveI18nString","DateComparisonSelectFieldPro","props","theme","useTheme","i18nSetup","description","placeholder","title","comparisonPeriod","onChange","resolveI18nProps","comparisonPeriodOptions","comparisonPeriodAvailable","useMemo","useEffect","dayjsLocaleReady","useLoadDayjsLocale","primaryDateRange","getTimeRangeFromPresets","options","jsx","EditorCard","SingleSelectField","i18n"],"mappings":";;;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AmBC;AAAA,IACvBjB,EAAM;AAAA,IACNC,EAAM,SAAS;AAAA,EAAA;AAGjB,MAAI,CAACa;AACH,WAAO;AAGT,QAAMI,IAAUvB;AAAA,IACde;AAAA,IACAM;AAAA,EAAA;AAGF,SACEG,gBAAAA,EAAAA,IAACC,GAAA,EAAW,OAAAd,GAAc,UAAUF,GAClC,UAAAe,gBAAAA,EAAAA;AAAAA,IAACE;AAAA,IAAA;AAAA,MACC,WAAWhC;AAAA,MACX,WAAS;AAAA,MACT,aAAAgB;AAAA,MACA,OAAOM,IAA4BJ,IAAmB;AAAA,MACtD,UAAAC;AAAA,MACA,SAAAU;AAAA,MACA,kBAAkBI,EAAK,EAAE,2BAA2B;AAAA,IAAA;AAAA,EAAA,GAExD;AAEJ;;;;","x_google_ignoreList":[0]}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { b as j, m as P, j as w, L as S } from "./Color.type.emb-
|
|
1
|
+
import { b as j, m as P, j as w, L as S } from "./Color.type.emb-CLYI-rua.js";
|
|
2
2
|
import { useTheme as y } from "@embeddable.com/react";
|
|
3
|
-
import { a as G, r as O } from "./component.inputs.constants-
|
|
4
|
-
import { C as v } from "./ChartCard-
|
|
5
|
-
import { g as $ } from "./formatter.utils-
|
|
3
|
+
import { a as G, r as O } from "./component.inputs.constants-BYwiwFNH.js";
|
|
4
|
+
import { C as v } from "./ChartCard-DWq8ltZe.js";
|
|
5
|
+
import { g as $ } from "./formatter.utils-C6e5AE1P.js";
|
|
6
6
|
import { g as R, a as M } from "./object.utils-D_Zzon-H.js";
|
|
7
7
|
import { s as F } from "./color.utils-BSg_DFOh.js";
|
|
8
8
|
import { g as T } from "./lines.utils-CFEUUo4k.js";
|
|
@@ -156,4 +156,4 @@ export {
|
|
|
156
156
|
D as g,
|
|
157
157
|
J as i
|
|
158
158
|
};
|
|
159
|
-
//# sourceMappingURL=index-
|
|
159
|
+
//# sourceMappingURL=index-agIiR5E8.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-CwiND2Ct.js","sources":["../src/components/charts/lines/LineChartGroupedPro/LineChartGroupedPro.utils.ts","../src/components/charts/lines/LineChartGroupedPro/index.tsx"],"sourcesContent":["import { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { Theme } from '../../../../theme/theme.types';\nimport { ChartData, ChartOptions } from 'chart.js';\nimport { getThemeFormatter } from '../../../../theme/formatter/formatter.utils';\nimport { mergician } from 'mergician';\nimport { getObjectStableKey } from '../../../../utils.ts/object.utils';\nimport { getColor } from '../../../../theme/styles/styles.utils';\nimport { setColorAlpha } from '../../../../utils.ts/color.utils';\nimport { getChartContrastColors } from '@embeddable.com/remarkable-ui';\nimport { getLineChartProOptions, LineChartProOptionsClick } from '../lines.utils';\n\nexport const getLineChartGroupedProData = (\n props: {\n data: DataResponse['data'];\n dimension: Dimension;\n groupDimension: Dimension;\n measure: Measure;\n hasMinMaxYAxisRange: boolean;\n },\n theme: Theme,\n): ChartData<'line'> => {\n const themeFormatter = getThemeFormatter(theme);\n const { data = [], dimension, groupDimension, measure, hasMinMaxYAxisRange } = props;\n\n const axis = [...new Set(data.map((d) => d[dimension.name]).filter((d) => d != null))].sort();\n const groupBy = [...new Set(data.map((d) => d[groupDimension.name]))].filter((d) => d != null);\n\n const themeKey = getObjectStableKey(theme);\n const chartContrastColors = getChartContrastColors();\n const datasets: ChartData<'line'>['datasets'] = groupBy.map((groupByItem, index) => {\n const backgroundColor = getColor(\n `${themeKey}.charts.backgroundColors`,\n `${groupDimension.name}.${groupByItem}`,\n theme.charts.backgroundColors ?? chartContrastColors,\n index,\n );\n\n const borderColor = getColor(\n `${themeKey}.charts.borderColors`,\n `${groupDimension.name}.${groupByItem}`,\n theme.charts.borderColors ?? chartContrastColors,\n index,\n );\n\n const dataset = {\n clip: hasMinMaxYAxisRange,\n label: themeFormatter.data(groupDimension, groupByItem),\n rawLabel: groupByItem,\n backgroundColor: setColorAlpha(backgroundColor, 0.5),\n pointBackgroundColor: backgroundColor,\n fill: measure.inputs?.['fillUnderLine'],\n borderColor,\n data: axis.map((axisItem) => {\n const record = data.find(\n (d) => d[groupDimension.name] === groupByItem && d[dimension.name] === axisItem,\n );\n return record?.[measure.name] ?? (measure.inputs?.['connectGaps'] ? 0 : null);\n }),\n } as ChartData<'line'>['datasets'][number];\n\n return dataset;\n });\n\n return {\n labels: axis,\n datasets,\n };\n};\n\nexport const getLineChartGroupedProOptions = (\n options: {\n dimension: Dimension;\n measure: Measure;\n data: ChartData<'line'>;\n onLineClicked: LineChartProOptionsClick;\n },\n theme: Theme,\n): ChartOptions<'line'> => {\n const { dimension, data, measure, onLineClicked } = options;\n const themeFormatter = getThemeFormatter(theme);\n\n const lineChartOptions: ChartOptions<'line'> = {\n plugins: {\n datalabels: {\n labels: {\n value: {\n formatter: (value: string | number) => {\n return themeFormatter.data(measure, value);\n },\n },\n },\n },\n tooltip: {\n callbacks: {\n title: (context) => {\n const label = context[0]?.label;\n return themeFormatter.data(dimension, label);\n },\n label: (context) => {\n const raw = context.raw as number;\n return `${context.dataset.label}: ${themeFormatter.data(measure, raw)}`;\n },\n },\n },\n },\n scales: {\n x: {\n ticks: {\n callback: (value) => {\n if (!data || !data.labels) return undefined;\n\n const label = data.labels[Number(value)] as string;\n return themeFormatter.data(dimension, label);\n },\n },\n },\n y: {\n ticks: {\n callback: (value) => {\n return themeFormatter.data(measure, value);\n },\n },\n },\n },\n };\n\n return mergician(\n getLineChartProOptions({ onLineClicked }),\n lineChartOptions,\n theme.charts?.lineChartGroupedPro?.options || {},\n );\n};\n","import { useTheme } from '@embeddable.com/react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { i18nSetup } from '../../../../theme/i18n/i18n';\nimport { resolveI18nProps } from '../../../component.utils';\nimport { ChartCard } from '../../shared/ChartCard/ChartCard';\nimport {\n getLineChartGroupedProData,\n getLineChartGroupedProOptions,\n} from './LineChartGroupedPro.utils';\nimport { useFillGaps } from '../../charts.fillGaps.hooks';\nimport { LineChartProOptionsClick } from '../lines.utils';\nimport { LineChart } from '@embeddable.com/remarkable-ui';\n\nexport type LineChartGroupedProPropsOnLineClicked = {\n axisDimensionValue: string | null;\n groupingDimensionValue: string | null;\n};\n\ntype LineChartGroupedProProp = {\n description: string;\n xAxis: Dimension;\n groupBy: Dimension;\n measure: Measure;\n results: DataResponse;\n reverseXAxis: boolean;\n showLegend: boolean;\n showLogarithmicScale: boolean;\n showTooltips: boolean;\n showValueLabels: boolean;\n title: string;\n xAxisLabel: string;\n yAxisLabel: string;\n yAxisRangeMax?: number;\n yAxisRangeMin?: number;\n onLineClicked: LineChartProOptionsClick;\n};\n\nconst LineChartGroupedPro = (props: LineChartGroupedProProp) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { title, description, xAxisLabel, yAxisLabel } = resolveI18nProps(props);\n const {\n measure,\n xAxis,\n groupBy,\n reverseXAxis,\n showLegend,\n showLogarithmicScale,\n showTooltips,\n showValueLabels,\n yAxisRangeMax,\n yAxisRangeMin,\n onLineClicked,\n } = props;\n\n const results = useFillGaps({\n results: props.results,\n dimension: props.xAxis,\n });\n\n const data = getLineChartGroupedProData(\n {\n data: results.data,\n dimension: xAxis,\n groupDimension: groupBy,\n measure,\n hasMinMaxYAxisRange: Boolean(yAxisRangeMin != null || yAxisRangeMax != null),\n },\n\n theme,\n );\n const options = getLineChartGroupedProOptions(\n { data, dimension: xAxis, measure, onLineClicked },\n theme,\n );\n\n return (\n <ChartCard\n data={results}\n dimensionsAndMeasures={[measure, xAxis, groupBy]}\n errorMessage={results.error}\n subtitle={description}\n title={title}\n >\n <LineChart\n data={data}\n reverseXAxis={reverseXAxis}\n showLegend={showLegend}\n showLogarithmicScale={showLogarithmicScale}\n showTooltips={showTooltips}\n showValueLabels={showValueLabels}\n xAxisLabel={xAxisLabel}\n yAxisLabel={yAxisLabel}\n yAxisRangeMax={yAxisRangeMax}\n yAxisRangeMin={yAxisRangeMin}\n options={options}\n />\n </ChartCard>\n );\n};\n\nexport default LineChartGroupedPro;\n"],"names":["getLineChartGroupedProData","props","theme","themeFormatter","getThemeFormatter","data","dimension","groupDimension","measure","hasMinMaxYAxisRange","axis","d","groupBy","themeKey","getObjectStableKey","chartContrastColors","getChartContrastColors","datasets","groupByItem","index","backgroundColor","getColor","borderColor","setColorAlpha","_a","axisItem","record","getLineChartGroupedProOptions","options","onLineClicked","lineChartOptions","value","context","label","raw","mergician","getLineChartProOptions","_b","LineChartGroupedPro","useTheme","i18nSetup","title","description","xAxisLabel","yAxisLabel","resolveI18nProps","xAxis","reverseXAxis","showLegend","showLogarithmicScale","showTooltips","showValueLabels","yAxisRangeMax","yAxisRangeMin","results","useFillGaps","jsx","ChartCard","LineChart"],"mappings":";;;;;;;;;AAWO,MAAMA,IAA6B,CACxCC,GAOAC,MACsB;AACtB,QAAMC,IAAiBC,EAAkBF,CAAK,GACxC,EAAE,MAAAG,IAAO,IAAI,WAAAC,GAAW,gBAAAC,GAAgB,SAAAC,GAAS,qBAAAC,MAAwBR,GAEzES,IAAO,CAAC,GAAG,IAAI,IAAIL,EAAK,IAAI,CAACM,MAAMA,EAAEL,EAAU,IAAI,CAAC,EAAE,OAAO,CAACK,MAAMA,KAAK,IAAI,CAAC,CAAC,EAAE,KAAA,GACjFC,IAAU,CAAC,GAAG,IAAI,IAAIP,EAAK,IAAI,CAACM,MAAMA,EAAEJ,EAAe,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAACI,MAAMA,KAAK,IAAI,GAEvFE,IAAWC,EAAmBZ,CAAK,GACnCa,IAAsBC,EAAA,GACtBC,IAA0CL,EAAQ,IAAI,CAACM,GAAaC,MAAU;;AAClF,UAAMC,IAAkBC;AAAA,MACtB,GAAGR,CAAQ;AAAA,MACX,GAAGN,EAAe,IAAI,IAAIW,CAAW;AAAA,MACrChB,EAAM,OAAO,oBAAoBa;AAAA,MACjCI;AAAA,IAAA,GAGIG,IAAcD;AAAA,MAClB,G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AC1B,SAAStD,EAAM;AAAA,IACf,WAAWA,EAAM;AAAA,EAAA,CAClB,GAEKI,IAAOL;AAAA,IACX;AAAA,MACE,MAAMsD,EAAQ;AAAA,MACd,WAAWR;AAAA,MACX,gBAAgBlC;AAAA,MAChB,SAAAJ;AAAA,MACA,qBAA6B6C,KAAiB,QAAQD,KAAiB;AAAA,IAAI;AAAA,IAG7ElD;AAAA,EAAA,GAEI0B,IAAUD;AAAA,IACd,EAAE,MAAAtB,GAAM,WAAWyC,GAAO,SAAAtC,GAAS,eAAAqB,EAAA;AAAA,IACnC3B;AAAA,EAAA;AAGF,SACEsD,gBAAAA,EAAAA;AAAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMH;AAAA,MACN,uBAAuB,CAAC9C,GAASsC,GAAOlC,CAAO;AAAA,MAC/C,cAAc0C,EAAQ;AAAA,MACtB,UAAUZ;AAAA,MACV,OAAAD;AAAA,MAEA,UAAAe,gBAAAA,EAAAA;AAAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAArD;AAAA,UACA,cAAA0C;AAAA,UACA,YAAAC;AAAA,UACA,sBAAAC;AAAA,UACA,cAAAC;AAAA,UACA,iBAAAC;AAAA,UACA,YAAAR;AAAA,UACA,YAAAC;AAAA,UACA,eAAAQ;AAAA,UACA,eAAAC;AAAA,UACA,SAAAzB;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;;;;"}
|
|
1
|
+
{"version":3,"file":"index-agIiR5E8.js","sources":["../src/components/charts/lines/LineChartGroupedPro/LineChartGroupedPro.utils.ts","../src/components/charts/lines/LineChartGroupedPro/index.tsx"],"sourcesContent":["import { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { Theme } from '../../../../theme/theme.types';\nimport { ChartData, ChartOptions } from 'chart.js';\nimport { getThemeFormatter } from '../../../../theme/formatter/formatter.utils';\nimport { mergician } from 'mergician';\nimport { getObjectStableKey } from '../../../../utils.ts/object.utils';\nimport { getColor } from '../../../../theme/styles/styles.utils';\nimport { setColorAlpha } from '../../../../utils.ts/color.utils';\nimport { getChartContrastColors } from '@embeddable.com/remarkable-ui';\nimport { getLineChartProOptions, LineChartProOptionsClick } from '../lines.utils';\n\nexport const getLineChartGroupedProData = (\n props: {\n data: DataResponse['data'];\n dimension: Dimension;\n groupDimension: Dimension;\n measure: Measure;\n hasMinMaxYAxisRange: boolean;\n },\n theme: Theme,\n): ChartData<'line'> => {\n const themeFormatter = getThemeFormatter(theme);\n const { data = [], dimension, groupDimension, measure, hasMinMaxYAxisRange } = props;\n\n const axis = [...new Set(data.map((d) => d[dimension.name]).filter((d) => d != null))].sort();\n const groupBy = [...new Set(data.map((d) => d[groupDimension.name]))].filter((d) => d != null);\n\n const themeKey = getObjectStableKey(theme);\n const chartContrastColors = getChartContrastColors();\n const datasets: ChartData<'line'>['datasets'] = groupBy.map((groupByItem, index) => {\n const backgroundColor = getColor(\n `${themeKey}.charts.backgroundColors`,\n `${groupDimension.name}.${groupByItem}`,\n theme.charts.backgroundColors ?? chartContrastColors,\n index,\n );\n\n const borderColor = getColor(\n `${themeKey}.charts.borderColors`,\n `${groupDimension.name}.${groupByItem}`,\n theme.charts.borderColors ?? chartContrastColors,\n index,\n );\n\n const dataset = {\n clip: hasMinMaxYAxisRange,\n label: themeFormatter.data(groupDimension, groupByItem),\n rawLabel: groupByItem,\n backgroundColor: setColorAlpha(backgroundColor, 0.5),\n pointBackgroundColor: backgroundColor,\n fill: measure.inputs?.['fillUnderLine'],\n borderColor,\n data: axis.map((axisItem) => {\n const record = data.find(\n (d) => d[groupDimension.name] === groupByItem && d[dimension.name] === axisItem,\n );\n return record?.[measure.name] ?? (measure.inputs?.['connectGaps'] ? 0 : null);\n }),\n } as ChartData<'line'>['datasets'][number];\n\n return dataset;\n });\n\n return {\n labels: axis,\n datasets,\n };\n};\n\nexport const getLineChartGroupedProOptions = (\n options: {\n dimension: Dimension;\n measure: Measure;\n data: ChartData<'line'>;\n onLineClicked: LineChartProOptionsClick;\n },\n theme: Theme,\n): ChartOptions<'line'> => {\n const { dimension, data, measure, onLineClicked } = options;\n const themeFormatter = getThemeFormatter(theme);\n\n const lineChartOptions: ChartOptions<'line'> = {\n plugins: {\n datalabels: {\n labels: {\n value: {\n formatter: (value: string | number) => {\n return themeFormatter.data(measure, value);\n },\n },\n },\n },\n tooltip: {\n callbacks: {\n title: (context) => {\n const label = context[0]?.label;\n return themeFormatter.data(dimension, label);\n },\n label: (context) => {\n const raw = context.raw as number;\n return `${context.dataset.label}: ${themeFormatter.data(measure, raw)}`;\n },\n },\n },\n },\n scales: {\n x: {\n ticks: {\n callback: (value) => {\n if (!data || !data.labels) return undefined;\n\n const label = data.labels[Number(value)] as string;\n return themeFormatter.data(dimension, label);\n },\n },\n },\n y: {\n ticks: {\n callback: (value) => {\n return themeFormatter.data(measure, value);\n },\n },\n },\n },\n };\n\n return mergician(\n getLineChartProOptions({ onLineClicked }),\n lineChartOptions,\n theme.charts?.lineChartGroupedPro?.options || {},\n );\n};\n","import { useTheme } from '@embeddable.com/react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { i18nSetup } from '../../../../theme/i18n/i18n';\nimport { resolveI18nProps } from '../../../component.utils';\nimport { ChartCard } from '../../shared/ChartCard/ChartCard';\nimport {\n getLineChartGroupedProData,\n getLineChartGroupedProOptions,\n} from './LineChartGroupedPro.utils';\nimport { useFillGaps } from '../../charts.fillGaps.hooks';\nimport { LineChartProOptionsClick } from '../lines.utils';\nimport { LineChart } from '@embeddable.com/remarkable-ui';\n\nexport type LineChartGroupedProPropsOnLineClicked = {\n axisDimensionValue: string | null;\n groupingDimensionValue: string | null;\n};\n\ntype LineChartGroupedProProp = {\n description: string;\n xAxis: Dimension;\n groupBy: Dimension;\n measure: Measure;\n results: DataResponse;\n reverseXAxis: boolean;\n showLegend: boolean;\n showLogarithmicScale: boolean;\n showTooltips: boolean;\n showValueLabels: boolean;\n title: string;\n xAxisLabel: string;\n yAxisLabel: string;\n yAxisRangeMax?: number;\n yAxisRangeMin?: number;\n onLineClicked: LineChartProOptionsClick;\n};\n\nconst LineChartGroupedPro = (props: LineChartGroupedProProp) => {\n const theme: Theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const { title, description, xAxisLabel, yAxisLabel } = resolveI18nProps(props);\n const {\n measure,\n xAxis,\n groupBy,\n reverseXAxis,\n showLegend,\n showLogarithmicScale,\n showTooltips,\n showValueLabels,\n yAxisRangeMax,\n yAxisRangeMin,\n onLineClicked,\n } = props;\n\n const results = useFillGaps({\n results: props.results,\n dimension: props.xAxis,\n });\n\n const data = getLineChartGroupedProData(\n {\n data: results.data,\n dimension: xAxis,\n groupDimension: groupBy,\n measure,\n hasMinMaxYAxisRange: Boolean(yAxisRangeMin != null || yAxisRangeMax != null),\n },\n\n theme,\n );\n const options = getLineChartGroupedProOptions(\n { data, dimension: xAxis, measure, onLineClicked },\n theme,\n );\n\n return (\n <ChartCard\n data={results}\n dimensionsAndMeasures={[measure, xAxis, groupBy]}\n errorMessage={results.error}\n subtitle={description}\n title={title}\n >\n <LineChart\n data={data}\n reverseXAxis={reverseXAxis}\n showLegend={showLegend}\n showLogarithmicScale={showLogarithmicScale}\n showTooltips={showTooltips}\n showValueLabels={showValueLabels}\n xAxisLabel={xAxisLabel}\n yAxisLabel={yAxisLabel}\n yAxisRangeMax={yAxisRangeMax}\n yAxisRangeMin={yAxisRangeMin}\n options={options}\n />\n </ChartCard>\n );\n};\n\nexport default LineChartGroupedPro;\n"],"names":["getLineChartGroupedProData","props","theme","themeFormatter","getThemeFormatter","data","dimension","groupDimension","measure","hasMinMaxYAxisRange","axis","d","groupBy","themeKey","getObjectStableKey","chartContrastColors","getChartContrastColors","datasets","groupByItem","index","backgroundColor","getColor","borderColor","setColorAlpha","_a","axisItem","record","getLineChartGroupedProOptions","options","onLineClicked","lineChartOptions","value","context","label","raw","mergician","getLineChartProOptions","_b","LineChartGroupedPro","useTheme","i18nSetup","title","description","xAxisLabel","yAxisLabel","resolveI18nProps","xAxis","reverseXAxis","showLegend","showLogarithmicScale","showTooltips","showValueLabels","yAxisRangeMax","yAxisRangeMin","results","useFillGaps","jsx","ChartCard","LineChart"],"mappings":";;;;;;;;;AAWO,MAAMA,IAA6B,CACxCC,GAOAC,MACsB;AACtB,QAAMC,IAAiBC,EAAkBF,CAAK,GACxC,EAAE,MAAAG,IAAO,IAAI,WAAAC,GAAW,gBAAAC,GAAgB,SAAAC,GAAS,qBAAAC,MAAwBR,GAEzES,IAAO,CAAC,GAAG,IAAI,IAAIL,EAAK,IAAI,CAACM,MAAMA,EAAEL,EAAU,IAAI,CAAC,EAAE,OAAO,CAACK,MAAMA,KAAK,IAAI,CAAC,CAAC,EAAE,KAAA,GACjFC,IAAU,CAAC,GAAG,IAAI,IAAIP,EAAK,IAAI,CAACM,MAAMA,EAAEJ,EAAe,IAAI,CAAC,CAAC,CAAC,EAAE,OAAO,CAACI,MAAMA,KAAK,IAAI,GAEvFE,IAAWC,EAAmBZ,CAAK,GACnCa,IAAsBC,EAAA,GACtBC,IAA0CL,EAAQ,IAAI,CAACM,GAAaC,MAAU;;AAClF,UAAMC,IAAkBC;AAAA,MACtB,GAAGR,CAAQ;AAAA,MACX,GAAGN,EAAe,IAAI,IAAIW,CAAW;AAAA,MACrChB,EAAM,OAAO,oBAAoBa;AAAA,MACjCI;AAAA,IAAA,GAGIG,IAAcD;AAAA,MAClB,GAAGR,CAAQ;AAAA,MACX,GAAGN,EAAe,IAAI,IAAIW,CAAW;AAAA,MACrChB,EAAM,OAAO,gBAAgBa;AAAA,MAC7BI;AAAA,IAAA;AAmBF,WAhBgB;AAAA,MACd,MAAMV;AAAA,MACN,OAAON,EAAe,KAAKI,GAAgBW,CAAW;AAAA,MACtD,UAAUA;AAAA,MACV,iBAAiBK,EAAcH,GAAiB,GAAG;AAAA,MACnD,sBAAsBA;AAAA,MACtB,OAAMI,IAAAhB,EAAQ,WAAR,gBAAAgB,EAAiB;AAAA,M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AA;AAAA,IACnC3B;AAAA,EAAA;AAGF,SACEsD,gBAAAA,EAAAA;AAAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMH;AAAA,MACN,uBAAuB,CAAC9C,GAASsC,GAAOlC,CAAO;AAAA,MAC/C,cAAc0C,EAAQ;AAAA,MACtB,UAAUZ;AAAA,MACV,OAAAD;AAAA,MAEA,UAAAe,gBAAAA,EAAAA;AAAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAArD;AAAA,UACA,cAAA0C;AAAA,UACA,YAAAC;AAAA,UACA,sBAAAC;AAAA,UACA,cAAAC;AAAA,UACA,iBAAAC;AAAA,UACA,YAAAR;AAAA,UACA,YAAAC;AAAA,UACA,eAAAQ;AAAA,UACA,eAAAC;AAAA,UACA,SAAAzB;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { m as L, j as m, B as P } from "./Color.type.emb-
|
|
1
|
+
import { m as L, j as m, B as P } from "./Color.type.emb-CLYI-rua.js";
|
|
2
2
|
import { useTheme as w } from "@embeddable.com/react";
|
|
3
|
-
import { a as M, r as S } from "./component.inputs.constants-
|
|
4
|
-
import { C as T } from "./ChartCard-
|
|
5
|
-
import { g as _, b as v } from "./bars.utils-
|
|
3
|
+
import { a as M, r as S } from "./component.inputs.constants-BYwiwFNH.js";
|
|
4
|
+
import { C as T } from "./ChartCard-DWq8ltZe.js";
|
|
5
|
+
import { g as _, b as v } from "./bars.utils-fkN2-HS9.js";
|
|
6
6
|
import { u as G } from "./charts.fillGaps.hooks-zCMYcjxz.js";
|
|
7
7
|
const O = (s) => {
|
|
8
8
|
var n, l;
|
|
@@ -78,4 +78,4 @@ export {
|
|
|
78
78
|
O as B,
|
|
79
79
|
I as i
|
|
80
80
|
};
|
|
81
|
-
//# sourceMappingURL=index-
|
|
81
|
+
//# sourceMappingURL=index-hHZCF8mP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-hHZCF8mP.js","sources":["../src/components/charts/bars/BarChartGroupedPro/index.tsx"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { i18nSetup } from '../../../../theme/i18n/i18n';\nimport { ChartCard } from '../../shared/ChartCard/ChartCard';\nimport { resolveI18nProps } from '../../../component.utils';\nimport { BarChart } from '@embeddable.com/remarkable-ui';\nimport { getBarChartProOptions, getBarStackedChartProData } from '../bars.utils';\nimport { mergician } from 'mergician';\nimport { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { useFillGaps } from '../../charts.fillGaps.hooks';\n\ntype BarChartGroupedProProps = {\n description: string;\n groupBy: Dimension;\n measure: Measure;\n results: DataResponse;\n reverseXAxis: boolean;\n showLegend: boolean;\n showLogarithmicScale: boolean;\n showTooltips: boolean;\n showTotalLabels?: boolean;\n showValueLabels: boolean;\n title: string;\n xAxis: Dimension;\n xAxisLabel: string;\n yAxisLabel: string;\n yAxisRangeMax?: number;\n yAxisRangeMin?: number;\n onBarClicked: (args: {\n axisDimensionValue: string | null;\n groupingDimensionValue: string | null;\n }) => void;\n};\n\nconst BarChartGroupedPro = (props: BarChartGroupedProProps) => {\n const theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const {\n description,\n groupBy,\n measure,\n reverseXAxis,\n showLegend,\n showLogarithmicScale,\n showTooltips,\n showTotalLabels,\n showValueLabels,\n title,\n xAxis,\n xAxisLabel,\n yAxisLabel,\n yAxisRangeMax,\n yAxisRangeMin,\n onBarClicked,\n } = resolveI18nProps(props);\n\n const results = useFillGaps({\n results: props.results,\n dimension: props.xAxis,\n });\n\n const data = getBarStackedChartProData(\n {\n data: results.data,\n dimension: xAxis,\n groupDimension: groupBy,\n measure,\n },\n theme,\n );\n\n const options = mergician(\n getBarChartProOptions(\n { measures: [measure], horizontal: false, onBarClicked, data, dimension: xAxis },\n theme,\n ),\n theme.charts?.barChartGroupedPro?.options || {},\n );\n\n return (\n <ChartCard\n data={results}\n dimensionsAndMeasures={[measure, xAxis, groupBy]}\n errorMessage={results.error}\n subtitle={description}\n title={title}\n >\n <BarChart\n data={data}\n showLegend={showLegend}\n showTooltips={showTooltips}\n showValueLabels={showValueLabels}\n showLogarithmicScale={showLogarithmicScale}\n xAxisLabel={xAxisLabel}\n yAxisLabel={yAxisLabel}\n reverseXAxis={reverseXAxis}\n yAxisRangeMin={yAxisRangeMin}\n yAxisRangeMax={yAxisRangeMax}\n showTotalLabels={showTotalLabels}\n options={options}\n />\n </ChartCard>\n );\n};\n\nexport default BarChartGroupedPro;\n"],"names":["BarChartGroupedPro","props","theme","useTheme","i18nSetup","description","groupBy","measure","reverseXAxis","showLegend","showLogarithmicScale","showTooltips","showTotalLabels","showValueLabels","title","xAxis","xAxisLabel","yAxisLabel","yAxisRangeMax","yAxisRangeMin","onBarClicked","resolveI18nProps","results","useFillGaps","data","getBarStackedChartProData","options","mergician","getBarChartProOptions","_b","_a","jsx","ChartCard","BarChart"],"mappings":";;;;;;AAkCA,MAAMA,IAAqB,CAACC,MAAmC;;AAC7D,QAAMC,IAAQC,EAAA;AACd,EAAAC,EAAUF,CAAK;AAEf,QAAM;AAAA,IACJ,aAAAG;AAAA,IACA,SAAAC;AAAA,IACA,SAAAC;AAAA,IACA,cAAAC;AAAA,IACA,YAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,OAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,IACEC,EAAiBpB,CAAK,GAEpBqB,IAAUC,EAAY;AAAA,IAC1B,SAAStB,EAAM;AAAA,IACf,WAAWA,EAAM;AAAA,EAAA,CAClB,GAEKuB,IAAOC;AAAA,IACX;AAAA,MACE,MAAMH,EAAQ;AAAA,MACd,WAAWP;AAAA,MACX,gBAAgBT;AAAA,MAChB,SAAAC;AAAA,IAAA;AAAA,IAEFL;AAAA,EAAA,GAGIwB,IAAUC;AAAA,IACdC;AAAA,MACE,EAAE,UAAU,CAACrB,CAAO,GAAG,YAAY,IAAO,cAAAa,GAAc,MAAAI,GAAM,WAAWT,EAAA;AAAA,MACzEb;AAAA,IAAA;AAAA,MAEF2B,KAAAC,IAAA5B,EAAM,WAAN,gBAAA4B,EAAc,uBAAd,gBAAAD,EAAkC,YAAW,CAAA;AAAA,EAAC;AAGhD,SACEE,gBAAAA,EAAAA;AAAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMV;AAAA,MACN,uBAAuB,CAACf,GAASQ,GAAOT,CAAO;AAAA,MAC/C,cAAcgB,EAAQ;AAAA,MACtB,UAAUjB;AAAA,MACV,OAAAS;AAAA,MAEA,UAAAiB,gBAAAA,EAAAA;AAAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAAT;AAAA,UACA,YAAAf;AAAA,UACA,cAAAE;AAAA,UACA,iBAAAE;AAAA,UACA,sBAAAH;AAAA,UACA,YAAAM;AAAA,UACA,YAAAC;AAAA,UACA,cAAAT;AAAA,UACA,eAAAW;AAAA,UACA,eAAAD;AAAA,UACA,iBAAAN;AAAA,UACA,SAAAc;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;;;;"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { m as M, j as l, B as P } from "./Color.type.emb-
|
|
1
|
+
import { m as M, j as l, B as P } from "./Color.type.emb-CLYI-rua.js";
|
|
2
2
|
import { useTheme as y } from "@embeddable.com/react";
|
|
3
|
-
import { a as L, r as w } from "./component.inputs.constants-
|
|
4
|
-
import { C as S } from "./ChartCard-
|
|
5
|
-
import { a as _, b as v } from "./bars.utils-
|
|
3
|
+
import { a as L, r as w } from "./component.inputs.constants-BYwiwFNH.js";
|
|
4
|
+
import { C as S } from "./ChartCard-DWq8ltZe.js";
|
|
5
|
+
import { a as _, b as v } from "./bars.utils-fkN2-HS9.js";
|
|
6
6
|
import { u as D } from "./charts.fillGaps.hooks-zCMYcjxz.js";
|
|
7
7
|
const I = (t) => {
|
|
8
8
|
var i, n;
|
|
@@ -69,4 +69,4 @@ export {
|
|
|
69
69
|
I as B,
|
|
70
70
|
F as i
|
|
71
71
|
};
|
|
72
|
-
//# sourceMappingURL=index-
|
|
72
|
+
//# sourceMappingURL=index-za3bNggu.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index-
|
|
1
|
+
{"version":3,"file":"index-za3bNggu.js","sources":["../src/components/charts/bars/BarChartDefaultPro/index.tsx"],"sourcesContent":["import { useTheme } from '@embeddable.com/react';\nimport { Theme } from '../../../../theme/theme.types';\nimport { i18nSetup } from '../../../../theme/i18n/i18n';\nimport { ChartCard } from '../../shared/ChartCard/ChartCard';\nimport { resolveI18nProps } from '../../../component.utils';\nimport { BarChart } from '@embeddable.com/remarkable-ui';\nimport { getBarChartProData, getBarChartProOptions } from '../bars.utils';\nimport { mergician } from 'mergician';\nimport { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { useFillGaps } from '../../charts.fillGaps.hooks';\n\ntype BarChartDefaultProProps = {\n description: string;\n dimension: Dimension;\n measures: Measure[];\n results: DataResponse;\n title: string;\n xAxisLabel: string;\n xAxisMaxItems: number;\n yAxisLabel: string;\n yAxisRangeMin?: number;\n yAxisRangeMax?: number;\n showLegend: boolean;\n showLogarithmicScale: boolean;\n showTooltips: boolean;\n showValueLabels: boolean;\n reverseXAxis: boolean;\n onBarClicked: (args: { axisDimensionValue: string | null }) => void;\n};\n\nconst BarChartDefaultPro = (props: BarChartDefaultProProps) => {\n const theme = useTheme() as Theme;\n i18nSetup(theme);\n\n const {\n description,\n dimension,\n measures,\n title,\n xAxisLabel,\n xAxisMaxItems,\n yAxisLabel,\n yAxisRangeMin,\n yAxisRangeMax,\n showLegend,\n showLogarithmicScale,\n showTooltips,\n showValueLabels,\n reverseXAxis,\n onBarClicked,\n } = resolveI18nProps(props);\n\n const results = useFillGaps({\n results: props.results,\n dimension,\n });\n\n const data = getBarChartProData(\n { data: results.data, dimension, measures, maxItems: xAxisMaxItems },\n theme,\n );\n\n const options = mergician(\n getBarChartProOptions({ measures, horizontal: false, onBarClicked, data, dimension }, theme), // Format Y axis based on first measure\n theme.charts?.barChartDefaultPro?.options || {},\n );\n\n return (\n <ChartCard\n data={results}\n dimensionsAndMeasures={[dimension, ...measures]}\n errorMessage={results.error}\n subtitle={description}\n title={title}\n >\n <BarChart\n data={data}\n showLegend={showLegend}\n showTooltips={showTooltips}\n showValueLabels={showValueLabels}\n showLogarithmicScale={showLogarithmicScale}\n xAxisLabel={xAxisLabel}\n yAxisLabel={yAxisLabel}\n reverseXAxis={reverseXAxis}\n yAxisRangeMin={yAxisRangeMin}\n yAxisRangeMax={yAxisRangeMax}\n options={options}\n />\n </ChartCard>\n );\n};\n\nexport default BarChartDefaultPro;\n"],"names":["BarChartDefaultPro","props","theme","useTheme","i18nSetup","description","dimension","measures","title","xAxisLabel","xAxisMaxItems","yAxisLabel","yAxisRangeMin","yAxisRangeMax","showLegend","showLogarithmicScale","showTooltips","showValueLabels","reverseXAxis","onBarClicked","resolveI18nProps","results","useFillGaps","data","getBarChartProData","options","mergician","getBarChartProOptions","_b","_a","jsx","ChartCard","BarChart"],"mappings":";;;;;;AA8BA,MAAMA,IAAqB,CAACC,MAAmC;;AAC7D,QAAMC,IAAQC,EAAA;AACd,EAAAC,EAAUF,CAAK;AAEf,QAAM;AAAA,IACJ,aAAAG;AAAA,IACA,WAAAC;AAAA,IACA,UAAAC;AAAA,IACA,OAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,eAAAC;AAAA,IACA,eAAAC;AAAA,IACA,YAAAC;AAAA,IACA,sBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,iBAAAC;AAAA,IACA,cAAAC;AAAA,IACA,cAAAC;AAAA,EAAA,IACEC,EAAiBnB,CAAK,GAEpBoB,IAAUC,EAAY;AAAA,IAC1B,SAASrB,EAAM;AAAA,IACf,WAAAK;AAAA,EAAA,CACD,GAEKiB,IAAOC;AAAA,IACX,EAAE,MAAMH,EAAQ,MAAM,WAAAf,GAAW,UAAAC,GAAU,UAAUG,EAAA;AAAA,IACrDR;AAAA,EAAA,GAGIuB,IAAUC;AAAA,IACdC,EAAsB,EAAE,UAAApB,GAAU,YAAY,IAAO,cAAAY,GAAc,MAAAI,GAAM,WAAAjB,EAAA,GAAaJ,CAAK;AAAA;AAAA,MAC3F0B,KAAAC,IAAA3B,EAAM,WAAN,gBAAA2B,EAAc,uBAAd,gBAAAD,EAAkC,YAAW,CAAA;AAAA,EAAC;AAGhD,SACEE,gBAAAA,EAAAA;AAAAA,IAACC;AAAA,IAAA;AAAA,MACC,MAAMV;AAAA,MACN,uBAAuB,CAACf,GAAW,GAAGC,CAAQ;AAAA,MAC9C,cAAcc,EAAQ;AAAA,MACtB,UAAUhB;AAAA,MACV,OAAAG;AAAA,MAEA,UAAAsB,gBAAAA,EAAAA;AAAAA,QAACE;AAAA,QAAA;AAAA,UACC,MAAAT;AAAA,UACA,YAAAT;AAAA,UACA,cAAAE;AAAA,UACA,iBAAAC;AAAA,UACA,sBAAAF;AAAA,UACA,YAAAN;AAAA,UACA,YAAAE;AAAA,UACA,cAAAO;AAAA,UACA,eAAAN;AAAA,UACA,eAAAC;AAAA,UACA,SAAAY;AAAA,QAAA;AAAA,MAAA;AAAA,IACF;AAAA,EAAA;AAGN;;;;"}
|
package/dist/index.d.ts
CHANGED
|
@@ -32,6 +32,7 @@ export * as TableChartPaginatedPro from './components/charts/tables/TableChartPa
|
|
|
32
32
|
export * from './components/charts/tables/tables.utils';
|
|
33
33
|
export { ChartCard } from './components/charts/shared/ChartCard/ChartCard';
|
|
34
34
|
export * from './components/component.inputs.constants';
|
|
35
|
+
export * from './components/component.subinputs.constants';
|
|
35
36
|
export * as ComparisonPeriodSelectFieldPro from './components/editors/ComparisonPeriodSelectFieldPro';
|
|
36
37
|
export * from './components/editors/ComparisonPeriodSelectFieldPro/ComparisonPeriodSelectFieldPro.utils';
|
|
37
38
|
export * as DateRangeSelectFieldPro from './components/editors/dates/DateRangePickerPresetsPro';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAG7D,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAGxD,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAGpD,cAAc,qBAAqB,CAAC;AACpC,cAAc,yBAAyB,CAAC;AAGxC,YAAY,EACV,eAAe,EACf,iBAAiB,EACjB,eAAe,EACf,cAAc,GACf,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAGtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,8BAA8B,CAAC;AAGhE,OAAO,KAAK,kBAAkB,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,kBAAkB,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,kBAAkB,MAAM,6CAA6C,CAAC;AAClF,OAAO,KAAK,4BAA4B,MAAM,uDAAuD,CAAC;AACtG,OAAO,KAAK,4BAA4B,MAAM,uDAAuD,CAAC;AACtG,OAAO,KAAK,4BAA4B,MAAM,uDAAuD,CAAC;AACtG,cAAc,qCAAqC,CAAC;AAEpD,OAAO,KAAK,iBAAiB,MAAM,4CAA4C,CAAC;AAChF,OAAO,KAAK,2BAA2B,MAAM,sDAAsD,CAAC;AAEpG,OAAO,KAAK,mBAAmB,MAAM,+CAA+C,CAAC;AACrF,OAAO,KAAK,mBAAmB,MAAM,+CAA+C,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AAI,oBAAoB,EAAE,MAAM,8CAA8C,CAAC;AAG/F,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,wBAAwB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,84 +1,87 @@
|
|
|
1
1
|
import { g as o } from "./object.utils-D_Zzon-H.js";
|
|
2
|
-
import { C as t, i, a as
|
|
3
|
-
import { r as
|
|
4
|
-
import { g as
|
|
5
|
-
import { i as
|
|
6
|
-
import { i as
|
|
7
|
-
import { i as
|
|
8
|
-
import { i as
|
|
9
|
-
import { i as
|
|
10
|
-
import { i as
|
|
11
|
-
import { a as
|
|
12
|
-
import { i as
|
|
13
|
-
import { i as
|
|
14
|
-
import { i as
|
|
15
|
-
import { i as
|
|
16
|
-
import { i as
|
|
17
|
-
import { i as
|
|
18
|
-
import { i as
|
|
19
|
-
import { i as
|
|
20
|
-
import { g as
|
|
21
|
-
import { i as
|
|
22
|
-
import { i as
|
|
23
|
-
import { i as
|
|
24
|
-
import { C as
|
|
25
|
-
import { i as
|
|
26
|
-
import { i as
|
|
27
|
-
import { i as
|
|
28
|
-
import { i as
|
|
29
|
-
import { E as
|
|
30
|
-
import { i as
|
|
2
|
+
import { C as t, d as s, i, a as p, b as m, r as n, s as P, t as C } from "./component.inputs.constants-BYwiwFNH.js";
|
|
3
|
+
import { r as f } from "./charts.utils-BiED7HDM.js";
|
|
4
|
+
import { g as h } from "./formatter.utils-C6e5AE1P.js";
|
|
5
|
+
import { i as d } from "./index-za3bNggu.js";
|
|
6
|
+
import { i as b } from "./index-B7ZOvR_0.js";
|
|
7
|
+
import { i as S } from "./index-hHZCF8mP.js";
|
|
8
|
+
import { i as L } from "./index-DP-lVPuh.js";
|
|
9
|
+
import { i as T } from "./index-CBauec4T.js";
|
|
10
|
+
import { i as F } from "./index-Do4E11C9.js";
|
|
11
|
+
import { a as G, b as k, g as I } from "./bars.utils-fkN2-HS9.js";
|
|
12
|
+
import { i as v } from "./index-PV9-pvEj.js";
|
|
13
|
+
import { i as A } from "./index-DGoq-GmG.js";
|
|
14
|
+
import { i as R, g as y, a as E } from "./index-BKe5XLWq.js";
|
|
15
|
+
import { i as j, g as w, a as V } from "./index-agIiR5E8.js";
|
|
16
|
+
import { i as q, g as J, a as Q } from "./index-De2fu_3w.js";
|
|
17
|
+
import { i as X } from "./index-CdT1o7ra.js";
|
|
18
|
+
import { i as Z } from "./index-BiJMrvpt.js";
|
|
19
|
+
import { i as $ } from "./index-IERhvJoR.js";
|
|
20
|
+
import { g as ar, a as or } from "./pies.utils--MuyzEyP.js";
|
|
21
|
+
import { i as tr } from "./index-BLrDwmLF.js";
|
|
22
|
+
import { i as ir } from "./index-AkhRDk1Q.js";
|
|
23
|
+
import { i as mr, g as nr, a as Pr, b as Cr, c as lr } from "./index-BPWmQIUP.js";
|
|
24
|
+
import { C as gr } from "./ChartCard-DWq8ltZe.js";
|
|
25
|
+
import { i as xr, g as dr, a as ur } from "./index-Ybpp0kam.js";
|
|
26
|
+
import { i as Dr, g as Sr } from "./index-B6Sxhv5V.js";
|
|
27
|
+
import { i as Lr } from "./index-DJy_zcds.js";
|
|
28
|
+
import { i as Tr } from "./index-Bvnqafeu.js";
|
|
29
|
+
import { E as Fr } from "./EditorCard-GIL6-rb_.js";
|
|
30
|
+
import { i as Gr, s as kr } from "./color.utils-BSg_DFOh.js";
|
|
31
31
|
export {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
32
|
+
L as BarChartDefaultHorizontalPro,
|
|
33
|
+
d as BarChartDefaultPro,
|
|
34
|
+
F as BarChartGroupedHorizontalPro,
|
|
35
|
+
S as BarChartGroupedPro,
|
|
36
|
+
T as BarChartStackedHorizontalPro,
|
|
37
|
+
b as BarChartStackedPro,
|
|
38
|
+
gr as ChartCard,
|
|
39
|
+
xr as ComparisonPeriodSelectFieldPro,
|
|
40
40
|
t as ComparisonPeriodType,
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
41
|
+
Dr as DateRangeSelectFieldPro,
|
|
42
|
+
X as DonutChartPro,
|
|
43
|
+
$ as DonutLabelChartPro,
|
|
44
|
+
Fr as EditorCard,
|
|
45
|
+
tr as HeatMapPro,
|
|
46
|
+
A as KpiChartNumberComparisonPro,
|
|
47
|
+
v as KpiChartNumberPro,
|
|
48
|
+
q as LineChartComparisonDefaultPro,
|
|
49
|
+
R as LineChartDefaultPro,
|
|
50
|
+
j as LineChartGroupedPro,
|
|
51
|
+
Lr as MultiSelectFieldPro,
|
|
52
|
+
Z as PieChartPro,
|
|
53
|
+
ir as PivotTablePro,
|
|
54
|
+
Tr as SingleSelectFieldPro,
|
|
55
|
+
mr as TableChartPaginatedPro,
|
|
56
|
+
s as dimensionMeasureSubInputs,
|
|
57
|
+
G as getBarChartProData,
|
|
58
|
+
k as getBarChartProOptions,
|
|
59
|
+
I as getBarStackedChartProData,
|
|
60
|
+
dr as getComparisonPeriodSelectFieldProOptions,
|
|
61
|
+
Sr as getDateRangeSelectFieldProOptions,
|
|
62
|
+
J as getLineChartComparisonProData,
|
|
63
|
+
Q as getLineChartComparisonProOptions,
|
|
64
|
+
w as getLineChartGroupedProData,
|
|
65
|
+
V as getLineChartGroupedProOptions,
|
|
66
|
+
y as getLineChartProData,
|
|
67
|
+
E as getLineChartProOptions,
|
|
67
68
|
o as getObjectStableKey,
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
69
|
+
ar as getPieChartProData,
|
|
70
|
+
or as getPieChartProOptions,
|
|
71
|
+
nr as getTableHeaderAlign,
|
|
72
|
+
Pr as getTableHeaderMinWidth,
|
|
73
|
+
Cr as getTableHeaders,
|
|
74
|
+
lr as getTableRows,
|
|
75
|
+
h as getThemeFormatter,
|
|
75
76
|
i as i18n,
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
77
|
+
p as i18nSetup,
|
|
78
|
+
m as inputs,
|
|
79
|
+
Gr as isColorValid,
|
|
80
|
+
ur as isComparisonPeriodAvailable,
|
|
81
|
+
f as remarkableTheme,
|
|
82
|
+
n as resolveI18nProps,
|
|
83
|
+
kr as setColorAlpha,
|
|
84
|
+
P as subInputs,
|
|
85
|
+
C as timeDimensionSubInputs
|
|
83
86
|
};
|
|
84
87
|
//# sourceMappingURL=index.js.map
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { r as g, g as b } from "./charts.utils-
|
|
2
|
-
import { g as u } from "./formatter.utils-
|
|
1
|
+
import { r as g, g as b } from "./charts.utils-BiED7HDM.js";
|
|
2
|
+
import { g as u } from "./formatter.utils-C6e5AE1P.js";
|
|
3
3
|
import { g as h, a as c } from "./object.utils-D_Zzon-H.js";
|
|
4
|
-
import { a as C } from "./Color.type.emb-
|
|
5
|
-
import { i as f } from "./component.inputs.constants-
|
|
4
|
+
import { a as C } from "./Color.type.emb-CLYI-rua.js";
|
|
5
|
+
import { i as f } from "./component.inputs.constants-BYwiwFNH.js";
|
|
6
6
|
const T = (a, o = g) => {
|
|
7
7
|
const s = u(o);
|
|
8
8
|
if (!a.data)
|
|
@@ -70,4 +70,4 @@ export {
|
|
|
70
70
|
w as a,
|
|
71
71
|
T as g
|
|
72
72
|
};
|
|
73
|
-
//# sourceMappingURL=pies.utils
|
|
73
|
+
//# sourceMappingURL=pies.utils--MuyzEyP.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"pies.utils
|
|
1
|
+
{"version":3,"file":"pies.utils--MuyzEyP.js","sources":["../src/components/charts/pies/pies.utils.ts"],"sourcesContent":["import { DataResponse, Dimension, Measure } from '@embeddable.com/core';\nimport { ChartData, ChartOptions } from 'chart.js';\nimport { groupTailAsOther } from '../charts.utils';\nimport { Theme } from '../../../theme/theme.types';\nimport { remarkableTheme } from '../../../theme/theme.constants';\nimport { getThemeFormatter } from '../../../theme/formatter/formatter.utils';\nimport { getColor } from '../../../theme/styles/styles.utils';\nimport { getChartColors } from '@embeddable.com/remarkable-ui';\nimport { i18n } from '../../../theme/i18n/i18n';\nimport { getObjectStableKey } from '../../../utils.ts/object.utils';\n\nexport const getPieChartProData = (\n props: {\n data: DataResponse['data'];\n dimension: Dimension;\n measure: Measure;\n maxLegendItems?: number;\n },\n theme: Theme = remarkableTheme,\n): ChartData<'pie'> => {\n const themeFormatter = getThemeFormatter(theme);\n\n if (!props.data)\n return {\n labels: [],\n datasets: [{ data: [] }],\n };\n\n const groupedData = groupTailAsOther(\n props.data,\n props.dimension,\n [props.measure],\n props.maxLegendItems,\n );\n\n const themeKey = getObjectStableKey(theme);\n const chartColors = getChartColors();\n const backgroundColor = groupedData.map((item, i) =>\n getColor(\n `${themeKey}.charts.backgroundColors`,\n `${props.dimension.name}.${item[props.dimension.name]}`,\n theme.charts.backgroundColors ?? chartColors,\n i,\n ),\n );\n\n const borderColor = groupedData.map((item, i) =>\n getColor(\n `${themeKey}.charts.borderColors`,\n `${props.dimension.name}.${item[props.dimension.name]}`,\n theme.charts.borderColors ?? chartColors,\n i,\n ),\n );\n\n return {\n labels: groupedData.map((item) => {\n const value = item[props.dimension.name];\n const formattedValue = themeFormatter.data(props.dimension, value);\n\n // If formatter did not work, try i18n translation\n if (value === formattedValue) {\n return i18n.t(value);\n }\n return formattedValue;\n }),\n datasets: [\n {\n data: groupedData.map((item) => item[props.measure.name]),\n backgroundColor,\n borderColor,\n },\n ],\n };\n};\n\nexport const getPieChartProOptions = (\n measure: Measure,\n theme: Theme = remarkableTheme,\n): Partial<ChartOptions<'pie'>> => {\n const themeFormatter = getThemeFormatter(theme);\n\n return {\n plugins: {\n legend: { position: theme.charts.legendPosition ?? 'bottom' },\n datalabels: {\n formatter: (value: string | number) => themeFormatter.data(measure, value),\n },\n tooltip: {\n callbacks: {\n label(context) {\n const raw = context.raw as number;\n const total = context.dataset.data.reduce(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n (sum: number, v: any) => sum + parseFloat(v),\n 0,\n );\n const pct = Math.round((raw / total) * 100);\n return `${themeFormatter.data(measure, raw)} (${pct}%)`;\n },\n },\n },\n },\n };\n};\n"],"names":["getPieChartProData","props","theme","remarkableTheme","themeFormatter","getThemeFormatter","groupedData","groupTailAsOther","themeKey","getObjectStableKey","chartColors","getChartColors","backgroundColor","item","i","getColor","borderColor","value","formattedValue","i18n","getPieChartProOptions","measure","context","raw","total","sum","v","pct"],"mappings":";;;;;AAWO,MAAMA,IAAqB,CAChCC,GAMAC,IAAeC,MACM;AACrB,QAAMC,IAAiBC,EAAkBH,CAAK;AAE9C,MAAI,CAACD,EAAM;AACT,WAAO;AAAA,MACL,QAAQ,CAAA;AAAA,MACR,UAAU,CAAC,EAAE,MAAM,IAAI;AAAA,IAAA;AAG3B,QAAMK,IAAcC;AAAA,IAClBN,EAAM;AAAA,IACNA,EAAM;AAAA,IACN,CAACA,EAAM,OAAO;AAAA,IACdA,EAAM;AAAA,EAAA,GAGFO,IAAWC,EAAmBP,CAAK,GACnCQ,IAAcC,EAAA,GACdC,IAAkBN,EAAY;AAAA,IAAI,CAACO,GAAMC,MAC7CC;AAAA,MACE,GAAGP,CAAQ;AAAA,MACX,GAAGP,EAAM,UAAU,IAAI,IAAIY,EAAKZ,EAAM,UAAU,IAAI,CAAC;AAAA,MACrDC,EAAM,OAAO,oBAAoBQ;AAAA,MACjCI;AAAA,IAAA;AAAA,EACF,GAGIE,IAAcV,EAAY;AAAA,IAAI,CAACO,GA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