@admin-layout/tailwind-design-pro 11.0.4-alpha.4 → 12.0.16-alpha.1
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 +401 -1
- package/lib/cdm-locales/en/settings.json +40 -1
- package/lib/cdm-locales/es/settings.json +42 -3
- package/lib/components/LanguageMenu/LanguageMenu.d.ts.map +1 -1
- package/lib/components/LanguageMenu/LanguageMenu.js +8 -18
- package/lib/components/LanguageMenu/LanguageMenu.js.map +1 -1
- package/lib/components/Layout/BasicLayout/index.d.ts +1 -8
- package/lib/components/Layout/BasicLayout/index.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/index.js +141 -64
- package/lib/components/Layout/BasicLayout/index.js.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.d.ts.map +1 -1
- package/lib/components/Layout/BasicLayout/utils.js +1 -14
- package/lib/components/Layout/BasicLayout/utils.js.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts +1 -8
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/BottomMenuDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalFooter/Copyright.d.ts.map +1 -1
- package/lib/components/Layout/GlobalFooter/Footer.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.d.ts +1 -14
- package/lib/components/Layout/GlobalHeader/Header.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/Header.js +78 -53
- package/lib/components/Layout/GlobalHeader/Header.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/Logo.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/Logo.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/Logo.js +141 -0
- package/lib/components/Layout/GlobalHeader/Logo.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts +6 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.js +228 -0
- package/lib/components/Layout/GlobalHeader/MainHeader.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts +1 -12
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js +4 -4
- package/lib/components/Layout/GlobalHeader/OrganizationDropdown.js.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts +2 -16
- package/lib/components/Layout/GlobalHeader/RightContent.d.ts.map +1 -1
- package/lib/components/Layout/GlobalHeader/RightContent.js +23 -0
- package/lib/components/Layout/GlobalHeader/RightContent.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.js +274 -0
- package/lib/components/Layout/GlobalHeader/RightMenu.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.d.ts +9 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.d.ts.map +1 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.js +118 -0
- package/lib/components/Layout/GlobalHeader/SearchBar.js.map +1 -0
- package/lib/components/Layout/GlobalHeader/index.d.ts +4 -0
- package/lib/components/Layout/GlobalHeader/index.d.ts.map +1 -0
- package/lib/components/Layout/ProTailwindLayout.d.ts +2 -0
- package/lib/components/Layout/ProTailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/ProTailwindLayout.js +7 -3
- package/lib/components/Layout/ProTailwindLayout.js.map +1 -1
- package/lib/components/Layout/Sidebar/Divider.d.ts +1 -31
- package/lib/components/Layout/Sidebar/Divider.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/Divider.js.map +1 -1
- package/lib/components/Layout/Sidebar/DynamicIcon.d.ts +5 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.d.ts.map +1 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.js +51 -0
- package/lib/components/Layout/Sidebar/DynamicIcon.js.map +1 -0
- package/lib/components/Layout/Sidebar/Sidebar.d.ts +1 -11
- package/lib/components/Layout/Sidebar/Sidebar.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/Sidebar.js +117 -78
- package/lib/components/Layout/Sidebar/Sidebar.js.map +1 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts +3 -5
- package/lib/components/Layout/Sidebar/SidebarMenu.d.ts.map +1 -1
- package/lib/components/Layout/Sidebar/SidebarMenu.js +132 -45
- package/lib/components/Layout/Sidebar/SidebarMenu.js.map +1 -1
- package/lib/components/Layout/TailwindLayout.d.ts.map +1 -1
- package/lib/components/Layout/TailwindLayout.js +34 -14
- package/lib/components/Layout/TailwindLayout.js.map +1 -1
- package/lib/components/Layout/getPageTitle.d.ts +1 -16
- package/lib/components/Layout/getPageTitle.d.ts.map +1 -1
- package/lib/components/Layout/getPageTitle.js +1 -1
- package/lib/components/Layout/getPageTitle.js.map +1 -1
- package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts +4 -0
- package/lib/components/Layout/slot-fill/AdditionalSettings.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/AdditionalSettings.js +7 -0
- package/lib/components/Layout/slot-fill/AdditionalSettings.js.map +1 -0
- package/lib/components/Layout/slot-fill/Footer.d.ts +1 -1
- package/lib/components/Layout/slot-fill/Footer.d.ts.map +1 -1
- package/lib/components/Layout/slot-fill/Footer.js +6 -6
- package/lib/components/Layout/slot-fill/Footer.js.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderNotice.d.ts.map +1 -1
- package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts +3 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.js +6 -0
- package/lib/components/Layout/slot-fill/HeaderSearchBar.js.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts +3 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.js +6 -0
- package/lib/components/Layout/slot-fill/HeaderSearchButton.js.map +1 -0
- package/lib/components/Layout/slot-fill/RightContent.d.ts +3 -0
- package/lib/components/Layout/slot-fill/RightContent.d.ts.map +1 -0
- package/lib/components/Layout/slot-fill/RightContent.js +6 -0
- package/lib/components/Layout/slot-fill/RightContent.js.map +1 -0
- package/lib/components/Layout/slot-fill/index.d.ts +4 -0
- package/lib/components/Layout/slot-fill/index.d.ts.map +1 -1
- package/lib/components/Layout/util.d.ts.map +1 -1
- package/lib/components/Layout/util.js +12 -0
- package/lib/components/Layout/util.js.map +1 -0
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts +1 -6
- package/lib/components/SettingDrawer/CheckBoxTheme.d.ts.map +1 -1
- package/lib/components/SettingDrawer/CheckBoxTheme.js +106 -31
- package/lib/components/SettingDrawer/CheckBoxTheme.js.map +1 -1
- package/lib/components/SettingDrawer/InvitationSettings.d.ts +3 -0
- package/lib/components/SettingDrawer/InvitationSettings.d.ts.map +1 -0
- package/lib/components/SettingDrawer/InvitationSettings.js +79 -0
- package/lib/components/SettingDrawer/InvitationSettings.js.map +1 -0
- package/lib/components/SettingDrawer/LayoutChange.d.ts +2 -6
- package/lib/components/SettingDrawer/LayoutChange.d.ts.map +1 -1
- package/lib/components/SettingDrawer/LayoutChange.js +84 -30
- package/lib/components/SettingDrawer/LayoutChange.js.map +1 -1
- package/lib/components/SettingDrawer/NavigationsModes.d.ts +3 -0
- package/lib/components/SettingDrawer/NavigationsModes.d.ts.map +1 -0
- package/lib/components/SettingDrawer/NavigationsModes.js +289 -0
- package/lib/components/SettingDrawer/NavigationsModes.js.map +1 -0
- package/lib/components/SettingDrawer/RegionalSettings.d.ts +1 -6
- package/lib/components/SettingDrawer/RegionalSettings.d.ts.map +1 -1
- package/lib/components/SettingDrawer/RegionalSettings.js +696 -51
- package/lib/components/SettingDrawer/RegionalSettings.js.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.d.ts +2 -25
- package/lib/components/SettingDrawer/SettingDrawer.d.ts.map +1 -1
- package/lib/components/SettingDrawer/SettingDrawer.js +249 -113
- package/lib/components/SettingDrawer/SettingDrawer.js.map +1 -1
- package/lib/components/SettingDrawer/Switch/index.d.ts +2 -8
- package/lib/components/SettingDrawer/Switch/index.d.ts.map +1 -1
- package/lib/components/SettingDrawer/Switch/index.js +17 -34
- package/lib/components/SettingDrawer/Switch/index.js.map +1 -1
- package/lib/components/SettingDrawer/ThemeColor.d.ts +1 -6
- package/lib/components/SettingDrawer/ThemeColor.d.ts.map +1 -1
- package/lib/components/SettingDrawer/ThemeColor.js +3 -0
- package/lib/components/SettingDrawer/ThemeColor.js.map +1 -1
- package/lib/components/SettingDrawer/ThemeSelector.d.ts +3 -0
- package/lib/components/SettingDrawer/ThemeSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/ThemeSelector.js +18 -0
- package/lib/components/SettingDrawer/ThemeSelector.js.map +1 -0
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts +3 -0
- package/lib/components/SettingDrawer/WebFontsSelector.d.ts.map +1 -0
- package/lib/components/SettingDrawer/WebFontsSelector.js +24 -0
- package/lib/components/SettingDrawer/WebFontsSelector.js.map +1 -0
- package/lib/components/SettingDrawer/types.d.ts +91 -0
- package/lib/components/SettingDrawer/types.d.ts.map +1 -0
- package/lib/components/UI/CardList.d.ts +61 -0
- package/lib/components/UI/CardList.d.ts.map +1 -0
- package/lib/components/UI/CardList.js +43 -0
- package/lib/components/UI/CardList.js.map +1 -0
- package/lib/components/UI/CategoriesTypeList.d.ts +29 -0
- package/lib/components/UI/CategoriesTypeList.d.ts.map +1 -0
- package/lib/components/UI/CategoriesTypeList.js +139 -0
- package/lib/components/UI/CategoriesTypeList.js.map +1 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts +83 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.d.ts.map +1 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.js +107 -0
- package/lib/components/UI/LazyLoadingGoogleMarker.js.map +1 -0
- package/lib/components/UI/Pagination.d.ts +6 -0
- package/lib/components/UI/Pagination.d.ts.map +1 -0
- package/lib/components/UI/Pagination.js +56 -0
- package/lib/components/UI/Pagination.js.map +1 -0
- package/lib/components/UI/ParamSearchResultContainer.d.ts +99 -0
- package/lib/components/UI/ParamSearchResultContainer.d.ts.map +1 -0
- package/lib/components/UI/ParamSearchResultContainer.js +120 -0
- package/lib/components/UI/ParamSearchResultContainer.js.map +1 -0
- package/lib/components/UI/PropertyCard.d.ts +24 -0
- package/lib/components/UI/PropertyCard.d.ts.map +1 -0
- package/lib/components/UI/PropertyCard.js +420 -0
- package/lib/components/UI/PropertyCard.js.map +1 -0
- package/lib/components/UI/PropertyCardOnMap.d.ts +10 -0
- package/lib/components/UI/PropertyCardOnMap.d.ts.map +1 -0
- package/lib/components/UI/PropertyCardOnMap.js +108 -0
- package/lib/components/UI/PropertyCardOnMap.js.map +1 -0
- package/lib/components/UI/VehicleCard/PricePopover.d.ts +8 -0
- package/lib/components/UI/VehicleCard/PricePopover.d.ts.map +1 -0
- package/lib/components/UI/VehicleCard/PricePopover.js +98 -0
- package/lib/components/UI/VehicleCard/PricePopover.js.map +1 -0
- package/lib/components/UI/VehicleCard/VehicleBadge.d.ts +7 -0
- package/lib/components/UI/VehicleCard/VehicleBadge.d.ts.map +1 -0
- package/lib/components/UI/VehicleCard/VehicleFeature.d.ts +9 -0
- package/lib/components/UI/VehicleCard/VehicleFeature.d.ts.map +1 -0
- package/lib/components/UI/VehicleCard/VehicleFeature.js +22 -0
- package/lib/components/UI/VehicleCard/VehicleFeature.js.map +1 -0
- package/lib/components/UI/VehicleCard/types.d.ts +59 -0
- package/lib/components/UI/VehicleCard/types.d.ts.map +1 -0
- package/lib/components/UI/VehicleCard.d.ts +15 -0
- package/lib/components/UI/VehicleCard.d.ts.map +1 -0
- package/lib/components/UI/VehicleCard.js +166 -0
- package/lib/components/UI/VehicleCard.js.map +1 -0
- package/lib/components/UI/VehicleCardList.d.ts +14 -0
- package/lib/components/UI/VehicleCardList.d.ts.map +1 -0
- package/lib/components/UI/VehicleCardList.js +38 -0
- package/lib/components/UI/VehicleCardList.js.map +1 -0
- package/lib/components/UI/VehicleParamSearchResultContainer.d.ts +90 -0
- package/lib/components/UI/VehicleParamSearchResultContainer.d.ts.map +1 -0
- package/lib/components/UI/icons/LocationIcon.d.ts +7 -0
- package/lib/components/UI/icons/LocationIcon.d.ts.map +1 -0
- package/lib/components/UI/icons/LocationIcon.js +18 -0
- package/lib/components/UI/icons/LocationIcon.js.map +1 -0
- package/lib/components/UI/icons/index.d.ts +2 -0
- package/lib/components/UI/icons/index.d.ts.map +1 -0
- package/lib/components/UI/index.d.ts +10 -0
- package/lib/components/UI/index.d.ts.map +1 -0
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts +11 -1
- package/lib/components/UpdateSettingsResource/UpdateSettingsResource.server.d.ts.map +1 -1
- package/lib/components/index.d.ts +3 -0
- package/lib/components/index.d.ts.map +1 -0
- package/lib/components/index.js +1 -0
- package/lib/components/index.js.map +1 -0
- package/lib/components/typings.d.ts +139 -49
- package/lib/components/typings.d.ts.map +1 -1
- package/lib/components/typings.js +6 -0
- package/lib/components/typings.js.map +1 -0
- package/lib/compute.d.ts.map +1 -1
- package/lib/compute.js +6 -4
- package/lib/compute.js.map +1 -1
- package/lib/config/analytics-config.d.ts +59 -0
- package/lib/config/analytics-config.d.ts.map +1 -0
- package/lib/config/constants.d.ts +8 -0
- package/lib/config/constants.d.ts.map +1 -0
- package/lib/config/constants.js +32 -0
- package/lib/config/constants.js.map +1 -0
- package/lib/config/env-config.d.ts +18 -0
- package/lib/config/env-config.d.ts.map +1 -1
- package/lib/config/env-config.js +76 -1
- package/lib/config/env-config.js.map +1 -1
- package/lib/config/index.d.ts +3 -0
- package/lib/config/index.d.ts.map +1 -0
- package/lib/helpers/DynamicIcon.d.ts +7 -4
- package/lib/helpers/DynamicIcon.d.ts.map +1 -1
- package/lib/helpers/DynamicIcon.js +51 -0
- package/lib/helpers/DynamicIcon.js.map +1 -0
- package/lib/hooks/index.d.ts +6 -0
- package/lib/hooks/index.d.ts.map +1 -0
- package/lib/hooks/use-get-current-lat-long.d.ts +18 -0
- package/lib/hooks/use-get-current-lat-long.d.ts.map +1 -0
- package/lib/hooks/use-get-current-lat-long.js +29 -0
- package/lib/hooks/use-get-current-lat-long.js.map +1 -0
- package/lib/hooks/useMediaQuery.d.ts +14 -0
- package/lib/hooks/useMediaQuery.d.ts.map +1 -0
- package/lib/hooks/useMediaQuery.js +48 -0
- package/lib/hooks/useMediaQuery.js.map +1 -0
- package/lib/hooks/useScrollThreshold.d.ts +12 -0
- package/lib/hooks/useScrollThreshold.d.ts.map +1 -0
- package/lib/hooks/useScrollThreshold.js +60 -0
- package/lib/hooks/useScrollThreshold.js.map +1 -0
- package/lib/hooks/useTailwindTheme.d.ts +34 -0
- package/lib/hooks/useTailwindTheme.d.ts.map +1 -0
- package/lib/hooks/useTailwindTheme.js +82 -0
- package/lib/hooks/useTailwindTheme.js.map +1 -0
- package/lib/hooks/useWindowSize.d.ts +6 -0
- package/lib/hooks/useWindowSize.d.ts.map +1 -0
- package/lib/hooks/useWindowSize.js +20 -0
- package/lib/hooks/useWindowSize.js.map +1 -0
- package/lib/icons.d.ts +16 -0
- package/lib/icons.d.ts.map +1 -0
- package/lib/icons.js +12 -0
- package/lib/icons.js.map +1 -0
- package/lib/index.d.ts +2 -3
- 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 +6 -0
- package/lib/machines/settingsMachine.d.ts.map +1 -0
- package/lib/machines/settingsMachine.js +206 -0
- package/lib/machines/settingsMachine.js.map +1 -0
- package/lib/machines/types.d.ts +174 -0
- package/lib/machines/types.d.ts.map +1 -0
- package/lib/machines/types.js +5 -0
- package/lib/machines/types.js.map +1 -0
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts +6 -0
- package/lib/middlewares/airbnbDatasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts +6 -0
- package/lib/middlewares/bookingCarRentalMiddleware.d.ts.map +1 -0
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts +7 -0
- package/lib/middlewares/bookingDatasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/datasourcesMiddleware.d.ts +6 -0
- package/lib/middlewares/datasourcesMiddleware.d.ts.map +1 -0
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts +7 -0
- package/lib/middlewares/pricelineDatasourcesMiddleware.d.ts.map +1 -0
- package/lib/module.d.ts +0 -1
- package/lib/module.d.ts.map +1 -1
- package/lib/module.js +14 -15
- package/lib/module.js.map +1 -1
- package/lib/redux/index.d.ts +2 -0
- package/lib/redux/index.d.ts.map +1 -0
- package/lib/redux/searchReducer.d.ts +42 -0
- package/lib/redux/searchReducer.d.ts.map +1 -0
- package/lib/redux/searchReducer.js +64 -0
- package/lib/redux/searchReducer.js.map +1 -0
- package/lib/routes.json +1 -0
- package/lib/styles/index.css +667 -45
- package/lib/tailwindConfig.d.ts +100 -0
- package/lib/tailwindConfig.d.ts.map +1 -0
- package/lib/tailwindConfig.js +101 -0
- package/lib/tailwindConfig.js.map +1 -0
- package/lib/utils/analytics-utils.d.ts +43 -0
- package/lib/utils/analytics-utils.d.ts.map +1 -0
- package/lib/utils/analytics.d.ts +48 -0
- package/lib/utils/analytics.d.ts.map +1 -0
- package/lib/utils/formateCarData.d.ts +2 -0
- package/lib/utils/formateCarData.d.ts.map +1 -0
- package/lib/utils/menu.d.ts.map +1 -1
- package/lib/utils/test-utils.d.ts.map +1 -1
- package/lib/utils/utils/index.d.ts.map +1 -1
- package/package.json +7 -5
- package/lib/components/Layout/GlobalFooter/Copyright.js +0 -8
- package/lib/components/Layout/GlobalFooter/Copyright.js.map +0 -1
- package/lib/components/Layout/GlobalFooter/Footer.js +0 -22
- package/lib/components/Layout/GlobalFooter/Footer.js.map +0 -1
- package/lib/components/defaultSettings.d.ts +0 -4
- package/lib/components/defaultSettings.d.ts.map +0 -1
- package/lib/components/defaultSettings.js +0 -14
- package/lib/components/defaultSettings.js.map +0 -1
- package/lib/utils/index.d.ts +0 -2
- package/lib/utils/index.d.ts.map +0 -1
- package/lib/utils/index.js +0 -13
- package/lib/utils/index.js.map +0 -1
|
@@ -1,21 +1,45 @@
|
|
|
1
|
-
import {jsxs,jsx}from'react/jsx-runtime';import React__default,{useState,useEffect}from'react';import {
|
|
1
|
+
import {jsxs,jsx}from'react/jsx-runtime';import React__default,{useState,useEffect}from'react';import {useTranslation}from'react-i18next';import BottomMenuDropDown from'../GlobalFooter/BottomMenuDropdown.js';import {getMenuSeparation}from'@admin-layout/client';import {Divider}from'./Divider.js';import {SidebarMenu}from'./SidebarMenu.js';import {RightContent}from'../GlobalHeader/RightContent.js';import {icons}from'../../../icons.js';import'@react-icons/all-files/fa/FaMoon.js';import'@react-icons/all-files/fa/FaSun.js';import'../../../hooks/use-get-current-lat-long.js';import {useMediaQuery}from'../../../hooks/useMediaQuery.js';const Sidebar = props => {
|
|
2
2
|
const {
|
|
3
3
|
isSideMenuOpen,
|
|
4
4
|
closeSideMenu,
|
|
5
5
|
menuData,
|
|
6
6
|
collapsed,
|
|
7
7
|
routeParams,
|
|
8
|
-
settings
|
|
8
|
+
settings,
|
|
9
|
+
setCollapsed,
|
|
10
|
+
location
|
|
9
11
|
} = props;
|
|
10
12
|
const [isPagesMenuOpen, setIsPagesMenuOpen] = useState(false);
|
|
11
13
|
const [iconModule, setIconModule] = React__default.useState(null);
|
|
12
|
-
const {
|
|
13
|
-
isDarkMode
|
|
14
|
-
} = useTheme();
|
|
15
14
|
const {
|
|
16
15
|
t,
|
|
17
16
|
i18n
|
|
18
17
|
} = useTranslation('menu');
|
|
18
|
+
const {
|
|
19
|
+
isMobile
|
|
20
|
+
} = useMediaQuery();
|
|
21
|
+
const {
|
|
22
|
+
ChevronLeftIcon,
|
|
23
|
+
ChevronRightIcon
|
|
24
|
+
} = icons;
|
|
25
|
+
const currentRoute = location?.pathname || '/';
|
|
26
|
+
const routeSettings = settings?.routeSettings?.[currentRoute] || settings?.routeSettings?.['/'] || settings;
|
|
27
|
+
const deviceType = isMobile ? 'mobile' : 'desktop';
|
|
28
|
+
const deviceLayout = routeSettings?.layout?.[deviceType] || {};
|
|
29
|
+
useEffect(() => {
|
|
30
|
+
if (!iconModule) {
|
|
31
|
+
import('./DynamicIcon.js').then(module => {
|
|
32
|
+
setIconModule(module);
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
}, []);
|
|
36
|
+
const toggleCollapsed = () => {
|
|
37
|
+
if (isMobile) {
|
|
38
|
+
closeSideMenu();
|
|
39
|
+
} else {
|
|
40
|
+
setCollapsed(!collapsed);
|
|
41
|
+
}
|
|
42
|
+
};
|
|
19
43
|
// Close sidebar when clicking outside on mobile
|
|
20
44
|
useEffect(() => {
|
|
21
45
|
const handleClickOutside = event => {
|
|
@@ -41,8 +65,14 @@ import {jsxs,jsx}from'react/jsx-runtime';import React__default,{useState,useEffe
|
|
|
41
65
|
document.removeEventListener('keydown', handleEscape);
|
|
42
66
|
};
|
|
43
67
|
}, [isSideMenuOpen, closeSideMenu]);
|
|
44
|
-
const
|
|
45
|
-
|
|
68
|
+
const {
|
|
69
|
+
upperMenus,
|
|
70
|
+
middleMenus,
|
|
71
|
+
lowerMenus,
|
|
72
|
+
bottomMenus
|
|
73
|
+
} = getMenuSeparation(menuData || []);
|
|
74
|
+
const updateMenuIcons = (menuItems = []) => {
|
|
75
|
+
if (!menuItems || !Array.isArray(menuItems)) return [];
|
|
46
76
|
return menuItems.map(item => {
|
|
47
77
|
const updatedItem = {
|
|
48
78
|
...item,
|
|
@@ -55,86 +85,95 @@ import {jsxs,jsx}from'react/jsx-runtime';import React__default,{useState,useEffe
|
|
|
55
85
|
return updatedItem;
|
|
56
86
|
});
|
|
57
87
|
};
|
|
58
|
-
const
|
|
59
|
-
menuData: updateMenuIcons(
|
|
88
|
+
const bottomMenusData = {
|
|
89
|
+
menuData: updateMenuIcons(bottomMenus)
|
|
90
|
+
};
|
|
91
|
+
// Use CSS classes instead of theme-based styling
|
|
92
|
+
const getSidebarClasses = () => {
|
|
93
|
+
let classes = 'text-gray-500 dark:text-gray-400 md:h-[93vh] h-full flex flex-col';
|
|
94
|
+
if (settings?.navTheme === 'realDark') {
|
|
95
|
+
classes += ' themed-sidebar';
|
|
96
|
+
}
|
|
97
|
+
return classes;
|
|
60
98
|
};
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
children:
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
className: "
|
|
82
|
-
children:
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
99
|
+
const SidebarStyles = React__default.useMemo(() => ({
|
|
100
|
+
backgroundColor: settings?.navTheme === 'realDark' ? '#222' : '',
|
|
101
|
+
color: settings?.navTheme === 'realDark' ? '#fff !important' : ''
|
|
102
|
+
}), [settings]);
|
|
103
|
+
// Helper function to render a separator with a name
|
|
104
|
+
const renderSeparator = name => {
|
|
105
|
+
if (!deviceLayout?.splitMenus) return null;
|
|
106
|
+
return collapsed ? jsx("hr", {
|
|
107
|
+
className: "border-t border-border"
|
|
108
|
+
}) : jsx(Divider, {
|
|
109
|
+
className: "text-muted-foreground border-border my-2 p-0",
|
|
110
|
+
plain: true,
|
|
111
|
+
children: name
|
|
112
|
+
});
|
|
113
|
+
};
|
|
114
|
+
const renderSidebarContent = () => {
|
|
115
|
+
return jsxs("div", {
|
|
116
|
+
className: getSidebarClasses(),
|
|
117
|
+
style: SidebarStyles,
|
|
118
|
+
children: [jsx("div", {
|
|
119
|
+
className: "relative",
|
|
120
|
+
children: jsx("button", {
|
|
121
|
+
onClick: toggleCollapsed,
|
|
122
|
+
className: "w-6 h-6 text-center bg-card text-muted-foreground flex items-center justify-center rounded-full shadow-themed-sm hover:text-foreground hover:shadow-themed-md transition-colors text-[22px] absolute right-[-13px] top-[20px]",
|
|
123
|
+
"aria-label": collapsed ? 'Expand sidebar' : 'Collapse sidebar',
|
|
124
|
+
children: collapsed ? jsx(ChevronRightIcon, {
|
|
125
|
+
fontSize: '11px'
|
|
126
|
+
}) : jsx(ChevronLeftIcon, {
|
|
127
|
+
fontSize: '11px'
|
|
128
|
+
})
|
|
129
|
+
})
|
|
130
|
+
}), jsxs("div", {
|
|
131
|
+
className: "flex-grow overflow-y-auto",
|
|
132
|
+
children: [middleMenus?.length > 0 && jsxs("div", {
|
|
133
|
+
className: "removeBoxShadow",
|
|
134
|
+
children: [renderSeparator(deviceLayout?.middleMenuDividerName), jsx(SidebarMenu, {
|
|
135
|
+
menuData: updateMenuIcons(middleMenus),
|
|
136
|
+
routeParams: routeParams,
|
|
137
|
+
settings: settings,
|
|
138
|
+
collapsed: collapsed
|
|
139
|
+
})]
|
|
140
|
+
}), lowerMenus?.length > 0 && jsxs("div", {
|
|
141
|
+
className: "removeBoxShadow",
|
|
142
|
+
children: [renderSeparator(deviceLayout?.lowerMenuDividerName), jsx(SidebarMenu, {
|
|
143
|
+
menuData: updateMenuIcons(lowerMenus),
|
|
144
|
+
routeParams: routeParams,
|
|
145
|
+
settings: settings,
|
|
146
|
+
collapsed: collapsed
|
|
147
|
+
})]
|
|
148
|
+
}), jsx("div", {
|
|
149
|
+
className: "p-4",
|
|
150
|
+
children: deviceLayout?.navigationMode === 'sidebar' && jsx(RightContent, {
|
|
151
|
+
upperMenus: upperMenus,
|
|
152
|
+
collapsed: collapsed,
|
|
153
|
+
routeParams: routeParams,
|
|
154
|
+
settings: settings
|
|
155
|
+
})
|
|
103
156
|
})]
|
|
104
157
|
}), jsx("div", {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
flexDirection: 'column'
|
|
111
|
-
},
|
|
112
|
-
className: "removeBoxShadow",
|
|
113
|
-
children: jsx(SidebarMenu, {
|
|
114
|
-
menuData: updateMenuIcons(lowerMenus),
|
|
115
|
-
routeParams: routeParams,
|
|
116
|
-
settings: settings
|
|
158
|
+
className: "flex-shrink-0 p-4 border-t border-border",
|
|
159
|
+
children: jsx(BottomMenuDropDown, {
|
|
160
|
+
menus: bottomMenusData,
|
|
161
|
+
collapsed: collapsed,
|
|
162
|
+
routeParams: routeParams
|
|
117
163
|
})
|
|
118
164
|
})]
|
|
119
|
-
})
|
|
120
|
-
|
|
121
|
-
children: jsx(BottomMenuDropDown, {
|
|
122
|
-
menus: bottomMenus,
|
|
123
|
-
collapsed: collapsed,
|
|
124
|
-
routeParams: routeParams
|
|
125
|
-
})
|
|
126
|
-
})]
|
|
127
|
-
});
|
|
165
|
+
});
|
|
166
|
+
};
|
|
128
167
|
return jsxs("div", {
|
|
129
|
-
children: [jsx("aside", {
|
|
130
|
-
className:
|
|
168
|
+
children: [!isMobile && jsx("aside", {
|
|
169
|
+
className: `${deviceLayout?.fixedSidebar ? 'fixed' : 'relative'} border-r border-border z-20 h-screen bg-card text-card-foreground md:block flex-shrink-0 transition-all duration-300 ease-in-out ${collapsed ? 'w-16' : 'w-64'}`,
|
|
131
170
|
children: renderSidebarContent()
|
|
132
|
-
}), isSideMenuOpen && jsx("div", {
|
|
133
|
-
className: "fixed inset-0 z-10 flex items-end bg-black bg-opacity-50 sm:items-center sm:justify-center",
|
|
171
|
+
}), isSideMenuOpen && isMobile && jsx("div", {
|
|
172
|
+
className: "fixed inset-0 z-10 flex items-end bg-black bg-opacity-50 sm:items-center sm:justify-center transition-opacity duration-300",
|
|
134
173
|
onClick: closeSideMenu
|
|
135
|
-
}), isSideMenuOpen && jsx("aside", {
|
|
174
|
+
}), isSideMenuOpen && isMobile && jsx("aside", {
|
|
136
175
|
id: "mobile-sidebar",
|
|
137
|
-
className:
|
|
176
|
+
className: `fixed inset-0 z-20 flex-shrink-0 bg-card text-card-foreground md:hidden transition-transform duration-300 ease-in-out transform ${collapsed ? 'w-16' : 'w-64'}`,
|
|
138
177
|
children: renderSidebarContent()
|
|
139
178
|
})]
|
|
140
179
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sidebar.js","sources":["../../../../src/components/Layout/Sidebar/Sidebar.tsx"],"sourcesContent":[null],"names":["React"
|
|
1
|
+
{"version":3,"file":"Sidebar.js","sources":["../../../../src/components/Layout/Sidebar/Sidebar.tsx"],"sourcesContent":[null],"names":["React"],"mappings":"0nBAaa,MAAA,OAAO,GAA2B,KAAC,IAAS;AACrD,EAAA,MAAA;IACA,cAAsB;AACtB,IAAA,aAAO;IACP,QAAQ;AACR,IAAA,SAAgB;AAChB,IAAA,WAAuB;AACvB,IAAA;AACA,IAAA;IACA;MACM,KAAA;QAEG,CAAA,eAAM,EAAA,kBAAA,CAAA,GAAA,QAAA,CAAA,KAAA,CAAA;QACX,CAAI,UAAW,EAAA,aAAG,CAAA,GAAAA,cAAA,CAAA,QAAA,CAAA,IAAA,CAAA;;;AAGd,IAAA;oBACH,CAAA,MAAA,CAAA;QACA;IACL;mBACQ;AACA,EAAA,MAAA;mBACH;;AACG,GAAA,GAAA,KAAA;QACJ,YAAC,GAAA,QAAA,EAAA,QAAA,IAAA,GAAA;AACL,EAAA,MAAE,aAAA,GAAA,QAAA,EAAA,aAAA,GAA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cAAA,EAAA,aAAA,CAAA,CAAA;QACI;IAEN,UAAiD;IACjD,WAAM;cACE;AAEJ,IAAA;uBACe;QACf,eAAC,GAAA,CAAA,SAAA,GAAA,EAAA,KAAA;AAED,IAAA,IAAA,CAAA,aAAc,CAAC,KAAA,CAAA,OAAA,CAAA,SAAA,CAAA,EAAA,OAAA,EAAA;AACnB,IAAA,OAAE,SAAA,CAAA,GAAA,CAAA,IAAA,IAAA;MACI,MAAA,WAAa,GAAG;AAGV,QAAA,GAAA,IAAA;AACA,QAAA,IAAA,EAAO,CAAA,CAAA,IAAA,CAAA,IAAU,CAAA;AACI,QAC7B,IAAS,EAAA,UACX,IAAA,IAAA,CAAA,IAAA,GAAA,UAAA,CAAA,iBAAA,CAAA,IAAA,CAAA,IAAA,CAAA,GAAA;OAEkD;AACpD,MAAA,IAAM,WAAe,CAAA,QAAI,EAAA;QACrB,WAAiB,CAAA,QAAY,GAAA,eAAA,CAAA,WAAA,CAAA,QAAA,CAAA;AAAE;aAExB,WAAS;AAOpB,KAAC,CAAC;;QAGE;AAwDJ,IAAA,QAAE,EAAA,eAAA,CAAA,WAAA;AAEF,GAAA;AAoCJ;AAEA,EAAA,MAAA,iBAAuB,GAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
settings: any;
|
|
5
|
-
}) => import("react/jsx-runtime").JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SidebarMenuProps } from '../../typings';
|
|
3
|
+
export declare const SidebarMenu: React.FC<SidebarMenuProps>;
|
|
6
4
|
//# sourceMappingURL=SidebarMenu.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Sidebar/SidebarMenu.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarMenu.d.ts","sourceRoot":"","sources":["../../../../src/components/Layout/Sidebar/SidebarMenu.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA8B,MAAM,OAAO,CAAC;AAKnD,OAAO,EAAE,gBAAgB,EAAE,MAAM,eAAe,CAAC;AAEjD,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAAC,gBAAgB,CA0NlD,CAAC"}
|
|
@@ -1,88 +1,175 @@
|
|
|
1
|
-
import {jsx,jsxs}from'react/jsx-runtime';import {useState}from'react';import {
|
|
1
|
+
import {jsx,jsxs}from'react/jsx-runtime';import {useState}from'react';import {useLocation,Link}from'@remix-run/react';import {generateMenuPath}from'@admin-layout/client';import {icons}from'../../../icons.js';const SidebarMenu = ({
|
|
2
2
|
menuData,
|
|
3
3
|
routeParams,
|
|
4
|
-
settings
|
|
4
|
+
settings,
|
|
5
|
+
collapsed
|
|
5
6
|
}) => {
|
|
6
|
-
|
|
7
|
-
const [
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
const [openMenus, setOpenMenus] = useState([]);
|
|
8
|
+
const [hoveredMenu, setHoveredMenu] = useState(null);
|
|
9
|
+
const [popupPosition, setPopupPosition] = useState({
|
|
10
|
+
top: 0,
|
|
11
|
+
height: 0
|
|
12
|
+
});
|
|
13
|
+
const {
|
|
14
|
+
ChevronDownIcon,
|
|
15
|
+
ChevronUpIcon
|
|
16
|
+
} = icons;
|
|
17
|
+
const location = useLocation();
|
|
18
|
+
const isMenuItemActive = itemPath => {
|
|
19
|
+
const currentPath = location.pathname;
|
|
20
|
+
const menuPath = generateMenuPath(itemPath, routeParams);
|
|
21
|
+
// Exact match
|
|
22
|
+
if (currentPath === menuPath) {
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
// Check if current path is a child of the menu item path
|
|
26
|
+
if (menuPath && currentPath.startsWith(menuPath + '/')) {
|
|
27
|
+
return true;
|
|
28
|
+
}
|
|
29
|
+
return false;
|
|
30
|
+
};
|
|
10
31
|
const toggleMenu = (path, depth, e) => {
|
|
11
|
-
// Prevent link navigation when clicking on a parent menu with children
|
|
12
32
|
e.preventDefault();
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
newState[depth] = null;
|
|
33
|
+
if (collapsed) return;
|
|
34
|
+
setOpenMenus(prev => {
|
|
35
|
+
if (prev.includes(path)) {
|
|
36
|
+
return prev.filter(item => item !== path);
|
|
37
|
+
} else {
|
|
38
|
+
return [...prev, path];
|
|
20
39
|
}
|
|
21
|
-
// Otherwise, close any other menu at this depth level and open this one
|
|
22
|
-
else {
|
|
23
|
-
newState[depth] = path;
|
|
24
|
-
}
|
|
25
|
-
return newState;
|
|
26
40
|
});
|
|
27
41
|
};
|
|
28
42
|
const handleMenuClick = (path, hasChildren, depth, e) => {
|
|
29
|
-
if (hasChildren) {
|
|
43
|
+
if (hasChildren && !collapsed) {
|
|
30
44
|
toggleMenu(path, depth, e);
|
|
31
|
-
} else {
|
|
32
|
-
// For leaf items, set as active and allow navigation
|
|
33
|
-
setActivePath(path);
|
|
34
45
|
}
|
|
35
46
|
};
|
|
36
|
-
const
|
|
47
|
+
const getFirstLetter = name => {
|
|
48
|
+
return name.charAt(0).toUpperCase();
|
|
49
|
+
};
|
|
50
|
+
const handleMenuHover = (e, item, isHoverMenu) => {
|
|
51
|
+
// Only set hover state if the menu has children
|
|
52
|
+
if (collapsed && !isHoverMenu && item.children && item.children.length > 0) {
|
|
53
|
+
const element = e.currentTarget;
|
|
54
|
+
const rect = element.getBoundingClientRect();
|
|
55
|
+
let top = rect.top;
|
|
56
|
+
// Store the height to use for positioning
|
|
57
|
+
setPopupPosition({
|
|
58
|
+
top: top,
|
|
59
|
+
height: rect.height
|
|
60
|
+
});
|
|
61
|
+
setHoveredMenu(item.path);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
const handleMenuLeave = (item, isHoverMenu) => {
|
|
65
|
+
if (collapsed && !isHoverMenu) {
|
|
66
|
+
setHoveredMenu(null);
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const renderPopupMenu = (item, depth = 0) => {
|
|
70
|
+
if (!item.children || item.children.length === 0) return null;
|
|
71
|
+
const sidebarWidth = collapsed ? 64 : 256; // 80px for collapsed (w-20), 256px for expanded (w-64)
|
|
72
|
+
return jsxs("div", {
|
|
73
|
+
className: "fixed shadow-themed-xl rounded-themed-lg border border-border z-[999] overflow-hidden themed-dropdown",
|
|
74
|
+
style: {
|
|
75
|
+
left: `${sidebarWidth}px`,
|
|
76
|
+
// Position right after sidebar
|
|
77
|
+
top: `${popupPosition.top}px`,
|
|
78
|
+
animation: 'fadeIn 0.2s ease-out forwards',
|
|
79
|
+
maxWidth: 'calc(100vw - 100px)',
|
|
80
|
+
// Prevent overflow on small screens
|
|
81
|
+
width: 'max-content',
|
|
82
|
+
minWidth: '220px'
|
|
83
|
+
},
|
|
84
|
+
children: [jsx("style", {
|
|
85
|
+
dangerouslySetInnerHTML: {
|
|
86
|
+
__html: `
|
|
87
|
+
@keyframes fadeIn {
|
|
88
|
+
from { opacity: 0; transform: translateX(-10px); }
|
|
89
|
+
to { opacity: 1; transform: translateX(0); }
|
|
90
|
+
}
|
|
91
|
+
`
|
|
92
|
+
}
|
|
93
|
+
}), jsx("div", {
|
|
94
|
+
className: "font-medium text-sm px-4 py-3 border-b border-border whitespace-nowrap bg-muted",
|
|
95
|
+
children: jsx("span", {
|
|
96
|
+
className: "text-primary",
|
|
97
|
+
children: item.name
|
|
98
|
+
})
|
|
99
|
+
}), jsx("div", {
|
|
100
|
+
className: "max-h-[400px] overflow-y-auto overflow-x-hidden py-1",
|
|
101
|
+
children: item.children.map(child => jsx("div", {
|
|
102
|
+
className: "w-full min-w-max",
|
|
103
|
+
children: renderMenuItem(child, depth + 1, true)
|
|
104
|
+
}, child.path))
|
|
105
|
+
})]
|
|
106
|
+
});
|
|
107
|
+
};
|
|
108
|
+
const renderMenuItem = (item, depth = 0, isHoverMenu = false) => {
|
|
37
109
|
const hasChildren = item.children && item.children.length > 0;
|
|
38
|
-
const isOpen =
|
|
39
|
-
const isActive =
|
|
110
|
+
const isOpen = openMenus.includes(item.path);
|
|
111
|
+
const isActive = isMenuItemActive(item.path);
|
|
112
|
+
const isHovered = hoveredMenu === item.path;
|
|
40
113
|
const paddingLeft = `${depth * 1}rem`;
|
|
41
|
-
// Determine
|
|
42
|
-
|
|
114
|
+
// Determine styling based on whether it's a parent or child item
|
|
115
|
+
const isParentWithChildren = hasChildren && depth === 0;
|
|
116
|
+
const shouldApplyBackground = isActive && !isParentWithChildren || isHovered;
|
|
43
117
|
return jsxs("div", {
|
|
44
|
-
className:
|
|
118
|
+
className: `w-full relative group ${isHovered && collapsed && !isHoverMenu ? `rounded-themed` : ''}`,
|
|
119
|
+
style: {
|
|
120
|
+
backgroundColor: isHovered && !isHoverMenu ? 'hsl(var(--muted))' : ''
|
|
121
|
+
},
|
|
122
|
+
onMouseEnter: e => handleMenuHover(e, item, isHoverMenu),
|
|
123
|
+
onMouseLeave: () => handleMenuLeave(item, isHoverMenu),
|
|
45
124
|
children: [jsxs(Link, {
|
|
46
|
-
to: generateMenuPath(item?.path, routeParams),
|
|
47
|
-
className: `flex items-center justify-between w-full px-
|
|
125
|
+
to: hasChildren && collapsed && !isHoverMenu ? '#' : generateMenuPath(item?.path, routeParams),
|
|
126
|
+
className: `flex items-center justify-between w-full px-1 py-2 hover:bg-muted text-sm cursor-pointer transition-colors rounded-themed mx-1 my-0.5 whitespace-nowrap overflow-hidden text-ellipsis ${shouldApplyBackground ? 'bg-muted' : ''}`,
|
|
48
127
|
style: {
|
|
49
|
-
paddingLeft: `calc(1rem + ${paddingLeft})
|
|
50
|
-
backgroundColor: isActive ? bgColor : ''
|
|
128
|
+
paddingLeft: `calc(1rem + ${paddingLeft})`
|
|
51
129
|
},
|
|
52
130
|
onClick: e => handleMenuClick(item.path, hasChildren, depth, e),
|
|
53
131
|
children: [jsxs("div", {
|
|
54
|
-
className:
|
|
55
|
-
children: [item.icon
|
|
132
|
+
className: `flex items-center ${collapsed && !isHoverMenu ? 'justify-center w-full' : 'gap-3'}`,
|
|
133
|
+
children: [item.icon ? jsx("span", {
|
|
134
|
+
className: `flex-shrink-0 ${isActive ? 'text-primary' : 'text-muted-foreground'}`,
|
|
56
135
|
style: {
|
|
57
|
-
color: isActive
|
|
136
|
+
color: !isActive && settings?.navTheme === 'realDark' ? '#fff' : undefined
|
|
58
137
|
},
|
|
59
138
|
children: item.icon
|
|
60
|
-
})
|
|
61
|
-
className: `
|
|
139
|
+
}) : collapsed && !isHoverMenu ? jsx("span", {
|
|
140
|
+
className: `flex items-center justify-center flex-shrink-0 ${isActive ? 'text-primary' : 'text-muted-foreground'}`,
|
|
141
|
+
style: {
|
|
142
|
+
color: !isActive && settings?.navTheme === 'realDark' ? '#fff' : undefined
|
|
143
|
+
},
|
|
144
|
+
children: getFirstLetter(item.name)
|
|
145
|
+
}) : null, (!collapsed || isHoverMenu) && jsx("span", {
|
|
146
|
+
className: `font-medium whitespace-nowrap overflow-hidden text-ellipsis ${isActive ? 'text-primary' : 'text-foreground'}`,
|
|
62
147
|
style: {
|
|
63
|
-
color: isActive
|
|
148
|
+
color: !isActive && settings?.navTheme === 'realDark' ? '#fff' : undefined
|
|
64
149
|
},
|
|
65
150
|
children: item.name
|
|
66
151
|
})]
|
|
67
|
-
}), hasChildren && jsx("span", {
|
|
152
|
+
}), hasChildren && (!collapsed || isHoverMenu) && jsx("span", {
|
|
153
|
+
className: `flex-shrink-0 ml-1 ${isActive ? 'text-primary' : 'text-muted-foreground'}`,
|
|
68
154
|
style: {
|
|
69
|
-
color: isActive
|
|
155
|
+
color: !isActive && settings?.navTheme === 'realDark' ? '#fff' : undefined
|
|
70
156
|
},
|
|
71
|
-
children: isOpen ? jsx(
|
|
157
|
+
children: isOpen ? jsx(ChevronUpIcon, {
|
|
72
158
|
className: "h-4 w-4"
|
|
73
|
-
}) : jsx(
|
|
159
|
+
}) : jsx(ChevronDownIcon, {
|
|
74
160
|
className: "h-4 w-4"
|
|
75
161
|
})
|
|
76
162
|
})]
|
|
77
|
-
}), hasChildren && isOpen && jsx("div", {
|
|
163
|
+
}), collapsed && hasChildren && isHovered && !isHoverMenu && item.children.length > 0 && renderPopupMenu(item, depth), hasChildren && isOpen && !collapsed && jsx("div", {
|
|
78
164
|
className: "transition-all duration-200 ease-in-out",
|
|
79
165
|
children: item.children.map(child => renderMenuItem(child, depth + 1))
|
|
80
166
|
})]
|
|
81
167
|
}, item.path);
|
|
82
168
|
};
|
|
83
169
|
return jsx("div", {
|
|
170
|
+
className: "overflow-hidden",
|
|
84
171
|
children: jsx("nav", {
|
|
85
|
-
className:
|
|
172
|
+
className: `mt-2 ${collapsed ? 'px-1' : 'px-2'} overflow-x-hidden`,
|
|
86
173
|
children: menuData.map(item => renderMenuItem(item))
|
|
87
174
|
})
|
|
88
175
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SidebarMenu.js","sources":["../../../../src/components/Layout/Sidebar/SidebarMenu.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SidebarMenu.js","sources":["../../../../src/components/Layout/Sidebar/SidebarMenu.tsx"],"sourcesContent":[null],"names":["_jsxs","_jsx"],"mappings":"gNAOO,MAAM,WAAW,GAA+B,CAAC;UAC9C;aACY;AAClB,EAAA,QAAM;AACN,EAAA;AACA,CAAA,KAAA;AAEA,EAAA,MAAA,CAAA,SAAsB,EAAA,YAAI,CAAA,GAAA,QAAoB,CAAA,EAAA,CAAA;AAC1C,EAAA,MAAA,CAAA,WAAiB,EAAA,cAAW,CAAC,WAAS,CAAA,IAAA,CAAA;QACtC,CAAM,aAAQ,kBAAmB,CAAA,WAAW,CAAA;SAE9B,CAAA;AACd,IAAA,MAAA,EAAI;AACA,GAAA,CAAA;QACJ;mBAEyD;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AAAA,GAAA,CAAA,KAAA,EAAA;AACT,UAAA,SAAA,EAAC,kBAAW;AACZ,UAAA,QAAA,EAAA,cAAc,CAAA,KAAM,OAAI,GAAA,CAAA,EAAA,IAAA;qBACT,CAAA;AAU/B,OAAE,CAAA;AAEF,KAAA,CAAA;AAOJ,GAAE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TailwindLayout.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/TailwindLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;
|
|
1
|
+
{"version":3,"file":"TailwindLayout.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/TailwindLayout.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAqB,MAAM,sBAAsB,CAAC;AAG3E,OAAO,KAA+B,MAAM,OAAO,CAAC;AACpD,OAAO,EAAE,kBAAkB,EAAE,cAAc,EAAwB,MAAM,aAAa,CAAC;AAsEvF,KAAK,cAAc,GAAG,cAAc,CAAC,OAAO,SAAS,CAAC,CAAC;AAEvD,QAAA,MAAM,SAAS;;;0EAAoB,CAAC;AAEpC,KAAK,+BAA+B,GAAG,gBAAgB,GAAG,cAAc,CAAC;AAEzE,QAAA,MAAM,mBAAmB,EAAE,kBAAkB,CACzC,KAAK,CAAC,mBAAmB,CAAC,CAAC,KAAK,EAAE,+BAA+B,KAAK,GAAG,CAAC,OAAO,CAAC,EAClF,GAAG,CAC8C,CAAC;AAEtD,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,34 +1,54 @@
|
|
|
1
|
-
import {jsx}from'react/jsx-runtime';import {useLayoutSettings}from'@admin-layout/client';import {userSelector}from'@adminide-stack/user-auth0-client';import React__default,{useMemo}from'react';import {connect,useSelector}from'react-redux';import {BasicLayout}from'./BasicLayout/index.js';function BasicLayoutWithAuthorities(props) {
|
|
1
|
+
import {jsx}from'react/jsx-runtime';import {useLayoutSettings}from'@admin-layout/client';import {userSelector}from'@adminide-stack/user-auth0-client';import {useMachine}from'@xstate/react';import React__default,{useMemo,useCallback}from'react';import {connect,useSelector}from'react-redux';import {settingsMachine}from'../../machines/settingsMachine.js';import {TailwindThemeProvider}from'@admin-layout/tailwind-ui';import {BasicLayout}from'./BasicLayout/index.js';import {useRouteLoaderData}from'@remix-run/react';function BasicLayoutWithAuthorities(props) {
|
|
2
2
|
const userData = useSelector(userSelector);
|
|
3
|
+
const {
|
|
4
|
+
settings: settingsFromLoader
|
|
5
|
+
} = useRouteLoaderData('root');
|
|
3
6
|
const {
|
|
4
7
|
settings,
|
|
5
8
|
setSettings
|
|
6
9
|
} = useLayoutSettings();
|
|
7
|
-
|
|
10
|
+
const [state, send, settingsActor] = useMachine(settingsMachine.provide({
|
|
11
|
+
actions: {
|
|
12
|
+
updateReduxSettings: ({
|
|
13
|
+
context
|
|
14
|
+
}) => {
|
|
15
|
+
setSettings(context);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}), {
|
|
19
|
+
input: {
|
|
20
|
+
settings: settingsFromLoader
|
|
21
|
+
}
|
|
22
|
+
});
|
|
23
|
+
const settingXstate = state?.context;
|
|
8
24
|
const {
|
|
9
25
|
permissions
|
|
10
26
|
} = props;
|
|
11
27
|
const mainHeaderProps = useMemo(() => ({
|
|
12
28
|
picture: userData ? userData?.profile?.picture : null
|
|
13
29
|
}), [userData]);
|
|
14
|
-
const onSettingChange = config => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
};
|
|
30
|
+
const onSettingChange = useCallback(config => {
|
|
31
|
+
// Update Redux first
|
|
32
|
+
setSettings(config);
|
|
33
|
+
}, [setSettings]);
|
|
19
34
|
//@ts-ignore
|
|
20
35
|
const {
|
|
21
36
|
routeParams: {
|
|
22
37
|
orgName
|
|
23
38
|
} = {}
|
|
24
39
|
} = props;
|
|
25
|
-
return jsx(
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
40
|
+
return jsx(TailwindThemeProvider, {
|
|
41
|
+
settings: settingXstate,
|
|
42
|
+
actor: settingsActor,
|
|
43
|
+
children: jsx(BasicLayout, {
|
|
44
|
+
routeParams: orgName,
|
|
45
|
+
authorities: permissions?.resolveConfiguration ?? permissions,
|
|
46
|
+
onSettingChange: onSettingChange,
|
|
47
|
+
mainHeaderProps: mainHeaderProps,
|
|
48
|
+
actor: settingsActor,
|
|
49
|
+
...props,
|
|
50
|
+
settings: settingXstate
|
|
51
|
+
})
|
|
32
52
|
});
|
|
33
53
|
}
|
|
34
54
|
const mapState = ({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TailwindLayout.js","sources":["../../../src/components/Layout/TailwindLayout.tsx"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TailwindLayout.js","sources":["../../../src/components/Layout/TailwindLayout.tsx"],"sourcesContent":[null],"names":[],"mappings":"mgBAUA,SAAS,0BAA0B,CAAC,KAAgF,EAAA;AAChH,EAAA,MAAA,WAAiB,WAAA,CAAA,YAAY,CAAA;QACvB;IACN,QAAQ;AAER,GAAA,GAAA,kBAAoB,CAAA,MAAA,CAAA;AAEZ,EAAA,MAAA;AACI,IAAA,QAAA;;uBAEC,EAAA;AACJ,EAAA,MAAA,CAAA,KAAA,EAAA,IAAA,EAAA,aAAA,CAAA,GAAA,UAAA,CAAA,eAAA,CAAA,OAAA,CAAA;AACJ,IAAA,OACD,EAAA;AACI,MAAA,mBAAO,EAAA,CAAA;AACH,QAAA;AACH,OAAA,KAAA;AACJ,QACH,WAAA,CAAA,OAAA,CAAA;AAEF;AAEA;AAEA,GAAA,CAAA,EAAA;AAEQ,IAAA,KAAA,EAAA;AACH,MAAC,QACO,EAAA;AAGb;;QAGQ,aAAkB,GAAA,KAAE,EAAA,OAAA;AACxB,EAAA,MACC;IAGL;MACM,KAAA;QAEC,eACmB,GAAA,OAAA,CAAA,OAAA;AAY9B,IAAC,OAAA,EAAA,QAAA,GAAA,QAAA,EAAA,OAAA,EAAA,OAAA,GAAA;AAED,GAAM,CAAA,EAAA,CAAA,QAAW,CAAA,CAAA;QACL,eAAA,GAAA,WAAA,CAAA,MAAA,IAAA;;AAEX,IAAE,WAAA,CAAA,MAAA,CAAA;AAMH,GAAA,EAAA,CAAM,WAAY,CAAA,CAAA;AAIlB;AAKA,EAAA,MAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,19 +1,4 @@
|
|
|
1
|
-
import { MenuDataItem } from '
|
|
2
|
-
import { ProSettings } from '../defaultSettings';
|
|
3
|
-
export interface GetPageTitleProps {
|
|
4
|
-
pathname?: string;
|
|
5
|
-
breadcrumb?: {
|
|
6
|
-
[path: string]: MenuDataItem;
|
|
7
|
-
};
|
|
8
|
-
breadcrumbMap?: Map<string, MenuDataItem>;
|
|
9
|
-
menu?: ProSettings['menu'];
|
|
10
|
-
title?: ProSettings['title'];
|
|
11
|
-
pageName?: string;
|
|
12
|
-
formatMessage?: (data: {
|
|
13
|
-
id: any;
|
|
14
|
-
defaultMessage?: string;
|
|
15
|
-
}) => string;
|
|
16
|
-
}
|
|
1
|
+
import { GetPageTitleProps, MenuDataItem } from '@admin-layout/client';
|
|
17
2
|
export declare const matchParamsPath: (pathname: string, breadcrumb?: {
|
|
18
3
|
[path: string]: MenuDataItem;
|
|
19
4
|
}, breadcrumbMap?: Map<string, MenuDataItem>) => MenuDataItem;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getPageTitle.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/getPageTitle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"getPageTitle.d.ts","sourceRoot":"","sources":["../../../src/components/Layout/getPageTitle.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEvE,eAAO,MAAM,eAAe,GACxB,UAAU,MAAM,EAChB,aAAa;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY,CAAA;CAAE,EAC7C,gBAAgB,GAAG,CAAC,MAAM,EAAE,YAAY,CAAC,KAC1C,YAQF,CAAC;AAEF,QAAA,MAAM,gBAAgB,GAClB,OAAO,iBAAiB,EACxB,aAAa,OAAO,KACrB;IAEC,KAAK,EAAE,MAAM,CAAC;IAEd,EAAE,EAAE,MAAM,CAAC;IAEX,QAAQ,EAAE,MAAM,CAAC;CAiDpB,CAAC;AAEF,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
|