@pushwoosh/smart-components-kit 2.7.0 → 2.8.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.
Files changed (28) hide show
  1. package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +13 -12
  2. package/DynamicContentPickerForm/TagFormatFields.d.ts +12 -0
  3. package/DynamicContentPickerForm/TagFormatFields.js +116 -0
  4. package/DynamicContentPickerForm/formatFields.d.ts +27 -0
  5. package/DynamicContentPickerForm/formatFields.js +153 -0
  6. package/DynamicContentPickerForm/hooks.d.ts +1 -0
  7. package/DynamicContentPickerForm/hooks.js +16 -4
  8. package/DynamicContentPickerForm/polyglot/messages_ar.js +19 -1
  9. package/DynamicContentPickerForm/polyglot/messages_bn.js +19 -1
  10. package/DynamicContentPickerForm/polyglot/messages_de.js +19 -1
  11. package/DynamicContentPickerForm/polyglot/messages_en.js +19 -1
  12. package/DynamicContentPickerForm/polyglot/messages_es.js +19 -1
  13. package/DynamicContentPickerForm/polyglot/messages_fr.js +19 -1
  14. package/DynamicContentPickerForm/polyglot/messages_he.js +19 -1
  15. package/DynamicContentPickerForm/polyglot/messages_hi.js +19 -1
  16. package/DynamicContentPickerForm/polyglot/messages_ja.js +19 -1
  17. package/DynamicContentPickerForm/polyglot/messages_ko.js +19 -1
  18. package/DynamicContentPickerForm/polyglot/messages_pt.js +19 -1
  19. package/DynamicContentPickerForm/polyglot/messages_ru.js +19 -1
  20. package/DynamicContentPickerForm/polyglot/messages_th.js +19 -1
  21. package/DynamicContentPickerForm/polyglot/messages_zh.js +19 -1
  22. package/DynamicContentPickerForm/polyglot/types.d.ts +18 -0
  23. package/DynamicContentPickerForm/tagFormat.d.ts +35 -0
  24. package/DynamicContentPickerForm/tagFormat.js +171 -0
  25. package/ExportCSV/ExportCsvBanner/ExportCsvBanner.js +11 -6
  26. package/ExportCSV/ExportCsvBanner/exportFileName.d.ts +3 -0
  27. package/ExportCSV/ExportCsvBanner/exportFileName.js +5 -0
  28. package/package.json +4 -4
@@ -5,6 +5,8 @@ import { Horizontal, Vertical } from '@pushwoosh/kit-helpers';
5
5
  import { useDynamicContentTags } from './hooks';
6
6
  import { useLang } from './polyglot';
7
7
  import { SimpleTagPickerDiv } from './styles';
8
+ import { formatKindOf } from './tagFormat';
9
+ import { TagFormatFields } from './TagFormatFields';
8
10
  import { allDynamicContentModifiers, buildOptions } from './utils';
9
11
  const defaultModifier = 'regular';
10
12
  const matchesQuery = (value, query) => value.toLowerCase().includes(query.trim().toLowerCase());
@@ -42,6 +44,9 @@ export const SimpleDynamicContentPickerFormSmart = ({
42
44
  const options = buildOptions(systemVariables ?? [], asyncResult.value || []);
43
45
  const pickedOption = options.find(option => option.name === dc.tagName);
44
46
  const modifiers = pickedOption?.modifiers ?? allDynamicContentModifiers;
47
+ const isSystemVariable = (systemVariables ?? []).some(variable => variable.name === dc.tagName);
48
+ const pickedTag = isSystemVariable ? undefined : asyncResult.value?.find(tag => tag.name === dc.tagName);
49
+ const kind = formatKindOf(pickedTag?.type);
45
50
  const isEmpty = !dc.tagName.trim();
46
51
  const labelOf = name => options.find(option => option.name === name)?.label ?? name;
47
52
  const changeTagName = (tagName, isPicked) => {
@@ -73,19 +78,15 @@ export const SimpleDynamicContentPickerFormSmart = ({
73
78
  message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TAG.PLACEHOLDER'
74
79
  }),
75
80
  fullWidth: true
76
- }), _jsx(Combobox, {
77
- select: true,
78
- value: dc.modifier || null,
79
- onChange: modifier => {
80
- onChange({
81
- ...dc,
82
- modifier: modifier ?? ''
83
- });
84
- },
85
- items: modifiers,
86
- getLabel: modifier => modifier,
81
+ }), _jsx(TagFormatFields, {
82
+ kind: kind,
83
+ modifier: dc.modifier,
84
+ modifiers: modifiers,
87
85
  disabled: isEmpty,
88
- fullWidth: true
86
+ onChange: modifier => onChange({
87
+ ...dc,
88
+ modifier
89
+ })
89
90
  })]
90
91
  })
