@micromag/element-grid 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.
@@ -1 +1 @@
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}
1
+ .micromag-element-grid-container{position:relative}.micromag-element-grid-container .micromag-element-grid-items{-webkit-box-align:stretch;-ms-flex-align:stretch;align-items:stretch;height:100%}.micromag-element-grid-container .micromag-element-grid-cross,.micromag-element-grid-container .micromag-element-grid-items{display:-webkit-box;display:-ms-flexbox;display:flex;position:relative}.micromag-element-grid-container .micromag-element-grid-axis{position:relative}
package/lib/index.js CHANGED
@@ -7,26 +7,18 @@ var PropTypes = require('prop-types');
7
7
  var React = require('react');
8
8
  var core = require('@micromag/core');
9
9
 
10
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
11
-
12
- var _defineProperty__default = /*#__PURE__*/_interopDefaultLegacy(_defineProperty);
13
- var classNames__default = /*#__PURE__*/_interopDefaultLegacy(classNames);
14
- var isArray__default = /*#__PURE__*/_interopDefaultLegacy(isArray);
15
- var PropTypes__default = /*#__PURE__*/_interopDefaultLegacy(PropTypes);
16
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
-
18
10
  var styles = {"container":"micromag-element-grid-container","items":"micromag-element-grid-items","cross":"micromag-element-grid-cross","axis":"micromag-element-grid-axis"};
19
11
 
20
12
  var propTypes = {
21
13
  layout: core.PropTypes.gridLayout,
22
- items: PropTypes__default["default"].arrayOf(PropTypes__default["default"].node),
23
- width: PropTypes__default["default"].number,
24
- height: PropTypes__default["default"].number,
25
- spacing: PropTypes__default["default"].number,
26
- vertical: PropTypes__default["default"].bool,
27
- className: PropTypes__default["default"].string,
28
- axisClassName: PropTypes__default["default"].string,
29
- crossClassName: PropTypes__default["default"].string
14
+ items: PropTypes.arrayOf(PropTypes.node),
15
+ width: PropTypes.number,
16
+ height: PropTypes.number,
17
+ spacing: PropTypes.number,
18
+ vertical: PropTypes.bool,
19
+ className: PropTypes.string,
20
+ axisClassName: PropTypes.string,
21
+ crossClassName: PropTypes.string
30
22
  };
31
23
  var defaultProps = {
32
24
  layout: null,
@@ -50,7 +42,7 @@ function Grid(_ref) {
50
42
  axisClassName = _ref.axisClassName,
51
43
  crossClassName = _ref.crossClassName;
52
44
  var itemIndex = 0;
53
- var finalLayout = isArray__default["default"](layout) ? layout : [{
45
+ var finalLayout = isArray(layout) ? layout : [{
54
46
  rows: vertical ? items.map(function () {
55
47
  return 1;
56
48
  }) : 1,
@@ -65,14 +57,14 @@ function Grid(_ref) {
65
57
  columns = _ref2$columns === void 0 ? 1 : _ref2$columns;
66
58
  return total + (vertical ? columns : rows);
67
59
  }, 0);
68
- return /*#__PURE__*/React__default["default"].createElement("div", {
69
- className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)]),
60
+ return /*#__PURE__*/React.createElement("div", {
61
+ className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
70
62
  style: {
71
63
  width: width,
72
64
  height: height,
73
65
  padding: spacing !== null && spacing > 0 ? spacing / 2 : null
74
66
  }
75
- }, /*#__PURE__*/React__default["default"].createElement("div", {
67
+ }, /*#__PURE__*/React.createElement("div", {
76
68
  className: styles.items,
77
69
  style: {
78
70
  flexDirection: vertical ? 'row' : 'column'
@@ -83,13 +75,13 @@ function Grid(_ref) {
83
75
  var crossSizeRatio = (vertical ? columns : rows) / crossTotal;
84
76
  var crossSize = "".concat(100 * crossSizeRatio, "%");
85
77
  var axisItems = vertical ? rows : columns;
86
- var finalAxisItems = isArray__default["default"](axisItems) ? axisItems : [axisItems];
78
+ var finalAxisItems = isArray(axisItems) ? axisItems : [axisItems];
87
79
  var axisTotal = finalAxisItems.reduce(function (total, it) {
88
80
  return total + it;
89
81
  }, 0);
90
- return /*#__PURE__*/React__default["default"].createElement("div", {
82
+ return /*#__PURE__*/React.createElement("div", {
91
83
  key: "cross-".concat(crossIndex),
92
- className: classNames__default["default"]([styles.cross, _defineProperty__default["default"]({}, crossClassName, crossClassName !== null)]),
84
+ className: classNames([styles.cross, _defineProperty({}, crossClassName, crossClassName !== null)]),
93
85
  style: {
94
86
  flexDirection: vertical ? 'column' : 'row',
95
87
  width: vertical ? crossSize : null,
@@ -100,9 +92,9 @@ function Grid(_ref) {
100
92
  var axisSize = "".concat(100 * axisSizeRatio, "%");
101
93
  var item = items[itemIndex];
102
94
  itemIndex += 1;
103
- return /*#__PURE__*/React__default["default"].createElement("div", {
95
+ return /*#__PURE__*/React.createElement("div", {
104
96
  key: "axis-".concat(axisIndex),
105
- className: classNames__default["default"]([styles.axis, _defineProperty__default["default"]({}, axisClassName, axisClassName !== null)]),
97
+ className: classNames([styles.axis, _defineProperty({}, axisClassName, axisClassName !== null)]),
106
98
  style: {
107
99
  width: vertical ? null : axisSize,
108
100
  height: vertical ? axisSize : null,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-grid",
3
- "version": "0.3.420",
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,7 +56,7 @@
50
56
  },
51
57
  "dependencies": {
52
58
  "@babel/runtime": "^7.13.10",
53
- "@micromag/core": "^0.3.420",
59
+ "@micromag/core": "^0.3.429",
54
60
  "classnames": "^2.2.6",
55
61
  "lodash": "^4.17.21",
56
62
  "prop-types": "^15.7.2",
@@ -61,5 +67,5 @@
61
67
  "access": "public",
62
68
  "registry": "https://registry.npmjs.org/"
63
69
  },
64
- "gitHead": "5b0f037a41c3bca07a5bce8f0dce205242f7ad17"
70
+ "gitHead": "f15e72b88ecfda4c54b87626513149b58572c52b"
65
71
  }