@instructure/ui-responsive 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/Responsive/index.js +27 -24
- package/lib/QueryType.js +5 -1
- package/lib/Responsive/index.js +27 -24
- package/package.json +11 -11
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-responsive
|
|
9
9
|
|
package/es/Responsive/index.js
CHANGED
|
@@ -36,20 +36,25 @@ category: components
|
|
|
36
36
|
**/
|
|
37
37
|
|
|
38
38
|
class Responsive extends Component {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
39
|
+
constructor() {
|
|
40
|
+
super(...arguments);
|
|
41
|
+
this.ref = /*#__PURE__*/createRef();
|
|
42
|
+
this._matchListener = null;
|
|
43
|
+
this.state = {
|
|
44
|
+
matches: [],
|
|
45
|
+
hasRendered: false
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
this.updateMatches = (matches, cb) => {
|
|
49
|
+
this.setState({
|
|
50
|
+
matches
|
|
51
|
+
}, () => {
|
|
52
|
+
if (typeof cb === 'function') {
|
|
53
|
+
cb();
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
};
|
|
57
|
+
}
|
|
53
58
|
|
|
54
59
|
componentDidMount() {
|
|
55
60
|
error(!!(this.props.render || this.props.children), `[Responsive] must have either a \`render\` prop or \`children\` prop.`);
|
|
@@ -99,16 +104,6 @@ class Responsive extends Component {
|
|
|
99
104
|
}
|
|
100
105
|
}
|
|
101
106
|
|
|
102
|
-
updateMatches = (matches, cb) => {
|
|
103
|
-
this.setState({
|
|
104
|
-
matches
|
|
105
|
-
}, () => {
|
|
106
|
-
if (typeof cb === 'function') {
|
|
107
|
-
cb();
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
|
|
112
107
|
mergeProps(matches, props) {
|
|
113
108
|
if (!props) {
|
|
114
109
|
return null;
|
|
@@ -155,5 +150,13 @@ class Responsive extends Component {
|
|
|
155
150
|
|
|
156
151
|
}
|
|
157
152
|
|
|
153
|
+
Responsive.displayName = "Responsive";
|
|
154
|
+
Responsive.allowedProps = allowedProps;
|
|
155
|
+
Responsive.propTypes = propTypes;
|
|
156
|
+
Responsive.defaultProps = {
|
|
157
|
+
children: null,
|
|
158
|
+
match: 'element',
|
|
159
|
+
props: null
|
|
160
|
+
};
|
|
158
161
|
export default Responsive;
|
|
159
162
|
export { Responsive };
|
package/lib/QueryType.js
CHANGED
package/lib/Responsive/index.js
CHANGED
|
@@ -52,20 +52,25 @@ category: components
|
|
|
52
52
|
@tsProps
|
|
53
53
|
**/
|
|
54
54
|
class Responsive extends _react.Component {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
55
|
+
constructor() {
|
|
56
|
+
super(...arguments);
|
|
57
|
+
this.ref = /*#__PURE__*/(0, _react.createRef)();
|
|
58
|
+
this._matchListener = null;
|
|
59
|
+
this.state = {
|
|
60
|
+
matches: [],
|
|
61
|
+
hasRendered: false
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
this.updateMatches = (matches, cb) => {
|
|
65
|
+
this.setState({
|
|
66
|
+
matches
|
|
67
|
+
}, () => {
|
|
68
|
+
if (typeof cb === 'function') {
|
|
69
|
+
cb();
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
};
|
|
73
|
+
}
|
|
69
74
|
|
|
70
75
|
componentDidMount() {
|
|
71
76
|
(0, _console.logError)(!!(this.props.render || this.props.children), `[Responsive] must have either a \`render\` prop or \`children\` prop.`);
|
|
@@ -115,16 +120,6 @@ class Responsive extends _react.Component {
|
|
|
115
120
|
}
|
|
116
121
|
}
|
|
117
122
|
|
|
118
|
-
updateMatches = (matches, cb) => {
|
|
119
|
-
this.setState({
|
|
120
|
-
matches
|
|
121
|
-
}, () => {
|
|
122
|
-
if (typeof cb === 'function') {
|
|
123
|
-
cb();
|
|
124
|
-
}
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
|
|
128
123
|
mergeProps(matches, props) {
|
|
129
124
|
if (!props) {
|
|
130
125
|
return null;
|
|
@@ -172,5 +167,13 @@ class Responsive extends _react.Component {
|
|
|
172
167
|
}
|
|
173
168
|
|
|
174
169
|
exports.Responsive = Responsive;
|
|
170
|
+
Responsive.displayName = "Responsive";
|
|
171
|
+
Responsive.allowedProps = _props.allowedProps;
|
|
172
|
+
Responsive.propTypes = _props.propTypes;
|
|
173
|
+
Responsive.defaultProps = {
|
|
174
|
+
children: null,
|
|
175
|
+
match: 'element',
|
|
176
|
+
props: null
|
|
177
|
+
};
|
|
175
178
|
var _default = Responsive;
|
|
176
179
|
exports.default = _default;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-responsive",
|
|
3
|
-
"version": "8.25.1-snapshot-
|
|
3
|
+
"version": "8.25.1-snapshot-13",
|
|
4
4
|
"description": "A component that allows for rendering a component differently based on either the element or the viewport size",
|
|
5
5
|
"author": "Instructure, Inc. Engineering and Product Design",
|
|
6
6
|
"module": "./es/index.js",
|
|
@@ -24,19 +24,19 @@
|
|
|
24
24
|
"license": "MIT",
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@babel/runtime": "^7.13.10",
|
|
27
|
-
"@instructure/console": "8.25.1-snapshot-
|
|
28
|
-
"@instructure/debounce": "8.25.1-snapshot-
|
|
29
|
-
"@instructure/shared-types": "8.25.1-snapshot-
|
|
30
|
-
"@instructure/ui-dom-utils": "8.25.1-snapshot-
|
|
31
|
-
"@instructure/ui-react-utils": "8.25.1-snapshot-
|
|
32
|
-
"@instructure/ui-testable": "8.25.1-snapshot-
|
|
33
|
-
"@instructure/ui-utils": "8.25.1-snapshot-
|
|
27
|
+
"@instructure/console": "8.25.1-snapshot-13",
|
|
28
|
+
"@instructure/debounce": "8.25.1-snapshot-13",
|
|
29
|
+
"@instructure/shared-types": "8.25.1-snapshot-13",
|
|
30
|
+
"@instructure/ui-dom-utils": "8.25.1-snapshot-13",
|
|
31
|
+
"@instructure/ui-react-utils": "8.25.1-snapshot-13",
|
|
32
|
+
"@instructure/ui-testable": "8.25.1-snapshot-13",
|
|
33
|
+
"@instructure/ui-utils": "8.25.1-snapshot-13",
|
|
34
34
|
"prop-types": "^15"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
|
-
"@instructure/ui-babel-preset": "8.25.1-snapshot-
|
|
38
|
-
"@instructure/ui-color-utils": "8.25.1-snapshot-
|
|
39
|
-
"@instructure/ui-test-utils": "8.25.1-snapshot-
|
|
37
|
+
"@instructure/ui-babel-preset": "8.25.1-snapshot-13",
|
|
38
|
+
"@instructure/ui-color-utils": "8.25.1-snapshot-13",
|
|
39
|
+
"@instructure/ui-test-utils": "8.25.1-snapshot-13"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"react": ">=16.8 <=17"
|