@m4l/components 3.1.7 → 3.1.8
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/index.js +183 -340
- package/node_modules-CQtkw0uG.js +7350 -0
- package/package.json +1 -1
- package/vendor-AfIOyqRr.js +24636 -0
- package/components/AccountPopover/index-Dm2-k-Mv.js +0 -334
- package/components/AppBar/index-i0rhG3J1.js +0 -93
- package/components/BaseModule/index-CiNNlxzS.js +0 -30
- package/components/CommonActions/components/ActionCancel/index-CIdpDXkr.js +0 -12
- package/components/CommonActions/components/ActionFormCancel/index-CpyASN3q.js +0 -56
- package/components/CommonActions/components/ActionFormIntro/index-7KKtcUra.js +0 -33
- package/components/CommonActions/components/ActionIntro/index-CqqDZZcG.js +0 -25
- package/components/CommonActions/components/Actions/index-CuG1pnXW.js +0 -70
- package/components/DataGrid/constants-8L7QgBKi.js +0 -10
- package/components/DataGrid/formatters/ColumnBooleanFormatter/index-CveSCbq_.js +0 -26
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/index-CHqvieM2.js +0 -22
- package/components/DataGrid/formatters/ColumnDateFormatter/index-CKg8CJ6A.js +0 -19
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-DE6bwaKP.js +0 -23
- package/components/DataGrid/formatters/ColumnNestedValueFormatter/index-BslXGK-A.js +0 -14
- package/components/DataGrid/formatters/ColumnPointsFormatter/index-BXGW2CsK.js +0 -10
- package/components/DataGrid/formatters/ColumnPriceFormatter/index-O11tBykn.js +0 -10
- package/components/DataGrid/formatters/ColumnSetCheckFormatter/index-BaCawLr1.js +0 -36
- package/components/DataGrid/formatters/ColumnUncertaintyFormatter/index-Cq7a-jnE.js +0 -10
- package/components/DataGrid/formatters/index-CrZXPa0e.js +0 -13
- package/components/DataGrid/index-BZ-lbmuU.js +0 -908
- package/components/DataGrid/subcomponents/Actions/index-CHvPZ4Ru.js +0 -549
- package/components/DataGrid/subcomponents/editors/TextEditor/index-BIFm8akr.js +0 -80
- package/components/DragResizeWindow/index-D2jLYExo.js +0 -505
- package/components/DynamicFilter/constants-ByqmFATV.js +0 -31
- package/components/DynamicFilter/dictionary-PrbXU3VZ.js +0 -51
- package/components/DynamicFilter/index-DZiJc9h7.js +0 -116
- package/components/DynamicFilter/slots/SlotsEnum-cawFeNzx.js +0 -34
- package/components/DynamicFilter/slots/dynamicFilterSlots-DHxelhXP.js +0 -151
- package/components/DynamicFilter/slots/index-l0sNRNKZ.js +0 -1
- package/components/DynamicFilter/store/index-BT-eWVnJ.js +0 -254
- package/components/DynamicFilter/subcomponents/AppliedFilterChip/index-B32bAzi-.js +0 -60
- package/components/DynamicFilter/subcomponents/AppliedFilters/index-Bha19drV.js +0 -26
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/index-BmvzoHit.js +0 -40
- package/components/DynamicFilter/subcomponents/FieldTypes/BooleanFilter/index-BcO3SlP5.js +0 -129
- package/components/DynamicFilter/subcomponents/FieldTypes/DateTimeFilter/index-BCJhpNS8.js +0 -171
- package/components/DynamicFilter/subcomponents/FieldTypes/NumberFilter/index-DCNhz68u.js +0 -153
- package/components/DynamicFilter/subcomponents/FieldTypes/SelectFilter/index-BdypjM1Y.js +0 -146
- package/components/DynamicFilter/subcomponents/FieldTypes/StringFilter/index-D-NFIVnK.js +0 -114
- package/components/DynamicFilter/subcomponents/FieldTypes/index-BwQHJqk9.js +0 -38
- package/components/DynamicFilter/subcomponents/FilterActions/index-B9UWmk07.js +0 -88
- package/components/DynamicFilter/subcomponents/InputFilter/index-CfGb1TfV.js +0 -188
- package/components/DynamicFilter/subcomponents/PopoverFilter/index-DkfRGrlO.js +0 -158
- package/components/DynamicFilter/subcomponents/PopoverMenuFields/index-DSegwAm2.js +0 -63
- package/components/FieldLabel/index-CI57EizR.js +0 -54
- package/components/GridLayout/index-C4HyxNYX.js +0 -1044
- package/components/GridLayout/subcomponents/Griditem/index-C7jT4s8t.js +0 -395
- package/components/GridLayout/subcomponents/Responsive/index-BKcU2OnF.js +0 -348
- package/components/GridLayout/subcomponents/SizeProvider/index-1aJ-e_54.js +0 -71
- package/components/HelperText/index-Crn_XIPF.js +0 -50
- package/components/Icon/index-C89MAkeH.js +0 -176
- package/components/Image/index-COp8vP0X.js +0 -175
- package/components/LanguagePopover/index-BA2Igs9L.js +0 -179
- package/components/LinearProgressIndeterminate/index-BwI756Mb.js +0 -55
- package/components/Loadable/index-BMbi9ISF.js +0 -9
- package/components/LoadingError/index-Cf0oGUrL.js +0 -89
- package/components/MFIsolationApp/index-V4R55hNU.js +0 -169
- package/components/MFLoader/index-BI8vQZSH.js +0 -299
- package/components/ModalDialog/index-CEVQBQ7W.js +0 -77
- package/components/NavLink/index-D1S_vtFO.js +0 -55
- package/components/NoItemSelected/index-B9oM26AX.js +0 -54
- package/components/ObjectLogs/index-CiXOJpS4.js +0 -233
- package/components/PDFViewer/index-GVN2rfd6.js +0 -51
- package/components/Page/index-DZMkYmr4.js +0 -117
- package/components/PaperForm/index-DwgAfjci.js +0 -59
- package/components/Period/index-2pJG3VmY.js +0 -238
- package/components/PrintingSystem/index-B2qcnfw0.js +0 -187
- package/components/PrintingSystem/subcomponents/BodyNode/index-Cv2aoy8S.js +0 -49
- package/components/PrintingSystem/subcomponents/ChartNode/index-BmJm8v_C.js +0 -105
- package/components/PrintingSystem/subcomponents/DividerNode/index-MpFhE-H0.js +0 -20
- package/components/PrintingSystem/subcomponents/FooterNode/index-ZEcWdMSM.js +0 -49
- package/components/PrintingSystem/subcomponents/GridNode/index-SsKax2xu.js +0 -74
- package/components/PrintingSystem/subcomponents/HeaderNode/index-Cs8TOOBL.js +0 -49
- package/components/PrintingSystem/subcomponents/PaperNode/index-DBb25Ecg.js +0 -30
- package/components/PrintingSystem/subcomponents/PropertyValueNode/index-CTVn7J9Q.js +0 -47
- package/components/PrintingSystem/subcomponents/SectionNode/index-iYPM3EaS.js +0 -49
- package/components/PrintingSystem/subcomponents/TextBoxNode/index-DGjXCFKJ.js +0 -24
- package/components/PropertyValue/index-Bh-Jnrte.js +0 -264
- package/components/Resizeable/index-DdP1xfE9.js +0 -20
- package/components/ScrollBar/index-f2URPPE2.js +0 -35
- package/components/ScrollToTop/index-TxORk5dB.js +0 -12
- package/components/SideBar/index-PUBBe0yH.js +0 -758
- package/components/SplitLayout/index-Bu1hcO6G.js +0 -89
- package/components/ToastContainer/index-DK1d8NNd.js +0 -191
- package/components/WrapperComponent/index-BHV-CsDU.js +0 -14
- package/components/animate/LoadingScreen/index-CkVLOrMz.js +0 -70
- package/components/animate/MotionContainer/index-eartnWyO.js +0 -34
- package/components/animate/MotionLazyContainer/index-Be8osTiG.js +0 -9
- package/components/animate/PropagateLoader/index-Bkq8V2SN.js +0 -23
- package/components/animate/features-BbnE33u3.js +0 -5
- package/components/animate/index-BsWiJfzp.js +0 -89
- package/components/animate/variants/bounce-DanQqHAX.js +0 -101
- package/components/animate/variants/container-Dmpr6tg5.js +0 -22
- package/components/animate/variants/fade-CAOJNn06.js +0 -65
- package/components/animate/variants/index-l0sNRNKZ.js +0 -1
- package/components/animate/variants/transition-B9W5SWTa.js +0 -20
- package/components/areas/components/AreasAdmin/index-OxQU3P8Y.js +0 -699
- package/components/areas/components/AreasViewer/index-DQ0aPioP.js +0 -805
- package/components/areas/components/index-l0sNRNKZ.js +0 -1
- package/components/areas/constants-rqODZNZe.js +0 -6
- package/components/areas/contexts/AreasContext/index-BqRlA7JA.js +0 -1110
- package/components/areas/contexts/DynamicMFParmsContext/index-22c6E7vK.js +0 -36
- package/components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js +0 -12
- package/components/areas/contexts/index-l0sNRNKZ.js +0 -1
- package/components/areas/dictionary-YUsP9beq.js +0 -36
- package/components/areas/hooks/index-l0sNRNKZ.js +0 -1
- package/components/areas/hooks/useAreas/index-BSbwbJLS.js +0 -11
- package/components/areas/hooks/useDynamicMFParameters/index-DhbcZPs9.js +0 -12
- package/components/areas/hooks/useSetWindowsTitle/useSetWindowsTitle-BzPD-miW.js +0 -31
- package/components/areas/hooks/useWindowToolsMF/index-BECQfhbC.js +0 -10
- package/components/areas/icons-CwFr-alN.js +0 -24
- package/components/areas/index-B_Odny9h.js +0 -22
- package/components/commercial/AppBarCommercial/index-CHq3P3GY.js +0 -28
- package/components/commercial/SectionCommercial/index-BeABGtdr.js +0 -56
- package/components/commercial/TopBar/index-F1repmti.js +0 -232
- package/components/commercial/index-CxDzs6Ax.js +0 -81
- package/components/formatters/BooleanFormatter/index-DktIidqW.js +0 -44
- package/components/formatters/DateFormatter/index-CGcRZ8BA.js +0 -43
- package/components/formatters/PointsFormatter/index-C7sR8iqk.js +0 -25
- package/components/formatters/PriceFormatter/index-CsvRawmc.js +0 -35
- package/components/formatters/UncertaintyFormatter/index-B9ESVEVp.js +0 -29
- package/components/formatters/index-pnJhDYKe.js +0 -109
- package/components/hook-form/HelperError/index-BVnmUazV.js +0 -19
- package/components/hook-form/RHFAutocomplete/index-BtPL16HR.js +0 -657
- package/components/hook-form/RHFAutocompleteAsync/index-BfzjLHG8.js +0 -226
- package/components/hook-form/RHFCheckbox/index-Vyttu8Vx.js +0 -132
- package/components/hook-form/RHFColorPicker/index-Cxxb5Wa_.js +0 -191
- package/components/hook-form/RHFDateTime/index-CW1Slb-f.js +0 -190
- package/components/hook-form/RHFMultiCheckbox/index-BARudV1A.js +0 -34
- package/components/hook-form/RHFPeriod/index-r-HeIOoZ.js +0 -98
- package/components/hook-form/RHFRadioGroup/index-CTD-0zKo.js +0 -52
- package/components/hook-form/RHFSelect/index-LdwRuFz-.js +0 -29
- package/components/hook-form/RHFTextField/index-B6ufruSB.js +0 -337
- package/components/hook-form/RHFUpload/index-CDPbm8NR.js +0 -253
- package/components/maps/components/GpsTools/index-5MXlhIEt.js +0 -1948
- package/components/maps/components/Map/index-2Lx5ARXa.js +0 -2546
- package/components/maps/index-Ci-7-FHg.js +0 -7
- package/components/modal/WindowBase-Gd27v5FU.js +0 -44
- package/components/modal/WindowConfirm-u6vAMFo7.js +0 -73
- package/components/modal/index-CydPIpKZ.js +0 -65
- package/components/mui_extended/Accordion/index-DMLYJL7o.js +0 -124
- package/components/mui_extended/Avatar/index-ClBa-6eF.js +0 -64
- package/components/mui_extended/Badge/index-zI-F_Qkq.js +0 -29
- package/components/mui_extended/BoxIcon/index-BUTJ2tKw.js +0 -22
- package/components/mui_extended/Breadcrumbs/index-DTS7rOZH.js +0 -86
- package/components/mui_extended/Button/index-CGfZbaea.js +0 -222
- package/components/mui_extended/CheckBox-BXUrbonB.js +0 -76
- package/components/mui_extended/CircularProgress/index-Bnnti_G6.js +0 -8
- package/components/mui_extended/IconButton/classes/constants-ChY2jKkp.js +0 -4
- package/components/mui_extended/IconButton/classes/index-BxjJGAqZ.js +0 -45
- package/components/mui_extended/IconButton/index-CusYFjie.js +0 -97
- package/components/mui_extended/IconButton/styledIconButton-fAsbGoFS.js +0 -7
- package/components/mui_extended/LinearProgress/index-CGgW8jq2.js +0 -9
- package/components/mui_extended/LinkWithRoute/index-BC2miUjR.js +0 -15
- package/components/mui_extended/MenuActions/MenuActions-C6CjSU6C.js +0 -149
- package/components/mui_extended/MenuActions/constants-BwsU9chA.js +0 -10
- package/components/mui_extended/MenuActions/dictionary-Dj_07puT.js +0 -11
- package/components/mui_extended/MenuActions/slots/MenuActionsEnum-Bu-L6eWU.js +0 -13
- package/components/mui_extended/MenuActions/slots/MenuActionsSlots-D65KZAKF.js +0 -46
- package/components/mui_extended/Pager/index-DCbxiTZA.js +0 -257
- package/components/mui_extended/Popover/index-DfrJAQkV.js +0 -153
- package/components/mui_extended/Stack/index-DzEeCYfp.js +0 -31
- package/components/mui_extended/Tab/index-Bu3dPidV.js +0 -129
- package/components/mui_extended/ToggleButton/index-C9cBkT1V.js +0 -18
- package/components/mui_extended/ToggleIconButton/index--0b3Td6C.js +0 -26
- package/components/mui_extended/Tooltip/index-B8QUytCK.js +0 -42
- package/components/mui_extended/Typography/index-Cf_4Zw8f.js +0 -54
- package/components/mui_extended/index-l0sNRNKZ.js +0 -1
- package/components/popups/PopupsProvider/index-DhSxmtfJ.js +0 -172
- package/components/popups/PopupsViewer/constants-DuyD7aCn.js +0 -4
- package/components/popups/PopupsViewer/icons-BUujqqbu.js +0 -7
- package/components/popups/PopupsViewer/index-BecevSns.js +0 -172
- package/components/popups/PopupsViewer/slots/index-B98CiRLa.js +0 -14
- package/components/popups/PopupsViewer/slots/popupsViewerSlots-BXH77nCF.js +0 -46
- package/components/popups/index-l0sNRNKZ.js +0 -1
- package/contexts/ModalContext/index-CPfNnfTL.js +0 -39
- package/contexts/RHFormContext/index-D_nK759o.js +0 -78
- package/hocs/withToggle/index-C1_DMZD3.js +0 -14
- package/hooks/useFormAddEdit/index-D9oSjUn1.js +0 -90
- package/hooks/useFormReadyForUpdate/index-B3HygFCM.js +0 -20
- package/hooks/useModal/index-BJSQOX3U.js +0 -10
- package/hooks/useSizeContainer/index-D4hDjM1P.js +0 -37
- package/hooks/useStateRef/index-C3P6ZK3m.js +0 -15
- package/hooks/useTab/index-B_GEQFOP.js +0 -12
- package/react-data-grid-BfYuZ6AK.js +0 -2606
- package/react-draggable-DsCPdgQP.js +0 -811
- package/react-json-view-bhqIAaNg.js +0 -2576
- package/react-resizable-eBbFl2dX.js +0 -618
- package/react-spinners-TpKN9lZg.js +0 -123
- package/react-splitter-layout-C-JTsNGs.js +0 -158
- package/styles/DynamicFilter-CJFsIegc.js +0 -319
- package/styles/MenuActions-lTi-ynPM.js +0 -42
- package/styles/index-DKj6m8SL.js +0 -1691
- package/test/constants_no_mock-CF-669v-.js +0 -4
- package/test/getNameDataTestId-BaBTWhBr.js +0 -10
- package/utils/index-DiMrtgIu.js +0 -502
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/index.d.ts +0 -0
- /package/components/GridLayout/subcomponents/{Griditem → GridItem}/types.d.ts +0 -0
|
@@ -1,337 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
3
|
-
import { Skeleton, generateUtilityClasses, TextField, InputAdornment, generateUtilityClass } from "@mui/material";
|
|
4
|
-
import { forwardRef, useState, useEffect } from "react";
|
|
5
|
-
import { I as IconButton } from "../../mui_extended/IconButton/index-CusYFjie.js";
|
|
6
|
-
import { useFormContext, Controller } from "react-hook-form";
|
|
7
|
-
import { ao as SkeletonTextFieldRoot, ap as WrapperSkeletonRHFTextField, aq as RHFTextFieldRoot, ar as RHFTextFieldPasswordRoot } from "../../../styles/index-DKj6m8SL.js";
|
|
8
|
-
import { T as TEST_PROP_ID } from "../../../test/constants_no_mock-CF-669v-.js";
|
|
9
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
10
|
-
import { g as getComponentUtilityClass } from "../../../utils/index-DiMrtgIu.js";
|
|
11
|
-
import { H as HelperText } from "../../HelperText/index-Crn_XIPF.js";
|
|
12
|
-
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
13
|
-
import { useFormFocus } from "../../../index.js";
|
|
14
|
-
import { F as FieldLabel } from "../../FieldLabel/index-CI57EizR.js";
|
|
15
|
-
const RHFTEXTFIELD_ROOT_TEST_ID = "RHFTextFieldRoot";
|
|
16
|
-
const RHFTEXTFIELD_INPUT_TEST_ID = "RHFTextFieldInput";
|
|
17
|
-
const RHFTEXTFIELD_PREFIX = "RHFTextField";
|
|
18
|
-
const getNameDataTestId$1 = (KEY) => {
|
|
19
|
-
return `${RHFTEXTFIELD_PREFIX}-${KEY}`;
|
|
20
|
-
};
|
|
21
|
-
const SkeletonTextField = (props) => {
|
|
22
|
-
const { skeletonWidth, skeletonHeight, ownerState, classes, hasLabel } = props;
|
|
23
|
-
const { type: variant } = ownerState;
|
|
24
|
-
return /* @__PURE__ */ jsxs(SkeletonTextFieldRoot, { children: [
|
|
25
|
-
(hasLabel || hasLabel?.length === 0) && /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: "30%", height: "16px" }),
|
|
26
|
-
/* @__PURE__ */ jsx(
|
|
27
|
-
WrapperSkeletonRHFTextField,
|
|
28
|
-
{
|
|
29
|
-
className: classes.skeleton,
|
|
30
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId$1("skeleton") } : {},
|
|
31
|
-
children: variant === "text" ? /* @__PURE__ */ jsx(Skeleton, { variant: "text", width: skeletonWidth, height: skeletonHeight }) : /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
32
|
-
/* @__PURE__ */ jsx(Skeleton, { variant: "text", width: skeletonWidth, height: skeletonHeight }),
|
|
33
|
-
/* @__PURE__ */ jsx(Skeleton, { variant: "circular", width: "16px", height: "16px" })
|
|
34
|
-
] })
|
|
35
|
-
}
|
|
36
|
-
)
|
|
37
|
-
] });
|
|
38
|
-
};
|
|
39
|
-
const componentName = "M4LRHFTextField";
|
|
40
|
-
generateUtilityClasses(
|
|
41
|
-
componentName,
|
|
42
|
-
[
|
|
43
|
-
/* elements */
|
|
44
|
-
"root",
|
|
45
|
-
"label",
|
|
46
|
-
"skeleton",
|
|
47
|
-
/* states or variants of elements */
|
|
48
|
-
"variantText",
|
|
49
|
-
"variantPassword",
|
|
50
|
-
"variantInfo",
|
|
51
|
-
"isDisabled",
|
|
52
|
-
"variantSuccess",
|
|
53
|
-
"variantWarning",
|
|
54
|
-
"variantError",
|
|
55
|
-
"sizeSmall",
|
|
56
|
-
"sizeMedium",
|
|
57
|
-
"isFocus",
|
|
58
|
-
"isTabSelected"
|
|
59
|
-
]
|
|
60
|
-
/* returna un objeto igual a:
|
|
61
|
-
{
|
|
62
|
-
root: 'M4LRHFTextField-root',
|
|
63
|
-
skeleton: 'M4LRHFTextField-skeleton',
|
|
64
|
-
variantText: 'M4LRHFTextField-variantText',
|
|
65
|
-
variantPassword: 'M4LRHFTextField-variantPassword',
|
|
66
|
-
}
|
|
67
|
-
*/
|
|
68
|
-
);
|
|
69
|
-
const getRHFTextFieldClassesByState = (ownerState) => {
|
|
70
|
-
const slots = {
|
|
71
|
-
root: [
|
|
72
|
-
"root",
|
|
73
|
-
ownerState.type === "password" ? "variantPassword" : "variantText",
|
|
74
|
-
ownerState.size === "small" && "sizeSmall",
|
|
75
|
-
ownerState.size === "medium" && "sizeMedium",
|
|
76
|
-
ownerState.isFocus && "isFocus",
|
|
77
|
-
ownerState.isTabSelected && "isTabSelected",
|
|
78
|
-
ownerState.disabled && "isDisabled",
|
|
79
|
-
ownerState.variant === "info" && "variantInfo",
|
|
80
|
-
ownerState.variant === "success" && "variantSuccess",
|
|
81
|
-
ownerState.variant === "warning" && "variantWarning",
|
|
82
|
-
ownerState.variant === "error" && "variantError"
|
|
83
|
-
],
|
|
84
|
-
label: ["label"],
|
|
85
|
-
skeleton: ["skeleton"]
|
|
86
|
-
};
|
|
87
|
-
const composedClasses = unstable_composeClasses(slots, getComponentUtilityClass(componentName), {});
|
|
88
|
-
return {
|
|
89
|
-
...composedClasses
|
|
90
|
-
/* retorna un objeto para una variante de tipo = 'password':
|
|
91
|
-
{
|
|
92
|
-
input : "M4LRHFTextField-input"
|
|
93
|
-
root: "M4LRHFTextField-root M4LRHFTextField-variantPassword"
|
|
94
|
-
skeleton: "M4LRHFTextField-skeleton"
|
|
95
|
-
};
|
|
96
|
-
*/
|
|
97
|
-
};
|
|
98
|
-
};
|
|
99
|
-
const RHFTextField = forwardRef((props, ref) => {
|
|
100
|
-
const {
|
|
101
|
-
name: nameRHF,
|
|
102
|
-
autoComplete = "off",
|
|
103
|
-
skeletonWidth = "100%",
|
|
104
|
-
skeletonHeight = "18px",
|
|
105
|
-
type,
|
|
106
|
-
label,
|
|
107
|
-
size = "small",
|
|
108
|
-
startIcon,
|
|
109
|
-
endIcon,
|
|
110
|
-
variant,
|
|
111
|
-
helperMessage = "",
|
|
112
|
-
disabled,
|
|
113
|
-
mandatory,
|
|
114
|
-
mandatoryMessage,
|
|
115
|
-
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
116
|
-
helperText,
|
|
117
|
-
...other
|
|
118
|
-
} = props;
|
|
119
|
-
const {
|
|
120
|
-
control,
|
|
121
|
-
formState: { errors }
|
|
122
|
-
} = useFormContext();
|
|
123
|
-
const [currentVariant, setCurrentVariant] = useState(null);
|
|
124
|
-
const { isFocus, isTabSelected, handlerFocus, handlerOnKeyUp, handlerOnBlur } = useFormFocus();
|
|
125
|
-
const isDesktop = useResponsiveDesktop();
|
|
126
|
-
const isSkeleton = useModuleSkeleton();
|
|
127
|
-
useEffect(() => {
|
|
128
|
-
if (errors[nameRHF]) {
|
|
129
|
-
setCurrentVariant("error");
|
|
130
|
-
} else if (variant) {
|
|
131
|
-
setCurrentVariant(variant);
|
|
132
|
-
} else {
|
|
133
|
-
setCurrentVariant(null);
|
|
134
|
-
}
|
|
135
|
-
}, [errors[nameRHF], variant, control]);
|
|
136
|
-
const ownerState = {
|
|
137
|
-
type: type === "password" ? "password" : "text",
|
|
138
|
-
size: !isDesktop ? "medium" : size,
|
|
139
|
-
isFocus: !isSkeleton ? isFocus : false,
|
|
140
|
-
isTabSelected: !isSkeleton ? isTabSelected : false,
|
|
141
|
-
variant: currentVariant,
|
|
142
|
-
disabled
|
|
143
|
-
};
|
|
144
|
-
const classes = getRHFTextFieldClassesByState(ownerState);
|
|
145
|
-
return (
|
|
146
|
-
/* RHFTextFieldRoot: Contenedor principal del componente, es usado para aplicar los estilos css de los overrides
|
|
147
|
-
que provienen del objeto del tema. Se usa para garantizar de que estos estilos no se propaguen a otros
|
|
148
|
-
componentes de la plataforna web. */
|
|
149
|
-
/* @__PURE__ */ jsx(
|
|
150
|
-
RHFTextFieldRoot,
|
|
151
|
-
{
|
|
152
|
-
className: classes.root,
|
|
153
|
-
tabIndex: 0,
|
|
154
|
-
onFocus: handlerFocus,
|
|
155
|
-
onBlur: handlerOnBlur,
|
|
156
|
-
onKeyUp: handlerOnKeyUp,
|
|
157
|
-
role: "textbox",
|
|
158
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: `${RHFTEXTFIELD_ROOT_TEST_ID}_${nameRHF}` } : {},
|
|
159
|
-
children: !isSkeleton ? (
|
|
160
|
-
/* controller: Componente usado para suscribir el componente al contexto de hook-form */
|
|
161
|
-
/* @__PURE__ */ jsx(
|
|
162
|
-
Controller,
|
|
163
|
-
{
|
|
164
|
-
name: nameRHF,
|
|
165
|
-
control,
|
|
166
|
-
render: ({ field: { onChange, value, name, ref: inputRef }, fieldState: { error } }) => {
|
|
167
|
-
const onInternalChange = (event) => {
|
|
168
|
-
if (type === "number") {
|
|
169
|
-
if (event.target.value) {
|
|
170
|
-
onChange(Number(event.target.value));
|
|
171
|
-
return;
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
onChange(event);
|
|
175
|
-
};
|
|
176
|
-
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
177
|
-
label && /* @__PURE__ */ jsx(
|
|
178
|
-
FieldLabel,
|
|
179
|
-
{
|
|
180
|
-
label,
|
|
181
|
-
mandatory,
|
|
182
|
-
mandatoryMessage,
|
|
183
|
-
helperMessage
|
|
184
|
-
}
|
|
185
|
-
),
|
|
186
|
-
/* @__PURE__ */ jsx(
|
|
187
|
-
TextField,
|
|
188
|
-
{
|
|
189
|
-
variant: "outlined",
|
|
190
|
-
disabled,
|
|
191
|
-
ref,
|
|
192
|
-
inputRef,
|
|
193
|
-
InputLabelProps: { shrink: true },
|
|
194
|
-
autoComplete,
|
|
195
|
-
onChange: onInternalChange,
|
|
196
|
-
value: type === "number" ? isNaN(value) ? 0 : value : value || "",
|
|
197
|
-
name,
|
|
198
|
-
inputProps: {
|
|
199
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
200
|
-
[TEST_PROP_ID]: `${RHFTEXTFIELD_INPUT_TEST_ID}_${name}`
|
|
201
|
-
} : {}
|
|
202
|
-
},
|
|
203
|
-
fullWidth: true,
|
|
204
|
-
error: !!error,
|
|
205
|
-
type,
|
|
206
|
-
...startIcon || endIcon ? {
|
|
207
|
-
InputProps: {
|
|
208
|
-
...{
|
|
209
|
-
...startIcon ? {
|
|
210
|
-
startAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "start", children: startIcon })
|
|
211
|
-
} : {},
|
|
212
|
-
...endIcon ? {
|
|
213
|
-
endAdornment: /* @__PURE__ */ jsx(InputAdornment, { position: "end", children: endIcon })
|
|
214
|
-
} : {}
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
} : {},
|
|
218
|
-
...other
|
|
219
|
-
}
|
|
220
|
-
),
|
|
221
|
-
currentVariant ? /* @__PURE__ */ jsx(
|
|
222
|
-
HelperText,
|
|
223
|
-
{
|
|
224
|
-
variant: currentVariant,
|
|
225
|
-
message: currentVariant !== "error" ? helperMessage : error?.message
|
|
226
|
-
}
|
|
227
|
-
) : null
|
|
228
|
-
] });
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
)
|
|
232
|
-
) : (
|
|
233
|
-
/* SkeletonTextField: Subcomponente donde se construye la versión de carga provisional que se va a dar mientras no se haya
|
|
234
|
-
asignado los valores de diccionario */
|
|
235
|
-
/* @__PURE__ */ jsx(
|
|
236
|
-
SkeletonTextField,
|
|
237
|
-
{
|
|
238
|
-
classes,
|
|
239
|
-
skeletonWidth,
|
|
240
|
-
skeletonHeight,
|
|
241
|
-
ownerState,
|
|
242
|
-
hasLabel: label
|
|
243
|
-
}
|
|
244
|
-
)
|
|
245
|
-
)
|
|
246
|
-
}
|
|
247
|
-
)
|
|
248
|
-
);
|
|
249
|
-
});
|
|
250
|
-
RHFTextField.displayName = "RHFTextField";
|
|
251
|
-
generateUtilityClasses(
|
|
252
|
-
"M4LRHFTextFieldPassword",
|
|
253
|
-
[
|
|
254
|
-
/* elements */
|
|
255
|
-
"root"
|
|
256
|
-
/* states or variants of elements */
|
|
257
|
-
]
|
|
258
|
-
);
|
|
259
|
-
function getRHFTextFieldPasswordUtilityClass(slot) {
|
|
260
|
-
return generateUtilityClass("M4LRHFTextFieldPassword", slot);
|
|
261
|
-
}
|
|
262
|
-
const useUtilityClasses = () => {
|
|
263
|
-
const slots = {
|
|
264
|
-
root: ["root"]
|
|
265
|
-
};
|
|
266
|
-
const composedClasses = unstable_composeClasses(slots, getRHFTextFieldPasswordUtilityClass, {});
|
|
267
|
-
return {
|
|
268
|
-
...composedClasses
|
|
269
|
-
};
|
|
270
|
-
};
|
|
271
|
-
const RHFTEXTFIELDPASSWORD_PREFIX = "RHFTextFieldPassword";
|
|
272
|
-
const getNameDataTestId = (KEY) => {
|
|
273
|
-
return `${RHFTEXTFIELDPASSWORD_PREFIX}-${KEY}`;
|
|
274
|
-
};
|
|
275
|
-
const RHFTextFieldPassword = (props) => {
|
|
276
|
-
const {
|
|
277
|
-
name,
|
|
278
|
-
label,
|
|
279
|
-
skeletonWidth,
|
|
280
|
-
skeletonHeight,
|
|
281
|
-
size,
|
|
282
|
-
mandatory,
|
|
283
|
-
mandatoryMessage,
|
|
284
|
-
helperMessage
|
|
285
|
-
} = props;
|
|
286
|
-
const [showPassword, setShowPassword] = useState(false);
|
|
287
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
288
|
-
const classes = useUtilityClasses();
|
|
289
|
-
return (
|
|
290
|
-
/* RHFTextFieldPasswordRoot: Contenedor principal del componente, es usado para aplicar los estilos css de los overrides
|
|
291
|
-
que provienen del objeto del tema. Se usa para garantizar de que estos estilos no se propaguen a otros
|
|
292
|
-
componentes de la plataforna web. */
|
|
293
|
-
/* @__PURE__ */ jsx(
|
|
294
|
-
RHFTextFieldPasswordRoot,
|
|
295
|
-
{
|
|
296
|
-
className: classes.root,
|
|
297
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameDataTestId("root") } : {},
|
|
298
|
-
children: /* @__PURE__ */ jsx(
|
|
299
|
-
RHFTextField,
|
|
300
|
-
{
|
|
301
|
-
name,
|
|
302
|
-
label,
|
|
303
|
-
type: showPassword ? "text" : "password",
|
|
304
|
-
autoComplete: "on",
|
|
305
|
-
skeletonWidth,
|
|
306
|
-
skeletonHeight,
|
|
307
|
-
size,
|
|
308
|
-
mandatory,
|
|
309
|
-
mandatoryMessage,
|
|
310
|
-
helperMessage,
|
|
311
|
-
InputProps: {
|
|
312
|
-
endAdornment: (
|
|
313
|
-
/* InputAdornment: Componente de la librería externa material ui, permite agregar un elemento gráfico
|
|
314
|
-
personalizado dentro del campo de texto*/
|
|
315
|
-
/* @__PURE__ */ jsx(InputAdornment, { position: "end", children: /* @__PURE__ */ jsx(
|
|
316
|
-
IconButton,
|
|
317
|
-
{
|
|
318
|
-
onClick: () => setShowPassword(!showPassword),
|
|
319
|
-
variant: "line",
|
|
320
|
-
src: showPassword ? `${host_static_assets}/${environment_assets}/frontend/domain/host/login/assets/icons/eye.svg` : `${host_static_assets}/${environment_assets}/frontend/domain/host/login/assets/icons/eye_off.svg`
|
|
321
|
-
}
|
|
322
|
-
) })
|
|
323
|
-
)
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
)
|
|
327
|
-
}
|
|
328
|
-
)
|
|
329
|
-
);
|
|
330
|
-
};
|
|
331
|
-
export {
|
|
332
|
-
RHFTextField as R,
|
|
333
|
-
RHFTEXTFIELD_ROOT_TEST_ID as a,
|
|
334
|
-
RHFTEXTFIELD_INPUT_TEST_ID as b,
|
|
335
|
-
RHFTEXTFIELD_PREFIX as c,
|
|
336
|
-
RHFTextFieldPassword as d
|
|
337
|
-
};
|
|
@@ -1,253 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
2
|
-
import { useCallback } from "react";
|
|
3
|
-
import { useFormContext, Controller } from "react-hook-form";
|
|
4
|
-
import isString from "lodash/isString";
|
|
5
|
-
import { useDropzone } from "react-dropzone";
|
|
6
|
-
import { I as Image } from "../../Image/index-COp8vP0X.js";
|
|
7
|
-
import { useEnvironment, useModuleDictionary, useModuleSkeleton } from "@m4l/core";
|
|
8
|
-
import { as as UploadImageRoot, at as WrapperRHFUploadImage } from "../../../styles/index-DKj6m8SL.js";
|
|
9
|
-
import { Skeleton, generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
10
|
-
import { T as TEST_PROP_ID } from "../../../test/constants_no_mock-CF-669v-.js";
|
|
11
|
-
import { unstable_composeClasses } from "@mui/base";
|
|
12
|
-
import { T as Typography } from "../../mui_extended/Typography/index-Cf_4Zw8f.js";
|
|
13
|
-
import { B as Button } from "../../mui_extended/Button/index-CGfZbaea.js";
|
|
14
|
-
import { H as HelperText } from "../../HelperText/index-Crn_XIPF.js";
|
|
15
|
-
const ICON_PREFIX = "M4LRHFUploadImage";
|
|
16
|
-
const getNameRHFUploadImageDataTestId = (KEY) => {
|
|
17
|
-
return `${ICON_PREFIX}-${KEY}`;
|
|
18
|
-
};
|
|
19
|
-
const SkeletonUploadImage = (props) => {
|
|
20
|
-
const { classes } = props;
|
|
21
|
-
return /* @__PURE__ */ jsxs(
|
|
22
|
-
"div",
|
|
23
|
-
{
|
|
24
|
-
className: classes,
|
|
25
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
26
|
-
[TEST_PROP_ID]: getNameRHFUploadImageDataTestId("skeleton")
|
|
27
|
-
} : {},
|
|
28
|
-
children: [
|
|
29
|
-
"está con skeleton",
|
|
30
|
-
/* @__PURE__ */ jsx(Skeleton, { variant: "rectangular", width: "100%", height: "100%" })
|
|
31
|
-
]
|
|
32
|
-
}
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
const componentName = "M4LRHFUploadImage";
|
|
36
|
-
generateUtilityClasses(
|
|
37
|
-
componentName,
|
|
38
|
-
[
|
|
39
|
-
/* elements */
|
|
40
|
-
"root",
|
|
41
|
-
"dropZoneStyle",
|
|
42
|
-
"containerFileImage",
|
|
43
|
-
"placeHolder",
|
|
44
|
-
"containerUploadBoddy",
|
|
45
|
-
"containerBodyImage",
|
|
46
|
-
"containerMessage",
|
|
47
|
-
"containerTitle",
|
|
48
|
-
"containerDescription",
|
|
49
|
-
"containerConditions",
|
|
50
|
-
"containerUploadImage",
|
|
51
|
-
"string",
|
|
52
|
-
"skeleton",
|
|
53
|
-
"inputDropZone",
|
|
54
|
-
/* states or variants of elements */
|
|
55
|
-
"stateError"
|
|
56
|
-
]
|
|
57
|
-
);
|
|
58
|
-
function getRHFUploadImagebUtilityClass(slot) {
|
|
59
|
-
return generateUtilityClass(componentName, slot);
|
|
60
|
-
}
|
|
61
|
-
const RHFUploadImageUtilityClasses = (ownerState) => {
|
|
62
|
-
const slots = {
|
|
63
|
-
root: [
|
|
64
|
-
"root",
|
|
65
|
-
ownerState.isDragReject && "stateError",
|
|
66
|
-
ownerState.isDragActive && "stateActive",
|
|
67
|
-
ownerState.hasFile && "hasFile"
|
|
68
|
-
],
|
|
69
|
-
dropZoneStyle: ["dropZoneStyle"],
|
|
70
|
-
containerFileImage: ["containerFileImage"],
|
|
71
|
-
placeHolder: ["placeHolder"],
|
|
72
|
-
containerUploadBoddy: ["containerUploadBoddy"],
|
|
73
|
-
containerBodyImage: ["containerBodyImage"],
|
|
74
|
-
containerMessage: ["containerMessage"],
|
|
75
|
-
containerTitle: ["containerTitle"],
|
|
76
|
-
containerDescription: ["containerDescription"],
|
|
77
|
-
containerConditions: ["containerConditions"],
|
|
78
|
-
containerUploadImage: ["containerUploadImage"],
|
|
79
|
-
skeleton: ["skeleton"],
|
|
80
|
-
inputDropZone: ["inputDropZone"]
|
|
81
|
-
};
|
|
82
|
-
const composedClasses = unstable_composeClasses(slots, getRHFUploadImagebUtilityClass, {});
|
|
83
|
-
return {
|
|
84
|
-
...composedClasses
|
|
85
|
-
};
|
|
86
|
-
};
|
|
87
|
-
function UploadImage({ error, file, helperText, sx, ...other }) {
|
|
88
|
-
const { getRootProps, getInputProps, isDragActive, isDragReject, open } = useDropzone({
|
|
89
|
-
multiple: false,
|
|
90
|
-
...other
|
|
91
|
-
});
|
|
92
|
-
const { host_static_assets, environment_assets } = useEnvironment();
|
|
93
|
-
const { getLabel } = useModuleDictionary();
|
|
94
|
-
const isSkeleton = useModuleSkeleton();
|
|
95
|
-
const ownerSate = {
|
|
96
|
-
isDragReject: isDragReject || error,
|
|
97
|
-
isDragActive,
|
|
98
|
-
hasFile: file
|
|
99
|
-
};
|
|
100
|
-
const classes = RHFUploadImageUtilityClasses(ownerSate);
|
|
101
|
-
return /* @__PURE__ */ jsx(
|
|
102
|
-
UploadImageRoot,
|
|
103
|
-
{
|
|
104
|
-
className: classes.root,
|
|
105
|
-
...process.env.NODE_ENV !== "production" ? { [TEST_PROP_ID]: getNameRHFUploadImageDataTestId("root") } : {},
|
|
106
|
-
children: !isSkeleton ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
107
|
-
"está sin skeleton",
|
|
108
|
-
/* @__PURE__ */ jsx(
|
|
109
|
-
"div",
|
|
110
|
-
{
|
|
111
|
-
className: classes.containerUploadImage,
|
|
112
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
113
|
-
[TEST_PROP_ID]: getNameRHFUploadImageDataTestId("containerUploadImage")
|
|
114
|
-
} : {},
|
|
115
|
-
children: /* @__PURE__ */ jsxs(
|
|
116
|
-
"div",
|
|
117
|
-
{
|
|
118
|
-
className: classes.dropZoneStyle,
|
|
119
|
-
...getRootProps(),
|
|
120
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
121
|
-
[TEST_PROP_ID]: getNameRHFUploadImageDataTestId("dropZoneStyle")
|
|
122
|
-
} : {},
|
|
123
|
-
children: [
|
|
124
|
-
/* @__PURE__ */ jsx(
|
|
125
|
-
"input",
|
|
126
|
-
{
|
|
127
|
-
...getInputProps(),
|
|
128
|
-
className: classes.inputDropZone,
|
|
129
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
130
|
-
[TEST_PROP_ID]: getNameRHFUploadImageDataTestId("inputDropZone")
|
|
131
|
-
} : {}
|
|
132
|
-
}
|
|
133
|
-
),
|
|
134
|
-
file && /* @__PURE__ */ jsx(
|
|
135
|
-
"div",
|
|
136
|
-
{
|
|
137
|
-
className: classes.containerFileImage,
|
|
138
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
139
|
-
[TEST_PROP_ID]: getNameRHFUploadImageDataTestId("containerFileImage")
|
|
140
|
-
} : {},
|
|
141
|
-
children: /* @__PURE__ */ jsx(
|
|
142
|
-
Image,
|
|
143
|
-
{
|
|
144
|
-
alt: "bgImageUploadImage",
|
|
145
|
-
src: isString(file) ? file : file.preview || "",
|
|
146
|
-
ratio: "1:1"
|
|
147
|
-
}
|
|
148
|
-
)
|
|
149
|
-
}
|
|
150
|
-
),
|
|
151
|
-
/* @__PURE__ */ jsx(
|
|
152
|
-
"div",
|
|
153
|
-
{
|
|
154
|
-
className: classes.placeHolder,
|
|
155
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
156
|
-
[TEST_PROP_ID]: getNameRHFUploadImageDataTestId("placeHolder")
|
|
157
|
-
} : {},
|
|
158
|
-
children: /* @__PURE__ */ jsxs(
|
|
159
|
-
"div",
|
|
160
|
-
{
|
|
161
|
-
className: classes.containerUploadBoddy,
|
|
162
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
163
|
-
[TEST_PROP_ID]: getNameRHFUploadImageDataTestId("containerUploadBoddy")
|
|
164
|
-
} : {},
|
|
165
|
-
children: [
|
|
166
|
-
/* @__PURE__ */ jsx(
|
|
167
|
-
"div",
|
|
168
|
-
{
|
|
169
|
-
className: classes.containerBodyImage,
|
|
170
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
171
|
-
[TEST_PROP_ID]: getNameRHFUploadImageDataTestId("containerBodyImage")
|
|
172
|
-
} : {},
|
|
173
|
-
children: /* @__PURE__ */ jsx(
|
|
174
|
-
Image,
|
|
175
|
-
{
|
|
176
|
-
src: `${host_static_assets}/${environment_assets}/frontend/components/upload_image/assets/img/upload_image_illustration.svg`,
|
|
177
|
-
ratio: "1:1"
|
|
178
|
-
}
|
|
179
|
-
)
|
|
180
|
-
}
|
|
181
|
-
),
|
|
182
|
-
/* @__PURE__ */ jsxs(
|
|
183
|
-
"div",
|
|
184
|
-
{
|
|
185
|
-
className: classes.containerMessage,
|
|
186
|
-
...process.env.NODE_ENV !== "production" ? {
|
|
187
|
-
[TEST_PROP_ID]: getNameRHFUploadImageDataTestId("containerMessage")
|
|
188
|
-
} : {},
|
|
189
|
-
children: [
|
|
190
|
-
/* @__PURE__ */ jsx(
|
|
191
|
-
Typography,
|
|
192
|
-
{
|
|
193
|
-
className: classes.containerTitle,
|
|
194
|
-
variant: "subtitle",
|
|
195
|
-
skeletonWidth: "150px",
|
|
196
|
-
children: getLabel("upload_image.title_upload")
|
|
197
|
-
}
|
|
198
|
-
),
|
|
199
|
-
/* @__PURE__ */ jsx(Typography, { className: classes.containerDescription, variant: "body", children: getLabel("upload_image.description") }),
|
|
200
|
-
/* @__PURE__ */ jsx(Typography, { className: classes.containerConditions, variant: "body", children: getLabel("upload_image.conditions") }),
|
|
201
|
-
/* @__PURE__ */ jsx(Button, { onClick: open, children: getLabel("upload_image.label_button") })
|
|
202
|
-
]
|
|
203
|
-
}
|
|
204
|
-
)
|
|
205
|
-
]
|
|
206
|
-
}
|
|
207
|
-
)
|
|
208
|
-
}
|
|
209
|
-
)
|
|
210
|
-
]
|
|
211
|
-
}
|
|
212
|
-
)
|
|
213
|
-
}
|
|
214
|
-
),
|
|
215
|
-
helperText && helperText
|
|
216
|
-
] }) : /* @__PURE__ */ jsx(SkeletonUploadImage, { classes: classes.skeleton })
|
|
217
|
-
}
|
|
218
|
-
);
|
|
219
|
-
}
|
|
220
|
-
function RHFUploadImage({ name, ...other }) {
|
|
221
|
-
const { control, setValue } = useFormContext();
|
|
222
|
-
const handleDrop = useCallback(
|
|
223
|
-
(acceptedFiles) => {
|
|
224
|
-
const file = acceptedFiles[0];
|
|
225
|
-
if (file) {
|
|
226
|
-
setValue(
|
|
227
|
-
name,
|
|
228
|
-
Object.assign(file, {
|
|
229
|
-
preview: URL.createObjectURL(file)
|
|
230
|
-
})
|
|
231
|
-
);
|
|
232
|
-
}
|
|
233
|
-
},
|
|
234
|
-
[setValue]
|
|
235
|
-
);
|
|
236
|
-
return /* @__PURE__ */ jsx(
|
|
237
|
-
Controller,
|
|
238
|
-
{
|
|
239
|
-
name,
|
|
240
|
-
control,
|
|
241
|
-
render: ({ field, fieldState: { error } }) => {
|
|
242
|
-
const checkError = !!error && !field.value;
|
|
243
|
-
return /* @__PURE__ */ jsxs(WrapperRHFUploadImage, { children: [
|
|
244
|
-
/* @__PURE__ */ jsx(UploadImage, { onDrop: handleDrop, error: checkError, ...other, file: field.value }),
|
|
245
|
-
checkError && /* @__PURE__ */ jsx(HelperText, { message: error.message })
|
|
246
|
-
] });
|
|
247
|
-
}
|
|
248
|
-
}
|
|
249
|
-
);
|
|
250
|
-
}
|
|
251
|
-
export {
|
|
252
|
-
RHFUploadImage as R
|
|
253
|
-
};
|