@simplybusiness/mobius 6.3.1 → 6.3.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/dist/esm/index.js
CHANGED
|
@@ -2282,6 +2282,7 @@ var CheckboxGroup = forwardRef15((props, ref) => {
|
|
|
2282
2282
|
if (isValidElement(child)) {
|
|
2283
2283
|
const isLastItem = child === lastCheckbox;
|
|
2284
2284
|
const isChildDisabled = isDisabled || lastItemDisables && lastCheckboxIsChecked && !isLastItem;
|
|
2285
|
+
const childProps = child.props;
|
|
2285
2286
|
return cloneElement4(
|
|
2286
2287
|
child,
|
|
2287
2288
|
{
|
|
@@ -2290,10 +2291,8 @@ var CheckboxGroup = forwardRef15((props, ref) => {
|
|
|
2290
2291
|
isReadOnly,
|
|
2291
2292
|
isInvalid,
|
|
2292
2293
|
isLastItem,
|
|
2293
|
-
selected: selected.includes(
|
|
2294
|
-
|
|
2295
|
-
),
|
|
2296
|
-
onChange: handleChange,
|
|
2294
|
+
selected: selected.includes(childProps.value),
|
|
2295
|
+
onChange: childProps.onChange || handleChange,
|
|
2297
2296
|
"aria-describedby": describedBy
|
|
2298
2297
|
}
|
|
2299
2298
|
);
|
package/package.json
CHANGED
|
@@ -160,6 +160,11 @@ export const CheckboxGroup: ForwardedRefComponent<
|
|
|
160
160
|
isDisabled ||
|
|
161
161
|
(lastItemDisables && lastCheckboxIsChecked && !isLastItem);
|
|
162
162
|
|
|
163
|
+
const childProps = child.props as {
|
|
164
|
+
value: string;
|
|
165
|
+
onChange?: (event: ChangeEvent<HTMLInputElement>) => void;
|
|
166
|
+
};
|
|
167
|
+
|
|
163
168
|
return cloneElement(
|
|
164
169
|
child as ReactElement,
|
|
165
170
|
{
|
|
@@ -168,10 +173,8 @@ export const CheckboxGroup: ForwardedRefComponent<
|
|
|
168
173
|
isReadOnly,
|
|
169
174
|
isInvalid,
|
|
170
175
|
isLastItem,
|
|
171
|
-
selected: selected.includes(
|
|
172
|
-
|
|
173
|
-
),
|
|
174
|
-
onChange: handleChange,
|
|
176
|
+
selected: selected.includes(childProps.value),
|
|
177
|
+
onChange: childProps.onChange || handleChange,
|
|
175
178
|
"aria-describedby": describedBy,
|
|
176
179
|
} as Record<string, unknown>,
|
|
177
180
|
);
|