@arquimedes.co/eureka-forms 2.0.99 → 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 (334) hide show
  1. package/dist/@Types/FormStep.d.ts +1 -1
  2. package/dist/App/App.d.ts +1 -3
  3. package/dist/App/App.js +21 -46
  4. package/dist/App/AppFunctions.d.ts +1 -1
  5. package/dist/App/AppFunctions.js +177 -328
  6. package/dist/App/AppFunctions.test.js +638 -0
  7. package/dist/App/AppHooks.d.ts +2 -2
  8. package/dist/App/AppHooks.js +127 -223
  9. package/dist/App/AppHooks.test.d.ts +1 -0
  10. package/dist/App/AppHooks.test.js +154 -0
  11. package/dist/Contexts/CustomContext.d.ts +0 -1
  12. package/dist/Contexts/CustomContext.js +1 -1
  13. package/dist/Contexts/FormContext.d.ts +1 -1
  14. package/dist/Contexts/FormContext.js +3 -2
  15. package/dist/Contexts/SectionContext.d.ts +0 -1
  16. package/dist/Contexts/SectionContext.js +1 -1
  17. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +0 -1
  18. package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +43 -62
  19. package/dist/Form/Form.d.ts +1 -2
  20. package/dist/Form/Form.js +75 -160
  21. package/dist/Form/FormFunctions.js +64 -114
  22. package/dist/Form/FormFunctions.test.d.ts +1 -0
  23. package/dist/Form/FormFunctions.test.js +454 -0
  24. package/dist/Form/FormHooks.d.ts +0 -1
  25. package/dist/Form/FormHooks.js +14 -21
  26. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +0 -1
  27. package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +34 -105
  28. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -2
  29. package/dist/Form/FormTypes/StepperForm/StepperForm.js +48 -110
  30. package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +0 -1
  31. package/dist/Form/Section/MaterialSection/MaterialSection.js +10 -23
  32. package/dist/Form/Section/MaterialSection/MaterialSection.module.css +0 -2
  33. package/dist/Form/Section/Section.d.ts +0 -1
  34. package/dist/Form/Section/Section.js +4 -15
  35. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +0 -1
  36. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +30 -65
  37. package/dist/Form/Terms/Term/Term.d.ts +0 -1
  38. package/dist/Form/Terms/Term/Term.js +2 -13
  39. package/dist/Form/Terms/Terms.d.ts +0 -1
  40. package/dist/Form/Terms/Terms.js +11 -27
  41. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +0 -1
  42. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +36 -106
  43. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +0 -1
  44. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
  45. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +0 -1
  46. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +12 -40
  47. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +0 -1
  48. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +57 -77
  49. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +0 -1
  50. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +46 -111
  51. package/dist/FormSteps/AYFStepMapper.d.ts +0 -1
  52. package/dist/FormSteps/AYFStepMapper.js +63 -127
  53. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +0 -1
  54. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +2 -13
  55. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +0 -1
  56. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +63 -165
  57. package/dist/FormSteps/CBRStepMapper.d.ts +0 -1
  58. package/dist/FormSteps/CBRStepMapper.js +61 -152
  59. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +0 -1
  60. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +2 -13
  61. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +0 -1
  62. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +19 -37
  63. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +0 -1
  64. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +2 -13
  65. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +1 -2
  66. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +47 -80
  67. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +0 -1
  68. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +3 -26
  69. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +0 -1
  70. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +33 -61
  71. package/dist/FormSteps/CustomStep.d.ts +0 -1
  72. package/dist/FormSteps/CustomStep.js +17 -31
  73. package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +0 -1
  74. package/dist/FormSteps/DatePickerStep/DatePickerStep.js +2 -13
  75. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +1 -2
  76. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +7 -20
  77. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +0 -1
  78. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +2 -13
  79. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +0 -1
  80. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +16 -32
  81. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +1 -2
  82. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +94 -180
  83. package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +0 -1
  84. package/dist/FormSteps/FileUploadStep/FileUploadStep.js +2 -13
  85. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +0 -1
  86. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +33 -95
  87. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +2 -0
  88. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +3 -0
  89. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +0 -2
  90. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +86 -180
  91. package/dist/FormSteps/MapperStep/MapperStep.d.ts +0 -1
  92. package/dist/FormSteps/MapperStep/MapperStep.js +2 -13
  93. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +0 -1
  94. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +16 -38
  95. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +21 -31
  96. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +0 -1
  97. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +89 -175
  98. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +0 -1
  99. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +20 -47
  100. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +0 -1
  101. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +81 -117
  102. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +1 -2
  103. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +15 -33
  104. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +0 -1
  105. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +2 -13
  106. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +0 -1
  107. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +17 -31
  108. package/dist/FormSteps/RatingStep/RatingStep.d.ts +0 -1
  109. package/dist/FormSteps/RatingStep/RatingStep.js +2 -13
  110. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +0 -1
  111. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +35 -61
  112. package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +0 -1
  113. package/dist/FormSteps/SelectorStep/SelectorStep.js +2 -13
  114. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +0 -1
  115. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -3
  116. package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +0 -1
  117. package/dist/FormSteps/SeparatorStep/SeparatorStep.js +2 -13
  118. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +1 -2
  119. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +77 -142
  120. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +5 -5
  121. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +2 -13
  122. package/dist/FormSteps/Step.d.ts +0 -1
  123. package/dist/FormSteps/Step.js +29 -58
  124. package/dist/FormSteps/StepFunctions.d.ts +4 -6
  125. package/dist/FormSteps/StepFunctions.js +149 -204
  126. package/dist/FormSteps/StepFunctions.test.d.ts +1 -0
  127. package/dist/FormSteps/StepFunctions.test.js +695 -0
  128. package/dist/FormSteps/StepHooks.d.ts +68 -14
  129. package/dist/FormSteps/StepHooks.js +94 -146
  130. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +0 -1
  131. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +38 -74
  132. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -2
  133. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +12 -28
  134. package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +0 -1
  135. package/dist/FormSteps/TextAreaStep/TextAreaStep.js +3 -14
  136. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -2
  137. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +12 -30
  138. package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +1 -2
  139. package/dist/FormSteps/TextInputStep/TextInputStep.js +2 -13
  140. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +1 -2
  141. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +9 -26
  142. package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +0 -1
  143. package/dist/FormSteps/TimePickerStep/TimePickerStep.js +2 -13
  144. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +0 -1
  145. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +13 -26
  146. package/dist/FormSteps/TitleStep/TitleStep.d.ts +0 -1
  147. package/dist/FormSteps/TitleStep/TitleStep.js +2 -13
  148. package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +1 -1
  149. package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +14 -26
  150. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +0 -1
  151. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +6 -18
  152. package/dist/Icons/@IconTypes.d.ts +0 -1
  153. package/dist/Icons/ArrowLeftIcon.d.ts +3 -0
  154. package/dist/Icons/ArrowLeftIcon.js +6 -0
  155. package/dist/Icons/ArrowRightIcon.d.ts +3 -0
  156. package/dist/Icons/ArrowRightIcon.js +6 -0
  157. package/dist/Icons/CalendarIcon.d.ts +1 -2
  158. package/dist/Icons/CalendarIcon.js +3 -14
  159. package/dist/Icons/CheckCircleIcon.d.ts +3 -0
  160. package/dist/Icons/CheckCircleIcon.js +6 -0
  161. package/dist/Icons/CheckboxCheckedIcon.d.ts +3 -0
  162. package/dist/Icons/CheckboxCheckedIcon.js +6 -0
  163. package/dist/Icons/CheckboxUncheckedIcon.d.ts +3 -0
  164. package/dist/Icons/CheckboxUncheckedIcon.js +6 -0
  165. package/dist/Icons/ClockIcon.d.ts +3 -0
  166. package/dist/Icons/ClockIcon.js +6 -0
  167. package/dist/Icons/CloseIcon.d.ts +3 -0
  168. package/dist/Icons/CloseIcon.js +6 -0
  169. package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
  170. package/dist/Icons/Construction/LeakIcon.js +3 -14
  171. package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
  172. package/dist/Icons/Construction/ProjectIcon.js +3 -14
  173. package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
  174. package/dist/Icons/Construction/PropertyIcon.js +3 -14
  175. package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
  176. package/dist/Icons/Construction/SpaceIcon.js +3 -14
  177. package/dist/Icons/DeleteIcon.d.ts +3 -0
  178. package/dist/Icons/DeleteIcon.js +6 -0
  179. package/dist/Icons/DocumentIcon.d.ts +2 -2
  180. package/dist/Icons/DocumentIcon.js +3 -14
  181. package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
  182. package/dist/Icons/Entities/CheckListIcon.js +3 -14
  183. package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
  184. package/dist/Icons/Entities/GenericEntityIcon.js +4 -15
  185. package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
  186. package/dist/Icons/Entities/HandshakeIcon.js +4 -15
  187. package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
  188. package/dist/Icons/Entities/SupplierIcon.js +4 -15
  189. package/dist/Icons/ErkIcon.module.css +9 -0
  190. package/dist/Icons/ErrorIcon.d.ts +3 -0
  191. package/dist/Icons/ErrorIcon.js +6 -0
  192. package/dist/Icons/ExpandLessIcon.d.ts +3 -0
  193. package/dist/Icons/ExpandLessIcon.js +6 -0
  194. package/dist/Icons/ExpandMoreIcon.d.ts +3 -0
  195. package/dist/Icons/ExpandMoreIcon.js +6 -0
  196. package/dist/Icons/FileIcon.d.ts +3 -0
  197. package/dist/Icons/FileIcon.js +6 -0
  198. package/dist/Icons/InfoIcon.d.ts +3 -0
  199. package/dist/Icons/InfoIcon.js +6 -0
  200. package/dist/Icons/LocationIcon.d.ts +1 -2
  201. package/dist/Icons/LocationIcon.js +3 -14
  202. package/dist/Icons/PersonIcon.d.ts +1 -2
  203. package/dist/Icons/PersonIcon.js +4 -15
  204. package/dist/Icons/Ratings/DislikeIcon.d.ts +3 -0
  205. package/dist/Icons/Ratings/DislikeIcon.js +6 -0
  206. package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +3 -0
  207. package/dist/Icons/Ratings/DissatisfiedIcon.js +6 -0
  208. package/dist/Icons/Ratings/LikeIcon.d.ts +3 -0
  209. package/dist/Icons/Ratings/LikeIcon.js +6 -0
  210. package/dist/Icons/Ratings/SatisfiedIcon.d.ts +3 -0
  211. package/dist/Icons/Ratings/SatisfiedIcon.js +6 -0
  212. package/dist/Icons/Ratings/StarIcon.d.ts +3 -0
  213. package/dist/Icons/Ratings/StarIcon.js +6 -0
  214. package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +3 -0
  215. package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +6 -0
  216. package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +3 -0
  217. package/dist/Icons/Ratings/VerySatisfiedIcon.js +6 -0
  218. package/dist/Icons/WarningIcon.d.ts +3 -0
  219. package/dist/Icons/WarningIcon.js +6 -0
  220. package/dist/Init.d.ts +1 -0
  221. package/dist/Init.js +2 -0
  222. package/dist/Services/FileService.d.ts +1 -1
  223. package/dist/Services/FileService.js +29 -86
  224. package/dist/Services/FormService.js +11 -56
  225. package/dist/Services/OrganizationService.js +11 -62
  226. package/dist/Shared/CustomBtn/CustomBtn.d.ts +1 -2
  227. package/dist/Shared/CustomBtn/CustomBtn.js +25 -88
  228. package/dist/Shared/{RoundedButton/RoundedButton.d.ts → ErkButton/ErkButton.d.ts} +6 -5
  229. package/dist/Shared/ErkButton/ErkButton.js +31 -0
  230. package/dist/Shared/{RoundedButton/RoundedButton.stories.d.ts → ErkButton/ErkButton.stories.d.ts} +2 -2
  231. package/dist/Shared/{RoundedButton/RoundedButton.stories.js → ErkButton/ErkButton.stories.js} +6 -6
  232. package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +19 -0
  233. package/dist/Shared/ErkCheckbox/ErkCheckBox.js +30 -0
  234. package/dist/Shared/{RoundedCheckBox/RoundedCheckBox.stories.d.ts → ErkCheckbox/ErkCheckBox.stories.d.ts} +2 -7
  235. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +37 -0
  236. package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +16 -0
  237. package/dist/Shared/ErkDatePicker/ErkDatePicker.js +210 -0
  238. package/dist/Shared/{RoundedDatePicker/RoundedDatePicker.stories.d.ts → ErkDatePicker/ErkDatePicker.stories.d.ts} +3 -16
  239. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +103 -0
  240. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +16 -0
  241. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +83 -0
  242. package/dist/Shared/ErkSelect/ErkSelect.d.ts +39 -0
  243. package/dist/Shared/ErkSelect/ErkSelect.js +90 -0
  244. package/dist/Shared/{RoundedSelect/RoundedSelect.stories.d.ts → ErkSelect/ErkSelect.stories.d.ts} +2 -12
  245. package/dist/Shared/ErkSelect/ErkSelect.stories.js +64 -0
  246. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +28 -0
  247. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +56 -0
  248. package/dist/Shared/{RoundedSmartSelect/RoundedSmartSelect.stories.d.ts → ErkSmartSelect/ErkSmartSelect.stories.d.ts} +2 -12
  249. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +167 -0
  250. package/dist/Shared/ErkTextField/ErkTextField.d.ts +26 -0
  251. package/dist/Shared/ErkTextField/ErkTextField.js +111 -0
  252. package/dist/Shared/{RoundedTextField/RoundedTextField.stories.d.ts → ErkTextField/ErkTextField.stories.d.ts} +3 -16
  253. package/dist/Shared/ErkTextField/ErkTextField.stories.js +105 -0
  254. package/dist/Shared/{RoundedTimePicker/RoundedTimePicker.d.ts → ErkTimePicker/ErkTimePicker.d.ts} +6 -16
  255. package/dist/Shared/ErkTimePicker/ErkTimePicker.js +131 -0
  256. package/dist/Shared/InputIcon/InputIcon.d.ts +2 -2
  257. package/dist/Shared/InputIcon/InputIcon.js +25 -48
  258. package/dist/Shared/Loader/Loader.d.ts +0 -1
  259. package/dist/Shared/Loader/Loader.js +6 -18
  260. package/dist/Shared/Navbar/Navbar.d.ts +0 -1
  261. package/dist/Shared/Navbar/Navbar.js +2 -14
  262. package/dist/Shared/Navbar/Navbar.stories.js +2 -2
  263. package/dist/Shared/Rating/Rating.d.ts +3 -5
  264. package/dist/Shared/Rating/Rating.js +4 -27
  265. package/dist/Shared/Rating/Rating.stories.js +13 -19
  266. package/dist/Shared/Rating/Ratings/LikeRating.d.ts +1 -2
  267. package/dist/Shared/Rating/Ratings/LikeRating.js +19 -33
  268. package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +1 -2
  269. package/dist/Shared/Rating/Ratings/SatisfactionRating.js +27 -47
  270. package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +1 -2
  271. package/dist/Shared/Rating/Ratings/ScaleRating.js +23 -54
  272. package/dist/Shared/Toggle/Toggle.d.ts +4 -14
  273. package/dist/Shared/Toggle/Toggle.js +11 -34
  274. package/dist/States/GlobalSlice.d.ts +4 -4
  275. package/dist/States/GlobalSlice.js +6 -17
  276. package/dist/States/SiteSlice.d.ts +30 -48
  277. package/dist/States/SiteSlice.js +58 -76
  278. package/dist/States/WidthStatsSlice.d.ts +2 -2
  279. package/dist/States/WidthStatsSlice.js +8 -9
  280. package/dist/Utils/AxiosAPI.js +3 -3
  281. package/dist/Utils/AxiosWidget.js +4 -4
  282. package/dist/Utils/CBRFunctions.js +29 -30
  283. package/dist/Utils/DraftFunctions.d.ts +3 -3
  284. package/dist/Utils/DraftFunctions.js +102 -143
  285. package/dist/Utils/FormStepFunctions.d.ts +1 -1
  286. package/dist/Utils/FormStepFunctions.js +27 -45
  287. package/dist/Utils/LocaleUtils.d.ts +2 -0
  288. package/dist/Utils/LocaleUtils.js +12 -0
  289. package/dist/Utils/MaterialProviders.d.ts +20 -1
  290. package/dist/Utils/MaterialProviders.js +43 -28
  291. package/dist/Utils/MuiClassnameSetup.js +3 -0
  292. package/dist/Utils/PhoneFunctions.js +5 -5
  293. package/dist/Utils/TestUtils.d.ts +55 -62
  294. package/dist/Utils/TestUtils.js +22 -51
  295. package/dist/Utils/store.d.ts +4 -2
  296. package/dist/Utils/store.js +10 -65
  297. package/dist/Widget.js +15 -26
  298. package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
  299. package/dist/constants/Files/FileExtensions.js +3 -3
  300. package/dist/constants/Files/FileMaxSize.js +1 -1
  301. package/dist/constants/InternalFormStyle.js +1 -1
  302. package/dist/hooks.js +14 -16
  303. package/dist/index.css +4 -0
  304. package/dist/main.d.ts +2 -0
  305. package/dist/main.js +22 -0
  306. package/package.json +108 -124
  307. package/dist/Shared/RoundedButton/RoundedButton.js +0 -45
  308. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +0 -24
  309. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +0 -101
  310. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +0 -50
  311. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +0 -49
  312. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +0 -351
  313. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +0 -223
  314. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +0 -43
  315. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +0 -226
  316. package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +0 -68
  317. package/dist/Shared/RoundedSelect/RoundedSelect.js +0 -214
  318. package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +0 -91
  319. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -63
  320. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +0 -236
  321. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +0 -318
  322. package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +0 -45
  323. package/dist/Shared/RoundedTextField/RoundedTextField.js +0 -175
  324. package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +0 -224
  325. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +0 -314
  326. package/dist/__mocks__/axios.d.ts +0 -2
  327. package/dist/__mocks__/axios.js +0 -2
  328. package/dist/constants/MaterialClassNameSeed.js +0 -1
  329. package/dist/index.js +0 -31
  330. /package/dist/{index.d.ts → App/AppFunctions.test.d.ts} +0 -0
  331. /package/dist/Shared/{RoundedTimePicker/RoundedTimePicker.module.css → ErkTimePicker/ErkTimePicker.module.css} +0 -0
  332. /package/dist/{constants/MaterialClassNameSeed.d.ts → Utils/MuiClassnameSetup.d.ts} +0 -0
  333. /package/dist/{setupTests.d.ts → __tests__/setup.d.ts} +0 -0
  334. /package/dist/{setupTests.js → __tests__/setup.js} +0 -0
