@m4l/components 9.20.0 → 9.21.0

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 (186) hide show
  1. package/components/AccountPopover/AccountPopover.d.ts.map +1 -1
  2. package/components/AccountPopover/AccountPopover.js +43 -39
  3. package/components/AccountPopover/constants.d.ts +3 -0
  4. package/components/AccountPopover/constants.d.ts.map +1 -1
  5. package/components/AccountPopover/constants.js +11 -3
  6. package/components/AccountPopover/slots/AccountPopoverSlots.d.ts +7 -7
  7. package/components/AccountPopover/subcomponents/MenuPopover/MenuPopover.d.ts.map +1 -1
  8. package/components/AccountPopover/subcomponents/MenuPopover/MenuPopover.js +45 -43
  9. package/components/AccountPopover/types.d.ts +9 -0
  10. package/components/AccountPopover/types.d.ts.map +1 -1
  11. package/components/ActionsGroup/slots/ActionsGroupSlots.d.ts +2 -2
  12. package/components/AppBar/AppBar.d.ts +3 -18
  13. package/components/AppBar/AppBar.d.ts.map +1 -1
  14. package/components/AppBar/AppBar.js +64 -45
  15. package/components/AppBar/slots/AppBarEnum.d.ts +3 -1
  16. package/components/AppBar/slots/AppBarEnum.d.ts.map +1 -1
  17. package/components/AppBar/slots/AppBarEnum.js +2 -2
  18. package/components/AppBar/slots/AppBarSlots.d.ts +7 -1
  19. package/components/AppBar/slots/AppBarSlots.d.ts.map +1 -1
  20. package/components/AppBar/slots/AppBarSlots.js +30 -22
  21. package/components/AppBar/styles.d.ts.map +1 -1
  22. package/components/AppBar/styles.js +90 -47
  23. package/components/AppBar/types.d.ts +63 -29
  24. package/components/AppBar/types.d.ts.map +1 -1
  25. package/components/Card/constants.d.ts +1 -1
  26. package/components/CheckableList/slots/styled.d.ts +9 -9
  27. package/components/Chip/slots/ChipSlots.d.ts +4 -4
  28. package/components/ColorPicker/slots/ColorPickerSlots.d.ts +2 -2
  29. package/components/CommonActions/classes/index.d.ts +1 -1
  30. package/components/CommonActions/components/ActionCancel/slots/ActionsCancelSlots.d.ts +1 -1
  31. package/components/CommonActions/components/ActionFormCancel/slots/ActionFormCancelSlots.d.ts +1 -1
  32. package/components/CommonActions/components/ActionFormSubmitProgrammatic/slots/ActionFormSubmitProgrammaticSlots.d.ts +1 -1
  33. package/components/CommonActions/components/ActionIntro/slots/ActionsIntroSlots.d.ts +1 -1
  34. package/components/CommonActions/components/ActionsContainer/slots/ActionsContainerSlots.d.ts +1 -1
  35. package/components/DateRangeCalendarPicker/constants.d.ts +1 -1
  36. package/components/DateTimeRangePicker/slots/DateTimeRangePickerSlots.d.ts +9 -9
  37. package/components/DaysOfMonthPicker/slots/DaysOfMonthPickerSlots.d.ts +1 -1
  38. package/components/DaysOfWeekPicker/constants.d.ts +1 -1
  39. package/components/DaysOfWeekPicker/slots/DaysOfWeekPickerSlots.d.ts +1 -1
  40. package/components/DynamicFilter/slots/dynamicFilterSlots.d.ts +7 -7
  41. package/components/DynamicForm/constants.d.ts +1 -1
  42. package/components/DynamicForm/slots/DynamicFormSlots.d.ts +3 -3
  43. package/components/DynamicSort/slots/DynamicSortSlots.d.ts +7 -7
  44. package/components/EditLabel/constants.d.ts +1 -1
  45. package/components/EditLabel/slots/EditLabelSlots.d.ts +4 -4
  46. package/components/GridLayout/classes/index.d.ts +1 -1
  47. package/components/HelperError/slots/HelperErrorSlots.d.ts +1 -1
  48. package/components/ImageSelector/constants.d.ts +1 -1
  49. package/components/ImageSelector/slots/ImageSelectorSlots.d.ts +4 -4
  50. package/components/ImageText/constants.d.ts +1 -1
  51. package/components/ImageText/slots/ImageTextSlots.d.ts +2 -2
  52. package/components/Label/slots/LabelSlots.d.ts +2 -2
  53. package/components/LanguagePopover/LanguagePopover.d.ts +7 -7
  54. package/components/LanguagePopover/LanguagePopover.d.ts.map +1 -1
  55. package/components/LanguagePopover/LanguagePopover.js +40 -36
  56. package/components/LanguagePopover/slots/LanguagePopoverSlots.d.ts +1 -1
  57. package/components/LanguagePopover/types.d.ts +12 -3
  58. package/components/LanguagePopover/types.d.ts.map +1 -1
  59. package/components/LoadingError/LoadingError.js +4 -4
  60. package/components/LoadingError/slots/LoadingErrorSlots.d.ts +1 -1
  61. package/components/MFIsolationApp/slots/MFIsolationAppSlots.d.ts +2 -2
  62. package/components/MenuActions/slots/MenuActionsSlots.d.ts +2 -2
  63. package/components/MenuActions/types.d.ts +1 -1
  64. package/components/MenuActions/types.d.ts.map +1 -1
  65. package/components/ModalDialog/slots/ModalDialogSlots.d.ts +2 -2
  66. package/components/NumberInput/slots/NumberInputSlots.d.ts +2 -2
  67. package/components/ObjectLogs/slots/ObjectLogsSlots.d.ts +2 -2
  68. package/components/Pager/slots/PagerSlots.d.ts +3 -3
  69. package/components/PaperForm/slots/PaperFormSlots.d.ts +1 -1
  70. package/components/PropertyValue/slots/PropertyValueSlots.d.ts +1 -1
  71. package/components/SettingsLayout/slots/SettingsLayoutSlots.d.ts +3 -3
  72. package/components/SideBar/slots/SideBarSlots.d.ts +1 -1
  73. package/components/Stepper/slots/StepperSlot.d.ts +4 -4
  74. package/components/TabsNavigator/constants.d.ts +1 -1
  75. package/components/TabsNavigator/slots/TabsNavigatorSlots.d.ts +3 -3
  76. package/components/TimePicker/slots/TimePickerSlots.d.ts +8 -8
  77. package/components/ToastContainer/slots/toastContainerSlots.d.ts +4 -4
  78. package/components/WindowBase/slots/WindowBaseSlots.d.ts +2 -2
  79. package/components/WindowConfirm/WindowConfirm.js +10 -10
  80. package/components/WindowConfirm/WindowConfirm.styles.d.ts.map +1 -1
  81. package/components/WindowConfirm/WindowConfirm.styles.js +26 -5
  82. package/components/WindowConfirm/slots/WindowConfirmSlots.d.ts +5 -5
  83. package/components/areas/components/AreasAdmin/AreasAdmin.d.ts +1 -2
  84. package/components/areas/components/AreasAdmin/AreasAdmin.d.ts.map +1 -1
  85. package/components/areas/components/AreasAdmin/AreasAdmin.js +295 -119
  86. package/components/areas/components/AreasAdmin/AreasAdmin.styles.d.ts.map +1 -1
  87. package/components/areas/components/AreasAdmin/AreasAdmin.styles.js +309 -70
  88. package/components/areas/components/AreasAdmin/constants.d.ts +8 -0
  89. package/components/areas/components/AreasAdmin/constants.d.ts.map +1 -1
  90. package/components/areas/components/AreasAdmin/constants.js +10 -2
  91. package/components/areas/components/AreasAdmin/slots/AreasAdminEnum.d.ts +19 -0
  92. package/components/areas/components/AreasAdmin/slots/AreasAdminEnum.d.ts.map +1 -1
  93. package/components/areas/components/AreasAdmin/slots/AreasAdminEnum.js +2 -2
  94. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts +66 -9
  95. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.d.ts.map +1 -1
  96. package/components/areas/components/AreasAdmin/slots/AreasAdminSlots.js +176 -93
  97. package/components/areas/components/AreasAdmin/subcomponents/ContainerModules/ContainerModules.d.ts +6 -0
  98. package/components/areas/components/AreasAdmin/subcomponents/ContainerModules/ContainerModules.d.ts.map +1 -0
  99. package/components/areas/components/AreasAdmin/subcomponents/ContainerModules/ContainerModules.js +191 -0
  100. package/components/areas/components/AreasAdmin/subcomponents/ContainerModules/index.d.ts +2 -0
  101. package/components/areas/components/AreasAdmin/subcomponents/ContainerModules/index.d.ts.map +1 -0
  102. package/components/areas/components/AreasAdmin/subcomponents/ContainerModules/types.d.ts +37 -0
  103. package/components/areas/components/AreasAdmin/subcomponents/ContainerModules/types.d.ts.map +1 -0
  104. package/components/areas/components/AreasAdmin/types.d.ts +29 -3
  105. package/components/areas/components/AreasAdmin/types.d.ts.map +1 -1
  106. package/components/areas/dictionary.d.ts +3 -0
  107. package/components/areas/dictionary.d.ts.map +1 -1
  108. package/components/areas/dictionary.js +4 -1
  109. package/components/areas/hooks/index.d.ts +1 -1
  110. package/components/areas/hooks/index.d.ts.map +1 -1
  111. package/components/areas/hooks/useAreas/index.d.ts +5 -0
  112. package/components/areas/hooks/useAreas/index.d.ts.map +1 -1
  113. package/components/areas/hooks/useAreas/index.js +16 -7
  114. package/components/areas/icons.js +3 -10
  115. package/components/datagrids/slots/DataGridSlot.d.ts +6 -6
  116. package/components/extended/React-Resizable/ResizableBox/slots/ResizableBoxSlots.d.ts +1 -1
  117. package/components/extended/React-resizable-panels/slots/SplitLayoutSlots.d.ts +5 -5
  118. package/components/extended/mui/Accordion/slots/AccordionSlots.d.ts +4 -4
  119. package/components/extended/mui/Autocomplete/constants.d.ts +1 -1
  120. package/components/extended/mui/Autocomplete/slots/AutocompleteSlots.d.ts +6 -6
  121. package/components/extended/mui/Avatar/slots/AvatarSlots.d.ts +1 -1
  122. package/components/extended/mui/Badge/slots/BadgeSlots.d.ts +1 -1
  123. package/components/extended/mui/Button/slots/ButtonSlots.d.ts +2 -2
  124. package/components/extended/mui/CheckBox/slots/CheckBoxSlots.d.ts +2 -2
  125. package/components/extended/mui/DatePicker/constants.d.ts +1 -1
  126. package/components/extended/mui/DatePicker/slots/DatePickerSlots.d.ts +3 -3
  127. package/components/extended/mui/DateTimePicker/slots/DateTimePickerSlots.d.ts +4 -4
  128. package/components/extended/mui/Divider/slots/DividerSlots.d.ts +1 -1
  129. package/components/extended/mui/IconButton/slots/IconButtonSlots.d.ts +1 -1
  130. package/components/extended/mui/LoadingButton/slots/LoadingButtonSlots.d.ts +1 -1
  131. package/components/extended/mui/MenuDivider/slots/MenuDividerSlots.d.ts +1 -1
  132. package/components/extended/mui/MenuItem/slots/MenuItemSlots.d.ts +4 -4
  133. package/components/extended/mui/NavLink/slots/NavLinkSlots.d.ts +1 -1
  134. package/components/extended/mui/Popover/Popover.d.ts.map +1 -1
  135. package/components/extended/mui/Popover/Popover.js +41 -41
  136. package/components/extended/mui/Popper/slots/PopperStlots.d.ts +1 -1
  137. package/components/extended/mui/Radio/constants.d.ts +1 -1
  138. package/components/extended/mui/Radio/slots/styled.d.ts +2 -2
  139. package/components/extended/mui/Select/constants.d.ts +1 -1
  140. package/components/extended/mui/Select/slots/SelectSlots.d.ts +5 -5
  141. package/components/extended/mui/Skeleton/Slots/skeletonSlots.d.ts +1 -1
  142. package/components/extended/mui/Stack/slots/StackSlot.d.ts +1 -1
  143. package/components/extended/mui/Switch/constants.d.ts +1 -1
  144. package/components/extended/mui/Switch/slots/SwitchSlots.d.ts +2 -2
  145. package/components/extended/mui/Tab/Slots/TabSlots.d.ts +4 -4
  146. package/components/extended/mui/Tab/constants.d.ts +1 -1
  147. package/components/extended/mui/Tabs/slots/TabsSlots.d.ts +1 -1
  148. package/components/extended/mui/TextField/constants.d.ts +1 -1
  149. package/components/extended/mui/TextField/slots/TextFieldSlots.d.ts +4 -4
  150. package/components/extended/mui/TimePicker/slots/TimePickerSlots.d.ts +3 -3
  151. package/components/extended/mui/ToggleButton/slots/ToggleButtonSlots.d.ts +1 -1
  152. package/components/extended/mui/ToggleIconButton/slots/ToggleIconButtonSlots.d.ts +1 -1
  153. package/components/formatters/BooleanFormatter/slots/BooleanFormatterSlots.d.ts +1 -1
  154. package/components/formatters/ConcatenatedFormatter/slots/ConcatenatedFormatterSlots.d.ts +1 -1
  155. package/components/formatters/DateFormatter/slots/DateFormatterSlots.d.ts +1 -1
  156. package/components/formatters/DistanceToNowFormatter/slots/DistanceToNowFormatterSlots.d.ts +1 -1
  157. package/components/formatters/ImageFormatter/constants.d.ts +1 -1
  158. package/components/formatters/ImageFormatter/slots/ImageFormatterSlots.d.ts +1 -1
  159. package/components/formatters/NestedFormatter/constants.d.ts +1 -1
  160. package/components/formatters/PeriodFormatter/slots/PeriodFormatterSlots.d.ts +1 -1
  161. package/components/formatters/PointsFormatter/slots/ointsFormatterSlots.d.ts +1 -1
  162. package/components/formatters/PriceFormatter/slots/PriceFormatterSlots.d.ts +1 -1
  163. package/components/formatters/UncertaintyFormatter/slots/UncertaintyFormatterSlots.d.ts +1 -1
  164. package/components/hook-form/RHFCheckableList/constants.d.ts +1 -1
  165. package/components/hook-form/RHFCheckbox/slots/RHFCheckBoxSlots.d.ts +1 -1
  166. package/components/hook-form/RHFDatePicker/slots/RHFDatePickerSlots.d.ts +3 -3
  167. package/components/hook-form/RHFPeriod/slots/RHFPeriodSlots.d.ts +1 -1
  168. package/components/hook-form/RHFRadioGroup/constants.d.ts +1 -1
  169. package/components/hook-form/RHFRadioGroup/slots/styled.d.ts +1 -1
  170. package/components/hook-form/RHFSelect/constants.d.ts +1 -1
  171. package/components/hook-form/RHFSelect/slots/RHFSlots.d.ts +1 -1
  172. package/components/hook-form/RHFTextField/slots/RHFTextFieldSlots.d.ts +1 -1
  173. package/components/hook-form/RHFTextFieldPassword/slots/RHFTextFieldPasswordSlots.d.ts +2 -2
  174. package/components/hook-form/RHFUpload/RHFUploadImage/slots/RHFUploadImageSlots.d.ts +3 -3
  175. package/components/hook-form/RHFUpload/RHFUploadSingleFile/constants.d.ts +1 -1
  176. package/components/hook-form/RHFUpload/RHFUploadSingleFile/slots/RHFUploadSingleFileSlots.d.ts +7 -7
  177. package/components/hook-form/RHFormProvider/classes/index.d.ts +1 -1
  178. package/hooks/useDynamicFilterAndSort/slots/DynamicFilterAndSortSlots.d.ts +4 -4
  179. package/index.js +674 -673
  180. package/package.json +7 -7
  181. package/test/mocks/dictionary-mock.d.ts +1 -0
  182. package/test/mocks/dictionary-mock.d.ts.map +1 -1
  183. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/AreaChip.js +0 -171
  184. package/components/areas/components/AreasAdmin/subcomponents/AreaChip/subcomponents/ChipActionsMobile/ChipActionsMobile.js +0 -45
  185. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/AreaChipMobile.js +0 -69
  186. package/components/areas/components/AreasAdmin/subcomponents/AreaChipMobile/subcomponents/ChipMobile/ChipMobile.js +0 -149
