@m4l/components 9.1.93 → 9.1.95

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 (107) hide show
  1. package/@types/types.d.ts +44 -35
  2. package/components/Chip/Chip.d.ts +2 -2
  3. package/components/Chip/ChipStyles.js +10 -10
  4. package/components/Chip/index.js +1 -0
  5. package/components/Chip/types.d.ts +3 -2
  6. package/components/Chip/types.js +1 -0
  7. package/components/Color/types.d.ts +8 -0
  8. package/components/CommonActions/components/ActionFormIntro/index.d.ts +2 -2
  9. package/components/DataGrid/dictionary.d.ts +1 -1
  10. package/components/DataGrid/subcomponents/Actions/index.d.ts +1 -1
  11. package/components/DataGrid/subcomponents/Actions/subcomponents/Density/index.d.ts +1 -1
  12. package/components/DataGrid/subcomponents/Actions/subcomponents/MobileMenuActions/index.d.ts +1 -1
  13. package/components/MenuActions/MenuActions.d.ts +1 -1
  14. package/components/MenuActions/MenuActions.js +2 -1
  15. package/components/MenuActions/MenuActions.styles.js +19 -5
  16. package/components/MenuActions/types.d.ts +10 -7
  17. package/components/Pager/Pager.d.ts +2 -2
  18. package/components/Pager/Pager.styles.js +8 -8
  19. package/components/Pager/subcomponents/CustomTablePagination/CustomTablePagination.d.ts +1 -1
  20. package/components/Pager/subcomponents/CustomTablePagination/types.d.ts +3 -3
  21. package/components/Pager/subcomponents/PagerActions/PagerActions.d.ts +1 -1
  22. package/components/PropertyValue/PropertyValue.js +1 -1
  23. package/components/ToastContainer/ToastContainer.d.ts +4 -0
  24. package/components/WindowBase/WindowBase.d.ts +1 -1
  25. package/components/WindowBase/subcomponents/Header/HeaderWindowBase.d.ts +1 -1
  26. package/components/WindowBase/types.d.ts +1 -1
  27. package/components/areas/components/AreasAdmin/AreasAdmin.d.ts +13 -0
  28. package/components/areas/components/AreasAdmin/AreasAdmin.js +163 -0
  29. package/components/areas/components/AreasAdmin/AreasAdmin.styles.d.ts +2 -0
  30. package/components/areas/components/AreasAdmin/AreasAdmin.styles.js +264 -0
  31. package/components/areas/components/AreasAdmin/classes/index.js +1 -2
  32. package/components/areas/components/AreasAdmin/constants.d.ts +1 -0
  33. package/components/areas/components/AreasAdmin/constants.js +4 -0
  34. package/components/areas/components/AreasAdmin/slots/AreasAdminEnum.d.ts +23 -0
  35. package/components/areas/components/AreasAdmin/slots/AreasAdminEnum.js +27 -0
  36. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +63 -0
  37. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.js +116 -0
  38. package/components/areas/components/AreasAdmin/slots/index.d.ts +2 -0
  39. package/components/areas/components/AreasAdmin/slots/index.js +1 -0
  40. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/{index.d.ts → AreaChip.d.ts} +4 -26
  41. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/{index.js → AreaChip.js} +81 -88
  42. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/ChipActionsMobile.d.ts +8 -0
  43. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/ChipActionsMobile.js +53 -0
  44. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/index.d.ts +1 -1
  45. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/types.d.ts +18 -0
  46. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/{index.d.ts → AreaChipMobile.d.ts} +1 -1
  47. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/AreaChipMobile.js +81 -0
  48. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.d.ts +2 -3
  49. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.js +36 -78
  50. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/PanelWindowPopUp/index.d.ts +1 -1
  51. package/components/areas/components/AreasAdmin/subcomponents/PanelWindowPopUp/{index.d.ts → PanelWindowPopUp.d.ts} +1 -1
  52. package/components/areas/components/AreasAdmin/types.d.ts +47 -0
  53. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/AreaGridLayout/index.js +1 -1
  54. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/helper.d.ts +23 -3
  55. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.d.ts +1 -1
  56. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/index.js +7 -3
  57. package/components/areas/components/AreasViewer/subcomponents/Area/subcomponents/Window/subcomponents/Header/subcomponents/WindowPopUpsList/index.d.ts +1 -1
  58. package/components/areas/components/index.d.ts +1 -1
  59. package/components/areas/contexts/AreasContext/helpers/generateModuleCount.d.ts +9 -0
  60. package/components/areas/contexts/AreasContext/helpers/generateModuleCount.js +16 -0
  61. package/components/areas/contexts/AreasContext/{helper.d.ts → helpers/helper.d.ts} +3 -3
  62. package/components/areas/contexts/AreasContext/{helper.js → helpers/helper.js} +5 -5
  63. package/components/areas/contexts/AreasContext/index.js +5 -2
  64. package/components/areas/contexts/AreasContext/store.d.ts +2 -2
  65. package/components/areas/contexts/AreasContext/store.js +175 -173
  66. package/components/areas/contexts/AreasContext/tests/AreasProvider.test.d.ts +1 -0
  67. package/components/areas/contexts/AreasContext/tests/Store.test.d.ts +1 -0
  68. package/components/areas/contexts/AreasContext/types.d.ts +6 -2
  69. package/components/areas/dictionary.d.ts +1 -0
  70. package/components/areas/dictionary.js +2 -1
  71. package/components/areas/icons.d.ts +2 -0
  72. package/components/areas/icons.js +3 -1
  73. package/components/areas/types.d.ts +6 -1
  74. package/components/hook-form/RHFAutocomplete/RFHAutocompleteStyles.js +4 -4
  75. package/components/hook-form/RHFAutocomplete/RHFAutocomplete.d.ts +2 -2
  76. package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts +5 -0
  77. package/components/hook-form/RHFDateTime/RHFDateTime.d.ts +2 -2
  78. package/components/hook-form/RHFDateTime/RHFDateTime.styles.js +2 -2
  79. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.d.ts +1 -1
  80. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useRowActionsGetter.d.ts +1 -1
  81. package/components/mui_extended/Autocomplete/Autocomplete.styles.js +22 -14
  82. package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
  83. package/components/mui_extended/CheckBox/CheckBox.d.ts +4 -0
  84. package/components/mui_extended/DateTimePicker/DateTimePicker.d.ts +2 -2
  85. package/components/mui_extended/DateTimePicker/DateTimePicker.styles.js +14 -14
  86. package/components/mui_extended/Divider/Divider.d.ts +4 -0
  87. package/components/mui_extended/IconButton/IconButton.styles.js +6 -6
  88. package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +1 -1
  89. package/components/mui_extended/MenuItem/MenuItem.styles.js +39 -8
  90. package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +1 -1
  91. package/components/mui_extended/NavLink/NavLink.d.ts +4 -0
  92. package/components/mui_extended/NavLink/NavLink.styles.js +28 -6
  93. package/components/mui_extended/Popover/Popover.styles.js +4 -4
  94. package/components/mui_extended/Select/Select.styles.js +5 -5
  95. package/components/mui_extended/Select/types.d.ts +6 -0
  96. package/components/mui_extended/Stack/Stack.d.ts +4 -0
  97. package/index.js +1 -1
  98. package/package.json +2 -2
  99. package/components/areas/components/AreasAdmin/index.d.ts +0 -10
  100. package/components/areas/components/AreasAdmin/index.js +0 -95
  101. package/components/areas/components/AreasAdmin/styles.js +0 -17
  102. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.js +0 -29
  103. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/index.js +0 -56
  104. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/index.js +0 -96
  105. package/components/areas/components/AreasAdmin/subcomponents/PanelWindowPopUp/index.js +0 -54
  106. package/components/areas/utils/useOnClickOutside/index.js +0 -22
  107. /package/components/areas/{contexts/AreasContext/index.test.d.ts → components/AreasAdmin/test/AreasAdmin.test.d.ts} +0 -0
