@envisiongroup/porygon 1.0.0-rc.9 → 1.0.0

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 (251) hide show
  1. package/README.md +50 -14
  2. package/dist/index.d.ts +9 -15
  3. package/dist/index.js +95 -55
  4. package/dist/react-components/buttons/EFWButton/EFWButton.d.ts +1 -1
  5. package/dist/react-components/buttons/EFWButton/EFWButton.hooks.js +32 -31
  6. package/dist/react-components/buttons/EFWButton/EFWButton.js +158 -90
  7. package/dist/react-components/buttons/EFWButton/EFWButton.types.d.ts +32 -6
  8. package/dist/react-components/buttons/EFWButton/index.d.ts +1 -1
  9. package/dist/react-components/buttons/EFWDrawerButton/EFWDrawerButton.d.ts +1 -1
  10. package/dist/react-components/buttons/EFWDrawerButton/EFWDrawerButton.types.d.ts +1 -1
  11. package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.d.ts +1 -63
  12. package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.js +120 -85
  13. package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.types.d.ts +7 -1
  14. package/dist/react-components/buttons/EFWGroupButton/index.d.ts +1 -1
  15. package/dist/react-components/commons/caretPositioning.d.ts +35 -0
  16. package/dist/react-components/commons/caretPositioning.js +28 -0
  17. package/dist/react-components/commons/utils.d.ts +1 -1
  18. package/dist/react-components/commons/utils.js +1 -1
  19. package/dist/react-components/commons/valueNormalization.d.ts +28 -0
  20. package/dist/react-components/commons/valueNormalization.js +6 -0
  21. package/dist/react-components/fields/Attachments/EFWAttachments.js +205 -0
  22. package/dist/react-components/fields/{EFWAttachments → Attachments}/EFWAttachments.types.d.ts +32 -2
  23. package/dist/react-components/fields/Attachments/EFWAttachments.utils.d.ts +8 -0
  24. package/dist/react-components/fields/Attachments/EFWAttachments.utils.js +4 -0
  25. package/dist/react-components/fields/{EFWAttachments/EFWAttachmentsCard → Attachments}/EFWAttachmentsCard.d.ts +2 -11
  26. package/dist/react-components/fields/Attachments/EFWAttachmentsCard.js +164 -0
  27. package/dist/react-components/fields/{EFWAttachments/EFWAttachmentsCard → Attachments}/EFWAttachmentsCard.types.d.ts +21 -1
  28. package/dist/react-components/fields/Attachments/EFWAttachmentsField.js +70 -0
  29. package/dist/react-components/fields/{EFWAttachmentsField → Attachments}/EFWAttachmentsField.types.d.ts +2 -2
  30. package/dist/react-components/fields/Attachments/index.d.ts +5 -0
  31. package/dist/react-components/fields/Attachments/index.js +8 -0
  32. package/dist/react-components/fields/{EFWDatePicker → DatePicker}/EFWDatePicker.d.ts +1 -3
  33. package/dist/react-components/fields/DatePicker/EFWDatePicker.js +134 -0
  34. package/dist/react-components/fields/{EFWDatePicker → DatePicker}/EFWDatePicker.types.d.ts +19 -7
  35. package/dist/react-components/fields/DatePicker/EFWDatePicker.utils.d.ts +19 -0
  36. package/dist/react-components/fields/DatePicker/EFWDatePicker.utils.js +179 -0
  37. package/dist/react-components/fields/DatePicker/EFWDatePickerField.js +251 -0
  38. package/dist/react-components/fields/DatePicker/EFWDatePickerField.types.d.ts +15 -0
  39. package/dist/react-components/fields/DatePicker/index.d.ts +6 -0
  40. package/dist/react-components/fields/DatePicker/index.js +11 -0
  41. package/dist/react-components/fields/Input/EFWInput.d.ts +10 -0
  42. package/dist/react-components/fields/Input/EFWInput.js +260 -0
  43. package/dist/react-components/fields/{EFWInput → Input}/EFWInput.types.d.ts +120 -25
  44. package/dist/react-components/fields/Input/EFWInput.utils.d.ts +101 -0
  45. package/dist/react-components/fields/Input/EFWInput.utils.js +222 -0
  46. package/dist/react-components/fields/Input/EFWInput.validation.d.ts +20 -0
  47. package/dist/react-components/fields/Input/EFWInput.validation.js +72 -0
  48. package/dist/react-components/fields/Input/EFWInputField.js +86 -0
  49. package/dist/react-components/fields/{EFWInputField → Input}/EFWInputField.types.d.ts +2 -2
  50. package/dist/react-components/fields/Input/index.d.ts +5 -0
  51. package/dist/react-components/fields/Input/index.js +8 -0
  52. package/dist/react-components/fields/NumberInput/EFWNumberInput.js +339 -0
  53. package/dist/react-components/fields/{EFWNumberInput → NumberInput}/EFWNumberInput.types.d.ts +33 -14
  54. package/dist/react-components/fields/{EFWNumberInput → NumberInput}/EFWNumberInput.utils.d.ts +20 -14
  55. package/dist/react-components/fields/NumberInput/EFWNumberInput.utils.js +86 -0
  56. package/dist/react-components/fields/NumberInput/EFWNumberInputField.js +84 -0
  57. package/dist/react-components/fields/{EFWNumberInputField → NumberInput}/EFWNumberInputField.types.d.ts +2 -2
  58. package/dist/react-components/fields/NumberInput/index.d.ts +5 -0
  59. package/dist/react-components/fields/NumberInput/index.js +8 -0
  60. package/dist/react-components/fields/Switch/EFWSwitch.js +75 -0
  61. package/dist/react-components/fields/{EFWSwitch → Switch}/EFWSwitch.types.d.ts +18 -10
  62. package/dist/react-components/fields/Switch/EFWSwitch.utils.d.ts +9 -0
  63. package/dist/react-components/fields/Switch/EFWSwitch.utils.js +4 -0
  64. package/dist/react-components/fields/Switch/EFWSwitchField.js +62 -0
  65. package/dist/react-components/fields/{EFWSwitchField → Switch}/EFWSwitchField.types.d.ts +6 -2
  66. package/dist/react-components/fields/Switch/index.d.ts +5 -0
  67. package/dist/react-components/fields/Switch/index.js +8 -0
  68. package/dist/react-components/fields/TagPicker/EFWTagPicker.js +384 -0
  69. package/dist/react-components/fields/{EFWTagPicker → TagPicker}/EFWTagPicker.types.d.ts +30 -17
  70. package/dist/react-components/fields/TagPicker/EFWTagPicker.utils.d.ts +6 -0
  71. package/dist/react-components/fields/TagPicker/EFWTagPicker.utils.js +4 -0
  72. package/dist/react-components/fields/TagPicker/EFWTagPickerField.js +83 -0
  73. package/dist/react-components/fields/{EFWTagPickerField → TagPicker}/EFWTagPickerField.types.d.ts +2 -2
  74. package/dist/react-components/fields/TagPicker/index.d.ts +5 -0
  75. package/dist/react-components/fields/TagPicker/index.js +8 -0
  76. package/dist/react-components/fields/TextArea/EFWTextArea.js +153 -0
  77. package/dist/react-components/fields/{EFWTextArea → TextArea}/EFWTextArea.types.d.ts +26 -8
  78. package/dist/react-components/fields/TextArea/EFWTextArea.utils.d.ts +6 -0
  79. package/dist/react-components/fields/TextArea/EFWTextArea.utils.js +4 -0
  80. package/dist/react-components/fields/TextArea/EFWTextAreaField.js +80 -0
  81. package/dist/react-components/fields/{EFWTextAreaField → TextArea}/EFWTextAreaField.types.d.ts +2 -2
  82. package/dist/react-components/fields/TextArea/index.d.ts +5 -0
  83. package/dist/react-components/fields/TextArea/index.js +8 -0
  84. package/dist/react-components/fields/_shared/EFWField/EFWField.js +119 -0
  85. package/dist/react-components/fields/{EFWField → _shared/EFWField}/EFWField.types.d.ts +24 -13
  86. package/dist/react-components/fields/_shared/EFWField/EFWField.utils.js +20 -0
  87. package/dist/react-components/fields/_shared/EFWField/useSyncedValidationState.d.ts +50 -0
  88. package/dist/react-components/fields/_shared/EFWField/useSyncedValidationState.js +41 -0
  89. package/dist/react-components/fields/test-utils/testUtils.js +10 -0
  90. package/dist/react-components/forms/EFWForm/EFWForm.converter.d.ts +16 -1
  91. package/dist/react-components/forms/EFWForm/EFWForm.converter.js +51 -20
  92. package/dist/react-components/forms/EFWForm/EFWForm.flatConverter.d.ts +130 -0
  93. package/dist/react-components/forms/EFWForm/EFWForm.flatConverter.js +279 -0
  94. package/dist/react-components/forms/EFWForm/EFWForm.hooks.js +21 -18
  95. package/dist/react-components/forms/EFWForm/EFWForm.js +866 -403
  96. package/dist/react-components/forms/EFWForm/EFWForm.types.d.ts +213 -89
  97. package/dist/react-components/forms/EFWForm/EFWForm.utils.d.ts +10 -5
  98. package/dist/react-components/forms/EFWForm/EFWForm.utils.js +356 -229
  99. package/dist/react-components/forms/EFWForm/index.d.ts +5 -2
  100. package/dist/react-components/forms/EFWForm/index.js +10 -6
  101. package/dist/react-components/forms/EFWFormMessageBarGroup/EFWFormMessageBarGroup.js +55 -55
  102. package/dist/react-components/forms/EFWMessageBarManager/EFWMessageBarManager.js +38 -29
  103. package/dist/react-components/hooks/useDrawer/component/EFWDrawer/EFWDrawer.js +49 -47
  104. package/dist/react-components/hooks/useDrawer/component/EFWDrawer/EFWDrawer.types.d.ts +1 -0
  105. package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/EFWDrawerLoader.d.ts +5 -3
  106. package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/EFWDrawerLoader.js +6 -6
  107. package/dist/react-components/hooks/useDrawer/index.d.ts +1 -1
  108. package/dist/react-components/hooks/useDrawer/useDrawer.d.ts +4 -2
  109. package/dist/react-components/hooks/useDrawer/useDrawer.js +216 -111
  110. package/dist/react-components/hooks/useDrawer/useDrawer.types.d.ts +15 -2
  111. package/dist/react-components/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +42 -0
  112. package/dist/react-components/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +5 -0
  113. package/dist/react-components/i18n/PorygonI18nProvider.d.ts +13 -0
  114. package/dist/react-components/i18n/PorygonI18nProvider.js +145 -0
  115. package/dist/react-components/i18n/defaultLocaleText.d.ts +6 -0
  116. package/dist/react-components/i18n/defaultLocaleText.js +176 -0
  117. package/dist/react-components/i18n/index.d.ts +4 -0
  118. package/dist/react-components/i18n/index.js +19 -0
  119. package/dist/react-components/i18n/localePresets.d.ts +10 -0
  120. package/dist/react-components/i18n/localePresets.js +366 -0
  121. package/dist/react-components/i18n/porygonI18n.types.d.ts +169 -0
  122. package/dist/react-components/layout/MainNavItems/MainNavItems.js +13 -13
  123. package/dist/react-components/tables/EFWTable/EFWTable.d.ts +2 -5
  124. package/dist/react-components/tables/EFWTable/EFWTable.js +916 -525
  125. package/dist/react-components/tables/EFWTable/EFWTable.types.d.ts +256 -62
  126. package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.d.ts +5 -1
  127. package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.js +97 -52
  128. package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.types.d.ts +4 -1
  129. package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.d.ts +1 -12
  130. package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.js +47 -22
  131. package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.types.d.ts +13 -0
  132. package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.d.ts +1 -1
  133. package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.js +94 -69
  134. package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.types.d.ts +7 -16
  135. package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/index.d.ts +1 -1
  136. package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.d.ts +1 -1
  137. package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.js +218 -83
  138. package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.types.d.ts +3 -0
  139. package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.js +90 -88
  140. package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.types.d.ts +5 -0
  141. package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.d.ts +1 -18
  142. package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.js +83 -45
  143. package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.types.d.ts +23 -0
  144. package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.d.ts +2 -1
  145. package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.js +65 -48
  146. package/dist/react-components/tables/EFWTable/hooks/useDefaultDeleteButton/useDefaultDeleteButton.d.ts +2 -1
  147. package/dist/react-components/tables/EFWTable/hooks/useDefaultDeleteButton/useDefaultDeleteButton.js +71 -48
  148. package/dist/react-components/tables/EFWTable/hooks/useDefaultFilterButton/useDefaultFilterButton.d.ts +17 -0
  149. package/dist/react-components/tables/EFWTable/hooks/useDefaultFilterButton/useDefaultFilterButton.js +255 -0
  150. package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.d.ts +2 -1
  151. package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.js +72 -52
  152. package/dist/react-components/tables/EFWTable/hooks/useStableColumnRenderers/useStableColumnRenderers.d.ts +10 -0
  153. package/dist/react-components/tables/EFWTable/hooks/useStableColumnRenderers/useStableColumnRenderers.js +28 -0
  154. package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.js +151 -115
  155. package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.d.ts +1 -1
  156. package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.js +100 -53
  157. package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.types.d.ts +5 -1
  158. package/dist/react-components/tables/EFWTable/index.d.ts +4 -1
  159. package/dist/react-components/tables/EFWTable/index.js +7 -5
  160. package/dist/react-components/tables/EFWTable/utils/CellRenderer/CellRenderer.js +26 -23
  161. package/dist/react-components/tables/EFWTable/utils/cache.d.ts +1 -8
  162. package/dist/react-components/tables/EFWTable/utils/cache.js +40 -49
  163. package/dist/react-components/tables/EFWTable/utils/filterFunctions.d.ts +16 -0
  164. package/dist/react-components/tables/EFWTable/utils/filterFunctions.js +52 -0
  165. package/dist/react-components/tables/EFWTable/utils/hashing.d.ts +2 -2
  166. package/dist/react-components/tables/EFWTable/utils/hashing.js +2 -2
  167. package/package.json +49 -22
  168. package/dist/react-components/fields/EFWAttachments/EFWAttachments.js +0 -125
  169. package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/EFWAttachmentsCard.js +0 -107
  170. package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/index.d.ts +0 -1
  171. package/dist/react-components/fields/EFWAttachments/index.d.ts +0 -2
  172. package/dist/react-components/fields/EFWAttachments/index.js +0 -4
  173. package/dist/react-components/fields/EFWAttachmentsField/EFWAttachmentsField.js +0 -57
  174. package/dist/react-components/fields/EFWAttachmentsField/index.d.ts +0 -2
  175. package/dist/react-components/fields/EFWAttachmentsField/index.js +0 -4
  176. package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.js +0 -114
  177. package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.utils.d.ts +0 -24
  178. package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.utils.js +0 -90
  179. package/dist/react-components/fields/EFWDatePicker/index.d.ts +0 -2
  180. package/dist/react-components/fields/EFWDatePicker/index.js +0 -4
  181. package/dist/react-components/fields/EFWDatePickerField/EFWDatePickerField.js +0 -65
  182. package/dist/react-components/fields/EFWDatePickerField/EFWDatePickerField.types.d.ts +0 -7
  183. package/dist/react-components/fields/EFWDatePickerField/index.d.ts +0 -2
  184. package/dist/react-components/fields/EFWDatePickerField/index.js +0 -4
  185. package/dist/react-components/fields/EFWField/EFWField.js +0 -96
  186. package/dist/react-components/fields/EFWField/EFWField.utils.js +0 -17
  187. package/dist/react-components/fields/EFWInput/EFWInput.d.ts +0 -26
  188. package/dist/react-components/fields/EFWInput/EFWInput.js +0 -119
  189. package/dist/react-components/fields/EFWInput/EFWInput.utils.d.ts +0 -20
  190. package/dist/react-components/fields/EFWInput/EFWInput.utils.js +0 -83
  191. package/dist/react-components/fields/EFWInput/index.d.ts +0 -2
  192. package/dist/react-components/fields/EFWInput/index.js +0 -4
  193. package/dist/react-components/fields/EFWInputField/EFWInputField.js +0 -73
  194. package/dist/react-components/fields/EFWInputField/EFWInputField.utils.d.ts +0 -1
  195. package/dist/react-components/fields/EFWInputField/EFWInputField.utils.js +0 -0
  196. package/dist/react-components/fields/EFWInputField/index.d.ts +0 -2
  197. package/dist/react-components/fields/EFWInputField/index.js +0 -4
  198. package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.js +0 -198
  199. package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.utils.js +0 -76
  200. package/dist/react-components/fields/EFWNumberInput/index.d.ts +0 -2
  201. package/dist/react-components/fields/EFWNumberInput/index.js +0 -4
  202. package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.js +0 -67
  203. package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.utils.d.ts +0 -1
  204. package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.utils.js +0 -0
  205. package/dist/react-components/fields/EFWNumberInputField/index.d.ts +0 -2
  206. package/dist/react-components/fields/EFWNumberInputField/index.js +0 -4
  207. package/dist/react-components/fields/EFWSwitch/EFWSwitch.js +0 -55
  208. package/dist/react-components/fields/EFWSwitch/index.d.ts +0 -2
  209. package/dist/react-components/fields/EFWSwitch/index.js +0 -4
  210. package/dist/react-components/fields/EFWSwitchField/EFWSwitchField.js +0 -55
  211. package/dist/react-components/fields/EFWSwitchField/index.d.ts +0 -2
  212. package/dist/react-components/fields/EFWSwitchField/index.js +0 -4
  213. package/dist/react-components/fields/EFWTagPicker/EFWTagPicker.js +0 -244
  214. package/dist/react-components/fields/EFWTagPicker/index.d.ts +0 -2
  215. package/dist/react-components/fields/EFWTagPicker/index.js +0 -4
  216. package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.js +0 -74
  217. package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.utils.d.ts +0 -1
  218. package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.utils.js +0 -0
  219. package/dist/react-components/fields/EFWTagPickerField/index.d.ts +0 -2
  220. package/dist/react-components/fields/EFWTagPickerField/index.js +0 -4
  221. package/dist/react-components/fields/EFWTextArea/EFWTextArea.js +0 -105
  222. package/dist/react-components/fields/EFWTextArea/EFWTextArea.utils.d.ts +0 -1
  223. package/dist/react-components/fields/EFWTextArea/EFWTextArea.utils.js +0 -0
  224. package/dist/react-components/fields/EFWTextArea/index.d.ts +0 -2
  225. package/dist/react-components/fields/EFWTextArea/index.js +0 -4
  226. package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.js +0 -71
  227. package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.utils.d.ts +0 -1
  228. package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.utils.js +0 -0
  229. package/dist/react-components/fields/EFWTextAreaField/index.d.ts +0 -2
  230. package/dist/react-components/fields/EFWTextAreaField/index.js +0 -4
  231. package/dist/react-components/fields/types.d.ts +0 -1
  232. package/dist/react-components/fields/types.js +0 -0
  233. package/dist/utils/htmlConverter.d.ts +0 -15
  234. package/dist/utils/htmlConverter.js +0 -12
  235. /package/dist/react-components/fields/{EFWAttachments → Attachments}/EFWAttachments.d.ts +0 -0
  236. /package/dist/react-components/fields/{EFWAttachmentsField → Attachments}/EFWAttachmentsField.d.ts +0 -0
  237. /package/dist/react-components/fields/{EFWDatePickerField → DatePicker}/EFWDatePickerField.d.ts +0 -0
  238. /package/dist/react-components/fields/{EFWInputField → Input}/EFWInputField.d.ts +0 -0
  239. /package/dist/react-components/fields/{EFWNumberInput → NumberInput}/EFWNumberInput.d.ts +0 -0
  240. /package/dist/react-components/fields/{EFWNumberInputField → NumberInput}/EFWNumberInputField.d.ts +0 -0
  241. /package/dist/react-components/fields/{EFWSwitch → Switch}/EFWSwitch.d.ts +0 -0
  242. /package/dist/react-components/fields/{EFWSwitchField → Switch}/EFWSwitchField.d.ts +0 -0
  243. /package/dist/react-components/fields/{EFWTagPicker → TagPicker}/EFWTagPicker.d.ts +0 -0
  244. /package/dist/react-components/fields/{EFWTagPickerField → TagPicker}/EFWTagPickerField.d.ts +0 -0
  245. /package/dist/react-components/fields/{EFWTextArea → TextArea}/EFWTextArea.d.ts +0 -0
  246. /package/dist/react-components/fields/{EFWTextAreaField → TextArea}/EFWTextAreaField.d.ts +0 -0
  247. /package/dist/react-components/fields/{EFWField → _shared/EFWField}/EFWField.d.ts +0 -0
  248. /package/dist/react-components/fields/{EFWField → _shared/EFWField}/EFWField.utils.d.ts +0 -0
  249. /package/dist/react-components/fields/{EFWField → _shared/EFWField}/index.d.ts +0 -0
  250. /package/dist/react-components/fields/{EFWField → _shared/EFWField}/index.js +0 -0
  251. /package/dist/{react-components/fields/EFWAttachments/EFWAttachmentsCard/index.js → vite-raw.d.js} +0 -0
