@m4l/components 9.86.0-beta-pkg-799-preparar-app-cd-ci.0 → 9.87.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 (68) hide show
  1. package/components/Label/Label.styles.d.ts.map +1 -1
  2. package/components/Label/Label.styles.js +80 -59
  3. package/components/Label/types.d.ts +2 -2
  4. package/components/Label/types.d.ts.map +1 -1
  5. package/components/NumberInput/NumberInput.styles.d.ts.map +1 -1
  6. package/components/NumberInput/NumberInput.styles.js +89 -81
  7. package/components/PropertyValue/PropertyValue.d.ts.map +1 -1
  8. package/components/PropertyValue/PropertyValue.js +76 -74
  9. package/components/PropertyValue/PropertyValue.styles.d.ts.map +1 -1
  10. package/components/PropertyValue/PropertyValue.styles.js +57 -37
  11. package/components/PropertyValue/types.d.ts +3 -1
  12. package/components/PropertyValue/types.d.ts.map +1 -1
  13. package/components/SideBar/SideBar.d.ts +2 -7
  14. package/components/SideBar/SideBar.d.ts.map +1 -1
  15. package/components/SideBar/SideBar.js +54 -48
  16. package/components/SideBar/constants.d.ts +21 -0
  17. package/components/SideBar/constants.d.ts.map +1 -1
  18. package/components/SideBar/constants.js +34 -14
  19. package/components/SideBar/dictionaryDefaults.d.ts +4 -0
  20. package/components/SideBar/dictionaryDefaults.d.ts.map +1 -0
  21. package/components/SideBar/dictionaryDefaults.js +35 -0
  22. package/components/SideBar/helpers/getMenuDataWithState/index.js +4 -4
  23. package/components/SideBar/helpers/resolveSidebarWidth.d.ts +3 -0
  24. package/components/SideBar/helpers/resolveSidebarWidth.d.ts.map +1 -0
  25. package/components/SideBar/helpers/resolveSidebarWidth.js +7 -0
  26. package/components/SideBar/hooks/useSideBarPreferences.d.ts +4 -0
  27. package/components/SideBar/hooks/useSideBarPreferences.d.ts.map +1 -0
  28. package/components/SideBar/hooks/useSideBarPreferences.js +71 -0
  29. package/components/SideBar/index.d.ts +4 -1
  30. package/components/SideBar/index.d.ts.map +1 -1
  31. package/components/SideBar/slots/SideBarSlots.js +1 -1
  32. package/components/SideBar/subcomponents/SideBarNavigation/SideBarNavigation.d.ts +4 -0
  33. package/components/SideBar/subcomponents/SideBarNavigation/SideBarNavigation.d.ts.map +1 -0
  34. package/components/SideBar/subcomponents/SideBarNavigation/SideBarNavigation.js +257 -0
  35. package/components/SideBar/subcomponents/SideBarNavigation/SidebarBranding.d.ts +6 -0
  36. package/components/SideBar/subcomponents/SideBarNavigation/SidebarBranding.d.ts.map +1 -0
  37. package/components/SideBar/subcomponents/SideBarNavigation/SidebarBranding.js +44 -0
  38. package/components/SideBar/subcomponents/SideBarNavigation/SidebarInstances.d.ts +4 -0
  39. package/components/SideBar/subcomponents/SideBarNavigation/SidebarInstances.d.ts.map +1 -0
  40. package/components/SideBar/subcomponents/SideBarNavigation/SidebarInstances.js +77 -0
  41. package/components/SideBar/subcomponents/SideBarNavigation/SidebarItemIcon.d.ts +4 -0
  42. package/components/SideBar/subcomponents/SideBarNavigation/SidebarItemIcon.d.ts.map +1 -0
  43. package/components/SideBar/subcomponents/SideBarNavigation/SidebarItemIcon.js +40 -0
  44. package/components/SideBar/subcomponents/SideBarNavigation/SidebarLabelTooltip.d.ts +4 -0
  45. package/components/SideBar/subcomponents/SideBarNavigation/SidebarLabelTooltip.d.ts.map +1 -0
  46. package/components/SideBar/subcomponents/SideBarNavigation/SidebarLabelTooltip.js +21 -0
  47. package/components/SideBar/subcomponents/SideBarNavigation/SidebarRow.d.ts +4 -0
  48. package/components/SideBar/subcomponents/SideBarNavigation/SidebarRow.d.ts.map +1 -0
  49. package/components/SideBar/subcomponents/SideBarNavigation/SidebarRow.js +62 -0
  50. package/components/SideBar/subcomponents/SideBarNavigation/assets/sidebar-texture.jpg.js +4 -0
  51. package/components/SideBar/subcomponents/SideBarNavigation/constants.d.ts +32 -0
  52. package/components/SideBar/subcomponents/SideBarNavigation/constants.d.ts.map +1 -0
  53. package/components/SideBar/subcomponents/SideBarNavigation/constants.js +17 -0
  54. package/components/SideBar/subcomponents/SideBarNavigation/helpers.d.ts +17 -0
  55. package/components/SideBar/subcomponents/SideBarNavigation/helpers.d.ts.map +1 -0
  56. package/components/SideBar/subcomponents/SideBarNavigation/helpers.js +61 -0
  57. package/components/SideBar/subcomponents/SideBarNavigation/slots/styled.d.ts +75 -0
  58. package/components/SideBar/subcomponents/SideBarNavigation/slots/styled.d.ts.map +1 -0
  59. package/components/SideBar/subcomponents/SideBarNavigation/slots/styled.js +508 -0
  60. package/components/SideBar/subcomponents/SideBarNavigation/types.d.ts +108 -0
  61. package/components/SideBar/subcomponents/SideBarNavigation/types.d.ts.map +1 -0
  62. package/components/SideBar/subcomponents/SideBarNavigation/useSidebarResize.d.ts +16 -0
  63. package/components/SideBar/subcomponents/SideBarNavigation/useSidebarResize.d.ts.map +1 -0
  64. package/components/SideBar/subcomponents/SideBarNavigation/useSidebarResize.js +42 -0
  65. package/components/SideBar/types.d.ts +70 -60
  66. package/components/SideBar/types.d.ts.map +1 -1
  67. package/index.js +200 -194
  68. package/package.json +10 -10
