diff --git a/CHANGELOG.md b/CHANGELOG.md index a20bc67..cc52116 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,12 @@ +# [10.0.0](https://github.com/cipchk/ngx-weui/compare/9.0.0...10.0.0) (2020-07-09) + + +### Features + +* **module:picker:** add `className` property of options ([#164](https://github.com/cipchk/ngx-weui/issues/164)) ([e4e6f0e](https://github.com/cipchk/ngx-weui/commit/e4e6f0e5490944b3a22d6fe8db6019ba22b74e0b)) + + + # [10.0.0-rc.1](https://github.com/cipchk/ngx-weui/compare/9.0.0...10.0.0-rc.1) (2020-07-08) diff --git a/components/actionsheet/actionsheet.service.ts b/components/actionsheet/actionsheet.service.ts index 0fbdd3d..571b2f8 100644 --- a/components/actionsheet/actionsheet.service.ts +++ b/components/actionsheet/actionsheet.service.ts @@ -1,4 +1,5 @@ -import { Injectable } from '@angular/core'; +import { DOCUMENT } from '@angular/common'; +import { ApplicationRef, ComponentFactoryResolver, Inject, Injectable, Injector } from '@angular/core'; import { BaseService } from 'ngx-weui/core'; import { Observable } from 'rxjs'; import { ActionSheetComponent } from './actionsheet.component'; @@ -7,6 +8,15 @@ import { ActionSheetMenuItem } from './actionsheet.types'; @Injectable({ providedIn: 'root' }) export class ActionSheetService extends BaseService { + constructor( + protected readonly resolver: ComponentFactoryResolver, + protected readonly applicationRef: ApplicationRef, + protected readonly injector: Injector, + @Inject(DOCUMENT) protected readonly doc: any, + ) { + super(); + } + /** * 创建一个弹出式菜单并显示 * diff --git a/components/core/utils/base.service.ts b/components/core/utils/base.service.ts index 89e74ee..5615e03 100644 --- a/components/core/utils/base.service.ts +++ b/components/core/utils/base.service.ts @@ -1,15 +1,12 @@ -import { DOCUMENT } from '@angular/common'; -import { ApplicationRef, ComponentFactoryResolver, ComponentRef, EmbeddedViewRef, Inject, Injectable, Injector } from '@angular/core'; +import { ApplicationRef, ComponentFactoryResolver, ComponentRef, EmbeddedViewRef, Injectable, Injector } from '@angular/core'; @Injectable() export abstract class BaseService { protected list: Array> = []; - constructor( - private resolver: ComponentFactoryResolver, - private applicationRef: ApplicationRef, - private injector: Injector, - @Inject(DOCUMENT) private doc: any, - ) {} + protected abstract readonly resolver: ComponentFactoryResolver; + protected abstract readonly applicationRef: ApplicationRef; + protected abstract readonly injector: Injector; + protected abstract readonly doc: Document; /** * 销毁 diff --git a/components/dialog/dialog.service.ts b/components/dialog/dialog.service.ts index 6e69f13..367b475 100644 --- a/components/dialog/dialog.service.ts +++ b/components/dialog/dialog.service.ts @@ -1,4 +1,5 @@ -import { Injectable } from '@angular/core'; +import { DOCUMENT } from '@angular/common'; +import { ApplicationRef, ComponentFactoryResolver, Inject, Injectable, Injector } from '@angular/core'; import { BaseService } from 'ngx-weui/core'; import { Observable } from 'rxjs'; import { DialogComponent } from './dialog.component'; @@ -6,6 +7,15 @@ import { DialogConfig } from './dialog.config'; @Injectable({ providedIn: 'root' }) export class DialogService extends BaseService { + constructor( + protected readonly resolver: ComponentFactoryResolver, + protected readonly applicationRef: ApplicationRef, + protected readonly injector: Injector, + @Inject(DOCUMENT) protected readonly doc: any, + ) { + super(); + } + /** * 创建一个对话框并显示 * diff --git a/components/picker/picker.service.ts b/components/picker/picker.service.ts index dff9f5d..8c194aa 100644 --- a/components/picker/picker.service.ts +++ b/components/picker/picker.service.ts @@ -1,4 +1,5 @@ -import { ComponentRef, Injectable } from '@angular/core'; +import { DOCUMENT } from '@angular/common'; +import { ApplicationRef, ComponentFactoryResolver, ComponentRef, Inject, Injectable, Injector } from '@angular/core'; import { BaseService, NwSafeAny } from 'ngx-weui/core'; import { Observable } from 'rxjs'; import { PickerBaseComponent } from './picker-base.component'; @@ -25,6 +26,15 @@ import { */ @Injectable({ providedIn: 'root' }) export class PickerService extends BaseService { + constructor( + protected readonly resolver: ComponentFactoryResolver, + protected readonly applicationRef: ApplicationRef, + protected readonly injector: Injector, + @Inject(DOCUMENT) protected readonly doc: any, + ) { + super(); + } + private attachBase(ref: ComponentRef, config: PickerBaseConfig): void { const instance = ref.instance; const { options, title, placeholder, disabled, value } = config; diff --git a/components/toast/toast.service.ts b/components/toast/toast.service.ts index 9a6b4f7..5c06a3b 100644 --- a/components/toast/toast.service.ts +++ b/components/toast/toast.service.ts @@ -1,9 +1,19 @@ -import { Injectable } from '@angular/core'; +import { DOCUMENT } from '@angular/common'; +import { ApplicationRef, ComponentFactoryResolver, Inject, Injectable, Injector } from '@angular/core'; import { BaseService } from 'ngx-weui/core'; import { ToastComponent } from './toast.component'; @Injectable({ providedIn: 'root' }) export class ToastService extends BaseService { + constructor( + protected readonly resolver: ComponentFactoryResolver, + protected readonly applicationRef: ApplicationRef, + protected readonly injector: Injector, + @Inject(DOCUMENT) protected readonly doc: any, + ) { + super(); + } + /** * 构建toast并显示 * diff --git a/components/toptips/toptips.service.ts b/components/toptips/toptips.service.ts index e79ae0b..51ca51b 100644 --- a/components/toptips/toptips.service.ts +++ b/components/toptips/toptips.service.ts @@ -1,9 +1,19 @@ -import { Injectable } from '@angular/core'; +import { DOCUMENT } from '@angular/common'; +import { ApplicationRef, ComponentFactoryResolver, Inject, Injectable, Injector } from '@angular/core'; import { BaseService } from 'ngx-weui/core'; import { ToptipsComponent, ToptipsType } from './toptips.component'; @Injectable({ providedIn: 'root' }) export class ToptipsService extends BaseService { + constructor( + protected readonly resolver: ComponentFactoryResolver, + protected readonly applicationRef: ApplicationRef, + protected readonly injector: Injector, + @Inject(DOCUMENT) protected readonly doc: any, + ) { + super(); + } + /** * 构建一个Toptips并显示 * diff --git a/package.json b/package.json index 36582b2..3dea077 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ngx-weui", - "version": "10.0.0-rc.1", + "version": "10.0.0", "description": "WeUI for angular", "repository": { "type": "git",