@su-labs/stepper 21.0.0 → 22.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [22.1.0] - 2026-11-17
9
+
10
+ ### Added
11
+ - `completed` on `su-lib-step` shows a step as completed whatever the user does, e.g. for levels or forms done earlier
12
+
13
+ ### Changed
14
+ - Uses `@su-labs/core` 1.11.0 (was 1.10.0), the same version as every other `@su-labs` package, so apps using several of them install core once
15
+
8
16
  ## [22.0.0] - 2026-11-17
9
17
 
10
18
  ### Added
package/README.md CHANGED
@@ -16,10 +16,10 @@ Content split into steps shown one at a time, for Angular:
16
16
  ## Installation
17
17
 
18
18
  ```bash
19
- npm install @su-labs/stepper@ng21
19
+ npm install @su-labs/stepper
20
20
  ```
21
21
 
22
- This is the Angular 21 version. For the newest Angular, install `@su-labs/stepper` without a tag.
22
+ On Angular 19, 20 or 21, install the matching version: `npm install @su-labs/stepper@ng19`, `@ng20` or `@ng21`.
23
23
 
24
24
  ## Usage
25
25
 
@@ -41,7 +41,7 @@ import { SuStepComponent, SuStepperComponent } from '@su-labs/stepper';
41
41
  </su-lib-stepper>
42
42
  ```
43
43
 
44
- Leave `label` out to show only the step's number. A step is completed once the user leaves it forward, as long as it still allows going forward.
44
+ Leave `label` out to show only the step's number. A step is completed once the user leaves it forward, as long as it still allows going forward, or when you set its `completed`.
45
45
 
46
46
  ### Stepper
47
47
 
@@ -71,6 +71,7 @@ To use your own buttons, set `[controls]="false"` and call the methods through a
71
71
  | `canNext` | `true` | The user may go forward from this step |
72
72
  | `canBack` | `true` | The user may go back from this step |
73
73
  | `disabled` | `false` | The step can't be visited; Back and Next skip it |
74
+ | `completed` | `false` | Shows the step as completed whatever the user does, e.g. for work saved earlier |
74
75
 
75
76
  A jump from a step header checks every step it passes: forward, each one's `canNext`; back, each one's `canBack`.
76
77
 
@@ -1,201 +1,573 @@
1
- import * as i0 from '@angular/core';
2
- import { InjectionToken, input, booleanAttribute, computed, inject, ElementRef, ChangeDetectionStrategy, Component, model, contentChildren, signal, viewChildren, DestroyRef, effect, untracked, afterRenderEffect } from '@angular/core';
3
- import { SuStepperController, SU_STEPPER_LABELS } from '@su-labs/core/stepper';
4
-
5
- const SU_STEPPER = new InjectionToken('SU_STEPPER');
6
-
7
- /**
8
- * One step of `su-lib-stepper`: its content shows while it's the current step. Its rules say when the user may leave
9
- * it, e.g. `[canNext]="form.valid"`.
10
- */
11
- class SuStepComponent {
12
- /** The text beside the step's number; without it, only the number shows */
13
- label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
14
- /** The user may go forward from this step, e.g. once its form is valid @default true */
15
- canNext = input(true, { ...(ngDevMode ? { debugName: "canNext" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
16
- /** The user may go back from this step @default true */
17
- canBack = input(true, { ...(ngDevMode ? { debugName: "canBack" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
18
- /** The step can't be visited; moving forward or back skips it @default false */
19
- disabled = input(false, { ...(ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
20
- /** The step's options for `SuStepperController` */
21
- options = computed(() => ({
22
- label: this.label(),
23
- canNext: this.canNext(),
24
- canBack: this.canBack(),
25
- disabled: this.disabled(),
26
- }), ...(ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []));
27
- stepper = inject(SU_STEPPER);
28
- host = inject(ElementRef);
29
- index = computed(() => this.stepper.steps().indexOf(this), ...(ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []));
30
- isCurrent = computed(() => this.index() === this.stepper.current(), ...(ngDevMode ? [{ debugName: "isCurrent" }] : /* istanbul ignore next */ []));
31
- panelId = computed(() => this.stepper.panelId(this.index()), ...(ngDevMode ? [{ debugName: "panelId" }] : /* istanbul ignore next */ []));
32
- headerId = computed(() => this.stepper.headerId(this.index()), ...(ngDevMode ? [{ debugName: "headerId" }] : /* istanbul ignore next */ []));
33
- /** Moves keyboard focus to the step's content */
34
- focus() {
35
- this.host.nativeElement.focus();
36
- }
37
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
38
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "21.2.26", type: SuStepComponent, isStandalone: true, selector: "su-lib-step", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, canNext: { classPropertyName: "canNext", publicName: "canNext", isSignal: true, isRequired: false, transformFunction: null }, canBack: { classPropertyName: "canBack", publicName: "canBack", isSignal: true, isRequired: false, transformFunction: null }, disabled: { classPropertyName: "disabled", publicName: "disabled", isSignal: true, isRequired: false, transformFunction: null } }, host: { attributes: { "tabindex": "-1" }, properties: { "id": "panelId()", "attr.role": "stepper.tabs() ? 'tabpanel' : 'group'", "attr.aria-labelledby": "headerId()", "hidden": "!isCurrent()" }, classAttribute: "su-stepper-panel" }, ngImport: i0, template: "<ng-content />\n", styles: [":host{border-radius:var(--su-stepper-panel-radius, .5rem);display:block;outline:none;padding:var(--su-stepper-panel-padding, 1rem 0)}:host:focus-visible{outline:var(--su-stepper-focus-ring, 2px solid currentColor);outline-offset:2px}:host([hidden]){display:none}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
39
- }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuStepComponent, decorators: [{
41
- type: Component,
42
- args: [{ selector: 'su-lib-step', changeDetection: ChangeDetectionStrategy.OnPush, host: {
43
- class: 'su-stepper-panel',
44
- tabindex: '-1',
45
- '[id]': 'panelId()',
46
- '[attr.role]': "stepper.tabs() ? 'tabpanel' : 'group'",
47
- '[attr.aria-labelledby]': 'headerId()',
48
- '[hidden]': '!isCurrent()',
49
- }, template: "<ng-content />\n", styles: [":host{border-radius:var(--su-stepper-panel-radius, .5rem);display:block;outline:none;padding:var(--su-stepper-panel-padding, 1rem 0)}:host:focus-visible{outline:var(--su-stepper-focus-ring, 2px solid currentColor);outline-offset:2px}:host([hidden]){display:none}\n"] }]
50
- }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], canNext: [{ type: i0.Input, args: [{ isSignal: true, alias: "canNext", required: false }] }], canBack: [{ type: i0.Input, args: [{ isSignal: true, alias: "canBack", required: false }] }], disabled: [{ type: i0.Input, args: [{ isSignal: true, alias: "disabled", required: false }] }] } });
51
-
52
- /** A step's circle with its number and its label, with the step's place and state for screen readers */
53
- class SuStepperHeaderComponent {
54
- step = input.required(...(ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []));
55
- count = input.required(...(ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []));
56
- labels = input.required(...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
57
- description = computed(() => {
58
- const step = this.step();
59
- const labels = this.labels();
60
- return [
61
- labels.step(step.number, this.count()),
62
- step.label,
63
- step.completed ? labels.completed : null,
64
- step.disabled ? labels.unavailable : null,
65
- ]
66
- .filter(part => part !== null)
67
- .join(', ');
68
- }, ...(ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []));
69
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuStepperHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: SuStepperHeaderComponent, isStandalone: true, selector: "su-lib-stepper-header", inputs: { step: { classPropertyName: "step", publicName: "step", isSignal: true, isRequired: true, transformFunction: null }, count: { classPropertyName: "count", publicName: "count", isSignal: true, isRequired: true, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: true, transformFunction: null } }, host: { properties: { "class.is-current": "step().current", "class.is-completed": "step().completed", "class.is-visited": "step().visited", "class.is-disabled": "step().disabled" }, classAttribute: "su-stepper-header-content" }, ngImport: i0, template: "<span class=\"su-stepper-marker\" aria-hidden=\"true\">{{ step().number }}</span>\n@if (step().label; as label) {\n <span class=\"su-stepper-label\" aria-hidden=\"true\">{{ label }}</span>\n}\n<span class=\"su-stepper-visually-hidden\">{{ description() }}</span>\n", styles: [":host{align-items:center;display:inline-flex;gap:var(--su-stepper-label-gap, .5rem);min-width:0}.su-stepper-marker{align-items:center;background:var(--su-stepper-marker-background, transparent);border:var(--su-stepper-marker-border, 2px solid rgba(0, 0, 0, .2));border-radius:50%;box-sizing:border-box;color:var(--su-stepper-marker-color, inherit);display:inline-flex;flex:none;font-size:var(--su-stepper-marker-font-size, .875rem);font-variant-numeric:tabular-nums;font-weight:600;height:var(--su-stepper-marker-size, 2rem);justify-content:center;transition:background-color .2s ease,border-color .2s ease,color .2s ease;width:var(--su-stepper-marker-size, 2rem)}.su-stepper-label{color:var(--su-stepper-label-color, inherit);font-size:var(--su-stepper-label-font-size, .95rem);overflow-wrap:anywhere}:host(.is-current) .su-stepper-marker{background:var(--su-stepper-current-background, transparent);border-color:var(--su-stepper-accent, #2563eb);color:var(--su-stepper-current-color, var(--su-stepper-accent, #2563eb))}:host(.is-current) .su-stepper-label{color:var(--su-stepper-current-label-color, inherit);font-weight:var(--su-stepper-current-label-weight, 600)}:host(.is-completed) .su-stepper-marker{background:var(--su-stepper-accent, #2563eb);border-color:var(--su-stepper-accent, #2563eb);color:var(--su-stepper-accent-text, #ffffff)}:host(.is-disabled){opacity:var(--su-stepper-disabled-opacity, .45)}.su-stepper-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:reduce){.su-stepper-marker{transition:none}}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
71
- }
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuStepperHeaderComponent, decorators: [{
73
- type: Component,
74
- args: [{ selector: 'su-lib-stepper-header', changeDetection: ChangeDetectionStrategy.OnPush, host: {
75
- class: 'su-stepper-header-content',
76
- '[class.is-current]': 'step().current',
77
- '[class.is-completed]': 'step().completed',
78
- '[class.is-visited]': 'step().visited',
79
- '[class.is-disabled]': 'step().disabled',
80
- }, template: "<span class=\"su-stepper-marker\" aria-hidden=\"true\">{{ step().number }}</span>\n@if (step().label; as label) {\n <span class=\"su-stepper-label\" aria-hidden=\"true\">{{ label }}</span>\n}\n<span class=\"su-stepper-visually-hidden\">{{ description() }}</span>\n", styles: [":host{align-items:center;display:inline-flex;gap:var(--su-stepper-label-gap, .5rem);min-width:0}.su-stepper-marker{align-items:center;background:var(--su-stepper-marker-background, transparent);border:var(--su-stepper-marker-border, 2px solid rgba(0, 0, 0, .2));border-radius:50%;box-sizing:border-box;color:var(--su-stepper-marker-color, inherit);display:inline-flex;flex:none;font-size:var(--su-stepper-marker-font-size, .875rem);font-variant-numeric:tabular-nums;font-weight:600;height:var(--su-stepper-marker-size, 2rem);justify-content:center;transition:background-color .2s ease,border-color .2s ease,color .2s ease;width:var(--su-stepper-marker-size, 2rem)}.su-stepper-label{color:var(--su-stepper-label-color, inherit);font-size:var(--su-stepper-label-font-size, .95rem);overflow-wrap:anywhere}:host(.is-current) .su-stepper-marker{background:var(--su-stepper-current-background, transparent);border-color:var(--su-stepper-accent, #2563eb);color:var(--su-stepper-current-color, var(--su-stepper-accent, #2563eb))}:host(.is-current) .su-stepper-label{color:var(--su-stepper-current-label-color, inherit);font-weight:var(--su-stepper-current-label-weight, 600)}:host(.is-completed) .su-stepper-marker{background:var(--su-stepper-accent, #2563eb);border-color:var(--su-stepper-accent, #2563eb);color:var(--su-stepper-accent-text, #ffffff)}:host(.is-disabled){opacity:var(--su-stepper-disabled-opacity, .45)}.su-stepper-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:reduce){.su-stepper-marker{transition:none}}\n"] }]
81
- }], propDecorators: { step: [{ type: i0.Input, args: [{ isSignal: true, alias: "step", required: true }] }], count: [{ type: i0.Input, args: [{ isSignal: true, alias: "count", required: true }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: true }] }] } });
82
-
1
+ import * as i0 from "@angular/core";
2
+ import { ChangeDetectionStrategy, Component, DestroyRef, ElementRef, InjectionToken, afterRenderEffect, booleanAttribute, computed, contentChildren, effect, inject, input, model, signal, untracked, viewChildren } from "@angular/core";
3
+ import { SU_STEPPER_LABELS, SuStepperController } from "@su-labs/core/stepper";
4
+ const SU_STEPPER = new InjectionToken("SU_STEPPER");
5
+ var SuStepComponent = class SuStepComponent {
6
+ label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
7
+ canNext = input(true, {
8
+ ...ngDevMode ? { debugName: "canNext" } : /* istanbul ignore next */ {},
9
+ transform: booleanAttribute
10
+ });
11
+ canBack = input(true, {
12
+ ...ngDevMode ? { debugName: "canBack" } : /* istanbul ignore next */ {},
13
+ transform: booleanAttribute
14
+ });
15
+ disabled = input(false, {
16
+ ...ngDevMode ? { debugName: "disabled" } : /* istanbul ignore next */ {},
17
+ transform: booleanAttribute
18
+ });
19
+ completed = input(false, {
20
+ ...ngDevMode ? { debugName: "completed" } : /* istanbul ignore next */ {},
21
+ transform: booleanAttribute
22
+ });
23
+ options = computed(() => ({
24
+ label: this.label(),
25
+ canNext: this.canNext(),
26
+ canBack: this.canBack(),
27
+ disabled: this.disabled(),
28
+ completed: this.completed()
29
+ }), ...ngDevMode ? [{ debugName: "options" }] : /* istanbul ignore next */ []);
30
+ stepper = inject(SU_STEPPER);
31
+ host = inject(ElementRef);
32
+ index = computed(() => this.stepper.steps().indexOf(this), ...ngDevMode ? [{ debugName: "index" }] : /* istanbul ignore next */ []);
33
+ isCurrent = computed(() => this.index() === this.stepper.current(), ...ngDevMode ? [{ debugName: "isCurrent" }] : /* istanbul ignore next */ []);
34
+ panelId = computed(() => this.stepper.panelId(this.index()), ...ngDevMode ? [{ debugName: "panelId" }] : /* istanbul ignore next */ []);
35
+ headerId = computed(() => this.stepper.headerId(this.index()), ...ngDevMode ? [{ debugName: "headerId" }] : /* istanbul ignore next */ []);
36
+ focus() {
37
+ this.host.nativeElement.focus();
38
+ }
39
+ static ɵfac = i0.ɵɵngDeclareFactory({
40
+ minVersion: "12.0.0",
41
+ version: "22.2.4",
42
+ ngImport: i0,
43
+ type: SuStepComponent,
44
+ deps: [],
45
+ target: i0.ɵɵFactoryTarget.Component
46
+ });
47
+ static ɵcmp = i0.ɵɵngDeclareComponent({
48
+ minVersion: "17.1.0",
49
+ version: "22.2.4",
50
+ type: SuStepComponent,
51
+ isStandalone: true,
52
+ selector: "su-lib-step",
53
+ inputs: {
54
+ label: {
55
+ classPropertyName: "label",
56
+ publicName: "label",
57
+ isSignal: true,
58
+ isRequired: false,
59
+ transformFunction: null
60
+ },
61
+ canNext: {
62
+ classPropertyName: "canNext",
63
+ publicName: "canNext",
64
+ isSignal: true,
65
+ isRequired: false,
66
+ transformFunction: null
67
+ },
68
+ canBack: {
69
+ classPropertyName: "canBack",
70
+ publicName: "canBack",
71
+ isSignal: true,
72
+ isRequired: false,
73
+ transformFunction: null
74
+ },
75
+ disabled: {
76
+ classPropertyName: "disabled",
77
+ publicName: "disabled",
78
+ isSignal: true,
79
+ isRequired: false,
80
+ transformFunction: null
81
+ },
82
+ completed: {
83
+ classPropertyName: "completed",
84
+ publicName: "completed",
85
+ isSignal: true,
86
+ isRequired: false,
87
+ transformFunction: null
88
+ }
89
+ },
90
+ host: {
91
+ attributes: { "tabindex": "-1" },
92
+ properties: {
93
+ "id": "panelId()",
94
+ "attr.role": "stepper.tabs() ? 'tabpanel' : 'group'",
95
+ "attr.aria-labelledby": "headerId()",
96
+ "hidden": "!isCurrent()"
97
+ },
98
+ classAttribute: "su-stepper-panel"
99
+ },
100
+ ngImport: i0,
101
+ template: "<ng-content />\n",
102
+ styles: [":host{border-radius:var(--su-stepper-panel-radius, .5rem);display:block;outline:none;padding:var(--su-stepper-panel-padding, 1rem 0)}:host:focus-visible{outline:var(--su-stepper-focus-ring, 2px solid currentColor);outline-offset:2px}:host([hidden]){display:none}\n"],
103
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
104
+ });
105
+ };
106
+ i0.ɵɵngDeclareClassMetadata({
107
+ minVersion: "12.0.0",
108
+ version: "22.2.4",
109
+ ngImport: i0,
110
+ type: SuStepComponent,
111
+ decorators: [{
112
+ type: Component,
113
+ args: [{
114
+ selector: "su-lib-step",
115
+ changeDetection: ChangeDetectionStrategy.OnPush,
116
+ host: {
117
+ class: "su-stepper-panel",
118
+ tabindex: "-1",
119
+ "[id]": "panelId()",
120
+ "[attr.role]": "stepper.tabs() ? 'tabpanel' : 'group'",
121
+ "[attr.aria-labelledby]": "headerId()",
122
+ "[hidden]": "!isCurrent()"
123
+ },
124
+ template: "<ng-content />\n",
125
+ styles: [":host{border-radius:var(--su-stepper-panel-radius, .5rem);display:block;outline:none;padding:var(--su-stepper-panel-padding, 1rem 0)}:host:focus-visible{outline:var(--su-stepper-focus-ring, 2px solid currentColor);outline-offset:2px}:host([hidden]){display:none}\n"]
126
+ }]
127
+ }],
128
+ propDecorators: {
129
+ label: [{
130
+ type: i0.Input,
131
+ args: [{
132
+ isSignal: true,
133
+ alias: "label",
134
+ required: false
135
+ }]
136
+ }],
137
+ canNext: [{
138
+ type: i0.Input,
139
+ args: [{
140
+ isSignal: true,
141
+ alias: "canNext",
142
+ required: false
143
+ }]
144
+ }],
145
+ canBack: [{
146
+ type: i0.Input,
147
+ args: [{
148
+ isSignal: true,
149
+ alias: "canBack",
150
+ required: false
151
+ }]
152
+ }],
153
+ disabled: [{
154
+ type: i0.Input,
155
+ args: [{
156
+ isSignal: true,
157
+ alias: "disabled",
158
+ required: false
159
+ }]
160
+ }],
161
+ completed: [{
162
+ type: i0.Input,
163
+ args: [{
164
+ isSignal: true,
165
+ alias: "completed",
166
+ required: false
167
+ }]
168
+ }]
169
+ }
170
+ });
171
+ var SuStepperHeaderComponent = class SuStepperHeaderComponent {
172
+ step = input.required(...ngDevMode ? [{ debugName: "step" }] : /* istanbul ignore next */ []);
173
+ count = input.required(...ngDevMode ? [{ debugName: "count" }] : /* istanbul ignore next */ []);
174
+ labels = input.required(...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
175
+ description = computed(() => {
176
+ const step = this.step();
177
+ const labels = this.labels();
178
+ return [
179
+ labels.step(step.number, this.count()),
180
+ step.label,
181
+ step.completed ? labels.completed : null,
182
+ step.disabled ? labels.unavailable : null
183
+ ].filter((part) => part !== null).join(", ");
184
+ }, ...ngDevMode ? [{ debugName: "description" }] : /* istanbul ignore next */ []);
185
+ static ɵfac = i0.ɵɵngDeclareFactory({
186
+ minVersion: "12.0.0",
187
+ version: "22.2.4",
188
+ ngImport: i0,
189
+ type: SuStepperHeaderComponent,
190
+ deps: [],
191
+ target: i0.ɵɵFactoryTarget.Component
192
+ });
193
+ static ɵcmp = i0.ɵɵngDeclareComponent({
194
+ minVersion: "17.0.0",
195
+ version: "22.2.4",
196
+ type: SuStepperHeaderComponent,
197
+ isStandalone: true,
198
+ selector: "su-lib-stepper-header",
199
+ inputs: {
200
+ step: {
201
+ classPropertyName: "step",
202
+ publicName: "step",
203
+ isSignal: true,
204
+ isRequired: true,
205
+ transformFunction: null
206
+ },
207
+ count: {
208
+ classPropertyName: "count",
209
+ publicName: "count",
210
+ isSignal: true,
211
+ isRequired: true,
212
+ transformFunction: null
213
+ },
214
+ labels: {
215
+ classPropertyName: "labels",
216
+ publicName: "labels",
217
+ isSignal: true,
218
+ isRequired: true,
219
+ transformFunction: null
220
+ }
221
+ },
222
+ host: {
223
+ properties: {
224
+ "class.is-current": "step().current",
225
+ "class.is-completed": "step().completed",
226
+ "class.is-visited": "step().visited",
227
+ "class.is-disabled": "step().disabled"
228
+ },
229
+ classAttribute: "su-stepper-header-content"
230
+ },
231
+ ngImport: i0,
232
+ template: "<span class=\"su-stepper-marker\" aria-hidden=\"true\">{{ step().number }}</span>\n@if (step().label; as label) {\n <span class=\"su-stepper-label\" aria-hidden=\"true\">{{ label }}</span>\n}\n<span class=\"su-stepper-visually-hidden\">{{ description() }}</span>\n",
233
+ styles: [":host{align-items:center;display:inline-flex;gap:var(--su-stepper-label-gap, .5rem);min-width:0}.su-stepper-marker{align-items:center;background:var(--su-stepper-marker-background, transparent);border:var(--su-stepper-marker-border, 2px solid rgba(0, 0, 0, .2));border-radius:50%;box-sizing:border-box;color:var(--su-stepper-marker-color, inherit);display:inline-flex;flex:none;font-size:var(--su-stepper-marker-font-size, .875rem);font-variant-numeric:tabular-nums;font-weight:600;height:var(--su-stepper-marker-size, 2rem);justify-content:center;transition:background-color .2s ease,border-color .2s ease,color .2s ease;width:var(--su-stepper-marker-size, 2rem)}.su-stepper-label{color:var(--su-stepper-label-color, inherit);font-size:var(--su-stepper-label-font-size, .95rem);overflow-wrap:anywhere}:host(.is-current) .su-stepper-marker{background:var(--su-stepper-current-background, transparent);border-color:var(--su-stepper-accent, #2563eb);color:var(--su-stepper-current-color, var(--su-stepper-accent, #2563eb))}:host(.is-current) .su-stepper-label{color:var(--su-stepper-current-label-color, inherit);font-weight:var(--su-stepper-current-label-weight, 600)}:host(.is-completed) .su-stepper-marker{background:var(--su-stepper-accent, #2563eb);border-color:var(--su-stepper-accent, #2563eb);color:var(--su-stepper-accent-text, #ffffff)}:host(.is-disabled){opacity:var(--su-stepper-disabled-opacity, .45)}.su-stepper-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:reduce){.su-stepper-marker{transition:none}}\n"],
234
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
235
+ });
236
+ };
237
+ i0.ɵɵngDeclareClassMetadata({
238
+ minVersion: "12.0.0",
239
+ version: "22.2.4",
240
+ ngImport: i0,
241
+ type: SuStepperHeaderComponent,
242
+ decorators: [{
243
+ type: Component,
244
+ args: [{
245
+ selector: "su-lib-stepper-header",
246
+ changeDetection: ChangeDetectionStrategy.OnPush,
247
+ host: {
248
+ class: "su-stepper-header-content",
249
+ "[class.is-current]": "step().current",
250
+ "[class.is-completed]": "step().completed",
251
+ "[class.is-visited]": "step().visited",
252
+ "[class.is-disabled]": "step().disabled"
253
+ },
254
+ template: "<span class=\"su-stepper-marker\" aria-hidden=\"true\">{{ step().number }}</span>\n@if (step().label; as label) {\n <span class=\"su-stepper-label\" aria-hidden=\"true\">{{ label }}</span>\n}\n<span class=\"su-stepper-visually-hidden\">{{ description() }}</span>\n",
255
+ styles: [":host{align-items:center;display:inline-flex;gap:var(--su-stepper-label-gap, .5rem);min-width:0}.su-stepper-marker{align-items:center;background:var(--su-stepper-marker-background, transparent);border:var(--su-stepper-marker-border, 2px solid rgba(0, 0, 0, .2));border-radius:50%;box-sizing:border-box;color:var(--su-stepper-marker-color, inherit);display:inline-flex;flex:none;font-size:var(--su-stepper-marker-font-size, .875rem);font-variant-numeric:tabular-nums;font-weight:600;height:var(--su-stepper-marker-size, 2rem);justify-content:center;transition:background-color .2s ease,border-color .2s ease,color .2s ease;width:var(--su-stepper-marker-size, 2rem)}.su-stepper-label{color:var(--su-stepper-label-color, inherit);font-size:var(--su-stepper-label-font-size, .95rem);overflow-wrap:anywhere}:host(.is-current) .su-stepper-marker{background:var(--su-stepper-current-background, transparent);border-color:var(--su-stepper-accent, #2563eb);color:var(--su-stepper-current-color, var(--su-stepper-accent, #2563eb))}:host(.is-current) .su-stepper-label{color:var(--su-stepper-current-label-color, inherit);font-weight:var(--su-stepper-current-label-weight, 600)}:host(.is-completed) .su-stepper-marker{background:var(--su-stepper-accent, #2563eb);border-color:var(--su-stepper-accent, #2563eb);color:var(--su-stepper-accent-text, #ffffff)}:host(.is-disabled){opacity:var(--su-stepper-disabled-opacity, .45)}.su-stepper-visually-hidden{clip-path:inset(50%);height:1px;overflow:hidden;position:absolute;white-space:nowrap;width:1px}@media(prefers-reduced-motion:reduce){.su-stepper-marker{transition:none}}\n"]
256
+ }]
257
+ }],
258
+ propDecorators: {
259
+ step: [{
260
+ type: i0.Input,
261
+ args: [{
262
+ isSignal: true,
263
+ alias: "step",
264
+ required: true
265
+ }]
266
+ }],
267
+ count: [{
268
+ type: i0.Input,
269
+ args: [{
270
+ isSignal: true,
271
+ alias: "count",
272
+ required: true
273
+ }]
274
+ }],
275
+ labels: [{
276
+ type: i0.Input,
277
+ args: [{
278
+ isSignal: true,
279
+ alias: "labels",
280
+ required: true
281
+ }]
282
+ }]
283
+ }
284
+ });
83
285
  let nextStepperId = 0;
84
- /** Keys that move focus between the step headers when they act as tabs, and where each one goes */
85
286
  const TAB_KEYS = {
86
- ArrowRight: (index, count) => (index + 1) % count,
87
- ArrowDown: (index, count) => (index + 1) % count,
88
- ArrowLeft: (index, count) => (index - 1 + count) % count,
89
- ArrowUp: (index, count) => (index - 1 + count) % count,
90
- Home: () => 0,
91
- End: (_index, count) => count - 1,
287
+ ArrowRight: (index, count) => (index + 1) % count,
288
+ ArrowDown: (index, count) => (index + 1) % count,
289
+ ArrowLeft: (index, count) => (index - 1 + count) % count,
290
+ ArrowUp: (index, count) => (index - 1 + count) % count,
291
+ Home: () => 0,
292
+ End: (_index, count) => count - 1
92
293
  };
93
- /**
94
- * Content split into steps (`su-lib-step`) shown one at a time, over `SuStepperController` from
95
- * `@su-labs/core/stepper`: a numbered circle per step joined by a line, horizontal or vertical, with Back and Next
96
- * buttons that follow each step's rules. With `tabs`, the step headers act as tabs too, still following the rules.
97
- */
98
- class SuStepperComponent {
99
- /** @default 'horizontal' */
100
- orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []));
101
- /** The step headers act as tabs: clicking one goes to its step, if the rules allow it @default false */
102
- tabs = input(false, { ...(ngDevMode ? { debugName: "tabs" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
103
- /** Going forward by more than one step only reaches steps already visited @default false */
104
- linear = input(false, { ...(ngDevMode ? { debugName: "linear" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
105
- /** Back and Next buttons under the steps; without them, call `next()` and `back()` from your own @default true */
106
- controls = input(true, { ...(ngDevMode ? { debugName: "controls" } : /* istanbul ignore next */ {}), transform: booleanAttribute });
107
- /** The name of the list of steps for screen readers @default labels.steps */
108
- label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : /* istanbul ignore next */ []));
109
- /** Texts to replace, e.g. in the page's language */
110
- labels = input({}, ...(ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []));
111
- /** The step on screen, from 0; setting it shows that step without checking the rules */
112
- current = model(0, ...(ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []));
113
- steps = contentChildren(SuStepComponent, ...(ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []));
114
- controller = new SuStepperController();
115
- state = signal(this.controller.state.get(), ...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
116
- text = computed(() => ({
117
- ...SU_STEPPER_LABELS,
118
- ...this.labels(),
119
- }), ...(ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []));
120
- tabButtons = viewChildren('tab', ...(ngDevMode ? [{ debugName: "tabButtons" }] : /* istanbul ignore next */ []));
121
- /** The step's content takes focus once it renders, after a move the user made with the buttons */
122
- focusPending = false;
123
- id = `su-stepper-${nextStepperId++}`;
124
- constructor() {
125
- const unsubscribe = this.controller.state.subscribe(state => {
126
- this.state.set(state);
127
- this.current.set(state.current);
128
- });
129
- inject(DestroyRef).onDestroy(unsubscribe);
130
- effect(() => {
131
- const steps = this.steps().map(step => step.options());
132
- const linear = this.linear();
133
- const current = this.current();
134
- untracked(() => {
135
- this.controller.setSteps(steps);
136
- this.controller.setLinear(linear);
137
- this.controller.select(current);
138
- });
139
- });
140
- afterRenderEffect(() => {
141
- const current = this.state().current;
142
- if (this.focusPending) {
143
- this.focusPending = false;
144
- untracked(() => this.steps()[current]?.focus());
145
- }
146
- });
147
- }
148
- /** Goes to the next step that isn't disabled, if the current one allows it; returns whether it moved */
149
- next() {
150
- return this.controller.next();
151
- }
152
- /** Goes to the previous step that isn't disabled, if the current one allows it; returns whether it moved */
153
- back() {
154
- return this.controller.back();
155
- }
156
- /** Goes to a step, from 0, if the rules allow it; returns whether it moved */
157
- goTo(index) {
158
- return this.controller.goTo(index);
159
- }
160
- /** Starts over: back to a step (the first by default) with nothing visited or completed */
161
- reset(start = 0) {
162
- this.controller.reset(start);
163
- }
164
- headerId(index) {
165
- return `${this.id}-step-${index}`;
166
- }
167
- panelId(index) {
168
- return `${this.id}-panel-${index}`;
169
- }
170
- onNext() {
171
- this.focusPending = this.next();
172
- }
173
- onBack() {
174
- this.focusPending = this.back();
175
- }
176
- onTabKeydown(event, index) {
177
- const target = TAB_KEYS[event.key];
178
- const buttons = this.tabButtons();
179
- if (!target || buttons.length === 0) {
180
- return;
181
- }
182
- event.preventDefault();
183
- buttons[target(index, buttons.length)]?.nativeElement.focus();
184
- }
185
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
186
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "21.2.26", type: SuStepperComponent, isStandalone: true, selector: "su-lib-stepper", inputs: { orientation: { classPropertyName: "orientation", publicName: "orientation", isSignal: true, isRequired: false, transformFunction: null }, tabs: { classPropertyName: "tabs", publicName: "tabs", isSignal: true, isRequired: false, transformFunction: null }, linear: { classPropertyName: "linear", publicName: "linear", isSignal: true, isRequired: false, transformFunction: null }, controls: { classPropertyName: "controls", publicName: "controls", isSignal: true, isRequired: false, transformFunction: null }, label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, labels: { classPropertyName: "labels", publicName: "labels", isSignal: true, isRequired: false, transformFunction: null }, current: { classPropertyName: "current", publicName: "current", isSignal: true, isRequired: false, transformFunction: null } }, outputs: { current: "currentChange" }, host: { properties: { "class.su-stepper-vertical": "orientation() === 'vertical'" }, classAttribute: "su-stepper" }, providers: [{ provide: SU_STEPPER, useExisting: SuStepperComponent }], queries: [{ propertyName: "steps", predicate: SuStepComponent, isSignal: true }], viewQueries: [{ propertyName: "tabButtons", predicate: ["tab"], descendants: true, isSignal: true }], ngImport: i0, template: "<ol\n class=\"su-stepper-steps\"\n [attr.role]=\"tabs() ? 'tablist' : null\"\n [attr.aria-orientation]=\"tabs() ? orientation() : null\"\n [attr.aria-label]=\"label() ?? text().steps\">\n @for (step of state().steps; track step.index) {\n <li\n class=\"su-stepper-step\"\n [class.is-current]=\"step.current\"\n [class.is-completed]=\"step.completed\"\n [attr.role]=\"tabs() ? 'presentation' : null\"\n [attr.aria-current]=\"!tabs() && step.current ? 'step' : null\">\n @if (tabs()) {\n <button\n #tab\n type=\"button\"\n role=\"tab\"\n class=\"su-stepper-header su-stepper-tab\"\n [id]=\"headerId(step.index)\"\n [attr.aria-controls]=\"panelId(step.index)\"\n [attr.aria-selected]=\"step.current\"\n [attr.aria-disabled]=\"step.current || step.reachable ? null : 'true'\"\n [tabIndex]=\"step.current ? 0 : -1\"\n (click)=\"goTo(step.index)\"\n (keydown)=\"onTabKeydown($event, step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </button>\n } @else {\n <div class=\"su-stepper-header\" [id]=\"headerId(step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </div>\n }\n </li>\n }\n</ol>\n\n<div class=\"su-stepper-body\">\n <ng-content />\n\n @if (controls() && state().count > 1) {\n <div class=\"su-stepper-controls\">\n @if (!state().isFirst) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-back\"\n [attr.aria-disabled]=\"state().canBack ? null : 'true'\"\n (click)=\"onBack()\">\n {{ text().back }}\n </button>\n }\n @if (!state().isLast) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-next\"\n [attr.aria-disabled]=\"state().canNext ? null : 'true'\"\n (click)=\"onNext()\">\n {{ text().next }}\n </button>\n }\n </div>\n }\n</div>\n", styles: [":host{color:var(--su-stepper-text-color, inherit);display:block;font-family:var(--su-stepper-font-family, inherit);min-width:0}.su-stepper-steps{display:flex;list-style:none;margin:0;padding:0}.su-stepper-step{align-items:center;display:flex;flex:1 1 0;min-width:0}.su-stepper-step:last-child{flex:0 1 auto}.su-stepper-step:not(:last-child):after{background:var(--su-stepper-line-color, rgba(0, 0, 0, .15));content:\"\";flex:1 1 1rem;height:var(--su-stepper-line-width, 2px);margin-inline:var(--su-stepper-line-gap, .5rem);min-width:1rem}.su-stepper-step.is-completed:after{background:var(--su-stepper-line-done-color, var(--su-stepper-accent, #2563eb))}.su-stepper-header{border-radius:var(--su-stepper-header-radius, .5rem);display:flex;min-width:0;padding:var(--su-stepper-header-padding, .25rem)}.su-stepper-tab{background:none;border:none;color:inherit;cursor:pointer;font:inherit;text-align:start}.su-stepper-tab:hover:not([aria-disabled=true]){background:var(--su-stepper-tab-hover-background, rgba(0, 0, 0, .05))}.su-stepper-tab[aria-disabled=true]{cursor:not-allowed}.su-stepper-tab:focus-visible,.su-stepper-button:focus-visible{outline:var(--su-stepper-focus-ring, 2px solid currentColor);outline-offset:2px}.su-stepper-body{min-width:0}.su-stepper-controls{display:flex;gap:var(--su-stepper-controls-gap, .5rem);margin-top:var(--su-stepper-controls-margin, .5rem)}.su-stepper-button{background:var(--su-stepper-button-background, transparent);border:var(--su-stepper-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-stepper-button-radius, .5rem);color:var(--su-stepper-button-color, inherit);cursor:pointer;font:inherit;font-weight:600;padding:var(--su-stepper-button-padding, .5rem 1rem)}.su-stepper-button[aria-disabled=true]{cursor:not-allowed;opacity:var(--su-stepper-disabled-opacity, .45)}.su-stepper-next{background:var(--su-stepper-primary-background, var(--su-stepper-accent, #2563eb));border-color:transparent;color:var(--su-stepper-primary-color, var(--su-stepper-accent-text, #ffffff));margin-inline-start:auto}:host(.su-stepper-vertical){align-items:flex-start;display:flex;flex-wrap:wrap;gap:var(--su-stepper-vertical-gap, 1.5rem)}:host(.su-stepper-vertical) .su-stepper-steps{flex:0 0 auto;flex-direction:column;max-width:100%}:host(.su-stepper-vertical) .su-stepper-step{flex:none;padding-bottom:var(--su-stepper-step-gap, 1.5rem);position:relative}:host(.su-stepper-vertical) .su-stepper-step:last-child{padding-bottom:0}:host(.su-stepper-vertical) .su-stepper-step:not(:last-child):after{bottom:.25rem;height:auto;inset-inline-start:calc(var(--su-stepper-header-padding, .25rem) + var(--su-stepper-marker-size, 2rem) / 2 - var(--su-stepper-line-width, 2px) / 2);margin:0;min-width:0;position:absolute;top:calc(var(--su-stepper-marker-size, 2rem) + var(--su-stepper-header-padding, .25rem) * 2 + .25rem);width:var(--su-stepper-line-width, 2px)}:host(.su-stepper-vertical) .su-stepper-body{flex:1 1 16rem}\n"], dependencies: [{ kind: "component", type: SuStepperHeaderComponent, selector: "su-lib-stepper-header", inputs: ["step", "count", "labels"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
187
- }
188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.26", ngImport: i0, type: SuStepperComponent, decorators: [{
189
- type: Component,
190
- args: [{ selector: 'su-lib-stepper', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SuStepperHeaderComponent], providers: [{ provide: SU_STEPPER, useExisting: SuStepperComponent }], host: {
191
- class: 'su-stepper',
192
- '[class.su-stepper-vertical]': "orientation() === 'vertical'",
193
- }, template: "<ol\n class=\"su-stepper-steps\"\n [attr.role]=\"tabs() ? 'tablist' : null\"\n [attr.aria-orientation]=\"tabs() ? orientation() : null\"\n [attr.aria-label]=\"label() ?? text().steps\">\n @for (step of state().steps; track step.index) {\n <li\n class=\"su-stepper-step\"\n [class.is-current]=\"step.current\"\n [class.is-completed]=\"step.completed\"\n [attr.role]=\"tabs() ? 'presentation' : null\"\n [attr.aria-current]=\"!tabs() && step.current ? 'step' : null\">\n @if (tabs()) {\n <button\n #tab\n type=\"button\"\n role=\"tab\"\n class=\"su-stepper-header su-stepper-tab\"\n [id]=\"headerId(step.index)\"\n [attr.aria-controls]=\"panelId(step.index)\"\n [attr.aria-selected]=\"step.current\"\n [attr.aria-disabled]=\"step.current || step.reachable ? null : 'true'\"\n [tabIndex]=\"step.current ? 0 : -1\"\n (click)=\"goTo(step.index)\"\n (keydown)=\"onTabKeydown($event, step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </button>\n } @else {\n <div class=\"su-stepper-header\" [id]=\"headerId(step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </div>\n }\n </li>\n }\n</ol>\n\n<div class=\"su-stepper-body\">\n <ng-content />\n\n @if (controls() && state().count > 1) {\n <div class=\"su-stepper-controls\">\n @if (!state().isFirst) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-back\"\n [attr.aria-disabled]=\"state().canBack ? null : 'true'\"\n (click)=\"onBack()\">\n {{ text().back }}\n </button>\n }\n @if (!state().isLast) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-next\"\n [attr.aria-disabled]=\"state().canNext ? null : 'true'\"\n (click)=\"onNext()\">\n {{ text().next }}\n </button>\n }\n </div>\n }\n</div>\n", styles: [":host{color:var(--su-stepper-text-color, inherit);display:block;font-family:var(--su-stepper-font-family, inherit);min-width:0}.su-stepper-steps{display:flex;list-style:none;margin:0;padding:0}.su-stepper-step{align-items:center;display:flex;flex:1 1 0;min-width:0}.su-stepper-step:last-child{flex:0 1 auto}.su-stepper-step:not(:last-child):after{background:var(--su-stepper-line-color, rgba(0, 0, 0, .15));content:\"\";flex:1 1 1rem;height:var(--su-stepper-line-width, 2px);margin-inline:var(--su-stepper-line-gap, .5rem);min-width:1rem}.su-stepper-step.is-completed:after{background:var(--su-stepper-line-done-color, var(--su-stepper-accent, #2563eb))}.su-stepper-header{border-radius:var(--su-stepper-header-radius, .5rem);display:flex;min-width:0;padding:var(--su-stepper-header-padding, .25rem)}.su-stepper-tab{background:none;border:none;color:inherit;cursor:pointer;font:inherit;text-align:start}.su-stepper-tab:hover:not([aria-disabled=true]){background:var(--su-stepper-tab-hover-background, rgba(0, 0, 0, .05))}.su-stepper-tab[aria-disabled=true]{cursor:not-allowed}.su-stepper-tab:focus-visible,.su-stepper-button:focus-visible{outline:var(--su-stepper-focus-ring, 2px solid currentColor);outline-offset:2px}.su-stepper-body{min-width:0}.su-stepper-controls{display:flex;gap:var(--su-stepper-controls-gap, .5rem);margin-top:var(--su-stepper-controls-margin, .5rem)}.su-stepper-button{background:var(--su-stepper-button-background, transparent);border:var(--su-stepper-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-stepper-button-radius, .5rem);color:var(--su-stepper-button-color, inherit);cursor:pointer;font:inherit;font-weight:600;padding:var(--su-stepper-button-padding, .5rem 1rem)}.su-stepper-button[aria-disabled=true]{cursor:not-allowed;opacity:var(--su-stepper-disabled-opacity, .45)}.su-stepper-next{background:var(--su-stepper-primary-background, var(--su-stepper-accent, #2563eb));border-color:transparent;color:var(--su-stepper-primary-color, var(--su-stepper-accent-text, #ffffff));margin-inline-start:auto}:host(.su-stepper-vertical){align-items:flex-start;display:flex;flex-wrap:wrap;gap:var(--su-stepper-vertical-gap, 1.5rem)}:host(.su-stepper-vertical) .su-stepper-steps{flex:0 0 auto;flex-direction:column;max-width:100%}:host(.su-stepper-vertical) .su-stepper-step{flex:none;padding-bottom:var(--su-stepper-step-gap, 1.5rem);position:relative}:host(.su-stepper-vertical) .su-stepper-step:last-child{padding-bottom:0}:host(.su-stepper-vertical) .su-stepper-step:not(:last-child):after{bottom:.25rem;height:auto;inset-inline-start:calc(var(--su-stepper-header-padding, .25rem) + var(--su-stepper-marker-size, 2rem) / 2 - var(--su-stepper-line-width, 2px) / 2);margin:0;min-width:0;position:absolute;top:calc(var(--su-stepper-marker-size, 2rem) + var(--su-stepper-header-padding, .25rem) * 2 + .25rem);width:var(--su-stepper-line-width, 2px)}:host(.su-stepper-vertical) .su-stepper-body{flex:1 1 16rem}\n"] }]
194
- }], ctorParameters: () => [], propDecorators: { orientation: [{ type: i0.Input, args: [{ isSignal: true, alias: "orientation", required: false }] }], tabs: [{ type: i0.Input, args: [{ isSignal: true, alias: "tabs", required: false }] }], linear: [{ type: i0.Input, args: [{ isSignal: true, alias: "linear", required: false }] }], controls: [{ type: i0.Input, args: [{ isSignal: true, alias: "controls", required: false }] }], label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], labels: [{ type: i0.Input, args: [{ isSignal: true, alias: "labels", required: false }] }], current: [{ type: i0.Input, args: [{ isSignal: true, alias: "current", required: false }] }, { type: i0.Output, args: ["currentChange"] }], steps: [{ type: i0.ContentChildren, args: [i0.forwardRef(() => SuStepComponent), { isSignal: true }] }], tabButtons: [{ type: i0.ViewChildren, args: ['tab', { isSignal: true }] }] } });
195
-
196
- /**
197
- * Generated bundle index. Do not edit.
198
- */
199
-
294
+ var SuStepperComponent = class SuStepperComponent {
295
+ orientation = input("horizontal", ...ngDevMode ? [{ debugName: "orientation" }] : /* istanbul ignore next */ []);
296
+ tabs = input(false, {
297
+ ...ngDevMode ? { debugName: "tabs" } : /* istanbul ignore next */ {},
298
+ transform: booleanAttribute
299
+ });
300
+ linear = input(false, {
301
+ ...ngDevMode ? { debugName: "linear" } : /* istanbul ignore next */ {},
302
+ transform: booleanAttribute
303
+ });
304
+ controls = input(true, {
305
+ ...ngDevMode ? { debugName: "controls" } : /* istanbul ignore next */ {},
306
+ transform: booleanAttribute
307
+ });
308
+ label = input(...ngDevMode ? [void 0, { debugName: "label" }] : /* istanbul ignore next */ []);
309
+ labels = input({}, ...ngDevMode ? [{ debugName: "labels" }] : /* istanbul ignore next */ []);
310
+ current = model(0, ...ngDevMode ? [{ debugName: "current" }] : /* istanbul ignore next */ []);
311
+ steps = contentChildren(SuStepComponent, ...ngDevMode ? [{ debugName: "steps" }] : /* istanbul ignore next */ []);
312
+ controller = new SuStepperController();
313
+ state = signal(this.controller.state.get(), ...ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []);
314
+ text = computed(() => ({
315
+ ...SU_STEPPER_LABELS,
316
+ ...this.labels()
317
+ }), ...ngDevMode ? [{ debugName: "text" }] : /* istanbul ignore next */ []);
318
+ tabButtons = viewChildren("tab", ...ngDevMode ? [{ debugName: "tabButtons" }] : /* istanbul ignore next */ []);
319
+ focusPending = false;
320
+ id = `su-stepper-${nextStepperId++}`;
321
+ constructor() {
322
+ const unsubscribe = this.controller.state.subscribe((state) => {
323
+ this.state.set(state);
324
+ this.current.set(state.current);
325
+ });
326
+ inject(DestroyRef).onDestroy(unsubscribe);
327
+ effect(() => {
328
+ const steps = this.steps().map((step) => step.options());
329
+ const linear = this.linear();
330
+ const current = this.current();
331
+ untracked(() => {
332
+ this.controller.setSteps(steps);
333
+ this.controller.setLinear(linear);
334
+ this.controller.select(current);
335
+ });
336
+ });
337
+ afterRenderEffect(() => {
338
+ const current = this.state().current;
339
+ if (this.focusPending) {
340
+ this.focusPending = false;
341
+ untracked(() => this.steps()[current]?.focus());
342
+ }
343
+ });
344
+ }
345
+ next() {
346
+ return this.controller.next();
347
+ }
348
+ back() {
349
+ return this.controller.back();
350
+ }
351
+ goTo(index) {
352
+ return this.controller.goTo(index);
353
+ }
354
+ reset(start = 0) {
355
+ this.controller.reset(start);
356
+ }
357
+ headerId(index) {
358
+ return `${this.id}-step-${index}`;
359
+ }
360
+ panelId(index) {
361
+ return `${this.id}-panel-${index}`;
362
+ }
363
+ onNext() {
364
+ this.focusPending = this.next();
365
+ }
366
+ onBack() {
367
+ this.focusPending = this.back();
368
+ }
369
+ onTabKeydown(event, index) {
370
+ const target = TAB_KEYS[event.key];
371
+ const buttons = this.tabButtons();
372
+ if (!target || buttons.length === 0) return;
373
+ event.preventDefault();
374
+ buttons[target(index, buttons.length)]?.nativeElement.focus();
375
+ }
376
+ static ɵfac = i0.ɵɵngDeclareFactory({
377
+ minVersion: "12.0.0",
378
+ version: "22.2.4",
379
+ ngImport: i0,
380
+ type: SuStepperComponent,
381
+ deps: [],
382
+ target: i0.ɵɵFactoryTarget.Component
383
+ });
384
+ static ɵcmp = i0.ɵɵngDeclareComponent({
385
+ minVersion: "17.0.0",
386
+ version: "22.2.4",
387
+ type: SuStepperComponent,
388
+ isStandalone: true,
389
+ selector: "su-lib-stepper",
390
+ inputs: {
391
+ orientation: {
392
+ classPropertyName: "orientation",
393
+ publicName: "orientation",
394
+ isSignal: true,
395
+ isRequired: false,
396
+ transformFunction: null
397
+ },
398
+ tabs: {
399
+ classPropertyName: "tabs",
400
+ publicName: "tabs",
401
+ isSignal: true,
402
+ isRequired: false,
403
+ transformFunction: null
404
+ },
405
+ linear: {
406
+ classPropertyName: "linear",
407
+ publicName: "linear",
408
+ isSignal: true,
409
+ isRequired: false,
410
+ transformFunction: null
411
+ },
412
+ controls: {
413
+ classPropertyName: "controls",
414
+ publicName: "controls",
415
+ isSignal: true,
416
+ isRequired: false,
417
+ transformFunction: null
418
+ },
419
+ label: {
420
+ classPropertyName: "label",
421
+ publicName: "label",
422
+ isSignal: true,
423
+ isRequired: false,
424
+ transformFunction: null
425
+ },
426
+ labels: {
427
+ classPropertyName: "labels",
428
+ publicName: "labels",
429
+ isSignal: true,
430
+ isRequired: false,
431
+ transformFunction: null
432
+ },
433
+ current: {
434
+ classPropertyName: "current",
435
+ publicName: "current",
436
+ isSignal: true,
437
+ isRequired: false,
438
+ transformFunction: null
439
+ }
440
+ },
441
+ outputs: { current: "currentChange" },
442
+ host: {
443
+ properties: { "class.su-stepper-vertical": "orientation() === 'vertical'" },
444
+ classAttribute: "su-stepper"
445
+ },
446
+ providers: [{
447
+ provide: SU_STEPPER,
448
+ useExisting: SuStepperComponent
449
+ }],
450
+ queries: [{
451
+ propertyName: "steps",
452
+ predicate: SuStepComponent,
453
+ isSignal: true
454
+ }],
455
+ viewQueries: [{
456
+ propertyName: "tabButtons",
457
+ predicate: ["tab"],
458
+ descendants: true,
459
+ isSignal: true
460
+ }],
461
+ ngImport: i0,
462
+ template: "<ol\n class=\"su-stepper-steps\"\n [attr.role]=\"tabs() ? 'tablist' : null\"\n [attr.aria-orientation]=\"tabs() ? orientation() : null\"\n [attr.aria-label]=\"label() ?? text().steps\">\n @for (step of state().steps; track step.index) {\n <li\n class=\"su-stepper-step\"\n [class.is-current]=\"step.current\"\n [class.is-completed]=\"step.completed\"\n [attr.role]=\"tabs() ? 'presentation' : null\"\n [attr.aria-current]=\"!tabs() && step.current ? 'step' : null\">\n @if (tabs()) {\n <button\n #tab\n type=\"button\"\n role=\"tab\"\n class=\"su-stepper-header su-stepper-tab\"\n [id]=\"headerId(step.index)\"\n [attr.aria-controls]=\"panelId(step.index)\"\n [attr.aria-selected]=\"step.current\"\n [attr.aria-disabled]=\"step.current || step.reachable ? null : 'true'\"\n [tabIndex]=\"step.current ? 0 : -1\"\n (click)=\"goTo(step.index)\"\n (keydown)=\"onTabKeydown($event, step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </button>\n } @else {\n <div class=\"su-stepper-header\" [id]=\"headerId(step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </div>\n }\n </li>\n }\n</ol>\n\n<div class=\"su-stepper-body\">\n <ng-content />\n\n @if (controls() && state().count > 1) {\n <div class=\"su-stepper-controls\">\n @if (!state().isFirst) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-back\"\n [attr.aria-disabled]=\"state().canBack ? null : 'true'\"\n (click)=\"onBack()\">\n {{ text().back }}\n </button>\n }\n @if (!state().isLast) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-next\"\n [attr.aria-disabled]=\"state().canNext ? null : 'true'\"\n (click)=\"onNext()\">\n {{ text().next }}\n </button>\n }\n </div>\n }\n</div>\n",
463
+ styles: [":host{color:var(--su-stepper-text-color, inherit);display:block;font-family:var(--su-stepper-font-family, inherit);min-width:0}.su-stepper-steps{display:flex;list-style:none;margin:0;padding:0}.su-stepper-step{align-items:center;display:flex;flex:1 1 0;min-width:0}.su-stepper-step:last-child{flex:0 1 auto}.su-stepper-step:not(:last-child):after{background:var(--su-stepper-line-color, rgba(0, 0, 0, .15));content:\"\";flex:1 1 1rem;height:var(--su-stepper-line-width, 2px);margin-inline:var(--su-stepper-line-gap, .5rem);min-width:1rem}.su-stepper-step.is-completed:after{background:var(--su-stepper-line-done-color, var(--su-stepper-accent, #2563eb))}.su-stepper-header{border-radius:var(--su-stepper-header-radius, .5rem);display:flex;min-width:0;padding:var(--su-stepper-header-padding, .25rem)}.su-stepper-tab{background:none;border:none;color:inherit;cursor:pointer;font:inherit;text-align:start}.su-stepper-tab:hover:not([aria-disabled=true]){background:var(--su-stepper-tab-hover-background, rgba(0, 0, 0, .05))}.su-stepper-tab[aria-disabled=true]{cursor:not-allowed}.su-stepper-tab:focus-visible,.su-stepper-button:focus-visible{outline:var(--su-stepper-focus-ring, 2px solid currentColor);outline-offset:2px}.su-stepper-body{min-width:0}.su-stepper-controls{display:flex;gap:var(--su-stepper-controls-gap, .5rem);margin-top:var(--su-stepper-controls-margin, .5rem)}.su-stepper-button{background:var(--su-stepper-button-background, transparent);border:var(--su-stepper-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-stepper-button-radius, .5rem);color:var(--su-stepper-button-color, inherit);cursor:pointer;font:inherit;font-weight:600;padding:var(--su-stepper-button-padding, .5rem 1rem)}.su-stepper-button[aria-disabled=true]{cursor:not-allowed;opacity:var(--su-stepper-disabled-opacity, .45)}.su-stepper-next{background:var(--su-stepper-primary-background, var(--su-stepper-accent, #2563eb));border-color:transparent;color:var(--su-stepper-primary-color, var(--su-stepper-accent-text, #ffffff));margin-inline-start:auto}:host(.su-stepper-vertical){align-items:flex-start;display:flex;flex-wrap:wrap;gap:var(--su-stepper-vertical-gap, 1.5rem)}:host(.su-stepper-vertical) .su-stepper-steps{flex:0 0 auto;flex-direction:column;max-width:100%}:host(.su-stepper-vertical) .su-stepper-step{flex:none;padding-bottom:var(--su-stepper-step-gap, 1.5rem);position:relative}:host(.su-stepper-vertical) .su-stepper-step:last-child{padding-bottom:0}:host(.su-stepper-vertical) .su-stepper-step:not(:last-child):after{bottom:.25rem;height:auto;inset-inline-start:calc(var(--su-stepper-header-padding, .25rem) + var(--su-stepper-marker-size, 2rem) / 2 - var(--su-stepper-line-width, 2px) / 2);margin:0;min-width:0;position:absolute;top:calc(var(--su-stepper-marker-size, 2rem) + var(--su-stepper-header-padding, .25rem) * 2 + .25rem);width:var(--su-stepper-line-width, 2px)}:host(.su-stepper-vertical) .su-stepper-body{flex:1 1 16rem}\n"],
464
+ dependencies: [{
465
+ kind: "component",
466
+ type: SuStepperHeaderComponent,
467
+ selector: "su-lib-stepper-header",
468
+ inputs: [
469
+ "step",
470
+ "count",
471
+ "labels"
472
+ ]
473
+ }],
474
+ changeDetection: i0.ChangeDetectionStrategy.OnPush
475
+ });
476
+ };
477
+ i0.ɵɵngDeclareClassMetadata({
478
+ minVersion: "12.0.0",
479
+ version: "22.2.4",
480
+ ngImport: i0,
481
+ type: SuStepperComponent,
482
+ decorators: [{
483
+ type: Component,
484
+ args: [{
485
+ selector: "su-lib-stepper",
486
+ changeDetection: ChangeDetectionStrategy.OnPush,
487
+ imports: [SuStepperHeaderComponent],
488
+ providers: [{
489
+ provide: SU_STEPPER,
490
+ useExisting: SuStepperComponent
491
+ }],
492
+ host: {
493
+ class: "su-stepper",
494
+ "[class.su-stepper-vertical]": "orientation() === 'vertical'"
495
+ },
496
+ template: "<ol\n class=\"su-stepper-steps\"\n [attr.role]=\"tabs() ? 'tablist' : null\"\n [attr.aria-orientation]=\"tabs() ? orientation() : null\"\n [attr.aria-label]=\"label() ?? text().steps\">\n @for (step of state().steps; track step.index) {\n <li\n class=\"su-stepper-step\"\n [class.is-current]=\"step.current\"\n [class.is-completed]=\"step.completed\"\n [attr.role]=\"tabs() ? 'presentation' : null\"\n [attr.aria-current]=\"!tabs() && step.current ? 'step' : null\">\n @if (tabs()) {\n <button\n #tab\n type=\"button\"\n role=\"tab\"\n class=\"su-stepper-header su-stepper-tab\"\n [id]=\"headerId(step.index)\"\n [attr.aria-controls]=\"panelId(step.index)\"\n [attr.aria-selected]=\"step.current\"\n [attr.aria-disabled]=\"step.current || step.reachable ? null : 'true'\"\n [tabIndex]=\"step.current ? 0 : -1\"\n (click)=\"goTo(step.index)\"\n (keydown)=\"onTabKeydown($event, step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </button>\n } @else {\n <div class=\"su-stepper-header\" [id]=\"headerId(step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </div>\n }\n </li>\n }\n</ol>\n\n<div class=\"su-stepper-body\">\n <ng-content />\n\n @if (controls() && state().count > 1) {\n <div class=\"su-stepper-controls\">\n @if (!state().isFirst) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-back\"\n [attr.aria-disabled]=\"state().canBack ? null : 'true'\"\n (click)=\"onBack()\">\n {{ text().back }}\n </button>\n }\n @if (!state().isLast) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-next\"\n [attr.aria-disabled]=\"state().canNext ? null : 'true'\"\n (click)=\"onNext()\">\n {{ text().next }}\n </button>\n }\n </div>\n }\n</div>\n",
497
+ styles: [":host{color:var(--su-stepper-text-color, inherit);display:block;font-family:var(--su-stepper-font-family, inherit);min-width:0}.su-stepper-steps{display:flex;list-style:none;margin:0;padding:0}.su-stepper-step{align-items:center;display:flex;flex:1 1 0;min-width:0}.su-stepper-step:last-child{flex:0 1 auto}.su-stepper-step:not(:last-child):after{background:var(--su-stepper-line-color, rgba(0, 0, 0, .15));content:\"\";flex:1 1 1rem;height:var(--su-stepper-line-width, 2px);margin-inline:var(--su-stepper-line-gap, .5rem);min-width:1rem}.su-stepper-step.is-completed:after{background:var(--su-stepper-line-done-color, var(--su-stepper-accent, #2563eb))}.su-stepper-header{border-radius:var(--su-stepper-header-radius, .5rem);display:flex;min-width:0;padding:var(--su-stepper-header-padding, .25rem)}.su-stepper-tab{background:none;border:none;color:inherit;cursor:pointer;font:inherit;text-align:start}.su-stepper-tab:hover:not([aria-disabled=true]){background:var(--su-stepper-tab-hover-background, rgba(0, 0, 0, .05))}.su-stepper-tab[aria-disabled=true]{cursor:not-allowed}.su-stepper-tab:focus-visible,.su-stepper-button:focus-visible{outline:var(--su-stepper-focus-ring, 2px solid currentColor);outline-offset:2px}.su-stepper-body{min-width:0}.su-stepper-controls{display:flex;gap:var(--su-stepper-controls-gap, .5rem);margin-top:var(--su-stepper-controls-margin, .5rem)}.su-stepper-button{background:var(--su-stepper-button-background, transparent);border:var(--su-stepper-button-border, 1px solid rgba(0, 0, 0, .2));border-radius:var(--su-stepper-button-radius, .5rem);color:var(--su-stepper-button-color, inherit);cursor:pointer;font:inherit;font-weight:600;padding:var(--su-stepper-button-padding, .5rem 1rem)}.su-stepper-button[aria-disabled=true]{cursor:not-allowed;opacity:var(--su-stepper-disabled-opacity, .45)}.su-stepper-next{background:var(--su-stepper-primary-background, var(--su-stepper-accent, #2563eb));border-color:transparent;color:var(--su-stepper-primary-color, var(--su-stepper-accent-text, #ffffff));margin-inline-start:auto}:host(.su-stepper-vertical){align-items:flex-start;display:flex;flex-wrap:wrap;gap:var(--su-stepper-vertical-gap, 1.5rem)}:host(.su-stepper-vertical) .su-stepper-steps{flex:0 0 auto;flex-direction:column;max-width:100%}:host(.su-stepper-vertical) .su-stepper-step{flex:none;padding-bottom:var(--su-stepper-step-gap, 1.5rem);position:relative}:host(.su-stepper-vertical) .su-stepper-step:last-child{padding-bottom:0}:host(.su-stepper-vertical) .su-stepper-step:not(:last-child):after{bottom:.25rem;height:auto;inset-inline-start:calc(var(--su-stepper-header-padding, .25rem) + var(--su-stepper-marker-size, 2rem) / 2 - var(--su-stepper-line-width, 2px) / 2);margin:0;min-width:0;position:absolute;top:calc(var(--su-stepper-marker-size, 2rem) + var(--su-stepper-header-padding, .25rem) * 2 + .25rem);width:var(--su-stepper-line-width, 2px)}:host(.su-stepper-vertical) .su-stepper-body{flex:1 1 16rem}\n"]
498
+ }]
499
+ }],
500
+ ctorParameters: () => [],
501
+ propDecorators: {
502
+ orientation: [{
503
+ type: i0.Input,
504
+ args: [{
505
+ isSignal: true,
506
+ alias: "orientation",
507
+ required: false
508
+ }]
509
+ }],
510
+ tabs: [{
511
+ type: i0.Input,
512
+ args: [{
513
+ isSignal: true,
514
+ alias: "tabs",
515
+ required: false
516
+ }]
517
+ }],
518
+ linear: [{
519
+ type: i0.Input,
520
+ args: [{
521
+ isSignal: true,
522
+ alias: "linear",
523
+ required: false
524
+ }]
525
+ }],
526
+ controls: [{
527
+ type: i0.Input,
528
+ args: [{
529
+ isSignal: true,
530
+ alias: "controls",
531
+ required: false
532
+ }]
533
+ }],
534
+ label: [{
535
+ type: i0.Input,
536
+ args: [{
537
+ isSignal: true,
538
+ alias: "label",
539
+ required: false
540
+ }]
541
+ }],
542
+ labels: [{
543
+ type: i0.Input,
544
+ args: [{
545
+ isSignal: true,
546
+ alias: "labels",
547
+ required: false
548
+ }]
549
+ }],
550
+ current: [{
551
+ type: i0.Input,
552
+ args: [{
553
+ isSignal: true,
554
+ alias: "current",
555
+ required: false
556
+ }]
557
+ }, {
558
+ type: i0.Output,
559
+ args: ["currentChange"]
560
+ }],
561
+ steps: [{
562
+ type: i0.ContentChildren,
563
+ args: [i0.forwardRef(() => SuStepComponent), { isSignal: true }]
564
+ }],
565
+ tabButtons: [{
566
+ type: i0.ViewChildren,
567
+ args: ["tab", { isSignal: true }]
568
+ }]
569
+ }
570
+ });
200
571
  export { SuStepComponent, SuStepperComponent };
201
- //# sourceMappingURL=su-labs-stepper.mjs.map
572
+
573
+ //# sourceMappingURL=su-labs-stepper.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"su-labs-stepper.mjs","sources":["../../../../compat/angular-21/build/stepper/src/lib/stepper.context.ts","../../../../compat/angular-21/build/stepper/src/lib/step/step.component.ts","../../../../compat/angular-21/build/stepper/src/lib/step/step.component.html","../../../../compat/angular-21/build/stepper/src/lib/stepper-header/stepper-header.component.ts","../../../../compat/angular-21/build/stepper/src/lib/stepper-header/stepper-header.component.html","../../../../compat/angular-21/build/stepper/src/lib/stepper/stepper.component.ts","../../../../compat/angular-21/build/stepper/src/lib/stepper/stepper.component.html","../../../../compat/angular-21/build/stepper/src/su-labs-stepper.ts"],"sourcesContent":["import { InjectionToken, Signal } from '@angular/core';\nimport type { SuStepComponent } from './step/step.component';\n\n/** What a step needs from the stepper around it to show itself as a panel */\nexport interface SuStepperContext {\n readonly steps: Signal<readonly SuStepComponent[]>;\n readonly current: Signal<number>;\n readonly tabs: Signal<boolean>;\n headerId(index: number): string;\n panelId(index: number): string;\n}\n\nexport const SU_STEPPER = new InjectionToken<SuStepperContext>('SU_STEPPER');\n","import { booleanAttribute, ChangeDetectionStrategy, Component, computed, ElementRef, inject, input } from '@angular/core';\nimport { SuStepOptions } from '@su-labs/core/stepper';\nimport { SU_STEPPER } from '../stepper.context';\n\n/**\n * One step of `su-lib-stepper`: its content shows while it's the current step. Its rules say when the user may leave\n * it, e.g. `[canNext]=\"form.valid\"`.\n */\n@Component({\n selector: 'su-lib-step',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './step.component.html',\n styleUrl: './step.component.scss',\n host: {\n class: 'su-stepper-panel',\n tabindex: '-1',\n '[id]': 'panelId()',\n '[attr.role]': \"stepper.tabs() ? 'tabpanel' : 'group'\",\n '[attr.aria-labelledby]': 'headerId()',\n '[hidden]': '!isCurrent()',\n },\n})\nexport class SuStepComponent {\n /** The text beside the step's number; without it, only the number shows */\n readonly label = input<string>();\n /** The user may go forward from this step, e.g. once its form is valid @default true */\n readonly canNext = input(true, { transform: booleanAttribute });\n /** The user may go back from this step @default true */\n readonly canBack = input(true, { transform: booleanAttribute });\n /** The step can't be visited; moving forward or back skips it @default false */\n readonly disabled = input(false, { transform: booleanAttribute });\n\n /** The step's options for `SuStepperController` */\n readonly options = computed<SuStepOptions>(() => ({\n label: this.label(),\n canNext: this.canNext(),\n canBack: this.canBack(),\n disabled: this.disabled(),\n }));\n\n protected readonly stepper = inject(SU_STEPPER);\n private readonly host: ElementRef<HTMLElement> = inject(ElementRef);\n private readonly index = computed(() => this.stepper.steps().indexOf(this));\n protected readonly isCurrent = computed(\n () => this.index() === this.stepper.current()\n );\n protected readonly panelId = computed(() =>\n this.stepper.panelId(this.index())\n );\n protected readonly headerId = computed(() =>\n this.stepper.headerId(this.index())\n );\n\n /** Moves keyboard focus to the step's content */\n focus(): void {\n this.host.nativeElement.focus();\n }\n}\n","<ng-content />\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { SuStepperLabels, SuStepView } from '@su-labs/core/stepper';\n\n/** A step's circle with its number and its label, with the step's place and state for screen readers */\n@Component({\n selector: 'su-lib-stepper-header',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './stepper-header.component.html',\n styleUrl: './stepper-header.component.scss',\n host: {\n class: 'su-stepper-header-content',\n '[class.is-current]': 'step().current',\n '[class.is-completed]': 'step().completed',\n '[class.is-visited]': 'step().visited',\n '[class.is-disabled]': 'step().disabled',\n },\n})\nexport class SuStepperHeaderComponent {\n readonly step = input.required<SuStepView>();\n readonly count = input.required<number>();\n readonly labels = input.required<SuStepperLabels>();\n\n protected readonly description = computed(() => {\n const step = this.step();\n const labels = this.labels();\n return [\n labels.step(step.number, this.count()),\n step.label,\n step.completed ? labels.completed : null,\n step.disabled ? labels.unavailable : null,\n ]\n .filter(part => part !== null)\n .join(', ');\n });\n}\n","<span class=\"su-stepper-marker\" aria-hidden=\"true\">{{ step().number }}</span>\n@if (step().label; as label) {\n <span class=\"su-stepper-label\" aria-hidden=\"true\">{{ label }}</span>\n}\n<span class=\"su-stepper-visually-hidden\">{{ description() }}</span>\n","import { afterRenderEffect, booleanAttribute, ChangeDetectionStrategy, Component, computed, contentChildren, DestroyRef, effect, ElementRef, inject, input, model, signal, untracked, viewChildren } from '@angular/core';\nimport { SU_STEPPER_LABELS, SuStepperController, SuStepperLabels, SuStepperOrientation } from '@su-labs/core/stepper';\nimport { SuStepComponent } from '../step/step.component';\nimport { SU_STEPPER, SuStepperContext } from '../stepper.context';\nimport { SuStepperHeaderComponent } from '../stepper-header/stepper-header.component';\n\nlet nextStepperId = 0;\n\n/** Keys that move focus between the step headers when they act as tabs, and where each one goes */\nconst TAB_KEYS: Readonly<\n Record<string, (index: number, count: number) => number>\n> = {\n ArrowRight: (index, count) => (index + 1) % count,\n ArrowDown: (index, count) => (index + 1) % count,\n ArrowLeft: (index, count) => (index - 1 + count) % count,\n ArrowUp: (index, count) => (index - 1 + count) % count,\n Home: () => 0,\n End: (_index, count) => count - 1,\n};\n\n/**\n * Content split into steps (`su-lib-step`) shown one at a time, over `SuStepperController` from\n * `@su-labs/core/stepper`: a numbered circle per step joined by a line, horizontal or vertical, with Back and Next\n * buttons that follow each step's rules. With `tabs`, the step headers act as tabs too, still following the rules.\n */\n@Component({\n selector: 'su-lib-stepper',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SuStepperHeaderComponent],\n templateUrl: './stepper.component.html',\n styleUrl: './stepper.component.scss',\n providers: [{ provide: SU_STEPPER, useExisting: SuStepperComponent }],\n host: {\n class: 'su-stepper',\n '[class.su-stepper-vertical]': \"orientation() === 'vertical'\",\n },\n})\nexport class SuStepperComponent implements SuStepperContext {\n /** @default 'horizontal' */\n readonly orientation = input<SuStepperOrientation>('horizontal');\n /** The step headers act as tabs: clicking one goes to its step, if the rules allow it @default false */\n readonly tabs = input(false, { transform: booleanAttribute });\n /** Going forward by more than one step only reaches steps already visited @default false */\n readonly linear = input(false, { transform: booleanAttribute });\n /** Back and Next buttons under the steps; without them, call `next()` and `back()` from your own @default true */\n readonly controls = input(true, { transform: booleanAttribute });\n /** The name of the list of steps for screen readers @default labels.steps */\n readonly label = input<string>();\n /** Texts to replace, e.g. in the page's language */\n readonly labels = input<Partial<SuStepperLabels>>({});\n /** The step on screen, from 0; setting it shows that step without checking the rules */\n readonly current = model(0);\n\n readonly steps = contentChildren(SuStepComponent);\n\n private readonly controller = new SuStepperController();\n protected readonly state = signal(this.controller.state.get());\n protected readonly text = computed<SuStepperLabels>(() => ({\n ...SU_STEPPER_LABELS,\n ...this.labels(),\n }));\n private readonly tabButtons =\n viewChildren<ElementRef<HTMLButtonElement>>('tab');\n /** The step's content takes focus once it renders, after a move the user made with the buttons */\n private focusPending = false;\n private readonly id = `su-stepper-${nextStepperId++}`;\n\n constructor() {\n const unsubscribe = this.controller.state.subscribe(state => {\n this.state.set(state);\n this.current.set(state.current);\n });\n inject(DestroyRef).onDestroy(unsubscribe);\n\n effect(() => {\n const steps = this.steps().map(step => step.options());\n const linear = this.linear();\n const current = this.current();\n untracked(() => {\n this.controller.setSteps(steps);\n this.controller.setLinear(linear);\n this.controller.select(current);\n });\n });\n\n afterRenderEffect(() => {\n const current = this.state().current;\n if (this.focusPending) {\n this.focusPending = false;\n untracked(() => this.steps()[current]?.focus());\n }\n });\n }\n\n /** Goes to the next step that isn't disabled, if the current one allows it; returns whether it moved */\n next(): boolean {\n return this.controller.next();\n }\n\n /** Goes to the previous step that isn't disabled, if the current one allows it; returns whether it moved */\n back(): boolean {\n return this.controller.back();\n }\n\n /** Goes to a step, from 0, if the rules allow it; returns whether it moved */\n goTo(index: number): boolean {\n return this.controller.goTo(index);\n }\n\n /** Starts over: back to a step (the first by default) with nothing visited or completed */\n reset(start = 0): void {\n this.controller.reset(start);\n }\n\n headerId(index: number): string {\n return `${this.id}-step-${index}`;\n }\n\n panelId(index: number): string {\n return `${this.id}-panel-${index}`;\n }\n\n protected onNext(): void {\n this.focusPending = this.next();\n }\n\n protected onBack(): void {\n this.focusPending = this.back();\n }\n\n protected onTabKeydown(event: KeyboardEvent, index: number): void {\n const target = TAB_KEYS[event.key];\n const buttons = this.tabButtons();\n if (!target || buttons.length === 0) {\n return;\n }\n event.preventDefault();\n buttons[target(index, buttons.length)]?.nativeElement.focus();\n }\n}\n","<ol\n class=\"su-stepper-steps\"\n [attr.role]=\"tabs() ? 'tablist' : null\"\n [attr.aria-orientation]=\"tabs() ? orientation() : null\"\n [attr.aria-label]=\"label() ?? text().steps\">\n @for (step of state().steps; track step.index) {\n <li\n class=\"su-stepper-step\"\n [class.is-current]=\"step.current\"\n [class.is-completed]=\"step.completed\"\n [attr.role]=\"tabs() ? 'presentation' : null\"\n [attr.aria-current]=\"!tabs() && step.current ? 'step' : null\">\n @if (tabs()) {\n <button\n #tab\n type=\"button\"\n role=\"tab\"\n class=\"su-stepper-header su-stepper-tab\"\n [id]=\"headerId(step.index)\"\n [attr.aria-controls]=\"panelId(step.index)\"\n [attr.aria-selected]=\"step.current\"\n [attr.aria-disabled]=\"step.current || step.reachable ? null : 'true'\"\n [tabIndex]=\"step.current ? 0 : -1\"\n (click)=\"goTo(step.index)\"\n (keydown)=\"onTabKeydown($event, step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </button>\n } @else {\n <div class=\"su-stepper-header\" [id]=\"headerId(step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </div>\n }\n </li>\n }\n</ol>\n\n<div class=\"su-stepper-body\">\n <ng-content />\n\n @if (controls() && state().count > 1) {\n <div class=\"su-stepper-controls\">\n @if (!state().isFirst) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-back\"\n [attr.aria-disabled]=\"state().canBack ? null : 'true'\"\n (click)=\"onBack()\">\n {{ text().back }}\n </button>\n }\n @if (!state().isLast) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-next\"\n [attr.aria-disabled]=\"state().canNext ? null : 'true'\"\n (click)=\"onNext()\">\n {{ text().next }}\n </button>\n }\n </div>\n }\n</div>\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAYO,MAAM,UAAU,GAAG,IAAI,cAAc,CAAmB,YAAY,CAAC;;ACR5E;;;AAGG;MAeU,eAAe,CAAA;;IAEjB,KAAK,GAAG,KAAK,CAAA,IAAA,SAAA,GAAA,CAAA,SAAA,EAAA,EAAA,SAAA,EAAA,OAAA,EAAA,CAAA,8BAAA,EAAA,CAAA,CAAU;;IAEvB,OAAO,GAAG,KAAK,CAAC,IAAI,+EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAEtD,OAAO,GAAG,KAAK,CAAC,IAAI,+EAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;IAEtD,QAAQ,GAAG,KAAK,CAAC,KAAK,gFAAI,SAAS,EAAE,gBAAgB,EAAA,CAAG;;AAGxD,IAAA,OAAO,GAAG,QAAQ,CAAgB,OAAO;AAChD,QAAA,KAAK,EAAE,IAAI,CAAC,KAAK,EAAE;AACnB,QAAA,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;AACvB,QAAA,OAAO,EAAE,IAAI,CAAC,OAAO,EAAE;AACvB,QAAA,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE;AAC1B,KAAA,CAAC,8EAAC;AAEgB,IAAA,OAAO,GAAG,MAAM,CAAC,UAAU,CAAC;AAC9B,IAAA,IAAI,GAA4B,MAAM,CAAC,UAAU,CAAC;AAClD,IAAA,KAAK,GAAG,QAAQ,CAAC,MAAM,IAAI,CAAC,OAAO,CAAC,KAAK,EAAE,CAAC,OAAO,CAAC,IAAI,CAAC,4EAAC;AACxD,IAAA,SAAS,GAAG,QAAQ,CACrC,MAAM,IAAI,CAAC,KAAK,EAAE,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A,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,OAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,QAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,OAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,SAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,EAAA,EAAA,IAAA,EAAA,EAAA,CAAA,MAAA,EAAA,IAAA,EAAA,CAAA,eAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA,eAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,UAAA,CAAA,MAAA,eAAe,wEASF,KAAK,EAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,CAAA,EAAA,EAAA,CAAA;;AE9DrD;;AAEG;;"}
1
+ {"version":3,"file":"su-labs-stepper.mjs","names":[],"sources":["../../../../projects/su-labs/stepper/src/lib/stepper.context.ts","../../../../projects/su-labs/stepper/src/lib/step/step.component.ts","../../../../projects/su-labs/stepper/src/lib/step/step.component.html","../../../../projects/su-labs/stepper/src/lib/stepper-header/stepper-header.component.ts","../../../../projects/su-labs/stepper/src/lib/stepper-header/stepper-header.component.html","../../../../projects/su-labs/stepper/src/lib/stepper/stepper.component.ts","../../../../projects/su-labs/stepper/src/lib/stepper/stepper.component.html"],"sourcesContent":["import { InjectionToken, Signal } from '@angular/core';\nimport type { SuStepComponent } from './step/step.component';\n\n/** What a step needs from the stepper around it to show itself as a panel */\nexport interface SuStepperContext {\n readonly steps: Signal<readonly SuStepComponent[]>;\n readonly current: Signal<number>;\n readonly tabs: Signal<boolean>;\n headerId(index: number): string;\n panelId(index: number): string;\n}\n\nexport const SU_STEPPER = new InjectionToken<SuStepperContext>('SU_STEPPER');\n","import { booleanAttribute, ChangeDetectionStrategy, Component, computed, ElementRef, inject, input } from '@angular/core';\nimport { SuStepOptions } from '@su-labs/core/stepper';\nimport { SU_STEPPER } from '../stepper.context';\n\n/**\n * One step of `su-lib-stepper`: its content shows while it's the current step. Its rules say when the user may leave\n * it, e.g. `[canNext]=\"form.valid\"`.\n */\n@Component({\n selector: 'su-lib-step',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './step.component.html',\n styleUrl: './step.component.scss',\n host: {\n class: 'su-stepper-panel',\n tabindex: '-1',\n '[id]': 'panelId()',\n '[attr.role]': \"stepper.tabs() ? 'tabpanel' : 'group'\",\n '[attr.aria-labelledby]': 'headerId()',\n '[hidden]': '!isCurrent()',\n },\n})\nexport class SuStepComponent {\n /** The text beside the step's number; without it, only the number shows */\n readonly label = input<string>();\n /** The user may go forward from this step, e.g. once its form is valid @default true */\n readonly canNext = input(true, { transform: booleanAttribute });\n /** The user may go back from this step @default true */\n readonly canBack = input(true, { transform: booleanAttribute });\n /** The step can't be visited; moving forward or back skips it @default false */\n readonly disabled = input(false, { transform: booleanAttribute });\n /** Shows the step as completed whatever the user does here, e.g. for work saved earlier @default false */\n readonly completed = input(false, { transform: booleanAttribute });\n\n /** The step's options for `SuStepperController` */\n readonly options = computed<SuStepOptions>(() => ({\n label: this.label(),\n canNext: this.canNext(),\n canBack: this.canBack(),\n disabled: this.disabled(),\n completed: this.completed(),\n }));\n\n protected readonly stepper = inject(SU_STEPPER);\n private readonly host: ElementRef<HTMLElement> = inject(ElementRef);\n private readonly index = computed(() => this.stepper.steps().indexOf(this));\n protected readonly isCurrent = computed(\n () => this.index() === this.stepper.current()\n );\n protected readonly panelId = computed(() =>\n this.stepper.panelId(this.index())\n );\n protected readonly headerId = computed(() =>\n this.stepper.headerId(this.index())\n );\n\n /** Moves keyboard focus to the step's content */\n focus(): void {\n this.host.nativeElement.focus();\n }\n}\n","<ng-content />\n","import { ChangeDetectionStrategy, Component, computed, input } from '@angular/core';\nimport { SuStepperLabels, SuStepView } from '@su-labs/core/stepper';\n\n/** A step's circle with its number and its label, with the step's place and state for screen readers */\n@Component({\n selector: 'su-lib-stepper-header',\n changeDetection: ChangeDetectionStrategy.OnPush,\n templateUrl: './stepper-header.component.html',\n styleUrl: './stepper-header.component.scss',\n host: {\n class: 'su-stepper-header-content',\n '[class.is-current]': 'step().current',\n '[class.is-completed]': 'step().completed',\n '[class.is-visited]': 'step().visited',\n '[class.is-disabled]': 'step().disabled',\n },\n})\nexport class SuStepperHeaderComponent {\n readonly step = input.required<SuStepView>();\n readonly count = input.required<number>();\n readonly labels = input.required<SuStepperLabels>();\n\n protected readonly description = computed(() => {\n const step = this.step();\n const labels = this.labels();\n return [\n labels.step(step.number, this.count()),\n step.label,\n step.completed ? labels.completed : null,\n step.disabled ? labels.unavailable : null,\n ]\n .filter(part => part !== null)\n .join(', ');\n });\n}\n","<span class=\"su-stepper-marker\" aria-hidden=\"true\">{{ step().number }}</span>\n@if (step().label; as label) {\n <span class=\"su-stepper-label\" aria-hidden=\"true\">{{ label }}</span>\n}\n<span class=\"su-stepper-visually-hidden\">{{ description() }}</span>\n","import { afterRenderEffect, booleanAttribute, ChangeDetectionStrategy, Component, computed, contentChildren, DestroyRef, effect, ElementRef, inject, input, model, signal, untracked, viewChildren } from '@angular/core';\nimport { SU_STEPPER_LABELS, SuStepperController, SuStepperLabels, SuStepperOrientation } from '@su-labs/core/stepper';\nimport { SuStepComponent } from '../step/step.component';\nimport { SU_STEPPER, SuStepperContext } from '../stepper.context';\nimport { SuStepperHeaderComponent } from '../stepper-header/stepper-header.component';\n\nlet nextStepperId = 0;\n\n/** Keys that move focus between the step headers when they act as tabs, and where each one goes */\nconst TAB_KEYS: Readonly<\n Record<string, (index: number, count: number) => number>\n> = {\n ArrowRight: (index, count) => (index + 1) % count,\n ArrowDown: (index, count) => (index + 1) % count,\n ArrowLeft: (index, count) => (index - 1 + count) % count,\n ArrowUp: (index, count) => (index - 1 + count) % count,\n Home: () => 0,\n End: (_index, count) => count - 1,\n};\n\n/**\n * Content split into steps (`su-lib-step`) shown one at a time, over `SuStepperController` from\n * `@su-labs/core/stepper`: a numbered circle per step joined by a line, horizontal or vertical, with Back and Next\n * buttons that follow each step's rules. With `tabs`, the step headers act as tabs too, still following the rules.\n */\n@Component({\n selector: 'su-lib-stepper',\n changeDetection: ChangeDetectionStrategy.OnPush,\n imports: [SuStepperHeaderComponent],\n templateUrl: './stepper.component.html',\n styleUrl: './stepper.component.scss',\n providers: [{ provide: SU_STEPPER, useExisting: SuStepperComponent }],\n host: {\n class: 'su-stepper',\n '[class.su-stepper-vertical]': \"orientation() === 'vertical'\",\n },\n})\nexport class SuStepperComponent implements SuStepperContext {\n /** @default 'horizontal' */\n readonly orientation = input<SuStepperOrientation>('horizontal');\n /** The step headers act as tabs: clicking one goes to its step, if the rules allow it @default false */\n readonly tabs = input(false, { transform: booleanAttribute });\n /** Going forward by more than one step only reaches steps already visited @default false */\n readonly linear = input(false, { transform: booleanAttribute });\n /** Back and Next buttons under the steps; without them, call `next()` and `back()` from your own @default true */\n readonly controls = input(true, { transform: booleanAttribute });\n /** The name of the list of steps for screen readers @default labels.steps */\n readonly label = input<string>();\n /** Texts to replace, e.g. in the page's language */\n readonly labels = input<Partial<SuStepperLabels>>({});\n /** The step on screen, from 0; setting it shows that step without checking the rules */\n readonly current = model(0);\n\n readonly steps = contentChildren(SuStepComponent);\n\n private readonly controller = new SuStepperController();\n protected readonly state = signal(this.controller.state.get());\n protected readonly text = computed<SuStepperLabels>(() => ({\n ...SU_STEPPER_LABELS,\n ...this.labels(),\n }));\n private readonly tabButtons =\n viewChildren<ElementRef<HTMLButtonElement>>('tab');\n /** The step's content takes focus once it renders, after a move the user made with the buttons */\n private focusPending = false;\n private readonly id = `su-stepper-${nextStepperId++}`;\n\n constructor() {\n const unsubscribe = this.controller.state.subscribe(state => {\n this.state.set(state);\n this.current.set(state.current);\n });\n inject(DestroyRef).onDestroy(unsubscribe);\n\n effect(() => {\n const steps = this.steps().map(step => step.options());\n const linear = this.linear();\n const current = this.current();\n untracked(() => {\n this.controller.setSteps(steps);\n this.controller.setLinear(linear);\n this.controller.select(current);\n });\n });\n\n afterRenderEffect(() => {\n const current = this.state().current;\n if (this.focusPending) {\n this.focusPending = false;\n untracked(() => this.steps()[current]?.focus());\n }\n });\n }\n\n /** Goes to the next step that isn't disabled, if the current one allows it; returns whether it moved */\n next(): boolean {\n return this.controller.next();\n }\n\n /** Goes to the previous step that isn't disabled, if the current one allows it; returns whether it moved */\n back(): boolean {\n return this.controller.back();\n }\n\n /** Goes to a step, from 0, if the rules allow it; returns whether it moved */\n goTo(index: number): boolean {\n return this.controller.goTo(index);\n }\n\n /** Starts over: back to a step (the first by default) with nothing visited or completed */\n reset(start = 0): void {\n this.controller.reset(start);\n }\n\n headerId(index: number): string {\n return `${this.id}-step-${index}`;\n }\n\n panelId(index: number): string {\n return `${this.id}-panel-${index}`;\n }\n\n protected onNext(): void {\n this.focusPending = this.next();\n }\n\n protected onBack(): void {\n this.focusPending = this.back();\n }\n\n protected onTabKeydown(event: KeyboardEvent, index: number): void {\n const target = TAB_KEYS[event.key];\n const buttons = this.tabButtons();\n if (!target || buttons.length === 0) {\n return;\n }\n event.preventDefault();\n buttons[target(index, buttons.length)]?.nativeElement.focus();\n }\n}\n","<ol\n class=\"su-stepper-steps\"\n [attr.role]=\"tabs() ? 'tablist' : null\"\n [attr.aria-orientation]=\"tabs() ? orientation() : null\"\n [attr.aria-label]=\"label() ?? text().steps\">\n @for (step of state().steps; track step.index) {\n <li\n class=\"su-stepper-step\"\n [class.is-current]=\"step.current\"\n [class.is-completed]=\"step.completed\"\n [attr.role]=\"tabs() ? 'presentation' : null\"\n [attr.aria-current]=\"!tabs() && step.current ? 'step' : null\">\n @if (tabs()) {\n <button\n #tab\n type=\"button\"\n role=\"tab\"\n class=\"su-stepper-header su-stepper-tab\"\n [id]=\"headerId(step.index)\"\n [attr.aria-controls]=\"panelId(step.index)\"\n [attr.aria-selected]=\"step.current\"\n [attr.aria-disabled]=\"step.current || step.reachable ? null : 'true'\"\n [tabIndex]=\"step.current ? 0 : -1\"\n (click)=\"goTo(step.index)\"\n (keydown)=\"onTabKeydown($event, step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </button>\n } @else {\n <div class=\"su-stepper-header\" [id]=\"headerId(step.index)\">\n <su-lib-stepper-header [step]=\"step\" [count]=\"state().count\" [labels]=\"text()\" />\n </div>\n }\n </li>\n }\n</ol>\n\n<div class=\"su-stepper-body\">\n <ng-content />\n\n @if (controls() && state().count > 1) {\n <div class=\"su-stepper-controls\">\n @if (!state().isFirst) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-back\"\n [attr.aria-disabled]=\"state().canBack ? null : 'true'\"\n (click)=\"onBack()\">\n {{ text().back }}\n </button>\n }\n @if (!state().isLast) {\n <button\n type=\"button\"\n class=\"su-stepper-button su-stepper-next\"\n [attr.aria-disabled]=\"state().canNext ? null : 'true'\"\n (click)=\"onNext()\">\n {{ text().next }}\n </button>\n }\n </div>\n }\n</div>\n"],"mappings":";;;AAYA,MAAa,aAAa,IAAI,eAAiC,YAAY;ACU3E,IAAa,kBAAb,MAAa,gBAAe;CAEjB,QAAQ,MAAe,GAAA,YAAA,CAAA,QAAA,EAAA,WAAA,QAAA,CAAA,+BAAA,CAAA,CAAA;CAEvB,UAAU,MAAM,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAEnD,UAAU,MAAM,MAAI;EAAA,GAAA,YAAA,EAAA,WAAA,UAAA,+BAAA,CAAA;EAAI,WAAW;CAAgB,CAAA;CAEnD,W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AA;EAAA,UAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,QAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,CAAA;EAAA,SAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA;IAAA,UAAA;IAAA,OAAA;IAAA,UAAA;GAAA,CAAA;EAAA,GAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,eAAA;EAAA,CAAA;EAAA,OAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CAAA,GAAA,iBAAA,eAAe,GAAA,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;EAAA,YAAA,CAAA;GAAA,MAAA,GAAA;GAAA,MAAA,CASF,OAAK,EAAA,UAAA,KAAA,CAAA;EAAA,CAAA;CAAA;AAAA,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@su-labs/stepper",
3
- "version": "21.0.0",
3
+ "version": "22.1.0",
4
4
  "description": "Accessible Angular steppers: content split into steps shown one at a time, with numbered circles joined by a line, optional titles, rules for going forward and back, horizontal or vertical, and headers that can act as tabs, themeable with CSS variables.",
5
5
  "keywords": [
6
6
  "angular",
@@ -29,11 +29,11 @@
29
29
  "url": "https://github.com/Greezaaa/settings-utils-lib/issues"
30
30
  },
31
31
  "peerDependencies": {
32
- "@angular/common": "^21.0.0",
33
- "@angular/core": "^21.0.0"
32
+ "@angular/common": "^22.0.0",
33
+ "@angular/core": "^22.0.0"
34
34
  },
35
35
  "dependencies": {
36
- "@su-labs/core": "1.10.0",
36
+ "@su-labs/core": "1.11.0",
37
37
  "tslib": "^2.3.0"
38
38
  },
39
39
  "sideEffects": false,
@@ -1,88 +1,149 @@
1
- import * as _angular_core from '@angular/core';
2
- import { Signal } from '@angular/core';
3
- import * as _su_labs_core_stepper from '@su-labs/core/stepper';
4
- import { SuStepOptions, SuStepperOrientation, SuStepperLabels } from '@su-labs/core/stepper';
5
-
1
+ import * as i0 from "@angular/core";
2
+ import { Signal } from "@angular/core";
3
+ import { SuStepOptions, SuStepperLabels, SuStepperOrientation } from "@su-labs/core/stepper";
6
4
  /** What a step needs from the stepper around it to show itself as a panel */
7
5
  interface SuStepperContext {
8
- readonly steps: Signal<readonly SuStepComponent[]>;
9
- readonly current: Signal<number>;
10
- readonly tabs: Signal<boolean>;
11
- headerId(index: number): string;
12
- panelId(index: number): string;
6
+ readonly steps: Signal<readonly SuStepComponent[]>;
7
+ readonly current: Signal<number>;
8
+ readonly tabs: Signal<boolean>;
9
+ headerId(index: number): string;
10
+ panelId(index: number): string;
13
11
  }
14
-
15
12
  /**
16
13
  * One step of `su-lib-stepper`: its content shows while it's the current step. Its rules say when the user may leave
17
14
  * it, e.g. `[canNext]="form.valid"`.
18
15
  */
19
- declare class SuStepComponent {
20
- /** The text beside the step's number; without it, only the number shows */
21
- readonly label: _angular_core.InputSignal<string | undefined>;
22
- /** The user may go forward from this step, e.g. once its form is valid @default true */
23
- readonly canNext: _angular_core.InputSignalWithTransform<boolean, unknown>;
24
- /** The user may go back from this step @default true */
25
- readonly canBack: _angular_core.InputSignalWithTransform<boolean, unknown>;
26
- /** The step can't be visited; moving forward or back skips it @default false */
27
- readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
28
- /** The step's options for `SuStepperController` */
29
- readonly options: _angular_core.Signal<SuStepOptions>;
30
- protected readonly stepper: SuStepperContext;
31
- private readonly host;
32
- private readonly index;
33
- protected readonly isCurrent: _angular_core.Signal<boolean>;
34
- protected readonly panelId: _angular_core.Signal<string>;
35
- protected readonly headerId: _angular_core.Signal<string>;
36
- /** Moves keyboard focus to the step's content */
37
- focus(): void;
38
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SuStepComponent, never>;
39
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SuStepComponent, "su-lib-step", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "canNext": { "alias": "canNext"; "required": false; "isSignal": true; }; "canBack": { "alias": "canBack"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
16
+ export declare class SuStepComponent {
17
+ /** The text beside the step's number; without it, only the number shows */
18
+ readonly label: import("@angular/core").InputSignal<string | undefined>;
19
+ /** The user may go forward from this step, e.g. once its form is valid @default true */
20
+ readonly canNext: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
21
+ /** The user may go back from this step @default true */
22
+ readonly canBack: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
23
+ /** The step can't be visited; moving forward or back skips it @default false */
24
+ readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
25
+ /** Shows the step as completed whatever the user does here, e.g. for work saved earlier @default false */
26
+ readonly completed: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
27
+ /** The step's options for `SuStepperController` */
28
+ readonly options: import("@angular/core").Signal<SuStepOptions>;
29
+ protected readonly stepper: SuStepperContext;
30
+ private readonly host;
31
+ private readonly index;
32
+ protected readonly isCurrent: import("@angular/core").Signal<boolean>;
33
+ protected readonly panelId: import("@angular/core").Signal<string>;
34
+ protected readonly headerId: import("@angular/core").Signal<string>;
35
+ /** Moves keyboard focus to the step's content */
36
+ focus(): void;
37
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuStepComponent, never>;
38
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuStepComponent, "su-lib-step", never, {
39
+ "label": {
40
+ "alias": "label";
41
+ "required": false;
42
+ "isSignal": true;
43
+ };
44
+ "canNext": {
45
+ "alias": "canNext";
46
+ "required": false;
47
+ "isSignal": true;
48
+ };
49
+ "canBack": {
50
+ "alias": "canBack";
51
+ "required": false;
52
+ "isSignal": true;
53
+ };
54
+ "disabled": {
55
+ "alias": "disabled";
56
+ "required": false;
57
+ "isSignal": true;
58
+ };
59
+ "completed": {
60
+ "alias": "completed";
61
+ "required": false;
62
+ "isSignal": true;
63
+ };
64
+ }, {}, never, ["*"], true, never>;
40
65
  }
41
-
42
66
  /**
43
67
  * Content split into steps (`su-lib-step`) shown one at a time, over `SuStepperController` from
44
68
  * `@su-labs/core/stepper`: a numbered circle per step joined by a line, horizontal or vertical, with Back and Next
45
69
  * buttons that follow each step's rules. With `tabs`, the step headers act as tabs too, still following the rules.
46
70
  */
47
- declare class SuStepperComponent implements SuStepperContext {
48
- /** @default 'horizontal' */
49
- readonly orientation: _angular_core.InputSignal<SuStepperOrientation>;
50
- /** The step headers act as tabs: clicking one goes to its step, if the rules allow it @default false */
51
- readonly tabs: _angular_core.InputSignalWithTransform<boolean, unknown>;
52
- /** Going forward by more than one step only reaches steps already visited @default false */
53
- readonly linear: _angular_core.InputSignalWithTransform<boolean, unknown>;
54
- /** Back and Next buttons under the steps; without them, call `next()` and `back()` from your own @default true */
55
- readonly controls: _angular_core.InputSignalWithTransform<boolean, unknown>;
56
- /** The name of the list of steps for screen readers @default labels.steps */
57
- readonly label: _angular_core.InputSignal<string | undefined>;
58
- /** Texts to replace, e.g. in the page's language */
59
- readonly labels: _angular_core.InputSignal<Partial<SuStepperLabels>>;
60
- /** The step on screen, from 0; setting it shows that step without checking the rules */
61
- readonly current: _angular_core.ModelSignal<number>;
62
- readonly steps: _angular_core.Signal<readonly SuStepComponent[]>;
63
- private readonly controller;
64
- protected readonly state: _angular_core.WritableSignal<_su_labs_core_stepper.SuStepperState>;
65
- protected readonly text: _angular_core.Signal<SuStepperLabels>;
66
- private readonly tabButtons;
67
- /** The step's content takes focus once it renders, after a move the user made with the buttons */
68
- private focusPending;
69
- private readonly id;
70
- constructor();
71
- /** Goes to the next step that isn't disabled, if the current one allows it; returns whether it moved */
72
- next(): boolean;
73
- /** Goes to the previous step that isn't disabled, if the current one allows it; returns whether it moved */
74
- back(): boolean;
75
- /** Goes to a step, from 0, if the rules allow it; returns whether it moved */
76
- goTo(index: number): boolean;
77
- /** Starts over: back to a step (the first by default) with nothing visited or completed */
78
- reset(start?: number): void;
79
- headerId(index: number): string;
80
- panelId(index: number): string;
81
- protected onNext(): void;
82
- protected onBack(): void;
83
- protected onTabKeydown(event: KeyboardEvent, index: number): void;
84
- static ɵfac: _angular_core.ɵɵFactoryDeclaration<SuStepperComponent, never>;
85
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<SuStepperComponent, "su-lib-stepper", never, { "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "tabs": { "alias": "tabs"; "required": false; "isSignal": true; }; "linear": { "alias": "linear"; "required": false; "isSignal": true; }; "controls": { "alias": "controls"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "labels": { "alias": "labels"; "required": false; "isSignal": true; }; "current": { "alias": "current"; "required": false; "isSignal": true; }; }, { "current": "currentChange"; }, ["steps"], ["*"], true, never>;
71
+ export declare class SuStepperComponent implements SuStepperContext {
72
+ /** @default 'horizontal' */
73
+ readonly orientation: import("@angular/core").InputSignal<SuStepperOrientation>;
74
+ /** The step headers act as tabs: clicking one goes to its step, if the rules allow it @default false */
75
+ readonly tabs: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
76
+ /** Going forward by more than one step only reaches steps already visited @default false */
77
+ readonly linear: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
78
+ /** Back and Next buttons under the steps; without them, call `next()` and `back()` from your own @default true */
79
+ readonly controls: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
80
+ /** The name of the list of steps for screen readers @default labels.steps */
81
+ readonly label: import("@angular/core").InputSignal<string | undefined>;
82
+ /** Texts to replace, e.g. in the page's language */
83
+ readonly labels: import("@angular/core").InputSignal<Partial<SuStepperLabels>>;
84
+ /** The step on screen, from 0; setting it shows that step without checking the rules */
85
+ readonly current: import("@angular/core").ModelSignal<number>;
86
+ readonly steps: import("@angular/core").Signal<readonly SuStepComponent[]>;
87
+ private readonly controller;
88
+ protected readonly state: import("@angular/core").WritableSignal<import("@su-labs/core/stepper").SuStepperState>;
89
+ protected readonly text: import("@angular/core").Signal<SuStepperLabels>;
90
+ private readonly tabButtons;
91
+ /** The step's content takes focus once it renders, after a move the user made with the buttons */
92
+ private focusPending;
93
+ private readonly id;
94
+ constructor();
95
+ /** Goes to the next step that isn't disabled, if the current one allows it; returns whether it moved */
96
+ next(): boolean;
97
+ /** Goes to the previous step that isn't disabled, if the current one allows it; returns whether it moved */
98
+ back(): boolean;
99
+ /** Goes to a step, from 0, if the rules allow it; returns whether it moved */
100
+ goTo(index: number): boolean;
101
+ /** Starts over: back to a step (the first by default) with nothing visited or completed */
102
+ reset(start?: number): void;
103
+ headerId(index: number): string;
104
+ panelId(index: number): string;
105
+ protected onNext(): void;
106
+ protected onBack(): void;
107
+ protected onTabKeydown(event: KeyboardEvent, index: number): void;
108
+ static ɵfac: i0.ɵɵFactoryDeclaration<SuStepperComponent, never>;
109
+ static ɵcmp: i0.ɵɵComponentDeclaration<SuStepperComponent, "su-lib-stepper", never, {
110
+ "orientation": {
111
+ "alias": "orientation";
112
+ "required": false;
113
+ "isSignal": true;
114
+ };
115
+ "tabs": {
116
+ "alias": "tabs";
117
+ "required": false;
118
+ "isSignal": true;
119
+ };
120
+ "linear": {
121
+ "alias": "linear";
122
+ "required": false;
123
+ "isSignal": true;
124
+ };
125
+ "controls": {
126
+ "alias": "controls";
127
+ "required": false;
128
+ "isSignal": true;
129
+ };
130
+ "label": {
131
+ "alias": "label";
132
+ "required": false;
133
+ "isSignal": true;
134
+ };
135
+ "labels": {
136
+ "alias": "labels";
137
+ "required": false;
138
+ "isSignal": true;
139
+ };
140
+ "current": {
141
+ "alias": "current";
142
+ "required": false;
143
+ "isSignal": true;
144
+ };
145
+ }, {
146
+ "current": "currentChange";
147
+ }, ["steps"], ["*"], true, never>;
86
148
  }
87
-
88
- export { SuStepComponent, SuStepperComponent };
149
+ export {};