@instructure/ui-popover 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.
@@ -53,10 +53,12 @@ let Popover = (_dec = bidirectional(), _dec2 = testable(), _dec(_class = _dec2(_
53
53
  this.ref = null;
54
54
 
55
55
  this.handleRef = el => {
56
- var _this$props$elementRe, _this$props;
57
-
56
+ const elementRef = this.props.elementRef;
58
57
  this.ref = el;
59
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
58
+
59
+ if (typeof elementRef === 'function') {
60
+ elementRef(el);
61
+ }
60
62
  };
61
63
 
62
64
  this.show = event => {
@@ -70,9 +72,9 @@ let Popover = (_dec = bidirectional(), _dec2 = testable(), _dec(_class = _dec2(_
70
72
  };
71
73
 
72
74
  this.hide = (event, documentClick = false) => {
73
- const _this$props2 = this.props,
74
- onHideContent = _this$props2.onHideContent,
75
- isShowingContent = _this$props2.isShowingContent;
75
+ const _this$props = this.props,
76
+ onHideContent = _this$props.onHideContent,
77
+ isShowingContent = _this$props.isShowingContent;
76
78
 
77
79
  if (typeof isShowingContent === 'undefined') {
78
80
  // uncontrolled, set state, fire callbacks
@@ -265,9 +267,9 @@ let Popover = (_dec = bidirectional(), _dec2 = testable(), _dec(_class = _dec2(_
265
267
  }
266
268
 
267
269
  computeOffsets(placement) {
268
- let _this$props3 = this.props,
269
- offsetX = _this$props3.offsetX,
270
- offsetY = _this$props3.offsetY;
270
+ let _this$props2 = this.props,
271
+ offsetX = _this$props2.offsetX,
272
+ offsetY = _this$props2.offsetY;
271
273
 
272
274
  if (this.props.shouldAlignArrow && this._view) {
273
275
  const secondaryPlacement = parsePlacement(placement)[1]; // arrowSize and arrowBorderWidth are component theme variables
@@ -337,9 +339,9 @@ let Popover = (_dec = bidirectional(), _dec2 = testable(), _dec(_class = _dec2(_
337
339
  let trigger = callRenderProp(this.props.renderTrigger);
338
340
 
339
341
  if (trigger) {
340
- const _this$props4 = this.props,
341
- on = _this$props4.on,
342
- shouldContainFocus = _this$props4.shouldContainFocus;
342
+ const _this$props3 = this.props,
343
+ on = _this$props3.on,
344
+ shouldContainFocus = _this$props3.shouldContainFocus;
343
345
  let onClick;
344
346
  let onFocus;
345
347
  let onMouseOut;
@@ -72,10 +72,12 @@ let Popover = (_dec = (0, _bidirectional.bidirectional)(), _dec2 = (0, _testable
72
72
  this.ref = null;
73
73
 
74
74
  this.handleRef = el => {
75
- var _this$props$elementRe, _this$props;
76
-
75
+ const elementRef = this.props.elementRef;
77
76
  this.ref = el;
78
- (_this$props$elementRe = (_this$props = this.props).elementRef) === null || _this$props$elementRe === void 0 ? void 0 : _this$props$elementRe.call(_this$props, el);
77
+
78
+ if (typeof elementRef === 'function') {
79
+ elementRef(el);
80
+ }
79
81
  };
80
82
 
81
83
  this.show = event => {
@@ -89,9 +91,9 @@ let Popover = (_dec = (0, _bidirectional.bidirectional)(), _dec2 = (0, _testable
89
91
  };
90
92
 
91
93
  this.hide = (event, documentClick = false) => {
92
- const _this$props2 = this.props,
93
- onHideContent = _this$props2.onHideContent,
94
- isShowingContent = _this$props2.isShowingContent;
94
+ const _this$props = this.props,
95
+ onHideContent = _this$props.onHideContent,
96
+ isShowingContent = _this$props.isShowingContent;
95
97
 
96
98
  if (typeof isShowingContent === 'undefined') {
97
99
  // uncontrolled, set state, fire callbacks
@@ -284,9 +286,9 @@ let Popover = (_dec = (0, _bidirectional.bidirectional)(), _dec2 = (0, _testable
284
286
  }
285
287
 
286
288
  computeOffsets(placement) {
287
- let _this$props3 = this.props,
288
- offsetX = _this$props3.offsetX,
289
- offsetY = _this$props3.offsetY;
289
+ let _this$props2 = this.props,
290
+ offsetX = _this$props2.offsetX,
291
+ offsetY = _this$props2.offsetY;
290
292
 
291
293
  if (this.props.shouldAlignArrow && this._view) {
292
294
  const secondaryPlacement = (0, _parsePlacement.parsePlacement)(placement)[1]; // arrowSize and arrowBorderWidth are component theme variables
@@ -356,9 +358,9 @@ let Popover = (_dec = (0, _bidirectional.bidirectional)(), _dec2 = (0, _testable
356
358
  let trigger = (0, _callRenderProp.callRenderProp)(this.props.renderTrigger);
357
359
 
358
360
  if (trigger) {
359
- const _this$props4 = this.props,
360
- on = _this$props4.on,
361
- shouldContainFocus = _this$props4.shouldContainFocus;
361
+ const _this$props3 = this.props,
362
+ on = _this$props3.on,
363
+ shouldContainFocus = _this$props3.shouldContainFocus;
362
364
  let onClick;
363
365
  let onFocus;
364
366
  let onMouseOut;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instructure/ui-popover",
3
- "version": "8.10.3-snapshot.22+f96f8c48e",
3
+ "version": "8.10.3-snapshot.23+5aaa29662",
4
4
  "description": "A component for hiding or showing content based on user interaction.",
5
5
  "author": "Instructure, Inc. Engineering and Product Design",
6
6
  "type": "commonjs",
@@ -25,28 +25,28 @@
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/ui-a11y-utils": "8.10.3-snapshot.22+f96f8c48e",
31
- "@instructure/ui-dialog": "8.10.3-snapshot.22+f96f8c48e",
32
- "@instructure/ui-dom-utils": "8.10.3-snapshot.22+f96f8c48e",
33
- "@instructure/ui-i18n": "8.10.3-snapshot.22+f96f8c48e",
34
- "@instructure/ui-position": "8.10.3-snapshot.22+f96f8c48e",
35
- "@instructure/ui-prop-types": "8.10.3-snapshot.22+f96f8c48e",
36
- "@instructure/ui-react-utils": "8.10.3-snapshot.22+f96f8c48e",
37
- "@instructure/ui-testable": "8.10.3-snapshot.22+f96f8c48e",
38
- "@instructure/ui-utils": "8.10.3-snapshot.22+f96f8c48e",
39
- "@instructure/ui-view": "8.10.3-snapshot.22+f96f8c48e",
40
- "@instructure/uid": "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/ui-a11y-utils": "8.10.3-snapshot.23+5aaa29662",
31
+ "@instructure/ui-dialog": "8.10.3-snapshot.23+5aaa29662",
32
+ "@instructure/ui-dom-utils": "8.10.3-snapshot.23+5aaa29662",
33
+ "@instructure/ui-i18n": "8.10.3-snapshot.23+5aaa29662",
34
+ "@instructure/ui-position": "8.10.3-snapshot.23+5aaa29662",
35
+ "@instructure/ui-prop-types": "8.10.3-snapshot.23+5aaa29662",
36
+ "@instructure/ui-react-utils": "8.10.3-snapshot.23+5aaa29662",
37
+ "@instructure/ui-testable": "8.10.3-snapshot.23+5aaa29662",
38
+ "@instructure/ui-utils": "8.10.3-snapshot.23+5aaa29662",
39
+ "@instructure/ui-view": "8.10.3-snapshot.23+5aaa29662",
40
+ "@instructure/uid": "8.10.3-snapshot.23+5aaa29662",
41
41
  "keycode": "^2",
42
42
  "prop-types": "^15"
43
43
  },
44
44
  "devDependencies": {
45
- "@instructure/ui-babel-preset": "8.10.3-snapshot.22+f96f8c48e",
46
- "@instructure/ui-color-utils": "8.10.3-snapshot.22+f96f8c48e",
47
- "@instructure/ui-test-locator": "8.10.3-snapshot.22+f96f8c48e",
48
- "@instructure/ui-test-queries": "8.10.3-snapshot.22+f96f8c48e",
49
- "@instructure/ui-test-utils": "8.10.3-snapshot.22+f96f8c48e"
45
+ "@instructure/ui-babel-preset": "8.10.3-snapshot.23+5aaa29662",
46
+ "@instructure/ui-color-utils": "8.10.3-snapshot.23+5aaa29662",
47
+ "@instructure/ui-test-locator": "8.10.3-snapshot.23+5aaa29662",
48
+ "@instructure/ui-test-queries": "8.10.3-snapshot.23+5aaa29662",
49
+ "@instructure/ui-test-utils": "8.10.3-snapshot.23+5aaa29662"
50
50
  },
51
51
  "peerDependencies": {
52
52
  "react": ">=16.8 <=17"
@@ -55,5 +55,5 @@
55
55
  "access": "public"
56
56
  },
57
57
  "sideEffects": false,
58
- "gitHead": "f96f8c48efab7806609098e1f00a6953b2884601"
58
+ "gitHead": "5aaa296621d72faebe1a809a8895a8185587008d"
59
59
  }
@@ -156,8 +156,13 @@ class Popover extends Component<PopoverProps> {
156
156
  ref: Element | null = null
157
157
 
158
158
  handleRef = (el: Element | null) => {
159
+ const { elementRef } = this.props
160
+
159
161
  this.ref = el
160
- this.props.elementRef?.(el)
162
+
163
+ if (typeof elementRef === 'function') {
164
+ elementRef(el)
165
+ }
161
166
  }
162
167
 
163
168
  get isTooltip() {
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/Popover/index.tsx"],"names":[],"mappings":"AAwBA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAiBxC,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,2BAA2B,CAAA;AAS1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,SAAS,CAAA;AAG3C;;;;;GAKG;AACH,cAEM,OAAQ,SAAQ,SAAS,CAAC,YAAY,CAAC;IAC3C,MAAM,CAAC,QAAQ,CAAC,WAAW,aAAY;IAEvC,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAAe;IAClC,MAAM,CAAC,SAAS;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAAY;IAE5B,MAAM,CAAC,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;MA8ClB;IAED,gBAAgB,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,SAAS,CAAA;IACrD,eAAe,EAAE,CAAC,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,GAAG,GAAG,SAAS,CAAA;gBAGxC,KAAK,KAAA;IAkCjB,IAAI,EAAE,yBAAyB,EAAE,CAAK;IAEtC,GAAG,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