@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.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __create = Object.create;
|
|
3
2
|
var __defProp = Object.defineProperty;
|
|
4
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
6
|
var __export = (target, all) => {
|
|
9
7
|
for (var name in all)
|
|
@@ -17,25 +15,21 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
17
15
|
}
|
|
18
16
|
return to;
|
|
19
17
|
};
|
|
20
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
-
mod
|
|
27
|
-
));
|
|
28
18
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
19
|
|
|
30
20
|
// src/index.ts
|
|
31
21
|
var index_exports = {};
|
|
32
22
|
__export(index_exports, {
|
|
23
|
+
BASIC_THEME_NAV_ITEM_PROVIDERS: () => BASIC_THEME_NAV_ITEM_PROVIDERS,
|
|
24
|
+
BASIC_THEME_STYLES_PROVIDERS: () => BASIC_THEME_STYLES_PROVIDERS,
|
|
33
25
|
Block: () => Block,
|
|
34
26
|
BrandingProvider: () => BrandingProvider,
|
|
35
27
|
ChangePassword: () => import_theme_shared.ChangePassword,
|
|
28
|
+
CurrentUserComponent: () => CurrentUserComponent,
|
|
36
29
|
DefaultLogo: () => DefaultLogo,
|
|
37
30
|
LAYOUTS: () => LAYOUTS,
|
|
38
31
|
LanguageSelector: () => LanguageSelector,
|
|
32
|
+
LanguagesComponent: () => LanguagesComponent,
|
|
39
33
|
LayoutAccount: () => LayoutAccount,
|
|
40
34
|
LayoutApplication: () => LayoutApplication,
|
|
41
35
|
LayoutBase: () => LayoutBase,
|
|
@@ -55,12 +49,18 @@ __export(index_exports, {
|
|
|
55
49
|
SearchProvider: () => SearchProvider,
|
|
56
50
|
Sidebar: () => Sidebar,
|
|
57
51
|
SidebarLink: () => SidebarLink,
|
|
52
|
+
THEME_BASIC_STYLES: () => THEME_BASIC_STYLES,
|
|
58
53
|
ThemeBasicProvider: () => ThemeBasicProvider,
|
|
59
54
|
UserProfile: () => UserProfile,
|
|
55
|
+
configureNavItems: () => configureNavItems,
|
|
56
|
+
configureStyles: () => configureStyles,
|
|
60
57
|
defaultThemeBasicConfig: () => defaultThemeBasicConfig,
|
|
61
|
-
defineConfig: () =>
|
|
58
|
+
defineConfig: () => import_theme_shared4.defineConfig,
|
|
62
59
|
eNavigationElementNames: () => eNavigationElementNames,
|
|
63
60
|
eThemeBasicComponents: () => eThemeBasicComponents,
|
|
61
|
+
initializeThemeBasicNavItems: () => initializeThemeBasicNavItems,
|
|
62
|
+
initializeThemeBasicStyles: () => initializeThemeBasicStyles,
|
|
63
|
+
injectThemeBasicStyles: () => injectThemeBasicStyles,
|
|
64
64
|
useBranding: () => useBranding,
|
|
65
65
|
useLayoutContext: () => useLayoutContext,
|
|
66
66
|
useLayoutService: () => useLayoutService,
|
|
@@ -78,7 +78,17 @@ var eThemeBasicComponents = {
|
|
|
78
78
|
EmptyLayout: "Theme.EmptyLayoutComponent",
|
|
79
79
|
Logo: "Theme.LogoComponent",
|
|
80
80
|
Routes: "Theme.RoutesComponent",
|
|
81
|
-
NavItems: "Theme.NavItemsComponent"
|
|
81
|
+
NavItems: "Theme.NavItemsComponent",
|
|
82
|
+
/**
|
|
83
|
+
* Component key for the current user nav item.
|
|
84
|
+
* @since 3.0.0
|
|
85
|
+
*/
|
|
86
|
+
CurrentUser: "Theme.CurrentUserComponent",
|
|
87
|
+
/**
|
|
88
|
+
* Component key for the languages nav item.
|
|
89
|
+
* @since 3.0.0
|
|
90
|
+
*/
|
|
91
|
+
Languages: "Theme.LanguagesComponent"
|
|
82
92
|
};
|
|
83
93
|
|
|
84
94
|
// src/enums/navigation-element-names.ts
|
|
@@ -834,9 +844,9 @@ function LayoutApplication({
|
|
|
834
844
|
const navigate = (0, import_react_router_dom6.useNavigate)();
|
|
835
845
|
const { logout } = (0, import_core6.useAuth)();
|
|
836
846
|
const { direction, isRtl } = (0, import_core6.useDirection)();
|
|
837
|
-
const
|
|
838
|
-
const
|
|
839
|
-
const
|
|
847
|
+
const _logoComponentKey = eThemeBasicComponents.Logo;
|
|
848
|
+
const _routesComponentKey = eThemeBasicComponents.Routes;
|
|
849
|
+
const _navItemsComponentKey = eThemeBasicComponents.NavItems;
|
|
840
850
|
const [isChangePasswordOpen, setIsChangePasswordOpen] = (0, import_react16.useState)(false);
|
|
841
851
|
const [isProfileOpen, setIsProfileOpen] = (0, import_react16.useState)(false);
|
|
842
852
|
const handleLogout = (0, import_react16.useCallback)(() => {
|
|
@@ -1020,70 +1030,200 @@ function LogoComponent({ style, linkTo }) {
|
|
|
1020
1030
|
}
|
|
1021
1031
|
|
|
1022
1032
|
// src/components/nav-items/NavItemsComponent.tsx
|
|
1023
|
-
var import_react21 =
|
|
1033
|
+
var import_react21 = require("react");
|
|
1024
1034
|
var import_react22 = require("@chakra-ui/react");
|
|
1025
|
-
var
|
|
1035
|
+
var import_theme_shared3 = require("@abpjs/theme-shared");
|
|
1026
1036
|
var import_jsx_runtime18 = require("react/jsx-runtime");
|
|
1027
1037
|
function NavItemsComponent({
|
|
1028
|
-
smallScreen = false
|
|
1029
|
-
userProfileProps,
|
|
1030
|
-
showLanguageSelector = true,
|
|
1031
|
-
showCurrentUser = true
|
|
1038
|
+
smallScreen: _smallScreen = false
|
|
1032
1039
|
}) {
|
|
1033
|
-
const
|
|
1034
|
-
const
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
const
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1040
|
+
const navItems = (0, import_theme_shared3.useNavItems)();
|
|
1041
|
+
const _trackByFn = (0, import_react21.useCallback)((item) => {
|
|
1042
|
+
return item.id;
|
|
1043
|
+
}, []);
|
|
1044
|
+
const renderNavItem = (0, import_react21.useCallback)((item) => {
|
|
1045
|
+
if (item.component) {
|
|
1046
|
+
const Component = item.component;
|
|
1047
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(Component, {}, item.id);
|
|
1048
|
+
}
|
|
1049
|
+
if (item.html) {
|
|
1050
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1051
|
+
import_react22.Box,
|
|
1052
|
+
{
|
|
1053
|
+
dangerouslySetInnerHTML: { __html: item.html }
|
|
1054
|
+
},
|
|
1055
|
+
item.id
|
|
1056
|
+
);
|
|
1057
|
+
}
|
|
1058
|
+
if (item.action) {
|
|
1059
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(
|
|
1060
|
+
import_react22.Box,
|
|
1061
|
+
{
|
|
1062
|
+
as: "button",
|
|
1063
|
+
onClick: item.action,
|
|
1064
|
+
cursor: "pointer",
|
|
1065
|
+
width: "full"
|
|
1066
|
+
},
|
|
1067
|
+
item.id
|
|
1068
|
+
);
|
|
1069
|
+
}
|
|
1070
|
+
return null;
|
|
1071
|
+
}, []);
|
|
1072
|
+
return /* @__PURE__ */ (0, import_jsx_runtime18.jsx)(import_react22.Stack, { gap: 2, width: "full", children: navItems.map((item) => renderNavItem(item)) });
|
|
1073
|
+
}
|
|
1074
|
+
|
|
1075
|
+
// src/components/nav-items/CurrentUserComponent.tsx
|
|
1076
|
+
var import_react23 = require("react");
|
|
1077
|
+
var import_react24 = require("@chakra-ui/react");
|
|
1078
|
+
var import_lu7 = require("react-icons/lu");
|
|
1079
|
+
var import_core9 = require("@abpjs/core");
|
|
1080
|
+
var import_react_router_dom10 = require("react-router-dom");
|
|
1081
|
+
var import_jsx_runtime19 = require("react/jsx-runtime");
|
|
1082
|
+
function CurrentUserComponent({
|
|
1083
|
+
smallScreen: _smallScreen = false,
|
|
1084
|
+
loginUrl = "/account/login",
|
|
1085
|
+
profileUrl = "/account/manage",
|
|
1086
|
+
changePasswordUrl = "/account/manage",
|
|
1087
|
+
containerStyle,
|
|
1088
|
+
menuZIndex = 1400
|
|
1089
|
+
}) {
|
|
1090
|
+
const { currentUser } = (0, import_core9.useConfig)();
|
|
1091
|
+
const { isAuthenticated, logout: authLogout } = (0, import_core9.useAuth)();
|
|
1092
|
+
const { endSide } = (0, import_core9.useDirection)();
|
|
1093
|
+
const { t } = (0, import_core9.useLocalization)();
|
|
1094
|
+
const navigate = (0, import_react_router_dom10.useNavigate)();
|
|
1095
|
+
const handleLogout = (0, import_react23.useCallback)(() => {
|
|
1096
|
+
authLogout();
|
|
1097
|
+
}, [authLogout]);
|
|
1098
|
+
const handleProfile = (0, import_react23.useCallback)(() => {
|
|
1099
|
+
navigate(profileUrl);
|
|
1100
|
+
}, [navigate, profileUrl]);
|
|
1101
|
+
const handleChangePassword = (0, import_react23.useCallback)(() => {
|
|
1102
|
+
navigate(changePasswordUrl);
|
|
1103
|
+
}, [navigate, changePasswordUrl]);
|
|
1104
|
+
const initials = (0, import_react23.useMemo)(() => {
|
|
1105
|
+
const userName = currentUser?.userName || "";
|
|
1106
|
+
return userName.slice(0, 2).toUpperCase();
|
|
1107
|
+
}, [currentUser?.userName]);
|
|
1108
|
+
if (!isAuthenticated || !currentUser) {
|
|
1109
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react24.Button, { asChild: true, variant: "outline", width: "full", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react_router_dom10.Link, { to: loginUrl, children: [
|
|
1110
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu7.LuLogIn, {}),
|
|
1111
|
+
t("AbpAccount::Login")
|
|
1112
|
+
] }) });
|
|
1113
|
+
}
|
|
1114
|
+
return /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react24.HStack, { gap: "3", justify: "space-between", css: containerStyle, children: [
|
|
1115
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react24.HStack, { gap: "3", children: [
|
|
1116
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react24.Avatar.Root, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react24.Avatar.Fallback, { children: initials }) }),
|
|
1117
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react24.Box, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react24.Text, { textStyle: "sm", fontWeight: "medium", children: currentUser.userName }) })
|
|
1118
|
+
] }),
|
|
1119
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react24.Menu.Root, { positioning: { placement: `${endSide}-start` }, children: [
|
|
1120
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react24.Menu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(
|
|
1121
|
+
import_react24.Box,
|
|
1122
|
+
{
|
|
1123
|
+
as: "button",
|
|
1124
|
+
p: "2",
|
|
1125
|
+
borderRadius: "md",
|
|
1126
|
+
cursor: "pointer",
|
|
1127
|
+
_hover: { bg: "colorPalette.subtle" },
|
|
1128
|
+
"aria-label": "User menu",
|
|
1129
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu7.LuEllipsisVertical, {})
|
|
1130
|
+
}
|
|
1131
|
+
) }),
|
|
1132
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react24.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_react24.Menu.Positioner, { style: { zIndex: menuZIndex }, children: /* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react24.Menu.Content, { children: [
|
|
1133
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react24.Menu.Item, { value: "profile", onClick: handleProfile, children: [
|
|
1134
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu7.LuUser, {}),
|
|
1135
|
+
t("AbpUi::PersonalInfo")
|
|
1136
|
+
] }),
|
|
1137
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react24.Menu.Item, { value: "change-password", onClick: handleChangePassword, children: [
|
|
1138
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu7.LuKey, {}),
|
|
1139
|
+
t("AbpUi::ChangePassword")
|
|
1140
|
+
] }),
|
|
1141
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsxs)(import_react24.Menu.Item, { value: "logout", onClick: handleLogout, color: "red.500", children: [
|
|
1142
|
+
/* @__PURE__ */ (0, import_jsx_runtime19.jsx)(import_lu7.LuLogOut, {}),
|
|
1143
|
+
t("AbpUi::Logout")
|
|
1144
|
+
] })
|
|
1145
|
+
] }) }) })
|
|
1146
|
+
] })
|
|
1147
|
+
] });
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
// src/components/nav-items/LanguagesComponent.tsx
|
|
1151
|
+
var import_react25 = require("react");
|
|
1152
|
+
var import_react26 = require("@chakra-ui/react");
|
|
1153
|
+
var import_lu8 = require("react-icons/lu");
|
|
1154
|
+
var import_core10 = require("@abpjs/core");
|
|
1155
|
+
var import_jsx_runtime20 = require("react/jsx-runtime");
|
|
1156
|
+
function LanguagesComponent({
|
|
1157
|
+
smallScreen: _smallScreen = false,
|
|
1158
|
+
compact = false,
|
|
1159
|
+
containerStyle,
|
|
1160
|
+
menuZIndex = 1400
|
|
1161
|
+
}) {
|
|
1162
|
+
const { localization } = (0, import_core10.useConfig)();
|
|
1163
|
+
const { language, setLanguage } = (0, import_core10.useSession)();
|
|
1164
|
+
const languages = (0, import_react25.useMemo)(() => {
|
|
1165
|
+
return localization?.languages || [];
|
|
1166
|
+
}, [localization]);
|
|
1167
|
+
const currentLanguage = (0, import_react25.useMemo)(() => {
|
|
1168
|
+
return languages.find((lang) => lang.cultureName === language);
|
|
1169
|
+
}, [languages, language]);
|
|
1170
|
+
const defaultLanguage = (0, import_react25.useMemo)(() => {
|
|
1171
|
+
return currentLanguage?.displayName || currentLanguage?.cultureName || "";
|
|
1172
|
+
}, [currentLanguage]);
|
|
1173
|
+
const dropdownLanguages = (0, import_react25.useMemo)(() => {
|
|
1174
|
+
return languages.filter((lang) => lang.cultureName !== language);
|
|
1175
|
+
}, [languages, language]);
|
|
1176
|
+
const _selectedLangCulture = language || "";
|
|
1177
|
+
const handleChangeLang = (0, import_react25.useCallback)(
|
|
1045
1178
|
(cultureName) => {
|
|
1046
1179
|
setLanguage(cultureName);
|
|
1047
1180
|
window.location.reload();
|
|
1048
1181
|
},
|
|
1049
1182
|
[setLanguage]
|
|
1050
1183
|
);
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
}
|
|
1054
|
-
(0,
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
}
|
|
1076
|
-
}
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1184
|
+
if (languages.length <= 1) {
|
|
1185
|
+
return null;
|
|
1186
|
+
}
|
|
1187
|
+
return /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react26.Menu.Root, { children: [
|
|
1188
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react26.Menu.Trigger, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1189
|
+
import_react26.Button,
|
|
1190
|
+
{
|
|
1191
|
+
variant: "ghost",
|
|
1192
|
+
width: "full",
|
|
1193
|
+
justifyContent: "start",
|
|
1194
|
+
gap: "3",
|
|
1195
|
+
color: "fg.muted",
|
|
1196
|
+
css: containerStyle,
|
|
1197
|
+
_hover: {
|
|
1198
|
+
bg: "colorPalette.subtle",
|
|
1199
|
+
color: "colorPalette.fg"
|
|
1200
|
+
},
|
|
1201
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react26.HStack, { justifyContent: "space-between", width: "full", children: [
|
|
1202
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsxs)(import_react26.HStack, { gap: "3", children: [
|
|
1203
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lu8.LuGlobe, {}),
|
|
1204
|
+
!compact && /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react26.Text, { children: defaultLanguage })
|
|
1205
|
+
] }),
|
|
1206
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_lu8.LuChevronDown, {})
|
|
1207
|
+
] })
|
|
1208
|
+
}
|
|
1209
|
+
) }),
|
|
1210
|
+
/* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react26.Portal, { children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react26.Menu.Positioner, { style: { zIndex: menuZIndex }, children: /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(import_react26.Menu.Content, { children: dropdownLanguages.map((lang) => /* @__PURE__ */ (0, import_jsx_runtime20.jsx)(
|
|
1211
|
+
import_react26.Menu.Item,
|
|
1212
|
+
{
|
|
1213
|
+
value: lang.cultureName,
|
|
1214
|
+
onClick: () => handleChangeLang(lang.cultureName),
|
|
1215
|
+
children: lang.displayName || lang.cultureName
|
|
1216
|
+
},
|
|
1217
|
+
lang.cultureName
|
|
1218
|
+
)) }) }) })
|
|
1219
|
+
] });
|
|
1080
1220
|
}
|
|
1081
1221
|
|
|
1082
1222
|
// src/components/routes/RoutesComponent.tsx
|
|
1083
|
-
var
|
|
1084
|
-
var
|
|
1085
|
-
var
|
|
1086
|
-
var
|
|
1223
|
+
var import_react27 = require("react");
|
|
1224
|
+
var import_react28 = require("@chakra-ui/react");
|
|
1225
|
+
var import_core11 = require("@abpjs/core");
|
|
1226
|
+
var import_jsx_runtime21 = require("react/jsx-runtime");
|
|
1087
1227
|
function getVisibleRoutes2(routes) {
|
|
1088
1228
|
return routes.reduce((acc, val) => {
|
|
1089
1229
|
if (val.invisible) {
|
|
@@ -1097,35 +1237,35 @@ function getVisibleRoutes2(routes) {
|
|
|
1097
1237
|
}, []);
|
|
1098
1238
|
}
|
|
1099
1239
|
function RoutesComponent({
|
|
1100
|
-
smallScreen = false,
|
|
1240
|
+
smallScreen: _smallScreen = false,
|
|
1101
1241
|
defaultIcon,
|
|
1102
1242
|
routes: customRoutes
|
|
1103
1243
|
}) {
|
|
1104
|
-
const { routes: configRoutes } = (0,
|
|
1105
|
-
const { direction } = (0,
|
|
1244
|
+
const { routes: configRoutes } = (0, import_core11.useConfig)();
|
|
1245
|
+
const { direction } = (0, import_core11.useDirection)();
|
|
1106
1246
|
const routes = customRoutes || configRoutes || [];
|
|
1107
|
-
const
|
|
1247
|
+
const _visibleRoutes = (0, import_react27.useMemo)(() => {
|
|
1108
1248
|
return getVisibleRoutes2(routes);
|
|
1109
1249
|
}, [routes]);
|
|
1110
|
-
const
|
|
1250
|
+
const _trackByFn = (index, item) => {
|
|
1111
1251
|
return item.name || item.path || index;
|
|
1112
1252
|
};
|
|
1113
|
-
return /* @__PURE__ */ (0,
|
|
1253
|
+
return /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(import_react28.Stack, { gap: "1", dir: direction, children: /* @__PURE__ */ (0, import_jsx_runtime21.jsx)(NavLinks, { defaultIcon }) });
|
|
1114
1254
|
}
|
|
1115
1255
|
|
|
1116
1256
|
// src/providers/ThemeBasicProvider.tsx
|
|
1117
|
-
var
|
|
1118
|
-
var
|
|
1119
|
-
var
|
|
1120
|
-
var
|
|
1257
|
+
var import_react29 = require("react");
|
|
1258
|
+
var import_theme_shared4 = require("@abpjs/theme-shared");
|
|
1259
|
+
var import_core12 = require("@abpjs/core");
|
|
1260
|
+
var import_jsx_runtime22 = require("react/jsx-runtime");
|
|
1121
1261
|
function LocaleSync({ children }) {
|
|
1122
|
-
const { language } = (0,
|
|
1123
|
-
const { direction } = (0,
|
|
1124
|
-
(0,
|
|
1262
|
+
const { language } = (0, import_core12.useSession)();
|
|
1263
|
+
const { direction } = (0, import_core12.useDirection)();
|
|
1264
|
+
(0, import_react29.useEffect)(() => {
|
|
1125
1265
|
document.documentElement.dir = direction;
|
|
1126
1266
|
document.documentElement.lang = language || "en";
|
|
1127
1267
|
}, [direction, language]);
|
|
1128
|
-
return /* @__PURE__ */ (0,
|
|
1268
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(import_jsx_runtime22.Fragment, { children });
|
|
1129
1269
|
}
|
|
1130
1270
|
function ThemeBasicInner({
|
|
1131
1271
|
children,
|
|
@@ -1140,10 +1280,10 @@ function ThemeBasicInner({
|
|
|
1140
1280
|
appName,
|
|
1141
1281
|
logoLink
|
|
1142
1282
|
}) {
|
|
1143
|
-
const { language } = (0,
|
|
1283
|
+
const { language } = (0, import_core12.useSession)();
|
|
1144
1284
|
const locale = language || "en-US";
|
|
1145
|
-
return /* @__PURE__ */ (0,
|
|
1146
|
-
|
|
1285
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1286
|
+
import_theme_shared4.ThemeSharedProvider,
|
|
1147
1287
|
{
|
|
1148
1288
|
renderToasts,
|
|
1149
1289
|
renderConfirmation,
|
|
@@ -1152,20 +1292,20 @@ function ThemeBasicInner({
|
|
|
1152
1292
|
enableColorMode,
|
|
1153
1293
|
defaultColorMode,
|
|
1154
1294
|
locale,
|
|
1155
|
-
children: /* @__PURE__ */ (0,
|
|
1295
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LocaleSync, { children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1156
1296
|
BrandingProvider,
|
|
1157
1297
|
{
|
|
1158
1298
|
logo,
|
|
1159
1299
|
logoIcon,
|
|
1160
1300
|
appName,
|
|
1161
1301
|
logoLink,
|
|
1162
|
-
children: /* @__PURE__ */ (0,
|
|
1302
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(LayoutProvider, { children })
|
|
1163
1303
|
}
|
|
1164
1304
|
) })
|
|
1165
1305
|
}
|
|
1166
1306
|
);
|
|
1167
1307
|
}
|
|
1168
|
-
var defaultThemeBasicConfig = (0,
|
|
1308
|
+
var defaultThemeBasicConfig = (0, import_theme_shared4.defineConfig)({
|
|
1169
1309
|
theme: {
|
|
1170
1310
|
tokens: {
|
|
1171
1311
|
colors: {
|
|
@@ -1233,7 +1373,7 @@ function ThemeBasicProvider({
|
|
|
1233
1373
|
logoLink
|
|
1234
1374
|
}) {
|
|
1235
1375
|
const mergedThemeOverrides = themeOverrides || defaultThemeBasicConfig;
|
|
1236
|
-
return /* @__PURE__ */ (0,
|
|
1376
|
+
return /* @__PURE__ */ (0, import_jsx_runtime22.jsx)(
|
|
1237
1377
|
ThemeBasicInner,
|
|
1238
1378
|
{
|
|
1239
1379
|
renderToasts,
|
|
@@ -1251,16 +1391,114 @@ function ThemeBasicProvider({
|
|
|
1251
1391
|
);
|
|
1252
1392
|
}
|
|
1253
1393
|
|
|
1394
|
+
// src/providers/nav-item.provider.ts
|
|
1395
|
+
var import_theme_shared5 = require("@abpjs/theme-shared");
|
|
1396
|
+
function configureNavItems(navItems) {
|
|
1397
|
+
return () => {
|
|
1398
|
+
navItems.addItems([
|
|
1399
|
+
{
|
|
1400
|
+
id: eThemeBasicComponents.Languages,
|
|
1401
|
+
component: LanguagesComponent,
|
|
1402
|
+
order: 100
|
|
1403
|
+
},
|
|
1404
|
+
{
|
|
1405
|
+
id: eThemeBasicComponents.CurrentUser,
|
|
1406
|
+
component: CurrentUserComponent,
|
|
1407
|
+
order: 200
|
|
1408
|
+
}
|
|
1409
|
+
]);
|
|
1410
|
+
};
|
|
1411
|
+
}
|
|
1412
|
+
var BASIC_THEME_NAV_ITEM_PROVIDERS = {
|
|
1413
|
+
configureNavItems
|
|
1414
|
+
};
|
|
1415
|
+
function initializeThemeBasicNavItems() {
|
|
1416
|
+
const navItemsService = (0, import_theme_shared5.getNavItemsService)();
|
|
1417
|
+
configureNavItems(navItemsService)();
|
|
1418
|
+
}
|
|
1419
|
+
|
|
1420
|
+
// src/providers/styles.provider.ts
|
|
1421
|
+
var THEME_BASIC_STYLES = `
|
|
1422
|
+
/* Content header styles */
|
|
1423
|
+
.content-header-title {
|
|
1424
|
+
font-size: 24px;
|
|
1425
|
+
}
|
|
1426
|
+
|
|
1427
|
+
.entry-row {
|
|
1428
|
+
margin-bottom: 15px;
|
|
1429
|
+
}
|
|
1430
|
+
|
|
1431
|
+
/* Input validation styles */
|
|
1432
|
+
.input-validation-error {
|
|
1433
|
+
border-color: #dc3545;
|
|
1434
|
+
}
|
|
1435
|
+
|
|
1436
|
+
.field-validation-error {
|
|
1437
|
+
font-size: 0.8em;
|
|
1438
|
+
}
|
|
1439
|
+
|
|
1440
|
+
/* Table styles */
|
|
1441
|
+
.ui-table .ui-table-tbody > tr.empty-row > div.empty-row-content {
|
|
1442
|
+
border: 1px solid #c8c8c8;
|
|
1443
|
+
}
|
|
1444
|
+
|
|
1445
|
+
.ui-table .pagination-wrapper {
|
|
1446
|
+
background-color: #f4f4f4;
|
|
1447
|
+
border: 1px solid #c8c8c8;
|
|
1448
|
+
}
|
|
1449
|
+
|
|
1450
|
+
/* Bordered datatable styles (added in v3.0.0) */
|
|
1451
|
+
.bordered .datatable-body-row {
|
|
1452
|
+
border-top: 1px solid #eee;
|
|
1453
|
+
margin-top: -1px;
|
|
1454
|
+
}
|
|
1455
|
+
|
|
1456
|
+
/* Loading overlay */
|
|
1457
|
+
.abp-loading {
|
|
1458
|
+
background: rgba(0, 0, 0, 0.1);
|
|
1459
|
+
}
|
|
1460
|
+
|
|
1461
|
+
/* Modal backdrop */
|
|
1462
|
+
.modal-backdrop {
|
|
1463
|
+
background-color: rgba(0, 0, 0, 0.6);
|
|
1464
|
+
}
|
|
1465
|
+
`;
|
|
1466
|
+
function injectThemeBasicStyles() {
|
|
1467
|
+
const existingStyle = document.getElementById("abpjs-theme-basic-styles");
|
|
1468
|
+
if (existingStyle) {
|
|
1469
|
+
return;
|
|
1470
|
+
}
|
|
1471
|
+
const styleElement = document.createElement("style");
|
|
1472
|
+
styleElement.id = "abpjs-theme-basic-styles";
|
|
1473
|
+
styleElement.textContent = THEME_BASIC_STYLES;
|
|
1474
|
+
document.head.appendChild(styleElement);
|
|
1475
|
+
}
|
|
1476
|
+
function configureStyles() {
|
|
1477
|
+
return () => {
|
|
1478
|
+
injectThemeBasicStyles();
|
|
1479
|
+
};
|
|
1480
|
+
}
|
|
1481
|
+
var BASIC_THEME_STYLES_PROVIDERS = {
|
|
1482
|
+
configureStyles
|
|
1483
|
+
};
|
|
1484
|
+
function initializeThemeBasicStyles() {
|
|
1485
|
+
configureStyles()();
|
|
1486
|
+
}
|
|
1487
|
+
|
|
1254
1488
|
// src/index.ts
|
|
1255
1489
|
var LAYOUTS = [LayoutApplication, LayoutAccount, LayoutEmpty];
|
|
1256
1490
|
// Annotate the CommonJS export names for ESM import in node:
|
|
1257
1491
|
0 && (module.exports = {
|
|
1492
|
+
BASIC_THEME_NAV_ITEM_PROVIDERS,
|
|
1493
|
+
BASIC_THEME_STYLES_PROVIDERS,
|
|
1258
1494
|
Block,
|
|
1259
1495
|
BrandingProvider,
|
|
1260
1496
|
ChangePassword,
|
|
1497
|
+
CurrentUserComponent,
|
|
1261
1498
|
DefaultLogo,
|
|
1262
1499
|
LAYOUTS,
|
|
1263
1500
|
LanguageSelector,
|
|
1501
|
+
LanguagesComponent,
|
|
1264
1502
|
LayoutAccount,
|
|
1265
1503
|
LayoutApplication,
|
|
1266
1504
|
LayoutBase,
|
|
@@ -1280,12 +1518,18 @@ var LAYOUTS = [LayoutApplication, LayoutAccount, LayoutEmpty];
|
|
|
1280
1518
|
SearchProvider,
|
|
1281
1519
|
Sidebar,
|
|
1282
1520
|
SidebarLink,
|
|
1521
|
+
THEME_BASIC_STYLES,
|
|
1283
1522
|
ThemeBasicProvider,
|
|
1284
1523
|
UserProfile,
|
|
1524
|
+
configureNavItems,
|
|
1525
|
+
configureStyles,
|
|
1285
1526
|
defaultThemeBasicConfig,
|
|
1286
1527
|
defineConfig,
|
|
1287
1528
|
eNavigationElementNames,
|
|
1288
1529
|
eThemeBasicComponents,
|
|
1530
|
+
initializeThemeBasicNavItems,
|
|
1531
|
+
initializeThemeBasicStyles,
|
|
1532
|
+
injectThemeBasicStyles,
|
|
1289
1533
|
useBranding,
|
|
1290
1534
|
useLayoutContext,
|
|
1291
1535
|
useLayoutService,
|