@megafon/ui-core 5.9.0 → 5.9.2
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 +23 -0
- package/dist/es/components/Chips/Chips.js +1 -1
- package/dist/es/components/ContentView/ContentView.css +37 -0
- package/dist/es/components/ContentView/ContentView.d.ts +2 -12
- package/dist/es/components/ContentView/ContentView.js +6 -23
- package/dist/es/components/Select/Select.js +1 -1
- package/dist/lib/components/Chips/Chips.js +2 -2
- package/dist/lib/components/ContentView/ContentView.css +37 -0
- package/dist/lib/components/ContentView/ContentView.d.ts +2 -12
- package/dist/lib/components/ContentView/ContentView.js +6 -32
- package/dist/lib/components/Select/Select.js +1 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,29 @@
|
|
|
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
|
+
## [5.9.2](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.9.1...@megafon/ui-core@5.9.2) (2024-04-11)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* **select:** fix focus ([a6fcc29](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/a6fcc295cc53a926c43003c4e1133723e495205e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
## [5.9.1](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.9.0...@megafon/ui-core@5.9.1) (2024-04-09)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
### Bug Fixes
|
|
21
|
+
|
|
22
|
+
* **chips:** fix constant import ([a16067b](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/a16067b2269179491e8f0e38a2c228a1cb2f7ffa))
|
|
23
|
+
* **contentview:** fix image imports ([2170756](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/commit/217075677f6b57712a6fe48cdf443a31e4f86e2c))
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
|
|
27
|
+
|
|
28
|
+
|
|
6
29
|
# [5.9.0](https://hq-gitlab.megafon.ru/site-portal/services/megafon-ui/compare/@megafon/ui-core@5.8.0...@megafon/ui-core@5.9.0) (2024-04-08)
|
|
7
30
|
|
|
8
31
|
|
|
@@ -5,9 +5,9 @@ import "core-js/modules/es.array.map.js";
|
|
|
5
5
|
import "core-js/modules/es.object.values.js";
|
|
6
6
|
import React from 'react';
|
|
7
7
|
import { breakpoints, cnCreate } from '@megafon/ui-helpers';
|
|
8
|
-
import throttleTime from '@megafon/ui-shared/src/constants/throttleTime';
|
|
9
8
|
import throttle from 'lodash.throttle';
|
|
10
9
|
import * as PropTypes from 'prop-types';
|
|
10
|
+
import throttleTime from "../../constants/throttleTime";
|
|
11
11
|
import Chip, { ChipColors, ChipPropType } from "./Chip";
|
|
12
12
|
import ChipsDropdown from "./components/ChipsDropdown";
|
|
13
13
|
import "./Chips.css";
|
|
@@ -5,10 +5,47 @@
|
|
|
5
5
|
text-align: center;
|
|
6
6
|
}
|
|
7
7
|
.mfui-content-view__image {
|
|
8
|
+
display: inline-block;
|
|
8
9
|
max-width: 144px;
|
|
9
10
|
margin-bottom: 24px;
|
|
10
11
|
vertical-align: top;
|
|
11
12
|
}
|
|
13
|
+
.mfui-content-view__bg-image {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
width: 144px;
|
|
16
|
+
height: 144px;
|
|
17
|
+
margin-bottom: 24px;
|
|
18
|
+
vertical-align: top;
|
|
19
|
+
background-repeat: no-repeat;
|
|
20
|
+
background-size: 100%;
|
|
21
|
+
}
|
|
22
|
+
.mfui-content-view__bg-image_type_waiting {
|
|
23
|
+
background-image: url('./i/waiting.png');
|
|
24
|
+
}
|
|
25
|
+
.mfui-content-view__bg-image_type_error {
|
|
26
|
+
background-image: url('./i/error.png');
|
|
27
|
+
}
|
|
28
|
+
.mfui-content-view__bg-image_type_submit {
|
|
29
|
+
background-image: url('./i/submit.png');
|
|
30
|
+
}
|
|
31
|
+
.mfui-content-view__bg-image_type_success {
|
|
32
|
+
background-image: url('./i/success.png');
|
|
33
|
+
}
|
|
34
|
+
.mfui-content-view__bg-image_type_fail {
|
|
35
|
+
background-image: url('./i/fail.png');
|
|
36
|
+
}
|
|
37
|
+
.mfui-content-view__bg-image_type_update {
|
|
38
|
+
background-image: url('./i/update.png');
|
|
39
|
+
}
|
|
40
|
+
.mfui-content-view__bg-image_type_alarm {
|
|
41
|
+
background-image: url('./i/alarm.png');
|
|
42
|
+
}
|
|
43
|
+
.mfui-content-view__bg-image_type_empty {
|
|
44
|
+
background-image: url('./i/empty.png');
|
|
45
|
+
}
|
|
46
|
+
.mfui-content-view__bg-image_type_searchNoResult {
|
|
47
|
+
background-image: url('./i/searchNoResult.png');
|
|
48
|
+
}
|
|
12
49
|
.mfui-content-view__title {
|
|
13
50
|
font-weight: 500;
|
|
14
51
|
font-size: 20px;
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import './ContentView.less';
|
|
3
|
-
declare const imageMap: {
|
|
4
|
-
alarm: any;
|
|
5
|
-
empty: any;
|
|
6
|
-
error: any;
|
|
7
|
-
fail: any;
|
|
8
|
-
searchNoResult: any;
|
|
9
|
-
submit: any;
|
|
10
|
-
success: any;
|
|
11
|
-
update: any;
|
|
12
|
-
waiting: any;
|
|
13
|
-
};
|
|
14
3
|
declare type ElementType = {
|
|
15
4
|
/** Текст */
|
|
16
5
|
text?: string;
|
|
@@ -27,7 +16,7 @@ export interface IContentViewProps {
|
|
|
27
16
|
/** Заголовок */
|
|
28
17
|
title: string;
|
|
29
18
|
/** Тип встроенного изображения */
|
|
30
|
-
type?:
|
|
19
|
+
type?: 'waiting' | 'error' | 'submit' | 'success' | 'fail' | 'update' | 'alarm' | 'empty' | 'searchNoResult';
|
|
31
20
|
/** Значение тега alt для изображения */
|
|
32
21
|
alt?: string;
|
|
33
22
|
/** Ссылка на изображение */
|
|
@@ -43,6 +32,7 @@ export interface IContentViewProps {
|
|
|
43
32
|
root?: Record<string, string>;
|
|
44
33
|
button?: Record<string, string>;
|
|
45
34
|
link?: Record<string, string>;
|
|
35
|
+
bgImage?: Record<string, string>;
|
|
46
36
|
};
|
|
47
37
|
}
|
|
48
38
|
declare const ContentView: React.FC<IContentViewProps>;
|
|
@@ -4,27 +4,7 @@ import * as React from 'react';
|
|
|
4
4
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
|
5
5
|
import * as PropTypes from 'prop-types';
|
|
6
6
|
import Button from "../Button/Button";
|
|
7
|
-
import alarmImg from "./i/alarm.png";
|
|
8
|
-
import emptyImg from "./i/empty.png";
|
|
9
|
-
import errorImg from "./i/error.png";
|
|
10
|
-
import failImg from "./i/fail.png";
|
|
11
|
-
import searchNoResultImg from "./i/searchNoResult.png";
|
|
12
|
-
import submitImg from "./i/submit.png";
|
|
13
|
-
import successImg from "./i/success.png";
|
|
14
|
-
import updateImg from "./i/update.png";
|
|
15
|
-
import waitingImg from "./i/waiting.png";
|
|
16
7
|
import "./ContentView.css";
|
|
17
|
-
var imageMap = {
|
|
18
|
-
alarm: alarmImg,
|
|
19
|
-
empty: emptyImg,
|
|
20
|
-
error: errorImg,
|
|
21
|
-
fail: failImg,
|
|
22
|
-
searchNoResult: searchNoResultImg,
|
|
23
|
-
submit: submitImg,
|
|
24
|
-
success: successImg,
|
|
25
|
-
update: updateImg,
|
|
26
|
-
waiting: waitingImg
|
|
27
|
-
};
|
|
28
8
|
var cn = cnCreate('mfui-content-view');
|
|
29
9
|
|
|
30
10
|
var ContentView = function ContentView(_ref) {
|
|
@@ -39,7 +19,6 @@ var ContentView = function ContentView(_ref) {
|
|
|
39
19
|
isFullscreen = _ref.isFullscreen,
|
|
40
20
|
dataAttrs = _ref.dataAttrs,
|
|
41
21
|
children = _ref.children;
|
|
42
|
-
var imageSrc = type ? imageMap[type] : src;
|
|
43
22
|
var showButtons = !!(buttonParams === null || buttonParams === void 0 ? void 0 : buttonParams.text) || !!(linkParams === null || linkParams === void 0 ? void 0 : linkParams.text);
|
|
44
23
|
return /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
45
24
|
className: cn({
|
|
@@ -47,9 +26,13 @@ var ContentView = function ContentView(_ref) {
|
|
|
47
26
|
}, [className])
|
|
48
27
|
}), /*#__PURE__*/React.createElement("div", {
|
|
49
28
|
className: cn('content')
|
|
50
|
-
}, /*#__PURE__*/React.createElement("
|
|
29
|
+
}, !!type && /*#__PURE__*/React.createElement("div", _extends({}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.bgImage), {
|
|
30
|
+
className: cn('bg-image', {
|
|
31
|
+
type: type
|
|
32
|
+
})
|
|
33
|
+
})), !!src && !type && /*#__PURE__*/React.createElement("img", {
|
|
51
34
|
className: cn('image'),
|
|
52
|
-
src:
|
|
35
|
+
src: src,
|
|
53
36
|
alt: alt
|
|
54
37
|
}), /*#__PURE__*/React.createElement("div", {
|
|
55
38
|
className: cn('title')
|
|
@@ -21,12 +21,12 @@ var _react = _interopRequireDefault(require("react"));
|
|
|
21
21
|
|
|
22
22
|
var _uiHelpers = require("@megafon/ui-helpers");
|
|
23
23
|
|
|
24
|
-
var _throttleTime = _interopRequireDefault(require("@megafon/ui-shared/src/constants/throttleTime"));
|
|
25
|
-
|
|
26
24
|
var _lodash = _interopRequireDefault(require("lodash.throttle"));
|
|
27
25
|
|
|
28
26
|
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
|
29
27
|
|
|
28
|
+
var _throttleTime = _interopRequireDefault(require("../../constants/throttleTime"));
|
|
29
|
+
|
|
30
30
|
var _Chip = _interopRequireWildcard(require("./Chip"));
|
|
31
31
|
|
|
32
32
|
var _ChipsDropdown = _interopRequireDefault(require("./components/ChipsDropdown"));
|
|
@@ -5,10 +5,47 @@
|
|
|
5
5
|
text-align: center;
|
|
6
6
|
}
|
|
7
7
|
.mfui-content-view__image {
|
|
8
|
+
display: inline-block;
|
|
8
9
|
max-width: 144px;
|
|
9
10
|
margin-bottom: 24px;
|
|
10
11
|
vertical-align: top;
|
|
11
12
|
}
|
|
13
|
+
.mfui-content-view__bg-image {
|
|
14
|
+
display: inline-block;
|
|
15
|
+
width: 144px;
|
|
16
|
+
height: 144px;
|
|
17
|
+
margin-bottom: 24px;
|
|
18
|
+
vertical-align: top;
|
|
19
|
+
background-repeat: no-repeat;
|
|
20
|
+
background-size: 100%;
|
|
21
|
+
}
|
|
22
|
+
.mfui-content-view__bg-image_type_waiting {
|
|
23
|
+
background-image: url('./i/waiting.png');
|
|
24
|
+
}
|
|
25
|
+
.mfui-content-view__bg-image_type_error {
|
|
26
|
+
background-image: url('./i/error.png');
|
|
27
|
+
}
|
|
28
|
+
.mfui-content-view__bg-image_type_submit {
|
|
29
|
+
background-image: url('./i/submit.png');
|
|
30
|
+
}
|
|
31
|
+
.mfui-content-view__bg-image_type_success {
|
|
32
|
+
background-image: url('./i/success.png');
|
|
33
|
+
}
|
|
34
|
+
.mfui-content-view__bg-image_type_fail {
|
|
35
|
+
background-image: url('./i/fail.png');
|
|
36
|
+
}
|
|
37
|
+
.mfui-content-view__bg-image_type_update {
|
|
38
|
+
background-image: url('./i/update.png');
|
|
39
|
+
}
|
|
40
|
+
.mfui-content-view__bg-image_type_alarm {
|
|
41
|
+
background-image: url('./i/alarm.png');
|
|
42
|
+
}
|
|
43
|
+
.mfui-content-view__bg-image_type_empty {
|
|
44
|
+
background-image: url('./i/empty.png');
|
|
45
|
+
}
|
|
46
|
+
.mfui-content-view__bg-image_type_searchNoResult {
|
|
47
|
+
background-image: url('./i/searchNoResult.png');
|
|
48
|
+
}
|
|
12
49
|
.mfui-content-view__title {
|
|
13
50
|
font-weight: 500;
|
|
14
51
|
font-size: 20px;
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import './ContentView.less';
|
|
3
|
-
declare const imageMap: {
|
|
4
|
-
alarm: any;
|
|
5
|
-
empty: any;
|
|
6
|
-
error: any;
|
|
7
|
-
fail: any;
|
|
8
|
-
searchNoResult: any;
|
|
9
|
-
submit: any;
|
|
10
|
-
success: any;
|
|
11
|
-
update: any;
|
|
12
|
-
waiting: any;
|
|
13
|
-
};
|
|
14
3
|
declare type ElementType = {
|
|
15
4
|
/** Текст */
|
|
16
5
|
text?: string;
|
|
@@ -27,7 +16,7 @@ export interface IContentViewProps {
|
|
|
27
16
|
/** Заголовок */
|
|
28
17
|
title: string;
|
|
29
18
|
/** Тип встроенного изображения */
|
|
30
|
-
type?:
|
|
19
|
+
type?: 'waiting' | 'error' | 'submit' | 'success' | 'fail' | 'update' | 'alarm' | 'empty' | 'searchNoResult';
|
|
31
20
|
/** Значение тега alt для изображения */
|
|
32
21
|
alt?: string;
|
|
33
22
|
/** Ссылка на изображение */
|
|
@@ -43,6 +32,7 @@ export interface IContentViewProps {
|
|
|
43
32
|
root?: Record<string, string>;
|
|
44
33
|
button?: Record<string, string>;
|
|
45
34
|
link?: Record<string, string>;
|
|
35
|
+
bgImage?: Record<string, string>;
|
|
46
36
|
};
|
|
47
37
|
}
|
|
48
38
|
declare const ContentView: React.FC<IContentViewProps>;
|
|
@@ -19,41 +19,12 @@ var PropTypes = _interopRequireWildcard(require("prop-types"));
|
|
|
19
19
|
|
|
20
20
|
var _Button = _interopRequireDefault(require("../Button/Button"));
|
|
21
21
|
|
|
22
|
-
var _alarm = _interopRequireDefault(require("./i/alarm.png"));
|
|
23
|
-
|
|
24
|
-
var _empty = _interopRequireDefault(require("./i/empty.png"));
|
|
25
|
-
|
|
26
|
-
var _error = _interopRequireDefault(require("./i/error.png"));
|
|
27
|
-
|
|
28
|
-
var _fail = _interopRequireDefault(require("./i/fail.png"));
|
|
29
|
-
|
|
30
|
-
var _searchNoResult = _interopRequireDefault(require("./i/searchNoResult.png"));
|
|
31
|
-
|
|
32
|
-
var _submit = _interopRequireDefault(require("./i/submit.png"));
|
|
33
|
-
|
|
34
|
-
var _success = _interopRequireDefault(require("./i/success.png"));
|
|
35
|
-
|
|
36
|
-
var _update = _interopRequireDefault(require("./i/update.png"));
|
|
37
|
-
|
|
38
|
-
var _waiting = _interopRequireDefault(require("./i/waiting.png"));
|
|
39
|
-
|
|
40
22
|
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
41
23
|
|
|
42
24
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
43
25
|
|
|
44
26
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
|
45
27
|
|
|
46
|
-
var imageMap = {
|
|
47
|
-
alarm: _alarm["default"],
|
|
48
|
-
empty: _empty["default"],
|
|
49
|
-
error: _error["default"],
|
|
50
|
-
fail: _fail["default"],
|
|
51
|
-
searchNoResult: _searchNoResult["default"],
|
|
52
|
-
submit: _submit["default"],
|
|
53
|
-
success: _success["default"],
|
|
54
|
-
update: _update["default"],
|
|
55
|
-
waiting: _waiting["default"]
|
|
56
|
-
};
|
|
57
28
|
var cn = (0, _uiHelpers.cnCreate)('mfui-content-view');
|
|
58
29
|
|
|
59
30
|
var ContentView = function ContentView(_ref) {
|
|
@@ -68,7 +39,6 @@ var ContentView = function ContentView(_ref) {
|
|
|
68
39
|
isFullscreen = _ref.isFullscreen,
|
|
69
40
|
dataAttrs = _ref.dataAttrs,
|
|
70
41
|
children = _ref.children;
|
|
71
|
-
var imageSrc = type ? imageMap[type] : src;
|
|
72
42
|
var showButtons = !!(buttonParams === null || buttonParams === void 0 ? void 0 : buttonParams.text) || !!(linkParams === null || linkParams === void 0 ? void 0 : linkParams.text);
|
|
73
43
|
return /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root), {
|
|
74
44
|
className: cn({
|
|
@@ -76,9 +46,13 @@ var ContentView = function ContentView(_ref) {
|
|
|
76
46
|
}, [className])
|
|
77
47
|
}), /*#__PURE__*/React.createElement("div", {
|
|
78
48
|
className: cn('content')
|
|
79
|
-
}, /*#__PURE__*/React.createElement("
|
|
49
|
+
}, !!type && /*#__PURE__*/React.createElement("div", (0, _extends2["default"])({}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.bgImage), {
|
|
50
|
+
className: cn('bg-image', {
|
|
51
|
+
type: type
|
|
52
|
+
})
|
|
53
|
+
})), !!src && !type && /*#__PURE__*/React.createElement("img", {
|
|
80
54
|
className: cn('image'),
|
|
81
|
-
src:
|
|
55
|
+
src: src,
|
|
82
56
|
alt: alt
|
|
83
57
|
}), /*#__PURE__*/React.createElement("div", {
|
|
84
58
|
className: cn('title')
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@megafon/ui-core",
|
|
3
|
-
"version": "5.9.
|
|
3
|
+
"version": "5.9.2",
|
|
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": "bb0ce323f912035f38087807e7f51ec39ae54af6"
|
|
101
101
|
}
|