forty-cdk 0.44.0 → 0.45.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/accordion/README.md +16 -3
- package/combobox/README.md +15 -4
- package/disclosure/README.md +15 -3
- package/fesm2022/forty-cdk-accordion.mjs +64 -17
- package/fesm2022/forty-cdk-accordion.mjs.map +1 -1
- package/fesm2022/forty-cdk-combobox.mjs +2 -2
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -1
- package/fesm2022/forty-cdk-core.mjs +39 -6
- package/fesm2022/forty-cdk-core.mjs.map +1 -1
- package/fesm2022/forty-cdk-defaults.mjs.map +1 -1
- package/fesm2022/forty-cdk-disclosure.mjs +69 -15
- package/fesm2022/forty-cdk-disclosure.mjs.map +1 -1
- package/fesm2022/forty-cdk-table.mjs +45 -1
- package/fesm2022/forty-cdk-table.mjs.map +1 -1
- package/package.json +1 -1
- package/radio-group/README.md +2 -2
- package/table/README.md +2 -0
- package/toggle/README.md +2 -2
- package/types/forty-cdk-accordion.d.ts +27 -4
- package/types/forty-cdk-combobox.d.ts +6 -6
- package/types/forty-cdk-core.d.ts +16 -1
- package/types/forty-cdk-defaults.d.ts +4 -3
- package/types/forty-cdk-disclosure.d.ts +37 -4
package/package.json
CHANGED
package/radio-group/README.md
CHANGED
|
@@ -123,7 +123,7 @@ export class DemoShipping {
|
|
|
123
123
|
| Property | Type | Description |
|
|
124
124
|
| ------------------------------------------------------------ | ---------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
125
125
|
| `value` | `model<string \| null>` | Two-way bindable. The selected radio's value; `null` = none selected, distinct from a radio whose `value` is `''`. Required by `FormValueControl<string \| null>`.<br>**Default:** `null` |
|
|
126
|
-
| `ariaLabel` | `input<string \| null>` | Reactive accessible name, reflected as `aria-label`; a static `aria-label` on the host wins over it. Prefer `aria-labelledby` when a visible label element exists.<br>**Default:** `null` (and `''`) emits no attribute
|
|
126
|
+
| `ariaLabel` | `input<string \| null>` | Reactive accessible name, reflected as `aria-label`; a static `aria-label` on the host wins over it, and a bound `[attr.aria-label]` is removed. Prefer `aria-labelledby` when a visible label element exists.<br>**Default:** `null` (and `''`) emits no attribute |
|
|
127
127
|
| `orientation` | `input<'horizontal' \| 'vertical'>` | Layout hint reflected as `aria-orientation` / `data-orientation`. Does **not** restrict arrow navigation: all four cursors navigate in either orientation.<br>**Default:** `'vertical'` |
|
|
128
128
|
| `dir` | `input<'ltr' \| 'rtl' \| null>` | Swaps ArrowLeft / ArrowRight. `null` inherits the nearest `[dir]` / `<html dir>`, else `'ltr'`.<br>**Default:** `null` |
|
|
129
129
|
| `disabled` / `readonly` / `required` / `invalid` / `pending` | `input<boolean>` | Reflected as `aria-*` / `data-*`. `disabled` blocks all interaction; `readonly` blocks selection changes but arrows still move focus.<br>**Default:** `false` |
|
|
@@ -201,7 +201,7 @@ export const appConfig: ApplicationConfig = {
|
|
|
201
201
|
|
|
202
202
|
Implements the [WAI-ARIA Radio Group pattern](https://www.w3.org/WAI/ARIA/apg/patterns/radio/).
|
|
203
203
|
|
|
204
|
-
- **Provide a group label.** Use `aria-labelledby` (pointing to a heading or `<span>`), a static `aria-label`, or the reactive `[ariaLabel]` input. Without one, screen readers cannot announce the group's purpose.
|
|
204
|
+
- **Provide a group label.** Use `aria-labelledby` (pointing to a heading or `<span>`), a static `aria-label`, or the reactive `[ariaLabel]` input. Without one, screen readers cannot announce the group's purpose. A bound `[attr.aria-label]` does not name the group: the group's own `aria-label` binding removes it, and dev mode warns `FORCDK-CORE-015`. Bind a changing name through `[ariaLabel]`.
|
|
205
205
|
- **Selection-on-focus** is the APG-mandated behavior for standard radio groups (toolbars use a different model). Be aware that arrow navigation immediately changes the form value.
|
|
206
206
|
- **All four arrow keys navigate** regardless of `orientation`, matching the WAI-ARIA Radio Group pattern and native HTML radios; `orientation` is a visual / `aria-orientation` hint only.
|
|
207
207
|
- **`role="radio"`** works on a `<button>` or on any other host. A non-button host has `Space` / `Enter` selection synthesized and emits no `type` attribute, so the radio holding the tab stop is always operable.
|
package/table/README.md
CHANGED
|
@@ -283,6 +283,8 @@ Two regimes, chosen by `mode`. The default `mode="table"` adds no navigation of
|
|
|
283
283
|
|
|
284
284
|
`PageUp` from within the first page of data rows clamps to the header row, for the same reason `ArrowUp` crosses into it. Under [`[forTableVirtualized]`](../table-virtualization/README.md) a move resolving a row outside the rendered window scrolls that row into view and lands focus on the target cell once it mounts; a move onto the header row also scrolls the window back to row 0, so the grid is never left focused on its header while the window sits at the end of the dataset. When the header does not join the grid (an incomplete header row), `Ctrl/Cmd+Home` lands on the first data cell instead and `ArrowUp` / `PageUp` stop there.
|
|
285
285
|
|
|
286
|
+
When the focused cell is removed, focus stays in the grid and moves to the cell that takes over the tab stop. Removing its column moves focus to the cell of the same row in the next column, or in the previous column when the last column was removed. Removing its row moves focus to the cell of the same column in the next row, or in the previous row when the last row was removed. A disabled target hands over to the nearest enabled cell of its row. This also applies when the focus was on a widget inside the cell. If focus had already left the grid, or the removed cell did not hold focus, nothing moves. Under `[forTableVirtualized]`, a focused row leaving the rendered window is left alone, because moving focus would scroll it back into view.
|
|
287
|
+
|
|
286
288
|
### Cell entry
|
|
287
289
|
|
|
288
290
|
`grid` / `treegrid`. The APG cell-entry mode that reaches a widget rendered inside a cell.
|
package/toggle/README.md
CHANGED
|
@@ -118,7 +118,7 @@ export class DemoAlignment {
|
|
|
118
118
|
| Property | Type | Description |
|
|
119
119
|
| -------------- | ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
120
120
|
| `value` | `model<readonly string[]>` | Two-way bindable. Selected values, in arbitrary order. Required by `FormValueControl<readonly string[]>`.<br>**Default:** `[]` |
|
|
121
|
-
| `ariaLabel` | `input<string \| null>` | Reactive accessible name, reflected as `aria-label`; a static `aria-label` on the host wins over it. Prefer `aria-labelledby` when a visible label element exists.<br>**Default:** `null` (and `''`) emits no attribute
|
|
121
|
+
| `ariaLabel` | `input<string \| null>` | Reactive accessible name, reflected as `aria-label`; a static `aria-label` on the host wins over it, and a bound `[attr.aria-label]` is removed. Prefer `aria-labelledby` when a visible label element exists.<br>**Default:** `null` (and `''`) emits no attribute |
|
|
122
122
|
| `multiple` | `input<boolean>` | When `true`, items toggle independently. When `false`, single mode (clicking the pressed item clears, unless `deselectable` is `false`).<br>**Default:** `false` |
|
|
123
123
|
| `deselectable` | `input<boolean>` | In single mode, whether pressing the pressed item clears the selection. When `false`, that press is a no-op and the item keeps `aria-pressed="true"`; a group with no value still starts empty. Ignored in multiple mode. The default is read from `provideForToggleDefaults`.<br>**Default:** `true` |
|
|
124
124
|
| `disabled` | `input<boolean>` | Disables every item regardless of per-item state.<br>**Default:** `false` |
|
|
@@ -173,7 +173,7 @@ Arrow keys move focus only. Selection requires an explicit click or Space / Ente
|
|
|
173
173
|
Implements the [WAI-ARIA Button pattern](https://www.w3.org/WAI/ARIA/apg/patterns/button/) (toggle-button variant).
|
|
174
174
|
|
|
175
175
|
- **`[forToggle]`** emits `role="button"` with `aria-pressed="true|false"`, which screen readers announce as "toggle button".
|
|
176
|
-
- **`[forToggleGroup]`** emits `role="group"` and reflects `data-orientation` for CSS (not `aria-orientation`). Provide a label via `aria-labelledby`, a static `aria-label`, or the reactive `[ariaLabel]` input.
|
|
176
|
+
- **`[forToggleGroup]`** emits `role="group"` and reflects `data-orientation` for CSS (not `aria-orientation`). Provide a label via `aria-labelledby`, a static `aria-label`, or the reactive `[ariaLabel]` input. A bound `[attr.aria-label]` does not name the group: the group's own `aria-label` binding removes it, and dev mode warns `FORCDK-CORE-015`. Bind a changing name through `[ariaLabel]`.
|
|
177
177
|
- **Roving tabindex** manages focus within the group. The consumer never sets `tabindex` manually.
|
|
178
178
|
- **A disabled item stays announced but is skipped by the keyboard**: it reflects `aria-disabled="true"` + `data-disabled=""` rather than native `disabled`, so assistive tech still announces it while interaction is a no-op, and the arrows, Home / End and the Tab stop pass over it.
|
|
179
179
|
- **`readonly` has no ARIA channel here.** WAI-ARIA supports `aria-readonly` on neither `role="button"` nor `role="group"`, so a read-only toggle / group reflects the boolean `data-readonly` styling hook only and interaction is blocked in the handler.
|
|
@@ -129,6 +129,9 @@ export declare class ForAccordion implements ForAccordionContext {
|
|
|
129
129
|
focusByOffset(currentTrigger: HTMLElement, action: ListNavigationAction): void;
|
|
130
130
|
private registerTrigger;
|
|
131
131
|
private unregisterTrigger;
|
|
132
|
+
private registerContent;
|
|
133
|
+
private unregisterContent;
|
|
134
|
+
private hasContent;
|
|
132
135
|
static ɵfac: i0.ɵɵFactoryDeclaration<ForAccordion, never>;
|
|
133
136
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ForAccordion, "[forAccordion]", ["forAccordion"], {
|
|
134
137
|
"multiple": {
|
|
@@ -231,9 +234,9 @@ export declare class ForAccordionItem implements ForAccordionItemContext {
|
|
|
231
234
|
* Handles ARIA wiring, click-to-toggle, and the recommended keyboard
|
|
232
235
|
* navigation (ArrowDown / ArrowUp / Home / End).
|
|
233
236
|
*
|
|
234
|
-
* `aria-controls`
|
|
235
|
-
*
|
|
236
|
-
*
|
|
237
|
+
* `aria-controls` references the item's content while the item is expanded,
|
|
238
|
+
* and while it is collapsed with the content kept mounted. A panel unmounted
|
|
239
|
+
* by `@if (item.expanded())` is not referenced while collapsed.
|
|
237
240
|
*/
|
|
238
241
|
export declare class ForAccordionTrigger {
|
|
239
242
|
#private;
|
|
@@ -269,17 +272,37 @@ export declare class ForAccordionTrigger {
|
|
|
269
272
|
* reflects `aria-hidden="true"` and `inert` while closed so the panel is
|
|
270
273
|
* removed from the accessibility tree and focus order automatically.
|
|
271
274
|
*
|
|
275
|
+
* Set `hiddenUntilFound` on a mounted panel to hide it with
|
|
276
|
+
* `hidden="until-found"` instead, so find-in-page can reach its text and open it.
|
|
277
|
+
*
|
|
272
278
|
* APG note: `role="region"` adds the panel to the landmark navigation tree.
|
|
273
279
|
* If the accordion has 6+ simultaneously expandable panels, consider not
|
|
274
280
|
* using region — the directive will gain an opt-out input when this comes up
|
|
275
281
|
* in real usage.
|
|
276
282
|
*/
|
|
277
283
|
export declare class ForAccordionContent {
|
|
284
|
+
#private;
|
|
278
285
|
private readonly parent;
|
|
279
286
|
private readonly item;
|
|
287
|
+
/**
|
|
288
|
+
* When set, a collapsed panel is hidden with `hidden="until-found"` in place of
|
|
289
|
+
* `aria-hidden` + `inert`, and a find-in-page match or fragment navigation inside it
|
|
290
|
+
* expands the item as a trigger click would. A disabled item stays collapsed. Closing
|
|
291
|
+
* is instant, so the opt-in rules out an exit animation.
|
|
292
|
+
*/
|
|
293
|
+
readonly hiddenUntilFound: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
294
|
+
private readonly hiddenValue;
|
|
295
|
+
private readonly untilFound;
|
|
280
296
|
private readonly labelledBy;
|
|
281
297
|
constructor();
|
|
298
|
+
private onBeforeMatch;
|
|
282
299
|
static ɵfac: i0.ɵɵFactoryDeclaration<ForAccordionContent, never>;
|
|
283
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ForAccordionContent, "[forAccordionContent]", ["forAccordionContent"], {
|
|
300
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ForAccordionContent, "[forAccordionContent]", ["forAccordionContent"], {
|
|
301
|
+
"hiddenUntilFound": {
|
|
302
|
+
"alias": "hiddenUntilFound";
|
|
303
|
+
"required": false;
|
|
304
|
+
"isSignal": true;
|
|
305
|
+
};
|
|
306
|
+
}, {}, never, never, true, never>;
|
|
284
307
|
}
|
|
285
308
|
export type { ForAccordionContext, ForAccordionItemContext };
|
|
@@ -324,12 +324,12 @@ export declare class ForCombobox<T = string> extends AnchoredFormValueControlBas
|
|
|
324
324
|
*/
|
|
325
325
|
readonly commitOnSelect: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
326
326
|
/**
|
|
327
|
-
*
|
|
328
|
-
*
|
|
329
|
-
*
|
|
330
|
-
*
|
|
331
|
-
* Defaults to the scope's `restoreQueryOnClose`
|
|
332
|
-
* `provideForComboboxDefaults`).
|
|
327
|
+
* Rewrite `query` whenever the listbox closes without a pick (Escape, an outside
|
|
328
|
+
* press, Tab, a toggle press, or `closeOverlay()`). In single mode it restores
|
|
329
|
+
* the selected option's label, or clears it when nothing is selected; in multi
|
|
330
|
+
* mode it clears the typed filter. A pick keeps the `commitOnSelect` behavior.
|
|
331
|
+
* Ignored in the picker anatomy. Defaults to the scope's `restoreQueryOnClose`
|
|
332
|
+
* (`false` unless overridden via `provideForComboboxDefaults`).
|
|
333
333
|
*/
|
|
334
334
|
readonly restoreQueryOnClose: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
335
335
|
/** When the user edits the query, automatically clear the committed `value`. Off by default — most apps want the value preserved across query edits. Single-mode only. */
|
|
@@ -3925,7 +3925,9 @@ export declare function hostLabelledBy(fallback: () => string | null): Signal<st
|
|
|
3925
3925
|
* rather than on the raw input, since `aria-labelledby` outranks `aria-label` in ARIA and a
|
|
3926
3926
|
* generated fallback would otherwise beat the consumer's adopted name.
|
|
3927
3927
|
*
|
|
3928
|
-
* Only **static** values are adopted; see {@link hostLabelledBy} for the boundary.
|
|
3928
|
+
* Only **static** values are adopted; see {@link hostLabelledBy} for the boundary. In dev mode a
|
|
3929
|
+
* consumer `[attr.aria-label]` binding that the host binding is about to remove warns
|
|
3930
|
+
* `FORCDK-CORE-015`, once per host.
|
|
3929
3931
|
*
|
|
3930
3932
|
* Must be invoked in an injection context.
|
|
3931
3933
|
*
|
|
@@ -4006,6 +4008,19 @@ export declare function staticHostId(host: HTMLElement): string | null;
|
|
|
4006
4008
|
*/
|
|
4007
4009
|
export declare function hostId(prefix: string): Signal<string>;
|
|
4008
4010
|
export declare function hostStaticAttribute(name: string, fallback: () => string | null): Signal<string | null>;
|
|
4011
|
+
/** The `hidden` attribute value that keeps a panel searchable by find-in-page. */
|
|
4012
|
+
export declare const HIDDEN_UNTIL_FOUND = "until-found";
|
|
4013
|
+
/**
|
|
4014
|
+
* Puts `hidden="until-found"` back on `host` after the browser strips it to reveal a
|
|
4015
|
+
* find-in-page match the owning piece declined to open, so the panel never shows while
|
|
4016
|
+
* its state says closed.
|
|
4017
|
+
*
|
|
4018
|
+
* Call it from the `beforematch` listener. The browser removes the attribute only after
|
|
4019
|
+
* the listener returns, so the restore waits for that removal. `stillHidden` is read at
|
|
4020
|
+
* that point and must answer whether the panel should still be hidden, which keeps a
|
|
4021
|
+
* restore that lands after a later legitimate open from hiding an open panel.
|
|
4022
|
+
*/
|
|
4023
|
+
export declare function keepHiddenUntilFound(host: HTMLElement, stillHidden: () => boolean): void;
|
|
4009
4024
|
/**
|
|
4010
4025
|
* Resolves the `type` attribute a piece must emit to force `type="button"`:
|
|
4011
4026
|
* `'button'` on a native `<button>` host, `null` on any other element.
|
|
@@ -286,9 +286,10 @@ interface ForComboboxDefaults {
|
|
|
286
286
|
*/
|
|
287
287
|
openHighlight: ForComboboxOpenHighlight;
|
|
288
288
|
/**
|
|
289
|
-
* Whether
|
|
290
|
-
*
|
|
291
|
-
* that don't set `restoreQueryOnClose` locally. Library fallback
|
|
289
|
+
* Whether an editable combobox rewrites `query` when its listbox closes without
|
|
290
|
+
* a pick (the selected label in single mode, `''` in multi mode), for
|
|
291
|
+
* comboboxes that don't set `restoreQueryOnClose` locally. Library fallback
|
|
292
|
+
* `false`.
|
|
292
293
|
*/
|
|
293
294
|
restoreQueryOnClose: boolean;
|
|
294
295
|
/**
|
|
@@ -16,6 +16,16 @@ interface ForDisclosureContext {
|
|
|
16
16
|
adoptContentId(el: HTMLElement): void;
|
|
17
17
|
toggle(): void;
|
|
18
18
|
}
|
|
19
|
+
/**
|
|
20
|
+
* DI token for the disclosure's coordination surface, provided by `[forDisclosure]`.
|
|
21
|
+
*
|
|
22
|
+
* Publicly typed as the read surface {@link ForDisclosureContext}, which is the whole of
|
|
23
|
+
* what the token promises a consumer. The pieces read the same token at an internal type
|
|
24
|
+
* that adds the content-registration protocol, so a wrapper re-providing it must alias it
|
|
25
|
+
* to the root: `{ provide: FOR_DISCLOSURE_CONTEXT, useExisting: MyDisclosure }`, where
|
|
26
|
+
* `MyDisclosure` extends `ForDisclosure`. A value that merely satisfies the declared type
|
|
27
|
+
* resolves too, and is rejected in dev mode by the first piece to reach the protocol.
|
|
28
|
+
*/
|
|
19
29
|
export declare const FOR_DISCLOSURE_CONTEXT: InjectionToken<ForDisclosureContext>;
|
|
20
30
|
/**
|
|
21
31
|
* Root of the Disclosure primitive. Holds the open/disabled state and
|
|
@@ -57,6 +67,9 @@ export declare class ForDisclosure implements ForDisclosureContext {
|
|
|
57
67
|
/** Adopts a consumer-set static `id` on the content host into `contentId`. */
|
|
58
68
|
adoptContentId(el: HTMLElement): void;
|
|
59
69
|
toggle(): void;
|
|
70
|
+
private registerContent;
|
|
71
|
+
private unregisterContent;
|
|
72
|
+
private hasContent;
|
|
60
73
|
static ɵfac: i0.ɵɵFactoryDeclaration<ForDisclosure, never>;
|
|
61
74
|
static ɵdir: i0.ɵɵDirectiveDeclaration<ForDisclosure, "[forDisclosure]", ["forDisclosure"], {
|
|
62
75
|
"open": {
|
|
@@ -78,9 +91,9 @@ export declare class ForDisclosure implements ForDisclosureContext {
|
|
|
78
91
|
* toggling come from native button behavior. The directive host-binds
|
|
79
92
|
* `type="button"` so a trigger inside a `<form>` never submits it on toggle.
|
|
80
93
|
*
|
|
81
|
-
* `aria-controls`
|
|
82
|
-
*
|
|
83
|
-
*
|
|
94
|
+
* `aria-controls` references the content while open, and while closed with the
|
|
95
|
+
* content kept mounted. A panel unmounted by `@if (open())` is not referenced
|
|
96
|
+
* while closed.
|
|
84
97
|
*
|
|
85
98
|
* Disabling: the trigger merges its own `disabled` input OR the root's
|
|
86
99
|
* `disabled` into `effectiveDisabled`, which drives the native `disabled`
|
|
@@ -116,11 +129,31 @@ export declare class ForDisclosureTrigger {
|
|
|
116
129
|
* state), the directive reflects `aria-hidden="true"` and `inert` while
|
|
117
130
|
* closed so the panel is removed from the accessibility tree and focus
|
|
118
131
|
* order automatically.
|
|
132
|
+
*
|
|
133
|
+
* Set `hiddenUntilFound` on a mounted panel to hide it with
|
|
134
|
+
* `hidden="until-found"` instead, so find-in-page can reach its text and open it.
|
|
119
135
|
*/
|
|
120
136
|
export declare class ForDisclosureContent {
|
|
137
|
+
#private;
|
|
121
138
|
private readonly ctx;
|
|
139
|
+
/**
|
|
140
|
+
* When set, a closed panel is hidden with `hidden="until-found"` in place of
|
|
141
|
+
* `aria-hidden` + `inert`, and a find-in-page match or fragment navigation inside it
|
|
142
|
+
* opens the disclosure as a trigger click would. A disabled disclosure stays closed.
|
|
143
|
+
* Closing is instant, so the opt-in rules out an exit animation.
|
|
144
|
+
*/
|
|
145
|
+
readonly hiddenUntilFound: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
146
|
+
private readonly hiddenValue;
|
|
147
|
+
private readonly untilFound;
|
|
122
148
|
constructor();
|
|
149
|
+
private onBeforeMatch;
|
|
123
150
|
static ɵfac: i0.ɵɵFactoryDeclaration<ForDisclosureContent, never>;
|
|
124
|
-
static ɵdir: i0.ɵɵDirectiveDeclaration<ForDisclosureContent, "[forDisclosureContent]", ["forDisclosureContent"], {
|
|
151
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ForDisclosureContent, "[forDisclosureContent]", ["forDisclosureContent"], {
|
|
152
|
+
"hiddenUntilFound": {
|
|
153
|
+
"alias": "hiddenUntilFound";
|
|
154
|
+
"required": false;
|
|
155
|
+
"isSignal": true;
|
|
156
|
+
};
|
|
157
|
+
}, {}, never, never, true, never>;
|
|
125
158
|
}
|
|
126
159
|
export type { ForDisclosureContext };
|