@arquimedes.co/eureka-forms 1.8.6-test → 1.9.0-test
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/FormComponents/Form/ColumnForm/ColumnForm.js +13 -0
- package/dist/FormComponents/Step/@Construction/CBRLocativasStep/CBRLocativasStep.js +2 -2
- package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +1 -1
- package/dist/FormComponents/Step/CBRStepMapper.js +4 -4
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +1 -1
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +1 -1
- package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +7 -4
- package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.d.ts +2 -0
- package/dist/shared/RoundedSelect/RoundedSelect.js +1 -1
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +3 -1
- package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +7 -3
- package/package.json +1 -1
|
@@ -194,6 +194,13 @@ var mapOriginalValues = function (originalValues, form) {
|
|
|
194
194
|
}
|
|
195
195
|
break;
|
|
196
196
|
}
|
|
197
|
+
case Types.SELECTOR:
|
|
198
|
+
case Types.CLASSIFIER_SELECTOR: {
|
|
199
|
+
var value = originalValues[step.id];
|
|
200
|
+
if (!(value === null || value === void 0 ? void 0 : value.value))
|
|
201
|
+
newValues[step.id] = { value: value };
|
|
202
|
+
break;
|
|
203
|
+
}
|
|
197
204
|
default:
|
|
198
205
|
break;
|
|
199
206
|
}
|
|
@@ -235,6 +242,12 @@ var updateValue = function (idStep, values, form, customSteps) {
|
|
|
235
242
|
}); });
|
|
236
243
|
break;
|
|
237
244
|
}
|
|
245
|
+
case Types.SELECTOR:
|
|
246
|
+
case Types.CLASSIFIER_SELECTOR: {
|
|
247
|
+
var value = values[step.id];
|
|
248
|
+
values[step.id] = value.value;
|
|
249
|
+
break;
|
|
250
|
+
}
|
|
238
251
|
default:
|
|
239
252
|
if ((step === null || step === void 0 ? void 0 : step.type) === 'CBR_INCIDENCIAS') {
|
|
240
253
|
values[step.id] = (_a = values[step.id]) === null || _a === void 0 ? void 0 : _a.filter(function (inmueble) { return inmueble.deleted !== true; });
|
|
@@ -57,7 +57,7 @@ function CBRLocativasStep(props) {
|
|
|
57
57
|
marginTop: 2,
|
|
58
58
|
} }, void 0), getOptions: getLocativasOptions, getOptionSelected: function (option, value) {
|
|
59
59
|
return option.id === value.id;
|
|
60
|
-
}, calcDepError: calcDepError, calcInvalidDeps: calcInvalidDependencies, valueOverwrite: function (value) {
|
|
60
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }, calcDepError: calcDepError, calcInvalidDeps: calcInvalidDependencies, valueOverwrite: function (value) {
|
|
61
61
|
if (value) {
|
|
62
62
|
return __assign(__assign({}, value), { subStep: props.step.subStep });
|
|
63
63
|
}
|
|
@@ -84,7 +84,7 @@ function LocativasSubStepRenderer(_a) {
|
|
|
84
84
|
marginTop: 2,
|
|
85
85
|
} }, void 0), calcInvalidDeps: calcInvalidDependencies, getOptions: getLocativasOptions, calcDepError: calcDepError, getOptionSelected: function (option, value) {
|
|
86
86
|
return option.id === value.id;
|
|
87
|
-
}, iconComponent: LeakIconComponent }, { children: _jsx(LocativasSubStepRenderer, {}, void 0) }), void 0));
|
|
87
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }, iconComponent: LeakIconComponent }, { children: _jsx(LocativasSubStepRenderer, {}, void 0) }), void 0));
|
|
88
88
|
}
|
|
89
89
|
function LeakIconComponent(props) {
|
|
90
90
|
return (_jsx(Leak, { className: props.className, fill: "#757575", style: {
|
|
@@ -89,7 +89,7 @@ function CBRPropertyStepComponent(props) {
|
|
|
89
89
|
width: 23,
|
|
90
90
|
} }, void 0), getOptionSelected: function (option, value) {
|
|
91
91
|
return option.id === value.id;
|
|
92
|
-
}, getValueWarning: props.step.validation
|
|
92
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }, getValueWarning: props.step.validation
|
|
93
93
|
? function (value) {
|
|
94
94
|
if (value &&
|
|
95
95
|
value.entrega !== undefined &&
|
|
@@ -156,7 +156,7 @@ function CBRStepMapper(props) {
|
|
|
156
156
|
case CBRFormStepTypes.CBR_TIPO_DOC:
|
|
157
157
|
return (_jsx(SmartSelectStep, __assign({}, props, { step: __assign(__assign({}, props.step), { showIcon: false }), getOptions: getTipoDocOptions, getOptionSelected: function (option, value) {
|
|
158
158
|
return option.id === value.id;
|
|
159
|
-
} }), void 0));
|
|
159
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }), void 0));
|
|
160
160
|
case CBRFormStepTypes.CBR_PROYECTO:
|
|
161
161
|
return (_jsx(SmartSelectStep, __assign({}, props, { step: props.step, icon: _jsx(ProjectIcon, { fill: "#757575", style: {
|
|
162
162
|
display: 'flex',
|
|
@@ -164,7 +164,7 @@ function CBRStepMapper(props) {
|
|
|
164
164
|
width: 24,
|
|
165
165
|
} }, void 0), iconComponent: ProjectIconComponent, getOptions: getProyectoOptions, getOptionSelected: function (option, value) {
|
|
166
166
|
return option.id === value.id;
|
|
167
|
-
} }), void 0));
|
|
167
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }), void 0));
|
|
168
168
|
case CBRFormStepTypes.CBR_INMUEBLE:
|
|
169
169
|
return _jsx(CBRPropertyStep, __assign({}, props, { step: props.step }), void 0);
|
|
170
170
|
case CBRFormStepTypes.CBR_TIPO_SOLICITANTE:
|
|
@@ -174,7 +174,7 @@ function CBRStepMapper(props) {
|
|
|
174
174
|
width: 23,
|
|
175
175
|
} }, void 0), iconComponent: PersonRoundedIcon, getOptions: getTipoSolicitanteOptions, getOptionSelected: function (option, value) {
|
|
176
176
|
return option.id === value.id;
|
|
177
|
-
} }), void 0));
|
|
177
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }), void 0));
|
|
178
178
|
case CBRFormStepTypes.CBR_TIPO_ESPACIO:
|
|
179
179
|
return (_jsx(SmartSelectStep, __assign({}, props, { step: props.step, icon: _jsx(SpaceTypeIcon, { fill: "#757575", style: {
|
|
180
180
|
display: 'flex',
|
|
@@ -190,7 +190,7 @@ function CBRStepMapper(props) {
|
|
|
190
190
|
return undefined;
|
|
191
191
|
}, getOptionSelected: function (option, value) {
|
|
192
192
|
return option.id === value.id;
|
|
193
|
-
} }), void 0));
|
|
193
|
+
}, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }), void 0));
|
|
194
194
|
case CBRFormStepTypes.CBR_LOCATIVAS:
|
|
195
195
|
return _jsx(CBRLocativasStep, __assign({}, props, { step: props.step }), void 0);
|
|
196
196
|
case CBRFormStepTypes.CBR_COMENTARIO:
|
|
@@ -81,7 +81,7 @@ function ClassifierSelector(_a) {
|
|
|
81
81
|
};
|
|
82
82
|
var mapNestedOption = function () {
|
|
83
83
|
if (value) {
|
|
84
|
-
var currentOption = step.options[
|
|
84
|
+
var currentOption = step.options[value.value];
|
|
85
85
|
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === ClassifierOptionTypes.NESTED) {
|
|
86
86
|
return (_jsx(React.Fragment, { children: currentOption.steps.map(function (idStep, index) {
|
|
87
87
|
var subStep = form.steps[idStep];
|
|
@@ -60,7 +60,7 @@ function Selector(_a) {
|
|
|
60
60
|
var currentOption = null;
|
|
61
61
|
for (var i = 0; i < step.options.length; i++) {
|
|
62
62
|
var option = step.options[i];
|
|
63
|
-
if (option.value ===
|
|
63
|
+
if (option.value === value.value) {
|
|
64
64
|
currentOptionIndex = i;
|
|
65
65
|
currentOption = option;
|
|
66
66
|
}
|
package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js
CHANGED
|
@@ -66,7 +66,7 @@ import React from 'react';
|
|
|
66
66
|
function SmartSelect(_a) {
|
|
67
67
|
var _this = this;
|
|
68
68
|
var _b, _c, _d, _e;
|
|
69
|
-
var icon = _a.icon, step = _a.step, form = _a.form, value = _a.value, onBlur = _a.onBlur, errors = _a.errors, trigger = _a.trigger, children = _a.children, editable = _a.editable, onChange = _a.onChange, inputRef = _a.inputRef, postview = _a.postview, formStyle = _a.formStyle, getOptions = _a.getOptions, widthStats = _a.widthStats, organization = _a.organization, calcDepError = _a.calcDepError, iconComponent = _a.iconComponent, valueOverwrite = _a.valueOverwrite, dependencyStore = _a.dependencyStore, _f = _a.calcInvalidDeps, calcInvalidDeps = _f === void 0 ? function (step, depStore) {
|
|
69
|
+
var icon = _a.icon, step = _a.step, form = _a.form, value = _a.value, onBlur = _a.onBlur, errors = _a.errors, trigger = _a.trigger, children = _a.children, editable = _a.editable, onChange = _a.onChange, inputRef = _a.inputRef, postview = _a.postview, formStyle = _a.formStyle, getOptions = _a.getOptions, widthStats = _a.widthStats, organization = _a.organization, calcDepError = _a.calcDepError, iconComponent = _a.iconComponent, valueOverwrite = _a.valueOverwrite, getValueString = _a.getValueString, dependencyStore = _a.dependencyStore, _f = _a.calcInvalidDeps, calcInvalidDeps = _f === void 0 ? function (step, depStore) {
|
|
70
70
|
var _a;
|
|
71
71
|
var missingDeps = [];
|
|
72
72
|
for (var _i = 0, _b = (_a = step.dependencies) !== null && _a !== void 0 ? _a : []; _i < _b.length; _i++) {
|
|
@@ -76,7 +76,7 @@ function SmartSelect(_a) {
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
return missingDeps;
|
|
79
|
-
} : _f, getValueWarning = _a.getValueWarning, getOptionSelected = _a.getOptionSelected, setDependencyStore = _a.setDependencyStore, others = __rest(_a, ["icon", "step", "form", "value", "onBlur", "errors", "trigger", "children", "editable", "onChange", "inputRef", "postview", "formStyle", "getOptions", "widthStats", "organization", "calcDepError", "iconComponent", "valueOverwrite", "dependencyStore", "calcInvalidDeps", "getValueWarning", "getOptionSelected", "setDependencyStore"]);
|
|
79
|
+
} : _f, getValueWarning = _a.getValueWarning, getOptionSelected = _a.getOptionSelected, setDependencyStore = _a.setDependencyStore, others = __rest(_a, ["icon", "step", "form", "value", "onBlur", "errors", "trigger", "children", "editable", "onChange", "inputRef", "postview", "formStyle", "getOptions", "widthStats", "organization", "calcDepError", "iconComponent", "valueOverwrite", "getValueString", "dependencyStore", "calcInvalidDeps", "getValueWarning", "getOptionSelected", "setDependencyStore"]);
|
|
80
80
|
var _g = useState(true), first = _g[0], setFirst = _g[1];
|
|
81
81
|
var _h = useState(), options = _h[0], setOptions = _h[1];
|
|
82
82
|
var _j = useState(), error = _j[0], setError = _j[1];
|
|
@@ -120,8 +120,11 @@ function SmartSelect(_a) {
|
|
|
120
120
|
calcOptions(value, invalids);
|
|
121
121
|
}
|
|
122
122
|
else {
|
|
123
|
-
if (value)
|
|
123
|
+
if (value) {
|
|
124
|
+
setLoading(true);
|
|
125
|
+
setOptions([]);
|
|
124
126
|
onChange(null);
|
|
127
|
+
}
|
|
125
128
|
calcOptions(null);
|
|
126
129
|
}
|
|
127
130
|
}
|
|
@@ -166,7 +169,7 @@ function SmartSelect(_a) {
|
|
|
166
169
|
? onChange(valueOverwrite(value))
|
|
167
170
|
: onChange(value);
|
|
168
171
|
setError(undefined);
|
|
169
|
-
}, getOptionSelected: getOptionSelected, helperText: (_e = error !== null && error !== void 0 ? error : warning) !== null && _e !== void 0 ? _e : (errors[step.id]
|
|
172
|
+
}, getOptionSelected: getOptionSelected, getValueString: getValueString, helperText: (_e = error !== null && error !== void 0 ? error : warning) !== null && _e !== void 0 ? _e : (errors[step.id]
|
|
170
173
|
? errors[step.id].message
|
|
171
174
|
: step.description), error: error !== undefined ||
|
|
172
175
|
(warning !== undefined && warning !== null) ||
|
|
@@ -13,6 +13,8 @@ export interface SmartSelectStepProps extends Omit<StepProps, 'step'> {
|
|
|
13
13
|
getOptions: (idOrganization: string, step: GSmartSelect, dependencyStore: Record<string, any>) => Promise<any[] | null>;
|
|
14
14
|
/** Function to determine the currently selected option */
|
|
15
15
|
getOptionSelected: (option: any, value: any) => boolean;
|
|
16
|
+
/** Function to determine the current value in string format */
|
|
17
|
+
getValueString: (value: any) => string;
|
|
16
18
|
/** Function to if currently selected option has warning */
|
|
17
19
|
getValueWarning?: (value: any) => string | null;
|
|
18
20
|
/** Function that returns the error message based on the types of the missing Dependencies, undefined if no error msg */
|
|
@@ -135,7 +135,7 @@ var useHelperTextStyles = function (props) {
|
|
|
135
135
|
}); });
|
|
136
136
|
};
|
|
137
137
|
function CustomSelect(_a) {
|
|
138
|
-
var children = _a.children,
|
|
138
|
+
var children = _a.children, _b = _a.value, value = _b === void 0 ? '' : _b, handleUpdate = _a.handleUpdate, label = _a.label, minWidth = _a.minWidth, helperText = _a.helperText, _c = _a.color, color = _c === void 0 ? '#293241' : _c, _d = _a.errorColor, errorColor = _d === void 0 ? '#cc2936' : _d, _e = _a.focusColor, focusColor = _e === void 0 ? '#3d5a7f' : _e, _f = _a.fontSize, fontSize = _f === void 0 ? '1rem' : _f, _g = _a.outlineColor, outlineColor = _g === void 0 ? '#0000003b' : _g, _h = _a.helperTextColor, helperTextColor = _h === void 0 ? '#989898' : _h, _j = _a.backgroundColor, backgroundColor = _j === void 0 ? '#ffffff' : _j, _k = _a.readOnly, readOnly = _k === void 0 ? false : _k, _l = _a.borderRadius, borderRadius = _l === void 0 ? 10 : _l, innerBackgroundColor = _a.innerBackgroundColor, _m = _a.cantEdit, cantEdit = _m === void 0 ? false : _m, _o = _a.showIcon, showIcon = _o === void 0 ? true : _o, _p = _a.containerMargin, containerMargin = _p === void 0 ? '8px' : _p, _q = _a.height, height = _q === void 0 ? '40px' : _q, required = _a.required, iconComponent = _a.iconComponent, error = _a.error, others = __rest(_a, ["children", "value", "handleUpdate", "label", "minWidth", "helperText", "color", "errorColor", "focusColor", "fontSize", "outlineColor", "helperTextColor", "backgroundColor", "readOnly", "borderRadius", "innerBackgroundColor", "cantEdit", "showIcon", "containerMargin", "height", "required", "iconComponent", "error"]);
|
|
139
139
|
var props = {
|
|
140
140
|
color: color,
|
|
141
141
|
height: height,
|
|
@@ -58,6 +58,8 @@ export interface RoundedSmartSelectProps extends Omit<TextFieldProps, 'color'>,
|
|
|
58
58
|
searchable?: boolean;
|
|
59
59
|
/** Function to determine the currently selected option */
|
|
60
60
|
getOptionSelected?: (option: any, value: any) => boolean;
|
|
61
|
+
/** Function to determine the current value in string format */
|
|
62
|
+
getValueString?: (value: any) => string;
|
|
61
63
|
}
|
|
62
|
-
export default function RoundedSmartSelect({ options, value, handleUpdate, label, color, errorColor, focusColor, helperTextColor, outlineColor, backgroundColor, cantEdit, loading, height, fontSize, required, error, innerBackgroundColor, getOptionSelected, helperText, readOnly, borderRadius, fontWeight, icon, iconComponent, searchable, containerMargin, showIcon, inputRef, disabled, onBlur, name, }: RoundedSmartSelectProps): JSX.Element;
|
|
64
|
+
export default function RoundedSmartSelect({ options, value, handleUpdate, label, getValueString, color, errorColor, focusColor, helperTextColor, outlineColor, backgroundColor, cantEdit, loading, height, fontSize, required, error, innerBackgroundColor, getOptionSelected, helperText, readOnly, borderRadius, fontWeight, icon, iconComponent, searchable, containerMargin, showIcon, inputRef, disabled, onBlur, name, }: RoundedSmartSelectProps): JSX.Element;
|
|
63
65
|
export {};
|
|
@@ -124,7 +124,7 @@ var useTextfieldStyles = function (props) {
|
|
|
124
124
|
}); });
|
|
125
125
|
};
|
|
126
126
|
export default function RoundedSmartSelect(_a) {
|
|
127
|
-
var _b = _a.options, options = _b === void 0 ? [] : _b,
|
|
127
|
+
var _b = _a.options, options = _b === void 0 ? [] : _b, _c = _a.value, value = _c === void 0 ? '' : _c, handleUpdate = _a.handleUpdate, label = _a.label, _d = _a.getValueString, getValueString = _d === void 0 ? function (value) { return value.value; } : _d, _e = _a.color, color = _e === void 0 ? '#293241' : _e, _f = _a.errorColor, errorColor = _f === void 0 ? '#cc2936' : _f, _g = _a.focusColor, focusColor = _g === void 0 ? '#3d5a7f' : _g, _h = _a.helperTextColor, helperTextColor = _h === void 0 ? '#989898' : _h, _j = _a.outlineColor, outlineColor = _j === void 0 ? '#b8b8b8' : _j, _k = _a.backgroundColor, backgroundColor = _k === void 0 ? '#ffffff' : _k, _l = _a.cantEdit, cantEdit = _l === void 0 ? false : _l, _m = _a.loading, loading = _m === void 0 ? false : _m, _o = _a.height, height = _o === void 0 ? '31px' : _o, _p = _a.fontSize, fontSize = _p === void 0 ? '1rem' : _p, required = _a.required, error = _a.error, innerBackgroundColor = _a.innerBackgroundColor, getOptionSelected = _a.getOptionSelected, helperText = _a.helperText, _q = _a.readOnly, readOnly = _q === void 0 ? false : _q, _r = _a.borderRadius, borderRadius = _r === void 0 ? 10 : _r, _s = _a.fontWeight, fontWeight = _s === void 0 ? '400' : _s, icon = _a.icon, iconComponent = _a.iconComponent, _t = _a.searchable, searchable = _t === void 0 ? false : _t, _u = _a.containerMargin, containerMargin = _u === void 0 ? '0px' : _u, _v = _a.showIcon, showIcon = _v === void 0 ? true : _v, inputRef = _a.inputRef, disabled = _a.disabled, onBlur = _a.onBlur, name = _a.name;
|
|
128
128
|
var props = {
|
|
129
129
|
color: color,
|
|
130
130
|
height: height,
|
|
@@ -171,8 +171,12 @@ export default function RoundedSmartSelect(_a) {
|
|
|
171
171
|
}, renderOption: function (option) { return option.label; }, renderInput: function (params) { return (_jsx(TextField, __assign({ classes: textFieldClasses }, params, { inputRef: inputRef, onBlur: onBlur, name: name, variant: "outlined", label: label, required: required, error: error, helperText: helperText }), void 0)); }, style: { pointerEvents: 'none' }, noOptionsText: "No hay opciones" }, void 0));
|
|
172
172
|
}
|
|
173
173
|
else {
|
|
174
|
-
return (_jsxs(RoundedSelect, __assign({ onBlur: onBlur, inputRef: inputRef, name: name, fullWidth: true, handleUpdate:
|
|
174
|
+
return (_jsxs(RoundedSelect, __assign({ onBlur: onBlur, inputRef: inputRef, name: name, fullWidth: true, handleUpdate: function (event) {
|
|
175
|
+
handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(options.find(function (option) {
|
|
176
|
+
return getValueString(option) == event.target.value;
|
|
177
|
+
}));
|
|
178
|
+
}, onOpen: function () {
|
|
175
179
|
//Show loading icon if loading
|
|
176
|
-
}, value: value, color: color, errorColor: errorColor, focusColor: focusColor, helperTextColor: helperTextColor, innerBackgroundColor: innerBackgroundColor, outlineColor: outlineColor, cantEdit: cantEdit, label: label, required: required, readOnly: readOnly, helperText: helperText, containerMargin: containerMargin, height: height, error: error, iconComponent: iconComponent, showIcon: showIcon }, { children: [_jsx(MenuItem, __assign({ value: '', style: { whiteSpace: 'normal' } }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), options.map(function (option) { return (_jsx(MenuItem, __assign({ value: option
|
|
180
|
+
}, value: getValueString(value), color: color, errorColor: errorColor, focusColor: focusColor, helperTextColor: helperTextColor, innerBackgroundColor: innerBackgroundColor, outlineColor: outlineColor, cantEdit: cantEdit, label: label, required: required, readOnly: readOnly, helperText: helperText, containerMargin: containerMargin, height: height, error: error, iconComponent: iconComponent, showIcon: showIcon }, { children: [_jsx(MenuItem, __assign({ value: '', style: { whiteSpace: 'normal' } }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), options.map(function (option) { return (_jsx(MenuItem, __assign({ value: getValueString(option), style: { whiteSpace: 'normal' } }, { children: option.label }), getValueString(option))); })] }), void 0));
|
|
177
181
|
}
|
|
178
182
|
}
|
package/package.json
CHANGED