@envisiongroup/porygon 0.1.0-rc.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/LICENSE +11 -0
- package/README.md +69 -0
- package/dist/index.d.ts +24 -0
- package/dist/index.js +60 -0
- package/dist/react-components/buttons/EFWButton/EFWButton.d.ts +59 -0
- package/dist/react-components/buttons/EFWButton/EFWButton.hooks.d.ts +45 -0
- package/dist/react-components/buttons/EFWButton/EFWButton.hooks.js +75 -0
- package/dist/react-components/buttons/EFWButton/EFWButton.js +164 -0
- package/dist/react-components/buttons/EFWButton/EFWButton.types.d.ts +282 -0
- package/dist/react-components/buttons/EFWButton/index.d.ts +3 -0
- package/dist/react-components/buttons/EFWButton/index.js +6 -0
- package/dist/react-components/buttons/EFWDrawerButton/EFWDrawerButton.d.ts +36 -0
- package/dist/react-components/buttons/EFWDrawerButton/EFWDrawerButton.js +32 -0
- package/dist/react-components/buttons/EFWDrawerButton/EFWDrawerButton.types.d.ts +87 -0
- package/dist/react-components/buttons/EFWDrawerButton/index.d.ts +12 -0
- package/dist/react-components/buttons/EFWDrawerButton/index.js +4 -0
- package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.d.ts +65 -0
- package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.js +129 -0
- package/dist/react-components/buttons/EFWGroupButton/EFWGroupButton.types.d.ts +232 -0
- package/dist/react-components/buttons/EFWGroupButton/index.d.ts +2 -0
- package/dist/react-components/buttons/EFWGroupButton/index.js +4 -0
- package/dist/react-components/commons/utils.d.ts +55 -0
- package/dist/react-components/commons/utils.js +18 -0
- package/dist/react-components/fields/EFWAttachments/EFWAttachments.d.ts +18 -0
- package/dist/react-components/fields/EFWAttachments/EFWAttachments.js +124 -0
- package/dist/react-components/fields/EFWAttachments/EFWAttachments.types.d.ts +78 -0
- package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/EFWAttachmentsCard.d.ts +23 -0
- package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/EFWAttachmentsCard.js +107 -0
- package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/EFWAttachmentsCard.types.d.ts +73 -0
- package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/index.d.ts +1 -0
- package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/index.js +0 -0
- package/dist/react-components/fields/EFWAttachments/index.d.ts +2 -0
- package/dist/react-components/fields/EFWAttachments/index.js +4 -0
- package/dist/react-components/fields/EFWAttachmentsField/EFWAttachmentsField.d.ts +21 -0
- package/dist/react-components/fields/EFWAttachmentsField/EFWAttachmentsField.js +55 -0
- package/dist/react-components/fields/EFWAttachmentsField/EFWAttachmentsField.types.d.ts +7 -0
- package/dist/react-components/fields/EFWAttachmentsField/index.d.ts +2 -0
- package/dist/react-components/fields/EFWAttachmentsField/index.js +4 -0
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.d.ts +34 -0
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.js +135 -0
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.types.d.ts +81 -0
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.utils.d.ts +22 -0
- package/dist/react-components/fields/EFWDatePicker/EFWDatePicker.utils.js +76 -0
- package/dist/react-components/fields/EFWDatePicker/index.d.ts +2 -0
- package/dist/react-components/fields/EFWDatePicker/index.js +4 -0
- package/dist/react-components/fields/EFWDatePickerField/EFWDatePickerField.d.ts +3 -0
- package/dist/react-components/fields/EFWDatePickerField/EFWDatePickerField.js +63 -0
- package/dist/react-components/fields/EFWDatePickerField/EFWDatePickerField.types.d.ts +7 -0
- package/dist/react-components/fields/EFWDatePickerField/index.d.ts +2 -0
- package/dist/react-components/fields/EFWDatePickerField/index.js +4 -0
- package/dist/react-components/fields/EFWField/EFWField.d.ts +53 -0
- package/dist/react-components/fields/EFWField/EFWField.js +90 -0
- package/dist/react-components/fields/EFWField/EFWField.types.d.ts +294 -0
- package/dist/react-components/fields/EFWField/EFWField.utils.d.ts +3 -0
- package/dist/react-components/fields/EFWField/EFWField.utils.js +17 -0
- package/dist/react-components/fields/EFWField/index.d.ts +2 -0
- package/dist/react-components/fields/EFWField/index.js +4 -0
- package/dist/react-components/fields/EFWInput/EFWInput.d.ts +26 -0
- package/dist/react-components/fields/EFWInput/EFWInput.js +100 -0
- package/dist/react-components/fields/EFWInput/EFWInput.types.d.ts +257 -0
- package/dist/react-components/fields/EFWInput/EFWInput.utils.d.ts +20 -0
- package/dist/react-components/fields/EFWInput/EFWInput.utils.js +84 -0
- package/dist/react-components/fields/EFWInput/index.d.ts +2 -0
- package/dist/react-components/fields/EFWInput/index.js +4 -0
- package/dist/react-components/fields/EFWInputField/EFWInputField.d.ts +3 -0
- package/dist/react-components/fields/EFWInputField/EFWInputField.js +71 -0
- package/dist/react-components/fields/EFWInputField/EFWInputField.types.d.ts +6 -0
- package/dist/react-components/fields/EFWInputField/EFWInputField.utils.d.ts +1 -0
- package/dist/react-components/fields/EFWInputField/EFWInputField.utils.js +0 -0
- package/dist/react-components/fields/EFWInputField/index.d.ts +2 -0
- package/dist/react-components/fields/EFWInputField/index.js +4 -0
- package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.d.ts +8 -0
- package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.js +183 -0
- package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.types.d.ts +226 -0
- package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.utils.d.ts +74 -0
- package/dist/react-components/fields/EFWNumberInput/EFWNumberInput.utils.js +76 -0
- package/dist/react-components/fields/EFWNumberInput/index.d.ts +2 -0
- package/dist/react-components/fields/EFWNumberInput/index.js +4 -0
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.d.ts +3 -0
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.js +65 -0
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.types.d.ts +6 -0
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.utils.d.ts +1 -0
- package/dist/react-components/fields/EFWNumberInputField/EFWNumberInputField.utils.js +0 -0
- package/dist/react-components/fields/EFWNumberInputField/index.d.ts +2 -0
- package/dist/react-components/fields/EFWNumberInputField/index.js +4 -0
- package/dist/react-components/fields/EFWSwitch/EFWSwitch.d.ts +3 -0
- package/dist/react-components/fields/EFWSwitch/EFWSwitch.js +54 -0
- package/dist/react-components/fields/EFWSwitch/EFWSwitch.types.d.ts +49 -0
- package/dist/react-components/fields/EFWSwitch/index.d.ts +2 -0
- package/dist/react-components/fields/EFWSwitch/index.js +4 -0
- package/dist/react-components/fields/EFWSwitchField/EFWSwitchField.d.ts +3 -0
- package/dist/react-components/fields/EFWSwitchField/EFWSwitchField.js +53 -0
- package/dist/react-components/fields/EFWSwitchField/EFWSwitchField.types.d.ts +7 -0
- package/dist/react-components/fields/EFWSwitchField/index.d.ts +2 -0
- package/dist/react-components/fields/EFWSwitchField/index.js +4 -0
- package/dist/react-components/fields/EFWTagPicker/EFWTagPicker.d.ts +8 -0
- package/dist/react-components/fields/EFWTagPicker/EFWTagPicker.js +230 -0
- package/dist/react-components/fields/EFWTagPicker/EFWTagPicker.types.d.ts +136 -0
- package/dist/react-components/fields/EFWTagPicker/index.d.ts +2 -0
- package/dist/react-components/fields/EFWTagPicker/index.js +4 -0
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.d.ts +3 -0
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.js +72 -0
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.types.d.ts +8 -0
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.utils.d.ts +1 -0
- package/dist/react-components/fields/EFWTagPickerField/EFWTagPickerField.utils.js +0 -0
- package/dist/react-components/fields/EFWTagPickerField/index.d.ts +2 -0
- package/dist/react-components/fields/EFWTagPickerField/index.js +4 -0
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.d.ts +3 -0
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.js +103 -0
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.types.d.ts +79 -0
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.utils.d.ts +1 -0
- package/dist/react-components/fields/EFWTextArea/EFWTextArea.utils.js +0 -0
- package/dist/react-components/fields/EFWTextArea/index.d.ts +2 -0
- package/dist/react-components/fields/EFWTextArea/index.js +4 -0
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.d.ts +3 -0
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.js +69 -0
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.types.d.ts +6 -0
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.utils.d.ts +1 -0
- package/dist/react-components/fields/EFWTextAreaField/EFWTextAreaField.utils.js +0 -0
- package/dist/react-components/fields/EFWTextAreaField/index.d.ts +2 -0
- package/dist/react-components/fields/EFWTextAreaField/index.js +4 -0
- package/dist/react-components/fields/types.d.ts +1 -0
- package/dist/react-components/fields/types.js +0 -0
- package/dist/react-components/forms/EFWForm/EFWForm.converter.d.ts +3 -0
- package/dist/react-components/forms/EFWForm/EFWForm.converter.js +30 -0
- package/dist/react-components/forms/EFWForm/EFWForm.d.ts +96 -0
- package/dist/react-components/forms/EFWForm/EFWForm.hooks.d.ts +55 -0
- package/dist/react-components/forms/EFWForm/EFWForm.hooks.js +41 -0
- package/dist/react-components/forms/EFWForm/EFWForm.js +363 -0
- package/dist/react-components/forms/EFWForm/EFWForm.types.d.ts +981 -0
- package/dist/react-components/forms/EFWForm/EFWForm.utils.d.ts +19 -0
- package/dist/react-components/forms/EFWForm/EFWForm.utils.js +252 -0
- package/dist/react-components/forms/EFWForm/index.d.ts +4 -0
- package/dist/react-components/forms/EFWForm/index.js +8 -0
- package/dist/react-components/forms/EFWFormMessageBarGroup/EFWFormMessageBarGroup.d.ts +3 -0
- package/dist/react-components/forms/EFWFormMessageBarGroup/EFWFormMessageBarGroup.js +86 -0
- package/dist/react-components/forms/EFWFormMessageBarGroup/EFWFormMessageBarGroup.types.d.ts +34 -0
- package/dist/react-components/forms/EFWFormMessageBarGroup/index.d.ts +2 -0
- package/dist/react-components/forms/EFWFormMessageBarGroup/index.js +4 -0
- package/dist/react-components/forms/EFWMessageBarManager/EFWMessageBarManager.d.ts +3 -0
- package/dist/react-components/forms/EFWMessageBarManager/EFWMessageBarManager.js +32 -0
- package/dist/react-components/forms/EFWMessageBarManager/EFWMessageBarManager.types.d.ts +7 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawer/EFWDrawer.d.ts +3 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawer/EFWDrawer.js +96 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawer/EFWDrawer.types.d.ts +15 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawer/index.d.ts +2 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawer/index.js +4 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/EFWDrawerLoader.d.ts +5 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/EFWDrawerLoader.js +24 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/index.d.ts +1 -0
- package/dist/react-components/hooks/useDrawer/component/EFWDrawerLoader/index.js +4 -0
- package/dist/react-components/hooks/useDrawer/index.d.ts +2 -0
- package/dist/react-components/hooks/useDrawer/index.js +4 -0
- package/dist/react-components/hooks/useDrawer/useDrawer.d.ts +10 -0
- package/dist/react-components/hooks/useDrawer/useDrawer.js +158 -0
- package/dist/react-components/hooks/useDrawer/useDrawer.types.d.ts +72 -0
- package/dist/react-components/layout/MainNavBar/MainNavBar.js +81 -0
- package/dist/react-components/layout/MainNavBar/index.js +4 -0
- package/dist/react-components/layout/MainNavItems/MainNavItems.js +35 -0
- package/dist/react-components/layout/MainNavItems/MainNavItems.styles.js +0 -0
- package/dist/react-components/layout/MainNavItems/index.js +4 -0
- package/dist/react-components/layout/NavBarContext/NavBarContext.js +24 -0
- package/dist/react-components/tables/EFWTable/EFWTable.d.ts +8 -0
- package/dist/react-components/tables/EFWTable/EFWTable.js +585 -0
- package/dist/react-components/tables/EFWTable/EFWTable.types.d.ts +367 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.js +75 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/EFWTableBody.types.d.ts +18 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/index.d.ts +2 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableBody/index.js +4 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.d.ts +16 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCell/EFWTableCell.js +38 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.d.ts +17 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.js +105 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.types.d.ts +94 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.utils.d.ts +14 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/EFWTableCommandBar.utils.js +26 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/index.d.ts +2 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableCommandBar/index.js +4 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/EFWTableEmpty.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/EFWTableEmpty.js +46 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/EFWTableEmpty.types.d.ts +6 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/index.d.ts +2 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableEmpty/index.js +4 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.js +87 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/EFWTableHeader.types.d.ts +13 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/index.d.ts +2 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableHeader/index.js +4 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.d.ts +22 -0
- package/dist/react-components/tables/EFWTable/components/EFWTableRow/EFWTableRow.js +60 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultAddButton/useDefaultAddButton.js +95 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultDeleteButton/useDefaultDeleteButton.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultDeleteButton/useDefaultDeleteButton.js +89 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/hooks/useDefaultUpdateButton/useDefaultUpdateButton.js +98 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController copy.d.ts +4 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController copy.js +178 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.d.ts +4 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.js +178 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.types copy.d.ts +16 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.types copy.js +0 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableController/useTableController.types.d.ts +16 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.js +67 -0
- package/dist/react-components/tables/EFWTable/hooks/useTableSelection/useTableSelection.types.d.ts +37 -0
- package/dist/react-components/tables/EFWTable/index.d.ts +3 -0
- package/dist/react-components/tables/EFWTable/index.js +6 -0
- package/dist/react-components/tables/EFWTable/utils/CellRenderer/CellRenderer.d.ts +7 -0
- package/dist/react-components/tables/EFWTable/utils/CellRenderer/CellRenderer.js +38 -0
- package/dist/react-components/tables/EFWTable/utils/CellRenderer/CellRenderer.types.d.ts +14 -0
- package/dist/react-components/tables/EFWTable/utils/cache.d.ts +37 -0
- package/dist/react-components/tables/EFWTable/utils/cache.js +127 -0
- package/dist/react-components/tables/EFWTable/utils/comparison.d.ts +6 -0
- package/dist/react-components/tables/EFWTable/utils/comparison.js +56 -0
- package/dist/react-components/tables/EFWTable/utils/constants.d.ts +8 -0
- package/dist/react-components/tables/EFWTable/utils/constants.js +9 -0
- package/dist/react-components/tables/EFWTable/utils/context.d.ts +8 -0
- package/dist/react-components/tables/EFWTable/utils/context.js +8 -0
- package/dist/react-components/tables/EFWTable/utils/general.d.ts +4 -0
- package/dist/react-components/tables/EFWTable/utils/general.js +4 -0
- package/dist/react-components/tables/EFWTable/utils/hashing.d.ts +18 -0
- package/dist/react-components/tables/EFWTable/utils/hashing.js +43 -0
- package/dist/react-components/tables/EFWTable/utils/index.d.ts +11 -0
- package/dist/react-components/tables/EFWTable/utils/index.js +24 -0
- package/dist/react-components/tables/EFWTable/utils/renderers.d.ts +8 -0
- package/dist/react-components/tables/EFWTable/utils/renderers.js +25 -0
- package/dist/react-components/tables/EFWTable/utils/types.d.ts +31 -0
- package/dist/react-components/tables/EFWTable/utils/types.js +0 -0
- package/dist/utils/htmlConverter.d.ts +15 -0
- package/dist/utils/htmlConverter.js +12 -0
- package/package.json +114 -0
package/dist/react-components/fields/EFWAttachments/EFWAttachmentsCard/EFWAttachmentsCard.types.d.ts
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { EFWAttachmentsValue } from '../EFWAttachments.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Propiedades para el componente de tarjeta de adjunto.
|
|
5
|
+
* @interface EFWAttachmentsCardProps
|
|
6
|
+
*/
|
|
7
|
+
export interface EFWAttachmentsCardProps {
|
|
8
|
+
/**
|
|
9
|
+
* El adjunto que se mostrará en la tarjeta.
|
|
10
|
+
* @type {EFWAttachmentsValue}
|
|
11
|
+
*/
|
|
12
|
+
attachment: EFWAttachmentsValue;
|
|
13
|
+
/**
|
|
14
|
+
* Función opcional que se ejecuta al eliminar un adjunto.
|
|
15
|
+
* @param {string} id - Identificador único del adjunto a eliminar.
|
|
16
|
+
* @returns {void}
|
|
17
|
+
*/
|
|
18
|
+
onRemoveAttachment?: (id: string) => void;
|
|
19
|
+
/**
|
|
20
|
+
* Clase CSS opcional para personalizar el estilo de la tarjeta.
|
|
21
|
+
* @type {string}
|
|
22
|
+
*/
|
|
23
|
+
className?: string;
|
|
24
|
+
/**
|
|
25
|
+
* Indica si el botón de eliminación está habilitado.
|
|
26
|
+
* @type {boolean}
|
|
27
|
+
* @default false
|
|
28
|
+
*/
|
|
29
|
+
enableRemoveButton?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Propiedades para el contenedor de múltiples adjuntos.
|
|
33
|
+
* @interface EFWAttachmentsContainerProps
|
|
34
|
+
*/
|
|
35
|
+
export interface EFWAttachmentsContainerProps {
|
|
36
|
+
/**
|
|
37
|
+
* Lista opcional de adjuntos a mostrar en el contenedor.
|
|
38
|
+
* @type {EFWAttachmentsValue[]}
|
|
39
|
+
*/
|
|
40
|
+
attachments?: EFWAttachmentsValue[];
|
|
41
|
+
/**
|
|
42
|
+
* Función opcional que se ejecuta al eliminar un adjunto.
|
|
43
|
+
* @param {string} id - Identificador único del adjunto a eliminar.
|
|
44
|
+
* @returns {void}
|
|
45
|
+
*/
|
|
46
|
+
onRemoveAttachment?: (id: string) => void;
|
|
47
|
+
/**
|
|
48
|
+
* Clase CSS opcional para personalizar el estilo del contenedor.
|
|
49
|
+
* @type {string}
|
|
50
|
+
*/
|
|
51
|
+
className?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Clase CSS opcional para personalizar el estilo de las tarjetas dentro del contenedor.
|
|
54
|
+
* @type {string}
|
|
55
|
+
*/
|
|
56
|
+
cardClassName?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Indica si los botones de eliminación están habilitados en las tarjetas.
|
|
59
|
+
* @type {boolean}
|
|
60
|
+
* @default false
|
|
61
|
+
*/
|
|
62
|
+
enableRemoveButtons?: boolean;
|
|
63
|
+
/**
|
|
64
|
+
* Mensaje opcional que se muestra cuando no hay adjuntos.
|
|
65
|
+
* @type {string}
|
|
66
|
+
*/
|
|
67
|
+
emptyMessage?: string;
|
|
68
|
+
/**
|
|
69
|
+
* Número máximo de adjuntos que se pueden mostrar en el contenedor.
|
|
70
|
+
* @type {number}
|
|
71
|
+
*/
|
|
72
|
+
maxItems?: number;
|
|
73
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EFWAttachmentsFieldProps } from './EFWAttachmentsField.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Componente de campo para gestionar adjuntos dentro de un formulario.
|
|
5
|
+
* @param {EFWAttachmentsFieldProps} props - Propiedades del componente.
|
|
6
|
+
* @param {string} [props.title] - Título del campo.
|
|
7
|
+
* @param {string} [props.infoLabel] - Etiqueta informativa del campo.
|
|
8
|
+
* @param {string} [props.hint] - Texto de ayuda o pista para el campo.
|
|
9
|
+
* @param {React.CSSProperties} [props.style={}] - Estilos CSS personalizados para el campo.
|
|
10
|
+
* @param {boolean} [props.required=false] - Indica si el campo es obligatorio.
|
|
11
|
+
* @param {ValidationState} [props.validationState] - Estado de validación del campo.
|
|
12
|
+
* @param {string} [props.validationMessage] - Mensaje de validación para mostrar.
|
|
13
|
+
* @param {boolean} [props.disabled=false] - Indica si el campo está deshabilitado.
|
|
14
|
+
* @param {boolean} [props.editable=true] - Indica si el campo permite cargar o eliminar adjuntos.
|
|
15
|
+
* @param {boolean} [props.hidden=false] - Indica si el campo está oculto.
|
|
16
|
+
* @param {EFWAttachmentsFieldValue[]} [props.values=[]] - Lista inicial de adjuntos.
|
|
17
|
+
* @param {(values: EFWAttachmentsFieldValue[], displayValue?: string) => void} [props.onChange] - Callback ejecutado al cambiar los adjuntos.
|
|
18
|
+
* @param {(state: ValidationState, message?: string) => void} [props.onValidationChange] - Callback ejecutado al cambiar el estado de validación.
|
|
19
|
+
* @returns {JSX.Element} Elemento JSX que representa el campo de adjuntos en un formulario.
|
|
20
|
+
*/
|
|
21
|
+
export declare const EFWAttachmentsField: (props: EFWAttachmentsFieldProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { EFWField as v } from "../EFWField/EFWField.js";
|
|
3
|
+
import { EFWAttachment as A } from "../EFWAttachments/EFWAttachments.js";
|
|
4
|
+
const L = (a) => {
|
|
5
|
+
const {
|
|
6
|
+
title: n,
|
|
7
|
+
infoLabel: i,
|
|
8
|
+
hint: l,
|
|
9
|
+
style: o = {},
|
|
10
|
+
required: d = !1,
|
|
11
|
+
validationState: r,
|
|
12
|
+
validationMessage: s,
|
|
13
|
+
disabled: h = !1,
|
|
14
|
+
editable: e = !0,
|
|
15
|
+
hidden: m = !1,
|
|
16
|
+
files: c = [],
|
|
17
|
+
multiple: f = !0,
|
|
18
|
+
acceptedTypes: g = "*/*",
|
|
19
|
+
onRemoveAttachment: p,
|
|
20
|
+
onChange: u,
|
|
21
|
+
onValidationChange: b
|
|
22
|
+
} = a;
|
|
23
|
+
return /* @__PURE__ */ t(
|
|
24
|
+
v,
|
|
25
|
+
{
|
|
26
|
+
style: o,
|
|
27
|
+
title: n,
|
|
28
|
+
infoLabel: i,
|
|
29
|
+
weightLabel: e ? "regular" : "semibold",
|
|
30
|
+
hint: l,
|
|
31
|
+
hidden: m,
|
|
32
|
+
required: d,
|
|
33
|
+
validationState: r,
|
|
34
|
+
validationMessage: s,
|
|
35
|
+
onValidationChange: b,
|
|
36
|
+
children: /* @__PURE__ */ t(
|
|
37
|
+
A,
|
|
38
|
+
{
|
|
39
|
+
files: c,
|
|
40
|
+
editable: e,
|
|
41
|
+
onChange: (C, F) => {
|
|
42
|
+
u?.(C, F);
|
|
43
|
+
},
|
|
44
|
+
disabled: h,
|
|
45
|
+
multiple: f,
|
|
46
|
+
acceptedTypes: g,
|
|
47
|
+
onRemoveAttachment: p
|
|
48
|
+
}
|
|
49
|
+
)
|
|
50
|
+
}
|
|
51
|
+
);
|
|
52
|
+
};
|
|
53
|
+
export {
|
|
54
|
+
L as EFWAttachmentsField
|
|
55
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EFWFieldProps } from '../EFWField/EFWField.types';
|
|
2
|
+
import { EFWAttachmentsProps, EFWAttachmentsValue, EFWAttachmentsOnChange } from '../EFWAttachments/EFWAttachments.types';
|
|
3
|
+
|
|
4
|
+
export type EFWAttachmentsFieldValue = EFWAttachmentsValue;
|
|
5
|
+
export type EFWAttachmentsFieldOnChange = EFWAttachmentsOnChange;
|
|
6
|
+
export interface EFWAttachmentsFieldProps extends Omit<EFWFieldProps, 'children'>, EFWAttachmentsProps {
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { EFWDatePickerProps } from './EFWDatePicker.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Componente funcional de React que renderiza un selector de fechas (DatePicker) con soporte para entrada de texto,
|
|
5
|
+
* formato personalizado, y sincronización con valores externos. Permite seleccionar una fecha y manejar su estado interno
|
|
6
|
+
* y externo a través de callbacks.
|
|
7
|
+
*
|
|
8
|
+
* @param {EFWDatePickerProps} props - Propiedades del componente.
|
|
9
|
+
* @param {boolean} [props.editable=true] - Indica si el DatePicker es editable.
|
|
10
|
+
* @param {boolean} [props.disabled=false] - Indica si el DatePicker está deshabilitado.
|
|
11
|
+
* @param {string} [props.placeholder='DD/MM/YYYY'] - Texto placeholder para el campo de entrada.
|
|
12
|
+
* @param {any[]} [props.selectedDates=[]] - Valores iniciales para el estado del componente.
|
|
13
|
+
* @param {boolean} [props.allowTextInput=true] - Permite la entrada de texto para introducir fechas manualmente.
|
|
14
|
+
* @param {object} [props.localizedStrings=esLocalizedStrings] - Objeto con cadenas localizadas para el componente.
|
|
15
|
+
* @param {Date} [props.minDate] - Fecha mínima seleccionable.
|
|
16
|
+
* @param {Date} [props.maxDate] - Fecha máxima seleccionable.
|
|
17
|
+
* @param {boolean} [props.showGoToToday=true] - Muestra el botón "Ir a hoy" en el calendario.
|
|
18
|
+
* @param {boolean} [props.showCloseButton=true] - Muestra el botón de cerrar en el calendario.
|
|
19
|
+
* @param {Date[]} [props.restrictedDates=[]] - Lista de fechas no seleccionables.
|
|
20
|
+
* @param {boolean} [props.friendlyDateFormat=false] - Si es true, formatea la fecha en un formato amigable (ej. "Enero 1, 2025").
|
|
21
|
+
* @param {function} [props.onSelectDate] - Callback ejecutado al seleccionar una fecha.
|
|
22
|
+
* @param {function} [props.onChange] - Callback ejecutado al cambiar los valores del estado.
|
|
23
|
+
* @param {string} [props.validationState='none'] - Estado de validación externo ('none' o 'error').
|
|
24
|
+
* @param {function} [props.setParentComponentState] - Callback para actualizar el estado del componente padre.
|
|
25
|
+
* @returns {JSX.Element} Elemento JSX que renderiza el DatePicker o un texto si no es editable.
|
|
26
|
+
* @example
|
|
27
|
+
* <EFWDatePicker
|
|
28
|
+
* editable={true}
|
|
29
|
+
* placeholder="DD/MM/YYYY"
|
|
30
|
+
* onSelectDate={(date) => console.log(date)}
|
|
31
|
+
* friendlyDateFormat={true}
|
|
32
|
+
* />
|
|
33
|
+
*/
|
|
34
|
+
export declare const EFWDatePicker: (props: EFWDatePickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import { jsx as D, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles as j, tokens as u, mergeClasses as q, Text as G } from "@fluentui/react-components";
|
|
3
|
+
import { useId as U, useState as H, useRef as b, useEffect as J, useCallback as h } from "react";
|
|
4
|
+
import { DatePicker as K } from "@fluentui/react-datepicker-compat";
|
|
5
|
+
import { arraysAreEqual as O, esLocalizedStrings as F } from "./EFWDatePicker.utils.js";
|
|
6
|
+
const Q = j({
|
|
7
|
+
efwDatePickerControl: {
|
|
8
|
+
"& [disabled]": {
|
|
9
|
+
backgroundColor: u.colorNeutralBackground3,
|
|
10
|
+
color: u.colorNeutralForeground2,
|
|
11
|
+
"&::placeholder": {
|
|
12
|
+
color: "transparent"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
// Afectar el span que contiene el input disabled
|
|
16
|
+
"&:has([disabled])": {
|
|
17
|
+
backgroundColor: u.colorNeutralBackground3
|
|
18
|
+
}
|
|
19
|
+
},
|
|
20
|
+
efwDatePickerControlError: {
|
|
21
|
+
backgroundColor: u.colorPaletteRedBackground1,
|
|
22
|
+
"::after": {
|
|
23
|
+
borderBottomColor: u.colorPaletteRedBorder2,
|
|
24
|
+
borderBottomStyle: "solid",
|
|
25
|
+
borderBottomWidth: "2px"
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
});
|
|
29
|
+
function P(i) {
|
|
30
|
+
return i.map((a) => {
|
|
31
|
+
if (a instanceof Date)
|
|
32
|
+
return p(a) ? a : null;
|
|
33
|
+
if (typeof a == "string") {
|
|
34
|
+
const l = new Date(a);
|
|
35
|
+
return p(l) ? l : null;
|
|
36
|
+
}
|
|
37
|
+
if (typeof a == "number") {
|
|
38
|
+
const l = new Date(a);
|
|
39
|
+
return p(l) ? l : null;
|
|
40
|
+
}
|
|
41
|
+
return null;
|
|
42
|
+
}).filter((a) => a !== null);
|
|
43
|
+
}
|
|
44
|
+
function p(i) {
|
|
45
|
+
return i instanceof Date && !isNaN(i.getTime());
|
|
46
|
+
}
|
|
47
|
+
const ot = (i) => {
|
|
48
|
+
const {
|
|
49
|
+
editable: a = !0,
|
|
50
|
+
disabled: l = !1,
|
|
51
|
+
placeholder: M = "DD/MM/YYYY",
|
|
52
|
+
className: x = "",
|
|
53
|
+
selectedDates: r = [],
|
|
54
|
+
allowTextInput: w = !0,
|
|
55
|
+
localizedStrings: B = F,
|
|
56
|
+
minDate: N,
|
|
57
|
+
maxDate: T,
|
|
58
|
+
showGoToToday: V = !0,
|
|
59
|
+
showCloseButton: Y = !0,
|
|
60
|
+
restrictedDates: $ = [],
|
|
61
|
+
friendlyDateFormat: C = !1,
|
|
62
|
+
onSelectDate: d,
|
|
63
|
+
onChange: g,
|
|
64
|
+
validationState: R = "none",
|
|
65
|
+
setParentComponentState: m
|
|
66
|
+
} = i, k = U(), y = Q(), [t, S] = H(P(r)), v = b(null), E = b(null);
|
|
67
|
+
J(() => {
|
|
68
|
+
const o = r.length === 0 && t.length > 0, n = t.length === 0 && r.length > 0, e = r.length > 0 && !O(r, t);
|
|
69
|
+
console.log("useeffect initialValues", r);
|
|
70
|
+
let s = P(r);
|
|
71
|
+
(o || n || e) && (console.log("Actualizando valores:", {
|
|
72
|
+
isReset: o,
|
|
73
|
+
isFirstMount: n,
|
|
74
|
+
isExternalUpdate: e,
|
|
75
|
+
newValues: s
|
|
76
|
+
}), S(s));
|
|
77
|
+
}, [r]);
|
|
78
|
+
const I = h((o) => {
|
|
79
|
+
if (!o) return "";
|
|
80
|
+
const n = o.getDate(), e = o.getMonth(), s = o.getFullYear();
|
|
81
|
+
if (C)
|
|
82
|
+
return `${F.months[e]} ${n}, ${s}`;
|
|
83
|
+
{
|
|
84
|
+
const f = n < 10 ? `0${n}` : n, c = e + 1 < 10 ? `0${e + 1}` : e + 1;
|
|
85
|
+
return `${f}/${c}/${s}`;
|
|
86
|
+
}
|
|
87
|
+
}, [C]), z = h((o) => {
|
|
88
|
+
const n = t.length && t[0] instanceof Date ? t[0] : /* @__PURE__ */ new Date(), e = (o || "").trim().split("/"), s = e.length > 0 ? Math.max(1, Math.min(31, parseInt(e[0], 10))) : n.getDate(), f = e.length > 1 ? Math.max(1, Math.min(12, parseInt(e[1], 10))) - 1 : n.getMonth();
|
|
89
|
+
let c = e.length > 2 ? parseInt(e[2], 10) : n.getFullYear();
|
|
90
|
+
return c < 100 && (c += n.getFullYear() - n.getFullYear() % 100), new Date(c, f, s);
|
|
91
|
+
}, [t]), A = h((o) => {
|
|
92
|
+
if ((t.length === 0 || (o instanceof Date && t[0] instanceof Date ? o.getTime() !== t[0].getTime() : o !== t[0])) && o instanceof Date) {
|
|
93
|
+
const e = [o];
|
|
94
|
+
S(e), d?.(o), g?.(e), m?.("none", "");
|
|
95
|
+
} else
|
|
96
|
+
d?.(null), g?.([]), m?.("none", "");
|
|
97
|
+
}, [t, d, g, m]), L = q(
|
|
98
|
+
x,
|
|
99
|
+
y.efwDatePickerControl,
|
|
100
|
+
R === "error" && y.efwDatePickerControlError
|
|
101
|
+
);
|
|
102
|
+
return /* @__PURE__ */ D(W, { children: a ? /* @__PURE__ */ D(
|
|
103
|
+
K,
|
|
104
|
+
{
|
|
105
|
+
calendar: {
|
|
106
|
+
componentRef: E,
|
|
107
|
+
restrictedDates: $
|
|
108
|
+
},
|
|
109
|
+
strings: B,
|
|
110
|
+
className: L,
|
|
111
|
+
ref: v,
|
|
112
|
+
id: k,
|
|
113
|
+
name: k,
|
|
114
|
+
autoComplete: "off",
|
|
115
|
+
autoCorrect: "off",
|
|
116
|
+
autoCapitalize: "off",
|
|
117
|
+
spellCheck: "false",
|
|
118
|
+
allowTextInput: w,
|
|
119
|
+
disableAutoFocus: !0,
|
|
120
|
+
value: t.length > 0 ? t[0] : null,
|
|
121
|
+
minDate: N,
|
|
122
|
+
maxDate: T,
|
|
123
|
+
disabled: l,
|
|
124
|
+
onSelectDate: A,
|
|
125
|
+
formatDate: I,
|
|
126
|
+
parseDateFromString: z,
|
|
127
|
+
placeholder: M,
|
|
128
|
+
showGoToToday: V,
|
|
129
|
+
showCloseButton: Y
|
|
130
|
+
}
|
|
131
|
+
) : /* @__PURE__ */ D(G, { style: t.length ? void 0 : { opacity: 0.7 }, children: t.length > 0 && t[0] instanceof Date ? t[0].toLocaleDateString() : "Sin datos disponibles" }) });
|
|
132
|
+
};
|
|
133
|
+
export {
|
|
134
|
+
ot as EFWDatePicker
|
|
135
|
+
};
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import { EFWFieldChildrenProps } from '../EFWField/EFWField.types';
|
|
2
|
+
import { DatePickerProps, CalendarStrings } from '@fluentui/react-datepicker-compat';
|
|
3
|
+
|
|
4
|
+
export type EFWDatePickerValue = (Date | string);
|
|
5
|
+
export type EFWDatePickerOnChange = (value: EFWDatePickerValue[]) => void;
|
|
6
|
+
/**
|
|
7
|
+
* Propiedades del componente EFWDatePicker que extiende las funcionalidades del DatePicker de Fluent UI
|
|
8
|
+
* con características adicionales para formularios y validación.
|
|
9
|
+
*/
|
|
10
|
+
export interface EFWDatePickerProps extends Omit<Partial<DatePickerProps>, 'onChange' | 'id' | 'value'>, EFWFieldChildrenProps {
|
|
11
|
+
/**
|
|
12
|
+
* Array de fechas seleccionadas iniciales. Puede contener objetos Date o strings que representen fechas.
|
|
13
|
+
* @default []
|
|
14
|
+
*/
|
|
15
|
+
selectedDates?: EFWDatePickerValue[];
|
|
16
|
+
/**
|
|
17
|
+
* Permite la entrada de texto manual para introducir fechas directamente en el campo de entrada.
|
|
18
|
+
* @default true
|
|
19
|
+
*/
|
|
20
|
+
allowTextInput?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* Texto de marcador de posición que se muestra cuando el campo está vacío.
|
|
23
|
+
* @default 'DD/MM/YYYY'
|
|
24
|
+
*/
|
|
25
|
+
placeholder?: string;
|
|
26
|
+
/**
|
|
27
|
+
* Determina si el DatePicker es editable o de solo lectura.
|
|
28
|
+
* @default true
|
|
29
|
+
*/
|
|
30
|
+
editable?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Clases CSS adicionales para personalizar el estilo del componente.
|
|
33
|
+
* @default ""
|
|
34
|
+
*/
|
|
35
|
+
className?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Número de días que se pueden seleccionar en la vista de día (para selección múltiple).
|
|
38
|
+
*/
|
|
39
|
+
daysToSelectInDayView?: number;
|
|
40
|
+
/**
|
|
41
|
+
* Función de callback ejecutada cuando se selecciona una fecha en el calendario.
|
|
42
|
+
*/
|
|
43
|
+
onSelectDate?: ((date: Date | null | undefined) => void);
|
|
44
|
+
/**
|
|
45
|
+
* Objeto con cadenas localizadas para personalizar el idioma del calendario.
|
|
46
|
+
* @default esLocalizedStrings
|
|
47
|
+
*/
|
|
48
|
+
localizedStrings?: CalendarStrings;
|
|
49
|
+
/**
|
|
50
|
+
* Fecha mínima seleccionable en el calendario.
|
|
51
|
+
*/
|
|
52
|
+
minDate?: Date;
|
|
53
|
+
/**
|
|
54
|
+
* Fecha máxima seleccionable en el calendario.
|
|
55
|
+
*/
|
|
56
|
+
maxDate?: Date;
|
|
57
|
+
/**
|
|
58
|
+
* Permite la selección de un rango de fechas en lugar de una sola fecha.
|
|
59
|
+
*/
|
|
60
|
+
allowRangeSelection?: boolean;
|
|
61
|
+
/**
|
|
62
|
+
* Array de fechas que están restringidas y no pueden ser seleccionadas.
|
|
63
|
+
* @default []
|
|
64
|
+
*/
|
|
65
|
+
restrictedDates?: Date[];
|
|
66
|
+
/**
|
|
67
|
+
* Si es true, formatea las fechas en un formato amigable (ej. "Enero 1, 2025").
|
|
68
|
+
* Si es false, usa formato numérico (ej. "01/01/2025").
|
|
69
|
+
* @default false
|
|
70
|
+
*/
|
|
71
|
+
friendlyDateFormat?: boolean;
|
|
72
|
+
/**
|
|
73
|
+
* Función personalizada para formatear las fechas mostradas en el campo de entrada.
|
|
74
|
+
*/
|
|
75
|
+
onFormatDate?: (date?: Date) => string;
|
|
76
|
+
/**
|
|
77
|
+
* Función de callback ejecutada cuando cambia el valor del componente.
|
|
78
|
+
* Recibe un array con los nuevos valores seleccionados.
|
|
79
|
+
*/
|
|
80
|
+
onChange?: EFWDatePickerOnChange;
|
|
81
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { CalendarStrings } from '@fluentui/react-datepicker-compat';
|
|
2
|
+
|
|
3
|
+
declare const esLocalizedStrings: CalendarStrings;
|
|
4
|
+
/**
|
|
5
|
+
* Formatea una fecha en el formato "[mes en español] [día], [año]"
|
|
6
|
+
* Por ejemplo: "mayo 2, 2025"
|
|
7
|
+
*
|
|
8
|
+
* @param {Date} [date] - Objeto Date opcional a formatear
|
|
9
|
+
* @returns {string} Fecha formateada en español o cadena vacía si no se proporciona fecha
|
|
10
|
+
*
|
|
11
|
+
* @example
|
|
12
|
+
* // Retorna "mayo 2, 2025" (asumiendo que esLocalizedStrings.months[4] es "mayo")
|
|
13
|
+
* esOnFormatDate(new Date(2025, 4, 2));
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* // Retorna cadena vacía
|
|
17
|
+
* esOnFormatDate();
|
|
18
|
+
*/
|
|
19
|
+
declare const esOnFormatDate: (date?: Date, friendlyFormat?: boolean) => string;
|
|
20
|
+
declare const normalizeToDate: (value: Date | string | null | undefined) => Date | null;
|
|
21
|
+
declare const arraysAreEqual: (arr1: (Date | string)[], arr2: (Date | string)[]) => boolean;
|
|
22
|
+
export { esLocalizedStrings, esOnFormatDate, normalizeToDate, arraysAreEqual };
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import { defaultDatePickerStrings as l } from "@fluentui/react-datepicker-compat";
|
|
2
|
+
const u = {
|
|
3
|
+
...l,
|
|
4
|
+
days: [
|
|
5
|
+
"Domingo",
|
|
6
|
+
"Lunes",
|
|
7
|
+
"Martes",
|
|
8
|
+
"Miercoles",
|
|
9
|
+
"Jueves",
|
|
10
|
+
"Viernes",
|
|
11
|
+
"Sabado"
|
|
12
|
+
],
|
|
13
|
+
shortDays: ["D", "L", "M", "M", "J", "V", "S"],
|
|
14
|
+
months: [
|
|
15
|
+
"Enero",
|
|
16
|
+
"Febrero",
|
|
17
|
+
"Marzo",
|
|
18
|
+
"Abril",
|
|
19
|
+
"Mayo",
|
|
20
|
+
"Junio",
|
|
21
|
+
"Julio",
|
|
22
|
+
"Agosto",
|
|
23
|
+
"Septiembre",
|
|
24
|
+
"Octubre",
|
|
25
|
+
"Noviembre",
|
|
26
|
+
"Diciembre"
|
|
27
|
+
],
|
|
28
|
+
shortMonths: [
|
|
29
|
+
"Ene",
|
|
30
|
+
"Feb",
|
|
31
|
+
"Mar",
|
|
32
|
+
"Abr",
|
|
33
|
+
"May",
|
|
34
|
+
"Jun",
|
|
35
|
+
"Jul",
|
|
36
|
+
"Ago",
|
|
37
|
+
"Sep",
|
|
38
|
+
"Oct",
|
|
39
|
+
"Nov",
|
|
40
|
+
"Dic"
|
|
41
|
+
],
|
|
42
|
+
goToToday: "Ir a hoy"
|
|
43
|
+
}, f = (t, o = !1) => {
|
|
44
|
+
if (!t) return "";
|
|
45
|
+
const e = t.getDate(), n = t.getMonth(), r = t.getFullYear();
|
|
46
|
+
if (o)
|
|
47
|
+
return `${u.months[n]} ${e}, ${r}`;
|
|
48
|
+
{
|
|
49
|
+
const s = e < 10 ? `0${e}` : e, a = n + 1 < 10 ? `0${n + 1}` : n + 1;
|
|
50
|
+
return `${s}/${a}/${r}`;
|
|
51
|
+
}
|
|
52
|
+
}, i = (t) => {
|
|
53
|
+
if (t instanceof Date) return t;
|
|
54
|
+
if (typeof t == "string")
|
|
55
|
+
try {
|
|
56
|
+
const o = new Date(t);
|
|
57
|
+
return isNaN(o.getTime()) ? null : o;
|
|
58
|
+
} catch {
|
|
59
|
+
return null;
|
|
60
|
+
}
|
|
61
|
+
return null;
|
|
62
|
+
}, g = (t, o) => {
|
|
63
|
+
if (t.length !== o.length) return !1;
|
|
64
|
+
for (let e = 0; e < t.length; e++) {
|
|
65
|
+
const n = i(t[e]), r = i(o[e]);
|
|
66
|
+
if (!(n === null && r === null) && (n === null || r === null || n.getTime() !== r.getTime()))
|
|
67
|
+
return !1;
|
|
68
|
+
}
|
|
69
|
+
return !0;
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
g as arraysAreEqual,
|
|
73
|
+
u as esLocalizedStrings,
|
|
74
|
+
f as esOnFormatDate,
|
|
75
|
+
i as normalizeToDate
|
|
76
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { EFWField as C } from "../EFWField/EFWField.js";
|
|
3
|
+
import { EFWDatePicker as E } from "../EFWDatePicker/EFWDatePicker.js";
|
|
4
|
+
const k = (a) => {
|
|
5
|
+
const {
|
|
6
|
+
title: l,
|
|
7
|
+
infoLabel: o,
|
|
8
|
+
hint: i,
|
|
9
|
+
style: r = {},
|
|
10
|
+
required: n = !1,
|
|
11
|
+
validationState: s,
|
|
12
|
+
validationMessage: d,
|
|
13
|
+
disabled: c = !1,
|
|
14
|
+
editable: e = !0,
|
|
15
|
+
hidden: h = !1,
|
|
16
|
+
onChange: m,
|
|
17
|
+
placeholder: f = "DD/MM/YYYY",
|
|
18
|
+
selectedDates: D = [],
|
|
19
|
+
allowRangeSelection: u = !1,
|
|
20
|
+
restrictedDates: g = [],
|
|
21
|
+
allowTextInput: p = !0,
|
|
22
|
+
minDate: b,
|
|
23
|
+
maxDate: w,
|
|
24
|
+
showGoToToday: F,
|
|
25
|
+
showCloseButton: x,
|
|
26
|
+
onValidationChange: Y
|
|
27
|
+
} = a;
|
|
28
|
+
return /* @__PURE__ */ t(
|
|
29
|
+
C,
|
|
30
|
+
{
|
|
31
|
+
style: r,
|
|
32
|
+
title: l,
|
|
33
|
+
infoLabel: o,
|
|
34
|
+
weightLabel: e ? "regular" : "semibold",
|
|
35
|
+
hint: i,
|
|
36
|
+
hidden: h,
|
|
37
|
+
required: n,
|
|
38
|
+
validationState: s,
|
|
39
|
+
validationMessage: d,
|
|
40
|
+
onValidationChange: Y,
|
|
41
|
+
children: /* @__PURE__ */ t(
|
|
42
|
+
E,
|
|
43
|
+
{
|
|
44
|
+
editable: e,
|
|
45
|
+
selectedDates: D,
|
|
46
|
+
minDate: b,
|
|
47
|
+
maxDate: w,
|
|
48
|
+
onChange: m,
|
|
49
|
+
allowTextInput: p,
|
|
50
|
+
disabled: c,
|
|
51
|
+
placeholder: f,
|
|
52
|
+
restrictedDates: g,
|
|
53
|
+
allowRangeSelection: u,
|
|
54
|
+
showGoToToday: F,
|
|
55
|
+
showCloseButton: x
|
|
56
|
+
}
|
|
57
|
+
)
|
|
58
|
+
}
|
|
59
|
+
);
|
|
60
|
+
};
|
|
61
|
+
export {
|
|
62
|
+
k as EFWDatePickerField
|
|
63
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { EFWFieldProps } from '../EFWField/EFWField.types';
|
|
2
|
+
import { EFWDatePickerProps, EFWDatePickerValue, EFWDatePickerOnChange } from '../EFWDatePicker/EFWDatePicker.types';
|
|
3
|
+
|
|
4
|
+
export type EFWDatePickerFieldValue = EFWDatePickerValue;
|
|
5
|
+
export type EFWDatePickerFieldOnChange = EFWDatePickerOnChange;
|
|
6
|
+
export interface EFWDatePickerFieldProps extends Omit<EFWFieldProps, 'children'>, EFWDatePickerProps {
|
|
7
|
+
}
|