Skip to content

Commit

Permalink
feat(module:back-top): support standalone component (#8195)
Browse files Browse the repository at this point in the history
* feat(module:back-top): support standalone component

* feat(module:back-top): support standalone component
  • Loading branch information
evgeniyefimov committed Dec 5, 2023
1 parent 548e842 commit db5d5f4
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 10 deletions.
5 changes: 4 additions & 1 deletion components/back-top/back-top.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import { Direction, Directionality } from '@angular/cdk/bidi';
import { Platform, normalizePassiveListenerOptions } from '@angular/cdk/platform';
import { DOCUMENT } from '@angular/common';
import { DOCUMENT, NgIf, NgTemplateOutlet } from '@angular/common';
import {
ChangeDetectionStrategy,
ChangeDetectorRef,
Expand Down Expand Up @@ -33,6 +33,7 @@ import { NzConfigKey, NzConfigService, WithConfig } from 'ng-zorro-antd/core/con
import { NzDestroyService, NzScrollService } from 'ng-zorro-antd/core/services';
import { NumberInput, NzSafeAny } from 'ng-zorro-antd/core/types';
import { InputNumber } from 'ng-zorro-antd/core/util';
import { NzIconModule } from 'ng-zorro-antd/icon';

const NZ_CONFIG_MODULE_NAME: NzConfigKey = 'backTop';

Expand All @@ -42,6 +43,8 @@ const passiveEventListenerOptions = normalizePassiveListenerOptions({ passive: t
selector: 'nz-back-top',
exportAs: 'nzBackTop',
animations: [fadeMotion],
standalone: true,
imports: [NgIf, NgTemplateOutlet, NzIconModule],
template: `
<div #backTop class="ant-back-top" [class.ant-back-top-rtl]="dir === 'rtl'" @fadeMotion *ngIf="visible">
<ng-template #defaultContent>
Expand Down
8 changes: 1 addition & 7 deletions components/back-top/back-top.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,12 @@
* found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE
*/

import { BidiModule } from '@angular/cdk/bidi';
import { PlatformModule } from '@angular/cdk/platform';
import { CommonModule } from '@angular/common';
import { NgModule } from '@angular/core';

import { NzIconModule } from 'ng-zorro-antd/icon';

import { NzBackTopComponent } from './back-top.component';

@NgModule({
declarations: [NzBackTopComponent],
exports: [NzBackTopComponent],
imports: [BidiModule, CommonModule, PlatformModule, NzIconModule]
imports: [NzBackTopComponent]
})
export class NzBackTopModule {}
2 changes: 1 addition & 1 deletion components/back-top/doc/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import { NzBackTopModule } from 'ng-zorro-antd/back-top';

## API

### nz-back-top
### nz-back-top:standalone

> The distance to the bottom is set to `50px` by default, which is overridable.
> If you decide to use custom styles, please note the size limit: no more than `40px * 40px`.
Expand Down
2 changes: 1 addition & 1 deletion components/back-top/doc/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import { NzBackTopModule } from 'ng-zorro-antd/back-top';

## API

### nz-back-top
### nz-back-top:standalone

> 有默认样式,距离底部 `50px`,可覆盖。
> 自定义样式宽高不大于 `40px * 40px`
Expand Down

0 comments on commit db5d5f4

Please sign in to comment.