@admin-layout/tailwind-design-pro 12.0.16-alpha.5 → 12.0.16-alpha.51
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 +30 -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 +1 -1
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +83 -17
- 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 +12 -9
- 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 +4 -2
- 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/Logo.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Logo.js +1 -12
- package/lib/components/Layout/GlobalHeader/Logo.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +2 -2
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/MainHeader.js +21 -13
- 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/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/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} +28 -7
- 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 +294 -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 +195 -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 +342 -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 +35 -8
- 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/RightContent.js.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 +28 -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 +19 -5
- 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 +53 -15
- 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 +140 -14
- 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 +73 -176
- 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 +297 -43
- 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 +28 -3
- package/lib/components/SettingDrawer/ThemeColor.js.map +1 -1
- package/lib/components/SettingDrawer/types.d.ts +6 -0
- package/lib/components/SettingDrawer/types.d.ts.map +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +8 -5
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js +240 -4
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.js.map +1 -1
- package/lib/components/index.d.ts +0 -1
- package/lib/components/index.d.ts.map +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/typings.d.ts +11 -6
- 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/analytics-config.js +9 -0
- package/lib/config/analytics-config.js.map +1 -0
- 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/index.d.ts +0 -3
- package/lib/hooks/index.d.ts.map +1 -1
- package/lib/hooks/useMediaQuery.js.map +1 -1
- package/lib/hooks/useScrollThreshold.js.map +1 -1
- package/lib/hooks/useTailwindTheme.js.map +1 -1
- 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/settingsMachine.d.ts +0 -1
- package/lib/machines/settingsMachine.d.ts.map +1 -1
- package/lib/machines/settingsMachine.js +145 -143
- package/lib/machines/settingsMachine.js.map +1 -1
- package/lib/machines/types.d.ts +71 -2
- 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 +355 -0
- package/lib/utils/configOverrides.js.map +1 -0
- package/lib/utils/isBrowser/index.js.map +1 -1
- package/lib/utils/settingsUtils.d.ts +70 -0
- package/lib/utils/settingsUtils.d.ts.map +1 -0
- package/lib/utils/utils/index.js.map +1 -1
- package/package.json +6 -16
- 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
- package/lib/components/UI/CardList.d.ts +0 -61
- package/lib/components/UI/CardList.d.ts.map +0 -1
- package/lib/components/UI/CardList.js +0 -43
- package/lib/components/UI/CardList.js.map +0 -1
- package/lib/components/UI/CategoriesTypeList.d.ts +0 -29
- package/lib/components/UI/CategoriesTypeList.d.ts.map +0 -1
- package/lib/components/UI/CategoriesTypeList.js +0 -139
- package/lib/components/UI/CategoriesTypeList.js.map +0 -1
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts +0 -83
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts.map +0 -1
- package/lib/components/UI/LazyLoadingGoogleMarker.js +0 -107
- package/lib/components/UI/LazyLoadingGoogleMarker.js.map +0 -1
- package/lib/components/UI/Pagination.d.ts +0 -6
- package/lib/components/UI/Pagination.d.ts.map +0 -1
- package/lib/components/UI/Pagination.js +0 -56
- package/lib/components/UI/Pagination.js.map +0 -1
- package/lib/components/UI/ParamSearchResultContainer.d.ts +0 -99
- package/lib/components/UI/ParamSearchResultContainer.d.ts.map +0 -1
- package/lib/components/UI/ParamSearchResultContainer.js +0 -120
- package/lib/components/UI/ParamSearchResultContainer.js.map +0 -1
- package/lib/components/UI/PropertyCard.d.ts +0 -24
- package/lib/components/UI/PropertyCard.d.ts.map +0 -1
- package/lib/components/UI/PropertyCard.js +0 -420
- package/lib/components/UI/PropertyCard.js.map +0 -1
- package/lib/components/UI/PropertyCardOnMap.d.ts +0 -10
- package/lib/components/UI/PropertyCardOnMap.d.ts.map +0 -1
- package/lib/components/UI/PropertyCardOnMap.js +0 -108
- package/lib/components/UI/PropertyCardOnMap.js.map +0 -1
- package/lib/components/UI/VehicleCard/PricePopover.d.ts +0 -8
- package/lib/components/UI/VehicleCard/PricePopover.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard/PricePopover.js +0 -98
- package/lib/components/UI/VehicleCard/PricePopover.js.map +0 -1
- package/lib/components/UI/VehicleCard/VehicleBadge.d.ts +0 -7
- package/lib/components/UI/VehicleCard/VehicleBadge.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard/VehicleFeature.d.ts +0 -9
- package/lib/components/UI/VehicleCard/VehicleFeature.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard/VehicleFeature.js +0 -22
- package/lib/components/UI/VehicleCard/VehicleFeature.js.map +0 -1
- package/lib/components/UI/VehicleCard/types.d.ts +0 -59
- package/lib/components/UI/VehicleCard/types.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard.d.ts +0 -15
- package/lib/components/UI/VehicleCard.d.ts.map +0 -1
- package/lib/components/UI/VehicleCard.js +0 -166
- package/lib/components/UI/VehicleCard.js.map +0 -1
- package/lib/components/UI/VehicleCardList.d.ts +0 -14
- package/lib/components/UI/VehicleCardList.d.ts.map +0 -1
- package/lib/components/UI/VehicleCardList.js +0 -38
- package/lib/components/UI/VehicleCardList.js.map +0 -1
- package/lib/components/UI/VehicleParamSearchResultContainer.d.ts +0 -90
- package/lib/components/UI/VehicleParamSearchResultContainer.d.ts.map +0 -1
- package/lib/components/UI/icons/LocationIcon.d.ts +0 -7
- package/lib/components/UI/icons/LocationIcon.d.ts.map +0 -1
- package/lib/components/UI/icons/LocationIcon.js +0 -18
- package/lib/components/UI/icons/LocationIcon.js.map +0 -1
- package/lib/components/UI/icons/index.d.ts +0 -2
- package/lib/components/UI/icons/index.d.ts.map +0 -1
- package/lib/components/UI/index.d.ts +0 -10
- package/lib/components/UI/index.d.ts.map +0 -1
- package/lib/components/typings.js +0 -6
- package/lib/components/typings.js.map +0 -1
- package/lib/hooks/use-get-current-lat-long.d.ts +0 -18
- package/lib/hooks/use-get-current-lat-long.d.ts.map +0 -1
- package/lib/hooks/use-get-current-lat-long.js +0 -29
- package/lib/hooks/use-get-current-lat-long.js.map +0 -1
- package/lib/hooks/useWindowSize.d.ts +0 -6
- package/lib/hooks/useWindowSize.d.ts.map +0 -1
- package/lib/hooks/useWindowSize.js +0 -20
- package/lib/hooks/useWindowSize.js.map +0 -1
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts +0 -6
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts.map +0 -1
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts +0 -6
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts.map +0 -1
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts +0 -7
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts.map +0 -1
- package/lib/middlewares/datasourcesMiddleware.d.ts +0 -6
- package/lib/middlewares/datasourcesMiddleware.d.ts.map +0 -1
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts +0 -7
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts.map +0 -1
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from'react-i18next';import {Switch}from'./Switch/index.js';import'
|
|
1
|
+
import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useMemo}from'react';import {useTranslation}from'react-i18next';import {Switch}from'./Switch/index.js';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../hooks/useMediaQuery.js';import {getConfigValue,getNestedValue,setConfigOverride}from'../../utils/configOverrides.js';function LayoutChange(props) {
|
|
2
2
|
const {
|
|
3
3
|
settings,
|
|
4
4
|
changeSetting,
|
|
5
|
-
location
|
|
5
|
+
location,
|
|
6
|
+
applyToAllRoutes = false
|
|
6
7
|
} = props;
|
|
7
8
|
const {
|
|
8
9
|
t
|
|
@@ -14,15 +15,52 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
14
15
|
const {
|
|
15
16
|
navTheme
|
|
16
17
|
} = settings || {};
|
|
17
|
-
const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
|
|
18
18
|
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
19
|
-
|
|
19
|
+
// Helper to get config value with overrides applied
|
|
20
|
+
const getConfigValue$1 = (configKey, defaultValue) => {
|
|
21
|
+
// If applyToAllRoutes is true, use global settings only
|
|
22
|
+
if (applyToAllRoutes) {
|
|
23
|
+
return getConfigValue(settings, configKey, {}, defaultValue);
|
|
24
|
+
}
|
|
25
|
+
// Otherwise, check for route-specific overrides first
|
|
26
|
+
if (settings?.uiSettings?.overrides) {
|
|
27
|
+
const contextKey = `[${currentRoute}][${deviceType}]`;
|
|
28
|
+
const overrideSettings = settings.uiSettings.overrides[contextKey];
|
|
29
|
+
if (overrideSettings) {
|
|
30
|
+
// Handle the uilayout wrapper in override structure
|
|
31
|
+
const overrideData = overrideSettings.uilayout || overrideSettings;
|
|
32
|
+
const value = getNestedValue(overrideData, configKey);
|
|
33
|
+
if (value !== undefined) {
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
// Fallback to regular settings
|
|
39
|
+
return getConfigValue(settings, configKey, {
|
|
40
|
+
route: currentRoute,
|
|
41
|
+
device: deviceType
|
|
42
|
+
}, defaultValue);
|
|
43
|
+
};
|
|
44
|
+
// Get layout values using override system
|
|
45
|
+
const layoutValues = useMemo(() => ({
|
|
46
|
+
fixedHeader: getConfigValue$1('fixedHeader', true),
|
|
47
|
+
fixedSidebar: getConfigValue$1('fixedSidebar', true),
|
|
48
|
+
splitMenus: getConfigValue$1('splitMenus', false),
|
|
49
|
+
upperMenuDividerName: getConfigValue$1('upperMenuDividerName', 'Navigation'),
|
|
50
|
+
middleMenuDividerName: getConfigValue$1('middleMenuDividerName', 'Dashboard'),
|
|
51
|
+
lowerMenuDividerName: getConfigValue$1('lowerMenuDividerName', 'Admin')
|
|
52
|
+
}), [settings, currentRoute, deviceType]);
|
|
20
53
|
const handleLayoutChange = (key, value) => {
|
|
21
54
|
if (!changeSetting) return;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
55
|
+
// Create context for override resolution
|
|
56
|
+
const context = {
|
|
57
|
+
route: currentRoute,
|
|
58
|
+
device: deviceType
|
|
59
|
+
};
|
|
60
|
+
// Use setConfigOverride to get the properly formatted key
|
|
61
|
+
const override = setConfigOverride(key, value, context);
|
|
62
|
+
// Send the flat key with override identifier to the backend
|
|
63
|
+
changeSetting(`${override.contextKey}.${override.path}`, value);
|
|
26
64
|
};
|
|
27
65
|
const textColor = {
|
|
28
66
|
color: navTheme === 'dark' ? '#ffff' : 'black'
|
|
@@ -37,7 +75,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
37
75
|
}), jsx("div", {
|
|
38
76
|
className: "flex-grow"
|
|
39
77
|
}), jsx(Switch, {
|
|
40
|
-
value:
|
|
78
|
+
value: layoutValues.fixedHeader,
|
|
41
79
|
onChange: checked => handleLayoutChange('fixedHeader', checked)
|
|
42
80
|
})]
|
|
43
81
|
}), jsxs("div", {
|
|
@@ -49,7 +87,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
49
87
|
}), jsx("div", {
|
|
50
88
|
className: "flex-grow"
|
|
51
89
|
}), jsx(Switch, {
|
|
52
|
-
value:
|
|
90
|
+
value: layoutValues.fixedSidebar,
|
|
53
91
|
onChange: checked => handleLayoutChange('fixedSidebar', checked)
|
|
54
92
|
})]
|
|
55
93
|
}), jsxs("div", {
|
|
@@ -61,10 +99,10 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
61
99
|
}), jsx("div", {
|
|
62
100
|
className: "flex-grow"
|
|
63
101
|
}), jsx(Switch, {
|
|
64
|
-
value:
|
|
102
|
+
value: layoutValues.splitMenus,
|
|
65
103
|
onChange: checked => handleLayoutChange('splitMenus', checked)
|
|
66
104
|
})]
|
|
67
|
-
}),
|
|
105
|
+
}), layoutValues.splitMenus && jsxs(Fragment, {
|
|
68
106
|
children: [jsx("div", {
|
|
69
107
|
className: "mt-6 mb-2",
|
|
70
108
|
children: jsx("p", {
|
|
@@ -83,7 +121,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
83
121
|
}), jsx("input", {
|
|
84
122
|
type: "text",
|
|
85
123
|
className: "px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white",
|
|
86
|
-
value:
|
|
124
|
+
value: layoutValues.upperMenuDividerName,
|
|
87
125
|
onChange: e => {
|
|
88
126
|
handleLayoutChange('upperMenuDividerName', e.target.value);
|
|
89
127
|
}
|
|
@@ -97,7 +135,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
97
135
|
}), jsx("input", {
|
|
98
136
|
type: "text",
|
|
99
137
|
className: "px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white",
|
|
100
|
-
value:
|
|
138
|
+
value: layoutValues.middleMenuDividerName,
|
|
101
139
|
onChange: e => {
|
|
102
140
|
handleLayoutChange('middleMenuDividerName', e.target.value);
|
|
103
141
|
}
|
|
@@ -111,7 +149,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
111
149
|
}), jsx("input", {
|
|
112
150
|
type: "text",
|
|
113
151
|
className: "px-3 py-2 border border-gray-300 rounded-md text-sm focus:outline-none focus:ring-2 focus:ring-blue-500 dark:bg-gray-700 dark:border-gray-600 dark:text-white",
|
|
114
|
-
value:
|
|
152
|
+
value: layoutValues.lowerMenuDividerName,
|
|
115
153
|
onChange: e => {
|
|
116
154
|
handleLayoutChange('lowerMenuDividerName', e.target.value);
|
|
117
155
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutChange.js","sources":["../../../src/components/SettingDrawer/LayoutChange.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LayoutChange.js","sources":["../../../src/components/SettingDrawer/LayoutChange.tsx"],"sourcesContent":[null],"names":["getConfigValue","getConfigValueUtil"],"mappings":"6YAQc,SAAU,YAAY,CAAC,KAAiC,EAAA;AAClE,EAAA,MAAA;IACA,QAAQ;AACR,IAAA,aAAQ;A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sBAAwB,EAAA,YAAU,CAAA;IAErE,qBACI,EAAAA,gBACI,CAAA;iEAiD2C;AACvB,GAAA,CAAA,EAAA,CAAA,QAAA,EAAA,YAAA,EAAA,UAAC;6CAYG;AACJ,IAAA,IAAA,CAAA,aAAA,EAAA;;AAaA,IAAA,MAAA,OAAA,GAAA;AAQhC,MAAC,KAAA,EAAA,YAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
interface MenuItem {
|
|
2
|
+
key: string;
|
|
3
|
+
name: string;
|
|
4
|
+
path: string;
|
|
5
|
+
position?: string;
|
|
6
|
+
children?: MenuItem[];
|
|
7
|
+
tab?: string;
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
}
|
|
10
|
+
interface MenuVisibilitySettingsProps {
|
|
11
|
+
fullMenuData: MenuItem[];
|
|
12
|
+
settings: {
|
|
13
|
+
hiddenMenuKeys?: string[];
|
|
14
|
+
[key: string]: any;
|
|
15
|
+
};
|
|
16
|
+
changeSetting: (key: string, value: any) => void;
|
|
17
|
+
}
|
|
18
|
+
export default function MenuVisibilitySettings({ fullMenuData, settings, changeSetting }: MenuVisibilitySettingsProps): import("react/jsx-runtime").JSX.Element;
|
|
19
|
+
export {};
|
|
20
|
+
//# sourceMappingURL=MenuVisibilitySettings.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuVisibilitySettings.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/MenuVisibilitySettings.tsx"],"names":[],"mappings":"AAQA,UAAU,QAAQ;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,QAAQ,EAAE,CAAC;IACtB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACtB;AAED,UAAU,2BAA2B;IACjC,YAAY,EAAE,QAAQ,EAAE,CAAC;IACzB,QAAQ,EAAE;QACN,cAAc,CAAC,EAAE,MAAM,EAAE,CAAC;QAC1B,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACtB,CAAC;IACF,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;CACpD;AAED,MAAM,CAAC,OAAO,UAAU,sBAAsB,CAAC,EAAE,YAAY,EAAE,QAAQ,EAAE,aAAa,EAAE,EAAE,2BAA2B,2CAqFpH"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useState,useMemo,useCallback}from'react';import {useTranslation}from'react-i18next';// Constants
|
|
2
|
+
// all keys included now ['usermenu', 'topmenu']
|
|
3
|
+
const EXCLUDED_MENU_KEYS = [];
|
|
4
|
+
const MENU_POSITIONS = ['UPPER', 'MIDDLE', 'LOWER', 'BOTTOM'];
|
|
5
|
+
function MenuVisibilitySettings({
|
|
6
|
+
fullMenuData,
|
|
7
|
+
settings,
|
|
8
|
+
changeSetting
|
|
9
|
+
}) {
|
|
10
|
+
const {
|
|
11
|
+
t
|
|
12
|
+
} = useTranslation('settings');
|
|
13
|
+
const [isExpanded, setIsExpanded] = useState(false);
|
|
14
|
+
// Get deduplicated hidden menu keys
|
|
15
|
+
const hiddenMenuKeys = useMemo(() => {
|
|
16
|
+
return settings.hiddenMenuKeys ? Array.from(new Set(settings.hiddenMenuKeys)) : [];
|
|
17
|
+
}, [settings.hiddenMenuKeys]);
|
|
18
|
+
// Organize menu items by position
|
|
19
|
+
const allMenuItems = useMemo(() => {
|
|
20
|
+
const categories = [];
|
|
21
|
+
if (fullMenuData?.length) {
|
|
22
|
+
MENU_POSITIONS.forEach(position => {
|
|
23
|
+
const positionItems = fullMenuData.filter(item => item.position === position && item.key && !EXCLUDED_MENU_KEYS.includes(item.key));
|
|
24
|
+
categories.push(...positionItems);
|
|
25
|
+
});
|
|
26
|
+
const itemsWithoutPosition = fullMenuData.filter(item => !item.position && item.key && !EXCLUDED_MENU_KEYS.includes(item.key));
|
|
27
|
+
categories.push(...itemsWithoutPosition);
|
|
28
|
+
}
|
|
29
|
+
return categories;
|
|
30
|
+
}, [fullMenuData]);
|
|
31
|
+
// Create bound functions with current dependencies
|
|
32
|
+
const boundGetDisplayName = useCallback(item => getDisplayName(item, t), [t]);
|
|
33
|
+
const boundToggleMenuItem = useCallback(itemKey => toggleMenuItem(itemKey, hiddenMenuKeys, changeSetting), [hiddenMenuKeys, changeSetting]);
|
|
34
|
+
// Memoize rendered menu items to prevent unnecessary JSX creation
|
|
35
|
+
const renderedMenuItems = useMemo(() => {
|
|
36
|
+
return renderMenuItems(allMenuItems, 0, hiddenMenuKeys, boundGetDisplayName, boundToggleMenuItem);
|
|
37
|
+
}, [allMenuItems, hiddenMenuKeys, boundGetDisplayName, boundToggleMenuItem]);
|
|
38
|
+
return jsxs("div", {
|
|
39
|
+
className: "space-y-4",
|
|
40
|
+
children: [jsx("div", {
|
|
41
|
+
className: "flex items-center mb-2",
|
|
42
|
+
children: jsxs("button", {
|
|
43
|
+
onClick: () => setIsExpanded(!isExpanded),
|
|
44
|
+
className: "flex items-center gap-2 hover:opacity-80 transition-all duration-200",
|
|
45
|
+
children: [jsx("svg", {
|
|
46
|
+
className: `w-4 h-4 transition-transform duration-300 ease-in-out ${isExpanded ? 'rotate-180' : ''}`,
|
|
47
|
+
fill: "none",
|
|
48
|
+
stroke: "currentColor",
|
|
49
|
+
viewBox: "0 0 24 24",
|
|
50
|
+
children: jsx("path", {
|
|
51
|
+
strokeLinecap: "round",
|
|
52
|
+
strokeLinejoin: "round",
|
|
53
|
+
strokeWidth: 2,
|
|
54
|
+
d: "M19 9l-7 7-7-7"
|
|
55
|
+
})
|
|
56
|
+
}), jsx("p", {
|
|
57
|
+
className: "text-md font-medium text-black dark:text-white",
|
|
58
|
+
children: t('menu_visibility.title') || 'Menu Visibility'
|
|
59
|
+
})]
|
|
60
|
+
})
|
|
61
|
+
}), jsx("div", {
|
|
62
|
+
className: `grid transition-all duration-300 ease-in-out ${isExpanded ? 'grid-rows-[1fr]' : 'grid-rows-[0fr]'}`,
|
|
63
|
+
children: jsx("div", {
|
|
64
|
+
className: "overflow-hidden",
|
|
65
|
+
children: jsx("div", {
|
|
66
|
+
className: "ml-4 mb-4 border-l-2 border-gray-200 dark:border-gray-600 pl-4",
|
|
67
|
+
children: jsx("div", {
|
|
68
|
+
className: "space-y-2",
|
|
69
|
+
children: allMenuItems.length === 0 ? jsx("div", {
|
|
70
|
+
className: "text-center text-gray-500 dark:text-gray-400 py-4",
|
|
71
|
+
children: t('menu_visibility.no_items') || 'No menu items found'
|
|
72
|
+
}) : renderedMenuItems
|
|
73
|
+
})
|
|
74
|
+
})
|
|
75
|
+
})
|
|
76
|
+
})]
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
// Helper functions
|
|
80
|
+
function getDisplayName(item, t) {
|
|
81
|
+
if (item.tab) return item.tab;
|
|
82
|
+
if (item.name?.startsWith('menu.')) {
|
|
83
|
+
const parts = item.name.split('.');
|
|
84
|
+
return parts.length > 1 ? parts[parts.length - 1].charAt(0).toUpperCase() + parts[parts.length - 1].slice(1) : item.name;
|
|
85
|
+
}
|
|
86
|
+
return t(item.name) || item.name;
|
|
87
|
+
}
|
|
88
|
+
function toggleMenuItem(itemKey, hiddenMenuKeys, changeSetting) {
|
|
89
|
+
const uniqueKeys = new Set(hiddenMenuKeys);
|
|
90
|
+
uniqueKeys.has(itemKey) ? uniqueKeys.delete(itemKey) : uniqueKeys.add(itemKey);
|
|
91
|
+
changeSetting('hiddenMenuKeys', Array.from(uniqueKeys));
|
|
92
|
+
}
|
|
93
|
+
function renderMenuItems(items, indent, hiddenMenuKeys, getDisplayNameFn, toggleMenuItemFn) {
|
|
94
|
+
return items.map(item => {
|
|
95
|
+
const isVisible = !hiddenMenuKeys.includes(item.key);
|
|
96
|
+
const displayName = getDisplayNameFn(item);
|
|
97
|
+
return jsxs("div", {
|
|
98
|
+
children: [jsxs("div", {
|
|
99
|
+
className: "flex items-center py-0.5",
|
|
100
|
+
children: [jsx("input", {
|
|
101
|
+
type: "checkbox",
|
|
102
|
+
id: `menu-item-${item.key}`,
|
|
103
|
+
className: "mr-2 h-3 w-3 rounded border-gray-300 dark:border-gray-600 focus:ring-primary dark:focus:ring-primary bg-white dark:bg-gray-700 accent-primary",
|
|
104
|
+
checked: isVisible,
|
|
105
|
+
onChange: () => toggleMenuItemFn(item.key)
|
|
106
|
+
}), jsx("label", {
|
|
107
|
+
htmlFor: `menu-item-${item.key}`,
|
|
108
|
+
className: "text-xs text-black dark:text-white cursor-pointer flex-1",
|
|
109
|
+
style: {
|
|
110
|
+
paddingLeft: `${indent * 12}px`
|
|
111
|
+
},
|
|
112
|
+
children: displayName
|
|
113
|
+
})]
|
|
114
|
+
}), isVisible && item.children && item.children.length > 0 && jsx("div", {
|
|
115
|
+
className: "ml-6",
|
|
116
|
+
children: renderMenuItems(item.children, indent + 1, hiddenMenuKeys, getDisplayNameFn, toggleMenuItemFn)
|
|
117
|
+
})]
|
|
118
|
+
}, item.key);
|
|
119
|
+
});
|
|
120
|
+
}export{MenuVisibilitySettings as default};//# sourceMappingURL=MenuVisibilitySettings.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MenuVisibilitySettings.js","sources":["../../../src/components/SettingDrawer/MenuVisibilitySettings.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"qIAGA;AACA;AACA,MAAM,kBAAkB,GAAG,EAAE;AAC7B,MAAM,cAAc,GAAG,CAAC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,QAAQ,CAAU;AAqBxD,SAAU,sBAAs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jB,EAAC,MAAA,mBAAA,GAAA,WAAA,CAAA,OAAA,IAAA,cAAA,CAAA,OAAA,EAAA,cAAA,EAAA,aAAA,CAAA,EAAA,CAAA,cAAA,EAAA,aAAA,CAAA,CAAA;AAED;AACA,EAAA,MAAA,iBAAwB,GAAc,OAA4B,CAAA,MAAA;IAC9D,OAAI,eAAQ,CAAA,YAAA,EAAA,CAAA,EAAA,cAAA,EAAA,mBAAA,EAAA,mBAAA,CAAA;kBAAS,EAAK,cAAI,EAAA,mBAAA,EAAA,mBAAA,CAAA,CAAA;SAC1BA,IAAK,CAAA;aACL,EAAM,WAAY;AAClB,IAAA,QAAA,EAAA,CAAOC,GAAA,CAAK,KAAC,EAAM;AACf,MAAA,SAAE,EAAA,wBAAwB;AAC1B,MAAA,QAAE,EAAAD,IAAK,CAAA,QAAK,EAAA;QACnB,OAAA,EAAA,MAAA,aAAA,CAAA,CAAA,UAAA,CAAA;QACD,SAAa,EAAC,sEAAmB;AACrC,QAAC,QAAA,EAAA,CAAAC,GAAA,CAAA,KAAA,EAAA;AAED,4EAAmH,EAAA,UAAA,GAAA,YAAA,GAAA,EAAA,CAAA,CAAA;AAC/G,UAAM,YAAU;UAChB,QAAc,cAAY;UAC1B,OAAa,EAAC,WAAA;AAClB,UAAC,QAAA,EAAAA,GAAA,CAAA,MAAA,EAAA;AAED,YAAS,aACL,EAAA,OACA;AAKA,0BAAsB,EAAE,OAAE;YACtB,WAAe,EAAA,CAAG;AAClB,YAAA,CAAA;WAEA;AA0BJ,SAAG,CAAA,EAAAA,GAAA,CAAA,GAAA,EAAA;AACP,UAAC,SAAA,EAAA,gDAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { NavMenuSelectorProps } from './types';
|
|
2
|
-
export default function NavigationModes({ changeSetting, settings, location }: NavMenuSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
2
|
+
export default function NavigationModes({ changeSetting, settings, location, applyToAllRoutes, }: NavMenuSelectorProps): import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
//# sourceMappingURL=NavigationsModes.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationsModes.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/NavigationsModes.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"NavigationsModes.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/NavigationsModes.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAgG/C,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACpC,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,gBAAwB,GAC3B,EAAE,oBAAoB,2CAqHtB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import'react';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import'../../hooks/
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import {useMemo}from'react';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import {useMediaQuery}from'../../hooks/useMediaQuery.js';import {setConfigOverride,getConfigValue,getNestedValue}from'../../utils/configOverrides.js';const navigationModes = [{
|
|
2
2
|
key: 'sidebar',
|
|
3
3
|
title: 'Sidebar',
|
|
4
4
|
svg: jsxs("svg", {
|
|
@@ -219,19 +219,131 @@ const menuTypes = [{
|
|
|
219
219
|
opacity: "0.65"
|
|
220
220
|
})]
|
|
221
221
|
})
|
|
222
|
+
}, {
|
|
223
|
+
key: 'perplexLayout',
|
|
224
|
+
title: 'Perplex Layout',
|
|
225
|
+
svg: jsxs("svg", {
|
|
226
|
+
width: "58",
|
|
227
|
+
height: "50",
|
|
228
|
+
viewBox: "0 0 80 60",
|
|
229
|
+
fill: "none",
|
|
230
|
+
xmlns: "http://www.w3.org/2000/svg",
|
|
231
|
+
children: [jsx("rect", {
|
|
232
|
+
x: "1",
|
|
233
|
+
y: "1",
|
|
234
|
+
width: "78",
|
|
235
|
+
height: "58",
|
|
236
|
+
rx: "4",
|
|
237
|
+
fill: "white",
|
|
238
|
+
stroke: "#E5E7EB",
|
|
239
|
+
strokeWidth: "2"
|
|
240
|
+
}), jsx("rect", {
|
|
241
|
+
x: "1",
|
|
242
|
+
y: "1",
|
|
243
|
+
width: "20",
|
|
244
|
+
height: "58",
|
|
245
|
+
rx: "3",
|
|
246
|
+
fill: "#0F172A"
|
|
247
|
+
}), jsx("rect", {
|
|
248
|
+
x: "5",
|
|
249
|
+
y: "10",
|
|
250
|
+
width: "10",
|
|
251
|
+
height: "3",
|
|
252
|
+
rx: "1.5",
|
|
253
|
+
fill: "white",
|
|
254
|
+
opacity: "0.9"
|
|
255
|
+
}), jsx("rect", {
|
|
256
|
+
x: "5",
|
|
257
|
+
y: "20",
|
|
258
|
+
width: "10",
|
|
259
|
+
height: "3",
|
|
260
|
+
rx: "1.5",
|
|
261
|
+
fill: "white",
|
|
262
|
+
opacity: "0.6"
|
|
263
|
+
}), jsx("rect", {
|
|
264
|
+
x: "5",
|
|
265
|
+
y: "30",
|
|
266
|
+
width: "10",
|
|
267
|
+
height: "3",
|
|
268
|
+
rx: "1.5",
|
|
269
|
+
fill: "white",
|
|
270
|
+
opacity: "0.4"
|
|
271
|
+
}), jsx("rect", {
|
|
272
|
+
x: "25",
|
|
273
|
+
y: "10",
|
|
274
|
+
width: "40",
|
|
275
|
+
height: "3",
|
|
276
|
+
rx: "1.5",
|
|
277
|
+
fill: "#0F172A",
|
|
278
|
+
opacity: "0.7"
|
|
279
|
+
}), jsx("rect", {
|
|
280
|
+
x: "25",
|
|
281
|
+
y: "20",
|
|
282
|
+
width: "30",
|
|
283
|
+
height: "3",
|
|
284
|
+
rx: "1.5",
|
|
285
|
+
fill: "#0F172A",
|
|
286
|
+
opacity: "0.5"
|
|
287
|
+
}), jsx("rect", {
|
|
288
|
+
x: "25",
|
|
289
|
+
y: "35",
|
|
290
|
+
width: "45",
|
|
291
|
+
height: "3",
|
|
292
|
+
rx: "1.5",
|
|
293
|
+
fill: "#0F172A",
|
|
294
|
+
opacity: "0.4"
|
|
295
|
+
}), jsx("rect", {
|
|
296
|
+
x: "25",
|
|
297
|
+
y: "45",
|
|
298
|
+
width: "35",
|
|
299
|
+
height: "3",
|
|
300
|
+
rx: "1.5",
|
|
301
|
+
fill: "#0F172A",
|
|
302
|
+
opacity: "0.3"
|
|
303
|
+
})]
|
|
304
|
+
})
|
|
222
305
|
}];
|
|
223
306
|
function NavigationModes({
|
|
224
307
|
changeSetting,
|
|
225
308
|
settings,
|
|
226
|
-
location
|
|
309
|
+
location,
|
|
310
|
+
applyToAllRoutes = false
|
|
227
311
|
}) {
|
|
228
312
|
const {
|
|
229
313
|
isMobile
|
|
230
314
|
} = useMediaQuery();
|
|
231
315
|
const currentRoute = location?.pathname || '/';
|
|
232
|
-
const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
|
|
233
316
|
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
234
|
-
|
|
317
|
+
// Helper to get config value with overrides applied
|
|
318
|
+
const getConfigValue$1 = (configKey, defaultValue) => {
|
|
319
|
+
// If applyToAllRoutes is true, use global settings only
|
|
320
|
+
if (applyToAllRoutes) {
|
|
321
|
+
return getConfigValue(settings, configKey, {}, defaultValue);
|
|
322
|
+
}
|
|
323
|
+
// Otherwise, check for route-specific overrides first
|
|
324
|
+
if (settings?.uiSettings?.overrides) {
|
|
325
|
+
const contextKey = `[${currentRoute}][${deviceType}]`;
|
|
326
|
+
const overrideSettings = settings.uiSettings.overrides[contextKey];
|
|
327
|
+
if (overrideSettings) {
|
|
328
|
+
// Handle the uilayout wrapper in override structure
|
|
329
|
+
const overrideData = overrideSettings.uilayout || overrideSettings;
|
|
330
|
+
const value = getNestedValue(overrideData, configKey);
|
|
331
|
+
if (value !== undefined) {
|
|
332
|
+
return value;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
// Fallback to regular settings
|
|
337
|
+
return getConfigValue(settings, configKey, {
|
|
338
|
+
route: currentRoute,
|
|
339
|
+
device: deviceType
|
|
340
|
+
}, defaultValue);
|
|
341
|
+
};
|
|
342
|
+
// Get navigation values using override system
|
|
343
|
+
const navigationValues = useMemo(() => ({
|
|
344
|
+
navigationMode: getConfigValue$1('navigationMode', 'mixed'),
|
|
345
|
+
sideMenuType: getConfigValue$1('sideMenuType', 'expanded')
|
|
346
|
+
}), [settings, currentRoute, deviceType]);
|
|
235
347
|
return jsxs("div", {
|
|
236
348
|
className: "space-y-8",
|
|
237
349
|
children: [jsxs("section", {
|
|
@@ -242,13 +354,19 @@ function NavigationModes({
|
|
|
242
354
|
className: "flex flex-row gap-4",
|
|
243
355
|
children: navigationModes.map((mode, index) => jsx("div", {
|
|
244
356
|
className: "relative cursor-pointer hover:opacity-80 transition-opacity shadow-sm dark:shadow-md rounded overflow-hidden",
|
|
245
|
-
onClick: () =>
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
357
|
+
onClick: () => {
|
|
358
|
+
// Create context for override resolution
|
|
359
|
+
const context = {
|
|
360
|
+
route: currentRoute,
|
|
361
|
+
device: deviceType
|
|
362
|
+
};
|
|
363
|
+
// Use setConfigOverride to get the properly formatted key
|
|
364
|
+
const override = setConfigOverride('navigationMode', mode.key, context);
|
|
365
|
+
changeSetting(`${override.contextKey}.${override.path}`, mode.key);
|
|
366
|
+
},
|
|
249
367
|
children: jsxs("div", {
|
|
250
368
|
className: "relative",
|
|
251
|
-
children: [mode.svg,
|
|
369
|
+
children: [mode.svg, navigationValues.navigationMode === mode.key && jsx("svg", {
|
|
252
370
|
className: "absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-6 h-6 text-blue-500 pointer-events-none",
|
|
253
371
|
viewBox: "0 0 24 24",
|
|
254
372
|
fill: "currentColor",
|
|
@@ -267,13 +385,21 @@ function NavigationModes({
|
|
|
267
385
|
className: "flex flex-row gap-4",
|
|
268
386
|
children: menuTypes.map((type, index) => jsx("div", {
|
|
269
387
|
className: "relative cursor-pointer hover:opacity-80 transition-opacity shadow-sm dark:shadow-md rounded overflow-hidden",
|
|
270
|
-
onClick: () =>
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
388
|
+
onClick: () => {
|
|
389
|
+
// Create context for override resolution
|
|
390
|
+
const context = {
|
|
391
|
+
route: currentRoute,
|
|
392
|
+
device: deviceType
|
|
393
|
+
};
|
|
394
|
+
// Use setConfigOverride to get the properly formatted key
|
|
395
|
+
const override = setConfigOverride('sideMenuType', type.key, context);
|
|
396
|
+
changeSetting(`${override.contextKey}.${override.path}`, type.key);
|
|
397
|
+
// Also update the global sideMenuType for compatibility
|
|
398
|
+
changeSetting('sideMenuType', type.key);
|
|
399
|
+
},
|
|
274
400
|
children: jsxs("div", {
|
|
275
401
|
className: "relative",
|
|
276
|
-
children: [type.svg,
|
|
402
|
+
children: [type.svg, navigationValues.sideMenuType === type.key && jsx("svg", {
|
|
277
403
|
className: "absolute top-1/2 left-1/2 transform -translate-x-1/2 -translate-y-1/2 w-6 h-6 text-blue-500 pointer-events-none",
|
|
278
404
|
viewBox: "0 0 24 24",
|
|
279
405
|
fill: "currentColor",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NavigationsModes.js","sources":["../../../src/components/SettingDrawer/NavigationsModes.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"
|
|
1
|
+
{"version":3,"file":"NavigationsModes.js","sources":["../../../src/components/SettingDrawer/NavigationsModes.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"kTAIA,MAAM,eAAe,GAAG,CAAA;AACpB,EAAA,GAAA,EAAA,SAAA;AACI,E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A,QAAA,EAAA,CAAAC,GAAA,CAAA;iBACA;AACA,MAAA,MAAA,EAAA,IAAA;AACI,MAAA,EAAA,EAAA,GAAA;;WAER,CAAC,MAAA,EAAA;SACJ,GAAA;SAED,GAAA;AACA,MAAA,KAAA,EAAA;AACJ,MAAE,MAAA,EAAA,IAAA;MAEF,IAAA,EAAA;AACA,KAAA,CAAA,EAAAA;AAEQ,MAAA,CAAA,EAAA,GAAA;AACA,MAAA,CAAA,EAAA,GAAA;MACF,KACD,EAAA,IAAQ;MAGb,MACI;;;;AAgBwB,MAAA,CAAA,EAAA,IAAA;AACA,MAAA,CAAA,EAAA,GAAA;;;;;AAmCA,MAAA,OAAA,EAAA;AACA,KAAA,CAAA,EAAAA,GAAA,CAAA,MAAA,EAAA;;AAGA,MAAA,CAAA,EAAA,GAAA;;AAqBhC,MAAC,MAAA,EAAA,GAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegionalSettings.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/RegionalSettings.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"RegionalSettings.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/RegionalSettings.tsx"],"names":[],"mappings":"AAGA,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAMjD,MAAM,CAAC,OAAO,UAAU,gBAAgB,CAAC,KAAK,EAAE,sBAAsB,2CAijBrE"}
|