@arquimedes.co/eureka-forms 1.9.79-test → 1.9.81-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 (217) hide show
  1. package/dist/@Types/@Types.d.ts +2 -0
  2. package/dist/@Types/@Types.js +1 -0
  3. package/dist/@Types/AYFFormStep.d.ts +19 -0
  4. package/dist/@Types/AYFFormStep.js +1 -0
  5. package/dist/@Types/CBRFormStep.d.ts +74 -0
  6. package/dist/@Types/CBRFormStep.js +1 -0
  7. package/dist/@Types/Form.d.ts +65 -0
  8. package/dist/@Types/Form.js +1 -0
  9. package/dist/@Types/FormStep.d.ts +138 -0
  10. package/dist/@Types/FormStep.js +1 -0
  11. package/dist/@Types/GenericFormSteps.d.ts +60 -0
  12. package/dist/@Types/GenericFormSteps.js +1 -0
  13. package/dist/@Types/Organization.d.ts +17 -0
  14. package/dist/@Types/Organization.js +1 -0
  15. package/dist/@Types/index.d.ts +1 -0
  16. package/dist/@Types/index.js +1 -0
  17. package/dist/App.d.ts +60 -0
  18. package/dist/App.js +470 -0
  19. package/dist/App.module.css +34 -0
  20. package/dist/AxiosAPI.d.ts +2 -0
  21. package/dist/AxiosAPI.js +8 -0
  22. package/dist/AxiosWidget.d.ts +2 -0
  23. package/dist/AxiosWidget.js +8 -0
  24. package/dist/FormComponents/Form/ColumnForm/ColumnForm.d.ts +7 -0
  25. package/dist/FormComponents/Form/ColumnForm/ColumnForm.js +379 -0
  26. package/dist/FormComponents/Form/ColumnForm/ColumnForm.module.css +51 -0
  27. package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.d.ts +12 -0
  28. package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.js +31 -0
  29. package/dist/FormComponents/Form/ConfirmationDialog/ConfirmationDialog.module.css +64 -0
  30. package/dist/FormComponents/Form/Form.d.ts +42 -0
  31. package/dist/FormComponents/Form/Form.js +147 -0
  32. package/dist/FormComponents/Form/Form.module.css +39 -0
  33. package/dist/FormComponents/Form/StepperForm/StepperForm.d.ts +4 -0
  34. package/dist/FormComponents/Form/StepperForm/StepperForm.js +6 -0
  35. package/dist/FormComponents/Form/StepperForm/StepperForm.module.css +0 -0
  36. package/dist/FormComponents/Section/MaterialSection/MaterialSection.d.ts +4 -0
  37. package/dist/FormComponents/Section/MaterialSection/MaterialSection.js +42 -0
  38. package/dist/FormComponents/Section/MaterialSection/MaterialSection.module.css +8 -0
  39. package/dist/FormComponents/Section/Section.d.ts +39 -0
  40. package/dist/FormComponents/Section/Section.js +23 -0
  41. package/dist/FormComponents/Step/@Construction/CBRElementStep/CBRElementStep.d.ts +8 -0
  42. package/dist/FormComponents/Step/@Construction/CBRElementStep/CBRElementStep.js +139 -0
  43. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +9 -0
  44. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +23 -0
  45. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +8 -0
  46. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +49 -0
  47. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.module.css +60 -0
  48. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +11 -0
  49. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +121 -0
  50. package/dist/FormComponents/Step/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.module.css +34 -0
  51. package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +8 -0
  52. package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.js +138 -0
  53. package/dist/FormComponents/Step/@Construction/CBRPropertyStep/CBRPropertyStep.module.css +54 -0
  54. package/dist/FormComponents/Step/AYFStepMapper.d.ts +12 -0
  55. package/dist/FormComponents/Step/AYFStepMapper.js +170 -0
  56. package/dist/FormComponents/Step/CBRStepMapper.d.ts +13 -0
  57. package/dist/FormComponents/Step/CBRStepMapper.js +202 -0
  58. package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.d.ts +9 -0
  59. package/dist/FormComponents/Step/CheckBoxStep/CheckBoxStep.js +35 -0
  60. package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +4 -0
  61. package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +65 -0
  62. package/dist/FormComponents/Step/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.module.css +37 -0
  63. package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +9 -0
  64. package/dist/FormComponents/Step/ClassifierSelectorStep/ClassifierSelectorStep.js +35 -0
  65. package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +4 -0
  66. package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +121 -0
  67. package/dist/FormComponents/Step/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.module.css +25 -0
  68. package/dist/FormComponents/Step/CollapsibleStep/CollapsibleStep.d.ts +9 -0
  69. package/dist/FormComponents/Step/CollapsibleStep/CollapsibleStep.js +37 -0
  70. package/dist/FormComponents/Step/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +4 -0
  71. package/dist/FormComponents/Step/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +75 -0
  72. package/dist/FormComponents/Step/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.module.css +62 -0
  73. package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.d.ts +11 -0
  74. package/dist/FormComponents/Step/DatePickerStep/DatePickerStep.js +23 -0
  75. package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +4 -0
  76. package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +48 -0
  77. package/dist/FormComponents/Step/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.module.css +9 -0
  78. package/dist/FormComponents/Step/EntityValueStep/EntityValuePickerStep.d.ts +15 -0
  79. package/dist/FormComponents/Step/EntityValueStep/EntityValuePickerStep.js +35 -0
  80. package/dist/FormComponents/Step/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +4 -0
  81. package/dist/FormComponents/Step/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +203 -0
  82. package/dist/FormComponents/Step/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.module.css +25 -0
  83. package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.d.ts +9 -0
  84. package/dist/FormComponents/Step/FileUploadStep/FileUploadStep.js +23 -0
  85. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +13 -0
  86. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +123 -0
  87. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.module.css +60 -0
  88. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +16 -0
  89. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +272 -0
  90. package/dist/FormComponents/Step/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.module.css +59 -0
  91. package/dist/FormComponents/Step/MapperStep/MapperStep.d.ts +15 -0
  92. package/dist/FormComponents/Step/MapperStep/MapperStep.js +35 -0
  93. package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/MapperElement.d.ts +10 -0
  94. package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/MapperElement.js +27 -0
  95. package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/MapperElement.module.css +60 -0
  96. package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/PillElementContainer/PillElementContainer.d.ts +13 -0
  97. package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/PillElementContainer/PillElementContainer.js +33 -0
  98. package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/Element/PillElementContainer/PillElementContainer.module.css +60 -0
  99. package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +15 -0
  100. package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/MaterialMapperStep.js +275 -0
  101. package/dist/FormComponents/Step/MapperStep/MaterialMapperStep/MaterialMapperStep.module.css +42 -0
  102. package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +4 -0
  103. package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.js +71 -0
  104. package/dist/FormComponents/Step/RatingStep/MaterialRatingStep/MaterialRatingStep.module.css +30 -0
  105. package/dist/FormComponents/Step/RatingStep/RatingStep.d.ts +9 -0
  106. package/dist/FormComponents/Step/RatingStep/RatingStep.js +23 -0
  107. package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +4 -0
  108. package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +104 -0
  109. package/dist/FormComponents/Step/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.module.css +25 -0
  110. package/dist/FormComponents/Step/SelectorStep/SelectorStep.d.ts +9 -0
  111. package/dist/FormComponents/Step/SelectorStep/SelectorStep.js +35 -0
  112. package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +4 -0
  113. package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +11 -0
  114. package/dist/FormComponents/Step/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.module.css +7 -0
  115. package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.d.ts +9 -0
  116. package/dist/FormComponents/Step/SeparatorStep/SeparatorStep.js +35 -0
  117. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +10 -0
  118. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +241 -0
  119. package/dist/FormComponents/Step/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.module.css +9 -0
  120. package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.d.ts +33 -0
  121. package/dist/FormComponents/Step/SmartSelectStep/SmartSelectStep.js +23 -0
  122. package/dist/FormComponents/Step/Step.d.ts +11 -0
  123. package/dist/FormComponents/Step/Step.js +108 -0
  124. package/dist/FormComponents/Step/StepFunctions.d.ts +5 -0
  125. package/dist/FormComponents/Step/StepFunctions.js +65 -0
  126. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +96 -0
  127. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +13 -0
  128. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +213 -0
  129. package/dist/FormComponents/Step/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.module.css +93 -0
  130. package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.d.ts +10 -0
  131. package/dist/FormComponents/Step/TextAreaStep/TextAreaStep.js +23 -0
  132. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +4 -0
  133. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +76 -0
  134. package/dist/FormComponents/Step/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.module.css +9 -0
  135. package/dist/FormComponents/Step/TextInputStep/TextInputStep.d.ts +13 -0
  136. package/dist/FormComponents/Step/TextInputStep/TextInputStep.js +23 -0
  137. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +4 -0
  138. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.js +20 -0
  139. package/dist/FormComponents/Step/TitleStep/MaterialTitleStep/MaterialTitleStep.module.css +19 -0
  140. package/dist/FormComponents/Step/TitleStep/TitleStep.d.ts +9 -0
  141. package/dist/FormComponents/Step/TitleStep/TitleStep.js +35 -0
  142. package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.d.ts +4 -0
  143. package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.js +88 -0
  144. package/dist/FormComponents/Term/MaterialTerm/MaterialTerm.module.css +83 -0
  145. package/dist/FormComponents/Term/Term.d.ts +15 -0
  146. package/dist/FormComponents/Term/Term.js +23 -0
  147. package/dist/Icons/Construction/LeakIcon.d.ts +3 -0
  148. package/dist/Icons/Construction/LeakIcon.js +16 -0
  149. package/dist/Icons/Construction/ProjectIcon.d.ts +3 -0
  150. package/dist/Icons/Construction/ProjectIcon.js +16 -0
  151. package/dist/Icons/Construction/PropertyIcon.d.ts +3 -0
  152. package/dist/Icons/Construction/PropertyIcon.js +16 -0
  153. package/dist/Icons/Construction/SpaceIcon.d.ts +3 -0
  154. package/dist/Icons/Construction/SpaceIcon.js +16 -0
  155. package/dist/Icons/DocumentIcon.d.ts +3 -0
  156. package/dist/Icons/DocumentIcon.js +16 -0
  157. package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -0
  158. package/dist/Icons/Entities/GenericEntityIcon.js +17 -0
  159. package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -0
  160. package/dist/Icons/Entities/HandshakeIcon.js +17 -0
  161. package/dist/Widget.d.ts +1 -0
  162. package/dist/Widget.js +61 -0
  163. package/dist/constants/AYFFormStepTypes.d.ts +9 -0
  164. package/dist/constants/AYFFormStepTypes.js +10 -0
  165. package/dist/constants/CBRFormStepTypes.d.ts +21 -0
  166. package/dist/constants/CBRFormStepTypes.js +22 -0
  167. package/dist/constants/Files/FileExtensions.d.ts +3 -0
  168. package/dist/constants/Files/FileExtensions.js +68 -0
  169. package/dist/constants/Files/FileMaxSize.d.ts +2 -0
  170. package/dist/constants/Files/FileMaxSize.js +2 -0
  171. package/dist/constants/FormStepTypes.d.ts +46 -0
  172. package/dist/constants/FormStepTypes.js +54 -0
  173. package/dist/constants/IconTypes.d.ts +10 -0
  174. package/dist/constants/IconTypes.js +11 -0
  175. package/dist/constants/InternalFormStyle.d.ts +3 -0
  176. package/dist/constants/InternalFormStyle.js +16 -0
  177. package/dist/constants/MaterialClassNameSeed.d.ts +1 -0
  178. package/dist/constants/MaterialClassNameSeed.js +1 -0
  179. package/dist/controllers/FileService.d.ts +5 -0
  180. package/dist/controllers/FileService.js +92 -0
  181. package/dist/index.d.ts +1 -0
  182. package/dist/index.js +29 -0
  183. package/dist/index.lib.d.ts +7 -0
  184. package/dist/index.lib.js +5 -0
  185. package/dist/index.module.css +14 -0
  186. package/dist/shared/InputIcon/InputIcon.d.ts +7 -0
  187. package/dist/shared/InputIcon/InputIcon.js +81 -0
  188. package/dist/shared/Loader/Loader.d.ts +18 -0
  189. package/dist/shared/Loader/Loader.js +26 -0
  190. package/dist/shared/Loader/Loader.module.css +12 -0
  191. package/dist/shared/Navbar/Navbar.d.ts +9 -0
  192. package/dist/shared/Navbar/Navbar.js +18 -0
  193. package/dist/shared/Navbar/Navbar.module.css +18 -0
  194. package/dist/shared/Rating/Rating.d.ts +16 -0
  195. package/dist/shared/Rating/Rating.js +41 -0
  196. package/dist/shared/Rating/Rating.module.css +32 -0
  197. package/dist/shared/Rating/Ratings/LikeRating.d.ts +4 -0
  198. package/dist/shared/Rating/Ratings/LikeRating.js +43 -0
  199. package/dist/shared/Rating/Ratings/SatisfactionRating.d.ts +4 -0
  200. package/dist/shared/Rating/Ratings/SatisfactionRating.js +61 -0
  201. package/dist/shared/Rating/Ratings/ScaleRating.d.ts +4 -0
  202. package/dist/shared/Rating/Ratings/ScaleRating.js +63 -0
  203. package/dist/shared/RoundedButton/RoundedButton.d.ts +30 -0
  204. package/dist/shared/RoundedButton/RoundedButton.js +45 -0
  205. package/dist/shared/RoundedCheckBox/RoundedCheckBox.d.ts +24 -0
  206. package/dist/shared/RoundedCheckBox/RoundedCheckBox.js +101 -0
  207. package/dist/shared/RoundedDatePicker/RoundedDatePicker.d.ts +48 -0
  208. package/dist/shared/RoundedDatePicker/RoundedDatePicker.js +348 -0
  209. package/dist/shared/RoundedSelect/RoundedSelect.d.ts +68 -0
  210. package/dist/shared/RoundedSelect/RoundedSelect.js +214 -0
  211. package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +66 -0
  212. package/dist/shared/RoundedSmartSelect/RoundedSmartSelect.js +234 -0
  213. package/dist/shared/RoundedTextField/RoundedTextField.d.ts +45 -0
  214. package/dist/shared/RoundedTextField/RoundedTextField.js +175 -0
  215. package/dist/utils/CbrFunctions.d.ts +8 -0
  216. package/dist/utils/CbrFunctions.js +53 -0
  217. package/package.json +1 -1
