@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,19 @@
|
|
|
1
|
+
import { EFWFormFieldUpdate, EFWFormFieldProps, GetFieldValue, ExtractFieldNames, EFWFormValues, EFWUpdateFieldFunction, GridTemplateColumnsType } from './EFWForm.types';
|
|
2
|
+
import { ValidationMessage, ValidationState } from '../../fields/EFWField/EFWField.types';
|
|
3
|
+
|
|
4
|
+
export declare const generateGridTemplateColumns: (config: GridTemplateColumnsType) => string;
|
|
5
|
+
declare const EFWFormFieldWrapperInner: <T extends readonly EFWFormFieldProps[]>({ field, initialValue, onValueChange, registerUpdateProps, fieldLogic, getAllValues, updateFieldProps, onValidationChange, }: {
|
|
6
|
+
field: T[number];
|
|
7
|
+
initialValue: GetFieldValue<T, T[number]["internalName"]>;
|
|
8
|
+
onValueChange: (internalName: ExtractFieldNames<T>, value: GetFieldValue<T, T[number]["internalName"]>) => void;
|
|
9
|
+
registerUpdateProps: (internalName: ExtractFieldNames<T>, updateFn: (updates: EFWFormFieldUpdate<T>) => void) => void;
|
|
10
|
+
fieldLogic?: (value: GetFieldValue<T, T[number]["internalName"]>, allValues: EFWFormValues<T>, updateField: EFWUpdateFieldFunction<T>) => void;
|
|
11
|
+
getAllValues: () => EFWFormValues<T>;
|
|
12
|
+
updateFieldProps: EFWUpdateFieldFunction<T>;
|
|
13
|
+
onValidationChange?: (validation: {
|
|
14
|
+
currentValidationState: ValidationState;
|
|
15
|
+
currentValidationMessage: ValidationMessage;
|
|
16
|
+
}) => void;
|
|
17
|
+
}) => import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
export declare const EFWFormFieldWrapper: typeof EFWFormFieldWrapperInner;
|
|
19
|
+
export {};
|
|
@@ -0,0 +1,252 @@
|
|
|
1
|
+
import { jsx as m, jsxs as g } from "react/jsx-runtime";
|
|
2
|
+
import { memo as q, useState as S, useCallback as h, useMemo as L } from "react";
|
|
3
|
+
import { EFWInputField as M } from "../../fields/EFWInputField/EFWInputField.js";
|
|
4
|
+
import { EFWNumberInputField as A } from "../../fields/EFWNumberInputField/EFWNumberInputField.js";
|
|
5
|
+
import { EFWTextAreaField as y } from "../../fields/EFWTextAreaField/EFWTextAreaField.js";
|
|
6
|
+
import { EFWSwitchField as P } from "../../fields/EFWSwitchField/EFWSwitchField.js";
|
|
7
|
+
import { EFWTagPickerField as T } from "../../fields/EFWTagPickerField/EFWTagPickerField.js";
|
|
8
|
+
import { EFWDatePickerField as E } from "../../fields/EFWDatePickerField/EFWDatePickerField.js";
|
|
9
|
+
import { EFWAttachmentsField as W } from "../../fields/EFWAttachmentsField/EFWAttachmentsField.js";
|
|
10
|
+
const Y = (t) => {
|
|
11
|
+
if (typeof t == "number")
|
|
12
|
+
return t > 1 ? `repeat(${t}, 1fr)` : "1fr";
|
|
13
|
+
if (t?.autoFit) {
|
|
14
|
+
const { minColumnWidth: e, maxColumns: i } = t.autoFit;
|
|
15
|
+
return i ? `repeat(auto-fit, minmax(clamp(${e}, 100% / ${i + 1}, 100% / 1), 1fr))` : `repeat(auto-fit, minmax(${e}, 1fr))`;
|
|
16
|
+
}
|
|
17
|
+
return "1fr";
|
|
18
|
+
}, k = ({
|
|
19
|
+
field: t,
|
|
20
|
+
initialValue: e,
|
|
21
|
+
onValueChange: i,
|
|
22
|
+
registerUpdateProps: l,
|
|
23
|
+
fieldLogic: n,
|
|
24
|
+
getAllValues: f,
|
|
25
|
+
updateFieldProps: s,
|
|
26
|
+
onValidationChange: d
|
|
27
|
+
}) => {
|
|
28
|
+
const [r, u] = S(e), [v, x] = S({
|
|
29
|
+
title: t.title,
|
|
30
|
+
required: t.required,
|
|
31
|
+
editable: t.editable,
|
|
32
|
+
disabled: t.disabled,
|
|
33
|
+
validationState: t.validationState,
|
|
34
|
+
validationMessage: t.validationMessage
|
|
35
|
+
}), o = h(
|
|
36
|
+
(a, b) => {
|
|
37
|
+
console.log("handleChange:", a, b), u(a), n && n(a, f(), s), i(t.internalName, a);
|
|
38
|
+
},
|
|
39
|
+
[t.internalName, i, n, f, s]
|
|
40
|
+
), F = h((a) => {
|
|
41
|
+
x((b) => ({ ...b, ...a })), "value" in a && a.value !== void 0 ? u(a.value) : "selectedOptions" in a && a.selectedOptions !== void 0 ? u(a.selectedOptions) : "selectedDates" in a && a.selectedDates !== void 0 ? u(a.selectedDates) : "files" in a && a.files !== void 0 && u(a.files);
|
|
42
|
+
}, []);
|
|
43
|
+
h(() => l(t.internalName, F), [t.internalName, l, F])();
|
|
44
|
+
const c = L(
|
|
45
|
+
() => ({
|
|
46
|
+
...t,
|
|
47
|
+
...v
|
|
48
|
+
}),
|
|
49
|
+
[t, v]
|
|
50
|
+
);
|
|
51
|
+
return t.typeAsString === "Text" ? /* @__PURE__ */ m(
|
|
52
|
+
M,
|
|
53
|
+
{
|
|
54
|
+
...N(
|
|
55
|
+
t,
|
|
56
|
+
c,
|
|
57
|
+
r,
|
|
58
|
+
o,
|
|
59
|
+
d
|
|
60
|
+
)
|
|
61
|
+
}
|
|
62
|
+
) : t.typeAsString === "Number" ? /* @__PURE__ */ m(
|
|
63
|
+
A,
|
|
64
|
+
{
|
|
65
|
+
...D(
|
|
66
|
+
t,
|
|
67
|
+
c,
|
|
68
|
+
r,
|
|
69
|
+
o,
|
|
70
|
+
d
|
|
71
|
+
)
|
|
72
|
+
}
|
|
73
|
+
) : t.typeAsString === "Note" ? /* @__PURE__ */ m(
|
|
74
|
+
y,
|
|
75
|
+
{
|
|
76
|
+
...B(
|
|
77
|
+
t,
|
|
78
|
+
c,
|
|
79
|
+
r,
|
|
80
|
+
o,
|
|
81
|
+
d
|
|
82
|
+
)
|
|
83
|
+
}
|
|
84
|
+
) : t.typeAsString === "Boolean" ? /* @__PURE__ */ m(
|
|
85
|
+
P,
|
|
86
|
+
{
|
|
87
|
+
...I(
|
|
88
|
+
t,
|
|
89
|
+
c,
|
|
90
|
+
r,
|
|
91
|
+
o,
|
|
92
|
+
d
|
|
93
|
+
)
|
|
94
|
+
}
|
|
95
|
+
) : t.typeAsString === "Choice" || t.typeAsString === "MultiChoice" ? /* @__PURE__ */ m(
|
|
96
|
+
T,
|
|
97
|
+
{
|
|
98
|
+
...O(
|
|
99
|
+
t,
|
|
100
|
+
c,
|
|
101
|
+
r,
|
|
102
|
+
o,
|
|
103
|
+
d
|
|
104
|
+
)
|
|
105
|
+
}
|
|
106
|
+
) : t.typeAsString === "Date" ? /* @__PURE__ */ m(
|
|
107
|
+
E,
|
|
108
|
+
{
|
|
109
|
+
...$(
|
|
110
|
+
t,
|
|
111
|
+
c,
|
|
112
|
+
r,
|
|
113
|
+
o,
|
|
114
|
+
d
|
|
115
|
+
)
|
|
116
|
+
}
|
|
117
|
+
) : t.typeAsString === "Attachments" ? /* @__PURE__ */ m(
|
|
118
|
+
W,
|
|
119
|
+
{
|
|
120
|
+
...j(
|
|
121
|
+
t,
|
|
122
|
+
c,
|
|
123
|
+
r,
|
|
124
|
+
o,
|
|
125
|
+
d
|
|
126
|
+
)
|
|
127
|
+
}
|
|
128
|
+
) : /* @__PURE__ */ g("div", { children: [
|
|
129
|
+
"Tipo de campo no soportado: ",
|
|
130
|
+
t
|
|
131
|
+
] });
|
|
132
|
+
}, Z = q(k), N = (t, e, i, l, n) => ({
|
|
133
|
+
title: e.title || t.title,
|
|
134
|
+
type: "text",
|
|
135
|
+
formatType: e.formatType,
|
|
136
|
+
formatPattern: e.formatPattern,
|
|
137
|
+
value: i || "",
|
|
138
|
+
contentAfter: e.contentAfter,
|
|
139
|
+
contentBefore: e.contentBefore,
|
|
140
|
+
onChange: l,
|
|
141
|
+
onValidationChange: n,
|
|
142
|
+
infoLabel: e.infoLabel,
|
|
143
|
+
hint: e.hint,
|
|
144
|
+
hidden: e.hidden || !1,
|
|
145
|
+
minLength: e.minLength || 0,
|
|
146
|
+
maxLength: e.maxLength || 250,
|
|
147
|
+
placeholder: e.placeholder ? e.placeholder : e.formatType == "chileanRut" ? "Ej: 11.111.111-1" : "Escriba aquí el texto",
|
|
148
|
+
required: e.required || !1,
|
|
149
|
+
editable: e.editable !== void 0 ? e.editable : !0,
|
|
150
|
+
disabled: e.disabled || !1,
|
|
151
|
+
validationState: e.validationState || "none",
|
|
152
|
+
validationMessage: e.validationMessage || "",
|
|
153
|
+
formatFunction: e.formatFunction
|
|
154
|
+
}), D = (t, e, i, l, n) => ({
|
|
155
|
+
title: e.title || t.title,
|
|
156
|
+
contentAfter: e.contentAfter,
|
|
157
|
+
contentBefore: e.contentBefore,
|
|
158
|
+
minValue: e.minValue,
|
|
159
|
+
maxValue: e.maxValue,
|
|
160
|
+
thousandSeparator: e.thousandSeparator,
|
|
161
|
+
decimalSeparator: e.decimalSeparator,
|
|
162
|
+
value: i,
|
|
163
|
+
onChange: l,
|
|
164
|
+
onValidationChange: n,
|
|
165
|
+
infoLabel: e.infoLabel,
|
|
166
|
+
hint: e.hint,
|
|
167
|
+
placeholder: e.placeholder || "Escriba aquí el número",
|
|
168
|
+
hidden: e.hidden || !1,
|
|
169
|
+
required: e.required || !1,
|
|
170
|
+
editable: e.editable !== void 0 ? e.editable : !0,
|
|
171
|
+
disabled: e.disabled || !1,
|
|
172
|
+
validationState: e.validationState || "none",
|
|
173
|
+
validationMessage: e.validationMessage || ""
|
|
174
|
+
}), B = (t, e, i, l, n) => ({
|
|
175
|
+
title: e.title || t.title,
|
|
176
|
+
value: i || "",
|
|
177
|
+
onChange: l,
|
|
178
|
+
onValidationChange: n,
|
|
179
|
+
infoLabel: e.infoLabel,
|
|
180
|
+
hint: e.hint,
|
|
181
|
+
maxLength: e.maxLength || 3e3,
|
|
182
|
+
placeholder: e.placeholder ? e.placeholder : "Escriba aquí el texto",
|
|
183
|
+
hidden: e.hidden || !1,
|
|
184
|
+
required: e.required || !1,
|
|
185
|
+
editable: e.editable !== void 0 ? e.editable : !0,
|
|
186
|
+
disabled: e.disabled || !1,
|
|
187
|
+
validationState: e.validationState || "none",
|
|
188
|
+
validationMessage: e.validationMessage || "",
|
|
189
|
+
formatFunction: e.formatFunction
|
|
190
|
+
}), O = (t, e, i, l, n) => ({
|
|
191
|
+
title: e.title || t.title,
|
|
192
|
+
onChange: l,
|
|
193
|
+
onValidationChange: n,
|
|
194
|
+
infoLabel: e.infoLabel,
|
|
195
|
+
hint: e.hint,
|
|
196
|
+
placeholder: e.placeholder,
|
|
197
|
+
hidden: e.hidden || !1,
|
|
198
|
+
required: e.required || !1,
|
|
199
|
+
editable: e.editable !== void 0 ? e.editable : !0,
|
|
200
|
+
disabled: e.disabled || !1,
|
|
201
|
+
validationState: e.validationState || "none",
|
|
202
|
+
validationMessage: e.validationMessage || "",
|
|
203
|
+
multiple: e.multiple ?? t.multiple,
|
|
204
|
+
options: e.options || t.options || [],
|
|
205
|
+
selectedOptions: i || t.selectedOptions || []
|
|
206
|
+
}), $ = (t, e, i, l, n) => ({
|
|
207
|
+
title: e.title || t.title,
|
|
208
|
+
onChange: l,
|
|
209
|
+
onValidationChange: n,
|
|
210
|
+
infoLabel: e.infoLabel,
|
|
211
|
+
hint: e.hint,
|
|
212
|
+
placeholder: e.placeholder,
|
|
213
|
+
hidden: e.hidden || !1,
|
|
214
|
+
required: e.required || !1,
|
|
215
|
+
editable: e.editable !== void 0 ? e.editable : !0,
|
|
216
|
+
disabled: e.disabled || !1,
|
|
217
|
+
validationState: e.validationState || "none",
|
|
218
|
+
validationMessage: e.validationMessage || "",
|
|
219
|
+
selectedDates: i || []
|
|
220
|
+
}), j = (t, e, i, l, n) => ({
|
|
221
|
+
title: e.title || t.title,
|
|
222
|
+
onChange: l,
|
|
223
|
+
onValidationChange: n,
|
|
224
|
+
infoLabel: e.infoLabel,
|
|
225
|
+
hint: e.hint,
|
|
226
|
+
hidden: e.hidden || !1,
|
|
227
|
+
required: e.required || !1,
|
|
228
|
+
editable: e.editable !== void 0 ? e.editable : !0,
|
|
229
|
+
disabled: e.disabled || !1,
|
|
230
|
+
validationState: e.validationState || "none",
|
|
231
|
+
validationMessage: e.validationMessage || "",
|
|
232
|
+
files: i || []
|
|
233
|
+
}), I = (t, e, i, l, n) => ({
|
|
234
|
+
title: e.title || t.title,
|
|
235
|
+
value: i || !1,
|
|
236
|
+
onChange: l,
|
|
237
|
+
checkedText: e.checkedText || "Sí",
|
|
238
|
+
uncheckedText: e.uncheckedText || "No",
|
|
239
|
+
onValidationChange: n,
|
|
240
|
+
infoLabel: e.infoLabel,
|
|
241
|
+
hint: e.hint,
|
|
242
|
+
hidden: e.hidden || !1,
|
|
243
|
+
required: e.required || !1,
|
|
244
|
+
editable: e.editable !== void 0 ? e.editable : !0,
|
|
245
|
+
disabled: e.disabled || !1,
|
|
246
|
+
validationState: e.validationState || "none",
|
|
247
|
+
validationMessage: e.validationMessage || ""
|
|
248
|
+
});
|
|
249
|
+
export {
|
|
250
|
+
Z as EFWFormFieldWrapper,
|
|
251
|
+
Y as generateGridTemplateColumns
|
|
252
|
+
};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export type { EFWFieldLogic, EFWFormProps, EFWFormFieldValue, EFWFormFieldProps, EFWFormMethods, EFWFormRef, EFWFormFieldUpdate, EFWFormFieldType } from './EFWForm.types';
|
|
2
|
+
export { getEFWFormFieldDisplayText } from './EFWForm.converter';
|
|
3
|
+
export { useFormController } from './EFWForm.hooks';
|
|
4
|
+
export { EFWForm } from './EFWForm';
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { getEFWFormFieldDisplayText as e } from "./EFWForm.converter.js";
|
|
2
|
+
import { useFormController as t } from "./EFWForm.hooks.js";
|
|
3
|
+
import { EFWForm as l } from "./EFWForm.js";
|
|
4
|
+
export {
|
|
5
|
+
l as EFWForm,
|
|
6
|
+
e as getEFWFormFieldDisplayText,
|
|
7
|
+
t as useFormController
|
|
8
|
+
};
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { jsx as e, jsxs as p } from "react/jsx-runtime";
|
|
2
|
+
import { useState as b, useEffect as j } from "react";
|
|
3
|
+
import { DismissRegular as v } from "@fluentui/react-icons";
|
|
4
|
+
import { makeStyles as D, MessageBarGroup as F, mergeClasses as S, MessageBar as k, MessageBarBody as A, MessageBarTitle as E, MessageBarActions as T, Button as c } from "@fluentui/react-components";
|
|
5
|
+
const $ = D({
|
|
6
|
+
efwMessageBarGroup: {
|
|
7
|
+
width: "100%",
|
|
8
|
+
display: "flex",
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
marginTop: "0px",
|
|
11
|
+
gap: "10px",
|
|
12
|
+
padding: "0px",
|
|
13
|
+
overflow: "auto",
|
|
14
|
+
"&:empty": {
|
|
15
|
+
display: "none !important"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
buttonGroup: {
|
|
19
|
+
display: "flex",
|
|
20
|
+
justifyContent: "end",
|
|
21
|
+
gap: "5px"
|
|
22
|
+
}
|
|
23
|
+
}), q = (m) => {
|
|
24
|
+
const {
|
|
25
|
+
style: d = {},
|
|
26
|
+
animate: g = void 0,
|
|
27
|
+
messages: o = [],
|
|
28
|
+
onDismiss: n
|
|
29
|
+
} = m, u = $(), [i, l] = b(o);
|
|
30
|
+
j(() => {
|
|
31
|
+
l(o);
|
|
32
|
+
}, [o]);
|
|
33
|
+
const f = (s) => {
|
|
34
|
+
if (n)
|
|
35
|
+
n(s);
|
|
36
|
+
else {
|
|
37
|
+
const r = i.filter((t) => t.id !== s);
|
|
38
|
+
l(r), console.log({ messagesFiltered: r });
|
|
39
|
+
}
|
|
40
|
+
}, M = () => i.map(({
|
|
41
|
+
intent: s,
|
|
42
|
+
id: r,
|
|
43
|
+
title: t,
|
|
44
|
+
message: x = "",
|
|
45
|
+
layout: y = "multiline",
|
|
46
|
+
actions: B = [],
|
|
47
|
+
dismissable: h = !0
|
|
48
|
+
}) => /* @__PURE__ */ p(k, { layout: y, intent: s, children: [
|
|
49
|
+
/* @__PURE__ */ p(A, { children: [
|
|
50
|
+
t && /* @__PURE__ */ e(E, { children: t }),
|
|
51
|
+
x
|
|
52
|
+
] }),
|
|
53
|
+
/* @__PURE__ */ e(
|
|
54
|
+
T,
|
|
55
|
+
{
|
|
56
|
+
containerAction: h ? /* @__PURE__ */ e(
|
|
57
|
+
c,
|
|
58
|
+
{
|
|
59
|
+
onClick: () => f(r),
|
|
60
|
+
"aria-label": "dismiss",
|
|
61
|
+
appearance: "transparent",
|
|
62
|
+
icon: /* @__PURE__ */ e(v, {})
|
|
63
|
+
}
|
|
64
|
+
) : void 0,
|
|
65
|
+
children: B.filter((a) => a.content).map((a) => {
|
|
66
|
+
const { id: G, content: w, ...C } = a;
|
|
67
|
+
return /* @__PURE__ */ e(c, { ...C, children: w }, G);
|
|
68
|
+
})
|
|
69
|
+
}
|
|
70
|
+
)
|
|
71
|
+
] }, `${s}-${r}`));
|
|
72
|
+
return /* @__PURE__ */ e(
|
|
73
|
+
F,
|
|
74
|
+
{
|
|
75
|
+
className: S(
|
|
76
|
+
u.efwMessageBarGroup
|
|
77
|
+
),
|
|
78
|
+
style: d,
|
|
79
|
+
animate: g,
|
|
80
|
+
children: M()
|
|
81
|
+
}
|
|
82
|
+
);
|
|
83
|
+
};
|
|
84
|
+
export {
|
|
85
|
+
q as EFWFormMessageBarGroup
|
|
86
|
+
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { MessageBarProps, ButtonProps } from '@fluentui/react-components';
|
|
3
|
+
|
|
4
|
+
export interface EFWFormMessageBarAction {
|
|
5
|
+
id: string | number;
|
|
6
|
+
content: ReactNode;
|
|
7
|
+
appearance?: ButtonProps['appearance'];
|
|
8
|
+
icon?: ButtonProps['icon'];
|
|
9
|
+
iconPosition?: ButtonProps['iconPosition'];
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
size?: ButtonProps['size'];
|
|
12
|
+
shape?: ButtonProps['shape'];
|
|
13
|
+
as?: 'a' | 'button';
|
|
14
|
+
href?: string;
|
|
15
|
+
target?: string;
|
|
16
|
+
onClick?: () => void;
|
|
17
|
+
}
|
|
18
|
+
export interface EFWFormMessageBar {
|
|
19
|
+
id: number | string;
|
|
20
|
+
intent?: MessageBarProps['intent'];
|
|
21
|
+
title?: string;
|
|
22
|
+
message?: ReactNode;
|
|
23
|
+
layout?: MessageBarProps['layout'];
|
|
24
|
+
actions?: EFWFormMessageBarAction[];
|
|
25
|
+
dismissable?: boolean;
|
|
26
|
+
source?: 'internal' | 'external';
|
|
27
|
+
}
|
|
28
|
+
export interface EFWFormMessageBarGroupProps {
|
|
29
|
+
style?: React.CSSProperties;
|
|
30
|
+
animate?: "both" | "exit-only" | undefined;
|
|
31
|
+
messages?: EFWFormMessageBar[];
|
|
32
|
+
children?: ReactNode;
|
|
33
|
+
onDismiss?: (messageId: number | string) => void;
|
|
34
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { jsx as F } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as E, useState as M, useCallback as i, useImperativeHandle as b } from "react";
|
|
3
|
+
import { EFWFormMessageBarGroup as W } from "../EFWFormMessageBarGroup/EFWFormMessageBarGroup.js";
|
|
4
|
+
const w = E((c, d) => {
|
|
5
|
+
const {
|
|
6
|
+
style: m,
|
|
7
|
+
initialExternalMessages: f = []
|
|
8
|
+
} = c, [g, a] = M([]), [u, n] = M(f), p = i((e, s = "internal") => {
|
|
9
|
+
(s === "internal" ? a : n)((o) => o.some((r) => r.id === e.id) ? o.map((r) => r.id === e.id ? { ...e } : r) : [...o, { ...e }]);
|
|
10
|
+
}, []), l = i((e) => {
|
|
11
|
+
a((s) => s.filter((t) => t.id !== e)), n((s) => s.filter((t) => t.id !== e));
|
|
12
|
+
}, []), x = i(() => {
|
|
13
|
+
a([]), n([]);
|
|
14
|
+
}, []);
|
|
15
|
+
b(d, () => ({
|
|
16
|
+
addMessageBar: p,
|
|
17
|
+
removeMessageBar: l,
|
|
18
|
+
removeAllMessagesBar: x
|
|
19
|
+
}));
|
|
20
|
+
const B = [...g, ...u];
|
|
21
|
+
return /* @__PURE__ */ F(
|
|
22
|
+
W,
|
|
23
|
+
{
|
|
24
|
+
style: m,
|
|
25
|
+
messages: B,
|
|
26
|
+
onDismiss: l
|
|
27
|
+
}
|
|
28
|
+
);
|
|
29
|
+
});
|
|
30
|
+
export {
|
|
31
|
+
w as EFWMessageBarManager
|
|
32
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsxs as w, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { makeStyles as f, Drawer as H, DrawerHeader as L, DrawerHeaderTitle as u, DrawerBody as y, DrawerFooter as h, tokens as r } from "@fluentui/react-components";
|
|
4
|
+
import { Dismiss24Regular as D } from "@fluentui/react-icons";
|
|
5
|
+
import { EFWButton as z } from "../../../../buttons/EFWButton/EFWButton.js";
|
|
6
|
+
import { EFWGroupButton as F } from "../../../../buttons/EFWGroupButton/EFWGroupButton.js";
|
|
7
|
+
const x = f({
|
|
8
|
+
drawerContainer: {
|
|
9
|
+
transform: "translateZ(0px)"
|
|
10
|
+
},
|
|
11
|
+
/**
|
|
12
|
+
* Estilos para el encabezado del drawer.
|
|
13
|
+
* Aplica padding vertical y horizontal usando tokens de diseño.
|
|
14
|
+
*/
|
|
15
|
+
drawerHeader: {
|
|
16
|
+
padding: r.spacingVerticalL,
|
|
17
|
+
paddingLeft: r.spacingHorizontalL,
|
|
18
|
+
paddingRight: r.spacingHorizontalL
|
|
19
|
+
},
|
|
20
|
+
/**
|
|
21
|
+
* Estilos para el cuerpo del drawer.
|
|
22
|
+
* Aplica padding inferior y lateral usando tokens de diseño.
|
|
23
|
+
*/
|
|
24
|
+
drawerBody: {
|
|
25
|
+
paddingBottom: r.spacingVerticalL,
|
|
26
|
+
paddingLeft: r.spacingHorizontalL,
|
|
27
|
+
paddingRight: r.spacingHorizontalL
|
|
28
|
+
},
|
|
29
|
+
/**
|
|
30
|
+
* Estilos para el pie del drawer.
|
|
31
|
+
* Aplica padding, disposición flexible y espaciado entre elementos.
|
|
32
|
+
*/
|
|
33
|
+
drawerFooter: {
|
|
34
|
+
padding: r.spacingVerticalM,
|
|
35
|
+
paddingLeft: r.spacingHorizontalL,
|
|
36
|
+
paddingRight: r.spacingHorizontalL,
|
|
37
|
+
display: "flex",
|
|
38
|
+
justifyContent: "flex-start",
|
|
39
|
+
gap: r.spacingHorizontalS
|
|
40
|
+
}
|
|
41
|
+
}), B = o.memo(({
|
|
42
|
+
isOpen: d,
|
|
43
|
+
onClose: e,
|
|
44
|
+
onOpenChange: s,
|
|
45
|
+
// Nueva prop
|
|
46
|
+
title: p,
|
|
47
|
+
content: i,
|
|
48
|
+
buttons: n = [],
|
|
49
|
+
size: l,
|
|
50
|
+
position: c,
|
|
51
|
+
modalType: g
|
|
52
|
+
}) => {
|
|
53
|
+
const t = x(), m = o.useMemo(() => typeof i == "function" ? i(e) : i, [i, e]);
|
|
54
|
+
return /* @__PURE__ */ w(
|
|
55
|
+
H,
|
|
56
|
+
{
|
|
57
|
+
as: "aside",
|
|
58
|
+
className: t.drawerContainer,
|
|
59
|
+
size: l,
|
|
60
|
+
position: c,
|
|
61
|
+
modalType: g,
|
|
62
|
+
open: d,
|
|
63
|
+
onOpenChange: s,
|
|
64
|
+
children: [
|
|
65
|
+
/* @__PURE__ */ a(L, { className: t.drawerHeader, children: /* @__PURE__ */ a(
|
|
66
|
+
u,
|
|
67
|
+
{
|
|
68
|
+
id: "drawer-title",
|
|
69
|
+
action: /* @__PURE__ */ a(
|
|
70
|
+
z,
|
|
71
|
+
{
|
|
72
|
+
appearance: "subtle",
|
|
73
|
+
icon: /* @__PURE__ */ a(D, {}),
|
|
74
|
+
"aria-label": "Cerrar",
|
|
75
|
+
onClick: e
|
|
76
|
+
}
|
|
77
|
+
),
|
|
78
|
+
children: p
|
|
79
|
+
}
|
|
80
|
+
) }),
|
|
81
|
+
/* @__PURE__ */ a(y, { className: t.drawerBody, children: m }),
|
|
82
|
+
n.length > 0 && /* @__PURE__ */ a(h, { className: t.drawerFooter, children: /* @__PURE__ */ a(
|
|
83
|
+
F,
|
|
84
|
+
{
|
|
85
|
+
buttons: n,
|
|
86
|
+
onClickParams: e
|
|
87
|
+
}
|
|
88
|
+
) })
|
|
89
|
+
]
|
|
90
|
+
}
|
|
91
|
+
);
|
|
92
|
+
});
|
|
93
|
+
B.displayName = "EFWDrawer";
|
|
94
|
+
export {
|
|
95
|
+
B as EFWDrawer
|
|
96
|
+
};
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { DrawerState, DrawerCloseHandler } from '../../useDrawer.types';
|
|
2
|
+
|
|
3
|
+
export interface EFWDrawerProps {
|
|
4
|
+
isOpen: DrawerState['isOpen'];
|
|
5
|
+
onClose: DrawerCloseHandler;
|
|
6
|
+
title: DrawerState['title'];
|
|
7
|
+
content?: DrawerState['content'];
|
|
8
|
+
buttons: DrawerState['buttons'];
|
|
9
|
+
size: DrawerState['size'];
|
|
10
|
+
position: DrawerState['position'];
|
|
11
|
+
modalType: DrawerState['modalType'];
|
|
12
|
+
onOpenChange: (event: React.SyntheticEvent, data: {
|
|
13
|
+
open: boolean;
|
|
14
|
+
}) => void;
|
|
15
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { jsxs as r, jsx as e } from "react/jsx-runtime";
|
|
2
|
+
import i from "react";
|
|
3
|
+
import { Spinner as t, Text as o } from "@fluentui/react-components";
|
|
4
|
+
const n = i.memo(({}) => /* @__PURE__ */ r(
|
|
5
|
+
"div",
|
|
6
|
+
{
|
|
7
|
+
style: {
|
|
8
|
+
display: "flex",
|
|
9
|
+
flexDirection: "column",
|
|
10
|
+
justifyContent: "center",
|
|
11
|
+
alignItems: "center",
|
|
12
|
+
minHeight: "200px",
|
|
13
|
+
gap: "10px"
|
|
14
|
+
},
|
|
15
|
+
children: [
|
|
16
|
+
/* @__PURE__ */ e(t, { size: "medium" }),
|
|
17
|
+
/* @__PURE__ */ e(o, { children: "Cargando contenido..." })
|
|
18
|
+
]
|
|
19
|
+
}
|
|
20
|
+
));
|
|
21
|
+
n.displayName = "EFWDrawerLoader";
|
|
22
|
+
export {
|
|
23
|
+
n as EFWDrawerLoader
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { EFWDrawerLoader } from './EFWDrawerLoader';
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { DrawerCloseHandler, DrawerOpenHandler, DrawerState, UseDrawerProps } from './useDrawer.types';
|
|
2
|
+
import * as React from 'react';
|
|
3
|
+
export declare function useDrawer({ title: initialTitle, content: initialContent, buttons: initialButtons, size: initialSize, position: initialPosition, modalType: initialModalType, drawerOnOpen, drawerOnClose, deferContentRendering, contentRenderDelay, }: UseDrawerProps): {
|
|
4
|
+
openDrawer: DrawerOpenHandler;
|
|
5
|
+
closeDrawer: DrawerCloseHandler;
|
|
6
|
+
updateDrawer: (updates: Partial<DrawerState>) => void;
|
|
7
|
+
isOpen: boolean;
|
|
8
|
+
isContentReady: boolean;
|
|
9
|
+
DrawerElement: React.ReactPortal | null;
|
|
10
|
+
};
|