@arquimedes.co/eureka-forms 3.0.0-refactor → 3.0.1-refactor

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 (188) hide show
  1. package/dist/@Types/@Types.d.ts +2 -0
  2. package/dist/@Types/AYFFormStep.d.ts +19 -0
  3. package/dist/@Types/Branding.d.ts +13 -0
  4. package/dist/@Types/CBRFormStep.d.ts +74 -0
  5. package/dist/@Types/Condition.d.ts +143 -0
  6. package/dist/@Types/Draft/Draft.d.ts +12 -0
  7. package/dist/@Types/Draft/DraftEntityData.d.ts +54 -0
  8. package/dist/@Types/Entity.d.ts +36 -0
  9. package/dist/@Types/Form.d.ts +75 -0
  10. package/dist/@Types/FormStep.d.ts +219 -0
  11. package/dist/@Types/GenericFormSteps.d.ts +84 -0
  12. package/dist/@Types/MapperElement.d.ts +8 -0
  13. package/dist/@Types/Organization.d.ts +11 -0
  14. package/dist/@Types/Time.d.ts +6 -0
  15. package/dist/@Types/index.d.ts +1 -0
  16. package/dist/App/App.d.ts +57 -0
  17. package/dist/App/AppFunctions.d.ts +23 -0
  18. package/dist/App/AppFunctions.test.d.ts +1 -0
  19. package/dist/App/AppHooks.d.ts +10 -0
  20. package/dist/App/AppHooks.test.d.ts +1 -0
  21. package/dist/Contexts/CustomContext.d.ts +11 -0
  22. package/dist/Contexts/FormContext.d.ts +6 -0
  23. package/dist/Contexts/SectionContext.d.ts +2 -0
  24. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +11 -0
  25. package/dist/Form/Form.d.ts +39 -0
  26. package/dist/Form/FormFunctions.d.ts +12 -0
  27. package/dist/Form/FormFunctions.test.d.ts +1 -0
  28. package/dist/Form/FormHooks.d.ts +2 -0
  29. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +3 -0
  30. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +3 -0
  31. package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +3 -0
  32. package/dist/Form/Section/Section.d.ts +5 -0
  33. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +3 -0
  34. package/dist/Form/Terms/Term/Term.d.ts +7 -0
  35. package/dist/Form/Terms/Terms.d.ts +2 -0
  36. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +7 -0
  37. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +8 -0
  38. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +7 -0
  39. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +10 -0
  40. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +7 -0
  41. package/dist/FormSteps/AYFStepMapper.d.ts +11 -0
  42. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +14 -0
  43. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +3 -0
  44. package/dist/FormSteps/CBRStepMapper.d.ts +12 -0
  45. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +8 -0
  46. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +3 -0
  47. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +8 -0
  48. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +3 -0
  49. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +8 -0
  50. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +3 -0
  51. package/dist/FormSteps/CustomStep.d.ts +26 -0
  52. package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +10 -0
  53. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +3 -0
  54. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +14 -0
  55. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +11 -0
  56. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +3 -0
  57. package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +8 -0
  58. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +13 -0
  59. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +2 -0
  60. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +16 -0
  61. package/dist/FormSteps/MapperStep/MapperStep.d.ts +17 -0
  62. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +4 -0
  63. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.d.ts +15 -0
  64. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +4 -0
  65. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +4 -0
  66. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +20 -0
  67. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +3 -0
  68. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +10 -0
  69. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +3 -0
  70. package/dist/FormSteps/RatingStep/RatingStep.d.ts +8 -0
  71. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +3 -0
  72. package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +8 -0
  73. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +3 -0
  74. package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +8 -0
  75. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +4 -0
  76. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +35 -0
  77. package/dist/FormSteps/Step.d.ts +7 -0
  78. package/dist/FormSteps/StepFunctions.d.ts +27 -0
  79. package/dist/FormSteps/StepFunctions.test.d.ts +1 -0
  80. package/dist/FormSteps/StepHooks.d.ts +109 -0
  81. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +9 -0
  82. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +7 -0
  83. package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +9 -0
  84. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +3 -0
  85. package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +16 -0
  86. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +3 -0
  87. package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +11 -0
  88. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +3 -0
  89. package/dist/FormSteps/TitleStep/TitleStep.d.ts +8 -0
  90. package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +9 -0
  91. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +11 -0
  92. package/dist/Icons/@IconTypes.d.ts +6 -0
  93. package/dist/Icons/ArrowLeftIcon.d.ts +3 -0
  94. package/dist/Icons/ArrowRightIcon.d.ts +3 -0
  95. package/dist/Icons/CalendarIcon.d.ts +3 -0
  96. package/dist/Icons/CheckCircleIcon.d.ts +3 -0
  97. package/dist/Icons/CheckboxCheckedIcon.d.ts +3 -0
  98. package/dist/Icons/CheckboxUncheckedIcon.d.ts +3 -0
  99. package/dist/Icons/ClockIcon.d.ts +3 -0
  100. package/dist/Icons/CloseIcon.d.ts +3 -0
  101. package/dist/Icons/Construction/LeakIcon.d.ts +3 -0
  102. package/dist/Icons/Construction/ProjectIcon.d.ts +3 -0
  103. package/dist/Icons/Construction/PropertyIcon.d.ts +3 -0
  104. package/dist/Icons/Construction/SpaceIcon.d.ts +3 -0
  105. package/dist/Icons/DeleteIcon.d.ts +3 -0
  106. package/dist/Icons/DocumentIcon.d.ts +3 -0
  107. package/dist/Icons/Entities/CheckListIcon.d.ts +3 -0
  108. package/dist/Icons/Entities/GenericEntityIcon.d.ts +3 -0
  109. package/dist/Icons/Entities/HandshakeIcon.d.ts +3 -0
  110. package/dist/Icons/Entities/SupplierIcon.d.ts +3 -0
  111. package/dist/Icons/ErrorIcon.d.ts +3 -0
  112. package/dist/Icons/ExpandLessIcon.d.ts +3 -0
  113. package/dist/Icons/ExpandMoreIcon.d.ts +3 -0
  114. package/dist/Icons/FileIcon.d.ts +3 -0
  115. package/dist/Icons/InfoIcon.d.ts +3 -0
  116. package/dist/Icons/LocationIcon.d.ts +3 -0
  117. package/dist/Icons/PersonIcon.d.ts +3 -0
  118. package/dist/Icons/Ratings/DislikeIcon.d.ts +3 -0
  119. package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +3 -0
  120. package/dist/Icons/Ratings/LikeIcon.d.ts +3 -0
  121. package/dist/Icons/Ratings/SatisfiedIcon.d.ts +3 -0
  122. package/dist/Icons/Ratings/StarIcon.d.ts +3 -0
  123. package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +3 -0
  124. package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +3 -0
  125. package/dist/Icons/WarningIcon.d.ts +3 -0
  126. package/dist/Init.d.ts +1 -0
  127. package/dist/Services/FileService.d.ts +5 -0
  128. package/dist/Services/FormService.d.ts +5 -0
  129. package/dist/Services/OrganizationService.d.ts +2 -0
  130. package/dist/Shared/CustomBtn/CustomBtn.d.ts +17 -0
  131. package/dist/Shared/ErkButton/ErkButton.d.ts +31 -0
  132. package/dist/Shared/ErkButton/ErkButton.stories.d.ts +23 -0
  133. package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +19 -0
  134. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +16 -0
  135. package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +16 -0
  136. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +23 -0
  137. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +16 -0
  138. package/dist/Shared/ErkSelect/ErkSelect.d.ts +39 -0
  139. package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +18 -0
  140. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +28 -0
  141. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.d.ts +26 -0
  142. package/dist/Shared/ErkTextField/ErkTextField.d.ts +26 -0
  143. package/dist/Shared/ErkTextField/ErkTextField.stories.d.ts +24 -0
  144. package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +31 -0
  145. package/dist/Shared/InputIcon/InputIcon.d.ts +7 -0
  146. package/dist/Shared/Loader/Loader.d.ts +17 -0
  147. package/dist/Shared/Navbar/Navbar.d.ts +8 -0
  148. package/dist/Shared/Navbar/Navbar.stories.d.ts +13 -0
  149. package/dist/Shared/Rating/Rating.d.ts +13 -0
  150. package/dist/Shared/Rating/Rating.stories.d.ts +15 -0
  151. package/dist/Shared/Rating/Ratings/LikeRating.d.ts +3 -0
  152. package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +3 -0
  153. package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +3 -0
  154. package/dist/Shared/Toggle/Toggle.d.ts +8 -0
  155. package/dist/States/GlobalSlice.d.ts +46 -0
  156. package/dist/States/SiteSlice.d.ts +77 -0
  157. package/dist/States/WidthStatsSlice.d.ts +7 -0
  158. package/dist/Utils/AxiosAPI.d.ts +2 -0
  159. package/dist/Utils/AxiosWidget.d.ts +2 -0
  160. package/dist/Utils/CBRFunctions.d.ts +8 -0
  161. package/dist/Utils/DraftFunctions.d.ts +56 -0
  162. package/dist/Utils/FormStepFunctions.d.ts +15 -0
  163. package/dist/Utils/LocaleUtils.d.ts +2 -0
  164. package/dist/Utils/MaterialProviders.d.ts +25 -0
  165. package/dist/Utils/MuiClassnameSetup.d.ts +1 -0
  166. package/dist/Utils/PhoneFunctions.d.ts +2 -0
  167. package/dist/Utils/TestUtils.d.ts +70 -0
  168. package/dist/Utils/store.d.ts +29 -0
  169. package/dist/Widget.d.ts +1 -0
  170. package/dist/__tests__/setup.d.ts +1 -0
  171. package/dist/constants/AYFFormStepTypes.d.ts +9 -0
  172. package/dist/constants/CBRFormStepTypes.d.ts +21 -0
  173. package/dist/constants/ConditionTypes.d.ts +27 -0
  174. package/dist/constants/Draft/DraftEntityDataTypes.d.ts +11 -0
  175. package/dist/constants/Draft/DraftEntityTypes.d.ts +3 -0
  176. package/dist/constants/Draft/DraftStyleTypes.d.ts +7 -0
  177. package/dist/constants/EntityPropertyTypes.d.ts +10 -0
  178. package/dist/constants/Files/FileExtensions.d.ts +3 -0
  179. package/dist/constants/Files/FileMaxSize.d.ts +2 -0
  180. package/dist/constants/FormStepTypes.d.ts +64 -0
  181. package/dist/constants/IconTypes.d.ts +15 -0
  182. package/dist/constants/InternalFormStyle.d.ts +3 -0
  183. package/dist/constants/TicketPropertyTypes.d.ts +3 -0
  184. package/dist/hooks.d.ts +7 -0
  185. package/dist/index.lib.d.ts +7 -0
  186. package/dist/main.d.ts +2 -0
  187. package/dist/main.js +1 -1
  188. package/package.json +2 -2
