@m4l/components 9.3.6 → 9.3.8-BE190825-beta.1

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 (125) hide show
  1. package/@types/types.d.ts +25 -0
  2. package/components/DataGrid/Datagrid.styles.js +2 -2
  3. package/components/DragResizeWindowRND/constants.d.ts +44 -0
  4. package/components/DragResizeWindowRND/constants.js +46 -1
  5. package/components/DragResizeWindowRND/index.d.ts +1 -0
  6. package/components/DynamicFilter/DynamicFilter.styles.js +8 -4
  7. package/components/DynamicFilter/subcomponents/FilterActions/FilterActions.js +3 -0
  8. package/components/DynamicSort/DynamicSort.styles.js +8 -4
  9. package/components/FormContainer/FormContainer.d.ts +7 -0
  10. package/components/FormContainer/FormContainer.js +21 -0
  11. package/components/FormContainer/FormContainer.styles.d.ts +2 -0
  12. package/components/FormContainer/FormContainer.styles.js +27 -0
  13. package/components/FormContainer/constants.d.ts +2 -0
  14. package/components/FormContainer/constants.js +8 -0
  15. package/components/FormContainer/index.d.ts +1 -0
  16. package/components/FormContainer/index.js +1 -0
  17. package/components/FormContainer/slots/FormContainerEnum.d.ts +5 -0
  18. package/components/FormContainer/slots/FormContainerEnum.js +9 -0
  19. package/components/FormContainer/slots/FormContainerSlots.d.ts +9 -0
  20. package/components/FormContainer/slots/FormContainerSlots.js +22 -0
  21. package/components/FormContainer/test/FormContainer.test.d.ts +1 -0
  22. package/components/FormContainer/types.d.ts +11 -0
  23. package/components/ImageText/ImageText.d.ts +7 -0
  24. package/components/ImageText/ImageText.js +62 -0
  25. package/components/ImageText/ImageText.styles.d.ts +2 -0
  26. package/components/ImageText/ImageText.styles.js +79 -0
  27. package/components/ImageText/constants.d.ts +16 -0
  28. package/components/ImageText/constants.js +10 -0
  29. package/components/ImageText/index.d.ts +1 -0
  30. package/components/ImageText/index.js +1 -0
  31. package/components/ImageText/slots/ImageTextEnum.d.ts +8 -0
  32. package/components/ImageText/slots/ImageTextEnum.js +12 -0
  33. package/components/ImageText/slots/ImageTextSlots.d.ts +18 -0
  34. package/components/ImageText/slots/ImageTextSlots.js +38 -0
  35. package/components/ImageText/types.d.ts +40 -0
  36. package/components/NoItemPrivileges/NoItemPrivileges.d.ts +7 -0
  37. package/components/NoItemPrivileges/NoItemPrivileges.js +33 -0
  38. package/components/NoItemPrivileges/NoItemPrivilegesStyles.d.ts +5 -0
  39. package/components/NoItemPrivileges/NoItemPrivilegesStyles.js +6 -0
  40. package/components/NoItemPrivileges/constants.d.ts +3 -0
  41. package/components/NoItemPrivileges/constants.js +10 -0
  42. package/components/NoItemPrivileges/dictionary.d.ts +5 -0
  43. package/components/NoItemPrivileges/dictionary.js +12 -0
  44. package/components/NoItemPrivileges/index.d.ts +3 -0
  45. package/components/NoItemPrivileges/index.js +1 -0
  46. package/components/NoItemPrivileges/slots/NoItemPrivilegesEnum.d.ts +3 -0
  47. package/components/NoItemPrivileges/slots/NoItemPrivilegesEnum.js +7 -0
  48. package/components/NoItemPrivileges/slots/NoItemPrivilegesSlots.d.ts +3 -0
  49. package/components/NoItemPrivileges/slots/NoItemPrivilegesSlots.js +12 -0
  50. package/components/NoItemPrivileges/test/NoItemPrivileges.test.d.ts +1 -0
  51. package/components/NoItemPrivileges/types.d.ts +36 -0
  52. package/components/NoItemSelected/NoItemSelected.js +16 -59
  53. package/components/NoItemSelected/NoItemSelected.styles.js +1 -100
  54. package/components/NoItemSelected/constant.d.ts +2 -2
  55. package/components/NoItemSelected/constant.js +4 -4
  56. package/components/NoItemSelected/dictionary.d.ts +0 -2
  57. package/components/NoItemSelected/dictionary.js +4 -3
  58. package/components/NoItemSelected/slots/NoItemSelectedEnum.d.ts +1 -7
  59. package/components/NoItemSelected/slots/NoItemSelectedEnum.js +0 -6
  60. package/components/NoItemSelected/slots/NoItemSelectedSlots.d.ts +1 -19
  61. package/components/NoItemSelected/slots/NoItemSelectedSlots.js +5 -37
  62. package/components/NoItemSelected/test/NoItemSelected.test.d.ts +1 -0
  63. package/components/NoItemSelected/types.d.ts +5 -6
  64. package/components/ObjectLogs/helpers/Fields/filterFields.d.ts +5 -0
  65. package/components/ObjectLogs/helpers/Fields/filterFields.js +81 -0
  66. package/components/ObjectLogs/hooks/useDetailFormatter.js +2 -2
  67. package/components/ObjectLogs/hooks/useFilterAndSort.d.ts +15 -0
  68. package/components/ObjectLogs/hooks/useFilterAndSort.js +52 -0
  69. package/components/ObjectLogs/slots/ObjectLogsSlots.js +1 -2
  70. package/components/ObjectLogs/subcomponents/ObjectLogsByM4L/ObjectLogsByM4L.js +39 -88
  71. package/components/ObjectLogs/subcomponents/ObjectLogsByOthers/ObjectLogsByOthers.js +30 -104
  72. package/components/PaperForm/PaperForm.js +6 -4
  73. package/components/PaperForm/index.js +1 -0
  74. package/components/PaperForm/styles.js +21 -10
  75. package/components/PaperForm/types.d.ts +3 -2
  76. package/components/PropertyValue/PropertyValue.styles.js +2 -1
  77. package/components/SideBar/subcomponents/ContentComponent/style.js +3 -0
  78. package/components/SideBar/subcomponents/TreeGroupItems/styles.js +1 -1
  79. package/components/SideBar/subcomponents/TreeGroupItems/subcomponents/NodeMenuItem/index.js +1 -1
  80. package/components/formatters/BooleanFormatter/BooleanFormatter.js +1 -0
  81. package/components/hook-form/RHFTextField/RHFTextField.js +5 -3
  82. package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
  83. package/components/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.js +63 -55
  84. package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +1 -1
  85. package/components/index.d.ts +4 -1
  86. package/components/mui_extended/Autocomplete/Autocomplete.js +2 -1
  87. package/components/mui_extended/Autocomplete/hooks/useEndAdornments.d.ts +1 -0
  88. package/components/mui_extended/Autocomplete/hooks/useEndAdornments.js +4 -2
  89. package/components/mui_extended/Autocomplete/hooks/useValuesAndHandlers.js +1 -1
  90. package/components/mui_extended/Autocomplete/slots/AutocompleteSlots.d.ts +1 -1
  91. package/components/mui_extended/Tab/Tab.styles.js +7 -7
  92. package/components/mui_extended/TabContent/TabContent.styles.js +1 -1
  93. package/components/mui_extended/TextField/TextField.js +13 -2
  94. package/components/mui_extended/TextField/TextField.styles.js +40 -3
  95. package/components/mui_extended/TextField/constants.d.ts +4 -0
  96. package/components/mui_extended/TextField/index.d.ts +1 -0
  97. package/components/mui_extended/TextField/slots/TextFieldEnum.d.ts +5 -1
  98. package/components/mui_extended/TextField/slots/TextFieldEnum.js +4 -0
  99. package/components/mui_extended/TextField/slots/TextFieldSlots.d.ts +18 -0
  100. package/components/mui_extended/TextField/slots/TextFieldSlots.js +22 -2
  101. package/components/mui_extended/TextField/types.d.ts +9 -0
  102. package/hooks/index.d.ts +1 -0
  103. package/hooks/useDynamicFilterAndSort/types.d.ts +2 -0
  104. package/hooks/useDynamicFilterAndSort/useDynamicFilterAndSort.js +5 -3
  105. package/hooks/useIsVisible/constants.d.ts +1 -0
  106. package/hooks/useIsVisible/constants.js +4 -0
  107. package/hooks/useIsVisible/index.d.ts +1 -0
  108. package/hooks/useIsVisible/index.js +1 -0
  109. package/hooks/useIsVisible/useIsVisible.d.ts +28 -0
  110. package/hooks/useIsVisible/useIsVisible.js +25 -0
  111. package/index.js +44 -32
  112. package/package.json +1 -1
  113. package/storybook/components/FormContainer/FormContainer.stories.d.ts +13 -0
  114. package/storybook/components/NoItemPrivileges/NoItemPrivileges.stories.d.ts +12 -0
  115. package/storybook/components/NoItemSelect/NoItemSelect.stories.d.ts +1 -1
  116. package/storybook/components/extended/mui/TextField/TextFieldText.stories.d.ts +7 -0
  117. package/storybook/components/paperForm/PaperForm.stories.d.ts +5 -0
  118. package/storybook/hook-form/RHFTextField/RHFTextField.stories.d.ts +4 -0
  119. package/storybook/hook-form/RHFTextFieldPassword/RHFTextFieldPassword.stories.d.ts +19 -0
  120. package/utils/getLimitCharacters/getLimitCharacters.d.ts +7 -0
  121. package/utils/getLimitCharacters/getLimitCharacters.js +11 -0
  122. package/utils/getLimitCharacters/index.d.ts +1 -0
  123. package/utils/getLimitCharacters/index.js +1 -0
  124. package/utils/getLimitCharacters/test/getLimitCharacters.test.d.ts +1 -0
  125. package/utils/getLimitCharacters/types.d.ts +11 -0
