@covalent/guided-tour 4.0.0 → 4.1.0-develop.10

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.
Files changed (33) hide show
  1. package/README.md +32 -15
  2. package/_guided-tour-theme.scss +6 -6
  3. package/covalent-guided-tour.d.ts +2 -1
  4. package/esm2020/covalent-guided-tour.mjs +5 -0
  5. package/esm2020/lib/guided-tour.module.mjs +19 -0
  6. package/esm2020/lib/guided-tour.service.mjs +163 -0
  7. package/esm2020/lib/guided.tour.mjs +438 -0
  8. package/esm2020/public_api.mjs +4 -0
  9. package/fesm2015/{covalent-guided-tour.js → covalent-guided-tour.mjs} +180 -615
  10. package/fesm2015/covalent-guided-tour.mjs.map +1 -0
  11. package/fesm2020/covalent-guided-tour.mjs +619 -0
  12. package/fesm2020/covalent-guided-tour.mjs.map +1 -0
  13. package/lib/guided-tour.module.d.ts +7 -0
  14. package/{guided-tour.service.d.ts → lib/guided-tour.service.d.ts} +4 -1
  15. package/{guided.tour.d.ts → lib/guided.tour.d.ts} +3 -7
  16. package/package.json +26 -14
  17. package/public_api.d.ts +3 -0
  18. package/{_guided-tour.scss → styles/guided-tour.scss} +17 -2
  19. package/bundles/covalent-guided-tour.umd.js +0 -1369
  20. package/bundles/covalent-guided-tour.umd.js.map +0 -1
  21. package/bundles/covalent-guided-tour.umd.min.js +0 -16
  22. package/bundles/covalent-guided-tour.umd.min.js.map +0 -1
  23. package/covalent-guided-tour.metadata.json +0 -1
  24. package/esm2015/covalent-guided-tour.js +0 -10
  25. package/esm2015/guided-tour.module.js +0 -19
  26. package/esm2015/guided-tour.service.js +0 -312
  27. package/esm2015/guided.tour.js +0 -722
  28. package/esm2015/index.js +0 -7
  29. package/esm2015/public-api.js +0 -9
  30. package/fesm2015/covalent-guided-tour.js.map +0 -1
  31. package/guided-tour.module.d.ts +0 -2
  32. package/index.d.ts +0 -1
  33. package/public-api.d.ts +0 -3
