@sixbell-telco/sdk 4.5.0 → 4.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +276 -986
- package/GLOSSARY.md +76 -0
- package/README.md +143 -1346
- package/banner.webp +0 -0
- package/components/badge/src/badge.component.d.ts +6 -1
- package/components/dropdown-menu/README.md +1 -0
- package/components/dropdown-menu/bar/dropdown-menu-bar/dropdown-menu-bar.component.d.ts +2 -0
- package/components/dropdown-menu/bar/dropdown-menu-bar-sub-trigger/dropdown-menu-bar-sub-trigger.component.d.ts +9 -2
- package/components/dropdown-menu/bar/dropdown-menu-bar-trigger/dropdown-menu-bar-trigger.component.d.ts +6 -0
- package/components/dropdown-menu/context/dropdown-context-menu-trigger/dropdown-context-menu-trigger.component.d.ts +7 -0
- package/components/dropdown-menu/public-api.d.ts +1 -0
- package/components/dropdown-menu/src/directives/dropdown-menu-keyboard.directive.d.ts +54 -0
- package/components/dropdown-menu/src/dropdown-menu-sub-trigger/dropdown-menu-sub-trigger.component.d.ts +5 -0
- package/components/dropdown-menu/src/dropdown-menu-trigger/dropdown-menu-trigger.component.d.ts +15 -2
- package/components/forms/checkbox/src/checkbox.component.d.ts +12 -1
- package/components/status-illustration/README.md +38 -0
- package/components/status-illustration/index.d.ts +5 -0
- package/components/status-illustration/public-api.d.ts +1 -0
- package/components/status-illustration/src/status-illustration.component.d.ts +42 -0
- package/components/tab/directives/tab-content/tab-content.directive.d.ts +1 -1
- package/components/tree/README.md +11 -1
- package/components/tree/src/tree.component.d.ts +44 -5
- package/components/wizard/README.md +17 -0
- package/components/wizard/services/wizard.service.d.ts +9 -0
- package/components/wizard/wizard-indicator/wizard-indicator.component.d.ts +71 -0
- package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +24 -1
- package/directives/text/src/text.directive.d.ts +6 -2
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs +5 -5
- package/fesm2022/sixbell-telco-sdk-components-audio-player.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs +8 -2
- package/fesm2022/sixbell-telco-sdk-components-badge.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-card.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +3 -3
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +92 -25
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs +29 -3
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-context.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +271 -21
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-dropdown.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs +14 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-checkbox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +15 -5
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-product-card.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-segmented-button.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-sonner-toaster.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-sonner.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-status-illustration.mjs +66 -0
- package/fesm2022/sixbell-telco-sdk-components-status-illustration.mjs.map +1 -0
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs +1 -0
- package/fesm2022/sixbell-telco-sdk-components-tab.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +4 -4
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tooltip.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs +171 -51
- package/fesm2022/sixbell-telco-sdk-components-tree.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +123 -356
- package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs +4 -1
- package/fesm2022/sixbell-telco-sdk-directives-text.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-directives-truncate.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +55 -13
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs +23 -4
- package/fesm2022/sixbell-telco-sdk-utils-theme.mjs.map +1 -1
- package/i18n/sdk/en.json +4 -1
- package/i18n/sdk/es.json +4 -1
- package/i18n/sdk/pt.json +4 -1
- package/layouts/README.md +16 -6
- package/layouts/src/page-banner/page-banner.component.d.ts +37 -6
- package/manifest.json +10943 -0
- package/package.json +58 -41
- package/schematics/lib/plan.cjs +179 -0
- package/schematics/lib/tokens.cjs +133 -0
- package/schematics/lib/workspace.cjs +118 -0
- package/schematics/manual-steps.json +90 -0
- package/schematics/migration.json +15 -0
- package/schematics/migrations/v4-0-0/assets.cjs +331 -0
- package/schematics/migrations/v4-0-0/canonical/enghouse_networks.json +360 -0
- package/schematics/migrations/v4-0-0/canonical/shell.json +25 -0
- package/schematics/migrations/v4-0-0/canonical/theme-assets.json +44 -0
- package/schematics/migrations/v4-0-0/canonical/themes.json +11 -0
- package/schematics/migrations/v4-0-0/index.cjs +96 -0
- package/schematics/migrations/v4-0-0/layout.cjs +269 -0
- package/schematics/migrations/v4-0-0/shell.cjs +1864 -0
- package/schematics/migrations/v4-6-0/index.cjs +394 -0
- package/src/_index.css +257 -26
- package/utils/theme/README.md +1 -1
- package/utils/theme/public-api.d.ts +1 -1
- package/utils/theme/src/models/theme.d.ts +10 -0
- package/utils/theme/src/theme-assets/theme-assets.service.d.ts +12 -1
- package/banner.png +0 -0
- package/components/wizard/wizard-marker/wizard-marker.component.d.ts +0 -85
- package/components/wizard/wizard-step/wizard-step.component.d.ts +0 -83
- package/components/wizard/wizard-sub-step/wizard-sub-step.component.d.ts +0 -95
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import * as i0 from '@angular/core';
|
|
2
|
-
import { signal, computed, Injectable, input, ChangeDetectionStrategy, Component, inject, booleanAttribute,
|
|
3
|
-
import { CommonModule, NgClass } from '@angular/common';
|
|
2
|
+
import { signal, computed, Injectable, input, ChangeDetectionStrategy, Component, inject, booleanAttribute, output, linkedSignal, contentChildren } from '@angular/core';
|
|
3
|
+
import { CommonModule, NgTemplateOutlet, NgClass } from '@angular/common';
|
|
4
4
|
import { cn } from '@sixbell-telco/sdk/utils/cn';
|
|
5
5
|
import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
|
|
6
6
|
import { matChevronLeftOutline, matChevronRightOutline, matKeyboardReturnOutline, matSaveOutline } from '@ng-icons/material-icons/outline';
|
|
7
|
-
import {
|
|
7
|
+
import { _, TranslatePipe } from '@ngx-translate/core';
|
|
8
8
|
import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
|
|
9
9
|
import { IconComponent } from '@sixbell-telco/sdk/components/icon';
|
|
10
10
|
import { TextDirective } from '@sixbell-telco/sdk/directives/text';
|
|
11
|
-
import { matCheckOutline } from '@sixbell-telco/sdk/components/icon/material/outline';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Enum-like object representing possible wizard step statuses
|
|
@@ -183,6 +182,15 @@ class WizardService {
|
|
|
183
182
|
const newSteps = this.steps().map((s, i) => (i === index ? { ...s, label } : s));
|
|
184
183
|
this.setSteps(newSteps);
|
|
185
184
|
}
|
|
185
|
+
/**
|
|
186
|
+
* Updates the meta text of the step at the specified index (shown by the checklist indicator)
|
|
187
|
+
* @param {number} index - Index of step to update
|
|
188
|
+
* @param {string | undefined} meta - New meta text, or undefined to clear it
|
|
189
|
+
*/
|
|
190
|
+
updateStepMeta(index, meta) {
|
|
191
|
+
const newSteps = this.steps().map((s, i) => (i === index ? { ...s, meta } : s));
|
|
192
|
+
this.setSteps(newSteps);
|
|
193
|
+
}
|
|
186
194
|
/**
|
|
187
195
|
* Updates status of step at specified index
|
|
188
196
|
* @param {number} index - Index of step to update
|
|
@@ -190,16 +198,17 @@ class WizardService {
|
|
|
190
198
|
* @param {number} [stale] - Optional delay in milliseconds before applying changes
|
|
191
199
|
*/
|
|
192
200
|
updateStepStatus(index, status, stale) {
|
|
193
|
-
|
|
201
|
+
// Built when applied, so a delayed status never reverts a change (validity, label) made meanwhile
|
|
202
|
+
const withStatus = () => this.steps().map((s, i) => (i === index ? { ...s, status } : s));
|
|
194
203
|
this._isTransitioning.set(true);
|
|
195
204
|
if (stale === undefined) {
|
|
196
205
|
this._isTransitioning.set(false);
|
|
197
|
-
this.setSteps(
|
|
206
|
+
this.setSteps(withStatus());
|
|
198
207
|
return;
|
|
199
208
|
}
|
|
200
209
|
setTimeout(() => {
|
|
201
210
|
this._isTransitioning.set(false);
|
|
202
|
-
this.setSteps(
|
|
211
|
+
this.setSteps(withStatus());
|
|
203
212
|
}, stale);
|
|
204
213
|
}
|
|
205
214
|
/**
|
|
@@ -418,364 +427,98 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
418
427
|
args: [{ selector: 'st-wizard-content', imports: [], template: "@if (this.isStepActive()) {\n\t<div [class]=\"componentClass()\">\n\t\t<ng-content></ng-content>\n\t</div>\n}\n" }]
|
|
419
428
|
}], ctorParameters: () => [] });
|
|
420
429
|
|
|
430
|
+
/** Vertical gap between rail rows, in px (`gap-1`); the track and highlight geometry depend on it. */
|
|
431
|
+
const RAIL_ROW_GAP = 4;
|
|
432
|
+
/** Placeholder used to split the translated "Step {{index}} of {{total}}" around the number, so the number can roll. */
|
|
433
|
+
const INDEX_MARK = '';
|
|
434
|
+
const STATE_KEYS = {
|
|
435
|
+
completed: _('sdk.wizard.wizardMarker.completed'),
|
|
436
|
+
'in progress': _('sdk.wizard.wizardWrapper.currentStep'),
|
|
437
|
+
pending: _('sdk.wizard.wizardWrapper.upNext'),
|
|
438
|
+
error: _('sdk.wizard.wizardMarker.error'),
|
|
439
|
+
};
|
|
421
440
|
/**
|
|
422
|
-
*
|
|
441
|
+
* Step indicator rendered by `st-wizard` (internal).
|
|
423
442
|
*
|
|
424
443
|
* @remarks
|
|
425
|
-
*
|
|
426
|
-
*
|
|
427
|
-
*
|
|
428
|
-
* -
|
|
429
|
-
*
|
|
430
|
-
*
|
|
431
|
-
* Uses NGX-Translate for localization of status labels.
|
|
432
|
-
*
|
|
433
|
-
* @example
|
|
434
|
-
* ```html
|
|
435
|
-
* <!-- Completed state -->
|
|
436
|
-
* <st-wizard-marker [status]="'completed'"></st-wizard-marker>
|
|
437
|
-
*
|
|
438
|
-
* <!-- In progress state -->
|
|
439
|
-
* <st-wizard-marker [status]="'in progress'"></st-wizard-marker>
|
|
440
|
-
* ```
|
|
444
|
+
* Reads the steps and the current index from {@link WizardService}. The current step (`aria-current="step"`)
|
|
445
|
+
* follows the service index at once; each circle follows the step status, which the service applies after
|
|
446
|
+
* its 300ms delay, so the track fill reaches the next circle as it activates.
|
|
447
|
+
* State-bound elements are recreated when their state changes, which replays their one-shot animation.
|
|
448
|
+
* @internal
|
|
441
449
|
*/
|
|
442
|
-
class
|
|
443
|
-
/** @internal
|
|
444
|
-
translateService = inject(TranslateService);
|
|
445
|
-
/** @internal Wizard state service */
|
|
450
|
+
class WizardIndicatorComponent {
|
|
451
|
+
/** @internal */
|
|
446
452
|
wizardService = inject(WizardService);
|
|
447
|
-
/**
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
/**
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
completed = signal('completed');
|
|
464
|
-
/** @internal Signal holding translated "in progress" text */
|
|
465
|
-
inProgress = signal('in progress');
|
|
466
|
-
/** @internal Signal holding translated "pending" text */
|
|
467
|
-
pending = signal('pending');
|
|
468
|
-
/** @internal Signal holding translated "error" text */
|
|
469
|
-
error = signal('error');
|
|
470
|
-
/** @internal Base CSS classes for the marker */
|
|
471
|
-
baseClasses = 'rounded-selector transition-colors duration-300 ease-out delay-150 text-nowrap w-max';
|
|
472
|
-
/** @internal Status-to-class mapping */
|
|
473
|
-
statusClassMap = {
|
|
474
|
-
completed: 'bg-success/20 text-success border-[2px] border-success px-3 py-[5px]',
|
|
475
|
-
'in progress': 'bg-primary text-primary-content border-[2px] border-primary px-[10px] py-[3px]',
|
|
476
|
-
pending: 'bg-base-200 text-base-content border-[2px] border-base-300 px-[10px] py-[3px]',
|
|
477
|
-
error: 'bg-error/20 text-error border-[2px] border-error px-[10px] py-[3px]',
|
|
478
|
-
};
|
|
479
|
-
/**
|
|
480
|
-
* Initializes component translations
|
|
481
|
-
* @remarks Loads translated status labels using NGX-Translate
|
|
482
|
-
*/
|
|
483
|
-
translationEffect = effect(() => {
|
|
484
|
-
this.initTranslatations();
|
|
453
|
+
/** Indicator style to render */
|
|
454
|
+
indicator = input.required();
|
|
455
|
+
/** Whether completed checklist steps can be clicked to go back */
|
|
456
|
+
canGoBack = input(true, { transform: booleanAttribute });
|
|
457
|
+
/** Emits the index of a completed step the user picked to go back to */
|
|
458
|
+
stepSelect = output();
|
|
459
|
+
/** @internal */
|
|
460
|
+
indexMark = INDEX_MARK;
|
|
461
|
+
/** @internal Number of steps */
|
|
462
|
+
count = computed(() => this.wizardService.steps().length);
|
|
463
|
+
/** @internal Current step index */
|
|
464
|
+
current = computed(() => this.wizardService.currentStepIndex());
|
|
465
|
+
/** @internal Direction of the last step change, so the number rolls the way the user moved */
|
|
466
|
+
direction = linkedSignal({
|
|
467
|
+
source: this.current,
|
|
468
|
+
computation: (index, previous) => (previous && index < previous.source ? 'back' : 'forward'),
|
|
485
469
|
});
|
|
486
|
-
/**
|
|
487
|
-
|
|
488
|
-
|
|
470
|
+
/** @internal Current step label */
|
|
471
|
+
currentLabel = computed(() => this.wizardService.steps()[this.current()]?.label ?? '');
|
|
472
|
+
/** @internal Progress in percent: 0 on the first step, 100 on the last */
|
|
473
|
+
progress = computed(() => {
|
|
474
|
+
const n = this.count();
|
|
475
|
+
return n <= 1 ? 100 : Math.min(100, Math.max(0, (this.current() / (n - 1)) * 100));
|
|
476
|
+
});
|
|
477
|
+
/** @internal Height of one rail row (rows share one height) */
|
|
478
|
+
railRowHeight = computed(() => `calc((100% - ${(this.count() - 1) * RAIL_ROW_GAP}px) / ${Math.max(1, this.count())})`);
|
|
479
|
+
/** @internal Track inset from the top and bottom: half a row, so it starts and ends on the circle centres */
|
|
480
|
+
railTrackInset = computed(() => `calc((100% - ${(this.count() - 1) * RAIL_ROW_GAP}px) / ${Math.max(1, this.count() * 2)})`);
|
|
481
|
+
/** @internal Moves the shared highlight onto the current row */
|
|
482
|
+
railHighlightTransform = computed(() => `translateY(calc(${this.current()} * (100% + ${RAIL_ROW_GAP}px)))`);
|
|
483
|
+
/** @internal Segment grid columns */
|
|
484
|
+
segmentColumns = computed(() => `repeat(${Math.max(1, this.count())}, minmax(0, 1fr))`);
|
|
485
|
+
/**
|
|
486
|
+
* Translation key of the state line for a status
|
|
489
487
|
* @internal
|
|
490
488
|
*/
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
return this.completed();
|
|
494
|
-
if (this.status() === 'in progress')
|
|
495
|
-
return this.inProgress();
|
|
496
|
-
if (this.status() === 'error')
|
|
497
|
-
return this.error();
|
|
498
|
-
return this.pending();
|
|
489
|
+
stateKey(status) {
|
|
490
|
+
return STATE_KEYS[status] ?? STATE_KEYS.pending;
|
|
499
491
|
}
|
|
500
492
|
/**
|
|
501
|
-
*
|
|
502
|
-
* @returns {string} Combined Tailwind classes
|
|
493
|
+
* Splits a translated "Step {{index}} of {{total}}" rendered with {@link INDEX_MARK} into the text before and after the number
|
|
503
494
|
* @internal
|
|
504
495
|
*/
|
|
505
|
-
|
|
506
|
-
|
|
496
|
+
splitAtIndex(text) {
|
|
497
|
+
const at = text.indexOf(INDEX_MARK);
|
|
498
|
+
return at < 0 ? [text, ''] : [text.slice(0, at), text.slice(at + INDEX_MARK.length)];
|
|
507
499
|
}
|
|
508
500
|
/**
|
|
509
|
-
*
|
|
510
|
-
* @remarks Uses translation keys:
|
|
511
|
-
* - 'sdk.wizard.wizardMarker.completed'
|
|
512
|
-
* - 'sdk.wizard.wizardMarker.inProgress'
|
|
513
|
-
* - 'sdk.wizard.wizardMarker.pending'
|
|
501
|
+
* Segment fill in percent: full when done or failed, half on the current step
|
|
514
502
|
* @internal
|
|
515
503
|
*/
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
this.translateService.get(_('sdk.wizard.wizardMarker.inProgress')).subscribe((res) => {
|
|
521
|
-
this.inProgress.set(res);
|
|
522
|
-
});
|
|
523
|
-
this.translateService.get(_('sdk.wizard.wizardMarker.pending')).subscribe((res) => {
|
|
524
|
-
this.pending.set(res);
|
|
525
|
-
});
|
|
526
|
-
this.translateService.get(_('sdk.wizard.wizardMarker.error')).subscribe((res) => {
|
|
527
|
-
this.error.set(res);
|
|
528
|
-
});
|
|
504
|
+
segmentFill(status) {
|
|
505
|
+
if (status === 'completed' || status === 'error')
|
|
506
|
+
return 100;
|
|
507
|
+
return status === 'in progress' ? 50 : 0;
|
|
529
508
|
}
|
|
530
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: WizardMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
531
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", type: WizardMarkerComponent, isStandalone: true, selector: "st-wizard-marker", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"statusMarkerClasses()\">\n\t<span stText=\"10\" stTextWeight=\"medium\">{{ statusMarkerMessage() }}</span>\n</div>\n", dependencies: [{ kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
532
|
-
}
|
|
533
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: WizardMarkerComponent, decorators: [{
|
|
534
|
-
type: Component,
|
|
535
|
-
args: [{ selector: 'st-wizard-marker', imports: [TextDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"statusMarkerClasses()\">\n\t<span stText=\"10\" stTextWeight=\"medium\">{{ statusMarkerMessage() }}</span>\n</div>\n" }]
|
|
536
|
-
}] });
|
|
537
|
-
|
|
538
|
-
/**
|
|
539
|
-
* Visual indicator component for individual wizard steps with status-dependent styling and animations.
|
|
540
|
-
*
|
|
541
|
-
* @remarks
|
|
542
|
-
* Displays step progress through dynamic border and background colors. Supports three states:
|
|
543
|
-
* - Completed (checkmark icon)
|
|
544
|
-
* - In progress (highlighted border)
|
|
545
|
-
* - Pending (dimmed appearance)
|
|
546
|
-
*
|
|
547
|
-
* Uses Angular signals for optimized change detection and smooth transitions.
|
|
548
|
-
*
|
|
549
|
-
* @example
|
|
550
|
-
* ```html
|
|
551
|
-
* <!-- Completed step with custom icon -->
|
|
552
|
-
* <st-wizard-step
|
|
553
|
-
* [stepIndex]="1"
|
|
554
|
-
* [status]="'completed'"
|
|
555
|
-
* icon="user-profile"
|
|
556
|
-
* ></st-wizard-step>
|
|
557
|
-
*
|
|
558
|
-
* <!-- Current active step -->
|
|
559
|
-
* <st-wizard-step
|
|
560
|
-
* [stepIndex]="2"
|
|
561
|
-
* [status]="'in progress'"
|
|
562
|
-
* ></st-wizard-step>
|
|
563
|
-
* ```
|
|
564
|
-
*/
|
|
565
|
-
class WizardStepComponent {
|
|
566
|
-
/** @internal Injected wizard state service */
|
|
567
|
-
wizardService = inject(WizardService);
|
|
568
|
-
/**
|
|
569
|
-
* Optional custom icon name for completed state
|
|
570
|
-
* @default undefined (uses checkmark)
|
|
571
|
-
*/
|
|
572
|
-
icon = input();
|
|
573
|
-
/**
|
|
574
|
-
* Current progress status of the step
|
|
575
|
-
* @remarks Determines visual state and transitions
|
|
576
|
-
*/
|
|
577
|
-
status = input.required();
|
|
578
|
-
/**
|
|
579
|
-
* Position in wizard sequence (0-based index)
|
|
580
|
-
* @remarks Used for current step comparison
|
|
581
|
-
*/
|
|
582
|
-
stepIndex = input.required();
|
|
583
|
-
/** @internal Predefined checkmark icon */
|
|
584
|
-
iconCheck = matCheckOutline;
|
|
585
|
-
/**
|
|
586
|
-
* Computed CSS classes for step containers
|
|
587
|
-
* @returns {Object} Classes for outer/inner elements
|
|
588
|
-
* @remarks Applies:
|
|
589
|
-
* - 300ms color transitions
|
|
590
|
-
* - 300ms delay for pending states
|
|
591
|
-
* - Primary colors for active/completed states
|
|
592
|
-
* @internal
|
|
593
|
-
*/
|
|
594
|
-
stepClasses = computed(() => {
|
|
595
|
-
const baseOuterClasses = 'flex h-[50px] min-h-[50px] w-[50px] min-w-[50px] items-center justify-center rounded-full border border-solid p-[2px] font-medium text-neutral-content';
|
|
596
|
-
const baseInnerClasses = 'flex h-full w-full items-center justify-center rounded-full';
|
|
597
|
-
const currentStatus = this.status();
|
|
598
|
-
const isCompleted = currentStatus === 'completed';
|
|
599
|
-
const isInProgress = currentStatus === 'in progress';
|
|
600
|
-
const isPending = currentStatus === 'pending';
|
|
601
|
-
const isError = currentStatus === 'error';
|
|
602
|
-
const outerClasses = cn(baseOuterClasses, {
|
|
603
|
-
'border-primary currentStep transition-colors duration-300 ease-out': isInProgress,
|
|
604
|
-
'border-success notCurrentStep transition-colors duration-300 ease-out': isCompleted,
|
|
605
|
-
'border-error notCurrentStep transition-colors duration-300 ease-out': isError,
|
|
606
|
-
'border-base-300 notCurrentStep transition-colors delay-300 duration-300 ease-out': isPending,
|
|
607
|
-
});
|
|
608
|
-
const innerClasses = cn(baseInnerClasses, {
|
|
609
|
-
'bg-primary text-primary-content currentStep transition-colors duration-300 ease-out': isInProgress,
|
|
610
|
-
'bg-success text-success-content notCurrentStep transition-colors duration-300 ease-out': isCompleted,
|
|
611
|
-
'bg-error text-error-content notCurrentStep transition-colors duration-300 ease-out': isError,
|
|
612
|
-
'bg-base-200 text-base-content notCurrentStep transition-colors delay-300 duration-300 ease-out': isPending,
|
|
613
|
-
});
|
|
614
|
-
return { outerClasses, innerClasses };
|
|
615
|
-
});
|
|
616
|
-
/**
|
|
617
|
-
* Step number visibility classes
|
|
618
|
-
* @returns {string} Tailwind classes with fade animation
|
|
619
|
-
* @remarks
|
|
620
|
-
* - Hidden when completed
|
|
621
|
-
* - 350ms fade-in delay for smooth transitions
|
|
622
|
-
* @internal
|
|
623
|
-
*/
|
|
624
|
-
stepNumberClasses = computed(() => {
|
|
625
|
-
const isCompleted = this.status() === 'completed';
|
|
626
|
-
return cn('col-start-1 row-start-1 grid place-items-center leading-none', {
|
|
627
|
-
'invisible opacity-0': isCompleted,
|
|
628
|
-
'animate-fade-in animate-duration-300 opacity-100 delay-350': !isCompleted,
|
|
629
|
-
});
|
|
630
|
-
});
|
|
631
|
-
/**
|
|
632
|
-
* Completion icon visibility classes
|
|
633
|
-
* @returns {string} Tailwind classes with fade animation
|
|
634
|
-
* @remarks
|
|
635
|
-
* - Only visible when completed
|
|
636
|
-
* - 350ms fade-in delay for smooth transition
|
|
637
|
-
* @internal
|
|
638
|
-
*/
|
|
639
|
-
stepIconClasses = computed(() => {
|
|
640
|
-
const isCompleted = this.status() === 'completed';
|
|
641
|
-
return cn('col-start-1 row-start-1 grid place-items-center leading-none', {
|
|
642
|
-
'animate-fade-in animate-duration-300 opacity-100 delay-350': isCompleted,
|
|
643
|
-
'invisible opacity-0': !isCompleted,
|
|
644
|
-
});
|
|
645
|
-
});
|
|
646
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: WizardStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
647
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: WizardStepComponent, isStandalone: true, selector: "st-wizard-step", inputs: { icon: { classPropertyName: "icon", publicName: "icon", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: true, transformFunction: null }, stepIndex: { classPropertyName: "stepIndex", publicName: "stepIndex", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"stepClasses().outerClasses\">\n\t<div [class]=\"stepClasses().innerClasses\">\n\t\t<div class=\"wizard-step-overlay grid h-full w-full place-items-center\">\n\t\t\t<div [class]=\"stepNumberClasses()\">\n\t\t\t\t@let iconVar = icon();\n\t\t\t\t@if (iconVar) {\n\t\t\t\t\t<st-icon [icon]=\"iconVar\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t\t\t} @else {\n\t\t\t\t\t<span stText=\"7\" stTextColor=\"inherit\" stTextWeight=\"semibold\">\n\t\t\t\t\t\t{{ stepIndex() + 1 }}\n\t\t\t\t\t</span>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<div [class]=\"stepIconClasses()\">\n\t\t\t\t<st-icon [icon]=\"iconCheck\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n", dependencies: [{ kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
648
|
-
}
|
|
649
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: WizardStepComponent, decorators: [{
|
|
650
|
-
type: Component,
|
|
651
|
-
args: [{ selector: 'st-wizard-step', imports: [TextDirective, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"stepClasses().outerClasses\">\n\t<div [class]=\"stepClasses().innerClasses\">\n\t\t<div class=\"wizard-step-overlay grid h-full w-full place-items-center\">\n\t\t\t<div [class]=\"stepNumberClasses()\">\n\t\t\t\t@let iconVar = icon();\n\t\t\t\t@if (iconVar) {\n\t\t\t\t\t<st-icon [icon]=\"iconVar\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t\t\t} @else {\n\t\t\t\t\t<span stText=\"7\" stTextColor=\"inherit\" stTextWeight=\"semibold\">\n\t\t\t\t\t\t{{ stepIndex() + 1 }}\n\t\t\t\t\t</span>\n\t\t\t\t}\n\t\t\t</div>\n\t\t\t<div [class]=\"stepIconClasses()\">\n\t\t\t\t<st-icon [icon]=\"iconCheck\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n" }]
|
|
652
|
-
}] });
|
|
653
|
-
|
|
654
|
-
/**
|
|
655
|
-
* A component that visualizes the connection between wizard steps with animated progress indicators.
|
|
656
|
-
*
|
|
657
|
-
* @remarks
|
|
658
|
-
* Handles both horizontal and vertical layouts with status-dependent animations. Manages three segments:
|
|
659
|
-
* - Left connector (before the step)
|
|
660
|
-
* - Center indicator (current step marker)
|
|
661
|
-
* - Right connector (after the step)
|
|
662
|
-
*
|
|
663
|
-
* @example
|
|
664
|
-
* ```html
|
|
665
|
-
* <!-- Horizontal sub-step -->
|
|
666
|
-
* <st-wizard-sub-step
|
|
667
|
-
* [stepIndex]="1"
|
|
668
|
-
* [stepStatus]="'completed'"
|
|
669
|
-
* ></st-wizard-sub-step>
|
|
670
|
-
*
|
|
671
|
-
* <!-- Vertical sub-step -->
|
|
672
|
-
* <st-wizard-sub-step
|
|
673
|
-
* variant="vertical"
|
|
674
|
-
* [stepIndex]="2"
|
|
675
|
-
* [stepStatus]="'in progress'"
|
|
676
|
-
* ></st-wizard-sub-step>
|
|
677
|
-
* ```
|
|
678
|
-
*/
|
|
679
|
-
class WizardSubStepComponent {
|
|
680
|
-
/**
|
|
681
|
-
* Layout direction for the sub-step connectors
|
|
682
|
-
* @default 'horizontal'
|
|
683
|
-
*/
|
|
684
|
-
variant = input('horizontal');
|
|
685
|
-
/** @internal Injected wizard state service */
|
|
686
|
-
wizardService = inject(WizardService);
|
|
687
|
-
/**
|
|
688
|
-
* Index of the parent step in the wizard sequence
|
|
689
|
-
* @remarks Required for position calculation
|
|
690
|
-
*/
|
|
691
|
-
stepIndex = input.required();
|
|
692
|
-
/**
|
|
693
|
-
* Current status of the associated wizard step
|
|
694
|
-
* @remarks Determines visual state and animations
|
|
695
|
-
*/
|
|
696
|
-
stepStatus = input.required();
|
|
697
|
-
/**
|
|
698
|
-
* Checks if this sub-step's index matches the current active step
|
|
699
|
-
* @returns {boolean} True if this is the active step
|
|
700
|
-
* @internal
|
|
701
|
-
*/
|
|
702
|
-
isCurrentStep = computed(() => this.wizardService.currentStepIndex() === this.stepIndex());
|
|
703
|
-
/**
|
|
704
|
-
* Computed classes for horizontal left connector segment
|
|
705
|
-
* @returns {string} Tailwind classes with animated width transition
|
|
706
|
-
* @internal
|
|
707
|
-
*/
|
|
708
|
-
horizontalLeftClasses = computed(() => {
|
|
709
|
-
const isCompleted = this.stepStatus() === 'completed';
|
|
710
|
-
const isInProgress = this.stepStatus() === 'in progress';
|
|
711
|
-
const isError = this.stepStatus() === 'error';
|
|
712
|
-
const afterWidthClass = isCompleted || isError || (this.isCurrentStep() && isInProgress) ? 'after:w-full' : 'after:w-0';
|
|
713
|
-
return cn('bg-secondary relative h-[2px] w-full', 'after:absolute after:bottom-0 after:left-0 after:h-[2px]', isCompleted ? 'after:bg-success' : isError ? 'after:bg-error' : 'after:bg-primary', 'after:transition-[width] after:duration-300 after:ease-out', afterWidthClass);
|
|
714
|
-
});
|
|
715
|
-
/**
|
|
716
|
-
* Computed classes for horizontal center indicator
|
|
717
|
-
* @returns {string} Tailwind classes with color transition delays
|
|
718
|
-
* @internal
|
|
719
|
-
*/
|
|
720
|
-
horizontalCenterClasses = computed(() => {
|
|
721
|
-
const isCompleted = this.stepStatus() === 'completed';
|
|
722
|
-
const isInProgress = this.stepStatus() === 'in progress';
|
|
723
|
-
const isError = this.stepStatus() === 'error';
|
|
724
|
-
const isPrimaryBg = (this.isCurrentStep() && isInProgress) || (!this.isCurrentStep() && isCompleted);
|
|
725
|
-
return cn('h-3 min-h-3 w-3 min-w-3 rounded-full', 'transition-colors duration-300 ease-out', isCompleted ? 'bg-success' : isError ? 'bg-error' : isPrimaryBg ? 'bg-primary' : 'bg-secondary', isPrimaryBg && !this.isCurrentStep() ? '' : 'delay-300');
|
|
726
|
-
});
|
|
727
|
-
/**
|
|
728
|
-
* Computed classes for horizontal right connector segment
|
|
729
|
-
* @returns {string} Tailwind classes with completion-based width
|
|
730
|
-
* @internal
|
|
731
|
-
*/
|
|
732
|
-
horizontalRightClasses = computed(() => {
|
|
733
|
-
const isCompleted = this.stepStatus() === 'completed';
|
|
734
|
-
const isError = this.stepStatus() === 'error';
|
|
735
|
-
const afterWidthClass = isCompleted || isError ? 'after:w-full' : 'after:w-0';
|
|
736
|
-
return cn('bg-secondary relative h-[2px] w-full', 'after:absolute after:bottom-0 after:left-0 after:h-[2px]', isCompleted ? 'after:bg-success' : isError ? 'after:bg-error' : 'after:bg-primary', 'after:transition-[width] after:duration-300 after:ease-out', afterWidthClass);
|
|
737
|
-
});
|
|
738
|
-
/**
|
|
739
|
-
* Computed classes for vertical left connector segment
|
|
740
|
-
* @returns {string} Tailwind classes with animated height transition
|
|
741
|
-
* @internal
|
|
742
|
-
*/
|
|
743
|
-
verticalLeftClasses = computed(() => {
|
|
744
|
-
const isCompleted = this.stepStatus() === 'completed';
|
|
745
|
-
const isInProgress = this.stepStatus() === 'in progress';
|
|
746
|
-
const isError = this.stepStatus() === 'error';
|
|
747
|
-
const afterHeightClass = isCompleted || isError || (this.isCurrentStep() && isInProgress) ? 'after:h-full' : 'after:h-0';
|
|
748
|
-
return cn('bg-secondary relative h-full w-[2px] rotate-180', 'after:absolute after:bottom-0 after:left-0 after:w-[2px]', isCompleted ? 'after:bg-success' : isError ? 'after:bg-error' : 'after:bg-primary', 'after:transition-[height] after:duration-300 after:ease-out', afterHeightClass);
|
|
749
|
-
});
|
|
750
|
-
/**
|
|
751
|
-
* Computed classes for vertical center indicator
|
|
752
|
-
* @returns {string} Tailwind classes with color transition logic
|
|
753
|
-
* @internal
|
|
754
|
-
*/
|
|
755
|
-
verticalCenterClasses = computed(() => {
|
|
756
|
-
const isCompleted = this.stepStatus() === 'completed';
|
|
757
|
-
const isInProgress = this.stepStatus() === 'in progress';
|
|
758
|
-
const isError = this.stepStatus() === 'error';
|
|
759
|
-
const isPrimaryBg = (this.isCurrentStep() && isInProgress) || (!this.isCurrentStep() && isCompleted);
|
|
760
|
-
return cn('h-3 min-h-3 w-3 min-w-3 rounded-full', 'transition-colors duration-300 ease-out', isCompleted ? 'bg-success' : isError ? 'bg-error' : isPrimaryBg ? 'bg-primary' : 'bg-secondary', isPrimaryBg && !this.isCurrentStep() ? '' : 'delay-300');
|
|
761
|
-
});
|
|
762
509
|
/**
|
|
763
|
-
*
|
|
764
|
-
* @returns {string} Tailwind classes with completion-based height
|
|
510
|
+
* Whether a checklist row is a button that goes back to its step
|
|
765
511
|
* @internal
|
|
766
512
|
*/
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
return cn('bg-secondary relative h-full w-[2px] rotate-180', 'after:absolute after:bottom-0 after:left-0 after:w-[2px]', isCompleted ? 'after:bg-success' : isError ? 'after:bg-error' : 'after:bg-primary', 'after:transition-[height] after:duration-300 after:ease-out', afterHeightClass);
|
|
772
|
-
});
|
|
773
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: WizardSubStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
774
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: WizardSubStepComponent, isStandalone: true, selector: "st-wizard-sub-step", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, stepIndex: { classPropertyName: "stepIndex", publicName: "stepIndex", isSignal: true, isRequired: true, transformFunction: null }, stepStatus: { classPropertyName: "stepStatus", publicName: "stepStatus", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@if (variant() === 'horizontal') {\n\t<div class=\"wizard-sub-step-horizontal flex w-full min-w-full -translate-y-[25px] items-center\">\n\t\t<div [class]=\"horizontalLeftClasses()\"></div>\n\t\t<div [class]=\"horizontalCenterClasses()\"></div>\n\t\t<div [class]=\"horizontalRightClasses()\"></div>\n\t</div>\n} @else {\n\t<div class=\"wizard-sub-step-vertical flex h-20 min-h-20 w-fit translate-x-[25px] flex-col items-center\">\n\t\t<div [class]=\"verticalLeftClasses()\"></div>\n\t\t<div [class]=\"verticalCenterClasses()\"></div>\n\t\t<div [class]=\"verticalRightClasses()\"></div>\n\t</div>\n}\n" });
|
|
513
|
+
isSelectable(index, status) {
|
|
514
|
+
return this.canGoBack() && status === 'completed' && index < this.current();
|
|
515
|
+
}
|
|
516
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: WizardIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
517
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: WizardIndicatorComponent, isStandalone: true, selector: "st-wizard-indicator", inputs: { indicator: { classPropertyName: "indicator", publicName: "indicator", isSignal: true, isRequired: true, transformFunction: null }, canGoBack: { classPropertyName: "canGoBack", publicName: "canGoBack", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { stepSelect: "stepSelect" }, ngImport: i0, template: "@let stepsVar = wizardService.steps();\n@let currentVar = current();\n@let countVar = count();\n\n<!-- Check that draws itself; replayed whenever its parent is recreated -->\n<ng-template #checkIcon let-size>\n\t<svg\n\t\t[class]=\"size\"\n\t\tviewBox=\"0 0 16 16\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstroke-width=\"2.4\"\n\t\tstroke-linecap=\"round\"\n\t\tstroke-linejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t>\n\t\t<path class=\"wizard-check-path animate-wizard-check motion-reduce:animate-none\" pathLength=\"1\" d=\"M3.5 8.5l3 3 6-7\" />\n\t</svg>\n</ng-template>\n\n@switch (indicator()) {\n\t@case ('checklist') {\n\t\t@let stepParts = splitAtIndex('sdk.wizard.wizardWrapper.stepOf' | translate: { index: indexMark, total: countVar });\n\t\t<div class=\"flex flex-col gap-3\" data-indicator=\"checklist\">\n\t\t\t<div class=\"flex items-baseline justify-between gap-3\">\n\t\t\t\t<span class=\"relative min-w-0 overflow-hidden\">\n\t\t\t\t\t@for (label of [currentLabel()]; track label) {\n\t\t\t\t\t\t<span stText=\"7\" stTextColor=\"base\" stTextWeight=\"bold\" class=\"animate-wizard-rise block motion-reduce:animate-none\">{{ label }}</span>\n\t\t\t\t\t}\n\t\t\t\t</span>\n\t\t\t\t<span stText=\"10\" stTextColor=\"base-secondary\" stTextWeight=\"medium\" class=\"shrink-0 whitespace-nowrap tabular-nums\" data-step-count\n\t\t\t\t\t>{{ stepParts[0]\n\t\t\t\t\t}}<span class=\"inline-flex overflow-hidden align-bottom\">\n\t\t\t\t\t\t@for (n of [currentVar + 1]; track n) {\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"inline-block motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t[class.animate-wizard-roll]=\"direction() === 'forward'\"\n\t\t\t\t\t\t\t\t[class.animate-wizard-roll-back]=\"direction() === 'back'\"\n\t\t\t\t\t\t\t\t>{{ n }}</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t}</span\n\t\t\t\t\t>{{ stepParts[1] }}</span\n\t\t\t\t>\n\t\t\t</div>\n\t\t\t<span class=\"bg-base-300 rounded-selector block h-1.5 overflow-hidden\" aria-hidden=\"true\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"bg-primary rounded-selector ease-out-back block h-full transition-[width] duration-450 motion-reduce:transition-none\"\n\t\t\t\t\tdata-progress\n\t\t\t\t\t[style.width.%]=\"progress()\"\n\t\t\t\t></span>\n\t\t\t</span>\n\t\t\t<ol class=\"flex flex-col gap-1\">\n\t\t\t\t@for (step of stepsVar; track $index; let i = $index) {\n\t\t\t\t\t@let isCurrent = $index === currentVar;\n\t\t\t\t\t<li [attr.aria-current]=\"isCurrent ? 'step' : null\">\n\t\t\t\t\t\t@if (isSelectable($index, step.status)) {\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tclass=\"rounded-field hover:bg-primary-soft focus-visible:outline-primary flex min-h-9 w-full cursor-pointer items-center gap-3 px-2 py-2 text-start transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 motion-reduce:transition-none\"\n\t\t\t\t\t\t\t\t(click)=\"stepSelect.emit($index)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"checklistRow; context: { $implicit: step, current: isCurrent }\"></ng-container>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass=\"rounded-field flex min-h-9 items-center gap-3 px-2 py-2 transition-colors duration-200 motion-reduce:transition-none\"\n\t\t\t\t\t\t\t\t[class.bg-primary-soft]=\"isCurrent\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"checklistRow; context: { $implicit: step, current: isCurrent }\"></ng-container>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ol>\n\t\t</div>\n\t}\n\n\t@case ('segments') {\n\t\t@let currentStepVar = stepsVar[currentVar];\n\t\t<div class=\"flex flex-col gap-2\" data-indicator=\"segments\">\n\t\t\t<ol class=\"grid gap-2\" [style.grid-template-columns]=\"segmentColumns()\">\n\t\t\t\t@for (step of stepsVar; track $index; let i = $index) {\n\t\t\t\t\t@let isCurrent = $index === currentVar;\n\t\t\t\t\t<li class=\"flex min-w-0 flex-col gap-2\" [attr.aria-current]=\"isCurrent ? 'step' : null\">\n\t\t\t\t\t\t<span class=\"bg-base-300 rounded-selector relative block h-1 overflow-hidden\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"rounded-selector relative block h-full overflow-hidden transition-[width,background-color] duration-400 ease-out motion-reduce:transition-none\"\n\t\t\t\t\t\t\t\tdata-segment-fill\n\t\t\t\t\t\t\t\t[class.bg-success]=\"step.status === 'completed'\"\n\t\t\t\t\t\t\t\t[class.bg-primary]=\"step.status === 'in progress'\"\n\t\t\t\t\t\t\t\t[class.bg-error]=\"step.status === 'error'\"\n\t\t\t\t\t\t\t\t[style.width.%]=\"segmentFill(step.status)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t@if (step.status === 'in progress') {\n\t\t\t\t\t\t\t\t\t<span class=\"wizard-sweep-highlight animate-wizard-sweep absolute inset-0 motion-reduce:hidden\"></span>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"flex min-w-0 flex-col max-[400px]:sr-only\" data-segment-label>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tstText=\"10\"\n\t\t\t\t\t\t\t\tstTextColor=\"base-secondary\"\n\t\t\t\t\t\t\t\t[stTextWeight]=\"isCurrent ? 'bold' : 'medium'\"\n\t\t\t\t\t\t\t\tclass=\"tracking-wide uppercase tabular-nums\"\n\t\t\t\t\t\t\t\t>{{ 'sdk.wizard.wizardWrapper.step' | translate: { index: $index + 1 } }}</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t@for (s of [step.status]; track s) {\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tstText=\"9\"\n\t\t\t\t\t\t\t\t\t[stTextColor]=\"step.status === 'pending' ? 'base-secondary' : 'base'\"\n\t\t\t\t\t\t\t\t\t[stTextWeight]=\"isCurrent ? 'semibold' : 'medium'\"\n\t\t\t\t\t\t\t\t\tclass=\"wrap-anywhere motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\t[class.animate-wizard-rise]=\"isCurrent\"\n\t\t\t\t\t\t\t\t\t>{{ step.label }}</span\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t<span class=\"sr-only\">{{ stateKey(step.status) | translate }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ol>\n\t\t\t<!-- Below 400px only the current step's label shows -->\n\t\t\t<div class=\"hidden min-w-0 flex-col max-[400px]:flex\" aria-hidden=\"true\" data-segment-current>\n\t\t\t\t<span stText=\"10\" stTextColor=\"base-secondary\" stTextWeight=\"bold\" class=\"tracking-wide uppercase tabular-nums\">{{\n\t\t\t\t\t'sdk.wizard.wizardWrapper.stepOf' | translate: { index: currentVar + 1, total: countVar }\n\t\t\t\t}}</span>\n\t\t\t\t@for (label of [currentStepVar?.label]; track label) {\n\t\t\t\t\t<span stText=\"9\" stTextColor=\"base\" stTextWeight=\"semibold\" class=\"animate-wizard-rise wrap-anywhere motion-reduce:animate-none\">{{\n\t\t\t\t\t\tlabel\n\t\t\t\t\t}}</span>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t}\n\n\t@default {\n\t\t<div class=\"relative\" data-indicator=\"rail\">\n\t\t\t<!-- Shared highlight: slides between rows instead of fading in place -->\n\t\t\t<span\n\t\t\t\tclass=\"bg-primary-soft rounded-field ease-out-back pointer-events-none absolute inset-x-0 top-0 transition-transform duration-400 motion-reduce:transition-none\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tdata-rail-highlight\n\t\t\t\t[style.height]=\"railRowHeight()\"\n\t\t\t\t[style.transform]=\"railHighlightTransform()\"\n\t\t\t></span>\n\t\t\t<!-- One continuous track on the circle centres (row padding 8px + half the 32px column = 24px) -->\n\t\t\t<span\n\t\t\t\tclass=\"bg-base-content-muted rounded-selector pointer-events-none absolute left-[23px] w-0.5\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tdata-rail-track\n\t\t\t\t[style.top]=\"railTrackInset()\"\n\t\t\t\t[style.bottom]=\"railTrackInset()\"\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"bg-success rounded-selector absolute inset-x-0 top-0 block transition-[height] duration-450 ease-out motion-reduce:transition-none\"\n\t\t\t\t\tdata-rail-fill\n\t\t\t\t\t[style.height.%]=\"progress()\"\n\t\t\t\t></span>\n\t\t\t</span>\n\t\t\t<ol class=\"relative grid auto-rows-fr gap-1\">\n\t\t\t\t@for (step of stepsVar; track $index; let i = $index) {\n\t\t\t\t\t<li\n\t\t\t\t\t\tclass=\"relative grid grid-cols-[2rem_minmax(0,1fr)] items-center gap-3 px-2 py-2\"\n\t\t\t\t\t\t[attr.aria-current]=\"$index === currentVar ? 'step' : null\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"grid size-8 place-items-center\" data-rail-circle>\n\t\t\t\t\t\t\t@for (s of [step.status]; track s) {\n\t\t\t\t\t\t\t\t@switch (s) {\n\t\t\t\t\t\t\t\t\t@case ('completed') {\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"bg-success border-success text-success-content animate-wizard-pop grid size-7 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"checkIcon; context: { $implicit: 'size-3.5' }\"></ng-container>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@case ('in progress') {\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"border-primary text-primary bg-base-100 animate-wizard-ring relative grid size-7 scale-108 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"animate-wizard-halo absolute -inset-0.5 rounded-full motion-reduce:hidden\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"stepMark; context: { $implicit: step, index: i }\"></ng-container>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@case ('error') {\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"bg-error border-error text-error-content animate-wizard-pop grid size-7 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"stepMark; context: { $implicit: step, index: i }\"></ng-container>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@default {\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"border-base-content-muted bg-base-100 text-base-content-secondary grid size-7 place-items-center rounded-full border-2\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"stepMark; context: { $implicit: step, index: i }\"></ng-container>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"flex min-w-0 flex-col\">\n\t\t\t\t\t\t\t<span stText=\"8\" stTextColor=\"base\" [stTextWeight]=\"$index === currentVar ? 'bold' : 'semibold'\" class=\"wrap-anywhere\">{{\n\t\t\t\t\t\t\t\tstep.label\n\t\t\t\t\t\t\t}}</span>\n\t\t\t\t\t\t\t@for (s of [step.status]; track s) {\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tstText=\"10\"\n\t\t\t\t\t\t\t\t\tstTextColor=\"base-secondary\"\n\t\t\t\t\t\t\t\t\tstTextWeight=\"medium\"\n\t\t\t\t\t\t\t\t\tclass=\"animate-wizard-rise motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\tdata-state-line\n\t\t\t\t\t\t\t\t\t>{{ stateKey(s) | translate }}</span\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ol>\n\t\t</div>\n\t}\n}\n\n<!-- Step number, or the step icon when one is set -->\n<ng-template #stepMark let-step let-index=\"index\">\n\t@if (step.icon) {\n\t\t<st-icon [icon]=\"step.icon\" color=\"inherit\" size=\"auto\"></st-icon>\n\t} @else {\n\t\t<span stText=\"10\" stTextColor=\"inherit\" stTextWeight=\"bold\" class=\"tabular-nums\">{{ index + 1 }}</span>\n\t}\n</ng-template>\n\n<!-- Checklist row content -->\n<ng-template #checklistRow let-step let-isCurrent=\"current\">\n\t<span class=\"grid size-5 shrink-0 place-items-center\" aria-hidden=\"true\">\n\t\t@for (s of [step.status]; track s) {\n\t\t\t@switch (s) {\n\t\t\t\t@case ('completed') {\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"bg-success border-success text-success-content animate-wizard-pop grid size-4.5 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"checkIcon; context: { $implicit: 'size-3' }\"></ng-container>\n\t\t\t\t\t</span>\n\t\t\t\t}\n\t\t\t\t@case ('in progress') {\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"border-primary bg-base-100 animate-wizard-ring relative grid size-4.5 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"animate-wizard-halo absolute -inset-0.5 rounded-full motion-reduce:hidden\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t}\n\t\t\t\t@case ('error') {\n\t\t\t\t\t<span class=\"bg-error border-error animate-wizard-pop grid size-4.5 rounded-full border-2 motion-reduce:animate-none\"></span>\n\t\t\t\t}\n\t\t\t\t@default {\n\t\t\t\t\t<span class=\"border-base-300 bg-base-100 grid size-4.5 rounded-full border-2\"></span>\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t</span>\n\t<span\n\t\tstText=\"9\"\n\t\t[stTextColor]=\"step.status === 'pending' && !isCurrent ? 'base-secondary' : 'base'\"\n\t\t[stTextWeight]=\"isCurrent ? 'bold' : 'medium'\"\n\t\tclass=\"min-w-0 flex-1 wrap-anywhere\"\n\t\t>{{ step.label }}<span class=\"sr-only\">, {{ stateKey(step.status) | translate }}</span></span\n\t>\n\t@if (step.meta) {\n\t\t<span class=\"sr-only\">, </span>\n\t\t<span stText=\"10\" stTextColor=\"base-secondary\" class=\"shrink-0 tabular-nums\" data-step-meta>{{ step.meta }}</span>\n\t}\n</ng-template>\n", dependencies: [{ kind: "directive", type: NgTemplateOutlet, selector: "[ngTemplateOutlet]", inputs: ["ngTemplateOutletContext", "ngTemplateOutlet", "ngTemplateOutletInjector"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "directive", type: TextDirective, selector: "[stText]", inputs: ["stText", "stTextWeight", "stTextColor", "stTextOverflow", "stTextLineClamp", "stTextClass"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
775
518
|
}
|
|
776
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type:
|
|
519
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: WizardIndicatorComponent, decorators: [{
|
|
777
520
|
type: Component,
|
|
778
|
-
args: [{ selector: 'st-wizard-sub-step', imports: [], template: "@if (variant() === 'horizontal') {\n\t<div class=\"wizard-sub-step-horizontal flex w-full min-w-full -translate-y-[25px] items-center\">\n\t\t<div [class]=\"horizontalLeftClasses()\"></div>\n\t\t<div [class]=\"horizontalCenterClasses()\"></div>\n\t\t<div [class]=\"horizontalRightClasses()\"></div>\n\t</div>\n} @else {\n\t<div class=\"wizard-sub-step-vertical flex h-20 min-h-20 w-fit translate-x-[25px] flex-col items-center\">\n\t\t<div [class]=\"verticalLeftClasses()\"></div>\n\t\t<div [class]=\"verticalCenterClasses()\"></div>\n\t\t<div [class]=\"verticalRightClasses()\"></div>\n\t</div>\n}\n" }]
|
|
521
|
+
args: [{ selector: 'st-wizard-indicator', imports: [NgTemplateOutlet, TranslatePipe, TextDirective, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let stepsVar = wizardService.steps();\n@let currentVar = current();\n@let countVar = count();\n\n<!-- Check that draws itself; replayed whenever its parent is recreated -->\n<ng-template #checkIcon let-size>\n\t<svg\n\t\t[class]=\"size\"\n\t\tviewBox=\"0 0 16 16\"\n\t\tfill=\"none\"\n\t\tstroke=\"currentColor\"\n\t\tstroke-width=\"2.4\"\n\t\tstroke-linecap=\"round\"\n\t\tstroke-linejoin=\"round\"\n\t\taria-hidden=\"true\"\n\t\tfocusable=\"false\"\n\t>\n\t\t<path class=\"wizard-check-path animate-wizard-check motion-reduce:animate-none\" pathLength=\"1\" d=\"M3.5 8.5l3 3 6-7\" />\n\t</svg>\n</ng-template>\n\n@switch (indicator()) {\n\t@case ('checklist') {\n\t\t@let stepParts = splitAtIndex('sdk.wizard.wizardWrapper.stepOf' | translate: { index: indexMark, total: countVar });\n\t\t<div class=\"flex flex-col gap-3\" data-indicator=\"checklist\">\n\t\t\t<div class=\"flex items-baseline justify-between gap-3\">\n\t\t\t\t<span class=\"relative min-w-0 overflow-hidden\">\n\t\t\t\t\t@for (label of [currentLabel()]; track label) {\n\t\t\t\t\t\t<span stText=\"7\" stTextColor=\"base\" stTextWeight=\"bold\" class=\"animate-wizard-rise block motion-reduce:animate-none\">{{ label }}</span>\n\t\t\t\t\t}\n\t\t\t\t</span>\n\t\t\t\t<span stText=\"10\" stTextColor=\"base-secondary\" stTextWeight=\"medium\" class=\"shrink-0 whitespace-nowrap tabular-nums\" data-step-count\n\t\t\t\t\t>{{ stepParts[0]\n\t\t\t\t\t}}<span class=\"inline-flex overflow-hidden align-bottom\">\n\t\t\t\t\t\t@for (n of [currentVar + 1]; track n) {\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"inline-block motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t[class.animate-wizard-roll]=\"direction() === 'forward'\"\n\t\t\t\t\t\t\t\t[class.animate-wizard-roll-back]=\"direction() === 'back'\"\n\t\t\t\t\t\t\t\t>{{ n }}</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t}</span\n\t\t\t\t\t>{{ stepParts[1] }}</span\n\t\t\t\t>\n\t\t\t</div>\n\t\t\t<span class=\"bg-base-300 rounded-selector block h-1.5 overflow-hidden\" aria-hidden=\"true\">\n\t\t\t\t<span\n\t\t\t\t\tclass=\"bg-primary rounded-selector ease-out-back block h-full transition-[width] duration-450 motion-reduce:transition-none\"\n\t\t\t\t\tdata-progress\n\t\t\t\t\t[style.width.%]=\"progress()\"\n\t\t\t\t></span>\n\t\t\t</span>\n\t\t\t<ol class=\"flex flex-col gap-1\">\n\t\t\t\t@for (step of stepsVar; track $index; let i = $index) {\n\t\t\t\t\t@let isCurrent = $index === currentVar;\n\t\t\t\t\t<li [attr.aria-current]=\"isCurrent ? 'step' : null\">\n\t\t\t\t\t\t@if (isSelectable($index, step.status)) {\n\t\t\t\t\t\t\t<button\n\t\t\t\t\t\t\t\ttype=\"button\"\n\t\t\t\t\t\t\t\tclass=\"rounded-field hover:bg-primary-soft focus-visible:outline-primary flex min-h-9 w-full cursor-pointer items-center gap-3 px-2 py-2 text-start transition-colors duration-200 focus-visible:outline-2 focus-visible:outline-offset-2 motion-reduce:transition-none\"\n\t\t\t\t\t\t\t\t(click)=\"stepSelect.emit($index)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"checklistRow; context: { $implicit: step, current: isCurrent }\"></ng-container>\n\t\t\t\t\t\t\t</button>\n\t\t\t\t\t\t} @else {\n\t\t\t\t\t\t\t<div\n\t\t\t\t\t\t\t\tclass=\"rounded-field flex min-h-9 items-center gap-3 px-2 py-2 transition-colors duration-200 motion-reduce:transition-none\"\n\t\t\t\t\t\t\t\t[class.bg-primary-soft]=\"isCurrent\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"checklistRow; context: { $implicit: step, current: isCurrent }\"></ng-container>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ol>\n\t\t</div>\n\t}\n\n\t@case ('segments') {\n\t\t@let currentStepVar = stepsVar[currentVar];\n\t\t<div class=\"flex flex-col gap-2\" data-indicator=\"segments\">\n\t\t\t<ol class=\"grid gap-2\" [style.grid-template-columns]=\"segmentColumns()\">\n\t\t\t\t@for (step of stepsVar; track $index; let i = $index) {\n\t\t\t\t\t@let isCurrent = $index === currentVar;\n\t\t\t\t\t<li class=\"flex min-w-0 flex-col gap-2\" [attr.aria-current]=\"isCurrent ? 'step' : null\">\n\t\t\t\t\t\t<span class=\"bg-base-300 rounded-selector relative block h-1 overflow-hidden\" aria-hidden=\"true\">\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tclass=\"rounded-selector relative block h-full overflow-hidden transition-[width,background-color] duration-400 ease-out motion-reduce:transition-none\"\n\t\t\t\t\t\t\t\tdata-segment-fill\n\t\t\t\t\t\t\t\t[class.bg-success]=\"step.status === 'completed'\"\n\t\t\t\t\t\t\t\t[class.bg-primary]=\"step.status === 'in progress'\"\n\t\t\t\t\t\t\t\t[class.bg-error]=\"step.status === 'error'\"\n\t\t\t\t\t\t\t\t[style.width.%]=\"segmentFill(step.status)\"\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t@if (step.status === 'in progress') {\n\t\t\t\t\t\t\t\t\t<span class=\"wizard-sweep-highlight animate-wizard-sweep absolute inset-0 motion-reduce:hidden\"></span>\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"flex min-w-0 flex-col max-[400px]:sr-only\" data-segment-label>\n\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\tstText=\"10\"\n\t\t\t\t\t\t\t\tstTextColor=\"base-secondary\"\n\t\t\t\t\t\t\t\t[stTextWeight]=\"isCurrent ? 'bold' : 'medium'\"\n\t\t\t\t\t\t\t\tclass=\"tracking-wide uppercase tabular-nums\"\n\t\t\t\t\t\t\t\t>{{ 'sdk.wizard.wizardWrapper.step' | translate: { index: $index + 1 } }}</span\n\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t@for (s of [step.status]; track s) {\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tstText=\"9\"\n\t\t\t\t\t\t\t\t\t[stTextColor]=\"step.status === 'pending' ? 'base-secondary' : 'base'\"\n\t\t\t\t\t\t\t\t\t[stTextWeight]=\"isCurrent ? 'semibold' : 'medium'\"\n\t\t\t\t\t\t\t\t\tclass=\"wrap-anywhere motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\t[class.animate-wizard-rise]=\"isCurrent\"\n\t\t\t\t\t\t\t\t\t>{{ step.label }}</span\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t<span class=\"sr-only\">{{ stateKey(step.status) | translate }}</span>\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ol>\n\t\t\t<!-- Below 400px only the current step's label shows -->\n\t\t\t<div class=\"hidden min-w-0 flex-col max-[400px]:flex\" aria-hidden=\"true\" data-segment-current>\n\t\t\t\t<span stText=\"10\" stTextColor=\"base-secondary\" stTextWeight=\"bold\" class=\"tracking-wide uppercase tabular-nums\">{{\n\t\t\t\t\t'sdk.wizard.wizardWrapper.stepOf' | translate: { index: currentVar + 1, total: countVar }\n\t\t\t\t}}</span>\n\t\t\t\t@for (label of [currentStepVar?.label]; track label) {\n\t\t\t\t\t<span stText=\"9\" stTextColor=\"base\" stTextWeight=\"semibold\" class=\"animate-wizard-rise wrap-anywhere motion-reduce:animate-none\">{{\n\t\t\t\t\t\tlabel\n\t\t\t\t\t}}</span>\n\t\t\t\t}\n\t\t\t</div>\n\t\t</div>\n\t}\n\n\t@default {\n\t\t<div class=\"relative\" data-indicator=\"rail\">\n\t\t\t<!-- Shared highlight: slides between rows instead of fading in place -->\n\t\t\t<span\n\t\t\t\tclass=\"bg-primary-soft rounded-field ease-out-back pointer-events-none absolute inset-x-0 top-0 transition-transform duration-400 motion-reduce:transition-none\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tdata-rail-highlight\n\t\t\t\t[style.height]=\"railRowHeight()\"\n\t\t\t\t[style.transform]=\"railHighlightTransform()\"\n\t\t\t></span>\n\t\t\t<!-- One continuous track on the circle centres (row padding 8px + half the 32px column = 24px) -->\n\t\t\t<span\n\t\t\t\tclass=\"bg-base-content-muted rounded-selector pointer-events-none absolute left-[23px] w-0.5\"\n\t\t\t\taria-hidden=\"true\"\n\t\t\t\tdata-rail-track\n\t\t\t\t[style.top]=\"railTrackInset()\"\n\t\t\t\t[style.bottom]=\"railTrackInset()\"\n\t\t\t>\n\t\t\t\t<span\n\t\t\t\t\tclass=\"bg-success rounded-selector absolute inset-x-0 top-0 block transition-[height] duration-450 ease-out motion-reduce:transition-none\"\n\t\t\t\t\tdata-rail-fill\n\t\t\t\t\t[style.height.%]=\"progress()\"\n\t\t\t\t></span>\n\t\t\t</span>\n\t\t\t<ol class=\"relative grid auto-rows-fr gap-1\">\n\t\t\t\t@for (step of stepsVar; track $index; let i = $index) {\n\t\t\t\t\t<li\n\t\t\t\t\t\tclass=\"relative grid grid-cols-[2rem_minmax(0,1fr)] items-center gap-3 px-2 py-2\"\n\t\t\t\t\t\t[attr.aria-current]=\"$index === currentVar ? 'step' : null\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"grid size-8 place-items-center\" data-rail-circle>\n\t\t\t\t\t\t\t@for (s of [step.status]; track s) {\n\t\t\t\t\t\t\t\t@switch (s) {\n\t\t\t\t\t\t\t\t\t@case ('completed') {\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"bg-success border-success text-success-content animate-wizard-pop grid size-7 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"checkIcon; context: { $implicit: 'size-3.5' }\"></ng-container>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@case ('in progress') {\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"border-primary text-primary bg-base-100 animate-wizard-ring relative grid size-7 scale-108 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<span class=\"animate-wizard-halo absolute -inset-0.5 rounded-full motion-reduce:hidden\" aria-hidden=\"true\"></span>\n\t\t\t\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"stepMark; context: { $implicit: step, index: i }\"></ng-container>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@case ('error') {\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"bg-error border-error text-error-content animate-wizard-pop grid size-7 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"stepMark; context: { $implicit: step, index: i }\"></ng-container>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@default {\n\t\t\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\t\t\tclass=\"border-base-content-muted bg-base-100 text-base-content-secondary grid size-7 place-items-center rounded-full border-2\"\n\t\t\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"stepMark; context: { $implicit: step, index: i }\"></ng-container>\n\t\t\t\t\t\t\t\t\t\t</span>\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t\t<span class=\"flex min-w-0 flex-col\">\n\t\t\t\t\t\t\t<span stText=\"8\" stTextColor=\"base\" [stTextWeight]=\"$index === currentVar ? 'bold' : 'semibold'\" class=\"wrap-anywhere\">{{\n\t\t\t\t\t\t\t\tstep.label\n\t\t\t\t\t\t\t}}</span>\n\t\t\t\t\t\t\t@for (s of [step.status]; track s) {\n\t\t\t\t\t\t\t\t<span\n\t\t\t\t\t\t\t\t\tstText=\"10\"\n\t\t\t\t\t\t\t\t\tstTextColor=\"base-secondary\"\n\t\t\t\t\t\t\t\t\tstTextWeight=\"medium\"\n\t\t\t\t\t\t\t\t\tclass=\"animate-wizard-rise motion-reduce:animate-none\"\n\t\t\t\t\t\t\t\t\tdata-state-line\n\t\t\t\t\t\t\t\t\t>{{ stateKey(s) | translate }}</span\n\t\t\t\t\t\t\t\t>\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t</span>\n\t\t\t\t\t</li>\n\t\t\t\t}\n\t\t\t</ol>\n\t\t</div>\n\t}\n}\n\n<!-- Step number, or the step icon when one is set -->\n<ng-template #stepMark let-step let-index=\"index\">\n\t@if (step.icon) {\n\t\t<st-icon [icon]=\"step.icon\" color=\"inherit\" size=\"auto\"></st-icon>\n\t} @else {\n\t\t<span stText=\"10\" stTextColor=\"inherit\" stTextWeight=\"bold\" class=\"tabular-nums\">{{ index + 1 }}</span>\n\t}\n</ng-template>\n\n<!-- Checklist row content -->\n<ng-template #checklistRow let-step let-isCurrent=\"current\">\n\t<span class=\"grid size-5 shrink-0 place-items-center\" aria-hidden=\"true\">\n\t\t@for (s of [step.status]; track s) {\n\t\t\t@switch (s) {\n\t\t\t\t@case ('completed') {\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"bg-success border-success text-success-content animate-wizard-pop grid size-4.5 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<ng-container *ngTemplateOutlet=\"checkIcon; context: { $implicit: 'size-3' }\"></ng-container>\n\t\t\t\t\t</span>\n\t\t\t\t}\n\t\t\t\t@case ('in progress') {\n\t\t\t\t\t<span\n\t\t\t\t\t\tclass=\"border-primary bg-base-100 animate-wizard-ring relative grid size-4.5 place-items-center rounded-full border-2 motion-reduce:animate-none\"\n\t\t\t\t\t>\n\t\t\t\t\t\t<span class=\"animate-wizard-halo absolute -inset-0.5 rounded-full motion-reduce:hidden\"></span>\n\t\t\t\t\t</span>\n\t\t\t\t}\n\t\t\t\t@case ('error') {\n\t\t\t\t\t<span class=\"bg-error border-error animate-wizard-pop grid size-4.5 rounded-full border-2 motion-reduce:animate-none\"></span>\n\t\t\t\t}\n\t\t\t\t@default {\n\t\t\t\t\t<span class=\"border-base-300 bg-base-100 grid size-4.5 rounded-full border-2\"></span>\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t</span>\n\t<span\n\t\tstText=\"9\"\n\t\t[stTextColor]=\"step.status === 'pending' && !isCurrent ? 'base-secondary' : 'base'\"\n\t\t[stTextWeight]=\"isCurrent ? 'bold' : 'medium'\"\n\t\tclass=\"min-w-0 flex-1 wrap-anywhere\"\n\t\t>{{ step.label }}<span class=\"sr-only\">, {{ stateKey(step.status) | translate }}</span></span\n\t>\n\t@if (step.meta) {\n\t\t<span class=\"sr-only\">, </span>\n\t\t<span stText=\"10\" stTextColor=\"base-secondary\" class=\"shrink-0 tabular-nums\" data-step-meta>{{ step.meta }}</span>\n\t}\n</ng-template>\n" }]
|
|
779
522
|
}] });
|
|
780
523
|
|
|
781
524
|
/**
|
|
@@ -820,6 +563,20 @@ class WizardWrapperComponent {
|
|
|
820
563
|
* <st-wizard variant="vertical">...</st-wizard>
|
|
821
564
|
*/
|
|
822
565
|
variant = input('horizontal');
|
|
566
|
+
/**
|
|
567
|
+
* Step indicator style. When unset it follows `variant`: vertical shows `rail`, horizontal shows `segments`.
|
|
568
|
+
* `segments` sits above the content; `rail` and `checklist` sit in a side column.
|
|
569
|
+
* In `checklist`, completed steps are buttons that go back to that step (emitting `previous`), except while `loading`.
|
|
570
|
+
* @default undefined (from `variant`)
|
|
571
|
+
* @example
|
|
572
|
+
* <st-wizard variant="vertical" indicator="checklist">...</st-wizard>
|
|
573
|
+
*/
|
|
574
|
+
indicator = input(undefined);
|
|
575
|
+
/**
|
|
576
|
+
* Indicator in use: the `indicator` input, or the default for `variant`
|
|
577
|
+
* @internal
|
|
578
|
+
*/
|
|
579
|
+
resolvedIndicator = computed(() => this.indicator() ?? (this.variant() === 'vertical' ? 'rail' : 'segments'));
|
|
823
580
|
/**
|
|
824
581
|
* Add a card style to the wizard
|
|
825
582
|
* @default false
|
|
@@ -914,8 +671,11 @@ class WizardWrapperComponent {
|
|
|
914
671
|
* }
|
|
915
672
|
*/
|
|
916
673
|
handlePrevious() {
|
|
674
|
+
const from = this.wizardService.currentStepIndex();
|
|
917
675
|
this.wizardService.previousStep();
|
|
918
|
-
this.
|
|
676
|
+
if (this.wizardService.currentStepIndex() !== from) {
|
|
677
|
+
this.previous.emit();
|
|
678
|
+
}
|
|
919
679
|
}
|
|
920
680
|
/**
|
|
921
681
|
* Navigates to next valid step and emits next event
|
|
@@ -930,8 +690,24 @@ class WizardWrapperComponent {
|
|
|
930
690
|
* }
|
|
931
691
|
*/
|
|
932
692
|
handleNext() {
|
|
693
|
+
// Only a real move emits: an invalid step stays (a click can reach the host of the disabled button)
|
|
694
|
+
const from = this.wizardService.currentStepIndex();
|
|
933
695
|
this.wizardService.nextStep();
|
|
934
|
-
this.
|
|
696
|
+
if (this.wizardService.currentStepIndex() !== from) {
|
|
697
|
+
this.next.emit();
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
/**
|
|
701
|
+
* Goes back to a completed step picked in the indicator and emits previous
|
|
702
|
+
* @param {number} index - Step to go back to; ignored unless it is before the current step
|
|
703
|
+
* @emits previous
|
|
704
|
+
* @internal
|
|
705
|
+
*/
|
|
706
|
+
handleStepSelect(index) {
|
|
707
|
+
if (this.loading() || index < 0 || index >= this.wizardService.currentStepIndex())
|
|
708
|
+
return;
|
|
709
|
+
this.wizardService.gotoStep(index);
|
|
710
|
+
this.previous.emit();
|
|
935
711
|
}
|
|
936
712
|
/**
|
|
937
713
|
* Completes wizard flow and emits complete event
|
|
@@ -948,20 +724,11 @@ class WizardWrapperComponent {
|
|
|
948
724
|
this.complete.emit();
|
|
949
725
|
}
|
|
950
726
|
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: WizardWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
951
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: WizardWrapperComponent, isStandalone: true, selector: "st-wizard", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, card: { classPropertyName: "card", publicName: "card", isSignal: true, isRequired: false, transformFunction: null }, showControls: { classPropertyName: "showControls", publicName: "showControls", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, nextDescribedBy: { classPropertyName: "nextDescribedBy", publicName: "nextDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { back: "back", previous: "previous", next: "next", complete: "complete" }, queries: [{ propertyName: "contents", predicate: WizardContentComponent, isSignal: true }], ngImport: i0, template: "@let
|
|
727
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", type: WizardWrapperComponent, isStandalone: true, selector: "st-wizard", inputs: { variant: { classPropertyName: "variant", publicName: "variant", isSignal: true, isRequired: false, transformFunction: null }, indicator: { classPropertyName: "indicator", publicName: "indicator", isSignal: true, isRequired: false, transformFunction: null }, card: { classPropertyName: "card", publicName: "card", isSignal: true, isRequired: false, transformFunction: null }, showControls: { classPropertyName: "showControls", publicName: "showControls", isSignal: true, isRequired: false, transformFunction: null }, loading: { classPropertyName: "loading", publicName: "loading", isSignal: true, isRequired: false, transformFunction: null }, nextDescribedBy: { classPropertyName: "nextDescribedBy", publicName: "nextDescribedBy", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { back: "back", previous: "previous", next: "next", complete: "complete" }, queries: [{ propertyName: "contents", predicate: WizardContentComponent, isSignal: true }], ngImport: i0, template: "@let indicatorVar = resolvedIndicator();\n@let stackedVar = indicatorVar === 'segments';\n\n<div [class]=\"stackedVar ? 'flex flex-col gap-6' : 'flex gap-6'\" [ngClass]=\"{ 'rounded-box bg-base-200 shadow-overlay p-6': card() && stackedVar }\">\n\t<!-- Steps -->\n\t<st-wizard-indicator\n\t\t[class]=\"stackedVar ? 'block w-full' : 'block h-min w-60 shrink-0'\"\n\t\t[ngClass]=\"{ 'rounded-box bg-base-200 shadow-overlay p-4': card() && !stackedVar }\"\n\t\t[indicator]=\"indicatorVar\"\n\t\t[canGoBack]=\"!loading()\"\n\t\t(stepSelect)=\"handleStepSelect($event)\"\n\t></st-wizard-indicator>\n\n\t<div class=\"flex min-w-0 flex-1 flex-col gap-6\" [ngClass]=\"{ 'rounded-box bg-base-200 shadow-overlay p-6': card() && !stackedVar }\">\n\t\t<!-- Content -->\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\n\t\t<!-- Actions -->\n\t\t@if (this.showControls()) {\n\t\t\t<div class=\"flex flex-wrap items-center gap-3\">\n\t\t\t\t@if (wizardService.isCurrentStepFirst()) {\n\t\t\t\t\t<st-button variant=\"secondary\" [outline]=\"true\" [icon]=\"iconReturn\" (click)=\"handleBack()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.back' | translate\n\t\t\t\t\t}}</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button [icon]=\"iconChevronLeft\" variant=\"secondary\" [outline]=\"true\" (click)=\"handlePrevious()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.previous' | translate\n\t\t\t\t\t}}</st-button>\n\t\t\t\t}\n\t\t\t\t@if (wizardService.isCurrentStepLast()) {\n\t\t\t\t\t<st-button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t[ariaDescribedBy]=\"nextDescribedBy()\"\n\t\t\t\t\t\t(click)=\"handleComplete()\"\n\t\t\t\t\t\t[disabled]=\"loading() || !wizardService.areAllStepsValid()\"\n\t\t\t\t\t\t[loader]=\"loading()\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@if (!loading()) {\n\t\t\t\t\t\t\t<st-icon [icon]=\"iconSave\"></st-icon>\n\n\t\t\t\t\t\t\t{{ 'sdk.wizard.wizardWrapper.end' | translate }}\n\t\t\t\t\t\t}\n\t\t\t\t\t</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t[icon]=\"iconChevronRight\"\n\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t[ariaDescribedBy]=\"nextDescribedBy()\"\n\t\t\t\t\t\t[disabled]=\"!wizardService.currentStep().isValid\"\n\t\t\t\t\t\t(click)=\"handleNext()\"\n\t\t\t\t\t\t>{{ 'sdk.wizard.wizardWrapper.next' | translate }}</st-button\n\t\t\t\t\t>\n\t\t\t\t}\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<ng-content select=\"st-wizard-actions\"></ng-content>\n\t\t}\n\t</div>\n</div>\n", dependencies: [{ kind: "component", type: WizardIndicatorComponent, selector: "st-wizard-indicator", inputs: ["indicator", "canGoBack"], outputs: ["stepSelect"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "link", "soft", "dash", "wide", "circle", "square", "glass", "block", "loader", "size", "shadow", "focusable", "icon", "iconPosition", "type", "disabled", "stopPropagation", "ariaLabel", "ariaExpanded", "ariaPressed", "ariaDescribedBy", "ariaControls"], outputs: ["clicked", "pointerDown", "keyDownEnter", "keyDownSpace", "triggered"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon", "ariaLabel"] }] });
|
|
952
728
|
}
|
|
953
729
|
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: WizardWrapperComponent, decorators: [{
|
|
954
730
|
type: Component,
|
|
955
|
-
args: [{ selector: 'st-wizard', imports: [
|
|
956
|
-
WizardStepComponent,
|
|
957
|
-
ButtonComponent,
|
|
958
|
-
NgClass,
|
|
959
|
-
TextDirective,
|
|
960
|
-
WizardMarkerComponent,
|
|
961
|
-
WizardSubStepComponent,
|
|
962
|
-
TranslatePipe,
|
|
963
|
-
IconComponent,
|
|
964
|
-
], template: "@let contentsVar = contents();\n@let varinatVar = variant();\n\n<div\n\t[class]=\"varinatVar === 'horizontal' ? 'flex flex-col gap-6' : 'flex gap-6'\"\n\t[ngClass]=\"{ 'rounded-box bg-base-200 shadow-main p-6': card() && varinatVar === 'horizontal' }\"\n>\n\t<!-- Steps -->\n\t@if (varinatVar === 'horizontal') {\n\t\t<ul class=\"mx-auto my-0 flex w-full max-w-[80%_40vw] min-w-fit gap-4 px-3.5 pt-6 md:px-4 lg:px-5\">\n\t\t\t@for (step of wizardService.steps(); track $index) {\n\t\t\t\t<li [ngClass]=\"{ 'flex-1': contentsVar.length - 1 !== $index }\">\n\t\t\t\t\t<div class=\"flex items-center gap-4\">\n\t\t\t\t\t\t<st-wizard-step [icon]=\"step.icon\" [stepIndex]=\"$index\" [status]=\"step.status\"></st-wizard-step>\n\t\t\t\t\t\t@if (contentsVar.length - 1 !== $index) {\n\t\t\t\t\t\t\t<div class=\"flex min-w-min flex-1 flex-col justify-center\">\n\t\t\t\t\t\t\t\t<div class=\"flex -translate-y-6 justify-center\">\n\t\t\t\t\t\t\t\t\t<st-wizard-marker [status]=\"step.status\"></st-wizard-marker>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t<st-wizard-sub-step [stepIndex]=\"$index\" [stepStatus]=\"step.status\"></st-wizard-sub-step>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"mt-1 w-[50px]\">\n\t\t\t\t\t\t<div class=\"relative flex max-w-fit flex-col items-center\">\n\t\t\t\t\t\t\t<div class=\"min-w-max\">\n\t\t\t\t\t\t\t\t<span stText=\"8\" stTextColor=\"base\" stTextWeight=\"medium\">{{ step.label }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"text-secondary relative -top-1 min-w-max\" stText=\"9\">\n\t\t\t\t\t\t\t\t{{ 'sdk.wizard.wizardWrapper.step' | translate: { index: $index + 1 } }}\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t}\n\t\t</ul>\n\t} @else {\n\t\t<ul class=\"grid h-min max-h-min gap-4\" [ngClass]=\"{ 'rounded-box bg-base-200 shadow-main p-6': card() }\">\n\t\t\t@for (step of wizardService.steps(); track $index) {\n\t\t\t\t<li>\n\t\t\t\t\t<!-- step pogress -->\n\t\t\t\t\t<div class=\"grid grid-rows-[min-content_min-content] gap-4\">\n\t\t\t\t\t\t<div class=\"flex items-center gap-3\">\n\t\t\t\t\t\t\t<st-wizard-step [icon]=\"step.icon\" [stepIndex]=\"$index\" [status]=\"step.status\"></st-wizard-step>\n\t\t\t\t\t\t\t<!-- step info -->\n\t\t\t\t\t\t\t<div>\n\t\t\t\t\t\t\t\t<div class=\"relative flex max-w-fit flex-col\">\n\t\t\t\t\t\t\t\t\t<div class=\"min-w-max\">\n\t\t\t\t\t\t\t\t\t\t<span stText=\"8\" stTextColor=\"base\" stTextWeight=\"medium\">{{ step.label }}</span>\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t\t<div class=\"text-neutral relative -top-1 min-w-max\" stText=\"9\">\n\t\t\t\t\t\t\t\t\t\t{{ 'sdk.wizard.wizardWrapper.step' | translate: { index: $index + 1 } }}\n\t\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t@if (contentsVar.length - 1 !== $index) {\n\t\t\t\t\t\t\t<div class=\"flex flex-col justify-center\">\n\t\t\t\t\t\t\t\t<st-wizard-sub-step variant=\"vertical\" [stepIndex]=\"$index\" [stepStatus]=\"step.status\"></st-wizard-sub-step>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t}\n\t\t\t\t\t</div>\n\t\t\t\t</li>\n\t\t\t}\n\t\t</ul>\n\t}\n\n\t<div class=\"flex flex-1 flex-col gap-6\" [ngClass]=\"{ 'rounded-box bg-base-200 shadow-main p-6': card() && varinatVar === 'vertical' }\">\n\t\t<!-- Content -->\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\n\t\t<!-- Actions -->\n\t\t@if (this.showControls()) {\n\t\t\t<div class=\"flex items-center gap-3\">\n\t\t\t\t@if (wizardService.isCurrentStepFirst()) {\n\t\t\t\t\t<st-button variant=\"secondary\" [outline]=\"true\" [icon]=\"iconReturn\" (click)=\"handleBack()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.back' | translate\n\t\t\t\t\t}}</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button [icon]=\"iconChevronLeft\" variant=\"secondary\" [outline]=\"true\" (click)=\"handlePrevious()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.previous' | translate\n\t\t\t\t\t}}</st-button>\n\t\t\t\t}\n\t\t\t\t@if (wizardService.isCurrentStepLast()) {\n\t\t\t\t\t<st-button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t[ariaDescribedBy]=\"nextDescribedBy()\"\n\t\t\t\t\t\t(click)=\"handleComplete()\"\n\t\t\t\t\t\t[disabled]=\"loading() || !wizardService.areAllStepsValid()\"\n\t\t\t\t\t\t[loader]=\"loading()\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@if (!loading()) {\n\t\t\t\t\t\t\t<st-icon [icon]=\"iconSave\"></st-icon>\n\n\t\t\t\t\t\t\t{{ 'sdk.wizard.wizardWrapper.end' | translate }}\n\t\t\t\t\t\t}\n\t\t\t\t\t</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t[icon]=\"iconChevronRight\"\n\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t[ariaDescribedBy]=\"nextDescribedBy()\"\n\t\t\t\t\t\t[disabled]=\"!wizardService.currentStep().isValid\"\n\t\t\t\t\t\t(click)=\"handleNext()\"\n\t\t\t\t\t\t>{{ 'sdk.wizard.wizardWrapper.next' | translate }}</st-button\n\t\t\t\t\t>\n\t\t\t\t}\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<ng-content select=\"st-wizard-actions\"></ng-content>\n\t\t}\n\t</div>\n</div>\n" }]
|
|
731
|
+
args: [{ selector: 'st-wizard', imports: [WizardIndicatorComponent, ButtonComponent, NgClass, TranslatePipe, IconComponent], template: "@let indicatorVar = resolvedIndicator();\n@let stackedVar = indicatorVar === 'segments';\n\n<div [class]=\"stackedVar ? 'flex flex-col gap-6' : 'flex gap-6'\" [ngClass]=\"{ 'rounded-box bg-base-200 shadow-overlay p-6': card() && stackedVar }\">\n\t<!-- Steps -->\n\t<st-wizard-indicator\n\t\t[class]=\"stackedVar ? 'block w-full' : 'block h-min w-60 shrink-0'\"\n\t\t[ngClass]=\"{ 'rounded-box bg-base-200 shadow-overlay p-4': card() && !stackedVar }\"\n\t\t[indicator]=\"indicatorVar\"\n\t\t[canGoBack]=\"!loading()\"\n\t\t(stepSelect)=\"handleStepSelect($event)\"\n\t></st-wizard-indicator>\n\n\t<div class=\"flex min-w-0 flex-1 flex-col gap-6\" [ngClass]=\"{ 'rounded-box bg-base-200 shadow-overlay p-6': card() && !stackedVar }\">\n\t\t<!-- Content -->\n\t\t<div>\n\t\t\t<ng-content></ng-content>\n\t\t</div>\n\n\t\t<!-- Actions -->\n\t\t@if (this.showControls()) {\n\t\t\t<div class=\"flex flex-wrap items-center gap-3\">\n\t\t\t\t@if (wizardService.isCurrentStepFirst()) {\n\t\t\t\t\t<st-button variant=\"secondary\" [outline]=\"true\" [icon]=\"iconReturn\" (click)=\"handleBack()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.back' | translate\n\t\t\t\t\t}}</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button [icon]=\"iconChevronLeft\" variant=\"secondary\" [outline]=\"true\" (click)=\"handlePrevious()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.previous' | translate\n\t\t\t\t\t}}</st-button>\n\t\t\t\t}\n\t\t\t\t@if (wizardService.isCurrentStepLast()) {\n\t\t\t\t\t<st-button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t[ariaDescribedBy]=\"nextDescribedBy()\"\n\t\t\t\t\t\t(click)=\"handleComplete()\"\n\t\t\t\t\t\t[disabled]=\"loading() || !wizardService.areAllStepsValid()\"\n\t\t\t\t\t\t[loader]=\"loading()\"\n\t\t\t\t\t>\n\t\t\t\t\t\t@if (!loading()) {\n\t\t\t\t\t\t\t<st-icon [icon]=\"iconSave\"></st-icon>\n\n\t\t\t\t\t\t\t{{ 'sdk.wizard.wizardWrapper.end' | translate }}\n\t\t\t\t\t\t}\n\t\t\t\t\t</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button\n\t\t\t\t\t\tvariant=\"primary\"\n\t\t\t\t\t\t[icon]=\"iconChevronRight\"\n\t\t\t\t\t\ticonPosition=\"right\"\n\t\t\t\t\t\t[ariaDescribedBy]=\"nextDescribedBy()\"\n\t\t\t\t\t\t[disabled]=\"!wizardService.currentStep().isValid\"\n\t\t\t\t\t\t(click)=\"handleNext()\"\n\t\t\t\t\t\t>{{ 'sdk.wizard.wizardWrapper.next' | translate }}</st-button\n\t\t\t\t\t>\n\t\t\t\t}\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<ng-content select=\"st-wizard-actions\"></ng-content>\n\t\t}\n\t</div>\n</div>\n" }]
|
|
965
732
|
}] });
|
|
966
733
|
|
|
967
734
|
/**
|