@@ -0,0 +1,12 @@
1
+ var ImageTextSlots = /* @__PURE__ */ ((ImageTextSlots2) => {
2
+ ImageTextSlots2["root"] = "root";
3
+ ImageTextSlots2["imageContainer"] = "imageContainer";
4
+ ImageTextSlots2["img"] = "img";
5
+ ImageTextSlots2["wrapperTitleMessage"] = "wrapperTitleMessage";
6
+ ImageTextSlots2["title"] = "title";
7
+ ImageTextSlots2["message"] = "message";
8
+ return ImageTextSlots2;
9
+ })(ImageTextSlots || {});
10
+ export {
11
+ ImageTextSlots as I
12
+ };
@@ -0,0 +1,18 @@
1
+ export declare const ImageTextContainerRoot: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
2
+ ownerState?: (Partial<import('../types').ImageTextOwnerState> & Record<string, unknown>) | undefined;
3
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
4
+ export declare const ImageContainerStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
5
+ ownerState?: (Partial<import('../types').ImageTextOwnerState> & Record<string, unknown>) | undefined;
6
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
7
+ export declare const ImgStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Image').ImageProps, keyof import('../../Image').ImageProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
8
+ ownerState?: (Partial<import('../types').ImageTextOwnerState> & Record<string, unknown>) | undefined;
9
+ }, {}, {}>;
10
+ export declare const WrapperTitleMessageStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
11
+ ownerState?: (Partial<import('../types').ImageTextOwnerState> & Record<string, unknown>) | undefined;
12
+ }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
13
+ export declare const TypographyTitleStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
14
+ ownerState?: (Partial<import('../types').ImageTextOwnerState> & Record<string, unknown>) | undefined;
15
+ }, {}, {}>;
16
+ export declare const TypographyMessageStyled: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
17
+ ownerState?: (Partial<import('../types').ImageTextOwnerState> & Record<string, unknown>) | undefined;
18
+ }, {}, {}>;
@@ -0,0 +1,38 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { b as IMAGE_TEXT_KEY_COMPONENT } from "../constants.js";
3
+ import { I as ImageTextSlots } from "./ImageTextEnum.js";
4
+ import { i as imageTextContainerStyles } from "../ImageText.styles.js";
5
+ import { I as Image } from "../../Image/Image.js";
6
+ import { T as Typography } from "../../mui_extended/Typography/Typography.js";
7
+ const ImageTextContainerRoot = styled("div", {
8
+ name: IMAGE_TEXT_KEY_COMPONENT,
9
+ slot: ImageTextSlots.root
10
+ })(imageTextContainerStyles?.root);
11
+ const ImageContainerStyled = styled("div", {
12
+ name: IMAGE_TEXT_KEY_COMPONENT,
13
+ slot: ImageTextSlots.imageContainer
14
+ })(imageTextContainerStyles?.imageContainer);
15
+ const ImgStyled = styled(Image, {
16
+ name: IMAGE_TEXT_KEY_COMPONENT,
17
+ slot: ImageTextSlots.img
18
+ })(imageTextContainerStyles?.img);
19
+ const WrapperTitleMessageStyled = styled("div", {
20
+ name: IMAGE_TEXT_KEY_COMPONENT,
21
+ slot: ImageTextSlots.wrapperTitleMessage
22
+ })(imageTextContainerStyles?.wrapperTitleMessage);
23
+ const TypographyTitleStyled = styled(Typography, {
24
+ name: IMAGE_TEXT_KEY_COMPONENT,
25
+ slot: ImageTextSlots.title
26
+ })(imageTextContainerStyles?.title);
27
+ const TypographyMessageStyled = styled(Typography, {
28
+ name: IMAGE_TEXT_KEY_COMPONENT,
29
+ slot: ImageTextSlots.message
30
+ })(imageTextContainerStyles?.message);
31
+ export {
32
+ ImageTextContainerRoot as I,
33
+ TypographyTitleStyled as T,
34
+ WrapperTitleMessageStyled as W,
35
+ ImageContainerStyled as a,
36
+ ImgStyled as b,
37
+ TypographyMessageStyled as c
38
+ };
@@ -0,0 +1,40 @@
1
+ import { ImageTextSlots } from './slots/ImageTextEnum';
2
+ import { M4LOverridesStyleRules } from '../../@types/augmentations';
3
+ import { IMAGE_TEXT_KEY_COMPONENT } from './constants';
4
+ import { Theme } from '@mui/material';
5
+ import { Sizes } from '@m4l/styles';
6
+ export interface ImageTextProps extends React.HTMLAttributes<HTMLDivElement> {
7
+ /**
8
+ * Clase del componente.
9
+ */
10
+ className?: string;
11
+ /**
12
+ * ID de prueba.
13
+ */
14
+ dataTestId?: string;
15
+ /**
16
+ * URL de la imagen.
17
+ */
18
+ imageUrl: string;
19
+ /**
20
+ * Título del componente.
21
+ */
22
+ title: string;
23
+ /**
24
+ * Mensaje del componente.
25
+ */
26
+ message: string;
27
+ /**
28
+ * Aria-label de la imagen.
29
+ */
30
+ imageAriaLabel?: string;
31
+ /**
32
+ * Tamaño del componente.
33
+ */
34
+ size?: Extract<Sizes, 'small' | 'medium'>;
35
+ }
36
+ export type ImageTextOwnerState = {
37
+ isVisible: boolean;
38
+ };
39
+ export type ImageTextSlotsType = keyof typeof ImageTextSlots;
40
+ export type ImageTextStyles = M4LOverridesStyleRules<ImageTextSlotsType, typeof IMAGE_TEXT_KEY_COMPONENT, Theme>;
@@ -0,0 +1,7 @@
1
+ import { NoItemPrivilegesProps } from './types';
2
+ /**
3
+ * Componente que muestra un mensaje de que no hay privilegios para el item seleccionado.
4
+ * @param props - Propiedades del componente.
5
+ * @returns Componente NoItemPrivileges.
6
+ */
7
+ export declare const NoItemPrivileges: (props: NoItemPrivilegesProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,33 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { useModuleDictionary, useEnvironment } from "@m4l/core";
3
+ import { D as DICTIONARY } from "./dictionary.js";
4
+ import { D as DEFAULT_IMAGE_URL, N as NO_ITEM_PRIVILEGES_CLASSES } from "./constants.js";
5
+ import clsx from "clsx";
6
+ import { N as NoItemPrivilegesRootStyled } from "./slots/NoItemPrivilegesSlots.js";
7
+ import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
8
+ const NoItemPrivileges = (props) => {
9
+ const { image, title, message, className, dataTestId, size } = props;
10
+ const { getLabel } = useModuleDictionary();
11
+ const { host_static_assets, environment_assets } = useEnvironment();
12
+ const imageUrl = image || `${host_static_assets}/${environment_assets}/${DEFAULT_IMAGE_URL}`;
13
+ const titleText = title || getLabel(DICTIONARY.LABEL_TITLE);
14
+ const messageText = message || getLabel(DICTIONARY.LABEL_MESSAGE);
15
+ const { currentSize } = useComponentSize(size);
16
+ return /* @__PURE__ */ jsx(
17
+ NoItemPrivilegesRootStyled,
18
+ {
19
+ imageUrl,
20
+ title: titleText,
21
+ message: messageText,
22
+ size: currentSize,
23
+ className: clsx(NO_ITEM_PRIVILEGES_CLASSES.root, className),
24
+ dataTestId,
25
+ role: "alert",
26
+ "aria-label": "NoItemPrivileges",
27
+ imageAriaLabel: "illustration no item privileges"
28
+ }
29
+ );
30
+ };
31
+ export {
32
+ NoItemPrivileges as N
33
+ };
@@ -0,0 +1,5 @@
1
+ import { NoItemPrivilegesStyles } from './types';
2
+ /**
3
+ * Estilos para el componente NoItemPrivileges.
4
+ */
5
+ export declare const noItemPrivilegesStyles: NoItemPrivilegesStyles;
@@ -0,0 +1,6 @@
1
+ const noItemPrivilegesStyles = {
2
+ root: {}
3
+ };
4
+ export {
5
+ noItemPrivilegesStyles as n
6
+ };
@@ -0,0 +1,3 @@
1
+ export declare const NO_ITEM_PRIVILEGES_KEY_COMPONENT = "M4LNoItemPrivileges";
2
+ export declare const NO_ITEM_PRIVILEGES_CLASSES: Record<string, string>;
3
+ export declare const DEFAULT_IMAGE_URL = "frontend/components/no_item_privileges/assets/img/ProtectionIllustration.svg";
@@ -0,0 +1,10 @@
1
+ import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
2
+ import { N as NoItemPrivilegesSlots } from "./slots/NoItemPrivilegesEnum.js";
3
+ const NO_ITEM_PRIVILEGES_KEY_COMPONENT = "M4LNoItemPrivileges";
4
+ const NO_ITEM_PRIVILEGES_CLASSES = getComponentClasses(NO_ITEM_PRIVILEGES_KEY_COMPONENT, [...Object.values(NoItemPrivilegesSlots), "root"]);
5
+ const DEFAULT_IMAGE_URL = "frontend/components/no_item_privileges/assets/img/ProtectionIllustration.svg";
6
+ export {
7
+ DEFAULT_IMAGE_URL as D,
8
+ NO_ITEM_PRIVILEGES_CLASSES as N,
9
+ NO_ITEM_PRIVILEGES_KEY_COMPONENT as a
10
+ };
@@ -0,0 +1,5 @@
1
+ export declare const getNoItemPrivilegesComponentsDictionary: () => string[];
2
+ export declare const DICTIONARY: {
3
+ LABEL_TITLE: string;
4
+ LABEL_MESSAGE: string;
5
+ };
@@ -0,0 +1,12 @@
1
+ const NO_ITEM_PRIVILEGES_DICTIONARY_KEY = "no_item_privileges";
2
+ const getNoItemPrivilegesComponentsDictionary = () => {
3
+ return [NO_ITEM_PRIVILEGES_DICTIONARY_KEY];
4
+ };
5
+ const DICTIONARY = {
6
+ LABEL_TITLE: `${NO_ITEM_PRIVILEGES_DICTIONARY_KEY}.label_title`,
7
+ LABEL_MESSAGE: `${NO_ITEM_PRIVILEGES_DICTIONARY_KEY}.label_message`
8
+ };
9
+ export {
10
+ DICTIONARY as D,
11
+ getNoItemPrivilegesComponentsDictionary as g
12
+ };
@@ -0,0 +1,3 @@
1
+ export { NoItemPrivileges } from './NoItemPrivileges';
2
+ export type { NoItemPrivilegesSlotsType, NoItemPrivilegesOwnerState } from './types';
3
+ export { getNoItemPrivilegesComponentsDictionary } from './dictionary';
@@ -0,0 +1,3 @@
1
+ export declare enum NoItemPrivilegesSlots {
2
+ root = "root"
3
+ }
@@ -0,0 +1,7 @@
1
+ var NoItemPrivilegesSlots = /* @__PURE__ */ ((NoItemPrivilegesSlots2) => {
2
+ NoItemPrivilegesSlots2["root"] = "root";
3
+ return NoItemPrivilegesSlots2;
4
+ })(NoItemPrivilegesSlots || {});
5
+ export {
6
+ NoItemPrivilegesSlots as N
7
+ };
@@ -0,0 +1,3 @@
1
+ export declare const NoItemPrivilegesRootStyled: import('@emotion/styled').StyledComponent<Pick<import('../../ImageText/types').ImageTextProps, keyof import('../../ImageText/types').ImageTextProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
2
+ ownerState?: (Partial<import('..').NoItemPrivilegesOwnerState> & Record<string, unknown>) | undefined;
3
+ }, {}, {}>;
@@ -0,0 +1,12 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { N as NoItemPrivilegesSlots } from "./NoItemPrivilegesEnum.js";
3
+ import { a as NO_ITEM_PRIVILEGES_KEY_COMPONENT } from "../constants.js";
4
+ import { n as noItemPrivilegesStyles } from "../NoItemPrivilegesStyles.js";
5
+ import { I as ImageText } from "../../ImageText/ImageText.js";
6
+ const NoItemPrivilegesRootStyled = styled(ImageText, {
7
+ name: NO_ITEM_PRIVILEGES_KEY_COMPONENT,
8
+ slot: NoItemPrivilegesSlots.root
9
+ })(noItemPrivilegesStyles?.root);
10
+ export {
11
+ NoItemPrivilegesRootStyled as N
12
+ };
@@ -0,0 +1,36 @@
1
+ import { Sizes } from '@m4l/styles';
2
+ import { M4LOverridesStyleRules } from '../../@types/augmentations';
3
+ import { NoItemPrivilegesSlots } from './slots/NoItemPrivilegesEnum';
4
+ import { NO_ITEM_PRIVILEGES_KEY_COMPONENT } from './constants';
5
+ import { Theme } from '@mui/material';
6
+ export type NoItemPrivilegesProps = {
7
+ /**
8
+ * Imagen que se muestra en el componente.
9
+ */
10
+ image?: string;
11
+ /**
12
+ * Título que se muestra en el componente.
13
+ */
14
+ title?: string;
15
+ /**
16
+ * Mensaje que se muestra en el componente.
17
+ */
18
+ message?: string;
19
+ /**
20
+ * Clase que se aplica al componente.
21
+ */
22
+ className?: string;
23
+ /**
24
+ * ID de prueba que se aplica al componente.
25
+ */
26
+ dataTestId?: string;
27
+ /**
28
+ * Tamaño del componente.
29
+ */
30
+ size?: Extract<Sizes, 'small' | 'medium'>;
31
+ };
32
+ export type NoItemPrivilegesOwnerState = {
33
+ isVisible: boolean;
34
+ };
35
+ export type NoItemPrivilegesSlotsType = keyof typeof NoItemPrivilegesSlots;
36
+ export type NoItemPrivilegesStyles = M4LOverridesStyleRules<NoItemPrivilegesSlotsType, typeof NO_ITEM_PRIVILEGES_KEY_COMPONENT, Theme>;
@@ -1,74 +1,31 @@
1
- import { jsxs, jsx, Fragment } from "react/jsx-runtime";
1
+ import { jsx } from "react/jsx-runtime";
2
2
  import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
