Skip to content

Commit

Permalink
feat(abc:avatar-list): support standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jan 11, 2024
1 parent 6c4ffa7 commit 9a2323d
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 9 deletions.
3 changes: 2 additions & 1 deletion packages/abc/avatar-list/avatar-list-item.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { ChangeDetectionStrategy, Component, Input, ViewEncapsulation } from '@a
template: `<ng-content />`,
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
encapsulation: ViewEncapsulation.None,
standalone: true
})
export class AvatarListItemComponent {
@Input() src?: string;
Expand Down
7 changes: 6 additions & 1 deletion packages/abc/avatar-list/avatar-list.component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Direction, Directionality } from '@angular/cdk/bidi';
import { NgClass, NgStyle } from '@angular/common';
import {
AfterViewInit,
ChangeDetectionStrategy,
Expand All @@ -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';

Expand All @@ -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;
Expand Down
3 changes: 1 addition & 2 deletions packages/abc/avatar-list/avatar-list.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {}
4 changes: 2 additions & 2 deletions packages/abc/avatar-list/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ 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 |
|----------|-------------|------|---------|
| `[size]` | size of list | `'large','small','mini','default'` | `'default'` |
| `[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 |
|----------|-------------|------|---------|
Expand Down
4 changes: 2 additions & 2 deletions packages/abc/avatar-list/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@ module: import { AvatarListModule } from '@delon/abc/avatar-list';

## API

### avatar-list
### avatar-list:standalone

| 成员 | 说明 | 类型 | 默认值 |
|----|----|----|-----|
| `[size]` | 头像大小 | `'large','small','mini','default'` | `'default'` |
| `[maxLength]` | 要显示的最大项目 | `number` | - |
| `[excessItemsStyle]` | 多余的项目风格 | `{ [key: string]: string }` | - |

### avatar-list-item
### avatar-list-item:standalone

| 成员 | 说明 | 类型 | 默认值 |
|----|----|----|-----|
Expand Down
3 changes: 2 additions & 1 deletion packages/abc/cell/cell.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -121,6 +121,7 @@ import type { CellDefaultText, CellOptions, CellTextResult, CellValue, CellWidge
NzTagModule,
NzBadgeModule,
NzToolTipModule,
NzImageModule,
CellHostDirective
]
})
Expand Down

0 comments on commit 9a2323d

Please sign in to comment.