@arquimedes.co/eureka-forms 0.1.2 → 0.2.5
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/@Types.d.ts +1 -1
- package/dist/@Types/@Types.js +1 -1
- package/dist/@Types/Form.d.ts +63 -63
- package/dist/@Types/Form.js +1 -1
- package/dist/@Types/FormStep.d.ts +105 -105
- package/dist/@Types/FormStep.js +1 -1
- package/dist/@Types/Organization.d.ts +16 -16
- package/dist/@Types/Organization.js +1 -1
- package/dist/App.d.ts +34 -32
- package/dist/App.js +262 -261
- package/dist/App.module.css +21 -0
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.d.ts +4 -4
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +232 -232
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.module.css +46 -0
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.d.ts +12 -12
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +33 -33
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.module.css +48 -0
- package/dist/FormComponents/Form/Form.d.ts +24 -23
- package/dist/FormComponents/Form/Form.js +116 -116
- package/dist/FormComponents/Form/Form.module.css +39 -0
- package/dist/FormComponents/Form/StepperForm/StepperForm.d.ts +4 -4
- package/dist/FormComponents/Form/StepperForm/StepperForm.js +6 -6
- package/dist/FormComponents/Form/StepperForm/StepperForm.module.css +0 -0
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.d.ts +4 -4
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +42 -42
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.module.css +8 -0
- package/dist/FormComponents/Section/Section.d.ts +24 -23
- package/dist/FormComponents/Section/Section.js +25 -25
- package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +9 -9
- package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +37 -37
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +4 -4
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +105 -105
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.module.css +25 -0
- package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.d.ts +9 -9
- package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +25 -25
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +4 -4
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +35 -35
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.module.css +9 -0
- package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.d.ts +9 -9
- package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +25 -25
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +11 -11
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +110 -110
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.module.css +52 -0
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +13 -13
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +165 -165
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.module.css +45 -0
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +4 -4
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +99 -99
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.module.css +25 -0
- package/dist/FormComponents/Step/SelectorStep/SelectorStep.d.ts +9 -9
- package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +37 -37
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +4 -4
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +11 -11
- package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.module.css +7 -0
- package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.d.ts +9 -9
- package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +37 -37
- package/dist/FormComponents/Step/Step.d.ts +10 -10
- package/dist/FormComponents/Step/Step.js +73 -64
- package/dist/FormComponents/Step/StepFunctions.d.ts +5 -5
- package/dist/FormComponents/Step/StepFunctions.js +51 -51
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +35 -0
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +6 -6
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +112 -112
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.module.css +58 -0
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.d.ts +9 -9
- package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +25 -25
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +4 -4
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +43 -43
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.module.css +9 -0
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.d.ts +9 -9
- package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +25 -25
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +4 -4
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +18 -18
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.module.css +35 -0
- package/dist/FormComponents/Step/TitleStep/TitleStep.d.ts +9 -9
- package/dist/FormComponents/Step/TitleStep/TitleStep.js +37 -37
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.d.ts +4 -4
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +77 -77
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.module.css +73 -0
- package/dist/FormComponents/Term/Term.d.ts +15 -15
- package/dist/FormComponents/Term/Term.js +25 -25
- package/dist/Widget.d.ts +1 -1
- package/dist/Widget.js +39 -56
- package/dist/constants/Files/FileExtensions.d.ts +3 -3
- package/dist/constants/Files/FileExtensions.js +65 -65
- package/dist/constants/Files/FileMaxSize.d.ts +2 -2
- package/dist/constants/Files/FileMaxSize.js +2 -2
- package/dist/constants/FormStepTypes.d.ts +33 -33
- package/dist/constants/FormStepTypes.js +39 -39
- package/dist/constants/InternalFormStyle.d.ts +3 -3
- package/dist/constants/InternalFormStyle.js +12 -12
- package/dist/constants/MaterialClassNameSeed.d.ts +1 -1
- package/dist/constants/MaterialClassNameSeed.js +1 -1
- package/dist/controllers/FileService.d.ts +5 -5
- package/dist/controllers/FileService.js +89 -89
- package/dist/index.d.ts +1 -2
- package/dist/index.js +16 -17
- package/dist/index.lib.d.ts +3 -0
- package/dist/index.lib.js +3 -0
- package/dist/index.module.css +14 -0
- package/dist/shared/Loader/Loader.d.ts +18 -18
- package/dist/shared/Loader/Loader.js +26 -26
- package/dist/shared/Loader/Loader.module.css +12 -0
- package/dist/shared/Navbar/Navbar.d.ts +9 -9
- package/dist/shared/Navbar/Navbar.js +18 -18
- package/dist/shared/Navbar/Navbar.module.css +18 -0
- package/dist/shared/RoundedButton/RoundedButton.d.ts +30 -30
- package/dist/shared/RoundedButton/RoundedButton.js +45 -45
- package/dist/shared/RoundedCheckBox/RoundedCheckBox.d.ts +24 -24
- package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +101 -101
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.d.ts +40 -40
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +246 -246
- package/dist/shared/RoundedSelect/RoundedSelect.d.ts +42 -42
- package/dist/shared/RoundedSelect/RoundedSelect.js +171 -171
- package/dist/shared/RoundedTextField/RoundedTextField.d.ts +41 -41
- package/dist/shared/RoundedTextField/RoundedTextField.js +138 -138
- package/package.json +2 -2
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
width: fit-content;
|
|
3
|
+
max-width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
padding: 10px;
|
|
6
|
+
padding-bottom: 0px;
|
|
7
|
+
padding-top: 5px;
|
|
8
|
+
margin-bottom: 0px;
|
|
9
|
+
min-height: 100px;
|
|
10
|
+
width: 100%;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.labelLabel {
|
|
15
|
+
font-size: 16px;
|
|
16
|
+
margin-left: 8px;
|
|
17
|
+
margin-bottom: 5px;
|
|
18
|
+
-moz-user-select: none;
|
|
19
|
+
-khtml-user-select: none;
|
|
20
|
+
-webkit-user-select: none;
|
|
21
|
+
-ms-user-select: none;
|
|
22
|
+
user-select: none;
|
|
23
|
+
}
|
|
24
|
+
.stepDescriptionLabel {
|
|
25
|
+
font-size: 0.7rem;
|
|
26
|
+
margin-top: -4px;
|
|
27
|
+
margin-left: 8px;
|
|
28
|
+
}
|
|
29
|
+
.filesInput {
|
|
30
|
+
display: none;
|
|
31
|
+
}
|
|
32
|
+
.btnContainer {
|
|
33
|
+
margin-top: 5px;
|
|
34
|
+
margin-left: 10px;
|
|
35
|
+
width: fit-content;
|
|
36
|
+
}
|
|
37
|
+
.errorMsg {
|
|
38
|
+
font-size: 0.75rem;
|
|
39
|
+
margin-top: 7px;
|
|
40
|
+
margin-left: 14px;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
.filesContainer {
|
|
44
|
+
padding-top: 5px;
|
|
45
|
+
}
|
package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { SelectorStepProps } from '../SelectorStep';
|
|
3
|
-
declare function SelectorStep(props: SelectorStepProps): JSX.Element;
|
|
4
|
-
export default SelectorStep;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SelectorStepProps } from '../SelectorStep';
|
|
3
|
+
declare function SelectorStep(props: SelectorStepProps): JSX.Element;
|
|
4
|
+
export default SelectorStep;
|
|
@@ -1,99 +1,99 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
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
|
-
import { createElement as _createElement } from "react";
|
|
24
|
-
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
-
import React, { useState } from 'react';
|
|
26
|
-
import { OptionTypes } from '../../../../constants/FormStepTypes';
|
|
27
|
-
import RoundedSelect from '../../../../shared/RoundedSelect/RoundedSelect';
|
|
28
|
-
import { MenuItem } from '@material-ui/core';
|
|
29
|
-
import styles from './MaterialSelectorStep.module.css';
|
|
30
|
-
import StepComponent from '../../Step';
|
|
31
|
-
import { calcFillerSize, calcStepWidth } from '../../StepFunctions';
|
|
32
|
-
import { Controller } from 'react-hook-form';
|
|
33
|
-
function Selector(_a) {
|
|
34
|
-
var step = _a.step, form = _a.form, value = _a.value, level = _a.level, onBlur = _a.onBlur, control = _a.control, onChange = _a.onChange, postview = _a.postview, formStyle = _a.formStyle, getValues = _a.getValues, widthStats = _a.widthStats, handleSizeChange = _a.handleSizeChange, errors = _a.errors, others = __rest(_a, ["step", "form", "value", "level", "onBlur", "control", "onChange", "postview", "formStyle", "getValues", "widthStats", "handleSizeChange", "errors"]);
|
|
35
|
-
var _b = useState(level === 0 ? calcFillerSize(step, form.steps, getValues(), form) : 0), fillerSize = _b[0], setFillerSize = _b[1];
|
|
36
|
-
var sizeChange = function () {
|
|
37
|
-
handleSizeChange();
|
|
38
|
-
if (level === 0) {
|
|
39
|
-
setFillerSize(calcFillerSize(step, form.steps, getValues(), form));
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
|
-
var renderSelect = function () {
|
|
43
|
-
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
44
|
-
width: widthStats.currentBreakPoint <= step.size
|
|
45
|
-
? '100%'
|
|
46
|
-
: calcStepWidth(step.size, form),
|
|
47
|
-
maxWidth: '100%',
|
|
48
|
-
minHeight: step.description || step.required ? '55px' : '43px',
|
|
49
|
-
} }, { children: _jsxs(RoundedSelect, __assign({ value: value, fullWidth: true, cantEdit: postview, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, label: step.label, required: step.required, containerMargin: "0px", height: '31px', onBlur: onBlur, handleUpdate: function (event) {
|
|
50
|
-
onChange(event.target.value);
|
|
51
|
-
sizeChange();
|
|
52
|
-
}, helperText: errors[step.id]
|
|
53
|
-
? errors[step.id].message
|
|
54
|
-
: step.description, error: !!errors[step.id] }, { children: [_jsx(MenuItem, __assign({ value: '' }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), step.options.map(function (option) { return (_jsx(MenuItem, __assign({ value: option.value }, { children: option.label }), option.value)); })] }), void 0) }), void 0));
|
|
55
|
-
};
|
|
56
|
-
var mapNestedOption = function () {
|
|
57
|
-
var currentOptionIndex = null;
|
|
58
|
-
var currentOption = null;
|
|
59
|
-
for (var i = 0; i < step.options.length; i++) {
|
|
60
|
-
var option = step.options[i];
|
|
61
|
-
if (option.value === value) {
|
|
62
|
-
currentOptionIndex = i;
|
|
63
|
-
currentOption = option;
|
|
64
|
-
}
|
|
65
|
-
}
|
|
66
|
-
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === OptionTypes.NESTED &&
|
|
67
|
-
currentOptionIndex !== null) {
|
|
68
|
-
return (_jsx(React.Fragment, { children: currentOption.steps.map(function (idSubStep, index) {
|
|
69
|
-
var subStep = form.steps[idSubStep];
|
|
70
|
-
return (_createElement(StepComponent, __assign({}, others, { postview: postview, formStyle: formStyle, form: form, getValues: getValues, errors: errors, control: control, widthStats: widthStats, step: subStep, key: index, level: level + 1, handleSizeChange: function () {
|
|
71
|
-
sizeChange();
|
|
72
|
-
} })));
|
|
73
|
-
}) }, void 0));
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
if (level === 0 && step.maxSize < form.blockNum) {
|
|
77
|
-
return (_jsxs("div", __assign({ className: styles.firstLvlContainer, style: {
|
|
78
|
-
width: widthStats.currentBreakPoint <= step.size
|
|
79
|
-
? '100%'
|
|
80
|
-
: 'fit-content',
|
|
81
|
-
} }, { children: [renderSelect(), mapNestedOption(), level === 0 && step.maxSize < form.blockNum && (_jsx("div", { className: styles.smallSeparator, style: {
|
|
82
|
-
width: fillerSize,
|
|
83
|
-
} }, void 0))] }), void 0));
|
|
84
|
-
}
|
|
85
|
-
else {
|
|
86
|
-
return (_jsxs(React.Fragment, { children: [renderSelect(), mapNestedOption(), level === 0 && _jsx("div", { className: styles.separator }, void 0)] }, void 0));
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
function SelectorStep(props) {
|
|
90
|
-
return (_jsx(Controller, { name: props.step.id, control: props.control, defaultValue: "", rules: {
|
|
91
|
-
required: props.step.required
|
|
92
|
-
? 'Este campo es obligatorio'
|
|
93
|
-
: undefined,
|
|
94
|
-
}, shouldUnregister: true, render: function (_a) {
|
|
95
|
-
var field = _a.field;
|
|
96
|
-
return (_jsx(Selector, __assign({}, props, { value: field.value, onChange: field.onChange, onBlur: field.onBlur }), void 0));
|
|
97
|
-
} }, void 0));
|
|
98
|
-
}
|
|
99
|
-
export default SelectorStep;
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
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
|
+
import { createElement as _createElement } from "react";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
import React, { useState } from 'react';
|
|
26
|
+
import { OptionTypes } from '../../../../constants/FormStepTypes';
|
|
27
|
+
import RoundedSelect from '../../../../shared/RoundedSelect/RoundedSelect';
|
|
28
|
+
import { MenuItem } from '@material-ui/core';
|
|
29
|
+
import styles from './MaterialSelectorStep.module.css';
|
|
30
|
+
import StepComponent from '../../Step';
|
|
31
|
+
import { calcFillerSize, calcStepWidth } from '../../StepFunctions';
|
|
32
|
+
import { Controller } from 'react-hook-form';
|
|
33
|
+
function Selector(_a) {
|
|
34
|
+
var step = _a.step, form = _a.form, value = _a.value, level = _a.level, onBlur = _a.onBlur, control = _a.control, onChange = _a.onChange, postview = _a.postview, formStyle = _a.formStyle, getValues = _a.getValues, widthStats = _a.widthStats, handleSizeChange = _a.handleSizeChange, errors = _a.errors, others = __rest(_a, ["step", "form", "value", "level", "onBlur", "control", "onChange", "postview", "formStyle", "getValues", "widthStats", "handleSizeChange", "errors"]);
|
|
35
|
+
var _b = useState(level === 0 ? calcFillerSize(step, form.steps, getValues(), form) : 0), fillerSize = _b[0], setFillerSize = _b[1];
|
|
36
|
+
var sizeChange = function () {
|
|
37
|
+
handleSizeChange();
|
|
38
|
+
if (level === 0) {
|
|
39
|
+
setFillerSize(calcFillerSize(step, form.steps, getValues(), form));
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var renderSelect = function () {
|
|
43
|
+
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
44
|
+
width: widthStats.currentBreakPoint <= step.size
|
|
45
|
+
? '100%'
|
|
46
|
+
: calcStepWidth(step.size, form),
|
|
47
|
+
maxWidth: '100%',
|
|
48
|
+
minHeight: step.description || step.required ? '55px' : '43px',
|
|
49
|
+
} }, { children: _jsxs(RoundedSelect, __assign({ value: value, fullWidth: true, cantEdit: postview, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, label: step.label, required: step.required, containerMargin: "0px", height: '31px', onBlur: onBlur, handleUpdate: function (event) {
|
|
50
|
+
onChange(event.target.value);
|
|
51
|
+
sizeChange();
|
|
52
|
+
}, helperText: errors[step.id]
|
|
53
|
+
? errors[step.id].message
|
|
54
|
+
: step.description, error: !!errors[step.id] }, { children: [_jsx(MenuItem, __assign({ value: '' }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), step.options.map(function (option) { return (_jsx(MenuItem, __assign({ value: option.value }, { children: option.label }), option.value)); })] }), void 0) }), void 0));
|
|
55
|
+
};
|
|
56
|
+
var mapNestedOption = function () {
|
|
57
|
+
var currentOptionIndex = null;
|
|
58
|
+
var currentOption = null;
|
|
59
|
+
for (var i = 0; i < step.options.length; i++) {
|
|
60
|
+
var option = step.options[i];
|
|
61
|
+
if (option.value === value) {
|
|
62
|
+
currentOptionIndex = i;
|
|
63
|
+
currentOption = option;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
if ((currentOption === null || currentOption === void 0 ? void 0 : currentOption.type) === OptionTypes.NESTED &&
|
|
67
|
+
currentOptionIndex !== null) {
|
|
68
|
+
return (_jsx(React.Fragment, { children: currentOption.steps.map(function (idSubStep, index) {
|
|
69
|
+
var subStep = form.steps[idSubStep];
|
|
70
|
+
return (_createElement(StepComponent, __assign({}, others, { postview: postview, formStyle: formStyle, form: form, getValues: getValues, errors: errors, control: control, widthStats: widthStats, step: subStep, key: index, level: level + 1, handleSizeChange: function () {
|
|
71
|
+
sizeChange();
|
|
72
|
+
} })));
|
|
73
|
+
}) }, void 0));
|
|
74
|
+
}
|
|
75
|
+
};
|
|
76
|
+
if (level === 0 && step.maxSize < form.blockNum) {
|
|
77
|
+
return (_jsxs("div", __assign({ className: styles.firstLvlContainer, style: {
|
|
78
|
+
width: widthStats.currentBreakPoint <= step.size
|
|
79
|
+
? '100%'
|
|
80
|
+
: 'fit-content',
|
|
81
|
+
} }, { children: [renderSelect(), mapNestedOption(), level === 0 && step.maxSize < form.blockNum && (_jsx("div", { className: styles.smallSeparator, style: {
|
|
82
|
+
width: fillerSize,
|
|
83
|
+
} }, void 0))] }), void 0));
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return (_jsxs(React.Fragment, { children: [renderSelect(), mapNestedOption(), level === 0 && _jsx("div", { className: styles.separator }, void 0)] }, void 0));
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
function SelectorStep(props) {
|
|
90
|
+
return (_jsx(Controller, { name: props.step.id, control: props.control, defaultValue: "", rules: {
|
|
91
|
+
required: props.step.required
|
|
92
|
+
? 'Este campo es obligatorio'
|
|
93
|
+
: undefined,
|
|
94
|
+
}, shouldUnregister: true, render: function (_a) {
|
|
95
|
+
var field = _a.field;
|
|
96
|
+
return (_jsx(Selector, __assign({}, props, { value: field.value, onChange: field.onChange, onBlur: field.onBlur }), void 0));
|
|
97
|
+
} }, void 0));
|
|
98
|
+
}
|
|
99
|
+
export default SelectorStep;
|
package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.module.css
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
.container {
|
|
2
|
+
width: fit-content;
|
|
3
|
+
max-width: 100%;
|
|
4
|
+
display: flex;
|
|
5
|
+
padding: 10px;
|
|
6
|
+
padding-bottom: 0px;
|
|
7
|
+
padding-top: 5px;
|
|
8
|
+
margin-bottom: 0px;
|
|
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,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormSelector } from '../../../@Types/FormStep';
|
|
3
|
-
import { StepProps } from '../Step';
|
|
4
|
-
export interface SelectorStepProps extends StepProps {
|
|
5
|
-
/** The SelectorStep to display */
|
|
6
|
-
step: FormSelector;
|
|
7
|
-
}
|
|
8
|
-
declare function SelectorStep({ formStyle, ...others }: SelectorStepProps): JSX.Element;
|
|
9
|
-
export default SelectorStep;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormSelector } from '../../../@Types/FormStep';
|
|
3
|
+
import { StepProps } from '../Step';
|
|
4
|
+
export interface SelectorStepProps extends StepProps {
|
|
5
|
+
/** The SelectorStep to display */
|
|
6
|
+
step: FormSelector;
|
|
7
|
+
}
|
|
8
|
+
declare function SelectorStep({ formStyle, ...others }: SelectorStepProps): JSX.Element;
|
|
9
|
+
export default SelectorStep;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
25
|
-
import MaterialSelectorStep from './MaterialSelectorStep/MaterialSelectorStep';
|
|
26
|
-
function SelectorStep(_a) {
|
|
27
|
-
var formStyle = _a.formStyle, others = __rest(_a, ["formStyle"]);
|
|
28
|
-
switch (formStyle.type) {
|
|
29
|
-
case FormStyleTypes.MATERIAL: {
|
|
30
|
-
return _jsx(MaterialSelectorStep, __assign({ formStyle: formStyle }, others), void 0);
|
|
31
|
-
}
|
|
32
|
-
default: {
|
|
33
|
-
return _jsx(MaterialSelectorStep, __assign({ formStyle: formStyle }, others), void 0);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export default SelectorStep;
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
25
|
+
import MaterialSelectorStep from './MaterialSelectorStep/MaterialSelectorStep';
|
|
26
|
+
function SelectorStep(_a) {
|
|
27
|
+
var formStyle = _a.formStyle, others = __rest(_a, ["formStyle"]);
|
|
28
|
+
switch (formStyle.type) {
|
|
29
|
+
case FormStyleTypes.MATERIAL: {
|
|
30
|
+
return _jsx(MaterialSelectorStep, __assign({ formStyle: formStyle }, others), void 0);
|
|
31
|
+
}
|
|
32
|
+
default: {
|
|
33
|
+
return _jsx(MaterialSelectorStep, __assign({ formStyle: formStyle }, others), void 0);
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export default SelectorStep;
|
package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { SeparatorStepProps } from '../SeparatorStep';
|
|
3
|
-
declare function SeparatorStep({ step, formStyle }: SeparatorStepProps): JSX.Element;
|
|
4
|
-
export default SeparatorStep;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { SeparatorStepProps } from '../SeparatorStep';
|
|
3
|
+
declare function SeparatorStep({ step, formStyle }: SeparatorStepProps): JSX.Element;
|
|
4
|
+
export default SeparatorStep;
|
package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
import styles from './MaterialSeparatorStep.module.css';
|
|
3
|
-
function SeparatorStep(_a) {
|
|
4
|
-
var step = _a.step, formStyle = _a.formStyle;
|
|
5
|
-
return (_jsx("div", { className: styles.container, style: {
|
|
6
|
-
backgroundColor: step.transparent
|
|
7
|
-
? 'transparent'
|
|
8
|
-
: formStyle.primaryColor,
|
|
9
|
-
} }, void 0));
|
|
10
|
-
}
|
|
11
|
-
export default SeparatorStep;
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import styles from './MaterialSeparatorStep.module.css';
|
|
3
|
+
function SeparatorStep(_a) {
|
|
4
|
+
var step = _a.step, formStyle = _a.formStyle;
|
|
5
|
+
return (_jsx("div", { className: styles.container, style: {
|
|
6
|
+
backgroundColor: step.transparent
|
|
7
|
+
? 'transparent'
|
|
8
|
+
: formStyle.primaryColor,
|
|
9
|
+
} }, void 0));
|
|
10
|
+
}
|
|
11
|
+
export default SeparatorStep;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { Separator } from '../../../@Types/FormStep';
|
|
3
|
-
import { StepProps } from '../Step';
|
|
4
|
-
export interface SeparatorStepProps extends StepProps {
|
|
5
|
-
/** The TitleStep to display */
|
|
6
|
-
step: Separator;
|
|
7
|
-
}
|
|
8
|
-
declare function SeparatorStep({ step, formStyle, ...others }: SeparatorStepProps): JSX.Element;
|
|
9
|
-
export default SeparatorStep;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { Separator } from '../../../@Types/FormStep';
|
|
3
|
+
import { StepProps } from '../Step';
|
|
4
|
+
export interface SeparatorStepProps extends StepProps {
|
|
5
|
+
/** The TitleStep to display */
|
|
6
|
+
step: Separator;
|
|
7
|
+
}
|
|
8
|
+
declare function SeparatorStep({ step, formStyle, ...others }: SeparatorStepProps): JSX.Element;
|
|
9
|
+
export default SeparatorStep;
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
var __assign = (this && this.__assign) || function () {
|
|
2
|
-
__assign = Object.assign || function(t) {
|
|
3
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
-
s = arguments[i];
|
|
5
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
-
t[p] = s[p];
|
|
7
|
-
}
|
|
8
|
-
return t;
|
|
9
|
-
};
|
|
10
|
-
return __assign.apply(this, arguments);
|
|
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
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
25
|
-
import MaterialSeparatorStep from './MaterialSeparatorStep/MaterialSeparatorStep';
|
|
26
|
-
function SeparatorStep(_a) {
|
|
27
|
-
var step = _a.step, formStyle = _a.formStyle, others = __rest(_a, ["step", "formStyle"]);
|
|
28
|
-
switch (formStyle.type) {
|
|
29
|
-
case FormStyleTypes.MATERIAL: {
|
|
30
|
-
return (_jsx(MaterialSeparatorStep, __assign({ step: step, formStyle: formStyle }, others), void 0));
|
|
31
|
-
}
|
|
32
|
-
default: {
|
|
33
|
-
return (_jsx(MaterialSeparatorStep, __assign({ step: step, formStyle: formStyle }, others), void 0));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export default SeparatorStep;
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
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
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
import { FormStyleTypes } from '../../../constants/FormStepTypes';
|
|
25
|
+
import MaterialSeparatorStep from './MaterialSeparatorStep/MaterialSeparatorStep';
|
|
26
|
+
function SeparatorStep(_a) {
|
|
27
|
+
var step = _a.step, formStyle = _a.formStyle, others = __rest(_a, ["step", "formStyle"]);
|
|
28
|
+
switch (formStyle.type) {
|
|
29
|
+
case FormStyleTypes.MATERIAL: {
|
|
30
|
+
return (_jsx(MaterialSeparatorStep, __assign({ step: step, formStyle: formStyle }, others), void 0));
|
|
31
|
+
}
|
|
32
|
+
default: {
|
|
33
|
+
return (_jsx(MaterialSeparatorStep, __assign({ step: step, formStyle: formStyle }, others), void 0));
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
export default SeparatorStep;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { FormStep } from '../../@Types/FormStep';
|
|
3
|
-
import { RecursiveData } from '../Section/Section';
|
|
4
|
-
export interface StepProps extends RecursiveData {
|
|
5
|
-
step: FormStep;
|
|
6
|
-
handleSizeChange: Function;
|
|
7
|
-
level: number;
|
|
8
|
-
}
|
|
9
|
-
declare function StepComponent({ step, ...
|
|
10
|
-
export default StepComponent;
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormStep } from '../../@Types/FormStep';
|
|
3
|
+
import { RecursiveData } from '../Section/Section';
|
|
4
|
+
export interface StepProps extends RecursiveData {
|
|
5
|
+
step: FormStep;
|
|
6
|
+
handleSizeChange: Function;
|
|
7
|
+
level: number;
|
|
8
|
+
}
|
|
9
|
+
declare function StepComponent({ step, ...props }: StepProps): JSX.Element;
|
|
10
|
+
export default StepComponent;
|