@@ -0,0 +1,116 @@
1
+ import { styled } from "@mui/material/styles";
2
+ import { A as AREAS_ADMIN_KEY_COMPONENT } from "../constants.js";
3
+ import { a as areasAdminStyles } from "../AreasAdmin.styles.js";
4
+ import { A as AreasAdminSlots } from "./AreasAdminEnum.js";
5
+ import { T as Typography } from "../../../../mui_extended/Typography/Typography.js";
6
+ import { C as Chip } from "../../../../Chip/Chip.js";
7
+ import { I as IconButton } from "../../../../mui_extended/IconButton/IconButton.js";
8
+ import { B as Button } from "../../../../mui_extended/Button/Button.js";
9
+ import { M as MenuActions } from "../../../../MenuActions/MenuActions.js";
10
+ const AreasAdminRootStyled = styled("div", {
11
+ name: AREAS_ADMIN_KEY_COMPONENT,
12
+ slot: AreasAdminSlots.root
13
+ })(areasAdminStyles?.root);
14
+ const AreasContainerChipIconStyled = styled("div", {
15
+ name: AREAS_ADMIN_KEY_COMPONENT,
16
+ slot: AreasAdminSlots.areaContainerChipIcon
17
+ })(areasAdminStyles?.areaContainerChipIcon);
18
+ const AreasContainerContentChipsStyled = styled("div", {
19
+ name: AREAS_ADMIN_KEY_COMPONENT,
20
+ slot: AreasAdminSlots.areaContainerContentChips
21
+ })(areasAdminStyles?.areaContainerContentChips);
22
+ const AreaContentChipStyled = styled("div", {
23
+ name: AREAS_ADMIN_KEY_COMPONENT,
24
+ slot: AreasAdminSlots.areaContentChip
25
+ })(areasAdminStyles?.areaContentChip);
26
+ const AreaChipRootStyled = styled("div", {
27
+ name: AREAS_ADMIN_KEY_COMPONENT,
28
+ slot: AreasAdminSlots.areaChipRoot
29
+ })(areasAdminStyles?.areaChipRoot);
30
+ const AreaContainerChipEditButtonStyled = styled("div", {
31
+ name: AREAS_ADMIN_KEY_COMPONENT,
32
+ slot: AreasAdminSlots.areaContainerChipEditButton
33
+ })(areasAdminStyles?.areaContainerChipEditButton);
34
+ const AreasAdminContentStyled = styled("div", {
35
+ name: AREAS_ADMIN_KEY_COMPONENT,
36
+ slot: AreasAdminSlots.areasAdminContent
37
+ })(areasAdminStyles?.areasAdminContent);
38
+ const ChipAreasStyled = styled(Chip, {
39
+ name: AREAS_ADMIN_KEY_COMPONENT,
40
+ slot: AreasAdminSlots.chipAreas
41
+ })(areasAdminStyles?.chipAreas);
42
+ const IconButtonAddAreaStyled = styled(IconButton, {
43
+ name: AREAS_ADMIN_KEY_COMPONENT,
44
+ slot: AreasAdminSlots.iconButtonAddArea
45
+ })(areasAdminStyles?.iconButtonAddArea);
46
+ const MenuActionsChipStyled = styled(MenuActions, {
47
+ name: AREAS_ADMIN_KEY_COMPONENT,
48
+ slot: AreasAdminSlots.menuActionsChip
49
+ })(areasAdminStyles?.menuActionsChip);
50
+ const ContainerAdminWindowsStyled = styled("div", {
51
+ name: AREAS_ADMIN_KEY_COMPONENT,
52
+ slot: AreasAdminSlots.containerAdminWindows
53
+ })(areasAdminStyles?.containerAdminWindows);
54
+ const AreaChipMobileRootStyled = styled("div", {
55
+ name: AREAS_ADMIN_KEY_COMPONENT,
56
+ slot: AreasAdminSlots.areaChipMobileRoot
57
+ })(areasAdminStyles?.areaChipMobileRoot);
58
+ const ChipMobileRootStyled = styled("div", {
59
+ name: AREAS_ADMIN_KEY_COMPONENT,
60
+ slot: AreasAdminSlots.chipMobileRoot
61
+ })(areasAdminStyles?.chipMobileRoot);
62
+ const ChipMobileContentStyled = styled("div", {
63
+ name: AREAS_ADMIN_KEY_COMPONENT,
64
+ slot: AreasAdminSlots.chipMobileContent
65
+ })(areasAdminStyles?.chipMobileContent);
66
+ const AddAreasMobileContainerStyled = styled("div", {
67
+ name: AREAS_ADMIN_KEY_COMPONENT,
68
+ slot: AreasAdminSlots.addAreasMobileContainer
69
+ })(areasAdminStyles?.addAreasMobileContainer);
70
+ const MenuActionsAreaChipMobileStyled = styled(MenuActions, {
71
+ name: AREAS_ADMIN_KEY_COMPONENT,
72
+ slot: AreasAdminSlots.menuActionsAreaChipMobile
73
+ })(areasAdminStyles?.menuActionsAreaChipMobile);
74
+ const ButtonAddAreaStyled = styled(Button, {
75
+ name: AREAS_ADMIN_KEY_COMPONENT,
76
+ slot: AreasAdminSlots.buttonAddArea
77
+ })(areasAdminStyles?.buttonAddArea);
78
+ const EditAreaChipContainerStyled = styled("div", {
79
+ name: AREAS_ADMIN_KEY_COMPONENT,
80
+ slot: AreasAdminSlots.editAreaChipContainer
81
+ })(areasAdminStyles?.editAreaChipContainer);
82
+ const EditAreaHeaderStyled = styled("div", {
83
+ name: AREAS_ADMIN_KEY_COMPONENT,
84
+ slot: AreasAdminSlots.editAreaHeader
85
+ })(areasAdminStyles?.editAreaHeader);
86
+ const EditAreaChipMobileContainerStyled = styled("div", {
87
+ name: AREAS_ADMIN_KEY_COMPONENT,
88
+ slot: AreasAdminSlots.editAreaChipMobileContainer
89
+ })(areasAdminStyles?.editAreaChipMobileContainer);
90
+ const NameChipMobileStyled = styled(Typography, {
91
+ name: AREAS_ADMIN_KEY_COMPONENT,
92
+ slot: AreasAdminSlots.nameChipMobile
93
+ })(areasAdminStyles?.nameChipMobile);
94
+ export {
95
+ AreasAdminRootStyled as A,
96
+ ButtonAddAreaStyled as B,
97
+ ContainerAdminWindowsStyled as C,
98
+ EditAreaChipContainerStyled as E,
99
+ IconButtonAddAreaStyled as I,
100
+ MenuActionsChipStyled as M,
101
+ NameChipMobileStyled as N,
102
+ AreasAdminContentStyled as a,
103
+ AreasContainerChipIconStyled as b,
104
+ AreasContainerContentChipsStyled as c,
105
+ AreaContentChipStyled as d,
106
+ AreaChipRootStyled as e,
107
+ AreaContainerChipEditButtonStyled as f,
108
+ ChipAreasStyled as g,
109
+ EditAreaHeaderStyled as h,
110
+ AreaChipMobileRootStyled as i,
111
+ AddAreasMobileContainerStyled as j,
112
+ MenuActionsAreaChipMobileStyled as k,
113
+ ChipMobileRootStyled as l,
114
+ ChipMobileContentStyled as m,
115
+ EditAreaChipMobileContainerStyled as n
116
+ };
@@ -0,0 +1,2 @@
1
+ export * from './AreasAdminEnum';
2
+ export * from './AreasAdminSlots';
@@ -1,14 +1,6 @@
1
1
  import { AreaChipProps } from './types';
