@instructure/ui-popover 8.12.1-snapshot.43 → 8.12.1-snapshot.47
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/PopoverLocator.js +9 -3
- package/es/Popover/index.js +16 -12
- package/lib/Popover/PopoverLocator.js +11 -4
- package/lib/Popover/index.js +17 -13
- package/lib/Popover/props.js +1 -1
- package/package.json +20 -20
|
@@ -27,9 +27,15 @@ import { PositionLocator } from '@instructure/ui-position/es/Position/PositionLo
|
|
|
27
27
|
import { Popover } from './index';
|
|
28
28
|
import { PopoverTriggerLocator } from './PopoverTriggerLocator';
|
|
29
29
|
export const customMethods = {
|
|
30
|
-
findContent: (
|
|
31
|
-
|
|
32
|
-
|
|
30
|
+
findContent: function () {
|
|
31
|
+
return PositionLocator.findContent(...arguments);
|
|
32
|
+
},
|
|
33
|
+
findPositionTarget: function () {
|
|
34
|
+
return PositionLocator.findTarget(...arguments);
|
|
35
|
+
},
|
|
36
|
+
findTrigger: function () {
|
|
37
|
+
return PopoverTriggerLocator.find(...arguments);
|
|
38
|
+
}
|
|
33
39
|
};
|
|
34
40
|
export { PopoverTriggerLocator };
|
|
35
41
|
export const PopoverLocator = locator(Popover.selector, customMethods);
|
package/es/Popover/index.js
CHANGED
|
@@ -46,7 +46,10 @@ tags: overlay, portal, dialog
|
|
|
46
46
|
|
|
47
47
|
let Popover = (_dec = textDirectionContextConsumer(), _dec2 = testable(), _dec(_class = _dec2(_class = (_temp = _class2 = class Popover extends Component {
|
|
48
48
|
constructor(props) {
|
|
49
|
+
var _this;
|
|
50
|
+
|
|
49
51
|
super(props);
|
|
52
|
+
_this = this;
|
|
50
53
|
this._handleMouseOver = void 0;
|
|
51
54
|
this._handleMouseOut = void 0;
|
|
52
55
|
this._raf = [];
|
|
@@ -71,16 +74,17 @@ let Popover = (_dec = textDirectionContextConsumer(), _dec2 = testable(), _dec(_
|
|
|
71
74
|
this.props.onShowContent(event);
|
|
72
75
|
};
|
|
73
76
|
|
|
74
|
-
this.hide = (event
|
|
75
|
-
|
|
77
|
+
this.hide = function (event) {
|
|
78
|
+
let documentClick = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
79
|
+
const _this$props = _this.props,
|
|
76
80
|
onHideContent = _this$props.onHideContent,
|
|
77
81
|
isShowingContent = _this$props.isShowingContent;
|
|
78
82
|
|
|
79
83
|
if (typeof isShowingContent === 'undefined') {
|
|
80
84
|
// uncontrolled, set state, fire callbacks
|
|
81
|
-
|
|
82
|
-
isShowingContent
|
|
83
|
-
|
|
85
|
+
_this.setState(_ref => {
|
|
86
|
+
let isShowingContent = _ref.isShowingContent;
|
|
87
|
+
|
|
84
88
|
if (isShowingContent) {
|
|
85
89
|
onHideContent(event, {
|
|
86
90
|
documentClick
|
|
@@ -107,16 +111,16 @@ let Popover = (_dec = textDirectionContextConsumer(), _dec2 = testable(), _dec(_
|
|
|
107
111
|
}
|
|
108
112
|
};
|
|
109
113
|
|
|
110
|
-
this.handleDialogDismiss = (
|
|
111
|
-
if (!
|
|
112
|
-
const trigger = findDOMNode(
|
|
114
|
+
this.handleDialogDismiss = function () {
|
|
115
|
+
if (!_this.props.shouldReturnFocus && _this.props.shouldFocusContentOnTriggerBlur) {
|
|
116
|
+
const trigger = findDOMNode(_this._trigger);
|
|
113
117
|
|
|
114
118
|
if (trigger && typeof trigger.focus === 'function') {
|
|
115
119
|
trigger.focus();
|
|
116
120
|
}
|
|
117
121
|
}
|
|
118
122
|
|
|
119
|
-
|
|
123
|
+
_this.hide(...arguments);
|
|
120
124
|
};
|
|
121
125
|
|
|
122
126
|
this.handleDialogBlur = event => {
|
|
@@ -498,9 +502,9 @@ let Popover = (_dec = textDirectionContextConsumer(), _dec2 = testable(), _dec(_
|
|
|
498
502
|
shouldFocusContentOnTriggerBlur: false,
|
|
499
503
|
shouldCloseOnEscape: true,
|
|
500
504
|
onShowContent: event => {},
|
|
501
|
-
onHideContent: (event, {
|
|
502
|
-
documentClick
|
|
503
|
-
}
|
|
505
|
+
onHideContent: (event, _ref2) => {
|
|
506
|
+
let documentClick = _ref2.documentClick;
|
|
507
|
+
},
|
|
504
508
|
onClick: event => {},
|
|
505
509
|
onFocus: event => {},
|
|
506
510
|
onBlur: event => {},
|
|
@@ -3,13 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.PopoverLocator = void 0;
|
|
6
7
|
Object.defineProperty(exports, "PopoverTriggerLocator", {
|
|
7
8
|
enumerable: true,
|
|
8
9
|
get: function () {
|
|
9
10
|
return _PopoverTriggerLocator.PopoverTriggerLocator;
|
|
10
11
|
}
|
|
11
12
|
});
|
|
12
|
-
exports.
|
|
13
|
+
exports.customMethods = void 0;
|
|
13
14
|
|
|
14
15
|
var _locator = require("@instructure/ui-test-locator/lib/utils/locator.js");
|
|
15
16
|
|
|
@@ -44,9 +45,15 @@ var _PopoverTriggerLocator = require("./PopoverTriggerLocator");
|
|
|
44
45
|
*/
|
|
45
46
|
// eslint-disable-next-line no-restricted-imports
|
|
46
47
|
const customMethods = {
|
|
47
|
-
findContent: (
|
|
48
|
-
|
|
49
|
-
|
|
48
|
+
findContent: function () {
|
|
49
|
+
return _PositionLocator.PositionLocator.findContent(...arguments);
|
|
50
|
+
},
|
|
51
|
+
findPositionTarget: function () {
|
|
52
|
+
return _PositionLocator.PositionLocator.findTarget(...arguments);
|
|
53
|
+
},
|
|
54
|
+
findTrigger: function () {
|
|
55
|
+
return _PopoverTriggerLocator.PopoverTriggerLocator.find(...arguments);
|
|
56
|
+
}
|
|
50
57
|
};
|
|
51
58
|
exports.customMethods = customMethods;
|
|
52
59
|
const PopoverLocator = (0, _locator.locator)(_index.Popover.selector, customMethods);
|
package/lib/Popover/index.js
CHANGED
|
@@ -7,7 +7,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
7
7
|
Object.defineProperty(exports, "__esModule", {
|
|
8
8
|
value: true
|
|
9
9
|
});
|
|
10
|
-
exports.
|
|
10
|
+
exports.default = exports.Popover = void 0;
|
|
11
11
|
|
|
12
12
|
var _react = _interopRequireWildcard(require("react"));
|
|
13
13
|
|
|
@@ -65,7 +65,10 @@ tags: overlay, portal, dialog
|
|
|
65
65
|
**/
|
|
66
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
|
+
var _this;
|
|
69
|
+
|
|
68
70
|
super(props);
|
|
71
|
+
_this = this;
|
|
69
72
|
this._handleMouseOver = void 0;
|
|
70
73
|
this._handleMouseOut = void 0;
|
|
71
74
|
this._raf = [];
|
|
@@ -90,16 +93,17 @@ let Popover = (_dec = (0, _textDirectionContextConsumer.textDirectionContextCons
|
|
|
90
93
|
this.props.onShowContent(event);
|
|
91
94
|
};
|
|
92
95
|
|
|
93
|
-
this.hide = (event
|
|
94
|
-
|
|
96
|
+
this.hide = function (event) {
|
|
97
|
+
let documentClick = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : false;
|
|
98
|
+
const _this$props = _this.props,
|
|
95
99
|
onHideContent = _this$props.onHideContent,
|
|
96
100
|
isShowingContent = _this$props.isShowingContent;
|
|
97
101
|
|
|
98
102
|
if (typeof isShowingContent === 'undefined') {
|
|
99
103
|
// uncontrolled, set state, fire callbacks
|
|
100
|
-
|
|
101
|
-
isShowingContent
|
|
102
|
-
|
|
104
|
+
_this.setState(_ref => {
|
|
105
|
+
let isShowingContent = _ref.isShowingContent;
|
|
106
|
+
|
|
103
107
|
if (isShowingContent) {
|
|
104
108
|
onHideContent(event, {
|
|
105
109
|
documentClick
|
|
@@ -126,16 +130,16 @@ let Popover = (_dec = (0, _textDirectionContextConsumer.textDirectionContextCons
|
|
|
126
130
|
}
|
|
127
131
|
};
|
|
128
132
|
|
|
129
|
-
this.handleDialogDismiss = (
|
|
130
|
-
if (!
|
|
131
|
-
const trigger = (0, _findDOMNode.findDOMNode)(
|
|
133
|
+
this.handleDialogDismiss = function () {
|
|
134
|
+
if (!_this.props.shouldReturnFocus && _this.props.shouldFocusContentOnTriggerBlur) {
|
|
135
|
+
const trigger = (0, _findDOMNode.findDOMNode)(_this._trigger);
|
|
132
136
|
|
|
133
137
|
if (trigger && typeof trigger.focus === 'function') {
|
|
134
138
|
trigger.focus();
|
|
135
139
|
}
|
|
136
140
|
}
|
|
137
141
|
|
|
138
|
-
|
|
142
|
+
_this.hide(...arguments);
|
|
139
143
|
};
|
|
140
144
|
|
|
141
145
|
this.handleDialogBlur = event => {
|
|
@@ -517,9 +521,9 @@ let Popover = (_dec = (0, _textDirectionContextConsumer.textDirectionContextCons
|
|
|
517
521
|
shouldFocusContentOnTriggerBlur: false,
|
|
518
522
|
shouldCloseOnEscape: true,
|
|
519
523
|
onShowContent: event => {},
|
|
520
|
-
onHideContent: (event, {
|
|
521
|
-
documentClick
|
|
522
|
-
}
|
|
524
|
+
onHideContent: (event, _ref2) => {
|
|
525
|
+
let documentClick = _ref2.documentClick;
|
|
526
|
+
},
|
|
523
527
|
onClick: event => {},
|
|
524
528
|
onFocus: event => {},
|
|
525
529
|
onBlur: event => {},
|
package/lib/Popover/props.js
CHANGED
|
@@ -5,7 +5,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", {
|
|
6
6
|
value: true
|
|
7
7
|
});
|
|
8
|
-
exports.
|
|
8
|
+
exports.propTypes = exports.allowedProps = void 0;
|
|
9
9
|
|
|
10
10
|
var _propTypes = _interopRequireDefault(require("prop-types"));
|
|
11
11
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-popover",
|
|
3
|
-
"version": "8.12.1-snapshot.
|
|
3
|
+
"version": "8.12.1-snapshot.47+70bc15c4e",
|
|
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.12.1-snapshot.
|
|
29
|
-
"@instructure/emotion": "8.12.1-snapshot.
|
|
30
|
-
"@instructure/ui-a11y-utils": "8.12.1-snapshot.
|
|
31
|
-
"@instructure/ui-dialog": "8.12.1-snapshot.
|
|
32
|
-
"@instructure/ui-dom-utils": "8.12.1-snapshot.
|
|
33
|
-
"@instructure/ui-i18n": "8.12.1-snapshot.
|
|
34
|
-
"@instructure/ui-position": "8.12.1-snapshot.
|
|
35
|
-
"@instructure/ui-prop-types": "8.12.1-snapshot.
|
|
36
|
-
"@instructure/ui-react-utils": "8.12.1-snapshot.
|
|
37
|
-
"@instructure/ui-testable": "8.12.1-snapshot.
|
|
38
|
-
"@instructure/ui-utils": "8.12.1-snapshot.
|
|
39
|
-
"@instructure/ui-view": "8.12.1-snapshot.
|
|
40
|
-
"@instructure/uid": "8.12.1-snapshot.
|
|
28
|
+
"@instructure/console": "8.12.1-snapshot.47+70bc15c4e",
|
|
29
|
+
"@instructure/emotion": "8.12.1-snapshot.47+70bc15c4e",
|
|
30
|
+
"@instructure/ui-a11y-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
31
|
+
"@instructure/ui-dialog": "8.12.1-snapshot.47+70bc15c4e",
|
|
32
|
+
"@instructure/ui-dom-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
33
|
+
"@instructure/ui-i18n": "8.12.1-snapshot.47+70bc15c4e",
|
|
34
|
+
"@instructure/ui-position": "8.12.1-snapshot.47+70bc15c4e",
|
|
35
|
+
"@instructure/ui-prop-types": "8.12.1-snapshot.47+70bc15c4e",
|
|
36
|
+
"@instructure/ui-react-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
37
|
+
"@instructure/ui-testable": "8.12.1-snapshot.47+70bc15c4e",
|
|
38
|
+
"@instructure/ui-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
39
|
+
"@instructure/ui-view": "8.12.1-snapshot.47+70bc15c4e",
|
|
40
|
+
"@instructure/uid": "8.12.1-snapshot.47+70bc15c4e",
|
|
41
41
|
"keycode": "^2",
|
|
42
42
|
"prop-types": "^15"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@instructure/ui-babel-preset": "8.12.1-snapshot.
|
|
46
|
-
"@instructure/ui-color-utils": "8.12.1-snapshot.
|
|
47
|
-
"@instructure/ui-test-locator": "8.12.1-snapshot.
|
|
48
|
-
"@instructure/ui-test-queries": "8.12.1-snapshot.
|
|
49
|
-
"@instructure/ui-test-utils": "8.12.1-snapshot.
|
|
45
|
+
"@instructure/ui-babel-preset": "8.12.1-snapshot.47+70bc15c4e",
|
|
46
|
+
"@instructure/ui-color-utils": "8.12.1-snapshot.47+70bc15c4e",
|
|
47
|
+
"@instructure/ui-test-locator": "8.12.1-snapshot.47+70bc15c4e",
|
|
48
|
+
"@instructure/ui-test-queries": "8.12.1-snapshot.47+70bc15c4e",
|
|
49
|
+
"@instructure/ui-test-utils": "8.12.1-snapshot.47+70bc15c4e"
|
|
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": "70bc15c4e8d89589a1372954f7a230ddde5ef71b"
|
|
59
59
|
}
|