Skip to content

Commit de579bc

Browse files
authored
feat(module:core): make no-animation standalone (#8257)
* feat(module:core): make no-animation standalone * refactor(module:*): use standalone directive * style(module:auto-complete): fix linter * refactor(module:*): use standalone directive instead module
1 parent 5765ae9 commit de579bc

File tree

17 files changed

+48
-48
lines changed

17 files changed

+48
-48
lines changed

components/auto-complete/autocomplete.component.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,11 @@ import {
3030
ViewChildren,
3131
ViewEncapsulation
3232
} from '@angular/core';
33-
import { Observable, Subject, Subscription, defer, merge } from 'rxjs';
33+
import { defer, merge, Observable, Subject, Subscription } from 'rxjs';
3434
import { filter, switchMap, take, takeUntil } from 'rxjs/operators';
3535

3636
import { slideMotion } from 'ng-zorro-antd/core/animation';
37-
import { NzNoAnimationDirective, NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
37+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
3838
import { BooleanInput, CompareWith, NzSafeAny } from 'ng-zorro-antd/core/types';
3939
import { InputBoolean } from 'ng-zorro-antd/core/util';
4040

@@ -66,7 +66,7 @@ function normalizeDataSource(value: AutocompleteDataSource): AutocompleteDataSou
6666
changeDetection: ChangeDetectionStrategy.OnPush,
6767
encapsulation: ViewEncapsulation.None,
6868
standalone: true,
69-
imports: [NgClass, NgFor, NgStyle, NgTemplateOutlet, NzAutocompleteOptionComponent, NzNoAnimationModule],
69+
imports: [NgClass, NgFor, NgStyle, NgTemplateOutlet, NzAutocompleteOptionComponent, NzNoAnimationDirective],
7070
template: `
7171
<ng-template>
7272
<div

components/badge/badge-sup.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ import {
1616
} from '@angular/core';
1717

1818
import { zoomBadgeMotion } from 'ng-zorro-antd/core/animation';
19-
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
19+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
2020
import { NzSafeAny, NzSizeDSType } from 'ng-zorro-antd/core/types';
2121

2222
@Component({
@@ -27,7 +27,7 @@ import { NzSafeAny, NzSizeDSType } from 'ng-zorro-antd/core/types';
2727
changeDetection: ChangeDetectionStrategy.OnPush,
2828
animations: [zoomBadgeMotion],
2929
standalone: true,
30-
imports: [NgFor, NgIf, NzNoAnimationModule],
30+
imports: [NgFor, NgIf, NzNoAnimationDirective],
3131
template: `
3232
<ng-container *ngIf="count <= nzOverflowCount; else overflowTemplate">
3333
<span

components/badge/badge.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { ComponentFixture, fakeAsync, TestBed, tick } from '@angular/core/testin
44
import { By } from '@angular/platform-browser';
55
import { BrowserAnimationsModule } from '@angular/platform-browser/animations';
66

7-
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
7+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
88
import { NgStyleInterface, NzSizeDSType } from 'ng-zorro-antd/core/types';
99

1010
import { NzBadgeComponent } from './badge.component';
@@ -13,7 +13,7 @@ import { NzBadgeModule } from './badge.module';
1313
describe('badge', () => {
1414
beforeEach(fakeAsync(() => {
1515
TestBed.configureTestingModule({
16-
imports: [BidiModule, NzBadgeModule, NzNoAnimationModule, BrowserAnimationsModule],
16+
imports: [BidiModule, NzBadgeModule, NzNoAnimationDirective, BrowserAnimationsModule],
1717
declarations: [NzTestBadgeBasicComponent, NzTestBadgeRtlComponent]
1818
});
1919
TestBed.compileComponents();

components/cascader/cascader.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import {
1313
Component,
1414
ElementRef,
1515
EventEmitter,
16+
forwardRef,
1617
Host,
1718
HostListener,
1819
Input,
@@ -28,17 +29,16 @@ import {
2829
TemplateRef,
2930
ViewChild,
3031
ViewChildren,
31-
ViewEncapsulation,
32-
forwardRef
32+
ViewEncapsulation
3333
} from '@angular/core';
3434
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
35-
import { BehaviorSubject, EMPTY, Observable, fromEvent, of as observableOf } from 'rxjs';
35+
import { BehaviorSubject, EMPTY, fromEvent, Observable, of as observableOf } from 'rxjs';
3636
import { distinctUntilChanged, map, startWith, switchMap, takeUntil, withLatestFrom } from 'rxjs/operators';
3737

3838
import { slideMotion } from 'ng-zorro-antd/core/animation';
3939
import { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';
4040
import { NzFormNoStatusService, NzFormPatchModule, NzFormStatusService } from 'ng-zorro-antd/core/form';
41-
import { NzNoAnimationDirective, NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
41+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
4242
import { DEFAULT_CASCADER_POSITIONS, NzOverlayModule } from 'ng-zorro-antd/core/overlay';
4343
import { NzDestroyService } from 'ng-zorro-antd/core/services';
4444
import {
@@ -50,7 +50,7 @@ import {
5050
NzStatus,
5151
NzValidateStatus
5252
} from 'ng-zorro-antd/core/types';
53-
import { InputBoolean, getStatusClassNames, toArray } from 'ng-zorro-antd/core/util';
53+
import { getStatusClassNames, InputBoolean, toArray } from 'ng-zorro-antd/core/util';
5454
import { NzEmptyModule } from 'ng-zorro-antd/empty';
5555
import { NzCascaderI18nInterface, NzI18nService } from 'ng-zorro-antd/i18n';
5656
import { NzIconModule } from 'ng-zorro-antd/icon';
@@ -233,7 +233,7 @@ const defaultDisplayRender = (labels: string[]): string => labels.join(' / ');
233233
NzIconModule,
234234
NzFormPatchModule,
235235
NzOverlayModule,
236-
NzNoAnimationModule,
236+
NzNoAnimationDirective,
237237
NgClass,
238238
NgStyle,
239239
NzEmptyModule,

components/date-picker/date-picker.component.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ import {
2222
Component,
2323
ElementRef,
2424
EventEmitter,
25+
forwardRef,
2526
Host,
2627
Inject,
2728
Input,
@@ -36,8 +37,7 @@ import {
3637
TemplateRef,
3738
ViewChild,
3839
ViewChildren,
39-
ViewEncapsulation,
40-
forwardRef
40+
ViewEncapsulation
4141
} from '@angular/core';
4242
import { ControlValueAccessor, FormsModule, NG_VALUE_ACCESSOR } from '@angular/forms';
4343
import { fromEvent, of as observableOf } from 'rxjs';
@@ -47,11 +47,11 @@ import { NzResizeObserver } from 'ng-zorro-antd/cdk/resize-observer';
4747
import { slideMotion } from 'ng-zorro-antd/core/animation';
4848
import { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';
4949
import { NzFormNoStatusService, NzFormPatchModule, NzFormStatusService } from 'ng-zorro-antd/core/form';
50-
import { NzNoAnimationDirective, NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
50+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
5151
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
5252
import { DATE_PICKER_POSITION_MAP, DEFAULT_DATE_PICKER_POSITIONS, NzOverlayModule } from 'ng-zorro-antd/core/overlay';
5353
import { NzDestroyService } from 'ng-zorro-antd/core/services';
54-
import { CandyDate, CompatibleValue, cloneDate, wrongSortOrder } from 'ng-zorro-antd/core/time';
54+
import { CandyDate, cloneDate, CompatibleValue, wrongSortOrder } from 'ng-zorro-antd/core/time';
5555
import {
5656
BooleanInput,
5757
FunctionProp,
@@ -62,7 +62,7 @@ import {
6262
OnChangeType,
6363
OnTouchedType
6464
} from 'ng-zorro-antd/core/types';
65-
import { InputBoolean, getStatusClassNames, toBoolean, valueFunctionProp } from 'ng-zorro-antd/core/util';
65+
import { getStatusClassNames, InputBoolean, toBoolean, valueFunctionProp } from 'ng-zorro-antd/core/util';
6666
import {
6767
DateHelperService,
6868
NzDatePickerI18nInterface,
@@ -264,7 +264,7 @@ export type NzPlacement = 'bottomLeft' | 'bottomRight' | 'topLeft' | 'topRight';
264264
DateRangePopupComponent,
265265
CdkConnectedOverlay,
266266
NzOverlayModule,
267-
NzNoAnimationModule
267+
NzNoAnimationDirective
268268
],
269269
standalone: true
270270
})

components/drawer/drawer.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import { Observable, Subject } from 'rxjs';
3535
import { takeUntil } from 'rxjs/operators';
3636

3737
import { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/config';
38-
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
38+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
3939
import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
4040
import { BooleanInput, NgStyleInterface, NzSafeAny } from 'ng-zorro-antd/core/types';
4141
import { InputBoolean, toCssPixel } from 'ng-zorro-antd/core/util';
@@ -140,7 +140,7 @@ const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'drawer';
140140
`,
141141
preserveWhitespaces: false,
142142
changeDetection: ChangeDetectionStrategy.OnPush,
143-
imports: [NzNoAnimationModule, NgIf, NgStyle, NzOutletModule, NzIconModule, PortalModule, NgTemplateOutlet],
143+
imports: [NzNoAnimationDirective, NgIf, NgStyle, NzOutletModule, NzIconModule, PortalModule, NgTemplateOutlet],
144144
standalone: true
145145
})
146146
export class NzDrawerComponent<T extends {} = NzSafeAny, R = NzSafeAny, D extends Partial<T> = NzSafeAny>

components/drawer/drawer.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Component, Inject, Input, TemplateRef, ViewChild } from '@angular/core'
55
import { ComponentFixture, fakeAsync, inject, TestBed, tick, waitForAsync } from '@angular/core/testing';
66
import { NoopAnimationsModule } from '@angular/platform-browser/animations';
77

8-
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
8+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
99
import { dispatchKeyboardEvent } from 'ng-zorro-antd/core/testing';
1010
import { NZ_DRAWER_DATA } from 'ng-zorro-antd/drawer/drawer-options';
1111

@@ -18,7 +18,7 @@ describe('NzDrawerComponent', () => {
1818
beforeEach(
1919
waitForAsync(() => {
2020
TestBed.configureTestingModule({
21-
imports: [BidiModule, NzDrawerModule, NoopAnimationsModule, NzNoAnimationModule],
21+
imports: [BidiModule, NzDrawerModule, NoopAnimationsModule, NzNoAnimationDirective],
2222
declarations: [NzTestDrawerComponent, NzTestDrawerRtlComponent]
2323
}).compileComponents();
2424
})

components/dropdown/dropdown-menu.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ import { BehaviorSubject, Subject } from 'rxjs';
2727
import { takeUntil } from 'rxjs/operators';
2828

2929
import { slideMotion } from 'ng-zorro-antd/core/animation';
30-
import { NzNoAnimationDirective, NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
30+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
3131
import { IndexableObject, NzSafeAny } from 'ng-zorro-antd/core/types';
3232
import { MenuService, NzIsMenuInsideDropDownToken } from 'ng-zorro-antd/menu';
3333

@@ -66,7 +66,7 @@ export type NzPlacementType = 'bottomLeft' | 'bottomCenter' | 'bottomRight' | 't
6666
preserveWhitespaces: false,
6767
encapsulation: ViewEncapsulation.None,
6868
changeDetection: ChangeDetectionStrategy.OnPush,
69-
imports: [NgClass, NgStyle, NzNoAnimationModule],
69+
imports: [NgClass, NgStyle, NzNoAnimationDirective],
7070
standalone: true
7171
})
7272
export class NzDropdownMenuComponent implements AfterContentInit, OnDestroy, OnInit {

components/graph/demo/module

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@ import { NzGraphModule } from 'ng-zorro-antd/graph';
22
import { NzButtonModule } from 'ng-zorro-antd/button';
33
import { NzIconModule } from 'ng-zorro-antd/icon';
44
import { NzRadioModule } from 'ng-zorro-antd/radio';
5-
import { NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
5+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
66

7-
export const moduleList = [ NzGraphModule, NzButtonModule, NzIconModule, NzRadioModule, NzNoAnimationModule ];
7+
export const moduleList = [ NzGraphModule, NzButtonModule, NzIconModule, NzRadioModule, NzNoAnimationDirective ];

components/menu/submenu.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import {
3333
import { combineLatest, merge, Subject } from 'rxjs';
3434
import { map, startWith, switchMap, takeUntil } from 'rxjs/operators';
3535

36-
import { NzNoAnimationDirective, NzNoAnimationModule } from 'ng-zorro-antd/core/no-animation';
36+
import { NzNoAnimationDirective } from 'ng-zorro-antd/core/no-animation';
3737
import { getPlacementName, POSITION_MAP, POSITION_TYPE_HORIZONTAL } from 'ng-zorro-antd/core/overlay';
3838
import { BooleanInput } from 'ng-zorro-antd/core/types';
3939
import { InputBoolean } from 'ng-zorro-antd/core/util';
@@ -149,7 +149,7 @@ const listOfHorizontalPositions = [
149149
NzSubMenuTitleComponent,
150150
NzSubmenuInlineChildComponent,
151151
NgIf,
152-
NzNoAnimationModule,
152+
NzNoAnimationDirective,
153153
NzSubmenuNoneInlineChildComponent,
154154
OverlayModule
155155
],

0 commit comments

Comments
 (0)