@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.
- package/README.md +50 -14
- package/dist/index.d.ts +9 -15
- package/dist/index.js +95 -55
- package/dist/react-components/buttons/EFWButton/EFWButton.d.ts +1 -1
- package/dist/react-components/buttons/EFWButton/EFWButton.hooks.js +32 -31
- package/dist/react-components/buttons/EFWButton/EFWButton.js +158 -90
- package/dist/react-components/buttons/EFWButton/EFWButton.types.d.ts +32 -6
- package/dist/react-components/buttons/EFWButton/index.d.ts +1 -1
- package/dist/react-components/buttons/EFWDrawerButton/EFWDrawerButton.d.ts +1 -1
- package/dist/react-components/buttons/EFWDrawerButton/EFWDrawerButton.types.d.ts +1 -1
- package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.d.ts +1 -63
- package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.js +120 -85
- package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.types.d.ts +7 -1
- package/dist/react-components/buttons/EFWGroupButton/index.d.ts +1 -1
- package/dist/react-components/commons/caretPositioning.d.ts +35 -0
- package/dist/react-components/commons/caretPositioning.js +28 -0
- package/dist/react-components/commons/utils.d.ts +1 -1
- package/dist/react-components/commons/utils.js +1 -1
- package/dist/react-components/commons/valueNormalization.d.ts +28 -0
- package/dist/react-components/commons/valueNormalization.js +6 -0
- package/dist/react-components/fields/Attachments/EFWAttachments.js +205 -0
- package/dist/react-components/fields/{EFWAttachments → Attachments}/EFWAttachments.types.d.ts +32 -2
- package/dist/react-components/fields/Attachments/EFWAttachments.utils.d.ts +8 -0
- package/dist/react-components/fields/Attachments/EFWAttachments.utils.js +4 -0
- package/dist/react-components/fields/{EFWAttachments/EFWAttachmentsCard → Attachments}/EFWAttachmentsCard.d.ts +2 -11
- package/dist/react-components/fields/Attachments/EFWAttachmentsCard.js +164 -0
- package/dist/react-components/fields/{EFWAttachments/EFWAttachmentsCard → Attachments}/EFWAttachmentsCard.types.d.ts +21 -1
- package/dist/react-components/fields/Attachments/EFWAttachmentsField.js +70 -0
- package/dist/react-components/fields/{EFWAttachmentsField → Attachments}/EFWAttachmentsField.types.d.ts +2 -2
- package/dist/react-components/fields/Attachments/index.d.ts +5 -0
- package/dist/react-components/fields/Attachments/index.js +8 -0
- package/dist/react-components/fields/{EFWDatePicker → DatePicker}/EFWDatePicker.d.ts +1 -3
- package/dist/react-components/fields/DatePicker/EFWDatePicker.js +134 -0
- package/dist/react-components/fields/{EFWDatePicker → DatePicker}/EFWDatePicker.types.d.ts +19 -7
- package/dist/react-components/fields/DatePicker/EFWDatePicker.utils.d.ts +19 -0
- package/dist/react-components/fields/DatePicker/EFWDatePicker.utils.js +179 -0
- package/dist/react-components/fields/DatePicker/EFWDatePickerField.js +251 -0
- package/dist/react-components/fields/DatePicker/EFWDatePickerField.types.d.ts +15 -0
- package/dist/react-components/fields/DatePicker/index.d.ts +6 -0
- package/dist/react-components/fields/DatePicker/index.js +11 -0
- package/dist/react-components/fields/Input/EFWInput.d.ts +10 -0
- package/dist/react-components/fields/Input/EFWInput.js +260 -0
- package/dist/react-components/fields/{EFWInput → Input}/EFWInput.types.d.ts +120 -25
- package/dist/react-components/fields/Input/EFWInput.utils.d.ts +101 -0
- package/dist/react-components/fields/Input/EFWInput.utils.js +222 -0
- package/dist/react-components/fields/Input/EFWInput.validation.d.ts +20 -0
- package/dist/react-components/fields/Input/EFWInput.validation.js +72 -0
- package/dist/react-components/fields/Input/EFWInputField.js +86 -0
- package/dist/react-components/fields/{EFWInputField → Input}/EFWInputField.types.d.ts +2 -2
- package/dist/react-components/fields/Input/index.d.ts +5 -0
- package/dist/react-components/fields/Input/index.js +8 -0
- package/dist/react-components/fields/NumberInput/EFWNumberInput.js +339 -0
- package/dist/react-components/fields/{EFWNumberInput → NumberInput}/EFWNumberInput.types.d.ts +33 -14
- package/dist/react-components/fields/{EFWNumberInput → NumberInput}/EFWNumberInput.utils.d.ts +20 -14
- package/dist/react-components/fields/NumberInput/EFWNumberInput.utils.js +86 -0
- package/dist/react-components/fields/NumberInput/EFWNumberInputField.js +84 -0
- package/dist/react-components/fields/{EFWNumberInputField → NumberInput}/EFWNumberInputField.types.d.ts +2 -2
- package/dist/react-components/fields/NumberInput/index.d.ts +5 -0
- package/dist/react-components/fields/NumberInput/index.js +8 -0
- package/dist/react-components/fields/Switch/EFWSwitch.js +75 -0
- package/dist/react-components/fields/{EFWSwitch → Switch}/EFWSwitch.types.d.ts +18 -10
- package/dist/react-components/fields/Switch/EFWSwitch.utils.d.ts +9 -0
- package/dist/react-components/fields/Switch/EFWSwitch.utils.js +4 -0
- package/dist/react-components/fields/Switch/EFWSwitchField.js +62 -0
- package/dist/react-components/fields/{EFWSwitchField → Switch}/EFWSwitchField.types.d.ts +6 -2
- package/dist/react-components/fields/Switch/index.d.ts +5 -0
- package/dist/react-components/fields/Switch/index.js +8 -0
- package/dist/react-components/fields/TagPicker/EFWTagPicker.js +384 -0
- package/dist/react-components/fields/{EFWTagPicker → TagPicker}/EFWTagPicker.types.d.ts +30 -17
- package/dist/react-components/fields/TagPicker/EFWTagPicker.utils.d.ts +6 -0
- package/dist/react-components/fields/TagPicker/EFWTagPicker.utils.js +4 -0
- package/dist/react-components/fields/TagPicker/EFWTagPickerField.js +83 -0
- package/dist/react-components/fields/{EFWTagPickerField → TagPicker}/EFWTagPickerField.types.d.ts +2 -2
- package/dist/react-components/fields/TagPicker/index.d.ts +5 -0
- package/dist/react-components/fields/TagPicker/index.js +8 -0
- package/dist/react-components/fields/TextArea/EFWTextArea.js +153 -0
- package/dist/react-components/fields/{EFWTextArea → TextArea}/EFWTextArea.types.d.ts +26 -8
- package/dist/react-components/fields/TextArea/EFWTextArea.utils.d.ts +6 -0
- package/dist/react-components/fields/TextArea/EFWTextArea.utils.js +4 -0
- package/dist/react-components/fields/TextArea/EFWTextAreaField.js +80 -0
- package/dist/react-components/fields/{EFWTextAreaField → TextArea}/EFWTextAreaField.types.d.ts +2 -2
- package/dist/react-components/fields/TextArea/index.d.ts +5 -0
- package/dist/react-components/fields/TextArea/index.js +8 -0
- package/dist/react-components/fields/_shared/EFWField/EFWField.js +119 -0
- package/dist/react-components/fields/{EFWField → _shared/EFWField}/EFWField.types.d.ts +24 -13
- package/dist/react-components/fields/_shared/EFWField/EFWField.utils.js +20 -0
- package/dist/react-components/fields/_shared/EFWField/useSyncedValidationState.d.ts +50 -0
- package/dist/react-components/fields/_shared/EFWField/useSyncedValidationState.js +41 -0
- package/dist/react-components/fields/test-utils/testUtils.js +10 -0
- package/dist/react-components/forms/EFWForm/EFWForm.converter.d.ts +16 -1
- package/dist/react-components/forms/EFWForm/EFWForm.converter.js +51 -20
- package/dist/react-components/forms/EFWForm/EFWForm.flatConverter.d.ts +130 -0
- package/dist/react-components/forms/EFWForm/EFWForm.flatConverter.js +279 -0
- package/dist/react-components/forms/EFWForm/EFWForm.hooks.js +21 -18
- package/dist/react-components/forms/EFWForm/EFWForm.js +866 -403
- package/dist/react-components/forms/EFWForm/EFWForm.types.d.ts +213 -89
- package/dist/react-components/forms/EFWForm/EFWForm.utils.d.ts +10 -5
- package/dist/react-components/forms/EFWForm/EFWForm.utils.js +356 -229
- package/dist/react-components/forms/EFWForm/index.d.ts +5 -2
- package/dist/react-components/forms/EFWForm/index.js +10 -6
- package/dist/react-components/forms/EFWFormMessageBarGroup/EFWFormMessageBarGroup.js +55 -55
- package/dist/react-components/forms/EFWMessageBarManager/EFWMessageBarManager.js +38 -29
- package/dist/react-components/hooks/useDrawer/component/EFWDrawer/EFWDrawer.js +49 -47
- package/dist/react-components/hooks/useDrawer/component/EFWDrawer/EFWDrawer.types.d.ts +1 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/EFWDrawerLoader.d.ts +5 -3
- package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/EFWDrawerLoader.js +6 -6
- package/dist/react-components/hooks/useDrawer/index.d.ts +1 -1
- package/dist/react-components/hooks/useDrawer/useDrawer.d.ts +4 -2
- package/dist/react-components/hooks/useDrawer/useDrawer.js +216 -111
- package/dist/react-components/hooks/useDrawer/useDrawer.types.d.ts +15 -2
- package/dist/react-components/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.d.ts +42 -0
- package/dist/react-components/hooks/useIsomorphicLayoutEffect/useIsomorphicLayoutEffect.js +5 -0
- package/dist/react-components/i18n/PorygonI18nProvider.d.ts +13 -0
- package/dist/react-components/i18n/PorygonI18nProvider.js +145 -0
- package/dist/react-components/i18n/defaultLocaleText.d.ts +6 -0
- package/dist/react-components/i18n/defaultLocaleText.js +176 -0
- package/dist/react-components/i18n/index.d.ts +4 -0
- package/dist/react-components/i18n/index.js +19 -0
- package/dist/react-components/i18n/localePresets.d.ts +10 -0
- package/dist/react-components/i18n/localePresets.js +366 -0
- package/dist/react-components/i18n/porygonI18n.types.d.ts +169 -0
- package/dist/react-components/layout/MainNavItems/MainNavItems.js +13 -13
- package/dist/react-components/tables/EFWTable/EFWTable.d.ts +2 -5
- package/dist/react-components/tables/EFWTable/EFWTable.js +916 -525
- package/dist/react-components/tables/EFWTable/EFWTable.types.d.ts +256 -62
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.d.ts +5 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.js +97 -52
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.types.d.ts +4 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.d.ts +1 -12
- package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.js +47 -22
- package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.types.d.ts +13 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.js +94 -69
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.types.d.ts +7 -16
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/index.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.js +218 -83
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.types.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.js +90 -88
- package/dist/react-components/tables/EFWTable/components/EFWTableOverlay/EFWTableOverlay.types.d.ts +5 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.d.ts +1 -18
- package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.js +83 -45
- package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.types.d.ts +23 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.d.ts +2 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.js +65 -48
- package/dist/react-components/tables/EFWTable/hooks/useDefaultDeleteButton/useDefaultDeleteButton.d.ts +2 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultDeleteButton/useDefaultDeleteButton.js +71 -48
- package/dist/react-components/tables/EFWTable/hooks/useDefaultFilterButton/useDefaultFilterButton.d.ts +17 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultFilterButton/useDefaultFilterButton.js +255 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.d.ts +2 -1
- package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.js +72 -52
- package/dist/react-components/tables/EFWTable/hooks/useStableColumnRenderers/useStableColumnRenderers.d.ts +10 -0
- package/dist/react-components/tables/EFWTable/hooks/useStableColumnRenderers/useStableColumnRenderers.js +28 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.js +151 -115
- package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.d.ts +1 -1
- package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.js +100 -53
- package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.types.d.ts +5 -1
- package/dist/react-components/tables/EFWTable/index.d.ts +4 -1
- package/dist/react-components/tables/EFWTable/index.js +7 -5
- package/dist/react-components/tables/EFWTable/utils/CellRenderer/CellRenderer.js +26 -23
- package/dist/react-components/tables/EFWTable/utils/cache.d.ts +1 -8
- package/dist/react-components/tables/EFWTable/utils/cache.js +40 -49
- package/dist/react-components/tables/EFWTable/utils/filterFunctions.d.ts +16 -0
- package/dist/react-components/tables/EFWTable/utils/filterFunctions.js +52 -0
- package/dist/react-components/tables/EFWTable/utils/hashing.d.ts +2 -2
- package/dist/react-components/tables/EFWTable/utils/hashing.js +2 -2
- package/package.json +49 -22
- package/dist/react-components/fields/EFWAttachments/EFWAttachments.js +0 -125
- package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/EFWAttachmentsCard.js +0 -107
- package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/index.d.ts +0 -1
- package/dist/react-components/fields/EFWAttachments/index.d.ts +0 -2
- package/dist/react-components/fields/EFWAttachments/index.js +0 -4
- package/dist/react-components/fields/EFWAttachmentsField/EFWAttachmentsField.js +0 -57
- package/dist/react-components/fields/EFWAttachmentsField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWAttachmentsField/index.js +0 -4
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.js +0 -114
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.utils.d.ts +0 -24
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.utils.js +0 -90
- package/dist/react-components/fields/EFWDatePicker/index.d.ts +0 -2
- package/dist/react-components/fields/EFWDatePicker/index.js +0 -4
- package/dist/react-components/fields/EFWDatePickerField/EFWDatePickerField.js +0 -65
- package/dist/react-components/fields/EFWDatePickerField/EFWDatePickerField.types.d.ts +0 -7
- package/dist/react-components/fields/EFWDatePickerField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWDatePickerField/index.js +0 -4
- package/dist/react-components/fields/EFWField/EFWField.js +0 -96
- package/dist/react-components/fields/EFWField/EFWField.utils.js +0 -17
- package/dist/react-components/fields/EFWInput/EFWInput.d.ts +0 -26
- package/dist/react-components/fields/EFWInput/EFWInput.js +0 -119
- package/dist/react-components/fields/EFWInput/EFWInput.utils.d.ts +0 -20
- package/dist/react-components/fields/EFWInput/EFWInput.utils.js +0 -83
- package/dist/react-components/fields/EFWInput/index.d.ts +0 -2
- package/dist/react-components/fields/EFWInput/index.js +0 -4
- package/dist/react-components/fields/EFWInputField/EFWInputField.js +0 -73
- package/dist/react-components/fields/EFWInputField/EFWInputField.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWInputField/EFWInputField.utils.js +0 -0
- package/dist/react-components/fields/EFWInputField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWInputField/index.js +0 -4
- package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.js +0 -198
- package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.utils.js +0 -76
- package/dist/react-components/fields/EFWNumberInput/index.d.ts +0 -2
- package/dist/react-components/fields/EFWNumberInput/index.js +0 -4
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.js +0 -67
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.utils.js +0 -0
- package/dist/react-components/fields/EFWNumberInputField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWNumberInputField/index.js +0 -4
- package/dist/react-components/fields/EFWSwitch/EFWSwitch.js +0 -55
- package/dist/react-components/fields/EFWSwitch/index.d.ts +0 -2
- package/dist/react-components/fields/EFWSwitch/index.js +0 -4
- package/dist/react-components/fields/EFWSwitchField/EFWSwitchField.js +0 -55
- package/dist/react-components/fields/EFWSwitchField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWSwitchField/index.js +0 -4
- package/dist/react-components/fields/EFWTagPicker/EFWTagPicker.js +0 -244
- package/dist/react-components/fields/EFWTagPicker/index.d.ts +0 -2
- package/dist/react-components/fields/EFWTagPicker/index.js +0 -4
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.js +0 -74
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.utils.js +0 -0
- package/dist/react-components/fields/EFWTagPickerField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWTagPickerField/index.js +0 -4
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.js +0 -105
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.utils.js +0 -0
- package/dist/react-components/fields/EFWTextArea/index.d.ts +0 -2
- package/dist/react-components/fields/EFWTextArea/index.js +0 -4
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.js +0 -71
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.utils.d.ts +0 -1
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.utils.js +0 -0
- package/dist/react-components/fields/EFWTextAreaField/index.d.ts +0 -2
- package/dist/react-components/fields/EFWTextAreaField/index.js +0 -4
- package/dist/react-components/fields/types.d.ts +0 -1
- package/dist/react-components/fields/types.js +0 -0
- package/dist/utils/htmlConverter.d.ts +0 -15
- package/dist/utils/htmlConverter.js +0 -12
- /package/dist/react-components/fields/{EFWAttachments → Attachments}/EFWAttachments.d.ts +0 -0
- /package/dist/react-components/fields/{EFWAttachmentsField → Attachments}/EFWAttachmentsField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWDatePickerField → DatePicker}/EFWDatePickerField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWInputField → Input}/EFWInputField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWNumberInput → NumberInput}/EFWNumberInput.d.ts +0 -0
- /package/dist/react-components/fields/{EFWNumberInputField → NumberInput}/EFWNumberInputField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWSwitch → Switch}/EFWSwitch.d.ts +0 -0
- /package/dist/react-components/fields/{EFWSwitchField → Switch}/EFWSwitchField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWTagPicker → TagPicker}/EFWTagPicker.d.ts +0 -0
- /package/dist/react-components/fields/{EFWTagPickerField → TagPicker}/EFWTagPickerField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWTextArea → TextArea}/EFWTextArea.d.ts +0 -0
- /package/dist/react-components/fields/{EFWTextAreaField → TextArea}/EFWTextAreaField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWField → _shared/EFWField}/EFWField.d.ts +0 -0
- /package/dist/react-components/fields/{EFWField → _shared/EFWField}/EFWField.utils.d.ts +0 -0
- /package/dist/react-components/fields/{EFWField → _shared/EFWField}/index.d.ts +0 -0
- /package/dist/react-components/fields/{EFWField → _shared/EFWField}/index.js +0 -0
- /package/dist/{react-components/fields/EFWAttachments/EFWAttachmentsCard/index.js → vite-raw.d.js} +0 -0
|
@@ -1,402 +1,803 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useMemo as
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
|
|
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
|
-
}),
|
|
13
|
-
|
|
14
|
-
|
|
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:
|
|
18
|
-
//
|
|
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:
|
|
24
|
-
//
|
|
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
|
-
},
|
|
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 :
|
|
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 :
|
|
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 :
|
|
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 :
|
|
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,
|
|
44
|
-
return
|
|
135
|
+
const S = s.typeAsString, E = S ? X[S] : void 0;
|
|
136
|
+
return E !== void 0 ? E : void 0;
|
|
45
137
|
}
|
|
46
138
|
}
|
|
47
|
-
},
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
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
|
|
65
|
-
},
|
|
148
|
+
return g && (E.current += 1, S.current = { ...s }), E.current;
|
|
149
|
+
}, rr = (s) => {
|
|
66
150
|
const {
|
|
67
151
|
title: S,
|
|
68
|
-
description:
|
|
69
|
-
hidden:
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
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
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
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
|
-
|
|
335
|
+
k.current[e] = {
|
|
137
336
|
validationState: t.currentValidationState,
|
|
138
337
|
validationMessage: t.currentValidationMessage
|
|
139
|
-
},
|
|
140
|
-
...
|
|
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
|
-
),
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
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
|
-
|
|
360
|
+
const r = Fe.current;
|
|
361
|
+
r?.(e, t);
|
|
159
362
|
},
|
|
160
|
-
[
|
|
161
|
-
),
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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
|
-
|
|
210
|
-
|
|
211
|
-
|
|
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
|
-
|
|
214
|
-
|
|
215
|
-
|
|
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
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
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
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
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
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
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
|
-
}, [
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
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
|
-
|
|
295
|
-
|
|
296
|
-
|
|
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
|
-
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
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
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
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 (
|
|
314
|
-
|
|
664
|
+
if (O !== void 0) {
|
|
665
|
+
pe.current = "";
|
|
315
666
|
return;
|
|
316
667
|
}
|
|
317
|
-
const e = `uncontrolled::${
|
|
318
|
-
|
|
319
|
-
}, [
|
|
320
|
-
|
|
321
|
-
|
|
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
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
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
|
-
|
|
333
|
-
|
|
334
|
-
}, [
|
|
335
|
-
const
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
...c
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
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
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
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
|
|
437
|
-
const t = e.internalName,
|
|
438
|
-
return /* @__PURE__ */
|
|
439
|
-
|
|
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
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
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:
|
|
460
|
-
gap:
|
|
461
|
-
|
|
895
|
+
gridTemplateColumns: r,
|
|
896
|
+
gap: Z,
|
|
897
|
+
margin: `${Z}px 0px 0px`
|
|
462
898
|
},
|
|
463
|
-
children: e.map(
|
|
899
|
+
children: e.map(Vt)
|
|
464
900
|
}
|
|
465
901
|
);
|
|
466
|
-
};
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
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
|
-
|
|
952
|
+
rr as EFWForm
|
|
490
953
|
};
|