@abpjs/theme-basic 2.9.0 → 3.1.0
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/dist/components/nav-items/CurrentUserComponent.d.ts +53 -0
- package/dist/components/nav-items/LanguagesComponent.d.ts +48 -0
- package/dist/components/nav-items/NavItemsComponent.d.ts +10 -18
- package/dist/components/nav-items/index.d.ts +2 -0
- package/dist/components/routes/RoutesComponent.d.ts +1 -1
- package/dist/enums/components.d.ts +11 -0
- package/dist/enums/index.d.ts +5 -0
- package/dist/enums/navigation-element-names.d.ts +4 -0
- package/dist/index.d.ts +13 -2
- package/dist/index.js +331 -87
- package/dist/index.mjs +328 -70
- package/dist/providers/index.d.ts +2 -0
- package/dist/providers/nav-item.provider.d.ts +55 -0
- package/dist/providers/styles.provider.d.ts +72 -0
- package/dist/services/index.d.ts +5 -0
- package/dist/services/layout-state.service.d.ts +10 -0
- package/package.json +6 -6
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,17 @@ var eThemeBasicComponents = {
|
|
|
5
5
|
EmptyLayout: "Theme.EmptyLayoutComponent",
|
|
6
6
|
Logo: "Theme.LogoComponent",
|
|
7
7
|
Routes: "Theme.RoutesComponent",
|
|
8
|
-
NavItems: "Theme.NavItemsComponent"
|
|
8
|
+
NavItems: "Theme.NavItemsComponent",
|
|
9
|
+
/**
|
|
10
|
+
* Component key for the current user nav item.
|
|
11
|
+
* @since 3.0.0
|
|
12
|
+
*/
|
|
13
|
+
CurrentUser: "Theme.CurrentUserComponent",
|
|
14
|
+
/**
|
|
15
|
+
* Component key for the languages nav item.
|
|
16
|
+
* @since 3.0.0
|
|
17
|
+
*/
|
|
18
|
+
Languages: "Theme.LanguagesComponent"
|
|
9
19
|
};
|
|
10
20
|
|
|
11
21
|
// src/enums/navigation-element-names.ts
|
|
@@ -777,9 +787,9 @@ function LayoutApplication({
|
|
|
777
787
|
const navigate = useNavigate();
|
|
778
788
|
const { logout } = useAuth2();
|
|
779
789
|
const { direction, isRtl } = useDirection4();
|
|
780
|
-
const
|
|
781
|
-
const
|
|
782
|
-
const
|
|
790
|
+
const _logoComponentKey = eThemeBasicComponents.Logo;
|
|
791
|
+
const _routesComponentKey = eThemeBasicComponents.Routes;
|
|
792
|
+
const _navItemsComponentKey = eThemeBasicComponents.NavItems;
|
|
783
793
|
const [isChangePasswordOpen, setIsChangePasswordOpen] = useState5(false);
|
|
784
794
|
const [isProfileOpen, setIsProfileOpen] = useState5(false);
|
|
785
795
|
const handleLogout = useCallback3(() => {
|
|
@@ -963,70 +973,214 @@ function LogoComponent({ style, linkTo }) {
|
|
|
963
973
|
}
|
|
964
974
|
|
|
965
975
|
// src/components/nav-items/NavItemsComponent.tsx
|
|
966
|
-
import
|
|
967
|
-
import { Stack as Stack3 } from "@chakra-ui/react";
|
|
968
|
-
import {
|
|
976
|
+
import { useCallback as useCallback4 } from "react";
|
|
977
|
+
import { Stack as Stack3, Box as Box9 } from "@chakra-ui/react";
|
|
978
|
+
import { useNavItems } from "@abpjs/theme-shared";
|
|
969
979
|
import { jsx as jsx18 } from "react/jsx-runtime";
|
|
970
980
|
function NavItemsComponent({
|
|
971
|
-
smallScreen = false
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
981
|
+
smallScreen: _smallScreen = false
|
|
982
|
+
}) {
|
|
983
|
+
const navItems = useNavItems();
|
|
984
|
+
const _trackByFn = useCallback4((item) => {
|
|
985
|
+
return item.id;
|
|
986
|
+
}, []);
|
|
987
|
+
const renderNavItem = useCallback4((item) => {
|
|
988
|
+
if (item.component) {
|
|
989
|
+
const Component = item.component;
|
|
990
|
+
return /* @__PURE__ */ jsx18(Component, {}, item.id);
|
|
991
|
+
}
|
|
992
|
+
if (item.html) {
|
|
993
|
+
return /* @__PURE__ */ jsx18(
|
|
994
|
+
Box9,
|
|
995
|
+
{
|
|
996
|
+
dangerouslySetInnerHTML: { __html: item.html }
|
|
997
|
+
},
|
|
998
|
+
item.id
|
|
999
|
+
);
|
|
1000
|
+
}
|
|
1001
|
+
if (item.action) {
|
|
1002
|
+
return /* @__PURE__ */ jsx18(
|
|
1003
|
+
Box9,
|
|
1004
|
+
{
|
|
1005
|
+
as: "button",
|
|
1006
|
+
onClick: item.action,
|
|
1007
|
+
cursor: "pointer",
|
|
1008
|
+
width: "full"
|
|
1009
|
+
},
|
|
1010
|
+
item.id
|
|
1011
|
+
);
|
|
1012
|
+
}
|
|
1013
|
+
return null;
|
|
1014
|
+
}, []);
|
|
1015
|
+
return /* @__PURE__ */ jsx18(Stack3, { gap: 2, width: "full", children: navItems.map((item) => renderNavItem(item)) });
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
// src/components/nav-items/CurrentUserComponent.tsx
|
|
1019
|
+
import { useCallback as useCallback5, useMemo as useMemo6 } from "react";
|
|
1020
|
+
import {
|
|
1021
|
+
Avatar as Avatar2,
|
|
1022
|
+
Box as Box10,
|
|
1023
|
+
HStack as HStack6,
|
|
1024
|
+
Menu as Menu3,
|
|
1025
|
+
Portal as Portal4,
|
|
1026
|
+
Text as Text5,
|
|
1027
|
+
Button as Button5
|
|
1028
|
+
} from "@chakra-ui/react";
|
|
1029
|
+
import { LuEllipsisVertical as LuEllipsisVertical2, LuKey as LuKey2, LuLogOut as LuLogOut2, LuUser as LuUser2, LuLogIn as LuLogIn2 } from "react-icons/lu";
|
|
1030
|
+
import { useConfig as useConfig4, useAuth as useAuth3, useDirection as useDirection6, useLocalization as useLocalization3 } from "@abpjs/core";
|
|
1031
|
+
import { Link as RouterLink5, useNavigate as useNavigate2 } from "react-router-dom";
|
|
1032
|
+
import { jsx as jsx19, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
1033
|
+
function CurrentUserComponent({
|
|
1034
|
+
smallScreen: _smallScreen = false,
|
|
1035
|
+
loginUrl = "/account/login",
|
|
1036
|
+
profileUrl = "/account/manage",
|
|
1037
|
+
changePasswordUrl = "/account/manage",
|
|
1038
|
+
containerStyle,
|
|
1039
|
+
menuZIndex = 1400
|
|
1040
|
+
}) {
|
|
1041
|
+
const { currentUser } = useConfig4();
|
|
1042
|
+
const { isAuthenticated, logout: authLogout } = useAuth3();
|
|
1043
|
+
const { endSide } = useDirection6();
|
|
1044
|
+
const { t } = useLocalization3();
|
|
1045
|
+
const navigate = useNavigate2();
|
|
1046
|
+
const handleLogout = useCallback5(() => {
|
|
1047
|
+
authLogout();
|
|
1048
|
+
}, [authLogout]);
|
|
1049
|
+
const handleProfile = useCallback5(() => {
|
|
1050
|
+
navigate(profileUrl);
|
|
1051
|
+
}, [navigate, profileUrl]);
|
|
1052
|
+
const handleChangePassword = useCallback5(() => {
|
|
1053
|
+
navigate(changePasswordUrl);
|
|
1054
|
+
}, [navigate, changePasswordUrl]);
|
|
1055
|
+
const initials = useMemo6(() => {
|
|
1056
|
+
const userName = currentUser?.userName || "";
|
|
1057
|
+
return userName.slice(0, 2).toUpperCase();
|
|
1058
|
+
}, [currentUser?.userName]);
|
|
1059
|
+
if (!isAuthenticated || !currentUser) {
|
|
1060
|
+
return /* @__PURE__ */ jsx19(Button5, { asChild: true, variant: "outline", width: "full", children: /* @__PURE__ */ jsxs12(RouterLink5, { to: loginUrl, children: [
|
|
1061
|
+
/* @__PURE__ */ jsx19(LuLogIn2, {}),
|
|
1062
|
+
t("AbpAccount::Login")
|
|
1063
|
+
] }) });
|
|
1064
|
+
}
|
|
1065
|
+
return /* @__PURE__ */ jsxs12(HStack6, { gap: "3", justify: "space-between", css: containerStyle, children: [
|
|
1066
|
+
/* @__PURE__ */ jsxs12(HStack6, { gap: "3", children: [
|
|
1067
|
+
/* @__PURE__ */ jsx19(Avatar2.Root, { size: "sm", children: /* @__PURE__ */ jsx19(Avatar2.Fallback, { children: initials }) }),
|
|
1068
|
+
/* @__PURE__ */ jsx19(Box10, { children: /* @__PURE__ */ jsx19(Text5, { textStyle: "sm", fontWeight: "medium", children: currentUser.userName }) })
|
|
1069
|
+
] }),
|
|
1070
|
+
/* @__PURE__ */ jsxs12(Menu3.Root, { positioning: { placement: `${endSide}-start` }, children: [
|
|
1071
|
+
/* @__PURE__ */ jsx19(Menu3.Trigger, { asChild: true, children: /* @__PURE__ */ jsx19(
|
|
1072
|
+
Box10,
|
|
1073
|
+
{
|
|
1074
|
+
as: "button",
|
|
1075
|
+
p: "2",
|
|
1076
|
+
borderRadius: "md",
|
|
1077
|
+
cursor: "pointer",
|
|
1078
|
+
_hover: { bg: "colorPalette.subtle" },
|
|
1079
|
+
"aria-label": "User menu",
|
|
1080
|
+
children: /* @__PURE__ */ jsx19(LuEllipsisVertical2, {})
|
|
1081
|
+
}
|
|
1082
|
+
) }),
|
|
1083
|
+
/* @__PURE__ */ jsx19(Portal4, { children: /* @__PURE__ */ jsx19(Menu3.Positioner, { style: { zIndex: menuZIndex }, children: /* @__PURE__ */ jsxs12(Menu3.Content, { children: [
|
|
1084
|
+
/* @__PURE__ */ jsxs12(Menu3.Item, { value: "profile", onClick: handleProfile, children: [
|
|
1085
|
+
/* @__PURE__ */ jsx19(LuUser2, {}),
|
|
1086
|
+
t("AbpUi::PersonalInfo")
|
|
1087
|
+
] }),
|
|
1088
|
+
/* @__PURE__ */ jsxs12(Menu3.Item, { value: "change-password", onClick: handleChangePassword, children: [
|
|
1089
|
+
/* @__PURE__ */ jsx19(LuKey2, {}),
|
|
1090
|
+
t("AbpUi::ChangePassword")
|
|
1091
|
+
] }),
|
|
1092
|
+
/* @__PURE__ */ jsxs12(Menu3.Item, { value: "logout", onClick: handleLogout, color: "red.500", children: [
|
|
1093
|
+
/* @__PURE__ */ jsx19(LuLogOut2, {}),
|
|
1094
|
+
t("AbpUi::Logout")
|
|
1095
|
+
] })
|
|
1096
|
+
] }) }) })
|
|
1097
|
+
] })
|
|
1098
|
+
] });
|
|
1099
|
+
}
|
|
1100
|
+
|
|
1101
|
+
// src/components/nav-items/LanguagesComponent.tsx
|
|
1102
|
+
import { useCallback as useCallback6, useMemo as useMemo7 } from "react";
|
|
1103
|
+
import {
|
|
1104
|
+
Button as Button6,
|
|
1105
|
+
HStack as HStack7,
|
|
1106
|
+
Menu as Menu4,
|
|
1107
|
+
Portal as Portal5,
|
|
1108
|
+
Text as Text6
|
|
1109
|
+
} from "@chakra-ui/react";
|
|
1110
|
+
import { LuChevronDown as LuChevronDown3, LuGlobe as LuGlobe2 } from "react-icons/lu";
|
|
1111
|
+
import { useConfig as useConfig5, useSession as useSession2 } from "@abpjs/core";
|
|
1112
|
+
import { jsx as jsx20, jsxs as jsxs13 } from "react/jsx-runtime";
|
|
1113
|
+
function LanguagesComponent({
|
|
1114
|
+
smallScreen: _smallScreen = false,
|
|
1115
|
+
compact = false,
|
|
1116
|
+
containerStyle,
|
|
1117
|
+
menuZIndex = 1400
|
|
975
1118
|
}) {
|
|
976
|
-
const {
|
|
977
|
-
const { isAuthenticated } = useAuth3();
|
|
1119
|
+
const { localization } = useConfig5();
|
|
978
1120
|
const { language, setLanguage } = useSession2();
|
|
979
|
-
const
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
1121
|
+
const languages = useMemo7(() => {
|
|
1122
|
+
return localization?.languages || [];
|
|
1123
|
+
}, [localization]);
|
|
1124
|
+
const currentLanguage = useMemo7(() => {
|
|
1125
|
+
return languages.find((lang) => lang.cultureName === language);
|
|
1126
|
+
}, [languages, language]);
|
|
1127
|
+
const defaultLanguage = useMemo7(() => {
|
|
1128
|
+
return currentLanguage?.displayName || currentLanguage?.cultureName || "";
|
|
1129
|
+
}, [currentLanguage]);
|
|
1130
|
+
const dropdownLanguages = useMemo7(() => {
|
|
1131
|
+
return languages.filter((lang) => lang.cultureName !== language);
|
|
1132
|
+
}, [languages, language]);
|
|
1133
|
+
const _selectedLangCulture = language || "";
|
|
1134
|
+
const handleChangeLang = useCallback6(
|
|
988
1135
|
(cultureName) => {
|
|
989
1136
|
setLanguage(cultureName);
|
|
990
1137
|
window.location.reload();
|
|
991
1138
|
},
|
|
992
1139
|
[setLanguage]
|
|
993
1140
|
);
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
}
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
}
|
|
1019
|
-
}
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1141
|
+
if (languages.length <= 1) {
|
|
1142
|
+
return null;
|
|
1143
|
+
}
|
|
1144
|
+
return /* @__PURE__ */ jsxs13(Menu4.Root, { children: [
|
|
1145
|
+
/* @__PURE__ */ jsx20(Menu4.Trigger, { asChild: true, children: /* @__PURE__ */ jsx20(
|
|
1146
|
+
Button6,
|
|
1147
|
+
{
|
|
1148
|
+
variant: "ghost",
|
|
1149
|
+
width: "full",
|
|
1150
|
+
justifyContent: "start",
|
|
1151
|
+
gap: "3",
|
|
1152
|
+
color: "fg.muted",
|
|
1153
|
+
css: containerStyle,
|
|
1154
|
+
_hover: {
|
|
1155
|
+
bg: "colorPalette.subtle",
|
|
1156
|
+
color: "colorPalette.fg"
|
|
1157
|
+
},
|
|
1158
|
+
children: /* @__PURE__ */ jsxs13(HStack7, { justifyContent: "space-between", width: "full", children: [
|
|
1159
|
+
/* @__PURE__ */ jsxs13(HStack7, { gap: "3", children: [
|
|
1160
|
+
/* @__PURE__ */ jsx20(LuGlobe2, {}),
|
|
1161
|
+
!compact && /* @__PURE__ */ jsx20(Text6, { children: defaultLanguage })
|
|
1162
|
+
] }),
|
|
1163
|
+
/* @__PURE__ */ jsx20(LuChevronDown3, {})
|
|
1164
|
+
] })
|
|
1165
|
+
}
|
|
1166
|
+
) }),
|
|
1167
|
+
/* @__PURE__ */ jsx20(Portal5, { children: /* @__PURE__ */ jsx20(Menu4.Positioner, { style: { zIndex: menuZIndex }, children: /* @__PURE__ */ jsx20(Menu4.Content, { children: dropdownLanguages.map((lang) => /* @__PURE__ */ jsx20(
|
|
1168
|
+
Menu4.Item,
|
|
1169
|
+
{
|
|
1170
|
+
value: lang.cultureName,
|
|
1171
|
+
onClick: () => handleChangeLang(lang.cultureName),
|
|
1172
|
+
children: lang.displayName || lang.cultureName
|
|
1173
|
+
},
|
|
1174
|
+
lang.cultureName
|
|
1175
|
+
)) }) }) })
|
|
1176
|
+
] });
|
|
1023
1177
|
}
|
|
1024
1178
|
|
|
1025
1179
|
// src/components/routes/RoutesComponent.tsx
|
|
1026
|
-
import { useMemo as
|
|
1180
|
+
import { useMemo as useMemo8 } from "react";
|
|
1027
1181
|
import { Stack as Stack4 } from "@chakra-ui/react";
|
|
1028
|
-
import { useConfig as
|
|
1029
|
-
import { jsx as
|
|
1182
|
+
import { useConfig as useConfig6, useDirection as useDirection7 } from "@abpjs/core";
|
|
1183
|
+
import { jsx as jsx21 } from "react/jsx-runtime";
|
|
1030
1184
|
function getVisibleRoutes2(routes) {
|
|
1031
1185
|
return routes.reduce((acc, val) => {
|
|
1032
1186
|
if (val.invisible) {
|
|
@@ -1040,35 +1194,35 @@ function getVisibleRoutes2(routes) {
|
|
|
1040
1194
|
}, []);
|
|
1041
1195
|
}
|
|
1042
1196
|
function RoutesComponent({
|
|
1043
|
-
smallScreen = false,
|
|
1197
|
+
smallScreen: _smallScreen = false,
|
|
1044
1198
|
defaultIcon,
|
|
1045
1199
|
routes: customRoutes
|
|
1046
1200
|
}) {
|
|
1047
|
-
const { routes: configRoutes } =
|
|
1048
|
-
const { direction } =
|
|
1201
|
+
const { routes: configRoutes } = useConfig6();
|
|
1202
|
+
const { direction } = useDirection7();
|
|
1049
1203
|
const routes = customRoutes || configRoutes || [];
|
|
1050
|
-
const
|
|
1204
|
+
const _visibleRoutes = useMemo8(() => {
|
|
1051
1205
|
return getVisibleRoutes2(routes);
|
|
1052
1206
|
}, [routes]);
|
|
1053
|
-
const
|
|
1207
|
+
const _trackByFn = (index, item) => {
|
|
1054
1208
|
return item.name || item.path || index;
|
|
1055
1209
|
};
|
|
1056
|
-
return /* @__PURE__ */
|
|
1210
|
+
return /* @__PURE__ */ jsx21(Stack4, { gap: "1", dir: direction, children: /* @__PURE__ */ jsx21(NavLinks, { defaultIcon }) });
|
|
1057
1211
|
}
|
|
1058
1212
|
|
|
1059
1213
|
// src/providers/ThemeBasicProvider.tsx
|
|
1060
|
-
import { useEffect
|
|
1214
|
+
import { useEffect } from "react";
|
|
1061
1215
|
import { ThemeSharedProvider, defineConfig } from "@abpjs/theme-shared";
|
|
1062
|
-
import { useSession as useSession3, useDirection as
|
|
1063
|
-
import { Fragment as Fragment4, jsx as
|
|
1216
|
+
import { useSession as useSession3, useDirection as useDirection8 } from "@abpjs/core";
|
|
1217
|
+
import { Fragment as Fragment4, jsx as jsx22 } from "react/jsx-runtime";
|
|
1064
1218
|
function LocaleSync({ children }) {
|
|
1065
1219
|
const { language } = useSession3();
|
|
1066
|
-
const { direction } =
|
|
1067
|
-
|
|
1220
|
+
const { direction } = useDirection8();
|
|
1221
|
+
useEffect(() => {
|
|
1068
1222
|
document.documentElement.dir = direction;
|
|
1069
1223
|
document.documentElement.lang = language || "en";
|
|
1070
1224
|
}, [direction, language]);
|
|
1071
|
-
return /* @__PURE__ */
|
|
1225
|
+
return /* @__PURE__ */ jsx22(Fragment4, { children });
|
|
1072
1226
|
}
|
|
1073
1227
|
function ThemeBasicInner({
|
|
1074
1228
|
children,
|
|
@@ -1085,7 +1239,7 @@ function ThemeBasicInner({
|
|
|
1085
1239
|
}) {
|
|
1086
1240
|
const { language } = useSession3();
|
|
1087
1241
|
const locale = language || "en-US";
|
|
1088
|
-
return /* @__PURE__ */
|
|
1242
|
+
return /* @__PURE__ */ jsx22(
|
|
1089
1243
|
ThemeSharedProvider,
|
|
1090
1244
|
{
|
|
1091
1245
|
renderToasts,
|
|
@@ -1095,14 +1249,14 @@ function ThemeBasicInner({
|
|
|
1095
1249
|
enableColorMode,
|
|
1096
1250
|
defaultColorMode,
|
|
1097
1251
|
locale,
|
|
1098
|
-
children: /* @__PURE__ */
|
|
1252
|
+
children: /* @__PURE__ */ jsx22(LocaleSync, { children: /* @__PURE__ */ jsx22(
|
|
1099
1253
|
BrandingProvider,
|
|
1100
1254
|
{
|
|
1101
1255
|
logo,
|
|
1102
1256
|
logoIcon,
|
|
1103
1257
|
appName,
|
|
1104
1258
|
logoLink,
|
|
1105
|
-
children: /* @__PURE__ */
|
|
1259
|
+
children: /* @__PURE__ */ jsx22(LayoutProvider, { children })
|
|
1106
1260
|
}
|
|
1107
1261
|
) })
|
|
1108
1262
|
}
|
|
@@ -1176,7 +1330,7 @@ function ThemeBasicProvider({
|
|
|
1176
1330
|
logoLink
|
|
1177
1331
|
}) {
|
|
1178
1332
|
const mergedThemeOverrides = themeOverrides || defaultThemeBasicConfig;
|
|
1179
|
-
return /* @__PURE__ */
|
|
1333
|
+
return /* @__PURE__ */ jsx22(
|
|
1180
1334
|
ThemeBasicInner,
|
|
1181
1335
|
{
|
|
1182
1336
|
renderToasts,
|
|
@@ -1194,15 +1348,113 @@ function ThemeBasicProvider({
|
|
|
1194
1348
|
);
|
|
1195
1349
|
}
|
|
1196
1350
|
|
|
1351
|
+
// src/providers/nav-item.provider.ts
|
|
1352
|
+
import { getNavItemsService } from "@abpjs/theme-shared";
|
|
1353
|
+
function configureNavItems(navItems) {
|
|
1354
|
+
return () => {
|
|
1355
|
+
navItems.addItems([
|
|
1356
|
+
{
|
|
1357
|
+
id: eThemeBasicComponents.Languages,
|
|
1358
|
+
component: LanguagesComponent,
|
|
1359
|
+
order: 100
|
|
1360
|
+
},
|
|
1361
|
+
{
|
|
1362
|
+
id: eThemeBasicComponents.CurrentUser,
|
|
1363
|
+
component: CurrentUserComponent,
|
|
1364
|
+
order: 200
|
|
1365
|
+
}
|
|
1366
|
+
]);
|
|
1367
|
+
};
|
|
1368
|
+
}
|
|
1369
|
+
var BASIC_THEME_NAV_ITEM_PROVIDERS = {
|
|
1370
|
+
configureNavItems
|
|
1371
|
+
};
|
|
1372
|
+
function initializeThemeBasicNavItems() {
|
|
1373
|
+
const navItemsService = getNavItemsService();
|
|
1374
|
+
configureNavItems(navItemsService)();
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
// src/providers/styles.provider.ts
|
|
1378
|
+
var THEME_BASIC_STYLES = `
|
|
1379
|
+
/* Content header styles */
|
|
1380
|
+
.content-header-title {
|
|
1381
|
+
font-size: 24px;
|
|
1382
|
+
}
|
|
1383
|
+
|
|
1384
|
+
.entry-row {
|
|
1385
|
+
margin-bottom: 15px;
|
|
1386
|
+
}
|
|
1387
|
+
|
|
1388
|
+
/* Input validation styles */
|
|
1389
|
+
.input-validation-error {
|
|
1390
|
+
border-color: #dc3545;
|
|
1391
|
+
}
|
|
1392
|
+
|
|
1393
|
+
.field-validation-error {
|
|
1394
|
+
font-size: 0.8em;
|
|
1395
|
+
}
|
|
1396
|
+
|
|
1397
|
+
/* Table styles */
|
|
1398
|
+
.ui-table .ui-table-tbody > tr.empty-row > div.empty-row-content {
|
|
1399
|
+
border: 1px solid #c8c8c8;
|
|
1400
|
+
}
|
|
1401
|
+
|
|
1402
|
+
.ui-table .pagination-wrapper {
|
|
1403
|
+
background-color: #f4f4f4;
|
|
1404
|
+
border: 1px solid #c8c8c8;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/* Bordered datatable styles (added in v3.0.0) */
|
|
1408
|
+
.bordered .datatable-body-row {
|
|
1409
|
+
border-top: 1px solid #eee;
|
|
1410
|
+
margin-top: -1px;
|
|
1411
|
+
}
|
|
1412
|
+
|
|
1413
|
+
/* Loading overlay */
|
|
1414
|
+
.abp-loading {
|
|
1415
|
+
background: rgba(0, 0, 0, 0.1);
|
|
1416
|
+
}
|
|
1417
|
+
|
|
1418
|
+
/* Modal backdrop */
|
|
1419
|
+
.modal-backdrop {
|
|
1420
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
1421
|
+
}
|
|
1422
|
+
`;
|
|
1423
|
+
function injectThemeBasicStyles() {
|
|
1424
|
+
const existingStyle = document.getElementById("abpjs-theme-basic-styles");
|
|
1425
|
+
if (existingStyle) {
|
|
1426
|
+
return;
|
|
1427
|
+
}
|
|
1428
|
+
const styleElement = document.createElement("style");
|
|
1429
|
+
styleElement.id = "abpjs-theme-basic-styles";
|
|
1430
|
+
styleElement.textContent = THEME_BASIC_STYLES;
|
|
1431
|
+
document.head.appendChild(styleElement);
|
|
1432
|
+
}
|
|
1433
|
+
function configureStyles() {
|
|
1434
|
+
return () => {
|
|
1435
|
+
injectThemeBasicStyles();
|
|
1436
|
+
};
|
|
1437
|
+
}
|
|
1438
|
+
var BASIC_THEME_STYLES_PROVIDERS = {
|
|
1439
|
+
configureStyles
|
|
1440
|
+
};
|
|
1441
|
+
function initializeThemeBasicStyles() {
|
|
1442
|
+
configureStyles()();
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1197
1445
|
// src/index.ts
|
|
1198
1446
|
var LAYOUTS = [LayoutApplication, LayoutAccount, LayoutEmpty];
|
|
1199
1447
|
export {
|
|
1448
|
+
BASIC_THEME_NAV_ITEM_PROVIDERS,
|
|
1449
|
+
BASIC_THEME_STYLES_PROVIDERS,
|
|
1200
1450
|
Block,
|
|
1201
1451
|
BrandingProvider,
|
|
1202
1452
|
ChangePassword,
|
|
1453
|
+
CurrentUserComponent,
|
|
1203
1454
|
DefaultLogo,
|
|
1204
1455
|
LAYOUTS,
|
|
1205
1456
|
LanguageSelector,
|
|
1457
|
+
LanguagesComponent,
|
|
1206
1458
|
LayoutAccount,
|
|
1207
1459
|
LayoutApplication,
|
|
1208
1460
|
LayoutBase,
|
|
@@ -1222,12 +1474,18 @@ export {
|
|
|
1222
1474
|
SearchProvider,
|
|
1223
1475
|
Sidebar,
|
|
1224
1476
|
SidebarLink,
|
|
1477
|
+
THEME_BASIC_STYLES,
|
|
1225
1478
|
ThemeBasicProvider,
|
|
1226
1479
|
UserProfile,
|
|
1480
|
+
configureNavItems,
|
|
1481
|
+
configureStyles,
|
|
1227
1482
|
defaultThemeBasicConfig,
|
|
1228
1483
|
defineConfig,
|
|
1229
1484
|
eNavigationElementNames,
|
|
1230
1485
|
eThemeBasicComponents,
|
|
1486
|
+
initializeThemeBasicNavItems,
|
|
1487
|
+
initializeThemeBasicStyles,
|
|
1488
|
+
injectThemeBasicStyles,
|
|
1231
1489
|
useBranding,
|
|
1232
1490
|
useLayoutContext,
|
|
1233
1491
|
useLayoutService,
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Nav Item Provider
|
|
3
|
+
* Translated from @abp/ng.theme.basic/lib/providers/nav-item.provider.ts v3.0.0
|
|
4
|
+
*
|
|
5
|
+
* Provides nav item configuration for the theme-basic module.
|
|
6
|
+
* Uses NavItemsService from @abpjs/theme-shared to register nav items.
|
|
7
|
+
*
|
|
8
|
+
* @since 3.0.0
|
|
9
|
+
*/
|
|
10
|
+
import { NavItemsService } from '@abpjs/theme-shared';
|
|
11
|
+
/**
|
|
12
|
+
* Configures the basic theme nav items.
|
|
13
|
+
* This function is called during app initialization to register
|
|
14
|
+
* the default nav items (Languages and CurrentUser).
|
|
15
|
+
*
|
|
16
|
+
* @param navItems - The NavItemsService instance
|
|
17
|
+
* @returns A function that performs the nav item configuration
|
|
18
|
+
* @since 3.0.0
|
|
19
|
+
*/
|
|
20
|
+
export declare function configureNavItems(navItems: NavItemsService): () => void;
|
|
21
|
+
/**
|
|
22
|
+
* Basic theme nav item providers for initialization.
|
|
23
|
+
* Use this in your app setup to configure theme-basic nav items.
|
|
24
|
+
*
|
|
25
|
+
* In React, you typically call this during app initialization:
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* ```tsx
|
|
29
|
+
* import { initializeThemeBasicNavItems } from '@abpjs/theme-basic';
|
|
30
|
+
*
|
|
31
|
+
* // In your app initialization
|
|
32
|
+
* initializeThemeBasicNavItems();
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @since 3.0.0
|
|
36
|
+
*/
|
|
37
|
+
export declare const BASIC_THEME_NAV_ITEM_PROVIDERS: {
|
|
38
|
+
configureNavItems: typeof configureNavItems;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* Initialize theme basic nav items.
|
|
42
|
+
* Call this function during app initialization to register the
|
|
43
|
+
* default Languages and CurrentUser nav items.
|
|
44
|
+
*
|
|
45
|
+
* @since 3.0.0
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```tsx
|
|
49
|
+
* import { initializeThemeBasicNavItems } from '@abpjs/theme-basic';
|
|
50
|
+
*
|
|
51
|
+
* // Call once during app initialization
|
|
52
|
+
* initializeThemeBasicNavItems();
|
|
53
|
+
* ```
|
|
54
|
+
*/
|
|
55
|
+
export declare function initializeThemeBasicNavItems(): void;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Styles Provider
|
|
3
|
+
* Translated from @abp/ng.theme.basic/lib/providers/styles.provider.ts v3.0.0
|
|
4
|
+
*
|
|
5
|
+
* Provides style configuration for the theme-basic module.
|
|
6
|
+
* In Angular, this uses DomInsertionService to inject CSS into the DOM.
|
|
7
|
+
* In React with Chakra UI, most styles are handled via CSS-in-JS,
|
|
8
|
+
* but this provider can be used for any global CSS overrides.
|
|
9
|
+
*
|
|
10
|
+
* @since 3.0.0
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* Default styles for theme-basic.
|
|
14
|
+
* These are global CSS styles that supplement Chakra UI's styling.
|
|
15
|
+
*
|
|
16
|
+
* @since 3.0.0
|
|
17
|
+
*/
|
|
18
|
+
export declare const THEME_BASIC_STYLES = "\n/* Content header styles */\n.content-header-title {\n font-size: 24px;\n}\n\n.entry-row {\n margin-bottom: 15px;\n}\n\n/* Input validation styles */\n.input-validation-error {\n border-color: #dc3545;\n}\n\n.field-validation-error {\n font-size: 0.8em;\n}\n\n/* Table styles */\n.ui-table .ui-table-tbody > tr.empty-row > div.empty-row-content {\n border: 1px solid #c8c8c8;\n}\n\n.ui-table .pagination-wrapper {\n background-color: #f4f4f4;\n border: 1px solid #c8c8c8;\n}\n\n/* Bordered datatable styles (added in v3.0.0) */\n.bordered .datatable-body-row {\n border-top: 1px solid #eee;\n margin-top: -1px;\n}\n\n/* Loading overlay */\n.abp-loading {\n background: rgba(0, 0, 0, 0.1);\n}\n\n/* Modal backdrop */\n.modal-backdrop {\n background-color: rgba(0, 0, 0, 0.6);\n}\n";
|
|
19
|
+
/**
|
|
20
|
+
* Injects the theme-basic styles into the document head.
|
|
21
|
+
* Call this function during app initialization if you need the global CSS styles.
|
|
22
|
+
*
|
|
23
|
+
* Note: Most styling in React/Chakra is handled via CSS-in-JS.
|
|
24
|
+
* This is primarily for compatibility with Angular components or
|
|
25
|
+
* third-party libraries that expect global CSS classes.
|
|
26
|
+
*
|
|
27
|
+
* @since 3.0.0
|
|
28
|
+
*/
|
|
29
|
+
export declare function injectThemeBasicStyles(): void;
|
|
30
|
+
/**
|
|
31
|
+
* Configures the basic theme styles.
|
|
32
|
+
* This function is called during app initialization to inject global CSS.
|
|
33
|
+
*
|
|
34
|
+
* @returns A function that performs the style injection
|
|
35
|
+
* @since 3.0.0
|
|
36
|
+
*/
|
|
37
|
+
export declare function configureStyles(): () => void;
|
|
38
|
+
/**
|
|
39
|
+
* Basic theme styles providers for initialization.
|
|
40
|
+
* Use this in your app setup to configure theme-basic styles.
|
|
41
|
+
*
|
|
42
|
+
* In React, you typically call this during app initialization:
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```tsx
|
|
46
|
+
* import { initializeThemeBasicStyles } from '@abpjs/theme-basic';
|
|
47
|
+
*
|
|
48
|
+
* // In your app initialization
|
|
49
|
+
* initializeThemeBasicStyles();
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @since 3.0.0
|
|
53
|
+
*/
|
|
54
|
+
export declare const BASIC_THEME_STYLES_PROVIDERS: {
|
|
55
|
+
configureStyles: typeof configureStyles;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Initialize theme basic styles.
|
|
59
|
+
* Call this function during app initialization to inject the
|
|
60
|
+
* global CSS styles for theme-basic.
|
|
61
|
+
*
|
|
62
|
+
* @since 3.0.0
|
|
63
|
+
*
|
|
64
|
+
* @example
|
|
65
|
+
* ```tsx
|
|
66
|
+
* import { initializeThemeBasicStyles } from '@abpjs/theme-basic';
|
|
67
|
+
*
|
|
68
|
+
* // Call once during app initialization
|
|
69
|
+
* initializeThemeBasicStyles();
|
|
70
|
+
* ```
|
|
71
|
+
*/
|
|
72
|
+
export declare function initializeThemeBasicStyles(): void;
|
package/dist/services/index.d.ts
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated The layout-state.service was removed in Angular v3.0.0.
|
|
3
|
+
* Use NavItemsService from @abpjs/theme-shared instead.
|
|
4
|
+
* This export is kept for backwards compatibility and will be removed in a future version.
|
|
5
|
+
*/
|
|
1
6
|
export * from './layout-state.service';
|
|
@@ -4,6 +4,11 @@ import { Layout } from '../models';
|
|
|
4
4
|
* Provides methods to access and modify layout state.
|
|
5
5
|
*
|
|
6
6
|
* @since 2.7.0
|
|
7
|
+
* @deprecated This service was removed in Angular v3.0.0. Use NavItemsService from
|
|
8
|
+
* @abpjs/theme-shared instead. This export is kept for backwards compatibility
|
|
9
|
+
* and will be removed in a future version.
|
|
10
|
+
*
|
|
11
|
+
* @see {@link NavItemsService} from @abpjs/theme-shared
|
|
7
12
|
*/
|
|
8
13
|
export interface LayoutStateService {
|
|
9
14
|
/**
|
|
@@ -31,6 +36,11 @@ export interface LayoutStateService {
|
|
|
31
36
|
* Provides a service-like interface matching the Angular LayoutStateService.
|
|
32
37
|
*
|
|
33
38
|
* @since 2.7.0
|
|
39
|
+
* @deprecated This hook was removed in Angular v3.0.0. Use NavItemsService from
|
|
40
|
+
* @abpjs/theme-shared instead. This export is kept for backwards compatibility
|
|
41
|
+
* and will be removed in a future version.
|
|
42
|
+
*
|
|
43
|
+
* @see {@link getNavItemsService} and {@link useNavItems} from @abpjs/theme-shared
|
|
34
44
|
*
|
|
35
45
|
* @example
|
|
36
46
|
* ```tsx
|