@m4l/components 9.1.93 → 9.1.94

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 (99) 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/test/AreasAdmin.test.d.ts +1 -0
  53. package/components/areas/components/AreasAdmin/types.d.ts +47 -0
  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/subcomponents/WindowPopUpsList/index.d.ts +1 -1
  57. package/components/areas/components/index.d.ts +1 -1
  58. package/components/areas/contexts/AreasContext/index.js +2 -0
  59. package/components/areas/contexts/AreasContext/store.d.ts +2 -2
  60. package/components/areas/contexts/AreasContext/store.js +166 -166
  61. package/components/areas/contexts/AreasContext/types.d.ts +6 -2
  62. package/components/areas/dictionary.d.ts +1 -0
  63. package/components/areas/dictionary.js +2 -1
  64. package/components/areas/icons.d.ts +2 -0
  65. package/components/areas/icons.js +3 -1
  66. package/components/areas/types.d.ts +1 -1
  67. package/components/hook-form/RHFAutocomplete/RFHAutocompleteStyles.js +4 -4
  68. package/components/hook-form/RHFAutocomplete/RHFAutocomplete.d.ts +2 -2
  69. package/components/hook-form/RHFCheckbox/RHFCheckbox.d.ts +5 -0
  70. package/components/hook-form/RHFDateTime/RHFDateTime.d.ts +2 -2
  71. package/components/hook-form/RHFDateTime/RHFDateTime.styles.js +2 -2
  72. package/components/maps/components/Map/subcomponents/Controls/subcomponents/TopLeftTools/subcomponents/PopoverToolButton/subcomponentes/LayersTool/hooks/useRowActionsGetter.d.ts +1 -1
  73. package/components/maps/components/MapGpsTools/subcomponents/TabsGpsTools/subcomponents/GeofencesList/hooks/useRowActionsGetter.d.ts +1 -1
  74. package/components/mui_extended/Autocomplete/Autocomplete.styles.js +22 -14
  75. package/components/mui_extended/Badge/slots/BadgeSlots.d.ts +1 -1
  76. package/components/mui_extended/CheckBox/CheckBox.d.ts +4 -0
  77. package/components/mui_extended/DateTimePicker/DateTimePicker.d.ts +2 -2
  78. package/components/mui_extended/DateTimePicker/DateTimePicker.styles.js +14 -14
  79. package/components/mui_extended/Divider/Divider.d.ts +4 -0
  80. package/components/mui_extended/IconButton/IconButton.styles.js +6 -6
  81. package/components/mui_extended/IconButton/slots/IconButtonSlots.d.ts +1 -1
  82. package/components/mui_extended/MenuItem/MenuItem.styles.js +39 -8
  83. package/components/mui_extended/MenuItem/slots/MenuItemSlots.js +1 -1
  84. package/components/mui_extended/NavLink/NavLink.d.ts +4 -0
  85. package/components/mui_extended/NavLink/NavLink.styles.js +28 -6
  86. package/components/mui_extended/Popover/Popover.styles.js +4 -4
  87. package/components/mui_extended/Select/Select.styles.js +5 -5
  88. package/components/mui_extended/Select/types.d.ts +6 -0
  89. package/components/mui_extended/Stack/Stack.d.ts +4 -0
  90. package/index.js +1 -1
  91. package/package.json +1 -1
  92. package/components/areas/components/AreasAdmin/index.d.ts +0 -10
  93. package/components/areas/components/AreasAdmin/index.js +0 -95
  94. package/components/areas/components/AreasAdmin/styles.js +0 -17
  95. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/styles.js +0 -29
  96. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/index.js +0 -56
  97. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/index.js +0 -96
  98. package/components/areas/components/AreasAdmin/subcomponents/PanelWindowPopUp/index.js +0 -54
  99. package/components/areas/utils/useOnClickOutside/index.js +0 -22
