@instructure/ui-modal 8.10.3-snapshot.22 → 8.10.3-snapshot.23
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/Modal/ModalBody/index.js +13 -11
- package/es/Modal/ModalBody/props.js +4 -0
- package/lib/Modal/ModalBody/index.js +13 -11
- package/lib/Modal/ModalBody/props.js +4 -0
- package/package.json +21 -21
- package/src/Modal/ModalBody/index.tsx +6 -1
- package/src/Modal/ModalBody/props.ts +3 -0
- package/types/Modal/ModalBody/index.d.ts.map +1 -1
- package/types/Modal/ModalBody/props.d.ts.map +1 -1
|
@@ -49,10 +49,12 @@ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
49
49
|
this.ref = null;
|
|
50
50
|
|
|
51
51
|
this.handleRef = el => {
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
const elementRef = this.props.elementRef;
|
|
54
53
|
this.ref = el;
|
|
55
|
-
|
|
54
|
+
|
|
55
|
+
if (typeof elementRef === 'function') {
|
|
56
|
+
elementRef(el);
|
|
57
|
+
}
|
|
56
58
|
};
|
|
57
59
|
}
|
|
58
60
|
|
|
@@ -67,14 +69,14 @@ let ModalBody = (_dec = withStyle(generateStyle, generateComponentTheme), _dec2
|
|
|
67
69
|
render() {
|
|
68
70
|
var _this$props$styles;
|
|
69
71
|
|
|
70
|
-
const _this$
|
|
71
|
-
as = _this$
|
|
72
|
-
elementRef = _this$
|
|
73
|
-
overflow = _this$
|
|
74
|
-
variant = _this$
|
|
75
|
-
padding = _this$
|
|
76
|
-
children = _this$
|
|
77
|
-
rest = _objectWithoutProperties(_this$
|
|
72
|
+
const _this$props = this.props,
|
|
73
|
+
as = _this$props.as,
|
|
74
|
+
elementRef = _this$props.elementRef,
|
|
75
|
+
overflow = _this$props.overflow,
|
|
76
|
+
variant = _this$props.variant,
|
|
77
|
+
padding = _this$props.padding,
|
|
78
|
+
children = _this$props.children,
|
|
79
|
+
rest = _objectWithoutProperties(_this$props, _excluded);
|
|
78
80
|
|
|
79
81
|
const passthroughProps = View.omitViewProps(omitProps(rest, ModalBody.allowedProps), ModalBody);
|
|
80
82
|
const isFit = overflow === 'fit';
|
|
@@ -26,6 +26,10 @@ import { ThemeablePropTypes } from '@instructure/emotion';
|
|
|
26
26
|
const propTypes = {
|
|
27
27
|
children: PropTypes.node,
|
|
28
28
|
padding: ThemeablePropTypes.spacing,
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* provides a reference to the underlying html root element
|
|
32
|
+
*/
|
|
29
33
|
elementRef: PropTypes.func,
|
|
30
34
|
as: PropTypes.elementType,
|
|
31
35
|
variant: PropTypes.oneOf(['default', 'inverse']),
|
|
@@ -41,10 +41,12 @@ let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
41
41
|
this.ref = null;
|
|
42
42
|
|
|
43
43
|
this.handleRef = el => {
|
|
44
|
-
|
|
45
|
-
|
|
44
|
+
const elementRef = this.props.elementRef;
|
|
46
45
|
this.ref = el;
|
|
47
|
-
|
|
46
|
+
|
|
47
|
+
if (typeof elementRef === 'function') {
|
|
48
|
+
elementRef(el);
|
|
49
|
+
}
|
|
48
50
|
};
|
|
49
51
|
}
|
|
50
52
|
|
|
@@ -59,14 +61,14 @@ let ModalBody = (_dec = (0, _emotion.withStyle)(_styles.default, _theme.default)
|
|
|
59
61
|
render() {
|
|
60
62
|
var _this$props$styles;
|
|
61
63
|
|
|
62
|
-
const _this$
|
|
63
|
-
as = _this$
|
|
64
|
-
elementRef = _this$
|
|
65
|
-
overflow = _this$
|
|
66
|
-
variant = _this$
|
|
67
|
-
padding = _this$
|
|
68
|
-
children = _this$
|
|
69
|
-
rest = (0, _objectWithoutProperties2.default)(_this$
|
|
64
|
+
const _this$props = this.props,
|
|
65
|
+
as = _this$props.as,
|
|
66
|
+
elementRef = _this$props.elementRef,
|
|
67
|
+
overflow = _this$props.overflow,
|
|
68
|
+
variant = _this$props.variant,
|
|
69
|
+
padding = _this$props.padding,
|
|
70
|
+
children = _this$props.children,
|
|
71
|
+
rest = (0, _objectWithoutProperties2.default)(_this$props, _excluded);
|
|
70
72
|
|
|
71
73
|
const passthroughProps = _View.View.omitViewProps((0, _omitProps.omitProps)(rest, ModalBody.allowedProps), ModalBody);
|
|
72
74
|
|
|
@@ -37,6 +37,10 @@ var _emotion = require("@instructure/emotion");
|
|
|
37
37
|
const propTypes = {
|
|
38
38
|
children: _propTypes.default.node,
|
|
39
39
|
padding: _emotion.ThemeablePropTypes.spacing,
|
|
40
|
+
|
|
41
|
+
/**
|
|
42
|
+
* provides a reference to the underlying html root element
|
|
43
|
+
*/
|
|
40
44
|
elementRef: _propTypes.default.func,
|
|
41
45
|
as: _propTypes.default.elementType,
|
|
42
46
|
variant: _propTypes.default.oneOf(['default', 'inverse']),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-modal",
|
|
3
|
-
"version": "8.10.3-snapshot.
|
|
3
|
+
"version": "8.10.3-snapshot.23+5aaa29662",
|
|
4
4
|
"description": "A component for displaying content in a dialog overlay",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"type": "commonjs",
|
|
@@ -25,35 +25,35 @@
|
|
|
25
25
|
"license": "MIT",
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"@babel/runtime": "^7.13.10",
|
|
28
|
-
"@instructure/console": "8.10.3-snapshot.
|
|
29
|
-
"@instructure/emotion": "8.10.3-snapshot.
|
|
30
|
-
"@instructure/shared-types": "8.10.3-snapshot.
|
|
31
|
-
"@instructure/ui-buttons": "8.10.3-snapshot.
|
|
32
|
-
"@instructure/ui-dialog": "8.10.3-snapshot.
|
|
33
|
-
"@instructure/ui-motion": "8.10.3-snapshot.
|
|
34
|
-
"@instructure/ui-overlays": "8.10.3-snapshot.
|
|
35
|
-
"@instructure/ui-portal": "8.10.3-snapshot.
|
|
36
|
-
"@instructure/ui-prop-types": "8.10.3-snapshot.
|
|
37
|
-
"@instructure/ui-react-utils": "8.10.3-snapshot.
|
|
38
|
-
"@instructure/ui-testable": "8.10.3-snapshot.
|
|
39
|
-
"@instructure/ui-utils": "8.10.3-snapshot.
|
|
40
|
-
"@instructure/ui-view": "8.10.3-snapshot.
|
|
28
|
+
"@instructure/console": "8.10.3-snapshot.23+5aaa29662",
|
|
29
|
+
"@instructure/emotion": "8.10.3-snapshot.23+5aaa29662",
|
|
30
|
+
"@instructure/shared-types": "8.10.3-snapshot.23+5aaa29662",
|
|
31
|
+
"@instructure/ui-buttons": "8.10.3-snapshot.23+5aaa29662",
|
|
32
|
+
"@instructure/ui-dialog": "8.10.3-snapshot.23+5aaa29662",
|
|
33
|
+
"@instructure/ui-motion": "8.10.3-snapshot.23+5aaa29662",
|
|
34
|
+
"@instructure/ui-overlays": "8.10.3-snapshot.23+5aaa29662",
|
|
35
|
+
"@instructure/ui-portal": "8.10.3-snapshot.23+5aaa29662",
|
|
36
|
+
"@instructure/ui-prop-types": "8.10.3-snapshot.23+5aaa29662",
|
|
37
|
+
"@instructure/ui-react-utils": "8.10.3-snapshot.23+5aaa29662",
|
|
38
|
+
"@instructure/ui-testable": "8.10.3-snapshot.23+5aaa29662",
|
|
39
|
+
"@instructure/ui-utils": "8.10.3-snapshot.23+5aaa29662",
|
|
40
|
+
"@instructure/ui-view": "8.10.3-snapshot.23+5aaa29662",
|
|
41
41
|
"prop-types": "^15"
|
|
42
42
|
},
|
|
43
43
|
"peerDependencies": {
|
|
44
44
|
"react": ">=16.8 <=17"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@instructure/ui-babel-preset": "8.10.3-snapshot.
|
|
48
|
-
"@instructure/ui-color-utils": "8.10.3-snapshot.
|
|
49
|
-
"@instructure/ui-position": "8.10.3-snapshot.
|
|
50
|
-
"@instructure/ui-test-locator": "8.10.3-snapshot.
|
|
51
|
-
"@instructure/ui-test-utils": "8.10.3-snapshot.
|
|
52
|
-
"@instructure/ui-themes": "8.10.3-snapshot.
|
|
47
|
+
"@instructure/ui-babel-preset": "8.10.3-snapshot.23+5aaa29662",
|
|
48
|
+
"@instructure/ui-color-utils": "8.10.3-snapshot.23+5aaa29662",
|
|
49
|
+
"@instructure/ui-position": "8.10.3-snapshot.23+5aaa29662",
|
|
50
|
+
"@instructure/ui-test-locator": "8.10.3-snapshot.23+5aaa29662",
|
|
51
|
+
"@instructure/ui-test-utils": "8.10.3-snapshot.23+5aaa29662",
|
|
52
|
+
"@instructure/ui-themes": "8.10.3-snapshot.23+5aaa29662"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
},
|
|
57
57
|
"sideEffects": false,
|
|
58
|
-
"gitHead": "
|
|
58
|
+
"gitHead": "5aaa296621d72faebe1a809a8895a8185587008d"
|
|
59
59
|
}
|
|
@@ -59,8 +59,13 @@ class ModalBody extends Component<ModalBodyProps> {
|
|
|
59
59
|
ref: Element | null = null
|
|
60
60
|
|
|
61
61
|
handleRef = (el: Element | null) => {
|
|
62
|
+
const { elementRef } = this.props
|
|
63
|
+
|
|
62
64
|
this.ref = el
|
|
63
|
-
|
|
65
|
+
|
|
66
|
+
if (typeof elementRef === 'function') {
|
|
67
|
+
elementRef(el)
|
|
68
|
+
}
|
|
64
69
|
}
|
|
65
70
|
|
|
66
71
|
componentDidMount() {
|
|
@@ -61,6 +61,9 @@ type ModalBodyStyle = ComponentStyle<'modalBody'>
|
|
|
61
61
|
const propTypes: PropValidators<PropKeys> = {
|
|
62
62
|
children: PropTypes.node,
|
|
63
63
|
padding: ThemeablePropTypes.spacing,
|
|
64
|
+
/**
|
|
65
|
+
* provides a reference to the underlying html root element
|
|
66
|
+
*/
|
|
64
67
|
elementRef: PropTypes.func,
|
|
65
68
|
as: PropTypes.elementType,
|
|
66
69
|
variant: PropTypes.oneOf(['default', 'inverse']),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Modal/ModalBody/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AACH,cAEM,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,SAAS;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Modal/ModalBody/index.tsx"],"names":[],"mappings":"AAwBA,eAAe;AACf,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAMjC,OAAO,EAAa,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAKrD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAE7C;;;;;GAKG;AACH,cAEM,SAAU,SAAQ,SAAS,CAAC,cAAc,CAAC;IAC/C,MAAM,CAAC,QAAQ,CAAC,WAAW,gBAAe;IAE1C,MAAM,CAAC,SAAS;;;;;;;OAAY;IAC5B,MAAM,CAAC,YAAY;;;;;;;SAAe;IAClC,MAAM,CAAC,YAAY;;;;;MAKlB;IAED,GAAG,EAAE,OAAO,GAAG,IAAI,CAAO;IAE1B,SAAS,OAAQ,OAAO,GAAG,IAAI,UAQ9B;IAED,iBAAiB;IAMjB,kBAAkB,CAAC,SAAS,KAAA,EAAE,SAAS,KAAA,EAAE,QAAQ,KAAA;IAKjD,MAAM;CAiCP;AAED,eAAe,SAAS,CAAA;AACxB,OAAO,EAAE,SAAS,EAAE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Modal/ModalBody/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAElC,aAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC/B,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;CAC5B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,cAAc,GAAG,iBAAiB,GACrC,cAAc,CAAC,cAAc,EAAE,cAAc,CAAC,GAC9C,mBAAmB,CAAC,iBAAiB,CAAC,CAAA;AAExC,aAAK,cAAc,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;AAEjD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"props.d.ts","sourceRoot":"","sources":["../../../src/Modal/ModalBody/props.ts"],"names":[],"mappings":"AAwBA,OAAO,KAAK,MAAM,OAAO,CAAA;AAKzB,OAAO,KAAK,EACV,OAAO,EACP,cAAc,EACd,cAAc,EACf,MAAM,sBAAsB,CAAA;AAC7B,OAAO,KAAK,EACV,aAAa,EACb,cAAc,EACd,cAAc,EACd,mBAAmB,EACpB,MAAM,2BAA2B,CAAA;AAElC,aAAK,iBAAiB,GAAG;IACvB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,OAAO,CAAC,EAAE,OAAO,CAAA;IACjB,UAAU,CAAC,EAAE,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,KAAK,IAAI,CAAA;IAC9C,EAAE,CAAC,EAAE,aAAa,CAAA;IAClB,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,CAAA;IAC/B,QAAQ,CAAC,EAAE,QAAQ,GAAG,KAAK,CAAA;CAC5B,CAAA;AAED,aAAK,QAAQ,GAAG,MAAM,iBAAiB,CAAA;AAEvC,aAAK,eAAe,GAAG,QAAQ,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC,CAAA;AAEhD,aAAK,cAAc,GAAG,iBAAiB,GACrC,cAAc,CAAC,cAAc,EAAE,cAAc,CAAC,GAC9C,mBAAmB,CAAC,iBAAiB,CAAC,CAAA;AAExC,aAAK,cAAc,GAAG,cAAc,CAAC,WAAW,CAAC,CAAA;AAEjD,QAAA,MAAM,SAAS,EAAE,cAAc,CAAC,QAAQ,CAUvC,CAAA;AAED,QAAA,MAAM,YAAY,EAAE,eAOnB,CAAA;AAED,YAAY,EAAE,cAAc,EAAE,cAAc,EAAE,CAAA;AAC9C,OAAO,EAAE,SAAS,EAAE,YAAY,EAAE,CAAA"}
|