@arquimedes.co/eureka-forms 1.8.2 → 1.8.5-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/App.js CHANGED
@@ -270,7 +270,7 @@ function App(_a) {
270
270
  if (handleConfirmed) {
271
271
  handleConfirmed();
272
272
  }
273
- }, editable: editable, postview: postview === true, internal: internal === true, apiKey: apiKey, domain: domain, customSend: customSend, originalValues: originalValues, containerRef: containerRef, organization: organizationInfo !== null && organizationInfo !== void 0 ? organizationInfo : { idOrganization: domain }, customSteps: customSteps !== null && customSteps !== void 0 ? customSteps : {} }), void 0) }), void 0));
273
+ }, editable: editable, postview: postview === true, internal: internal === true, apiKey: apiKey, domain: domain, customSend: customSend, originalValues: originalValues, containerRef: containerRef, organization: organizationInfo !== null && organizationInfo !== void 0 ? organizationInfo : { idOrganization: domain }, customSteps: customSteps !== null && customSteps !== void 0 ? customSteps : {}, isWidget: isWidget === true }), void 0) }), void 0));
274
274
  }
275
275
  }
276
276
  export default App;
@@ -15,7 +15,6 @@
15
15
  }
16
16
  .container {
17
17
  width: 100%;
18
- height: 100%;
19
18
  position: relative;
20
19
  }
21
20
 
@@ -153,7 +153,8 @@ function ColumnForm(_a) {
153
153
  reload();
154
154
  setShowConfirmation(undefined);
155
155
  } }, 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
- !internal &&
156
+ (!internal || (internal && postview)) &&
157
+ (originalValues === null || originalValues === void 0 ? void 0 : originalValues['INTERNAL_CREATING_AGENT']) === undefined &&
157
158
  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 () {
158
159
  onSubmit();
159
160
  }, style: {
@@ -30,8 +30,9 @@ export interface FormComponentProps {
30
30
  /** The custom send label to display */
31
31
  sendLabel?: string;
32
32
  }
33
- declare function FormComponent({ form, internal, postview, organization, containerRef, ...others }: Omit<FormComponentProps, 'widthStats' | 'formStyle' | 'handleLoaded'> & {
33
+ declare function FormComponent({ form, isWidget, internal, postview, organization, containerRef, ...others }: Omit<FormComponentProps, 'widthStats' | 'formStyle' | 'handleLoaded'> & {
34
34
  containerRef: any;
35
35
  organization: Organization | null;
36
+ isWidget: boolean;
36
37
  }): JSX.Element;
37
38
  export default FormComponent;
@@ -49,7 +49,7 @@ export var getLocale = function () {
49
49
  };
50
50
  function FormComponent(_a) {
51
51
  var _b, _c;
52
- var form = _a.form, internal = _a.internal, postview = _a.postview, organization = _a.organization, containerRef = _a.containerRef, others = __rest(_a, ["form", "internal", "postview", "organization", "containerRef"]);
52
+ var form = _a.form, isWidget = _a.isWidget, internal = _a.internal, postview = _a.postview, organization = _a.organization, containerRef = _a.containerRef, others = __rest(_a, ["form", "isWidget", "internal", "postview", "organization", "containerRef"]);
53
53
  var _d = useState(false), loaded = _d[0], setLoaded = _d[1];
54
54
  var _e = useState(undefined), widthStats = _e[0], setWidthStats = _e[1];
55
55
  /** Calcs the currentBreakPoint and if is mobile */
@@ -88,15 +88,13 @@ function FormComponent(_a) {
88
88
  if ((postview || internal || !form.isStandAlone) &&
89
89
  widthStats !== undefined) {
90
90
  return (_jsx("div", __assign({ style: {
91
- backgroundColor: internal || postview
91
+ backgroundColor: internal
92
92
  ? InternalFormStyle.backgroundColor
93
93
  : form.style.backgroundColor,
94
- minHeight: '100%',
94
+ minHeight: isWidget ? '100%' : '100vh',
95
95
  } }, { children: _jsx("div", __assign({ className: styles.widgetFormContainer, ref: containerRef }, { children: _jsx(FormTypeComponent, __assign({}, others, { handleLoaded: function () {
96
96
  setLoaded(true);
97
- }, widthStats: widthStats, form: form, internal: internal, postview: postview, organization: organization, formStyle: internal || postview
98
- ? InternalFormStyle
99
- : form.style }), void 0) }), void 0) }), void 0));
97
+ }, widthStats: widthStats, form: form, internal: internal, postview: postview, organization: organization, formStyle: internal ? InternalFormStyle : form.style }), void 0) }), void 0) }), void 0));
100
98
  }
101
99
  else if (organization && widthStats !== undefined) {
102
100
  //Standalone cant have widget
@@ -17,7 +17,7 @@ import { Editor } from 'react-draft-wysiwyg'; //Load programatically only if ste
17
17
  import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
18
18
  import './DraftEditor.css';
19
19
  import { convertFromRaw, EditorState } from 'draft-js';
20
- import { useState } from 'react';
20
+ import React, { useState } from 'react';
21
21
  import { ClickAwayListener } from '@material-ui/core';
22
22
  function TextAreaStep(_a) {
23
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;
@@ -77,7 +77,10 @@ function TextAreaStep(_a) {
77
77
  if (canEdit) {
78
78
  setFocus(false);
79
79
  }
80
- } }, { children: _jsx("div", __assign({ className: styles.textContainer + ' EF-DraftContainer', "data-testid": step.id, style: calcStyle(), onMouseEnter: function () {
80
+ } }, { children: _jsx("div", __assign({ className: postview
81
+ ? styles.postViewContainer +
82
+ ' EF-DraftContainer'
83
+ : styles.textContainer + ' EF-DraftContainer', "data-testid": step.id, style: calcStyle(), onMouseEnter: function () {
81
84
  if (canEdit) {
82
85
  setHovering(true);
83
86
  }
@@ -155,9 +158,12 @@ function TextAreaStep(_a) {
155
158
  }, shouldUnregister: true, render: function (_a) {
156
159
  var _b;
157
160
  var field = _a.field;
158
- return (_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, maxRows: 6, 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]
159
- ? errors[step.id].message
160
- : (_b = step.description) !== null && _b !== void 0 ? _b : (step.required ? ' ' : null), error: !!errors[step.id] }), void 0));
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]
162
+ ? errors[step.id].message
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
+ backgroundColor: formStyle.stepBackgroundColor,
165
+ borderColor: formStyle.outlineColor,
166
+ } }, { children: field.value }), void 0)] }), void 0))] }, void 0));
161
167
  } }, void 0) }), void 0));
162
168
  }
163
169
  }
@@ -3,6 +3,7 @@
3
3
  width: fit-content;
4
4
  max-width: calc(100% - 20px);
5
5
  display: flex;
6
+ flex-direction: column;
6
7
  padding: 10px;
7
8
  padding-top: 5px;
8
9
  width: calc(100% - 20px);
@@ -13,7 +14,15 @@
13
14
  display: flex;
14
15
  flex-direction: column;
15
16
  }
16
-
17
+ .postViewContainer {
18
+ height: fit-content;
19
+ border-radius: 15px;
20
+ min-height: 265px;
21
+ width: 100%;
22
+ position: relative;
23
+ margin-bottom: 1px;
24
+ overflow: hidden;
25
+ }
17
26
  .textContainer {
18
27
  height: 100%;
19
28
  border-radius: 15px;
@@ -56,3 +65,29 @@
56
65
  margin-bottom: 2px;
57
66
  font-size: 1rem;
58
67
  }
68
+ .print {
69
+ display: none;
70
+ }
71
+ .printContainer {
72
+ border-radius: 10px;
73
+ border: 1px solid black;
74
+ padding: 6px 12px;
75
+ width: calc(100% - 2);
76
+ font-size: 1rem;
77
+ min-height: 50px;
78
+ margin: 0px;
79
+ }
80
+ .erkTextArea {
81
+ position: relative;
82
+ width: 100%;
83
+ max-width: 100%;
84
+ }
85
+
86
+ @media print {
87
+ .print {
88
+ display: block;
89
+ }
90
+ .erkTextArea {
91
+ display: none !important;
92
+ }
93
+ }
package/dist/index.d.ts CHANGED
@@ -1 +1 @@
1
- import './index.css';
1
+ export {};
package/dist/index.js CHANGED
@@ -13,7 +13,6 @@ import { jsx as _jsx } from "react/jsx-runtime";
13
13
  import * as ReactDOM from 'react-dom';
14
14
  import App from './App';
15
15
  import styles from './index.module.css';
16
- import './index.css';
17
16
  var urlParams = new URLSearchParams(window.location.search);
18
17
  var values = urlParams.get('data-values');
19
18
  var dataValues = undefined;
@@ -1,18 +1,12 @@
1
1
  @import url('https://fonts.googleapis.com/css2?family=Nunito:ital,wght@0,200;0,300;0,400;0,600;0,700;0,800;0,900;1,200;1,300;1,400;1,600;1,700;1,800;1,900&display=swap');
2
2
 
3
- html {
4
- height: 100%;
5
- }
6
-
7
3
  body {
8
4
  font-family: 'Nunito';
9
- height: 100%;
10
5
  }
11
6
 
12
7
  .eurekaForm {
13
8
  min-height: 100vh;
14
9
  width: 100%;
15
- height: 100%;
16
10
  scroll-behavior: smooth;
17
11
  overflow: hidden;
18
12
  overflow-x: hidden;
@@ -46,7 +46,7 @@ var useTextfieldStyles = function (props) {
46
46
  backgroundColor: props.backgroundColor,
47
47
  '& input, textarea': {
48
48
  cursor: props.cantEdit ? 'default' : 'text',
49
- padding: props.multiline ? '' : props.padding,
49
+ padding: props.multiline ? props.padding : props.padding,
50
50
  fontWeight: props.fontWeight,
51
51
  color: props.textColor,
52
52
  fontSize: props.fontSize,
@@ -54,7 +54,7 @@ var useTextfieldStyles = function (props) {
54
54
  fontSize: props.fontSize,
55
55
  },
56
56
  backgroundColor: props.innerBackgroundColor,
57
- borderRadius: props.multiline ? '0px' : props.borderRadius,
57
+ borderRadius: props.borderRadius,
58
58
  },
59
59
  '& label': {
60
60
  marginTop: props.multiline ? '0px' : '-4px',
@@ -106,7 +106,7 @@ var useTextfieldStyles = function (props) {
106
106
  marginRight: props.maxLength ? 40 : 14,
107
107
  },
108
108
  '& .EF-MuiOutlinedInput-multiline': {
109
- padding: props.padding,
109
+ padding: 0,
110
110
  backgroundColor: props.innerBackgroundColor,
111
111
  },
112
112
  },
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": "1.8.2",
4
+ "version":"1.8.5-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",
package/dist/index.css DELETED
@@ -1,3 +0,0 @@
1
- #eureka-root {
2
- height: 100%;
3
- }