@arquimedes.co/eureka-forms 0.2.40-test → 0.2.40
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/Form.d.ts +0 -1
- package/dist/@Types/FormStep.d.ts +1 -9
- package/dist/App.js +9 -4
- package/dist/App.module.css +8 -0
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +1 -0
- package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.module.css +9 -0
- package/dist/FormComponents/Form/Form.d.ts +0 -1
- package/dist/FormComponents/Form/Form.js +6 -5
- package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +3 -3
- package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +1 -1
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +1 -1
- package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.module.css +2 -9
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +2 -2
- package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.module.css +1 -1
- package/dist/FormComponents/Step/Step.js +0 -4
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +50 -2
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +45 -33
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.module.css +0 -1
- package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +1 -1
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.module.css +2 -0
- package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.module.css +10 -0
- package/dist/constants/FormStepTypes.d.ts +0 -1
- package/dist/constants/FormStepTypes.js +0 -1
- package/dist/constants/InternalFormStyle.js +0 -1
- package/dist/shared/RoundedButton/RoundedButton.js +1 -1
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.d.ts +0 -2
- package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +2 -9
- package/dist/shared/RoundedSelect/RoundedSelect.d.ts +11 -17
- package/dist/shared/RoundedSelect/RoundedSelect.js +14 -13
- package/dist/shared/RoundedTextField/RoundedTextField.d.ts +0 -2
- package/dist/shared/RoundedTextField/RoundedTextField.js +1 -5
- package/package.json +9 -3
- package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.d.ts +0 -9
- package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +0 -37
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +0 -4
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +0 -40
- package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css +0 -37
package/dist/@Types/Form.d.ts
CHANGED
|
@@ -1,19 +1,11 @@
|
|
|
1
1
|
import Types, { ClassifierOptionTypes, ClientInfoTypes, OptionTypes } from '../constants/FormStepTypes';
|
|
2
|
-
export declare type FormStep = Title |
|
|
2
|
+
export declare type FormStep = Title | TextArea | TextInput | DatePicker | FileUpload | Separator | FormSelector | ClassifierSelector;
|
|
3
3
|
export interface Title {
|
|
4
4
|
id: string;
|
|
5
5
|
type: Types.TITLE;
|
|
6
6
|
title: string;
|
|
7
7
|
description: string | null;
|
|
8
8
|
}
|
|
9
|
-
export interface CheckBox {
|
|
10
|
-
label: string;
|
|
11
|
-
description: string | null;
|
|
12
|
-
id: string;
|
|
13
|
-
type: Types.CHECKBOX;
|
|
14
|
-
required: boolean;
|
|
15
|
-
size: 1 | 2 | 3 | 4;
|
|
16
|
-
}
|
|
17
9
|
export interface FileUpload {
|
|
18
10
|
id: string;
|
|
19
11
|
type: Types.FILEUPLOAD;
|
package/dist/App.js
CHANGED
|
@@ -74,7 +74,7 @@ function App(_a) {
|
|
|
74
74
|
//
|
|
75
75
|
function fetchOrgData(domain) {
|
|
76
76
|
return __awaiter(this, void 0, void 0, function () {
|
|
77
|
-
var response, _a, currentOrg
|
|
77
|
+
var response, _a, currentOrg;
|
|
78
78
|
return __generator(this, function (_b) {
|
|
79
79
|
switch (_b.label) {
|
|
80
80
|
case 0:
|
|
@@ -91,8 +91,11 @@ function App(_a) {
|
|
|
91
91
|
response = _a;
|
|
92
92
|
if (response === null || response === void 0 ? void 0 : response.data) {
|
|
93
93
|
currentOrg = response.data;
|
|
94
|
-
|
|
95
|
-
favicon
|
|
94
|
+
// document.title = currentOrg.name;
|
|
95
|
+
// const favicon: any = document.getElementById('favicon');
|
|
96
|
+
// if (favicon !== undefined) {
|
|
97
|
+
// favicon.href = currentOrg.partialLogoUrl;
|
|
98
|
+
// }
|
|
96
99
|
return [2 /*return*/, currentOrg];
|
|
97
100
|
}
|
|
98
101
|
return [2 /*return*/];
|
|
@@ -109,7 +112,6 @@ function App(_a) {
|
|
|
109
112
|
case 1:
|
|
110
113
|
response = _a.sent();
|
|
111
114
|
if (response.data) {
|
|
112
|
-
console.log('ORGANIZATON', response);
|
|
113
115
|
setOrganizationInfo(response.data);
|
|
114
116
|
setForm(migrateFormData(formData));
|
|
115
117
|
}
|
|
@@ -140,6 +142,7 @@ function App(_a) {
|
|
|
140
142
|
loadInfo(apiKey, domain);
|
|
141
143
|
}
|
|
142
144
|
else {
|
|
145
|
+
console.log('ERROREMBED');
|
|
143
146
|
//Error in embed
|
|
144
147
|
setForm(null);
|
|
145
148
|
setOrganizationInfo(null);
|
|
@@ -190,7 +193,9 @@ function App(_a) {
|
|
|
190
193
|
return (_jsx("div", __assign({ className: styles.curtain }, { children: _jsx(Loader, { size: 50 }, void 0) }), void 0));
|
|
191
194
|
}
|
|
192
195
|
else if (form === null) {
|
|
196
|
+
console.log('FORM IS NULL');
|
|
193
197
|
if (organizationInfo === null) {
|
|
198
|
+
console.log('ORG IS NULL');
|
|
194
199
|
if (isWidget) {
|
|
195
200
|
return (_jsx("div", __assign({ className: styles.widgetContainer }, { children: _jsx("div", __assign({ className: styles.curtain }, { children: "Error" }), void 0) }), void 0));
|
|
196
201
|
}
|
package/dist/App.module.css
CHANGED
|
@@ -7,6 +7,15 @@
|
|
|
7
7
|
position: relative;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
+
.confirmationContainer,
|
|
11
|
+
.confirmationContainer *,
|
|
12
|
+
.confirmationContainer *::after,
|
|
13
|
+
.confirmationContainer *::before {
|
|
14
|
+
-webkit-box-sizing: content-box;
|
|
15
|
+
-moz-box-sizing: content-box;
|
|
16
|
+
box-sizing: content-box;
|
|
17
|
+
}
|
|
18
|
+
|
|
10
19
|
.checkContainer {
|
|
11
20
|
margin-left: auto;
|
|
12
21
|
margin-right: auto;
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
import { Organization } from '../../@Types/@Types';
|
|
3
3
|
import { Form, FormStyle } from '../../@Types/Form';
|
|
4
4
|
import { CustomStep } from '../../App';
|
|
5
|
-
export declare const getLocale: () => any;
|
|
6
5
|
export interface WidthStats {
|
|
7
6
|
currentBreakPoint: number;
|
|
8
7
|
isMobile: boolean;
|
|
@@ -39,13 +39,13 @@ var localeMap = {
|
|
|
39
39
|
'en-US': enLocale,
|
|
40
40
|
es: esLocale,
|
|
41
41
|
};
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
return ((_a = localeMap[navigator.languages && navigator.languages.length
|
|
42
|
+
var getNavigatorLanguage = function () {
|
|
43
|
+
return navigator.languages && navigator.languages.length
|
|
45
44
|
? navigator.languages[0]
|
|
46
45
|
: navigator.userLanguage ||
|
|
47
46
|
navigator.language ||
|
|
48
|
-
navigator.browserLanguage
|
|
47
|
+
navigator.browserLanguage ||
|
|
48
|
+
'es';
|
|
49
49
|
};
|
|
50
50
|
var blockSize = 210;
|
|
51
51
|
var spacingSize = 20;
|
|
@@ -108,6 +108,7 @@ var generateClassName = createGenerateClassName({
|
|
|
108
108
|
productionPrefix: 'efjss',
|
|
109
109
|
});
|
|
110
110
|
function FormTypeComponent(_a) {
|
|
111
|
+
var _b;
|
|
111
112
|
var props = __rest(_a, []);
|
|
112
113
|
var renderTypes = function () {
|
|
113
114
|
switch (props.form.type) {
|
|
@@ -124,7 +125,7 @@ function FormTypeComponent(_a) {
|
|
|
124
125
|
};
|
|
125
126
|
switch (props.formStyle.type) {
|
|
126
127
|
case FormStyleTypes.MATERIAL:
|
|
127
|
-
return (_jsx(StylesProvider, __assign({ generateClassName: generateClassName }, { children: _jsx(ThemeProvider, __assign({ theme: muiTheme }, { children: _jsx(MuiPickersUtilsProvider, __assign({ utils: DateFnsUtils, locale:
|
|
128
|
+
return (_jsx(StylesProvider, __assign({ generateClassName: generateClassName }, { children: _jsx(ThemeProvider, __assign({ theme: muiTheme }, { children: _jsx(MuiPickersUtilsProvider, __assign({ utils: DateFnsUtils, locale: (_b = localeMap[getNavigatorLanguage()]) !== null && _b !== void 0 ? _b : localeMap.es }, { children: renderTypes() }), void 0) }), void 0) }), void 0));
|
|
128
129
|
default:
|
|
129
130
|
return renderTypes();
|
|
130
131
|
}
|
|
@@ -53,18 +53,18 @@ function ClassifierSelector(_a) {
|
|
|
53
53
|
: calcStepWidth(step.size, form),
|
|
54
54
|
maxWidth: '100%',
|
|
55
55
|
minHeight: step.description || step.required ? '55px' : '43px',
|
|
56
|
-
} }, { children: _jsxs(RoundedSelect, __assign({ fullWidth: true, value: value, cantEdit: postview,
|
|
56
|
+
} }, { children: _jsxs(RoundedSelect, __assign({ fullWidth: true, value: value, cantEdit: postview, errorColor: formStyle.errorColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, label: step.label ? step.label : classifier.name, required: step.required, containerMargin: "0px", height: '31px', onBlur: onBlur, handleUpdate: function (event) {
|
|
57
57
|
onChange(event.target.value);
|
|
58
58
|
sizeChange();
|
|
59
59
|
}, inputRef: inputRef, helperText: errors[step.id]
|
|
60
60
|
? errors[step.id].message
|
|
61
|
-
: step.description, error: !!errors[step.id] }, { children: [_jsx(MenuItem, __assign({ value: '' }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), classifier.children
|
|
61
|
+
: step.description, error: !!errors[step.id] }, { children: [_jsx(MenuItem, __assign({ value: '', style: { whiteSpace: 'normal' } }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), classifier.children
|
|
62
62
|
.filter(function (classifier) {
|
|
63
63
|
var _a;
|
|
64
64
|
return ((_a = step.options[classifier._id]) === null || _a === void 0 ? void 0 : _a.type) !==
|
|
65
65
|
ClassifierOptionTypes.HIDE;
|
|
66
66
|
})
|
|
67
|
-
.map(function (classifier) { return (_jsx(MenuItem, __assign({ value: classifier._id }, { children: classifier.name }), classifier._id)); })] }), void 0) }), void 0));
|
|
67
|
+
.map(function (classifier) { return (_jsx(MenuItem, __assign({ value: classifier._id, style: { whiteSpace: 'normal' } }, { children: classifier.name }), classifier._id)); })] }), void 0) }), void 0));
|
|
68
68
|
};
|
|
69
69
|
var mapNestedOption = function () {
|
|
70
70
|
if (value) {
|
package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js
CHANGED
|
@@ -27,7 +27,7 @@ function DatePickerStep(_a) {
|
|
|
27
27
|
: undefined,
|
|
28
28
|
}, shouldUnregister: true, render: function (_a) {
|
|
29
29
|
var field = _a.field;
|
|
30
|
-
return (_jsx(RoundedDatePicker, __assign({}, field, { showIcon: step.showIcon, inputRef: field.ref, cantEdit: postview, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor,
|
|
30
|
+
return (_jsx(RoundedDatePicker, __assign({}, field, { showIcon: step.showIcon, inputRef: field.ref, cantEdit: postview, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, fontWeight: 400, label: step.label, helperText: errors[step.id]
|
|
31
31
|
? errors[step.id].message
|
|
32
32
|
: step.description, error: !!errors[step.id], required: step.required }), void 0));
|
|
33
33
|
} }, void 0) }), void 0));
|
package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js
CHANGED
|
@@ -190,7 +190,7 @@ function FileUploadStep(_a) {
|
|
|
190
190
|
}
|
|
191
191
|
return '';
|
|
192
192
|
};
|
|
193
|
-
return (_jsxs("div", __assign({ className: styles.container }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label }), void 0), step.description && (_jsx("div", __assign({ className: styles.stepDescriptionLabel
|
|
193
|
+
return (_jsxs("div", __assign({ className: styles.container }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label }), void 0), step.description && (_jsx("div", __assign({ className: styles.stepDescriptionLabel }, { children: step.description }), void 0)), _jsx("input", { type: "file", ref: inputRef, className: styles.filesInput, onChange: function (e) {
|
|
194
194
|
var files = e.target.files;
|
|
195
195
|
if (files) {
|
|
196
196
|
var filesArray = Array.from(files);
|
|
@@ -21,18 +21,11 @@
|
|
|
21
21
|
-ms-user-select: none;
|
|
22
22
|
user-select: none;
|
|
23
23
|
}
|
|
24
|
-
|
|
25
24
|
.stepDescriptionLabel {
|
|
26
|
-
font-size: 0.
|
|
27
|
-
margin-left: 14px;
|
|
25
|
+
font-size: 0.7rem;
|
|
28
26
|
margin-top: -4px;
|
|
29
|
-
|
|
30
|
-
line-height: 1.66;
|
|
31
|
-
max-width: 100%;
|
|
32
|
-
overflow: hidden;
|
|
33
|
-
text-overflow: ellipsis;
|
|
27
|
+
margin-left: 8px;
|
|
34
28
|
}
|
|
35
|
-
|
|
36
29
|
.filesInput {
|
|
37
30
|
display: none;
|
|
38
31
|
}
|
|
@@ -46,12 +46,12 @@ function Selector(_a) {
|
|
|
46
46
|
: calcStepWidth(step.size, form),
|
|
47
47
|
maxWidth: '100%',
|
|
48
48
|
minHeight: step.description || step.required ? '55px' : '43px',
|
|
49
|
-
} }, { children: _jsxs(RoundedSelect, __assign({ value: value, fullWidth: true, inputRef: inputRef, cantEdit: postview,
|
|
49
|
+
} }, { children: _jsxs(RoundedSelect, __assign({ value: value, fullWidth: true, inputRef: inputRef, 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
50
|
onChange(event.target.value);
|
|
51
51
|
sizeChange();
|
|
52
52
|
}, helperText: errors[step.id]
|
|
53
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));
|
|
54
|
+
: step.description, error: !!errors[step.id] }, { children: [_jsx(MenuItem, __assign({ value: '', style: { whiteSpace: 'normal' } }, { children: _jsx("em", { children: "Sin Seleccionar" }, void 0) }), 'EMPTY'), step.options.map(function (option) { return (_jsx(MenuItem, __assign({ value: option.value, style: { whiteSpace: 'normal' } }, { children: option.label }), option.value)); })] }), void 0) }), void 0));
|
|
55
55
|
};
|
|
56
56
|
var mapNestedOption = function () {
|
|
57
57
|
var currentOptionIndex = null;
|
|
@@ -30,7 +30,6 @@ import ClassifierSelectorStep from './ClassifierSelectorStep/ClassifierSelectorS
|
|
|
30
30
|
import TextAreaStep from './TextAreaStep/TextAreaStep';
|
|
31
31
|
import DatePickerStep from './DatePickerStep/DatePickerStep';
|
|
32
32
|
import FileUploadStep from './FileUploadStep/FileUploadStep';
|
|
33
|
-
import CheckBoxStep from './CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep';
|
|
34
33
|
function StepComponent(_a) {
|
|
35
34
|
var step = _a.step, props = __rest(_a, ["step"]);
|
|
36
35
|
switch (step.type) {
|
|
@@ -40,9 +39,6 @@ function StepComponent(_a) {
|
|
|
40
39
|
case Types.SELECTOR: {
|
|
41
40
|
return _jsx(SelectorStep, __assign({ step: step }, props), void 0);
|
|
42
41
|
}
|
|
43
|
-
case Types.CHECKBOX: {
|
|
44
|
-
return _jsx(CheckBoxStep, __assign({ step: step }, props), void 0);
|
|
45
|
-
}
|
|
46
42
|
case Types.CLASSIFIER_SELECTOR: {
|
|
47
43
|
return (_jsx(ClassifierSelectorStep, __assign({ step: step }, props), void 0));
|
|
48
44
|
}
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
.EF-DraftContainer .rdw-option-wrapper {
|
|
11
11
|
border-radius: 7px;
|
|
12
12
|
border: 1px solid var(--eureka-outline);
|
|
13
|
+
background-color: transparent;
|
|
13
14
|
}
|
|
15
|
+
|
|
14
16
|
.EF-DraftContainer .rdw-option-wrapper:active {
|
|
15
17
|
border: 1px solid var(--eureka-primary);
|
|
16
18
|
}
|
|
@@ -28,15 +30,61 @@
|
|
|
28
30
|
border-radius: 15px 15px 0 0;
|
|
29
31
|
border: none;
|
|
30
32
|
border-bottom: 1px solid var(--eureka-outline);
|
|
33
|
+
background-color: transparent;
|
|
31
34
|
}
|
|
32
35
|
|
|
33
36
|
.EF-DraftContainer .rdw-editor-main {
|
|
34
37
|
cursor: text;
|
|
35
|
-
padding-top:
|
|
36
|
-
padding-bottom:
|
|
38
|
+
padding-top: 12px;
|
|
39
|
+
padding-bottom: 12px;
|
|
37
40
|
margin-right: 0px;
|
|
38
41
|
}
|
|
39
42
|
|
|
40
43
|
.EF-DraftContainer .public-DraftStyleDefault-block {
|
|
41
44
|
margin: 0px 0;
|
|
45
|
+
max-width: 100%;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.EF-DraftContainer .rdw-image-imagewrapper {
|
|
49
|
+
max-width: 100%;
|
|
50
|
+
/* cursor: pointer; */
|
|
51
|
+
position: relative;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
.EF-DraftContainer .rdw-image-alignment-editor {
|
|
55
|
+
padding-right: 10px;
|
|
56
|
+
padding-left: 5px;
|
|
57
|
+
margin-left: -5px;
|
|
58
|
+
}
|
|
59
|
+
.EF-DraftContainer .rdw-editing-image {
|
|
60
|
+
border: 1px solid var(--secondary);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
.EF-DraftContainer .DraftEditor-root figure {
|
|
64
|
+
margin: 0px;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
.EF-DraftContainer .rdw-image-alignment-option {
|
|
68
|
+
font-size: 16px !important;
|
|
69
|
+
width: 20px;
|
|
70
|
+
height: 20px;
|
|
71
|
+
margin-left: 2px;
|
|
72
|
+
border-radius: 2px;
|
|
73
|
+
|
|
74
|
+
display: flex;
|
|
75
|
+
align-items: center;
|
|
76
|
+
justify-content: center;
|
|
77
|
+
border: 1px solid var(--light-grey);
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
.EF-DraftContainer .rdw-image-alignment-options-popup {
|
|
81
|
+
width: fit-content;
|
|
82
|
+
box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
/* Hides empty placeholder */
|
|
86
|
+
.EF-DraftContainer
|
|
87
|
+
.RichEditor-hidePlaceholder
|
|
88
|
+
.public-DraftEditorPlaceholder-root {
|
|
89
|
+
display: none;
|
|
42
90
|
}
|
|
@@ -36,10 +36,7 @@ function TextAreaStep(_a) {
|
|
|
36
36
|
return { border: '1px solid ' + formStyle.primaryColor };
|
|
37
37
|
}
|
|
38
38
|
else {
|
|
39
|
-
return {
|
|
40
|
-
border: '1px solid ' + formStyle.outlineColor,
|
|
41
|
-
pointerEvents: postview ? 'none' : 'all',
|
|
42
|
-
};
|
|
39
|
+
return { border: '1px solid ' + formStyle.outlineColor };
|
|
43
40
|
}
|
|
44
41
|
};
|
|
45
42
|
if (step.hasTextEditor) {
|
|
@@ -54,7 +51,7 @@ function TextAreaStep(_a) {
|
|
|
54
51
|
if (!postview) {
|
|
55
52
|
setFocus(false);
|
|
56
53
|
}
|
|
57
|
-
} }, { children:
|
|
54
|
+
} }, { children: _jsxs("div", __assign({ className: styles.textContainer + ' EF-DraftContainer', style: calcStyle(), onMouseEnter: function () {
|
|
58
55
|
if (!postview) {
|
|
59
56
|
setHovering(true);
|
|
60
57
|
}
|
|
@@ -66,36 +63,51 @@ function TextAreaStep(_a) {
|
|
|
66
63
|
if (!postview) {
|
|
67
64
|
setFocus(true);
|
|
68
65
|
}
|
|
69
|
-
} }, { children: _jsx(Controller, { name: step.id, control: control, defaultValue: originalValues[step.id]
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
66
|
+
} }, { children: [postview && (_jsx("div", { className: styles.disabledCurtain }, void 0)), _jsx(Controller, { name: step.id, control: control, defaultValue: originalValues[step.id]
|
|
67
|
+
? EditorState.createWithContent(convertFromRaw(getRawText(originalValues[step.id].draft, originalValues[step.id].text)))
|
|
68
|
+
: EditorState.createEmpty(), rules: step.required
|
|
69
|
+
? {
|
|
70
|
+
validate: function (editorState) {
|
|
71
|
+
return editorState
|
|
72
|
+
.getCurrentContent()
|
|
73
|
+
.hasText();
|
|
74
|
+
},
|
|
75
|
+
}
|
|
76
|
+
: {}, shouldUnregister: true, render: function (_a) {
|
|
77
|
+
var _b;
|
|
78
|
+
var field = _a.field;
|
|
79
|
+
var editorClassName = styles.editor;
|
|
80
|
+
if (!field.value.getCurrentContent().hasText()) {
|
|
81
|
+
if (field.value
|
|
75
82
|
.getCurrentContent()
|
|
76
|
-
.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
inline: {
|
|
83
|
+
.getBlockMap()
|
|
84
|
+
.first()
|
|
85
|
+
.getType() !== 'unstyled') {
|
|
86
|
+
editorClassName +=
|
|
87
|
+
' RichEditor-hidePlaceholder';
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
return (_jsx(Editor, { editorRef: field.ref, onFocus: function () {
|
|
91
|
+
setFocus(true);
|
|
92
|
+
}, onBlur: field.onBlur, editorState: field.value, onEditorStateChange: field.onChange, toolbarClassName: styles.toolbar, editorClassName: editorClassName, wrapperClassName: styles.wrapper, placeholder: (_b = step.description) !== null && _b !== void 0 ? _b : '', toolbar: {
|
|
87
93
|
options: [
|
|
88
|
-
'
|
|
89
|
-
'
|
|
90
|
-
'
|
|
91
|
-
'strikethrough',
|
|
94
|
+
'inline',
|
|
95
|
+
'list',
|
|
96
|
+
'history',
|
|
92
97
|
],
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
98
|
+
inline: {
|
|
99
|
+
options: [
|
|
100
|
+
'bold',
|
|
101
|
+
'italic',
|
|
102
|
+
'underline',
|
|
103
|
+
'strikethrough',
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
list: {
|
|
107
|
+
options: ['unordered'],
|
|
108
|
+
},
|
|
109
|
+
} }, void 0));
|
|
110
|
+
} }, void 0)] }), void 0) }), void 0), _jsx("div", __assign({ className: styles.errorMsg, style: {
|
|
99
111
|
color: formStyle.errorColor,
|
|
100
112
|
} }, { children: !!errors[step.id] && 'Este campo es obligatorio' }), void 0)] }), void 0));
|
|
101
113
|
}
|
|
@@ -108,7 +120,7 @@ function TextAreaStep(_a) {
|
|
|
108
120
|
: undefined,
|
|
109
121
|
}, shouldUnregister: true, render: function (_a) {
|
|
110
122
|
var field = _a.field;
|
|
111
|
-
return (_jsx(RoundedTextField, __assign({}, field, { label: step.label, inputRef: field.ref, required: step.required, cantEdit: postview, fontWeight: 400, multiline: true, minRows: 4, maxRows: 6, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.backgroundColor, innerBackgroundColor: formStyle.stepBackgroundColor,
|
|
123
|
+
return (_jsx(RoundedTextField, __assign({}, field, { label: step.label, inputRef: field.ref, required: step.required, cantEdit: postview, fontWeight: 400, multiline: true, minRows: 4, maxRows: 6, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.backgroundColor, innerBackgroundColor: formStyle.stepBackgroundColor, helperText: errors[step.id]
|
|
112
124
|
? errors[step.id].message
|
|
113
125
|
: step.description, error: !!errors[step.id] }), void 0));
|
|
114
126
|
} }, void 0) }), void 0));
|
package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js
CHANGED
|
@@ -37,7 +37,7 @@ function TextInputStep(_a) {
|
|
|
37
37
|
var field = _a.field;
|
|
38
38
|
return (_jsx(RoundedTextField, __assign({}, field, { label: step.label, inputRef: field.ref, cantEdit: postview, required: step.required, fontWeight: 400, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: formStyle.backgroundColor, innerBackgroundColor: formStyle.stepBackgroundColor, helperText: errors[step.id]
|
|
39
39
|
? errors[step.id].message
|
|
40
|
-
: step.description,
|
|
40
|
+
: step.description, error: !!errors[step.id] }), void 0));
|
|
41
41
|
} }, void 0) }), void 0));
|
|
42
42
|
}
|
|
43
43
|
export default TextInputStep;
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
display: flex;
|
|
3
3
|
flex-direction: column;
|
|
4
4
|
width: 900px;
|
|
5
|
+
max-width: 100%;
|
|
5
6
|
margin-bottom: 10px;
|
|
6
7
|
padding: 10px;
|
|
7
8
|
padding-bottom: 0px;
|
|
@@ -32,4 +33,5 @@
|
|
|
32
33
|
-webkit-user-select: none;
|
|
33
34
|
-ms-user-select: none;
|
|
34
35
|
user-select: none;
|
|
36
|
+
margin-bottom: 10px;
|
|
35
37
|
}
|
|
@@ -29,6 +29,16 @@
|
|
|
29
29
|
align-items: center;
|
|
30
30
|
position: relative;
|
|
31
31
|
}
|
|
32
|
+
|
|
33
|
+
.dialogContainer,
|
|
34
|
+
.dialogContainer *,
|
|
35
|
+
.dialogContainer *::after,
|
|
36
|
+
.dialogContainer *::before {
|
|
37
|
+
-webkit-box-sizing: content-box;
|
|
38
|
+
-moz-box-sizing: content-box;
|
|
39
|
+
box-sizing: content-box;
|
|
40
|
+
}
|
|
41
|
+
|
|
32
42
|
.closeIcon {
|
|
33
43
|
right: 15px;
|
|
34
44
|
top: 10px;
|
|
@@ -26,8 +26,6 @@ interface StyleProps {
|
|
|
26
26
|
shrunkenFontSize?: number | string;
|
|
27
27
|
/** Cant edit */
|
|
28
28
|
cantEdit?: boolean;
|
|
29
|
-
/** The color of the helper text when not error */
|
|
30
|
-
helperTextColor?: string;
|
|
31
29
|
}
|
|
32
30
|
interface RoundedDatePickerProps extends StyleProps {
|
|
33
31
|
/** If the calendar icon should be shown */
|
|
@@ -40,8 +40,6 @@ import React, { cloneElement } from 'react';
|
|
|
40
40
|
import { makeStyles } from '@material-ui/core/styles';
|
|
41
41
|
import CalendarTodayRoundedIcon from '@material-ui/icons/CalendarTodayRounded';
|
|
42
42
|
import { KeyboardDatePicker, } from '@material-ui/pickers';
|
|
43
|
-
import { getLocale } from '../../FormComponents/Form/Form';
|
|
44
|
-
import { format } from 'date-fns';
|
|
45
43
|
var useDatePickerStyles = function (props) {
|
|
46
44
|
return makeStyles(function () { return ({
|
|
47
45
|
root: {
|
|
@@ -119,7 +117,6 @@ var useDatePickerLabelStyles = function (props) {
|
|
|
119
117
|
var useDatePickerHelperTextStyles = function (props) {
|
|
120
118
|
return makeStyles(function () { return ({
|
|
121
119
|
root: {
|
|
122
|
-
color: props.helperTextColor,
|
|
123
120
|
'&.Mui-error': {
|
|
124
121
|
color: props.errorColor,
|
|
125
122
|
},
|
|
@@ -161,7 +158,7 @@ var useDatePickerDialogStyles = function (props) {
|
|
|
161
158
|
}); });
|
|
162
159
|
};
|
|
163
160
|
function CustomDatePicker(_a) {
|
|
164
|
-
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.outlineColor, outlineColor = _c === void 0 ? '#0000003b' : _c, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? 'white' : _d, innerBackgroundColor = _a.innerBackgroundColor, _e = _a.textColor, textColor = _e === void 0 ? '#293241' : _e, _f = _a.errorColor, errorColor = _f === void 0 ? '#cc2936' : _f, _g = _a.borderRadius, borderRadius = _g === void 0 ? 10 : _g, _h = _a.padding, padding = _h === void 0 ? '6px 12px' : _h, _j = _a.fontSize, fontSize = _j === void 0 ? '1rem' : _j, _k = _a.shrunkenFontSize, shrunkenFontSize = _k === void 0 ? '1rem' : _k, _l = _a.
|
|
161
|
+
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.outlineColor, outlineColor = _c === void 0 ? '#0000003b' : _c, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? 'white' : _d, innerBackgroundColor = _a.innerBackgroundColor, _e = _a.textColor, textColor = _e === void 0 ? '#293241' : _e, _f = _a.errorColor, errorColor = _f === void 0 ? '#cc2936' : _f, _g = _a.borderRadius, borderRadius = _g === void 0 ? 10 : _g, _h = _a.padding, padding = _h === void 0 ? '6px 12px' : _h, _j = _a.fontSize, fontSize = _j === void 0 ? '1rem' : _j, _k = _a.shrunkenFontSize, shrunkenFontSize = _k === void 0 ? '1rem' : _k, _l = _a.fontWeight, fontWeight = _l === void 0 ? '300' : _l, _m = _a.showIcon, showIcon = _m === void 0 ? true : _m, _o = _a.cantEdit, cantEdit = _o === void 0 ? false : _o, onChange = _a.onChange, required = _a.required, others = __rest(_a, ["focusColor", "outlineColor", "backgroundColor", "innerBackgroundColor", "textColor", "errorColor", "borderRadius", "padding", "fontSize", "shrunkenFontSize", "fontWeight", "showIcon", "cantEdit", "onChange", "required"]);
|
|
165
162
|
var classes = useDatePickerStyles({
|
|
166
163
|
padding: padding,
|
|
167
164
|
cantEdit: cantEdit,
|
|
@@ -176,7 +173,6 @@ function CustomDatePicker(_a) {
|
|
|
176
173
|
fontSize: fontSize,
|
|
177
174
|
shrunkenFontSize: shrunkenFontSize,
|
|
178
175
|
fontWeight: fontWeight,
|
|
179
|
-
helperTextColor: helperTextColor,
|
|
180
176
|
})();
|
|
181
177
|
var labelClasses = useDatePickerLabelStyles({
|
|
182
178
|
padding: padding,
|
|
@@ -192,7 +188,6 @@ function CustomDatePicker(_a) {
|
|
|
192
188
|
fontSize: fontSize,
|
|
193
189
|
shrunkenFontSize: shrunkenFontSize,
|
|
194
190
|
fontWeight: fontWeight,
|
|
195
|
-
helperTextColor: helperTextColor,
|
|
196
191
|
})();
|
|
197
192
|
var datePicker = useDatePickerDialogStyles({
|
|
198
193
|
padding: padding,
|
|
@@ -208,7 +203,6 @@ function CustomDatePicker(_a) {
|
|
|
208
203
|
fontSize: fontSize,
|
|
209
204
|
shrunkenFontSize: shrunkenFontSize,
|
|
210
205
|
fontWeight: fontWeight,
|
|
211
|
-
helperTextColor: helperTextColor,
|
|
212
206
|
})().datePicker;
|
|
213
207
|
var helperTextStyles = useDatePickerHelperTextStyles({
|
|
214
208
|
padding: padding,
|
|
@@ -222,9 +216,8 @@ function CustomDatePicker(_a) {
|
|
|
222
216
|
fontSize: fontSize,
|
|
223
217
|
shrunkenFontSize: shrunkenFontSize,
|
|
224
218
|
fontWeight: fontWeight,
|
|
225
|
-
helperTextColor: helperTextColor,
|
|
226
219
|
})();
|
|
227
|
-
return (_jsx(KeyboardDatePicker, __assign({}, others, { inputVariant: "outlined", size: "small", disabled: cantEdit, fullWidth: true, onChange: onChange, placeholder:
|
|
220
|
+
return (_jsx(KeyboardDatePicker, __assign({}, others, { inputVariant: "outlined", size: "small", disabled: cantEdit, fullWidth: true, onChange: onChange, placeholder: "PPP", format: "PPP", required: required, keyboardIcon: showIcon ? (_jsx(CalendarTodayRoundedIcon, { fontSize: "inherit" }, void 0)) : null, InputLabelProps: { classes: labelClasses }, DialogProps: {
|
|
228
221
|
disableEnforceFocus: true,
|
|
229
222
|
className: datePicker,
|
|
230
223
|
cancelLabel: '',
|
|
@@ -1,22 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SelectProps } from '@material-ui/core/Select';
|
|
3
|
-
interface
|
|
4
|
-
/** The color of the helper text when not error */
|
|
5
|
-
helperTextColor?: string;
|
|
6
|
-
/** The color of the outline when selected and hovered on */
|
|
7
|
-
focusColor?: string;
|
|
8
|
-
/** The color of the outline when it is not selected */
|
|
9
|
-
outlineColor?: string;
|
|
10
|
-
/** The color of the error to display */
|
|
11
|
-
errorColor?: string;
|
|
12
|
-
/** If the style should change on hover */
|
|
13
|
-
cantEdit?: boolean;
|
|
14
|
-
/** The hight of the container */
|
|
15
|
-
height?: string;
|
|
16
|
-
/** The color of the text in the form */
|
|
17
|
-
color?: string;
|
|
18
|
-
}
|
|
19
|
-
interface RoundedSelectProps extends Omit<SelectProps, 'color'>, ColorProps {
|
|
3
|
+
interface RoundedSelectProps extends Omit<SelectProps, 'color'> {
|
|
20
4
|
/** children to display in the options */
|
|
21
5
|
children?: any;
|
|
22
6
|
/** Currently selected value */
|
|
@@ -26,16 +10,26 @@ interface RoundedSelectProps extends Omit<SelectProps, 'color'>, ColorProps {
|
|
|
26
10
|
name?: string | undefined;
|
|
27
11
|
value: any;
|
|
28
12
|
}>, child?: React.ReactNode) => void;
|
|
13
|
+
/** The hight of the container */
|
|
14
|
+
height?: string;
|
|
29
15
|
/** Strig to place in the label */
|
|
30
16
|
label: string;
|
|
31
17
|
/** Minimum width in px of the component */
|
|
32
18
|
minWidth?: number;
|
|
33
19
|
/** The color of the outline when selected and hovered on */
|
|
34
20
|
focusColor?: string;
|
|
21
|
+
/** The color of the error to display */
|
|
22
|
+
errorColor?: string;
|
|
23
|
+
/** the color of the text */
|
|
24
|
+
color?: string;
|
|
25
|
+
/** The color of the outline when it is not selected */
|
|
26
|
+
outlineColor?: string;
|
|
35
27
|
/** If outline should be error color */
|
|
36
28
|
highlightError?: boolean;
|
|
37
29
|
/** The helper Text to display */
|
|
38
30
|
helperText?: string;
|
|
31
|
+
/** If the selector cant be opened, diabled but with same style */
|
|
32
|
+
cantEdit?: boolean;
|
|
39
33
|
/** the margin around the selector */
|
|
40
34
|
containerMargin?: string;
|
|
41
35
|
}
|
|
@@ -98,9 +98,14 @@ var useLabelInputStyles = function (props) {
|
|
|
98
98
|
color: props.focusColor + ' !important',
|
|
99
99
|
},
|
|
100
100
|
root: {
|
|
101
|
+
whiteSpace: 'nowrap',
|
|
102
|
+
overflow: 'hidden',
|
|
103
|
+
maxWidth: 'calc(100% - 45px)',
|
|
104
|
+
textOverflow: 'ellipsis',
|
|
101
105
|
marginTop: props.height != '40px' ? '-4px' : '0px',
|
|
102
106
|
'&.EF-MuiInputLabel-shrink': {
|
|
103
107
|
marginTop: '0px',
|
|
108
|
+
maxWidth: 'calc(125% - 30px)',
|
|
104
109
|
},
|
|
105
110
|
'& .Mui-error': {
|
|
106
111
|
color: props.errorColor,
|
|
@@ -114,7 +119,6 @@ var useLabelInputStyles = function (props) {
|
|
|
114
119
|
var useHelperTextStyles = function (props) {
|
|
115
120
|
return makeStyles(function () { return ({
|
|
116
121
|
root: {
|
|
117
|
-
color: props.helperTextColor,
|
|
118
122
|
'&.Mui-error': {
|
|
119
123
|
color: props.errorColor,
|
|
120
124
|
},
|
|
@@ -122,37 +126,34 @@ var useHelperTextStyles = function (props) {
|
|
|
122
126
|
}); });
|
|
123
127
|
};
|
|
124
128
|
function CustomSelect(_a) {
|
|
125
|
-
var children = _a.children, value = _a.value, handleUpdate = _a.handleUpdate, label = _a.label, minWidth = _a.minWidth, helperText = _a.helperText, _b = _a.color, color = _b === void 0 ? '#293241' : _b, _c = _a.errorColor, errorColor = _c === void 0 ? '#cc2936' : _c, _d = _a.focusColor, focusColor = _d === void 0 ? '#3d5a7f' : _d, _e = _a.outlineColor, outlineColor = _e === void 0 ? '#0000003b' : _e, _f = _a.
|
|
129
|
+
var children = _a.children, value = _a.value, handleUpdate = _a.handleUpdate, label = _a.label, minWidth = _a.minWidth, helperText = _a.helperText, _b = _a.color, color = _b === void 0 ? '#293241' : _b, _c = _a.errorColor, errorColor = _c === void 0 ? '#cc2936' : _c, _d = _a.focusColor, focusColor = _d === void 0 ? '#3d5a7f' : _d, _e = _a.outlineColor, outlineColor = _e === void 0 ? '#0000003b' : _e, _f = _a.cantEdit, cantEdit = _f === void 0 ? false : _f, _g = _a.containerMargin, containerMargin = _g === void 0 ? '8px' : _g, _h = _a.height, height = _h === void 0 ? '40px' : _h, required = _a.required, error = _a.error, others = __rest(_a, ["children", "value", "handleUpdate", "label", "minWidth", "helperText", "color", "errorColor", "focusColor", "outlineColor", "cantEdit", "containerMargin", "height", "required", "error"]);
|
|
126
130
|
var classes = useStyles();
|
|
127
131
|
var outlinedInputClasses = useOutlinedInputStyles({
|
|
128
|
-
helperTextColor: helperTextColor,
|
|
129
|
-
outlineColor: outlineColor,
|
|
130
|
-
errorColor: errorColor,
|
|
131
132
|
focusColor: focusColor,
|
|
133
|
+
outlineColor: outlineColor,
|
|
132
134
|
cantEdit: cantEdit,
|
|
133
|
-
height: height,
|
|
134
135
|
color: color,
|
|
136
|
+
errorColor: errorColor,
|
|
137
|
+
height: height,
|
|
135
138
|
})();
|
|
136
139
|
var labelClasses = useLabelInputStyles({
|
|
137
|
-
|
|
140
|
+
focusColor: focusColor,
|
|
138
141
|
outlineColor: outlineColor,
|
|
139
142
|
errorColor: errorColor,
|
|
140
|
-
|
|
143
|
+
color: color,
|
|
141
144
|
cantEdit: cantEdit,
|
|
142
145
|
height: height,
|
|
143
|
-
color: color,
|
|
144
146
|
})();
|
|
145
147
|
var helperTextClasses = useHelperTextStyles({
|
|
146
|
-
|
|
148
|
+
focusColor: focusColor,
|
|
147
149
|
outlineColor: outlineColor,
|
|
148
150
|
errorColor: errorColor,
|
|
149
|
-
focusColor: focusColor,
|
|
150
151
|
cantEdit: cantEdit,
|
|
151
|
-
height: height,
|
|
152
152
|
color: color,
|
|
153
|
+
height: height,
|
|
153
154
|
})();
|
|
154
155
|
var inputLabel = React.useRef();
|
|
155
|
-
var
|
|
156
|
+
var _j = React.useState(0), labelWidth = _j[0], setLabelWidth = _j[1];
|
|
156
157
|
useEffect(function () {
|
|
157
158
|
setLabelWidth(inputLabel.current.offsetWidth);
|
|
158
159
|
}, [label]);
|
|
@@ -96,14 +96,11 @@ var useTextfieldStyles = function (props) {
|
|
|
96
96
|
'& .Mui-error': {
|
|
97
97
|
color: props.errorColor,
|
|
98
98
|
},
|
|
99
|
-
'& .EF-MuiFormHelperText-root': {
|
|
100
|
-
color: props.helperTextColor,
|
|
101
|
-
},
|
|
102
99
|
},
|
|
103
100
|
}); });
|
|
104
101
|
};
|
|
105
102
|
function CustomTextfield(_a) {
|
|
106
|
-
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.
|
|
103
|
+
var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.outlineColor, outlineColor = _c === void 0 ? '#0000003b' : _c, _d = _a.backgroundColor, backgroundColor = _d === void 0 ? 'white' : _d, innerBackgroundColor = _a.innerBackgroundColor, _e = _a.textColor, textColor = _e === void 0 ? '#293241' : _e, _f = _a.readOnly, readOnly = _f === void 0 ? false : _f, _g = _a.borderRadius, borderRadius = _g === void 0 ? 10 : _g, _h = _a.padding, padding = _h === void 0 ? '6px 12px' : _h, _j = _a.fontSize, fontSize = _j === void 0 ? '1rem' : _j, _k = _a.shrunkenFontSize, shrunkenFontSize = _k === void 0 ? '1rem' : _k, _l = _a.errorColor, errorColor = _l === void 0 ? '#cc2936' : _l, _m = _a.fontWeight, fontWeight = _m === void 0 ? '300' : _m, _o = _a.multiline, multiline = _o === void 0 ? false : _o, _p = _a.cantEdit, cantEdit = _p === void 0 ? false : _p, others = __rest(_a, ["focusColor", "outlineColor", "backgroundColor", "innerBackgroundColor", "textColor", "readOnly", "borderRadius", "padding", "fontSize", "shrunkenFontSize", "errorColor", "fontWeight", "multiline", "cantEdit"]);
|
|
107
104
|
var classes = useTextfieldStyles({
|
|
108
105
|
padding: padding,
|
|
109
106
|
textColor: textColor,
|
|
@@ -111,7 +108,6 @@ function CustomTextfield(_a) {
|
|
|
111
108
|
focusColor: focusColor,
|
|
112
109
|
outlineColor: outlineColor,
|
|
113
110
|
innerBackgroundColor: innerBackgroundColor !== null && innerBackgroundColor !== void 0 ? innerBackgroundColor : backgroundColor,
|
|
114
|
-
helperTextColor: helperTextColor,
|
|
115
111
|
backgroundColor: backgroundColor,
|
|
116
112
|
borderRadius: borderRadius,
|
|
117
113
|
readOnly: readOnly,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@arquimedes.co/eureka-forms",
|
|
3
3
|
"repository": "git://github.com/Arquimede5/Eureka-Forms.git",
|
|
4
|
-
"version":"0.2.40
|
|
4
|
+
"version": "0.2.40",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "react-scripts start",
|
|
7
7
|
"build": "react-scripts build",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"date-fns": "^2.23.0",
|
|
22
22
|
"draft-js": "^0.11.7",
|
|
23
23
|
"react-draft-wysiwyg": "^1.14.7",
|
|
24
|
-
"react-hook-form": "
|
|
24
|
+
"react-hook-form": "7.18.1",
|
|
25
25
|
"react-router-dom": "^5.2.0",
|
|
26
26
|
"react-scripts": "5.0.0-next.37",
|
|
27
27
|
"typescript": "^4.4.3"
|
|
@@ -66,7 +66,13 @@
|
|
|
66
66
|
},
|
|
67
67
|
"peerDependencies": {
|
|
68
68
|
"react": "^17.x.x",
|
|
69
|
-
"react-dom": "^17.x.x"
|
|
69
|
+
"react-dom": "^17.x.x",
|
|
70
|
+
"axios": "^0.21.x",
|
|
71
|
+
"date-fns": "^2.23.x",
|
|
72
|
+
"draft-js": "^0.11.x",
|
|
73
|
+
"react-draft-wysiwyg": "^1.14.x",
|
|
74
|
+
"react-hook-form": "^7.6.4",
|
|
75
|
+
"react-router-dom": "^5.2.0"
|
|
70
76
|
},
|
|
71
77
|
"publishConfig": {
|
|
72
78
|
"access": "public"
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
import { CheckBox } from '../../../@Types/FormStep';
|
|
3
|
-
import { StepProps } from '../Step';
|
|
4
|
-
export interface CheckBoxStepProps extends StepProps {
|
|
5
|
-
/** The CheckboxStep to display */
|
|
6
|
-
step: CheckBox;
|
|
7
|
-
}
|
|
8
|
-
declare function CheckboxStep({ formStyle, ...others }: CheckBoxStepProps): JSX.Element;
|
|
9
|
-
export default CheckboxStep;
|
|
@@ -1,37 +0,0 @@
|
|
|
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 MaterialCheckBoxStep from './MaterialCheckBoxStep/MaterialCheckBoxStep';
|
|
26
|
-
function CheckboxStep(_a) {
|
|
27
|
-
var formStyle = _a.formStyle, others = __rest(_a, ["formStyle"]);
|
|
28
|
-
switch (formStyle.type) {
|
|
29
|
-
case FormStyleTypes.MATERIAL: {
|
|
30
|
-
return _jsx(MaterialCheckBoxStep, __assign({ formStyle: formStyle }, others), void 0);
|
|
31
|
-
}
|
|
32
|
-
default: {
|
|
33
|
-
return _jsx(MaterialCheckBoxStep, __assign({ formStyle: formStyle }, others), void 0);
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
export default CheckboxStep;
|
|
@@ -1,40 +0,0 @@
|
|
|
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
|
-
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
13
|
-
import styles from './MaterialCheckBoxStep.module.css';
|
|
14
|
-
import { calcStepWidth } from '../../StepFunctions';
|
|
15
|
-
import RoundedCheckBox from '../../../../shared/RoundedCheckBox/RoundedCheckBox';
|
|
16
|
-
import { Controller } from 'react-hook-form';
|
|
17
|
-
function CheckBoxStep(_a) {
|
|
18
|
-
var step = _a.step, form = _a.form, errors = _a.errors, control = _a.control, postview = _a.postview, formStyle = _a.formStyle, widthStats = _a.widthStats;
|
|
19
|
-
return (_jsxs("div", __assign({ className: styles.container, style: {
|
|
20
|
-
width: widthStats.currentBreakPoint <= step.size
|
|
21
|
-
? '100%'
|
|
22
|
-
: calcStepWidth(step.size, form),
|
|
23
|
-
maxWidth: '100%',
|
|
24
|
-
minHeight: step.description || step.required ? '55px' : '43px',
|
|
25
|
-
} }, { children: [_jsxs("div", __assign({ className: styles.labelCheckBoxContainer }, { children: [_jsxs("div", __assign({ className: styles.checkboxLbl }, { children: [step.label, step.required ? ' *' : '', ":"] }), void 0), _jsx(Controller, { name: step.id, control: control, defaultValue: false, rules: {
|
|
26
|
-
required: step.required
|
|
27
|
-
? 'Este campo es obligatorio'
|
|
28
|
-
: undefined,
|
|
29
|
-
}, shouldUnregister: true, render: function (_a) {
|
|
30
|
-
var field = _a.field;
|
|
31
|
-
return (_jsx(RoundedCheckBox, __assign({}, field, { inputRef: field.ref, padding: "0px", size: "1.6rem", cantEdit: postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: field.value }), void 0));
|
|
32
|
-
} }, void 0)] }), void 0), (step.description || !!errors[step.id]) && (_jsx("div", __assign({ className: styles.descriptionPar, style: {
|
|
33
|
-
color: !!errors[step.id]
|
|
34
|
-
? formStyle.errorColor
|
|
35
|
-
: formStyle.descriptionTextColor,
|
|
36
|
-
} }, { children: !!errors[step.id]
|
|
37
|
-
? 'Este campo es obligatorio'
|
|
38
|
-
: step.description }), void 0))] }), void 0));
|
|
39
|
-
}
|
|
40
|
-
export default CheckBoxStep;
|
package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css
DELETED
|
@@ -1,37 +0,0 @@
|
|
|
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
|
-
flex-direction: column;
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
.checkboxLbl {
|
|
13
|
-
font-size: 18px;
|
|
14
|
-
margin-right: 10px;
|
|
15
|
-
margin-left: 10px;
|
|
16
|
-
white-space: nowrap;
|
|
17
|
-
overflow: hidden;
|
|
18
|
-
text-overflow: ellipsis;
|
|
19
|
-
}
|
|
20
|
-
.labelCheckBoxContainer {
|
|
21
|
-
display: flex;
|
|
22
|
-
align-items: center;
|
|
23
|
-
flex-direction: row;
|
|
24
|
-
align-items: center;
|
|
25
|
-
height: 31px;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
.descriptionPar {
|
|
29
|
-
font-size: 0.75rem;
|
|
30
|
-
margin-left: 14px;
|
|
31
|
-
margin-top: 4px;
|
|
32
|
-
font-weight: 400;
|
|
33
|
-
line-height: 1.66;
|
|
34
|
-
max-width: 100%;
|
|
35
|
-
overflow: hidden;
|
|
36
|
-
text-overflow: ellipsis;
|
|
37
|
-
}
|