@admin-layout/tailwind-design-pro 12.0.16-alpha.9 → 12.0.16-alpha.90
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/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.d.ts.map +1 -1
- package/lib/components/LanguageMenu/LanguageMenu.js +16 -20
- package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
- package/lib/components/Layout/BasicLayout/index.d.ts +6 -5
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +220 -124
- 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/BottomMenuDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js +9 -14
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts +0 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.js +38 -10
- 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/MainSidebar.js +246 -0
- package/lib/components/Layout/Sidebar/MainSidebar.js.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts +6 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js +467 -0
- package/lib/components/Layout/Sidebar/MainSidebarMenu.js.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts +4 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/PerplexSidebar.js +279 -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 +332 -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 +29 -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/HeaderNotice.js +7 -0
- package/lib/components/Layout/slot-fill/HeaderNotice.js.map +1 -0
- 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/SettingDrawer.d.ts +2 -3
- package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.js +166 -416
- package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts +7 -0
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js +30 -0
- package/lib/components/SettingDrawer/components/ApplyToAllRoutesToggle.js.map +1 -0
- package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts +3 -0
- package/lib/components/SettingDrawer/components/CheckBoxTheme.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{CheckBoxTheme.js → components/CheckBoxTheme.js} +14 -5
- package/lib/components/SettingDrawer/components/CheckBoxTheme.js.map +1 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.d.ts +7 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.js +82 -0
- package/lib/components/SettingDrawer/components/DeviceTabs.js.map +1 -0
- package/lib/components/SettingDrawer/components/InvitationSettings.d.ts +3 -0
- package/lib/components/SettingDrawer/components/InvitationSettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{InvitationSettings.js → components/InvitationSettings.js} +11 -7
- package/lib/components/SettingDrawer/components/InvitationSettings.js.map +1 -0
- package/lib/components/SettingDrawer/components/LayoutChange.d.ts +3 -0
- package/lib/components/SettingDrawer/components/LayoutChange.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{LayoutChange.js → components/LayoutChange.js} +24 -17
- package/lib/components/SettingDrawer/components/LayoutChange.js.map +1 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts +20 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js +119 -0
- package/lib/components/SettingDrawer/components/MenuVisibilitySettings.js.map +1 -0
- package/lib/components/SettingDrawer/components/NavigationsModes.d.ts +3 -0
- package/lib/components/SettingDrawer/components/NavigationsModes.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{NavigationsModes.js → components/NavigationsModes.js} +91 -40
- package/lib/components/SettingDrawer/components/NavigationsModes.js.map +1 -0
- package/lib/components/SettingDrawer/components/RegionalSettings.d.ts +3 -0
- package/lib/components/SettingDrawer/components/RegionalSettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{RegionalSettings.js → components/RegionalSettings.js} +55 -178
- package/lib/components/SettingDrawer/components/RegionalSettings.js.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsActions.d.ts +12 -0
- package/lib/components/SettingDrawer/components/SettingsActions.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsActions.js +69 -0
- package/lib/components/SettingDrawer/components/SettingsActions.js.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts +4 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js +25 -0
- package/lib/components/SettingDrawer/components/SettingsDrawerHeader.js.map +1 -0
- package/lib/components/SettingDrawer/{Switch/index.d.ts → components/Switch.d.ts} +2 -2
- package/lib/components/SettingDrawer/components/Switch.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{Switch/index.js → components/Switch.js} +1 -1
- package/lib/components/SettingDrawer/components/Switch.js.map +1 -0
- package/lib/components/SettingDrawer/components/ThemeColor.d.ts +3 -0
- package/lib/components/SettingDrawer/components/ThemeColor.d.ts.map +1 -0
- package/lib/components/SettingDrawer/{ThemeColor.js → components/ThemeColor.js} +16 -4
- package/lib/components/SettingDrawer/components/ThemeColor.js.map +1 -0
- package/lib/components/SettingDrawer/{ThemeSelector.d.ts → components/ThemeSelector.d.ts} +1 -1
- package/lib/components/SettingDrawer/components/ThemeSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/ThemeSelector.js.map +1 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts +3 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/components/WebFontsSelector.js.map +1 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts +18 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.d.ts.map +1 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.js +119 -0
- package/lib/components/SettingDrawer/hooks/useSettingsOperations.js.map +1 -0
- package/lib/components/SettingDrawer/utils/constants.d.ts +11 -0
- package/lib/components/SettingDrawer/utils/constants.d.ts.map +1 -0
- package/lib/components/SettingDrawer/utils/constants.js +77 -0
- package/lib/components/SettingDrawer/utils/constants.js.map +1 -0
- package/lib/components/SettingDrawer/utils/helper.d.ts +37 -0
- package/lib/components/SettingDrawer/utils/helper.d.ts.map +1 -0
- package/lib/components/SettingDrawer/utils/helper.js +243 -0
- package/lib/components/SettingDrawer/utils/helper.js.map +1 -0
- package/lib/components/SettingDrawer/utils/transformers.d.ts +15 -0
- package/lib/components/SettingDrawer/utils/transformers.d.ts.map +1 -0
- package/lib/components/SettingDrawer/utils/transformers.js +76 -0
- package/lib/components/SettingDrawer/utils/transformers.js.map +1 -0
- package/lib/components/SettingDrawer/{types.d.ts → utils/types.d.ts} +14 -0
- package/lib/components/SettingDrawer/utils/types.d.ts.map +1 -0
- 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 +139 -168
- 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 +107 -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 +0 -180
- 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
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts +0 -3
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +0 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.js.map +0 -1
- package/lib/components/SettingDrawer/InvitationSettings.d.ts +0 -3
- package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +0 -1
- package/lib/components/SettingDrawer/InvitationSettings.js.map +0 -1
- package/lib/components/SettingDrawer/LayoutChange.d.ts +0 -3
- package/lib/components/SettingDrawer/LayoutChange.d.ts.map +0 -1
- package/lib/components/SettingDrawer/LayoutChange.js.map +0 -1
- package/lib/components/SettingDrawer/NavigationsModes.d.ts +0 -3
- package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +0 -1
- package/lib/components/SettingDrawer/NavigationsModes.js.map +0 -1
- package/lib/components/SettingDrawer/RegionalSettings.d.ts +0 -3
- package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +0 -1
- package/lib/components/SettingDrawer/RegionalSettings.js.map +0 -1
- package/lib/components/SettingDrawer/Switch/index.d.ts.map +0 -1
- package/lib/components/SettingDrawer/Switch/index.js.map +0 -1
- package/lib/components/SettingDrawer/ThemeColor.d.ts +0 -3
- package/lib/components/SettingDrawer/ThemeColor.d.ts.map +0 -1
- package/lib/components/SettingDrawer/ThemeColor.js.map +0 -1
- package/lib/components/SettingDrawer/ThemeSelector.d.ts.map +0 -1
- package/lib/components/SettingDrawer/ThemeSelector.js.map +0 -1
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts +0 -3
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts.map +0 -1
- package/lib/components/SettingDrawer/WebFontsSelector.js.map +0 -1
- package/lib/components/SettingDrawer/types.d.ts.map +0 -1
- /package/lib/components/SettingDrawer/{ThemeSelector.js → components/ThemeSelector.js} +0 -0
- /package/lib/components/SettingDrawer/{WebFontsSelector.js → components/WebFontsSelector.js} +0 -0
|
@@ -110,6 +110,7 @@
|
|
|
110
110
|
"dict": "Diccionario",
|
|
111
111
|
"config": "Configuración",
|
|
112
112
|
"system_log": "Registro del Sistema",
|
|
113
|
-
"login_info": "Información de Inicio de Sesión"
|
|
113
|
+
"login_info": "Información de Inicio de Sesión",
|
|
114
|
+
"tenant_management": "Gestión de Inquilinos"
|
|
114
115
|
}
|
|
115
116
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cdm-locales/index.ts"],"names":[],"mappings":"AAAA,cAAc,uCAAuC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from '@admin-layout/client/src/graphql/link';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageMenu.d.ts","sourceRoot":"","sources":["../../../src/components/LanguageMenu/LanguageMenu.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,+
|
|
1
|
+
{"version":3,"file":"LanguageMenu.d.ts","sourceRoot":"","sources":["../../../src/components/LanguageMenu/LanguageMenu.tsx"],"names":[],"mappings":"AAQA,eAAO,MAAM,YAAY,+CAiFxB,CAAC"}
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {useTranslation}from'react-i18next';import {useMediaQuery}from'react-responsive';import {
|
|
2
|
-
const isMobile = useMediaQuery({
|
|
3
|
-
maxWidth: 767
|
|
4
|
-
});
|
|
5
|
-
const [locale, setLocale] = useState('en');
|
|
6
|
-
const dispatch = useAppDispatch();
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'react';import {useTranslation}from'react-i18next';import {useMediaQuery}from'react-responsive';import {languages,useLayoutSettings}from'@admin-layout/client';import {Globe}from'lucide-react';import config from'@app/cde-webconfig.json';const LanguageMenu = () => {
|
|
7
2
|
const {
|
|
8
3
|
i18n
|
|
9
4
|
} = useTranslation();
|
|
10
5
|
const {
|
|
11
6
|
i18n: i18nextInstance
|
|
12
7
|
} = config;
|
|
13
|
-
const
|
|
8
|
+
const filteredLanguages = languages.filter(language => i18nextInstance.supportedLngs.includes(language.key));
|
|
9
|
+
const isMobile = useMediaQuery({
|
|
10
|
+
maxWidth: 767
|
|
11
|
+
});
|
|
12
|
+
const {
|
|
13
|
+
settings,
|
|
14
|
+
setSettings
|
|
15
|
+
} = useLayoutSettings();
|
|
16
|
+
const [currentLang, setCurrentLang] = useState(filteredLanguages.find(language => language.key === settings.language) || {
|
|
14
17
|
key: 'en',
|
|
15
18
|
label: 'English',
|
|
16
19
|
flag: '🇬🇧',
|
|
@@ -18,13 +21,9 @@ import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'
|
|
|
18
21
|
});
|
|
19
22
|
const [isOpen, setIsOpen] = useState(false);
|
|
20
23
|
const dropdownRef = useRef(null);
|
|
21
|
-
const filteredLanguages = languages.filter(language => i18nextInstance.supportedLngs.includes(language.key));
|
|
22
24
|
useEffect(() => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
payload: locale
|
|
26
|
-
});
|
|
27
|
-
}, [locale, dispatch]);
|
|
25
|
+
i18n.changeLanguage(settings.language);
|
|
26
|
+
}, []);
|
|
28
27
|
useEffect(() => {
|
|
29
28
|
const handleClickOutside = event => {
|
|
30
29
|
if (dropdownRef.current && !dropdownRef.current.contains(event.target)) {
|
|
@@ -37,15 +36,12 @@ import {jsxs,jsx}from'react/jsx-runtime';import {useState,useRef,useEffect}from'
|
|
|
37
36
|
};
|
|
38
37
|
}, []);
|
|
39
38
|
const handleLanguageChange = language => {
|
|
40
|
-
setCurrentLang(
|
|
41
|
-
key: language.key,
|
|
42
|
-
label: language.label,
|
|
43
|
-
flag: language.flag,
|
|
44
|
-
global: language.global
|
|
45
|
-
});
|
|
39
|
+
setCurrentLang(language);
|
|
46
40
|
i18n.changeLanguage(language.key);
|
|
47
|
-
setLocale(language.key);
|
|
48
41
|
setIsOpen(false);
|
|
42
|
+
setSettings(settings, {
|
|
43
|
+
language: language.key
|
|
44
|
+
});
|
|
49
45
|
};
|
|
50
46
|
const toggleDropdown = () => {
|
|
51
47
|
setIsOpen(!isOpen);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LanguageMenu.js","sources":["../../../src/components/LanguageMenu/LanguageMenu.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LanguageMenu.js","sources":["../../../src/components/LanguageMenu/LanguageMenu.tsx"],"sourcesContent":[null],"names":[],"mappings":"2TAQO,MAAM,YAAY,GAAG,MAAK;AAC7B,EAAA,MAAA;AACA,IAAA;MACA,cAAM,EAAA;QACN;IACA,IAAA,EAAM;MACN,MAAO;AAEC,EAAA,MAAA,iBAAS,GAAA,SAAA,CAAA,MAAA,CAAA,QAAA,IAAA,eAAA,CAAA,aAAA,CAAA,QAAA,CAAA,QAAA,CAAA,GAAA,CAAA,CAAA;AACT,EAAA,MAAA,QAAO,GAAA,aAAS,CAAA;AAChB,IAAA,QAAI,EAAE;AACN,GAAA,CAAA;AACH,EAAA,MACH;IACF,QAAO;AACP,IAAA;MAEA,iBAAe,EAAA;AACX,EAAA,MAAA,CAAA,WAAK,EAAA,cAAuB,CAAC,GAAA,QAAU,CAAA,iBAAA,CAAA,IAAA,CAAA,QAAA,IAAA,QAAA,CAAA,GAAA,KAAA,QAAA,CAAA,QAAA,CAAA,IAAA;IAC3C,GAAG,EAAE,IAAE;IAEP,KAAA,EAAA,SAAe;AACX,IAAA,IAAA,EAAA,MAAM;AACF,IAAA,MAAA,EAAA;;eAEC,EAAA,SAAA,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;AACL,EAAA,MAAA,WAAE,GAAA,MAAA,CAAA,IAAA,CAAA;AAEF,EAAA,SAAA,CAAA,MAAS;AACT,IAAA,IAAA,CAAA,cAAY,CAAA,QAAA,CAAA,QAAA,CAAA;AACR,EAAA,CAAA,EAAA,EAAA,CAAA;AACJ,EAAA,SAAE,CAAA,MAAA;IACN,MAAM,kBAAC,GAAA,KAAA,IAAA;AAEP,MAAA,IAAM,WAAA,CAAA,OAAA,IAAuB,CAAC,WAAU,CAAE,OAAA,CAAA,QAAA,CAAA,KAAA,CAAA,MAAA,CAAA,EAAA;QACtC,SAAA,CAAA,KAAe,CAAA;AACf,MAAA;;YAEA,CAAA,gBAAoB,CAAE,WAAU,EAAE,kBAAgB,CAAA;AACtD,IAAA,OAAE,MAAA;MAEF,QAAM,CAAA,mBAAsB,CAAA,WAAA,EAAA,kBAAA,CAAA;AACxB,IAAA,CAAA;AACJ,EAAA,CAAA,EAAC,EAAC,CAAA;AAEF,EAAA,MAAA,oBACS,GAAA,QAAU,IAAA;AAmCvB,IAAE,cAAA,CAAA,QAAA,CAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
1
|
import { BasicLayoutProps, GlobalHeaderProps } from '@admin-layout/client';
|
|
3
|
-
|
|
2
|
+
import React from 'react';
|
|
3
|
+
export declare function useHorizontalScroll({ setScrolled, setSearchOptionsShown, onScrollReachEnd }: {
|
|
4
4
|
setScrolled: any;
|
|
5
5
|
setSearchOptionsShown: any;
|
|
6
6
|
onScrollReachEnd: any;
|
|
7
|
-
})
|
|
8
|
-
export declare
|
|
7
|
+
}): React.MutableRefObject<undefined>;
|
|
8
|
+
export declare function BasicLayout(props: BasicLayoutProps & GlobalHeaderProps & {
|
|
9
9
|
routeParams?: any;
|
|
10
10
|
children?: React.ReactNode;
|
|
11
|
-
|
|
11
|
+
routePattern?: string;
|
|
12
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/BasicLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/BasicLayout/index.tsx"],"names":[],"mappings":"AAAA,OAAO,EACH,gBAAgB,EAIhB,iBAAiB,EAEpB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,KAA4D,MAAM,OAAO,CAAC;AAcjF,wBAAgB,mBAAmB,CAAC,EAAE,WAAW,EAAE,qBAAqB,EAAE,gBAAgB,EAAE;;;;CAAA,qCA+B3F;AAwCD,wBAAgB,WAAW,CACvB,KAAK,EAAE,gBAAgB,GACnB,iBAAiB,GAAG;IAAE,WAAW,CAAC,EAAE,GAAG,CAAC;IAAC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAAC,YAAY,CAAC,EAAE,MAAM,CAAA;CAAE,2CAkXnG"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import {
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {getThemeColors,getMenuSeparation,useComponentSize}from'@admin-layout/client';import {Outlet}from'@remix-run/react';import {omit}from'lodash-es';import {useRef,useState,useMemo,useEffect,useCallback}from'react';import warning from'warning';import {config}from'../../../config/env-config.js';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../../hooks/useMediaQuery.js';import {useScrollThreshold}from'../../../hooks/useScrollThreshold.js';import {SettingDrawer}from'../../SettingDrawer/SettingDrawer.js';import {getPageTitleInfo}from'../getPageTitle.js';import {MainHeader}from'../GlobalHeader/MainHeader.js';import'@remix-run/router';import'../../../helpers/DynamicIcon.js';import'@app/dialog/WrappedDialogsSwitch';import {GlobalHeader}from'../GlobalHeader/Header.js';import {MainSidebar}from'../Sidebar/MainSidebar.js';import {PerplexSidebar}from'../Sidebar/PerplexSidebar.js';import'@common-stack/components-pro';import {FooterSlot}from'../slot-fill/Footer.js';import'reflect-metadata';import'@admin-layout/client/lib/constants/layout.js';//helper func
|
|
2
|
+
function useHorizontalScroll({
|
|
2
3
|
setScrolled,
|
|
3
4
|
setSearchOptionsShown,
|
|
4
5
|
onScrollReachEnd
|
|
5
|
-
})
|
|
6
|
+
}) {
|
|
6
7
|
const elRef = useRef();
|
|
7
8
|
useEffect(() => {
|
|
8
9
|
const el = elRef.current || null;
|
|
@@ -10,9 +11,6 @@ import {jsxs,jsx}from'react/jsx-runtime';import {useState,useEffect,useRef}from'
|
|
|
10
11
|
const onWheel = e => {
|
|
11
12
|
if (e.deltaY == 0) return;
|
|
12
13
|
e.preventDefault();
|
|
13
|
-
// if (!isMobileView) {
|
|
14
|
-
// setSearchOptionsShown(false);
|
|
15
|
-
// }
|
|
16
14
|
if (window.scrollY > 50) {
|
|
17
15
|
setScrolled(true);
|
|
18
16
|
}
|
|
@@ -30,8 +28,8 @@ import {jsxs,jsx}from'react/jsx-runtime';import {useState,useEffect,useRef}from'
|
|
|
30
28
|
}
|
|
31
29
|
}, []);
|
|
32
30
|
return elRef;
|
|
33
|
-
}
|
|
34
|
-
|
|
31
|
+
}
|
|
32
|
+
function defaultPageTitleRender(pageProps, props) {
|
|
35
33
|
const {
|
|
36
34
|
pageTitleRender
|
|
37
35
|
} = props;
|
|
@@ -54,111 +52,165 @@ const defaultPageTitleRender = (pageProps, props) => {
|
|
|
54
52
|
warning(typeof title === 'string', 'pro-layout: renderPageTitle return value should be a string');
|
|
55
53
|
}
|
|
56
54
|
return pageTitleInfo;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
55
|
+
}
|
|
56
|
+
function getUILayoutValueFromSettings(settingsObj, routeForBracket, device, path) {
|
|
57
|
+
const routeDeviceKey = `[${routeForBracket}][${device}]`;
|
|
58
|
+
const uiOverride = settingsObj?.uiSettings?.[routeDeviceKey];
|
|
59
|
+
if (uiOverride) {
|
|
60
|
+
const value = path.split('.').reduce((obj, key) => obj?.[key], uiOverride);
|
|
61
|
+
if (value !== undefined) return value;
|
|
62
|
+
}
|
|
63
|
+
return path.split('.').reduce((obj, key) => obj?.[key], settingsObj);
|
|
64
|
+
}
|
|
65
|
+
function BasicLayout(props) {
|
|
66
|
+
// Destructure props
|
|
65
67
|
const {
|
|
68
|
+
children,
|
|
69
|
+
onCollapse: propsOnCollapse,
|
|
70
|
+
defaultCollapsed,
|
|
66
71
|
menuData,
|
|
72
|
+
fullMenuData,
|
|
73
|
+
siderWidth = 208,
|
|
74
|
+
menu,
|
|
75
|
+
menuDataRender,
|
|
76
|
+
loading,
|
|
67
77
|
location,
|
|
68
78
|
routeParams,
|
|
69
79
|
settings,
|
|
70
80
|
authorities,
|
|
71
81
|
primaryColor,
|
|
72
|
-
onSettingChange,
|
|
73
82
|
mainHeaderProps,
|
|
74
|
-
actor
|
|
75
|
-
|
|
83
|
+
actor,
|
|
84
|
+
routePattern
|
|
85
|
+
} = props;
|
|
86
|
+
// Refs
|
|
87
|
+
useRef(settings);
|
|
88
|
+
// Hooks
|
|
89
|
+
const {
|
|
90
|
+
isMobile
|
|
91
|
+
} = useMediaQuery();
|
|
92
|
+
// State
|
|
93
|
+
const [scrolled, setScrolled] = useState(false);
|
|
94
|
+
const [collapsed, setCollapsed] = useState(false);
|
|
95
|
+
const [siderPinned, setSiderPinned] = useState(false);
|
|
76
96
|
const [isSideMenuOpen, setIsSideMenuOpen] = useState(false);
|
|
77
97
|
const [scrollEnd, setScrollEnd] = useState(false);
|
|
78
98
|
const [searchOptionsShown, setSearchOptionsShown] = useState(false);
|
|
99
|
+
const [footerFixed, setFooterFixed] = useState(false);
|
|
100
|
+
// Computed values
|
|
101
|
+
const currentRoute = location?.pathname || '/';
|
|
102
|
+
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
103
|
+
const routeForBracket = routePattern || currentRoute;
|
|
79
104
|
const {
|
|
80
105
|
picture
|
|
81
106
|
} = mainHeaderProps;
|
|
82
107
|
const {
|
|
83
108
|
LAYOUT_ROOT
|
|
84
109
|
} = config;
|
|
85
|
-
const {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
110
|
+
const deviceSettings = useMemo(() => ({
|
|
111
|
+
header: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'header'),
|
|
112
|
+
background: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'background'),
|
|
113
|
+
footer: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'footer')
|
|
114
|
+
}), [settings, routeForBracket, deviceType]);
|
|
115
|
+
const layoutSettings = useMemo(() => ({
|
|
116
|
+
contentWidth: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'contentWidth'),
|
|
117
|
+
navigationMode: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'navigationMode'),
|
|
118
|
+
sideMenuType: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'sideMenuType'),
|
|
119
|
+
fixedHeader: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'fixedHeader'),
|
|
120
|
+
fixedSidebar: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'fixedSidebar'),
|
|
121
|
+
splitMenus: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'splitMenus'),
|
|
122
|
+
upperMenuDividerName: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'upperMenuDividerName'),
|
|
123
|
+
middleMenuDividerName: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'middleMenuDividerName'),
|
|
124
|
+
lowerMenuDividerName: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'lowerMenuDividerName'),
|
|
125
|
+
menuHeaderRender: getUILayoutValueFromSettings(settings, routeForBracket, deviceType, 'menuHeaderRender')
|
|
126
|
+
}), [settings, routeForBracket, deviceType]);
|
|
127
|
+
const backgroundSettings = useMemo(() => {
|
|
128
|
+
return deviceSettings?.background || {
|
|
129
|
+
type: 'color',
|
|
130
|
+
color: 'inherit',
|
|
131
|
+
image: '',
|
|
132
|
+
video: ''
|
|
133
|
+
};
|
|
134
|
+
}, [deviceSettings]);
|
|
135
|
+
const themeColors = useMemo(() => getThemeColors(settings?.theme), [settings?.theme]);
|
|
136
|
+
const backgroundClasses = useMemo(() => {
|
|
137
|
+
let classes = 'flex flex-col h-screen bg-background font-sans relative';
|
|
138
|
+
if (backgroundSettings.type === 'image' && backgroundSettings.image) {
|
|
139
|
+
classes += ' bg-cover bg-center bg-fixed';
|
|
140
|
+
}
|
|
141
|
+
return classes;
|
|
142
|
+
}, [backgroundSettings]);
|
|
143
|
+
const backgroundStyle = useMemo(() => {
|
|
144
|
+
if (backgroundSettings.type === 'image' && backgroundSettings.image) {
|
|
145
|
+
return {
|
|
146
|
+
backgroundImage: `url(${backgroundSettings.image})`
|
|
147
|
+
};
|
|
148
|
+
}
|
|
149
|
+
if (backgroundSettings.type === 'color' && backgroundSettings.color !== 'inherit') {
|
|
150
|
+
return {
|
|
151
|
+
backgroundColor: backgroundSettings.color
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
return {};
|
|
155
|
+
}, [backgroundSettings]);
|
|
156
|
+
const headerUpperMenus = useMemo(() => getMenuSeparation(menuData).upperMenus, [menuData]);
|
|
157
|
+
const footerActive = useMemo(() => getOverrideValue('footer.showFooter'), [deviceSettings]);
|
|
158
|
+
const memoizedMenuData = useMemo(() => menuData, [menuData]);
|
|
159
|
+
const memoizedRouteParams = useMemo(() => routeParams, [routeParams]);
|
|
160
|
+
// Derived layout flags
|
|
161
|
+
const isSidebarLayout = layoutSettings?.navigationMode !== 'topbar';
|
|
162
|
+
layoutSettings?.navigationMode === 'topbar';
|
|
163
|
+
const isSideMenuLayout = layoutSettings?.navigationMode === 'sidebar';
|
|
164
|
+
layoutSettings?.navigationMode === 'mixed';
|
|
165
|
+
const showMenu = deviceSettings?.header?.showMenu;
|
|
166
|
+
const showHeader = deviceSettings?.header?.showHeader;
|
|
167
|
+
const menuHeaderRender = deviceSettings?.header?.menuHeaderRender;
|
|
168
|
+
const hasFixedSidebar = layoutSettings?.fixedSidebar;
|
|
169
|
+
const isPerplexLayout = settings?.sideMenuType === 'perplexLayout';
|
|
170
|
+
const isAppShell = LAYOUT_ROOT != '/';
|
|
171
|
+
const shouldApplySidebarMargin = isSidebarLayout && showMenu && hasFixedSidebar && !isMobile;
|
|
172
|
+
const shouldShowSidebar = isSidebarLayout && showMenu;
|
|
173
|
+
const sideBarMarginTop = !isAppShell && showHeader ? '5rem' : undefined;
|
|
174
|
+
const computedMarginLeft = useMemo(() => {
|
|
175
|
+
return shouldApplySidebarMargin ? !isPerplexLayout ? collapsed ? '64px' : '256px' : !siderPinned ? '92px' : '316px' : '0px';
|
|
176
|
+
}, [shouldApplySidebarMargin, isPerplexLayout, collapsed, siderPinned]);
|
|
177
|
+
const defaultProps = omit({
|
|
178
|
+
...props
|
|
179
|
+
}, ['layout']);
|
|
180
|
+
const pageTitleInfo = defaultPageTitleRender({
|
|
181
|
+
pathname: location?.pathname,
|
|
182
|
+
...defaultProps
|
|
183
|
+
}, props);
|
|
184
|
+
const scrollThreshold = deviceSettings?.header?.scrollThreshold || 50;
|
|
185
|
+
// Effects
|
|
89
186
|
useEffect(() => {
|
|
90
187
|
if (searchOptionsShown && isMobile) {
|
|
91
|
-
// Save the current scroll position
|
|
92
188
|
const scrollY = window.scrollY;
|
|
93
|
-
// Add the no-scroll class to the body
|
|
94
189
|
document.body.style.position = 'fixed';
|
|
95
190
|
document.body.style.top = `-${scrollY}px`;
|
|
96
191
|
document.body.style.width = '100%';
|
|
97
192
|
document.body.style.overflow = 'hidden';
|
|
98
193
|
return () => {
|
|
99
|
-
// Remove the no-scroll class when component unmounts or modal closes
|
|
100
194
|
document.body.style.position = '';
|
|
101
195
|
document.body.style.top = '';
|
|
102
196
|
document.body.style.width = '';
|
|
103
197
|
document.body.style.overflow = '';
|
|
104
|
-
// Restore scroll position
|
|
105
198
|
window.scrollTo(0, scrollY);
|
|
106
199
|
};
|
|
107
200
|
}
|
|
108
201
|
}, [searchOptionsShown, isMobile]);
|
|
109
|
-
|
|
110
|
-
const currentRoute = location?.pathname || '/';
|
|
111
|
-
const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
|
|
112
|
-
// Get device-specific settings
|
|
113
|
-
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
114
|
-
const deviceSettings = routeSettings?.regions?.[deviceType] || {};
|
|
115
|
-
const layoutSettings = routeSettings?.layout?.[deviceType] || {};
|
|
116
|
-
const backgroundSettings = deviceSettings?.background || {
|
|
117
|
-
type: 'color',
|
|
118
|
-
color: 'inherit',
|
|
119
|
-
image: ''};
|
|
120
|
-
const onScrollReachEnd = () => {
|
|
121
|
-
setScrollEnd(prevScrollEnd => !prevScrollEnd);
|
|
122
|
-
};
|
|
123
|
-
const horizontalScrollRef = useHorizontalScroll({
|
|
124
|
-
setScrolled,
|
|
125
|
-
setSearchOptionsShown,
|
|
126
|
-
onScrollReachEnd
|
|
127
|
-
});
|
|
128
|
-
const defaultProps = omit({
|
|
129
|
-
...propsWithSettings
|
|
130
|
-
}, ['layout']);
|
|
131
|
-
const pageTitleInfo = defaultPageTitleRender({
|
|
132
|
-
pathname: location?.pathname,
|
|
133
|
-
...defaultProps
|
|
134
|
-
}, propsWithSettings);
|
|
135
|
-
const settingRef = useRef(settings);
|
|
136
|
-
const scrollThreshold = deviceSettings?.header?.scrollThreshold || 50;
|
|
137
|
-
const {
|
|
138
|
-
componentVisibility
|
|
139
|
-
} = useScrollThreshold([{
|
|
140
|
-
threshold: scrollThreshold,
|
|
141
|
-
id: 'search-bar',
|
|
142
|
-
useWindowScroll: true
|
|
143
|
-
}]);
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
if (settingRef.current?.primaryColor === '#3FA541C' && primaryColor !== '#3FA541C') {
|
|
146
|
-
const newState = {
|
|
147
|
-
...settingRef.current,
|
|
148
|
-
primaryColor
|
|
149
|
-
};
|
|
150
|
-
onSettingChange(newState);
|
|
151
|
-
}
|
|
152
|
-
}, [primaryColor, isBrowser, settingRef]);
|
|
153
|
-
// Update settings when route changes
|
|
154
|
-
useEffect(() => {
|
|
202
|
+
const sendRouteChange = useCallback(() => {
|
|
155
203
|
if (actor && location?.pathname) {
|
|
156
204
|
actor.send({
|
|
157
|
-
type: '
|
|
158
|
-
pathname: location?.pathname
|
|
205
|
+
type: 'UISETTING_ROUTE_CHANGE',
|
|
206
|
+
pathname: location?.pathname,
|
|
207
|
+
routePattern: props.routePattern
|
|
159
208
|
});
|
|
160
209
|
}
|
|
161
|
-
}, [location?.pathname,
|
|
210
|
+
}, [actor, location?.pathname, props.routePattern]);
|
|
211
|
+
useEffect(() => {
|
|
212
|
+
sendRouteChange();
|
|
213
|
+
}, [sendRouteChange]);
|
|
162
214
|
const {
|
|
163
215
|
ref: refHeader,
|
|
164
216
|
height: heightHeader
|
|
@@ -171,84 +223,128 @@ const BasicLayout = props => {
|
|
|
171
223
|
ref: refFooter,
|
|
172
224
|
height: heightFooter
|
|
173
225
|
} = useComponentSize();
|
|
174
|
-
const [footerFixed, setFooterFixed] = useState(false);
|
|
175
226
|
useEffect(() => {
|
|
176
227
|
if (heightHeader && heightBody && heightFooter) {
|
|
177
228
|
if (heightBody < window.innerHeight - heightHeader - heightFooter) setFooterFixed(true);else setFooterFixed(false);
|
|
178
229
|
}
|
|
179
230
|
}, [heightHeader, heightBody, heightFooter]);
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
231
|
+
const {
|
|
232
|
+
componentVisibility
|
|
233
|
+
} = useScrollThreshold([{
|
|
234
|
+
threshold: scrollThreshold,
|
|
235
|
+
id: 'search-bar',
|
|
236
|
+
useWindowScroll: true
|
|
237
|
+
}]);
|
|
238
|
+
const onScrollReachEnd = useCallback(() => {
|
|
239
|
+
setScrollEnd(prevScrollEnd => !prevScrollEnd);
|
|
240
|
+
}, []);
|
|
241
|
+
const horizontalScrollRef = useHorizontalScroll({
|
|
242
|
+
setScrolled,
|
|
243
|
+
setSearchOptionsShown,
|
|
244
|
+
onScrollReachEnd
|
|
245
|
+
});
|
|
246
|
+
// Helper functions
|
|
247
|
+
function getOverrideValue(path, deviceSettingsRef = deviceSettings) {
|
|
248
|
+
return path.split('.').reduce((obj, key) => obj?.[key], deviceSettingsRef);
|
|
249
|
+
}
|
|
250
|
+
const toggleSideMenu = useCallback(() => {
|
|
251
|
+
setIsSideMenuOpen(prev => !prev);
|
|
252
|
+
}, []);
|
|
253
|
+
const closeSideMenu = useCallback(() => {
|
|
184
254
|
setIsSideMenuOpen(false);
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
255
|
+
}, []);
|
|
256
|
+
const handleSettingChange = useCallback(newSettings => {
|
|
257
|
+
if (actor) {
|
|
258
|
+
actor.send({
|
|
259
|
+
type: 'UISETTING_UPDATE',
|
|
260
|
+
value: newSettings
|
|
261
|
+
});
|
|
191
262
|
}
|
|
192
|
-
|
|
193
|
-
};
|
|
263
|
+
}, [actor]);
|
|
194
264
|
return jsxs("div", {
|
|
195
|
-
className:
|
|
265
|
+
className: backgroundClasses,
|
|
196
266
|
ref: horizontalScrollRef,
|
|
197
|
-
style:
|
|
198
|
-
|
|
199
|
-
} : backgroundSettings.type === 'color' && backgroundSettings.color !== 'inherit' ? {
|
|
200
|
-
backgroundColor: backgroundSettings.color
|
|
201
|
-
} : {},
|
|
202
|
-
children: [deviceSettings?.header?.showHeader && LAYOUT_ROOT != '/' && jsx(GlobalHeader, {
|
|
267
|
+
style: backgroundStyle,
|
|
268
|
+
children: [deviceSettings?.header?.showHeader && !isSideMenuLayout && LAYOUT_ROOT != '/' && jsx(GlobalHeader, {
|
|
203
269
|
toggleSideMenu: toggleSideMenu,
|
|
204
270
|
settings: settings,
|
|
205
|
-
upperMenus:
|
|
206
|
-
routeParams:
|
|
271
|
+
upperMenus: headerUpperMenus,
|
|
272
|
+
routeParams: memoizedRouteParams,
|
|
207
273
|
collapsed: collapsed,
|
|
208
|
-
|
|
274
|
+
location: location
|
|
209
275
|
}), LAYOUT_ROOT === '/' && deviceSettings?.header?.showHeader && jsx(MainHeader, {
|
|
210
276
|
scrolled: scrolled,
|
|
211
277
|
location: location,
|
|
212
|
-
menuData:
|
|
278
|
+
menuData: memoizedMenuData,
|
|
213
279
|
settings: settings,
|
|
214
280
|
pageTitleInfo: pageTitleInfo,
|
|
215
|
-
onSettingChange: onSettingChange,
|
|
216
281
|
searchOptionsShown: searchOptionsShown,
|
|
217
282
|
setSearchOptionsShown: setSearchOptionsShown,
|
|
218
283
|
authorities: authorities,
|
|
219
284
|
picture: picture,
|
|
220
|
-
componentVisibility: componentVisibility
|
|
285
|
+
componentVisibility: componentVisibility,
|
|
286
|
+
showMenu: showMenu,
|
|
287
|
+
toggleSideMenu: toggleSideMenu
|
|
221
288
|
}), jsxs("div", {
|
|
222
289
|
className: "bg-background",
|
|
223
|
-
children: [
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
290
|
+
children: [shouldShowSidebar && !isPerplexLayout && jsx("div", {
|
|
291
|
+
style: sideBarMarginTop ? {
|
|
292
|
+
marginTop: sideBarMarginTop
|
|
293
|
+
} : undefined,
|
|
294
|
+
children: jsx(MainSidebar, {
|
|
295
|
+
isSideMenuOpen: isSideMenuOpen,
|
|
296
|
+
closeSideMenu: closeSideMenu,
|
|
297
|
+
menuData: memoizedMenuData,
|
|
298
|
+
collapsed: collapsed,
|
|
299
|
+
setCollapsed: setCollapsed,
|
|
300
|
+
routeParams: memoizedRouteParams,
|
|
301
|
+
settings: settings,
|
|
302
|
+
siderPinned: siderPinned,
|
|
303
|
+
setSiderPinned: setSiderPinned,
|
|
304
|
+
showHeader: showHeader,
|
|
305
|
+
menuHeaderRender: menuHeaderRender,
|
|
306
|
+
deviceSettings: deviceSettings,
|
|
307
|
+
isSideMenuLayout: isSideMenuLayout
|
|
308
|
+
})
|
|
309
|
+
}), shouldShowSidebar && isPerplexLayout && jsx("div", {
|
|
310
|
+
style: sideBarMarginTop ? {
|
|
311
|
+
marginTop: sideBarMarginTop
|
|
312
|
+
} : undefined,
|
|
313
|
+
children: jsx(PerplexSidebar, {
|
|
314
|
+
isSideMenuOpen: isSideMenuOpen,
|
|
315
|
+
closeSideMenu: closeSideMenu,
|
|
316
|
+
menuData: memoizedMenuData,
|
|
317
|
+
collapsed: collapsed,
|
|
318
|
+
setCollapsed: setCollapsed,
|
|
319
|
+
routeParams: memoizedRouteParams,
|
|
320
|
+
settings: settings,
|
|
321
|
+
layoutSettings: layoutSettings,
|
|
322
|
+
menuHeaderRender: menuHeaderRender,
|
|
323
|
+
deviceSettings: deviceSettings,
|
|
324
|
+
siderPinned: siderPinned,
|
|
325
|
+
setSiderPinned: setSiderPinned,
|
|
326
|
+
actor: actor,
|
|
327
|
+
sideBarMarginTop: sideBarMarginTop,
|
|
328
|
+
showHeader: showHeader,
|
|
329
|
+
isSideMenuLayout: isSideMenuLayout,
|
|
330
|
+
authorities: authorities,
|
|
331
|
+
picture: picture
|
|
332
|
+
})
|
|
231
333
|
}), jsxs("div", {
|
|
232
334
|
className: "flex flex-col flex-1 bg-background",
|
|
233
335
|
style: {
|
|
234
|
-
marginLeft:
|
|
336
|
+
marginLeft: computedMarginLeft,
|
|
235
337
|
padding: LAYOUT_ROOT != '/' ? '24px' : '0px'
|
|
236
338
|
},
|
|
237
339
|
children: [config.ENABLE_SETTING_DRAWER && jsx(SettingDrawer, {
|
|
238
340
|
primaryColor: primaryColor,
|
|
239
341
|
settings: settings,
|
|
240
|
-
onSettingChange:
|
|
241
|
-
if (actor) {
|
|
242
|
-
actor.send({
|
|
243
|
-
type: 'UPDATE',
|
|
244
|
-
value: newSettings
|
|
245
|
-
});
|
|
246
|
-
}
|
|
247
|
-
onSettingChange?.(newSettings);
|
|
248
|
-
},
|
|
342
|
+
onSettingChange: handleSettingChange,
|
|
249
343
|
actor: actor,
|
|
250
|
-
colorList:
|
|
251
|
-
|
|
344
|
+
colorList: themeColors,
|
|
345
|
+
fullMenuData: fullMenuData,
|
|
346
|
+
location: location,
|
|
347
|
+
routePattern: props.routePattern
|
|
252
348
|
}), jsxs("main", {
|
|
253
349
|
className: "relative",
|
|
254
350
|
children: [searchOptionsShown && deviceSettings?.header?.searchBarOverlay && jsx("div", {
|
|
@@ -258,15 +354,15 @@ const BasicLayout = props => {
|
|
|
258
354
|
setSearchOptionsShown(false);
|
|
259
355
|
}
|
|
260
356
|
}), jsx(Outlet, {})]
|
|
261
|
-
}),
|
|
357
|
+
}), getOverrideValue('footer.showFooter') && jsx("div", {
|
|
262
358
|
ref: refFooter,
|
|
263
359
|
className: footerFixed ? 'fixed bottom-0 w-full' : '',
|
|
264
360
|
children: jsx(FooterSlot, {
|
|
265
361
|
settings: settings,
|
|
266
|
-
active:
|
|
362
|
+
active: footerActive
|
|
267
363
|
})
|
|
268
364
|
})]
|
|
269
365
|
})]
|
|
270
366
|
})]
|
|
271
367
|
});
|
|
272
|
-
}
|
|
368
|
+
}export{BasicLayout,useHorizontalScroll};//# sourceMappingURL=index.js.map
|