@itcase/ui 1.8.123 → 1.8.125
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Avatar_cjs_AwXEUY8j.js +161 -0
- package/dist/Avatar_es_BtlaCRc5.js +157 -0
- package/dist/{Button_cjs_Ce97psFT.js → Button_cjs_C34BU1BK.js} +46 -34
- package/dist/{Button_es_CZss7cXh.js → Button_es_DnlzLBUT.js} +46 -34
- package/dist/ChipsGroup_cjs_DfAKN5CA.js +344 -0
- package/dist/{ChipsGroup_es_ayPPUwQ7.js → ChipsGroup_es_DBKY2UyF.js} +48 -35
- package/dist/DatePicker_cjs_DfbeIL2m.js +182 -0
- package/dist/DatePicker_es_BIJNx427.js +178 -0
- package/dist/Divider_cjs_DrmV2ezS.js +105 -0
- package/dist/Divider_es_BiYozVBS.js +101 -0
- package/dist/DropdownItem_cjs_vHuzXW9M.js +211 -0
- package/dist/DropdownItem_es_DVHWWgnU.js +206 -0
- package/dist/Group_cjs_DmfeUcFI.js +59 -0
- package/dist/Group_es_BU5k8f5S.js +55 -0
- package/dist/{Icon_cjs_Cz6IyOkb.js → Icon_cjs_BVLGzj7Y.js} +170 -157
- package/dist/{Icon_es_BrwLifge.js → Icon_es_DkVkzTha.js} +170 -157
- package/dist/Image_cjs_BUM81t4Y.js +28 -0
- package/dist/Image_es_C-IjVkKX.js +26 -0
- package/dist/{Input_cjs_DRPK_RHK.js → Input_cjs_DDi5JVAV.js} +27 -19
- package/dist/{Input_es_Cv5nEb_n.js → Input_es_BnCXATnh.js} +27 -19
- package/dist/{Label_cjs_DMoaOoHi.js → Label_cjs_DwAmukik.js} +45 -33
- package/dist/{Label_es_SULlg9bL.js → Label_es_B2kcstsG.js} +45 -33
- package/dist/{Link_cjs_C5UsZUiF.js → Link_cjs_qKXVfU8e.js} +43 -30
- package/dist/{Link_es_XiqbdwLp.js → Link_es_P2b6ya7P.js} +43 -30
- package/dist/Loader_cjs_DIDsIq3J.js +143 -0
- package/dist/Loader_es_CmSggwbR.js +139 -0
- package/dist/Overlay_cjs_tGA2fU43.js +42 -0
- package/dist/Overlay_es_BS7OTFoy.js +38 -0
- package/dist/{Scrollbar_cjs_DcKOfcNp.js → Scrollbar_cjs_Cp-7v2Mt.js} +1 -1
- package/dist/{Scrollbar_es_CThJeCLF.js → Scrollbar_es_CcMgNvGi.js} +1 -1
- package/dist/Text_cjs_BDTjOTVB.js +69 -0
- package/dist/Text_es_CnymlElo.js +65 -0
- package/dist/cjs/components/Accordion.js +37 -34
- package/dist/cjs/components/Avatar.js +5 -6
- package/dist/cjs/components/AvatarStack/stories/__mock__.js +1 -1
- package/dist/cjs/components/AvatarStack.js +17 -16
- package/dist/cjs/components/Badge.js +3 -4
- package/dist/cjs/components/Breadcrumbs/stories/__mock__.js +1 -1
- package/dist/cjs/components/Breadcrumbs.js +27 -23
- package/dist/cjs/components/Button.js +5 -6
- package/dist/cjs/components/Cell/stories/__mock__.js +1 -1
- package/dist/cjs/components/Cell.js +28 -25
- package/dist/cjs/components/Checkbox.js +33 -26
- package/dist/cjs/components/Checkmark.js +28 -23
- package/dist/cjs/components/Chips/stories/__mock__.js +1 -1
- package/dist/cjs/components/Chips.js +4 -5
- package/dist/cjs/components/Choice/stories/__mock__.js +2 -2
- package/dist/cjs/components/Choice.js +46 -40
- package/dist/cjs/components/Code.js +34 -26
- package/dist/cjs/components/CookiesWarning.js +23 -23
- package/dist/cjs/components/Dadata.js +14 -9
- package/dist/cjs/components/DatePeriod.js +32 -30
- package/dist/cjs/components/DatePicker.js +8 -9
- package/dist/cjs/components/Divider.js +1 -2
- package/dist/cjs/components/Dot.js +5 -6
- package/dist/cjs/components/Drawer.js +23 -21
- package/dist/cjs/components/Dropdown/stories/__mock__.js +6 -6
- package/dist/cjs/components/Dropdown.js +5 -6
- package/dist/cjs/components/Flex.js +11 -12
- package/dist/cjs/components/Grid.js +15 -16
- package/dist/cjs/components/Group.js +1 -2
- package/dist/cjs/components/HTMLContent.js +5 -6
- package/dist/cjs/components/HeroTitle.js +17 -16
- package/dist/cjs/components/Icon.js +3 -4
- package/dist/cjs/components/Image.js +1 -2
- package/dist/cjs/components/Input.js +1 -2
- package/dist/cjs/components/InputPassword.js +34 -26
- package/dist/cjs/components/Label.js +4 -5
- package/dist/cjs/components/Link.js +1 -2
- package/dist/cjs/components/List.js +39 -28
- package/dist/cjs/components/Loader.js +2 -3
- package/dist/cjs/components/Logo.js +10 -11
- package/dist/cjs/components/MenuItem.js +36 -33
- package/dist/cjs/components/Modal.js +40 -38
- package/dist/cjs/components/ModalSheetBottom.js +17 -18
- package/dist/cjs/components/Notification/stories/__mock__.js +1 -1
- package/dist/cjs/components/Notification.js +31 -24
- package/dist/cjs/components/Overlay.js +1 -2
- package/dist/cjs/components/Pagination.js +43 -41
- package/dist/cjs/components/Radio.js +34 -26
- package/dist/cjs/components/RangeSlider.js +8 -9
- package/dist/cjs/components/Response/img.js +1 -1
- package/dist/cjs/components/Response.js +45 -34
- package/dist/cjs/components/SVGContent.js +6 -7
- package/dist/cjs/components/ScrollOnDrag/stories/__mock__.js +2 -2
- package/dist/cjs/components/ScrollOnDrag.js +7 -8
- package/dist/cjs/components/ScrollToView.js +8 -9
- package/dist/cjs/components/Scrollbar/stories/__mock__.js +1 -1
- package/dist/cjs/components/Scrollbar.js +1 -1
- package/dist/cjs/components/Search.js +39 -31
- package/dist/cjs/components/Segmented/stories/__mock__.js +23 -10
- package/dist/cjs/components/Segmented.js +46 -41
- package/dist/cjs/components/Select.js +118 -113
- package/dist/cjs/components/Swiper/stories/__mock__.js +3 -3
- package/dist/cjs/components/Swiper.js +27 -29
- package/dist/cjs/components/Switch.js +33 -26
- package/dist/cjs/components/Tab/stories/__mock__.js +1 -1
- package/dist/cjs/components/Tab.js +33 -29
- package/dist/cjs/components/Text.js +1 -2
- package/dist/cjs/components/Textarea.js +26 -18
- package/dist/cjs/components/Tile.js +21 -17
- package/dist/cjs/components/Title.js +3 -4
- package/dist/cjs/components/Tooltip.js +3 -4
- package/dist/cjs/components/Video/stories/__mocks__.js +1 -1
- package/dist/cjs/components/Video.js +3 -4
- package/dist/cjs/components/Warning.js +26 -20
- package/dist/cjs/context/Notifications.js +38 -42
- package/dist/cjs/context/UIContext.js +19 -17
- package/dist/cjs/context/UrlAssetPrefix.js +3 -3
- package/dist/cjs/hoc/urlWithAssetPrefix.js +13 -16
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.helpers.js +13 -40
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.interface.js +1 -1
- package/dist/cjs/hooks/useActiveClasses/useActiveClasses.js +25 -29
- package/dist/cjs/hooks/useAppearanceConfig/useAppearanceConfig.js +13 -15
- package/dist/cjs/hooks/useAppearanceConfig.js +0 -1
- package/dist/cjs/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +21 -28
- package/dist/cjs/hooks/useDevicePropsGenerator.js +0 -1
- package/dist/cjs/hooks/useDeviceTargetClass.js +0 -1
- package/dist/cjs/hooks/useStyles/styleAttributes.js +1 -1
- package/dist/cjs/hooks/useStyles/useStyles.js +0 -1
- package/dist/cjs/hooks/useStyles.js +0 -1
- package/dist/cjs/hooks/useViewportFix.js +5 -5
- package/dist/cjs/hooks.js +1 -1
- package/dist/cjs/utils/setViewportProperty.js +3 -3
- package/dist/components/Accordion.js +37 -34
- package/dist/components/Avatar.js +5 -6
- package/dist/components/AvatarStack/stories/__mock__.js +1 -1
- package/dist/components/AvatarStack.js +17 -16
- package/dist/components/Badge.js +3 -4
- package/dist/components/Breadcrumbs/stories/__mock__.js +1 -1
- package/dist/components/Breadcrumbs.js +27 -23
- package/dist/components/Button.js +5 -6
- package/dist/components/Cell/stories/__mock__.js +1 -1
- package/dist/components/Cell.js +28 -25
- package/dist/components/Checkbox.js +33 -26
- package/dist/components/Checkmark.js +28 -23
- package/dist/components/Chips/stories/__mock__.js +1 -1
- package/dist/components/Chips.js +4 -5
- package/dist/components/Choice/stories/__mock__.js +2 -2
- package/dist/components/Choice.js +46 -40
- package/dist/components/Code.js +34 -26
- package/dist/components/CookiesWarning.js +23 -23
- package/dist/components/Dadata.js +14 -9
- package/dist/components/DatePeriod.js +32 -30
- package/dist/components/DatePicker.js +8 -9
- package/dist/components/Divider.js +1 -2
- package/dist/components/Dot.js +5 -6
- package/dist/components/Drawer.js +23 -21
- package/dist/components/Dropdown/stories/__mock__.js +6 -6
- package/dist/components/Dropdown.js +5 -6
- package/dist/components/Flex.js +11 -12
- package/dist/components/Grid.js +15 -16
- package/dist/components/Group.js +1 -2
- package/dist/components/HTMLContent.js +5 -6
- package/dist/components/HeroTitle.js +17 -16
- package/dist/components/Icon.js +3 -4
- package/dist/components/Image.js +1 -2
- package/dist/components/Input.js +1 -2
- package/dist/components/InputPassword.js +34 -26
- package/dist/components/Label.js +4 -5
- package/dist/components/Link.js +1 -2
- package/dist/components/List.js +39 -28
- package/dist/components/Loader.js +2 -3
- package/dist/components/Logo.js +10 -11
- package/dist/components/MenuItem.js +36 -33
- package/dist/components/Modal.js +40 -38
- package/dist/components/ModalSheetBottom.js +17 -18
- package/dist/components/Notification/stories/__mock__.js +1 -1
- package/dist/components/Notification.js +31 -24
- package/dist/components/Overlay.js +1 -2
- package/dist/components/Pagination.js +43 -41
- package/dist/components/Radio.js +34 -26
- package/dist/components/RangeSlider.js +8 -9
- package/dist/components/Response/img.js +1 -1
- package/dist/components/Response.js +45 -34
- package/dist/components/SVGContent.js +6 -7
- package/dist/components/ScrollOnDrag/stories/__mock__.js +2 -2
- package/dist/components/ScrollOnDrag.js +7 -8
- package/dist/components/ScrollToView.js +8 -9
- package/dist/components/Scrollbar/stories/__mock__.js +1 -1
- package/dist/components/Scrollbar.js +1 -1
- package/dist/components/Search.js +39 -31
- package/dist/components/Segmented/stories/__mock__.js +23 -10
- package/dist/components/Segmented.js +46 -41
- package/dist/components/Select.js +118 -113
- package/dist/components/Swiper/stories/__mock__.js +3 -3
- package/dist/components/Swiper.js +27 -29
- package/dist/components/Switch.js +33 -26
- package/dist/components/Tab/stories/__mock__.js +1 -1
- package/dist/components/Tab.js +33 -29
- package/dist/components/Text.js +1 -2
- package/dist/components/Textarea.js +26 -18
- package/dist/components/Tile.js +21 -17
- package/dist/components/Title.js +3 -4
- package/dist/components/Tooltip.js +3 -4
- package/dist/components/Video/stories/__mocks__.js +1 -1
- package/dist/components/Video.js +3 -4
- package/dist/components/Warning.js +26 -20
- package/dist/context/Notifications.js +38 -42
- package/dist/context/UIContext.js +19 -17
- package/dist/context/UrlAssetPrefix.js +3 -3
- package/dist/css/components/Tile/Tile.css +3 -3
- package/dist/hoc/urlWithAssetPrefix.js +13 -16
- package/dist/hooks/useActiveClasses/useActiveClasses.helpers.js +13 -40
- package/dist/hooks/useActiveClasses/useActiveClasses.interface.js +1 -1
- package/dist/hooks/useActiveClasses/useActiveClasses.js +25 -29
- package/dist/hooks/useAppearanceConfig/useAppearanceConfig.js +13 -15
- package/dist/hooks/useAppearanceConfig.js +0 -1
- package/dist/hooks/useDevicePropsGenerator/useDevicePropsGenerator.js +21 -28
- package/dist/hooks/useDevicePropsGenerator.js +0 -1
- package/dist/hooks/useDeviceTargetClass.js +0 -1
- package/dist/hooks/useStyles/styleAttributes.js +1 -1
- package/dist/hooks/useStyles/useStyles.js +0 -1
- package/dist/hooks/useStyles.js +0 -1
- package/dist/hooks/useViewportFix.js +5 -5
- package/dist/hooks.js +1 -1
- package/dist/types/components/Button/Button.appearance.d.ts +232 -232
- package/dist/types/components/Button/Button.d.ts +4 -4
- package/dist/types/components/Button/Button.interface.d.ts +5 -5
- package/dist/types/components/Pagination/Pagination.d.ts +1 -1
- package/dist/types/components/Select/SelectContainer.d.ts +1 -1
- package/dist/types/components/Text/Text.appearance.d.ts +58 -58
- package/dist/types/components/Text/Text.interface.d.ts +1 -1
- package/dist/utils/setViewportProperty.js +3 -3
- package/package.json +3 -3
- package/dist/Avatar_cjs_CLJnKU39.js +0 -157
- package/dist/Avatar_es_BgN-fbOj.js +0 -153
- package/dist/ChipsGroup_cjs_C8L3ZeD_.js +0 -331
- package/dist/DatePicker_cjs_BzEtDAb8.js +0 -183
- package/dist/DatePicker_es_DRyCMO0I.js +0 -179
- package/dist/Divider_cjs_DUYtmwn2.js +0 -97
- package/dist/Divider_es_CCLBFIx6.js +0 -93
- package/dist/DropdownItem_cjs_Bhss6lyM.js +0 -207
- package/dist/DropdownItem_es_BXl6lPJx.js +0 -202
- package/dist/Group_cjs_CsJ6ICKK.js +0 -59
- package/dist/Group_es_DRqIIM9m.js +0 -55
- package/dist/Image_cjs_DRhhc66R.js +0 -29
- package/dist/Image_es_BpMidmve.js +0 -27
- package/dist/Loader_cjs_D3lnxPlI.js +0 -132
- package/dist/Loader_es_BUSqFrCd.js +0 -128
- package/dist/Overlay_cjs_CcfJYN5o.js +0 -41
- package/dist/Overlay_es_DF3DAdxS.js +0 -37
- package/dist/Text_cjs_0EINiUq4.js +0 -68
- package/dist/Text_es_CwV9rjFD.js +0 -64
- package/dist/tslib.es6_cjs_CCZ3TN_7.js +0 -59
- package/dist/tslib.es6_es_Bwu1Cn-t.js +0 -56
|
@@ -6,10 +6,9 @@ import ReactPaginate from 'react-paginate';
|
|
|
6
6
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
7
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
8
8
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
9
|
-
import { D as Dropdown, a as DropdownItem } from '../
|
|
10
|
-
import { I as Icon } from '../
|
|
11
|
-
import { T as Text } from '../
|
|
12
|
-
import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
|
|
9
|
+
import { D as Dropdown, a as DropdownItem } from '../DropdownItem_es_DVHWWgnU.js';
|
|
10
|
+
import { I as Icon } from '../Icon_es_DkVkzTha.js';
|
|
11
|
+
import { T as Text } from '../Text_es_CnymlElo.js';
|
|
13
12
|
import { icons14, icons24, icons16 } from '@itcase/icons/default';
|
|
14
13
|
import 'lodash/camelCase';
|
|
15
14
|
import 'lodash/castArray';
|
|
@@ -24,13 +23,13 @@ import '../utils/setViewportProperty.js';
|
|
|
24
23
|
import '../hooks.js';
|
|
25
24
|
import '../hooks/useStyles/styleAttributes.js';
|
|
26
25
|
import 'lodash/maxBy';
|
|
27
|
-
import '../
|
|
26
|
+
import '../Divider_es_BiYozVBS.js';
|
|
28
27
|
import 'react-inlinesvg';
|
|
29
28
|
import '../hoc/urlWithAssetPrefix.js';
|
|
30
29
|
import '../context/UrlAssetPrefix.js';
|
|
31
|
-
import '../
|
|
30
|
+
import '../Link_es_P2b6ya7P.js';
|
|
32
31
|
|
|
33
|
-
|
|
32
|
+
const paginationAppearanceAccent = {
|
|
34
33
|
accent: {
|
|
35
34
|
fill: 'accentPrimary',
|
|
36
35
|
fillHover: 'accentPrimaryHover',
|
|
@@ -72,7 +71,7 @@ var paginationAppearanceAccent = {
|
|
|
72
71
|
},
|
|
73
72
|
};
|
|
74
73
|
|
|
75
|
-
|
|
74
|
+
const paginationAppearanceSize = {
|
|
76
75
|
sizeL: {
|
|
77
76
|
size: 'l',
|
|
78
77
|
labelTextSize: 'l',
|
|
@@ -149,7 +148,7 @@ var paginationAppearanceSize = {
|
|
|
149
148
|
},
|
|
150
149
|
};
|
|
151
150
|
|
|
152
|
-
|
|
151
|
+
const paginationAppearanceStyle = {
|
|
153
152
|
solid: {
|
|
154
153
|
borderColor: 'none',
|
|
155
154
|
},
|
|
@@ -163,7 +162,7 @@ var paginationAppearanceStyle = {
|
|
|
163
162
|
},
|
|
164
163
|
};
|
|
165
164
|
|
|
166
|
-
|
|
165
|
+
const paginationAppearanceSurface = {
|
|
167
166
|
surfacePrimary: {
|
|
168
167
|
fill: 'surfacePrimary',
|
|
169
168
|
fillHover: 'surfaceTertiary',
|
|
@@ -194,57 +193,62 @@ var paginationAppearanceSurface = {
|
|
|
194
193
|
},
|
|
195
194
|
};
|
|
196
195
|
|
|
197
|
-
|
|
196
|
+
const paginationAppearance = {
|
|
197
|
+
...paginationAppearanceSurface,
|
|
198
|
+
...paginationAppearanceAccent,
|
|
199
|
+
...paginationAppearanceSize,
|
|
200
|
+
...paginationAppearanceStyle,
|
|
201
|
+
};
|
|
198
202
|
|
|
199
|
-
|
|
203
|
+
const paginationConfig = {
|
|
200
204
|
appearance: paginationAppearance,
|
|
201
|
-
setAppearance:
|
|
205
|
+
setAppearance: (appearanceConfig) => {
|
|
202
206
|
paginationConfig.appearance = appearanceConfig;
|
|
203
207
|
},
|
|
204
208
|
};
|
|
205
209
|
function Pagination(props) {
|
|
206
|
-
|
|
210
|
+
const { className, appearance, allItemsCount = 0, dataTestId, dataTour, pageCountArray = [10, 20, 50, 100], pageCountDesc = 'кол-во строк', pageCountDropdownItemDividerDirection, pageNumber = 0, perPageCount = 0, isPageCount, isDisabled, isPageCountDropdownReversed = false, isPageLabelBuilder, isSkeleton, onChangePage, onChangePerPageCount,
|
|
207
211
|
/**
|
|
208
212
|
* @deprecated The method should not be used
|
|
209
213
|
*/
|
|
210
|
-
onPageChange
|
|
214
|
+
onPageChange,
|
|
211
215
|
/**
|
|
212
216
|
* @deprecated The method should not be used
|
|
213
217
|
*/
|
|
214
|
-
onPerPageCountChange = props
|
|
215
|
-
|
|
218
|
+
onPerPageCountChange, } = props;
|
|
219
|
+
const _onChangePage = useMemo(() => {
|
|
216
220
|
if (onPageChange) {
|
|
217
221
|
console.warn('@itcase/ui Pagination warning: "onPageChange" is deprecated, use "onChangePage" instead.');
|
|
218
222
|
return onPageChange;
|
|
219
223
|
}
|
|
220
224
|
return onChangePage;
|
|
221
225
|
}, [onChangePage, onPageChange]);
|
|
222
|
-
|
|
226
|
+
const _onChangePerPageCount = useMemo(() => {
|
|
223
227
|
if (onPerPageCountChange) {
|
|
224
228
|
console.warn('@itcase/ui Pagination warning: "onPerPageCountChange" is deprecated, use "onChangePerPageCount" instead.');
|
|
225
229
|
return onPerPageCountChange;
|
|
226
230
|
}
|
|
227
231
|
return onChangePerPageCount;
|
|
228
232
|
}, [onChangePerPageCount, onPerPageCountChange]);
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
233
|
+
const [isOpenDropdown, setIsOpenDropdown] = useState(false);
|
|
234
|
+
const [activeDropdownItem, setActiveDropdownItem] = useState(perPageCount);
|
|
235
|
+
const pageCountDropdownArray = useMemo(() => {
|
|
232
236
|
return isPageCountDropdownReversed
|
|
233
|
-
? pageCountArray
|
|
237
|
+
? pageCountArray?.reverse()
|
|
234
238
|
: pageCountArray;
|
|
235
239
|
}, [isPageCountDropdownReversed, pageCountArray]);
|
|
236
240
|
// Toggle command menu
|
|
237
|
-
|
|
238
|
-
setIsOpenDropdown(
|
|
241
|
+
const onClickCommandMenuButton = useCallback(() => {
|
|
242
|
+
setIsOpenDropdown((state) => !state);
|
|
239
243
|
}, []);
|
|
240
|
-
|
|
244
|
+
const handleDropdownItemClick = useCallback((event, item) => {
|
|
241
245
|
event.stopPropagation();
|
|
242
246
|
_onChangePerPageCount && _onChangePerPageCount(item);
|
|
243
247
|
setActiveDropdownItem(item);
|
|
244
248
|
setIsOpenDropdown(false);
|
|
245
249
|
}, [_onChangePerPageCount]);
|
|
246
250
|
// Calculate count of pages for all items
|
|
247
|
-
|
|
251
|
+
const paginationPagesCount = useMemo(() => {
|
|
248
252
|
if (allItemsCount && allItemsCount > 0) {
|
|
249
253
|
// Round up. "perPageCount" may be is a query params "limit"
|
|
250
254
|
return ceil(allItemsCount / perPageCount);
|
|
@@ -252,29 +256,27 @@ function Pagination(props) {
|
|
|
252
256
|
return 0;
|
|
253
257
|
}, [allItemsCount, perPageCount]);
|
|
254
258
|
// Index for pagination state
|
|
255
|
-
|
|
256
|
-
|
|
259
|
+
const paginationPageIndex = useMemo(() => {
|
|
260
|
+
const intPageNumber = parseInt(pageNumber);
|
|
257
261
|
// For pagination need index of page, not number
|
|
258
262
|
if (!isNaN(intPageNumber) && intPageNumber > 1) {
|
|
259
263
|
return intPageNumber - 1;
|
|
260
264
|
}
|
|
261
265
|
return 0;
|
|
262
266
|
}, [pageNumber]);
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
return (jsxs("div", { className: clsx('pagination', sizeClass &&
|
|
268
|
-
|
|
267
|
+
const appearanceConfig = useAppearanceConfig(appearance, paginationConfig, isDisabled);
|
|
268
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
269
|
+
const { justifyContentClass, fillActiveClass, fillActiveHoverClass, fillClass, fillHoverClass, fillInputClass, fillInputHoverClass, textColorClass, textSizeClass, builderIcon, builderIconFill, builderIconFillIcon, builderIconFillSize, builderIconSize, marginPagesDisplayed, nextIcon, nextIconFill, nextIconFillIcon, nextIconFillSize, nextIconSize, pageCountDescTextColor, pageCountDescTextSize, pageCountDropdownAlignment, pageCountDropdownElevation, pageCountDropdownFill, pageCountDropdownItemDividerFill, pageCountDropdownItemDividerSize, pageCountDropdownItemFill, pageCountDropdownItemFillActive, pageCountDropdownItemFillActiveHover, pageCountDropdownItemFillHover, pageCountDropdownItemLabelAlign, pageCountDropdownItemLabelColor, pageCountDropdownItemLabelColorActive, pageCountDropdownItemLabelColorActiveHover, pageCountDropdownItemLabelColorHover, pageCountDropdownItemLabelSize, pageCountDropdownItemLabelWrap, pageCountDropdownItemShowDivider, pageCountDropdownItemSize, pageCountDropdownItemWidth, pageCountDropdownShape, pageCountInputIcon, pageCountInputIconColor, pageCountInputIconFillSize, pageCountInputIconSrc, pageCountInputTextColor, pageCountInputTextSize, pageRangeDisplayed, previousIcon, previousIconFill, previousIconFillIcon, previousIconFillSize, previousIconSize, sizeClass, } = propsGenerator;
|
|
270
|
+
const { styles: paginationStyles } = useStyles(props);
|
|
271
|
+
return (allItemsCount > perPageCount && (jsxs("div", { className: clsx('pagination', sizeClass && `pagination_size_${sizeClass}`, isSkeleton && `pagination_skeleton`), "data-test-id": dataTestId, "data-tour": dataTour, style: paginationStyles, children: [jsx(ReactPaginate, { activeClassName: clsx('pagination__item_state_active cursor_type_default', fillActiveClass && `fill_active_${fillActiveClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`), activeLinkClassName: "pagination__item-link_state_active", breakClassName: "pagination__item pagination__item_break", breakLabel: "...", breakLinkClassName: "pagination__item-link", containerClassName: clsx(className, 'pagination__container', justifyContentClass &&
|
|
272
|
+
`pagination_justify-content_${justifyContentClass}`), disabledClassName: "pagination__item_state_disabled cursor_type_default", disabledLinkClassName: "pagination__item_state_disabled",
|
|
269
273
|
// pages settings
|
|
270
|
-
forcePage: paginationPageIndex, marginPagesDisplayed: marginPagesDisplayed, nextClassName: clsx('pagination__item pagination__item_next', sizeClass &&
|
|
274
|
+
forcePage: paginationPageIndex, marginPagesDisplayed: marginPagesDisplayed, nextClassName: clsx('pagination__item pagination__item_next', sizeClass && `pagination__item_size_${sizeClass}`, fillClass && `fill_${fillClass}`),
|
|
271
275
|
// next button
|
|
272
|
-
nextLabel: jsx(Icon, { fill: nextIconFill, fillSize: nextIconFillSize, iconFill: nextIconFillIcon, iconSize: nextIconSize, shape: "circular", SvgImage: nextIcon }), nextLinkClassName: "pagination__item-link", pageClassName: clsx('pagination__item', sizeClass &&
|
|
273
|
-
(
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
pageCountDropdownItemShowDivider, isActive: false, onClick: function (event) { return handleDropdownItemClick(event, item); } }, item));
|
|
277
|
-
}) })] })] }))] }));
|
|
276
|
+
nextLabel: jsx(Icon, { fill: nextIconFill, fillSize: nextIconFillSize, iconFill: nextIconFillIcon, iconSize: nextIconSize, shape: "circular", SvgImage: nextIcon }), nextLinkClassName: "pagination__item-link", pageClassName: clsx('pagination__item', sizeClass && `pagination__item_size_${sizeClass}`, fillClass && `fill_${fillClass}`), pageCount: paginationPagesCount, pageLabelBuilder: isPageLabelBuilder &&
|
|
277
|
+
(() => (jsx(Icon, { fill: builderIconFill, fillSize: builderIconFillSize, iconFill: builderIconFillIcon, iconSize: builderIconSize, shape: "circular", SvgImage: builderIcon }))), pageLinkClassName: clsx('pagination__item-link', textSizeClass && `pagination__item-link_size_${textSizeClass}`, textColorClass && 'text', textColorClass && `text-color_${textColorClass}`), pageRangeDisplayed: pageRangeDisplayed, previousClassName: clsx('pagination__item pagination__item_previous', sizeClass && `pagination__item_size_${sizeClass}`, fillClass && `fill_${fillClass}`), previousLabel: jsx(Icon, { fill: previousIconFill, fillSize: previousIconFillSize, iconFill: previousIconFillIcon, iconSize: previousIconSize, shape: "circular", SvgImage: previousIcon }), previousLinkClassName: "pagination__item-link", onPageChange: _onChangePage }), isPageCount && (jsxs("div", { className: clsx(className, 'pagination__count'), children: [jsx(Text, { className: "pagination__count-text", size: pageCountDescTextSize, textColor: pageCountDescTextColor, children: pageCountDesc }), jsxs("div", { className: clsx('pagination__input', 'cursor_type_pointer', fillClass && `fill_${fillInputClass}`, fillHoverClass && `fill_hover_${fillInputHoverClass}`), onClick: onClickCommandMenuButton, children: [jsx(Text, { size: pageCountInputTextSize, textColor: pageCountInputTextColor, children: activeDropdownItem }), jsx(Icon, { fillSize: pageCountInputIconFillSize, iconFill: pageCountInputIconColor, imageSrc: pageCountInputIconSrc, SvgImage: pageCountInputIcon }), jsx(Dropdown, { className: "pagination__dropdown", alignment: pageCountDropdownAlignment, fill: pageCountDropdownFill, elevation: pageCountDropdownElevation, setIsOpen: setIsOpenDropdown, shape: pageCountDropdownShape, isOpen: isOpenDropdown, children: pageCountDropdownArray.map((item, index) => activeDropdownItem === item ? (jsx(DropdownItem, { width: pageCountDropdownItemWidth, size: pageCountDropdownItemSize, fill: pageCountDropdownItemFill, fillActive: pageCountDropdownItemFillActive, fillActiveHover: pageCountDropdownItemFillActiveHover, fillHover: pageCountDropdownItemFillHover, label: item.toString(), labelTextAlign: pageCountDropdownItemLabelAlign, labelTextColor: pageCountDropdownItemLabelColor, labelTextColorActive: pageCountDropdownItemLabelColorActive, labelTextColorActiveHover: pageCountDropdownItemLabelColorActiveHover, labelTextColorHover: pageCountDropdownItemLabelColorHover, labelTextSize: pageCountDropdownItemLabelSize, labelTextWrap: pageCountDropdownItemLabelWrap, dividerDirection: pageCountDropdownItemDividerDirection, dividerFill: pageCountDropdownItemDividerFill, dividerSize: pageCountDropdownItemDividerSize, showDivider: index < pageCountArray.length - 1 &&
|
|
278
|
+
pageCountDropdownItemShowDivider, isActive: true, onClick: (event) => handleDropdownItemClick(event, item) }, item)) : (jsx(DropdownItem, { width: pageCountDropdownItemWidth, size: pageCountDropdownItemSize, fill: pageCountDropdownItemFill, fillHover: pageCountDropdownItemFillHover, label: item.toString(), labelTextAlign: pageCountDropdownItemLabelAlign, labelTextColor: pageCountDropdownItemLabelColor, labelTextColorHover: pageCountDropdownItemLabelColorHover, labelTextSize: pageCountDropdownItemLabelSize, labelTextWrap: pageCountDropdownItemLabelWrap, dividerDirection: pageCountDropdownItemDividerDirection, dividerFill: pageCountDropdownItemDividerFill, dividerSize: pageCountDropdownItemDividerSize, showDivider: index < pageCountArray.length - 1 &&
|
|
279
|
+
pageCountDropdownItemShowDivider, isActive: false, onClick: (event) => handleDropdownItemClick(event, item) }, item))) })] })] }))] })));
|
|
278
280
|
}
|
|
279
281
|
|
|
280
282
|
export { Pagination, paginationAppearance, paginationConfig };
|
package/dist/components/Radio.js
CHANGED
|
@@ -2,8 +2,7 @@ import { jsxs, jsx } from 'react/jsx-runtime';
|
|
|
2
2
|
import clsx from 'clsx';
|
|
3
3
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
|
-
import { T as Text } from '../
|
|
6
|
-
import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
|
|
5
|
+
import { T as Text } from '../Text_es_CnymlElo.js';
|
|
7
6
|
import 'react';
|
|
8
7
|
import 'lodash/camelCase';
|
|
9
8
|
import 'lodash/castArray';
|
|
@@ -20,7 +19,7 @@ import '../hooks/useStyles/styleAttributes.js';
|
|
|
20
19
|
import '../hooks/useStyles/useStyles.js';
|
|
21
20
|
import 'lodash/maxBy';
|
|
22
21
|
|
|
23
|
-
|
|
22
|
+
const radioAppearanceDefault = {
|
|
24
23
|
defaultPrimary: {
|
|
25
24
|
fill: 'surfaceSecondary',
|
|
26
25
|
fillCheckmark: 'surfaceQuaternary',
|
|
@@ -38,7 +37,7 @@ var radioAppearanceDefault = {
|
|
|
38
37
|
},
|
|
39
38
|
};
|
|
40
39
|
|
|
41
|
-
|
|
40
|
+
const radioAppearanceDisabled = {
|
|
42
41
|
disabledPrimary: {
|
|
43
42
|
fill: 'surfaceDisabled',
|
|
44
43
|
fillCheckmark: 'surfaceQuaternary',
|
|
@@ -52,7 +51,7 @@ var radioAppearanceDisabled = {
|
|
|
52
51
|
},
|
|
53
52
|
};
|
|
54
53
|
|
|
55
|
-
|
|
54
|
+
const radioAppearanceError = {
|
|
56
55
|
errorPrimary: {
|
|
57
56
|
fill: 'errorTertiary',
|
|
58
57
|
fillCheckmark: 'errorPrimary',
|
|
@@ -66,7 +65,7 @@ var radioAppearanceError = {
|
|
|
66
65
|
},
|
|
67
66
|
};
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
const radioAppearanceRequire = {
|
|
70
69
|
requirePrimary: {
|
|
71
70
|
fill: 'warningTertiary',
|
|
72
71
|
fillCheckmark: 'warningPrimary',
|
|
@@ -80,7 +79,7 @@ var radioAppearanceRequire = {
|
|
|
80
79
|
},
|
|
81
80
|
};
|
|
82
81
|
|
|
83
|
-
|
|
82
|
+
const radioAppearanceShape = {
|
|
84
83
|
circular: {
|
|
85
84
|
shape: 'circular',
|
|
86
85
|
},
|
|
@@ -105,7 +104,7 @@ var radioAppearanceShape = {
|
|
|
105
104
|
},
|
|
106
105
|
};
|
|
107
106
|
|
|
108
|
-
|
|
107
|
+
const radioAppearanceSize = {
|
|
109
108
|
sizeM: {
|
|
110
109
|
size: 'm',
|
|
111
110
|
labelTextSize: 's',
|
|
@@ -123,7 +122,7 @@ var radioAppearanceSize = {
|
|
|
123
122
|
},
|
|
124
123
|
};
|
|
125
124
|
|
|
126
|
-
|
|
125
|
+
const radioAppearanceStyle = {
|
|
127
126
|
solid: {
|
|
128
127
|
fill: 'none',
|
|
129
128
|
fillHover: 'none',
|
|
@@ -147,7 +146,7 @@ var radioAppearanceStyle = {
|
|
|
147
146
|
},
|
|
148
147
|
};
|
|
149
148
|
|
|
150
|
-
|
|
149
|
+
const radioAppearanceSuccess = {
|
|
151
150
|
successPrimary: {
|
|
152
151
|
fill: 'successTertiary',
|
|
153
152
|
fillCheckmark: 'accentItemSecondary',
|
|
@@ -161,33 +160,42 @@ var radioAppearanceSuccess = {
|
|
|
161
160
|
},
|
|
162
161
|
};
|
|
163
162
|
|
|
164
|
-
|
|
163
|
+
const radioAppearance = {
|
|
164
|
+
...radioAppearanceDefault,
|
|
165
|
+
...radioAppearanceError,
|
|
166
|
+
...radioAppearanceSuccess,
|
|
167
|
+
...radioAppearanceRequire,
|
|
168
|
+
...radioAppearanceDisabled,
|
|
169
|
+
...radioAppearanceSize,
|
|
170
|
+
...radioAppearanceShape,
|
|
171
|
+
...radioAppearanceStyle,
|
|
172
|
+
};
|
|
165
173
|
|
|
166
|
-
|
|
174
|
+
const radioConfig = {
|
|
167
175
|
appearance: radioAppearance,
|
|
168
|
-
setAppearance:
|
|
176
|
+
setAppearance: (appearanceConfig) => {
|
|
169
177
|
radioConfig.appearance = appearanceConfig;
|
|
170
178
|
},
|
|
171
179
|
};
|
|
172
180
|
function Radio(props) {
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return (jsxs(Tag, { className: clsx(className, 'radio', fillClass &&
|
|
178
|
-
? fillRadioClass &&
|
|
179
|
-
: fillRadioActiveClass &&
|
|
180
|
-
? fillRadioHoverClass &&
|
|
181
|
+
const { id, className, appearance, label, desc, isDisabled, checked, tag: Tag = 'label', value, isActive, isSkeleton, onChange, } = props;
|
|
182
|
+
const appearanceConfig = useAppearanceConfig(appearance, radioConfig, isDisabled);
|
|
183
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
184
|
+
const { fillCheckmarkClass, fillClass, fillHoverClass, fillRadioActiveClass, fillRadioActiveHoverClass, fillRadioClass, fillRadioHoverClass, labelTextColor, labelTextSize, labelTextWeight, descTextColor, descTextSize, descTextWeight, borderRadioColorClass, borderRadioColorActiveClass, borderRadioColorActiveHoverClass, borderRadioColorHoverClass, shapeClass, shapeStrengthClass, sizeClass, } = propsGenerator;
|
|
185
|
+
return (jsxs(Tag, { className: clsx(className, 'radio', fillClass && `fill_${fillClass}`, fillHoverClass && `fill_${fillHoverClass}`, isSkeleton && 'radio_skeleton', sizeClass && `radio_size_${sizeClass}`, !checked || !isActive
|
|
186
|
+
? fillRadioClass && `radio_fill_${fillRadioClass}`
|
|
187
|
+
: fillRadioActiveClass && `radio_fill_active_${fillRadioActiveClass}`, !checked || !isActive
|
|
188
|
+
? fillRadioHoverClass && `radio_fill_hover_${fillRadioHoverClass}`
|
|
181
189
|
: fillRadioActiveHoverClass &&
|
|
182
|
-
|
|
190
|
+
`radio_fill_active_hover_${fillRadioActiveHoverClass}`, !checked || !isActive
|
|
183
191
|
? borderRadioColorClass &&
|
|
184
|
-
|
|
192
|
+
`radio_border-color_${borderRadioColorClass}`
|
|
185
193
|
: borderRadioColorActiveClass &&
|
|
186
|
-
|
|
194
|
+
`radio_border-color_active_${borderRadioColorActiveClass}`, !checked || !isActive
|
|
187
195
|
? borderRadioColorHoverClass &&
|
|
188
|
-
|
|
196
|
+
`radio_border-color_hover_${borderRadioColorHoverClass}`
|
|
189
197
|
: borderRadioColorActiveHoverClass &&
|
|
190
|
-
|
|
198
|
+
`radio_border-color_active_hover_${borderRadioColorActiveHoverClass}`), htmlFor: id, children: [jsxs("div", { className: clsx('radio__item'), children: [jsx("input", { id: String(id), className: "radio__input", type: "radio", disabled: isDisabled && 'disabled', checked: checked, value: value, onChange: onChange }), jsx("div", { className: clsx('radio__state', shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`), children: "\u00A0" }), jsx("div", { className: clsx('radio__state-checkmark', checked && fillCheckmarkClass && `fill_${fillCheckmarkClass}`), children: "\u00A0" })] }), label && (jsx(Text, { className: "radio__label", size: labelTextSize, textColor: labelTextColor, textWeight: labelTextWeight, children: label })), desc && (jsx(Text, { className: "radio__desc", size: descTextSize, textColor: descTextColor, textWeight: descTextWeight, children: desc }))] }));
|
|
191
199
|
}
|
|
192
200
|
|
|
193
201
|
export { Radio, radioAppearance, radioConfig };
|
|
@@ -3,7 +3,6 @@ import clsx from 'clsx';
|
|
|
3
3
|
import Slider from 'rc-slider';
|
|
4
4
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
5
5
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
6
|
-
import '../tslib.es6_es_Bwu1Cn-t.js';
|
|
7
6
|
import 'react';
|
|
8
7
|
import 'lodash/camelCase';
|
|
9
8
|
import 'lodash/castArray';
|
|
@@ -20,15 +19,15 @@ import '../hooks/useStyles/styleAttributes.js';
|
|
|
20
19
|
import 'lodash/maxBy';
|
|
21
20
|
|
|
22
21
|
function RangeSlider(props) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
const { className, min, max, disabled, pushable, range, value, vertical, before, after, set, onChangeSlider, children, } = props;
|
|
23
|
+
const propsGenerator = useDevicePropsGenerator(props);
|
|
24
|
+
const { fillClass, fillHandleClass, fillHandleDraggingClass, fillHandleDraggingHoverClass, fillHandleHoverClass, fillRailClass, fillTrackClass, shapeClass, widthClass, } = propsGenerator;
|
|
26
25
|
// @ts-expect-error
|
|
27
|
-
|
|
28
|
-
return (jsxs("div", { className: clsx(className, 'range-slider', set &&
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
26
|
+
const { styles: rangeSliderStyles } = useStyles(props);
|
|
27
|
+
return (jsxs("div", { className: clsx(className, 'range-slider', set && `range-slider_set_${set}`, fillClass && `fill_${fillClass}`, fillTrackClass && `range-slider-track-fill_${fillTrackClass}`, fillRailClass && `range-slider-rail-fill_${fillRailClass}`, fillHandleClass && `range-slider-handle-fill_${fillHandleClass}`, fillHandleHoverClass &&
|
|
28
|
+
`range-slider-handle-fill-hover_${fillHandleHoverClass}`, fillHandleDraggingClass &&
|
|
29
|
+
`range-slider-handle-dragging-fill_${fillHandleDraggingClass}`, fillHandleDraggingHoverClass &&
|
|
30
|
+
`range-slider-handle-dragging-fill-hover_${fillHandleDraggingHoverClass}`, shapeClass && `range-slider_shape_${shapeClass}`, widthClass && `width_${widthClass}`), style: rangeSliderStyles, children: [before && jsx("div", { className: "range-slider__before", children: before }), jsx(Slider, { className: "range-slider__wrapper", min: min, max: max, disabled: disabled, pushable: pushable, range: range, value: value, vertical: vertical, onChange: onChangeSlider }), children, after && jsx("div", { className: "range-slider__after", children: after })] }));
|
|
32
31
|
}
|
|
33
32
|
|
|
34
33
|
export { RangeSlider };
|
|
@@ -20,7 +20,7 @@ var img$1 = "data:image/svg+xml,%3csvg width='180' height='180' viewBox='0 0 180
|
|
|
20
20
|
|
|
21
21
|
var img = "data:image/svg+xml,%3csvg width='180' height='180' viewBox='0 0 180 180' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3crect width='180' height='180' rx='90' fill='%23DE8806'/%3e%3cpath d='M90.5029 123.721C93.8166 123.721 96.5029 126.407 96.5029 129.721V134.749C96.5027 138.063 93.8165 140.749 90.5029 140.749C87.1894 140.749 84.5031 138.063 84.5029 134.749V129.721C84.5029 126.407 87.1892 123.721 90.5029 123.721ZM90.5029 39.251C93.8166 39.251 96.5029 41.9383 96.5029 45.252V104.582C96.5024 107.895 93.8163 110.582 90.5029 110.582C87.1895 110.582 84.5034 107.895 84.5029 104.582V45.252C84.5029 41.9382 87.1892 39.251 90.5029 39.251Z' fill='white'/%3e%3c/svg%3e";
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
const responseIcon = {
|
|
24
24
|
Error: img$7,
|
|
25
25
|
Warning: img,
|
|
26
26
|
Success: img$2,
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { responseIcon } from './Response/img.js';
|
|
2
|
-
import { _ as __assign } from '../tslib.es6_es_Bwu1Cn-t.js';
|
|
3
2
|
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
4
3
|
import { useMemo } from 'react';
|
|
5
4
|
import clsx from 'clsx';
|
|
@@ -7,9 +6,9 @@ import { urlWithAssetPrefix } from '../hoc/urlWithAssetPrefix.js';
|
|
|
7
6
|
import { useAppearanceConfig } from '../hooks/useAppearanceConfig/useAppearanceConfig.js';
|
|
8
7
|
import { useDevicePropsGenerator } from '../hooks/useDevicePropsGenerator/useDevicePropsGenerator.js';
|
|
9
8
|
import { useStyles } from '../hooks/useStyles/useStyles.js';
|
|
10
|
-
import { B as Button } from '../
|
|
11
|
-
import { G as Group } from '../
|
|
12
|
-
import { T as Text } from '../
|
|
9
|
+
import { B as Button } from '../Button_es_DnlzLBUT.js';
|
|
10
|
+
import { G as Group } from '../Group_es_BU5k8f5S.js';
|
|
11
|
+
import { T as Text } from '../Text_es_CnymlElo.js';
|
|
13
12
|
import '@itcase/common';
|
|
14
13
|
import '../context/UrlAssetPrefix.js';
|
|
15
14
|
import 'lodash/camelCase';
|
|
@@ -24,12 +23,12 @@ import '../utils/setViewportProperty.js';
|
|
|
24
23
|
import '../hooks.js';
|
|
25
24
|
import '../hooks/useStyles/styleAttributes.js';
|
|
26
25
|
import 'lodash/maxBy';
|
|
27
|
-
import '../
|
|
26
|
+
import '../Icon_es_DkVkzTha.js';
|
|
28
27
|
import 'react-inlinesvg';
|
|
29
|
-
import '../
|
|
30
|
-
import '../
|
|
28
|
+
import '../Link_es_P2b6ya7P.js';
|
|
29
|
+
import '../Loader_es_CmSggwbR.js';
|
|
31
30
|
|
|
32
|
-
|
|
31
|
+
const responseAppearanceConfirm = {
|
|
33
32
|
confirm: {
|
|
34
33
|
fill: 'surfacePrimary',
|
|
35
34
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -44,7 +43,7 @@ var responseAppearanceConfirm = {
|
|
|
44
43
|
},
|
|
45
44
|
};
|
|
46
45
|
|
|
47
|
-
|
|
46
|
+
const responseAppearanceDanger = {
|
|
48
47
|
danger: {
|
|
49
48
|
fill: 'surfacePrimary',
|
|
50
49
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -59,7 +58,7 @@ var responseAppearanceDanger = {
|
|
|
59
58
|
},
|
|
60
59
|
};
|
|
61
60
|
|
|
62
|
-
|
|
61
|
+
const responseAppearanceEmpty = {
|
|
63
62
|
empty: {
|
|
64
63
|
fill: 'surfacePrimary',
|
|
65
64
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -74,7 +73,7 @@ var responseAppearanceEmpty = {
|
|
|
74
73
|
},
|
|
75
74
|
};
|
|
76
75
|
|
|
77
|
-
|
|
76
|
+
const responseAppearanceError = {
|
|
78
77
|
error: {
|
|
79
78
|
fill: 'surfacePrimary',
|
|
80
79
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -89,7 +88,7 @@ var responseAppearanceError = {
|
|
|
89
88
|
},
|
|
90
89
|
};
|
|
91
90
|
|
|
92
|
-
|
|
91
|
+
const responseAppearanceFail = {
|
|
93
92
|
fail: {
|
|
94
93
|
fill: 'surfacePrimary',
|
|
95
94
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -104,7 +103,7 @@ var responseAppearanceFail = {
|
|
|
104
103
|
},
|
|
105
104
|
};
|
|
106
105
|
|
|
107
|
-
|
|
106
|
+
const responseAppearanceNothingFound = {
|
|
108
107
|
nothingFound: {
|
|
109
108
|
fill: 'surfacePrimary',
|
|
110
109
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -119,7 +118,7 @@ var responseAppearanceNothingFound = {
|
|
|
119
118
|
},
|
|
120
119
|
};
|
|
121
120
|
|
|
122
|
-
|
|
121
|
+
const responseAppearanceRefresh = {
|
|
123
122
|
refresh: {
|
|
124
123
|
fill: 'surfacePrimary',
|
|
125
124
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -134,7 +133,7 @@ var responseAppearanceRefresh = {
|
|
|
134
133
|
},
|
|
135
134
|
};
|
|
136
135
|
|
|
137
|
-
|
|
136
|
+
const responseAppearanceStyle = {
|
|
138
137
|
solid: {
|
|
139
138
|
borderColor: 'none',
|
|
140
139
|
},
|
|
@@ -148,7 +147,7 @@ var responseAppearanceStyle = {
|
|
|
148
147
|
},
|
|
149
148
|
};
|
|
150
149
|
|
|
151
|
-
|
|
150
|
+
const responseAppearanceSuccess = {
|
|
152
151
|
success: {
|
|
153
152
|
fill: 'surfacePrimary',
|
|
154
153
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -163,7 +162,7 @@ var responseAppearanceSuccess = {
|
|
|
163
162
|
},
|
|
164
163
|
};
|
|
165
164
|
|
|
166
|
-
|
|
165
|
+
const responseAppearanceUnableLoadData = {
|
|
167
166
|
unableLoadData: {
|
|
168
167
|
fill: 'surfacePrimary',
|
|
169
168
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -178,7 +177,7 @@ var responseAppearanceUnableLoadData = {
|
|
|
178
177
|
},
|
|
179
178
|
};
|
|
180
179
|
|
|
181
|
-
|
|
180
|
+
const responseAppearanceWarning = {
|
|
182
181
|
warning: {
|
|
183
182
|
fill: 'surfacePrimary',
|
|
184
183
|
titleTextColor: 'surfaceTextPrimary',
|
|
@@ -193,32 +192,44 @@ var responseAppearanceWarning = {
|
|
|
193
192
|
},
|
|
194
193
|
};
|
|
195
194
|
|
|
196
|
-
|
|
195
|
+
const responseAppearance = {
|
|
196
|
+
...responseAppearanceConfirm,
|
|
197
|
+
...responseAppearanceEmpty,
|
|
198
|
+
...responseAppearanceDanger,
|
|
199
|
+
...responseAppearanceRefresh,
|
|
200
|
+
...responseAppearanceUnableLoadData,
|
|
201
|
+
...responseAppearanceNothingFound,
|
|
202
|
+
...responseAppearanceFail,
|
|
203
|
+
...responseAppearanceError,
|
|
204
|
+
...responseAppearanceSuccess,
|
|
205
|
+
...responseAppearanceWarning,
|
|
206
|
+
...responseAppearanceStyle,
|
|
207
|
+
};
|
|
197
208
|
|
|
198
|
-
|
|
209
|
+
const responseConfig = {
|
|
199
210
|
appearance: responseAppearance,
|
|
200
|
-
setAppearance:
|
|
211
|
+
setAppearance: (appearanceConfig) => {
|
|
201
212
|
responseConfig.appearance = appearanceConfig;
|
|
202
213
|
},
|
|
203
214
|
};
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
215
|
+
const Response = urlWithAssetPrefix(function Response(props) {
|
|
216
|
+
const { appearance, className, width, height, title, desc, secondaryButton, primaryButton, before, after, isSkeleton, onClickSecondaryButton, } = props;
|
|
217
|
+
const appearanceConfig = useAppearanceConfig(appearance, responseConfig);
|
|
218
|
+
const propsGenerator = useDevicePropsGenerator(props, appearanceConfig);
|
|
219
|
+
const { dataTestId, dataTour, fillClass, fillHoverClass, titleTextColor, titleTextSize, titleTextWeight, descTextColor, descTextSize, descTextWeight, borderColorClass, borderColorHoverClass, borderTypeClass, borderWidthClass, onClickPrimaryButton, secondaryButtonAfter, secondaryButtonAppearance, secondaryButtonBefore, secondaryButtonFill, secondaryButtonFillHover, secondaryButtonLabel, secondaryButtonLabelTextColor, secondaryButtonLabelTextSize, secondaryButtonShape, secondaryButtonSize, secondaryButtonWidth, imageSrc, primaryButtonAfter, primaryButtonAppearance, primaryButtonBefore, primaryButtonFill, primaryButtonFillHover, primaryButtonLabel, primaryButtonLabelTextColor, primaryButtonLabelTextSize, primaryButtonShape, primaryButtonSize, primaryButtonWidth, shapeClass, shapeStrengthClass, svgFillClass, SvgImage, svgPathFillClass, svgSrc, widthClass, } = propsGenerator;
|
|
209
220
|
// TODO: use Icon instead?
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
221
|
+
const ImageComponent = useMemo(() => {
|
|
222
|
+
const src = imageSrc || svgSrc;
|
|
223
|
+
const Image = SvgImage;
|
|
213
224
|
if (Image) {
|
|
214
|
-
|
|
225
|
+
const sizes = {};
|
|
215
226
|
if (width) {
|
|
216
227
|
sizes.width = width;
|
|
217
228
|
}
|
|
218
229
|
if (height) {
|
|
219
230
|
sizes.height = height;
|
|
220
231
|
}
|
|
221
|
-
return jsx(Image,
|
|
232
|
+
return jsx(Image, { ...sizes });
|
|
222
233
|
}
|
|
223
234
|
if (src) {
|
|
224
235
|
// if (src.endsWith('.svg') || src.startsWith('data:image/svg')) {
|
|
@@ -233,15 +244,15 @@ var Response = urlWithAssetPrefix(function Response(props) {
|
|
|
233
244
|
return null;
|
|
234
245
|
}, [imageSrc, svgSrc, SvgImage, width, height, svgFillClass]);
|
|
235
246
|
// @ts-expect-error
|
|
236
|
-
|
|
237
|
-
return (jsxs("div", { className: clsx(className, 'response', fillClass &&
|
|
247
|
+
const { styles: responseStyles, wrapper: wrapperStyles } = useStyles(props);
|
|
248
|
+
return (jsxs("div", { className: clsx(className, 'response', fillClass && `fill_${fillClass}`, fillHoverClass && `fill_hover_${fillHoverClass}`, shapeClass && `shape_${shapeClass}`, shapeStrengthClass && `shape-strength_${shapeStrengthClass}`, widthClass && `width_${widthClass}`, borderColorClass && `border-color_${borderColorClass}`, borderColorHoverClass && `border-color_hover_${borderColorHoverClass}`, borderWidthClass && `border-width_${borderWidthClass}`, borderTypeClass && `border_type_${borderTypeClass}`, isSkeleton && `response_skeleton`), "data-test-id": dataTestId, "data-tour": dataTour, style: responseStyles, children: [before, jsxs("div", { className: "response__wrapper", style: wrapperStyles, children: [ImageComponent && (jsx("div", { className: clsx('response__image', svgFillClass && `svg_fill_${svgFillClass}`, svgPathFillClass && `svg_path_fill_${svgPathFillClass}`), children: ImageComponent })), jsxs("div", { className: "response__wrapper-inner", children: [title && (jsx(Text, { className: "response__title", size: titleTextSize, textColor: titleTextColor, textWeight: titleTextWeight, children: title })), desc && (jsx(Text, { className: "response__desc", size: descTextSize, textColor: descTextColor, textWeight: descTextWeight, children: desc }))] })] }), (primaryButtonLabel ||
|
|
238
249
|
primaryButton ||
|
|
239
250
|
secondaryButtonLabel ||
|
|
240
251
|
secondaryButton ||
|
|
241
252
|
appearanceConfig) && (jsxs(Group, { className: "response__button", width: "fill", children: [primaryButtonLabel ? (jsx(Button, { className: "response__button-item", appearance: primaryButtonAppearance, width: primaryButtonWidth || 'fill', size: primaryButtonSize, fill: primaryButtonFill, fillHover: primaryButtonFillHover, label: primaryButtonLabel, labelTextColor: primaryButtonLabelTextColor, labelTextSize: primaryButtonLabelTextSize, shape: primaryButtonShape, before: primaryButtonBefore, after: primaryButtonAfter, onClick: onClickPrimaryButton })) : (primaryButton), secondaryButtonLabel ? (jsx(Button, { className: "response__button-item", appearance: secondaryButtonAppearance, width: secondaryButtonWidth || 'fill', size: secondaryButtonSize, fill: secondaryButtonFill, fillHover: secondaryButtonFillHover, label: secondaryButtonLabel, labelTextColor: secondaryButtonLabelTextColor, labelTextSize: secondaryButtonLabelTextSize, shape: secondaryButtonShape, before: secondaryButtonBefore, after: secondaryButtonAfter, onClick: onClickSecondaryButton })) : (secondaryButton)] })), after] }));
|
|
242
253
|
});
|
|
243
254
|
|
|
244
|
-
|
|
255
|
+
const RESPONSE_MESSAGES = {
|
|
245
256
|
empty: {
|
|
246
257
|
appearance: 'refresh ghost',
|
|
247
258
|
title: ' Список пуст',
|