@clr/angular 18.0.0-beta.3 → 18.0.0-beta.5
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/fesm2022/clr-angular-data-datagrid.mjs +8 -2
- package/fesm2022/clr-angular-data-datagrid.mjs.map +1 -1
- package/fesm2022/clr-angular-forms-combobox.mjs +332 -39
- package/fesm2022/clr-angular-forms-combobox.mjs.map +1 -1
- package/fesm2022/clr-angular-layout-nav.mjs +27 -25
- package/fesm2022/clr-angular-layout-nav.mjs.map +1 -1
- package/fesm2022/clr-angular-modal.mjs +2 -3
- package/fesm2022/clr-angular-modal.mjs.map +1 -1
- package/fesm2022/clr-angular-utils.mjs +5 -0
- package/fesm2022/clr-angular-utils.mjs.map +1 -1
- package/fesm2022/clr-angular-wizard.mjs +427 -224
- package/fesm2022/clr-angular-wizard.mjs.map +1 -1
- package/package.json +7 -2
- package/schematics/collection.json +10 -0
- package/schematics/ng-update/index.d.ts +2 -0
- package/schematics/ng-update/index.js +69 -0
- package/schematics/ng-update/index.js.map +1 -0
- package/schematics/ng-update/migrations/css-migration.d.ts +6 -0
- package/schematics/ng-update/migrations/css-migration.js +177 -0
- package/schematics/ng-update/migrations/css-migration.js.map +1 -0
- package/schematics/ng-update/migrations/import-migration.d.ts +4 -0
- package/schematics/ng-update/migrations/import-migration.js +187 -0
- package/schematics/ng-update/migrations/import-migration.js.map +1 -0
- package/schematics/ng-update/migrations/template-migration.d.ts +6 -0
- package/schematics/ng-update/migrations/template-migration.js +203 -0
- package/schematics/ng-update/migrations/template-migration.js.map +1 -0
- package/schematics/ng-update/replacements/css-replacements.d.ts +17 -0
- package/schematics/ng-update/replacements/css-replacements.js +74 -0
- package/schematics/ng-update/replacements/css-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/import-replacements.d.ts +13 -0
- package/schematics/ng-update/replacements/import-replacements.js +101 -0
- package/schematics/ng-update/replacements/import-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/symbol-replacements.d.ts +12 -0
- package/schematics/ng-update/replacements/symbol-replacements.js +68 -0
- package/schematics/ng-update/replacements/symbol-replacements.js.map +1 -0
- package/schematics/ng-update/replacements/template-replacements.d.ts +14 -0
- package/schematics/ng-update/replacements/template-replacements.js +53 -0
- package/schematics/ng-update/replacements/template-replacements.js.map +1 -0
- package/schematics/ng-update/tests/test-helpers.d.ts +6 -0
- package/schematics/ng-update/tests/test-helpers.js +34 -0
- package/schematics/ng-update/tests/test-helpers.js.map +1 -0
- package/schematics/ng-update/utils/file-visitor.d.ts +8 -0
- package/schematics/ng-update/utils/file-visitor.js +44 -0
- package/schematics/ng-update/utils/file-visitor.js.map +1 -0
- package/schematics/ng-update/utils/regexp-utils.d.ts +16 -0
- package/schematics/ng-update/utils/regexp-utils.js +34 -0
- package/schematics/ng-update/utils/regexp-utils.js.map +1 -0
- package/schematics/vitest.config.d.ts +2 -0
- package/schematics/vitest.config.js +17 -0
- package/schematics/vitest.config.js.map +1 -0
- package/types/clr-angular-forms-combobox.d.ts +55 -9
- package/types/clr-angular-layout-nav.d.ts +6 -2
- package/types/clr-angular-utils.d.ts +5 -0
- package/types/clr-angular-wizard.d.ts +89 -35
|
@@ -1,17 +1,55 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as i6 from '@angular/common';
|
|
2
2
|
import { isPlatformBrowser, CommonModule } from '@angular/common';
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
|
-
import { Injectable, EventEmitter, Output, Input, Component, Directive, ContentChild, PLATFORM_ID, ViewChild, ContentChildren, Inject, NgModule } from '@angular/core';
|
|
5
|
-
import * as i8 from '@clr/angular/modal';
|
|
6
|
-
import { ClrModal, ClrModalModule } from '@clr/angular/modal';
|
|
4
|
+
import { Injectable, EventEmitter, Output, Input, Component, Directive, ContentChild, ViewChildren, PLATFORM_ID, ViewChild, ContentChildren, Inject, NgModule } from '@angular/core';
|
|
7
5
|
import * as i3 from '@clr/angular/utils';
|
|
8
6
|
import { uniqueIdFactory } from '@clr/angular/utils';
|
|
9
7
|
import { filter } from 'rxjs/operators';
|
|
10
|
-
import { Subject, startWith, tap } from 'rxjs';
|
|
8
|
+
import { Subject, startWith, debounceTime, tap } from 'rxjs';
|
|
11
9
|
import * as i5 from '@clr/angular/icon';
|
|
12
10
|
import { ClarityIcons, errorStandardIcon, successStandardIcon, ClrIcon } from '@clr/angular/icon';
|
|
11
|
+
import * as i8 from '@clr/angular/modal';
|
|
12
|
+
import { ClrModalModule } from '@clr/angular/modal';
|
|
13
13
|
import { ClrAlertModule } from '@clr/angular/emphasis/alert';
|
|
14
14
|
|
|
15
|
+
/*
|
|
16
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
17
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
18
|
+
* This software is released under MIT license.
|
|
19
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
20
|
+
*/
|
|
21
|
+
var ClrWizardFooterAlign;
|
|
22
|
+
(function (ClrWizardFooterAlign) {
|
|
23
|
+
ClrWizardFooterAlign["START"] = "start";
|
|
24
|
+
ClrWizardFooterAlign["END"] = "end";
|
|
25
|
+
})(ClrWizardFooterAlign || (ClrWizardFooterAlign = {}));
|
|
26
|
+
const CLR_WIZARD_FOOTER_ALIGN_VALUES = new Set(Object.values(ClrWizardFooterAlign));
|
|
27
|
+
function footerAlignAttribute(value) {
|
|
28
|
+
if (CLR_WIZARD_FOOTER_ALIGN_VALUES.has(value)) {
|
|
29
|
+
return value;
|
|
30
|
+
}
|
|
31
|
+
throw new Error(`Invalid ClrWizardFooterAlign: "${value}". Expected one of: ${[...CLR_WIZARD_FOOTER_ALIGN_VALUES].join(', ')}`);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/*
|
|
35
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
36
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
37
|
+
* This software is released under MIT license.
|
|
38
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
39
|
+
*/
|
|
40
|
+
var ClrWizardStepnavLayout;
|
|
41
|
+
(function (ClrWizardStepnavLayout) {
|
|
42
|
+
ClrWizardStepnavLayout["VERTICAL"] = "vertical";
|
|
43
|
+
ClrWizardStepnavLayout["HORIZONTAL"] = "horizontal";
|
|
44
|
+
})(ClrWizardStepnavLayout || (ClrWizardStepnavLayout = {}));
|
|
45
|
+
const CLR_WIZARD_STEPNAV_LAYOUT_VALUES = new Set(Object.values(ClrWizardStepnavLayout));
|
|
46
|
+
function stepnavLayoutAttribute(value) {
|
|
47
|
+
if (CLR_WIZARD_STEPNAV_LAYOUT_VALUES.has(value)) {
|
|
48
|
+
return value;
|
|
49
|
+
}
|
|
50
|
+
throw new Error(`Invalid ClrWizardStepnavLayout: "${value}". Expected one of: ${[...CLR_WIZARD_STEPNAV_LAYOUT_VALUES].join(', ')}`);
|
|
51
|
+
}
|
|
52
|
+
|
|
15
53
|
/*
|
|
16
54
|
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
17
55
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -522,6 +560,10 @@ class WizardNavigationService {
|
|
|
522
560
|
* @memberof WizardNavigationService
|
|
523
561
|
*/
|
|
524
562
|
this.wizardDisableStepnav = false;
|
|
563
|
+
/**
|
|
564
|
+
* The layout of the wizard stepnav, either 'vertical' or 'horizontal'.
|
|
565
|
+
*/
|
|
566
|
+
this.stepnavLayout = ClrWizardStepnavLayout.VERTICAL;
|
|
525
567
|
/**
|
|
526
568
|
*
|
|
527
569
|
* @memberof WizardNavigationService
|
|
@@ -1031,6 +1073,191 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1031
1073
|
type: Injectable
|
|
1032
1074
|
}], ctorParameters: () => [{ type: WizardNavigationService }] });
|
|
1033
1075
|
|
|
1076
|
+
/*
|
|
1077
|
+
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
1078
|
+
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
1079
|
+
* This software is released under MIT license.
|
|
1080
|
+
* The full license information can be found in LICENSE in the root directory of this project.
|
|
1081
|
+
*/
|
|
1082
|
+
const DEFAULT_BUTTON_TYPES = {
|
|
1083
|
+
cancel: 'cancel',
|
|
1084
|
+
previous: 'previous',
|
|
1085
|
+
next: 'next',
|
|
1086
|
+
finish: 'finish',
|
|
1087
|
+
danger: 'danger',
|
|
1088
|
+
};
|
|
1089
|
+
const CUSTOM_BUTTON_TYPES = {
|
|
1090
|
+
cancel: 'custom-cancel',
|
|
1091
|
+
previous: 'custom-previous',
|
|
1092
|
+
next: 'custom-next',
|
|
1093
|
+
finish: 'custom-finish',
|
|
1094
|
+
danger: 'custom-danger',
|
|
1095
|
+
};
|
|
1096
|
+
class ClrWizardButton {
|
|
1097
|
+
constructor(navService, buttonService) {
|
|
1098
|
+
this.navService = navService;
|
|
1099
|
+
this.buttonService = buttonService;
|
|
1100
|
+
this.type = '';
|
|
1101
|
+
this.disabled = false;
|
|
1102
|
+
this.hidden = false;
|
|
1103
|
+
// EventEmitter which is emitted when a button is clicked.
|
|
1104
|
+
this.wasClicked = new EventEmitter(false);
|
|
1105
|
+
}
|
|
1106
|
+
get isCancel() {
|
|
1107
|
+
return this.checkDefaultAndCustomType(this.type, 'cancel');
|
|
1108
|
+
}
|
|
1109
|
+
get isNext() {
|
|
1110
|
+
return this.checkDefaultAndCustomType(this.type, 'next');
|
|
1111
|
+
}
|
|
1112
|
+
get isPrevious() {
|
|
1113
|
+
return this.checkDefaultAndCustomType(this.type, 'previous');
|
|
1114
|
+
}
|
|
1115
|
+
get isFinish() {
|
|
1116
|
+
return this.checkDefaultAndCustomType(this.type, 'finish');
|
|
1117
|
+
}
|
|
1118
|
+
get isDanger() {
|
|
1119
|
+
return this.checkDefaultAndCustomType(this.type, 'danger');
|
|
1120
|
+
}
|
|
1121
|
+
get isPrimaryAction() {
|
|
1122
|
+
return this.isNext || this.isDanger || this.isFinish;
|
|
1123
|
+
}
|
|
1124
|
+
get _disabledAttribute() {
|
|
1125
|
+
if (this.isDisabled) {
|
|
1126
|
+
return '';
|
|
1127
|
+
}
|
|
1128
|
+
return null;
|
|
1129
|
+
}
|
|
1130
|
+
get isDisabled() {
|
|
1131
|
+
// dealing with negatives here. cognitively easier to think of it like this...
|
|
1132
|
+
const disabled = true;
|
|
1133
|
+
const nav = this.navService;
|
|
1134
|
+
const page = this.navService.currentPage;
|
|
1135
|
+
// Ensure we don't change the response until buttons are ready to avoid chocolate
|
|
1136
|
+
if (!this.buttonService.buttonsReady) {
|
|
1137
|
+
return !disabled;
|
|
1138
|
+
}
|
|
1139
|
+
if (this.disabled || nav.wizardStopNavigation || !page) {
|
|
1140
|
+
return true;
|
|
1141
|
+
}
|
|
1142
|
+
if (this.isCancel) {
|
|
1143
|
+
return !disabled;
|
|
1144
|
+
}
|
|
1145
|
+
if (this.isPrevious && (nav.currentPageIsFirst || page.previousStepDisabled)) {
|
|
1146
|
+
return disabled;
|
|
1147
|
+
}
|
|
1148
|
+
if (this.isDanger && !page.readyToComplete) {
|
|
1149
|
+
return disabled;
|
|
1150
|
+
}
|
|
1151
|
+
if (this.isNext && (nav.currentPageIsLast || !page.readyToComplete)) {
|
|
1152
|
+
return disabled;
|
|
1153
|
+
}
|
|
1154
|
+
if (this.isFinish && (!nav.currentPageIsLast || !page.readyToComplete)) {
|
|
1155
|
+
return disabled;
|
|
1156
|
+
}
|
|
1157
|
+
return !disabled;
|
|
1158
|
+
}
|
|
1159
|
+
get isHidden() {
|
|
1160
|
+
// dealing with negatives here. cognitively easier to think of it like this...
|
|
1161
|
+
const hidden = true;
|
|
1162
|
+
const nav = this.navService;
|
|
1163
|
+
// Ensure we don't change the response until buttons are ready to avoid chocolate
|
|
1164
|
+
if (!this.buttonService.buttonsReady) {
|
|
1165
|
+
return !hidden;
|
|
1166
|
+
}
|
|
1167
|
+
if (this.hidden) {
|
|
1168
|
+
return true;
|
|
1169
|
+
}
|
|
1170
|
+
if (this.isCancel) {
|
|
1171
|
+
return !hidden;
|
|
1172
|
+
}
|
|
1173
|
+
if (this.isPrevious && nav.currentPageIsFirst) {
|
|
1174
|
+
return hidden;
|
|
1175
|
+
}
|
|
1176
|
+
if (this.isNext && nav.currentPageIsLast) {
|
|
1177
|
+
return hidden;
|
|
1178
|
+
}
|
|
1179
|
+
if (this.isFinish && !nav.currentPageIsLast) {
|
|
1180
|
+
return hidden;
|
|
1181
|
+
}
|
|
1182
|
+
return !hidden;
|
|
1183
|
+
}
|
|
1184
|
+
click() {
|
|
1185
|
+
if (this.isDisabled) {
|
|
1186
|
+
return;
|
|
1187
|
+
}
|
|
1188
|
+
this.wasClicked.emit(this.type);
|
|
1189
|
+
this.buttonService.buttonClicked(this.type);
|
|
1190
|
+
}
|
|
1191
|
+
checkDefaultAndCustomType(valueToCheck = '', typeToLookUp) {
|
|
1192
|
+
if (DEFAULT_BUTTON_TYPES[typeToLookUp] === valueToCheck) {
|
|
1193
|
+
return true;
|
|
1194
|
+
}
|
|
1195
|
+
if (CUSTOM_BUTTON_TYPES[typeToLookUp] === valueToCheck) {
|
|
1196
|
+
return true;
|
|
1197
|
+
}
|
|
1198
|
+
return false;
|
|
1199
|
+
}
|
|
1200
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardButton, deps: [{ token: WizardNavigationService }, { token: ButtonHubService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1201
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrWizardButton, isStandalone: false, selector: "clr-wizard-button", inputs: { type: "type", disabled: ["clrWizardButtonDisabled", "disabled"], hidden: ["clrWizardButtonHidden", "hidden"] }, outputs: { wasClicked: "clrWizardButtonClicked" }, host: { properties: { "attr.aria-hidden": "isHidden" }, classAttribute: "clr-wizard-btn-wrapper" }, ngImport: i0, template: `
|
|
1202
|
+
<button
|
|
1203
|
+
type="button"
|
|
1204
|
+
class="btn clr-wizard-btn"
|
|
1205
|
+
[class.btn-link]="isCancel"
|
|
1206
|
+
[class.clr-wizard-btn--tertiary]="isCancel"
|
|
1207
|
+
[class.btn-outline]="isPrevious"
|
|
1208
|
+
[class.clr-wizard-btn--secondary]="isPrevious"
|
|
1209
|
+
[class.btn-primary]="isPrimaryAction"
|
|
1210
|
+
[class.clr-wizard-btn--primary]="isPrimaryAction"
|
|
1211
|
+
[class.btn-success]="isFinish"
|
|
1212
|
+
[class.btn-danger]="isDanger"
|
|
1213
|
+
[class.disabled]="isDisabled"
|
|
1214
|
+
[attr.disabled]="_disabledAttribute"
|
|
1215
|
+
(click)="click()"
|
|
1216
|
+
>
|
|
1217
|
+
<ng-content></ng-content>
|
|
1218
|
+
</button>
|
|
1219
|
+
`, isInline: true }); }
|
|
1220
|
+
}
|
|
1221
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardButton, decorators: [{
|
|
1222
|
+
type: Component,
|
|
1223
|
+
args: [{
|
|
1224
|
+
selector: 'clr-wizard-button',
|
|
1225
|
+
template: `
|
|
1226
|
+
<button
|
|
1227
|
+
type="button"
|
|
1228
|
+
class="btn clr-wizard-btn"
|
|
1229
|
+
[class.btn-link]="isCancel"
|
|
1230
|
+
[class.clr-wizard-btn--tertiary]="isCancel"
|
|
1231
|
+
[class.btn-outline]="isPrevious"
|
|
1232
|
+
[class.clr-wizard-btn--secondary]="isPrevious"
|
|
1233
|
+
[class.btn-primary]="isPrimaryAction"
|
|
1234
|
+
[class.clr-wizard-btn--primary]="isPrimaryAction"
|
|
1235
|
+
[class.btn-success]="isFinish"
|
|
1236
|
+
[class.btn-danger]="isDanger"
|
|
1237
|
+
[class.disabled]="isDisabled"
|
|
1238
|
+
[attr.disabled]="_disabledAttribute"
|
|
1239
|
+
(click)="click()"
|
|
1240
|
+
>
|
|
1241
|
+
<ng-content></ng-content>
|
|
1242
|
+
</button>
|
|
1243
|
+
`,
|
|
1244
|
+
host: { class: 'clr-wizard-btn-wrapper', '[attr.aria-hidden]': 'isHidden' },
|
|
1245
|
+
standalone: false,
|
|
1246
|
+
}]
|
|
1247
|
+
}], ctorParameters: () => [{ type: WizardNavigationService }, { type: ButtonHubService }], propDecorators: { type: [{
|
|
1248
|
+
type: Input,
|
|
1249
|
+
args: ['type']
|
|
1250
|
+
}], disabled: [{
|
|
1251
|
+
type: Input,
|
|
1252
|
+
args: ['clrWizardButtonDisabled']
|
|
1253
|
+
}], hidden: [{
|
|
1254
|
+
type: Input,
|
|
1255
|
+
args: ['clrWizardButtonHidden']
|
|
1256
|
+
}], wasClicked: [{
|
|
1257
|
+
type: Output,
|
|
1258
|
+
args: ['clrWizardButtonClicked']
|
|
1259
|
+
}] } });
|
|
1260
|
+
|
|
1034
1261
|
/*
|
|
1035
1262
|
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
1036
1263
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -1657,7 +1884,7 @@ class ClrWizardPage {
|
|
|
1657
1884
|
*
|
|
1658
1885
|
*/
|
|
1659
1886
|
get title() {
|
|
1660
|
-
return this.pageTitle
|
|
1887
|
+
return this.pageTitle?.pageTitleTemplateRef;
|
|
1661
1888
|
}
|
|
1662
1889
|
/**
|
|
1663
1890
|
*
|
|
@@ -1668,7 +1895,7 @@ class ClrWizardPage {
|
|
|
1668
1895
|
if (this.pageNavTitle) {
|
|
1669
1896
|
return this.pageNavTitle.pageNavTitleTemplateRef;
|
|
1670
1897
|
}
|
|
1671
|
-
return this.pageTitle
|
|
1898
|
+
return this.pageTitle?.pageTitleTemplateRef;
|
|
1672
1899
|
}
|
|
1673
1900
|
/**
|
|
1674
1901
|
*
|
|
@@ -1751,7 +1978,7 @@ class ClrWizardPage {
|
|
|
1751
1978
|
this.navService.currentPage = this;
|
|
1752
1979
|
}
|
|
1753
1980
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardPage, deps: [{ token: WizardNavigationService }, { token: PageCollectionService }, { token: ButtonHubService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1754
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrWizardPage, isStandalone: false, selector: "clr-wizard-page", inputs: { _id: ["id", "_id"], preventDefault: ["clrWizardPagePreventDefault", "preventDefault"], nextStepDisabled: ["clrWizardPageNextDisabled", "nextStepDisabled"], previousStepDisabled: ["clrWizardPagePreviousDisabled", "previousStepDisabled"], hasError: ["clrWizardPageHasError", "hasError"], stopCancel: ["clrWizardPagePreventDefaultCancel", "stopCancel"], stopNext: ["clrWizardPagePreventDefaultNext", "stopNext"] }, outputs: { nextStepDisabledChange: "clrWizardPageNextDisabledChange", previousStepDisabledChange: "clrWizardPagePreviousDisabledChange", stopCancelChange: "clrWizardPagePreventDefaultCancelChange", onCommit: "clrWizardPageOnCommit", onLoad: "clrWizardPageOnLoad", pageOnCancel: "clrWizardPageOnCancel", finishButtonClicked: "clrWizardPageFinish", previousButtonClicked: "clrWizardPagePrevious", nextButtonClicked: "clrWizardPageNext", dangerButtonClicked: "clrWizardPageDanger", primaryButtonClicked: "clrWizardPagePrimary", customButtonClicked: "clrWizardPageCustomButton" }, host: { properties: { "id": "id", "attr.aria-hidden": "!current", "attr.aria-labelledby": "stepItemId", "class.active": "current", "class.clr-wizard-page": "true" } }, queries: [{ propertyName: "pageTitle", first: true, predicate: ClrWizardPageTitle,
|
|
1981
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrWizardPage, isStandalone: false, selector: "clr-wizard-page", inputs: { _id: ["id", "_id"], preventDefault: ["clrWizardPagePreventDefault", "preventDefault"], nextStepDisabled: ["clrWizardPageNextDisabled", "nextStepDisabled"], previousStepDisabled: ["clrWizardPagePreviousDisabled", "previousStepDisabled"], hasError: ["clrWizardPageHasError", "hasError"], stopCancel: ["clrWizardPagePreventDefaultCancel", "stopCancel"], stopNext: ["clrWizardPagePreventDefaultNext", "stopNext"] }, outputs: { nextStepDisabledChange: "clrWizardPageNextDisabledChange", previousStepDisabledChange: "clrWizardPagePreviousDisabledChange", stopCancelChange: "clrWizardPagePreventDefaultCancelChange", onCommit: "clrWizardPageOnCommit", onLoad: "clrWizardPageOnLoad", pageOnCancel: "clrWizardPageOnCancel", finishButtonClicked: "clrWizardPageFinish", previousButtonClicked: "clrWizardPagePrevious", nextButtonClicked: "clrWizardPageNext", dangerButtonClicked: "clrWizardPageDanger", primaryButtonClicked: "clrWizardPagePrimary", customButtonClicked: "clrWizardPageCustomButton" }, host: { properties: { "id": "id", "attr.aria-hidden": "!current", "attr.aria-labelledby": "stepItemId", "class.active": "current", "class.clr-wizard-page": "true" } }, queries: [{ propertyName: "pageTitle", first: true, predicate: ClrWizardPageTitle, static: true }, { propertyName: "pageNavTitle", first: true, predicate: ClrWizardPageNavTitle, static: true }, { propertyName: "_buttons", first: true, predicate: ClrWizardPageButtons, static: true }, { propertyName: "_headerActions", first: true, predicate: ClrWizardPageHeaderActions, descendants: true, static: true }], ngImport: i0, template: '<ng-content></ng-content>', isInline: true }); }
|
|
1755
1982
|
}
|
|
1756
1983
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardPage, decorators: [{
|
|
1757
1984
|
type: Component,
|
|
@@ -1811,13 +2038,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
1811
2038
|
args: ['clrWizardPageCustomButton']
|
|
1812
2039
|
}], pageTitle: [{
|
|
1813
2040
|
type: ContentChild,
|
|
1814
|
-
args: [ClrWizardPageTitle, { static: true }]
|
|
2041
|
+
args: [ClrWizardPageTitle, { static: true, descendants: false }]
|
|
1815
2042
|
}], pageNavTitle: [{
|
|
1816
2043
|
type: ContentChild,
|
|
1817
|
-
args: [ClrWizardPageNavTitle, { static: true }]
|
|
2044
|
+
args: [ClrWizardPageNavTitle, { static: true, descendants: false }]
|
|
1818
2045
|
}], _buttons: [{
|
|
1819
2046
|
type: ContentChild,
|
|
1820
|
-
args: [ClrWizardPageButtons, { static: true }]
|
|
2047
|
+
args: [ClrWizardPageButtons, { static: true, descendants: false }]
|
|
1821
2048
|
}], _headerActions: [{
|
|
1822
2049
|
type: ContentChild,
|
|
1823
2050
|
args: [ClrWizardPageHeaderActions, { static: true }]
|
|
@@ -1921,7 +2148,7 @@ class ClrWizardStepnavItem {
|
|
|
1921
2148
|
return allIds.join(' ');
|
|
1922
2149
|
}
|
|
1923
2150
|
get icon() {
|
|
1924
|
-
if (this.isCurrent) {
|
|
2151
|
+
if (this.isCurrent && this.navService.stepnavLayout !== ClrWizardStepnavLayout.HORIZONTAL) {
|
|
1925
2152
|
return {
|
|
1926
2153
|
shape: 'dot-circle',
|
|
1927
2154
|
label: this.commonStrings.keys.wizardStepCurrent || this.commonStrings.keys.timelineStepCurrent,
|
|
@@ -1958,6 +2185,9 @@ class ClrWizardStepnavItem {
|
|
|
1958
2185
|
this.skipNextScroll = true;
|
|
1959
2186
|
this.navService.goTo(this.page);
|
|
1960
2187
|
}
|
|
2188
|
+
scrollIntoView() {
|
|
2189
|
+
this.elementRef.nativeElement.scrollIntoView({ behavior: 'smooth', block: 'nearest', inline: 'nearest' });
|
|
2190
|
+
}
|
|
1961
2191
|
pageGuard() {
|
|
1962
2192
|
if (!this.page) {
|
|
1963
2193
|
throw new Error('Wizard stepnav item is not associated with a wizard page.');
|
|
@@ -1967,7 +2197,7 @@ class ClrWizardStepnavItem {
|
|
|
1967
2197
|
// Don't use "smooth" scrolling when the wizard is first opened to avoid a delay in scrolling the current step into view.
|
|
1968
2198
|
// The current step when the wizard is opened might not be the first step. For example, the wizard can be closed and re-opened.
|
|
1969
2199
|
let scrollBehavior = 'auto';
|
|
1970
|
-
return this.navService.currentPageChange.pipe(startWith(this.navService.currentPage), tap(currentPage => {
|
|
2200
|
+
return this.navService.currentPageChange.pipe(startWith(this.navService.currentPage), debounceTime(1), tap(currentPage => {
|
|
1971
2201
|
if (!this.skipNextScroll && currentPage === this.page) {
|
|
1972
2202
|
this.elementRef.nativeElement.scrollIntoView({ behavior: scrollBehavior, block: 'center', inline: 'center' });
|
|
1973
2203
|
}
|
|
@@ -1976,7 +2206,7 @@ class ClrWizardStepnavItem {
|
|
|
1976
2206
|
}));
|
|
1977
2207
|
}
|
|
1978
2208
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardStepnavItem, deps: [{ token: WizardNavigationService }, { token: PageCollectionService }, { token: i3.ClrCommonStringsService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
1979
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrWizardStepnavItem, isStandalone: false, selector: "[clr-wizard-stepnav-item]", inputs: { page: "page" }, host: { properties: { "id": "id", "attr.aria-current": "stepAriaCurrent", "attr.aria-controls": "page.id", "class.clr-nav-link": "true", "class.nav-item": "true", "class.active": "isCurrent", "class.disabled": "isDisabled", "class.no-click": "!canNavigate", "class.complete": "isComplete", "class.error": "hasError" } }, ngImport: i0, template: `
|
|
2209
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrWizardStepnavItem, isStandalone: false, selector: "[clr-wizard-stepnav-item]", inputs: { page: "page" }, host: { listeners: { "focusin": "scrollIntoView()" }, properties: { "id": "id", "attr.aria-current": "stepAriaCurrent", "attr.aria-controls": "page.id", "class.clr-nav-link": "true", "class.nav-item": "true", "class.active": "isCurrent", "class.disabled": "isDisabled", "class.no-click": "!canNavigate", "class.complete": "isComplete", "class.error": "hasError" } }, ngImport: i0, template: `
|
|
1980
2210
|
<button
|
|
1981
2211
|
type="button"
|
|
1982
2212
|
class="btn btn-link clr-wizard-stepnav-link"
|
|
@@ -2004,7 +2234,7 @@ class ClrWizardStepnavItem {
|
|
|
2004
2234
|
<ng-template [ngTemplateOutlet]="page.navTitle"></ng-template>
|
|
2005
2235
|
</span>
|
|
2006
2236
|
</button>
|
|
2007
|
-
`, isInline: true, dependencies: [{ kind: "directive", type:
|
|
2237
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }] }); }
|
|
2008
2238
|
}
|
|
2009
2239
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardStepnavItem, decorators: [{
|
|
2010
2240
|
type: Component,
|
|
@@ -2050,6 +2280,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2050
2280
|
'[class.no-click]': '!canNavigate',
|
|
2051
2281
|
'[class.complete]': 'isComplete',
|
|
2052
2282
|
'[class.error]': 'hasError',
|
|
2283
|
+
'(focusin)': 'scrollIntoView()',
|
|
2053
2284
|
},
|
|
2054
2285
|
standalone: false,
|
|
2055
2286
|
}]
|
|
@@ -2065,12 +2296,94 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2065
2296
|
* The full license information can be found in LICENSE in the root directory of this project.
|
|
2066
2297
|
*/
|
|
2067
2298
|
class ClrWizardStepnav {
|
|
2068
|
-
constructor(pageService) {
|
|
2299
|
+
constructor(pageService, navService, elementRef) {
|
|
2069
2300
|
this.pageService = pageService;
|
|
2301
|
+
this.navService = navService;
|
|
2302
|
+
this.elementRef = elementRef;
|
|
2303
|
+
this.showScrollLeftButton = false;
|
|
2304
|
+
this.showScrollRightButton = false;
|
|
2305
|
+
this.firstItemVisible = true;
|
|
2306
|
+
this.lastItemVisible = true;
|
|
2307
|
+
}
|
|
2308
|
+
get stepnavLayout() {
|
|
2309
|
+
return this.navService.stepnavLayout;
|
|
2310
|
+
}
|
|
2311
|
+
ngAfterViewInit() {
|
|
2312
|
+
if (this.stepnavLayout === ClrWizardStepnavLayout.HORIZONTAL) {
|
|
2313
|
+
this.setupIntersectionObserver();
|
|
2314
|
+
this.stepnavItems.notifyOnChanges();
|
|
2315
|
+
this.subscription = this.stepnavItems.changes.pipe(startWith(undefined)).subscribe(() => {
|
|
2316
|
+
this.observeEdgeItems();
|
|
2317
|
+
});
|
|
2318
|
+
}
|
|
2070
2319
|
}
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2320
|
+
ngOnDestroy() {
|
|
2321
|
+
this.subscription?.unsubscribe();
|
|
2322
|
+
this.intersectionObserver?.disconnect();
|
|
2323
|
+
}
|
|
2324
|
+
scrollLeft() {
|
|
2325
|
+
this.scroll('left');
|
|
2326
|
+
}
|
|
2327
|
+
scrollRight() {
|
|
2328
|
+
this.scroll('right');
|
|
2329
|
+
}
|
|
2330
|
+
setupIntersectionObserver() {
|
|
2331
|
+
const scrollContainer = this.elementRef.nativeElement.querySelector('.clr-wizard-stepnav-list');
|
|
2332
|
+
this.intersectionObserver = new IntersectionObserver(entries => {
|
|
2333
|
+
for (const entry of entries) {
|
|
2334
|
+
const target = entry.target;
|
|
2335
|
+
const isFirst = target === this.stepnavItems.first?.elementRef.nativeElement;
|
|
2336
|
+
const isLast = target === this.stepnavItems.last?.elementRef.nativeElement;
|
|
2337
|
+
if (isFirst) {
|
|
2338
|
+
this.firstItemVisible = entry.isIntersecting;
|
|
2339
|
+
}
|
|
2340
|
+
if (isLast) {
|
|
2341
|
+
this.lastItemVisible = entry.isIntersecting;
|
|
2342
|
+
}
|
|
2343
|
+
}
|
|
2344
|
+
this.showScrollLeftButton = !this.firstItemVisible;
|
|
2345
|
+
this.showScrollRightButton = !this.lastItemVisible;
|
|
2346
|
+
}, { root: scrollContainer, threshold: 0.99 });
|
|
2347
|
+
}
|
|
2348
|
+
observeEdgeItems() {
|
|
2349
|
+
this.intersectionObserver.disconnect();
|
|
2350
|
+
this.firstItemVisible = true;
|
|
2351
|
+
this.lastItemVisible = true;
|
|
2352
|
+
const first = this.stepnavItems.first;
|
|
2353
|
+
const last = this.stepnavItems.last;
|
|
2354
|
+
if (first) {
|
|
2355
|
+
this.intersectionObserver.observe(first.elementRef.nativeElement);
|
|
2356
|
+
}
|
|
2357
|
+
if (last && last !== first) {
|
|
2358
|
+
this.intersectionObserver.observe(last.elementRef.nativeElement);
|
|
2359
|
+
}
|
|
2360
|
+
}
|
|
2361
|
+
scroll(direction) {
|
|
2362
|
+
const scrollContainer = this.elementRef.nativeElement.querySelector('.clr-wizard-stepnav-list');
|
|
2363
|
+
const scrollAmount = scrollContainer.clientWidth * 0.5;
|
|
2364
|
+
scrollContainer.scrollBy({ left: direction === 'left' ? -scrollAmount : scrollAmount, behavior: 'smooth' });
|
|
2365
|
+
}
|
|
2366
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardStepnav, deps: [{ token: PageCollectionService }, { token: WizardNavigationService }, { token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2367
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrWizardStepnav, isStandalone: false, selector: "clr-wizard-stepnav", inputs: { label: "label" }, host: { classAttribute: "clr-wizard-stepnav" }, viewQueries: [{ propertyName: "stepnavItems", predicate: ClrWizardStepnavItem, descendants: true }], ngImport: i0, template: `
|
|
2368
|
+
@if (showScrollLeftButton && stepnavLayout === 'horizontal') {
|
|
2369
|
+
<button
|
|
2370
|
+
type="button"
|
|
2371
|
+
class="btn btn-sm btn-icon clr-wizard-stepnav-scroll-button-left"
|
|
2372
|
+
(click)="scrollLeft()"
|
|
2373
|
+
tabindex="-1"
|
|
2374
|
+
>
|
|
2375
|
+
<cds-icon shape="angle" direction="left"></cds-icon>
|
|
2376
|
+
</button>
|
|
2377
|
+
}
|
|
2378
|
+
|
|
2379
|
+
<nav
|
|
2380
|
+
class="clr-wizard-stepnav-nav"
|
|
2381
|
+
[ngClass]="{
|
|
2382
|
+
'clr-wizard-stepnav-nav--with-one-scroll-button': showScrollLeftButton || showScrollRightButton,
|
|
2383
|
+
'clr-wizard-stepnav-nav--with-two-scroll-buttons': showScrollLeftButton && showScrollRightButton,
|
|
2384
|
+
}"
|
|
2385
|
+
[attr.aria-label]="label"
|
|
2386
|
+
>
|
|
2074
2387
|
<ol class="clr-wizard-stepnav-list">
|
|
2075
2388
|
@for (page of pageService.pages; track page; let i = $index) {
|
|
2076
2389
|
<li clr-wizard-stepnav-item [page]="page" class="clr-wizard-stepnav-item">
|
|
@@ -2079,14 +2392,43 @@ class ClrWizardStepnav {
|
|
|
2079
2392
|
}
|
|
2080
2393
|
</ol>
|
|
2081
2394
|
</nav>
|
|
2082
|
-
|
|
2395
|
+
|
|
2396
|
+
@if (showScrollRightButton && stepnavLayout === 'horizontal') {
|
|
2397
|
+
<button
|
|
2398
|
+
type="button"
|
|
2399
|
+
class="btn btn-sm btn-icon clr-wizard-stepnav-scroll-button-right"
|
|
2400
|
+
(click)="scrollRight()"
|
|
2401
|
+
tabindex="-1"
|
|
2402
|
+
>
|
|
2403
|
+
<cds-icon shape="angle" direction="right"></cds-icon>
|
|
2404
|
+
</button>
|
|
2405
|
+
}
|
|
2406
|
+
`, isInline: true, dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "component", type: i5.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }, { kind: "component", type: ClrWizardStepnavItem, selector: "[clr-wizard-stepnav-item]", inputs: ["page"] }] }); }
|
|
2083
2407
|
}
|
|
2084
2408
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardStepnav, decorators: [{
|
|
2085
2409
|
type: Component,
|
|
2086
2410
|
args: [{
|
|
2087
2411
|
selector: 'clr-wizard-stepnav',
|
|
2088
2412
|
template: `
|
|
2089
|
-
|
|
2413
|
+
@if (showScrollLeftButton && stepnavLayout === 'horizontal') {
|
|
2414
|
+
<button
|
|
2415
|
+
type="button"
|
|
2416
|
+
class="btn btn-sm btn-icon clr-wizard-stepnav-scroll-button-left"
|
|
2417
|
+
(click)="scrollLeft()"
|
|
2418
|
+
tabindex="-1"
|
|
2419
|
+
>
|
|
2420
|
+
<cds-icon shape="angle" direction="left"></cds-icon>
|
|
2421
|
+
</button>
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2424
|
+
<nav
|
|
2425
|
+
class="clr-wizard-stepnav-nav"
|
|
2426
|
+
[ngClass]="{
|
|
2427
|
+
'clr-wizard-stepnav-nav--with-one-scroll-button': showScrollLeftButton || showScrollRightButton,
|
|
2428
|
+
'clr-wizard-stepnav-nav--with-two-scroll-buttons': showScrollLeftButton && showScrollRightButton,
|
|
2429
|
+
}"
|
|
2430
|
+
[attr.aria-label]="label"
|
|
2431
|
+
>
|
|
2090
2432
|
<ol class="clr-wizard-stepnav-list">
|
|
2091
2433
|
@for (page of pageService.pages; track page; let i = $index) {
|
|
2092
2434
|
<li clr-wizard-stepnav-item [page]="page" class="clr-wizard-stepnav-item">
|
|
@@ -2095,12 +2437,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2095
2437
|
}
|
|
2096
2438
|
</ol>
|
|
2097
2439
|
</nav>
|
|
2440
|
+
|
|
2441
|
+
@if (showScrollRightButton && stepnavLayout === 'horizontal') {
|
|
2442
|
+
<button
|
|
2443
|
+
type="button"
|
|
2444
|
+
class="btn btn-sm btn-icon clr-wizard-stepnav-scroll-button-right"
|
|
2445
|
+
(click)="scrollRight()"
|
|
2446
|
+
tabindex="-1"
|
|
2447
|
+
>
|
|
2448
|
+
<cds-icon shape="angle" direction="right"></cds-icon>
|
|
2449
|
+
</button>
|
|
2450
|
+
}
|
|
2098
2451
|
`,
|
|
2099
2452
|
host: { class: 'clr-wizard-stepnav' },
|
|
2100
2453
|
standalone: false,
|
|
2101
2454
|
}]
|
|
2102
|
-
}], ctorParameters: () => [{ type: PageCollectionService }], propDecorators: { label: [{
|
|
2455
|
+
}], ctorParameters: () => [{ type: PageCollectionService }, { type: WizardNavigationService }, { type: i0.ElementRef }], propDecorators: { label: [{
|
|
2103
2456
|
type: Input
|
|
2457
|
+
}], stepnavItems: [{
|
|
2458
|
+
type: ViewChildren,
|
|
2459
|
+
args: [ClrWizardStepnavItem]
|
|
2104
2460
|
}] } });
|
|
2105
2461
|
|
|
2106
2462
|
/*
|
|
@@ -2122,6 +2478,10 @@ class ClrWizard {
|
|
|
2122
2478
|
* Set the aria-label for the stepnav section of the wizard. Set using `[clrWizardStepnavAriaLabel]` input.
|
|
2123
2479
|
*/
|
|
2124
2480
|
this.stepnavAriaLabel = this.commonStrings.keys.wizardStepnavAriaLabel;
|
|
2481
|
+
/**
|
|
2482
|
+
* Set the wizard stepnav layout to 'vertical' (default) or 'horizontal'. Set using `[clrWizardStepnavLayout]` input.
|
|
2483
|
+
*/
|
|
2484
|
+
this.stepnavLayout = ClrWizardStepnavLayout.VERTICAL;
|
|
2125
2485
|
/**
|
|
2126
2486
|
* Set the modal size of the wizard. Set using `[clrWizardSize]` input.
|
|
2127
2487
|
*/
|
|
@@ -2135,6 +2495,18 @@ class ClrWizard {
|
|
|
2135
2495
|
* If you can't use this option, you will likely need to provide custom CSS to set the wizard's height and margins.
|
|
2136
2496
|
*/
|
|
2137
2497
|
this.inPageFillContentArea = false;
|
|
2498
|
+
/**
|
|
2499
|
+
* Hide the wizard footer entirely. Set using `[clrWizardHideFooter]` input.
|
|
2500
|
+
* Useful when a nested wizard or stepper handles its own navigation.
|
|
2501
|
+
*/
|
|
2502
|
+
this.hideFooter = false;
|
|
2503
|
+
/**
|
|
2504
|
+
* Align the footer buttons to 'start' (left) or 'end' (right).
|
|
2505
|
+
* By default, modal wizards align to 'end' and in-page wizards align to 'start'.
|
|
2506
|
+
* Nested wizards inherit the default unless this input is explicitly set.
|
|
2507
|
+
* Set using `[clrWizardFooterAlign]` input.
|
|
2508
|
+
*/
|
|
2509
|
+
this._footerAlign = null;
|
|
2138
2510
|
/**
|
|
2139
2511
|
* Tells the modal part of the wizard whether it should have a close "X"
|
|
2140
2512
|
* in the top right corner. Set using `[clrWizardClosable]` input.
|
|
@@ -2185,6 +2557,8 @@ class ClrWizard {
|
|
|
2185
2557
|
this.onMovePrevious = new EventEmitter(false);
|
|
2186
2558
|
this._open = false;
|
|
2187
2559
|
this.wizardId = uniqueIdFactory();
|
|
2560
|
+
this.ClrWizardFooterAlign = ClrWizardFooterAlign;
|
|
2561
|
+
this.ClrWizardStepnavLayout = ClrWizardStepnavLayout;
|
|
2188
2562
|
this._forceForward = false;
|
|
2189
2563
|
this._stopNext = false;
|
|
2190
2564
|
this._stopCancel = false;
|
|
@@ -2194,13 +2568,6 @@ class ClrWizard {
|
|
|
2194
2568
|
this.subscriptions.push(this.listenForNextPageChanges(), this.listenForPreviousPageChanges(), this.listenForCancelChanges(), this.listenForFinishedChanges(), this.listenForPageChanges());
|
|
2195
2569
|
this.differ = differs.find([]).create(null);
|
|
2196
2570
|
}
|
|
2197
|
-
get title() {
|
|
2198
|
-
return this._title;
|
|
2199
|
-
}
|
|
2200
|
-
set title(title) {
|
|
2201
|
-
this._title = title;
|
|
2202
|
-
this.modal.title = title;
|
|
2203
|
-
}
|
|
2204
2571
|
/**
|
|
2205
2572
|
* Resets page completed states when navigating backwards.
|
|
2206
2573
|
* Set using `[clrWizardForceForwardNavigation]` input.
|
|
@@ -2294,10 +2661,24 @@ class ClrWizard {
|
|
|
2294
2661
|
get isInline() {
|
|
2295
2662
|
return this.elementRef.nativeElement.classList.contains('clr-wizard--inline');
|
|
2296
2663
|
}
|
|
2664
|
+
get showHeader() {
|
|
2665
|
+
return (!!this.navService.currentPage?.pageTitle ||
|
|
2666
|
+
(this.stepnavLayout === ClrWizardStepnavLayout.VERTICAL && this.headerActionService.displayHeaderActionsWrapper));
|
|
2667
|
+
}
|
|
2668
|
+
get showFooter() {
|
|
2669
|
+
return !this.hideFooter && (this.navService.currentPage?.hasButtons || this.wizardButtons?.length > 0);
|
|
2670
|
+
}
|
|
2671
|
+
get footerAlign() {
|
|
2672
|
+
if (this._footerAlign !== null) {
|
|
2673
|
+
return this._footerAlign;
|
|
2674
|
+
}
|
|
2675
|
+
return this.inPage ? ClrWizardFooterAlign.START : ClrWizardFooterAlign.END;
|
|
2676
|
+
}
|
|
2297
2677
|
get stopModalAnimations() {
|
|
2298
2678
|
return this._stopModalAnimations;
|
|
2299
2679
|
}
|
|
2300
2680
|
ngAfterContentInit() {
|
|
2681
|
+
this.navService.stepnavLayout = this.stepnavLayout;
|
|
2301
2682
|
this.pageCollection.pages = this.pages;
|
|
2302
2683
|
this.headerActionService.wizardHeaderActions = this.headerActions;
|
|
2303
2684
|
if (this.inPage) {
|
|
@@ -2520,7 +2901,7 @@ class ClrWizard {
|
|
|
2520
2901
|
this.wizardFinished.emit();
|
|
2521
2902
|
}
|
|
2522
2903
|
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizard, deps: [{ token: PLATFORM_ID }, { token: i3.ClrCommonStringsService }, { token: WizardNavigationService }, { token: PageCollectionService }, { token: ButtonHubService }, { token: HeaderActionService }, { token: i0.ElementRef }, { token: i0.IterableDiffers }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2523
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrWizard, isStandalone: false, selector: "clr-wizard", inputs: { stepnavAriaLabel: ["clrWizardStepnavAriaLabel", "stepnavAriaLabel"], size: ["clrWizardSize", "size"], inPage: ["clrWizardInPage", "inPage"], inPageFillContentArea: ["clrWizardInPageFillContentArea", "inPageFillContentArea"], closable: ["clrWizardClosable", "closable"], _stopModalAnimations: ["clrWizardPreventModalAnimation", "_stopModalAnimations"], forceForward: ["clrWizardForceForwardNavigation", "forceForward"], clrWizardOpen: "clrWizardOpen", stopNext: ["clrWizardPreventDefaultNext", "stopNext"], stopCancel: ["clrWizardPreventDefaultCancel", "stopCancel"], stopNavigation: ["clrWizardPreventNavigation", "stopNavigation"], disableStepnav: ["clrWizardDisableStepnav", "disableStepnav"] }, outputs: { _openChanged: "clrWizardOpenChange", onCancel: "clrWizardOnCancel", wizardFinished: "clrWizardOnFinish", onReset: "clrWizardOnReset", currentPageChange: "clrWizardCurrentPageChange", onMoveNext: "clrWizardOnNext", onMovePrevious: "clrWizardOnPrevious" }, host: { properties: { "class.clr-wizard": "true", "class.wizard-md": "size == 'md'", "class.wizard-lg": "size == 'lg'", "class.wizard-xl": "size == 'xl'", "class.wizard-in-page": "inPage", "class.wizard-in-page--fill-content-area": "inPage && inPageFillContentArea" } }, providers: [WizardNavigationService, PageCollectionService, ButtonHubService, HeaderActionService], queries: [{ propertyName: "wizardTitle", first: true, predicate: ClrWizardTitle, descendants: true }, { propertyName: "pages", predicate: ClrWizardPage
|
|
2904
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.1.3", type: ClrWizard, isStandalone: false, selector: "clr-wizard", inputs: { stepnavAriaLabel: ["clrWizardStepnavAriaLabel", "stepnavAriaLabel"], stepnavLayout: ["clrWizardStepnavLayout", "stepnavLayout", stepnavLayoutAttribute], size: ["clrWizardSize", "size"], inPage: ["clrWizardInPage", "inPage"], inPageFillContentArea: ["clrWizardInPageFillContentArea", "inPageFillContentArea"], hideFooter: ["clrWizardHideFooter", "hideFooter"], _footerAlign: ["clrWizardFooterAlign", "_footerAlign", footerAlignAttribute], closable: ["clrWizardClosable", "closable"], _stopModalAnimations: ["clrWizardPreventModalAnimation", "_stopModalAnimations"], forceForward: ["clrWizardForceForwardNavigation", "forceForward"], clrWizardOpen: "clrWizardOpen", stopNext: ["clrWizardPreventDefaultNext", "stopNext"], stopCancel: ["clrWizardPreventDefaultCancel", "stopCancel"], stopNavigation: ["clrWizardPreventNavigation", "stopNavigation"], disableStepnav: ["clrWizardDisableStepnav", "disableStepnav"] }, outputs: { _openChanged: "clrWizardOpenChange", onCancel: "clrWizardOnCancel", wizardFinished: "clrWizardOnFinish", onReset: "clrWizardOnReset", currentPageChange: "clrWizardCurrentPageChange", onMoveNext: "clrWizardOnNext", onMovePrevious: "clrWizardOnPrevious" }, host: { properties: { "class.clr-wizard": "true", "class.wizard-md": "size == 'md'", "class.wizard-lg": "size == 'lg'", "class.wizard-xl": "size == 'xl'", "class.wizard-in-page": "inPage", "class.wizard-in-page--fill-content-area": "inPage && inPageFillContentArea", "class.wizard-horizontal": "stepnavLayout === ClrWizardStepnavLayout.HORIZONTAL" } }, providers: [WizardNavigationService, PageCollectionService, ButtonHubService, HeaderActionService], queries: [{ propertyName: "wizardTitle", first: true, predicate: ClrWizardTitle, descendants: true }, { propertyName: "pages", predicate: ClrWizardPage }, { propertyName: "wizardButtons", predicate: ClrWizardButton }, { propertyName: "headerActions", predicate: ClrWizardHeaderAction }], viewQueries: [{ propertyName: "pageTitle", first: true, predicate: ["pageTitle"], descendants: true }, { propertyName: "bodyElementRef", first: true, predicate: ["body"], descendants: true }], ngImport: i0, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n<ng-template #coreWizardContent>\n <div class=\"clr-wizard-content-wrapper\">\n @if (stepnavLayout === ClrWizardStepnavLayout.HORIZONTAL) {\n <div class=\"clr-wizard-title-wrapper\">\n <ng-container [ngTemplateOutlet]=\"wizardTitleTemplate\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"wizardActionsTemplate\"></ng-container>\n </div>\n }\n\n <div class=\"clr-wizard-stepnav-wrapper\" role=\"region\">\n @if (stepnavLayout === ClrWizardStepnavLayout.VERTICAL) {\n <ng-container [ngTemplateOutlet]=\"wizardTitleTemplate\"></ng-container>\n }\n <clr-wizard-stepnav [label]=\"stepnavAriaLabel\"></clr-wizard-stepnav>\n </div>\n\n <div class=\"clr-wizard-main-content\">\n @if (showHeader) {\n <div class=\"clr-wizard-header\">\n @if (navService.currentPage?.pageTitle) {\n <div class=\"clr-wizard-page-title-wrapper\" cdkFocusInitial tabindex=\"-1\">\n <div\n class=\"clr-wizard-page-title\"\n role=\"heading\"\n [attr.aria-level]=\"navService.currentPage?.pageTitle?.headingLevel || 2\"\n >\n <span tabindex=\"-1\" #pageTitle class=\"clr-wizard-page-title-text\">\n <ng-template [ngTemplateOutlet]=\"navService.currentPageTitle\"></ng-template>\n </span>\n </div>\n </div>\n } @if (stepnavLayout === ClrWizardStepnavLayout.VERTICAL) {\n <ng-container [ngTemplateOutlet]=\"wizardActionsTemplate\"></ng-container>\n }\n </div>\n }\n\n <div #body class=\"clr-wizard-body-wrapper\">\n <div class=\"clr-wizard-body\">\n <main clr-wizard-pages-wrapper class=\"clr-wizard-content\">\n <ng-content></ng-content>\n </main>\n </div>\n </div>\n\n @if (showFooter) {\n <div class=\"clr-wizard-footer\">\n <div class=\"clr-wizard-footer-buttons\">\n <div\n class=\"clr-wizard-footer-buttons-wrapper\"\n [ngClass]=\"{'align-start': footerAlign === ClrWizardFooterAlign.START, 'align-end': footerAlign === ClrWizardFooterAlign.END}\"\n >\n @if (navService.currentPage?.hasButtons) {\n <ng-template [ngTemplateOutlet]=\"navService.currentPage.buttons\"></ng-template>\n } @else {\n <ng-content select=\"clr-wizard-button\"></ng-content>\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<ng-template #wizardTitleTemplate>\n <div class=\"clr-wizard-title\" [id]=\"wizardId\" role=\"heading\" [attr.aria-level]=\"wizardTitle?.headingLevel || 1\">\n <ng-content select=\"clr-wizard-title\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #wizardActionsTemplate>\n @if (headerActionService.displayHeaderActionsWrapper) {\n <div class=\"clr-wizard-header-actions-wrapper\">\n @if (headerActionService.showWizardHeaderActions) {\n <ng-content select=\"clr-wizard-header-action\"></ng-content>\n } @if (headerActionService.currentPageHasHeaderActions) {\n <ng-template [ngTemplateOutlet]=\"navService.currentPage?.headerActions\"></ng-template>\n }\n </div>\n } @if (closable && !inPage) {\n <button type=\"button\" class=\"close\" [attr.aria-label]=\"commonStrings.keys.close\" (click)=\"modalCancel()\">\n <cds-icon shape=\"window-close\"></cds-icon>\n </button>\n }\n</ng-template>\n\n@if (inPage) {\n<ng-container [ngTemplateOutlet]=\"coreWizardContent\"></ng-container>\n} @else {\n<clr-modal\n [clrModalOpen]=\"_open\"\n [clrModalSize]=\"size\"\n [clrModalClosable]=\"closable\"\n [clrModalStaticBackdrop]=\"true\"\n [clrModalSkipAnimation]=\"stopModalAnimations\"\n [clrModalOverrideScrollService]=\"isInline\"\n [clrModalPreventClose]=\"true\"\n (clrModalAlternateClose)=\"modalCancel()\"\n [clrModalLabelledById]=\"wizardId\"\n>\n <ng-template #clrInternalModalContentTemplate>\n <ng-container [ngTemplateOutlet]=\"coreWizardContent\"></ng-container>\n </ng-template>\n</clr-modal>\n}\n", dependencies: [{ kind: "directive", type: i6.NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: i6.NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "component", type: i5.ClrIcon, selector: "clr-icon, cds-icon", inputs: ["shape", "size", "direction", "flip", "solid", "status", "inverse", "badge"] }, { kind: "component", type: i8.ClrModal, selector: "clr-modal", inputs: ["clrModalOpen", "clrModalClosable", "clrModalCloseButtonAriaLabel", "clrModalSize", "clrModalStaticBackdrop", "clrModalSkipAnimation", "clrModalPreventClose", "clrModalLabelledById", "clrModalOverrideScrollService"], outputs: ["clrModalOpenChange", "clrModalAlternateClose"] }, { kind: "component", type: ClrWizardStepnav, selector: "clr-wizard-stepnav", inputs: ["label"] }] }); }
|
|
2524
2905
|
}
|
|
2525
2906
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizard, decorators: [{
|
|
2526
2907
|
type: Component,
|
|
@@ -2531,13 +2912,17 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2531
2912
|
'[class.wizard-xl]': "size == 'xl'",
|
|
2532
2913
|
'[class.wizard-in-page]': 'inPage',
|
|
2533
2914
|
'[class.wizard-in-page--fill-content-area]': 'inPage && inPageFillContentArea',
|
|
2534
|
-
|
|
2915
|
+
'[class.wizard-horizontal]': 'stepnavLayout === ClrWizardStepnavLayout.HORIZONTAL',
|
|
2916
|
+
}, standalone: false, template: "<!--\n ~ Copyright (c) 2016-2026 Broadcom. All Rights Reserved.\n ~ The term \"Broadcom\" refers to Broadcom Inc. and/or its subsidiaries.\n ~ This software is released under MIT license.\n ~ The full license information can be found in LICENSE in the root directory of this project.\n -->\n<ng-template #coreWizardContent>\n <div class=\"clr-wizard-content-wrapper\">\n @if (stepnavLayout === ClrWizardStepnavLayout.HORIZONTAL) {\n <div class=\"clr-wizard-title-wrapper\">\n <ng-container [ngTemplateOutlet]=\"wizardTitleTemplate\"></ng-container>\n <ng-container [ngTemplateOutlet]=\"wizardActionsTemplate\"></ng-container>\n </div>\n }\n\n <div class=\"clr-wizard-stepnav-wrapper\" role=\"region\">\n @if (stepnavLayout === ClrWizardStepnavLayout.VERTICAL) {\n <ng-container [ngTemplateOutlet]=\"wizardTitleTemplate\"></ng-container>\n }\n <clr-wizard-stepnav [label]=\"stepnavAriaLabel\"></clr-wizard-stepnav>\n </div>\n\n <div class=\"clr-wizard-main-content\">\n @if (showHeader) {\n <div class=\"clr-wizard-header\">\n @if (navService.currentPage?.pageTitle) {\n <div class=\"clr-wizard-page-title-wrapper\" cdkFocusInitial tabindex=\"-1\">\n <div\n class=\"clr-wizard-page-title\"\n role=\"heading\"\n [attr.aria-level]=\"navService.currentPage?.pageTitle?.headingLevel || 2\"\n >\n <span tabindex=\"-1\" #pageTitle class=\"clr-wizard-page-title-text\">\n <ng-template [ngTemplateOutlet]=\"navService.currentPageTitle\"></ng-template>\n </span>\n </div>\n </div>\n } @if (stepnavLayout === ClrWizardStepnavLayout.VERTICAL) {\n <ng-container [ngTemplateOutlet]=\"wizardActionsTemplate\"></ng-container>\n }\n </div>\n }\n\n <div #body class=\"clr-wizard-body-wrapper\">\n <div class=\"clr-wizard-body\">\n <main clr-wizard-pages-wrapper class=\"clr-wizard-content\">\n <ng-content></ng-content>\n </main>\n </div>\n </div>\n\n @if (showFooter) {\n <div class=\"clr-wizard-footer\">\n <div class=\"clr-wizard-footer-buttons\">\n <div\n class=\"clr-wizard-footer-buttons-wrapper\"\n [ngClass]=\"{'align-start': footerAlign === ClrWizardFooterAlign.START, 'align-end': footerAlign === ClrWizardFooterAlign.END}\"\n >\n @if (navService.currentPage?.hasButtons) {\n <ng-template [ngTemplateOutlet]=\"navService.currentPage.buttons\"></ng-template>\n } @else {\n <ng-content select=\"clr-wizard-button\"></ng-content>\n }\n </div>\n </div>\n </div>\n }\n </div>\n </div>\n</ng-template>\n\n<ng-template #wizardTitleTemplate>\n <div class=\"clr-wizard-title\" [id]=\"wizardId\" role=\"heading\" [attr.aria-level]=\"wizardTitle?.headingLevel || 1\">\n <ng-content select=\"clr-wizard-title\"></ng-content>\n </div>\n</ng-template>\n\n<ng-template #wizardActionsTemplate>\n @if (headerActionService.displayHeaderActionsWrapper) {\n <div class=\"clr-wizard-header-actions-wrapper\">\n @if (headerActionService.showWizardHeaderActions) {\n <ng-content select=\"clr-wizard-header-action\"></ng-content>\n } @if (headerActionService.currentPageHasHeaderActions) {\n <ng-template [ngTemplateOutlet]=\"navService.currentPage?.headerActions\"></ng-template>\n }\n </div>\n } @if (closable && !inPage) {\n <button type=\"button\" class=\"close\" [attr.aria-label]=\"commonStrings.keys.close\" (click)=\"modalCancel()\">\n <cds-icon shape=\"window-close\"></cds-icon>\n </button>\n }\n</ng-template>\n\n@if (inPage) {\n<ng-container [ngTemplateOutlet]=\"coreWizardContent\"></ng-container>\n} @else {\n<clr-modal\n [clrModalOpen]=\"_open\"\n [clrModalSize]=\"size\"\n [clrModalClosable]=\"closable\"\n [clrModalStaticBackdrop]=\"true\"\n [clrModalSkipAnimation]=\"stopModalAnimations\"\n [clrModalOverrideScrollService]=\"isInline\"\n [clrModalPreventClose]=\"true\"\n (clrModalAlternateClose)=\"modalCancel()\"\n [clrModalLabelledById]=\"wizardId\"\n>\n <ng-template #clrInternalModalContentTemplate>\n <ng-container [ngTemplateOutlet]=\"coreWizardContent\"></ng-container>\n </ng-template>\n</clr-modal>\n}\n" }]
|
|
2535
2917
|
}], ctorParameters: () => [{ type: undefined, decorators: [{
|
|
2536
2918
|
type: Inject,
|
|
2537
2919
|
args: [PLATFORM_ID]
|
|
2538
2920
|
}] }, { type: i3.ClrCommonStringsService }, { type: WizardNavigationService }, { type: PageCollectionService }, { type: ButtonHubService }, { type: HeaderActionService }, { type: i0.ElementRef }, { type: i0.IterableDiffers }], propDecorators: { stepnavAriaLabel: [{
|
|
2539
2921
|
type: Input,
|
|
2540
2922
|
args: ['clrWizardStepnavAriaLabel']
|
|
2923
|
+
}], stepnavLayout: [{
|
|
2924
|
+
type: Input,
|
|
2925
|
+
args: [{ alias: 'clrWizardStepnavLayout', transform: stepnavLayoutAttribute }]
|
|
2541
2926
|
}], size: [{
|
|
2542
2927
|
type: Input,
|
|
2543
2928
|
args: ['clrWizardSize']
|
|
@@ -2547,6 +2932,12 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2547
2932
|
}], inPageFillContentArea: [{
|
|
2548
2933
|
type: Input,
|
|
2549
2934
|
args: ['clrWizardInPageFillContentArea']
|
|
2935
|
+
}], hideFooter: [{
|
|
2936
|
+
type: Input,
|
|
2937
|
+
args: ['clrWizardHideFooter']
|
|
2938
|
+
}], _footerAlign: [{
|
|
2939
|
+
type: Input,
|
|
2940
|
+
args: [{ alias: 'clrWizardFooterAlign', transform: footerAlignAttribute }]
|
|
2550
2941
|
}], closable: [{
|
|
2551
2942
|
type: Input,
|
|
2552
2943
|
args: ['clrWizardClosable']
|
|
@@ -2579,7 +2970,10 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2579
2970
|
args: ['pageTitle']
|
|
2580
2971
|
}], pages: [{
|
|
2581
2972
|
type: ContentChildren,
|
|
2582
|
-
args: [ClrWizardPage
|
|
2973
|
+
args: [ClrWizardPage]
|
|
2974
|
+
}], wizardButtons: [{
|
|
2975
|
+
type: ContentChildren,
|
|
2976
|
+
args: [ClrWizardButton, { descendants: false }]
|
|
2583
2977
|
}], headerActions: [{
|
|
2584
2978
|
type: ContentChildren,
|
|
2585
2979
|
args: [ClrWizardHeaderAction]
|
|
@@ -2589,12 +2983,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2589
2983
|
}], bodyElementRef: [{
|
|
2590
2984
|
type: ViewChild,
|
|
2591
2985
|
args: ['body']
|
|
2592
|
-
}], modal: [{
|
|
2593
|
-
type: ViewChild,
|
|
2594
|
-
args: [ClrModal]
|
|
2595
|
-
}], title: [{
|
|
2596
|
-
type: ViewChild,
|
|
2597
|
-
args: ['title']
|
|
2598
2986
|
}], forceForward: [{
|
|
2599
2987
|
type: Input,
|
|
2600
2988
|
args: ['clrWizardForceForwardNavigation']
|
|
@@ -2615,191 +3003,6 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2615
3003
|
args: ['clrWizardDisableStepnav']
|
|
2616
3004
|
}] } });
|
|
2617
3005
|
|
|
2618
|
-
/*
|
|
2619
|
-
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
2620
|
-
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
2621
|
-
* This software is released under MIT license.
|
|
2622
|
-
* The full license information can be found in LICENSE in the root directory of this project.
|
|
2623
|
-
*/
|
|
2624
|
-
const DEFAULT_BUTTON_TYPES = {
|
|
2625
|
-
cancel: 'cancel',
|
|
2626
|
-
previous: 'previous',
|
|
2627
|
-
next: 'next',
|
|
2628
|
-
finish: 'finish',
|
|
2629
|
-
danger: 'danger',
|
|
2630
|
-
};
|
|
2631
|
-
const CUSTOM_BUTTON_TYPES = {
|
|
2632
|
-
cancel: 'custom-cancel',
|
|
2633
|
-
previous: 'custom-previous',
|
|
2634
|
-
next: 'custom-next',
|
|
2635
|
-
finish: 'custom-finish',
|
|
2636
|
-
danger: 'custom-danger',
|
|
2637
|
-
};
|
|
2638
|
-
class ClrWizardButton {
|
|
2639
|
-
constructor(navService, buttonService) {
|
|
2640
|
-
this.navService = navService;
|
|
2641
|
-
this.buttonService = buttonService;
|
|
2642
|
-
this.type = '';
|
|
2643
|
-
this.disabled = false;
|
|
2644
|
-
this.hidden = false;
|
|
2645
|
-
// EventEmitter which is emitted when a button is clicked.
|
|
2646
|
-
this.wasClicked = new EventEmitter(false);
|
|
2647
|
-
}
|
|
2648
|
-
get isCancel() {
|
|
2649
|
-
return this.checkDefaultAndCustomType(this.type, 'cancel');
|
|
2650
|
-
}
|
|
2651
|
-
get isNext() {
|
|
2652
|
-
return this.checkDefaultAndCustomType(this.type, 'next');
|
|
2653
|
-
}
|
|
2654
|
-
get isPrevious() {
|
|
2655
|
-
return this.checkDefaultAndCustomType(this.type, 'previous');
|
|
2656
|
-
}
|
|
2657
|
-
get isFinish() {
|
|
2658
|
-
return this.checkDefaultAndCustomType(this.type, 'finish');
|
|
2659
|
-
}
|
|
2660
|
-
get isDanger() {
|
|
2661
|
-
return this.checkDefaultAndCustomType(this.type, 'danger');
|
|
2662
|
-
}
|
|
2663
|
-
get isPrimaryAction() {
|
|
2664
|
-
return this.isNext || this.isDanger || this.isFinish;
|
|
2665
|
-
}
|
|
2666
|
-
get _disabledAttribute() {
|
|
2667
|
-
if (this.isDisabled) {
|
|
2668
|
-
return '';
|
|
2669
|
-
}
|
|
2670
|
-
return null;
|
|
2671
|
-
}
|
|
2672
|
-
get isDisabled() {
|
|
2673
|
-
// dealing with negatives here. cognitively easier to think of it like this...
|
|
2674
|
-
const disabled = true;
|
|
2675
|
-
const nav = this.navService;
|
|
2676
|
-
const page = this.navService.currentPage;
|
|
2677
|
-
// Ensure we don't change the response until buttons are ready to avoid chocolate
|
|
2678
|
-
if (!this.buttonService.buttonsReady) {
|
|
2679
|
-
return !disabled;
|
|
2680
|
-
}
|
|
2681
|
-
if (this.disabled || nav.wizardStopNavigation || !page) {
|
|
2682
|
-
return true;
|
|
2683
|
-
}
|
|
2684
|
-
if (this.isCancel) {
|
|
2685
|
-
return !disabled;
|
|
2686
|
-
}
|
|
2687
|
-
if (this.isPrevious && (nav.currentPageIsFirst || page.previousStepDisabled)) {
|
|
2688
|
-
return disabled;
|
|
2689
|
-
}
|
|
2690
|
-
if (this.isDanger && !page.readyToComplete) {
|
|
2691
|
-
return disabled;
|
|
2692
|
-
}
|
|
2693
|
-
if (this.isNext && (nav.currentPageIsLast || !page.readyToComplete)) {
|
|
2694
|
-
return disabled;
|
|
2695
|
-
}
|
|
2696
|
-
if (this.isFinish && (!nav.currentPageIsLast || !page.readyToComplete)) {
|
|
2697
|
-
return disabled;
|
|
2698
|
-
}
|
|
2699
|
-
return !disabled;
|
|
2700
|
-
}
|
|
2701
|
-
get isHidden() {
|
|
2702
|
-
// dealing with negatives here. cognitively easier to think of it like this...
|
|
2703
|
-
const hidden = true;
|
|
2704
|
-
const nav = this.navService;
|
|
2705
|
-
// Ensure we don't change the response until buttons are ready to avoid chocolate
|
|
2706
|
-
if (!this.buttonService.buttonsReady) {
|
|
2707
|
-
return !hidden;
|
|
2708
|
-
}
|
|
2709
|
-
if (this.hidden) {
|
|
2710
|
-
return true;
|
|
2711
|
-
}
|
|
2712
|
-
if (this.isCancel) {
|
|
2713
|
-
return !hidden;
|
|
2714
|
-
}
|
|
2715
|
-
if (this.isPrevious && nav.currentPageIsFirst) {
|
|
2716
|
-
return hidden;
|
|
2717
|
-
}
|
|
2718
|
-
if (this.isNext && nav.currentPageIsLast) {
|
|
2719
|
-
return hidden;
|
|
2720
|
-
}
|
|
2721
|
-
if (this.isFinish && !nav.currentPageIsLast) {
|
|
2722
|
-
return hidden;
|
|
2723
|
-
}
|
|
2724
|
-
return !hidden;
|
|
2725
|
-
}
|
|
2726
|
-
click() {
|
|
2727
|
-
if (this.isDisabled) {
|
|
2728
|
-
return;
|
|
2729
|
-
}
|
|
2730
|
-
this.wasClicked.emit(this.type);
|
|
2731
|
-
this.buttonService.buttonClicked(this.type);
|
|
2732
|
-
}
|
|
2733
|
-
checkDefaultAndCustomType(valueToCheck = '', typeToLookUp) {
|
|
2734
|
-
if (DEFAULT_BUTTON_TYPES[typeToLookUp] === valueToCheck) {
|
|
2735
|
-
return true;
|
|
2736
|
-
}
|
|
2737
|
-
if (CUSTOM_BUTTON_TYPES[typeToLookUp] === valueToCheck) {
|
|
2738
|
-
return true;
|
|
2739
|
-
}
|
|
2740
|
-
return false;
|
|
2741
|
-
}
|
|
2742
|
-
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardButton, deps: [{ token: WizardNavigationService }, { token: ButtonHubService }], target: i0.ɵɵFactoryTarget.Component }); }
|
|
2743
|
-
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.1.3", type: ClrWizardButton, isStandalone: false, selector: "clr-wizard-button", inputs: { type: "type", disabled: ["clrWizardButtonDisabled", "disabled"], hidden: ["clrWizardButtonHidden", "hidden"] }, outputs: { wasClicked: "clrWizardButtonClicked" }, host: { properties: { "attr.aria-hidden": "isHidden" }, classAttribute: "clr-wizard-btn-wrapper" }, ngImport: i0, template: `
|
|
2744
|
-
<button
|
|
2745
|
-
type="button"
|
|
2746
|
-
class="btn clr-wizard-btn"
|
|
2747
|
-
[class.btn-link]="isCancel"
|
|
2748
|
-
[class.clr-wizard-btn--tertiary]="isCancel"
|
|
2749
|
-
[class.btn-outline]="isPrevious"
|
|
2750
|
-
[class.clr-wizard-btn--secondary]="isPrevious"
|
|
2751
|
-
[class.btn-primary]="isPrimaryAction"
|
|
2752
|
-
[class.clr-wizard-btn--primary]="isPrimaryAction"
|
|
2753
|
-
[class.btn-success]="isFinish"
|
|
2754
|
-
[class.btn-danger]="isDanger"
|
|
2755
|
-
[class.disabled]="isDisabled"
|
|
2756
|
-
[attr.disabled]="_disabledAttribute"
|
|
2757
|
-
(click)="click()"
|
|
2758
|
-
>
|
|
2759
|
-
<ng-content></ng-content>
|
|
2760
|
-
</button>
|
|
2761
|
-
`, isInline: true }); }
|
|
2762
|
-
}
|
|
2763
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImport: i0, type: ClrWizardButton, decorators: [{
|
|
2764
|
-
type: Component,
|
|
2765
|
-
args: [{
|
|
2766
|
-
selector: 'clr-wizard-button',
|
|
2767
|
-
template: `
|
|
2768
|
-
<button
|
|
2769
|
-
type="button"
|
|
2770
|
-
class="btn clr-wizard-btn"
|
|
2771
|
-
[class.btn-link]="isCancel"
|
|
2772
|
-
[class.clr-wizard-btn--tertiary]="isCancel"
|
|
2773
|
-
[class.btn-outline]="isPrevious"
|
|
2774
|
-
[class.clr-wizard-btn--secondary]="isPrevious"
|
|
2775
|
-
[class.btn-primary]="isPrimaryAction"
|
|
2776
|
-
[class.clr-wizard-btn--primary]="isPrimaryAction"
|
|
2777
|
-
[class.btn-success]="isFinish"
|
|
2778
|
-
[class.btn-danger]="isDanger"
|
|
2779
|
-
[class.disabled]="isDisabled"
|
|
2780
|
-
[attr.disabled]="_disabledAttribute"
|
|
2781
|
-
(click)="click()"
|
|
2782
|
-
>
|
|
2783
|
-
<ng-content></ng-content>
|
|
2784
|
-
</button>
|
|
2785
|
-
`,
|
|
2786
|
-
host: { class: 'clr-wizard-btn-wrapper', '[attr.aria-hidden]': 'isHidden' },
|
|
2787
|
-
standalone: false,
|
|
2788
|
-
}]
|
|
2789
|
-
}], ctorParameters: () => [{ type: WizardNavigationService }, { type: ButtonHubService }], propDecorators: { type: [{
|
|
2790
|
-
type: Input,
|
|
2791
|
-
args: ['type']
|
|
2792
|
-
}], disabled: [{
|
|
2793
|
-
type: Input,
|
|
2794
|
-
args: ['clrWizardButtonDisabled']
|
|
2795
|
-
}], hidden: [{
|
|
2796
|
-
type: Input,
|
|
2797
|
-
args: ['clrWizardButtonHidden']
|
|
2798
|
-
}], wasClicked: [{
|
|
2799
|
-
type: Output,
|
|
2800
|
-
args: ['clrWizardButtonClicked']
|
|
2801
|
-
}] } });
|
|
2802
|
-
|
|
2803
3006
|
/*
|
|
2804
3007
|
* Copyright (c) 2016-2026 Broadcom. All Rights Reserved.
|
|
2805
3008
|
* The term "Broadcom" refers to Broadcom Inc. and/or its subsidiaries.
|
|
@@ -2867,5 +3070,5 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.1.3", ngImpor
|
|
|
2867
3070
|
* Generated bundle index. Do not edit.
|
|
2868
3071
|
*/
|
|
2869
3072
|
|
|
2870
|
-
export { CLR_WIZARD_DIRECTIVES, CUSTOM_BUTTON_TYPES, ClrWizard, ClrWizardButton, ClrWizardHeaderAction, ClrWizardModule, ClrWizardPage, ClrWizardPageButtons, ClrWizardPageHeaderActions, ClrWizardPageNavTitle, ClrWizardPageTitle, ClrWizardStepnav, ClrWizardStepnavItem, ClrWizardTitle, DEFAULT_BUTTON_TYPES };
|
|
3073
|
+
export { CLR_WIZARD_DIRECTIVES, CUSTOM_BUTTON_TYPES, ClrWizard, ClrWizardButton, ClrWizardFooterAlign, ClrWizardHeaderAction, ClrWizardModule, ClrWizardPage, ClrWizardPageButtons, ClrWizardPageHeaderActions, ClrWizardPageNavTitle, ClrWizardPageTitle, ClrWizardStepnav, ClrWizardStepnavItem, ClrWizardStepnavLayout, ClrWizardTitle, DEFAULT_BUTTON_TYPES, footerAlignAttribute, stepnavLayoutAttribute };
|
|
2871
3074
|
//# sourceMappingURL=clr-angular-wizard.mjs.map
|