From 2ee634e2b2553044ba94b0f09382ae0a84cb5bd9 Mon Sep 17 00:00:00 2001 From: cipchk Date: Thu, 11 Jan 2024 17:11:41 +0800 Subject: [PATCH] feat(abc:notice-icon): support standalone --- .../error-collect/error-collect.component.ts | 2 +- packages/abc/media/index.en-US.md | 2 +- packages/abc/media/index.zh-CN.md | 2 +- packages/abc/notice-icon/demo/basic.md | 4 ++-- packages/abc/notice-icon/demo/popover.md | 4 ++-- packages/abc/notice-icon/index.en-US.md | 2 +- packages/abc/notice-icon/index.zh-CN.md | 2 +- .../notice-icon-tab.component.html | 2 +- .../notice-icon/notice-icon-tab.component.ts | 8 +++++++- .../abc/notice-icon/notice-icon.component.ts | 19 ++++++++++++++++++- .../abc/notice-icon/notice-icon.module.ts | 5 +++-- 11 files changed, 38 insertions(+), 14 deletions(-) diff --git a/packages/abc/error-collect/error-collect.component.ts b/packages/abc/error-collect/error-collect.component.ts index 649903bdc..fc24d4800 100644 --- a/packages/abc/error-collect/error-collect.component.ts +++ b/packages/abc/error-collect/error-collect.component.ts @@ -39,7 +39,7 @@ import { NzIconDirective } from 'ng-zorro-antd/icon'; changeDetection: ChangeDetectionStrategy.OnPush, encapsulation: ViewEncapsulation.None, standalone: true, - imports: [NzIconDirective] + imports: [NzIconDirective, NzIconDirective] }) export class ErrorCollectComponent implements OnInit { private formEl: HTMLFormElement | null = null; diff --git a/packages/abc/media/index.en-US.md b/packages/abc/media/index.en-US.md index b9f6a640f..4a2456fa9 100644 --- a/packages/abc/media/index.en-US.md +++ b/packages/abc/media/index.en-US.md @@ -39,7 +39,7 @@ const alainConfig: AlainConfig = { ## API -### media +### [media]:standalone | Property | Description | Type | Default | Global Config | |----------|-------------|------|---------|---------------| diff --git a/packages/abc/media/index.zh-CN.md b/packages/abc/media/index.zh-CN.md index cf89a938a..6f1158c56 100644 --- a/packages/abc/media/index.zh-CN.md +++ b/packages/abc/media/index.zh-CN.md @@ -39,7 +39,7 @@ const alainConfig: AlainConfig = { ## API -### media +### [media]:standalone | 成员 | 说明 | 类型 | 默认值 | 全局配置 | |----|----|----|-----|------| diff --git a/packages/abc/notice-icon/demo/basic.md b/packages/abc/notice-icon/demo/basic.md index db9e8976f..f7f6f9d08 100644 --- a/packages/abc/notice-icon/demo/basic.md +++ b/packages/abc/notice-icon/demo/basic.md @@ -8,13 +8,13 @@ title: 通知图标 ```ts import { Component } from '@angular/core'; -import { NoticeIconModule } from '@delon/abc/notice-icon'; +import { NoticeIconComponent } from '@delon/abc/notice-icon'; @Component({ selector: 'app-demo', template: ` `, standalone: true, - imports: [NoticeIconModule] + imports: [NoticeIconComponent] }) export class DemoComponent {} ``` diff --git a/packages/abc/notice-icon/demo/popover.md b/packages/abc/notice-icon/demo/popover.md index 200e1ed21..dd2f53e84 100644 --- a/packages/abc/notice-icon/demo/popover.md +++ b/packages/abc/notice-icon/demo/popover.md @@ -10,7 +10,7 @@ import { Component, TemplateRef, ViewChild, inject } from '@angular/core'; import { add, formatDistanceToNow, parse } from 'date-fns'; -import { NoticeIconList, NoticeIconModule, NoticeIconSelect, NoticeItem } from '@delon/abc/notice-icon'; +import { NoticeIconList, NoticeIconComponent, NoticeIconSelect, NoticeItem } from '@delon/abc/notice-icon'; import { NzI18nService } from 'ng-zorro-antd/i18n'; import { NzMessageService } from 'ng-zorro-antd/message'; @@ -36,7 +36,7 @@ import { NzMessageService } from 'ng-zorro-antd/message'; `, standalone: true, - imports: [NoticeIconModule] + imports: [NoticeIconComponent] }) export class DemoComponent { private readonly msg = inject(NzMessageService); diff --git a/packages/abc/notice-icon/index.en-US.md b/packages/abc/notice-icon/index.en-US.md index 576c59ddf..947f85572 100644 --- a/packages/abc/notice-icon/index.en-US.md +++ b/packages/abc/notice-icon/index.en-US.md @@ -10,7 +10,7 @@ Used on the navigation toolbar as a unified notification center for the entire p ## API -### notice-icon +### notice-icon:standalone | Property | Description | Type | Default | |----------|-------------|------|---------| diff --git a/packages/abc/notice-icon/index.zh-CN.md b/packages/abc/notice-icon/index.zh-CN.md index ceebf65a9..08000d42b 100644 --- a/packages/abc/notice-icon/index.zh-CN.md +++ b/packages/abc/notice-icon/index.zh-CN.md @@ -10,7 +10,7 @@ module: import { NoticeIconModule } from '@delon/abc/notice-icon'; ## API -### notice-icon +### notice-icon:standalone | 参数 | 说明 | 类型 | 默认值 | |----|----|----|-----| diff --git a/packages/abc/notice-icon/notice-icon-tab.component.html b/packages/abc/notice-icon/notice-icon-tab.component.html index 5e2bd1bc8..62c181647 100644 --- a/packages/abc/notice-icon/notice-icon-tab.component.html +++ b/packages/abc/notice-icon/notice-icon-tab.component.html @@ -15,7 +15,7 @@ - + diff --git a/packages/abc/notice-icon/notice-icon-tab.component.ts b/packages/abc/notice-icon/notice-icon-tab.component.ts index eccd550fb..5a6480dc0 100644 --- a/packages/abc/notice-icon/notice-icon-tab.component.ts +++ b/packages/abc/notice-icon/notice-icon-tab.component.ts @@ -1,6 +1,10 @@ +import { NgTemplateOutlet } from '@angular/common'; import { Component, EventEmitter, Input, Output, ViewEncapsulation } from '@angular/core'; import { LocaleData } from '@delon/theme'; +import { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet'; +import { NzListModule } from 'ng-zorro-antd/list'; +import { NzTagComponent } from 'ng-zorro-antd/tag'; import { NoticeIconSelect, NoticeItem } from './notice-icon.types'; @@ -9,7 +13,9 @@ import { NoticeIconSelect, NoticeItem } from './notice-icon.types'; exportAs: 'noticeIconTab', templateUrl: './notice-icon-tab.component.html', preserveWhitespaces: false, - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, + standalone: true, + imports: [NgTemplateOutlet, NzStringTemplateOutletDirective, NzListModule, NzTagComponent] }) export class NoticeIconTabComponent { @Input() locale: LocaleData = {}; diff --git a/packages/abc/notice-icon/notice-icon.component.ts b/packages/abc/notice-icon/notice-icon.component.ts index 8dfd2b23e..d5127e22a 100644 --- a/packages/abc/notice-icon/notice-icon.component.ts +++ b/packages/abc/notice-icon/notice-icon.component.ts @@ -1,3 +1,4 @@ +import { NgClass } from '@angular/common'; import { ChangeDetectionStrategy, ChangeDetectorRef, @@ -14,8 +15,14 @@ import { Subscription } from 'rxjs'; import { DelonLocaleService, LocaleData } from '@delon/theme'; import { BooleanInput, InputBoolean, InputNumber, NumberInput } from '@delon/util/decorator'; +import { NzBadgeComponent } from 'ng-zorro-antd/badge'; import type { NgClassType } from 'ng-zorro-antd/core/types'; +import { NzDropDownModule } from 'ng-zorro-antd/dropdown'; +import { NzIconDirective } from 'ng-zorro-antd/icon'; +import { NzSpinComponent } from 'ng-zorro-antd/spin'; +import { NzTabsModule } from 'ng-zorro-antd/tabs'; +import { NoticeIconTabComponent } from './notice-icon-tab.component'; import { NoticeIconSelect, NoticeItem } from './notice-icon.types'; @Component({ @@ -25,7 +32,17 @@ import { NoticeIconSelect, NoticeItem } from './notice-icon.types'; host: { '[class.notice-icon__btn]': 'true' }, preserveWhitespaces: false, changeDetection: ChangeDetectionStrategy.OnPush, - encapsulation: ViewEncapsulation.None + encapsulation: ViewEncapsulation.None, + standalone: true, + imports: [ + NgClass, + NzBadgeComponent, + NzIconDirective, + NzDropDownModule, + NzSpinComponent, + NzTabsModule, + NoticeIconTabComponent + ] }) export class NoticeIconComponent implements OnInit, OnChanges, OnDestroy { static ngAcceptInputType_count: NumberInput; diff --git a/packages/abc/notice-icon/notice-icon.module.ts b/packages/abc/notice-icon/notice-icon.module.ts index 298ff8e72..1422d8dfb 100644 --- a/packages/abc/notice-icon/notice-icon.module.ts +++ b/packages/abc/notice-icon/notice-icon.module.ts @@ -27,9 +27,10 @@ const COMPONENTS = [NoticeIconComponent]; NzSpinModule, NzTabsModule, NzTagModule, - NzOutletModule + NzOutletModule, + ...COMPONENTS, + NoticeIconTabComponent ], - declarations: [...COMPONENTS, NoticeIconTabComponent], exports: COMPONENTS }) export class NoticeIconModule {}