@gooddata/sdk-ui-kit 11.13.0-alpha.6 → 11.14.0-alpha.0
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/esm/@ui/UiCombobox/UiCombobox.d.ts +32 -0
- package/esm/@ui/UiCombobox/UiCombobox.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/UiCombobox.js +32 -0
- package/esm/@ui/UiCombobox/UiCombobox.js.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxContext.d.ts +10 -0
- package/esm/@ui/UiCombobox/UiComboboxContext.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxContext.js +16 -0
- package/esm/@ui/UiCombobox/UiComboboxContext.js.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxInput.d.ts +6 -0
- package/esm/@ui/UiCombobox/UiComboboxInput.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxInput.js +38 -0
- package/esm/@ui/UiCombobox/UiComboboxInput.js.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxList.d.ts +12 -0
- package/esm/@ui/UiCombobox/UiComboboxList.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxList.js +13 -0
- package/esm/@ui/UiCombobox/UiComboboxList.js.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxListItem.d.ts +38 -0
- package/esm/@ui/UiCombobox/UiComboboxListItem.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxListItem.js +56 -0
- package/esm/@ui/UiCombobox/UiComboboxListItem.js.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxPopup.d.ts +6 -0
- package/esm/@ui/UiCombobox/UiComboboxPopup.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/UiComboboxPopup.js +13 -0
- package/esm/@ui/UiCombobox/UiComboboxPopup.js.map +1 -0
- package/esm/@ui/UiCombobox/comboboxBem.d.ts +2 -0
- package/esm/@ui/UiCombobox/comboboxBem.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/comboboxBem.js +4 -0
- package/esm/@ui/UiCombobox/comboboxBem.js.map +1 -0
- package/esm/@ui/UiCombobox/index.d.ts +8 -0
- package/esm/@ui/UiCombobox/index.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/index.js +8 -0
- package/esm/@ui/UiCombobox/index.js.map +1 -0
- package/esm/@ui/UiCombobox/types.d.ts +57 -0
- package/esm/@ui/UiCombobox/types.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/types.js +3 -0
- package/esm/@ui/UiCombobox/types.js.map +1 -0
- package/esm/@ui/UiCombobox/useCombobox.d.ts +4 -0
- package/esm/@ui/UiCombobox/useCombobox.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/useCombobox.js +168 -0
- package/esm/@ui/UiCombobox/useCombobox.js.map +1 -0
- package/esm/@ui/UiCombobox/utils.d.ts +3 -0
- package/esm/@ui/UiCombobox/utils.d.ts.map +1 -0
- package/esm/@ui/UiCombobox/utils.js +6 -0
- package/esm/@ui/UiCombobox/utils.js.map +1 -0
- package/esm/@ui/UiPagedVirtualList/UiPagedVirtualList.d.ts.map +1 -1
- package/esm/@ui/UiPagedVirtualList/UiPagedVirtualList.js +4 -4
- package/esm/@ui/UiPagedVirtualList/UiPagedVirtualList.js.map +1 -1
- package/esm/@ui/UiTags/UiTags.d.ts +1 -1
- package/esm/@ui/UiTags/UiTags.d.ts.map +1 -1
- package/esm/@ui/UiTags/UiTags.js +24 -14
- package/esm/@ui/UiTags/UiTags.js.map +1 -1
- package/esm/@ui/UiTags/interactions.d.ts.map +1 -1
- package/esm/@ui/UiTags/interactions.js +4 -5
- package/esm/@ui/UiTags/interactions.js.map +1 -1
- package/esm/@ui/UiTags/types.d.ts +2 -0
- package/esm/@ui/UiTags/types.d.ts.map +1 -1
- package/esm/@ui/UiTags/types.js +1 -0
- package/esm/@ui/UiTags/types.js.map +1 -1
- package/esm/index.d.ts +1 -0
- package/esm/index.d.ts.map +1 -1
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/esm/measureNumberFormat/hooks/useMetricTypePresets.d.ts +1 -28
- package/esm/measureNumberFormat/hooks/useMetricTypePresets.d.ts.map +1 -1
- package/esm/measureNumberFormat/hooks/useMetricTypePresets.js +18 -21
- package/esm/measureNumberFormat/hooks/useMetricTypePresets.js.map +1 -1
- package/esm/measureNumberFormat/index.d.ts +2 -2
- package/esm/measureNumberFormat/index.d.ts.map +1 -1
- package/esm/measureNumberFormat/index.js +2 -2
- package/esm/measureNumberFormat/index.js.map +1 -1
- package/esm/measureNumberFormat/presets/currencyPresets.d.ts +1 -7
- package/esm/measureNumberFormat/presets/currencyPresets.d.ts.map +1 -1
- package/esm/measureNumberFormat/presets/currencyPresets.js +5 -14
- package/esm/measureNumberFormat/presets/currencyPresets.js.map +1 -1
- package/esm/measureNumberFormat/presets/standardPresets.d.ts +1 -7
- package/esm/measureNumberFormat/presets/standardPresets.d.ts.map +1 -1
- package/esm/measureNumberFormat/presets/standardPresets.js +21 -17
- package/esm/measureNumberFormat/presets/standardPresets.js.map +1 -1
- package/esm/measureNumberFormat/presets/templates.d.ts +4 -4
- package/esm/measureNumberFormat/presets/templates.d.ts.map +1 -1
- package/esm/measureNumberFormat/presets/templates.js +65 -25
- package/esm/measureNumberFormat/presets/templates.js.map +1 -1
- package/esm/sdk-ui-kit.d.ts +158 -49
- package/package.json +9 -9
- package/src/@ui/UiCombobox/UiCombobox.scss +128 -0
- package/src/@ui/index.scss +1 -0
- package/styles/css/main.css +127 -3
- package/styles/css/main.css.map +1 -1
|
@@ -21,22 +21,6 @@ export interface UseMetricTypePresetsConfig {
|
|
|
21
21
|
formatMessage: (descriptor: {
|
|
22
22
|
id: string;
|
|
23
23
|
}) => string;
|
|
24
|
-
/**
|
|
25
|
-
* Optional prefix for preset message IDs.
|
|
26
|
-
* Default: "metricComponent.numberFormat.preset"
|
|
27
|
-
*
|
|
28
|
-
* Use this to customize the translation keys for presets.
|
|
29
|
-
* For example, set to "measure_number_format.preset" for Analytical Designer compatibility.
|
|
30
|
-
*/
|
|
31
|
-
presetMessageIdPrefix?: string;
|
|
32
|
-
/**
|
|
33
|
-
* Optional prefix for template message IDs.
|
|
34
|
-
* Default: "metricComponent.numberFormat.template"
|
|
35
|
-
*
|
|
36
|
-
* Use this to customize the translation keys for templates.
|
|
37
|
-
* For example, set to "measure_number_format.template" for Analytical Designer compatibility.
|
|
38
|
-
*/
|
|
39
|
-
templateMessageIdPrefix?: string;
|
|
40
24
|
}
|
|
41
25
|
/**
|
|
42
26
|
* Result from the useMetricTypePresets hook.
|
|
@@ -75,20 +59,9 @@ export interface UseMetricTypePresetsResult {
|
|
|
75
59
|
* });
|
|
76
60
|
* ```
|
|
77
61
|
*
|
|
78
|
-
* @example
|
|
79
|
-
* ```tsx
|
|
80
|
-
* // With custom message ID prefixes (e.g., for Analytical Designer)
|
|
81
|
-
* const { presets, templates } = useMetricTypePresets({
|
|
82
|
-
* metricType: undefined,
|
|
83
|
-
* formatMessage: (d) => intl.formatMessage(d),
|
|
84
|
-
* presetMessageIdPrefix: "measure_number_format.preset",
|
|
85
|
-
* templateMessageIdPrefix: "measure_number_format.template",
|
|
86
|
-
* });
|
|
87
|
-
* ```
|
|
88
|
-
*
|
|
89
62
|
* @internal
|
|
90
63
|
*/
|
|
91
|
-
export declare function useMetricTypePresets({ metricType, currencyFormatOverride, formatMessage,
|
|
64
|
+
export declare function useMetricTypePresets({ metricType, currencyFormatOverride, formatMessage, }: UseMetricTypePresetsConfig): UseMetricTypePresetsResult;
|
|
92
65
|
/**
|
|
93
66
|
* Hook that creates standard numeric format presets.
|
|
94
67
|
* Use this when you don't need metric type awareness.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMetricTypePresets.d.ts","sourceRoot":"","sources":["../../../src/measureNumberFormat/hooks/useMetricTypePresets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useMetricTypePresets.d.ts","sourceRoot":"","sources":["../../../src/measureNumberFormat/hooks/useMetricTypePresets.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAKtD,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAUzE;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACvC;;;OAGG;IACH,UAAU,CAAC,EAAE,UAAU,CAAC;IAExB;;;OAGG;IACH,sBAAsB,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IAEvC;;OAEG;IACH,aAAa,EAAE,CAAC,UAAU,EAAE;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,KAAK,MAAM,CAAC;CACzD;AAED;;;GAGG;AACH,MAAM,WAAW,0BAA0B;IACvC;;;;OAIG;IACH,OAAO,EAAE,aAAa,EAAE,CAAC;IAEzB;;;OAGG;IACH,SAAS,EAAE,eAAe,EAAE,CAAC;IAE7B;;OAEG;IACH,aAAa,EAAE,aAAa,GAAG,IAAI,CAAC;CACvC;AAED;;;;;;;;;;;;;;;;;GAiBG;AACH,wBAAgB,oBAAoB,CAAC,EACjC,UAAU,EACV,sBAAsB,EACtB,aAAa,GAChB,EAAE,0BAA0B,GAAG,0BAA0B,CAwDzD;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,CAAC,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,GAAG,aAAa,EAAE,CAEzG;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAC9B,aAAa,EAAE,CAAC,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,EACrD,wBAAwB,UAAQ,GACjC,eAAe,EAAE,CAQnB"}
|
|
@@ -1,8 +1,16 @@
|
|
|
1
1
|
// (C) 2025 GoodData Corporation
|
|
2
2
|
import { useMemo } from "react";
|
|
3
|
+
import { defineMessages } from "react-intl";
|
|
3
4
|
import { createCurrencyPresets } from "../presets/currencyPresets.js";
|
|
4
|
-
import {
|
|
5
|
-
import { CURRENCY_TEMPLATE_IDS,
|
|
5
|
+
import { createStandardPresets } from "../presets/standardPresets.js";
|
|
6
|
+
import { CURRENCY_TEMPLATE_IDS, createAllTemplates } from "../presets/templates.js";
|
|
7
|
+
/**
|
|
8
|
+
* Message IDs for metric type presets.
|
|
9
|
+
* @internal
|
|
10
|
+
*/
|
|
11
|
+
const metricTypePresetMessages = defineMessages({
|
|
12
|
+
inherit: { id: "measureNumberFormat.numberFormat.preset.inherit" },
|
|
13
|
+
});
|
|
6
14
|
/**
|
|
7
15
|
* Hook that creates format presets and templates based on metric type.
|
|
8
16
|
*
|
|
@@ -19,24 +27,13 @@ import { CURRENCY_TEMPLATE_IDS, DEFAULT_TEMPLATE_PREFIX, createAllTemplates } fr
|
|
|
19
27
|
* });
|
|
20
28
|
* ```
|
|
21
29
|
*
|
|
22
|
-
* @example
|
|
23
|
-
* ```tsx
|
|
24
|
-
* // With custom message ID prefixes (e.g., for Analytical Designer)
|
|
25
|
-
* const { presets, templates } = useMetricTypePresets({
|
|
26
|
-
* metricType: undefined,
|
|
27
|
-
* formatMessage: (d) => intl.formatMessage(d),
|
|
28
|
-
* presetMessageIdPrefix: "measure_number_format.preset",
|
|
29
|
-
* templateMessageIdPrefix: "measure_number_format.template",
|
|
30
|
-
* });
|
|
31
|
-
* ```
|
|
32
|
-
*
|
|
33
30
|
* @internal
|
|
34
31
|
*/
|
|
35
|
-
export function useMetricTypePresets({ metricType, currencyFormatOverride, formatMessage,
|
|
32
|
+
export function useMetricTypePresets({ metricType, currencyFormatOverride, formatMessage, }) {
|
|
36
33
|
// Standard numeric presets
|
|
37
|
-
const standardPresets = useMemo(() => createStandardPresets(formatMessage
|
|
34
|
+
const standardPresets = useMemo(() => createStandardPresets(formatMessage), [formatMessage]);
|
|
38
35
|
// Base currency presets
|
|
39
|
-
const baseCurrencyPresets = useMemo(() => createCurrencyPresets(formatMessage
|
|
36
|
+
const baseCurrencyPresets = useMemo(() => createCurrencyPresets(formatMessage), [formatMessage]);
|
|
40
37
|
// Currency presets, excluding the override format if it matches a preset
|
|
41
38
|
const currencyPresets = useMemo(() => {
|
|
42
39
|
if (!currencyFormatOverride) {
|
|
@@ -48,14 +45,14 @@ export function useMetricTypePresets({ metricType, currencyFormatOverride, forma
|
|
|
48
45
|
const inheritPreset = useMemo(() => {
|
|
49
46
|
if (metricType === "CURRENCY" && currencyFormatOverride) {
|
|
50
47
|
return {
|
|
51
|
-
name: formatMessage({ id:
|
|
48
|
+
name: formatMessage({ id: metricTypePresetMessages.inherit.id }),
|
|
52
49
|
localIdentifier: "inherit",
|
|
53
50
|
format: currencyFormatOverride,
|
|
54
51
|
previewNumber: 1000.12,
|
|
55
52
|
};
|
|
56
53
|
}
|
|
57
54
|
return null;
|
|
58
|
-
}, [metricType, currencyFormatOverride, formatMessage
|
|
55
|
+
}, [metricType, currencyFormatOverride, formatMessage]);
|
|
59
56
|
// Final presets based on metric type
|
|
60
57
|
const presets = useMemo(() => {
|
|
61
58
|
if (metricType === "CURRENCY") {
|
|
@@ -70,11 +67,11 @@ export function useMetricTypePresets({ metricType, currencyFormatOverride, forma
|
|
|
70
67
|
const templates = useMemo(() => {
|
|
71
68
|
if (metricType === "CURRENCY") {
|
|
72
69
|
// For CURRENCY metrics, show only currency-specific templates
|
|
73
|
-
return createAllTemplates(formatMessage
|
|
70
|
+
return createAllTemplates(formatMessage).filter((t) => CURRENCY_TEMPLATE_IDS.includes(t.localIdentifier));
|
|
74
71
|
}
|
|
75
72
|
// For non-CURRENCY, show all templates
|
|
76
|
-
return createAllTemplates(formatMessage
|
|
77
|
-
}, [metricType, formatMessage
|
|
73
|
+
return createAllTemplates(formatMessage);
|
|
74
|
+
}, [metricType, formatMessage]);
|
|
78
75
|
return {
|
|
79
76
|
presets,
|
|
80
77
|
templates,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMetricTypePresets.js","sourceRoot":"","sources":["../../../src/measureNumberFormat/hooks/useMetricTypePresets.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"useMetricTypePresets.js","sourceRoot":"","sources":["../../../src/measureNumberFormat/hooks/useMetricTypePresets.ts"],"names":[],"mappings":"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"}
|
|
@@ -4,8 +4,8 @@ export { MeasureNumberFormat } from "./MeasureNumberFormat.js";
|
|
|
4
4
|
export { validateCurrencyFormat, isCurrencyFormat, type CurrencyFormatValidationErrorCode, type ICurrencyFormatValidationError, type ICurrencyFormatValidationOptions, type ICurrencyFormatValidationResult, } from "./validation/currencyFormatValidator.js";
|
|
5
5
|
export { useCurrencyFormatDefaults } from "./hooks/useCurrencyFormatDefaults.js";
|
|
6
6
|
export type { UseCurrencyFormatDefaultsConfig } from "./hooks/useCurrencyFormatDefaults.js";
|
|
7
|
-
export { createCurrencyPresets, CURRENCY_PRESET_DEFINITIONS,
|
|
8
|
-
export { createStandardPresets, STANDARD_PRESET_DEFINITIONS,
|
|
7
|
+
export { createCurrencyPresets, CURRENCY_PRESET_DEFINITIONS, type ICurrencyPresetDefinition, } from "./presets/currencyPresets.js";
|
|
8
|
+
export { createStandardPresets, STANDARD_PRESET_DEFINITIONS, type IStandardPresetDefinition, } from "./presets/standardPresets.js";
|
|
9
9
|
export { createTemplates, createAllTemplates, STANDARD_TEMPLATE_DEFINITIONS, CURRENCY_TEMPLATE_DEFINITIONS, ADVANCED_TEMPLATE_DEFINITIONS, CURRENCY_TEMPLATE_IDS, DEFAULT_TEMPLATE_PREFIX, type ITemplateDefinition, } from "./presets/templates.js";
|
|
10
10
|
export { useMetricTypePresets, useStandardPresets, useFormatTemplates, type UseMetricTypePresetsConfig, type UseMetricTypePresetsResult, } from "./hooks/useMetricTypePresets.js";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/measureNumberFormat/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,iCAAiC,EACtC,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,GACvC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,YAAY,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EACH,qBAAqB,EACrB,2BAA2B,EAC3B,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/measureNumberFormat/index.ts"],"names":[],"mappings":"AAEA,cAAc,cAAc,CAAC;AAC7B,YAAY,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AAC7E,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACH,sBAAsB,EACtB,gBAAgB,EAChB,KAAK,iCAAiC,EACtC,KAAK,8BAA8B,EACnC,KAAK,gCAAgC,EACrC,KAAK,+BAA+B,GACvC,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AACjF,YAAY,EAAE,+BAA+B,EAAE,MAAM,sCAAsC,CAAC;AAC5F,OAAO,EACH,qBAAqB,EACrB,2BAA2B,EAC3B,KAAK,yBAAyB,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,qBAAqB,EACrB,2BAA2B,EAC3B,KAAK,yBAAyB,GACjC,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,qBAAqB,EACrB,uBAAuB,EACvB,KAAK,mBAAmB,GAC3B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,EAClB,KAAK,0BAA0B,EAC/B,KAAK,0BAA0B,GAClC,MAAM,iCAAiC,CAAC"}
|
|
@@ -3,8 +3,8 @@ export * from "./typings.js";
|
|
|
3
3
|
export { MeasureNumberFormat } from "./MeasureNumberFormat.js";
|
|
4
4
|
export { validateCurrencyFormat, isCurrencyFormat, } from "./validation/currencyFormatValidator.js";
|
|
5
5
|
export { useCurrencyFormatDefaults } from "./hooks/useCurrencyFormatDefaults.js";
|
|
6
|
-
export { createCurrencyPresets, CURRENCY_PRESET_DEFINITIONS,
|
|
7
|
-
export { createStandardPresets, STANDARD_PRESET_DEFINITIONS,
|
|
6
|
+
export { createCurrencyPresets, CURRENCY_PRESET_DEFINITIONS, } from "./presets/currencyPresets.js";
|
|
7
|
+
export { createStandardPresets, STANDARD_PRESET_DEFINITIONS, } from "./presets/standardPresets.js";
|
|
8
8
|
export { createTemplates, createAllTemplates, STANDARD_TEMPLATE_DEFINITIONS, CURRENCY_TEMPLATE_DEFINITIONS, ADVANCED_TEMPLATE_DEFINITIONS, CURRENCY_TEMPLATE_IDS, DEFAULT_TEMPLATE_PREFIX, } from "./presets/templates.js";
|
|
9
9
|
export { useMetricTypePresets, useStandardPresets, useFormatTemplates, } from "./hooks/useMetricTypePresets.js";
|
|
10
10
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/measureNumberFormat/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACH,sBAAsB,EACtB,gBAAgB,GAKnB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,OAAO,EACH,qBAAqB,EACrB,2BAA2B,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/measureNumberFormat/index.ts"],"names":[],"mappings":"AAAA,qCAAqC;AAErC,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,mBAAmB,EAAE,MAAM,0BAA0B,CAAC;AAC/D,OAAO,EACH,sBAAsB,EACtB,gBAAgB,GAKnB,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAAE,yBAAyB,EAAE,MAAM,sCAAsC,CAAC;AAEjF,OAAO,EACH,qBAAqB,EACrB,2BAA2B,GAE9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,qBAAqB,EACrB,2BAA2B,GAE9B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACH,eAAe,EACf,kBAAkB,EAClB,6BAA6B,EAC7B,6BAA6B,EAC7B,6BAA6B,EAC7B,qBAAqB,EACrB,uBAAuB,GAE1B,MAAM,wBAAwB,CAAC;AAChC,OAAO,EACH,oBAAoB,EACpB,kBAAkB,EAClB,kBAAkB,GAGrB,MAAM,iCAAiC,CAAC"}
|
|
@@ -15,20 +15,14 @@ export interface ICurrencyPresetDefinition {
|
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
export declare const CURRENCY_PRESET_DEFINITIONS: readonly ICurrencyPresetDefinition[];
|
|
18
|
-
/**
|
|
19
|
-
* Default message ID prefix for currency preset definitions.
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare const DEFAULT_CURRENCY_PRESET_PREFIX = "metricComponent.numberFormat.preset";
|
|
23
18
|
/**
|
|
24
19
|
* Creates localized currency format presets.
|
|
25
20
|
*
|
|
26
21
|
* @param formatMessage - Function to format localized messages (e.g., from react-intl)
|
|
27
|
-
* @param messageIdPrefix - Optional prefix for message IDs (default: "metricComponent.numberFormat.preset")
|
|
28
22
|
* @returns Array of currency format presets with localized names
|
|
29
23
|
* @internal
|
|
30
24
|
*/
|
|
31
25
|
export declare function createCurrencyPresets(formatMessage: (descriptor: {
|
|
32
26
|
id: string;
|
|
33
|
-
}) => string
|
|
27
|
+
}) => string): IFormatPreset[];
|
|
34
28
|
//# sourceMappingURL=currencyPresets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currencyPresets.d.ts","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/currencyPresets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,yBAAyB,EAmBlE,CAAC;AAEX
|
|
1
|
+
{"version":3,"file":"currencyPresets.d.ts","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/currencyPresets.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,yBAAyB,EAmBlE,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACjC,aAAa,EAAE,CAAC,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,GACtD,aAAa,EAAE,CASjB"}
|
|
@@ -9,41 +9,32 @@ export const CURRENCY_PRESET_DEFINITIONS = [
|
|
|
9
9
|
localIdentifier: "currency",
|
|
10
10
|
format: "$#,##0.00",
|
|
11
11
|
previewNumber: 1000.12,
|
|
12
|
-
messageId: "
|
|
12
|
+
messageId: "measureNumberFormat.numberFormat.preset.currency",
|
|
13
13
|
},
|
|
14
14
|
{
|
|
15
15
|
localIdentifier: "currency-single-decimal",
|
|
16
16
|
format: "$#,##0.0",
|
|
17
17
|
previewNumber: 1000.12,
|
|
18
|
-
messageId: "
|
|
18
|
+
messageId: "measureNumberFormat.numberFormat.preset.currency1",
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
localIdentifier: "currency-rounded",
|
|
22
22
|
format: "$#,##0",
|
|
23
23
|
previewNumber: 1000.12,
|
|
24
|
-
messageId: "
|
|
24
|
+
messageId: "measureNumberFormat.numberFormat.preset.currencyRounded",
|
|
25
25
|
},
|
|
26
26
|
];
|
|
27
|
-
/**
|
|
28
|
-
* Default message ID prefix for currency preset definitions.
|
|
29
|
-
* @internal
|
|
30
|
-
*/
|
|
31
|
-
export const DEFAULT_CURRENCY_PRESET_PREFIX = "metricComponent.numberFormat.preset";
|
|
32
27
|
/**
|
|
33
28
|
* Creates localized currency format presets.
|
|
34
29
|
*
|
|
35
30
|
* @param formatMessage - Function to format localized messages (e.g., from react-intl)
|
|
36
|
-
* @param messageIdPrefix - Optional prefix for message IDs (default: "metricComponent.numberFormat.preset")
|
|
37
31
|
* @returns Array of currency format presets with localized names
|
|
38
32
|
* @internal
|
|
39
33
|
*/
|
|
40
|
-
export function createCurrencyPresets(formatMessage
|
|
34
|
+
export function createCurrencyPresets(formatMessage) {
|
|
41
35
|
return CURRENCY_PRESET_DEFINITIONS.map((definition) => {
|
|
42
|
-
// Extract the key part from the default message ID (e.g., "currency" from "metricComponent.numberFormat.preset.currency")
|
|
43
|
-
const keyPart = definition.messageId.replace(`${DEFAULT_CURRENCY_PRESET_PREFIX}.`, "");
|
|
44
|
-
const messageId = `${messageIdPrefix}.${keyPart}`;
|
|
45
36
|
return {
|
|
46
|
-
name: formatMessage({ id: messageId }),
|
|
37
|
+
name: formatMessage({ id: definition.messageId }),
|
|
47
38
|
localIdentifier: definition.localIdentifier,
|
|
48
39
|
format: definition.format,
|
|
49
40
|
previewNumber: definition.previewNumber,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"currencyPresets.js","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/currencyPresets.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAehC;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAyC;IAC7E;QACI,eAAe,EAAE,UAAU;QAC3B,MAAM,EAAE,WAAW;QACnB,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,
|
|
1
|
+
{"version":3,"file":"currencyPresets.js","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/currencyPresets.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAehC;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAyC;IAC7E;QACI,eAAe,EAAE,UAAU;QAC3B,MAAM,EAAE,WAAW;QACnB,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,kDAAkD;KAChE;IACD;QACI,eAAe,EAAE,yBAAyB;QAC1C,MAAM,EAAE,UAAU;QAClB,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,mDAAmD;KACjE;IACD;QACI,eAAe,EAAE,kBAAkB;QACnC,MAAM,EAAE,QAAQ;QAChB,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,yDAAyD;KACvE;CACK,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACjC,aAAqD;IAErD,OAAO,2BAA2B,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;QAClD,OAAO;YACH,IAAI,EAAE,aAAa,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,SAAS,EAAE,CAAC;YACjD,eAAe,EAAE,UAAU,CAAC,eAAe;YAC3C,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,aAAa,EAAE,UAAU,CAAC,aAAa;SAC1C,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -15,20 +15,14 @@ export interface IStandardPresetDefinition {
|
|
|
15
15
|
* @internal
|
|
16
16
|
*/
|
|
17
17
|
export declare const STANDARD_PRESET_DEFINITIONS: readonly IStandardPresetDefinition[];
|
|
18
|
-
/**
|
|
19
|
-
* Default message ID prefix for standard preset definitions.
|
|
20
|
-
* @internal
|
|
21
|
-
*/
|
|
22
|
-
export declare const DEFAULT_STANDARD_PRESET_PREFIX = "metricComponent.numberFormat.preset";
|
|
23
18
|
/**
|
|
24
19
|
* Creates localized standard format presets.
|
|
25
20
|
*
|
|
26
21
|
* @param formatMessage - Function to format localized messages (e.g., from react-intl)
|
|
27
|
-
* @param messageIdPrefix - Optional prefix for message IDs (default: "metricComponent.numberFormat.preset")
|
|
28
22
|
* @returns Array of standard format presets with localized names
|
|
29
23
|
* @internal
|
|
30
24
|
*/
|
|
31
25
|
export declare function createStandardPresets(formatMessage: (descriptor: {
|
|
32
26
|
id: string;
|
|
33
|
-
}) => string
|
|
27
|
+
}) => string): IFormatPreset[];
|
|
34
28
|
//# sourceMappingURL=standardPresets.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standardPresets.d.ts","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/standardPresets.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"standardPresets.d.ts","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/standardPresets.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,eAAe,CAAC;AAEnD;;;GAGG;AACH,MAAM,WAAW,yBAAyB;IACtC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;CACrB;AAeD;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,SAAS,yBAAyB,EAqClE,CAAC;AAEX;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACjC,aAAa,EAAE,CAAC,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,GACtD,aAAa,EAAE,CASjB"}
|
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
// (C) 2025 GoodData Corporation
|
|
2
|
+
import { defineMessages } from "react-intl";
|
|
3
|
+
/**
|
|
4
|
+
* Message ids for standard numeric presets
|
|
5
|
+
* @internal
|
|
6
|
+
*/
|
|
7
|
+
const standardPresetMessages = defineMessages({
|
|
8
|
+
rounded: { id: "measureNumberFormat.numberFormat.preset.rounded" },
|
|
9
|
+
decimal1: { id: "measureNumberFormat.numberFormat.preset.decimal1" },
|
|
10
|
+
decimal2: { id: "measureNumberFormat.numberFormat.preset.decimal2" },
|
|
11
|
+
percentRounded: { id: "measureNumberFormat.numberFormat.preset.percentRounded" },
|
|
12
|
+
percent1: { id: "measureNumberFormat.numberFormat.preset.percent1" },
|
|
13
|
+
percent2: { id: "measureNumberFormat.numberFormat.preset.percent2" },
|
|
14
|
+
});
|
|
2
15
|
/**
|
|
3
16
|
* Standard numeric preset definitions.
|
|
4
17
|
* These are the raw preset data that can be used to create localized presets.
|
|
@@ -9,59 +22,50 @@ export const STANDARD_PRESET_DEFINITIONS = [
|
|
|
9
22
|
localIdentifier: "rounded",
|
|
10
23
|
format: "#,##0",
|
|
11
24
|
previewNumber: 1000.12,
|
|
12
|
-
messageId:
|
|
25
|
+
messageId: standardPresetMessages.rounded.id,
|
|
13
26
|
},
|
|
14
27
|
{
|
|
15
28
|
localIdentifier: "decimal-1",
|
|
16
29
|
format: "#,##0.0",
|
|
17
30
|
previewNumber: 1000.12,
|
|
18
|
-
messageId:
|
|
31
|
+
messageId: standardPresetMessages.decimal1.id,
|
|
19
32
|
},
|
|
20
33
|
{
|
|
21
34
|
localIdentifier: "decimal-2",
|
|
22
35
|
format: "#,##0.00",
|
|
23
36
|
previewNumber: 1000.12,
|
|
24
|
-
messageId:
|
|
37
|
+
messageId: standardPresetMessages.decimal2.id,
|
|
25
38
|
},
|
|
26
39
|
{
|
|
27
40
|
localIdentifier: "percent-rounded",
|
|
28
41
|
format: "#,##0%",
|
|
29
42
|
previewNumber: 0.1,
|
|
30
|
-
messageId:
|
|
43
|
+
messageId: standardPresetMessages.percentRounded.id,
|
|
31
44
|
},
|
|
32
45
|
{
|
|
33
46
|
localIdentifier: "percent-1",
|
|
34
47
|
format: "#,##0.0%",
|
|
35
48
|
previewNumber: 0.101,
|
|
36
|
-
messageId:
|
|
49
|
+
messageId: standardPresetMessages.percent1.id,
|
|
37
50
|
},
|
|
38
51
|
{
|
|
39
52
|
localIdentifier: "percent-2",
|
|
40
53
|
format: "#,##0.00%",
|
|
41
54
|
previewNumber: 0.1012,
|
|
42
|
-
messageId:
|
|
55
|
+
messageId: standardPresetMessages.percent2.id,
|
|
43
56
|
},
|
|
44
57
|
];
|
|
45
|
-
/**
|
|
46
|
-
* Default message ID prefix for standard preset definitions.
|
|
47
|
-
* @internal
|
|
48
|
-
*/
|
|
49
|
-
export const DEFAULT_STANDARD_PRESET_PREFIX = "metricComponent.numberFormat.preset";
|
|
50
58
|
/**
|
|
51
59
|
* Creates localized standard format presets.
|
|
52
60
|
*
|
|
53
61
|
* @param formatMessage - Function to format localized messages (e.g., from react-intl)
|
|
54
|
-
* @param messageIdPrefix - Optional prefix for message IDs (default: "metricComponent.numberFormat.preset")
|
|
55
62
|
* @returns Array of standard format presets with localized names
|
|
56
63
|
* @internal
|
|
57
64
|
*/
|
|
58
|
-
export function createStandardPresets(formatMessage
|
|
65
|
+
export function createStandardPresets(formatMessage) {
|
|
59
66
|
return STANDARD_PRESET_DEFINITIONS.map((definition) => {
|
|
60
|
-
// Extract the key part from the default message ID (e.g., "rounded" from "metricComponent.numberFormat.preset.rounded")
|
|
61
|
-
const keyPart = definition.messageId.replace(`${DEFAULT_STANDARD_PRESET_PREFIX}.`, "");
|
|
62
|
-
const messageId = `${messageIdPrefix}.${keyPart}`;
|
|
63
67
|
return {
|
|
64
|
-
name: formatMessage({ id: messageId }),
|
|
68
|
+
name: formatMessage({ id: definition.messageId }),
|
|
65
69
|
localIdentifier: definition.localIdentifier,
|
|
66
70
|
format: definition.format,
|
|
67
71
|
previewNumber: definition.previewNumber,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"standardPresets.js","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/standardPresets.ts"],"names":[],"mappings":"AAAA,gCAAgC;
|
|
1
|
+
{"version":3,"file":"standardPresets.js","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/standardPresets.ts"],"names":[],"mappings":"AAAA,gCAAgC;AAEhC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAe5C;;;GAGG;AACH,MAAM,sBAAsB,GAAG,cAAc,CAAC;IAC1C,OAAO,EAAE,EAAE,EAAE,EAAE,iDAAiD,EAAE;IAClE,QAAQ,EAAE,EAAE,EAAE,EAAE,kDAAkD,EAAE;IACpE,QAAQ,EAAE,EAAE,EAAE,EAAE,kDAAkD,EAAE;IACpE,cAAc,EAAE,EAAE,EAAE,EAAE,wDAAwD,EAAE;IAChF,QAAQ,EAAE,EAAE,EAAE,EAAE,kDAAkD,EAAE;IACpE,QAAQ,EAAE,EAAE,EAAE,EAAE,kDAAkD,EAAE;CACvE,CAAC,CAAC;AAEH;;;;GAIG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAyC;IAC7E;QACI,eAAe,EAAE,SAAS;QAC1B,MAAM,EAAE,OAAO;QACf,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,sBAAsB,CAAC,OAAO,CAAC,EAAE;KAC/C;IACD;QACI,eAAe,EAAE,WAAW;QAC5B,MAAM,EAAE,SAAS;QACjB,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,sBAAsB,CAAC,QAAQ,CAAC,EAAE;KAChD;IACD;QACI,eAAe,EAAE,WAAW;QAC5B,MAAM,EAAE,UAAU;QAClB,aAAa,EAAE,OAAO;QACtB,SAAS,EAAE,sBAAsB,CAAC,QAAQ,CAAC,EAAE;KAChD;IACD;QACI,eAAe,EAAE,iBAAiB;QAClC,MAAM,EAAE,QAAQ;QAChB,aAAa,EAAE,GAAG;QAClB,SAAS,EAAE,sBAAsB,CAAC,cAAc,CAAC,EAAE;KACtD;IACD;QACI,eAAe,EAAE,WAAW;QAC5B,MAAM,EAAE,UAAU;QAClB,aAAa,EAAE,KAAK;QACpB,SAAS,EAAE,sBAAsB,CAAC,QAAQ,CAAC,EAAE;KAChD;IACD;QACI,eAAe,EAAE,WAAW;QAC5B,MAAM,EAAE,WAAW;QACnB,aAAa,EAAE,MAAM;QACrB,SAAS,EAAE,sBAAsB,CAAC,QAAQ,CAAC,EAAE;KAChD;CACK,CAAC;AAEX;;;;;;GAMG;AACH,MAAM,UAAU,qBAAqB,CACjC,aAAqD;IAErD,OAAO,2BAA2B,CAAC,GAAG,CAAC,CAAC,UAAU,EAAE,EAAE;QAClD,OAAO;YACH,IAAI,EAAE,aAAa,CAAC,EAAE,EAAE,EAAE,UAAU,CAAC,SAAS,EAAE,CAAC;YACjD,eAAe,EAAE,UAAU,CAAC,eAAe;YAC3C,MAAM,EAAE,UAAU,CAAC,MAAM;YACzB,aAAa,EAAE,UAAU,CAAC,aAAa;SAC1C,CAAC;IACN,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -33,13 +33,13 @@ export declare const CURRENCY_TEMPLATE_IDS: string[];
|
|
|
33
33
|
* Default message ID prefix for template definitions.
|
|
34
34
|
* @internal
|
|
35
35
|
*/
|
|
36
|
-
export declare const DEFAULT_TEMPLATE_PREFIX = "
|
|
36
|
+
export declare const DEFAULT_TEMPLATE_PREFIX = "measureNumberFormat.numberFormat.template";
|
|
37
37
|
/**
|
|
38
38
|
* Creates localized format templates.
|
|
39
39
|
*
|
|
40
40
|
* @param formatMessage - Function to format localized messages (e.g., from react-intl)
|
|
41
41
|
* @param definitions - Template definitions to localize
|
|
42
|
-
* @param messageIdPrefix - Optional prefix for message IDs (default: "
|
|
42
|
+
* @param messageIdPrefix - Optional prefix for message IDs (default: "measureNumberFormat.numberFormat.template")
|
|
43
43
|
* @returns Array of format templates with localized names
|
|
44
44
|
* @internal
|
|
45
45
|
*/
|
|
@@ -50,11 +50,11 @@ export declare function createTemplates(formatMessage: (descriptor: {
|
|
|
50
50
|
* Creates all localized format templates (standard + currency + advanced).
|
|
51
51
|
*
|
|
52
52
|
* @param formatMessage - Function to format localized messages (e.g., from react-intl)
|
|
53
|
-
* @param messageIdPrefix - Optional prefix for message IDs (default: "
|
|
53
|
+
* @param messageIdPrefix - Optional prefix for message IDs (default: "measureNumberFormat.numberFormat.template")
|
|
54
54
|
* @returns Array of all format templates with localized names
|
|
55
55
|
* @internal
|
|
56
56
|
*/
|
|
57
57
|
export declare function createAllTemplates(formatMessage: (descriptor: {
|
|
58
58
|
id: string;
|
|
59
|
-
}) => string
|
|
59
|
+
}) => string): IFormatTemplate[];
|
|
60
60
|
//# sourceMappingURL=templates.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/templates.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"templates.d.ts","sourceRoot":"","sources":["../../../src/measureNumberFormat/presets/templates.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,eAAe,CAAC;AAErD;;;GAGG;AACH,MAAM,WAAW,mBAAmB;IAChC,eAAe,EAAE,MAAM,CAAC;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAE,MAAM,CAAC;CACrB;AAeD;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,mBAAmB,EA+B9D,CAAC;AAWX;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,mBAAmB,EAqB9D,CAAC;AAsBX;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,SAAS,mBAAmB,EAuE9D,CAAC;AAEX;;;;GAIG;AACH,eAAO,MAAM,qBAAqB,UAA8D,CAAC;AAEjG;;;GAGG;AACH,eAAO,MAAM,uBAAuB,8CAA8C,CAAC;AAEnF;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAC3B,aAAa,EAAE,CAAC,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,EACrD,WAAW,EAAE,SAAS,mBAAmB,EAAE,EAC3C,eAAe,GAAE,MAAgC,GAClD,eAAe,EAAE,CAWnB;AAED;;;;;;;GAOG;AACH,wBAAgB,kBAAkB,CAAC,aAAa,EAAE,CAAC,UAAU,EAAE;IAAE,EAAE,EAAE,MAAM,CAAA;CAAE,KAAK,MAAM,GAAG,eAAe,EAAE,CAM3G"}
|