@instructure/ui-checkbox 8.14.1-snapshot.7 → 8.15.1-snapshot.2
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/Checkbox/CheckboxFacade/index.js +11 -6
- package/es/Checkbox/CheckboxFacade/props.js +0 -4
- package/es/Checkbox/CheckboxLocator.js +2 -1
- package/es/Checkbox/ToggleFacade/index.js +17 -12
- package/es/Checkbox/index.js +45 -43
- package/es/Checkbox/props.js +0 -29
- package/es/Checkbox/styles.js +1 -1
- package/es/CheckboxGroup/CheckboxGroupLocator.js +2 -1
- package/es/CheckboxGroup/index.js +16 -19
- package/lib/Checkbox/CheckboxFacade/index.js +11 -6
- package/lib/Checkbox/CheckboxFacade/props.js +0 -4
- package/lib/Checkbox/CheckboxLocator.js +1 -0
- package/lib/Checkbox/ToggleFacade/index.js +17 -12
- package/lib/Checkbox/index.js +47 -43
- package/lib/Checkbox/props.js +0 -29
- package/lib/Checkbox/styles.js +1 -1
- package/lib/CheckboxGroup/CheckboxGroupLocator.js +1 -0
- package/lib/CheckboxGroup/index.js +16 -19
- package/package.json +20 -20
- package/src/Checkbox/CheckboxFacade/index.tsx +4 -6
- package/src/Checkbox/CheckboxFacade/props.ts +3 -3
- package/src/Checkbox/ToggleFacade/index.tsx +4 -6
- package/src/Checkbox/ToggleFacade/props.ts +1 -0
- package/src/Checkbox/index.tsx +29 -54
- package/src/Checkbox/props.ts +36 -30
- package/src/Checkbox/styles.ts +2 -2
- package/src/CheckboxGroup/index.tsx +24 -40
- package/src/CheckboxGroup/props.ts +11 -5
- package/tsconfig.build.tsbuildinfo +1 -1
- package/types/Checkbox/CheckboxFacade/index.d.ts +2 -1
- package/types/Checkbox/CheckboxFacade/index.d.ts.map +1 -1
- package/types/Checkbox/CheckboxFacade/props.d.ts +3 -0
- package/types/Checkbox/CheckboxFacade/props.d.ts.map +1 -1
- package/types/Checkbox/CheckboxLocator.d.ts +4 -4
- package/types/Checkbox/ToggleFacade/index.d.ts +2 -1
- package/types/Checkbox/ToggleFacade/index.d.ts.map +1 -1
- package/types/Checkbox/ToggleFacade/props.d.ts +1 -1
- package/types/Checkbox/ToggleFacade/props.d.ts.map +1 -1
- package/types/Checkbox/index.d.ts +32 -29
- package/types/Checkbox/index.d.ts.map +1 -1
- package/types/Checkbox/props.d.ts +34 -8
- package/types/Checkbox/props.d.ts.map +1 -1
- package/types/Checkbox/styles.d.ts +2 -1
- package/types/Checkbox/styles.d.ts.map +1 -1
- package/types/CheckboxGroup/CheckboxGroupLocator.d.ts +4 -4
- package/types/CheckboxGroup/index.d.ts +16 -14
- package/types/CheckboxGroup/index.d.ts.map +1 -1
- package/types/CheckboxGroup/props.d.ts +11 -5
- package/types/CheckboxGroup/props.d.ts.map +1 -1
package/lib/Checkbox/index.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
+
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard").default;
|
|
4
|
+
|
|
3
5
|
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault").default;
|
|
4
6
|
|
|
5
7
|
Object.defineProperty(exports, "__esModule", {
|
|
@@ -20,7 +22,7 @@ Object.defineProperty(exports, "ToggleFacade", {
|
|
|
20
22
|
});
|
|
21
23
|
exports.default = void 0;
|
|
22
24
|
|
|
23
|
-
var _react = require("react");
|
|
25
|
+
var _react = _interopRequireWildcard(require("react"));
|
|
24
26
|
|
|
25
27
|
var _keycode = _interopRequireDefault(require("keycode"));
|
|
26
28
|
|
|
@@ -57,10 +59,13 @@ var _dec, _dec2, _class, _class2, _temp;
|
|
|
57
59
|
category: components
|
|
58
60
|
tags: toggle, switch
|
|
59
61
|
---
|
|
62
|
+
@tsProps
|
|
60
63
|
**/
|
|
61
64
|
let Checkbox = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 = (0, _testable.testable)(), _dec(_class = _dec2(_class = (_temp = _class2 = class Checkbox extends _react.Component {
|
|
62
65
|
constructor(props) {
|
|
63
66
|
super(props);
|
|
67
|
+
this._defaultId = void 0;
|
|
68
|
+
this._input = null;
|
|
64
69
|
this.ref = null;
|
|
65
70
|
|
|
66
71
|
this.handleRef = el => {
|
|
@@ -91,32 +96,31 @@ let Checkbox = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 = (
|
|
|
91
96
|
};
|
|
92
97
|
|
|
93
98
|
this.handleKeyDown = e => {
|
|
94
|
-
if (this.props.variant === 'toggle' &&
|
|
95
|
-
this._input.click();
|
|
96
|
-
|
|
99
|
+
if (this.props.variant === 'toggle' && e.keyCode === _keycode.default.codes.enter) {
|
|
100
|
+
this._input && this._input.click();
|
|
97
101
|
e.preventDefault();
|
|
98
102
|
}
|
|
99
103
|
};
|
|
100
104
|
|
|
101
|
-
this.handleFocus =
|
|
105
|
+
this.handleFocus = () => {
|
|
102
106
|
this.setState({
|
|
103
107
|
focused: true
|
|
104
108
|
});
|
|
105
109
|
};
|
|
106
110
|
|
|
107
|
-
this.handleBlur =
|
|
111
|
+
this.handleBlur = () => {
|
|
108
112
|
this.setState({
|
|
109
113
|
focused: false
|
|
110
114
|
});
|
|
111
115
|
};
|
|
112
116
|
|
|
113
|
-
this.handleMouseOver =
|
|
117
|
+
this.handleMouseOver = () => {
|
|
114
118
|
this.setState({
|
|
115
119
|
hovered: true
|
|
116
120
|
});
|
|
117
121
|
};
|
|
118
122
|
|
|
119
|
-
this.handleMouseOut =
|
|
123
|
+
this.handleMouseOut = () => {
|
|
120
124
|
this.setState({
|
|
121
125
|
hovered: false
|
|
122
126
|
});
|
|
@@ -124,29 +128,30 @@ let Checkbox = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 = (
|
|
|
124
128
|
|
|
125
129
|
this.state = {
|
|
126
130
|
focused: false,
|
|
127
|
-
hovered: false
|
|
131
|
+
hovered: false,
|
|
132
|
+
checked: typeof props.checked === 'undefined' ? !!props.defaultChecked : void 0
|
|
128
133
|
};
|
|
129
|
-
|
|
130
|
-
if (typeof props.checked === 'undefined') {
|
|
131
|
-
this.state.checked = !!props.defaultChecked;
|
|
132
|
-
}
|
|
133
|
-
|
|
134
134
|
this._defaultId = (0, _uid.uid)('Checkbox');
|
|
135
135
|
}
|
|
136
136
|
|
|
137
137
|
componentDidMount() {
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
this.
|
|
138
|
+
var _this$props$makeStyle, _this$props2;
|
|
139
|
+
|
|
140
|
+
if (this._input) {
|
|
141
|
+
this._input.indeterminate = this.props.indeterminate;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
(_this$props$makeStyle = (_this$props2 = this.props).makeStyles) === null || _this$props$makeStyle === void 0 ? void 0 : _this$props$makeStyle.call(_this$props2);
|
|
141
145
|
}
|
|
142
146
|
|
|
143
147
|
componentDidUpdate(prevProps) {
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
148
|
+
var _this$props$makeStyle2, _this$props3;
|
|
149
|
+
|
|
150
|
+
if (prevProps.indeterminate !== this.props.indeterminate && this._input) {
|
|
151
|
+
this._input.indeterminate = this.props.indeterminate || false;
|
|
147
152
|
}
|
|
148
153
|
|
|
149
|
-
this.props.makeStyles();
|
|
154
|
+
(_this$props$makeStyle2 = (_this$props3 = this.props).makeStyles) === null || _this$props$makeStyle2 === void 0 ? void 0 : _this$props$makeStyle2.call(_this$props3);
|
|
150
155
|
}
|
|
151
156
|
|
|
152
157
|
get id() {
|
|
@@ -166,15 +171,15 @@ let Checkbox = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 = (
|
|
|
166
171
|
}
|
|
167
172
|
|
|
168
173
|
renderFacade() {
|
|
169
|
-
const _this$
|
|
170
|
-
size = _this$
|
|
171
|
-
disabled = _this$
|
|
172
|
-
variant = _this$
|
|
173
|
-
label = _this$
|
|
174
|
-
readOnly = _this$
|
|
175
|
-
indeterminate = _this$
|
|
176
|
-
labelPlacement = _this$
|
|
177
|
-
themeOverride = _this$
|
|
174
|
+
const _this$props4 = this.props,
|
|
175
|
+
size = _this$props4.size,
|
|
176
|
+
disabled = _this$props4.disabled,
|
|
177
|
+
variant = _this$props4.variant,
|
|
178
|
+
label = _this$props4.label,
|
|
179
|
+
readOnly = _this$props4.readOnly,
|
|
180
|
+
indeterminate = _this$props4.indeterminate,
|
|
181
|
+
labelPlacement = _this$props4.labelPlacement,
|
|
182
|
+
themeOverride = _this$props4.themeOverride;
|
|
178
183
|
const _this$state = this.state,
|
|
179
184
|
hovered = _this$state.hovered,
|
|
180
185
|
focused = _this$state.focused;
|
|
@@ -184,7 +189,6 @@ let Checkbox = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 = (
|
|
|
184
189
|
return (0, _emotion.jsx)(_ToggleFacade.ToggleFacade, {
|
|
185
190
|
disabled: disabled,
|
|
186
191
|
size: size,
|
|
187
|
-
hovered: hovered,
|
|
188
192
|
focused: focused,
|
|
189
193
|
checked: this.checked,
|
|
190
194
|
readOnly: readOnly,
|
|
@@ -214,18 +218,18 @@ let Checkbox = (_dec = (0, _emotion.withStyle)(_styles.default, null), _dec2 = (
|
|
|
214
218
|
}
|
|
215
219
|
|
|
216
220
|
render() {
|
|
217
|
-
const _this$
|
|
218
|
-
disabled = _this$
|
|
219
|
-
readOnly = _this$
|
|
220
|
-
value = _this$
|
|
221
|
-
onKeyDown = _this$
|
|
222
|
-
onFocus = _this$
|
|
223
|
-
onBlur = _this$
|
|
224
|
-
onMouseOver = _this$
|
|
225
|
-
onMouseOut = _this$
|
|
226
|
-
indeterminate = _this$
|
|
227
|
-
variant = _this$
|
|
228
|
-
styles = _this$
|
|
221
|
+
const _this$props5 = this.props,
|
|
222
|
+
disabled = _this$props5.disabled,
|
|
223
|
+
readOnly = _this$props5.readOnly,
|
|
224
|
+
value = _this$props5.value,
|
|
225
|
+
onKeyDown = _this$props5.onKeyDown,
|
|
226
|
+
onFocus = _this$props5.onFocus,
|
|
227
|
+
onBlur = _this$props5.onBlur,
|
|
228
|
+
onMouseOver = _this$props5.onMouseOver,
|
|
229
|
+
onMouseOut = _this$props5.onMouseOut,
|
|
230
|
+
indeterminate = _this$props5.indeterminate,
|
|
231
|
+
variant = _this$props5.variant,
|
|
232
|
+
styles = _this$props5.styles;
|
|
229
233
|
const props = (0, _omitProps.omitProps)(this.props, Checkbox.allowedProps);
|
|
230
234
|
(0, _console.logError)(!(variant === 'toggle' && indeterminate), `[Checkbox] The \`toggle\` variant does not support the \`indeterminate\` property. Use the \`simple\` variant instead.`);
|
|
231
235
|
/* eslint-disable jsx-a11y/mouse-events-have-key-events */
|
package/lib/Checkbox/props.js
CHANGED
|
@@ -40,46 +40,17 @@ const propTypes = {
|
|
|
40
40
|
label: _propTypes.default.node.isRequired,
|
|
41
41
|
id: _propTypes.default.string,
|
|
42
42
|
value: _propTypes.default.oneOfType([_propTypes.default.string, _propTypes.default.number]),
|
|
43
|
-
|
|
44
|
-
/**
|
|
45
|
-
* object with shape: `{
|
|
46
|
-
* text: PropTypes.node,
|
|
47
|
-
* type: PropTypes.oneOf(['error', 'hint', 'success', 'screenreader-only'])
|
|
48
|
-
* }`
|
|
49
|
-
*/
|
|
50
43
|
messages: _propTypes.default.arrayOf(_FormPropTypes.FormPropTypes.message),
|
|
51
|
-
|
|
52
|
-
/* whether to set the input to checked or not on initial render */
|
|
53
44
|
defaultChecked: _propTypes.default.bool,
|
|
54
|
-
|
|
55
|
-
/**
|
|
56
|
-
* whether the input is checked or not (must be accompanied by an `onChange` prop)
|
|
57
|
-
*/
|
|
58
45
|
checked: (0, _controllable.controllable)(_propTypes.default.bool, 'onChange', 'defaultChecked'),
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* when used with the `checked` prop, the component will not control its own state
|
|
62
|
-
*/
|
|
63
46
|
onChange: _propTypes.default.func,
|
|
64
47
|
onKeyDown: _propTypes.default.func,
|
|
65
48
|
onFocus: _propTypes.default.func,
|
|
66
49
|
onBlur: _propTypes.default.func,
|
|
67
50
|
onMouseOver: _propTypes.default.func,
|
|
68
51
|
onMouseOut: _propTypes.default.func,
|
|
69
|
-
|
|
70
|
-
/**
|
|
71
|
-
* Whether or not to disable the checkbox
|
|
72
|
-
*/
|
|
73
52
|
disabled: _propTypes.default.bool,
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* Works just like disabled but keeps the same styles as if it were active
|
|
77
|
-
*/
|
|
78
53
|
readOnly: _propTypes.default.bool,
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* Visual state showing that child checkboxes are a combination of checked and unchecked
|
|
82
|
-
*/
|
|
83
54
|
indeterminate: _propTypes.default.bool,
|
|
84
55
|
size: _propTypes.default.oneOf(['small', 'medium', 'large']),
|
|
85
56
|
variant: _propTypes.default.oneOf(['simple', 'toggle']),
|
package/lib/Checkbox/styles.js
CHANGED
|
@@ -39,7 +39,7 @@ exports.default = void 0;
|
|
|
39
39
|
* @param {Object} state the state of the component, the style is applied to
|
|
40
40
|
* @return {Object} The final style object, which will be used in the component
|
|
41
41
|
*/
|
|
42
|
-
const generateStyle = (
|
|
42
|
+
const generateStyle = (_componentTheme, props) => {
|
|
43
43
|
const inline = props.inline,
|
|
44
44
|
disabled = props.disabled;
|
|
45
45
|
return {
|
|
@@ -32,5 +32,6 @@ 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
|
+
// @ts-expect-error ts-migrate(2339) FIXME: Property 'selector' does not exist on type 'typeof... Remove this comment to see the full error message
|
|
35
36
|
const CheckboxGroupLocator = (0, _locator.locator)(_index.CheckboxGroup.selector);
|
|
36
37
|
exports.CheckboxGroupLocator = CheckboxGroupLocator;
|
|
@@ -33,10 +33,12 @@ var _dec, _class, _class2, _temp;
|
|
|
33
33
|
---
|
|
34
34
|
category: components
|
|
35
35
|
---
|
|
36
|
+
@tsProps
|
|
36
37
|
**/
|
|
37
38
|
let CheckboxGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _class2 = class CheckboxGroup extends _react.Component {
|
|
38
39
|
constructor(props) {
|
|
39
|
-
super();
|
|
40
|
+
super(props);
|
|
41
|
+
this._messagesId = void 0;
|
|
40
42
|
this.ref = null;
|
|
41
43
|
|
|
42
44
|
this.handleRef = el => {
|
|
@@ -44,7 +46,7 @@ let CheckboxGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
44
46
|
};
|
|
45
47
|
|
|
46
48
|
this.handleChange = e => {
|
|
47
|
-
const newValue = this.value
|
|
49
|
+
const newValue = this.value;
|
|
48
50
|
|
|
49
51
|
if (this.props.disabled || this.props.readOnly) {
|
|
50
52
|
e.preventDefault();
|
|
@@ -70,7 +72,7 @@ let CheckboxGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
70
72
|
|
|
71
73
|
if (typeof props.value === 'undefined') {
|
|
72
74
|
this.state = {
|
|
73
|
-
value: props.defaultValue
|
|
75
|
+
value: props.defaultValue || []
|
|
74
76
|
};
|
|
75
77
|
}
|
|
76
78
|
|
|
@@ -82,11 +84,7 @@ let CheckboxGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
82
84
|
}
|
|
83
85
|
|
|
84
86
|
get value() {
|
|
85
|
-
|
|
86
|
-
return [];
|
|
87
|
-
} else {
|
|
88
|
-
return typeof this.props.value === 'undefined' ? [...this.state.value] : [...this.props.value];
|
|
89
|
-
}
|
|
87
|
+
return typeof this.props.value === 'undefined' ? [...this.state.value] : [...this.props.value];
|
|
90
88
|
}
|
|
91
89
|
|
|
92
90
|
renderChildren() {
|
|
@@ -96,18 +94,19 @@ let CheckboxGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
96
94
|
size = _this$props.size,
|
|
97
95
|
disabled = _this$props.disabled,
|
|
98
96
|
readOnly = _this$props.readOnly;
|
|
99
|
-
return _react.Children.map(children,
|
|
97
|
+
return _react.Children.map(children, child => {
|
|
100
98
|
if ((0, _matchComponentTypes.matchComponentTypes)(child, [_Checkbox.Checkbox])) {
|
|
101
99
|
return (0, _safeCloneElement.safeCloneElement)(child, {
|
|
102
100
|
key: `${child.props.name}`,
|
|
103
101
|
name,
|
|
102
|
+
label: child.props.label,
|
|
104
103
|
disabled: disabled || child.props.disabled,
|
|
105
104
|
readOnly: readOnly || child.props.readOnly,
|
|
106
105
|
size,
|
|
107
106
|
checked: this.value.indexOf(child.props.value) > -1,
|
|
108
107
|
onChange: this.handleChange,
|
|
109
108
|
width: child.props.width || 'auto',
|
|
110
|
-
'aria-describedby': this.hasMessages
|
|
109
|
+
'aria-describedby': this.hasMessages ? this._messagesId : void 0
|
|
111
110
|
});
|
|
112
111
|
} else {
|
|
113
112
|
return child;
|
|
@@ -116,15 +115,13 @@ let CheckboxGroup = (_dec = (0, _testable.testable)(), _dec(_class = (_temp = _c
|
|
|
116
115
|
}
|
|
117
116
|
|
|
118
117
|
render() {
|
|
119
|
-
return (
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
}), this.renderChildren())
|
|
127
|
-
);
|
|
118
|
+
return /*#__PURE__*/_react.default.createElement(_FormFieldGroup.FormFieldGroup, Object.assign({}, (0, _omitProps.omitProps)(this.props, CheckboxGroup.allowedProps), (0, _pickProps.pickProps)(this.props, _FormFieldGroup.FormFieldGroup.allowedProps), {
|
|
119
|
+
description: this.props.description,
|
|
120
|
+
rowSpacing: "small",
|
|
121
|
+
vAlign: "top",
|
|
122
|
+
messagesId: this._messagesId,
|
|
123
|
+
elementRef: this.handleRef
|
|
124
|
+
}), this.renderChildren());
|
|
128
125
|
}
|
|
129
126
|
|
|
130
127
|
}, _class2.displayName = "CheckboxGroup", _class2.componentId = 'CheckboxGroup', _class2.propTypes = _props.propTypes, _class2.allowedProps = _props.allowedProps, _class2.defaultProps = {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@instructure/ui-checkbox",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.15.1-snapshot.2+00f55c738",
|
|
4
4
|
"description": " styled HTML input type='checkbox' component.",
|
|
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.
|
|
29
|
-
"@instructure/emotion": "8.
|
|
30
|
-
"@instructure/shared-types": "8.
|
|
31
|
-
"@instructure/ui-dom-utils": "8.
|
|
32
|
-
"@instructure/ui-form-field": "8.
|
|
33
|
-
"@instructure/ui-icons": "8.
|
|
34
|
-
"@instructure/ui-prop-types": "8.
|
|
35
|
-
"@instructure/ui-react-utils": "8.
|
|
36
|
-
"@instructure/ui-svg-images": "8.
|
|
37
|
-
"@instructure/ui-testable": "8.
|
|
38
|
-
"@instructure/ui-utils": "8.
|
|
39
|
-
"@instructure/ui-view": "8.
|
|
40
|
-
"@instructure/uid": "8.
|
|
28
|
+
"@instructure/console": "8.15.1-snapshot.2+00f55c738",
|
|
29
|
+
"@instructure/emotion": "8.15.1-snapshot.2+00f55c738",
|
|
30
|
+
"@instructure/shared-types": "8.15.1-snapshot.2+00f55c738",
|
|
31
|
+
"@instructure/ui-dom-utils": "8.15.1-snapshot.2+00f55c738",
|
|
32
|
+
"@instructure/ui-form-field": "8.15.1-snapshot.2+00f55c738",
|
|
33
|
+
"@instructure/ui-icons": "8.15.1-snapshot.2+00f55c738",
|
|
34
|
+
"@instructure/ui-prop-types": "8.15.1-snapshot.2+00f55c738",
|
|
35
|
+
"@instructure/ui-react-utils": "8.15.1-snapshot.2+00f55c738",
|
|
36
|
+
"@instructure/ui-svg-images": "8.15.1-snapshot.2+00f55c738",
|
|
37
|
+
"@instructure/ui-testable": "8.15.1-snapshot.2+00f55c738",
|
|
38
|
+
"@instructure/ui-utils": "8.15.1-snapshot.2+00f55c738",
|
|
39
|
+
"@instructure/ui-view": "8.15.1-snapshot.2+00f55c738",
|
|
40
|
+
"@instructure/uid": "8.15.1-snapshot.2+00f55c738",
|
|
41
41
|
"keycode": "^2",
|
|
42
42
|
"prop-types": "^15"
|
|
43
43
|
},
|
|
44
44
|
"devDependencies": {
|
|
45
|
-
"@instructure/ui-babel-preset": "8.
|
|
46
|
-
"@instructure/ui-color-utils": "8.
|
|
47
|
-
"@instructure/ui-test-locator": "8.
|
|
48
|
-
"@instructure/ui-test-utils": "8.
|
|
49
|
-
"@instructure/ui-themes": "8.
|
|
45
|
+
"@instructure/ui-babel-preset": "8.15.1-snapshot.2+00f55c738",
|
|
46
|
+
"@instructure/ui-color-utils": "8.15.1-snapshot.2+00f55c738",
|
|
47
|
+
"@instructure/ui-test-locator": "8.15.1-snapshot.2+00f55c738",
|
|
48
|
+
"@instructure/ui-test-utils": "8.15.1-snapshot.2+00f55c738",
|
|
49
|
+
"@instructure/ui-themes": "8.15.1-snapshot.2+00f55c738"
|
|
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": "00f55c7382e82209ea553c107951c4356ba202bf"
|
|
59
59
|
}
|
|
@@ -40,6 +40,7 @@ import type { CheckboxFacadeProps } from './props'
|
|
|
40
40
|
---
|
|
41
41
|
parent: Checkbox
|
|
42
42
|
---
|
|
43
|
+
@tsProps
|
|
43
44
|
**/
|
|
44
45
|
@withStyle(generateStyle, generateComponentTheme)
|
|
45
46
|
class CheckboxFacade extends Component<CheckboxFacadeProps> {
|
|
@@ -62,14 +63,11 @@ class CheckboxFacade extends Component<CheckboxFacadeProps> {
|
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
componentDidMount() {
|
|
65
|
-
|
|
66
|
-
this.props.makeStyles()
|
|
66
|
+
this.props.makeStyles?.()
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
|
72
|
-
this.props.makeStyles()
|
|
69
|
+
componentDidUpdate() {
|
|
70
|
+
this.props.makeStyles?.()
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
renderIcon() {
|
|
@@ -36,6 +36,9 @@ type CheckboxFacadeOwnProps = {
|
|
|
36
36
|
focused?: boolean
|
|
37
37
|
hovered?: boolean
|
|
38
38
|
size?: 'small' | 'medium' | 'large'
|
|
39
|
+
/**
|
|
40
|
+
* Visual state showing that child checkboxes are a combination of checked and unchecked
|
|
41
|
+
*/
|
|
39
42
|
indeterminate?: boolean
|
|
40
43
|
}
|
|
41
44
|
|
|
@@ -54,9 +57,6 @@ const propTypes: PropValidators<PropKeys> = {
|
|
|
54
57
|
focused: PropTypes.bool,
|
|
55
58
|
hovered: PropTypes.bool,
|
|
56
59
|
size: PropTypes.oneOf(['small', 'medium', 'large']),
|
|
57
|
-
/**
|
|
58
|
-
* Visual state showing that child checkboxes are a combination of checked and unchecked
|
|
59
|
-
*/
|
|
60
60
|
indeterminate: PropTypes.bool
|
|
61
61
|
}
|
|
62
62
|
|
|
@@ -39,6 +39,7 @@ import type { ToggleFacadeProps } from './props'
|
|
|
39
39
|
---
|
|
40
40
|
parent: Checkbox
|
|
41
41
|
---
|
|
42
|
+
@tsProps
|
|
42
43
|
**/
|
|
43
44
|
@withStyle(generateStyle, generateComponentTheme)
|
|
44
45
|
class ToggleFacade extends Component<ToggleFacadeProps> {
|
|
@@ -62,14 +63,11 @@ class ToggleFacade extends Component<ToggleFacadeProps> {
|
|
|
62
63
|
}
|
|
63
64
|
|
|
64
65
|
componentDidMount() {
|
|
65
|
-
|
|
66
|
-
this.props.makeStyles()
|
|
66
|
+
this.props.makeStyles?.()
|
|
67
67
|
}
|
|
68
68
|
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
// @ts-expect-error ts-migrate(2722) FIXME: Cannot invoke an object which is possibly 'undefin... Remove this comment to see the full error message
|
|
72
|
-
this.props.makeStyles()
|
|
69
|
+
componentDidUpdate() {
|
|
70
|
+
this.props.makeStyles?.()
|
|
73
71
|
}
|
|
74
72
|
|
|
75
73
|
renderIcon() {
|