ish-ui 1.0.43 → 1.0.44
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.
|
@@ -3,5 +3,6 @@
|
|
|
3
3
|
* */
|
|
4
4
|
import React from 'react';
|
|
5
5
|
import { CheckboxFieldProps, FieldInputProps } from '../model';
|
|
6
|
+
import { CheckboxProps } from '@mui/material/Checkbox/Checkbox';
|
|
6
7
|
export declare const StyledCheckbox: React.JSXElementConstructor<Omit<any, "classes"> & import("@mui/styles/withStyles").StyledComponentProps<"root"> & object>;
|
|
7
|
-
export declare function CheckboxField<IP extends FieldInputProps>({ input, color, disabled, stringValue, className, uncheckedClass, onChangeHandler, stopPropagation }: CheckboxFieldProps<IP>): React.JSX.Element;
|
|
8
|
+
export declare function CheckboxField<IP extends FieldInputProps>({ input, color, disabled, stringValue, className, uncheckedClass, onChangeHandler, stopPropagation, ...rest }: CheckboxFieldProps<IP> & CheckboxProps): React.JSX.Element;
|
|
@@ -50,7 +50,8 @@ const StyledCheckboxBase = props => {
|
|
|
50
50
|
} }, rest)));
|
|
51
51
|
};
|
|
52
52
|
export const StyledCheckbox = withStyles(styles)(StyledCheckboxBase);
|
|
53
|
-
export function CheckboxField(
|
|
53
|
+
export function CheckboxField(_a) {
|
|
54
|
+
var { input, color, disabled, stringValue, className, uncheckedClass, onChangeHandler, stopPropagation } = _a, rest = __rest(_a, ["input", "color", "disabled", "stringValue", "className", "uncheckedClass", "onChangeHandler", "stopPropagation"]);
|
|
54
55
|
const onChange = useCallback((e, value) => {
|
|
55
56
|
let checked = value;
|
|
56
57
|
if (stringValue) {
|
|
@@ -63,5 +64,5 @@ export function CheckboxField({ input, color, disabled, stringValue, className,
|
|
|
63
64
|
input.onChange(checked);
|
|
64
65
|
}
|
|
65
66
|
}, [stringValue, input, onChangeHandler]);
|
|
66
|
-
return (React.createElement(StyledCheckbox, { checked: getValue(input.value, stringValue), onChange: onChange, color: color, disabled: disabled, className: className, uncheckedClass: uncheckedClass, onClick: stopPropagation ? e => e.stopPropagation() : undefined, id: `input-${input.name}`, name: input.name }));
|
|
67
|
+
return (React.createElement(StyledCheckbox, Object.assign({ checked: getValue(input.value, stringValue), onChange: onChange, color: color, disabled: disabled, className: className, uncheckedClass: uncheckedClass, onClick: stopPropagation ? e => e.stopPropagation() : undefined, id: `input-${input.name}`, name: input.name }, rest)));
|
|
67
68
|
}
|
package/dist/model/Fields.d.ts
CHANGED
|
@@ -7,6 +7,7 @@ import { PopperPlacementType } from '@mui/material';
|
|
|
7
7
|
import { FormControlTypeMap } from '@mui/material/FormControl/FormControl';
|
|
8
8
|
import { RadioProps } from '@mui/material/Radio/Radio';
|
|
9
9
|
import { RadioGroupProps } from '@mui/material/RadioGroup/RadioGroup';
|
|
10
|
+
import { CheckboxProps } from '@mui/material/Checkbox/Checkbox';
|
|
10
11
|
export type EventHandler<Event> = (event: Event, name?: string) => void;
|
|
11
12
|
export interface EventOrValueHandler<Event> extends EventHandler<Event> {
|
|
12
13
|
(value: any): void;
|
|
@@ -217,11 +218,10 @@ export interface FormSwitchProps<IP> {
|
|
|
217
218
|
onChangeHandler?: AnyArgFunction;
|
|
218
219
|
onClick?: AnyArgFunction;
|
|
219
220
|
}
|
|
220
|
-
export interface CheckboxFieldProps<IP> {
|
|
221
|
+
export interface CheckboxFieldProps<IP> extends CheckboxProps {
|
|
221
222
|
input?: Partial<Omit<IP, 'onBlur'>> & {
|
|
222
223
|
onBlur?: AnyArgFunction;
|
|
223
224
|
};
|
|
224
|
-
color?: string;
|
|
225
225
|
disabled?: boolean;
|
|
226
226
|
stringValue?: boolean;
|
|
227
227
|
className?: string;
|