@instructure/ui-dialog 8.11.2-snapshot.17 → 8.11.2-snapshot.39

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.
@@ -44,12 +44,9 @@ class Dialog extends Component {
44
44
  this._raf = [];
45
45
  this._focusRegion = null;
46
46
  this.ref = null;
47
- this._root = null;
48
47
 
49
48
  this.getRef = el => {
50
- const elementRef = this.props.elementRef; // TODO: deprecate _root? ref should be enough
51
-
52
- this._root = el;
49
+ const elementRef = this.props.elementRef;
53
50
  this.ref = el;
54
51
 
55
52
  if (typeof elementRef === 'function') {
@@ -58,6 +55,10 @@ class Dialog extends Component {
58
55
  };
59
56
  }
60
57
 
58
+ get _root() {
59
+ return this.ref;
60
+ }
61
+
61
62
  componentDidMount() {
62
63
  if (this.props.open) {
63
64
  this.open();
@@ -141,7 +142,7 @@ class Dialog extends Component {
141
142
  let contentElement = findDOMNode(this.props.contentElement);
142
143
 
143
144
  if (!contentElement) {
144
- contentElement = findDOMNode(this._root);
145
+ contentElement = findDOMNode(this.ref);
145
146
  }
146
147
 
147
148
  return contentElement;
@@ -42,12 +42,9 @@ class Dialog extends _react.Component {
42
42
  this._raf = [];
43
43
  this._focusRegion = null;
44
44
  this.ref = null;
45
- this._root = null;
46
45
 
47
46
  this.getRef = el => {
48
- const elementRef = this.props.elementRef; // TODO: deprecate _root? ref should be enough
49
-
50
- this._root = el;
47
+ const elementRef = this.props.elementRef;
51
48
  this.ref = el;
52
49
 
53
50
  if (typeof elementRef === 'function') {
@@ -56,6 +53,10 @@ class Dialog extends _react.Component {
56
53
  };
57
54
  }
58
55
 
56
+ get _root() {
57
+ return this.ref;
58
+ }
59
+
59
60
  componentDidMount() {
60
61
  if (this.props.open) {
61
62
  this.open();
@@ -139,7 +140,7 @@ class Dialog extends _react.Component {
139
140
  let contentElement = (0, _findDOMNode.findDOMNode)(this.props.contentElement);
140
141
 
141
142
  if (!contentElement) {
142
- contentElement = (0, _findDOMNode.findDOMNode)(this._root);
143
+ contentElement = (0, _findDOMNode.findDOMNode)(this.ref);
143
144
  }
144
145
 
145
146
  return contentElement;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-dialog",
3
- "version": "8.11.2-snapshot.17+82b8314a5",
3
+ "version": "8.11.2-snapshot.39+5b3b94d60",
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.11.2-snapshot.17+82b8314a5",
29
- "@instructure/ui-a11y-utils": "8.11.2-snapshot.17+82b8314a5",
30
- "@instructure/ui-dom-utils": "8.11.2-snapshot.17+82b8314a5",
31
- "@instructure/ui-react-utils": "8.11.2-snapshot.17+82b8314a5",
32
- "@instructure/ui-testable": "8.11.2-snapshot.17+82b8314a5",
28
+ "@instructure/shared-types": "8.11.2-snapshot.39+5b3b94d60",
29
+ "@instructure/ui-a11y-utils": "8.11.2-snapshot.39+5b3b94d60",
30
+ "@instructure/ui-dom-utils": "8.11.2-snapshot.39+5b3b94d60",
31
+ "@instructure/ui-react-utils": "8.11.2-snapshot.39+5b3b94d60",
32
+ "@instructure/ui-testable": "8.11.2-snapshot.39+5b3b94d60",
33
33
  "prop-types": "^15"
34
34
  },
35
35
  "devDependencies": {
36
- "@instructure/console": "8.11.2-snapshot.17+82b8314a5",
37
- "@instructure/ui-babel-preset": "8.11.2-snapshot.17+82b8314a5",
38
- "@instructure/ui-prop-types": "8.11.2-snapshot.17+82b8314a5",
39
- "@instructure/ui-test-utils": "8.11.2-snapshot.17+82b8314a5"
36
+ "@instructure/console": "8.11.2-snapshot.39+5b3b94d60",
37
+ "@instructure/ui-babel-preset": "8.11.2-snapshot.39+5b3b94d60",
38
+ "@instructure/ui-prop-types": "8.11.2-snapshot.39+5b3b94d60",
39
+ "@instructure/ui-test-utils": "8.11.2-snapshot.39+5b3b94d60"
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": "82b8314a5ce13ef30c3f03125b1e2104ba81c889"
48
+ "gitHead": "5b3b94d60693dc069b6ff4fde8f2ca1a72462ab7"
49
49
  }
@@ -66,8 +66,13 @@ class Dialog extends Component<DialogProps> {
66
66
  _raf: RequestAnimationFrameType[] = []
67
67
  _focusRegion = null
68
68
  ref: Element | null = null
69
- _root: Element | null = null
69
+ get _root() {
70
+ console.warn(
71
+ '_root property is deprecated and will be removed in v9, please use ref instead'
72
+ )
70
73
 
74
+ return this.ref
75
+ }
71
76
  componentDidMount() {
72
77
  if (this.props.open) {
73
78
  this.open()
@@ -157,8 +162,6 @@ class Dialog extends Component<DialogProps> {
157
162
  getRef = (el: Element | null) => {
158
163
  const { elementRef } = this.props
159
164
 
160
- // TODO: deprecate _root? ref should be enough
161
- this._root = el
162
165
  this.ref = el
163
166
 
164
167
  if (typeof elementRef === 'function') {
@@ -170,7 +173,7 @@ class Dialog extends Component<DialogProps> {
170
173
  let contentElement = findDOMNode(this.props.contentElement)
171
174
 
172
175
  if (!contentElement) {
173
- contentElement = findDOMNode(this._root)
176
+ contentElement = findDOMNode(this.ref)
174
177
  }
175
178
 
176
179
  return contentElement
@@ -63,7 +63,7 @@ declare class Dialog extends Component<DialogProps> {
63
63
  _raf: RequestAnimationFrameType[];
64
64
  _focusRegion: null;
65
65
  ref: Element | null;
66
- _root: Element | null;
66
+ get _root(): Element | null;
67
67
  componentDidMount(): void;
68
68
  componentDidUpdate(prevProps: any): void;
69
69
  componentWillUnmount(): void;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Dialog/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE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