@sixbell-telco/sdk 4.8.0 → 4.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +24 -0
- package/components/accordion/README.md +1 -1
- package/components/accordion/src/accordion.component.d.ts +4 -0
- package/components/data-table/src/data-table.component.d.ts +2 -24
- package/components/dialog/README.md +4 -3
- package/components/dialog/dialog-actions/dialog-actions.component.d.ts +2 -1
- package/components/dialog/src/dialog.component.d.ts +10 -5
- package/components/dropdown-menu/bar/dropdown-menu-bar-item/dropdown-menu-bar-item.component.d.ts +1 -1
- package/components/dropdown-menu/src/dropdown-menu-item/dropdown-menu-item.component.d.ts +3 -2
- package/components/forms/combobox/README.md +9 -0
- package/components/forms/combobox/src/combobox.component.d.ts +46 -2
- package/components/forms/date-picker/README.md +3 -1
- package/components/forms/date-picker/src/date-picker.component.d.ts +8 -1
- package/components/forms/form-error/README.md +2 -0
- package/components/forms/form-error/src/form-error.component.d.ts +17 -0
- package/components/forms/form-hint/README.md +2 -2
- package/components/forms/form-item/README.md +1 -0
- package/components/forms/form-item/src/form-item.component.d.ts +38 -6
- package/components/forms/input/README.md +7 -0
- package/components/forms/input/src/input.component.d.ts +11 -1
- package/components/forms/select/README.md +8 -0
- package/components/forms/select/src/select.component.d.ts +40 -1
- package/components/forms/textarea/README.md +1 -0
- package/components/paginator/README.md +3 -0
- package/components/paginator/components/pagination-item/pagination-item.component.d.ts +8 -3
- package/components/paginator/src/paginator.component.d.ts +2 -1
- package/components/table/src/table.component.d.ts +3 -23
- package/directives/only-numbers/src/only-numbers.directive.d.ts +27 -1
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs +6 -1
- package/fesm2022/sixbell-telco-sdk-components-accordion.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs +5 -2
- package/fesm2022/sixbell-telco-sdk-components-data-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs +30 -13
- package/fesm2022/sixbell-telco-sdk-components-dialog.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs +2 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu-bar.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs +10 -4
- package/fesm2022/sixbell-telco-sdk-components-dropdown-menu.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-dual-list.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-components-file-upload.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs +74 -8
- package/fesm2022/sixbell-telco-sdk-components-forms-combobox.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs +17 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-date-picker.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs +32 -4
- package/fesm2022/sixbell-telco-sdk-components-forms-form-error.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs +74 -10
- package/fesm2022/sixbell-telco-sdk-components-forms-form-item.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs +13 -3
- package/fesm2022/sixbell-telco-sdk-components-forms-input.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs +74 -6
- package/fesm2022/sixbell-telco-sdk-components-forms-select.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-switch.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs +2 -2
- package/fesm2022/sixbell-telco-sdk-components-forms-textarea.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs +15 -11
- package/fesm2022/sixbell-telco-sdk-components-paginator.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-components-table.mjs +5 -2
- package/fesm2022/sixbell-telco-sdk-components-table.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs +49 -4
- package/fesm2022/sixbell-telco-sdk-directives-only-numbers.mjs.map +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs +1 -1
- package/fesm2022/sixbell-telco-sdk-layouts.mjs.map +1 -1
- package/i18n/sdk/en.json +7 -3
- package/i18n/sdk/es.json +7 -3
- package/i18n/sdk/pt.json +7 -3
- package/manifest.json +95 -15
- package/package.json +1 -1
- package/src/_index.css +19 -0
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,30 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
## [4.9.0] - 2026-12-02
|
|
11
|
+
|
|
12
|
+
### Added
|
|
13
|
+
|
|
14
|
+
- **Date picker**: `mode="single"` with `[showTimePicker]="true"` shows a time input (`HH:mm`, or `HH:mm:ss` with `[showSeconds]`) below the calendar, bound to `startTimeValue` / `startTimeChanged`, so one field picks a date and a time. A day click keeps the popover open while the time picker is shown. New key `sdk.datePicker.time` (es/en/pt) names the input. Pickers without `showTimePicker` and range mode are unchanged
|
|
15
|
+
- **Only numbers**: `stOnlyNumbers` takes opt-in `stOnlyNumbersAllowNegative` and `stOnlyNumbersAllowDecimal` (`st-input`: `onlyNumbersAllowNegative`, `onlyNumbersAllowDecimal`); each keypress and paste is judged by the resulting value, dot as separator. The defaults stay digits only (NSU-147)
|
|
16
|
+
- **Theme**: `rounded-inner` utility and `--radius-inner` variable, a concentric radius for a surface inside a card (`max(--radius-selector, --radius-box − --card-p)`) that follows card size and theme with no app CSS (NSU-146)
|
|
17
|
+
|
|
18
|
+
### Fixed
|
|
19
|
+
|
|
20
|
+
- **Forms**: field errors reach assistive tech: kit controls get `aria-invalid` and their `aria-describedby` includes the `st-form-errors` message, shown as `role="alert"`; `st-select` and `st-combobox` get generated listbox ids, a named listbox and `aria-haspopup="listbox"`, and the combobox search input announces the active option. New key `sdk.select.noOptions` (es/en/pt) (NSU-149, NSU-152)
|
|
21
|
+
- **Paginator**: one Enter or Space press changes the page once (`triggered` fires once); the paginator is a `<nav>` labelled from `sdk.pagination.label`, the ellipsis is announced as `sdk.pagination.more`, and first/last hide below `sm` so the bar fits a phone. New keys in es/en/pt (NSU-150)
|
|
22
|
+
- **Accessibility**: disabled `st-dropdown-menu` items get `aria-disabled` and no longer fire, and long menus cap their height and scroll with the kit scroll fade; `st-accordion` gets a unique default `name`; `st-switch` has `role="switch"`; `st-table` and `st-data-table` name their items-per-page select; `st-table` projects `caption` and `colgroup` (NSU-151)
|
|
23
|
+
- **Combobox and select**: disabled options through `disabledKey` (dimmed, `aria-disabled`, skipped by the arrow keys, never selected, still found by search) and an optional second line through `descriptionKey`. `st-select` also moves with Home and End (NSU-143)
|
|
24
|
+
- **Dialog**: `st-dialog` never grows past the viewport: the body scrolls while the title and actions stay visible (also inside an MFE shadow root), with the kit scroll fade on its top and bottom edges, shown only while there is more to scroll, long titles and single long words wrap before the close button, actions stack full width on phones, and the close button is an icon at the inline end. Local `max-h-* overflow-y-auto` wrappers on `st-dialog-content` can be removed (NSU-148)
|
|
25
|
+
|
|
26
|
+
### Consumer upgrade
|
|
27
|
+
|
|
28
|
+
- Move a host and every remote it loads to 4.9.0 together: the SDK is a strict federation singleton. No `ng update` migration runs for 4.9.0
|
|
29
|
+
- `st-dialog` now caps itself to the viewport and scrolls its body (also inside an MFE shadow root): remove local `max-h-* overflow-y-auto` wrappers on `st-dialog-content` (aux-tables, DDT)
|
|
30
|
+
- Disabled options: pass `disabledKey` (and optionally `descriptionKey`) to `st-select` / `st-combobox` instead of label tricks such as «· ya agregado»
|
|
31
|
+
- `st-accordion` without a `name` now gets a unique one per instance (was `'accordion'`): code that relied on two single accordions sharing a group must pass the same `name` explicitly
|
|
32
|
+
- New i18n keys in the `sdk` bundle (es/en/pt): `sdk.select.noOptions`, `sdk.pagination.label`, `sdk.pagination.more`; apps that ship their own copy of the bundle should add them
|
|
33
|
+
|
|
10
34
|
## [4.8.0] - 2026-11-18
|
|
11
35
|
|
|
12
36
|
### Changed
|
|
@@ -16,5 +16,5 @@ Expandable sections. Use `type="single"` to keep only one item open.
|
|
|
16
16
|
|
|
17
17
|
## Notes
|
|
18
18
|
|
|
19
|
-
- `st-accordion` `name` groups items; `type` is `'default'` or `'single'`.
|
|
19
|
+
- `st-accordion` `name` groups items (default: a name unique to each accordion); `type` is `'default'` or `'single'`.
|
|
20
20
|
- `st-accordion-item` takes `header`, `opened`, and `variant` (`default` | `arrow` | `plus`).
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import * as i0 from "@angular/core";
|
|
2
2
|
export declare class AccordionComponent {
|
|
3
|
+
/**
|
|
4
|
+
* Group name shared by the item inputs. Defaults to a name unique to this accordion, so two
|
|
5
|
+
* `type="single"` accordions on one page do not close each other's items.
|
|
6
|
+
*/
|
|
3
7
|
name: import("@angular/core").InputSignal<string>;
|
|
4
8
|
type: import("@angular/core").InputSignal<"default" | "single">;
|
|
5
9
|
static ɵfac: i0.ɵɵFactoryDeclaration<AccordionComponent, never>;
|
|
@@ -18,30 +18,6 @@ export type DataTableVariantProps = {
|
|
|
18
18
|
export declare const dataTableContent: (props?: ({
|
|
19
19
|
size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
|
|
20
20
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
21
|
-
/**
|
|
22
|
-
* A styled container component for data tables - provides styling shell only
|
|
23
|
-
*
|
|
24
|
-
* This component is similar to st-table but with additional data table specific styling.
|
|
25
|
-
* Users should compose their own table structure using TanStack Table and SDK components.
|
|
26
|
-
*
|
|
27
|
-
* @example
|
|
28
|
-
* ```html
|
|
29
|
-
* <st-data-table size="md" height="lg">
|
|
30
|
-
* <table>
|
|
31
|
-
* <thead>
|
|
32
|
-
* <tr>
|
|
33
|
-
* <th><st-data-table-sortable-header>Name</st-data-table-sortable-header></th>
|
|
34
|
-
* </tr>
|
|
35
|
-
* </thead>
|
|
36
|
-
* <tbody>
|
|
37
|
-
* <tr>
|
|
38
|
-
* <td>John Doe</td>
|
|
39
|
-
* </tr>
|
|
40
|
-
* </tbody>
|
|
41
|
-
* </table>
|
|
42
|
-
* </st-data-table>
|
|
43
|
-
* ```
|
|
44
|
-
*/
|
|
45
21
|
export declare class DataTableContainerComponent {
|
|
46
22
|
readonly translationService: TranslateService;
|
|
47
23
|
readonly dataTableContext: DataTableContextService;
|
|
@@ -150,6 +126,8 @@ export declare class DataTableContainerComponent {
|
|
|
150
126
|
pageSizeChanged: import("@angular/core").OutputEmitterRef<number>;
|
|
151
127
|
readonly ENTRIES: readonly [5, 10, 20, 50, 100];
|
|
152
128
|
private readonly translateLabel;
|
|
129
|
+
/** @internal Id of the items-per-page select, named by its visually hidden label */
|
|
130
|
+
protected readonly pageSizeSelectId: string;
|
|
153
131
|
readonly entriesPerPageOptions: import("@angular/core").Signal<{
|
|
154
132
|
value: 10 | 5 | 20 | 50 | 100;
|
|
155
133
|
text: string;
|
|
@@ -22,8 +22,9 @@ Modal overlay with title, content, and actions.
|
|
|
22
22
|
## Notes
|
|
23
23
|
|
|
24
24
|
- `width` is `'xs'` | `'sm'` | `'md'` | `'lg'` | `'xl'` | `'2xl'` | `'3xl'` | `'4xl'` | `'5xl'` (16rem to 64rem), default `'lg'` (32rem). Set it by purpose: form or action `lg`, delete confirm `xl` (or `2xl` with a full-row table), upload `xl`. The dialog never grows wider than the viewport minus 2rem. Outputs: `closed`, `clickOutside`.
|
|
25
|
-
- `st-dialog-actions` aligns right by default: put the dismiss action first and the confirm action last.
|
|
26
|
-
-
|
|
27
|
-
-
|
|
25
|
+
- `st-dialog-actions` aligns right by default: put the dismiss action first and the confirm action last. Below `sm` the actions stack full width with the confirm on top.
|
|
26
|
+
- The dialog never grows taller than the viewport (1rem gap per edge when centered, 2rem at the top or bottom position): the content scrolls, and the title and actions stay visible. This holds on every width, with or without `fullscreenOnMobile`, and inside an MFE shadow root. Drop local `max-h-* overflow-y-auto` wrappers on `st-dialog-content`.
|
|
27
|
+
- `fullscreenOnMobile` (default `true`): below the `sm` breakpoint (640px) the dialog fills the screen (full width and `100dvh`, no radius). Set `[fullscreenOnMobile]="false"` for a short confirm that should stay a centered card on phones. While full-screen, the page behind is scroll-locked (CDK block strategy); wider viewports and opted-out dialogs keep the page scroll so a sticky navbar does not jump. The lock sets `position: fixed`, `width: 100%` and `overflow-y: scroll` inline on `<html>` as well as the `cdk-global-scrollblock` class, so it also works when the host page does not load the SDK stylesheet (for example a host that loads it only inside an MFE child's shadow root); the previous inline values come back on close. The focus trap and `prefers-reduced-motion` handling are unchanged.
|
|
28
|
+
- The title and subtitle keep clear of the close button (an icon button), so long titles wrap before it, and a single long word breaks inside the panel; no local `pe-*` padding is needed.
|
|
28
29
|
- Prefer `(triggered)` on close controls.
|
|
29
30
|
- The close button is named by the `sdk.dialog.close` translation key, and falls back to "Close dialog" when no translation service or key is available.
|
|
@@ -2,7 +2,8 @@ import * as i0 from "@angular/core";
|
|
|
2
2
|
export type ModalActionsAligmentProps = 'left' | 'right' | 'center';
|
|
3
3
|
export declare class DialogActionsComponent {
|
|
4
4
|
/**
|
|
5
|
-
* Horizontal alignment of the actions. Dialog actions sit at the bottom right, dismiss first and
|
|
5
|
+
* Horizontal alignment of the actions from `sm` up. Dialog actions sit at the bottom right, dismiss first and
|
|
6
|
+
* confirm last. Below `sm` they stack full width with the last one (the confirm) on top.
|
|
6
7
|
* @defaultValue 'right'
|
|
7
8
|
*/
|
|
8
9
|
alignment: import("@angular/core").InputSignal<ModalActionsAligmentProps>;
|
|
@@ -12,6 +12,7 @@ export type DialogYPosition = 'top' | 'center' | 'bottom';
|
|
|
12
12
|
*/
|
|
13
13
|
export declare const dialogComponent: (props?: ({
|
|
14
14
|
width?: "xs" | "sm" | "md" | "lg" | "xl" | "2xl" | "3xl" | "4xl" | "5xl" | null | undefined;
|
|
15
|
+
yPosition?: "center" | "top" | "bottom" | null | undefined;
|
|
15
16
|
fullscreenOnMobile?: boolean | null | undefined;
|
|
16
17
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
17
18
|
/** Possible width values for the dialog component */
|
|
@@ -60,6 +61,8 @@ export declare class DialogComponent {
|
|
|
60
61
|
private readonly translateLabel;
|
|
61
62
|
/** @internal Close button name from `sdk.dialog.close`, in English when no translation is loaded. */
|
|
62
63
|
protected readonly closeLabel: import("@angular/core").Signal<string>;
|
|
64
|
+
/** @internal Close button icon; the button carries the accessible name. */
|
|
65
|
+
protected readonly iconClose = "<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M19 6.41L17.59 5L12 10.59L6.41 5L5 6.41L10.59 12L5 17.59L6.41 19L12 13.41L17.59 19L19 17.59L13.41 12L19 6.41z\"></path></svg>";
|
|
63
66
|
private readonly contentEffect;
|
|
64
67
|
/**
|
|
65
68
|
* Specifies the width of the dialog
|
|
@@ -67,9 +70,9 @@ export declare class DialogComponent {
|
|
|
67
70
|
*/
|
|
68
71
|
width: import("@angular/core").InputSignal<DialogWidthProps>;
|
|
69
72
|
/**
|
|
70
|
-
* Below the `sm` breakpoint (640px) the dialog fills the screen: full width and height, no radius
|
|
71
|
-
*
|
|
72
|
-
*
|
|
73
|
+
* Below the `sm` breakpoint (640px) the dialog fills the screen: full width and height, no radius.
|
|
74
|
+
* Set it to `false` for a short confirm that should stay a centered card on phones. Either way the
|
|
75
|
+
* dialog never grows past the viewport: the content scrolls and the title and actions stay visible.
|
|
73
76
|
* @defaultValue true
|
|
74
77
|
*/
|
|
75
78
|
fullscreenOnMobile: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
@@ -148,10 +151,12 @@ export declare class DialogComponent {
|
|
|
148
151
|
*/
|
|
149
152
|
componentClass: import("@angular/core").Signal<string>;
|
|
150
153
|
/**
|
|
151
|
-
* Classes for the content region: it takes the free height and scrolls
|
|
154
|
+
* Classes for the content region: it takes the free height and scrolls when the dialog reaches the viewport.
|
|
155
|
+
* The 0.25rem padding, offset by a negative margin, keeps focus rings inside the scroll box from being clipped.
|
|
156
|
+
* `scroll-fade-y` fades the top and bottom edges only while there is more content to scroll to.
|
|
152
157
|
* @internal
|
|
153
158
|
*/
|
|
154
|
-
contentClass: import("@angular/core").Signal<
|
|
159
|
+
contentClass: import("@angular/core").Signal<string>;
|
|
155
160
|
/** @internal Handles open/close state changes */
|
|
156
161
|
openedEffect: import("@angular/core").EffectRef;
|
|
157
162
|
/**
|
package/components/dropdown-menu/bar/dropdown-menu-bar-item/dropdown-menu-bar-item.component.d.ts
CHANGED
|
@@ -65,5 +65,5 @@ export declare class DropdownMenuBarItemComponent {
|
|
|
65
65
|
*/
|
|
66
66
|
itemClass: () => string;
|
|
67
67
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownMenuBarItemComponent, never>;
|
|
68
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenuBarItemComponent, "st-dropdown-menu-bar-item", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "shortcut": { "alias": "shortcut"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "triggered": "triggered"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; }, never, ["*"], true, [{ directive: typeof i1.CdkMenuItem; inputs: {}; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
68
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenuBarItemComponent, "st-dropdown-menu-bar-item", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "shortcut": { "alias": "shortcut"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "triggered": "triggered"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; }, never, ["*"], true, [{ directive: typeof i1.CdkMenuItem; inputs: { "cdkMenuItemDisabled": "disabled"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
69
69
|
}
|
|
@@ -6,7 +6,8 @@ import * as i1 from "@angular/cdk/menu";
|
|
|
6
6
|
export declare class DropdownMenuItemComponent {
|
|
7
7
|
private readonly menuStack;
|
|
8
8
|
/**
|
|
9
|
-
* Whether the menu item is disabled
|
|
9
|
+
* Whether the menu item is disabled. The CDK menu item gets it too, so the item has
|
|
10
|
+
* `aria-disabled`, keyboard navigation skips it and it never fires `triggered`.
|
|
10
11
|
*/
|
|
11
12
|
disabled: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
12
13
|
/**
|
|
@@ -66,5 +67,5 @@ export declare class DropdownMenuItemComponent {
|
|
|
66
67
|
*/
|
|
67
68
|
itemClass: () => string;
|
|
68
69
|
static ɵfac: i0.ɵɵFactoryDeclaration<DropdownMenuItemComponent, never>;
|
|
69
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenuItemComponent, "st-dropdown-menu-item", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "shortcut": { "alias": "shortcut"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "triggered": "triggered"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; }, never, ["*"], true, [{ directive: typeof i1.CdkMenuItem; inputs: {}; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
70
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<DropdownMenuItemComponent, "st-dropdown-menu-item", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "active": { "alias": "active"; "required": false; "isSignal": true; }; "shortcut": { "alias": "shortcut"; "required": false; "isSignal": true; }; "class": { "alias": "class"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "triggered": "triggered"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; }, never, ["*"], true, [{ directive: typeof i1.CdkMenuItem; inputs: { "cdkMenuItemDisabled": "disabled"; }; outputs: { "cdkMenuItemTriggered": "triggered"; }; }]>;
|
|
70
71
|
}
|
|
@@ -25,3 +25,12 @@ Searchable select. Clear is a sibling of the trigger; the chevron is a custom ic
|
|
|
25
25
|
- Overlay animation follows CDK position with a 4px gap above or below.
|
|
26
26
|
- `selectionType` is `'single'` or `'multiple'`.
|
|
27
27
|
- Async options: a value written through the form (`writeValue`) before its options exist is kept and resolved, with its label, once a matching option arrives, without calling `onChange` (the control stays pristine). It is resolved again whenever `options` is replaced, so a list that is filtered or reloaded later still shows the label. A user selection, clear or `writeValue(null)` replaces it (clear is ignored while disabled). In `multiple` mode the values that match show right away and the ones without an option stay pending in the form, showing when their option arrives; a user toggle emits the visible values plus the still-pending ones, so nothing the form holds is silently dropped. Pending values are cleared by `writeValue`, a reset or a user clear.
|
|
28
|
+
- Disabled options: `disabledKey` names the option property that disables it when truthy. The option stays in the list and in search results, is dimmed with the kit's disabled colors (`--color-disabled-content`), carries `aria-disabled="true"` and cannot be chosen by click, Enter or Space. The arrow keys skip them; Home and End stay on the search text. In `multiple` mode a disabled option is never added, by click or Enter. Without `disabledKey` every option is enabled.
|
|
29
|
+
- Secondary text: `descriptionKey` names an option property shown as a second line under the label (for example why the option is disabled). It is part of the option's accessible name.
|
|
30
|
+
- Validation errors: inside `st-form-item` with `st-form-errors`, the `role="combobox"` trigger gets `aria-invalid="true"` while its control is invalid and touched or dirty, and the error message id joins the hint ids in its `aria-describedby`. See [Form Error](../form-error/README.md).
|
|
31
|
+
- Listbox: the trigger has `aria-haspopup="listbox"` and `aria-controls` pointing at the listbox's generated id (unique per instance). The listbox is named by the `label`, or by the trigger when there is no `label`. With no matches it shows `noResultsText`, else `sdk.combobox.noResultsFound` ("No results found" when no translation is loaded).
|
|
32
|
+
- Search input: while the panel is open it has focus and is the combobox: `role="combobox"`, `aria-autocomplete="list"`, `aria-expanded`, `aria-controls` (the listbox id) and `aria-activedescendant`, the id of the option the arrow keys made active (disabled options are skipped), so screen readers announce it.
|
|
33
|
+
|
|
34
|
+
```html
|
|
35
|
+
<st-combobox [options]="countries" displayKey="name" valueKey="code" disabledKey="added" descriptionKey="note" [(value)]="country"></st-combobox>
|
|
36
|
+
```
|
|
@@ -136,6 +136,12 @@ export declare class ComboboxComponent implements ControlValueAccessor {
|
|
|
136
136
|
private readonly generatedId;
|
|
137
137
|
/** @internal Id applied to the focusable control and referenced by its label */
|
|
138
138
|
protected readonly resolvedId: import("@angular/core").Signal<string>;
|
|
139
|
+
/** @internal Id of the options listbox, referenced by the trigger's `aria-controls` */
|
|
140
|
+
protected readonly listboxId: string;
|
|
141
|
+
/** @internal Id of the visually hidden label, which names the listbox */
|
|
142
|
+
protected readonly labelId: string;
|
|
143
|
+
/** @internal Id of the option at `index` in the filtered list */
|
|
144
|
+
protected optionId(index: number): string;
|
|
139
145
|
/**
|
|
140
146
|
* Placeholder text displayed when no option is selected
|
|
141
147
|
*/
|
|
@@ -199,6 +205,19 @@ export declare class ComboboxComponent implements ControlValueAccessor {
|
|
|
199
205
|
* Uses the entire object if not specified
|
|
200
206
|
*/
|
|
201
207
|
valueKey: import("@angular/core").InputSignal<string>;
|
|
208
|
+
/**
|
|
209
|
+
* The object property that marks an option as disabled when truthy.
|
|
210
|
+
* A disabled option stays in the list (and in search results), is dimmed,
|
|
211
|
+
* carries `aria-disabled="true"` and cannot be chosen by click or keyboard.
|
|
212
|
+
* Leave empty to keep every option enabled.
|
|
213
|
+
*/
|
|
214
|
+
disabledKey: import("@angular/core").InputSignal<string>;
|
|
215
|
+
/**
|
|
216
|
+
* The object property holding a secondary text shown under the option label
|
|
217
|
+
* (for example why it is disabled: "Already added"). It is part of the
|
|
218
|
+
* option's accessible name.
|
|
219
|
+
*/
|
|
220
|
+
descriptionKey: import("@angular/core").InputSignal<string>;
|
|
202
221
|
/**
|
|
203
222
|
* Selection mode: 'single' for single selection, 'multiple' for multi-select
|
|
204
223
|
* @default 'single'
|
|
@@ -403,7 +422,12 @@ export declare class ComboboxComponent implements ControlValueAccessor {
|
|
|
403
422
|
* Translated no results text
|
|
404
423
|
* @returns Translated no results text or input value
|
|
405
424
|
*/
|
|
406
|
-
translatedNoResultsText: import("@angular/core").Signal<
|
|
425
|
+
translatedNoResultsText: import("@angular/core").Signal<string>;
|
|
426
|
+
/**
|
|
427
|
+
* @internal
|
|
428
|
+
* Id of the active option, for the search input's `aria-activedescendant`, or `null` when none is active.
|
|
429
|
+
*/
|
|
430
|
+
protected readonly activeOptionId: import("@angular/core").Signal<string | null>;
|
|
407
431
|
/**
|
|
408
432
|
* Current search input value for template binding
|
|
409
433
|
* @returns Current search value
|
|
@@ -525,6 +549,18 @@ export declare class ComboboxComponent implements ControlValueAccessor {
|
|
|
525
549
|
* @returns True if the option is active
|
|
526
550
|
*/
|
|
527
551
|
isActiveOption(index: number): boolean;
|
|
552
|
+
/**
|
|
553
|
+
* Whether an option is disabled through `disabledKey`
|
|
554
|
+
* @param option - The option to check
|
|
555
|
+
* @returns True if the option cannot be chosen
|
|
556
|
+
*/
|
|
557
|
+
isOptionDisabled(option: any): boolean;
|
|
558
|
+
/**
|
|
559
|
+
* Gets the secondary text for an option through `descriptionKey`
|
|
560
|
+
* @param option - The option to read
|
|
561
|
+
* @returns The secondary text, or an empty string
|
|
562
|
+
*/
|
|
563
|
+
getOptionDescription(option: any): string;
|
|
528
564
|
/**
|
|
529
565
|
* Gets the display value for an option
|
|
530
566
|
* @param option - The option to get display value for
|
|
@@ -566,6 +602,14 @@ export declare class ComboboxComponent implements ControlValueAccessor {
|
|
|
566
602
|
* The debounce time updates reactively when the input changes
|
|
567
603
|
*/
|
|
568
604
|
private setupSearchHandling;
|
|
605
|
+
/**
|
|
606
|
+
* Finds the next enabled option index, wrapping around the list
|
|
607
|
+
* @param options - The options being navigated
|
|
608
|
+
* @param from - The index to start from (exclusive)
|
|
609
|
+
* @param step - 1 to move down, -1 to move up
|
|
610
|
+
* @returns The index of the next enabled option, or -1 if every option is disabled
|
|
611
|
+
*/
|
|
612
|
+
private findEnabledIndex;
|
|
569
613
|
/**
|
|
570
614
|
* Sets the active option for keyboard navigation
|
|
571
615
|
* @param index - The index of the option to make active
|
|
@@ -585,6 +629,6 @@ export declare class ComboboxComponent implements ControlValueAccessor {
|
|
|
585
629
|
*/
|
|
586
630
|
private setupSearchQueryEmission;
|
|
587
631
|
static ɵfac: i0.ɵɵFactoryDeclaration<ComboboxComponent, never>;
|
|
588
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "st-combobox", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showOptional": { "alias": "showOptional"; "required": false; "isSignal": true; }; "optionalText": { "alias": "optionalText"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "ghost": { "alias": "ghost"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "allowClear": { "alias": "allowClear"; "required": false; "isSignal": true; }; "allowClearAll": { "alias": "allowClearAll"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "noResultsText": { "alias": "noResultsText"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayKey": { "alias": "displayKey"; "required": false; "isSignal": true; }; "valueKey": { "alias": "valueKey"; "required": false; "isSignal": true; }; "selectionType": { "alias": "selectionType"; "required": false; "isSignal": true; }; "searchDebounced": { "alias": "searchDebounced"; "required": false; "isSignal": true; }; "searchDebounceTime": { "alias": "searchDebounceTime"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "value": "valueChange"; "blurred": "blurred"; "valueUpdated": "valueUpdated"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; "triggered": "triggered"; "searchQuery": "searchQuery"; }, never, ["*"], true, never>;
|
|
632
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<ComboboxComponent, "st-combobox", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "showOptional": { "alias": "showOptional"; "required": false; "isSignal": true; }; "optionalText": { "alias": "optionalText"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "ghost": { "alias": "ghost"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "allowClear": { "alias": "allowClear"; "required": false; "isSignal": true; }; "allowClearAll": { "alias": "allowClearAll"; "required": false; "isSignal": true; }; "searchPlaceholder": { "alias": "searchPlaceholder"; "required": false; "isSignal": true; }; "noResultsText": { "alias": "noResultsText"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "options": { "alias": "options"; "required": false; "isSignal": true; }; "displayKey": { "alias": "displayKey"; "required": false; "isSignal": true; }; "valueKey": { "alias": "valueKey"; "required": false; "isSignal": true; }; "disabledKey": { "alias": "disabledKey"; "required": false; "isSignal": true; }; "descriptionKey": { "alias": "descriptionKey"; "required": false; "isSignal": true; }; "selectionType": { "alias": "selectionType"; "required": false; "isSignal": true; }; "searchDebounced": { "alias": "searchDebounced"; "required": false; "isSignal": true; }; "searchDebounceTime": { "alias": "searchDebounceTime"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; }, { "disabled": "disabledChange"; "value": "valueChange"; "blurred": "blurred"; "valueUpdated": "valueUpdated"; "clicked": "clicked"; "keyDownEnter": "keyDownEnter"; "keyDownSpace": "keyDownSpace"; "triggered": "triggered"; "searchQuery": "searchQuery"; }, never, ["*"], true, never>;
|
|
589
633
|
}
|
|
590
634
|
export {};
|
|
@@ -25,5 +25,7 @@ Single or range calendar. Overlay Clear is gated by `allowClear` (default `true`
|
|
|
25
25
|
## Notes
|
|
26
26
|
|
|
27
27
|
- Wrap with `st-form-item` and put `st-form-errors` as a sibling, not inside the trigger.
|
|
28
|
+
- The picker renders no control of its own: a projected kit control with no form control of its own (the `st-input` above) takes the picker's state, so it gets `aria-required` from the picker's `required` or `Validators.required`, and `aria-invalid="true"` while the picker's control is invalid and touched or dirty. Inside `st-form-item`, its `aria-describedby` lists the hints and, while invalid, the `st-form-errors` message. A projected `st-button` or plain element gets none of this.
|
|
28
29
|
- Range: bind `[rangeValue]` and `(rangeValueChanged)`.
|
|
29
|
-
-
|
|
30
|
+
- Single date and time: `mode="single"` with `[showTimePicker]="true"` shows a time input below the calendar (`HH:mm`, or `HH:mm:ss` with `[showSeconds]`). Bind `[startTimeValue]` and `(startTimeChanged)`; `displayValue()` shows the date plus the time. A day click emits the date and keeps the popover open so the time can still change; it closes on outside click or Escape.
|
|
31
|
+
- Accessibility: the calendar's month buttons are named from `sdk.datePicker.previousMonth` and `sdk.datePicker.nextMonth`, and the single-mode time input from `sdk.datePicker.time`, in English when no translation is loaded.
|
|
@@ -100,7 +100,12 @@ export declare class DatepickerComponent implements ControlValueAccessor {
|
|
|
100
100
|
* When not set, the enclosing `st-form-item` `required`, then `Validators.required` on the bound control decide.
|
|
101
101
|
*/
|
|
102
102
|
required: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
103
|
-
/**
|
|
103
|
+
/**
|
|
104
|
+
* @internal
|
|
105
|
+
* Required, invalid and description state of the field. The picker renders no control of its own, so it
|
|
106
|
+
* shares this state with the projected kit control (`st-input`), which binds `aria-required`,
|
|
107
|
+
* `aria-invalid` and `aria-describedby`.
|
|
108
|
+
*/
|
|
104
109
|
protected readonly fieldA11y: import("@sixbell-telco/sdk/components/forms/form-item").FormFieldA11y;
|
|
105
110
|
/**
|
|
106
111
|
* Picker mode
|
|
@@ -353,6 +358,8 @@ export declare class DatepickerComponent implements ControlValueAccessor {
|
|
|
353
358
|
previous: string;
|
|
354
359
|
next: string;
|
|
355
360
|
}>;
|
|
361
|
+
/** @internal Accessible name of the single-mode time input. */
|
|
362
|
+
protected readonly timeLabel: import("@angular/core").Signal<string>;
|
|
356
363
|
private clampTime;
|
|
357
364
|
onStartTimeChange(ev: Event): void;
|
|
358
365
|
onEndTimeChange(ev: Event): void;
|
|
@@ -18,4 +18,6 @@ Full-width validation messages for a control on `parentForm`.
|
|
|
18
18
|
## Notes
|
|
19
19
|
|
|
20
20
|
- `parentForm` and `formField` are required. Projecting errors inside a field is legacy and width-limited.
|
|
21
|
+
- The message shows once the control has errors and is touched or dirty. It then renders as a `role="alert"` element with a generated id, so screen readers announce it when it appears; while hidden it is not an alert and keeps only an invisible placeholder line.
|
|
22
|
+
- Inside `st-form-item`, the message id is added to the control's `aria-describedby` (after the `st-form-hint` ids) while the control is invalid and touched or dirty, and the control gets `aria-invalid="true"`. This works for `st-input`, `st-textarea`, `st-select`, `st-combobox` and the `st-input` projected into `st-datepicker`.
|
|
21
23
|
- See [Form Errors migration](../../../../../docs/migrations/Form_Errors_Migration.md).
|
|
@@ -1,9 +1,26 @@
|
|
|
1
1
|
import { FormControl, FormGroup } from '@angular/forms';
|
|
2
2
|
import * as i0 from "@angular/core";
|
|
3
|
+
/**
|
|
4
|
+
* The validation message of one control on `parentForm`.
|
|
5
|
+
*
|
|
6
|
+
* @remarks
|
|
7
|
+
* The message shows once the control is invalid and touched or dirty, as an `role="alert"` element,
|
|
8
|
+
* so screen readers announce it when it appears. Inside `st-form-item`, the message id is also added
|
|
9
|
+
* to the control's `aria-describedby` while the control is invalid, next to the `st-form-hint` ids.
|
|
10
|
+
*/
|
|
3
11
|
export declare class FormErrorsComponent {
|
|
4
12
|
parentForm: import("@angular/core").InputSignal<FormGroup<any>>;
|
|
5
13
|
formField: import("@angular/core").InputSignal<string>;
|
|
6
14
|
formControl: import("@angular/core").Signal<FormControl<any>>;
|
|
15
|
+
/** @internal Id of the message element, referenced by the control's `aria-describedby`. */
|
|
16
|
+
readonly messageId: string;
|
|
17
|
+
constructor();
|
|
18
|
+
/**
|
|
19
|
+
* @internal
|
|
20
|
+
* Whether the message is shown: the control has errors and is touched or dirty.
|
|
21
|
+
* A method for the same reason as `customError()`.
|
|
22
|
+
*/
|
|
23
|
+
isVisible(): boolean;
|
|
7
24
|
/**
|
|
8
25
|
* Returns the value of the first custom error on the current form control.
|
|
9
26
|
*
|
|
@@ -22,8 +22,8 @@ Helper text for a form field, linked to its control through `aria-describedby`,
|
|
|
22
22
|
- `st-form-hint` must sit inside `st-form-item`. Input: `id` (generated when omitted). The control's `aria-describedby` lists every hint in the item.
|
|
23
23
|
- `st-form-required-legend` renders `sdk.formFields.requiredLegend` ("Fields marked with * are required"); `textKey` overrides it. Place it once above the first field.
|
|
24
24
|
- Required marker: `st-input`, `st-textarea`, `st-select`, `st-combobox`, `st-range` and `st-date-picker` show `*` after the label and (except `st-date-picker`, see below) set `aria-required="true"` on the native control or `role="combobox"` trigger when their `required` input is set, else when `st-form-item [required]` is set, else when the bound control has `Validators.required`. The `*` is `aria-hidden`; `showOptional` is unchanged.
|
|
25
|
-
- `st-date-picker` projects its own trigger:
|
|
25
|
+
- `st-date-picker` projects its own trigger: a projected `st-input` without a form control of its own takes the picker's required state and sets `aria-required`.
|
|
26
26
|
- `st-range` shows the marker but does not set `aria-required` (not allowed on the `slider` role); it adds a visually hidden "Required" note (`sdk.formFields.required`) to its `aria-describedby` instead.
|
|
27
|
-
-
|
|
27
|
+
- A validator added or removed later is picked up once the control's validity is updated (`updateValueAndValidity()`).
|
|
28
28
|
- An explicit `required` on the control wins over `st-form-item [required]` and over the validator, so `[required]="false"` removes the marker. Angular's `RequiredValidator` also matches `[required]` next to `formControlName`, so `[required]="true"` adds `Validators.required` to the control.
|
|
29
29
|
- Replaces hand-rolled `span.field-hint` hints in consumer apps.
|
|
@@ -15,3 +15,4 @@
|
|
|
15
15
|
|
|
16
16
|
- Place `st-form-errors` as a sibling (not inside) the input/field component.
|
|
17
17
|
- `st-form-item` provides a consistent vertical gap and full-width error line.
|
|
18
|
+
- It is also the field context for assistive technology: controls inside it read `required` from it, list every `st-form-hint` id in their `aria-describedby`, and add the `st-form-errors` message id there, with `aria-invalid="true"`, while the control is invalid and touched or dirty. One field per item.
|
|
@@ -7,8 +7,9 @@ export declare const optionalBooleanAttribute: (value: unknown) => boolean | und
|
|
|
7
7
|
* A layout wrapper for one form field: the control, its `st-form-hint` and its `st-form-errors`.
|
|
8
8
|
*
|
|
9
9
|
* @remarks
|
|
10
|
-
* It is also the field context: controls inside it read `required` from here,
|
|
11
|
-
* `st-form-hint` inside it is linked to the control through `aria-describedby
|
|
10
|
+
* It is also the field context: controls inside it read `required` from here, every
|
|
11
|
+
* `st-form-hint` inside it is linked to the control through `aria-describedby`, and so is the
|
|
12
|
+
* `st-form-errors` message while the control is invalid and touched or dirty.
|
|
12
13
|
*/
|
|
13
14
|
export declare class FormItemComponent {
|
|
14
15
|
/**
|
|
@@ -16,15 +17,34 @@ export declare class FormItemComponent {
|
|
|
16
17
|
*/
|
|
17
18
|
required: import("@angular/core").InputSignalWithTransform<boolean | undefined, unknown>;
|
|
18
19
|
private readonly hints;
|
|
20
|
+
private readonly errors;
|
|
19
21
|
/** Ids of the hints inside this item, space separated, or `null` when there are none. */
|
|
20
22
|
readonly describedBy: Signal<string | null>;
|
|
21
23
|
/** @internal Called by `st-form-hint`. */
|
|
22
24
|
registerHint(id: string): void;
|
|
23
25
|
/** @internal Called by `st-form-hint`. */
|
|
24
26
|
unregisterHint(id: string): void;
|
|
27
|
+
/** @internal Ids of the `st-form-errors` messages inside this item. */
|
|
28
|
+
readonly errorIds: Signal<readonly string[]>;
|
|
29
|
+
/** @internal Called by `st-form-errors`. */
|
|
30
|
+
registerError(id: string): void;
|
|
31
|
+
/** @internal Called by `st-form-errors`. */
|
|
32
|
+
unregisterError(id: string): void;
|
|
25
33
|
static ɵfac: i0.ɵɵFactoryDeclaration<FormItemComponent, never>;
|
|
26
34
|
static ɵcmp: i0.ɵɵComponentDeclaration<FormItemComponent, "st-form-item", never, { "required": { "alias": "required"; "required": false; "isSignal": true; }; }, {}, never, [":not(st-form-errors)", "st-form-errors"], true, never>;
|
|
27
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* @internal
|
|
38
|
+
* Provided by a field that wraps a projected kit control instead of rendering its own (`st-datepicker`
|
|
39
|
+
* around its `st-input` trigger). The projected control has no form control of its own, so it takes
|
|
40
|
+
* the field's `required` and `invalid` state from here.
|
|
41
|
+
*/
|
|
42
|
+
export declare class FormFieldA11yScope {
|
|
43
|
+
/** The wrapping field's state. */
|
|
44
|
+
readonly field: import("@angular/core").WritableSignal<FormFieldA11y | null>;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<FormFieldA11yScope, never>;
|
|
46
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<FormFieldA11yScope>;
|
|
47
|
+
}
|
|
28
48
|
/** Sources a form control passes to `injectFormFieldA11y`. */
|
|
29
49
|
export interface FormFieldA11ySource {
|
|
30
50
|
/** The control's own `required` input (`undefined` when not set). */
|
|
@@ -33,17 +53,29 @@ export interface FormFieldA11ySource {
|
|
|
33
53
|
control: () => AbstractControl | null | undefined;
|
|
34
54
|
/** A signal that changes when the control status changes, so validator changes are picked up. */
|
|
35
55
|
status?: () => unknown;
|
|
56
|
+
/**
|
|
57
|
+
* Set by a field that wraps a projected kit control (`st-datepicker`): it then shares its state
|
|
58
|
+
* through the `FormFieldA11yScope` it provides.
|
|
59
|
+
*/
|
|
60
|
+
wrapsControl?: boolean;
|
|
36
61
|
}
|
|
37
|
-
/** Required
|
|
62
|
+
/** Required, invalid and description state for a form control. */
|
|
38
63
|
export interface FormFieldA11y {
|
|
39
64
|
/** Whether the field shows the required marker and is announced as required. */
|
|
40
65
|
required: Signal<boolean>;
|
|
41
|
-
/**
|
|
66
|
+
/** Whether the control is invalid and touched or dirty: the value for `aria-invalid`. */
|
|
67
|
+
invalid: Signal<boolean>;
|
|
68
|
+
/** Value for the control's `aria-describedby`: the hint ids, then the error ids while `invalid`. */
|
|
42
69
|
describedBy: Signal<string | null>;
|
|
43
70
|
}
|
|
44
71
|
/**
|
|
45
72
|
* @internal
|
|
46
|
-
* Resolves
|
|
47
|
-
*
|
|
73
|
+
* Resolves, for one form control:
|
|
74
|
+
* - `required`: the explicit input, then a wrapping field (for a control without a form control of its own), then the
|
|
75
|
+
* enclosing `st-form-item`, then `Validators.required`;
|
|
76
|
+
* - `invalid`: the bound control is invalid and touched or dirty (a control without one takes it from a wrapping field);
|
|
77
|
+
* - `describedBy`: the `st-form-hint` ids of the enclosing `st-form-item`, plus its `st-form-errors` ids while `invalid`.
|
|
78
|
+
*
|
|
79
|
+
* Bind `aria-invalid` to `invalid() || null` and `aria-describedby` to `describedBy()`. Call it in an injection context.
|
|
48
80
|
*/
|
|
49
81
|
export declare function injectFormFieldA11y(source: FormFieldA11ySource): FormFieldA11y;
|
|
@@ -15,6 +15,13 @@ Text field. Default `variant` is `base`.
|
|
|
15
15
|
## Notes
|
|
16
16
|
|
|
17
17
|
- Supports `parentForm` / `formControlName`, `onlyNumbers`, `ghost`, `debounceTime`.
|
|
18
|
+
- `onlyNumbers` accepts digits only. Add `onlyNumbersAllowNegative` for a single leading `-` and `onlyNumbersAllowDecimal` for a single `.` after at least one digit (no comma). With either on, each keypress and paste is judged by the value it leaves, so half-typed values (`-`, `4.`, `-0.`) stay typeable; check the complete value with a form validator.
|
|
19
|
+
|
|
20
|
+
```html
|
|
21
|
+
<st-input label="Amount" onlyNumbers onlyNumbersAllowNegative onlyNumbersAllowDecimal [(value)]="amount"></st-input>
|
|
22
|
+
```
|
|
23
|
+
|
|
18
24
|
- Prefer `(triggered)` instead of the old `(enterPressed)`.
|
|
19
25
|
- `label` names the inner `<input>` through a generated id; pass `inputId` when you need a known id.
|
|
20
26
|
- `passwordToggle` on `type="password"` adds a reveal button named from `sdk.input.showPassword` / `sdk.input.hidePassword`.
|
|
27
|
+
- Validation errors: inside `st-form-item` with `st-form-errors`, the inner `<input>` gets `aria-invalid="true"` while its control is invalid and touched or dirty, and the error message id joins the hint ids in its `aria-describedby`. See [Form Error](../form-error/README.md).
|
|
@@ -102,6 +102,16 @@ export declare class InputComponent implements ControlValueAccessor {
|
|
|
102
102
|
* @defaultValue false
|
|
103
103
|
*/
|
|
104
104
|
onlyNumbers: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
105
|
+
/**
|
|
106
|
+
* With `onlyNumbers`, also accept a single leading `-`
|
|
107
|
+
* @defaultValue false
|
|
108
|
+
*/
|
|
109
|
+
onlyNumbersAllowNegative: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
110
|
+
/**
|
|
111
|
+
* With `onlyNumbers`, also accept a single `.` as decimal separator after at least one digit
|
|
112
|
+
* @defaultValue false
|
|
113
|
+
*/
|
|
114
|
+
onlyNumbersAllowDecimal: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
105
115
|
/**
|
|
106
116
|
* Whether to use ghost (transparent) styling
|
|
107
117
|
* @defaultValue false
|
|
@@ -241,6 +251,6 @@ export declare class InputComponent implements ControlValueAccessor {
|
|
|
241
251
|
*/
|
|
242
252
|
private setupDebounce;
|
|
243
253
|
static ɵfac: i0.ɵɵFactoryDeclaration<InputComponent, never>;
|
|
244
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "st-input", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "showOptional": { "alias": "showOptional"; "required": false; "isSignal": true; }; "optionalText": { "alias": "optionalText"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "passwordToggle": { "alias": "passwordToggle"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "focus": { "alias": "focus"; "required": false; "isSignal": true; }; "onlyNumbers": { "alias": "onlyNumbers"; "required": false; "isSignal": true; }; "ghost": { "alias": "ghost"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; "debounceTime": { "alias": "debounceTime"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "keyDownEnter": "keyDownEnter"; "triggered": "triggered"; "clicked": "clicked"; "blurred": "blurred"; "valueDebounced": "valueDebounced"; }, never, ["st-input-content[alignment='start']", "st-input-content[alignment='end']", ":not(st-input-content)"], true, never>;
|
|
254
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<InputComponent, "st-input", never, { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "label": { "alias": "label"; "required": false; "isSignal": true; }; "showOptional": { "alias": "showOptional"; "required": false; "isSignal": true; }; "optionalText": { "alias": "optionalText"; "required": false; "isSignal": true; }; "required": { "alias": "required"; "required": false; "isSignal": true; }; "type": { "alias": "type"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "inputId": { "alias": "inputId"; "required": false; "isSignal": true; }; "passwordToggle": { "alias": "passwordToggle"; "required": false; "isSignal": true; }; "placeholder": { "alias": "placeholder"; "required": false; "isSignal": true; }; "readonly": { "alias": "readonly"; "required": false; "isSignal": true; }; "focus": { "alias": "focus"; "required": false; "isSignal": true; }; "onlyNumbers": { "alias": "onlyNumbers"; "required": false; "isSignal": true; }; "onlyNumbersAllowNegative": { "alias": "onlyNumbersAllowNegative"; "required": false; "isSignal": true; }; "onlyNumbersAllowDecimal": { "alias": "onlyNumbersAllowDecimal"; "required": false; "isSignal": true; }; "ghost": { "alias": "ghost"; "required": false; "isSignal": true; }; "value": { "alias": "value"; "required": false; "isSignal": true; }; "parentForm": { "alias": "parentForm"; "required": false; "isSignal": true; }; "formControlName": { "alias": "formControlName"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "stopPropagation": { "alias": "stopPropagation"; "required": false; "isSignal": true; }; "debounceTime": { "alias": "debounceTime"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; "disabled": "disabledChange"; "keyDownEnter": "keyDownEnter"; "triggered": "triggered"; "clicked": "clicked"; "blurred": "blurred"; "valueDebounced": "valueDebounced"; }, never, ["st-input-content[alignment='start']", "st-input-content[alignment='end']", ":not(st-input-content)"], true, never>;
|
|
245
255
|
}
|
|
246
256
|
export {};
|
|
@@ -17,3 +17,11 @@ List picker. Clear is a sibling of the trigger; the chevron is a custom icon tha
|
|
|
17
17
|
- `allowClear` defaults to `true`. The panel opens 4px from the field with the shared popover motion (`popover-motion`), toward the side the CDK placed it on.
|
|
18
18
|
- Do not nest the clear button inside the trigger.
|
|
19
19
|
- Async options: a value written through the form (`writeValue`) before its option exists is kept and resolved to the matching option, with its label, as soon as one arrives (first load or a replaced list), without calling `onChange` (the control stays pristine). A user selection, clear or `writeValue(null)` replaces it. While no option matches the select shows the placeholder and its value is `null`; the form control still holds the written value.
|
|
20
|
+
- Disabled options: `disabledKey` names the option property that disables it when truthy. The option stays in the list and in search results, is dimmed with the kit's disabled colors (`--color-disabled-content`), carries `aria-disabled="true"` and cannot be chosen by click, Enter or Space. ArrowUp, ArrowDown, Home and End skip them. Without `disabledKey` every option is enabled.
|
|
21
|
+
- Secondary text: `descriptionKey` names an option property shown as a second line under the label (for example why the option is disabled). It is part of the option's accessible name.
|
|
22
|
+
- Validation errors: inside `st-form-item` with `st-form-errors`, the `role="combobox"` trigger gets `aria-invalid="true"` while its control is invalid and touched or dirty, and the error message id joins the hint ids in its `aria-describedby`. See [Form Error](../form-error/README.md).
|
|
23
|
+
- Listbox: the trigger has `aria-haspopup="listbox"` and `aria-controls` pointing at the listbox's generated id (unique per instance). The listbox is named by the `label` (through the visually hidden label's id), or by the trigger when there is no `label`. With no options it shows `sdk.select.noOptions` ("No options available" when no translation is loaded).
|
|
24
|
+
|
|
25
|
+
```html
|
|
26
|
+
<st-select [options]="countries" displayKey="name" valueKey="code" disabledKey="added" descriptionKey="note" [(value)]="country"></st-select>
|
|
27
|
+
```
|