@micromag/element-layout 0.3.420 → 0.3.429
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/assets/css/styles.css +1 -1
- package/es/index.js +1 -2
- package/lib/index.js +14 -23
- package/package.json +10 -4
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.micromag-element-layout-container.micromag-element-layout-fullscreen{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-element-layout-container{display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.micromag-element-layout-container .micromag-element-layout-horizontal{display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}
|
|
1
|
+
.micromag-element-layout-container.micromag-element-layout-fullscreen{height:100%;left:0;position:absolute;top:0;width:100%}.micromag-element-layout-container{-webkit-box-orient:vertical;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:column;flex-direction:column}.micromag-element-layout-container .micromag-element-layout-horizontal{-webkit-box-orient:horizontal;-webkit-box-direction:normal;display:-webkit-box;display:-ms-flexbox;display:flex;-ms-flex-direction:row;flex-direction:row}
|
package/es/index.js
CHANGED
|
@@ -32,7 +32,6 @@ var defaultProps = {
|
|
|
32
32
|
style: null
|
|
33
33
|
};
|
|
34
34
|
var Layout = function Layout(_ref) {
|
|
35
|
-
var _ref2;
|
|
36
35
|
var width = _ref.width,
|
|
37
36
|
height = _ref.height,
|
|
38
37
|
horizontalAlign = _ref.horizontalAlign,
|
|
@@ -65,7 +64,7 @@ var Layout = function Layout(_ref) {
|
|
|
65
64
|
return /*#__PURE__*/React.createElement(StackProvider, {
|
|
66
65
|
direction: "vertical"
|
|
67
66
|
}, /*#__PURE__*/React.createElement("div", {
|
|
68
|
-
className: classNames([styles.container, (
|
|
67
|
+
className: classNames([styles.container, _defineProperty(_defineProperty({}, styles.fullscreen, fullscreen), className, className !== null)]),
|
|
69
68
|
style: finalStyle
|
|
70
69
|
}, children));
|
|
71
70
|
};
|
package/lib/index.js
CHANGED
|
@@ -9,26 +9,18 @@ var PropTypes = require('prop-types');
|
|
|
9
9
|
var classNames = require('classnames');
|
|
10
10
|
var elementStack = require('@micromag/element-stack');
|
|
11
11
|
|
|
12
|
-
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
13
|
-
|
|
14
|
-
var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
|
|
15
|
-
var _objectSpread__default = /*#__PURE__*/_interopDefaultLegacy(_objectSpread);
|
|
16
|
-
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
17
|
-
var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
|
|
18
|
-
var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
|
|
19
|
-
|
|
20
12
|
var styles = {"container":"micromag-element-layout-container","fullscreen":"micromag-element-layout-fullscreen","horizontal":"micromag-element-layout-horizontal"};
|
|
21
13
|
|
|
22
14
|
var propTypes = {
|
|
23
|
-
width:
|
|
24
|
-
height:
|
|
25
|
-
horizontalAlign:
|
|
26
|
-
verticalAlign:
|
|
27
|
-
distribution:
|
|
28
|
-
fullscreen:
|
|
29
|
-
className:
|
|
30
|
-
children:
|
|
31
|
-
style:
|
|
15
|
+
width: PropTypes.number,
|
|
16
|
+
height: PropTypes.number,
|
|
17
|
+
horizontalAlign: PropTypes.oneOf(['left', 'center', 'right']),
|
|
18
|
+
verticalAlign: PropTypes.oneOf(['top', 'middle', 'bottom']),
|
|
19
|
+
distribution: PropTypes.oneOf(['between', 'around', null]),
|
|
20
|
+
fullscreen: PropTypes.bool,
|
|
21
|
+
className: PropTypes.string,
|
|
22
|
+
children: PropTypes.node,
|
|
23
|
+
style: PropTypes.object // eslint-disable-line
|
|
32
24
|
};
|
|
33
25
|
|
|
34
26
|
var defaultProps = {
|
|
@@ -43,7 +35,6 @@ var defaultProps = {
|
|
|
43
35
|
style: null
|
|
44
36
|
};
|
|
45
37
|
var Layout = function Layout(_ref) {
|
|
46
|
-
var _ref2;
|
|
47
38
|
var width = _ref.width,
|
|
48
39
|
height = _ref.height,
|
|
49
40
|
horizontalAlign = _ref.horizontalAlign,
|
|
@@ -67,16 +58,16 @@ var Layout = function Layout(_ref) {
|
|
|
67
58
|
} else if (horizontalAlign === 'right') {
|
|
68
59
|
alignItems = 'flex-end';
|
|
69
60
|
}
|
|
70
|
-
var finalStyle =
|
|
61
|
+
var finalStyle = _objectSpread({
|
|
71
62
|
width: width,
|
|
72
63
|
height: height,
|
|
73
64
|
justifyContent: justifyContent,
|
|
74
65
|
alignItems: alignItems
|
|
75
66
|
}, style);
|
|
76
|
-
return /*#__PURE__*/
|
|
67
|
+
return /*#__PURE__*/React.createElement(elementStack.StackProvider, {
|
|
77
68
|
direction: "vertical"
|
|
78
|
-
}, /*#__PURE__*/
|
|
79
|
-
className:
|
|
69
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
70
|
+
className: classNames([styles.container, _defineProperty(_defineProperty({}, styles.fullscreen, fullscreen), className, className !== null)]),
|
|
80
71
|
style: finalStyle
|
|
81
72
|
}, children));
|
|
82
73
|
};
|
|
@@ -87,4 +78,4 @@ Object.defineProperty(exports, 'Spacer', {
|
|
|
87
78
|
enumerable: true,
|
|
88
79
|
get: function () { return elementStack.Spacer; }
|
|
89
80
|
});
|
|
90
|
-
exports
|
|
81
|
+
exports.default = Layout;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-layout",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.429",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -32,6 +32,12 @@
|
|
|
32
32
|
"license": "ISC",
|
|
33
33
|
"main": "lib/index.js",
|
|
34
34
|
"module": "es/index.js",
|
|
35
|
+
"exports": {
|
|
36
|
+
".": {
|
|
37
|
+
"require": "./lib/index.js",
|
|
38
|
+
"import": "./es/index.js"
|
|
39
|
+
}
|
|
40
|
+
},
|
|
35
41
|
"files": [
|
|
36
42
|
"lib",
|
|
37
43
|
"es",
|
|
@@ -50,8 +56,8 @@
|
|
|
50
56
|
},
|
|
51
57
|
"dependencies": {
|
|
52
58
|
"@babel/runtime": "^7.13.10",
|
|
53
|
-
"@micromag/core": "^0.3.
|
|
54
|
-
"@micromag/element-stack": "^0.3.
|
|
59
|
+
"@micromag/core": "^0.3.429",
|
|
60
|
+
"@micromag/element-stack": "^0.3.429",
|
|
55
61
|
"classnames": "^2.2.6",
|
|
56
62
|
"lodash": "^4.17.21",
|
|
57
63
|
"prop-types": "^15.7.2",
|
|
@@ -62,5 +68,5 @@
|
|
|
62
68
|
"access": "public",
|
|
63
69
|
"registry": "https://registry.npmjs.org/"
|
|
64
70
|
},
|
|
65
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "f15e72b88ecfda4c54b87626513149b58572c52b"
|
|
66
72
|
}
|