@instructure/ui-modal 8.10.3-snapshot.22 → 8.10.3-snapshot.23

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.
@@ -49,10 +49,12 @@ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
49
49
  this.ref = null;
50
50
 
51
51
  this.handleRef = el => {
52
- var _this$props$elementRe, _this$props;
53
-
52
+ const elementRef = this.props.elementRef;
54
53
  this.ref = el;
55
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
54
+
55
+ if (typeof elementRef === 'function') {
56
+ elementRef(el);
57
+ }
56
58
  };
57
59
  }
58
60
 
@@ -67,14 +69,14 @@ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
67
69
  render() {
68
70
  var _this$props$styles;
69
71
 
70
- const _this$props2 = this.props,
71
- as = _this$props2.as,
72
- elementRef = _this$props2.elementRef,
73
- overflow = _this$props2.overflow,
74
- variant = _this$props2.variant,
75
- padding = _this$props2.padding,
76
- children = _this$props2.children,
77
- rest = _objectWithoutProperties(_this$props2, _excluded);
72
+ const _this$props = this.props,
73
+ as = _this$props.as,
74
+ elementRef = _this$props.elementRef,
75
+ overflow = _this$props.overflow,
76
+ variant = _this$props.variant,
77
+ padding = _this$props.padding,
78
+ children = _this$props.children,
79
+ rest = _objectWithoutProperties(_this$props, _excluded);
78
80
 
79
81
  const passthroughProps = View.omitViewProps(omitProps(rest, ModalBody.allowedProps), ModalBody);
80
82
  const isFit = overflow === 'fit';
@@ -26,6 +26,10 @@ import { ThemeablePropTypes } from '@instructure/emotion';
26
26
  const propTypes = {
27
27
  children: PropTypes.node,
28
28
  padding: ThemeablePropTypes.spacing,
29
+
30
+ /**
31
+ * provides a reference to the underlying html root element
32
+ */
29
33
  elementRef: PropTypes.func,
30
34
  as: PropTypes.elementType,
31
35
  variant: PropTypes.oneOf(['default', 'inverse']),
@@ -41,10 +41,12 @@ let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
41
41
  this.ref = null;
42
42
 
43
43
  this.handleRef = el => {
44
- var _this$props$elementRe, _this$props;
45
-
44
+ const elementRef = this.props.elementRef;
46
45
  this.ref = el;
47
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
46
+
47
+ if (typeof elementRef === 'function') {
48
+ elementRef(el);
49
+ }
48
50
  };
49
51
  }
50
52
 
@@ -59,14 +61,14 @@ let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
59
61
  render() {
60
62
  var _this$props$styles;
61
63
 
62
- const _this$props2 = this.props,
63
- as = _this$props2.as,
64
- elementRef = _this$props2.elementRef,
65
- overflow = _this$props2.overflow,
66
- variant = _this$props2.variant,
67
- padding = _this$props2.padding,
68
- children = _this$props2.children,
69
- rest = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
64
+ const _this$props = this.props,
65
+ as = _this$props.as,
66
+ elementRef = _this$props.elementRef,
67
+ overflow = _this$props.overflow,
68
+ variant = _this$props.variant,
69
+ padding = _this$props.padding,
70
+ children = _this$props.children,
71
+ rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
70
72
 
71
73
  const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(rest, ModalBody.allowedProps), ModalBody);
72
74
 
@@ -37,6 +37,10 @@ var _emotion = require("@instructure/emotion");
37
37
  const propTypes = {
38
38
  children: _propTypes.default.node,
39
39
  padding: _emotion.ThemeablePropTypes.spacing,
40
+
41
+ /**
42
+ * provides a reference to the underlying html root element
43
+ */
40
44
  elementRef: _propTypes.default.func,
41
45
  as: _propTypes.default.elementType,
42
46
  variant: _propTypes.default.oneOf(['default', 'inverse']),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-modal",
3
- "version": "8.10.3-snapshot.22+f96f8c48e",
3
+ "version": "8.10.3-snapshot.23+5aaa29662",
4
4
  "description": "A component for displaying content in a dialog overlay",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,35 +25,35 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/console": "8.10.3-snapshot.22+f96f8c48e",
29
- "@instructure/emotion": "8.10.3-snapshot.22+f96f8c48e",
30
- "@instructure/shared-types": "8.10.3-snapshot.22+f96f8c48e",
31
- "@instructure/ui-buttons": "8.10.3-snapshot.22+f96f8c48e",
32
- "@instructure/ui-dialog": "8.10.3-snapshot.22+f96f8c48e",
33
- "@instructure/ui-motion": "8.10.3-snapshot.22+f96f8c48e",
34
- "@instructure/ui-overlays": "8.10.3-snapshot.22+f96f8c48e",
35
- "@instructure/ui-portal": "8.10.3-snapshot.22+f96f8c48e",
36
- "@instructure/ui-prop-types": "8.10.3-snapshot.22+f96f8c48e",
37
- "@instructure/ui-react-utils": "8.10.3-snapshot.22+f96f8c48e",
38
- "@instructure/ui-testable": "8.10.3-snapshot.22+f96f8c48e",
39
- "@instructure/ui-utils": "8.10.3-snapshot.22+f96f8c48e",
40
- "@instructure/ui-view": "8.10.3-snapshot.22+f96f8c48e",
28
+ "@instructure/console": "8.10.3-snapshot.23+5aaa29662",
29
+ "@instructure/emotion": "8.10.3-snapshot.23+5aaa29662",
30
+ "@instructure/shared-types": "8.10.3-snapshot.23+5aaa29662",
31
+ "@instructure/ui-buttons": "8.10.3-snapshot.23+5aaa29662",
32
+ "@instructure/ui-dialog": "8.10.3-snapshot.23+5aaa29662",
33
+ "@instructure/ui-motion": "8.10.3-snapshot.23+5aaa29662",
34
+ "@instructure/ui-overlays": "8.10.3-snapshot.23+5aaa29662",
35
+ "@instructure/ui-portal": "8.10.3-snapshot.23+5aaa29662",
36
+ "@instructure/ui-prop-types": "8.10.3-snapshot.23+5aaa29662",
37
+ "@instructure/ui-react-utils": "8.10.3-snapshot.23+5aaa29662",
38
+ "@instructure/ui-testable": "8.10.3-snapshot.23+5aaa29662",
39
+ "@instructure/ui-utils": "8.10.3-snapshot.23+5aaa29662",
40
+ "@instructure/ui-view": "8.10.3-snapshot.23+5aaa29662",
41
41
  "prop-types": "^15"
42
42
  },
43
43
  "peerDependencies": {
44
44
  "react": ">=16.8 <=17"
45
45
  },
46
46
  "devDependencies": {
47
- "@instructure/ui-babel-preset": "8.10.3-snapshot.22+f96f8c48e",
48
- "@instructure/ui-color-utils": "8.10.3-snapshot.22+f96f8c48e",
49
- "@instructure/ui-position": "8.10.3-snapshot.22+f96f8c48e",
50
- "@instructure/ui-test-locator": "8.10.3-snapshot.22+f96f8c48e",
51
- "@instructure/ui-test-utils": "8.10.3-snapshot.22+f96f8c48e",
52
- "@instructure/ui-themes": "8.10.3-snapshot.22+f96f8c48e"
47
+ "@instructure/ui-babel-preset": "8.10.3-snapshot.23+5aaa29662",
48
+ "@instructure/ui-color-utils": "8.10.3-snapshot.23+5aaa29662",
49
+ "@instructure/ui-position": "8.10.3-snapshot.23+5aaa29662",
50
+ "@instructure/ui-test-locator": "8.10.3-snapshot.23+5aaa29662",
51
+ "@instructure/ui-test-utils": "8.10.3-snapshot.23+5aaa29662",
52
+ "@instructure/ui-themes": "8.10.3-snapshot.23+5aaa29662"
53
53
  },
54
54
  "publishConfig": {
55
55
  "access": "public"
56
56
  },
57
57
  "sideEffects": false,
58
- "gitHead": "f96f8c48efab7806609098e1f00a6953b2884601"
58
+ "gitHead": "5aaa296621d72faebe1a809a8895a8185587008d"
59
59
  }
@@ -59,8 +59,13 @@ class ModalBody extends Component<ModalBodyProps> {
59
59
  ref: Element | null = null
60
60
 
61
61
  handleRef = (el: Element | null) => {
62
+ const { elementRef } = this.props
63
+
62
64
  this.ref = el
63
- this.props.elementRef?.(el)
65
+
66
+ if (typeof elementRef === 'function') {
67
+ elementRef(el)
68
+ }
64
69
  }
65
70
 
66
71
  componentDidMount() {
@@ -61,6 +61,9 @@ type ModalBodyStyle = ComponentStyle<'modalBody'>
61
61
  const propTypes: PropValidators<PropKeys> = {
62
62
  children: PropTypes.node,
63
63
  padding: ThemeablePropTypes.spacing,
64
+ /**
65
+ * provides a reference to the underlying html root element
66
+ */
64
67
  elementRef: PropTypes.func,
65
68
  as: PropTypes.elementType,
66
69
  variant: PropTypes.oneOf(['default', 'inverse']),
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Modal/ModalBody/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AACH,cAEM,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,SAAS;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAG9B;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM;CAiCP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Modal/ModalBody/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C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