@m4l/components 0.2.25 → 0.2.27
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/@types/export.d.ts +3 -0
- package/components/AccountPopover/{index.505e278a.js → index.3994a80b.js} +2 -2
- package/components/AppBar/{index.7106417d.js → index.23323f96.js} +3 -4
- package/components/CommonActions/components/ActionCancel/{index.de862adf.js → index.bd767c14.js} +2 -2
- package/components/CommonActions/components/ActionFormCancel/{index.3fd5c858.js → index.d737bddc.js} +4 -4
- package/components/CommonActions/components/ActionFormIntro/{index.07394f62.js → index.d5b80747.js} +2 -2
- package/components/CommonActions/components/ActionIntro/{index.79fc2386.js → index.9bd56cd0.js} +2 -2
- package/components/CommonActions/components/Actions/{index.2f6286eb.js → index.16946bfd.js} +12 -13
- package/components/DataGrid/formatters/ColumnBooleanFormatter/{index.36270dd1.js → index.29cf6542.js} +1 -1
- package/components/DataGrid/formatters/ColumnConcatenatedValueFormatter/{index.8b008692.js → index.2c4fd22e.js} +1 -1
- package/components/DataGrid/formatters/ColumnInteractiveCheckFormatter/{index.cb308086.js → index.e30c976f.js} +1 -1
- package/components/DataGrid/formatters/ColumnPointsFormatter/{index.f3d6036f.js → index.4335c26b.js} +1 -1
- package/components/DataGrid/{index.b1eafce1.js → index.a3792770.js} +4 -5
- package/components/DataGrid/subcomponents/Actions/{index.9af87fa1.js → index.a317b384.js} +11 -12
- package/components/DataGrid/subcomponents/editors/TextEditor/{index.91380a55.js → index.eac1749c.js} +12 -1
- package/components/DragResizeWindow/{index.051c743d.js → index.bf1a4a47.js} +2 -3
- package/components/DynamicFilter/{index.b93e5649.js → index.cce92677.js} +19 -17
- package/components/FieldLabel/FieldLabel.d.ts +2 -0
- package/components/FieldLabel/classes/constants.d.ts +1 -0
- package/components/FieldLabel/classes/index.d.ts +10 -0
- package/components/FieldLabel/classes/types.d.ts +11 -0
- package/components/FieldLabel/index.8d3d6bb4.js +82 -0
- package/components/FieldLabel/index.d.ts +1 -0
- package/components/FieldLabel/types.d.ts +8 -0
- package/components/GridLayout/subcomponents/Responsive/{index.0fd1b7f8.js → index.d2ec9ddb.js} +1 -0
- package/components/GridLayout/subcomponents/SizeProvider/{index.7669a2cd.js → index.06986ab4.js} +9 -5
- package/components/HamburgerMenu/{index.25029e23.js → index.06905db3.js} +2 -2
- package/components/Icon/{index.b920baf8.js → index.58eaf354.js} +8 -48
- package/components/Icon/types.d.ts +0 -5
- package/components/Image/classes/index.d.ts +7 -0
- package/components/Image/{utils/classes → classes}/types.d.ts +0 -5
- package/components/Image/index.fa98eb78.js +203 -0
- package/components/Image/tests/utils.d.ts +1 -1
- package/components/Image/types.d.ts +3 -43
- package/components/LanguagePopover/{index.e54c5cc7.js → index.2740fb8e.js} +3 -4
- package/components/LoadingError/{index.123e16f8.js → index.4f4724c4.js} +2 -2
- package/components/MFLoader/{index.52096ea5.js → index.f6a46c70.js} +1 -1
- package/components/ModalDialog/{index.2e931b5f.js → index.86de725b.js} +3 -3
- package/components/NoItemSelected/{index.1024b856.js → index.aa3679f1.js} +2 -3
- package/components/ObjectLogs/{index.d10f4a2f.js → index.0e365006.js} +7 -8
- package/components/PDFViewer/{index.98852f91.js → index.85d4e010.js} +1 -1
- package/components/Page/{index.def863f2.js → index.aa33f20b.js} +1 -1
- package/components/PaperForm/{index.8a617a66.js → index.b6811634.js} +2 -3
- package/components/Period/classes/index.d.ts +3 -1
- package/components/Period/classes/types.d.ts +6 -1
- package/components/Period/{index.d80dff10.js → index.ba79014c.js} +76 -61
- package/components/Period/subcomponents/SkeletonPeriod/index.d.ts +2 -0
- package/components/Period/subcomponents/SkeletonPeriod/types.d.ts +4 -0
- package/components/Period/types.d.ts +4 -1
- package/components/PrintingSystem/{index.2e17cae5.js → index.b3ed9375.js} +14 -14
- package/components/PrintingSystem/subcomponents/BodyNode/{index.c5ffe20a.js → index.7a5c7bdd.js} +1 -1
- package/components/PrintingSystem/subcomponents/ChartNode/{index.020c037c.js → index.85914c4b.js} +1 -1
- package/components/PrintingSystem/subcomponents/DividerNode/{index.78b023bb.js → index.45284722.js} +1 -1
- package/components/PrintingSystem/subcomponents/FooterNode/{index.b29fc1e9.js → index.a83e65dc.js} +1 -1
- package/components/PrintingSystem/subcomponents/GridNode/{index.11626284.js → index.cb7d0af9.js} +1 -1
- package/components/PrintingSystem/subcomponents/HeaderNode/{index.ef44c8ab.js → index.d67484e5.js} +1 -1
- package/components/PrintingSystem/subcomponents/PaperNode/{index.d72d224b.js → index.ab17815a.js} +1 -1
- package/components/PrintingSystem/subcomponents/PropertyValueNode/{index.8e53440c.js → index.8a2617ae.js} +1 -1
- package/components/PrintingSystem/subcomponents/SectionNode/{index.0b66458e.js → index.2c52ee12.js} +1 -1
- package/components/PrintingSystem/subcomponents/TextBoxNode/{index.b4c72fef.js → index.f0ac0243.js} +1 -1
- package/components/PropertyValue/{index.3b6670d4.js → index.a3527d10.js} +2 -3
- package/components/Resizeable/{index.0eb66c37.js → index.8db8f77d.js} +1 -1
- package/components/ScrollBar/{index.010f1b9d.js → index.7dfc2f29.js} +4 -3
- package/components/ScrollBar/index.d.ts +2 -2
- package/components/SideBar/classes/index.d.ts +7 -2
- package/components/SideBar/classes/types.d.ts +6 -1
- package/components/SideBar/constants.d.ts +2 -0
- package/components/SideBar/context/sideBarContext/types.d.ts +3 -1
- package/components/SideBar/{index.cdb70977.js → index.0d49daff.js} +255 -427
- package/components/SideBar/subcomponents/ContentDesktop/subcomponents/CollapseButton/index.d.ts +1 -1
- package/components/SideBar/subcomponents/ContentDesktop/subcomponents/ContentComponent/index.d.ts +1 -0
- package/components/SideBar/types.d.ts +1 -4
- package/components/SplitLayout/{index.30fd5861.js → index.3856385c.js} +1 -2
- package/components/ToastContainer/{index.97fdba82.js → index.b42aca02.js} +2 -2
- package/components/areas/components/AreasAdmin/{index.e4f0ccc1.js → index.6d902d47.js} +17 -18
- package/components/areas/components/AreasViewer/{index.f87c63ca.js → index.2a286dfa.js} +120 -221
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowHeaderSkeleton/index.d.ts +2 -0
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowHeaderSkeleton/types.d.ts +3 -0
- package/components/areas/contexts/AreasContext/helper.d.ts +2 -2
- package/components/areas/contexts/AreasContext/{index.3e3d8c62.js → index.3eb6b2a4.js} +5 -5
- package/components/areas/hooks/useAreas/{index.b18fe111.js → index.febe901b.js} +1 -1
- package/components/commercial/TopBar/{index.8e2163f7.js → index.08853566.js} +5 -18
- package/components/formatters/BooleanFormatter/{index.b3052107.js → index.4bb3d2f9.js} +2 -2
- package/components/formatters/PointsFormatter/{index.5c94c5e8.js → index.8a4fa393.js} +4 -4
- package/components/formatters/{index.95cc337e.js → index.3e9e2305.js} +1 -1
- package/components/hook-form/RHFAutocomplete/classes/types.d.ts +1 -0
- package/components/hook-form/RHFAutocomplete/{index.cf399b24.js → index.f9be5465.js} +41 -23
- package/components/hook-form/RHFAutocomplete/types.d.ts +7 -7
- package/components/hook-form/RHFAutocompleteAsync/{index.b2b75475.js → index.c01fd38a.js} +2 -3
- package/components/hook-form/RHFCheckbox/classes/types.d.ts +2 -0
- package/components/hook-form/RHFCheckbox/{index.a38715e3.js → index.4f650b78.js} +37 -10
- package/components/hook-form/RHFCheckbox/types.d.ts +4 -1
- package/components/hook-form/RHFColorPicker/RFHColorPicker.d.ts +8 -0
- package/components/hook-form/RHFColorPicker/classes/index.d.ts +2 -1
- package/components/hook-form/RHFColorPicker/classes/types.d.ts +4 -0
- package/components/hook-form/RHFColorPicker/dictionary.d.ts +1 -0
- package/components/hook-form/RHFColorPicker/index.5be9e237.js +206 -0
- package/components/hook-form/RHFColorPicker/index.d.ts +2 -8
- package/components/hook-form/RHFColorPicker/subcomponents/Skeleton/indext.d.ts +2 -1
- package/components/hook-form/RHFColorPicker/subcomponents/Skeleton/types.d.ts +3 -0
- package/components/hook-form/RHFColorPicker/types.d.ts +13 -2
- package/components/hook-form/RHFDateTime/classes/types.d.ts +3 -0
- package/components/hook-form/RHFDateTime/{index.5a673a96.js → index.ace3f52e.js} +52 -47
- package/components/hook-form/RHFDateTime/subcomponents/Skeleton/types.d.ts +3 -2
- package/components/hook-form/RHFDateTime/types.d.ts +4 -2
- package/components/hook-form/RHFPeriod/classes/index.d.ts +2 -1
- package/components/hook-form/RHFPeriod/classes/types.d.ts +2 -0
- package/components/hook-form/RHFPeriod/index.88812636.js +112 -0
- package/components/hook-form/RHFPeriod/types.d.ts +7 -1
- package/components/hook-form/RHFTextField/classes/types.d.ts +1 -0
- package/components/hook-form/RHFTextField/{index.fbb29ee1.js → index.d4192912.js} +40 -25
- package/components/hook-form/RHFTextField/types.d.ts +4 -3
- package/components/hook-form/RHFTextFieldPassword/types.d.ts +0 -1
- package/components/hook-form/RHFUpload/{index.05d7e2a7.js → index.f7efd0e2.js} +4 -5
- package/components/hook-form/index.d.ts +1 -1
- package/components/index.d.ts +1 -0
- package/components/modal/{WindowBase.998b8a38.js → WindowBase.4881da1f.js} +3 -3
- package/components/modal/{WindowConfirm.55ac3c8f.js → WindowConfirm.3b0e842b.js} +6 -6
- package/components/mui_extended/Accordion/{index.fb4eb664.js → index.a32a5761.js} +2 -2
- package/components/mui_extended/Button/{index.e520bd15.js → index.81367a73.js} +3 -7
- package/components/mui_extended/CheckBox/types.d.ts +2 -1
- package/components/mui_extended/{CheckBox.e662d20c.js → CheckBox.b3c0f2ad.js} +21 -23
- package/components/mui_extended/IconButton/classes/types.d.ts +0 -1
- package/components/mui_extended/IconButton/{index.9ea23f87.js → index.32fc9419.js} +2 -5
- package/components/mui_extended/IconButton/types.d.ts +1 -1
- package/components/mui_extended/ImageButton/ImageButton.d.ts +1 -1
- package/components/mui_extended/MenuActions/{index.fa7c26a5.js → index.fdea20e7.js} +4 -5
- package/components/mui_extended/Pager/{index.0c703574.js → index.c843dde3.js} +2 -3
- package/components/mui_extended/Popover/{index.b3eca6b1.js → index.d85de73b.js} +1 -2
- package/components/mui_extended/Tab/{index.409b9c74.js → index.2068925d.js} +2 -3
- package/components/mui_extended/ToggleButton/{index.bcaea74b.js → index.3d71f374.js} +1 -1
- package/components/mui_extended/ToggleIconButton/{index.131772d7.js → index.1cff26af.js} +1 -1
- package/contexts/ModalContext/{index.978a412d.js → index.e748f329.js} +1 -1
- package/contexts/RHFormContext/{index.7769076a.js → index.7b2a8723.js} +1 -2
- package/hooks/index.d.ts +1 -0
- package/hooks/useFormAddEdit/{index.4caddd24.js → index.5c3d8e48.js} +2 -2
- package/hooks/useFormFocus/index.d.ts +7 -0
- package/hooks/useFormFocus/types.d.ts +8 -0
- package/hooks/useModal/{index.786a4439.js → index.66a0c82e.js} +1 -1
- package/hooks/useTab/{index.eee18a49.js → index.c0564138.js} +1 -1
- package/index.js +124 -120
- package/{node_modules.71622512.js → node_modules.47f7709b.js} +1 -1
- package/package.json +1 -1
- package/{vendor.a735310a.js → vendor.47f1f3d4.js} +90 -70
- package/components/Image/index.d034ca68.js +0 -388
- package/components/Image/subcomponents/BasicIntersectComponent/index.d.ts +0 -3
- package/components/Image/subcomponents/LazyLoadComponent/index.d.ts +0 -7
- package/components/Image/subcomponents/Skeleton/index.d.ts +0 -2
- package/components/Image/subcomponents/Skeleton/types.d.ts +0 -6
- package/components/Image/utils/classes/index.d.ts +0 -12
- package/components/Image/utils/isIntersectionObserverAvailable.d.ts +0 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/Skeleton/index.d.ts +0 -1
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/Skeleton/types.d.ts +0 -3
- package/components/SideBar/subcomponents/ContentGroups/type.d.ts +0 -7
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/skeleton.d.ts +0 -1
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/index.d.ts +0 -2
- package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/types.d.ts +0 -2
- package/components/hook-form/RHFColorPicker/index.48a1ee1b.js +0 -153
- package/components/hook-form/RHFPeriod/index.4205c8ab.js +0 -76
- package/components/mui_extended/Popover/index.d.ts +0 -2
- /package/components/Image/{utils/classes → classes}/constant.d.ts +0 -0
|
@@ -5,12 +5,12 @@ import { g as getComponentUtilityClass } from "../../../utils/index.de903261.js"
|
|
|
5
5
|
import { createContext, useContext, useState } from "react";
|
|
6
6
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
7
7
|
import { useEnvironment } from "@m4l/core";
|
|
8
|
-
import { I as Icon } from "../../Icon/index.
|
|
8
|
+
import { I as Icon } from "../../Icon/index.58eaf354.js";
|
|
9
9
|
import clsx from "clsx";
|
|
10
10
|
import { g as getNameDataTestId } from "../../../test/getNameDataTestId.14875ec7.js";
|
|
11
|
-
import { A as Accordion } from "../../mui_extended/Accordion/index.
|
|
12
|
-
import { B as Button } from "../../mui_extended/Button/index.
|
|
13
|
-
import { P as Popover } from "../../mui_extended/Popover/index.
|
|
11
|
+
import { A as Accordion } from "../../mui_extended/Accordion/index.a32a5761.js";
|
|
12
|
+
import { B as Button } from "../../mui_extended/Button/index.81367a73.js";
|
|
13
|
+
import { P as Popover } from "../../mui_extended/Popover/index.d85de73b.js";
|
|
14
14
|
const componentName = "M4LTopBar";
|
|
15
15
|
const TopBarClasses = generateUtilityClasses(componentName, [
|
|
16
16
|
"root",
|
|
@@ -110,8 +110,7 @@ const NavItemRoot = (props) => {
|
|
|
110
110
|
const {
|
|
111
111
|
title,
|
|
112
112
|
children,
|
|
113
|
-
module_id
|
|
114
|
-
icon_url
|
|
113
|
+
module_id
|
|
115
114
|
} = itemRootData;
|
|
116
115
|
const [anchorEl, setAnchorEl] = useState(null);
|
|
117
116
|
const [openedPopoverId, setOpenedPopoverId] = useState(null);
|
|
@@ -181,9 +180,6 @@ const NavItemRoot = (props) => {
|
|
|
181
180
|
size: "medium",
|
|
182
181
|
variant: "text",
|
|
183
182
|
href: itemRootData.path,
|
|
184
|
-
startIcon: /* @__PURE__ */ jsx(Icon, {
|
|
185
|
-
src: `${icon_url}`
|
|
186
|
-
}),
|
|
187
183
|
children: title
|
|
188
184
|
}), /* @__PURE__ */ jsx(Button, {
|
|
189
185
|
variant: "text",
|
|
@@ -191,9 +187,6 @@ const NavItemRoot = (props) => {
|
|
|
191
187
|
onClick: (e) => handleClick(e, module_id),
|
|
192
188
|
endIcon: /* @__PURE__ */ jsx(ArrowIcon, {
|
|
193
189
|
openState: openedPopoverId === module_id ? true : false
|
|
194
|
-
}),
|
|
195
|
-
startIcon: /* @__PURE__ */ jsx(Icon, {
|
|
196
|
-
src: `${icon_url}`
|
|
197
190
|
})
|
|
198
191
|
}), renderPopover()]
|
|
199
192
|
});
|
|
@@ -212,9 +205,6 @@ const NavItemRoot = (props) => {
|
|
|
212
205
|
endIcon: /* @__PURE__ */ jsx(ArrowIcon, {
|
|
213
206
|
openState: openedPopoverId === module_id ? true : false
|
|
214
207
|
}),
|
|
215
|
-
startIcon: /* @__PURE__ */ jsx(Icon, {
|
|
216
|
-
src: `${icon_url}`
|
|
217
|
-
}),
|
|
218
208
|
children: title
|
|
219
209
|
}), renderPopover()]
|
|
220
210
|
});
|
|
@@ -225,9 +215,6 @@ const NavItemRoot = (props) => {
|
|
|
225
215
|
size: "medium",
|
|
226
216
|
href: itemRootData.path,
|
|
227
217
|
"aria-describedby": module_id,
|
|
228
|
-
startIcon: /* @__PURE__ */ jsx(Icon, {
|
|
229
|
-
src: `${icon_url}`
|
|
230
|
-
}),
|
|
231
218
|
children: /* @__PURE__ */ jsx("div", {
|
|
232
219
|
children: title
|
|
233
220
|
})
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useModuleDictionary, useEnvironment } from "@m4l/core";
|
|
3
|
-
import { I as Icon } from "../../Icon/index.
|
|
3
|
+
import { I as Icon } from "../../Icon/index.58eaf354.js";
|
|
4
4
|
import { W as WrapperComponent } from "../../WrapperComponent/index.5e872594.js";
|
|
5
|
-
import { F as FormatterRoot, f as formatterClasses } from "../index.
|
|
5
|
+
import { F as FormatterRoot, f as formatterClasses } from "../index.3e9e2305.js";
|
|
6
6
|
import clsx from "clsx";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
const BOOLEAN_FORMATTER_DICTIONARY_KEY = `boolean_formatter`;
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { evaluateWithContext } from "@m4l/core";
|
|
2
2
|
import { W as WrapperComponent } from "../../WrapperComponent/index.5e872594.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
function getFormatPoints(obProps, fieldValue, fieldUnit, chainPoint) {
|
|
5
5
|
let result = "";
|
|
6
|
-
const points =
|
|
7
|
-
const unit =
|
|
6
|
+
const points = evaluateWithContext(obProps, fieldValue);
|
|
7
|
+
const unit = evaluateWithContext(obProps, fieldUnit) || "";
|
|
8
8
|
if (points === void 0 || points === null || !Array.isArray(points)) {
|
|
9
9
|
return "[]";
|
|
10
10
|
}
|
|
11
11
|
points.map((point) => {
|
|
12
12
|
if (point) {
|
|
13
|
-
result = !chainPoint ? result.concat(`[${point}${unit}]`) : result.concat(`[${
|
|
13
|
+
result = !chainPoint ? result.concat(`[${point}${unit}]`) : result.concat(`[${evaluateWithContext(point, chainPoint)}${unit}]`);
|
|
14
14
|
}
|
|
15
15
|
});
|
|
16
16
|
return result;
|
|
@@ -3,7 +3,7 @@ import "@mui/base";
|
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { W as WrapperComponent } from "../WrapperComponent/index.5e872594.js";
|
|
5
5
|
import { useModuleDictionary } from "@m4l/core";
|
|
6
|
-
import { a as BOOLEAN_FORMATTER_DICTIONARY_KEY } from "./BooleanFormatter/index.
|
|
6
|
+
import { a as BOOLEAN_FORMATTER_DICTIONARY_KEY } from "./BooleanFormatter/index.4bb3d2f9.js";
|
|
7
7
|
const COMPONENT_CLASS_NAME = "M4LFormatter";
|
|
8
8
|
const formatterClasses = generateUtilityClasses(COMPONENT_CLASS_NAME, [
|
|
9
9
|
"root",
|
|
@@ -18,6 +18,7 @@ export interface RHFAutocompleteClassesType {
|
|
|
18
18
|
sizeSmall: string;
|
|
19
19
|
sizeMedium: string;
|
|
20
20
|
isFocus: string;
|
|
21
|
+
isTabSelected: string;
|
|
21
22
|
}
|
|
22
23
|
export declare type RHFAutocompleteClassesKey = keyof RHFAutocompleteClassesType;
|
|
23
24
|
export declare type Classes = ReturnType<typeof useUtilityClasses>;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useModuleDictionary, useModuleSkeleton, useEnvironment } from "@m4l/core";
|
|
2
2
|
import { useFormContext, Controller } from "react-hook-form";
|
|
3
|
-
import { Skeleton, generateUtilityClasses, generateUtilityClass, useTheme, Autocomplete, Popper, TextField, CircularProgress } from "@mui/material";
|
|
4
|
-
import {
|
|
5
|
-
import { I as Image } from "../../Image/index.d034ca68.js";
|
|
3
|
+
import { styled, Skeleton, generateUtilityClasses, generateUtilityClass, useTheme, Autocomplete, Popper, TextField, CircularProgress } from "@mui/material";
|
|
4
|
+
import { I as Image } from "../../Image/index.fa98eb78.js";
|
|
6
5
|
import { useMemo, useRef, useState, useEffect } from "react";
|
|
7
6
|
import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.86c553a9.js";
|
|
8
7
|
import { jsxs, jsx, Fragment } from "react/jsx-runtime";
|
|
@@ -10,7 +9,9 @@ import { T as Typography } from "../../mui_extended/Typography/index.379dd374.js
|
|
|
10
9
|
import { unstable_composeClasses } from "@mui/base";
|
|
11
10
|
import { H as HelperText } from "../../HelperText/index.7d2afdb3.js";
|
|
12
11
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
13
|
-
import {
|
|
12
|
+
import { u as useFormFocus } from "../../../vendor.47f1f3d4.js";
|
|
13
|
+
import { F as FieldLabel } from "../../FieldLabel/index.8d3d6bb4.js";
|
|
14
|
+
import { I as IconButton } from "../../mui_extended/IconButton/index.32fc9419.js";
|
|
14
15
|
const AutocompleteRoot = styled("div")(({
|
|
15
16
|
theme
|
|
16
17
|
}) => ({
|
|
@@ -68,7 +69,9 @@ const SkeletonRHFAutocomplete = (props) => {
|
|
|
68
69
|
children: [/* @__PURE__ */ jsx("div", {
|
|
69
70
|
className: classes.skeletonContainerText,
|
|
70
71
|
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
71
|
-
variant: "text"
|
|
72
|
+
variant: "text",
|
|
73
|
+
width: "50%",
|
|
74
|
+
height: "14px"
|
|
72
75
|
})
|
|
73
76
|
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
74
77
|
variant: "circular",
|
|
@@ -84,7 +87,9 @@ const SkeletonRHFAutocomplete = (props) => {
|
|
|
84
87
|
}), /* @__PURE__ */ jsx("div", {
|
|
85
88
|
className: classes.skeletonContainerText,
|
|
86
89
|
children: /* @__PURE__ */ jsx(Skeleton, {
|
|
87
|
-
variant: "text"
|
|
90
|
+
variant: "text",
|
|
91
|
+
width: "50%",
|
|
92
|
+
height: "14px"
|
|
88
93
|
})
|
|
89
94
|
}), /* @__PURE__ */ jsx(Skeleton, {
|
|
90
95
|
variant: "circular",
|
|
@@ -117,14 +122,15 @@ generateUtilityClasses(componentName, [
|
|
|
117
122
|
"variantError",
|
|
118
123
|
"sizeSmall",
|
|
119
124
|
"sizeMedium",
|
|
120
|
-
"isFocus"
|
|
125
|
+
"isFocus",
|
|
126
|
+
"isTabSelected"
|
|
121
127
|
]);
|
|
122
128
|
function getRHFAutocompleteClassesUtilityClass(slot) {
|
|
123
129
|
return generateUtilityClass(componentName, slot);
|
|
124
130
|
}
|
|
125
131
|
const useUtilityClasses = (ownerState) => {
|
|
126
132
|
const slots = {
|
|
127
|
-
root: ["root", ownerState.size === "small" && "sizeSmall", ownerState.size === "medium" && "sizeMedium", ownerState.
|
|
133
|
+
root: ["root", ownerState.size === "small" && "sizeSmall", ownerState.size === "medium" && "sizeMedium", ownerState.isFocus && "isFocus", ownerState.isTabSelected && "isTabSelected", ownerState.disabled && "isDisabled", ownerState.semantics === "info" && "variantInfo", ownerState.semantics === "success" && "variantSuccess", ownerState.semantics === "warning" && "variantWarning", ownerState.semantics === "error" && "variantError", ownerState.imageWidthDefined && "imageWidthDefined"],
|
|
128
134
|
withImage: ["withImage"],
|
|
129
135
|
skeleton: ["skeleton"],
|
|
130
136
|
label: ["label"],
|
|
@@ -157,17 +163,29 @@ function RHFAutocomplete(props) {
|
|
|
157
163
|
size = "small",
|
|
158
164
|
onChangeFilterParmsLocal,
|
|
159
165
|
imageWidth,
|
|
166
|
+
mandatory,
|
|
167
|
+
mandatoryMessage,
|
|
160
168
|
...other
|
|
161
169
|
} = props;
|
|
162
170
|
const {
|
|
163
171
|
getLabel
|
|
164
172
|
} = useModuleDictionary();
|
|
165
173
|
const isSkeleton = useModuleSkeleton();
|
|
174
|
+
console.log("RHFAutocomplete mandatory", mandatory);
|
|
175
|
+
console.log("RHFAutocomplete mandatoryMessage", mandatoryMessage);
|
|
176
|
+
console.log("RHFAutocomplete label", label);
|
|
166
177
|
const withImage = useMemo(() => getOptionUrlImage !== void 0, [getOptionUrlImage]);
|
|
167
178
|
const {
|
|
168
179
|
host_static_assets,
|
|
169
180
|
environment_assets
|
|
170
181
|
} = useEnvironment();
|
|
182
|
+
const {
|
|
183
|
+
isFocus,
|
|
184
|
+
isTabSelected,
|
|
185
|
+
handlerFocus,
|
|
186
|
+
handlerOnKeyUp,
|
|
187
|
+
handlerOnBlur
|
|
188
|
+
} = useFormFocus();
|
|
171
189
|
const autocompleteRef = useRef(null);
|
|
172
190
|
const [open, setOpen] = useState(false);
|
|
173
191
|
const isDesktop = useResponsiveDesktop();
|
|
@@ -205,7 +223,6 @@ function RHFAutocomplete(props) {
|
|
|
205
223
|
errors
|
|
206
224
|
}
|
|
207
225
|
} = useFormContext();
|
|
208
|
-
const [isFocus, setIsFocus] = useState(false);
|
|
209
226
|
const [currentVariant, setCurrentVariant] = useState(null);
|
|
210
227
|
useEffect(() => {
|
|
211
228
|
if (errors[nameRHF]) {
|
|
@@ -216,23 +233,23 @@ function RHFAutocomplete(props) {
|
|
|
216
233
|
setCurrentVariant(null);
|
|
217
234
|
}
|
|
218
235
|
}, [errors[nameRHF], variant, control]);
|
|
219
|
-
const handleFocus = () => {
|
|
220
|
-
setIsFocus(true);
|
|
221
|
-
};
|
|
222
|
-
const handleBlur = () => {
|
|
223
|
-
setIsFocus(false);
|
|
224
|
-
};
|
|
225
236
|
const ownerState = {
|
|
226
237
|
size: !isDesktop ? "medium" : size,
|
|
227
|
-
|
|
238
|
+
isFocus: !isSkeleton ? isFocus : false,
|
|
239
|
+
isTabSelected: !isSkeleton ? isTabSelected : false,
|
|
228
240
|
semantics: currentVariant,
|
|
229
241
|
disabled,
|
|
230
242
|
imageWidthDefined: imageWidth ? true : false
|
|
231
243
|
};
|
|
232
244
|
const classes = useUtilityClasses(ownerState);
|
|
245
|
+
console.log("classes ***", classes);
|
|
233
246
|
const theme = useTheme();
|
|
234
247
|
return /* @__PURE__ */ jsx(AutocompleteRoot, {
|
|
235
248
|
className: classes.root,
|
|
249
|
+
tabIndex: 0,
|
|
250
|
+
onFocus: handlerFocus,
|
|
251
|
+
onBlur: handlerOnBlur,
|
|
252
|
+
onKeyUp: handlerOnKeyUp,
|
|
236
253
|
...process.env.NODE_ENV !== "production" ? {
|
|
237
254
|
[TEST_PROP_ID]: `${RHFTAUTOCOMPLET_ROOT_TEST_ID}_${nameRHF}`
|
|
238
255
|
} : {},
|
|
@@ -262,17 +279,17 @@ function RHFAutocomplete(props) {
|
|
|
262
279
|
e.preventDefault();
|
|
263
280
|
};
|
|
264
281
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
265
|
-
children: [/* @__PURE__ */ jsx(
|
|
266
|
-
variant: "body",
|
|
282
|
+
children: [label && /* @__PURE__ */ jsx(FieldLabel, {
|
|
267
283
|
className: classes.label,
|
|
268
|
-
|
|
284
|
+
label,
|
|
285
|
+
mandatory,
|
|
286
|
+
mandatoryMessage,
|
|
287
|
+
helperMessage
|
|
269
288
|
}), /* @__PURE__ */ jsx(Autocomplete, {
|
|
270
289
|
onKeyDown: checkKeyDown,
|
|
271
290
|
autoComplete: true,
|
|
272
291
|
size,
|
|
273
292
|
ref: autocompleteRef,
|
|
274
|
-
onFocus: handleFocus,
|
|
275
|
-
onBlur: handleBlur,
|
|
276
293
|
autoSelect: false,
|
|
277
294
|
options,
|
|
278
295
|
getOptionLabel: getOptionLabelLocal,
|
|
@@ -347,6 +364,7 @@ function RHFAutocomplete(props) {
|
|
|
347
364
|
className: classes.iconDown,
|
|
348
365
|
src: `${host_static_assets}/${environment_assets}/frontend/components/RHFAutocompletarAsync/assets/icons/chevronDown.svg`,
|
|
349
366
|
onClick: (event) => onOpenLocal(event),
|
|
367
|
+
disabled,
|
|
350
368
|
size
|
|
351
369
|
})
|
|
352
370
|
})
|
|
@@ -356,9 +374,9 @@ function RHFAutocomplete(props) {
|
|
|
356
374
|
...other
|
|
357
375
|
});
|
|
358
376
|
}
|
|
359
|
-
}), currentVariant ? /* @__PURE__ */ jsx(HelperText, {
|
|
377
|
+
}), currentVariant === "error" ? /* @__PURE__ */ jsx(HelperText, {
|
|
360
378
|
variant: currentVariant,
|
|
361
|
-
message:
|
|
379
|
+
message: error?.message
|
|
362
380
|
}) : null]
|
|
363
381
|
});
|
|
364
382
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { AutocompleteCloseReason, AutocompleteInputChangeReason, TextFieldProps } from '@mui/material';
|
|
3
|
-
import {
|
|
3
|
+
import { FieldLabelProps } from '../../FieldLabel/types';
|
|
4
4
|
export declare type GetOptionString<T> = (option: T | null) => string;
|
|
5
5
|
export declare type RHFAutocompleteVariants = 'info' | 'success' | 'warning';
|
|
6
|
-
export
|
|
6
|
+
export interface RHFAutocompleteProps<T> extends Omit<TextFieldProps, 'label' | 'variant'>, Omit<FieldLabelProps, 'label'> {
|
|
7
7
|
name: string;
|
|
8
8
|
options: Array<T>;
|
|
9
9
|
getOptionLabel: (option: T) => string;
|
|
@@ -15,18 +15,18 @@ export declare type RHFAutocompleteProps<T> = {
|
|
|
15
15
|
isOptionEqualToValue: (option: T, value: T) => boolean;
|
|
16
16
|
skeletonWidth?: string | number;
|
|
17
17
|
skeletonHeight?: string | number;
|
|
18
|
-
size?: Pick<RHFTextFieldProps, 'size'>;
|
|
19
|
-
label: string;
|
|
20
18
|
loading?: boolean;
|
|
19
|
+
label?: string;
|
|
21
20
|
variant?: RHFAutocompleteVariants;
|
|
22
21
|
helperMessage?: string;
|
|
23
22
|
onOpen?: (event: React.SyntheticEvent) => void;
|
|
24
23
|
onClose?: (event: React.SyntheticEvent, reason: AutocompleteCloseReason) => void;
|
|
25
24
|
onChangeFilterParmsLocal?: (newValue: string, reason: AutocompleteInputChangeReason) => void;
|
|
26
25
|
imageHeight?: string | number;
|
|
27
|
-
}
|
|
28
|
-
export interface OwnerState extends Pick<
|
|
29
|
-
|
|
26
|
+
}
|
|
27
|
+
export interface OwnerState extends Pick<RHFAutocompleteProps<any>, 'size' | 'disabled'> {
|
|
28
|
+
isFocus: boolean;
|
|
29
|
+
isTabSelected: boolean;
|
|
30
30
|
semantics: RHFAutocompleteVariants | 'error' | null;
|
|
31
31
|
variant?: 'withImage';
|
|
32
32
|
imageWidthDefined: boolean;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { useState, useCallback, useEffect } from "react";
|
|
2
2
|
import { useNetwork, getPropertyByString } from "@m4l/core";
|
|
3
3
|
import debounce from "lodash/debounce";
|
|
4
|
-
import { styled } from "@mui/material
|
|
5
|
-
import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
4
|
+
import { styled, generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
6
5
|
import { unstable_composeClasses } from "@mui/base";
|
|
7
6
|
import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.86c553a9.js";
|
|
8
7
|
import { jsx } from "react/jsx-runtime";
|
|
9
|
-
import { R as RHFAutocomplete, g as getRHFAutocompleteComponentsDictionary } from "../RHFAutocomplete/index.
|
|
8
|
+
import { R as RHFAutocomplete, g as getRHFAutocompleteComponentsDictionary } from "../RHFAutocomplete/index.f9be5465.js";
|
|
10
9
|
styled("div")(() => ({
|
|
11
10
|
display: "flex",
|
|
12
11
|
width: "100%",
|
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import { useFormContext, Controller } from "react-hook-form";
|
|
2
|
-
import { styled } from "@mui/material
|
|
3
|
-
import { Skeleton, generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
2
|
+
import { styled, Skeleton, generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
4
3
|
import { unstable_composeClasses } from "@mui/base";
|
|
5
4
|
import { H as HelperText } from "../../HelperText/index.7d2afdb3.js";
|
|
6
5
|
import { T as TEST_PROP_ID } from "../../../test/constants_no_mock.86c553a9.js";
|
|
7
6
|
import { useResponsiveDesktop } from "@m4l/graphics";
|
|
7
|
+
import { useModuleSkeleton } from "@m4l/core";
|
|
8
8
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
9
|
-
import {
|
|
9
|
+
import { u as useFormFocus } from "../../../vendor.47f1f3d4.js";
|
|
10
|
+
import { C as CheckBox } from "../../mui_extended/CheckBox.b3c0f2ad.js";
|
|
10
11
|
const RHFCheckboxRoot = styled("div")(({
|
|
11
12
|
theme
|
|
12
13
|
}) => ({
|
|
@@ -34,14 +35,16 @@ generateUtilityClasses("M4LRHFCheckbox", [
|
|
|
34
35
|
"small",
|
|
35
36
|
"medium",
|
|
36
37
|
"stateDisabled",
|
|
37
|
-
"stateError"
|
|
38
|
+
"stateError",
|
|
39
|
+
"isFocus",
|
|
40
|
+
"isTabSelected"
|
|
38
41
|
]);
|
|
39
42
|
function getRHFCheckboxUtilityClass(slot) {
|
|
40
43
|
return generateUtilityClass("M4LRHFCheckbox", slot);
|
|
41
44
|
}
|
|
42
45
|
const useUtilityClasses = (ownerState) => {
|
|
43
46
|
const slots = {
|
|
44
|
-
root: ["root", ownerState.sizeCheck === "small" && "small", ownerState.sizeCheck === "medium" && "medium", ownerState.disabled && "stateDisabled", ownerState.error && "stateError"],
|
|
47
|
+
root: ["root", ownerState.isFocus && "isFocus", ownerState.isTabSelected && "isTabSelected", ownerState.sizeCheck === "small" && "small", ownerState.sizeCheck === "medium" && "medium", ownerState.disabled && "stateDisabled", ownerState.error && "stateError"],
|
|
45
48
|
skeleton: ["skeleton"],
|
|
46
49
|
checkTypography: ["checkTypography", ownerState.sizeCheck === "small" ? "small" : "medium", ownerState.disabled && "stateDisabled"]
|
|
47
50
|
};
|
|
@@ -59,7 +62,10 @@ function RHFCheckbox(props) {
|
|
|
59
62
|
name,
|
|
60
63
|
sizeCheck = "small",
|
|
61
64
|
label,
|
|
62
|
-
disabled = false
|
|
65
|
+
disabled = false,
|
|
66
|
+
mandatory,
|
|
67
|
+
mandatoryMessage,
|
|
68
|
+
helperMessage
|
|
63
69
|
} = props;
|
|
64
70
|
const {
|
|
65
71
|
control,
|
|
@@ -67,8 +73,18 @@ function RHFCheckbox(props) {
|
|
|
67
73
|
errors
|
|
68
74
|
}
|
|
69
75
|
} = useFormContext();
|
|
76
|
+
const isSkeleton = useModuleSkeleton();
|
|
77
|
+
const {
|
|
78
|
+
isFocus,
|
|
79
|
+
isTabSelected,
|
|
80
|
+
handlerFocus,
|
|
81
|
+
handlerOnKeyUp,
|
|
82
|
+
handlerOnBlur
|
|
83
|
+
} = useFormFocus();
|
|
70
84
|
const isDesktop = useResponsiveDesktop();
|
|
71
85
|
const ownerState = {
|
|
86
|
+
isFocus: !isSkeleton ? isFocus : false,
|
|
87
|
+
isTabSelected: !isSkeleton ? isTabSelected : false,
|
|
72
88
|
sizeCheck: !isDesktop ? "medium" : sizeCheck,
|
|
73
89
|
disabled,
|
|
74
90
|
error: errors[name] ? true : false
|
|
@@ -76,6 +92,9 @@ function RHFCheckbox(props) {
|
|
|
76
92
|
const classes = useUtilityClasses(ownerState);
|
|
77
93
|
return /* @__PURE__ */ jsx(RHFCheckboxRoot, {
|
|
78
94
|
className: classes.root,
|
|
95
|
+
onFocus: handlerFocus,
|
|
96
|
+
onBlur: handlerOnBlur,
|
|
97
|
+
onKeyUp: handlerOnKeyUp,
|
|
79
98
|
...process.env.NODE_ENV !== "production" ? {
|
|
80
99
|
[TEST_PROP_ID]: getNameDataTestId("root", name)
|
|
81
100
|
} : {},
|
|
@@ -83,11 +102,15 @@ function RHFCheckbox(props) {
|
|
|
83
102
|
name,
|
|
84
103
|
control,
|
|
85
104
|
render: ({
|
|
86
|
-
field
|
|
105
|
+
field: {
|
|
106
|
+
onChange,
|
|
107
|
+
value
|
|
108
|
+
},
|
|
87
109
|
fieldState: {
|
|
88
110
|
error
|
|
89
111
|
}
|
|
90
112
|
}) => {
|
|
113
|
+
console.log("checkBox Field value", value);
|
|
91
114
|
return /* @__PURE__ */ jsxs(Fragment, {
|
|
92
115
|
children: [/* @__PURE__ */ jsx(ContainerCheckTypography, {
|
|
93
116
|
className: classes.checkTypography,
|
|
@@ -96,11 +119,15 @@ function RHFCheckbox(props) {
|
|
|
96
119
|
} : {},
|
|
97
120
|
children: /* @__PURE__ */ jsx(CheckBox, {
|
|
98
121
|
size: sizeCheck,
|
|
99
|
-
|
|
100
|
-
checked:
|
|
122
|
+
onChange,
|
|
123
|
+
checked: value,
|
|
101
124
|
disabled: disabled ? true : false,
|
|
102
125
|
disableRipple: true,
|
|
103
|
-
label
|
|
126
|
+
label,
|
|
127
|
+
mandatory,
|
|
128
|
+
mandatoryMessage,
|
|
129
|
+
helperMessage,
|
|
130
|
+
htmlFor: name
|
|
104
131
|
})
|
|
105
132
|
}), error?.message && /* @__PURE__ */ jsx(HelperText, {
|
|
106
133
|
variant: "error",
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { FormControlLabelProps } from '@mui/material';
|
|
2
|
-
|
|
2
|
+
import { FieldLabelProps } from '../../FieldLabel/types';
|
|
3
|
+
export interface RHFCheckboxProps extends Omit<FormControlLabelProps, 'control' | 'label'>, Omit<FieldLabelProps, 'label'> {
|
|
3
4
|
name: string;
|
|
4
5
|
sizeCheck?: 'small' | 'medium';
|
|
5
6
|
label?: string;
|
|
@@ -9,5 +10,7 @@ export interface RHFMultiCheckboxProps extends Omit<FormControlLabelProps, 'cont
|
|
|
9
10
|
options: string[];
|
|
10
11
|
}
|
|
11
12
|
export interface OwnerState extends Pick<RHFCheckboxProps, 'sizeCheck' | 'disabled'> {
|
|
13
|
+
isFocus: boolean;
|
|
14
|
+
isTabSelected: boolean;
|
|
12
15
|
error: boolean;
|
|
13
16
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { RHFColorPickerProps } from './types';
|
|
2
|
+
/**
|
|
3
|
+
* Componente RHFColorPicker para seleccionar colores con React Hook Form.
|
|
4
|
+
* @component
|
|
5
|
+
* @param {RHFColorPickerProps} props - Propiedades del componente.
|
|
6
|
+
* @returns {JSX.Element} - Elemento JSX que representa el componente.
|
|
7
|
+
*/
|
|
8
|
+
export declare const RHFColorPicker: (props: RHFColorPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { RHFColorPickerClassesType } from './types';
|
|
2
|
+
import type { OwnerState } from '../types';
|
|
2
3
|
export declare const colorPickerClasses: RHFColorPickerClassesType;
|
|
3
4
|
export declare function getRHFColorPickerUtilityClass(slot: string): string;
|
|
4
|
-
export declare const useUtilityClasses: () => {
|
|
5
|
+
export declare const useUtilityClasses: (owmerState: OwnerState) => {
|
|
5
6
|
root: string;
|
|
6
7
|
skeleton: string;
|
|
7
8
|
popoverRoot: string;
|
|
@@ -6,6 +6,10 @@ export interface RHFColorPickerClassesType {
|
|
|
6
6
|
fieldColor: string;
|
|
7
7
|
containerPicker: string;
|
|
8
8
|
skeleton: string;
|
|
9
|
+
sizeSmall: string;
|
|
10
|
+
sizeMedium: string;
|
|
11
|
+
isFocus: string;
|
|
12
|
+
isTabSelected: string;
|
|
9
13
|
}
|
|
10
14
|
export declare type RHFColorPickerClassesKey = keyof RHFColorPickerClassesType;
|
|
11
15
|
export declare type Classes = ReturnType<typeof useUtilityClasses>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function getRHFColorPickerComponentsDictionary(): string[];
|