- import { useMemo, useRef, useState, useEffect } from "react";
4
- import { W as WrapperNoItemSelectedStyled, N as NoItemSelectedContainer, I as ImgStyled, a as WrapperTpography, T as TypographyStyledTitle, b as TypographyStyledDetail, L as LabelDetail } from "./slots/NoItemSelectedSlots.js";
3
+ import { useMemo } from "react";
5
4
  import { clsx } from "clsx";
6
- import { c as classNoItemSelected, N as NO_ITEM_SELECT_KEY_COMPONENT } from "./constant.js";
7
- import { g as getPropDataTestId } from "../../test/getNameDataTestId.js";
8
- import { N as NoItemSelectedSlots } from "./slots/NoItemSelectedEnum.js";
5
+ import { N as NO_ITEM_SELECTED_CLASSES } from "./constant.js";
9
6
  import { D as DICTIONARY } from "./dictionary.js";
7
+ import { N as NoItemSelectedRootStyled } from "./slots/NoItemSelectedSlots.js";
10
8
  import { u as useComponentSize } from "../../hooks/useComponentSize/useComponentSize.js";
11
9
  function NoItemSelected(props) {
12
- const { image, message, size = "medium", className, dataTestId } = props;
10
+ const { image, title, message, size, className, dataTestId } = props;
13
11
  const { host_static_assets, environment_assets } = useEnvironment();
14
12
  const { currentSize } = useComponentSize(size);
15
- const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
16
13
  const { getLabel } = useModuleDictionary();
17
14
  const defaultImage = useMemo(() => {
18
15
  return `${host_static_assets}/${environment_assets}/frontend/components/no_item_selected/assets/icons/no_selected.svg`;
19
16
  }, []);
20
- const ownerState = {
21
- size
22
- };
23
- const containerRef = useRef(null);
24
- const [isVisible, setIsVisible] = useState(true);
25
- useEffect(() => {
26
- const observer = new ResizeObserver((entries) => {
27
- for (const entry of entries) {
28
- setIsVisible(entry.contentRect.height >= 49);
29
- }
30
- });
31
- if (containerRef.current) {
32
- observer.observe(containerRef.current);
33
- }
34
- return () => observer.disconnect();
35
- }, []);
36
- return /* @__PURE__ */ jsxs(
37
- WrapperNoItemSelectedStyled,
17
+ return /* @__PURE__ */ jsx(
18
+ NoItemSelectedRootStyled,
38
19
  {
39
- ...getPropDataTestId(NO_ITEM_SELECT_KEY_COMPONENT, NoItemSelectedSlots.root, dataTestId),
40
- children: [
41
- /* @__PURE__ */ jsx(NoItemSelectedContainer, { ref: containerRef, children: isVisible && /* @__PURE__ */ jsx(
42
- ImgStyled,
43
- {
44
- className: clsx(classNoItemSelected.img, "noItemSelectedImg", className),
45
- src: image || defaultImage,
46
- alt: "No item selected"
47
- }
48
- ) }),
49
- !message ? /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsxs(WrapperTpography, { size: adjustedSize, children: [
50
- /* @__PURE__ */ jsx(
51
- TypographyStyledTitle,
52
- {
53
- ownerState: { ...ownerState },
54
- skeletonWidth: 100,
55
- size: adjustedSize,
56
- "data-testid": getPropDataTestId(NO_ITEM_SELECT_KEY_COMPONENT, NoItemSelectedSlots.typographyStyledTitle, dataTestId),
57
- children: getLabel(DICTIONARY.LABEL_TITLE)
58
- }
59
- ),
60
- /* @__PURE__ */ jsx(
61
- TypographyStyledDetail,
62
- {
63
- ownerState: { ...ownerState },
64
- skeletonWidth: 200,
65
- size: adjustedSize,
66
- "data-testid": getPropDataTestId(NO_ITEM_SELECT_KEY_COMPONENT, NoItemSelectedSlots.typographyStyledDetail, dataTestId),
67
- children: getLabel(DICTIONARY.LABEL_DETAIL)
68
- }
69
- )
70
- ] }) }) : /* @__PURE__ */ jsx(LabelDetail, { children: message })
71
- ]
20
+ imageUrl: image || defaultImage,
21
+ title: title || getLabel(DICTIONARY.LABEL_TITLE),
22
+ message: message || getLabel(DICTIONARY.LABEL_DETAIL),
23
+ size: currentSize,
24
+ className: clsx(NO_ITEM_SELECTED_CLASSES.root, className),
25
+ dataTestId,
26
+ role: "alert",
27
+ "aria-label": "NoItemSelected",
28
+ imageAriaLabel: "illustration no item selected"
72
29
  }
73
30
  );
