1.1.5 • Published 10 months ago

@rfprodz/client-guided-tour v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Guided Tour Module for Angular

This library was generated with Nx.

Description

Guided tour feature for Angular clients.

Usage

Within the development workspace

Import the module

...
import { AppGuidedTourModule } from '@app/client-guided-tour';

@NgModule({
  imports: [
    ...
    AppGuidedTourModule,
    ...
  ],
  ...
})
export class AppModule {}

As an external package

Install the package

yarn add @rfprodz/client-guided-tour @angular/cdk @angular/common @angular/core @angular/material @angular/router

Import the module

...
import { AppGuidedTourModule } from '@rfprodz/client-guided-tour';

@NgModule({
  imports: [
    ...
    AppGuidedTourModule,
    ...
  ],
  ...
})
export class AppModule {}

Use in components

...
<p>... Some content ...</p>

<div [appGuidedTour]="config.at(0)" [highlightElement]="false">first item to explain</div>

<p>... Some content ...</p>

<div [appGuidedTour]="config.at(1)" [highlightElement]="true">second item to explain</div>
...
@Component({
  ...
  providers: [AppGuidedTourService], // <-- declare a service
  ...
})
export class GuidedComponent implements AfterViewInit {
  /** Locate steps. */
  @ViewChildren(AppGuidedTourDirective) public steps!: QueryList<AppGuidedTourDirective>;

  /** Configure the tour. */
  public tourConig$ = signal<IGuidedTourData[]>([
    {
      index: 0,
      title: 'first',
      subtitle: 'First step',
      description: 'The first step. Highlighting disabled.',
      first: true,
      last: false,
    },
    {
      index: 1,
      title: 'second',
      subtitle: 'Second step',
      description: 'The second step. Highlighting enabled.',
      first: false,
      last: true,
    },
  ]);

  constructor(public readonly tour: AppGuidedTourService) {}

  public ngAfterViewInit(): void {
    this.tour.configuration = this.steps; // <-- add steps to the service
  }
}

Full example

Developer commands reference

npx nx run tools:help --search client-guided-tour:

References

1.1.5

10 months ago

1.1.1

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.13

1 year ago

1.0.12

1 year ago

1.0.11

1 year ago

1.0.10

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago