@arquimedes.co/eureka-forms 2.0.19 → 2.0.21
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/@Types/FormStep.d.ts +1 -0
- package/dist/App/App.js +2 -2
- package/dist/App/AppFunctions.js +1 -1
- package/dist/Form/Section/MaterialSection/MaterialSection.js +1 -1
- package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +1 -1
- package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +2 -2
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +1 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +2 -2
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +1 -1
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +23 -23
- package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.module.css +6 -0
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +2 -2
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +20 -63
- package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.module.css +0 -16
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +1 -1
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +21 -76
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css +0 -28
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +1 -1
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +39 -96
- package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +2 -2
- package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +7 -38
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +1 -1
- package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +20 -74
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +2 -2
- package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +18 -42
- package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +2 -2
- package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +9 -5
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +1 -1
- package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +15 -43
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +2 -2
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +22 -78
- package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.module.css +0 -16
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +1 -9
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +26 -57
- package/dist/FormSteps/Step.d.ts +0 -2
- package/dist/FormSteps/StepFunctions.d.ts +2 -1
- package/dist/FormSteps/StepFunctions.js +71 -63
- package/dist/FormSteps/StepHooks.d.ts +16 -0
- package/dist/FormSteps/StepHooks.js +58 -2
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +3 -3
- package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +6 -37
- package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +13 -39
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +1 -1
- package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +4 -24
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +9 -0
- package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +48 -0
- package/dist/FormSteps/{EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.module.css → Utils/@StepFiller/StepFiller.module.css} +16 -16
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +11 -0
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +32 -0
- package/dist/FormSteps/{DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.module.css → Utils/MaterialInputContainer/MaterialInputContainer.module.css} +9 -9
- package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +3 -3
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +1 -4
- package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +1 -3
- package/dist/States/SiteSlice.d.ts +2 -1
- package/dist/States/SiteSlice.js +25 -6
- package/dist/hooks.d.ts +2 -0
- package/dist/hooks.js +5 -1
- package/package.json +2 -2
- package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.module.css +0 -25
- package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.module.css +0 -9
|
@@ -9,34 +9,26 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
13
|
import styles from './MaterialRatingStep.module.css';
|
|
25
|
-
import {
|
|
26
|
-
import React, { useCallback, useContext } from 'react';
|
|
14
|
+
import React, { useContext } from 'react';
|
|
27
15
|
import Rating from '../../../Shared/Rating/Rating';
|
|
28
16
|
import { RatingTypes } from '../../../constants/FormStepTypes';
|
|
29
17
|
import StepComponent from '../../Step';
|
|
30
18
|
import FormContext from '../../../Contexts/FormContext';
|
|
31
19
|
import { useAppSelector } from '../../../hooks';
|
|
32
|
-
import {
|
|
33
|
-
function
|
|
34
|
-
var _b, _c, _d, _e
|
|
35
|
-
var step = _a.step,
|
|
20
|
+
import { useFormStep } from '../../StepHooks';
|
|
21
|
+
function RatingStep(_a) {
|
|
22
|
+
var _b, _c, _d, _e;
|
|
23
|
+
var step = _a.step, editable = _a.editable;
|
|
24
|
+
var _f = useFormStep(step, {
|
|
25
|
+
rules: {
|
|
26
|
+
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
27
|
+
},
|
|
28
|
+
}), ref = _f.ref, value = _f.value, onChange = _f.onChange, error = _f.error;
|
|
36
29
|
var _g = useAppSelector(function (state) { return state.global; }), formStyle = _g.formStyle, postview = _g.postview;
|
|
37
30
|
var form = useContext(FormContext);
|
|
38
31
|
var widthStats = useAppSelector(function (state) { return state.widthStats; });
|
|
39
|
-
var errors = useFormContext().formState.errors;
|
|
40
32
|
var renderNestedOption = function () {
|
|
41
33
|
var currentOption;
|
|
42
34
|
if (value !== undefined && value !== null && step.nestedSteps) {
|
|
@@ -49,39 +41,19 @@ function MaterialRatingStep(_a) {
|
|
|
49
41
|
if (currentOption && currentOption.length > 0) {
|
|
50
42
|
return (_jsx(React.Fragment, { children: currentOption.map(function (idSubStep) {
|
|
51
43
|
var subStep = form.steps[idSubStep];
|
|
52
|
-
return (_jsx(StepComponent, { editable: editable, step: subStep
|
|
44
|
+
return (_jsx(StepComponent, { editable: editable, step: subStep }, idSubStep));
|
|
53
45
|
}) }));
|
|
54
46
|
}
|
|
55
47
|
}
|
|
56
48
|
};
|
|
57
49
|
return (_jsxs(React.Fragment, { children: [_jsxs("div", __assign({ className: styles.container, style: {
|
|
58
50
|
paddingBottom: step.description || step.required ? 0 : 15,
|
|
59
|
-
} }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label + (step.required ? ' *' : '') })), _jsx("div", __assign({ className: styles.ratingContainer }, { children: _jsx(Rating, { name: step.id, type: step.ratingType, isMobile: widthStats.isMobile, focusColor: (_b = formStyle.primaryColor) !== null && _b !== void 0 ? _b : '#3d5a7f', unSelectedColor: (_c = formStyle.outlineColor) !== null && _c !== void 0 ? _c : '#b8b8b8', disabled: !editable || postview, value: value, onChange: onChange, inputRef:
|
|
60
|
-
color: !!
|
|
51
|
+
} }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label + (step.required ? ' *' : '') })), _jsx("div", __assign({ className: styles.ratingContainer }, { children: _jsx(Rating, { name: step.id, type: step.ratingType, isMobile: widthStats.isMobile, focusColor: (_b = formStyle.primaryColor) !== null && _b !== void 0 ? _b : '#3d5a7f', unSelectedColor: (_c = formStyle.outlineColor) !== null && _c !== void 0 ? _c : '#b8b8b8', disabled: !editable || postview, value: value, onChange: onChange, inputRef: ref }) })), (step.description || step.required) && (_jsx("div", __assign({ className: styles.stepDescriptionLabel, style: {
|
|
52
|
+
color: !!error && value === null
|
|
61
53
|
? (_d = formStyle.errorColor) !== null && _d !== void 0 ? _d : '#cc2936'
|
|
62
54
|
: (_e = formStyle.descriptionTextColor) !== null && _e !== void 0 ? _e : '#989898',
|
|
63
|
-
} }, { children: !!
|
|
64
|
-
?
|
|
55
|
+
} }, { children: !!error && value === null
|
|
56
|
+
? error === null || error === void 0 ? void 0 : error.message
|
|
65
57
|
: step.description })))] })), renderNestedOption()] }));
|
|
66
58
|
}
|
|
67
|
-
function RatingStep(props) {
|
|
68
|
-
var step = props.step;
|
|
69
|
-
var _a = useStepDependency(step), handleStepDep = _a.handleStepDep, originalValue = _a.originalValue;
|
|
70
|
-
var _b = useController({
|
|
71
|
-
name: step.id,
|
|
72
|
-
shouldUnregister: true,
|
|
73
|
-
rules: {
|
|
74
|
-
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
75
|
-
},
|
|
76
|
-
defaultValue: originalValue,
|
|
77
|
-
}).field, ref = _b.ref, field = __rest(_b, ["ref"]);
|
|
78
|
-
var onChange = useCallback(function (value) {
|
|
79
|
-
handleStepDep(value);
|
|
80
|
-
field.onChange(value);
|
|
81
|
-
}, [handleStepDep, field]);
|
|
82
|
-
return (_jsx(MaterialRatingStep, __assign({}, props, field, { inputRef: ref, onChange: function (value) {
|
|
83
|
-
handleStepDep(value);
|
|
84
|
-
onChange(value);
|
|
85
|
-
} })));
|
|
86
|
-
}
|
|
87
59
|
export default RatingStep;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SelectorStepProps } from '../SelectorStep';
|
|
3
|
-
declare function
|
|
4
|
-
export default
|
|
3
|
+
declare function SelectorStepContainer(props: SelectorStepProps): JSX.Element;
|
|
4
|
+
export default SelectorStepContainer;
|
|
@@ -9,59 +9,27 @@ var __assign = (this && this.__assign) || function () {
|
|
|
9
9
|
};
|
|
10
10
|
return __assign.apply(this, arguments);
|
|
11
11
|
};
|
|
12
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
13
|
-
var t = {};
|
|
14
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
15
|
-
t[p] = s[p];
|
|
16
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
18
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
19
|
-
t[p[i]] = s[p[i]];
|
|
20
|
-
}
|
|
21
|
-
return t;
|
|
22
|
-
};
|
|
23
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
-
import React, {
|
|
13
|
+
import React, { useContext } from 'react';
|
|
25
14
|
import { OptionTypes } from '../../../constants/FormStepTypes';
|
|
26
|
-
import styles from './MaterialSelectorStep.module.css';
|
|
27
15
|
import StepComponent from '../../Step';
|
|
28
|
-
import { calcFillerSize, calcStepWidth } from '../../StepFunctions';
|
|
29
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
30
16
|
import RoundedSmartSelect from '../../../Shared/RoundedSmartSelect/RoundedSmartSelect';
|
|
31
17
|
import FormContext from '../../../Contexts/FormContext';
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
|
|
35
|
-
|
|
18
|
+
import { useAppSelector } from '../../../hooks';
|
|
19
|
+
import { useFormStep } from '../../StepHooks';
|
|
20
|
+
import StepFillerContainer from '../../Utils/@StepFiller/StepFiller';
|
|
21
|
+
import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
|
|
22
|
+
function SelectorStep(_a) {
|
|
23
|
+
var _b, _c, _d;
|
|
24
|
+
var step = _a.step, editable = _a.editable;
|
|
25
|
+
var _e = useFormStep(step, {
|
|
26
|
+
rules: {
|
|
27
|
+
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
28
|
+
},
|
|
29
|
+
sizeChange: true,
|
|
30
|
+
}), ref = _e.ref, value = _e.value, onChange = _e.onChange, error = _e.error, field = _e.field;
|
|
36
31
|
var form = useContext(FormContext);
|
|
37
|
-
var
|
|
38
|
-
var currentBreakPoint = useAppSelector(selectBreakPoint);
|
|
39
|
-
var _c = useFormContext(), getValues = _c.getValues, errors = _c.formState.errors;
|
|
40
|
-
var _d = useState(level === 0
|
|
41
|
-
? calcFillerSize(step, form.steps, getValues(), form.size)
|
|
42
|
-
: 0), fillerSize = _d[0], setFillerSize = _d[1];
|
|
43
|
-
var sizeChange = function () {
|
|
44
|
-
handleSizeChange === null || handleSizeChange === void 0 ? void 0 : handleSizeChange();
|
|
45
|
-
if (level === 0) {
|
|
46
|
-
setFillerSize(calcFillerSize(step, form.steps, getValues(), form.size));
|
|
47
|
-
}
|
|
48
|
-
};
|
|
49
|
-
var renderSelect = function () {
|
|
50
|
-
var _a, _b, _c, _d;
|
|
51
|
-
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
52
|
-
width: currentBreakPoint <= step.size
|
|
53
|
-
? '100%'
|
|
54
|
-
: calcStepWidth(step.size, form.size),
|
|
55
|
-
minHeight: step.description ||
|
|
56
|
-
(!postview && editable && step.required)
|
|
57
|
-
? '55px'
|
|
58
|
-
: '43px',
|
|
59
|
-
} }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, disabled: false, loading: false, options: step.options, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: (_a = formStyle.stepBackgroundColor) !== null && _a !== void 0 ? _a : 'white', label: step.label, required: step.required, height: '31px', searchable: step.searchable, icon: undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", handleUpdate: function (value) {
|
|
60
|
-
onChange(value);
|
|
61
|
-
}, getOptionSelected: function (option, value) {
|
|
62
|
-
return (option === null || option === void 0 ? void 0 : option.value) === (value === null || value === void 0 ? void 0 : value.value);
|
|
63
|
-
}, helperText: (_d = (_c = (_b = errors[step.id]) === null || _b === void 0 ? void 0 : _b.message) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : step.description, error: !!errors[step.id] }) })));
|
|
64
|
-
};
|
|
32
|
+
var _f = useAppSelector(function (state) { return state.global; }), postview = _f.postview, formStyle = _f.formStyle;
|
|
65
33
|
var mapNestedOption = function () {
|
|
66
34
|
var currentOptionIndex = null;
|
|
67
35
|
var currentOption = null;
|
|
@@ -76,39 +44,15 @@ function Selector(_a) {
|
|
|
76
44
|
currentOptionIndex !== null) {
|
|
77
45
|
return (_jsx(React.Fragment, { children: currentOption.steps.map(function (idSubStep) {
|
|
78
46
|
var subStep = form.steps[idSubStep];
|
|
79
|
-
return (_jsx(StepComponent, { editable: editable, step: subStep
|
|
47
|
+
return (_jsx(StepComponent, { editable: editable, step: subStep }, idSubStep));
|
|
80
48
|
}) }));
|
|
81
49
|
}
|
|
82
50
|
};
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
} }, { children: [renderSelect(), mapNestedOption(), level === 0 && step.maxSize < form.size.blockNum && (_jsx("div", { className: styles.smallSeparator, style: {
|
|
87
|
-
width: fillerSize,
|
|
88
|
-
} }))] })));
|
|
89
|
-
}
|
|
90
|
-
else {
|
|
91
|
-
return (_jsxs(React.Fragment, { children: [renderSelect(), mapNestedOption(), level === 0 && step.maxSize && (_jsx("div", { className: styles.separator }))] }));
|
|
92
|
-
}
|
|
51
|
+
return (_jsxs(React.Fragment, { children: [_jsx(MaterialInputContainer, __assign({ step: step, editable: editable }, { children: _jsx(RoundedSmartSelect, __assign({}, field, { value: value, inputRef: ref, handleUpdate: onChange, disabled: false, loading: false, options: step.options, cantEdit: !editable || postview, fullWidth: true, backgroundColor: (_b = formStyle.stepBackgroundColor) !== null && _b !== void 0 ? _b : 'white', label: step.label, required: step.required, height: '31px', searchable: step.searchable, icon: undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", getOptionSelected: function (option, value) {
|
|
52
|
+
return (option === null || option === void 0 ? void 0 : option.value) === (value === null || value === void 0 ? void 0 : value.value);
|
|
53
|
+
}, helperText: (_d = (_c = error === null || error === void 0 ? void 0 : error.message) === null || _c === void 0 ? void 0 : _c.toString()) !== null && _d !== void 0 ? _d : step.description, error: !!error })) })), value && mapNestedOption()] }));
|
|
93
54
|
}
|
|
94
|
-
function
|
|
95
|
-
|
|
96
|
-
var _a = useStepDependency(step), handleStepDep = _a.handleStepDep, originalValue = _a.originalValue;
|
|
97
|
-
var _b = useController({
|
|
98
|
-
name: step.id,
|
|
99
|
-
rules: {
|
|
100
|
-
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
101
|
-
},
|
|
102
|
-
shouldUnregister: true,
|
|
103
|
-
defaultValue: originalValue,
|
|
104
|
-
}).field, ref = _b.ref, field = __rest(_b, ["ref"]);
|
|
105
|
-
var onChange = useCallback(function (value) {
|
|
106
|
-
handleStepDep(value);
|
|
107
|
-
field.onChange(value);
|
|
108
|
-
}, [handleStepDep, field]);
|
|
109
|
-
return (_jsx(Selector, __assign({}, props, field, { inputRef: ref, onChange: function (value) {
|
|
110
|
-
handleStepDep(value);
|
|
111
|
-
onChange(value);
|
|
112
|
-
} })));
|
|
55
|
+
function SelectorStepContainer(props) {
|
|
56
|
+
return (_jsx(StepFillerContainer, __assign({ step: props.step }, { children: _jsx(SelectorStep, __assign({}, props)) })));
|
|
113
57
|
}
|
|
114
|
-
export default
|
|
58
|
+
export default SelectorStepContainer;
|
|
@@ -7,19 +7,3 @@
|
|
|
7
7
|
padding-top: 5px;
|
|
8
8
|
margin-bottom: 0px;
|
|
9
9
|
}
|
|
10
|
-
.separator {
|
|
11
|
-
flex-basis: 100%;
|
|
12
|
-
height: 0;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
.firstLvlContainer {
|
|
16
|
-
max-width: 100%;
|
|
17
|
-
display: flex;
|
|
18
|
-
flex-flow: row wrap;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
.smallSeparator {
|
|
22
|
-
height: 0;
|
|
23
|
-
max-width: 100%;
|
|
24
|
-
flex-basis: 0;
|
|
25
|
-
}
|
|
@@ -1,13 +1,5 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
|
-
import { FieldError } from 'react-hook-form';
|
|
3
2
|
import { SmartSelectStepProps } from '../SmartSelectStep';
|
|
4
3
|
import { GSmartSelect } from '../../../@Types/GenericFormSteps';
|
|
5
|
-
|
|
6
|
-
error: FieldError | undefined;
|
|
7
|
-
onChange: any;
|
|
8
|
-
onBlur: (event: any) => void;
|
|
9
|
-
value: any;
|
|
10
|
-
inputRef: any;
|
|
11
|
-
}): JSX.Element;
|
|
12
|
-
declare function SmartSelectStep(props: SmartSelectStepProps): JSX.Element;
|
|
4
|
+
declare function SmartSelectStep<StepType extends GSmartSelect>({ icon, step, editable, getOptions, calcDepError, defaultValue, valueOverwrite, getValueString, changeListener, getValueWarning, getOptionSelected, renderNestedSteps, }: SmartSelectStepProps<StepType>): JSX.Element;
|
|
13
5
|
export default SmartSelectStep;
|
|
@@ -45,45 +45,42 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
45
45
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
46
46
|
}
|
|
47
47
|
};
|
|
48
|
-
var __rest = (this && this.__rest) || function (s, e) {
|
|
49
|
-
var t = {};
|
|
50
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
51
|
-
t[p] = s[p];
|
|
52
|
-
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
53
|
-
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
54
|
-
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
55
|
-
t[p[i]] = s[p[i]];
|
|
56
|
-
}
|
|
57
|
-
return t;
|
|
58
|
-
};
|
|
59
48
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
60
|
-
import
|
|
61
|
-
import { useController, useFormContext } from 'react-hook-form';
|
|
62
|
-
import { calcStepWidth } from '../../StepFunctions';
|
|
49
|
+
import { useFormContext } from 'react-hook-form';
|
|
63
50
|
import RoundedSmartSelect from '../../../Shared/RoundedSmartSelect/RoundedSmartSelect';
|
|
64
51
|
import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
|
|
65
52
|
import React from 'react';
|
|
66
53
|
import FormContext from '../../../Contexts/FormContext';
|
|
67
|
-
import {
|
|
54
|
+
import { useAppDispatch, useAppSelector } from '../../../hooks';
|
|
68
55
|
import { focusStep, setEmptyDependency } from '../../../States/SiteSlice';
|
|
69
|
-
import { selectDependencies,
|
|
70
|
-
|
|
56
|
+
import { selectDependencies, useFormStep } from '../../StepHooks';
|
|
57
|
+
import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
|
|
58
|
+
function SmartSelectStep(_a) {
|
|
71
59
|
var _this = this;
|
|
72
60
|
var _b, _c, _d, _e, _f, _g, _h;
|
|
73
|
-
var icon = _a.icon, step = _a.step,
|
|
74
|
-
var _j =
|
|
61
|
+
var icon = _a.icon, step = _a.step, editable = _a.editable, getOptions = _a.getOptions, calcDepError = _a.calcDepError, defaultValue = _a.defaultValue, valueOverwrite = _a.valueOverwrite, getValueString = _a.getValueString, changeListener = _a.changeListener, getValueWarning = _a.getValueWarning, getOptionSelected = _a.getOptionSelected, renderNestedSteps = _a.renderNestedSteps;
|
|
62
|
+
var _j = useFormStep(step, {
|
|
63
|
+
sizeChange: true,
|
|
64
|
+
defaultValue: defaultValue,
|
|
65
|
+
rules: {
|
|
66
|
+
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
67
|
+
},
|
|
68
|
+
}), ref = _j.ref, value = _j.value, error = _j.error, field = _j.field, handleChange = _j.onChange;
|
|
69
|
+
var onChange = useCallback(function (value) {
|
|
70
|
+
return handleChange(valueOverwrite ? valueOverwrite(value) : value);
|
|
71
|
+
}, [handleChange, valueOverwrite]);
|
|
72
|
+
var _k = useAppSelector(function (state) { return state.global; }), postview = _k.postview, formStyle = _k.formStyle, idOrganization = _k.idOrganization;
|
|
75
73
|
var form = useContext(FormContext);
|
|
76
|
-
var
|
|
77
|
-
var
|
|
78
|
-
var
|
|
79
|
-
var
|
|
80
|
-
var _o = useState(false), touched = _o[0], setTouched = _o[1];
|
|
74
|
+
var _l = useState(), options = _l[0], setOptions = _l[1];
|
|
75
|
+
var _m = useState(false), loading = _m[0], setLoading = _m[1];
|
|
76
|
+
var _o = useState(true), firstTime = _o[0], setFirstTime = _o[1];
|
|
77
|
+
var _p = useState(false), touched = _p[0], setTouched = _p[1];
|
|
81
78
|
var dispatch = useAppDispatch();
|
|
82
79
|
var dependencyStore = useAppSelector(function (state) { return state.site.dependencies; });
|
|
83
|
-
var
|
|
80
|
+
var _q = useAppSelector(function (state) {
|
|
84
81
|
return selectDependencies(state, step, form);
|
|
85
|
-
}), emptyDep =
|
|
86
|
-
var
|
|
82
|
+
}), emptyDep = _q.emptyDep, invalids = _q.invalids;
|
|
83
|
+
var _r = useFormContext(), getValues = _r.getValues, setFocus = _r.setFocus;
|
|
87
84
|
var isEmpty = useAppSelector(function (state) { var _a; return (_a = state.site.dependencies[step.id]) === null || _a === void 0 ? void 0 : _a.empty; });
|
|
88
85
|
var disabled = emptyDep;
|
|
89
86
|
useEffect(function () {
|
|
@@ -118,7 +115,7 @@ export function SmartSelect(_a) {
|
|
|
118
115
|
return getValueString(option) === getValueString(value);
|
|
119
116
|
});
|
|
120
117
|
if (!firstTime)
|
|
121
|
-
onChange(newValue);
|
|
118
|
+
onChange(newValue !== null && newValue !== void 0 ? newValue : null);
|
|
122
119
|
}
|
|
123
120
|
else if (!firstTime)
|
|
124
121
|
onChange(null);
|
|
@@ -174,9 +171,6 @@ export function SmartSelect(_a) {
|
|
|
174
171
|
if (!touched)
|
|
175
172
|
setTouched(true);
|
|
176
173
|
}, [options, disabled, postview, editable, invalids, touched]);
|
|
177
|
-
var handleUpdate = useCallback(function (value) {
|
|
178
|
-
valueOverwrite ? onChange(valueOverwrite(value)) : onChange(value);
|
|
179
|
-
}, [valueOverwrite, onChange]);
|
|
180
174
|
var errorMsg = useMemo(function () {
|
|
181
175
|
if (postview || loading)
|
|
182
176
|
return undefined;
|
|
@@ -196,31 +190,6 @@ export function SmartSelect(_a) {
|
|
|
196
190
|
}
|
|
197
191
|
return undefined;
|
|
198
192
|
}, [invalids, touched, value, options]);
|
|
199
|
-
return (_jsxs(React.Fragment, { children: [_jsx(
|
|
200
|
-
width: currentBreakPoint <= step.size
|
|
201
|
-
? '100%'
|
|
202
|
-
: calcStepWidth(step.size, form.size),
|
|
203
|
-
minHeight: step.description ||
|
|
204
|
-
(!postview && editable && step.required)
|
|
205
|
-
? '55px'
|
|
206
|
-
: '43px',
|
|
207
|
-
}, onClick: onFocus, "data-testid": step.id }, { children: _jsx(RoundedSmartSelect, { value: value, onBlur: onBlur, onFocus: onFocus, disabled: options === null || disabled, hidden: disabled, loading: loading, options: options !== null && options !== void 0 ? options : undefined, inputRef: inputRef, cantEdit: !editable || postview, fullWidth: true, backgroundColor: (_d = formStyle.stepBackgroundColor) !== null && _d !== void 0 ? _d : 'white', label: step.label, required: step.required, height: '31px', changeListener: changeListener, searchable: step.searchable, icon: step.showIcon ? icon : undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", handleUpdate: handleUpdate, getOptionSelected: getOptionSelected, getValueString: getValueString, helperText: (_h = (_g = (_e = errorMsg !== null && errorMsg !== void 0 ? errorMsg : warning) !== null && _e !== void 0 ? _e : (_f = error === null || error === void 0 ? void 0 : error.message) === null || _f === void 0 ? void 0 : _f.toString()) !== null && _g !== void 0 ? _g : step.description) !== null && _h !== void 0 ? _h : undefined, error: !!errorMsg || !!warning || !!error }) })), renderNestedSteps === null || renderNestedSteps === void 0 ? void 0 : renderNestedSteps(value)] }));
|
|
208
|
-
}
|
|
209
|
-
function SmartSelectStep(props) {
|
|
210
|
-
var step = props.step, defaultValue = props.defaultValue;
|
|
211
|
-
var _a = useStepDependency(step, defaultValue), handleStepDep = _a.handleStepDep, originalValue = _a.originalValue;
|
|
212
|
-
var _b = useController({
|
|
213
|
-
name: step.id,
|
|
214
|
-
shouldUnregister: true,
|
|
215
|
-
rules: {
|
|
216
|
-
required: step.required ? 'Este campo es obligatorio' : undefined,
|
|
217
|
-
},
|
|
218
|
-
defaultValue: originalValue,
|
|
219
|
-
}), _c = _b.field, ref = _c.ref, field = __rest(_c, ["ref"]), error = _b.fieldState.error;
|
|
220
|
-
var onChange = useCallback(function (value) {
|
|
221
|
-
handleStepDep(value);
|
|
222
|
-
field.onChange(value);
|
|
223
|
-
}, [handleStepDep, field]);
|
|
224
|
-
return (_jsx(SmartSelect, __assign({}, props, field, { error: error, inputRef: ref, onChange: onChange })));
|
|
193
|
+
return (_jsxs(React.Fragment, { children: [_jsx(MaterialInputContainer, __assign({ step: step, onClick: onFocus, editable: editable }, { children: _jsx(RoundedSmartSelect, __assign({}, field, { inputRef: ref, value: value, handleUpdate: onChange, onFocus: onFocus, disabled: options === null || disabled, hidden: disabled, loading: loading, options: options !== null && options !== void 0 ? options : undefined, cantEdit: !editable || postview, fullWidth: true, backgroundColor: (_d = formStyle.stepBackgroundColor) !== null && _d !== void 0 ? _d : 'white', label: step.label, required: step.required, height: '31px', changeListener: changeListener, searchable: step.searchable, icon: step.showIcon ? icon : undefined, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, containerMargin: "0px", getOptionSelected: getOptionSelected, getValueString: getValueString, helperText: (_h = (_g = (_e = errorMsg !== null && errorMsg !== void 0 ? errorMsg : warning) !== null && _e !== void 0 ? _e : (_f = error === null || error === void 0 ? void 0 : error.message) === null || _f === void 0 ? void 0 : _f.toString()) !== null && _g !== void 0 ? _g : step.description) !== null && _h !== void 0 ? _h : undefined, error: !!errorMsg || !!warning || !!error })) })), renderNestedSteps === null || renderNestedSteps === void 0 ? void 0 : renderNestedSteps(value)] }));
|
|
225
194
|
}
|
|
226
195
|
export default SmartSelectStep;
|
package/dist/FormSteps/Step.d.ts
CHANGED
|
@@ -3,8 +3,6 @@ import { FormStep } from '../@Types/FormStep';
|
|
|
3
3
|
export interface StepProps {
|
|
4
4
|
step: FormStep;
|
|
5
5
|
editable: boolean;
|
|
6
|
-
handleSizeChange?: () => void;
|
|
7
|
-
level: number;
|
|
8
6
|
}
|
|
9
7
|
declare function StepComponent({ step, ...props }: StepProps): JSX.Element;
|
|
10
8
|
export default StepComponent;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { FormSize } from '../@Types/Form';
|
|
2
2
|
import { ApiSelector, CheckBox, ClassifierSelector, EntityValuePicker, FormSelector, FormStep } from '../@Types/FormStep';
|
|
3
3
|
import { CBRFormStep } from '../@Types/CBRFormStep';
|
|
4
|
-
export
|
|
4
|
+
export type FillerSteps = FormSelector | ClassifierSelector | EntityValuePicker | ApiSelector | CheckBox;
|
|
5
|
+
export declare function calcFillerSize(step: FillerSteps, steps: Record<string, FormStep>, values: Record<string, unknown>, size: FormSize): number;
|
|
5
6
|
export declare function recursivelyCheckOpenSize(idStep: string, steps: Record<string, FormStep>, values: Record<string, any>): number;
|
|
6
7
|
export declare const calcStepWidth: (stepSize: 1 | 2 | 3 | 4, size: FormSize) => number;
|
|
7
8
|
export declare const calcDefaultValue: (step: FormStep | CBRFormStep) => any;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { ApiSelectorOptionTypes, ClassifierOptionTypes, EntityValueDataTypes, EntityValueOptionTypes, OptionTypes, StepTypes, } from '../constants/FormStepTypes';
|
|
2
2
|
import CBRFormStepTypes from '../constants/CBRFormStepTypes';
|
|
3
3
|
import AYFFormStepTypes from '../constants/AYFFormStepTypes';
|
|
4
4
|
import { getRawText } from '../Utils/DraftFunctions';
|
|
@@ -6,7 +6,8 @@ export function calcFillerSize(step, steps, values, size) {
|
|
|
6
6
|
var _a;
|
|
7
7
|
var maxSize = (_a = step.maxSize) !== null && _a !== void 0 ? _a : size.blockNum;
|
|
8
8
|
if (maxSize < size.blockNum) {
|
|
9
|
-
var
|
|
9
|
+
var tsize = recursivelyCheckOpenSize(step.id, steps, values);
|
|
10
|
+
var stepSize = maxSize - tsize;
|
|
10
11
|
return (size.blockSize * stepSize + size.spacingSize * (stepSize - 1) + 20);
|
|
11
12
|
}
|
|
12
13
|
else {
|
|
@@ -16,79 +17,85 @@ export function calcFillerSize(step, steps, values, size) {
|
|
|
16
17
|
export function recursivelyCheckOpenSize(idStep, steps, values) {
|
|
17
18
|
var step = steps[idStep];
|
|
18
19
|
var value = values[idStep];
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var
|
|
27
|
-
|
|
20
|
+
switch (step.type) {
|
|
21
|
+
case StepTypes.SELECTOR: {
|
|
22
|
+
var size = step.size;
|
|
23
|
+
if (value) {
|
|
24
|
+
var currentOption = step.options.find(function (option) { return option.value === value.value; });
|
|
25
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === OptionTypes.NESTED) {
|
|
26
|
+
var optionSize = 0;
|
|
27
|
+
for (var _i = 0, _a = currentOption.steps; _i < _a.length; _i++) {
|
|
28
|
+
var pStepId = _a[_i];
|
|
29
|
+
var temp = recursivelyCheckOpenSize(pStepId, steps, values);
|
|
30
|
+
optionSize += temp;
|
|
31
|
+
}
|
|
32
|
+
size += optionSize;
|
|
28
33
|
}
|
|
29
|
-
size += optionSize;
|
|
30
34
|
}
|
|
35
|
+
return size;
|
|
31
36
|
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
37
|
+
case StepTypes.CLASSIFIER_SELECTOR: {
|
|
38
|
+
var size = step.size;
|
|
39
|
+
if (value) {
|
|
40
|
+
var currentOption = step.options[value];
|
|
41
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === ClassifierOptionTypes.NESTED) {
|
|
42
|
+
var optionSize = 0;
|
|
43
|
+
for (var _b = 0, _c = currentOption.steps; _b < _c.length; _b++) {
|
|
44
|
+
var pStepId = _c[_b];
|
|
45
|
+
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
46
|
+
}
|
|
47
|
+
size += optionSize;
|
|
43
48
|
}
|
|
44
|
-
size += optionSize;
|
|
45
49
|
}
|
|
50
|
+
return size;
|
|
46
51
|
}
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
52
|
+
case StepTypes.ENTITYVALUEPICKER: {
|
|
53
|
+
var size = step.size;
|
|
54
|
+
if (value) {
|
|
55
|
+
var currentOption = step.options[value];
|
|
56
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === EntityValueOptionTypes.NESTED) {
|
|
57
|
+
var optionSize = 0;
|
|
58
|
+
for (var _d = 0, _e = currentOption.steps; _d < _e.length; _d++) {
|
|
59
|
+
var pStepId = _e[_d];
|
|
60
|
+
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
61
|
+
}
|
|
62
|
+
size += optionSize;
|
|
58
63
|
}
|
|
59
|
-
size += optionSize;
|
|
60
64
|
}
|
|
65
|
+
return size;
|
|
61
66
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
67
|
+
case StepTypes.API_SELECTOR: {
|
|
68
|
+
var size = step.size;
|
|
69
|
+
if (value) {
|
|
70
|
+
var currentOption = step.options[value];
|
|
71
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === ApiSelectorOptionTypes.NESTED) {
|
|
72
|
+
var optionSize = 0;
|
|
73
|
+
for (var _f = 0, _g = currentOption.steps; _f < _g.length; _f++) {
|
|
74
|
+
var pStepId = _g[_f];
|
|
75
|
+
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
76
|
+
}
|
|
77
|
+
size += optionSize;
|
|
73
78
|
}
|
|
74
|
-
size += optionSize;
|
|
75
79
|
}
|
|
80
|
+
return size;
|
|
76
81
|
}
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
82
|
+
case StepTypes.CHECKBOX: {
|
|
83
|
+
var size = step.size;
|
|
84
|
+
var stepSteps = value ? step.steps : step.uncheckedSteps;
|
|
85
|
+
var optionSize = 0;
|
|
86
|
+
for (var _h = 0, _j = stepSteps !== null && stepSteps !== void 0 ? stepSteps : []; _h < _j.length; _h++) {
|
|
87
|
+
var pStepId = _j[_h];
|
|
88
|
+
optionSize += recursivelyCheckOpenSize(pStepId, steps, values);
|
|
89
|
+
}
|
|
90
|
+
size += optionSize;
|
|
91
|
+
return size;
|
|
86
92
|
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
93
|
+
case StepTypes.DATEPICKER:
|
|
94
|
+
case StepTypes.TEXTINPUT: {
|
|
95
|
+
return step.size;
|
|
96
|
+
}
|
|
97
|
+
default:
|
|
98
|
+
return 4;
|
|
92
99
|
}
|
|
93
100
|
}
|
|
94
101
|
export var calcStepWidth = function (stepSize, size) {
|
|
@@ -120,6 +127,7 @@ export var calcDefaultValue = function (step) {
|
|
|
120
127
|
return null;
|
|
121
128
|
case StepTypes.MAPPER:
|
|
122
129
|
case StepTypes.FILEUPLOAD:
|
|
130
|
+
case CBRFormStepTypes.CBR_INCIDENCIAS:
|
|
123
131
|
return [];
|
|
124
132
|
case StepTypes.COLLAPSIBLE:
|
|
125
133
|
return false;
|
|
@@ -131,7 +139,7 @@ export var calcDefaultValue = function (step) {
|
|
|
131
139
|
export var iterateNestedSteps = function (idStep, steps, iteration) {
|
|
132
140
|
var step = steps[idStep];
|
|
133
141
|
iteration(step);
|
|
134
|
-
if (step.type
|
|
142
|
+
if (step.type === StepTypes.MAPPER) {
|
|
135
143
|
for (var _i = 0, _a = step.rootSteps; _i < _a.length; _i++) {
|
|
136
144
|
var idStep_1 = _a[_i];
|
|
137
145
|
iterateNestedSteps(idStep_1, step.steps, iteration);
|
|
@@ -3,6 +3,7 @@ import { ValuesStore } from '../States/SiteSlice';
|
|
|
3
3
|
import { RootState } from '../Utils/store';
|
|
4
4
|
import { Form } from '../@Types';
|
|
5
5
|
import { DependencyStore } from '../Form/Form';
|
|
6
|
+
import { FieldError, RefCallBack, UseControllerProps, useController } from 'react-hook-form';
|
|
6
7
|
export declare const selectOriginalValue: ((state: RootState, step: GBaseStep) => any) & import("reselect").OutputSelectorFields<(args_0: ValuesStore, args_1: GBaseStep) => any, {
|
|
7
8
|
clearCache: () => void;
|
|
8
9
|
}> & {
|
|
@@ -25,3 +26,18 @@ export declare const selectDependencies: ((state: RootState, step: GBaseStep, fo
|
|
|
25
26
|
}> & {
|
|
26
27
|
clearCache: () => void;
|
|
27
28
|
};
|
|
29
|
+
export interface UseFormStepOptions<ValueType> {
|
|
30
|
+
defaultValue?: ValueType;
|
|
31
|
+
/** If true, will not trigger onChange until the user has finished typing */
|
|
32
|
+
debounce?: boolean;
|
|
33
|
+
rules?: UseControllerProps['rules'];
|
|
34
|
+
/** If the step should trigger a filler(root StepFiller) size change */
|
|
35
|
+
sizeChange?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export declare const useFormStep: <ValueType = unknown>(step: GBaseStep, { rules, debounce, sizeChange, defaultValue, }?: UseFormStepOptions<ValueType>) => {
|
|
38
|
+
value: ValueType;
|
|
39
|
+
ref: RefCallBack;
|
|
40
|
+
onChange: (value: ValueType) => void;
|
|
41
|
+
error: FieldError | undefined;
|
|
42
|
+
field: Omit<ReturnType<typeof useController>['field'], 'ref' | 'value' | 'onChange'>;
|
|
43
|
+
};
|