@m4l/components 9.2.32 → 9.2.34

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.
Files changed (55) hide show
  1. package/@types/export.d.ts +0 -3
  2. package/@types/types.d.ts +29 -21
  3. package/components/DataGrid/subcomponents/Actions/subcomponents/hooks/useModalSettings/index.js +1 -0
  4. package/components/DynamicFilter/DynamicFilter.d.ts +3 -3
  5. package/components/DynamicFilter/store/DynamicFilterContext.js +3 -3
  6. package/components/ObjectLogs/ObjectLogs.d.ts +5 -0
  7. package/components/ObjectLogs/components/DetailFormatter/index.js +2 -3
  8. package/components/ObjectLogs/index.d.ts +1 -5
  9. package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.d.ts +18 -2
  10. package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.js +66 -28
  11. package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.styles.d.ts +2 -0
  12. package/components/hook-form/RHFUpload/RHFUploadImage/RHFUploadImage.styles.js +117 -0
  13. package/components/hook-form/RHFUpload/RHFUploadImage/constants.d.ts +1 -0
  14. package/components/hook-form/RHFUpload/RHFUploadImage/constants.js +4 -0
  15. package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageEnum.d.ts +13 -0
  16. package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageEnum.js +17 -0
  17. package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageSlots.d.ts +33 -0
  18. package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageSlots.js +65 -0
  19. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.d.ts +5 -0
  20. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/UploadImage.js +113 -0
  21. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/dictionary.d.ts +10 -0
  22. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/dictionary.js +14 -0
  23. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/tests/UploadImage.test.d.ts +1 -0
  24. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/types.d.ts +24 -8
  25. package/components/hook-form/RHFUpload/RHFUploadImage/tests/RHFUploadImage.test.d.ts +1 -0
  26. package/components/hook-form/RHFUpload/RHFUploadImage/types.d.ts +13 -11
  27. package/components/index.d.ts +1 -1
  28. package/components/mui_extended/Divider/Divider.js +38 -0
  29. package/components/mui_extended/Divider/Divider.styles.js +51 -0
  30. package/components/mui_extended/Divider/constants.js +4 -0
  31. package/components/mui_extended/Divider/slots/DividerEnum.js +8 -0
  32. package/components/mui_extended/Divider/slots/DividerSlots.js +17 -0
  33. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +14 -17
  34. package/index.js +1 -1
  35. package/package.json +1 -1
  36. package/storybook/hook-form/RHFUploadImage/RHFUploadImage.stories.d.ts +8 -0
  37. package/components/hook-form/RHFUpload/RHFUploadImage/classes/constants.d.ts +0 -1
  38. package/components/hook-form/RHFUpload/RHFUploadImage/classes/constants.js +0 -4
  39. package/components/hook-form/RHFUpload/RHFUploadImage/classes/index.d.ts +0 -22
  40. package/components/hook-form/RHFUpload/RHFUploadImage/classes/index.js +0 -57
  41. package/components/hook-form/RHFUpload/RHFUploadImage/classes/types.d.ts +0 -18
  42. package/components/hook-form/RHFUpload/RHFUploadImage/styles.d.ts +0 -1
  43. package/components/hook-form/RHFUpload/RHFUploadImage/styles.js +0 -9
  44. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/index.d.ts +0 -5
  45. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/index.js +0 -146
  46. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.d.ts +0 -1
  47. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/styles.js +0 -7
  48. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/index.d.ts +0 -5
  49. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/index.js +0 -23
  50. package/components/hook-form/RHFUpload/RHFUploadImage/subcomponents/UploadImage/subcomponents/Skeleton/types.d.ts +0 -3
  51. package/components/hook-form/RHFUpload/RHFUploadImage/tests/constants.d.ts +0 -1
  52. package/components/hook-form/RHFUpload/RHFUploadImage/tests/constants.js +0 -4
  53. package/components/hook-form/RHFUpload/RHFUploadImage/tests/utils.d.ts +0 -2
  54. package/components/hook-form/RHFUpload/RHFUploadImage/tests/utils.js +0 -7
  55. /package/components/ObjectLogs/{index.js → ObjectLogs.js} +0 -0
