@arquimedes.co/eureka-forms 3.0.32 → 3.0.33-test

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (410) hide show
  1. package/dist/@Types/Condition.d.ts +4 -6
  2. package/dist/@Types/Form.d.ts +0 -1
  3. package/dist/@Types/FormStep.d.ts +8 -12
  4. package/dist/@Types/GenericFormSteps.d.ts +8 -0
  5. package/dist/App/App.d.ts +1 -3
  6. package/dist/App/App.js +21 -46
  7. package/dist/App/AppFunctions.d.ts +1 -1
  8. package/dist/App/AppFunctions.js +177 -336
  9. package/dist/App/AppFunctions.test.js +708 -0
  10. package/dist/App/AppHooks.d.ts +2 -2
  11. package/dist/App/AppHooks.js +146 -252
  12. package/dist/App/AppHooks.test.js +154 -0
  13. package/dist/Contexts/CustomContext.d.ts +0 -1
  14. package/dist/Contexts/CustomContext.js +1 -1
  15. package/dist/Contexts/FormContext.d.ts +1 -1
  16. package/dist/Contexts/FormContext.js +3 -2
  17. package/dist/Contexts/SectionContext.d.ts +0 -1
  18. package/dist/Contexts/SectionContext.js +1 -1
  19. package/dist/Form/ConfirmationDialog/ConfirmationDialog.d.ts +1 -2
  20. package/dist/Form/ConfirmationDialog/ConfirmationDialog.js +36 -62
  21. package/dist/Form/Form.d.ts +1 -2
  22. package/dist/Form/Form.js +71 -164
  23. package/dist/Form/Form.module.css +0 -9
  24. package/dist/Form/FormFunctions.js +63 -112
  25. package/dist/Form/FormFunctions.test.js +458 -0
  26. package/dist/Form/FormHooks.d.ts +0 -1
  27. package/dist/Form/FormHooks.js +13 -21
  28. package/dist/Form/FormTypes/ColumnForm/ColumnForm.d.ts +0 -1
  29. package/dist/Form/FormTypes/ColumnForm/ColumnForm.js +32 -105
  30. package/dist/Form/FormTypes/StepperForm/StepperForm.d.ts +1 -2
  31. package/dist/Form/FormTypes/StepperForm/StepperForm.js +46 -110
  32. package/dist/Form/Section/MaterialSection/MaterialSection.d.ts +0 -1
  33. package/dist/Form/Section/MaterialSection/MaterialSection.js +10 -23
  34. package/dist/Form/Section/MaterialSection/MaterialSection.module.css +0 -2
  35. package/dist/Form/Section/Section.d.ts +0 -1
  36. package/dist/Form/Section/Section.js +4 -15
  37. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.d.ts +0 -1
  38. package/dist/Form/Terms/Term/MaterialTerm/MaterialTerm.js +30 -65
  39. package/dist/Form/Terms/Term/Term.d.ts +0 -1
  40. package/dist/Form/Terms/Term/Term.js +2 -13
  41. package/dist/Form/Terms/Terms.d.ts +0 -1
  42. package/dist/Form/Terms/Terms.js +11 -27
  43. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.d.ts +0 -1
  44. package/dist/FormSteps/@Construction/CBRElementStep/CBRElementStep.js +34 -107
  45. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.d.ts +0 -1
  46. package/dist/FormSteps/@Construction/CBRIncidentsStep/CBRIncidentsStep.js +2 -13
  47. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.d.ts +0 -1
  48. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/Incident/Incident.js +12 -40
  49. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.d.ts +0 -1
  50. package/dist/FormSteps/@Construction/CBRIncidentsStep/MaterialCBRIncidentsStep/MaterialCBRIncidentsStep.js +56 -77
  51. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.d.ts +0 -1
  52. package/dist/FormSteps/@Construction/CBRPropertyStep/CBRPropertyStep.js +45 -115
  53. package/dist/FormSteps/AYFStepMapper.d.ts +0 -1
  54. package/dist/FormSteps/AYFStepMapper.js +60 -137
  55. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.d.ts +0 -1
  56. package/dist/FormSteps/ApiSelectorStep/ApiSelectorStep.js +2 -13
  57. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.d.ts +0 -1
  58. package/dist/FormSteps/ApiSelectorStep/MaterialApiSelectorStep/MaterialApiSelectorStep.js +64 -173
  59. package/dist/FormSteps/CBRStepMapper.d.ts +0 -1
  60. package/dist/FormSteps/CBRStepMapper.js +56 -168
  61. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.d.ts +0 -1
  62. package/dist/FormSteps/CheckBoxStep/CheckBoxStep.js +2 -13
  63. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.d.ts +0 -1
  64. package/dist/FormSteps/CheckBoxStep/MaterialCheckBoxStep/MaterialCheckBoxStep.js +19 -37
  65. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.d.ts +0 -1
  66. package/dist/FormSteps/ClassifierSelectorStep/ClassifierSelectorStep.js +2 -13
  67. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.d.ts +1 -2
  68. package/dist/FormSteps/ClassifierSelectorStep/MaterialClassifierSelectorStep/MaterialClassifierSelectorStep.js +44 -81
  69. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.d.ts +0 -1
  70. package/dist/FormSteps/CollapsibleStep/CollapsibleStep.js +3 -26
  71. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.d.ts +0 -1
  72. package/dist/FormSteps/CollapsibleStep/MaterialTitleStep/MaterialCollapsibleStep.js +31 -61
  73. package/dist/FormSteps/CustomStep.d.ts +0 -1
  74. package/dist/FormSteps/CustomStep.js +17 -31
  75. package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.d.ts +10 -0
  76. package/dist/FormSteps/DatePickerRangeStep/DatePickerRangeStep.js +14 -0
  77. package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.d.ts +3 -0
  78. package/dist/FormSteps/DatePickerRangeStep/MaterialDatePickerRangeStep/MaterialDatePickerRangeStep.js +34 -0
  79. package/dist/FormSteps/DatePickerStep/DatePickerStep.d.ts +1 -2
  80. package/dist/FormSteps/DatePickerStep/DatePickerStep.js +2 -13
  81. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.d.ts +1 -2
  82. package/dist/FormSteps/DatePickerStep/MaterialDatePickerStep/MaterialDatePickerStep.js +9 -20
  83. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.d.ts +0 -1
  84. package/dist/FormSteps/EntityValueStep/EntityValuePickerStep.js +2 -13
  85. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.d.ts +0 -1
  86. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValueDialog/MaterialEntityValueDialog.js +16 -32
  87. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.d.ts +1 -2
  88. package/dist/FormSteps/EntityValueStep/MaterialEntityValuePickerStep/MaterialEntityValuePickerStep.js +106 -300
  89. package/dist/FormSteps/FileUploadStep/FileUploadStep.d.ts +0 -1
  90. package/dist/FormSteps/FileUploadStep/FileUploadStep.js +2 -13
  91. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.d.ts +0 -1
  92. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileComponent/FileComponent.js +33 -95
  93. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.d.ts +2 -0
  94. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/FileFunctions.js +3 -0
  95. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.d.ts +0 -2
  96. package/dist/FormSteps/FileUploadStep/MaterialFileUploadStep/MaterialFileUploadStep.js +85 -180
  97. package/dist/FormSteps/MapperStep/MapperStep.d.ts +0 -1
  98. package/dist/FormSteps/MapperStep/MapperStep.js +2 -13
  99. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.d.ts +0 -1
  100. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/ListMapperElement/ListMapperElement.js +16 -38
  101. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/MapperElementComponent.js +20 -31
  102. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.d.ts +0 -1
  103. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PagedMapperElement/PagedMapperElement.js +85 -175
  104. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.d.ts +0 -1
  105. package/dist/FormSteps/MapperStep/MaterialMapperStep/Element/PillMapperElement/PillMapperElement.js +20 -47
  106. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.d.ts +0 -1
  107. package/dist/FormSteps/MapperStep/MaterialMapperStep/MaterialMapperStep.js +70 -115
  108. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.d.ts +1 -2
  109. package/dist/FormSteps/PhoneInputStep/MaterialTextInputStep/MaterialPhoneInputStep.js +15 -33
  110. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.d.ts +0 -1
  111. package/dist/FormSteps/PhoneInputStep/PhoneInputStep.js +2 -13
  112. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.d.ts +0 -1
  113. package/dist/FormSteps/RatingStep/MaterialRatingStep/MaterialRatingStep.js +17 -31
  114. package/dist/FormSteps/RatingStep/RatingStep.d.ts +0 -1
  115. package/dist/FormSteps/RatingStep/RatingStep.js +2 -13
  116. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.d.ts +0 -1
  117. package/dist/FormSteps/SelectorStep/MaterialSelectorStep/MaterialSelectorStep.js +31 -61
  118. package/dist/FormSteps/SelectorStep/SelectorStep.d.ts +0 -1
  119. package/dist/FormSteps/SelectorStep/SelectorStep.js +2 -13
  120. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.d.ts +0 -1
  121. package/dist/FormSteps/SeparatorStep/MaterialSeparatorStep/MaterialSeparatorStep.js +2 -3
  122. package/dist/FormSteps/SeparatorStep/SeparatorStep.d.ts +0 -1
  123. package/dist/FormSteps/SeparatorStep/SeparatorStep.js +2 -13
  124. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.d.ts +1 -2
  125. package/dist/FormSteps/SmartSelectStep/MaterialSmartSelectStep/MaterialSmartSelectStep.js +73 -155
  126. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.d.ts +7 -7
  127. package/dist/FormSteps/SmartSelectStep/SmartSelectStep.js +2 -13
  128. package/dist/FormSteps/Step.d.ts +0 -1
  129. package/dist/FormSteps/Step.js +33 -58
  130. package/dist/FormSteps/StepFunctions.d.ts +4 -6
  131. package/dist/FormSteps/StepFunctions.js +153 -208
  132. package/dist/FormSteps/StepFunctions.test.js +702 -0
  133. package/dist/FormSteps/StepHooks.d.ts +68 -14
  134. package/dist/FormSteps/StepHooks.js +88 -154
  135. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/DraftEditor.css +18 -20
  136. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.d.ts +0 -1
  137. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaEditorStep.js +36 -74
  138. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.d.ts +1 -2
  139. package/dist/FormSteps/TextAreaStep/MaterialTextAreaStep/MaterialTextAreaStep.js +12 -28
  140. package/dist/FormSteps/TextAreaStep/TextAreaStep.d.ts +0 -1
  141. package/dist/FormSteps/TextAreaStep/TextAreaStep.js +3 -14
  142. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.d.ts +1 -2
  143. package/dist/FormSteps/TextInputStep/MaterialTextInputStep/MaterialTextInputStep.js +12 -30
  144. package/dist/FormSteps/TextInputStep/TextInputStep.d.ts +1 -2
  145. package/dist/FormSteps/TextInputStep/TextInputStep.js +2 -13
  146. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.d.ts +1 -2
  147. package/dist/FormSteps/TimePickerStep/MaterialTimePickerStep/MaterialTimePickerStep.js +9 -26
  148. package/dist/FormSteps/TimePickerStep/TimePickerStep.d.ts +0 -1
  149. package/dist/FormSteps/TimePickerStep/TimePickerStep.js +2 -13
  150. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.d.ts +0 -1
  151. package/dist/FormSteps/TitleStep/MaterialTitleStep/MaterialTitleStep.js +21 -54
  152. package/dist/FormSteps/TitleStep/TitleStep.d.ts +0 -1
  153. package/dist/FormSteps/TitleStep/TitleStep.js +2 -13
  154. package/dist/FormSteps/Utils/@StepFiller/StepFiller.d.ts +1 -2
  155. package/dist/FormSteps/Utils/@StepFiller/StepFiller.js +14 -27
  156. package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.d.ts +1 -0
  157. package/dist/FormSteps/Utils/@StepFiller/StepFillerContext.js +2 -0
  158. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.d.ts +2 -3
  159. package/dist/FormSteps/Utils/MaterialInputContainer/MaterialInputContainer.js +8 -23
  160. package/dist/Icons/@ErkIcon.d.ts +14 -0
  161. package/dist/Icons/@ErkIcon.js +9 -0
  162. package/dist/Icons/ArrowLeftIcon.d.ts +3 -0
  163. package/dist/Icons/ArrowLeftIcon.js +7 -0
  164. package/dist/Icons/ArrowRightIcon.d.ts +3 -0
  165. package/dist/Icons/ArrowRightIcon.js +7 -0
  166. package/dist/Icons/CalendarIcon.d.ts +2 -3
  167. package/dist/Icons/CalendarIcon.js +4 -14
  168. package/dist/Icons/CheckCircleIcon.d.ts +3 -0
  169. package/dist/Icons/CheckCircleIcon.js +7 -0
  170. package/dist/Icons/CheckboxCheckedIcon.d.ts +3 -0
  171. package/dist/Icons/CheckboxCheckedIcon.js +7 -0
  172. package/dist/Icons/CheckboxUncheckedIcon.d.ts +3 -0
  173. package/dist/Icons/CheckboxUncheckedIcon.js +7 -0
  174. package/dist/Icons/ClockIcon.d.ts +3 -0
  175. package/dist/Icons/ClockIcon.js +7 -0
  176. package/dist/Icons/CloseIcon.d.ts +3 -0
  177. package/dist/Icons/CloseIcon.js +7 -0
  178. package/dist/Icons/Construction/LeakIcon.d.ts +2 -2
  179. package/dist/Icons/Construction/LeakIcon.js +3 -13
  180. package/dist/Icons/Construction/ProjectIcon.d.ts +2 -2
  181. package/dist/Icons/Construction/ProjectIcon.js +3 -13
  182. package/dist/Icons/Construction/PropertyIcon.d.ts +2 -2
  183. package/dist/Icons/Construction/PropertyIcon.js +3 -13
  184. package/dist/Icons/Construction/SpaceIcon.d.ts +2 -2
  185. package/dist/Icons/Construction/SpaceIcon.js +3 -13
  186. package/dist/Icons/DeleteIcon.d.ts +3 -0
  187. package/dist/Icons/DeleteIcon.js +7 -0
  188. package/dist/Icons/DocumentIcon.d.ts +2 -2
  189. package/dist/Icons/DocumentIcon.js +3 -13
  190. package/dist/Icons/Entities/CheckListIcon.d.ts +2 -2
  191. package/dist/Icons/Entities/CheckListIcon.js +3 -13
  192. package/dist/Icons/Entities/GenericEntityIcon.d.ts +2 -2
  193. package/dist/Icons/Entities/GenericEntityIcon.js +5 -15
  194. package/dist/Icons/Entities/HandshakeIcon.d.ts +2 -2
  195. package/dist/Icons/Entities/HandshakeIcon.js +5 -15
  196. package/dist/Icons/Entities/SupplierIcon.d.ts +2 -2
  197. package/dist/Icons/Entities/SupplierIcon.js +5 -15
  198. package/dist/Icons/Entities/WorkIcon.d.ts +3 -0
  199. package/dist/Icons/Entities/WorkIcon.js +7 -0
  200. package/dist/Icons/ErrorIcon.d.ts +3 -0
  201. package/dist/Icons/ErrorIcon.js +7 -0
  202. package/dist/Icons/ExpandLessIcon.d.ts +3 -0
  203. package/dist/Icons/ExpandLessIcon.js +7 -0
  204. package/dist/Icons/ExpandMoreIcon.d.ts +3 -0
  205. package/dist/Icons/ExpandMoreIcon.js +7 -0
  206. package/dist/Icons/FileIcon.d.ts +3 -0
  207. package/dist/Icons/FileIcon.js +7 -0
  208. package/dist/Icons/InfoIcon.d.ts +3 -0
  209. package/dist/Icons/InfoIcon.js +7 -0
  210. package/dist/Icons/LocationIcon.d.ts +2 -3
  211. package/dist/Icons/LocationIcon.js +4 -14
  212. package/dist/Icons/PersonIcon.d.ts +2 -3
  213. package/dist/Icons/PersonIcon.js +6 -16
  214. package/dist/Icons/Ratings/DislikeIcon.d.ts +3 -0
  215. package/dist/Icons/Ratings/DislikeIcon.js +7 -0
  216. package/dist/Icons/Ratings/DissatisfiedIcon.d.ts +3 -0
  217. package/dist/Icons/Ratings/DissatisfiedIcon.js +7 -0
  218. package/dist/Icons/Ratings/LikeIcon.d.ts +3 -0
  219. package/dist/Icons/Ratings/LikeIcon.js +7 -0
  220. package/dist/Icons/Ratings/SatisfiedIcon.d.ts +3 -0
  221. package/dist/Icons/Ratings/SatisfiedIcon.js +7 -0
  222. package/dist/Icons/Ratings/StarIcon.d.ts +3 -0
  223. package/dist/Icons/Ratings/StarIcon.js +7 -0
  224. package/dist/Icons/Ratings/VeryDissatisfiedIcon.d.ts +3 -0
  225. package/dist/Icons/Ratings/VeryDissatisfiedIcon.js +7 -0
  226. package/dist/Icons/Ratings/VerySatisfiedIcon.d.ts +3 -0
  227. package/dist/Icons/Ratings/VerySatisfiedIcon.js +7 -0
  228. package/dist/Icons/WarningIcon.d.ts +3 -0
  229. package/dist/Icons/WarningIcon.js +7 -0
  230. package/dist/Init.d.ts +1 -0
  231. package/dist/Init.js +2 -0
  232. package/dist/Services/DraftService.d.ts +14 -14
  233. package/dist/Services/DraftService.js +22 -72
  234. package/dist/Services/FileService.d.ts +1 -1
  235. package/dist/Services/FileService.js +29 -86
  236. package/dist/Services/FormService.js +11 -56
  237. package/dist/Services/OrganizationService.js +11 -62
  238. package/dist/Shared/CustomBtn/CustomBtn.d.ts +1 -2
  239. package/dist/Shared/CustomBtn/CustomBtn.js +24 -88
  240. package/dist/Shared/ErkButton/ErkButton.d.ts +25 -0
  241. package/dist/Shared/ErkButton/ErkButton.js +31 -0
  242. package/dist/Shared/ErkButton/ErkButton.stories.d.ts +16 -0
  243. package/dist/Shared/ErkButton/ErkButton.stories.js +28 -0
  244. package/dist/Shared/ErkCheckbox/ErkCheckBox.d.ts +19 -0
  245. package/dist/Shared/ErkCheckbox/ErkCheckBox.js +31 -0
  246. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.d.ts +13 -0
  247. package/dist/Shared/ErkCheckbox/ErkCheckBox.stories.js +34 -0
  248. package/dist/Shared/ErkDatePicker/ErkDatePicker.d.ts +18 -0
  249. package/dist/Shared/ErkDatePicker/ErkDatePicker.js +266 -0
  250. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.d.ts +23 -0
  251. package/dist/Shared/ErkDatePicker/ErkDatePicker.stories.js +98 -0
  252. package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.d.ts +18 -0
  253. package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.js +162 -0
  254. package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.d.ts +36 -0
  255. package/dist/Shared/ErkDatePickerRange/ErkDatePickerRange.stories.js +274 -0
  256. package/dist/Shared/ErkMenuItem.d.ts +4 -0
  257. package/dist/Shared/ErkMenuItem.js +18 -0
  258. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.d.ts +17 -0
  259. package/dist/Shared/ErkPhoneInput/EkrPhoneInput.js +96 -0
  260. package/dist/Shared/ErkSelect/ErkSelect.d.ts +52 -0
  261. package/dist/Shared/ErkSelect/ErkSelect.js +141 -0
  262. package/dist/Shared/ErkSelect/ErkSelect.stories.d.ts +21 -0
  263. package/dist/Shared/ErkSelect/ErkSelect.stories.js +87 -0
  264. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.d.ts +28 -0
  265. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.js +54 -0
  266. package/dist/Shared/{RoundedSmartSelect/RoundedSmartSelect.stories.d.ts → ErkSmartSelect/ErkSmartSelect.stories.d.ts} +3 -13
  267. package/dist/Shared/ErkSmartSelect/ErkSmartSelect.stories.js +159 -0
  268. package/dist/Shared/ErkTextField/ErkTextField.d.ts +34 -0
  269. package/dist/Shared/ErkTextField/ErkTextField.js +146 -0
  270. package/dist/Shared/{RoundedTextField/RoundedTextField.stories.d.ts → ErkTextField/ErkTextField.stories.d.ts} +4 -17
  271. package/dist/Shared/ErkTextField/ErkTextField.stories.js +99 -0
  272. package/dist/Shared/ErkTimePicker/ErkTimePicker.d.ts +32 -0
  273. package/dist/Shared/ErkTimePicker/ErkTimePicker.js +107 -0
  274. package/dist/Shared/InputIcon/InputIcon.d.ts +3 -3
  275. package/dist/Shared/InputIcon/InputIcon.js +29 -112
  276. package/dist/Shared/Loader/Loader.d.ts +0 -1
  277. package/dist/Shared/Loader/Loader.js +6 -18
  278. package/dist/Shared/Navbar/Navbar.d.ts +1 -3
  279. package/dist/Shared/Navbar/Navbar.js +3 -96
  280. package/dist/Shared/Navbar/Navbar.module.css +0 -15
  281. package/dist/Shared/Navbar/Navbar.stories.d.ts +1 -1
  282. package/dist/Shared/Navbar/Navbar.stories.js +2 -2
  283. package/dist/Shared/Rating/Rating.d.ts +3 -5
  284. package/dist/Shared/Rating/Rating.js +4 -27
  285. package/dist/Shared/Rating/Rating.stories.d.ts +1 -1
  286. package/dist/Shared/Rating/Rating.stories.js +13 -19
  287. package/dist/Shared/Rating/Ratings/LikeRating.d.ts +1 -2
  288. package/dist/Shared/Rating/Ratings/LikeRating.js +19 -33
  289. package/dist/Shared/Rating/Ratings/SatisfactionRating.d.ts +1 -2
  290. package/dist/Shared/Rating/Ratings/SatisfactionRating.js +27 -47
  291. package/dist/Shared/Rating/Ratings/ScaleRating.d.ts +1 -2
  292. package/dist/Shared/Rating/Ratings/ScaleRating.js +23 -54
  293. package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.d.ts +1 -0
  294. package/dist/Shared/SmartDraftRenderer/DraftLoadingContext.js +2 -0
  295. package/dist/Shared/SmartDraftRenderer/FormDecorator.d.ts +1 -2
  296. package/dist/Shared/SmartDraftRenderer/FormDecorator.js +8 -22
  297. package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.d.ts +1 -2
  298. package/dist/Shared/SmartDraftRenderer/SmartDraftRenderer.js +27 -43
  299. package/dist/Shared/Toggle/Toggle.d.ts +5 -14
  300. package/dist/Shared/Toggle/Toggle.js +29 -32
  301. package/dist/States/GlobalSlice.d.ts +7 -12
  302. package/dist/States/GlobalSlice.js +6 -22
  303. package/dist/States/SiteSlice.d.ts +30 -48
  304. package/dist/States/SiteSlice.js +58 -76
  305. package/dist/States/WidthStatsSlice.d.ts +2 -2
  306. package/dist/States/WidthStatsSlice.js +8 -9
  307. package/dist/Utils/AxiosAPI.d.ts +4 -5
  308. package/dist/Utils/AxiosAPI.js +23 -73
  309. package/dist/Utils/AxiosWidget.js +4 -4
  310. package/dist/Utils/CBRFunctions.js +29 -30
  311. package/dist/Utils/DraftFunctions.d.ts +3 -3
  312. package/dist/Utils/DraftFunctions.js +102 -143
  313. package/dist/Utils/FormStepFunctions.d.ts +1 -1
  314. package/dist/Utils/FormStepFunctions.js +27 -45
  315. package/dist/Utils/LocaleUtils.d.ts +2 -0
  316. package/dist/Utils/LocaleUtils.js +12 -0
  317. package/dist/Utils/MaterialProviders.d.ts +21 -1
  318. package/dist/Utils/MaterialProviders.js +46 -28
  319. package/dist/Utils/MuiClassnameSetup.d.ts +1 -0
  320. package/dist/Utils/MuiClassnameSetup.js +3 -0
  321. package/dist/Utils/PhoneFunctions.js +5 -5
  322. package/dist/Utils/StoreContext.js +1 -1
  323. package/dist/Utils/TestUtils.d.ts +60 -81
  324. package/dist/Utils/TestUtils.js +28 -57
  325. package/dist/Utils/_api.d.ts +7 -7
  326. package/dist/Utils/_api.js +10 -8
  327. package/dist/Utils/store.d.ts +9 -17
  328. package/dist/Utils/store.js +15 -74
  329. package/dist/Widget.d.ts +1 -1
  330. package/dist/Widget.js +16 -26
  331. package/dist/constants/Draft/DraftEntityDataTypes.d.ts +3 -3
  332. package/dist/constants/{IconTypes.d.ts → ErkIconTypes.d.ts} +2 -4
  333. package/dist/constants/ErkIconTypes.js +16 -0
  334. package/dist/constants/Files/FileExtensions.js +3 -3
  335. package/dist/constants/Files/FileMaxSize.js +1 -1
  336. package/dist/constants/FormStepTypes.d.ts +2 -2
  337. package/dist/constants/FormStepTypes.js +1 -1
  338. package/dist/constants/InternalFormStyle.js +1 -1
  339. package/dist/hooks.d.ts +0 -3
  340. package/dist/hooks.js +14 -77
  341. package/dist/index.css +15 -0
  342. package/dist/index.lib.d.ts +0 -1
  343. package/dist/index.lib.js +0 -1
  344. package/dist/main.d.ts +3 -0
  345. package/dist/main.js +25 -0
  346. package/package.json +72 -93
  347. package/dist/@Types/ErkValue.d.ts +0 -16
  348. package/dist/@Types/User.d.ts +0 -13
  349. package/dist/Icons/@IconTypes.d.ts +0 -7
  350. package/dist/Icons/EmailIcon.d.ts +0 -4
  351. package/dist/Icons/EmailIcon.js +0 -17
  352. package/dist/Icons/Entities/SchoolIcon.d.ts +0 -2
  353. package/dist/Icons/Entities/SchoolIcon.js +0 -17
  354. package/dist/Icons/GroupIcon.d.ts +0 -4
  355. package/dist/Icons/GroupIcon.js +0 -17
  356. package/dist/Icons/LockedIcon.d.ts +0 -4
  357. package/dist/Icons/LockedIcon.js +0 -17
  358. package/dist/Login/Login.module.css +0 -135
  359. package/dist/Login/LoginLayout.module.css +0 -68
  360. package/dist/Login/LoginPage.d.ts +0 -11
  361. package/dist/Login/LoginPage.js +0 -177
  362. package/dist/Login/LoginTextField.d.ts +0 -15
  363. package/dist/Login/LoginTextField.js +0 -134
  364. package/dist/Services/IntegrationService.d.ts +0 -21
  365. package/dist/Services/IntegrationService.js +0 -69
  366. package/dist/Services/UserService.d.ts +0 -10
  367. package/dist/Services/UserService.js +0 -71
  368. package/dist/Shared/RoundedButton/RoundedButton.d.ts +0 -30
  369. package/dist/Shared/RoundedButton/RoundedButton.js +0 -45
  370. package/dist/Shared/RoundedButton/RoundedButton.stories.d.ts +0 -23
  371. package/dist/Shared/RoundedButton/RoundedButton.stories.js +0 -36
  372. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.d.ts +0 -24
  373. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.js +0 -101
  374. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.d.ts +0 -21
  375. package/dist/Shared/RoundedCheckBox/RoundedCheckBox.stories.js +0 -50
  376. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.d.ts +0 -49
  377. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.js +0 -351
  378. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.d.ts +0 -36
  379. package/dist/Shared/RoundedDatePicker/RoundedDatePicker.stories.js +0 -223
  380. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.d.ts +0 -43
  381. package/dist/Shared/RoundedPhoneInput/RoundedPhoneInput.js +0 -226
  382. package/dist/Shared/RoundedSelect/RoundedSelect.d.ts +0 -68
  383. package/dist/Shared/RoundedSelect/RoundedSelect.js +0 -214
  384. package/dist/Shared/RoundedSelect/RoundedSelect.stories.d.ts +0 -28
  385. package/dist/Shared/RoundedSelect/RoundedSelect.stories.js +0 -91
  386. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.d.ts +0 -63
  387. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.js +0 -236
  388. package/dist/Shared/RoundedSmartSelect/RoundedSmartSelect.stories.js +0 -318
  389. package/dist/Shared/RoundedTextField/RoundedTextField.d.ts +0 -45
  390. package/dist/Shared/RoundedTextField/RoundedTextField.js +0 -175
  391. package/dist/Shared/RoundedTextField/RoundedTextField.stories.js +0 -224
  392. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.d.ts +0 -41
  393. package/dist/Shared/RoundedTimePicker/RoundedTimePicker.js +0 -314
  394. package/dist/Shared/SmartDraftRenderer/LinkDecorator.d.ts +0 -14
  395. package/dist/Shared/SmartDraftRenderer/LinkDecorator.js +0 -60
  396. package/dist/__mocks__/axios.d.ts +0 -2
  397. package/dist/__mocks__/axios.js +0 -2
  398. package/dist/constants/ErkValueTypes.d.ts +0 -6
  399. package/dist/constants/ErkValueTypes.js +0 -7
  400. package/dist/constants/IconTypes.js +0 -18
  401. package/dist/constants/MaterialClassNameSeed.d.ts +0 -1
  402. package/dist/constants/MaterialClassNameSeed.js +0 -1
  403. package/dist/index.js +0 -31
  404. /package/dist/{@Types/ErkValue.js → App/AppFunctions.test.d.ts} +0 -0
  405. /package/dist/{@Types/User.js → App/AppHooks.test.d.ts} +0 -0
  406. /package/dist/{Icons/@IconTypes.js → Form/FormFunctions.test.d.ts} +0 -0
  407. /package/dist/{index.d.ts → FormSteps/StepFunctions.test.d.ts} +0 -0
  408. /package/dist/Shared/{RoundedTimePicker/RoundedTimePicker.module.css → ErkTimePicker/ErkTimePicker.module.css} +0 -0
  409. /package/dist/{setupTests.d.ts → __tests__/setup.d.ts} +0 -0
  410. /package/dist/{setupTests.js → __tests__/setup.js} +0 -0