@@ -7,27 +7,65 @@ import { FormStep } from '../@Types/FormStep';
7
7
  import { FieldError, RefCallBack, UseControllerProps, useController } from 'react-hook-form';
8
8
  import { Condition } from '../@Types/Condition';
9
9
  import { CBRFormStep } from '../@Types/CBRFormStep';
10
- export declare const selectOriginalValue: ((state: RootState, step: GBaseStep) => any) & import("reselect").OutputSelectorFields<(args_0: ValuesStore, args_1: GBaseStep) => any, {
11
- clearCache: () => void;
12
- }> & {
10
+ export declare const selectOriginalValue: ((state: RootState, step: GBaseStep) => any) & {
13
11
  clearCache: () => void;
12
+ resultsCount: () => number;
13
+ resetResultsCount: () => void;
14
+ } & {
15
+ resultFunc: (resultFuncArgs_0: ValuesStore, resultFuncArgs_1: GBaseStep) => any;
16
+ memoizedResultFunc: ((resultFuncArgs_0: ValuesStore, resultFuncArgs_1: GBaseStep) => any) & {
17
+ clearCache: () => void;
18
+ resultsCount: () => number;
19
+ resetResultsCount: () => void;
20
+ };
21
+ lastResult: () => any;
22
+ dependencies: [(state: RootState) => ValuesStore, (_state: RootState, step: GBaseStep) => GBaseStep];
23
+ recomputations: () => number;
24
+ resetRecomputations: () => void;
25
+ dependencyRecomputations: () => number;
26
+ resetDependencyRecomputations: () => void;
27
+ } & {
28
+ memoize: typeof import("reselect").weakMapMemoize;
29
+ argsMemoize: typeof import("reselect").weakMapMemoize;
14
30
  };
15
31
  export interface StepDependency {
16
32
  originalValue: any;
17
33
  isDependency: boolean;
18
- handleStepDep: (value: any | undefined) => void;
34
+ handleStepDep: (value: any) => void;
19
35
  }
20
36
  export declare const useStepDependency: (step: GBaseStep, defaultValue?: any) => StepDependency;
21
- export declare const selectStepDependencies: ((state: RootState, step: GBaseStep, form: Form) => {
22
- invalids: string[];
23
- emptyDep: boolean;
24
- }) & import("reselect").OutputSelectorFields<(args_0: DependencyStore, args_1: GBaseStep, args_2: Form) => {
37
+ export declare const selectStepDependencies: ((state: RootState, _step: GBaseStep, form: Form) => {
25
38
  invalids: string[];
26
39
  emptyDep: boolean;
27
- }, {
28
- clearCache: () => void;
29
- }> & {
40
+ }) & {
30
41
  clearCache: () => void;
42
+ resultsCount: () => number;
43
+ resetResultsCount: () => void;
44
+ } & {
45
+ resultFunc: (resultFuncArgs_0: DependencyStore, resultFuncArgs_1: GBaseStep, resultFuncArgs_2: Form) => {
46
+ invalids: string[];
47
+ emptyDep: boolean;
48
+ };
49
+ memoizedResultFunc: ((resultFuncArgs_0: DependencyStore, resultFuncArgs_1: GBaseStep, resultFuncArgs_2: Form) => {
50
+ invalids: string[];
51
+ emptyDep: boolean;
52
+ }) & {
53
+ clearCache: () => void;
54
+ resultsCount: () => number;
55
+ resetResultsCount: () => void;
56
+ };
57
+ lastResult: () => {
58
+ invalids: string[];
59
+ emptyDep: boolean;
60
+ };
61
+ dependencies: [(state: RootState) => DependencyStore, (_state: RootState, step: GBaseStep) => GBaseStep, (_state: RootState, _step: GBaseStep, form: Form) => Form];
62
+ recomputations: () => number;
63
+ resetRecomputations: () => void;
64
+ dependencyRecomputations: () => number;
65
+ resetDependencyRecomputations: () => void;
66
+ } & {
67
+ memoize: typeof import("reselect").weakMapMemoize;
68
+ argsMemoize: typeof import("reselect").weakMapMemoize;
31
69
  };
32
70
  export interface UseFormStepOptions<ValueType> {
33
71
  defaultValue: ValueType;
@@ -45,10 +83,26 @@ export interface FormStepFunctions<ValueType = unknown> {
45
83
  field: Omit<ReturnType<typeof useController>['field'], 'ref' | 'value' | 'onChange'>;
46
84
  }
47
85
  export declare const useFormStep: <ValueType = unknown>(step: GBaseStep, { rules, debounce, sizeChange, defaultValue }: UseFormStepOptions<ValueType>) => FormStepFunctions<ValueType>;
48
- export declare const selectDependencies: ((state: RootState, idDeps: string[] | undefined) => DependencyStore) & import("reselect").OutputSelectorFields<(args_0: DependencyStore, args_1: string[]) => DependencyStore, {
49
- clearCache: () => void;
50
- }> & {
86
+ export declare const selectDependencies: ((state: RootState, idDeps: string[] | undefined) => DependencyStore) & {
51
87
  clearCache: () => void;
88
+ resultsCount: () => number;
89
+ resetResultsCount: () => void;
90
+ } & {
91
+ resultFunc: (resultFuncArgs_0: DependencyStore, resultFuncArgs_1: string[]) => DependencyStore;
92
+ memoizedResultFunc: ((resultFuncArgs_0: DependencyStore, resultFuncArgs_1: string[]) => DependencyStore) & {
93
+ clearCache: () => void;
94
+ resultsCount: () => number;
95
+ resetResultsCount: () => void;
96
+ };
97
+ lastResult: () => DependencyStore;
98
+ dependencies: [(state: RootState) => DependencyStore, (_state: RootState, idDeps: string[] | undefined) => string[]];
99
+ recomputations: () => number;
100
+ resetRecomputations: () => void;
101
+ dependencyRecomputations: () => number;
102
+ resetDependencyRecomputations: () => void;
103
+ } & {
104
+ memoize: typeof import("reselect").weakMapMemoize;
105
+ argsMemoize: typeof import("reselect").weakMapMemoize;
52
106
  };
53
107
  export declare const useCondition: (condition?: Condition) => boolean;
54
108
  export declare const calcStepDeps: (step: FormStep | CBRFormStep) => string[];
@@ -1,139 +1,99 @@
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
- var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
24
- if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
25
- if (ar || !(i in from)) {
26
- if (!ar) ar = Array.prototype.slice.call(from, 0, i);
27
- ar[i] = from[i];
28
- }
29
- }
30
- return to.concat(ar || Array.prototype.slice.call(from));
31
- };
32
1
  import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
33
2
  import { useAppSelector, useAppDispatch } from '../hooks';
34
- import { clearDependency, setStepDependency, } from '../States/SiteSlice';
3
+ import { clearDependency, setStepDependency } from '../States/SiteSlice';
35
4
  import { createSelector } from '@reduxjs/toolkit';
36
5
  import { calcDefaultValue, evaluateCondition } from './StepFunctions';
37
- import { useController, } from 'react-hook-form';
6
+ import { useController } from 'react-hook-form';
38
7
  import { SizeChangeContext } from './Utils/@StepFiller/StepFiller';
39
8
  import ConditionTypes from '../constants/ConditionTypes';
40
9
  import FormStepTypes, { ApiSelectorOptionTypes, ClassifierOptionTypes, EntityValueOptionTypes, } from '../constants/FormStepTypes';
41
- var selectIsDependency = createSelector([
42
- function (state) { return state.site.dependencies; },
43
- function (state, step) { return step; },
44
- ], function (dependencies, step) {
10
+ const selectIsDependency = createSelector([
11
+ (state) => state.site.dependencies,
12
+ (_state, step) => step,
13
+ ], (dependencies, step) => {
45
14
  return dependencies[step.id] !== undefined;
46
15
  });
47
- export var selectOriginalValue = createSelector([
48
- function (state) { return state.site.values; },
49
- function (state, step) { return step; },
50
- ], function (values, step) { var _a; return (_a = values.sections[step.idSection]) === null || _a === void 0 ? void 0 : _a[step.id]; });
51
- export var useStepDependency = function (step, defaultValue) {
52
- var _a;
53
- var isDependency = useAppSelector(function (state) {
54
- return selectIsDependency(state, step);
55
- });
56
- var originalValue = useAppSelector(function (state) {
57
- return selectOriginalValue(state, step);
58
- });
59
- var dispatch = useAppDispatch();
60
- useEffect(function () {
16
+ export const selectOriginalValue = createSelector([(state) => state.site.values, (_state, step) => step], (values, step) => values.sections[step?.idSection]?.[step?.id]);
17
+ export const useStepDependency = (step, defaultValue) => {
18
+ const isDependency = useAppSelector((state) => selectIsDependency(state, step));
19
+ const originalValue = useAppSelector((state) => selectOriginalValue(state, step));
20
+ const dispatch = useAppDispatch();
21
+ useEffect(() => {
61
22
  if (isDependency && !originalValue && defaultValue) {
62
23
  dispatch(setStepDependency({
63
- step: step,
24
+ step,
64
25
  value: defaultValue,
65
26
  }));
66
27
  }
67
- return function () {
28
+ return () => {
68
29
  dispatch(clearDependency(step));
69
30
  };
31
+ // eslint-disable-next-line react-hooks/exhaustive-deps
70
32
  }, [isDependency]);
71
- var handleStepDep = useCallback(function (value) {
33
+ const handleStepDep = useCallback((value) => {
72
34
  if (!isDependency)
73
35
  return;
74
36
  dispatch(setStepDependency({
75
- step: step,
76
- value: value !== null && value !== void 0 ? value : null,
37
+ step,
38
+ value: value ?? null,
77
39
  }));
78
- }, [step.id, step.type, isDependency]);
40
+ },
41
+ // eslint-disable-next-line react-hooks/exhaustive-deps
42
+ [step.id, step.type, isDependency]);
79
43
  return {
80
- handleStepDep: handleStepDep,
81
- isDependency: isDependency,
82
- originalValue: (_a = originalValue !== null && originalValue !== void 0 ? originalValue : defaultValue) !== null && _a !== void 0 ? _a : calcDefaultValue(step),
44
+ handleStepDep,
45
+ isDependency,
46
+ originalValue: originalValue ?? defaultValue ?? calcDefaultValue(step),
83
47
  };
84
48
  };
85
- export var selectStepDependencies = createSelector([
86
- function (state) { return state.site.dependencies; },
87
- function (state, step) { return step; },
88
- function (state, step, form) { return form; },
89
- ], function (dependencies, step, form) {
90
- var invalids = [];
91
- var emptyDep = false;
49
+ export const selectStepDependencies = createSelector([
50
+ (state) => state.site.dependencies,
51
+ (_state, step) => step,
52
+ (_state, _step, form) => form,
53
+ ], (dependencies, step, form) => {
54
+ const invalids = [];
55
+ let emptyDep = false;
92
56
  /** Show deep error changes even if not in dependencies */
93
- for (var _i = 0, _a = calcDeepDependencies(step.id, form); _i < _a.length; _i++) {
94
- var idDep = _a[_i];
95
- var dependency = dependencies[idDep];
96
- if ((dependency === null || dependency === void 0 ? void 0 : dependency.value) === null && form.steps[idDep]) {
57
+ for (const idDep of calcDeepDependencies(step.id, form)) {
58
+ const dependency = dependencies[idDep];
59
+ if (dependency?.value === null && form.steps[idDep]) {
97
60
  invalids.push(idDep);
98
61
  }
99
- if (dependency === null || dependency === void 0 ? void 0 : dependency.empty)
62
+ if (dependency?.empty)
100
63
  emptyDep = true;
101
64
  }
102
- return { invalids: invalids, emptyDep: emptyDep };
65
+ return { invalids, emptyDep };
103
66
  });
104
- var calcDeepDependencies = function (idStep, form, deps) {
105
- if (deps === void 0) { deps = []; }
106
- var step = form.steps[idStep];
107
- if (step === null || step === void 0 ? void 0 : step.dependencies) {
108
- for (var _i = 0, _a = step.dependencies; _i < _a.length; _i++) {
109
- var dep = _a[_i];
67
+ const calcDeepDependencies = (idStep, form, deps = []) => {
68
+ const step = form.steps[idStep];
69
+ if (step?.dependencies) {
70
+ for (const dep of step.dependencies) {
110
71
  if (!deps.includes(dep)) {
111
- deps.push.apply(deps, __spreadArray(__spreadArray([], calcDeepDependencies(dep, form, deps), false), [dep], false));
72
+ deps.push(...calcDeepDependencies(dep, form, deps), dep);
112
73
  }
113
74
  }
114
75
  }
115
76
  return deps;
116
77
  };
117
- export var useFormStep = function (step, _a) {
118
- var rules = _a.rules, debounce = _a.debounce, sizeChange = _a.sizeChange, defaultValue = _a.defaultValue;
119
- var _b = useState(), timer = _b[0], setTimer = _b[1];
120
- var _c = useStepDependency(step, defaultValue), isDependency = _c.isDependency, handleStepDep = _c.handleStepDep, originalValue = _c.originalValue;
121
- var _d = useController({
78
+ export const useFormStep = (step, { rules, debounce, sizeChange, defaultValue }) => {
79
+ const [timer, setTimer] = useState();
80
+ const { isDependency, handleStepDep, originalValue } = useStepDependency(step, defaultValue);
81
+ const { field: { ref, value, onChange: fieldOnChange, ...field }, fieldState: { error }, } = useController({
122
82
  name: step.id,
123
- rules: rules,
83
+ rules,
124
84
  shouldUnregister: true,
125
85
  defaultValue: originalValue,
126
- }), _e = _d.field, ref = _e.ref, value = _e.value, fieldOnChange = _e.onChange, field = __rest(_e, ["ref", "value", "onChange"]), error = _d.fieldState.error;
127
- var handleSizeChange = useContext(SizeChangeContext);
128
- var onChange = useCallback(function (value) {
86
+ });
87
+ const handleSizeChange = useContext(SizeChangeContext);
88
+ const onChange = useCallback((value) => {
129
89
  if (isDependency) {
130
90
  if (debounce) {
131
91
  try {
132
92
  clearTimeout(timer);
133
- // eslint-disable-next-line no-empty
93
+ // eslint-disable-next-line no-empty, @typescript-eslint/no-unused-vars
134
94
  }
135
95
  catch (e) { }
136
- setTimer(setTimeout(function () {
96
+ setTimer(setTimeout(() => {
137
97
  handleStepDep(value);
138
98
  setTimer(undefined);
139
99
  }, 1000));
@@ -144,88 +104,78 @@ export var useFormStep = function (step, _a) {
144
104
  }
145
105
  fieldOnChange(value);
146
106
  if (sizeChange)
147
- handleSizeChange === null || handleSizeChange === void 0 ? void 0 : handleSizeChange();
148
- }, [handleStepDep, isDependency, fieldOnChange]);
107
+ handleSizeChange?.();
108
+ },
109
+ // eslint-disable-next-line react-hooks/exhaustive-deps
110
+ [handleStepDep, isDependency, fieldOnChange]);
149
111
  return {
150
- ref: ref,
151
- value: value,
152
- onChange: onChange,
153
- error: error,
154
- field: field,
112
+ ref,
113
+ value,
114
+ onChange,
115
+ error,
116
+ field,
155
117
  };
156
118
  };
157
- var EMPTY_ARRAY = [];
158
- export var selectDependencies = createSelector([
159
- function (state) { return state.site.dependencies; },
160
- function (state, idDeps) {
161
- return idDeps !== null && idDeps !== void 0 ? idDeps : EMPTY_ARRAY;
162
- },
163
- ], function (dependencies, idDeps) {
164
- return idDeps.reduce(function (acc, idDep) {
165
- var _a;
166
- return (__assign(__assign({}, acc), (_a = {}, _a[idDep] = dependencies[idDep], _a)));
167
- }, {});
168
- });
169
- export var useCondition = function (condition) {
170
- var ids = useMemo(function () { return recursivelyCalcConditionSteps(condition); }, []);
171
- var dependencies = useAppSelector(function (state) {
172
- return selectDependencies(state, ids);
173
- });
174
- return useMemo(function () {
119
+ const EMPTY_ARRAY = [];
120
+ export const selectDependencies = createSelector([
121
+ (state) => state.site.dependencies,
122
+ (_state, idDeps) => idDeps ?? EMPTY_ARRAY,
123
+ ], (dependencies, idDeps) => idDeps.reduce((acc, idDep) => ({
124
+ ...acc,
125
+ [idDep]: dependencies[idDep],
126
+ }), {}));
127
+ export const useCondition = (condition) => {
128
+ // eslint-disable-next-line react-hooks/exhaustive-deps
129
+ const ids = useMemo(() => recursivelyCalcConditionSteps(condition), []);
130
+ const dependencies = useAppSelector((state) => selectDependencies(state, ids));
131
+ return useMemo(() => {
175
132
  return !condition || evaluateCondition(condition, dependencies);
176
- }, ids.map(function (id) { return dependencies[id].value; }));
133
+ },
134
+ // eslint-disable-next-line react-hooks/exhaustive-deps
135
+ ids.map((id) => dependencies[id].value));
177
136
  };
178
- export var calcStepDeps = function (step) {
179
- var _a;
180
- var dependencies = __spreadArray([], ((_a = step.dependencies) !== null && _a !== void 0 ? _a : []), true);
137
+ export const calcStepDeps = (step) => {
138
+ const dependencies = [...(step.dependencies ?? [])];
181
139
  if (step.condition) {
182
- dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(step.condition));
140
+ dependencies.push(...recursivelyCalcConditionSteps(step.condition));
183
141
  }
184
142
  switch (step.type) {
185
143
  case FormStepTypes.CLASSIFIER_SELECTOR:
186
144
  {
187
- for (var _i = 0, _b = Object.values(step.options); _i < _b.length; _i++) {
188
- var option = _b[_i];
189
- if (option.type !== ClassifierOptionTypes.HIDE &&
190
- option.condition) {
191
- dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
145
+ for (const option of Object.values(step.options)) {
146
+ if (option.type !== ClassifierOptionTypes.HIDE && option.condition) {
147
+ dependencies.push(...recursivelyCalcConditionSteps(option.condition));
192
148
  }
193
149
  }
194
150
  }
195
151
  break;
196
152
  case FormStepTypes.ENTITYVALUEPICKER:
197
153
  {
198
- for (var _c = 0, _d = Object.values(step.options); _c < _d.length; _c++) {
199
- var option = _d[_c];
200
- if (option.type !== EntityValueOptionTypes.HIDE &&
201
- option.condition) {
202
- dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
154
+ for (const option of Object.values(step.options)) {
155
+ if (option.type !== EntityValueOptionTypes.HIDE && option.condition) {
156
+ dependencies.push(...recursivelyCalcConditionSteps(option.condition));
203
157
  }
204
158
  }
205
159
  if (step.dialogs)
206
- for (var _e = 0, _f = Object.values(step.dialogs); _e < _f.length; _e++) {
207
- var dialog = _f[_e];
208
- dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(dialog.condition));
160
+ for (const dialog of Object.values(step.dialogs)) {
161
+ dependencies.push(...recursivelyCalcConditionSteps(dialog.condition));
209
162
  }
210
163
  }
211
164
  break;
212
165
  case FormStepTypes.API_SELECTOR:
213
166
  {
214
- for (var _g = 0, _h = Object.values(step.options); _g < _h.length; _g++) {
215
- var option = _h[_g];
216
- if (option.type !== ApiSelectorOptionTypes.HIDE &&
217
- option.condition) {
218
- dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
167
+ for (const option of Object.values(step.options)) {
168
+ if (option.type !== ApiSelectorOptionTypes.HIDE && option.condition) {
169
+ dependencies.push(...recursivelyCalcConditionSteps(option.condition));
219
170
  }
220
171
  }
221
172
  }
222
173
  break;
223
174
  case FormStepTypes.SELECTOR:
224
175
  {
225
- for (var _j = 0, _k = Object.values(step.options); _j < _k.length; _j++) {
226
- var option = _k[_j];
176
+ for (const option of Object.values(step.options)) {
227
177
  if (option.condition) {
228
- dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
178
+ dependencies.push(...recursivelyCalcConditionSteps(option.condition));
229
179
  }
230
180
  }
231
181
  }
@@ -235,14 +185,12 @@ export var calcStepDeps = function (step) {
235
185
  }
236
186
  return dependencies;
237
187
  };
238
- export var recursivelyCalcConditionSteps = function (condition) {
188
+ export const recursivelyCalcConditionSteps = (condition) => {
239
189
  if (!condition)
240
190
  return [];
241
191
  switch (condition.type) {
242
192
  case ConditionTypes.EXPRESSION: {
243
- return condition.conditions
244
- .map(function (condition) { return recursivelyCalcConditionSteps(condition); })
245
- .flat();
193
+ return condition.conditions.map((condition) => recursivelyCalcConditionSteps(condition)).flat();
246
194
  }
247
195
  case ConditionTypes.FORM_STEP: {
248
196
  return [condition.idStep];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
3
2
  import './DraftEditor.css';
4
3
  import { TextAreaStepProps } from '../TextAreaStep';
@@ -1,25 +1,3 @@
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
1
  import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
24
2
  import styles from './MaterialTextAreaStep.module.css';
25
3
  import { useController } from 'react-hook-form';
@@ -27,124 +5,110 @@ import { Editor } from 'react-draft-wysiwyg'; //Load programatically only if ste
27
5
  import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
28
6
  import './DraftEditor.css';
29
7
  import { useCallback, useState } from 'react';
30
- import { ClickAwayListener } from '@material-ui/core';
31
8
  import { useAppSelector } from '../../../hooks';
32
9
  import { useStepDependency } from '../../StepHooks';
33
10
  import { EditorState, convertFromRaw } from 'draft-js';
34
11
  import { getRawText } from '../../../Utils/DraftFunctions';
35
- function TextAreaStep(_a) {
36
- var _b;
37
- var step = _a.step, editable = _a.editable;
38
- var _c = useAppSelector(function (state) { return state.global; }), formStyle = _c.formStyle, postview = _c.postview;
39
- var _d = useState(false), hovering = _d[0], setHovering = _d[1];
40
- var _e = useState(false), focus = _e[0], setFocus = _e[1];
41
- var _f = useState(), timer = _f[0], setTimer = _f[1];
42
- var _g = useStepDependency(step, getRawText()), handleStepDep = _g.handleStepDep, originalValue = _g.originalValue, isDependency = _g.isDependency;
43
- var _h = useController({
12
+ import { ClickAwayListener } from '@mui/material';
13
+ function TextAreaStep({ step, editable }) {
14
+ const { formStyle, postview } = useAppSelector((state) => state.global);
15
+ const [hovering, setHovering] = useState(false);
16
+ const [focus, setFocus] = useState(false);
17
+ const [timer, setTimer] = useState();
18
+ const { handleStepDep, originalValue, isDependency } = useStepDependency(step, getRawText());
19
+ const { field: { ref, onChange, ...field }, fieldState: { error }, } = useController({
44
20
  name: step.id,
45
21
  shouldUnregister: true,
46
22
  rules: step.required
47
23
  ? {
48
- validate: function (editorState) {
49
- return editorState.getCurrentContent().hasText();
50
- },
24
+ validate: (editorState) => editorState.getCurrentContent().hasText(),
51
25
  }
52
26
  : {},
53
27
  defaultValue: EditorState.createWithContent(convertFromRaw(originalValue)),
54
- }), _j = _h.field, ref = _j.ref, onChange = _j.onChange, field = __rest(_j, ["ref", "onChange"]), error = _h.fieldState.error;
55
- var handleChange = useCallback(function (value) {
28
+ });
29
+ const handleChange = useCallback((value) => {
56
30
  if (isDependency) {
57
- try {
58
- clearTimeout(timer);
59
- // eslint-disable-next-line no-empty
60
- }
61
- catch (e) { }
62
- setTimer(setTimeout(function () {
31
+ clearTimeout(timer);
32
+ setTimer(setTimeout(() => {
63
33
  handleStepDep(value.getCurrentContent().getPlainText());
64
34
  setTimer(undefined);
65
35
  }, 1000));
66
36
  }
67
37
  onChange(value);
68
- }, [handleStepDep, isDependency, onChange]);
69
- var calcStyle = function () {
70
- var backgroundColor = formStyle.stepBackgroundColor;
38
+ },
39
+ // eslint-disable-next-line react-hooks/exhaustive-deps
40
+ [handleStepDep, isDependency, onChange]);
41
+ const calcStyle = () => {
42
+ const backgroundColor = formStyle.stepBackgroundColor;
71
43
  if (focus) {
72
44
  return {
73
45
  border: '2px solid ' + formStyle.primaryColor,
74
46
  marginTop: -1,
75
47
  marginLeft: -1,
76
48
  marginBottom: 0,
77
- backgroundColor: backgroundColor,
49
+ backgroundColor,
78
50
  };
79
51
  }
80
52
  else if (hovering) {
81
53
  return {
82
54
  border: '1px solid ' + formStyle.primaryColor,
83
- backgroundColor: backgroundColor,
55
+ backgroundColor,
84
56
  };
85
57
  }
86
58
  else {
87
59
  return {
88
60
  border: '1px solid ' + formStyle.outlineColor,
89
- backgroundColor: backgroundColor,
61
+ backgroundColor,
90
62
  };
91
63
  }
92
64
  };
93
- var canEdit = editable && !postview;
94
- var value = field.value;
95
- var editorClassName = styles.editor;
65
+ const canEdit = editable && !postview;
66
+ const value = field.value;
67
+ let editorClassName = styles.editor;
96
68
  if (!value.getCurrentContent().hasText()) {
97
- if (value.getCurrentContent().getBlockMap().first().getType() !==
98
- 'unstyled') {
69
+ if (value.getCurrentContent().getBlockMap().first().getType() !== 'unstyled') {
99
70
  editorClassName += ' RichEditor-hidePlaceholder';
100
71
  }
101
72
  }
102
73
  if (!canEdit) {
103
74
  editorClassName += ' postview-editor';
104
75
  }
105
- return (_jsxs("div", __assign({ className: styles.textEditorContainer, style: {
76
+ return (_jsxs("div", { className: styles.textEditorContainer, style: {
106
77
  '--eureka-outline': formStyle.outlineColor,
107
78
  '--eureka-primary': formStyle.primaryColor,
108
- } }, { children: [step.label && (_jsxs("div", __assign({ className: styles.textEditorLabel, style: {
109
- color: error
110
- ? formStyle.errorColor
111
- : formStyle.textColor,
112
- } }, { children: [step.label, " ", step.required ? ' *' : ''] }))), _jsx(ClickAwayListener, __assign({ mouseEvent: "onMouseDown", onClickAway: function () {
79
+ }, children: [step.label && (_jsxs("div", { className: styles.textEditorLabel, style: {
80
+ color: error ? formStyle.errorColor : formStyle.textColor,
81
+ }, children: [step.label, " ", step.required ? ' *' : ''] })), _jsx(ClickAwayListener, { mouseEvent: "onMouseDown", onClickAway: () => {
113
82
  if (canEdit) {
114
83
  setFocus(false);
115
84
  }
116
- } }, { children: _jsx("div", __assign({ className: postview
85
+ }, children: _jsx("div", { className: postview
117
86
  ? styles.postViewContainer + ' EF-DraftContainer'
118
- : styles.textContainer + ' EF-DraftContainer', style: calcStyle(), onMouseEnter: function () {
87
+ : styles.textContainer + ' EF-DraftContainer', style: calcStyle(), onMouseEnter: () => {
119
88
  if (canEdit) {
120
89
  setHovering(true);
121
90
  }
122
- }, onMouseLeave: function () {
91
+ }, onMouseLeave: () => {
123
92
  if (canEdit) {
124
93
  setHovering(false);
125
94
  }
126
- }, onClick: function () {
95
+ }, onClick: () => {
127
96
  if (canEdit) {
128
97
  setFocus(true);
129
98
  }
130
- }, "data-testid": step.id }, { children: _jsx(Editor, __assign({}, field, { editorRef: ref, onFocus: function () {
99
+ }, "data-testid": step.id, children: _jsx(Editor, { ...field, editorRef: ref, onFocus: () => {
131
100
  setFocus(true);
132
- }, readOnly: !canEdit, stripPastedStyles: true, onEditorStateChange: handleChange, toolbarClassName: !canEdit ? ' postview-editor-toolbar' : '', editorState: value, editorClassName: editorClassName, wrapperClassName: styles.wrapper, placeholder: (_b = step.description) !== null && _b !== void 0 ? _b : '', toolbar: {
101
+ }, readOnly: !canEdit, stripPastedStyles: true, onEditorStateChange: handleChange, toolbarClassName: !canEdit ? ' postview-editor-toolbar' : '', editorState: value, editorClassName: editorClassName, wrapperClassName: styles.wrapper, placeholder: step.description ?? '', toolbar: {
133
102
  options: ['inline', 'list', 'history'],
134
103
  inline: {
135
- options: [
136
- 'bold',
137
- 'italic',
138
- 'underline',
139
- 'strikethrough',
140
- ],
104
+ options: ['bold', 'italic', 'underline', 'strikethrough'],
141
105
  },
142
106
  list: {
143
107
  options: ['unordered'],
144
108
  },
145
- } })) })) })), _jsx("div", __assign({ className: styles.errorMsg, style: {
109
+ } }) }) }), _jsx("div", { className: styles.errorMsg, style: {
146
110
  color: formStyle.errorColor,
147
111
  height: !postview && editable ? '0.75rem' : 0,
148
- } }, { children: !!error && 'Este campo es obligatorio' }))] })));
112
+ }, children: !!error && 'Este campo es obligatorio' })] }));
149
113
  }
150
114
  export default TextAreaStep;