@instructure/ui-popover 8.11.2-snapshot.7 → 8.12.0
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/CHANGELOG.md +4 -0
- package/es/Popover/index.js +4 -4
- package/es/package.json +1 -0
- package/lib/Popover/index.js +4 -4
- package/package.json +20 -21
- package/src/Popover/index.tsx +4 -4
- package/LICENSE.md +0 -27
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,10 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [8.12.0](https://github.com/instructure/instructure-ui/compare/v8.11.1...v8.12.0) (2021-11-17)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-popover
|
|
9
|
+
|
|
6
10
|
## [8.11.1](https://github.com/instructure/instructure-ui/compare/v8.11.0...v8.11.1) (2021-10-19)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @instructure/ui-popover
|
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/es/package.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"type":"module"}
|
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.
|
|
3
|
+
"version": "8.12.0",
|
|
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.
|
|
29
|
-
"@instructure/emotion": "8.
|
|
30
|
-
"@instructure/ui-a11y-utils": "8.
|
|
31
|
-
"@instructure/ui-dialog": "8.
|
|
32
|
-
"@instructure/ui-dom-utils": "8.
|
|
33
|
-
"@instructure/ui-i18n": "8.
|
|
34
|
-
"@instructure/ui-position": "8.
|
|
35
|
-
"@instructure/ui-prop-types": "8.
|
|
36
|
-
"@instructure/ui-react-utils": "8.
|
|
37
|
-
"@instructure/ui-testable": "8.
|
|
38
|
-
"@instructure/ui-utils": "8.
|
|
39
|
-
"@instructure/ui-view": "8.
|
|
40
|
-
"@instructure/uid": "8.
|
|
28
|
+
"@instructure/console": "8.12.0",
|
|
29
|
+
"@instructure/emotion": "8.12.0",
|
|
30
|
+
"@instructure/ui-a11y-utils": "8.12.0",
|
|
31
|
+
"@instructure/ui-dialog": "8.12.0",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.12.0",
|
|
33
|
+
"@instructure/ui-i18n": "8.12.0",
|
|
34
|
+
"@instructure/ui-position": "8.12.0",
|
|
35
|
+
"@instructure/ui-prop-types": "8.12.0",
|
|
36
|
+
"@instructure/ui-react-utils": "8.12.0",
|
|
37
|
+
"@instructure/ui-testable": "8.12.0",
|
|
38
|
+
"@instructure/ui-utils": "8.12.0",
|
|
39
|
+
"@instructure/ui-view": "8.12.0",
|
|
40
|
+
"@instructure/uid": "8.12.0",
|
|
41
41
|
"keycode": "^2",
|
|
42
42
|
"prop-types": "^15"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@instructure/ui-babel-preset": "8.
|
|
46
|
-
"@instructure/ui-color-utils": "8.
|
|
47
|
-
"@instructure/ui-test-locator": "8.
|
|
48
|
-
"@instructure/ui-test-queries": "8.
|
|
49
|
-
"@instructure/ui-test-utils": "8.
|
|
45
|
+
"@instructure/ui-babel-preset": "8.12.0",
|
|
46
|
+
"@instructure/ui-color-utils": "8.12.0",
|
|
47
|
+
"@instructure/ui-test-locator": "8.12.0",
|
|
48
|
+
"@instructure/ui-test-queries": "8.12.0",
|
|
49
|
+
"@instructure/ui-test-utils": "8.12.0"
|
|
50
50
|
},
|
|
51
51
|
"peerDependencies": {
|
|
52
52
|
"react": ">=16.8 <=17"
|
|
@@ -54,6 +54,5 @@
|
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
|
-
"sideEffects": false
|
|
58
|
-
"gitHead": "2681e145ad469e1396536d3e9eed75a19995eb8a"
|
|
57
|
+
"sideEffects": false
|
|
59
58
|
}
|
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
|
}
|
package/LICENSE.md
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: The MIT License (MIT)
|
|
3
|
-
category: Getting Started
|
|
4
|
-
order: 9
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
# The MIT License (MIT)
|
|
8
|
-
|
|
9
|
-
Copyright (c) 2015 Instructure, Inc.
|
|
10
|
-
|
|
11
|
-
**Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
12
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
13
|
-
in the Software without restriction, including without limitation the rights
|
|
14
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
15
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
16
|
-
furnished to do so, subject to the following conditions.**
|
|
17
|
-
|
|
18
|
-
The above copyright notice and this permission notice shall be included in all
|
|
19
|
-
copies or substantial portions of the Software.
|
|
20
|
-
|
|
21
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
22
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
23
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
24
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
25
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
26
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
27
|
-
SOFTWARE.
|