@micromag/element-grid 0.3.311 → 0.3.322
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 +12 -14
- package/lib/index.js +12 -14
- package/package.json +4 -4
package/assets/css/styles.css
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
.micromag-element-grid-container{position:relative}.micromag-element-grid-container .micromag-element-grid-items{-
|
|
1
|
+
.micromag-element-grid-container{position:relative}.micromag-element-grid-container .micromag-element-grid-items{-ms-flex-align:stretch;align-items:stretch;display:-ms-flexbox;display:flex;height:100%;position:relative}.micromag-element-grid-container .micromag-element-grid-cross{display:-ms-flexbox;display:flex;position:relative}.micromag-element-grid-container .micromag-element-grid-axis{position:relative}
|
package/es/index.js
CHANGED
|
@@ -29,17 +29,16 @@ var defaultProps = {
|
|
|
29
29
|
axisClassName: null,
|
|
30
30
|
crossClassName: null
|
|
31
31
|
};
|
|
32
|
-
|
|
33
32
|
function Grid(_ref) {
|
|
34
33
|
var items = _ref.items,
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
34
|
+
layout = _ref.layout,
|
|
35
|
+
width = _ref.width,
|
|
36
|
+
height = _ref.height,
|
|
37
|
+
spacing = _ref.spacing,
|
|
38
|
+
vertical = _ref.vertical,
|
|
39
|
+
className = _ref.className,
|
|
40
|
+
axisClassName = _ref.axisClassName,
|
|
41
|
+
crossClassName = _ref.crossClassName;
|
|
43
42
|
var itemIndex = 0;
|
|
44
43
|
var finalLayout = isArray(layout) ? layout : [{
|
|
45
44
|
rows: vertical ? items.map(function () {
|
|
@@ -51,9 +50,9 @@ function Grid(_ref) {
|
|
|
51
50
|
}];
|
|
52
51
|
var crossTotal = finalLayout.reduce(function (total, _ref2) {
|
|
53
52
|
var _ref2$rows = _ref2.rows,
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
53
|
+
rows = _ref2$rows === void 0 ? 1 : _ref2$rows,
|
|
54
|
+
_ref2$columns = _ref2.columns,
|
|
55
|
+
columns = _ref2$columns === void 0 ? 1 : _ref2$columns;
|
|
57
56
|
return total + (vertical ? columns : rows);
|
|
58
57
|
}, 0);
|
|
59
58
|
return /*#__PURE__*/React.createElement("div", {
|
|
@@ -70,7 +69,7 @@ function Grid(_ref) {
|
|
|
70
69
|
}
|
|
71
70
|
}, finalLayout.map(function (_ref4, crossIndex) {
|
|
72
71
|
var rows = _ref4.rows,
|
|
73
|
-
|
|
72
|
+
columns = _ref4.columns;
|
|
74
73
|
var crossSizeRatio = (vertical ? columns : rows) / crossTotal;
|
|
75
74
|
var crossSize = "".concat(100 * crossSizeRatio, "%");
|
|
76
75
|
var axisItems = vertical ? rows : columns;
|
|
@@ -103,7 +102,6 @@ function Grid(_ref) {
|
|
|
103
102
|
}));
|
|
104
103
|
})));
|
|
105
104
|
}
|
|
106
|
-
|
|
107
105
|
Grid.propTypes = propTypes;
|
|
108
106
|
Grid.defaultProps = defaultProps;
|
|
109
107
|
|
package/lib/index.js
CHANGED
|
@@ -39,17 +39,16 @@ var defaultProps = {
|
|
|
39
39
|
axisClassName: null,
|
|
40
40
|
crossClassName: null
|
|
41
41
|
};
|
|
42
|
-
|
|
43
42
|
function Grid(_ref) {
|
|
44
43
|
var items = _ref.items,
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
44
|
+
layout = _ref.layout,
|
|
45
|
+
width = _ref.width,
|
|
46
|
+
height = _ref.height,
|
|
47
|
+
spacing = _ref.spacing,
|
|
48
|
+
vertical = _ref.vertical,
|
|
49
|
+
className = _ref.className,
|
|
50
|
+
axisClassName = _ref.axisClassName,
|
|
51
|
+
crossClassName = _ref.crossClassName;
|
|
53
52
|
var itemIndex = 0;
|
|
54
53
|
var finalLayout = isArray__default["default"](layout) ? layout : [{
|
|
55
54
|
rows: vertical ? items.map(function () {
|
|
@@ -61,9 +60,9 @@ function Grid(_ref) {
|
|
|
61
60
|
}];
|
|
62
61
|
var crossTotal = finalLayout.reduce(function (total, _ref2) {
|
|
63
62
|
var _ref2$rows = _ref2.rows,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
rows = _ref2$rows === void 0 ? 1 : _ref2$rows,
|
|
64
|
+
_ref2$columns = _ref2.columns,
|
|
65
|
+
columns = _ref2$columns === void 0 ? 1 : _ref2$columns;
|
|
67
66
|
return total + (vertical ? columns : rows);
|
|
68
67
|
}, 0);
|
|
69
68
|
return /*#__PURE__*/React__default["default"].createElement("div", {
|
|
@@ -80,7 +79,7 @@ function Grid(_ref) {
|
|
|
80
79
|
}
|
|
81
80
|
}, finalLayout.map(function (_ref4, crossIndex) {
|
|
82
81
|
var rows = _ref4.rows,
|
|
83
|
-
|
|
82
|
+
columns = _ref4.columns;
|
|
84
83
|
var crossSizeRatio = (vertical ? columns : rows) / crossTotal;
|
|
85
84
|
var crossSize = "".concat(100 * crossSizeRatio, "%");
|
|
86
85
|
var axisItems = vertical ? rows : columns;
|
|
@@ -113,7 +112,6 @@ function Grid(_ref) {
|
|
|
113
112
|
}));
|
|
114
113
|
})));
|
|
115
114
|
}
|
|
116
|
-
|
|
117
115
|
Grid.propTypes = propTypes;
|
|
118
116
|
Grid.defaultProps = defaultProps;
|
|
119
117
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-grid",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.322",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"javascript"
|
|
@@ -49,15 +49,15 @@
|
|
|
49
49
|
},
|
|
50
50
|
"dependencies": {
|
|
51
51
|
"@babel/runtime": "^7.13.10",
|
|
52
|
-
"@micromag/core": "^0.3.
|
|
52
|
+
"@micromag/core": "^0.3.322",
|
|
53
53
|
"classnames": "^2.2.6",
|
|
54
54
|
"lodash": "^4.17.21",
|
|
55
55
|
"prop-types": "^15.7.2",
|
|
56
56
|
"react-intl": "^5.12.1",
|
|
57
|
-
"uuid": "^
|
|
57
|
+
"uuid": "^9.0.0"
|
|
58
58
|
},
|
|
59
59
|
"publishConfig": {
|
|
60
60
|
"access": "public"
|
|
61
61
|
},
|
|
62
|
-
"gitHead": "
|
|
62
|
+
"gitHead": "2dfe09ad5a9ac720e4bfbffcb6371fc31c24fa9f"
|
|
63
63
|
}
|