@micromag/element-container 0.3.373 → 0.3.377

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 CHANGED
@@ -6,17 +6,22 @@ import React from 'react';
6
6
  var styles = {"container":"micromag-element-container-container"};
7
7
 
8
8
  var propTypes = {
9
+ containerRef: PropTypes.oneOfType([PropTypes.func, PropTypes.shape({
10
+ current: PropTypes.any
11
+ })]),
9
12
  width: PropTypes.number.isRequired,
10
13
  height: PropTypes.number.isRequired,
11
14
  className: PropTypes.string,
12
15
  children: PropTypes.node
13
16
  };
14
17
  var defaultProps = {
18
+ containerRef: null,
15
19
  className: null,
16
20
  children: null
17
21
  };
18
22
  function Container(_ref) {
19
- var width = _ref.width,
23
+ var containerRef = _ref.containerRef,
24
+ width = _ref.width,
20
25
  height = _ref.height,
21
26
  className = _ref.className,
22
27
  children = _ref.children;
@@ -26,11 +31,17 @@ function Container(_ref) {
26
31
  height: height
27
32
  } : null;
28
33
  return /*#__PURE__*/React.createElement("div", {
34
+ ref: containerRef,
29
35
  className: classNames([styles.container, _defineProperty({}, className, className !== null)]),
30
36
  style: containerStyle
31
37
  }, children);
32
38
  }
33
39
  Container.propTypes = propTypes;
34
40
  Container.defaultProps = defaultProps;
41
+ var Container$1 = /*#__PURE__*/React.forwardRef(function (props, ref) {
42
+ return /*#__PURE__*/React.createElement(Container, Object.assign({
43
+ containerRef: ref
44
+ }, props));
45
+ });
35
46
 
36
- export { Container as default };
47
+ export { Container$1 as default };
package/lib/index.js CHANGED
@@ -15,17 +15,22 @@ var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
15
  var styles = {"container":"micromag-element-container-container"};
16
16
 
17
17
  var propTypes = {
18
+ containerRef: PropTypes__default["default"].oneOfType([PropTypes__default["default"].func, PropTypes__default["default"].shape({
19
+ current: PropTypes__default["default"].any
20
+ })]),
18
21
  width: PropTypes__default["default"].number.isRequired,
19
22
  height: PropTypes__default["default"].number.isRequired,
20
23
  className: PropTypes__default["default"].string,
21
24
  children: PropTypes__default["default"].node
22
25
  };
23
26
  var defaultProps = {
27
+ containerRef: null,
24
28
  className: null,
25
29
  children: null
26
30
  };
27
31
  function Container(_ref) {
28
- var width = _ref.width,
32
+ var containerRef = _ref.containerRef,
33
+ width = _ref.width,
29
34
  height = _ref.height,
30
35
  className = _ref.className,
31
36
  children = _ref.children;
@@ -35,11 +40,17 @@ function Container(_ref) {
35
40
  height: height
36
41
  } : null;
37
42
  return /*#__PURE__*/React__default["default"].createElement("div", {
43
+ ref: containerRef,
38
44
  className: classNames__default["default"]([styles.container, _defineProperty__default["default"]({}, className, className !== null)]),
39
45
  style: containerStyle
40
46
  }, children);
41
47
  }
42
48
  Container.propTypes = propTypes;
43
49
  Container.defaultProps = defaultProps;
50
+ var Container$1 = /*#__PURE__*/React__default["default"].forwardRef(function (props, ref) {
51
+ return /*#__PURE__*/React__default["default"].createElement(Container, Object.assign({
52
+ containerRef: ref
53
+ }, props));
54
+ });
44
55
 
45
- module.exports = Container;
56
+ module.exports = Container$1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@micromag/element-container",
3
- "version": "0.3.373",
3
+ "version": "0.3.377",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "javascript"
@@ -49,7 +49,7 @@
49
49
  },
50
50
  "dependencies": {
51
51
  "@babel/runtime": "^7.13.10",
52
- "@micromag/core": "^0.3.373",
52
+ "@micromag/core": "^0.3.377",
53
53
  "classnames": "^2.2.6",
54
54
  "lodash": "^4.17.21",
55
55
  "prop-types": "^15.7.2",
@@ -59,5 +59,5 @@
59
59
  "publishConfig": {
60
60
  "access": "public"
61
61
  },
62
- "gitHead": "072c8a8e64514933e9d13e4ad99778c2cbcc6968"
62
+ "gitHead": "80f2c43eabcb9c8e23e71704751c4ad4066e4d3a"
63
63
  }