@arquimedes.co/eureka-forms 1.9.56-test → 1.9.57-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/@Types/FormStep.d.ts +1 -0
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +1 -1
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +33 -21
- package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/MaterialMapperStep.js +10 -0
- package/package.json +1 -1
package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { CheckBoxStepProps } from '../CheckBoxStep';
|
|
3
|
-
declare function CheckBoxStep(
|
|
3
|
+
declare function CheckBoxStep(props: CheckBoxStepProps): JSX.Element;
|
|
4
4
|
export default CheckBoxStep;
|
|
@@ -20,31 +20,43 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
20
20
|
}
|
|
21
21
|
return t;
|
|
22
22
|
};
|
|
23
|
+
import { createElement as _createElement } from "react";
|
|
23
24
|
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
24
25
|
import styles from './MaterialCheckBoxStep.module.css';
|
|
25
26
|
import { calcStepWidth } from '../../StepFunctions';
|
|
26
27
|
import RoundedCheckBox from '../../../../shared/RoundedCheckBox/RoundedCheckBox';
|
|
27
28
|
import { Controller } from 'react-hook-form';
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
29
|
+
import React from 'react';
|
|
30
|
+
import StepComponent from '../../Step';
|
|
31
|
+
function CheckBox(_a) {
|
|
32
|
+
var step = _a.step, form = _a.form, value = _a.value, onBlur = _a.onBlur, errors = _a.errors, onChange = _a.onChange, inputRef = _a.inputRef, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, widthStats = _a.widthStats, others = __rest(_a, ["step", "form", "value", "onBlur", "errors", "onChange", "inputRef", "editable", "postview", "formStyle", "widthStats"]);
|
|
33
|
+
return (_jsxs(React.Fragment, { children: [_jsxs("div", __assign({ className: styles.container, style: {
|
|
34
|
+
width: widthStats.currentBreakPoint <= step.size
|
|
35
|
+
? '100%'
|
|
36
|
+
: calcStepWidth(step.size, form.size),
|
|
37
|
+
minHeight: step.description || step.required ? '55px' : '43px',
|
|
38
|
+
} }, { children: [_jsxs("div", __assign({ className: styles.labelCheckBoxContainer }, { children: [step.label && (_jsxs("div", __assign({ className: styles.checkboxLbl }, { children: [step.label, step.required ? ' *' : '', ":"] }))), _jsx(RoundedCheckBox, { onChange: onChange, onBlur: onBlur, "data-testid": step.id, inputRef: inputRef, padding: "0px", size: "1.6rem", error: !!errors[step.id], cantEdit: !editable || postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: value })] })), (step.description || !!errors[step.id]) && (_jsx("div", __assign({ className: styles.descriptionPar, style: {
|
|
39
|
+
color: !!errors[step.id]
|
|
40
|
+
? formStyle.errorColor
|
|
41
|
+
: formStyle.descriptionTextColor,
|
|
42
|
+
} }, { children: !!errors[step.id]
|
|
43
|
+
? 'Este campo es obligatorio'
|
|
44
|
+
: step.description })))] })), value &&
|
|
45
|
+
step.steps &&
|
|
46
|
+
step.steps.map(function (idSubStep) {
|
|
47
|
+
var subStep = form.steps[idSubStep];
|
|
48
|
+
return (_createElement(StepComponent, __assign({}, others, { editable: editable, postview: postview, errors: errors, formStyle: formStyle, form: form, widthStats: widthStats, step: subStep, key: idSubStep, handleSizeChange: function () { } })));
|
|
49
|
+
})] }));
|
|
50
|
+
}
|
|
51
|
+
function CheckBoxStep(props) {
|
|
52
|
+
var _a;
|
|
53
|
+
return (_jsx(Controller, { name: props.step.id, control: props.control, defaultValue: (_a = props.originalValues[props.step.id]) !== null && _a !== void 0 ? _a : false, rules: {
|
|
54
|
+
required: props.step.required
|
|
55
|
+
? 'Este campo es obligatorio'
|
|
56
|
+
: undefined,
|
|
57
|
+
}, shouldUnregister: true, render: function (_a) {
|
|
58
|
+
var _b = _a.field, ref = _b.ref, field = __rest(_b, ["ref"]);
|
|
59
|
+
return (_jsx(CheckBox, __assign({}, props, field, { inputRef: ref })));
|
|
60
|
+
} }));
|
|
49
61
|
}
|
|
50
62
|
export default CheckBoxStep;
|
|
@@ -195,6 +195,16 @@ function calcRecursiveData(element, newSteps, deps, originalValues) {
|
|
|
195
195
|
}
|
|
196
196
|
break;
|
|
197
197
|
}
|
|
198
|
+
case StepTypes.CHECKBOX: {
|
|
199
|
+
if (step.steps) {
|
|
200
|
+
for (var i = 0; i < step.steps.length; i++) {
|
|
201
|
+
var idStep_5 = step.steps[i];
|
|
202
|
+
var newId = element.ids[idStep_5];
|
|
203
|
+
step.steps[i] = newId;
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
break;
|
|
207
|
+
}
|
|
198
208
|
case StepTypes.ENTITYVALUEPICKER:
|
|
199
209
|
for (var _h = 0, _j = step.filters; _h < _j.length; _h++) {
|
|
200
210
|
var filter = _j[_h];
|
package/package.json
CHANGED