@micromag/element-grid 0.4.38 → 0.4.40
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/es/index.js +7 -7
- package/package.json +3 -3
package/es/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import _defineProperty from '@babel/runtime/helpers/defineProperty';
|
|
2
1
|
import classNames from 'classnames';
|
|
3
2
|
import isArray from 'lodash/isArray';
|
|
4
3
|
import React from 'react';
|
|
5
4
|
|
|
6
5
|
var styles = {"container":"micromag-element-grid-container","items":"micromag-element-grid-items","cross":"micromag-element-grid-cross","axis":"micromag-element-grid-axis"};
|
|
7
6
|
|
|
7
|
+
/* eslint-disable react/no-array-index-key */
|
|
8
8
|
function Grid(_ref) {
|
|
9
9
|
var _ref$items = _ref.items,
|
|
10
10
|
initialItems = _ref$items === void 0 ? null : _ref$items,
|
|
@@ -42,7 +42,7 @@ function Grid(_ref) {
|
|
|
42
42
|
return total + (vertical ? columns : rows);
|
|
43
43
|
}, 0);
|
|
44
44
|
return /*#__PURE__*/React.createElement("div", {
|
|
45
|
-
className: classNames([styles.container,
|
|
45
|
+
className: classNames([styles.container, className]),
|
|
46
46
|
style: {
|
|
47
47
|
width: width,
|
|
48
48
|
height: height,
|
|
@@ -53,9 +53,9 @@ function Grid(_ref) {
|
|
|
53
53
|
style: {
|
|
54
54
|
flexDirection: vertical ? 'row' : 'column'
|
|
55
55
|
}
|
|
56
|
-
}, finalLayout.map(function (
|
|
57
|
-
var rows =
|
|
58
|
-
columns =
|
|
56
|
+
}, finalLayout.map(function (_ref3, crossIndex) {
|
|
57
|
+
var rows = _ref3.rows,
|
|
58
|
+
columns = _ref3.columns;
|
|
59
59
|
var crossSizeRatio = (vertical ? columns : rows) / crossTotal;
|
|
60
60
|
var crossSize = "".concat(100 * crossSizeRatio, "%");
|
|
61
61
|
var axisItems = vertical ? rows : columns;
|
|
@@ -65,7 +65,7 @@ function Grid(_ref) {
|
|
|
65
65
|
}, 0);
|
|
66
66
|
return /*#__PURE__*/React.createElement("div", {
|
|
67
67
|
key: "cross-".concat(crossIndex),
|
|
68
|
-
className: classNames([styles.cross,
|
|
68
|
+
className: classNames([styles.cross, crossClassName]),
|
|
69
69
|
style: {
|
|
70
70
|
flexDirection: vertical ? 'column' : 'row',
|
|
71
71
|
width: vertical ? crossSize : null,
|
|
@@ -78,7 +78,7 @@ function Grid(_ref) {
|
|
|
78
78
|
itemIndex += 1;
|
|
79
79
|
return /*#__PURE__*/React.createElement("div", {
|
|
80
80
|
key: "axis-".concat(axisIndex),
|
|
81
|
-
className: classNames([styles.axis,
|
|
81
|
+
className: classNames([styles.axis, axisClassName]),
|
|
82
82
|
style: {
|
|
83
83
|
width: vertical ? null : axisSize,
|
|
84
84
|
height: vertical ? axisSize : null,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@micromag/element-grid",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.40",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "",
|
|
6
6
|
"keywords": [
|
|
@@ -60,7 +60,7 @@
|
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
62
|
"@babel/runtime": "^7.28.6",
|
|
63
|
-
"@micromag/core": "^0.4.
|
|
63
|
+
"@micromag/core": "^0.4.40",
|
|
64
64
|
"classnames": "^2.2.6",
|
|
65
65
|
"lodash": "^4.17.23",
|
|
66
66
|
"react-intl": "^8.1.3 || ^10.0.0",
|
|
@@ -70,6 +70,6 @@
|
|
|
70
70
|
"access": "public",
|
|
71
71
|
"registry": "https://registry.npmjs.org/"
|
|
72
72
|
},
|
|
73
|
-
"gitHead": "
|
|
73
|
+
"gitHead": "6a9ff6e196a972abfd617f49353862cf445b0e83",
|
|
74
74
|
"types": "es/index.d.ts"
|
|
75
75
|
}
|