@m4l/components 4.1.9 → 4.2.0
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/components/DynamicFilter/{DynamicFilter-BahzyXJG.js → DynamicFilter-v3KSDetp.js} +1 -1
- package/components/DynamicFilter/subcomponents/DynamicFilterBase/{DynamicFilterBase-C15D4Zhu.js → DynamicFilterBase-BKKR9x6s.js} +1 -1
- package/components/DynamicFilter/subcomponents/PopoverFilter/{PopoverFilter-D-puPgiG.js → PopoverFilter-BwhQfSyo.js} +1 -1
- package/components/ObjectLogs/{index-CwJymQWT.js → index-qB2t03L7.js} +1 -1
- package/components/areas/components/AreasAdmin/{index-9nvjoDoZ.js → index-Jdk8HOci.js} +2 -2
- package/components/areas/components/AreasAdmin/subcomponents/AreaChip/{index-cbG3ZKSy.js → index-DPpEktvU.js} +1 -1
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/{index-V8dlAGS1.js → index-DBibZv7z.js} +1 -1
- package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/{ChipMobile-PIsb7yYr.js → ChipMobile-BQgk7Spx.js} +1 -1
- package/components/maps/components/Map/{Map-B8heev6x.js → Map-Cfa4sxoa.js} +1 -1
- package/components/maps/components/Map/subcomponents/Controls/{index-Ch-2YwkY.js → index-BZHx_MEC.js} +1 -1
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/{index-Bzj01pHo.js → index-DpT-T6mI.js} +1 -1
- package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopRigthTools/subcomponents/MeasureTool/{index-DRRBzj9U.js → index-CcBuNe8O.js} +1 -1
- package/components/maps/components/MapGpsTools/{MapGpsTools-CMucgAvh.js → MapGpsTools-CtqnLHD2.js} +1 -1
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/{index-Czba2iEh.js → index-DOa_sPr5.js} +1 -1
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/{index-D0YvYMiP.js → index-CpGA5Bzh.js} +1 -1
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofenceAddEdit/{styles-G3zCBsBA.js → styles-6aaokEs3.js} +1 -1
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/{useMaster-DLp59aDf.js → useMaster-C_vutXhx.js} +2 -2
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/{useRowActionsGetter-GRv6s2YH.js → useRowActionsGetter-CUSi3eg_.js} +1 -1
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/{index-CswUdg9X.js → index-DBZQJY8J.js} +2 -2
- package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/subcomponents/Filter/{index-BT3ghfe5.js → index-vBwncRFD.js} +1 -1
- package/contexts/RHFormContext/{index-DE-wmCBw.js → index-DJtfB7-U.js} +27 -13
- package/contexts/RHFormContext/index.d.ts +14 -1
- package/contexts/RHFormContext/types.d.ts +7 -1
- package/contexts/index.d.ts +1 -1
- package/index.js +24 -22
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useFlagsPresent, CommonFlags } from "@m4l/core";
|
|
3
3
|
import { D as DynamicFilterProvider } from "./store/DynamicFilterContext--lBOTDWD.js";
|
|
4
|
-
import { D as DynamicFilterBase } from "./subcomponents/DynamicFilterBase/DynamicFilterBase-
|
|
4
|
+
import { D as DynamicFilterBase } from "./subcomponents/DynamicFilterBase/DynamicFilterBase-BKKR9x6s.js";
|
|
5
5
|
function DynamicFilter(props) {
|
|
6
6
|
const hasPresentFlags = useFlagsPresent([CommonFlags.FLAG_DICTIONARY_LOADED]);
|
|
7
7
|
if (!hasPresentFlags) {
|
|
@@ -6,7 +6,7 @@ import { D as DynamicFilterSlots } from "../../slots/SlotsEnum-cawFeNzx.js";
|
|
|
6
6
|
import { I as InputFilter } from "../InputFilter/InputFilter-Bj8INNYl.js";
|
|
7
7
|
import { A as AppliedFilters } from "../AppliedFilters/AppliedFilters-CqdFDKlB.js";
|
|
8
8
|
import { F as FilterActions } from "../FilterActions/FilterActions-Czdl47x4.js";
|
|
9
|
-
import { P as PopoverFilter } from "../PopoverFilter/PopoverFilter-
|
|
9
|
+
import { P as PopoverFilter } from "../PopoverFilter/PopoverFilter-BwhQfSyo.js";
|
|
10
10
|
function DynamicFilterBase() {
|
|
11
11
|
const { ownerState, dataTestId } = useDynamicFilterBase();
|
|
12
12
|
return /* @__PURE__ */ jsx(
|
|
@@ -2,7 +2,7 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { u as usePopoverFilter } from "./usePopoverFilter-BUiOZUV-.js";
|
|
3
3
|
import { D as DataTypeComponent } from "../FieldTypes/DataTypeComponent-B6mD-fVy.js";
|
|
4
4
|
import { P as PopoverStyled, p as PopoverHeaderStyled, q as PopoverHeaderIconStyled, r as PopoverHeaderTitleStyled, s as PopoverContainerFieldsStyled, t as PopoverHeaderActionsStyled } from "../../slots/dynamicFilterSlots-C8IBJUmf.js";
|
|
5
|
-
import { R as RHFormProvider } from "../../../../contexts/RHFormContext/index-
|
|
5
|
+
import { R as RHFormProvider } from "../../../../contexts/RHFormContext/index-DJtfB7-U.js";
|
|
6
6
|
import { A as ActionCancel } from "../../../CommonActions/components/ActionCancel/index-CI0Yqh5P.js";
|
|
7
7
|
import { A as ActionIntro } from "../../../CommonActions/components/ActionIntro/index-CCc2O0ve.js";
|
|
8
8
|
function PopoverFilter() {
|
|
@@ -5,7 +5,7 @@ import { C as Container, A as Actions, G as GridWrapper } from "./styles-PxnVTC5
|
|
|
5
5
|
import { D as DataGrid } from "../DataGrid/index-B4eh2KBx.js";
|
|
6
6
|
import { D as DateFormatter } from "../formatters/DateFormatter/index-CGcRZ8BA.js";
|
|
7
7
|
import { D as DetailFormatter } from "./components/DetailFormatter/index-EcGYfHVI.js";
|
|
8
|
-
import { D as DynamicFilter } from "../DynamicFilter/DynamicFilter-
|
|
8
|
+
import { D as DynamicFilter } from "../DynamicFilter/DynamicFilter-v3KSDetp.js";
|
|
9
9
|
import { T as TEST_PROP_ID } from "../../test/constants_no_mock-CF-669v-.js";
|
|
10
10
|
function ObjectLogs(props) {
|
|
11
11
|
const { resource_id, object_id, dataTestId = "" } = props;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
2
|
import { u as useAreasStore } from "../../hooks/useAreas/index-DosRWKI3.js";
|
|
3
3
|
import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
4
|
-
import { A as AreaChip } from "./subcomponents/AreaChip/index-
|
|
4
|
+
import { A as AreaChip } from "./subcomponents/AreaChip/index-DPpEktvU.js";
|
|
5
5
|
import { shallow } from "zustand/shallow";
|
|
6
6
|
import { A as AreasAdminRoot } from "./styles-BkiAuWPY.js";
|
|
7
7
|
import { a as areasAdminClasses } from "./classes/index-CryauVAw.js";
|
|
8
8
|
import { I as ICONS } from "../../icons-CwFr-alN.js";
|
|
9
9
|
import { S as ScrollBar } from "../../../ScrollBar/index-1MJx3e_h.js";
|
|
10
10
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
11
|
-
import { A as AreaChipMobile } from "./subcomponents/AreaChipMobile/index-
|
|
11
|
+
import { A as AreaChipMobile } from "./subcomponents/AreaChipMobile/index-DBibZv7z.js";
|
|
12
12
|
import { useRef } from "react";
|
|
13
13
|
import { u as useOnClickOutside } from "../../utils/useOnClickOutside/index-B_Odny9h.js";
|
|
14
14
|
import { P as PanelWindowPopUp } from "./subcomponents/PanelWindowPopUp/index-Cm-WpVBD.js";
|
|
@@ -13,7 +13,7 @@ import { C as ChipActionsMobile } from "./subcomponents/ChipActionsMobile/index-
|
|
|
13
13
|
import { useTheme } from "@mui/material";
|
|
14
14
|
import { shallow } from "zustand/shallow";
|
|
15
15
|
import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButton-B3bJhoym.js";
|
|
16
|
-
import { R as RHFormProvider } from "../../../../../../contexts/RHFormContext/index-
|
|
16
|
+
import { R as RHFormProvider } from "../../../../../../contexts/RHFormContext/index-DJtfB7-U.js";
|
|
17
17
|
import { T as Typography } from "../../../../../mui_extended/Typography/Typography-C_rG8K21.js";
|
|
18
18
|
import { R as RHFTextField } from "../../../../../hook-form/RHFTextField/RHFTextField-CLJBIdqH.js";
|
|
19
19
|
import { A as Actions } from "../../../../../CommonActions/components/Actions/index-B4L6Y4pL.js";
|
|
@@ -7,7 +7,7 @@ import { I as ICONS } from "../../../../icons-CwFr-alN.js";
|
|
|
7
7
|
import { useState, useMemo } from "react";
|
|
8
8
|
import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../../dictionary-gOjRdYCc.js";
|
|
9
9
|
import { useTheme } from "@mui/material";
|
|
10
|
-
import { C as ChipMobile } from "./subcomponents/ChipMobile/ChipMobile-
|
|
10
|
+
import { C as ChipMobile } from "./subcomponents/ChipMobile/ChipMobile-BQgk7Spx.js";
|
|
11
11
|
import { M as MenuActions } from "../../../../../mui_extended/MenuActions/MenuActions-Dxsk2iZ_.js";
|
|
12
12
|
import { B as Button } from "../../../../../mui_extended/Button/Button-BdusSjEV.js";
|
|
13
13
|
import { I as Icon } from "../../../../../Icon/Icon-BV4VaWM4.js";
|
|
@@ -14,7 +14,7 @@ import { I as ICONS } from "../../../../../../icons-CwFr-alN.js";
|
|
|
14
14
|
import { C as ChipActionsMobile } from "../../../AreaChip/subcomponents/ChipActionsMobile/index-DG8rtyb1.js";
|
|
15
15
|
import { E as EditAreaHeader } from "../../../AreaChip/styles-CScNS_dH.js";
|
|
16
16
|
import { I as IconButton } from "../../../../../../../mui_extended/IconButton/IconButton-B3bJhoym.js";
|
|
17
|
-
import { R as RHFormProvider } from "../../../../../../../../contexts/RHFormContext/index-
|
|
17
|
+
import { R as RHFormProvider } from "../../../../../../../../contexts/RHFormContext/index-DJtfB7-U.js";
|
|
18
18
|
import { T as Typography } from "../../../../../../../mui_extended/Typography/Typography-C_rG8K21.js";
|
|
19
19
|
import { A as Actions } from "../../../../../../../CommonActions/components/Actions/index-B4L6Y4pL.js";
|
|
20
20
|
import { A as ActionCancel } from "../../../../../../../CommonActions/components/ActionCancel/index-CI0Yqh5P.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
2
|
import { T as TileLayers } from "./subcomponents/TileLayers/index-p7XmQ2he.js";
|
|
3
|
-
import { C as Controls } from "./subcomponents/Controls/index-
|
|
3
|
+
import { C as Controls } from "./subcomponents/Controls/index-BZHx_MEC.js";
|
|
4
4
|
import { L as LayersContainer } from "./subcomponents/LayersContainer/index-tYTwy6xC.js";
|
|
5
5
|
import { m as mapClasses } from "./classes/index-Di523KHt.js";
|
|
6
6
|
import { M as MapRootStyled } from "./slots/MapSlots-DpFp1Bkq.js";
|
|
@@ -3,7 +3,7 @@ import { useState, useEffect } from "react";
|
|
|
3
3
|
import { createPortal } from "react-dom";
|
|
4
4
|
import L__default from "leaflet";
|
|
5
5
|
import { useMap } from "react-leaflet";
|
|
6
|
-
import { T as TopRightTools } from "./subcomponents/TopRigthTools/index-
|
|
6
|
+
import { T as TopRightTools } from "./subcomponents/TopRigthTools/index-DpT-T6mI.js";
|
|
7
7
|
import { T as TopLeftTools } from "./subcomponents/TopLeftTools/index-be-jfACS.js";
|
|
8
8
|
import { b as MAP_ZINDEX_OVER_MAP } from "../../constants--nCJwhxA.js";
|
|
9
9
|
import { P as PopupsProvider } from "../../../../../popups/components/PopupsProvider/contexts/PopupsContext/PopupsContext-CahdzSly.js";
|
|
@@ -3,7 +3,7 @@ import { useEnvironment, useModuleDictionary } from "@m4l/core";
|
|
|
3
3
|
import { useMap } from "react-leaflet";
|
|
4
4
|
import { shallow } from "zustand/shallow";
|
|
5
5
|
import { C as Control } from "../../../../external/Control/index-B9L3AeDC.js";
|
|
6
|
-
import { M as MeasureTool } from "./subcomponents/MeasureTool/index-
|
|
6
|
+
import { M as MeasureTool } from "./subcomponents/MeasureTool/index-CcBuNe8O.js";
|
|
7
7
|
import { Z as ZoomButtons } from "./subcomponents/ZoomButtons/index-zll-PWuG.js";
|
|
8
8
|
import { M as MAP_ICONS } from "../../../../icons-CSYh7uR4.js";
|
|
9
9
|
import { M as MAP_DICCTIONARY } from "../../../../dictionary-DMmTydS6.js";
|
|
@@ -6,7 +6,7 @@ import { M as MeasureData } from "./subcomponents/MeasureData/index-CjUVLTHr.js"
|
|
|
6
6
|
import { useModuleDictionary } from "@m4l/core";
|
|
7
7
|
import { M as MAP_DICCTIONARY } from "../../../../../../dictionary-DMmTydS6.js";
|
|
8
8
|
import { m as mapClasses } from "../../../../../../classes/index-Di523KHt.js";
|
|
9
|
-
import { R as RHFormProvider } from "../../../../../../../../../../contexts/RHFormContext/index-
|
|
9
|
+
import { R as RHFormProvider } from "../../../../../../../../../../contexts/RHFormContext/index-DJtfB7-U.js";
|
|
10
10
|
import { S as Stack } from "../../../../../../../../../mui_extended/Stack/Stack-C79qEBpg.js";
|
|
11
11
|
function MeasureTool() {
|
|
12
12
|
const { getLabel } = useModuleDictionary();
|
package/components/maps/components/MapGpsTools/{MapGpsTools-CMucgAvh.js → MapGpsTools-CtqnLHD2.js}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useModuleSkeleton } from "@m4l/core";
|
|
3
|
-
import { T as TabsGpsTools } from "./subcomponents/TabsGpsTools/index-
|
|
3
|
+
import { T as TabsGpsTools } from "./subcomponents/TabsGpsTools/index-DOa_sPr5.js";
|
|
4
4
|
function MapGpsTools() {
|
|
5
5
|
const isSkeleton = useModuleSkeleton();
|
|
6
6
|
return !isSkeleton && /* @__PURE__ */ jsx(TabsGpsTools, {});
|
|
@@ -8,7 +8,7 @@ import "@geoman-io/leaflet-geoman-free";
|
|
|
8
8
|
import clsx from "clsx";
|
|
9
9
|
import { D as DivTabGpsToolsRoot } from "../../styles-Dcg_ULaS.js";
|
|
10
10
|
import { T as Tab } from "../../../../../mui_extended/Tab/index-BwGxBuKl.js";
|
|
11
|
-
import { G as GeofencesList } from "./subcomponents/GeofencesList/index-
|
|
11
|
+
import { G as GeofencesList } from "./subcomponents/GeofencesList/index-DBZQJY8J.js";
|
|
12
12
|
import { u as useLayers } from "../../hooks/useLayers/index-BqucFfYk.js";
|
|
13
13
|
import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../dictionary-BOXSG1O8.js";
|
|
14
14
|
import { g as gpsToolsClasses } from "../../classes/index-oE5Q9Oa0.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { R as RHFormProviderStyled } from "./styles-
|
|
2
|
+
import { R as RHFormProviderStyled } from "./styles-6aaokEs3.js";
|
|
3
3
|
import { T as TabProvider } from "../../../../../../../mui_extended/TabContext/index-fsl0KiAB.js";
|
|
4
4
|
import { M as MyActions } from "./subcomponents/MyActions/index-8qnFKiN-.js";
|
|
5
5
|
import { M as MyTabs } from "./subcomponents/MyTabs/index-P-e27Hqi.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { styled } from "@mui/material/styles";
|
|
2
|
-
import { R as RHFormProvider } from "../../../../../../../../contexts/RHFormContext/index-
|
|
2
|
+
import { R as RHFormProvider } from "../../../../../../../../contexts/RHFormContext/index-DJtfB7-U.js";
|
|
3
3
|
const RHFormProviderStyled = styled(RHFormProvider)`
|
|
4
4
|
${(props) => props.theme.components?.M4LMapGpsToolsGeofencesAddEdit?.styleOverrides}
|
|
5
5
|
`;
|
|
@@ -2,12 +2,12 @@ import { jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useCallback, useState, useEffect } from "react";
|
|
3
3
|
import { useModuleDictionary, useEnvironment, usePaginate } from "@m4l/core";
|
|
4
4
|
import { u as useColumns } from "./useColumns-joQU1eqZ.js";
|
|
5
|
-
import { u as useRowActionsGetter } from "./useRowActionsGetter-
|
|
5
|
+
import { u as useRowActionsGetter } from "./useRowActionsGetter-CUSi3eg_.js";
|
|
6
6
|
import { u as useCheckedGeofences } from "./useCheckedGeofences-aqOGX--1.js";
|
|
7
7
|
import { u as useCheckedFeatures } from "./useCheckedFeatures-BftLgiVe.js";
|
|
8
8
|
import { G as GeofencesFeaturesLayers } from "../../constants-BruLA0T6.js";
|
|
9
9
|
import { shallow } from "zustand/shallow";
|
|
10
|
-
import { G as GeofenceAddEdit } from "../../GeofenceAddEdit/index-
|
|
10
|
+
import { G as GeofenceAddEdit } from "../../GeofenceAddEdit/index-CpGA5Bzh.js";
|
|
11
11
|
import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../../../../dictionary-BOXSG1O8.js";
|
|
12
12
|
import { M as MAP_GPSTOOLS_ICONS } from "../../../../../icons-BXKX8nl1.js";
|
|
13
13
|
import { u as usePopupsStore } from "../../../../../../../../popups/components/PopupsProvider/hooks/usePopupsStore/index-DBMhBXk-.js";
|
|
@@ -6,7 +6,7 @@ import { useResponsiveDesktop } from "@m4l/graphics";
|
|
|
6
6
|
import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../../../../dictionary-BOXSG1O8.js";
|
|
7
7
|
import { u as useModal } from "../../../../../../../../../hooks/useModal/index-DkNYHw5Z.js";
|
|
8
8
|
import { shallow } from "zustand/shallow";
|
|
9
|
-
import { G as GeofenceAddEdit } from "../../GeofenceAddEdit/index-
|
|
9
|
+
import { G as GeofenceAddEdit } from "../../GeofenceAddEdit/index-CpGA5Bzh.js";
|
|
10
10
|
import { u as usePopupsStore } from "../../../../../../../../popups/components/PopupsProvider/hooks/usePopupsStore/index-DBMhBXk-.js";
|
|
11
11
|
import { u as useMapGpsToolsStore } from "../../../../../hooks/useMapGpsToolsStore/index-DCjjIsPI.js";
|
|
12
12
|
import { W as WindowConfirm } from "../../../../../../../../modal/WindowConfirm/index-Du4Wb6aF.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
-
import { F as Filter } from "./subcomponents/Filter/index-
|
|
3
|
-
import { u as useMaster } from "./hooks/useMaster-
|
|
2
|
+
import { F as Filter } from "./subcomponents/Filter/index-vBwncRFD.js";
|
|
3
|
+
import { u as useMaster } from "./hooks/useMaster-C_vutXhx.js";
|
|
4
4
|
import { g as gpsToolsClasses } from "../../../../classes/index-oE5Q9Oa0.js";
|
|
5
5
|
import { S as StackGeofenceListRoot } from "./styles-x5ildRoz.js";
|
|
6
6
|
import { useModuleDictionary } from "@m4l/core";
|
|
@@ -4,7 +4,7 @@ import { M as MAP_GPSTOOLS_DICCTIONARY } from "../../../../../../dictionary-BOXS
|
|
|
4
4
|
import { useState } from "react";
|
|
5
5
|
import { c as COMPONENT_MAP_TOOLS_ID } from "../../../../../../constants-BtQVGkL6.js";
|
|
6
6
|
import { M as MAP_GPSTOOLS_ICONS } from "../../../../../../icons-BXKX8nl1.js";
|
|
7
|
-
import { D as DynamicFilter } from "../../../../../../../../../DynamicFilter/DynamicFilter-
|
|
7
|
+
import { D as DynamicFilter } from "../../../../../../../../../DynamicFilter/DynamicFilter-v3KSDetp.js";
|
|
8
8
|
function Filter(props) {
|
|
9
9
|
const { refresh, setBackendQueryParams } = props;
|
|
10
10
|
const { host_static_assets, environment_assets } = useEnvironment();
|
|
@@ -6,9 +6,8 @@ import { yupResolver } from "@hookform/resolvers/yup";
|
|
|
6
6
|
import { F as FormProviderRoot } from "./styles-DAsa8vSY.js";
|
|
7
7
|
import { R as RHFormProviderUtilityClasses } from "./classes/index-CXQ6_8rw.js";
|
|
8
8
|
const classes = RHFormProviderUtilityClasses();
|
|
9
|
-
function
|
|
10
|
-
const
|
|
11
|
-
const methods = useForm({
|
|
9
|
+
function useCustomForm({ validationSchema, values, statusLoad }) {
|
|
10
|
+
const formMethods = useForm({
|
|
12
11
|
resolver: yupResolver(validationSchema),
|
|
13
12
|
defaultValues: values
|
|
14
13
|
});
|
|
@@ -16,34 +15,49 @@ function RHFormProvider(props) {
|
|
|
16
15
|
if (statusLoad === "reload_values_provider") {
|
|
17
16
|
const keys = Object.keys(values);
|
|
18
17
|
keys.forEach((key) => {
|
|
19
|
-
|
|
18
|
+
formMethods.setValue(key, values[key], {
|
|
20
19
|
shouldValidate: false,
|
|
21
20
|
shouldDirty: false,
|
|
22
21
|
shouldTouch: false
|
|
23
22
|
});
|
|
24
23
|
});
|
|
25
|
-
|
|
24
|
+
formMethods.clearErrors();
|
|
26
25
|
return;
|
|
27
26
|
}
|
|
28
|
-
}, [
|
|
27
|
+
}, [formMethods, statusLoad, values]);
|
|
29
28
|
useEffect(() => {
|
|
30
29
|
if (statusLoad === "ready") {
|
|
31
|
-
|
|
30
|
+
formMethods.setValue("statusLoad", "ready", {
|
|
32
31
|
shouldValidate: false,
|
|
33
32
|
shouldDirty: false,
|
|
34
33
|
shouldTouch: false
|
|
35
34
|
});
|
|
36
35
|
}
|
|
37
36
|
}, [statusLoad]);
|
|
38
|
-
return
|
|
39
|
-
|
|
37
|
+
return formMethods;
|
|
38
|
+
}
|
|
39
|
+
function FormProviderCustom(props) {
|
|
40
|
+
const { children, onSubmit, className, handleSubmit } = props;
|
|
41
|
+
return /* @__PURE__ */ jsx(FormProvider, { ...props, children: /* @__PURE__ */ jsx(FormProviderRoot, { className: clsx(classes.root, className), onSubmit: handleSubmit(onSubmit), children }) });
|
|
42
|
+
}
|
|
43
|
+
function RHFormProvider(props) {
|
|
44
|
+
const { children, onSubmit, values, validationSchema, statusLoad = "ready", className } = props;
|
|
45
|
+
const formMethods = useCustomForm({ validationSchema, statusLoad, values });
|
|
46
|
+
return /* @__PURE__ */ jsx(
|
|
47
|
+
FormProviderCustom,
|
|
40
48
|
{
|
|
41
|
-
className
|
|
42
|
-
|
|
49
|
+
className,
|
|
50
|
+
values,
|
|
51
|
+
validationSchema,
|
|
52
|
+
statusLoad,
|
|
53
|
+
onSubmit,
|
|
54
|
+
...formMethods,
|
|
43
55
|
children
|
|
44
56
|
}
|
|
45
|
-
)
|
|
57
|
+
);
|
|
46
58
|
}
|
|
47
59
|
export {
|
|
48
|
-
|
|
60
|
+
FormProviderCustom as F,
|
|
61
|
+
RHFormProvider as R,
|
|
62
|
+
useCustomForm as u
|
|
49
63
|
};
|
|
@@ -1,2 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { CustomFormArguments, FormProviderCustomProps, FormProviderProps } from './types';
|
|
3
|
+
export declare function useCustomForm({ validationSchema, values, statusLoad }: CustomFormArguments): import("react-hook-form").UseFormReturn<FieldValues, any, undefined>;
|
|
4
|
+
export declare function FormProviderCustom(props: FormProviderCustomProps): import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
/**
|
|
6
|
+
* Componente que gestiona el `Provider` de `react-hook-form` y encapsula el formulario para la creación de formularios personalizados.
|
|
7
|
+
*
|
|
8
|
+
* Este componente utiliza internamente `useForm` para inicializar todos los métodos necesarios para la manipulación del formulario.
|
|
9
|
+
*
|
|
10
|
+
* Si necesitas acceder directamente a los métodos de `useForm`, puedes utilizar el `Provider` y el hook por separado mediante
|
|
11
|
+
* `FormProviderCustom` y `useCustomForm`, respectivamente.
|
|
12
|
+
* @param props
|
|
13
|
+
* @constructor
|
|
14
|
+
*/
|
|
2
15
|
export declare function RHFormProvider(props: FormProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
-
import { FieldValues } from 'react-hook-form';
|
|
2
|
+
import { FieldValues, FormProviderProps as RHFormProviderProps } from 'react-hook-form';
|
|
3
3
|
export declare type FormStatusLoad = 'initial' | 'new' | 'edit' | 'reload_values_provider' | 'ready' | 'error';
|
|
4
4
|
export declare type FormInitialValues = FieldValues;
|
|
5
5
|
export interface FormProviderProps {
|
|
@@ -10,3 +10,9 @@ export interface FormProviderProps {
|
|
|
10
10
|
statusLoad?: FormStatusLoad;
|
|
11
11
|
className?: string;
|
|
12
12
|
}
|
|
13
|
+
export declare type FormProviderCustomProps = RHFormProviderProps & FormProviderProps;
|
|
14
|
+
export interface CustomFormArguments {
|
|
15
|
+
values: FormInitialValues;
|
|
16
|
+
validationSchema: any;
|
|
17
|
+
statusLoad?: FormStatusLoad;
|
|
18
|
+
}
|
package/contexts/index.d.ts
CHANGED
|
@@ -2,6 +2,6 @@ export { DynamicMFParmsProvider, DynamicMFParmsContext, MemonizedDynamicMFParmsP
|
|
|
2
2
|
export * from './ModalContext/index';
|
|
3
3
|
export * from './ModalContext/types';
|
|
4
4
|
export type { FormInitialValues, FormStatusLoad } from './RHFormContext/types';
|
|
5
|
-
export { RHFormProvider } from './RHFormContext';
|
|
5
|
+
export { RHFormProvider, FormProviderCustom, useCustomForm } from './RHFormContext';
|
|
6
6
|
export { getFormComponentsDictionary } from './RHFormContext/dictionary';
|
|
7
7
|
export { useAppearanceComponentStore, AppearanceComponentProvider, } from './AppearanceComponentContext';
|
package/index.js
CHANGED
|
@@ -16,7 +16,7 @@ import { v } from "./components/animate/variants/fade-CAOJNn06.js";
|
|
|
16
16
|
import { v as v2 } from "./components/animate/variants/bounce-DanQqHAX.js";
|
|
17
17
|
import { v as v3 } from "./components/animate/variants/container-Dmpr6tg5.js";
|
|
18
18
|
import { v as v4, a, b } from "./components/animate/variants/transition-B9W5SWTa.js";
|
|
19
|
-
import { A as A2 } from "./components/areas/components/AreasAdmin/index-
|
|
19
|
+
import { A as A2 } from "./components/areas/components/AreasAdmin/index-Jdk8HOci.js";
|
|
20
20
|
import { A as A3 } from "./components/areas/components/AreasViewer/index-DDhTc-L_.js";
|
|
21
21
|
import { a as a2, W } from "./components/areas/contexts/WindowToolsMFContext/index-DkE30fhm.js";
|
|
22
22
|
import { c as c2 } from "./components/areas/contexts/DynamicMFParmsContext/store-8_SPgo06.js";
|
|
@@ -61,7 +61,7 @@ import { C as C8 } from "./components/DataGrid/formatters/ColumnPriceFormatter/i
|
|
|
61
61
|
import { C as C9 } from "./components/DataGrid/formatters/ColumnInteractiveCheckFormatter/index-8LLfJGSu.js";
|
|
62
62
|
import { C as C10 } from "./components/DataGrid/formatters/ColumnSetCheckFormatter/index-FMaDuDoo.js";
|
|
63
63
|
import { a as a5 } from "./components/DynamicFilter/dictionary-CNZO5wD-.js";
|
|
64
|
-
import { D as D4 } from "./components/DynamicFilter/DynamicFilter-
|
|
64
|
+
import { D as D4 } from "./components/DynamicFilter/DynamicFilter-v3KSDetp.js";
|
|
65
65
|
import { F } from "./components/FieldLabel/FieldLabel-B2BhuYxm.js";
|
|
66
66
|
import { e } from "./components/HelperText/utils/Clases/index-BHBSnukJ.js";
|
|
67
67
|
import { H } from "./components/HelperText/index-DZCj76Dl.js";
|
|
@@ -83,11 +83,11 @@ import { L as L3 } from "./components/LanguagePopover/LanguagePopover-YmHJMFsY.j
|
|
|
83
83
|
import { L as L4 } from "./components/LinearProgressIndeterminate/LinearProgressIndeterminate--VicNz4N.js";
|
|
84
84
|
import { I as I3 } from "./components/Image/Image-BjqOt3pz.js";
|
|
85
85
|
import { L as L5 } from "./components/Loadable/index-aNEylxCd.js";
|
|
86
|
-
import { M as M3 } from "./components/maps/components/MapGpsTools/MapGpsTools-
|
|
86
|
+
import { M as M3 } from "./components/maps/components/MapGpsTools/MapGpsTools-CtqnLHD2.js";
|
|
87
87
|
import { u as u4 } from "./components/maps/components/MapGpsTools/hooks/useMapGpsToolsStore/index-DCjjIsPI.js";
|
|
88
88
|
import { a as a6 } from "./components/maps/components/MapGpsTools/contexts/MapGpsToolsContext/index-DtJv8-7m.js";
|
|
89
89
|
import { g as g17 } from "./components/maps/components/MapGpsTools/dictionary-BOXSG1O8.js";
|
|
90
|
-
import { M as M4 } from "./components/maps/components/Map/Map-
|
|
90
|
+
import { M as M4 } from "./components/maps/components/Map/Map-Cfa4sxoa.js";
|
|
91
91
|
import { M as M5, a as a7 } from "./components/maps/components/Map/contexts/MapContext/MapContext-CRsX00bx.js";
|
|
92
92
|
import { u as u5 } from "./components/maps/components/Map/hooks/useMapStore/index-1eqb58ec.js";
|
|
93
93
|
import { g as g18 } from "./components/maps/components/Map/dictionary-DMmTydS6.js";
|
|
@@ -113,7 +113,7 @@ import { M as M9 } from "./components/MFLoader/MFLoader-DGyI0TI-.js";
|
|
|
113
113
|
import { g as g23 } from "./components/MFLoader/dictionary-CXND9TXx.js";
|
|
114
114
|
import { N as N3 } from "./components/NoItemSelected/index-M2NHb7cH.js";
|
|
115
115
|
import { d as d5, g as g24 } from "./components/NoItemSelected/dictionary-DhPDgHyg.js";
|
|
116
|
-
import { O } from "./components/ObjectLogs/index-
|
|
116
|
+
import { O } from "./components/ObjectLogs/index-qB2t03L7.js";
|
|
117
117
|
import { d as d6, g as g25 } from "./components/ObjectLogs/dictionary-DwDsJzPq.js";
|
|
118
118
|
import { P as P7 } from "./components/PaperForm/PaperForm-B_0YMPq6.js";
|
|
119
119
|
import { P as P8 } from "./components/PDFViewer/PDFViewer-qhATZVpK.js";
|
|
@@ -168,19 +168,19 @@ import { T as T10 } from "./components/mui_extended/Typography/Typography-C_rG8K
|
|
|
168
168
|
import { T as T11 } from "./components/mui_extended/ToggleButton/ToggleButton-Bcdm1gSN.js";
|
|
169
169
|
import { T as T12 } from "./components/mui_extended/ToggleIconButton/ToggleIconButton-DEvsd9LS.js";
|
|
170
170
|
import { a as a12, D as D6, M as M12 } from "./components/areas/contexts/DynamicMFParmsContext/index-SHbC_49A.js";
|
|
171
|
-
import { R as R16 } from "./contexts/RHFormContext/index-
|
|
171
|
+
import { F as F2, R as R16, u as u7 } from "./contexts/RHFormContext/index-DJtfB7-U.js";
|
|
172
172
|
import { g as g29 } from "./contexts/RHFormContext/dictionary-Dsuwh7PB.js";
|
|
173
|
-
import { u as
|
|
173
|
+
import { u as u8 } from "./contexts/AppearanceComponentContext/useAppearanceComponentStore-Cn0YUt4u.js";
|
|
174
174
|
import { A as A16 } from "./contexts/AppearanceComponentContext/AppearanceComponentContext-Dh1xxcRq.js";
|
|
175
175
|
import { a as a13, M as M13 } from "./contexts/ModalContext/index-BZQsMljQ.js";
|
|
176
|
-
import { u as
|
|
177
|
-
import { u as
|
|
178
|
-
import { u as
|
|
176
|
+
import { u as u9 } from "./hooks/useFormAddEdit/index-B-hEaKJy.js";
|
|
177
|
+
import { u as u10 } from "./hooks/useModal/index-DkNYHw5Z.js";
|
|
178
|
+
import { u as u11 } from "./hooks/useTab/index-CRVh_6kE.js";
|
|
179
179
|
import { g as g30 } from "./hooks/useFormAddEdit/dictionary-DFRDT91K.js";
|
|
180
|
-
import { u as
|
|
181
|
-
import { u as
|
|
182
|
-
import { u as
|
|
183
|
-
import { u as
|
|
180
|
+
import { u as u12 } from "./hooks/useFormFocus/index-B1F2sySJ.js";
|
|
181
|
+
import { u as u13 } from "./hooks/useInterval/index-U86sMsvn.js";
|
|
182
|
+
import { u as u14 } from "./hooks/useComponentSize/useComponentSize-IEs8SldY.js";
|
|
183
|
+
import { u as u15 } from "./hooks/useSvgColor/useSvgColor-fM-5zMjL.js";
|
|
184
184
|
export {
|
|
185
185
|
A5 as AREAS_DICCTIONARY,
|
|
186
186
|
a4 as AREAS_DICTIONARY_ID,
|
|
@@ -227,6 +227,7 @@ export {
|
|
|
227
227
|
a12 as DynamicMFParmsContext,
|
|
228
228
|
D6 as DynamicMFParmsProvider,
|
|
229
229
|
F as FieldLabel,
|
|
230
|
+
F2 as FormProviderCustom,
|
|
230
231
|
G as GridLayout,
|
|
231
232
|
H3 as HamburgerMenu,
|
|
232
233
|
H2 as HelmetPage,
|
|
@@ -373,19 +374,20 @@ export {
|
|
|
373
374
|
i3 as isFeatureCollection,
|
|
374
375
|
i4 as isFeatureCollectionDraft,
|
|
375
376
|
i5 as isGeometry,
|
|
376
|
-
|
|
377
|
-
|
|
377
|
+
u8 as useAppearanceComponentStore,
|
|
378
|
+
u14 as useComponentSize,
|
|
379
|
+
u7 as useCustomForm,
|
|
378
380
|
u as useDynamicMFParametersStore,
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
381
|
+
u9 as useFormAddEdit,
|
|
382
|
+
u12 as useFormFocus,
|
|
383
|
+
u13 as useInterval,
|
|
382
384
|
u4 as useMapGpsToolsStore,
|
|
383
385
|
u5 as useMapStore,
|
|
384
|
-
|
|
386
|
+
u10 as useModal,
|
|
385
387
|
u6 as usePopupsStore,
|
|
386
388
|
u3 as useSetWindowsTitle,
|
|
387
|
-
|
|
388
|
-
|
|
389
|
+
u15 as useSvgColor,
|
|
390
|
+
u11 as useTab,
|
|
389
391
|
u2 as useWindowToolsMF,
|
|
390
392
|
v2 as varBounce,
|
|
391
393
|
v3 as varContainer,
|