@megafon/ui-core 4.2.0 → 4.4.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/CHANGELOG.md +29 -0
- package/dist/es/components/Select/Select.css +3 -0
- package/dist/es/components/Select/Select.d.ts +4 -1
- package/dist/es/components/Select/Select.js +6 -1
- package/dist/es/components/Tabs/Tabs.d.ts +2 -0
- package/dist/es/components/Tabs/Tabs.js +12 -14
- package/dist/es/components/TextField/TextField.css +1 -0
- package/dist/es/components/TextField/TextField.d.ts +1 -0
- package/dist/es/components/TextField/TextField.js +6 -6
- package/dist/es/components/Tooltip/Tooltip.js +5 -1
- package/dist/lib/components/Select/Select.css +3 -0
- package/dist/lib/components/Select/Select.d.ts +4 -1
- package/dist/lib/components/Select/Select.js +6 -1
- package/dist/lib/components/Tabs/Tabs.d.ts +2 -0
- package/dist/lib/components/Tabs/Tabs.js +12 -14
- package/dist/lib/components/TextField/TextField.css +1 -0
- package/dist/lib/components/TextField/TextField.d.ts +1 -0
- package/dist/lib/components/TextField/TextField.js +6 -6
- package/dist/lib/components/Tooltip/Tooltip.js +5 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,35 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [4.4.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.3.0...@megafon/ui-core@4.4.0) (2022-10-10)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **textfield:** fix input height in Safari ([b60e1ac](https://github.com/MegafonWebLab/megafon-ui/commit/b60e1acd76dc80b4609b55dc8256eb94e8e8ec0c))
|
|
12
|
+
* **tooltip:** fix touch device controlled trigger ([e983ca8](https://github.com/MegafonWebLab/megafon-ui/commit/e983ca88636990e467b43483b0cf0df06dff8553))
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
### Features
|
|
16
|
+
|
|
17
|
+
* **select:** add new props useShortListItems ([31d1172](https://github.com/MegafonWebLab/megafon-ui/commit/31d1172484ca4c07060ff64eb7f3be692f5dbdec))
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
# [4.3.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.2.0...@megafon/ui-core@4.3.0) (2022-10-05)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* **tabs:** update prop classes with new keys wrapper and swiperWrapper ([1832aac](https://github.com/MegafonWebLab/megafon-ui/commit/1832aac3a0cdba03c9e74fd4e570be72c4156387))
|
|
29
|
+
* **textfield:** update pros classes with new key label ([db2a10d](https://github.com/MegafonWebLab/megafon-ui/commit/db2a10dd23e0ac6634510207202ba86886ae6d61))
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
6
35
|
# [4.2.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.1.0...@megafon/ui-core@4.2.0) (2022-10-04)
|
|
7
36
|
|
|
8
37
|
|
|
@@ -56,6 +56,8 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
56
56
|
notFoundText?: string;
|
|
57
57
|
/** Массив элементов селекта */
|
|
58
58
|
items: Array<ISelectItem<T>>;
|
|
59
|
+
/** Отображать короткий выпадающий список */
|
|
60
|
+
shortList?: boolean;
|
|
59
61
|
/** Дополнительный класс корневого элемента */
|
|
60
62
|
className?: string;
|
|
61
63
|
/** Дополнительные классы для внутренних элементов */
|
|
@@ -88,7 +90,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
88
90
|
onClosed?: () => void;
|
|
89
91
|
}
|
|
90
92
|
declare const Select: {
|
|
91
|
-
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
93
|
+
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, shortList, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
92
94
|
propTypes: {
|
|
93
95
|
type: PropTypes.Requireable<"classic" | "combobox">;
|
|
94
96
|
label: PropTypes.Requireable<string>;
|
|
@@ -144,6 +146,7 @@ declare const Select: {
|
|
|
144
146
|
value: PropTypes.Validator<string | number>;
|
|
145
147
|
paddings: PropTypes.Requireable<"small" | "large">;
|
|
146
148
|
}>> | null | undefined)[]>;
|
|
149
|
+
shortList: PropTypes.Requireable<boolean>;
|
|
147
150
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
148
151
|
onOpened: PropTypes.Requireable<(...args: any[]) => any>;
|
|
149
152
|
onClosed: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -73,6 +73,8 @@ var Select = function Select(_ref) {
|
|
|
73
73
|
items = _ref.items,
|
|
74
74
|
placeholder = _ref.placeholder,
|
|
75
75
|
currentValue = _ref.currentValue,
|
|
76
|
+
_ref$shortList = _ref.shortList,
|
|
77
|
+
shortList = _ref$shortList === void 0 ? false : _ref$shortList,
|
|
76
78
|
onClosed = _ref.onClosed,
|
|
77
79
|
onOpened = _ref.onOpened,
|
|
78
80
|
onSelect = _ref.onSelect;
|
|
@@ -380,7 +382,9 @@ var Select = function Select(_ref) {
|
|
|
380
382
|
return /*#__PURE__*/React.createElement("div", {
|
|
381
383
|
className: cn('list', [classes.list])
|
|
382
384
|
}, /*#__PURE__*/React.createElement("div", {
|
|
383
|
-
className: cn('list-inner',
|
|
385
|
+
className: cn('list-inner', {
|
|
386
|
+
"short": shortList
|
|
387
|
+
}, [classes.listInner]),
|
|
384
388
|
ref: itemWrapperNode
|
|
385
389
|
}, currentItems.map(function (_ref3, i) {
|
|
386
390
|
var title = _ref3.title,
|
|
@@ -471,6 +475,7 @@ Select.propTypes = {
|
|
|
471
475
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
472
476
|
paddings: PropTypes.oneOf(Object.values(SelectItemsPaddings))
|
|
473
477
|
})).isRequired,
|
|
478
|
+
shortList: PropTypes.bool,
|
|
474
479
|
onSelect: PropTypes.func,
|
|
475
480
|
onOpened: PropTypes.func,
|
|
476
481
|
onClosed: PropTypes.func
|
|
@@ -38,12 +38,8 @@ var cn = cnCreate('mfui-tabs');
|
|
|
38
38
|
|
|
39
39
|
var Tabs = function Tabs(_ref) {
|
|
40
40
|
var className = _ref.className,
|
|
41
|
-
_ref$classes = _ref.classes
|
|
42
|
-
|
|
43
|
-
var rootClass = _ref$classes.root,
|
|
44
|
-
innerIndentsClass = _ref$classes.innerIndents,
|
|
45
|
-
tabClass = _ref$classes.tab,
|
|
46
|
-
activeTabClass = _ref$classes.activeTab,
|
|
41
|
+
_ref$classes = _ref.classes,
|
|
42
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
47
43
|
_ref$size = _ref.size,
|
|
48
44
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
49
45
|
_ref$tabColorTheme = _ref.tabColorTheme,
|
|
@@ -287,15 +283,15 @@ var Tabs = function Tabs(_ref) {
|
|
|
287
283
|
renderTabWrapper = _child$props.renderTabWrapper,
|
|
288
284
|
data = _child$props.dataAttrs;
|
|
289
285
|
var tab = renderTab(i, title, icon, href, data === null || data === void 0 ? void 0 : data.inner);
|
|
290
|
-
var activeTabClassName = currentIndex === i ?
|
|
286
|
+
var activeTabClassName = currentIndex === i ? classes === null || classes === void 0 ? void 0 : classes.activeTab : undefined;
|
|
291
287
|
return /*#__PURE__*/React.createElement(SwiperSlide, {
|
|
292
288
|
className: cn('slide')
|
|
293
289
|
}, /*#__PURE__*/React.createElement("div", _extends({
|
|
294
|
-
className: cn('tab', [
|
|
290
|
+
className: cn('tab', [classes === null || classes === void 0 ? void 0 : classes.tab, activeTabClassName]),
|
|
295
291
|
ref: setTabRef
|
|
296
292
|
}, filterDataAttrs(data === null || data === void 0 ? void 0 : data.root, i + 1)), renderTabWrapper ? renderTabWrapper(tab) : tab));
|
|
297
293
|
});
|
|
298
|
-
}, [renderTab, children,
|
|
294
|
+
}, [renderTab, children, classes === null || classes === void 0 ? void 0 : classes.activeTab, currentIndex, setTabRef, classes === null || classes === void 0 ? void 0 : classes.tab]);
|
|
299
295
|
var renderPanels = React.useCallback(function () {
|
|
300
296
|
return React.Children.map(children, function (child, i) {
|
|
301
297
|
var panel = child.props.children;
|
|
@@ -364,19 +360,19 @@ var Tabs = function Tabs(_ref) {
|
|
|
364
360
|
size: size,
|
|
365
361
|
'tab-color': tabColorTheme,
|
|
366
362
|
'h-align': align,
|
|
367
|
-
indents: !
|
|
363
|
+
indents: !(classes === null || classes === void 0 ? void 0 : classes.innerIndents),
|
|
368
364
|
sticky: isSticky,
|
|
369
365
|
'auto-width': autoWidth
|
|
370
|
-
}, [className,
|
|
366
|
+
}, [className, classes.root]),
|
|
371
367
|
ref: rootRef
|
|
372
368
|
}), /*#__PURE__*/React.createElement("div", {
|
|
373
|
-
className: cn('wrapper'),
|
|
369
|
+
className: cn('wrapper', [classes === null || classes === void 0 ? void 0 : classes.wrapper]),
|
|
374
370
|
ref: tabListRef,
|
|
375
371
|
style: {
|
|
376
372
|
height: tabListHeight
|
|
377
373
|
}
|
|
378
374
|
}, /*#__PURE__*/React.createElement("div", {
|
|
379
|
-
className: cn('swiper-wrapper'),
|
|
375
|
+
className: cn('swiper-wrapper', [classes === null || classes === void 0 ? void 0 : classes.swiperWrapper]),
|
|
380
376
|
style: {
|
|
381
377
|
paddingLeft: stickyOffset.left,
|
|
382
378
|
paddingRight: stickyOffset.right
|
|
@@ -386,7 +382,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
386
382
|
className: cn('swiper', {
|
|
387
383
|
beginning: isBeginning,
|
|
388
384
|
end: isEnd
|
|
389
|
-
}, [
|
|
385
|
+
}, [classes === null || classes === void 0 ? void 0 : classes.innerIndents]),
|
|
390
386
|
watchOverflow: true,
|
|
391
387
|
slidesPerView: "auto",
|
|
392
388
|
initialSlide: currentIndex,
|
|
@@ -421,6 +417,8 @@ Tabs.propTypes = {
|
|
|
421
417
|
className: PropTypes.string,
|
|
422
418
|
classes: PropTypes.shape({
|
|
423
419
|
root: PropTypes.string,
|
|
420
|
+
wrapper: PropTypes.string,
|
|
421
|
+
swiperWrapper: PropTypes.string,
|
|
424
422
|
innerIndents: PropTypes.string,
|
|
425
423
|
tab: PropTypes.string,
|
|
426
424
|
activeTab: PropTypes.string
|
|
@@ -119,9 +119,8 @@ var TextField = function TextField(_ref) {
|
|
|
119
119
|
inputRef = _ref.inputRef,
|
|
120
120
|
inputMode = _ref.inputMode,
|
|
121
121
|
autoComplete = _ref.autoComplete,
|
|
122
|
-
_ref$classes = _ref.classes
|
|
123
|
-
|
|
124
|
-
var input = _ref$classes.input,
|
|
122
|
+
_ref$classes = _ref.classes,
|
|
123
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
125
124
|
dataAttrs = _ref.dataAttrs;
|
|
126
125
|
|
|
127
126
|
var _useState = useState(true),
|
|
@@ -313,7 +312,7 @@ var TextField = function TextField(_ref) {
|
|
|
313
312
|
});
|
|
314
313
|
|
|
315
314
|
var inputParams = _extends(_extends({}, commonParams), {
|
|
316
|
-
className: cn('field', input),
|
|
315
|
+
className: cn('field', classes === null || classes === void 0 ? void 0 : classes.input),
|
|
317
316
|
type: isVisiblePassword ? 'text' : type,
|
|
318
317
|
autoComplete: autoComplete
|
|
319
318
|
});
|
|
@@ -329,7 +328,7 @@ var TextField = function TextField(_ref) {
|
|
|
329
328
|
type: textareaType,
|
|
330
329
|
textarea: textarea,
|
|
331
330
|
resized: isTextareaResizeFocused
|
|
332
|
-
}, input)
|
|
331
|
+
}, classes === null || classes === void 0 ? void 0 : classes.input)
|
|
333
332
|
});
|
|
334
333
|
|
|
335
334
|
var getFieldNode = function getFieldNode(node) {
|
|
@@ -377,7 +376,7 @@ var TextField = function TextField(_ref) {
|
|
|
377
376
|
var currentLabel = label || actualPlaceholder;
|
|
378
377
|
return /*#__PURE__*/React.createElement("label", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.label), {
|
|
379
378
|
htmlFor: id,
|
|
380
|
-
className: cn('label'),
|
|
379
|
+
className: cn('label', [classes === null || classes === void 0 ? void 0 : classes.label]),
|
|
381
380
|
ref: labelRef
|
|
382
381
|
}), currentLabel, required && /*#__PURE__*/React.createElement("span", {
|
|
383
382
|
className: cn('require-mark')
|
|
@@ -494,6 +493,7 @@ TextField.propTypes = {
|
|
|
494
493
|
onCustomIconClick: PropTypes.func,
|
|
495
494
|
inputRef: PropTypes.func,
|
|
496
495
|
classes: PropTypes.shape({
|
|
496
|
+
label: PropTypes.string,
|
|
497
497
|
input: PropTypes.string
|
|
498
498
|
}),
|
|
499
499
|
dataAttrs: PropTypes.shape({
|
|
@@ -132,7 +132,11 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
132
132
|
return isTouchDevice ? TOUCH_KEY : MOUSE_KEY;
|
|
133
133
|
}, [isTouchDevice]);
|
|
134
134
|
var triggerEventName = useMemo(function () {
|
|
135
|
-
|
|
135
|
+
if (triggerEvent === TriggerEvent.CONTROLLED || !isTouchDevice) {
|
|
136
|
+
return triggerEvent;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
return TriggerEvent.CLICK;
|
|
136
140
|
}, [isTouchDevice, triggerEvent]);
|
|
137
141
|
var handleMouseEnter = useCallback(function (e) {
|
|
138
142
|
if (!isOpen) {
|
|
@@ -56,6 +56,8 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
56
56
|
notFoundText?: string;
|
|
57
57
|
/** Массив элементов селекта */
|
|
58
58
|
items: Array<ISelectItem<T>>;
|
|
59
|
+
/** Отображать короткий выпадающий список */
|
|
60
|
+
shortList?: boolean;
|
|
59
61
|
/** Дополнительный класс корневого элемента */
|
|
60
62
|
className?: string;
|
|
61
63
|
/** Дополнительные классы для внутренних элементов */
|
|
@@ -88,7 +90,7 @@ export interface ISelectProps<T extends SelectItemValueType> {
|
|
|
88
90
|
onClosed?: () => void;
|
|
89
91
|
}
|
|
90
92
|
declare const Select: {
|
|
91
|
-
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
93
|
+
<T extends string | number | undefined>({ type, disabled, verification, noticeText, label, labelId, required, className, classes, dataAttrs, notFoundText, items, placeholder, currentValue, shortList, onClosed, onOpened, onSelect, }: ISelectProps<T>): JSX.Element;
|
|
92
94
|
propTypes: {
|
|
93
95
|
type: PropTypes.Requireable<"classic" | "combobox">;
|
|
94
96
|
label: PropTypes.Requireable<string>;
|
|
@@ -144,6 +146,7 @@ declare const Select: {
|
|
|
144
146
|
value: PropTypes.Validator<string | number>;
|
|
145
147
|
paddings: PropTypes.Requireable<"small" | "large">;
|
|
146
148
|
}>> | null | undefined)[]>;
|
|
149
|
+
shortList: PropTypes.Requireable<boolean>;
|
|
147
150
|
onSelect: PropTypes.Requireable<(...args: any[]) => any>;
|
|
148
151
|
onOpened: PropTypes.Requireable<(...args: any[]) => any>;
|
|
149
152
|
onClosed: PropTypes.Requireable<(...args: any[]) => any>;
|
|
@@ -108,6 +108,8 @@ var Select = function Select(_ref) {
|
|
|
108
108
|
items = _ref.items,
|
|
109
109
|
placeholder = _ref.placeholder,
|
|
110
110
|
currentValue = _ref.currentValue,
|
|
111
|
+
_ref$shortList = _ref.shortList,
|
|
112
|
+
shortList = _ref$shortList === void 0 ? false : _ref$shortList,
|
|
111
113
|
onClosed = _ref.onClosed,
|
|
112
114
|
onOpened = _ref.onOpened,
|
|
113
115
|
onSelect = _ref.onSelect;
|
|
@@ -415,7 +417,9 @@ var Select = function Select(_ref) {
|
|
|
415
417
|
return /*#__PURE__*/React.createElement("div", {
|
|
416
418
|
className: cn('list', [classes.list])
|
|
417
419
|
}, /*#__PURE__*/React.createElement("div", {
|
|
418
|
-
className: cn('list-inner',
|
|
420
|
+
className: cn('list-inner', {
|
|
421
|
+
"short": shortList
|
|
422
|
+
}, [classes.listInner]),
|
|
419
423
|
ref: itemWrapperNode
|
|
420
424
|
}, currentItems.map(function (_ref3, i) {
|
|
421
425
|
var title = _ref3.title,
|
|
@@ -506,6 +510,7 @@ Select.propTypes = {
|
|
|
506
510
|
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
507
511
|
paddings: PropTypes.oneOf(Object.values(SelectItemsPaddings))
|
|
508
512
|
})).isRequired,
|
|
513
|
+
shortList: PropTypes.bool,
|
|
509
514
|
onSelect: PropTypes.func,
|
|
510
515
|
onOpened: PropTypes.func,
|
|
511
516
|
onClosed: PropTypes.func
|
|
@@ -68,12 +68,8 @@ var cn = (0, _uiHelpers.cnCreate)('mfui-tabs');
|
|
|
68
68
|
|
|
69
69
|
var Tabs = function Tabs(_ref) {
|
|
70
70
|
var className = _ref.className,
|
|
71
|
-
_ref$classes = _ref.classes
|
|
72
|
-
|
|
73
|
-
var rootClass = _ref$classes.root,
|
|
74
|
-
innerIndentsClass = _ref$classes.innerIndents,
|
|
75
|
-
tabClass = _ref$classes.tab,
|
|
76
|
-
activeTabClass = _ref$classes.activeTab,
|
|
71
|
+
_ref$classes = _ref.classes,
|
|
72
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
77
73
|
_ref$size = _ref.size,
|
|
78
74
|
size = _ref$size === void 0 ? 'medium' : _ref$size,
|
|
79
75
|
_ref$tabColorTheme = _ref.tabColorTheme,
|
|
@@ -316,15 +312,15 @@ var Tabs = function Tabs(_ref) {
|
|
|
316
312
|
renderTabWrapper = _child$props.renderTabWrapper,
|
|
317
313
|
data = _child$props.dataAttrs;
|
|
318
314
|
var tab = renderTab(i, title, icon, href, data === null || data === void 0 ? void 0 : data.inner);
|
|
319
|
-
var activeTabClassName = currentIndex === i ?
|
|
315
|
+
var activeTabClassName = currentIndex === i ? classes === null || classes === void 0 ? void 0 : classes.activeTab : undefined;
|
|
320
316
|
return /*#__PURE__*/React.createElement(_react2.SwiperSlide, {
|
|
321
317
|
className: cn('slide')
|
|
322
318
|
}, /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
|
|
323
|
-
className: cn('tab', [
|
|
319
|
+
className: cn('tab', [classes === null || classes === void 0 ? void 0 : classes.tab, activeTabClassName]),
|
|
324
320
|
ref: setTabRef
|
|
325
321
|
}, (0, _uiHelpers.filterDataAttrs)(data === null || data === void 0 ? void 0 : data.root, i + 1)), renderTabWrapper ? renderTabWrapper(tab) : tab));
|
|
326
322
|
});
|
|
327
|
-
}, [renderTab, children,
|
|
323
|
+
}, [renderTab, children, classes === null || classes === void 0 ? void 0 : classes.activeTab, currentIndex, setTabRef, classes === null || classes === void 0 ? void 0 : classes.tab]);
|
|
328
324
|
var renderPanels = React.useCallback(function () {
|
|
329
325
|
return React.Children.map(children, function (child, i) {
|
|
330
326
|
var panel = child.props.children;
|
|
@@ -393,19 +389,19 @@ var Tabs = function Tabs(_ref) {
|
|
|
393
389
|
size: size,
|
|
394
390
|
'tab-color': tabColorTheme,
|
|
395
391
|
'h-align': align,
|
|
396
|
-
indents: !
|
|
392
|
+
indents: !(classes === null || classes === void 0 ? void 0 : classes.innerIndents),
|
|
397
393
|
sticky: isSticky,
|
|
398
394
|
'auto-width': autoWidth
|
|
399
|
-
}, [className,
|
|
395
|
+
}, [className, classes.root]),
|
|
400
396
|
ref: rootRef
|
|
401
397
|
}), /*#__PURE__*/React.createElement("div", {
|
|
402
|
-
className: cn('wrapper'),
|
|
398
|
+
className: cn('wrapper', [classes === null || classes === void 0 ? void 0 : classes.wrapper]),
|
|
403
399
|
ref: tabListRef,
|
|
404
400
|
style: {
|
|
405
401
|
height: tabListHeight
|
|
406
402
|
}
|
|
407
403
|
}, /*#__PURE__*/React.createElement("div", {
|
|
408
|
-
className: cn('swiper-wrapper'),
|
|
404
|
+
className: cn('swiper-wrapper', [classes === null || classes === void 0 ? void 0 : classes.swiperWrapper]),
|
|
409
405
|
style: {
|
|
410
406
|
paddingLeft: stickyOffset.left,
|
|
411
407
|
paddingRight: stickyOffset.right
|
|
@@ -415,7 +411,7 @@ var Tabs = function Tabs(_ref) {
|
|
|
415
411
|
className: cn('swiper', {
|
|
416
412
|
beginning: isBeginning,
|
|
417
413
|
end: isEnd
|
|
418
|
-
}, [
|
|
414
|
+
}, [classes === null || classes === void 0 ? void 0 : classes.innerIndents]),
|
|
419
415
|
watchOverflow: true,
|
|
420
416
|
slidesPerView: "auto",
|
|
421
417
|
initialSlide: currentIndex,
|
|
@@ -450,6 +446,8 @@ Tabs.propTypes = {
|
|
|
450
446
|
className: _propTypes["default"].string,
|
|
451
447
|
classes: _propTypes["default"].shape({
|
|
452
448
|
root: _propTypes["default"].string,
|
|
449
|
+
wrapper: _propTypes["default"].string,
|
|
450
|
+
swiperWrapper: _propTypes["default"].string,
|
|
453
451
|
innerIndents: _propTypes["default"].string,
|
|
454
452
|
tab: _propTypes["default"].string,
|
|
455
453
|
activeTab: _propTypes["default"].string
|
|
@@ -147,9 +147,8 @@ var TextField = function TextField(_ref) {
|
|
|
147
147
|
inputRef = _ref.inputRef,
|
|
148
148
|
inputMode = _ref.inputMode,
|
|
149
149
|
autoComplete = _ref.autoComplete,
|
|
150
|
-
_ref$classes = _ref.classes
|
|
151
|
-
|
|
152
|
-
var input = _ref$classes.input,
|
|
150
|
+
_ref$classes = _ref.classes,
|
|
151
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
153
152
|
dataAttrs = _ref.dataAttrs;
|
|
154
153
|
|
|
155
154
|
var _useState = (0, React.useState)(true),
|
|
@@ -339,7 +338,7 @@ var TextField = function TextField(_ref) {
|
|
|
339
338
|
inputMode: inputMode
|
|
340
339
|
});
|
|
341
340
|
var inputParams = (0, _extends2["default"])((0, _extends2["default"])({}, commonParams), {
|
|
342
|
-
className: cn('field', input),
|
|
341
|
+
className: cn('field', classes === null || classes === void 0 ? void 0 : classes.input),
|
|
343
342
|
type: isVisiblePassword ? 'text' : type,
|
|
344
343
|
autoComplete: autoComplete
|
|
345
344
|
});
|
|
@@ -353,7 +352,7 @@ var TextField = function TextField(_ref) {
|
|
|
353
352
|
type: textareaType,
|
|
354
353
|
textarea: textarea,
|
|
355
354
|
resized: isTextareaResizeFocused
|
|
356
|
-
}, input)
|
|
355
|
+
}, classes === null || classes === void 0 ? void 0 : classes.input)
|
|
357
356
|
});
|
|
358
357
|
|
|
359
358
|
var getFieldNode = function getFieldNode(node) {
|
|
@@ -401,7 +400,7 @@ var TextField = function TextField(_ref) {
|
|
|
401
400
|
var currentLabel = label || actualPlaceholder;
|
|
402
401
|
return /*#__PURE__*/React.createElement("label", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.label), {
|
|
403
402
|
htmlFor: id,
|
|
404
|
-
className: cn('label'),
|
|
403
|
+
className: cn('label', [classes === null || classes === void 0 ? void 0 : classes.label]),
|
|
405
404
|
ref: labelRef
|
|
406
405
|
}), currentLabel, required && /*#__PURE__*/React.createElement("span", {
|
|
407
406
|
className: cn('require-mark')
|
|
@@ -518,6 +517,7 @@ TextField.propTypes = {
|
|
|
518
517
|
onCustomIconClick: PropTypes.func,
|
|
519
518
|
inputRef: PropTypes.func,
|
|
520
519
|
classes: PropTypes.shape({
|
|
520
|
+
label: PropTypes.string,
|
|
521
521
|
input: PropTypes.string
|
|
522
522
|
}),
|
|
523
523
|
dataAttrs: PropTypes.shape({
|
|
@@ -161,7 +161,11 @@ var Tooltip = function Tooltip(_ref) {
|
|
|
161
161
|
return isTouchDevice ? TOUCH_KEY : MOUSE_KEY;
|
|
162
162
|
}, [isTouchDevice]);
|
|
163
163
|
var triggerEventName = (0, _react.useMemo)(function () {
|
|
164
|
-
|
|
164
|
+
if (triggerEvent === TriggerEvent.CONTROLLED || !isTouchDevice) {
|
|
165
|
+
return triggerEvent;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
return TriggerEvent.CLICK;
|
|
165
169
|
}, [isTouchDevice, triggerEvent]);
|
|
166
170
|
var handleMouseEnter = (0, _react.useCallback)(function (e) {
|
|
167
171
|
if (!isOpen) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"styles"
|
|
@@ -97,5 +97,5 @@
|
|
|
97
97
|
"react-popper": "^2.2.3",
|
|
98
98
|
"swiper": "^6.5.6"
|
|
99
99
|
},
|
|
100
|
-
"gitHead": "
|
|
100
|
+
"gitHead": "ab68c8392f13f494977b7a6e44104f9ae1b1f64b"
|
|
101
101
|
}
|