@megafon/ui-core 4.13.0 → 4.14.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/CHANGELOG.md +25 -0
- package/dist/es/components/Button/Button.js +1 -0
- package/dist/es/components/Carousel/Carousel.css +1 -1
- package/dist/es/components/Preloader/Preloader.d.ts +2 -0
- package/dist/es/components/Preloader/Preloader.js +8 -2
- package/dist/lib/components/Button/Button.js +1 -0
- package/dist/lib/components/Carousel/Carousel.css +1 -1
- package/dist/lib/components/Preloader/Preloader.d.ts +2 -0
- package/dist/lib/components/Preloader/Preloader.js +8 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,31 @@
|
|
|
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.14.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.14.0...@megafon/ui-core@4.14.1) (2023-03-15)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @megafon/ui-core
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
# [4.14.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.13.0...@megafon/ui-core@4.14.0) (2023-03-07)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Bug Fixes
|
|
18
|
+
|
|
19
|
+
* **button:** disable delay for loader ([a19c599](https://github.com/MegafonWebLab/megafon-ui/commit/a19c599f884d5dc9d485c56c6c7914e76d1c3fb6))
|
|
20
|
+
|
|
21
|
+
|
|
22
|
+
### Features
|
|
23
|
+
|
|
24
|
+
* **carousel:** fix z-index of naw arrow ([b6b1ae1](https://github.com/MegafonWebLab/megafon-ui/commit/b6b1ae18e8641d8168bc97598df62a1ce0eac1f4))
|
|
25
|
+
* **preloader:** add new prop hasDelay ([356305d](https://github.com/MegafonWebLab/megafon-ui/commit/356305d70451d38e91e638970eb9b597cac86ea7))
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
|
|
6
31
|
# [4.13.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-core@4.12.0...@megafon/ui-core@4.13.0) (2023-02-22)
|
|
7
32
|
|
|
8
33
|
|
|
@@ -157,6 +157,7 @@ var Button = function Button(_ref) {
|
|
|
157
157
|
}, [icon, children]);
|
|
158
158
|
var renderedLoader = React.useMemo(function () {
|
|
159
159
|
return /*#__PURE__*/React.createElement(Preloader, {
|
|
160
|
+
delay: false,
|
|
160
161
|
className: cn('preloader'),
|
|
161
162
|
dataAttrs: {
|
|
162
163
|
root: filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.loader)
|
|
@@ -12,6 +12,8 @@ export declare const PreloaderSizes: {
|
|
|
12
12
|
};
|
|
13
13
|
export declare type PreloaderSizesType = typeof PreloaderSizes[keyof typeof PreloaderSizes];
|
|
14
14
|
export interface IPreloaderProps {
|
|
15
|
+
/** Задержка отрисовки */
|
|
16
|
+
delay?: boolean;
|
|
15
17
|
/** Цветовая тема */
|
|
16
18
|
color?: PreloaderColorsType;
|
|
17
19
|
/** Размер на всех разрешениях экрана */
|
|
@@ -22,6 +22,8 @@ var Preloader = function Preloader(_ref) {
|
|
|
22
22
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
23
23
|
_ref$sizeAll = _ref.sizeAll,
|
|
24
24
|
sizeAll = _ref$sizeAll === void 0 ? 'medium' : _ref$sizeAll,
|
|
25
|
+
_ref$delay = _ref.delay,
|
|
26
|
+
delay = _ref$delay === void 0 ? true : _ref$delay,
|
|
25
27
|
sizeWide = _ref.sizeWide,
|
|
26
28
|
sizeDesktop = _ref.sizeDesktop,
|
|
27
29
|
sizeTablet = _ref.sizeTablet,
|
|
@@ -29,19 +31,23 @@ var Preloader = function Preloader(_ref) {
|
|
|
29
31
|
className = _ref.className,
|
|
30
32
|
dataAttrs = _ref.dataAttrs;
|
|
31
33
|
|
|
32
|
-
var _React$useState = React.useState(
|
|
34
|
+
var _React$useState = React.useState(!delay),
|
|
33
35
|
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
34
36
|
isShowed = _React$useState2[0],
|
|
35
37
|
setIsShowed = _React$useState2[1];
|
|
36
38
|
|
|
37
39
|
React.useEffect(function () {
|
|
40
|
+
if (isShowed) {
|
|
41
|
+
return undefined;
|
|
42
|
+
}
|
|
43
|
+
|
|
38
44
|
var timerId = setTimeout(function () {
|
|
39
45
|
setIsShowed(true);
|
|
40
46
|
}, 250);
|
|
41
47
|
return function () {
|
|
42
48
|
clearTimeout(timerId);
|
|
43
49
|
};
|
|
44
|
-
}, []);
|
|
50
|
+
}, [isShowed]);
|
|
45
51
|
return isShowed ? /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
46
52
|
className: cn({
|
|
47
53
|
color: color,
|
|
@@ -190,6 +190,7 @@ var Button = function Button(_ref) {
|
|
|
190
190
|
|
|
191
191
|
var renderedLoader = _react["default"].useMemo(function () {
|
|
192
192
|
return /*#__PURE__*/_react["default"].createElement(_Preloader["default"], {
|
|
193
|
+
delay: false,
|
|
193
194
|
className: cn('preloader'),
|
|
194
195
|
dataAttrs: {
|
|
195
196
|
root: (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.loader)
|
|
@@ -12,6 +12,8 @@ export declare const PreloaderSizes: {
|
|
|
12
12
|
};
|
|
13
13
|
export declare type PreloaderSizesType = typeof PreloaderSizes[keyof typeof PreloaderSizes];
|
|
14
14
|
export interface IPreloaderProps {
|
|
15
|
+
/** Задержка отрисовки */
|
|
16
|
+
delay?: boolean;
|
|
15
17
|
/** Цветовая тема */
|
|
16
18
|
color?: PreloaderColorsType;
|
|
17
19
|
/** Размер на всех разрешениях экрана */
|
|
@@ -45,6 +45,8 @@ var Preloader = function Preloader(_ref) {
|
|
|
45
45
|
color = _ref$color === void 0 ? 'default' : _ref$color,
|
|
46
46
|
_ref$sizeAll = _ref.sizeAll,
|
|
47
47
|
sizeAll = _ref$sizeAll === void 0 ? 'medium' : _ref$sizeAll,
|
|
48
|
+
_ref$delay = _ref.delay,
|
|
49
|
+
delay = _ref$delay === void 0 ? true : _ref$delay,
|
|
48
50
|
sizeWide = _ref.sizeWide,
|
|
49
51
|
sizeDesktop = _ref.sizeDesktop,
|
|
50
52
|
sizeTablet = _ref.sizeTablet,
|
|
@@ -52,19 +54,23 @@ var Preloader = function Preloader(_ref) {
|
|
|
52
54
|
className = _ref.className,
|
|
53
55
|
dataAttrs = _ref.dataAttrs;
|
|
54
56
|
|
|
55
|
-
var _React$useState = React.useState(
|
|
57
|
+
var _React$useState = React.useState(!delay),
|
|
56
58
|
_React$useState2 = (0, _slicedToArray2["default"])(_React$useState, 2),
|
|
57
59
|
isShowed = _React$useState2[0],
|
|
58
60
|
setIsShowed = _React$useState2[1];
|
|
59
61
|
|
|
60
62
|
React.useEffect(function () {
|
|
63
|
+
if (isShowed) {
|
|
64
|
+
return undefined;
|
|
65
|
+
}
|
|
66
|
+
|
|
61
67
|
var timerId = setTimeout(function () {
|
|
62
68
|
setIsShowed(true);
|
|
63
69
|
}, 250);
|
|
64
70
|
return function () {
|
|
65
71
|
clearTimeout(timerId);
|
|
66
72
|
};
|
|
67
|
-
}, []);
|
|
73
|
+
}, [isShowed]);
|
|
68
74
|
return isShowed ? /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
69
75
|
className: cn({
|
|
70
76
|
color: color,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.14.1",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist",
|
|
6
6
|
"styles"
|
|
@@ -54,7 +54,7 @@
|
|
|
54
54
|
"@babel/preset-env": "^7.8.6",
|
|
55
55
|
"@babel/preset-react": "^7.8.3",
|
|
56
56
|
"@babel/preset-typescript": "^7.8.3",
|
|
57
|
-
"@megafon/ui-icons": "^2.
|
|
57
|
+
"@megafon/ui-icons": "^2.8.0",
|
|
58
58
|
"@svgr/core": "^2.4.1",
|
|
59
59
|
"@testing-library/jest-dom": "5.16.2",
|
|
60
60
|
"@testing-library/react": "12.1.2",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"react-popper": "^2.2.3",
|
|
101
101
|
"swiper": "^6.5.6"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "f4e8d7fc125d61575ec4fb4ce4d111c94a87c18f"
|
|
104
104
|
}
|