@instructure/ui-modal 8.23.1-snapshot.7 → 8.24.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/Modal/ModalBody/index.js +17 -13
- package/es/Modal/ModalFooter/index.js +12 -8
- package/es/Modal/ModalHeader/index.js +11 -7
- package/es/Modal/ModalLocator.js +8 -4
- package/es/Modal/index.js +40 -49
- package/es/Modal/props.js +0 -99
- package/lib/Modal/ModalBody/index.js +17 -13
- package/lib/Modal/ModalFooter/index.js +12 -8
- package/lib/Modal/ModalHeader/index.js +11 -7
- package/lib/Modal/ModalLocator.js +7 -3
- package/lib/Modal/index.js +40 -49
- package/lib/Modal/props.js +0 -99
- package/package.json +21 -22
- package/src/Modal/ModalBody/index.tsx +7 -17
- package/src/Modal/ModalFooter/index.tsx +7 -10
- package/src/Modal/ModalHeader/index.tsx +9 -12
- package/src/Modal/index.tsx +24 -37
- package/src/Modal/props.ts +131 -97
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Modal/ModalBody/index.d.ts +2 -2
- package/types/Modal/ModalBody/index.d.ts.map +1 -1
- package/types/Modal/ModalFooter/index.d.ts +4 -4
- package/types/Modal/ModalFooter/index.d.ts.map +1 -1
- package/types/Modal/ModalHeader/index.d.ts +4 -4
- package/types/Modal/ModalHeader/index.d.ts.map +1 -1
- package/types/Modal/index.d.ts +13 -78
- package/types/Modal/index.d.ts.map +1 -1
- package/types/Modal/props.d.ts +108 -22
- package/types/Modal/props.d.ts.map +1 -1
- 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.24.0](https://github.com/instructure/instructure-ui/compare/v8.23.0...v8.24.0) (2022-04-26)
|
|
7
|
+
|
|
8
|
+
**Note:** Version bump only for package @instructure/ui-modal
|
|
9
|
+
|
|
6
10
|
# [8.23.0](https://github.com/instructure/instructure-ui/compare/v8.22.0...v8.23.0) (2022-04-07)
|
|
7
11
|
|
|
8
12
|
**Note:** Version bump only for package @instructure/ui-modal
|
|
@@ -42,6 +42,7 @@ import { propTypes, allowedProps } from './props';
|
|
|
42
42
|
parent: Modal
|
|
43
43
|
id: Modal.Body
|
|
44
44
|
---
|
|
45
|
+
@tsProps
|
|
45
46
|
**/
|
|
46
47
|
let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class ModalBody extends Component {
|
|
47
48
|
constructor() {
|
|
@@ -59,24 +60,28 @@ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
59
60
|
}
|
|
60
61
|
|
|
61
62
|
componentDidMount() {
|
|
62
|
-
|
|
63
|
+
var _this$props$makeStyle, _this$props;
|
|
64
|
+
|
|
65
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
63
66
|
}
|
|
64
67
|
|
|
65
|
-
componentDidUpdate(
|
|
66
|
-
|
|
68
|
+
componentDidUpdate() {
|
|
69
|
+
var _this$props$makeStyle2, _this$props2;
|
|
70
|
+
|
|
71
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
render() {
|
|
70
75
|
var _this$props$styles;
|
|
71
76
|
|
|
72
|
-
const _this$
|
|
73
|
-
as = _this$
|
|
74
|
-
elementRef = _this$
|
|
75
|
-
overflow = _this$
|
|
76
|
-
variant = _this$
|
|
77
|
-
padding = _this$
|
|
78
|
-
children = _this$
|
|
79
|
-
rest = _objectWithoutProperties(_this$
|
|
77
|
+
const _this$props3 = this.props,
|
|
78
|
+
as = _this$props3.as,
|
|
79
|
+
elementRef = _this$props3.elementRef,
|
|
80
|
+
overflow = _this$props3.overflow,
|
|
81
|
+
variant = _this$props3.variant,
|
|
82
|
+
padding = _this$props3.padding,
|
|
83
|
+
children = _this$props3.children,
|
|
84
|
+
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
80
85
|
|
|
81
86
|
const passthroughProps = View.omitViewProps(omitProps(rest, ModalBody.allowedProps), ModalBody);
|
|
82
87
|
const isFit = overflow === 'fit';
|
|
@@ -96,8 +101,7 @@ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
96
101
|
}, _class2.displayName = "ModalBody", _class2.componentId = 'Modal.Body', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
97
102
|
padding: 'medium',
|
|
98
103
|
as: 'div',
|
|
99
|
-
variant: 'default'
|
|
100
|
-
children: null
|
|
104
|
+
variant: 'default'
|
|
101
105
|
}, _class2)) || _class) || _class);
|
|
102
106
|
export default ModalBody;
|
|
103
107
|
export { ModalBody };
|
|
@@ -41,6 +41,7 @@ import { propTypes, allowedProps } from './props';
|
|
|
41
41
|
parent: Modal
|
|
42
42
|
id: Modal.Footer
|
|
43
43
|
---
|
|
44
|
+
@tsProps
|
|
44
45
|
**/
|
|
45
46
|
let ModalFooter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class ModalFooter extends Component {
|
|
46
47
|
constructor() {
|
|
@@ -53,19 +54,23 @@ let ModalFooter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
53
54
|
}
|
|
54
55
|
|
|
55
56
|
componentDidMount() {
|
|
56
|
-
|
|
57
|
+
var _this$props$makeStyle, _this$props;
|
|
58
|
+
|
|
59
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
57
60
|
}
|
|
58
61
|
|
|
59
|
-
componentDidUpdate(
|
|
60
|
-
|
|
62
|
+
componentDidUpdate() {
|
|
63
|
+
var _this$props$makeStyle2, _this$props2;
|
|
64
|
+
|
|
65
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
61
66
|
}
|
|
62
67
|
|
|
63
68
|
render() {
|
|
64
69
|
var _this$props$styles;
|
|
65
70
|
|
|
66
|
-
const _this$
|
|
67
|
-
children = _this$
|
|
68
|
-
rest = _objectWithoutProperties(_this$
|
|
71
|
+
const _this$props3 = this.props,
|
|
72
|
+
children = _this$props3.children,
|
|
73
|
+
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
69
74
|
|
|
70
75
|
return jsx("div", Object.assign({
|
|
71
76
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalFooter
|
|
@@ -75,8 +80,7 @@ let ModalFooter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
75
80
|
}
|
|
76
81
|
|
|
77
82
|
}, _class2.displayName = "ModalFooter", _class2.componentId = 'Modal.Footer', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
78
|
-
variant: 'default'
|
|
79
|
-
children: null
|
|
83
|
+
variant: 'default'
|
|
80
84
|
}, _class2)) || _class) || _class);
|
|
81
85
|
export default ModalFooter;
|
|
82
86
|
export { ModalFooter };
|
|
@@ -42,6 +42,7 @@ import { propTypes, allowedProps } from './props';
|
|
|
42
42
|
parent: Modal
|
|
43
43
|
id: Modal.Header
|
|
44
44
|
---
|
|
45
|
+
@tsProps
|
|
45
46
|
**/
|
|
46
47
|
let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class ModalHeader extends Component {
|
|
47
48
|
constructor() {
|
|
@@ -60,11 +61,15 @@ let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
60
61
|
}
|
|
61
62
|
|
|
62
63
|
componentDidMount() {
|
|
63
|
-
|
|
64
|
+
var _this$props$makeStyle, _this$props;
|
|
65
|
+
|
|
66
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStyleProps());
|
|
64
67
|
}
|
|
65
68
|
|
|
66
|
-
componentDidUpdate(
|
|
67
|
-
|
|
69
|
+
componentDidUpdate() {
|
|
70
|
+
var _this$props$makeStyle2, _this$props2;
|
|
71
|
+
|
|
72
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleProps());
|
|
68
73
|
}
|
|
69
74
|
|
|
70
75
|
get usesCloseButton() {
|
|
@@ -80,9 +85,9 @@ let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
80
85
|
render() {
|
|
81
86
|
var _this$props$styles;
|
|
82
87
|
|
|
83
|
-
const _this$
|
|
84
|
-
children = _this$
|
|
85
|
-
rest = _objectWithoutProperties(_this$
|
|
88
|
+
const _this$props3 = this.props,
|
|
89
|
+
children = _this$props3.children,
|
|
90
|
+
rest = _objectWithoutProperties(_this$props3, _excluded);
|
|
86
91
|
|
|
87
92
|
return jsx("div", Object.assign({
|
|
88
93
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalHeader
|
|
@@ -92,7 +97,6 @@ let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
92
97
|
}
|
|
93
98
|
|
|
94
99
|
}, _class2.displayName = "ModalHeader", _class2.componentId = 'Modal.Header', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
95
|
-
children: null,
|
|
96
100
|
variant: 'default',
|
|
97
101
|
spacing: 'default'
|
|
98
102
|
}, _class2)) || _class) || _class);
|
package/es/Modal/ModalLocator.js
CHANGED
|
@@ -22,10 +22,14 @@
|
|
|
22
22
|
* SOFTWARE.
|
|
23
23
|
*/
|
|
24
24
|
import { locator } from '@instructure/ui-test-locator';
|
|
25
|
-
import { Modal } from './index';
|
|
26
|
-
|
|
27
|
-
const
|
|
28
|
-
|
|
25
|
+
import { Modal } from './index'; // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
26
|
+
|
|
27
|
+
const ModalHeaderLocator = locator(Modal.Header.selector); // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
28
|
+
|
|
29
|
+
const ModalBodyLocator = locator(Modal.Body.selector); // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
30
|
+
|
|
31
|
+
const ModalFooterLocator = locator(Modal.Footer.selector); // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
32
|
+
|
|
29
33
|
export const ModalLocator = locator(Modal.selector, {
|
|
30
34
|
findHeader: function () {
|
|
31
35
|
return ModalHeaderLocator.find(...arguments);
|
package/es/Modal/index.js
CHANGED
|
@@ -49,11 +49,13 @@ import { propTypes, allowedProps } from './props';
|
|
|
49
49
|
category: components
|
|
50
50
|
tags: overlay, portal, dialog
|
|
51
51
|
---
|
|
52
|
+
@tsProps
|
|
52
53
|
**/
|
|
53
54
|
let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class Modal extends Component {
|
|
54
55
|
constructor(props) {
|
|
55
56
|
super(props);
|
|
56
57
|
this._DOMNode = null;
|
|
58
|
+
this._content = null;
|
|
57
59
|
this.ref = null;
|
|
58
60
|
|
|
59
61
|
this.handleRef = el => {
|
|
@@ -64,7 +66,7 @@ let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = te
|
|
|
64
66
|
this.DOMNode = DOMNode;
|
|
65
67
|
};
|
|
66
68
|
|
|
67
|
-
this.handleTransitionExited =
|
|
69
|
+
this.handleTransitionExited = () => {
|
|
68
70
|
this.setState({
|
|
69
71
|
transitioning: false
|
|
70
72
|
});
|
|
@@ -84,10 +86,14 @@ let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = te
|
|
|
84
86
|
}
|
|
85
87
|
|
|
86
88
|
componentDidMount() {
|
|
87
|
-
|
|
89
|
+
var _this$props$makeStyle, _this$props;
|
|
90
|
+
|
|
91
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
88
92
|
}
|
|
89
93
|
|
|
90
|
-
componentDidUpdate(prevProps
|
|
94
|
+
componentDidUpdate(prevProps) {
|
|
95
|
+
var _this$props$makeStyle2, _this$props2;
|
|
96
|
+
|
|
91
97
|
if (prevProps.open && !this.props.open) {
|
|
92
98
|
// closing
|
|
93
99
|
this.setState({
|
|
@@ -95,7 +101,7 @@ let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = te
|
|
|
95
101
|
});
|
|
96
102
|
}
|
|
97
103
|
|
|
98
|
-
this.props.makeStyles();
|
|
104
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
99
105
|
}
|
|
100
106
|
|
|
101
107
|
get defaultFocusElement() {
|
|
@@ -119,10 +125,10 @@ let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = te
|
|
|
119
125
|
}
|
|
120
126
|
|
|
121
127
|
renderChildren() {
|
|
122
|
-
const _this$
|
|
123
|
-
children = _this$
|
|
124
|
-
variant = _this$
|
|
125
|
-
overflow = _this$
|
|
128
|
+
const _this$props3 = this.props,
|
|
129
|
+
children = _this$props3.children,
|
|
130
|
+
variant = _this$props3.variant,
|
|
131
|
+
overflow = _this$props3.overflow;
|
|
126
132
|
return Children.map(children, child => {
|
|
127
133
|
if (!child) return; // ignore null, falsy children
|
|
128
134
|
|
|
@@ -140,16 +146,16 @@ let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = te
|
|
|
140
146
|
}
|
|
141
147
|
|
|
142
148
|
renderDialog(props) {
|
|
143
|
-
const _this$
|
|
144
|
-
onDismiss = _this$
|
|
145
|
-
label = _this$
|
|
146
|
-
shouldCloseOnDocumentClick = _this$
|
|
147
|
-
shouldReturnFocus = _this$
|
|
148
|
-
liveRegion = _this$
|
|
149
|
-
size = _this$
|
|
150
|
-
constrain = _this$
|
|
151
|
-
as = _this$
|
|
152
|
-
styles = _this$
|
|
149
|
+
const _this$props4 = this.props,
|
|
150
|
+
onDismiss = _this$props4.onDismiss,
|
|
151
|
+
label = _this$props4.label,
|
|
152
|
+
shouldCloseOnDocumentClick = _this$props4.shouldCloseOnDocumentClick,
|
|
153
|
+
shouldReturnFocus = _this$props4.shouldReturnFocus,
|
|
154
|
+
liveRegion = _this$props4.liveRegion,
|
|
155
|
+
size = _this$props4.size,
|
|
156
|
+
constrain = _this$props4.constrain,
|
|
157
|
+
as = _this$props4.as,
|
|
158
|
+
styles = _this$props4.styles;
|
|
153
159
|
const isFullScreen = size === 'fullscreen';
|
|
154
160
|
const dialog = jsx(Dialog, Object.assign({}, passthroughProps(props), {
|
|
155
161
|
as: as,
|
|
@@ -179,22 +185,22 @@ let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = te
|
|
|
179
185
|
render() {
|
|
180
186
|
var _this$props$styles;
|
|
181
187
|
|
|
182
|
-
const _this$
|
|
183
|
-
open = _this$
|
|
184
|
-
onOpen = _this$
|
|
185
|
-
onClose = _this$
|
|
186
|
-
mountNode = _this$
|
|
187
|
-
insertAt = _this$
|
|
188
|
-
transition = _this$
|
|
189
|
-
onEnter = _this$
|
|
190
|
-
onEntering = _this$
|
|
191
|
-
onEntered = _this$
|
|
192
|
-
onExit = _this$
|
|
193
|
-
onExiting = _this$
|
|
194
|
-
onExited = _this$
|
|
195
|
-
constrain = _this$
|
|
196
|
-
overflow = _this$
|
|
197
|
-
passthroughProps = _objectWithoutProperties(_this$
|
|
188
|
+
const _this$props5 = this.props,
|
|
189
|
+
open = _this$props5.open,
|
|
190
|
+
onOpen = _this$props5.onOpen,
|
|
191
|
+
onClose = _this$props5.onClose,
|
|
192
|
+
mountNode = _this$props5.mountNode,
|
|
193
|
+
insertAt = _this$props5.insertAt,
|
|
194
|
+
transition = _this$props5.transition,
|
|
195
|
+
onEnter = _this$props5.onEnter,
|
|
196
|
+
onEntering = _this$props5.onEntering,
|
|
197
|
+
onEntered = _this$props5.onEntered,
|
|
198
|
+
onExit = _this$props5.onExit,
|
|
199
|
+
onExiting = _this$props5.onExiting,
|
|
200
|
+
onExited = _this$props5.onExited,
|
|
201
|
+
constrain = _this$props5.constrain,
|
|
202
|
+
overflow = _this$props5.overflow,
|
|
203
|
+
passthroughProps = _objectWithoutProperties(_this$props5, _excluded);
|
|
198
204
|
|
|
199
205
|
const portalIsOpen = open || this.state.transitioning;
|
|
200
206
|
return jsx(Portal, {
|
|
@@ -225,24 +231,9 @@ let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = te
|
|
|
225
231
|
size: 'auto',
|
|
226
232
|
variant: 'default',
|
|
227
233
|
transition: 'fade',
|
|
228
|
-
onOpen: event => {},
|
|
229
|
-
onClose: event => {},
|
|
230
|
-
onDismiss: event => {},
|
|
231
|
-
onEnter: () => {},
|
|
232
|
-
onEntering: () => {},
|
|
233
|
-
onEntered: () => {},
|
|
234
|
-
onExit: () => {},
|
|
235
|
-
onExiting: () => {},
|
|
236
|
-
onExited: () => {},
|
|
237
|
-
as: void 0,
|
|
238
|
-
mountNode: null,
|
|
239
234
|
insertAt: 'bottom',
|
|
240
|
-
liveRegion: null,
|
|
241
|
-
contentRef: el => {},
|
|
242
235
|
shouldCloseOnDocumentClick: true,
|
|
243
236
|
shouldReturnFocus: true,
|
|
244
|
-
defaultFocusElement: null,
|
|
245
|
-
children: null,
|
|
246
237
|
constrain: 'window',
|
|
247
238
|
overflow: 'scroll'
|
|
248
239
|
}, _class2.Header = ModalHeader, _class2.Body = ModalBody, _class2.Footer = ModalFooter, _class2)) || _class) || _class);
|
package/es/Modal/props.js
CHANGED
|
@@ -28,129 +28,30 @@ import { ModalHeader } from './ModalHeader';
|
|
|
28
28
|
import { ModalBody } from './ModalBody';
|
|
29
29
|
import { ModalFooter } from './ModalFooter';
|
|
30
30
|
const propTypes = {
|
|
31
|
-
/**
|
|
32
|
-
* An accessible label for the `<Modal />` content
|
|
33
|
-
*/
|
|
34
31
|
label: PropTypes.string.isRequired,
|
|
35
|
-
|
|
36
|
-
/**
|
|
37
|
-
* The children to be rendered within the `<Modal />`
|
|
38
|
-
*/
|
|
39
32
|
children: ChildrenPropTypes.enforceOrder([ModalHeader, ModalBody, ModalFooter], [ModalHeader, ModalBody], [ModalBody, ModalFooter], [ModalBody]),
|
|
40
|
-
|
|
41
|
-
/**
|
|
42
|
-
* The element to render the dialog as, `span` by default
|
|
43
|
-
*/
|
|
44
33
|
as: PropTypes.elementType,
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* The size of the `<Modal />` content
|
|
48
|
-
*/
|
|
49
34
|
size: PropTypes.oneOf(['auto', 'small', 'medium', 'large', 'fullscreen']),
|
|
50
|
-
|
|
51
|
-
/**
|
|
52
|
-
* Designates the background style of the `<Modal />`
|
|
53
|
-
*/
|
|
54
35
|
variant: PropTypes.oneOf(['default', 'inverse']),
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Whether or not the `<Modal />` is open
|
|
58
|
-
*/
|
|
59
36
|
open: PropTypes.bool,
|
|
60
|
-
|
|
61
|
-
/**
|
|
62
|
-
* An element or a function returning an element to focus by default
|
|
63
|
-
*/
|
|
64
37
|
defaultFocusElement: PropTypes.oneOfType([PropTypes.element, PropTypes.func]),
|
|
65
|
-
|
|
66
|
-
/**
|
|
67
|
-
* Whether focus should be returned to the trigger when the `<Modal/>` is closed
|
|
68
|
-
*/
|
|
69
38
|
shouldReturnFocus: PropTypes.bool,
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Whether the `<Modal/>` should request close when the document is clicked
|
|
73
|
-
*/
|
|
74
39
|
shouldCloseOnDocumentClick: PropTypes.bool,
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Callback fired when `<Modal />` content has been mounted in the DOM
|
|
78
|
-
*/
|
|
79
40
|
onOpen: PropTypes.func,
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Callback fired when `<Modal />` has been unmounted from the DOM
|
|
83
|
-
*/
|
|
84
41
|
onClose: PropTypes.func,
|
|
85
|
-
|
|
86
|
-
/**
|
|
87
|
-
* Callback fired when the `<Modal />` is requesting to be closed
|
|
88
|
-
*/
|
|
89
42
|
onDismiss: PropTypes.func,
|
|
90
|
-
|
|
91
|
-
/**
|
|
92
|
-
*
|
|
93
|
-
* A function that returns a reference to the content element
|
|
94
|
-
*/
|
|
95
43
|
contentRef: PropTypes.func,
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* An element or a function returning an element to use as the mount node
|
|
99
|
-
* for the `<Modal />` (defaults to `document.body`)
|
|
100
|
-
*/
|
|
101
44
|
mountNode: PropTypes.oneOfType([element, PropTypes.func]),
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* Insert the element at the 'top' of the mountNode or at the 'bottom'
|
|
105
|
-
*/
|
|
106
45
|
insertAt: PropTypes.oneOf(['bottom', 'top']),
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* An element, function returning an element, or array of elements that will not be hidden from
|
|
110
|
-
* the screen reader when the `<Modal />` is open
|
|
111
|
-
*/
|
|
112
46
|
liveRegion: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.element), PropTypes.element, PropTypes.func]),
|
|
113
47
|
transition: transitionTypePropType,
|
|
114
|
-
|
|
115
|
-
/**
|
|
116
|
-
* Callback fired before the <Modal /> transitions in
|
|
117
|
-
*/
|
|
118
48
|
onEnter: PropTypes.func,
|
|
119
|
-
|
|
120
|
-
/**
|
|
121
|
-
* Callback fired as the <Modal /> begins to transition in
|
|
122
|
-
*/
|
|
123
49
|
onEntering: PropTypes.func,
|
|
124
|
-
|
|
125
|
-
/**
|
|
126
|
-
* Callback fired after the <Modal /> finishes transitioning in
|
|
127
|
-
*/
|
|
128
50
|
onEntered: PropTypes.func,
|
|
129
|
-
|
|
130
|
-
/**
|
|
131
|
-
* Callback fired right before the <Modal /> transitions out
|
|
132
|
-
*/
|
|
133
51
|
onExit: PropTypes.func,
|
|
134
|
-
|
|
135
|
-
/**
|
|
136
|
-
* Callback fired as the <Modal /> begins to transition out
|
|
137
|
-
*/
|
|
138
52
|
onExiting: PropTypes.func,
|
|
139
|
-
|
|
140
|
-
/**
|
|
141
|
-
* Callback fired after the <Modal /> finishes transitioning out
|
|
142
|
-
*/
|
|
143
53
|
onExited: PropTypes.func,
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Constrain the Modal to the document window or its closest positioned parent
|
|
147
|
-
*/
|
|
148
54
|
constrain: PropTypes.oneOf(['window', 'parent']),
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Should ModalBody handle overflow with scrollbars, or fit its
|
|
152
|
-
* content within its own height?
|
|
153
|
-
*/
|
|
154
55
|
overflow: PropTypes.oneOf(['scroll', 'fit'])
|
|
155
56
|
};
|
|
156
57
|
const allowedProps = ['label', 'children', 'as', 'size', 'variant', 'open', 'defaultFocusElement', 'shouldReturnFocus', 'shouldCloseOnDocumentClick', 'onOpen', 'onClose', 'onDismiss', 'contentRef', 'mountNode', 'insertAt', 'liveRegion', 'transition', 'onEnter', 'onEntering', 'onEntered', 'onExit', 'onExiting', 'onExited', 'constrain', 'overflow'];
|
|
@@ -34,6 +34,7 @@ var _dec, _dec2, _class, _class2;
|
|
|
34
34
|
parent: Modal
|
|
35
35
|
id: Modal.Body
|
|
36
36
|
---
|
|
37
|
+
@tsProps
|
|
37
38
|
**/
|
|
38
39
|
let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class ModalBody extends _react.Component {
|
|
39
40
|
constructor() {
|
|
@@ -51,24 +52,28 @@ let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
51
52
|
}
|
|
52
53
|
|
|
53
54
|
componentDidMount() {
|
|
54
|
-
|
|
55
|
+
var _this$props$makeStyle, _this$props;
|
|
56
|
+
|
|
57
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
55
58
|
}
|
|
56
59
|
|
|
57
|
-
componentDidUpdate(
|
|
58
|
-
|
|
60
|
+
componentDidUpdate() {
|
|
61
|
+
var _this$props$makeStyle2, _this$props2;
|
|
62
|
+
|
|
63
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
59
64
|
}
|
|
60
65
|
|
|
61
66
|
render() {
|
|
62
67
|
var _this$props$styles;
|
|
63
68
|
|
|
64
|
-
const _this$
|
|
65
|
-
as = _this$
|
|
66
|
-
elementRef = _this$
|
|
67
|
-
overflow = _this$
|
|
68
|
-
variant = _this$
|
|
69
|
-
padding = _this$
|
|
70
|
-
children = _this$
|
|
71
|
-
rest = (0, _objectWithoutProperties2.default)(_this$
|
|
69
|
+
const _this$props3 = this.props,
|
|
70
|
+
as = _this$props3.as,
|
|
71
|
+
elementRef = _this$props3.elementRef,
|
|
72
|
+
overflow = _this$props3.overflow,
|
|
73
|
+
variant = _this$props3.variant,
|
|
74
|
+
padding = _this$props3.padding,
|
|
75
|
+
children = _this$props3.children,
|
|
76
|
+
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
72
77
|
|
|
73
78
|
const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(rest, ModalBody.allowedProps), ModalBody);
|
|
74
79
|
|
|
@@ -89,8 +94,7 @@ let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
89
94
|
}, _class2.displayName = "ModalBody", _class2.componentId = 'Modal.Body', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
90
95
|
padding: 'medium',
|
|
91
96
|
as: 'div',
|
|
92
|
-
variant: 'default'
|
|
93
|
-
children: null
|
|
97
|
+
variant: 'default'
|
|
94
98
|
}, _class2)) || _class) || _class);
|
|
95
99
|
exports.ModalBody = ModalBody;
|
|
96
100
|
var _default = ModalBody;
|
|
@@ -32,6 +32,7 @@ var _dec, _dec2, _class, _class2;
|
|
|
32
32
|
parent: Modal
|
|
33
33
|
id: Modal.Footer
|
|
34
34
|
---
|
|
35
|
+
@tsProps
|
|
35
36
|
**/
|
|
36
37
|
let ModalFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class ModalFooter extends _react.Component {
|
|
37
38
|
constructor() {
|
|
@@ -44,19 +45,23 @@ let ModalFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
44
45
|
}
|
|
45
46
|
|
|
46
47
|
componentDidMount() {
|
|
47
|
-
|
|
48
|
+
var _this$props$makeStyle, _this$props;
|
|
49
|
+
|
|
50
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props);
|
|
48
51
|
}
|
|
49
52
|
|
|
50
|
-
componentDidUpdate(
|
|
51
|
-
|
|
53
|
+
componentDidUpdate() {
|
|
54
|
+
var _this$props$makeStyle2, _this$props2;
|
|
55
|
+
|
|
56
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2);
|
|
52
57
|
}
|
|
53
58
|
|
|
54
59
|
render() {
|
|
55
60
|
var _this$props$styles;
|
|
56
61
|
|
|
57
|
-
const _this$
|
|
58
|
-
children = _this$
|
|
59
|
-
rest = (0, _objectWithoutProperties2.default)(_this$
|
|
62
|
+
const _this$props3 = this.props,
|
|
63
|
+
children = _this$props3.children,
|
|
64
|
+
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
60
65
|
return (0, _emotion.jsx)("div", Object.assign({
|
|
61
66
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalFooter
|
|
62
67
|
}, (0, _passthroughProps.passthroughProps)(rest), {
|
|
@@ -65,8 +70,7 @@ let ModalFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
65
70
|
}
|
|
66
71
|
|
|
67
72
|
}, _class2.displayName = "ModalFooter", _class2.componentId = 'Modal.Footer', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
68
|
-
variant: 'default'
|
|
69
|
-
children: null
|
|
73
|
+
variant: 'default'
|
|
70
74
|
}, _class2)) || _class) || _class);
|
|
71
75
|
exports.ModalFooter = ModalFooter;
|
|
72
76
|
var _default = ModalFooter;
|
|
@@ -38,6 +38,7 @@ var _dec, _dec2, _class, _class2;
|
|
|
38
38
|
parent: Modal
|
|
39
39
|
id: Modal.Header
|
|
40
40
|
---
|
|
41
|
+
@tsProps
|
|
41
42
|
**/
|
|
42
43
|
let ModalHeader = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class ModalHeader extends _react.Component {
|
|
43
44
|
constructor() {
|
|
@@ -56,11 +57,15 @@ let ModalHeader = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
56
57
|
}
|
|
57
58
|
|
|
58
59
|
componentDidMount() {
|
|
59
|
-
|
|
60
|
+
var _this$props$makeStyle, _this$props;
|
|
61
|
+
|
|
62
|
+
(_this$props$makeStyle = (_this$props = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props, this.makeStyleProps());
|
|
60
63
|
}
|
|
61
64
|
|
|
62
|
-
componentDidUpdate(
|
|
63
|
-
|
|
65
|
+
componentDidUpdate() {
|
|
66
|
+
var _this$props$makeStyle2, _this$props2;
|
|
67
|
+
|
|
68
|
+
(_this$props$makeStyle2 = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props2, this.makeStyleProps());
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
get usesCloseButton() {
|
|
@@ -78,9 +83,9 @@ let ModalHeader = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
78
83
|
render() {
|
|
79
84
|
var _this$props$styles;
|
|
80
85
|
|
|
81
|
-
const _this$
|
|
82
|
-
children = _this$
|
|
83
|
-
rest = (0, _objectWithoutProperties2.default)(_this$
|
|
86
|
+
const _this$props3 = this.props,
|
|
87
|
+
children = _this$props3.children,
|
|
88
|
+
rest = (0, _objectWithoutProperties2.default)(_this$props3, _excluded);
|
|
84
89
|
return (0, _emotion.jsx)("div", Object.assign({
|
|
85
90
|
css: (_this$props$styles = this.props.styles) === null || _this$props$styles === void 0 ? void 0 : _this$props$styles.modalHeader
|
|
86
91
|
}, (0, _passthroughProps.passthroughProps)(rest), {
|
|
@@ -89,7 +94,6 @@ let ModalHeader = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
89
94
|
}
|
|
90
95
|
|
|
91
96
|
}, _class2.displayName = "ModalHeader", _class2.componentId = 'Modal.Header', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
92
|
-
children: null,
|
|
93
97
|
variant: 'default',
|
|
94
98
|
spacing: 'default'
|
|
95
99
|
}, _class2)) || _class) || _class);
|
|
@@ -32,9 +32,13 @@ var _index = require("./index");
|
|
|
32
32
|
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
33
33
|
* SOFTWARE.
|
|
34
34
|
*/
|
|
35
|
-
|
|
36
|
-
const
|
|
37
|
-
|
|
35
|
+
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
36
|
+
const ModalHeaderLocator = (0, _locator.locator)(_index.Modal.Header.selector); // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
37
|
+
|
|
38
|
+
const ModalBodyLocator = (0, _locator.locator)(_index.Modal.Body.selector); // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
39
|
+
|
|
40
|
+
const ModalFooterLocator = (0, _locator.locator)(_index.Modal.Footer.selector); // @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
41
|
+
|
|
38
42
|
const ModalLocator = (0, _locator.locator)(_index.Modal.selector, {
|
|
39
43
|
findHeader: function () {
|
|
40
44
|
return ModalHeaderLocator.find(...arguments);
|