@arquimedes.co/eureka-forms 1.9.134 → 2.0.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.
Files changed (208) hide show
  1. package/dist/@Types/Form.d.ts +1 -1
  2. package/dist/@Types/FormStep.d.ts +2 -2
  3. package/dist/@Types/GenericFormSteps.d.ts +1 -0
  4. package/dist/App/App.css +6 -0
  5. package/dist/{App.d.ts → App/App.d.ts} +13 -21
  6. package/dist/App/App.js +76 -0
  7. package/dist/App/AppFunctions.d.ts +16 -0
  8. package/dist/App/AppFunctions.js +210 -0
  9. package/dist/App/AppHooks.d.ts +10 -0
  10. package/dist/App/AppHooks.js +235 -0
  11. package/dist/Contexts/CustomContext.d.ts +11 -0
  12. package/dist/Contexts/CustomContext.js +6 -0
  13. package/dist/Contexts/FormContext.d.ts +4 -0
  14. package/dist/Contexts/FormContext.js +19 -0
  15. package/dist/Contexts/SectionContext.d.ts +3 -0
  16. package/dist/Contexts/SectionContext.js +3 -0
  17. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +2 -4
  18. package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +3 -1
  19. package/dist/Form/Form.d.ts +17 -34
  20. package/dist/Form/Form.js +73 -124
  21. package/dist/Form/FormFunctions.d.ts +5 -4
  22. package/dist/Form/FormFunctions.js +24 -25
  23. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +1 -1
  24. package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +34 -58
  25. package/dist/Form/FormTypes/ColumnForm/ColumnForm.module.css +0 -4
  26. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -1
  27. package/dist/Form/FormTypes/StepperForm/StepperForm.js +122 -3
  28. package/dist/Form/FormTypes/StepperForm/StepperForm.module.css +53 -0
  29. package/dist/Form/Hooks.d.ts +9 -0
  30. package/dist/Form/Hooks.js +7 -0
  31. package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +1 -1
  32. package/dist/Form/Section/MaterialSection/MaterialSection.js +15 -16
  33. package/dist/Form/Section/Section.d.ts +2 -34
  34. package/dist/Form/Section/Section.js +11 -5
  35. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +1 -1
  36. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +19 -14
  37. package/dist/Form/Terms/Term/Term.d.ts +1 -8
  38. package/dist/Form/Terms/Term/Term.js +3 -1
  39. package/dist/Form/Terms/Terms.d.ts +1 -2
  40. package/dist/Form/Terms/Terms.js +17 -8
  41. package/dist/Form/Terms/Terms.module.css +3 -0
  42. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +3 -3
  43. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +49 -38
  44. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +3 -1
  45. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +2 -2
  46. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +11 -5
  47. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +29 -27
  48. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.module.css +0 -6
  49. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +39 -31
  50. package/dist/FormSteps/AYFStepMapper.js +42 -43
  51. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +1 -1
  52. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +4 -14
  53. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +84 -97
  54. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.module.css +0 -9
  55. package/dist/FormSteps/CBRStepMapper.js +78 -74
  56. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +1 -1
  57. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +4 -14
  58. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +33 -26
  59. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css +17 -0
  60. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +1 -1
  61. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +4 -14
  62. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +34 -27
  63. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +1 -1
  64. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +4 -2
  65. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +16 -11
  66. package/dist/FormSteps/CustomStep.d.ts +23 -0
  67. package/dist/FormSteps/CustomStep.js +37 -0
  68. package/dist/FormSteps/DatePickerStep/DatePickerStep.js +3 -1
  69. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +1 -1
  70. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +26 -14
  71. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +1 -1
  72. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +4 -14
  73. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +93 -112
  74. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.module.css +0 -9
  75. package/dist/FormSteps/FileUploadStep/FileUploadStep.js +3 -1
  76. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +1 -1
  77. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +1 -1
  78. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.module.css +0 -7
  79. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +32 -18
  80. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.module.css +0 -7
  81. package/dist/FormSteps/MapperStep/MapperStep.d.ts +2 -2
  82. package/dist/FormSteps/MapperStep/MapperStep.js +4 -14
  83. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +1 -9
  84. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +7 -2
  85. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElement.d.ts +3 -2
  86. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElement.js +18 -10
  87. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +1 -9
  88. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +7 -2
  89. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +1 -1
  90. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +44 -228
  91. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.module.css +0 -7
  92. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +30 -14
  93. package/dist/FormSteps/RatingStep/RatingStep.js +3 -1
  94. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +36 -26
  95. package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +1 -1
  96. package/dist/FormSteps/SelectorStep/SelectorStep.js +4 -14
  97. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +1 -1
  98. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +3 -1
  99. package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +1 -1
  100. package/dist/FormSteps/SeparatorStep/SeparatorStep.js +4 -14
  101. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +5 -2
  102. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +119 -199
  103. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +9 -10
  104. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +3 -1
  105. package/dist/FormSteps/Step.d.ts +3 -4
  106. package/dist/FormSteps/Step.js +12 -8
  107. package/dist/FormSteps/StepFunctions.d.ts +10 -0
  108. package/dist/FormSteps/StepFunctions.js +156 -1
  109. package/dist/FormSteps/StepHooks.d.ts +23 -0
  110. package/dist/FormSteps/StepHooks.js +87 -0
  111. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +10 -0
  112. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +148 -0
  113. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -6
  114. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +40 -186
  115. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.module.css +0 -9
  116. package/dist/FormSteps/TextAreaStep/TextAreaStep.js +8 -2
  117. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -1
  118. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +43 -42
  119. package/dist/FormSteps/TextInputStep/TextInputStep.js +3 -1
  120. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +11 -6
  121. package/dist/FormSteps/TitleStep/TitleStep.d.ts +1 -1
  122. package/dist/FormSteps/TitleStep/TitleStep.js +4 -14
  123. package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
  124. package/dist/Icons/Construction/LeakIcon.js +2 -1
  125. package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
  126. package/dist/Icons/Construction/ProjectIcon.js +2 -1
  127. package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
  128. package/dist/Icons/Construction/PropertyIcon.js +2 -1
  129. package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
  130. package/dist/Icons/Construction/SpaceIcon.js +2 -1
  131. package/dist/Icons/DocumentIcon.d.ts +2 -2
  132. package/dist/Icons/DocumentIcon.js +2 -1
  133. package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
  134. package/dist/Icons/Entities/CheckListIcon.js +2 -1
  135. package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -1
  136. package/dist/Icons/Entities/GenericEntityIcon.js +1 -1
  137. package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -1
  138. package/dist/Icons/Entities/HandshakeIcon.js +1 -1
  139. package/dist/Icons/Entities/SupplierIcon.d.ts +2 -1
  140. package/dist/Icons/Entities/SupplierIcon.js +4 -1
  141. package/dist/{controllers → Services}/FileService.d.ts +1 -1
  142. package/dist/{controllers → Services}/FileService.js +5 -5
  143. package/dist/Services/FormService.d.ts +5 -0
  144. package/dist/Services/FormService.js +59 -0
  145. package/dist/Services/OrganizationService.d.ts +2 -0
  146. package/dist/Services/OrganizationService.js +65 -0
  147. package/dist/Shared/Navbar/Navbar.module.css +8 -0
  148. package/dist/{shared → Shared}/Rating/Rating.d.ts +1 -1
  149. package/dist/Shared/Rating/Rating.module.css +18 -0
  150. package/dist/{shared → Shared}/Rating/Ratings/LikeRating.js +5 -5
  151. package/dist/{shared → Shared}/Rating/Ratings/SatisfactionRating.js +9 -9
  152. package/dist/{shared → Shared}/Rating/Ratings/ScaleRating.js +1 -2
  153. package/dist/{shared → Shared}/RoundedCheckBox/RoundedCheckBox.d.ts +1 -1
  154. package/dist/{shared → Shared}/RoundedSmartSelect/RoundedSmartSelect.js +4 -4
  155. package/dist/{shared → Shared}/RoundedTextField/RoundedTextField.d.ts +1 -1
  156. package/dist/{shared → Shared}/RoundedTextField/RoundedTextField.js +3 -2
  157. package/dist/Shared/RoundedTextField/RoundedTextField.stories.d.ts +24 -0
  158. package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +25 -0
  159. package/dist/States/GlobalStateReducer.d.ts +35 -0
  160. package/dist/States/GlobalStateReducer.js +34 -0
  161. package/dist/States/SiteStateReducer.d.ts +63 -0
  162. package/dist/States/SiteStateReducer.js +110 -0
  163. package/dist/States/WidthStatsStateReducer.d.ts +11 -0
  164. package/dist/States/WidthStatsStateReducer.js +64 -0
  165. package/dist/Utils/DraftFunctions.d.ts +3 -0
  166. package/dist/Utils/DraftFunctions.js +42 -0
  167. package/dist/Utils/MaterialProviders.d.ts +6 -0
  168. package/dist/Utils/MaterialProviders.js +31 -0
  169. package/dist/Utils/store.d.ts +25 -0
  170. package/dist/Utils/store.js +52 -0
  171. package/dist/Widget.js +3 -3
  172. package/dist/constants/CBRFormStepTypes.d.ts +2 -2
  173. package/dist/constants/CBRFormStepTypes.js +22 -22
  174. package/dist/hooks.d.ts +5 -0
  175. package/dist/hooks.js +7 -0
  176. package/dist/index.js +1 -1
  177. package/dist/index.lib.d.ts +1 -1
  178. package/dist/index.lib.js +1 -1
  179. package/package.json +63 -44
  180. package/dist/App.js +0 -472
  181. package/dist/shared/Navbar/Navbar.module.css +0 -18
  182. package/dist/shared/Rating/Rating.module.css +0 -32
  183. package/dist/{App.module.css → App/App.module.css} +0 -0
  184. package/dist/{shared → Shared}/InputIcon/InputIcon.d.ts +0 -0
  185. package/dist/{shared → Shared}/InputIcon/InputIcon.js +0 -0
  186. package/dist/{shared → Shared}/Loader/Loader.d.ts +0 -0
  187. package/dist/{shared → Shared}/Loader/Loader.js +0 -0
  188. package/dist/{shared → Shared}/Loader/Loader.module.css +0 -0
  189. package/dist/{shared → Shared}/Navbar/Navbar.d.ts +0 -0
  190. package/dist/{shared → Shared}/Navbar/Navbar.js +0 -0
  191. package/dist/{shared → Shared}/Rating/Rating.js +2 -2
  192. /package/dist/{shared → Shared}/Rating/Ratings/LikeRating.d.ts +0 -0
  193. /package/dist/{shared → Shared}/Rating/Ratings/SatisfactionRating.d.ts +0 -0
  194. /package/dist/{shared → Shared}/Rating/Ratings/ScaleRating.d.ts +0 -0
  195. /package/dist/{shared → Shared}/RoundedButton/RoundedButton.d.ts +0 -0
  196. /package/dist/{shared → Shared}/RoundedButton/RoundedButton.js +0 -0
  197. /package/dist/{shared → Shared}/RoundedCheckBox/RoundedCheckBox.js +0 -0
  198. /package/dist/{shared → Shared}/RoundedDatePicker/RoundedDatePicker.d.ts +0 -0
  199. /package/dist/{shared → Shared}/RoundedDatePicker/RoundedDatePicker.js +0 -0
  200. /package/dist/{shared → Shared}/RoundedSelect/RoundedSelect.d.ts +0 -0
  201. /package/dist/{shared → Shared}/RoundedSelect/RoundedSelect.js +0 -0
  202. /package/dist/{shared → Shared}/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -0
  203. /package/dist/{AxiosAPI.d.ts → Utils/AxiosAPI.d.ts} +0 -0
  204. /package/dist/{AxiosAPI.js → Utils/AxiosAPI.js} +0 -0
  205. /package/dist/{AxiosWidget.d.ts → Utils/AxiosWidget.d.ts} +0 -0
  206. /package/dist/{AxiosWidget.js → Utils/AxiosWidget.js} +0 -0
  207. /package/dist/{utils/CbrFunctions.d.ts → Utils/CBRFunctions.d.ts} +0 -0
  208. /package/dist/{utils/CbrFunctions.js → Utils/CBRFunctions.js} +0 -0
