@pushwoosh/smart-components-kit 1.0.90 → 1.1.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/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.d.ts +1 -2
- package/CampaignsConfigurationDrawer/CampaignsConfigurationDrawer.js +103 -88
- package/CampaignsConfigurationDrawer/components/Card/Card.d.ts +1 -2
- package/CampaignsConfigurationDrawer/components/Card/Card.js +19 -13
- package/DocsButton/DocsButton.d.ts +1 -2
- package/DocsButton/DocsButton.js +21 -18
- package/DynamicContentPicker/DynamicContentPicker.js +76 -63
- package/DynamicContentPicker/Line.js +24 -22
- package/DynamicContentPickerForm/DynamicContentCustomPickerForm.js +18 -17
- package/DynamicContentPickerForm/DynamicContentEventPickerForm.js +60 -57
- package/DynamicContentPickerForm/DynamicContentTagPickerForm.js +60 -57
- package/DynamicContentPickerForm/SimpleDynamicContentPickerFormSmart.js +72 -63
- package/DynamicContentPickerForm/VariedDynamicContentPickerFormSmart.js +86 -74
- package/EmailTemplatePreview/EmailTemplatePreview.js +8 -6
- package/ExportCSV/ExportCsvBanner/ExportCsvBanner.d.ts +1 -2
- package/ExportCSV/ExportCsvBanner/ExportCsvBanner.js +54 -49
- package/ExportCSV/useExportService/useExportService.js +1 -0
- package/LanguagesSelector/LanguagesModal.js +38 -24
- package/LanguagesSelector/LanguagesSelectForm.js +73 -62
- package/LanguagesSelector/LanguagesSelectFormLoader.js +8 -7
- package/LanguagesSelector/LanguagesSelector.js +92 -78
- package/MediaStore/CreateVariantDrawer.js +134 -85
- package/MediaStore/MediaStore.js +137 -112
- package/ModalCloningJourney/ModalCloningJourney.d.ts +1 -2
- package/ModalCloningJourney/ModalCloningJourney.js +113 -91
- package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.d.ts +1 -2
- package/OpenActions/components/OpenActionsSummary/OpenActionsSummary.js +98 -78
- package/OpenActions/components/OpenActionsSummaryByPreset.d.ts +1 -2
- package/OpenActions/components/OpenActionsSummaryByPreset.js +2 -2
- package/PlatformsConfigurationDrawer/PlatformsConfigurationDrawer.js +21 -17
- package/PlatformsConfigurationDrawer/components/DesktopPage/DesktopPage.js +112 -75
- package/PlatformsConfigurationDrawer/components/MainPage/MainPage.js +155 -101
- package/PlatformsConfigurationDrawer/components/MobilePage/MobilePage.js +138 -91
- package/ResendModal/ResendModal.d.ts +1 -2
- package/ResendModal/ResendModal.js +92 -72
- package/RichMessageEditorSmart/NewDynamicContentForm.js +16 -12
- package/RichMessageEditorSmart/RichMessageEditorSmart.js +4 -4
- package/SystemParcel/SystemParcel.d.ts +3 -3
- package/SystemParcel/SystemParcel.js +3 -2
- package/Table/components/DataTable/DataTable.js +80 -61
- package/Table/components/DataTableGetContext/DataTableGetContext.d.ts +1 -2
- package/Table/components/DataTableGetContext/DataTableGetContext.js +5 -2
- package/Table/components/DataTableList/DataTableList.d.ts +1 -2
- package/Table/components/DataTableList/DataTableList.js +86 -68
- package/Table/components/DataTablePagination/DataTablePagination.js +6 -4
- package/Table/components/DataTableSearchInput/DataTableSearchInput.js +3 -2
- package/Table/components/DataTableSortableCell/DataTableSortableCell.js +6 -4
- package/Table/components/Loading/Loading.d.ts +1 -2
- package/Table/components/Loading/Loading.js +16 -14
- package/Table/components/TablePagination/TablePagination.js +31 -25
- package/_devel/index.js +36 -24
- package/_devel/lib/dynamic-content-picker.d.ts +1 -2
- package/_devel/lib/dynamic-content-picker.js +16 -10
- package/_devel/lib/index.d.ts +2 -2
- package/_devel/lib/index.js +38 -19
- package/_devel/test-place.d.ts +1 -2
- package/_devel/test-place.js +4 -2
- package/package.json +2 -2
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useCallback, useEffect } from 'react';
|
|
2
3
|
import { ExportResult, ProgressBar, Button } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { Color, ShapeRadius } from '@pushwoosh/kit-constants';
|
|
4
5
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
@@ -97,57 +98,61 @@ export const ExportCsvBanner = ({
|
|
|
97
98
|
resultSubTitle,
|
|
98
99
|
progressTitle
|
|
99
100
|
} = exportTask;
|
|
100
|
-
return
|
|
101
|
+
return _jsxs(Horizontal, {
|
|
101
102
|
"$padding": 8,
|
|
102
103
|
"$alignItems": "center",
|
|
103
104
|
"$border": `1px solid ${Color.DIVIDER}`,
|
|
104
105
|
"$borderRadius": ShapeRadius.SECTION,
|
|
105
|
-
"$bgColor": Color.CLEAR
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
106
|
+
"$bgColor": Color.CLEAR,
|
|
107
|
+
children: [status === 'STATUS_SUCCESS' && _jsx(ExportResult, {
|
|
108
|
+
type: "success",
|
|
109
|
+
title: lang({
|
|
110
|
+
message: 'SMART.EXPORT_CSV.SUCCESS_TITLE'
|
|
111
|
+
}),
|
|
112
|
+
subtitle: `${resultSubTitle} ${filename}`,
|
|
113
|
+
handleClose: handleClose,
|
|
114
|
+
rightSlot: _jsx("a", {
|
|
115
|
+
href: `/api/v2/statistics/exportMessagesStatistics/download/${filename}`,
|
|
116
|
+
download: filename,
|
|
117
|
+
children: _jsx(Button, {
|
|
118
|
+
color: "secondary",
|
|
119
|
+
size: "compact",
|
|
120
|
+
icon: _jsx(DownloadIcon, {
|
|
121
|
+
size: "small",
|
|
122
|
+
view: "filled"
|
|
123
|
+
}),
|
|
124
|
+
children: lang({
|
|
125
|
+
message: 'SMART.EXPORT_CSV.DOWNLOAD'
|
|
126
|
+
})
|
|
127
|
+
})
|
|
128
|
+
})
|
|
129
|
+
}), status === 'STATUS_PENDING' && (isKeepPageOpenWarning ? _jsx(ProgressBar, {
|
|
130
|
+
title: progressTitle,
|
|
131
|
+
percentValue: progress,
|
|
132
|
+
rightSlot: _jsx(Text, {
|
|
133
|
+
"$color": Color.WARNING,
|
|
134
|
+
"$variant": "h5",
|
|
135
|
+
"$uppercase": true,
|
|
136
|
+
children: lang({
|
|
137
|
+
message: 'SMART.EXPORT_CSV.KEEP_PAGE_OPEN'
|
|
138
|
+
})
|
|
122
139
|
})
|
|
123
|
-
},
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
title: lang({
|
|
142
|
-
message: 'SMART.EXPORT_CSV.FAILED_TITLE'
|
|
143
|
-
}),
|
|
144
|
-
subtitle: lang({
|
|
145
|
-
message: 'SMART.EXPORT_CSV.FAILED_SUBTITLE'
|
|
146
|
-
}),
|
|
147
|
-
leftSlotIcon: React.createElement(DangerTriangleIcon, {
|
|
148
|
-
size: "medium",
|
|
149
|
-
view: "filled"
|
|
150
|
-
}),
|
|
151
|
-
handleClose: handleClose
|
|
152
|
-
}));
|
|
140
|
+
}) : _jsx(ProgressBar, {
|
|
141
|
+
title: progressTitle,
|
|
142
|
+
percentValue: progress
|
|
143
|
+
})), status === 'STATUS_FAILED' && _jsx(ExportResult, {
|
|
144
|
+
type: "error",
|
|
145
|
+
title: lang({
|
|
146
|
+
message: 'SMART.EXPORT_CSV.FAILED_TITLE'
|
|
147
|
+
}),
|
|
148
|
+
subtitle: lang({
|
|
149
|
+
message: 'SMART.EXPORT_CSV.FAILED_SUBTITLE'
|
|
150
|
+
}),
|
|
151
|
+
leftSlotIcon: _jsx(DangerTriangleIcon, {
|
|
152
|
+
size: "medium",
|
|
153
|
+
view: "filled"
|
|
154
|
+
}),
|
|
155
|
+
handleClose: handleClose
|
|
156
|
+
})]
|
|
157
|
+
});
|
|
153
158
|
};
|
|
@@ -60,6 +60,7 @@ export const useExportService = () => {
|
|
|
60
60
|
if (retriesRef.current < MAX_RETRIES) {
|
|
61
61
|
retriesRef.current += 1;
|
|
62
62
|
timeoutStatusRef.current = setTimeout(() => {
|
|
63
|
+
// eslint-disable-next-line react-hooks/immutability
|
|
63
64
|
getStatus(params);
|
|
64
65
|
clearStatusTimeout();
|
|
65
66
|
}, API_CHECK_INTERVAL);
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { useState } from 'react';
|
|
2
3
|
import { Button, ModalHeader, ModalBody, ModalFooter, ModalTitle } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import { LanguagesSelectFormLoader } from './LanguagesSelectFormLoader';
|
|
@@ -12,27 +13,40 @@ export const LanguagesModal = ({
|
|
|
12
13
|
}) => {
|
|
13
14
|
const lang = useLang();
|
|
14
15
|
const [selectedLanguages, setSelectedLanguages] = useState(initialLanguages);
|
|
15
|
-
return
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
16
|
+
return _jsxs(_Fragment, {
|
|
17
|
+
children: [_jsx(ModalHeader, {
|
|
18
|
+
children: _jsx(ModalTitle, {
|
|
19
|
+
children: lang({
|
|
20
|
+
message: 'SMART.LANGUAGES_SELECTOR.MODAL.TITLE'
|
|
21
|
+
})
|
|
22
|
+
})
|
|
23
|
+
}), _jsx(ModalBody, {
|
|
24
|
+
children: _jsx(LanguagesSelectFormLoader, {
|
|
25
|
+
application: applicationCode,
|
|
26
|
+
onChange: setSelectedLanguages,
|
|
27
|
+
value: selectedLanguages
|
|
28
|
+
})
|
|
29
|
+
}), _jsx(ModalFooter, {
|
|
30
|
+
children: _jsxs(Horizontal, {
|
|
31
|
+
"$justifyContent": "end",
|
|
32
|
+
"$gap": 8,
|
|
33
|
+
children: [_jsx(Button, {
|
|
34
|
+
color: "secondary",
|
|
35
|
+
onClick: onClose,
|
|
36
|
+
children: lang({
|
|
37
|
+
message: 'SMART.LANGUAGES_SELECTOR.BUTTON.CANCEL'
|
|
38
|
+
})
|
|
39
|
+
}), _jsx(Button, {
|
|
40
|
+
color: "primary",
|
|
41
|
+
onClick: () => {
|
|
42
|
+
saveLastSelection(selectedLanguages);
|
|
43
|
+
onSubmit(selectedLanguages);
|
|
44
|
+
},
|
|
45
|
+
children: lang({
|
|
46
|
+
message: 'SMART.LANGUAGES_SELECTOR.BUTTON.APPLY'
|
|
47
|
+
})
|
|
48
|
+
})]
|
|
49
|
+
})
|
|
50
|
+
})]
|
|
51
|
+
});
|
|
38
52
|
};
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
2
3
|
import { Checkbox, SearchInput } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { Columns, Horizontal, Vertical } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import { useLang } from './polyglot';
|
|
@@ -24,65 +25,75 @@ export const LanguagesSelectForm = ({
|
|
|
24
25
|
return item.name.toLowerCase().includes(search.toLowerCase());
|
|
25
26
|
});
|
|
26
27
|
}, [allLanguageItems, search, showAllLanguages, langs]);
|
|
27
|
-
return
|
|
28
|
-
"$gap": 8
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
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
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
28
|
+
return _jsxs(Vertical, {
|
|
29
|
+
"$gap": 8,
|
|
30
|
+
children: [_jsx(SearchInput, {
|
|
31
|
+
value: search,
|
|
32
|
+
onChange: e => setSearch(e.target.value),
|
|
33
|
+
"$onClear": () => setSearch(''),
|
|
34
|
+
placeholder: lang({
|
|
35
|
+
message: 'SMART.LANGUAGES_SELECTOR.SEARCH_PLACEHOLDER'
|
|
36
|
+
})
|
|
37
|
+
}), _jsxs(Horizontal, {
|
|
38
|
+
"$justifyContent": "space-between",
|
|
39
|
+
children: [_jsxs(Horizontal, {
|
|
40
|
+
"$gap": 16,
|
|
41
|
+
"$justifyContent": "start",
|
|
42
|
+
children: [_jsx(ActionButton, {
|
|
43
|
+
onClick: () => {
|
|
44
|
+
onChange(filteredLanguages.map(item => item.code));
|
|
45
|
+
},
|
|
46
|
+
children: lang({
|
|
47
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.SELECT_ALL'
|
|
48
|
+
})
|
|
49
|
+
}), _jsx(ActionButton, {
|
|
50
|
+
onClick: () => {
|
|
51
|
+
onChange([]);
|
|
52
|
+
},
|
|
53
|
+
children: lang({
|
|
54
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.DESELECT_ALL'
|
|
55
|
+
})
|
|
56
|
+
})]
|
|
57
|
+
}), lastSelection.length > 0 && _jsx(ActionButton, {
|
|
58
|
+
onClick: () => {
|
|
59
|
+
onChange(lastSelection);
|
|
60
|
+
},
|
|
61
|
+
children: lang({
|
|
62
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.REUSE_LAST'
|
|
63
|
+
})
|
|
64
|
+
})]
|
|
65
|
+
}), _jsxs(Vertical, {
|
|
66
|
+
"$gap": 24,
|
|
67
|
+
children: [_jsx(Columns, {
|
|
68
|
+
"$sizes": 3,
|
|
69
|
+
"$gap": 8,
|
|
70
|
+
children: filteredLanguages.map(item => _jsx(Checkbox, {
|
|
71
|
+
name: "languages",
|
|
72
|
+
value: item.code,
|
|
73
|
+
isChecked: langs.includes(item.code),
|
|
74
|
+
onChange: isChecked => {
|
|
75
|
+
if (isChecked) {
|
|
76
|
+
onChange([...langs, item.code]);
|
|
77
|
+
} else {
|
|
78
|
+
onChange(langs.filter(code => code !== item.code));
|
|
79
|
+
}
|
|
80
|
+
},
|
|
81
|
+
label: lang({
|
|
82
|
+
message: 'SMART.LANGUAGES_SELECTOR.CHECKBOX_LABEL',
|
|
83
|
+
name: getLangName(item.code),
|
|
84
|
+
subscribers: item.subscribers
|
|
85
|
+
})
|
|
86
|
+
}, item.code))
|
|
87
|
+
}), _jsx("div", {
|
|
88
|
+
children: _jsx(ActionButton, {
|
|
89
|
+
onClick: () => setShowAllLanguages(x => !x),
|
|
90
|
+
children: showAllLanguages ? lang({
|
|
91
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.SHOW_WITH_SUBSCRIBERS'
|
|
92
|
+
}) : lang({
|
|
93
|
+
message: 'SMART.LANGUAGES_SELECTOR.ACTION.SHOW_ALL'
|
|
94
|
+
})
|
|
95
|
+
})
|
|
96
|
+
})]
|
|
97
|
+
})]
|
|
98
|
+
});
|
|
88
99
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
import { Spinner } from '@pushwoosh/dumb-components';
|
|
3
3
|
import { Horizontal, useAsync } from '@pushwoosh/kit-helpers';
|
|
4
4
|
import { useSPAContext } from '@pushwoosh/spa-context';
|
|
@@ -38,14 +38,15 @@ export const LanguagesSelectFormLoader = ({
|
|
|
38
38
|
});
|
|
39
39
|
}, [application, getLangName, systemLanguage]);
|
|
40
40
|
if (langAsync.loading) {
|
|
41
|
-
return
|
|
41
|
+
return _jsx(Horizontal, {
|
|
42
42
|
"$placeItems": "center",
|
|
43
|
-
"$padding": 36
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
43
|
+
"$padding": 36,
|
|
44
|
+
children: _jsx(Spinner, {
|
|
45
|
+
size: "medium"
|
|
46
|
+
})
|
|
47
|
+
});
|
|
47
48
|
}
|
|
48
|
-
return
|
|
49
|
+
return _jsx(LanguagesSelectForm, {
|
|
49
50
|
allLanguageItems: langAsync.value,
|
|
50
51
|
langs: value,
|
|
51
52
|
onChange: onChange,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo, useState } from 'react';
|
|
2
3
|
import { Button, Modal, DropdownMenu, DropdownMenuItem, DropdownMenuSection } from '@pushwoosh/dumb-components';
|
|
3
4
|
import { Horizontal } from '@pushwoosh/kit-helpers';
|
|
4
5
|
import { ArrowIcon, ChevronIcon, LanguageIcon, PlusIcon } from '@pushwoosh/kit-icons';
|
|
@@ -23,84 +24,97 @@ export const LanguagesSelector = ({
|
|
|
23
24
|
}));
|
|
24
25
|
return ['default', ...sorted];
|
|
25
26
|
}, [getLangName, languages]);
|
|
26
|
-
return
|
|
27
|
-
"$gap": 8
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
return _jsxs(Horizontal, {
|
|
28
|
+
"$gap": 8,
|
|
29
|
+
children: [_jsx(DropdownMenu, {
|
|
30
|
+
isScrollable: true,
|
|
31
|
+
renderHandler: handlerProps => _jsx(Button, {
|
|
32
|
+
style: {
|
|
33
|
+
minWidth: 200
|
|
34
|
+
},
|
|
35
|
+
color: "secondary",
|
|
36
|
+
icon: _jsx(LanguageIcon, {
|
|
37
|
+
size: "medium",
|
|
38
|
+
view: "lined"
|
|
39
|
+
}),
|
|
40
|
+
rightIcon: _jsx(ChevronIcon, {
|
|
41
|
+
size: "medium",
|
|
42
|
+
direction: "down"
|
|
43
|
+
}),
|
|
44
|
+
onClick: handlerProps.onClick,
|
|
45
|
+
boxRef: handlerProps.ref,
|
|
46
|
+
isOpen: handlerProps.isOpen,
|
|
47
|
+
isDisabled: isDisabled,
|
|
48
|
+
children: getLangName(value)
|
|
38
49
|
}),
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
50
|
+
children: () => _jsxs(_Fragment, {
|
|
51
|
+
children: [_jsx(DropdownMenuSection, {
|
|
52
|
+
children: _jsx(DropdownMenuItem, {
|
|
53
|
+
onClick: () => setShowLanguagesModal(true),
|
|
54
|
+
children: lang({
|
|
55
|
+
message: 'SMART.LANGUAGES_SELECTOR.CHOOSE_LANGUAGES'
|
|
56
|
+
})
|
|
57
|
+
})
|
|
58
|
+
}), _jsx(DropdownMenuSection, {
|
|
59
|
+
children: sortedLanguages.map(code => _jsx(DropdownMenuItem, {
|
|
60
|
+
isActive: code === value,
|
|
61
|
+
onClick: () => onChange(code),
|
|
62
|
+
children: getLangName(code)
|
|
63
|
+
}, code))
|
|
64
|
+
})]
|
|
65
|
+
})
|
|
66
|
+
}), sortedLanguages.length > 1 && _jsxs(ButtonGroup, {
|
|
67
|
+
children: [_jsx(Button, {
|
|
68
|
+
color: "secondary",
|
|
69
|
+
isDisabled: isDisabled,
|
|
70
|
+
icon: _jsx(ArrowIcon, {
|
|
71
|
+
size: "medium",
|
|
72
|
+
direction: "left"
|
|
73
|
+
}),
|
|
74
|
+
onClick: () => {
|
|
75
|
+
const index = sortedLanguages.indexOf(value);
|
|
76
|
+
if (index > 0) {
|
|
77
|
+
onChange(sortedLanguages[index - 1]);
|
|
78
|
+
} else {
|
|
79
|
+
onChange(sortedLanguages[sortedLanguages.length - 1]);
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
}), _jsx(Button, {
|
|
83
|
+
color: "secondary",
|
|
84
|
+
isDisabled: isDisabled,
|
|
85
|
+
icon: _jsx(ArrowIcon, {
|
|
86
|
+
size: "medium",
|
|
87
|
+
direction: "right"
|
|
88
|
+
}),
|
|
89
|
+
onClick: () => {
|
|
90
|
+
const index = sortedLanguages.indexOf(value);
|
|
91
|
+
if (index < sortedLanguages.length - 1) {
|
|
92
|
+
onChange(sortedLanguages[index + 1]);
|
|
93
|
+
} else {
|
|
94
|
+
onChange(sortedLanguages[0]);
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
})]
|
|
98
|
+
}), sortedLanguages.length <= 1 && _jsx(Button, {
|
|
99
|
+
color: "secondary",
|
|
100
|
+
icon: _jsx(PlusIcon, {
|
|
101
|
+
size: "medium"
|
|
42
102
|
}),
|
|
43
|
-
onClick:
|
|
44
|
-
|
|
45
|
-
isOpen: handlerProps.isOpen,
|
|
46
|
-
isDisabled: isDisabled
|
|
47
|
-
}, getLangName(value))
|
|
48
|
-
}, () => React.createElement(React.Fragment, null, React.createElement(DropdownMenuSection, null, React.createElement(DropdownMenuItem, {
|
|
49
|
-
onClick: () => setShowLanguagesModal(true)
|
|
50
|
-
}, lang({
|
|
51
|
-
message: 'SMART.LANGUAGES_SELECTOR.CHOOSE_LANGUAGES'
|
|
52
|
-
}))), React.createElement(DropdownMenuSection, null, sortedLanguages.map(code => React.createElement(DropdownMenuItem, {
|
|
53
|
-
key: code,
|
|
54
|
-
isActive: code === value,
|
|
55
|
-
onClick: () => onChange(code)
|
|
56
|
-
}, getLangName(code)))))), sortedLanguages.length > 1 && React.createElement(ButtonGroup, null, React.createElement(Button, {
|
|
57
|
-
color: "secondary",
|
|
58
|
-
isDisabled: isDisabled,
|
|
59
|
-
icon: React.createElement(ArrowIcon, {
|
|
60
|
-
size: "medium",
|
|
61
|
-
direction: "left"
|
|
62
|
-
}),
|
|
63
|
-
onClick: () => {
|
|
64
|
-
const index = sortedLanguages.indexOf(value);
|
|
65
|
-
if (index > 0) {
|
|
66
|
-
onChange(sortedLanguages[index - 1]);
|
|
67
|
-
} else {
|
|
68
|
-
onChange(sortedLanguages[sortedLanguages.length - 1]);
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}), React.createElement(Button, {
|
|
72
|
-
color: "secondary",
|
|
73
|
-
isDisabled: isDisabled,
|
|
74
|
-
icon: React.createElement(ArrowIcon, {
|
|
103
|
+
onClick: () => setShowLanguagesModal(true)
|
|
104
|
+
}), _jsx(Modal, {
|
|
75
105
|
size: "medium",
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
}),
|
|
91
|
-
onClick: () => setShowLanguagesModal(true)
|
|
92
|
-
}), React.createElement(Modal, {
|
|
93
|
-
size: "medium",
|
|
94
|
-
isOpen: showLanguagesModal
|
|
95
|
-
}, React.createElement(LanguagesModal, {
|
|
96
|
-
applicationCode: applicationCode,
|
|
97
|
-
initialLanguages: languages,
|
|
98
|
-
onSubmit: langs => {
|
|
99
|
-
onChangeLanguages(langs);
|
|
100
|
-
setShowLanguagesModal(false);
|
|
101
|
-
},
|
|
102
|
-
onClose: () => {
|
|
103
|
-
setShowLanguagesModal(false);
|
|
104
|
-
}
|
|
105
|
-
})));
|
|
106
|
+
isOpen: showLanguagesModal,
|
|
107
|
+
children: _jsx(LanguagesModal, {
|
|
108
|
+
applicationCode: applicationCode,
|
|
109
|
+
initialLanguages: languages,
|
|
110
|
+
onSubmit: langs => {
|
|
111
|
+
onChangeLanguages(langs);
|
|
112
|
+
setShowLanguagesModal(false);
|
|
113
|
+
},
|
|
114
|
+
onClose: () => {
|
|
115
|
+
setShowLanguagesModal(false);
|
|
116
|
+
}
|
|
117
|
+
})
|
|
118
|
+
})]
|
|
119
|
+
});
|
|
106
120
|
};
|