91
92
  }), _jsx(FieldBox, {
@@ -0,0 +1,12 @@
1
+ import { type FC } from 'react';
2
+ import { type FormatKind } from './tagFormat';
3
+ type TagFormatFieldsProps = {
4
+ kind: FormatKind;
5
+ modifier: string;
6
+ modifiers: string[];
7
+ disabled: boolean;
8
+ onChange: (modifier: string) => void;
9
+ };
10
+ /** Output format controls of a picked tag, by the kind of its type. */
11
+ export declare const TagFormatFields: FC<TagFormatFieldsProps>;
12
+ export {};
@@ -0,0 +1,116 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import { useEffect } from 'react';
3
+ import { Combobox } from '@pushwoosh/dumb-components';
4
+ import { Vertical } from '@pushwoosh/kit-helpers';
5
+ import { ChoiceFormatField, DateFormatFields, FormatPreview, PriceFormatField, sampleDate } from './formatFields';
6
+ import { useLang } from './polyglot';
7
+ import { booleanFormats, currencyOf, formatDate, formatPrice, isAcceptedModifier, listFormats, parseDateModifier } from './tagFormat';
8
+ import { allDynamicContentModifiers } from './utils';
9
+ const sampleList = ['sneakers', 't-shirt'];
10
+ /** Output format controls of a picked tag, by the kind of its type. */
11
+ export const TagFormatFields = ({
12
+ kind,
13
+ modifier,
14
+ modifiers,
15
+ disabled,
16
+ onChange
17
+ }) => {
18
+ const lang = useLang();
19
+ const isAccepted = disabled || isAcceptedModifier(kind, modifier, [...modifiers, ...allDynamicContentModifiers]);
20
+ useEffect(() => {
21
+ if (!isAccepted && modifiers[0]) {
22
+ onChange(modifiers[0]);
23
+ }
24
+ }, [isAccepted, modifiers, onChange]);
25
+ const listLabel = format => lang({
26
+ message: format === 'join:newline' ? 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE' : 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA'
27
+ });
28
+ const booleanWords = format => {
29
+ switch (format) {
30
+ case 'bool:on_off':
31
+ return [lang({
32
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON'
33
+ }), lang({
34
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF'
35
+ })];
36
+ case 'bool:have':
37
+ return [lang({
38
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE'
39
+ }), lang({
40
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT'
41
+ })];
42
+ case 'bool:check':
43
+ return ['✅', '❌'];
44
+ default:
45
+ return [lang({
46
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES'
47
+ }), lang({
48
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO'
49
+ })];
50
+ }
51
+ };
52
+ const fieldProps = {
53
+ modifier,
54
+ disabled,
55
+ onChange
56
+ };
57
+ const preview = !disabled && isAccepted;
58
+ switch (kind) {
59
+ case 'date':
60
+ return _jsxs(Vertical, {
61
+ "$gap": 8,
62
+ children: [_jsx(DateFormatFields, {
63
+ ...fieldProps
64
+ }), preview && _jsx(FormatPreview, {
65
+ children: formatDate(sampleDate, parseDateModifier(modifier).format, 'en')
66
+ })]
67
+ });
68
+ case 'price':
69
+ return _jsxs(Vertical, {
70
+ "$gap": 8,
71
+ children: [_jsx(PriceFormatField, {
72
+ ...fieldProps
73
+ }), preview && currencyOf(modifier) && _jsx(FormatPreview, {
74
+ children: formatPrice(1990.5, currencyOf(modifier))
75
+ })]
76
+ });
77
+ case 'list':
78
+ return _jsxs(Vertical, {
79
+ "$gap": 8,
80
+ children: [_jsx(ChoiceFormatField, {
81
+ ...fieldProps,
82
+ title: lang({
83
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR'
84
+ }),
85
+ items: listFormats,
86
+ getLabel: listLabel
87
+ }), preview && _jsx(FormatPreview, {
88
+ children: sampleList.join(modifier === 'join:newline' ? ' ↵ ' : ', ')
89
+ })]
90
+ });
91
+ case 'boolean':
92
+ return _jsxs(Vertical, {
93
+ "$gap": 8,
94
+ children: [_jsx(ChoiceFormatField, {
95
+ ...fieldProps,
96
+ title: lang({
97
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES'
98
+ }),
99
+ items: booleanFormats,
100
+ getLabel: format => booleanWords(format).join(' / ')
101
+ }), preview && _jsx(FormatPreview, {
102
+ children: booleanWords(modifier)[0]
103
+ })]
104
+ });
105
+ default:
106
+ return _jsx(Combobox, {
107
+ select: true,
108
+ value: modifier || null,
109
+ onChange: item => onChange(item ?? ''),
110
+ items: modifiers,
111
+ getLabel: item => item,
112
+ disabled: disabled,
113
+ fullWidth: true
114
+ });
115
+ }
116
+ };
@@ -0,0 +1,27 @@
1
+ import { type FC, type ReactElement, type ReactNode } from 'react';
2
+ export declare const sampleDate: Date;
3
+ type FieldProps = {
4
+ modifier: string;
5
+ disabled: boolean;
6
+ onChange: (modifier: string) => void;
7
+ };
8
+ /** A titled control of the format fields. */
9
+ export declare const FormatField: FC<{
10
+ title: string;
11
+ children: ReactElement;
12
+ }>;
13
+ /** Sample value of the picked format. */
14
+ export declare const FormatPreview: FC<{
15
+ children: ReactNode;
16
+ }>;
17
+ /** Date format plus the time zone the date is shown in. */
18
+ export declare const DateFormatFields: FC<FieldProps>;
19
+ /** Currency of a Price tag; the legacy money modifiers stay pickable for saved presets. */
20
+ export declare const PriceFormatField: FC<FieldProps>;
21
+ /** One closed list of modifiers under a title: List separators, Boolean word pairs. */
22
+ export declare const ChoiceFormatField: FC<FieldProps & {
23
+ title: string;
24
+ items: string[];
25
+ getLabel: (item: string) => string;
26
+ }>;
27
+ export {};
@@ -0,0 +1,153 @@
1
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
2
+ import { Combobox } from '@pushwoosh/dumb-components';
3
+ import { Color } from '@pushwoosh/kit-constants';
4
+ import { Vertical } from '@pushwoosh/kit-helpers';
5
+ import { Text } from '@pushwoosh/kit-typography';
6
+ import { useLang } from './polyglot';
7
+ import { currencyName, currencyOf, currencySymbol, dateFormats, DATE_AS_STORED, DEFAULT_FIXED_TIME_ZONE, formatDate, parseDateModifier, priceModifiers, timeZones, withTimeZone } from './tagFormat';
8
+ export const sampleDate = new Date(Date.UTC(2026, 10, 23, 10, 0));
9
+ const timeZoneModes = ['local', 'fixed', 'stored'];
10
+ const matches = (label, query) => label.toLowerCase().includes(query.trim().toLowerCase());
11
+ /** A titled control of the format fields. */
12
+ export const FormatField = ({
13
+ title,
14
+ children
15
+ }) => _jsxs(Vertical, {
16
+ "$gap": 4,
17
+ children: [_jsx(Text, {
18
+ "$variant": "footnote",
19
+ "$color": Color.LOCKED,
20
+ children: title
21
+ }), children]
22
+ });
23
+ /** Sample value of the picked format. */
24
+ export const FormatPreview = ({
25
+ children
26
+ }) => {
27
+ const lang = useLang();
28
+ return _jsxs(Text, {
29
+ "$variant": "footnote",
30
+ "$color": Color.LOCKED,
31
+ children: [`${lang({
32
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW'
33
+ })}: `, _jsx(Text, {
34
+ "$variant": "footnote",
35
+ children: children
36
+ })]
37
+ });
38
+ };
39
+ /** Date format plus the time zone the date is shown in. */
40
+ export const DateFormatFields = ({
41
+ modifier,
42
+ disabled,
43
+ onChange
44
+ }) => {
45
+ const lang = useLang();
46
+ const date = parseDateModifier(modifier);
47
+ const timeZoneLabel = mode => {
48
+ switch (mode) {
49
+ case 'fixed':
50
+ return lang({
51
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED'
52
+ });
53
+ case 'stored':
54
+ return lang({
55
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED'
56
+ });
57
+ default:
58
+ return lang({
59
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL'
60
+ });
61
+ }
62
+ };
63
+ return _jsxs(_Fragment, {
64
+ children: [_jsx(FormatField, {
65
+ title: lang({
66
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT'
67
+ }),
68
+ children: _jsx(Combobox, {
69
+ select: true,
70
+ value: date.format,
71
+ onChange: format => onChange(withTimeZone(format ?? dateFormats[0], date.mode, date.zone)),
72
+ items: dateFormats,
73
+ getLabel: format => formatDate(sampleDate, format, 'en'),
74
+ disabled: disabled,
75
+ fullWidth: true
76
+ })
77
+ }), date.format !== DATE_AS_STORED && _jsx(FormatField, {
78
+ title: lang({
79
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE'
80
+ }),
81
+ children: _jsx(Combobox, {
82
+ select: true,
83
+ value: date.mode,
84
+ onChange: mode => onChange(withTimeZone(date.format, mode ?? 'local', date.zone)),
85
+ items: timeZoneModes,
86
+ getLabel: timeZoneLabel,
87
+ disabled: disabled,
88
+ fullWidth: true
89
+ })
90
+ }), date.mode === 'fixed' && _jsx(Combobox, {
91
+ select: true,
92
+ value: date.zone,
93
+ onChange: zone => onChange(withTimeZone(date.format, 'fixed', zone ?? DEFAULT_FIXED_TIME_ZONE)),
94
+ items: timeZones(),
95
+ getLabel: zone => zone,
96
+ filter: matches,
97
+ disabled: disabled,
98
+ fullWidth: true
99
+ })]
100
+ });
101
+ };
102
+ /** Currency of a Price tag; the legacy money modifiers stay pickable for saved presets. */
103
+ export const PriceFormatField = ({
104
+ modifier,
105
+ disabled,
106
+ onChange
107
+ }) => {
108
+ const lang = useLang();
109
+ const currencyLabel = item => {
110
+ const code = currencyOf(item);
111
+ if (code) {
112
+ return `${code} · ${currencySymbol(code)} · ${currencyName(code)}`;
113
+ }
114
+ return item === 'regular' ? lang({
115
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE'
116
+ }) : item;
117
+ };
118
+ return _jsx(FormatField, {
119
+ title: lang({
120
+ message: 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY'
121
+ }),
122
+ children: _jsx(Combobox, {
123
+ select: true,
124
+ value: modifier,
125
+ onChange: item => item && onChange(item),
126
+ items: priceModifiers(),
127
+ getLabel: currencyLabel,
128
+ filter: (item, query) => matches(currencyLabel(item), query),
129
+ disabled: disabled,
130
+ fullWidth: true
131
+ })
132
+ });
133
+ };
134
+ /** One closed list of modifiers under a title: List separators, Boolean word pairs. */
135
+ export const ChoiceFormatField = ({
136
+ modifier,
137
+ disabled,
138
+ onChange,
139
+ title,
140
+ items,
141
+ getLabel
142
+ }) => _jsx(FormatField, {
143
+ title: title,
144
+ children: _jsx(Combobox, {
145
+ select: true,
146
+ value: modifier,
147
+ onChange: item => item && onChange(item),
148
+ items: items,
149
+ getLabel: getLabel,
150
+ disabled: disabled,
151
+ fullWidth: true
152
+ })
153
+ });
@@ -2,6 +2,7 @@ import { type Event } from '@pushwoosh/rpc-v2-http-api-data/events';
2
2
  import { type SPAContextType } from '@pushwoosh/spa-context';
3
3
  import { type FullTagData } from './types';
4
4
  export declare function fetchDynamicContentTags(context: SPAContextType): Promise<FullTagData[]>;
5
+ /** Tags of every type, each with the output formats the sender can render it in. */
5
6
  export declare function useDynamicContentTags(): {
6
7
  loading: boolean;
7
8
  error?: undefined;
@@ -2,9 +2,10 @@ import { modifiersForTagType } from '@pushwoosh/kit-constants';
2
2
  import { useAsync } from '@pushwoosh/kit-helpers';
3
3
  import { useSPAContext } from '@pushwoosh/spa-context';
4
4
  import { collectPaginatedData } from '../asyncHelpers';
5
+ import { formatKindOf, modifiersForKind } from './tagFormat';
5
6
  const ignoreTagTypes = ['BOOLEAN', 'LIST'];
6
- export async function fetchDynamicContentTags(context) {
7
- const originalTags = await collectPaginatedData(1000, async (perPage, page) => {
7
+ async function fetchAllTags(context) {
8
+ return collectPaginatedData(1000, async (perPage, page) => {
8
9
  const res = await context.rpcGateway.tags.List({
9
10
  orderBy: 'NAME',
10
11
  orderDirection: 'ASC',
@@ -13,15 +14,26 @@ export async function fetchDynamicContentTags(context) {
13
14
  });
14
15
  return res.tags;
15
16
  });
16
- return originalTags.filter(tag => !ignoreTagTypes.includes(tag.type)).map(tag => ({
17
+ }
18
+ export async function fetchDynamicContentTags(context) {
19
+ const tags = await fetchAllTags(context);
20
+ return tags.filter(tag => !ignoreTagTypes.includes(tag.type)).map(tag => ({
17
21
  ...tag,
18
22
  modifiers: modifiersForTagType(tag.type)
19
23
  }));
20
24
  }
25
+ async function fetchFormattableTags(context) {
26
+ const tags = await fetchAllTags(context);
27
+ return tags.map(tag => ({
28
+ ...tag,
29
+ modifiers: modifiersForKind(formatKindOf(tag.type), tag.type)
30
+ }));
31
+ }
32
+ /** Tags of every type, each with the output formats the sender can render it in. */
21
33
  export function useDynamicContentTags() {
22
34
  const context = useSPAContext();
23
35
  return useAsync(async () => {
24
- return fetchDynamicContentTags(context);
36
+ return fetchFormattableTags(context);
25
37
  }, [context]);
26
38
  }
27
39
  export async function fetchDynamicContentEvents(context, application) {
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'الحدث',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'نص مخصص',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'إلغاء',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'تطبيق'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'تطبيق',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'التنسيق',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'المنطقة الزمنية',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'العملة',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'الفاصل',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'القيم',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'معاينة',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'المنطقة الزمنية للمستلم',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'منطقة زمنية ثابتة',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'كما هو مخزن، بدون تحويل',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'بدون عملة',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'فاصلة',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'سطر جديد',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'نعم',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'لا',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'تشغيل',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'إيقاف',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'متوفر',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'غير متوفر'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'ইভেন্ট',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'কাস্টম টেক্সট',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'বাতিল করুন',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'প্রয়োগ করুন'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'প্রয়োগ করুন',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'ফরম্যাট',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'টাইম জোন',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'মুদ্রা',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'বিভাজক',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'মান',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'প্রিভিউ',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'প্রাপকের টাইম জোন',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'নির্দিষ্ট টাইম জোন',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'যেমন সংরক্ষিত, রূপান্তর ছাড়া',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'কোনো মুদ্রা নেই',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'কমা',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'নতুন লাইন',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'হ্যাঁ',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'না',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'চালু',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'বন্ধ',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'আছে',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'নেই'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Ereignis',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Eigener Text',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Abbrechen',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Anwenden'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Anwenden',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'Format',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'Zeitzone',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'Währung',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'Trennzeichen',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'Werte',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'Vorschau',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'Zeitzone des Empfängers',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'Feste Zeitzone',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'Wie gespeichert, ohne Umrechnung',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'Ohne Währung',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'Komma',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'Neue Zeile',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'Ja',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'Nein',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'An',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'Aus',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'Verfügbar',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'Nicht verfügbar'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Event',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Custom Text',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Cancel',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Apply'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Apply',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'Format',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'Time zone',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'Currency',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'Separator',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'Values',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'Preview',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'Recipient\'s time zone',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'Fixed time zone',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'As stored, no conversion',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'No currency',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'Comma',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'New line',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'Yes',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'No',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'On',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'Off',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'Available',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'Not available'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Evento',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Texto personalizado',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Cancelar',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Aplicar'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Aplicar',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'Formato',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'Zona horaria',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'Moneda',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'Separador',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'Valores',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'Vista previa',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'Zona horaria del destinatario',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'Zona horaria fija',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'Tal como se guardó, sin conversión',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'Sin moneda',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'Coma',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'Nueva línea',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'Sí',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'No',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'Activado',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'Desactivado',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'Disponible',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'No disponible'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Événement',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Texte personnalisé',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Annuler',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Appliquer'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Appliquer',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'Format',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'Fuseau horaire',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'Devise',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'Séparateur',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'Valeurs',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'Aperçu',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'Fuseau horaire du destinataire',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'Fuseau horaire fixe',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'Tel quel, sans conversion',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'Sans devise',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'Virgule',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'Nouvelle ligne',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'Oui',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'Non',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'Activé',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'Désactivé',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'Disponible',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'Indisponible'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'אירוע',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'טקסט מותאם אישית',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'ביטול',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'החל'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'החל',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'פורמט',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'אזור זמן',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'מטבע',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'מפריד',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'ערכים',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'תצוגה מקדימה',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'אזור הזמן של הנמען',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'אזור זמן קבוע',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'כפי שנשמר, ללא המרה',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'ללא מטבע',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'פסיק',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'שורה חדשה',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'כן',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'לא',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'פועל',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'כבוי',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'זמין',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'לא זמין'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'इवेंट',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'कस्टम टेक्स्ट',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'रद्द करें',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'लागू करें'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'लागू करें',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'फ़ॉर्मेट',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'समय क्षेत्र',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'मुद्रा',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'विभाजक',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'मान',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'पूर्वावलोकन',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'प्राप्तकर्ता का समय क्षेत्र',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'निश्चित समय क्षेत्र',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'जैसा सहेजा गया, बिना रूपांतरण',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'कोई मुद्रा नहीं',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'अल्पविराम',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'नई पंक्ति',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'हाँ',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'नहीं',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'चालू',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'बंद',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'उपलब्ध',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'उपलब्ध नहीं'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'イベント',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'カスタムテキスト',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'キャンセル',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': '適用'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': '適用',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': '形式',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'タイムゾーン',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': '通貨',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': '区切り文字',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': '値',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'プレビュー',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': '受信者のタイムゾーン',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': '固定タイムゾーン',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': '保存どおり(変換なし)',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': '通貨なし',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'カンマ',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': '改行',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'はい',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'いいえ',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'オン',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'オフ',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'あり',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'なし'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': '이벤트',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': '사용자 지정 텍스트',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': '취소',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': '적용'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': '적용',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': '형식',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': '시간대',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': '통화',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': '구분자',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': '값',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': '미리보기',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': '수신자 시간대',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': '고정 시간대',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': '저장된 그대로 (변환 없음)',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': '통화 없음',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': '쉼표',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': '줄바꿈',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': '예',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': '아니요',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': '켜짐',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': '꺼짐',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': '있음',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': '없음'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Evento',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Texto personalizado',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Cancelar',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Aplicar'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Aplicar',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'Formato',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'Fuso horário',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'Moeda',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'Separador',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'Valores',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'Pré-visualização',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'Fuso horário do destinatário',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'Fuso horário fixo',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'Como armazenado, sem conversão',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'Sem moeda',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'Vírgula',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'Nova linha',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'Sim',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'Não',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'Ligado',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'Desligado',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'Disponível',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'Indisponível'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'Событие',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'Произвольный текст',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'Отмена',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Применить'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'Применить',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'Формат',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'Часовой пояс',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'Валюта',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'Разделитель',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'Значения',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'Пример',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'Пояс получателя',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'Фиксированный пояс',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'Как записано, без пересчёта',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'Без валюты',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'Запятая',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'Новая строка',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'Да',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'Нет',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'Вкл',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'Выкл',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'Есть',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'Нет'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': 'เหตุการณ์',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': 'ข้อความกำหนดเอง',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': 'ยกเลิก',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'นำไปใช้'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': 'นำไปใช้',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': 'รูปแบบ',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': 'เขตเวลา',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': 'สกุลเงิน',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': 'ตัวคั่น',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': 'ค่า',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': 'ตัวอย่าง',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': 'เขตเวลาของผู้รับ',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': 'เขตเวลาคงที่',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': 'ตามที่บันทึก ไม่แปลง',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': 'ไม่มีสกุลเงิน',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': 'จุลภาค',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': 'บรรทัดใหม่',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': 'ใช่',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': 'ไม่ใช่',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': 'เปิด',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': 'ปิด',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': 'มี',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': 'ไม่มี'
18
36
  };
@@ -14,5 +14,23 @@ export const messages = {
14
14
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.EVENT': '事件',
15
15
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': '自定义文本',
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': '取消',
17
- 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': '应用'
17
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': '应用',
18
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': '格式',
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': '时区',
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': '货币',
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': '分隔符',
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': '值',
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': '预览',
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': '收件人时区',
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': '固定时区',
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': '按存储值,不转换',
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': '无货币',
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': '逗号',
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': '换行',
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': '是',
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': '否',
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': '开',
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': '关',
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': '有',
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': '无'
18
36
  };
@@ -16,4 +16,22 @@ export type DynamicContentPickerFormMessages = {
16
16
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.KIND.CUSTOM_TEXT': NoParams;
17
17
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.CANCEL': NoParams;
18
18
  'SMART.DYNAMIC_CONTENT_PICKER_FORM.BUTTON.APPLY': NoParams;
19
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.FORMAT': NoParams;
20
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.TIME_ZONE': NoParams;
21
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.CURRENCY': NoParams;
22
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.SEPARATOR': NoParams;
23
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.FIELD.VALUES': NoParams;
24
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.PREVIEW': NoParams;
25
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.LOCAL': NoParams;
26
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.FIXED': NoParams;
27
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.TIME_ZONE.STORED': NoParams;
28
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.CURRENCY.NONE': NoParams;
29
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.COMMA': NoParams;
30
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.SEPARATOR.NEWLINE': NoParams;
31
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.YES': NoParams;
32
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.NO': NoParams;
33
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.ON': NoParams;
34
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.OFF': NoParams;
35
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE': NoParams;
36
+ 'SMART.DYNAMIC_CONTENT_PICKER_FORM.BOOLEAN.HAVE_NOT': NoParams;
19
37
  };
@@ -0,0 +1,35 @@
1
+ export type FormatKind = 'string' | 'number' | 'date' | 'price' | 'list' | 'boolean';
2
+ export type TimeZoneMode = 'local' | 'fixed' | 'stored';
3
+ export declare const DEFAULT_FIXED_TIME_ZONE = "Europe/Moscow";
4
+ export declare const DATE_AS_STORED = "regular";
5
+ export declare const dateFormats: string[];
6
+ export declare const listFormats: string[];
7
+ export declare const booleanFormats: string[];
8
+ export declare const legacyPriceModifiers: string[];
9
+ /** ISO 4217 codes the browser knows, read once. */
10
+ export declare function currencyCodes(): string[];
11
+ /** IANA time zones the browser knows, read once. */
12
+ export declare function timeZones(): string[];
13
+ /** Which group of output formats the picker offers for a tag of this type. */
14
+ export declare function formatKindOf(tagType: string | undefined): FormatKind;
15
+ export declare function currencyModifier(code: string): string;
16
+ export declare function currencyOf(modifier: string): string | undefined;
17
+ /** Price choices: every currency, then the legacy money modifiers saved presets may still carry. */
18
+ export declare function priceModifiers(): string[];
19
+ /** Modifiers the token may carry for a tag of this type; the first is the default. */
20
+ export declare function modifiersForKind(kind: FormatKind, tagType: string | undefined): string[];
21
+ export type DateModifier = {
22
+ format: string;
23
+ mode: TimeZoneMode;
24
+ zone: string;
25
+ };
26
+ export declare function parseDateModifier(modifier: string): DateModifier;
27
+ export declare function withTimeZone(format: string, mode: TimeZoneMode, zone: string): string;
28
+ /** Whether the sender renders this modifier for a tag of the kind, so the form can keep it as saved. */
29
+ export declare function isAcceptedModifier(kind: FormatKind, modifier: string, defaults: string[]): boolean;
30
+ export declare function currencySymbol(code: string): string;
31
+ export declare function currencyName(code: string): string;
32
+ /** Renders a price the way the sender does: symbol first, thousands by a space, cents only when not zero. */
33
+ export declare function formatPrice(amount: number, code: string | undefined): string;
34
+ /** Renders a sample date in a picker format (PHP `date()` letters, as the sender reads them). */
35
+ export declare function formatDate(date: Date, format: string, locale: string): string;
@@ -0,0 +1,171 @@
1
+ import { DynamicContentModifiers, modifiersForTagType } from '@pushwoosh/kit-constants';
2
+ const TZ_SPLITTER = '@';
3
+ const TZ_LOCAL = 'local';
4
+ const CURRENCY_PREFIX = 'currency:';
5
+ export const DEFAULT_FIXED_TIME_ZONE = 'Europe/Moscow';
6
+ export const DATE_AS_STORED = 'regular';
7
+ export const dateFormats = ['d.m.Y', 'd.m.Y H:i', 'Y-m-d', 'j F', ...DynamicContentModifiers.date, DATE_AS_STORED];
8
+ export const listFormats = ['join:comma', 'join:newline'];
9
+ export const booleanFormats = ['bool:yes_no', 'bool:on_off', 'bool:have', 'bool:check'];
10
+ export const legacyPriceModifiers = [...DynamicContentModifiers.number];
11
+ let currencies;
12
+ let zones;
13
+ /** ISO 4217 codes the browser knows, read once. */
14
+ export function currencyCodes() {
15
+ currencies ??= Intl.supportedValuesOf('currency');
16
+ return currencies;
17
+ }
18
+ /** IANA time zones the browser knows, read once. */
19
+ export function timeZones() {
20
+ zones ??= Intl.supportedValuesOf('timeZone');
21
+ return zones;
22
+ }
23
+ /** Which group of output formats the picker offers for a tag of this type. */
24
+ export function formatKindOf(tagType) {
25
+ switch (tagType) {
26
+ case 'DATE':
27
+ return 'date';
28
+ case 'INTEGER':
29
+ return 'number';
30
+ case 'PRICE':
31
+ return 'price';
32
+ case 'LIST':
33
+ return 'list';
34
+ case 'BOOLEAN':
35
+ return 'boolean';
36
+ default:
37
+ return 'string';
38
+ }
39
+ }
40
+ export function currencyModifier(code) {
41
+ return `${CURRENCY_PREFIX}${code}`;
42
+ }
43
+ export function currencyOf(modifier) {
44
+ return modifier.startsWith(CURRENCY_PREFIX) ? modifier.slice(CURRENCY_PREFIX.length) : undefined;
45
+ }
46
+ /** Price choices: every currency, then the legacy money modifiers saved presets may still carry. */
47
+ export function priceModifiers() {
48
+ return [currencyModifier('USD'), ...currencyCodes().filter(code => code !== 'USD').map(currencyModifier), ...legacyPriceModifiers];
49
+ }
50
+ /** Modifiers the token may carry for a tag of this type; the first is the default. */
51
+ export function modifiersForKind(kind, tagType) {
52
+ switch (kind) {
53
+ case 'date':
54
+ return [withTimeZone(dateFormats[0], 'local', DEFAULT_FIXED_TIME_ZONE)];
55
+ case 'price':
56
+ return [currencyModifier('USD')];
57
+ case 'list':
58
+ return listFormats;
59
+ case 'boolean':
60
+ return booleanFormats;
61
+ default:
62
+ return modifiersForTagType(tagType);
63
+ }
64
+ }
65
+ export function parseDateModifier(modifier) {
66
+ const [format, zone] = modifier.split(TZ_SPLITTER);
67
+ if (zone === undefined) {
68
+ return {
69
+ format,
70
+ mode: 'stored',
71
+ zone: DEFAULT_FIXED_TIME_ZONE
72
+ };
73
+ }
74
+ if (zone === TZ_LOCAL) {
75
+ return {
76
+ format,
77
+ mode: 'local',
78
+ zone: DEFAULT_FIXED_TIME_ZONE
79
+ };
80
+ }
81
+ return {
82
+ format,
83
+ mode: 'fixed',
84
+ zone
85
+ };
86
+ }
87
+ export function withTimeZone(format, mode, zone) {
88
+ if (format === DATE_AS_STORED) {
89
+ return format;
90
+ }
91
+ switch (mode) {
92
+ case 'local':
93
+ return `${format}${TZ_SPLITTER}${TZ_LOCAL}`;
94
+ case 'fixed':
95
+ return `${format}${TZ_SPLITTER}${zone}`;
96
+ default:
97
+ return format;
98
+ }
99
+ }
100
+ /** Whether the sender renders this modifier for a tag of the kind, so the form can keep it as saved. */
101
+ export function isAcceptedModifier(kind, modifier, defaults) {
102
+ switch (kind) {
103
+ case 'date':
104
+ {
105
+ const {
106
+ format,
107
+ mode,
108
+ zone
109
+ } = parseDateModifier(modifier);
110
+ return dateFormats.includes(format) && (mode !== 'fixed' || timeZones().includes(zone)) && (format !== DATE_AS_STORED || mode === 'stored');
111
+ }
112
+ case 'price':
113
+ {
114
+ const code = currencyOf(modifier);
115
+ return code ? currencyCodes().includes(code) : legacyPriceModifiers.includes(modifier);
116
+ }
117
+ default:
118
+ return defaults.includes(modifier);
119
+ }
120
+ }
121
+ export function currencySymbol(code) {
122
+ const parts = new Intl.NumberFormat('en', {
123
+ style: 'currency',
124
+ currency: code,
125
+ currencyDisplay: 'narrowSymbol'
126
+ }).formatToParts(0);
127
+ return parts.find(part => part.type === 'currency')?.value ?? code;
128
+ }
129
+ export function currencyName(code) {
130
+ return new Intl.DisplayNames(['en'], {
131
+ type: 'currency'
132
+ }).of(code) ?? code;
133
+ }
134
+ const groupThousands = digits => digits.replace(/\B(?=(\d{3})+(?!\d))/g, ' ');
135
+ /** Renders a price the way the sender does: symbol first, thousands by a space, cents only when not zero. */
136
+ export function formatPrice(amount, code) {
137
+ const [whole, cents] = amount.toFixed(2).split('.');
138
+ const number = cents === '00' ? groupThousands(whole) : `${groupThousands(whole)}.${cents}`;
139
+ return code ? `${currencySymbol(code)} ${number}` : number;
140
+ }
141
+ const pad = n => String(n).padStart(2, '0');
142
+ /** Renders a sample date in a picker format (PHP `date()` letters, as the sender reads them). */
143
+ export function formatDate(date, format, locale) {
144
+ if (format === DATE_AS_STORED) {
145
+ return `${date.getUTCFullYear()}-${pad(date.getUTCMonth() + 1)}-${pad(date.getUTCDate())} ${pad(date.getUTCHours())}:${pad(date.getUTCMinutes())}:00`;
146
+ }
147
+ const month = style => new Intl.DateTimeFormat(locale, {
148
+ month: style,
149
+ timeZone: 'UTC'
150
+ }).format(date);
151
+ const map = {
152
+ d: pad(date.getUTCDate()),
153
+ j: String(date.getUTCDate()),
154
+ m: pad(date.getUTCMonth() + 1),
155
+ M: month('short'),
156
+ F: new Intl.DateTimeFormat(locale, {
157
+ day: 'numeric',
158
+ month: 'long',
159
+ timeZone: 'UTC'
160
+ }).formatToParts(date).find(part => part.type === 'month')?.value ?? month('long'),
161
+ y: pad(date.getUTCFullYear() % 100),
162
+ Y: String(date.getUTCFullYear()),
163
+ H: pad(date.getUTCHours()),
164
+ i: pad(date.getUTCMinutes()),
165
+ l: new Intl.DateTimeFormat(locale, {
166
+ weekday: 'long',
167
+ timeZone: 'UTC'
168
+ }).format(date)
169
+ };
170
+ return format.replace(/[djmMFyYHil]/g, letter => map[letter] ?? letter);
171
+ }
@@ -7,6 +7,7 @@ import { DangerTriangleIcon, DownloadIcon } from '@pushwoosh/kit-icons';
7
7
  import { Text } from '@pushwoosh/kit-typography';
8
8
  import { useLang } from '../polyglot';
9
9
  import { useExportService } from '../useExportService';
10
+ import { exportFileName } from './exportFileName';
10
11
  import { useExportVisibility } from './hooks/useExportVisibility';
11
12
  export const ExportCsvBanner = ({
12
13
  exportTask,
@@ -44,9 +45,12 @@ export const ExportCsvBanner = ({
44
45
  }, [clearExport, exportTask, getStatus, show]);
45
46
  useEffect(() => {
46
47
  if (taskResult) {
47
- updateExportTask({
48
+ const filename = exportFileName(taskResult);
49
+ updateExportTask(filename ? {
48
50
  status: 'STATUS_SUCCESS',
49
- filename: taskResult.data.file
51
+ filename
52
+ } : {
53
+ status: 'STATUS_FAILED'
50
54
  });
51
55
  }
52
56
  }, [taskResult, updateExportTask]);
@@ -67,13 +71,14 @@ export const ExportCsvBanner = ({
67
71
  status,
68
72
  args
69
73
  } = res[0];
70
- const {
71
- data
72
- } = result;
74
+ const filename = exportFileName(result);
75
+ if (status === 'STATUS_SUCCESS' && !filename) {
76
+ return;
77
+ }
73
78
  updateExportTask({
74
79
  id,
75
80
  status,
76
- filename: data.file,
81
+ filename,
77
82
  args,
78
83
  progressTitle: lang({
79
84
  message: 'SMART.EXPORT_CSV.PROGRESS_TITLE'
@@ -0,0 +1,3 @@
1
+ import { type ResultResponse_result, type TaskInfo_result } from '@pushwoosh/rpc-v2-http-api-data/pushwoosh_export_messages_v2';
2
+ /** File of a finished export task; a running task has no `data` in its result yet. */
3
+ export declare const exportFileName: (result: ResultResponse_result | TaskInfo_result | undefined) => string | undefined;
@@ -0,0 +1,5 @@
1
+ /** File of a finished export task; a running task has no `data` in its result yet. */
2
+ export const exportFileName = result => {
3
+ const data = result?.data;
4
+ return data && 'file' in data && data.file ? data.file : undefined;
5
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pushwoosh/smart-components-kit",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "Stateful, data-connected React components shared by Pushwoosh micro-frontends",
5
5
  "repository": {
6
6
  "type": "git",
@@ -26,18 +26,18 @@
26
26
  },
27
27
  "dependencies": {
28
28
  "@floating-ui/react-dom": "^2.1.9",
29
- "@pushwoosh/dumb-components": "^4.18.0",
29
+ "@pushwoosh/dumb-components": "^4.18.1",
30
30
  "@pushwoosh/kit-constants": "^3.2.1",
31
31
  "@pushwoosh/kit-helpers": "^4.18.0",
32
32
  "@pushwoosh/kit-icons": "^3.0.2",
33
33
  "@pushwoosh/kit-typography": "^2.2.0",
34
- "@pushwoosh/rpc-v2-http-api-data": "^0.2.556",
34
+ "@pushwoosh/rpc-v2-http-api-data": "^0.2.570",
35
35
  "jwt-decode": "^4.0.0",
36
36
  "react-hook-form": "^7.91.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@pushwoosh/frontend-builder-engine": "^5.6.0",
40
- "@pushwoosh/spa-context": "^3.10.0",
40
+ "@pushwoosh/spa-context": "^3.13.1",
41
41
  "@svgr/webpack": "^8.1.0",
42
42
  "@testing-library/dom": "^10.4.2",
43
43
  "@testing-library/react": "^16.3.3",