@megafon/ui-core 2.4.0 → 3.0.0-beta.10
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/CHANGELOG.md +154 -7
- package/dist/es/colors/ColorItem/ColorItem.css +1 -8
- package/dist/es/colors/ColorItem/ColorItem.js +1 -1
- package/dist/es/colors/Colors.css +3 -11
- package/dist/es/colors/Colors.d.ts +2 -2
- package/dist/es/colors/Colors.js +64 -4
- package/dist/es/colors/colorsData.js +78 -71
- package/dist/es/components/Accordion/Accordion.css +7 -27
- package/dist/es/components/Accordion/Accordion.d.ts +12 -7
- package/dist/es/components/Accordion/Accordion.js +25 -20
- package/dist/es/components/Banner/Banner.css +2 -37
- package/dist/es/components/Banner/Banner.d.ts +10 -2
- package/dist/es/components/Banner/Banner.js +35 -26
- package/dist/es/components/Banner/BannerDot.css +4 -11
- package/dist/es/components/Banner/BannerDot.d.ts +3 -0
- package/dist/es/components/Banner/BannerDot.js +8 -3
- package/dist/es/components/Button/Button.css +83 -74
- package/dist/es/components/Button/Button.d.ts +8 -2
- package/dist/es/components/Button/Button.js +16 -8
- package/dist/es/components/Calendar/Calendar.css +0 -7
- package/dist/es/components/Calendar/Calendar.js +2 -3
- package/dist/es/components/Calendar/components/Day/Day.css +10 -17
- package/dist/es/components/Calendar/components/Day/Day.js +1 -1
- package/dist/es/components/Calendar/components/Month/Month.css +3 -10
- package/dist/es/components/Calendar/components/Month/Month.js +21 -5
- package/dist/es/components/Carousel/Carousel.css +4 -11
- package/dist/es/components/Carousel/Carousel.d.ts +9 -2
- package/dist/es/components/Carousel/Carousel.js +28 -25
- package/dist/es/components/Checkbox/Checkbox.css +18 -25
- package/dist/es/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/es/components/Checkbox/Checkbox.js +77 -90
- package/dist/es/components/Collapse/Collapse.d.ts +15 -3
- package/dist/es/components/Collapse/Collapse.js +11 -4
- package/dist/es/components/ContentArea/ContentArea.css +18 -28
- package/dist/es/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/es/components/ContentArea/ContentArea.js +5 -39
- package/dist/es/components/Counter/Counter.css +14 -11
- package/dist/es/components/Counter/Counter.js +3 -3
- package/dist/es/components/Grid/GridColumn.css +0 -7
- package/dist/es/components/Header/Header.css +8 -12
- package/dist/es/components/Header/Header.d.ts +7 -21
- package/dist/es/components/Header/Header.js +31 -67
- package/dist/es/components/InputLabel/InputLabel.css +0 -7
- package/dist/es/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/es/components/InputLabel/InputLabel.js +9 -4
- package/dist/es/components/Link/Link.d.ts +3 -3
- package/dist/es/components/Link/Link.js +32 -21
- package/dist/es/components/List/List.css +9 -13
- package/dist/es/components/List/List.d.ts +1 -1
- package/dist/es/components/List/List.js +2 -2
- package/dist/es/components/List/ListItem.css +0 -7
- package/dist/es/components/Logo/Logo.css +0 -7
- package/dist/es/components/Logo/Logo.js +4 -8
- package/dist/es/components/NavArrow/NavArrow.css +5 -12
- package/dist/es/components/Notification/Notification.css +41 -24
- package/dist/es/components/Notification/Notification.d.ts +8 -0
- package/dist/es/components/Notification/Notification.js +21 -4
- package/dist/es/components/Pagination/Pagination.css +0 -7
- package/dist/es/components/Pagination/Pagination.d.ts +9 -2
- package/dist/es/components/Pagination/Pagination.js +20 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/es/components/Pagination/components/PaginationButton/PaginationButton.js +12 -7
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationButtons/PaginationButtons.js +10 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/es/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/es/components/Pagination/helpers.d.ts +1 -1
- package/dist/es/components/Paragraph/Paragraph.css +10 -31
- package/dist/es/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/es/components/Paragraph/Paragraph.js +14 -40
- package/dist/es/components/Preloader/Preloader.css +5 -12
- package/dist/es/components/Preloader/Preloader.d.ts +4 -0
- package/dist/es/components/Preloader/Preloader.js +10 -5
- package/dist/es/components/RadioButton/RadioButton.css +7 -14
- package/dist/es/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/es/components/RadioButton/RadioButton.js +50 -85
- package/dist/es/components/Search/Search.css +20 -25
- package/dist/es/components/Search/Search.js +3 -4
- package/dist/es/components/Select/Select.css +34 -37
- package/dist/es/components/Select/Select.d.ts +43 -50
- package/dist/es/components/Select/Select.js +382 -461
- package/dist/es/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/es/components/Select/reducer/selectReducer.js +123 -0
- package/dist/es/components/Switcher/Switcher.css +18 -28
- package/dist/es/components/Switcher/Switcher.js +1 -1
- package/dist/es/components/Tabs/Tab.d.ts +5 -2
- package/dist/es/components/Tabs/Tab.js +4 -2
- package/dist/es/components/Tabs/Tabs.css +30 -37
- package/dist/es/components/Tabs/Tabs.d.ts +8 -0
- package/dist/es/components/Tabs/Tabs.js +38 -31
- package/dist/es/components/TextField/TextField.css +27 -33
- package/dist/es/components/TextField/TextField.d.ts +9 -3
- package/dist/es/components/TextField/TextField.js +32 -24
- package/dist/es/components/TextLink/TextLink.css +10 -14
- package/dist/es/components/TextLink/TextLink.d.ts +1 -1
- package/dist/es/components/TextLink/TextLink.js +7 -2
- package/dist/es/components/Tile/Tile.css +2 -8
- package/dist/es/components/Tile/Tile.d.ts +5 -2
- package/dist/es/components/Tile/Tile.js +2 -2
- package/dist/es/components/Tooltip/Tooltip.css +1 -8
- package/dist/es/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/es/components/Tooltip/Tooltip.js +28 -27
- package/dist/es/index.d.ts +1 -0
- package/dist/es/index.js +1 -0
- package/dist/lib/colors/ColorItem/ColorItem.css +1 -8
- package/dist/lib/colors/ColorItem/ColorItem.js +1 -1
- package/dist/lib/colors/Colors.css +3 -11
- package/dist/lib/colors/Colors.d.ts +2 -2
- package/dist/lib/colors/Colors.js +63 -4
- package/dist/lib/colors/colorsData.js +78 -71
- package/dist/lib/components/Accordion/Accordion.css +7 -27
- package/dist/lib/components/Accordion/Accordion.d.ts +12 -7
- package/dist/lib/components/Accordion/Accordion.js +24 -19
- package/dist/lib/components/Banner/Banner.css +2 -37
- package/dist/lib/components/Banner/Banner.d.ts +10 -2
- package/dist/lib/components/Banner/Banner.js +35 -25
- package/dist/lib/components/Banner/BannerDot.css +4 -11
- package/dist/lib/components/Banner/BannerDot.d.ts +3 -0
- package/dist/lib/components/Banner/BannerDot.js +10 -2
- package/dist/lib/components/Button/Button.css +83 -74
- package/dist/lib/components/Button/Button.d.ts +8 -2
- package/dist/lib/components/Button/Button.js +16 -8
- package/dist/lib/components/Calendar/Calendar.css +0 -7
- package/dist/lib/components/Calendar/Calendar.js +3 -3
- package/dist/lib/components/Calendar/components/Day/Day.css +10 -17
- package/dist/lib/components/Calendar/components/Day/Day.js +1 -1
- package/dist/lib/components/Calendar/components/Month/Month.css +3 -10
- package/dist/lib/components/Calendar/components/Month/Month.js +20 -4
- package/dist/lib/components/Carousel/Carousel.css +4 -11
- package/dist/lib/components/Carousel/Carousel.d.ts +9 -2
- package/dist/lib/components/Carousel/Carousel.js +26 -23
- package/dist/lib/components/Checkbox/Checkbox.css +18 -25
- package/dist/lib/components/Checkbox/Checkbox.d.ts +11 -27
- package/dist/lib/components/Checkbox/Checkbox.js +82 -125
- package/dist/lib/components/Collapse/Collapse.d.ts +15 -3
- package/dist/lib/components/Collapse/Collapse.js +13 -4
- package/dist/lib/components/ContentArea/ContentArea.css +18 -28
- package/dist/lib/components/ContentArea/ContentArea.d.ts +2 -7
- package/dist/lib/components/ContentArea/ContentArea.js +5 -42
- package/dist/lib/components/Counter/Counter.css +14 -11
- package/dist/lib/components/Counter/Counter.js +3 -3
- package/dist/lib/components/Grid/GridColumn.css +0 -7
- package/dist/lib/components/Header/Header.css +8 -12
- package/dist/lib/components/Header/Header.d.ts +7 -21
- package/dist/lib/components/Header/Header.js +31 -98
- package/dist/lib/components/InputLabel/InputLabel.css +0 -7
- package/dist/lib/components/InputLabel/InputLabel.d.ts +3 -0
- package/dist/lib/components/InputLabel/InputLabel.js +11 -3
- package/dist/lib/components/Link/Link.d.ts +3 -3
- package/dist/lib/components/Link/Link.js +44 -26
- package/dist/lib/components/List/List.css +9 -13
- package/dist/lib/components/List/List.d.ts +1 -1
- package/dist/lib/components/List/List.js +2 -2
- package/dist/lib/components/List/ListItem.css +0 -7
- package/dist/lib/components/Logo/Logo.css +0 -7
- package/dist/lib/components/Logo/Logo.js +4 -8
- package/dist/lib/components/NavArrow/NavArrow.css +5 -12
- package/dist/lib/components/Notification/Notification.css +41 -24
- package/dist/lib/components/Notification/Notification.d.ts +8 -0
- package/dist/lib/components/Notification/Notification.js +20 -3
- package/dist/lib/components/Pagination/Pagination.css +0 -7
- package/dist/lib/components/Pagination/Pagination.d.ts +9 -2
- package/dist/lib/components/Pagination/Pagination.js +20 -2
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.css +9 -9
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.d.ts +6 -3
- package/dist/lib/components/Pagination/components/PaginationButton/PaginationButton.js +12 -6
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationButtons/PaginationButtons.js +9 -1
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.d.ts +5 -2
- package/dist/lib/components/Pagination/components/PaginationNavigation/PaginationNavigation.js +6 -1
- package/dist/lib/components/Pagination/helpers.d.ts +1 -1
- package/dist/lib/components/Paragraph/Paragraph.css +10 -31
- package/dist/lib/components/Paragraph/Paragraph.d.ts +9 -13
- package/dist/lib/components/Paragraph/Paragraph.js +15 -41
- package/dist/lib/components/Preloader/Preloader.css +5 -12
- package/dist/lib/components/Preloader/Preloader.d.ts +4 -0
- package/dist/lib/components/Preloader/Preloader.js +10 -4
- package/dist/lib/components/RadioButton/RadioButton.css +7 -14
- package/dist/lib/components/RadioButton/RadioButton.d.ts +8 -28
- package/dist/lib/components/RadioButton/RadioButton.js +51 -117
- package/dist/lib/components/Search/Search.css +20 -25
- package/dist/lib/components/Search/Search.js +3 -4
- package/dist/lib/components/Select/Select.css +34 -37
- package/dist/lib/components/Select/Select.d.ts +43 -50
- package/dist/lib/components/Select/Select.js +375 -483
- package/dist/lib/components/Select/reducer/selectReducer.d.ts +34 -0
- package/dist/lib/components/Select/reducer/selectReducer.js +136 -0
- package/dist/lib/components/Switcher/Switcher.css +18 -28
- package/dist/lib/components/Switcher/Switcher.js +1 -1
- package/dist/lib/components/Tabs/Tab.d.ts +5 -2
- package/dist/lib/components/Tabs/Tab.js +4 -2
- package/dist/lib/components/Tabs/Tabs.css +30 -37
- package/dist/lib/components/Tabs/Tabs.d.ts +8 -0
- package/dist/lib/components/Tabs/Tabs.js +38 -31
- package/dist/lib/components/TextField/TextField.css +27 -33
- package/dist/lib/components/TextField/TextField.d.ts +9 -3
- package/dist/lib/components/TextField/TextField.js +30 -23
- package/dist/lib/components/TextLink/TextLink.css +10 -14
- package/dist/lib/components/TextLink/TextLink.d.ts +1 -1
- package/dist/lib/components/TextLink/TextLink.js +7 -2
- package/dist/lib/components/Tile/Tile.css +2 -8
- package/dist/lib/components/Tile/Tile.d.ts +5 -2
- package/dist/lib/components/Tile/Tile.js +2 -2
- package/dist/lib/components/Tooltip/Tooltip.css +1 -8
- package/dist/lib/components/Tooltip/Tooltip.d.ts +8 -2
- package/dist/lib/components/Tooltip/Tooltip.js +27 -26
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.js +8 -0
- package/package.json +5 -4
- package/styles/base.less +2 -73
- package/styles/colors.css +60 -0
- package/styles/colorsDark.css +62 -0
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ISelectItem, SelectItemValueType } from '../Select';
|
|
2
|
+
export declare const initialState: {
|
|
3
|
+
isOpened: boolean;
|
|
4
|
+
hoveredItemIndex: number;
|
|
5
|
+
itemsList: never[];
|
|
6
|
+
comparableInputValue: string;
|
|
7
|
+
inputValue: string;
|
|
8
|
+
};
|
|
9
|
+
export declare enum SelectActions {
|
|
10
|
+
TOGGLE_DROPDOWN = "TOGGLE_DROPDOWN",
|
|
11
|
+
UPDATE_ITEMS_LIST = "UPDATE_ITEMS_LIST",
|
|
12
|
+
UPDATE_VALUE_FROM_PROPS = "UPDATE_VALUE_FROM_PROPS",
|
|
13
|
+
UPDATE_SELECT_VALUE = "UPDATE_SELECT_VALUE",
|
|
14
|
+
SET_HOVERED_ITEM_INDEX = "SET_HOVERED_ITEM_INDEX",
|
|
15
|
+
COMBOBOX_VALUE_DEBOUNCE = "COMBOBOX_VALUE_DEBOUNCE",
|
|
16
|
+
COMBOBOX_INPUT_CHANGE = "COMBOBOX_INPUT_CHANGE"
|
|
17
|
+
}
|
|
18
|
+
export interface ISelectState<T extends SelectItemValueType> {
|
|
19
|
+
isOpened: boolean;
|
|
20
|
+
hoveredItemIndex: number;
|
|
21
|
+
itemsList: Array<ISelectItem<T>>;
|
|
22
|
+
comparableInputValue: string;
|
|
23
|
+
inputValue: string;
|
|
24
|
+
}
|
|
25
|
+
export interface ISelectAction<T extends SelectItemValueType> {
|
|
26
|
+
type: SelectActions;
|
|
27
|
+
items?: Array<ISelectItem<T>>;
|
|
28
|
+
hoveredItemIndex?: number;
|
|
29
|
+
inputValue?: string;
|
|
30
|
+
comparableInputValue?: string;
|
|
31
|
+
isOpened?: boolean;
|
|
32
|
+
}
|
|
33
|
+
declare const selectReducer: <T extends string | number | undefined>(state: ISelectState<T>, action: ISelectAction<T>) => ISelectState<T>;
|
|
34
|
+
export default selectReducer;
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import "core-js/modules/es.array.every";
|
|
2
|
+
import _extends from "@babel/runtime/helpers/extends";
|
|
3
|
+
|
|
4
|
+
var isEqualItems = function isEqualItems(newItems, setItems) {
|
|
5
|
+
if (newItems.length !== setItems.length) {
|
|
6
|
+
return false;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
return newItems.every(function (item, i) {
|
|
10
|
+
var isEqualValue = item.value === setItems[i].value;
|
|
11
|
+
var isEqualTitle = item.title === setItems[i].title;
|
|
12
|
+
return isEqualValue && isEqualTitle;
|
|
13
|
+
});
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export var initialState = {
|
|
17
|
+
isOpened: false,
|
|
18
|
+
hoveredItemIndex: 0,
|
|
19
|
+
itemsList: [],
|
|
20
|
+
comparableInputValue: '',
|
|
21
|
+
inputValue: ''
|
|
22
|
+
};
|
|
23
|
+
export var SelectActions;
|
|
24
|
+
|
|
25
|
+
(function (SelectActions) {
|
|
26
|
+
SelectActions["TOGGLE_DROPDOWN"] = "TOGGLE_DROPDOWN";
|
|
27
|
+
SelectActions["UPDATE_ITEMS_LIST"] = "UPDATE_ITEMS_LIST";
|
|
28
|
+
SelectActions["UPDATE_VALUE_FROM_PROPS"] = "UPDATE_VALUE_FROM_PROPS";
|
|
29
|
+
SelectActions["UPDATE_SELECT_VALUE"] = "UPDATE_SELECT_VALUE";
|
|
30
|
+
SelectActions["SET_HOVERED_ITEM_INDEX"] = "SET_HOVERED_ITEM_INDEX";
|
|
31
|
+
SelectActions["COMBOBOX_VALUE_DEBOUNCE"] = "COMBOBOX_VALUE_DEBOUNCE";
|
|
32
|
+
SelectActions["COMBOBOX_INPUT_CHANGE"] = "COMBOBOX_INPUT_CHANGE";
|
|
33
|
+
})(SelectActions || (SelectActions = {}));
|
|
34
|
+
|
|
35
|
+
var _SelectActions = SelectActions,
|
|
36
|
+
TOGGLE_DROPDOWN = _SelectActions.TOGGLE_DROPDOWN,
|
|
37
|
+
UPDATE_ITEMS_LIST = _SelectActions.UPDATE_ITEMS_LIST,
|
|
38
|
+
UPDATE_VALUE_FROM_PROPS = _SelectActions.UPDATE_VALUE_FROM_PROPS,
|
|
39
|
+
UPDATE_SELECT_VALUE = _SelectActions.UPDATE_SELECT_VALUE,
|
|
40
|
+
SET_HOVERED_ITEM_INDEX = _SelectActions.SET_HOVERED_ITEM_INDEX,
|
|
41
|
+
COMBOBOX_VALUE_DEBOUNCE = _SelectActions.COMBOBOX_VALUE_DEBOUNCE,
|
|
42
|
+
COMBOBOX_INPUT_CHANGE = _SelectActions.COMBOBOX_INPUT_CHANGE;
|
|
43
|
+
|
|
44
|
+
var selectReducer = function selectReducer(state, action) {
|
|
45
|
+
var type = action.type,
|
|
46
|
+
_action$items = action.items,
|
|
47
|
+
items = _action$items === void 0 ? [] : _action$items,
|
|
48
|
+
_action$hoveredItemIn = action.hoveredItemIndex,
|
|
49
|
+
hoveredItemIndex = _action$hoveredItemIn === void 0 ? 0 : _action$hoveredItemIn,
|
|
50
|
+
_action$inputValue = action.inputValue,
|
|
51
|
+
inputValue = _action$inputValue === void 0 ? '' : _action$inputValue,
|
|
52
|
+
_action$comparableInp = action.comparableInputValue,
|
|
53
|
+
comparableInputValue = _action$comparableInp === void 0 ? '' : _action$comparableInp,
|
|
54
|
+
_action$isOpened = action.isOpened,
|
|
55
|
+
isOpened = _action$isOpened === void 0 ? false : _action$isOpened;
|
|
56
|
+
var prevItems = state.itemsList;
|
|
57
|
+
|
|
58
|
+
switch (type) {
|
|
59
|
+
case TOGGLE_DROPDOWN:
|
|
60
|
+
{
|
|
61
|
+
return _extends(_extends({}, state), {
|
|
62
|
+
isOpened: isOpened
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
case UPDATE_ITEMS_LIST:
|
|
67
|
+
{
|
|
68
|
+
var isItemsEqual = isEqualItems(items, prevItems);
|
|
69
|
+
return isItemsEqual ? state : _extends(_extends({}, state), {
|
|
70
|
+
itemsList: items
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
case UPDATE_VALUE_FROM_PROPS:
|
|
75
|
+
{
|
|
76
|
+
return _extends(_extends({}, state), {
|
|
77
|
+
hoveredItemIndex: hoveredItemIndex,
|
|
78
|
+
inputValue: inputValue,
|
|
79
|
+
comparableInputValue: ''
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
case COMBOBOX_VALUE_DEBOUNCE:
|
|
84
|
+
{
|
|
85
|
+
return _extends(_extends({}, state), {
|
|
86
|
+
comparableInputValue: comparableInputValue,
|
|
87
|
+
itemsList: items,
|
|
88
|
+
isOpened: true,
|
|
89
|
+
hoveredItemIndex: 0
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
case UPDATE_SELECT_VALUE:
|
|
94
|
+
{
|
|
95
|
+
return _extends(_extends({}, state), {
|
|
96
|
+
isOpened: false,
|
|
97
|
+
itemsList: items,
|
|
98
|
+
hoveredItemIndex: hoveredItemIndex
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
case SET_HOVERED_ITEM_INDEX:
|
|
103
|
+
{
|
|
104
|
+
return _extends(_extends({}, state), {
|
|
105
|
+
hoveredItemIndex: hoveredItemIndex
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
case COMBOBOX_INPUT_CHANGE:
|
|
110
|
+
{
|
|
111
|
+
return _extends(_extends({}, state), {
|
|
112
|
+
inputValue: inputValue
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
default:
|
|
117
|
+
{
|
|
118
|
+
return state;
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
export default selectReducer;
|
|
@@ -1,54 +1,44 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-switcher {
|
|
9
2
|
top: 22px;
|
|
10
3
|
right: 28px;
|
|
11
|
-
width:
|
|
12
|
-
height:
|
|
4
|
+
width: 40px;
|
|
5
|
+
height: 24px;
|
|
13
6
|
border-radius: 15.5px;
|
|
14
|
-
background-color:
|
|
15
|
-
-webkit-box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
|
|
16
|
-
box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
|
|
7
|
+
background-color: var(--spbSky1);
|
|
17
8
|
cursor: pointer;
|
|
18
9
|
-webkit-transition: all 0.3s;
|
|
19
10
|
transition: all 0.3s;
|
|
20
11
|
}
|
|
21
12
|
.mfui-switcher_no-touch:hover {
|
|
22
|
-
background-color:
|
|
13
|
+
background-color: var(--spbSky1);
|
|
23
14
|
}
|
|
24
15
|
.mfui-switcher__pointer {
|
|
25
16
|
position: relative;
|
|
26
|
-
top:
|
|
27
|
-
left:
|
|
28
|
-
width:
|
|
29
|
-
height:
|
|
30
|
-
border: 1px solid #D8D8D8;
|
|
17
|
+
top: 2px;
|
|
18
|
+
left: 2px;
|
|
19
|
+
width: 20px;
|
|
20
|
+
height: 20px;
|
|
31
21
|
border-radius: 50%;
|
|
32
|
-
background-color:
|
|
33
|
-
-webkit-box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.05), 0 3px 3px 0 rgba(0, 0, 0, 0.05);
|
|
34
|
-
box-shadow: 0 3px 1px 0 rgba(0, 0, 0, 0.05), 0 3px 3px 0 rgba(0, 0, 0, 0.05);
|
|
22
|
+
background-color: var(--base);
|
|
35
23
|
-webkit-transition: all 0.3s;
|
|
36
24
|
transition: all 0.3s;
|
|
37
25
|
}
|
|
38
26
|
.mfui-switcher_checked {
|
|
39
|
-
background-color:
|
|
27
|
+
background-color: var(--brandGreen);
|
|
40
28
|
}
|
|
41
29
|
.mfui-switcher_checked .mfui-switcher__pointer {
|
|
42
|
-
left:
|
|
30
|
+
left: 18px;
|
|
43
31
|
}
|
|
44
32
|
.mfui-switcher_checked.mfui-switcher_no-touch:hover {
|
|
45
|
-
background-color:
|
|
33
|
+
background-color: var(--buttonHoverGreen);
|
|
46
34
|
}
|
|
47
35
|
.mfui-switcher_disabled {
|
|
48
|
-
background-color:
|
|
36
|
+
background-color: var(--spbSky1);
|
|
49
37
|
cursor: default;
|
|
50
38
|
}
|
|
51
|
-
.mfui-switcher_checked.mfui-
|
|
52
|
-
|
|
53
|
-
|
|
39
|
+
.mfui-switcher_disabled.mfui-switcher_checked.mfui-switcher_no-touch.mfui-switcher:hover {
|
|
40
|
+
background-color: var(--spbSky1);
|
|
41
|
+
}
|
|
42
|
+
.mfui-switcher_disabled .mfui-switcher__pointer {
|
|
43
|
+
background-color: var(--spbSky2);
|
|
54
44
|
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
|
-
|
|
3
|
-
export interface ITabProps extends IFilterDataAttrs {
|
|
2
|
+
export interface ITabProps {
|
|
4
3
|
/** Заголовок таба */
|
|
5
4
|
title?: string;
|
|
6
5
|
/** Иконка таба */
|
|
7
6
|
icon?: React.ReactNode;
|
|
8
7
|
/** Ссылка */
|
|
9
8
|
href?: string;
|
|
9
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
10
|
+
dataAttrs?: {
|
|
11
|
+
root?: Record<string, string>;
|
|
12
|
+
};
|
|
10
13
|
/** Дочерние элементы */
|
|
11
14
|
children?: React.ReactNode;
|
|
12
15
|
/** Функция рендера компонента-обертки для заголовка и иконки */
|
|
@@ -8,10 +8,12 @@ var Tab = function Tab(_ref) {
|
|
|
8
8
|
};
|
|
9
9
|
|
|
10
10
|
Tab.propTypes = {
|
|
11
|
+
dataAttrs: PropTypes.shape({
|
|
12
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
13
|
+
}),
|
|
11
14
|
title: PropTypes.string,
|
|
12
15
|
icon: PropTypes.node,
|
|
13
16
|
href: PropTypes.string,
|
|
14
|
-
renderTabWrapper: PropTypes.func
|
|
15
|
-
dataAttrs: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
17
|
+
renderTabWrapper: PropTypes.func
|
|
16
18
|
};
|
|
17
19
|
export default Tab;
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
h1,
|
|
2
|
-
h2,
|
|
3
|
-
h3,
|
|
4
|
-
h4,
|
|
5
|
-
h5 {
|
|
6
|
-
margin: 0;
|
|
7
|
-
}
|
|
8
1
|
.mfui-tabs__swiper {
|
|
9
2
|
font-family: inherit;
|
|
10
3
|
font-size: 15px;
|
|
@@ -28,13 +21,13 @@ h5 {
|
|
|
28
21
|
}
|
|
29
22
|
.mfui-tabs__swiper:before {
|
|
30
23
|
left: 0;
|
|
31
|
-
background: -webkit-gradient(linear, left top, right top, from(
|
|
32
|
-
background: linear-gradient(to right,
|
|
24
|
+
background: -webkit-gradient(linear, left top, right top, from(var(--base)), to(rgba(255, 255, 255, 0)));
|
|
25
|
+
background: linear-gradient(to right, var(--base), rgba(255, 255, 255, 0));
|
|
33
26
|
}
|
|
34
27
|
.mfui-tabs__swiper:after {
|
|
35
28
|
right: 0;
|
|
36
|
-
background: -webkit-gradient(linear, right top, left top, from(
|
|
37
|
-
background: linear-gradient(to left,
|
|
29
|
+
background: -webkit-gradient(linear, right top, left top, from(var(--base)), to(rgba(255, 255, 255, 0)));
|
|
30
|
+
background: linear-gradient(to left, var(--base), rgba(255, 255, 255, 0));
|
|
38
31
|
}
|
|
39
32
|
.mfui-tabs__swiper_beginning:before {
|
|
40
33
|
display: none;
|
|
@@ -80,19 +73,19 @@ h5 {
|
|
|
80
73
|
-webkit-box-sizing: content-box;
|
|
81
74
|
box-sizing: content-box;
|
|
82
75
|
height: 32px;
|
|
83
|
-
color:
|
|
76
|
+
color: var(--content);
|
|
84
77
|
white-space: nowrap;
|
|
85
78
|
text-decoration: none;
|
|
86
79
|
cursor: pointer;
|
|
87
|
-
fill:
|
|
80
|
+
fill: var(--content);
|
|
88
81
|
}
|
|
89
82
|
.mfui-tabs__tab-inner:hover {
|
|
90
|
-
color:
|
|
91
|
-
fill:
|
|
83
|
+
color: var(--brandGreen);
|
|
84
|
+
fill: var(--brandGreen);
|
|
92
85
|
}
|
|
93
86
|
.mfui-tabs__tab-inner_current {
|
|
94
|
-
color:
|
|
95
|
-
fill:
|
|
87
|
+
color: var(--brandGreen);
|
|
88
|
+
fill: var(--brandGreen);
|
|
96
89
|
}
|
|
97
90
|
.mfui-tabs__tab-icon {
|
|
98
91
|
width: 32px;
|
|
@@ -116,7 +109,7 @@ h5 {
|
|
|
116
109
|
bottom: 0;
|
|
117
110
|
left: 0;
|
|
118
111
|
height: 2px;
|
|
119
|
-
background-color:
|
|
112
|
+
background-color: var(--brandGreen);
|
|
120
113
|
-webkit-transition-duration: 0.3s;
|
|
121
114
|
transition-duration: 0.3s;
|
|
122
115
|
}
|
|
@@ -128,11 +121,11 @@ h5 {
|
|
|
128
121
|
width: 16px;
|
|
129
122
|
height: 16px;
|
|
130
123
|
border-radius: 50%;
|
|
131
|
-
background-color:
|
|
124
|
+
background-color: var(--content);
|
|
132
125
|
-webkit-transform: translateY(-50%);
|
|
133
126
|
transform: translateY(-50%);
|
|
134
127
|
cursor: pointer;
|
|
135
|
-
fill:
|
|
128
|
+
fill: var(--base);
|
|
136
129
|
}
|
|
137
130
|
@media screen and (max-width: 1023px) {
|
|
138
131
|
.mfui-tabs__arrow {
|
|
@@ -206,7 +199,7 @@ h5 {
|
|
|
206
199
|
justify-content: center;
|
|
207
200
|
}
|
|
208
201
|
.mfui-tabs_h-align_center .mfui-tabs__tab {
|
|
209
|
-
border-bottom: 1px solid
|
|
202
|
+
border-bottom: 1px solid var(--stcWhite);
|
|
210
203
|
}
|
|
211
204
|
.mfui-tabs_h-align_left .mfui-tabs__swiper-wrapper {
|
|
212
205
|
position: relative;
|
|
@@ -218,7 +211,7 @@ h5 {
|
|
|
218
211
|
left: 0;
|
|
219
212
|
width: 100%;
|
|
220
213
|
height: 1px;
|
|
221
|
-
background-color:
|
|
214
|
+
background-color: var(--spbSky2);
|
|
222
215
|
}
|
|
223
216
|
@media screen and (min-width: 768px) and (max-width: 1023px) {
|
|
224
217
|
.mfui-tabs_indents .mfui-tabs__swiper {
|
|
@@ -238,37 +231,37 @@ h5 {
|
|
|
238
231
|
right: 0;
|
|
239
232
|
left: 0;
|
|
240
233
|
z-index: 100;
|
|
241
|
-
background-color:
|
|
234
|
+
background-color: var(--base);
|
|
242
235
|
}
|
|
243
236
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__swiper:before {
|
|
244
237
|
left: 0;
|
|
245
|
-
background: -webkit-gradient(linear, left top, right top, from(
|
|
246
|
-
background: linear-gradient(to right,
|
|
238
|
+
background: -webkit-gradient(linear, left top, right top, from(var(--brandGreen)), to(transparent));
|
|
239
|
+
background: linear-gradient(to right, var(--brandGreen), transparent);
|
|
247
240
|
}
|
|
248
241
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__swiper:after {
|
|
249
242
|
right: 0;
|
|
250
|
-
background: -webkit-gradient(linear, right top, left top, from(
|
|
251
|
-
background: linear-gradient(to left,
|
|
243
|
+
background: -webkit-gradient(linear, right top, left top, from(var(--brandGreen)), to(transparent));
|
|
244
|
+
background: linear-gradient(to left, var(--brandGreen), transparent);
|
|
252
245
|
}
|
|
253
246
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab {
|
|
254
|
-
border-color:
|
|
247
|
+
border-color: var(--stcBlack5);
|
|
255
248
|
}
|
|
256
249
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab-inner {
|
|
257
|
-
color:
|
|
258
|
-
fill:
|
|
250
|
+
color: var(--stcWhite50);
|
|
251
|
+
fill: var(--stcWhite50);
|
|
259
252
|
}
|
|
260
253
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab-inner:hover {
|
|
261
|
-
color:
|
|
262
|
-
fill:
|
|
254
|
+
color: var(--stcWhite);
|
|
255
|
+
fill: var(--stcWhite);
|
|
263
256
|
}
|
|
264
257
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__tab-inner_current {
|
|
265
|
-
color:
|
|
266
|
-
fill:
|
|
258
|
+
color: var(--stcWhite);
|
|
259
|
+
fill: var(--stcWhite);
|
|
267
260
|
}
|
|
268
261
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__underline {
|
|
269
|
-
background-color:
|
|
262
|
+
background-color: var(--stcWhite);
|
|
270
263
|
}
|
|
271
264
|
.mfui-tabs_tab-color_green:not(.mfui-tabs_sticky) .mfui-tabs__arrow {
|
|
272
|
-
background-color:
|
|
273
|
-
fill:
|
|
265
|
+
background-color: var(--stcWhite);
|
|
266
|
+
fill: var(--brandGreen);
|
|
274
267
|
}
|
|
@@ -27,6 +27,14 @@ export interface ITabsProps {
|
|
|
27
27
|
tab?: string;
|
|
28
28
|
activeTab?: string;
|
|
29
29
|
};
|
|
30
|
+
/** Дополнительные data атрибуты к внутренним элементам */
|
|
31
|
+
dataAttrs?: {
|
|
32
|
+
root?: Record<string, string>;
|
|
33
|
+
slider?: Record<string, string>;
|
|
34
|
+
panel?: Record<string, string>;
|
|
35
|
+
prev?: Record<string, string>;
|
|
36
|
+
next?: Record<string, string>;
|
|
37
|
+
};
|
|
30
38
|
/** Размер табов */
|
|
31
39
|
size?: TabSizeType;
|
|
32
40
|
/** Горизонтальное выравнивание */
|
|
@@ -67,6 +67,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
67
67
|
_ref$renderOnlyCurren = _ref.renderOnlyCurrentPanel,
|
|
68
68
|
renderOnlyCurrentPanel = _ref$renderOnlyCurren === void 0 ? false : _ref$renderOnlyCurren,
|
|
69
69
|
children = _ref.children,
|
|
70
|
+
dataAttrs = _ref.dataAttrs,
|
|
70
71
|
onTabClick = _ref.onTabClick;
|
|
71
72
|
var tabsRef = React.useRef([]);
|
|
72
73
|
var rootRef = React.useRef(null);
|
|
@@ -164,11 +165,11 @@ var Tabs = function Tabs(_ref) {
|
|
|
164
165
|
left: left,
|
|
165
166
|
right: documentWidth - right
|
|
166
167
|
});
|
|
167
|
-
}, [
|
|
168
|
+
}, [stickyOffset, isSticky]);
|
|
168
169
|
var handleTabInnerClick = React.useCallback(function (index) {
|
|
169
170
|
return function () {
|
|
170
171
|
setUnderlineTransition('all');
|
|
171
|
-
onTabClick
|
|
172
|
+
onTabClick && onTabClick(index);
|
|
172
173
|
|
|
173
174
|
if (outerIndex === undefined) {
|
|
174
175
|
setInnerIndex(index);
|
|
@@ -186,6 +187,16 @@ var Tabs = function Tabs(_ref) {
|
|
|
186
187
|
var handleNextArrowClick = React.useCallback(function () {
|
|
187
188
|
swiperInstance === null || swiperInstance === void 0 ? void 0 : swiperInstance.slideNext();
|
|
188
189
|
}, [swiperInstance]);
|
|
190
|
+
var handleReachBeginning = React.useCallback(function (swiper) {
|
|
191
|
+
setBeginning(swiper.isBeginning);
|
|
192
|
+
}, []);
|
|
193
|
+
var handleReachEnd = React.useCallback(function (swiper) {
|
|
194
|
+
setEnd(swiper.isEnd);
|
|
195
|
+
}, []);
|
|
196
|
+
var handleFromEdge = React.useCallback(function (swiper) {
|
|
197
|
+
setBeginning(swiper.isBeginning);
|
|
198
|
+
setEnd(swiper.isEnd);
|
|
199
|
+
}, []);
|
|
189
200
|
var renderTab = React.useCallback(function (index, title, icon, href) {
|
|
190
201
|
var ElementType = href ? 'a' : 'div';
|
|
191
202
|
return /*#__PURE__*/React.createElement(ElementType, {
|
|
@@ -207,7 +218,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
207
218
|
icon = _child$props.icon,
|
|
208
219
|
href = _child$props.href,
|
|
209
220
|
renderTabWrapper = _child$props.renderTabWrapper,
|
|
210
|
-
|
|
221
|
+
data = _child$props.dataAttrs;
|
|
211
222
|
var tab = renderTab(i, title, icon, href);
|
|
212
223
|
var activeTabClassName = currentIndex === i ? activeTabClass : undefined;
|
|
213
224
|
return /*#__PURE__*/React.createElement(SwiperSlide, {
|
|
@@ -215,9 +226,9 @@ var Tabs = function Tabs(_ref) {
|
|
|
215
226
|
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
216
227
|
className: cn('tab', [tabClass, activeTabClassName]),
|
|
217
228
|
ref: setTabRef
|
|
218
|
-
}, filterDataAttrs(
|
|
229
|
+
}, filterDataAttrs(data === null || data === void 0 ? void 0 : data.root, i + 1)), renderTabWrapper ? renderTabWrapper(tab) : tab));
|
|
219
230
|
});
|
|
220
|
-
}, [renderTab, children
|
|
231
|
+
}, [renderTab, children]);
|
|
221
232
|
var renderPanels = React.useCallback(function () {
|
|
222
233
|
return React.Children.map(children, function (child, i) {
|
|
223
234
|
var panel = child.props.children;
|
|
@@ -227,25 +238,14 @@ var Tabs = function Tabs(_ref) {
|
|
|
227
238
|
return null;
|
|
228
239
|
}
|
|
229
240
|
|
|
230
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
241
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.panel, i + 1), {
|
|
231
242
|
className: cn('panel', {
|
|
232
243
|
current: isCurrentPanel
|
|
233
244
|
})
|
|
234
|
-
}, panel);
|
|
245
|
+
}), panel);
|
|
235
246
|
});
|
|
236
|
-
}, [children, currentIndex
|
|
237
|
-
var handleReachBeginning = React.useCallback(function (swiper) {
|
|
238
|
-
setBeginning(swiper.isBeginning);
|
|
239
|
-
}, []);
|
|
240
|
-
var handleReachEnd = React.useCallback(function (swiper) {
|
|
241
|
-
setEnd(swiper.isEnd);
|
|
242
|
-
}, []);
|
|
243
|
-
var handleFromEdge = React.useCallback(function (swiper) {
|
|
244
|
-
setBeginning(swiper.isBeginning);
|
|
245
|
-
setEnd(swiper.isEnd);
|
|
246
|
-
}, []);
|
|
247
|
+
}, [children, currentIndex]);
|
|
247
248
|
React.useEffect(function () {
|
|
248
|
-
var rootRefNode = rootRef.current;
|
|
249
249
|
var observer = new IntersectionObserver(function (entries) {
|
|
250
250
|
entries.forEach(function (_ref2) {
|
|
251
251
|
var isIntersecting = _ref2.isIntersecting,
|
|
@@ -254,7 +254,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
254
254
|
left = _ref2$boundingClientR.left,
|
|
255
255
|
right = _ref2$boundingClientR.right;
|
|
256
256
|
|
|
257
|
-
if (!sticky || !
|
|
257
|
+
if (!sticky || !rootRef.current || !tabListRef.current) {
|
|
258
258
|
return;
|
|
259
259
|
}
|
|
260
260
|
|
|
@@ -287,11 +287,11 @@ var Tabs = function Tabs(_ref) {
|
|
|
287
287
|
}, {
|
|
288
288
|
threshold: [0, 1]
|
|
289
289
|
});
|
|
290
|
-
|
|
290
|
+
rootRef.current && observer.observe(rootRef.current);
|
|
291
291
|
return function () {
|
|
292
|
-
|
|
292
|
+
rootRef.current && observer.unobserve(rootRef.current);
|
|
293
293
|
};
|
|
294
|
-
}, [calculateSticky
|
|
294
|
+
}, [calculateSticky]);
|
|
295
295
|
React.useEffect(function () {
|
|
296
296
|
var handleResize = throttle(function () {
|
|
297
297
|
calculateSticky();
|
|
@@ -312,7 +312,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
312
312
|
return function () {
|
|
313
313
|
window.removeEventListener('resize', handleResize);
|
|
314
314
|
};
|
|
315
|
-
}, [calculateUnderline, calculateSticky
|
|
315
|
+
}, [calculateUnderline, calculateSticky]);
|
|
316
316
|
React.useEffect(function () {
|
|
317
317
|
if (!swiperInstance) {
|
|
318
318
|
return;
|
|
@@ -321,7 +321,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
321
321
|
setBeginning(swiperInstance.isBeginning);
|
|
322
322
|
setEnd(swiperInstance.isEnd);
|
|
323
323
|
}, [swiperInstance]);
|
|
324
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
324
|
+
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
325
325
|
className: cn({
|
|
326
326
|
size: size,
|
|
327
327
|
'h-align': hAlign,
|
|
@@ -330,7 +330,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
330
330
|
sticky: isSticky
|
|
331
331
|
}, [className, rootClass]),
|
|
332
332
|
ref: rootRef
|
|
333
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
333
|
+
}), /*#__PURE__*/React.createElement("div", {
|
|
334
334
|
ref: tabListRef,
|
|
335
335
|
style: {
|
|
336
336
|
height: tabListHeight
|
|
@@ -341,7 +341,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
341
341
|
paddingLeft: stickyOffset.left,
|
|
342
342
|
paddingRight: stickyOffset.right
|
|
343
343
|
}
|
|
344
|
-
}, /*#__PURE__*/React.createElement(Swiper, {
|
|
344
|
+
}, /*#__PURE__*/React.createElement(Swiper, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.slider), {
|
|
345
345
|
simulateTouch: false,
|
|
346
346
|
className: cn('swiper', {
|
|
347
347
|
beginning: isBeginning,
|
|
@@ -353,7 +353,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
353
353
|
onReachBeginning: handleReachBeginning,
|
|
354
354
|
onReachEnd: handleReachEnd,
|
|
355
355
|
onFromEdge: handleFromEdge
|
|
356
|
-
}, renderTabs(), /*#__PURE__*/React.createElement("div", {
|
|
356
|
+
}), renderTabs(), /*#__PURE__*/React.createElement("div", {
|
|
357
357
|
className: cn('underline'),
|
|
358
358
|
slot: "wrapper-start",
|
|
359
359
|
style: {
|
|
@@ -361,19 +361,19 @@ var Tabs = function Tabs(_ref) {
|
|
|
361
361
|
transform: "translateX(".concat(underlineTranslate, "px)"),
|
|
362
362
|
transitionProperty: underlineTransition
|
|
363
363
|
}
|
|
364
|
-
}), /*#__PURE__*/React.createElement(ArrowLeft, {
|
|
364
|
+
}), /*#__PURE__*/React.createElement(ArrowLeft, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.prev), {
|
|
365
365
|
className: cn('arrow', {
|
|
366
366
|
prev: true,
|
|
367
367
|
hide: isBeginning
|
|
368
368
|
}),
|
|
369
369
|
onClick: handlePrevArrowClick
|
|
370
|
-
}), /*#__PURE__*/React.createElement(ArrowRight, {
|
|
370
|
+
})), /*#__PURE__*/React.createElement(ArrowRight, _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.next), {
|
|
371
371
|
className: cn('arrow', {
|
|
372
372
|
next: true,
|
|
373
373
|
hide: isEnd
|
|
374
374
|
}),
|
|
375
375
|
onClick: handleNextArrowClick
|
|
376
|
-
})))), renderPanels());
|
|
376
|
+
}))))), renderPanels());
|
|
377
377
|
};
|
|
378
378
|
|
|
379
379
|
Tabs.propTypes = {
|
|
@@ -384,6 +384,13 @@ Tabs.propTypes = {
|
|
|
384
384
|
tab: PropTypes.string,
|
|
385
385
|
activeTab: PropTypes.string
|
|
386
386
|
}),
|
|
387
|
+
dataAttrs: PropTypes.shape({
|
|
388
|
+
root: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
389
|
+
slider: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
390
|
+
panel: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
391
|
+
prev: PropTypes.objectOf(PropTypes.string.isRequired),
|
|
392
|
+
next: PropTypes.objectOf(PropTypes.string.isRequired)
|
|
393
|
+
}),
|
|
387
394
|
size: PropTypes.oneOf(Object.values(TabSize)),
|
|
388
395
|
hAlign: PropTypes.oneOf(Object.values(TabHAlign)),
|
|
389
396
|
tabColorTheme: PropTypes.oneOf(Object.values(TabColorTheme)),
|