@envisiongroup/porygon 1.0.0-rc.9 → 1.0.1
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 +388 -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,83 +0,0 @@
|
|
|
1
|
-
const p = (t) => {
|
|
2
|
-
const r = (t || "").toString(), e = r.replace(/^0+/, "");
|
|
3
|
-
let n = "";
|
|
4
|
-
if (e != "" && e.length > 1) {
|
|
5
|
-
const l = e.replace(/\./g, "").replace(/-/g, ""), s = l.substring(0, l.length - 1);
|
|
6
|
-
let c = 0, o = 1;
|
|
7
|
-
for (c = s.length - 1; c >= 0; c--)
|
|
8
|
-
n = s.charAt(c) + n, o % 3 == 0 && o <= s.length - 1 && (n = "." + n), o++;
|
|
9
|
-
const g = l.substring(l.length - 1);
|
|
10
|
-
return n = n + "-" + g, n;
|
|
11
|
-
} else
|
|
12
|
-
return r;
|
|
13
|
-
}, u = (t) => {
|
|
14
|
-
if (t = t || "", t = t.replace(/\./g, ""), !/^[0-9]+[-|‐]{1}[0-9kK]{1}$/.test(t))
|
|
15
|
-
return !1;
|
|
16
|
-
const r = t.split("-");
|
|
17
|
-
let e = r[1];
|
|
18
|
-
const n = r[0], i = function(l) {
|
|
19
|
-
let s = 0, c = 1;
|
|
20
|
-
for (; l; l = Math.floor(l / 10))
|
|
21
|
-
c = (c + l % 10 * (9 - s++ % 6)) % 11;
|
|
22
|
-
return c ? c - 1 : "k";
|
|
23
|
-
};
|
|
24
|
-
return e == "K" && (e = "k"), i(n) == e;
|
|
25
|
-
}, d = (t) => /^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/.test(t), m = (t, r, e = ",", n = ".") => {
|
|
26
|
-
if (t == null) return "";
|
|
27
|
-
typeof t == "number" && (t = t.toString(), Number.isInteger(t) || (t = t.replace(".", n))), e = e || ",", n = n || ".";
|
|
28
|
-
const i = new RegExp("[^" + n + "\\d]", "g"), s = t.replace(i, "").toString().split(n), c = s[0].length % 3;
|
|
29
|
-
let o = s[0].substr(0, c);
|
|
30
|
-
const g = s[0].substr(c).match(/\d{3}/g);
|
|
31
|
-
return g && (o += (c ? e : "") + g.join(e)), o = s[1] != null ? o + n + s[1] : o, r == null ? o : o ? r + o : "";
|
|
32
|
-
}, $ = (t = "") => {
|
|
33
|
-
const r = t.toString().replace(/[^\d.]/g, "");
|
|
34
|
-
return isNaN(Number(r)) || r === "" ? "" : r;
|
|
35
|
-
}, f = {
|
|
36
|
-
none: (t) => t,
|
|
37
|
-
email: (t) => t,
|
|
38
|
-
phone: (t) => t.replace(/\D/g, ""),
|
|
39
|
-
creditCard: (t) => t.replace(/\D/g, ""),
|
|
40
|
-
chileanRut: (t) => {
|
|
41
|
-
const r = t.replace(/[^\dkK-]/gi, ""), e = r.includes("-"), n = r.replace(/-/g, "");
|
|
42
|
-
if (e && n.length >= 2) {
|
|
43
|
-
const i = n.length - 1;
|
|
44
|
-
return n.slice(0, i) + "-" + n.slice(i);
|
|
45
|
-
}
|
|
46
|
-
return n;
|
|
47
|
-
},
|
|
48
|
-
date: (t) => t.replace(/\D/g, ""),
|
|
49
|
-
//number: (value) => stripFormatNumber(value || ''),
|
|
50
|
-
custom: (t) => t.replace(/\D/g, "")
|
|
51
|
-
// Por defecto, podría personalizarse
|
|
52
|
-
}, a = {
|
|
53
|
-
none: (t) => t,
|
|
54
|
-
email: (t) => t,
|
|
55
|
-
phone: (t) => t.length <= 3 ? t : t.length <= 6 ? `(${t.slice(0, 3)}) ${t.slice(3)}` : `(${t.slice(0, 3)}) ${t.slice(3, 6)}-${t.slice(6, 10)}`,
|
|
56
|
-
creditCard: (t) => t.replace(/(\d{4})(?=\d)/g, "$1 ").trim(),
|
|
57
|
-
chileanRut: (t) => p(t),
|
|
58
|
-
date: (t) => t.length <= 2 ? t : t.length <= 4 ? `${t.slice(0, 2)}/${t.slice(2)}` : `${t.slice(0, 2)}/${t.slice(2, 4)}/${t.slice(4, 8)}`,
|
|
59
|
-
// number: (value) => {
|
|
60
|
-
// if (isNaN(Number(value))) return value; // Si no es un número válido, retornar el valor original
|
|
61
|
-
// return formatNumber(value)
|
|
62
|
-
// },
|
|
63
|
-
custom: (t, r = {}) => {
|
|
64
|
-
if (r.formatFunction)
|
|
65
|
-
return r.formatFunction(t) || t;
|
|
66
|
-
if (r.formatPattern) {
|
|
67
|
-
let e = "", n = 0;
|
|
68
|
-
for (let i = 0; i < r.formatPattern.length && n < t.length; i++)
|
|
69
|
-
r.formatPattern[i] === "#" ? (e += t[n], n++) : (e += r.formatPattern[i], r.formatPattern[i] === t[n] && n++);
|
|
70
|
-
return e;
|
|
71
|
-
}
|
|
72
|
-
return t;
|
|
73
|
-
}
|
|
74
|
-
}, F = (t, r) => t ? (f[r] || f.none)(t) : "", P = (t, r, e = {}) => t ? (a[r] || a.none)(t, e) : "";
|
|
75
|
-
export {
|
|
76
|
-
P as applyFormatting,
|
|
77
|
-
p as formatChileanRut,
|
|
78
|
-
m as formatNumber,
|
|
79
|
-
$ as stripFormatNumber,
|
|
80
|
-
F as stripFormatting,
|
|
81
|
-
u as validateChileanRut,
|
|
82
|
-
d as validateEmail
|
|
83
|
-
};
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
-
import { EFWField as q } from "../EFWField/EFWField.js";
|
|
3
|
-
import { EFWInput as w } from "../EFWInput/EFWInput.js";
|
|
4
|
-
const P = (n) => {
|
|
5
|
-
const {
|
|
6
|
-
title: a,
|
|
7
|
-
infoLabel: o,
|
|
8
|
-
hint: l,
|
|
9
|
-
style: i = {},
|
|
10
|
-
size: r,
|
|
11
|
-
required: d = !1,
|
|
12
|
-
contentBefore: f,
|
|
13
|
-
contentAfter: h,
|
|
14
|
-
minLength: m = 0,
|
|
15
|
-
maxLength: s = 250,
|
|
16
|
-
validationState: u,
|
|
17
|
-
validationMessage: g,
|
|
18
|
-
value: p,
|
|
19
|
-
defaultValue: c,
|
|
20
|
-
editable: e = !0,
|
|
21
|
-
disabled: C = !1,
|
|
22
|
-
hidden: F = !1,
|
|
23
|
-
onChange: b,
|
|
24
|
-
autoComplete: x = "off",
|
|
25
|
-
type: L = "text",
|
|
26
|
-
placeholder: v,
|
|
27
|
-
formatType: y = "none",
|
|
28
|
-
formatPattern: E,
|
|
29
|
-
formatFunction: W,
|
|
30
|
-
onValidationChange: I
|
|
31
|
-
} = n;
|
|
32
|
-
return /* @__PURE__ */ t(
|
|
33
|
-
q,
|
|
34
|
-
{
|
|
35
|
-
style: i,
|
|
36
|
-
title: a,
|
|
37
|
-
infoLabel: o,
|
|
38
|
-
weightLabel: e ? "regular" : "semibold",
|
|
39
|
-
hint: l,
|
|
40
|
-
size: r,
|
|
41
|
-
required: d,
|
|
42
|
-
validationState: u,
|
|
43
|
-
validationMessage: g,
|
|
44
|
-
onValidationChange: I,
|
|
45
|
-
hidden: F,
|
|
46
|
-
children: /* @__PURE__ */ t(
|
|
47
|
-
w,
|
|
48
|
-
{
|
|
49
|
-
value: p,
|
|
50
|
-
defaultValue: c,
|
|
51
|
-
editable: e,
|
|
52
|
-
onChange: (V, j) => {
|
|
53
|
-
b?.(V, j);
|
|
54
|
-
},
|
|
55
|
-
minLength: m,
|
|
56
|
-
maxLength: s,
|
|
57
|
-
disabled: C,
|
|
58
|
-
autoComplete: x,
|
|
59
|
-
type: L,
|
|
60
|
-
placeholder: v,
|
|
61
|
-
contentBefore: f,
|
|
62
|
-
contentAfter: h,
|
|
63
|
-
formatType: y,
|
|
64
|
-
formatPattern: E,
|
|
65
|
-
formatFunction: W
|
|
66
|
-
}
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
);
|
|
70
|
-
};
|
|
71
|
-
export {
|
|
72
|
-
P as EFWInputField
|
|
73
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
@@ -1,198 +0,0 @@
|
|
|
1
|
-
import { jsx as j, Fragment as ie } from "react/jsx-runtime";
|
|
2
|
-
import { makeStyles as ce, tokens as C, mergeClasses as de, Input as fe, Text as me } from "@fluentui/react-components";
|
|
3
|
-
import { useId as pe, useMemo as S, useCallback as k, useState as A, useRef as ge, useEffect as L } from "react";
|
|
4
|
-
import { stripFormatting as D, applyFormatting as p, isValidNumber as Q } from "./EFWNumberInput.utils.js";
|
|
5
|
-
const be = ce({
|
|
6
|
-
EFWNumberInputError: {
|
|
7
|
-
backgroundColor: C.colorPaletteRedBackground1,
|
|
8
|
-
"::after": {
|
|
9
|
-
borderBottomColor: C.colorPaletteRedBorder2,
|
|
10
|
-
borderBottomStyle: "solid",
|
|
11
|
-
borderBottomWidth: "2px"
|
|
12
|
-
}
|
|
13
|
-
},
|
|
14
|
-
EFWNumberInput: {
|
|
15
|
-
"& [disabled]": {
|
|
16
|
-
backgroundColor: C.colorNeutralBackground3,
|
|
17
|
-
color: C.colorNeutralForeground2,
|
|
18
|
-
"&::placeholder": {
|
|
19
|
-
color: "transparent"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"&:has(span + [disabled])": {
|
|
23
|
-
backgroundColor: C.colorNeutralBackground3
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}), Ve = () => {
|
|
27
|
-
const i = /* @__PURE__ */ new Map();
|
|
28
|
-
return (o, V) => {
|
|
29
|
-
const a = `${o}-${V}`;
|
|
30
|
-
if (!i.has(a)) {
|
|
31
|
-
const w = o.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), h = V.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
32
|
-
i.set(a, {
|
|
33
|
-
validation: new RegExp(`^-?[\\d${w}]*${h}?\\d*$`),
|
|
34
|
-
thousandSeparator: new RegExp(`^\\d+${w}0{1,2}$`),
|
|
35
|
-
progressPatterns: [
|
|
36
|
-
new RegExp("^-?$"),
|
|
37
|
-
new RegExp(`^-?\\d+${h}$`),
|
|
38
|
-
new RegExp(`^-?\\d+${h}0+$`),
|
|
39
|
-
new RegExp(`^-?[\\d${w}]+${h}$`),
|
|
40
|
-
new RegExp(`^-?[\\d${w}]+${h}0+$`)
|
|
41
|
-
]
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
return i.get(a);
|
|
45
|
-
};
|
|
46
|
-
}, he = Ve(), X = (i, o) => o.some((V) => V.test(i)), Ee = (i, o) => i.includes(o) && (i.endsWith("0") || i.endsWith(o) || /\.\d*0$/.test(i.replace(o, "."))), ye = (i) => {
|
|
47
|
-
const {
|
|
48
|
-
value: o,
|
|
49
|
-
defaultValue: V,
|
|
50
|
-
onChange: a,
|
|
51
|
-
editable: w = !0,
|
|
52
|
-
disabled: h = !1,
|
|
53
|
-
className: Y = "",
|
|
54
|
-
autoComplete: Z = "off",
|
|
55
|
-
placeholder: ee,
|
|
56
|
-
contentBefore: re,
|
|
57
|
-
contentAfter: te,
|
|
58
|
-
formatType: t = "number",
|
|
59
|
-
maxValue: R,
|
|
60
|
-
minValue: F,
|
|
61
|
-
validationState: ne = "none",
|
|
62
|
-
setParentComponentState: d,
|
|
63
|
-
enableFormatting: H = !0,
|
|
64
|
-
thousandSeparator: N = ",",
|
|
65
|
-
decimalSeparator: f = "."
|
|
66
|
-
} = i, I = V ?? null, O = be(), U = pe(), x = o !== void 0, P = x ? o ?? null : V ?? null, n = S(() => ({
|
|
67
|
-
enableFormatting: H,
|
|
68
|
-
thousandSeparator: N,
|
|
69
|
-
decimalSeparator: f
|
|
70
|
-
}), [H, N, f]), $ = k((r) => r === null ? "" : D(r.toString(), t, n), [t, n]), B = S(() => $(P), [$, P]), y = S(
|
|
71
|
-
() => $(I),
|
|
72
|
-
[$, I]
|
|
73
|
-
), _ = S(
|
|
74
|
-
() => y ? p(y, t, n) : "",
|
|
75
|
-
[y, t, n]
|
|
76
|
-
), [c, g] = A(() => B ? p(B, t, n) : ""), [W, v] = A(!1), [b, q] = A(!1), l = ge({
|
|
77
|
-
prevValue: P,
|
|
78
|
-
lastValidatedValue: "",
|
|
79
|
-
rawValue: B
|
|
80
|
-
}), E = he(N, f), T = k((r) => {
|
|
81
|
-
if (l.current.lastValidatedValue === r)
|
|
82
|
-
return W;
|
|
83
|
-
if (l.current.lastValidatedValue = r, t !== "number" || r.length === 0)
|
|
84
|
-
return d?.("none", ""), !1;
|
|
85
|
-
if (!E.validation.test(r))
|
|
86
|
-
return d?.("error", "El valor ingresado no es un número válido."), !0;
|
|
87
|
-
const s = D(r, t, n);
|
|
88
|
-
if (X(r, E.progressPatterns))
|
|
89
|
-
return d?.("none", ""), !1;
|
|
90
|
-
if (s && !Q(s))
|
|
91
|
-
return d?.("error", "El valor ingresado no es un número válido."), !0;
|
|
92
|
-
if (s) {
|
|
93
|
-
const e = Number(s);
|
|
94
|
-
if (F !== void 0 && e < F)
|
|
95
|
-
return d?.("error", `El valor debe ser mayor o igual a ${p(F.toString(), "number", n)}.`), !0;
|
|
96
|
-
if (R !== void 0 && e > R)
|
|
97
|
-
return d?.("error", `El valor debe ser menor o igual a ${p(R.toString(), "number", n)}.`), !0;
|
|
98
|
-
}
|
|
99
|
-
return d?.("none", ""), !1;
|
|
100
|
-
}, [t, E, d, F, R, n, W]);
|
|
101
|
-
L(() => {
|
|
102
|
-
if (x && o !== l.current.prevValue && !b) {
|
|
103
|
-
const r = $(o ?? null), s = r ? p(r, t, n) : "";
|
|
104
|
-
l.current.rawValue = r, l.current.prevValue = o ?? null, g(s), v(!1);
|
|
105
|
-
}
|
|
106
|
-
}, [o, t, n, b, x, $]), L(() => {
|
|
107
|
-
x || b || (l.current.rawValue = y, l.current.prevValue = I, g(_), v(!1));
|
|
108
|
-
}, [
|
|
109
|
-
x,
|
|
110
|
-
b,
|
|
111
|
-
y,
|
|
112
|
-
_,
|
|
113
|
-
I
|
|
114
|
-
]);
|
|
115
|
-
const ae = k(() => {
|
|
116
|
-
if (t !== "number" || !b) return;
|
|
117
|
-
q(!1);
|
|
118
|
-
let r = c;
|
|
119
|
-
if (r.endsWith(f) && (r = r.slice(0, -1)), r.includes(f)) {
|
|
120
|
-
const [e, z] = r.split(f);
|
|
121
|
-
z && /^0+$/.test(z) && (r = e);
|
|
122
|
-
}
|
|
123
|
-
const s = D(r, t, n);
|
|
124
|
-
if (s && Q(s)) {
|
|
125
|
-
const e = p(s, t, n);
|
|
126
|
-
l.current.rawValue = s, g(e), v(!1), a?.(Number(s), e);
|
|
127
|
-
} else (c === "" || c === "-") && (l.current.rawValue = "", g(""), v(!1), a?.(null, ""));
|
|
128
|
-
}, [c, t, n, a, f, b]), oe = k((r, s) => {
|
|
129
|
-
if (typeof s.value != "string") return;
|
|
130
|
-
const e = s.value;
|
|
131
|
-
if (b || q(!0), g(e), e.length < c.length && c.startsWith(e) && E.thousandSeparator.test(e)) {
|
|
132
|
-
const u = e.replace(new RegExp(N.replace(/[.*+?^${}()|[\]\\]/g, "\\$&"), "g"), ""), M = p(u, t, n), K = T(M);
|
|
133
|
-
l.current.rawValue = u, g(M), v(K), a?.(K || !u ? null : Number(u), M);
|
|
134
|
-
return;
|
|
135
|
-
}
|
|
136
|
-
const m = D(e, t, n), G = T(e), J = Ee(e, f), ue = X(e, E.progressPatterns);
|
|
137
|
-
if (l.current.rawValue = m, v(G), G)
|
|
138
|
-
if (m && E.validation.test(e))
|
|
139
|
-
if (J)
|
|
140
|
-
a?.(Number(m), e);
|
|
141
|
-
else {
|
|
142
|
-
const u = p(m, t, n);
|
|
143
|
-
g(u), a?.(Number(m), u);
|
|
144
|
-
}
|
|
145
|
-
else
|
|
146
|
-
a?.(null, e);
|
|
147
|
-
else if (m)
|
|
148
|
-
if (J)
|
|
149
|
-
a?.(Number(m), e);
|
|
150
|
-
else {
|
|
151
|
-
const u = p(m, t, n);
|
|
152
|
-
g(u), a?.(Number(m), u);
|
|
153
|
-
}
|
|
154
|
-
else if (ue) {
|
|
155
|
-
const u = e.replace(/[^\d-]/g, "");
|
|
156
|
-
u && u !== "-" ? (l.current.rawValue = u, a?.(Number(u), e)) : (l.current.rawValue = "", a?.(null, e));
|
|
157
|
-
} else
|
|
158
|
-
l.current.rawValue = "", a?.(null, "");
|
|
159
|
-
}, [
|
|
160
|
-
c,
|
|
161
|
-
b,
|
|
162
|
-
E,
|
|
163
|
-
N,
|
|
164
|
-
t,
|
|
165
|
-
n,
|
|
166
|
-
T,
|
|
167
|
-
f,
|
|
168
|
-
a
|
|
169
|
-
]), le = ne === "error" || W, se = de(
|
|
170
|
-
Y,
|
|
171
|
-
O.EFWNumberInput,
|
|
172
|
-
le && O.EFWNumberInputError
|
|
173
|
-
);
|
|
174
|
-
return /* @__PURE__ */ j(ie, { children: w ? /* @__PURE__ */ j(
|
|
175
|
-
fe,
|
|
176
|
-
{
|
|
177
|
-
className: se,
|
|
178
|
-
id: U,
|
|
179
|
-
name: U,
|
|
180
|
-
type: "text",
|
|
181
|
-
placeholder: ee,
|
|
182
|
-
contentBefore: re,
|
|
183
|
-
contentAfter: te,
|
|
184
|
-
disabled: h,
|
|
185
|
-
value: c,
|
|
186
|
-
"data-raw-value": l.current.rawValue,
|
|
187
|
-
autoComplete: Z,
|
|
188
|
-
autoCorrect: "off",
|
|
189
|
-
autoCapitalize: "off",
|
|
190
|
-
spellCheck: "false",
|
|
191
|
-
onChange: oe,
|
|
192
|
-
onBlur: ae
|
|
193
|
-
}
|
|
194
|
-
) : /* @__PURE__ */ j(me, { style: c ? void 0 : { opacity: 0.7 }, children: c || "Sin datos disponibles" }) });
|
|
195
|
-
};
|
|
196
|
-
export {
|
|
197
|
-
ye as EFWNumberInput
|
|
198
|
-
};
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
const y = (n, e, c = ",", t = ".") => {
|
|
2
|
-
const p = (r) => r == null, m = (r) => r.length <= 3 ? r : r.replace(/\B(?=(\d{3})+(?!\d))/g, c), b = (r) => r.replace(/^0+(?=\d)/, "") || "0", d = (r) => /[^0]/.test(r) && r.replace(/0+$/, "") || "0";
|
|
3
|
-
if (p(n) || typeof n == "number" && !Number.isFinite(n)) return "";
|
|
4
|
-
if (typeof n == "number") {
|
|
5
|
-
const r = n < 0, i = Math.abs(n);
|
|
6
|
-
let [h, u = ""] = i.toString().split(".");
|
|
7
|
-
if (/[eE]/.test(u)) {
|
|
8
|
-
const w = i.toFixed(20).replace(/0+$/, "");
|
|
9
|
-
[h, u = ""] = w.split(".");
|
|
10
|
-
}
|
|
11
|
-
h = b(h), u = u && d(u);
|
|
12
|
-
let a = m(h);
|
|
13
|
-
return u && (a += t + u), r && (a = "-" + a), e && a && (a = e + a), a;
|
|
14
|
-
}
|
|
15
|
-
let s = n.trim();
|
|
16
|
-
if (!s) return "";
|
|
17
|
-
let g = !1;
|
|
18
|
-
/^\(.*\)$/.test(s) && (s = s.slice(1, -1));
|
|
19
|
-
const $ = s.match(/^-+/);
|
|
20
|
-
if ($ && (g = $[0].length === 1, s = s.slice($[0].length)), /^[+-]?\d*\.?\d+e[+-]?\d+$/i.test(s)) {
|
|
21
|
-
const r = Number(s);
|
|
22
|
-
let i = y(r, void 0, c, t);
|
|
23
|
-
return /\.\d$/.test(i) && (i = i.replace(new RegExp(`\\${t}0$`), "")), g && (i = "-" + i), e && i && (i = e + i), i;
|
|
24
|
-
}
|
|
25
|
-
const l = s.replace(/[^\d.,]/g, "");
|
|
26
|
-
if (!/\d/.test(l)) return "";
|
|
27
|
-
const D = l.lastIndexOf(","), E = l.lastIndexOf(".");
|
|
28
|
-
let f = Math.max(D, E);
|
|
29
|
-
f > -1 && /^\d{3}$/.test(l.slice(f + 1)) && l.slice(0, f).includes(l[f]) && (f = -1);
|
|
30
|
-
const I = f === -1 ? l : l.slice(0, f), F = f === -1 ? "" : l.slice(f + 1), M = b(I.replace(/[.,]/g, "")), x = F ? d(F.replace(/[^\d]/g, "")) : "";
|
|
31
|
-
let o = m(M);
|
|
32
|
-
return x ? o += t + x : s.endsWith(t) && (o += t), g && (o = "-" + o), e && o && (o = e + o), o;
|
|
33
|
-
}, O = (n = "", e = ".", c = ",") => {
|
|
34
|
-
if (!n || typeof n != "string") return "";
|
|
35
|
-
let t = n.trim();
|
|
36
|
-
if (!t) return "";
|
|
37
|
-
let p = !1;
|
|
38
|
-
/^\(.*\)$/.test(t) && (p = !0, t = t.slice(1, -1));
|
|
39
|
-
const m = t.match(/^-+/);
|
|
40
|
-
m && (p = m[0].length % 2 === 1, t = t.slice(m[0].length)), t = t.replace(/^[^\d.,-]+|[^\d.,-]+$/g, "");
|
|
41
|
-
const b = (s) => s.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
42
|
-
if (c) {
|
|
43
|
-
const s = new RegExp(b(c), "g");
|
|
44
|
-
t = t.replace(s, "");
|
|
45
|
-
}
|
|
46
|
-
if (e && e !== ".") {
|
|
47
|
-
const s = new RegExp(b(e), "g"), g = t.lastIndexOf(e);
|
|
48
|
-
g !== -1 && (t = t.slice(0, g).replace(s, "") + "." + t.slice(g + e.length));
|
|
49
|
-
}
|
|
50
|
-
t = t.replace(/[^\d.-]/g, "");
|
|
51
|
-
const d = t.split(".");
|
|
52
|
-
return d.length > 2 && (t = d.shift() + "." + d.join("")), t = t.replace(/^-+/, "-").replace(/(?!^)-/g, ""), /^\d+(\.\d+)?$/.test(t.replace(/^-/, "")) ? (t[t.length - 1] === e && (t = t.slice(0, -1)), p && (t = "-" + t), t) : "";
|
|
53
|
-
}, N = {
|
|
54
|
-
number: (n, e) => O(
|
|
55
|
-
n || "",
|
|
56
|
-
e?.decimalSeparator || ".",
|
|
57
|
-
e?.thousandSeparator || ","
|
|
58
|
-
)
|
|
59
|
-
}, R = {
|
|
60
|
-
number: (n, e) => e?.enableFormatting === !1 || isNaN(Number(n)) ? n : y(
|
|
61
|
-
n,
|
|
62
|
-
void 0,
|
|
63
|
-
e?.thousandSeparator || ",",
|
|
64
|
-
e?.decimalSeparator || "."
|
|
65
|
-
)
|
|
66
|
-
}, C = (n, e, c = {}) => n ? (N[e] || N.number)(n, c) : "", P = (n, e, c = {}) => n ? (R[e] || R.number)(n, c) : "", j = (n) => {
|
|
67
|
-
const e = n.trim();
|
|
68
|
-
return e === "" ? !1 : /^-?\d+(\.\d*)?$/.test(e);
|
|
69
|
-
};
|
|
70
|
-
export {
|
|
71
|
-
P as applyFormatting,
|
|
72
|
-
y as formatNumber,
|
|
73
|
-
j as isValidNumber,
|
|
74
|
-
O as stripFormatNumber,
|
|
75
|
-
C as stripFormatting
|
|
76
|
-
};
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { EFWField as I } from "../EFWField/EFWField.js";
|
|
3
|
-
import { EFWNumberInput as L } from "../EFWNumberInput/EFWNumberInput.js";
|
|
4
|
-
const y = (t) => {
|
|
5
|
-
const {
|
|
6
|
-
title: n,
|
|
7
|
-
infoLabel: l,
|
|
8
|
-
hint: o,
|
|
9
|
-
style: r = {},
|
|
10
|
-
required: i = !1,
|
|
11
|
-
contentBefore: d,
|
|
12
|
-
contentAfter: u,
|
|
13
|
-
minValue: h,
|
|
14
|
-
maxValue: m,
|
|
15
|
-
validationState: s,
|
|
16
|
-
validationMessage: f,
|
|
17
|
-
value: p,
|
|
18
|
-
defaultValue: c,
|
|
19
|
-
editable: e = !0,
|
|
20
|
-
disabled: g = !1,
|
|
21
|
-
hidden: b = !1,
|
|
22
|
-
onChange: C,
|
|
23
|
-
autoComplete: F = "off",
|
|
24
|
-
placeholder: V,
|
|
25
|
-
thousandSeparator: v,
|
|
26
|
-
decimalSeparator: x,
|
|
27
|
-
onValidationChange: E
|
|
28
|
-
} = t;
|
|
29
|
-
return /* @__PURE__ */ a(
|
|
30
|
-
I,
|
|
31
|
-
{
|
|
32
|
-
style: r,
|
|
33
|
-
title: n,
|
|
34
|
-
infoLabel: l,
|
|
35
|
-
weightLabel: e ? "regular" : "semibold",
|
|
36
|
-
hint: o,
|
|
37
|
-
required: i,
|
|
38
|
-
validationState: s,
|
|
39
|
-
validationMessage: f,
|
|
40
|
-
onValidationChange: E,
|
|
41
|
-
hidden: b,
|
|
42
|
-
children: /* @__PURE__ */ a(
|
|
43
|
-
L,
|
|
44
|
-
{
|
|
45
|
-
value: p,
|
|
46
|
-
defaultValue: c,
|
|
47
|
-
editable: e,
|
|
48
|
-
onChange: (S, W) => {
|
|
49
|
-
C?.(S, W);
|
|
50
|
-
},
|
|
51
|
-
disabled: g,
|
|
52
|
-
autoComplete: F,
|
|
53
|
-
placeholder: V,
|
|
54
|
-
contentBefore: d,
|
|
55
|
-
contentAfter: u,
|
|
56
|
-
minValue: h,
|
|
57
|
-
maxValue: m,
|
|
58
|
-
thousandSeparator: v,
|
|
59
|
-
decimalSeparator: x
|
|
60
|
-
}
|
|
61
|
-
)
|
|
62
|
-
}
|
|
63
|
-
);
|
|
64
|
-
};
|
|
65
|
-
export {
|
|
66
|
-
y as EFWNumberInputField
|
|
67
|
-
};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export {};
|
|
File without changes
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as r, Fragment as x } from "react/jsx-runtime";
|
|
2
|
-
import { makeStyles as y, tokens as c, mergeClasses as T, Switch as v, Text as F } from "@fluentui/react-components";
|
|
3
|
-
import { useId as V, useState as _, useEffect as I, useCallback as B } from "react";
|
|
4
|
-
const E = y({
|
|
5
|
-
efwSwitch: {
|
|
6
|
-
"& [disabled]": {
|
|
7
|
-
"&~ .fui-Switch__indicator": {
|
|
8
|
-
backgroundColor: c.colorNeutralBackground3,
|
|
9
|
-
color: c.colorNeutralForeground4
|
|
10
|
-
},
|
|
11
|
-
"&~ .fui-Switch__label": {
|
|
12
|
-
color: c.colorNeutralForeground2
|
|
13
|
-
}
|
|
14
|
-
},
|
|
15
|
-
// Afectar el span que contiene el input disabled
|
|
16
|
-
"& :has(span + [disabled])": {
|
|
17
|
-
backgroundColor: c.colorNeutralBackground3
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}), U = (f) => {
|
|
21
|
-
const {
|
|
22
|
-
value: d,
|
|
23
|
-
defaultValue: k,
|
|
24
|
-
onChange: i,
|
|
25
|
-
className: m = "",
|
|
26
|
-
editable: g = !0,
|
|
27
|
-
disabled: C = !1,
|
|
28
|
-
checkedText: l = "Sí",
|
|
29
|
-
uncheckedText: s = "No"
|
|
30
|
-
} = f, S = E(), b = V(), o = k ?? !1, e = d !== void 0, [w, u] = _(o);
|
|
31
|
-
I(() => {
|
|
32
|
-
e || u((t) => t === o ? t : o);
|
|
33
|
-
}, [e, o]);
|
|
34
|
-
const h = e ? !!d : w, a = h ? l : s, p = B((t) => {
|
|
35
|
-
const n = t.currentTarget.checked;
|
|
36
|
-
e || u(n), i?.(n, n ? l : s);
|
|
37
|
-
}, [l, s, i, e]), N = T(
|
|
38
|
-
S.efwSwitch,
|
|
39
|
-
m
|
|
40
|
-
);
|
|
41
|
-
return /* @__PURE__ */ r(x, { children: g ? /* @__PURE__ */ r(
|
|
42
|
-
v,
|
|
43
|
-
{
|
|
44
|
-
className: N,
|
|
45
|
-
id: b,
|
|
46
|
-
disabled: C,
|
|
47
|
-
checked: h,
|
|
48
|
-
onChange: p,
|
|
49
|
-
label: a
|
|
50
|
-
}
|
|
51
|
-
) : /* @__PURE__ */ r(F, { style: a ? void 0 : { opacity: 0.7 }, children: a || "Sin datos disponibles" }) });
|
|
52
|
-
};
|
|
53
|
-
export {
|
|
54
|
-
U as EFWSwitch
|
|
55
|
-
};
|
|
@@ -1,55 +0,0 @@
|
|
|
1
|
-
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
-
import { EFWField as x } from "../EFWField/EFWField.js";
|
|
3
|
-
import { EFWSwitch as S } from "../EFWSwitch/EFWSwitch.js";
|
|
4
|
-
const k = (t) => {
|
|
5
|
-
const {
|
|
6
|
-
title: i,
|
|
7
|
-
infoLabel: l,
|
|
8
|
-
hint: n,
|
|
9
|
-
style: o = {},
|
|
10
|
-
required: d = !1,
|
|
11
|
-
validationState: h,
|
|
12
|
-
validationMessage: r,
|
|
13
|
-
value: s,
|
|
14
|
-
defaultValue: c,
|
|
15
|
-
editable: e = !0,
|
|
16
|
-
disabled: f = !1,
|
|
17
|
-
hidden: g = !1,
|
|
18
|
-
checkedText: u = "Sí",
|
|
19
|
-
uncheckedText: m = "No",
|
|
20
|
-
onChange: b,
|
|
21
|
-
onValidationChange: C
|
|
22
|
-
} = t;
|
|
23
|
-
return /* @__PURE__ */ a(
|
|
24
|
-
x,
|
|
25
|
-
{
|
|
26
|
-
style: o,
|
|
27
|
-
title: i,
|
|
28
|
-
infoLabel: l,
|
|
29
|
-
weightLabel: e ? "regular" : "semibold",
|
|
30
|
-
hint: n,
|
|
31
|
-
required: d,
|
|
32
|
-
validationState: h,
|
|
33
|
-
validationMessage: r,
|
|
34
|
-
onValidationChange: C,
|
|
35
|
-
hidden: g,
|
|
36
|
-
children: /* @__PURE__ */ a(
|
|
37
|
-
S,
|
|
38
|
-
{
|
|
39
|
-
value: s,
|
|
40
|
-
defaultValue: c,
|
|
41
|
-
editable: e,
|
|
42
|
-
onChange: (F, p) => {
|
|
43
|
-
b?.(F, p);
|
|
44
|
-
},
|
|
45
|
-
disabled: f,
|
|
46
|
-
checkedText: u,
|
|
47
|
-
uncheckedText: m
|
|
48
|
-
}
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
};
|
|
53
|
-
export {
|
|
54
|
-
k as EFWSwitchField
|
|
55
|
-
};
|