2
2
  /**
3
- * <<<<<<< HEAD
4
3
  * Componente de chip de área.
5
- * <<<<<<< HEAD
6
- * @createdAt 2024-11-01 12:34:48 - automatic
7
- * =======
8
- * @createdAt 2024-11-06 09:00:05 - automatic
9
- * >>>>>>> 2cb88276 (refactor(PGK-552): refactor button)
10
- * =======
11
- * AreaChip component for rendering a chip with area details.
12
4
  *
13
5
  * Props:
14
6
  * - areaId: string - The ID of the area.
@@ -33,24 +25,10 @@ import { AreaChipProps } from './types';
33
25
  * - initialValues: { inputEditArea: string } - Initial values for the form.
34
26
  * - validationSchema: Yup.ObjectSchema - Validation schema for the form.
35
27
  * - rippleRef: React.RefObject<any> - Reference to the ripple effect.
36
- * @createdAt 2024-11-06 11:07:59 - automatic
37
- * >>>>>>> 32caab70 (refactor(PGK-552): resolve TODO documentar and styles to slots)
38
- */
39
- /**
40
- * Propiedades del componente de chip de área.
41
- * @author SebastianM - automatic
42
- * <<<<<<< HEAD
43
- * <<<<<<< HEAD
44
- * @createdAt 2024-11-01 12:34:48 - automatic
45
- * @updatedAt 2025-01-08 10:36:41 - automatic
46
- * =======
47
- * @createdAt 2024-11-06 09:00:05 - automatic
48
- * @updatedAt 2025-01-08 10:36:41 - automatic
49
- * =======
50
- * @createdAt 2024-11-06 11:07:59 - automatic
51
- * @updatedAt 2025-01-08 10:36:41 - automatic
52
- * >>>>>>> 32caab70 (refactor(PGK-552): resolve TODO documentar and styles to slots)
53
- * @updatedUser Andrés Quintero - automatic
28
+ * @author cesar - automatic
29
+ * @createdAt 2025-01-25 19:41:41 - automatic
30
+ * @updatedAt 2025-02-04 09:17:16 - automatic
31
+ * @updatedUser cesar - automatic
54
32
  */
