`,
styles: [],
- imports: [NgClass, NgStyle],
+ imports: [NgClass],
})
export class CardHeaderComponent {
@HostBinding('class') componentClass = 'card-header';
diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts
index 42973fdcb0..1f941bcb7e 100644
--- a/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts
+++ b/npm/ng-packs/packages/theme-shared/src/lib/components/card/card.component.ts
@@ -1,12 +1,12 @@
import { Component, Input } from '@angular/core';
-import { NgClass, NgStyle } from '@angular/common';
+import { NgClass } from '@angular/common';
@Component({
selector: 'abp-card',
- template: `
+ template: `
`,
- imports: [NgClass, NgStyle],
+ imports: [NgClass],
})
export class CardComponent {
@Input() cardClass: string;
diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/checkbox/checkbox.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/checkbox/checkbox.component.ts
index 8cadf828d1..7be8551c2b 100644
--- a/npm/ng-packs/packages/theme-shared/src/lib/components/checkbox/checkbox.component.ts
+++ b/npm/ng-packs/packages/theme-shared/src/lib/components/checkbox/checkbox.component.ts
@@ -1,6 +1,6 @@
import { Component, EventEmitter, forwardRef, Input, Output } from '@angular/core';
import { NG_VALUE_ACCESSOR, FormsModule } from '@angular/forms';
-import { NgClass, NgStyle } from '@angular/common';
+import { NgClass } from '@angular/common';
import { AbstractNgModelComponent, LocalizationPipe } from '@abp/ng.core';
@Component({
@@ -13,7 +13,7 @@ import { AbstractNgModelComponent, LocalizationPipe } from '@abp/ng.core';
[id]="checkboxId"
[readonly]="checkboxReadonly"
[ngClass]="checkboxClass"
- [ngStyle]="checkboxStyle"
+ [style]="checkboxStyle"
(blur)="checkboxBlur.next()"
(focus)="checkboxFocus.next()"
/>
@@ -31,7 +31,7 @@ import { AbstractNgModelComponent, LocalizationPipe } from '@abp/ng.core';
multi: true,
},
],
- imports: [NgClass, NgStyle, FormsModule, LocalizationPipe],
+ imports: [NgClass, FormsModule, LocalizationPipe],
})
export class FormCheckboxComponent extends AbstractNgModelComponent {
@Input() label?: string;
diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/form-input/form-input.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/form-input/form-input.component.ts
index 2d10ab5709..401cf22250 100644
--- a/npm/ng-packs/packages/theme-shared/src/lib/components/form-input/form-input.component.ts
+++ b/npm/ng-packs/packages/theme-shared/src/lib/components/form-input/form-input.component.ts
@@ -1,6 +1,6 @@
import { Component, EventEmitter, forwardRef, Input, Output } from '@angular/core';
import { FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
-import { NgClass, NgStyle } from '@angular/common';
+import { NgClass } from '@angular/common';
import { AbstractNgModelComponent, LocalizationPipe } from '@abp/ng.core';
@Component({
@@ -18,7 +18,7 @@ import { AbstractNgModelComponent, LocalizationPipe } from '@abp/ng.core';
[placeholder]="inputPlaceholder"
[readonly]="inputReadonly"
[ngClass]="inputClass"
- [ngStyle]="inputStyle"
+ [style]="inputStyle"
(blur)="formBlur.next()"
(focus)="formFocus.next()"
[(ngModel)]="value"
@@ -32,7 +32,7 @@ import { AbstractNgModelComponent, LocalizationPipe } from '@abp/ng.core';
multi: true,
},
],
- imports: [NgClass, NgStyle, LocalizationPipe, FormsModule],
+ imports: [NgClass, LocalizationPipe, FormsModule],
})
export class FormInputComponent extends AbstractNgModelComponent {
@Input() inputId!: string;
diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts
index 244b055322..81e2d6597f 100644
--- a/npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts
+++ b/npm/ng-packs/packages/theme-shared/src/lib/components/loader-bar/loader-bar.component.ts
@@ -1,118 +1,116 @@
-import { NgClass, NgStyle } from '@angular/common';
-import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, inject } from '@angular/core';
-import { combineLatest, Subscription, timer } from 'rxjs';
-import { HttpWaitService, RouterWaitService, SubscriptionService } from '@abp/ng.core';
-
-@Component({
- selector: 'abp-loader-bar',
- template: `
-
- `,
- styleUrls: ['./loader-bar.component.scss'],
- providers: [SubscriptionService],
- imports: [NgClass, NgStyle],
-})
-export class LoaderBarComponent implements OnDestroy, OnInit {
- private cdRef = inject(ChangeDetectorRef);
- private subscription = inject(SubscriptionService);
- private httpWaitService = inject(HttpWaitService);
- private routerWaitService = inject(RouterWaitService);
-
- protected _isLoading!: boolean;
-
- @Input()
- set isLoading(value: boolean) {
- this._isLoading = value;
- this.cdRef.detectChanges();
- }
- get isLoading(): boolean {
- return this._isLoading;
- }
-
- @Input()
- containerClass = 'abp-loader-bar';
-
- @Input()
- color = '#77b6ff';
-
- progressLevel = 0;
-
- interval = new Subscription();
-
- timer = new Subscription();
-
- intervalPeriod = 350;
-
- stopDelay = 800;
-
- private readonly clearProgress = () => {
- this.progressLevel = 0;
- this.cdRef.detectChanges();
- };
-
- private readonly reportProgress = () => {
- if (this.progressLevel < 75) {
- this.progressLevel += 1 + Math.random() * 9;
- } else if (this.progressLevel < 90) {
- this.progressLevel += 0.4;
- } else if (this.progressLevel < 100) {
- this.progressLevel += 0.1;
- } else {
- this.interval.unsubscribe();
- }
- this.cdRef.detectChanges();
- };
-
- get boxShadow(): string {
- return `0 0 10px rgba(${this.color}, 0.5)`;
- }
-
- ngOnInit() {
- this.subscribeLoading();
- }
-
- subscribeLoading() {
- this.subscription.addOne(
- combineLatest([this.httpWaitService.getLoading$(), this.routerWaitService.getLoading$()]),
- ([httpLoading, routerLoading]) => {
- if (httpLoading || routerLoading) this.startLoading();
- else this.stopLoading();
- },
- );
- }
-
- ngOnDestroy() {
- this.interval.unsubscribe();
- }
-
- startLoading() {
- if (this.isLoading || !this.interval.closed) return;
-
- this.isLoading = true;
- this.progressLevel = 0;
- this.cdRef.detectChanges();
- this.interval = timer(0, this.intervalPeriod).subscribe(this.reportProgress);
- this.timer.unsubscribe();
- }
-
- stopLoading() {
- this.interval.unsubscribe();
-
- this.progressLevel = 100;
- this.isLoading = false;
-
- if (!this.timer.closed) return;
-
- this.timer = timer(this.stopDelay).subscribe(this.clearProgress);
- }
-}
+import { NgClass }ngular/common';
+import { ChangeDetectorRef, Component, Input, OnDestroy, OnInit, inject } from '@angular/core';
+import { combineLatest, Subscription, timer } from 'rxjs';
+import { HttpWaitService, RouterWaitService, SubscriptionService } from '@abp/ng.core';
+
+@Component({
+ selector: 'abp-loader-bar',
+ template: `
+
+
+
+ Urls: ['./loader-bar.component.scss'],
+ providers: [SubscriptionService],
+ imports: [NgClass],
[NgClass]LoaderBarComponent implements OnDestroy, OnInit {
+ private cdRef = inject(ChangeDetectorRef);
+ private subscription = inject(SubscriptionService);
+ private httpWaitService = inject(HttpWaitService);
+ private routerWaitService = inject(RouterWaitService);
+
+ protected _isLoading!: boolean;
+
+ @Input()
+ set isLoading(value: boolean) {
+ this._isLoading = value;
+ this.cdRef.detectChanges();
+ }
+ get isLoading(): boolean {
+ return this._isLoading;
+ }
+
+ @Input()
+ containerClass = 'abp-loader-bar';
+
+ @Input()
+ color = '#77b6ff';
+
+ progressLevel = 0;
+
+ interval = new Subscription();
+
+ timer = new Subscription();
+
+ intervalPeriod = 350;
+
+ stopDelay = 800;
+
+ private readonly clearProgress = () => {
+ this.progressLevel = 0;
+ this.cdRef.detectChanges();
+ };
+
+ private readonly reportProgress = () => {
+ if (this.progressLevel < 75) {
+ this.progressLevel += 1 + Math.random() * 9;
+ } else if (this.progressLevel < 90) {
+ this.progressLevel += 0.4;
+ } else if (this.progressLevel < 100) {
+ this.progressLevel += 0.1;
+ } else {
+ this.interval.unsubscribe();
+ }
+ this.cdRef.detectChanges();
+ };
+
+ get boxShadow(): string {
+ return `0 0 10px rgba(${this.color}, 0.5)`;
+ }
+
+ ngOnInit() {
+ this.subscribeLoading();
+ }
+
+ subscribeLoading() {
+ this.subscription.addOne(
+ combineLatest([this.httpWaitService.getLoading$(), this.routerWaitService.getLoading$()]),
+ ([httpLoading, routerLoading]) => {
+ if (httpLoading || routerLoading) this.startLoading();
+ else this.stopLoading();
+ },
+ );
+ }
+
+ ngOnDestroy() {
+ this.interval.unsubscribe();
+ }
+
+ startLoading() {
+ if (this.isLoading || !this.interval.closed) return;
+
+ this.isLoading = true;
+ this.progressLevel = 0;
+ this.cdRef.detectChanges();
+ this.interval = timer(0, this.intervalPeriod).subscribe(this.reportProgress);
+ this.timer.unsubscribe();
+ }
+
+ stopLoading() {
+ this.interval.unsubscribe();
+
+ this.progressLevel = 100;
+ this.isLoading = false;
+
+ if (!this.timer.closed) return;
+
+ this.timer = timer(this.stopDelay).subscribe(this.clearProgress);
+ }
+}
From ca0172ba023bf10d9a9b8b06ae4181fb172df0dc Mon Sep 17 00:00:00 2001
From: Fahri Gedik <53567152+fahrigedik@users.noreply.github.com>
Date: Thu, 8 Jan 2026 13:29:48 +0300
Subject: [PATCH 3/5] Refactor Angular imports for component modules
Replaced CommonModule with more specific Angular imports (NgTemplateOutlet, NgClass) in several components to optimize module usage and reduce unnecessary dependencies. Also removed unused CommonModule import from email-setting-group and http-error-wrapper components.
---
.../components/lookup/src/lib/lookup-search.component.ts | 4 ++--
.../email-setting-group/email-setting-group.component.ts | 7 +++----
.../src/lib/components/button/button.component.ts | 4 ++--
.../http-error-wrapper/http-error-wrapper.component.ts | 4 ++--
4 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/npm/ng-packs/packages/components/lookup/src/lib/lookup-search.component.ts b/npm/ng-packs/packages/components/lookup/src/lib/lookup-search.component.ts
index b78bfa19ce..6b4f475edd 100644
--- a/npm/ng-packs/packages/components/lookup/src/lib/lookup-search.component.ts
+++ b/npm/ng-packs/packages/components/lookup/src/lib/lookup-search.component.ts
@@ -12,7 +12,7 @@ import {
inject,
} from '@angular/core';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
-import { CommonModule } from '@angular/common';
+import { NgTemplateOutlet } from '@angular/common';
import { FormsModule } from '@angular/forms';
import { LocalizationPipe } from '@abp/ng.core';
import { Subject, Observable, debounceTime, distinctUntilChanged, of, finalize } from 'rxjs';
@@ -29,7 +29,7 @@ export type LookupSearchFn