@@ -0,0 +1,66 @@
1
+ import React from 'react';
2
+ import { TextFieldProps } from '@material-ui/core';
3
+ interface StyleProps {
4
+ /** The color of the outline when selected and hovered on */
5
+ focusColor?: string;
6
+ /** The color of the outline when it is not selected */
7
+ outlineColor?: string;
8
+ /** The color of the background */
9
+ backgroundColor?: string;
10
+ /** The color of the error to display */
11
+ errorColor?: string;
12
+ /** If the style should change on hover */
13
+ cantEdit?: boolean;
14
+ /** The hight of the container */
15
+ height?: string;
16
+ /** The color of the text in the form */
17
+ color?: string;
18
+ /** The fontsize of the content */
19
+ fontSize?: string;
20
+ /** The borderRadius of the input */
21
+ borderRadius?: number;
22
+ /** If input is readOnly */
23
+ readOnly?: boolean;
24
+ /** The weight of the font of the value and the placeholder */
25
+ fontWeight?: number | string;
26
+ /** The color of the helper text when not error */
27
+ helperTextColor?: string;
28
+ /** If custom icon exists and should be displayed */
29
+ showIcon?: boolean;
30
+ }
31
+ export interface RoundedSmartSelectProps extends Omit<TextFieldProps, 'color' | 'onFocus'>, StyleProps {
32
+ /** Currently selected value */
33
+ value: any;
34
+ /** The array of options to display */
35
+ options?: any[];
36
+ /** If the input is loading */
37
+ loading?: boolean;
38
+ /** function called when value changes */
39
+ handleUpdate?: (event: React.ChangeEvent<{
40
+ name?: string | undefined;
41
+ value: any;
42
+ }> | string, child?: React.ReactNode) => void;
43
+ /** Strig to place in the label */
44
+ label: string;
45
+ /** Minimum width in px of the component */
46
+ minWidth?: number;
47
+ /** The helper Text to display */
48
+ helperText?: string;
49
+ /** The margin around the selector */
50
+ containerMargin?: string;
51
+ /** The icon to display */
52
+ icon?: React.ReactNode;
53
+ /** If the options are searchable */
54
+ searchable?: boolean;
55
+ /** If can create new option */
56
+ creatable?: boolean;
57
+ /** Function to determine the currently selected option */
58
+ getOptionSelected?: (option: any, value: any) => boolean;
59
+ /** Function to determine the current value in string format */
60
+ getValueString?: (value: any) => string;
61
+ /** Function called on each value change */
62
+ changeListener?: (value: any) => void;
63
+ onFocus?: any;
64
+ }
65
+ export default function RoundedSmartSelect({ options, value, handleUpdate, label, getValueString, color, errorColor, focusColor, helperTextColor, outlineColor, backgroundColor, cantEdit, loading, height, fontSize, required, changeListener, error, getOptionSelected, helperText, readOnly, borderRadius, fontWeight, icon, searchable, containerMargin, showIcon, inputRef, disabled, creatable, onBlur, name, onFocus, }: RoundedSmartSelectProps): JSX.Element;
66
+ export {};
@@ -0,0 +1,234 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ var __rest = (this && this.__rest) || function (s, e) {
13
+ var t = {};
14
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
15
+ t[p] = s[p];
16
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
17
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
18
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
19
+ t[p[i]] = s[p[i]];
20
+ }
21
+ return t;
22
+ };
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
+ import Autocomplete, { createFilterOptions, } from '@material-ui/lab/Autocomplete';
25
+ import { makeStyles } from '@material-ui/core/styles';
26
+ import TextField from '@material-ui/core/TextField';
27
+ import { cloneElement } from 'react';
28
+ import { MenuItem, Popper } from '@material-ui/core';
29
+ import RoundedSelect from '../RoundedSelect/RoundedSelect';
30
+ import CircularProgress from '@material-ui/core/CircularProgress';
31
+ var filter = createFilterOptions();
32
+ var useTextfieldStyles = function (props) {
33
+ return makeStyles(function () {
34
+ var _a, _b, _c;
35
+ return ({
36
+ root: {
37
+ borderRadius: props.borderRadius,
38
+ '& input, textarea': {
39
+ cursor: props.cantEdit ? 'default' : 'text',
40
+ fontWeight: props.fontWeight,
41
+ color: props.color,
42
+ fontSize: props.fontSize,
43
+ '&::placeholder': {
44
+ fontSize: props.fontSize,
45
+ },
46
+ backgroundColor: props.backgroundColor,
47
+ borderRadius: props.borderRadius,
48
+ height: props.height,
49
+ marginTop: '0px !important',
50
+ padding: '0px 38px 0px 12px !important',
51
+ },
52
+ '& .EF-MuiInputBase-root': {
53
+ padding: '0px !important',
54
+ pointerEvents: 'all',
55
+ },
56
+ '& label': {
57
+ marginTop: '-4px',
58
+ fontSize: props.fontSize,
59
+ color: ((_a = props.color) === null || _a === void 0 ? void 0 : _a.startsWith('#'))
60
+ ? props.color + '8a'
61
+ : props.color,
62
+ whiteSpace: 'nowrap',
63
+ overflow: 'hidden',
64
+ textOverflow: 'ellipsis',
65
+ maxWidth: 'calc(100% - 22px)',
66
+ },
67
+ '& label.EF-MuiInputLabel-shrink': {
68
+ marginTop: '0px',
69
+ maxWidth: 'calc(100% - 5px)',
70
+ },
71
+ '& input + fieldset': {
72
+ borderRadius: props.borderRadius,
73
+ },
74
+ '& .EF-MuiInput-underline:after': {
75
+ borderBottomColor: props.outlineColor,
76
+ },
77
+ '& .EF-MuiOutlinedInput-root': {
78
+ borderRadius: props.borderRadius,
79
+ '&.Mui-focused fieldset': {
80
+ borderColor: props.focusColor,
81
+ borderWidth: props.readOnly ? 1 : 2,
82
+ },
83
+ '& .EF-MuiOutlinedInput-notchedOutline': {
84
+ borderColor: props.outlineColor,
85
+ },
86
+ height: props.height,
87
+ '& .EF-MuiAutocomplete-input': {
88
+ height: props.height,
89
+ marginTop: -10,
90
+ },
91
+ '& .EF-MuiAutocomplete-input::placeholder': {
92
+ color: '#787878',
93
+ opacity: 1,
94
+ },
95
+ },
96
+ '& .EF-MuiOutlinedInput-root:hover .EF-MuiOutlinedInput-notchedOutline': {
97
+ borderColor: props.cantEdit
98
+ ? props.outlineColor
99
+ : props.focusColor,
100
+ },
101
+ '& label.Mui-focused': {
102
+ color: props.focusColor,
103
+ },
104
+ '& .Mui-error': {
105
+ color: props.errorColor + ' !important',
106
+ },
107
+ '& .EF-MuiFormHelperText-root': {
108
+ color: props.helperTextColor,
109
+ },
110
+ '& .EF-MuiFormHelperText-root.Mui-error': {
111
+ color: props.errorColor + ' !important',
112
+ },
113
+ '& .EF-MuiFormLabel-root.Mui-disabled': {
114
+ color: '#0000008a',
115
+ },
116
+ '& .EF-MuiOutlinedInput-notchedOutline': {
117
+ borderColor: '#0000003b',
118
+ },
119
+ '& .EF-MuiAutocomplete-popupIndicator': {
120
+ padding: 0,
121
+ color: ((_b = props.color) === null || _b === void 0 ? void 0 : _b.startsWith('#'))
122
+ ? props.color + '8a'
123
+ : props.color,
124
+ },
125
+ '& .EF-MuiAutocomplete-popupIndicatorOpen': {
126
+ transform: props.showIcon ? 'none' : 'rotate(180deg)',
127
+ },
128
+ '& .EF-MuiAutocomplete-clearIndicator': {
129
+ display: 'none',
130
+ },
131
+ '& .EF-MuiAutocomplete-endAdornment': {
132
+ top: 'calc(50% - 13px)',
133
+ color: ((_c = props.color) === null || _c === void 0 ? void 0 : _c.startsWith('#'))
134
+ ? props.color + '8a'
135
+ : props.color,
136
+ },
137
+ },
138
+ });
139
+ });
140
+ };
141
+ export default function RoundedSmartSelect(_a) {
142
+ var options = _a.options, _b = _a.value, value = _b === void 0 ? '' : _b, handleUpdate = _a.handleUpdate, label = _a.label, _c = _a.getValueString, getValueString = _c === void 0 ? function (value) { return value.value; } : _c, _d = _a.color, color = _d === void 0 ? '#293241' : _d, _e = _a.errorColor, errorColor = _e === void 0 ? '#cc2936' : _e, _f = _a.focusColor, focusColor = _f === void 0 ? '#3d5a7f' : _f, _g = _a.helperTextColor, helperTextColor = _g === void 0 ? '#989898' : _g, _h = _a.outlineColor, outlineColor = _h === void 0 ? '#b8b8b8' : _h, _j = _a.backgroundColor, backgroundColor = _j === void 0 ? '#ffffff' : _j, _k = _a.cantEdit, cantEdit = _k === void 0 ? false : _k, _l = _a.loading, loading = _l === void 0 ? false : _l, _m = _a.height, height = _m === void 0 ? '31px' : _m, _o = _a.fontSize, fontSize = _o === void 0 ? '1rem' : _o, required = _a.required, changeListener = _a.changeListener, error = _a.error, getOptionSelected = _a.getOptionSelected, helperText = _a.helperText, _p = _a.readOnly, readOnly = _p === void 0 ? false : _p, _q = _a.borderRadius, borderRadius = _q === void 0 ? 10 : _q, _r = _a.fontWeight, fontWeight = _r === void 0 ? '400' : _r, icon = _a.icon, _s = _a.searchable, searchable = _s === void 0 ? false : _s, _t = _a.containerMargin, containerMargin = _t === void 0 ? '0px' : _t, _u = _a.showIcon, showIcon = _u === void 0 ? true : _u, inputRef = _a.inputRef, disabled = _a.disabled, _v = _a.creatable, creatable = _v === void 0 ? false : _v, onBlur = _a.onBlur, name = _a.name, onFocus = _a.onFocus;
143
+ var props = {
144
+ color: color,
145
+ height: height,
146
+ errorColor: errorColor,
147
+ focusColor: focusColor,
148
+ outlineColor: outlineColor,
149
+ helperTextColor: helperTextColor,
150
+ backgroundColor: backgroundColor,
151
+ borderRadius: borderRadius,
152
+ readOnly: readOnly,
153
+ fontSize: fontSize,
154
+ fontWeight: fontWeight,
155
+ cantEdit: cantEdit,
156
+ showIcon: showIcon && icon !== undefined,
157
+ };
158
+ var textFieldClasses = useTextfieldStyles(props)();
159
+ if (searchable) {
160
+ return (_jsx(Autocomplete, { onFocus: onFocus, size: "small", fullWidth: true, openOnFocus: true, freeSolo: creatable, disabled: cantEdit || disabled, popupIcon: loading ? (_jsx(CircularProgress, { size: 22, style: { color: '#757575' } })) : showIcon && icon ? (icon) : undefined, onOpen: function () { }, loading: loading, loadingText: 'Cargando...', closeIcon: false, options: options !== null && options !== void 0 ? options : [], getOptionLabel: function (option) {
161
+ var _a, _b;
162
+ // Value selected with enter, right from the input
163
+ if (typeof option === 'string') {
164
+ return option;
165
+ }
166
+ else if (option === null || option === void 0 ? void 0 : option.inputValue) {
167
+ return (_a = option.inputValue) !== null && _a !== void 0 ? _a : '';
168
+ }
169
+ else {
170
+ // Regular option
171
+ return (_b = option.label) !== null && _b !== void 0 ? _b : '';
172
+ }
173
+ }, getOptionSelected: getOptionSelected, PopperComponent: function (_a) {
174
+ var style = _a.style, props = __rest(_a, ["style"]);
175
+ return (_jsx(Popper, __assign({}, props, { style: __assign(__assign({}, style), { zIndex: 1305 }) })));
176
+ }, value: value ? value : null, onChange: function (event, newValue) {
177
+ if (creatable) {
178
+ if (typeof newValue === 'string') {
179
+ changeListener === null || changeListener === void 0 ? void 0 : changeListener(newValue);
180
+ handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(newValue);
181
+ }
182
+ else if (newValue && newValue.inputValue) {
183
+ changeListener === null || changeListener === void 0 ? void 0 : changeListener(newValue.inputValue);
184
+ handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(newValue.inputValue); // Create a new value from the user input
185
+ }
186
+ else {
187
+ changeListener === null || changeListener === void 0 ? void 0 : changeListener(newValue === null || newValue === void 0 ? void 0 : newValue.label);
188
+ handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(newValue === null || newValue === void 0 ? void 0 : newValue.label);
189
+ }
190
+ }
191
+ else {
192
+ changeListener === null || changeListener === void 0 ? void 0 : changeListener(newValue);
193
+ handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(newValue);
194
+ }
195
+ }, filterOptions: function (options, params) {
196
+ if (value && value.label === (params === null || params === void 0 ? void 0 : params.inputValue)) {
197
+ return options;
198
+ }
199
+ else {
200
+ var filtered = filter(options, params);
201
+ // Suggest the creation of a new value
202
+ if (creatable && params.inputValue !== '') {
203
+ filtered.push({
204
+ inputValue: params.inputValue,
205
+ label: "Crear \"".concat(params.inputValue, "\""),
206
+ });
207
+ }
208
+ return filtered;
209
+ }
210
+ }, renderOption: function (option) {
211
+ return typeof option === 'string' ? option : option.label;
212
+ }, renderInput: function (params) { return (_jsx(TextField, __assign({ classes: textFieldClasses }, params, { inputRef: inputRef, onBlur: onBlur, name: name, variant: "outlined", label: label, required: required, error: error, helperText: helperText }))); }, style: { pointerEvents: 'none' }, noOptionsText: "No hay opciones" }));
213
+ }
214
+ else {
215
+ return (_jsxs(RoundedSelect, __assign({ onBlur: onBlur, onFocus: onFocus, inputRef: inputRef, name: name, fullWidth: true, handleUpdate: function (event) {
216
+ handleUpdate === null || handleUpdate === void 0 ? void 0 : handleUpdate(options === null || options === void 0 ? void 0 : options.find(function (option) {
217
+ return getValueString(option) == event.target.value;
218
+ }));
219
+ }, onOpen: function () {
220
+ //Show loading icon if loading
221
+ }, value: getValueString(value), color: color, errorColor: errorColor, focusColor: focusColor, helperTextColor: helperTextColor, backgroundColor: backgroundColor, outlineColor: outlineColor, cantEdit: cantEdit, disabled: cantEdit || disabled, label: label, required: required, readOnly: readOnly, helperText: helperText, containerMargin: containerMargin, height: height, fontSize: fontSize, error: error, iconComponent: loading
222
+ ? function () { return (_jsx("div", __assign({ style: {
223
+ marginTop: 3,
224
+ marginRight: 8,
225
+ } }, { children: _jsx(CircularProgress, { size: 22, style: {
226
+ color: '#757575',
227
+ } }) }))); }
228
+ : showIcon && icon
229
+ ? function (props) {
230
+ return cloneElement(icon, props);
231
+ }
232
+ : undefined, showIcon: showIcon }, { children: [_jsx(MenuItem, __assign({ value: '', style: { whiteSpace: 'normal' } }, { children: _jsx("em", { children: options ? 'Sin Seleccionar' : 'Cargando...' }) }), 'EMPTY'), options === null || options === void 0 ? void 0 : options.map(function (option) { return (_jsx(MenuItem, __assign({ value: getValueString(option), style: { whiteSpace: 'normal' } }, { children: option.label }), getValueString(option))); })] })));
233
+ }
234
+ }
@@ -0,0 +1,45 @@
1
+ import React from 'react';
2
+ import { TextFieldProps } from '@material-ui/core/TextField';
3
+ interface StyleProps {
4
+ /** The color of the text */
5
+ textColor?: string;
6
+ /** The color of the outline when selected and hovered on */
7
+ focusColor?: string;
8
+ /** The color of the error to display */
9
+ errorColor?: string;
10
+ /** The color of the outline when it is not selected */
11
+ outlineColor?: string;
12
+ /** The backgroundColor of the input */
13
+ backgroundColor?: string;
14
+ /** The borderRadius of the input */
15
+ borderRadius?: number;
16
+ /** If input is readOnly */
17
+ readOnly?: boolean;
18
+ /** The padding of the input */
19
+ padding?: string;
20
+ /** The size of the font to display the input in */
21
+ fontSize?: number | string;
22
+ /** The weight of the font of the value and the placeholder */
23
+ fontWeight?: number | string;
24
+ /** If the input is multiline */
25
+ multiline?: boolean;
26
+ /** Cant edit */
27
+ cantEdit?: boolean;
28
+ /** The color of the helper text when not error */
29
+ helperTextColor?: string;
30
+ /** The icon to display */
31
+ icon?: React.ReactNode;
32
+ /** The max length of the string */
33
+ maxLength?: number;
34
+ }
35
+ interface RoundedTextFieldProps extends StyleProps {
36
+ /** The value of the textfield */
37
+ value?: any;
38
+ }
39
+ /**
40
+ * Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
41
+ */
42
+ declare class RoundedTextField extends React.Component<RoundedTextFieldProps & TextFieldProps> {
43
+ render(): JSX.Element;
44
+ }
45
+ export default RoundedTextField;
@@ -0,0 +1,175 @@
1
+ var __extends = (this && this.__extends) || (function () {
2
+ var extendStatics = function (d, b) {
3
+ extendStatics = Object.setPrototypeOf ||
4
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
5
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
6
+ return extendStatics(d, b);
7
+ };
8
+ return function (d, b) {
9
+ if (typeof b !== "function" && b !== null)
10
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
11
+ extendStatics(d, b);
12
+ function __() { this.constructor = d; }
13
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
14
+ };
15
+ })();
16
+ var __assign = (this && this.__assign) || function () {
17
+ __assign = Object.assign || function(t) {
18
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
19
+ s = arguments[i];
20
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
21
+ t[p] = s[p];
22
+ }
23
+ return t;
24
+ };
25
+ return __assign.apply(this, arguments);
26
+ };
27
+ var __rest = (this && this.__rest) || function (s, e) {
28
+ var t = {};
29
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
30
+ t[p] = s[p];
31
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
32
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
33
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
34
+ t[p[i]] = s[p[i]];
35
+ }
36
+ return t;
37
+ };
38
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
39
+ import React from 'react';
40
+ import { makeStyles } from '@material-ui/core/styles';
41
+ import TextField from '@material-ui/core/TextField';
42
+ var useTextfieldStyles = function (props) {
43
+ return makeStyles(function () { return ({
44
+ root: {
45
+ borderRadius: props.borderRadius,
46
+ '& input, textarea': {
47
+ cursor: props.cantEdit ? 'default' : 'text',
48
+ padding: props.multiline ? props.padding : props.padding,
49
+ fontWeight: props.fontWeight,
50
+ color: props.textColor,
51
+ fontSize: props.fontSize,
52
+ '&::placeholder': {
53
+ fontSize: props.fontSize,
54
+ },
55
+ backgroundColor: props.backgroundColor,
56
+ borderRadius: props.borderRadius,
57
+ },
58
+ '& label': {
59
+ marginTop: props.multiline ? '0px' : '-4px',
60
+ fontSize: props.fontSize,
61
+ color: props.textColor + '8a',
62
+ whiteSpace: 'nowrap',
63
+ overflow: 'hidden',
64
+ textOverflow: 'ellipsis',
65
+ maxWidth: 'calc(100% - 22px)',
66
+ },
67
+ '& label.EF-MuiInputLabel-shrink': {
68
+ marginTop: '0px',
69
+ maxWidth: 'calc(100% - 5px)',
70
+ },
71
+ '& input + fieldset': {
72
+ borderRadius: props.borderRadius,
73
+ },
74
+ '& .EF-MuiInput-underline:after': {
75
+ borderBottomColor: props.outlineColor,
76
+ },
77
+ '& .EF-MuiOutlinedInput-root': {
78
+ borderRadius: props.borderRadius,
79
+ '&.Mui-focused fieldset': {
80
+ borderColor: props.focusColor,
81
+ borderWidth: props.readOnly ? 1 : 2,
82
+ },
83
+ '& .EF-MuiOutlinedInput-notchedOutline': {
84
+ borderColor: props.outlineColor,
85
+ '& legend': {
86
+ fontSize: 'calc(' + props.fontSize + ' * 0.75)',
87
+ },
88
+ },
89
+ },
90
+ '& .EF-MuiOutlinedInput-root:hover .EF-MuiOutlinedInput-notchedOutline': {
91
+ borderColor: props.cantEdit
92
+ ? props.outlineColor
93
+ : props.focusColor,
94
+ },
95
+ '& label.Mui-focused': {
96
+ color: props.focusColor,
97
+ },
98
+ '& .Mui-error': {
99
+ color: props.errorColor,
100
+ },
101
+ '& .EF-MuiOutlinedInput-adornedEnd': {
102
+ paddingRight: '7px',
103
+ },
104
+ '& .EF-MuiFormHelperText-root': {
105
+ color: props.helperTextColor,
106
+ marginRight: props.maxLength ? 40 : 14,
107
+ },
108
+ '& .EF-MuiFormHelperText-root.Mui-error': {
109
+ color: props.errorColor,
110
+ },
111
+ '& .EF-MuiOutlinedInput-multiline': {
112
+ padding: 0,
113
+ backgroundColor: props.backgroundColor,
114
+ },
115
+ },
116
+ }); });
117
+ };
118
+ function CustomTextfield(_a) {
119
+ var _b = _a.focusColor, focusColor = _b === void 0 ? '#3d5a7f' : _b, _c = _a.helperTextColor, helperTextColor = _c === void 0 ? '#989898' : _c, _d = _a.outlineColor, outlineColor = _d === void 0 ? '#0000003b' : _d, _e = _a.backgroundColor, backgroundColor = _e === void 0 ? 'white' : _e, _f = _a.textColor, textColor = _f === void 0 ? '#293241' : _f, _g = _a.readOnly, readOnly = _g === void 0 ? false : _g, _h = _a.borderRadius, borderRadius = _h === void 0 ? 10 : _h, _j = _a.padding, padding = _j === void 0 ? '6px 12px' : _j, _k = _a.fontSize, fontSize = _k === void 0 ? '1rem' : _k, _l = _a.errorColor, errorColor = _l === void 0 ? '#cc2936' : _l, _m = _a.fontWeight, fontWeight = _m === void 0 ? '300' : _m, _o = _a.multiline, multiline = _o === void 0 ? false : _o, _p = _a.cantEdit, cantEdit = _p === void 0 ? false : _p, maxLength = _a.maxLength, value = _a.value, icon = _a.icon, others = __rest(_a, ["focusColor", "helperTextColor", "outlineColor", "backgroundColor", "textColor", "readOnly", "borderRadius", "padding", "fontSize", "errorColor", "fontWeight", "multiline", "cantEdit", "maxLength", "value", "icon"]);
120
+ var classes = useTextfieldStyles({
121
+ padding: padding,
122
+ textColor: textColor,
123
+ errorColor: errorColor,
124
+ focusColor: focusColor,
125
+ outlineColor: outlineColor,
126
+ helperTextColor: helperTextColor,
127
+ backgroundColor: backgroundColor,
128
+ borderRadius: borderRadius,
129
+ readOnly: readOnly,
130
+ fontSize: fontSize,
131
+ fontWeight: fontWeight,
132
+ multiline: multiline,
133
+ cantEdit: cantEdit,
134
+ maxLength: maxLength,
135
+ })();
136
+ var length = maxLength ? value.length : null;
137
+ var inputProps = {
138
+ readOnly: readOnly,
139
+ disabled: cantEdit,
140
+ endAdornment: icon,
141
+ };
142
+ if (maxLength) {
143
+ inputProps.inputProps = { maxLength: maxLength };
144
+ }
145
+ return (_jsxs("div", __assign({ style: { position: 'relative', width: '100%', maxWidth: '100%' } }, { children: [_jsx(TextField, __assign({ classes: classes }, others, { value: value !== null && value !== void 0 ? value : '', multiline: multiline, variant: "outlined", size: "small", fullWidth: true, InputProps: inputProps })), length !== null && (_jsxs("div", __assign({ style: others.helperText
146
+ ? {
147
+ position: 'absolute',
148
+ bottom: '3px',
149
+ right: '8px',
150
+ fontSize: '12px',
151
+ color: helperTextColor,
152
+ }
153
+ : {
154
+ fontSize: '12px',
155
+ color: helperTextColor,
156
+ textAlign: 'right',
157
+ paddingRight: '8px',
158
+ paddingTop: '2px',
159
+ paddingBottom: '2px',
160
+ } }, { children: [length, "/", maxLength] })))] })));
161
+ }
162
+ /**
163
+ * Generic textfield with apps designs. Is class do to the use in the react-hook-forms library
164
+ */
165
+ var RoundedTextField = /** @class */ (function (_super) {
166
+ __extends(RoundedTextField, _super);
167
+ function RoundedTextField() {
168
+ return _super !== null && _super.apply(this, arguments) || this;
169
+ }
170
+ RoundedTextField.prototype.render = function () {
171
+ return _jsx(CustomTextfield, __assign({}, this.props));
172
+ };
173
+ return RoundedTextField;
174
+ }(React.Component));
175
+ export default RoundedTextField;
@@ -0,0 +1,8 @@
1
+ import { Form } from '../@Types';
2
+ export interface Incident {
3
+ idSpaceStep: string;
4
+ idElementStep: string;
5
+ idCommentStep: string;
6
+ num: number;
7
+ }
8
+ export declare const calcCbrForm: (form: Form, formValues: Record<string, any>) => Form;
@@ -0,0 +1,53 @@
1
+ var __assign = (this && this.__assign) || function () {
2
+ __assign = Object.assign || function(t) {
3
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
4
+ s = arguments[i];
5
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
6
+ t[p] = s[p];
7
+ }
8
+ return t;
9
+ };
10
+ return __assign.apply(this, arguments);
11
+ };
12
+ import CBRFormStepTypes from '../constants/CBRFormStepTypes';
13
+ export var calcCbrForm = function (form, formValues) {
14
+ var _a;
15
+ for (var _i = 0, _b = Object.values(form.steps); _i < _b.length; _i++) {
16
+ var step = _b[_i];
17
+ if (step.type === CBRFormStepTypes.CBR_INCIDENCIAS) {
18
+ var incidentStep = step;
19
+ var incValue = formValues[(_a = incidentStep.id) !== null && _a !== void 0 ? _a : ''];
20
+ if (incValue) {
21
+ for (var _c = 0, incValue_1 = incValue; _c < incValue_1.length; _c++) {
22
+ var incident = incValue_1[_c];
23
+ handleAddIncident(incident, incidentStep, form.steps, formValues);
24
+ }
25
+ }
26
+ }
27
+ }
28
+ return form;
29
+ };
30
+ var handleAddIncident = function (incident, step, steps, formValues) {
31
+ var _a, _b;
32
+ var spaceStep = __assign(__assign({}, step.spaceStep), { id: incident.idSpaceStep, type: CBRFormStepTypes.CBR_TIPO_ESPACIO, dependencies: step.dependencies });
33
+ steps[incident.idSpaceStep] = spaceStep;
34
+ var commentStep = __assign(__assign({}, step.commentStep), { id: incident.idCommentStep, type: CBRFormStepTypes.CBR_COMENTARIO });
35
+ steps[incident.idCommentStep] = commentStep;
36
+ addRecursiveElementStep(incident.idElementStep, step.elementStep, null, steps, (_b = (_a = step.dependencies) === null || _a === void 0 ? void 0 : _a[0]) !== null && _b !== void 0 ? _b : '', formValues);
37
+ };
38
+ var addRecursiveElementStep = function (idStep, step, idParent, steps, idProjectDep, formValues) {
39
+ var _a, _b, _c;
40
+ var idSubStep = (_a = formValues[idStep]) === null || _a === void 0 ? void 0 : _a.subStep;
41
+ var newSubStep = step.subStep ? __assign({}, step.subStep) : undefined;
42
+ var newStep = __assign(__assign({}, step), { id: idStep, type: CBRFormStepTypes.CBR_LOCATIVAS, dependencies: [idProjectDep], subStep: null });
43
+ if (newSubStep) {
44
+ newStep.subStep = idSubStep;
45
+ }
46
+ if (idParent) {
47
+ (_c = (_b = newStep.dependencies) === null || _b === void 0 ? void 0 : _b.push) === null || _c === void 0 ? void 0 : _c.call(_b, idParent);
48
+ }
49
+ steps[idStep] = newStep;
50
+ if (newSubStep) {
51
+ addRecursiveElementStep(idSubStep, newSubStep, idStep, steps, idProjectDep, formValues);
52
+ }
53
+ };
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.9.79-test",
4
+ "version":"1.9.81-test",
5
5
  "scripts": {
6
6
  "start": "react-scripts start",
7
7
  "build": "react-scripts build",