@m4l/components 0.1.62 → 0.1.64
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 +45 -8
- package/components/AccountPopover/AccountPopover.d.ts +2 -0
- package/components/AccountPopover/classes/constants.d.ts +1 -0
- package/components/AccountPopover/classes/index.d.ts +7 -0
- package/components/AccountPopover/classes/types.d.ts +5 -0
- package/components/AccountPopover/index.d.ts +2 -0
- package/components/AccountPopover/subcomponents/PopOver/index.d.ts +2 -0
- package/components/AccountPopover/subcomponents/PopOver/types.d.ts +9 -0
- package/components/AccountPopover/types.d.ts +28 -0
- package/components/AppBar/AppBar.d.ts +2 -0
- package/components/AppBar/classes/constants.d.ts +1 -0
- package/components/AppBar/classes/index.d.ts +6 -0
- package/components/AppBar/classes/types.d.ts +4 -0
- package/components/AppBar/index.d.ts +1 -0
- package/components/AppBar/subcomponents/MyAvatar/createAvatar.d.ts +4 -0
- package/components/AppBar/subcomponents/MyAvatar/index.d.ts +2 -0
- package/components/AppBar/tests/constants.d.ts +1 -0
- package/components/AppBar/tests/utils.d.ts +2 -0
- package/components/AppBar/types.d.ts +9 -0
- package/components/CommonActions/components/ActionCancel/{index.a81752ef.js → index.2eb2c1e1.js} +1 -1
- package/components/CommonActions/components/ActionCancel/index.d.ts +2 -2
- package/components/CommonActions/components/ActionFormCancel/{index.2124a98a.js → index.2864d574.js} +16 -17
- package/components/CommonActions/components/ActionFormIntro/index.d.ts +2 -2
- package/components/CommonActions/components/ActionFormIntro/{index.ca4d2674.js → index.e7f83ddd.js} +1 -1
- package/components/CommonActions/components/ActionIntro/{index.3f75a205.js → index.0d138cb3.js} +2 -2
- package/components/CommonActions/components/ActionIntro/index.d.ts +2 -2
- package/components/CommonActions/components/Actions/{index.6eb24c0b.js → index.433cd345.js} +17 -15
- package/components/DataGrid/{index.58f35158.js → index.42521a55.js} +24 -22
- package/components/DynamicFilter/{index.10f901c6.js → index.442bda79.js} +38 -37
- package/components/HelperText/index.3c07ca2a.js +70 -0
- package/components/HelperText/index.d.ts +10 -0
- package/components/HelperText/types.d.ts +8 -0
- package/components/HelperText/utils/Clases/constant.d.ts +1 -0
- package/components/HelperText/utils/Clases/index.d.ts +7 -0
- package/components/HelperText/utils/Clases/types.d.ts +7 -0
- package/components/Icon/classes/index.d.ts +1 -1
- package/components/Icon/classes/types.d.ts +3 -8
- package/components/Icon/index.0f9b360e.js +200 -0
- package/components/Icon/tests/constants.d.ts +1 -0
- package/components/Icon/tests/utils.d.ts +2 -0
- package/components/Icon/types.d.ts +3 -4
- package/components/Image/{index.aa24e982.js → index.1a9c0327.js} +124 -56
- package/components/Image/subcomponents/Skeleton/types.d.ts +2 -0
- package/components/Image/tests/constants.d.ts +1 -0
- package/components/Image/tests/utils.d.ts +2 -0
- package/components/Image/types.d.ts +9 -2
- package/components/Image/utils/classes/types.d.ts +1 -0
- package/components/Image/utils/getRatioValues.d.ts +5 -0
- package/components/LanguagePopover/classes/types.d.ts +1 -0
- package/components/LanguagePopover/{index.df9b47a6.js → index.68de7176.js} +49 -25
- package/components/LanguagePopover/tests/constants.d.ts +1 -0
- package/components/LanguagePopover/tests/utils.d.ts +2 -0
- package/components/ModalDialog/{index.dc7ebe06.js → index.3efe049b.js} +5 -5
- package/components/NavLink/NavLink.d.ts +2 -0
- package/components/NavLink/classes/constant.d.ts +1 -0
- package/components/NavLink/classes/index.d.ts +6 -0
- package/components/NavLink/classes/types.d.ts +4 -0
- package/components/NavLink/index.ae9f1cc9.js +74 -0
- package/components/NavLink/index.d.ts +1 -0
- package/components/NavLink/tests/constants.d.ts +1 -0
- package/components/NavLink/tests/utils.d.ts +2 -0
- package/components/NavLink/types.d.ts +5 -0
- package/components/NoItemSelected/{index.9636ec8a.js → index.7cfd7613.js} +2 -4
- package/components/ObjectLogs/{index.38c2ad18.js → index.b50726fb.js} +20 -18
- package/components/PaperForm/{index.3cdac885.js → index.44bf4469.js} +1 -1
- package/components/Period/{index.796b3af4.js → index.99feb99e.js} +18 -17
- package/components/Resizeable/{index.04fa8de5.js → index.b5d42efb.js} +1 -1
- package/components/ScrollBar/{index.b77feabd.js → index.bbe48f4d.js} +7 -2
- package/components/SideBar/SideBar.d.ts +2 -0
- package/components/SideBar/classes/constants.d.ts +1 -0
- package/components/SideBar/classes/index.d.ts +37 -0
- package/components/SideBar/classes/types.d.ts +37 -0
- package/components/SideBar/context/sideBarContext/index.d.ts +5 -0
- package/components/SideBar/context/sideBarContext/types.d.ts +9 -0
- package/components/SideBar/hooks/useSideBar/index.d.ts +2 -0
- package/components/SideBar/index.011880b6.js +1010 -0
- package/components/SideBar/index.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentDesktop/index.d.ts +1 -0
- package/components/SideBar/subcomponents/ContentDesktop/subcomponents/CollapseButton/index.d.ts +6 -0
- package/components/SideBar/subcomponents/ContentGroups/index.d.ts +1 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/index.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/ArrowIcon/index.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/ArrowIcon/types.d.ts +3 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/index.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/subcomponents/NavItemRootContent/index.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/subcomponents/NavItemRootContent/type.d.ts +9 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavItemRoot/type.d.ts +14 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/index.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/index.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/index.d.ts +2 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/subcomponents/NavItemSubContent/types.d.ts +7 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/subcomponents/NavItemSub/types.d.ts +13 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/subcomponents/NavListSub/type.d.ts +12 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/ItemListRoot/types.d.ts +13 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/Skeleton/index.d.ts +1 -0
- package/components/SideBar/subcomponents/ContentGroups/subcomponents/Skeleton/types.d.ts +3 -0
- package/components/SideBar/subcomponents/ContentGroups/type.d.ts +7 -0
- package/components/SideBar/subcomponents/ContentMobile/index.d.ts +1 -0
- package/components/SideBar/tests/constants.d.ts +5 -0
- package/components/SideBar/tests/utils.d.ts +2 -0
- package/components/SideBar/types.d.ts +29 -0
- package/components/areas/components/AreasAdmin/{index.645bd2c7.js → index.51e28f63.js} +11 -10
- package/components/areas/components/AreasContainer/{index.3e74c849.js → index.1e5e6e91.js} +3 -3
- package/components/areas/components/GridLayout/{index.50810712.js → index.5bf8d5e4.js} +5 -5
- package/components/areas/components/Window/{index.8040dbe4.js → index.416a874f.js} +49 -49
- package/components/areas/components/WindowPopUp/{index.4514046e.js → index.f053fca7.js} +45 -42
- package/components/areas/components/{index.9f62ca8e.js → index.eace295a.js} +10 -10
- package/components/areas/contexts/AreaContext/{index.368adb8d.js → index.7890e58d.js} +1 -1
- package/components/areas/contexts/AreasContext/{index.f3d6e728.js → index.0792a8d1.js} +1 -1
- package/components/areas/contexts/{index.3623b460.js → index.2a915acf.js} +1 -1
- package/components/areas/hooks/{index.18982960.js → index.f4d78492.js} +1 -1
- package/components/areas/hooks/useArea/{index.dab7ce20.js → index.d6263051.js} +2 -2
- package/components/areas/index.8fca0f8f.js +20 -0
- package/components/formatters/BooleanFormatter/{index.bf947220.js → index.cd00c8e1.js} +2 -3
- package/components/formatters/{index.acd3dcea.js → index.deae4701.js} +2 -3
- package/components/hook-form/RHFAutocomplete/RHFAutocomplete.d.ts +2 -0
- package/components/hook-form/RHFAutocomplete/classes/constant.d.ts +1 -0
- package/components/hook-form/RHFAutocomplete/classes/index.d.ts +10 -0
- package/components/hook-form/RHFAutocomplete/classes/types.d.ts +15 -0
- package/components/hook-form/RHFAutocomplete/index.083e23c1.js +400 -0
- package/components/hook-form/RHFAutocomplete/index.d.ts +1 -2
- package/components/hook-form/RHFAutocomplete/subcomponents/RenderOption/index.d.ts +1 -1
- package/components/hook-form/RHFAutocomplete/subcomponents/Skeleton/types.d.ts +2 -0
- package/components/hook-form/RHFAutocomplete/test/constants.d.ts +1 -0
- package/components/hook-form/RHFAutocomplete/test/utils.d.ts +2 -0
- package/components/hook-form/RHFAutocomplete/types.d.ts +9 -0
- package/components/hook-form/RHFAutocompleteAsync/RHFAutocompleteAsync.d.ts +7 -0
- package/components/hook-form/RHFAutocompleteAsync/classes/constant.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/classes/index.d.ts +6 -0
- package/components/hook-form/RHFAutocompleteAsync/classes/types.d.ts +4 -0
- package/components/hook-form/RHFAutocompleteAsync/index.ba751be9.js +156 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/constants.d.ts +1 -0
- package/components/hook-form/RHFAutocompleteAsync/tests/utils.d.ts +2 -0
- package/components/hook-form/RHFCheckbox/classes/index.d.ts +3 -1
- package/components/hook-form/RHFCheckbox/classes/types.d.ts +4 -0
- package/components/hook-form/RHFCheckbox/index.c19393b1.js +152 -0
- package/components/hook-form/RHFCheckbox/subcomponents/Skeleton/types.d.ts +1 -0
- package/components/hook-form/RHFCheckbox/test/constants.d.ts +4 -0
- package/components/hook-form/RHFCheckbox/test/utils.d.ts +2 -0
- package/components/hook-form/RHFCheckbox/types.d.ts +1 -0
- package/components/hook-form/RHFPeriod/{index.c4944f9c.js → index.c0a80aeb.js} +3 -3
- package/components/hook-form/RHFTextField/RHFTextField.d.ts +1 -1
- package/components/hook-form/RHFTextField/classes/index.d.ts +3 -1
- package/components/hook-form/RHFTextField/classes/types.d.ts +9 -3
- package/components/hook-form/RHFTextField/index.97485ff2.js +341 -0
- package/components/hook-form/RHFTextField/subcomponents/Skeleton/types.d.ts +2 -2
- package/components/hook-form/RHFTextField/tests/{contants.d.ts → constants.d.ts} +1 -0
- package/components/hook-form/RHFTextField/tests/utils.d.ts +2 -0
- package/components/hook-form/RHFTextField/types.d.ts +15 -1
- package/components/hook-form/RHFTextFieldPassword/tests/constants.d.ts +2 -0
- package/components/hook-form/RHFTextFieldPassword/tests/utils.d.ts +2 -0
- package/components/hook-form/RHFUpload/{index.7fdff30f.js → index.798eb11d.js} +3 -5
- package/components/hook-form/index.d.ts +2 -2
- package/components/index.d.ts +9 -2
- package/components/modal/{WindowBase.7828e042.js → WindowBase.59f50553.js} +3 -3
- package/components/modal/{WindowConfirm.42ec4dcd.js → WindowConfirm.c1339cf8.js} +21 -19
- package/components/modal/index.7a84f64d.js +30 -0
- package/components/mui_extended/Accordion/{index.725a10af.js → index.b7487e37.js} +2 -2
- package/components/mui_extended/Button/classes/index.d.ts +2 -1
- package/components/mui_extended/Button/classes/types.d.ts +7 -1
- package/components/mui_extended/Button/index.d9e0ae2e.js +208 -0
- package/components/mui_extended/Button/types.d.ts +6 -1
- package/components/mui_extended/IconButton/IconButton.d.ts +1 -2
- package/components/mui_extended/IconButton/classes/index.d.ts +2 -1
- package/components/mui_extended/IconButton/classes/types.d.ts +8 -0
- package/components/mui_extended/IconButton/{index.afa201a7.js → index.be9c2ce5.js} +48 -22
- package/components/mui_extended/IconButton/types.d.ts +13 -1
- package/components/mui_extended/ImageButton/ImageButton.d.ts +0 -3
- package/components/mui_extended/ImageButton/tests/constants.d.ts +1 -0
- package/components/mui_extended/ImageButton/tests/utils.d.ts +2 -0
- package/components/mui_extended/ImageButton/types.d.ts +1 -0
- package/components/mui_extended/ImageButton/utils/Clases/types.d.ts +1 -0
- package/components/mui_extended/LoadingButton/classes/constants.d.ts +1 -0
- package/components/mui_extended/LoadingButton/classes/index.d.ts +8 -0
- package/components/mui_extended/LoadingButton/classes/types.d.ts +11 -0
- package/components/mui_extended/LoadingButton/tests/constants.d.ts +1 -0
- package/components/mui_extended/LoadingButton/tests/utils.d.ts +2 -0
- package/components/mui_extended/LoadingButton/types.d.ts +5 -0
- package/components/mui_extended/MenuActions/{index.1affe51a.js → index.ec654122.js} +2 -2
- package/components/mui_extended/Pager/{index.d4d1a1a0.js → index.9e123670.js} +1 -1
- package/components/mui_extended/Popover/{index.8ed52492.js → index.260aae81.js} +2 -3
- package/components/mui_extended/Popover/index.d.ts +2 -0
- package/components/mui_extended/Typography/Typography.d.ts +2 -0
- package/components/mui_extended/Typography/{index.be3a279a.js → index.41b60a6b.js} +20 -15
- package/components/mui_extended/Typography/index.d.ts +1 -5
- package/components/mui_extended/Typography/tests/constants.d.ts +1 -0
- package/components/mui_extended/Typography/tests/utils.d.ts +2 -0
- package/components/mui_extended/Typography/utils/Clases/types.d.ts +1 -0
- package/components/mui_extended/index.459cbd6c.js +19 -0
- package/components/mui_extended/index.d.ts +1 -1
- package/contexts/ModalContext/{index.b4114066.js → index.ae8041f3.js} +1 -1
- package/contexts/RHFormContext/{index.3dc6e2f5.js → index.a7511399.js} +2 -8
- package/hooks/useModal/{index.77b3415c.js → index.5c159ed2.js} +1 -1
- package/index.js +69 -65
- package/package.json +1 -1
- package/{react-draggable.6471b07e.js → react-draggable.1aa81436.js} +1 -1
- package/{react-resizable.b620abed.js → react-resizable.e86cb01e.js} +2 -2
- package/utils/{index.b6ae791a.js → index.e199226a.js} +7 -18
- package/vendor.a15d263e.js +458 -0
- package/components/ErrorLabel/index.d.ts +0 -10
- package/components/ErrorLabel/index.e140421c.js +0 -65
- package/components/ErrorLabel/types.d.ts +0 -4
- package/components/ErrorLabel/utils/Clases/index.d.ts +0 -6
- package/components/ErrorLabel/utils/Clases/types.d.ts +0 -3
- package/components/Icon/index.b29ff2d9.js +0 -200
- package/components/areas/index.a0456f95.js +0 -21
- package/components/hook-form/RHFAutocomplete/index.bb6cb5df.js +0 -289
- package/components/hook-form/RHFAutocomplete/test/contants.d.ts +0 -1
- package/components/hook-form/RHFAutocompleteAsync/index.815949a9.js +0 -87
- package/components/hook-form/RHFAutocompleteAsync/index.d.ts +0 -2
- package/components/hook-form/RHFCheckbox/index.6e80f572.js +0 -110
- package/components/hook-form/RHFTextField/index.d3544fa3.js +0 -228
- package/components/modal/index.3cc54b93.js +0 -29
- package/components/mui_extended/Button/index.8406ed5b.js +0 -150
- package/components/mui_extended/LoadingButton/subcomponents/Skeleton/index.d.ts +0 -1
- package/components/mui_extended/index.9ce0bca3.js +0 -19
- package/vendor.29969396.js +0 -145
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { styled, generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
2
|
+
import "react";
|
|
3
|
+
import "@m4l/core";
|
|
4
|
+
import "../Icon/index.0f9b360e.js";
|
|
5
|
+
import { jsx } from "react/jsx-runtime";
|
|
6
|
+
import "../mui_extended/IconButton/index.be9c2ce5.js";
|
|
7
|
+
import "../mui_extended/Accordion/index.b7487e37.js";
|
|
8
|
+
import "../mui_extended/Avatar/index.fe06afd7.js";
|
|
9
|
+
import "react-router-dom";
|
|
10
|
+
import "@mui/material/Button";
|
|
11
|
+
import "../mui_extended/Button/index.d9e0ae2e.js";
|
|
12
|
+
import "clsx";
|
|
13
|
+
import "../Image/index.1a9c0327.js";
|
|
14
|
+
import "@mui/lab";
|
|
15
|
+
import { T as Typography } from "../mui_extended/Typography/index.41b60a6b.js";
|
|
16
|
+
import "../mui_extended/Popover/index.260aae81.js";
|
|
17
|
+
import "../mui_extended/MenuActions/index.ec654122.js";
|
|
18
|
+
import "../mui_extended/Pager/index.9e123670.js";
|
|
19
|
+
import "../mui_extended/Tab/index.e0653a0a.js";
|
|
20
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
21
|
+
const HelperTextRoot = styled("div")(({
|
|
22
|
+
theme
|
|
23
|
+
}) => ({
|
|
24
|
+
...theme.components?.M4LErrorLabel?.styleOverrides
|
|
25
|
+
}));
|
|
26
|
+
const componentName = "M4LHelperText";
|
|
27
|
+
const errorLabelClasses = generateUtilityClasses(componentName, [
|
|
28
|
+
"root",
|
|
29
|
+
"variantInfo",
|
|
30
|
+
"variantSuccess",
|
|
31
|
+
"variantWarning",
|
|
32
|
+
"variantError"
|
|
33
|
+
]);
|
|
34
|
+
function getHelperTextUtilityClass(slot) {
|
|
35
|
+
return generateUtilityClass(componentName, slot);
|
|
36
|
+
}
|
|
37
|
+
const useUtilityClasses = (ownerSate) => {
|
|
38
|
+
const slots = {
|
|
39
|
+
root: ["root", ownerSate.variant === "info" && "variantInfo", ownerSate.variant === "success" && "variantSuccess", ownerSate.variant === "warning" && "variantWarning", ownerSate.variant === "error" && "variantError"]
|
|
40
|
+
};
|
|
41
|
+
const composedClasses = unstable_composeClasses(slots, getHelperTextUtilityClass, {});
|
|
42
|
+
return {
|
|
43
|
+
...composedClasses
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
const HelperText = (props) => {
|
|
47
|
+
const {
|
|
48
|
+
message = "",
|
|
49
|
+
skeletonWidth,
|
|
50
|
+
skeletongHeight,
|
|
51
|
+
variant
|
|
52
|
+
} = props;
|
|
53
|
+
const ownerSate = {
|
|
54
|
+
variant
|
|
55
|
+
};
|
|
56
|
+
const classes = useUtilityClasses(ownerSate);
|
|
57
|
+
return /* @__PURE__ */ jsx(HelperTextRoot, {
|
|
58
|
+
className: classes.root,
|
|
59
|
+
children: /* @__PURE__ */ jsx(Typography, {
|
|
60
|
+
variant: "body",
|
|
61
|
+
skeletonWidth,
|
|
62
|
+
skeletongHeight,
|
|
63
|
+
children: message
|
|
64
|
+
})
|
|
65
|
+
});
|
|
66
|
+
};
|
|
67
|
+
export {
|
|
68
|
+
HelperText as H,
|
|
69
|
+
errorLabelClasses as e
|
|
70
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { HelperTextProps } from './types';
|
|
2
|
+
import { HelperTextClassesType } from './utils/Clases/types';
|
|
3
|
+
/**
|
|
4
|
+
* Provee de un texto que posee los estilos gráficos de error.
|
|
5
|
+
* @param props
|
|
6
|
+
* @returns
|
|
7
|
+
*/
|
|
8
|
+
export { errorLabelClasses } from './utils/Clases/index';
|
|
9
|
+
export declare type ErrorLabelClassesKey = HelperTextClassesType;
|
|
10
|
+
export declare const HelperText: (props: HelperTextProps) => JSX.Element;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { TypographyProps } from '../mui_extended/Typography/types';
|
|
2
|
+
declare type Variants = 'info' | 'success' | 'warning' | 'error';
|
|
3
|
+
export interface HelperTextProps extends Pick<TypographyProps, 'skeletonWidth' | 'skeletongHeight'> {
|
|
4
|
+
message: string | undefined;
|
|
5
|
+
variant?: Variants;
|
|
6
|
+
}
|
|
7
|
+
export declare type OwnerState = Pick<HelperTextProps, 'variant'>;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const componentName = "M4LHelperText";
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { HelperTextClassesType } from './types';
|
|
2
|
+
import { OwnerState } from '../../types';
|
|
3
|
+
export declare const errorLabelClasses: HelperTextClassesType;
|
|
4
|
+
export declare function getHelperTextUtilityClass(slot: string): string;
|
|
5
|
+
export declare const useUtilityClasses: (ownerSate: OwnerState) => {
|
|
6
|
+
root: string;
|
|
7
|
+
};
|
|
@@ -1,17 +1,12 @@
|
|
|
1
1
|
export interface IconClassesType {
|
|
2
2
|
root: string;
|
|
3
3
|
icon: string;
|
|
4
|
-
|
|
4
|
+
variantSkeleton: string;
|
|
5
5
|
sizeExtraSmall: string;
|
|
6
6
|
sizeSmall: string;
|
|
7
|
-
|
|
7
|
+
sizeMedium: string;
|
|
8
8
|
sizeLarge: string;
|
|
9
|
-
|
|
10
|
-
colorWarning: string;
|
|
11
|
-
colorError: string;
|
|
12
|
-
colorActive: string;
|
|
13
|
-
colorSelected: string;
|
|
14
|
-
colorDisabled: string;
|
|
9
|
+
sizeExtraLarge: string;
|
|
15
10
|
rotationAngle: string;
|
|
16
11
|
}
|
|
17
12
|
export declare type IconClassesKey = keyof IconClassesType;
|
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
import { m } from "framer-motion";
|
|
2
|
+
import { forwardRef, useState, useEffect } from "react";
|
|
3
|
+
import { IconButton, Box, styled, generateUtilityClasses, generateUtilityClass, Skeleton } from "@mui/material";
|
|
4
|
+
import { jsx } from "react/jsx-runtime";
|
|
5
|
+
import { useEnvironment } from "@m4l/core";
|
|
6
|
+
import { u as useSideBar, g as getNameDataTestId$1 } from "../SideBar/index.011880b6.js";
|
|
7
|
+
import { T as TEST_PROP_ID } from "../../vendor.a15d263e.js";
|
|
8
|
+
import { unstable_composeClasses } from "@mui/base";
|
|
9
|
+
const varSmall = {
|
|
10
|
+
hover: {
|
|
11
|
+
scale: 1.1
|
|
12
|
+
},
|
|
13
|
+
tap: {
|
|
14
|
+
scale: 0.95
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
const varMedium = {
|
|
18
|
+
hover: {
|
|
19
|
+
scale: 1.09
|
|
20
|
+
},
|
|
21
|
+
tap: {
|
|
22
|
+
scale: 0.97
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
const varLarge = {
|
|
26
|
+
hover: {
|
|
27
|
+
scale: 1.08
|
|
28
|
+
},
|
|
29
|
+
tap: {
|
|
30
|
+
scale: 0.99
|
|
31
|
+
}
|
|
32
|
+
};
|
|
33
|
+
function AnimateWrap({
|
|
34
|
+
size,
|
|
35
|
+
children
|
|
36
|
+
}) {
|
|
37
|
+
const isSmall = size === "small";
|
|
38
|
+
const isLarge = size === "large";
|
|
39
|
+
return /* @__PURE__ */ jsx(Box, {
|
|
40
|
+
component: m.div,
|
|
41
|
+
whileTap: "tap",
|
|
42
|
+
whileHover: "hover",
|
|
43
|
+
variants: isSmall && varSmall || isLarge && varLarge || varMedium,
|
|
44
|
+
sx: {
|
|
45
|
+
display: "inline-flex"
|
|
46
|
+
},
|
|
47
|
+
children
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
const IconButtonAnimate = forwardRef(({
|
|
51
|
+
children,
|
|
52
|
+
size = "medium",
|
|
53
|
+
...other
|
|
54
|
+
}, ref) => /* @__PURE__ */ jsx(AnimateWrap, {
|
|
55
|
+
size,
|
|
56
|
+
children: /* @__PURE__ */ jsx(IconButton, {
|
|
57
|
+
size,
|
|
58
|
+
ref,
|
|
59
|
+
...other,
|
|
60
|
+
children
|
|
61
|
+
})
|
|
62
|
+
}));
|
|
63
|
+
IconButtonAnimate.displayName = "IconButtonAnimate";
|
|
64
|
+
const IconRoot = styled("div")(({
|
|
65
|
+
theme
|
|
66
|
+
}) => ({
|
|
67
|
+
...theme.components?.M4LIcon?.styleOverrides
|
|
68
|
+
}));
|
|
69
|
+
const DivIcon = styled("div", {
|
|
70
|
+
shouldForwardProp: (props) => props !== "src" && props !== "rotationAngle"
|
|
71
|
+
})(({
|
|
72
|
+
src,
|
|
73
|
+
rotationAngle
|
|
74
|
+
}) => ({
|
|
75
|
+
maskPosition: "center",
|
|
76
|
+
maskRepeat: "no-repeat",
|
|
77
|
+
maskSize: "cover",
|
|
78
|
+
WebkitMaskRepeat: "no-repeat",
|
|
79
|
+
mask: `url('data:image/svg+xml;base64,${src}')`,
|
|
80
|
+
WebkitMask: `url('data:image/svg+xml;base64,${src}')`,
|
|
81
|
+
WebkitMaskSize: "cover",
|
|
82
|
+
...rotationAngle && {
|
|
83
|
+
transform: `rotate(${rotationAngle}deg)`
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
86
|
+
const componentName = "M4LIcon";
|
|
87
|
+
generateUtilityClasses(componentName, [
|
|
88
|
+
"root",
|
|
89
|
+
"icon",
|
|
90
|
+
"variantSkeleton",
|
|
91
|
+
"sizeExtraSmall",
|
|
92
|
+
"sizeSmall",
|
|
93
|
+
"sizeMedium",
|
|
94
|
+
"sizeLarge",
|
|
95
|
+
"sizeExtraLarge",
|
|
96
|
+
"rotationAngle"
|
|
97
|
+
]);
|
|
98
|
+
function getIconClassesUtilityClass(slot) {
|
|
99
|
+
return generateUtilityClass(componentName, slot);
|
|
100
|
+
}
|
|
101
|
+
const useUtilityClasses = (ownerState) => {
|
|
102
|
+
const slots = {
|
|
103
|
+
root: ["root"],
|
|
104
|
+
icon: ["icon", ownerState.size === "extraSmall" && "sizeExtraSmall", ownerState.size === "small" && "sizeSmall", ownerState.size === "medium" && "sizeMedium", ownerState.size === "large" && "sizeLarge", ownerState.size === "extraLarge" && "sizeExtraLarge", ownerState.rotationAngle ? "rotationAngle" : ""],
|
|
105
|
+
variantSkeleton: ["variantSkeleton", ownerState.size === "extraSmall" && "sizeExtraSmall", ownerState.size === "small" && "sizeSmall", ownerState.size === "medium" && "sizeMedium", ownerState.size === "large" && "sizeLarge", ownerState.size === "extraLarge" && "sizeExtraLarge"]
|
|
106
|
+
};
|
|
107
|
+
const composedClasses = unstable_composeClasses(slots, getIconClassesUtilityClass, {});
|
|
108
|
+
return {
|
|
109
|
+
...composedClasses
|
|
110
|
+
};
|
|
111
|
+
};
|
|
112
|
+
const ICON_PREFIX = "Icon";
|
|
113
|
+
const getNameDataTestId = (KEY) => {
|
|
114
|
+
return `${ICON_PREFIX}-${KEY}`;
|
|
115
|
+
};
|
|
116
|
+
function Icon(props) {
|
|
117
|
+
const {
|
|
118
|
+
src,
|
|
119
|
+
size = "small",
|
|
120
|
+
rotationAngle,
|
|
121
|
+
testingProps
|
|
122
|
+
} = props;
|
|
123
|
+
const [resource, setResource] = useState(testingProps?.resource || void 0);
|
|
124
|
+
useEffect(() => {
|
|
125
|
+
let mounted = true;
|
|
126
|
+
(async function networkOperation() {
|
|
127
|
+
await fetch(src).then((response) => {
|
|
128
|
+
return response.text() || "";
|
|
129
|
+
}).then((xml) => {
|
|
130
|
+
xml = xml.match(
|
|
131
|
+
/(<svg\b[^>]*\s*(viewBox="(\b[^"]*)").*?>([\s\S]*?)<\/svg>|<svg>([\s\S]*?)<\/svg>)/g
|
|
132
|
+
)?.toString() || "";
|
|
133
|
+
if (mounted) {
|
|
134
|
+
setResource(window.btoa(xml));
|
|
135
|
+
}
|
|
136
|
+
}).catch((_err) => {
|
|
137
|
+
});
|
|
138
|
+
})();
|
|
139
|
+
return function clenUp() {
|
|
140
|
+
mounted = false;
|
|
141
|
+
};
|
|
142
|
+
}, [src]);
|
|
143
|
+
const ownerState = {
|
|
144
|
+
size,
|
|
145
|
+
rotationAngle
|
|
146
|
+
};
|
|
147
|
+
const classes = useUtilityClasses(ownerState);
|
|
148
|
+
return /* @__PURE__ */ jsx(IconRoot, {
|
|
149
|
+
className: classes.root,
|
|
150
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
151
|
+
[TEST_PROP_ID]: getNameDataTestId("root")
|
|
152
|
+
} : {},
|
|
153
|
+
children: resource ? /* @__PURE__ */ jsx(DivIcon, {
|
|
154
|
+
className: classes.icon,
|
|
155
|
+
src: resource,
|
|
156
|
+
rotationAngle,
|
|
157
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
158
|
+
[TEST_PROP_ID]: getNameDataTestId("icon")
|
|
159
|
+
} : {}
|
|
160
|
+
}) : /* @__PURE__ */ jsx(Skeleton, {
|
|
161
|
+
variant: "rectangular",
|
|
162
|
+
className: classes.variantSkeleton,
|
|
163
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
164
|
+
[TEST_PROP_ID]: getNameDataTestId("variantSkeleton")
|
|
165
|
+
} : {}
|
|
166
|
+
})
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
const ArrowIconRoot = styled("div")(() => ({
|
|
170
|
+
display: "flex",
|
|
171
|
+
alignSelf: "center",
|
|
172
|
+
lineHeight: 0
|
|
173
|
+
}));
|
|
174
|
+
function ArrowIcon(props) {
|
|
175
|
+
const {
|
|
176
|
+
openState
|
|
177
|
+
} = props;
|
|
178
|
+
const {
|
|
179
|
+
host_static_assets,
|
|
180
|
+
environment_assets
|
|
181
|
+
} = useEnvironment();
|
|
182
|
+
const {
|
|
183
|
+
classes
|
|
184
|
+
} = useSideBar();
|
|
185
|
+
return /* @__PURE__ */ jsx(ArrowIconRoot, {
|
|
186
|
+
className: classes.arrowIconRoot,
|
|
187
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
188
|
+
[TEST_PROP_ID]: getNameDataTestId$1("arrowIconRoot")
|
|
189
|
+
} : {},
|
|
190
|
+
children: /* @__PURE__ */ jsx(Icon, {
|
|
191
|
+
src: `${host_static_assets}/${environment_assets}/frontend/components/sidebar/assets/icons/ChevronRight.svg`,
|
|
192
|
+
rotationAngle: openState ? 90 : 0
|
|
193
|
+
})
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
export {
|
|
197
|
+
ArrowIcon as A,
|
|
198
|
+
Icon as I,
|
|
199
|
+
IconButtonAnimate as a
|
|
200
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const ICON_PREFIX = "Icon";
|
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
export declare type SizeIcon = '
|
|
1
|
+
export declare type SizeIcon = 'small' | 'extraSmall' | 'medium' | 'large' | 'extraLarge';
|
|
2
2
|
export interface TestingProps {
|
|
3
3
|
resource: any;
|
|
4
4
|
}
|
|
5
5
|
export interface IconProps {
|
|
6
6
|
src: string;
|
|
7
|
-
bgColor?: string | 'info' | 'warning' | 'error' | 'active' | 'selected' | 'disabled';
|
|
8
7
|
size?: SizeIcon;
|
|
9
8
|
rotationAngle?: number;
|
|
10
|
-
angleTransition?: number;
|
|
11
9
|
testingProps?: TestingProps;
|
|
12
10
|
}
|
|
11
|
+
export declare type DivIconProps = Pick<IconProps, 'src' | 'rotationAngle'>;
|
|
13
12
|
export declare type WrapperPlaceHolderProps = {
|
|
14
13
|
size: string;
|
|
15
14
|
};
|
|
16
|
-
export declare type OwnerState = Pick<IconProps, '
|
|
15
|
+
export declare type OwnerState = Pick<IconProps, 'size' | 'rotationAngle'>;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
1
|
import { useBase, useModuleSkeleton, BaseProvider } from "@m4l/core";
|
|
2
2
|
import { forwardRef, useState, useRef, useImperativeHandle, useEffect, useMemo } from "react";
|
|
3
|
-
import {
|
|
3
|
+
import { T as TEST_PROP_ID } from "../../vendor.a15d263e.js";
|
|
4
|
+
import { jsx, Fragment, jsxs } from "react/jsx-runtime";
|
|
4
5
|
import { styled, Skeleton as Skeleton$1, generateUtilityClasses, generateUtilityClass } from "@mui/material";
|
|
5
6
|
import { unstable_composeClasses } from "@mui/base";
|
|
6
7
|
function isIntersectionObserverAvailable() {
|
|
7
8
|
return typeof window !== "undefined" && "IntersectionObserver" in window && "IntersectionObserverEntry" in window;
|
|
8
9
|
}
|
|
10
|
+
const IMAGE_PREFIX = "Image";
|
|
11
|
+
const getNameDataTestId = (KEY) => {
|
|
12
|
+
return `${IMAGE_PREFIX}-${KEY}`;
|
|
13
|
+
};
|
|
9
14
|
const checkIntersections = (entries) => {
|
|
10
15
|
entries.forEach((entry) => {
|
|
11
16
|
if (entry.isIntersecting) {
|
|
@@ -27,6 +32,9 @@ const BasicIntersectComponent = forwardRef((props, ref) => {
|
|
|
27
32
|
setIsVisible,
|
|
28
33
|
threshold
|
|
29
34
|
} = props;
|
|
35
|
+
const {
|
|
36
|
+
classes
|
|
37
|
+
} = useBase();
|
|
30
38
|
const [observer] = useState(getObserver(threshold));
|
|
31
39
|
const intersectComponentRef = useRef(null);
|
|
32
40
|
useImperativeHandle(ref, () => intersectComponentRef.current);
|
|
@@ -52,9 +60,12 @@ const BasicIntersectComponent = forwardRef((props, ref) => {
|
|
|
52
60
|
styleProp.minHeight = height;
|
|
53
61
|
}
|
|
54
62
|
return /* @__PURE__ */ jsx("span", {
|
|
63
|
+
className: classes.span,
|
|
55
64
|
ref: intersectComponentRef,
|
|
56
65
|
style: styleProp,
|
|
57
|
-
"
|
|
66
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
67
|
+
[TEST_PROP_ID]: getNameDataTestId("span")
|
|
68
|
+
} : {}
|
|
58
69
|
});
|
|
59
70
|
});
|
|
60
71
|
BasicIntersectComponent.displayName = "IntersectComponent";
|
|
@@ -70,17 +81,14 @@ function LazyLoadComponent(props) {
|
|
|
70
81
|
const {
|
|
71
82
|
classes
|
|
72
83
|
} = useBase();
|
|
73
|
-
if (isVisible) {
|
|
74
|
-
return /* @__PURE__ */ jsx(WrapperLazyLoadComponent, {
|
|
75
|
-
className: classes.lazyLoad,
|
|
76
|
-
"data-testid": "WrapperLazyLoadComponent",
|
|
77
|
-
children
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
84
|
return /* @__PURE__ */ jsx(WrapperLazyLoadComponent, {
|
|
81
85
|
className: classes.lazyLoad,
|
|
82
|
-
"
|
|
83
|
-
|
|
86
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
87
|
+
[TEST_PROP_ID]: getNameDataTestId("lazyLoad")
|
|
88
|
+
} : {},
|
|
89
|
+
children: isVisible ? /* @__PURE__ */ jsx(Fragment, {
|
|
90
|
+
children
|
|
91
|
+
}) : /* @__PURE__ */ jsx(BasicIntersectComponent, {
|
|
84
92
|
useIntersectionObserver,
|
|
85
93
|
setIsVisible,
|
|
86
94
|
...other
|
|
@@ -88,41 +96,10 @@ function LazyLoadComponent(props) {
|
|
|
88
96
|
});
|
|
89
97
|
}
|
|
90
98
|
const ImageRoot = styled("div", {
|
|
91
|
-
shouldForwardProp: (props) => props !== "
|
|
99
|
+
shouldForwardProp: (props) => props !== "imageClasses"
|
|
92
100
|
})(({
|
|
93
|
-
theme
|
|
94
|
-
height,
|
|
95
|
-
width,
|
|
96
|
-
imageClasses: imageClasses2
|
|
101
|
+
theme
|
|
97
102
|
}) => ({
|
|
98
|
-
position: "relative",
|
|
99
|
-
width,
|
|
100
|
-
height,
|
|
101
|
-
minHeight: height,
|
|
102
|
-
minWidth: width,
|
|
103
|
-
[`&.${imageClasses2.root}`]: {
|
|
104
|
-
[`.${imageClasses2.img}`]: {
|
|
105
|
-
opacity: 0,
|
|
106
|
-
position: "absolute",
|
|
107
|
-
inset: "0",
|
|
108
|
-
width: "100%",
|
|
109
|
-
height: "100%"
|
|
110
|
-
},
|
|
111
|
-
[`.${imageClasses2.loaded} .${imageClasses2.img}`]: {
|
|
112
|
-
opacity: 1,
|
|
113
|
-
transition: "opacity .5s"
|
|
114
|
-
},
|
|
115
|
-
[`.${imageClasses2.skeletonImage}, .${imageClasses2.skeletonCircle}`]: {
|
|
116
|
-
opacity: 1,
|
|
117
|
-
width,
|
|
118
|
-
height
|
|
119
|
-
},
|
|
120
|
-
[`.${imageClasses2.loaded} .${imageClasses2.skeletonImage},
|
|
121
|
-
.${imageClasses2.loaded} .${imageClasses2.skeletonCircle}`]: {
|
|
122
|
-
opacity: 0,
|
|
123
|
-
transition: "opacity .3s"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
103
|
...theme.components?.M4LImage?.styleOverrides
|
|
127
104
|
}));
|
|
128
105
|
const WrapperSkeletonImage = styled("div")(() => ({
|
|
@@ -136,14 +113,22 @@ const WrapperSkeletonImage = styled("div")(() => ({
|
|
|
136
113
|
}));
|
|
137
114
|
const Skeleton = (props) => {
|
|
138
115
|
const {
|
|
139
|
-
skeletonVariant
|
|
116
|
+
skeletonVariant,
|
|
117
|
+
width,
|
|
118
|
+
height
|
|
140
119
|
} = props;
|
|
141
120
|
const {
|
|
142
121
|
classes
|
|
143
122
|
} = useBase();
|
|
144
123
|
return skeletonVariant === "image" ? /* @__PURE__ */ jsx(WrapperSkeletonImage, {
|
|
145
124
|
className: classes.skeletonImage,
|
|
146
|
-
"
|
|
125
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
126
|
+
[TEST_PROP_ID]: getNameDataTestId("skeletonImage")
|
|
127
|
+
} : {},
|
|
128
|
+
style: {
|
|
129
|
+
width,
|
|
130
|
+
height
|
|
131
|
+
},
|
|
147
132
|
children: /* @__PURE__ */ jsx(Skeleton$1, {
|
|
148
133
|
variant: "rectangular",
|
|
149
134
|
width: "100%",
|
|
@@ -154,7 +139,9 @@ const Skeleton = (props) => {
|
|
|
154
139
|
width: "100%",
|
|
155
140
|
height: "100%",
|
|
156
141
|
className: classes.skeletonCircle,
|
|
157
|
-
"
|
|
142
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
143
|
+
[TEST_PROP_ID]: getNameDataTestId("skeletonCircle")
|
|
144
|
+
} : {}
|
|
158
145
|
});
|
|
159
146
|
};
|
|
160
147
|
const componentName = "M4LImage";
|
|
@@ -162,6 +149,7 @@ const imageClasses = generateUtilityClasses(componentName, [
|
|
|
162
149
|
"root",
|
|
163
150
|
"lazyLoad",
|
|
164
151
|
"img",
|
|
152
|
+
"span",
|
|
165
153
|
"skeletonImage",
|
|
166
154
|
"skeletonCircle",
|
|
167
155
|
"loaded"
|
|
@@ -183,17 +171,80 @@ const useUtilityClasses = (ownerState) => {
|
|
|
183
171
|
...composedClasses
|
|
184
172
|
};
|
|
185
173
|
};
|
|
174
|
+
const ratioOptions = {
|
|
175
|
+
"1.168:1": {
|
|
176
|
+
width: 1.168,
|
|
177
|
+
height: 1
|
|
178
|
+
},
|
|
179
|
+
"16:9": {
|
|
180
|
+
width: 16,
|
|
181
|
+
height: 9
|
|
182
|
+
},
|
|
183
|
+
"1:1": {
|
|
184
|
+
width: 1,
|
|
185
|
+
height: 1
|
|
186
|
+
},
|
|
187
|
+
"1:1.168": {
|
|
188
|
+
width: 1,
|
|
189
|
+
height: 1.168
|
|
190
|
+
},
|
|
191
|
+
"2:1": {
|
|
192
|
+
width: 2,
|
|
193
|
+
height: 1
|
|
194
|
+
},
|
|
195
|
+
"2:3": {
|
|
196
|
+
width: 2,
|
|
197
|
+
height: 3
|
|
198
|
+
},
|
|
199
|
+
"3:1": {
|
|
200
|
+
width: 3,
|
|
201
|
+
height: 1
|
|
202
|
+
},
|
|
203
|
+
"3:2": {
|
|
204
|
+
width: 3,
|
|
205
|
+
height: 2
|
|
206
|
+
},
|
|
207
|
+
"3:4": {
|
|
208
|
+
width: 3,
|
|
209
|
+
height: 4
|
|
210
|
+
},
|
|
211
|
+
"4:3": {
|
|
212
|
+
width: 4,
|
|
213
|
+
height: 3
|
|
214
|
+
},
|
|
215
|
+
"5:2": {
|
|
216
|
+
width: 5,
|
|
217
|
+
height: 2
|
|
218
|
+
}
|
|
219
|
+
};
|
|
220
|
+
const getRatioValues = (ratio) => {
|
|
221
|
+
const numType = ratioOptions[ratio];
|
|
222
|
+
const numRef = numType.width / numType.height;
|
|
223
|
+
if (numRef >= 1) {
|
|
224
|
+
return {
|
|
225
|
+
width: "100%",
|
|
226
|
+
height: `${Math.trunc(numRef * 100)}%`
|
|
227
|
+
};
|
|
228
|
+
} else {
|
|
229
|
+
return {
|
|
230
|
+
width: `${Math.trunc(numRef * 100)}%`,
|
|
231
|
+
height: "100%"
|
|
232
|
+
};
|
|
233
|
+
}
|
|
234
|
+
};
|
|
186
235
|
function Image(props) {
|
|
187
236
|
const {
|
|
188
237
|
src,
|
|
189
238
|
alt,
|
|
190
239
|
useIntersectionObserver = true,
|
|
191
240
|
threshold = 100,
|
|
241
|
+
skeletonVariant = "image",
|
|
242
|
+
testingProps,
|
|
192
243
|
width,
|
|
193
244
|
height,
|
|
194
|
-
|
|
195
|
-
testingProps
|
|
245
|
+
ratio = "1:1"
|
|
196
246
|
} = props;
|
|
247
|
+
const ratioImage = getRatioValues(ratio);
|
|
197
248
|
const isSKeleton = useModuleSkeleton();
|
|
198
249
|
const [statusLoad, setStatusLoad] = useState(testingProps?.statusLoad || "initial");
|
|
199
250
|
useEffect(() => {
|
|
@@ -219,25 +270,42 @@ function Image(props) {
|
|
|
219
270
|
const classes = useUtilityClasses(ownerState);
|
|
220
271
|
const lazyLoadComponent = useMemo(() => {
|
|
221
272
|
return /* @__PURE__ */ jsx(ImageRoot, {
|
|
222
|
-
width,
|
|
223
|
-
height,
|
|
224
273
|
className: classes.root,
|
|
225
274
|
imageClasses,
|
|
226
|
-
"
|
|
275
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
276
|
+
[TEST_PROP_ID]: getNameDataTestId("root")
|
|
277
|
+
} : {},
|
|
278
|
+
...width && height ? {
|
|
279
|
+
style: {
|
|
280
|
+
width,
|
|
281
|
+
height
|
|
282
|
+
}
|
|
283
|
+
} : {
|
|
284
|
+
sx: {
|
|
285
|
+
width: "100%",
|
|
286
|
+
height: "100%"
|
|
287
|
+
}
|
|
288
|
+
},
|
|
227
289
|
children: /* @__PURE__ */ jsxs(LazyLoadComponent, {
|
|
228
|
-
width,
|
|
229
|
-
height,
|
|
290
|
+
width: "100%",
|
|
291
|
+
height: "100%",
|
|
230
292
|
useIntersectionObserver,
|
|
231
293
|
threshold,
|
|
232
294
|
testingProps,
|
|
233
295
|
children: [statusLoad !== "removed" ? /* @__PURE__ */ jsx(Skeleton, {
|
|
234
|
-
skeletonVariant
|
|
296
|
+
skeletonVariant,
|
|
297
|
+
width: !width ? "100%" : ratioImage.width,
|
|
298
|
+
height: !height ? "100%" : ratioImage.height
|
|
235
299
|
}) : null, /* @__PURE__ */ jsx("img", {
|
|
236
300
|
alt,
|
|
237
301
|
src,
|
|
238
302
|
onLoad,
|
|
239
303
|
className: classes.img,
|
|
240
|
-
"
|
|
304
|
+
width: !width ? "100%" : ratioImage.width,
|
|
305
|
+
height: !height ? "100%" : ratioImage.height,
|
|
306
|
+
...process.env.NODE_ENV !== "production" ? {
|
|
307
|
+
[TEST_PROP_ID]: getNameDataTestId("img")
|
|
308
|
+
} : {}
|
|
241
309
|
})]
|
|
242
310
|
})
|
|
243
311
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const IMAGE_PREFIX = "Image";
|