@@ -0,0 +1,65 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { B as Button } from "../../../../mui_extended/Button/Button.js";
3
+ import { D as Divider } from "../../../../mui_extended/Divider/Divider.js";
4
+ import { I as IconButton } from "../../../../mui_extended/IconButton/IconButton.js";
5
+ import { T as Typography } from "../../../../mui_extended/Typography/Typography.js";
6
+ import { R as RHF_UPLOAD_IMAGE_KEY_COMPONENT } from "../constants.js";
7
+ import { r as rhfUploadImageStyles } from "../RHFUploadImage.styles.js";
8
+ import { U as UploadImageSlots } from "./RHFUploadImageEnum.js";
9
+ const RHFUploadImageRootStyled = styled("div", {
10
+ slot: UploadImageSlots.rhfUploadImageRoot,
11
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
12
+ })(rhfUploadImageStyles.rhfUploadImageRoot);
13
+ const UploadImageRootStyled = styled("div", {
14
+ slot: UploadImageSlots.uploadImageRoot,
15
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
16
+ })(rhfUploadImageStyles.uploadImageRoot);
17
+ const ContentModuleLayoutStyled = styled("div", {
18
+ slot: UploadImageSlots.contentModuleLayout,
19
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
20
+ })(rhfUploadImageStyles.contentModuleLayout);
21
+ const ContentImageStyled = styled("div", {
22
+ slot: UploadImageSlots.contentImage,
23
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
24
+ })(rhfUploadImageStyles.contentImage);
25
+ const ContentImageTextStyled = styled("div", {
26
+ slot: UploadImageSlots.contentImageText,
27
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
28
+ })(rhfUploadImageStyles.contentImageText);
29
+ const ContentMessageStyled = styled("div", {
30
+ slot: UploadImageSlots.contentMessage,
31
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
32
+ })(rhfUploadImageStyles.contentMessage);
33
+ const TypographyStyled = styled(Typography, {
34
+ slot: UploadImageSlots.typography,
35
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
36
+ })(rhfUploadImageStyles.typography);
37
+ const ButtonStyled = styled(Button, {
38
+ slot: UploadImageSlots.button,
39
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
40
+ })(rhfUploadImageStyles.button);
41
+ const IconButtonRemoveStyled = styled(IconButton, {
42
+ slot: UploadImageSlots.iconButtonRemove,
43
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
44
+ })(rhfUploadImageStyles.iconButtonRemove);
45
+ const ContainPreviewStyled = styled("div", {
46
+ slot: UploadImageSlots.containPreview,
47
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
48
+ })(rhfUploadImageStyles.containPreview);
49
+ const DividerStyled = styled(Divider, {
50
+ slot: UploadImageSlots.divider,
51
+ name: RHF_UPLOAD_IMAGE_KEY_COMPONENT
52
+ })(rhfUploadImageStyles.divider);
53
+ export {
54
+ ButtonStyled as B,
55
+ ContentModuleLayoutStyled as C,
56
+ DividerStyled as D,
57
+ IconButtonRemoveStyled as I,
58
+ RHFUploadImageRootStyled as R,
59
+ TypographyStyled as T,
60
+ UploadImageRootStyled as U,
61
+ ContainPreviewStyled as a,
62
+ ContentImageStyled as b,
63
+ ContentImageTextStyled as c,
64
+ ContentMessageStyled as d
65
+ };
@@ -0,0 +1,5 @@
1
+ import { UploadImageProps } from './types';
2
+ /**
3
+ * UploadImage es un componente que permite subir una imagen
4
+ */
5
+ export declare const UploadImage: (props: UploadImageProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,113 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { useHostTools, useEnvironment, useModuleDictionary } from "@m4l/core";
3
+ import isString from "lodash-es/isString";
4
+ import { useDropzone } from "react-dropzone";
5
+ import { g as getPropDataTestId } from "../../../../../../test/getNameDataTestId.js";
6
+ import { I as Image } from "../../../../../Image/Image.js";
7
+ import { R as RHF_UPLOAD_IMAGE_KEY_COMPONENT } from "../../constants.js";
8
+ import { U as UploadImageSlots } from "../../slots/RHFUploadImageEnum.js";
9
+ import { U as UploadImageRootStyled, C as ContentModuleLayoutStyled, a as ContainPreviewStyled, I as IconButtonRemoveStyled, b as ContentImageStyled, c as ContentImageTextStyled, T as TypographyStyled, d as ContentMessageStyled, D as DividerStyled, B as ButtonStyled } from "../../slots/RHFUploadImageSlots.js";
10
+ import { g as getUploadImageDictionary, C as COMPONENTS_DICTIONARY_KEYS } from "./dictionary.js";
11
+ import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
12
+ import { g as getComponentClasses } from "../../../../../../utils/getComponentSlotRoot.js";
13
+ import { T as Typography } from "../../../../../mui_extended/Typography/Typography.js";
14
+ const UploadImage = (props) => {
15
+ const { file, size, onDrop, onRemove, maxSize, dataTestId, error = false, multiple, ...other } = props;
16
+ const { currentSize } = useComponentSize(size);
17
+ const { toast } = useHostTools();
18
+ const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
19
+ const { getInputProps, getRootProps, open, isDragReject, isDragAccept } = useDropzone({
20
+ multiple: false,
21
+ accept: { "image/png": [], "image/jpeg": [], "image/gif": [] },
22
+ onDrop,
23
+ /**
24
+ * onDropRejected es una función que se ejecuta cuando el archivo no es aceptado
25
+ */
26
+ onDropRejected: (fileReject) => {
27
+ fileReject.forEach((rejection) => {
28
+ toast(
29
+ { title: rejection.file.name, description: rejection.errors[0].message },
30
+ { type: "error" }
31
+ );
32
+ });
33
+ },
34
+ noClick: true,
35
+ maxSize,
36
+ ...other
37
+ });
38
+ const { host_static_assets, environment_assets } = useEnvironment();
39
+ const { getLabel } = useModuleDictionary();
40
+ const ownerState = {
41
+ isDragReject,
42
+ isDragAccept,
43
+ error
44
+ };
45
+ const classses = getComponentClasses(RHF_UPLOAD_IMAGE_KEY_COMPONENT, UploadImageSlots);
46
+ return /* @__PURE__ */ jsx(
47
+ UploadImageRootStyled,
48
+ {
49
+ className: classses.uploadImageRoot,
50
+ ownerState: { ...ownerState },
51
+ ...getPropDataTestId(RHF_UPLOAD_IMAGE_KEY_COMPONENT, UploadImageSlots.uploadImageRoot, dataTestId),
52
+ children: /* @__PURE__ */ jsxs(
53
+ ContentModuleLayoutStyled,
54
+ {
55
+ ...getPropDataTestId(RHF_UPLOAD_IMAGE_KEY_COMPONENT, UploadImageSlots.contentModuleLayout, dataTestId),
56
+ ...getRootProps(),
57
+ children: [
58
+ file ? /* @__PURE__ */ jsxs(ContainPreviewStyled, { ownerState: {}, children: [
59
+ /* @__PURE__ */ jsx(
60
+ IconButtonRemoveStyled,
61
+ {
62
+ ownerState: {},
63
+ variant: "contained",
64
+ icon: `${host_static_assets}/${environment_assets}/frontend/components/chip/assets/icons/closeSmall.svg`,
65
+ onClick: onRemove,
66
+ size: adjustedSize
67
+ }
68
+ ),
69
+ /* @__PURE__ */ jsx(
70
+ Image,
71
+ {
72
+ src: isString(file) ? file : file.preview || "",
73
+ enableIntersectionObserver: false
74
+ }
75
+ )
76
+ ] }) : /* @__PURE__ */ jsxs("div", { style: { display: "flex", flexDirection: "column", justifyContent: "center", alignItems: "center" }, children: [
77
+ /* @__PURE__ */ jsx(
78
+ "input",
79
+ {
80
+ ...getInputProps()
81
+ }
82
+ ),
83
+ /* @__PURE__ */ jsxs(ContentImageStyled, { ownerState: {}, children: [
84
+ /* @__PURE__ */ jsxs(ContentImageTextStyled, { ownerState: {}, children: [
85
+ /* @__PURE__ */ jsx(
86
+ Image,
87
+ {
88
+ height: 100,
89
+ width: 100,
90
+ sizes: size,
91
+ src: `${host_static_assets}/${environment_assets}/frontend/components/RHFUploadImage/assets/icons/uploadImage.svg`
92
+ }
93
+ ),
94
+ /* @__PURE__ */ jsx(Typography, { skeletonWidth: 100, variant: "bodyDens", size: adjustedSize, children: getLabel(getUploadImageDictionary(COMPONENTS_DICTIONARY_KEYS.title_upload)) })
95
+ ] }),
96
+ /* @__PURE__ */ jsx(TypographyStyled, { skeletonWidth: 200, skeletonRows: 2, ownerState: {}, variant: "body", size: adjustedSize, children: getLabel(getUploadImageDictionary(COMPONENTS_DICTIONARY_KEYS.description)) }),
97
+ /* @__PURE__ */ jsxs(ContentMessageStyled, { ownerState: {}, children: [
98
+ /* @__PURE__ */ jsx(DividerStyled, { ownerState: {}, orientation: "horizontal", customVariant: "solid", size: adjustedSize }),
99
+ /* @__PURE__ */ jsx(TypographyStyled, { skeletonWidth: 10, ownerState: {}, variant: "body", size: adjustedSize, children: getLabel(getUploadImageDictionary(COMPONENTS_DICTIONARY_KEYS.divider_text)) }),
100
+ /* @__PURE__ */ jsx(DividerStyled, { ownerState: {}, orientation: "horizontal", customVariant: "solid", size: adjustedSize })
101
+ ] })
102
+ ] })
103
+ ] }),
104
+ !file ? /* @__PURE__ */ jsx(ButtonStyled, { ownerState: {}, variant: "contained", color: "primary", onClick: open, label: getLabel(getUploadImageDictionary(COMPONENTS_DICTIONARY_KEYS.click_button)), size: adjustedSize }) : null
105
+ ]
106
+ }
107
+ )
108
+ }
109
+ );
110
+ };
111
+ export {
112
+ UploadImage as U
113
+ };
@@ -0,0 +1,10 @@
1
+ export declare const UPLOAD_IMAGE_DICTIONARY_ID = "rhf_uploadimage";
2
+ export declare function getUploadImageComponentsDictionary(): string[];
3
+ export declare const COMPONENTS_DICTIONARY_KEYS: {
4
+ readonly click_button: "click_button";
5
+ readonly description: "description";
6
+ readonly title_upload: "title_upload";
7
+ readonly divider_text: "divider_text";
8
+ };
9
+ export type TypeDictionary = typeof COMPONENTS_DICTIONARY_KEYS;
10
+ export declare const getUploadImageDictionary: (key: keyof TypeDictionary) => string;
@@ -0,0 +1,14 @@
1
+ const UPLOAD_IMAGE_DICTIONARY_ID = "rhf_uploadimage";
2
+ const COMPONENTS_DICTIONARY_KEYS = {
3
+ click_button: "click_button",
4
+ description: "description",
5
+ title_upload: "title_upload",
6
+ divider_text: "divider_text"
7
+ };
8
+ const getUploadImageDictionary = (key) => {
9
+ return `${UPLOAD_IMAGE_DICTIONARY_ID}.${key}`;
10
+ };
11
+ export {
12
+ COMPONENTS_DICTIONARY_KEYS as C,
13
+ getUploadImageDictionary as g
14
+ };
@@ -1,16 +1,32 @@
1
- import { ReactNode } from 'react';
2
- import { DropzoneOptions } from 'react-dropzone';
1
+ import { Sizes } from '@m4l/styles';
3
2
  import { SxProps } from '@mui/material';
4
3
  import { Theme } from '@mui/material/styles';
4
+ import { DropzoneOptions } from 'react-dropzone';
5
5
  import { CustomFile } from '../../../types';
6
6
  export interface UploadImageProps extends DropzoneOptions {
7
7
  error?: boolean;
8
+ /**
9
+ * file para mostrar la imagen
10
+ */
8
11
  file: CustomFile | string | null;
9
- helperText?: ReactNode;
12
+ /**
13
+ * sx para el componente
14
+ */
10
15
  sx?: SxProps<Theme>;
11
- }
12
- export interface OwnerState {
13
- isDragReject?: boolean;
14
- isDragActive?: boolean;
15
- hasFile: string | CustomFile | null;
16
+ /**
17
+ * Tamaño del componente
18
+ */
19
+ size?: Extract<Sizes, 'small' | 'medium'>;
20
+ /**
21
+ * onRemove es una función que se ejecuta cuando se elimina la imagen
22
+ */
23
+ onRemove: () => void;
24
+ /**
25
+ * isDragActive es una propiedad booleana que indica si el componente está en estado de arrastre
26
+ */
27
+ isDragAccept?: boolean;
28
+ /**
29
+ * dataTestId
30
+ */
31
+ dataTestId?: string;
16
32
  }
@@ -1,14 +1,16 @@
1
- import { ReactNode } from 'react';
2
- import { DropzoneOptions } from 'react-dropzone';
3
- import { CustomFile } from '../types';
4
- import { SxProps } from '@mui/material';
5
1
  import { Theme } from '@mui/material/styles';
6
- export interface UploadImageProps extends DropzoneOptions {
7
- error?: boolean;
8
- file: CustomFile | string | null;
9
- helperText?: ReactNode;
10
- sx?: SxProps<Theme>;
11
- }
12
- export interface RHFUploadImageProps extends Omit<UploadImageProps, 'file' | 'onDrop'> {
2
+ import { OverridesStyleRules } from '@mui/material/styles/overrides';
3
+ import { LabelProps } from 'src/components/Label';
4
+ import { RHF_UPLOAD_IMAGE_KEY_COMPONENT } from './constants';
5
+ import { UploadImageSlots as Slots } from './slots/RHFUploadImageEnum';
6
+ import { UploadImageProps } from './subcomponents/UploadImage/types';
7
+ export interface RHFUploadImageProps extends Omit<UploadImageProps, 'file' | 'onDrop' | 'onRemove'>, Omit<LabelProps, 'size' | 'error' | 'disabled' | 'children'> {
13
8
  name: string;
14
9
  }
10
+ export type RHFUploadImageSlotsType = keyof typeof Slots;
11
+ export type RHFUploadImageOwnerState = {
12
+ isDragAccept: boolean;
13
+ isDragReject: boolean;
14
+ error: boolean;
15
+ };
16
+ export type RHFUploadImageStyles = OverridesStyleRules<RHFUploadImageSlotsType, typeof RHF_UPLOAD_IMAGE_KEY_COMPONENT, Theme>;
@@ -32,7 +32,7 @@ export * from './MenuActions';
32
32
  export * from './MFIsolationApp';
33
33
  export * from './MFLoader';
34
34
  export * from './NoItemSelected';
35
- export * from './ObjectLogs';
35
+ export * from './ObjectLogs/ObjectLogs';
36
36
  export * from './ObjectLogs/dictionary';
37
37
  export * from './PaperForm/PaperForm';
38
38
  export * from './PDFViewer';
@@ -0,0 +1,38 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import clsx from "clsx";
3
+ import { D as DividerRootStyled, a as DividerStyled } from "./slots/DividerSlots.js";
4
+ import { u as useComponentSize } from "../../../hooks/useComponentSize/useComponentSize.js";
5
+ const Divider = (props) => {
6
+ const {
7
+ className,
8
+ size = "medium",
9
+ orientation = "vertical",
10
+ customVariant = "dash",
11
+ ...other
12
+ } = props;
13
+ const { currentSize } = useComponentSize(size);
14
+ const normalizedSize = currentSize === "large" ? "medium" : currentSize;
15
+ const ownerState = {
16
+ orientation,
17
+ customVariant,
18
+ size: normalizedSize
19
+ };
20
+ return /* @__PURE__ */ jsx(
21
+ DividerRootStyled,
22
+ {
23
+ ownerState: { ...ownerState },
24
+ className: clsx(className),
25
+ children: /* @__PURE__ */ jsx(
26
+ DividerStyled,
27
+ {
28
+ ownerState: { ...ownerState },
29
+ orientation,
30
+ ...other
31
+ }
32
+ )
33
+ }
34
+ );
35
+ };
36
+ export {
37
+ Divider as D
38
+ };
@@ -0,0 +1,51 @@
1
+ import { a as getHeightSizeStyles } from "../../../utils/getSizeStyles/getSizeStyles.js";
2
+ const dividerStyles = {
3
+ /**
4
+ * 🧮 Estilos para el Root del componente `Divider`. 🧮
5
+ */
6
+ root: ({ theme, ownerState }) => ({
7
+ display: "flex",
8
+ justifyContent: "center",
9
+ alignItems: "center",
10
+ position: "relative",
11
+ ...getHeightSizeStyles(
12
+ theme.generalSettings.isMobile,
13
+ ownerState.size || "medium",
14
+ "action",
15
+ (dynamicSize) => ({
16
+ ...ownerState.orientation === "horizontal" && {
17
+ height: dynamicSize,
18
+ width: "100%"
19
+ },
20
+ ...ownerState.orientation === "vertical" && {
21
+ width: dynamicSize,
22
+ height: "100%"
23
+ }
24
+ })
25
+ )
26
+ }),
27
+ /**
28
+ * Divider Styles
29
+ */
30
+ /*
31
+ * ➗ Estilos del Divider ➗ */
32
+ /**
33
+ * Styles for the Divider component.
34
+ * @param {object} ownerState - The state of the owner component.
35
+ * @param {object} theme - The theme object.
36
+ * @returns {object} The styles for the Divider component.
37
+ */
38
+ divider: ({ ownerState, theme }) => ({
39
+ position: "absolute",
40
+ top: ownerState.orientation === "horizontal" ? "50%" : "0",
41
+ left: ownerState.orientation === "vertical" ? "50%" : "0",
42
+ transform: ownerState.orientation === "horizontal" ? "translateY(-50%)" : "translateX(0%)",
43
+ width: ownerState.orientation === "horizontal" ? "100%" : "1px",
44
+ height: ownerState.orientation === "vertical" ? "100%" : "1px",
45
+ borderColor: theme.vars.palette.border.secondary,
46
+ borderStyle: ownerState.customVariant === "dash" ? "dashed" : "solid"
47
+ })
48
+ };
49
+ export {
50
+ dividerStyles as d
51
+ };
@@ -0,0 +1,4 @@
1
+ const DIVIDER_KEY_COMPONENT = "M4LDivider";
2
+ export {
3
+ DIVIDER_KEY_COMPONENT as D
4
+ };
@@ -0,0 +1,8 @@
1
+ var DividerSlots = /* @__PURE__ */ ((DividerSlots2) => {
2
+ DividerSlots2["root"] = "root";
3
+ DividerSlots2["divider"] = "divider";
4
+ return DividerSlots2;
5
+ })(DividerSlots || {});
6
+ export {
7
+ DividerSlots as D
8
+ };
@@ -0,0 +1,17 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { Divider } from "@mui/material";
3
+ import { D as DIVIDER_KEY_COMPONENT } from "../constants.js";
4
+ import { d as dividerStyles } from "../Divider.styles.js";
5
+ import { D as DividerSlots } from "./DividerEnum.js";
6
+ const DividerRootStyled = styled("div", {
7
+ name: DIVIDER_KEY_COMPONENT,
8
+ slot: DividerSlots.root
9
+ })(dividerStyles?.root);
10
+ const DividerStyled = styled(Divider, {
11
+ name: DIVIDER_KEY_COMPONENT,
12
+ slot: DividerSlots.divider
13
+ })(dividerStyles?.divider);
14
+ export {
15
+ DividerRootStyled as D,
16
+ DividerStyled as a
17
+ };
@@ -53,23 +53,20 @@ const useDynamicFilterAndSort = (props) => {
53
53
  const handleToggles = (key) => {
54
54
  setTogglesLeftActions((prev) => ({ ...prev, [key]: !prev[key] }));
55
55
  };
56
- const handleChangeFilters = useCallback(
57
- (filters, rawFilters) => {
58
- setInvisibleBadge((prev) => ({ ...prev, filter: filters.length === 0 }));
59
- if (eventRefs.current?.eventFilters?.filters && !deepEqual(eventRefs.current?.eventFilters?.filters, filters)) {
60
- setCookie?.(prefixCookie ? `${prefixCookie}_${COOKIE_APPLIED_FILTERS}` : COOKIE_APPLIED_FILTERS, "window", filters);
61
- }
62
- eventRefs.current = {
63
- ...eventRefs.current,
64
- eventFilters: { filters, rawFilters }
65
- };
66
- if (refOnChangeFilterSort.current > 0 || refOnChangeFilterSort.current === 0 && !sorts) {
67
- onChangeFilterSort(eventRefs.current);
68
- }
69
- refOnChangeFilterSort.current++;
70
- },
71
- [onChangeFilterSort, prefixCookie, setCookie, setInvisibleBadge, sorts]
72
- );
56
+ const handleChangeFilters = useCallback((filters, rawFilters) => {
57
+ setInvisibleBadge((prev) => ({ ...prev, filter: filters.length === 0 }));
58
+ if (eventRefs.current?.eventFilters?.filters && !deepEqual(eventRefs.current?.eventFilters?.filters, filters)) {
59
+ setCookie?.(prefixCookie ? `${prefixCookie}_${COOKIE_APPLIED_FILTERS}` : COOKIE_APPLIED_FILTERS, "window", filters);
60
+ }
61
+ eventRefs.current = {
62
+ ...eventRefs.current,
63
+ eventFilters: { filters, rawFilters }
64
+ };
65
+ if (refOnChangeFilterSort.current > 0 || refOnChangeFilterSort.current === 0 && !sorts) {
66
+ onChangeFilterSort(eventRefs.current);
67
+ }
68
+ refOnChangeFilterSort.current++;
69
+ }, [onChangeFilterSort, prefixCookie, setCookie, setInvisibleBadge, sorts]);
73
70
  const handleChangeSorts = useCallback((Sorts, rawSorts) => {
74
71
  setInvisibleBadge((prev) => ({ ...prev, sort: Sorts.length === 0 }));
75
72
  if (eventRefs.current?.eventSorts?.sorts && !deepEqual(eventRefs.current?.eventSorts?.sorts, Sorts)) {
package/index.js CHANGED
@@ -160,7 +160,7 @@ import { M as M5 } from "./components/MFLoader/MFLoader.js";
160
160
  import { g as g20 } from "./components/MFLoader/dictionary.js";
161
161
  import { N as N3 } from "./components/NoItemSelected/NoItemSelected.js";
162
162
  import { g as g21 } from "./components/NoItemSelected/dictionary.js";
163
- import { O } from "./components/ObjectLogs/index.js";
163
+ import { O } from "./components/ObjectLogs/ObjectLogs.js";
164
164
  import { d as d4, g as g22 } from "./components/ObjectLogs/dictionary.js";
165
165
  import { P as P8 } from "./components/PaperForm/PaperForm.js";
166
166
  import { P as P9 } from "./components/PDFViewer/PDFViewer.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.2.32",
3
+ "version": "9.2.34",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0 --no-warn-ignored"
@@ -0,0 +1,8 @@
1
+ import { Meta, StoryObj } from '@storybook/react';
2
+ import { RHFUploadImage } from '../../../src/components/hook-form/RHFUpload/RHFUploadImage';
3
+ declare const meta: Meta<typeof RHFUploadImage>;
4
+ type Story = StoryObj<typeof RHFUploadImage>;
5
+ export default meta;
6
+ export declare const RHFUploadImageDefault: Story;
7
+ export declare const RHFUploadImageWithError: Story;
8
+ export declare const Skeleton: Story;
@@ -1 +0,0 @@
1
- export declare const componentName = "M4LRHFUploadImage";
@@ -1,4 +0,0 @@
1
- const componentName = "M4LRHFUploadImage";
2
- export {
3
- componentName as c
4
- };
@@ -1,22 +0,0 @@
1
- import { RHFUploadImageClassesType } from './types';
2
- import { OwnerState } from '../subcomponents/UploadImage/types';
3
- export declare const RHFUploadImageClasses: RHFUploadImageClassesType;
4
- export declare function getRHFUploadImagebUtilityClass(slot: string): string;
5
- /**
6
- * TODO: Documentar
7
- */
8
- export declare const RHFUploadImageUtilityClasses: (ownerState: OwnerState) => {
9
- skeleton: string;
10
- root: string;
11
- dropZoneStyle: string;
12
- containerFileImage: string;
13
- placeHolder: string;
14
- containerUploadBoddy: string;
15
- containerBodyImage: string;
16
- containerMessage: string;
17
- containerTitle: string;
18
- containerDescription: string;
19
- containerConditions: string;
20
- containerUploadImage: string;
21
- inputDropZone: string;
22
- };
@@ -1,57 +0,0 @@
1
- import { generateUtilityClasses, generateUtilityClass } from "@mui/material";
2
- import { unstable_composeClasses } from "@mui/base";
3
- import { c as componentName } from "./constants.js";
4
- generateUtilityClasses(
5
- componentName,
6
- [
7
- /* elements */
8
- "root",
9
- "dropZoneStyle",
10
- "containerFileImage",
11
- "placeHolder",
12
- "containerUploadBoddy",
13
- "containerBodyImage",
14
- "containerMessage",
15
- "containerTitle",
16
- "containerDescription",
17
- "containerConditions",
18
- "containerUploadImage",
19
- "string",
20
- "skeleton",
21
- "inputDropZone",
22
- /* states or variants of elements */
23
- "stateError"
24
- ]
25
- );
26
- function getRHFUploadImagebUtilityClass(slot) {
27
- return generateUtilityClass(componentName, slot);
28
- }
29
- const RHFUploadImageUtilityClasses = (ownerState) => {
30
- const slots = {
31
- root: [
32
- "root",
33
- ownerState.isDragReject && "stateError",
34
- ownerState.isDragActive && "stateActive",
35
- ownerState.hasFile && "hasFile"
36
- ],
37
- dropZoneStyle: ["dropZoneStyle"],
38
- containerFileImage: ["containerFileImage"],
39
- placeHolder: ["placeHolder"],
40
- containerUploadBoddy: ["containerUploadBoddy"],
41
- containerBodyImage: ["containerBodyImage"],
42
- containerMessage: ["containerMessage"],
43
- containerTitle: ["containerTitle"],
44
- containerDescription: ["containerDescription"],
45
- containerConditions: ["containerConditions"],
46
- containerUploadImage: ["containerUploadImage"],
47
- skeleton: ["skeleton"],
48
- inputDropZone: ["inputDropZone"]
49
- };
50
- const composedClasses = unstable_composeClasses(slots, getRHFUploadImagebUtilityClass, {});
51
- return {
52
- ...composedClasses
53
- };
54
- };
55
- export {
56
- RHFUploadImageUtilityClasses as R
57
- };
@@ -1,18 +0,0 @@
1
- import { RHFUploadImageUtilityClasses } from '.';
2
- export interface RHFUploadImageClassesType {
3
- root: string;
4
- dropZoneStyle: string;
5
- containerFileImage: string;
6
- placeHolder: string;
7
- containerUploadBoddy: string;
8
- containerBodyImage: string;
9
- containerMessage: string;
10
- containerTitle: string;
11
- containerDescription: string;
12
- containerConditions: string;
13
- containerUploadImage: string;
14
- skeleton: string;
15
- inputDropZone: string;
16
- }
17
- export type RHFUploadImageClassesKey = keyof RHFUploadImageClassesType;
18
- export type Classes = ReturnType<typeof RHFUploadImageUtilityClasses>;
@@ -1 +0,0 @@
1
- export declare const WrapperRHFUploadImage: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material').Theme>, import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
@@ -1,9 +0,0 @@
1
- import { styled } from "@mui/material";
2
- const WrapperRHFUploadImage = styled("div")(() => ({
3
- width: "inherit",
4
- height: "inherit",
5
- padding: "1px"
6
- }));
7
- export {
8
- WrapperRHFUploadImage as W
9
- };
@@ -1,5 +0,0 @@
1
- import { UploadImageProps } from './types';
2
- /**
3
- * TODO: Documentar
4
- */
5
- export default function UploadImage({ error, file, helperText, sx, ...other }: UploadImageProps): import("react/jsx-runtime").JSX.Element;