@instructure/ui-dialog 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.
@@ -47,12 +47,14 @@ class Dialog extends Component {
47
47
  this._root = null;
48
48
 
49
49
  this.getRef = el => {
50
- var _this$props$elementRe, _this$props;
50
+ const elementRef = this.props.elementRef; // TODO: deprecate _root? ref should be enough
51
51
 
52
- // TODO: deprecate _root? ref should be enough
53
52
  this._root = el;
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
 
@@ -91,10 +93,10 @@ class Dialog extends Component {
91
93
  }
92
94
 
93
95
  open() {
94
- const _this$props2 = this.props,
95
- open = _this$props2.open,
96
- contentElement = _this$props2.contentElement,
97
- options = _objectWithoutProperties(_this$props2, _excluded);
96
+ const _this$props = this.props,
97
+ open = _this$props.open,
98
+ contentElement = _this$props.contentElement,
99
+ options = _objectWithoutProperties(_this$props, _excluded);
98
100
 
99
101
  this._raf.push(requestAnimationFrame(() => {
100
102
  // It needs to wait a heartbeat until the content is fully loaded
@@ -68,6 +68,10 @@ const propTypes = {
68
68
  shouldCloseOnDocumentClick: PropTypes.bool,
69
69
  shouldCloseOnEscape: PropTypes.bool,
70
70
  shouldFocusOnOpen: PropTypes.bool,
71
+
72
+ /**
73
+ * provides a reference to the underlying html root element
74
+ */
71
75
  elementRef: PropTypes.func
72
76
  };
73
77
  const allowedProps = ['children', 'as', 'display', 'label', 'open', 'onBlur', 'onDismiss', 'defaultFocusElement', 'contentElement', 'liveRegion', 'shouldContainFocus', 'shouldReturnFocus', 'shouldCloseOnDocumentClick', 'shouldCloseOnEscape', 'shouldFocusOnOpen', 'elementRef'];
@@ -45,12 +45,14 @@ class Dialog extends _react.Component {
45
45
  this._root = null;
46
46
 
47
47
  this.getRef = el => {
48
- var _this$props$elementRe, _this$props;
48
+ const elementRef = this.props.elementRef; // TODO: deprecate _root? ref should be enough
49
49
 
50
- // TODO: deprecate _root? ref should be enough
51
50
  this._root = el;
52
51
  this.ref = el;
53
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
52
+
53
+ if (typeof elementRef === 'function') {
54
+ elementRef(el);
55
+ }
54
56
  };
55
57
  }
56
58
 
@@ -89,10 +91,10 @@ class Dialog extends _react.Component {
89
91
  }
90
92
 
91
93
  open() {
92
- const _this$props2 = this.props,
93
- open = _this$props2.open,
94
- contentElement = _this$props2.contentElement,
95
- options = (0, _objectWithoutProperties2.default)(_this$props2, _excluded);
94
+ const _this$props = this.props,
95
+ open = _this$props.open,
96
+ contentElement = _this$props.contentElement,
97
+ options = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
96
98
 
97
99
  this._raf.push((0, _requestAnimationFrame.requestAnimationFrame)(() => {
98
100
  // It needs to wait a heartbeat until the content is fully loaded
@@ -78,6 +78,10 @@ const propTypes = {
78
78
  shouldCloseOnDocumentClick: _propTypes.default.bool,
79
79
  shouldCloseOnEscape: _propTypes.default.bool,
80
80
  shouldFocusOnOpen: _propTypes.default.bool,
81
+
82
+ /**
83
+ * provides a reference to the underlying html root element
84
+ */
81
85
  elementRef: _propTypes.default.func
82
86
  };
83
87
  exports.propTypes = propTypes;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-dialog",
3
- "version": "8.10.3-snapshot.22+f96f8c48e",
3
+ "version": "8.10.3-snapshot.23+5aaa29662",
4
4
  "description": "A utility component for managing keyboard accessibility and screen reader behavior",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,18 +25,18 @@
25
25
  "license": "MIT",
26
26
  "dependencies": {
27
27
  "@babel/runtime": "^7.13.10",
28
- "@instructure/shared-types": "8.10.3-snapshot.22+f96f8c48e",
29
- "@instructure/ui-a11y-utils": "8.10.3-snapshot.22+f96f8c48e",
30
- "@instructure/ui-dom-utils": "8.10.3-snapshot.22+f96f8c48e",
31
- "@instructure/ui-react-utils": "8.10.3-snapshot.22+f96f8c48e",
32
- "@instructure/ui-testable": "8.10.3-snapshot.22+f96f8c48e",
28
+ "@instructure/shared-types": "8.10.3-snapshot.23+5aaa29662",
29
+ "@instructure/ui-a11y-utils": "8.10.3-snapshot.23+5aaa29662",
30
+ "@instructure/ui-dom-utils": "8.10.3-snapshot.23+5aaa29662",
31
+ "@instructure/ui-react-utils": "8.10.3-snapshot.23+5aaa29662",
32
+ "@instructure/ui-testable": "8.10.3-snapshot.23+5aaa29662",
33
33
  "prop-types": "^15"
34
34
  },
35
35
  "devDependencies": {
36
- "@instructure/console": "8.10.3-snapshot.22+f96f8c48e",
37
- "@instructure/ui-babel-preset": "8.10.3-snapshot.22+f96f8c48e",
38
- "@instructure/ui-prop-types": "8.10.3-snapshot.22+f96f8c48e",
39
- "@instructure/ui-test-utils": "8.10.3-snapshot.22+f96f8c48e"
36
+ "@instructure/console": "8.10.3-snapshot.23+5aaa29662",
37
+ "@instructure/ui-babel-preset": "8.10.3-snapshot.23+5aaa29662",
38
+ "@instructure/ui-prop-types": "8.10.3-snapshot.23+5aaa29662",
39
+ "@instructure/ui-test-utils": "8.10.3-snapshot.23+5aaa29662"
40
40
  },
41
41
  "peerDependencies": {
42
42
  "react": ">=16.8 <=17"
@@ -45,5 +45,5 @@
45
45
  "access": "public"
46
46
  },
47
47
  "sideEffects": false,
48
- "gitHead": "f96f8c48efab7806609098e1f00a6953b2884601"
48
+ "gitHead": "5aaa296621d72faebe1a809a8895a8185587008d"
49
49
  }
@@ -155,10 +155,15 @@ class Dialog extends Component<DialogProps> {
155
155
  }
156
156
 
157
157
  getRef = (el: Element | null) => {
158
+ const { elementRef } = this.props
159
+
158
160
  // TODO: deprecate _root? ref should be enough
159
161
  this._root = el
160
162
  this.ref = el
161
- this.props.elementRef?.(el)
163
+
164
+ if (typeof elementRef === 'function') {
165
+ elementRef(el)
166
+ }
162
167
  }
163
168
 
164
169
  get contentElement() {
@@ -114,6 +114,9 @@ const propTypes: PropValidators<PropKeys> = {
114
114
  shouldCloseOnDocumentClick: PropTypes.bool,
115
115
  shouldCloseOnEscape: PropTypes.bool,
116
116
  shouldFocusOnOpen: PropTypes.bool,
117
+ /**
118
+ * provides a reference to the underlying html root element
119
+ */
117
120
  elementRef: PropTypes.func
118
121
  }
119
122
 
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Dialog/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAK1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;GAKG;AAEH,cAAM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;;;;;MAeT;IAEV,SAAS,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,EAAE,CAAK;IAC/C,IAAI,EAAE,yBAAyB,EAAE,CAAK;IACtC,YAAY,OAAO;IACnB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAC1B,KAAK,EAAE,OAAO,GAAG,IAAI,CAAO;IAE5B,iBAAiB;IAOjB,kBAAkB,CAAC,SAAS,KAAA;IAe5B,oBAAoB;IAWpB,IAAI;IAyBJ,KAAK;IAOL,KAAK;IAYL,IAAI;IASJ,MAAM,OAAQ,OAAO,GAAG,IAAI,UAK3B;IAED,IAAI,cAAc,wCAQjB;IAED,IAAI,OAAO,qBAOV;IAED,MAAM;CAgBP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Dialog/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAIxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAK1E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,SAAS,CAAA;AAE1C;;;;;GAKG;AAEH,cAAM,MAAO,SAAQ,SAAS,CAAC,WAAW,CAAC;IACzC,MAAM,CAAC,QAAQ,CAAC,WAAW,YAAW;IAEtC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;;;;;;;;;MAeT;IAEV,SAAS,EAAE,UAAU,CAAC,OAAO,UAAU,CAAC,EAAE,CAAK;IAC/C,IAAI,EAAE,yBAAyB,EAAE,CAAK;IACtC,YAAY,OAAO;IACnB,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAC1B,KAAK,EAAE,OAAO,GAAG,IAAI,CAAO;IAE5B,iBAAiB;IAOjB,kBAAkB,CAAC,SAAS,KAAA;IAe5B,oBAAoB;IAWpB,IAAI;IAyBJ,KAAK;IAOL,KAAK;IAYL,IAAI;IASJ,MAAM,OAAQ,OAAO,GAAG,IAAI,UAU3B;IAED,IAAI,cAAc,wCAQjB;IAED,IAAI,OAAO,qBAOV;IAED,MAAM;CAgBP;AAED,eAAe,MAAM,CAAA;AACrB,OAAO,EAAE,MAAM,EAAE,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../src/Dialog/props.ts"],"names":[],"mappings":"AAwB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