@skyux/progress-indicator 5.0.3 → 5.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +6 -4
- package/documentation.json +123 -14
- package/esm2015/index.js +18 -0
- package/esm2015/index.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator-item/progress-indicator-item.component.js +74 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator-item/progress-indicator-item.component.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button.component.js +223 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button.component.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator-reset-button/progress-indicator-reset-button.component.js +59 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator-reset-button/progress-indicator-reset-button.component.js.map +1 -0
- package/esm2015/{modules → lib/modules}/progress-indicator/progress-indicator-status-marker/progress-indicator-status-marker.component.js +3 -2
- package/esm2015/lib/modules/progress-indicator/progress-indicator-status-marker/progress-indicator-status-marker.component.js.map +1 -0
- package/esm2015/{modules → lib/modules}/progress-indicator/progress-indicator-title/progress-indicator-title.component.js +1 -1
- package/esm2015/lib/modules/progress-indicator/progress-indicator-title/progress-indicator-title.component.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator.component.js +317 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator.component.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator.module.js +65 -0
- package/esm2015/lib/modules/progress-indicator/progress-indicator.module.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-action-click-args.js +2 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-action-click-args.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-action-click-progress-handler.js +14 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-action-click-progress-handler.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-change.js +2 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-change.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-display-mode-type.js +2 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-display-mode-type.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-item-status.js +20 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-item-status.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-message-type.js +28 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-message-type.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-message.js +2 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-message.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-mode.js +16 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-mode.js.map +1 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-nav-button-type.js +2 -0
- package/esm2015/lib/modules/progress-indicator/types/progress-indicator-nav-button-type.js.map +1 -0
- package/esm2015/lib/modules/shared/sky-progress-indicator-resources.module.js +50 -0
- package/esm2015/lib/modules/shared/sky-progress-indicator-resources.module.js.map +1 -0
- package/esm2015/skyux-progress-indicator.js +2 -2
- package/esm2015/skyux-progress-indicator.js.map +1 -0
- package/fesm2015/skyux-progress-indicator.js +1 -1
- package/fesm2015/skyux-progress-indicator.js.map +1 -1
- package/index.d.ts +15 -0
- package/{modules → lib/modules}/progress-indicator/progress-indicator-item/progress-indicator-item.component.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button.component.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/progress-indicator-reset-button/progress-indicator-reset-button.component.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/progress-indicator-status-marker/progress-indicator-status-marker.component.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/progress-indicator-title/progress-indicator-title.component.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/progress-indicator.component.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/progress-indicator.module.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/types/progress-indicator-action-click-args.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/types/progress-indicator-action-click-progress-handler.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/types/progress-indicator-change.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/types/progress-indicator-display-mode-type.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/types/progress-indicator-item-status.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/types/progress-indicator-message-type.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/types/progress-indicator-message.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/types/progress-indicator-mode.d.ts +0 -0
- package/{modules → lib/modules}/progress-indicator/types/progress-indicator-nav-button-type.d.ts +0 -0
- package/{modules → lib/modules}/shared/sky-progress-indicator-resources.module.d.ts +0 -0
- package/package.json +18 -4
- package/skyux-progress-indicator.d.ts +1 -1
- package/LICENSE +0 -21
- package/esm2015/modules/progress-indicator/progress-indicator-item/progress-indicator-item.component.js +0 -74
- package/esm2015/modules/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button.component.js +0 -222
- package/esm2015/modules/progress-indicator/progress-indicator-reset-button/progress-indicator-reset-button.component.js +0 -58
- package/esm2015/modules/progress-indicator/progress-indicator.component.js +0 -316
- package/esm2015/modules/progress-indicator/progress-indicator.module.js +0 -65
- package/esm2015/modules/progress-indicator/types/progress-indicator-action-click-args.js +0 -2
- package/esm2015/modules/progress-indicator/types/progress-indicator-action-click-progress-handler.js +0 -14
- package/esm2015/modules/progress-indicator/types/progress-indicator-change.js +0 -2
- package/esm2015/modules/progress-indicator/types/progress-indicator-display-mode-type.js +0 -2
- package/esm2015/modules/progress-indicator/types/progress-indicator-item-status.js +0 -20
- package/esm2015/modules/progress-indicator/types/progress-indicator-message-type.js +0 -28
- package/esm2015/modules/progress-indicator/types/progress-indicator-message.js +0 -2
- package/esm2015/modules/progress-indicator/types/progress-indicator-mode.js +0 -16
- package/esm2015/modules/progress-indicator/types/progress-indicator-nav-button-type.js +0 -2
- package/esm2015/modules/shared/sky-progress-indicator-resources.module.js +0 -50
- package/esm2015/public-api.js +0 -18
- package/public-api.d.ts +0 -15
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Optional, Output, } from '@angular/core';
|
|
2
|
+
import { Subject } from 'rxjs';
|
|
3
|
+
import { distinctUntilChanged, takeUntil } from 'rxjs/operators';
|
|
4
|
+
import { SkyProgressIndicatorActionClickProgressHandler } from '../types/progress-indicator-action-click-progress-handler';
|
|
5
|
+
import { SkyProgressIndicatorMessageType } from '../types/progress-indicator-message-type';
|
|
6
|
+
import { SkyProgressIndicatorComponent } from '../progress-indicator.component';
|
|
7
|
+
import * as i0 from "@angular/core";
|
|
8
|
+
import * as i1 from "../progress-indicator.component";
|
|
9
|
+
import * as i2 from "@angular/common";
|
|
10
|
+
import * as i3 from "@skyux/theme";
|
|
11
|
+
import * as i4 from "@skyux/i18n";
|
|
12
|
+
/**
|
|
13
|
+
* Displays a button to navigate the steps in modal wizards. We recommend against using it in
|
|
14
|
+
* passive progress indicators and waterfall progress indicators.
|
|
15
|
+
*/
|
|
16
|
+
export class SkyProgressIndicatorNavButtonComponent {
|
|
17
|
+
constructor(changeDetector, parentComponent) {
|
|
18
|
+
this.changeDetector = changeDetector;
|
|
19
|
+
this.parentComponent = parentComponent;
|
|
20
|
+
/**
|
|
21
|
+
* Fires when users select the nav button and emits a `SkyProgressIndicatorActionClickArgs`
|
|
22
|
+
* object that is passed into the callback function to allow consumers to decide whether
|
|
23
|
+
* the button’s action should complete successfully.
|
|
24
|
+
*/
|
|
25
|
+
this.actionClick = new EventEmitter();
|
|
26
|
+
this.ngUnsubscribe = new Subject();
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Specifies the type of nav button to include.
|
|
30
|
+
* The valid options are `"finish"`, `"next"`, `"previous"`, and `"reset"`.
|
|
31
|
+
* @default "next"
|
|
32
|
+
*/
|
|
33
|
+
set buttonType(value) {
|
|
34
|
+
this._buttonType = value;
|
|
35
|
+
}
|
|
36
|
+
get buttonType() {
|
|
37
|
+
if (this._buttonType === undefined) {
|
|
38
|
+
return 'next';
|
|
39
|
+
}
|
|
40
|
+
return this._buttonType;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Indicates whether to disable the nav button.
|
|
44
|
+
* @default false
|
|
45
|
+
*/
|
|
46
|
+
set disabled(value) {
|
|
47
|
+
this._disabled = value;
|
|
48
|
+
this.changeDetector.markForCheck();
|
|
49
|
+
}
|
|
50
|
+
get disabled() {
|
|
51
|
+
const buttonType = this.buttonType;
|
|
52
|
+
const activeIndex = this.lastProgressChange.activeIndex;
|
|
53
|
+
const isLastStep = activeIndex === this.lastProgressChange.itemStatuses.length - 1;
|
|
54
|
+
if (buttonType === 'previous' && activeIndex === 0) {
|
|
55
|
+
return true;
|
|
56
|
+
}
|
|
57
|
+
if (buttonType === 'next' && isLastStep) {
|
|
58
|
+
return true;
|
|
59
|
+
}
|
|
60
|
+
return this._disabled || false;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Specifies the progress indicator component to associate with the nav button.
|
|
64
|
+
* @required
|
|
65
|
+
*/
|
|
66
|
+
set progressIndicator(value) {
|
|
67
|
+
this._progressIndicator = value;
|
|
68
|
+
if (value) {
|
|
69
|
+
if (this.buttonType === 'finish') {
|
|
70
|
+
// The `hasFinishButton` field was added to support legacy API.
|
|
71
|
+
// Some implementations only include a next button; we cannot
|
|
72
|
+
// assume that every implementation includes both a finish button and a next button.
|
|
73
|
+
this._progressIndicator.hasFinishButton = true;
|
|
74
|
+
}
|
|
75
|
+
this._progressIndicator.progressChanges
|
|
76
|
+
.pipe(distinctUntilChanged(), takeUntil(this.ngUnsubscribe))
|
|
77
|
+
.subscribe((change) => {
|
|
78
|
+
this.lastProgressChange = change;
|
|
79
|
+
this.updateButtonVisibility(change);
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
else {
|
|
83
|
+
if (!this.parentTimeout) {
|
|
84
|
+
this.parentTimeout = window.setTimeout(() => {
|
|
85
|
+
/* istanbul ignore else */
|
|
86
|
+
if (!this.progressIndicator) {
|
|
87
|
+
throw new Error('The `<sky-progress-indicator-nav-button>` component requires a reference to ' +
|
|
88
|
+
'the `<sky-progress-indicator>` component it controls. For example:\n' +
|
|
89
|
+
'<sky-progress-indicator\n' +
|
|
90
|
+
' #myProgressIndicator\n' +
|
|
91
|
+
'>\n' +
|
|
92
|
+
'</sky-progress-indicator>\n' +
|
|
93
|
+
'<sky-progress-indicator-nav-button\n' +
|
|
94
|
+
' [progressIndicator]="myProgressIndicator"\n' +
|
|
95
|
+
'>\n' +
|
|
96
|
+
'</sky-progress-indicator-nav-button>');
|
|
97
|
+
}
|
|
98
|
+
}, 50);
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
get progressIndicator() {
|
|
103
|
+
return this._progressIndicator;
|
|
104
|
+
}
|
|
105
|
+
get cssClassNames() {
|
|
106
|
+
const buttonType = this.buttonType;
|
|
107
|
+
const classNames = [`sky-progress-indicator-nav-button-${this.buttonType}`];
|
|
108
|
+
switch (buttonType) {
|
|
109
|
+
case 'next':
|
|
110
|
+
case 'finish':
|
|
111
|
+
classNames.push('sky-btn-primary');
|
|
112
|
+
break;
|
|
113
|
+
case 'reset':
|
|
114
|
+
classNames.push('sky-btn-link');
|
|
115
|
+
break;
|
|
116
|
+
default:
|
|
117
|
+
classNames.push('sky-btn-default');
|
|
118
|
+
break;
|
|
119
|
+
}
|
|
120
|
+
return classNames.join(' ');
|
|
121
|
+
}
|
|
122
|
+
get buttonLabelResourceString() {
|
|
123
|
+
return `skyux_progress_indicator_navigator_${this.buttonType}`;
|
|
124
|
+
}
|
|
125
|
+
set isVisible(value) {
|
|
126
|
+
this._isVisible = value;
|
|
127
|
+
this.changeDetector.markForCheck();
|
|
128
|
+
}
|
|
129
|
+
get isVisible() {
|
|
130
|
+
return this._isVisible || false;
|
|
131
|
+
}
|
|
132
|
+
ngAfterViewInit() {
|
|
133
|
+
if (!this.progressIndicator && this.parentComponent) {
|
|
134
|
+
this.progressIndicator = this.parentComponent;
|
|
135
|
+
}
|
|
136
|
+
else if (!this.progressIndicator) {
|
|
137
|
+
this.progressIndicator = undefined;
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
ngOnDestroy() {
|
|
141
|
+
this.ngUnsubscribe.next();
|
|
142
|
+
this.ngUnsubscribe.complete();
|
|
143
|
+
this.actionClick.complete();
|
|
144
|
+
}
|
|
145
|
+
onClick(event) {
|
|
146
|
+
event.preventDefault();
|
|
147
|
+
let type;
|
|
148
|
+
switch (this.buttonType) {
|
|
149
|
+
case 'finish':
|
|
150
|
+
type = SkyProgressIndicatorMessageType.Finish;
|
|
151
|
+
break;
|
|
152
|
+
case 'next':
|
|
153
|
+
type = SkyProgressIndicatorMessageType.Progress;
|
|
154
|
+
break;
|
|
155
|
+
case 'previous':
|
|
156
|
+
type = SkyProgressIndicatorMessageType.Regress;
|
|
157
|
+
break;
|
|
158
|
+
case 'reset':
|
|
159
|
+
type = SkyProgressIndicatorMessageType.Reset;
|
|
160
|
+
break;
|
|
161
|
+
default:
|
|
162
|
+
break;
|
|
163
|
+
}
|
|
164
|
+
// If the consumer has subscribed to the `actionClick` event,
|
|
165
|
+
// allow them to decide when to advance to the next step.
|
|
166
|
+
if (this.actionClick.observers.length > 0) {
|
|
167
|
+
this.actionClick.emit({
|
|
168
|
+
event,
|
|
169
|
+
progressHandler: new SkyProgressIndicatorActionClickProgressHandler(() => {
|
|
170
|
+
this.progressIndicator.sendMessage({ type });
|
|
171
|
+
}),
|
|
172
|
+
});
|
|
173
|
+
}
|
|
174
|
+
else {
|
|
175
|
+
this.progressIndicator.sendMessage({ type });
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
updateButtonVisibility(change) {
|
|
179
|
+
const isLastStep = change.activeIndex === change.itemStatuses.length - 1;
|
|
180
|
+
const buttonType = this.buttonType;
|
|
181
|
+
// Hide the button if all steps are complete
|
|
182
|
+
// (except for the reset button)
|
|
183
|
+
if (buttonType !== 'reset' && change.isComplete) {
|
|
184
|
+
this.isVisible = false;
|
|
185
|
+
return;
|
|
186
|
+
}
|
|
187
|
+
if (buttonType === 'finish') {
|
|
188
|
+
this.isVisible = isLastStep;
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
// Hide the next button on the last step only if a finish button exists.
|
|
192
|
+
if (buttonType === 'next' &&
|
|
193
|
+
isLastStep &&
|
|
194
|
+
this.progressIndicator.hasFinishButton) {
|
|
195
|
+
this.isVisible = false;
|
|
196
|
+
return;
|
|
197
|
+
}
|
|
198
|
+
this.isVisible = true;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
SkyProgressIndicatorNavButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyProgressIndicatorNavButtonComponent, deps: [{ token: i0.ChangeDetectorRef }, { token: i1.SkyProgressIndicatorComponent, optional: true }], target: i0.ɵɵFactoryTarget.Component });
|
|
202
|
+
SkyProgressIndicatorNavButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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\"\n type=\"button\"\n [disabled]=\"disabled\"\n [ngClass]=\"cssClassNames\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-compact': 'default',\n 'sky-btn-link': 'modern'\n }\"\n (click)=\"onClick($event)\"\n>\n {{ buttonText || (buttonLabelResourceString | skyLibResources) }}\n</button>\n", directives: [{ type: i2.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { type: i2.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { type: i3.λ2, selector: "[skyThemeClass]", inputs: ["class", "skyThemeClass"] }], pipes: { "skyLibResources": i4.SkyLibResourcesPipe }, changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
203
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyProgressIndicatorNavButtonComponent, decorators: [{
|
|
204
|
+
type: Component,
|
|
205
|
+
args: [{
|
|
206
|
+
selector: 'sky-progress-indicator-nav-button',
|
|
207
|
+
templateUrl: './progress-indicator-nav-button.component.html',
|
|
208
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
209
|
+
}]
|
|
210
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }, { type: i1.SkyProgressIndicatorComponent, decorators: [{
|
|
211
|
+
type: Optional
|
|
212
|
+
}] }]; }, propDecorators: { buttonText: [{
|
|
213
|
+
type: Input
|
|
214
|
+
}], buttonType: [{
|
|
215
|
+
type: Input
|
|
216
|
+
}], disabled: [{
|
|
217
|
+
type: Input
|
|
218
|
+
}], progressIndicator: [{
|
|
219
|
+
type: Input
|
|
220
|
+
}], actionClick: [{
|
|
221
|
+
type: Output
|
|
222
|
+
}] } });
|
|
223
|
+
//# sourceMappingURL=progress-indicator-nav-button.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-indicator-nav-button.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/progress-indicator/src/lib/modules/progress-indicator/progress-indicator-nav-button/progress-indicator-nav-button.component.ts","../../../../../../../../../libs/components/progress-indicator/src/lib/modules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;QAChC,IAAI,UAAU,KAAK,OAAO,IAAI,MAAM,CAAC,UAAU,EAAE;YAC/C,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,OAAO;SACR;QAED,IAAI,UAAU,KAAK,QAAQ,EAAE;YAC3B,IAAI,CAAC,SAAS,GAAG,UAAU,CAAC;YAC5B,OAAO;SACR;QAED,wEAAwE;QACxE,IACE,UAAU,KAAK,MAAM;YACrB,UAAU;YACV,IAAI,CAAC,iBAAiB,CAAC,eAAe,EACtC;YACA,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;YACvB,OAAO;SACR;QAED,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC;IACxB,CAAC;;oIArPU,sCAAsC;wHAAtC,sCAAsC,gPCrCnD,+VAcA;4FDuBa,sCAAsC;kBALlD,SAAS;mBAAC;oBACT,QAAQ,EAAE,mCAAmC;oBAC7C,WAAW,EAAE,gDAAgD;oBAC7D,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;0BAgKI,QAAQ;4CAvJJ,UAAU;sBADhB,KAAK;gBASK,UAAU;sBADpB,KAAK;gBAkBK,QAAQ;sBADlB,KAAK;gBA4BK,iBAAiB;sBAD3B,KAAK;gBAmDC,WAAW;sBADjB,MAAM","sourcesContent":["import {\n AfterViewInit,\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n Optional,\n Output,\n} from '@angular/core';\n\nimport { Subject } from 'rxjs';\n\nimport { distinctUntilChanged, takeUntil } from 'rxjs/operators';\n\nimport { SkyProgressIndicatorActionClickArgs } from '../types/progress-indicator-action-click-args';\n\nimport { SkyProgressIndicatorActionClickProgressHandler } from '../types/progress-indicator-action-click-progress-handler';\n\nimport { SkyProgressIndicatorChange } from '../types/progress-indicator-change';\n\nimport { SkyProgressIndicatorMessageType } from '../types/progress-indicator-message-type';\n\nimport { SkyProgressIndicatorNavButtonType } from '../types/progress-indicator-nav-button-type';\n\nimport { SkyProgressIndicatorComponent } from '../progress-indicator.component';\n\n/**\n * Displays a button to navigate the steps in modal wizards. We recommend against using it in\n * passive progress indicators and waterfall progress indicators.\n */\n@Component({\n selector: 'sky-progress-indicator-nav-button',\n templateUrl: './progress-indicator-nav-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyProgressIndicatorNavButtonComponent\n implements AfterViewInit, OnDestroy\n{\n /**\n * Specifies the label to display on the nav button.\n * @default \"Next\"\n */\n @Input()\n public buttonText: string;\n\n /**\n * Specifies the type of nav button to include.\n * The valid options are `\"finish\"`, `\"next\"`, `\"previous\"`, and `\"reset\"`.\n * @default \"next\"\n */\n @Input()\n public set buttonType(value: SkyProgressIndicatorNavButtonType) {\n this._buttonType = value;\n }\n\n public get buttonType(): SkyProgressIndicatorNavButtonType {\n if (this._buttonType === undefined) {\n return 'next';\n }\n\n return this._buttonType;\n }\n\n /**\n * Indicates whether to disable the nav button.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this._disabled = value;\n this.changeDetector.markForCheck();\n }\n\n public get disabled(): boolean {\n const buttonType = this.buttonType;\n const activeIndex = this.lastProgressChange.activeIndex;\n const isLastStep =\n activeIndex === this.lastProgressChange.itemStatuses.length - 1;\n\n if (buttonType === 'previous' && activeIndex === 0) {\n return true;\n }\n\n if (buttonType === 'next' && isLastStep) {\n return true;\n }\n\n return this._disabled || false;\n }\n\n /**\n * Specifies the progress indicator component to associate with the nav button.\n * @required\n */\n @Input()\n public set progressIndicator(value: SkyProgressIndicatorComponent) {\n this._progressIndicator = value;\n\n if (value) {\n if (this.buttonType === 'finish') {\n // The `hasFinishButton` field was added to support legacy API.\n // Some implementations only include a next button; we cannot\n // assume that every implementation includes both a finish button and a next button.\n this._progressIndicator.hasFinishButton = true;\n }\n\n this._progressIndicator.progressChanges\n .pipe(distinctUntilChanged(), takeUntil(this.ngUnsubscribe))\n .subscribe((change: SkyProgressIndicatorChange) => {\n this.lastProgressChange = change;\n this.updateButtonVisibility(change);\n });\n } else {\n if (!this.parentTimeout) {\n this.parentTimeout = window.setTimeout(() => {\n /* istanbul ignore else */\n if (!this.progressIndicator) {\n throw new Error(\n 'The `<sky-progress-indicator-nav-button>` component requires a reference to ' +\n 'the `<sky-progress-indicator>` component it controls. For example:\\n' +\n '<sky-progress-indicator\\n' +\n ' #myProgressIndicator\\n' +\n '>\\n' +\n '</sky-progress-indicator>\\n' +\n '<sky-progress-indicator-nav-button\\n' +\n ' [progressIndicator]=\"myProgressIndicator\"\\n' +\n '>\\n' +\n '</sky-progress-indicator-nav-button>'\n );\n }\n }, 50);\n }\n }\n }\n\n public get progressIndicator(): SkyProgressIndicatorComponent {\n return this._progressIndicator;\n }\n\n /**\n * Fires when users select the nav button and emits a `SkyProgressIndicatorActionClickArgs`\n * object that is passed into the callback function to allow consumers to decide whether\n * the button’s action should complete successfully.\n */\n @Output()\n public actionClick = new EventEmitter<SkyProgressIndicatorActionClickArgs>();\n\n public get cssClassNames(): string {\n const buttonType = this.buttonType;\n\n const classNames = [`sky-progress-indicator-nav-button-${this.buttonType}`];\n\n switch (buttonType) {\n case 'next':\n case 'finish':\n classNames.push('sky-btn-primary');\n break;\n\n case 'reset':\n classNames.push('sky-btn-link');\n break;\n\n default:\n classNames.push('sky-btn-default');\n break;\n }\n\n return classNames.join(' ');\n }\n\n public get buttonLabelResourceString(): string {\n return `skyux_progress_indicator_navigator_${this.buttonType}`;\n }\n\n public set isVisible(value: boolean) {\n this._isVisible = value;\n this.changeDetector.markForCheck();\n }\n\n public get isVisible(): boolean {\n return this._isVisible || false;\n }\n\n private lastProgressChange: SkyProgressIndicatorChange;\n private ngUnsubscribe = new Subject<void>();\n private parentTimeout: number;\n\n private _buttonType: SkyProgressIndicatorNavButtonType;\n private _disabled: boolean;\n private _isVisible: boolean;\n private _progressIndicator: SkyProgressIndicatorComponent;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n @Optional() private parentComponent: SkyProgressIndicatorComponent\n ) {}\n\n public ngAfterViewInit(): void {\n if (!this.progressIndicator && this.parentComponent) {\n this.progressIndicator = this.parentComponent;\n } else if (!this.progressIndicator) {\n this.progressIndicator = undefined;\n }\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n this.actionClick.complete();\n }\n\n public onClick(event: MouseEvent): void {\n event.preventDefault();\n\n let type: SkyProgressIndicatorMessageType;\n\n switch (this.buttonType) {\n case 'finish':\n type = SkyProgressIndicatorMessageType.Finish;\n break;\n\n case 'next':\n type = SkyProgressIndicatorMessageType.Progress;\n break;\n\n case 'previous':\n type = SkyProgressIndicatorMessageType.Regress;\n break;\n\n case 'reset':\n type = SkyProgressIndicatorMessageType.Reset;\n break;\n\n default:\n break;\n }\n\n // If the consumer has subscribed to the `actionClick` event,\n // allow them to decide when to advance to the next step.\n if (this.actionClick.observers.length > 0) {\n this.actionClick.emit({\n event,\n progressHandler: new SkyProgressIndicatorActionClickProgressHandler(\n () => {\n this.progressIndicator.sendMessage({ type });\n }\n ),\n });\n } else {\n this.progressIndicator.sendMessage({ type });\n }\n }\n\n private updateButtonVisibility(change: SkyProgressIndicatorChange): void {\n const isLastStep = change.activeIndex === change.itemStatuses.length - 1;\n const buttonType = this.buttonType;\n\n // Hide the button if all steps are complete\n // (except for the reset button)\n if (buttonType !== 'reset' && change.isComplete) {\n this.isVisible = false;\n return;\n }\n\n if (buttonType === 'finish') {\n this.isVisible = isLastStep;\n return;\n }\n\n // Hide the next button on the last step only if a finish button exists.\n if (\n buttonType === 'next' &&\n isLastStep &&\n this.progressIndicator.hasFinishButton\n ) {\n this.isVisible = false;\n return;\n }\n\n this.isVisible = true;\n }\n}\n","<button\n *ngIf=\"isVisible\"\n class=\"sky-btn\"\n type=\"button\"\n [disabled]=\"disabled\"\n [ngClass]=\"cssClassNames\"\n [skyThemeClass]=\"{\n 'sky-margin-inline-compact': 'default',\n 'sky-btn-link': 'modern'\n }\"\n (click)=\"onClick($event)\"\n>\n {{ buttonText || (buttonLabelResourceString | skyLibResources) }}\n</button>\n"]}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, EventEmitter, Input, Output, } from '@angular/core';
|
|
2
|
+
import { SkyProgressIndicatorMessageType } from '../types/progress-indicator-message-type';
|
|
3
|
+
import { SkyProgressIndicatorComponent } from '../progress-indicator.component';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Displays a button to mark all items in the progress indicator as incomplete and set the
|
|
7
|
+
* first item as the active item. The steps after the active item remain incomplete until
|
|
8
|
+
* users reach them in their sequential order.
|
|
9
|
+
*/
|
|
10
|
+
export class SkyProgressIndicatorResetButtonComponent {
|
|
11
|
+
constructor(changeDetector) {
|
|
12
|
+
this.changeDetector = changeDetector;
|
|
13
|
+
/**
|
|
14
|
+
* Fires when users select the reset button that marks all items as incomplete and sets the
|
|
15
|
+
* first item as the active item.
|
|
16
|
+
*/
|
|
17
|
+
this.resetClick = new EventEmitter();
|
|
18
|
+
console.warn('[Deprecation warning] The `<sky-progress-indicator-reset-button>` component is ' +
|
|
19
|
+
'deprecated. Please use the `<sky-progress-indicator-nav-button>` component instead, with ' +
|
|
20
|
+
'`buttonType` set to "reset".');
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Indicates whether to disable the reset button.
|
|
24
|
+
* @default false
|
|
25
|
+
*/
|
|
26
|
+
set disabled(value) {
|
|
27
|
+
this._disabled = value;
|
|
28
|
+
this.changeDetector.markForCheck();
|
|
29
|
+
}
|
|
30
|
+
get disabled() {
|
|
31
|
+
return this._disabled || false;
|
|
32
|
+
}
|
|
33
|
+
ngOnDestroy() {
|
|
34
|
+
this.resetClick.complete();
|
|
35
|
+
}
|
|
36
|
+
onClick() {
|
|
37
|
+
this.resetClick.emit();
|
|
38
|
+
this.progressIndicator.sendMessage({
|
|
39
|
+
type: SkyProgressIndicatorMessageType.Reset,
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
SkyProgressIndicatorResetButtonComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyProgressIndicatorResetButtonComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component });
|
|
44
|
+
SkyProgressIndicatorResetButtonComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.16", 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 });
|
|
45
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImport: i0, type: SkyProgressIndicatorResetButtonComponent, decorators: [{
|
|
46
|
+
type: Component,
|
|
47
|
+
args: [{
|
|
48
|
+
selector: 'sky-progress-indicator-reset-button',
|
|
49
|
+
templateUrl: './progress-indicator-reset-button.component.html',
|
|
50
|
+
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
51
|
+
}]
|
|
52
|
+
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { disabled: [{
|
|
53
|
+
type: Input
|
|
54
|
+
}], progressIndicator: [{
|
|
55
|
+
type: Input
|
|
56
|
+
}], resetClick: [{
|
|
57
|
+
type: Output
|
|
58
|
+
}] } });
|
|
59
|
+
//# sourceMappingURL=progress-indicator-reset-button.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-indicator-reset-button.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/progress-indicator/src/lib/modules/progress-indicator/progress-indicator-reset-button/progress-indicator-reset-button.component.ts","../../../../../../../../../libs/components/progress-indicator/src/lib/modules/progress-indicator/progress-indicator-reset-button/progress-indicator-reset-button.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,YAAY,EACZ,KAAK,EAEL,MAAM,GACP,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,+BAA+B,EAAE,MAAM,0CAA0C,CAAC;AAE3F,OAAO,EAAE,6BAA6B,EAAE,MAAM,iCAAiC,CAAC;;AAEhF;;;;GAIG;AAMH,MAAM,OAAO,wCAAwC;IA+BnD,YAAoB,cAAiC;QAAjC,mBAAc,GAAd,cAAc,CAAmB;QATrD;;;WAGG;QAEI,eAAU,GAAG,IAAI,YAAY,EAAO,CAAC;QAK1C,OAAO,CAAC,IAAI,CACV,iFAAiF;YAC/E,2FAA2F;YAC3F,8BAA8B,CACjC,CAAC;IACJ,CAAC;IApCD;;;OAGG;IACH,IACW,QAAQ,CAAC,KAAc;QAChC,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;QACvB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IACrC,CAAC;IAED,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,IAAI,KAAK,CAAC;IACjC,CAAC;IA0BM,WAAW;QAChB,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,CAAC;IAC7B,CAAC;IAEM,OAAO;QACZ,IAAI,CAAC,UAAU,CAAC,IAAI,EAAE,CAAC;QAEvB,IAAI,CAAC,iBAAiB,CAAC,WAAW,CAAC;YACjC,IAAI,EAAE,+BAA+B,CAAC,KAAK;SAC5C,CAAC,CAAC;IACL,CAAC;;sIAjDU,wCAAwC;0HAAxC,wCAAwC,4LCxBrD,+JAQA;4FDgBa,wCAAwC;kBALpD,SAAS;mBAAC;oBACT,QAAQ,EAAE,qCAAqC;oBAC/C,WAAW,EAAE,kDAAkD;oBAC/D,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;wGAOY,QAAQ;sBADlB,KAAK;gBAeC,iBAAiB;sBADvB,KAAK;gBAQC,UAAU;sBADhB,MAAM","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n EventEmitter,\n Input,\n OnDestroy,\n Output,\n} from '@angular/core';\n\nimport { SkyProgressIndicatorMessageType } from '../types/progress-indicator-message-type';\n\nimport { SkyProgressIndicatorComponent } from '../progress-indicator.component';\n\n/**\n * Displays a button to mark all items in the progress indicator as incomplete and set the\n * first item as the active item. The steps after the active item remain incomplete until\n * users reach them in their sequential order.\n */\n@Component({\n selector: 'sky-progress-indicator-reset-button',\n templateUrl: './progress-indicator-reset-button.component.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyProgressIndicatorResetButtonComponent implements OnDestroy {\n /**\n * Indicates whether to disable the reset button.\n * @default false\n */\n @Input()\n public set disabled(value: boolean) {\n this._disabled = value;\n this.changeDetector.markForCheck();\n }\n\n public get disabled(): boolean {\n return this._disabled || false;\n }\n\n /**\n * Specifies the progress indicator component to associate with the reset button.\n * @required\n */\n @Input()\n public progressIndicator: SkyProgressIndicatorComponent;\n\n /**\n * Fires when users select the reset button that marks all items as incomplete and sets the\n * first item as the active item.\n */\n @Output()\n public resetClick = new EventEmitter<any>();\n\n private _disabled: boolean;\n\n constructor(private changeDetector: ChangeDetectorRef) {\n console.warn(\n '[Deprecation warning] The `<sky-progress-indicator-reset-button>` component is ' +\n 'deprecated. Please use the `<sky-progress-indicator-nav-button>` component instead, with ' +\n '`buttonType` set to \"reset\".'\n );\n }\n\n public ngOnDestroy(): void {\n this.resetClick.complete();\n }\n\n public onClick(): void {\n this.resetClick.emit();\n\n this.progressIndicator.sendMessage({\n type: SkyProgressIndicatorMessageType.Reset,\n });\n }\n}\n","<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"]}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { ChangeDetectionStrategy, Component, Input, Optional, } from '@angular/core';
|
|
1
|
+
import { ChangeDetectionStrategy, ChangeDetectorRef, Component, Input, Optional, } from '@angular/core';
|
|
2
|
+
import { SkyThemeService } from '@skyux/theme';
|
|
2
3
|
import { takeUntil } from 'rxjs/operators';
|
|
3
4
|
import { Subject } from 'rxjs';
|
|
4
5
|
import { SkyProgressIndicatorItemStatus } from '../types/progress-indicator-item-status';
|
|
@@ -80,4 +81,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
80
81
|
}], status: [{
|
|
81
82
|
type: Input
|
|
82
83
|
}] } });
|
|
83
|
-
//# sourceMappingURL=
|
|
84
|
+
//# sourceMappingURL=progress-indicator-status-marker.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-indicator-status-marker.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/progress-indicator/src/lib/modules/progress-indicator/progress-indicator-status-marker/progress-indicator-status-marker.component.ts","../../../../../../../../../libs/components/progress-indicator/src/lib/modules/progress-indicator/progress-indicator-status-marker/progress-indicator-status-marker.component.html"],"names":[],"mappings":"AAAA,OAAO,EACL,uBAAuB,EACvB,iBAAiB,EACjB,SAAS,EACT,KAAK,EAEL,QAAQ,GACT,MAAM,eAAe,CAAC;AAEvB,OAAO,EAAE,eAAe,EAAE,MAAM,cAAc,CAAC;AAE/C,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAE3C,OAAO,EAAE,OAAO,EAAE,MAAM,MAAM,CAAC;AAE/B,OAAO,EAAE,8BAA8B,EAAE,MAAM,yCAAyC,CAAC;;;;;AAEzF;;;GAGG;AAOH,MAAM,OAAO,yCAAyC;IA2DpD,YACU,cAAiC,EAC7B,QAA0B;QAD9B,mBAAc,GAAd,cAAc,CAAmB;QANnC,kBAAa,GAAG,IAAI,OAAO,EAAQ,CAAC;QAS1C,mCAAmC;QACnC,QAAQ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CAAC,aAAa,CAAC,IAAI,EAAE,CAAC;QAC1B,IAAI,CAAC,aAAa,CAAC,QAAQ,EAAE,CAAC;IAChC,CAAC;;uIA1EU,yCAAyC;2HAAzC,yCAAyC,sIC3BtD,qkBAiBA;4FDUa,yCAAyC;kBANrD,SAAS;mBAAC;oBACT,QAAQ,EAAE,sCAAsC;oBAChD,WAAW,EAAE,mDAAmD;oBAChE,SAAS,EAAE,CAAC,mDAAmD,CAAC;oBAChE,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD;;0BA8DI,QAAQ;4CA3DA,WAAW;sBADrB,KAAK;gBAcK,MAAM;sBADhB,KAAK","sourcesContent":["import {\n ChangeDetectionStrategy,\n ChangeDetectorRef,\n Component,\n Input,\n OnDestroy,\n Optional,\n} from '@angular/core';\n\nimport { SkyThemeService } from '@skyux/theme';\n\nimport { takeUntil } from 'rxjs/operators';\n\nimport { Subject } from 'rxjs';\n\nimport { SkyProgressIndicatorItemStatus } from '../types/progress-indicator-item-status';\n\n/**\n * Specifies the content to display in the status marker.\n * @internal\n */\n@Component({\n selector: 'sky-progress-indicator-status-marker',\n templateUrl: './progress-indicator-status-marker.component.html',\n styleUrls: ['./progress-indicator-status-marker.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyProgressIndicatorStatusMarkerComponent implements OnDestroy {\n @Input()\n public set displayMode(value: 'vertical' | 'horizontal') {\n this._displayMode = value;\n }\n\n public get displayMode(): 'vertical' | 'horizontal' {\n if (this._displayMode === undefined) {\n return 'vertical';\n }\n\n return this._displayMode;\n }\n\n @Input()\n public set status(value: SkyProgressIndicatorItemStatus) {\n this._status = value;\n this.changeDetector.markForCheck();\n }\n\n public get cssClassNames(): string {\n const classNames = [\n `sky-progress-indicator-status-marker-mode-${this.displayMode}`,\n `sky-progress-indicator-status-marker-status-${this.statusName}`,\n ];\n\n return classNames.join(' ');\n }\n\n public get statusName(): string {\n let name: string;\n\n /* tslint:disable-next-line:switch-default */\n switch (this._status) {\n case SkyProgressIndicatorItemStatus.Active:\n name = 'active';\n break;\n\n case SkyProgressIndicatorItemStatus.Complete:\n name = 'complete';\n break;\n\n case SkyProgressIndicatorItemStatus.Incomplete:\n name = 'incomplete';\n break;\n\n case SkyProgressIndicatorItemStatus.Pending:\n name = 'pending';\n break;\n }\n\n return name;\n }\n\n private ngUnsubscribe = new Subject<void>();\n\n private _displayMode: 'vertical' | 'horizontal';\n private _status: SkyProgressIndicatorItemStatus;\n\n constructor(\n private changeDetector: ChangeDetectorRef,\n @Optional() themeSvc?: SkyThemeService\n ) {\n // Update icons when theme changes.\n themeSvc?.settingsChange\n .pipe(takeUntil(this.ngUnsubscribe))\n .subscribe(() => {\n this.changeDetector.markForCheck();\n });\n }\n\n public ngOnDestroy(): void {\n this.ngUnsubscribe.next();\n this.ngUnsubscribe.complete();\n }\n}\n","<div\n class=\"sky-progress-indicator-status-marker\"\n role=\"presentation\"\n [ngClass]=\"cssClassNames\"\n>\n <div\n *skyThemeIf=\"'default'\"\n class=\"sky-progress-indicator-status-marker-icon\"\n >\n <sky-icon *ngIf=\"statusName === 'complete'\" icon=\"check\"> </sky-icon>\n </div>\n <div *skyThemeIf=\"'modern'\" class=\"sky-progress-indicator-status-marker-icon\">\n <sky-icon *ngIf=\"statusName === 'complete'\" icon=\"check\" iconType=\"skyux\">\n </sky-icon>\n </div>\n <div class=\"sky-progress-indicator-status-marker-line\"></div>\n</div>\n"]}
|
|
@@ -17,4 +17,4 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.16", ngImpo
|
|
|
17
17
|
changeDetection: ChangeDetectionStrategy.OnPush,
|
|
18
18
|
}]
|
|
19
19
|
}] });
|
|
20
|
-
//# sourceMappingURL=
|
|
20
|
+
//# sourceMappingURL=progress-indicator-title.component.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"progress-indicator-title.component.js","sourceRoot":"","sources":["../../../../../../../../../libs/components/progress-indicator/src/lib/modules/progress-indicator/progress-indicator-title/progress-indicator-title.component.ts","../../../../../../../../../libs/components/progress-indicator/src/lib/modules/progress-indicator/progress-indicator-title/progress-indicator-title.component.html"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;;;AAEnE;;GAEG;AAOH,MAAM,OAAO,kCAAkC;;gIAAlC,kCAAkC;oHAAlC,kCAAkC,oECX/C,2OAWA;4FDAa,kCAAkC;kBAN9C,SAAS;mBAAC;oBACT,QAAQ,EAAE,8BAA8B;oBACxC,WAAW,EAAE,2CAA2C;oBACxD,SAAS,EAAE,CAAC,2CAA2C,CAAC;oBACxD,eAAe,EAAE,uBAAuB,CAAC,MAAM;iBAChD","sourcesContent":["import { ChangeDetectionStrategy, Component } from '@angular/core';\n\n/**\n * Specifies a header to display above the progress indicator.\n */\n@Component({\n selector: 'sky-progress-indicator-title',\n templateUrl: './progress-indicator-title.component.html',\n styleUrls: ['./progress-indicator-title.component.scss'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport class SkyProgressIndicatorTitleComponent {}\n","<div\n aria-level=\"1\"\n class=\"sky-progress-indicator-title\"\n role=\"heading\"\n [skyThemeClass]=\"{\n 'sky-section-heading': 'default',\n 'sky-font-heading-1': 'modern'\n }\"\n>\n <ng-content></ng-content>\n</div>\n"]}
|