@@ -0,0 +1,84 @@
1
+ import { Condition } from './Condition';
2
+ export interface GBaseStep {
3
+ id: string;
4
+ idSection: string;
5
+ type: string;
6
+ editable?: boolean;
7
+ partial?: boolean;
8
+ clientInfoType?: string;
9
+ dependencies?: string[];
10
+ condition?: Condition;
11
+ }
12
+ export interface GTitle extends GBaseStep {
13
+ title: string;
14
+ description: string | null;
15
+ }
16
+ export interface GCheckBox extends GBaseStep {
17
+ label: string;
18
+ description: string | null;
19
+ required: boolean;
20
+ isList?: boolean;
21
+ size: 1 | 2 | 3 | 4;
22
+ }
23
+ export interface GSeparator extends GBaseStep {
24
+ transparent: boolean;
25
+ }
26
+ export interface GTextArea extends GBaseStep {
27
+ label: string;
28
+ description: string | null;
29
+ required: boolean;
30
+ hasTextEditor: boolean;
31
+ }
32
+ export interface GTextInput extends GBaseStep {
33
+ label: string;
34
+ description: string | null;
35
+ validation?: {
36
+ message: string;
37
+ value: string;
38
+ type: 'EMAIL' | 'PHONE' | 'OTHER';
39
+ };
40
+ required: boolean;
41
+ showIcon?: boolean;
42
+ size: 1 | 2 | 3 | 4;
43
+ maxLength?: number;
44
+ defaultValue?: string;
45
+ }
46
+ export interface GDatePicker extends GBaseStep {
47
+ label: string;
48
+ description: string | null;
49
+ pickTime: boolean;
50
+ required: boolean;
51
+ size: 1 | 2 | 3 | 4;
52
+ }
53
+ export interface GTimePicker extends GBaseStep {
54
+ label: string;
55
+ description: string | null;
56
+ required: boolean;
57
+ size: 1 | 2 | 3 | 4;
58
+ pickDays: boolean;
59
+ minDays?: number;
60
+ maxDays?: number;
61
+ pickHours: boolean;
62
+ minHours?: number;
63
+ maxHours?: number;
64
+ pickMinutes: boolean;
65
+ minMinutes?: number;
66
+ maxMinutes?: number;
67
+ /** Undefined if user can choose */
68
+ working?: boolean;
69
+ }
70
+ export interface GAgentPicker extends GBaseStep {
71
+ label: string;
72
+ description: string | null;
73
+ required: boolean;
74
+ multiple: boolean;
75
+ size: 1 | 2 | 3 | 4;
76
+ }
77
+ export interface GSmartSelect extends GBaseStep {
78
+ label: string;
79
+ description: string | null;
80
+ showIcon: boolean;
81
+ required: boolean;
82
+ searchable: boolean;
83
+ size: 1 | 2 | 3 | 4;
84
+ }
@@ -0,0 +1,8 @@
1
+ export interface MapperElement<Type> {
2
+ id: string;
3
+ ids: Record<string, string>;
4
+ deleted?: boolean;
5
+ value?: Type;
6
+ originalValues: Record<string, any>;
7
+ isOriginal: boolean;
8
+ }
@@ -0,0 +1,11 @@
1
+ import { CountryCode } from 'libphonenumber-js';
2
+ import { Branding } from './Branding';
3
+ export interface Organization {
4
+ /** The Organization's id */
5
+ idOrganization: string;
6
+ /** The Organization's name */
7
+ name: string;
8
+ branding: Branding;
9
+ customBrandings: boolean;
10
+ countryCode?: CountryCode;
11
+ }
@@ -0,0 +1,6 @@
1
+ export interface Time {
2
+ days?: number;
3
+ hours?: number;
4
+ minutes?: number;
5
+ working?: boolean;
6
+ }
@@ -0,0 +1 @@
1
+ export * from './@Types';
@@ -0,0 +1,57 @@
1
+ import { Classifier, Form } from '../@Types/Form';
2
+ import './App.css';
3
+ import { CustomStep, CustomStepProps } from '../FormSteps/CustomStep';
4
+ import { EditorState } from 'draft-js';
5
+ import { CountryCode } from 'libphonenumber-js';
6
+ export interface AppProps {
7
+ /** If the app is currently a widget */
8
+ isWidget?: boolean;
9
+ /** The apikey of the Form */
10
+ apiKey?: string;
11
+ /** The id of the form's organization */
12
+ idOrganization?: string;
13
+ /** The form to display, (used for postviews) */
14
+ formData?: Form;
15
+ /** If the widget is usedInternally */
16
+ internal?: boolean;
17
+ /** If the widget is a postview (view what the user filled)*/
18
+ postview?: boolean;
19
+ /** If postview should only show steps with values*/
20
+ partial?: boolean;
21
+ /** If the widget is a preview (view from admin)*/
22
+ preview?: boolean;
23
+ /** If the form can be edited (For entities) */
24
+ editable?: boolean;
25
+ /** The custom send label to display */
26
+ sendLabel?: string;
27
+ /** The data to fill the form with */
28
+ valuesData?: Record<string, unknown>;
29
+ /** Custom steps to display */
30
+ customSteps?: Record<string, CustomStep>;
31
+ /** Custom steps to display */
32
+ customStepProps?: Record<string, unknown>;
33
+ /** Classifiers dict */
34
+ classifiers?: Record<string, Classifier>;
35
+ /** Custom Confirmation Content */
36
+ customConfirmation?: (confirmation: {
37
+ url: string;
38
+ caseNumber: string;
39
+ }, renderIcon: () => JSX.Element, renderConfirmation: (state?: EditorState) => JSX.Element | null, renderLink: () => JSX.Element | null, onClose: () => void) => JSX.Element;
40
+ customClientInfoStep?: (props: CustomStepProps) => JSX.Element;
41
+ /** Custom function to call on send */
42
+ customSubmit?: (values: Record<string, unknown>, reload: () => void) => Promise<void>;
43
+ /** Custom submit function, when passed it is called */
44
+ setSubmit?: (submit: () => Promise<void | Record<string, any>>) => void;
45
+ /** Custom submit buttons */
46
+ customSubmitBtns?: null | ((onSubmit: () => Promise<Record<string, any> | void>, loading: boolean) => JSX.Element);
47
+ /** Function to call on postview to fetch the download url of a file */
48
+ fetchDownloadUrl?: (S3Key: string, fileName: string) => Promise<string>;
49
+ /** Function to call after the confimation dialog has been closed */
50
+ handleConfirmed?: () => void;
51
+ /** Function called to scroll to the top */
52
+ scrollToTop?: () => void;
53
+ /** The default country to use in phone pickers */
54
+ countryCode?: CountryCode;
55
+ }
56
+ declare function AppComponent({ formData, valuesData, ...props }: AppProps): JSX.Element;
57
+ export default AppComponent;
@@ -0,0 +1,23 @@
1
+ import { Form } from '../@Types';
2
+ import { FormStep, Mapper } from '../@Types/FormStep';
3
+ import { SiteState, ValuesStore } from '../States/SiteSlice';
4
+ import { CustomStep } from '../FormSteps/CustomStep';
5
+ import { MapperElement } from '../@Types/MapperElement';
6
+ import { MapperValue } from '../FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep';
7
+ import { CountryCode } from 'libphonenumber-js/max';
8
+ export declare const calcValuesStore: (orgInfo: {
9
+ idOrganization: string;
10
+ countryCode: CountryCode;
11
+ }, form: Readonly<Form>, originalValues?: Record<string, any>, postview?: boolean, customSteps?: Record<string, CustomStep>) => Promise<ValuesStore>;
12
+ export declare const addMapperStep: <Type>(step: Mapper, customSteps: Record<string, CustomStep>, path?: string) => {
13
+ element: MapperElement<Type>;
14
+ /** Record of all the new mapper values created */
15
+ mappers: Record<string, MapperValue<Type>>;
16
+ /** Record of all the new steps created */
17
+ steps: Record<string, FormStep>;
18
+ };
19
+ export declare const mapOriginalValue: (orgInfo: {
20
+ idOrganization: string;
21
+ countryCode: CountryCode;
22
+ }, step: FormStep, value: any, values: ValuesStore, form?: Readonly<Form>, path?: string) => Promise<any>;
23
+ export declare const calcInitialSections: (form: Form) => Pick<SiteState, "previousSections" | "idCurrentSection" | "nextSections">;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,10 @@
1
+ import { Form, Organization } from '../@Types';
2
+ import { AppProps } from './App';
3
+ import { Branding } from '../@Types/Branding';
4
+ export declare const useSetupApp: (isEmbedded: boolean, { preview, internal, postview, partial, editable, handleConfirmed, customSteps, valuesData, apiKey, formData, classifiers, ...others }: Omit<AppProps, "isWidget">) => {
5
+ form: Form | undefined | null;
6
+ organization: Organization | undefined | null;
7
+ branding: Branding | undefined;
8
+ reload: () => void;
9
+ };
10
+ export declare const useLogRocket: (organization: Organization | null | undefined, form: Form | null | undefined, { apiKey, internal, postview, preview }: Pick<AppProps, "apiKey" | "internal" | "postview" | "preview">) => void;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,11 @@
1
+ import { CustomStep, CustomStepProps } from '../FormSteps/CustomStep';
2
+ export interface CustomContextData {
3
+ sendLabel?: string;
4
+ customStepProps: Record<string, unknown>;
5
+ customSteps: Record<string, CustomStep>;
6
+ customClientInfoStep?: (props: CustomStepProps) => JSX.Element;
7
+ /** Function to call on postview to fetch the download url of a file */
8
+ fetchDownloadUrl?: (S3Key: string, fileName: string) => Promise<string>;
9
+ }
10
+ declare const CustomContext: import("react").Context<CustomContextData>;
11
+ export default CustomContext;
@@ -0,0 +1,6 @@
1
+ import { Form } from '../@Types';
2
+ import { EurekaDraft } from '../@Types/Draft/Draft';
3
+ export declare const BaseConfirmationMessage: EurekaDraft;
4
+ declare const FormContext: import("react").Context<Form>;
5
+ export default FormContext;
6
+ export declare const IdFormContext: import("react").Context<string>;
@@ -0,0 +1,2 @@
1
+ declare const SectionContext: import("react").Context<string>;
2
+ export default SectionContext;
@@ -0,0 +1,11 @@
1
+ import { AppProps } from '../../App/App';
2
+ interface ConfirmationDialogProps {
3
+ confirmation: {
4
+ case: string;
5
+ url: string;
6
+ };
7
+ customConfirmation?: AppProps['customConfirmation'];
8
+ onClose: () => void;
9
+ }
10
+ declare function ConfirmationDialog({ onClose, confirmation, customConfirmation, }: ConfirmationDialogProps): JSX.Element;
11
+ export default ConfirmationDialog;
@@ -0,0 +1,39 @@
1
+ import React from 'react';
2
+ import { Branding } from '../@Types/Branding';
3
+ import FormStepTypes from '../constants/FormStepTypes';
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';
10
+ export interface StepDependency {
11
+ dependents: (FormStep | CBRFormStep)[];
12
+ value: any;
13
+ type: FormStepTypes | CBRFormStepTypes | 'ORIGINAL';
14
+ empty?: boolean;
15
+ }
16
+ export type DependencyStore = Record<string, StepDependency>;
17
+ export interface WidthStats {
18
+ currentBreakPoint: number;
19
+ isResponsive: boolean;
20
+ isMobile: boolean;
21
+ }
22
+ type CustomAppProps = Pick<AppProps, 'customSteps' | 'customSubmitBtns' | 'setSubmit' | 'customConfirmation'>;
23
+ export interface BaseFormProps extends CustomAppProps {
24
+ form: Form;
25
+ branding?: Branding;
26
+ reload: () => void;
27
+ isWidget: boolean;
28
+ apiKey: string | undefined;
29
+ customSubmit: AppProps['customSubmit'];
30
+ containerRef: React.RefObject<HTMLDivElement>;
31
+ scrollToTop?: () => void;
32
+ }
33
+ export interface FormComponentProps extends CustomAppProps {
34
+ /** Function called when users clicks submit */
35
+ onSubmit: (values: FieldValues) => Promise<any>;
36
+ scrollToTop?: () => void;
37
+ }
38
+ declare function FormComponent({ form, apiKey, reload, isWidget, branding, setSubmit, scrollToTop, customSteps, containerRef, customSubmit, customSubmitBtns, customConfirmation, }: BaseFormProps): JSX.Element;
39
+ export default FormComponent;
@@ -0,0 +1,12 @@
1
+ import { FormStep, Mapper } from '../@Types/FormStep';
2
+ import { DependencyStore } from './Form';
3
+ import { CustomStep } from '../FormSteps/CustomStep';
4
+ import { CBRFormStep } from '../@Types/CBRFormStep';
5
+ import { MapperElement } from '../@Types/MapperElement';
6
+ import { ValuesStore } from '../States/SiteSlice';
7
+ /**
8
+ * Function that cals the value of a step to output on submit
9
+ */
10
+ export declare const calcValue: (idStep: string, steps: Record<string, FormStep>, values: Record<string, any>, customSteps: Record<string, CustomStep> | undefined, deleteIds: string[], value?: any) => any;
11
+ export declare function calcDependencies(steps: Record<string, FormStep | CBRFormStep>, customSteps?: Record<string, CustomStep>, allSteps?: Record<string, FormStep | CBRFormStep>, dependencies?: DependencyStore, values?: ValuesStore, addDependents?: boolean): DependencyStore;
12
+ export declare const calcMapperSubSteps: (step: Mapper, elements: MapperElement<any>[] | undefined, customSteps: Record<string, CustomStep>) => Record<string, FormStep>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ import { Form } from '../@Types';
2
+ export declare function useWidthStats(containerRef: React.RefObject<HTMLDivElement>, form: Form, postview: boolean, internal: boolean): void;
@@ -0,0 +1,3 @@
1
+ import { FormComponentProps } from '../../Form';
2
+ declare function ColumnForm({ onSubmit, customSubmitBtns, ...props }: FormComponentProps): JSX.Element;
3
+ export default ColumnForm;
@@ -0,0 +1,3 @@
1
+ import { FormComponentProps } from '../../Form';
2
+ declare function StepperForm({ onSubmit, scrollToTop }: FormComponentProps): JSX.Element;
3
+ export default StepperForm;
@@ -0,0 +1,3 @@
1
+ import { SectionComponentProps } from '../Section';
2
+ declare function MaterialSection({ idSection }: SectionComponentProps): JSX.Element;
3
+ export default MaterialSection;
@@ -0,0 +1,5 @@
1
+ export interface SectionComponentProps {
2
+ idSection: string;
3
+ }
4
+ declare function SectionComponent(props: SectionComponentProps): JSX.Element;
5
+ export default SectionComponent;
@@ -0,0 +1,3 @@
1
+ import { TermComponentProps } from '../Term';
2
+ declare function TermComponent({ term, tempError }: TermComponentProps): JSX.Element;
3
+ export default TermComponent;
@@ -0,0 +1,7 @@
1
+ import { Term } from '../../../@Types/Form';
2
+ export interface TermComponentProps {
3
+ term: Term;
4
+ tempError: boolean;
5
+ }
6
+ declare function TermComponent(props: TermComponentProps): JSX.Element;
7
+ export default TermComponent;
@@ -0,0 +1,2 @@
1
+ declare function Terms(): JSX.Element;
2
+ export default Terms;
@@ -0,0 +1,7 @@
1
+ import { StepProps } from '../../Step';
2
+ import { CBRElementStep } from '../../../@Types/CBRFormStep';
3
+ export interface ElementStepProps extends Omit<StepProps, 'step'> {
4
+ step: CBRElementStep;
5
+ }
6
+ declare function CBRElementStepComponent(props: ElementStepProps): JSX.Element;
7
+ export default CBRElementStepComponent;
@@ -0,0 +1,8 @@
1
+ import { CBRIncidentsStep as CBRIncidentsStepType } from '../../../@Types/CBRFormStep';
2
+ import { StepProps } from '../../Step';
3
+ export interface CBRIncidentsStepProps extends Omit<StepProps, 'step'> {
4
+ /** The CBRIncidentsStep to display */
5
+ step: CBRIncidentsStepType;
6
+ }
7
+ declare function CBRIncidentsStep(props: CBRIncidentsStepProps): JSX.Element;
8
+ export default CBRIncidentsStep;
@@ -0,0 +1,7 @@
1
+ import { CBRIncidentsStepProps } from '../../CBRIncidentsStep';
2
+ import { Incident } from '../MaterialCBRIncidentsStep';
3
+ declare function IncidentComponent({ step, incident, handleDelete, ...others }: CBRIncidentsStepProps & {
4
+ incident: Incident;
5
+ handleDelete: () => void;
6
+ }): JSX.Element;
7
+ export default IncidentComponent;
@@ -0,0 +1,10 @@
1
+ import { CBRIncidentsStepProps } from '../CBRIncidentsStep';
2
+ export interface Incident {
3
+ idSpaceStep: string;
4
+ idElementStep: string;
5
+ idCommentStep: string;
6
+ deleted?: boolean;
7
+ num: number;
8
+ }
9
+ declare function CBRIncidentsStep({ step, editable, ...others }: CBRIncidentsStepProps): JSX.Element;
10
+ export default CBRIncidentsStep;
@@ -0,0 +1,7 @@
1
+ import { StepProps } from '../../Step';
2
+ import { CBRPropertyStep } from '../../../@Types/CBRFormStep';
3
+ export interface PropertyRendererProps extends Omit<StepProps, 'step'> {
4
+ step: CBRPropertyStep;
5
+ }
6
+ declare function CBRPropertyStepComponent(props: PropertyRendererProps): JSX.Element;
7
+ export default CBRPropertyStepComponent;
@@ -0,0 +1,11 @@
1
+ import { AYFFormStep } from '../@Types/AYFFormStep';
2
+ import { StepProps } from './Step';
3
+ interface AYFStepProps extends Omit<StepProps, 'step'> {
4
+ step: AYFFormStep;
5
+ }
6
+ export interface StepOptions {
7
+ id: string | number;
8
+ label: string;
9
+ }
10
+ declare function AYFStepMapper(props: AYFStepProps): JSX.Element;
11
+ export default AYFStepMapper;
@@ -0,0 +1,14 @@
1
+ import { ApiSelector } from '../../@Types/FormStep';
2
+ import { StepProps } from '../Step';
3
+ export interface StepOption {
4
+ id: string | number;
5
+ label: string;
6
+ }
7
+ export interface ApiSelectorStepProps extends StepProps {
8
+ /** The ApiSelectorStep to display */
9
+ step: ApiSelector;
10
+ /** Default value to display */
11
+ defaultValue?: Date | null;
12
+ }
13
+ declare function ApiSelectorStep(props: ApiSelectorStepProps): JSX.Element;
14
+ export default ApiSelectorStep;
@@ -0,0 +1,3 @@
1
+ import { ApiSelectorStepProps } from '../ApiSelectorStep';
2
+ declare function ApiSelectorComponent({ step, editable, ...others }: ApiSelectorStepProps): JSX.Element;
3
+ export default ApiSelectorComponent;
@@ -0,0 +1,12 @@
1
+ import { CBRFormStep } from '../@Types/CBRFormStep';
2
+ import { StepProps } from './Step';
3
+ interface CBRStepProps extends Omit<StepProps, 'step'> {
4
+ step: CBRFormStep;
5
+ }
6
+ export interface StepOptions {
7
+ id: string | number;
8
+ label: string;
9
+ idMacroProyecto?: number;
10
+ }
11
+ declare function CBRStepMapper(props: CBRStepProps): JSX.Element;
12
+ export default CBRStepMapper;
@@ -0,0 +1,8 @@
1
+ import { CheckBox } from '../../@Types/FormStep';
2
+ import { StepProps } from '../Step';
3
+ export interface CheckBoxStepProps extends StepProps {
4
+ /** The CheckboxStep to display */
5
+ step: CheckBox;
6
+ }
7
+ declare function CheckboxStep(props: CheckBoxStepProps): JSX.Element;
8
+ export default CheckboxStep;
@@ -0,0 +1,3 @@
1
+ import { CheckBoxStepProps } from '../CheckBoxStep';
2
+ declare function CheckBoxStep({ step, editable }: CheckBoxStepProps): JSX.Element;
3
+ export default CheckBoxStep;
@@ -0,0 +1,8 @@
1
+ import { ClassifierSelector } from '../../@Types/FormStep';
2
+ import { StepProps } from '../Step';
3
+ export interface ClassifierSelectorStepProps extends StepProps {
4
+ /** The ClassifierSelectorStep to display */
5
+ step: ClassifierSelector;
6
+ }
7
+ declare function ClassifierSelectorStep(props: ClassifierSelectorStepProps): JSX.Element;
8
+ export default ClassifierSelectorStep;
@@ -0,0 +1,3 @@
1
+ import { ClassifierSelectorStepProps } from '../ClassifierSelectorStep';
2
+ declare function ClassifierSelectorStep({ step, editable }: ClassifierSelectorStepProps): JSX.Element;
3
+ export default ClassifierSelectorStep;
@@ -0,0 +1,8 @@
1
+ import { Collapsible } from '../../@Types/FormStep';
2
+ import { StepProps } from '../Step';
3
+ export interface CollapsibleStepProps extends StepProps {
4
+ /** The CollapsibleStep to display */
5
+ step: Collapsible;
6
+ }
7
+ declare function CollapsibleStep({ step, ...others }: CollapsibleStepProps): JSX.Element;
8
+ export default CollapsibleStep;
@@ -0,0 +1,3 @@
1
+ import { CollapsibleStepProps } from '../CollapsibleStep';
2
+ declare function CollapsibleStep(props: CollapsibleStepProps): JSX.Element;
3
+ export default CollapsibleStep;
@@ -0,0 +1,26 @@
1
+ import { StepProps } from './Step';
2
+ import { Form } from '../@Types';
3
+ import { GlobalState } from '../States/GlobalSlice';
4
+ import { WidthStats } from '../Form/Form';
5
+ import { StepDependency } from './StepHooks';
6
+ import { SiteState } from '../States/SiteSlice';
7
+ export interface CustomStepProps extends StepProps, GlobalState, StepDependency {
8
+ form: Form;
9
+ dependencyStore: SiteState['dependencies'];
10
+ customStepProps: Record<string, any>;
11
+ widthStats: WidthStats;
12
+ }
13
+ export interface CustomStep {
14
+ componentProps?: Record<string, any>;
15
+ component: (props: CustomStepProps) => JSX.Element;
16
+ calcValue?: (step: any, value: any) => any;
17
+ /** Function to change custom steps nested step ids to the generated ones. */
18
+ calcRecursiveData?: (step: any, ids: Record<string, string>) => void;
19
+ calcDependencyValue?: (step: any, value: any) => any;
20
+ }
21
+ interface CustomStepComponentProps extends StepProps {
22
+ customComponent: (props: CustomStepProps) => JSX.Element;
23
+ customProps?: Record<string, any>;
24
+ }
25
+ declare function CustomStepComponent({ customComponent, customProps, ...props }: CustomStepComponentProps): JSX.Element;
26
+ export default CustomStepComponent;
@@ -0,0 +1,10 @@
1
+ import { DatePicker } from '../../@Types/FormStep';
2
+ import { StepProps } from '../Step';
3
+ export interface DatePickerStepProps extends StepProps {
4
+ /** The DatePickerStep to display */
5
+ step: DatePicker;
6
+ /** Default value to display */
7
+ defaultValue?: Date | null;
8
+ }
9
+ declare function DatePickerStep(props: DatePickerStepProps): JSX.Element;
10
+ export default DatePickerStep;
@@ -0,0 +1,3 @@
1
+ import { DatePickerStepProps } from '../DatePickerStep';
2
+ declare function DatePickerStep({ step, editable, defaultValue }: DatePickerStepProps): JSX.Element;
3
+ export default DatePickerStep;
@@ -0,0 +1,14 @@
1
+ import { EntityValuePicker } from '../../@Types/FormStep';
2
+ import { StepProps } from '../Step';
3
+ export interface StepOption {
4
+ id: string | number;
5
+ label: string;
6
+ }
7
+ export interface EntityValuePickerStepProps extends StepProps {
8
+ /** The EntityValuePickerStep to display */
9
+ step: EntityValuePicker;
10
+ /** Default value to display */
11
+ defaultValue?: Date | null;
12
+ }
13
+ declare function EntityValuePickerStep(props: EntityValuePickerStepProps): JSX.Element;
14
+ export default EntityValuePickerStep;
@@ -0,0 +1,11 @@
1
+ import { EurekaDraft } from '../../../../@Types/Draft/Draft';
2
+ import { Entity } from '../../../../@Types/Entity';
3
+ interface EntityValueDialogProps {
4
+ type: 'WARNING' | 'INFO';
5
+ message: EurekaDraft;
6
+ entityValue: any;
7
+ entity: Entity;
8
+ handleClose: () => void;
9
+ }
10
+ declare function MaterialEntityValueDialog({ type, entity, message, entityValue, handleClose, }: EntityValueDialogProps): JSX.Element;
11
+ export default MaterialEntityValueDialog;
@@ -0,0 +1,3 @@
1
+ import { EntityValuePickerStepProps } from '../EntityValuePickerStep';
2
+ declare function EntityValuePickerStep({ step, editable }: EntityValuePickerStepProps): JSX.Element;
3
+ export default EntityValuePickerStep;
@@ -0,0 +1,8 @@
1
+ import { FileUpload } from '../../@Types/FormStep';
2
+ import { StepProps } from '../Step';
3
+ export interface FileUploadStepProps extends StepProps {
4
+ /** The FileUploadStep to display */
5
+ step: FileUpload;
6
+ }
7
+ declare function FileUploadStep(props: FileUploadStepProps): JSX.Element;
8
+ export default FileUploadStep;
@@ -0,0 +1,13 @@
1
+ import { FileObject, UploadedFileObject } from '../MaterialFileUploadStep';
2
+ import { FormStyle } from '../../../../@Types/Form';
3
+ interface FileComponentProps {
4
+ file: FileObject | UploadedFileObject;
5
+ formStyle: FormStyle;
6
+ error: boolean;
7
+ editable: boolean;
8
+ handleRemove: () => void;
9
+ /** Function to call on postview to fetch the download url of a file */
10
+ fetchDownloadUrl?: (S3Key: string, fileName: string) => Promise<string>;
11
+ }
12
+ declare function FileUploadComponent({ file, formStyle, error, editable, handleRemove, fetchDownloadUrl, }: FileComponentProps): JSX.Element;
13
+ export default FileUploadComponent;
@@ -0,0 +1,2 @@
1
+ import { UploadedFileObject, FileObject } from './MaterialFileUploadStep';
2
+ export declare function isUploadedFileObject(file: UploadedFileObject | FileObject): file is UploadedFileObject;
@@ -0,0 +1,16 @@
1
+ import { FileUploadStepProps } from '../FileUploadStep';
2
+ export interface FileObject {
3
+ state: 'STARTING' | 'UPLOADING' | 'DONE' | 'CANCEL' | 'ERROR';
4
+ file: File;
5
+ postInfo: any;
6
+ fileName?: string;
7
+ S3Key?: string;
8
+ error?: boolean;
9
+ }
10
+ export interface UploadedFileObject {
11
+ fileName: string;
12
+ S3Key: string;
13
+ downloadUrl?: string;
14
+ }
15
+ declare function FileUploadStep({ step, editable }: FileUploadStepProps): JSX.Element;
16
+ export default FileUploadStep;