@@ -1,18 +1,38 @@
1
- import { ContentComponentSlots as o, SideBarFooterSlots as t, HeaderSidebarSlots as S, ContentGroupsSlots as e, SideBarMobileSlots as _, SideBarDesktopSlots as s } from "./slots/SideBarEnum.js";
2
- const n = "M4LSideBar", A = {
1
+ import { ContentComponentSlots as t, SideBarFooterSlots as e, HeaderSidebarSlots as o, ContentGroupsSlots as s, SideBarMobileSlots as a, SideBarDesktopSlots as n } from "./slots/SideBarEnum.js";
2
+ const _ = "M4LSideBar", r = { default: 240, min: 180, max: 310 }, S = 1500, E = {
3
+ anchored: !0,
4
+ favorites: [],
5
+ width: r.default
6
+ }, l = {
7
+ navigation: "platform_sidebar.navigation",
8
+ search: "platform_sidebar.search",
9
+ resize: "platform_sidebar.resize",
10
+ favorites: "platform_sidebar.favorites",
11
+ pin: "platform_sidebar.pin",
12
+ unpin: "platform_sidebar.unpin",
13
+ addInstance: "platform_sidebar.add_instance",
14
+ closeInstance: "platform_sidebar.close_instance",
15
+ instances: "platform_sidebar.instances",
16
+ noResults: "platform_sidebar.no_results",
17
+ attribution: "label_powerby"
18
+ }, c = {
19
+ ...n,
20
+ ...a,
3
21
  ...s,
4
- ..._,
22
+ ...o,
5
23
  ...e,
6
- ...S,
7
- ...t,
8
- ...o
9
- }, i = "is-root", r = "menu-active", C = "item-in-tree-active", c = "has-children", L = "item-closed";
24
+ ...t
25
+ }, d = "is-root", A = "menu-active", I = "item-in-tree-active", p = "has-children", m = "item-closed";
10
26
  export {
11
- A as ALL_SIDEBAR_SLOTS,
12
- c as CLASS_NAME_HAS_CHILDREN,
13
- i as CLASS_NAME_IS_ROOT,
14
- L as CLASS_NAME_ITEM_CLOSED,
15
- C as CLASS_NAME_ITEM_IN_TREE_ACTIVE,
16
- r as CLASS_NAME_MENU_ACTIVE,
17
- n as SIDEBAR_KEY_COMPONENT
27
+ c as ALL_SIDEBAR_SLOTS,
28
+ p as CLASS_NAME_HAS_CHILDREN,
29
+ d as CLASS_NAME_IS_ROOT,
30
+ m as CLASS_NAME_ITEM_CLOSED,
31
+ I as CLASS_NAME_ITEM_IN_TREE_ACTIVE,
32
+ A as CLASS_NAME_MENU_ACTIVE,
33
+ E as DEFAULT_SIDEBAR_PREFERENCES,
34
+ l as SIDEBAR_DICTIONARY,
35
+ S as SIDEBAR_INITIAL_PREFERENCES_WAIT_MS,
36
+ _ as SIDEBAR_KEY_COMPONENT,
37
+ r as SIDEBAR_WIDTH
18
38
  };
