@sixbell-telco/sdk 0.9.0 → 0.10.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.
Files changed (30) hide show
  1. package/CHANGELOG.md +27 -0
  2. package/README.md +6 -3
  3. package/components/wizard/public-api.d.ts +2 -3
  4. package/components/wizard/services/wizard.service.d.ts +221 -0
  5. package/components/wizard/wizard-actions/wizard-actions.component.d.ts +8 -0
  6. package/components/wizard/wizard-content/wizard-content.component.d.ts +67 -13
  7. package/components/wizard/wizard-marker/wizard-marker.component.d.ts +73 -6
  8. package/components/wizard/wizard-step/wizard-step.component.d.ts +76 -9
  9. package/components/wizard/wizard-sub-step/wizard-sub-step.component.d.ts +91 -9
  10. package/components/wizard/wizard-wrapper/wizard-wrapper.component.d.ts +144 -15
  11. package/esm2022/components/dual-list/src/dual-list.component.mjs +3 -3
  12. package/esm2022/components/forms/select/src/select.component.mjs +1 -8
  13. package/esm2022/components/forms/textarea/src/textarea.component.mjs +3 -3
  14. package/esm2022/components/wizard/public-api.mjs +3 -4
  15. package/esm2022/components/wizard/services/wizard.service.mjs +312 -0
  16. package/esm2022/components/wizard/wizard-actions/wizard-actions.component.mjs +22 -0
  17. package/esm2022/components/wizard/wizard-content/wizard-content.component.mjs +77 -23
  18. package/esm2022/components/wizard/wizard-marker/wizard-marker.component.mjs +81 -13
  19. package/esm2022/components/wizard/wizard-step/wizard-step.component.mjs +107 -25
  20. package/esm2022/components/wizard/wizard-sub-step/wizard-sub-step.component.mjs +113 -26
  21. package/esm2022/components/wizard/wizard-wrapper/wizard-wrapper.component.mjs +150 -66
  22. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +2 -2
  23. package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
  24. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +0 -7
  25. package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
  26. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +2 -2
  27. package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
  28. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs +851 -150
  29. package/fesm2022/sixbell-telco-sdk-components-wizard.mjs.map +1 -1
  30. package/package.json +13 -13
@@ -1,32 +1,508 @@
1
1
  import * as i0 from '@angular/core';
2
- import { inject, signal, input, Component, ChangeDetectionStrategy, contentChildren, model, output, computed, Host } from '@angular/core';
2
+ import { signal, computed, Injectable, input, Component, ChangeDetectionStrategy, inject, contentChildren, output } from '@angular/core';
3
+ import { CommonModule, NgClass } from '@angular/common';
3
4
  import { cn } from '@sixbell-telco/sdk/utils/cn';
4
- import { NgClass } from '@angular/common';
5
+ import { toObservable, takeUntilDestroyed } from '@angular/core/rxjs-interop';
6
+ import { matChevronLeftOutline, matChevronRightOutline, matKeyboardReturnOutline, matSaveOutline } from '@ng-icons/material-icons/outline';
5
7
  import { TranslateService, _, TranslatePipe } from '@ngx-translate/core';
6
8
  import { ButtonComponent } from '@sixbell-telco/sdk/components/button';
7
- import { matCheckOutline, matKeyboardBackspaceOutline } from '@sixbell-telco/sdk/components/icon/material/outline';
8
9
  import { TypographyDirective } from '@sixbell-telco/sdk/directives/typography';
9
10
  import { IconComponent } from '@sixbell-telco/sdk/components/icon';
11
+ import { matCheckOutline } from '@sixbell-telco/sdk/components/icon/material/outline';
10
12
 
13
+ /**
14
+ * Enum-like object representing possible wizard step statuses
15
+ * @readonly
16
+ * @enum {string}
17
+ */
18
+ const WIZARD_STEP_STATUS = {
19
+ IN_PROGRESS: 'in progress',
20
+ PENDING: 'pending',
21
+ COMPLETED: 'completed',
22
+ };
23
+ /**
24
+ * Service for managing wizard state and navigation
25
+ * @Injectable
26
+ */
27
+ class WizardService {
28
+ // State signals
29
+ /** @private Internal signal for wizard steps */
30
+ _steps = signal([]);
31
+ /** @private Internal signal for current step index */
32
+ _currentStepIndex = signal(0);
33
+ /** @private Internal signal for first step index */
34
+ _fistStepIndex = signal(0);
35
+ /** @private Internal signal for last step index */
36
+ _lastStepIndex = signal(0);
37
+ /** @private Internal signal for transition state */
38
+ _isTransitioning = signal(false);
39
+ // Readonly signals
40
+ /** Readonly array of wizard steps */
41
+ steps = this._steps.asReadonly();
42
+ /**
43
+ * Current step index
44
+ * @readonly
45
+ */
46
+ currentStepIndex = this._currentStepIndex.asReadonly();
47
+ /**
48
+ * Currently active step
49
+ * @readonly
50
+ */
51
+ currentStep = computed(() => this.steps()[this.currentStepIndex()]);
52
+ /**
53
+ * Array of valid steps
54
+ * @readonly
55
+ */
56
+ validSteps = computed(() => this.steps().filter((step) => step.isValid));
57
+ /**
58
+ * Indicates if all steps are valid
59
+ * @readonly
60
+ */
61
+ areAllStepsValid = computed(() => this.validSteps().length === this.steps().length);
62
+ /**
63
+ * First step index
64
+ * @readonly
65
+ */
66
+ fistStepIndex = this._fistStepIndex.asReadonly();
67
+ /**
68
+ * First step in the wizard
69
+ * @readonly
70
+ */
71
+ firstStep = computed(() => this.steps()[this.fistStepIndex()]);
72
+ /**
73
+ * Last step index
74
+ * @readonly
75
+ */
76
+ lastStepIndex = this._lastStepIndex.asReadonly();
77
+ /**
78
+ * Last step in the wizard
79
+ * @readonly
80
+ */
81
+ lastStep = computed(() => this.steps()[this.lastStepIndex()]);
82
+ /**
83
+ * Completed steps
84
+ * @readonly
85
+ */
86
+ completedSteps = computed(() => this.steps().filter((step) => step.status === 'completed'));
87
+ /**
88
+ * Pending steps
89
+ * @readonly
90
+ */
91
+ pendingSteps = computed(() => this.steps().filter((step) => step.status === 'pending'));
92
+ /**
93
+ * In-progress steps
94
+ * @readonly
95
+ */
96
+ inProgressSteps = computed(() => this.steps().filter((step) => step.status === 'in progress'));
97
+ /**
98
+ * Indicates if all steps are completed
99
+ * @readonly
100
+ */
101
+ isCompleted = computed(() => this.completedSteps().length === this.steps().length);
102
+ /**
103
+ * Indicates if current step is the first step
104
+ * @readonly
105
+ */
106
+ isCurrentStepFirst = computed(() => this.currentStepIndex() === this.fistStepIndex());
107
+ /**
108
+ * Indicates if current step is the last step
109
+ * @readonly
110
+ */
111
+ isCurrentStepLast = computed(() => this.currentStepIndex() === this.lastStepIndex());
112
+ /**
113
+ * Indicates if wizard is transitioning between steps
114
+ * @readonly
115
+ */
116
+ isTransitioning = this._isTransitioning.asReadonly();
117
+ /**
118
+ * Initializes the wizard with given steps
119
+ * @param {WizardStep[]} steps - Array of step configurations
120
+ */
121
+ init(steps) {
122
+ this.setSteps(steps.map((step, index) => ({
123
+ ...step,
124
+ status: index === 0 ? 'in progress' : 'pending',
125
+ isValid: false,
126
+ })));
127
+ this.setFistStepIndex(0);
128
+ this.setLastStepIndex(steps.length - 1);
129
+ }
130
+ /**
131
+ * Replaces all steps with new configuration
132
+ * @param {WizardStepConfig[]} steps - New array of step configurations
133
+ */
134
+ setSteps(steps) {
135
+ this._steps.set(steps);
136
+ }
137
+ /**
138
+ * Adds a new step to the end of the wizard
139
+ * @param {WizardStepConfig} step - Step configuration to add
140
+ */
141
+ addStep(step) {
142
+ this.setSteps([...this.steps(), step]);
143
+ }
144
+ /**
145
+ * Inserts a step at specific index
146
+ * @param {number} index - Position to insert the step
147
+ * @param {WizardStepConfig} step - Step configuration to add
148
+ */
149
+ addStepAtIndex(index, step) {
150
+ const newSteps = this.steps().reduce((acc, s, i) => {
151
+ if (i === index) {
152
+ acc.push(step);
153
+ }
154
+ acc.push(s);
155
+ return acc;
156
+ }, []);
157
+ this.setSteps(newSteps);
158
+ }
159
+ /**
160
+ * Removes step at specified index
161
+ * @param {number} index - Index of step to remove
162
+ */
163
+ removeStep(index) {
164
+ const newSteps = this.steps().filter((_, i) => i !== index);
165
+ this.setSteps(newSteps);
166
+ }
167
+ /**
168
+ * Updates name of step at specified index
169
+ * @param {number} index - Index of step to update
170
+ * @param {string} name - New name for the step
171
+ */
172
+ updateStepName(index, name) {
173
+ const newSteps = this.steps().map((s, i) => (i === index ? { ...s, name } : s));
174
+ this.setSteps(newSteps);
175
+ }
176
+ /**
177
+ * Updates label of step at specified index
178
+ * @param {number} index - Index of step to update
179
+ * @param {string} label - New label for the step
180
+ */
181
+ updateStepLabel(index, label) {
182
+ const newSteps = this.steps().map((s, i) => (i === index ? { ...s, label } : s));
183
+ this.setSteps(newSteps);
184
+ }
185
+ /**
186
+ * Updates status of step at specified index
187
+ * @param {number} index - Index of step to update
188
+ * @param {WizardStepStatus} status - New status for the step
189
+ * @param {number} [stale] - Optional delay in milliseconds before applying changes
190
+ */
191
+ updateStepStatus(index, status, stale) {
192
+ const newSteps = this.steps().map((s, i) => (i === index ? { ...s, status } : s));
193
+ this._isTransitioning.set(true);
194
+ if (stale === undefined) {
195
+ this._isTransitioning.set(false);
196
+ this.setSteps(newSteps);
197
+ return;
198
+ }
199
+ setTimeout(() => {
200
+ this._isTransitioning.set(false);
201
+ this.setSteps(newSteps);
202
+ }, stale);
203
+ }
204
+ /**
205
+ * Updates validation status of step at specified index
206
+ * @param {number} index - Index of step to update
207
+ * @param {boolean} isValid - New validation status
208
+ */
209
+ updateStepIsValid(index, isValid) {
210
+ const newSteps = this.steps().map((s, i) => (i === index ? { ...s, isValid } : s));
211
+ this.setSteps(newSteps);
212
+ }
213
+ /**
214
+ * Replaces entire step configuration at specified index
215
+ * @param {number} index - Index of step to replace
216
+ * @param {WizardStepConfig} step - New step configuration
217
+ */
218
+ updateStep(index, step) {
219
+ const newSteps = this.steps().map((s, i) => (i === index ? step : s));
220
+ this.setSteps(newSteps);
221
+ }
222
+ /**
223
+ * Sets current active step index
224
+ * @param {number} index - New current step index
225
+ */
226
+ setCurrentStepIndex(index) {
227
+ this._currentStepIndex.set(index);
228
+ }
229
+ /**
230
+ * Sets index for first step in wizard
231
+ * @param {number} index - New first step index
232
+ */
233
+ setFistStepIndex(index) {
234
+ this._fistStepIndex.set(index);
235
+ }
236
+ /**
237
+ * Sets index for last step in wizard
238
+ * @param {number} index - New last step index
239
+ */
240
+ setLastStepIndex(index) {
241
+ this._lastStepIndex.set(index);
242
+ }
243
+ /**
244
+ * Navigates to next valid step
245
+ */
246
+ nextStep() {
247
+ if (!this.currentStep().isValid)
248
+ return;
249
+ const lastIndex = this._steps().length - 1;
250
+ const nextIndex = this.currentStepIndex() + 1;
251
+ if (nextIndex > lastIndex)
252
+ return;
253
+ const nextStepIndex = nextIndex;
254
+ this.updateStepStatus(this.currentStepIndex(), 'completed');
255
+ this._currentStepIndex.set(nextStepIndex);
256
+ this.updateStepStatus(nextStepIndex, 'in progress', 300);
257
+ }
258
+ /**
259
+ * Navigates to previous step
260
+ */
261
+ previousStep() {
262
+ if (this.currentStepIndex() <= 0)
263
+ return;
264
+ const previousStepIndex = this.currentStepIndex() - 1;
265
+ this.updateStepStatus(this.currentStepIndex(), 'pending');
266
+ this._currentStepIndex.set(previousStepIndex);
267
+ this.updateStepStatus(previousStepIndex, 'in progress', 300);
268
+ }
269
+ /**
270
+ * Jumps to specified step index
271
+ * @param {number} index - Target step index to navigate to
272
+ */
273
+ gotoStep(index) {
274
+ if (index < 0 || index >= this.steps().length)
275
+ return;
276
+ const newSteps = this.steps().map((step, i) => {
277
+ if (i === index) {
278
+ return { ...step, status: WIZARD_STEP_STATUS.IN_PROGRESS };
279
+ }
280
+ if (index === this.fistStepIndex()) {
281
+ if (i === this.fistStepIndex()) {
282
+ return { ...step, status: WIZARD_STEP_STATUS.IN_PROGRESS };
283
+ }
284
+ return { ...step, status: WIZARD_STEP_STATUS.PENDING };
285
+ }
286
+ if (index === this.lastStepIndex()) {
287
+ if (i === this.lastStepIndex()) {
288
+ return { ...step, status: WIZARD_STEP_STATUS.IN_PROGRESS };
289
+ }
290
+ return { ...step, status: WIZARD_STEP_STATUS.COMPLETED };
291
+ }
292
+ if (i < index) {
293
+ return { ...step, status: WIZARD_STEP_STATUS.COMPLETED };
294
+ }
295
+ if (i > index) {
296
+ return { ...step, status: WIZARD_STEP_STATUS.PENDING };
297
+ }
298
+ return step;
299
+ });
300
+ this.setSteps(newSteps);
301
+ this._currentStepIndex.set(index);
302
+ }
303
+ /**
304
+ * Resets wizard to initial state
305
+ */
306
+ reset() {
307
+ this._steps.set([]);
308
+ this._currentStepIndex.set(0);
309
+ this._fistStepIndex.set(0);
310
+ this._lastStepIndex.set(0);
311
+ this._isTransitioning.set(false);
312
+ }
313
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
314
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardService, providedIn: 'root' });
315
+ }
316
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardService, decorators: [{
317
+ type: Injectable,
318
+ args: [{
319
+ providedIn: 'root',
320
+ }]
321
+ }] });
322
+
323
+ class WizardActionsComponent {
324
+ // Base table properties
325
+ alignment = input('left');
326
+ get componentClass() {
327
+ return cn('flex flex-w items-center gap-2', {
328
+ 'justify-start': this.alignment() === 'left',
329
+ 'justify-end': this.alignment() === 'right',
330
+ 'justify-center': this.alignment() === 'center',
331
+ });
332
+ }
333
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardActionsComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
334
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: WizardActionsComponent, isStandalone: true, selector: "st-wizard-actions", inputs: { alignment: { classPropertyName: "alignment", publicName: "alignment", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "<div [class]=\"componentClass\">\n\t<ng-content></ng-content>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
335
+ }
336
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardActionsComponent, decorators: [{
337
+ type: Component,
338
+ args: [{ selector: 'st-wizard-actions', standalone: true, imports: [CommonModule], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"componentClass\">\n\t<ng-content></ng-content>\n</div>\n" }]
339
+ }] });
340
+
341
+ /**
342
+ * Component wrapper for individual wizard step content with validation integration.
343
+ *
344
+ * @remarks
345
+ * Manages content visibility and validation state synchronization with the wizard service.
346
+ * Automatically handles:
347
+ * - Step activation status
348
+ * - Validation state propagation
349
+ * - Fade animations
350
+ * - Destruction cleanup
351
+ *
352
+ * @example
353
+ * ```html
354
+ * <st-wizard-content
355
+ * [stepIndex]="0"
356
+ * [isValid]="form.valid"
357
+ * >
358
+ * <!-- Step content -->
359
+ * </st-wizard-content>
360
+ * ```
361
+ */
362
+ class WizardContentComponent {
363
+ /** @internal Injected wizard state service */
364
+ wizardService = inject(WizardService);
365
+ /**
366
+ * Position index in the wizard sequence (0-based)
367
+ * @default 0
368
+ */
369
+ stepIndex = input(0);
370
+ /**
371
+ * Current validation state of the step
372
+ * @default false
373
+ * @remarks Updates wizard service automatically when changed
374
+ */
375
+ isValid = input(false);
376
+ /**
377
+ * Computed status from wizard service
378
+ * @internal
379
+ */
380
+ status = computed(() => this.wizardService.steps()[this.stepIndex()].status);
381
+ /**
382
+ * Observable version of isValid input
383
+ * @internal
384
+ */
385
+ isValid$ = toObservable(this.isValid);
386
+ /**
387
+ * Current active step index from service
388
+ * @internal
389
+ */
390
+ currentStep = computed(() => this.wizardService.currentStepIndex());
391
+ /**
392
+ * Checks if this content's step is currently active
393
+ * @returns {boolean} True if stepIndex matches current active step
394
+ * @internal
395
+ */
396
+ isStepActive = computed(() => this.stepIndex() === this.wizardService.currentStepIndex());
397
+ /**
398
+ * Computed CSS classes for content container
399
+ * @returns {string} Animation classes
400
+ * @internal
401
+ */
402
+ componentClass = computed(() => cn('animate-fade-in animate-duration-300'));
403
+ /**
404
+ * Sets up validation state synchronization
405
+ * @remarks Uses takeUntilDestroyed for automatic cleanup
406
+ */
407
+ constructor() {
408
+ this.isValid$.pipe(takeUntilDestroyed()).subscribe((isValid) => {
409
+ this.wizardService.updateStepIsValid(this.stepIndex(), isValid);
410
+ });
411
+ }
412
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardContentComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
413
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: WizardContentComponent, isStandalone: true, selector: "st-wizard-content", inputs: { stepIndex: { classPropertyName: "stepIndex", publicName: "stepIndex", isSignal: true, isRequired: false, transformFunction: null }, isValid: { classPropertyName: "isValid", publicName: "isValid", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: "@if (this.isStepActive()) {\n\t<div [class]=\"componentClass()\">\n\t\t<ng-content></ng-content>\n\t</div>\n}\n" });
414
+ }
415
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardContentComponent, decorators: [{
416
+ type: Component,
417
+ args: [{ selector: 'st-wizard-content', standalone: true, imports: [], template: "@if (this.isStepActive()) {\n\t<div [class]=\"componentClass()\">\n\t\t<ng-content></ng-content>\n\t</div>\n}\n" }]
418
+ }], ctorParameters: () => [] });
419
+
420
+ /**
421
+ * Component that displays a status badge for wizard steps with translated labels.
422
+ *
423
+ * @remarks
424
+ * Shows visual indicators for different step states with automatic translations.
425
+ * Supports three status types with corresponding styling:
426
+ * - Completed (green background)
427
+ * - In progress (neutral border)
428
+ * - Pending (dimmed appearance)
429
+ *
430
+ * Uses NGX-Translate for localization of status labels.
431
+ *
432
+ * @example
433
+ * ```html
434
+ * <!-- Completed state -->
435
+ * <st-wizard-marker [status]="'completed'"></st-wizard-marker>
436
+ *
437
+ * <!-- In progress state -->
438
+ * <st-wizard-marker [status]="'in progress'"></st-wizard-marker>
439
+ * ```
440
+ */
11
441
  class WizardMarkerComponent {
442
+ /** @internal Translation service instance */
12
443
  translateService = inject(TranslateService);
444
+ /** @internal Wizard state service */
445
+ wizardService = inject(WizardService);
446
+ /**
447
+ * Current status of the associated wizard step
448
+ * @remarks Determines badge styling and label
449
+ */
450
+ status = input.required();
451
+ /**
452
+ * Computed translated status message
453
+ * @internal
454
+ */
455
+ statusMarkerMessage = computed(() => this.getStatusMarkerMessage());
456
+ /**
457
+ * Computed CSS classes for the status badge
458
+ * @internal
459
+ */
460
+ statusMarkerClasses = computed(() => this.getStepStatusMarkerClasses());
461
+ /** @internal Signal holding translated "completed" text */
13
462
  completed = signal('completed');
463
+ /** @internal Signal holding translated "in progress" text */
14
464
  inProgress = signal('in progress');
465
+ /** @internal Signal holding translated "pending" text */
15
466
  pending = signal('pending');
16
- content = input.required();
467
+ /** @internal Base CSS classes for the marker */
468
+ baseClasses = 'rounded-btn transition-colors duration-300 ease-out delay-150';
469
+ /** @internal Status-to-class mapping */
470
+ statusClassMap = {
471
+ completed: 'bg-primary/20 text-primary px-3 py-[5px]',
472
+ 'in progress': 'bg-neutral text-neutral-content border-[2px] border-neutral px-[10px] py-[3px]',
473
+ pending: 'bg-neutral/20 text-neutral-content/20 border-[2px] border-neutral px-[10px] py-[3px]',
474
+ };
475
+ /**
476
+ * Initializes component translations
477
+ * @remarks Loads translated status labels using NGX-Translate
478
+ */
17
479
  ngOnInit() {
18
480
  this.initTranslatations();
19
481
  }
20
- getStatusMarkerMessage(content) {
21
- return content.status() === 'completed' ? this.completed() : content.status() === 'in progress' ? this.inProgress() : this.pending();
482
+ /**
483
+ * Gets the appropriate translated status message
484
+ * @returns {string} Translated status label
485
+ * @internal
486
+ */
487
+ getStatusMarkerMessage() {
488
+ return this.status() === 'completed' ? this.completed() : this.status() === 'in progress' ? this.inProgress() : this.pending();
22
489
  }
23
- getStepStatusMarkerClasses(content) {
24
- return cn('rounded-btn-xs', {
25
- 'transition-colors duration-300 ease-out delay-150 bg-primary bg-opacity-20 text-primary px-3 py-[5px]': content.status() === 'completed',
26
- 'transition-colors duration-300 ease-out delay-150 bg-neutral-content text-secondary border-[2px] border-secondary px-[10px] py-[3px]': content.status() === 'in progress',
27
- 'transition-colors duration-300 ease-out delay-150 bg-neutral-content text-tertiary border-[2px] border-tertiary px-[10px] py-[3px]': content.status() === 'pending',
28
- });
490
+ /**
491
+ * Computes CSS classes based on current status
492
+ * @returns {string} Combined Tailwind classes
493
+ * @internal
494
+ */
495
+ getStepStatusMarkerClasses() {
496
+ return cn(this.baseClasses, this.statusClassMap[this.status()]);
29
497
  }
498
+ /**
499
+ * Initializes translations for status labels
500
+ * @remarks Uses translation keys:
501
+ * - 'sdk.wizard.wizardMarker.completed'
502
+ * - 'sdk.wizard.wizardMarker.inProgress'
503
+ * - 'sdk.wizard.wizardMarker.pending'
504
+ * @internal
505
+ */
30
506
  initTranslatations() {
31
507
  this.translateService.get(_('sdk.wizard.wizardMarker.completed')).subscribe((res) => {
32
508
  this.completed.set(res);
@@ -39,188 +515,413 @@ class WizardMarkerComponent {
39
515
  });
40
516
  }
41
517
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardMarkerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
42
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: WizardMarkerComponent, isStandalone: true, selector: "st-wizard-marker", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let contentVar = content();\n<div [class]=\"getStepStatusMarkerClasses(contentVar)\">\n\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'semibold'\">{{ getStatusMarkerMessage(contentVar) }}</span>\n</div>\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
518
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", 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 typography [tyVariant]=\"'body-xxs'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'medium'\">{{ statusMarkerMessage() }}</span>\n</div>\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
43
519
  }
44
520
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardMarkerComponent, decorators: [{
45
521
  type: Component,
46
- args: [{ selector: 'st-wizard-marker', standalone: true, imports: [TypographyDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let contentVar = content();\n<div [class]=\"getStepStatusMarkerClasses(contentVar)\">\n\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'semibold'\">{{ getStatusMarkerMessage(contentVar) }}</span>\n</div>\n" }]
522
+ args: [{ selector: 'st-wizard-marker', standalone: true, imports: [TypographyDirective], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"statusMarkerClasses()\">\n\t<span typography [tyVariant]=\"'body-xxs'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'medium'\">{{ statusMarkerMessage() }}</span>\n</div>\n" }]
47
523
  }] });
48
524
 
525
+ /**
526
+ * Visual indicator component for individual wizard steps with status-dependent styling and animations.
527
+ *
528
+ * @remarks
529
+ * Displays step progress through dynamic border and background colors. Supports three states:
530
+ * - Completed (checkmark icon)
531
+ * - In progress (highlighted border)
532
+ * - Pending (dimmed appearance)
533
+ *
534
+ * Uses Angular signals for optimized change detection and smooth transitions.
535
+ *
536
+ * @example
537
+ * ```html
538
+ * <!-- Completed step with custom icon -->
539
+ * <st-wizard-step
540
+ * [stepIndex]="1"
541
+ * [status]="'completed'"
542
+ * icon="user-profile"
543
+ * ></st-wizard-step>
544
+ *
545
+ * <!-- Current active step -->
546
+ * <st-wizard-step
547
+ * [stepIndex]="2"
548
+ * [status]="'in progress'"
549
+ * ></st-wizard-step>
550
+ * ```
551
+ */
49
552
  class WizardStepComponent {
553
+ /** @internal Injected wizard state service */
554
+ wizardService = inject(WizardService);
555
+ /**
556
+ * Optional custom icon name for completed state
557
+ * @default undefined (uses checkmark)
558
+ */
559
+ icon = input();
560
+ /**
561
+ * Current progress status of the step
562
+ * @remarks Determines visual state and transitions
563
+ */
50
564
  status = input.required();
51
- content = input.required();
52
- currentStep = input.required();
53
- icon = matCheckOutline;
54
- getStepClasses(currentStep, content) {
55
- const outerClasses = cn('flex h-[50px] min-h-[50px] w-[50px] min-w-[50px] items-center justify-center rounded-full border-[1px] border-solid p-[2px] font-medium text-neutral-content', {
56
- 'border-primary currentStep transition-colors duration-300 ease-out': currentStep === content.step() && (content.status() === 'in progress' || content.status() === 'completed'),
57
- 'border-primary notCurrentStep transition-colors duration-300 ease-out': currentStep !== content.step() && content.status() === 'completed',
58
- 'border-secondary notCurrentStep transition-colors duration-300 ease-out delay-[300ms]': currentStep !== content.step() && content.status() === 'pending',
565
+ /**
566
+ * Position in wizard sequence (0-based index)
567
+ * @remarks Used for current step comparison
568
+ */
569
+ stepIndex = input.required();
570
+ /** @internal Predefined checkmark icon */
571
+ iconCheck = matCheckOutline;
572
+ /**
573
+ * Computed CSS classes for step containers
574
+ * @returns {Object} Classes for outer/inner elements
575
+ * @remarks Applies:
576
+ * - 300ms color transitions
577
+ * - 300ms delay for pending states
578
+ * - Primary colors for active/completed states
579
+ * @internal
580
+ */
581
+ stepClasses = computed(() => {
582
+ // Base classes
583
+ const baseOuterClasses = 'flex h-[50px] min-h-[50px] w-[50px] min-w-[50px] items-center justify-center rounded-full border-[1px] border-solid p-[2px] font-medium text-neutral-content';
584
+ const baseInnerClasses = 'flex h-full w-full items-center justify-center rounded-full bg-secondary';
585
+ // State variables
586
+ const isCurrentStep = this.wizardService.currentStepIndex() === this.stepIndex();
587
+ const currentStatus = this.status();
588
+ const isCompleted = currentStatus === 'completed';
589
+ const isInProgress = currentStatus === 'in progress';
590
+ // Conditions
591
+ const isCurrentActive = isCurrentStep && (isInProgress || isCompleted);
592
+ const isCompletedNotCurrent = !isCurrentStep && isCompleted;
593
+ const isPendingNotCurrent = !isCurrentStep && currentStatus === 'pending';
594
+ const outerClasses = cn(baseOuterClasses, {
595
+ 'border-primary currentStep transition-colors duration-300 ease-out': isCurrentActive,
596
+ 'border-primary notCurrentStep transition-colors duration-300 ease-out': isCompletedNotCurrent,
597
+ 'border-secondary notCurrentStep transition-colors duration-300 ease-out delay-[300ms]': isPendingNotCurrent,
59
598
  });
60
- const innerClasses = cn('flex h-full w-full items-center justify-center rounded-full', {
61
- 'bg-primary currentStep transition-colors duration-300 ease-out': currentStep === content.step() && (content.status() === 'in progress' || content.status() === 'completed'),
62
- 'bg-primary notCurrentStep transition-colors duration-300 ease-out': currentStep !== content.step() && content.status() === 'completed',
63
- 'bg-secondary notCurrentStep transition-colors duration-300 ease-out delay-[300ms]': currentStep !== content.step() && content.status() === 'pending',
599
+ const innerClasses = cn(baseInnerClasses, {
600
+ 'bg-primary currentStep transition-colors duration-300 ease-out': isCurrentActive,
601
+ 'bg-primary notCurrentStep transition-colors duration-300 ease-out': isCompletedNotCurrent,
602
+ 'bg-secondary notCurrentStep transition-colors duration-300 ease-out delay-[300ms]': isPendingNotCurrent,
64
603
  });
65
604
  return { outerClasses, innerClasses };
66
- }
67
- get stepNumberClasses() {
605
+ });
606
+ /**
607
+ * Step number visibility classes
608
+ * @returns {string} Tailwind classes with fade animation
609
+ * @remarks
610
+ * - Hidden when completed
611
+ * - 350ms fade-in delay for smooth transitions
612
+ * @internal
613
+ */
614
+ stepNumberClasses = computed(() => {
615
+ const isCompleted = this.status() === 'completed';
68
616
  return cn({
69
- 'hidden opacity-0': this.status() === 'completed',
70
- 'animate-fade-in animate-duration-300 delay-[350ms] opacity-1': this.status() === 'in progress' || this.status() === 'pending',
617
+ 'hidden opacity-0': isCompleted,
618
+ 'animate-fade-in animate-duration-300 delay-[350ms] opacity-1': !isCompleted,
71
619
  });
72
- }
73
- get stepIconClasses() {
620
+ });
621
+ /**
622
+ * Completion icon visibility classes
623
+ * @returns {string} Tailwind classes with fade animation
624
+ * @remarks
625
+ * - Only visible when completed
626
+ * - 350ms fade-in delay for smooth transition
627
+ * @internal
628
+ */
629
+ stepIconClasses = computed(() => {
630
+ const isCompleted = this.status() === 'completed';
74
631
  return cn({
75
- 'animate-fade-in animate-duration-300 delay-[350ms] opacity-1': this.status() === 'completed',
76
- 'hidden opacity-0': this.status() === 'in progress' || this.status() === 'pending',
632
+ 'animate-fade-in animate-duration-300 delay-[350ms] opacity-1': isCompleted,
633
+ 'hidden opacity-0': !isCompleted,
77
634
  });
78
- }
635
+ });
79
636
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
80
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: WizardStepComponent, isStandalone: true, selector: "st-wizard-step", inputs: { status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: true, transformFunction: null }, content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let currentStepVar = currentStep();\n@let contentVar = content();\n\n<div [class]=\"getStepClasses(currentStepVar, contentVar).outerClasses\">\n\t<div [class]=\"getStepClasses(currentStepVar, contentVar).innerClasses\">\n\t\t<div [class]=\"stepNumberClasses\">\n\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'semibold'\">\n\t\t\t\t{{ contentVar.step() + 1 }}\n\t\t\t</span>\n\t\t</div>\n\t\t<st-icon [class]=\"stepIconClasses\" [icon]=\"icon\" color=\"inherit\" size=\"md\"></st-icon>\n\t</div>\n</div>\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
637
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", 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]=\"stepNumberClasses()\">\n\t\t\t@let iconVar = icon();\n\t\t\t@if (iconVar) {\n\t\t\t\t<st-icon [icon]=\"iconVar\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t\t} @else {\n\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'semibold'\">\n\t\t\t\t\t{{ stepIndex() + 1 }}\n\t\t\t\t</span>\n\t\t\t}\n\t\t</div>\n\t\t<st-icon [class]=\"stepIconClasses()\" [icon]=\"iconCheck\" color=\"inherit\" size=\"md\"></st-icon>\n\t</div>\n</div>\n", dependencies: [{ kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "component", type: IconComponent, selector: "st-icon", inputs: ["color", "size", "icon"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
81
638
  }
82
639
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardStepComponent, decorators: [{
83
640
  type: Component,
84
- args: [{ selector: 'st-wizard-step', standalone: true, imports: [TypographyDirective, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "@let currentStepVar = currentStep();\n@let contentVar = content();\n\n<div [class]=\"getStepClasses(currentStepVar, contentVar).outerClasses\">\n\t<div [class]=\"getStepClasses(currentStepVar, contentVar).innerClasses\">\n\t\t<div [class]=\"stepNumberClasses\">\n\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'semibold'\">\n\t\t\t\t{{ contentVar.step() + 1 }}\n\t\t\t</span>\n\t\t</div>\n\t\t<st-icon [class]=\"stepIconClasses\" [icon]=\"icon\" color=\"inherit\" size=\"md\"></st-icon>\n\t</div>\n</div>\n" }]
641
+ args: [{ selector: 'st-wizard-step', standalone: true, imports: [TypographyDirective, IconComponent], changeDetection: ChangeDetectionStrategy.OnPush, template: "<div [class]=\"stepClasses().outerClasses\">\n\t<div [class]=\"stepClasses().innerClasses\">\n\t\t<div [class]=\"stepNumberClasses()\">\n\t\t\t@let iconVar = icon();\n\t\t\t@if (iconVar) {\n\t\t\t\t<st-icon [icon]=\"iconVar\" color=\"inherit\" size=\"md\"></st-icon>\n\t\t\t} @else {\n\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'semibold'\">\n\t\t\t\t\t{{ stepIndex() + 1 }}\n\t\t\t\t</span>\n\t\t\t}\n\t\t</div>\n\t\t<st-icon [class]=\"stepIconClasses()\" [icon]=\"iconCheck\" color=\"inherit\" size=\"md\"></st-icon>\n\t</div>\n</div>\n" }]
85
642
  }] });
86
643
 
644
+ /**
645
+ * A component that visualizes the connection between wizard steps with animated progress indicators.
646
+ *
647
+ * @remarks
648
+ * Handles both horizontal and vertical layouts with status-dependent animations. Manages three segments:
649
+ * - Left connector (before the step)
650
+ * - Center indicator (current step marker)
651
+ * - Right connector (after the step)
652
+ *
653
+ * @example
654
+ * ```html
655
+ * <!-- Horizontal sub-step -->
656
+ * <st-wizard-sub-step
657
+ * [stepIndex]="1"
658
+ * [stepStatus]="'completed'"
659
+ * ></st-wizard-sub-step>
660
+ *
661
+ * <!-- Vertical sub-step -->
662
+ * <st-wizard-sub-step
663
+ * variant="vertical"
664
+ * [stepIndex]="2"
665
+ * [stepStatus]="'in progress'"
666
+ * ></st-wizard-sub-step>
667
+ * ```
668
+ */
87
669
  class WizardSubStepComponent {
88
- content = input.required();
89
- currentStep = input.required();
90
- getSubStepClasses(currentStep, content) {
91
- const leftClasses = cn('h-[2px] w-full', {
92
- 'bg-secondary currentStep relative after:absolute after:w-full after:left-0 after:bottom-0 after:bg-primary bg:content-[" "] after:h-[2px] after:transition-[width] after:duration-300 after:ease-out': currentStep === content.step() && (content.status() === 'in progress' || content.status() === 'completed'),
93
- 'bg-secondary notCurrentSte relative after:absolute after:w-full after:left-0 after:bottom-0 after:bg-primary bg:content-[" "] after:h-[2px] after:transition-[width] after:duration-300 after:ease-out': currentStep !== content.step() && content.status() === 'completed',
94
- 'bg-secondary notCurrentStep relative after:absolute after:w-0 after:left-0 after:bottom-0 after:bg-primary bg:content-[" "] after:h-[2px] after:transition-[width] after:duration-300 after:ease-out after:delay-[350ms]': currentStep !== content.step() && content.status() === 'pending',
95
- });
96
- const centerClasses = cn('h-3 min-h-3 w-3 min-w-3 rounded-full', {
97
- 'bg-primary currentStep transition-colors duration-300 ease-out delay-300': currentStep === content.step() && content.status() === 'in progress',
98
- 'bg-primary notCurrentStep transition-colors duration-300 ease-out delay-300': currentStep !== content.step() && content.status() === 'completed',
99
- 'bg-primary currentStep inProgress transition-colors duration-300 ease-out delay-300': currentStep === content.step() && content.status() === 'completed',
100
- 'bg-secondary notCurrentStep transition-colors duration-300 ease-out': currentStep !== content.step() && content.status() === 'pending',
101
- });
102
- const rightClasses = cn('h-[2px] w-full', {
103
- 'bg-secondary currentStep relative after:absolute after:w-full after:left-0 after:bottom-0 after:bg-primary bg:content-[" "] after:h-[2px] after:transition-[width] after:duration-300 after:ease-out after:delay-[350ms]': currentStep === content.step() && content.status() === 'completed',
104
- 'bg-secondary notCurrentStep relative after:absolute after:w-full after:left-0 after:bottom-0 after:bg-primary bg:content-[" "] after:h-[2px] after:transition-[width] after:duration-300 after:ease-out after:delay-[350ms]': currentStep !== content.step() && content.status() === 'completed',
105
- 'bg-secondary currentStep inProgress relative after:absolute after:w-0 after:left-0 after:bottom-0 after:bg-primary bg:content-[" "] after:h-[2px] after:transition-[width] after:duration-300 after:ease-out': currentStep === content.step() && content.status() === 'in progress',
106
- 'bg-secondary notCurrentStep relative after:absolute after:w-0 after:left-0 after:bottom-0 after:bg-primary bg:content-[" "] after:h-[2px] after:transition-[width] after:duration-300 after:ease-out': currentStep !== content.step() && content.status() === 'pending',
107
- });
108
- return { leftClasses, centerClasses, rightClasses };
109
- }
670
+ /**
671
+ * Layout direction for the sub-step connectors
672
+ * @default 'horizontal'
673
+ */
674
+ variant = input('horizontal');
675
+ /** @internal Injected wizard state service */
676
+ wizardService = inject(WizardService);
677
+ /**
678
+ * Index of the parent step in the wizard sequence
679
+ * @remarks Required for position calculation
680
+ */
681
+ stepIndex = input.required();
682
+ /**
683
+ * Current status of the associated wizard step
684
+ * @remarks Determines visual state and animations
685
+ */
686
+ stepStatus = input.required();
687
+ /**
688
+ * Checks if this sub-step's index matches the current active step
689
+ * @returns {boolean} True if this is the active step
690
+ * @internal
691
+ */
692
+ isCurrentStep = computed(() => this.wizardService.currentStepIndex() === this.stepIndex());
693
+ /**
694
+ * Computed classes for horizontal left connector segment
695
+ * @returns {string} Tailwind classes with animated width transition
696
+ * @internal
697
+ */
698
+ horizontalLeftClasses = computed(() => {
699
+ const isCompleted = this.stepStatus() === 'completed';
700
+ const isInProgress = this.stepStatus() === 'in progress';
701
+ const afterWidthClass = isCompleted || (this.isCurrentStep() && isInProgress) ? 'after:w-full' : 'after:w-0';
702
+ return cn('h-[2px] w-full bg-secondary relative', 'after:absolute after:left-0 after:bottom-0 after:bg-primary after:h-[2px]', 'after:transition-[width] after:duration-300 after:ease-out', afterWidthClass);
703
+ });
704
+ /**
705
+ * Computed classes for horizontal center indicator
706
+ * @returns {string} Tailwind classes with color transition delays
707
+ * @internal
708
+ */
709
+ horizontalCenterClasses = computed(() => {
710
+ const isPrimaryBg = (this.isCurrentStep() && this.stepStatus() !== 'pending') || (!this.isCurrentStep() && this.stepStatus() === 'completed');
711
+ return cn('h-3 min-h-3 w-3 min-w-3 rounded-full', 'transition-colors duration-300 ease-out', isPrimaryBg ? 'bg-primary' : 'bg-secondary', isPrimaryBg && !this.isCurrentStep() ? '' : 'delay-300');
712
+ });
713
+ /**
714
+ * Computed classes for horizontal right connector segment
715
+ * @returns {string} Tailwind classes with completion-based width
716
+ * @internal
717
+ */
718
+ horizontalRightClasses = computed(() => {
719
+ const isCompleted = this.stepStatus() === 'completed';
720
+ const afterWidthClass = isCompleted ? 'after:w-full' : 'after:w-0';
721
+ return cn('h-[2px] w-full bg-secondary relative', 'after:absolute after:left-0 after:bottom-0 after:bg-primary after:h-[2px]', 'after:transition-[width] after:duration-300 after:ease-out', afterWidthClass);
722
+ });
723
+ /**
724
+ * Computed classes for vertical left connector segment
725
+ * @returns {string} Tailwind classes with animated height transition
726
+ * @internal
727
+ */
728
+ verticalLeftClasses = computed(() => {
729
+ const isCompleted = this.stepStatus() === 'completed';
730
+ const isInProgress = this.stepStatus() === 'in progress';
731
+ const afterHeightClass = isCompleted || (this.isCurrentStep() && isInProgress) ? 'after:h-full' : 'after:h-0';
732
+ return cn('w-[2px] h-full bg-secondary relative rotate-180', 'after:absolute after:left-0 after:bottom-0 after:bg-primary after:w-[2px]', 'after:transition-[height] after:duration-300 after:ease-out', afterHeightClass);
733
+ });
734
+ /**
735
+ * Computed classes for vertical center indicator
736
+ * @returns {string} Tailwind classes with color transition logic
737
+ * @internal
738
+ */
739
+ verticalCenterClasses = computed(() => {
740
+ const isPrimaryBg = (this.isCurrentStep() && this.stepStatus() !== 'pending') || (!this.isCurrentStep() && this.stepStatus() === 'completed');
741
+ return cn('h-3 min-h-3 w-3 min-w-3 rounded-full', 'transition-colors duration-300 ease-out', isPrimaryBg ? 'bg-primary' : 'bg-secondary', isPrimaryBg && !this.isCurrentStep() ? '' : 'delay-300');
742
+ });
743
+ /**
744
+ * Computed classes for vertical right connector segment
745
+ * @returns {string} Tailwind classes with completion-based height
746
+ * @internal
747
+ */
748
+ verticalRightClasses = computed(() => {
749
+ const isCompleted = this.stepStatus() === 'completed';
750
+ const afterHeightClass = isCompleted ? 'after:h-full' : 'after:h-0';
751
+ return cn('w-[2px] h-full bg-secondary relative rotate-180', 'after:absolute after:left-0 after:bottom-0 after:bg-primary after:w-[2px]', 'after:transition-[height] after:duration-300 after:ease-out', afterHeightClass);
752
+ });
110
753
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardSubStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
111
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "18.2.12", type: WizardSubStepComponent, isStandalone: true, selector: "st-wizard-sub-step", inputs: { content: { classPropertyName: "content", publicName: "content", isSignal: true, isRequired: true, transformFunction: null }, currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: true, transformFunction: null } }, ngImport: i0, template: "@let currentStepVar = currentStep();\n@let contentVar = content();\n<div class=\"flex flex-1 -translate-y-3 items-center\">\n\t<div [class]=\"getSubStepClasses(currentStepVar, contentVar).leftClasses\"></div>\n\t<div [class]=\"getSubStepClasses(currentStepVar, contentVar).centerClasses\"></div>\n\t<div [class]=\"getSubStepClasses(currentStepVar, contentVar).rightClasses\"></div>\n</div>\n" });
754
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", 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=\"flex min-w-[max(100%,80px)] flex-1 -translate-y-[18px] 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=\"flex h-full min-h-full w-fit translate-x-[18px] 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" });
112
755
  }
113
756
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardSubStepComponent, decorators: [{
114
757
  type: Component,
115
- args: [{ selector: 'st-wizard-sub-step', standalone: true, imports: [], template: "@let currentStepVar = currentStep();\n@let contentVar = content();\n<div class=\"flex flex-1 -translate-y-3 items-center\">\n\t<div [class]=\"getSubStepClasses(currentStepVar, contentVar).leftClasses\"></div>\n\t<div [class]=\"getSubStepClasses(currentStepVar, contentVar).centerClasses\"></div>\n\t<div [class]=\"getSubStepClasses(currentStepVar, contentVar).rightClasses\"></div>\n</div>\n" }]
758
+ args: [{ selector: 'st-wizard-sub-step', standalone: true, imports: [], template: "@if (variant() === 'horizontal') {\n\t<div class=\"flex min-w-[max(100%,80px)] flex-1 -translate-y-[18px] 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=\"flex h-full min-h-full w-fit translate-x-[18px] 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" }]
116
759
  }] });
117
760
 
761
+ /**
762
+ * A container component for multi-step workflows with navigation controls and layout management.
763
+ *
764
+ * @remarks
765
+ * Integrates with WizardService for state management and provides template structure for wizard steps.
766
+ * Supports both horizontal and vertical layouts with customizable navigation controls.
767
+ *
768
+ * @example
769
+ * ```html
770
+ * <!-- Basic horizontal wizard -->
771
+ * <st-wizard>
772
+ * <st-wizard-content [stepIndex]="0" name="Step 1" [isValid]="true">
773
+ * <!-- Step content -->
774
+ * </st-wizard-content>
775
+ * <st-wizard-content [stepIndex]="1" name="Step 2">
776
+ * <!-- Step content -->
777
+ * </st-wizard-content>
778
+ * </st-wizard>
779
+ *
780
+ * <!-- Vertical wizard with external controls -->
781
+ * <st-wizard variant="vertical" [showControls]="false">
782
+ * <!-- Step contents -->
783
+ * </st-wizard>
784
+ * <div class="controls">
785
+ * <st-button (click)="handlePrevious()">Previous</st-button>
786
+ * <st-button (click)="handleNext()">Next</st-button>
787
+ * </div>
788
+ * ```
789
+ */
118
790
  class WizardWrapperComponent {
791
+ /**
792
+ * Injected wizard state management service instance
793
+ * @internal
794
+ */
795
+ wizardService = inject(WizardService);
796
+ /**
797
+ * Controls the layout direction of the wizard steps
798
+ * @default 'horizontal'
799
+ * @example
800
+ * <st-wizard variant="vertical">...</st-wizard>
801
+ */
802
+ variant = input('horizontal');
803
+ /**
804
+ * Add a card style to the wizard
805
+ * @default false
806
+ * @example
807
+ * <st-wizard [card]="true">...</st-wizard>
808
+ */
809
+ card = input(false);
810
+ /**
811
+ * Query list of contained wizard content components
812
+ * @internal
813
+ */
119
814
  contents = contentChildren(WizardContentComponent);
120
- currentStep = model(0);
815
+ /**
816
+ * Controls visibility of built-in navigation controls
817
+ * @default true
818
+ * @example
819
+ * <st-wizard [showControls]="false">...</st-wizard>
820
+ */
821
+ showControls = input(true);
822
+ /**
823
+ * Event emitted when the back button is clicked
824
+ * @example
825
+ * <st-wizard (onBack)="handleCancel()">...</st-wizard>
826
+ */
121
827
  onBack = output();
122
- oncompleted = output();
123
- isFirstStep = computed(() => this.currentStep() === 0);
124
- isLastStep = computed(() => this.currentStep() === this.contents().length - 1);
125
- allStepsAreValid = computed(() => this.contents().every((step) => step.isValid()));
126
- isCurrentStepValid = computed(() => this.contents()[this.currentStep()].isValid());
127
- icon = matKeyboardBackspaceOutline;
128
- handlePreviousStep() {
129
- if (this.currentStep() <= 0) {
130
- return;
131
- }
132
- this.currentStep.set(this.currentStep() - 1);
133
- this.handleStepStatusChange(this.contents()[this.currentStep()]);
134
- }
135
- handleNextStep() {
136
- if (this.currentStep() >= this.contents().length - 1) {
137
- return;
138
- }
139
- if (!this.isCurrentStepValid()) {
140
- return;
141
- }
142
- this.currentStep.set(this.currentStep() + 1);
143
- this.handleStepStatusChange(this.contents()[this.currentStep()]);
144
- }
828
+ /**
829
+ * Event emitted when navigating to the previous step
830
+ * @example
831
+ * <st-wizard (onPrevious)="logStepChange('previous')">...</st-wizard>
832
+ */
833
+ onPrevious = output();
834
+ /**
835
+ * Event emitted when navigating to the next valid step
836
+ * @example
837
+ * <st-wizard (onNext)="logStepChange('next')">...</st-wizard>
838
+ */
839
+ onNext = output();
840
+ /**
841
+ * Event emitted when all steps are completed
842
+ * @example
843
+ * <st-wizard (onComplete)="showCompletionModal()">...</st-wizard>
844
+ */
845
+ onComplete = output();
846
+ // Icon definitions
847
+ /** @internal Material design chevron left icon */
848
+ iconChevronLeft = matChevronLeftOutline;
849
+ /** @internal Material design chevron right icon */
850
+ iconChevronRight = matChevronRightOutline;
851
+ /** @internal Material design return arrow icon */
852
+ iconReturn = matKeyboardReturnOutline;
853
+ /** @internal Material design save/floppy disk icon */
854
+ iconSave = matSaveOutline;
855
+ /**
856
+ * Handles back navigation and emits onBack event
857
+ * @emits onBack
858
+ * @example
859
+ * // Template
860
+ * <button (click)="handleBack()">Cancel</button>
861
+ *
862
+ * // Component
863
+ * handleBack() {
864
+ * this.onBack.emit();
865
+ * }
866
+ */
145
867
  handleBack() {
146
868
  this.onBack.emit();
147
869
  }
148
- handleComplete() {
149
- if (!this.isCurrentStepValid()) {
150
- return;
151
- }
152
- this.oncompleted.emit();
870
+ /**
871
+ * Navigates to previous step and emits onPrevious event
872
+ * @emits onPrevious
873
+ * @example
874
+ * // Manually trigger previous step
875
+ * previousStep() {
876
+ * this.wizardService.previousStep();
877
+ * this.onPrevious.emit();
878
+ * }
879
+ */
880
+ handlePrevious() {
881
+ this.wizardService.previousStep();
882
+ this.onPrevious.emit();
153
883
  }
154
- handleStepStatusChange(step) {
155
- this.contents().forEach((s) => {
156
- if (s.step() < step.step()) {
157
- s.status.set('completed');
158
- return;
159
- }
160
- if (s.step() > step.step()) {
161
- s.status.set('pending');
162
- return;
163
- }
164
- if (s.step() === step.step() && !step.isValid()) {
165
- s.status.set('in progress');
166
- return;
167
- }
168
- if (s.step() === step.step() && step.isValid()) {
169
- s.status.set('completed');
170
- return;
171
- }
172
- });
884
+ /**
885
+ * Navigates to next valid step and emits onNext event
886
+ * @emits onNext
887
+ * @example
888
+ * // Custom next step handler
889
+ * handleNext() {
890
+ * if (form.valid) {
891
+ * this.wizardService.nextStep();
892
+ * this.onNext.emit();
893
+ * }
894
+ * }
895
+ */
896
+ handleNext() {
897
+ this.wizardService.nextStep();
898
+ this.onNext.emit();
173
899
  }
174
- getStepClasses(currentStep, step) {
175
- const outerClasses = cn({
176
- 'border-primary currentStep': currentStep === step.step() && (step.status() === 'in progress' || step.status() === 'completed'),
177
- 'border-primary notCurrentStep': currentStep !== step.step() && step.status() === 'completed',
178
- 'border-secondary notCurrentStep': currentStep !== step.step() && step.status() === 'pending',
179
- });
180
- const innerClasses = cn({
181
- 'bg-primary currentStep': currentStep === step.step() && (step.status() === 'in progress' || step.status() === 'completed'),
182
- 'bg-primary notCurrentStep': currentStep !== step.step() && step.status() === 'completed',
183
- 'bg-secondary notCurrentStep': currentStep !== step.step() && step.status() === 'pending',
184
- });
185
- return { outerClasses, innerClasses };
900
+ /**
901
+ * Completes wizard flow and emits onComplete event
902
+ * @emits onComplete
903
+ * @example
904
+ * // Final step handler
905
+ * handleComplete() {
906
+ * if (allStepsValid) {
907
+ * this.onComplete.emit();
908
+ * }
909
+ * }
910
+ */
911
+ handleComplete() {
912
+ this.onComplete.emit();
186
913
  }
187
914
  static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardWrapperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
188
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: WizardWrapperComponent, isStandalone: true, selector: "st-wizard", inputs: { currentStep: { classPropertyName: "currentStep", publicName: "currentStep", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { currentStep: "currentStepChange", onBack: "onBack", oncompleted: "oncompleted" }, queries: [{ propertyName: "contents", predicate: WizardContentComponent, isSignal: true }], ngImport: i0, template: "@let contentsVar = contents();\n@let currentStepVar = currentStep();\n\n<div class=\"flex flex-col gap-5\">\n\t<ul class=\"flex gap-4 px-[20%] pt-6\">\n\t\t@for (content of contentsVar; track $index) {\n\t\t\t<li [ngClass]=\"{ 'flex-1': contentsVar.length - 1 !== $index }\">\n\t\t\t\t<div class=\"flex items-center gap-4\">\n\t\t\t\t\t<st-wizard-step [currentStep]=\"currentStepVar\" [content]=\"content\" [status]=\"content.status()\"></st-wizard-step>\n\t\t\t\t\t@if (contentsVar.length - 1 !== $index) {\n\t\t\t\t\t\t<div class=\"flex flex-1 flex-col justify-center\">\n\t\t\t\t\t\t\t<div class=\"flex -translate-y-6 justify-center\">\n\t\t\t\t\t\t\t\t<st-wizard-marker [content]=\"content\"></st-wizard-marker>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<st-wizard-sub-step [currentStep]=\"currentStepVar\" [content]=\"content\"></st-wizard-sub-step>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"w-[50px]\">\n\t\t\t\t\t<div class=\"flex max-w-fit flex-col items-center text-secondary\">\n\t\t\t\t\t\t<div class=\"min-w-max\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">{{ content.name() }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"min-w-max\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ content.label() }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t}\n\t</ul>\n\n\t<div>\n\t\t<ng-content></ng-content>\n\t</div>\n\n\t<div class=\"flex items-center justify-center gap-5\">\n\t\t@if (isFirstStep()) {\n\t\t\t<div class=\"w-60\">\n\t\t\t\t<st-button variant=\"secondary\" (click)=\"handleBack()\" [block]=\"true\">{{ 'sdk.wizard.wizardWrapper.back' | translate }}</st-button>\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<div class=\"w-60\">\n\t\t\t\t<st-button [icon]=\"icon\" variant=\"secondary\" (click)=\"handlePreviousStep()\" [block]=\"true\">{{\n\t\t\t\t\t'sdk.wizard.wizardWrapper.previous' | translate\n\t\t\t\t}}</st-button>\n\t\t\t</div>\n\t\t}\n\t\t@if (isLastStep()) {\n\t\t\t<div class=\"w-60\">\n\t\t\t\t<st-button [disabled]=\"!allStepsAreValid()\" variant=\"secondary\" (click)=\"handleComplete()\" [block]=\"true\">{{\n\t\t\t\t\t'sdk.wizard.wizardWrapper.end' | translate\n\t\t\t\t}}</st-button>\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<div class=\"w-60\">\n\t\t\t\t<st-button [disabled]=\"!isCurrentStepValid()\" (click)=\"handleNextStep()\" [block]=\"true\">{{\n\t\t\t\t\t'sdk.wizard.wizardWrapper.next' | translate\n\t\t\t\t}}</st-button>\n\t\t\t</div>\n\t\t}\n\t</div>\n</div>\n", dependencies: [{ kind: "component", type: WizardStepComponent, selector: "st-wizard-step", inputs: ["status", "content", "currentStep"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "block", "loader", "size", "shadow", "icon", "iconPosition", "type", "disabled"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "component", type: WizardMarkerComponent, selector: "st-wizard-marker", inputs: ["content"] }, { kind: "component", type: WizardSubStepComponent, selector: "st-wizard-sub-step", inputs: ["content", "currentStep"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
915
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", 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 } }, outputs: { onBack: "onBack", onPrevious: "onPrevious", onNext: "onNext", onComplete: "onComplete" }, queries: [{ propertyName: "contents", predicate: WizardContentComponent, isSignal: true }], ngImport: i0, 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 p-6 shadow-main': card() && varinatVar === 'horizontal' }\"\n>\n\t<!-- Steps -->\n\t@if (varinatVar === 'horizontal') {\n\t\t<ul class=\"flex gap-4 px-[20%] pt-6\">\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 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 typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'medium'\">{{ step.label }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"relative -top-1 min-w-max text-secondary\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">\n\t\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\t>\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 grid-flow-row gap-4\" [ngClass]=\"{ 'rounded-box bg-base-200 p-6 shadow-main': card() }\">\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<!-- step pogress -->\n\t\t\t\t\t<div class=\"grid h-full grid-rows-[min-content_2fr] 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 typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'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=\"relative -top-1 min-w-max text-neutral\">\n\t\t\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">\n\t\t\t\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\t\t\t>\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 h-full min-h-full flex-col justify-center\">\n\t\t\t\t\t\t\t\t<st-wizard-sub-step class=\"h-full min-h-full\" 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 p-6 shadow-main': 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 justify-end gap-3\">\n\t\t\t\t@if (wizardService.isCurrentStepFirst()) {\n\t\t\t\t\t<st-button variant=\"secondary\" [icon]=\"iconReturn\" (click)=\"handleBack()\">{{ 'sdk.wizard.wizardWrapper.back' | translate }}</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button [icon]=\"iconChevronLeft\" variant=\"secondary\" (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 [icon]=\"iconSave\" [disabled]=\"!wizardService.areAllStepsValid()\" variant=\"primary\" (click)=\"handleComplete()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.end' | translate\n\t\t\t\t\t}}</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button [icon]=\"iconChevronRight\" iconPosition=\"right\" [disabled]=\"!wizardService.currentStep().isValid\" (click)=\"handleNext()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.next' | translate\n\t\t\t\t\t}}</st-button>\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: WizardStepComponent, selector: "st-wizard-step", inputs: ["icon", "status", "stepIndex"] }, { kind: "component", type: ButtonComponent, selector: "st-button", inputs: ["variant", "ghost", "outline", "circle", "square", "glass", "block", "loader", "size", "shadow", "icon", "iconPosition", "type", "disabled"] }, { kind: "directive", type: NgClass, selector: "[ngClass]", inputs: ["class", "ngClass"] }, { kind: "directive", type: TypographyDirective, selector: "[typography]", inputs: ["tyVariant", "tyColor", "tyFontWeight", "tyTextOverflow"] }, { kind: "component", type: WizardMarkerComponent, selector: "st-wizard-marker", inputs: ["status"] }, { kind: "component", type: WizardSubStepComponent, selector: "st-wizard-sub-step", inputs: ["variant", "stepIndex", "stepStatus"] }, { kind: "pipe", type: TranslatePipe, name: "translate" }] });
189
916
  }
190
917
  i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardWrapperComponent, decorators: [{
191
918
  type: Component,
192
- args: [{ selector: 'st-wizard', standalone: true, imports: [WizardStepComponent, ButtonComponent, NgClass, TypographyDirective, WizardMarkerComponent, WizardSubStepComponent, TranslatePipe], template: "@let contentsVar = contents();\n@let currentStepVar = currentStep();\n\n<div class=\"flex flex-col gap-5\">\n\t<ul class=\"flex gap-4 px-[20%] pt-6\">\n\t\t@for (content of contentsVar; track $index) {\n\t\t\t<li [ngClass]=\"{ 'flex-1': contentsVar.length - 1 !== $index }\">\n\t\t\t\t<div class=\"flex items-center gap-4\">\n\t\t\t\t\t<st-wizard-step [currentStep]=\"currentStepVar\" [content]=\"content\" [status]=\"content.status()\"></st-wizard-step>\n\t\t\t\t\t@if (contentsVar.length - 1 !== $index) {\n\t\t\t\t\t\t<div class=\"flex flex-1 flex-col justify-center\">\n\t\t\t\t\t\t\t<div class=\"flex -translate-y-6 justify-center\">\n\t\t\t\t\t\t\t\t<st-wizard-marker [content]=\"content\"></st-wizard-marker>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<st-wizard-sub-step [currentStep]=\"currentStepVar\" [content]=\"content\"></st-wizard-sub-step>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t}\n\t\t\t\t</div>\n\t\t\t\t<div class=\"w-[50px]\">\n\t\t\t\t\t<div class=\"flex max-w-fit flex-col items-center text-secondary\">\n\t\t\t\t\t\t<div class=\"min-w-max\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">{{ content.name() }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t\t<div class=\"min-w-max\">\n\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'normal'\">{{ content.label() }}</span>\n\t\t\t\t\t\t</div>\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t</li>\n\t\t}\n\t</ul>\n\n\t<div>\n\t\t<ng-content></ng-content>\n\t</div>\n\n\t<div class=\"flex items-center justify-center gap-5\">\n\t\t@if (isFirstStep()) {\n\t\t\t<div class=\"w-60\">\n\t\t\t\t<st-button variant=\"secondary\" (click)=\"handleBack()\" [block]=\"true\">{{ 'sdk.wizard.wizardWrapper.back' | translate }}</st-button>\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<div class=\"w-60\">\n\t\t\t\t<st-button [icon]=\"icon\" variant=\"secondary\" (click)=\"handlePreviousStep()\" [block]=\"true\">{{\n\t\t\t\t\t'sdk.wizard.wizardWrapper.previous' | translate\n\t\t\t\t}}</st-button>\n\t\t\t</div>\n\t\t}\n\t\t@if (isLastStep()) {\n\t\t\t<div class=\"w-60\">\n\t\t\t\t<st-button [disabled]=\"!allStepsAreValid()\" variant=\"secondary\" (click)=\"handleComplete()\" [block]=\"true\">{{\n\t\t\t\t\t'sdk.wizard.wizardWrapper.end' | translate\n\t\t\t\t}}</st-button>\n\t\t\t</div>\n\t\t} @else {\n\t\t\t<div class=\"w-60\">\n\t\t\t\t<st-button [disabled]=\"!isCurrentStepValid()\" (click)=\"handleNextStep()\" [block]=\"true\">{{\n\t\t\t\t\t'sdk.wizard.wizardWrapper.next' | translate\n\t\t\t\t}}</st-button>\n\t\t\t</div>\n\t\t}\n\t</div>\n</div>\n" }]
919
+ args: [{ selector: 'st-wizard', standalone: true, imports: [WizardStepComponent, ButtonComponent, NgClass, TypographyDirective, WizardMarkerComponent, WizardSubStepComponent, TranslatePipe], 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 p-6 shadow-main': card() && varinatVar === 'horizontal' }\"\n>\n\t<!-- Steps -->\n\t@if (varinatVar === 'horizontal') {\n\t\t<ul class=\"flex gap-4 px-[20%] pt-6\">\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 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 typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'medium'\">{{ step.label }}</span>\n\t\t\t\t\t\t\t</div>\n\t\t\t\t\t\t\t<div class=\"relative -top-1 min-w-max text-secondary\">\n\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">\n\t\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\t>\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 grid-flow-row gap-4\" [ngClass]=\"{ 'rounded-box bg-base-200 p-6 shadow-main': card() }\">\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<!-- step pogress -->\n\t\t\t\t\t<div class=\"grid h-full grid-rows-[min-content_2fr] 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 typography [tyVariant]=\"'body-sm'\" [tyColor]=\"'base'\" [tyFontWeight]=\"'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=\"relative -top-1 min-w-max text-neutral\">\n\t\t\t\t\t\t\t\t\t\t<span typography [tyVariant]=\"'body-xs'\" [tyColor]=\"'inherit'\" [tyFontWeight]=\"'normal'\">\n\t\t\t\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\t\t\t>\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 h-full min-h-full flex-col justify-center\">\n\t\t\t\t\t\t\t\t<st-wizard-sub-step class=\"h-full min-h-full\" 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 p-6 shadow-main': 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 justify-end gap-3\">\n\t\t\t\t@if (wizardService.isCurrentStepFirst()) {\n\t\t\t\t\t<st-button variant=\"secondary\" [icon]=\"iconReturn\" (click)=\"handleBack()\">{{ 'sdk.wizard.wizardWrapper.back' | translate }}</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button [icon]=\"iconChevronLeft\" variant=\"secondary\" (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 [icon]=\"iconSave\" [disabled]=\"!wizardService.areAllStepsValid()\" variant=\"primary\" (click)=\"handleComplete()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.end' | translate\n\t\t\t\t\t}}</st-button>\n\t\t\t\t} @else {\n\t\t\t\t\t<st-button [icon]=\"iconChevronRight\" iconPosition=\"right\" [disabled]=\"!wizardService.currentStep().isValid\" (click)=\"handleNext()\">{{\n\t\t\t\t\t\t'sdk.wizard.wizardWrapper.next' | translate\n\t\t\t\t\t}}</st-button>\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" }]
193
920
  }] });
194
921
 
195
- class WizardContentComponent {
196
- wizard;
197
- step = input(0);
198
- name = input('');
199
- status = model.required();
200
- isValid = model.required();
201
- label = input('');
202
- classes = input('');
203
- currentStep = computed(() => this.wizard.currentStep());
204
- isStepActive = computed(() => this.step() === this.currentStep());
205
- constructor(wizard) {
206
- this.wizard = wizard;
207
- }
208
- get componentClass() {
209
- return cn('animate-fade-in animate-duration-300', this.classes());
210
- }
211
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardContentComponent, deps: [{ token: WizardWrapperComponent, host: true }], target: i0.ɵɵFactoryTarget.Component });
212
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "18.2.12", type: WizardContentComponent, isStandalone: true, selector: "st-wizard-content", inputs: { step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: false, transformFunction: null }, name: { classPropertyName: "name", publicName: "name", isSignal: true, isRequired: false, transformFunction: null }, status: { classPropertyName: "status", publicName: "status", isSignal: true, isRequired: true, transformFunction: null }, isValid: { classPropertyName: "isValid", publicName: "isValid", isSignal: true, isRequired: true, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, classes: { classPropertyName: "classes", publicName: "classes", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { status: "statusChange", isValid: "isValidChange" }, ngImport: i0, template: "@if (this.isStepActive()) {\n\t<div [class]=\"componentClass\">\n\t\t<ng-content></ng-content>\n\t</div>\n}\n" });
213
- }
214
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "18.2.12", ngImport: i0, type: WizardContentComponent, decorators: [{
215
- type: Component,
216
- args: [{ selector: 'st-wizard-content', standalone: true, imports: [], template: "@if (this.isStepActive()) {\n\t<div [class]=\"componentClass\">\n\t\t<ng-content></ng-content>\n\t</div>\n}\n" }]
217
- }], ctorParameters: () => [{ type: WizardWrapperComponent, decorators: [{
218
- type: Host
219
- }] }] });
220
-
221
922
  /**
222
923
  * Generated bundle index. Do not edit.
223
924
  */
224
925
 
225
- export { WizardContentComponent, WizardMarkerComponent, WizardStepComponent, WizardSubStepComponent, WizardWrapperComponent };
926
+ export { WIZARD_STEP_STATUS, WizardActionsComponent, WizardContentComponent, WizardService, WizardWrapperComponent };
226
927
  //# sourceMappingURL=sixbell-telco-sdk-components-wizard.mjs.map