@envisiongroup/porygon 1.0.0-rc.8 → 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,9 +1,10 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import * as
|
|
3
|
-
import { makeStyles as
|
|
4
|
-
import { ErrorCircleRegular as
|
|
5
|
-
import { useEFWButton as
|
|
6
|
-
|
|
1
|
+
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
+
import * as y from "react";
|
|
3
|
+
import { makeStyles as ne, tokens as t, Tooltip as se, Spinner as ae, Button as ie } from "@fluentui/react-components";
|
|
4
|
+
import { ErrorCircleRegular as ce, CheckmarkRegular as le } from "@fluentui/react-icons";
|
|
5
|
+
import { useEFWButton as ue } from "./EFWButton.hooks.js";
|
|
6
|
+
import { useButtonsLocaleText as de } from "../../i18n/PorygonI18nProvider.js";
|
|
7
|
+
const ge = ne({
|
|
7
8
|
/**
|
|
8
9
|
* Estilo para botón no interactivo (estado de carga con deshabilitación).
|
|
9
10
|
* Aplica opacidad reducida y deshabilita eventos de puntero.
|
|
@@ -39,126 +40,193 @@ const Y = q({
|
|
|
39
40
|
"& .ms-Button-icon": {
|
|
40
41
|
color: `${t.colorStatusSuccessForeground1} !important`
|
|
41
42
|
}
|
|
43
|
+
},
|
|
44
|
+
/**
|
|
45
|
+
* Oculta el label cuando el contenedor padre es ≤ 480px.
|
|
46
|
+
* Requiere que un ancestro tenga `container-type: inline-size`.
|
|
47
|
+
*/
|
|
48
|
+
collapseLabelXs: {
|
|
49
|
+
"@container (max-width: 480px)": {
|
|
50
|
+
padding: "5px",
|
|
51
|
+
"& .efw-button__label": { display: "none" },
|
|
52
|
+
"& .fui-Button__icon": { marginRight: 0 },
|
|
53
|
+
minWidth: "auto"
|
|
54
|
+
}
|
|
55
|
+
},
|
|
56
|
+
/**
|
|
57
|
+
* Oculta el label cuando el contenedor padre es ≤ 640px.
|
|
58
|
+
* Requiere que un ancestro tenga `container-type: inline-size`.
|
|
59
|
+
*/
|
|
60
|
+
collapseLabelSm: {
|
|
61
|
+
"@container (max-width: 640px)": {
|
|
62
|
+
padding: "5px",
|
|
63
|
+
"& .efw-button__label": { display: "none" },
|
|
64
|
+
"& .fui-Button__icon": { marginRight: 0 },
|
|
65
|
+
minWidth: "auto"
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
/**
|
|
69
|
+
* Oculta el label cuando el contenedor padre es ≤ 768px.
|
|
70
|
+
* Requiere que un ancestro tenga `container-type: inline-size`.
|
|
71
|
+
*/
|
|
72
|
+
collapseLabelMd: {
|
|
73
|
+
"@container (max-width: 768px)": {
|
|
74
|
+
padding: "5px",
|
|
75
|
+
"& .efw-button__label": { display: "none" },
|
|
76
|
+
"& .fui-Button__icon": { marginRight: 0 },
|
|
77
|
+
minWidth: "auto"
|
|
78
|
+
}
|
|
79
|
+
},
|
|
80
|
+
/**
|
|
81
|
+
* Oculta el label cuando el contenedor padre es ≤ 1024px.
|
|
82
|
+
* Requiere que un ancestro tenga `container-type: inline-size`.
|
|
83
|
+
*/
|
|
84
|
+
collapseLabelLg: {
|
|
85
|
+
"@container (max-width: 1024px)": {
|
|
86
|
+
padding: "5px",
|
|
87
|
+
"& .efw-button__label": { display: "none" },
|
|
88
|
+
"& .fui-Button__icon": { marginRight: 0 },
|
|
89
|
+
minWidth: "auto"
|
|
90
|
+
}
|
|
42
91
|
}
|
|
43
92
|
});
|
|
44
|
-
function
|
|
45
|
-
return
|
|
93
|
+
function pe(e, r) {
|
|
94
|
+
return e instanceof Error ? e : fe(e) ? e === void 0 ? new Error(r.operationFailedMessage) : e.success ? new Error(r.operationFailedMessage) : e.error instanceof Error ? e.error : new Error(e.error || r.operationFailedMessage) : new Error(String(e) || r.unknownErrorMessage);
|
|
46
95
|
}
|
|
47
|
-
function
|
|
48
|
-
return
|
|
96
|
+
function fe(e) {
|
|
97
|
+
return e === void 0 ? !0 : typeof e == "object" && e !== null && "success" in e && typeof e.success == "boolean" && (e.error === void 0 || typeof e.error == "string" || e.error instanceof Error);
|
|
49
98
|
}
|
|
50
|
-
const
|
|
51
|
-
if (!
|
|
52
|
-
if (
|
|
53
|
-
if (typeof
|
|
54
|
-
if (typeof
|
|
55
|
-
const n =
|
|
56
|
-
if (typeof n.message == "string") return n.message;
|
|
57
|
-
if (typeof n.error == "string") return n.error;
|
|
99
|
+
const me = (e, r) => {
|
|
100
|
+
if (!e) return r.defaultErrorMessage;
|
|
101
|
+
if (e instanceof Error) return e.message || r.defaultErrorMessage;
|
|
102
|
+
if (typeof e == "string") return e;
|
|
103
|
+
if (typeof e == "object" && e !== null) {
|
|
104
|
+
const n = e;
|
|
105
|
+
if (typeof n.message == "string") return n.message || r.defaultErrorMessage;
|
|
106
|
+
if (typeof n.error == "string") return n.error || r.defaultErrorMessage;
|
|
58
107
|
try {
|
|
59
|
-
return JSON.stringify(
|
|
108
|
+
return JSON.stringify(e);
|
|
60
109
|
} catch {
|
|
61
|
-
return
|
|
110
|
+
return r.parseErrorMessage;
|
|
62
111
|
}
|
|
63
112
|
}
|
|
64
|
-
return String(
|
|
65
|
-
},
|
|
66
|
-
onClick:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
tooltips:
|
|
73
|
-
showStatusIcons:
|
|
74
|
-
autoReset:
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
113
|
+
return String(e) || r.defaultErrorMessage;
|
|
114
|
+
}, Ee = {}, be = {}, Fe = ({
|
|
115
|
+
onClick: e,
|
|
116
|
+
disableOnLoading: r = !0,
|
|
117
|
+
autoLoading: n = !1,
|
|
118
|
+
successConfig: I = Ee,
|
|
119
|
+
errorConfig: U = be,
|
|
120
|
+
labels: l,
|
|
121
|
+
tooltips: g,
|
|
122
|
+
showStatusIcons: E = !0,
|
|
123
|
+
autoReset: v = !0,
|
|
124
|
+
collapseLabel: p,
|
|
125
|
+
children: b,
|
|
126
|
+
disabled: M,
|
|
127
|
+
className: X,
|
|
128
|
+
appearance: Y = "secondary",
|
|
129
|
+
icon: u,
|
|
130
|
+
...z
|
|
81
131
|
}) => {
|
|
82
|
-
const
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}),
|
|
132
|
+
const s = ge(), d = de().button.labels, _ = d.loadingText, w = d.defaultErrorMessage, F = d.operationFailedMessage, S = d.unknownErrorMessage, T = d.parseErrorMessage, B = l?.loadingText, C = l?.defaultErrorMessage, N = l?.operationFailedMessage, R = l?.unknownErrorMessage, L = l?.parseErrorMessage, a = y.useMemo(() => ({
|
|
133
|
+
loadingText: B ?? _,
|
|
134
|
+
defaultErrorMessage: C ?? w,
|
|
135
|
+
operationFailedMessage: N ?? F,
|
|
136
|
+
unknownErrorMessage: R ?? S,
|
|
137
|
+
parseErrorMessage: L ?? T
|
|
138
|
+
}), [
|
|
139
|
+
B,
|
|
140
|
+
C,
|
|
141
|
+
N,
|
|
142
|
+
R,
|
|
143
|
+
L,
|
|
144
|
+
_,
|
|
145
|
+
w,
|
|
146
|
+
F,
|
|
147
|
+
S,
|
|
148
|
+
T
|
|
149
|
+
]), { onSuccess: A, timeout: J = 2e3, text: q } = I, { onError: H, timeout: K = 2e3, text: Q } = U, { currentState: j, isLoading: x, error: V, setLoading: P, stopLoading: $, setSuccess: W, setError: f } = ue({
|
|
150
|
+
onError: H,
|
|
151
|
+
onSuccess: A,
|
|
152
|
+
successTimeout: J,
|
|
153
|
+
errorTimeout: K,
|
|
154
|
+
autoReset: v,
|
|
155
|
+
fallbackErrorMessage: a.operationFailedMessage
|
|
156
|
+
}), k = y.useCallback(
|
|
89
157
|
(o) => {
|
|
90
158
|
if (!o)
|
|
91
|
-
|
|
159
|
+
$();
|
|
92
160
|
else if (typeof o == "object")
|
|
93
161
|
if (o.success)
|
|
94
|
-
|
|
162
|
+
W();
|
|
95
163
|
else {
|
|
96
|
-
const
|
|
97
|
-
|
|
164
|
+
const i = o.error instanceof Error ? o.error : new Error(String(o.error || a.operationFailedMessage));
|
|
165
|
+
f(i);
|
|
98
166
|
}
|
|
99
167
|
},
|
|
100
|
-
[
|
|
101
|
-
),
|
|
102
|
-
if (!(!
|
|
168
|
+
[$, W, f, a.operationFailedMessage]
|
|
169
|
+
), Z = y.useCallback(async (o) => {
|
|
170
|
+
if (!(!e || x || M))
|
|
103
171
|
try {
|
|
104
|
-
const
|
|
105
|
-
if (
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
|
|
172
|
+
const i = e(o);
|
|
173
|
+
if (i instanceof Promise) {
|
|
174
|
+
n && P();
|
|
175
|
+
const h = await i;
|
|
176
|
+
n && k(h);
|
|
109
177
|
} else
|
|
110
|
-
|
|
111
|
-
} catch (
|
|
112
|
-
const
|
|
113
|
-
|
|
178
|
+
k(i);
|
|
179
|
+
} catch (i) {
|
|
180
|
+
const h = pe(i, a);
|
|
181
|
+
f(h);
|
|
114
182
|
}
|
|
115
|
-
}, [
|
|
116
|
-
const o = [
|
|
117
|
-
switch (
|
|
183
|
+
}, [e, x, M, n, P, k, f, a]), O = u && p ? p === "sm" ? s.collapseLabelSm : p === "md" ? s.collapseLabelMd : p === "lg" ? s.collapseLabelLg : s.collapseLabelXs : void 0, m = (o) => O ? o ? /* @__PURE__ */ c("span", { className: "efw-button__label", children: o }) : void 0 : o, ee = () => {
|
|
184
|
+
const o = [X, O].filter(Boolean);
|
|
185
|
+
switch (j) {
|
|
118
186
|
case "loading":
|
|
119
187
|
return {
|
|
120
|
-
content:
|
|
121
|
-
icon:
|
|
122
|
-
className:
|
|
123
|
-
tooltip:
|
|
188
|
+
content: m(a.loadingText),
|
|
189
|
+
icon: E ? /* @__PURE__ */ c(ae, { size: "tiny" }) : u,
|
|
190
|
+
className: r ? [...o, s.buttonNonInteractive].join(" ") : o.join(" "),
|
|
191
|
+
tooltip: g?.loading
|
|
124
192
|
};
|
|
125
193
|
case "success":
|
|
126
194
|
return {
|
|
127
|
-
content:
|
|
128
|
-
icon:
|
|
129
|
-
className: [...o,
|
|
130
|
-
tooltip:
|
|
195
|
+
content: m(q ?? b),
|
|
196
|
+
icon: E ? /* @__PURE__ */ c(le, {}) : u,
|
|
197
|
+
className: [...o, s.buttonSuccess].join(" "),
|
|
198
|
+
tooltip: g?.success
|
|
131
199
|
};
|
|
132
200
|
case "error":
|
|
133
201
|
return {
|
|
134
|
-
content:
|
|
135
|
-
icon:
|
|
136
|
-
className: [...o,
|
|
137
|
-
tooltip:
|
|
202
|
+
content: m(Q ?? b),
|
|
203
|
+
icon: E ? /* @__PURE__ */ c(ce, {}) : u,
|
|
204
|
+
className: [...o, s.buttonError].join(" "),
|
|
205
|
+
tooltip: g?.error ?? me(V, a)
|
|
138
206
|
};
|
|
139
207
|
default:
|
|
140
208
|
return {
|
|
141
|
-
content:
|
|
142
|
-
icon:
|
|
209
|
+
content: m(b),
|
|
210
|
+
icon: u,
|
|
143
211
|
className: o.join(" "),
|
|
144
|
-
tooltip:
|
|
212
|
+
tooltip: g?.idle
|
|
145
213
|
};
|
|
146
214
|
}
|
|
147
|
-
}, { content:
|
|
148
|
-
|
|
215
|
+
}, { content: oe, icon: re, className: te, tooltip: G } = ee(), D = /* @__PURE__ */ c(
|
|
216
|
+
ie,
|
|
149
217
|
{
|
|
150
|
-
...
|
|
151
|
-
appearance:
|
|
152
|
-
className:
|
|
153
|
-
disabled:
|
|
154
|
-
disabledFocusable:
|
|
155
|
-
icon:
|
|
156
|
-
onClick:
|
|
157
|
-
children:
|
|
218
|
+
...z,
|
|
219
|
+
appearance: Y,
|
|
220
|
+
className: te,
|
|
221
|
+
disabled: M || r && x,
|
|
222
|
+
disabledFocusable: j === "loading" && r,
|
|
223
|
+
icon: re,
|
|
224
|
+
onClick: Z,
|
|
225
|
+
children: oe
|
|
158
226
|
}
|
|
159
227
|
);
|
|
160
|
-
return
|
|
228
|
+
return G ? /* @__PURE__ */ c(se, { content: G, relationship: "label", children: D }) : D;
|
|
161
229
|
};
|
|
162
230
|
export {
|
|
163
|
-
|
|
231
|
+
Fe as EFWButton
|
|
164
232
|
};
|
|
@@ -108,6 +108,18 @@ export interface TooltipConfig {
|
|
|
108
108
|
/** Tooltip mostrado cuando ocurrió un error */
|
|
109
109
|
error?: string;
|
|
110
110
|
}
|
|
111
|
+
export interface EFWButtonLabels {
|
|
112
|
+
/** Texto mostrado cuando el botón está en estado de carga */
|
|
113
|
+
loadingText?: string;
|
|
114
|
+
/** Mensaje de error genérico mostrado al usuario */
|
|
115
|
+
defaultErrorMessage?: string;
|
|
116
|
+
/** Mensaje usado cuando una operación falla sin mensaje específico */
|
|
117
|
+
operationFailedMessage?: string;
|
|
118
|
+
/** Mensaje usado cuando no es posible determinar el error */
|
|
119
|
+
unknownErrorMessage?: string;
|
|
120
|
+
/** Mensaje usado cuando no se puede serializar un error de objeto */
|
|
121
|
+
parseErrorMessage?: string;
|
|
122
|
+
}
|
|
111
123
|
type EFWButtonClickEvent = Parameters<NonNullable<ButtonProps['onClick']>>[0];
|
|
112
124
|
/**
|
|
113
125
|
* Propiedades del componente EFWButton.
|
|
@@ -124,7 +136,7 @@ type EFWButtonClickEvent = Parameters<NonNullable<ButtonProps['onClick']>>[0];
|
|
|
124
136
|
* await saveData();
|
|
125
137
|
* return { success: true };
|
|
126
138
|
* }}
|
|
127
|
-
* loadingText
|
|
139
|
+
* labels={{ loadingText: "Guardando..." }}
|
|
128
140
|
* autoLoading={true}
|
|
129
141
|
* successConfig={{
|
|
130
142
|
* text: 'Guardado',
|
|
@@ -141,11 +153,6 @@ export interface EFWButtonProps extends Omit<ButtonProps, "onClick"> {
|
|
|
141
153
|
* Puede retornar una Promise o un valor directo con el resultado de la operación.
|
|
142
154
|
*/
|
|
143
155
|
onClick?: (event: EFWButtonClickEvent) => Promise<EFWButtonActionResult> | EFWButtonActionResult;
|
|
144
|
-
/**
|
|
145
|
-
* Texto personalizado a mostrar durante el estado de carga.
|
|
146
|
-
* @default "Cargando..."
|
|
147
|
-
*/
|
|
148
|
-
loadingText?: string;
|
|
149
156
|
/**
|
|
150
157
|
* Desactiva el botón durante el estado de carga para evitar múltiples clics.
|
|
151
158
|
* @default true
|
|
@@ -172,6 +179,20 @@ export interface EFWButtonProps extends Omit<ButtonProps, "onClick"> {
|
|
|
172
179
|
* @default true
|
|
173
180
|
*/
|
|
174
181
|
autoReset?: boolean;
|
|
182
|
+
/**
|
|
183
|
+
* Oculta el label del botón cuando su contenedor padre es menor al breakpoint,
|
|
184
|
+
* mostrando solo el icono para optimizar espacio. Usa CSS Container Queries.
|
|
185
|
+
* Solo aplica cuando el botón tiene la prop `icon` definida.
|
|
186
|
+
* Requiere que un ancestro tenga `container-type: inline-size`.
|
|
187
|
+
* - true | "xs": oculta en contenedor ≤ 480px (default)
|
|
188
|
+
* - "sm": oculta en contenedor ≤ 640px
|
|
189
|
+
* - "md": oculta en contenedor ≤ 768px
|
|
190
|
+
* - "lg": oculta en contenedor ≤ 1024px
|
|
191
|
+
* @default undefined
|
|
192
|
+
*/
|
|
193
|
+
collapseLabel?: boolean | "xs" | "sm" | "md" | "lg";
|
|
194
|
+
/** Textos de UI internos del componente para localización. */
|
|
195
|
+
labels?: EFWButtonLabels;
|
|
175
196
|
}
|
|
176
197
|
/**
|
|
177
198
|
* Interfaz para los métodos expuestos por el hook useEFWButton.
|
|
@@ -278,5 +299,10 @@ export interface UseEFWButtonOptions {
|
|
|
278
299
|
* @default true
|
|
279
300
|
*/
|
|
280
301
|
autoReset?: boolean;
|
|
302
|
+
/**
|
|
303
|
+
* Mensaje usado cuando una operación falla sin mensaje específico.
|
|
304
|
+
* @default "Operation failed"
|
|
305
|
+
*/
|
|
306
|
+
fallbackErrorMessage?: string;
|
|
281
307
|
}
|
|
282
308
|
export {};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
export { EFWButton } from './EFWButton';
|
|
2
2
|
export { useEFWButton } from './EFWButton.hooks';
|
|
3
|
-
export type { EFWButtonProps, EFWButtonHandle, EFWButtonActionResult, UseEFWButtonOptions } from './EFWButton.types';
|
|
3
|
+
export type { EFWButtonProps, EFWButtonHandle, EFWButtonActionResult, UseEFWButtonOptions, EFWButtonLabels } from './EFWButton.types';
|
|
@@ -44,7 +44,7 @@ export type EFWDrawerButtonClickHandler = (event: React.MouseEvent<HTMLButtonEle
|
|
|
44
44
|
* },
|
|
45
45
|
* drawerConfig: { size: 'medium', position: 'end' },
|
|
46
46
|
* autoOpenDrawer: true,
|
|
47
|
-
* loadingText: 'Processing...',
|
|
47
|
+
* labels: { loadingText: 'Processing...' },
|
|
48
48
|
* appearance: 'primary',
|
|
49
49
|
* };
|
|
50
50
|
*/
|
|
@@ -1,65 +1,3 @@
|
|
|
1
1
|
import { EFWGroupButtonProps } from './EFWGroupButton.types';
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
* Componente de grupo de botones que permite renderizar múltiples tipos de botones
|
|
5
|
-
* de Fluent UI, EFWButton y EFWDrawerButton en un contenedor flexible.
|
|
6
|
-
*
|
|
7
|
-
* @template T - Tipo de los parámetros que se pasarán a los manejadores onClick.
|
|
8
|
-
* Debe extender Record<string, any> para asegurar que sea un objeto.
|
|
9
|
-
*
|
|
10
|
-
* @description
|
|
11
|
-
* Este componente proporciona:
|
|
12
|
-
* - Renderizado unificado de diferentes tipos de botones
|
|
13
|
-
* - Inyección automática de parámetros contextuales a los handlers
|
|
14
|
-
* - Detección inteligente del tipo de botón para manejo especializado
|
|
15
|
-
* - Layout flexible con espaciado personalizable
|
|
16
|
-
* - Soporte para EFWDrawerButton con manejo específico de callbacks del drawer
|
|
17
|
-
*
|
|
18
|
-
* **¿Por qué T extends Record<string, any>?**
|
|
19
|
-
* La restricción asegura que T sea un objeto, lo cual es lógico para parámetros
|
|
20
|
-
* contextuales que típicamente contienen múltiples propiedades (userId, action, etc.)
|
|
21
|
-
*
|
|
22
|
-
* @param props - Propiedades del componente
|
|
23
|
-
* @returns JSX.Element - Contenedor div con los botones renderizados
|
|
24
|
-
*
|
|
25
|
-
* @example
|
|
26
|
-
* ```tsx
|
|
27
|
-
* interface UserActionParams {
|
|
28
|
-
* userId: string;
|
|
29
|
-
* action: 'edit' | 'delete' | 'view';
|
|
30
|
-
* }
|
|
31
|
-
*
|
|
32
|
-
* <EFWGroupButton<UserActionParams>
|
|
33
|
-
* buttons={[
|
|
34
|
-
* {
|
|
35
|
-
* component: Button,
|
|
36
|
-
* props: {
|
|
37
|
-
* children: 'Edit',
|
|
38
|
-
* onClick: (event, params) => handleEdit(params.userId)
|
|
39
|
-
* }
|
|
40
|
-
* },
|
|
41
|
-
* {
|
|
42
|
-
* component: EFWButton,
|
|
43
|
-
* props: {
|
|
44
|
-
* children: 'Delete',
|
|
45
|
-
* onClick: async (event, params) => {
|
|
46
|
-
* return await deleteUser(params.userId);
|
|
47
|
-
* }
|
|
48
|
-
* }
|
|
49
|
-
* },
|
|
50
|
-
* {
|
|
51
|
-
* component: EFWDrawerButton,
|
|
52
|
-
* props: {
|
|
53
|
-
* children: 'View Details',
|
|
54
|
-
* drawerTitle: 'User Details',
|
|
55
|
-
* drawerBody: <UserDetails />,
|
|
56
|
-
* drawerOnOpen: (params) => console.log('Opening drawer for:', params.userId)
|
|
57
|
-
* }
|
|
58
|
-
* }
|
|
59
|
-
* ]}
|
|
60
|
-
* onClickParams={{ userId: '123', action: 'edit' }}
|
|
61
|
-
* gap="12px"
|
|
62
|
-
* />
|
|
63
|
-
* ```
|
|
64
|
-
*/
|
|
65
|
-
export declare const EFWGroupButton: <T extends Record<string, any>>({ buttons, onClickParams, style, gap, className }: EFWGroupButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const EFWGroupButton: <T extends Record<string, any>>({ buttons, onClickParams, style, gap, className, labels, }: EFWGroupButtonProps<T>) => import("react/jsx-runtime").JSX.Element;
|