@arquimedes.co/eureka-forms 1.9.84-test → 1.9.85-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 +62 -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 +8 -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 +16 -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 +29 -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,147 @@
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 React, { useEffect, useState } from 'react';
25
+ import { FormStyleTypes, FormTypes } from '../../constants/FormStepTypes';
26
+ import Navbar from '../../shared/Navbar/Navbar';
27
+ import ColumnForm from './ColumnForm/ColumnForm';
28
+ import StepperForm from './StepperForm/StepperForm';
29
+ import styles from './Form.module.css';
30
+ import { MuiPickersUtilsProvider } from '@material-ui/pickers';
31
+ import DateFnsUtils from '@date-io/date-fns';
32
+ import { createGenerateClassName, createTheme, StylesProvider, ThemeProvider, } from '@material-ui/core';
33
+ import { SEED } from '../../constants/MaterialClassNameSeed';
34
+ import InternalFormStyle from '../../constants/InternalFormStyle';
35
+ import enLocale from 'date-fns/locale/en-US';
36
+ import esLocale from 'date-fns/locale/es';
37
+ var localeMap = {
38
+ en: enLocale,
39
+ 'en-US': enLocale,
40
+ es: esLocale,
41
+ };
42
+ export var getLocale = function () {
43
+ var _a;
44
+ return ((_a = localeMap[navigator.languages && navigator.languages.length
45
+ ? navigator.languages[0]
46
+ : navigator.userLanguage ||
47
+ navigator.language ||
48
+ navigator.browserLanguage]) !== null && _a !== void 0 ? _a : localeMap.es);
49
+ };
50
+ function FormComponent(_a) {
51
+ var _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
52
+ var form = _a.form, isWidget = _a.isWidget, internal = _a.internal, postview = _a.postview, organization = _a.organization, containerRef = _a.containerRef, others = __rest(_a, ["form", "isWidget", "internal", "postview", "organization", "containerRef"]);
53
+ var _p = useState(false), loaded = _p[0], setLoaded = _p[1];
54
+ var _q = useState(undefined), widthStats = _q[0], setWidthStats = _q[1];
55
+ /** Calcs the currentBreakPoint and if is mobile */
56
+ var handleResize = function () {
57
+ var _a;
58
+ var currentWidth = (_a = containerRef === null || containerRef === void 0 ? void 0 : containerRef.current) === null || _a === void 0 ? void 0 : _a.offsetWidth;
59
+ if (currentWidth !== undefined) {
60
+ var currentBreakPoint = form.size.blockNum;
61
+ var padding = postview || internal || !form.isStandAlone ? 0 : 40;
62
+ while (currentWidth <
63
+ (form.size.blockSize + form.size.spacingSize) *
64
+ currentBreakPoint +
65
+ padding) {
66
+ currentBreakPoint--;
67
+ }
68
+ setWidthStats({
69
+ isResponsive: currentWidth <
70
+ (form.size.blockSize + form.size.spacingSize) *
71
+ form.size.blockNum +
72
+ padding,
73
+ isMobile: currentWidth <
74
+ (form.size.blockSize + form.size.spacingSize) * 2 + padding,
75
+ currentBreakPoint: currentBreakPoint,
76
+ });
77
+ }
78
+ };
79
+ useEffect(function () {
80
+ /** On load add a resize listener to calc the currentBreakpoint */
81
+ window.addEventListener('resize', handleResize);
82
+ handleResize();
83
+ return function () {
84
+ window.removeEventListener('resize', handleResize);
85
+ };
86
+ }, [containerRef.current, (_b = containerRef.current) === null || _b === void 0 ? void 0 : _b.offsetWidth]);
87
+ //If currently displaying internal or form is standalone
88
+ if ((postview || internal || !form.isStandAlone) &&
89
+ widthStats !== undefined) {
90
+ return (_jsx("div", __assign({ style: {
91
+ backgroundColor: internal
92
+ ? 'transparent'
93
+ : (_d = (_c = form.style) === null || _c === void 0 ? void 0 : _c.backgroundColor) !== null && _d !== void 0 ? _d : InternalFormStyle.backgroundColor,
94
+ minHeight: form.isStandAlone && !isWidget ? '100vh' : '100%',
95
+ } }, { children: _jsx("div", __assign({ className: styles.widgetFormContainer, ref: containerRef }, { children: _jsx(FormTypeComponent, __assign({}, others, { handleLoaded: function () {
96
+ setLoaded(true);
97
+ }, widthStats: widthStats, form: form, internal: internal, postview: postview, organization: organization, formStyle: internal
98
+ ? InternalFormStyle
99
+ : __assign(__assign({}, InternalFormStyle), ((_e = form.style) !== null && _e !== void 0 ? _e : {})) })) })) })));
100
+ }
101
+ else if (organization && widthStats !== undefined) {
102
+ //Standalone cant have widget
103
+ return (_jsxs(React.Fragment, { children: [_jsx(Navbar, { logo: organization.logoUrl, color: (_g = (_f = organization.styles) === null || _f === void 0 ? void 0 : _f.navbarColor) !== null && _g !== void 0 ? _g : (_h = organization.styles) === null || _h === void 0 ? void 0 : _h.primaryColor }), _jsx("div", __assign({ className: styles.standAloneFormContainer, ref: containerRef, style: {
104
+ background: (_k = (_j = form.style) === null || _j === void 0 ? void 0 : _j.standAloneBackgroundColor) !== null && _k !== void 0 ? _k : '#ffffff',
105
+ } }, { children: _jsx("div", __assign({ className: widthStats.isResponsive
106
+ ? styles.fullScreenStandAloneForm
107
+ : styles.standAloneFormCard, style: {
108
+ backgroundColor: (_m = (_l = form.style) === null || _l === void 0 ? void 0 : _l.backgroundColor) !== null && _m !== void 0 ? _m : InternalFormStyle.backgroundColor,
109
+ visibility: loaded ? 'visible' : 'hidden',
110
+ } }, { children: _jsx(FormTypeComponent, __assign({}, others, { internal: internal, postview: postview, widthStats: widthStats, form: form, formStyle: (_o = form.style) !== null && _o !== void 0 ? _o : InternalFormStyle, organization: organization, handleLoaded: function () {
111
+ setLoaded(true);
112
+ } })) })) }))] }));
113
+ }
114
+ else {
115
+ return _jsx("div", {});
116
+ }
117
+ }
118
+ var muiTheme = createTheme({
119
+ typography: {
120
+ fontFamily: 'inherit',
121
+ },
122
+ });
123
+ var generateClassName = createGenerateClassName({
124
+ seed: SEED,
125
+ productionPrefix: 'efjss',
126
+ });
127
+ function FormTypeComponent(_a) {
128
+ var props = __rest(_a, []);
129
+ var renderTypes = function () {
130
+ switch (props.form.type) {
131
+ case FormTypes.STEPPER: {
132
+ return _jsx(StepperForm, __assign({}, props));
133
+ }
134
+ case FormTypes.COLUMN:
135
+ default: {
136
+ return _jsx(ColumnForm, __assign({}, props));
137
+ }
138
+ }
139
+ };
140
+ switch (props.formStyle.type) {
141
+ case FormStyleTypes.MATERIAL:
142
+ return (_jsx(StylesProvider, __assign({ generateClassName: generateClassName }, { children: _jsx(ThemeProvider, __assign({ theme: muiTheme }, { children: _jsx(MuiPickersUtilsProvider, __assign({ utils: DateFnsUtils, locale: getLocale() }, { children: renderTypes() })) })) })));
143
+ default:
144
+ return renderTypes();
145
+ }
146
+ }
147
+ export default FormComponent;
@@ -0,0 +1,39 @@
1
+ .standAloneFormContainer {
2
+ width: 100%;
3
+ max-width: 100%;
4
+ overflow: hidden;
5
+ min-height: calc(100vh - 60px);
6
+ display: flex;
7
+ overflow-x: hidden;
8
+ }
9
+
10
+ .fullScreenStandAloneForm {
11
+ width: 100%;
12
+ padding: 20px;
13
+ min-height: 100%;
14
+ overflow: hidden;
15
+ }
16
+
17
+ .standAloneFormCard {
18
+ -webkit-box-shadow: -6px 0px 8px 5px rgba(0, 0, 0, 0.2);
19
+ -moz-box-shadow: -6px 0px 8px 5px rgba(0, 0, 0, 0.2);
20
+ box-shadow: -6px 0px 8px 5px rgba(0, 0, 0, 0.2);
21
+ margin-top: 30px;
22
+ margin-left: auto;
23
+ margin-right: auto;
24
+ height: fit-content;
25
+ width: fit-content;
26
+ border-radius: 15px;
27
+ padding: 20px;
28
+ margin-bottom: 30px;
29
+ }
30
+
31
+ .widgetFormContainer {
32
+ padding-top: 10px;
33
+ padding-bottom: 10px;
34
+ margin-left: auto;
35
+ margin-right: auto;
36
+ height: fit-content;
37
+ width: fit-content;
38
+ max-width: 100%;
39
+ }
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { FormComponentProps } from '../Form';
3
+ declare function StepperForm({}: FormComponentProps): JSX.Element;
4
+ export default StepperForm;
@@ -0,0 +1,6 @@
1
+ import { jsx as _jsx } from "react/jsx-runtime";
2
+ // import styles from './StepperForm.module.css';
3
+ function StepperForm(_a) {
4
+ return _jsx("div", {});
5
+ }
6
+ export default StepperForm;
@@ -0,0 +1,4 @@
1
+ /// <reference types="react" />
2
+ import { SectionComponentProps } from '../Section';
3
+ declare function MaterialSection({ form, section, widthStats, sendLabel, ...others }: SectionComponentProps): JSX.Element;
4
+ export default MaterialSection;
@@ -0,0 +1,42 @@
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 } from "react/jsx-runtime";
24
+ import { createElement as _createElement } from "react";
25
+ import StepComponent from '../../Step/Step';
26
+ import styles from './MaterialSection.module.css';
27
+ function MaterialSection(_a) {
28
+ var _b;
29
+ var form = _a.form, section = _a.section, widthStats = _a.widthStats, sendLabel = _a.sendLabel, others = __rest(_a, ["form", "section", "widthStats", "sendLabel"]);
30
+ return (_jsx("div", __assign({ className: styles.container, style: {
31
+ width: (form.size.blockSize + form.size.spacingSize) *
32
+ form.size.blockNum,
33
+ justifyContent: sendLabel !== undefined &&
34
+ widthStats.currentBreakPoint < form.size.blockNum
35
+ ? 'center'
36
+ : 'normal',
37
+ } }, { children: (_b = section.steps) === null || _b === void 0 ? void 0 : _b.map(function (idStep) {
38
+ var step = form.steps[idStep];
39
+ return (_createElement(StepComponent, __assign({}, others, { globalEditable: others.editable, widthStats: widthStats, form: form, step: step, key: idStep, level: 0 })));
40
+ }) })));
41
+ }
42
+ export default MaterialSection;
@@ -0,0 +1,8 @@
1
+ .container {
2
+ display: flex;
3
+ flex-flow: row wrap;
4
+ height: fit-content;
5
+ max-width: 100%;
6
+ overflow-x: hidden;
7
+ overflow-y: hidden;
8
+ }
@@ -0,0 +1,39 @@
1
+ /// <reference types="react" />
2
+ import { Control, FieldValues, UseFormGetValues } from 'react-hook-form';
3
+ import { Organization } from '../../@Types';
4
+ import { Form, FormStyle, Section } from '../../@Types/Form';
5
+ import { CustomStep } from '../../App';
6
+ import { WidthStats } from '../Form/Form';
7
+ export interface RecursiveData {
8
+ form: Form;
9
+ organization: Organization;
10
+ control: Control<FieldValues, object>;
11
+ formStyle: FormStyle;
12
+ /** If the formsteps can be edited (For internal) */
13
+ editable: boolean;
14
+ preview: boolean;
15
+ postview: boolean;
16
+ partial: boolean;
17
+ domain?: string;
18
+ errors: Record<string, any>;
19
+ widthStats: WidthStats;
20
+ clearErrors: Function;
21
+ getValues: UseFormGetValues<FieldValues>;
22
+ originalValues: Record<string, any>;
23
+ customSteps: Record<string, CustomStep>;
24
+ customStepProps: Record<string, any>;
25
+ /** Function to call on postview to fetch the download url of a file */
26
+ fetchDownloadUrl?: (S3Key: string, fileName: string) => Promise<string>;
27
+ dependencyStore: Record<string, any>;
28
+ setDependencyStore: (values: Record<string, any>) => void;
29
+ setFocus: (id: string) => void;
30
+ }
31
+ export interface SectionComponentProps extends RecursiveData {
32
+ /** The custom send label to display */
33
+ sendLabel?: string;
34
+ section: Section;
35
+ setSections: Function;
36
+ index: number;
37
+ }
38
+ declare function SectionComponent(props: SectionComponentProps): JSX.Element;
39
+ export default SectionComponent;
@@ -0,0 +1,23 @@
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 { jsx as _jsx } from "react/jsx-runtime";
13
+ import { FormStyleTypes } from '../../constants/FormStepTypes';
14
+ import MaterialSection from './MaterialSection/MaterialSection';
15
+ function SectionComponent(props) {
16
+ switch (props.formStyle.type) {
17
+ case FormStyleTypes.MATERIAL:
18
+ default: {
19
+ return _jsx(MaterialSection, __assign({}, props));
20
+ }
21
+ }
22
+ }
23
+ export default SectionComponent;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { StepProps } from '../../Step';
3
+ import { CBRElementStep } from '../../../../@Types/CBRFormStep';
4
+ declare function CBRElementStepComponent(props: ElementSubStepRendererProps): JSX.Element;
5
+ export default CBRElementStepComponent;
6
+ export interface ElementSubStepRendererProps extends Omit<StepProps, 'step'> {
7
+ step: CBRElementStep;
8
+ }
@@ -0,0 +1,139 @@
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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
13
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
14
+ return new (P || (P = Promise))(function (resolve, reject) {
15
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
16
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
17
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
18
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
19
+ });
20
+ };
21
+ var __generator = (this && this.__generator) || function (thisArg, body) {
22
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
23
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
24
+ function verb(n) { return function (v) { return step([n, v]); }; }
25
+ function step(op) {
26
+ if (f) throw new TypeError("Generator is already executing.");
27
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
28
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
29
+ if (y = 0, t) op = [op[0] & 2, t.value];
30
+ switch (op[0]) {
31
+ case 0: case 1: t = op; break;
32
+ case 4: _.label++; return { value: op[1], done: false };
33
+ case 5: _.label++; y = op[1]; op = [0]; continue;
34
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
35
+ default:
36
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
37
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
38
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
39
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
40
+ if (t[2]) _.ops.pop();
41
+ _.trys.pop(); continue;
42
+ }
43
+ op = body.call(thisArg, _);
44
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
45
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
46
+ }
47
+ };
48
+ import { jsx as _jsx } from "react/jsx-runtime";
49
+ import SmartSelectStep from '../../SmartSelectStep/SmartSelectStep';
50
+ import CBRFormStepTypes from '../../../../constants/CBRFormStepTypes';
51
+ import axios from 'axios';
52
+ import InputIcon from '../../../../shared/InputIcon/InputIcon';
53
+ function CBRElementStepComponent(props) {
54
+ return (_jsx(SmartSelectStep, __assign({}, props, { step: props.step, icon: _jsx(InputIcon, { icon: 'LEAK' }), getOptions: getElementOptions, getOptionSelected: function (option, value) {
55
+ return option.id === value.id;
56
+ }, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; }, calcDepError: calcDepError, calcInvalidDeps: calcInvalidDependencies, valueOverwrite: function (value) {
57
+ if (value) {
58
+ return __assign(__assign({}, value), { subStep: props.step.subStep });
59
+ }
60
+ else {
61
+ return null;
62
+ }
63
+ } }, { children: _jsx(ElementSubStepRenderer, {}) })));
64
+ }
65
+ export default CBRElementStepComponent;
66
+ function ElementSubStepRenderer(_a) {
67
+ var _b;
68
+ var value = _a.value, stepProps = _a.stepProps;
69
+ if (!value || stepProps == undefined) {
70
+ return _jsx("div", {});
71
+ }
72
+ var subStep = stepProps === null || stepProps === void 0 ? void 0 : stepProps.form.steps[(_b = stepProps.step.subStep) !== null && _b !== void 0 ? _b : ''];
73
+ if ((subStep === null || subStep === void 0 ? void 0 : subStep.type) !== CBRFormStepTypes.CBR_LOCATIVAS) {
74
+ return _jsx("div", {});
75
+ }
76
+ return (_jsx(SmartSelectStep, __assign({}, stepProps, { step: subStep, level: stepProps.level + 1, icon: _jsx(InputIcon, { icon: 'LEAK' }), calcInvalidDeps: calcInvalidDependencies, getOptions: getElementOptions, calcDepError: calcDepError, getOptionSelected: function (option, value) {
77
+ return option.id === value.id;
78
+ }, getValueString: function (value) { return value === null || value === void 0 ? void 0 : value.id; } }, { children: _jsx(ElementSubStepRenderer, {}) })));
79
+ }
80
+ var getElementOptions = function (_a, step, dependencyStore) {
81
+ var idOrganization = _a.idOrganization;
82
+ return __awaiter(void 0, void 0, void 0, function () {
83
+ var idProyecto, response, father_1;
84
+ var _b;
85
+ return __generator(this, function (_c) {
86
+ switch (_c.label) {
87
+ case 0:
88
+ if (!step.dependencies) return [3 /*break*/, 2];
89
+ idProyecto = (_b = dependencyStore[step.dependencies[0]]) === null || _b === void 0 ? void 0 : _b.id;
90
+ if (!idProyecto) {
91
+ return [2 /*return*/, null]; //null para indicar que falta la depedency
92
+ }
93
+ return [4 /*yield*/, axios.get("https://integrations.".concat(process.env.REACT_APP_DOMAIN, "/sinco/cbr/Locativas?idOrganization=").concat(idOrganization))];
94
+ case 1:
95
+ response = (_c.sent()).data;
96
+ father_1 = dependencyStore[step.dependencies[1]];
97
+ if (father_1 !== undefined && father_1.id === undefined) {
98
+ return [2 /*return*/, null];
99
+ }
100
+ return [2 /*return*/, response.filter(function (locativa) {
101
+ if (father_1 === null || father_1 === void 0 ? void 0 : father_1.id) {
102
+ return (locativa.id.startsWith(father_1.id) &&
103
+ locativa.id !== father_1.id);
104
+ }
105
+ else {
106
+ return locativa.id.length === 2;
107
+ }
108
+ })];
109
+ case 2: return [2 /*return*/, null];
110
+ }
111
+ });
112
+ });
113
+ };
114
+ var calcInvalidDependencies = function (step, dependencyStore) {
115
+ var _a;
116
+ var deps = [];
117
+ if (step.dependencies) {
118
+ for (var _i = 0, _b = step.dependencies; _i < _b.length; _i++) {
119
+ var idDep = _b[_i];
120
+ if (((_a = dependencyStore[idDep]) === null || _a === void 0 ? void 0 : _a.id) === undefined) {
121
+ deps.push(idDep);
122
+ }
123
+ }
124
+ }
125
+ return deps;
126
+ };
127
+ var calcDepError = function (steps) {
128
+ for (var _i = 0, steps_1 = steps; _i < steps_1.length; _i++) {
129
+ var step = steps_1[_i];
130
+ var type = step.type;
131
+ if (type === CBRFormStepTypes.CBR_PROYECTO) {
132
+ return 'Selecciona un proyecto';
133
+ }
134
+ if (type === CBRFormStepTypes.CBR_LOCATIVAS) {
135
+ return 'Selecciona un padre';
136
+ }
137
+ }
138
+ return undefined;
139
+ };
@@ -0,0 +1,9 @@
1
+ /// <reference types="react" />
2
+ import { CBRIncidentsStep as CBRIncidentsStepType } from '../../../../@Types/CBRFormStep';
3
+ import { StepProps } from '../../Step';
4
+ export interface CBRIncidentsStepProps extends Omit<StepProps, 'step'> {
5
+ /** The CBRIncidentsStep to display */
6
+ step: CBRIncidentsStepType;
7
+ }
8
+ declare function CBRIncidentsStep(props: CBRIncidentsStepProps): JSX.Element;
9
+ export default CBRIncidentsStep;
@@ -0,0 +1,23 @@
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 { jsx as _jsx } from "react/jsx-runtime";
13
+ import { FormStyleTypes } from '../../../../constants/FormStepTypes';
14
+ import MaterialCBRIncidentsStep from './MaterialCBRIncidentsStep/MaterialCBRIncidentsStep';
15
+ function CBRIncidentsStep(props) {
16
+ switch (props.formStyle.type) {
17
+ case FormStyleTypes.MATERIAL:
18
+ default: {
19
+ return _jsx(MaterialCBRIncidentsStep, __assign({}, props));
20
+ }
21
+ }
22
+ }
23
+ export default CBRIncidentsStep;
@@ -0,0 +1,8 @@
1
+ /// <reference types="react" />
2
+ import { CBRIncidentsStepProps } from '../../CBRIncidentsStep';
3
+ import { Incident } from '../MaterialCBRIncidentsStep';
4
+ declare function IncidentComponent({ step, form, level, incident, formStyle, handleDelete, ...others }: CBRIncidentsStepProps & {
5
+ incident: Incident;
6
+ handleDelete: Function;
7
+ }): JSX.Element;
8
+ export default IncidentComponent;
@@ -0,0 +1,49 @@
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 styles from './Incident.module.css';
25
+ import StepComponent from '../../../../Step';
26
+ import DeleteRoundedIcon from '@material-ui/icons/DeleteRounded';
27
+ import TextAreaStep from '../../../../TextAreaStep/TextAreaStep';
28
+ function IncidentComponent(_a) {
29
+ var step = _a.step, form = _a.form, level = _a.level, incident = _a.incident, formStyle = _a.formStyle, handleDelete = _a.handleDelete, others = __rest(_a, ["step", "form", "level", "incident", "formStyle", "handleDelete"]);
30
+ var spaceStep = form.steps[incident.idSpaceStep];
31
+ var elementStep = form.steps[incident.idElementStep];
32
+ var commentStep = form.steps[incident.idCommentStep];
33
+ if (incident.deleted) {
34
+ return _jsx("div", {});
35
+ }
36
+ return (_jsx("div", __assign({ className: others.widthStats.isMobile || form.size.blockNum < 3
37
+ ? styles.mobileContainer
38
+ : styles.container }, { children: _jsxs("div", __assign({ className: styles.contentContainer, style: {
39
+ width: (form.size.blockSize + form.size.spacingSize) *
40
+ (form.size.blockNum - 1),
41
+ } }, { children: [_jsxs("div", __assign({ className: styles.titleLbl, style: { color: formStyle.textColor } }, { children: [step.unitLabel + ' ' + incident.num, ":"] })), _jsx("div", __assign({ className: !others.editable || others.postview
42
+ ? styles.disabledDeleteBtn
43
+ : styles.deleteBtn, style: { color: formStyle.textColor }, onClick: function () {
44
+ if (others.editable && !others.postview) {
45
+ handleDelete();
46
+ }
47
+ } }, { children: _jsx(DeleteRoundedIcon, { fontSize: "inherit" }) })), _jsx(StepComponent, __assign({}, others, { formStyle: formStyle, form: form, step: spaceStep, level: level + 1 })), _jsx(StepComponent, __assign({}, others, { form: form, formStyle: formStyle, step: elementStep, level: level + 1 })), _jsx(TextAreaStep, __assign({}, others, { form: form, formStyle: formStyle, step: commentStep, maxLength: 200, level: level + 1 }))] })) })));
48
+ }
49
+ export default IncidentComponent;
@@ -0,0 +1,60 @@
1
+ .container,
2
+ .mobileContainer {
3
+ background-color: #f0f0f0;
4
+ border: 1px solid #d6d6d6;
5
+ width: fit-content;
6
+ border-radius: 20px;
7
+ margin-bottom: 10px;
8
+ margin-top: 10px;
9
+ margin-left: auto;
10
+ margin-right: auto;
11
+ padding-top: 20px;
12
+ padding-bottom: 20px;
13
+ position: relative;
14
+ }
15
+ .container {
16
+ max-width: calc(100% - 112px);
17
+ padding-right: 55px;
18
+ padding-left: 55px;
19
+ }
20
+
21
+ .mobileContainer {
22
+ max-width: calc(100% - 42px);
23
+ padding-right: 20px;
24
+ padding-left: 20px;
25
+ }
26
+
27
+ .titleLbl {
28
+ width: 100%;
29
+ font-size: 20px;
30
+ font-weight: 600;
31
+ white-space: nowrap;
32
+ overflow: hidden;
33
+ text-overflow: ellipsis;
34
+ cursor: default;
35
+ margin-left: 10px;
36
+ margin-bottom: 10px;
37
+ }
38
+
39
+ .contentContainer {
40
+ margin-left: auto;
41
+ margin-right: auto;
42
+ display: flex;
43
+ flex-flow: row wrap;
44
+ height: fit-content;
45
+ max-width: 100%;
46
+ overflow-x: hidden;
47
+ overflow-y: hidden;
48
+ }
49
+
50
+ .deleteBtn,
51
+ .disabledDeleteBtn {
52
+ font-size: 24px;
53
+ position: absolute;
54
+ right: 15px;
55
+ top: 15px;
56
+ }
57
+
58
+ .deleteBtn {
59
+ cursor: pointer;
60
+ }
@@ -0,0 +1,11 @@
1
+ /// <reference types="react" />
2
+ import { CBRIncidentsStepProps } from '../CBRIncidentsStep';
3
+ export interface Incident {
4
+ idSpaceStep: string;
5
+ idElementStep: string;
6
+ idCommentStep: string;
7
+ deleted?: boolean;
8
+ num: number;
9
+ }
10
+ declare function CBRIncidentsStep(props: CBRIncidentsStepProps): JSX.Element;
11
+ export default CBRIncidentsStep;