@lifecorner/angular-ui-kit 3.30.2 → 3.32.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.
@@ -1,4 +1,12 @@
1
+ import { BadgeVariant } from "@lifecorner/angular-ui-kit/badge";
1
2
  import * as i0 from "@angular/core";
3
+ /** A count or status on a bottom-nav entry (`BottomNavItem.badge`, `moreBadge`). */
4
+ export interface BottomNavBadge {
5
+ /** Text or number inside the badge. */
6
+ value: string | number;
7
+ /** Badge colour (`lc-badge` variant). */
8
+ variant?: BadgeVariant;
9
+ }
2
10
  /**
3
11
  * A destination in the bottom navigation bar. A subset of `NavigationItem`, so
4
12
  * the side navigation's items can be passed as they are (sections and children
@@ -16,12 +24,7 @@ export interface BottomNavItem {
16
24
  /** Sort order; items without one keep their array order. */
17
25
  displayOrder?: number;
18
26
  /** Count or status shown on the icon; read out through `badgeAriaLabel`. */
19
- badge?: {
20
- /** Text or number inside the badge. */
21
- value: string | number;
22
- /** Badge colour (`lc-badge` variant). */
23
- variant?: 'default' | 'primary' | 'success' | 'warning' | 'error' | 'info';
24
- };
27
+ badge?: BottomNavBadge;
25
28
  }
26
29
  /** Surface of the bar: `docked` spans the bottom edge, `floating` is an inset pill. */
27
30
  export type BottomNavVariant = 'docked' | 'floating';
