@megafon/ui-shared 4.2.0 → 4.2.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 +8 -0
- package/dist/es/components/AccordionBox/AccordionBox.js +6 -10
- package/dist/es/components/Property/Property.js +2 -11
- package/dist/es/helpers/getColumnConfig.d.ts +2 -0
- package/dist/es/helpers/getColumnConfig.js +10 -0
- package/dist/lib/components/AccordionBox/AccordionBox.js +7 -10
- package/dist/lib/components/Property/Property.js +3 -12
- package/dist/lib/helpers/getColumnConfig.d.ts +2 -0
- package/dist/lib/helpers/getColumnConfig.js +19 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
@@ -3,6 +3,14 @@
|
|
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.2.1](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.2.0...@megafon/ui-shared@4.2.1) (2022-10-17)
|
7
|
+
|
8
|
+
**Note:** Version bump only for package @megafon/ui-shared
|
9
|
+
|
10
|
+
|
11
|
+
|
12
|
+
|
13
|
+
|
6
14
|
# [4.2.0](https://github.com/MegafonWebLab/megafon-ui/compare/@megafon/ui-shared@4.1.2...@megafon/ui-shared@4.2.0) (2022-10-13)
|
7
15
|
|
8
16
|
|
@@ -19,6 +19,7 @@ import { Grid, GridColumn, Accordion } from '@megafon/ui-core';
|
|
19
19
|
import { cnCreate } from '@megafon/ui-helpers';
|
20
20
|
import * as PropTypes from 'prop-types';
|
21
21
|
import "./AccordionBox.css";
|
22
|
+
import { getColumnConfig } from "../../helpers/getColumnConfig";
|
22
23
|
var cn = cnCreate('mfui-accordion-box');
|
23
24
|
|
24
25
|
var AccordionBox = function AccordionBox(_a) {
|
@@ -28,16 +29,11 @@ var AccordionBox = function AccordionBox(_a) {
|
|
28
29
|
isFullWidth = _a$isFullWidth === void 0 ? false : _a$isFullWidth,
|
29
30
|
restProps = __rest(_a, ["hCenterAlignWide", "isFullWidth"]);
|
30
31
|
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
}, /*#__PURE__*/React.createElement(GridColumn, {
|
37
|
-
wide: "8"
|
38
|
-
}, /*#__PURE__*/React.createElement(Accordion, restProps))));
|
39
|
-
}, [restProps, hCenterAlignWide]);
|
40
|
-
return isFullWidth ? /*#__PURE__*/React.createElement(Accordion, restProps) : renderAccordionWithGrid();
|
32
|
+
return /*#__PURE__*/React.createElement("div", {
|
33
|
+
className: cn()
|
34
|
+
}, /*#__PURE__*/React.createElement(Grid, {
|
35
|
+
hAlign: hCenterAlignWide ? 'center' : 'left'
|
36
|
+
}, /*#__PURE__*/React.createElement(GridColumn, getColumnConfig(isFullWidth), /*#__PURE__*/React.createElement(Accordion, restProps))));
|
41
37
|
};
|
42
38
|
|
43
39
|
AccordionBox.propTypes = {
|
@@ -7,6 +7,7 @@ import { Header, Grid, GridColumn } from '@megafon/ui-core';
|
|
7
7
|
import { cnCreate, filterDataAttrs } from '@megafon/ui-helpers';
|
8
8
|
import PropTypes from 'prop-types';
|
9
9
|
import "./Property.css";
|
10
|
+
import { getColumnConfig } from "../../helpers/getColumnConfig";
|
10
11
|
import PropertyDescription from "./PropertyDescription";
|
11
12
|
var cn = cnCreate('mfui-property');
|
12
13
|
|
@@ -57,22 +58,12 @@ var Property = function Property(_ref) {
|
|
57
58
|
}));
|
58
59
|
});
|
59
60
|
}, [classes.openedDescription, classes.toggleDescription, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreLink]);
|
60
|
-
var getColumnConfig = React.useCallback(function () {
|
61
|
-
return fullWidth ? {
|
62
|
-
all: '12'
|
63
|
-
} : {
|
64
|
-
wide: '8',
|
65
|
-
desktop: '10',
|
66
|
-
tablet: '12',
|
67
|
-
mobile: '12'
|
68
|
-
};
|
69
|
-
}, [fullWidth]);
|
70
61
|
return /*#__PURE__*/React.createElement("div", _extends({
|
71
62
|
className: cn({
|
72
63
|
'border-bottom': borderBottom
|
73
64
|
}, [className]),
|
74
65
|
ref: rootRef
|
75
|
-
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(GridColumn, getColumnConfig(), /*#__PURE__*/React.createElement("div", {
|
66
|
+
}, filterDataAttrs(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/React.createElement(Grid, null, /*#__PURE__*/React.createElement(GridColumn, getColumnConfig(fullWidth), /*#__PURE__*/React.createElement("div", {
|
76
67
|
className: cn('wrapper')
|
77
68
|
}, badge && /*#__PURE__*/React.createElement("div", {
|
78
69
|
className: cn('badge-wrapper')
|
@@ -19,6 +19,8 @@ var _uiHelpers = require("@megafon/ui-helpers");
|
|
19
19
|
|
20
20
|
var PropTypes = _interopRequireWildcard(require("prop-types"));
|
21
21
|
|
22
|
+
var _getColumnConfig = require("../../helpers/getColumnConfig");
|
23
|
+
|
22
24
|
function _getRequireWildcardCache() { if (typeof WeakMap !== "function") return null; var cache = new WeakMap(); _getRequireWildcardCache = function _getRequireWildcardCache() { return cache; }; return cache; }
|
23
25
|
|
24
26
|
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (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; }
|
@@ -45,16 +47,11 @@ var AccordionBox = function AccordionBox(_a) {
|
|
45
47
|
isFullWidth = _a$isFullWidth === void 0 ? false : _a$isFullWidth,
|
46
48
|
restProps = __rest(_a, ["hCenterAlignWide", "isFullWidth"]);
|
47
49
|
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
}, /*#__PURE__*/React.createElement(_uiCore.GridColumn, {
|
54
|
-
wide: "8"
|
55
|
-
}, /*#__PURE__*/React.createElement(_uiCore.Accordion, restProps))));
|
56
|
-
}, [restProps, hCenterAlignWide]);
|
57
|
-
return isFullWidth ? /*#__PURE__*/React.createElement(_uiCore.Accordion, restProps) : renderAccordionWithGrid();
|
50
|
+
return /*#__PURE__*/React.createElement("div", {
|
51
|
+
className: cn()
|
52
|
+
}, /*#__PURE__*/React.createElement(_uiCore.Grid, {
|
53
|
+
hAlign: hCenterAlignWide ? 'center' : 'left'
|
54
|
+
}, /*#__PURE__*/React.createElement(_uiCore.GridColumn, (0, _getColumnConfig.getColumnConfig)(isFullWidth), /*#__PURE__*/React.createElement(_uiCore.Accordion, restProps))));
|
58
55
|
};
|
59
56
|
|
60
57
|
AccordionBox.propTypes = {
|
@@ -21,6 +21,8 @@ var _uiHelpers = require("@megafon/ui-helpers");
|
|
21
21
|
|
22
22
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
23
23
|
|
24
|
+
var _getColumnConfig = require("../../helpers/getColumnConfig");
|
25
|
+
|
24
26
|
var _PropertyDescription = _interopRequireDefault(require("./PropertyDescription"));
|
25
27
|
|
26
28
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { "default": obj }; }
|
@@ -77,23 +79,12 @@ var Property = function Property(_ref) {
|
|
77
79
|
});
|
78
80
|
}, [classes.openedDescription, classes.toggleDescription, dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.moreLink]);
|
79
81
|
|
80
|
-
var getColumnConfig = _react["default"].useCallback(function () {
|
81
|
-
return fullWidth ? {
|
82
|
-
all: '12'
|
83
|
-
} : {
|
84
|
-
wide: '8',
|
85
|
-
desktop: '10',
|
86
|
-
tablet: '12',
|
87
|
-
mobile: '12'
|
88
|
-
};
|
89
|
-
}, [fullWidth]);
|
90
|
-
|
91
82
|
return /*#__PURE__*/_react["default"].createElement("div", (0, _extends2["default"])({
|
92
83
|
className: cn({
|
93
84
|
'border-bottom': borderBottom
|
94
85
|
}, [className]),
|
95
86
|
ref: rootRef
|
96
|
-
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, null, /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, getColumnConfig(), /*#__PURE__*/_react["default"].createElement("div", {
|
87
|
+
}, (0, _uiHelpers.filterDataAttrs)(dataAttrs === null || dataAttrs === void 0 ? void 0 : dataAttrs.root)), /*#__PURE__*/_react["default"].createElement(_uiCore.Grid, null, /*#__PURE__*/_react["default"].createElement(_uiCore.GridColumn, (0, _getColumnConfig.getColumnConfig)(fullWidth), /*#__PURE__*/_react["default"].createElement("div", {
|
97
88
|
className: cn('wrapper')
|
98
89
|
}, badge && /*#__PURE__*/_react["default"].createElement("div", {
|
99
90
|
className: cn('badge-wrapper')
|
@@ -0,0 +1,19 @@
|
|
1
|
+
"use strict";
|
2
|
+
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
4
|
+
value: true
|
5
|
+
});
|
6
|
+
exports.getColumnConfig = void 0;
|
7
|
+
|
8
|
+
var getColumnConfig = function getColumnConfig(isFullWidth) {
|
9
|
+
return isFullWidth ? {
|
10
|
+
all: '12'
|
11
|
+
} : {
|
12
|
+
wide: '8',
|
13
|
+
desktop: '10',
|
14
|
+
tablet: '12',
|
15
|
+
mobile: '12'
|
16
|
+
};
|
17
|
+
};
|
18
|
+
|
19
|
+
exports.getColumnConfig = getColumnConfig;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@megafon/ui-shared",
|
3
|
-
"version": "4.2.
|
3
|
+
"version": "4.2.1",
|
4
4
|
"files": [
|
5
5
|
"dist"
|
6
6
|
],
|
@@ -82,7 +82,7 @@
|
|
82
82
|
},
|
83
83
|
"dependencies": {
|
84
84
|
"@babel/runtime": "^7.8.4",
|
85
|
-
"@megafon/ui-core": "^4.
|
85
|
+
"@megafon/ui-core": "^4.5.0",
|
86
86
|
"@megafon/ui-helpers": "^2.2.0",
|
87
87
|
"core-js": "^3.6.4",
|
88
88
|
"htmr": "^0.9.2",
|
@@ -90,5 +90,5 @@
|
|
90
90
|
"prop-types": "^15.7.2",
|
91
91
|
"swiper": "^6.5.6"
|
92
92
|
},
|
93
|
-
"gitHead": "
|
93
|
+
"gitHead": "1767b434f1650a100aa2aca6f5c795f8b549a184"
|
94
94
|
}
|