55
33
  export declare const AreaChip: {
56
34
  (props: AreaChipProps): import("react/jsx-runtime").JSX.Element;
@@ -1,52 +1,55 @@
1
1
  import { jsxs, Fragment, jsx } from "react/jsx-runtime";
2
- import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
2
  import { useState, useRef, useMemo } from "react";
4
3
  import * as Yup from "yup";
5
4
  import { u as useAreasStore } from "../../../../hooks/useAreas/index.js";
6
- import clsx from "clsx";
7
- import { a as areasAdminClasses } from "../../classes/index.js";
5
+ import { useIsMobile } from "@m4l/graphics";
6
+ import { C as ChipActionsMobile } from "./subcomponents/ChipActionsMobile/ChipActionsMobile.js";
7
+ import { shallow } from "zustand/shallow";
8
+ import { e as AreaChipRootStyled, f as AreaContainerChipEditButtonStyled, g as ChipAreasStyled, M as MenuActionsChipStyled, E as EditAreaChipContainerStyled, h as EditAreaHeaderStyled } from "../../slots/AreasAdminSlots.js";
9
+ import { u as useComponentSize } from "../../../../../../hooks/useComponentSize/useComponentSize.js";
10
+ import { useModuleDictionary, useEnvironment } from "@m4l/core";
8
11
  import { I as ICONS } from "../../../../icons.js";
9
12
  import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../../dictionary.js";
10
- import { E as EditAreaHeader } from "./styles.js";
11
- import { useResponsiveDesktop } from "@m4l/graphics";
12
- import { C as ChipActionsMobile } from "./subcomponents/ChipActionsMobile/index.js";
13
- import { useTheme } from "@mui/material";
14
- import { shallow } from "zustand/shallow";
15
- import { I as IconButton } from "../../../../../mui_extended/IconButton/IconButton.js";
13
+ import { A as AREAS_ADMIN_KEY_COMPONENT } from "../../constants.js";
14
+ import { g as getComponentClasses } from "../../../../../../utils/getComponentSlotRoot.js";
16
15
  import { R as RHFormProvider } from "../../../../../hook-form/RHFormContext/index.js";
17
16
  import { T as Typography } from "../../../../../mui_extended/Typography/Typography.js";
18
17
  import { R as RHFTextField } from "../../../../../hook-form/RHFTextField/RHFTextField.js";
19
18
  import { A as ActionsContainer } from "../../../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
19
+ import { A as AreasAdminSlots } from "../../slots/AreasAdminEnum.js";
20
20
  import { P as Popover } from "../../../../../mui_extended/Popover/Popover.js";
21
21
  import { A as ActionCancel } from "../../../../../CommonActions/components/ActionCancel/ActionCancel.js";
22
22
  import { A as ActionIntro } from "../../../../../CommonActions/components/ActionIntro/ActionIntro.js";
23
23
  const AreaChip = (props) => {
24
- const { areaId, selected, disabled, setAnchorMenuAreas } = props;
25
- const { host_static_assets, environment_assets } = useEnvironment();
26
- const { deleteArea, selectArea, editArea } = useAreasStore((state) => state.areasActions);
27
- const { setFocus } = useAreasStore((state) => state.areaAdminActions);
24
+ const {
25
+ areaId,
26
+ selected,
27
+ //disabled,
28
+ setAnchorMenuAreas,
29
+ size,
30
+ color
31
+ } = props;
32
+ const { selectArea, editArea, deleteArea } = useAreasStore((state) => state.areasActions);
28
33
  const areaName = useAreasStore((state) => state.hashAreas[areaId].name, shallow);
29
34
  const listAreas = useAreasStore((state) => state.areasIds, shallow);
30
35
  const [open, setOpen] = useState(false);
31
- const { getLabel } = useModuleDictionary();
32
- const isDesktop = useResponsiveDesktop();
33
36
  const anchorRef = useRef(null);
34
- const theme = useTheme();
37
+ const { currentSize } = useComponentSize(size);
38
+ const isMobile = useIsMobile();
39
+ const { getLabel } = useModuleDictionary();
40
+ const { host_static_assets, environment_assets } = useEnvironment();
35
41
  const onClickDeleteArea = (e) => {
36
42
  if (listAreas.length > 1) {
37
43
  e.stopPropagation();
38
- setFocus(true);
39
44
  deleteArea(areaId);
40
45
  }
41
46
  };
42
47
  const onSubmit = (data) => {
43
48
  editArea(areaId, data.inputEditArea);
44
49
  setOpen(false);
45
- setFocus(false);
46
50
  };
47
51
  const handlerOpenPopoverEditArea = (e) => {
48
52
  e?.stopPropagation();
49
- setFocus(true);
50
53
  setOpen(true);
51
54
  };
52
55
  const initialValues = {
@@ -65,72 +68,83 @@ const AreaChip = (props) => {
65
68
  selectArea(areaId);
66
69
  };
67
70
  const rippleRef = useRef(null);
68
- const onRippleStart = (e) => {
69
- if (rippleRef.current) {
70
- rippleRef.current.start(e);
71
- }
72
- };
73
71
  const onRippleStop = (e) => {
74
72
  if (rippleRef.current) {
75
73
  rippleRef.current.stop(e);
76
74
  }
77
75
  };
76
+ const adjustedSize = currentSize === "small" || currentSize === "medium" ? currentSize : "medium";
77
+ const ownerState = {
78
+ isMobile,
79
+ color,
80
+ size: adjustedSize,
81
+ isAreaSelected: selected
82
+ };
83
+ const menuActions = [
84
+ {
85
+ type: "menuItem",
86
+ startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
87
+ label: `${getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_edit_area))}`,
88
+ onClick: handlerOpenPopoverEditArea
89
+ },
90
+ {
91
+ type: "menuItem",
92
+ startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
93
+ label: `${getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_delete_area))}`,
94
+ onClick: onClickDeleteArea
95
+ }
96
+ ];
97
+ const classes = getComponentClasses(AREAS_ADMIN_KEY_COMPONENT, AreasAdminSlots);
78
98
  return /* @__PURE__ */ jsxs(Fragment, { children: [
79
- /* @__PURE__ */ jsxs(
80
- "div",
99
+ /* @__PURE__ */ jsx(
100
+ AreaChipRootStyled,
81
101
  {
102
+ ownerState: {},
82
103
  role: "presentation",
83
104
  ref: anchorRef,
84
- onMouseDown: onRippleStart,
85
105
  onMouseUp: onRippleStop,
86
- className: clsx(
87
- areasAdminClasses.areaChipRoot,
88
- selected ? areasAdminClasses.selected : null,
89
- disabled ? areasAdminClasses.disabled : null
90
- ),
91
106
  onClick: (e) => {
92
107
  handlerOnClick(e);
93
108
  },
94
- children: [
95
- /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipTitle, children: areaName }),
96
- isDesktop ? /* @__PURE__ */ jsxs("div", { className: areasAdminClasses.areaContainerChipEditButton, children: [
97
- /* @__PURE__ */ jsx(
98
- IconButton,
99
- {
100
- className: areasAdminClasses.areaChipEditButton,
101
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
102
- size: "small",
103
- onClick: (e) => {
104
- handlerOpenPopoverEditArea(e);
105
- },
106
- tooltip: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_edit_area))
107
- }
108
- ),
109
- /* @__PURE__ */ jsx(
110
- IconButton,
109
+ children: !isMobile ? /* @__PURE__ */ jsx(
110
+ AreaContainerChipEditButtonStyled,
111
+ {
112
+ ownerState: {},
113
+ children: /* @__PURE__ */ jsx(
114
+ ChipAreasStyled,
111
115
  {
112
- className: areasAdminClasses.areaChipDeleteButton,
113
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
114
- size: "small",
115
- onClick: (e) => {
116
- onClickDeleteArea(e);
117
- },
118
- tooltip: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_delete_area))
116
+ opacity: selected ? false : true,
117
+ color: selected ? "info" : "default",
118
+ ownerState: { ...ownerState },
119
+ hasIconClose: false,
120
+ onClick: () => selectArea(areaId),
121
+ size,
122
+ label: `${areaName}`,
123
+ endIcon: /* @__PURE__ */ jsx(
124
+ MenuActionsChipStyled,
125
+ {
126
+ className: classes.menuActionsChip,
127
+ ownerState: { ...ownerState },
128
+ icon: `${host_static_assets}/${environment_assets}/frontend/components/window_base/assets/icons/${ICONS.MORE_VERTICAL}`,
129
+ arrowType: "no-arrow",
130
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
131
+ transformOrigin: { vertical: "top", horizontal: "right" },
132
+ menuActions
133
+ }
134
+ )
119
135
  }
120
136
  )
121
- ] }) : /* @__PURE__ */ jsx(
122
- ChipActionsMobile,
123
- {
124
- areaId,
125
- handlerOpenPopoverEditArea
126
- }
127
- )
128
- ]
137
+ }
138
+ ) : /* @__PURE__ */ jsx(
139
+ ChipActionsMobile,
140
+ {}
141
+ )
129
142
  }
130
143
  ),
131
144
  /* @__PURE__ */ jsx(
132
- "div",
145
+ EditAreaChipContainerStyled,
133
146
  {
147
+ ownerState: {},
134
148
  role: "presentation",
135
149
  onClick: (e) => {
136
150
  e.stopPropagation();
@@ -140,18 +154,12 @@ const AreaChip = (props) => {
140
154
  {
141
155
  arrowType: "top-center",
142
156
  open,
143
- className: areasAdminClasses.areaEditPopover,
144
157
  anchorEl: anchorRef.current,
145
158
  anchorOrigin: { vertical: "bottom", horizontal: "center" },
146
159
  transformOrigin: { vertical: "top", horizontal: "center" },
147
160
  onClose: () => {
148
- setFocus(false);
149
161
  setOpen(false);
150
162
  },
151
- sx: {
152
- mt: "10px",
153
- ...theme.components?.M4LAreasAdminEditPopover?.styleOverrides || {}
154
- },
155
163
  children: /* @__PURE__ */ jsxs(
156
164
  RHFormProvider,
157
165
  {
@@ -159,25 +167,11 @@ const AreaChip = (props) => {
159
167
  values: initialValues,
160
168
  validationSchema,
161
169
  children: [
162
- /* @__PURE__ */ jsxs(EditAreaHeader, { children: [
163
- /* @__PURE__ */ jsx(Typography, { children: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_edit_area)) }),
164
- /* @__PURE__ */ jsx(
165
- IconButton,
166
- {
167
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CLOSE}`,
168
- size: "small",
169
- onClick: () => {
170
- setFocus(false);
171
- setOpen(false);
172
- }
173
- }
174
- )
175
- ] }),
170
+ /* @__PURE__ */ jsx(EditAreaHeaderStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(Typography, { children: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_edit_area)) }) }),
176
171
  /* @__PURE__ */ jsx(
177
172
  RHFTextField,
178
173
  {
179
- name: "inputEditArea",
180
- sx: { mt: "20px" }
174
+ name: "inputEditArea"
181
175
  }
182
176
  ),
183
177
  /* @__PURE__ */ jsxs(ActionsContainer, { children: [
@@ -186,7 +180,6 @@ const AreaChip = (props) => {
186
180
  {
187
181
  onClick: () => {
188
182
  setOpen(false);
189
- setFocus(false);
190
183
  },
191
184
  variant: "outlined"
192
185
  }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * ChipActionsMobile component for rendering the actions of the chip in mobile view.
3
+ * @author Andrés Quintero - automatic
4
+ * @createdAt 2024-12-27 08:27:31 - automatic
5
+ * @updatedAt 2025-01-31 11:37:44 - automatic
6
+ * @updatedUser cesar - automatic
7
+ */
8
+ export declare const ChipActionsMobile: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,53 @@
1
+ import { jsx, Fragment } from "react/jsx-runtime";
2
+ import { useEnvironment } from "@m4l/core";
3
+ import { I as ICONS } from "../../../../../../icons.js";
4
+ import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
5
+ import { shallow } from "zustand/shallow";
6
+ import { M as MenuActions } from "../../../../../../../MenuActions/MenuActions.js";
7
+ const ChipActionsMobile = () => {
8
+ const { host_static_assets, environment_assets } = useEnvironment();
9
+ const currentAreaId = useAreasStore((state) => state.currentAreaId, shallow);
10
+ const maximizedId = useAreasStore(
11
+ (state) => state.hashAreas[currentAreaId] ? state.hashAreas[currentAreaId].maximizedId : false,
12
+ shallow
13
+ );
14
+ const { maximizeLayout } = useAreasStore((state) => state.areaActions);
15
+ const windowsLayouts = useAreasStore(
16
+ (state) => state.hashAreas[state.currentAreaId]?.layoutItemsIds?.filter((li) => state.hashWindows[li].emergeType === "layout")?.map((lim) => {
17
+ const w = state.hashWindows[lim];
18
+ return {
19
+ i: w.windowId,
20
+ url_icon: w.iconUrl,
21
+ title: w.title
22
+ };
23
+ }) ?? [],
24
+ shallow
25
+ );
26
+ const onTouched = (layoutId) => {
27
+ maximizeLayout(currentAreaId, layoutId);
28
+ };
29
+ const menuActions = windowsLayouts.map((element) => {
30
+ return {
31
+ type: "menuItem",
32
+ onClick: () => onTouched(element.i),
33
+ label: element.title,
34
+ urlIcon: element.url_icon,
35
+ checkable: true,
36
+ checked: maximizedId === element.i
37
+ };
38
+ });
39
+ return /* @__PURE__ */ jsx(Fragment, { children: maximizedId && /* @__PURE__ */ jsx(
40
+ MenuActions,
41
+ {
42
+ icon: `${host_static_assets}/${environment_assets}/frontend/components/areas_admin/assets/icons/${ICONS.PENDING_ORDER}`,
43
+ arrowType: "no-arrow",
44
+ marginTop: "12px",
45
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
46
+ transformOrigin: { vertical: "top", horizontal: "right" },
47
+ menuActions
48
+ }
49
+ ) });
50
+ };
51
+ export {
52
+ ChipActionsMobile as C
53
+ };
@@ -3,7 +3,7 @@ import { ChipActionsMobileProps } from './types';
3
3
  * TODO: Documentar
4
4
  * @author Andrés Quintero - automatic
5
5
  * @createdAt 2024-12-27 08:27:31 - automatic
6
- * @updatedAt 2025-01-22 08:48:47 - automatic
6
+ * @updatedAt 2025-01-31 11:37:44 - automatic
7
7
  * @updatedUser cesar - automatic
8
8
  */
9
9
  export declare const ChipActionsMobile: (props: ChipActionsMobileProps) => import("react/jsx-runtime").JSX.Element;
@@ -1,9 +1,27 @@
1
+ import { ComponentPalletColor, Sizes } from '@m4l/styles';
1
2
  import { FieldValues } from 'react-hook-form';
2
3
  export interface AreaChipProps {
3
4
  areaId: string;
4
5
  setAnchorMenuAreas?: React.Dispatch<React.SetStateAction<HTMLDivElement | null>>;
5
6
  selected: boolean;
6
7
  disabled: boolean;
8
+ size?: Extract<Sizes, 'small' | 'medium'>;
9
+ color?: Extract<ComponentPalletColor, 'primary'>;
10
+ }
11
+ export interface AreasChipOwnerState {
12
+ /**
13
+ * Indica si el dispositivo es móvil.
14
+ */
15
+ isMobile: boolean;
16
+ /**
17
+ * Tamaño del campo de texto.
18
+ */
19
+ size: AreaChipProps['size'];
20
+ /**
21
+ * Color del componente.
22
+ */
23
+ color: AreaChipProps['color'];
24
+ isAreaSelected: boolean;
7
25
  }
8
26
  export type AreaEditChip = {
9
27
  inputEditArea: string;
@@ -2,7 +2,7 @@
2
2
  * TODO: Documentar
3
3
  * @author SebastianM - automatic
4
4
  * @createdAt 2024-11-06 09:00:05 - automatic
5
- * @updatedAt 2025-01-22 08:50:39 - automatic
5
+ * @updatedAt 2025-01-31 11:37:44 - automatic
6
6
  * @updatedUser cesar - automatic
7
7
  */
8
8
  export declare const AreaChipMobile: () => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,81 @@
1
+ import { jsxs, jsx } from "react/jsx-runtime";
2
+ import { u as useAreasStore } from "../../../../hooks/useAreas/index.js";
3
+ import { shallow } from "zustand/shallow";
4
+ import { useModuleDictionary, useEnvironment } from "@m4l/core";
5
+ import { I as ICONS } from "../../../../icons.js";
6
+ import { useMemo } from "react";
7
+ import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../../dictionary.js";
8
+ import { C as ChipMobile } from "./subcomponents/ChipMobile/ChipMobile.js";
9
+ import { i as AreaChipMobileRootStyled, j as AddAreasMobileContainerStyled, k as MenuActionsAreaChipMobileStyled, B as ButtonAddAreaStyled } from "../../slots/AreasAdminSlots.js";
10
+ const AreaChipMobile = () => {
11
+ const areas = useAreasStore(
12
+ (state) => state.areasIds.map((a) => ({ id: a, name: state.hashAreas[a].name })),
13
+ shallow
14
+ );
15
+ const { selectArea } = useAreasStore((state) => state.areasActions);
16
+ const currentAreaId = useAreasStore((state) => state.currentAreaId, shallow);
17
+ const { addArea } = useAreasStore((state) => state.areasActions, shallow);
18
+ const { getLabel } = useModuleDictionary();
19
+ const currentArea = areas.find((area) => area.id === currentAreaId);
20
+ const { host_static_assets, environment_assets } = useEnvironment();
21
+ const menuActions = useMemo(() => {
22
+ if (areas.length === 0) {
23
+ return [
24
+ {
25
+ type: "menuItem",
26
+ startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CHECK}`,
27
+ onClick: () => {
28
+ },
29
+ label: "No hay Áreas",
30
+ disabled: true
31
+ }
32
+ ];
33
+ }
34
+ return areas.map((area) => ({
35
+ type: "menuItem",
36
+ onClick: () => selectArea(area.id),
37
+ label: area.name,
38
+ selected: area.id === currentAreaId
39
+ }));
40
+ }, [areas, currentAreaId]);
41
+ return /* @__PURE__ */ jsxs(AreaChipMobileRootStyled, { "data-testid": "area-chip-mobile", ownerState: {}, children: [
42
+ menuActions.length >= 0 ? /* @__PURE__ */ jsx(AddAreasMobileContainerStyled, { ownerState: {}, children: /* @__PURE__ */ jsx(
43
+ MenuActionsAreaChipMobileStyled,
44
+ {
45
+ ownerState: {},
46
+ urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CHEVRON_DOWN}`,
47
+ arrowType: "no-arrow",
48
+ marginTop: "12px!important",
49
+ marginLeft: "14px!important",
50
+ anchorOrigin: { vertical: "bottom", horizontal: "right" },
51
+ transformOrigin: { vertical: "top", horizontal: "right" },
52
+ menuActions,
53
+ endListElement: /* @__PURE__ */ jsx(
54
+ ButtonAddAreaStyled,
55
+ {
56
+ color: "primary",
57
+ ownerState: {},
58
+ onClick: () => {
59
+ addArea();
60
+ },
61
+ variant: "contained",
62
+ endIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
63
+ label: getLabel(getAreasDictionary(AREAS_DICCTIONARY.area_add_new))
64
+ }
65
+ )
66
+ }
67
+ ) }) : null,
68
+ currentArea ? /* @__PURE__ */ jsx(
69
+ ChipMobile,
70
+ {
71
+ areaId: currentArea.id,
72
+ selected: true,
73
+ disabled: true
74
+ },
75
+ currentArea.id
76
+ ) : null
77
+ ] });
78
+ };
79
+ export {
80
+ AreaChipMobile as A
81
+ };
@@ -14,7 +14,6 @@ import { AreaChipProps } from '../../../AreaChip/types';
14
14
  * - deleteArea: (areaId: string) => void - Function to delete an area.
15
15
  * - selectArea: (areaId: string) => void - Function to select an area.
16
16
  * - editArea: (areaId: string, data: any) => void - Function to edit an area.
17
- * - setFocus: (focus: boolean) => void - Function to set focus.
18
17
  * - areaName: string - The name of the area.
19
18
  * - listAreas: string[] - List of area IDs.
20
19
  * - open: boolean - State to control the open/close state of the popover.
@@ -27,8 +26,8 @@ import { AreaChipProps } from '../../../AreaChip/types';
27
26
  * - rippleRef: React.RefObject<any> - Reference to the ripple effect.
28
27
  * @author SebastianM - automatic
29
28
  * @createdAt 2024-11-06 11:07:59 - automatic
30
- * @updatedAt 2025-01-08 10:36:41 - automatic
31
- * @updatedUser Andrés Quintero - automatic
29
+ * @updatedAt 2025-02-04 07:14:00 - automatic
30
+ * @updatedUser cesar - automatic
32
31
  */
33
32
  export declare const ChipMobile: {
34
33
  (props: AreaChipProps): import("react/jsx-runtime").JSX.Element;