@arquimedes.co/eureka-forms 1.9.2 → 1.9.3-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 +56 -11
- package/dist/FormComponents/Form/ColumnForm/ColumnForm.module.css +4 -0
- package/dist/FormComponents/Form/EntradasAmarillasDialog/ConfirmationDialog.d.ts +13 -0
- package/dist/FormComponents/Form/EntradasAmarillasDialog/ConfirmationDialog.js +61 -0
- package/dist/FormComponents/Form/EntradasAmarillasDialog/ConfirmationDialog.module.css +80 -0
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.d.ts +1 -1
- package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +5 -2
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -1
- package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +2 -2
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +1 -1
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +2 -2
- package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.module.css +0 -3
- package/package.json +3 -1
|
@@ -57,7 +57,8 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
57
57
|
return t;
|
|
58
58
|
};
|
|
59
59
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
60
|
-
import { useEffect, useState } from 'react';
|
|
60
|
+
import { useEffect, useRef, useState } from 'react';
|
|
61
|
+
import ReCAPTCHA from 'react-google-recaptcha';
|
|
61
62
|
import SectionComponent from '../../Section/Section';
|
|
62
63
|
import { useForm } from 'react-hook-form';
|
|
63
64
|
import styles from './ColumnForm.module.css';
|
|
@@ -65,9 +66,11 @@ import Types from '../../../constants/FormStepTypes';
|
|
|
65
66
|
import { convertToRaw } from 'draft-js';
|
|
66
67
|
import TermComponent from '../../Term/Term';
|
|
67
68
|
import ConfirmationDialog from '../ConfirmationDialog/ConfirmationDialog';
|
|
69
|
+
import EntradasConfirmationDialog from '../EntradasAmarillasDialog/ConfirmationDialog';
|
|
68
70
|
import Loader from '../../../shared/Loader/Loader';
|
|
69
71
|
import axiosInstance from '../../../AxiosAPI';
|
|
70
72
|
import widgetInstance from '../../../AxiosWidget';
|
|
73
|
+
import React from 'react';
|
|
71
74
|
function ColumnForm(_a) {
|
|
72
75
|
var _this = this;
|
|
73
76
|
var form = _a.form, apiKey = _a.apiKey, reload = _a.reload, domain = _a.domain, postview = _a.postview, internal = _a.internal, formStyle = _a.formStyle, sendLabel = _a.sendLabel, widthStats = _a.widthStats, customSteps = _a.customSteps, customSend = _a.customSend, handleLoaded = _a.handleLoaded, originalValues = _a.originalValues, others = __rest(_a, ["form", "apiKey", "reload", "domain", "postview", "internal", "formStyle", "sendLabel", "widthStats", "customSteps", "customSend", "handleLoaded", "originalValues"]);
|
|
@@ -78,9 +81,11 @@ function ColumnForm(_a) {
|
|
|
78
81
|
mode: 'onTouched',
|
|
79
82
|
shouldFocusError: true,
|
|
80
83
|
}), getValues = _d.getValues, setValue = _d.setValue, clearErrors = _d.clearErrors, control = _d.control, errors = _d.formState.errors, trigger = _d.trigger;
|
|
84
|
+
var recaptchaRef = useRef();
|
|
81
85
|
var _e = useState(undefined), sections = _e[0], setSections = _e[1];
|
|
82
86
|
var _f = useState(false), loading = _f[0], setLoading = _f[1];
|
|
83
87
|
var _g = useState(), showConfirmation = _g[0], setShowConfirmation = _g[1];
|
|
88
|
+
var _h = useState(), showEntradasConfirmation = _h[0], setShowEntradasConfirmation = _h[1];
|
|
84
89
|
useEffect(function () {
|
|
85
90
|
var tempSections = [];
|
|
86
91
|
calcNextSection(form, form.firstSection, tempSections);
|
|
@@ -90,7 +95,7 @@ function ColumnForm(_a) {
|
|
|
90
95
|
if (sections === undefined) {
|
|
91
96
|
return _jsx("div", {}, void 0);
|
|
92
97
|
}
|
|
93
|
-
var onSubmit = function () { return __awaiter(_this, void 0, void 0, function () {
|
|
98
|
+
var onSubmit = function (token) { return __awaiter(_this, void 0, void 0, function () {
|
|
94
99
|
var valid, values, _i, _a, idStep, payload, url, resp, _b, error_1;
|
|
95
100
|
return __generator(this, function (_c) {
|
|
96
101
|
switch (_c.label) {
|
|
@@ -123,6 +128,9 @@ function ColumnForm(_a) {
|
|
|
123
128
|
payload = {
|
|
124
129
|
formValues: { steps: values },
|
|
125
130
|
};
|
|
131
|
+
if (token) {
|
|
132
|
+
payload.token = token;
|
|
133
|
+
}
|
|
126
134
|
url = "/ticket/" + (internal ? form.apiKey : apiKey);
|
|
127
135
|
if (!(domain || internal)) return [3 /*break*/, 6];
|
|
128
136
|
return [4 /*yield*/, widgetInstance.post(url + "?idOrganization=" + domain, payload)];
|
|
@@ -135,7 +143,14 @@ function ColumnForm(_a) {
|
|
|
135
143
|
_c.label = 8;
|
|
136
144
|
case 8:
|
|
137
145
|
resp = _b;
|
|
138
|
-
|
|
146
|
+
if (others.organization.idOrganization ===
|
|
147
|
+
'entradasamarillas' &&
|
|
148
|
+
form.apiKey === 'precarga') {
|
|
149
|
+
setShowEntradasConfirmation(resp === null || resp === void 0 ? void 0 : resp.data);
|
|
150
|
+
}
|
|
151
|
+
else {
|
|
152
|
+
setShowConfirmation(resp === null || resp === void 0 ? void 0 : resp.data);
|
|
153
|
+
}
|
|
139
154
|
_c.label = 9;
|
|
140
155
|
case 9:
|
|
141
156
|
setLoading(false);
|
|
@@ -152,19 +167,49 @@ function ColumnForm(_a) {
|
|
|
152
167
|
return (_jsxs("div", __assign({ className: styles.container, style: { color: formStyle.textColor } }, { children: [loading && _jsx("div", { className: styles.curtain }, void 0), showConfirmation !== undefined && (_jsx(ConfirmationDialog, { formStyle: formStyle, confirmation: showConfirmation, onClose: function () {
|
|
153
168
|
reload();
|
|
154
169
|
setShowConfirmation(undefined);
|
|
170
|
+
} }, void 0)), showEntradasConfirmation !== undefined && (_jsx(EntradasConfirmationDialog, { formStyle: formStyle, widthStats: widthStats, confirmation: showEntradasConfirmation, onClose: function () {
|
|
171
|
+
reload();
|
|
172
|
+
setShowEntradasConfirmation(undefined);
|
|
155
173
|
} }, void 0)), sections.map(function (idSection, index) { return (_jsx(SectionComponent, __assign({ form: form, domain: domain, postview: postview, clearErrors: clearErrors, widthStats: widthStats, control: control, getValues: getValues, originalValues: originalValues, errors: errors, index: index, setSections: setSections, section: form.sections[idSection], formStyle: formStyle, customSteps: customSteps, setDependencyStore: setDependencyStore, dependencyStore: dependencyStore, trigger: trigger }, others), index)); }), form.terms &&
|
|
156
174
|
(!internal || (internal && postview)) &&
|
|
157
175
|
(originalValues === null || originalValues === void 0 ? void 0 : originalValues['INTERNAL_CREATING_AGENT']) === undefined && (_jsx("div", __assign({ className: styles.termsContainer, style: {
|
|
158
176
|
width: (form.size.blockSize + form.size.spacingSize) *
|
|
159
177
|
form.size.blockNum,
|
|
160
|
-
} }, { children: form.terms.map(function (term, index) { return (_jsx(TermComponent, { setValue: setValue, postview: postview, tempError: tempError, term: term, control: control, errors: errors, form: form, formStyle: formStyle }, index)); }) }), void 0)), !postview && (_jsx("div", __assign({ className: styles.submitBtnContainer }, { children: _jsxs("button", __assign({ "data-testid": "form__submit", className: styles.submitBtn, onClick: function () {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
178
|
+
} }, { children: form.terms.map(function (term, index) { return (_jsx(TermComponent, { setValue: setValue, postview: postview, tempError: tempError, term: term, control: control, errors: errors, form: form, formStyle: formStyle }, index)); }) }), void 0)), !postview && (_jsxs(React.Fragment, { children: [form.hasCaptcha && !internal && (_jsx(ReCAPTCHA, { ref: recaptchaRef, sitekey: "6LcL22kkAAAAAEotDeAFbRATob-u5vbibbCyWL2p", size: 'invisible', badge: 'bottomright' }, void 0)), _jsx("div", __assign({ className: styles.submitBtnContainer }, { children: _jsxs("button", __assign({ "data-testid": "form__submit", className: styles.submitBtn, onClick: function () { return __awaiter(_this, void 0, void 0, function () {
|
|
179
|
+
var valid, captcha;
|
|
180
|
+
return __generator(this, function (_a) {
|
|
181
|
+
switch (_a.label) {
|
|
182
|
+
case 0:
|
|
183
|
+
if (!(form.hasCaptcha && !internal)) return [3 /*break*/, 5];
|
|
184
|
+
return [4 /*yield*/, trigger(undefined, {
|
|
185
|
+
shouldFocus: true,
|
|
186
|
+
})];
|
|
187
|
+
case 1:
|
|
188
|
+
valid = _a.sent();
|
|
189
|
+
if (!valid) return [3 /*break*/, 4];
|
|
190
|
+
captcha = recaptchaRef.current.getValue();
|
|
191
|
+
if (!!captcha) return [3 /*break*/, 3];
|
|
192
|
+
return [4 /*yield*/, (recaptchaRef === null || recaptchaRef === void 0 ? void 0 : recaptchaRef.current.executeAsync())];
|
|
193
|
+
case 2:
|
|
194
|
+
captcha =
|
|
195
|
+
_a.sent();
|
|
196
|
+
_a.label = 3;
|
|
197
|
+
case 3:
|
|
198
|
+
onSubmit(captcha);
|
|
199
|
+
_a.label = 4;
|
|
200
|
+
case 4: return [3 /*break*/, 6];
|
|
201
|
+
case 5:
|
|
202
|
+
onSubmit();
|
|
203
|
+
_a.label = 6;
|
|
204
|
+
case 6: return [2 /*return*/];
|
|
205
|
+
}
|
|
206
|
+
});
|
|
207
|
+
}); }, style: {
|
|
208
|
+
background: formStyle.primaryColor,
|
|
209
|
+
color: formStyle.primaryContrastColor,
|
|
210
|
+
}, disabled: loading }, { children: [_jsx("div", __assign({ style: {
|
|
211
|
+
visibility: loading ? 'hidden' : 'visible',
|
|
212
|
+
} }, { children: sendLabel !== null && sendLabel !== void 0 ? sendLabel : 'Enviar' }), void 0), loading && (_jsx("div", __assign({ className: styles.loaderContainer }, { children: _jsx(Loader, { color: formStyle.primaryContrastColor, position: "unset" }, void 0) }), void 0))] }), void 0) }), void 0)] }, void 0))] }), void 0));
|
|
168
213
|
}
|
|
169
214
|
export default ColumnForm;
|
|
170
215
|
function calcNextSection(form, idSection, sections) {
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FormStyle } from '../../../@Types/Form';
|
|
3
|
+
import { WidthStats } from '../Form';
|
|
4
|
+
interface ConfirmationDialogProps {
|
|
5
|
+
confirmation: {
|
|
6
|
+
code: string;
|
|
7
|
+
};
|
|
8
|
+
onClose: Function;
|
|
9
|
+
formStyle: FormStyle;
|
|
10
|
+
widthStats: WidthStats;
|
|
11
|
+
}
|
|
12
|
+
declare function ConfirmationDialog({ confirmation, widthStats, formStyle, onClose, }: ConfirmationDialogProps): JSX.Element;
|
|
13
|
+
export default ConfirmationDialog;
|
|
@@ -0,0 +1,61 @@
|
|
|
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 { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
|
+
import CheckCircleOutlineRoundedIcon from '@material-ui/icons/CheckCircleOutlineRounded';
|
|
14
|
+
import styles from './ConfirmationDialog.module.css';
|
|
15
|
+
import Dialog from '@material-ui/core/Dialog';
|
|
16
|
+
import CloseRoundedIcon from '@material-ui/icons/CloseRounded';
|
|
17
|
+
import { useRef } from 'react';
|
|
18
|
+
import RoundedButton from '../../../shared/RoundedButton/RoundedButton';
|
|
19
|
+
import { Link } from '@material-ui/core';
|
|
20
|
+
function ConfirmationDialog(_a) {
|
|
21
|
+
var confirmation = _a.confirmation, widthStats = _a.widthStats, formStyle = _a.formStyle, onClose = _a.onClose;
|
|
22
|
+
var urlRef = useRef(null);
|
|
23
|
+
var copyRef = useRef(null);
|
|
24
|
+
return (_jsx(Dialog, __assign({ PaperProps: {
|
|
25
|
+
style: {
|
|
26
|
+
borderRadius: '20px',
|
|
27
|
+
maxWidth: '100vw',
|
|
28
|
+
boxSizing: 'content-box',
|
|
29
|
+
},
|
|
30
|
+
}, open: true }, { children: _jsxs("div", __assign({ className: styles.confirmationContainer, style: { color: formStyle.textColor } }, { children: [_jsx("div", __assign({ className: styles.closeIcon, onClick: function () {
|
|
31
|
+
onClose();
|
|
32
|
+
} }, { children: _jsx(CloseRoundedIcon, { fontSize: "inherit" }, void 0) }), void 0), _jsxs("div", __assign({ className: styles.container }, { children: [_jsx("div", __assign({ className: styles.checkContainer, style: { color: formStyle.secondaryColor } }, { children: _jsx(CheckCircleOutlineRoundedIcon, { fontSize: "inherit", style: { fontSize: '160px' } }, void 0) }), void 0), _jsxs("div", __assign({ className: styles.messageContainer, style: widthStats.isMobile
|
|
33
|
+
? {
|
|
34
|
+
margin: '0px 20px',
|
|
35
|
+
}
|
|
36
|
+
: {} }, { children: ["Tu c\u00F3digo de precarga es:", _jsxs("div", __assign({ className: styles.codeContainer, style: {
|
|
37
|
+
flexDirection: widthStats.isMobile
|
|
38
|
+
? 'column'
|
|
39
|
+
: 'row',
|
|
40
|
+
} }, { children: [_jsx("input", { value: confirmation.code, className: styles.codeInput, ref: urlRef, readOnly: true, style: widthStats.isMobile
|
|
41
|
+
? {
|
|
42
|
+
color: formStyle.textColor,
|
|
43
|
+
fontWeight: 'bold',
|
|
44
|
+
maxWidth: '100%',
|
|
45
|
+
width: '100%',
|
|
46
|
+
marginLeft: '0px',
|
|
47
|
+
marginBottom: '15px',
|
|
48
|
+
}
|
|
49
|
+
: {
|
|
50
|
+
color: formStyle.textColor,
|
|
51
|
+
fontWeight: 'bold',
|
|
52
|
+
} }, void 0), _jsx("div", __assign({ className: styles.copyLink }, { children: _jsx(RoundedButton, { text: 'Copiar', color: formStyle.primaryContrastColor, backgroundColor: '#afafaf', fontSize: '1rem', padding: '2px 5px 2px 5px', onClick: function () {
|
|
53
|
+
var _a, _b, _c;
|
|
54
|
+
(_a = urlRef.current) === null || _a === void 0 ? void 0 : _a.select();
|
|
55
|
+
/* For mobile devices */
|
|
56
|
+
(_b = urlRef.current) === null || _b === void 0 ? void 0 : _b.setSelectionRange(0, 99999);
|
|
57
|
+
document.execCommand('copy');
|
|
58
|
+
(_c = copyRef.current) === null || _c === void 0 ? void 0 : _c.focus();
|
|
59
|
+
} }, void 0) }), void 0)] }), void 0)] }), void 0), _jsx("div", __assign({ className: styles.btnContainer }, { children: _jsx(Link, __assign({ href: "https://www.entradasamarillas.com/", target: "_blank", rel: "noopener" }, { children: _jsx(RoundedButton, { text: 'Precargar', color: formStyle.primaryContrastColor, backgroundColor: formStyle.primaryColor, fontSize: '1.2rem', padding: '5px 15px 5px 15px', onClick: function () { } }, void 0) }), void 0) }), void 0)] }), void 0)] }), void 0) }), void 0));
|
|
60
|
+
}
|
|
61
|
+
export default ConfirmationDialog;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
.confirmationContainer {
|
|
2
|
+
display: flex;
|
|
3
|
+
flex-direction: column;
|
|
4
|
+
width: fit-content;
|
|
5
|
+
max-height: 80vh;
|
|
6
|
+
max-width: 80vw;
|
|
7
|
+
position: relative;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
.container {
|
|
11
|
+
max-height: 100%;
|
|
12
|
+
display: flex;
|
|
13
|
+
flex-direction: column;
|
|
14
|
+
overflow: hidden;
|
|
15
|
+
overflow-y: auto;
|
|
16
|
+
}
|
|
17
|
+
.confirmationContainer,
|
|
18
|
+
.confirmationContainer *,
|
|
19
|
+
.confirmationContainer *::after,
|
|
20
|
+
.confirmationContainer *::before {
|
|
21
|
+
-webkit-box-sizing: content-box;
|
|
22
|
+
-moz-box-sizing: content-box;
|
|
23
|
+
box-sizing: content-box;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
.checkContainer {
|
|
27
|
+
margin-left: auto;
|
|
28
|
+
margin-right: auto;
|
|
29
|
+
padding-top: 30px;
|
|
30
|
+
height: fit-content;
|
|
31
|
+
margin-bottom: 10px;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
.messageContainer {
|
|
35
|
+
margin-left: 40px;
|
|
36
|
+
margin-right: 40px;
|
|
37
|
+
font-size: 1.6rem;
|
|
38
|
+
text-align: center;
|
|
39
|
+
}
|
|
40
|
+
.closeIcon {
|
|
41
|
+
right: 15px;
|
|
42
|
+
top: 10px;
|
|
43
|
+
font-size: 26px;
|
|
44
|
+
position: absolute;
|
|
45
|
+
cursor: pointer;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
.copyLink {
|
|
49
|
+
padding-left: 5px;
|
|
50
|
+
padding-right: 5px;
|
|
51
|
+
display: flex;
|
|
52
|
+
justify-content: center;
|
|
53
|
+
align-items: center;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
.codeContainer {
|
|
57
|
+
display: flex;
|
|
58
|
+
flex-direction: row;
|
|
59
|
+
justify-content: center;
|
|
60
|
+
margin-top: 20px;
|
|
61
|
+
margin-bottom: 20px;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.codeInput {
|
|
65
|
+
margin-left: 69px;
|
|
66
|
+
width: 240px;
|
|
67
|
+
max-width: calc(100% - 120px);
|
|
68
|
+
outline: none;
|
|
69
|
+
border: none;
|
|
70
|
+
font-size: 2rem;
|
|
71
|
+
text-align: center;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.btnContainer {
|
|
75
|
+
display: flex;
|
|
76
|
+
flex-direction: row;
|
|
77
|
+
align-items: center;
|
|
78
|
+
justify-content: center;
|
|
79
|
+
margin-bottom: 20px;
|
|
80
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { SectionComponentProps } from '../Section';
|
|
3
|
-
declare function MaterialSection({ section,
|
|
3
|
+
declare function MaterialSection({ form, section, widthStats, ...others }: SectionComponentProps): JSX.Element;
|
|
4
4
|
export default MaterialSection;
|
|
@@ -25,11 +25,14 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
25
25
|
import StepComponent from '../../Step/Step';
|
|
26
26
|
import styles from './MaterialSection.module.css';
|
|
27
27
|
function MaterialSection(_a) {
|
|
28
|
-
var section = _a.section,
|
|
28
|
+
var form = _a.form, section = _a.section, widthStats = _a.widthStats, others = __rest(_a, ["form", "section", "widthStats"]);
|
|
29
29
|
var postview = others.postview, partial = others.partial, originalValues = others.originalValues;
|
|
30
30
|
return (_jsx("div", __assign({ className: styles.container, style: {
|
|
31
31
|
width: (form.size.blockSize + form.size.spacingSize) *
|
|
32
32
|
form.size.blockNum,
|
|
33
|
+
justifyContent: widthStats.currentBreakPoint < form.size.blockNum
|
|
34
|
+
? 'center'
|
|
35
|
+
: 'normal',
|
|
33
36
|
} }, { children: section.steps.map(function (idStep, index) {
|
|
34
37
|
var step = form.steps[idStep];
|
|
35
38
|
//If partial is active only display steps with originalValues
|
|
@@ -39,7 +42,7 @@ function MaterialSection(_a) {
|
|
|
39
42
|
return _jsx("div", {}, index);
|
|
40
43
|
}
|
|
41
44
|
else if (step) {
|
|
42
|
-
return (_createElement(StepComponent, __assign({}, others, { form: form, step: step, handleSizeChange: function () { }, key: index, level: 0 })));
|
|
45
|
+
return (_createElement(StepComponent, __assign({}, others, { widthStats: widthStats, form: form, step: step, handleSizeChange: function () { }, key: index, level: 0 })));
|
|
43
46
|
}
|
|
44
47
|
else {
|
|
45
48
|
console.error('Step not found:', idStep);
|
package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
|
|
|
3
3
|
import './DraftEditor.css';
|
|
4
4
|
import { RawDraftContentState } from 'draft-js';
|
|
5
5
|
import { TextAreaStepProps } from '../TextAreaStep';
|
|
6
|
-
declare function TextAreaStep({ step, errors, control, editable, postview, formStyle, maxLength, originalValues, backgroundColor, }: TextAreaStepProps): JSX.Element;
|
|
6
|
+
declare function TextAreaStep({ step, errors, partial, control, editable, postview, formStyle, maxLength, originalValues, backgroundColor, }: TextAreaStepProps): JSX.Element;
|
|
7
7
|
export default TextAreaStep;
|
|
8
8
|
export declare function stringToDraft(text: string): RawDraftContentState;
|
|
9
9
|
export declare const getRawText: (draft?: RawDraftContentState | undefined, text?: string | undefined) => RawDraftContentState;
|
|
@@ -20,7 +20,7 @@ import { convertFromRaw, EditorState } from 'draft-js';
|
|
|
20
20
|
import React, { useState } from 'react';
|
|
21
21
|
import { ClickAwayListener } from '@material-ui/core';
|
|
22
22
|
function TextAreaStep(_a) {
|
|
23
|
-
var step = _a.step, errors = _a.errors, control = _a.control, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, maxLength = _a.maxLength, originalValues = _a.originalValues, backgroundColor = _a.backgroundColor;
|
|
23
|
+
var step = _a.step, errors = _a.errors, partial = _a.partial, control = _a.control, editable = _a.editable, postview = _a.postview, formStyle = _a.formStyle, maxLength = _a.maxLength, originalValues = _a.originalValues, backgroundColor = _a.backgroundColor;
|
|
24
24
|
var _b = useState(false), hovering = _b[0], setHovering = _b[1];
|
|
25
25
|
var _c = useState(false), focus = _c[0], setFocus = _c[1];
|
|
26
26
|
var calcStyle = function () {
|
|
@@ -158,7 +158,7 @@ function TextAreaStep(_a) {
|
|
|
158
158
|
}, shouldUnregister: true, render: function (_a) {
|
|
159
159
|
var _b;
|
|
160
160
|
var field = _a.field;
|
|
161
|
-
return (_jsxs(React.Fragment, { children: [_jsx("div", __assign({ className: styles.erkTextArea }, { children: _jsx(RoundedTextField, __assign({}, field, { "data-testid": step.id, maxLength: maxLength, label: step.label, inputRef: field.ref, required: step.required, cantEdit: !canEdit, fontWeight: 400, multiline: true, minRows: 4, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : formStyle.backgroundColor, innerBackgroundColor: formStyle.stepBackgroundColor, helperTextColor: formStyle.descriptionTextColor, helperText: errors[step.id]
|
|
161
|
+
return (_jsxs(React.Fragment, { children: [_jsx("div", __assign({ className: styles.erkTextArea }, { children: _jsx(RoundedTextField, __assign({}, field, { "data-testid": step.id, maxLength: maxLength, label: step.label, inputRef: field.ref, required: step.required, cantEdit: !canEdit, fontWeight: 400, multiline: true, minRows: postview && partial ? undefined : 4, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, backgroundColor: backgroundColor !== null && backgroundColor !== void 0 ? backgroundColor : formStyle.backgroundColor, innerBackgroundColor: formStyle.stepBackgroundColor, helperTextColor: formStyle.descriptionTextColor, helperText: errors[step.id]
|
|
162
162
|
? errors[step.id].message
|
|
163
163
|
: (_b = step.description) !== null && _b !== void 0 ? _b : (step.required ? ' ' : null), error: !!errors[step.id] }), void 0) }), void 0), postview && (_jsxs("div", __assign({ className: styles.print }, { children: [_jsxs("div", { children: [step.label, ":"] }, void 0), _jsx("p", __assign({ className: styles.printContainer, style: {
|
|
164
164
|
backgroundColor: formStyle.stepBackgroundColor,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TitleStepProps } from '../TitleStep';
|
|
3
|
-
declare function TitleStep({ step, formStyle }: TitleStepProps): JSX.Element;
|
|
3
|
+
declare function TitleStep({ step, formStyle, widthStats, }: TitleStepProps): JSX.Element;
|
|
4
4
|
export default TitleStep;
|
|
@@ -12,8 +12,8 @@ var __assign = (this && this.__assign) || function () {
|
|
|
12
12
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
13
13
|
import styles from './MaterialTitleStep.module.css';
|
|
14
14
|
function TitleStep(_a) {
|
|
15
|
-
var step = _a.step, formStyle = _a.formStyle;
|
|
16
|
-
return (_jsxs("div", __assign({ className: styles.container, style: { color: formStyle.textColor } }, { children: [_jsx("div", __assign({ className: styles.titleLbl }, { children: step.title }), void 0), step.description && (_jsx("p", __assign({ className: styles.descriptionPar, style: {
|
|
15
|
+
var step = _a.step, formStyle = _a.formStyle, widthStats = _a.widthStats;
|
|
16
|
+
return (_jsxs("div", __assign({ className: styles.container, style: { color: formStyle.textColor } }, { children: [_jsx("div", __assign({ className: styles.titleLbl, style: { textAlign: widthStats.isMobile ? 'center' : 'start' } }, { children: step.title }), void 0), step.description && (_jsx("p", __assign({ className: styles.descriptionPar, style: {
|
|
17
17
|
margin: step.title ? '10px 0px' : '0px 0px 5px 0px',
|
|
18
18
|
} }, { children: step.description }), void 0))] }), void 0));
|
|
19
19
|
}
|
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":
|
|
4
|
+
"version":"1.9.3-test",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"start": "react-scripts start",
|
|
7
7
|
"build": "react-scripts build",
|
|
@@ -18,11 +18,13 @@
|
|
|
18
18
|
"@testing-library/jest-dom": "^5.14.1",
|
|
19
19
|
"@testing-library/react": "^11.2.7",
|
|
20
20
|
"@testing-library/user-event": "^12.8.3",
|
|
21
|
+
"@types/react-google-recaptcha": "^2.1.5",
|
|
21
22
|
"axios": "^0.21.x",
|
|
22
23
|
"date-fns": "^2.23.x",
|
|
23
24
|
"draft-js": "^0.11.x",
|
|
24
25
|
"nanoid": "^3.3.3",
|
|
25
26
|
"react-draft-wysiwyg": "^1.14.x",
|
|
27
|
+
"react-google-recaptcha": "^2.1.0",
|
|
26
28
|
"react-hook-form": "^7.6.4",
|
|
27
29
|
"react-router-dom": "^5.2.0",
|
|
28
30
|
"react-scripts": "5.0.0-next.37",
|