@instructure/ui-modal 8.25.1-snapshot-10 → 8.25.1-snapshot-13
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 +1 -1
- package/es/Modal/ModalBody/index.js +19 -20
- package/es/Modal/ModalFooter/index.js +13 -14
- package/es/Modal/ModalHeader/index.js +20 -21
- package/es/Modal/index.js +39 -45
- package/lib/Modal/ModalBody/index.js +20 -21
- package/lib/Modal/ModalFooter/index.js +13 -14
- package/lib/Modal/ModalHeader/index.js +20 -21
- package/lib/Modal/index.js +39 -45
- package/package.json +20 -20
package/CHANGELOG.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
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.25.1-snapshot-
|
|
6
|
+
## [8.25.1-snapshot-13](https://github.com/instructure/instructure-ui/compare/v8.25.0...v8.25.1-snapshot-13) (2022-06-22)
|
|
7
7
|
|
|
8
8
|
**Note:** Version bump only for package @instructure/ui-modal
|
|
9
9
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["as", "elementRef", "overflow", "variant", "padding", "children"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -44,25 +44,20 @@ id: Modal.Body
|
|
|
44
44
|
---
|
|
45
45
|
@tsProps
|
|
46
46
|
**/
|
|
47
|
-
let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class ModalBody extends Component {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
static allowedProps = allowedProps;
|
|
52
|
-
static defaultProps = {
|
|
53
|
-
padding: 'medium',
|
|
54
|
-
as: 'div',
|
|
55
|
-
variant: 'default'
|
|
56
|
-
};
|
|
57
|
-
ref = null;
|
|
58
|
-
handleRef = el => {
|
|
59
|
-
const elementRef = this.props.elementRef;
|
|
60
|
-
this.ref = el;
|
|
47
|
+
let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class ModalBody extends Component {
|
|
48
|
+
constructor() {
|
|
49
|
+
super(...arguments);
|
|
50
|
+
this.ref = null;
|
|
61
51
|
|
|
62
|
-
|
|
63
|
-
elementRef
|
|
64
|
-
|
|
65
|
-
|
|
52
|
+
this.handleRef = el => {
|
|
53
|
+
const elementRef = this.props.elementRef;
|
|
54
|
+
this.ref = el;
|
|
55
|
+
|
|
56
|
+
if (typeof elementRef === 'function') {
|
|
57
|
+
elementRef(el);
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
}
|
|
66
61
|
|
|
67
62
|
componentDidMount() {
|
|
68
63
|
var _this$props$makeStyle, _this$props;
|
|
@@ -103,6 +98,10 @@ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
103
98
|
}), children);
|
|
104
99
|
}
|
|
105
100
|
|
|
106
|
-
}
|
|
101
|
+
}, _class2.displayName = "ModalBody", _class2.componentId = 'Modal.Body', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
102
|
+
padding: 'medium',
|
|
103
|
+
as: 'div',
|
|
104
|
+
variant: 'default'
|
|
105
|
+
}, _class2)) || _class) || _class);
|
|
107
106
|
export default ModalBody;
|
|
108
107
|
export { ModalBody };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["children"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -43,18 +43,15 @@ id: Modal.Footer
|
|
|
43
43
|
---
|
|
44
44
|
@tsProps
|
|
45
45
|
**/
|
|
46
|
-
let ModalFooter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class ModalFooter extends Component {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
handleRef = el => {
|
|
56
|
-
this.ref = el;
|
|
57
|
-
};
|
|
46
|
+
let ModalFooter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class ModalFooter extends Component {
|
|
47
|
+
constructor() {
|
|
48
|
+
super(...arguments);
|
|
49
|
+
this.ref = null;
|
|
50
|
+
|
|
51
|
+
this.handleRef = el => {
|
|
52
|
+
this.ref = el;
|
|
53
|
+
};
|
|
54
|
+
}
|
|
58
55
|
|
|
59
56
|
componentDidMount() {
|
|
60
57
|
var _this$props$makeStyle, _this$props;
|
|
@@ -82,6 +79,8 @@ let ModalFooter = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
82
79
|
}), children);
|
|
83
80
|
}
|
|
84
81
|
|
|
85
|
-
}
|
|
82
|
+
}, _class2.displayName = "ModalFooter", _class2.componentId = 'Modal.Footer', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
83
|
+
variant: 'default'
|
|
84
|
+
}, _class2)) || _class) || _class);
|
|
86
85
|
export default ModalFooter;
|
|
87
86
|
export { ModalFooter };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["children"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -44,19 +44,21 @@ id: Modal.Header
|
|
|
44
44
|
---
|
|
45
45
|
@tsProps
|
|
46
46
|
**/
|
|
47
|
-
let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class ModalHeader extends Component {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class ModalHeader extends Component {
|
|
48
|
+
constructor() {
|
|
49
|
+
super(...arguments);
|
|
50
|
+
this.ref = null;
|
|
51
|
+
|
|
52
|
+
this.handleRef = el => {
|
|
53
|
+
this.ref = el;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
this.makeStyleProps = () => {
|
|
57
|
+
return {
|
|
58
|
+
withCloseButton: this.usesCloseButton
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
}
|
|
60
62
|
|
|
61
63
|
componentDidMount() {
|
|
62
64
|
var _this$props$makeStyle, _this$props;
|
|
@@ -70,12 +72,6 @@ let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
70
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());
|
|
71
73
|
}
|
|
72
74
|
|
|
73
|
-
makeStyleProps = () => {
|
|
74
|
-
return {
|
|
75
|
-
withCloseButton: this.usesCloseButton
|
|
76
|
-
};
|
|
77
|
-
};
|
|
78
|
-
|
|
79
75
|
get usesCloseButton() {
|
|
80
76
|
let hasCloseButton = false;
|
|
81
77
|
React.Children.forEach(this.props.children, child => {
|
|
@@ -100,6 +96,9 @@ let ModalHeader = (_dec = withStyle(generateStyle, generateComponentTheme), _dec
|
|
|
100
96
|
}), children);
|
|
101
97
|
}
|
|
102
98
|
|
|
103
|
-
}
|
|
99
|
+
}, _class2.displayName = "ModalHeader", _class2.componentId = 'Modal.Header', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
100
|
+
variant: 'default',
|
|
101
|
+
spacing: 'default'
|
|
102
|
+
}, _class2)) || _class) || _class);
|
|
104
103
|
export default ModalHeader;
|
|
105
104
|
export { ModalHeader };
|
package/es/Modal/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties";
|
|
2
2
|
const _excluded = ["open", "onOpen", "onClose", "mountNode", "insertAt", "transition", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "constrain", "overflow"];
|
|
3
3
|
|
|
4
|
-
var _dec, _dec2, _class;
|
|
4
|
+
var _dec, _dec2, _class, _class2;
|
|
5
5
|
|
|
6
6
|
/*
|
|
7
7
|
* The MIT License (MIT)
|
|
@@ -51,40 +51,40 @@ tags: overlay, portal, dialog
|
|
|
51
51
|
---
|
|
52
52
|
@tsProps
|
|
53
53
|
**/
|
|
54
|
-
let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = class Modal extends Component {
|
|
55
|
-
static displayName = "Modal";
|
|
56
|
-
static componentId = 'Modal';
|
|
57
|
-
static propTypes = propTypes;
|
|
58
|
-
static allowedProps = allowedProps;
|
|
59
|
-
static defaultProps = {
|
|
60
|
-
open: false,
|
|
61
|
-
size: 'auto',
|
|
62
|
-
variant: 'default',
|
|
63
|
-
transition: 'fade',
|
|
64
|
-
insertAt: 'bottom',
|
|
65
|
-
shouldCloseOnDocumentClick: true,
|
|
66
|
-
shouldReturnFocus: true,
|
|
67
|
-
constrain: 'window',
|
|
68
|
-
overflow: 'scroll'
|
|
69
|
-
};
|
|
70
|
-
static Header = ModalHeader;
|
|
71
|
-
static Body = ModalBody;
|
|
72
|
-
static Footer = ModalFooter;
|
|
73
|
-
|
|
54
|
+
let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = testable(), _dec(_class = _dec2(_class = (_class2 = class Modal extends Component {
|
|
74
55
|
constructor(props) {
|
|
75
56
|
super(props);
|
|
57
|
+
this._DOMNode = null;
|
|
58
|
+
this._content = null;
|
|
59
|
+
this.ref = null;
|
|
60
|
+
|
|
61
|
+
this.handleRef = el => {
|
|
62
|
+
this.ref = el;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
this.handlePortalOpen = DOMNode => {
|
|
66
|
+
this.DOMNode = DOMNode;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
this.handleTransitionExited = () => {
|
|
70
|
+
this.setState({
|
|
71
|
+
transitioning: false
|
|
72
|
+
});
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
this.contentRef = el => {
|
|
76
|
+
this._content = el;
|
|
77
|
+
|
|
78
|
+
if (typeof this.props.contentRef === 'function') {
|
|
79
|
+
this.props.contentRef(el);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
|
|
76
83
|
this.state = {
|
|
77
84
|
transitioning: false
|
|
78
85
|
};
|
|
79
86
|
}
|
|
80
87
|
|
|
81
|
-
_DOMNode = null;
|
|
82
|
-
_content = null;
|
|
83
|
-
ref = null;
|
|
84
|
-
handleRef = el => {
|
|
85
|
-
this.ref = el;
|
|
86
|
-
};
|
|
87
|
-
|
|
88
88
|
componentDidMount() {
|
|
89
89
|
var _this$props$makeStyle, _this$props;
|
|
90
90
|
|
|
@@ -124,22 +124,6 @@ let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = te
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
|
|
127
|
-
handlePortalOpen = DOMNode => {
|
|
128
|
-
this.DOMNode = DOMNode;
|
|
129
|
-
};
|
|
130
|
-
handleTransitionExited = () => {
|
|
131
|
-
this.setState({
|
|
132
|
-
transitioning: false
|
|
133
|
-
});
|
|
134
|
-
};
|
|
135
|
-
contentRef = el => {
|
|
136
|
-
this._content = el;
|
|
137
|
-
|
|
138
|
-
if (typeof this.props.contentRef === 'function') {
|
|
139
|
-
this.props.contentRef(el);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
|
|
143
127
|
renderChildren() {
|
|
144
128
|
const _this$props3 = this.props,
|
|
145
129
|
children = _this$props3.children,
|
|
@@ -242,6 +226,16 @@ let Modal = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2 = te
|
|
|
242
226
|
}, this.renderDialog(passthroughProps)) : this.renderDialog(passthroughProps)));
|
|
243
227
|
}
|
|
244
228
|
|
|
245
|
-
}
|
|
229
|
+
}, _class2.displayName = "Modal", _class2.componentId = 'Modal', _class2.propTypes = propTypes, _class2.allowedProps = allowedProps, _class2.defaultProps = {
|
|
230
|
+
open: false,
|
|
231
|
+
size: 'auto',
|
|
232
|
+
variant: 'default',
|
|
233
|
+
transition: 'fade',
|
|
234
|
+
insertAt: 'bottom',
|
|
235
|
+
shouldCloseOnDocumentClick: true,
|
|
236
|
+
shouldReturnFocus: true,
|
|
237
|
+
constrain: 'window',
|
|
238
|
+
overflow: 'scroll'
|
|
239
|
+
}, _class2.Header = ModalHeader, _class2.Body = ModalBody, _class2.Footer = ModalFooter, _class2)) || _class) || _class);
|
|
246
240
|
export default Modal;
|
|
247
241
|
export { Modal, ModalHeader, ModalBody, ModalFooter };
|
|
@@ -27,7 +27,7 @@ var _props = require("./props");
|
|
|
27
27
|
|
|
28
28
|
const _excluded = ["as", "elementRef", "overflow", "variant", "padding", "children"];
|
|
29
29
|
|
|
30
|
-
var _dec, _dec2, _class;
|
|
30
|
+
var _dec, _dec2, _class, _class2;
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
---
|
|
@@ -36,25 +36,20 @@ id: Modal.Body
|
|
|
36
36
|
---
|
|
37
37
|
@tsProps
|
|
38
38
|
**/
|
|
39
|
-
let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = class ModalBody extends _react.Component {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
if (typeof elementRef === 'function') {
|
|
55
|
-
elementRef(el);
|
|
56
|
-
}
|
|
57
|
-
};
|
|
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 {
|
|
40
|
+
constructor() {
|
|
41
|
+
super(...arguments);
|
|
42
|
+
this.ref = null;
|
|
43
|
+
|
|
44
|
+
this.handleRef = el => {
|
|
45
|
+
const elementRef = this.props.elementRef;
|
|
46
|
+
this.ref = el;
|
|
47
|
+
|
|
48
|
+
if (typeof elementRef === 'function') {
|
|
49
|
+
elementRef(el);
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
}
|
|
58
53
|
|
|
59
54
|
componentDidMount() {
|
|
60
55
|
var _this$props$makeStyle, _this$props;
|
|
@@ -96,7 +91,11 @@ let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
96
91
|
}), children);
|
|
97
92
|
}
|
|
98
93
|
|
|
99
|
-
}
|
|
94
|
+
}, _class2.displayName = "ModalBody", _class2.componentId = 'Modal.Body', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
95
|
+
padding: 'medium',
|
|
96
|
+
as: 'div',
|
|
97
|
+
variant: 'default'
|
|
98
|
+
}, _class2)) || _class) || _class);
|
|
100
99
|
exports.ModalBody = ModalBody;
|
|
101
100
|
var _default = ModalBody;
|
|
102
101
|
exports.default = _default;
|
|
@@ -25,7 +25,7 @@ var _props = require("./props");
|
|
|
25
25
|
|
|
26
26
|
const _excluded = ["children"];
|
|
27
27
|
|
|
28
|
-
var _dec, _dec2, _class;
|
|
28
|
+
var _dec, _dec2, _class, _class2;
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
31
|
---
|
|
@@ -34,18 +34,15 @@ id: Modal.Footer
|
|
|
34
34
|
---
|
|
35
35
|
@tsProps
|
|
36
36
|
**/
|
|
37
|
-
let ModalFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = class ModalFooter extends _react.Component {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
handleRef = el => {
|
|
47
|
-
this.ref = el;
|
|
48
|
-
};
|
|
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 {
|
|
38
|
+
constructor() {
|
|
39
|
+
super(...arguments);
|
|
40
|
+
this.ref = null;
|
|
41
|
+
|
|
42
|
+
this.handleRef = el => {
|
|
43
|
+
this.ref = el;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
49
46
|
|
|
50
47
|
componentDidMount() {
|
|
51
48
|
var _this$props$makeStyle, _this$props;
|
|
@@ -72,7 +69,9 @@ let ModalFooter = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
72
69
|
}), children);
|
|
73
70
|
}
|
|
74
71
|
|
|
75
|
-
}
|
|
72
|
+
}, _class2.displayName = "ModalFooter", _class2.componentId = 'Modal.Footer', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
73
|
+
variant: 'default'
|
|
74
|
+
}, _class2)) || _class) || _class);
|
|
76
75
|
exports.ModalFooter = ModalFooter;
|
|
77
76
|
var _default = ModalFooter;
|
|
78
77
|
exports.default = _default;
|
|
@@ -31,7 +31,7 @@ var _props = require("./props");
|
|
|
31
31
|
|
|
32
32
|
const _excluded = ["children"];
|
|
33
33
|
|
|
34
|
-
var _dec, _dec2, _class;
|
|
34
|
+
var _dec, _dec2, _class, _class2;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
---
|
|
@@ -40,19 +40,21 @@ id: Modal.Header
|
|
|
40
40
|
---
|
|
41
41
|
@tsProps
|
|
42
42
|
**/
|
|
43
|
-
let ModalHeader = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = class ModalHeader extends _react.Component {
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
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 {
|
|
44
|
+
constructor() {
|
|
45
|
+
super(...arguments);
|
|
46
|
+
this.ref = null;
|
|
47
|
+
|
|
48
|
+
this.handleRef = el => {
|
|
49
|
+
this.ref = el;
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
this.makeStyleProps = () => {
|
|
53
|
+
return {
|
|
54
|
+
withCloseButton: this.usesCloseButton
|
|
55
|
+
};
|
|
56
|
+
};
|
|
57
|
+
}
|
|
56
58
|
|
|
57
59
|
componentDidMount() {
|
|
58
60
|
var _this$props$makeStyle, _this$props;
|
|
@@ -66,12 +68,6 @@ let ModalHeader = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
66
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());
|
|
67
69
|
}
|
|
68
70
|
|
|
69
|
-
makeStyleProps = () => {
|
|
70
|
-
return {
|
|
71
|
-
withCloseButton: this.usesCloseButton
|
|
72
|
-
};
|
|
73
|
-
};
|
|
74
|
-
|
|
75
71
|
get usesCloseButton() {
|
|
76
72
|
let hasCloseButton = false;
|
|
77
73
|
|
|
@@ -97,7 +93,10 @@ let ModalHeader = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.defaul
|
|
|
97
93
|
}), children);
|
|
98
94
|
}
|
|
99
95
|
|
|
100
|
-
}
|
|
96
|
+
}, _class2.displayName = "ModalHeader", _class2.componentId = 'Modal.Header', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
97
|
+
variant: 'default',
|
|
98
|
+
spacing: 'default'
|
|
99
|
+
}, _class2)) || _class) || _class);
|
|
101
100
|
exports.ModalHeader = ModalHeader;
|
|
102
101
|
var _default = ModalHeader;
|
|
103
102
|
exports.default = _default;
|
package/lib/Modal/index.js
CHANGED
|
@@ -66,7 +66,7 @@ var _props = require("./props");
|
|
|
66
66
|
|
|
67
67
|
const _excluded = ["open", "onOpen", "onClose", "mountNode", "insertAt", "transition", "onEnter", "onEntering", "onEntered", "onExit", "onExiting", "onExited", "constrain", "overflow"];
|
|
68
68
|
|
|
69
|
-
var _dec, _dec2, _class;
|
|
69
|
+
var _dec, _dec2, _class, _class2;
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
---
|
|
@@ -75,40 +75,40 @@ tags: overlay, portal, dialog
|
|
|
75
75
|
---
|
|
76
76
|
@tsProps
|
|
77
77
|
**/
|
|
78
|
-
let Modal = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = class Modal extends _react.Component {
|
|
79
|
-
static displayName = "Modal";
|
|
80
|
-
static componentId = 'Modal';
|
|
81
|
-
static propTypes = _props.propTypes;
|
|
82
|
-
static allowedProps = _props.allowedProps;
|
|
83
|
-
static defaultProps = {
|
|
84
|
-
open: false,
|
|
85
|
-
size: 'auto',
|
|
86
|
-
variant: 'default',
|
|
87
|
-
transition: 'fade',
|
|
88
|
-
insertAt: 'bottom',
|
|
89
|
-
shouldCloseOnDocumentClick: true,
|
|
90
|
-
shouldReturnFocus: true,
|
|
91
|
-
constrain: 'window',
|
|
92
|
-
overflow: 'scroll'
|
|
93
|
-
};
|
|
94
|
-
static Header = _ModalHeader.ModalHeader;
|
|
95
|
-
static Body = _ModalBody.ModalBody;
|
|
96
|
-
static Footer = _ModalFooter.ModalFooter;
|
|
97
|
-
|
|
78
|
+
let Modal = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_class2 = class Modal extends _react.Component {
|
|
98
79
|
constructor(props) {
|
|
99
80
|
super(props);
|
|
81
|
+
this._DOMNode = null;
|
|
82
|
+
this._content = null;
|
|
83
|
+
this.ref = null;
|
|
84
|
+
|
|
85
|
+
this.handleRef = el => {
|
|
86
|
+
this.ref = el;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
this.handlePortalOpen = DOMNode => {
|
|
90
|
+
this.DOMNode = DOMNode;
|
|
91
|
+
};
|
|
92
|
+
|
|
93
|
+
this.handleTransitionExited = () => {
|
|
94
|
+
this.setState({
|
|
95
|
+
transitioning: false
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
this.contentRef = el => {
|
|
100
|
+
this._content = el;
|
|
101
|
+
|
|
102
|
+
if (typeof this.props.contentRef === 'function') {
|
|
103
|
+
this.props.contentRef(el);
|
|
104
|
+
}
|
|
105
|
+
};
|
|
106
|
+
|
|
100
107
|
this.state = {
|
|
101
108
|
transitioning: false
|
|
102
109
|
};
|
|
103
110
|
}
|
|
104
111
|
|
|
105
|
-
_DOMNode = null;
|
|
106
|
-
_content = null;
|
|
107
|
-
ref = null;
|
|
108
|
-
handleRef = el => {
|
|
109
|
-
this.ref = el;
|
|
110
|
-
};
|
|
111
|
-
|
|
112
112
|
componentDidMount() {
|
|
113
113
|
var _this$props$makeStyle, _this$props;
|
|
114
114
|
|
|
@@ -148,22 +148,6 @@ let Modal = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
151
|
-
handlePortalOpen = DOMNode => {
|
|
152
|
-
this.DOMNode = DOMNode;
|
|
153
|
-
};
|
|
154
|
-
handleTransitionExited = () => {
|
|
155
|
-
this.setState({
|
|
156
|
-
transitioning: false
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
contentRef = el => {
|
|
160
|
-
this._content = el;
|
|
161
|
-
|
|
162
|
-
if (typeof this.props.contentRef === 'function') {
|
|
163
|
-
this.props.contentRef(el);
|
|
164
|
-
}
|
|
165
|
-
};
|
|
166
|
-
|
|
167
151
|
renderChildren() {
|
|
168
152
|
const _this$props3 = this.props,
|
|
169
153
|
children = _this$props3.children,
|
|
@@ -265,7 +249,17 @@ let Modal = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default), _d
|
|
|
265
249
|
}, this.renderDialog(passthroughProps)) : this.renderDialog(passthroughProps)));
|
|
266
250
|
}
|
|
267
251
|
|
|
268
|
-
}
|
|
252
|
+
}, _class2.displayName = "Modal", _class2.componentId = 'Modal', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
|
253
|
+
open: false,
|
|
254
|
+
size: 'auto',
|
|
255
|
+
variant: 'default',
|
|
256
|
+
transition: 'fade',
|
|
257
|
+
insertAt: 'bottom',
|
|
258
|
+
shouldCloseOnDocumentClick: true,
|
|
259
|
+
shouldReturnFocus: true,
|
|
260
|
+
constrain: 'window',
|
|
261
|
+
overflow: 'scroll'
|
|
262
|
+
}, _class2.Header = _ModalHeader.ModalHeader, _class2.Body = _ModalBody.ModalBody, _class2.Footer = _ModalFooter.ModalFooter, _class2)) || _class) || _class);
|
|
269
263
|
exports.Modal = Modal;
|
|
270
264
|
var _default = Modal;
|
|
271
265
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-modal",
|
|
3
|
-
"version": "8.25.1-snapshot-
|
|
3
|
+
"version": "8.25.1-snapshot-13",
|
|
4
4
|
"description": "A component for displaying content in a dialog overlay",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,31 +24,31 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.13.10",
|
|
27
|
-
"@instructure/console": "8.25.1-snapshot-
|
|
28
|
-
"@instructure/emotion": "8.25.1-snapshot-
|
|
29
|
-
"@instructure/shared-types": "8.25.1-snapshot-
|
|
30
|
-
"@instructure/ui-buttons": "8.25.1-snapshot-
|
|
31
|
-
"@instructure/ui-dialog": "8.25.1-snapshot-
|
|
32
|
-
"@instructure/ui-motion": "8.25.1-snapshot-
|
|
33
|
-
"@instructure/ui-overlays": "8.25.1-snapshot-
|
|
34
|
-
"@instructure/ui-portal": "8.25.1-snapshot-
|
|
35
|
-
"@instructure/ui-prop-types": "8.25.1-snapshot-
|
|
36
|
-
"@instructure/ui-react-utils": "8.25.1-snapshot-
|
|
37
|
-
"@instructure/ui-testable": "8.25.1-snapshot-
|
|
38
|
-
"@instructure/ui-utils": "8.25.1-snapshot-
|
|
39
|
-
"@instructure/ui-view": "8.25.1-snapshot-
|
|
27
|
+
"@instructure/console": "8.25.1-snapshot-13",
|
|
28
|
+
"@instructure/emotion": "8.25.1-snapshot-13",
|
|
29
|
+
"@instructure/shared-types": "8.25.1-snapshot-13",
|
|
30
|
+
"@instructure/ui-buttons": "8.25.1-snapshot-13",
|
|
31
|
+
"@instructure/ui-dialog": "8.25.1-snapshot-13",
|
|
32
|
+
"@instructure/ui-motion": "8.25.1-snapshot-13",
|
|
33
|
+
"@instructure/ui-overlays": "8.25.1-snapshot-13",
|
|
34
|
+
"@instructure/ui-portal": "8.25.1-snapshot-13",
|
|
35
|
+
"@instructure/ui-prop-types": "8.25.1-snapshot-13",
|
|
36
|
+
"@instructure/ui-react-utils": "8.25.1-snapshot-13",
|
|
37
|
+
"@instructure/ui-testable": "8.25.1-snapshot-13",
|
|
38
|
+
"@instructure/ui-utils": "8.25.1-snapshot-13",
|
|
39
|
+
"@instructure/ui-view": "8.25.1-snapshot-13",
|
|
40
40
|
"prop-types": "^15"
|
|
41
41
|
},
|
|
42
42
|
"peerDependencies": {
|
|
43
43
|
"react": ">=16.8 <=17"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
|
-
"@instructure/ui-babel-preset": "8.25.1-snapshot-
|
|
47
|
-
"@instructure/ui-color-utils": "8.25.1-snapshot-
|
|
48
|
-
"@instructure/ui-position": "8.25.1-snapshot-
|
|
49
|
-
"@instructure/ui-test-locator": "8.25.1-snapshot-
|
|
50
|
-
"@instructure/ui-test-utils": "8.25.1-snapshot-
|
|
51
|
-
"@instructure/ui-themes": "8.25.1-snapshot-
|
|
46
|
+
"@instructure/ui-babel-preset": "8.25.1-snapshot-13",
|
|
47
|
+
"@instructure/ui-color-utils": "8.25.1-snapshot-13",
|
|
48
|
+
"@instructure/ui-position": "8.25.1-snapshot-13",
|
|
49
|
+
"@instructure/ui-test-locator": "8.25.1-snapshot-13",
|
|
50
|
+
"@instructure/ui-test-utils": "8.25.1-snapshot-13",
|
|
51
|
+
"@instructure/ui-themes": "8.25.1-snapshot-13"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|