@@ -129,8 +132,22 @@ export declare class BottomNavComponent {
129
132
  */
130
133
  readonly moreRoute: import("@angular/core").InputSignal<string>;
131
134
  /**
132
- * Text read after an item's label when it has a badge; `{value}` is
133
- * replaced with the badge value (e.g. "3 new").
135
+ * Badge on the "More" entry (on overflow or with `showMore`), e.g. the open
136
+ * tasks on the pages behind it: drawn like an item badge and read after the
137
+ * label through `badgeAriaLabel`. The kit doesn't add up the hidden
138
+ * destinations' badges; pass the value to show. It sits on the bar's last
139
+ * entry, so keep it to two characters (`'9+'`). `null` or `undefined`: no
140
+ * badge.
141
+ *
142
+ * @default null
143
+ */
144
+ readonly moreBadge: import("@angular/core").InputSignal<BottomNavBadge | null | undefined>;
145
+ /**
146
+ * Text read after an item's label, and after the "More" label with
147
+ * `moreBadge`, when it has a badge; `{value}` is replaced with the badge
148
+ * value (e.g. "3 new").
149
+ *
150
+ * @default '{value} new'
134
151
  */
135
152
  readonly badgeAriaLabel: import("@angular/core").InputSignal<string>;
136
153
  /** The current item was tapped again (e.g. scroll the page to the top). */
@@ -205,6 +222,11 @@ export declare class BottomNavComponent {
205
222
  "required": false;
206
223
  "isSignal": true;
207
224
  };
225
+ "moreBadge": {
226
+ "alias": "moreBadge";
227
+ "required": false;
228
+ "isSignal": true;
229
+ };
208
230
  "badgeAriaLabel": {
209
231
  "alias": "badgeAriaLabel";
210
232
  "required": false;
@@ -76,6 +76,16 @@ export declare class ComboboxComponent implements ControlValueAccessor {
76
76
  readonly createOptionLabel: import("@angular/core").InputSignal<string>;
77
77
  /** Size */
78
78
  readonly size: import("@angular/core").InputSignal<ComboboxSize>;
79
+ /**
80
+ * Whether the list opens when the field gets focus (3.32, request 051).
81
+ * With `false`, focus alone (`focus()` from the page, Tab) leaves the list
82
+ * closed and `aria-expanded="false"`; a click or tap on the field, typing or
83
+ * ArrowDown opens it. Use it in forms that move focus into the field
84
+ * themselves, on open or to the first invalid field after a rejected save.
85
+ * Escape and choosing an option work as before.
86
+ * @default true
87
+ */
88
+ readonly openOnFocus: import("@angular/core").InputSignal<boolean>;
79
89
  /**
80
90
  * The `value` of the selected option, two-way (3.29, regeln row 2):
81
91
  * `[(selectedValue)]="month"`. Shows the matching option's label (from
@@ -162,10 +172,16 @@ export declare class ComboboxComponent implements ControlValueAccessor {
162
172
  * and its buttons keeps focus where it is (no blur, so the list stays open).
163
173
  */
164
174
  protected onFrameMousedown(event: MouseEvent): void;
165
- /** A click on the frame beside the input and its buttons focuses the input. */
175
+ /**
176
+ * A click on the frame beside the input and its buttons focuses the input.
177
+ * With `openOnFocus` off (3.32, request 051), a click or tap on the input or
178
+ * the frame also opens the list, which focus alone no longer does.
179
+ */
166
180
  protected onFrameClick(event: MouseEvent): void;
167
181
  protected onInputChange(event: Event): void;
168
182
  protected onInputFocus(): void;
183
+ /** Opens the list when there is something to show: a long enough query, or options. */
184
+ private openIfAny;
169
185
  protected onInputBlur(): void;
170
186
  protected onKeydown(event: KeyboardEvent): void;
171
187
  protected selectOption(option: ComboboxOption): void;
@@ -254,6 +270,11 @@ export declare class ComboboxComponent implements ControlValueAccessor {
254
270
  "required": false;
255
271
  "isSignal": true;
256
272
  };
273
+ "openOnFocus": {
274
+ "alias": "openOnFocus";
275
+ "required": false;
276
+ "isSignal": true;
277
+ };
257
278
  "selectedValue": {
258
279
  "alias": "selectedValue";
259
280
  "required": false;
@@ -24,6 +24,8 @@ export type SelectValue = string | number | string[] | number[] | null;
24
24
  * - CDK overlay positioning
25
25
  * - ControlValueAccessor integration for reactive forms
26
26
  *
27
+ * The dropdown takes the `lang` of the host's closest `[lang]` (3.31).
28
+ *
27
29
  * @example
28
30
  * ```html
29
31
  * <lc-select [options]="options" placeholder="Choose" [(ngModel)]="selected" />
@@ -115,6 +117,13 @@ export declare class SelectComponent implements ControlValueAccessor {
115
117
  private readonly formDisabled;
116
118
  /** Effective disabled state: the `disabled` input OR the form control's disabled state. */
117
119
  readonly isDisabled: import("@angular/core").Signal<boolean>;
120
+ private readonly host;
121
+ /**
122
+ * `lang` of the open dropdown (3.31, request 050, WCAG 3.1.2): the overlay
123
+ * renders under `<body>`, so it takes the host's closest `[lang]`, else none.
124
+ * Read at every opening; `null` while closed, so the server never reads the DOM.
125
+ */
126
+ protected readonly panelLang: import("@angular/core").Signal<string | null>;
118
127
  readonly filteredOptions: import("@angular/core").Signal<SelectOption[]>;
119
128
  /** Keyboard highlight; resets whenever the visible option list changes so it never points at a stale row. */
120
129
  readonly highlightedIndex: import("@angular/core").WritableSignal<number>;
@@ -25,7 +25,9 @@ export type SidenavVariant = 'default' | 'transparent';
25
25
  * - Hierarchical navigation with collapsible groups (up to 3 levels)
26
26
  * - Section headlines for item grouping with optional action buttons
27
27
  * - Action buttons on any item (hover-reveal)
28
- * - Badge support on items (count / status indicator)
28
+ * - Badge support on items (count / status indicator), read after the label
29
+ * through `badgeAriaLabel` (3.31); on the collapsed rail the label and the
30
+ * badge text name the item
29
31
  * - One current item, announced and painted alike: the link for `activeRoute`
30
32
  * (or, without it, the one the router's URL matches) gets
31
33
  * `aria-current="page"` and the current look, every other link neither
@@ -202,6 +204,16 @@ export declare class SidenavComponent implements OnDestroy {
202
204
  readonly collapseTitle: import("@angular/core").InputSignal<string>;
203
205
  /** Accessible name of the close button (drawer mode). */
204
206
  readonly closeAriaLabel: import("@angular/core").InputSignal<string>;
207
+ /**
208
+ * Text read after an item's label when it has a badge, at every level. On
209
+ * the collapsed rail, where labels are hidden, the label and this text name
210
+ * the item. `{value}` is replaced with the badge value, e.g.
211
+ * `'{value} offen'` → "Stammdaten 1 offen". The badge itself is hidden from
212
+ * screen readers. Empty: the badge isn't read.
213
+ *
214
+ * @default '{value}'
215
+ */
216
+ readonly badgeAriaLabel: import("@angular/core").InputSignal<string>;
205
217
  /**
206
218
  * Ids of the expanded parent items — the single source of truth for
207
219
  * `isExpanded`. Seeded with the current item's parent whenever it changes
@@ -265,6 +277,8 @@ export declare class SidenavComponent implements OnDestroy {
265
277
  protected readonly brandInitial: import("@angular/core").Signal<string>;
266
278
  /** Whether the rail shows only icons (as `lc-sidenav--collapsed`). */
267
279
  protected readonly isRail: import("@angular/core").Signal<boolean>;
280
+ /** Visually hidden badge text: `badgeAriaLabel` with `{value}`; on the rail, where labels are hidden, after the label. */
281
+ protected badgeText(item: NavigationItem): string;
268
282
  /** The collapse button's accessible name: what a press does. */
269
283
  protected readonly collapseToggleLabel: import("@angular/core").Signal<string>;
270
284
  /** The collapse button's chevron points where the rail moves: ⟨ to collapse a left rail, ⟩ to expand it (mirrored on the right). */
@@ -458,6 +472,11 @@ export declare class SidenavComponent implements OnDestroy {
458
472
  "required": false;
459
473
  "isSignal": true;
460
474
  };
475
+ "badgeAriaLabel": {
476
+ "alias": "badgeAriaLabel";
477
+ "required": false;
478
+ "isSignal": true;
479
+ };
461
480
  }, {
462
481
  "collapsed": "collapsedChange";
463
482
  "closed": "closed";
@@ -15,6 +15,12 @@ export declare class TooltipContentComponent {
15
15
  * the preferred one does not fit the viewport, and can be dismissed with
16
16
  * Escape (WCAG 1.4.13).
17
17
  *
18
+ * The tooltip takes the `lang` of the host's closest `[lang]` (3.31).
19
+ *
20
+ * Shows on hover and on keyboard focus of the host or of an element inside it
21
+ * (3.32). On a wrapper such as `lc-button`, the tooltip describes and anchors
22
+ * to the wrapped `<button>`.
23
+ *
18
24
  * @example
19
25
  * ```html
20
26
  * <button lcTooltip="Click me!" tooltipPosition="top">
@@ -48,10 +54,17 @@ export declare class TooltipDirective implements OnDestroy {
48
54
  * @default false
49
55
  */
50
56
  tooltipDisabled: import("@angular/core").InputSignal<boolean>;
51
- /** Id of the tooltip element; the host's `aria-describedby` points at it while shown. */
57
+ /**
58
+ * Id of the tooltip element; while shown, the `aria-describedby` of the
59
+ * described element (the host, or the focusable element it wraps, such as
60
+ * `lc-button`'s `<button>`) points at it.
61
+ */
52
62
  readonly tooltipId: string;
53
63
  private overlayRef?;
54
64
  private tooltipRef?;
65
+ private positionStrategy?;
66
+ /** The element whose `aria-describedby` holds the tooltip id while shown. */
67
+ private describedEl?;
55
68
  private positionSubscription?;
56
69
  private showTimeout?;
57
70
  private hideTimeout?;
@@ -66,6 +79,14 @@ export declare class TooltipDirective implements OnDestroy {
66
79
  onMouseLeave(): void;
67
80
  onFocus(): void;
68
81
  onBlur(): void;
82
+ /**
83
+ * 3.32 (request 051, 050-f3): `focus` does not bubble, so focus on an
84
+ * element inside the host (`lc-button`'s `<button>`) arrives as `focusin`.
85
+ * The host's own focus is handled by `onFocus`, so it is skipped here.
86
+ */
87
+ onFocusIn(event: FocusEvent): void;
88
+ /** Hides when focus leaves the host from an element inside it (not when it moves within). */
89
+ onFocusOut(event: FocusEvent): void;
69
90
  /**
70
91
  * Show tooltip programmatically
71
92
  */
@@ -84,8 +105,13 @@ export declare class TooltipDirective implements OnDestroy {
84
105
  /** Preferred position first, then the fallbacks the overlay may flip to. */
85
106
  private getPositions;
86
107
  private setPositionClass;
87
- /** Append the tooltip id to the host's aria-describedby without clobbering ids the caller set. */
108
+ /** The described element: the host if it is a control, else the first control inside it, else the host. */
109
+ private resolveControl;
110
+ /** The overlay origin: the control when it is the host's only element child (a wrapper), else the host. */
111
+ private resolveAnchor;
112
+ /** Append the tooltip id to the element's aria-describedby without clobbering ids the caller set. */
88
113
  private addDescribedBy;
114
+ /** Removes the tooltip id from the element it was added to, keeping the other ids. */
89
115
  private removeDescribedBy;
90
116
  private clearTimeouts;
91
117
  private cleanup;