@su-labs/stepper 19.1.0 → 20.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/README.md +2 -2
- package/fesm2022/su-labs-stepper.mjs +37 -37
- package/fesm2022/su-labs-stepper.mjs.map +1 -1
- package/index.d.ts +88 -3
- package/package.json +3 -3
- package/lib/step/step.component.d.ts +0 -30
- package/lib/stepper/stepper.component.d.ts +0 -49
- package/lib/stepper-header/stepper-header.component.d.ts +0 -11
- package/lib/stepper.context.d.ts +0 -11
- package/public-api.d.ts +0 -2
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@
|
|
19
|
+
npm install @su-labs/stepper@ng20
|
|
20
20
|
```
|
|
21
21
|
|
|
22
|
-
This is the Angular
|
|
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,15 +10,15 @@ 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
|
/** Shows the step as completed whatever the user does here, e.g. for work saved earlier @default false */
|
|
21
|
-
completed = input(false, { transform: booleanAttribute });
|
|
21
|
+
completed = input(false, ...(ngDevMode ? [{ debugName: "completed", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
22
22
|
/** The step's options for `SuStepperController` */
|
|
23
23
|
options = computed(() => ({
|
|
24
24
|
label: this.label(),
|
|
@@ -26,21 +26,21 @@ class SuStepComponent {
|
|
|
26
26
|
canBack: this.canBack(),
|
|
27
27
|
disabled: this.disabled(),
|
|
28
28
|
completed: this.completed(),
|
|
29
|
-
}));
|
|
29
|
+
}), ...(ngDevMode ? [{ debugName: "options" }] : []));
|
|
30
30
|
stepper = inject(SU_STEPPER);
|
|
31
31
|
host = inject(ElementRef);
|
|
32
|
-
index = computed(() => this.stepper.steps().indexOf(this));
|
|
33
|
-
isCurrent = computed(() => this.index() === this.stepper.current());
|
|
34
|
-
panelId = computed(() => this.stepper.panelId(this.index()));
|
|
35
|
-
headerId = computed(() => this.stepper.headerId(this.index()));
|
|
32
|
+
index = computed(() => this.stepper.steps().indexOf(this), ...(ngDevMode ? [{ debugName: "index" }] : []));
|
|
33
|
+
isCurrent = computed(() => this.index() === this.stepper.current(), ...(ngDevMode ? [{ debugName: "isCurrent" }] : []));
|
|
34
|
+
panelId = computed(() => this.stepper.panelId(this.index()), ...(ngDevMode ? [{ debugName: "panelId" }] : []));
|
|
35
|
+
headerId = computed(() => this.stepper.headerId(this.index()), ...(ngDevMode ? [{ debugName: "headerId" }] : []));
|
|
36
36
|
/** Moves keyboard focus to the step's content */
|
|
37
37
|
focus() {
|
|
38
38
|
this.host.nativeElement.focus();
|
|
39
39
|
}
|
|
40
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
41
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "
|
|
40
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
41
|
+
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 }, completed: { classPropertyName: "completed", publicName: "completed", 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 });
|
|
42
42
|
}
|
|
43
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
43
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepComponent, decorators: [{
|
|
44
44
|
type: Component,
|
|
45
45
|
args: [{ selector: 'su-lib-step', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
46
46
|
class: 'su-stepper-panel',
|
|
@@ -50,13 +50,13 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
50
50
|
'[attr.aria-labelledby]': 'headerId()',
|
|
51
51
|
'[hidden]': '!isCurrent()',
|
|
52
52
|
}, 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"] }]
|
|
53
|
-
}] });
|
|
53
|
+
}], 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 }] }], completed: [{ type: i0.Input, args: [{ isSignal: true, alias: "completed", required: false }] }] } });
|
|
54
54
|
|
|
55
55
|
/** A step's circle with its number and its label, with the step's place and state for screen readers */
|
|
56
56
|
class SuStepperHeaderComponent {
|
|
57
|
-
step = input.required();
|
|
58
|
-
count = input.required();
|
|
59
|
-
labels = input.required();
|
|
57
|
+
step = input.required(...(ngDevMode ? [{ debugName: "step" }] : []));
|
|
58
|
+
count = input.required(...(ngDevMode ? [{ debugName: "count" }] : []));
|
|
59
|
+
labels = input.required(...(ngDevMode ? [{ debugName: "labels" }] : []));
|
|
60
60
|
description = computed(() => {
|
|
61
61
|
const step = this.step();
|
|
62
62
|
const labels = this.labels();
|
|
@@ -68,11 +68,11 @@ class SuStepperHeaderComponent {
|
|
|
68
68
|
]
|
|
69
69
|
.filter(part => part !== null)
|
|
70
70
|
.join(', ');
|
|
71
|
-
});
|
|
72
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
73
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
71
|
+
}, ...(ngDevMode ? [{ debugName: "description" }] : []));
|
|
72
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepperHeaderComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
73
|
+
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 });
|
|
74
74
|
}
|
|
75
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
75
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepperHeaderComponent, decorators: [{
|
|
76
76
|
type: Component,
|
|
77
77
|
args: [{ selector: 'su-lib-stepper-header', changeDetection: ChangeDetectionStrategy.OnPush, host: {
|
|
78
78
|
class: 'su-stepper-header-content',
|
|
@@ -81,7 +81,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.25", ngImpo
|
|
|
81
81
|
'[class.is-visited]': 'step().visited',
|
|
82
82
|
'[class.is-disabled]': 'step().disabled',
|
|
83
83
|
}, 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"] }]
|
|
84
|
-
}] });
|
|
84
|
+
}], 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 }] }] } });
|
|
85
85
|
|
|
86
86
|
let nextStepperId = 0;
|
|
87
87
|
/** Keys that move focus between the step headers when they act as tabs, and where each one goes */
|
|
@@ -100,27 +100,27 @@ const TAB_KEYS = {
|
|
|
100
100
|
*/
|
|
101
101
|
class SuStepperComponent {
|
|
102
102
|
/** @default 'horizontal' */
|
|
103
|
-
orientation = input('horizontal');
|
|
103
|
+
orientation = input('horizontal', ...(ngDevMode ? [{ debugName: "orientation" }] : []));
|
|
104
104
|
/** The step headers act as tabs: clicking one goes to its step, if the rules allow it @default false */
|
|
105
|
-
tabs = input(false, { transform: booleanAttribute });
|
|
105
|
+
tabs = input(false, ...(ngDevMode ? [{ debugName: "tabs", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
106
106
|
/** Going forward by more than one step only reaches steps already visited @default false */
|
|
107
|
-
linear = input(false, { transform: booleanAttribute });
|
|
107
|
+
linear = input(false, ...(ngDevMode ? [{ debugName: "linear", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
108
108
|
/** Back and Next buttons under the steps; without them, call `next()` and `back()` from your own @default true */
|
|
109
|
-
controls = input(true, { transform: booleanAttribute });
|
|
109
|
+
controls = input(true, ...(ngDevMode ? [{ debugName: "controls", transform: booleanAttribute }] : [{ transform: booleanAttribute }]));
|
|
110
110
|
/** The name of the list of steps for screen readers @default labels.steps */
|
|
111
|
-
label = input();
|
|
111
|
+
label = input(...(ngDevMode ? [undefined, { debugName: "label" }] : []));
|
|
112
112
|
/** Texts to replace, e.g. in the page's language */
|
|
113
|
-
labels = input({});
|
|
113
|
+
labels = input({}, ...(ngDevMode ? [{ debugName: "labels" }] : []));
|
|
114
114
|
/** The step on screen, from 0; setting it shows that step without checking the rules */
|
|
115
|
-
current = model(0);
|
|
116
|
-
steps = contentChildren(SuStepComponent);
|
|
115
|
+
current = model(0, ...(ngDevMode ? [{ debugName: "current" }] : []));
|
|
116
|
+
steps = contentChildren(SuStepComponent, ...(ngDevMode ? [{ debugName: "steps" }] : []));
|
|
117
117
|
controller = new SuStepperController();
|
|
118
|
-
state = signal(this.controller.state.get());
|
|
118
|
+
state = signal(this.controller.state.get(), ...(ngDevMode ? [{ debugName: "state" }] : []));
|
|
119
119
|
text = computed(() => ({
|
|
120
120
|
...SU_STEPPER_LABELS,
|
|
121
121
|
...this.labels(),
|
|
122
|
-
}));
|
|
123
|
-
tabButtons = viewChildren('tab');
|
|
122
|
+
}), ...(ngDevMode ? [{ debugName: "text" }] : []));
|
|
123
|
+
tabButtons = viewChildren('tab', ...(ngDevMode ? [{ debugName: "tabButtons" }] : []));
|
|
124
124
|
/** The step's content takes focus once it renders, after a move the user made with the buttons */
|
|
125
125
|
focusPending = false;
|
|
126
126
|
id = `su-stepper-${nextStepperId++}`;
|
|
@@ -185,16 +185,16 @@ class SuStepperComponent {
|
|
|
185
185
|
event.preventDefault();
|
|
186
186
|
buttons[target(index, buttons.length)]?.nativeElement.focus();
|
|
187
187
|
}
|
|
188
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "
|
|
189
|
-
static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "
|
|
188
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepperComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
|
|
189
|
+
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 });
|
|
190
190
|
}
|
|
191
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
191
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "20.3.35", ngImport: i0, type: SuStepperComponent, decorators: [{
|
|
192
192
|
type: Component,
|
|
193
193
|
args: [{ selector: 'su-lib-stepper', changeDetection: ChangeDetectionStrategy.OnPush, imports: [SuStepperHeaderComponent], providers: [{ provide: SU_STEPPER, useExisting: SuStepperComponent }], host: {
|
|
194
194
|
class: 'su-stepper',
|
|
195
195
|
'[class.su-stepper-vertical]': "orientation() === 'vertical'",
|
|
196
196
|
}, 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"] }]
|
|
197
|
-
}], ctorParameters: () => [] });
|
|
197
|
+
}], 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 }] }] } });
|
|
198
198
|
|
|
199
199
|
/**
|
|
200
200
|
* 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 /** 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","/**\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,EAAU;;IAEvB,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;;IAEtD,OAAO,GAAG,KAAK,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;;IAEtD,QAAQ,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,CAAC;;IAExD,SAAS,GAAG,KAAK,CAAC,KAAK,EAAE,EAAE,SAAS,EAAE,gBAAgB,EAAE,C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AA,EAAA,WAAA,EAAA,CAAA,EAAA,YAAA,EAAA,YAAA,EAAA,SAAA,EAAA,CAAA,KAAA,CAAA,EAAA,WAAA,EAAA,IAAA,EAAA,QAAA,EAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,ECrDlD,ulEA8DA,m8FDlCY,wBAAwB,EAAA,QAAA,EAAA,uBAAA,EAAA,MAAA,EAAA,CAAA,MAAA,EAAA,OAAA,EAAA,QAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;4FASvB,kBAAkB,EAAA,UAAA,EAAA,CAAA;kBAZ9B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,mBACT,uBAAuB,CAAC,MAAM,EAAA,OAAA,EACtC,CAAC,wBAAwB,CAAC,EAAA,SAAA,EAGxB,CAAC,EAAE,OAAO,EAAE,UAAU,EAAE,WAAW,EAAA,kBAAoB,EAAE,CAAC,EAAA,IAAA,EAC/D;AACJ,wBAAA,KAAK,EAAE,YAAY;AACnB,wBAAA,6BAA6B,EAAE,8BAA8B;AAC9D,qBAAA,EAAA,QAAA,EAAA,ulEAAA,EAAA,MAAA,EAAA,CAAA,24FAAA,CAAA,EAAA;;;AEnCH;;AAEG;;;;"}
|
|
1
|
+
{"version":3,"file":"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 /** 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","/**\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,GAAA,EAAA,CAAA,CAAU;;AAEv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,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,90 @@
|
|
|
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
|
-
*
|
|
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
|
-
|
|
5
|
-
|
|
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
|
+
/** Shows the step as completed whatever the user does here, e.g. for work saved earlier @default false */
|
|
29
|
+
readonly completed: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
30
|
+
/** The step's options for `SuStepperController` */
|
|
31
|
+
readonly options: _angular_core.Signal<SuStepOptions>;
|
|
32
|
+
protected readonly stepper: SuStepperContext;
|
|
33
|
+
private readonly host;
|
|
34
|
+
private readonly index;
|
|
35
|
+
protected readonly isCurrent: _angular_core.Signal<boolean>;
|
|
36
|
+
protected readonly panelId: _angular_core.Signal<string>;
|
|
37
|
+
protected readonly headerId: _angular_core.Signal<string>;
|
|
38
|
+
/** Moves keyboard focus to the step's content */
|
|
39
|
+
focus(): void;
|
|
40
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SuStepComponent, never>;
|
|
41
|
+
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; }; "completed": { "alias": "completed"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
/**
|
|
45
|
+
* Content split into steps (`su-lib-step`) shown one at a time, over `SuStepperController` from
|
|
46
|
+
* `@su-labs/core/stepper`: a numbered circle per step joined by a line, horizontal or vertical, with Back and Next
|
|
47
|
+
* buttons that follow each step's rules. With `tabs`, the step headers act as tabs too, still following the rules.
|
|
48
|
+
*/
|
|
49
|
+
declare class SuStepperComponent implements SuStepperContext {
|
|
50
|
+
/** @default 'horizontal' */
|
|
51
|
+
readonly orientation: _angular_core.InputSignal<SuStepperOrientation>;
|
|
52
|
+
/** The step headers act as tabs: clicking one goes to its step, if the rules allow it @default false */
|
|
53
|
+
readonly tabs: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
54
|
+
/** Going forward by more than one step only reaches steps already visited @default false */
|
|
55
|
+
readonly linear: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
56
|
+
/** Back and Next buttons under the steps; without them, call `next()` and `back()` from your own @default true */
|
|
57
|
+
readonly controls: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
58
|
+
/** The name of the list of steps for screen readers @default labels.steps */
|
|
59
|
+
readonly label: _angular_core.InputSignal<string | undefined>;
|
|
60
|
+
/** Texts to replace, e.g. in the page's language */
|
|
61
|
+
readonly labels: _angular_core.InputSignal<Partial<SuStepperLabels>>;
|
|
62
|
+
/** The step on screen, from 0; setting it shows that step without checking the rules */
|
|
63
|
+
readonly current: _angular_core.ModelSignal<number>;
|
|
64
|
+
readonly steps: _angular_core.Signal<readonly SuStepComponent[]>;
|
|
65
|
+
private readonly controller;
|
|
66
|
+
protected readonly state: _angular_core.WritableSignal<_su_labs_core_stepper.SuStepperState>;
|
|
67
|
+
protected readonly text: _angular_core.Signal<SuStepperLabels>;
|
|
68
|
+
private readonly tabButtons;
|
|
69
|
+
/** The step's content takes focus once it renders, after a move the user made with the buttons */
|
|
70
|
+
private focusPending;
|
|
71
|
+
private readonly id;
|
|
72
|
+
constructor();
|
|
73
|
+
/** Goes to the next step that isn't disabled, if the current one allows it; returns whether it moved */
|
|
74
|
+
next(): boolean;
|
|
75
|
+
/** Goes to the previous step that isn't disabled, if the current one allows it; returns whether it moved */
|
|
76
|
+
back(): boolean;
|
|
77
|
+
/** Goes to a step, from 0, if the rules allow it; returns whether it moved */
|
|
78
|
+
goTo(index: number): boolean;
|
|
79
|
+
/** Starts over: back to a step (the first by default) with nothing visited or completed */
|
|
80
|
+
reset(start?: number): void;
|
|
81
|
+
headerId(index: number): string;
|
|
82
|
+
panelId(index: number): string;
|
|
83
|
+
protected onNext(): void;
|
|
84
|
+
protected onBack(): void;
|
|
85
|
+
protected onTabKeydown(event: KeyboardEvent, index: number): void;
|
|
86
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<SuStepperComponent, never>;
|
|
87
|
+
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>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
export { SuStepComponent, SuStepperComponent };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@su-labs/stepper",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "20.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,8 +29,8 @@
|
|
|
29
29
|
"url": "https://github.com/Greezaaa/settings-utils-lib/issues"
|
|
30
30
|
},
|
|
31
31
|
"peerDependencies": {
|
|
32
|
-
"@angular/common": "^
|
|
33
|
-
"@angular/core": "^
|
|
32
|
+
"@angular/common": "^20.0.0",
|
|
33
|
+
"@angular/core": "^20.0.0"
|
|
34
34
|
},
|
|
35
35
|
"dependencies": {
|
|
36
36
|
"@su-labs/core": "1.11.0",
|
|
@@ -1,30 +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
|
-
/** Shows the step as completed whatever the user does here, e.g. for work saved earlier @default false */
|
|
17
|
-
readonly completed: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
18
|
-
/** The step's options for `SuStepperController` */
|
|
19
|
-
readonly options: import("@angular/core").Signal<SuStepOptions>;
|
|
20
|
-
protected readonly stepper: import("../stepper.context").SuStepperContext;
|
|
21
|
-
private readonly host;
|
|
22
|
-
private readonly index;
|
|
23
|
-
protected readonly isCurrent: import("@angular/core").Signal<boolean>;
|
|
24
|
-
protected readonly panelId: import("@angular/core").Signal<string>;
|
|
25
|
-
protected readonly headerId: import("@angular/core").Signal<string>;
|
|
26
|
-
/** Moves keyboard focus to the step's content */
|
|
27
|
-
focus(): void;
|
|
28
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<SuStepComponent, never>;
|
|
29
|
-
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; }; "completed": { "alias": "completed"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
|
|
30
|
-
}
|
|
@@ -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
|
-
}
|
package/lib/stepper.context.d.ts
DELETED
|
@@ -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