@@ -0,0 +1,274 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import ErkDatePickerRange from './ErkDatePickerRange';
3
+ import { useArgs } from 'storybook/internal/preview-api';
4
+ import { useState } from 'react';
5
+ const meta = {
6
+ component: ErkDatePickerRange,
7
+ tags: ['autodocs'],
8
+ args: {
9
+ readOnly: false,
10
+ },
11
+ parameters: {
12
+ dateRange: [new Date('2021-07-01'), new Date('2021-07-21')],
13
+ },
14
+ };
15
+ export default meta;
16
+ export const Empty = {
17
+ args: {
18
+ label: 'Seleccionar Rango',
19
+ value: [null, null],
20
+ },
21
+ };
22
+ export const Default = {
23
+ args: {
24
+ label: 'Rango de Fechas',
25
+ value: [new Date('2021-07-01'), new Date('2021-07-21')],
26
+ },
27
+ render: function Component(args) {
28
+ const [value, setValue] = useState(args.value ?? [null, null]);
29
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
30
+ },
31
+ };
32
+ export const Interactive = {
33
+ args: {
34
+ label: 'Rango Interactivo',
35
+ value: [null, null],
36
+ helperText: 'Seleccione un rango de fechas',
37
+ },
38
+ render: function Component(args) {
39
+ const [value, setValue] = useState(args.value ?? [null, null]);
40
+ const handleChange = (newValue) => {
41
+ setValue(newValue);
42
+ args.onChange?.(newValue);
43
+ };
44
+ return (_jsxs("div", { children: [_jsx(ErkDatePickerRange, { ...args, value: value, onChange: handleChange }), _jsxs("div", { style: { marginTop: '20px', fontSize: '14px' }, children: [_jsx("strong", { children: "Valor seleccionado:" }), _jsxs("div", { children: ["Inicio: ", value[0]?.toLocaleDateString('es-ES') ?? 'No seleccionado'] }), _jsxs("div", { children: ["Fin: ", value[1]?.toLocaleDateString('es-ES') ?? 'No seleccionado'] })] })] }));
45
+ },
46
+ };
47
+ export const ValueAndLabel = {
48
+ args: {
49
+ label: 'Rango de Fechas',
50
+ value: [null, null],
51
+ },
52
+ render: function Component(args) {
53
+ const [, setArgs] = useArgs();
54
+ const onValueChange = (value) => {
55
+ args.onChange?.(value);
56
+ setArgs({ value });
57
+ };
58
+ return _jsx(ErkDatePickerRange, { ...args, onChange: onValueChange });
59
+ },
60
+ };
61
+ export const Full = {
62
+ args: {
63
+ label: 'Rango de Fechas',
64
+ value: [null, null],
65
+ helperText: 'Seleccione un rango de fechas',
66
+ },
67
+ render: function Component(args) {
68
+ const [value, setValue] = useState(args.value ?? [null, null]);
69
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
70
+ },
71
+ };
72
+ export const Error = {
73
+ args: {
74
+ label: 'Rango de Fechas',
75
+ value: [null, null],
76
+ helperText: 'Error: Rango de fechas inválido',
77
+ error: true,
78
+ },
79
+ render: function Component(args) {
80
+ const [value, setValue] = useState(args.value ?? [null, null]);
81
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
82
+ },
83
+ };
84
+ export const Menu = {
85
+ args: {
86
+ label: 'Rango de Fechas',
87
+ value: [null, null],
88
+ },
89
+ render: function Component(args) {
90
+ const [value, setValue] = useState(args.value ?? [null, null]);
91
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
92
+ },
93
+ play: async ({ canvas, userEvent }) => {
94
+ const selector = canvas.getByTestId('date-picker');
95
+ await userEvent.click(selector);
96
+ },
97
+ };
98
+ export const WithSelectedRange = {
99
+ args: {
100
+ label: 'Vacaciones',
101
+ value: [new Date('2024-12-20'), new Date('2025-01-05')],
102
+ helperText: 'Período de vacaciones',
103
+ },
104
+ render: function Component(args) {
105
+ const [, setArgs] = useArgs();
106
+ const onValueChange = (value) => {
107
+ args.onChange?.(value);
108
+ setArgs({ value });
109
+ };
110
+ return _jsx(ErkDatePickerRange, { ...args, onChange: onValueChange });
111
+ },
112
+ };
113
+ export const Disabled = {
114
+ args: {
115
+ label: 'Rango de Fechas',
116
+ value: [new Date('2021-07-01'), new Date('2021-07-21')],
117
+ disabled: true,
118
+ helperText: 'Campo deshabilitado',
119
+ },
120
+ render: function Component(args) {
121
+ const [value, setValue] = useState(args.value ?? [null, null]);
122
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
123
+ },
124
+ };
125
+ export const ReadOnly = {
126
+ args: {
127
+ label: 'Rango de Fechas',
128
+ value: [new Date('2021-07-01'), new Date('2021-07-21')],
129
+ readOnly: true,
130
+ helperText: 'Campo de solo lectura',
131
+ },
132
+ render: function Component(args) {
133
+ const [value, setValue] = useState(args.value ?? [null, null]);
134
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
135
+ },
136
+ };
137
+ export const WithError = {
138
+ args: {
139
+ label: 'Rango de Fechas',
140
+ value: [new Date('2021-07-21'), new Date('2021-07-01')],
141
+ helperText: 'La fecha de inicio debe ser anterior a la fecha de fin',
142
+ error: true,
143
+ },
144
+ render: function Component(args) {
145
+ const [value, setValue] = useState(args.value ?? [null, null]);
146
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
147
+ },
148
+ };
149
+ export const Required = {
150
+ args: {
151
+ label: 'Rango de Fechas',
152
+ value: [null, null],
153
+ helperText: 'Este campo es obligatorio',
154
+ required: true,
155
+ },
156
+ render: function Component(args) {
157
+ const [value, setValue] = useState(args.value ?? [null, null]);
158
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
159
+ },
160
+ };
161
+ export const SmallSize = {
162
+ args: {
163
+ label: 'Rango Pequeño',
164
+ value: [new Date('2021-07-01'), new Date('2021-07-21')],
165
+ size: 'small',
166
+ helperText: 'Tamaño pequeño',
167
+ },
168
+ render: function Component(args) {
169
+ const [value, setValue] = useState(args.value ?? [null, null]);
170
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
171
+ },
172
+ };
173
+ export const MediumSize = {
174
+ args: {
175
+ label: 'Rango Mediano',
176
+ value: [new Date('2021-07-01'), new Date('2021-07-21')],
177
+ size: 'medium',
178
+ helperText: 'Tamaño mediano',
179
+ },
180
+ render: function Component(args) {
181
+ const [value, setValue] = useState(args.value ?? [null, null]);
182
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
183
+ },
184
+ };
185
+ export const CurrentMonth = {
186
+ args: {
187
+ label: 'Mes Actual',
188
+ value: [new Date(2025, 10, 1), new Date(2025, 10, 30)],
189
+ helperText: 'Noviembre 2025',
190
+ },
191
+ render: function Component(args) {
192
+ const [value, setValue] = useState(args.value ?? [null, null]);
193
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
194
+ },
195
+ };
196
+ export const LastWeek = {
197
+ args: {
198
+ label: 'Última Semana',
199
+ value: [new Date(new Date().setDate(new Date().getDate() - 7)), new Date()],
200
+ helperText: 'Últimos 7 días',
201
+ },
202
+ render: function Component(args) {
203
+ const [value, setValue] = useState(args.value ?? [null, null]);
204
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
205
+ },
206
+ };
207
+ export const NextMonth = {
208
+ args: {
209
+ label: 'Próximo Mes',
210
+ value: [
211
+ new Date(new Date().getFullYear(), new Date().getMonth() + 1, 1),
212
+ new Date(new Date().getFullYear(), new Date().getMonth() + 2, 0),
213
+ ],
214
+ helperText: 'Planificación del próximo mes',
215
+ },
216
+ render: function Component(args) {
217
+ const [value, setValue] = useState(args.value ?? [null, null]);
218
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
219
+ },
220
+ };
221
+ export const WithMinMaxDates = {
222
+ args: {
223
+ label: 'Reserva de Hotel',
224
+ value: [null, null],
225
+ helperText: 'Seleccione fechas entre hoy y 3 meses',
226
+ minDate: new Date(),
227
+ maxDate: new Date(new Date().setMonth(new Date().getMonth() + 3)),
228
+ },
229
+ render: function Component(args) {
230
+ const [value, setValue] = useState(args.value ?? [null, null]);
231
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
232
+ },
233
+ };
234
+ export const YearRange = {
235
+ args: {
236
+ label: 'Período Fiscal',
237
+ value: [new Date('2025-01-01'), new Date('2025-12-31')],
238
+ helperText: 'Año fiscal 2025',
239
+ },
240
+ render: function Component(args) {
241
+ const [value, setValue] = useState(args.value ?? [null, null]);
242
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
243
+ },
244
+ };
245
+ export const QuarterRange = {
246
+ args: {
247
+ label: 'Trimestre Q1 2025',
248
+ value: [new Date('2025-01-01'), new Date('2025-03-31')],
249
+ helperText: 'Primer trimestre del año',
250
+ },
251
+ render: function Component(args) {
252
+ const [value, setValue] = useState(args.value ?? [null, null]);
253
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
254
+ },
255
+ };
256
+ export const EventDuration = {
257
+ args: {
258
+ label: 'Duración del Evento',
259
+ value: [new Date('2025-06-15'), new Date('2025-06-18')],
260
+ helperText: 'Conferencia anual (4 días)',
261
+ },
262
+ render: function Component(args) {
263
+ const [value, setValue] = useState(args.value ?? [null, null]);
264
+ return _jsx(ErkDatePickerRange, { ...args, value: value, onChange: setValue });
265
+ },
266
+ };
267
+ export const MultipleStates = {
268
+ render: function Component() {
269
+ const [range1, setRange1] = useState([null, null]);
270
+ const [range2, setRange2] = useState([new Date('2025-01-01'), new Date('2025-01-31')]);
271
+ const [range3, setRange3] = useState([null, null]);
272
+ return (_jsxs("div", { style: { display: 'flex', flexDirection: 'column', gap: '20px' }, children: [_jsx(ErkDatePickerRange, { label: "Fecha de Inicio del Proyecto", value: range1, onChange: setRange1, helperText: "Seleccione el per\u00EDodo del proyecto" }), _jsx(ErkDatePickerRange, { label: "Per\u00EDodo de Pruebas", value: range2, onChange: setRange2, helperText: "Enero 2025" }), _jsx(ErkDatePickerRange, { label: "Fecha de Entrega", value: range3, onChange: setRange3, error: range3[0] === null, helperText: range3[0] === null ? 'Este campo es obligatorio' : 'Fecha confirmada', required: true })] }));
273
+ },
274
+ };
@@ -0,0 +1,4 @@
1
+ declare const Styled: import("@emotion/styled").StyledComponent<import("@mui/material").MenuItemOwnProps & Omit<import("@mui/material").ButtonBaseOwnProps, "classes"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<import("react").DetailedHTMLProps<import("react").LiHTMLAttributes<HTMLLIElement>, HTMLLIElement>, "ref"> & {
2
+ ref?: ((instance: HTMLLIElement | null) => void | import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof import("react").DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | import("react").RefObject<HTMLLIElement> | null | undefined;
3
+ }, "children" | "className" | "style" | "classes" | "autoFocus" | "tabIndex" | "action" | "centerRipple" | "disabled" | "disableRipple" | "disableTouchRipple" | "focusRipple" | "focusVisibleClassName" | "LinkComponent" | "onFocusVisible" | "sx" | "TouchRippleProps" | "touchRippleRef" | "dense" | "disableGutters" | "divider" | "selected"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>, {}, {}>;
4
+ export default Styled;
@@ -0,0 +1,18 @@
1
+ import { MenuItem, styled } from '@mui/material';
2
+ const Styled = styled(MenuItem)(({ theme }) => ({
3
+ padding: '6px 12px',
4
+ whiteSpace: 'normal',
5
+ '& .Erk-MuiMenuItem-root:has(.ErkIcon) ': {
6
+ paddingLeft: '40px',
7
+ '& .ErkIcon': {
8
+ left: 12,
9
+ top: '50%',
10
+ position: 'absolute',
11
+ transform: 'translateY(-50%)',
12
+ fill: theme.palette.primary.main,
13
+ width: '20px',
14
+ height: '20px',
15
+ },
16
+ },
17
+ }));
18
+ export default Styled;
@@ -0,0 +1,17 @@
1
+ import React from 'react';
2
+ import { TextFieldProps as MuiTextFieldProps } from '@mui/material';
3
+ import { ErkTextFieldProps } from '../ErkTextField/ErkTextField';
4
+ export interface ErkPhoneInputProps extends Omit<ErkTextFieldProps, 'onChange' | 'ref'> {
5
+ /** The value of the phoneinput */
6
+ value?: string;
7
+ onChange?: (value: string) => void;
8
+ inputRef?: any;
9
+ readOnly?: boolean;
10
+ }
11
+ /**
12
+ * Generic phoneinput with apps designs. Is class due to the use in the react-hook-forms library
13
+ */
14
+ declare class ErkPhoneInput extends React.Component<ErkPhoneInputProps & Omit<MuiTextFieldProps, 'onChange'>> {
15
+ render(): JSX.Element;
16
+ }
17
+ export default ErkPhoneInput;
@@ -0,0 +1,96 @@
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useMemo } from 'react';
3
+ import parse from 'libphonenumber-js/max';
4
+ import { defaultCountries, FlagImage, parseCountry, usePhoneInput } from 'react-international-phone';
5
+ import isoCountries from 'i18n-iso-countries';
6
+ import es from 'i18n-iso-countries/langs/es.json';
7
+ import { InputAdornment, Select, styled } from '@mui/material';
8
+ import { MenuItem } from '@mui/material';
9
+ import { StyledTextField } from '../ErkTextField/ErkTextField';
10
+ import { useAppSelector } from '../../hooks';
11
+ isoCountries.registerLocale(es);
12
+ const StyledSelect = styled(Select)(() => ({
13
+ padding: 0,
14
+ input: {
15
+ padding: 0,
16
+ },
17
+ '& .Erk-MuiSelect-select': {
18
+ height: '20px',
19
+ },
20
+ '& .Erk-MuiSelect-select.Erk-MuiInputBase-inputSizeSmall': {
21
+ paddingBottom: 0,
22
+ borderBottom: 'none',
23
+ },
24
+ backgroundColor: 'transparent',
25
+ '& input': {
26
+ padding: 0,
27
+ margin: 0,
28
+ },
29
+ '&.Erk-MuiInputBase-root::before': {
30
+ borderBottom: 'none !important',
31
+ },
32
+ '&.Erk-MuiInput-underline::after': {
33
+ borderBottom: 'none',
34
+ },
35
+ '&.Mui-readOnly': {
36
+ '& .Erk-MuiSelect-select': {
37
+ paddingRight: 5,
38
+ },
39
+ '& .Erk-MuiSelect-icon': {
40
+ display: 'none',
41
+ },
42
+ },
43
+ }));
44
+ function CustomPhoneInput({ value, onChange, inputRef, IconComponent, size = 'small', readOnly = false, disabled = false, ...others }) {
45
+ const defaultCountry = useAppSelector((state) => state.global.countryCode);
46
+ const { inputValue, handlePhoneValueChange, inputRef: phoneRef, country, setCountry, } = usePhoneInput({
47
+ value: '+' + value,
48
+ inputRef,
49
+ defaultCountry: (defaultCountry ?? 'CO').toLowerCase(),
50
+ disableDialCodePrefill: true,
51
+ disableDialCodeAndPrefix: true,
52
+ onChange: (data) => onChange?.(data.phone.replace('+', '')),
53
+ });
54
+ const countries = useMemo(() => defaultCountries
55
+ .map((c) => {
56
+ const country = parseCountry(c);
57
+ return {
58
+ country,
59
+ name: isoCountries.getName(country.iso2.toUpperCase(), 'es') ?? country.name,
60
+ };
61
+ })
62
+ .sort((a, b) => a.name.localeCompare(b.name)), []);
63
+ return (_jsx("div", { style: { position: 'relative', width: '100%', maxWidth: '100%' }, children: _jsx(StyledTextField, { ...others, value: inputValue, readOnly: readOnly, disabled: disabled, fullWidth: true, size: size, variant: "outlined", onChange: handlePhoneValueChange, type: "tel", padding: "6px 12px 6px 6px", autoComplete: "tel", inputRef: phoneRef, onPaste: (e) => {
64
+ const value = e.clipboardData.getData('Text');
65
+ if (!value.startsWith('+')) {
66
+ const phone = parse('+' + value);
67
+ if (phone?.isValid()) {
68
+ e.preventDefault();
69
+ if (phone.country)
70
+ setCountry(phone.country.toLowerCase());
71
+ onChange?.(phone.number);
72
+ }
73
+ }
74
+ }, slotProps: {
75
+ input: {
76
+ readOnly,
77
+ disabled: readOnly || disabled,
78
+ startAdornment: (_jsx(InputAdornment, { position: "start", children: _jsx(StyledSelect, { size: 'small', variant: "standard", readOnly: readOnly, value: country.iso2, inputProps: { readOnly, disabled: readOnly || disabled }, onChange: (e) => setCountry(e.target.value), renderValue: (value) => (_jsx(FlagImage, { iso2: value, style: { display: 'flex' }, width: 20 })), children: countries.map(({ country, name }) => {
79
+ return (_jsxs(MenuItem, { value: country.iso2, children: [_jsx(FlagImage, { iso2: country.iso2, size: 20 }), _jsx("span", { style: {
80
+ marginLeft: '8px',
81
+ marginRight: '8px',
82
+ }, children: name }), _jsxs("span", { style: { color: 'grey' }, children: ["+", country.dialCode] })] }, country.iso2));
83
+ }) }) })),
84
+ endAdornment: IconComponent,
85
+ },
86
+ } }) }));
87
+ }
88
+ /**
89
+ * Generic phoneinput with apps designs. Is class due to the use in the react-hook-forms library
90
+ */
91
+ class ErkPhoneInput extends React.Component {
92
+ render() {
93
+ return _jsx(CustomPhoneInput, { ...this.props });
94
+ }
95
+ }
96
+ export default ErkPhoneInput;
@@ -0,0 +1,52 @@
1
+ import React from 'react';
2
+ import { SelectProps as MuiSelectProps } from '@mui/material';
3
+ export interface SelectorStyleProps {
4
+ /** If input is readOnly */
5
+ readOnly?: boolean;
6
+ }
7
+ export declare const StyledSelect: import("@emotion/styled").StyledComponent<(import("@mui/material").FilledSelectProps & import("@mui/material").BaseSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>) | (import("@mui/material").StandardSelectProps & import("@mui/material").BaseSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>) | (import("@mui/material").OutlinedSelectProps & import("@mui/material").BaseSelectProps<unknown> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme>), {}, {}>;
8
+ export declare const StyledInputLabel: import("@emotion/styled").StyledComponent<import("@mui/material").InputLabelOwnProps & Pick<import("@mui/material").FormLabelOwnProps, "color" | "filled"> & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.LabelHTMLAttributes<HTMLLabelElement>, HTMLLabelElement>, "ref"> & {
9
+ ref?: ((instance: HTMLLabelElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLLabelElement> | null | undefined;
10
+ }, "required" | "size" | "color" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused" | "disableAnimation" | "shrink"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
11
+ component?: React.ElementType;
12
+ } & {
13
+ open: boolean;
14
+ }, {}, {}>;
15
+ export declare const StyledHelperText: import("@emotion/styled").StyledComponent<import("@mui/material").FormHelperTextOwnProps & import("@mui/material/OverridableComponent").CommonProps & Omit<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref"> & {
16
+ ref?: ((instance: HTMLParagraphElement | null) => void | React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES[keyof React.DO_NOT_USE_OR_YOU_WILL_BE_FIRED_CALLBACK_REF_RETURN_VALUES]) | React.RefObject<HTMLParagraphElement> | null | undefined;
17
+ }, "required" | "children" | "className" | "style" | "classes" | "disabled" | "sx" | "margin" | "error" | "filled" | "variant" | "focused"> & import("@mui/system").MUIStyledCommonProps<import("@mui/material").Theme> & {
18
+ component?: React.ElementType;
19
+ }, {}, {}>;
20
+ export type ErkSelectValue<Type extends string | number, Multiple, Clearable> = Multiple extends true ? Type[] : Clearable extends true ? Type | undefined : Type;
21
+ export interface ErkSelectProps<Type extends string | number = string, Multiple extends boolean | undefined = false, Clearable extends boolean | undefined = true> extends Omit<MuiSelectProps, 'color' | 'onChange' | 'ref'>, SelectorStyleProps {
22
+ /** if selecting multiple values */
23
+ multiple?: Multiple;
24
+ /** If the usar can clear the value */
25
+ clearable?: Clearable;
26
+ /** If the input is loading */
27
+ loading?: boolean;
28
+ /** children to display in the options */
29
+ children?: React.ReactNode;
30
+ /** Currently selected value */
31
+ value?: ErkSelectValue<Type, Multiple, Clearable>;
32
+ onChange?: (value: ErkSelectValue<Type, Multiple, Clearable>) => void;
33
+ /** String to place in the label */
34
+ label?: string;
35
+ /** The helper Text to display */
36
+ helperText?: string;
37
+ /** Label to display on clearable */
38
+ clearLabel?: string;
39
+ /** labelMargin */
40
+ labelMargin?: number;
41
+ }
42
+ export type CustomErkSelectOnChangeType<ChangeType, Multiple extends boolean | undefined, Clearable extends boolean | undefined> = Multiple extends true ? ChangeType[] : Clearable extends true ? ChangeType | undefined : ChangeType;
43
+ export interface CustomErkSelectProps<ValueType extends string | number = string, ChangeType = any, Multiple extends boolean | undefined = false, Clearable extends boolean | undefined = true> extends Omit<ErkSelectProps<ValueType, Multiple, Clearable>, 'onChange'> {
44
+ onChange?: (value: CustomErkSelectOnChangeType<ChangeType, Multiple, Clearable>) => void;
45
+ }
46
+ /**
47
+ * Generic textfield with apps designs. Is class due to the use in the react-hook-forms library
48
+ */
49
+ declare class ErkSelect<Type extends string | number = string, Multiple extends boolean | undefined = false, Clearable extends boolean | undefined = true> extends React.Component<ErkSelectProps<Type, Multiple, Clearable>> {
50
+ render(): JSX.Element;
51
+ }
52
+ export default ErkSelect;
@@ -0,0 +1,141 @@
1
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
2
+ import React, { useCallback, useState } from 'react';
3
+ import { FormControl, FormHelperText as MuiFormHelperText, InputLabel as MuiInputLabel, Select as MuiSelect, styled, InputAdornment, } from '@mui/material';
4
+ import ErkMenuItem from '../ErkMenuItem';
5
+ export const StyledSelect = styled(MuiSelect)(({ theme, size, ...props }) => ({
6
+ borderRadius: 10,
7
+ opacity: props.disabled ? 0.5 : 1,
8
+ backgroundColor: theme.palette.stepBackgroundColor.default,
9
+ minHeight: size === 'small' ? 31 : size === 'medium' ? 40 : undefined,
10
+ '&.Erk-MuiInputBase-adornedEnd': {
11
+ paddingRight: 7,
12
+ },
13
+ '& .Erk-MuiSelect-select': {
14
+ fontSize: '1rem',
15
+ padding: '6px 12px',
16
+ lineHeight: size === 'small' ? '1.188em' : size === 'medium' ? '1.75em' : undefined,
17
+ height: size === 'small' ? '1.188em' : size === 'medium' ? '1.75em' : undefined,
18
+ '&.Erk-MuiInputBase-inputAdornedEnd': {
19
+ paddingRight: '0px !important',
20
+ },
21
+ whiteSpace: 'nowrap',
22
+ overflow: 'hidden',
23
+ textOverflow: 'ellipsis',
24
+ },
25
+ '& .Erk-MuiOutlinedInput-notchedOutline': {
26
+ borderColor: theme.palette.outline.main,
27
+ },
28
+ '&:hover:not(.Mui-readOnly) .Erk-MuiOutlinedInput-notchedOutline': {
29
+ borderColor: props.disabled || props.readOnly ? theme.palette.outline.main : theme.palette.primary.main,
30
+ },
31
+ '&.Mui-readOnly': {
32
+ '& .Erk-MuiSelect-select': {
33
+ color: theme.palette.text.primary,
34
+ WebkitTextFillColor: theme.palette.text.primary,
35
+ },
36
+ '& .Erk-MuiSelect-icon': {
37
+ color: theme.palette.text.primary + 'a0',
38
+ },
39
+ },
40
+ '& .Mui-disabled, &.Mui-readOnly': {
41
+ cursor: 'default',
42
+ },
43
+ '&.Erk-MuiInputBase-root.Mui-focused': {
44
+ '& .Erk-MuiOutlinedInput-notchedOutline': {
45
+ borderColor: theme.palette.primary.main,
46
+ borderWidth: 2,
47
+ },
48
+ },
49
+ '& .Erk-MuiInputAdornment-root': {
50
+ marginLeft: 0,
51
+ marginRight: size === 'medium' ? 2 : 0,
52
+ color: theme.palette.text.primary + 'a0',
53
+ fill: theme.palette.text.primary + 'a0',
54
+ cursor: props.disabled || props.readOnly ? 'default' : 'pointer',
55
+ },
56
+ '& .Erk-MuiSelect-iconOpen': {
57
+ transform: props.IconComponent ? 'none' : undefined,
58
+ },
59
+ '& .Erk-MuiInputBase-input:has(.ErkIcon) ': {
60
+ paddingLeft: 40,
61
+ '& .ErkIcon': {
62
+ left: 12,
63
+ top: '50%',
64
+ position: 'absolute',
65
+ transform: 'translateY(-50%)',
66
+ fill: theme.palette.primary.main,
67
+ width: '20px',
68
+ height: '20px',
69
+ },
70
+ },
71
+ }));
72
+ export const StyledInputLabel = styled(MuiInputLabel)(({ theme, size = 'small', ...props }) => ({
73
+ color: theme.palette.text.primary + '8a',
74
+ '&.Erk-MuiInputLabel-root.Mui-focused': {
75
+ color: theme.palette.primary.main,
76
+ },
77
+ '&.Erk-MuiFormLabel-root:not(.Erk-MuiInputLabel-shrink)': {
78
+ transform: `translate(12px, ${size === 'small' ? 5 : 9}px) scale(1)`,
79
+ maxWidth: 'calc(100% - 40px)',
80
+ },
81
+ '&.Mui-error': {
82
+ color: theme.palette.error.main,
83
+ },
84
+ opacity: props.disabled ? 0.5 : 1,
85
+ }));
86
+ export const StyledHelperText = styled(MuiFormHelperText)(({ theme, ...props }) => ({
87
+ color: theme.palette.helperText.primary,
88
+ overflow: 'hidden',
89
+ textOverflow: 'ellipsis',
90
+ opacity: props.disabled ? 0.5 : 1,
91
+ '&.Mui-error': {
92
+ color: theme.palette.error.main,
93
+ },
94
+ }));
95
+ function CustomSelect({ label, error, value, loading, onChange, children, required, inputRef, MenuProps, helperText, IconComponent, size = 'small', labelMargin = 5, multiple = false, readOnly = false, disabled = false, clearable = true, fullWidth = true, clearLabel = 'Sin Seleccionar', ...others }) {
96
+ const [open, setOpen] = useState(false);
97
+ const handleChange = useCallback((event) => onChange?.(event.target.value), [onChange]);
98
+ return (_jsxs(FormControl, { size: size, error: error, variant: "outlined", required: required, fullWidth: fullWidth, style: { marginTop: label ? labelMargin : undefined, maxWidth: '100%' }, children: [label && (_jsx(StyledInputLabel, { disabled: disabled, open: open, size: size === 'small' ? 'small' : undefined, children: label })), _jsxs(StyledSelect, { ...others, size: size, autoWidth: false, open: others.open ?? open, label: label, inputRef: inputRef, readOnly: readOnly, disabled: disabled, multiple: multiple, onChange: handleChange, value: value ?? (multiple ? [] : ''), IconComponent: IconComponent ? () => _jsx(_Fragment, {}) : undefined, endAdornment: IconComponent ? (_jsx(InputAdornment, { position: "end", onClick: (e) => {
99
+ e.stopPropagation();
100
+ if (!readOnly && !disabled) {
101
+ if (others.open !== undefined) {
102
+ if (others.open)
103
+ others.onClose?.(e);
104
+ else
105
+ others.onOpen?.(e);
106
+ }
107
+ else
108
+ setOpen((open) => !open);
109
+ }
110
+ }, children: _jsx(IconComponent, { size: size === 'small' ? 22 : 26 }) })) : undefined, onFocus: (e) => {
111
+ if (!e.relatedTarget?.closest('.Erk-MuiPaper-root')) {
112
+ setOpen(true);
113
+ }
114
+ others.onFocus?.(e);
115
+ }, MenuProps: {
116
+ disablePortal: true,
117
+ sx: (theme) => ({
118
+ '& .Erk-MuiMenuItem-root:has(.ErkIcon) ': {
119
+ gap: '10px',
120
+ padding: '6px 12px',
121
+ display: 'flex',
122
+ maxWidth: '100%',
123
+ alignItems: 'center',
124
+ '& .ErkIcon': {
125
+ width: '20px',
126
+ fill: theme.palette.primary.main,
127
+ },
128
+ },
129
+ }),
130
+ ...MenuProps,
131
+ }, onOpen: others.onOpen ?? (() => setOpen(true)), onClose: others.onClose ?? (() => setOpen(false)), inputProps: { disabled: readOnly || disabled }, children: [((clearable && !multiple) || loading) && (_jsx(ErkMenuItem, { value: '', "data-testid": 'smart-select-empty', style: { whiteSpace: 'normal' }, children: _jsx("em", { children: loading ? 'Cargando...' : clearLabel }) }, 'EMPTY')), children] }), helperText && _jsx(StyledHelperText, { disabled: disabled, children: helperText })] }));
132
+ }
133
+ /**
134
+ * Generic textfield with apps designs. Is class due to the use in the react-hook-forms library
135
+ */
136
+ class ErkSelect extends React.Component {
137
+ render() {
138
+ return _jsx(CustomSelect, { ...this.props });
139
+ }
140
+ }
141
+ export default ErkSelect;
@@ -0,0 +1,21 @@
1
+ import type { StoryObj } from '@storybook/react-vite';
2
+ import ErkSelect from './ErkSelect';
3
+ declare const meta: {
4
+ component: typeof ErkSelect;
5
+ tags: string[];
6
+ args: {
7
+ readOnly: false;
8
+ MenuProps: {
9
+ disablePortal: false;
10
+ };
11
+ };
12
+ };
13
+ export default meta;
14
+ type Story = StoryObj<typeof meta>;
15
+ export declare const Default: Story;
16
+ export declare const Empty: Story;
17
+ export declare const ValueAndLabel: Story;
18
+ export declare const Full: Story;
19
+ export declare const Error: Story;
20
+ export declare const ErrorColor: Story;
21
+ export declare const DifferentColors: Story;