@arquimedes.co/eureka-forms 1.1.9 → 1.2.0-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.
@@ -1 +1,2 @@
1
1
  export type { Organization } from './Organization';
2
+ export type { Form } from './Form';
@@ -0,0 +1 @@
1
+ export * from './@Types';
@@ -0,0 +1 @@
1
+ export * from './@Types';
package/dist/App.js CHANGED
@@ -127,6 +127,7 @@ function App(_a) {
127
127
  if (!(organizationInfo && form !== undefined)) return [3 /*break*/, 4];
128
128
  if (!(process.env.NODE_ENV === 'production' &&
129
129
  apiKey !== 'rCgWiEfOSN1TlUmHO28Y0' &&
130
+ apiKey !== 'X4aMB86AHeg4qRs4CH4o8' &&
130
131
  !internal &&
131
132
  !postview &&
132
133
  !preview)) return [3 /*break*/, 4];
@@ -136,8 +137,8 @@ function App(_a) {
136
137
  return [4 /*yield*/, import('logrocket')];
137
138
  case 2:
138
139
  LogRocket = _a.sent();
139
- LogRocket.init('63mg8a/forms-uv0gd');
140
- LogRocket.identify(organizationInfo.idOrganization + '/' + apiKey, {
140
+ LogRocket.default.init('63mg8a/forms-uv0gd');
141
+ LogRocket.default.identify(organizationInfo.idOrganization + '/' + apiKey, {
141
142
  name: organizationInfo.name +
142
143
  '/' +
143
144
  (form ? form === null || form === void 0 ? void 0 : form.name : '404'),
@@ -162,7 +163,7 @@ function App(_a) {
162
163
  case 0:
163
164
  _b.trys.push([0, 5, , 6]);
164
165
  if (!domain) return [3 /*break*/, 2];
165
- return [4 /*yield*/, widgetInstance.get("/organization?idOrganization=".concat(domain))];
166
+ return [4 /*yield*/, widgetInstance.get("/organization?idOrganization=" + domain)];
166
167
  case 1:
167
168
  _a = _b.sent();
168
169
  return [3 /*break*/, 4];
@@ -205,8 +206,8 @@ function App(_a) {
205
206
  case 0:
206
207
  _a.trys.push([0, 2, , 3]);
207
208
  return [4 /*yield*/, (domain
208
- ? widgetInstance.get("/form/".concat(apiKey, "?idOrganization=").concat(domain))
209
- : axiosInstance.get("/form/".concat(apiKey)))];
209
+ ? widgetInstance.get("/form/" + apiKey + "?idOrganization=" + domain)
210
+ : axiosInstance.get("/form/" + apiKey))];
210
211
  case 1:
211
212
  response = _a.sent();
212
213
  if (response) {
@@ -1,7 +1,7 @@
1
1
  import axios from 'axios';
2
2
  var headers = {};
3
3
  var widgetInstance = axios.create({
4
- baseURL: "https://api.forms.".concat(process.env.REACT_APP_DOMAIN, "/api"),
4
+ baseURL: "https://api.forms." + process.env.REACT_APP_DOMAIN + "/api",
5
5
  timeout: 30000,
6
6
  headers: headers,
7
7
  });
@@ -119,9 +119,9 @@ function ColumnForm(_a) {
119
119
  payload = {
120
120
  formValues: { steps: values },
121
121
  };
122
- url = "/ticket/".concat(internal ? form.apiKey : apiKey);
122
+ url = "/ticket/" + (internal ? form.apiKey : apiKey);
123
123
  if (!(domain || internal)) return [3 /*break*/, 4];
124
- return [4 /*yield*/, widgetInstance.post("".concat(url, "?idOrganization=").concat(domain), payload)];
124
+ return [4 /*yield*/, widgetInstance.post(url + "?idOrganization=" + domain, payload)];
125
125
  case 3:
126
126
  _b = _c.sent();
127
127
  return [3 /*break*/, 6];
@@ -148,7 +148,7 @@ function ColumnForm(_a) {
148
148
  setShowConfirmation(undefined);
149
149
  } }, 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 }, others), index)); }), form.terms &&
150
150
  !internal &&
151
- 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)); }), !postview && (_jsx("div", __assign({ className: styles.submitBtnContainer }, { children: _jsxs("button", __assign({ "data-testid": "login__submit", className: styles.submitBtn, onClick: function () {
151
+ 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)); }), !postview && (_jsx("div", __assign({ className: styles.submitBtnContainer }, { children: _jsxs("button", __assign({ "data-testid": "form__submit", className: styles.submitBtn, onClick: function () {
152
152
  onSubmit();
153
153
  }, style: {
154
154
  background: formStyle.primaryColor,
@@ -24,7 +24,7 @@ function ConfirmationDialog(_a) {
24
24
  },
25
25
  }, open: true }, { children: _jsxs("div", __assign({ className: styles.confirmationContainer, style: { color: formStyle.textColor } }, { children: [_jsx("div", __assign({ className: styles.closeIcon, onClick: function () {
26
26
  onClose();
27
- } }, { 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.primaryColor } }, { children: _jsx(CheckCircleOutlineRoundedIcon, { fontSize: "inherit", style: { fontSize: '160px' } }, void 0) }), void 0), _jsxs("div", __assign({ className: styles.messageContainer }, { children: ["Tu caso n\u00FAmero", ' ', _jsx("span", __assign({ style: { fontWeight: 'bold' } }, { children: confirmation.case }), void 0), ' ', "ha sido registrado!"] }), void 0), _jsx("div", __assign({ className: styles.messageContainer }, { children: "Pronto te estaremos dando respuesta." }), void 0), _jsxs("div", __assign({ className: styles.linkContainer }, { children: ["Puedes consultar el estado aqui:", ' '] }), void 0), _jsx("label", __assign({ className: styles.url, onClick: function () {
27
+ } }, { 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.primaryColor } }, { children: _jsx(CheckCircleOutlineRoundedIcon, { fontSize: "inherit", style: { fontSize: '160px' } }, void 0) }), void 0), _jsxs("div", __assign({ className: styles.messageContainer }, { children: ["Tu caso n\u00FAmero", ' ', _jsx("span", __assign({ style: { fontWeight: 'bold' } }, { children: confirmation.case }), void 0), ' ', "ha sido registrado!"] }), void 0), _jsx("div", __assign({ className: styles.messageContainer }, { children: "Pronto te estaremos dando respuesta." }), void 0), _jsxs("div", __assign({ className: styles.linkContainer }, { children: ["Puedes consultar el estado aqui:", ' '] }), void 0), _jsx("label", __assign({ className: styles.url, "data-testid": "ResUrl", onClick: function () {
28
28
  var _a, _b, _c;
29
29
  (_c = (_b = (_a = window
30
30
  .open) === null || _a === void 0 ? void 0 : _a.call(window, confirmation.url, '_blank')) === null || _b === void 0 ? void 0 : _b.focus) === null || _c === void 0 ? void 0 : _c.call(_b);
@@ -27,7 +27,7 @@ function CheckBoxStep(_a) {
27
27
  : undefined,
28
28
  }, shouldUnregister: true, render: function (_a) {
29
29
  var field = _a.field;
30
- 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));
30
+ return (_jsx(RoundedCheckBox, __assign({}, field, { "data-testid": step.id, inputRef: field.ref, padding: "0px", size: "1.6rem", cantEdit: postview, checkedColor: formStyle.primaryColor, uncheckedColor: formStyle.outlineColor, checked: field.value }), void 0));
31
31
  } }, void 0)] }), void 0), (step.description || !!errors[step.id]) && (_jsx("div", __assign({ className: styles.descriptionPar, style: {
32
32
  color: !!errors[step.id]
33
33
  ? formStyle.errorColor
@@ -55,7 +55,7 @@ function ClassifierSelector(_a) {
55
55
  } }, { children: _jsxs(RoundedSelect, __assign({ fullWidth: true, value: value, cantEdit: postview, helperTextColor: formStyle.descriptionTextColor, 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) {
56
56
  onChange(event.target.value);
57
57
  sizeChange();
58
- }, inputRef: inputRef, helperText: errors[step.id]
58
+ }, "data-testid": step.id, inputRef: inputRef, helperText: errors[step.id]
59
59
  ? errors[step.id].message
60
60
  : 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
61
61
  .filter(function (classifier) {
@@ -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, { pickTime: step.pickTime, showIcon: step.showIcon, inputRef: field.ref, cantEdit: postview, secondaryColor: formStyle.secondaryColor, contrastColor: formStyle.secondaryContrastColor, accentColor: formStyle.textColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, helperTextColor: formStyle.descriptionTextColor, fontWeight: 400, label: step.label, helperText: errors[step.id]
30
+ return (_jsx(RoundedDatePicker, __assign({}, field, { pickTime: step.pickTime, showIcon: step.showIcon, inputRef: field.ref, cantEdit: postview, "data-testid": step.id, secondaryColor: formStyle.secondaryColor, contrastColor: formStyle.secondaryContrastColor, accentColor: formStyle.textColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, textColor: formStyle.textColor, errorColor: formStyle.errorColor, helperTextColor: formStyle.descriptionTextColor, 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));
@@ -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, style: { color: formStyle.descriptionTextColor } }, { children: step.description }), void 0)), _jsx("input", { type: "file", ref: inputRef, className: styles.filesInput, onChange: function (e) {
193
+ return (_jsxs("div", __assign({ className: styles.container, "data-testid": step.id }, { children: [_jsx("div", __assign({ className: styles.labelLabel }, { children: step.label }), void 0), step.description && (_jsx("div", __assign({ className: styles.stepDescriptionLabel, style: { color: formStyle.descriptionTextColor } }, { 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);
@@ -45,7 +45,7 @@ function Selector(_a) {
45
45
  ? '100%'
46
46
  : calcStepWidth(step.size, form),
47
47
  minHeight: step.description || step.required ? '55px' : '43px',
48
- } }, { children: _jsxs(RoundedSelect, __assign({ value: value, fullWidth: true, inputRef: inputRef, cantEdit: postview, helperTextColor: formStyle.descriptionTextColor, 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) {
48
+ } }, { children: _jsxs(RoundedSelect, __assign({ value: value, fullWidth: true, inputRef: inputRef, cantEdit: postview, helperTextColor: formStyle.descriptionTextColor, focusColor: formStyle.primaryColor, outlineColor: formStyle.outlineColor, errorColor: formStyle.errorColor, color: formStyle.textColor, label: step.label, "data-testid": step.id, required: step.required, containerMargin: "0px", height: '31px', onBlur: onBlur, handleUpdate: function (event) {
49
49
  onChange(event.target.value);
50
50
  sizeChange();
51
51
  }, helperText: errors[step.id]
@@ -95,7 +95,7 @@ function TextAreaStep(_a) {
95
95
  }
96
96
  return (_jsx(Editor, { editorRef: field.ref, onFocus: function () {
97
97
  setFocus(true);
98
- }, readOnly: postview, onBlur: field.onBlur, stripPastedStyles: true, editorState: field.value, onEditorStateChange: field.onChange, toolbarClassName: styles.toolbar +
98
+ }, "data-testid": step.id, readOnly: postview, onBlur: field.onBlur, stripPastedStyles: true, editorState: field.value, onEditorStateChange: field.onChange, toolbarClassName: styles.toolbar +
99
99
  (postview
100
100
  ? ' postview-editor-toolbar'
101
101
  : ''), editorClassName: editorClassName, wrapperClassName: styles.wrapper, placeholder: (_b = step.description) !== null && _b !== void 0 ? _b : '', toolbar: {
@@ -129,7 +129,7 @@ function TextAreaStep(_a) {
129
129
  : undefined,
130
130
  }, shouldUnregister: true, render: function (_a) {
131
131
  var field = _a.field;
132
- 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, helperTextColor: formStyle.descriptionTextColor, helperText: errors[step.id]
132
+ return (_jsx(RoundedTextField, __assign({}, field, { "data-testid": step.id, 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, helperTextColor: formStyle.descriptionTextColor, helperText: errors[step.id]
133
133
  ? errors[step.id].message
134
134
  : step.description, error: !!errors[step.id] }), void 0));
135
135
  } }, void 0) }), void 0));
@@ -35,7 +35,7 @@ function TextInputStep(_a) {
35
35
  : undefined,
36
36
  }, shouldUnregister: true, render: function (_a) {
37
37
  var field = _a.field;
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]
38
+ return (_jsx(RoundedTextField, __assign({}, field, { "data-testid": step.id, 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
40
  : step.description, helperTextColor: formStyle.descriptionTextColor, error: !!errors[step.id] }), void 0));
41
41
  } }, void 0) }), void 0));
@@ -49,7 +49,7 @@ export function getUploadUrls(files, domain) {
49
49
  extension: file.name.split('.').pop(),
50
50
  }); });
51
51
  if (!domain) return [3 /*break*/, 2];
52
- return [4 /*yield*/, widgetInstance.post("/uploadfile?idOrganization=".concat(domain), filesArray)];
52
+ return [4 /*yield*/, widgetInstance.post("/uploadfile?idOrganization=" + domain, filesArray)];
53
53
  case 1:
54
54
  response = _b.sent();
55
55
  return [3 /*break*/, 4];
package/package.json CHANGED
@@ -1,10 +1,11 @@
1
1
  {
2
2
  "name": "@arquimedes.co/eureka-forms",
3
3
  "repository": "git://github.com/Arquimede5/Eureka-Forms.git",
4
- "version": "1.1.9",
4
+ "version":"1.2.0-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",
8
+ "e2e": "percy exec -- cypress run",
8
9
  "lint": "eslint 'src/**/*.ts'",
9
10
  "tsc-build": "tsc --noEmit false --outDir ./dist"
10
11
  },
@@ -17,11 +18,11 @@
17
18
  "@testing-library/jest-dom": "^5.14.1",
18
19
  "@testing-library/react": "^11.2.7",
19
20
  "@testing-library/user-event": "^12.8.3",
20
- "axios": "^0.21.1",
21
- "date-fns": "^2.23.0",
22
- "draft-js": "^0.11.7",
23
- "react-draft-wysiwyg": "^1.14.7",
24
- "react-hook-form": "7.18.1",
21
+ "axios": "^0.21.x",
22
+ "date-fns": "^2.23.x",
23
+ "draft-js": "^0.11.x",
24
+ "react-draft-wysiwyg": "^1.14.x",
25
+ "react-hook-form": "^7.6.4",
25
26
  "react-router-dom": "^5.2.0",
26
27
  "react-scripts": "5.0.0-next.37",
27
28
  "typescript": "^4.4.3"
@@ -46,15 +47,17 @@
46
47
  },
47
48
  "devDependencies": {
48
49
  "@babel/core": "^7.14.6",
50
+ "@percy/cli": "^1.0.0-beta.76",
51
+ "@percy/cypress": "^3.1.1",
49
52
  "@types/draft-js": "^0.11.5",
50
53
  "@types/jest": "^26.0.24",
51
- "@types/node": "^12.20.25",
52
54
  "@types/react": "^17.0.21",
53
55
  "@types/react-dom": "^17.0.9",
54
56
  "@types/react-draft-wysiwyg": "^1.13.3",
55
57
  "@types/react-router-dom": "^5.1.7",
56
58
  "@typescript-eslint/eslint-plugin": "^4.24.0",
57
59
  "@typescript-eslint/parser": "^4.24.0",
60
+ "cypress": "^9.5.1",
58
61
  "eslint": "^7.27.0",
59
62
  "eslint-config-prettier": "^8.3.0",
60
63
  "eslint-plugin-prettier": "^3.4.0",
@@ -65,16 +68,16 @@
65
68
  "react-dom": "^17.0.2"
66
69
  },
67
70
  "peerDependencies": {
68
- "react": "^17.x.x",
69
- "react-dom": "^17.x.x",
70
71
  "axios": "^0.21.x",
72
+ "babel-plugin-add-react-displayname": "0.0.x",
71
73
  "date-fns": "^2.23.x",
72
74
  "draft-js": "^0.11.x",
75
+ "logrocket": "^2.x.x",
76
+ "react": "^17.x.x",
77
+ "react-dom": "^17.x.x",
73
78
  "react-draft-wysiwyg": "^1.14.x",
74
79
  "react-hook-form": "^7.6.4",
75
- "react-router-dom": "^5.2.0",
76
- "babel-plugin-add-react-displayname": "0.0.x",
77
- "logrocket": "^2.x.x"
80
+ "react-router-dom": "^5.2.0"
78
81
  },
79
82
  "publishConfig": {
80
83
  "access": "public"