@@ -1,1369 +0,0 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('@angular/core'), require('@angular/common'), require('@angular/common/http'), require('@angular/router'), require('rxjs/operators'), require('rxjs'), require('shepherd.js')) :
3
- typeof define === 'function' && define.amd ? define('@covalent/guided-tour', ['exports', '@angular/core', '@angular/common', '@angular/common/http', '@angular/router', 'rxjs/operators', 'rxjs', 'shepherd.js'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.covalent = global.covalent || {}, global.covalent['guided-tour'] = {}), global.ng.core, global.ng.common, global.ng.common.http, global.ng.router, global.rxjs.operators, global.rxjs, global.Shepherd));
5
- }(this, (function (exports, core, common, http, router, operators, rxjs, Shepherd) { 'use strict';
6
-
7
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
8
-
9
- var Shepherd__default = /*#__PURE__*/_interopDefaultLegacy(Shepherd);
10
-
11
- /*! *****************************************************************************
12
- Copyright (c) Microsoft Corporation.
13
-
14
- Permission to use, copy, modify, and/or distribute this software for any
15
- purpose with or without fee is hereby granted.
16
-
17
- THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
18
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
19
- AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
20
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
21
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
22
- OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
23
- PERFORMANCE OF THIS SOFTWARE.
24
- ***************************************************************************** */
25
- /* global Reflect, Promise */
26
- var extendStatics = function (d, b) {
27
- extendStatics = Object.setPrototypeOf ||
28
- ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
29
- function (d, b) { for (var p in b)
30
- if (Object.prototype.hasOwnProperty.call(b, p))
31
- d[p] = b[p]; };
32
- return extendStatics(d, b);
33
- };
34
- function __extends(d, b) {
35
- extendStatics(d, b);
36
- function __() { this.constructor = d; }
37
- d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
38
- }
39
- var __assign = function () {
40
- __assign = Object.assign || function __assign(t) {
41
- for (var s, i = 1, n = arguments.length; i < n; i++) {
42
- s = arguments[i];
43
- for (var p in s)
44
- if (Object.prototype.hasOwnProperty.call(s, p))
45
- t[p] = s[p];
46
- }
47
- return t;
48
- };
49
- return __assign.apply(this, arguments);
50
- };
51
- function __rest(s, e) {
52
- var t = {};
53
- for (var p in s)
54
- if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
55
- t[p] = s[p];
56
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
57
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
58
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
59
- t[p[i]] = s[p[i]];
60
- }
61
- return t;
62
- }
63
- function __decorate(decorators, target, key, desc) {
64
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
65
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function")
66
- r = Reflect.decorate(decorators, target, key, desc);
67
- else
68
- for (var i = decorators.length - 1; i >= 0; i--)
69
- if (d = decorators[i])
70
- r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
71
- return c > 3 && r && Object.defineProperty(target, key, r), r;
72
- }
73
- function __param(paramIndex, decorator) {
74
- return function (target, key) { decorator(target, key, paramIndex); };
75
- }
76
- function __metadata(metadataKey, metadataValue) {
77
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function")
78
- return Reflect.metadata(metadataKey, metadataValue);
79
- }
80
- function __awaiter(thisArg, _arguments, P, generator) {
81
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
82
- return new (P || (P = Promise))(function (resolve, reject) {
83
- function fulfilled(value) { try {
84
- step(generator.next(value));
85
- }
86
- catch (e) {
87
- reject(e);
88
- } }
89
- function rejected(value) { try {
90
- step(generator["throw"](value));
91
- }
92
- catch (e) {
93
- reject(e);
94
- } }
95
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
96
- step((generator = generator.apply(thisArg, _arguments || [])).next());
97
- });
98
- }
99
- function __generator(thisArg, body) {
100
- var _ = { label: 0, sent: function () { if (t[0] & 1)
101
- throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
102
- return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function () { return this; }), g;
103
- function verb(n) { return function (v) { return step([n, v]); }; }
104
- function step(op) {
105
- if (f)
106
- throw new TypeError("Generator is already executing.");
107
- while (_)
108
- try {
109
- if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done)
110
- return t;
111
- if (y = 0, t)
112
- op = [op[0] & 2, t.value];
113
- switch (op[0]) {
114
- case 0:
115
- case 1:
116
- t = op;
117
- break;
118
- case 4:
119
- _.label++;
120
- return { value: op[1], done: false };
121
- case 5:
122
- _.label++;
123
- y = op[1];
124
- op = [0];
125
- continue;
126
- case 7:
127
- op = _.ops.pop();
128
- _.trys.pop();
129
- continue;
130
- default:
131
- if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {
132
- _ = 0;
133
- continue;
134
- }
135
- if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) {
136
- _.label = op[1];
137
- break;
138
- }
139
- if (op[0] === 6 && _.label < t[1]) {
140
- _.label = t[1];
141
- t = op;
142
- break;
143
- }
144
- if (t && _.label < t[2]) {
145
- _.label = t[2];
146
- _.ops.push(op);
147
- break;
148
- }
149
- if (t[2])
150
- _.ops.pop();
151
- _.trys.pop();
152
- continue;
153
- }
154
- op = body.call(thisArg, _);
155
- }
156
- catch (e) {
157
- op = [6, e];
158
- y = 0;
159
- }
160
- finally {
161
- f = t = 0;
162
- }
163
- if (op[0] & 5)
164
- throw op[1];
165
- return { value: op[0] ? op[1] : void 0, done: true };
166
- }
167
- }
168
- var __createBinding = Object.create ? (function (o, m, k, k2) {
169
- if (k2 === undefined)
170
- k2 = k;
171
- Object.defineProperty(o, k2, { enumerable: true, get: function () { return m[k]; } });
172
- }) : (function (o, m, k, k2) {
173
- if (k2 === undefined)
174
- k2 = k;
175
- o[k2] = m[k];
176
- });
177
- function __exportStar(m, o) {
178
- for (var p in m)
179
- if (p !== "default" && !Object.prototype.hasOwnProperty.call(o, p))
180
- __createBinding(o, m, p);
181
- }
182
- function __values(o) {
183
- var s = typeof Symbol === "function" && Symbol.iterator, m = s && o[s], i = 0;
184
- if (m)
185
- return m.call(o);
186
- if (o && typeof o.length === "number")
187
- return {
188
- next: function () {
189
- if (o && i >= o.length)
190
- o = void 0;
191
- return { value: o && o[i++], done: !o };
192
- }
193
- };
194
- throw new TypeError(s ? "Object is not iterable." : "Symbol.iterator is not defined.");
195
- }
196
- function __read(o, n) {
197
- var m = typeof Symbol === "function" && o[Symbol.iterator];
198
- if (!m)
199
- return o;
200
- var i = m.call(o), r, ar = [], e;
201
- try {
202
- while ((n === void 0 || n-- > 0) && !(r = i.next()).done)
203
- ar.push(r.value);
204
- }
205
- catch (error) {
206
- e = { error: error };
207
- }
208
- finally {
209
- try {
210
- if (r && !r.done && (m = i["return"]))
211
- m.call(i);
212
- }
213
- finally {
214
- if (e)
215
- throw e.error;
216
- }
217
- }
218
- return ar;
219
- }
220
- function __spread() {
221
- for (var ar = [], i = 0; i < arguments.length; i++)
222
- ar = ar.concat(__read(arguments[i]));
223
- return ar;
224
- }
225
- function __spreadArrays() {
226
- for (var s = 0, i = 0, il = arguments.length; i < il; i++)
227
- s += arguments[i].length;
228
- for (var r = Array(s), k = 0, i = 0; i < il; i++)
229
- for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
230
- r[k] = a[j];
231
- return r;
232
- }
233
- ;
234
- function __await(v) {
235
- return this instanceof __await ? (this.v = v, this) : new __await(v);
236
- }
237
- function __asyncGenerator(thisArg, _arguments, generator) {
238
- if (!Symbol.asyncIterator)
239
- throw new TypeError("Symbol.asyncIterator is not defined.");
240
- var g = generator.apply(thisArg, _arguments || []), i, q = [];
241
- return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
242
- function verb(n) { if (g[n])
243
- i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
244
- function resume(n, v) { try {
245
- step(g[n](v));
246
- }
247
- catch (e) {
248
- settle(q[0][3], e);
249
- } }
250
- function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
251
- function fulfill(value) { resume("next", value); }
252
- function reject(value) { resume("throw", value); }
253
- function settle(f, v) { if (f(v), q.shift(), q.length)
254
- resume(q[0][0], q[0][1]); }
255
- }
256
- function __asyncDelegator(o) {
257
- var i, p;
258
- return i = {}, verb("next"), verb("throw", function (e) { throw e; }), verb("return"), i[Symbol.iterator] = function () { return this; }, i;
259
- function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === "return" } : f ? f(v) : v; } : f; }
260
- }
261
- function __asyncValues(o) {
262
- if (!Symbol.asyncIterator)
263
- throw new TypeError("Symbol.asyncIterator is not defined.");
264
- var m = o[Symbol.asyncIterator], i;
265
- return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
266
- function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
267
- function settle(resolve, reject, d, v) { Promise.resolve(v).then(function (v) { resolve({ value: v, done: d }); }, reject); }
268
- }
269
- function __makeTemplateObject(cooked, raw) {
270
- if (Object.defineProperty) {
271
- Object.defineProperty(cooked, "raw", { value: raw });
272
- }
273
- else {
274
- cooked.raw = raw;
275
- }
276
- return cooked;
277
- }
278
- ;
279
- var __setModuleDefault = Object.create ? (function (o, v) {
280
- Object.defineProperty(o, "default", { enumerable: true, value: v });
281
- }) : function (o, v) {
282
- o["default"] = v;
283
- };
284
- function __importStar(mod) {
285
- if (mod && mod.__esModule)
286
- return mod;
287
- var result = {};
288
- if (mod != null)
289
- for (var k in mod)
290
- if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k))
291
- __createBinding(result, mod, k);
292
- __setModuleDefault(result, mod);
293
- return result;
294
- }
295
- function __importDefault(mod) {
296
- return (mod && mod.__esModule) ? mod : { default: mod };
297
- }
298
- function __classPrivateFieldGet(receiver, privateMap) {
299
- if (!privateMap.has(receiver)) {
300
- throw new TypeError("attempted to get private field on non-instance");
301
- }
302
- return privateMap.get(receiver);
303
- }
304
- function __classPrivateFieldSet(receiver, privateMap, value) {
305
- if (!privateMap.has(receiver)) {
306
- throw new TypeError("attempted to set private field on non-instance");
307
- }
308
- privateMap.set(receiver, value);
309
- return value;
310
- }
311
-
312
- /** @enum {string} */
313
- var ITourEvent = {
314
- 'click': "click",
315
- 'pointerover': "pointerover",
316
- 'keyup': "keyup",
317
- 'added': "added",
318
- 'removed': "removed",
319
- };
320
- /**
321
- * @record
322
- */
323
- function ITourEventOn() { }
324
- if (false) {
325
- /** @type {?|undefined} */
326
- ITourEventOn.prototype.selector;
327
- /** @type {?|undefined} */
328
- ITourEventOn.prototype.event;
329
- }
330
- /**
331
- * @record
332
- */
333
- function ITourEventOnOptions() { }
334
- if (false) {
335
- /** @type {?|undefined} */
336
- ITourEventOnOptions.prototype.timeBeforeShow;
337
- /** @type {?|undefined} */
338
- ITourEventOnOptions.prototype.interval;
339
- }
340
- /**
341
- * @record
342
- */
343
- function ITourAbortOn() { }
344
- /**
345
- * @record
346
- */
347
- function ITourOptions() { }
348
- if (false) {
349
- /** @type {?|undefined} */
350
- ITourOptions.prototype.abortOn;
351
- }
352
- /**
353
- * @record
354
- */
355
- function ITourStepAttachToOptions() { }
356
- if (false) {
357
- /** @type {?|undefined} */
358
- ITourStepAttachToOptions.prototype.highlight;
359
- /** @type {?|undefined} */
360
- ITourStepAttachToOptions.prototype.retries;
361
- /** @type {?|undefined} */
362
- ITourStepAttachToOptions.prototype.skipIfNotFound;
363
- /** @type {?|undefined} */
364
- ITourStepAttachToOptions.prototype.else;
365
- /** @type {?|undefined} */
366
- ITourStepAttachToOptions.prototype.goBackTo;
367
- /** @type {?|undefined} */
368
- ITourStepAttachToOptions.prototype.skipFromStepCount;
369
- }
370
- /**
371
- * @record
372
- */
373
- function ITourStepAdvanceOn() { }
374
- /**
375
- * @record
376
- */
377
- function ITourStepAdvanceOnOptions() { }
378
- if (false) {
379
- /** @type {?|undefined} */
380
- ITourStepAdvanceOnOptions.prototype.jumpTo;
381
- /** @type {?|undefined} */
382
- ITourStepAdvanceOnOptions.prototype.allowGoBack;
383
- }
384
- /**
385
- * @record
386
- */
387
- function ITourStep() { }
388
- if (false) {
389
- /** @type {?|undefined} */
390
- ITourStep.prototype.attachToOptions;
391
- /** @type {?|undefined} */
392
- ITourStep.prototype.advanceOnOptions;
393
- /** @type {?|undefined} */
394
- ITourStep.prototype.advanceOn;
395
- /** @type {?|undefined} */
396
- ITourStep.prototype.abortOn;
397
- /** @type {?|undefined} */
398
- ITourStep.prototype.count;
399
- }
400
- /**
401
- * @abstract
402
- */
403
- var TourButtonsActions = /** @class */ (function () {
404
- function TourButtonsActions() {
405
- }
406
- return TourButtonsActions;
407
- }());
408
- if (false) {
409
- /**
410
- * @abstract
411
- * @return {?}
412
- */
413
- TourButtonsActions.prototype.next = function () { };
414
- /**
415
- * @abstract
416
- * @return {?}
417
- */
418
- TourButtonsActions.prototype.back = function () { };
419
- /**
420
- * @abstract
421
- * @return {?}
422
- */
423
- TourButtonsActions.prototype.cancel = function () { };
424
- /**
425
- * @abstract
426
- * @return {?}
427
- */
428
- TourButtonsActions.prototype.finish = function () { };
429
- }
430
- /** @type {?} */
431
- var SHEPHERD_DEFAULT_FIND_TIME_BEFORE_SHOW = 100;
432
- /** @type {?} */
433
- var SHEPHERD_DEFAULT_FIND_INTERVAL = 500;
434
- /** @type {?} */
435
- var SHEPHERD_DEFAULT_FIND_ATTEMPTS = 20;
436
- /** @type {?} */
437
- var overriddenEvents = [
438
- ITourEvent.click,
439
- ITourEvent.pointerover,
440
- ITourEvent.removed,
441
- ITourEvent.added,
442
- ITourEvent.keyup,
443
- ];
444
- /** @type {?} */
445
- var keyEvents = new Map([
446
- [13, 'enter'],
447
- [27, 'esc'],
448
- ]);
449
- /** @type {?} */
450
- var defaultStepOptions = {
451
- scrollTo: { behavior: 'smooth', block: 'center' },
452
- cancelIcon: {
453
- enabled: true,
454
- },
455
- };
456
- /** @type {?} */
457
- var MAT_ICON_BUTTON = 'mat-icon-button material-icons mat-button-base';
458
- /** @type {?} */
459
- var MAT_BUTTON = 'mat-button-base mat-button';
460
- /** @type {?} */
461
- var MAT_BUTTON_INVISIBLE = 'shepherd-void-button';
462
- var CovalentGuidedTour = /** @class */ (function (_super) {
463
- __extends(CovalentGuidedTour, _super);
464
- /**
465
- * @param {?=} stepOptions
466
- */
467
- function CovalentGuidedTour(stepOptions) {
468
- if (stepOptions === void 0) { stepOptions = defaultStepOptions; }
469
- var _this = _super.call(this) || this;
470
- _this.stepOptions = stepOptions;
471
- _this.newTour();
472
- return _this;
473
- }
474
- /**
475
- * @param {?=} opts
476
- * @return {?}
477
- */
478
- CovalentGuidedTour.prototype.newTour = function (opts) {
479
- var _this = this;
480
- this.shepherdTour = new Shepherd__default['default'].Tour(Object.assign({
481
- defaultStepOptions: this.stepOptions,
482
- }, opts));
483
- this._destroyedEvent$ = new rxjs.Subject();
484
- // listen to cancel and complete to clean up abortOn events
485
- rxjs.merge(rxjs.fromEvent(this.shepherdTour, 'cancel'), rxjs.fromEvent(this.shepherdTour, 'complete'))
486
- .pipe(operators.first())
487
- .subscribe(( /**
488
- * @return {?}
489
- */function () {
490
- _this._destroyedEvent$.next();
491
- _this._destroyedEvent$.complete();
492
- }));
493
- // if abortOn was passed, we bind the event and execute complete
494
- if (opts && opts.abortOn) {
495
- /** @type {?} */
496
- var abortArr$_1 = [];
497
- opts.abortOn.forEach(( /**
498
- * @param {?} abortOn
499
- * @return {?}
500
- */function (abortOn) {
501
- /** @type {?} */
502
- var abortEvent$ = new rxjs.Subject();
503
- abortArr$_1.push(abortEvent$);
504
- _this._bindEvent(abortOn, undefined, abortEvent$, _this._destroyedEvent$);
505
- }));
506
- /** @type {?} */
507
- var abortSubs_1 = rxjs.merge.apply(void 0, __spread(abortArr$_1)).pipe(operators.takeUntil(this._destroyedEvent$))
508
- .subscribe(( /**
509
- * @return {?}
510
- */function () {
511
- _this.shepherdTour.complete();
512
- abortSubs_1.unsubscribe();
513
- }));
514
- }
515
- };
516
- /**
517
- * @return {?}
518
- */
519
- CovalentGuidedTour.prototype.back = function () {
520
- this.shepherdTour.back();
521
- };
522
- /**
523
- * @return {?}
524
- */
525
- CovalentGuidedTour.prototype.cancel = function () {
526
- this.shepherdTour.cancel();
527
- };
528
- /**
529
- * @return {?}
530
- */
531
- CovalentGuidedTour.prototype.next = function () {
532
- this.shepherdTour.next();
533
- };
534
- /**
535
- * @return {?}
536
- */
537
- CovalentGuidedTour.prototype.finish = function () {
538
- this.shepherdTour.complete();
539
- };
540
- /**
541
- * @param {?} steps
542
- * @return {?}
543
- */
544
- CovalentGuidedTour.prototype.addSteps = function (steps) {
545
- this.shepherdTour.addSteps(this._prepareTour(steps));
546
- };
547
- /**
548
- * @return {?}
549
- */
550
- CovalentGuidedTour.prototype.start = function () {
551
- this.shepherdTour.start();
552
- };
553
- /**
554
- * @protected
555
- * @param {?} originalSteps
556
- * @param {?=} finishLabel
557
- * @return {?}
558
- */
559
- CovalentGuidedTour.prototype._prepareTour = function (originalSteps, finishLabel) {
560
- var _this = this;
561
- if (finishLabel === void 0) { finishLabel = 'finish'; }
562
- // create Subjects for back and forward events
563
- /** @type {?} */
564
- var backEvent$ = new rxjs.Subject();
565
- /** @type {?} */
566
- var forwardEvent$ = new rxjs.Subject();
567
- /** @type {?} */
568
- var _backFlow = false;
569
- // create Subject for your end
570
- /** @type {?} */
571
- var destroyedEvent$ = new rxjs.Subject();
572
- /**
573
- * This function adds the step progress in the footer of the shepherd tooltip
574
- * @type {?}
575
- */
576
- var appendProgressFunc = ( /**
577
- * @return {?}
578
- */function () {
579
- // get all the footers that are available in the DOM
580
- /** @type {?} */
581
- var footers = Array.from(document.querySelectorAll('.shepherd-footer'));
582
- // get the last footer since Shepherd always puts the active one at the end
583
- /** @type {?} */
584
- var footer = footers[footers.length - 1];
585
- // generate steps html element
586
- /** @type {?} */
587
- var progress = document.createElement('span');
588
- progress.className = 'shepherd-progress';
589
- progress.innerText = this.shepherdTour.currentStep.options.count + "/" + stepTotal;
590
- // insert into the footer before the first button
591
- footer.insertBefore(progress, footer.querySelector('.shepherd-button'));
592
- });
593
- /** @type {?} */
594
- var stepTotal = 0;
595
- /** @type {?} */
596
- var steps = originalSteps.map(( /**
597
- * @param {?} step
598
- * @return {?}
599
- */function (step) {
600
- var _a, _b, _c;
601
- /** @type {?} */
602
- var showProgress;
603
- if (((_a = step.attachToOptions) === null || _a === void 0 ? void 0 : _a.skipFromStepCount) === true) {
604
- showProgress = ( /**
605
- * @return {?}
606
- */function () {
607
- return;
608
- });
609
- }
610
- else if (((_b = step.attachToOptions) === null || _b === void 0 ? void 0 : _b.skipFromStepCount) === undefined ||
611
- ((_c = step.attachToOptions) === null || _c === void 0 ? void 0 : _c.skipFromStepCount) === false) {
612
- step.count = ++stepTotal;
613
- showProgress = appendProgressFunc.bind(_this);
614
- }
615
- return Object.assign({}, step, {
616
- when: {
617
- show: showProgress,
618
- },
619
- });
620
- }));
621
- /** @type {?} */
622
- var finishButton = {
623
- text: finishLabel,
624
- action: this['finish'].bind(this),
625
- classes: MAT_BUTTON,
626
- };
627
- /** @type {?} */
628
- var voidButton = {
629
- text: '',
630
- /**
631
- * @return {?}
632
- */
633
- action: function () {
634
- return;
635
- },
636
- classes: MAT_BUTTON_INVISIBLE,
637
- };
638
- // listen to the destroyed event to clean up all the streams
639
- this._destroyedEvent$.pipe(operators.first()).subscribe(( /**
640
- * @return {?}
641
- */function () {
642
- backEvent$.complete();
643
- forwardEvent$.complete();
644
- destroyedEvent$.next();
645
- destroyedEvent$.complete();
646
- }));
647
- /** @type {?} */
648
- var totalSteps = steps.length;
649
- steps.forEach(( /**
650
- * @param {?} step
651
- * @param {?} index
652
- * @return {?}
653
- */function (step, index) {
654
- var _a;
655
- // create buttons specific for the step
656
- // this is done to create more control on events
657
- /** @type {?} */
658
- var nextButton = {
659
- text: 'chevron_right',
660
- action: ( /**
661
- * @return {?}
662
- */function () {
663
- // intercept the next action and trigger event
664
- forwardEvent$.next();
665
- _this.shepherdTour.next();
666
- }),
667
- classes: MAT_ICON_BUTTON,
668
- };
669
- /** @type {?} */
670
- var backButton = {
671
- text: 'chevron_left',
672
- action: ( /**
673
- * @return {?}
674
- */function () {
675
- // intercept the back action and trigger event
676
- backEvent$.next();
677
- _backFlow = true;
678
- // check if 'goBackTo' is set to jump to a particular step, else just go back
679
- if (step.attachToOptions && step.attachToOptions.goBackTo) {
680
- _this.shepherdTour.show(step.attachToOptions.goBackTo, false);
681
- }
682
- else {
683
- _this.shepherdTour.back();
684
- }
685
- }),
686
- classes: ((_a = step.advanceOnOptions) === null || _a === void 0 ? void 0 : _a.allowGoBack) === false ? MAT_BUTTON_INVISIBLE : MAT_ICON_BUTTON,
687
- };
688
- // check if highlight was provided for the step, else fallback into shepherds usage
689
- step.highlightClass =
690
- step.attachToOptions && step.attachToOptions.highlight ? 'shepherd-highlight' : step.highlightClass;
691
- // Adding buttons in the steps if no buttons are defined
692
- if (!step.buttons || step.buttons.length === 0) {
693
- if (index === 0) {
694
- // first step
695
- step.buttons = [nextButton];
696
- }
697
- else if (index === totalSteps - 1) {
698
- // last step
699
- step.buttons = [backButton, finishButton];
700
- }
701
- else {
702
- step.buttons = [backButton, nextButton];
703
- }
704
- }
705
- // checks "advanceOn" to override listeners
706
- /** @type {?} */
707
- var advanceOn = step.advanceOn;
708
- // remove the shepherd "advanceOn" infavor of ours if the event is part of our list
709
- if ((typeof advanceOn === 'object' &&
710
- !Array.isArray(advanceOn) &&
711
- overriddenEvents.indexOf(advanceOn.event.split('.')[0]) > -1) ||
712
- advanceOn instanceof Array) {
713
- step.advanceOn = undefined;
714
- step.buttons =
715
- step.advanceOnOptions && step.advanceOnOptions.allowGoBack ? [backButton, voidButton] : [voidButton];
716
- }
717
- // adds a default beforeShowPromise function
718
- step.beforeShowPromise = ( /**
719
- * @return {?}
720
- */function () {
721
- return new Promise(( /**
722
- * @param {?} resolve
723
- * @return {?}
724
- */function (resolve) {
725
- /** @type {?} */
726
- var additionalCapabilitiesSetup = ( /**
727
- * @return {?}
728
- */function () {
729
- if (advanceOn && !step.advanceOn) {
730
- if (!Array.isArray(advanceOn)) {
731
- advanceOn = [advanceOn];
732
- }
733
- /** @type {?} */
734
- var advanceArr$_1 = [];
735
- advanceOn.forEach(( /**
736
- * @param {?} _
737
- * @param {?} i
738
- * @return {?}
739
- */function (_, i) {
740
- /** @type {?} */
741
- var advanceEvent$ = new rxjs.Subject();
742
- advanceArr$_1.push(advanceEvent$);
743
- // we start a timer of attempts to find an element in the dom
744
- _this._bindEvent(advanceOn[i], step.advanceOnOptions, advanceEvent$, destroyedEvent$);
745
- }));
746
- /** @type {?} */
747
- var advanceSubs_1 = rxjs.forkJoin.apply(void 0, __spread(advanceArr$_1)).pipe(operators.takeUntil(rxjs.merge(destroyedEvent$, backEvent$)))
748
- .subscribe(( /**
749
- * @return {?}
750
- */function () {
751
- // check if we need to advance to a specific step, else advance to next step
752
- if (step.advanceOnOptions && step.advanceOnOptions.jumpTo) {
753
- _this.shepherdTour.show(step.advanceOnOptions.jumpTo);
754
- }
755
- else {
756
- _this.shepherdTour.next();
757
- }
758
- forwardEvent$.next();
759
- advanceSubs_1.unsubscribe();
760
- }));
761
- }
762
- // if abortOn was passed on the step, we bind the event and execute complete
763
- if (step.abortOn) {
764
- /** @type {?} */
765
- var abortArr$_2 = [];
766
- step.abortOn.forEach(( /**
767
- * @param {?} abortOn
768
- * @return {?}
769
- */function (abortOn) {
770
- /** @type {?} */
771
- var abortEvent$ = new rxjs.Subject();
772
- abortArr$_2.push(abortEvent$);
773
- _this._bindEvent(abortOn, undefined, abortEvent$, destroyedEvent$);
774
- }));
775
- /** @type {?} */
776
- var abortSubs_2 = rxjs.merge.apply(void 0, __spread(abortArr$_2)).pipe(operators.takeUntil(rxjs.merge(destroyedEvent$, backEvent$, forwardEvent$)))
777
- .subscribe(( /**
778
- * @return {?}
779
- */function () {
780
- _this.shepherdTour.complete();
781
- abortSubs_2.unsubscribe();
782
- }));
783
- }
784
- });
785
- /** @type {?} */
786
- var _stopTimer$ = new rxjs.Subject();
787
- /** @type {?} */
788
- var _retriesReached$ = new rxjs.Subject();
789
- /** @type {?} */
790
- var _retryAttempts$ = new rxjs.BehaviorSubject(-1);
791
- /** @type {?} */
792
- var id;
793
- // checks if "attachTo" is a string or an object to get the id of an element
794
- if (typeof step.attachTo === 'string') {
795
- id = step.attachTo;
796
- }
797
- else if (typeof step.attachTo === 'object' && typeof step.attachTo.element === 'string') {
798
- id = step.attachTo.element;
799
- }
800
- // if we have an id as a string in either case, we use it (we ignore it if its HTMLElement)
801
- if (id) {
802
- // if current step is the first step of the tour, we set the buttons to be only "next"
803
- // we had to use `any` since the tour doesnt expose the steps in any fashion nor a way to check if we have modified them at all
804
- if (_this.shepherdTour.getCurrentStep() === (( /** @type {?} */(_this.shepherdTour))).steps[0]) {
805
- _this.shepherdTour.getCurrentStep().updateStepOptions({
806
- buttons: originalSteps[index].advanceOn ? [voidButton] : [nextButton],
807
- });
808
- }
809
- // register to the attempts observable to notify deeveloper when number has been reached
810
- _retryAttempts$
811
- .pipe(operators.skip(1), operators.takeUntil(rxjs.merge(_stopTimer$.asObservable(), destroyedEvent$)), operators.skipWhile(( /**
812
- * @param {?} val
813
- * @return {?}
814
- */function (val) {
815
- if (step.attachToOptions && step.attachToOptions.retries !== undefined) {
816
- return val < step.attachToOptions.retries;
817
- }
818
- return val < SHEPHERD_DEFAULT_FIND_ATTEMPTS;
819
- })))
820
- .subscribe(( /**
821
- * @param {?} attempts
822
- * @return {?}
823
- */function (attempts) {
824
- _retriesReached$.next();
825
- _retriesReached$.complete();
826
- // if attempts have been reached, we check "skipIfNotFound" to move on to the next step
827
- if (step.attachToOptions && step.attachToOptions.skipIfNotFound) {
828
- // if we get to this step coming back from a step and it wasnt found
829
- // then we either check if its the first step and try going forward
830
- // or we keep going back until we find a step that actually exists
831
- if (_backFlow) {
832
- if ((( /** @type {?} */(_this.shepherdTour))).steps.indexOf(_this.shepherdTour.getCurrentStep()) === 0) {
833
- _this.shepherdTour.next();
834
- }
835
- else {
836
- _this.shepherdTour.back();
837
- }
838
- _backFlow = false;
839
- }
840
- else {
841
- // destroys current step if we need to skip it to remove it from the tour
842
- /** @type {?} */
843
- var currentStep = _this.shepherdTour.getCurrentStep();
844
- currentStep.destroy();
845
- _this.shepherdTour.next();
846
- _this.shepherdTour.removeStep((( /** @type {?} */(currentStep))).id);
847
- }
848
- }
849
- else if (step.attachToOptions && step.attachToOptions.else) {
850
- // if "skipIfNotFound" is not true, then we check if "else" has been set to jump to a specific step
851
- _this.shepherdTour.show(step.attachToOptions.else);
852
- }
853
- else {
854
- // tslint:disable-next-line:no-console
855
- console.warn("Retries reached trying to find " + id + ". Retried " + attempts + " times.");
856
- // else we show the step regardless
857
- resolve();
858
- }
859
- }));
860
- // we start a timer of attempts to find an element in the dom
861
- rxjs.timer((step.attachToOptions && step.attachToOptions.timeBeforeShow) || SHEPHERD_DEFAULT_FIND_TIME_BEFORE_SHOW, (step.attachToOptions && step.attachToOptions.interval) || SHEPHERD_DEFAULT_FIND_INTERVAL)
862
- .pipe(
863
- // the timer will continue either until we find the element or the number of attempts has been reached
864
- operators.takeUntil(rxjs.merge(_stopTimer$, _retriesReached$, destroyedEvent$)))
865
- .subscribe(( /**
866
- * @return {?}
867
- */function () {
868
- /** @type {?} */
869
- var element = document.querySelector(id);
870
- // if the element has been found, we stop the timer and resolve the promise
871
- if (element) {
872
- _stopTimer$.next();
873
- _stopTimer$.complete();
874
- additionalCapabilitiesSetup();
875
- resolve();
876
- }
877
- else {
878
- _retryAttempts$.next(_retryAttempts$.value + 1);
879
- }
880
- }));
881
- // stop find interval if user stops the tour
882
- destroyedEvent$.subscribe(( /**
883
- * @return {?}
884
- */function () {
885
- _stopTimer$.next();
886
- _stopTimer$.complete();
887
- _retriesReached$.next();
888
- _retriesReached$.complete();
889
- }));
890
- }
891
- else {
892
- // resolve observable until the timeBeforeShow has passsed or use default
893
- rxjs.timer((step.attachToOptions && step.attachToOptions.timeBeforeShow) || SHEPHERD_DEFAULT_FIND_TIME_BEFORE_SHOW)
894
- .pipe(operators.takeUntil(rxjs.merge(destroyedEvent$)))
895
- .subscribe(( /**
896
- * @return {?}
897
- */function () {
898
- resolve();
899
- }));
900
- }
901
- }));
902
- });
903
- }));
904
- return steps;
905
- };
906
- /**
907
- * @private
908
- * @param {?} eventOn
909
- * @param {?} eventOnOptions
910
- * @param {?} event$
911
- * @param {?} destroyedEvent$
912
- * @return {?}
913
- */
914
- CovalentGuidedTour.prototype._bindEvent = function (eventOn, eventOnOptions, event$, destroyedEvent$) {
915
- /** @type {?} */
916
- var selector = eventOn.selector;
917
- /** @type {?} */
918
- var event = eventOn.event;
919
- // we start a timer of attempts to find an element in the dom
920
- /** @type {?} */
921
- var timerSubs = rxjs.timer((eventOnOptions && eventOnOptions.timeBeforeShow) || SHEPHERD_DEFAULT_FIND_TIME_BEFORE_SHOW, (eventOnOptions && eventOnOptions.interval) || SHEPHERD_DEFAULT_FIND_INTERVAL)
922
- .pipe(operators.takeUntil(destroyedEvent$))
923
- .subscribe(( /**
924
- * @return {?}
925
- */function () {
926
- /** @type {?} */
927
- var element = document.querySelector(selector);
928
- // if the element has been found, we stop the timer and resolve the promise
929
- if (element) {
930
- timerSubs.unsubscribe();
931
- if (event === ITourEvent.added) {
932
- // if event is "Added" trigger a soon as this is attached.
933
- event$.next();
934
- event$.complete();
935
- }
936
- else if (event === ITourEvent.click ||
937
- event === ITourEvent.pointerover ||
938
- event.indexOf(ITourEvent.keyup) > -1) {
939
- // we use normal listeners for mouseevents
940
- /** @type {?} */
941
- var mainEvent = event.split('.')[0];
942
- /** @type {?} */
943
- var subEvent_1 = event.split('.')[1];
944
- rxjs.fromEvent(element, mainEvent)
945
- .pipe(operators.takeUntil(rxjs.merge(event$.asObservable(), destroyedEvent$)), operators.filter(( /**
946
- * @param {?} $event
947
- * @return {?}
948
- */function ($event) {
949
- // only trigger if the event is a keyboard event and part of out list
950
- if ($event instanceof KeyboardEvent) {
951
- if (keyEvents.get($event.keyCode) === subEvent_1) {
952
- return true;
953
- }
954
- return false;
955
- }
956
- else {
957
- return true;
958
- }
959
- })))
960
- .subscribe(( /**
961
- * @return {?}
962
- */function () {
963
- event$.next();
964
- event$.complete();
965
- }));
966
- }
967
- else if (event === ITourEvent.removed) {
968
- // and we will use MutationObserver for DOM events
969
- /** @type {?} */
970
- var observer_1 = new MutationObserver(( /**
971
- * @return {?}
972
- */function () {
973
- if (!document.body.contains(element)) {
974
- event$.next();
975
- event$.complete();
976
- observer_1.disconnect();
977
- }
978
- }));
979
- // stop listenining if tour is closed
980
- destroyedEvent$.subscribe(( /**
981
- * @return {?}
982
- */function () {
983
- observer_1.disconnect();
984
- }));
985
- // observe for any DOM interaction in the element
986
- observer_1.observe(element, { childList: true, subtree: true, attributes: true });
987
- }
988
- }
989
- }));
990
- };
991
- return CovalentGuidedTour;
992
- }(TourButtonsActions));
993
- if (false) {
994
- /**
995
- * @type {?}
996
- * @private
997
- */
998
- CovalentGuidedTour.prototype._destroyedEvent$;
999
- /** @type {?} */
1000
- CovalentGuidedTour.prototype.shepherdTour;
1001
- /** @type {?} */
1002
- CovalentGuidedTour.prototype.stepOptions;
1003
- }
1004
-
1005
- /**
1006
- * @record
1007
- */
1008
- function IGuidedTour() { }
1009
- if (false) {
1010
- /** @type {?} */
1011
- IGuidedTour.prototype.steps;
1012
- /** @type {?|undefined} */
1013
- IGuidedTour.prototype.finishButtonText;
1014
- }
1015
- /**
1016
- * @record
1017
- */
1018
- function IGuidedTourStep() { }
1019
- if (false) {
1020
- /** @type {?|undefined} */
1021
- IGuidedTourStep.prototype.routing;
1022
- }
1023
- /** @enum {string} */
1024
- var TourEvents = {
1025
- complete: "complete",
1026
- cancel: "cancel",
1027
- hide: "hide",
1028
- show: "show",
1029
- start: "start",
1030
- active: "active",
1031
- inactive: "inactive",
1032
- };
1033
- /**
1034
- * @record
1035
- */
1036
- function IGuidedTourEvent() { }
1037
- if (false) {
1038
- /** @type {?} */
1039
- IGuidedTourEvent.prototype.step;
1040
- /** @type {?} */
1041
- IGuidedTourEvent.prototype.previous;
1042
- /** @type {?} */
1043
- IGuidedTourEvent.prototype.tour;
1044
- }
1045
- var CovalentGuidedTourService = /** @class */ (function (_super) {
1046
- __extends(CovalentGuidedTourService, _super);
1047
- /**
1048
- * @param {?} _router
1049
- * @param {?} _route
1050
- * @param {?} _httpClient
1051
- */
1052
- function CovalentGuidedTourService(_router, _route, _httpClient) {
1053
- var _this = _super.call(this) || this;
1054
- _this._router = _router;
1055
- _this._route = _route;
1056
- _this._httpClient = _httpClient;
1057
- _this._toursMap = new Map();
1058
- _this._tourStepURLs = new Map();
1059
- _router.events
1060
- .pipe(operators.filter(( /**
1061
- * @param {?} event
1062
- * @return {?}
1063
- */function (event) { return event instanceof router.NavigationStart && event.navigationTrigger === 'popstate'; })))
1064
- .subscribe(( /**
1065
- * @param {?} event
1066
- * @return {?}
1067
- */function (event) {
1068
- if (_this.shepherdTour.isActive) {
1069
- _this.shepherdTour.cancel();
1070
- }
1071
- }));
1072
- return _this;
1073
- }
1074
- /**
1075
- * @param {?} str
1076
- * @return {?}
1077
- */
1078
- CovalentGuidedTourService.prototype.tourEvent$ = function (str) {
1079
- return rxjs.fromEvent(this.shepherdTour, str);
1080
- };
1081
- /**
1082
- * @param {?} tourName
1083
- * @param {?} tour
1084
- * @return {?}
1085
- */
1086
- CovalentGuidedTourService.prototype.registerTour = function (tourName, tour) {
1087
- return __awaiter(this, void 0, void 0, function () {
1088
- var guidedTour, _b;
1089
- return __generator(this, function (_c) {
1090
- switch (_c.label) {
1091
- case 0:
1092
- if (!(typeof tour === 'string')) return [3 /*break*/, 2];
1093
- return [4 /*yield*/, this._loadTour(tour)];
1094
- case 1:
1095
- _b = _c.sent();
1096
- return [3 /*break*/, 3];
1097
- case 2:
1098
- _b = tour;
1099
- _c.label = 3;
1100
- case 3:
1101
- guidedTour = _b;
1102
- this._toursMap.set(tourName, guidedTour);
1103
- return [2 /*return*/];
1104
- }
1105
- });
1106
- });
1107
- };
1108
- /**
1109
- * @param {?} tourName
1110
- * @return {?}
1111
- */
1112
- CovalentGuidedTourService.prototype.startTour = function (tourName) {
1113
- var _this = this;
1114
- /** @type {?} */
1115
- var guidedTour = this._getTour(tourName);
1116
- this.finish();
1117
- if (guidedTour && guidedTour.steps && guidedTour.steps.length) {
1118
- // remove steps from tour since we need to preprocess them first
1119
- this.newTour(Object.assign({}, guidedTour, { steps: undefined }));
1120
- /** @type {?} */
1121
- var tourInstance = this.shepherdTour.addSteps(this._configureRoutesForSteps(this._prepareTour(guidedTour.steps, guidedTour.finishButtonText)));
1122
- // init route transition if step URL is different then the current location.
1123
- this.tourEvent$(TourEvents.show).subscribe(( /**
1124
- * @param {?} tourEvent
1125
- * @return {?}
1126
- */function (tourEvent) {
1127
- /** @type {?} */
1128
- var currentURL = _this._router.url.split(/[?#]/)[0];
1129
- var _b = tourEvent.step, id = _b.id, options = _b.options;
1130
- if (_this._tourStepURLs.has(id)) {
1131
- /** @type {?} */
1132
- var stepRoute = _this._tourStepURLs.get(id);
1133
- if (stepRoute !== currentURL) {
1134
- _this._router.navigate([stepRoute]);
1135
- }
1136
- }
1137
- else {
1138
- if (options && options.routing) {
1139
- _this._tourStepURLs.set(id, options.routing.route);
1140
- }
1141
- else {
1142
- _this._tourStepURLs.set(id, currentURL);
1143
- }
1144
- }
1145
- }));
1146
- this.start();
1147
- return tourInstance;
1148
- }
1149
- else {
1150
- // tslint:disable-next-line:no-console
1151
- console.warn("Tour " + tourName + " does not exist. Please try another tour.");
1152
- }
1153
- };
1154
- // Finds the right registered tour by using queryParams
1155
- // finishes any other tour and starts the new one.
1156
- /**
1157
- * @param {?=} queryParam
1158
- * @return {?}
1159
- */
1160
- CovalentGuidedTourService.prototype.initializeOnQueryParams = function (queryParam) {
1161
- var _this = this;
1162
- if (queryParam === void 0) { queryParam = 'tour'; }
1163
- return this._route.queryParamMap.pipe(operators.debounceTime(100), operators.tap(( /**
1164
- * @param {?} params
1165
- * @return {?}
1166
- */function (params) {
1167
- /** @type {?} */
1168
- var tourParam = params.get(queryParam);
1169
- if (tourParam) {
1170
- _this.startTour(tourParam);
1171
- // get current search parameters
1172
- /** @type {?} */
1173
- var searchParams = new URLSearchParams(window.location.search);
1174
- // delete tour queryParam
1175
- searchParams.delete(queryParam);
1176
- // build new URL string without it
1177
- /** @type {?} */
1178
- var url = window.location.protocol + '//' + window.location.host + window.location.pathname;
1179
- if (searchParams.toString()) {
1180
- url += '?' + searchParams.toString();
1181
- }
1182
- // replace state in history without triggering a navigation
1183
- window.history.replaceState({ path: url }, '', url);
1184
- }
1185
- })));
1186
- };
1187
- /**
1188
- * @param {?} stepId
1189
- * @param {?} isDisabled
1190
- * @return {?}
1191
- */
1192
- CovalentGuidedTourService.prototype.setNextBtnDisability = function (stepId, isDisabled) {
1193
- if (this.shepherdTour.getById(stepId)) {
1194
- /** @type {?} */
1195
- var stepOptions = (( /** @type {?} */(this.shepherdTour.getById(stepId)))).options;
1196
- stepOptions.buttons.forEach(( /**
1197
- * @param {?} button
1198
- * @return {?}
1199
- */function (button) {
1200
- if (button.text === 'chevron_right') {
1201
- button.disabled = isDisabled;
1202
- }
1203
- }));
1204
- this.shepherdTour.getById(stepId).updateStepOptions(stepOptions);
1205
- }
1206
- };
1207
- /**
1208
- * @private
1209
- * @param {?} tourUrl
1210
- * @return {?}
1211
- */
1212
- CovalentGuidedTourService.prototype._loadTour = function (tourUrl) {
1213
- return __awaiter(this, void 0, void 0, function () {
1214
- var request, _a_1;
1215
- return __generator(this, function (_b) {
1216
- switch (_b.label) {
1217
- case 0:
1218
- request = this._httpClient.get(tourUrl);
1219
- _b.label = 1;
1220
- case 1:
1221
- _b.trys.push([1, 3, , 4]);
1222
- return [4 /*yield*/, request
1223
- .pipe(operators.map(( /**
1224
- * @param {?} resultSet
1225
- * @return {?}
1226
- */function (resultSet) {
1227
- return JSON.parse(JSON.stringify(resultSet));
1228
- })))
1229
- .toPromise()];
1230
- case 2: return [2 /*return*/, _b.sent()];
1231
- case 3:
1232
- _a_1 = _b.sent();
1233
- return [2 /*return*/, undefined];
1234
- case 4: return [2 /*return*/];
1235
- }
1236
- });
1237
- });
1238
- };
1239
- /**
1240
- * @private
1241
- * @param {?} key
1242
- * @return {?}
1243
- */
1244
- CovalentGuidedTourService.prototype._getTour = function (key) {
1245
- return this._toursMap.get(key);
1246
- };
1247
- /**
1248
- * @private
1249
- * @param {?} routedSteps
1250
- * @return {?}
1251
- */
1252
- CovalentGuidedTourService.prototype._configureRoutesForSteps = function (routedSteps) {
1253
- var _this = this;
1254
- routedSteps.forEach(( /**
1255
- * @param {?} step
1256
- * @return {?}
1257
- */function (step) {
1258
- if (step.routing) {
1259
- /** @type {?} */
1260
- var route_1 = step.routing.route;
1261
- // if there is a beforeShowPromise, then we save it and call it after the navigation
1262
- if (step.beforeShowPromise) {
1263
- /** @type {?} */
1264
- var beforeShowPromise_1 = step.beforeShowPromise;
1265
- step.beforeShowPromise = ( /**
1266
- * @return {?}
1267
- */function () {
1268
- return _this._router.navigate([route_1], step.routing.extras).then(( /**
1269
- * @return {?}
1270
- */function () {
1271
- return beforeShowPromise_1();
1272
- }));
1273
- });
1274
- }
1275
- else {
1276
- step.beforeShowPromise = ( /**
1277
- * @return {?}
1278
- */function () { return _this._router.navigate([route_1]); });
1279
- }
1280
- }
1281
- }));
1282
- return routedSteps;
1283
- };
1284
- return CovalentGuidedTourService;
1285
- }(CovalentGuidedTour));
1286
- CovalentGuidedTourService.decorators = [
1287
- { type: core.Injectable }
1288
- ];
1289
- /** @nocollapse */
1290
- CovalentGuidedTourService.ctorParameters = function () { return [
1291
- { type: router.Router },
1292
- { type: router.ActivatedRoute },
1293
- { type: http.HttpClient }
1294
- ]; };
1295
- if (false) {
1296
- /**
1297
- * @type {?}
1298
- * @private
1299
- */
1300
- CovalentGuidedTourService.prototype._toursMap;
1301
- /**
1302
- * @type {?}
1303
- * @private
1304
- */
1305
- CovalentGuidedTourService.prototype._tourStepURLs;
1306
- /**
1307
- * @type {?}
1308
- * @private
1309
- */
1310
- CovalentGuidedTourService.prototype._router;
1311
- /**
1312
- * @type {?}
1313
- * @private
1314
- */
1315
- CovalentGuidedTourService.prototype._route;
1316
- /**
1317
- * @type {?}
1318
- * @private
1319
- */
1320
- CovalentGuidedTourService.prototype._httpClient;
1321
- }
1322
-
1323
- /**
1324
- * @fileoverview added by tsickle
1325
- * Generated from: guided-tour.module.ts
1326
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1327
- */
1328
- var CovalentGuidedTourModule = /** @class */ (function () {
1329
- function CovalentGuidedTourModule() {
1330
- }
1331
- return CovalentGuidedTourModule;
1332
- }());
1333
- CovalentGuidedTourModule.decorators = [
1334
- { type: core.NgModule, args: [{
1335
- imports: [common.CommonModule],
1336
- providers: [CovalentGuidedTourService],
1337
- declarations: [],
1338
- exports: [],
1339
- },] }
1340
- ];
1341
-
1342
- /**
1343
- * @fileoverview added by tsickle
1344
- * Generated from: public-api.ts
1345
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1346
- */
1347
-
1348
- /**
1349
- * @fileoverview added by tsickle
1350
- * Generated from: index.ts
1351
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1352
- */
1353
-
1354
- /**
1355
- * @fileoverview added by tsickle
1356
- * Generated from: covalent-guided-tour.ts
1357
- * @suppress {checkTypes,constantProperty,extraRequire,missingOverride,missingRequire,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
1358
- */
1359
-
1360
- exports.CovalentGuidedTour = CovalentGuidedTour;
1361
- exports.CovalentGuidedTourModule = CovalentGuidedTourModule;
1362
- exports.CovalentGuidedTourService = CovalentGuidedTourService;
1363
- exports.ITourEvent = ITourEvent;
1364
- exports.TourEvents = TourEvents;
1365
-
1366
- Object.defineProperty(exports, '__esModule', { value: true });
1367
-
1368
- })));
1369
- //# sourceMappingURL=covalent-guided-tour.umd.js.map