74
31
  }
@@ -1,104 +1,5 @@
1
- import { g as getTypographyStyles } from "../../utils/getTypographyStyles.js";
2
1
  const noItemSelectedStyles = {
3
- /**
4
- * 📦 Estilos para el contenedor principal del componente NoItemSelected 📦.
5
- */
6
- root: ({ theme }) => ({
7
- display: "flex",
8
- flexDirection: "column",
9
- alignItems: "center",
10
- justifyContent: "center",
11
- height: "80%",
12
- width: "100%",
13
- maxWidth: "600px",
14
- minWidth: "200px",
15
- padding: "10px",
16
- gap: theme.vars.size.baseSpacings.sp2,
17
- minHeight: "60px"
18
- }),
19
- /**
20
- * 📸 Estilos para la imagen del componente NoItemSelected 📸.
21
- */
22
- img: {},
23
- /**
24
- * 🏷️ Estilos para la etiqueta TypographyTitle del componente NoItemSelected 🏷️.
25
- */
26
- typographyStyledTitle: ({ theme, ownerState }) => ({
27
- "&.MuiTypography-root": {
28
- "&.M4lclassCssSpecificity": {
29
- display: "flex",
30
- color: theme.vars.palette.primary.semanticText,
31
- ...getTypographyStyles(
32
- theme.generalSettings.isMobile,
33
- ownerState?.size || "medium",
34
- "bodyDens"
35
- ),
36
- ...getTypographyStyles(
37
- theme.generalSettings.isMobile,
38
- ownerState?.size || "small",
39
- "bodyDens"
40
- )
41
- }
42
- }
43
- }),
44
- /**
45
- * 🏷️ Estilos para la etiqueta TypographyDetail del componente NoItemSelected 🏷️.
46
- */
47
- typographyStyledDetail: ({ theme, ownerState }) => ({
48
- "&.MuiTypography-root": {
49
- "&.M4lclassCssSpecificity": {
50
- color: theme.vars.palette.text.secondary,
51
- ...getTypographyStyles(
52
- theme.generalSettings.isMobile,
53
- ownerState?.size || "medium",
54
- "bodyDens"
55
- ),
56
- ...getTypographyStyles(
57
- theme.generalSettings.isMobile,
58
- ownerState?.size || "small",
59
- "body"
60
- )
61
- }
62
- }
63
- }),
64
- /**
65
- * 🎁 Estilos para el wrapper de la typography de NoItemSelect. 🎁
66
- */
67
- wrapperTpography: ({ theme }) => ({
68
- display: "flex",
69
- justifyContent: "center",
70
- alignItems: "center",
71
- flexDirection: "column",
72
- gap: theme.vars.size.baseSpacings["sp0-5"],
73
- "& .MuiTypography-root": {
74
- width: "auto"
75
- }
76
- }),
77
- /**
78
- * 🎁 Estilos para el wrapper de la imagen de NoItemSelect. 🎁
79
- */
80
- noItemSelectedContainer: () => ({
81
- justifyContent: "center",
82
- display: "flex",
83
- height: "100%",
84
- width: "100%",
85
- maxWidth: "150px",
86
- maxHeight: "106px",
87
- minWidth: "70px",
88
- minHeight: "50px",
89
- '& [class*="M4LImage-imgSkeleton"]': {
90
- opacity: 0
91
- },
92
- '& [class*="M4LImage"]': {
93
- width: "100%",
94
- height: "auto ",
95
- maxWidth: "150px",
96
- maxHeight: "106px",
97
- minWidth: "70px",
98
- minHeight: "50px"
99
- }
100
- }),
101
- labelDetail: {}
2
+ root: {}
102
3
  };
