@su-labs/stepper 19.0.0 → 20.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md 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@ng19
19
+ npm install @su-labs/stepper@ng20
20
20
  ```
21
21
 
22
- This is the Angular 19 version. For the newest Angular, install `@su-labs/stepper` without a tag.
22
+ This is the Angular 20 version. For the newest Angular, install `@su-labs/stepper` without a tag.
23
23
 
24
24
  ## Usage
25
25
 
@@ -10,34 +10,34 @@ const SU_STEPPER = new InjectionToken('SU_STEPPER');
10
10
  */
11
11
  class SuStepComponent {
12
12
  /** The text beside the step's number; without it, only the number shows */
13
- label = input();
13
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
14
14
  /** The user may go forward from this step, e.g. once its form is valid @default true */
15
- canNext = input(true, { transform: booleanAttribute });
15
+ canNext = input(true, ...(ngDevMode ? [{ debugName: "canNext", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
16
16
  /** The user may go back from this step @default true */
17
- canBack = input(true, { transform: booleanAttribute });
17
+ canBack = input(true, ...(ngDevMode ? [{ debugName: "canBack", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
18
18
  /** The step can't be visited; moving forward or back skips it @default false */
19
- disabled = input(false, { transform: booleanAttribute });
19
+ disabled = input(false, ...(ngDevMode ? [{ debugName: "disabled", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
20
20
  /** The step's options for `SuStepperController` */
21
21
  options = computed(() => ({
22
22
  label: this.label(),
23
23
  canNext: this.canNext(),
24
24
  canBack: this.canBack(),
25
25
  disabled: this.disabled(),
26
- }));
26
+ }), ...(ngDevMode ? [{ debugName: "options" }] : []));
27
27
  stepper = inject(SU_STEPPER);
28
28
  host = inject(ElementRef);
29
- index = computed(() => this.stepper.steps().indexOf(this));
30
- isCurrent = computed(() => this.index() === this.stepper.current());
31
- panelId = computed(() => this.stepper.panelId(this.index()));
32
- headerId = computed(() => this.stepper.headerId(this.index()));
29
+ index = computed(() => this.stepper.steps().indexOf(this), ...(ngDevMode ? [{ debugName: "index" }] : []));
30
+ isCurrent = computed(() => this.index() === this.stepper.current(), ...(ngDevMode ? [{ debugName: "isCurrent" }] : []));
31
+ panelId = computed(() => this.stepper.panelId(this.index()), ...(ngDevMode ? [{ debugName: "panelId" }] : []));
32
+ headerId = computed(() => this.stepper.headerId(this.index()), ...(ngDevMode ? [{ debugName: "headerId" }] : []));
33
33
  /** Moves keyboard focus to the step's content */
34
34
  focus() {
35
35
  this.host.nativeElement.focus();
36
36
  }
37
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
38
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "19.2.25", 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 });
37
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
38
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "20.3.35", 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
39
  }
40
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuStepComponent, decorators: [{
40
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepComponent, decorators: [{
41
41
  type: Component,
42
42
  args: [{ selector: 'su-lib-step', changeDetection: ChangeDetectionStrategy.OnPush, host: {
43
43
  class: 'su-stepper-panel',
@@ -47,13 +47,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
47
47
  '[attr.aria-labelledby]': 'headerId()',
48
48
  '[hidden]': '!isCurrent()',
49
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
- }] });
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
51
 
52
52
  /** A step's circle with its number and its label, with the step's place and state for screen readers */
53
53
  class SuStepperHeaderComponent {
54
- step = input.required();
55
- count = input.required();
56
- labels = input.required();
54
+ step = input.required(...(ngDevMode ? [{ debugName: "step" }] : []));
55
+ count = input.required(...(ngDevMode ? [{ debugName: "count" }] : []));
56
+ labels = input.required(...(ngDevMode ? [{ debugName: "labels" }] : []));
57
57
  description = computed(() => {
58
58
  const step = this.step();
59
59
  const labels = this.labels();
@@ -65,11 +65,11 @@ class SuStepperHeaderComponent {
65
65
  ]
66
66
  .filter(part => part !== null)
67
67
  .join(', ');
68
- });
69
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuStepperHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", 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 });
68
+ }, ...(ngDevMode ? [{ debugName: "description" }] : []));
69
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepperHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
70
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.35", 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
71
  }
72
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuStepperHeaderComponent, decorators: [{
72
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepperHeaderComponent, decorators: [{
73
73
  type: Component,
74
74
  args: [{ selector: 'su-lib-stepper-header', changeDetection: ChangeDetectionStrategy.OnPush, host: {
75
75
  class: 'su-stepper-header-content',
@@ -78,7 +78,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
78
78
  '[class.is-visited]': 'step().visited',
79
79
  '[class.is-disabled]': 'step().disabled',
80
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
- }] });
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
82
 
83
83
  let nextStepperId = 0;
84
84
  /** Keys that move focus between the step headers when they act as tabs, and where each one goes */
@@ -97,27 +97,27 @@ const TAB_KEYS = {
97
97
  */
98
98
  class SuStepperComponent {
99
99
  /** @default 'horizontal' */
100
- orientation = input('horizontal');
100
+ orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
101
101
  /** The step headers act as tabs: clicking one goes to its step, if the rules allow it @default false */
102
- tabs = input(false, { transform: booleanAttribute });
102
+ tabs = input(false, ...(ngDevMode ? [{ debugName: "tabs", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
103
103
  /** Going forward by more than one step only reaches steps already visited @default false */
104
- linear = input(false, { transform: booleanAttribute });
104
+ linear = input(false, ...(ngDevMode ? [{ debugName: "linear", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
105
105
  /** Back and Next buttons under the steps; without them, call `next()` and `back()` from your own @default true */
106
- controls = input(true, { transform: booleanAttribute });
106
+ controls = input(true, ...(ngDevMode ? [{ debugName: "controls", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
107
107
  /** The name of the list of steps for screen readers @default labels.steps */
108
- label = input();
108
+ label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
109
109
  /** Texts to replace, e.g. in the page's language */
110
- labels = input({});
110
+ labels = input({}, ...(ngDevMode ? [{ debugName: "labels" }] : []));
111
111
  /** The step on screen, from 0; setting it shows that step without checking the rules */
112
- current = model(0);
113
- steps = contentChildren(SuStepComponent);
112
+ current = model(0, ...(ngDevMode ? [{ debugName: "current" }] : []));
113
+ steps = contentChildren(SuStepComponent, ...(ngDevMode ? [{ debugName: "steps" }] : []));
114
114
  controller = new SuStepperController();
115
- state = signal(this.controller.state.get());
115
+ state = signal(this.controller.state.get(), ...(ngDevMode ? [{ debugName: "state" }] : []));
116
116
  text = computed(() => ({
117
117
  ...SU_STEPPER_LABELS,
118
118
  ...this.labels(),
119
- }));
120
- tabButtons = viewChildren('tab');
119
+ }), ...(ngDevMode ? [{ debugName: "text" }] : []));
120
+ tabButtons = viewChildren('tab', ...(ngDevMode ? [{ debugName: "tabButtons" }] : []));
121
121
  /** The step's content takes focus once it renders, after a move the user made with the buttons */
122
122
  focusPending = false;
123
123
  id = `su-stepper-${nextStepperId++}`;
@@ -182,16 +182,16 @@ class SuStepperComponent {
182
182
  event.preventDefault();
183
183
  buttons[target(index, buttons.length)]?.nativeElement.focus();
184
184
  }
185
- static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
186
- static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.25", 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 });
185
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
186
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "20.3.35", 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
187
  }
188
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImport: i0, type: SuStepperComponent, decorators: [{
188
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepperComponent, decorators: [{
189
189
  type: Component,
190
190
  args: [{ selector: 'su-lib-stepper', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SuStepperHeaderComponent], providers: [{ provide: SU_STEPPER, useExisting: SuStepperComponent }], host: {
191
191
  class: 'su-stepper',
192
192
  '[class.su-stepper-vertical]': "orientation() === 'vertical'",
193
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: () => [] });
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
195
 
196
196
  /**
197
197
  * Generated bundle index. Do not edit.
@@ -1 +1 @@
1
- {"version":3,"file":"su-labs-stepper.mjs","sources":["../../../../compat/angular-19/build/stepper/src/lib/stepper.context.ts","../../../../compat/angular-19/build/stepper/src/lib/step/step.component.ts","../../../../compat/angular-19/build/stepper/src/lib/step/step.component.html","../../../../compat/angular-19/build/stepper/src/lib/stepper-header/stepper-header.component.ts","../../../../compat/angular-19/build/stepper/src/lib/stepper-header/stepper-header.component.html","../../../../compat/angular-19/build/stepper/src/lib/stepper/stepper.component.ts","../../../../compat/angular-19/build/stepper/src/lib/stepper/stepper.component.html","../../../../compat/angular-19/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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":"su-labs-stepper.mjs","sources":["../../../../compat/angular-20/build/stepper/src/lib/stepper.context.ts","../../../../compat/angular-20/build/stepper/src/lib/step/step.component.ts","../../../../compat/angular-20/build/stepper/src/lib/step/step.component.html","../../../../compat/angular-20/build/stepper/src/lib/stepper-header/stepper-header.component.ts","../../../../compat/angular-20/build/stepper/src/lib/stepper-header/stepper-header.component.html","../../../../compat/angular-20/build/stepper/src/lib/stepper/stepper.component.ts","../../../../compat/angular-20/build/stepper/src/lib/stepper/stepper.component.html","../../../../compat/angular-20/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","/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AA,CAAA,KAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,KAAA,EAAA,UAAA,EAAA,QAAA,EAAA,KAAA,EAAA,CAAA,EAAA,CAAA,EAAA,KAAA,EAAA,CAAA,EAAA,IAAA,EAAA,EAAA,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;;;;"}
package/index.d.ts CHANGED
@@ -1,5 +1,88 @@
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
+
6
+ /** What a step needs from the stepper around it to show itself as a panel */
7
+ 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;
13
+ }
14
+
1
15
  /**
2
- * Generated bundle index. Do not edit.
16
+ * One step of `su-lib-stepper`: its content shows while it's the current step. Its rules say when the user may leave
17
+ * it, e.g. `[canNext]="form.valid"`.
3
18
  */
4
- /// <amd-module name="@su-labs/stepper" />
5
- export * from './public-api';
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>;
40
+ }
41
+
42
+ /**
43
+ * Content split into steps (`su-lib-step`) shown one at a time, over `SuStepperController` from
44
+ * `@su-labs/core/stepper`: a numbered circle per step joined by a line, horizontal or vertical, with Back and Next
45
+ * buttons that follow each step's rules. With `tabs`, the step headers act as tabs too, still following the rules.
46
+ */
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>;
86
+ }
87
+
88
+ export { SuStepComponent, SuStepperComponent };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@su-labs/stepper",
3
- "version": "19.0.0",
3
+ "version": "20.0.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,8 +29,8 @@
29
29
  "url": "https://github.com/Greezaaa/settings-utils-lib/issues"
30
30
  },
31
31
  "peerDependencies": {
32
- "@angular/common": "^19.0.0",
33
- "@angular/core": "^19.0.0"
32
+ "@angular/common": "^20.0.0",
33
+ "@angular/core": "^20.0.0"
34
34
  },
35
35
  "dependencies": {
36
36
  "@su-labs/core": "1.10.0",
@@ -1,28 +0,0 @@
1
- import { SuStepOptions } from '@su-labs/core/stepper';
2
- import * as i0 from "@angular/core";
3
- /**
4
- * One step of `su-lib-stepper`: its content shows while it's the current step. Its rules say when the user may leave
5
- * it, e.g. `[canNext]="form.valid"`.
6
- */
7
- export declare class SuStepComponent {
8
- /** The text beside the step's number; without it, only the number shows */
9
- readonly label: import("@angular/core").InputSignal<string | undefined>;
10
- /** The user may go forward from this step, e.g. once its form is valid @default true */
11
- readonly canNext: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
12
- /** The user may go back from this step @default true */
13
- readonly canBack: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
14
- /** The step can't be visited; moving forward or back skips it @default false */
15
- readonly disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
16
- /** The step's options for `SuStepperController` */
17
- readonly options: import("@angular/core").Signal<SuStepOptions>;
18
- protected readonly stepper: import("../stepper.context").SuStepperContext;
19
- private readonly host;
20
- private readonly index;
21
- protected readonly isCurrent: import("@angular/core").Signal<boolean>;
22
- protected readonly panelId: import("@angular/core").Signal<string>;
23
- protected readonly headerId: import("@angular/core").Signal<string>;
24
- /** Moves keyboard focus to the step's content */
25
- focus(): void;
26
- static ɵfac: i0.ɵɵFactoryDeclaration<SuStepComponent, never>;
27
- static ɵcmp: i0.ɵɵ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>;
28
- }
@@ -1,49 +0,0 @@
1
- import { SuStepperLabels, SuStepperOrientation } from '@su-labs/core/stepper';
2
- import { SuStepComponent } from '../step/step.component';
3
- import { SuStepperContext } from '../stepper.context';
4
- import * as i0 from "@angular/core";
5
- /**
6
- * Content split into steps (`su-lib-step`) shown one at a time, over `SuStepperController` from
7
- * `@su-labs/core/stepper`: a numbered circle per step joined by a line, horizontal or vertical, with Back and Next
8
- * buttons that follow each step's rules. With `tabs`, the step headers act as tabs too, still following the rules.
9
- */
10
- export declare class SuStepperComponent implements SuStepperContext {
11
- /** @default 'horizontal' */
12
- readonly orientation: import("@angular/core").InputSignal<SuStepperOrientation>;
13
- /** The step headers act as tabs: clicking one goes to its step, if the rules allow it @default false */
14
- readonly tabs: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
15
- /** Going forward by more than one step only reaches steps already visited @default false */
16
- readonly linear: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
17
- /** Back and Next buttons under the steps; without them, call `next()` and `back()` from your own @default true */
18
- readonly controls: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
19
- /** The name of the list of steps for screen readers @default labels.steps */
20
- readonly label: import("@angular/core").InputSignal<string | undefined>;
21
- /** Texts to replace, e.g. in the page's language */
22
- readonly labels: import("@angular/core").InputSignal<Partial<SuStepperLabels>>;
23
- /** The step on screen, from 0; setting it shows that step without checking the rules */
24
- readonly current: import("@angular/core").ModelSignal<number>;
25
- readonly steps: import("@angular/core").Signal<readonly SuStepComponent[]>;
26
- private readonly controller;
27
- protected readonly state: import("@angular/core").WritableSignal<import("@su-labs/core/stepper").SuStepperState>;
28
- protected readonly text: import("@angular/core").Signal<SuStepperLabels>;
29
- private readonly tabButtons;
30
- /** The step's content takes focus once it renders, after a move the user made with the buttons */
31
- private focusPending;
32
- private readonly id;
33
- constructor();
34
- /** Goes to the next step that isn't disabled, if the current one allows it; returns whether it moved */
35
- next(): boolean;
36
- /** Goes to the previous step that isn't disabled, if the current one allows it; returns whether it moved */
37
- back(): boolean;
38
- /** Goes to a step, from 0, if the rules allow it; returns whether it moved */
39
- goTo(index: number): boolean;
40
- /** Starts over: back to a step (the first by default) with nothing visited or completed */
41
- reset(start?: number): void;
42
- headerId(index: number): string;
43
- panelId(index: number): string;
44
- protected onNext(): void;
45
- protected onBack(): void;
46
- protected onTabKeydown(event: KeyboardEvent, index: number): void;
47
- static ɵfac: i0.ɵɵFactoryDeclaration<SuStepperComponent, never>;
48
- static ɵcmp: i0.ɵɵ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>;
49
- }
@@ -1,11 +0,0 @@
1
- import { SuStepperLabels, SuStepView } from '@su-labs/core/stepper';
2
- import * as i0 from "@angular/core";
3
- /** A step's circle with its number and its label, with the step's place and state for screen readers */
4
- export declare class SuStepperHeaderComponent {
5
- readonly step: import("@angular/core").InputSignal<SuStepView>;
6
- readonly count: import("@angular/core").InputSignal<number>;
7
- readonly labels: import("@angular/core").InputSignal<SuStepperLabels>;
8
- protected readonly description: import("@angular/core").Signal<string>;
9
- static ɵfac: i0.ɵɵFactoryDeclaration<SuStepperHeaderComponent, never>;
10
- static ɵcmp: i0.ɵɵComponentDeclaration<SuStepperHeaderComponent, "su-lib-stepper-header", never, { "step": { "alias": "step"; "required": true; "isSignal": true; }; "count": { "alias": "count"; "required": true; "isSignal": true; }; "labels": { "alias": "labels"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
11
- }
@@ -1,11 +0,0 @@
1
- import { InjectionToken, Signal } from '@angular/core';
2
- import type { SuStepComponent } from './step/step.component';
3
- /** What a step needs from the stepper around it to show itself as a panel */
4
- export interface SuStepperContext {
5
- readonly steps: Signal<readonly SuStepComponent[]>;
6
- readonly current: Signal<number>;
7
- readonly tabs: Signal<boolean>;
8
- headerId(index: number): string;
9
- panelId(index: number): string;
10
- }
11
- export declare const SU_STEPPER: InjectionToken<SuStepperContext>;
package/public-api.d.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './lib/step/step.component';
2
- export * from './lib/stepper/stepper.component';