@arquimedes.co/eureka-forms 2.0.45 → 2.0.47
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/GenericFormSteps.d.ts +1 -0
- package/dist/Form/Form.js +2 -2
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +11 -1
- package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css +4 -2
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +2 -1
- package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +7 -4
- package/package.json +1 -1
package/dist/Form/Form.js
CHANGED
|
@@ -107,7 +107,7 @@ function FormComponent(_a) {
|
|
|
107
107
|
switch (_c.label) {
|
|
108
108
|
case 0:
|
|
109
109
|
token = null;
|
|
110
|
-
if (!(form.hasCaptcha && !
|
|
110
|
+
if (!(form.hasCaptcha && !customSubmit)) return [3 /*break*/, 2];
|
|
111
111
|
token = recaptchaRef.current.getValue();
|
|
112
112
|
if (!!token) return [3 /*break*/, 2];
|
|
113
113
|
return [4 /*yield*/, (recaptchaRef === null || recaptchaRef === void 0 ? void 0 : recaptchaRef.current.executeAsync())];
|
|
@@ -115,7 +115,7 @@ function FormComponent(_a) {
|
|
|
115
115
|
token = _c.sent();
|
|
116
116
|
_c.label = 2;
|
|
117
117
|
case 2:
|
|
118
|
-
if (!apiKey && !
|
|
118
|
+
if (!apiKey && !customSubmit)
|
|
119
119
|
return [2 /*return*/];
|
|
120
120
|
_c.label = 3;
|
|
121
121
|
case 3:
|
|
@@ -19,6 +19,7 @@ import { useAppSelector } from '../../../hooks';
|
|
|
19
19
|
import { useFormStep } from '../../StepHooks';
|
|
20
20
|
import StepFillerContainer from '../../Utils/@StepFiller/StepFiller';
|
|
21
21
|
import MaterialInputContainer from '../../Utils/MaterialInputContainer/MaterialInputContainer';
|
|
22
|
+
import { calcStepWidth } from '../../StepFunctions';
|
|
22
23
|
function CheckBoxStep(_a) {
|
|
23
24
|
var _b;
|
|
24
25
|
var step = _a.step, editable = _a.editable;
|
|
@@ -38,7 +39,16 @@ function CheckBoxStep(_a) {
|
|
|
38
39
|
return (_jsx(StepComponent, { editable: editable, step: subStep }, idStep));
|
|
39
40
|
}) }));
|
|
40
41
|
};
|
|
41
|
-
|
|
42
|
+
var renderLabel = function (colon) {
|
|
43
|
+
if (colon === void 0) { colon = false; }
|
|
44
|
+
return (_jsxs("div", __assign({ className: step.size === 4 ? styles.checkboxLbl : styles.overflowLbl, style: {
|
|
45
|
+
maxWidth: calcStepWidth(step.size, form.size) - 45,
|
|
46
|
+
} }, { children: [step.label, step.required ? ' *' : '', colon ? ':' : ''] })));
|
|
47
|
+
};
|
|
48
|
+
return (_jsxs(StepFillerContainer, __assign({ step: step }, { children: [_jsx(MaterialInputContainer, __assign({ step: step, editable: editable, maxHeight: step.size < 4 }, { children: _jsxs("div", __assign({ className: styles.container }, { children: [_jsxs("div", __assign({ className: styles.labelCheckBoxContainer, style: {
|
|
49
|
+
height: step.size < 4 ? 31 : undefined,
|
|
50
|
+
alignItems: step.isList ? 'start' : 'center',
|
|
51
|
+
} }, { children: [step.label && !step.isList && renderLabel(true), _jsx(RoundedCheckBox, __assign({}, field, { inputRef: ref, onChange: onChange, "data-testid": step.id, padding: "0px", size: "1.6rem", error: !!error, cantEdit: !editable || postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: value })), step.label && step.isList && renderLabel()] })), (step.description || !!error) && (_jsx("div", __assign({ className: styles.descriptionPar, style: {
|
|
42
52
|
color: error
|
|
43
53
|
? formStyle.errorColor
|
|
44
54
|
: formStyle.descriptionTextColor,
|
|
@@ -2,10 +2,13 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
}
|
|
5
|
-
.checkboxLbl
|
|
5
|
+
.checkboxLbl,
|
|
6
|
+
.overflowLbl {
|
|
6
7
|
font-size: 18px;
|
|
7
8
|
margin-right: 10px;
|
|
8
9
|
margin-left: 10px;
|
|
10
|
+
}
|
|
11
|
+
.overflowLbl {
|
|
9
12
|
white-space: nowrap;
|
|
10
13
|
overflow: hidden;
|
|
11
14
|
text-overflow: ellipsis;
|
|
@@ -15,7 +18,6 @@
|
|
|
15
18
|
align-items: center;
|
|
16
19
|
flex-direction: row;
|
|
17
20
|
align-items: center;
|
|
18
|
-
height: 31px;
|
|
19
21
|
}
|
|
20
22
|
|
|
21
23
|
.descriptionPar {
|
|
@@ -6,6 +6,7 @@ interface MaterialInputProps {
|
|
|
6
6
|
editable: boolean;
|
|
7
7
|
onClick?: () => void;
|
|
8
8
|
children: React.ReactNode;
|
|
9
|
+
maxHeight?: boolean;
|
|
9
10
|
}
|
|
10
|
-
declare function MaterialInputContainer({ step, editable, children, onClick, }: MaterialInputProps): JSX.Element;
|
|
11
|
+
declare function MaterialInputContainer({ step, editable, children, onClick, maxHeight, }: MaterialInputProps): JSX.Element;
|
|
11
12
|
export default MaterialInputContainer;
|
|
@@ -16,7 +16,7 @@ import { useAppSelector, selectBreakPoint } from '../../../hooks';
|
|
|
16
16
|
import { calcStepWidth } from '../../StepFunctions';
|
|
17
17
|
import styles from './MaterialInputContainer.module.css';
|
|
18
18
|
function MaterialInputContainer(_a) {
|
|
19
|
-
var step = _a.step, editable = _a.editable, children = _a.children, onClick = _a.onClick;
|
|
19
|
+
var step = _a.step, editable = _a.editable, children = _a.children, onClick = _a.onClick, _b = _a.maxHeight, maxHeight = _b === void 0 ? true : _b;
|
|
20
20
|
var form = useContext(FormContext);
|
|
21
21
|
var currentBreakPoint = useAppSelector(selectBreakPoint);
|
|
22
22
|
var postview = useAppSelector(function (state) { return state.global.postview; });
|
|
@@ -24,9 +24,12 @@ function MaterialInputContainer(_a) {
|
|
|
24
24
|
width: currentBreakPoint <= step.size
|
|
25
25
|
? '100%'
|
|
26
26
|
: calcStepWidth(step.size, form.size),
|
|
27
|
-
minHeight:
|
|
28
|
-
?
|
|
29
|
-
|
|
27
|
+
minHeight: maxHeight
|
|
28
|
+
? step.description ||
|
|
29
|
+
(!postview && editable && step.required)
|
|
30
|
+
? '55px'
|
|
31
|
+
: '43px'
|
|
32
|
+
: undefined,
|
|
30
33
|
}, onClick: onClick, "data-testid": step.id }, { children: children })));
|
|
31
34
|
}
|
|
32
35
|
export default MaterialInputContainer;
|