103
4
  export {
104
5
  noItemSelectedStyles as n
@@ -1,2 +1,2 @@
1
- export declare const NO_ITEM_SELECT_KEY_COMPONENT = "M4LNoItemSelected";
2
- export declare const classNoItemSelected: Record<string, string>;
1
+ export declare const NO_ITEM_SELECTED_KEY_COMPONENT = "M4LNoItemSelected";
2
+ export declare const NO_ITEM_SELECTED_CLASSES: Record<string, string>;
@@ -1,8 +1,8 @@
1
1
  import { g as getComponentClasses } from "../../utils/getComponentSlotRoot.js";
2
2
  import { N as NoItemSelectedSlots } from "./slots/NoItemSelectedEnum.js";
3
- const NO_ITEM_SELECT_KEY_COMPONENT = "M4LNoItemSelected";
4
- const classNoItemSelected = getComponentClasses(NO_ITEM_SELECT_KEY_COMPONENT, NoItemSelectedSlots);
3
+ const NO_ITEM_SELECTED_KEY_COMPONENT = "M4LNoItemSelected";
4
+ const NO_ITEM_SELECTED_CLASSES = getComponentClasses(NO_ITEM_SELECTED_KEY_COMPONENT, NoItemSelectedSlots);
5
5
  export {
6
- NO_ITEM_SELECT_KEY_COMPONENT as N,
7
- classNoItemSelected as c
6
+ NO_ITEM_SELECTED_CLASSES as N,
7
+ NO_ITEM_SELECTED_KEY_COMPONENT as a
8
8
  };
@@ -1,6 +1,4 @@
1
- import { Dictionary } from '@m4l/core';
2
1
  export declare function getNoItemSelectedComponentsDictionary(): string[];
3
- export declare const defaultNoItemSelectedDictionary: Dictionary;
4
2
  export declare const DICTIONARY: {
5
3
  readonly LABEL_TITLE: "no_item_selected.title";
6
4
  readonly LABEL_DETAIL: "no_item_selected.detail";
@@ -1,9 +1,10 @@
1
+ const NO_ITEM_SELECTED_DICTIONARY_KEY = "no_item_selected";
1
2
  function getNoItemSelectedComponentsDictionary() {
2
- return ["no_item_selected"];
3
+ return [NO_ITEM_SELECTED_DICTIONARY_KEY];
3
4
  }
4
5
  const DICTIONARY = {
5
- LABEL_TITLE: "no_item_selected.title",
6
- LABEL_DETAIL: "no_item_selected.detail"
6
+ LABEL_TITLE: `${NO_ITEM_SELECTED_DICTIONARY_KEY}.title`,
7
+ LABEL_DETAIL: `${NO_ITEM_SELECTED_DICTIONARY_KEY}.detail`
7
8
  };
8
9
  export {
9
10
  DICTIONARY as D,
@@ -1,9 +1,3 @@
1
1
  export declare enum NoItemSelectedSlots {
2
- root = "root",
3
- img = "img",
4
- typographyStyledTitle = "typographyStyledTitle",
5
- typographyStyledDetail = "typographyStyledDetail",
6
- labelDetail = "labelDetail",
7
- noItemSelectedContainer = "noItemSelectedContainer",
8
- wrapperTpography = "wrapperTpography"
2
+ root = "root"
9
3
  }
@@ -1,11 +1,5 @@
1
1
  var NoItemSelectedSlots = /* @__PURE__ */ ((NoItemSelectedSlots2) => {
2
2
  NoItemSelectedSlots2["root"] = "root";
3
- NoItemSelectedSlots2["img"] = "img";
4
- NoItemSelectedSlots2["typographyStyledTitle"] = "typographyStyledTitle";
5
- NoItemSelectedSlots2["typographyStyledDetail"] = "typographyStyledDetail";
6
- NoItemSelectedSlots2["labelDetail"] = "labelDetail";
7
- NoItemSelectedSlots2["noItemSelectedContainer"] = "noItemSelectedContainer";
8
- NoItemSelectedSlots2["wrapperTpography"] = "wrapperTpography";
9
3
  return NoItemSelectedSlots2;
10
4
  })(NoItemSelectedSlots || {});
11
5
  export {
@@ -1,21 +1,3 @@
1
- export declare const WrapperNoItemSelectedStyled: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
2
- ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
3
- }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
4
- export declare const ImgStyled: import('@emotion/styled').StyledComponent<Pick<import('../../Image').ImageProps, keyof import('../../Image').ImageProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
5
- ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
6
- }, {}, {}>;
7
- export declare const TypographyStyledTitle: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
8
- ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
9
- }, {}, {}>;
10
- export declare const TypographyStyledDetail: import('@emotion/styled').StyledComponent<Pick<import('../../mui_extended/Typography/types').TypographyProps, keyof import('../../mui_extended/Typography/types').TypographyProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
1
+ export declare const NoItemSelectedRootStyled: import('@emotion/styled').StyledComponent<Pick<import('../../ImageText/types').ImageTextProps, keyof import('../../ImageText/types').ImageTextProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
11
2
  ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
12
3
  }, {}, {}>;
