@instructure/ui-popover 8.11.2-snapshot.56 → 8.11.2-snapshot.69
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/Popover/index.js +4 -4
- package/lib/Popover/index.js +4 -4
- package/package.json +20 -20
- package/src/Popover/index.tsx +4 -4
package/es/Popover/index.js
CHANGED
|
@@ -28,7 +28,7 @@ import keycode from 'keycode';
|
|
|
28
28
|
import { Position, parsePlacement, mirrorHorizontalPlacement } from '@instructure/ui-position';
|
|
29
29
|
import { ContextView, View } from '@instructure/ui-view';
|
|
30
30
|
import { Dialog } from '@instructure/ui-dialog';
|
|
31
|
-
import {
|
|
31
|
+
import { textDirectionContextConsumer } from '@instructure/ui-i18n';
|
|
32
32
|
import { findDOMNode, containsActiveElement, requestAnimationFrame, handleMouseOverOut } from '@instructure/ui-dom-utils';
|
|
33
33
|
import { safeCloneElement, callRenderProp } from '@instructure/ui-react-utils';
|
|
34
34
|
import { createChainedFunction, shallowEqual, px } from '@instructure/ui-utils';
|
|
@@ -44,7 +44,7 @@ tags: overlay, portal, dialog
|
|
|
44
44
|
---
|
|
45
45
|
**/
|
|
46
46
|
|
|
47
|
-
let Popover = (_dec =
|
|
47
|
+
let Popover = (_dec = textDirectionContextConsumer(), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class Popover extends Component {
|
|
48
48
|
constructor(props) {
|
|
49
49
|
super(props);
|
|
50
50
|
this._handleMouseOver = void 0;
|
|
@@ -302,7 +302,7 @@ let Popover = (_dec = bidirectional(), _dec2 = testable(), _dec(_class = _dec2(_
|
|
|
302
302
|
get placement() {
|
|
303
303
|
let placement = this.props.placement;
|
|
304
304
|
const dir = this.props.dir;
|
|
305
|
-
const isRtl = dir ===
|
|
305
|
+
const isRtl = dir === textDirectionContextConsumer.DIRECTION.rtl;
|
|
306
306
|
|
|
307
307
|
if (isRtl) {
|
|
308
308
|
placement = mirrorHorizontalPlacement(placement, ' ');
|
|
@@ -434,7 +434,7 @@ let Popover = (_dec = bidirectional(), _dec2 = testable(), _dec(_class = _dec2(_
|
|
|
434
434
|
viewProps = { ...viewProps,
|
|
435
435
|
// TODO: remove background override after contextview is updated
|
|
436
436
|
background: color === 'primary' ? 'default' : 'inverse',
|
|
437
|
-
placement: this.props.dir ===
|
|
437
|
+
placement: this.props.dir === textDirectionContextConsumer.DIRECTION.rtl ? mirrorHorizontalPlacement(placement, ' ') : placement
|
|
438
438
|
};
|
|
439
439
|
} else {
|
|
440
440
|
ViewElement = View;
|
package/lib/Popover/index.js
CHANGED
|
@@ -25,7 +25,7 @@ var _View = require("@instructure/ui-view/lib/View");
|
|
|
25
25
|
|
|
26
26
|
var _Dialog = require("@instructure/ui-dialog/lib/Dialog");
|
|
27
27
|
|
|
28
|
-
var
|
|
28
|
+
var _textDirectionContextConsumer = require("@instructure/ui-i18n/lib/textDirectionContextConsumer.js");
|
|
29
29
|
|
|
30
30
|
var _findDOMNode = require("@instructure/ui-dom-utils/lib/findDOMNode.js");
|
|
31
31
|
|
|
@@ -63,7 +63,7 @@ category: components
|
|
|
63
63
|
tags: overlay, portal, dialog
|
|
64
64
|
---
|
|
65
65
|
**/
|
|
66
|
-
let Popover = (_dec = (0,
|
|
66
|
+
let Popover = (_dec = (0, _textDirectionContextConsumer.textDirectionContextConsumer)(), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class Popover extends _react.Component {
|
|
67
67
|
constructor(props) {
|
|
68
68
|
super(props);
|
|
69
69
|
this._handleMouseOver = void 0;
|
|
@@ -321,7 +321,7 @@ let Popover = (_dec = (0, _bidirectional.bidirectional)(), _dec2 = (0, _testable
|
|
|
321
321
|
get placement() {
|
|
322
322
|
let placement = this.props.placement;
|
|
323
323
|
const dir = this.props.dir;
|
|
324
|
-
const isRtl = dir ===
|
|
324
|
+
const isRtl = dir === _textDirectionContextConsumer.textDirectionContextConsumer.DIRECTION.rtl;
|
|
325
325
|
|
|
326
326
|
if (isRtl) {
|
|
327
327
|
placement = (0, _mirrorHorizontalPlacement.mirrorHorizontalPlacement)(placement, ' ');
|
|
@@ -453,7 +453,7 @@ let Popover = (_dec = (0, _bidirectional.bidirectional)(), _dec2 = (0, _testable
|
|
|
453
453
|
viewProps = { ...viewProps,
|
|
454
454
|
// TODO: remove background override after contextview is updated
|
|
455
455
|
background: color === 'primary' ? 'default' : 'inverse',
|
|
456
|
-
placement: this.props.dir ===
|
|
456
|
+
placement: this.props.dir === _textDirectionContextConsumer.textDirectionContextConsumer.DIRECTION.rtl ? (0, _mirrorHorizontalPlacement.mirrorHorizontalPlacement)(placement, ' ') : placement
|
|
457
457
|
};
|
|
458
458
|
} else {
|
|
459
459
|
ViewElement = _View.View;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-popover",
|
|
3
|
-
"version": "8.11.2-snapshot.
|
|
3
|
+
"version": "8.11.2-snapshot.69+10d1551b9",
|
|
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.11.2-snapshot.
|
|
29
|
-
"@instructure/emotion": "8.11.2-snapshot.
|
|
30
|
-
"@instructure/ui-a11y-utils": "8.11.2-snapshot.
|
|
31
|
-
"@instructure/ui-dialog": "8.11.2-snapshot.
|
|
32
|
-
"@instructure/ui-dom-utils": "8.11.2-snapshot.
|
|
33
|
-
"@instructure/ui-i18n": "8.11.2-snapshot.
|
|
34
|
-
"@instructure/ui-position": "8.11.2-snapshot.
|
|
35
|
-
"@instructure/ui-prop-types": "8.11.2-snapshot.
|
|
36
|
-
"@instructure/ui-react-utils": "8.11.2-snapshot.
|
|
37
|
-
"@instructure/ui-testable": "8.11.2-snapshot.
|
|
38
|
-
"@instructure/ui-utils": "8.11.2-snapshot.
|
|
39
|
-
"@instructure/ui-view": "8.11.2-snapshot.
|
|
40
|
-
"@instructure/uid": "8.11.2-snapshot.
|
|
28
|
+
"@instructure/console": "8.11.2-snapshot.69+10d1551b9",
|
|
29
|
+
"@instructure/emotion": "8.11.2-snapshot.69+10d1551b9",
|
|
30
|
+
"@instructure/ui-a11y-utils": "8.11.2-snapshot.69+10d1551b9",
|
|
31
|
+
"@instructure/ui-dialog": "8.11.2-snapshot.69+10d1551b9",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.11.2-snapshot.69+10d1551b9",
|
|
33
|
+
"@instructure/ui-i18n": "8.11.2-snapshot.69+10d1551b9",
|
|
34
|
+
"@instructure/ui-position": "8.11.2-snapshot.69+10d1551b9",
|
|
35
|
+
"@instructure/ui-prop-types": "8.11.2-snapshot.69+10d1551b9",
|
|
36
|
+
"@instructure/ui-react-utils": "8.11.2-snapshot.69+10d1551b9",
|
|
37
|
+
"@instructure/ui-testable": "8.11.2-snapshot.69+10d1551b9",
|
|
38
|
+
"@instructure/ui-utils": "8.11.2-snapshot.69+10d1551b9",
|
|
39
|
+
"@instructure/ui-view": "8.11.2-snapshot.69+10d1551b9",
|
|
40
|
+
"@instructure/uid": "8.11.2-snapshot.69+10d1551b9",
|
|
41
41
|
"keycode": "^2",
|
|
42
42
|
"prop-types": "^15"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@instructure/ui-babel-preset": "8.11.2-snapshot.
|
|
46
|
-
"@instructure/ui-color-utils": "8.11.2-snapshot.
|
|
47
|
-
"@instructure/ui-test-locator": "8.11.2-snapshot.
|
|
48
|
-
"@instructure/ui-test-queries": "8.11.2-snapshot.
|
|
49
|
-
"@instructure/ui-test-utils": "8.11.2-snapshot.
|
|
45
|
+
"@instructure/ui-babel-preset": "8.11.2-snapshot.69+10d1551b9",
|
|
46
|
+
"@instructure/ui-color-utils": "8.11.2-snapshot.69+10d1551b9",
|
|
47
|
+
"@instructure/ui-test-locator": "8.11.2-snapshot.69+10d1551b9",
|
|
48
|
+
"@instructure/ui-test-queries": "8.11.2-snapshot.69+10d1551b9",
|
|
49
|
+
"@instructure/ui-test-utils": "8.11.2-snapshot.69+10d1551b9"
|
|
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": "
|
|
58
|
+
"gitHead": "10d1551b961c568d88c9c5f3393815f637662995"
|
|
59
59
|
}
|
package/src/Popover/index.tsx
CHANGED
|
@@ -32,7 +32,7 @@ import {
|
|
|
32
32
|
} from '@instructure/ui-position'
|
|
33
33
|
import { ContextView, View } from '@instructure/ui-view'
|
|
34
34
|
import { Dialog } from '@instructure/ui-dialog'
|
|
35
|
-
import {
|
|
35
|
+
import { textDirectionContextConsumer } from '@instructure/ui-i18n'
|
|
36
36
|
import {
|
|
37
37
|
findDOMNode,
|
|
38
38
|
containsActiveElement,
|
|
@@ -57,7 +57,7 @@ category: components
|
|
|
57
57
|
tags: overlay, portal, dialog
|
|
58
58
|
---
|
|
59
59
|
**/
|
|
60
|
-
@
|
|
60
|
+
@textDirectionContextConsumer()
|
|
61
61
|
@testable()
|
|
62
62
|
class Popover extends Component<PopoverProps> {
|
|
63
63
|
static readonly componentId = 'Popover'
|
|
@@ -291,7 +291,7 @@ class Popover extends Component<PopoverProps> {
|
|
|
291
291
|
get placement() {
|
|
292
292
|
let { placement } = this.props
|
|
293
293
|
const { dir } = this.props
|
|
294
|
-
const isRtl = dir ===
|
|
294
|
+
const isRtl = dir === textDirectionContextConsumer.DIRECTION.rtl
|
|
295
295
|
if (isRtl) {
|
|
296
296
|
placement = mirrorHorizontalPlacement(placement, ' ')
|
|
297
297
|
}
|
|
@@ -595,7 +595,7 @@ class Popover extends Component<PopoverProps> {
|
|
|
595
595
|
// @ts-expect-error ts-migrate(2322) FIXME: Type '"default" | "inverse"' is not assignable to ... Remove this comment to see the full error message
|
|
596
596
|
background: color === 'primary' ? 'default' : 'inverse',
|
|
597
597
|
placement:
|
|
598
|
-
this.props.dir ===
|
|
598
|
+
this.props.dir === textDirectionContextConsumer.DIRECTION.rtl
|
|
599
599
|
? mirrorHorizontalPlacement(placement, ' ')
|
|
600
600
|
: placement
|
|
601
601
|
}
|