@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
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EFWTagPickerProps } from './EFWTagPicker.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* @description Componente de campo selector de etiquetas que permite seleccionar múltiples opciones de una lista.
|
|
5
|
+
* @param {EFWTagPickerProps} props - Propiedades del componente EFWTagPickerProps
|
|
6
|
+
* @returns {JSX.Element | null} - Retorna el componente de campo selector o null si está oculto
|
|
7
|
+
*/
|
|
8
|
+
export declare const EFWTagPicker: (props: EFWTagPickerProps) => import("react/jsx-runtime").JSX.Element | null;
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
import { jsx as t, Fragment as ae, jsxs as j } from "react/jsx-runtime";
|
|
2
|
+
import { useRef as y, useState as p, useCallback as u, useEffect as N } from "react";
|
|
3
|
+
import { makeStyles as se, tokens as s, useTagPickerFilter as ie, TagPickerOption as R, Avatar as le, Spinner as ce, mergeClasses as de, TagPicker as pe, TagPickerControl as ue, TagPickerGroup as ge, Tag as fe, TagPickerInput as me, Button as he, TagPickerList as be, Text as Ce } from "@fluentui/react-components";
|
|
4
|
+
import { CollectionsEmpty20Regular as ke, Eraser20Regular as Oe } from "@fluentui/react-icons";
|
|
5
|
+
const ye = se({
|
|
6
|
+
efwTagPickerControl: {
|
|
7
|
+
"& [disabled]": {
|
|
8
|
+
backgroundColor: s.colorNeutralBackground3,
|
|
9
|
+
color: s.colorNeutralForeground2,
|
|
10
|
+
"&::placeholder": {
|
|
11
|
+
color: "transparent"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
// Afectar el span que contiene el input disabled
|
|
15
|
+
"&:has([disabled])": {
|
|
16
|
+
backgroundColor: s.colorNeutralBackground3,
|
|
17
|
+
"& button": {
|
|
18
|
+
borderBottomColor: s.colorNeutralStrokeDisabled,
|
|
19
|
+
borderTopColor: s.colorNeutralStrokeDisabled,
|
|
20
|
+
borderLeftColor: s.colorNeutralStrokeDisabled,
|
|
21
|
+
borderRightColor: s.colorNeutralStrokeDisabled,
|
|
22
|
+
paddingRight: "5px",
|
|
23
|
+
"& .fui-Tag__dismissIcon": {
|
|
24
|
+
display: "none"
|
|
25
|
+
//visibility: 'hidden'
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
efwTagPickerControlError: {
|
|
31
|
+
backgroundColor: s.colorPaletteRedBackground1,
|
|
32
|
+
"::after": {
|
|
33
|
+
borderBottomColor: s.colorPaletteRedBorder2,
|
|
34
|
+
borderBottomStyle: "solid",
|
|
35
|
+
borderBottomWidth: "2px"
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}), ve = (D) => {
|
|
39
|
+
const {
|
|
40
|
+
placeholder: F = "Selecciona una opción",
|
|
41
|
+
noMatchesMessage: I = "No se encontraron coincidencias",
|
|
42
|
+
loadingMessage: V = "Buscando información...",
|
|
43
|
+
className: _ = "",
|
|
44
|
+
minQueryLength: g = 0,
|
|
45
|
+
options: n = [],
|
|
46
|
+
hidden: q = !1,
|
|
47
|
+
disabled: w = !1,
|
|
48
|
+
editable: Q = !0,
|
|
49
|
+
selectedOptions: l = [],
|
|
50
|
+
//values: initialSelectedOptions = [],
|
|
51
|
+
noPopover: W = !1,
|
|
52
|
+
tagSize: G = "medium",
|
|
53
|
+
tagShape: J = "rounded",
|
|
54
|
+
tagAppearance: H = "brand",
|
|
55
|
+
onChange: k,
|
|
56
|
+
beforeRenderOptions: f,
|
|
57
|
+
multiple: E = !0,
|
|
58
|
+
validationState: L = "none",
|
|
59
|
+
validationMessage: U,
|
|
60
|
+
setParentComponentState: S
|
|
61
|
+
} = D, X = y(L), Y = y(U), [a, A] = p(""), [c, T] = p(l.map((e) => e.key)), [m, x] = p(l), [i, h] = p([]), [Z, P] = p(!1), [b, O] = p(!1), d = y(), v = y(
|
|
62
|
+
Object.fromEntries(l.map((e) => [e.key, e]))
|
|
63
|
+
), M = ye(), $ = u((e) => (m.find((r) => r.key === e) || v.current[e])?.text || e, [m]);
|
|
64
|
+
N(() => {
|
|
65
|
+
T(l.map((e) => e.key)), x(l);
|
|
66
|
+
}, [l]), N(() => {
|
|
67
|
+
typeof n == "function" && a.length < g && b && O(!1);
|
|
68
|
+
}, [a, g, n, b]), N(() => b ? (d.current?.abort(), d.current = new AbortController(), (async () => {
|
|
69
|
+
if (typeof n != "function") {
|
|
70
|
+
const o = f ? f(n) : n;
|
|
71
|
+
h(o);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
S?.(X.current, Y.current);
|
|
75
|
+
try {
|
|
76
|
+
P(!0), h([]);
|
|
77
|
+
const o = await n(a, { signal: d.current.signal }), r = f ? f(o) : o;
|
|
78
|
+
h(r);
|
|
79
|
+
} catch (o) {
|
|
80
|
+
d.current?.signal.aborted || (console.error("Error loading options:", o), h([]), S?.("error", JSON.stringify(o)));
|
|
81
|
+
} finally {
|
|
82
|
+
d.current?.signal.aborted || P(!1);
|
|
83
|
+
}
|
|
84
|
+
})(), () => d.current?.abort()) : void 0, [b, n, a, f, S, g]);
|
|
85
|
+
const K = u(() => {
|
|
86
|
+
T([]), x([]), k?.([]);
|
|
87
|
+
}, [k]), ee = u((e, o) => {
|
|
88
|
+
if (o.open && typeof n == "function" && a.length < g) {
|
|
89
|
+
O(!1);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
o.open && typeof n == "function" && (P(!0), h([])), O(o.open);
|
|
93
|
+
}, [n, a, g]), oe = u((e, o) => {
|
|
94
|
+
if (o.value === "no-matches") return;
|
|
95
|
+
let r;
|
|
96
|
+
E ? r = o.selectedOptions : (r = o.selectedOptions.slice(-1), O(!1)), T(r), A("");
|
|
97
|
+
const z = r.map((C) => {
|
|
98
|
+
const B = i.find((ne) => ne.key === C) || v.current[C];
|
|
99
|
+
return B && (v.current[C] = B), B || { key: C, text: C };
|
|
100
|
+
});
|
|
101
|
+
x(z), k?.(z);
|
|
102
|
+
}, [i, k, E]), te = ie({
|
|
103
|
+
// La consulta actual ingresada por el usuario para filtrar opciones.
|
|
104
|
+
query: a,
|
|
105
|
+
// Lista de claves (como strings) de las opciones disponibles, obtenidas de 'availableOptions'.
|
|
106
|
+
options: i.map((e) => e.key.toString()),
|
|
107
|
+
// Elemento a mostrar cuando no hay opciones disponibles.
|
|
108
|
+
noOptionsElement: Z ? (
|
|
109
|
+
// Si está cargando ('isLoading' es true), muestra un spinner pequeño.
|
|
110
|
+
/* @__PURE__ */ t(
|
|
111
|
+
ce,
|
|
112
|
+
{
|
|
113
|
+
style: { height: "30px" },
|
|
114
|
+
size: "extra-tiny",
|
|
115
|
+
appearance: "primary",
|
|
116
|
+
label: {
|
|
117
|
+
size: "small",
|
|
118
|
+
children: V
|
|
119
|
+
// Mensaje como "Buscando información...".
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
) : (
|
|
124
|
+
// Si no está cargando y no hay opciones, muestra un mensaje de "sin coincidencias".
|
|
125
|
+
/* @__PURE__ */ t(
|
|
126
|
+
R,
|
|
127
|
+
{
|
|
128
|
+
value: "no-matches",
|
|
129
|
+
media: /* @__PURE__ */ t(ke, {}),
|
|
130
|
+
children: I
|
|
131
|
+
}
|
|
132
|
+
)
|
|
133
|
+
),
|
|
134
|
+
/**
|
|
135
|
+
* Función para renderizar una opción individual en la lista.
|
|
136
|
+
* @param {string} optionKey - Clave de la opción a renderizar.
|
|
137
|
+
* @returns {JSX.Element} - Elemento JSX que representa la opción.
|
|
138
|
+
*/
|
|
139
|
+
renderOption: u((e) => {
|
|
140
|
+
const o = i.find((r) => r.key === e);
|
|
141
|
+
return o ? /* @__PURE__ */ t(
|
|
142
|
+
R,
|
|
143
|
+
{
|
|
144
|
+
secondaryContent: o.secondaryContent || "",
|
|
145
|
+
media: /* @__PURE__ */ t(le, { shape: "square", "aria-hidden": !0, name: o.text, color: "colorful" }),
|
|
146
|
+
value: o.key,
|
|
147
|
+
children: o.text
|
|
148
|
+
},
|
|
149
|
+
o.key
|
|
150
|
+
) : (
|
|
151
|
+
// Si no se encuentra la opción, renderiza una versión básica con solo la clave.
|
|
152
|
+
/* @__PURE__ */ t(R, { value: e, children: e }, e)
|
|
153
|
+
);
|
|
154
|
+
}, [i]),
|
|
155
|
+
// Dependencia: se recrea si 'availableOptions' cambia.
|
|
156
|
+
/**
|
|
157
|
+
* Función de filtrado para determinar qué opciones mostrar.
|
|
158
|
+
* @param {string} optionKey - Clave de la opción a evaluar.
|
|
159
|
+
* @returns {boolean} - True si la opción debe mostrarse, false si no.
|
|
160
|
+
*/
|
|
161
|
+
filter: u((e) => {
|
|
162
|
+
const o = i.find((r) => r.key === e);
|
|
163
|
+
return o ? !c.includes(e) && o.text.toLowerCase().includes(a.toLowerCase()) : !1;
|
|
164
|
+
}, [i, c, a])
|
|
165
|
+
});
|
|
166
|
+
if (q) return null;
|
|
167
|
+
const re = de(
|
|
168
|
+
_,
|
|
169
|
+
M.efwTagPickerControl,
|
|
170
|
+
L === "error" && M.efwTagPickerControlError
|
|
171
|
+
);
|
|
172
|
+
return /* @__PURE__ */ t(ae, { children: Q ? /* @__PURE__ */ j(
|
|
173
|
+
pe,
|
|
174
|
+
{
|
|
175
|
+
open: b,
|
|
176
|
+
size: G,
|
|
177
|
+
disabled: w,
|
|
178
|
+
onOptionSelect: oe,
|
|
179
|
+
onOpenChange: ee,
|
|
180
|
+
selectedOptions: c,
|
|
181
|
+
noPopover: W,
|
|
182
|
+
children: [
|
|
183
|
+
/* @__PURE__ */ j(
|
|
184
|
+
ue,
|
|
185
|
+
{
|
|
186
|
+
className: re,
|
|
187
|
+
secondaryAction: !w && c.length ? /* @__PURE__ */ t(
|
|
188
|
+
he,
|
|
189
|
+
{
|
|
190
|
+
appearance: "transparent",
|
|
191
|
+
size: "small",
|
|
192
|
+
shape: "rounded",
|
|
193
|
+
onClick: K,
|
|
194
|
+
icon: /* @__PURE__ */ t(Oe, {}),
|
|
195
|
+
iconPosition: "before"
|
|
196
|
+
}
|
|
197
|
+
) : void 0,
|
|
198
|
+
children: [
|
|
199
|
+
/* @__PURE__ */ t(ge, { "aria-label": "Selected items", children: c.map((e) => /* @__PURE__ */ t(
|
|
200
|
+
fe,
|
|
201
|
+
{
|
|
202
|
+
style: { paddingTop: "0px", paddingBottom: "0px" },
|
|
203
|
+
shape: J,
|
|
204
|
+
appearance: H,
|
|
205
|
+
value: e,
|
|
206
|
+
children: $(e)
|
|
207
|
+
},
|
|
208
|
+
e
|
|
209
|
+
)) }),
|
|
210
|
+
/* @__PURE__ */ t(
|
|
211
|
+
me,
|
|
212
|
+
{
|
|
213
|
+
placeholder: c.length ? "" : F,
|
|
214
|
+
autoComplete: "off",
|
|
215
|
+
"aria-label": "Select items",
|
|
216
|
+
value: a,
|
|
217
|
+
onChange: (e) => A(e.target.value)
|
|
218
|
+
}
|
|
219
|
+
)
|
|
220
|
+
]
|
|
221
|
+
}
|
|
222
|
+
),
|
|
223
|
+
/* @__PURE__ */ t(be, { children: te })
|
|
224
|
+
]
|
|
225
|
+
}
|
|
226
|
+
) : /* @__PURE__ */ t(Ce, { style: m.length ? void 0 : { opacity: 0.7 }, children: m.length ? m.map((e) => e.text).join(", ") : "Sin datos disponibles" }) });
|
|
227
|
+
};
|
|
228
|
+
export {
|
|
229
|
+
ve as EFWTagPicker
|
|
230
|
+
};
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { EFWFieldChildrenProps } from '../EFWField/EFWField.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Representa un objeto de datos genérico que puede contener propiedades de tipo string,
|
|
5
|
+
* number o arrays de otros objetos IItem.
|
|
6
|
+
*
|
|
7
|
+
* @interface IItem
|
|
8
|
+
* @property {string | number | IItem[]} [key] - Propiedades dinámicas que pueden ser strings, números o arrays de objetos IItem
|
|
9
|
+
*/
|
|
10
|
+
type IItem = {
|
|
11
|
+
[key: string]: string | number | IItem[];
|
|
12
|
+
};
|
|
13
|
+
/**
|
|
14
|
+
* Función callback que se ejecuta cuando cambian las opciones seleccionadas en el TagPicker.
|
|
15
|
+
*
|
|
16
|
+
* @callback EFWTagPickerOnChange
|
|
17
|
+
* @param {EFWTagPickerOption[]} selectedOptions - Array de opciones actualmente seleccionadas
|
|
18
|
+
* @param {string} [displayValue] - Valor de visualización opcional
|
|
19
|
+
* @returns {void}
|
|
20
|
+
*/
|
|
21
|
+
export type EFWTagPickerOnChange = (selectedOptions: EFWTagPickerOption[], displayValue?: string) => void;
|
|
22
|
+
/**
|
|
23
|
+
* Define la estructura de cada opción en el TagPicker.
|
|
24
|
+
* Contiene la información necesaria para mostrar y gestionar una opción seleccionable.
|
|
25
|
+
*
|
|
26
|
+
* @interface EFWTagPickerOption
|
|
27
|
+
* @property {string} key - Identificador único de la opción
|
|
28
|
+
* @property {string} text - Texto principal que se muestra para la opción
|
|
29
|
+
* @property {string} [secondaryContent] - Texto secundario opcional para mostrar información adicional
|
|
30
|
+
* @property {IItem} [item] - Objeto de datos personalizado asociado con esta opción
|
|
31
|
+
*/
|
|
32
|
+
export interface EFWTagPickerOption {
|
|
33
|
+
key: string;
|
|
34
|
+
text: string;
|
|
35
|
+
secondaryContent?: string;
|
|
36
|
+
item?: IItem;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Alias para EFWTagPickerOption que representa el valor de una opción seleccionada.
|
|
40
|
+
* Se utiliza para mantener consistencia en la nomenclatura del componente.
|
|
41
|
+
*/
|
|
42
|
+
export type EFWTagPickerValue = EFWTagPickerOption;
|
|
43
|
+
/**
|
|
44
|
+
* Función para cargar opciones de manera asíncrona basada en una consulta de búsqueda.
|
|
45
|
+
* Permite implementar funcionalidad de búsqueda dinámica y carga bajo demanda.
|
|
46
|
+
*
|
|
47
|
+
* @callback AsyncOptionsLoader
|
|
48
|
+
* @param {string} query - Texto de búsqueda para filtrar opciones
|
|
49
|
+
* @param {Object} [options] - Opciones adicionales para la carga
|
|
50
|
+
* @param {AbortSignal} [options.signal] - Señal para cancelar la petición si es necesario
|
|
51
|
+
* @returns {Promise<EFWTagPickerOption[]>} Promesa que resuelve a un array de opciones que coinciden con la búsqueda
|
|
52
|
+
*/
|
|
53
|
+
export type AsyncOptionsLoader = (query: string, options?: {
|
|
54
|
+
signal: AbortSignal;
|
|
55
|
+
}) => Promise<EFWTagPickerOption[]>;
|
|
56
|
+
/**
|
|
57
|
+
* Propiedades del componente EFWTagPicker.
|
|
58
|
+
* Extiende EFWFieldChildrenProps para heredar propiedades comunes de campos de formulario.
|
|
59
|
+
*
|
|
60
|
+
* @interface EFWTagPickerProps
|
|
61
|
+
* @extends EFWFieldChildrenProps
|
|
62
|
+
*/
|
|
63
|
+
export interface EFWTagPickerProps extends EFWFieldChildrenProps {
|
|
64
|
+
/**
|
|
65
|
+
* Mensaje personalizado a mostrar cuando no hay resultados coincidentes con la búsqueda
|
|
66
|
+
* @default "No se encontraron coincidencias"
|
|
67
|
+
*/
|
|
68
|
+
noMatchesMessage?: string;
|
|
69
|
+
/**
|
|
70
|
+
* Mensaje personalizado a mostrar durante la carga asíncrona de opciones
|
|
71
|
+
* @default "Buscando información..."
|
|
72
|
+
*/
|
|
73
|
+
loadingMessage?: string;
|
|
74
|
+
/**
|
|
75
|
+
* Texto de marcador de posición que se muestra cuando el campo está vacío
|
|
76
|
+
* @default "Selecciona una opción"
|
|
77
|
+
*/
|
|
78
|
+
placeholder?: string;
|
|
79
|
+
/**
|
|
80
|
+
* Determina si el componente permite edición o solo muestra los valores seleccionados
|
|
81
|
+
* @default true
|
|
82
|
+
*/
|
|
83
|
+
editable?: boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Clases CSS adicionales para personalizar el estilo visual del componente
|
|
86
|
+
* @default ""
|
|
87
|
+
*/
|
|
88
|
+
className?: string;
|
|
89
|
+
/**
|
|
90
|
+
* Habilita la selección múltiple (true) o limita a selección única (false)
|
|
91
|
+
* @default true
|
|
92
|
+
*/
|
|
93
|
+
multiple?: boolean;
|
|
94
|
+
/**
|
|
95
|
+
* Deshabilita el uso del popover flotante para mostrar las opciones
|
|
96
|
+
* @default false
|
|
97
|
+
*/
|
|
98
|
+
noPopover?: boolean;
|
|
99
|
+
/**
|
|
100
|
+
* Define la forma visual de las etiquetas: redondeadas o circulares
|
|
101
|
+
* @default "rounded"
|
|
102
|
+
*/
|
|
103
|
+
tagShape?: "rounded" | "circular";
|
|
104
|
+
/**
|
|
105
|
+
* Define el estilo de apariencia de las etiquetas: relleno, contorno o marca
|
|
106
|
+
* @default "brand"
|
|
107
|
+
*/
|
|
108
|
+
tagAppearance?: "filled" | "outline" | "brand";
|
|
109
|
+
/**
|
|
110
|
+
* Define el tamaño visual de las etiquetas seleccionadas
|
|
111
|
+
* @default "medium"
|
|
112
|
+
*/
|
|
113
|
+
tagSize?: "medium" | "large" | 'extra-large';
|
|
114
|
+
/**
|
|
115
|
+
* Longitud mínima de caracteres requerida antes de ejecutar búsqueda asíncrona
|
|
116
|
+
* @default 0
|
|
117
|
+
*/
|
|
118
|
+
minQueryLength?: number;
|
|
119
|
+
/**
|
|
120
|
+
* Lista estática de opciones o función asíncrona para cargar opciones dinámicamente
|
|
121
|
+
* @default []
|
|
122
|
+
*/
|
|
123
|
+
options: EFWTagPickerOption[] | AsyncOptionsLoader;
|
|
124
|
+
/**
|
|
125
|
+
* Array de opciones actualmente seleccionadas en el componente
|
|
126
|
+
* @default []
|
|
127
|
+
*/
|
|
128
|
+
selectedOptions?: EFWTagPickerOption[];
|
|
129
|
+
/** Función callback ejecutada cuando cambian las opciones seleccionadas */
|
|
130
|
+
onChange?: EFWTagPickerOnChange;
|
|
131
|
+
/** Función para transformar o procesar las opciones antes de renderizarlas */
|
|
132
|
+
beforeRenderOptions?: (options: EFWTagPickerOption[]) => EFWTagPickerOption[];
|
|
133
|
+
/** Función para establecer el estado de error y mostrar mensajes de validación */
|
|
134
|
+
setError?: (hasError: boolean, message?: string) => void;
|
|
135
|
+
}
|
|
136
|
+
export {};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { EFWField as v } from "../EFWField/EFWField.js";
|
|
3
|
+
import { EFWTagPicker as L } from "../EFWTagPicker/EFWTagPicker.js";
|
|
4
|
+
const j = (n) => {
|
|
5
|
+
const {
|
|
6
|
+
title: i,
|
|
7
|
+
// description,
|
|
8
|
+
infoLabel: o,
|
|
9
|
+
hint: t,
|
|
10
|
+
style: l = {},
|
|
11
|
+
required: r = !1,
|
|
12
|
+
placeholder: d = "Selecciona una opción",
|
|
13
|
+
noMatchesMessage: s = "No se encontraron coincidencias",
|
|
14
|
+
loadingMessage: c = "Buscando información...",
|
|
15
|
+
validationState: g = "none",
|
|
16
|
+
validationMessage: h = "",
|
|
17
|
+
minQueryLength: p = 0,
|
|
18
|
+
options: m = [],
|
|
19
|
+
selectedOptions: f = [],
|
|
20
|
+
editable: e = !0,
|
|
21
|
+
disabled: u = !1,
|
|
22
|
+
hidden: b = !1,
|
|
23
|
+
noPopover: F = !1,
|
|
24
|
+
multiple: C = !1,
|
|
25
|
+
tagSize: E = "medium",
|
|
26
|
+
tagShape: M = "rounded",
|
|
27
|
+
tagAppearance: P = "brand",
|
|
28
|
+
onChange: S,
|
|
29
|
+
beforeRenderOptions: W,
|
|
30
|
+
onValidationChange: _
|
|
31
|
+
} = n;
|
|
32
|
+
return /* @__PURE__ */ a(
|
|
33
|
+
v,
|
|
34
|
+
{
|
|
35
|
+
hint: t,
|
|
36
|
+
style: l,
|
|
37
|
+
title: i,
|
|
38
|
+
infoLabel: o,
|
|
39
|
+
weightLabel: e ? "regular" : "semibold",
|
|
40
|
+
required: r,
|
|
41
|
+
validationState: g,
|
|
42
|
+
validationMessage: h,
|
|
43
|
+
onValidationChange: _,
|
|
44
|
+
hidden: b,
|
|
45
|
+
children: /* @__PURE__ */ a(
|
|
46
|
+
L,
|
|
47
|
+
{
|
|
48
|
+
editable: e,
|
|
49
|
+
noMatchesMessage: s,
|
|
50
|
+
loadingMessage: c,
|
|
51
|
+
placeholder: d,
|
|
52
|
+
selectedOptions: f,
|
|
53
|
+
minQueryLength: p,
|
|
54
|
+
options: m,
|
|
55
|
+
onChange: (k = []) => {
|
|
56
|
+
S?.(k, "[EFWTagPickerField]: __handleChange__");
|
|
57
|
+
},
|
|
58
|
+
beforeRenderOptions: W,
|
|
59
|
+
disabled: u,
|
|
60
|
+
noPopover: F,
|
|
61
|
+
tagSize: E,
|
|
62
|
+
tagShape: M,
|
|
63
|
+
tagAppearance: P,
|
|
64
|
+
multiple: C
|
|
65
|
+
}
|
|
66
|
+
)
|
|
67
|
+
}
|
|
68
|
+
);
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
j as EFWTagPickerField
|
|
72
|
+
};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { EFWFieldProps } from '../EFWField/EFWField.types';
|
|
2
|
+
import { EFWTagPickerOption, EFWTagPickerProps, EFWTagPickerValue, EFWTagPickerOnChange } from '../EFWTagPicker';
|
|
3
|
+
|
|
4
|
+
export type EFWTagPickerFieldValue = EFWTagPickerValue;
|
|
5
|
+
export type EFWTagPickerFieldOnChange = EFWTagPickerOnChange;
|
|
6
|
+
export type EFWTagPickerFieldOption = EFWTagPickerOption;
|
|
7
|
+
export interface EFWTagPickerFieldProps extends Omit<EFWFieldProps, 'children'>, EFWTagPickerProps {
|
|
8
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { jsx as x, Fragment as H } from "react/jsx-runtime";
|
|
2
|
+
import { makeStyles as B, tokens as l, mergeClasses as D, Textarea as F, Text as I } from "@fluentui/react-components";
|
|
3
|
+
import { useId as K, useRef as v, useState as P, useCallback as s, useEffect as j, useLayoutEffect as L } from "react";
|
|
4
|
+
const $ = B({
|
|
5
|
+
efwTextArea: {
|
|
6
|
+
"& textarea": {
|
|
7
|
+
maxHeight: "none",
|
|
8
|
+
"&[disabled]": {
|
|
9
|
+
backgroundColor: l.colorNeutralBackground3,
|
|
10
|
+
color: l.colorNeutralForeground3
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
// Afectar el span que contiene el textarea disabled
|
|
14
|
+
"&:has([disabled])": {
|
|
15
|
+
backgroundColor: l.colorNeutralBackground3
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
efwTextAreaError: {
|
|
19
|
+
backgroundColor: l.colorPaletteRedBackground1
|
|
20
|
+
// '& textarea': {
|
|
21
|
+
// maxHeight: 'none',
|
|
22
|
+
// backgroundColor: "var(--colorPaletteRedBackground1)",
|
|
23
|
+
// },
|
|
24
|
+
// '.fui-Textarea': {
|
|
25
|
+
// backgroundColor: "var(--colorPaletteRedBackground1)",
|
|
26
|
+
// borderBottom: "2px solid var(--colorPaletteRedBorder2) !important"
|
|
27
|
+
// },
|
|
28
|
+
// '& textarea::after': {
|
|
29
|
+
// borderBottom: "2px solid var(--colorPaletteRedBorder2) !important"
|
|
30
|
+
// }
|
|
31
|
+
}
|
|
32
|
+
}), G = (k) => {
|
|
33
|
+
const {
|
|
34
|
+
value: o = "",
|
|
35
|
+
onKeyDown: g,
|
|
36
|
+
onChange: r,
|
|
37
|
+
editable: b = !0,
|
|
38
|
+
disabled: T = !1,
|
|
39
|
+
autoComplete: w = "off",
|
|
40
|
+
className: S = "",
|
|
41
|
+
placeholder: N,
|
|
42
|
+
maxLength: c = 250,
|
|
43
|
+
size: V,
|
|
44
|
+
validationState: z = "none",
|
|
45
|
+
setParentComponentState: i,
|
|
46
|
+
autoResize: u = !0
|
|
47
|
+
// Nuevo prop con valor por defecto true
|
|
48
|
+
} = k, h = $(), m = K(), d = v(o || ""), f = v(null), [t, p] = P(o || ""), C = s(() => {
|
|
49
|
+
if (!u || !f.current) return;
|
|
50
|
+
const e = f.current;
|
|
51
|
+
e.style.height = "auto", e.style.height = `${e.scrollHeight}px`;
|
|
52
|
+
}, [u]), n = s((e) => {
|
|
53
|
+
e.length > c ? i?.("error", `Por favor introduzca menos de ${c} caracteres.`) : i?.("none", "");
|
|
54
|
+
}, [c, i]);
|
|
55
|
+
j(() => {
|
|
56
|
+
if (o !== d.current) {
|
|
57
|
+
const e = o || "";
|
|
58
|
+
n(e), p(e), d.current = e, r?.(e, e);
|
|
59
|
+
}
|
|
60
|
+
}, [o, n, r]), L(() => {
|
|
61
|
+
C();
|
|
62
|
+
}, [t, C]);
|
|
63
|
+
const A = s((e, y) => {
|
|
64
|
+
if (typeof y.value == "string") {
|
|
65
|
+
const a = y.value || "";
|
|
66
|
+
n(a), p(a), d.current = a, r?.(a, a);
|
|
67
|
+
}
|
|
68
|
+
}, [n, r]), E = s((e) => {
|
|
69
|
+
g?.(e, t);
|
|
70
|
+
}, [g, t]), R = D(
|
|
71
|
+
S,
|
|
72
|
+
h.efwTextArea,
|
|
73
|
+
z === "error" && h.efwTextAreaError
|
|
74
|
+
);
|
|
75
|
+
return /* @__PURE__ */ x(H, { children: b ? /* @__PURE__ */ x(
|
|
76
|
+
F,
|
|
77
|
+
{
|
|
78
|
+
ref: f,
|
|
79
|
+
className: R,
|
|
80
|
+
id: m,
|
|
81
|
+
name: m,
|
|
82
|
+
placeholder: N,
|
|
83
|
+
disabled: T,
|
|
84
|
+
value: t,
|
|
85
|
+
autoComplete: w,
|
|
86
|
+
autoCorrect: "off",
|
|
87
|
+
autoCapitalize: "off",
|
|
88
|
+
spellCheck: "false",
|
|
89
|
+
onChange: A,
|
|
90
|
+
onKeyDown: E,
|
|
91
|
+
size: V,
|
|
92
|
+
style: {
|
|
93
|
+
resize: u ? "none" : "vertical",
|
|
94
|
+
overflow: "hidden",
|
|
95
|
+
minHeight: "40px"
|
|
96
|
+
// Altura mínima para mantener usabilidad
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
) : /* @__PURE__ */ x(I, { style: t ? void 0 : { opacity: 0.7 }, children: t || "Sin datos disponibles" }) });
|
|
100
|
+
};
|
|
101
|
+
export {
|
|
102
|
+
G as EFWTextArea
|
|
103
|
+
};
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { EFWFieldChildrenProps } from '../EFWField/EFWField.types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Representa el valor que puede contener un componente EFWTextArea
|
|
5
|
+
*/
|
|
6
|
+
export type EFWTextAreaValue = string | null;
|
|
7
|
+
/**
|
|
8
|
+
* Propiedades del componente EFWTextArea
|
|
9
|
+
*/
|
|
10
|
+
export interface EFWTextAreaProps extends Partial<EFWFieldChildrenProps> {
|
|
11
|
+
/**
|
|
12
|
+
* Contenido a mostrar antes del textarea
|
|
13
|
+
*/
|
|
14
|
+
contentBefore?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Contenido a mostrar después del textarea
|
|
17
|
+
*/
|
|
18
|
+
contentAfter?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Configuración de autocompletado del navegador
|
|
21
|
+
* @default "off"
|
|
22
|
+
*/
|
|
23
|
+
autoComplete?: 'on' | 'off';
|
|
24
|
+
/**
|
|
25
|
+
* Valor inicial o controlado del textarea
|
|
26
|
+
* @default ""
|
|
27
|
+
*/
|
|
28
|
+
value?: EFWTextAreaValue;
|
|
29
|
+
/**
|
|
30
|
+
* Tamaño visual del textarea
|
|
31
|
+
*/
|
|
32
|
+
size?: 'small' | 'medium' | 'large';
|
|
33
|
+
/**
|
|
34
|
+
* Clases CSS adicionales para personalizar el estilo
|
|
35
|
+
* @default ""
|
|
36
|
+
*/
|
|
37
|
+
className?: string;
|
|
38
|
+
/**
|
|
39
|
+
* Texto de marcador de posición que se muestra cuando el textarea está vacío
|
|
40
|
+
*/
|
|
41
|
+
placeholder?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Patrón de formato a aplicar al texto (actualmente no implementado)
|
|
44
|
+
*/
|
|
45
|
+
formatPattern?: string;
|
|
46
|
+
/**
|
|
47
|
+
* Determina si el textarea es editable o de solo lectura
|
|
48
|
+
* @default true
|
|
49
|
+
*/
|
|
50
|
+
editable?: boolean;
|
|
51
|
+
/**
|
|
52
|
+
* Longitud máxima de caracteres permitidos en el textarea
|
|
53
|
+
* @default 250
|
|
54
|
+
*/
|
|
55
|
+
maxLength?: number;
|
|
56
|
+
/**
|
|
57
|
+
* Habilita el redimensionamiento automático de altura basado en el contenido
|
|
58
|
+
* @default true
|
|
59
|
+
*/
|
|
60
|
+
autoResize?: true;
|
|
61
|
+
/**
|
|
62
|
+
* Función personalizada para formatear el valor del textarea
|
|
63
|
+
* @param value - El valor actual del textarea
|
|
64
|
+
* @returns El valor formateado
|
|
65
|
+
*/
|
|
66
|
+
formatFunction?: (value: EFWTextAreaValue) => EFWTextAreaValue;
|
|
67
|
+
/**
|
|
68
|
+
* Callback que se ejecuta cuando el valor del textarea cambia
|
|
69
|
+
* @param value - El nuevo valor del textarea
|
|
70
|
+
* @param displayValue - El valor formateado para mostrar (opcional)
|
|
71
|
+
*/
|
|
72
|
+
onChange?: (value: EFWTextAreaValue, displayValue?: string) => void;
|
|
73
|
+
/**
|
|
74
|
+
* Callback que se ejecuta cuando se presiona una tecla en el textarea
|
|
75
|
+
* @param event - El evento de teclado de React
|
|
76
|
+
* @param currentValue - El valor actual del textarea en el momento del evento
|
|
77
|
+
*/
|
|
78
|
+
onKeyDown?: (event: React.KeyboardEvent<HTMLTextAreaElement>, currentValue: string) => void;
|
|
79
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
File without changes
|