@arquimedes.co/eureka-forms 3.0.31 → 3.0.32

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 (410) hide show
  1. package/dist/@Types/Condition.d.ts +6 -4
  2. package/dist/@Types/ErkValue.d.ts +16 -0
  3. package/dist/@Types/Form.d.ts +1 -0
  4. package/dist/@Types/FormStep.d.ts +12 -8
  5. package/dist/@Types/GenericFormSteps.d.ts +0 -6
  6. package/dist/@Types/User.d.ts +13 -0
  7. package/dist/App/App.d.ts +3 -1
  8. package/dist/App/App.js +46 -21
  9. package/dist/App/AppFunctions.d.ts +1 -1
  10. package/dist/App/AppFunctions.js +336 -177
  11. package/dist/App/AppHooks.d.ts +2 -2
  12. package/dist/App/AppHooks.js +252 -146
  13. package/dist/Contexts/CustomContext.d.ts +1 -0
  14. package/dist/Contexts/CustomContext.js +1 -1
  15. package/dist/Contexts/FormContext.d.ts +1 -1
  16. package/dist/Contexts/FormContext.js +2 -3
  17. package/dist/Contexts/SectionContext.d.ts +1 -0
  18. package/dist/Contexts/SectionContext.js +1 -1
  19. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +2 -1
  20. package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +62 -36
  21. package/dist/Form/Form.d.ts +2 -1
  22. package/dist/Form/Form.js +164 -71
  23. package/dist/Form/Form.module.css +9 -0
  24. package/dist/Form/FormFunctions.js +112 -63
  25. package/dist/Form/FormHooks.d.ts +1 -0
  26. package/dist/Form/FormHooks.js +21 -13
  27. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +1 -0
  28. package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +105 -32
  29. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +2 -1
  30. package/dist/Form/FormTypes/StepperForm/StepperForm.js +110 -46
  31. package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +1 -0
  32. package/dist/Form/Section/MaterialSection/MaterialSection.js +23 -10
  33. package/dist/Form/Section/MaterialSection/MaterialSection.module.css +2 -0
  34. package/dist/Form/Section/Section.d.ts +1 -0
  35. package/dist/Form/Section/Section.js +15 -4
  36. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +1 -0
  37. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +65 -30
  38. package/dist/Form/Terms/Term/Term.d.ts +1 -0
  39. package/dist/Form/Terms/Term/Term.js +13 -2
  40. package/dist/Form/Terms/Terms.d.ts +1 -0
  41. package/dist/Form/Terms/Terms.js +27 -11
  42. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +1 -0
  43. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +107 -34
  44. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +1 -0
  45. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +13 -2
  46. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +1 -0
  47. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +40 -12
  48. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +1 -0
  49. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +77 -56
  50. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +1 -0
  51. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +115 -45
  52. package/dist/FormSteps/AYFStepMapper.d.ts +1 -0
  53. package/dist/FormSteps/AYFStepMapper.js +137 -60
  54. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +1 -0
  55. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +13 -2
  56. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +1 -0
  57. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +173 -64
  58. package/dist/FormSteps/CBRStepMapper.d.ts +1 -0
  59. package/dist/FormSteps/CBRStepMapper.js +168 -56
  60. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +1 -0
  61. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +13 -2
  62. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +1 -0
  63. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +37 -19
  64. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +1 -0
  65. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +13 -2
  66. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +2 -1
  67. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +81 -44
  68. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +1 -0
  69. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +26 -3
  70. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +1 -0
  71. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +61 -31
  72. package/dist/FormSteps/CustomStep.d.ts +1 -0
  73. package/dist/FormSteps/CustomStep.js +31 -17
  74. package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +2 -1
  75. package/dist/FormSteps/DatePickerStep/DatePickerStep.js +13 -2
  76. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +2 -1
  77. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +20 -9
  78. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +1 -0
  79. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +13 -2
  80. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +1 -0
  81. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +32 -16
  82. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +2 -1
  83. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +300 -106
  84. package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +1 -0
  85. package/dist/FormSteps/FileUploadStep/FileUploadStep.js +13 -2
  86. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +1 -0
  87. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +95 -33
  88. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +2 -0
  89. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +180 -85
  90. package/dist/FormSteps/MapperStep/MapperStep.d.ts +1 -0
  91. package/dist/FormSteps/MapperStep/MapperStep.js +13 -2
  92. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +1 -0
  93. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +38 -16
  94. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +31 -20
  95. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +1 -0
  96. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +175 -85
  97. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +1 -0
  98. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +47 -20
  99. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +1 -0
  100. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +115 -70
  101. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +2 -1
  102. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +33 -15
  103. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +1 -0
  104. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +13 -2
  105. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +1 -0
  106. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +31 -17
  107. package/dist/FormSteps/RatingStep/RatingStep.d.ts +1 -0
  108. package/dist/FormSteps/RatingStep/RatingStep.js +13 -2
  109. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +1 -0
  110. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +61 -31
  111. package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +1 -0
  112. package/dist/FormSteps/SelectorStep/SelectorStep.js +13 -2
  113. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +1 -0
  114. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +3 -2
  115. package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +1 -0
  116. package/dist/FormSteps/SeparatorStep/SeparatorStep.js +13 -2
  117. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +2 -1
  118. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +155 -73
  119. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +7 -7
  120. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +13 -2
  121. package/dist/FormSteps/Step.d.ts +1 -0
  122. package/dist/FormSteps/Step.js +58 -33
  123. package/dist/FormSteps/StepFunctions.d.ts +6 -4
  124. package/dist/FormSteps/StepFunctions.js +208 -153
  125. package/dist/FormSteps/StepHooks.d.ts +14 -68
  126. package/dist/FormSteps/StepHooks.js +154 -88
  127. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +20 -18
  128. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +1 -0
  129. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +74 -36
  130. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +2 -1
  131. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +28 -12
  132. package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +1 -0
  133. package/dist/FormSteps/TextAreaStep/TextAreaStep.js +14 -3
  134. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +2 -1
  135. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +30 -12
  136. package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +2 -1
  137. package/dist/FormSteps/TextInputStep/TextInputStep.js +13 -2
  138. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +2 -1
  139. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +26 -9
  140. package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +1 -0
  141. package/dist/FormSteps/TimePickerStep/TimePickerStep.js +13 -2
  142. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +1 -0
  143. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +54 -21
  144. package/dist/FormSteps/TitleStep/TitleStep.d.ts +1 -0
  145. package/dist/FormSteps/TitleStep/TitleStep.js +13 -2
  146. package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +2 -1
  147. package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +27 -14
  148. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +3 -2
  149. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +23 -8
  150. package/dist/Icons/@IconTypes.d.ts +7 -0
  151. package/dist/Icons/CalendarIcon.d.ts +3 -2
  152. package/dist/Icons/CalendarIcon.js +14 -4
  153. package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
  154. package/dist/Icons/Construction/LeakIcon.js +13 -3
  155. package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
  156. package/dist/Icons/Construction/ProjectIcon.js +13 -3
  157. package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
  158. package/dist/Icons/Construction/PropertyIcon.js +13 -3
  159. package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
  160. package/dist/Icons/Construction/SpaceIcon.js +13 -3
  161. package/dist/Icons/DocumentIcon.d.ts +2 -2
  162. package/dist/Icons/DocumentIcon.js +13 -3
  163. package/dist/Icons/EmailIcon.d.ts +4 -0
  164. package/dist/Icons/EmailIcon.js +17 -0
  165. package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
  166. package/dist/Icons/Entities/CheckListIcon.js +13 -3
  167. package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
  168. package/dist/Icons/Entities/GenericEntityIcon.js +15 -5
  169. package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
  170. package/dist/Icons/Entities/HandshakeIcon.js +15 -5
  171. package/dist/Icons/Entities/SchoolIcon.d.ts +2 -0
  172. package/dist/Icons/Entities/SchoolIcon.js +17 -0
  173. package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
  174. package/dist/Icons/Entities/SupplierIcon.js +15 -5
  175. package/dist/Icons/GroupIcon.d.ts +4 -0
  176. package/dist/Icons/GroupIcon.js +17 -0
  177. package/dist/Icons/LocationIcon.d.ts +3 -2
  178. package/dist/Icons/LocationIcon.js +14 -4
  179. package/dist/Icons/LockedIcon.d.ts +4 -0
  180. package/dist/Icons/LockedIcon.js +17 -0
  181. package/dist/Icons/PersonIcon.d.ts +3 -2
  182. package/dist/Icons/PersonIcon.js +16 -6
  183. package/dist/Login/Login.module.css +135 -0
  184. package/dist/Login/LoginLayout.module.css +68 -0
  185. package/dist/Login/LoginPage.d.ts +11 -0
  186. package/dist/Login/LoginPage.js +177 -0
  187. package/dist/Login/LoginTextField.d.ts +15 -0
  188. package/dist/Login/LoginTextField.js +134 -0
  189. package/dist/Services/DraftService.d.ts +14 -14
  190. package/dist/Services/DraftService.js +72 -22
  191. package/dist/Services/FileService.d.ts +1 -1
  192. package/dist/Services/FileService.js +86 -29
  193. package/dist/Services/FormService.js +56 -11
  194. package/dist/Services/IntegrationService.d.ts +21 -0
  195. package/dist/Services/IntegrationService.js +69 -0
  196. package/dist/Services/OrganizationService.js +62 -11
  197. package/dist/Services/UserService.d.ts +10 -0
  198. package/dist/Services/UserService.js +71 -0
  199. package/dist/Shared/CustomBtn/CustomBtn.d.ts +2 -1
  200. package/dist/Shared/CustomBtn/CustomBtn.js +88 -24
  201. package/dist/Shared/InputIcon/InputIcon.d.ts +3 -3
  202. package/dist/Shared/InputIcon/InputIcon.js +112 -29
  203. package/dist/Shared/Loader/Loader.d.ts +1 -0
  204. package/dist/Shared/Loader/Loader.js +18 -6
  205. package/dist/Shared/Navbar/Navbar.d.ts +3 -1
  206. package/dist/Shared/Navbar/Navbar.js +96 -3
  207. package/dist/Shared/Navbar/Navbar.module.css +15 -0
  208. package/dist/Shared/Navbar/Navbar.stories.d.ts +1 -1
  209. package/dist/Shared/Navbar/Navbar.stories.js +2 -2
  210. package/dist/Shared/Rating/Rating.d.ts +5 -3
  211. package/dist/Shared/Rating/Rating.js +27 -4
  212. package/dist/Shared/Rating/Rating.stories.d.ts +1 -1
  213. package/dist/Shared/Rating/Rating.stories.js +19 -13
  214. package/dist/Shared/Rating/Ratings/LikeRating.d.ts +2 -1
  215. package/dist/Shared/Rating/Ratings/LikeRating.js +33 -19
  216. package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +2 -1
  217. package/dist/Shared/Rating/Ratings/SatisfactionRating.js +47 -27
  218. package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +2 -1
  219. package/dist/Shared/Rating/Ratings/ScaleRating.js +54 -23
  220. package/dist/Shared/RoundedButton/RoundedButton.d.ts +30 -0
  221. package/dist/Shared/RoundedButton/RoundedButton.js +45 -0
  222. package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +23 -0
  223. package/dist/Shared/RoundedButton/RoundedButton.stories.js +36 -0
  224. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +24 -0
  225. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +101 -0
  226. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +21 -0
  227. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +50 -0
  228. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +49 -0
  229. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +351 -0
  230. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +36 -0
  231. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +223 -0
  232. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +43 -0
  233. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +226 -0
  234. package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +68 -0
  235. package/dist/Shared/RoundedSelect/RoundedSelect.js +214 -0
  236. package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +28 -0
  237. package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +91 -0
  238. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +63 -0
  239. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +236 -0
  240. package/dist/Shared/{ErkSmartSelect/ErkSmartSelect.stories.d.ts → RoundedSmartSelect/RoundedSmartSelect.stories.d.ts} +13 -3
  241. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +318 -0
  242. package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +45 -0
  243. package/dist/Shared/RoundedTextField/RoundedTextField.js +175 -0
  244. package/dist/Shared/{ErkTextField/ErkTextField.stories.d.ts → RoundedTextField/RoundedTextField.stories.d.ts} +17 -4
  245. package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +224 -0
  246. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +41 -0
  247. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +314 -0
  248. package/dist/Shared/SmartDraftRenderer/FormDecorator.d.ts +2 -1
  249. package/dist/Shared/SmartDraftRenderer/FormDecorator.js +22 -8
  250. package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +14 -0
  251. package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +60 -0
  252. package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +2 -1
  253. package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +43 -27
  254. package/dist/Shared/Toggle/Toggle.d.ts +14 -5
  255. package/dist/Shared/Toggle/Toggle.js +32 -29
  256. package/dist/States/GlobalSlice.d.ts +12 -7
  257. package/dist/States/GlobalSlice.js +22 -6
  258. package/dist/States/SiteSlice.d.ts +48 -30
  259. package/dist/States/SiteSlice.js +76 -58
  260. package/dist/States/WidthStatsSlice.d.ts +2 -2
  261. package/dist/States/WidthStatsSlice.js +9 -8
  262. package/dist/Utils/AxiosAPI.d.ts +5 -4
  263. package/dist/Utils/AxiosAPI.js +73 -23
  264. package/dist/Utils/AxiosWidget.js +4 -4
  265. package/dist/Utils/CBRFunctions.js +30 -29
  266. package/dist/Utils/DraftFunctions.d.ts +3 -3
  267. package/dist/Utils/DraftFunctions.js +143 -102
  268. package/dist/Utils/FormStepFunctions.d.ts +1 -1
  269. package/dist/Utils/FormStepFunctions.js +45 -27
  270. package/dist/Utils/MaterialProviders.d.ts +1 -21
  271. package/dist/Utils/MaterialProviders.js +28 -46
  272. package/dist/Utils/PhoneFunctions.js +5 -5
  273. package/dist/Utils/StoreContext.js +1 -1
  274. package/dist/Utils/TestUtils.d.ts +81 -60
  275. package/dist/Utils/TestUtils.js +57 -28
  276. package/dist/Utils/_api.d.ts +7 -7
  277. package/dist/Utils/_api.js +8 -10
  278. package/dist/Utils/store.d.ts +17 -9
  279. package/dist/Utils/store.js +74 -15
  280. package/dist/Widget.d.ts +1 -1
  281. package/dist/Widget.js +26 -16
  282. package/dist/__mocks__/axios.d.ts +2 -0
  283. package/dist/__mocks__/axios.js +2 -0
  284. package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
  285. package/dist/constants/ErkValueTypes.d.ts +6 -0
  286. package/dist/constants/ErkValueTypes.js +7 -0
  287. package/dist/constants/Files/FileExtensions.js +3 -3
  288. package/dist/constants/Files/FileMaxSize.js +1 -1
  289. package/dist/constants/FormStepTypes.d.ts +2 -2
  290. package/dist/constants/FormStepTypes.js +1 -1
  291. package/dist/constants/{ErkIconTypes.d.ts → IconTypes.d.ts} +4 -2
  292. package/dist/constants/IconTypes.js +18 -0
  293. package/dist/constants/InternalFormStyle.js +1 -1
  294. package/dist/constants/MaterialClassNameSeed.d.ts +1 -0
  295. package/dist/constants/MaterialClassNameSeed.js +1 -0
  296. package/dist/hooks.d.ts +3 -0
  297. package/dist/hooks.js +77 -14
  298. package/dist/index.js +31 -0
  299. package/dist/index.lib.d.ts +1 -0
  300. package/dist/index.lib.js +1 -0
  301. package/package.json +93 -72
  302. package/dist/App/AppFunctions.test.js +0 -708
  303. package/dist/App/AppHooks.test.js +0 -154
  304. package/dist/Form/FormFunctions.test.js +0 -458
  305. package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.d.ts +0 -10
  306. package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.js +0 -14
  307. package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.d.ts +0 -3
  308. package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +0 -27
  309. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +0 -2
  310. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +0 -3
  311. package/dist/FormSteps/StepFunctions.test.js +0 -702
  312. package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.d.ts +0 -1
  313. package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.js +0 -2
  314. package/dist/Icons/@ErkIcon.d.ts +0 -14
  315. package/dist/Icons/@ErkIcon.js +0 -9
  316. package/dist/Icons/ArrowLeftIcon.d.ts +0 -3
  317. package/dist/Icons/ArrowLeftIcon.js +0 -7
  318. package/dist/Icons/ArrowRightIcon.d.ts +0 -3
  319. package/dist/Icons/ArrowRightIcon.js +0 -7
  320. package/dist/Icons/CheckCircleIcon.d.ts +0 -3
  321. package/dist/Icons/CheckCircleIcon.js +0 -7
  322. package/dist/Icons/CheckboxCheckedIcon.d.ts +0 -3
  323. package/dist/Icons/CheckboxCheckedIcon.js +0 -7
  324. package/dist/Icons/CheckboxUncheckedIcon.d.ts +0 -3
  325. package/dist/Icons/CheckboxUncheckedIcon.js +0 -7
  326. package/dist/Icons/ClockIcon.d.ts +0 -3
  327. package/dist/Icons/ClockIcon.js +0 -7
  328. package/dist/Icons/CloseIcon.d.ts +0 -3
  329. package/dist/Icons/CloseIcon.js +0 -7
  330. package/dist/Icons/DeleteIcon.d.ts +0 -3
  331. package/dist/Icons/DeleteIcon.js +0 -7
  332. package/dist/Icons/Entities/WorkIcon.d.ts +0 -3
  333. package/dist/Icons/Entities/WorkIcon.js +0 -7
  334. package/dist/Icons/ErrorIcon.d.ts +0 -3
  335. package/dist/Icons/ErrorIcon.js +0 -7
  336. package/dist/Icons/ExpandLessIcon.d.ts +0 -3
  337. package/dist/Icons/ExpandLessIcon.js +0 -7
  338. package/dist/Icons/ExpandMoreIcon.d.ts +0 -3
  339. package/dist/Icons/ExpandMoreIcon.js +0 -7
  340. package/dist/Icons/FileIcon.d.ts +0 -3
  341. package/dist/Icons/FileIcon.js +0 -7
  342. package/dist/Icons/InfoIcon.d.ts +0 -3
  343. package/dist/Icons/InfoIcon.js +0 -7
  344. package/dist/Icons/Ratings/DislikeIcon.d.ts +0 -3
  345. package/dist/Icons/Ratings/DislikeIcon.js +0 -7
  346. package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +0 -3
  347. package/dist/Icons/Ratings/DissatisfiedIcon.js +0 -7
  348. package/dist/Icons/Ratings/LikeIcon.d.ts +0 -3
  349. package/dist/Icons/Ratings/LikeIcon.js +0 -7
  350. package/dist/Icons/Ratings/SatisfiedIcon.d.ts +0 -3
  351. package/dist/Icons/Ratings/SatisfiedIcon.js +0 -7
  352. package/dist/Icons/Ratings/StarIcon.d.ts +0 -3
  353. package/dist/Icons/Ratings/StarIcon.js +0 -7
  354. package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +0 -3
  355. package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +0 -7
  356. package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +0 -3
  357. package/dist/Icons/Ratings/VerySatisfiedIcon.js +0 -7
  358. package/dist/Icons/WarningIcon.d.ts +0 -3
  359. package/dist/Icons/WarningIcon.js +0 -7
  360. package/dist/Init.d.ts +0 -1
  361. package/dist/Init.js +0 -2
  362. package/dist/Shared/ErkButton/ErkButton.d.ts +0 -25
  363. package/dist/Shared/ErkButton/ErkButton.js +0 -31
  364. package/dist/Shared/ErkButton/ErkButton.stories.d.ts +0 -16
  365. package/dist/Shared/ErkButton/ErkButton.stories.js +0 -28
  366. package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +0 -19
  367. package/dist/Shared/ErkCheckbox/ErkCheckBox.js +0 -31
  368. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +0 -13
  369. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +0 -34
  370. package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +0 -18
  371. package/dist/Shared/ErkDatePicker/ErkDatePicker.js +0 -266
  372. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +0 -23
  373. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +0 -98
  374. package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.d.ts +0 -18
  375. package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.js +0 -160
  376. package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.d.ts +0 -36
  377. package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.js +0 -274
  378. package/dist/Shared/ErkMenuItem.d.ts +0 -4
  379. package/dist/Shared/ErkMenuItem.js +0 -18
  380. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +0 -17
  381. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +0 -96
  382. package/dist/Shared/ErkSelect/ErkSelect.d.ts +0 -52
  383. package/dist/Shared/ErkSelect/ErkSelect.js +0 -141
  384. package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +0 -21
  385. package/dist/Shared/ErkSelect/ErkSelect.stories.js +0 -87
  386. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +0 -28
  387. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +0 -54
  388. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +0 -159
  389. package/dist/Shared/ErkTextField/ErkTextField.d.ts +0 -34
  390. package/dist/Shared/ErkTextField/ErkTextField.js +0 -146
  391. package/dist/Shared/ErkTextField/ErkTextField.stories.js +0 -99
  392. package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +0 -32
  393. package/dist/Shared/ErkTimePicker/ErkTimePicker.js +0 -107
  394. package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +0 -1
  395. package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +0 -2
  396. package/dist/Utils/LocaleUtils.d.ts +0 -2
  397. package/dist/Utils/LocaleUtils.js +0 -12
  398. package/dist/Utils/MuiClassnameSetup.d.ts +0 -1
  399. package/dist/Utils/MuiClassnameSetup.js +0 -3
  400. package/dist/constants/ErkIconTypes.js +0 -16
  401. package/dist/index.css +0 -15
  402. package/dist/main.d.ts +0 -3
  403. package/dist/main.js +0 -25
  404. /package/dist/{App/AppFunctions.test.d.ts → @Types/ErkValue.js} +0 -0
  405. /package/dist/{App/AppHooks.test.d.ts → @Types/User.js} +0 -0
  406. /package/dist/{Form/FormFunctions.test.d.ts → Icons/@IconTypes.js} +0 -0
  407. /package/dist/Shared/{ErkTimePicker/ErkTimePicker.module.css → RoundedTimePicker/RoundedTimePicker.module.css} +0 -0
  408. /package/dist/{FormSteps/StepFunctions.test.d.ts → index.d.ts} +0 -0
  409. /package/dist/{__tests__/setup.d.ts → setupTests.d.ts} +0 -0
  410. /package/dist/{__tests__/setup.js → setupTests.js} +0 -0
