windows-plus-utilities 0.0.82 → 0.0.83
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/esm2022/modal-wizard/public-api.mjs +6 -2
- package/esm2022/modal-wizard/util/helper/wizard-builder.service.mjs +13 -0
- package/esm2022/modal-wizard/util/interface/step-definition.interface.mjs +2 -0
- package/esm2022/modal-wizard/util/interface/wizard-state.interface.mjs +2 -0
- package/esm2022/modal-wizard/util/service/wizard-step.service.mjs +72 -0
- package/fesm2022/windows-plus-utilities-modal-wizard.mjs +83 -2
- package/fesm2022/windows-plus-utilities-modal-wizard.mjs.map +1 -1
- package/modal-wizard/public-api.d.ts +5 -1
- package/modal-wizard/util/helper/wizard-builder.service.d.ts +6 -0
- package/modal-wizard/util/interface/step-definition.interface.d.ts +7 -0
- package/modal-wizard/util/interface/wizard-state.interface.d.ts +5 -0
- package/modal-wizard/util/service/wizard-step.service.d.ts +19 -0
- package/package.json +12 -12
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
* Public API Surface of windows-plus-utilities
|
|
3
3
|
*/
|
|
4
4
|
export * from './components/step/step.component';
|
|
5
|
-
export * from './util/
|
|
5
|
+
export * from './util/helper/wizard-builder.service';
|
|
6
6
|
export * from './util/interface/modal-step.interface';
|
|
7
|
+
export * from './util/interface/step-definition.interface';
|
|
8
|
+
export * from './util/interface/stepped-modal.interface';
|
|
9
|
+
export * from './util/interface/wizard-state.interface';
|
|
10
|
+
export * from './util/service/wizard-step.service';
|
|
7
11
|
export * from './util/service/step.service';
|
|
8
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
12
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoicHVibGljLWFwaS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uL3Byb2plY3RzL3dpbmRvd3MtcGx1cy11dGlsaXRpZXMvbW9kYWwtd2l6YXJkL3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+
export class WizardBuilder {
|
|
2
|
+
constructor() {
|
|
3
|
+
this.steps = [];
|
|
4
|
+
}
|
|
5
|
+
addStep(step) {
|
|
6
|
+
this.steps.push(step);
|
|
7
|
+
return this;
|
|
8
|
+
}
|
|
9
|
+
build() {
|
|
10
|
+
return [...this.steps]; // Immutable copy
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l6YXJkLWJ1aWxkZXIuc2VydmljZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3dpbmRvd3MtcGx1cy11dGlsaXRpZXMvbW9kYWwtd2l6YXJkL3V0aWwvaGVscGVyL3dpemFyZC1idWlsZGVyLnNlcnZpY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBRUEsTUFBTSxPQUFPLGFBQWE7SUFBMUI7UUFDUyxVQUFLLEdBQW1CLEVBQUUsQ0FBQTtJQVduQyxDQUFDO0lBVEEsT0FBTyxDQUFDLElBQWtCO1FBQ3pCLElBQUksQ0FBQyxLQUFLLENBQUMsSUFBSSxDQUFDLElBQUksQ0FBQyxDQUFBO1FBRXJCLE9BQU8sSUFBSSxDQUFBO0lBQ1osQ0FBQztJQUVELEtBQUs7UUFDSixPQUFPLENBQUMsR0FBRyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUEsQ0FBQyxpQkFBaUI7SUFDekMsQ0FBQztDQUNEIiwic291cmNlc0NvbnRlbnQiOlsiaW1wb3J0IHsgU3RlcE1vZGVsIH0gZnJvbSAnLi4vaW50ZXJmYWNlL21vZGFsLXN0ZXAuaW50ZXJmYWNlJ1xyXG5cclxuZXhwb3J0IGNsYXNzIFdpemFyZEJ1aWxkZXI8VD4ge1xyXG5cdHByaXZhdGUgc3RlcHM6IFN0ZXBNb2RlbDxUPltdID0gW11cclxuXHJcblx0YWRkU3RlcChzdGVwOiBTdGVwTW9kZWw8VD4pOiBXaXphcmRCdWlsZGVyPFQ+IHtcclxuXHRcdHRoaXMuc3RlcHMucHVzaChzdGVwKVxyXG5cclxuXHRcdHJldHVybiB0aGlzXHJcblx0fVxyXG5cclxuXHRidWlsZCgpOiBTdGVwTW9kZWw8VD5bXSB7XHJcblx0XHRyZXR1cm4gWy4uLnRoaXMuc3RlcHNdIC8vIEltbXV0YWJsZSBjb3B5XHJcblx0fVxyXG59Il19
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic3RlcC1kZWZpbml0aW9uLmludGVyZmFjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3dpbmRvd3MtcGx1cy11dGlsaXRpZXMvbW9kYWwtd2l6YXJkL3V0aWwvaW50ZXJmYWNlL3N0ZXAtZGVmaW5pdGlvbi5pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImV4cG9ydCBpbnRlcmZhY2UgU3RlcERlZmluaXRpb248VD4ge1xyXG4gIGlkOiBzdHJpbmdcclxuICB0aXRsZTogc3RyaW5nXHJcbiAgc2x1Zzogc3RyaW5nXHJcbiAgcGFyYW1ldGVycz86IFRbXVxyXG4gIG9uRW50ZXI/OiAoY29udGV4dD86IGFueSkgPT4gUHJvbWlzZTxib29sZWFuPiB8IGJvb2xlYW5cclxufSJdfQ==
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l6YXJkLXN0YXRlLmludGVyZmFjZS5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uL3Byb2plY3RzL3dpbmRvd3MtcGx1cy11dGlsaXRpZXMvbW9kYWwtd2l6YXJkL3V0aWwvaW50ZXJmYWNlL3dpemFyZC1zdGF0ZS5pbnRlcmZhY2UudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IiIsInNvdXJjZXNDb250ZW50IjpbImltcG9ydCB7IFN0ZXBEZWZpbml0aW9uIH0gZnJvbSAnLi9zdGVwLWRlZmluaXRpb24uaW50ZXJmYWNlJ1xyXG5cclxuZXhwb3J0IGludGVyZmFjZSBXaXphcmRTdGF0ZTxUPiB7XHJcblx0c3RlcHM6IFN0ZXBEZWZpbml0aW9uPFQ+W11cclxuXHRjdXJyZW50SW5kZXg6IG51bWJlclxyXG59Il19
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { BehaviorSubject, map } from 'rxjs';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
import * as i1 from "@angular/router";
|
|
5
|
+
export class WizardStepService {
|
|
6
|
+
constructor(router, activatedRoute) {
|
|
7
|
+
this.router = router;
|
|
8
|
+
this.activatedRoute = activatedRoute;
|
|
9
|
+
this.state$ = new BehaviorSubject(null);
|
|
10
|
+
}
|
|
11
|
+
initialize(steps) {
|
|
12
|
+
this.state$.next({
|
|
13
|
+
steps: [...steps],
|
|
14
|
+
currentIndex: 0
|
|
15
|
+
});
|
|
16
|
+
this.navigate();
|
|
17
|
+
}
|
|
18
|
+
getCurrentStep() {
|
|
19
|
+
return this.state$.value?.steps[this.state$.value.currentIndex] ?? null;
|
|
20
|
+
}
|
|
21
|
+
getCurrentStep$() {
|
|
22
|
+
return this.state$.pipe(map(state => state ? state.steps[state.currentIndex] : null));
|
|
23
|
+
}
|
|
24
|
+
async next(context) {
|
|
25
|
+
const state = this.state$.value;
|
|
26
|
+
if (!state)
|
|
27
|
+
return;
|
|
28
|
+
const current = state.steps[state.currentIndex];
|
|
29
|
+
if (current.onEnter) {
|
|
30
|
+
const allowed = await current.onEnter(context);
|
|
31
|
+
if (!allowed)
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (state.currentIndex < state.steps.length - 1) {
|
|
35
|
+
this.state$.next({
|
|
36
|
+
...state,
|
|
37
|
+
currentIndex: state.currentIndex + 1
|
|
38
|
+
});
|
|
39
|
+
this.navigate();
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
previous() {
|
|
43
|
+
const state = this.state$.value;
|
|
44
|
+
if (!state)
|
|
45
|
+
return;
|
|
46
|
+
if (state.currentIndex > 0) {
|
|
47
|
+
this.state$.next({
|
|
48
|
+
...state,
|
|
49
|
+
currentIndex: state.currentIndex - 1
|
|
50
|
+
});
|
|
51
|
+
this.navigate();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
isLast() {
|
|
55
|
+
const state = this.state$.value;
|
|
56
|
+
if (!state)
|
|
57
|
+
return false;
|
|
58
|
+
return state.currentIndex === state.steps.length - 1;
|
|
59
|
+
}
|
|
60
|
+
navigate() {
|
|
61
|
+
const step = this.getCurrentStep();
|
|
62
|
+
if (!step)
|
|
63
|
+
return;
|
|
64
|
+
this.router.navigate([`step-${step.slug}`], { relativeTo: this.activatedRoute });
|
|
65
|
+
}
|
|
66
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: WizardStepService, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
67
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: WizardStepService }); }
|
|
68
|
+
}
|
|
69
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: WizardStepService, decorators: [{
|
|
70
|
+
type: Injectable
|
|
71
|
+
}], ctorParameters: () => [{ type: i1.Router }, { type: i1.ActivatedRoute }] });
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XG4gICAgICB0aGlzLnN0YXRlJC5uZXh0KHtcclxuICAgICAgICAuLi5zdGF0ZSxcclxuICAgICAgICBjdXJyZW50SW5kZXg6IHN0YXRlLmN1cnJlbnRJbmRleCAtIDFcclxuICAgICAgfSlcclxuXHJcbiAgICAgIHRoaXMubmF2aWdhdGUoKVxyXG4gICAgfVxyXG4gIH1cclxuXHJcbiAgaXNMYXN0KCk6IGJvb2xlYW4ge1xyXG4gICAgY29uc3Qgc3RhdGUgPSB0aGlzLnN0YXRlJC52YWx1ZVxyXG4gICAgaWYgKCFzdGF0ZSkgcmV0dXJuIGZhbHNlXHJcbiAgICByZXR1cm4gc3RhdGUuY3VycmVudEluZGV4ID09PSBzdGF0ZS5zdGVwcy5sZW5ndGggLSAxXHJcbiAgfVxyXG5cclxuICBwcml2YXRlIG5hdmlnYXRlKCk6IHZvaWQge1xyXG4gICAgY29uc3Qgc3RlcCA9IHRoaXMuZ2V0Q3VycmVudFN0ZXAoKVxyXG4gICAgaWYgKCFzdGVwKSByZXR1cm5cclxuXHJcbiAgICB0aGlzLnJvdXRlci5uYXZpZ2F0ZShcclxuICAgICAgW2BzdGVwLSR7c3RlcC5zbHVnfWBdLFxyXG4gICAgICB7IHJlbGF0aXZlVG86IHRoaXMuYWN0aXZhdGVkUm91dGUgfVxyXG4gICAgKVxyXG4gIH1cclxufVxyXG4iXX0=
|
|
@@ -2,7 +2,7 @@ import * as i0 from '@angular/core';
|
|
|
2
2
|
import { Injectable, Inject, Component } from '@angular/core';
|
|
3
3
|
import * as i2 from '@angular/common';
|
|
4
4
|
import { CommonModule } from '@angular/common';
|
|
5
|
-
import { BehaviorSubject } from 'rxjs';
|
|
5
|
+
import { BehaviorSubject, map } from 'rxjs';
|
|
6
6
|
import * as i1 from '@angular/router';
|
|
7
7
|
|
|
8
8
|
class StepService {
|
|
@@ -241,6 +241,87 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
|
|
|
241
241
|
args: [{ selector: 'step', standalone: true, imports: [CommonModule], template: "<div class=\"form-steps-container\">\r\n\t<ng-container *ngFor=\"let step of steps | async; let i = index;\">\r\n\t\t<div class=\"d-flex flex-column align-items-center\">\r\n\t\t\t<div \r\n\t\t\t\t(click)=\"onStepClick(step)\"\r\n\t\t\t\t[ngClass]=\"{ 'step-complete': step.isComplete, 'step-incomplete': !step.isComplete, 'step-current': (currentStep | async)?.stepIndex === step.stepIndex }\"\r\n\t\t\t\tclass=\"step-bubble cursor-pointer\"\r\n\t\t\t>{{ step.stepIndex }}</div>\r\n\t\t\t<div>\r\n\t\t\t\t<span class=\"text-grey\">{{step.title}}</span>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t<div *ngIf=\"i < (steps | async)?.length - 1\" class=\"step-divider\"></div>\r\n\t</ng-container>\r\n</div>", styles: [".form-steps-container{display:flex;justify-content:space-between;align-items:center;padding:0 32px;margin-bottom:32px}.step-bubble{padding:20px;border:3px solid var(--wp-primaryBlue);width:12px;height:12px;display:flex;justify-content:center;align-items:center;border-radius:50%;color:var(--wp-primaryBlue);font-size:1em;cursor:pointer;-webkit-user-select:none;user-select:none}.step-divider{height:2px;background:var(--wp-primaryBlue);flex:1;margin:0 10px}.step-current,.step-complete{background:var(--wp-primaryBlue);color:#fff}.step-incomplete{cursor:not-allowed;pointer-events:none}\n"] }]
|
|
242
242
|
}], ctorParameters: () => [{ type: StepService }] });
|
|
243
243
|
|
|
244
|
+
class WizardBuilder {
|
|
245
|
+
constructor() {
|
|
246
|
+
this.steps = [];
|
|
247
|
+
}
|
|
248
|
+
addStep(step) {
|
|
249
|
+
this.steps.push(step);
|
|
250
|
+
return this;
|
|
251
|
+
}
|
|
252
|
+
build() {
|
|
253
|
+
return [...this.steps]; // Immutable copy
|
|
254
|
+
}
|
|
255
|
+
}
|
|
256
|
+
|
|
257
|
+
class WizardStepService {
|
|
258
|
+
constructor(router, activatedRoute) {
|
|
259
|
+
this.router = router;
|
|
260
|
+
this.activatedRoute = activatedRoute;
|
|
261
|
+
this.state$ = new BehaviorSubject(null);
|
|
262
|
+
}
|
|
263
|
+
initialize(steps) {
|
|
264
|
+
this.state$.next({
|
|
265
|
+
steps: [...steps],
|
|
266
|
+
currentIndex: 0
|
|
267
|
+
});
|
|
268
|
+
this.navigate();
|
|
269
|
+
}
|
|
270
|
+
getCurrentStep() {
|
|
271
|
+
return this.state$.value?.steps[this.state$.value.currentIndex] ?? null;
|
|
272
|
+
}
|
|
273
|
+
getCurrentStep$() {
|
|
274
|
+
return this.state$.pipe(map(state => state ? state.steps[state.currentIndex] : null));
|
|
275
|
+
}
|
|
276
|
+
async next(context) {
|
|
277
|
+
const state = this.state$.value;
|
|
278
|
+
if (!state)
|
|
279
|
+
return;
|
|
280
|
+
const current = state.steps[state.currentIndex];
|
|
281
|
+
if (current.onEnter) {
|
|
282
|
+
const allowed = await current.onEnter(context);
|
|
283
|
+
if (!allowed)
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
286
|
+
if (state.currentIndex < state.steps.length - 1) {
|
|
287
|
+
this.state$.next({
|
|
288
|
+
...state,
|
|
289
|
+
currentIndex: state.currentIndex + 1
|
|
290
|
+
});
|
|
291
|
+
this.navigate();
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
previous() {
|
|
295
|
+
const state = this.state$.value;
|
|
296
|
+
if (!state)
|
|
297
|
+
return;
|
|
298
|
+
if (state.currentIndex > 0) {
|
|
299
|
+
this.state$.next({
|
|
300
|
+
...state,
|
|
301
|
+
currentIndex: state.currentIndex - 1
|
|
302
|
+
});
|
|
303
|
+
this.navigate();
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
isLast() {
|
|
307
|
+
const state = this.state$.value;
|
|
308
|
+
if (!state)
|
|
309
|
+
return false;
|
|
310
|
+
return state.currentIndex === state.steps.length - 1;
|
|
311
|
+
}
|
|
312
|
+
navigate() {
|
|
313
|
+
const step = this.getCurrentStep();
|
|
314
|
+
if (!step)
|
|
315
|
+
return;
|
|
316
|
+
this.router.navigate([`step-${step.slug}`], { relativeTo: this.activatedRoute });
|
|
317
|
+
}
|
|
318
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: WizardStepService, deps: [{ token: i1.Router }, { token: i1.ActivatedRoute }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
319
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: WizardStepService }); }
|
|
320
|
+
}
|
|
321
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImport: i0, type: WizardStepService, decorators: [{
|
|
322
|
+
type: Injectable
|
|
323
|
+
}], ctorParameters: () => [{ type: i1.Router }, { type: i1.ActivatedRoute }] });
|
|
324
|
+
|
|
244
325
|
/*
|
|
245
326
|
* Public API Surface of windows-plus-utilities
|
|
246
327
|
*/
|
|
@@ -249,5 +330,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "17.3.8", ngImpor
|
|
|
249
330
|
* Generated bundle index. Do not edit.
|
|
250
331
|
*/
|
|
251
332
|
|
|
252
|
-
export { StepComponent, StepService };
|
|
333
|
+
export { StepComponent, StepService, WizardBuilder, WizardStepService };
|
|
253
334
|
//# sourceMappingURL=windows-plus-utilities-modal-wizard.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"windows-plus-utilities-modal-wizard.mjs","sources":["../../../projects/windows-plus-utilities/modal-wizard/util/service/step.service.ts","../../../projects/windows-plus-utilities/modal-wizard/components/step/step.component.ts","../../../projects/windows-plus-utilities/modal-wizard/components/step/step.component.html","../../../projects/windows-plus-utilities/modal-wizard/public-api.ts","../../../projects/windows-plus-utilities/modal-wizard/windows-plus-utilities-modal-wizard.ts"],"sourcesContent":["import { Inject, Injectable } from '@angular/core'\r\nimport { BehaviorSubject, Observable } from 'rxjs'\r\nimport { StepModel } from '../interface/modal-step.interface'\r\nimport { ActivatedRoute, Router } from '@angular/router'\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root'\r\n})\r\nexport class StepService<T> {\r\n\t/**\r\n\t * @description the current index\r\n\t */\r\n\tprivate currentIndex = 0\r\n\t/**\r\n\t * @description the original step configuration\r\n\t */\r\n\toriginalSteps: StepModel<T>[]\r\n\t/**\r\n\t * @description the subject for the modal steps\r\n\t */\r\n\tsteps$: BehaviorSubject<StepModel<T>[]>\r\n\t/**\r\n\t * @description the subject for the current modal step\r\n\t */\r\n\tcurrentStep$: BehaviorSubject<StepModel<T> | null> = new BehaviorSubject<StepModel<T> | null>(null);\r\n\t/**\r\n\t * @description the subject for the step forward availability\r\n\t */\r\n\tstepForwardAvailability$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false)\r\n\t/**\r\n * @author Alex Hodson\r\n * @description class constructor specifying the required services and properties\r\n * @param steps the steps in the modal\r\n */\r\n\tconstructor(\r\n\t\tprivate router: Router,\r\n\t\tprivate activatedRoute: ActivatedRoute,\r\n\t\t@Inject('steps') private stepConfig: StepModel<T>[]\r\n\t) {\r\n\t\tthis.originalSteps = this.buildSteps(stepConfig)\r\n\t\tthis.steps$ = new BehaviorSubject(this.originalSteps)\r\n\t\tthis.currentStep$.next(this.originalSteps[0])\r\n\t}\r\n\tprivate buildSteps(config: Omit<StepModel<T>, 'stepIndex'>[]): StepModel<T>[] {\r\n\t\treturn config.map((step, index) => ({\r\n\t\t\t...step,\r\n\t\t\tstepIndex: index + 1\r\n\t\t}))\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description adjusts the step indexes to be sequential based on their position in the steps array\r\n\t */\r\n\tadjustStepIndexes(): void {\r\n\t\tconst rebuilt = this.steps$.value.map((step, index) => ({\r\n\t\t\t...step,\r\n\t\t\tstepIndex: index + 1\r\n\t\t}))\r\n\r\n\t\tthis.steps$.next(rebuilt)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description inserts a new step at a specific index, specified by the step index property\r\n\t * @param step the step to be inserted\r\n\t */\r\n\tinsertStep(step: StepModel<T>): void {\r\n\t\tconst current = this.steps$.value\r\n\r\n\t\tconst updated = [\r\n\t\t\t...current.slice(0, step.stepIndex - 1),\r\n\t\t\tstep,\r\n\t\t\t...current.slice(step.stepIndex - 1)\r\n\t\t].map((s, index) => ({\r\n\t\t\t...s,\r\n\t\t\tstepIndex: index + 1\r\n\t\t}))\r\n\r\n\t\tthis.steps$.next(updated)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description sets the current modal step\r\n\t * @param step the step to be set\r\n\t */\r\n\tsetCurrentStep(step: StepModel<T>): void {\r\n\t\tthis.currentStep$.next(step)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description returns the current modal step observable\r\n\t * @returns the current modal step observable\r\n\t */\r\n\tgetCurrentStepObservable(): Observable<StepModel<T> | null> {\r\n\t\treturn this.currentStep$.asObservable()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description returns the current modal step observable\r\n\t * @returns the current modal step observable\r\n\t */\r\n\tgetCurrentStep(): StepModel<T> | null {\r\n\t\treturn this.currentStep$.getValue()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description retrieves the current steps\r\n\t * @returns the current steps\r\n\t */\r\n\tgetSteps(): StepModel<T>[] {\r\n\t\treturn this.steps$.getValue()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description returns the modal step observable\r\n\t * @returns the modal step observable\r\n\t */\r\n\tgetStepsObservable(): Observable<StepModel<T>[]> {\r\n\t\treturn this.steps$.asObservable()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description sets the step forward availability\r\n\t * @param available whether a step forward is available\r\n\t */\r\n\tsetStepForwardAvailability(available: boolean): void {\r\n\t\tthis.stepForwardAvailability$.next(available)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description returns the step forward availability observable\r\n\t * @returns the step forward availability observable\r\n\t */\r\n\tgetStepForwardAvailability(): Observable<boolean> {\r\n\t\treturn this.stepForwardAvailability$.asObservable()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description moves to the next modal step\r\n\t */\r\n\tmoveToNextStep(): void {\r\n\t\tif (this.currentIndex < this.steps$.value.length - 1) {\r\n\t\t\tthis.currentIndex++\r\n\t\t\tthis.currentStep$.next(this.steps$.value[this.currentIndex])\r\n\t\t}\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description moves to the previous modal step\r\n\t */\r\n\tmoveToPreviousStep(): void {\r\n\t\tconst previous = this.steps$.getValue()[this.currentIndex - 1]\r\n\r\n\t\tif (!previous) return\r\n\r\n\t\tthis.currentStep$.next({\r\n\t\t\t...previous,\r\n\t\t\t'triggerCallback': false\r\n\t\t})\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description determines whether the current step is the last\r\n\t * @returns whether the step is the last one\r\n\t */\r\n\tisLastStep(): boolean {\r\n\t\treturn this.currentIndex === this.steps$.value.length\r\n\t}\r\n\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description triggers any potential \"after-step\" functionality for the current step and changes the current route with any required parameters\r\n\t * @param getParameterValue the callback which retrieves the value for a step parameter\r\n\t * @param triggerStepCallback the callback which triggers the specific functionality for the specified step index\r\n\t */\r\n\tasync handleStepChange(getParameterValue?: (...args: any) => any, triggerStepCallback?: (...args: any) => Promise<boolean>, revert: boolean = false): Promise<void | null> {\r\n\t\tconst currentStep = this.currentStep$.value\r\n\r\n\t\tif (!currentStep) return\r\n\r\n\t\tconst { stepIndex, triggerCallback } = currentStep\r\n\r\n\t\tif (triggerCallback && triggerStepCallback) {\r\n\t\t\tconst results = await triggerStepCallback(stepIndex)\r\n\r\n\t\t\tif (!results && revert) return this.moveToPreviousStep()\r\n\t\t}\r\n\r\n\t\tthis.handleNavigation(getParameterValue, currentStep)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description handles the modification of the system route which will navigate to the specified step. If no step is provided, then the stored current step is used\r\n\t * @param getParameterValue the callback which retrieves the value for a step parameter\r\n\t * @param step an optional step which will be used to navigate to\r\n\t */\r\n\thandleNavigation(getParameterValue?: (...args: any) => any, step?: StepModel<T>): void {\r\n\t\tconst currentStep = step || this.currentStep$.value\r\n\r\n\t\tif (!currentStep) return\r\n\r\n\t\tconst { slug, parameters } = currentStep\r\n\r\n\t\tlet route = `step-${slug}`\r\n\t\tif (getParameterValue) parameters.forEach((element) => route += `/${getParameterValue(element)}`)\r\n\t\tthis.router.navigate([route], { relativeTo: this.activatedRoute })\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description clears any route paths and/or parameters created during the step functionality, reverting the url back to the original state when the step paths were appended\r\n\t */\r\n\tclearStepRoute(): void {\r\n\t\tconst url = this.router.url\r\n\t\tconst [initial] = url.split('/step-')\r\n\t\tthis.router.navigate([initial])\r\n\t}\r\n}\r\n","import { Component } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Observable } from 'rxjs'\r\nimport { StepModel } from '../../util/interface/modal-step.interface'\r\nimport { StepService } from '../../util/service/step.service'\r\n\r\n@Component({\r\n selector: 'step',\r\n standalone: true,\r\n imports: [CommonModule],\r\n templateUrl: './step.component.html',\r\n styleUrls: ['./step.component.sass']\r\n})\r\nexport class StepComponent {\r\n\t/**\r\n\t * @description an observable to the modal steps\r\n\t */\r\n steps: Observable<StepModel<any>[]>\r\n\t/**\r\n\t * @description an observable to the current step\r\n\t */\r\n currentStep: Observable<StepModel<any>|null>;\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description class constructor specifying the required services and properties\r\n\t * @param stepService the service class which contains access to the modal steps functionality\r\n\t */\r\n constructor(private stepService: StepService<any>) { }\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description the method to be run when the component is rendered\r\n\t */\r\n ngOnInit(): void {\r\n this.steps = this.stepService.getStepsObservable();\r\n this.currentStep = this.stepService.getCurrentStepObservable();\r\n }\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description handles the user clicking a step\r\n\t * @param step the step clicked\r\n\t */\r\n onStepClick(step: StepModel<any>) {\r\n this.stepService.setCurrentStep(step);\r\n }\r\n}\r\n","<div class=\"form-steps-container\">\r\n\t<ng-container *ngFor=\"let step of steps | async; let i = index;\">\r\n\t\t<div class=\"d-flex flex-column align-items-center\">\r\n\t\t\t<div \r\n\t\t\t\t(click)=\"onStepClick(step)\"\r\n\t\t\t\t[ngClass]=\"{ 'step-complete': step.isComplete, 'step-incomplete': !step.isComplete, 'step-current': (currentStep | async)?.stepIndex === step.stepIndex }\"\r\n\t\t\t\tclass=\"step-bubble cursor-pointer\"\r\n\t\t\t>{{ step.stepIndex }}</div>\r\n\t\t\t<div>\r\n\t\t\t\t<span class=\"text-grey\">{{step.title}}</span>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t<div *ngIf=\"i < (steps | async)?.length - 1\" class=\"step-divider\"></div>\r\n\t</ng-container>\r\n</div>","/*\r\n * Public API Surface of windows-plus-utilities\r\n */\r\n\r\nexport * from './components/step/step.component';\r\n\r\nexport * from './util/interface/stepped-modal.interface'\r\nexport * from './util/interface/modal-step.interface'\r\nexport * from './util/service/step.service'","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.StepService"],"mappings":";;;;;;;MAQa,WAAW,CAAA;AAqBvB;;;;AAIE;AACF,IAAA,WAAA,CACS,MAAc,EACd,cAA8B,EACb,UAA0B,EAAA;QAF3C,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAc,CAAA,cAAA,GAAd,cAAc,CAAgB;QACb,IAAU,CAAA,UAAA,GAAV,UAAU,CAAgB;AA5BpD;;AAEG;QACK,IAAY,CAAA,YAAA,GAAG,CAAC,CAAA;AASxB;;AAEG;AACH,QAAA,IAAA,CAAA,YAAY,GAAyC,IAAI,eA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,EAAA,CAAA,MAAA,EAAA,UAAA,EAAA,UAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,CAAA,EAAA,CAAA,CAAA,EAAA;;2FAIX,aAAa,EAAA,UAAA,EAAA,CAAA;kBAPzB,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,MAAM,EACJ,UAAA,EAAA,IAAI,EACP,OAAA,EAAA,CAAC,YAAY,CAAC,EAAA,QAAA,EAAA,4rBAAA,EAAA,MAAA,EAAA,CAAA,8kBAAA,CAAA,EAAA,CAAA;;;AETzB;;AAEG;;ACFH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"windows-plus-utilities-modal-wizard.mjs","sources":["../../../projects/windows-plus-utilities/modal-wizard/util/service/step.service.ts","../../../projects/windows-plus-utilities/modal-wizard/components/step/step.component.ts","../../../projects/windows-plus-utilities/modal-wizard/components/step/step.component.html","../../../projects/windows-plus-utilities/modal-wizard/util/helper/wizard-builder.service.ts","../../../projects/windows-plus-utilities/modal-wizard/util/service/wizard-step.service.ts","../../../projects/windows-plus-utilities/modal-wizard/public-api.ts","../../../projects/windows-plus-utilities/modal-wizard/windows-plus-utilities-modal-wizard.ts"],"sourcesContent":["import { Inject, Injectable } from '@angular/core'\r\nimport { BehaviorSubject, Observable } from 'rxjs'\r\nimport { StepModel } from '../interface/modal-step.interface'\r\nimport { ActivatedRoute, Router } from '@angular/router'\r\n\r\n@Injectable({\r\n\tprovidedIn: 'root'\r\n})\r\nexport class StepService<T> {\r\n\t/**\r\n\t * @description the current index\r\n\t */\r\n\tprivate currentIndex = 0\r\n\t/**\r\n\t * @description the original step configuration\r\n\t */\r\n\toriginalSteps: StepModel<T>[]\r\n\t/**\r\n\t * @description the subject for the modal steps\r\n\t */\r\n\tsteps$: BehaviorSubject<StepModel<T>[]>\r\n\t/**\r\n\t * @description the subject for the current modal step\r\n\t */\r\n\tcurrentStep$: BehaviorSubject<StepModel<T> | null> = new BehaviorSubject<StepModel<T> | null>(null);\r\n\t/**\r\n\t * @description the subject for the step forward availability\r\n\t */\r\n\tstepForwardAvailability$: BehaviorSubject<boolean> = new BehaviorSubject<boolean>(false)\r\n\t/**\r\n * @author Alex Hodson\r\n * @description class constructor specifying the required services and properties\r\n * @param steps the steps in the modal\r\n */\r\n\tconstructor(\r\n\t\tprivate router: Router,\r\n\t\tprivate activatedRoute: ActivatedRoute,\r\n\t\t@Inject('steps') private stepConfig: StepModel<T>[]\r\n\t) {\r\n\t\tthis.originalSteps = this.buildSteps(stepConfig)\r\n\t\tthis.steps$ = new BehaviorSubject(this.originalSteps)\r\n\t\tthis.currentStep$.next(this.originalSteps[0])\r\n\t}\r\n\tprivate buildSteps(config: Omit<StepModel<T>, 'stepIndex'>[]): StepModel<T>[] {\r\n\t\treturn config.map((step, index) => ({\r\n\t\t\t...step,\r\n\t\t\tstepIndex: index + 1\r\n\t\t}))\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description adjusts the step indexes to be sequential based on their position in the steps array\r\n\t */\r\n\tadjustStepIndexes(): void {\r\n\t\tconst rebuilt = this.steps$.value.map((step, index) => ({\r\n\t\t\t...step,\r\n\t\t\tstepIndex: index + 1\r\n\t\t}))\r\n\r\n\t\tthis.steps$.next(rebuilt)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description inserts a new step at a specific index, specified by the step index property\r\n\t * @param step the step to be inserted\r\n\t */\r\n\tinsertStep(step: StepModel<T>): void {\r\n\t\tconst current = this.steps$.value\r\n\r\n\t\tconst updated = [\r\n\t\t\t...current.slice(0, step.stepIndex - 1),\r\n\t\t\tstep,\r\n\t\t\t...current.slice(step.stepIndex - 1)\r\n\t\t].map((s, index) => ({\r\n\t\t\t...s,\r\n\t\t\tstepIndex: index + 1\r\n\t\t}))\r\n\r\n\t\tthis.steps$.next(updated)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description sets the current modal step\r\n\t * @param step the step to be set\r\n\t */\r\n\tsetCurrentStep(step: StepModel<T>): void {\r\n\t\tthis.currentStep$.next(step)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description returns the current modal step observable\r\n\t * @returns the current modal step observable\r\n\t */\r\n\tgetCurrentStepObservable(): Observable<StepModel<T> | null> {\r\n\t\treturn this.currentStep$.asObservable()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description returns the current modal step observable\r\n\t * @returns the current modal step observable\r\n\t */\r\n\tgetCurrentStep(): StepModel<T> | null {\r\n\t\treturn this.currentStep$.getValue()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description retrieves the current steps\r\n\t * @returns the current steps\r\n\t */\r\n\tgetSteps(): StepModel<T>[] {\r\n\t\treturn this.steps$.getValue()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description returns the modal step observable\r\n\t * @returns the modal step observable\r\n\t */\r\n\tgetStepsObservable(): Observable<StepModel<T>[]> {\r\n\t\treturn this.steps$.asObservable()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description sets the step forward availability\r\n\t * @param available whether a step forward is available\r\n\t */\r\n\tsetStepForwardAvailability(available: boolean): void {\r\n\t\tthis.stepForwardAvailability$.next(available)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description returns the step forward availability observable\r\n\t * @returns the step forward availability observable\r\n\t */\r\n\tgetStepForwardAvailability(): Observable<boolean> {\r\n\t\treturn this.stepForwardAvailability$.asObservable()\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description moves to the next modal step\r\n\t */\r\n\tmoveToNextStep(): void {\r\n\t\tif (this.currentIndex < this.steps$.value.length - 1) {\r\n\t\t\tthis.currentIndex++\r\n\t\t\tthis.currentStep$.next(this.steps$.value[this.currentIndex])\r\n\t\t}\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description moves to the previous modal step\r\n\t */\r\n\tmoveToPreviousStep(): void {\r\n\t\tconst previous = this.steps$.getValue()[this.currentIndex - 1]\r\n\r\n\t\tif (!previous) return\r\n\r\n\t\tthis.currentStep$.next({\r\n\t\t\t...previous,\r\n\t\t\t'triggerCallback': false\r\n\t\t})\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description determines whether the current step is the last\r\n\t * @returns whether the step is the last one\r\n\t */\r\n\tisLastStep(): boolean {\r\n\t\treturn this.currentIndex === this.steps$.value.length\r\n\t}\r\n\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description triggers any potential \"after-step\" functionality for the current step and changes the current route with any required parameters\r\n\t * @param getParameterValue the callback which retrieves the value for a step parameter\r\n\t * @param triggerStepCallback the callback which triggers the specific functionality for the specified step index\r\n\t */\r\n\tasync handleStepChange(getParameterValue?: (...args: any) => any, triggerStepCallback?: (...args: any) => Promise<boolean>, revert: boolean = false): Promise<void | null> {\r\n\t\tconst currentStep = this.currentStep$.value\r\n\r\n\t\tif (!currentStep) return\r\n\r\n\t\tconst { stepIndex, triggerCallback } = currentStep\r\n\r\n\t\tif (triggerCallback && triggerStepCallback) {\r\n\t\t\tconst results = await triggerStepCallback(stepIndex)\r\n\r\n\t\t\tif (!results && revert) return this.moveToPreviousStep()\r\n\t\t}\r\n\r\n\t\tthis.handleNavigation(getParameterValue, currentStep)\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description handles the modification of the system route which will navigate to the specified step. If no step is provided, then the stored current step is used\r\n\t * @param getParameterValue the callback which retrieves the value for a step parameter\r\n\t * @param step an optional step which will be used to navigate to\r\n\t */\r\n\thandleNavigation(getParameterValue?: (...args: any) => any, step?: StepModel<T>): void {\r\n\t\tconst currentStep = step || this.currentStep$.value\r\n\r\n\t\tif (!currentStep) return\r\n\r\n\t\tconst { slug, parameters } = currentStep\r\n\r\n\t\tlet route = `step-${slug}`\r\n\t\tif (getParameterValue) parameters.forEach((element) => route += `/${getParameterValue(element)}`)\r\n\t\tthis.router.navigate([route], { relativeTo: this.activatedRoute })\r\n\t}\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description clears any route paths and/or parameters created during the step functionality, reverting the url back to the original state when the step paths were appended\r\n\t */\r\n\tclearStepRoute(): void {\r\n\t\tconst url = this.router.url\r\n\t\tconst [initial] = url.split('/step-')\r\n\t\tthis.router.navigate([initial])\r\n\t}\r\n}\r\n","import { Component } from '@angular/core';\r\nimport { CommonModule } from '@angular/common';\r\nimport { Observable } from 'rxjs'\r\nimport { StepModel } from '../../util/interface/modal-step.interface'\r\nimport { StepService } from '../../util/service/step.service'\r\n\r\n@Component({\r\n selector: 'step',\r\n standalone: true,\r\n imports: [CommonModule],\r\n templateUrl: './step.component.html',\r\n styleUrls: ['./step.component.sass']\r\n})\r\nexport class StepComponent {\r\n\t/**\r\n\t * @description an observable to the modal steps\r\n\t */\r\n steps: Observable<StepModel<any>[]>\r\n\t/**\r\n\t * @description an observable to the current step\r\n\t */\r\n currentStep: Observable<StepModel<any>|null>;\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description class constructor specifying the required services and properties\r\n\t * @param stepService the service class which contains access to the modal steps functionality\r\n\t */\r\n constructor(private stepService: StepService<any>) { }\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description the method to be run when the component is rendered\r\n\t */\r\n ngOnInit(): void {\r\n this.steps = this.stepService.getStepsObservable();\r\n this.currentStep = this.stepService.getCurrentStepObservable();\r\n }\r\n\t/**\r\n\t * @author Alex Hodson\r\n\t * @description handles the user clicking a step\r\n\t * @param step the step clicked\r\n\t */\r\n onStepClick(step: StepModel<any>) {\r\n this.stepService.setCurrentStep(step);\r\n }\r\n}\r\n","<div class=\"form-steps-container\">\r\n\t<ng-container *ngFor=\"let step of steps | async; let i = index;\">\r\n\t\t<div class=\"d-flex flex-column align-items-center\">\r\n\t\t\t<div \r\n\t\t\t\t(click)=\"onStepClick(step)\"\r\n\t\t\t\t[ngClass]=\"{ 'step-complete': step.isComplete, 'step-incomplete': !step.isComplete, 'step-current': (currentStep | async)?.stepIndex === step.stepIndex }\"\r\n\t\t\t\tclass=\"step-bubble cursor-pointer\"\r\n\t\t\t>{{ step.stepIndex }}</div>\r\n\t\t\t<div>\r\n\t\t\t\t<span class=\"text-grey\">{{step.title}}</span>\r\n\t\t\t</div>\r\n\t\t</div>\r\n\t\t<div *ngIf=\"i < (steps | async)?.length - 1\" class=\"step-divider\"></div>\r\n\t</ng-container>\r\n</div>","import { StepModel } from '../interface/modal-step.interface'\r\n\r\nexport class WizardBuilder<T> {\r\n\tprivate steps: StepModel<T>[] = []\r\n\r\n\taddStep(step: StepModel<T>): WizardBuilder<T> {\r\n\t\tthis.steps.push(step)\r\n\r\n\t\treturn this\r\n\t}\r\n\r\n\tbuild(): StepModel<T>[] {\r\n\t\treturn [...this.steps] // Immutable copy\r\n\t}\r\n}","import { Injectable } from '@angular/core'\r\nimport { Router, ActivatedRoute } from '@angular/router'\r\nimport { BehaviorSubject, Observable, map } from 'rxjs'\r\nimport { StepDefinition } from '../interface/step-definition.interface'\r\nimport { WizardState } from '../interface/wizard-state.interface'\r\n\r\n@Injectable()\r\nexport class WizardStepService<T> {\r\n\r\n private state$ = new BehaviorSubject<WizardState<T> | null>(null)\r\n\r\n constructor(\r\n private router: Router,\r\n private activatedRoute: ActivatedRoute\r\n ) {}\r\n\r\n initialize(steps: StepDefinition<T>[]): void {\r\n this.state$.next({\r\n steps: [...steps],\r\n currentIndex: 0\r\n })\r\n\r\n this.navigate()\r\n }\r\n\r\n getCurrentStep(): StepDefinition<T> | null {\r\n return this.state$.value?.steps[this.state$.value.currentIndex] ?? null\r\n }\r\n\r\n getCurrentStep$(): Observable<StepDefinition<T> | null> {\r\n return this.state$.pipe(\r\n map(state =>\r\n state ? state.steps[state.currentIndex] : null\r\n )\r\n )\r\n }\r\n\r\n async next(context?: any): Promise<void> {\r\n const state = this.state$.value\r\n if (!state) return\r\n\r\n const current = state.steps[state.currentIndex]\r\n\r\n if (current.onEnter) {\r\n const allowed = await current.onEnter(context)\r\n if (!allowed) return\r\n }\r\n\r\n if (state.currentIndex < state.steps.length - 1) {\r\n this.state$.next({\r\n ...state,\r\n currentIndex: state.currentIndex + 1\r\n })\r\n\r\n this.navigate()\r\n }\r\n }\r\n\r\n previous(): void {\r\n const state = this.state$.value\r\n if (!state) return\r\n\r\n if (state.currentIndex > 0) {\r\n this.state$.next({\r\n ...state,\r\n currentIndex: state.currentIndex - 1\r\n })\r\n\r\n this.navigate()\r\n }\r\n }\r\n\r\n isLast(): boolean {\r\n const state = this.state$.value\r\n if (!state) return false\r\n return state.currentIndex === state.steps.length - 1\r\n }\r\n\r\n private navigate(): void {\r\n const step = this.getCurrentStep()\r\n if (!step) return\r\n\r\n this.router.navigate(\r\n [`step-${step.slug}`],\r\n { relativeTo: this.activatedRoute }\r\n )\r\n }\r\n}\r\n","/*\r\n * Public API Surface of windows-plus-utilities\r\n */\r\nexport * from './components/step/step.component';\r\n\r\nexport * from './util/helper/wizard-builder.service'\r\n\r\nexport * from './util/interface/modal-step.interface'\r\nexport * from './util/interface/step-definition.interface'\r\nexport * from './util/interface/stepped-modal.interface'\r\nexport * from './util/interface/wizard-state.interface'\r\n\r\nexport * from './util/service/wizard-step.service'\r\nexport * from './util/service/step.service'","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1.StepService"],"mappings":";;;;;;;MAQa,WAAW,CAAA;AAqBvB;;;;AAIE;AACF,IAAA,WAAA,CACS,MAAc,EACd,cAA8B,EACb,UAA0B,EAAA;QAF3C,IAAM,CAAA,MAAA,GAAN,MAAM,CAAQ;QACd,IAAc,CAAA,cAAA,GAAd,cAAc,CAAgB;QACb,IAAU,CAAA,UAAA,GAAV,UAAU,CAAgB;AA5BpD;;AAEG;QACK,IAAY,CAAA,YAAA,GAAG,CAAC,CAAA;AASxB;;AAEG;AACH,QAAA,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AM,CAAC,IAAI,CAAC;AACf,gBAAA,GAAG,KAAK;AACR,gBAAA,YAAY,EAAE,KAAK,CAAC,YAAY,GAAG,CAAC;AACrC,aAAA,CAAC,CAAA;YAEF,IAAI,CAAC,QAAQ,EAAE,CAAA;SAChB;KACF;IAED,MAAM,GAAA;AACJ,QAAA,MAAM,KAAK,GAAG,IAAI,CAAC,MAAM,CAAC,KAAK,CAAA;AAC/B,QAAA,IAAI,CAAC,KAAK;AAAE,YAAA,OAAO,KAAK,CAAA;QACxB,OAAO,KAAK,CAAC,YAAY,KAAK,KAAK,CAAC,KAAK,CAAC,MAAM,GAAG,CAAC,CAAA;KACrD;IAEO,QAAQ,GAAA;AACd,QAAA,MAAM,IAAI,GAAG,IAAI,CAAC,cAAc,EAAE,CAAA;AAClC,QAAA,IAAI,CAAC,IAAI;YAAE,OAAM;QAEjB,IAAI,CAAC,MAAM,CAAC,QAAQ,CAClB,CAAC,CAAA,KAAA,EAAQ,IAAI,CAAC,IAAI,EAAE,CAAC,EACrB,EAAE,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,CACpC,CAAA;KACF;8GA/EU,iBAAiB,EAAA,IAAA,EAAA,CAAA,EAAA,KAAA,EAAA,EAAA,CAAA,MAAA,EAAA,EAAA,EAAA,KAAA,EAAA,EAAA,CAAA,cAAA,EAAA,CAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,UAAA,EAAA,CAAA,CAAA,EAAA;kHAAjB,iBAAiB,EAAA,CAAA,CAAA,EAAA;;2FAAjB,iBAAiB,EAAA,UAAA,EAAA,CAAA;kBAD7B,UAAU;;;ACNX;;AAEG;;ACFH;;AAEG;;;;"}
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export * from './components/step/step.component';
|
|
2
|
-
export * from './util/
|
|
2
|
+
export * from './util/helper/wizard-builder.service';
|
|
3
3
|
export * from './util/interface/modal-step.interface';
|
|
4
|
+
export * from './util/interface/step-definition.interface';
|
|
5
|
+
export * from './util/interface/stepped-modal.interface';
|
|
6
|
+
export * from './util/interface/wizard-state.interface';
|
|
7
|
+
export * from './util/service/wizard-step.service';
|
|
4
8
|
export * from './util/service/step.service';
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Router, ActivatedRoute } from '@angular/router';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { StepDefinition } from '../interface/step-definition.interface';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class WizardStepService<T> {
|
|
6
|
+
private router;
|
|
7
|
+
private activatedRoute;
|
|
8
|
+
private state$;
|
|
9
|
+
constructor(router: Router, activatedRoute: ActivatedRoute);
|
|
10
|
+
initialize(steps: StepDefinition<T>[]): void;
|
|
11
|
+
getCurrentStep(): StepDefinition<T> | null;
|
|
12
|
+
getCurrentStep$(): Observable<StepDefinition<T> | null>;
|
|
13
|
+
next(context?: any): Promise<void>;
|
|
14
|
+
previous(): void;
|
|
15
|
+
isLast(): boolean;
|
|
16
|
+
private navigate;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<WizardStepService<any>, never>;
|
|
18
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<WizardStepService<any>>;
|
|
19
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "windows-plus-utilities",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.83",
|
|
4
4
|
"peerDependencies": {
|
|
5
5
|
"@angular/common": "^17.3.8",
|
|
6
6
|
"@angular/core": "^17.3.8",
|
|
@@ -31,23 +31,17 @@
|
|
|
31
31
|
"esm": "./esm2022/context-menu/windows-plus-utilities-context-menu.mjs",
|
|
32
32
|
"default": "./fesm2022/windows-plus-utilities-context-menu.mjs"
|
|
33
33
|
},
|
|
34
|
-
"./empty-display": {
|
|
35
|
-
"types": "./empty-display/index.d.ts",
|
|
36
|
-
"esm2022": "./esm2022/empty-display/windows-plus-utilities-empty-display.mjs",
|
|
37
|
-
"esm": "./esm2022/empty-display/windows-plus-utilities-empty-display.mjs",
|
|
38
|
-
"default": "./fesm2022/windows-plus-utilities-empty-display.mjs"
|
|
39
|
-
},
|
|
40
34
|
"./custom-card": {
|
|
41
35
|
"types": "./custom-card/index.d.ts",
|
|
42
36
|
"esm2022": "./esm2022/custom-card/windows-plus-utilities-custom-card.mjs",
|
|
43
37
|
"esm": "./esm2022/custom-card/windows-plus-utilities-custom-card.mjs",
|
|
44
38
|
"default": "./fesm2022/windows-plus-utilities-custom-card.mjs"
|
|
45
39
|
},
|
|
46
|
-
"./
|
|
47
|
-
"types": "./
|
|
48
|
-
"esm2022": "./esm2022/
|
|
49
|
-
"esm": "./esm2022/
|
|
50
|
-
"default": "./fesm2022/windows-plus-utilities-
|
|
40
|
+
"./empty-display": {
|
|
41
|
+
"types": "./empty-display/index.d.ts",
|
|
42
|
+
"esm2022": "./esm2022/empty-display/windows-plus-utilities-empty-display.mjs",
|
|
43
|
+
"esm": "./esm2022/empty-display/windows-plus-utilities-empty-display.mjs",
|
|
44
|
+
"default": "./fesm2022/windows-plus-utilities-empty-display.mjs"
|
|
51
45
|
},
|
|
52
46
|
"./main-menu": {
|
|
53
47
|
"types": "./main-menu/index.d.ts",
|
|
@@ -55,6 +49,12 @@
|
|
|
55
49
|
"esm": "./esm2022/main-menu/windows-plus-utilities-main-menu.mjs",
|
|
56
50
|
"default": "./fesm2022/windows-plus-utilities-main-menu.mjs"
|
|
57
51
|
},
|
|
52
|
+
"./job-label": {
|
|
53
|
+
"types": "./job-label/index.d.ts",
|
|
54
|
+
"esm2022": "./esm2022/job-label/windows-plus-utilities-job-label.mjs",
|
|
55
|
+
"esm": "./esm2022/job-label/windows-plus-utilities-job-label.mjs",
|
|
56
|
+
"default": "./fesm2022/windows-plus-utilities-job-label.mjs"
|
|
57
|
+
},
|
|
58
58
|
"./modal-wizard": {
|
|
59
59
|
"types": "./modal-wizard/index.d.ts",
|
|
60
60
|
"esm2022": "./esm2022/modal-wizard/windows-plus-utilities-modal-wizard.mjs",
|