@dartech/arsenal-ui 1.3.33 → 1.3.35
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/index.js +11 -11
- package/package.json +1 -1
- package/src/interfaces/ui.d.ts +1 -0
- package/src/lib/Forms/ControlCheckbox.d.ts +2 -1
package/index.js
CHANGED
@@ -518,12 +518,12 @@ const ControlCheckbox = _a => {
|
|
518
518
|
name = '',
|
519
519
|
label = '',
|
520
520
|
required = false,
|
521
|
-
|
521
|
+
defaultValue,
|
522
522
|
disabled = false,
|
523
523
|
hideErrorMessage = false,
|
524
524
|
onChange: customOnChange
|
525
525
|
} = _a,
|
526
|
-
checkboxProps = __rest(_a, ["control", "validate", "name", "label", "required", "disabled", "hideErrorMessage", "onChange"]);
|
526
|
+
checkboxProps = __rest(_a, ["control", "validate", "name", "label", "required", "defaultValue", "disabled", "hideErrorMessage", "onChange"]);
|
527
527
|
const {
|
528
528
|
field: {
|
529
529
|
ref,
|
@@ -535,7 +535,7 @@ const ControlCheckbox = _a => {
|
|
535
535
|
} = useController({
|
536
536
|
name,
|
537
537
|
control,
|
538
|
-
defaultValue
|
538
|
+
defaultValue
|
539
539
|
});
|
540
540
|
const value = useWatch({
|
541
541
|
control,
|
@@ -567,7 +567,8 @@ const ControlCheckbox = _a => {
|
|
567
567
|
onChange: customOnChange ? customOnChange : onChange,
|
568
568
|
name: name,
|
569
569
|
inputRef: ref,
|
570
|
-
disabled: disabled
|
570
|
+
disabled: disabled,
|
571
|
+
defaultChecked: defaultValue
|
571
572
|
}, checkboxProps)),
|
572
573
|
label: label
|
573
574
|
}), !hideErrorMessage && (error === null || error === void 0 ? void 0 : error.message) && jsx(FormHelperText, {
|
@@ -4392,13 +4393,11 @@ const NumericTypeValidator = ({
|
|
4392
4393
|
children: [jsx(ControlCheckbox, {
|
4393
4394
|
control: control,
|
4394
4395
|
name: `${name}.exclusiveMinimum`,
|
4395
|
-
label: "Exclusive Minimum"
|
4396
|
-
defaultValue: 'false'
|
4396
|
+
label: "Exclusive Minimum"
|
4397
4397
|
}), jsx(ControlCheckbox, {
|
4398
4398
|
control: control,
|
4399
4399
|
name: `${name}.exclusiveMaximum`,
|
4400
|
-
label: "Exclusive Maximum"
|
4401
|
-
defaultValue: 'false'
|
4400
|
+
label: "Exclusive Maximum"
|
4402
4401
|
})]
|
4403
4402
|
}))]
|
4404
4403
|
});
|
@@ -4729,14 +4728,14 @@ const CreatePropertyFormFields = ({
|
|
4729
4728
|
spacing: 2
|
4730
4729
|
}, {
|
4731
4730
|
children: [jsx(Grid$1, {
|
4732
|
-
children: jsx(
|
4731
|
+
children: jsx(ControlInput, {
|
4733
4732
|
required: true,
|
4734
4733
|
control: control,
|
4735
4734
|
name: `${propertyFieldName}.key`,
|
4736
4735
|
label: "Key"
|
4737
4736
|
})
|
4738
4737
|
}), jsx(Grid$1, {
|
4739
|
-
children: jsx(
|
4738
|
+
children: jsx(ControlInput, {
|
4740
4739
|
required: true,
|
4741
4740
|
control: control,
|
4742
4741
|
name: `${propertyFieldName}.name`,
|
@@ -4787,7 +4786,8 @@ const CreatePropertyFormFields = ({
|
|
4787
4786
|
control: control,
|
4788
4787
|
name: `${propertyFieldName}.${field.name}`,
|
4789
4788
|
label: field.label,
|
4790
|
-
checked: field.checked
|
4789
|
+
checked: field.checked,
|
4790
|
+
defaultValue: field.defaultValue
|
4791
4791
|
}, index))
|
4792
4792
|
}) : null]
|
4793
4793
|
}), propertyType && jsxs(Fragment, {
|
package/package.json
CHANGED
package/src/interfaces/ui.d.ts
CHANGED
@@ -43,6 +43,7 @@ export type CustomPropertyFieldProps = {
|
|
43
43
|
}[];
|
44
44
|
required?: boolean;
|
45
45
|
checked?: boolean;
|
46
|
+
defaultValue?: any;
|
46
47
|
};
|
47
48
|
export type PropertyFillType = 'expression' | 'widget' | 'null' | 'string' | 'json_valid' | 'json_notvalid' | 'dem_builder';
|
48
49
|
export type StatusVariant = 'default' | 'success' | 'error' | 'warning';
|
@@ -22,6 +22,7 @@ export type ControlCheckboxProps = CheckboxProps & {
|
|
22
22
|
/**
|
23
23
|
* React Hook Form `defaultValue`
|
24
24
|
*/
|
25
|
+
defaultValue?: boolean;
|
25
26
|
/**
|
26
27
|
* Is disabled input flag
|
27
28
|
*/
|
@@ -46,5 +47,5 @@ export type ControlCheckboxProps = CheckboxProps & {
|
|
46
47
|
* Material UI `Checkbox` controlled component. Used with react-hook-form
|
47
48
|
* @category Forms
|
48
49
|
*/
|
49
|
-
export declare const ControlCheckbox: ({ control, validate, name, label, required, disabled, hideErrorMessage, onChange: customOnChange, ...checkboxProps }: ControlCheckboxProps) => JSX.Element;
|
50
|
+
export declare const ControlCheckbox: ({ control, validate, name, label, required, defaultValue, disabled, hideErrorMessage, onChange: customOnChange, ...checkboxProps }: ControlCheckboxProps) => JSX.Element;
|
50
51
|
export default ControlCheckbox;
|