@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,4 +1,5 @@
|
|
|
1
|
-
import { EFWFieldChildrenProps } from '../EFWField/EFWField.types';
|
|
1
|
+
import { EFWFieldChildrenProps } from '../_shared/EFWField/EFWField.types';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Representa un objeto de datos genérico que puede contener propiedades de tipo string,
|
|
@@ -15,7 +16,7 @@ type IItem = {
|
|
|
15
16
|
*
|
|
16
17
|
* @callback EFWTagPickerOnChange
|
|
17
18
|
* @param {EFWTagPickerOption[]} selectedOptions - Array de opciones actualmente seleccionadas
|
|
18
|
-
* @param {string} [displayValue] -
|
|
19
|
+
* @param {string} [displayValue] - Texto formateado de las opciones seleccionadas
|
|
19
20
|
* @returns {void}
|
|
20
21
|
*/
|
|
21
22
|
export type EFWTagPickerOnChange = (selectedOptions: EFWTagPickerOption[], displayValue?: string) => void;
|
|
@@ -53,6 +54,16 @@ export type EFWTagPickerValue = EFWTagPickerOption;
|
|
|
53
54
|
export type AsyncOptionsLoader = (query: string, options?: {
|
|
54
55
|
signal: AbortSignal;
|
|
55
56
|
}) => Promise<EFWTagPickerOption[]>;
|
|
57
|
+
export interface EFWTagPickerLabels {
|
|
58
|
+
noMatchesMessage?: string;
|
|
59
|
+
loadingMessage?: string;
|
|
60
|
+
placeholder?: string;
|
|
61
|
+
emptyState?: string;
|
|
62
|
+
selectedItemsAriaLabel?: string;
|
|
63
|
+
inputAriaLabel?: string;
|
|
64
|
+
}
|
|
65
|
+
export type EFWTagPickerOptionMediaRenderer = (option: EFWTagPickerOption) => ReactNode;
|
|
66
|
+
export type EFWTagPickerNonEditableRenderer = (value: EFWTagPickerOption[], displayValue: string) => ReactNode;
|
|
56
67
|
/**
|
|
57
68
|
* Propiedades del componente EFWTagPicker.
|
|
58
69
|
* Extiende EFWFieldChildrenProps para heredar propiedades comunes de campos de formulario.
|
|
@@ -61,21 +72,6 @@ export type AsyncOptionsLoader = (query: string, options?: {
|
|
|
61
72
|
* @extends EFWFieldChildrenProps
|
|
62
73
|
*/
|
|
63
74
|
export interface EFWTagPickerProps extends EFWFieldChildrenProps {
|
|
64
|
-
/**
|
|
65
|
-
* Mensaje personalizado a mostrar cuando no hay resultados coincidentes con la búsqueda
|
|
66
|
-
* @default "No se encontraron coincidencias"
|
|
67
|
-
*/
|
|
68
|
-
noMatchesMessage?: string;
|
|
69
|
-
/**
|
|
70
|
-
* Mensaje personalizado a mostrar durante la carga asíncrona de opciones
|
|
71
|
-
* @default "Buscando información..."
|
|
72
|
-
*/
|
|
73
|
-
loadingMessage?: string;
|
|
74
|
-
/**
|
|
75
|
-
* Texto de marcador de posición que se muestra cuando el campo está vacío
|
|
76
|
-
* @default "Selecciona una opción"
|
|
77
|
-
*/
|
|
78
|
-
placeholder?: string;
|
|
79
75
|
/**
|
|
80
76
|
* Determina si el componente permite edición o solo muestra los valores seleccionados
|
|
81
77
|
* @default true
|
|
@@ -135,7 +131,24 @@ export interface EFWTagPickerProps extends EFWFieldChildrenProps {
|
|
|
135
131
|
onChange?: EFWTagPickerOnChange;
|
|
136
132
|
/** Función para transformar o procesar las opciones antes de renderizarlas */
|
|
137
133
|
beforeRenderOptions?: (options: EFWTagPickerOption[]) => EFWTagPickerOption[];
|
|
134
|
+
/**
|
|
135
|
+
* Función para renderizar el contenido visual de `media` en cada `TagPickerOption`.
|
|
136
|
+
* Si no se define, se usa un Avatar por defecto basado en `option.text`.
|
|
137
|
+
*/
|
|
138
|
+
renderOptionMedia?: EFWTagPickerOptionMediaRenderer;
|
|
139
|
+
/**
|
|
140
|
+
* Indica si el `media` de cada opción también debe renderizarse dentro de la etiqueta
|
|
141
|
+
* seleccionada que aparece en el input.
|
|
142
|
+
* @default false
|
|
143
|
+
*/
|
|
144
|
+
showOptionMediaInSelectedTags?: boolean;
|
|
138
145
|
/** Función para establecer el estado de error y mostrar mensajes de validación */
|
|
139
146
|
setError?: (hasError: boolean, message?: string) => void;
|
|
147
|
+
labels?: EFWTagPickerLabels;
|
|
148
|
+
/**
|
|
149
|
+
* Renderiza contenido custom cuando `editable={false}`.
|
|
150
|
+
* Si retorna `null` o `undefined`, se utiliza el render no editable por defecto.
|
|
151
|
+
*/
|
|
152
|
+
readOnlyRenderer?: EFWTagPickerNonEditableRenderer;
|
|
140
153
|
}
|
|
141
154
|
export {};
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EFWTagPickerOption } from './EFWTagPicker.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Retorna el valor formateado que EFWTagPicker muestra cuando no está en modo editable.
|
|
5
|
+
*/
|
|
6
|
+
export declare const getTagPickerFormattedValue: (value: EFWTagPickerOption[] | undefined | null) => string;
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { EFWField as I } from "../_shared/EFWField/EFWField.js";
|
|
3
|
+
import { EFWTagPicker as R } from "./EFWTagPicker.js";
|
|
4
|
+
import { mergeClasses as j } from "@griffel/react";
|
|
5
|
+
const V = (i) => {
|
|
6
|
+
const {
|
|
7
|
+
title: n,
|
|
8
|
+
// description,
|
|
9
|
+
infoLabel: t,
|
|
10
|
+
hint: o,
|
|
11
|
+
className: l,
|
|
12
|
+
style: s = {},
|
|
13
|
+
required: r = !1,
|
|
14
|
+
labels: d,
|
|
15
|
+
validationState: g = "none",
|
|
16
|
+
validationMessage: m = "",
|
|
17
|
+
validationMessageIcon: p,
|
|
18
|
+
minQueryLength: f = 0,
|
|
19
|
+
options: c = [],
|
|
20
|
+
selectedOptions: h,
|
|
21
|
+
defaultSelectedOptions: u,
|
|
22
|
+
editable: e = !0,
|
|
23
|
+
disabled: b = !1,
|
|
24
|
+
hidden: C = !1,
|
|
25
|
+
noPopover: O = !1,
|
|
26
|
+
multiple: F = !1,
|
|
27
|
+
tagSize: P = "medium",
|
|
28
|
+
tagShape: S = "rounded",
|
|
29
|
+
tagAppearance: v = "brand",
|
|
30
|
+
onChange: M,
|
|
31
|
+
beforeRenderOptions: k,
|
|
32
|
+
renderOptionMedia: w,
|
|
33
|
+
showOptionMediaInSelectedTags: y = !1,
|
|
34
|
+
readOnlyRenderer: E,
|
|
35
|
+
onValidationChange: L,
|
|
36
|
+
...N
|
|
37
|
+
} = i, T = (x = []) => {
|
|
38
|
+
M?.(x);
|
|
39
|
+
}, W = j(l, "efw-tagPicker-field");
|
|
40
|
+
return /* @__PURE__ */ a(
|
|
41
|
+
I,
|
|
42
|
+
{
|
|
43
|
+
hint: o,
|
|
44
|
+
className: W,
|
|
45
|
+
style: s,
|
|
46
|
+
title: n,
|
|
47
|
+
infoLabel: t,
|
|
48
|
+
weightLabel: e ? "regular" : "semibold",
|
|
49
|
+
required: r,
|
|
50
|
+
validationState: g,
|
|
51
|
+
validationMessage: m,
|
|
52
|
+
validationMessageIcon: p,
|
|
53
|
+
onValidationChange: L,
|
|
54
|
+
hidden: C,
|
|
55
|
+
...N,
|
|
56
|
+
children: /* @__PURE__ */ a(
|
|
57
|
+
R,
|
|
58
|
+
{
|
|
59
|
+
editable: e,
|
|
60
|
+
labels: d,
|
|
61
|
+
selectedOptions: h,
|
|
62
|
+
defaultSelectedOptions: u,
|
|
63
|
+
minQueryLength: f,
|
|
64
|
+
options: c,
|
|
65
|
+
onChange: T,
|
|
66
|
+
beforeRenderOptions: k,
|
|
67
|
+
renderOptionMedia: w,
|
|
68
|
+
showOptionMediaInSelectedTags: y,
|
|
69
|
+
readOnlyRenderer: E,
|
|
70
|
+
disabled: b,
|
|
71
|
+
noPopover: O,
|
|
72
|
+
tagSize: P,
|
|
73
|
+
tagShape: S,
|
|
74
|
+
tagAppearance: v,
|
|
75
|
+
multiple: F
|
|
76
|
+
}
|
|
77
|
+
)
|
|
78
|
+
}
|
|
79
|
+
);
|
|
80
|
+
};
|
|
81
|
+
export {
|
|
82
|
+
V as EFWTagPickerField
|
|
83
|
+
};
|
package/dist/react-components/fields/{EFWTagPickerField → TagPicker}/EFWTagPickerField.types.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EFWFieldProps } from '../EFWField/EFWField.types';
|
|
2
|
-
import { EFWTagPickerOption, EFWTagPickerProps, EFWTagPickerValue, EFWTagPickerOnChange } from '
|
|
1
|
+
import { EFWFieldProps } from '../_shared/EFWField/EFWField.types';
|
|
2
|
+
import { EFWTagPickerOption, EFWTagPickerProps, EFWTagPickerValue, EFWTagPickerOnChange } from './EFWTagPicker.types';
|
|
3
3
|
|
|
4
4
|
export type EFWTagPickerFieldValue = EFWTagPickerValue;
|
|
5
5
|
export type EFWTagPickerFieldOnChange = EFWTagPickerOnChange;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EFWTagPicker } from './EFWTagPicker';
|
|
2
|
+
export { getTagPickerFormattedValue } from './EFWTagPicker.utils';
|
|
3
|
+
export type { EFWTagPickerProps, EFWTagPickerValue, EFWTagPickerOption, EFWTagPickerOnChange, EFWTagPickerOptionMediaRenderer, EFWTagPickerNonEditableRenderer } from './EFWTagPicker.types';
|
|
4
|
+
export { EFWTagPickerField } from './EFWTagPickerField';
|
|
5
|
+
export type { EFWTagPickerFieldProps, EFWTagPickerFieldValue, EFWTagPickerFieldOnChange, EFWTagPickerFieldOption } from './EFWTagPickerField.types';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EFWTagPicker as o } from "./EFWTagPicker.js";
|
|
2
|
+
import { getTagPickerFormattedValue as a } from "./EFWTagPicker.utils.js";
|
|
3
|
+
import { EFWTagPickerField as i } from "./EFWTagPickerField.js";
|
|
4
|
+
export {
|
|
5
|
+
o as EFWTagPicker,
|
|
6
|
+
i as EFWTagPickerField,
|
|
7
|
+
a as getTagPickerFormattedValue
|
|
8
|
+
};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { jsx as v, Fragment as ne } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles as re, tokens as h, mergeClasses as oe, Text as ae, Textarea as le } from "@fluentui/react-components";
|
|
3
|
+
import { useMemo as B, useId as se, useRef as b, useState as ce, useCallback as i, useEffect as g, useLayoutEffect as ie } from "react";
|
|
4
|
+
import { getTextAreaFormattedValue as ue } from "./EFWTextArea.utils.js";
|
|
5
|
+
import { useFieldsLocaleText as de } from "../../i18n/PorygonI18nProvider.js";
|
|
6
|
+
const fe = re({
|
|
7
|
+
efwTextArea: {
|
|
8
|
+
"& textarea": {
|
|
9
|
+
maxHeight: "none",
|
|
10
|
+
"&[disabled]": {
|
|
11
|
+
backgroundColor: h.colorNeutralBackground3,
|
|
12
|
+
color: h.colorNeutralForeground3
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
// Afectar el span que contiene el textarea disabled
|
|
16
|
+
"&:has([disabled])": {
|
|
17
|
+
backgroundColor: h.colorNeutralBackground3
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
efwTextAreaError: {
|
|
21
|
+
backgroundColor: h.colorPaletteRedBackground1
|
|
22
|
+
// '& textarea': {
|
|
23
|
+
// maxHeight: 'none',
|
|
24
|
+
// backgroundColor: "var(--colorPaletteRedBackground1)",
|
|
25
|
+
// },
|
|
26
|
+
// '.fui-Textarea': {
|
|
27
|
+
// backgroundColor: "var(--colorPaletteRedBackground1)",
|
|
28
|
+
// borderBottom: "2px solid var(--colorPaletteRedBorder2) !important"
|
|
29
|
+
// },
|
|
30
|
+
// '& textarea::after': {
|
|
31
|
+
// borderBottom: "2px solid var(--colorPaletteRedBorder2) !important"
|
|
32
|
+
// }
|
|
33
|
+
}
|
|
34
|
+
}), w = (x) => x ?? "", ye = (x) => {
|
|
35
|
+
const {
|
|
36
|
+
value: d,
|
|
37
|
+
defaultValue: C,
|
|
38
|
+
onKeyDown: T,
|
|
39
|
+
onChange: A,
|
|
40
|
+
editable: K = !0,
|
|
41
|
+
disabled: W = !1,
|
|
42
|
+
autoComplete: q = "off",
|
|
43
|
+
className: U = "",
|
|
44
|
+
maxLength: p = 250,
|
|
45
|
+
labels: L,
|
|
46
|
+
readOnlyRenderer: _,
|
|
47
|
+
validationMessages: $,
|
|
48
|
+
size: G,
|
|
49
|
+
validationState: J = "none",
|
|
50
|
+
setParentComponentState: y,
|
|
51
|
+
autoResize: a = !0
|
|
52
|
+
// Nuevo prop con valor por defecto true
|
|
53
|
+
} = x, t = d !== void 0, Q = w(t ? d : C), f = w(C), V = de(), z = V.textArea.labels, X = V.textArea.validationMessages, S = z.placeholder, E = z.emptyState, k = L?.placeholder, F = L?.emptyState, R = B(() => ({
|
|
54
|
+
placeholder: k ?? S,
|
|
55
|
+
emptyState: F ?? E
|
|
56
|
+
}), [
|
|
57
|
+
k,
|
|
58
|
+
F,
|
|
59
|
+
S,
|
|
60
|
+
E
|
|
61
|
+
]), N = X.maxLength, M = $?.maxLength, H = B(() => ({
|
|
62
|
+
maxLength: M ?? N
|
|
63
|
+
}), [
|
|
64
|
+
M,
|
|
65
|
+
N
|
|
66
|
+
]), I = fe(), D = se(), u = b(null), s = b(null), [O, P] = ce(Q), j = b(!1), n = t ? w(d) : O, m = i(() => {
|
|
67
|
+
if (!a || !u.current) return;
|
|
68
|
+
const e = u.current;
|
|
69
|
+
e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
|
|
70
|
+
}, [a]), c = i(() => {
|
|
71
|
+
a && (s.current !== null && window.cancelAnimationFrame(s.current), s.current = window.requestAnimationFrame(() => {
|
|
72
|
+
s.current = null, m();
|
|
73
|
+
}));
|
|
74
|
+
}, [a, m]), l = i((e) => {
|
|
75
|
+
e.length > p ? y?.("error", H.maxLength(p)) : y?.("none", "");
|
|
76
|
+
}, [p, y, H]);
|
|
77
|
+
g(() => {
|
|
78
|
+
t && l(n);
|
|
79
|
+
}, [t, n, l]), g(() => {
|
|
80
|
+
t || j.current || (j.current = !0, l(n));
|
|
81
|
+
}, [t, n, l]), ie(() => {
|
|
82
|
+
m();
|
|
83
|
+
}, [n, m]), g(() => {
|
|
84
|
+
if (!u.current)
|
|
85
|
+
return;
|
|
86
|
+
const e = u.current;
|
|
87
|
+
if (!a) {
|
|
88
|
+
e.style.height = "";
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
c();
|
|
92
|
+
const r = () => c();
|
|
93
|
+
window.addEventListener("resize", r);
|
|
94
|
+
let o = null;
|
|
95
|
+
return typeof ResizeObserver < "u" && (o = new ResizeObserver(() => {
|
|
96
|
+
c();
|
|
97
|
+
}), o.observe(e), e.parentElement && o.observe(e.parentElement)), () => {
|
|
98
|
+
window.removeEventListener("resize", r), o?.disconnect(), s.current !== null && (window.cancelAnimationFrame(s.current), s.current = null);
|
|
99
|
+
};
|
|
100
|
+
}, [a, c]);
|
|
101
|
+
const Y = i((e, r) => {
|
|
102
|
+
if (typeof r.value == "string") {
|
|
103
|
+
const o = r.value ?? "";
|
|
104
|
+
l(o), t || P(o), A?.(o, o);
|
|
105
|
+
}
|
|
106
|
+
}, [l, t, A]), Z = i((e) => {
|
|
107
|
+
T?.(e, n);
|
|
108
|
+
}, [T, n]), ee = i(() => {
|
|
109
|
+
c();
|
|
110
|
+
}, [c]), te = oe(
|
|
111
|
+
U,
|
|
112
|
+
I.efwTextArea,
|
|
113
|
+
J === "error" && I.efwTextAreaError
|
|
114
|
+
);
|
|
115
|
+
if (g(() => {
|
|
116
|
+
t || (P((e) => e === f ? e : f), l(f));
|
|
117
|
+
}, [t, f, l]), !K) {
|
|
118
|
+
const e = ue(n) || R.emptyState, r = _?.(
|
|
119
|
+
t ? d : O,
|
|
120
|
+
e
|
|
121
|
+
);
|
|
122
|
+
return r != null ? /* @__PURE__ */ v(ne, { children: r }) : /* @__PURE__ */ v(ae, { style: n ? void 0 : { opacity: 0.7 }, children: e });
|
|
123
|
+
}
|
|
124
|
+
return /* @__PURE__ */ v(
|
|
125
|
+
le,
|
|
126
|
+
{
|
|
127
|
+
ref: u,
|
|
128
|
+
className: te,
|
|
129
|
+
id: D,
|
|
130
|
+
name: D,
|
|
131
|
+
placeholder: R.placeholder,
|
|
132
|
+
disabled: W,
|
|
133
|
+
value: n,
|
|
134
|
+
autoComplete: q,
|
|
135
|
+
autoCorrect: "off",
|
|
136
|
+
autoCapitalize: "off",
|
|
137
|
+
spellCheck: "false",
|
|
138
|
+
onChange: Y,
|
|
139
|
+
onKeyDown: Z,
|
|
140
|
+
onFocus: ee,
|
|
141
|
+
size: G,
|
|
142
|
+
style: {
|
|
143
|
+
resize: a ? "none" : "vertical",
|
|
144
|
+
overflow: a ? "hidden" : "auto",
|
|
145
|
+
minHeight: "40px"
|
|
146
|
+
// Altura mínima para mantener usabilidad
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
);
|
|
150
|
+
};
|
|
151
|
+
export {
|
|
152
|
+
ye as EFWTextArea
|
|
153
|
+
};
|
|
@@ -1,9 +1,24 @@
|
|
|
1
|
-
import { EFWFieldChildrenProps } from '../EFWField/EFWField.types';
|
|
1
|
+
import { EFWFieldChildrenProps } from '../_shared/EFWField/EFWField.types';
|
|
2
|
+
import { ReactNode } from 'react';
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
|
-
* Representa el valor que puede contener un componente EFWTextArea
|
|
5
|
+
* Representa el valor que puede contener un componente EFWTextArea.
|
|
6
|
+
* Semántica recomendada:
|
|
7
|
+
* - `undefined`: prop ausente (modo uncontrolled)
|
|
8
|
+
* - `null`: vacío explícito recibido desde integración externa
|
|
9
|
+
* - `string`: valor efectivo del campo
|
|
10
|
+
*
|
|
11
|
+
* Nota: el callback `onChange` emite `string` normalizado.
|
|
5
12
|
*/
|
|
6
13
|
export type EFWTextAreaValue = string | null;
|
|
14
|
+
export type EFWTextAreaNonEditableRenderer = (value: EFWTextAreaValue, displayValue: string) => ReactNode;
|
|
15
|
+
export interface EFWTextAreaLabels {
|
|
16
|
+
placeholder?: string;
|
|
17
|
+
emptyState?: string;
|
|
18
|
+
}
|
|
19
|
+
export interface EFWTextAreaValidationMessages {
|
|
20
|
+
maxLength?: (maxLength: number) => string;
|
|
21
|
+
}
|
|
7
22
|
/**
|
|
8
23
|
* Propiedades del componente EFWTextArea
|
|
9
24
|
*/
|
|
@@ -39,10 +54,6 @@ export interface EFWTextAreaProps extends Partial<EFWFieldChildrenProps> {
|
|
|
39
54
|
* @default ""
|
|
40
55
|
*/
|
|
41
56
|
className?: string;
|
|
42
|
-
/**
|
|
43
|
-
* Texto de marcador de posición que se muestra cuando el textarea está vacío
|
|
44
|
-
*/
|
|
45
|
-
placeholder?: string;
|
|
46
57
|
/**
|
|
47
58
|
* Patrón de formato a aplicar al texto (actualmente no implementado)
|
|
48
59
|
*/
|
|
@@ -61,16 +72,23 @@ export interface EFWTextAreaProps extends Partial<EFWFieldChildrenProps> {
|
|
|
61
72
|
* Habilita el redimensionamiento automático de altura basado en el contenido
|
|
62
73
|
* @default true
|
|
63
74
|
*/
|
|
64
|
-
autoResize?:
|
|
75
|
+
autoResize?: boolean;
|
|
65
76
|
/**
|
|
66
77
|
* Función personalizada para formatear el valor del textarea
|
|
67
78
|
* @param value - El valor actual del textarea
|
|
68
79
|
* @returns El valor formateado
|
|
69
80
|
*/
|
|
70
81
|
formatFunction?: (value: EFWTextAreaValue) => EFWTextAreaValue;
|
|
82
|
+
labels?: EFWTextAreaLabels;
|
|
83
|
+
validationMessages?: EFWTextAreaValidationMessages;
|
|
84
|
+
/**
|
|
85
|
+
* Renderiza contenido custom cuando `editable={false}`.
|
|
86
|
+
* Si retorna `null` o `undefined`, se utiliza el render no editable por defecto.
|
|
87
|
+
*/
|
|
88
|
+
readOnlyRenderer?: EFWTextAreaNonEditableRenderer;
|
|
71
89
|
/**
|
|
72
90
|
* Callback que se ejecuta cuando el valor del textarea cambia
|
|
73
|
-
* @param value - El nuevo valor del textarea
|
|
91
|
+
* @param value - El nuevo valor del textarea (emisión real: `string`)
|
|
74
92
|
* @param displayValue - El valor formateado para mostrar (opcional)
|
|
75
93
|
*/
|
|
76
94
|
onChange?: (value: EFWTextAreaValue, displayValue?: string) => void;
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { EFWField as q } from "../_shared/EFWField/EFWField.js";
|
|
3
|
+
import { EFWTextArea as z } from "./EFWTextArea.js";
|
|
4
|
+
import { mergeClasses as B } from "@griffel/react";
|
|
5
|
+
const R = (t) => {
|
|
6
|
+
const {
|
|
7
|
+
title: o,
|
|
8
|
+
infoLabel: n,
|
|
9
|
+
hint: l,
|
|
10
|
+
className: r,
|
|
11
|
+
style: s = {},
|
|
12
|
+
required: i = !1,
|
|
13
|
+
contentBefore: d,
|
|
14
|
+
contentAfter: f,
|
|
15
|
+
maxLength: m = 1e3,
|
|
16
|
+
size: c,
|
|
17
|
+
validationState: g,
|
|
18
|
+
validationMessage: h,
|
|
19
|
+
validationMessageIcon: u,
|
|
20
|
+
value: p,
|
|
21
|
+
defaultValue: C,
|
|
22
|
+
editable: e = !0,
|
|
23
|
+
disabled: b = !1,
|
|
24
|
+
hidden: x = !1,
|
|
25
|
+
onChange: F,
|
|
26
|
+
onKeyDown: v,
|
|
27
|
+
autoComplete: A = "off",
|
|
28
|
+
formatPattern: w,
|
|
29
|
+
formatFunction: y,
|
|
30
|
+
labels: E,
|
|
31
|
+
readOnlyRenderer: L,
|
|
32
|
+
validationMessages: M,
|
|
33
|
+
onValidationChange: N,
|
|
34
|
+
...W
|
|
35
|
+
} = t, P = (V, j) => {
|
|
36
|
+
F?.(V, j);
|
|
37
|
+
}, T = B(r, "efw-textArea-field");
|
|
38
|
+
return /* @__PURE__ */ a(
|
|
39
|
+
q,
|
|
40
|
+
{
|
|
41
|
+
className: T,
|
|
42
|
+
style: s,
|
|
43
|
+
title: o,
|
|
44
|
+
infoLabel: n,
|
|
45
|
+
weightLabel: e ? "regular" : "semibold",
|
|
46
|
+
hint: l,
|
|
47
|
+
required: i,
|
|
48
|
+
validationState: g,
|
|
49
|
+
validationMessage: h,
|
|
50
|
+
validationMessageIcon: u,
|
|
51
|
+
onValidationChange: N,
|
|
52
|
+
hidden: x,
|
|
53
|
+
...W,
|
|
54
|
+
children: /* @__PURE__ */ a(
|
|
55
|
+
z,
|
|
56
|
+
{
|
|
57
|
+
value: p,
|
|
58
|
+
defaultValue: C,
|
|
59
|
+
editable: e,
|
|
60
|
+
onChange: P,
|
|
61
|
+
onKeyDown: v,
|
|
62
|
+
maxLength: m,
|
|
63
|
+
size: c,
|
|
64
|
+
disabled: b,
|
|
65
|
+
autoComplete: A,
|
|
66
|
+
contentBefore: d,
|
|
67
|
+
contentAfter: f,
|
|
68
|
+
formatPattern: w,
|
|
69
|
+
formatFunction: y,
|
|
70
|
+
labels: E,
|
|
71
|
+
readOnlyRenderer: L,
|
|
72
|
+
validationMessages: M
|
|
73
|
+
}
|
|
74
|
+
)
|
|
75
|
+
}
|
|
76
|
+
);
|
|
77
|
+
};
|
|
78
|
+
export {
|
|
79
|
+
R as EFWTextAreaField
|
|
80
|
+
};
|
package/dist/react-components/fields/{EFWTextAreaField → TextArea}/EFWTextAreaField.types.d.ts
RENAMED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EFWFieldProps } from '../EFWField/EFWField.types';
|
|
2
|
-
import { EFWTextAreaProps, EFWTextAreaValue } from '
|
|
1
|
+
import { EFWFieldProps } from '../_shared/EFWField/EFWField.types';
|
|
2
|
+
import { EFWTextAreaProps, EFWTextAreaValue } from './EFWTextArea.types';
|
|
3
3
|
|
|
4
4
|
export type EFWTextAreaFieldValue = EFWTextAreaValue;
|
|
5
5
|
export interface EFWTextAreaFieldProps extends Omit<EFWFieldProps, 'children'>, EFWTextAreaProps {
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export { EFWTextArea } from './EFWTextArea';
|
|
2
|
+
export { getTextAreaFormattedValue } from './EFWTextArea.utils';
|
|
3
|
+
export type { EFWTextAreaProps, EFWTextAreaValue, EFWTextAreaNonEditableRenderer } from './EFWTextArea.types';
|
|
4
|
+
export { EFWTextAreaField } from './EFWTextAreaField';
|
|
5
|
+
export type { EFWTextAreaFieldProps, EFWTextAreaFieldValue } from './EFWTextAreaField.types';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EFWTextArea as t } from "./EFWTextArea.js";
|
|
2
|
+
import { getTextAreaFormattedValue as x } from "./EFWTextArea.utils.js";
|
|
3
|
+
import { EFWTextAreaField as m } from "./EFWTextAreaField.js";
|
|
4
|
+
export {
|
|
5
|
+
t as EFWTextArea,
|
|
6
|
+
m as EFWTextAreaField,
|
|
7
|
+
x as getTextAreaFormattedValue
|
|
8
|
+
};
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles as B, tokens as a, InfoLabel as C, mergeClasses as L, Field as k } from "@fluentui/react-components";
|
|
3
|
+
import N, { useMemo as i } from "react";
|
|
4
|
+
import { getValidationIcon as O } from "./EFWField.utils.js";
|
|
5
|
+
import { useSyncedValidationState as j } from "./useSyncedValidationState.js";
|
|
6
|
+
const E = B({
|
|
7
|
+
"efw-textField": {
|
|
8
|
+
"& .fui-Field__validationMessage:empty": {
|
|
9
|
+
display: "none !important"
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"efw-textField-success": {
|
|
13
|
+
"& .fui-Field__validationMessage": {
|
|
14
|
+
color: a.colorPaletteGreenBorder2
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
"efw-textField-warning": {
|
|
18
|
+
"& .fui-Field__validationMessage": {
|
|
19
|
+
color: a.colorPaletteDarkOrangeForeground1
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"efw-textField-loading": {
|
|
23
|
+
"& .fui-Field__validationMessage": {
|
|
24
|
+
color: a.colorBrandForeground1
|
|
25
|
+
},
|
|
26
|
+
"& .fui-Spinner__spinner": {
|
|
27
|
+
width: "13px",
|
|
28
|
+
height: "13px"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"efw-textField-error": {
|
|
32
|
+
"::after": {
|
|
33
|
+
borderBottom: `2px solid ${a.colorPaletteRedBorder2} !important`
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
}), W = (n) => {
|
|
37
|
+
const {
|
|
38
|
+
title: l,
|
|
39
|
+
hint: m,
|
|
40
|
+
className: F,
|
|
41
|
+
style: w = {},
|
|
42
|
+
infoLabel: s,
|
|
43
|
+
weightLabel: r = "regular",
|
|
44
|
+
required: d = !1,
|
|
45
|
+
hidden: v = !1,
|
|
46
|
+
orientation: x,
|
|
47
|
+
size: p,
|
|
48
|
+
children: c,
|
|
49
|
+
validationMessageIcon: f,
|
|
50
|
+
validationState: M = "none",
|
|
51
|
+
validationMessage: S = "",
|
|
52
|
+
onValidationChange: h,
|
|
53
|
+
..._
|
|
54
|
+
} = n, t = E(), {
|
|
55
|
+
validationState: e,
|
|
56
|
+
validationMessage: g,
|
|
57
|
+
setFieldState: y
|
|
58
|
+
} = j({
|
|
59
|
+
externalValidationState: M,
|
|
60
|
+
externalValidationMessage: S,
|
|
61
|
+
onValidationChange: h
|
|
62
|
+
}), o = i(
|
|
63
|
+
() => O(e),
|
|
64
|
+
[e]
|
|
65
|
+
), V = i(() => Object.prototype.hasOwnProperty.call(n, "validationMessageIcon") ? f ?? o : o, [n, o, f]), b = i(() => {
|
|
66
|
+
switch (e) {
|
|
67
|
+
case "success":
|
|
68
|
+
case "warning":
|
|
69
|
+
case "error":
|
|
70
|
+
case "none":
|
|
71
|
+
return e;
|
|
72
|
+
default:
|
|
73
|
+
return "none";
|
|
74
|
+
}
|
|
75
|
+
}, [e]), I = i(
|
|
76
|
+
() => /* @__PURE__ */ u(
|
|
77
|
+
C,
|
|
78
|
+
{
|
|
79
|
+
weight: r,
|
|
80
|
+
info: s || "",
|
|
81
|
+
required: d,
|
|
82
|
+
children: l
|
|
83
|
+
}
|
|
84
|
+
),
|
|
85
|
+
[s, d, r, l]
|
|
86
|
+
);
|
|
87
|
+
if (v) return null;
|
|
88
|
+
const P = L(
|
|
89
|
+
F,
|
|
90
|
+
t["efw-textField"],
|
|
91
|
+
e === "success" && t["efw-textField-success"],
|
|
92
|
+
e === "warning" && t["efw-textField-warning"],
|
|
93
|
+
e === "loading" && t["efw-textField-loading"],
|
|
94
|
+
e === "error" && t["efw-textField-error"]
|
|
95
|
+
);
|
|
96
|
+
return /* @__PURE__ */ u(
|
|
97
|
+
k,
|
|
98
|
+
{
|
|
99
|
+
style: { ...w },
|
|
100
|
+
className: P,
|
|
101
|
+
label: I,
|
|
102
|
+
hint: m,
|
|
103
|
+
validationState: b,
|
|
104
|
+
validationMessage: g,
|
|
105
|
+
validationMessageIcon: V,
|
|
106
|
+
orientation: x,
|
|
107
|
+
size: p,
|
|
108
|
+
..._,
|
|
109
|
+
children: c && N.cloneElement(c, {
|
|
110
|
+
setParentComponentState: y,
|
|
111
|
+
validationState: e,
|
|
112
|
+
validationMessage: g
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
);
|
|
116
|
+
};
|
|
117
|
+
export {
|
|
118
|
+
W as EFWField
|
|
119
|
+
};
|