@admin-layout/tailwind-design-pro 12.0.16-alpha.7 → 12.0.16-alpha.71
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.
- package/README.md +20 -0
- package/lib/cdm-locales/en/menu.json +2 -1
- package/lib/cdm-locales/es/menu.json +2 -1
- package/lib/cdm-locales/index.d.ts +2 -0
- package/lib/cdm-locales/index.d.ts.map +1 -0
- package/lib/cdm-locales/index.ts +1 -0
- package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
- package/lib/components/Layout/BasicLayout/index.d.ts +2 -1
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +134 -44
- package/lib/components/Layout/BasicLayout/index.js.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.d.ts +2 -0
- package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.js +16 -13
- package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
- package/lib/components/Layout/GlobalFooter/Account.d.ts +4 -0
- package/lib/components/Layout/GlobalFooter/Account.d.ts.map +1 -0
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +7 -12
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.js +31 -8
- package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +0 -2
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/MainHeader.js +54 -85
- package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +1 -1
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts +1 -0
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.js +73 -6
- package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightMenu.js +2 -4
- package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/index.d.ts +0 -1
- package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.d.ts +2 -2
- package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.js +69 -7
- package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
- package/lib/components/Layout/Sidebar/BottomMenu.d.ts +4 -0
- package/lib/components/Layout/Sidebar/BottomMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/BottomMenu.js +330 -0
- package/lib/components/Layout/Sidebar/BottomMenu.js.map +1 -0
- package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
- package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -1
- package/lib/components/Layout/Sidebar/MainSidebar.d.ts +5 -0
- package/lib/components/Layout/Sidebar/MainSidebar.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/{Sidebar.js → MainSidebar.js} +94 -34
- package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +4 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js +291 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +5 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.js +277 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.js.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts +4 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js +330 -0
- package/lib/components/Layout/Sidebar/PerplexSidebarMenu.js.map +1 -0
- package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/TailwindLayout.js +37 -10
- package/lib/components/Layout/TailwindLayout.js.map +1 -1
- package/lib/components/Layout/getPageTitle.js.map +1 -1
- package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -1
- package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -1
- package/lib/components/Layout/slot-fill/Logo.d.ts +4 -0
- package/lib/components/Layout/slot-fill/Logo.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/Logo.js +7 -0
- package/lib/components/Layout/slot-fill/Logo.js.map +1 -0
- package/lib/components/Layout/slot-fill/RightContent.js.map +1 -1
- package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts +4 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.js +7 -0
- package/lib/components/Layout/slot-fill/SideMenuLogo.js.map +1 -0
- package/lib/components/Layout/slot-fill/index.d.ts +2 -0
- package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
- package/lib/components/Layout/util.js +1 -1
- package/lib/components/Layout/util.js.map +1 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +1 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.js +13 -3
- package/lib/components/SettingDrawer/CheckBoxTheme.js.map +1 -1
- package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +1 -1
- package/lib/components/SettingDrawer/InvitationSettings.js +10 -6
- package/lib/components/SettingDrawer/InvitationSettings.js.map +1 -1
- package/lib/components/SettingDrawer/LayoutChange.d.ts.map +1 -1
- package/lib/components/SettingDrawer/LayoutChange.js +23 -16
- package/lib/components/SettingDrawer/LayoutChange.js.map +1 -1
- package/lib/components/SettingDrawer/MenuVisibilitySettings.d.ts +20 -0
- package/lib/components/SettingDrawer/MenuVisibilitySettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/MenuVisibilitySettings.js +120 -0
- package/lib/components/SettingDrawer/MenuVisibilitySettings.js.map +1 -0
- package/lib/components/SettingDrawer/NavigationsModes.d.ts +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.js +90 -39
- package/lib/components/SettingDrawer/NavigationsModes.js.map +1 -1
- package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +1 -1
- package/lib/components/SettingDrawer/RegionalSettings.js +54 -177
- package/lib/components/SettingDrawer/RegionalSettings.js.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.js +404 -66
- package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
- package/lib/components/SettingDrawer/Switch/index.js.map +1 -1
- package/lib/components/SettingDrawer/ThemeColor.d.ts.map +1 -1
- package/lib/components/SettingDrawer/ThemeColor.js +15 -3
- package/lib/components/SettingDrawer/ThemeColor.js.map +1 -1
- package/lib/components/SettingDrawer/types.d.ts +12 -0
- package/lib/components/SettingDrawer/types.d.ts.map +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +10 -5
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +97 -4
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/typings.d.ts +20 -1
- package/lib/components/typings.d.ts.map +1 -1
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +10 -2
- package/lib/compute.js.map +1 -1
- package/lib/config/constants.js.map +1 -1
- package/lib/config/env-config.d.ts +3 -0
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +10 -0
- package/lib/config/env-config.js.map +1 -1
- package/lib/helpers/DynamicIcon.js.map +1 -1
- package/lib/hooks/useMediaQuery.js.map +1 -1
- package/lib/hooks/useScrollThreshold.js.map +1 -1
- package/lib/hooks/useTailwindTheme.js +82 -0
- package/lib/hooks/useTailwindTheme.js.map +1 -0
- package/lib/icons.d.ts +2 -0
- package/lib/icons.d.ts.map +1 -1
- package/lib/icons.js +4 -2
- package/lib/icons.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -1
- package/lib/index.js.map +1 -1
- package/lib/machines/selectors.d.ts +118 -0
- package/lib/machines/selectors.d.ts.map +1 -0
- package/lib/machines/settingsMachine.d.ts +25 -2
- package/lib/machines/settingsMachine.d.ts.map +1 -1
- package/lib/machines/settingsMachine.js +174 -163
- package/lib/machines/settingsMachine.js.map +1 -1
- package/lib/machines/settingsMachine.test.d.ts +2 -0
- package/lib/machines/settingsMachine.test.d.ts.map +1 -0
- package/lib/machines/types.d.ts +106 -9
- package/lib/machines/types.d.ts.map +1 -1
- package/lib/machines/types.js.map +1 -1
- package/lib/module.js.map +1 -1
- package/lib/redux/searchReducer.js.map +1 -1
- package/lib/routes.json +9 -1
- package/lib/tailwindConfig.js.map +1 -1
- package/lib/utils/__tests__/configOverrides.test.d.ts +2 -0
- package/lib/utils/__tests__/configOverrides.test.d.ts.map +1 -0
- package/lib/utils/configOverrides.d.ts +213 -0
- package/lib/utils/configOverrides.d.ts.map +1 -0
- package/lib/utils/configOverrides.js +91 -0
- package/lib/utils/configOverrides.js.map +1 -0
- package/lib/utils/isBrowser/index.js.map +1 -1
- package/lib/utils/settingsUtils.d.ts +20 -0
- package/lib/utils/settingsUtils.d.ts.map +1 -0
- package/lib/utils/settingsUtils.js +74 -0
- package/lib/utils/settingsUtils.js.map +1 -0
- package/lib/utils/utils/index.js.map +1 -1
- package/package.json +6 -6
- package/lib/components/Layout/GlobalHeader/Logo.d.ts +0 -4
- package/lib/components/Layout/GlobalHeader/Logo.d.ts.map +0 -1
- package/lib/components/Layout/GlobalHeader/Logo.js +0 -141
- package/lib/components/Layout/GlobalHeader/Logo.js.map +0 -1
- package/lib/components/Layout/Sidebar/Sidebar.d.ts +0 -5
- package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +0 -1
- package/lib/components/Layout/Sidebar/Sidebar.js.map +0 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +0 -4
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +0 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.js +0 -176
- package/lib/components/Layout/Sidebar/SidebarMenu.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIvD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,
|
|
1
|
+
{"version":3,"file":"Header.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/Header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAK1B,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAIvD,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CAgJzD,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -21,18 +21,41 @@ import {jsx,jsxs}from'react/jsx-runtime';import {Link}from'@remix-run/react';imp
|
|
|
21
21
|
isSearching
|
|
22
22
|
} = useSelector(state => state.search);
|
|
23
23
|
const currentRoute = location?.pathname || '/';
|
|
24
|
-
const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
|
|
25
24
|
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
26
|
-
|
|
27
|
-
const
|
|
25
|
+
// Helper function to get value from uilayout with route/device override support
|
|
26
|
+
const getUILayoutValue = path => {
|
|
27
|
+
// Check for route/device-specific override first
|
|
28
|
+
const routeDeviceKey = `[${currentRoute}][${deviceType}]`;
|
|
29
|
+
const uiOverride = settings?.uiSettings?.[routeDeviceKey];
|
|
30
|
+
if (uiOverride) {
|
|
31
|
+
const value = path.split('.').reduce((obj, key) => obj?.[key], uiOverride);
|
|
32
|
+
if (value !== undefined) return value;
|
|
33
|
+
}
|
|
34
|
+
// Fallback to settings (flattened uilayout from configuration-registries)
|
|
35
|
+
return path.split('.').reduce((obj, key) => obj?.[key], settings);
|
|
36
|
+
};
|
|
37
|
+
// Get device settings directly from uilayout
|
|
38
|
+
const deviceSettings = {
|
|
39
|
+
header: getUILayoutValue('header'),
|
|
40
|
+
background: getUILayoutValue('background')
|
|
41
|
+
};
|
|
42
|
+
// Get layout settings directly from uilayout
|
|
43
|
+
const layoutSettings = {
|
|
44
|
+
contentWidth: getUILayoutValue('contentWidth'),
|
|
45
|
+
navigationMode: getUILayoutValue('navigationMode'),
|
|
46
|
+
sideMenuType: getUILayoutValue('sideMenuType'),
|
|
47
|
+
fixedHeader: getUILayoutValue('fixedHeader'),
|
|
48
|
+
fixedSidebar: getUILayoutValue('fixedSidebar'),
|
|
49
|
+
splitMenus: getUILayoutValue('splitMenus'),
|
|
50
|
+
upperMenuDividerName: getUILayoutValue('upperMenuDividerName'),
|
|
51
|
+
middleMenuDividerName: getUILayoutValue('middleMenuDividerName'),
|
|
52
|
+
lowerMenuDividerName: getUILayoutValue('lowerMenuDividerName')
|
|
53
|
+
};
|
|
28
54
|
const headerSettings = deviceSettings?.header || {};
|
|
29
|
-
const backgroundSettings = deviceSettings?.background || {
|
|
30
|
-
type: 'color',
|
|
31
|
-
color: 'inherit',
|
|
32
|
-
image: ''};
|
|
55
|
+
const backgroundSettings = deviceSettings?.background || {};
|
|
33
56
|
// Use CSS classes instead of theme-based styling
|
|
34
57
|
const getHeaderClasses = () => {
|
|
35
|
-
let classes = `z-10 py-4 top-0 border-b border-border relative ${layoutSettings?.fixedHeader ? 'sticky' : 'relative'}`;
|
|
58
|
+
let classes = `z-10 py-4 top-0 border-b border-border header-container relative ${layoutSettings?.fixedHeader ? 'sticky' : 'relative'}`;
|
|
36
59
|
if (backgroundSettings.type === 'image' && backgroundSettings.image) {
|
|
37
60
|
classes += ' bg-cover bg-center';
|
|
38
61
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Header.js","sources":["../../../../src/components/Layout/GlobalHeader/Header.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Header.js","sources":["../../../../src/components/Layout/GlobalHeader/Header.tsx"],"sourcesContent":[null],"names":[],"mappings":"0ZASO,MAAM,YAAY,GAAqC,KAAC,IAAO;AAClE,EAAA,MAAA;AACA,IAAA,KAAA;AACA,IAAA,MAAM;AACN,IAAA,UAAM;AACN,IAAA,WAAQ;AAER,IAAA;IACA,QAAM;IAEN,cAAA;AACA,IAAA;WACI;AACA,EAAA,MAAA;;WAGA;;;AAE6B,GAAA,GAAA,aAAA,EAAA;EAC5B,WAAA;QAED;eACO;AACX,IAAA;MAEA,WAAA,CAAA,KAAA,IAAA,KAAA,CAAA,MAAA,CAAA;AACA,EAAA,MAAA,uBAAuB,EAAA,QAAA,IAAA,GAAA;AACnB,EAAA,MAAA,UAAQ,GAAA,QAAA,GAAgB,QAAC,GAAS,SAAA;AAClC;QACF,gBAAA,GAAA,IAAA,I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,EAAA,cAAA,EAAA,WAAA,GAAA,QAAA,GAAA,UAAA,CAAA,CAAA;AAC7C,IAAA,IAAA,kBAAW,CAAA,IAAA,KAAA,OAAkB,IAAM,kBAAC,CAAA,KAAA,EAAA;AACpC,MAAA,OAAA,IAAA,qBAAmB;;AAGvB,IAAA,OAAA;AACJ,EAAA,CAAA;QAEA,eAAA,GAAA,MAAA;IACA,MAAK,UAAA,GAAc,EAAE;AAAY,IAAA,IAAA,kBAAY,CAAA,IAAA,KAAA,OAAA,IAAA,kBAAA,CAAA,KAAA,EAAA;MAE7C,UAAA,CAAA,eAAA,GAAA,CAAA,IAAA,EAAA,kBAA0C,CAAA,KAAA,CAAA,CAAA,CAAA;IAC1C,CAAA,MAAM,IAAA,kBAAgB,CAAA,IAAA,kCAAkC,CAAA,KAAgB,KAAA,SAAgB,EAAA;MAExF,UAAA,CAAA,eAAA,GAAA,kBAA6C,CAAA,KAAA;IAC7C;;AA2DJ,IAAE,IAAA,QAAA,EAAA,QAAA,KAAA,UAAA,EAAA;AAEF,MAAA,0BAA4B,GAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { MainHeaderProps, PrivateHeaderProps } from '../../typings';
|
|
3
|
-
export declare const defaultRenderLogo: (logo: () => React.ReactElement, animation: any, scrolled: any, settings: any, location: any) => React.ReactNode;
|
|
4
|
-
export declare const defaultRenderLogoAndTitle: (props: any, animation: any, renderKey?: string) => React.ReactNode;
|
|
5
3
|
export declare const MainHeader: React.FC<MainHeaderProps & PrivateHeaderProps>;
|
|
6
4
|
//# sourceMappingURL=MainHeader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/MainHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"MainHeader.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/MainHeader.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAS/B,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AAMpE,eAAO,MAAM,UAAU,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,GAAG,kBAAkB,CA0PrE,CAAC"}
|
|
@@ -1,70 +1,4 @@
|
|
|
1
|
-
import {jsx,jsxs}from'react/jsx-runtime';import*as React from'react';import {getMenuSeparation}from'@admin-layout/client';import {
|
|
2
|
-
from { transform: rotate(0deg); }
|
|
3
|
-
to { transform: rotate(360deg); }
|
|
4
|
-
`;
|
|
5
|
-
const defaultRenderLogo = (logo, animation, scrolled, settings, location) => {
|
|
6
|
-
if (typeof logo === 'string') {
|
|
7
|
-
return jsx(Logo, {
|
|
8
|
-
logo: undefined,
|
|
9
|
-
settings: settings,
|
|
10
|
-
scrolled: scrolled,
|
|
11
|
-
location: location
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
if (typeof logo === 'function') {
|
|
15
|
-
return logo();
|
|
16
|
-
}
|
|
17
|
-
return logo;
|
|
18
|
-
};
|
|
19
|
-
const defaultRenderLogoAndTitle = (props, animation, renderKey = 'menuHeaderRender') => {
|
|
20
|
-
const {
|
|
21
|
-
settings,
|
|
22
|
-
layout,
|
|
23
|
-
pageTitleInfo,
|
|
24
|
-
scrolled,
|
|
25
|
-
location
|
|
26
|
-
} = props;
|
|
27
|
-
const {
|
|
28
|
-
fontFamily,
|
|
29
|
-
titleFontSize,
|
|
30
|
-
titleFontWeight,
|
|
31
|
-
titleHeight,
|
|
32
|
-
titleColor,
|
|
33
|
-
letterSpacing,
|
|
34
|
-
logo,
|
|
35
|
-
title
|
|
36
|
-
} = settings || {};
|
|
37
|
-
const renderFunction = props[renderKey || ''];
|
|
38
|
-
if (renderFunction === false) {
|
|
39
|
-
return null;
|
|
40
|
-
}
|
|
41
|
-
const logoDom = defaultRenderLogo(logo, animation, scrolled, settings, location);
|
|
42
|
-
const titleDom = jsx("h1", {
|
|
43
|
-
className: `text-2xl ${settings?.navTheme === 'dark' ? 'text-[#F9FBFF]' : titleColor || 'text-gray-900'}`,
|
|
44
|
-
style: {
|
|
45
|
-
fontFamily: fontFamily,
|
|
46
|
-
fontWeight: titleFontWeight,
|
|
47
|
-
height: titleHeight,
|
|
48
|
-
letterSpacing: letterSpacing,
|
|
49
|
-
fontSize: titleFontSize
|
|
50
|
-
},
|
|
51
|
-
children: title
|
|
52
|
-
});
|
|
53
|
-
if (renderFunction) {
|
|
54
|
-
const {
|
|
55
|
-
isMobile
|
|
56
|
-
} = useMediaQuery();
|
|
57
|
-
return renderFunction(logoDom, isMobile ? null : titleDom, props);
|
|
58
|
-
}
|
|
59
|
-
if (layout === 'mix' && renderKey === 'menuHeaderRender') {
|
|
60
|
-
return null;
|
|
61
|
-
}
|
|
62
|
-
return jsx("div", {
|
|
63
|
-
className: "flex space-x-2 w-[200px] md:w-[200px] h-[60px]",
|
|
64
|
-
children: logoDom
|
|
65
|
-
});
|
|
66
|
-
};
|
|
67
|
-
const MainHeader = props => {
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import*as React from'react';import {getMenuSeparation}from'@admin-layout/client';import {Link}from'@remix-run/react';import {RightMenu}from'./RightMenu.js';import'@common-stack/components-pro';import {HeaderSearchBarSlot}from'../slot-fill/HeaderSearchBar.js';import {HeaderSearchButtonSlot}from'../slot-fill/HeaderSearchButton.js';import {RightContentSlot}from'../slot-fill/RightContent.js';import {LogoSlot}from'../slot-fill/Logo.js';import {SearchBarBehavior}from'../../../machines/types.js';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../../hooks/useMediaQuery.js';const MainHeader = props => {
|
|
68
2
|
const {
|
|
69
3
|
rightContentRender,
|
|
70
4
|
setSettingToggle,
|
|
@@ -75,7 +9,6 @@ const MainHeader = props => {
|
|
|
75
9
|
layout,
|
|
76
10
|
location,
|
|
77
11
|
showSettings,
|
|
78
|
-
onSettingChange,
|
|
79
12
|
settings,
|
|
80
13
|
primaryColor,
|
|
81
14
|
pageTitleInfo,
|
|
@@ -84,15 +17,31 @@ const MainHeader = props => {
|
|
|
84
17
|
setSearchOptionsShown,
|
|
85
18
|
authorities,
|
|
86
19
|
picture,
|
|
87
|
-
componentVisibility
|
|
20
|
+
componentVisibility,
|
|
21
|
+
showMenu,
|
|
22
|
+
toggleSideMenu
|
|
88
23
|
} = props;
|
|
89
24
|
const {
|
|
90
25
|
isMobile
|
|
91
26
|
} = useMediaQuery();
|
|
92
27
|
const currentRoute = location?.pathname || '/';
|
|
93
|
-
const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
|
|
94
28
|
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
95
|
-
|
|
29
|
+
// Helper function to get value from uilayout with route/device override support
|
|
30
|
+
const getUILayoutValue = path => {
|
|
31
|
+
// Check for route/device-specific override first
|
|
32
|
+
const routeDeviceKey = `[${currentRoute}][${deviceType}]`;
|
|
33
|
+
const uiOverride = settings?.uiSettings?.[routeDeviceKey];
|
|
34
|
+
if (uiOverride) {
|
|
35
|
+
const value = path.split('.').reduce((obj, key) => obj?.[key], uiOverride);
|
|
36
|
+
if (value !== undefined) return value;
|
|
37
|
+
}
|
|
38
|
+
// Fallback to settings (flattened uilayout from configuration-registries)
|
|
39
|
+
return path.split('.').reduce((obj, key) => obj?.[key], settings);
|
|
40
|
+
};
|
|
41
|
+
// Get device regions directly from uilayout
|
|
42
|
+
const deviceRegions = {
|
|
43
|
+
header: getUILayoutValue('header')
|
|
44
|
+
};
|
|
96
45
|
const headerSettings = deviceRegions?.header || {};
|
|
97
46
|
// State to track reduced motion preference
|
|
98
47
|
const [prefersReducedMotion, setPrefersReducedMotion] = React.useState(false);
|
|
@@ -128,26 +77,23 @@ const MainHeader = props => {
|
|
|
128
77
|
// const toggleSettings = () => {
|
|
129
78
|
// setSettingToggle(!settingToggle);
|
|
130
79
|
// };
|
|
131
|
-
const {
|
|
132
|
-
pathname
|
|
133
|
-
} = useLocation();
|
|
134
|
-
// Use the state variable for animation
|
|
135
|
-
const animation = prefersReducedMotion ? undefined : `${spin} infinite 20s linear`;
|
|
136
|
-
const headerDom = defaultRenderLogoAndTitle({
|
|
137
|
-
scrolled,
|
|
138
|
-
...props
|
|
139
|
-
}, animation, layout === 'mix' ? 'headerTitleRender' : undefined);
|
|
140
80
|
// Use CSS classes instead of theme-based styling
|
|
141
81
|
const getHeaderClasses = () => {
|
|
142
|
-
let classes =
|
|
82
|
+
let classes = ` ${isMobile ? headerSettings?.position || 'fixed' : scrolled ? 'fixed' : 'absolute'} w-full top-0 z-[100] px-[8%] transition-all duration-1000 ease-in-out group`;
|
|
143
83
|
if (scrolled) {
|
|
144
84
|
classes += ' py-2 shadow-themed-md';
|
|
145
85
|
} else {
|
|
146
|
-
classes += ' py-
|
|
86
|
+
classes += ' py-2';
|
|
147
87
|
}
|
|
148
88
|
if (searchOptionsShown) {
|
|
149
89
|
classes += ' pb-8';
|
|
150
90
|
}
|
|
91
|
+
if (showMenu) {
|
|
92
|
+
classes += ' border-b';
|
|
93
|
+
}
|
|
94
|
+
if (isMobile) {
|
|
95
|
+
classes += ' border-none';
|
|
96
|
+
}
|
|
151
97
|
return classes;
|
|
152
98
|
};
|
|
153
99
|
const getHeaderStyles = () => {
|
|
@@ -175,10 +121,33 @@ const MainHeader = props => {
|
|
|
175
121
|
justify-around items-start ${deviceRegions?.header?.searchBarRender ? 'pt-0' : 'pt-[7px]'}
|
|
176
122
|
${deviceRegions?.header?.hidden ? 'hidden' : 'flex'}
|
|
177
123
|
`,
|
|
178
|
-
children: [
|
|
124
|
+
children: [isMobile && showMenu && jsx("button", {
|
|
125
|
+
onClick: toggleSideMenu,
|
|
126
|
+
className: "flex items-center justify-center p-2 rounded-lg hover:bg-gray-100 dark:hover:bg-gray-800 transition-colors duration-200",
|
|
127
|
+
"aria-label": "Toggle sidebar",
|
|
128
|
+
children: jsx("svg", {
|
|
129
|
+
className: "w-6 h-6 text-gray-600 dark:text-gray-300",
|
|
130
|
+
fill: "none",
|
|
131
|
+
stroke: "currentColor",
|
|
132
|
+
viewBox: "0 0 24 24",
|
|
133
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
134
|
+
children: jsx("path", {
|
|
135
|
+
strokeLinecap: "round",
|
|
136
|
+
strokeLinejoin: "round",
|
|
137
|
+
strokeWidth: 2,
|
|
138
|
+
d: "M4 6h16M4 12h16M4 18h16"
|
|
139
|
+
})
|
|
140
|
+
})
|
|
141
|
+
}), headerSettings?.showLogo && jsx(Link, {
|
|
179
142
|
to: "/",
|
|
180
143
|
className: "text-foreground",
|
|
181
|
-
children:
|
|
144
|
+
children: jsx(LogoSlot, {
|
|
145
|
+
settings: settings,
|
|
146
|
+
scrolled: scrolled,
|
|
147
|
+
location: location,
|
|
148
|
+
prefersReducedMotion: prefersReducedMotion,
|
|
149
|
+
layout: layout
|
|
150
|
+
})
|
|
182
151
|
}), jsx("div", {
|
|
183
152
|
className: "flex-grow"
|
|
184
153
|
}), headerSettings?.showSearchSlot && jsxs("div", {
|
|
@@ -225,4 +194,4 @@ const MainHeader = props => {
|
|
|
225
194
|
})
|
|
226
195
|
})
|
|
227
196
|
});
|
|
228
|
-
};export{MainHeader
|
|
197
|
+
};export{MainHeader};//# sourceMappingURL=MainHeader.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MainHeader.js","sources":["../../../../src/components/Layout/GlobalHeader/MainHeader.tsx"],"sourcesContent":[null],"names":[
|
|
1
|
+
{"version":3,"file":"MainHeader.js","sources":["../../../../src/components/Layout/GlobalHeader/MainHeader.tsx"],"sourcesContent":[null],"names":[],"mappings":"0qBAeO,MAAM,UAAU,GAAmD,KAAC,IAAO;AAC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AACN,IAAA;AAEA,IAAA,OAAK,OAAA;AACD,EAAA,CAAA;QACH,eAAA,GAAA,MAAA;AACD,IAAA,IAAA,QACI,EAAA;;2CAKiC;AACpB,QAAA,KAAA,EAAA;;;;AAuEuB,MAAA,eAAA,EAAA,aAAA;AAEQ,MAAA,KAAA,EAAA;AAEZ,KAAA;AA4BxC,EAAE,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {Link}from'react
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {Link}from'@remix-run/react';import {useTranslation}from'react-i18next';import {generateMenuPath}from'@admin-layout/client';const OrganizationDropDown = props => {
|
|
2
2
|
const {
|
|
3
3
|
theme,
|
|
4
4
|
layout,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"OrganizationDropdown.js","sources":["../../../../src/components/Layout/GlobalHeader/OrganizationDropdown.tsx"],"sourcesContent":[null],"names":[],"mappings":"0NAMA,MAAM,oBAAoB,GAAqC,KAAC,
|
|
1
|
+
{"version":3,"file":"OrganizationDropdown.js","sources":["../../../../src/components/Layout/GlobalHeader/OrganizationDropdown.tsx"],"sourcesContent":[null],"names":[],"mappings":"0NAMA,MAAM,oBAAoB,GAAqC,KAAC,IAAO;AACnE,EAAA,MAAA;IACA,KAAA;IACA,MAAM;AACN,IAAA;IACA,WAAW;IAEX,SAAA;IACA;AACI,GAAA,GAAA,KAAA;QACA,CAAA,uBAAA,EAA0B,0BAAQ,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;AACtC,EAAA,MAAE,CAAA,iBAAA,EAAA,oBAAA,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;QAEF,WAAA,GAAA,MAAA,CAAA,IAAA,CAAA;QACA;AACI,IAAA,CAAA;AACI,IAAA;oBACI,CAAA,MAAA,CAAA;;AAER,EAAA,MAAA,iBAAE,GAAA,MAAA;AAEF,IAAA,oBAAS,CAAA,CAAA;AACT,IAAA,0BAAY,CAAA,KAAA,CAAA;AACR,EAAA,CAAA;AACJ;WACG,CAAA,MAAA;IAEP,MAAA,kBAAsB,GAAA,KAAA,IAAA;MACtB,IAAM,WAAA,CAAA,OAAmB,IAAG,CAAE,WAAA,CAAA,OAAA,CAAA,QAAA,CAAA,KAAA,CAAA,MAAA,CAAA,EAAA;QAC1B,oBAAoB,CAAC,KAAK,CAAC;AAC/B,MAAE;IAEF,CAAA;YACI,CAAA,gBAAqB,CAAA,WAAO,EAAA,kBAAA,CAAA;AAChC,IAAA,OAAE,MAAA;AAEF,MAAA,QACI,CAAA,+BAAuB,EAAA,kBAAoB,CAAA;AAmB3B,IAAA,CAAA;AAexB,EAAE,CAAA,EAAA,EAAA,CAAA;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as React from 'react';
|
|
2
2
|
import { GlobalHeaderRightProps } from '../../typings';
|
|
3
|
+
export declare const useHorizontalScroll: () => React.MutableRefObject<HTMLDivElement>;
|
|
3
4
|
export declare const RightContent: React.FC<GlobalHeaderRightProps>;
|
|
4
5
|
//# sourceMappingURL=RightContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/RightContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"RightContent.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/RightContent.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAK/B,OAAO,EAAE,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAEvD,eAAO,MAAM,mBAAmB,8CAsB/B,CAAC;AAEF,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAAE,CAAC,sBAAsB,CA8EzD,CAAC"}
|
|
@@ -1,13 +1,80 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import {LanguageMenu}from'../../LanguageMenu/LanguageMenu.js';import OrganizationDropDown from'./OrganizationDropdown.js';const
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useEffect,useRef}from'react';import {LanguageMenu}from'../../LanguageMenu/LanguageMenu.js';import OrganizationDropDown from'./OrganizationDropdown.js';const useHorizontalScroll = () => {
|
|
2
|
+
const elRef = useRef(null);
|
|
3
|
+
useEffect(() => {
|
|
4
|
+
const el = elRef.current;
|
|
5
|
+
if (el) {
|
|
6
|
+
const onWheel = e => {
|
|
7
|
+
if (e.deltaY === 0) return;
|
|
8
|
+
e.preventDefault();
|
|
9
|
+
el.scrollTo({
|
|
10
|
+
left: el.scrollLeft + e.deltaY,
|
|
11
|
+
behavior: 'smooth'
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
el.addEventListener('wheel', onWheel);
|
|
15
|
+
return () => {
|
|
16
|
+
el.removeEventListener('wheel', onWheel);
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
}, []);
|
|
20
|
+
return elRef;
|
|
21
|
+
};
|
|
22
|
+
const RightContent = props => {
|
|
2
23
|
const {
|
|
3
|
-
|
|
24
|
+
theme,
|
|
25
|
+
layout,
|
|
4
26
|
upperMenus,
|
|
5
|
-
|
|
6
|
-
collapsed
|
|
27
|
+
routeParams,
|
|
28
|
+
collapsed,
|
|
29
|
+
settings
|
|
7
30
|
} = props;
|
|
31
|
+
const [navBarItems, setNavBarItems] = useState([]);
|
|
32
|
+
const scrollRef = useHorizontalScroll();
|
|
33
|
+
// TODO: uncomment this once the extension API is updated
|
|
34
|
+
// const controller: any = useExtensionController();
|
|
35
|
+
// useEffect(() => {
|
|
36
|
+
// if (controller) {
|
|
37
|
+
// const subscription = controller.services.contribution.getContributions().subscribe(({ pageNavBar }) => {
|
|
38
|
+
// setNavBarItems(pageNavBar || []);
|
|
39
|
+
// });
|
|
40
|
+
// return () => subscription.unsubscribe();
|
|
41
|
+
// }
|
|
42
|
+
// }, [controller]);
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
const ele = document.getElementById('item-wrapper');
|
|
45
|
+
if (ele) {
|
|
46
|
+
if (check(ele)) {
|
|
47
|
+
ele.style.boxShadow = 'inset 0 0 5px #e2e2e2';
|
|
48
|
+
} else {
|
|
49
|
+
ele.style.boxShadow = 'none';
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const check = el => {
|
|
54
|
+
const curOverflow = el.style.overflow;
|
|
55
|
+
if (!curOverflow || curOverflow === 'visible') {
|
|
56
|
+
el.style.overflow = 'hidden';
|
|
57
|
+
}
|
|
58
|
+
const isOverflowing = el.clientWidth < el.scrollWidth || el.clientHeight < el.scrollHeight;
|
|
59
|
+
el.style.overflow = curOverflow;
|
|
60
|
+
return isOverflowing;
|
|
61
|
+
};
|
|
8
62
|
return jsxs("div", {
|
|
9
|
-
className:
|
|
63
|
+
className: `flex items-center ${collapsed ? 'ml-2.5' : 'ml-0'}`,
|
|
10
64
|
children: [jsx("div", {
|
|
65
|
+
id: "item-wrapper",
|
|
66
|
+
ref: scrollRef,
|
|
67
|
+
className: "flex overflow-x-auto scrollbar-hide whitespace-nowrap space-x-2 py-2 px-1",
|
|
68
|
+
children: navBarItems.map((item, index) => {
|
|
69
|
+
if (item.position === 'right' && item.component) {
|
|
70
|
+
return jsx("div", {
|
|
71
|
+
className: "flex-shrink-0",
|
|
72
|
+
children: item.component(props)
|
|
73
|
+
}, index);
|
|
74
|
+
}
|
|
75
|
+
return null;
|
|
76
|
+
})
|
|
77
|
+
}), jsx("div", {
|
|
11
78
|
className: "relative",
|
|
12
79
|
children: jsx(LanguageMenu, {})
|
|
13
80
|
}), jsx("div", {
|
|
@@ -20,4 +87,4 @@ import {jsxs,jsx}from'react/jsx-runtime';import {LanguageMenu}from'../../Languag
|
|
|
20
87
|
})
|
|
21
88
|
})]
|
|
22
89
|
});
|
|
23
|
-
};export{RightContent};//# sourceMappingURL=RightContent.js.map
|
|
90
|
+
};export{RightContent,useHorizontalScroll};//# sourceMappingURL=RightContent.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightContent.js","sources":["../../../../src/components/Layout/GlobalHeader/RightContent.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"RightContent.js","sources":["../../../../src/components/Layout/GlobalHeader/RightContent.tsx"],"sourcesContent":[null],"names":["_jsxs"],"mappings":"iNAOO,MAAM,mBAAmB,GAAG,MAAK;AACpC,EAAA,MAAA,QAAW,MAAG,CAAA,IAAuB,CAAA;WAErC,CAAA,MAAa;AACT,IAAA,MAAA,EAAA,GAAM,KAAK,CAAA;QACX,EAAA,EAAI;AACA,MAAA,MAAA,OAAM,GAAA,CAAA,IAAO;AACT,QAAA,IAAA,CAAA,CAAA,MAAI,KAAE,CAAA,EAAM;wBAAQ,EAAA;mBAClB,CAAA;gBACF,EAAE,CAAC,UAAS,GAAA,CAAA,CAAA,MAAA;AACR,UAAA,QAAA,EAAA;AACA,SAAA,CAAA;AACH,MAAA,CAAA;AACL,MAAA,EAAA,CAAA,gBAAE,CAAA,OAAA,EAAA,OAAA,CAAA;AACF,MAAA,OAAA,MAAG;AACH,QAAA,EAAA,CAAA,mBAAY,CAAA,OAAA,EAAA,OAAA,CAAA;AACR,MAAA,CAAA;AACJ,IAAA;QACJ;SACC,KAAE;AAEP;AACF,MAAA,YAAA,GAAA,KAAA,IAAA;AAEF,EAAA,MAAO;AACH,IAAA,KAAA;IACA,MAAM;AACN,IAAA,UAAM;IAEN,WAAA;IAEA,SAAA;IAEA;MACA,KAAA;QACA,CAAA,WAAA,EAAA,cAAA,CAAA,GAAA,QAAA,CAAA,EAAA,CAAA;QACA,SAAA,GAAA,mBAAA,EAAA;;;;;;;;AASQ;AACI;;kBACI;AACJ,IAAA,MAAA,GAAA,GAAA,QAAI,CAAK,6BAAoB,CAAA;aAChC;UACJ,KAAA,CAAA,GAAA,CAAA,EAAA;AACL,QAAG,GAAA,CAAA,KAAA,CAAA,SAAA,GAAA,uBAAA;AAEH,MAAA,CAAA,MAAM;AACF,QAAA,GAAA,CAAA,eAAiB,GAAK,MAAM;AAC5B,MAAA;AACI,IAAA;;AAEJ,EAAA,MAAA,KAAA;AACA,IAAA,MAAE,WAAO,GAAA,EAAQ,CAAA,cAAe;AAChC,IAAA,IAAA,CAAA,0BAAqB,KAAA,SAAA,EAAA;AACzB,MAAE,EAAA,CAAA,KAAA,CAAA,QAAA,GAAA,QAAA;IAEF;IACA,MAAI,aAAU,GAAM,EAAI,YAAW,GAAA,GAAO,WAAC,IAAA,EAAA,CAAA,YAAA,GAAA,EAAA,CAAA,YAAA;YACvC,CAAA,QAAA,GAAc;IAClB,OAAC,aAAA;AAED,EAAA,CAAA;AAgBY,EAAA,OAAAA,IAAA,CAAA,KAAE,EACA;AAiBlB,IAAE,SAAA,EAAA,CAAA,kBAAA,EAAA,SAAA,GAAA,QAAA,GAAA,MAAA,CAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/RightMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAOrE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAgBhD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,
|
|
1
|
+
{"version":3,"file":"RightMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/RightMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAgD,MAAM,OAAO,CAAC;AAOrE,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAgBhD,eAAO,MAAM,SAAS,EAAE,KAAK,CAAC,EAAE,CAAC,eAAe,CAiR/C,CAAC"}
|
|
@@ -233,9 +233,7 @@ const RightMenu = ({
|
|
|
233
233
|
onMouseEnter: onOpen,
|
|
234
234
|
children: [jsx("button", {
|
|
235
235
|
className: `
|
|
236
|
-
inline-flex items-center justify-center
|
|
237
|
-
${scrolled ? 'text-muted-foreground bg-transparent hover:text-foreground' : 'text-white bg-muted hover:text-white'}
|
|
238
|
-
rounded-full h-12 w-12 min-w-[48px] outline-none transform transition-colors duration-200
|
|
236
|
+
inline-flex items-center justify-center bg-muted hover:bg-muted-foreground text-foreground rounded-full h-12 w-12 min-w-[48px] outline-none transform transition-colors duration-200
|
|
239
237
|
`,
|
|
240
238
|
"aria-expanded": "false",
|
|
241
239
|
onClick: toggleMenu,
|
|
@@ -245,7 +243,7 @@ const RightMenu = ({
|
|
|
245
243
|
alt: "User"
|
|
246
244
|
}) : null
|
|
247
245
|
}), isOpen && jsxs("div", {
|
|
248
|
-
className: "absolute right-0 mt-2 w-72 rounded-themed shadow-themed-lg py-1 themed-dropdown ring-1 ring-border focus:outline-none z-40",
|
|
246
|
+
className: "bg-background absolute right-0 mt-2 w-72 rounded-themed shadow-themed-lg py-1 themed-dropdown ring-1 ring-border focus:outline-none z-40",
|
|
249
247
|
role: "menu",
|
|
250
248
|
"aria-orientation": "vertical",
|
|
251
249
|
"aria-labelledby": "user-menu",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RightMenu.js","sources":["../../../../src/components/Layout/GlobalHeader/RightMenu.tsx"],"sourcesContent":[null],"names":["_jsx","React","_jsxs"],"mappings":"yTASA,MAAM,eAAe,GAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"RightMenu.js","sources":["../../../../src/components/Layout/GlobalHeader/RightMenu.tsx"],"sourcesContent":[null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A,MAAE;MAEF,GAAA;UACI;AACA,MAAA;AACA,KAAA,GAAA,IAAA;AACA,IAAA,OAAAC,aAAgB,EAAG;AACnB,MAAA,OAAA;AAEA,QAAA,iBAAgB,CAAA,GAAA,CAAM;iBAAM,CAAA,KAAW,CAAA,CAAA;AACvC,MAAA,CAAA;eAA6B,EAAA,6EAAiD;AAC9E,MAAA,IAAA,EAAI,UAAU;cAAc,EAAA,CAAAF,GAAA,CAAA;AAC5B,QAAA,SAAI,EAAA,MAAa;gBAAY,EAAA,sBAA0B;QAEvD,EAAA,CAAA,CAAA,IAAO,CAAA;;AAGH,EAAA,CAAA;AAQ4B;;;AAoBQ;;AAEJ;AAwBI,IAAA,MAAA,QAAA,GAAA,cAAA,CAAA,IAAA,CAAA,IAAA,CAAA;;;AAWxC,MAAA,MAAG;AACP,MAAE,IAAA;AAEF,MAAA;;AAMiB;AA2DrB,IAAE,IAAA,cAAA,CAAA,IAAA,CAAA,QAAA,CAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SearchBar.js","sources":["../../../../src/components/Layout/GlobalHeader/SearchBar.tsx"],"sourcesContent":[null],"names":[],"mappings":"uSAMA,MAAM;AAQN,EAAA;AACI,CAAA,GAAA,KAAA;
|
|
1
|
+
{"version":3,"file":"SearchBar.js","sources":["../../../../src/components/Layout/GlobalHeader/SearchBar.tsx"],"sourcesContent":[null],"names":[],"mappings":"uSAMA,MAAM;AAQN,EAAA;AACI,CAAA,GAAA,KAAA;AACM,MAAA,SAAW,GAAA,CAAA;AACjB,EAAA;aACO,GAAA,QAAQ;;AAEf,CAAA,KAAA;QAEA,QAAA,GAAA,WAAA,EAAA;AACA,E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,CAAA,MAAA;IAEP,MAAA,kBAAsB,GAAA,KAAA,IAAA;AACtB,MAAA,IAAM,SAAA,CAAA,OAAiB,IAAI,CAAA,SAAwB,CAAA,OAAA,CAAA,QAAA,CAAA,KAAA,CAAA,MAAA,CAAA,EAAA;AAC/C,QAAA,SAAI,CAAM,KAAI,CAAE;AACZ,MAAA;;YAEJ,CAAA,gBAAiB,CAAA,WAAA,EAAA,kBAAA,CAAA;AACrB,IAAA,OAAE,MAAA;MAEF,QACI,CAAA,mBAAU,CAAA,WAAW,EAAA,kBAAuB,CAAA;AA2BZ,IAAA,CAAA;AACA,EAAA,CAAA,EAAA,EAAA,CAAA;AAwBxC;AAEA,EAAA,MAAA,iBAAyB,GAAA,MAAA,IAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/GlobalHeader/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import type { LinksFunction } from '@remix-run/node';
|
|
3
1
|
import { BasicLayoutProps } from '@admin-layout/client';
|
|
2
|
+
import type { LinksFunction } from '@remix-run/node';
|
|
3
|
+
import * as React from 'react';
|
|
4
4
|
declare const ProTailwindLayout: React.FC<BasicLayoutProps & {
|
|
5
5
|
loaderData?: any;
|
|
6
6
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProTailwindLayout.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/ProTailwindLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"ProTailwindLayout.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/ProTailwindLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAEH,gBAAgB,EAMnB,MAAM,sBAAsB,CAAC;AAO9B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAErD,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AA2E/B,QAAA,MAAM,iBAAiB,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,GAAG;IAAE,UAAU,CAAC,EAAE,GAAG,CAAA;CAAE,CAyBxE,CAAC;AACF,eAAe,iBAAiB,CAAC;AAEjC,eAAO,MAAM,MAAM;;CAElB,CAAC;AACF,eAAO,MAAM,KAAK,EAAE,aAA+D,CAAC;AAEpF,eAAO,MAAM,MAAM,GAAU,WAAM;;;EA0BlC,CAAC;AAEF,wBAAsB,YAAY,CAAC,EAAE,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE;;;;CAAA,gBAkBnE;AAED,eAAO,MAAM,gBAAgB,GAAI;;;CAA6B,YAE7D,CAAC"}
|
|
@@ -1,17 +1,73 @@
|
|
|
1
1
|
import { jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useSelector } from 'react-redux';
|
|
3
2
|
import { filterRoutesWithLocale, transformData, addProLayoutParentKeys, removeUnnecessaryProperties, menuDataRender } from '@admin-layout/client';
|
|
4
3
|
import { matchParentRoute } from '@admin-layout/client/lib/utils/parentRoute.js';
|
|
5
|
-
import { ClientContainerService } from 'common';
|
|
6
4
|
import { ClientTypes } from '@common-stack/client-core';
|
|
5
|
+
import { getAvailableCategories, getMenusByAdvancedFilter } from '@common-stack/client-react/lib/utils/filteredRoutes.js';
|
|
6
|
+
import { ClientContainerService } from 'common';
|
|
7
|
+
import * as React from 'react';
|
|
8
|
+
import { useSelector } from 'react-redux';
|
|
7
9
|
import { createSelector } from 'reselect';
|
|
8
|
-
import BasicLayoutEnhanced from './TailwindLayout.js';
|
|
9
10
|
import { config } from '../../config/env-config.js';
|
|
11
|
+
import BasicLayoutEnhanced from './TailwindLayout.js';
|
|
10
12
|
import stylesheet from '../../styles/index.css?url';
|
|
11
13
|
const selectOrgName = state => state.platform.orgName;
|
|
12
|
-
const
|
|
13
|
-
|
|
14
|
+
const selectSettings = state => state.settings;
|
|
15
|
+
const selector = createSelector([selectOrgName, selectSettings], (orgName, settings) => ({
|
|
16
|
+
orgName,
|
|
17
|
+
settings
|
|
14
18
|
}));
|
|
19
|
+
/**
|
|
20
|
+
* Filter menu items based on user visibility settings using filteredRoutes utilities
|
|
21
|
+
*/
|
|
22
|
+
function filterMenuItemsByVisibility(menuData, settings) {
|
|
23
|
+
if (!menuData || !Array.isArray(menuData)) return [];
|
|
24
|
+
const hiddenMenuCategories = settings?.hiddenMenuCategories || [];
|
|
25
|
+
// Deduplicate hiddenMenuKeys using Set for consistent behavior
|
|
26
|
+
const hiddenMenuKeys = settings?.hiddenMenuKeys ? Array.from(new Set(settings.hiddenMenuKeys)) : [];
|
|
27
|
+
// Convert menu data to format expected by filteredRoutes utilities
|
|
28
|
+
const menuItemsWithCategories = menuData.map(item => ({
|
|
29
|
+
...item,
|
|
30
|
+
// Use position as category for filtering
|
|
31
|
+
category: item.position || 'default',
|
|
32
|
+
// Ensure key exists for filtering
|
|
33
|
+
key: item.key || item.path || ''
|
|
34
|
+
}));
|
|
35
|
+
// Step 1: Filter by categories using advanced filter
|
|
36
|
+
const availableCategories = getAvailableCategories(menuItemsWithCategories);
|
|
37
|
+
const visibleCategories = availableCategories.filter(category => !hiddenMenuCategories.includes(category.toLowerCase()));
|
|
38
|
+
let filteredByCategory = menuItemsWithCategories;
|
|
39
|
+
if (visibleCategories.length !== availableCategories.length) {
|
|
40
|
+
// Use advanced filter to get menus by visible categories
|
|
41
|
+
const filters = {
|
|
42
|
+
categories: visibleCategories.length > 0 ? visibleCategories : ['__no_matches__'] // Empty array would show all
|
|
43
|
+
};
|
|
44
|
+
const filteredMenuMaps = getMenusByAdvancedFilter(menuItemsWithCategories, filters);
|
|
45
|
+
// Convert back to array format
|
|
46
|
+
filteredByCategory = filteredMenuMaps.map(menuMap => {
|
|
47
|
+
const path = Object.keys(menuMap)[0];
|
|
48
|
+
return {
|
|
49
|
+
...menuMap[path],
|
|
50
|
+
path
|
|
51
|
+
};
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
// Step 2: Filter out individually hidden items recursively
|
|
55
|
+
const filterItemsRecursively = items => {
|
|
56
|
+
return items.filter(item => {
|
|
57
|
+
if (!item?.key) return false;
|
|
58
|
+
// Skip if this specific item is hidden
|
|
59
|
+
if (hiddenMenuKeys.includes(item.key)) {
|
|
60
|
+
return false;
|
|
61
|
+
}
|
|
62
|
+
// Process children recursively
|
|
63
|
+
if (item.children && Array.isArray(item.children) && item.children.length > 0) {
|
|
64
|
+
item.children = filterItemsRecursively(item.children);
|
|
65
|
+
}
|
|
66
|
+
return true;
|
|
67
|
+
});
|
|
68
|
+
};
|
|
69
|
+
return filterItemsRecursively(filteredByCategory);
|
|
70
|
+
}
|
|
15
71
|
const ProTailwindLayout = props => {
|
|
16
72
|
const {
|
|
17
73
|
loaderData: {
|
|
@@ -20,15 +76,21 @@ const ProTailwindLayout = props => {
|
|
|
20
76
|
}
|
|
21
77
|
} = props;
|
|
22
78
|
const {
|
|
23
|
-
orgName
|
|
79
|
+
orgName,
|
|
80
|
+
settings
|
|
24
81
|
} = useSelector(state => selector(state));
|
|
82
|
+
// Apply menu visibility filters
|
|
83
|
+
const filteredMenuData = React.useMemo(() => {
|
|
84
|
+
return filterMenuItemsByVisibility(newMenuData, settings);
|
|
85
|
+
}, [newMenuData, settings?.hiddenMenuCategories, settings?.hiddenMenuKeys]);
|
|
25
86
|
const params = {
|
|
26
87
|
orgName: orgName
|
|
27
88
|
};
|
|
28
89
|
return jsx(BasicLayoutEnhanced, {
|
|
29
90
|
routeParams: params,
|
|
30
91
|
permissions: permissions,
|
|
31
|
-
menuData:
|
|
92
|
+
menuData: filteredMenuData,
|
|
93
|
+
fullMenuData: newMenuData
|
|
32
94
|
});
|
|
33
95
|
};
|
|
34
96
|
const handle = {
|