Browse Source

Merge pull request #22829 from abpframework/feature/migrating-abp-packages-to-standalone-structure

Migrating abp packages to standalone structure
pull/22960/head
oykuermann 1 year ago
committed by GitHub
parent
commit
00d89f6023
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 34
      npm/ng-packs/apps/dev-app/src/app/app-routing.module.ts
  2. 4
      npm/ng-packs/apps/dev-app/src/app/app.component.ts
  3. 42
      npm/ng-packs/apps/dev-app/src/app/app.config.ts
  4. 58
      npm/ng-packs/apps/dev-app/src/app/app.module.ts
  5. 25
      npm/ng-packs/apps/dev-app/src/app/app.routes.ts
  6. 11
      npm/ng-packs/apps/dev-app/src/app/home/home-routing.module.ts
  7. 6
      npm/ng-packs/apps/dev-app/src/app/home/home.component.ts
  8. 10
      npm/ng-packs/apps/dev-app/src/app/home/home.module.ts
  9. 13
      npm/ng-packs/apps/dev-app/src/app/shared/shared.module.ts
  10. 16
      npm/ng-packs/apps/dev-app/src/main.ts
  11. 46
      npm/ng-packs/packages/account/src/lib/account.module.ts
  12. 119
      npm/ng-packs/packages/account/src/lib/account.routes.ts
  13. 2
      npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.html
  14. 19
      npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts
  15. 2
      npm/ng-packs/packages/account/src/lib/components/forgot-password/forgot-password.component.html
  16. 19
      npm/ng-packs/packages/account/src/lib/components/forgot-password/forgot-password.component.ts
  17. 31
      npm/ng-packs/packages/account/src/lib/components/login/login.component.ts
  18. 18
      npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.ts
  19. 5
      npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings-half-row.component.ts
  20. 21
      npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts
  21. 27
      npm/ng-packs/packages/account/src/lib/components/register/register.component.ts
  22. 22
      npm/ng-packs/packages/account/src/lib/components/reset-password/reset-password.component.ts
  23. 1
      npm/ng-packs/packages/account/src/public-api.ts
  24. 1
      npm/ng-packs/packages/components/chart.js/src/chart.component.ts
  25. 5
      npm/ng-packs/packages/components/chart.js/src/chart.module.ts
  26. 1
      npm/ng-packs/packages/components/extensible/src/lib/directives/prop-data.directive.ts
  27. 1
      npm/ng-packs/packages/components/extensible/src/lib/pipes/create-injector.pipe.ts
  28. 1
      npm/ng-packs/packages/components/page/src/page-part.directive.ts
  29. 3
      npm/ng-packs/packages/components/page/src/page-parts.component.ts
  30. 5
      npm/ng-packs/packages/components/page/src/page.component.ts
  31. 11
      npm/ng-packs/packages/components/page/src/page.module.ts
  32. 28
      npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts
  33. 1
      npm/ng-packs/packages/components/tree/src/lib/templates/expanded-icon-template.directive.ts
  34. 1
      npm/ng-packs/packages/components/tree/src/lib/templates/tree-node-template.directive.ts
  35. 14
      npm/ng-packs/packages/components/tree/src/lib/tree.module.ts
  36. 1
      npm/ng-packs/packages/core/src/lib/abstracts/ng-model.component.ts
  37. 3
      npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts
  38. 3
      npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts
  39. 3
      npm/ng-packs/packages/core/src/lib/components/router-outlet.component.ts
  40. 111
      npm/ng-packs/packages/core/src/lib/core.module.ts
  41. 1
      npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts
  42. 1
      npm/ng-packs/packages/core/src/lib/directives/caps-lock.directive.ts
  43. 6
      npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts
  44. 1
      npm/ng-packs/packages/core/src/lib/directives/for.directive.ts
  45. 1
      npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts
  46. 1
      npm/ng-packs/packages/core/src/lib/directives/init.directive.ts
  47. 1
      npm/ng-packs/packages/core/src/lib/directives/permission.directive.ts
  48. 1
      npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts
  49. 1
      npm/ng-packs/packages/core/src/lib/directives/show-password.directive.ts
  50. 6
      npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts
  51. 8
      npm/ng-packs/packages/core/src/lib/localization.module.ts
  52. 1
      npm/ng-packs/packages/core/src/lib/pipes/localization.pipe.ts
  53. 1
      npm/ng-packs/packages/core/src/lib/pipes/safe-html.pipe.ts
  54. 33
      npm/ng-packs/packages/core/src/lib/pipes/short-date-time.pipe.ts
  55. 33
      npm/ng-packs/packages/core/src/lib/pipes/short-date.pipe.ts
  56. 33
      npm/ng-packs/packages/core/src/lib/pipes/short-time.pipe.ts
  57. 1
      npm/ng-packs/packages/core/src/lib/pipes/sort.pipe.ts
  58. 1
      npm/ng-packs/packages/core/src/lib/pipes/to-injector.pipe.ts
  59. 1
      npm/ng-packs/packages/core/src/lib/utils/index.ts
  60. 4
      npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.ts
  61. 20
      npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts
  62. 1
      npm/ng-packs/packages/feature-management/src/lib/directives/free-text-input.directive.ts
  63. 14
      npm/ng-packs/packages/feature-management/src/lib/feature-management.module.ts
  64. 2
      npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html
  65. 44
      npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts
  66. 43
      npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts
  67. 33
      npm/ng-packs/packages/identity/src/lib/identity.module.ts
  68. 82
      npm/ng-packs/packages/identity/src/lib/identity.routes.ts
  69. 1
      npm/ng-packs/packages/identity/src/public-api.ts
  70. 23
      npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts
  71. 8
      npm/ng-packs/packages/permission-management/src/lib/permission-management.module.ts
  72. 35
      npm/ng-packs/packages/setting-management/config/src/lib/components/email-setting-group/email-setting-group.component.ts
  73. 7
      npm/ng-packs/packages/setting-management/config/src/lib/setting-management-config.module.ts
  74. 6
      npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.ts
  75. 18
      npm/ng-packs/packages/setting-management/src/lib/setting-management.module.ts
  76. 36
      npm/ng-packs/packages/setting-management/src/lib/setting-management.routes.ts
  77. 1
      npm/ng-packs/packages/setting-management/src/public-api.ts
  78. 47
      npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts
  79. 31
      npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts
  80. 70
      npm/ng-packs/packages/tenant-management/src/lib/tenant-management.routes.ts
  81. 1
      npm/ng-packs/packages/tenant-management/src/public-api.ts
  82. 20
      npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/account-layout.component.ts
  83. 5
      npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.ts
  84. 13
      npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.ts
  85. 18
      npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts
  86. 3
      npm/ng-packs/packages/theme-basic/src/lib/components/empty-layout/empty-layout.component.ts
  87. 3
      npm/ng-packs/packages/theme-basic/src/lib/components/logo/logo.component.ts
  88. 16
      npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts
  89. 4
      npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/languages.component.ts
  90. 6
      npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/nav-items.component.ts
  91. 4
      npm/ng-packs/packages/theme-basic/src/lib/components/page-alert-container/page-alert-container.component.ts
  92. 23
      npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.ts
  93. 4
      npm/ng-packs/packages/theme-basic/src/lib/components/validation-error/validation-error.component.ts
  94. 75
      npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts
  95. 6
      npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb-items/breadcrumb-items.component.ts
  96. 3
      npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts
  97. 5
      npm/ng-packs/packages/theme-shared/src/lib/components/button/button.component.ts
  98. 3
      npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts
  99. 3
      npm/ng-packs/packages/theme-shared/src/lib/components/card/card-footer.component.ts
  100. 3
      npm/ng-packs/packages/theme-shared/src/lib/components/card/card-header.component.ts

34
npm/ng-packs/apps/dev-app/src/app/app-routing.module.ts

@ -1,34 +0,0 @@
import { NgModule } from '@angular/core';
import { RouterModule, Routes } from '@angular/router';
const routes: Routes = [
{
path: '',
pathMatch: 'full',
loadChildren: () => import('./home/home.module').then(m => m.HomeModule),
},
{
path: 'account',
loadChildren: () => import('@abp/ng.account').then(m => m.AccountModule.forLazy()),
},
{
path: 'identity',
loadChildren: () => import('@abp/ng.identity').then(m => m.IdentityModule.forLazy()),
},
{
path: 'tenant-management',
loadChildren: () =>
import('@abp/ng.tenant-management').then(m => m.TenantManagementModule.forLazy()),
},
{
path: 'setting-management',
loadChildren: () =>
import('@abp/ng.setting-management').then(m => m.SettingManagementModule.forLazy()),
},
];
@NgModule({
imports: [RouterModule.forRoot(routes, {})],
exports: [RouterModule],
})
export class AppRoutingModule {}

4
npm/ng-packs/apps/dev-app/src/app/app.component.ts

@ -1,12 +1,14 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { InternetConnectionStatusComponent, LoaderBarComponent } from '@abp/ng.theme.shared';
import { DynamicLayoutComponent } from '@abp/ng.core';
@Component({ @Component({
standalone: false,
selector: 'app-root', selector: 'app-root',
template: ` template: `
<abp-loader-bar></abp-loader-bar> <abp-loader-bar></abp-loader-bar>
<abp-dynamic-layout></abp-dynamic-layout> <abp-dynamic-layout></abp-dynamic-layout>
<abp-internet-status></abp-internet-status> <abp-internet-status></abp-internet-status>
`, `,
imports: [LoaderBarComponent, DynamicLayoutComponent, InternetConnectionStatusComponent],
}) })
export class AppComponent {} export class AppComponent {}

42
npm/ng-packs/apps/dev-app/src/app/app.config.ts

@ -0,0 +1,42 @@
import { ApplicationConfig, provideZoneChangeDetection } from '@angular/core';
import { provideRouter } from '@angular/router';
import { appRoutes } from './app.routes';
import { APP_ROUTE_PROVIDER } from './route.provider';
import { provideAbpCore, withOptions } from '@abp/ng.core';
import { environment } from '../environments/environment';
import { registerLocale } from '@abp/ng.core/locale';
import { provideAbpOAuth } from '@abp/ng.oauth';
import { provideAbpThemeShared } from '@abp/ng.theme.shared';
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config';
import { provideAccountConfig } from '@abp/ng.account/config';
import { provideIdentityConfig } from '@abp/ng.identity/config';
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
import { provideFeatureManagementConfig } from '@abp/ng.feature-management';
import { provideThemeBasicConfig } from '@abp/ng.theme.basic';
import { provideAnimations } from '@angular/platform-browser/animations';
export const appConfig: ApplicationConfig = {
providers: [
provideRouter(appRoutes),
APP_ROUTE_PROVIDER,
provideAbpCore(
withOptions({
environment,
registerLocaleFn: registerLocale(),
sendNullsAsQueryParam: false,
skipGetAppConfiguration: false,
}),
),
provideAbpOAuth(),
provideAbpThemeShared(),
provideSettingManagementConfig(),
provideAccountConfig(),
provideIdentityConfig(),
provideTenantManagementConfig(),
provideFeatureManagementConfig(),
provideZoneChangeDetection({ eventCoalescing: true }),
provideThemeBasicConfig(),
provideAnimations(),
],
};

58
npm/ng-packs/apps/dev-app/src/app/app.module.ts

@ -1,58 +0,0 @@
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
import { CoreModule, provideAbpCore, withOptions } from '@abp/ng.core';
import { registerLocale } from '@abp/ng.core/locale';
import {
InternetConnectionStatusComponent,
ThemeSharedModule,
provideAbpThemeShared,
} from '@abp/ng.theme.shared';
import { ThemeLeptonXModule } from '@abp/ng.theme.lepton-x';
import { SideMenuLayoutModule } from '@abp/ng.theme.lepton-x/layouts';
import { provideAbpOAuth } from '@abp/ng.oauth';
import { provideSettingManagementConfig } from '@abp/ng.setting-management/config';
import { provideAccountConfig } from '@abp/ng.account/config';
import { provideIdentityConfig } from '@abp/ng.identity/config';
import { provideTenantManagementConfig } from '@abp/ng.tenant-management/config';
import { provideFeatureManagementConfig } from '@abp/ng.feature-management';
import { AccountLayoutModule } from '@abp/ng.theme.lepton-x/account';
import { environment } from '../environments/environment';
import { AppRoutingModule } from './app-routing.module';
import { AppComponent } from './app.component';
import { APP_ROUTE_PROVIDER } from './route.provider';
@NgModule({
imports: [
BrowserModule,
BrowserAnimationsModule,
AppRoutingModule,
CoreModule,
ThemeSharedModule,
ThemeLeptonXModule.forRoot(),
SideMenuLayoutModule.forRoot(),
AccountLayoutModule.forRoot(),
InternetConnectionStatusComponent,
],
providers: [
APP_ROUTE_PROVIDER,
provideAbpCore(
withOptions({
environment,
registerLocaleFn: registerLocale(),
sendNullsAsQueryParam: false,
skipGetAppConfiguration: false,
}),
),
provideAbpOAuth(),
provideAbpThemeShared(),
provideSettingManagementConfig(),
provideAccountConfig(),
provideIdentityConfig(),
provideTenantManagementConfig(),
provideFeatureManagementConfig(),
],
declarations: [AppComponent],
bootstrap: [AppComponent],
})
export class AppModule {}

25
npm/ng-packs/apps/dev-app/src/app/app.routes.ts

@ -0,0 +1,25 @@
import { Routes } from '@angular/router';
export const appRoutes: Routes = [
{
path: '',
pathMatch: 'full',
loadComponent: () => import('./home/home.component').then(m => m.HomeComponent),
},
{
path: 'account',
loadChildren: () => import('@abp/ng.account').then(m => m.createRoutes()),
},
{
path: 'identity',
loadChildren: () => import('@abp/ng.identity').then(m => m.createRoutes()),
},
{
path: 'tenant-management',
loadChildren: () => import('@abp/ng.tenant-management').then(m => m.createRoutes()),
},
{
path: 'setting-management',
loadChildren: () => import('@abp/ng.setting-management').then(m => m.createRoutes()),
},
];

11
npm/ng-packs/apps/dev-app/src/app/home/home-routing.module.ts

@ -1,11 +0,0 @@
import { NgModule } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';
import { HomeComponent } from './home.component';
const routes: Routes = [{ path: '', component: HomeComponent }];
@NgModule({
imports: [RouterModule.forChild(routes)],
exports: [RouterModule],
})
export class HomeRoutingModule {}

6
npm/ng-packs/apps/dev-app/src/app/home/home.component.ts