@@ -7,65 +7,27 @@ 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) & {
10
+ export declare const selectOriginalValue: ((state: RootState, step: GBaseStep) => any) & import("reselect").OutputSelectorFields<(args_0: ValuesStore, args_1: GBaseStep) => any, {
11
+ clearCache: () => void;
12
+ }> & {
11
13
  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;
30
14
  };
31
15
  export interface StepDependency {
32
16
  originalValue: any;
33
17
  isDependency: boolean;
34
- handleStepDep: (value: any) => void;
18
+ handleStepDep: (value: any | undefined) => void;
35
19
  }
36
20
  export declare const useStepDependency: (step: GBaseStep, defaultValue?: any) => StepDependency;
37
- export declare const selectStepDependencies: ((state: RootState, _step: GBaseStep, form: Form) => {
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) => {
38
25
  invalids: string[];
39
26
  emptyDep: boolean;
40
- }) & {
27
+ }, {
28
+ clearCache: () => void;
29
+ }> & {
41
30
  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;
69
31
  };
70
32
  export interface UseFormStepOptions<ValueType> {
71
33
  defaultValue: ValueType;
@@ -83,26 +45,10 @@ export interface FormStepFunctions<ValueType = unknown> {
83
45
  field: Omit<ReturnType<typeof useController>['field'], 'ref' | 'value' | 'onChange'>;
84
46
  }
85
47
  export declare const useFormStep: <ValueType = unknown>(step: GBaseStep, { rules, debounce, sizeChange, defaultValue }: UseFormStepOptions<ValueType>) => FormStepFunctions<ValueType>;
86
- export declare const selectDependencies: ((state: RootState, idDeps: string[] | undefined) => DependencyStore) & {
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
+ }> & {
87
51
  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;
106
52
  };
107
53
  export declare const useCondition: (condition?: Condition) => boolean;
108
54
  export declare const calcStepDeps: (step: FormStep | CBRFormStep) => string[];
@@ -1,96 +1,137 @@
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
+ };
1
32
  import { useCallback, useContext, useEffect, useMemo, useState } from 'react';
2
33
  import { useAppSelector, useAppDispatch } from '../hooks';
3
- import { clearDependency, setStepDependency } from '../States/SiteSlice';
34
+ import { clearDependency, setStepDependency, } from '../States/SiteSlice';
4
35
  import { createSelector } from '@reduxjs/toolkit';
5
36
  import { calcDefaultValue, evaluateCondition } from './StepFunctions';
6
- import { useController } from 'react-hook-form';
37
+ import { useController, } from 'react-hook-form';
38
+ import { SizeChangeContext } from './Utils/@StepFiller/StepFiller';
7
39
  import ConditionTypes from '../constants/ConditionTypes';
8
40
  import FormStepTypes, { ApiSelectorOptionTypes, ClassifierOptionTypes, EntityValueOptionTypes, } from '../constants/FormStepTypes';
9
- import { SizeChangeContext } from './Utils/@StepFiller/StepFillerContext';
10
- const selectIsDependency = createSelector([
11
- (state) => state.site.dependencies,
12
- (_state, step) => step,
13
- ], (dependencies, step) => {
41
+ var selectIsDependency = createSelector([
42
+ function (state) { return state.site.dependencies; },
43
+ function (state, step) { return step; },
44
+ ], function (dependencies, step) {
14
45
  return dependencies[step.id] !== undefined;
15
46
  });
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(() => {
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 () {
22
61
  if (isDependency && !originalValue && defaultValue) {
23
62
  dispatch(setStepDependency({
24
- step,
63
+ step: step,
25
64
  value: defaultValue,
26
65
  }));
27
66
  }
28
- return () => {
67
+ return function () {
29
68
  dispatch(clearDependency(step));
30
69
  };
31
70
  }, [isDependency]);
32
- const handleStepDep = useCallback((value) => {
71
+ var handleStepDep = useCallback(function (value) {
33
72
  if (!isDependency)
34
73
  return;
35
74
  dispatch(setStepDependency({
36
- step,
37
- value: value ?? null,
75
+ step: step,
76
+ value: value !== null && value !== void 0 ? value : null,
38
77
  }));
39
78
  }, [step.id, step.type, isDependency]);
40
79
  return {
41
- handleStepDep,
42
- isDependency,
43
- originalValue: originalValue ?? defaultValue ?? calcDefaultValue(step),
80
+ handleStepDep: handleStepDep,
81
+ isDependency: isDependency,
82
+ originalValue: (_a = originalValue !== null && originalValue !== void 0 ? originalValue : defaultValue) !== null && _a !== void 0 ? _a : calcDefaultValue(step),
44
83
  };
45
84
  };
46
- export const selectStepDependencies = createSelector([
47
- (state) => state.site.dependencies,
48
- (_state, step) => step,
49
- (_state, _step, form) => form,
50
- ], (dependencies, step, form) => {
51
- const invalids = [];
52
- let emptyDep = false;
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;
53
92
  /** Show deep error changes even if not in dependencies */
54
- for (const idDep of calcDeepDependencies(step.id, form)) {
55
- const dependency = dependencies[idDep];
56
- if (dependency?.value === null && form.steps[idDep]) {
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
97
  invalids.push(idDep);
58
98
  }
59
- if (dependency?.empty)
99
+ if (dependency === null || dependency === void 0 ? void 0 : dependency.empty)
60
100
  emptyDep = true;
61
101
  }
62
- return { invalids, emptyDep };
102
+ return { invalids: invalids, emptyDep: emptyDep };
63
103
  });
64
- const calcDeepDependencies = (idStep, form, deps = []) => {
65
- const step = form.steps[idStep];
66
- if (step?.dependencies) {
67
- for (const dep of step.dependencies) {
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];
68
110
  if (!deps.includes(dep)) {
69
- deps.push(...calcDeepDependencies(dep, form, deps), dep);
111
+ deps.push.apply(deps, __spreadArray(__spreadArray([], calcDeepDependencies(dep, form, deps), false), [dep], false));
70
112
  }
71
113
  }
72
114
  }
73
115
  return deps;
74
116
  };
75
- export const useFormStep = (step, { rules, debounce, sizeChange, defaultValue }) => {
76
- const [timer, setTimer] = useState();
77
- const { isDependency, handleStepDep, originalValue } = useStepDependency(step, defaultValue);
78
- const { field: { ref, value, onChange: fieldOnChange, ...field }, fieldState: { error }, } = useController({
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({
79
122
  name: step.id,
80
- rules,
123
+ rules: rules,
81
124
  shouldUnregister: true,
82
125
  defaultValue: originalValue,
83
- });
84
- const handleSizeChange = useContext(SizeChangeContext);
85
- const onChange = useCallback((value) => {
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
129
  if (isDependency) {
87
130
  if (debounce) {
88
- try {
131
+ if (timer) {
89
132
  clearTimeout(timer);
90
- // eslint-disable-next-line no-empty, @typescript-eslint/no-unused-vars
91
133
  }
92
- catch (e) { }
93
- setTimer(setTimeout(() => {
134
+ setTimer(setTimeout(function () {
94
135
  handleStepDep(value);
95
136
  setTimer(undefined);
96
137
  }, 1000));
@@ -101,73 +142,96 @@ export const useFormStep = (step, { rules, debounce, sizeChange, defaultValue })
101
142
  }
102
143
  fieldOnChange(value);
103
144
  if (sizeChange)
104
- handleSizeChange?.();
105
- }, [handleStepDep, isDependency, fieldOnChange]);
145
+ handleSizeChange === null || handleSizeChange === void 0 ? void 0 : handleSizeChange();
146
+ }, [
147
+ handleStepDep,
148
+ isDependency,
149
+ fieldOnChange,
150
+ timer,
151
+ debounce,
152
+ sizeChange,
153
+ handleSizeChange,
154
+ ]);
106
155
  return {
107
- ref,
108
- value,
109
- onChange,
110
- error,
111
- field,
156
+ ref: ref,
157
+ value: value,
158
+ onChange: onChange,
159
+ error: error,
160
+ field: field,
112
161
  };
113
162
  };
114
- const EMPTY_ARRAY = [];
115
- export const selectDependencies = createSelector([
116
- (state) => state.site.dependencies,
117
- (_state, idDeps) => idDeps ?? EMPTY_ARRAY,
118
- ], (dependencies, idDeps) => idDeps.reduce((acc, idDep) => ({
119
- ...acc,
120
- [idDep]: dependencies[idDep],
121
- }), {}));
122
- export const useCondition = (condition) => {
123
- const ids = useMemo(() => recursivelyCalcConditionSteps(condition), []);
124
- const dependencies = useAppSelector((state) => selectDependencies(state, ids));
125
- return useMemo(() => {
163
+ var EMPTY_ARRAY = [];
164
+ export var selectDependencies = createSelector([
165
+ function (state) { return state.site.dependencies; },
166
+ function (state, idDeps) {
167
+ return idDeps !== null && idDeps !== void 0 ? idDeps : EMPTY_ARRAY;
168
+ },
169
+ ], function (dependencies, idDeps) {
170
+ return idDeps.reduce(function (acc, idDep) {
171
+ var _a;
172
+ return (__assign(__assign({}, acc), (_a = {}, _a[idDep] = dependencies[idDep], _a)));
173
+ }, {});
174
+ });
175
+ export var useCondition = function (condition) {
176
+ var ids = useMemo(function () { return recursivelyCalcConditionSteps(condition); }, []);
177
+ var dependencies = useAppSelector(function (state) {
178
+ return selectDependencies(state, ids);
179
+ });
180
+ return useMemo(function () {
126
181
  return !condition || evaluateCondition(condition, dependencies);
127
- }, ids.map((id) => dependencies[id].value));
182
+ }, ids.map(function (id) { return dependencies[id].value; }));
128
183
  };
129
- export const calcStepDeps = (step) => {
130
- const dependencies = [...(step.dependencies ?? [])];
184
+ export var calcStepDeps = function (step) {
185
+ var _a;
186
+ var dependencies = __spreadArray([], ((_a = step.dependencies) !== null && _a !== void 0 ? _a : []), true);
131
187
  if (step.condition) {
132
- dependencies.push(...recursivelyCalcConditionSteps(step.condition));
188
+ dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(step.condition));
133
189
  }
134
190
  switch (step.type) {
135
191
  case FormStepTypes.CLASSIFIER_SELECTOR:
136
192
  {
137
- for (const option of Object.values(step.options)) {
138
- if (option.type !== ClassifierOptionTypes.HIDE && option.condition) {
139
- dependencies.push(...recursivelyCalcConditionSteps(option.condition));
193
+ for (var _i = 0, _b = Object.values(step.options); _i < _b.length; _i++) {
194
+ var option = _b[_i];
195
+ if (option.type !== ClassifierOptionTypes.HIDE &&
196
+ option.condition) {
197
+ dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
140
198
  }
141
199
  }
142
200
  }
143
201
  break;
144
202
  case FormStepTypes.ENTITYVALUEPICKER:
145
203
  {
146
- for (const option of Object.values(step.options)) {
147
- if (option.type !== EntityValueOptionTypes.HIDE && option.condition) {
148
- dependencies.push(...recursivelyCalcConditionSteps(option.condition));
204
+ for (var _c = 0, _d = Object.values(step.options); _c < _d.length; _c++) {
205
+ var option = _d[_c];
206
+ if (option.type !== EntityValueOptionTypes.HIDE &&
207
+ option.condition) {
208
+ dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
149
209
  }
150
210
  }
151
211
  if (step.dialogs)
152
- for (const dialog of Object.values(step.dialogs)) {
153
- dependencies.push(...recursivelyCalcConditionSteps(dialog.condition));
212
+ for (var _e = 0, _f = Object.values(step.dialogs); _e < _f.length; _e++) {
213
+ var dialog = _f[_e];
214
+ dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(dialog.condition));
154
215
  }
155
216
  }
156
217
  break;
157
218
  case FormStepTypes.API_SELECTOR:
158
219
  {
159
- for (const option of Object.values(step.options)) {
160
- if (option.type !== ApiSelectorOptionTypes.HIDE && option.condition) {
161
- dependencies.push(...recursivelyCalcConditionSteps(option.condition));
220
+ for (var _g = 0, _h = Object.values(step.options); _g < _h.length; _g++) {
221
+ var option = _h[_g];
222
+ if (option.type !== ApiSelectorOptionTypes.HIDE &&
223
+ option.condition) {
224
+ dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
162
225
  }
163
226
  }
164
227
  }
165
228
  break;
166
229
  case FormStepTypes.SELECTOR:
167
230
  {
168
- for (const option of Object.values(step.options)) {
231
+ for (var _j = 0, _k = Object.values(step.options); _j < _k.length; _j++) {
232
+ var option = _k[_j];
169
233
  if (option.condition) {
170
- dependencies.push(...recursivelyCalcConditionSteps(option.condition));
234
+ dependencies.push.apply(dependencies, recursivelyCalcConditionSteps(option.condition));
171
235
  }
172
236
  }
173
237
  }
@@ -177,12 +241,14 @@ export const calcStepDeps = (step) => {
177
241
  }
178
242
  return dependencies;
179
243
  };
180
- export const recursivelyCalcConditionSteps = (condition) => {
244
+ export var recursivelyCalcConditionSteps = function (condition) {
181
245
  if (!condition)
182
246
  return [];
183
247
  switch (condition.type) {
184
248
  case ConditionTypes.EXPRESSION: {
185
- return condition.conditions.map((condition) => recursivelyCalcConditionSteps(condition)).flat();
249
+ return condition.conditions
250
+ .map(function (condition) { return recursivelyCalcConditionSteps(condition); })
251
+ .flat();
186
252
  }
187
253
  case ConditionTypes.FORM_STEP: {
188
254
  return [condition.idStep];
@@ -1,34 +1,34 @@
1
- .Erk-DraftContainer {
1
+ .EF-DraftContainer {
2
2
  font: inherit;
3
3
  font-size: 1rem;
4
4
  }
5
5
  .postview-editor {
6
6
  cursor: default !important;
7
7
  }
8
- .Erk-DraftContainer .DraftEditor-root {
8
+ .EF-DraftContainer .DraftEditor-root {
9
9
  height: unset;
10
10
  }
11
11
 
12
- .Erk-DraftContainer .rdw-option-wrapper {
12
+ .EF-DraftContainer .rdw-option-wrapper {
13
13
  border-radius: 7px;
14
14
  border: 1px solid var(--eureka-outline);
15
15
  background-color: transparent;
16
16
  }
17
17
 
18
- .Erk-DraftContainer .rdw-option-wrapper:active {
18
+ .EF-DraftContainer .rdw-option-wrapper:active {
19
19
  border: 1px solid var(--eureka-primary);
20
20
  }
21
- .Erk-DraftContainer .rdw-option-wrapper:hover {
21
+ .EF-DraftContainer .rdw-option-wrapper:hover {
22
22
  box-shadow: none;
23
23
  border: 1px solid var(--eureka-primary);
24
24
  }
25
25
 
26
- .Erk-DraftContainer .rdw-option-active {
26
+ .EF-DraftContainer .rdw-option-active {
27
27
  border: 1px solid var(--eureka-primary);
28
28
  box-shadow: none;
29
29
  }
30
30
 
31
- .Erk-DraftContainer .rdw-editor-toolbar {
31
+ .EF-DraftContainer .rdw-editor-toolbar {
32
32
  border-radius: 15px 15px 0 0;
33
33
  border: none;
34
34
  border-bottom: 1px solid var(--eureka-outline);
@@ -39,38 +39,38 @@
39
39
  pointer-events: none;
40
40
  }
41
41
 
42
- .Erk-DraftContainer .rdw-editor-main {
42
+ .EF-DraftContainer .rdw-editor-main {
43
43
  cursor: text;
44
44
  padding-top: 12px;
45
45
  padding-bottom: 40px;
46
46
  margin-right: 0px;
47
47
  }
48
48
 
49
- .Erk-DraftContainer .public-DraftStyleDefault-block {
49
+ .EF-DraftContainer .public-DraftStyleDefault-block {
50
50
  margin: 0px 0;
51
51
  max-width: 100%;
52
52
  }
53
53
 
54
- .Erk-DraftContainer .rdw-image-imagewrapper {
54
+ .EF-DraftContainer .rdw-image-imagewrapper {
55
55
  max-width: 100%;
56
56
  /* cursor: pointer; */
57
57
  position: relative;
58
58
  }
59
59
 
60
- .Erk-DraftContainer .rdw-image-alignment-editor {
60
+ .EF-DraftContainer .rdw-image-alignment-editor {
61
61
  padding-right: 10px;
62
62
  padding-left: 5px;
63
63
  margin-left: -5px;
64
64
  }
65
- .Erk-DraftContainer .rdw-editing-image {
66
- border: 1px solid var(--eureka-primary);
65
+ .EF-DraftContainer .rdw-editing-image {
66
+ border: 1px solid var(--secondary);
67
67
  }
68
68
 
69
- .Erk-DraftContainer .DraftEditor-root figure {
69
+ .EF-DraftContainer .DraftEditor-root figure {
70
70
  margin: 0px;
71
71
  }
72
72
 
73
- .Erk-DraftContainer .rdw-image-alignment-option {
73
+ .EF-DraftContainer .rdw-image-alignment-option {
74
74
  font-size: 16px !important;
75
75
  width: 20px;
76
76
  height: 20px;
@@ -80,15 +80,17 @@
80
80
  display: flex;
81
81
  align-items: center;
82
82
  justify-content: center;
83
- border: 1px solid var(--eureka-outline);
83
+ border: 1px solid var(--light-grey);
84
84
  }
85
85
 
86
- .Erk-DraftContainer .rdw-image-alignment-options-popup {
86
+ .EF-DraftContainer .rdw-image-alignment-options-popup {
87
87
  width: fit-content;
88
88
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.6);
89
89
  }
90
90
 
91
91
  /* Hides empty placeholder */
92
- .Erk-DraftContainer .RichEditor-hidePlaceholder .public-DraftEditorPlaceholder-root {
92
+ .EF-DraftContainer
93
+ .RichEditor-hidePlaceholder
94
+ .public-DraftEditorPlaceholder-root {
93
95
  display: none;
94
96
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import 'react-draft-wysiwyg/dist/react-draft-wysiwyg.css';
2
3
  import './DraftEditor.css';
3
4
  import { TextAreaStepProps } from '../TextAreaStep';