13
- export declare const LabelDetail: import('@emotion/styled').StyledComponent<Pick<import('../../Label').LabelProps, keyof import('../../Label').LabelProps> & import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
14
- ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
15
- }, {}, {}>;
16
- export declare const NoItemSelectedContainer: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
17
- ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
18
- }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
19
- export declare const WrapperTpography: import('@emotion/styled').StyledComponent<import('@mui/system').MUIStyledCommonProps<import('@mui/material/styles').Theme> & Record<string, unknown> & {
20
- ownerState?: (Partial<import('../types').NoItemSelectedOwnerState> & Record<string, unknown>) | undefined;
21
- }, Pick<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof import('react').ClassAttributes<HTMLDivElement> | keyof import('react').HTMLAttributes<HTMLDivElement>>, {}>;
@@ -1,44 +1,12 @@
1
1
  import { styled } from "@mui/material/styles";
2
2
  import { N as NoItemSelectedSlots } from "./NoItemSelectedEnum.js";
3
- import { N as NO_ITEM_SELECT_KEY_COMPONENT } from "../constant.js";
3
+ import { a as NO_ITEM_SELECTED_KEY_COMPONENT } from "../constant.js";
4
4
  import { n as noItemSelectedStyles } from "../NoItemSelected.styles.js";
5
- import { T as Typography } from "../../mui_extended/Typography/Typography.js";
6
- import { L as Label } from "../../Label/Label.js";
7
- import { I as Image } from "../../Image/Image.js";
8
- const WrapperNoItemSelectedStyled = styled("div", {
9
- name: NO_ITEM_SELECT_KEY_COMPONENT,
5
+ import { I as ImageText } from "../../ImageText/ImageText.js";
6
+ const NoItemSelectedRootStyled = styled(ImageText, {
7
+ name: NO_ITEM_SELECTED_KEY_COMPONENT,
10
8
  slot: NoItemSelectedSlots.root
11
9
  })(noItemSelectedStyles?.root);
12
- const ImgStyled = styled(Image, {
13
- name: NO_ITEM_SELECT_KEY_COMPONENT,
14
- slot: NoItemSelectedSlots.img
15
- })(noItemSelectedStyles?.img);
16
- const TypographyStyledTitle = styled(Typography, {
17
- name: NO_ITEM_SELECT_KEY_COMPONENT,
18
- slot: NoItemSelectedSlots.typographyStyledTitle
19
- })(noItemSelectedStyles?.typographyStyledTitle);
20
- const TypographyStyledDetail = styled(Typography, {
21
- name: NO_ITEM_SELECT_KEY_COMPONENT,
22
- slot: NoItemSelectedSlots.typographyStyledDetail
23
- })(noItemSelectedStyles?.typographyStyledDetail);
24
- const LabelDetail = styled(Label, {
25
- name: NO_ITEM_SELECT_KEY_COMPONENT,
26
- slot: NoItemSelectedSlots.labelDetail
27
- })(noItemSelectedStyles?.labelDetail);
28
- const NoItemSelectedContainer = styled("div", {
29
- name: NO_ITEM_SELECT_KEY_COMPONENT,
30
- slot: NoItemSelectedSlots.noItemSelectedContainer
31
- })(noItemSelectedStyles?.noItemSelectedContainer);
32
- const WrapperTpography = styled("div", {
33
- name: NO_ITEM_SELECT_KEY_COMPONENT,
34
- slot: NoItemSelectedSlots.wrapperTpography
35
- })(noItemSelectedStyles?.wrapperTpography);
36
10
  export {
37
- ImgStyled as I,
38
- LabelDetail as L,
39
- NoItemSelectedContainer as N,
40
- TypographyStyledTitle as T,
41
- WrapperNoItemSelectedStyled as W,
42
- WrapperTpography as a,
43
- TypographyStyledDetail as b
11
+ NoItemSelectedRootStyled as N
44
12
  };