@ -1,10 +1,12 @@
import { AuthService } from '@abp/ng.core'; import { AuthService, LocalizationPipe } from '@abp/ng.core';
import { Component, inject } from '@angular/core'; import { Component, inject } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ButtonComponent, CardBodyComponent, CardComponent } from '@abp/ng.theme.shared';
@Component({ @Component({
standalone: false,
selector: 'app-home', selector: 'app-home',
templateUrl: './home.component.html', templateUrl: './home.component.html',
imports: [CommonModule, LocalizationPipe, CardComponent, CardBodyComponent, ButtonComponent],
}) })
export class HomeComponent { export class HomeComponent {
protected readonly authService = inject(AuthService); protected readonly authService = inject(AuthService);

10
npm/ng-packs/apps/dev-app/src/app/home/home.module.ts

@ -1,10 +0,0 @@
import { NgModule } from '@angular/core';
import { SharedModule } from '../shared/shared.module';
import { HomeRoutingModule } from './home-routing.module';
import { HomeComponent } from './home.component';
@NgModule({
declarations: [HomeComponent],
imports: [SharedModule, HomeRoutingModule],
})
export class HomeModule {}

13
npm/ng-packs/apps/dev-app/src/app/shared/shared.module.ts

@ -1,13 +0,0 @@
import { CoreModule } from '@abp/ng.core';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
import { NgModule } from '@angular/core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgxValidateCoreModule } from '@ngx-validate/core';
@NgModule({
declarations: [],
imports: [CoreModule, ThemeSharedModule, NgbDropdownModule, NgxValidateCoreModule],
exports: [CoreModule, ThemeSharedModule, NgbDropdownModule, NgxValidateCoreModule],
providers: [],
})
export class SharedModule {}

16
npm/ng-packs/apps/dev-app/src/main.ts

@ -1,13 +1,5 @@
import { enableProdMode } from '@angular/core'; import { bootstrapApplication } from '@angular/platform-browser';
import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; import { appConfig } from './app/app.config';
import { AppComponent } from './app/app.component';
import { AppModule } from './app/app.module'; bootstrapApplication(AppComponent, appConfig).catch(err => console.error(err));
import { environment } from './environments/environment';
if (environment.production) {
enableProdMode();
}
platformBrowserDynamic()
.bootstrapModule(AppModule)
.catch(err => console.error(err));

46
npm/ng-packs/packages/account/src/lib/account.module.ts

@ -1,49 +1,33 @@
import { CoreModule, LazyModuleFactory } from '@abp/ng.core'; import { LazyModuleFactory } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core'; import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { AccountRoutingModule } from './account-routing.module';
import { ChangePasswordComponent } from './components/change-password/change-password.component';
import { LoginComponent } from './components/login/login.component';
import { ManageProfileComponent } from './components/manage-profile/manage-profile.component';
import { PersonalSettingsComponent } from './components/personal-settings/personal-settings.component';
import { RegisterComponent } from './components/register/register.component';
import { AccountConfigOptions } from './models/config-options'; import { AccountConfigOptions } from './models/config-options';
import { ACCOUNT_CONFIG_OPTIONS } from './tokens/config-options.token'; import { ACCOUNT_CONFIG_OPTIONS } from './tokens/config-options.token';
import { accountConfigOptionsFactory } from './utils/factory-utils'; import { accountConfigOptionsFactory } from './utils/factory-utils';
import { AuthenticationFlowGuard } from './guards/authentication-flow.guard'; import { AuthenticationFlowGuard } from './guards/authentication-flow.guard';
import { ForgotPasswordComponent } from './components/forgot-password/forgot-password.component';
import { ResetPasswordComponent } from './components/reset-password/reset-password.component';
import { RE_LOGIN_CONFIRMATION_TOKEN } from './tokens'; import { RE_LOGIN_CONFIRMATION_TOKEN } from './tokens';
import { ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS } from './tokens/extensions.token'; import { ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS } from './tokens/extensions.token';
import { AccountExtensionsGuard } from './guards/extensions.guard'; import { AccountExtensionsGuard } from './guards/extensions.guard';
import { PersonalSettingsHalfRowComponent } from './components/personal-settings/personal-settings-half-row.component'; import {
import { ExtensibleModule } from "@abp/ng.components/extensible"; ForgotPasswordComponent,
const declarations = [
LoginComponent, LoginComponent,
RegisterComponent,
ChangePasswordComponent,
ManageProfileComponent, ManageProfileComponent,
PersonalSettingsComponent, RegisterComponent,
ForgotPasswordComponent,
ResetPasswordComponent, ResetPasswordComponent,
PersonalSettingsHalfRowComponent, } from './components';
]; import { AccountRoutingModule } from './account-routing.module';
@NgModule({ @NgModule({
declarations: [...declarations], declarations: [],
imports: [ imports: [
CoreModule, LoginComponent,
RegisterComponent,
ForgotPasswordComponent,
ResetPasswordComponent,
ManageProfileComponent,
AccountRoutingModule, AccountRoutingModule,
ThemeSharedModule,
NgbDropdownModule,
NgxValidateCoreModule,
ExtensibleModule,
], ],
exports: [...declarations], exports: [],
}) })
export class AccountModule { export class AccountModule {
static forChild(options = {} as AccountConfigOptions): ModuleWithProviders<AccountModule> { static forChild(options = {} as AccountConfigOptions): ModuleWithProviders<AccountModule> {
@ -69,7 +53,9 @@ export class AccountModule {
], ],
}; };
} }
/**
* @deprecated `AccountModule.forLazy()` is deprecated. You can use `createRoutes` **function** instead.
*/
static forLazy(options = {} as AccountConfigOptions): NgModuleFactory<AccountModule> { static forLazy(options = {} as AccountConfigOptions): NgModuleFactory<AccountModule> {
return new LazyModuleFactory(AccountModule.forChild(options)); return new LazyModuleFactory(AccountModule.forChild(options));
} }

119
npm/ng-packs/packages/account/src/lib/account.routes.ts

@ -0,0 +1,119 @@
import { Routes } from '@angular/router';
import {
ForgotPasswordComponent,
LoginComponent,
RegisterComponent,
ResetPasswordComponent,
ManageProfileComponent,
} from './components';
import { eAccountComponents } from './enums';
import { authenticationFlowGuard } from './guards';
import { accountExtensionsResolver } from './resolvers';
import {
RE_LOGIN_CONFIRMATION_TOKEN,
ACCOUNT_CONFIG_OPTIONS,
ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS,
} from './tokens';
import { AccountConfigOptions } from './models';
import { accountConfigOptionsFactory } from './utils';
import {
authGuard,
ReplaceableComponents,
ReplaceableRouteContainerComponent,
RouterOutletComponent,
} from '@abp/ng.core';
export function provideAccount(options: AccountConfigOptions = {}) {
return [
{ provide: ACCOUNT_CONFIG_OPTIONS, useValue: options },
{
provide: 'ACCOUNT_OPTIONS',
useFactory: accountConfigOptionsFactory,
deps: [ACCOUNT_CONFIG_OPTIONS],
},
{
provide: RE_LOGIN_CONFIRMATION_TOKEN,
useValue: options.isPersonalSettingsChangedConfirmationActive ?? true,
},
{
provide: ACCOUNT_EDIT_FORM_PROP_CONTRIBUTORS,
useValue: options.editFormPropContributors,
},
];
}
const canActivate = [authenticationFlowGuard];
export const createRoutes = (options: AccountConfigOptions = {}): Routes => [
{
path: '',
component: RouterOutletComponent,
providers: provideAccount(options),
children: [
{ path: '', pathMatch: 'full', redirectTo: 'login' },
{
path: 'login',
component: ReplaceableRouteContainerComponent,
canActivate,
data: {
replaceableComponent: {
key: eAccountComponents.Login,
defaultComponent: LoginComponent,
} as ReplaceableComponents.RouteData<LoginComponent>,
},
title: 'AbpAccount::Login',
},
{
path: 'register',
component: ReplaceableRouteContainerComponent,
canActivate,
data: {
replaceableComponent: {
key: eAccountComponents.Register,
defaultComponent: RegisterComponent,
} as ReplaceableComponents.RouteData<RegisterComponent>,
},
title: 'AbpAccount::Register',
},
{
path: 'forgot-password',
component: ReplaceableRouteContainerComponent,
canActivate,
data: {
replaceableComponent: {
key: eAccountComponents.ForgotPassword,
defaultComponent: ForgotPasswordComponent,
} as ReplaceableComponents.RouteData<ForgotPasswordComponent>,
},
title: 'AbpAccount::ForgotPassword',
},
{
path: 'reset-password',
component: ReplaceableRouteContainerComponent,
canActivate: [],
data: {
tenantBoxVisible: false,
replaceableComponent: {
key: eAccountComponents.ResetPassword,
defaultComponent: ResetPasswordComponent,
} as ReplaceableComponents.RouteData<ResetPasswordComponent>,
},
title: 'AbpAccount::ResetPassword',
},
{
path: 'manage',
component: ReplaceableRouteContainerComponent,
canActivate: [authGuard],
resolve: [accountExtensionsResolver],
data: {
replaceableComponent: {
key: eAccountComponents.ManageProfile,
defaultComponent: ManageProfileComponent,
} as ReplaceableComponents.RouteData<ManageProfileComponent>,
},
title: 'AbpAccount::MyAccount',
},
],
},
];

2
npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.html

@ -1,4 +1,4 @@
<form [formGroup]="form" (ngSubmit)="onSubmit()" [mapErrorsFn]="mapErrorsFn" validateOnSubmit class="abp-md-form"> <form [formGroup]="form" (ngSubmit)="onSubmit()" [mapErrorsFn]="mapErrorsFn" [validateOnSubmit]="true" class="abp-md-form">
@if (!hideCurrentPassword) { @if (!hideCurrentPassword) {
<div class="mb-3 form-group"> <div class="mb-3 form-group">
<label for="current-password" class="form-label">{{ <label for="current-password" class="form-label">{{

19
npm/ng-packs/packages/account/src/lib/components/change-password/change-password.component.ts

@ -1,26 +1,33 @@
import { ProfileService } from '@abp/ng.account.core/proxy'; import { ProfileService } from '@abp/ng.account.core/proxy';
import { getPasswordValidators, ToasterService } from '@abp/ng.theme.shared'; import { ButtonComponent, getPasswordValidators, ToasterService } from '@abp/ng.theme.shared';
import { Component, Injector, OnInit } from '@angular/core'; import { Component, Injector, OnInit } from '@angular/core';
import { import {
ReactiveFormsModule,
UntypedFormBuilder, UntypedFormBuilder,
UntypedFormControl, UntypedFormControl,
UntypedFormGroup, UntypedFormGroup,
Validators, Validators,
} from '@angular/forms'; } from '@angular/forms';
import { comparePasswords, Validation } from '@ngx-validate/core';
import { finalize } from 'rxjs/operators'; import { finalize } from 'rxjs/operators';
import { Account } from '../../models/account'; import { Account } from '../../models';
import { ManageProfileStateService } from '../../services/manage-profile.state.service'; import { ManageProfileStateService } from '../../services';
import { comparePasswords, NgxValidateCoreModule, Validation } from '@ngx-validate/core';
import { AutofocusDirective, LocalizationPipe } from '@abp/ng.core';
const { required } = Validators; const { required } = Validators;
const PASSWORD_FIELDS = ['newPassword', 'repeatNewPassword']; const PASSWORD_FIELDS = ['newPassword', 'repeatNewPassword'];
@Component({ @Component({
standalone: false,
selector: 'abp-change-password-form', selector: 'abp-change-password-form',
templateUrl: './change-password.component.html', templateUrl: './change-password.component.html',
exportAs: 'abpChangePasswordForm', exportAs: 'abpChangePasswordForm',
imports: [
ReactiveFormsModule,
LocalizationPipe,
ButtonComponent,
NgxValidateCoreModule,
AutofocusDirective,
],
}) })
export class ChangePasswordComponent export class ChangePasswordComponent
implements OnInit, Account.ChangePasswordComponentInputs, Account.ChangePasswordComponentOutputs implements OnInit, Account.ChangePasswordComponentInputs, Account.ChangePasswordComponentOutputs

2
npm/ng-packs/packages/account/src/lib/components/forgot-password/forgot-password.component.html

@ -1,7 +1,7 @@
<h4>{{ 'AbpAccount::ForgotPassword' | abpLocalization }}</h4> <h4>{{ 'AbpAccount::ForgotPassword' | abpLocalization }}</h4>
@if (!isEmailSent) { @if (!isEmailSent) {
<form [formGroup]="form" (ngSubmit)="onSubmit()" validateOnSubmit> <form [formGroup]="form" (ngSubmit)="onSubmit()" [validateOnSubmit]="true">
<p>{{ 'AbpAccount::SendPasswordResetLink_Information' | abpLocalization }}</p> <p>{{ 'AbpAccount::SendPasswordResetLink_Information' | abpLocalization }}</p>
<div class="mb-3 form-group"> <div class="mb-3 form-group">
<label for="input-email-address" class="form-label">{{ <label for="input-email-address" class="form-label">{{

19
npm/ng-packs/packages/account/src/lib/components/forgot-password/forgot-password.component.ts

@ -1,12 +1,27 @@
import { AccountService } from '@abp/ng.account.core/proxy'; import { AccountService } from '@abp/ng.account.core/proxy';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import {
ReactiveFormsModule,
UntypedFormBuilder,
UntypedFormGroup,
Validators,
} from '@angular/forms';
import { finalize } from 'rxjs/operators'; import { finalize } from 'rxjs/operators';
import { LocalizationPipe } from '@abp/ng.core';
import { ButtonComponent } from '@abp/ng.theme.shared';
import { RouterModule } from '@angular/router';
import { NgxValidateCoreModule } from '@ngx-validate/core';
@Component({ @Component({
standalone: false,
selector: 'abp-forgot-password', selector: 'abp-forgot-password',
templateUrl: 'forgot-password.component.html', templateUrl: 'forgot-password.component.html',
imports: [
ReactiveFormsModule,
RouterModule,
LocalizationPipe,
ButtonComponent,
NgxValidateCoreModule,
],
}) })
export class ForgotPasswordComponent { export class ForgotPasswordComponent {
form: UntypedFormGroup; form: UntypedFormGroup;

31
npm/ng-packs/packages/account/src/lib/components/login/login.component.ts

@ -1,18 +1,37 @@
import { AuthService, ConfigStateService } from '@abp/ng.core';
import { ToasterService } from '@abp/ng.theme.shared';
import { Component, Injector, OnInit, inject } from '@angular/core'; import { Component, Injector, OnInit, inject } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import {
ReactiveFormsModule,
UntypedFormBuilder,
UntypedFormGroup,
Validators,
} from '@angular/forms';
import { RouterModule } from '@angular/router';
import { throwError } from 'rxjs'; import { throwError } from 'rxjs';
import { catchError, finalize } from 'rxjs/operators'; import { catchError, finalize } from 'rxjs/operators';
import { eAccountComponents } from '../../enums/components'; import {
import { getRedirectUrl } from '../../utils/auth-utils'; AuthService,
AutofocusDirective,
ConfigStateService,
LocalizationPipe,
NgxValidateCoreModule,
} from '@abp/ng.core';
import { ButtonComponent, ToasterService } from '@abp/ng.theme.shared';
import { eAccountComponents } from '../../enums';
import { getRedirectUrl } from '../../utils';
const { maxLength, required } = Validators; const { maxLength, required } = Validators;
@Component({ @Component({
standalone: false,
selector: 'abp-login', selector: 'abp-login',
templateUrl: './login.component.html', templateUrl: './login.component.html',
imports: [
ReactiveFormsModule,
RouterModule,
LocalizationPipe,
ButtonComponent,
NgxValidateCoreModule,
AutofocusDirective,
],
}) })
export class LoginComponent implements OnInit { export class LoginComponent implements OnInit {
protected injector = inject(Injector); protected injector = inject(Injector);

18
npm/ng-packs/packages/account/src/lib/components/manage-profile/manage-profile.component.ts

@ -1,22 +1,36 @@
import { ProfileService } from '@abp/ng.account.core/proxy'; import { ProfileService } from '@abp/ng.account.core/proxy';
import { fadeIn } from '@abp/ng.theme.shared'; import { fadeIn, LoadingDirective } from '@abp/ng.theme.shared';
import { transition, trigger, useAnimation } from '@angular/animations'; import { transition, trigger, useAnimation } from '@angular/animations';
import { Component, OnInit } from '@angular/core'; import { Component, OnInit } from '@angular/core';
import { eAccountComponents } from '../../enums/components'; import { eAccountComponents } from '../../enums/components';
import { ManageProfileStateService } from '../../services/manage-profile.state.service'; import { ManageProfileStateService } from '../../services/manage-profile.state.service';
import { CommonModule } from '@angular/common';
import { ReactiveFormsModule } from '@angular/forms';
import { LocalizationPipe, ReplaceableTemplateDirective } from '@abp/ng.core';
import { PersonalSettingsComponent } from '../personal-settings/personal-settings.component';
import { ChangePasswordComponent } from '../change-password/change-password.component';
@Component({ @Component({
standalone: false,
selector: 'abp-manage-profile', selector: 'abp-manage-profile',
templateUrl: './manage-profile.component.html', templateUrl: './manage-profile.component.html',
animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])], animations: [trigger('fadeIn', [transition(':enter', useAnimation(fadeIn))])],
styles: [ styles: [
//TODO: move static styles
` `
.min-h-400 { .min-h-400 {
min-height: 400px; min-height: 400px;
} }
`, `,
], ],
imports: [
CommonModule,
ReactiveFormsModule,
PersonalSettingsComponent,
ChangePasswordComponent,
LocalizationPipe,
ReplaceableTemplateDirective,
LoadingDirective,
],
}) })
export class ManageProfileComponent implements OnInit { export class ManageProfileComponent implements OnInit {
selectedTab = 0; selectedTab = 0;

5
npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings-half-row.component.ts

@ -4,10 +4,10 @@ import {
FormProp, FormProp,
EXTENSIBLE_FORM_VIEW_PROVIDER, EXTENSIBLE_FORM_VIEW_PROVIDER,
} from '@abp/ng.components/extensible'; } from '@abp/ng.components/extensible';
import { UntypedFormGroup } from '@angular/forms'; import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
import { LocalizationPipe } from '@abp/ng.core';
@Component({ @Component({
standalone: false,
selector: 'abp-personal-settings-half-row', selector: 'abp-personal-settings-half-row',
template: ` <div class="w-50 d-inline"> template: ` <div class="w-50 d-inline">
<label [attr.for]="name" class="form-label">{{ displayName | abpLocalization }} </label> <label [attr.for]="name" class="form-label">{{ displayName | abpLocalization }} </label>
@ -21,6 +21,7 @@ import { UntypedFormGroup } from '@angular/forms';
</div>`, </div>`,
styles: [], styles: [],
viewProviders: [EXTENSIBLE_FORM_VIEW_PROVIDER], viewProviders: [EXTENSIBLE_FORM_VIEW_PROVIDER],
imports: [ReactiveFormsModule, LocalizationPipe],
}) })
export class PersonalSettingsHalfRowComponent { export class PersonalSettingsHalfRowComponent {
public displayName: string; public displayName: string;

21
npm/ng-packs/packages/account/src/lib/components/personal-settings/personal-settings.component.ts

@ -1,21 +1,27 @@
import { ProfileDto, ProfileService } from '@abp/ng.account.core/proxy'; import { ProfileDto, ProfileService } from '@abp/ng.account.core/proxy';
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared'; import {
ButtonComponent,
Confirmation,
ConfirmationService,
ToasterService,
} from '@abp/ng.theme.shared';
import { Component, inject, Injector, OnInit } from '@angular/core'; import { Component, inject, Injector, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import { ReactiveFormsModule, UntypedFormBuilder, UntypedFormGroup } from '@angular/forms';
import { finalize, filter } from 'rxjs/operators'; import { finalize, filter } from 'rxjs/operators';
import { Account } from '../../models/account'; import { Account } from '../../models/account';
import { ManageProfileStateService } from '../../services/manage-profile.state.service'; import { ManageProfileStateService } from '../../services/manage-profile.state.service';
import { AuthService, ConfigStateService } from '@abp/ng.core'; import { AuthService, ConfigStateService, LocalizationPipe } from '@abp/ng.core';
import { RE_LOGIN_CONFIRMATION_TOKEN } from '../../tokens'; import { RE_LOGIN_CONFIRMATION_TOKEN } from '../../tokens';
import { import {
ExtensibleFormComponent,
EXTENSIONS_IDENTIFIER, EXTENSIONS_IDENTIFIER,
FormPropData, FormPropData,
generateFormFromProps, generateFormFromProps,
} from '@abp/ng.components/extensible'; } from '@abp/ng.components/extensible';
import { eAccountComponents } from '../../enums'; import { eAccountComponents } from '../../enums';
import { NgxValidateCoreModule } from '@ngx-validate/core';
@Component({ @Component({
standalone: false,
selector: 'abp-personal-settings-form', selector: 'abp-personal-settings-form',
templateUrl: './personal-settings.component.html', templateUrl: './personal-settings.component.html',
exportAs: 'abpPersonalSettingsForm', exportAs: 'abpPersonalSettingsForm',
@ -25,6 +31,13 @@ import { eAccountComponents } from '../../enums';
useValue: eAccountComponents.PersonalSettings, useValue: eAccountComponents.PersonalSettings,
}, },
], ],
imports: [
ReactiveFormsModule,
ExtensibleFormComponent,
NgxValidateCoreModule,
ButtonComponent,
LocalizationPipe,
],
}) })
export class PersonalSettingsComponent export class PersonalSettingsComponent
implements implements

27
npm/ng-packs/packages/account/src/lib/components/register/register.component.ts

@ -1,19 +1,38 @@
import { AccountService, RegisterDto } from '@abp/ng.account.core/proxy'; import { AccountService, RegisterDto } from '@abp/ng.account.core/proxy';
import { AuthService, ConfigStateService } from '@abp/ng.core'; import {
import { getPasswordValidators, ToasterService } from '@abp/ng.theme.shared'; AuthService,
AutofocusDirective,
ConfigStateService,
LocalizationPipe,
} from '@abp/ng.core';
import { ButtonComponent, getPasswordValidators, ToasterService } from '@abp/ng.theme.shared';
import { Component, Injector, OnInit } from '@angular/core'; import { Component, Injector, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import {
ReactiveFormsModule,
UntypedFormBuilder,
UntypedFormGroup,
Validators,
} from '@angular/forms';
import { throwError } from 'rxjs'; import { throwError } from 'rxjs';
import { catchError, finalize, switchMap } from 'rxjs/operators'; import { catchError, finalize, switchMap } from 'rxjs/operators';
import { eAccountComponents } from '../../enums/components'; import { eAccountComponents } from '../../enums/components';
import { getRedirectUrl } from '../../utils/auth-utils'; import { getRedirectUrl } from '../../utils/auth-utils';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { RouterModule } from '@angular/router';
const { maxLength, required, email } = Validators; const { maxLength, required, email } = Validators;
@Component({ @Component({
standalone: false,
selector: 'abp-register', selector: 'abp-register',
templateUrl: './register.component.html', templateUrl: './register.component.html',
imports: [
ReactiveFormsModule,
RouterModule,
NgxValidateCoreModule,
LocalizationPipe,
ButtonComponent,
AutofocusDirective,
],
}) })
export class RegisterComponent implements OnInit { export class RegisterComponent implements OnInit {
form!: UntypedFormGroup; form!: UntypedFormGroup;

22
npm/ng-packs/packages/account/src/lib/components/reset-password/reset-password.component.ts

@ -1,17 +1,29 @@
import { AccountService } from '@abp/ng.account.core/proxy'; import { AccountService } from '@abp/ng.account.core/proxy';
import { getPasswordValidators } from '@abp/ng.theme.shared'; import { ButtonComponent, getPasswordValidators } from '@abp/ng.theme.shared';
import { Component, Injector, OnInit } from '@angular/core'; import { Component, Injector, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import {
import { ActivatedRoute, Router } from '@angular/router'; ReactiveFormsModule,
import { comparePasswords, Validation } from '@ngx-validate/core'; UntypedFormBuilder,
UntypedFormGroup,
Validators,
} from '@angular/forms';
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
import { comparePasswords, NgxValidateCoreModule, Validation } from '@ngx-validate/core';
import { finalize } from 'rxjs/operators'; import { finalize } from 'rxjs/operators';
import { LocalizationPipe } from '@abp/ng.core';
const PASSWORD_FIELDS = ['password', 'confirmPassword']; const PASSWORD_FIELDS = ['password', 'confirmPassword'];
@Component({ @Component({
standalone: false,
selector: 'abp-reset-password', selector: 'abp-reset-password',
templateUrl: './reset-password.component.html', templateUrl: './reset-password.component.html',
imports: [
ReactiveFormsModule,
RouterModule,
NgxValidateCoreModule,
LocalizationPipe,
ButtonComponent,
],
}) })
export class ResetPasswordComponent implements OnInit { export class ResetPasswordComponent implements OnInit {
form!: UntypedFormGroup; form!: UntypedFormGroup;

1
npm/ng-packs/packages/account/src/public-api.ts

@ -7,3 +7,4 @@ export * from './lib/services';
export * from './lib/tokens'; export * from './lib/tokens';
export * from './lib/utils'; export * from './lib/utils';
export * from './lib/resolvers'; export * from './lib/resolvers';
export * from './lib/account.routes';

1
npm/ng-packs/packages/components/chart.js/src/chart.component.ts

@ -16,7 +16,6 @@ import {
let Chart: any; let Chart: any;
@Component({ @Component({
standalone: false,
selector: 'abp-chart', selector: 'abp-chart',
template: ` template: `
<div <div

5
npm/ng-packs/packages/components/chart.js/src/chart.module.ts

@ -1,11 +1,10 @@
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { ChartComponent } from './chart.component'; import { ChartComponent } from './chart.component';
@NgModule({ @NgModule({
imports: [CommonModule], imports: [ChartComponent],
exports: [ChartComponent], exports: [ChartComponent],
declarations: [ChartComponent], declarations: [],
providers: [], providers: [],
}) })
export class ChartModule {} export class ChartModule {}

1
npm/ng-packs/packages/components/extensible/src/lib/directives/prop-data.directive.ts

@ -13,7 +13,6 @@ import { PropData, PropList } from '../models/props';
@Directive({ @Directive({
exportAs: 'abpPropData', exportAs: 'abpPropData',
selector: '[abpPropData]', selector: '[abpPropData]',
standalone: true,
}) })
export class PropDataDirective<L extends PropList<any>> export class PropDataDirective<L extends PropList<any>>
extends PropData<InferredData<L>> extends PropData<InferredData<L>>

1
npm/ng-packs/packages/components/extensible/src/lib/pipes/create-injector.pipe.ts

@ -12,7 +12,6 @@ import { EXTENSIONS_ACTION_CALLBACK, EXTENSIONS_ACTION_DATA } from '../tokens/ex
@Pipe({ @Pipe({
name: 'createInjector', name: 'createInjector',
standalone: true,
}) })
export class CreateInjectorPipe<R> implements PipeTransform { export class CreateInjectorPipe<R> implements PipeTransform {
public transform( public transform(

1
npm/ng-packs/packages/components/page/src/page-part.directive.ts

@ -25,7 +25,6 @@ export interface PageRenderStrategy {
export const PAGE_RENDER_STRATEGY = new InjectionToken<PageRenderStrategy>('PAGE_RENDER_STRATEGY'); export const PAGE_RENDER_STRATEGY = new InjectionToken<PageRenderStrategy>('PAGE_RENDER_STRATEGY');
@Directive({ @Directive({
standalone: false,
selector: '[abpPagePart]', selector: '[abpPagePart]',
}) })
export class PagePartDirective implements OnInit, OnDestroy, OnChanges { export class PagePartDirective implements OnInit, OnDestroy, OnChanges {

3
npm/ng-packs/packages/components/page/src/page-parts.component.ts

@ -7,7 +7,6 @@ export enum PageParts {
} }
@Component({ @Component({
standalone: false,
selector: 'abp-page-title-container', selector: 'abp-page-title-container',
template: ` <ng-content></ng-content> `, template: ` <ng-content></ng-content> `,
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
@ -15,7 +14,6 @@ export enum PageParts {
export class PageTitleContainerComponent {} export class PageTitleContainerComponent {}
@Component({ @Component({
standalone: false,
selector: 'abp-page-breadcrumb-container', selector: 'abp-page-breadcrumb-container',
template: ` <ng-content></ng-content> `, template: ` <ng-content></ng-content> `,
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
@ -23,7 +21,6 @@ export class PageTitleContainerComponent {}
export class PageBreadcrumbContainerComponent {} export class PageBreadcrumbContainerComponent {}
@Component({ @Component({
standalone: false,
selector: 'abp-page-toolbar-container', selector: 'abp-page-toolbar-container',
template: ` <ng-content></ng-content> `, template: ` <ng-content></ng-content> `,
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,

5
npm/ng-packs/packages/components/page/src/page.component.ts

@ -5,12 +5,15 @@ import {
PageToolbarContainerComponent, PageToolbarContainerComponent,
PageParts, PageParts,
} from './page-parts.component'; } from './page-parts.component';
import { BreadcrumbComponent } from '@abp/ng.theme.shared';
import { PageToolbarComponent } from '@abp/ng.components/extensible';
import { PagePartDirective } from './page-part.directive';
@Component({ @Component({
standalone: false,
selector: 'abp-page', selector: 'abp-page',
templateUrl: './page.component.html', templateUrl: './page.component.html',
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
imports: [BreadcrumbComponent, PageToolbarComponent, PagePartDirective],
}) })
export class PageComponent { export class PageComponent {
@Input() title?: string; @Input() title?: string;

11
npm/ng-packs/packages/components/page/src/page.module.ts

@ -1,5 +1,3 @@
import { CoreModule } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { PagePartDirective } from './page-part.directive'; import { PagePartDirective } from './page-part.directive';
import { import {
@ -8,9 +6,8 @@ import {
PageToolbarContainerComponent, PageToolbarContainerComponent,
} from './page-parts.component'; } from './page-parts.component';
import { PageComponent } from './page.component'; import { PageComponent } from './page.component';
import {PageToolbarComponent} from "@abp/ng.components/extensible";
const exportedDeclarations = [ export const PAGE_EXPORTS = [
PageComponent, PageComponent,
PageTitleContainerComponent, PageTitleContainerComponent,
PageBreadcrumbContainerComponent, PageBreadcrumbContainerComponent,
@ -19,8 +16,8 @@ const exportedDeclarations = [
]; ];
@NgModule({ @NgModule({
declarations: [...exportedDeclarations], declarations: [],
imports: [CoreModule, ThemeSharedModule, PageToolbarComponent], imports: [...PAGE_EXPORTS],
exports: [...exportedDeclarations], exports: [...PAGE_EXPORTS],
}) })
export class PageModule {} export class PageModule {}

28
npm/ng-packs/packages/components/tree/src/lib/components/tree.component.ts

@ -11,24 +11,44 @@ import {
TemplateRef, TemplateRef,
ViewEncapsulation, ViewEncapsulation,
} from '@angular/core'; } from '@angular/core';
import { NgbDropdown } from '@ng-bootstrap/ng-bootstrap'; import { NgbDropdown, NgbDropdownMenu, NgbDropdownToggle } from '@ng-bootstrap/ng-bootstrap';
import { NzFormatBeforeDropEvent, NzFormatEmitEvent, NzTreeNode } from 'ng-zorro-antd/tree'; import {
import { LazyLoadService, LOADING_STRATEGY, SubscriptionService } from '@abp/ng.core'; NzFormatBeforeDropEvent,
NzFormatEmitEvent,
NzTreeComponent,
NzTreeNode,
} from 'ng-zorro-antd/tree';
import {
InitDirective,
LazyLoadService,
LOADING_STRATEGY,
SubscriptionService,
} from '@abp/ng.core';
import { of } from 'rxjs'; import { of } from 'rxjs';
import { DISABLE_TREE_STYLE_LOADING_TOKEN } from '../disable-tree-style-loading.token'; import { DISABLE_TREE_STYLE_LOADING_TOKEN } from '../disable-tree-style-loading.token';
import { TreeNodeTemplateDirective } from '../templates/tree-node-template.directive'; import { TreeNodeTemplateDirective } from '../templates/tree-node-template.directive';
import { ExpandedIconTemplateDirective } from '../templates/expanded-icon-template.directive'; import { ExpandedIconTemplateDirective } from '../templates/expanded-icon-template.directive';
import { CommonModule } from '@angular/common';
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
export type DropEvent = NzFormatEmitEvent & { pos: number }; export type DropEvent = NzFormatEmitEvent & { pos: number };
@Component({ @Component({
standalone: false,
selector: 'abp-tree', selector: 'abp-tree',
templateUrl: 'tree.component.html', templateUrl: 'tree.component.html',
styleUrls: ['tree.component.scss'], styleUrls: ['tree.component.scss'],
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
providers: [SubscriptionService], providers: [SubscriptionService],
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
imports: [
CommonModule,
NzTreeComponent,
NgbDropdown,
NgbDropdownMenu,
NgbDropdownToggle,
InitDirective,
NzNoAnimationDirective,
],
}) })
export class TreeComponent implements OnInit { export class TreeComponent implements OnInit {
private lazyLoadService = inject(LazyLoadService); private lazyLoadService = inject(LazyLoadService);

1
npm/ng-packs/packages/components/tree/src/lib/templates/expanded-icon-template.directive.ts

@ -1,7 +1,6 @@
import { Directive, TemplateRef } from '@angular/core'; import { Directive, TemplateRef } from '@angular/core';
@Directive({ @Directive({
standalone: false,
selector: '[abpTreeExpandedIconTemplate],[abp-tree-expanded-icon-template]', selector: '[abpTreeExpandedIconTemplate],[abp-tree-expanded-icon-template]',
}) })
export class ExpandedIconTemplateDirective { export class ExpandedIconTemplateDirective {

1
npm/ng-packs/packages/components/tree/src/lib/templates/tree-node-template.directive.ts

@ -1,7 +1,6 @@
import { Directive, TemplateRef } from '@angular/core'; import { Directive, TemplateRef } from '@angular/core';
@Directive({ @Directive({
standalone: false,
selector: '[abpTreeNodeTemplate],[abp-tree-node-template]', selector: '[abpTreeNodeTemplate],[abp-tree-node-template]',
}) })
export class TreeNodeTemplateDirective { export class TreeNodeTemplateDirective {

14
npm/ng-packs/packages/components/tree/src/lib/tree.module.ts

@ -1,19 +1,11 @@
import { CoreModule } from '@abp/ng.core';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
import { NzTreeModule } from 'ng-zorro-antd/tree';
import { TreeComponent } from './components/tree.component'; import { TreeComponent } from './components/tree.component';
import { ExpandedIconTemplateDirective } from './templates/expanded-icon-template.directive'; import { ExpandedIconTemplateDirective } from './templates/expanded-icon-template.directive';
import { TreeNodeTemplateDirective } from './templates/tree-node-template.directive'; import { TreeNodeTemplateDirective } from './templates/tree-node-template.directive';
const templates = [TreeNodeTemplateDirective, ExpandedIconTemplateDirective];
const exported = [...templates, TreeComponent];
@NgModule({ @NgModule({
imports: [CoreModule, NzTreeModule, NgbDropdownModule, NzNoAnimationModule], imports: [TreeComponent, TreeNodeTemplateDirective, ExpandedIconTemplateDirective],
exports: [...exported], exports: [TreeComponent, TreeNodeTemplateDirective, ExpandedIconTemplateDirective],
declarations: [...exported], declarations: [],
}) })
export class TreeModule {} export class TreeModule {}

1
npm/ng-packs/packages/core/src/lib/abstracts/ng-model.component.ts

@ -3,7 +3,6 @@ import { ControlValueAccessor } from '@angular/forms';
// Not an abstract class on purpose. Do not change! // Not an abstract class on purpose. Do not change!
@Component({ @Component({
standalone: false,
template: '', template: '',
}) })
export class AbstractNgModelComponent<T = any, U = T> implements ControlValueAccessor { export class AbstractNgModelComponent<T = any, U = T> implements ControlValueAccessor {

3
npm/ng-packs/packages/core/src/lib/components/dynamic-layout.component.ts

@ -12,9 +12,9 @@ import { findRoute, getRoutePath } from '../utils/route-utils';
import { TreeNode } from '../utils/tree-utils'; import { TreeNode } from '../utils/tree-utils';
import { DYNAMIC_LAYOUTS_TOKEN } from '../tokens/dynamic-layout.token'; import { DYNAMIC_LAYOUTS_TOKEN } from '../tokens/dynamic-layout.token';
import { EnvironmentService } from '../services'; import { EnvironmentService } from '../services';
import { CommonModule } from '@angular/common';
@Component({ @Component({
standalone: false,
selector: 'abp-dynamic-layout', selector: 'abp-dynamic-layout',
template: ` template: `
@if (isLayoutVisible) { @if (isLayoutVisible) {
@ -22,6 +22,7 @@ import { EnvironmentService } from '../services';
} }
`, `,
providers: [SubscriptionService], providers: [SubscriptionService],
imports: [CommonModule],
}) })
export class DynamicLayoutComponent implements OnInit { export class DynamicLayoutComponent implements OnInit {
layout?: Type<any>; layout?: Type<any>;

3
npm/ng-packs/packages/core/src/lib/components/replaceable-route-container.component.ts

@ -4,14 +4,15 @@ import { distinctUntilChanged } from 'rxjs/operators';
import { ReplaceableComponents } from '../models/replaceable-components'; import { ReplaceableComponents } from '../models/replaceable-components';
import { ReplaceableComponentsService } from '../services/replaceable-components.service'; import { ReplaceableComponentsService } from '../services/replaceable-components.service';
import { SubscriptionService } from '../services/subscription.service'; import { SubscriptionService } from '../services/subscription.service';
import { CommonModule } from '@angular/common';
@Component({ @Component({
standalone: false,
selector: 'abp-replaceable-route-container', selector: 'abp-replaceable-route-container',
template: ` template: `
<ng-container *ngComponentOutlet="externalComponent || defaultComponent"></ng-container> <ng-container *ngComponentOutlet="externalComponent || defaultComponent"></ng-container>
`, `,
providers: [SubscriptionService], providers: [SubscriptionService],
imports: [CommonModule],
}) })
export class ReplaceableRouteContainerComponent implements OnInit { export class ReplaceableRouteContainerComponent implements OnInit {
defaultComponent!: Type<any>; defaultComponent!: Type<any>;

3
npm/ng-packs/packages/core/src/lib/components/router-outlet.component.ts

@ -1,8 +1,9 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';
@Component({ @Component({
standalone: false,
selector: 'abp-router-outlet', selector: 'abp-router-outlet',
template: ` <router-outlet></router-outlet> `, template: ` <router-outlet></router-outlet> `,
imports: [RouterModule],
}) })
export class RouterOutletComponent {} export class RouterOutletComponent {}

111
npm/ng-packs/packages/core/src/lib/core.module.ts

@ -3,37 +3,43 @@ import {
provideHttpClient, provideHttpClient,
withInterceptorsFromDi, withInterceptorsFromDi,
withXsrfConfiguration, withXsrfConfiguration,
HTTP_INTERCEPTORS,
} from '@angular/common/http'; } from '@angular/common/http';
import { ModuleWithProviders, NgModule } from '@angular/core'; import { ModuleWithProviders, NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { RouterModule } from '@angular/router'; import { RouterModule } from '@angular/router';
import { AbstractNgModelComponent } from './abstracts/ng-model.component'; import { AbstractNgModelComponent } from './abstracts';
import { DynamicLayoutComponent } from './components/dynamic-layout.component'; import {
import { ReplaceableRouteContainerComponent } from './components/replaceable-route-container.component'; DynamicLayoutComponent,
import { RouterOutletComponent } from './components/router-outlet.component'; ReplaceableRouteContainerComponent,
import { AutofocusDirective } from './directives/autofocus.directive'; RouterOutletComponent,
import { InputEventDebounceDirective } from './directives/debounce.directive'; } from './components';
import { ForDirective } from './directives/for.directive'; import { NgxValidateCoreModule } from '@ngx-validate/core';
import { FormSubmitDirective } from './directives/form-submit.directive'; import {
import { InitDirective } from './directives/init.directive'; StopPropagationDirective,
import { PermissionDirective } from './directives/permission.directive'; ReplaceableTemplateDirective,
import { ReplaceableTemplateDirective } from './directives/replaceable-template.directive'; PermissionDirective,
import { StopPropagationDirective } from './directives/stop-propagation.directive'; InitDirective,
import { LocalizationModule } from './localization.module'; ForDirective,
InputEventDebounceDirective,
AutofocusDirective,
FormSubmitDirective,
} from './directives';
import { ABP } from './models/common'; import { ABP } from './models/common';
import { LocalizationPipe } from './pipes/localization.pipe';
import { SortPipe } from './pipes/sort.pipe';
import { ToInjectorPipe } from './pipes/to-injector.pipe';
import './utils/date-extensions'; import './utils/date-extensions';
import { ShortDateTimePipe } from './pipes/short-date-time.pipe';
import { ShortTimePipe } from './pipes/short-time.pipe';
import { ShortDatePipe } from './pipes/short-date.pipe';
import { SafeHtmlPipe } from './pipes/safe-html.pipe';
import { provideAbpCoreChild, provideAbpCore, withOptions } from './providers'; import { provideAbpCoreChild, provideAbpCore, withOptions } from './providers';
import { UtcToLocalPipe } from './pipes'; import {
LazyLocalizationPipe,
UtcToLocalPipe,
SafeHtmlPipe,
ShortDatePipe,
ShortTimePipe,
ShortDateTimePipe,
ToInjectorPipe,
SortPipe,
LocalizationPipe,
} from './pipes';
const standaloneDirectives = [ const CORE_DIRECTIVES = [
AutofocusDirective, AutofocusDirective,
InputEventDebounceDirective, InputEventDebounceDirective,
ForDirective, ForDirective,
@ -43,6 +49,25 @@ const standaloneDirectives = [
ReplaceableTemplateDirective, ReplaceableTemplateDirective,
StopPropagationDirective, StopPropagationDirective,
]; ];
const CORE_PIPES = [
LocalizationPipe,
SortPipe,
SafeHtmlPipe,
ShortDateTimePipe,
ShortTimePipe,
ShortDatePipe,
ToInjectorPipe,
UtcToLocalPipe,
LazyLocalizationPipe,
];
const CORE_COMPONENTS = [
DynamicLayoutComponent,
ReplaceableRouteContainerComponent,
RouterOutletComponent,
AbstractNgModelComponent,
];
/** /**
* BaseCoreModule is the module that holds * BaseCoreModule is the module that holds
* all imports, declarations, exports, and entryComponents * all imports, declarations, exports, and entryComponents
@ -55,40 +80,22 @@ const standaloneDirectives = [
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
RouterModule, RouterModule,
LocalizationModule, NgxValidateCoreModule,
AbstractNgModelComponent, ...CORE_DIRECTIVES,
DynamicLayoutComponent, ...CORE_PIPES,
ReplaceableRouteContainerComponent, ...CORE_COMPONENTS,
RouterOutletComponent,
SortPipe,
SafeHtmlPipe,
ToInjectorPipe,
ShortDateTimePipe,
ShortTimePipe,
ShortDatePipe,
...standaloneDirectives,
], ],
imports: [ imports: [
CommonModule, CommonModule,
FormsModule, FormsModule,
ReactiveFormsModule, ReactiveFormsModule,
RouterModule, RouterModule,
LocalizationModule, NgxValidateCoreModule,
UtcToLocalPipe, ...CORE_DIRECTIVES,
...standaloneDirectives, ...CORE_PIPES,
], ...CORE_COMPONENTS,
declarations: [
AbstractNgModelComponent,
DynamicLayoutComponent,
ReplaceableRouteContainerComponent,
RouterOutletComponent,
SortPipe,
SafeHtmlPipe,
ToInjectorPipe,
ShortDateTimePipe,
ShortTimePipe,
ShortDatePipe,
], ],
declarations: [],
providers: [LocalizationPipe, provideHttpClient(withInterceptorsFromDi())], providers: [LocalizationPipe, provideHttpClient(withInterceptorsFromDi())],
}) })
export class BaseCoreModule {} export class BaseCoreModule {}
@ -98,8 +105,8 @@ export class BaseCoreModule {}
* and it introduces imports useful at root level (e.g. NGXS) * and it introduces imports useful at root level (e.g. NGXS)
*/ */
@NgModule({ @NgModule({
exports: [BaseCoreModule, LocalizationModule], exports: [BaseCoreModule],
imports: [BaseCoreModule, LocalizationModule], imports: [BaseCoreModule],
providers: [ providers: [
provideHttpClient( provideHttpClient(
withXsrfConfiguration({ withXsrfConfiguration({

1
npm/ng-packs/packages/core/src/lib/directives/autofocus.directive.ts

@ -1,7 +1,6 @@
import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core'; import { AfterViewInit, Directive, ElementRef, Input } from '@angular/core';
@Directive({ @Directive({
standalone: true,
selector: '[autofocus]', selector: '[autofocus]',
}) })
export class AutofocusDirective implements AfterViewInit { export class AutofocusDirective implements AfterViewInit {

1
npm/ng-packs/packages/core/src/lib/directives/caps-lock.directive.ts

@ -1,7 +1,6 @@
import { Directive, EventEmitter, HostListener, Output } from '@angular/core'; import { Directive, EventEmitter, HostListener, Output } from '@angular/core';
@Directive({ @Directive({
standalone: true,
selector: '[abpCapsLock]', selector: '[abpCapsLock]',
}) })
export class TrackCapsLockDirective { export class TrackCapsLockDirective {

6
npm/ng-packs/packages/core/src/lib/directives/debounce.directive.ts

@ -4,7 +4,6 @@ import { debounceTime } from 'rxjs/operators';
import { SubscriptionService } from '../services/subscription.service'; import { SubscriptionService } from '../services/subscription.service';
@Directive({ @Directive({
standalone: true,
selector: '[input.debounce]', selector: '[input.debounce]',
providers: [SubscriptionService], providers: [SubscriptionService],
}) })
@ -13,7 +12,10 @@ export class InputEventDebounceDirective implements OnInit {
@Output('input.debounce') readonly debounceEvent = new EventEmitter<Event>(); @Output('input.debounce') readonly debounceEvent = new EventEmitter<Event>();
constructor(private el: ElementRef, private subscription: SubscriptionService) {} constructor(
private el: ElementRef,
private subscription: SubscriptionService,
) {}
ngOnInit(): void { ngOnInit(): void {
const input$ = fromEvent<InputEvent>(this.el.nativeElement, 'input').pipe( const input$ = fromEvent<InputEvent>(this.el.nativeElement, 'input').pipe(

1
npm/ng-packs/packages/core/src/lib/directives/for.directive.ts

@ -33,7 +33,6 @@ class RecordView {
} }
@Directive({ @Directive({
standalone: true,
selector: '[abpFor]', selector: '[abpFor]',
}) })
export class ForDirective implements OnChanges { export class ForDirective implements OnChanges {

1
npm/ng-packs/packages/core/src/lib/directives/form-submit.directive.ts

@ -18,7 +18,6 @@ type Controls = { [key: string]: UntypedFormControl } | UntypedFormGroup[];
* @deprecated FormSubmitDirective will be removed in V7.0.0. Use `ngSubmit` instead. * @deprecated FormSubmitDirective will be removed in V7.0.0. Use `ngSubmit` instead.
*/ */
@Directive({ @Directive({
standalone: true,
selector: 'form[ngSubmit][formGroup]', selector: 'form[ngSubmit][formGroup]',
providers: [SubscriptionService], providers: [SubscriptionService],
}) })

1
npm/ng-packs/packages/core/src/lib/directives/init.directive.ts

@ -1,7 +1,6 @@
import { Directive, Output, EventEmitter, ElementRef, AfterViewInit } from '@angular/core'; import { Directive, Output, EventEmitter, ElementRef, AfterViewInit } from '@angular/core';
@Directive({ @Directive({
standalone: true,
selector: '[abpInit]', selector: '[abpInit]',
}) })
export class InitDirective implements AfterViewInit { export class InitDirective implements AfterViewInit {

1
npm/ng-packs/packages/core/src/lib/directives/permission.directive.ts

@ -17,7 +17,6 @@ import { QUEUE_MANAGER } from '../tokens/queue.token';
import { QueueManager } from '../utils/queue'; import { QueueManager } from '../utils/queue';
@Directive({ @Directive({
standalone: true,
selector: '[abpPermission]', selector: '[abpPermission]',
}) })
export class PermissionDirective implements OnDestroy, OnChanges, AfterViewInit { export class PermissionDirective implements OnDestroy, OnChanges, AfterViewInit {

1
npm/ng-packs/packages/core/src/lib/directives/replaceable-template.directive.ts

@ -18,7 +18,6 @@ import { ReplaceableComponentsService } from '../services/replaceable-components
import { SubscriptionService } from '../services/subscription.service'; import { SubscriptionService } from '../services/subscription.service';
@Directive({ @Directive({
standalone: true,
selector: '[abpReplaceableTemplate]', selector: '[abpReplaceableTemplate]',
providers: [SubscriptionService], providers: [SubscriptionService],
}) })

1
npm/ng-packs/packages/core/src/lib/directives/show-password.directive.ts

@ -1,7 +1,6 @@
import { Directive, ElementRef, Input, inject } from '@angular/core'; import { Directive, ElementRef, Input, inject } from '@angular/core';
@Directive({ @Directive({
standalone: true,
selector: '[abpShowPassword]', selector: '[abpShowPassword]',
}) })
export class ShowPasswordDirective { export class ShowPasswordDirective {

6
npm/ng-packs/packages/core/src/lib/directives/stop-propagation.directive.ts

@ -3,14 +3,16 @@ import { fromEvent } from 'rxjs';
import { SubscriptionService } from '../services/subscription.service'; import { SubscriptionService } from '../services/subscription.service';
@Directive({ @Directive({
standalone: true,
selector: '[click.stop]', selector: '[click.stop]',
providers: [SubscriptionService], providers: [SubscriptionService],
}) })
export class StopPropagationDirective implements OnInit { export class StopPropagationDirective implements OnInit {
@Output('click.stop') readonly stopPropEvent = new EventEmitter<MouseEvent>(); @Output('click.stop') readonly stopPropEvent = new EventEmitter<MouseEvent>();
constructor(private el: ElementRef, private subscription: SubscriptionService) {} constructor(
private el: ElementRef,
private subscription: SubscriptionService,
) {}
ngOnInit(): void { ngOnInit(): void {
this.subscription.addOne(fromEvent<MouseEvent>(this.el.nativeElement, 'click'), event => { this.subscription.addOne(fromEvent<MouseEvent>(this.el.nativeElement, 'click'), event => {

8
npm/ng-packs/packages/core/src/lib/localization.module.ts

@ -2,9 +2,13 @@ import { NgModule } from '@angular/core';
import { LocalizationPipe } from './pipes/localization.pipe'; import { LocalizationPipe } from './pipes/localization.pipe';
import { LazyLocalizationPipe } from './pipes'; import { LazyLocalizationPipe } from './pipes';
/**
* @deprecated Use `LocalizationPipe` and `LazyLocalizationPipe` directly as a standalone pipe.
* This module is no longer necessary for using the `LocalizationPipe` and `LazyLocalizationPipe` pipes.
*/
@NgModule({ @NgModule({
imports: [LazyLocalizationPipe],
exports: [LocalizationPipe, LazyLocalizationPipe], exports: [LocalizationPipe, LazyLocalizationPipe],
declarations: [LocalizationPipe], imports: [LocalizationPipe, LazyLocalizationPipe],
}) })
export class LocalizationModule {} export class LocalizationModule {}

1
npm/ng-packs/packages/core/src/lib/pipes/localization.pipe.ts

@ -4,7 +4,6 @@ import { LocalizationService } from '../services/localization.service';
@Injectable() @Injectable()
@Pipe({ @Pipe({
standalone: false,
name: 'abpLocalization', name: 'abpLocalization',
}) })
export class LocalizationPipe implements PipeTransform { export class LocalizationPipe implements PipeTransform {

1
npm/ng-packs/packages/core/src/lib/pipes/safe-html.pipe.ts

@ -3,7 +3,6 @@ import { DomSanitizer } from '@angular/platform-browser';
@Injectable() @Injectable()
@Pipe({ @Pipe({
standalone: false,
name: 'abpSafeHtml', name: 'abpSafeHtml',
}) })
export class SafeHtmlPipe implements PipeTransform { export class SafeHtmlPipe implements PipeTransform {

33
npm/ng-packs/packages/core/src/lib/pipes/short-date-time.pipe.ts

@ -4,30 +4,31 @@ import { ConfigStateService } from '../services';
import { getShortDateShortTimeFormat } from '../utils/date-utils'; import { getShortDateShortTimeFormat } from '../utils/date-utils';
@Pipe({ @Pipe({
standalone: false,
name: 'shortDateTime', name: 'shortDateTime',
pure: true, pure: true,
}) })
export class ShortDateTimePipe extends DatePipe implements PipeTransform { export class ShortDateTimePipe extends DatePipe implements PipeTransform {
constructor(
constructor(private configStateService: ConfigStateService, private configStateService: ConfigStateService,
@Inject(LOCALE_ID) locale: string, @Inject(LOCALE_ID) locale: string,
@Inject(DATE_PIPE_DEFAULT_TIMEZONE) @Optional() defaultTimezone?: string|null @Inject(DATE_PIPE_DEFAULT_TIMEZONE) @Optional() defaultTimezone?: string | null,
) { ) {
super(locale, defaultTimezone) super(locale, defaultTimezone);
} }
transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string | null; transform(
value: Date | string | number,
format?: string,
timezone?: string,
locale?: string,
): string | null;
transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null; transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null;
transform( transform(
value: string|number|Date|null|undefined, timezone?: string, value: string | number | Date | null | undefined,
locale?: string): string|null { timezone?: string,
locale?: string,
const format = getShortDateShortTimeFormat(this.configStateService); ): string | null {
return super.transform(value,format,timezone,locale) const format = getShortDateShortTimeFormat(this.configStateService);
return super.transform(value, format, timezone, locale);
} }
} }

33
npm/ng-packs/packages/core/src/lib/pipes/short-date.pipe.ts

@ -4,30 +4,31 @@ import { ConfigStateService } from '../services';
import { getShortDateFormat } from '../utils/date-utils'; import { getShortDateFormat } from '../utils/date-utils';
@Pipe({ @Pipe({
standalone: false,
name: 'shortDate', name: 'shortDate',
pure: true, pure: true,
}) })
export class ShortDatePipe extends DatePipe implements PipeTransform { export class ShortDatePipe extends DatePipe implements PipeTransform {
constructor(
constructor(private configStateService: ConfigStateService, private configStateService: ConfigStateService,
@Inject(LOCALE_ID) locale: string, @Inject(LOCALE_ID) locale: string,
@Inject(DATE_PIPE_DEFAULT_TIMEZONE) @Optional() defaultTimezone?: string|null @Inject(DATE_PIPE_DEFAULT_TIMEZONE) @Optional() defaultTimezone?: string | null,
) { ) {
super(locale, defaultTimezone) super(locale, defaultTimezone);
} }
transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string | null; transform(
value: Date | string | number,
format?: string,
timezone?: string,
locale?: string,
): string | null;
transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null; transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null;
transform( transform(
value: string|number|Date|null|undefined, timezone?: string, value: string | number | Date | null | undefined,
locale?: string): string|null { timezone?: string,
locale?: string,
const format = getShortDateFormat(this.configStateService); ): string | null {
return super.transform(value,format,timezone,locale) const format = getShortDateFormat(this.configStateService);
return super.transform(value, format, timezone, locale);
} }
} }

33
npm/ng-packs/packages/core/src/lib/pipes/short-time.pipe.ts

@ -4,30 +4,31 @@ import { ConfigStateService } from '../services';
import { getShortTimeFormat } from '../utils/date-utils'; import { getShortTimeFormat } from '../utils/date-utils';
@Pipe({ @Pipe({
standalone: false,
name: 'shortTime', name: 'shortTime',
pure: true, pure: true,
}) })
export class ShortTimePipe extends DatePipe implements PipeTransform { export class ShortTimePipe extends DatePipe implements PipeTransform {
constructor(
constructor(private configStateService: ConfigStateService, private configStateService: ConfigStateService,
@Inject(LOCALE_ID) locale: string, @Inject(LOCALE_ID) locale: string,
@Inject(DATE_PIPE_DEFAULT_TIMEZONE) @Optional() defaultTimezone?: string|null @Inject(DATE_PIPE_DEFAULT_TIMEZONE) @Optional() defaultTimezone?: string | null,
) { ) {
super(locale, defaultTimezone) super(locale, defaultTimezone);
} }
transform(value: Date | string | number, format?: string, timezone?: string, locale?: string): string | null; transform(
value: Date | string | number,
format?: string,
timezone?: string,
locale?: string,
): string | null;
transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null; transform(value: null | undefined, format?: string, timezone?: string, locale?: string): null;
transform( transform(
value: string|number|Date|null|undefined, timezone?: string, value: string | number | Date | null | undefined,
locale?: string): string|null { timezone?: string,
locale?: string,
const format = getShortTimeFormat(this.configStateService); ): string | null {
return super.transform(value,format,timezone,locale) const format = getShortTimeFormat(this.configStateService);
return super.transform(value, format, timezone, locale);
} }
} }

1
npm/ng-packs/packages/core/src/lib/pipes/sort.pipe.ts

@ -3,7 +3,6 @@ export type SortOrder = 'asc' | 'desc';
@Injectable() @Injectable()
@Pipe({ @Pipe({
standalone: false,
name: 'abpSort', name: 'abpSort',
}) })
export class SortPipe implements PipeTransform { export class SortPipe implements PipeTransform {

1
npm/ng-packs/packages/core/src/lib/pipes/to-injector.pipe.ts

@ -5,7 +5,6 @@ export const INJECTOR_PIPE_DATA_TOKEN = new InjectionToken<PipeTransform>(
); );
@Pipe({ @Pipe({
standalone: false,
name: 'toInjector', name: 'toInjector',
}) })
export class ToInjectorPipe implements PipeTransform { export class ToInjectorPipe implements PipeTransform {

1
npm/ng-packs/packages/core/src/lib/utils/index.ts

@ -18,3 +18,4 @@ export * from './queue';
export * from './route-utils'; export * from './route-utils';
export * from './string-utils'; export * from './string-utils';
export * from './tree-utils'; export * from './tree-utils';
export { NgxValidateCoreModule, Validation } from '@ngx-validate/core';

4
npm/ng-packs/packages/feature-management/src/lib/components/feature-management-tab/feature-management-tab.component.ts

@ -1,11 +1,11 @@
import { LocalizationModule, ReplaceableTemplateDirective } from '@abp/ng.core'; import { LocalizationPipe, ReplaceableTemplateDirective } from '@abp/ng.core';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { FeatureManagementComponent } from '../feature-management/feature-management.component'; import { FeatureManagementComponent } from '../feature-management/feature-management.component';
@Component({ @Component({
selector: 'abp-feature-management-tab', selector: 'abp-feature-management-tab',
templateUrl: './feature-management-tab.component.html', templateUrl: './feature-management-tab.component.html',
imports: [ReplaceableTemplateDirective, LocalizationModule, FeatureManagementComponent], imports: [ReplaceableTemplateDirective, LocalizationPipe, FeatureManagementComponent],
}) })
export class FeatureManagementTabComponent { export class FeatureManagementTabComponent {
visibleFeatures = false; visibleFeatures = false;

20
npm/ng-packs/packages/feature-management/src/lib/components/feature-management/feature-management.component.ts

@ -1,4 +1,7 @@
import { ConfigStateService, LocalizationModule, TrackByService } from '@abp/ng.core'; import { Component, EventEmitter, Input, Output, inject } from '@angular/core';
import { CommonModule, NgTemplateOutlet } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { ConfigStateService, LocalizationPipe, TrackByService } from '@abp/ng.core';
import { import {
FeatureDto, FeatureDto,
FeatureGroupDto, FeatureGroupDto,
@ -6,19 +9,18 @@ import {
UpdateFeatureDto, UpdateFeatureDto,
} from '@abp/ng.feature-management/proxy'; } from '@abp/ng.feature-management/proxy';
import { import {
ButtonComponent,
Confirmation, Confirmation,
ConfirmationService, ConfirmationService,
LocaleDirection, LocaleDirection,
ThemeSharedModule, ModalCloseDirective,
ModalComponent,
ToasterService, ToasterService,
} from '@abp/ng.theme.shared'; } from '@abp/ng.theme.shared';
import { Component, EventEmitter, Input, Output, inject } from '@angular/core';
import { CommonModule, NgTemplateOutlet } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
import { finalize } from 'rxjs/operators'; import { finalize } from 'rxjs/operators';
import { FreeTextInputDirective } from '../../directives'; import { FreeTextInputDirective } from '../../directives';
import { FeatureManagement } from '../../models/feature-management'; import { FeatureManagement } from '../../models';
enum ValueTypes { enum ValueTypes {
ToggleStringValueType = 'ToggleStringValueType', ToggleStringValueType = 'ToggleStringValueType',
@ -32,12 +34,14 @@ enum ValueTypes {
exportAs: 'abpFeatureManagement', exportAs: 'abpFeatureManagement',
imports: [ imports: [
CommonModule, CommonModule,
ThemeSharedModule, ButtonComponent,
LocalizationModule, ModalComponent,
LocalizationPipe,
FormsModule, FormsModule,
NgbNavModule, NgbNavModule,
FreeTextInputDirective, FreeTextInputDirective,
NgTemplateOutlet, NgTemplateOutlet,
ModalCloseDirective,
], ],
}) })
export class FeatureManagementComponent export class FeatureManagementComponent

1
npm/ng-packs/packages/feature-management/src/lib/directives/free-text-input.directive.ts

@ -15,7 +15,6 @@ export const INPUT_TYPES = {
}; };
@Directive({ @Directive({
standalone: true,
selector: 'input[abpFeatureManagementFreeText]', selector: 'input[abpFeatureManagementFreeText]',
exportAs: 'inputAbpFeatureManagementFreeText', exportAs: 'inputAbpFeatureManagementFreeText',
}) })

14
npm/ng-packs/packages/feature-management/src/lib/feature-management.module.ts

@ -1,13 +1,9 @@
import { CoreModule } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { ModuleWithProviders, NgModule } from '@angular/core'; import { ModuleWithProviders, NgModule } from '@angular/core';
import { NgbNavModule } from '@ng-bootstrap/ng-bootstrap'; import { FreeTextInputDirective } from './directives';
import { FeatureManagementComponent } from './components/feature-management/feature-management.component';
import { FreeTextInputDirective } from './directives/free-text-input.directive';
import { provideFeatureManagementConfig } from './providers'; import { provideFeatureManagementConfig } from './providers';
import { FeatureManagementTabComponent } from './components'; import { FeatureManagementTabComponent, FeatureManagementComponent } from './components';
const exported = [ export const FEATURE_MANAGEMENT_EXPORTS = [
FeatureManagementComponent, FeatureManagementComponent,
FreeTextInputDirective, FreeTextInputDirective,
FeatureManagementTabComponent, FeatureManagementTabComponent,
@ -19,8 +15,8 @@ const exported = [
* You can import directives and pipes directly whichs were belongs to FeatureManagementModule are switched to standalone. * You can import directives and pipes directly whichs were belongs to FeatureManagementModule are switched to standalone.
*/ */
@NgModule({ @NgModule({
imports: [CoreModule, ThemeSharedModule, NgbNavModule, ...exported], imports: [...FEATURE_MANAGEMENT_EXPORTS],
exports: [...exported], exports: [...FEATURE_MANAGEMENT_EXPORTS],
}) })
export class FeatureManagementModule { export class FeatureManagementModule {
static forRoot(): ModuleWithProviders<FeatureManagementModule> { static forRoot(): ModuleWithProviders<FeatureManagementModule> {

2
npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.html

@ -15,7 +15,7 @@
</ng-template> </ng-template>
<ng-template #abpBody> <ng-template #abpBody>
<form [formGroup]="form" (ngSubmit)="save()" validateOnSubmit> <form [formGroup]="form" (ngSubmit)="save()" [validateOnSubmit]="true">
<abp-extensible-form [selectedRecord]="selected"></abp-extensible-form> <abp-extensible-form [selectedRecord]="selected"></abp-extensible-form>
</form> </form>
</ng-template> </ng-template>

44
npm/ng-packs/packages/identity/src/lib/components/roles/roles.component.ts

@ -1,19 +1,39 @@
import { ListService, PagedAndSortedResultRequestDto, PagedResultDto } from '@abp/ng.core'; import {
InitDirective,
ListService,
LocalizationPipe,
PagedAndSortedResultRequestDto,
PagedResultDto,
ReplaceableTemplateDirective,
} from '@abp/ng.core';
import { IdentityRoleDto, IdentityRoleService } from '@abp/ng.identity/proxy'; import { IdentityRoleDto, IdentityRoleService } from '@abp/ng.identity/proxy';
import { ePermissionManagementComponents } from '@abp/ng.permission-management';
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
import { import {
ePermissionManagementComponents,
PermissionManagementComponent,
} from '@abp/ng.permission-management';
import {
ButtonComponent,
Confirmation,
ConfirmationService,
ModalCloseDirective,
ModalComponent,
ToasterService,
} from '@abp/ng.theme.shared';
import {
ExtensibleFormComponent,
ExtensibleTableComponent,
EXTENSIONS_IDENTIFIER, EXTENSIONS_IDENTIFIER,
FormPropData, FormPropData,
generateFormFromProps, generateFormFromProps,
} from '@abp/ng.components/extensible'; } from '@abp/ng.components/extensible';
import { Component, inject, Injector, OnInit } from '@angular/core'; import { Component, inject, Injector, OnInit } from '@angular/core';
import { UntypedFormGroup } from '@angular/forms'; import { ReactiveFormsModule, UntypedFormGroup } from '@angular/forms';
import { finalize } from 'rxjs/operators'; import { finalize } from 'rxjs/operators';
import { eIdentityComponents } from '../../enums/components'; import { eIdentityComponents } from '../../enums/components';
import { PageComponent } from '@abp/ng.components/page';
import { NgxValidateCoreModule } from '@ngx-validate/core';
@Component({ @Component({
standalone: false,
selector: 'abp-roles', selector: 'abp-roles',
templateUrl: './roles.component.html', templateUrl: './roles.component.html',
providers: [ providers: [
@ -23,6 +43,20 @@ import { eIdentityComponents } from '../../enums/components';
useValue: eIdentityComponents.Roles, useValue: eIdentityComponents.Roles,
}, },
], ],
imports: [
ReactiveFormsModule,
LocalizationPipe,
ExtensibleTableComponent,
ModalComponent,
ButtonComponent,
PageComponent,
ExtensibleFormComponent,
ModalCloseDirective,
PermissionManagementComponent,
ReplaceableTemplateDirective,
NgxValidateCoreModule,
InitDirective,
],
}) })
export class RolesComponent implements OnInit { export class RolesComponent implements OnInit {
protected readonly list = inject(ListService<PagedAndSortedResultRequestDto>); protected readonly list = inject(ListService<PagedAndSortedResultRequestDto>);

43
npm/ng-packs/packages/identity/src/lib/components/users/users.component.ts

@ -1,18 +1,33 @@
import { ListService, PagedResultDto } from '@abp/ng.core'; import {
InitDirective,
ListService,
LocalizationPipe,
PagedResultDto,
ReplaceableTemplateDirective,
} from '@abp/ng.core';
import { import {
GetIdentityUsersInput, GetIdentityUsersInput,
IdentityRoleDto, IdentityRoleDto,
IdentityUserDto, IdentityUserDto,
IdentityUserService, IdentityUserService,
} from '@abp/ng.identity/proxy'; } from '@abp/ng.identity/proxy';
import { ePermissionManagementComponents } from '@abp/ng.permission-management';
import { import {
ePermissionManagementComponents,
PermissionManagementComponent,
} from '@abp/ng.permission-management';
import {
ButtonComponent,
Confirmation, Confirmation,
ConfirmationService, ConfirmationService,
eFormComponets, eFormComponets,
FormCheckboxComponent,
ModalCloseDirective,
ModalComponent,
ToasterService, ToasterService,
} from '@abp/ng.theme.shared'; } from '@abp/ng.theme.shared';
import { import {
ExtensibleFormComponent,
ExtensibleTableComponent,
EXTENSIONS_IDENTIFIER, EXTENSIONS_IDENTIFIER,
FormPropData, FormPropData,
generateFormFromProps, generateFormFromProps,
@ -28,15 +43,19 @@ import {
} from '@angular/core'; } from '@angular/core';
import { import {
AbstractControl, AbstractControl,
FormsModule,
ReactiveFormsModule,
UntypedFormArray, UntypedFormArray,
UntypedFormBuilder, UntypedFormBuilder,
UntypedFormGroup, UntypedFormGroup,
} from '@angular/forms'; } from '@angular/forms';
import { finalize, switchMap, tap } from 'rxjs/operators'; import { finalize, switchMap, tap } from 'rxjs/operators';
import { eIdentityComponents } from '../../enums/components'; import { eIdentityComponents } from '../../enums/components';
import { PageComponent } from '@abp/ng.components/page';
import { NgbDropdownModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
import { NgxValidateCoreModule } from '@ngx-validate/core';
@Component({ @Component({
standalone: false,
selector: 'abp-users', selector: 'abp-users',
templateUrl: './users.component.html', templateUrl: './users.component.html',
providers: [ providers: [
@ -46,6 +65,24 @@ import { eIdentityComponents } from '../../enums/components';
useValue: eIdentityComponents.Users, useValue: eIdentityComponents.Users,
}, },
], ],
imports: [
ReactiveFormsModule,
FormsModule,
PermissionManagementComponent,
PageComponent,
NgbNavModule,
NgbDropdownModule,
NgxValidateCoreModule,
LocalizationPipe,
ExtensibleTableComponent,
ModalComponent,
ExtensibleFormComponent,
FormCheckboxComponent,
ButtonComponent,
ReplaceableTemplateDirective,
ModalCloseDirective,
InitDirective,
],
}) })
export class UsersComponent implements OnInit { export class UsersComponent implements OnInit {
protected readonly list = inject(ListService<GetIdentityUsersInput>); protected readonly list = inject(ListService<GetIdentityUsersInput>);

33
npm/ng-packs/packages/identity/src/lib/identity.module.ts

@ -1,14 +1,6 @@
import { CoreModule, LazyModuleFactory } from '@abp/ng.core'; import { LazyModuleFactory } from '@abp/ng.core';
import { PermissionManagementModule } from '@abp/ng.permission-management';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { ExtensibleModule } from '@abp/ng.components/extensible';
import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core'; import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core';
import { NgbDropdownModule, NgbNavModule } from '@ng-bootstrap/ng-bootstrap';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { RolesComponent } from './components/roles/roles.component';
import { UsersComponent } from './components/users/users.component';
import { IdentityExtensionsGuard } from './guards/extensions.guard'; import { IdentityExtensionsGuard } from './guards/extensions.guard';
import { IdentityRoutingModule } from './identity-routing.module';
import { IdentityConfigOptions } from './models/config-options'; import { IdentityConfigOptions } from './models/config-options';
import { import {
IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS, IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
@ -17,22 +9,13 @@ import {
IDENTITY_ENTITY_PROP_CONTRIBUTORS, IDENTITY_ENTITY_PROP_CONTRIBUTORS,
IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS, IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
} from './tokens/extensions.token'; } from './tokens/extensions.token';
import { PageModule } from '@abp/ng.components/page'; import { IdentityRoutingModule } from './identity-routing.module';
import { RolesComponent, UsersComponent } from './components';
@NgModule({ @NgModule({
declarations: [RolesComponent, UsersComponent], declarations: [],
exports: [RolesComponent, UsersComponent], exports: [],
imports: [ imports: [IdentityRoutingModule, RolesComponent, UsersComponent],
CoreModule,
IdentityRoutingModule,
NgbNavModule,
ThemeSharedModule,
ExtensibleModule,
NgbDropdownModule,
PermissionManagementModule,
NgxValidateCoreModule,
PageModule,
],
}) })
export class IdentityModule { export class IdentityModule {
static forChild(options: IdentityConfigOptions = {}): ModuleWithProviders<IdentityModule> { static forChild(options: IdentityConfigOptions = {}): ModuleWithProviders<IdentityModule> {
@ -63,7 +46,9 @@ export class IdentityModule {
], ],
}; };
} }
/**
* @deprecated `IdentityModule.forLazy()` is deprecated. You can use `createRoutes` **function** instead.
*/
static forLazy(options: IdentityConfigOptions = {}): NgModuleFactory<IdentityModule> { static forLazy(options: IdentityConfigOptions = {}): NgModuleFactory<IdentityModule> {
return new LazyModuleFactory(IdentityModule.forChild(options)); return new LazyModuleFactory(IdentityModule.forChild(options));
} }

82
npm/ng-packs/packages/identity/src/lib/identity.routes.ts

@ -0,0 +1,82 @@
import { Provider } from '@angular/core';
import { Routes } from '@angular/router';
import {
IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS,
IDENTITY_ENTITY_ACTION_CONTRIBUTORS,
IDENTITY_ENTITY_PROP_CONTRIBUTORS,
IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
} from './tokens';
import { IdentityConfigOptions } from './models';
import {
authGuard,
permissionGuard,
ReplaceableComponents,
ReplaceableRouteContainerComponent,
RouterOutletComponent,
} from '@abp/ng.core';
import { RolesComponent, UsersComponent } from './components';
import { identityExtensionsResolver } from './resolvers';
import { eIdentityComponents } from './enums';
export function provideIdentity(options: IdentityConfigOptions = {}): Provider[] {
return [
{
provide: IDENTITY_ENTITY_ACTION_CONTRIBUTORS,
useValue: options.entityActionContributors,
},
{
provide: IDENTITY_TOOLBAR_ACTION_CONTRIBUTORS,
useValue: options.toolbarActionContributors,
},
{
provide: IDENTITY_ENTITY_PROP_CONTRIBUTORS,
useValue: options.entityPropContributors,
},
{
provide: IDENTITY_CREATE_FORM_PROP_CONTRIBUTORS,
useValue: options.createFormPropContributors,
},
{
provide: IDENTITY_EDIT_FORM_PROP_CONTRIBUTORS,
useValue: options.editFormPropContributors,
},
];
}
export const createRoutes = (options: IdentityConfigOptions = {}): Routes => [
{
path: '',
component: RouterOutletComponent,
canActivate: [authGuard, permissionGuard],
resolve: [identityExtensionsResolver],
providers: provideIdentity(options),
children: [
{ path: '', redirectTo: 'roles', pathMatch: 'full' },
{
path: 'roles',
component: ReplaceableRouteContainerComponent,
data: {
requiredPolicy: 'AbpIdentity.Roles',
replaceableComponent: {
key: eIdentityComponents.Roles,
defaultComponent: RolesComponent,
} as ReplaceableComponents.RouteData<RolesComponent>,
},
title: 'AbpIdentity::Roles',
},
{
path: 'users',
component: ReplaceableRouteContainerComponent,
data: {
requiredPolicy: 'AbpIdentity.Users',
replaceableComponent: {
key: eIdentityComponents.Users,
defaultComponent: UsersComponent,
} as ReplaceableComponents.RouteData<UsersComponent>,
},
title: 'AbpIdentity::Users',
},
],
},
];

1
npm/ng-packs/packages/identity/src/public-api.ts

@ -5,3 +5,4 @@ export * from './lib/identity.module';
export * from './lib/models'; export * from './lib/models';
export * from './lib/tokens'; export * from './lib/tokens';
export * from './lib/resolvers'; export * from './lib/resolvers';
export * from './lib/identity.routes';

23
npm/ng-packs/packages/permission-management/src/lib/components/permission-management.component.ts

@ -1,5 +1,11 @@
import { ConfigStateService, CurrentUserDto } from '@abp/ng.core'; import { ConfigStateService, CurrentUserDto, LocalizationPipe } from '@abp/ng.core';
import { LocaleDirection, ToasterService } from '@abp/ng.theme.shared'; import {
ButtonComponent,
LocaleDirection,
ModalCloseDirective,
ModalComponent,
ToasterService,
} from '@abp/ng.theme.shared';
import { import {
GetPermissionListResultDto, GetPermissionListResultDto,
PermissionGrantInfoDto, PermissionGrantInfoDto,
@ -23,7 +29,9 @@ import {
} from '@angular/core'; } from '@angular/core';
import { concat, of } from 'rxjs'; import { concat, of } from 'rxjs';
import { finalize, switchMap, take, tap } from 'rxjs/operators'; import { finalize, switchMap, take, tap } from 'rxjs/operators';
import { PermissionManagement } from '../models/permission-management'; import { PermissionManagement } from '../models';
import { CommonModule } from '@angular/common';
import { FormsModule } from '@angular/forms';
type PermissionWithStyle = PermissionGrantInfoDto & { type PermissionWithStyle = PermissionGrantInfoDto & {
style: string; style: string;
@ -34,7 +42,6 @@ type PermissionWithGroupName = PermissionGrantInfoDto & {
}; };
@Component({ @Component({
standalone: false,
selector: 'abp-permission-management', selector: 'abp-permission-management',
templateUrl: './permission-management.component.html', templateUrl: './permission-management.component.html',
exportAs: 'abpPermissionManagement', exportAs: 'abpPermissionManagement',
@ -85,6 +92,14 @@ type PermissionWithGroupName = PermissionGrantInfoDto & {
} }
`, `,
], ],
imports: [
FormsModule,
CommonModule,
ModalComponent,
LocalizationPipe,
ButtonComponent,
ModalCloseDirective,
],
}) })
export class PermissionManagementComponent export class PermissionManagementComponent
implements implements

8
npm/ng-packs/packages/permission-management/src/lib/permission-management.module.ts

@ -1,11 +1,9 @@
import { CoreModule } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { NgModule } from '@angular/core'; import { NgModule } from '@angular/core';
import { PermissionManagementComponent } from './components/permission-management.component'; import { PermissionManagementComponent } from './components';
@NgModule({ @NgModule({
declarations: [PermissionManagementComponent], declarations: [],
imports: [CoreModule, ThemeSharedModule], imports: [PermissionManagementComponent],
exports: [PermissionManagementComponent], exports: [PermissionManagementComponent],
}) })
export class PermissionManagementModule {} export class PermissionManagementModule {}

35
npm/ng-packs/packages/setting-management/config/src/lib/components/email-setting-group/email-setting-group.component.ts

@ -1,21 +1,48 @@
import { NgbModalOptions } from '@ng-bootstrap/ng-bootstrap'; import { NgbModalOptions } from '@ng-bootstrap/ng-bootstrap';
import { collapse, ToasterService } from '@abp/ng.theme.shared'; import {
ButtonComponent,
collapse,
ModalCloseDirective,
ModalComponent,
ToasterService,
} from '@abp/ng.theme.shared';
import { Component, inject, OnInit } from '@angular/core'; import { Component, inject, OnInit } from '@angular/core';
import { toSignal } from '@angular/core/rxjs-interop'; import { toSignal } from '@angular/core/rxjs-interop';
import { UntypedFormBuilder, UntypedFormGroup, Validators } from '@angular/forms'; import {
ReactiveFormsModule,
UntypedFormBuilder,
UntypedFormGroup,
Validators,
} from '@angular/forms';
import { finalize } from 'rxjs/operators'; import { finalize } from 'rxjs/operators';
import { SettingManagementPolicyNames } from '../../enums/policy-names'; import { SettingManagementPolicyNames } from '../../enums/policy-names';
import { EmailSettingsService } from '@abp/ng.setting-management/proxy'; import { EmailSettingsService } from '@abp/ng.setting-management/proxy';
import { EmailSettingsDto } from '../../proxy/models'; import { EmailSettingsDto } from '../../proxy/models';
import { ConfigStateService, LocalizationService } from '@abp/ng.core'; import {
ConfigStateService,
LocalizationPipe,
LocalizationService,
PermissionDirective,
} from '@abp/ng.core';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { CommonModule } from '@angular/common';
const { required, email } = Validators; const { required, email } = Validators;
@Component({ @Component({
standalone: false,
selector: 'abp-email-setting-group', selector: 'abp-email-setting-group',
templateUrl: 'email-setting-group.component.html', templateUrl: 'email-setting-group.component.html',
animations: [collapse], animations: [collapse],
imports: [
ReactiveFormsModule,
CommonModule,
LocalizationPipe,
ButtonComponent,
ModalComponent,
ModalCloseDirective,
NgxValidateCoreModule,
PermissionDirective,
],
}) })
export class EmailSettingGroupComponent implements OnInit { export class EmailSettingGroupComponent implements OnInit {
protected readonly localizationService = inject(LocalizationService); protected readonly localizationService = inject(LocalizationService);

7
npm/ng-packs/packages/setting-management/config/src/lib/setting-management-config.module.ts

@ -1,13 +1,10 @@
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { ModuleWithProviders, NgModule } from '@angular/core'; import { ModuleWithProviders, NgModule } from '@angular/core';
import { CoreModule } from '@abp/ng.core';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { EmailSettingGroupComponent } from './components/email-setting-group/email-setting-group.component'; import { EmailSettingGroupComponent } from './components/email-setting-group/email-setting-group.component';
import { provideSettingManagementConfig } from './providers'; import { provideSettingManagementConfig } from './providers';
@NgModule({ @NgModule({
imports: [CoreModule, ThemeSharedModule, NgxValidateCoreModule], imports: [EmailSettingGroupComponent],
declarations: [EmailSettingGroupComponent], declarations: [],
exports: [EmailSettingGroupComponent], exports: [EmailSettingGroupComponent],
}) })
export class SettingManagementConfigModule { export class SettingManagementConfigModule {

6
npm/ng-packs/packages/setting-management/src/lib/components/setting-management.component.ts

@ -1,12 +1,14 @@
import { ABP } from '@abp/ng.core'; import { ABP, ForDirective, LocalizationPipe, PermissionDirective } from '@abp/ng.core';
import { SettingTabsService } from '@abp/ng.setting-management/config'; import { SettingTabsService } from '@abp/ng.setting-management/config';
import { Component, OnDestroy, OnInit, TrackByFunction } from '@angular/core'; import { Component, OnDestroy, OnInit, TrackByFunction } from '@angular/core';
import { Subscription } from 'rxjs'; import { Subscription } from 'rxjs';
import { CommonModule } from '@angular/common';
import { PageComponent } from '@abp/ng.components/page';
@Component({ @Component({
standalone: false,
selector: 'abp-setting-management', selector: 'abp-setting-management',
templateUrl: './setting-management.component.html', templateUrl: './setting-management.component.html',
imports: [CommonModule, PageComponent, LocalizationPipe, PermissionDirective, ForDirective],
}) })
export class SettingManagementComponent implements OnDestroy, OnInit { export class SettingManagementComponent implements OnDestroy, OnInit {
private subscription = new Subscription(); private subscription = new Subscription();

18
npm/ng-packs/packages/setting-management/src/lib/setting-management.module.ts

@ -1,14 +1,14 @@
import { PageModule } from '@abp/ng.components/page'; import { LazyModuleFactory } from '@abp/ng.core';
import { CoreModule, LazyModuleFactory } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core'; import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core';
import { SettingManagementComponent } from './components/setting-management.component';
import { SettingManagementRoutingModule } from './setting-management-routing.module'; import { SettingManagementRoutingModule } from './setting-management-routing.module';
import { SettingManagementComponent } from './components/setting-management.component';
export const SETTING_MANAGEMENT_MODULE_EXPORTS = [SettingManagementComponent];
@NgModule({ @NgModule({
declarations: [SettingManagementComponent], declarations: [],
exports: [SettingManagementComponent], exports: [],
imports: [SettingManagementRoutingModule, CoreModule, ThemeSharedModule, PageModule], imports: [SettingManagementRoutingModule, ...SETTING_MANAGEMENT_MODULE_EXPORTS],
}) })
export class SettingManagementModule { export class SettingManagementModule {
static forChild(): ModuleWithProviders<SettingManagementModule> { static forChild(): ModuleWithProviders<SettingManagementModule> {
@ -17,7 +17,9 @@ export class SettingManagementModule {
providers: [], providers: [],
}; };
} }
/**
* @deprecated `SettingManagementModule.forLazy()` is deprecated. You can use `createRoutes` **function** instead.
*/
static forLazy(): NgModuleFactory<SettingManagementModule> { static forLazy(): NgModuleFactory<SettingManagementModule> {
return new LazyModuleFactory(SettingManagementModule.forChild()); return new LazyModuleFactory(SettingManagementModule.forChild());
} }

36
npm/ng-packs/packages/setting-management/src/lib/setting-management.routes.ts

@ -0,0 +1,36 @@
import { Routes } from '@angular/router';
import {
authGuard,
ReplaceableComponents,
ReplaceableRouteContainerComponent,
RouterOutletComponent,
} from '@abp/ng.core';
import { SettingManagementComponent } from './components/setting-management.component';
import { eSettingManagementComponents } from './enums/components';
export function provideSettingManagement() {
return [];
}
export const createRoutes = (): Routes => [
{
path: '',
component: RouterOutletComponent,
canActivate: [authGuard],
providers: provideSettingManagement(),
children: [
{
path: '',
component: ReplaceableRouteContainerComponent,
data: {
requiredPolicy: 'AbpAccount.SettingManagement',
replaceableComponent: {
key: eSettingManagementComponents.SettingManagement,
defaultComponent: SettingManagementComponent,
} as ReplaceableComponents.RouteData,
},
},
],
title: 'AbpSettingManagement::Settings',
},
];

1
npm/ng-packs/packages/setting-management/src/public-api.ts

@ -1,3 +1,4 @@
export * from './lib/setting-management.module'; export * from './lib/setting-management.module';
export * from './lib/components/setting-management.component'; export * from './lib/components/setting-management.component';
export * from './lib/enums'; export * from './lib/enums';
export * from './lib/setting-management.routes';

47
npm/ng-packs/packages/tenant-management/src/lib/components/tenants/tenants.component.ts

@ -1,19 +1,42 @@
import { ListService, PagedResultDto } from '@abp/ng.core'; import {
import { eFeatureManagementComponents } from '@abp/ng.feature-management'; ListService,
LocalizationPipe,
PagedResultDto,
ReplaceableTemplateDirective,
} from '@abp/ng.core';
import {
eFeatureManagementComponents,
FeatureManagementComponent,
} from '@abp/ng.feature-management';
import { GetTenantsInput, TenantDto, TenantService } from '@abp/ng.tenant-management/proxy'; import { GetTenantsInput, TenantDto, TenantService } from '@abp/ng.tenant-management/proxy';
import { Confirmation, ConfirmationService, ToasterService } from '@abp/ng.theme.shared';
import { import {
ButtonComponent,
Confirmation,
ConfirmationService,
ModalCloseDirective,
ModalComponent,
ToasterService,
} from '@abp/ng.theme.shared';
import {
ExtensibleFormComponent,
ExtensibleTableComponent,
EXTENSIONS_IDENTIFIER, EXTENSIONS_IDENTIFIER,
FormPropData, FormPropData,
generateFormFromProps, generateFormFromProps,
} from '@abp/ng.components/extensible'; } from '@abp/ng.components/extensible';
import { Component, inject, Injector, OnInit } from '@angular/core'; import { Component, inject, Injector, OnInit } from '@angular/core';
import { UntypedFormBuilder, UntypedFormGroup } from '@angular/forms'; import {
FormsModule,
ReactiveFormsModule,
UntypedFormBuilder,
UntypedFormGroup,
} from '@angular/forms';
import { finalize } from 'rxjs/operators'; import { finalize } from 'rxjs/operators';
import { eTenantManagementComponents } from '../../enums/components'; import { eTenantManagementComponents } from '../../enums/components';
import { PageComponent } from '@abp/ng.components/page';
import { NgxValidateCoreModule } from '@ngx-validate/core';
@Component({ @Component({
standalone: false,
selector: 'abp-tenants', selector: 'abp-tenants',
templateUrl: './tenants.component.html', templateUrl: './tenants.component.html',
providers: [ providers: [
@ -23,6 +46,20 @@ import { eTenantManagementComponents } from '../../enums/components';
useValue: eTenantManagementComponents.Tenants, useValue: eTenantManagementComponents.Tenants,
}, },
], ],
imports: [
FormsModule,
ReactiveFormsModule,
PageComponent,
LocalizationPipe,
ExtensibleTableComponent,
ModalComponent,
FeatureManagementComponent,
ButtonComponent,
ReplaceableTemplateDirective,
ExtensibleFormComponent,
ModalCloseDirective,
NgxValidateCoreModule,
],
}) })
export class TenantsComponent implements OnInit { export class TenantsComponent implements OnInit {
protected readonly list = inject(ListService<GetTenantsInput>); protected readonly list = inject(ListService<GetTenantsInput>);

31
npm/ng-packs/packages/tenant-management/src/lib/tenant-management.module.ts

@ -1,13 +1,7 @@
import { CoreModule, LazyModuleFactory } from '@abp/ng.core'; import { LazyModuleFactory } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { ExtensibleModule } from '@abp/ng.components/extensible';
import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core'; import { ModuleWithProviders, NgModule, NgModuleFactory } from '@angular/core';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
import { NgxValidateCoreModule } from '@ngx-validate/core';
import { TenantsComponent } from './components/tenants/tenants.component';
import { TenantManagementExtensionsGuard } from './guards/extensions.guard'; import { TenantManagementExtensionsGuard } from './guards/extensions.guard';
import { TenantManagementConfigOptions } from './models/config-options'; import { TenantManagementConfigOptions } from './models/config-options';
import { TenantManagementRoutingModule } from './tenant-management-routing.module';
import { import {
TENANT_MANAGEMENT_CREATE_FORM_PROP_CONTRIBUTORS, TENANT_MANAGEMENT_CREATE_FORM_PROP_CONTRIBUTORS,
TENANT_MANAGEMENT_EDIT_FORM_PROP_CONTRIBUTORS, TENANT_MANAGEMENT_EDIT_FORM_PROP_CONTRIBUTORS,
@ -15,22 +9,13 @@ import {
TENANT_MANAGEMENT_ENTITY_PROP_CONTRIBUTORS, TENANT_MANAGEMENT_ENTITY_PROP_CONTRIBUTORS,
TENANT_MANAGEMENT_TOOLBAR_ACTION_CONTRIBUTORS, TENANT_MANAGEMENT_TOOLBAR_ACTION_CONTRIBUTORS,
} from './tokens/extensions.token'; } from './tokens/extensions.token';
import { PageModule } from '@abp/ng.components/page'; import { TenantsComponent } from './components';
import { FeatureManagementComponent } from '@abp/ng.feature-management'; import { TenantManagementRoutingModule } from './tenant-management-routing.module';
@NgModule({ @NgModule({
declarations: [TenantsComponent], declarations: [],
exports: [TenantsComponent], exports: [],
imports: [ imports: [TenantManagementRoutingModule, TenantsComponent],
TenantManagementRoutingModule,
NgxValidateCoreModule,
CoreModule,
ThemeSharedModule,
NgbDropdownModule,
ExtensibleModule,
PageModule,
FeatureManagementComponent,
],
}) })
export class TenantManagementModule { export class TenantManagementModule {
static forChild( static forChild(
@ -63,7 +48,9 @@ export class TenantManagementModule {
], ],
}; };
} }
/**
* @deprecated `TenantManagementModule.forLazy()` is deprecated. You can use `createRoutes` **function** instead.
*/
static forLazy( static forLazy(
options: TenantManagementConfigOptions = {}, options: TenantManagementConfigOptions = {},
): NgModuleFactory<TenantManagementModule> { ): NgModuleFactory<TenantManagementModule> {

70
npm/ng-packs/packages/tenant-management/src/lib/tenant-management.routes.ts

@ -0,0 +1,70 @@
import { Routes } from '@angular/router';
import { TenantManagementConfigOptions } from './models/config-options';
import {
TENANT_MANAGEMENT_CREATE_FORM_PROP_CONTRIBUTORS,
TENANT_MANAGEMENT_EDIT_FORM_PROP_CONTRIBUTORS,
TENANT_MANAGEMENT_ENTITY_ACTION_CONTRIBUTORS,
TENANT_MANAGEMENT_ENTITY_PROP_CONTRIBUTORS,
TENANT_MANAGEMENT_TOOLBAR_ACTION_CONTRIBUTORS,
} from './tokens/extensions.token';
import {
authGuard,
permissionGuard,
ReplaceableComponents,
ReplaceableRouteContainerComponent,
RouterOutletComponent,
} from '@abp/ng.core';
import { TenantsComponent } from './components';
import { eTenantManagementComponents } from './enums';
import { tenantManagementExtensionsResolver } from './resolvers';
export function provideTenantManagement(options: TenantManagementConfigOptions = {}) {
return [
{
provide: TENANT_MANAGEMENT_ENTITY_ACTION_CONTRIBUTORS,
useValue: options.entityActionContributors,
},
{
provide: TENANT_MANAGEMENT_TOOLBAR_ACTION_CONTRIBUTORS,
useValue: options.toolbarActionContributors,
},
{
provide: TENANT_MANAGEMENT_ENTITY_PROP_CONTRIBUTORS,
useValue: options.entityPropContributors,
},
{
provide: TENANT_MANAGEMENT_CREATE_FORM_PROP_CONTRIBUTORS,
useValue: options.createFormPropContributors,
},
{
provide: TENANT_MANAGEMENT_EDIT_FORM_PROP_CONTRIBUTORS,
useValue: options.editFormPropContributors,
},
];
}
export const createRoutes = (options: TenantManagementConfigOptions = {}): Routes => [
{
path: '',
component: RouterOutletComponent,
canActivate: [authGuard, permissionGuard],
resolve: [tenantManagementExtensionsResolver],
providers: provideTenantManagement(options),
children: [
{ path: '', redirectTo: 'tenants', pathMatch: 'full' },
{
path: 'tenants',
component: ReplaceableRouteContainerComponent,
data: {
requiredPolicy: 'AbpTenantManagement.Tenants',
replaceableComponent: {
key: eTenantManagementComponents.Tenants,
defaultComponent: TenantsComponent,
} as ReplaceableComponents.RouteData<TenantsComponent>,
},
title: 'AbpTenantManagement::Tenants',
},
],
},
];

1
npm/ng-packs/packages/tenant-management/src/public-api.ts

@ -5,3 +5,4 @@ export * from './lib/models';
export * from './lib/tenant-management.module'; export * from './lib/tenant-management.module';
export * from './lib/tokens'; export * from './lib/tokens';
export * from './lib/resolvers'; export * from './lib/resolvers';
export * from './lib/tenant-management.routes';

20
npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/account-layout.component.ts

@ -1,12 +1,28 @@
import { AfterViewInit, Component } from '@angular/core'; import { AfterViewInit, Component } from '@angular/core';
import { eLayoutType, SubscriptionService } from '@abp/ng.core'; import { eLayoutType, ReplaceableTemplateDirective, SubscriptionService } from '@abp/ng.core';
import { LayoutService } from '../../services/layout.service'; import { LayoutService } from '../../services/layout.service';
import { CommonModule } from '@angular/common';
import { LogoComponent } from '../logo/logo.component';
import { RoutesComponent } from '../routes/routes.component';
import { NavItemsComponent } from '../nav-items/nav-items.component';
import { AuthWrapperComponent } from './auth-wrapper/auth-wrapper.component';
import { PageAlertContainerComponent } from '../page-alert-container/page-alert-container.component';
import { RouterModule } from '@angular/router';
@Component({ @Component({
standalone: false,
selector: 'abp-layout-account', selector: 'abp-layout-account',
templateUrl: './account-layout.component.html', templateUrl: './account-layout.component.html',
providers: [LayoutService, SubscriptionService], providers: [LayoutService, SubscriptionService],
imports: [
CommonModule,
LogoComponent,
RoutesComponent,
NavItemsComponent,
AuthWrapperComponent,
PageAlertContainerComponent,
ReplaceableTemplateDirective,
RouterModule,
],
}) })
export class AccountLayoutComponent implements AfterViewInit { export class AccountLayoutComponent implements AfterViewInit {
// required for dynamic component // required for dynamic component

5
npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/auth-wrapper/auth-wrapper.component.ts

@ -1,11 +1,14 @@
import { AuthWrapperService } from '@abp/ng.account.core'; import { AuthWrapperService } from '@abp/ng.account.core';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LocalizationPipe, ReplaceableTemplateDirective } from '@abp/ng.core';
import { TenantBoxComponent } from '../tenant-box/tenant-box.component';
@Component({ @Component({
standalone: false,
selector: 'abp-auth-wrapper', selector: 'abp-auth-wrapper',
templateUrl: './auth-wrapper.component.html', templateUrl: './auth-wrapper.component.html',
providers: [AuthWrapperService], providers: [AuthWrapperService],
imports: [CommonModule, TenantBoxComponent, ReplaceableTemplateDirective, LocalizationPipe],
}) })
export class AuthWrapperComponent { export class AuthWrapperComponent {
constructor(public service: AuthWrapperService) {} constructor(public service: AuthWrapperService) {}

13
npm/ng-packs/packages/theme-basic/src/lib/components/account-layout/tenant-box/tenant-box.component.ts

@ -1,11 +1,22 @@
import { TenantBoxService } from '@abp/ng.account.core'; import { TenantBoxService } from '@abp/ng.account.core';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
import { LocalizationPipe } from '@abp/ng.core';
import { ButtonComponent, ModalCloseDirective, ModalComponent } from '@abp/ng.theme.shared';
import { FormsModule } from '@angular/forms';
@Component({ @Component({
standalone: false,
selector: 'abp-tenant-box', selector: 'abp-tenant-box',
templateUrl: './tenant-box.component.html', templateUrl: './tenant-box.component.html',
providers: [TenantBoxService], providers: [TenantBoxService],
imports: [
CommonModule,
FormsModule,
ModalComponent,
LocalizationPipe,
ButtonComponent,
ModalCloseDirective,
],
}) })
export class TenantBoxComponent { export class TenantBoxComponent {
constructor(public service: TenantBoxService) {} constructor(public service: TenantBoxService) {}

18
npm/ng-packs/packages/theme-basic/src/lib/components/application-layout/application-layout.component.ts

@ -1,14 +1,28 @@
import { eLayoutType, SubscriptionService } from '@abp/ng.core'; import { eLayoutType, ReplaceableTemplateDirective, SubscriptionService } from '@abp/ng.core';
import { collapseWithMargin, slideFromBottom } from '@abp/ng.theme.shared'; import { collapseWithMargin, slideFromBottom } from '@abp/ng.theme.shared';
import { AfterViewInit, Component, inject } from '@angular/core'; import { AfterViewInit, Component, inject } from '@angular/core';
import { LayoutService } from '../../services/layout.service'; import { LayoutService } from '../../services/layout.service';
import { CommonModule } from '@angular/common';
import { RouterModule } from '@angular/router';
import { LogoComponent } from '../logo/logo.component';
import { PageAlertContainerComponent } from '../page-alert-container/page-alert-container.component';
import { RoutesComponent } from '../routes/routes.component';
import { NavItemsComponent } from '../nav-items/nav-items.component';
@Component({ @Component({
standalone: false,
selector: 'abp-layout-application', selector: 'abp-layout-application',
templateUrl: './application-layout.component.html', templateUrl: './application-layout.component.html',
animations: [slideFromBottom, collapseWithMargin], animations: [slideFromBottom, collapseWithMargin],
providers: [LayoutService, SubscriptionService], providers: [LayoutService, SubscriptionService],
imports: [
CommonModule,
LogoComponent,
PageAlertContainerComponent,
RoutesComponent,
NavItemsComponent,
ReplaceableTemplateDirective,
RouterModule,
],
}) })
export class ApplicationLayoutComponent implements AfterViewInit { export class ApplicationLayoutComponent implements AfterViewInit {
public readonly service = inject(LayoutService); public readonly service = inject(LayoutService);

3
npm/ng-packs/packages/theme-basic/src/lib/components/empty-layout/empty-layout.component.ts

@ -1,10 +1,11 @@
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { eLayoutType } from '@abp/ng.core'; import { eLayoutType } from '@abp/ng.core';
import { RouterModule } from '@angular/router';
@Component({ @Component({
standalone: false,
selector: 'abp-layout-empty', selector: 'abp-layout-empty',
template: ` <router-outlet></router-outlet> `, template: ` <router-outlet></router-outlet> `,
imports: [RouterModule],
}) })
export class EmptyLayoutComponent { export class EmptyLayoutComponent {
static type = eLayoutType.empty; static type = eLayoutType.empty;

3
npm/ng-packs/packages/theme-basic/src/lib/components/logo/logo.component.ts

@ -1,8 +1,8 @@
import { ApplicationInfo, EnvironmentService } from '@abp/ng.core'; import { ApplicationInfo, EnvironmentService } from '@abp/ng.core';
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { CommonModule } from '@angular/common';
@Component({ @Component({
standalone: false,
selector: 'abp-logo', selector: 'abp-logo',
template: ` template: `
<a class="navbar-brand" routerLink="/"> <a class="navbar-brand" routerLink="/">
@ -13,6 +13,7 @@ import { Component } from '@angular/core';
} }
</a> </a>
`, `,
imports: [CommonModule],
}) })
export class LogoComponent { export class LogoComponent {
get appInfo(): ApplicationInfo { get appInfo(): ApplicationInfo {

16
npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/current-user.component.ts

@ -2,17 +2,29 @@ import {
AuthService, AuthService,
ConfigStateService, ConfigStateService,
CurrentUserDto, CurrentUserDto,
LocalizationPipe,
NAVIGATE_TO_MANAGE_PROFILE, NAVIGATE_TO_MANAGE_PROFILE,
PermissionDirective,
SessionStateService, SessionStateService,
ToInjectorPipe,
} from '@abp/ng.core'; } from '@abp/ng.core';
import { UserMenu, UserMenuService } from '@abp/ng.theme.shared'; import { AbpVisibleDirective, UserMenu, UserMenuService } from '@abp/ng.theme.shared';
import { Component, Inject, TrackByFunction } from '@angular/core'; import { Component, Inject, TrackByFunction } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { CommonModule } from '@angular/common';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
@Component({ @Component({
standalone: false,
selector: 'abp-current-user', selector: 'abp-current-user',
templateUrl: './current-user.component.html', templateUrl: './current-user.component.html',
imports: [
CommonModule,
NgbDropdownModule,
AbpVisibleDirective,
PermissionDirective,
ToInjectorPipe,
LocalizationPipe,
],
}) })
export class CurrentUserComponent { export class CurrentUserComponent {
currentUser$: Observable<CurrentUserDto> = this.configState.getOne$('currentUser'); currentUser$: Observable<CurrentUserDto> = this.configState.getOne$('currentUser');

4
npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/languages.component.ts

@ -2,9 +2,10 @@ import { ConfigStateService, LanguageInfo, SessionStateService } from '@abp/ng.c
import { Component } from '@angular/core'; import { Component } from '@angular/core';
import { Observable } from 'rxjs'; import { Observable } from 'rxjs';
import { map } from 'rxjs/operators'; import { map } from 'rxjs/operators';
import { CommonModule } from '@angular/common';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
@Component({ @Component({
standalone: false,
selector: 'abp-languages', selector: 'abp-languages',
template: ` template: `
@if (((dropdownLanguages$ | async)?.length || 0) > 0) { @if (((dropdownLanguages$ | async)?.length || 0) > 0) {
@ -38,6 +39,7 @@ import { map } from 'rxjs/operators';
</div> </div>
} }
`, `,
imports: [CommonModule, NgbDropdownModule],
}) })
export class LanguagesComponent { export class LanguagesComponent {
get smallScreen(): boolean { get smallScreen(): boolean {

6
npm/ng-packs/packages/theme-basic/src/lib/components/nav-items/nav-items.component.ts

@ -1,10 +1,12 @@
import { NavItem, NavItemsService } from '@abp/ng.theme.shared'; import { AbpVisibleDirective, NavItem, NavItemsService } from '@abp/ng.theme.shared';
import { Component, TrackByFunction } from '@angular/core'; import { Component, TrackByFunction } from '@angular/core';
import { CommonModule } from '@angular/common';
import { PermissionDirective, ToInjectorPipe } from '@abp/ng.core';
@Component({ @Component({
standalone: false,
selector: 'abp-nav-items', selector: 'abp-nav-items',
templateUrl: 'nav-items.component.html', templateUrl: 'nav-items.component.html',
imports: [CommonModule, AbpVisibleDirective, PermissionDirective, ToInjectorPipe],
}) })
export class NavItemsComponent { export class NavItemsComponent {
trackByFn: TrackByFunction<NavItem> = (_, element) => element.id; trackByFn: TrackByFunction<NavItem> = (_, element) => element.id;

4
npm/ng-packs/packages/theme-basic/src/lib/components/page-alert-container/page-alert-container.component.ts

@ -1,11 +1,13 @@
import { Component, ViewEncapsulation } from '@angular/core'; import { Component, ViewEncapsulation } from '@angular/core';
import { PageAlertService } from '@abp/ng.theme.shared'; import { PageAlertService } from '@abp/ng.theme.shared';
import { CommonModule } from '@angular/common';
import { LocalizationPipe, SafeHtmlPipe } from '@abp/ng.core';
@Component({ @Component({
standalone: false,
selector: 'abp-page-alert-container', selector: 'abp-page-alert-container',
templateUrl: './page-alert-container.component.html', templateUrl: './page-alert-container.component.html',
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
imports: [CommonModule, LocalizationPipe, SafeHtmlPipe],
}) })
export class PageAlertContainerComponent { export class PageAlertContainerComponent {
constructor(public service: PageAlertService) {} constructor(public service: PageAlertService) {}

23
npm/ng-packs/packages/theme-basic/src/lib/components/routes/routes.component.ts

@ -1,4 +1,11 @@
import { ABP, RoutesService, TreeNode } from '@abp/ng.core'; import {
ABP,
LazyLocalizationPipe,
LocalizationPipe,
PermissionDirective,
RoutesService,
TreeNode,
} from '@abp/ng.core';
import { import {
Component, Component,
ElementRef, ElementRef,
@ -9,11 +16,23 @@ import {
TrackByFunction, TrackByFunction,
ViewChildren, ViewChildren,
} from '@angular/core'; } from '@angular/core';
import { CommonModule } from '@angular/common';
import { NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap';
import { RouterModule } from '@angular/router';
import { EllipsisDirective } from '@abp/ng.theme.shared';
@Component({ @Component({
standalone: false,
selector: 'abp-routes', selector: 'abp-routes',
templateUrl: 'routes.component.html', templateUrl: 'routes.component.html',
imports: [
CommonModule,
RouterModule,
NgbDropdownModule,
LazyLocalizationPipe,
PermissionDirective,
EllipsisDirective,
LocalizationPipe,
],
}) })
export class RoutesComponent { export class RoutesComponent {
public readonly routesService = inject(RoutesService); public readonly routesService = inject(RoutesService);

4
npm/ng-packs/packages/theme-basic/src/lib/components/validation-error/validation-error.component.ts

@ -1,8 +1,9 @@
import { CommonModule } from '@angular/common';
import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core'; import { ChangeDetectionStrategy, Component, ViewEncapsulation } from '@angular/core';
import { Validation, ValidationErrorComponent as ErrorComponent } from '@ngx-validate/core'; import { Validation, ValidationErrorComponent as ErrorComponent } from '@ngx-validate/core';
import { LocalizationPipe } from '@abp/ng.core';
@Component({ @Component({
standalone: false,
selector: 'abp-validation-error', selector: 'abp-validation-error',
template: ` template: `
@for (error of abpErrors; track $index) { @for (error of abpErrors; track $index) {
@ -13,6 +14,7 @@ import { Validation, ValidationErrorComponent as ErrorComponent } from '@ngx-val
`, `,
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None, encapsulation: ViewEncapsulation.None,
imports: [CommonModule, LocalizationPipe],
}) })
export class ValidationErrorComponent extends ErrorComponent { export class ValidationErrorComponent extends ErrorComponent {
get abpErrors(): (Validation.Error & { interpoliteParams?: string[] })[] { get abpErrors(): (Validation.Error & { interpoliteParams?: string[] })[] {

75
npm/ng-packs/packages/theme-basic/src/lib/theme-basic.module.ts

@ -1,54 +1,39 @@
import { CoreModule } from '@abp/ng.core';
import { ThemeSharedModule } from '@abp/ng.theme.shared';
import { ModuleWithProviders, NgModule } from '@angular/core'; import { ModuleWithProviders, NgModule } from '@angular/core';
import { NgbCollapseModule, NgbDropdownModule } from '@ng-bootstrap/ng-bootstrap'; import {
import { NgxValidateCoreModule } from '@ngx-validate/core'; AccountLayoutComponent,
import { AccountLayoutComponent } from './components/account-layout/account-layout.component'; AuthWrapperComponent,
import { AuthWrapperComponent } from './components/account-layout/auth-wrapper/auth-wrapper.component'; TenantBoxComponent,
import { TenantBoxComponent } from './components/account-layout/tenant-box/tenant-box.component'; ApplicationLayoutComponent,
import { ApplicationLayoutComponent } from './components/application-layout/application-layout.component'; EmptyLayoutComponent,
import { EmptyLayoutComponent } from './components/empty-layout/empty-layout.component'; LogoComponent,
import { LogoComponent } from './components/logo/logo.component'; CurrentUserComponent,
import { CurrentUserComponent } from './components/nav-items/current-user.component'; LanguagesComponent,
import { LanguagesComponent } from './components/nav-items/languages.component'; NavItemsComponent,
import { NavItemsComponent } from './components/nav-items/nav-items.component'; PageAlertContainerComponent,
import { PageAlertContainerComponent } from './components/page-alert-container/page-alert-container.component'; RoutesComponent,
import { RoutesComponent } from './components/routes/routes.component'; ValidationErrorComponent,
import { ValidationErrorComponent } from './components/validation-error/validation-error.component'; } from './components';
import { provideThemeBasicConfig } from './providers'; import { provideThemeBasicConfig } from './providers';
export const LAYOUTS = [ApplicationLayoutComponent, AccountLayoutComponent, EmptyLayoutComponent]; export const LAYOUTS = [ApplicationLayoutComponent, AccountLayoutComponent, EmptyLayoutComponent];
export const THEME_BASIC_COMPONENTS = [
...LAYOUTS,
ValidationErrorComponent,
LogoComponent,
NavItemsComponent,
RoutesComponent,
CurrentUserComponent,
LanguagesComponent,
PageAlertContainerComponent,
AuthWrapperComponent,
TenantBoxComponent,
];
@NgModule({ @NgModule({
declarations: [ declarations: [],
...LAYOUTS, exports: [...THEME_BASIC_COMPONENTS],
ValidationErrorComponent, imports: [...THEME_BASIC_COMPONENTS],
LogoComponent,
NavItemsComponent,
RoutesComponent,
CurrentUserComponent,
LanguagesComponent,
PageAlertContainerComponent,
TenantBoxComponent,
AuthWrapperComponent,
],
exports: [
...LAYOUTS,
ValidationErrorComponent,
LogoComponent,
NavItemsComponent,
RoutesComponent,
CurrentUserComponent,
LanguagesComponent,
PageAlertContainerComponent,
],
imports: [
CoreModule,
ThemeSharedModule,
NgbCollapseModule,
NgbDropdownModule,
NgxValidateCoreModule,
],
}) })
export class BaseThemeBasicModule {} export class BaseThemeBasicModule {}

6
npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb-items/breadcrumb-items.component.ts

@ -1,10 +1,12 @@
import { ABP } from '@abp/ng.core';
import { Component, Input } from '@angular/core'; import { Component, Input } from '@angular/core';
import { RouterModule } from '@angular/router';
import { CommonModule } from '@angular/common';
import { ABP, LocalizationPipe } from '@abp/ng.core';
@Component({ @Component({
standalone: false,
selector: 'abp-breadcrumb-items', selector: 'abp-breadcrumb-items',
templateUrl: './breadcrumb-items.component.html', templateUrl: './breadcrumb-items.component.html',
imports: [CommonModule, RouterModule, LocalizationPipe],
}) })
export class BreadcrumbItemsComponent { export class BreadcrumbItemsComponent {
@Input() items: Partial<ABP.Route>[] = []; @Input() items: Partial<ABP.Route>[] = [];

3
npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts

@ -10,13 +10,14 @@ import { ChangeDetectionStrategy, ChangeDetectorRef, Component, OnInit } from '@
import { Router } from '@angular/router'; import { Router } from '@angular/router';
import { map, startWith } from 'rxjs/operators'; import { map, startWith } from 'rxjs/operators';
import { eThemeSharedRouteNames } from '../../enums/route-names'; import { eThemeSharedRouteNames } from '../../enums/route-names';
import { BreadcrumbItemsComponent } from '../breadcrumb-items/breadcrumb-items.component';
@Component({ @Component({
standalone: false,
selector: 'abp-breadcrumb', selector: 'abp-breadcrumb',
templateUrl: './breadcrumb.component.html', templateUrl: './breadcrumb.component.html',
changeDetection: ChangeDetectionStrategy.OnPush, changeDetection: ChangeDetectionStrategy.OnPush,
providers: [SubscriptionService], providers: [SubscriptionService],
imports: [BreadcrumbItemsComponent],
}) })
export class BreadcrumbComponent implements OnInit { export class BreadcrumbComponent implements OnInit {
segments: Partial<ABP.Route>[] = []; segments: Partial<ABP.Route>[] = [];

5
npm/ng-packs/packages/theme-shared/src/lib/components/button/button.component.ts

@ -1,5 +1,4 @@
/* eslint-disable @angular-eslint/no-output-native */ /* eslint-disable @angular-eslint/no-output-native */
import { ABP } from '@abp/ng.core';
import { import {
Component, Component,
ElementRef, ElementRef,
@ -10,9 +9,10 @@ import {
Renderer2, Renderer2,
ViewChild, ViewChild,
} from '@angular/core'; } from '@angular/core';
import { CommonModule } from '@angular/common';
import { ABP } from '@abp/ng.core';
@Component({ @Component({
standalone: false,
selector: 'abp-button', selector: 'abp-button',
template: ` template: `
<button <button
@ -29,6 +29,7 @@ import {
<i [ngClass]="icon" class="me-1" aria-hidden="true"></i><ng-content></ng-content> <i [ngClass]="icon" class="me-1" aria-hidden="true"></i><ng-content></ng-content>
</button> </button>
`, `,
imports: [CommonModule],
}) })
export class ButtonComponent implements OnInit { export class ButtonComponent implements OnInit {
@Input() @Input()

3
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-body.component.ts

@ -1,11 +1,12 @@
import { Component, HostBinding, Input } from '@angular/core'; import { Component, HostBinding, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
@Component({ @Component({
standalone: false,
selector: 'abp-card-body', selector: 'abp-card-body',
template: ` <div [ngClass]="cardBodyClass" [ngStyle]="cardBodyStyle"> template: ` <div [ngClass]="cardBodyClass" [ngStyle]="cardBodyStyle">
<ng-content></ng-content> <ng-content></ng-content>
</div>`, </div>`,
imports: [CommonModule],
}) })
export class CardBodyComponent { export class CardBodyComponent {
@HostBinding('class') componentClass = 'card-body'; @HostBinding('class') componentClass = 'card-body';

3
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-footer.component.ts

@ -1,7 +1,7 @@
import { Component, HostBinding, Input } from '@angular/core'; import { Component, HostBinding, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
@Component({ @Component({
standalone: false,
selector: 'abp-card-footer', selector: 'abp-card-footer',
template: ` template: `
<div [ngStyle]="cardFooterStyle" [ngClass]="cardFooterClass"> <div [ngStyle]="cardFooterStyle" [ngClass]="cardFooterClass">
@ -9,6 +9,7 @@ import { Component, HostBinding, Input } from '@angular/core';
</div> </div>
`, `,
styles: [], styles: [],
imports: [CommonModule],
}) })
export class CardFooterComponent { export class CardFooterComponent {
@HostBinding('class') componentClass = 'card-footer'; @HostBinding('class') componentClass = 'card-footer';

3
npm/ng-packs/packages/theme-shared/src/lib/components/card/card-header.component.ts

@ -1,7 +1,7 @@
import { Component, HostBinding, Input } from '@angular/core'; import { Component, HostBinding, Input } from '@angular/core';
import { CommonModule } from '@angular/common';
@Component({ @Component({
standalone: false,
selector: 'abp-card-header', selector: 'abp-card-header',
template: ` template: `
<div [ngClass]="cardHeaderClass" [ngStyle]="cardHeaderStyle"> <div [ngClass]="cardHeaderClass" [ngStyle]="cardHeaderStyle">
@ -9,6 +9,7 @@ import { Component, HostBinding, Input } from '@angular/core';
</div> </div>
`, `,
styles: [], styles: [],
imports: [CommonModule],
}) })
export class CardHeaderComponent { export class CardHeaderComponent {
@HostBinding('class') componentClass = 'card-header'; @HostBinding('class') componentClass = 'card-header';

Some files were not shown because too many files changed in this diff

Loading…
Cancel
Save