@@ -27,14 +27,20 @@ export type selectOption<T = unknown> = {
27
27
  export interface SelectProps<T> extends Omit<MUISelectProps<T>, 'size' | 'onChange' | 'error' | 'variant' | 'color'> {
28
28
  /**
29
29
  * Lista de opciones para enseñar en el Select.
30
+ * @createdAt 2025-01-31 11:34:36 - automatic
30
31
  */
31
32
  options: selectOption<T>[];
32
33
  /**
33
34
  * Tamaño del Select.
35
+ * @createdAt 2025-01-31 11:34:36 - automatic
34
36
  */
35
37
  size?: Extract<Sizes, 'small' | 'medium'>;
36
38
  /**
37
39
  * procedimiento para ejecutarse cuando cabia la selección.
40
+ * @author cesar - automatic
41
+ * @createdAt 2025-01-31 11:34:36 - automatic
42
+ * @updatedAt 2025-01-31 11:37:44 - automatic
43
+ * @updatedUser cesar - automatic
38
44
  */
39
45
  onChange?: (option: selectOption<T>) => void;
40
46
  /**
@@ -1,5 +1,9 @@
1
1
  import { StackProps } from './types';
2
2
  /**
3
3
  * Stack es un componente contenedor para organizar elementos vertical u horizontalmente.
4
+ * @author cesar - automatic
5
+ * @createdAt 2025-02-04 15:44:12 - automatic
6
+ * @updatedAt 2025-02-04 15:44:12 - automatic
7
+ * @updatedUser cesar - automatic
4
8
  */
5
9
  export declare const Stack: (props: StackProps) => import("react/jsx-runtime").JSX.Element;
package/index.js CHANGED
@@ -16,7 +16,7 @@ import { v } from "./components/animate/variants/fade.js";
16
16
  import { v as v2 } from "./components/animate/variants/bounce.js";
17
17
  import { v as v3 } from "./components/animate/variants/container.js";
18
18
  import { v as v4, a, b } from "./components/animate/variants/transition.js";
19
- import { A as A2 } from "./components/areas/components/AreasAdmin/index.js";
19
+ import { A as A2 } from "./components/areas/components/AreasAdmin/AreasAdmin.js";
20
20
  import { A as A3 } from "./components/areas/components/AreasViewer/index.js";
21
21
  import { a as a2, W } from "./components/areas/contexts/WindowToolsMFContext/index.js";
22
22
  import { c as c2 } from "./components/areas/contexts/DynamicMFParmsContext/store.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m4l/components",
3
- "version": "9.1.93",
3
+ "version": "9.1.94",
4
4
  "license": "UNLICENSED",
5
5
  "lint-staged": {
6
6
  "*.{js,ts,tsx}": "eslint --fix --max-warnings 0"
@@ -1,10 +0,0 @@
1
- /**
2
- * Componente para administrar áreas.
3
- * Este componente permite al usuario administrar las áreas disponibles,
4
- * seleccionar un área específica y agregar nuevas áreas.
5
- * Utiliza hooks como useAreasStore, useEnvironment, useModuleDictionary y useResponsiveDesktop.
6
- */
7
- /**
8
- * TODO: Documentar
9
- */
10
- export declare function AreasAdmin(): import("react/jsx-runtime").JSX.Element | null;
@@ -1,95 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { u as useAreasStore } from "../../hooks/useAreas/index.js";
3
- import { useEnvironment, useModuleDictionary } from "@m4l/core";
4
- import { A as AreaChip } from "./subcomponents/AreaChip/index.js";
5
- import { shallow } from "zustand/shallow";
6
- import { A as AreasAdminRoot } from "./styles.js";
7
- import { a as areasAdminClasses } from "./classes/index.js";
8
- import { I as ICONS } from "../../icons.js";
9
- import { S as ScrollBar } from "../../../ScrollBar/index.js";
10
- import { useResponsiveDesktop } from "@m4l/graphics";
11
- import { A as AreaChipMobile } from "./subcomponents/AreaChipMobile/index.js";
12
- import { useRef } from "react";
13
- import { u as useOnClickOutside } from "../../utils/useOnClickOutside/index.js";
14
- import { P as PanelWindowPopUp } from "./subcomponents/PanelWindowPopUp/index.js";
15
- import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../dictionary.js";
16
- import { I as IconButton } from "../../../mui_extended/IconButton/IconButton.js";
17
- function AreasAdmin() {
18
- const areas = useAreasStore((state) => state.areasIds, shallow);
19
- const currentArea = useAreasStore((state) => state.currentAreaId, shallow);
20
- const status = useAreasStore((state) => state.ownerState.status);
21
- const { setFocus } = useAreasStore((state) => state.areaAdminActions, shallow);
22
- const classesRoot = useAreasStore((state) => state.adminClasses.root);
23
- const areasLength = useAreasStore((state) => state.areasIds.length);
24
- const isDesktop = useResponsiveDesktop();
25
- const { addArea } = useAreasStore((state) => state.areasActions, shallow);
26
- const maximizedId = useAreasStore(
27
- (state) => state.hashAreas[currentArea] ? state.hashAreas[currentArea].maximizedId : false,
28
- shallow
29
- );
30
- const { host_static_assets, environment_assets } = useEnvironment();
31
- const { getLabel } = useModuleDictionary();
32
- const divRef = useRef(null);
33
- const divRefOut = useRef(null);
34
- const handleClickOutsideFn = () => {
35
- setFocus(false);
36
- };
37
- useOnClickOutside(divRef, handleClickOutsideFn, divRefOut);
38
- const rippleRef = useRef(null);
39
- const onRippleStart = (e) => {
40
- if (rippleRef.current) {
41
- rippleRef.current.start(e);
42
- }
43
- };
44
- const onRippleStop = (e) => {
45
- if (rippleRef.current) {
46
- rippleRef.current.stop(e);
47
- }
48
- };
49
- if (status !== "loaded") {
50
- return null;
51
- }
52
- return /* @__PURE__ */ jsx(
53
- AreasAdminRoot,
54
- {
55
- ref: divRefOut,
56
- onMouseDown: onRippleStart,
57
- onMouseUp: onRippleStop,
58
- className: classesRoot,
59
- children: /* @__PURE__ */ jsxs(
60
- "div",
61
- {
62
- role: "presentation",
63
- ref: divRef,
64
- className: areasAdminClasses.rootContent,
65
- onClick: () => setFocus(true),
66
- children: [
67
- /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaContainerChipsIcon, children: /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaContainerChips, children: /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaContainerContentChips, children: isDesktop ? /* @__PURE__ */ jsx(ScrollBar, { children: /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaContentChips, children: areas.map((area) => /* @__PURE__ */ jsx(
68
- AreaChip,
69
- {
70
- areaId: area,
71
- selected: area === currentArea,
72
- disabled: areasLength === 1
73
- },
74
- area
75
- )) }) }) : /* @__PURE__ */ jsx(AreaChipMobile, {}) }) }) }),
76
- isDesktop ? /* @__PURE__ */ jsx(
77
- IconButton,
78
- {
79
- className: areasAdminClasses.areasAddButton,
80
- src: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
81
- size: "small",
82
- onClick: addArea,
83
- tooltip: getLabel(getAreasDictionary(AREAS_DICCTIONARY.area_add_new))
84
- }
85
- ) : null,
86
- !isDesktop && maximizedId ? /* @__PURE__ */ jsx(PanelWindowPopUp, { currentAreaId: currentArea }) : null
87
- ]
88
- }
89
- )
90
- }
91
- );
92
- }
93
- export {
94
- AreasAdmin as A
95
- };
@@ -1,17 +0,0 @@
1
- import { styled } from "@mui/material";
2
- import { a as areasAdminClasses } from "./classes/index.js";
3
- const AreasAdminRoot = styled("div")`
4
- display: flex;
5
- position: relative;
6
- background-color: transparent;
7
-
8
- //areaRoot
9
- & .${areasAdminClasses.areaChipRoot} {
10
- display: flex;
11
- }
12
-
13
- ${(props) => props.theme.components?.M4LAreasAdmin?.styleOverrides}
14
- `;
15
- export {
16
- AreasAdminRoot as A
17
- };
@@ -1,29 +0,0 @@
1
- import { styled } from "@mui/material/styles";
2
- styled("div")(() => ({
3
- display: "flex",
4
- flexDirection: "row",
5
- border: "1px solid gray",
6
- "&.active": {
7
- border: "1px solid red"
8
- }
9
- }));
10
- styled("div")(({ theme }) => ({
11
- height: "100%",
12
- width: theme.spacing(1),
13
- backgroundColor: theme.vars.palette.background.default,
14
- "&.active": {
15
- backgroundColor: theme.vars.palette.primary.main
16
- }
17
- }));
18
- const EditAreaHeader = styled("div")(({ theme }) => ({
19
- display: "flex",
20
- width: "100%",
21
- height: "25px",
22
- borderBottom: "1px solid",
23
- borderColor: theme.vars.palette.border.default,
24
- justifyContent: "space-between",
25
- alignItems: "center"
26
- }));
27
- export {
28
- EditAreaHeader as E
29
- };
@@ -1,56 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useEnvironment, useModuleDictionary } from "@m4l/core";
3
- import { I as ICONS } from "../../../../../../icons.js";
4
- import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../../../../dictionary.js";
5
- import { u as useAreasStore } from "../../../../../../hooks/useAreas/index.js";
6
- import { shallow } from "zustand/shallow";
7
- import { M as MenuActions } from "../../../../../../../MenuActions/MenuActions.js";
8
- const ChipActionsMobile = (props) => {
9
- const { handlerOpenPopoverEditArea, areaId } = props;
10
- const { deleteArea } = useAreasStore((state) => state.areasActions);
11
- const { setFocus } = useAreasStore((state) => state.areaAdminActions, shallow);
12
- const listAreas = useAreasStore((state) => state.areasIds, shallow);
13
- const { host_static_assets, environment_assets } = useEnvironment();
14
- const { getLabel } = useModuleDictionary();
15
- const menuActions = [
16
- {
17
- type: "menuItem",
18
- startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.EDIT_AREA}`,
19
- onClick: handlerOpenPopoverEditArea,
20
- label: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_edit_area))
21
- }
22
- ];
23
- if (listAreas.length > 1) {
24
- menuActions.push({
25
- type: "menuItem",
26
- startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.DELETE_AREA}`,
27
- /**
28
- * OnClick
29
- * @author Andrés Quintero - automatic
30
- * @createdAt 2024-12-27 08:27:31 - automatic
31
- * @updatedAt 2025-01-22 08:48:47 - automatic
32
- * @updatedUser cesar - automatic
33
- */
34
- onClick: () => {
35
- deleteArea(areaId);
36
- setFocus(false);
37
- },
38
- label: getLabel(getAreasDictionary(AREAS_DICCTIONARY.label_delete_area))
39
- });
40
- }
41
- return /* @__PURE__ */ jsx(
42
- MenuActions,
43
- {
44
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.SHOW_OPTIONS}`,
45
- arrowType: "no-arrow",
46
- marginTop: "12px",
47
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
48
- transformOrigin: { vertical: "top", horizontal: "right" },
49
- menuActions,
50
- externalClose: () => setFocus(false)
51
- }
52
- );
53
- };
54
- export {
55
- ChipActionsMobile as C
56
- };
@@ -1,96 +0,0 @@
1
- import { jsx, jsxs } from "react/jsx-runtime";
2
- import { u as useAreasStore } from "../../../../hooks/useAreas/index.js";
3
- import { shallow } from "zustand/shallow";
4
- import { a as areasAdminClasses } from "../../classes/index.js";
5
- import { useModuleDictionary, useEnvironment } from "@m4l/core";
6
- import { I as ICONS } from "../../../../icons.js";
7
- import { useState, useMemo } from "react";
8
- import { g as getAreasDictionary, A as AREAS_DICCTIONARY } from "../../../../dictionary.js";
9
- import { useTheme } from "@mui/material";
10
- import { C as ChipMobile } from "./subcomponents/ChipMobile/ChipMobile.js";
11
- import { M as MenuActions } from "../../../../../MenuActions/MenuActions.js";
12
- import { B as Button } from "../../../../../mui_extended/Button/Button.js";
13
- const AreaChipMobile = () => {
14
- const areas = useAreasStore(
15
- (state) => state.areasIds.map((a) => ({ id: a, name: state.hashAreas[a].name })),
16
- shallow
17
- );
18
- const { selectArea } = useAreasStore((state) => state.areasActions);
19
- const currentAreaId = useAreasStore((state) => state.currentAreaId, shallow);
20
- const { addArea } = useAreasStore((state) => state.areasActions, shallow);
21
- const { setFocus } = useAreasStore((state) => state.areaAdminActions, shallow);
22
- const [anchorMenuAreas, setAnchorMenuAreas] = useState(null);
23
- const { getLabel } = useModuleDictionary();
24
- const theme = useTheme();
25
- const currentArea = areas.find((area) => area.id === currentAreaId);
26
- const { host_static_assets, environment_assets } = useEnvironment();
27
- const menuActions = useMemo(
28
- () => areas.filter((area) => area.id !== currentAreaId).map((area) => {
29
- return {
30
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.LAYERS}`,
31
- /**
32
- * OnClick
33
- * @author SebastianM - automatic
34
- * @createdAt 2024-11-06 09:00:05 - automatic
35
- * @updatedAt 2025-01-22 08:50:39 - automatic
36
- * @updatedUser cesar - automatic
37
- */
38
- onClick: () => {
39
- selectArea(area.id);
40
- setFocus(false);
41
- },
42
- label: area.name,
43
- type: "menuItem"
44
- };
45
- }),
46
- // eslint-disable-next-line react-hooks/exhaustive-deps
47
- [areas, currentAreaId]
48
- );
49
- const handlerSetAnchorMenuAreas = (element) => {
50
- setFocus(false);
51
- setAnchorMenuAreas(element);
52
- };
53
- return /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipMobileRoot, children: /* @__PURE__ */ jsxs("div", { className: areasAdminClasses.areaContainerContentChips, children: [
54
- currentArea ? /* @__PURE__ */ jsx(
55
- ChipMobile,
56
- {
57
- areaId: currentArea.id,
58
- selected: true,
59
- disabled: true,
60
- setAnchorMenuAreas
61
- },
62
- currentArea.id
63
- ) : null,
64
- menuActions.length >= 0 ? /* @__PURE__ */ jsx("div", { className: areasAdminClasses.areaChipMobileIconContainer, children: /* @__PURE__ */ jsx(
65
- MenuActions,
66
- {
67
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.CHEVRON_DOWN}`,
68
- arrowType: "no-arrow",
69
- marginTop: "12px!important",
70
- marginLeft: "14px!important",
71
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
72
- transformOrigin: { vertical: "top", horizontal: "right" },
73
- menuActions,
74
- externalOpen: anchorMenuAreas,
75
- externalClose: handlerSetAnchorMenuAreas,
76
- className: areasAdminClasses.areasPopoverMobileOptions,
77
- menuActionSx: theme.components?.M4LAreasAdminMobilePopoverOptions?.styleOverrides,
78
- endListElement: /* @__PURE__ */ jsx(
79
- Button,
80
- {
81
- onClick: () => {
82
- addArea();
83
- setAnchorMenuAreas(null);
84
- },
85
- variant: "outlined",
86
- startIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.ADD_AREA}`,
87
- label: getLabel(getAreasDictionary(AREAS_DICCTIONARY.area_add_new))
88
- }
89
- )
90
- }
91
- ) }) : null
92
- ] }) });
93
- };
94
- export {
95
- AreaChipMobile as A
96
- };
@@ -1,54 +0,0 @@
1
- import { jsx } from "react/jsx-runtime";
2
- import { useEnvironment } from "@m4l/core";
3
- import { shallow } from "zustand/shallow";
4
- import { useTheme } from "@mui/material";
5
- import { u as useAreasStore } from "../../../../hooks/useAreas/index.js";
6
- import { I as ICONS } from "../../../../icons.js";
7
- import { a as areasAdminClasses } from "../../classes/index.js";
8
- import { M as MenuActions } from "../../../../../MenuActions/MenuActions.js";
9
- const PanelWindowPopUp = (props) => {
10
- const { currentAreaId } = props;
11
- const { host_static_assets, environment_assets } = useEnvironment();
12
- const windowsLayouts = useAreasStore(
13
- (state) => state.hashAreas[currentAreaId].layoutItemsIds.filter((li) => state.hashWindows[li].emergeType === "layout").map((lim) => {
14
- const w = state.hashWindows[lim];
15
- return {
16
- i: w.windowId,
17
- url_icon: w.iconUrl,
18
- title: w.title
19
- };
20
- }),
21
- shallow
22
- );
23
- const theme = useTheme();
24
- const { maximizeLayout } = useAreasStore((state) => state.areaActions);
25
- const onTouched = (layoutId) => {
26
- maximizeLayout(currentAreaId, layoutId);
27
- };
28
- const menuActions = windowsLayouts.map((element) => {
29
- return {
30
- type: "menuItem",
31
- onClick: () => onTouched(element.i),
32
- label: element.title,
33
- urlIcon: element.url_icon
34
- };
35
- });
36
- return menuActions.length > 0 ? /* @__PURE__ */ jsx(
37
- MenuActions,
38
- {
39
- urlIcon: `${host_static_assets}/${environment_assets}/frontend/components/areas/assets/icons/${ICONS.LAYERS}`,
40
- arrowType: "no-arrow",
41
- marginTop: "12px!important",
42
- marginLeft: "14px!important",
43
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
44
- transformOrigin: { vertical: "top", horizontal: "right" },
45
- menuActions,
46
- className: areasAdminClasses.areasPopoverListWindows,
47
- iconButtonClassName: areasAdminClasses.areasPopoverListWindowsIcon,
48
- menuActionSx: theme.components?.M4LAreasAdminMobilePopoverOptions?.styleOverrides
49
- }
50
- ) : null;
51
- };
52
- export {
53
- PanelWindowPopUp as P
54
- };
@@ -1,22 +0,0 @@
1
- import { useEffect } from "react";
2
- function useOnClickOutside(ref, handler, noRef) {
3
- useEffect(() => {
4
- const listener = (event) => {
5
- const el = ref?.current;
6
- const noEl = noRef?.current;
7
- if (!el || el.contains(event.target) || noEl && noEl.contains(event.target)) {
8
- return;
9
- }
10
- handler(event);
11
- };
12
- document.addEventListener("mousedown", listener);
13
- document.addEventListener("touchstart", listener);
14
- return () => {
15
- document.removeEventListener("mousedown", listener);
16
- document.removeEventListener("touchstart", listener);
17
- };
18
- }, [ref, handler]);
19
- }
20
- export {
21
- useOnClickOutside as u
22
- };