@@ -1,402 +1,803 @@
1
- import { jsxs as Fe, jsx as A } from "react/jsx-runtime";
2
- import { useMemo as U, useRef as f, useEffect as j, useCallback as g, useLayoutEffect as Ie } from "react";
3
- import { makeStyles as Ke, Subtitle2Stronger as Se, Text as Ve } from "@fluentui/react-components";
4
- import { generateGridTemplateColumns as Ge, EFWFormFieldWrapper as _e } from "./EFWForm.utils.js";
5
- import { EFWMessageBarManager as ze } from "../EFWMessageBarManager/EFWMessageBarManager.js";
6
- const He = Ke({
1
+ import { jsxs as ze, jsx as w } from "react/jsx-runtime";
2
+ import { useMemo as L, useRef as o, useState as He, useEffect as oe, useCallback as p } from "react";
3
+ import { useIsomorphicLayoutEffect as ce } from "../../hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js";
4
+ import { makeStyles as Rt, mergeClasses as Lt, Subtitle2Stronger as Ye, Text as Je, tokens as Qe } from "@fluentui/react-components";
5
+ import { generateGridTemplateColumns as wt, EFWFormFieldWrapper as xt } from "./EFWForm.utils.js";
6
+ import { EFWMessageBarManager as It } from "../EFWMessageBarManager/EFWMessageBarManager.js";
7
+ import { isFieldEmptyForValidation as Xe } from "../../commons/valueNormalization.js";
8
+ import { useFormLocaleText as Pt, PorygonI18nProvider as $t } from "../../i18n/PorygonI18nProvider.js";
9
+ const Nt = Rt({
7
10
  efwFormFieldWrapper: {
8
11
  "&:empty": {
9
12
  display: "none !important"
10
13
  }
11
14
  }
12
- }), B = {
13
- Text: void 0,
14
- // Default: let text fields decide controlled/uncontrolled
15
+ }), qt = 900, Ut = 20, Bt = {}, _t = [
16
+ ".fui-Input",
17
+ ".fui-Textarea",
18
+ ".fui-DatePicker",
19
+ ".fui-TagPickerControl",
20
+ ".fui-Switch",
21
+ '[role="combobox"]',
22
+ "textarea",
23
+ 'input:not([type="hidden"]):not([type="file"])',
24
+ ".fui-Button",
25
+ 'button:not([aria-hidden="true"])'
26
+ ], jt = (s) => {
27
+ for (const S of _t) {
28
+ const E = s.querySelector(S);
29
+ if (E)
30
+ return E;
31
+ }
32
+ return null;
33
+ }, Kt = ({
34
+ animationDelay: s = 0,
35
+ animationToken: S,
36
+ children: E,
37
+ className: D
38
+ }) => {
39
+ const g = o(null), b = p(
40
+ (y) => {
41
+ if (g.current?.cancel(), g.current = null, !S || !y)
42
+ return;
43
+ const j = jt(y);
44
+ !j || typeof j.animate != "function" || typeof window < "u" && window.matchMedia?.("(prefers-reduced-motion: reduce)").matches || (g.current = j.animate(
45
+ [
46
+ {
47
+ backgroundColor: "transparent",
48
+ boxShadow: "0 0 0 0 transparent"
49
+ //transform: 'scale(1)',
50
+ },
51
+ {
52
+ backgroundColor: Qe.colorBrandBackground2,
53
+ boxShadow: `0 0 0 1px ${Qe.colorBrandStroke1}`
54
+ //transform: 'scale(1.01)',
55
+ },
56
+ {
57
+ backgroundColor: "transparent",
58
+ boxShadow: "0 0 0 0 transparent"
59
+ //transform: 'scale(1)',
60
+ }
61
+ ],
62
+ {
63
+ delay: s,
64
+ duration: qt,
65
+ easing: "ease-out"
66
+ }
67
+ ));
68
+ },
69
+ [s, S]
70
+ );
71
+ return /* @__PURE__ */ w("div", { ref: b, className: D, children: E });
72
+ }, X = {
73
+ Text: "",
74
+ // String vacío para modo controlado
15
75
  Number: null,
16
76
  // Default value for Number fields
17
- Note: void 0,
18
- // Default: let text areas decide controlled/uncontrolled
77
+ Note: "",
78
+ // String vacío para modo controlado
19
79
  Choice: [],
20
80
  // Default value for Choice fields (array for multiple selections)
21
81
  Date: [],
22
82
  // Date picker expects arrays even cuando está vacío
23
- Boolean: void 0,
24
- // Default: let boolean fields decide controlled/uncontrolled
83
+ Boolean: !1,
84
+ // false para modo controlado
25
85
  Attachments: [],
26
86
  MultiChoice: []
27
87
  // Default value for MultiChoice fields (array for multiple selections)
28
- }, ye = (s) => {
88
+ }, kt = [
89
+ "value",
90
+ "selectedOptions",
91
+ "selectedDates",
92
+ "files"
93
+ ], Wt = {
94
+ Text: "value",
95
+ Number: "value",
96
+ Choice: "selectedOptions",
97
+ Note: "value",
98
+ Boolean: "value",
99
+ MultiChoice: "selectedOptions",
100
+ Date: "selectedDates",
101
+ Attachments: "files"
102
+ }, Ve = (s, S) => (
103
+ // biome-ignore lint/complexity/useObjectHasOwn: el target de tsconfig es < es2022 y Object.hasOwn no está disponible
104
+ Object.prototype.hasOwnProperty.call(s, S)
105
+ ), Gt = (s, S, E) => {
106
+ const D = { ...S }, g = Wt[s], b = kt.filter(
107
+ (y) => y !== g && y in D
108
+ );
109
+ if (b.length > 0) {
110
+ for (const y of b)
111
+ delete D[y];
112
+ console.warn(
113
+ `updateField recibió keys de valor incompatibles para '${E}' (${s}): ${b.join(", ")}. Se ignoraron y solo se permite '${g}'.`
114
+ );
115
+ }
116
+ return D;
117
+ }, zt = (s) => !(Ve(s, "validationState") || Ve(s, "validationMessage")) || Ve(s, "validationMessageIcon") ? s : {
118
+ ...s,
119
+ validationMessageIcon: void 0
120
+ }, Ze = (s) => {
29
121
  switch (s.typeAsString) {
30
122
  case "Text":
31
123
  case "Note":
32
124
  case "Boolean":
33
125
  case "Number":
34
- return s.value !== void 0 ? s.value : "defaultValue" in s && s.defaultValue !== void 0 ? s.defaultValue : B[s.typeAsString];
126
+ return s.value !== void 0 ? s.value : "defaultValue" in s && s.defaultValue !== void 0 ? s.defaultValue : X[s.typeAsString];
35
127
  case "Choice":
36
128
  case "MultiChoice":
37
- return "selectedOptions" in s && s.selectedOptions !== void 0 ? s.selectedOptions : "defaultSelectedOptions" in s && s.defaultSelectedOptions !== void 0 ? s.defaultSelectedOptions : B[s.typeAsString];
129
+ return "selectedOptions" in s && s.selectedOptions !== void 0 ? s.selectedOptions : "defaultSelectedOptions" in s && s.defaultSelectedOptions !== void 0 ? s.defaultSelectedOptions : X[s.typeAsString];
38
130
  case "Date":
39
- return "selectedDates" in s && s.selectedDates !== void 0 ? s.selectedDates : "defaultSelectedDates" in s && s.defaultSelectedDates !== void 0 ? s.defaultSelectedDates : B[s.typeAsString];
131
+ return "selectedDates" in s && s.selectedDates !== void 0 ? s.selectedDates : "defaultSelectedDates" in s && s.defaultSelectedDates !== void 0 ? s.defaultSelectedDates : X[s.typeAsString];
40
132
  case "Attachments":
41
- return "files" in s && s.files !== void 0 ? s.files : "defaultFiles" in s && s.defaultFiles !== void 0 ? s.defaultFiles : B[s.typeAsString];
133
+ return "files" in s && s.files !== void 0 ? s.files : "defaultFiles" in s && s.defaultFiles !== void 0 ? s.defaultFiles : X[s.typeAsString];
42
134
  default: {
43
- const S = s.typeAsString, b = S ? B[S] : void 0;
44
- return b !== void 0 ? b : void 0;
135
+ const S = s.typeAsString, E = S ? X[S] : void 0;
136
+ return E !== void 0 ? E : void 0;
45
137
  }
46
138
  }
47
- }, Je = (s, S) => {
48
- const b = s ?? {}, O = S ?? {};
49
- return Array.from(
50
- /* @__PURE__ */ new Set([
51
- ...Object.keys(b),
52
- ...Object.keys(O)
53
- ])
54
- ).filter((d) => b[d] !== O[d]);
55
- }, Me = (s, S, b) => {
56
- const O = S.current;
57
- let M = !1;
58
- const d = /* @__PURE__ */ new Set([...Object.keys(O), ...Object.keys(s)]);
59
- for (const w of d)
60
- if (!Object.is(O[w], s[w])) {
61
- M = !0;
139
+ }, et = (s, S, E) => {
140
+ const D = S.current;
141
+ let g = !1;
142
+ const b = /* @__PURE__ */ new Set([...Object.keys(D), ...Object.keys(s)]);
143
+ for (const y of b)
144
+ if (!Object.is(D[y], s[y])) {
145
+ g = !0;
62
146
  break;
63
147
  }
64
- return M && (b.current += 1, S.current = { ...s }), b.current;
65
- }, te = typeof window < "u" ? Ie : j, tt = (s) => {
148
+ return g && (E.current += 1, S.current = { ...s }), E.current;
149
+ }, rr = (s) => {
66
150
  const {
67
151
  title: S,
68
- description: b,
69
- hidden: O = !1,
70
- fields: M = [],
71
- fieldLogic: d,
72
- onValuesChange: w,
73
- style: Ce = {},
74
- className: Ee = "",
75
- header: Te,
76
- footer: De,
77
- children: Ae,
78
- gridTemplateColumns: Oe = 1,
79
- gridTemplateGap: L = 16,
80
- defaultValues: R = {},
81
- values: V,
82
- sections: T = [],
83
- messages: we = [],
84
- onInit: re,
85
- formRef: K
86
- } = s;
87
- if (O) return null;
88
- if (M.length > 0 && T.length > 0)
89
- throw console.error('EFWForm: No se pueden usar "fields" y "sections" al mismo tiempo. Use solo uno de ellos.'), new Error('EFWForm: No se pueden usar "fields" y "sections" al mismo tiempo.');
90
- M.length === 0 && T.length === 0 && console.warn('EFWForm: No se han proporcionado "fields" ni "sections". El formulario estará vacío.');
91
- const Re = He(), a = U(() => M.length > 0 ? [...M] : T.length > 0 ? T.flatMap((e) => e.fields) : [], [M, T]), x = U(() => a.reduce((e, t) => ({
92
- ...e,
93
- [t.internalName]: ye(t)
94
- }), {}), [a]), G = U(() => ({
95
- ...x,
96
- ...R
97
- }), [x, R]), se = U(() => a.map((e) => `${e.internalName}::${e.id ?? "no-id"}`).join("|"), [a]), $ = f(null), i = f(G), C = f(
98
- a.reduce((e, t) => ({
99
- ...e,
100
- [t.internalName]: {
101
- disabled: !1,
102
- editable: !0,
103
- hidden: !1,
104
- required: !1,
105
- validationState: "none",
106
- validationMessage: "",
107
- ...t
152
+ description: E,
153
+ hidden: D = !1,
154
+ editable: g = !0,
155
+ disabled: b = !1,
156
+ fields: y = [],
157
+ fieldLogic: j,
158
+ onValuesChange: Me,
159
+ style: tt = {},
160
+ className: rt = "",
161
+ header: nt,
162
+ footer: st,
163
+ children: it,
164
+ gridTemplateColumns: at = 1,
165
+ gridTemplateGap: Z = 16,
166
+ defaultValues: N = {},
167
+ values: O,
168
+ sections: x = [],
169
+ messages: ot = [],
170
+ fieldAnimationConfig: Ae = Bt,
171
+ onInit: le,
172
+ formRef: K,
173
+ localeText: Te
174
+ } = s, Ce = L(() => {
175
+ const {
176
+ fields: e,
177
+ buttons: t,
178
+ ...r
179
+ } = Te ?? {}, i = Object.keys(r).length > 0 ? r : void 0, n = e || t ? {
180
+ ...e ? { fields: e } : {},
181
+ ...t ? { buttons: t } : {}
182
+ } : void 0;
183
+ return {
184
+ formOverrides: i,
185
+ i18nProviderLocale: n
186
+ };
187
+ }, [Te]), Y = Pt(Ce.formOverrides), De = Ce.i18nProviderLocale;
188
+ if (y.length > 0 && x.length > 0)
189
+ throw console.error(
190
+ 'EFWForm: No se pueden usar "fields" y "sections" al mismo tiempo. Use solo uno de ellos.'
191
+ ), new Error(
192
+ 'EFWForm: No se pueden usar "fields" y "sections" al mismo tiempo.'
193
+ );
194
+ y.length === 0 && x.length === 0 && console.warn(
195
+ 'EFWForm: No se han proporcionado "fields" ni "sections". El formulario estará vacío.'
196
+ );
197
+ const ct = Nt(), c = L(() => y.length > 0 ? [...y] : x.length > 0 ? x.flatMap((e) => e.fields) : [], [y, x]), I = L(() => {
198
+ const e = /* @__PURE__ */ new Set(), t = /* @__PURE__ */ new Set();
199
+ return c.forEach((r) => {
200
+ const i = r.internalName;
201
+ r.editable === void 0 && e.add(i), r.disabled === void 0 && t.add(i);
202
+ }), { editable: e, disabled: t };
203
+ }, [c]), de = L(
204
+ () => c.map((e) => {
205
+ const t = e.editable === void 0 && g !== !0, r = e.disabled === void 0 && b !== !1;
206
+ return !t && !r ? e : {
207
+ ...e,
208
+ ...t ? { editable: g } : {},
209
+ ...r ? { disabled: b } : {}
210
+ };
211
+ }),
212
+ [c, g, b]
213
+ ), ee = L(() => {
214
+ const e = {};
215
+ for (const t of c)
216
+ e[t.internalName] = Ze(t);
217
+ return e;
218
+ }, [c]), J = L(
219
+ () => ({
220
+ ...ee,
221
+ ...N
222
+ }),
223
+ [ee, N]
224
+ ), q = O !== void 0, lt = L(() => q ? {
225
+ ...J,
226
+ ...O
227
+ } : J, [q, J, O]), Oe = L(
228
+ () => c.map((e) => `${e.internalName}::${e.id ?? "no-id"}`).join("|"),
229
+ [c]
230
+ ), U = o(null), [dt, Re] = He(!le), [ut, ft] = He({}), u = o(lt), m = o(null);
231
+ m.current === null && (m.current = de.reduce(
232
+ (e, t) => (e[t.internalName] = {
233
+ disabled: !1,
234
+ editable: !0,
235
+ hidden: !1,
236
+ required: !1,
237
+ validationState: "none",
238
+ validationMessage: "",
239
+ ...t
240
+ }, e),
241
+ {}
242
+ ));
243
+ const B = o(null);
244
+ B.current === null && (B.current = c.reduce(
245
+ (e, t) => (e[t.internalName] = {
246
+ editable: t.editable ?? g,
247
+ disabled: t.disabled ?? b,
248
+ hidden: t.hidden ?? !1,
249
+ required: t.required ?? !1
250
+ }, e),
251
+ {}
252
+ )), oe(() => {
253
+ const e = new Set(Object.keys(m.current)), t = new Set(c.map((r) => r.internalName));
254
+ e.forEach((r) => {
255
+ t.has(r) || (delete m.current[r], delete B.current[r], delete R.current[r]);
256
+ }), c.forEach((r) => {
257
+ const i = r.editable ?? g, n = r.disabled ?? b, a = r.hidden ?? !1, f = r.required ?? !1, l = B.current[r.internalName];
258
+ if (!e.has(r.internalName)) {
259
+ m.current[r.internalName] = {
260
+ hidden: !1,
261
+ required: !1,
262
+ validationState: "none",
263
+ validationMessage: "",
264
+ ...r,
265
+ editable: i,
266
+ disabled: n
267
+ }, B.current[r.internalName] = {
268
+ editable: i,
269
+ disabled: n,
270
+ hidden: a,
271
+ required: f
272
+ };
273
+ return;
108
274
  }
109
- }), {})
110
- ), P = f({}), _ = f(!1), $e = f({}), ne = f(
111
- a.reduce((e, t) => ({
112
- ...e,
113
- [t.internalName]: {
114
- validationState: t.validationState || "none",
115
- validationMessage: t.validationMessage || ""
275
+ const V = m.current[r.internalName];
276
+ if (!V) {
277
+ B.current[r.internalName] = {
278
+ editable: i,
279
+ disabled: n,
280
+ hidden: a,
281
+ required: f
282
+ };
283
+ return;
116
284
  }
117
- }), {})
118
- ), z = f(""), H = f(), Pe = f({
119
- ...x
120
- }), ke = f(0), J = Me(
121
- x,
122
- Pe,
123
- ke
124
- ), ae = f(R);
125
- j(() => {
126
- ae.current = R;
127
- }, [R]);
128
- const Ne = f({
129
- ...R
130
- }), Ue = f(0), Q = Me(
131
- R,
132
- Ne,
133
- Ue
134
- ), N = V !== void 0, X = `${J}:${Q}`, Y = f(""), oe = U(() => d ? Object.keys(d) : [], [d]), Be = g(
285
+ (!l || l.editable !== i || l.disabled !== n || l.hidden !== a || l.required !== f) && (m.current[r.internalName] = {
286
+ ...V,
287
+ editable: i,
288
+ disabled: n,
289
+ hidden: a,
290
+ required: f
291
+ }), B.current[r.internalName] = {
292
+ editable: i,
293
+ disabled: n,
294
+ hidden: a,
295
+ required: f
296
+ };
297
+ });
298
+ }, [c, g, b]);
299
+ const R = o({}), ue = o(!1), fe = o(/* @__PURE__ */ new Set()), pt = o({}), k = o(null);
300
+ k.current === null && (k.current = de.reduce(
301
+ (e, t) => (e[t.internalName] = {
302
+ validationState: t.validationState || "none",
303
+ validationMessage: t.validationMessage || ""
304
+ }, e),
305
+ {}
306
+ ));
307
+ const pe = o(""), te = o(!1), gt = o({
308
+ ...ee
309
+ }), mt = o(0), ge = et(
310
+ ee,
311
+ gt,
312
+ mt
313
+ ), Le = o(N), W = o(j), we = o(le), me = o(Ae), re = o({}), xe = o(!1);
314
+ oe(() => {
315
+ Le.current = N;
316
+ }, [N]), W.current = j, we.current = le, me.current = Ae;
317
+ const vt = o({
318
+ ...N
319
+ }), ht = o(0), ve = et(
320
+ N,
321
+ vt,
322
+ ht
323
+ ), he = `${ge}:${ve}`, be = o(""), G = L(
324
+ () => new Map(
325
+ c.map((e) => [
326
+ e.internalName,
327
+ e
328
+ ])
329
+ ),
330
+ [c]
331
+ ), Ie = o(G);
332
+ Ie.current = G;
333
+ const bt = p(
135
334
  (e, t) => {
136
- ne.current[e] = {
335
+ k.current[e] = {
137
336
  validationState: t.currentValidationState,
138
337
  validationMessage: t.currentValidationMessage
139
- }, C.current[e] = {
140
- ...C.current[e],
338
+ }, m.current[e] = {
339
+ ...m.current[e],
141
340
  validationState: t.currentValidationState,
142
341
  validationMessage: t.currentValidationMessage
143
342
  };
144
343
  },
145
344
  []
146
- ), ie = f(0);
147
- j(() => {
148
- ie.current += 1, console.log(`EFWForm renderizado #${ie.current}`);
149
- });
150
- const W = g((e, t = "internal") => {
151
- $.current && $.current.addMessageBar(e, t);
152
- }, []), q = g((e) => {
153
- $.current && $.current.removeMessageBar(e);
154
- }, []), le = g(() => {
155
- $.current && $.current.removeAllMessagesBar();
156
- }, []), je = g(
345
+ ), ne = p(
346
+ (e, t = "internal") => {
347
+ U.current && U.current.addMessageBar(e, t);
348
+ },
349
+ []
350
+ ), se = p((e) => {
351
+ U.current && U.current.removeMessageBar(e);
352
+ }, []), Pe = p(() => {
353
+ U.current && U.current.removeAllMessagesBar();
354
+ }, []), $e = o(Me);
355
+ $e.current = Me;
356
+ const ie = p(() => {
357
+ $e.current?.({ ...u.current });
358
+ }, []), Q = p(
157
359
  (e, t) => {
158
- i.current[e] = t, _.current || (_.current = !0, w?.(i.current), _.current = !1);
360
+ const r = Fe.current;
361
+ r?.(e, t);
159
362
  },
160
- [w]
161
- ), Le = g((e, t) => {
162
- P.current[e] = t;
163
- }, []), F = g((e, t) => {
164
- const c = Array.isArray(e) ? e : [e], u = (r) => {
165
- console.log(`updateFieldProps called for ${String(r)} with updates:`, t);
166
- const o = P.current[r];
167
- if (!o) {
168
- console.warn(`No se encontró un campo registrado para '${String(r)}'`);
169
- return;
170
- }
171
- const m = a.find((ee) => ee.internalName === r);
172
- if (!m) {
173
- console.warn(`No se encontró la definición del campo: ${String(r)}`);
174
- return;
175
- }
176
- o(t);
177
- const { value: l, selectedOptions: n, selectedDates: v, files: h, ...p } = t;
178
- Object.keys(p).length > 0 && (C.current[r] = {
179
- ...C.current[r],
180
- ...p
181
- });
182
- const y = d, E = (ee, We, qe = "change") => {
183
- const be = y?.[r];
184
- be && be(
185
- ee,
186
- F,
187
- {
188
- allValues: i.current,
189
- trigger: qe,
190
- fieldName: r,
191
- previousValue: We,
192
- isControlled: N
193
- }
194
- );
195
- }, he = m.typeAsString, I = i.current[r];
196
- switch (he) {
197
- case "Text":
198
- case "Number":
199
- case "Boolean":
200
- case "Note": {
201
- l !== void 0 && (i.current[r] = l, E(l, I));
202
- break;
203
- }
204
- case "Choice":
205
- case "MultiChoice": {
206
- n !== void 0 && (i.current[r] = n, E(n, I));
207
- break;
363
+ []
364
+ ), z = p(
365
+ (e, t) => {
366
+ const r = k.current[e], i = re.current[e];
367
+ if (!(i !== void 0 && r?.validationState === "error" && r?.validationMessage === i)) return;
368
+ const a = Ie.current.get(e);
369
+ a && (Xe(t, a.typeAsString) || (Q(e, {
370
+ validationState: "none",
371
+ validationMessage: ""
372
+ }), k.current[e] = {
373
+ validationState: "none",
374
+ validationMessage: ""
375
+ }, m.current[e] = {
376
+ ...m.current[e],
377
+ validationState: "none",
378
+ validationMessage: ""
379
+ }, delete re.current[e]));
380
+ },
381
+ [Q]
382
+ ), St = p(
383
+ (e, t, r) => {
384
+ u.current[e] = t, !r?.silent && (z(e, t), ue.current || (ue.current = !0, ie(), ue.current = !1));
385
+ },
386
+ [ie, z]
387
+ ), Ft = p(
388
+ (e, t) => {
389
+ R.current[e] = t;
390
+ },
391
+ []
392
+ ), yt = p(
393
+ (e, t) => {
394
+ R.current[e] === t && delete R.current[e];
395
+ },
396
+ []
397
+ ), A = p(
398
+ (e, t) => {
399
+ const r = Array.isArray(e) ? e : [e], i = (n) => {
400
+ const a = R.current[n];
401
+ if (!a) {
402
+ console.warn(
403
+ `No se encontró un campo registrado para '${String(n)}'`
404
+ );
405
+ return;
208
406
  }
209
- case "Date": {
210
- v !== void 0 && (i.current[r] = v, E(v, I));
211
- break;
407
+ const f = G.get(n);
408
+ if (!f) {
409
+ console.warn(
410
+ `No se encontró la definición del campo: ${String(n)}`
411
+ );
412
+ return;
212
413
  }
213
- case "Attachments": {
214
- h !== void 0 && (i.current[r] = h, E(h, I));
215
- break;
414
+ const l = f.typeAsString, V = Gt(
415
+ l,
416
+ t,
417
+ String(n)
418
+ ), F = zt(V);
419
+ a(F);
420
+ const {
421
+ value: v,
422
+ selectedOptions: M,
423
+ selectedDates: d,
424
+ files: h,
425
+ ...$
426
+ } = F;
427
+ Object.keys($).length > 0 && (m.current[n] = {
428
+ ...m.current[n],
429
+ ...$
430
+ });
431
+ const H = W.current, T = (Ct, Dt, Ot = "change") => {
432
+ const Ge = H?.[n];
433
+ if (!Ge)
434
+ return;
435
+ const ae = String(n);
436
+ if (fe.current.has(ae)) {
437
+ console.warn(
438
+ `Se detectó una actualización en cascada cíclica sobre el campo '${ae}'. Se omite la re-ejecución de su fieldLogic para evitar recursión infinita; revisa que la lógica del campo no se actualice a sí misma de forma indefinida.`
439
+ );
440
+ return;
441
+ }
442
+ fe.current.add(ae);
443
+ try {
444
+ Ge(
445
+ Ct,
446
+ A,
447
+ {
448
+ allValues: u.current,
449
+ trigger: Ot,
450
+ fieldName: n,
451
+ previousValue: Dt,
452
+ isControlled: q
453
+ }
454
+ );
455
+ } finally {
456
+ fe.current.delete(ae);
457
+ }
458
+ }, C = u.current[n];
459
+ switch (l) {
460
+ case "Text":
461
+ case "Number":
462
+ case "Boolean":
463
+ case "Note": {
464
+ v !== void 0 && (u.current[n] = v, T(v, C));
465
+ break;
466
+ }
467
+ case "Choice":
468
+ case "MultiChoice": {
469
+ M !== void 0 && (u.current[n] = M, T(
470
+ M,
471
+ C
472
+ ));
473
+ break;
474
+ }
475
+ case "Date": {
476
+ d !== void 0 && (u.current[n] = d, T(
477
+ d,
478
+ C
479
+ ));
480
+ break;
481
+ }
482
+ case "Attachments": {
483
+ h !== void 0 && (u.current[n] = h, T(h, C));
484
+ break;
485
+ }
486
+ default:
487
+ console.warn(`Tipo de campo desconocido: ${l}`);
216
488
  }
217
- default:
218
- console.warn(`Tipo de campo desconocido: ${he}`);
219
- }
220
- };
221
- for (const r of c)
222
- u(r);
223
- }, [d, a, N]), k = g((e, t = {}) => {
224
- if (!d)
225
- return;
226
- const c = e && e.length > 0 ? e : oe;
227
- if (c.length === 0)
489
+ const At = v !== void 0 || M !== void 0 || d !== void 0 || h !== void 0, Tt = "validationState" in F || "validationMessage" in F;
490
+ At && !Tt && z(
491
+ n,
492
+ u.current[n]
493
+ );
494
+ };
495
+ for (const n of r)
496
+ i(n);
497
+ },
498
+ [G, q, z]
499
+ ), Se = L(() => {
500
+ const e = Array.from(I.editable).sort().join("|"), t = Array.from(I.disabled).sort().join("|");
501
+ return `${e}::${t}`;
502
+ }, [I]), Ne = o(
503
+ `${g}::${b}::${Se}`
504
+ );
505
+ ce(() => {
506
+ const e = `${g}::${b}::${Se}`;
507
+ if (Ne.current === e)
228
508
  return;
229
- const u = d, {
230
- trigger: r = "change",
231
- previousValues: o,
232
- allValuesOverride: m
233
- } = t, l = m ?? i.current;
234
- c.forEach((n) => {
235
- const v = u[n];
236
- if (!v)
509
+ Ne.current = e, (/* @__PURE__ */ new Set([
510
+ ...I.editable,
511
+ ...I.disabled
512
+ ])).forEach((r) => {
513
+ const i = m.current[r];
514
+ if (!i)
237
515
  return;
238
- const h = o?.[n];
239
- v(
240
- l[n],
241
- F,
242
- {
243
- allValues: l,
244
- trigger: r,
245
- fieldName: n,
246
- previousValue: h,
247
- isControlled: N
248
- }
249
- );
516
+ let n = i.editable, a = i.disabled, f = !1;
517
+ I.editable.has(r) && i.editable !== g && (n = g, f = !0), I.disabled.has(r) && i.disabled !== b && (a = b, f = !0), f && (m.current[r] = {
518
+ ...i,
519
+ editable: n,
520
+ disabled: a
521
+ });
250
522
  });
251
- }, [d, oe, F, N]), Z = g(() => ({ ...i.current }), []), D = g((e, t = {
252
- triggerOnChange: !0,
253
- triggerFieldLogic: !0,
254
- overwriteAll: !1
255
- }) => {
256
- const { triggerOnChange: c = !0, triggerFieldLogic: u = !0, overwriteAll: r = !1 } = t, o = Object.keys(e), m = {};
257
- if (o.forEach((l) => {
258
- m[l] = i.current[l];
259
- }), r)
260
- i.current = { ...i.current, ...e };
261
- else {
262
- const l = { ...i.current };
263
- Object.keys(e).forEach((n) => {
264
- n in i.current && (l[n] = e[n]);
265
- }), i.current = l;
266
- }
267
- o.forEach((l) => {
268
- const n = P.current[l];
269
- if (n) {
270
- const v = a.find((h) => h.internalName === l);
271
- if (v) {
272
- const h = v.typeAsString, p = e[l];
273
- let y;
274
- switch (h) {
275
- case "Text":
276
- case "Number":
277
- case "Boolean":
278
- case "Note":
279
- y = { value: p };
280
- break;
281
- case "Choice":
282
- case "MultiChoice":
283
- y = { selectedOptions: p };
284
- break;
285
- case "Date":
286
- y = { selectedDates: p };
287
- break;
288
- case "Attachments":
289
- y = { files: p };
290
- break;
291
- default:
292
- console.warn(`Tipo de campo desconocido: ${h}`), y = {};
523
+ }, [
524
+ g,
525
+ b,
526
+ Se,
527
+ I
528
+ ]);
529
+ const Fe = o(A);
530
+ Fe.current = A;
531
+ const _ = p(
532
+ (e, t = {}) => {
533
+ const r = W.current;
534
+ if (!r)
535
+ return;
536
+ const i = e && e.length > 0 ? e : Object.keys(r);
537
+ if (i.length === 0)
538
+ return;
539
+ const n = r, { trigger: a = "change", previousValues: f, allValuesOverride: l } = t, V = l ?? u.current;
540
+ i.forEach((F) => {
541
+ const v = n[F];
542
+ if (!v)
543
+ return;
544
+ const M = f?.[F];
545
+ v(
546
+ V[F],
547
+ A,
548
+ {
549
+ allValues: V,
550
+ trigger: a,
551
+ fieldName: F,
552
+ previousValue: M,
553
+ isControlled: q
554
+ }
555
+ );
556
+ });
557
+ },
558
+ [A, q]
559
+ ), Et = p(
560
+ (e) => W.current?.[e],
561
+ []
562
+ ), ye = p(
563
+ () => ({ ...u.current }),
564
+ []
565
+ ), P = p(
566
+ (e, t = {
567
+ triggerOnChange: !0,
568
+ triggerFieldLogic: !0,
569
+ overwriteAll: !1
570
+ }, r) => {
571
+ const {
572
+ triggerOnChange: i = !0,
573
+ triggerFieldLogic: n = !0,
574
+ overwriteAll: a = !1,
575
+ force: f = !1
576
+ } = t, l = t.animateUpdatedFields ?? r ?? me.current.setValues ?? !1, V = Object.keys(e), F = {}, v = [], M = f ? V : V.filter(
577
+ (d) => !Object.is(
578
+ u.current[d],
579
+ e[d]
580
+ )
581
+ );
582
+ if (M.forEach((d) => {
583
+ F[d] = u.current[d];
584
+ }), !(M.length === 0 && !a)) {
585
+ if (a)
586
+ u.current = {
587
+ ...u.current,
588
+ ...e
589
+ };
590
+ else {
591
+ const d = { ...u.current };
592
+ Object.keys(e).forEach((h) => {
593
+ h in u.current && (d[h] = e[h]);
594
+ }), u.current = d;
595
+ }
596
+ M.forEach((d) => {
597
+ const h = R.current[d];
598
+ if (h) {
599
+ const $ = G.get(d);
600
+ if ($) {
601
+ const H = $.typeAsString, T = e[d];
602
+ let C;
603
+ switch (H) {
604
+ case "Text":
605
+ case "Number":
606
+ case "Boolean":
607
+ case "Note":
608
+ C = { value: T };
609
+ break;
610
+ case "Choice":
611
+ case "MultiChoice":
612
+ C = { selectedOptions: T };
613
+ break;
614
+ case "Date":
615
+ C = { selectedDates: T };
616
+ break;
617
+ case "Attachments":
618
+ C = { files: T };
619
+ break;
620
+ default:
621
+ console.warn(`Tipo de campo desconocido: ${H}`), C = {};
622
+ }
623
+ h(C), z(d, T), l && !Object.is(F[d], T) && v.push(d);
624
+ } else
625
+ console.warn(`No se encontró la definición del campo: ${d}`);
293
626
  }
294
- n(y);
295
- } else
296
- console.warn(`No se encontró la definición del campo: ${l}`);
627
+ }), v.length > 0 && ft((d) => {
628
+ const h = { ...d };
629
+ return v.forEach(($, H) => {
630
+ h[$] = {
631
+ delay: H * Ut,
632
+ token: (h[$]?.token ?? 0) + 1
633
+ };
634
+ }), h;
635
+ }), n && M.length > 0 && _(M, {
636
+ previousValues: F
637
+ }), i && ie();
297
638
  }
298
- }), u && o.length > 0 && k(o, { previousValues: m }), c && w?.(i.current);
299
- }, [w, a, k]);
300
- te(() => {
301
- if (V !== void 0) {
302
- Y.current = "";
639
+ },
640
+ [
641
+ ie,
642
+ G,
643
+ _,
644
+ z
645
+ ]
646
+ );
647
+ ce(() => {
648
+ if (O !== void 0) {
649
+ be.current = "";
303
650
  return;
304
651
  }
305
- Y.current !== X && (Y.current = X, D(G, {
306
- overwriteAll: !0,
307
- triggerOnChange: !1,
308
- triggerFieldLogic: !1
309
- }));
310
- }, [V, X, D, G]), te(() => {
311
- if (!d)
652
+ be.current !== he && (be.current = he, P(
653
+ J,
654
+ {
655
+ overwriteAll: !0,
656
+ triggerOnChange: !1,
657
+ triggerFieldLogic: !1
658
+ },
659
+ !1
660
+ ));
661
+ }, [O, he, P, J]), ce(() => {
662
+ if (!W.current)
312
663
  return;
313
- if (V !== void 0) {
314
- z.current = "";
664
+ if (O !== void 0) {
665
+ pe.current = "";
315
666
  return;
316
667
  }
317
- const e = `uncontrolled::${se}::${J}::${Q}`;
318
- z.current !== e && (z.current = e, k(void 0, { trigger: "init" }));
319
- }, [d, V, se, J, Q, k]), te(() => {
320
- if (V === void 0) {
321
- H.current = void 0;
668
+ const e = `uncontrolled::${Oe}::${ge}::${ve}`;
669
+ pe.current !== e && (pe.current = e, _(void 0, { trigger: "init" }));
670
+ }, [
671
+ O,
672
+ Oe,
673
+ ge,
674
+ ve,
675
+ _
676
+ ]), ce(() => {
677
+ if (O === void 0) {
678
+ te.current = !1;
322
679
  return;
323
680
  }
324
- D(V, {
325
- triggerOnChange: !1,
326
- triggerFieldLogic: !1,
327
- overwriteAll: !0
328
- });
329
- const e = H.current;
330
- if (H.current = V, !d)
681
+ const e = u.current, t = O, i = Object.keys(t).filter(
682
+ (n) => e[n] !== t[n]
683
+ );
684
+ if (i.length > 0 && P(
685
+ t,
686
+ {
687
+ triggerOnChange: !1,
688
+ triggerFieldLogic: !1,
689
+ overwriteAll: !0
690
+ },
691
+ !1
692
+ ), !W.current) {
693
+ te.current = !0;
331
694
  return;
332
- const t = Je(e, V);
333
- t.length > 0 ? k(t, { previousValues: e }) : e || k(void 0, { trigger: "init" });
334
- }, [V, D, k, d]);
335
- const ce = g(() => {
336
- const t = {
337
- ...a.reduce((c, u) => ({
338
- ...c,
339
- [u.internalName]: ye(u)
340
- }), {}),
341
- ...ae.current
342
- };
343
- D(t, { overwriteAll: !0 });
344
- }, [a, D]), ue = g((e, t) => {
345
- const c = t || a.map((r) => r.internalName), u = [];
346
- return c.forEach((r) => {
347
- const o = C.current[r];
348
- if (!o) {
349
- console.warn(`Field state not found for ${r}`);
350
- return;
351
- }
352
- const m = o.disabled ?? !1;
353
- e !== m && P.current[r] ? (F(r, { disabled: e }), u.push(r)) : P.current[r] || console.warn(`Field ${r} not found in fieldUpdateRefs`);
354
- }), u;
355
- }, [a, F]), de = g((e, t) => {
356
- const c = t || a.map((r) => r.internalName), u = [];
357
- return c.forEach((r) => {
358
- const o = C.current[r];
359
- if (!o) {
360
- console.warn(`Field state not found for ${r}`);
361
- return;
362
- }
363
- const m = o.editable ?? !0;
364
- e !== m && P.current[r] ? (F(r, { editable: e }), u.push(r)) : P.current[r] || console.warn(`Field ${r} not found in fieldUpdateRefs`);
365
- }), u;
366
- }, [a, F]), fe = g(() => a.every((t) => C.current[t.internalName].disabled === !0 || t.disabled === !0), [a]), pe = g(() => a.every((t) => C.current[t.internalName].editable === !0 || t.editable === !0), [a]), ge = g((e = !0) => {
367
- const t = "validacion__10000001", c = "error", u = "Este campo es obligatorio", r = $e.current;
368
- let o = !0;
369
- const m = F;
370
- return a.forEach((l) => {
371
- const n = l.internalName, v = i.current[n], h = C.current[n], p = ne.current[n], y = v == null || v === "" || Array.isArray(v) && v.length === 0;
372
- if (!h?.required && p?.validationState === "error") {
373
- o = !1;
374
- return;
375
- }
376
- if (h?.required)
377
- if (y)
378
- (p?.validationState !== "error" || p?.validationMessage !== u) && (r[n] = {
379
- validationState: p?.validationState || "none",
380
- validationMessage: p?.validationMessage || ""
381
- }, m(n, {
382
- validationState: c,
383
- validationMessage: u
384
- })), o = !1;
385
- else if (p?.validationState === "error" && p?.validationMessage === u) {
386
- const E = r[n];
387
- E && (m(n, {
388
- validationState: E.validationState,
389
- validationMessage: E.validationMessage
390
- }), E.validationState === "error" && (o = !1));
391
- } else p?.validationState === "error" && (o = !1);
392
- }), e && !o ? W({
393
- id: t,
394
- intent: "error",
395
- message: "Por favor complete todos los campos indicados como requeridos e inténtelo nuevamente.",
396
- actions: []
397
- }, "internal") : q(t), o;
398
- }, [W, a, q, F]), ve = f({
399
- getValues: () => i.current,
695
+ }
696
+ i.length > 0 ? _(i, { previousValues: e }) : te.current || _(void 0, { trigger: "init" }), te.current = !0;
697
+ }, [O, P, _]);
698
+ const qe = p(
699
+ (e = {}) => {
700
+ const r = {
701
+ ...c.reduce(
702
+ (i, n) => (i[n.internalName] = Ze(n), i),
703
+ {}
704
+ ),
705
+ ...Le.current
706
+ };
707
+ P(
708
+ r,
709
+ {
710
+ ...e,
711
+ overwriteAll: !0
712
+ },
713
+ me.current.resetValues
714
+ );
715
+ },
716
+ [c, P]
717
+ ), Ue = p(
718
+ (e, t) => {
719
+ const r = t || c.map((n) => n.internalName), i = [];
720
+ return r.forEach((n) => {
721
+ const a = m.current[n];
722
+ if (!a) {
723
+ console.warn(`Field state not found for ${n}`);
724
+ return;
725
+ }
726
+ const f = a.disabled ?? !1;
727
+ e !== f && R.current[n] ? (A(n, { disabled: e }), i.push(n)) : R.current[n] || console.warn(`Field ${n} not found in fieldUpdateRefs`);
728
+ }), i;
729
+ },
730
+ [c, A]
731
+ ), Be = p(
732
+ (e, t) => {
733
+ const r = t || c.map((n) => n.internalName), i = [];
734
+ return r.forEach((n) => {
735
+ const a = m.current[n];
736
+ if (!a) {
737
+ console.warn(`Field state not found for ${n}`);
738
+ return;
739
+ }
740
+ const f = a.editable ?? !0;
741
+ e !== f && R.current[n] ? (A(n, { editable: e }), i.push(n)) : R.current[n] || console.warn(`Field ${n} not found in fieldUpdateRefs`);
742
+ }), i;
743
+ },
744
+ [c, A]
745
+ ), _e = p(() => c.every(
746
+ (e) => m.current[e.internalName]?.disabled === !0
747
+ ), [c]), je = p(() => c.every(
748
+ (e) => m.current[e.internalName]?.editable === !0
749
+ ), [c]), Ke = p(
750
+ (e = !0) => {
751
+ const t = "validacion__10000001", r = "error", i = Y.requiredFieldError, n = pt.current;
752
+ let a = !0;
753
+ return c.forEach((f) => {
754
+ const l = f.internalName, V = u.current[l], F = m.current[l], v = k.current[l];
755
+ if (F?.hidden === !0)
756
+ return;
757
+ const d = Xe(
758
+ V,
759
+ f.typeAsString
760
+ );
761
+ if (!F?.required && v?.validationState === "error") {
762
+ a = !1;
763
+ return;
764
+ }
765
+ if (F?.required)
766
+ if (d)
767
+ re.current[l] = i, (v?.validationState !== "error" || v?.validationMessage !== i) && (n[l] = {
768
+ validationState: v?.validationState || "none",
769
+ validationMessage: v?.validationMessage || ""
770
+ }, Q(l, {
771
+ validationState: r,
772
+ validationMessage: i
773
+ })), a = !1;
774
+ else if (delete re.current[l], v?.validationState === "error" && v?.validationMessage === i) {
775
+ const h = n[l];
776
+ h && (Q(l, {
777
+ validationState: h.validationState,
778
+ validationMessage: h.validationMessage
779
+ }), h.validationState === "error" && (a = !1));
780
+ } else v?.validationState === "error" && (a = !1);
781
+ }), e && !a ? ne(
782
+ {
783
+ id: t,
784
+ intent: "error",
785
+ message: Y.requiredFieldsNotification,
786
+ actions: []
787
+ },
788
+ "internal"
789
+ ) : se(t), a;
790
+ },
791
+ [
792
+ ne,
793
+ c,
794
+ Y.requiredFieldError,
795
+ Y.requiredFieldsNotification,
796
+ se,
797
+ Q
798
+ ]
799
+ ), Ee = o({
800
+ getValues: () => u.current,
400
801
  setValues: () => {
401
802
  },
402
803
  resetValues: () => {
@@ -411,80 +812,142 @@ const He = Ke({
411
812
  removeMessageBar: () => {
412
813
  },
413
814
  removeAllMessagesBar: () => {
815
+ },
816
+ updateField: () => {
414
817
  }
415
818
  });
416
- j(() => {
417
- ve.current = {
418
- getValues: Z,
419
- setValues: D,
420
- resetValues: ce,
421
- setDisabled: ue,
422
- setEditable: de,
423
- isDisabled: fe,
424
- isEditable: pe,
425
- validateForm: ge,
426
- addMessageBar: W,
427
- removeMessageBar: q,
428
- removeAllMessagesBar: le
429
- }, K && (K.current = ve.current);
430
- }, [Z, D, ce, ue, fe, ge, K, W, q, le, de, pe]), j(() => {
431
- if (re) {
432
- const e = re(i.current, F);
433
- e instanceof Promise && e.catch((t) => console.error("Error en onInit:", t));
819
+ oe(() => (Ee.current = {
820
+ getValues: ye,
821
+ setValues: P,
822
+ resetValues: qe,
823
+ setDisabled: Ue,
824
+ setEditable: Be,
825
+ isDisabled: _e,
826
+ isEditable: je,
827
+ validateForm: Ke,
828
+ addMessageBar: ne,
829
+ removeMessageBar: se,
830
+ removeAllMessagesBar: Pe,
831
+ updateField: A
832
+ }, K && (K.current = Ee.current), () => {
833
+ K && K.current === Ee.current && (K.current = null);
834
+ }), [
835
+ ye,
836
+ P,
837
+ qe,
838
+ Ue,
839
+ _e,
840
+ Ke,
841
+ K,
842
+ ne,
843
+ se,
844
+ Pe,
845
+ Be,
846
+ je,
847
+ A
848
+ ]), oe(() => {
849
+ if (xe.current)
850
+ return;
851
+ xe.current = !0;
852
+ const e = we.current;
853
+ if (e) {
854
+ const t = e(
855
+ u.current,
856
+ Fe.current
857
+ );
858
+ t instanceof Promise ? t.catch((r) => console.error("Error en onInit:", r)).finally(() => Re(!0)) : Re(!0);
434
859
  }
435
860
  }, []);
436
- const xe = (e) => {
437
- const t = e.internalName, c = i.current[t];
438
- return /* @__PURE__ */ A("div", { className: Re.efwFormFieldWrapper, children: /* @__PURE__ */ A(
439
- _e,
861
+ const Vt = (e) => {
862
+ const t = e.internalName, r = u.current[t], i = ut[t];
863
+ return /* @__PURE__ */ w(
864
+ Kt,
440
865
  {
441
- field: e,
442
- initialValue: c,
443
- onValueChange: je,
444
- registerUpdateProps: Le,
445
- fieldLogic: d?.[e.internalName],
446
- isControlled: N,
447
- getAllValues: Z,
448
- updateFieldProps: F,
449
- onValidationChange: (u) => Be(e.internalName, u)
450
- }
451
- ) }, e.id);
452
- }, me = (e, t = 1) => {
453
- const c = Ge(t);
454
- return /* @__PURE__ */ A(
866
+ className: ct.efwFormFieldWrapper,
867
+ animationDelay: i?.delay,
868
+ animationToken: i?.token,
869
+ children: /* @__PURE__ */ w(
870
+ xt,
871
+ {
872
+ field: e,
873
+ initialValue: r,
874
+ onValueChange: St,
875
+ registerUpdateProps: Ft,
876
+ unregisterUpdateProps: yt,
877
+ getFieldLogicByName: Et,
878
+ isControlled: q,
879
+ getAllValues: ye,
880
+ updateFieldProps: A,
881
+ onValidationChange: bt,
882
+ localeText: Y
883
+ }
884
+ )
885
+ },
886
+ e.id
887
+ );
888
+ }, ke = (e, t = 1) => {
889
+ const r = wt(t);
890
+ return /* @__PURE__ */ w(
455
891
  "div",
456
892
  {
457
893
  style: {
458
894
  display: "grid",
459
- gridTemplateColumns: c,
460
- gap: L,
461
- padding: `${L}px 0px 0px`
895
+ gridTemplateColumns: r,
896
+ gap: Z,
897
+ margin: `${Z}px 0px 0px`
462
898
  },
463
- children: e.map(xe)
899
+ children: e.map(Vt)
464
900
  }
465
901
  );
466
- };
467
- return /* @__PURE__ */ Fe("div", { style: { ...Ce }, className: Ee, children: [
468
- Te,
469
- S && /* @__PURE__ */ A(Se, { style: { marginTop: 12 }, block: !0, children: S }),
470
- b && /* @__PURE__ */ A(Ve, { block: !0, as: "p", children: b }),
471
- T && T.length > 0 ? T.map((e, t) => /* @__PURE__ */ Fe("div", { children: [
472
- e.title && /* @__PURE__ */ A(Se, { style: { marginTop: L * (t > 0 ? 2 : 1) }, block: !0, children: e.title }),
473
- e.description && /* @__PURE__ */ A(Ve, { block: !0, as: "p", style: e.title ? {} : { marginTop: L * (t > 0 ? 2 : 1) }, children: e.description }),
474
- me(e.fields, e.gridTemplateColumns)
475
- ] }, t)) : me(a, Oe),
476
- /* @__PURE__ */ A(
477
- ze,
478
- {
479
- style: { marginTop: "22px" },
480
- initialExternalMessages: we,
481
- ref: $
482
- }
483
- ),
484
- Ae,
485
- De
486
- ] });
902
+ }, Mt = Lt(rt, "efw-form");
903
+ if (D) return null;
904
+ const We = /* @__PURE__ */ ze(
905
+ "div",
906
+ {
907
+ style: {
908
+ ...tt,
909
+ ...dt ? {} : { visibility: "hidden" }
910
+ },
911
+ className: Mt,
912
+ children: [
913
+ nt,
914
+ S && /* @__PURE__ */ w(Ye, { style: { marginTop: 12 }, block: !0, children: S }),
915
+ E && /* @__PURE__ */ w(Je, { block: !0, as: "p", children: E }),
916
+ x && x.length > 0 ? x.map((e, t) => /* @__PURE__ */ ze("div", { children: [
917
+ e.title && /* @__PURE__ */ w(
918
+ Ye,
919
+ {
920
+ style: { marginTop: Z * (t > 0 ? 2 : 1) },
921
+ block: !0,
922
+ children: e.title
923
+ }
924
+ ),
925
+ e.description && /* @__PURE__ */ w(
926
+ Je,
927
+ {
928
+ block: !0,
929
+ as: "p",
930
+ style: e.title ? {} : { marginTop: Z * (t > 0 ? 2 : 1) },
931
+ children: e.description
932
+ }
933
+ ),
934
+ ke(e.fields, e.gridTemplateColumns)
935
+ ] }, e.fields[0]?.internalName ?? `section-${t}`)) : ke(de, at),
936
+ /* @__PURE__ */ w(
937
+ It,
938
+ {
939
+ style: { marginTop: "22px" },
940
+ initialExternalMessages: ot,
941
+ ref: U
942
+ }
943
+ ),
944
+ it,
945
+ st
946
+ ]
947
+ }
948
+ );
949
+ return De ? /* @__PURE__ */ w($t, { localeText: De, children: We }) : We;
487
950
  };
488
951
  export {
489
- tt as EFWForm
952
+ rr as EFWForm
490
953
  };