@@ -0,0 +1,4 @@
1
+ import { DictionaryDefaults } from '@m4l/core';
2
+ /** Provide English and Spanish navigation labels for the consumer's dictionary boundary. */
3
+ export declare function getSideBarDictionaryDefaults(): DictionaryDefaults;
4
+ //# sourceMappingURL=dictionaryDefaults.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"dictionaryDefaults.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/SideBar/dictionaryDefaults.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,WAAW,CAAC;AAgCpD,4FAA4F;AAC5F,wBAAgB,4BAA4B,IAAI,kBAAkB,CAEjE"}
@@ -0,0 +1,35 @@
1
+ import { SIDEBAR_DICTIONARY as e } from "./constants.js";
2
+ const a = {
3
+ en: {
4
+ [e.navigation]: "Navigation menu",
5
+ [e.search]: "Search",
6
+ [e.resize]: "Resize sidebar",
7
+ [e.favorites]: "Favorites",
8
+ [e.pin]: "Pin to favorites",
9
+ [e.unpin]: "Remove from favorites",
10
+ [e.addInstance]: "Add instance",
11
+ [e.closeInstance]: "Close instance",
12
+ [e.instances]: "Module instances",
13
+ [e.noResults]: "No results",
14
+ [e.attribution]: "PowerBy"
15
+ },
16
+ es: {
17
+ [e.navigation]: "Menú de navegación",
18
+ [e.search]: "Buscar",
19
+ [e.resize]: "Ajustar ancho del sidebar",
20
+ [e.favorites]: "Favoritos",
21
+ [e.pin]: "Fijar en favoritos",
22
+ [e.unpin]: "Quitar de favoritos",
23
+ [e.addInstance]: "Agregar instancia",
24
+ [e.closeInstance]: "Cerrar instancia",
25
+ [e.instances]: "Instancias del módulo",
26
+ [e.noResults]: "Sin resultados",
27
+ [e.attribution]: "PowerBy"
28
+ }
29
+ };
30
+ function i() {
31
+ return a;
32
+ }
33
+ export {
34
+ i as getSideBarDictionaryDefaults
35
+ };
@@ -1,12 +1,12 @@
1
- const s = ({ menuData: u, moduleSelectedId: a, initialLevel: i = 0 }) => u.map((e) => {
1
+ const f = ({ menuData: s, moduleSelectedId: a, initialLevel: i = 0 }) => s.map((e) => {
2
2
  if (!e.children && e.moduleId === a)
3
3
  return { ...e, active: !0, itemInTreeActive: !1 };
4
4
  if (e.children) {
5
- let r = s({ menuData: e.children, moduleSelectedId: a, initialLevel: i + 1 });
5
+ let r = f({ menuData: e.children, moduleSelectedId: a, initialLevel: i + 1 });
6
6
  const n = r.findIndex((t) => t.active === !0);
7
7
  if (i === 0)
8
8
  return { ...e, children: r, active: !1, itemInTreeActive: !1 };
9
- n !== -1 && (r = r.map((t, f) => t.active ? { ...t, itemInTreeActive: !1 } : !t.active && !((t.children?.length ?? 0) > 0) ? { ...t, itemInTreeActive: !0, active: !1 } : f <= n ? {
9
+ n !== -1 && (r = r.map((t, v) => t.active ? { ...t, itemInTreeActive: !1 } : !t.active && !((t.children?.length ?? 0) > 0) ? { ...t, itemInTreeActive: !0, active: !1 } : v <= n ? {
10
10
  ...t,
11
11
  itemInTreeActive: !0,
12
12
  active: !1
@@ -22,5 +22,5 @@ const s = ({ menuData: u, moduleSelectedId: a, initialLevel: i = 0 }) => u.map((
22
22
  return { ...e, active: !1, itemInTreeActive: !1 };
23
23
  });
24
24
  export {
25
- s as getMenuDataWithState
25
+ f as getMenuDataWithState
26
26
  };
@@ -0,0 +1,3 @@
1
+ /** Normalize a saved width or a resize position to the supported desktop range. */
2
+ export declare function resolveSidebarWidth(value: unknown): number;
3
+ //# sourceMappingURL=resolveSidebarWidth.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"resolveSidebarWidth.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/SideBar/helpers/resolveSidebarWidth.ts"],"names":[],"mappings":"AAEA,mFAAmF;AACnF,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAM1D"}
@@ -0,0 +1,7 @@
1
+ import { SIDEBAR_WIDTH as t } from "../constants.js";
2
+ function e(r) {
3
+ return typeof r != "number" || !Number.isFinite(r) ? t.default : Math.round(Math.max(t.min, Math.min(t.max, r)));
4
+ }
5
+ export {
6
+ e as resolveSidebarWidth
7
+ };
@@ -0,0 +1,4 @@
1
+ import { SideBarPreferenceBindings, SideBarPreferencesStorage } from '../types';
2
+ /** Share responsive sidebar state with the shell and replay edits made during storage hydration. */
3
+ export declare function useSideBarPreferences(storage?: SideBarPreferencesStorage): SideBarPreferenceBindings;
4
+ //# sourceMappingURL=useSideBarPreferences.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useSideBarPreferences.d.ts","sourceRoot":"","sources":["../../../../../../../packages/components/src/components/SideBar/hooks/useSideBarPreferences.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAEV,yBAAyB,EAEzB,yBAAyB,EAG1B,MAAM,UAAU,CAAC;AAoBlB,oGAAoG;AACpG,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,yBAAyB,GAAG,yBAAyB,CA8HpG"}
@@ -0,0 +1,71 @@
1
+ import { useIsMobile as W } from "@m4l/graphics";
2
+ import { useState as m, useRef as y, useCallback as c, useEffect as B } from "react";
3
+ import { DEFAULT_SIDEBAR_PREFERENCES as P, SIDEBAR_INITIAL_PREFERENCES_WAIT_MS as N } from "../constants.js";
4
+ import { resolveSidebarWidth as R } from "../helpers/resolveSidebarWidth.js";
5
+ function V(s) {
6
+ const o = s && typeof s == "object" && !Array.isArray(s) ? s : void 0, a = Array.isArray(o?.favorites) ? o.favorites.filter(
7
+ (n) => typeof n == "string" && n.length > 0 && !n.startsWith("area:")
8
+ ) : [];
9
+ return {
10
+ anchored: typeof o?.anchored == "boolean" ? o.anchored : P.anchored,
11
+ favorites: [...new Set(a)],
12
+ width: R(o?.width)
13
+ };
14
+ }
15
+ function G(s) {
16
+ const o = W(), a = s?.load, n = s?.save, [v, E] = m(P), [A, S] = m(), [I, g] = m(!1), [T, k] = m(0), d = y(v), w = y([]), f = y("pending"), { anchored: b, width: D } = A ?? v, l = c((t) => {
17
+ S((e) => e ?? { anchored: t.anchored, width: t.width });
18
+ }, []);
19
+ B(() => {
20
+ if (!a || !n)
21
+ return;
22
+ let t = !0;
23
+ const e = T === 0 ? window.setTimeout(() => l(d.current), N) : void 0;
24
+ return a().then((r) => {
25
+ if (!t)
26
+ return;
27
+ const u = V(r), i = w.current.reduce((F, M) => M(F), u);
28
+ w.current = [], d.current = i, f.current = "loaded", E(i), l(i), i !== u && n(i);
29
+ }).catch(() => {
30
+ t && (f.current = "failed", l(d.current));
31
+ }).finally(() => {
32
+ window.clearTimeout(e);
33
+ }), () => {
34
+ t = !1, window.clearTimeout(e);
35
+ };
36
+ }, [T, a, l, n]);
37
+ const h = c((t) => {
38
+ const e = d.current, r = t(e), u = !n || f.current === "loaded";
39
+ u || (w.current.push(t), f.current === "failed" && (f.current = "pending", k((i) => i + 1))), r !== e && (d.current = r, E(r), u && n?.(r));
40
+ }, [n]), p = c((t) => {
41
+ S((e) => e && { ...e, ...t }), h((e) => {
42
+ const r = { ...e, ...t };
43
+ return r.anchored === e.anchored && r.width === e.width ? e : r;
44
+ });
45
+ }, [h]), L = c((t) => {
46
+ o || p({ anchored: t ?? !b });
47
+ }, [b, o, p]), _ = c((t) => {
48
+ g((e) => t ?? !e);
49
+ }, []), x = c((t) => {
50
+ h((e) => {
51
+ const r = t(e.favorites);
52
+ return r === e.favorites ? e : { ...e, favorites: r };
53
+ });
54
+ }, [h]), C = c((t) => {
55
+ p({ width: R(t) });
56
+ }, [p]);
57
+ return {
58
+ anchored: !o && b,
59
+ visible: !o || I,
60
+ desktopReady: !s || A !== void 0,
61
+ width: D,
62
+ favorites: v.favorites,
63
+ onToggleAnchored: L,
64
+ onToggleVisible: _,
65
+ onWidthChange: C,
66
+ updateFavorites: x
67
+ };
68
+ }
69
+ export {
70
+ G as useSideBarPreferences
71
+ };
@@ -1,3 +1,6 @@
1
1
  export { SideBar } from './SideBar';
2
- export type { MenuDataType, MenuItemClickOptions } from './types';
2
+ export { SIDEBAR_WIDTH } from './constants';
3
+ export { getSideBarDictionaryDefaults } from './dictionaryDefaults';
4
+ export { useSideBarPreferences } from './hooks/useSideBarPreferences';
5
+ export type { MenuDataType, MenuItemClickOptions, SideBarNavigationOptions, SideBarPreferenceBindings, SideBarPreferences, SideBarPreferencesStorage, SideBarProps, UpdateSideBarFavorites, } from './types';
3
6
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/SideBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,YAAY,EAAE,YAAY,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../packages/components/src/components/SideBar/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,qBAAqB,EAAE,MAAM,+BAA+B,CAAC;AACtE,YAAY,EACV,YAAY,EACZ,oBAAoB,EACpB,wBAAwB,EACxB,yBAAyB,EACzB,kBAAkB,EAClB,yBAAyB,EACzB,YAAY,EACZ,sBAAsB,GACvB,MAAM,SAAS,CAAC"}
@@ -1,5 +1,5 @@
1
1
  import { styled as n } from "@mui/material/styles";
2
- import { SideBarDesktopSlots as a, SideBarMobileSlots as m, ContentComponentSlots as r, SideBarFooterSlots as s, HeaderSidebarSlots as i, ContentGroupsSlots as o } from "./SideBarEnum.js";
2
+ import { SideBarMobileSlots as m, SideBarDesktopSlots as a, ContentComponentSlots as r, SideBarFooterSlots as s, HeaderSidebarSlots as i, ContentGroupsSlots as o } from "./SideBarEnum.js";
3
3
  import { SIDEBAR_KEY_COMPONENT as t } from "../constants.js";
4
4
  import { sideBarStyles as e } from "../styles.js";
5
5
  import { IconButton as c } from "../../extended/mui/IconButton/IconButton.js";
@@ -0,0 +1,4 @@
1
+ import { SidebarNavigationProps } from './types';
2
+ /** Enable window navigation when the shared sidebar is rendered within Areas. */
3
+ export declare function SideBarNavigation(props: SidebarNavigationProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=SideBarNavigation.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SideBarNavigation.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/SideBar/subcomponents/SideBarNavigation/SideBarNavigation.tsx"],"names":[],"mappings":"AAiDA,OAAO,KAAK,EAKV,sBAAsB,EAEvB,MAAM,SAAS,CAAC;AAGjB,iFAAiF;AACjF,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,sBAAsB,oDAG9D"}
@@ -0,0 +1,257 @@
1
+ import { jsx as i, jsxs as d } from "@emotion/react/jsx-runtime";
2
+ import { useEnvironment as Ue, useModuleDictionary as qe } from "@m4l/core";
3
+ import { useIsMobile as Je } from "@m4l/graphics";
4
+ import { ActionsSearchOutlined as Qe, ShapeStarOutlined as Xe, ArrowChevronSmUpOutlined as we } from "@m4l/icons";
5
+ import { useContext as Ze, useId as $e, useState as T, useMemo as j, useRef as ke, useEffect as Ve } from "react";
6
+ import { shallow as et } from "zustand/shallow";
7
+ import { AreasContext as tt } from "../../../areas/contexts/AreasContext/index.js";
8
+ import { useAreasStore as rt } from "../../../areas/hooks/useAreas/index.js";
9
+ import { SIDEBAR_DICTIONARY as h, SIDEBAR_WIDTH as pe } from "../../constants.js";
10
+ import { resolveSidebarWidth as it } from "../../helpers/resolveSidebarWidth.js";
11
+ import { EMPTY_SIDEBAR_WINDOWS as ot, EMPTY_SIDEBAR_MENU as nt } from "./constants.js";
12
+ import { sidebarNavigationEntries as at, sidebarLeaves as dt, windowShortcutId as Y, sidebarRoute as st, filterSidebarEntries as ct, instanceTitle as lt, setShortcutPinned as ut } from "./helpers.js";
13
+ import { SidebarBranding as mt, SidebarAttribution as ht } from "./SidebarBranding.js";
14
+ import { SidebarInstances as St } from "./SidebarInstances.js";
15
+ import { sidebarItemIcon as U } from "./SidebarItemIcon.js";
16
+ import { SidebarLabelTooltip as Ie } from "./SidebarLabelTooltip.js";
17
+ import { SidebarRow as ft } from "./SidebarRow.js";
18
+ import { SidebarPanel as wt, SidebarChromeHeader as pt, SidebarScroll as It, SidebarSearch as bt, SidebarGlyph as be, SidebarSearchInput as vt, SidebarBranches as ve, SidebarBranch as ge, SidebarBranchToggle as Ae, SidebarBranchGlyph as Ee, SidebarChevron as Be, SidebarDisclosure as Ce, SidebarDisclosureClip as xe, SidebarChildren as Te, SidebarMenu as gt, SidebarGroup as At, SidebarGroupHeading as Et, SidebarEmpty as Bt, SidebarChromeFooter as Ct, SidebarFooterAction as xt, SidebarDrawer as Tt, SidebarFrame as Rt, SidebarResizeHandle as Lt } from "./slots/styled.js";
19
+ import { useSidebarResize as Dt } from "./useSidebarResize.js";
20
+ function $t(u) {
21
+ return Ze(tt) ? /* @__PURE__ */ i(Wt, { ...u }) : /* @__PURE__ */ i(Re, { ...u });
22
+ }
23
+ function Wt(u) {
24
+ const I = rt((s) => ({
25
+ activeAreaId: s.currentAreaId,
26
+ activeWindowId: s.hashAreas[s.currentAreaId]?.currentLayoutId || void 0,
27
+ windows: s.hashWindows,
28
+ selectArea: s.areasActions.selectArea,
29
+ selectLayout: s.areaActions.selectLayout,
30
+ closeWindow: s.windowActions.close
31
+ }), et);
32
+ return /* @__PURE__ */ i(Re, { ...u, areas: I });
33
+ }
34
+ function Re({
35
+ anchored: u,
36
+ menuData: I = nt,
37
+ moduleSelectedId: s,
38
+ onMenuItemClick: b,
39
+ onToggleVisible: N,
40
+ visible: q,
41
+ companyLogoSmallUrl: J,
42
+ headerComponent: Q,
43
+ footerComponent: X,
44
+ navigation: Le,
45
+ areas: m
46
+ }) {
47
+ const { hostApiRemote: z } = Ue(), { getLabel: c } = qe(), {
48
+ title: v,
49
+ showHeading: Z = !0,
50
+ rootTitles: $,
51
+ badgeColor: k,
52
+ attributionLogo: De,
53
+ attributionLogoUrl: We,
54
+ footerAction: S,
55
+ preferences: ye
56
+ } = Le, K = De ?? We, { favorites: R, updateFavorites: O, width: Me, onWidthChange: Fe } = ye, L = Je(), D = Dt(it(Me), Fe), g = m?.activeAreaId, V = m?.activeWindowId, W = m?.windows ?? ot, ee = $e(), [te, Ne] = T(""), [ze, Ke] = T(() => /* @__PURE__ */ new Set()), [y, Oe] = T(!0), [f, M] = T(), [A, P] = T(), E = te.trim().toLocaleLowerCase(), B = j(
57
+ () => at(I, v, $),
58
+ [I, v, $]
59
+ ), C = j(() => dt(B), [B]), w = j(() => Object.values(W).filter((e) => e.emergeType === "layout" && e.winType === "microfrontend"), [W]), _ = w.filter((e) => e.areaId === g), re = ke(w), ie = new Map(C.map((e) => [e.id, e])), Pe = new Map(B.map((e, t) => [e.id, t])), _e = new Map(w.map((e) => [Y(e.windowId), e])), oe = _.filter((e) => e.moduleId === A?.entry.item.moduleId).sort((e, t) => (e.moduleCount ?? 0) - (t.moduleCount ?? 0));
60
+ Ve(() => {
61
+ const e = re.current.filter((o) => !W[o.windowId]);
62
+ if (re.current = w, !e.length)
63
+ return;
64
+ const t = new Set(e.map((o) => Y(o.windowId))), r = /* @__PURE__ */ new Map();
65
+ for (const o of e) {
66
+ const a = w.filter(
67
+ (n) => n.moduleId === o.moduleId && n.areaId === o.areaId
68
+ );
69
+ if (a.length === 1) {
70
+ const n = C.find((l) => l.item.moduleId === o.moduleId);
71
+ n && r.set(Y(a[0].windowId), n.id);
72
+ }
73
+ }
74
+ O((o) => {
75
+ const a = [...new Set(o.filter((n) => !t.has(n)).map((n) => r.get(n) ?? n))];
76
+ return a.length === o.length && a.every((n, l) => n === o[l]) ? o : a;
77
+ });
78
+ }, [w, C, O, W]);
79
+ const Ge = (e) => {
80
+ Ke((t) => {
81
+ const r = new Set(t);
82
+ return r.has(e) ? r.delete(e) : r.add(e), r;
83
+ });
84
+ }, x = () => {
85
+ P(void 0);
86
+ }, ne = (e) => {
87
+ const t = R.includes(e);
88
+ O((r) => ut(r, e, !t)), t && M((r) => r?.favoriteId === e ? { ...r, favoriteId: void 0 } : r);
89
+ }, ae = (e, t, r) => {
90
+ t.areaId !== g && m?.selectArea(t.areaId), m?.selectLayout(t.areaId, t.windowId), M({ entryId: e.id, areaId: t.areaId, favoriteId: r, windowId: t.windowId }), x(), L && N(!1);
91
+ }, He = (e, t, r, o) => {
92
+ if (o) {
93
+ ae(e, o, r);
94
+ return;
95
+ }
96
+ M({ entryId: e.id, areaId: g, favoriteId: r });
97
+ const a = _.filter((n) => n.moduleId === e.item.moduleId);
98
+ if (!t.shiftKey && a.length > 1) {
99
+ P({ entry: e, anchor: t.currentTarget });
100
+ return;
101
+ }
102
+ t.shiftKey ? b(e.item, { shiftKey: !0 }) : b(e.item), x(), L && N(!1);
103
+ }, de = f && f.areaId === g ? ie.get(f.entryId) : void 0, se = de?.item.moduleId === s ? de : void 0, G = se ?? C.find((e) => e.item.moduleId && e.item.moduleId === s), F = se && (!f?.windowId || f.windowId === V) ? f?.favoriteId : void 0, je = new Set(G && !F ? st(B, G.id) : []), ce = ct(B, E), le = R.flatMap((e) => {
104
+ const t = _e.get(e), r = ie.get(e) ?? C.find((o) => t && o.item.moduleId === t.moduleId);
105
+ return !r || E && !r.item.title.toLocaleLowerCase().includes(E) ? [] : [{ id: e, entry: r, instance: t }];
106
+ }), ue = (e, t, r, o) => {
107
+ const a = r ?? e.id, n = r ? F === a : !F && G?.id === e.id, l = !r && e.item.moduleId && _.some(
108
+ (p) => p.moduleId === e.item.moduleId
109
+ );
110
+ return /* @__PURE__ */ i(
111
+ ft,
112
+ {
113
+ title: o ? lt(e.item.title, o.moduleCount ?? 1) : e.item.title,
114
+ icon: U(e.item, z),
115
+ favoriteShortcut: !!r,
116
+ nested: t,
117
+ selected: n,
118
+ pinned: R.includes(a),
119
+ getLabel: c,
120
+ onSelect: (p) => He(e, p, r, o),
121
+ onPin: () => ne(a),
122
+ onAdd: l ? (p) => {
123
+ M({ entryId: e.id, areaId: g }), b(e.item, { shiftKey: !0 });
124
+ const Ye = p.currentTarget.closest("[data-sidebar-row]") ?? p.currentTarget;
125
+ P({ entry: e, anchor: Ye });
126
+ } : void 0
127
+ },
128
+ a
129
+ );
130
+ }, me = (e, t, r) => {
131
+ if (!e.children)
132
+ return ue(e, t);
133
+ const o = !!E || !ze.has(e.id), n = { current: je.has(e.id), nested: t };
134
+ return /* @__PURE__ */ d(ge, { ownerState: n, children: [
135
+ /* @__PURE__ */ i(Ie, { title: e.item.title, children: (l) => /* @__PURE__ */ d(
136
+ Ae,
137
+ {
138
+ type: "button",
139
+ ownerState: n,
140
+ "aria-expanded": o,
141
+ onClick: () => Ge(e.id),
142
+ children: [
143
+ /* @__PURE__ */ i(Ee, { "aria-hidden": "true", ownerState: n, children: U(e.item, z, t ? void 0 : r) }),
144
+ l,
145
+ /* @__PURE__ */ i(Be, { "aria-hidden": "true", ownerState: { expanded: o }, children: /* @__PURE__ */ i(we, {}) })
146
+ ]
147
+ }
148
+ ) }),
149
+ /* @__PURE__ */ i(Ce, { ownerState: { expanded: o }, inert: !o, children: /* @__PURE__ */ i(xe, { children: /* @__PURE__ */ i(Te, { ownerState: { nested: t, withGuide: !0 }, role: "group", "aria-label": e.item.title, children: e.children.map((l) => me(l, !0, r)) }) }) })
150
+ ] }, e.id);
151
+ }, he = c(h.favorites), H = { current: !!F, nested: !1 }, Se = L ? q : u, fe = /* @__PURE__ */ d(wt, { "data-sidebar-panel": !0, "data-testid": "platform-sidebar", inert: !Se, children: [
152
+ (Q || J || k) && /* @__PURE__ */ i(pt, { children: Q ?? /* @__PURE__ */ i(mt, { logo: J, title: v, badgeColor: k }) }),
153
+ /* @__PURE__ */ d(It, { ownerState: { showHeading: Z }, onScroll: x, children: [
154
+ /* @__PURE__ */ d(bt, { children: [
155
+ /* @__PURE__ */ i(be, { "aria-hidden": "true", children: /* @__PURE__ */ i(Qe, {}) }),
156
+ /* @__PURE__ */ i(
157
+ vt,
158
+ {
159
+ type: "search",
160
+ "aria-label": c(h.search),
161
+ placeholder: c(h.search),
162
+ value: te,
163
+ onChange: (e) => {
164
+ Ne(e.currentTarget.value), x();
165
+ }
166
+ }
167
+ )
168
+ ] }),
169
+ /* @__PURE__ */ d(ve, { children: [
170
+ le.length > 0 && /* @__PURE__ */ d(ge, { role: "group", "aria-label": he, ownerState: H, children: [
171
+ /* @__PURE__ */ i(Ie, { title: he, children: (e) => /* @__PURE__ */ d(
172
+ Ae,
173
+ {
174
+ type: "button",
175
+ ownerState: H,
176
+ "aria-expanded": y,
177
+ "aria-controls": ee,
178
+ onClick: () => Oe((t) => !t),
179
+ children: [
180
+ /* @__PURE__ */ i(Ee, { "aria-hidden": "true", ownerState: H, children: /* @__PURE__ */ i(Xe, {}) }),
181
+ e,
182
+ /* @__PURE__ */ i(Be, { "aria-hidden": "true", ownerState: { expanded: y }, children: /* @__PURE__ */ i(we, {}) })
183
+ ]
184
+ }
185
+ ) }),
186
+ /* @__PURE__ */ i(
187
+ Ce,
188
+ {
189
+ id: ee,
190
+ ownerState: { expanded: y },
191
+ inert: !y,
192
+ children: /* @__PURE__ */ i(xe, { children: /* @__PURE__ */ i(Te, { ownerState: { nested: !1 }, role: "list", children: le.map(({ id: e, entry: t, instance: r }) => ue(t, !1, e, r)) }) })
193
+ }
194
+ )
195
+ ] }),
196
+ /* @__PURE__ */ i(gt, { role: "menu", "aria-label": c(h.navigation), children: /* @__PURE__ */ d(At, { role: "group", "aria-label": v, children: [
197
+ Z && /* @__PURE__ */ i(Et, { children: v }),
198
+ /* @__PURE__ */ d(ve, { children: [
199
+ ce.map((e) => me(e, !1, Pe.get(e.id))),
200
+ E && !ce.length && /* @__PURE__ */ i(Bt, { role: "status", children: c(h.noResults) })
201
+ ] })
202
+ ] }) })
203
+ ] })
204
+ ] }),
205
+ (S || X || K) && /* @__PURE__ */ d(Ct, { children: [
206
+ S && /* @__PURE__ */ d(
207
+ xt,
208
+ {
209
+ type: "button",
210
+ onClick: (e) => {
211
+ e.shiftKey ? b(S.item, { shiftKey: !0 }) : b(S.item);
212
+ },
213
+ children: [
214
+ /* @__PURE__ */ i(be, { "aria-hidden": "true", children: S.icon }),
215
+ S.item.title
216
+ ]
217
+ }
218
+ ),
219
+ X,
220
+ K && /* @__PURE__ */ i(ht, { logo: K, label: c(h.attribution) })
221
+ ] }),
222
+ m && A && Se && oe.length > 1 && /* @__PURE__ */ i(
223
+ St,
224
+ {
225
+ menu: A,
226
+ instances: oe,
227
+ selectedWindowId: V,
228
+ favorites: R,
229
+ icon: U(A.entry.item, z),
230
+ getLabel: c,
231
+ onSelect: (e) => ae(A.entry, e),
232
+ onToggleFavorite: ne,
233
+ onCloseInstance: m.closeWindow,
234
+ onDismiss: x
235
+ }
236
+ )
237
+ ] });
238
+ return L ? /* @__PURE__ */ i(Tt, { open: q, onClose: () => N(!1), children: fe }) : /* @__PURE__ */ d(Rt, { ownerState: { width: D.width, expanded: u, resizing: D.resizing }, children: [
239
+ fe,
240
+ u && /* @__PURE__ */ i(
241
+ Lt,
242
+ {
243
+ type: "button",
244
+ role: "separator",
245
+ "aria-orientation": "vertical",
246
+ "aria-label": c(h.resize),
247
+ "aria-valuemin": pe.min,
248
+ "aria-valuemax": pe.max,
249
+ "aria-valuenow": D.width,
250
+ ...D.handle
251
+ }
252
+ )
253
+ ] });
254
+ }
255
+ export {
256
+ $t as SideBarNavigation
257
+ };
@@ -0,0 +1,6 @@
1
+ import { SidebarAttributionProps, SidebarBrandingProps } from './types';
2
+ /** Display the tenant logo and its localized environment badge. */
3
+ export declare function SidebarBranding({ logo, title, badgeColor }: SidebarBrandingProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ /** Display the attribution in the compact navigation footer. */
5
+ export declare function SidebarAttribution({ logo, label }: SidebarAttributionProps): import("@emotion/react/jsx-runtime").JSX.Element;
6
+ //# sourceMappingURL=SidebarBranding.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarBranding.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/SideBar/subcomponents/SideBarNavigation/SidebarBranding.tsx"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAE7E,mEAAmE;AACnE,wBAAgB,eAAe,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,UAAU,EAAE,EAAE,oBAAoB,oDAkBhF;AAED,gEAAgE;AAChE,wBAAgB,kBAAkB,CAAC,EAAE,IAAI,EAAE,KAAK,EAAE,EAAE,uBAAuB,oDAoB1E"}
@@ -0,0 +1,44 @@
1
+ import { jsxs as o, jsx as r } from "@emotion/react/jsx-runtime";
2
+ import { useHostThemeMode as a } from "@m4l/graphics";
3
+ import { useTheme as n } from "@mui/material/styles";
4
+ import { SIDEBAR_ATTRIBUTION_SIZE as s } from "./constants.js";
5
+ import { SidebarBrandHeader as b, SidebarBrandLogo as m, SidebarBrandBadge as c, SidebarAttributionRoot as l, SidebarAttributionDivider as p, SidebarAttributionLogo as S, SidebarAttributionMark as f } from "./slots/styled.js";
6
+ import { Typography as h } from "../../../extended/mui/Typography/Typography.js";
7
+ function I({ logo: e, title: i, badgeColor: t }) {
8
+ const d = a(n().palette.mode);
9
+ return /* @__PURE__ */ o(b, { children: [
10
+ typeof e == "string" ? /* @__PURE__ */ r(
11
+ m,
12
+ {
13
+ ownerState: { themeMode: d },
14
+ src: e,
15
+ alt: "logo",
16
+ width: "72px",
17
+ height: "32px",
18
+ enableIntersectionObserver: !1
19
+ }
20
+ ) : e,
21
+ t && /* @__PURE__ */ r(c, { label: i, variant: "contained", color: t, size: "small" })
22
+ ] });
23
+ }
24
+ function T({ logo: e, label: i }) {
25
+ const t = a(n().palette.mode);
26
+ return /* @__PURE__ */ o(l, { children: [
27
+ /* @__PURE__ */ r(h, { variant: "bodyStandard", color: "text.disabled", children: i }),
28
+ /* @__PURE__ */ r(p, { orientation: "vertical", customVariant: "solid" }),
29
+ typeof e == "string" ? /* @__PURE__ */ r(
30
+ S,
31
+ {
32
+ ownerState: { themeMode: t },
33
+ src: e,
34
+ alt: "powerbyLogo",
35
+ ...s,
36
+ enableIntersectionObserver: !1
37
+ }
38
+ ) : /* @__PURE__ */ r(f, { children: e })
39
+ ] });
40
+ }
41
+ export {
42
+ T as SidebarAttribution,
43
+ I as SidebarBranding
44
+ };
@@ -0,0 +1,4 @@
1
+ import { SidebarInstancesProps } from './types';
2
+ /** Display and act on the real layout windows for the selected module in this Area. */
3
+ export declare function SidebarInstances({ menu, instances, selectedWindowId, favorites, icon, getLabel, onSelect, onToggleFavorite, onCloseInstance, onDismiss, }: SidebarInstancesProps): import("@emotion/react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=SidebarInstances.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"SidebarInstances.d.ts","sourceRoot":"","sources":["../../../../../../../../packages/components/src/components/SideBar/subcomponents/SideBarNavigation/SidebarInstances.tsx"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAErD,uFAAuF;AACvF,wBAAgB,gBAAgB,CAAC,EAC/B,IAAI,EACJ,SAAS,EACT,gBAAgB,EAChB,SAAS,EACT,IAAI,EACJ,QAAQ,EACR,QAAQ,EACR,gBAAgB,EAChB,eAAe,EACf,SAAS,GACV,EAAE,qBAAqB,oDA4DvB"}