@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,57 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { EFWField as A } from "../EFWField/EFWField.js";
|
|
3
|
-
import { EFWAttachment as E } from "../EFWAttachments/EFWAttachments.js";
|
|
4
|
-
const j = (a) => {
|
|
5
|
-
const {
|
|
6
|
-
title: n,
|
|
7
|
-
infoLabel: i,
|
|
8
|
-
hint: l,
|
|
9
|
-
style: o = {},
|
|
10
|
-
required: d = !1,
|
|
11
|
-
validationState: r,
|
|
12
|
-
validationMessage: s,
|
|
13
|
-
disabled: h = !1,
|
|
14
|
-
editable: e = !0,
|
|
15
|
-
hidden: m = !1,
|
|
16
|
-
files: c,
|
|
17
|
-
defaultFiles: f,
|
|
18
|
-
multiple: g = !0,
|
|
19
|
-
acceptedTypes: p = "*/*",
|
|
20
|
-
onRemoveAttachment: u,
|
|
21
|
-
onChange: F,
|
|
22
|
-
onValidationChange: b
|
|
23
|
-
} = a;
|
|
24
|
-
return /* @__PURE__ */ t(
|
|
25
|
-
A,
|
|
26
|
-
{
|
|
27
|
-
style: o,
|
|
28
|
-
title: n,
|
|
29
|
-
infoLabel: i,
|
|
30
|
-
weightLabel: e ? "regular" : "semibold",
|
|
31
|
-
hint: l,
|
|
32
|
-
hidden: m,
|
|
33
|
-
required: d,
|
|
34
|
-
validationState: r,
|
|
35
|
-
validationMessage: s,
|
|
36
|
-
onValidationChange: b,
|
|
37
|
-
children: /* @__PURE__ */ t(
|
|
38
|
-
E,
|
|
39
|
-
{
|
|
40
|
-
files: c,
|
|
41
|
-
defaultFiles: f,
|
|
42
|
-
editable: e,
|
|
43
|
-
onChange: (C, v) => {
|
|
44
|
-
F?.(C, v);
|
|
45
|
-
},
|
|
46
|
-
disabled: h,
|
|
47
|
-
multiple: g,
|
|
48
|
-
acceptedTypes: p,
|
|
49
|
-
onRemoveAttachment: u
|
|
50
|
-
}
|
|
51
|
-
)
|
|
52
|
-
}
|
|
53
|
-
);
|
|
54
|
-
};
|
|
55
|
-
export {
|
|
56
|
-
j as EFWAttachmentsField
|
|
57
|
-
};
|
|
@@ -1,114 +0,0 @@
|
|
|
1
|
-
import { jsx as g, Fragment as H } from "react/jsx-runtime";
|
|
2
|
-
import { makeStyles as J, tokens as l, mergeClasses as K, Text as O } from "@fluentui/react-components";
|
|
3
|
-
import { useId as Q, useMemo as M, useState as X, useRef as F, useCallback as h, useEffect as Z } from "react";
|
|
4
|
-
import { DatePicker as ee } from "@fluentui/react-datepicker-compat";
|
|
5
|
-
import { mapToValidDates as D, esLocalizedStrings as x } from "./EFWDatePicker.utils.js";
|
|
6
|
-
const p = [], te = J({
|
|
7
|
-
efwDatePickerControl: {
|
|
8
|
-
"& [disabled]": {
|
|
9
|
-
backgroundColor: l.colorNeutralBackground3,
|
|
10
|
-
color: l.colorNeutralForeground2,
|
|
11
|
-
"&::placeholder": {
|
|
12
|
-
color: "transparent"
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
// Afectar el span que contiene el input disabled
|
|
16
|
-
"&:has([disabled])": {
|
|
17
|
-
backgroundColor: l.colorNeutralBackground3
|
|
18
|
-
}
|
|
19
|
-
},
|
|
20
|
-
efwDatePickerControlError: {
|
|
21
|
-
backgroundColor: l.colorPaletteRedBackground1,
|
|
22
|
-
"::after": {
|
|
23
|
-
borderBottomColor: l.colorPaletteRedBorder2,
|
|
24
|
-
borderBottomStyle: "solid",
|
|
25
|
-
borderBottomWidth: "2px"
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}), se = (C) => {
|
|
29
|
-
const {
|
|
30
|
-
editable: T = !0,
|
|
31
|
-
disabled: Y = !1,
|
|
32
|
-
placeholder: B = "DD/MM/YYYY",
|
|
33
|
-
className: V = "",
|
|
34
|
-
selectedDates: S = p,
|
|
35
|
-
defaultSelectedDates: u = p,
|
|
36
|
-
allowTextInput: $ = !0,
|
|
37
|
-
localizedStrings: w = x,
|
|
38
|
-
minDate: E,
|
|
39
|
-
maxDate: I,
|
|
40
|
-
showGoToToday: N = !0,
|
|
41
|
-
showCloseButton: R = !0,
|
|
42
|
-
restrictedDates: v = p,
|
|
43
|
-
friendlyDateFormat: k = !1,
|
|
44
|
-
onSelectDate: s,
|
|
45
|
-
onChange: d,
|
|
46
|
-
validationState: z = "none",
|
|
47
|
-
setParentComponentState: m
|
|
48
|
-
} = C, P = Q(), b = te(), n = C.selectedDates !== void 0, A = M(() => D(S ?? []), [S]), y = M(() => D(u), [u]), [L, f] = X(() => D(u)), e = n ? A : L, W = F(null), j = F(null), G = h((o) => {
|
|
49
|
-
if (!o) return "";
|
|
50
|
-
const a = o.getDate(), t = o.getMonth(), c = o.getFullYear();
|
|
51
|
-
if (k)
|
|
52
|
-
return `${x.months[t]} ${a}, ${c}`;
|
|
53
|
-
{
|
|
54
|
-
const i = a < 10 ? `0${a}` : a, r = t + 1 < 10 ? `0${t + 1}` : t + 1;
|
|
55
|
-
return `${i}/${r}/${c}`;
|
|
56
|
-
}
|
|
57
|
-
}, [k]), U = h((o) => {
|
|
58
|
-
const a = e.length && e[0] instanceof Date ? e[0] : /* @__PURE__ */ new Date(), t = (o || "").trim().split("/"), c = t.length > 0 ? Math.max(1, Math.min(31, parseInt(t[0], 10))) : a.getDate(), i = t.length > 1 ? Math.max(1, Math.min(12, parseInt(t[1], 10))) - 1 : a.getMonth();
|
|
59
|
-
let r = t.length > 2 ? parseInt(t[2], 10) : a.getFullYear();
|
|
60
|
-
return r < 100 && (r += a.getFullYear() - a.getFullYear() % 100), new Date(r, i, c);
|
|
61
|
-
}, [e]), _ = h((o) => {
|
|
62
|
-
if (!(o instanceof Date)) {
|
|
63
|
-
!n && e.length > 0 && f([]), s?.(null), d?.([]), m?.("none", "");
|
|
64
|
-
return;
|
|
65
|
-
}
|
|
66
|
-
if (e.length > 0 && e[0] instanceof Date ? e[0].getTime() === o.getTime() : !1) {
|
|
67
|
-
s?.(o);
|
|
68
|
-
return;
|
|
69
|
-
}
|
|
70
|
-
const t = [o];
|
|
71
|
-
n || f(t), s?.(o), d?.(t), m?.("none", "");
|
|
72
|
-
}, [e, n, s, d, m]);
|
|
73
|
-
Z(() => {
|
|
74
|
-
n || f(y);
|
|
75
|
-
}, [n, y]);
|
|
76
|
-
const q = K(
|
|
77
|
-
V,
|
|
78
|
-
b.efwDatePickerControl,
|
|
79
|
-
z === "error" && b.efwDatePickerControlError
|
|
80
|
-
);
|
|
81
|
-
return /* @__PURE__ */ g(H, { children: T ? /* @__PURE__ */ g(
|
|
82
|
-
ee,
|
|
83
|
-
{
|
|
84
|
-
calendar: {
|
|
85
|
-
componentRef: j,
|
|
86
|
-
restrictedDates: v
|
|
87
|
-
},
|
|
88
|
-
strings: w,
|
|
89
|
-
className: q,
|
|
90
|
-
ref: W,
|
|
91
|
-
id: P,
|
|
92
|
-
name: P,
|
|
93
|
-
autoComplete: "off",
|
|
94
|
-
autoCorrect: "off",
|
|
95
|
-
autoCapitalize: "off",
|
|
96
|
-
spellCheck: "false",
|
|
97
|
-
allowTextInput: $,
|
|
98
|
-
disableAutoFocus: !0,
|
|
99
|
-
value: e.length > 0 ? e[0] : null,
|
|
100
|
-
minDate: E,
|
|
101
|
-
maxDate: I,
|
|
102
|
-
disabled: Y,
|
|
103
|
-
onSelectDate: _,
|
|
104
|
-
formatDate: G,
|
|
105
|
-
parseDateFromString: U,
|
|
106
|
-
placeholder: B,
|
|
107
|
-
showGoToToday: N,
|
|
108
|
-
showCloseButton: R
|
|
109
|
-
}
|
|
110
|
-
) : /* @__PURE__ */ g(O, { style: e.length ? void 0 : { opacity: 0.7 }, children: e.length > 0 && e[0] instanceof Date ? e[0].toLocaleDateString() : "Sin datos disponibles" }) });
|
|
111
|
-
};
|
|
112
|
-
export {
|
|
113
|
-
se as EFWDatePicker
|
|
114
|
-
};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { CalendarStrings } from '@fluentui/react-datepicker-compat';
|
|
2
|
-
|
|
3
|
-
declare const esLocalizedStrings: CalendarStrings;
|
|
4
|
-
/**
|
|
5
|
-
* Formatea una fecha en el formato "[mes en español] [día], [año]"
|
|
6
|
-
* Por ejemplo: "mayo 2, 2025"
|
|
7
|
-
*
|
|
8
|
-
* @param {Date} [date] - Objeto Date opcional a formatear
|
|
9
|
-
* @returns {string} Fecha formateada en español o cadena vacía si no se proporciona fecha
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* // Retorna "mayo 2, 2025" (asumiendo que esLocalizedStrings.months[4] es "mayo")
|
|
13
|
-
* esOnFormatDate(new Date(2025, 4, 2));
|
|
14
|
-
*
|
|
15
|
-
* @example
|
|
16
|
-
* // Retorna cadena vacía
|
|
17
|
-
* esOnFormatDate();
|
|
18
|
-
*/
|
|
19
|
-
declare const esOnFormatDate: (date?: Date, friendlyFormat?: boolean) => string;
|
|
20
|
-
declare const normalizeToDate: (value: Date | string | null | undefined) => Date | null;
|
|
21
|
-
declare const arraysAreEqual: (arr1: (Date | string)[], arr2: (Date | string)[]) => boolean;
|
|
22
|
-
export declare const mapToValidDates: (arr?: unknown[]) => Date[];
|
|
23
|
-
export declare const isValidDate: (date: Date) => boolean;
|
|
24
|
-
export { esLocalizedStrings, esOnFormatDate, normalizeToDate, arraysAreEqual };
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
import { defaultDatePickerStrings as l } from "@fluentui/react-datepicker-compat";
|
|
2
|
-
const c = {
|
|
3
|
-
...l,
|
|
4
|
-
days: [
|
|
5
|
-
"Domingo",
|
|
6
|
-
"Lunes",
|
|
7
|
-
"Martes",
|
|
8
|
-
"Miercoles",
|
|
9
|
-
"Jueves",
|
|
10
|
-
"Viernes",
|
|
11
|
-
"Sabado"
|
|
12
|
-
],
|
|
13
|
-
shortDays: ["D", "L", "M", "M", "J", "V", "S"],
|
|
14
|
-
months: [
|
|
15
|
-
"Enero",
|
|
16
|
-
"Febrero",
|
|
17
|
-
"Marzo",
|
|
18
|
-
"Abril",
|
|
19
|
-
"Mayo",
|
|
20
|
-
"Junio",
|
|
21
|
-
"Julio",
|
|
22
|
-
"Agosto",
|
|
23
|
-
"Septiembre",
|
|
24
|
-
"Octubre",
|
|
25
|
-
"Noviembre",
|
|
26
|
-
"Diciembre"
|
|
27
|
-
],
|
|
28
|
-
shortMonths: [
|
|
29
|
-
"Ene",
|
|
30
|
-
"Feb",
|
|
31
|
-
"Mar",
|
|
32
|
-
"Abr",
|
|
33
|
-
"May",
|
|
34
|
-
"Jun",
|
|
35
|
-
"Jul",
|
|
36
|
-
"Ago",
|
|
37
|
-
"Sep",
|
|
38
|
-
"Oct",
|
|
39
|
-
"Nov",
|
|
40
|
-
"Dic"
|
|
41
|
-
],
|
|
42
|
-
goToToday: "Ir a hoy"
|
|
43
|
-
}, g = (t, n = !1) => {
|
|
44
|
-
if (!t) return "";
|
|
45
|
-
const e = t.getDate(), r = t.getMonth(), o = t.getFullYear();
|
|
46
|
-
if (n)
|
|
47
|
-
return `${c.months[r]} ${e}, ${o}`;
|
|
48
|
-
{
|
|
49
|
-
const i = e < 10 ? `0${e}` : e, u = r + 1 < 10 ? `0${r + 1}` : r + 1;
|
|
50
|
-
return `${i}/${u}/${o}`;
|
|
51
|
-
}
|
|
52
|
-
}, a = (t) => {
|
|
53
|
-
if (t instanceof Date) return t;
|
|
54
|
-
if (typeof t == "string")
|
|
55
|
-
try {
|
|
56
|
-
const n = new Date(t);
|
|
57
|
-
return isNaN(n.getTime()) ? null : n;
|
|
58
|
-
} catch {
|
|
59
|
-
return null;
|
|
60
|
-
}
|
|
61
|
-
return null;
|
|
62
|
-
}, D = (t, n) => {
|
|
63
|
-
if (t.length !== n.length) return !1;
|
|
64
|
-
for (let e = 0; e < t.length; e++) {
|
|
65
|
-
const r = a(t[e]), o = a(n[e]);
|
|
66
|
-
if (!(r === null && o === null) && (r === null || o === null || r.getTime() !== o.getTime()))
|
|
67
|
-
return !1;
|
|
68
|
-
}
|
|
69
|
-
return !0;
|
|
70
|
-
}, h = (t = []) => t.map((n) => {
|
|
71
|
-
if (n instanceof Date)
|
|
72
|
-
return s(n) ? n : null;
|
|
73
|
-
if (typeof n == "string") {
|
|
74
|
-
const e = new Date(n);
|
|
75
|
-
return s(e) ? e : null;
|
|
76
|
-
}
|
|
77
|
-
if (typeof n == "number") {
|
|
78
|
-
const e = new Date(n);
|
|
79
|
-
return s(e) ? e : null;
|
|
80
|
-
}
|
|
81
|
-
return null;
|
|
82
|
-
}).filter((n) => n !== null), s = (t) => t instanceof Date && !isNaN(t.getTime());
|
|
83
|
-
export {
|
|
84
|
-
D as arraysAreEqual,
|
|
85
|
-
c as esLocalizedStrings,
|
|
86
|
-
g as esOnFormatDate,
|
|
87
|
-
s as isValidDate,
|
|
88
|
-
h as mapToValidDates,
|
|
89
|
-
a as normalizeToDate
|
|
90
|
-
};
|
|
@@ -1,65 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { EFWField as E } from "../EFWField/EFWField.js";
|
|
3
|
-
import { EFWDatePicker as M } from "../EFWDatePicker/EFWDatePicker.js";
|
|
4
|
-
const k = (a) => {
|
|
5
|
-
const {
|
|
6
|
-
title: l,
|
|
7
|
-
infoLabel: o,
|
|
8
|
-
hint: i,
|
|
9
|
-
style: r = {},
|
|
10
|
-
required: s = !1,
|
|
11
|
-
validationState: d,
|
|
12
|
-
validationMessage: n,
|
|
13
|
-
disabled: c = !1,
|
|
14
|
-
editable: e = !0,
|
|
15
|
-
hidden: f = !1,
|
|
16
|
-
onChange: h,
|
|
17
|
-
placeholder: m = "DD/MM/YYYY",
|
|
18
|
-
selectedDates: D,
|
|
19
|
-
defaultSelectedDates: u,
|
|
20
|
-
allowRangeSelection: g = !1,
|
|
21
|
-
restrictedDates: p = [],
|
|
22
|
-
allowTextInput: b = !0,
|
|
23
|
-
minDate: w,
|
|
24
|
-
maxDate: F,
|
|
25
|
-
showGoToToday: x,
|
|
26
|
-
showCloseButton: Y,
|
|
27
|
-
onValidationChange: C
|
|
28
|
-
} = a;
|
|
29
|
-
return /* @__PURE__ */ t(
|
|
30
|
-
E,
|
|
31
|
-
{
|
|
32
|
-
style: r,
|
|
33
|
-
title: l,
|
|
34
|
-
infoLabel: o,
|
|
35
|
-
weightLabel: e ? "regular" : "semibold",
|
|
36
|
-
hint: i,
|
|
37
|
-
hidden: f,
|
|
38
|
-
required: s,
|
|
39
|
-
validationState: d,
|
|
40
|
-
validationMessage: n,
|
|
41
|
-
onValidationChange: C,
|
|
42
|
-
children: /* @__PURE__ */ t(
|
|
43
|
-
M,
|
|
44
|
-
{
|
|
45
|
-
editable: e,
|
|
46
|
-
selectedDates: D,
|
|
47
|
-
defaultSelectedDates: u,
|
|
48
|
-
minDate: w,
|
|
49
|
-
maxDate: F,
|
|
50
|
-
onChange: h,
|
|
51
|
-
allowTextInput: b,
|
|
52
|
-
disabled: c,
|
|
53
|
-
placeholder: m,
|
|
54
|
-
restrictedDates: p,
|
|
55
|
-
allowRangeSelection: g,
|
|
56
|
-
showGoToToday: x,
|
|
57
|
-
showCloseButton: Y
|
|
58
|
-
}
|
|
59
|
-
)
|
|
60
|
-
}
|
|
61
|
-
);
|
|
62
|
-
};
|
|
63
|
-
export {
|
|
64
|
-
k as EFWDatePickerField
|
|
65
|
-
};
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { EFWFieldProps } from '../EFWField/EFWField.types';
|
|
2
|
-
import { EFWDatePickerProps, EFWDatePickerValue, EFWDatePickerOnChange } from '../EFWDatePicker/EFWDatePicker.types';
|
|
3
|
-
|
|
4
|
-
export type EFWDatePickerFieldValue = EFWDatePickerValue;
|
|
5
|
-
export type EFWDatePickerFieldOnChange = EFWDatePickerOnChange;
|
|
6
|
-
export interface EFWDatePickerFieldProps extends Omit<EFWFieldProps, 'children'>, EFWDatePickerProps {
|
|
7
|
-
}
|
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
import { jsx as v } from "react/jsx-runtime";
|
|
2
|
-
import { makeStyles as R, InfoLabel as D, mergeClasses as W, Field as $ } from "@fluentui/react-components";
|
|
3
|
-
import j, { useState as x, useMemo as M, useRef as p, useEffect as l, useCallback as q } from "react";
|
|
4
|
-
import { getValidationIcon as z } from "./EFWField.utils.js";
|
|
5
|
-
const G = R({
|
|
6
|
-
"efw-textField": {
|
|
7
|
-
"& .fui-Field__validationMessage:empty": {
|
|
8
|
-
display: "none !important"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"efw-textField-success": {
|
|
12
|
-
"& .fui-Field__validationMessage": {
|
|
13
|
-
color: "var(--colorPaletteGreenBorder2)"
|
|
14
|
-
}
|
|
15
|
-
},
|
|
16
|
-
"efw-textField-warning": {
|
|
17
|
-
"& .fui-Field__validationMessage": {
|
|
18
|
-
color: "var(--colorPaletteDarkOrangeForeground1)"
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
"efw-textField-error": {
|
|
22
|
-
"::after": {
|
|
23
|
-
borderBottom: "2px solid var(--colorPaletteRedBorder2) !important"
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}), K = (V) => {
|
|
27
|
-
const {
|
|
28
|
-
title: o,
|
|
29
|
-
hint: h,
|
|
30
|
-
className: y,
|
|
31
|
-
style: _ = {},
|
|
32
|
-
infoLabel: r,
|
|
33
|
-
weightLabel: s = "regular",
|
|
34
|
-
required: d = !1,
|
|
35
|
-
hidden: b = !1,
|
|
36
|
-
orientation: C,
|
|
37
|
-
size: I,
|
|
38
|
-
children: c,
|
|
39
|
-
validationState: t = "none",
|
|
40
|
-
validationMessage: a = "",
|
|
41
|
-
onValidationChange: f
|
|
42
|
-
} = V, n = G(), [e, u] = x(t), [i, g] = x(a), E = M(
|
|
43
|
-
() => z(e),
|
|
44
|
-
[e]
|
|
45
|
-
), L = M(() => /* @__PURE__ */ v(D, { weight: s, info: r || "", required: d, children: o }), [r, d, s, o]), m = p(0);
|
|
46
|
-
l(() => {
|
|
47
|
-
m.current += 1, console.log(`EFWField ${o} #${m.current}`);
|
|
48
|
-
});
|
|
49
|
-
const F = p(!1);
|
|
50
|
-
l(() => {
|
|
51
|
-
if (!F.current) {
|
|
52
|
-
F.current = !0;
|
|
53
|
-
return;
|
|
54
|
-
}
|
|
55
|
-
u(t), g(a);
|
|
56
|
-
}, [t, a]);
|
|
57
|
-
const P = q((w = "none", S = "") => {
|
|
58
|
-
const B = w !== "none" ? w : t, N = S !== "" ? S : a;
|
|
59
|
-
u(B), g(N);
|
|
60
|
-
}, [t, a]);
|
|
61
|
-
if (l(() => {
|
|
62
|
-
f?.({
|
|
63
|
-
currentValidationState: e,
|
|
64
|
-
currentValidationMessage: i
|
|
65
|
-
});
|
|
66
|
-
}, [e, i, f]), b) return null;
|
|
67
|
-
const k = W(
|
|
68
|
-
y,
|
|
69
|
-
n["efw-textField"],
|
|
70
|
-
e === "success" && n["efw-textField-success"],
|
|
71
|
-
e === "warning" && n["efw-textField-warning"],
|
|
72
|
-
e === "error" && n["efw-textField-error"]
|
|
73
|
-
);
|
|
74
|
-
return /* @__PURE__ */ v(
|
|
75
|
-
$,
|
|
76
|
-
{
|
|
77
|
-
style: { ..._ },
|
|
78
|
-
className: k,
|
|
79
|
-
label: L,
|
|
80
|
-
hint: h,
|
|
81
|
-
validationState: e,
|
|
82
|
-
validationMessage: i,
|
|
83
|
-
validationMessageIcon: E,
|
|
84
|
-
orientation: C,
|
|
85
|
-
size: I,
|
|
86
|
-
children: c && j.cloneElement(c, {
|
|
87
|
-
setParentComponentState: P,
|
|
88
|
-
validationState: e,
|
|
89
|
-
validationMessage: i
|
|
90
|
-
})
|
|
91
|
-
}
|
|
92
|
-
);
|
|
93
|
-
};
|
|
94
|
-
export {
|
|
95
|
-
K as EFWField
|
|
96
|
-
};
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { jsx as r } from "react/jsx-runtime";
|
|
2
|
-
import { CheckmarkCircle12Regular as a, Warning12Regular as n, ErrorCircle12Regular as t } from "@fluentui/react-icons";
|
|
3
|
-
const u = (e) => {
|
|
4
|
-
switch (e) {
|
|
5
|
-
case "error":
|
|
6
|
-
return /* @__PURE__ */ r(t, {});
|
|
7
|
-
case "warning":
|
|
8
|
-
return /* @__PURE__ */ r(n, {});
|
|
9
|
-
case "success":
|
|
10
|
-
return /* @__PURE__ */ r(a, {});
|
|
11
|
-
default:
|
|
12
|
-
return null;
|
|
13
|
-
}
|
|
14
|
-
};
|
|
15
|
-
export {
|
|
16
|
-
u as getValidationIcon
|
|
17
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { EFWInputProps } from './EFWInput.types';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Componente de entrada de texto personalizado con soporte para formateo y validación.
|
|
5
|
-
* Permite manejar valores con formatos específicos (como RUT chileno, correo electrónico, números) y valida la entrada del usuario.
|
|
6
|
-
* @param {EFWInputProps} props - Propiedades del componente.
|
|
7
|
-
* @param {string} [props.value=""] - Valor inicial del input.
|
|
8
|
-
* @param {(rawValue: string, formattedValue: string) => void} [props.onChange] - Función llamada cuando cambia el valor del input.
|
|
9
|
-
* @param {boolean} [props.editable=true] - Indica si el input es editable o de solo lectura.
|
|
10
|
-
* @param {boolean} [props.disabled=false] - Indica si el input está deshabilitado.
|
|
11
|
-
* @param {string} [props.autoComplete="off"] - Configuración de autocompletado del input.
|
|
12
|
-
* @param {string} [props.type="text"] - Tipo de input (por ejemplo, 'text', 'number').
|
|
13
|
-
* @param {string} [props.placeholder] - Texto placeholder del input.
|
|
14
|
-
* @param {React.ReactNode} [props.contentBefore] - Contenido renderizado antes del input.
|
|
15
|
-
* @param {React.ReactNode} [props.contentAfter] - Contenido renderizado después del input.
|
|
16
|
-
* @param {string} [props.formatType="none"] - Tipo de formateo aplicado al valor (por ejemplo, 'chileanRut', 'email', 'number').
|
|
17
|
-
* @param {string} [props.formatPattern] - Expresión regular para validar el formato del valor.
|
|
18
|
-
* @param {(value: string) => string} [props.formatFunction] - Función personalizada para formatear el valor.
|
|
19
|
-
* @param {number} [props.maxLength=250] - Longitud máxima del valor en caracteres.
|
|
20
|
-
* @param {number} [props.maxValue] - Valor numérico máximo permitido (para `formatType="number"`).
|
|
21
|
-
* @param {number} [props.minValue] - Valor numérico mínimo permitido (para `formatType="number"`).
|
|
22
|
-
* @param {string} [props.validationState="none"] - Estado de validación externo ('none', 'error').
|
|
23
|
-
* @param {(state: string, message: string) => void} [props.setParentComponentState] - Función para actualizar el estado de validación en el componente padre.
|
|
24
|
-
* @returns {JSX.Element} El componente de input o texto renderizado según la configuración.
|
|
25
|
-
*/
|
|
26
|
-
export declare const EFWInput: (props: EFWInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { jsx as k, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import { makeStyles as Z, tokens as d, mergeClasses as ee, Input as te, Text as re } from "@fluentui/react-components";
|
|
3
|
-
import { useId as oe, useRef as ne, useState as W, useMemo as g, useCallback as z, useEffect as h } from "react";
|
|
4
|
-
import { stripFormatting as c, applyFormatting as f, validateChileanRut as ae, validateEmail as le } from "./EFWInput.utils.js";
|
|
5
|
-
const se = Z({
|
|
6
|
-
efwInputError: {
|
|
7
|
-
backgroundColor: d.colorPaletteRedBackground1,
|
|
8
|
-
"::after": {
|
|
9
|
-
borderBottomColor: d.colorPaletteRedBorder2,
|
|
10
|
-
borderBottomStyle: "solid",
|
|
11
|
-
borderBottomWidth: "2px"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
efwInput: {
|
|
15
|
-
"& [disabled]": {
|
|
16
|
-
backgroundColor: d.colorNeutralBackground3,
|
|
17
|
-
color: d.colorNeutralForeground2,
|
|
18
|
-
"&::placeholder": {
|
|
19
|
-
color: "transparent"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
// Afectar el span que contiene el input disabled
|
|
23
|
-
"&:has(span + [disabled])": {
|
|
24
|
-
backgroundColor: d.colorNeutralBackground3
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}), fe = ($) => {
|
|
28
|
-
const {
|
|
29
|
-
value: m,
|
|
30
|
-
defaultValue: E,
|
|
31
|
-
onChange: S,
|
|
32
|
-
editable: j = !0,
|
|
33
|
-
disabled: A = !1,
|
|
34
|
-
className: M = "",
|
|
35
|
-
autoComplete: O = "off",
|
|
36
|
-
type: U = "text",
|
|
37
|
-
placeholder: _,
|
|
38
|
-
contentBefore: q,
|
|
39
|
-
contentAfter: G,
|
|
40
|
-
formatType: t = "none",
|
|
41
|
-
formatPattern: s,
|
|
42
|
-
formatFunction: C,
|
|
43
|
-
minLength: p = 0,
|
|
44
|
-
maxLength: v = 250,
|
|
45
|
-
validationState: H = "none",
|
|
46
|
-
setParentComponentState: l
|
|
47
|
-
} = $, r = m !== void 0, B = (r ? m : E) ?? "", N = E ?? "", P = se(), R = oe(), w = ne(!1), [u, D] = W(() => c(B, t)), [J, F] = W(() => f(B, t, { formatPattern: s, formatFunction: C })), o = g(
|
|
48
|
-
() => ({ formatPattern: s, formatFunction: C }),
|
|
49
|
-
[s, C]
|
|
50
|
-
), i = g(
|
|
51
|
-
() => c(N, t),
|
|
52
|
-
[N, t]
|
|
53
|
-
), b = g(
|
|
54
|
-
() => f(i, t, o),
|
|
55
|
-
[i, t, o]
|
|
56
|
-
), T = g(() => {
|
|
57
|
-
if (!r)
|
|
58
|
-
return { raw: "", formatted: "" };
|
|
59
|
-
const e = c(m ?? "", t), a = f(e, t, o);
|
|
60
|
-
return { raw: e, formatted: a };
|
|
61
|
-
}, [r, m, t, o]), x = r ? T.raw : u, y = r ? T.formatted : J, L = z((e) => {
|
|
62
|
-
if (t === "none" || !s) return !0;
|
|
63
|
-
try {
|
|
64
|
-
return new RegExp(s).test(e);
|
|
65
|
-
} catch {
|
|
66
|
-
return !1;
|
|
67
|
-
}
|
|
68
|
-
}, [t, s]), n = z((e) => p > 0 && e.length > 0 && e.length < p ? (l?.("error", `Por favor introduzca más de ${p} caracteres.`), !0) : e.length > v ? (l?.("error", `Por favor introduzca menos de ${v} caracteres.`), !0) : t === "chileanRut" && e.length > 0 && !ae(e) ? (l?.("error", "El R.U.T ingresado no es válido."), !0) : t === "email" && e.length > 0 && !le(e) ? (l?.("error", "El correo ingresado no es válido."), !0) : L(e) ? (l?.("none", ""), !1) : (l?.("error", "El formato del valor ingresado no es válido."), !0), [p, v, t, L, l]);
|
|
69
|
-
h(() => {
|
|
70
|
-
r && n(x);
|
|
71
|
-
}, [r, x, n]), h(() => {
|
|
72
|
-
r || (D((e) => e === i ? e : i), F((e) => e === b ? e : b), n(i));
|
|
73
|
-
}, [
|
|
74
|
-
r,
|
|
75
|
-
i,
|
|
76
|
-
b,
|
|
77
|
-
n
|
|
78
|
-
]), h(() => {
|
|
79
|
-
r || F((e) => {
|
|
80
|
-
const a = f(u, t, o);
|
|
81
|
-
return a === e ? e : a;
|
|
82
|
-
});
|
|
83
|
-
}, [r, u, t, o]), h(() => {
|
|
84
|
-
r || w.current || (w.current = !0, n(u));
|
|
85
|
-
}, [r, u, n]);
|
|
86
|
-
const K = z((e, a) => {
|
|
87
|
-
if (typeof a.value == "string") {
|
|
88
|
-
const X = c(a.value, t), I = f(X, t, o), V = c(I, t);
|
|
89
|
-
n(V), r || (D(V), F(I)), S?.(V, I);
|
|
90
|
-
}
|
|
91
|
-
}, [t, o, S, n, r]), Q = ee(
|
|
92
|
-
M,
|
|
93
|
-
P.efwInput,
|
|
94
|
-
H === "error" && P.efwInputError
|
|
95
|
-
);
|
|
96
|
-
return /* @__PURE__ */ k(Y, { children: j ? /* @__PURE__ */ k(
|
|
97
|
-
te,
|
|
98
|
-
{
|
|
99
|
-
className: Q,
|
|
100
|
-
id: R,
|
|
101
|
-
name: R,
|
|
102
|
-
type: U,
|
|
103
|
-
placeholder: _,
|
|
104
|
-
contentBefore: q,
|
|
105
|
-
contentAfter: G,
|
|
106
|
-
disabled: A,
|
|
107
|
-
value: y,
|
|
108
|
-
"data-raw-value": x,
|
|
109
|
-
autoComplete: O,
|
|
110
|
-
autoCorrect: "off",
|
|
111
|
-
autoCapitalize: "off",
|
|
112
|
-
spellCheck: "false",
|
|
113
|
-
onChange: K
|
|
114
|
-
}
|
|
115
|
-
) : /* @__PURE__ */ k(re, { style: y ? void 0 : { opacity: 0.7 }, children: y || "Sin datos disponibles" }) });
|
|
116
|
-
};
|
|
117
|
-
export {
|
|
118
|
-
fe as EFWInput
|
|
119
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { EFWInputValue, FormatType } from './EFWInput.types';
|
|
2
|
-
|
|
3
|
-
interface FormatOptions {
|
|
4
|
-
formatPattern?: string;
|
|
5
|
-
formatFunction?: (value: EFWInputValue) => EFWInputValue;
|
|
6
|
-
}
|
|
7
|
-
export declare const formatChileanRut: (rawValue: string) => string;
|
|
8
|
-
export declare const validateChileanRut: (rutCompleto: string) => boolean;
|
|
9
|
-
export declare const validateEmail: (email: string) => boolean;
|
|
10
|
-
export declare const formatNumber: (number: string | number, prefix?: string, thousand_separator?: string, decimal_separator?: string) => string;
|
|
11
|
-
export declare const stripFormatNumber: (value?: string) => string;
|
|
12
|
-
/**
|
|
13
|
-
* Quita el formato de un valor según el tipo especificado
|
|
14
|
-
*/
|
|
15
|
-
export declare const stripFormatting: (value: string, formatType: FormatType) => string;
|
|
16
|
-
/**
|
|
17
|
-
* Aplica formato a un valor según el tipo y opciones especificadas
|
|
18
|
-
*/
|
|
19
|
-
export declare const applyFormatting: (value: string, formatType: FormatType, options?: FormatOptions) => string;
|
|
20
|
-
export {};
|