Skip to content

Commit

Permalink
feat(abc:onboarding): support standalone
Browse files Browse the repository at this point in the history
  • Loading branch information
cipchk committed Jan 11, 2024
1 parent 5ac646c commit 90a1392
Show file tree
Hide file tree
Showing 7 changed files with 21 additions and 12 deletions.
2 changes: 1 addition & 1 deletion packages/abc/observers/index.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ The `ObserversModule` package provides convenience directives built on top of na

## API

### [observeSize]
### [observeSize]:standalone

Watch the DOM size change.

Expand Down
2 changes: 1 addition & 1 deletion packages/abc/observers/index.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ module: import { ObserversModule } from '@delon/abc/observers';

## API

### [observeSize]
### [observeSize]:standalone

观察DOM大小变化。

Expand Down
4 changes: 2 additions & 2 deletions packages/abc/onboarding/demo/basic.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Simplest of usage.
```ts
import { Component, inject } from '@angular/core';

import { OnboardingConfig, OnboardingModule, OnboardingService } from '@delon/abc/onboarding';
import { OnboardingConfig, OnboardingService } from '@delon/abc/onboarding';
import { _HttpClient } from '@delon/theme';
import { NzButtonModule } from 'ng-zorro-antd/button';
import { NzMessageService } from 'ng-zorro-antd/message';
Expand All @@ -41,7 +41,7 @@ import { NzMessageService } from 'ng-zorro-antd/message';
</a>
`,
standalone: true,
imports: [NzButtonModule, OnboardingModule]
imports: [NzButtonModule]
})
export class DemoComponent {
private readonly msg = inject(NzMessageService);
Expand Down
4 changes: 2 additions & 2 deletions packages/abc/onboarding/demo/multiple-pages.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Use `url` to change the routing, it's recommended to use `before` to delay, othe
```ts
import { Component, inject } from '@angular/core';

import { OnboardingModule, OnboardingService } from '@delon/abc/onboarding';
import { OnboardingService } from '@delon/abc/onboarding';
import { _HttpClient } from '@delon/theme';
import { NzButtonModule } from 'ng-zorro-antd/button';

Expand All @@ -30,7 +30,7 @@ import { NzButtonModule } from 'ng-zorro-antd/button';
<button nz-button (click)="start()">Start</button>
`,
standalone: true,
imports: [NzButtonModule, OnboardingModule]
imports: [NzButtonModule]
})
export class DemoComponent {
private readonly srv = inject(OnboardingService);
Expand Down
6 changes: 5 additions & 1 deletion packages/abc/onboarding/onboarding.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ import {
ViewEncapsulation
} from '@angular/core';

import { NzButtonComponent } from 'ng-zorro-antd/button';
import { NzStringTemplateOutletDirective } from 'ng-zorro-antd/core/outlet';
import type { NzSafeAny } from 'ng-zorro-antd/core/types';
import { NzPopoverDirective } from 'ng-zorro-antd/popover';

Expand All @@ -40,7 +42,9 @@ interface OnboardingLightData {
},
preserveWhitespaces: false,
changeDetection: ChangeDetectionStrategy.OnPush,
encapsulation: ViewEncapsulation.None
encapsulation: ViewEncapsulation.None,
standalone: true,
imports: [NzPopoverDirective, NzStringTemplateOutletDirective, NzButtonComponent]
})
export class OnboardingComponent implements OnDestroy, AfterViewInit {
private time: NzSafeAny;
Expand Down
13 changes: 9 additions & 4 deletions packages/abc/onboarding/onboarding.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,19 @@ import { NzOutletModule } from 'ng-zorro-antd/core/outlet';
import { NzPopoverModule } from 'ng-zorro-antd/popover';

import { OnboardingComponent } from './onboarding.component';
import { OnboardingService } from './onboarding.service';

const COMPONENTS = [OnboardingComponent];

@NgModule({
imports: [CommonModule, DelonLocaleModule, NzPopoverModule, NzOutletModule, NzButtonModule, NzNoAnimationModule],
declarations: COMPONENTS,
providers: [OnboardingService],
imports: [
CommonModule,
DelonLocaleModule,
NzPopoverModule,
NzOutletModule,
NzButtonModule,
NzNoAnimationModule,
COMPONENTS
],
exports: COMPONENTS
})
export class OnboardingModule {}
2 changes: 1 addition & 1 deletion packages/abc/onboarding/onboarding.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import { OnboardingComponent } from './onboarding.component';
import { ONBOARDING_STORE_TOKEN, OnBoardingKeyStore } from './onboarding.storage';
import { OnboardingConfig, OnboardingItem, OnboardingOpType } from './onboarding.types';

@Injectable()
@Injectable({ providedIn: 'root' })
export class OnboardingService implements OnDestroy {
private compRef!: ComponentRef<OnboardingComponent>;
private op$!: Subscription;
Expand Down

0 comments on commit 90a1392

Please sign in to comment.