@@ -0,0 +1,6 @@
1
+ import { createContext } from 'react';
2
+ var CustomContext = createContext({
3
+ customSteps: {},
4
+ customStepProps: {},
5
+ });
6
+ export default CustomContext;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { Form } from '../@Types';
3
+ declare const FormContext: import("react").Context<Form>;
4
+ export default FormContext;
@@ -0,0 +1,19 @@
1
+ import { createContext } from 'react';
2
+ var FormContext = createContext({
3
+ firstSection: 'FIRST',
4
+ sections: {
5
+ FIRST: {
6
+ id: 'FIRST',
7
+ name: 'FIRST',
8
+ steps: [],
9
+ nextSection: null,
10
+ },
11
+ },
12
+ steps: {},
13
+ size: {
14
+ blockSize: 0,
15
+ blockNum: 4,
16
+ spacingSize: 0,
17
+ },
18
+ });
19
+ export default FormContext;
@@ -0,0 +1,3 @@
1
+ /// <reference types="react" />
2
+ declare const SectionContext: import("react").Context<string>;
3
+ export default SectionContext;
@@ -0,0 +1,3 @@
1
+ import { createContext } from 'react';
2
+ var SectionContext = createContext('NULL');
3
+ export default SectionContext;
@@ -1,12 +1,10 @@
1
1
  /// <reference types="react" />