@@ -1,139 +1,315 @@
1
- import { jsx as e, jsxs as I, Fragment as y } from "@emotion/react/jsx-runtime";
2
- import { useAreasStore as n } from "../../hooks/useAreas/index.js";
3
- import { useEnvironment as L, useModuleDictionary as P } from "@m4l/core";
4
- import j from "clsx";
5
- import { AreaChip as Y } from "./subcomponents/AreaChip/AreaChip.js";
6
- import { shallow as s } from "zustand/shallow";
7
- import { ICONS as w } from "../../icons.js";
8
- import { AreaChipMobile as B } from "./subcomponents/AreaChipMobile/AreaChipMobile.js";
9
- import { useRef as z } from "react";
10
- import { getAreasDictionary as l, AREAS_DICCTIONARY as u } from "../../dictionary.js";
11
- import { AreasAdminRootStyled as F, AreasAdminContentStyled as G, AreasContainerChipIconStyled as K, AreasContainerContentChipsStyled as U, IconButtonAddAreaStyled as q, AreaContentChipStyled as H, ContainerAdminWindowsStyled as J } from "./slots/AreasAdminSlots.js";
12
- import { useIsMobile as Q } from "@m4l/graphics";
13
- import { useComponentSize as V } from "../../../../hooks/useComponentSize/index.js";
14
- import { Typography as X } from "@m4l/base";
15
- import { AREAS_ADMIN_KEY_COMPONENT as S } from "./constants.js";
16
- import { getComponentSlotRoot as Z } from "../../../../utils/getComponentSlotRoot.js";
17
- import { getPropDataTestId as oo } from "../../../../test/getNameDataTestId.js";
18
- import { MenuActions as eo } from "../../../MenuActions/MenuActions.js";
19
- import { AreasAdminSlots as ro } from "./slots/AreasAdminEnum.js";
20
- const _o = (_) => {
1
+ import { jsxs as u, jsx as t } from "@emotion/react/jsx-runtime";
2
+ import { useModuleDictionary as Me } from "@m4l/core";
3
+ import { useIsMobile as _e } from "@m4l/graphics";
4
+ import { LayoutTableFill as be, ActionsEditOutlined as ge, ActionsTrashOutlined as Se, ActionsAddSquareOutlined as we } from "@m4l/icons";
5
+ import { Tooltip as Ee, Icon as ve, Typography as ye } from "@m4l/base";
6
+ import Le from "clsx";
7
+ import * as Te from "yup";
8
+ import { useState as h, useRef as Ce, useEffect as Oe } from "react";
9
+ import { shallow as p } from "zustand/shallow";
10
+ import { getComponentSlotRoot as De } from "../../../../utils/getComponentSlotRoot.js";
11
+ import { getPropDataTestId as Pe } from "../../../../test/getNameDataTestId.js";
12
+ import { useModal as xe } from "../../../../hooks/useModal/index.js";
13
+ import { MenuDivider as Re } from "../../../extended/mui/MenuDivider/MenuDivider.js";
14
+ import { getAreasDictionary as i, AREAS_DICCTIONARY as l } from "../../dictionary.js";
15
+ import { useAreasStore as c } from "../../hooks/useAreas/index.js";
16
+ import { AREAS_ADMIN_TOOLTIP_DELAY_PROPS as Ne, AREAS_MENU_MAX_VISIBLE_ITEMS as $e, AREAS_ADMIN_KEY_COMPONENT as W, DEFAULT_HORIZONTAL_MODULE_ITEM_LIMIT as ze, DEFAULT_VERTICAL_MODULE_ITEM_LIMIT as We } from "./constants.js";
17
+ import { AreasAdminRootStyled as ke, AreasAdminContentStyled as Be, AreasTriggerButtonStyled as Fe, AreasMenuContentStyled as Ve, AreasMenuScrollAreaStyled as Ue, AreasMenuListStyled as He, AreaMenuItemActionsStyled as je, AreaMenuActionButtonStyled as k, AreasMenuFooterStyled as Ye, ButtonAddAreaStyled as qe, AreasSectionDividerStyled as Ke, EditAreaHeaderStyled as Xe } from "./slots/AreasAdminSlots.js";
18
+ import { createValidationSchema as Ze, createValidationFullObject as Ge, createValidationPartialObject as Je } from "../../../hook-form/RHFormProvider/schema.js";
19
+ import { ContainerModules as Qe } from "./subcomponents/ContainerModules/ContainerModules.js";
20
+ import { RHFormProvider as et } from "../../../hook-form/RHFormProvider/RHFormProvider.js";
21
+ import { RHFTextField as tt } from "../../../hook-form/RHFTextField/RHFTextField.js";
22
+ import { ActionsContainer as rt } from "../../../CommonActions/components/ActionsContainer/ActionsContainer.js";
23
+ import { Popover as B } from "../../../extended/mui/Popover/Popover.js";
24
+ import { MenuItem as F } from "../../../extended/mui/MenuItem/MenuItem.js";
25
+ import { ActionCancel as ot } from "../../../CommonActions/components/ActionCancel/ActionCancel.js";
26
+ import { ActionIntro as nt } from "../../../CommonActions/components/ActionIntro/ActionIntro.js";
27
+ import { AreasAdminSlots as at } from "./slots/AreasAdminEnum.js";
28
+ import { WindowConfirm as it } from "../../../WindowConfirm/WindowConfirm.js";
29
+ function lt(g, f) {
30
+ return f !== void 0 ? Math.max(f, 1) : g === "horizontal" ? ze : We;
31
+ }
32
+ const Nt = (g) => {
21
33
  const {
22
- color: p = "primary",
23
- size: g = "medium",
24
- className: R,
25
- dataTestId: b,
26
- ...D
27
- } = _, h = Q(), { currentSize: r } = V(g), N = n((o) => o.areasIds ?? [], s), a = n((o) => o.currentAreaId, s), $ = n((o) => o.ownerState?.status), x = n((o) => o.areasIds.length), { addArea: E } = n((o) => o.areasActions, s), { maximizeLayout: O } = n((o) => o.areaActions), A = n(
28
- (o) => o.hashAreas[a] ? o.hashAreas[a].maximizedId : !1,
29
- s
30
- ), m = n(
31
- (o) => o.hashAreas[o.currentAreaId]?.layoutItemsIds?.filter((t) => o.hashWindows[t].emergeType === "layout")?.map((t) => {
32
- const i = o.hashWindows[t];
34
+ color: f = "primary",
35
+ size: o = "medium",
36
+ orientation: m = "vertical",
37
+ moduleItemLimit: V,
38
+ className: U,
39
+ dataTestId: H,
40
+ ...j
41
+ } = g, Y = _e(), { getLabel: n } = Me(), { openModal: q } = xe(), [I, T] = h(null), [S, C] = h(null), [K, O] = h(null), [A, D] = h(null), [w, E] = h(null), P = Ce(null), d = c(
42
+ (e) => e.areasIds.map((r) => ({ id: r, name: e.hashAreas[r].name })),
43
+ p
44
+ ), M = c((e) => e.currentAreaId, p), X = c((e) => e.ownerState?.status), { addArea: Z, deleteArea: G, editArea: J, selectArea: Q } = c((e) => e.areasActions, p), { maximizeLayout: ee } = c((e) => e.areaActions, p), te = c(
45
+ (e) => e.currentAreaId ? e.hashAreas[e.currentAreaId]?.currentLayoutId : ""
46
+ ), x = c(
47
+ (e) => e.currentAreaId ? e.hashAreas[e.currentAreaId]?.maximizedId : void 0
48
+ ), R = c(
49
+ (e) => e.hashAreas[e.currentAreaId]?.layoutItemsIds?.filter((r) => e.hashWindows[r].emergeType === "layout")?.map((r) => {
50
+ const a = e.hashWindows[r], s = a.moduleCount;
33
51
  return {
34
- i: i.windowId,
35
- url_icon: i.iconUrl,
36
- title: i.title
52
+ iconUrl: a.iconUrl,
53
+ id: a.windowId,
54
+ label: `${a.title}${s ? `:${s}` : ""}`,
55
+ title: a.title
37
56
  };
38
57
  }) ?? [],
39
- s
40
- ), T = n((o) => m.reduce((t, i) => (t[i.i] = o.hashWindows[i.i]?.moduleCount, t), {}), s), { host_static_assets: f, environment_assets: C } = L(), { getLabel: c } = P(), v = z(null), M = z(null);
41
- if ($ !== "loaded")
58
+ p
59
+ ), _ = !!I;
60
+ if (Oe(() => {
61
+ if (!_ || !w)
62
+ return;
63
+ const e = Array.from(
64
+ P.current?.querySelectorAll("[data-area-menu-item-id]") ?? []
65
+ ).find((r) => r.dataset.areaMenuItemId === w);
66
+ e && (e.scrollIntoView?.({ block: "nearest" }), E(null));
67
+ }, [d, _, w]), X !== "loaded")
42
68
  return null;
43
- const d = {
44
- isMobile: h,
45
- color: p,
46
- size: r
47
- }, k = (o) => {
48
- O(a, o);
49
- }, W = m.map((o) => {
50
- const t = T[o.i];
51
- return {
52
- type: "menuItem",
53
- onClick: () => k(o.i),
54
- label: `${o.title}${t ? `:${t}` : ""}`,
55
- urlIcon: o.url_icon,
56
- checkable: !0,
57
- checked: A === o.i
58
- };
59
- });
60
- return /* @__PURE__ */ e(
61
- F,
69
+ const v = n(i(l.label_new_area)) || "Open areas menu", re = n(i(l.area_add_new)) || "Add area", N = n(i(l.label_edit_area)) || "Edit area", oe = n(i(l.label_delete_area)) || "Delete area", ne = n(i(l.label_delete_area_confirm_title)) || "Delete work area", ae = n(i(l.label_delete_area_confirm_message)) || "This action is irreversible. Do you want to permanently delete this work area?", $ = d.find((e) => e.id === M)?.name ?? "", ie = n(i(l.label_window)) || "Window", le = n(i(l.label_windows)) || "Windows", y = !!x && R.length > 1, de = lt(m, V), se = x || te || !1, L = {
70
+ color: f,
71
+ hasModules: y,
72
+ isMobile: Y,
73
+ orientation: m,
74
+ size: o
75
+ };
76
+ function ce(e) {
77
+ e.stopPropagation(), T(e.currentTarget);
78
+ }
79
+ function z() {
80
+ I?.blur(), T(null), E(null), b();
81
+ }
82
+ function me(e, r) {
83
+ e.stopPropagation();
84
+ const a = e.currentTarget.closest("li") ?? e.currentTarget, s = a.getBoundingClientRect();
85
+ C(a), O({ left: s.right, top: s.top + s.height / 2 }), D(r);
86
+ }
87
+ function b() {
88
+ C(null), O(null), D(null);
89
+ }
90
+ function ue(e) {
91
+ A && (J(A, e.inputEditArea), b());
92
+ }
93
+ function Ae(e, r) {
94
+ if (e.stopPropagation(), d.length > 1) {
95
+ const a = d.find((s) => s.id === r)?.name;
96
+ q({
97
+ variant: "warning",
98
+ window: /* @__PURE__ */ t(
99
+ it,
100
+ {
101
+ variant: "warning",
102
+ title: ne,
103
+ msg: `${ae} (${a})`,
104
+ onClickIntro: () => G(r),
105
+ size: o
106
+ }
107
+ )
108
+ });
109
+ }
110
+ }
111
+ function he(e) {
112
+ Q(e), z();
113
+ }
114
+ function pe() {
115
+ const e = Z();
116
+ e && E(e);
117
+ }
118
+ function fe(e) {
119
+ ee(M, e);
120
+ }
121
+ const Ie = Ze(
122
+ Ge(
123
+ Je({
124
+ inputEditArea: Te.string().required(
125
+ n(i(l.validation_edit_area))
126
+ )
127
+ })
128
+ )
129
+ );
130
+ return /* @__PURE__ */ u(
131
+ ke,
62
132
  {
63
- className: j(Z(S), R),
64
- ...oo(S, ro.root, b),
133
+ className: Le(De(W), U),
134
+ ownerState: L,
65
135
  role: "areas-admin-role",
66
- ownerState: d,
67
- ref: M,
68
- ...D,
69
- children: /* @__PURE__ */ e(
70
- G,
71
- {
72
- size: r,
73
- role: "presentation",
74
- ref: v,
75
- children: /* @__PURE__ */ e(
76
- K,
136
+ ...Pe(W, at.root, H),
137
+ ...j,
138
+ children: [
139
+ /* @__PURE__ */ u(Be, { ownerState: L, children: [
140
+ /* @__PURE__ */ t(
141
+ Ee,
77
142
  {
78
- size: r,
79
- children: /* @__PURE__ */ e(
80
- U,
143
+ ...Ne,
144
+ title: $ ? `${v}: ${$}` : v,
145
+ children: /* @__PURE__ */ t(
146
+ Fe,
81
147
  {
82
- size: r,
83
- children: h ? /* @__PURE__ */ e(B, {}) : /* @__PURE__ */ I(y, { children: [
84
- /* @__PURE__ */ e(
85
- q,
148
+ "aria-label": v,
149
+ color: I ? "primary" : "default",
150
+ icon: /* @__PURE__ */ t(be, {}),
151
+ onClick: ce,
152
+ size: o,
153
+ selected: _,
154
+ variant: "text"
155
+ }
156
+ )
157
+ }
158
+ ),
159
+ /* @__PURE__ */ t(
160
+ B,
161
+ {
162
+ anchorEl: I,
163
+ anchorOrigin: m === "vertical" ? { horizontal: "right", vertical: "top" } : { horizontal: "right", vertical: "bottom" },
164
+ arrowType: "right-top",
165
+ onClose: z,
166
+ open: _,
167
+ slotProps: {
168
+ paper: {
169
+ sx: {
170
+ // Pin the areas menu to a fixed, safe width so growing content
171
+ // (long area names) can no longer widen or shift the popover.
172
+ width: 230,
173
+ maxWidth: 230,
174
+ minWidth: 230,
175
+ ...m === "vertical" ? { ml: 1.5 } : { mt: 1 }
176
+ }
177
+ }
178
+ },
179
+ transformOrigin: m === "vertical" ? { horizontal: "left", vertical: "top" } : { horizontal: "right", vertical: "top" },
180
+ children: /* @__PURE__ */ u(Ve, { children: [
181
+ /* @__PURE__ */ t(
182
+ Ue,
183
+ {
184
+ ref: P,
185
+ ownerState: { ...L, maxVisibleItems: $e },
186
+ children: /* @__PURE__ */ t(He, { children: d.length > 0 ? d.map((e) => /* @__PURE__ */ t(
187
+ F,
86
188
  {
87
- "aria-label": c(l(u.area_add_new)),
88
- size: r,
89
- variant: "contained",
90
- ownerState: d,
91
- src: `${f}/${C}/frontend/components/areas/assets/icons/${w.ADD_AREA}`,
92
- onClick: E,
93
- tooltip: c(l(u.area_add_new))
189
+ "data-area-menu-item-id": e.id,
190
+ endAdornment: e.id === M ? /* @__PURE__ */ u(je, { children: [
191
+ /* @__PURE__ */ t(
192
+ k,
193
+ {
194
+ "aria-label": `${N}: ${e.name}`,
195
+ icon: /* @__PURE__ */ t(ge, {}),
196
+ onClick: (r) => me(r, e.id),
197
+ size: o,
198
+ variant: "text"
199
+ }
200
+ ),
201
+ /* @__PURE__ */ t(
202
+ k,
203
+ {
204
+ "aria-label": `${oe}: ${e.name}`,
205
+ color: "error",
206
+ disabled: d.length === 1,
207
+ icon: /* @__PURE__ */ t(Se, {}),
208
+ onClick: (r) => Ae(r, e.id),
209
+ size: o,
210
+ variant: "text"
211
+ }
212
+ )
213
+ ] }) : void 0,
214
+ label: e.name,
215
+ onClick: () => he(e.id),
216
+ selected: e.id === M,
217
+ size: o
218
+ },
219
+ e.id
220
+ )) : /* @__PURE__ */ t(
221
+ F,
222
+ {
223
+ disabled: !0,
224
+ label: n(i(l.label_no_areas_available)) || "No areas available",
225
+ size: o
94
226
  }
95
- ),
96
- /* @__PURE__ */ e(
97
- H,
227
+ ) })
228
+ }
229
+ ),
230
+ /* @__PURE__ */ t(Re, { variant: "solid", size: o }),
231
+ /* @__PURE__ */ t(Ye, { children: /* @__PURE__ */ t(
232
+ qe,
233
+ {
234
+ endIcon: /* @__PURE__ */ t(ve, { icon: /* @__PURE__ */ t(we, {}) }),
235
+ label: re,
236
+ onClick: pe,
237
+ size: o,
238
+ color: "default",
239
+ variant: "contained",
240
+ fullWidth: !0
241
+ }
242
+ ) })
243
+ ] })
244
+ }
245
+ ),
246
+ m === "vertical" && y ? /* @__PURE__ */ t(
247
+ Ke,
248
+ {
249
+ customVariant: "solid",
250
+ "data-testid": "AreasAdminTriggerDivider",
251
+ orientation: "horizontal",
252
+ size: o
253
+ }
254
+ ) : null,
255
+ y ? /* @__PURE__ */ t(
256
+ Qe,
257
+ {
258
+ itemLimit: de,
259
+ items: R,
260
+ menuHeaderLabel: le,
261
+ onSelect: fe,
262
+ orientation: m,
263
+ overflowLabel: `More ${ie.toLowerCase()} modules`,
264
+ selectedItemId: se,
265
+ size: o
266
+ }
267
+ ) : null
268
+ ] }),
269
+ A ? /* @__PURE__ */ t(
270
+ B,
271
+ {
272
+ anchorEl: S,
273
+ anchorPosition: K ?? void 0,
274
+ anchorReference: "anchorPosition",
275
+ arrowType: "no-arrow",
276
+ container: S?.closest('[aria-label="Paper-popover-root"]'),
277
+ onClose: b,
278
+ open: !!S,
279
+ slotProps: { paper: { sx: { ml: 4, minWidth: 220 } } },
280
+ transformOrigin: { horizontal: "left", vertical: "center" },
281
+ children: /* @__PURE__ */ u(
282
+ et,
283
+ {
284
+ onSubmit: ue,
285
+ validationSchema: Ie,
286
+ values: {
287
+ inputEditArea: d.find((e) => e.id === A)?.name ?? ""
288
+ },
289
+ children: [
290
+ /* @__PURE__ */ t(Xe, { children: /* @__PURE__ */ t(ye, { color: "text.secondary", variant: "bodyDens", children: N }) }),
291
+ /* @__PURE__ */ t(tt, { name: "inputEditArea" }),
292
+ /* @__PURE__ */ u(rt, { children: [
293
+ /* @__PURE__ */ t(
294
+ ot,
98
295
  {
99
- size: r,
100
- children: N.map((o) => /* @__PURE__ */ e(
101
- Y,
102
- {
103
- size: r,
104
- color: p,
105
- areaId: o,
106
- selected: o === a,
107
- disabled: x === 1
108
- },
109
- o
110
- ))
296
+ onClick: b,
297
+ size: o,
298
+ variant: "contained"
111
299
  }
112
300
  ),
113
- A && m.length > 1 && /* @__PURE__ */ e(y, { children: /* @__PURE__ */ I(J, { size: r, ownerState: d, children: [
114
- /* @__PURE__ */ e(X, { size: r, skeletonWidth: "80px", children: c(l(u.label_window)) }),
115
- /* @__PURE__ */ e(
116
- eo,
117
- {
118
- size: r,
119
- icon: `${f}/${C}/frontend/components/areas_admin/assets/icons/${w.PENDING_ORDER}`,
120
- arrowType: "no-arrow",
121
- anchorOrigin: { vertical: "bottom", horizontal: "right" },
122
- transformOrigin: { vertical: "top", horizontal: "left" },
123
- menuActions: W
124
- }
125
- )
126
- ] }) })
301
+ /* @__PURE__ */ t(nt, { size: o })
127
302
  ] })
128
- }
129
- )
130
- }
131
- )
132
- }
133
- )
303
+ ]
304
+ },
305
+ A
306
+ )
307
+ }
308
+ ) : null
309
+ ]
134
310
  }
135
311
  );
136
312
  };
137
313
  export {
138
- _o as AreasAdmin
314
+ Nt as AreasAdmin
139
315
  };
@@ -1 +1 @@
1
- {"version":3,"file":"AreasAdmin.styles.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/areas/components/AreasAdmin/AreasAdmin.styles.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAC3C,eAAO,MAAM,gBAAgB,EAAE,gBAgM9B,CAAC"}
1
+ {"version":3,"file":"AreasAdmin.styles.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/areas/components/AreasAdmin/AreasAdmin.styles.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,gBAAgB,EAAE,MAAM,SAAS,CAAC;AAE3C,eAAO,MAAM,gBAAgB,EAAE,gBA8b9B,CAAC"}