@skyux/progress-indicator 8.7.2 → 9.0.0-alpha.1
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/documentation.json +62 -62
- package/esm2022/lib/modules/progress-indicator/progress-indicator-item/progress-indicator-item.component.mjs +111 -0
- package/{esm2020 → esm2022}/lib/modules/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button-class.pipe.mjs +4 -4
- package/{esm2020 → esm2022}/lib/modules/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button-disabled.pipe.mjs +4 -4
- package/esm2022/lib/modules/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button.component.mjs +200 -0
- package/esm2022/lib/modules/progress-indicator/progress-indicator-reset-button/progress-indicator-reset-button.component.mjs +56 -0
- package/{esm2020 → esm2022}/lib/modules/progress-indicator/progress-indicator-status-marker/progress-indicator-status-marker-class.pipe.mjs +4 -4
- package/esm2022/lib/modules/progress-indicator/progress-indicator-status-marker/progress-indicator-status-marker.component.mjs +62 -0
- package/{esm2020 → esm2022}/lib/modules/progress-indicator/progress-indicator-title/progress-indicator-title.component.mjs +4 -4
- package/esm2022/lib/modules/progress-indicator/progress-indicator.component.mjs +330 -0
- package/{esm2020 → esm2022}/lib/modules/progress-indicator/progress-indicator.module.mjs +27 -27
- package/esm2022/lib/modules/shared/sky-progress-indicator-resources.module.mjs +50 -0
- package/fesm2022/skyux-progress-indicator.mjs +1006 -0
- package/{fesm2020 → fesm2022}/skyux-progress-indicator.mjs.map +1 -1
- package/lib/modules/progress-indicator/progress-indicator-item/progress-indicator-item.component.d.ts +1 -1
- package/lib/modules/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button.component.d.ts +1 -1
- package/lib/modules/progress-indicator/progress-indicator-reset-button/progress-indicator-reset-button.component.d.ts +1 -1
- package/lib/modules/progress-indicator/progress-indicator-status-marker/progress-indicator-status-marker.component.d.ts +1 -1
- package/lib/modules/progress-indicator/progress-indicator.component.d.ts +1 -1
- package/package.json +11 -17
- package/esm2020/lib/modules/progress-indicator/progress-indicator-item/progress-indicator-item.component.mjs +0 -110
- package/esm2020/lib/modules/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button.component.mjs +0 -200
- package/esm2020/lib/modules/progress-indicator/progress-indicator-reset-button/progress-indicator-reset-button.component.mjs +0 -59
- package/esm2020/lib/modules/progress-indicator/progress-indicator-status-marker/progress-indicator-status-marker.component.mjs +0 -62
- package/esm2020/lib/modules/progress-indicator/progress-indicator.component.mjs +0 -312
- package/esm2020/lib/modules/shared/sky-progress-indicator-resources.module.mjs +0 -50
- package/fesm2015/skyux-progress-indicator.mjs +0 -995
- package/fesm2015/skyux-progress-indicator.mjs.map +0 -1
- package/fesm2020/skyux-progress-indicator.mjs +0 -986
- /package/{esm2020 → esm2022}/index.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/progress-indicator/types/progress-indicator-action-click-args.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/progress-indicator/types/progress-indicator-action-click-progress-handler.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/progress-indicator/types/progress-indicator-change.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/progress-indicator/types/progress-indicator-display-mode-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/progress-indicator/types/progress-indicator-item-status.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/progress-indicator/types/progress-indicator-message-type.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/progress-indicator/types/progress-indicator-message.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/progress-indicator/types/progress-indicator-mode.mjs +0 -0
- /package/{esm2020 → esm2022}/lib/modules/progress-indicator/types/progress-indicator-nav-button-type.mjs +0 -0
- /package/{esm2020 → esm2022}/skyux-progress-indicator.mjs +0 -0
|
@@ -0,0 +1,1006 @@
|
|
|
1
|
+
import * as i2 from '@angular/common';
|
|
2
|
+
import { CommonModule } from '@angular/common';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { NgModule, Pipe, Component, ChangeDetectionStrategy, Optional, Input, EventEmitter, Output, ContentChildren } from '@angular/core';
|
|
5
|
+
import * as i1$1 from '@skyux/core';
|
|
6
|
+
import { SkyTrimModule } from '@skyux/core';
|
|
7
|
+
import * as i3$1 from '@skyux/i18n';
|
|
8
|
+
import { getLibStringForLocale, SkyI18nModule, SKY_LIB_RESOURCES_PROVIDERS } from '@skyux/i18n';
|
|
9
|
+
import * as i3 from '@skyux/indicators';
|
|
10
|
+
import { SkyIconModule } from '@skyux/indicators';
|
|
11
|
+
import * as i1 from '@skyux/theme';
|
|
12
|
+
import { SkyThemeModule } from '@skyux/theme';
|
|
13
|
+
import { Subject } from 'rxjs';
|
|
14
|
+
import { takeUntil, delay, distinctUntilChanged } from 'rxjs/operators';
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* NOTICE: DO NOT MODIFY THIS FILE!
|
|
18
|
+
* The contents of this file were automatically generated by
|
|
19
|
+
* the 'ng generate @skyux/i18n:lib-resources-module lib/modules/shared/sky-progress-indicator' schematic.
|
|
20
|
+
* To update this file, simply rerun the command.
|
|
21
|
+
*/
|
|
22
|
+
const RESOURCES = {
|
|
23
|
+
'EN-US': {
|
|
24
|
+
skyux_progress_indicator_navigator_finish: { message: 'Finish' },
|
|
25
|
+
skyux_progress_indicator_navigator_next: { message: 'Next' },
|
|
26
|
+
skyux_progress_indicator_navigator_previous: { message: 'Previous' },
|
|
27
|
+
skyux_progress_indicator_navigator_reset: { message: 'Reset' },
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
class SkyProgressIndicatorResourcesProvider {
|
|
31
|
+
getString(localeInfo, name) {
|
|
32
|
+
return getLibStringForLocale(RESOURCES, localeInfo.locale, name);
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Import into any component library module that needs to use resource strings.
|
|
37
|
+
*/
|
|
38
|
+
class SkyProgressIndicatorResourcesModule {
|
|
39
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorResourcesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
40
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorResourcesModule, exports: [SkyI18nModule] }); }
|
|
41
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorResourcesModule, providers: [
|
|
42
|
+
{
|
|
43
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
44
|
+
useClass: SkyProgressIndicatorResourcesProvider,
|
|
45
|
+
multi: true,
|
|
46
|
+
},
|
|
47
|
+
], imports: [SkyI18nModule] }); }
|
|
48
|
+
}
|
|
49
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorResourcesModule, decorators: [{
|
|
50
|
+
type: NgModule,
|
|
51
|
+
args: [{
|
|
52
|
+
exports: [SkyI18nModule],
|
|
53
|
+
providers: [
|
|
54
|
+
{
|
|
55
|
+
provide: SKY_LIB_RESOURCES_PROVIDERS,
|
|
56
|
+
useClass: SkyProgressIndicatorResourcesProvider,
|
|
57
|
+
multi: true,
|
|
58
|
+
},
|
|
59
|
+
],
|
|
60
|
+
}]
|
|
61
|
+
}] });
|
|
62
|
+
|
|
63
|
+
var SkyProgressIndicatorItemStatus;
|
|
64
|
+
(function (SkyProgressIndicatorItemStatus) {
|
|
65
|
+
/**
|
|
66
|
+
* The item is active.
|
|
67
|
+
*/
|
|
68
|
+
SkyProgressIndicatorItemStatus[SkyProgressIndicatorItemStatus["Active"] = 0] = "Active";
|
|
69
|
+
/**
|
|
70
|
+
* The item is complete.
|
|
71
|
+
*/
|
|
72
|
+
SkyProgressIndicatorItemStatus[SkyProgressIndicatorItemStatus["Complete"] = 1] = "Complete";
|
|
73
|
+
/**
|
|
74
|
+
* The item is incomplete.
|
|
75
|
+
*/
|
|
76
|
+
SkyProgressIndicatorItemStatus[SkyProgressIndicatorItemStatus["Incomplete"] = 2] = "Incomplete";
|
|
77
|
+
/**
|
|
78
|
+
* The item is pending.
|
|
79
|
+
*/
|
|
80
|
+
SkyProgressIndicatorItemStatus[SkyProgressIndicatorItemStatus["Pending"] = 3] = "Pending";
|
|
81
|
+
})(SkyProgressIndicatorItemStatus || (SkyProgressIndicatorItemStatus = {}));
|
|
82
|
+
|
|
83
|
+
class SkyProgressIndicatorMarkerClassPipe {
|
|
84
|
+
transform(displayMode, status) {
|
|
85
|
+
let statusName;
|
|
86
|
+
switch (status) {
|
|
87
|
+
case SkyProgressIndicatorItemStatus.Complete:
|
|
88
|
+
statusName = 'complete';
|
|
89
|
+
break;
|
|
90
|
+
case SkyProgressIndicatorItemStatus.Incomplete:
|
|
91
|
+
statusName = 'incomplete';
|
|
92
|
+
break;
|
|
93
|
+
case SkyProgressIndicatorItemStatus.Pending:
|
|
94
|
+
statusName = 'pending';
|
|
95
|
+
break;
|
|
96
|
+
default:
|
|
97
|
+
statusName = 'active';
|
|
98
|
+
}
|
|
99
|
+
return `sky-progress-indicator-status-marker-mode-${displayMode} sky-progress-indicator-status-marker-status-${statusName}`;
|
|
100
|
+
}
|
|
101
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorMarkerClassPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
102
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorMarkerClassPipe, name: "skyProgressIndicatorMarkerClass" }); }
|
|
103
|
+
}
|
|
104
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorMarkerClassPipe, decorators: [{
|
|
105
|
+
type: Pipe,
|
|
106
|
+
args: [{
|
|
107
|
+
name: 'skyProgressIndicatorMarkerClass',
|
|
108
|
+
}]
|
|
109
|
+
}] });
|
|
110
|
+
|
|
111
|
+
/**
|
|
112
|
+
* Specifies the content to display in the status marker.
|
|
113
|
+
* @internal
|
|
114
|
+
*/
|
|
115
|
+
class SkyProgressIndicatorStatusMarkerComponent {
|
|
116
|
+
set displayMode(value) {
|
|
117
|
+
this.#_displayMode = value;
|
|
118
|
+
}
|
|
119
|
+
get displayMode() {
|
|
120
|
+
return this.#_displayMode;
|
|
121
|
+
}
|
|
122
|
+
set status(value) {
|
|
123
|
+
this.#_status = value;
|
|
124
|
+
this.isComplete = this.#_status === SkyProgressIndicatorItemStatus.Complete;
|
|
125
|
+
}
|
|
126
|
+
get status() {
|
|
127
|
+
return this.#_status;
|
|
128
|
+
}
|
|
129
|
+
#ngUnsubscribe;
|
|
130
|
+
#changeDetector;
|
|
131
|
+
#_status;
|
|
132
|
+
#_displayMode;
|
|
133
|
+
constructor(changeDetector, themeSvc) {
|
|
134
|
+
this.isComplete = false;
|
|
135
|
+
this.#ngUnsubscribe = new Subject();
|
|
136
|
+
this.#_status = SkyProgressIndicatorItemStatus.Active;
|
|
137
|
+
this.#_displayMode = 'vertical';
|
|
138
|
+
this.#changeDetector = changeDetector;
|
|
139
|
+
// Update icons when theme changes.
|
|
140
|
+
themeSvc?.settingsChange
|
|
141
|
+
.pipe(takeUntil(this.#ngUnsubscribe))
|
|
142
|
+
.subscribe(() => {
|
|
143
|
+
this.#changeDetector.markForCheck();
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
ngOnDestroy() {
|
|
147
|
+
this.#ngUnsubscribe.next();
|
|
148
|
+
this.#ngUnsubscribe.complete();
|
|
149
|
+
}
|
|
150
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorStatusMarkerComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.SkyThemeService, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
151
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyProgressIndicatorStatusMarkerComponent, selector: "sky-progress-indicator-status-marker", inputs: { displayMode: "displayMode", status: "status" }, ngImport: i0, template: "<div\n class=\"sky-progress-indicator-status-marker\"\n role=\"presentation\"\n [ngClass]=\"displayMode | skyProgressIndicatorMarkerClass : status\"\n>\n <div\n *skyThemeIf=\"'default'\"\n class=\"sky-progress-indicator-status-marker-icon\"\n >\n <sky-icon *ngIf=\"isComplete\" icon=\"check\"></sky-icon>\n </div>\n <div *skyThemeIf=\"'modern'\" class=\"sky-progress-indicator-status-marker-icon\">\n <sky-icon *ngIf=\"isComplete\" icon=\"check\" iconType=\"skyux\"></sky-icon>\n </div>\n <div class=\"sky-progress-indicator-status-marker-line\"></div>\n</div>\n", styles: [".sky-progress-indicator-status-marker{display:flex;height:100%}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical{flex-basis:15px;flex-grow:0;flex-direction:column;margin-right:15px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-icon{margin-top:1px;width:15px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-icon>::ng-deep sky-icon{margin-left:-1px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-line{margin:0 auto;width:1px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal{flex-direction:row;width:100%;padding-left:5px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal .sky-progress-indicator-status-marker-icon{height:15px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal .sky-progress-indicator-status-marker-line{margin:auto 0;height:1px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-complete .sky-progress-indicator-status-marker-icon{border:0;margin-right:5px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-active .sky-progress-indicator-status-marker-icon{position:relative}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-active .sky-progress-indicator-status-marker-icon:before{content:\"\";display:block;width:5px;height:1px;background-color:#5a9936;position:absolute;left:-7px;top:5px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-incomplete .sky-progress-indicator-status-marker-icon{position:relative}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-incomplete .sky-progress-indicator-status-marker-icon:before{content:\"\";display:block;width:5px;height:1px;background-color:#cdcfd2;position:absolute;left:-7px;top:5px}.sky-progress-indicator-status-marker-icon{border-radius:15px;border:2px solid #cdcfd2;flex:0 0 15px}.sky-progress-indicator-status-marker-line{background-color:#cdcfd2;flex:1 0 auto}.sky-progress-indicator-status-marker-status-active .sky-progress-indicator-status-marker-icon{background-color:#5a9936;border-color:transparent}.sky-progress-indicator-status-marker-status-pending .sky-progress-indicator-status-marker-icon{border-color:#5a9936}.sky-progress-indicator-status-marker-status-complete .sky-progress-indicator-status-marker-icon{border-color:transparent;color:#5a9936;margin-top:0}.sky-progress-indicator-status-marker-status-complete .sky-progress-indicator-status-marker-icon>::ng-deep sky-icon{display:inline-flex;vertical-align:top}.sky-progress-indicator-status-marker-status-complete .sky-progress-indicator-status-marker-line{background-color:#5a9936}:host-context(.sky-theme-modern) .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical{position:relative;top:3px;margin-right:20px}:host-context(.sky-theme-modern) .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-icon{width:17px}:host-context(.sky-theme-modern) .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal .sky-progress-indicator-status-marker-icon{height:17px;top:1px}:host-context(.sky-theme-modern) .sky-progress-indicator-status-marker-icon{border-radius:17px;flex:0 0 17px}.sky-theme-modern .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical{position:relative;top:3px;margin-right:20px}.sky-theme-modern .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-icon{width:17px}.sky-theme-modern .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal .sky-progress-indicator-status-marker-icon{height:17px;top:1px}.sky-theme-modern .sky-progress-indicator-status-marker-icon{border-radius:17px;flex:0 0 17px}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: i3.λ4, selector: "sky-icon", inputs: ["icon", "iconType", "size", "fixedWidth", "variant"] }, { kind: "directive", type: i1.λ3, selector: "[skyThemeIf]", inputs: ["skyThemeIf"] }, { kind: "pipe", type: SkyProgressIndicatorMarkerClassPipe, name: "skyProgressIndicatorMarkerClass" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
152
|
+
}
|
|
153
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorStatusMarkerComponent, decorators: [{
|
|
154
|
+
type: Component,
|
|
155
|
+
args: [{ selector: 'sky-progress-indicator-status-marker', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n class=\"sky-progress-indicator-status-marker\"\n role=\"presentation\"\n [ngClass]=\"displayMode | skyProgressIndicatorMarkerClass : status\"\n>\n <div\n *skyThemeIf=\"'default'\"\n class=\"sky-progress-indicator-status-marker-icon\"\n >\n <sky-icon *ngIf=\"isComplete\" icon=\"check\"></sky-icon>\n </div>\n <div *skyThemeIf=\"'modern'\" class=\"sky-progress-indicator-status-marker-icon\">\n <sky-icon *ngIf=\"isComplete\" icon=\"check\" iconType=\"skyux\"></sky-icon>\n </div>\n <div class=\"sky-progress-indicator-status-marker-line\"></div>\n</div>\n", styles: [".sky-progress-indicator-status-marker{display:flex;height:100%}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical{flex-basis:15px;flex-grow:0;flex-direction:column;margin-right:15px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-icon{margin-top:1px;width:15px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-icon>::ng-deep sky-icon{margin-left:-1px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-line{margin:0 auto;width:1px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal{flex-direction:row;width:100%;padding-left:5px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal .sky-progress-indicator-status-marker-icon{height:15px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal .sky-progress-indicator-status-marker-line{margin:auto 0;height:1px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-complete .sky-progress-indicator-status-marker-icon{border:0;margin-right:5px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-active .sky-progress-indicator-status-marker-icon{position:relative}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-active .sky-progress-indicator-status-marker-icon:before{content:\"\";display:block;width:5px;height:1px;background-color:#5a9936;position:absolute;left:-7px;top:5px}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-incomplete .sky-progress-indicator-status-marker-icon{position:relative}.sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal.sky-progress-indicator-status-marker-status-incomplete .sky-progress-indicator-status-marker-icon:before{content:\"\";display:block;width:5px;height:1px;background-color:#cdcfd2;position:absolute;left:-7px;top:5px}.sky-progress-indicator-status-marker-icon{border-radius:15px;border:2px solid #cdcfd2;flex:0 0 15px}.sky-progress-indicator-status-marker-line{background-color:#cdcfd2;flex:1 0 auto}.sky-progress-indicator-status-marker-status-active .sky-progress-indicator-status-marker-icon{background-color:#5a9936;border-color:transparent}.sky-progress-indicator-status-marker-status-pending .sky-progress-indicator-status-marker-icon{border-color:#5a9936}.sky-progress-indicator-status-marker-status-complete .sky-progress-indicator-status-marker-icon{border-color:transparent;color:#5a9936;margin-top:0}.sky-progress-indicator-status-marker-status-complete .sky-progress-indicator-status-marker-icon>::ng-deep sky-icon{display:inline-flex;vertical-align:top}.sky-progress-indicator-status-marker-status-complete .sky-progress-indicator-status-marker-line{background-color:#5a9936}:host-context(.sky-theme-modern) .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical{position:relative;top:3px;margin-right:20px}:host-context(.sky-theme-modern) .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-icon{width:17px}:host-context(.sky-theme-modern) .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal .sky-progress-indicator-status-marker-icon{height:17px;top:1px}:host-context(.sky-theme-modern) .sky-progress-indicator-status-marker-icon{border-radius:17px;flex:0 0 17px}.sky-theme-modern .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical{position:relative;top:3px;margin-right:20px}.sky-theme-modern .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-vertical .sky-progress-indicator-status-marker-icon{width:17px}.sky-theme-modern .sky-progress-indicator-status-marker.sky-progress-indicator-status-marker-mode-horizontal .sky-progress-indicator-status-marker-icon{height:17px;top:1px}.sky-theme-modern .sky-progress-indicator-status-marker-icon{border-radius:17px;flex:0 0 17px}\n"] }]
|
|
156
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.SkyThemeService, decorators: [{
|
|
157
|
+
type: Optional
|
|
158
|
+
}] }]; }, propDecorators: { displayMode: [{
|
|
159
|
+
type: Input
|
|
160
|
+
}], status: [{
|
|
161
|
+
type: Input
|
|
162
|
+
}] } });
|
|
163
|
+
|
|
164
|
+
const STATUS_DEFAULT = SkyProgressIndicatorItemStatus.Incomplete;
|
|
165
|
+
const STATUS_NAME_DEFAULT = 'incomplete';
|
|
166
|
+
/**
|
|
167
|
+
* Specifies a step to include in the progress indicator. Each step requires a label,
|
|
168
|
+
* and you can also specify step details within the `sky-progress-indicator-item` element.
|
|
169
|
+
*/
|
|
170
|
+
class SkyProgressIndicatorItemComponent {
|
|
171
|
+
/**
|
|
172
|
+
* The step label for the step in the progress indicator.
|
|
173
|
+
* @required
|
|
174
|
+
*/
|
|
175
|
+
set title(value) {
|
|
176
|
+
this.#_title = value;
|
|
177
|
+
this.#updateFormattedTitle();
|
|
178
|
+
}
|
|
179
|
+
get title() {
|
|
180
|
+
return this.#_title;
|
|
181
|
+
}
|
|
182
|
+
set status(value) {
|
|
183
|
+
if (value === this.#_status) {
|
|
184
|
+
return;
|
|
185
|
+
}
|
|
186
|
+
/* istanbul ignore next */
|
|
187
|
+
this.#_status = value ?? STATUS_DEFAULT;
|
|
188
|
+
switch (this.#_status) {
|
|
189
|
+
case SkyProgressIndicatorItemStatus.Active:
|
|
190
|
+
this.statusName = 'active';
|
|
191
|
+
break;
|
|
192
|
+
case SkyProgressIndicatorItemStatus.Complete:
|
|
193
|
+
this.statusName = 'complete';
|
|
194
|
+
break;
|
|
195
|
+
case SkyProgressIndicatorItemStatus.Incomplete:
|
|
196
|
+
this.statusName = 'incomplete';
|
|
197
|
+
break;
|
|
198
|
+
case SkyProgressIndicatorItemStatus.Pending:
|
|
199
|
+
this.statusName = 'pending';
|
|
200
|
+
break;
|
|
201
|
+
}
|
|
202
|
+
this.#changeDetector.markForCheck();
|
|
203
|
+
}
|
|
204
|
+
get status() {
|
|
205
|
+
return this.#_status;
|
|
206
|
+
}
|
|
207
|
+
set isVisible(value) {
|
|
208
|
+
this.#_isVisible = !!value;
|
|
209
|
+
this.#changeDetector.markForCheck();
|
|
210
|
+
}
|
|
211
|
+
get isVisible() {
|
|
212
|
+
return this.#_isVisible;
|
|
213
|
+
}
|
|
214
|
+
set showStatusMarker(value) {
|
|
215
|
+
this.#_showStatusMarker = !!value;
|
|
216
|
+
this.#changeDetector.markForCheck();
|
|
217
|
+
}
|
|
218
|
+
get showStatusMarker() {
|
|
219
|
+
return this.#_showStatusMarker;
|
|
220
|
+
}
|
|
221
|
+
set showTitle(value) {
|
|
222
|
+
this.#_showTitle = !!value;
|
|
223
|
+
this.#changeDetector.markForCheck();
|
|
224
|
+
}
|
|
225
|
+
get showTitle() {
|
|
226
|
+
return this.#_showTitle;
|
|
227
|
+
}
|
|
228
|
+
#titlePrefix;
|
|
229
|
+
#changeDetector;
|
|
230
|
+
#_isVisible;
|
|
231
|
+
#_title;
|
|
232
|
+
#_showStatusMarker;
|
|
233
|
+
#_showTitle;
|
|
234
|
+
#_status;
|
|
235
|
+
constructor(changeDetector) {
|
|
236
|
+
this.statusName = STATUS_NAME_DEFAULT;
|
|
237
|
+
this.#_isVisible = false;
|
|
238
|
+
this.#_showStatusMarker = true;
|
|
239
|
+
this.#_showTitle = true;
|
|
240
|
+
this.#_status = STATUS_DEFAULT;
|
|
241
|
+
this.#changeDetector = changeDetector;
|
|
242
|
+
}
|
|
243
|
+
ngOnInit() {
|
|
244
|
+
this.#updateFormattedTitle();
|
|
245
|
+
}
|
|
246
|
+
showStepNumber(step) {
|
|
247
|
+
this.#titlePrefix = `${step} - `;
|
|
248
|
+
this.#updateFormattedTitle();
|
|
249
|
+
}
|
|
250
|
+
hideStepNumber() {
|
|
251
|
+
this.#titlePrefix = '';
|
|
252
|
+
this.#updateFormattedTitle();
|
|
253
|
+
}
|
|
254
|
+
#updateFormattedTitle() {
|
|
255
|
+
this.formattedTitle = `${this.#titlePrefix}${this.title}`;
|
|
256
|
+
this.#changeDetector.markForCheck();
|
|
257
|
+
}
|
|
258
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorItemComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
259
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyProgressIndicatorItemComponent, selector: "sky-progress-indicator-item", inputs: { title: "title" }, ngImport: i0, template: "<div\n *ngIf=\"isVisible\"\n class=\"sky-progress-indicator-item\"\n [ngClass]=\"'sky-progress-indicator-item-status-' + statusName\"\n>\n <sky-progress-indicator-status-marker\n *ngIf=\"showStatusMarker\"\n [status]=\"status\"\n >\n </sky-progress-indicator-status-marker>\n\n <div class=\"sky-progress-indicator-item-content\">\n <div\n *ngIf=\"showTitle\"\n aria-level=\"2\"\n class=\"sky-progress-indicator-item-heading\"\n role=\"heading\"\n [ngClass]=\"{\n 'sky-deemphasized': statusName === 'pending'\n }\"\n [skyThemeClass]=\"{\n 'sky-font-display-3': 'modern'\n }\"\n skyTrim\n >\n {{ formattedTitle }}\n <span class=\"sky-control-help-container\" skyTrim\n ><ng-content select=\".sky-control-help\"></ng-content\n ></span>\n </div>\n <div class=\"sky-progress-indicator-item-body\">\n <ng-template [ngIf]=\"statusName !== 'incomplete'\">\n <ng-content></ng-content>\n </ng-template>\n </div>\n </div>\n</div>\n", styles: [".sky-progress-indicator-item{display:flex;margin-bottom:-1px}.sky-progress-indicator-item-content{flex:1 1 100%}.sky-progress-indicator-item-body{min-height:20px;padding-top:10px;padding-bottom:30px}.sky-progress-indicator-item-status-incomplete .sky-progress-indicator-item-body{padding:0}:host-context(.sky-theme-modern) .sky-progress-indicator-item{margin:0}:host-context(.sky-theme-modern) .sky-progress-indicator-item-body{padding:20px 0 30px}:host-context(.sky-theme-modern) .sky-progress-indicator-item-body:empty{padding:0}.sky-theme-modern .sky-progress-indicator-item{margin:0}.sky-theme-modern .sky-progress-indicator-item-body{padding:20px 0 30px}.sky-theme-modern .sky-progress-indicator-item-body:empty{padding:0}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: i1.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }, { kind: "directive", type: i1$1.λ4, selector: "[skyTrim]" }, { kind: "component", type: SkyProgressIndicatorStatusMarkerComponent, selector: "sky-progress-indicator-status-marker", inputs: ["displayMode", "status"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
260
|
+
}
|
|
261
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorItemComponent, decorators: [{
|
|
262
|
+
type: Component,
|
|
263
|
+
args: [{ selector: 'sky-progress-indicator-item', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n *ngIf=\"isVisible\"\n class=\"sky-progress-indicator-item\"\n [ngClass]=\"'sky-progress-indicator-item-status-' + statusName\"\n>\n <sky-progress-indicator-status-marker\n *ngIf=\"showStatusMarker\"\n [status]=\"status\"\n >\n </sky-progress-indicator-status-marker>\n\n <div class=\"sky-progress-indicator-item-content\">\n <div\n *ngIf=\"showTitle\"\n aria-level=\"2\"\n class=\"sky-progress-indicator-item-heading\"\n role=\"heading\"\n [ngClass]=\"{\n 'sky-deemphasized': statusName === 'pending'\n }\"\n [skyThemeClass]=\"{\n 'sky-font-display-3': 'modern'\n }\"\n skyTrim\n >\n {{ formattedTitle }}\n <span class=\"sky-control-help-container\" skyTrim\n ><ng-content select=\".sky-control-help\"></ng-content\n ></span>\n </div>\n <div class=\"sky-progress-indicator-item-body\">\n <ng-template [ngIf]=\"statusName !== 'incomplete'\">\n <ng-content></ng-content>\n </ng-template>\n </div>\n </div>\n</div>\n", styles: [".sky-progress-indicator-item{display:flex;margin-bottom:-1px}.sky-progress-indicator-item-content{flex:1 1 100%}.sky-progress-indicator-item-body{min-height:20px;padding-top:10px;padding-bottom:30px}.sky-progress-indicator-item-status-incomplete .sky-progress-indicator-item-body{padding:0}:host-context(.sky-theme-modern) .sky-progress-indicator-item{margin:0}:host-context(.sky-theme-modern) .sky-progress-indicator-item-body{padding:20px 0 30px}:host-context(.sky-theme-modern) .sky-progress-indicator-item-body:empty{padding:0}.sky-theme-modern .sky-progress-indicator-item{margin:0}.sky-theme-modern .sky-progress-indicator-item-body{padding:20px 0 30px}.sky-theme-modern .sky-progress-indicator-item-body:empty{padding:0}\n"] }]
|
|
264
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { title: [{
|
|
265
|
+
type: Input
|
|
266
|
+
}] } });
|
|
267
|
+
|
|
268
|
+
class SkyProgressIndicatorNavButtonClass {
|
|
269
|
+
transform(buttonType) {
|
|
270
|
+
const classNames = [`sky-progress-indicator-nav-button-${buttonType}`];
|
|
271
|
+
switch (buttonType) {
|
|
272
|
+
case 'next':
|
|
273
|
+
case 'finish':
|
|
274
|
+
classNames.push('sky-btn-primary');
|
|
275
|
+
break;
|
|
276
|
+
case 'reset':
|
|
277
|
+
classNames.push('sky-btn-link');
|
|
278
|
+
break;
|
|
279
|
+
default:
|
|
280
|
+
classNames.push('sky-btn-default');
|
|
281
|
+
}
|
|
282
|
+
return classNames;
|
|
283
|
+
}
|
|
284
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorNavButtonClass, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
285
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorNavButtonClass, name: "skyProgressIndicatorNavButtonClass" }); }
|
|
286
|
+
}
|
|
287
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorNavButtonClass, decorators: [{
|
|
288
|
+
type: Pipe,
|
|
289
|
+
args: [{
|
|
290
|
+
name: 'skyProgressIndicatorNavButtonClass',
|
|
291
|
+
}]
|
|
292
|
+
}] });
|
|
293
|
+
|
|
294
|
+
class SkyProgressIndicatorNavButtonDisabledPipe {
|
|
295
|
+
transform(disabled, buttonType, activeIndex, itemStatuses) {
|
|
296
|
+
const isLastStep = itemStatuses && activeIndex === itemStatuses.length - 1;
|
|
297
|
+
return ((buttonType === 'next' && isLastStep) ||
|
|
298
|
+
(buttonType === 'previous' && activeIndex === 0) ||
|
|
299
|
+
disabled);
|
|
300
|
+
}
|
|
301
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorNavButtonDisabledPipe, deps: [], target: i0.ɵɵFactoryTarget.Pipe }); }
|
|
302
|
+
static { this.ɵpipe = i0.ɵɵngDeclarePipe({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorNavButtonDisabledPipe, name: "skyProgressIndicatorNavButtonDisabled" }); }
|
|
303
|
+
}
|
|
304
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorNavButtonDisabledPipe, decorators: [{
|
|
305
|
+
type: Pipe,
|
|
306
|
+
args: [{
|
|
307
|
+
name: 'skyProgressIndicatorNavButtonDisabled',
|
|
308
|
+
}]
|
|
309
|
+
}] });
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Allows the consumer to decide whether the button's action should be completed successfully.
|
|
313
|
+
* The handler is provided with all nav button types.
|
|
314
|
+
*/
|
|
315
|
+
class SkyProgressIndicatorActionClickProgressHandler {
|
|
316
|
+
/**
|
|
317
|
+
*
|
|
318
|
+
* @param advance Advances the progress indicator to the next step.
|
|
319
|
+
*/
|
|
320
|
+
constructor(advance) {
|
|
321
|
+
this.advance = advance;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
var SkyProgressIndicatorMessageType;
|
|
326
|
+
(function (SkyProgressIndicatorMessageType) {
|
|
327
|
+
/**
|
|
328
|
+
* The current step is complete.
|
|
329
|
+
* This completes the active item and moves to the next item.
|
|
330
|
+
*/
|
|
331
|
+
SkyProgressIndicatorMessageType[SkyProgressIndicatorMessageType["Progress"] = 0] = "Progress";
|
|
332
|
+
/**
|
|
333
|
+
* Returns progress to the previous step.
|
|
334
|
+
* This moves from the active item to the item that precedes it.
|
|
335
|
+
*/
|
|
336
|
+
SkyProgressIndicatorMessageType[SkyProgressIndicatorMessageType["Regress"] = 1] = "Regress";
|
|
337
|
+
/**
|
|
338
|
+
* Progress is incomplete.
|
|
339
|
+
* This marks all items as incomplete and sets the first item as the active item.
|
|
340
|
+
*/
|
|
341
|
+
SkyProgressIndicatorMessageType[SkyProgressIndicatorMessageType["Reset"] = 2] = "Reset";
|
|
342
|
+
/**
|
|
343
|
+
* Progress is complete.
|
|
344
|
+
* This marks all items as complete and sets the last item as the active item.
|
|
345
|
+
*/
|
|
346
|
+
SkyProgressIndicatorMessageType[SkyProgressIndicatorMessageType["Finish"] = 3] = "Finish";
|
|
347
|
+
/**
|
|
348
|
+
* Moves progress to the item indicated by the `data.activeIndex` property.
|
|
349
|
+
*/
|
|
350
|
+
SkyProgressIndicatorMessageType[SkyProgressIndicatorMessageType["GoTo"] = 4] = "GoTo";
|
|
351
|
+
})(SkyProgressIndicatorMessageType || (SkyProgressIndicatorMessageType = {}));
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* @deprecated Use `SkyProgressIndicatorDisplayModeType` instead.
|
|
355
|
+
* @internal
|
|
356
|
+
*/
|
|
357
|
+
var SkyProgressIndicatorDisplayMode;
|
|
358
|
+
(function (SkyProgressIndicatorDisplayMode) {
|
|
359
|
+
/**
|
|
360
|
+
* The vertical layout for the progress indicator.
|
|
361
|
+
*/
|
|
362
|
+
SkyProgressIndicatorDisplayMode[SkyProgressIndicatorDisplayMode["Vertical"] = 0] = "Vertical";
|
|
363
|
+
/**
|
|
364
|
+
* The horizontal layout for the progress indicator.
|
|
365
|
+
*/
|
|
366
|
+
SkyProgressIndicatorDisplayMode[SkyProgressIndicatorDisplayMode["Horizontal"] = 1] = "Horizontal";
|
|
367
|
+
})(SkyProgressIndicatorDisplayMode || (SkyProgressIndicatorDisplayMode = {}));
|
|
368
|
+
|
|
369
|
+
class SkyProgressIndicatorComponent {
|
|
370
|
+
/**
|
|
371
|
+
* The orientation of the progress indicator, which can be vertical or horizontal.
|
|
372
|
+
* For [passive progress indicators](https://developer.blackbaud.com/skyux-progress-indicator/docs/passive-indicator)
|
|
373
|
+
* and [waterfall progress indicators](https://developer.blackbaud.com/skyux/components/progress-indicator/waterfall-progress-indicator),
|
|
374
|
+
* use the vertical display mode. For [modal wizards](https://developer.blackbaud.com/skyux/components/wizard),
|
|
375
|
+
* use the horizontal display mode.
|
|
376
|
+
* @deprecated The property was designed to create wizards by setting `displayMode="horizontal"` on progress indicators in modals,
|
|
377
|
+
* but this wizard implementation was replaced by the
|
|
378
|
+
* [Wizard (Tabs) component](https://developer.blackbaud.com/skyux/components/progress-indicator).
|
|
379
|
+
* @default "vertical"
|
|
380
|
+
*/
|
|
381
|
+
set displayMode(value) {
|
|
382
|
+
switch (value) {
|
|
383
|
+
case SkyProgressIndicatorDisplayMode.Horizontal:
|
|
384
|
+
case 'horizontal':
|
|
385
|
+
this.#_displayMode = 'horizontal';
|
|
386
|
+
break;
|
|
387
|
+
default:
|
|
388
|
+
this.#_displayMode = 'vertical';
|
|
389
|
+
}
|
|
390
|
+
this.#updateCssClassNames();
|
|
391
|
+
if (this.#_displayMode === 'horizontal') {
|
|
392
|
+
this.#logger.deprecated('SkyProgressIndicator wizard', {
|
|
393
|
+
deprecationMajorVersion: 6,
|
|
394
|
+
replacementRecommendation: 'Use Wizard (Tabs) instead.',
|
|
395
|
+
});
|
|
396
|
+
}
|
|
397
|
+
}
|
|
398
|
+
get displayMode() {
|
|
399
|
+
return this.#_displayMode;
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* Whether the progress indicator is passive. Passive progress indicators inform users of
|
|
403
|
+
* progress that concerns them but that they are not responsible for, and they must use the vertical display mode.
|
|
404
|
+
* @default false
|
|
405
|
+
*/
|
|
406
|
+
set isPassive(value) {
|
|
407
|
+
this.#_isPassive = value;
|
|
408
|
+
this.#updateCssClassNames();
|
|
409
|
+
}
|
|
410
|
+
get isPassive() {
|
|
411
|
+
return this.#_isPassive;
|
|
412
|
+
}
|
|
413
|
+
/**
|
|
414
|
+
* The observable of `SkyProgressIndicatorMessage` that determines the status to
|
|
415
|
+
* display for items in the progress indicator. The message stream is a queue of
|
|
416
|
+
* commanding messages to change the state of the progress indicator based on the message type.
|
|
417
|
+
*/
|
|
418
|
+
set messageStream(value) {
|
|
419
|
+
this.#messageStream = value || new Subject();
|
|
420
|
+
this.#subscribeToMessageStream();
|
|
421
|
+
}
|
|
422
|
+
/**
|
|
423
|
+
* The index for the item to make active when the progress indicator
|
|
424
|
+
* loads. All steps that precede the active item are marked as complete, and all steps
|
|
425
|
+
* that follow the active item are marked as incomplete.
|
|
426
|
+
*/
|
|
427
|
+
set startingIndex(value) {
|
|
428
|
+
this.#_startingIndex = value || 0;
|
|
429
|
+
}
|
|
430
|
+
get startingIndex() {
|
|
431
|
+
return this.#_startingIndex;
|
|
432
|
+
}
|
|
433
|
+
get hasFinishButton() {
|
|
434
|
+
return this.#_hasFinishButton;
|
|
435
|
+
}
|
|
436
|
+
set hasFinishButton(value) {
|
|
437
|
+
this.#_hasFinishButton = value;
|
|
438
|
+
}
|
|
439
|
+
set #activeIndex(value) {
|
|
440
|
+
const lastIndex = (this.itemComponents?.length || 0) - 1;
|
|
441
|
+
this.#_activeIndex = Math.max(Math.min(value || 0, lastIndex), 0);
|
|
442
|
+
}
|
|
443
|
+
get #activeIndex() {
|
|
444
|
+
return this.#_activeIndex;
|
|
445
|
+
}
|
|
446
|
+
#_activeIndex;
|
|
447
|
+
#_displayMode;
|
|
448
|
+
#_hasFinishButton;
|
|
449
|
+
#_isPassive;
|
|
450
|
+
#_startingIndex;
|
|
451
|
+
#messageStreamSub;
|
|
452
|
+
#initialized;
|
|
453
|
+
#ngUnsubscribe;
|
|
454
|
+
#messageStream;
|
|
455
|
+
#changeDetector;
|
|
456
|
+
#windowRef;
|
|
457
|
+
#logger;
|
|
458
|
+
constructor(changeDetector, windowRef, logger) {
|
|
459
|
+
/**
|
|
460
|
+
* Fires when the progress indicator changes the status of an item.
|
|
461
|
+
*/
|
|
462
|
+
this.progressChanges = new EventEmitter();
|
|
463
|
+
this.cssClassNames = [];
|
|
464
|
+
this.itemStatuses = [];
|
|
465
|
+
this.#_activeIndex = 0;
|
|
466
|
+
this.#_displayMode = 'vertical';
|
|
467
|
+
this.#_isPassive = false;
|
|
468
|
+
this.#_startingIndex = 0;
|
|
469
|
+
this.#initialized = false;
|
|
470
|
+
this.#ngUnsubscribe = new Subject();
|
|
471
|
+
this.#messageStream = new Subject();
|
|
472
|
+
this.#changeDetector = changeDetector;
|
|
473
|
+
this.#windowRef = windowRef;
|
|
474
|
+
this.#logger = logger;
|
|
475
|
+
}
|
|
476
|
+
ngOnInit() {
|
|
477
|
+
this.#initialized = true;
|
|
478
|
+
this.#updateCssClassNames();
|
|
479
|
+
this.#subscribeToMessageStream();
|
|
480
|
+
}
|
|
481
|
+
ngAfterContentInit() {
|
|
482
|
+
this.#activeIndex = this.startingIndex;
|
|
483
|
+
this.#updateSteps();
|
|
484
|
+
// Note: The delay here is to ensure all change detection on the items has finished. Without
|
|
485
|
+
// the delay we receive a changed before checked error for vertical progress indicators
|
|
486
|
+
this.itemComponents?.changes
|
|
487
|
+
.pipe(takeUntil(this.#ngUnsubscribe), delay(0))
|
|
488
|
+
.subscribe(() => {
|
|
489
|
+
this.#updateSteps();
|
|
490
|
+
this.#updateStatusesAndNotify();
|
|
491
|
+
});
|
|
492
|
+
// Wait for item components' change detection to complete
|
|
493
|
+
// before notifying changes to the consumer.
|
|
494
|
+
this.#windowRef.nativeWindow.setTimeout(() => {
|
|
495
|
+
this.#updateStatusesAndNotify();
|
|
496
|
+
});
|
|
497
|
+
}
|
|
498
|
+
ngOnDestroy() {
|
|
499
|
+
this.#ngUnsubscribe.next();
|
|
500
|
+
this.#ngUnsubscribe.complete();
|
|
501
|
+
}
|
|
502
|
+
sendMessage(message) {
|
|
503
|
+
this.#messageStream.next(message);
|
|
504
|
+
}
|
|
505
|
+
#isPassiveAndVertical() {
|
|
506
|
+
// Currently, passive mode is not supported for horizontal displays.
|
|
507
|
+
if (this.displayMode === 'horizontal') {
|
|
508
|
+
return false;
|
|
509
|
+
}
|
|
510
|
+
return this.isPassive;
|
|
511
|
+
}
|
|
512
|
+
#gotoNextStep() {
|
|
513
|
+
const nextIndex = this.#activeIndex + 1;
|
|
514
|
+
const lastIndex = this.#getLastIndex();
|
|
515
|
+
if (nextIndex > lastIndex) {
|
|
516
|
+
return;
|
|
517
|
+
}
|
|
518
|
+
this.#gotoStep(nextIndex);
|
|
519
|
+
}
|
|
520
|
+
#gotoPreviousStep() {
|
|
521
|
+
const previousIndex = this.#activeIndex - 1;
|
|
522
|
+
if (previousIndex < 0) {
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
this.#gotoStep(previousIndex);
|
|
526
|
+
}
|
|
527
|
+
#gotoStep(index) {
|
|
528
|
+
this.#activeIndex = index;
|
|
529
|
+
this.#updateSteps();
|
|
530
|
+
this.#updateStatusesAndNotify();
|
|
531
|
+
}
|
|
532
|
+
#finishSteps() {
|
|
533
|
+
this.#activeIndex = this.#getLastIndex();
|
|
534
|
+
this.itemComponents?.forEach((component) => {
|
|
535
|
+
component.status = SkyProgressIndicatorItemStatus.Complete;
|
|
536
|
+
});
|
|
537
|
+
this.#updateStatusesAndNotify({
|
|
538
|
+
isComplete: true,
|
|
539
|
+
});
|
|
540
|
+
}
|
|
541
|
+
#resetSteps() {
|
|
542
|
+
this.#gotoStep(0);
|
|
543
|
+
}
|
|
544
|
+
#updateSteps() {
|
|
545
|
+
if (this.#activeIndex > this.#getLastIndex()) {
|
|
546
|
+
this.#activeIndex = this.#activeIndex - 1;
|
|
547
|
+
}
|
|
548
|
+
const activeIndex = this.#activeIndex;
|
|
549
|
+
const isPassiveAndVertical = this.#isPassiveAndVertical();
|
|
550
|
+
const isVertical = this.displayMode === 'vertical';
|
|
551
|
+
this.itemComponents?.forEach((component, i) => {
|
|
552
|
+
// Set visibility.
|
|
553
|
+
component.isVisible = activeIndex === i || isVertical;
|
|
554
|
+
// Set status.
|
|
555
|
+
let status;
|
|
556
|
+
if (activeIndex === i) {
|
|
557
|
+
if (isPassiveAndVertical) {
|
|
558
|
+
status = SkyProgressIndicatorItemStatus.Pending;
|
|
559
|
+
}
|
|
560
|
+
else {
|
|
561
|
+
status = SkyProgressIndicatorItemStatus.Active;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
else if (activeIndex > i) {
|
|
565
|
+
status = SkyProgressIndicatorItemStatus.Complete;
|
|
566
|
+
}
|
|
567
|
+
else {
|
|
568
|
+
status = SkyProgressIndicatorItemStatus.Incomplete;
|
|
569
|
+
}
|
|
570
|
+
component.status = status;
|
|
571
|
+
// Show or hide the status markers.
|
|
572
|
+
component.showStatusMarker = isVertical;
|
|
573
|
+
// Show or hide the step number.
|
|
574
|
+
if (isPassiveAndVertical) {
|
|
575
|
+
component.hideStepNumber();
|
|
576
|
+
}
|
|
577
|
+
else {
|
|
578
|
+
component.showStepNumber(i + 1);
|
|
579
|
+
}
|
|
580
|
+
// If we're in passive mode, don't show titles for incomplete items.
|
|
581
|
+
component.showTitle = !(isPassiveAndVertical && activeIndex < i);
|
|
582
|
+
});
|
|
583
|
+
}
|
|
584
|
+
#updateItemStatuses() {
|
|
585
|
+
/* istanbul ignore next */
|
|
586
|
+
this.itemStatuses = this.itemComponents?.map((c) => c.status) || [];
|
|
587
|
+
}
|
|
588
|
+
#updateCssClassNames() {
|
|
589
|
+
const classNames = [`sky-progress-indicator-mode-${this.displayMode}`];
|
|
590
|
+
if (this.#isPassiveAndVertical()) {
|
|
591
|
+
classNames.push('sky-progress-indicator-passive');
|
|
592
|
+
}
|
|
593
|
+
this.cssClassNames = classNames;
|
|
594
|
+
}
|
|
595
|
+
#handleIncomingMessage(message) {
|
|
596
|
+
const indicatorMessage = message;
|
|
597
|
+
let type;
|
|
598
|
+
// Prints a deprecation warning if the consumer provides only `SkyProgressIndicatorMessageType`.
|
|
599
|
+
if (indicatorMessage.type === undefined) {
|
|
600
|
+
console.warn("[Deprecation warning] The progress indicator component's `messageStream` input is set " +
|
|
601
|
+
'to `Subject<SkyProgressIndicatorMessageType>`. We will remove this deprecated type in ' +
|
|
602
|
+
'the next major version release. Instead, set the `messageStream` input to a value of ' +
|
|
603
|
+
'`Subject<SkyProgressIndicatorMessage>`.');
|
|
604
|
+
type = message;
|
|
605
|
+
}
|
|
606
|
+
else {
|
|
607
|
+
type = indicatorMessage.type;
|
|
608
|
+
}
|
|
609
|
+
switch (type) {
|
|
610
|
+
case SkyProgressIndicatorMessageType.Progress:
|
|
611
|
+
this.#gotoNextStep();
|
|
612
|
+
break;
|
|
613
|
+
case SkyProgressIndicatorMessageType.Regress:
|
|
614
|
+
this.#gotoPreviousStep();
|
|
615
|
+
break;
|
|
616
|
+
case SkyProgressIndicatorMessageType.Finish:
|
|
617
|
+
this.#finishSteps();
|
|
618
|
+
break;
|
|
619
|
+
case SkyProgressIndicatorMessageType.Reset:
|
|
620
|
+
this.#resetSteps();
|
|
621
|
+
break;
|
|
622
|
+
case SkyProgressIndicatorMessageType.GoTo:
|
|
623
|
+
if (!indicatorMessage.data ||
|
|
624
|
+
indicatorMessage.data.activeIndex === undefined) {
|
|
625
|
+
console.warn('A message type of `SkyProgressIndicatorMessageType.GoTo` was passed to the progress ' +
|
|
626
|
+
'indicator, but no step index was provided. You can pass the desired active ' +
|
|
627
|
+
'index via:\n' +
|
|
628
|
+
'{\n' +
|
|
629
|
+
' type: SkyProgressIndicatorMessageType.GoTo,\n' +
|
|
630
|
+
' data: { activeIndex: 0 }\n' +
|
|
631
|
+
'}');
|
|
632
|
+
return;
|
|
633
|
+
}
|
|
634
|
+
this.#gotoStep(indicatorMessage.data.activeIndex);
|
|
635
|
+
break;
|
|
636
|
+
default:
|
|
637
|
+
break;
|
|
638
|
+
}
|
|
639
|
+
// Update the view after a message is received.
|
|
640
|
+
this.#changeDetector.markForCheck();
|
|
641
|
+
}
|
|
642
|
+
#subscribeToMessageStream() {
|
|
643
|
+
if (this.#initialized) {
|
|
644
|
+
if (this.#messageStreamSub) {
|
|
645
|
+
this.#messageStreamSub.unsubscribe();
|
|
646
|
+
this.#messageStreamSub = undefined;
|
|
647
|
+
}
|
|
648
|
+
if (this.#messageStream) {
|
|
649
|
+
this.#messageStreamSub = this.#messageStream
|
|
650
|
+
.pipe(takeUntil(this.#ngUnsubscribe))
|
|
651
|
+
.subscribe((message) => {
|
|
652
|
+
this.#handleIncomingMessage(message);
|
|
653
|
+
});
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
}
|
|
657
|
+
#updateStatusesAndNotify(change) {
|
|
658
|
+
this.#updateItemStatuses();
|
|
659
|
+
this.progressChanges.next(Object.assign({}, {
|
|
660
|
+
activeIndex: this.#activeIndex,
|
|
661
|
+
itemStatuses: this.itemStatuses,
|
|
662
|
+
}, change));
|
|
663
|
+
}
|
|
664
|
+
#getLastIndex() {
|
|
665
|
+
return (this.itemComponents?.length || 0) - 1;
|
|
666
|
+
}
|
|
667
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1$1.SkyAppWindowRef }, { token: i1$1.SkyLogService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
668
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyProgressIndicatorComponent, selector: "sky-progress-indicator", inputs: { displayMode: "displayMode", isPassive: "isPassive", messageStream: "messageStream", startingIndex: "startingIndex" }, outputs: { progressChanges: "progressChanges" }, queries: [{ propertyName: "itemComponents", predicate: SkyProgressIndicatorItemComponent }], ngImport: i0, template: "<div class=\"sky-progress-indicator\" [ngClass]=\"cssClassNames\">\n <div\n *ngIf=\"displayMode === 'horizontal'\"\n class=\"sky-progress-indicator-horizontal-status-markers\"\n >\n <sky-progress-indicator-status-marker\n *ngFor=\"let status of itemStatuses\"\n [displayMode]=\"displayMode\"\n [status]=\"status\"\n >\n </sky-progress-indicator-status-marker>\n </div>\n <ng-content></ng-content>\n</div>\n", styles: [".sky-progress-indicator ::ng-deep sky-progress-indicator-item:last-of-type .sky-progress-indicator-status-marker-line{display:none}.sky-progress-indicator-mode-vertical{max-width:400px;min-width:250px;margin:0 auto}.sky-progress-indicator-mode-vertical ::ng-deep .sky-progress-indicator-item-body{text-align:center;margin-left:-30px}.sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-nav-button,.sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-reset-button{display:block;padding-top:30px;padding-left:15px}::ng-deep .sky-popover ::ng-deep .sky-progress-indicator-mode-vertical{min-width:auto}.sky-progress-indicator-mode-horizontal ::ng-deep .sky-progress-indicator-item-heading{font-weight:600;font-size:16px}.sky-progress-indicator-horizontal-status-markers{display:flex;margin-bottom:10px}.sky-progress-indicator-horizontal-status-markers ::ng-deep sky-progress-indicator-status-marker{flex-basis:45px;flex-grow:0}.sky-progress-indicator-horizontal-status-markers ::ng-deep sky-progress-indicator-status-marker:first-of-type{margin-left:-5px}.sky-progress-indicator-horizontal-status-markers ::ng-deep sky-progress-indicator-status-marker:first-of-type .sky-progress-indicator-status-marker .sky-progress-indicator-status-marker-icon:before{display:none!important}.sky-progress-indicator-horizontal-status-markers ::ng-deep sky-progress-indicator-status-marker:last-of-type .sky-progress-indicator-status-marker-line{display:none}:host-context(.sky-theme-modern) .sky-progress-indicator-mode-horizontal ::ng-deep .sky-progress-indicator-item-heading{font-weight:inherit;font-size:inherit}:host-context(.sky-theme-modern) .sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-nav-button,:host-context(.sky-theme-modern) .sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-reset-button{padding:0;margin:60px 0 0;text-align:center}.sky-theme-modern .sky-progress-indicator-mode-horizontal ::ng-deep .sky-progress-indicator-item-heading{font-weight:inherit;font-size:inherit}.sky-theme-modern .sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-nav-button,.sky-theme-modern .sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-reset-button{padding:0;margin:60px 0 0;text-align:center}\n"], dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: SkyProgressIndicatorStatusMarkerComponent, selector: "sky-progress-indicator-status-marker", inputs: ["displayMode", "status"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
669
|
+
}
|
|
670
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorComponent, decorators: [{
|
|
671
|
+
type: Component,
|
|
672
|
+
args: [{ selector: 'sky-progress-indicator', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div class=\"sky-progress-indicator\" [ngClass]=\"cssClassNames\">\n <div\n *ngIf=\"displayMode === 'horizontal'\"\n class=\"sky-progress-indicator-horizontal-status-markers\"\n >\n <sky-progress-indicator-status-marker\n *ngFor=\"let status of itemStatuses\"\n [displayMode]=\"displayMode\"\n [status]=\"status\"\n >\n </sky-progress-indicator-status-marker>\n </div>\n <ng-content></ng-content>\n</div>\n", styles: [".sky-progress-indicator ::ng-deep sky-progress-indicator-item:last-of-type .sky-progress-indicator-status-marker-line{display:none}.sky-progress-indicator-mode-vertical{max-width:400px;min-width:250px;margin:0 auto}.sky-progress-indicator-mode-vertical ::ng-deep .sky-progress-indicator-item-body{text-align:center;margin-left:-30px}.sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-nav-button,.sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-reset-button{display:block;padding-top:30px;padding-left:15px}::ng-deep .sky-popover ::ng-deep .sky-progress-indicator-mode-vertical{min-width:auto}.sky-progress-indicator-mode-horizontal ::ng-deep .sky-progress-indicator-item-heading{font-weight:600;font-size:16px}.sky-progress-indicator-horizontal-status-markers{display:flex;margin-bottom:10px}.sky-progress-indicator-horizontal-status-markers ::ng-deep sky-progress-indicator-status-marker{flex-basis:45px;flex-grow:0}.sky-progress-indicator-horizontal-status-markers ::ng-deep sky-progress-indicator-status-marker:first-of-type{margin-left:-5px}.sky-progress-indicator-horizontal-status-markers ::ng-deep sky-progress-indicator-status-marker:first-of-type .sky-progress-indicator-status-marker .sky-progress-indicator-status-marker-icon:before{display:none!important}.sky-progress-indicator-horizontal-status-markers ::ng-deep sky-progress-indicator-status-marker:last-of-type .sky-progress-indicator-status-marker-line{display:none}:host-context(.sky-theme-modern) .sky-progress-indicator-mode-horizontal ::ng-deep .sky-progress-indicator-item-heading{font-weight:inherit;font-size:inherit}:host-context(.sky-theme-modern) .sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-nav-button,:host-context(.sky-theme-modern) .sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-reset-button{padding:0;margin:60px 0 0;text-align:center}.sky-theme-modern .sky-progress-indicator-mode-horizontal ::ng-deep .sky-progress-indicator-item-heading{font-weight:inherit;font-size:inherit}.sky-theme-modern .sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-nav-button,.sky-theme-modern .sky-progress-indicator-mode-vertical ::ng-deep sky-progress-indicator-reset-button{padding:0;margin:60px 0 0;text-align:center}\n"] }]
|
|
673
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1$1.SkyAppWindowRef }, { type: i1$1.SkyLogService }]; }, propDecorators: { displayMode: [{
|
|
674
|
+
type: Input
|
|
675
|
+
}], isPassive: [{
|
|
676
|
+
type: Input
|
|
677
|
+
}], messageStream: [{
|
|
678
|
+
type: Input
|
|
679
|
+
}], startingIndex: [{
|
|
680
|
+
type: Input
|
|
681
|
+
}], progressChanges: [{
|
|
682
|
+
type: Output
|
|
683
|
+
}], itemComponents: [{
|
|
684
|
+
type: ContentChildren,
|
|
685
|
+
args: [SkyProgressIndicatorItemComponent]
|
|
686
|
+
}] } });
|
|
687
|
+
|
|
688
|
+
const BUTTON_TYPE_DEFAULT = 'next';
|
|
689
|
+
/**
|
|
690
|
+
* Displays a button to navigate the steps in modal wizards. We recommend against using it in
|
|
691
|
+
* passive progress indicators and waterfall progress indicators.
|
|
692
|
+
*/
|
|
693
|
+
class SkyProgressIndicatorNavButtonComponent {
|
|
694
|
+
/**
|
|
695
|
+
* The type of nav button to include.
|
|
696
|
+
* @default "next"
|
|
697
|
+
*/
|
|
698
|
+
set buttonType(value) {
|
|
699
|
+
this.#_buttonType = value || BUTTON_TYPE_DEFAULT;
|
|
700
|
+
}
|
|
701
|
+
get buttonType() {
|
|
702
|
+
return this.#_buttonType;
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Whether to disable the nav button.
|
|
706
|
+
* @default false
|
|
707
|
+
*/
|
|
708
|
+
set disabled(value) {
|
|
709
|
+
this.#_disabled = value;
|
|
710
|
+
this.#changeDetector.markForCheck();
|
|
711
|
+
}
|
|
712
|
+
get disabled() {
|
|
713
|
+
return this.#_disabled;
|
|
714
|
+
}
|
|
715
|
+
/**
|
|
716
|
+
* The progress indicator component to associate with the nav button.
|
|
717
|
+
* @required
|
|
718
|
+
*/
|
|
719
|
+
set progressIndicator(value) {
|
|
720
|
+
this.#_progressIndicator = value;
|
|
721
|
+
if (this.#_progressIndicator) {
|
|
722
|
+
if (this.buttonType === 'finish') {
|
|
723
|
+
// The `hasFinishButton` field was added to support legacy API.
|
|
724
|
+
// Some implementations only include a next button; we cannot
|
|
725
|
+
// assume that every implementation includes both a finish button and a next button.
|
|
726
|
+
this.#_progressIndicator.hasFinishButton = true;
|
|
727
|
+
}
|
|
728
|
+
this.#_progressIndicator.progressChanges
|
|
729
|
+
.pipe(distinctUntilChanged(), takeUntil(this.#ngUnsubscribe))
|
|
730
|
+
.subscribe((change) => {
|
|
731
|
+
this.lastProgressChange = change;
|
|
732
|
+
this.#updateButtonVisibility(change);
|
|
733
|
+
});
|
|
734
|
+
}
|
|
735
|
+
else {
|
|
736
|
+
if (!this.#parentTimeout) {
|
|
737
|
+
this.#parentTimeout = window.setTimeout(() => {
|
|
738
|
+
/* istanbul ignore else */
|
|
739
|
+
if (!this.progressIndicator) {
|
|
740
|
+
throw new Error('The `<sky-progress-indicator-nav-button>` component requires a reference to ' +
|
|
741
|
+
'the `<sky-progress-indicator>` component it controls. For example:\n' +
|
|
742
|
+
'<sky-progress-indicator\n' +
|
|
743
|
+
' #myProgressIndicator\n' +
|
|
744
|
+
'>\n' +
|
|
745
|
+
'</sky-progress-indicator>\n' +
|
|
746
|
+
'<sky-progress-indicator-nav-button\n' +
|
|
747
|
+
' [progressIndicator]="myProgressIndicator"\n' +
|
|
748
|
+
'>\n' +
|
|
749
|
+
'</sky-progress-indicator-nav-button>');
|
|
750
|
+
}
|
|
751
|
+
}, 50);
|
|
752
|
+
}
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
get progressIndicator() {
|
|
756
|
+
return this.#_progressIndicator;
|
|
757
|
+
}
|
|
758
|
+
set isVisible(value) {
|
|
759
|
+
this.#_isVisible = value;
|
|
760
|
+
this.#changeDetector.markForCheck();
|
|
761
|
+
}
|
|
762
|
+
get isVisible() {
|
|
763
|
+
return this.#_isVisible;
|
|
764
|
+
}
|
|
765
|
+
#ngUnsubscribe;
|
|
766
|
+
#parentTimeout;
|
|
767
|
+
#_buttonType;
|
|
768
|
+
#_disabled;
|
|
769
|
+
#_isVisible;
|
|
770
|
+
#_progressIndicator;
|
|
771
|
+
#changeDetector;
|
|
772
|
+
#parentComponent;
|
|
773
|
+
constructor(changeDetector, parentComponent) {
|
|
774
|
+
/**
|
|
775
|
+
* Fires when users select the nav button and emits a `SkyProgressIndicatorActionClickArgs`
|
|
776
|
+
* object that is passed into the callback function to allow consumers to decide whether
|
|
777
|
+
* the button’s action should complete successfully.
|
|
778
|
+
*/
|
|
779
|
+
this.actionClick = new EventEmitter();
|
|
780
|
+
this.#ngUnsubscribe = new Subject();
|
|
781
|
+
this.#_buttonType = BUTTON_TYPE_DEFAULT;
|
|
782
|
+
this.#changeDetector = changeDetector;
|
|
783
|
+
this.#parentComponent = parentComponent;
|
|
784
|
+
}
|
|
785
|
+
ngAfterViewInit() {
|
|
786
|
+
if (!this.progressIndicator && this.#parentComponent) {
|
|
787
|
+
this.progressIndicator = this.#parentComponent;
|
|
788
|
+
}
|
|
789
|
+
else if (!this.progressIndicator) {
|
|
790
|
+
this.progressIndicator = undefined;
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
ngOnDestroy() {
|
|
794
|
+
this.#ngUnsubscribe.next();
|
|
795
|
+
this.#ngUnsubscribe.complete();
|
|
796
|
+
this.actionClick.complete();
|
|
797
|
+
}
|
|
798
|
+
onClick(event) {
|
|
799
|
+
event.preventDefault();
|
|
800
|
+
let type;
|
|
801
|
+
switch (this.buttonType) {
|
|
802
|
+
case 'finish':
|
|
803
|
+
type = SkyProgressIndicatorMessageType.Finish;
|
|
804
|
+
break;
|
|
805
|
+
case 'next':
|
|
806
|
+
type = SkyProgressIndicatorMessageType.Progress;
|
|
807
|
+
break;
|
|
808
|
+
case 'previous':
|
|
809
|
+
type = SkyProgressIndicatorMessageType.Regress;
|
|
810
|
+
break;
|
|
811
|
+
case 'reset':
|
|
812
|
+
type = SkyProgressIndicatorMessageType.Reset;
|
|
813
|
+
break;
|
|
814
|
+
}
|
|
815
|
+
// If the consumer has subscribed to the `actionClick` event,
|
|
816
|
+
// allow them to decide when to advance to the next step.
|
|
817
|
+
if (this.actionClick.observers.length > 0) {
|
|
818
|
+
this.actionClick.emit({
|
|
819
|
+
event,
|
|
820
|
+
progressHandler: new SkyProgressIndicatorActionClickProgressHandler(() => {
|
|
821
|
+
this.#sendMessage(type);
|
|
822
|
+
}),
|
|
823
|
+
});
|
|
824
|
+
}
|
|
825
|
+
else {
|
|
826
|
+
this.#sendMessage(type);
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
#sendMessage(type) {
|
|
830
|
+
if (type !== undefined) {
|
|
831
|
+
this.progressIndicator?.sendMessage({ type });
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
#updateButtonVisibility(change) {
|
|
835
|
+
const isLastStep = change.itemStatuses &&
|
|
836
|
+
change.activeIndex === change.itemStatuses.length - 1;
|
|
837
|
+
const buttonType = this.buttonType;
|
|
838
|
+
// Hide the button if all steps are complete
|
|
839
|
+
// (except for the reset button)
|
|
840
|
+
if (buttonType !== 'reset' && change.isComplete) {
|
|
841
|
+
this.isVisible = false;
|
|
842
|
+
return;
|
|
843
|
+
}
|
|
844
|
+
if (buttonType === 'finish') {
|
|
845
|
+
this.isVisible = isLastStep;
|
|
846
|
+
return;
|
|
847
|
+
}
|
|
848
|
+
// Hide the next button on the last step only if a finish button exists.
|
|
849
|
+
if (buttonType === 'next' &&
|
|
850
|
+
isLastStep &&
|
|
851
|
+
this.progressIndicator?.hasFinishButton) {
|
|
852
|
+
this.isVisible = false;
|
|
853
|
+
return;
|
|
854
|
+
}
|
|
855
|
+
this.isVisible = true;
|
|
856
|
+
}
|
|
857
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorNavButtonComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: SkyProgressIndicatorComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
858
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyProgressIndicatorNavButtonComponent, selector: "sky-progress-indicator-nav-button", inputs: { buttonText: "buttonText", buttonType: "buttonType", disabled: "disabled", progressIndicator: "progressIndicator" }, outputs: { actionClick: "actionClick" }, ngImport: i0, template: "<button\n *ngIf=\"isVisible\"\n class=\"sky-btn sky-margin-inline-sm\"\n type=\"button\"\n [disabled]=\"\n disabled\n | skyProgressIndicatorNavButtonDisabled\n : buttonType\n : lastProgressChange?.activeIndex\n : lastProgressChange?.itemStatuses\n \"\n [ngClass]=\"buttonType | skyProgressIndicatorNavButtonClass\"\n (click)=\"onClick($event)\"\n>\n {{\n buttonText ||\n ('skyux_progress_indicator_navigator_' + buttonType | skyLibResources)\n }}\n</button>\n", dependencies: [{ kind: "directive", type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "pipe", type: i3$1.SkyLibResourcesPipe, name: "skyLibResources" }, { kind: "pipe", type: SkyProgressIndicatorNavButtonClass, name: "skyProgressIndicatorNavButtonClass" }, { kind: "pipe", type: SkyProgressIndicatorNavButtonDisabledPipe, name: "skyProgressIndicatorNavButtonDisabled" }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
859
|
+
}
|
|
860
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorNavButtonComponent, decorators: [{
|
|
861
|
+
type: Component,
|
|
862
|
+
args: [{ selector: 'sky-progress-indicator-nav-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n *ngIf=\"isVisible\"\n class=\"sky-btn sky-margin-inline-sm\"\n type=\"button\"\n [disabled]=\"\n disabled\n | skyProgressIndicatorNavButtonDisabled\n : buttonType\n : lastProgressChange?.activeIndex\n : lastProgressChange?.itemStatuses\n \"\n [ngClass]=\"buttonType | skyProgressIndicatorNavButtonClass\"\n (click)=\"onClick($event)\"\n>\n {{\n buttonText ||\n ('skyux_progress_indicator_navigator_' + buttonType | skyLibResources)\n }}\n</button>\n" }]
|
|
863
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: SkyProgressIndicatorComponent, decorators: [{
|
|
864
|
+
type: Optional
|
|
865
|
+
}] }]; }, propDecorators: { buttonText: [{
|
|
866
|
+
type: Input
|
|
867
|
+
}], buttonType: [{
|
|
868
|
+
type: Input
|
|
869
|
+
}], disabled: [{
|
|
870
|
+
type: Input
|
|
871
|
+
}], progressIndicator: [{
|
|
872
|
+
type: Input
|
|
873
|
+
}], actionClick: [{
|
|
874
|
+
type: Output
|
|
875
|
+
}] } });
|
|
876
|
+
|
|
877
|
+
/**
|
|
878
|
+
* Displays a button to mark all items in the progress indicator as incomplete and set the
|
|
879
|
+
* first item as the active item. The steps after the active item remain incomplete until
|
|
880
|
+
* users reach them in their sequential order.
|
|
881
|
+
*/
|
|
882
|
+
class SkyProgressIndicatorResetButtonComponent {
|
|
883
|
+
/**
|
|
884
|
+
* Whether to disable the reset button.
|
|
885
|
+
* @default false
|
|
886
|
+
*/
|
|
887
|
+
set disabled(value) {
|
|
888
|
+
this.#_disabled = value;
|
|
889
|
+
this.#changeDetector.markForCheck();
|
|
890
|
+
}
|
|
891
|
+
get disabled() {
|
|
892
|
+
return this.#_disabled;
|
|
893
|
+
}
|
|
894
|
+
#_disabled;
|
|
895
|
+
#changeDetector;
|
|
896
|
+
constructor(changeDetector) {
|
|
897
|
+
/**
|
|
898
|
+
* Fires when users select the reset button that marks all items as incomplete and sets the
|
|
899
|
+
* first item as the active item.
|
|
900
|
+
*/
|
|
901
|
+
this.resetClick = new EventEmitter();
|
|
902
|
+
this.#changeDetector = changeDetector;
|
|
903
|
+
console.warn('[Deprecation warning] The `<sky-progress-indicator-reset-button>` component is ' +
|
|
904
|
+
'deprecated. Please use the `<sky-progress-indicator-nav-button>` component instead, with ' +
|
|
905
|
+
'`buttonType` set to "reset".');
|
|
906
|
+
}
|
|
907
|
+
ngOnDestroy() {
|
|
908
|
+
this.resetClick.complete();
|
|
909
|
+
}
|
|
910
|
+
onClick() {
|
|
911
|
+
this.resetClick.emit();
|
|
912
|
+
this.progressIndicator?.sendMessage({
|
|
913
|
+
type: SkyProgressIndicatorMessageType.Reset,
|
|
914
|
+
});
|
|
915
|
+
}
|
|
916
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorResetButtonComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
917
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyProgressIndicatorResetButtonComponent, selector: "sky-progress-indicator-reset-button", inputs: { disabled: "disabled", progressIndicator: "progressIndicator" }, outputs: { resetClick: "resetClick" }, ngImport: i0, template: "<button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [disabled]=\"disabled\"\n (click)=\"onClick()\"\n>\n <ng-content></ng-content>\n</button>\n", changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
918
|
+
}
|
|
919
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorResetButtonComponent, decorators: [{
|
|
920
|
+
type: Component,
|
|
921
|
+
args: [{ selector: 'sky-progress-indicator-reset-button', changeDetection: ChangeDetectionStrategy.OnPush, template: "<button\n class=\"sky-btn sky-btn-link\"\n type=\"button\"\n [disabled]=\"disabled\"\n (click)=\"onClick()\"\n>\n <ng-content></ng-content>\n</button>\n" }]
|
|
922
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { disabled: [{
|
|
923
|
+
type: Input
|
|
924
|
+
}], progressIndicator: [{
|
|
925
|
+
type: Input
|
|
926
|
+
}], resetClick: [{
|
|
927
|
+
type: Output
|
|
928
|
+
}] } });
|
|
929
|
+
|
|
930
|
+
/**
|
|
931
|
+
* Specifies a header to display above the progress indicator.
|
|
932
|
+
*/
|
|
933
|
+
class SkyProgressIndicatorTitleComponent {
|
|
934
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorTitleComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
935
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.1.7", type: SkyProgressIndicatorTitleComponent, selector: "sky-progress-indicator-title", ngImport: i0, template: "<div\n aria-level=\"1\"\n class=\"sky-progress-indicator-title\"\n role=\"heading\"\n [skyThemeClass]=\"{\n 'sky-font-heading-2': 'default',\n 'sky-font-heading-1': 'modern'\n }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [".sky-progress-indicator-title{line-height:1.1;margin:0 0 30px;text-align:center}:host-context(.sky-theme-modern) .sky-progress-indicator-title{line-height:inherit;margin:0 0 60px}.sky-theme-modern .sky-progress-indicator-title{line-height:inherit;margin:0 0 60px}\n"], dependencies: [{ kind: "directive", type: i1.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush }); }
|
|
936
|
+
}
|
|
937
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorTitleComponent, decorators: [{
|
|
938
|
+
type: Component,
|
|
939
|
+
args: [{ selector: 'sky-progress-indicator-title', changeDetection: ChangeDetectionStrategy.OnPush, template: "<div\n aria-level=\"1\"\n class=\"sky-progress-indicator-title\"\n role=\"heading\"\n [skyThemeClass]=\"{\n 'sky-font-heading-2': 'default',\n 'sky-font-heading-1': 'modern'\n }\"\n>\n <ng-content></ng-content>\n</div>\n", styles: [".sky-progress-indicator-title{line-height:1.1;margin:0 0 30px;text-align:center}:host-context(.sky-theme-modern) .sky-progress-indicator-title{line-height:inherit;margin:0 0 60px}.sky-theme-modern .sky-progress-indicator-title{line-height:inherit;margin:0 0 60px}\n"] }]
|
|
940
|
+
}] });
|
|
941
|
+
|
|
942
|
+
class SkyProgressIndicatorModule {
|
|
943
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
|
|
944
|
+
static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorModule, declarations: [SkyProgressIndicatorComponent,
|
|
945
|
+
SkyProgressIndicatorItemComponent,
|
|
946
|
+
SkyProgressIndicatorMarkerClassPipe,
|
|
947
|
+
SkyProgressIndicatorNavButtonClass,
|
|
948
|
+
SkyProgressIndicatorNavButtonDisabledPipe,
|
|
949
|
+
SkyProgressIndicatorNavButtonComponent,
|
|
950
|
+
SkyProgressIndicatorResetButtonComponent,
|
|
951
|
+
SkyProgressIndicatorStatusMarkerComponent,
|
|
952
|
+
SkyProgressIndicatorTitleComponent], imports: [CommonModule,
|
|
953
|
+
SkyI18nModule,
|
|
954
|
+
SkyIconModule,
|
|
955
|
+
SkyProgressIndicatorResourcesModule,
|
|
956
|
+
SkyThemeModule,
|
|
957
|
+
SkyTrimModule], exports: [SkyProgressIndicatorComponent,
|
|
958
|
+
SkyProgressIndicatorItemComponent,
|
|
959
|
+
SkyProgressIndicatorNavButtonComponent,
|
|
960
|
+
SkyProgressIndicatorResetButtonComponent,
|
|
961
|
+
SkyProgressIndicatorTitleComponent] }); }
|
|
962
|
+
static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorModule, imports: [CommonModule,
|
|
963
|
+
SkyI18nModule,
|
|
964
|
+
SkyIconModule,
|
|
965
|
+
SkyProgressIndicatorResourcesModule,
|
|
966
|
+
SkyThemeModule,
|
|
967
|
+
SkyTrimModule] }); }
|
|
968
|
+
}
|
|
969
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.7", ngImport: i0, type: SkyProgressIndicatorModule, decorators: [{
|
|
970
|
+
type: NgModule,
|
|
971
|
+
args: [{
|
|
972
|
+
declarations: [
|
|
973
|
+
SkyProgressIndicatorComponent,
|
|
974
|
+
SkyProgressIndicatorItemComponent,
|
|
975
|
+
SkyProgressIndicatorMarkerClassPipe,
|
|
976
|
+
SkyProgressIndicatorNavButtonClass,
|
|
977
|
+
SkyProgressIndicatorNavButtonDisabledPipe,
|
|
978
|
+
SkyProgressIndicatorNavButtonComponent,
|
|
979
|
+
SkyProgressIndicatorResetButtonComponent,
|
|
980
|
+
SkyProgressIndicatorStatusMarkerComponent,
|
|
981
|
+
SkyProgressIndicatorTitleComponent,
|
|
982
|
+
],
|
|
983
|
+
imports: [
|
|
984
|
+
CommonModule,
|
|
985
|
+
SkyI18nModule,
|
|
986
|
+
SkyIconModule,
|
|
987
|
+
SkyProgressIndicatorResourcesModule,
|
|
988
|
+
SkyThemeModule,
|
|
989
|
+
SkyTrimModule,
|
|
990
|
+
],
|
|
991
|
+
exports: [
|
|
992
|
+
SkyProgressIndicatorComponent,
|
|
993
|
+
SkyProgressIndicatorItemComponent,
|
|
994
|
+
SkyProgressIndicatorNavButtonComponent,
|
|
995
|
+
SkyProgressIndicatorResetButtonComponent,
|
|
996
|
+
SkyProgressIndicatorTitleComponent,
|
|
997
|
+
],
|
|
998
|
+
}]
|
|
999
|
+
}] });
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* Generated bundle index. Do not edit.
|
|
1003
|
+
*/
|
|
1004
|
+
|
|
1005
|
+
export { SkyProgressIndicatorActionClickProgressHandler, SkyProgressIndicatorDisplayMode, SkyProgressIndicatorItemStatus, SkyProgressIndicatorMessageType, SkyProgressIndicatorModule, SkyProgressIndicatorItemComponent as λ1, SkyProgressIndicatorComponent as λ2, SkyProgressIndicatorNavButtonComponent as λ3, SkyProgressIndicatorResetButtonComponent as λ4, SkyProgressIndicatorTitleComponent as λ5 };
|
|
1006
|
+
//# sourceMappingURL=skyux-progress-indicator.mjs.map
|