From 9a2323da36d8da05af7db5644dbefb2db772cea7 Mon Sep 17 00:00:00 2001 From: cipchk Date: Thu, 11 Jan 2024 16:19:26 +0800 Subject: [PATCH] feat(abc:avatar-list): support standalone --- packages/abc/avatar-list/avatar-list-item.component.ts | 3 ++- packages/abc/avatar-list/avatar-list.component.ts | 7 ++++++- packages/abc/avatar-list/avatar-list.module.ts | 3 +-- packages/abc/avatar-list/index.en-US.md | 4 ++-- packages/abc/avatar-list/index.zh-CN.md | 4 ++-- packages/abc/cell/cell.component.ts | 3 ++- 6 files changed, 15 insertions(+), 9 deletions(-) diff --git a/packages/abc/avatar-list/avatar-list-item.component.ts b/packages/abc/avatar-list/avatar-list-item.component.ts index f90a9f4b2f..032be816e2 100644 --- a/packages/abc/avatar-list/avatar-list-item.component.ts +++ b/packages/abc/avatar-list/avatar-list-item.component.ts @@ -6,7 +6,8 @@ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@a template: ``, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, + standalone: true }) export class AvatarListItemComponent { @Input() src?: string; diff --git a/packages/abc/avatar-list/avatar-list.component.ts b/packages/abc/avatar-list/avatar-list.component.ts index c176bb747d..4fbf28fdff 100644 --- a/packages/abc/avatar-list/avatar-list.component.ts +++ b/packages/abc/avatar-list/avatar-list.component.ts @@ -1,4 +1,5 @@ import { Direction, Directionality } from '@angular/cdk/bidi'; +import { NgClass, NgStyle } from '@angular/common'; import { AfterViewInit, ChangeDetectionStrategy, @@ -14,7 +15,9 @@ import { import { takeUntilDestroyed } from '@angular/core/rxjs-interop'; import { InputNumber, NumberInput } from '@delon/util/decorator'; +import { NzAvatarComponent } from 'ng-zorro-antd/avatar'; import type { NgStyleInterface, NzSizeLDSType } from 'ng-zorro-antd/core/types'; +import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; import { AvatarListItemComponent } from './avatar-list-item.component'; @@ -28,7 +31,9 @@ import { AvatarListItemComponent } from './avatar-list-item.component'; }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, + standalone: true, + imports: [NgStyle, NgClass, NzAvatarComponent, NzToolTipModule] }) export class AvatarListComponent implements AfterViewInit, OnChanges { static ngAcceptInputType_maxLength: NumberInput; diff --git a/packages/abc/avatar-list/avatar-list.module.ts b/packages/abc/avatar-list/avatar-list.module.ts index 4aefbd0956..9e2bb47e8f 100644 --- a/packages/abc/avatar-list/avatar-list.module.ts +++ b/packages/abc/avatar-list/avatar-list.module.ts @@ -10,8 +10,7 @@ import { AvatarListComponent } from './avatar-list.component'; const COMPONENTS = [AvatarListComponent, AvatarListItemComponent]; @NgModule({ - imports: [CommonModule, NzAvatarModule, NzToolTipModule], - declarations: COMPONENTS, + imports: [CommonModule, NzAvatarModule, NzToolTipModule, ...COMPONENTS], exports: COMPONENTS }) export class AvatarListModule {} diff --git a/packages/abc/avatar-list/index.en-US.md b/packages/abc/avatar-list/index.en-US.md index 9f24f5b667..07c3bb2868 100644 --- a/packages/abc/avatar-list/index.en-US.md +++ b/packages/abc/avatar-list/index.en-US.md @@ -10,7 +10,7 @@ A list of user's avatar for project or group member list frequently. If a large ## API -### avatar-list +### avatar-list:standalone | Property | Description | Type | Default | |----------|-------------|------|---------| @@ -18,7 +18,7 @@ A list of user's avatar for project or group member list frequently. If a large | `[maxLength]` | max items to show | `number` | - | | `[excessItemsStyle]` | the excess item style | `{ [key: string]: string }` | - | -### avatar-list-item +### avatar-list-item:standalone | Property | Description | Type | Default | |----------|-------------|------|---------| diff --git a/packages/abc/avatar-list/index.zh-CN.md b/packages/abc/avatar-list/index.zh-CN.md index e37c2cdf0f..dbe709b6b1 100644 --- a/packages/abc/avatar-list/index.zh-CN.md +++ b/packages/abc/avatar-list/index.zh-CN.md @@ -10,7 +10,7 @@ module: import { AvatarListModule } from '@delon/abc/avatar-list'; ## API -### avatar-list +### avatar-list:standalone | 成员 | 说明 | 类型 | 默认值 | |----|----|----|-----| @@ -18,7 +18,7 @@ module: import { AvatarListModule } from '@delon/abc/avatar-list'; | `[maxLength]` | 要显示的最大项目 | `number` | - | | `[excessItemsStyle]` | 多余的项目风格 | `{ [key: string]: string }` | - | -### avatar-list-item +### avatar-list-item:standalone | 成员 | 说明 | 类型 | 默认值 | |----|----|----|-----| diff --git a/packages/abc/cell/cell.component.ts b/packages/abc/cell/cell.component.ts index 3c2e6293d8..2a566e1939 100644 --- a/packages/abc/cell/cell.component.ts +++ b/packages/abc/cell/cell.component.ts @@ -26,7 +26,7 @@ import { NzBadgeModule } from 'ng-zorro-antd/badge'; import { NzCheckboxModule } from 'ng-zorro-antd/checkbox'; import type { NzSafeAny } from 'ng-zorro-antd/core/types'; import { NzIconModule } from 'ng-zorro-antd/icon'; -import { NzImage, NzImageService } from 'ng-zorro-antd/image'; +import { NzImage, NzImageModule, NzImageService } from 'ng-zorro-antd/image'; import { NzRadioModule } from 'ng-zorro-antd/radio'; import { NzTagModule } from 'ng-zorro-antd/tag'; import { NzToolTipModule } from 'ng-zorro-antd/tooltip'; @@ -121,6 +121,7 @@ import type { CellDefaultText, CellOptions, CellTextResult, CellValue, CellWidge NzTagModule, NzBadgeModule, NzToolTipModule, + NzImageModule, CellHostDirective ] })