@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,8 +1,10 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import {useTranslation}from'react-i18next';import {Switch}from'./Switch/index.js';import'
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import*as React 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 {getSettingValue}from'../../utils/settingsUtils.js';function InvitationSettings(props) {
|
|
2
2
|
const {
|
|
3
3
|
settings,
|
|
4
4
|
changeSetting,
|
|
5
|
-
location
|
|
5
|
+
location,
|
|
6
|
+
routePattern,
|
|
7
|
+
applyToAllRoutes = false
|
|
6
8
|
} = props;
|
|
7
9
|
const {
|
|
8
10
|
t
|
|
@@ -10,10 +12,12 @@ import {jsxs,jsx}from'react/jsx-runtime';import {useTranslation}from'react-i18ne
|
|
|
10
12
|
const {
|
|
11
13
|
isMobile
|
|
12
14
|
} = useMediaQuery();
|
|
13
|
-
const currentRoute = location?.pathname || '/';
|
|
14
|
-
|
|
15
|
-
//
|
|
16
|
-
const invitations =
|
|
15
|
+
const currentRoute = routePattern || location?.pathname || '/';
|
|
16
|
+
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
17
|
+
// Get organization invitations using the utility function
|
|
18
|
+
const invitations = React.useMemo(() => {
|
|
19
|
+
return getSettingValue(settings, 'organization.members.invitations', applyToAllRoutes, currentRoute, deviceType, {});
|
|
20
|
+
}, [settings, applyToAllRoutes, currentRoute, deviceType]);
|
|
17
21
|
const handleInvitationChange = (key, value) => {
|
|
18
22
|
if (!changeSetting) return;
|
|
19
23
|
const newInvitations = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InvitationSettings.js","sources":["../../../src/components/SettingDrawer/InvitationSettings.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InvitationSettings.js","sources":["../../../src/components/SettingDrawer/InvitationSettings.tsx"],"sourcesContent":[null],"names":[],"mappings":"kWAOc,SAAU,kBAAkB,CAAC,KAAiC,EAAA;AACxE,EAAA,MAAA;IACA,QAAQ;AACR,IAAA,aAAQ;IACR,QAAM;IACN,YAAM;IAEN,gBAAA,GAAA;AACA,GAAA,GAAA;AACI,EAAA,MAAA;IAQJ;AAEA,GAAA,GAAA,0BAA4B;AACxB,EAAA,MAAA;;AACA,GAAA,GAAA;AACI,EAAA,MAAA,YAAG,GAAA,YAAW,IAAA,QAAA,EAAA,QAAA,IAAA,GAAA;kBACT,GAAE,QAAK,GAAA,QAAA,GAAA,SAAA;;AAGhB,EAAA,MAAA,WAAA,GAAc,KAAA,CAAA,OAAA,CAAA,MAAA;AAClB,IAAA,OAAE,eAAA,CAAA,QAAA,EAAA,kCAAA,EAAA,gBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,EAAA,CAAA;AAEF,EAAA,CAAA,EAAA,CAAA,0BAA2B,EAAA,YAAU,EAAA,YAAmB;QAExD,sBACI,GAAA,CAAA,GAAA,EACI,KAAA,KAAA;AAqCZ,IAAC,IAAA,CAAA,aAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LayoutChange.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/LayoutChange.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LayoutChange.d.ts","sourceRoot":"","sources":["../../../src/components/SettingDrawer/LayoutChange.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAI/C,MAAM,CAAC,OAAO,UAAU,YAAY,CAAC,KAAK,EAAE,oBAAoB,GAAG,GAAG,2CAwIrE"}
|
|
@@ -1,8 +1,10 @@
|
|
|
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 {getSettingValue}from'../../utils/settingsUtils.js';function LayoutChange(props) {
|
|
2
2
|
const {
|
|
3
3
|
settings,
|
|
4
4
|
changeSetting,
|
|
5
|
-
location
|
|
5
|
+
location,
|
|
6
|
+
routePattern,
|
|
7
|
+
applyToAllRoutes = false
|
|
6
8
|
} = props;
|
|
7
9
|
const {
|
|
8
10
|
t
|
|
@@ -10,19 +12,24 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
10
12
|
const {
|
|
11
13
|
isMobile
|
|
12
14
|
} = useMediaQuery();
|
|
13
|
-
const currentRoute = location?.pathname || '/';
|
|
15
|
+
const currentRoute = routePattern || location?.pathname || '/';
|
|
14
16
|
const {
|
|
15
17
|
navTheme
|
|
16
18
|
} = settings || {};
|
|
17
|
-
const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
|
|
18
19
|
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
19
|
-
|
|
20
|
+
// Get layout values using the utility function
|
|
21
|
+
const layoutValues = useMemo(() => ({
|
|
22
|
+
fixedHeader: getSettingValue(settings, 'fixedHeader', applyToAllRoutes, currentRoute, deviceType, true),
|
|
23
|
+
fixedSidebar: getSettingValue(settings, 'fixedSidebar', applyToAllRoutes, currentRoute, deviceType, true),
|
|
24
|
+
splitMenus: getSettingValue(settings, 'splitMenus', applyToAllRoutes, currentRoute, deviceType, false),
|
|
25
|
+
upperMenuDividerName: getSettingValue(settings, 'upperMenuDividerName', applyToAllRoutes, currentRoute, deviceType, 'Navigation'),
|
|
26
|
+
middleMenuDividerName: getSettingValue(settings, 'middleMenuDividerName', applyToAllRoutes, currentRoute, deviceType, 'Dashboard'),
|
|
27
|
+
lowerMenuDividerName: getSettingValue(settings, 'lowerMenuDividerName', applyToAllRoutes, currentRoute, deviceType, 'Admin')
|
|
28
|
+
}), [settings, applyToAllRoutes, currentRoute, deviceType]);
|
|
20
29
|
const handleLayoutChange = (key, value) => {
|
|
21
30
|
if (!changeSetting) return;
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
[key]: value
|
|
25
|
-
});
|
|
31
|
+
// Pass simple key - handleSettingChange in SettingDrawer will decide if it's global or route-specific
|
|
32
|
+
changeSetting(key, value);
|
|
26
33
|
};
|
|
27
34
|
const textColor = {
|
|
28
35
|
color: navTheme === 'dark' ? '#ffff' : 'black'
|
|
@@ -37,7 +44,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
37
44
|
}), jsx("div", {
|
|
38
45
|
className: "flex-grow"
|
|
39
46
|
}), jsx(Switch, {
|
|
40
|
-
value:
|
|
47
|
+
value: layoutValues.fixedHeader,
|
|
41
48
|
onChange: checked => handleLayoutChange('fixedHeader', checked)
|
|
42
49
|
})]
|
|
43
50
|
}), jsxs("div", {
|
|
@@ -49,7 +56,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
49
56
|
}), jsx("div", {
|
|
50
57
|
className: "flex-grow"
|
|
51
58
|
}), jsx(Switch, {
|
|
52
|
-
value:
|
|
59
|
+
value: layoutValues.fixedSidebar,
|
|
53
60
|
onChange: checked => handleLayoutChange('fixedSidebar', checked)
|
|
54
61
|
})]
|
|
55
62
|
}), jsxs("div", {
|
|
@@ -61,10 +68,10 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
61
68
|
}), jsx("div", {
|
|
62
69
|
className: "flex-grow"
|
|
63
70
|
}), jsx(Switch, {
|
|
64
|
-
value:
|
|
71
|
+
value: layoutValues.splitMenus,
|
|
65
72
|
onChange: checked => handleLayoutChange('splitMenus', checked)
|
|
66
73
|
})]
|
|
67
|
-
}),
|
|
74
|
+
}), layoutValues.splitMenus && jsxs(Fragment, {
|
|
68
75
|
children: [jsx("div", {
|
|
69
76
|
className: "mt-6 mb-2",
|
|
70
77
|
children: jsx("p", {
|
|
@@ -83,7 +90,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
83
90
|
}), jsx("input", {
|
|
84
91
|
type: "text",
|
|
85
92
|
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:
|
|
93
|
+
value: layoutValues.upperMenuDividerName,
|
|
87
94
|
onChange: e => {
|
|
88
95
|
handleLayoutChange('upperMenuDividerName', e.target.value);
|
|
89
96
|
}
|
|
@@ -97,7 +104,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
97
104
|
}), jsx("input", {
|
|
98
105
|
type: "text",
|
|
99
106
|
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:
|
|
107
|
+
value: layoutValues.middleMenuDividerName,
|
|
101
108
|
onChange: e => {
|
|
102
109
|
handleLayoutChange('middleMenuDividerName', e.target.value);
|
|
103
110
|
}
|
|
@@ -111,7 +118,7 @@ import {jsxs,jsx,Fragment}from'react/jsx-runtime';import {useTranslation}from're
|
|
|
111
118
|
}), jsx("input", {
|
|
112
119
|
type: "text",
|
|
113
120
|
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:
|
|
121
|
+
value: layoutValues.lowerMenuDividerName,
|
|
115
122
|
onChange: e => {
|
|
116
123
|
handleLayoutChange('lowerMenuDividerName', e.target.value);
|
|
117
124
|
}
|
|
@@ -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":[],"mappings":"2WAQc,SAAU,YAAY,CAAC,KAAiC,EAAA;AAClE,EAAA,MAAA;IACA,QAAQ;AACR,IAAA,aAAQ;IACR,QAAM;AACN,IAAA,YAAQ;AACR,IAAA,gBAAgB,GAAG;MAEnB,KAAA;AACA,EAAA,MAAA;AAEQ,IAAA;AACA,GAAA,GAAA,cAAY,CAAA,UAAE,CAAA;AACd,EAAA,MAAA;AACA,IAAA;AAQA,GAAA,GAAA,aAAA,EAAA;AAQA,EAAA,MAAA,YAAA,GAAA,YAAsB,IAAA,QAClB,EAAA,QACA,IAAA,GAAA;QAOR;AAGJ,IAAA;AACI,GAAA,GAAA,QAAK,IAAA,EAAA;kBAAe,GAAO,QAAA,GAAA,QAAA,GAAA,SAAA;;AAE3B,EAAA,MAAA,YAAA,GAAc,OAAK,CAAA,OAAO;AAC9B,IAAA,WAAE,EAAA,eAAA,CAAA,QAAA,EAAA,aAAA,EAAA,gBAAA,EAAA,YAAA,EAAA,UAAA,EAAA,IAAA,CAAA;AAEF,IAAA,sCAAmC,EAAK,cAAS,EAAO,gBAAa,EAAA,YAAA,EAAA,UAAA,EAAA,IAAA,CAAA;IAErE,UACI,EAAA,eAAA,CAAA,QACI,EAAA,YAAK,EAAA,gCAAkC,UAAA,EAAA,KACnC,CAAA;kDAgDoB,EAAA,wCAA6C,EAAA,YAAc,EAAA,UAAA,EAAA,YAAA,CAAA;AAC/D,IAAA,qBAAA,EAAA,iDAGO,kBAAe,EAAA,YAC1B,EAAA,UAAO,aAAU,CAAA;kDAQT,EAAA,wCAA8C,EAAA,YAAc,EAAA,UAAA,EAAA,OAAA;AAChE,GAAA,CAAA,EAAA,CAAA,QAAA,EAAA,gBAAA,EAAA,YACF,EACA;6CAUM;AACJ,IAAA,IAAA,CAAA,aAAA,EAAA;AAQhC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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":"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"}
|
|
@@ -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, routePattern, 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;AAoF/C,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACpC,aAAa,EACb,QAAQ,EACR,QAAQ,EACR,YAAY,EACZ,gBAAwB,GAC3B,EAAE,oBAAoB,2CA+FtB"}
|
|
@@ -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 {useMediaQuery}from'../../hooks/useMediaQuery.js';const navigationModes = [{
|
|
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 {getSettingValue}from'../../utils/settingsUtils.js';const navigationModes = [{
|
|
2
2
|
key: 'sidebar',
|
|
3
3
|
title: 'Sidebar',
|
|
4
4
|
svg: jsxs("svg", {
|
|
@@ -183,55 +183,106 @@ const menuTypes = [{
|
|
|
183
183
|
})]
|
|
184
184
|
})
|
|
185
185
|
}, {
|
|
186
|
-
key: '
|
|
187
|
-
title: '
|
|
186
|
+
key: 'perplexLayout',
|
|
187
|
+
title: 'Perplex Layout',
|
|
188
188
|
svg: jsxs("svg", {
|
|
189
189
|
width: "58",
|
|
190
190
|
height: "50",
|
|
191
|
-
viewBox: "0 0
|
|
191
|
+
viewBox: "0 0 80 60",
|
|
192
|
+
fill: "none",
|
|
192
193
|
xmlns: "http://www.w3.org/2000/svg",
|
|
193
194
|
children: [jsx("rect", {
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
x: "1",
|
|
196
|
+
y: "1",
|
|
197
|
+
width: "78",
|
|
198
|
+
height: "58",
|
|
199
|
+
rx: "4",
|
|
200
|
+
fill: "white",
|
|
201
|
+
stroke: "#E5E7EB",
|
|
202
|
+
strokeWidth: "2"
|
|
198
203
|
}), jsx("rect", {
|
|
199
|
-
x: "
|
|
200
|
-
y: "
|
|
201
|
-
width: "
|
|
202
|
-
height: "
|
|
203
|
-
|
|
204
|
+
x: "1",
|
|
205
|
+
y: "1",
|
|
206
|
+
width: "20",
|
|
207
|
+
height: "58",
|
|
208
|
+
rx: "3",
|
|
209
|
+
fill: "#0F172A"
|
|
204
210
|
}), jsx("rect", {
|
|
205
|
-
x: "
|
|
206
|
-
y: "
|
|
211
|
+
x: "5",
|
|
212
|
+
y: "10",
|
|
207
213
|
width: "10",
|
|
208
|
-
height: "
|
|
209
|
-
rx: "1",
|
|
210
|
-
fill: "
|
|
211
|
-
opacity: "0.
|
|
214
|
+
height: "3",
|
|
215
|
+
rx: "1.5",
|
|
216
|
+
fill: "white",
|
|
217
|
+
opacity: "0.9"
|
|
212
218
|
}), jsx("rect", {
|
|
213
|
-
x: "
|
|
214
|
-
y: "
|
|
219
|
+
x: "5",
|
|
220
|
+
y: "20",
|
|
215
221
|
width: "10",
|
|
216
|
-
height: "
|
|
217
|
-
rx: "1",
|
|
218
|
-
fill: "
|
|
219
|
-
opacity: "0.
|
|
222
|
+
height: "3",
|
|
223
|
+
rx: "1.5",
|
|
224
|
+
fill: "white",
|
|
225
|
+
opacity: "0.6"
|
|
226
|
+
}), jsx("rect", {
|
|
227
|
+
x: "5",
|
|
228
|
+
y: "30",
|
|
229
|
+
width: "10",
|
|
230
|
+
height: "3",
|
|
231
|
+
rx: "1.5",
|
|
232
|
+
fill: "white",
|
|
233
|
+
opacity: "0.4"
|
|
234
|
+
}), jsx("rect", {
|
|
235
|
+
x: "25",
|
|
236
|
+
y: "10",
|
|
237
|
+
width: "40",
|
|
238
|
+
height: "3",
|
|
239
|
+
rx: "1.5",
|
|
240
|
+
fill: "#0F172A",
|
|
241
|
+
opacity: "0.7"
|
|
242
|
+
}), jsx("rect", {
|
|
243
|
+
x: "25",
|
|
244
|
+
y: "20",
|
|
245
|
+
width: "30",
|
|
246
|
+
height: "3",
|
|
247
|
+
rx: "1.5",
|
|
248
|
+
fill: "#0F172A",
|
|
249
|
+
opacity: "0.5"
|
|
250
|
+
}), jsx("rect", {
|
|
251
|
+
x: "25",
|
|
252
|
+
y: "35",
|
|
253
|
+
width: "45",
|
|
254
|
+
height: "3",
|
|
255
|
+
rx: "1.5",
|
|
256
|
+
fill: "#0F172A",
|
|
257
|
+
opacity: "0.4"
|
|
258
|
+
}), jsx("rect", {
|
|
259
|
+
x: "25",
|
|
260
|
+
y: "45",
|
|
261
|
+
width: "35",
|
|
262
|
+
height: "3",
|
|
263
|
+
rx: "1.5",
|
|
264
|
+
fill: "#0F172A",
|
|
265
|
+
opacity: "0.3"
|
|
220
266
|
})]
|
|
221
267
|
})
|
|
222
268
|
}];
|
|
223
269
|
function NavigationModes({
|
|
224
270
|
changeSetting,
|
|
225
271
|
settings,
|
|
226
|
-
location
|
|
272
|
+
location,
|
|
273
|
+
routePattern,
|
|
274
|
+
applyToAllRoutes = false
|
|
227
275
|
}) {
|
|
228
276
|
const {
|
|
229
277
|
isMobile
|
|
230
278
|
} = useMediaQuery();
|
|
231
|
-
const currentRoute = location?.pathname || '/';
|
|
232
|
-
const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
|
|
279
|
+
const currentRoute = routePattern || location?.pathname || '/';
|
|
233
280
|
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
234
|
-
|
|
281
|
+
// Get navigation values using the utility function
|
|
282
|
+
const navigationValues = useMemo(() => ({
|
|
283
|
+
navigationMode: getSettingValue(settings, 'navigationMode', applyToAllRoutes, currentRoute, deviceType, 'mixed'),
|
|
284
|
+
sideMenuType: getSettingValue(settings, 'sideMenuType', applyToAllRoutes, currentRoute, deviceType, 'expanded')
|
|
285
|
+
}), [settings, applyToAllRoutes, currentRoute, deviceType]);
|
|
235
286
|
return jsxs("div", {
|
|
236
287
|
className: "space-y-8",
|
|
237
288
|
children: [jsxs("section", {
|
|
@@ -242,13 +293,13 @@ function NavigationModes({
|
|
|
242
293
|
className: "flex flex-row gap-4",
|
|
243
294
|
children: navigationModes.map((mode, index) => jsx("div", {
|
|
244
295
|
className: "relative cursor-pointer hover:opacity-80 transition-opacity shadow-sm dark:shadow-md rounded overflow-hidden",
|
|
245
|
-
onClick: () =>
|
|
246
|
-
|
|
247
|
-
navigationMode
|
|
248
|
-
}
|
|
296
|
+
onClick: () => {
|
|
297
|
+
// Pass simple key - handleSettingChange in SettingDrawer will decide if it's global or route-specific
|
|
298
|
+
changeSetting('navigationMode', mode.key);
|
|
299
|
+
},
|
|
249
300
|
children: jsxs("div", {
|
|
250
301
|
className: "relative",
|
|
251
|
-
children: [mode.svg,
|
|
302
|
+
children: [mode.svg, navigationValues.navigationMode === mode.key && jsx("svg", {
|
|
252
303
|
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
304
|
viewBox: "0 0 24 24",
|
|
254
305
|
fill: "currentColor",
|
|
@@ -267,13 +318,13 @@ function NavigationModes({
|
|
|
267
318
|
className: "flex flex-row gap-4",
|
|
268
319
|
children: menuTypes.map((type, index) => jsx("div", {
|
|
269
320
|
className: "relative cursor-pointer hover:opacity-80 transition-opacity shadow-sm dark:shadow-md rounded overflow-hidden",
|
|
270
|
-
onClick: () =>
|
|
271
|
-
|
|
272
|
-
sideMenuType
|
|
273
|
-
}
|
|
321
|
+
onClick: () => {
|
|
322
|
+
// Pass simple key - handleSettingChange in SettingDrawer will decide if it's global or route-specific
|
|
323
|
+
changeSetting('sideMenuType', type.key);
|
|
324
|
+
},
|
|
274
325
|
children: jsxs("div", {
|
|
275
326
|
className: "relative",
|
|
276
|
-
children: [type.svg,
|
|
327
|
+
children: [type.svg, navigationValues.sideMenuType === type.key && jsx("svg", {
|
|
277
328
|
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
329
|
viewBox: "0 0 24 24",
|
|
279
330
|
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":"gRAIA,MAAM,eAAe,GAAG,CAAA;AACpB,EAAA,GAAA,EAAA,SAAA;AACI,EAAA,KAAA,EAAA,SAAK;AACL,EAAA,GAAA,EAAAA,IAAA,CAAK,KAAE,EAAA;AACP,IAAA,KAAA,EAAG,IACC;AAQP,IAAA,MAAA,EAAA,IAAA;AACD,IAAA,OAAA,EAAA,WAAA;AACI,IAAA,KAAA,EAAG,4BAAU;AACb,IAAA,QAAA,GAAOC,GAAA,CAAA,MAAS,EAAA;AAChB,MAAA,KAAG,EAAE,IACD;AAQP,MAAA,MAAA,EAAA,IAAA;AACD,MAAA,EAAA,EAAA,GAAA;AACI,MAAA,IAAA;AACA,KAAA,CAAA,EAAAA,GAAA,CAAK,MAAE,EAAA;SACP,GAAG;AAaN,MAAA,CAAA,EAAA,GAAA;MACH,KAAA,EAAA,IAAA;AAEF,MAAM,YAAY;AACd,MAAA,IAAA,EAAA;AACI,KAAA,CAAA,EAAAA,IAAK,MAAA,EAAA;AACL,MAAA,CAAA,EAAA,GAAA;SACA,GAAG;AAQN,MAAA,KAAA,EAAA,IAAA;AACD,MAAA,MAAA,EAAA,GAAA;AACI,MAAA,EAAA,EAAA,GAAK;AACL,MAAA,IAAA,EAAA;AACA,KAAA,CAAA,EAAAA,GAAG,CAAE,MACD,EAAA;AAYP,MAAA,CAAA,EAAA,GAAA;MACH,CAAA,EAAA,IAAA;AAEF,MAAA,KAAS,EAAA,IAAO;AAChB,MAAA,MAAS,EAAA,GAAA;AAET,MAAM,EAAC,EAAA,GAAA;AAOH,MAAA,IAAM,EAAE,SAAQ;MAChB,OAAM,EAAA;AACN,KAAA,CAAA,EAAAA,GAAM,CAAA,MAAA,EAAU;MAEhB,CAAA,EAAA,GAAA;AACA,MAAA,CAAA,EAAA;AAEQ,MAAA,KAAA,EAAA,IAAA;AAQA,MAAA,MAAA,EAAA,GAAA;MAQF,EACF,EAAC,GAAA;MAGL,IAAA,EACI;;AAawB,KAAA,CAAA;;;AAgCA,EAAA,GAAA,EAAA,QAAA;;AAqBhC,EAAC,GAAA,EAAAD,IAAA,CAAA,KAAA,EAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -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,2CA4hBrE"}
|