@energycap/components 0.43.11 → 0.44.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/energycap-components.min.css +1 -1
- package/esm2022/lib/components.module.mjs +1 -6
- package/esm2022/lib/display/tooltip/tooltip.component.mjs +1 -1
- package/esm2022/public-api.mjs +1 -4
- package/fesm2022/energycap-components.mjs +1 -494
- package/fesm2022/energycap-components.mjs.map +1 -1
- package/lib/components.module.d.ts +15 -16
- package/lib/display/tooltip/tooltip.component.d.ts +1 -1
- package/package.json +1 -1
- package/public-api.d.ts +0 -3
- package/src/styles/_global-variables.scss +0 -3
- package/esm2022/lib/display/tour/tour-types.mjs +0 -34
- package/esm2022/lib/display/tour/tour.component.mjs +0 -398
- package/esm2022/lib/display/tour/tour.service.mjs +0 -75
- package/lib/display/tour/tour-types.d.ts +0 -70
- package/lib/display/tour/tour.component.d.ts +0 -147
- package/lib/display/tour/tour.service.d.ts +0 -38
@@ -1,75 +0,0 @@
|
|
1
|
-
import { Injectable } from '@angular/core';
|
2
|
-
import { Subject } from 'rxjs';
|
3
|
-
import { TourEvent } from './tour-types';
|
4
|
-
import * as i0 from "@angular/core";
|
5
|
-
import * as i1 from "../../core/cache.service";
|
6
|
-
export class TourService {
|
7
|
-
constructor(cacheService) {
|
8
|
-
this.cacheService = cacheService;
|
9
|
-
this.events = new Subject();
|
10
|
-
}
|
11
|
-
/**
|
12
|
-
* Start a tour of the application. Allows one or many tours to be sent in, each will
|
13
|
-
* follow the next. If multiple tours have exit steps defined only the final tour will
|
14
|
-
* execute the exit step.
|
15
|
-
* @param tours
|
16
|
-
*/
|
17
|
-
start(tours, isAutoStart = false) {
|
18
|
-
let tourEvent = new TourEvent(tours, 'start', isAutoStart);
|
19
|
-
this.events.next(tourEvent);
|
20
|
-
}
|
21
|
-
end() {
|
22
|
-
let tourEvent = new TourEvent([], 'end');
|
23
|
-
this.events.next(tourEvent);
|
24
|
-
}
|
25
|
-
append(tours, isAutoStart = false) {
|
26
|
-
let tourEvent = new TourEvent(tours, 'append', isAutoStart);
|
27
|
-
this.events.next(tourEvent);
|
28
|
-
}
|
29
|
-
/**
|
30
|
-
* Returns a formatted cache key for tours
|
31
|
-
* @param tour
|
32
|
-
* @returns
|
33
|
-
*/
|
34
|
-
getCacheKey(tour) {
|
35
|
-
return `TourCompleted_${tour.id}`;
|
36
|
-
}
|
37
|
-
/**
|
38
|
-
* Given a tour, check to see if it's been completed
|
39
|
-
* @param tour
|
40
|
-
* @returns
|
41
|
-
*/
|
42
|
-
hasTourBeenViewed(tour) {
|
43
|
-
let cacheValue = this.cacheService.getItem(this.getCacheKey(tour));
|
44
|
-
if (cacheValue) {
|
45
|
-
return cacheValue.completed;
|
46
|
-
}
|
47
|
-
else {
|
48
|
-
// If no cache value then we never ran through it and wrote a key
|
49
|
-
return false;
|
50
|
-
}
|
51
|
-
}
|
52
|
-
/**
|
53
|
-
* Given a list of tours, check to see if any will show to the user
|
54
|
-
* @param tours
|
55
|
-
* @returns
|
56
|
-
*/
|
57
|
-
haveAllToursBeenViewed(tours) {
|
58
|
-
let viewedCount = 0;
|
59
|
-
tours.forEach(tour => {
|
60
|
-
if (this.hasTourBeenViewed(tour)) {
|
61
|
-
viewedCount++;
|
62
|
-
}
|
63
|
-
});
|
64
|
-
return viewedCount === tours.length;
|
65
|
-
}
|
66
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TourService, deps: [{ token: i1.CacheService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
67
|
-
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TourService, providedIn: 'root' }); }
|
68
|
-
}
|
69
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.13", ngImport: i0, type: TourService, decorators: [{
|
70
|
-
type: Injectable,
|
71
|
-
args: [{
|
72
|
-
providedIn: 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1cclxufVxyXG4iXX0=
|
@@ -1,70 +0,0 @@
|
|
1
|
-
import { TemplateRef, Type } from "@angular/core";
|
2
|
-
import { DialogContent } from "../dialog/dialog-content";
|
3
|
-
import { DialogOptions, DialogSize } from "../dialog/dialog-types";
|
4
|
-
import { TooltipPosition } from "../tooltip/tooltip.component";
|
5
|
-
export type TourCacheEntry = {
|
6
|
-
completed: boolean;
|
7
|
-
};
|
8
|
-
export declare class Tour<T = any> {
|
9
|
-
/** Unique identifier for the tour */
|
10
|
-
id: string;
|
11
|
-
/** List of tour steps to present to the user */
|
12
|
-
steps: TourStep[];
|
13
|
-
/** Final step to be presented to the user if defined */
|
14
|
-
exitStep?: TourStep;
|
15
|
-
/** Dialog to present to the user before the tour begins */
|
16
|
-
introDialog?: TourIntroDialog<T>;
|
17
|
-
}
|
18
|
-
export interface TourIntroDialog<T> {
|
19
|
-
content?: Type<DialogContent<T>> | TemplateRef<any>;
|
20
|
-
context?: T;
|
21
|
-
options?: DialogOptions;
|
22
|
-
size?: DialogSize;
|
23
|
-
}
|
24
|
-
export declare class TourStep {
|
25
|
-
/** Unique identifier for the tour step */
|
26
|
-
id: string;
|
27
|
-
/** Optional tour step title displayed at top of tooltip */
|
28
|
-
title?: string;
|
29
|
-
/** Optional media to display below title and above tour text. Can be a jpg, png, or gif */
|
30
|
-
media?: string;
|
31
|
-
/** HTML formatted text that contains the primary content of the tour step */
|
32
|
-
text: string;
|
33
|
-
/** The element to attach the tour step to. If undefined, step will appear centered on screen */
|
34
|
-
anchor?: TourAnchor;
|
35
|
-
helpLink?: string;
|
36
|
-
/** Allows the step to have a fixed width defined for the tooltip. If not defined the width will be defaulted to 400. If you would like
|
37
|
-
* auto width define as 'auto'.
|
38
|
-
*/
|
39
|
-
width?: number | 'auto';
|
40
|
-
/** Allows the step to have a max width defined for the tooltip */
|
41
|
-
maxWidth?: number;
|
42
|
-
}
|
43
|
-
export declare class TourAnchor {
|
44
|
-
/**
|
45
|
-
* Optional css selector of an element to click in order to open a menu or
|
46
|
-
* overlay. Should not cause a navigation. If defined but does not exist in
|
47
|
-
* the DOM, skip this step because it is probably hidden to the user because of permissions
|
48
|
-
*/
|
49
|
-
clickBefore?: string;
|
50
|
-
/**
|
51
|
-
* CSS selector of element to click in order to close a menu or overlay
|
52
|
-
* before continuing to the next step. Ignored if clickBefore is undefined.
|
53
|
-
* Should not cause a navigation
|
54
|
-
*/
|
55
|
-
clickAfter?: string;
|
56
|
-
/**
|
57
|
-
* Selector to attach the tooltip to. If defined but does not exist in the
|
58
|
-
* DOM skip this step because it is probably hidden to the user because of
|
59
|
-
* permissions.
|
60
|
-
*/
|
61
|
-
selector: string;
|
62
|
-
/** Position of the tooltip relative to the anchor. https://energycap-components.netlify.app/tooltip#position */
|
63
|
-
position?: TooltipPosition;
|
64
|
-
}
|
65
|
-
export declare class TourEvent {
|
66
|
-
tours: Tour[];
|
67
|
-
tourAction: 'start' | 'end' | 'append';
|
68
|
-
isAutoStart: boolean;
|
69
|
-
constructor(tours: Tour[], tourAction?: 'start' | 'end' | 'append', isAutoStart?: boolean);
|
70
|
-
}
|
@@ -1,147 +0,0 @@
|
|
1
|
-
import { OnInit, TemplateRef } from '@angular/core';
|
2
|
-
import { TranslateService } from '@ngx-translate/core';
|
3
|
-
import { CacheService } from '../../core/cache.service';
|
4
|
-
import { TelemetryService } from '../../core/telemetry.service';
|
5
|
-
import { DialogService } from '../dialog/dialog.service';
|
6
|
-
import { TooltipComponent } from './../tooltip/tooltip.component';
|
7
|
-
import { TooltipService } from './../tooltip/tooltip.service';
|
8
|
-
import { TourStep } from './tour-types';
|
9
|
-
import { TourService } from './tour.service';
|
10
|
-
import * as i0 from "@angular/core";
|
11
|
-
export declare class TourComponent implements OnInit {
|
12
|
-
private tourService;
|
13
|
-
private tooltipService;
|
14
|
-
private telemetryService;
|
15
|
-
private cacheService;
|
16
|
-
private dialogService;
|
17
|
-
private translateService;
|
18
|
-
private document;
|
19
|
-
/** Current tour step being shown to the user. The custom content in the template is bound to properties on this and therefor needs to be
|
20
|
-
* its own property. The exitStep is a tour step and this will hold that step at the end of the tour.
|
21
|
-
*/
|
22
|
-
currentTourStep?: TourStep;
|
23
|
-
/** Used to tell the UI that the step being shown is an exit step. This will change the
|
24
|
-
* link text and the action when clicked
|
25
|
-
*/
|
26
|
-
showDoneButton: boolean;
|
27
|
-
/** Reference to the tooltip used for the tour steps */
|
28
|
-
tooltip?: TooltipComponent;
|
29
|
-
/** Array of tours provided when the start tour event was detected */
|
30
|
-
private tours;
|
31
|
-
private currentStepIndex;
|
32
|
-
private currentTourIndex;
|
33
|
-
/** Used to know if the restore step should be triggered when the tour is dismissed */
|
34
|
-
private isAutoStart;
|
35
|
-
private destroyed;
|
36
|
-
custom: TemplateRef<any>;
|
37
|
-
constructor(tourService: TourService, tooltipService: TooltipService, telemetryService: TelemetryService, cacheService: CacheService, dialogService: DialogService, translateService: TranslateService, document: Document);
|
38
|
-
ngOnInit(): void;
|
39
|
-
ngOnDestroy(): void;
|
40
|
-
/**
|
41
|
-
* Called when a restore step has been completed
|
42
|
-
*/
|
43
|
-
done(): Promise<void>;
|
44
|
-
/**
|
45
|
-
* Called when a tour begins and when the user clicks next on the current tour step. It will handle any after click actions and then
|
46
|
-
* find the next step and present it to the user and transition to a restore step or new tour if needed.
|
47
|
-
*/
|
48
|
-
showNextStep(): Promise<void>;
|
49
|
-
private setupTourComponent;
|
50
|
-
/**
|
51
|
-
* Shows a tour and emits an event that it was started
|
52
|
-
* @param tour
|
53
|
-
*/
|
54
|
-
private showNextTour;
|
55
|
-
private endTour;
|
56
|
-
/**
|
57
|
-
* Displays a tooltip for the current tour step
|
58
|
-
*/
|
59
|
-
private showStepTooltip;
|
60
|
-
/**
|
61
|
-
* Subscribes to the tooltips onHide event emitter and reacts if the user dismisses the tooltip
|
62
|
-
*/
|
63
|
-
private subscribeToTooltipOnHide;
|
64
|
-
/**
|
65
|
-
* Loops through the current tour steps starting after the current step index. It will try to find a visible
|
66
|
-
* selector and if so return the index.
|
67
|
-
* @returns
|
68
|
-
*/
|
69
|
-
private getNextAvailableStepIndex;
|
70
|
-
/**
|
71
|
-
* Try to find the tour step element to know if it is visible for the user. Check for the clickBefore first if defined
|
72
|
-
* @param anchor
|
73
|
-
* @returns
|
74
|
-
*/
|
75
|
-
private stepElementFound;
|
76
|
-
/**
|
77
|
-
* Some tour steps may have a click after defined. If so call the click method on the html element
|
78
|
-
*/
|
79
|
-
private handleClickAfter;
|
80
|
-
/**
|
81
|
-
* Some tour steps may have a click before defined. If so call the click method on the html element
|
82
|
-
*/
|
83
|
-
private handleClickBefore;
|
84
|
-
/**
|
85
|
-
* Checks for an exit step on the current tour and if found displays the step
|
86
|
-
*/
|
87
|
-
private handleExitStep;
|
88
|
-
/**
|
89
|
-
* Try to find the element with the selector provided and if so click it. This is how tour steps will open/close menus to
|
90
|
-
* give a tour to the user
|
91
|
-
* @param selector
|
92
|
-
*/
|
93
|
-
private clickElementIfFound;
|
94
|
-
/**
|
95
|
-
* When auto starting tours we will want to remove any that have the local storage key written as completed so
|
96
|
-
* they are not presented to the user again.
|
97
|
-
* @param tours
|
98
|
-
* @returns
|
99
|
-
*/
|
100
|
-
private removeCompletedTours;
|
101
|
-
/**
|
102
|
-
* Writes a key to local storage so the tour will not be shown again automatically
|
103
|
-
*/
|
104
|
-
private writeCompletionKey;
|
105
|
-
/**
|
106
|
-
* When dismissing a tour or one being dismissed via a navigation event, etc we will want to mark
|
107
|
-
* every tour in the array as completed so it doesn't resurface unless the user requests the tour.
|
108
|
-
* This function will loop over all and write the local storage key
|
109
|
-
*/
|
110
|
-
private writeCompletionKeyForAllTours;
|
111
|
-
/**
|
112
|
-
* Cache key used to set/get the completion status of a tour
|
113
|
-
* @param tour
|
114
|
-
* @returns
|
115
|
-
*/
|
116
|
-
private makeCacheKey;
|
117
|
-
/**
|
118
|
-
* Removes a tooltip from the view, used when switching tour steps and closing a tour
|
119
|
-
*/
|
120
|
-
private removeTooltip;
|
121
|
-
/**
|
122
|
-
* Returns the tour based on the current index
|
123
|
-
*/
|
124
|
-
private get currentTour();
|
125
|
-
/**
|
126
|
-
* The click before/after and show tooltip functions need to be wrapped in setTimeout for the UI
|
127
|
-
* to operate correctly but setTimeout is an action we cannot await so we're wrapping it in a promise to return
|
128
|
-
* so the function calls can await the action
|
129
|
-
* @param fn
|
130
|
-
* @returns
|
131
|
-
*/
|
132
|
-
private waitForTimeout;
|
133
|
-
/**
|
134
|
-
* Find the "next" or "done" button and focus on it.
|
135
|
-
*
|
136
|
-
* They are mutually exclusive, so if we cannot find the next button
|
137
|
-
* we look for the done button.
|
138
|
-
*/
|
139
|
-
private focusOnNextOrDoneButton;
|
140
|
-
/**
|
141
|
-
* Find an element with given selector and focus on it.
|
142
|
-
* Return false if element not found.
|
143
|
-
*/
|
144
|
-
private focusOnElement;
|
145
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TourComponent, never>;
|
146
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<TourComponent, "ec-tour", never, {}, {}, never, never, false, never>;
|
147
|
-
}
|
@@ -1,38 +0,0 @@
|
|
1
|
-
import { Observable } from 'rxjs';
|
2
|
-
import { CacheService } from '../../core/cache.service';
|
3
|
-
import { Tour, TourEvent } from './tour-types';
|
4
|
-
import * as i0 from "@angular/core";
|
5
|
-
export declare class TourService {
|
6
|
-
private cacheService;
|
7
|
-
events: Observable<TourEvent>;
|
8
|
-
constructor(cacheService: CacheService);
|
9
|
-
/**
|
10
|
-
* Start a tour of the application. Allows one or many tours to be sent in, each will
|
11
|
-
* follow the next. If multiple tours have exit steps defined only the final tour will
|
12
|
-
* execute the exit step.
|
13
|
-
* @param tours
|
14
|
-
*/
|
15
|
-
start(tours: Tour[], isAutoStart?: boolean): void;
|
16
|
-
end(): void;
|
17
|
-
append(tours: Tour[], isAutoStart?: boolean): void;
|
18
|
-
/**
|
19
|
-
* Returns a formatted cache key for tours
|
20
|
-
* @param tour
|
21
|
-
* @returns
|
22
|
-
*/
|
23
|
-
getCacheKey(tour: Tour): string;
|
24
|
-
/**
|
25
|
-
* Given a tour, check to see if it's been completed
|
26
|
-
* @param tour
|
27
|
-
* @returns
|
28
|
-
*/
|
29
|
-
hasTourBeenViewed(tour: Tour): boolean;
|
30
|
-
/**
|
31
|
-
* Given a list of tours, check to see if any will show to the user
|
32
|
-
* @param tours
|
33
|
-
* @returns
|
34
|
-
*/
|
35
|
-
haveAllToursBeenViewed(tours: Tour[]): boolean;
|
36
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TourService, never>;
|
37
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<TourService>;
|
38
|
-
}
|