2
- import { FormStyle } from '../../@Types/Form';
3
2
  interface ConfirmationDialogProps {
4
3
  confirmation: {
5
4
  case: string;
6
5
  url: string;
7
6
  };
8
- onClose: Function;
9
- formStyle: FormStyle;
7
+ onClose: () => void;
10
8
  }
11
- declare function ConfirmationDialog({ confirmation, formStyle, onClose, }: ConfirmationDialogProps): JSX.Element;
9
+ declare function ConfirmationDialog({ confirmation, onClose, }: ConfirmationDialogProps): JSX.Element;
12
10
  export default ConfirmationDialog;
@@ -14,8 +14,10 @@ import CheckCircleOutlineRoundedIcon from '@material-ui/icons/CheckCircleOutline
14
14
  import styles from './ConfirmationDialog.module.css';
15
15
  import Dialog from '@material-ui/core/Dialog';
16
16
  import CloseRoundedIcon from '@material-ui/icons/CloseRounded';
17
+ import { useAppSelector } from '../../hooks';
17
18
  function ConfirmationDialog(_a) {
18
- var confirmation = _a.confirmation, formStyle = _a.formStyle, onClose = _a.onClose;
19
+ var confirmation = _a.confirmation, onClose = _a.onClose;
20
+ var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
19
21
  return (_jsx(Dialog, __assign({ PaperProps: {
20
22
  style: {
21
23
  borderRadius: '20px',
@@ -1,14 +1,17 @@
1
1
  import React from 'react';
2
- import { Organization } from '../@Types/@Types';
3
- import { Form, FormStyle } from '../@Types/Form';
4
- import { CustomStep } from '../App';
5
2
  import { Branding } from '../@Types/Branding';
6
3
  import StepTypes from '../constants/FormStepTypes';
7
- import { FieldValues, UseFormReturn } from 'react-hook-form';
4
+ import { FieldValues } from 'react-hook-form';
5
+ import { AppProps } from '../App/App';
6
+ import CBRFormStepTypes from '../constants/CBRFormStepTypes';
7
+ import { Form } from '../@Types';
8
+ import { FormStep } from '../@Types/FormStep';
9
+ import { CBRFormStep } from '../@Types/CBRFormStep';
8
10
  export declare const getLocale: () => any;
9
11
  export interface StepDependency {
12
+ dependents: (FormStep | CBRFormStep)[];
10
13
  value: any | undefined;
11
- type: StepTypes | 'ORIGINAL';
14
+ type: StepTypes | CBRFormStepTypes | 'ORIGINAL';
12
15
  empty?: boolean;
13
16
  }
14
17
  export type DependencyStore = Record<string, StepDependency>;
@@ -17,39 +20,19 @@ export interface WidthStats {
17
20
  isResponsive: boolean;
18
21
  isMobile: boolean;
19
22
  }
20
- export interface FormComponentProps {
23
+ type CustomAppProps = Pick<AppProps, 'customSteps' | 'customSubmitBtns'>;
24
+ export interface BaseFormProps extends CustomAppProps {
21
25
  form: Form;
22
- formController: UseFormReturn;
23
- organization: Organization;
24
26
  branding?: Branding;
25
- originalValues: Record<string, unknown>;
26
- customSteps: Record<string, CustomStep>;
27
- customStepProps: Record<string, any>;
28
- customSend?: (values: any, reload: Function) => Promise<any>;
29
- customSubmit?: JSX.Element;
30
- widthStats: WidthStats;
31
- internal: boolean;
32
- reload: Function;
33
- partial: boolean;
34
- postview: boolean;
35
- preview: boolean;
36
- formStyle: FormStyle;
37
- domain?: string;
27
+ reload: () => void;
28
+ isWidget: boolean;
38
29
  apiKey: string | undefined;
39
- /** Function to call on postview to fetch the download url of a file */
40
- fetchDownloadUrl?: (S3Key: string, fileName: string) => Promise<string>;
41
- /** If the form can be edited (For entities) */
42
- editable: boolean;
43
- /** The custom send label to display */
44
- sendLabel?: string;
30
+ customSubmit: AppProps['customSubmit'];
31
+ containerRef: React.RefObject<HTMLDivElement>;
32
+ }
33
+ export interface FormComponentProps extends CustomAppProps {
45
34
  /** Function called when users clicks submit */
46
35
  onSubmit: (values: FieldValues) => Promise<any>;
47
- dependencyStore: DependencyStore;
48
- setDependencyStore: React.Dispatch<React.SetStateAction<DependencyStore>>;
49
36
  }
50
- declare function FormComponent({ form, isWidget, internal, postview, branding, organization, containerRef, ...others }: Omit<FormComponentProps, 'widthStats' | 'formStyle' | 'formController' | 'onSubmit' | 'setDependencyStore' | 'dependencyStore'> & {
51
- containerRef: any;
52
- organization: Organization | null;
53
- isWidget: boolean;
54
- }): JSX.Element;
37
+ declare function FormComponent({ form, apiKey, reload, isWidget, branding, customSteps, containerRef, customSubmit, customSubmitBtns, }: BaseFormProps): JSX.Element;
55
38
  export default FormComponent;
package/dist/Form/Form.js CHANGED
@@ -45,20 +45,9 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
45
45
  if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
46
  }
47
47
  };
48
- var __rest = (this && this.__rest) || function (s, e) {
49
- var t = {};
50
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
51
- t[p] = s[p];
52
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
53
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
54
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
55
- t[p[i]] = s[p[i]];
56
- }
57
- return t;
58
- };
59
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
60
- import React, { useEffect, useMemo, useRef, useState } from 'react';
61
- import Navbar from '../shared/Navbar/Navbar';
48
+ import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
49
+ import React, { useCallback, useContext, useEffect, useRef, useState, } from 'react';
50
+ import Navbar from '../Shared/Navbar/Navbar';
62
51
  import styles from './Form.module.css';
63
52
  import InternalFormStyle from '../constants/InternalFormStyle';
64
53
  import enLocale from 'date-fns/locale/en-US';
@@ -66,16 +55,18 @@ import esLocale from 'date-fns/locale/es';
66
55
  import ColumnForm from './FormTypes/ColumnForm/ColumnForm';
67
56
  import StepperForm from './FormTypes/StepperForm/StepperForm';
68
57
  import { FormStyleTypes, FormTypes, } from '../constants/FormStepTypes';
69
- import { MuiPickersUtilsProvider } from '@material-ui/pickers';
70
- import DateFnsUtils from '@date-io/date-fns';
71
- import { createGenerateClassName, createTheme, StylesProvider, ThemeProvider, } from '@material-ui/core';
72
- import { SEED } from '../constants/MaterialClassNameSeed';
73
- import { calcDependencies, calcValue } from './FormFunctions';
74
- import { useForm } from 'react-hook-form';
75
- import widgetInstance from '../AxiosWidget';
76
- import axiosInstance from '../AxiosAPI';
58
+ import { calcValue } from './FormFunctions';
59
+ import { FormProvider, useForm } from 'react-hook-form';
60
+ import widgetInstance from '../Utils/AxiosWidget';
61
+ import axiosInstance from '../Utils/AxiosAPI';
77
62
  import ReCAPTCHA from 'react-google-recaptcha';
78
63
  import ConfirmationDialog from './ConfirmationDialog/ConfirmationDialog';
64
+ import MaterialProviders from '../Utils/MaterialProviders';
65
+ import { useWidthStats } from '../States/WidthStatsStateReducer';
66
+ import { useAppDispatch, useAppSelector } from '../hooks';
67
+ import FormContext from '../Contexts/FormContext';
68
+ import { getAppState } from '../Utils/store';
69
+ import { focusStep } from '../States/SiteStateReducer';
79
70
  var localeMap = {
80
71
  en: enLocale,
81
72
  'en-US': enLocale,
@@ -91,38 +82,46 @@ export var getLocale = function () {
91
82
  };
92
83
  function FormComponent(_a) {
93
84
  var _this = this;
94
- var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
95
- var form = _a.form, isWidget = _a.isWidget, internal = _a.internal, postview = _a.postview, branding = _a.branding, organization = _a.organization, containerRef = _a.containerRef, others = __rest(_a, ["form", "isWidget", "internal", "postview", "branding", "organization", "containerRef"]);
96
- var apiKey = others.apiKey, domain = others.domain, customSteps = others.customSteps, originalValues = others.originalValues, customSend = others.customSend;
97
- var _m = useState(calcDependencies(form.steps, originalValues, customSteps)), dependencyStore = _m[0], setDependencyStore = _m[1];
98
- var formController = useForm({
99
- defaultValues: originalValues,
85
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k;
86
+ var form = _a.form, apiKey = _a.apiKey, reload = _a.reload, isWidget = _a.isWidget, branding = _a.branding, customSteps = _a.customSteps, containerRef = _a.containerRef, customSubmit = _a.customSubmit, customSubmitBtns = _a.customSubmitBtns;
87
+ var _l = useAppSelector(function (state) { return state.global; }), idOrganization = _l.idOrganization, internal = _l.internal, postview = _l.postview;
88
+ var formMethods = useForm({
100
89
  mode: 'onTouched',
101
90
  shouldFocusError: true,
102
91
  });
103
92
  var recaptchaRef = useRef();
104
- var _o = useState(), showConfirmation = _o[0], setShowConfirmation = _o[1];
105
- var onSubmit = function (values) { return __awaiter(_this, void 0, void 0, function () {
106
- var token, token_1, newValues, deleteIds, _i, _a, idStep, _b, deleteIds_1, id, customResp, params, url, axios, resp, error_1;
93
+ var dispatch = useAppDispatch();
94
+ var _m = useState(), showConfirmation = _m[0], setShowConfirmation = _m[1];
95
+ var idFocusStep = useAppSelector(function (state) { return state.site.focusStep; });
96
+ useEffect(function () {
97
+ if (idFocusStep) {
98
+ formMethods.setFocus(idFocusStep);
99
+ dispatch(focusStep(undefined));
100
+ }
101
+ }, [idFocusStep]);
102
+ var onSubmit = useCallback(function (values) { return __awaiter(_this, void 0, void 0, function () {
103
+ var token, state, newValues, deleteIds, _i, _a, idStep, _b, deleteIds_1, id, params, url, axios, resp, error_1;
107
104
  return __generator(this, function (_c) {
108
105
  switch (_c.label) {
109
106
  case 0:
110
- values = __assign(__assign({}, originalValues), values);
111
107
  token = null;
112
- if (!(form.hasCaptcha && !internal && !customSend)) return [3 /*break*/, 2];
113
- token_1 = recaptchaRef.current.getValue();
114
- if (!!token_1) return [3 /*break*/, 2];
108
+ if (!(form.hasCaptcha && !internal && !customSubmit)) return [3 /*break*/, 2];
109
+ token = recaptchaRef.current.getValue();
110
+ if (!!token) return [3 /*break*/, 2];
115
111
  return [4 /*yield*/, (recaptchaRef === null || recaptchaRef === void 0 ? void 0 : recaptchaRef.current.executeAsync())];
116
112
  case 1:
117
- token_1 = _c.sent();
113
+ token = _c.sent();
118
114
  _c.label = 2;
119
115
  case 2:
120
- if (!apiKey && !internal && !customSend)
116
+ if (!apiKey && !internal && !customSubmit)
121
117
  return [2 /*return*/];
122
118
  _c.label = 3;
123
119
  case 3:
124
- _c.trys.push([3, 7, , 8]);
125
- newValues = {};
120
+ _c.trys.push([3, 8, , 9]);
121
+ return [4 /*yield*/, dispatch(getAppState()).unwrap()];
122
+ case 4:
123
+ state = _c.sent();
124
+ newValues = __assign({}, state.site.values.global);
126
125
  deleteIds = [];
127
126
  for (_i = 0, _a = Object.keys(values); _i < _a.length; _i++) {
128
127
  idStep = _a[_i];
@@ -132,121 +131,71 @@ function FormComponent(_a) {
132
131
  id = deleteIds_1[_b];
133
132
  delete newValues[id];
134
133
  }
135
- if (!customSend) return [3 /*break*/, 5];
136
- return [4 /*yield*/, customSend(newValues, others.reload)];
137
- case 4:
138
- customResp = _c.sent();
139
- return [2 /*return*/, customResp];
140
- case 5:
134
+ if (!customSubmit) return [3 /*break*/, 6];
135
+ return [4 /*yield*/, customSubmit(newValues, reload)];
136
+ case 5: return [2 /*return*/, _c.sent()];
137
+ case 6:
138
+ if (customSubmitBtns)
139
+ return [2 /*return*/, newValues];
141
140
  params = new URLSearchParams();
142
- if (domain || internal)
143
- params.set('idOrganization', domain !== null && domain !== void 0 ? domain : '');
141
+ if (idOrganization || internal)
142
+ params.set('idOrganization', idOrganization !== null && idOrganization !== void 0 ? idOrganization : '');
144
143
  if (token)
145
144
  params.set('token', token);
146
145
  url = "/ticket/".concat(internal ? form.apiKey : apiKey);
147
146
  if (params.toString()) {
148
147
  url += "?".concat(params.toString());
149
148
  }
150
- axios = domain || internal ? widgetInstance : axiosInstance;
149
+ axios = idOrganization || internal ? widgetInstance : axiosInstance;
151
150
  return [4 /*yield*/, axios.post(url, newValues)];
152
- case 6:
151
+ case 7:
153
152
  resp = _c.sent();
154
153
  setShowConfirmation(resp === null || resp === void 0 ? void 0 : resp.data);
155
- return [3 /*break*/, 8];
156
- case 7:
154
+ return [3 /*break*/, 9];
155
+ case 8:
157
156
  error_1 = _c.sent();
158
157
  console.error(error_1);
159
- return [3 /*break*/, 8];
160
- case 8: return [2 /*return*/];
158
+ return [3 /*break*/, 9];
159
+ case 9: return [2 /*return*/];
161
160
  }
162
161
  });
163
- }); };
164
- var _p = useState(undefined), widthStats = _p[0], setWidthStats = _p[1];
165
- /** Calcs the currentBreakPoint and if is mobile */
166
- var handleResize = function () {
167
- var _a;
168
- var currentWidth = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
169
- if (currentWidth !== undefined) {
170
- var currentBreakPoint = form.size.blockNum;
171
- var padding = postview || internal || !form.isStandAlone ? 0 : 40;
172
- while (currentWidth <
173
- (form.size.blockSize + form.size.spacingSize) *
174
- currentBreakPoint +
175
- padding) {
176
- currentBreakPoint--;
177
- }
178
- setWidthStats({
179
- isResponsive: currentWidth <
180
- (form.size.blockSize + form.size.spacingSize) *
181
- form.size.blockNum +
182
- padding,
183
- isMobile: currentWidth <
184
- (form.size.blockSize + form.size.spacingSize) * 2 + padding,
185
- currentBreakPoint: currentBreakPoint,
186
- });
187
- }
188
- };
189
- useEffect(function () {
190
- /** On load add a resize listener to calc the currentBreakpoint */
191
- window.addEventListener('resize', handleResize);
192
- handleResize();
193
- return function () {
194
- window.removeEventListener('resize', handleResize);
195
- };
196
- }, [containerRef.current, (_b = containerRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth]);
197
- var formStyle = useMemo(function () {
198
- var _a;
199
- return internal
200
- ? InternalFormStyle
201
- : __assign(__assign({}, InternalFormStyle), ((_a = form.style) !== null && _a !== void 0 ? _a : {}));
202
- }, []);
203
- if (!widthStats)
204
- return _jsx("div", {});
162
+ }); }, [customSteps, internal, customSubmit, idOrganization]);
163
+ useWidthStats(containerRef, form, postview, internal);
164
+ var isResponsive = useAppSelector(function (state) { return state.widthStats.isResponsive; });
205
165
  var renderForm = function () {
206
- return (_jsxs(React.Fragment, { children: [showConfirmation !== undefined && (_jsx(ConfirmationDialog, { formStyle: formStyle, confirmation: showConfirmation, onClose: function () {
207
- others.reload();
166
+ return (_jsxs(React.Fragment, { children: [showConfirmation !== undefined && (_jsx(ConfirmationDialog, { confirmation: showConfirmation, onClose: function () {
167
+ reload();
208
168
  setShowConfirmation(undefined);
209
- } })), form.hasCaptcha && !internal && (_jsx(ReCAPTCHA, { ref: recaptchaRef, sitekey: "6LcL22kkAAAAAEotDeAFbRATob-u5vbibbCyWL2p", size: 'invisible', badge: 'bottomright' })), _jsx(FormTypeComponent, __assign({}, others, { branding: branding, widthStats: widthStats, form: form, internal: internal, postview: postview, organization: organization, formStyle: formStyle, onSubmit: onSubmit, formController: formController, dependencyStore: dependencyStore, setDependencyStore: setDependencyStore }))] }));
169
+ } })), form.hasCaptcha && !internal && (_jsx(ReCAPTCHA, { ref: recaptchaRef, sitekey: "6LcL22kkAAAAAEotDeAFbRATob-u5vbibbCyWL2p", size: 'invisible', badge: 'bottomright' })), _jsx(FormProvider, __assign({}, formMethods, { children: _jsx(FormContext.Provider, __assign({ value: form }, { children: _jsx(FormTypeComponent, { onSubmit: onSubmit, customSubmitBtns: customSubmitBtns }) })) }))] }));
210
170
  };
171
+ if (!idOrganization)
172
+ return _jsx(_Fragment, {});
211
173
  //If currently displaying internal or form is standalone
212
- if ((postview || internal || !form.isStandAlone) &&
213
- widthStats !== undefined) {
174
+ if (postview || internal || !form.isStandAlone) {
214
175
  return (_jsx("div", __assign({ style: {
215
176
  backgroundColor: internal
216
177
  ? 'transparent'
217
- : (_d = (_c = form.style) === null || _c === void 0 ? void 0 : _c.backgroundColor) !== null && _d !== void 0 ? _d : InternalFormStyle.backgroundColor,
178
+ : (_c = (_b = form.style) === null || _b === void 0 ? void 0 : _b.backgroundColor) !== null && _c !== void 0 ? _c : InternalFormStyle.backgroundColor,
218
179
  minHeight: form.isStandAlone && !isWidget ? '100vh' : '100%',
219
180
  } }, { children: _jsx("div", __assign({ className: styles.widgetFormContainer, ref: containerRef }, { children: renderForm() })) })));
220
181
  }
221
- else if (organization && widthStats !== undefined) {
182
+ else {
222
183
  //Standalone cant have widget
223
- return (_jsxs(React.Fragment, { children: [_jsx(Navbar, { logo: branding === null || branding === void 0 ? void 0 : branding.images.logoUrl, color: (_f = (_e = branding === null || branding === void 0 ? void 0 : branding.colors) === null || _e === void 0 ? void 0 : _e.navbarColor) !== null && _f !== void 0 ? _f : (_g = branding === null || branding === void 0 ? void 0 : branding.colors) === null || _g === void 0 ? void 0 : _g.primaryColor }), _jsx("div", __assign({ className: styles.standAloneFormContainer, ref: containerRef, style: {
224
- background: (_j = (_h = form.style) === null || _h === void 0 ? void 0 : _h.standAloneBackgroundColor) !== null && _j !== void 0 ? _j : '#ffffff',
225
- } }, { children: _jsx("div", __assign({ className: widthStats.isResponsive
184
+ return (_jsxs(React.Fragment, { children: [_jsx(Navbar, { logo: branding === null || branding === void 0 ? void 0 : branding.images.logoUrl, color: (_e = (_d = branding === null || branding === void 0 ? void 0 : branding.colors) === null || _d === void 0 ? void 0 : _d.navbarColor) !== null && _e !== void 0 ? _e : (_f = branding === null || branding === void 0 ? void 0 : branding.colors) === null || _f === void 0 ? void 0 : _f.primaryColor }), _jsx("div", __assign({ className: styles.standAloneFormContainer, ref: containerRef, style: {
185
+ background: (_h = (_g = form.style) === null || _g === void 0 ? void 0 : _g.standAloneBackgroundColor) !== null && _h !== void 0 ? _h : '#ffffff',
186
+ } }, { children: _jsx("div", __assign({ className: isResponsive
226
187
  ? styles.fullScreenStandAloneForm
227
188
  : styles.standAloneFormCard, style: {
228
- backgroundColor: (_l = (_k = form.style) === null || _k === void 0 ? void 0 : _k.backgroundColor) !== null && _l !== void 0 ? _l : InternalFormStyle.backgroundColor,
229
- // visibility: loaded ? 'visible' : 'hidden',
189
+ backgroundColor: (_k = (_j = form.style) === null || _j === void 0 ? void 0 : _j.backgroundColor) !== null && _k !== void 0 ? _k : InternalFormStyle.backgroundColor,
230
190
  } }, { children: renderForm() })) }))] }));
231
191
  }
232
- else {
233
- return _jsx("div", {});
234
- }
235
192
  }
236
193
  export default FormComponent;
237
- var muiTheme = createTheme({
238
- typography: {
239
- fontFamily: 'inherit',
240
- },
241
- });
242
- var generateClassName = createGenerateClassName({
243
- seed: SEED,
244
- productionPrefix: 'efjss',
245
- });
246
- function FormTypeComponent(_a) {
247
- var props = __rest(_a, []);
194
+ function FormTypeComponent(props) {
195
+ var formStyle = useAppSelector(function (state) { return state.global; }).formStyle;
196
+ var form = useContext(FormContext);
248
197
  var renderTypes = function () {
249
- switch (props.form.type) {
198
+ switch (form.type) {
250
199
  case FormTypes.STEPPER: {
251
200
  return _jsx(StepperForm, __assign({}, props));
252
201
  }
@@ -256,9 +205,9 @@ function FormTypeComponent(_a) {
256
205
  }
257
206
  }
258
207
  };
259
- switch (props.formStyle.type) {
208
+ switch (formStyle.type) {
260
209
  case FormStyleTypes.MATERIAL:
261
- return (_jsx(StylesProvider, __assign({ generateClassName: generateClassName }, { children: _jsx(ThemeProvider, __assign({ theme: muiTheme }, { children: _jsx(MuiPickersUtilsProvider, __assign({ utils: DateFnsUtils, locale: getLocale() }, { children: renderTypes() })) })) })));
210
+ return _jsx(MaterialProviders, { children: renderTypes() });
262
211
  default:
263
212
  return renderTypes();
264
213
  }
@@ -1,6 +1,7 @@
1
1
  import { FormStep } from '../@Types/FormStep';
2
- import { CustomStep } from '../App';
3
2
  import { DependencyStore, StepDependency } from './Form';
4
- export declare const calcValue: (idStep: string, steps: Record<string, FormStep>, values: Record<string, any>, customSteps: Record<string, CustomStep>, deleteIds: string[], value?: any) => any;
5
- export declare function calcDependencies(steps: Record<string, FormStep>, originalValues: Record<string, any>, customSteps?: Record<string, CustomStep>, allSteps?: Record<string, FormStep>, dependencies?: DependencyStore): DependencyStore;
6
- export declare function calcStepDependency(idStep: string, steps: Record<string, FormStep>, originalValues: Record<string, any>, customSteps: Record<string, CustomStep>): StepDependency;
3
+ import { CustomStep } from '../FormSteps/CustomStep';
4
+ import { CBRFormStep } from '../@Types/CBRFormStep';
5
+ export declare const calcValue: (idStep: string, steps: Record<string, FormStep>, values: Record<string, any>, customSteps: Record<string, CustomStep> | undefined, deleteIds: string[], value?: any) => any;
6
+ export declare function calcDependencies(steps: Record<string, FormStep | CBRFormStep>, originalValues?: Record<string, any>, customSteps?: Record<string, CustomStep>, allSteps?: Record<string, FormStep | CBRFormStep>, dependencies?: DependencyStore): DependencyStore;
7
+ export declare function calcStepDependency(idStep: string, steps: Record<string, FormStep | CBRFormStep>, originalValues: Record<string, any>, customSteps: Record<string, CustomStep>): StepDependency;
@@ -26,7 +26,7 @@ export var calcValue = function (idStep, steps, values, customSteps, deleteIds,
26
26
  var step = steps[idStep];
27
27
  if (!step)
28
28
  return value;
29
- var custom = customSteps[step === null || step === void 0 ? void 0 : step.type];
29
+ var custom = customSteps === null || customSteps === void 0 ? void 0 : customSteps[step === null || step === void 0 ? void 0 : step.type];
30
30
  if (custom !== undefined) {
31
31
  return (_b = (_a = custom.calcValue) === null || _a === void 0 ? void 0 : _a.call(custom, step, value)) !== null && _b !== void 0 ? _b : value;
32
32
  }
@@ -114,6 +114,7 @@ function stringToDraft(text) {
114
114
  }
115
115
  export function calcDependencies(steps, originalValues, customSteps, allSteps, dependencies) {
116
116
  var _a, _b, _c;
117
+ if (originalValues === void 0) { originalValues = {}; }
117
118
  if (customSteps === void 0) { customSteps = {}; }
118
119
  if (allSteps === void 0) { allSteps = steps; }
119
120
  if (dependencies === void 0) { dependencies = {}; }
@@ -122,24 +123,37 @@ export function calcDependencies(steps, originalValues, customSteps, allSteps, d
122
123
  if (step.dependencies) {
123
124
  for (var _e = 0, _f = step.dependencies; _e < _f.length; _e++) {
124
125
  var idDep = _f[_e];
125
- if (dependencies[idDep] !== undefined)
126
+ if (dependencies[idDep] === undefined)
127
+ dependencies[idDep] = calcStepDependency(idDep, allSteps, originalValues, customSteps);
128
+ dependencies[idDep].dependents.push(step);
129
+ }
130
+ }
131
+ if (step.type === StepTypes.ENTITYVALUEPICKER) {
132
+ for (var _g = 0, _h = __spreadArray(__spreadArray([], step.path, true), step.filters, true); _g < _h.length; _g++) {
133
+ var path = _h[_g];
134
+ if (path.type !== EntityValueDataTypes.STEP)
135
+ continue;
136
+ if ((_a = step.dependencies) === null || _a === void 0 ? void 0 : _a.includes(path.idStep))
126
137
  continue;
127
- dependencies[idDep] = calcStepDependency(idDep, allSteps, originalValues, customSteps);
138
+ if (dependencies[path.idStep] === undefined) {
139
+ dependencies[path.idStep] = calcStepDependency(path.idStep, allSteps, originalValues, customSteps);
140
+ }
141
+ dependencies[path.idStep].dependents.push(step);
128
142
  }
129
143
  }
130
144
  if (step.type === StepTypes.MAPPER) {
131
145
  var newSteps = {};
132
- var elements = (_a = originalValues[step.id]) !== null && _a !== void 0 ? _a : [];
146
+ var elements = (_b = originalValues[step.id]) !== null && _b !== void 0 ? _b : [];
133
147
  var _loop_1 = function (element) {
134
- for (var _m = 0, _o = Object.keys(step.steps); _m < _o.length; _m++) {
135
- var idSubStep = _o[_m];
148
+ for (var _k = 0, _l = Object.keys(step.steps); _k < _l.length; _k++) {
149
+ var idSubStep = _l[_k];
136
150
  var subStep = step.steps[idSubStep];
137
151
  var mappedId = element.ids[idSubStep];
138
- newSteps[mappedId] = __assign(__assign({}, subStep), { id: mappedId, dependencies: (_b = subStep.dependencies) === null || _b === void 0 ? void 0 : _b.map(function (dep) { var _a; return (_a = element.ids[dep]) !== null && _a !== void 0 ? _a : dep; }) });
152
+ newSteps[mappedId] = __assign(__assign({}, subStep), { id: mappedId, dependencies: (_c = subStep.dependencies) === null || _c === void 0 ? void 0 : _c.map(function (dep) { var _a; return (_a = element.ids[dep]) !== null && _a !== void 0 ? _a : dep; }) });
139
153
  }
140
154
  };
141
- for (var _g = 0, elements_2 = elements; _g < elements_2.length; _g++) {
142
- var element = elements_2[_g];
155
+ for (var _j = 0, elements_2 = elements; _j < elements_2.length; _j++) {
156
+ var element = elements_2[_j];
143
157
  _loop_1(element);
144
158
  }
145
159
  if (elements.length === 0) {
@@ -148,22 +162,6 @@ export function calcDependencies(steps, originalValues, customSteps, allSteps, d
148
162
  calcDependencies(newSteps, originalValues, customSteps, __assign(__assign({}, allSteps), newSteps), dependencies);
149
163
  }
150
164
  }
151
- /** After all steps have been checked check missing entityvalue dependencies */
152
- for (var _h = 0, _j = Object.values(steps); _h < _j.length; _h++) {
153
- var step = _j[_h];
154
- if (step.type === StepTypes.ENTITYVALUEPICKER) {
155
- for (var _k = 0, _l = __spreadArray(__spreadArray([], step.path, true), step.filters, true); _k < _l.length; _k++) {
156
- var path = _l[_k];
157
- if (path.type !== EntityValueDataTypes.STEP)
158
- continue;
159
- if ((_c = step.dependencies) === null || _c === void 0 ? void 0 : _c.includes(path.idStep))
160
- continue;
161
- if (dependencies[path.idStep] === undefined) {
162
- dependencies[path.idStep] = calcStepDependency(path.idStep, allSteps, originalValues, customSteps);
163
- }
164
- }
165
- }
166
- }
167
165
  return dependencies;
168
166
  }
169
167
  export function calcStepDependency(idStep, steps, originalValues, customSteps) {
@@ -174,6 +172,7 @@ export function calcStepDependency(idStep, steps, originalValues, customSteps) {
174
172
  value: depStep
175
173
  ? calcStepDependencyValue(depStep, originalValues, customSteps)
176
174
  : (_b = originalValues[idStep]) !== null && _b !== void 0 ? _b : null,
175
+ dependents: [],
177
176
  };
178
177
  }
179
178
  function calcStepDependencyValue(depStep, originalValues, customSteps) {
@@ -1,4 +1,4 @@
1
1
  /// <reference types="react" />
2
2
  import { FormComponentProps } from '../../Form';
3
- declare function ColumnForm({ onSubmit, formController, ...props }: FormComponentProps): JSX.Element;
3
+ declare function ColumnForm({ onSubmit, customSubmitBtns, }: FormComponentProps): JSX.Element;
4
4
  export default ColumnForm;