@megafon/ui-core 8.15.1 → 8.16.1
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/es/components/Chips/Chips.d.ts +4 -0
- package/dist/es/components/Chips/Chips.js +8 -0
- package/dist/es/components/Chips/components/ChipsScrollPanel/ChipsScrollPanel.d.ts +8 -0
- package/dist/es/components/Chips/components/ChipsScrollPanel/ChipsScrollPanel.js +10 -7
- package/dist/es/components/Modal/_ModalContent/ModalContent.js +2 -0
- package/dist/lib/components/Chips/Chips.d.ts +4 -0
- package/dist/lib/components/Chips/Chips.js +8 -0
- package/dist/lib/components/Chips/components/ChipsScrollPanel/ChipsScrollPanel.d.ts +8 -0
- package/dist/lib/components/Chips/components/ChipsScrollPanel/ChipsScrollPanel.js +9 -6
- package/dist/lib/components/Modal/_ModalContent/ModalContent.js +2 -0
- package/package.json +4 -4
|
@@ -33,12 +33,16 @@ export interface IChipsProps {
|
|
|
33
33
|
root?: string;
|
|
34
34
|
dropdown?: string;
|
|
35
35
|
dropdownList?: string;
|
|
36
|
+
scroll?: string;
|
|
37
|
+
scrollInner?: string;
|
|
36
38
|
};
|
|
37
39
|
/** Дополнительные data атрибуты к внутренним элементам */
|
|
38
40
|
dataAttrs?: {
|
|
39
41
|
root?: Record<string, string>;
|
|
40
42
|
dropdown?: Record<string, string>;
|
|
41
43
|
dropdownList?: Record<string, string>;
|
|
44
|
+
scroll?: Record<string, string>;
|
|
45
|
+
scrollInner?: Record<string, string>;
|
|
42
46
|
};
|
|
43
47
|
}
|
|
44
48
|
declare const Chips: React.FC<IChipsProps>;
|
|
@@ -76,6 +76,14 @@ var Chips = function Chips(_ref) {
|
|
|
76
76
|
var renderItems = function renderItems() {
|
|
77
77
|
if (isScrollableMode) {
|
|
78
78
|
return /*#__PURE__*/React.createElement(ChipsScrollPanel, {
|
|
79
|
+
classes: {
|
|
80
|
+
root: classes.scroll,
|
|
81
|
+
inner: classes.scrollInner
|
|
82
|
+
},
|
|
83
|
+
dataAttrs: {
|
|
84
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.scroll,
|
|
85
|
+
inner: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.scrollInner
|
|
86
|
+
},
|
|
79
87
|
value: selectedId,
|
|
80
88
|
items: visibleItems,
|
|
81
89
|
color: color,
|
|
@@ -2,6 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
import { ChipColorsType, ChipIdType, IChipProps } from '../../Chip';
|
|
3
3
|
import './ChipsScrollPanel.scss';
|
|
4
4
|
export interface IChipsScrollPanelProps {
|
|
5
|
+
classes?: {
|
|
6
|
+
root?: string;
|
|
7
|
+
inner?: string;
|
|
8
|
+
};
|
|
9
|
+
dataAttrs?: {
|
|
10
|
+
root?: Record<string, string>;
|
|
11
|
+
inner?: Record<string, string>;
|
|
12
|
+
};
|
|
5
13
|
value?: ChipIdType;
|
|
6
14
|
items: IChipProps[];
|
|
7
15
|
color: ChipColorsType;
|
|
@@ -12,13 +12,16 @@ var __rest = this && this.__rest || function (s, e) {
|
|
|
12
12
|
return t;
|
|
13
13
|
};
|
|
14
14
|
import * as React from 'react';
|
|
15
|
-
import { cnCreate } from '@megafon/ui-helpers';
|
|
15
|
+
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
16
16
|
import Chip from "../../Chip";
|
|
17
17
|
import "./ChipsScrollPanel.css";
|
|
18
18
|
var HALF_DIVIDER = 2;
|
|
19
19
|
var cn = cnCreate('mfui-chips-scroll-panel');
|
|
20
20
|
var ChipsScrollPanel = function ChipsScrollPanel(_ref) {
|
|
21
|
-
var
|
|
21
|
+
var _ref$classes = _ref.classes,
|
|
22
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
23
|
+
dataAttrs = _ref.dataAttrs,
|
|
24
|
+
value = _ref.value,
|
|
22
25
|
items = _ref.items,
|
|
23
26
|
color = _ref.color,
|
|
24
27
|
onClick = _ref.onClick;
|
|
@@ -57,13 +60,13 @@ var ChipsScrollPanel = function ChipsScrollPanel(_ref) {
|
|
|
57
60
|
setCurrentValue(value);
|
|
58
61
|
}
|
|
59
62
|
}, [value, currentValue, scrollToActiveItem]);
|
|
60
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
61
|
-
className: cn(),
|
|
63
|
+
return /*#__PURE__*/React.createElement("div", _extends({
|
|
64
|
+
className: cn([classes.root]),
|
|
62
65
|
ref: containerRef
|
|
63
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
64
|
-
className: cn('inner'),
|
|
66
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", _extends({
|
|
67
|
+
className: cn('inner', [classes.inner]),
|
|
65
68
|
tabIndex: -1
|
|
66
|
-
}, items.map(function (_a) {
|
|
69
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner)), items.map(function (_a) {
|
|
67
70
|
var id = _a.id,
|
|
68
71
|
children = _a.children,
|
|
69
72
|
rest = __rest(_a, ["id", "children"]);
|
|
@@ -61,6 +61,7 @@ var ModalContent = function ModalContent(_ref) {
|
|
|
61
61
|
footerRef = _ref$refs.footerRef,
|
|
62
62
|
containerInnerRef = _ref$refs.containerInnerRef,
|
|
63
63
|
containerBodyRef = _ref$refs.containerBodyRef,
|
|
64
|
+
containerWrapRef = _ref$refs.containerWrapRef,
|
|
64
65
|
isEnabledNativeScroll = _ref.isEnabledNativeScroll,
|
|
65
66
|
isDisabledBackgroundClick = _ref.isDisabledBackgroundClick,
|
|
66
67
|
isMobile = _ref.isMobile,
|
|
@@ -173,6 +174,7 @@ var ModalContent = function ModalContent(_ref) {
|
|
|
173
174
|
className: cn('background', classes === null || classes === void 0 ? void 0 : classes.background),
|
|
174
175
|
onClick: isDisabledBackgroundClick ? undefined : onPopupClose
|
|
175
176
|
})), /*#__PURE__*/React.createElement(CSSTransition, {
|
|
177
|
+
nodeRef: containerWrapRef,
|
|
176
178
|
"in": isBottomTransitionIn,
|
|
177
179
|
timeout: 190,
|
|
178
180
|
onExited: onTransitionExited
|
|
@@ -33,12 +33,16 @@ export interface IChipsProps {
|
|
|
33
33
|
root?: string;
|
|
34
34
|
dropdown?: string;
|
|
35
35
|
dropdownList?: string;
|
|
36
|
+
scroll?: string;
|
|
37
|
+
scrollInner?: string;
|
|
36
38
|
};
|
|
37
39
|
/** Дополнительные data атрибуты к внутренним элементам */
|
|
38
40
|
dataAttrs?: {
|
|
39
41
|
root?: Record<string, string>;
|
|
40
42
|
dropdown?: Record<string, string>;
|
|
41
43
|
dropdownList?: Record<string, string>;
|
|
44
|
+
scroll?: Record<string, string>;
|
|
45
|
+
scrollInner?: Record<string, string>;
|
|
42
46
|
};
|
|
43
47
|
}
|
|
44
48
|
declare const Chips: React.FC<IChipsProps>;
|
|
@@ -85,6 +85,14 @@ var Chips = function Chips(_ref) {
|
|
|
85
85
|
var renderItems = function renderItems() {
|
|
86
86
|
if (isScrollableMode) {
|
|
87
87
|
return /*#__PURE__*/React.createElement(_ChipsScrollPanel["default"], {
|
|
88
|
+
classes: {
|
|
89
|
+
root: classes.scroll,
|
|
90
|
+
inner: classes.scrollInner
|
|
91
|
+
},
|
|
92
|
+
dataAttrs: {
|
|
93
|
+
root: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.scroll,
|
|
94
|
+
inner: dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.scrollInner
|
|
95
|
+
},
|
|
88
96
|
value: selectedId,
|
|
89
97
|
items: visibleItems,
|
|
90
98
|
color: color,
|
|
@@ -2,6 +2,14 @@ import * as React from 'react';
|
|
|
2
2
|
import { ChipColorsType, ChipIdType, IChipProps } from '../../Chip';
|
|
3
3
|
import './ChipsScrollPanel.scss';
|
|
4
4
|
export interface IChipsScrollPanelProps {
|
|
5
|
+
classes?: {
|
|
6
|
+
root?: string;
|
|
7
|
+
inner?: string;
|
|
8
|
+
};
|
|
9
|
+
dataAttrs?: {
|
|
10
|
+
root?: Record<string, string>;
|
|
11
|
+
inner?: Record<string, string>;
|
|
12
|
+
};
|
|
5
13
|
value?: ChipIdType;
|
|
6
14
|
items: IChipProps[];
|
|
7
15
|
color: ChipColorsType;
|
|
@@ -27,7 +27,10 @@ var __rest = void 0 && (void 0).__rest || function (s, e) {
|
|
|
27
27
|
var HALF_DIVIDER = 2;
|
|
28
28
|
var cn = (0, _uiHelpers.cnCreate)('mfui-chips-scroll-panel');
|
|
29
29
|
var ChipsScrollPanel = function ChipsScrollPanel(_ref) {
|
|
30
|
-
var
|
|
30
|
+
var _ref$classes = _ref.classes,
|
|
31
|
+
classes = _ref$classes === void 0 ? {} : _ref$classes,
|
|
32
|
+
dataAttrs = _ref.dataAttrs,
|
|
33
|
+
value = _ref.value,
|
|
31
34
|
items = _ref.items,
|
|
32
35
|
color = _ref.color,
|
|
33
36
|
onClick = _ref.onClick;
|
|
@@ -66,13 +69,13 @@ var ChipsScrollPanel = function ChipsScrollPanel(_ref) {
|
|
|
66
69
|
setCurrentValue(value);
|
|
67
70
|
}
|
|
68
71
|
}, [value, currentValue, scrollToActiveItem]);
|
|
69
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
70
|
-
className: cn(),
|
|
72
|
+
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
|
|
73
|
+
className: cn([classes.root]),
|
|
71
74
|
ref: containerRef
|
|
72
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
73
|
-
className: cn('inner'),
|
|
75
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({
|
|
76
|
+
className: cn('inner', [classes.inner]),
|
|
74
77
|
tabIndex: -1
|
|
75
|
-
}, items.map(function (_a) {
|
|
78
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.inner)), items.map(function (_a) {
|
|
76
79
|
var id = _a.id,
|
|
77
80
|
children = _a.children,
|
|
78
81
|
rest = __rest(_a, ["id", "children"]);
|
|
@@ -70,6 +70,7 @@ var ModalContent = function ModalContent(_ref) {
|
|
|
70
70
|
footerRef = _ref$refs.footerRef,
|
|
71
71
|
containerInnerRef = _ref$refs.containerInnerRef,
|
|
72
72
|
containerBodyRef = _ref$refs.containerBodyRef,
|
|
73
|
+
containerWrapRef = _ref$refs.containerWrapRef,
|
|
73
74
|
isEnabledNativeScroll = _ref.isEnabledNativeScroll,
|
|
74
75
|
isDisabledBackgroundClick = _ref.isDisabledBackgroundClick,
|
|
75
76
|
isMobile = _ref.isMobile,
|
|
@@ -182,6 +183,7 @@ var ModalContent = function ModalContent(_ref) {
|
|
|
182
183
|
className: cn('background', classes === null || classes === void 0 ? void 0 : classes.background),
|
|
183
184
|
onClick: isDisabledBackgroundClick ? undefined : onPopupClose
|
|
184
185
|
})), /*#__PURE__*/React.createElement(_reactTransitionGroup.CSSTransition, {
|
|
186
|
+
nodeRef: containerWrapRef,
|
|
185
187
|
"in": isBottomTransitionIn,
|
|
186
188
|
timeout: 190,
|
|
187
189
|
onExited: onTransitionExited
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.16.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"styles"
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
"@babel/preset-env": "^7.8.6",
|
|
51
51
|
"@babel/preset-react": "^7.8.3",
|
|
52
52
|
"@babel/preset-typescript": "^7.8.3",
|
|
53
|
-
"@megafon/ui-icons": "^3.14.
|
|
53
|
+
"@megafon/ui-icons": "^3.14.1",
|
|
54
54
|
"@svgr/core": "^2.4.1",
|
|
55
55
|
"@testing-library/jest-dom": "^6.5.0",
|
|
56
56
|
"@testing-library/react": "^16.0.1",
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@datepicker-react/hooks": "^2.7.0",
|
|
90
90
|
"@dnd-kit/core": "^6.1.0",
|
|
91
91
|
"@dnd-kit/sortable": "^8.0.0",
|
|
92
|
-
"@megafon/ui-helpers": "^4.0
|
|
92
|
+
"@megafon/ui-helpers": "^4.1.0",
|
|
93
93
|
"@mona-health/react-input-mask": "^3.0.3",
|
|
94
94
|
"@popperjs/core": "^2.11.8",
|
|
95
95
|
"core-js": "^3.6.4",
|
|
@@ -104,5 +104,5 @@
|
|
|
104
104
|
"simplebar-react": "^3.2.5",
|
|
105
105
|
"swiper": "^11.1.1"
|
|
106
106
|
},
|
|
107
|
-
"gitHead": "
|
|
107
|
+
"gitHead": "c3fa882b11bf3f456e960ed6c0e55a21116f1620"
|
|
108
108
|
}
|