forty-cdk 0.2.0 → 0.3.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 +122 -0
- package/aspect-ratio/README.md +76 -0
- package/avatar/README.md +100 -0
- package/breadcrumbs/README.md +49 -0
- package/breakpoints/README.md +81 -0
- package/button/README.md +49 -0
- package/calendar/README.md +458 -0
- package/carousel/README.md +358 -0
- package/checkbox/README.md +146 -0
- package/combobox/README.md +535 -0
- package/context-menu/README.md +139 -0
- package/date-field/README.md +184 -0
- package/date-picker/README.md +338 -0
- package/dialog/README.md +388 -0
- package/disclosure/README.md +114 -0
- package/drag-drop/README.md +359 -0
- package/drawer/README.md +560 -0
- package/dropdown-menu/README.md +176 -0
- package/fesm2022/forty-cdk-accordion.mjs +348 -0
- package/fesm2022/forty-cdk-accordion.mjs.map +1 -0
- package/fesm2022/forty-cdk-aspect-ratio.mjs +74 -0
- package/fesm2022/forty-cdk-aspect-ratio.mjs.map +1 -0
- package/fesm2022/forty-cdk-avatar.mjs +308 -0
- package/fesm2022/forty-cdk-avatar.mjs.map +1 -0
- package/fesm2022/forty-cdk-breadcrumbs.mjs +125 -0
- package/fesm2022/forty-cdk-breadcrumbs.mjs.map +1 -0
- package/fesm2022/forty-cdk-breakpoints.mjs +117 -0
- package/fesm2022/forty-cdk-breakpoints.mjs.map +1 -0
- package/fesm2022/forty-cdk-button.mjs +134 -0
- package/fesm2022/forty-cdk-button.mjs.map +1 -0
- package/fesm2022/forty-cdk-calendar.mjs +2034 -0
- package/fesm2022/forty-cdk-calendar.mjs.map +1 -0
- package/fesm2022/forty-cdk-carousel.mjs +968 -0
- package/fesm2022/forty-cdk-carousel.mjs.map +1 -0
- package/fesm2022/forty-cdk-checkbox.mjs +226 -0
- package/fesm2022/forty-cdk-checkbox.mjs.map +1 -0
- package/fesm2022/forty-cdk-combobox.mjs +2596 -0
- package/fesm2022/forty-cdk-combobox.mjs.map +1 -0
- package/fesm2022/forty-cdk-context-menu.mjs +413 -0
- package/fesm2022/forty-cdk-context-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-core.mjs +9022 -0
- package/fesm2022/forty-cdk-core.mjs.map +1 -0
- package/fesm2022/forty-cdk-date-field.mjs +744 -0
- package/fesm2022/forty-cdk-date-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-date-picker.mjs +1011 -0
- package/fesm2022/forty-cdk-date-picker.mjs.map +1 -0
- package/fesm2022/forty-cdk-dialog.mjs +707 -0
- package/fesm2022/forty-cdk-dialog.mjs.map +1 -0
- package/fesm2022/forty-cdk-disclosure.mjs +190 -0
- package/fesm2022/forty-cdk-disclosure.mjs.map +1 -0
- package/fesm2022/forty-cdk-drag-drop.mjs +1180 -0
- package/fesm2022/forty-cdk-drag-drop.mjs.map +1 -0
- package/fesm2022/forty-cdk-drawer.mjs +1641 -0
- package/fesm2022/forty-cdk-drawer.mjs.map +1 -0
- package/fesm2022/forty-cdk-dropdown-menu.mjs +350 -0
- package/fesm2022/forty-cdk-dropdown-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-field.mjs +425 -0
- package/fesm2022/forty-cdk-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-fieldset.mjs +164 -0
- package/fesm2022/forty-cdk-fieldset.mjs.map +1 -0
- package/fesm2022/forty-cdk-file-upload.mjs +221 -0
- package/fesm2022/forty-cdk-file-upload.mjs.map +1 -0
- package/fesm2022/forty-cdk-hover-card.mjs +496 -0
- package/fesm2022/forty-cdk-hover-card.mjs.map +1 -0
- package/fesm2022/forty-cdk-input.mjs +274 -0
- package/fesm2022/forty-cdk-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-internationalized-date.mjs +1 -1
- package/fesm2022/forty-cdk-internationalized-date.mjs.map +1 -1
- package/fesm2022/forty-cdk-listbox.mjs +1279 -0
- package/fesm2022/forty-cdk-listbox.mjs.map +1 -0
- package/fesm2022/forty-cdk-menu.mjs +1439 -0
- package/fesm2022/forty-cdk-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-menubar.mjs +787 -0
- package/fesm2022/forty-cdk-menubar.mjs.map +1 -0
- package/fesm2022/forty-cdk-meter.mjs +211 -0
- package/fesm2022/forty-cdk-meter.mjs.map +1 -0
- package/fesm2022/forty-cdk-navigation-menu.mjs +1145 -0
- package/fesm2022/forty-cdk-navigation-menu.mjs.map +1 -0
- package/fesm2022/forty-cdk-number-input.mjs +559 -0
- package/fesm2022/forty-cdk-number-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-otp-input.mjs +527 -0
- package/fesm2022/forty-cdk-otp-input.mjs.map +1 -0
- package/fesm2022/forty-cdk-pagination.mjs +323 -0
- package/fesm2022/forty-cdk-pagination.mjs.map +1 -0
- package/fesm2022/forty-cdk-pane-resizer.mjs +297 -0
- package/fesm2022/forty-cdk-pane-resizer.mjs.map +1 -0
- package/fesm2022/forty-cdk-popover.mjs +698 -0
- package/fesm2022/forty-cdk-popover.mjs.map +1 -0
- package/fesm2022/forty-cdk-progress.mjs +226 -0
- package/fesm2022/forty-cdk-progress.mjs.map +1 -0
- package/fesm2022/forty-cdk-radio-group.mjs +378 -0
- package/fesm2022/forty-cdk-radio-group.mjs.map +1 -0
- package/fesm2022/forty-cdk-scroll-area.mjs +640 -0
- package/fesm2022/forty-cdk-scroll-area.mjs.map +1 -0
- package/fesm2022/forty-cdk-search.mjs +205 -0
- package/fesm2022/forty-cdk-search.mjs.map +1 -0
- package/fesm2022/forty-cdk-select.mjs +1661 -0
- package/fesm2022/forty-cdk-select.mjs.map +1 -0
- package/fesm2022/forty-cdk-separator.mjs +82 -0
- package/fesm2022/forty-cdk-separator.mjs.map +1 -0
- package/fesm2022/forty-cdk-signal-forms.mjs +97 -0
- package/fesm2022/forty-cdk-signal-forms.mjs.map +1 -0
- package/fesm2022/forty-cdk-slider.mjs +803 -0
- package/fesm2022/forty-cdk-slider.mjs.map +1 -0
- package/fesm2022/forty-cdk-stepper.mjs +886 -0
- package/fesm2022/forty-cdk-stepper.mjs.map +1 -0
- package/fesm2022/forty-cdk-switch.mjs +137 -0
- package/fesm2022/forty-cdk-switch.mjs.map +1 -0
- package/fesm2022/forty-cdk-table.mjs +1518 -0
- package/fesm2022/forty-cdk-table.mjs.map +1 -0
- package/fesm2022/forty-cdk-tabs.mjs +400 -0
- package/fesm2022/forty-cdk-tabs.mjs.map +1 -0
- package/fesm2022/forty-cdk-time-field.mjs +593 -0
- package/fesm2022/forty-cdk-time-field.mjs.map +1 -0
- package/fesm2022/forty-cdk-time-picker.mjs +1013 -0
- package/fesm2022/forty-cdk-time-picker.mjs.map +1 -0
- package/fesm2022/forty-cdk-toast.mjs +1153 -0
- package/fesm2022/forty-cdk-toast.mjs.map +1 -0
- package/fesm2022/forty-cdk-toggle.mjs +516 -0
- package/fesm2022/forty-cdk-toggle.mjs.map +1 -0
- package/fesm2022/forty-cdk-toolbar.mjs +374 -0
- package/fesm2022/forty-cdk-toolbar.mjs.map +1 -0
- package/fesm2022/forty-cdk-tooltip.mjs +672 -0
- package/fesm2022/forty-cdk-tooltip.mjs.map +1 -0
- package/fesm2022/forty-cdk-tree.mjs +2007 -0
- package/fesm2022/forty-cdk-tree.mjs.map +1 -0
- package/fesm2022/forty-cdk-virtualization.mjs +1 -1
- package/fesm2022/forty-cdk-virtualization.mjs.map +1 -1
- package/fesm2022/forty-cdk.mjs +0 -43310
- package/fesm2022/forty-cdk.mjs.map +1 -1
- package/field/README.md +97 -0
- package/fieldset/README.md +86 -0
- package/file-upload/README.md +73 -0
- package/hover-card/README.md +171 -0
- package/input/README.md +156 -0
- package/listbox/README.md +424 -0
- package/menu/README.md +181 -0
- package/menubar/README.md +140 -0
- package/meter/README.md +128 -0
- package/navigation-menu/README.md +253 -0
- package/number-input/README.md +171 -0
- package/otp-input/README.md +198 -0
- package/package.json +213 -1
- package/pagination/README.md +61 -0
- package/pane-resizer/README.md +136 -0
- package/popover/README.md +262 -0
- package/progress/README.md +115 -0
- package/radio-group/README.md +129 -0
- package/scroll-area/README.md +184 -0
- package/search/README.md +42 -0
- package/select/README.md +488 -0
- package/separator/README.md +84 -0
- package/signal-forms/README.md +72 -0
- package/slider/README.md +152 -0
- package/stepper/README.md +292 -0
- package/switch/README.md +116 -0
- package/table/README.md +769 -0
- package/tabs/README.md +130 -0
- package/time-field/README.md +157 -0
- package/time-picker/README.md +172 -0
- package/toast/README.md +398 -0
- package/toggle/README.md +224 -0
- package/toolbar/README.md +109 -0
- package/tooltip/README.md +274 -0
- package/tree/README.md +708 -0
- package/types/forty-cdk-accordion.d.ts +242 -0
- package/types/forty-cdk-aspect-ratio.d.ts +59 -0
- package/types/forty-cdk-avatar.d.ts +133 -0
- package/types/forty-cdk-breadcrumbs.d.ts +92 -0
- package/types/forty-cdk-breakpoints.d.ts +141 -0
- package/types/forty-cdk-button.d.ts +80 -0
- package/types/forty-cdk-calendar.d.ts +914 -0
- package/types/forty-cdk-carousel.d.ts +530 -0
- package/types/forty-cdk-checkbox.d.ts +141 -0
- package/types/forty-cdk-combobox.d.ts +1259 -0
- package/types/forty-cdk-context-menu.d.ts +313 -0
- package/types/forty-cdk-core.d.ts +5774 -0
- package/types/forty-cdk-date-field.d.ts +307 -0
- package/types/forty-cdk-date-picker.d.ts +622 -0
- package/types/forty-cdk-dialog.d.ts +546 -0
- package/types/forty-cdk-disclosure.d.ts +127 -0
- package/types/forty-cdk-drag-drop.d.ts +456 -0
- package/types/forty-cdk-drawer.d.ts +871 -0
- package/types/forty-cdk-dropdown-menu.d.ts +242 -0
- package/types/forty-cdk-field.d.ts +236 -0
- package/types/forty-cdk-fieldset.d.ts +119 -0
- package/types/forty-cdk-file-upload.d.ts +124 -0
- package/types/forty-cdk-hover-card.d.ts +320 -0
- package/types/forty-cdk-input.d.ts +169 -0
- package/types/forty-cdk-internationalized-date.d.ts +1 -1
- package/types/forty-cdk-listbox.d.ts +513 -0
- package/types/forty-cdk-menu.d.ts +629 -0
- package/types/forty-cdk-menubar.d.ts +451 -0
- package/types/forty-cdk-meter.d.ts +122 -0
- package/types/forty-cdk-navigation-menu.d.ts +514 -0
- package/types/forty-cdk-number-input.d.ts +319 -0
- package/types/forty-cdk-otp-input.d.ts +248 -0
- package/types/forty-cdk-pagination.d.ts +214 -0
- package/types/forty-cdk-pane-resizer.d.ts +145 -0
- package/types/forty-cdk-popover.d.ts +509 -0
- package/types/forty-cdk-progress.d.ts +143 -0
- package/types/forty-cdk-radio-group.d.ts +222 -0
- package/types/forty-cdk-scroll-area.d.ts +258 -0
- package/types/forty-cdk-search.d.ts +142 -0
- package/types/forty-cdk-select.d.ts +899 -0
- package/types/forty-cdk-separator.d.ts +59 -0
- package/types/forty-cdk-signal-forms.d.ts +58 -0
- package/types/forty-cdk-slider.d.ts +379 -0
- package/types/forty-cdk-stepper.d.ts +650 -0
- package/types/forty-cdk-switch.d.ts +87 -0
- package/types/forty-cdk-table.d.ts +723 -0
- package/types/forty-cdk-tabs.d.ts +235 -0
- package/types/forty-cdk-time-field.d.ts +307 -0
- package/types/forty-cdk-time-picker.d.ts +578 -0
- package/types/forty-cdk-toast.d.ts +598 -0
- package/types/forty-cdk-toggle.d.ts +310 -0
- package/types/forty-cdk-toolbar.d.ts +217 -0
- package/types/forty-cdk-tooltip.d.ts +436 -0
- package/types/forty-cdk-tree.d.ts +688 -0
- package/types/forty-cdk.d.ts +1 -19743
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, Signal, Provider } from '@angular/core';
|
|
3
|
+
import { FormValueControl } from '@angular/forms/signals';
|
|
4
|
+
import { WritingDirection, ListNavigationAction, FormUiControlBase } from 'forty-cdk/core';
|
|
5
|
+
import * as forty_cdk_radio_group from 'forty-cdk/radio-group';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Lightweight handle each `ForRadio` registers with the group on init so the
|
|
9
|
+
* group can react to changes in any radio's `disabled` (the `firstEnabledHost`
|
|
10
|
+
* computation depends on every registered handle's disabled signal).
|
|
11
|
+
*/
|
|
12
|
+
interface ForRadioHandle {
|
|
13
|
+
readonly host: HTMLElement;
|
|
14
|
+
readonly value: Signal<string>;
|
|
15
|
+
readonly disabled: Signal<boolean>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Coordination contract owned by `ForRadioGroup`. Each `ForRadio` reads its
|
|
19
|
+
* checked / disabled / tabindex state from this and routes click + keyboard
|
|
20
|
+
* activation through `select` / `navigate`.
|
|
21
|
+
*/
|
|
22
|
+
interface ForRadioGroupContext {
|
|
23
|
+
readonly value: Signal<string>;
|
|
24
|
+
/**
|
|
25
|
+
* The group's effective disabled — its own `disabled` input OR'd with a
|
|
26
|
+
* surrounding disabled `[forFieldset]`. Each `ForRadio` ORs this into its own
|
|
27
|
+
* `effectiveDisabled`, so a disabled group (or fieldset) disables every radio.
|
|
28
|
+
*/
|
|
29
|
+
readonly effectiveDisabled: Signal<boolean>;
|
|
30
|
+
readonly readonly: Signal<boolean>;
|
|
31
|
+
readonly orientation: Signal<'horizontal' | 'vertical'>;
|
|
32
|
+
readonly dir: Signal<WritingDirection>;
|
|
33
|
+
/** True when some registered radio's value matches the group's current value. */
|
|
34
|
+
readonly hasSelectedRadio: Signal<boolean>;
|
|
35
|
+
isSelected(value: string): boolean;
|
|
36
|
+
/** Selects `value` if the group is interactive. */
|
|
37
|
+
select(value: string): void;
|
|
38
|
+
/** Moves focus + selection from `currentRadio` according to `action`. */
|
|
39
|
+
navigate(currentRadio: HTMLElement, action: ListNavigationAction): void;
|
|
40
|
+
/** True when `el` is the first enabled radio in registration order. */
|
|
41
|
+
isFirstEnabledRadio(el: HTMLElement): boolean;
|
|
42
|
+
registerRadio(handle: ForRadioHandle): void;
|
|
43
|
+
unregisterRadio(handle: ForRadioHandle): void;
|
|
44
|
+
}
|
|
45
|
+
declare const FOR_RADIO_GROUP_CONTEXT: InjectionToken<ForRadioGroupContext>;
|
|
46
|
+
|
|
47
|
+
/**
|
|
48
|
+
* Root of the Radio Group primitive. Owns the selected value, orientation,
|
|
49
|
+
* and disabled / readonly / form-state inputs. Provides the shared context
|
|
50
|
+
* to descendant `ForRadio` directives.
|
|
51
|
+
*
|
|
52
|
+
* Implements the [WAI-ARIA Radio Group pattern](https://www.w3.org/WAI/ARIA/apg/patterns/radio/)
|
|
53
|
+
* and `FormValueControl<string>` from `@angular/forms/signals`, so it
|
|
54
|
+
* auto-wires with `[formField]`.
|
|
55
|
+
*
|
|
56
|
+
* Selection-on-focus: arrow keys move focus AND change the value (APG
|
|
57
|
+
* standard behavior). Wrap-around at the ends. Disabled radios are skipped.
|
|
58
|
+
*
|
|
59
|
+
* Empty string is the canonical "nothing selected" value (matches HTML form
|
|
60
|
+
* semantics). Choose non-empty `value`s on each `ForRadio`.
|
|
61
|
+
*/
|
|
62
|
+
declare class ForRadioGroup extends FormUiControlBase implements FormValueControl<string>, ForRadioGroupContext {
|
|
63
|
+
#private;
|
|
64
|
+
/** Two-way bindable. Selected radio's value. Empty string = none selected. */
|
|
65
|
+
readonly value: _angular_core.ModelSignal<string>;
|
|
66
|
+
/** Layout direction for keyboard navigation. */
|
|
67
|
+
readonly orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
68
|
+
/**
|
|
69
|
+
* Reading direction for horizontal orientation. When unset (default
|
|
70
|
+
* `null`), the inherited ambient direction is resolved from the nearest
|
|
71
|
+
* ancestor carrying a `dir` attribute (or `<html dir>`), defaulting to
|
|
72
|
+
* `'ltr'`. An explicit `[dir]` always wins. The resolved value is reflected
|
|
73
|
+
* to the host `dir` attribute and swaps ArrowLeft / ArrowRight in RTL.
|
|
74
|
+
*/
|
|
75
|
+
readonly _dirInput: _angular_core.InputSignal<WritingDirection | null>;
|
|
76
|
+
readonly dir: _angular_core.Signal<WritingDirection>;
|
|
77
|
+
/**
|
|
78
|
+
* Whether arrow navigation wraps around past the first / last enabled
|
|
79
|
+
* radio. Default `true` — matches the WAI-ARIA Radio Group APG. Set to
|
|
80
|
+
* `false` for a non-wrapping group. The default is read from
|
|
81
|
+
* `provideForRadioGroupDefaults` for the surrounding scope.
|
|
82
|
+
*/
|
|
83
|
+
readonly loop: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
84
|
+
/** True when some registered radio's value matches the group's current value. */
|
|
85
|
+
readonly hasSelectedRadio: _angular_core.Signal<boolean>;
|
|
86
|
+
constructor();
|
|
87
|
+
/**
|
|
88
|
+
* Move focus to a radio, implementing `FormUiControl.focus` from
|
|
89
|
+
* `@angular/forms/signals`. Without this override Signal Forms would focus
|
|
90
|
+
* the host `role="radiogroup"` wrapper — which is not focusable and carries
|
|
91
|
+
* no keyboard map — so focus-on-error would silently go nowhere. Targets the
|
|
92
|
+
* selected radio's host when one matches, else the first enabled radio host;
|
|
93
|
+
* no-op when the group is disabled or has no enabled radio.
|
|
94
|
+
*/
|
|
95
|
+
focus(options?: FocusOptions): void;
|
|
96
|
+
isSelected(v: string): boolean;
|
|
97
|
+
select(v: string): void;
|
|
98
|
+
navigate(currentRadio: HTMLElement, action: ListNavigationAction): void;
|
|
99
|
+
isFirstEnabledRadio(el: HTMLElement): boolean;
|
|
100
|
+
registerRadio(handle: ForRadioHandle): void;
|
|
101
|
+
unregisterRadio(handle: ForRadioHandle): void;
|
|
102
|
+
protected onFocusOut(event: FocusEvent): void;
|
|
103
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForRadioGroup, never>;
|
|
104
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForRadioGroup, "[forRadioGroup]", ["forRadioGroup"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "orientation": { "alias": "orientation"; "required": false; "isSignal": true; }; "_dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; "loop": { "alias": "loop"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Injection key the `[forRadioIndicator]` uses to resolve its parent radio,
|
|
109
|
+
* decoupled from the concrete `ForRadio` class. `ForRadio` provides itself
|
|
110
|
+
* under this token, so a design system wrapping the radio by subclassing
|
|
111
|
+
* re-points it at the subclass with a single provider
|
|
112
|
+
* (`{ provide: FOR_RADIO, useExisting: MtxRadio }`) and the indicator keeps
|
|
113
|
+
* resolving — see `docs/wrapping-form-primitives.md`.
|
|
114
|
+
*/
|
|
115
|
+
declare const FOR_RADIO: InjectionToken<ForRadio>;
|
|
116
|
+
/**
|
|
117
|
+
* One radio inside a `ForRadioGroup`. Apply on a `<button type="button">`.
|
|
118
|
+
*
|
|
119
|
+
* The directive reflects ARIA + roving tabindex for the WAI-ARIA Radio
|
|
120
|
+
* pattern: only the selected radio (or the first enabled one when nothing
|
|
121
|
+
* is selected) gets `tabindex=0`.
|
|
122
|
+
*/
|
|
123
|
+
declare class ForRadio {
|
|
124
|
+
#private;
|
|
125
|
+
/** Parent group's context — public so siblings like `ForRadioIndicator` can read it. */
|
|
126
|
+
readonly group: forty_cdk_radio_group.ForRadioGroupContext;
|
|
127
|
+
/** Unique identifier for this radio's value. Required. */
|
|
128
|
+
readonly value: _angular_core.InputSignal<string>;
|
|
129
|
+
/** When true, this radio is disabled (independent of the group's disabled). */
|
|
130
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
131
|
+
readonly id: _angular_core.Signal<string>;
|
|
132
|
+
readonly checked: _angular_core.Signal<boolean>;
|
|
133
|
+
readonly effectiveDisabled: _angular_core.Signal<boolean>;
|
|
134
|
+
constructor();
|
|
135
|
+
/**
|
|
136
|
+
* Tabindex per APG: 0 if this radio is selected; if no registered radio
|
|
137
|
+
* matches the group's value (none selected, or a stale value matching no
|
|
138
|
+
* radio), 0 if this is the first enabled radio in DOM order; -1 otherwise.
|
|
139
|
+
*
|
|
140
|
+
* Disabled radios are always -1.
|
|
141
|
+
*/
|
|
142
|
+
readonly tabindex: _angular_core.Signal<0 | -1>;
|
|
143
|
+
protected onClick(): void;
|
|
144
|
+
protected onKeyDown(event: KeyboardEvent): void;
|
|
145
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForRadio, never>;
|
|
146
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForRadio, "[forRadio]", ["forRadio"], { "value": { "alias": "value"; "required": true; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
/**
|
|
150
|
+
* Optional indicator slot inside a `ForRadio`. Apply on the element the
|
|
151
|
+
* consumer wants to show only while this radio is selected (typically a
|
|
152
|
+
* filled dot inside the radio circle). The directive mirrors `data-state`
|
|
153
|
+
* from the parent radio; hide the unchecked state via
|
|
154
|
+
* `[data-state="unchecked"] { display: none }` or `@if`.
|
|
155
|
+
*
|
|
156
|
+
* Purely a styling convenience.
|
|
157
|
+
*/
|
|
158
|
+
declare class ForRadioIndicator {
|
|
159
|
+
protected readonly parent: ForRadio;
|
|
160
|
+
constructor();
|
|
161
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForRadioIndicator, never>;
|
|
162
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForRadioIndicator, "[forRadioIndicator]", ["forRadioIndicator"], {}, {}, never, never, true, never>;
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/**
|
|
166
|
+
* Defaults inherited by descendant radio groups in the surrounding injector
|
|
167
|
+
* scope. Configure with `provideForRadioGroupDefaults` either at the
|
|
168
|
+
* application root or in any component's `providers` array; partial
|
|
169
|
+
* overrides merge with the parent scope.
|
|
170
|
+
*/
|
|
171
|
+
interface ForRadioGroupDefaults {
|
|
172
|
+
/**
|
|
173
|
+
* Whether arrow navigation wraps around past the first / last enabled
|
|
174
|
+
* radio. Matches the WAI-ARIA Radio Group APG default.
|
|
175
|
+
*/
|
|
176
|
+
loop: boolean;
|
|
177
|
+
}
|
|
178
|
+
/** Token holding the resolved radio-group defaults for the current scope. */
|
|
179
|
+
declare const FOR_RADIO_GROUP_DEFAULTS: _angular_core.InjectionToken<ForRadioGroupDefaults>;
|
|
180
|
+
/**
|
|
181
|
+
* Configures forty-cdk radio-group defaults for this injector scope. Partial
|
|
182
|
+
* overrides inherit unspecified keys from the parent scope (or library
|
|
183
|
+
* defaults at the root).
|
|
184
|
+
*/
|
|
185
|
+
declare function provideForRadioGroupDefaults(defaults?: Partial<ForRadioGroupDefaults>): Provider[];
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Exact public names of every `ForRadioGroup` input, its models included. Spread it into the
|
|
189
|
+
* `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the
|
|
190
|
+
* primitive's full surface — the Signal Forms members `[formField]` binds among them —
|
|
191
|
+
* without hand-maintaining the list. Always spread into an inline object literal as shown
|
|
192
|
+
* below: the literal is what keeps the entry statically analyzable for consumers compiling
|
|
193
|
+
* against the published package. An anti-drift spec fails when this list no longer matches
|
|
194
|
+
* the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported
|
|
195
|
+
* wrapping patterns.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* ```ts
|
|
199
|
+
* @Component({
|
|
200
|
+
* selector: 'div[myRadioGroup]',
|
|
201
|
+
* template: '',
|
|
202
|
+
* hostDirectives: [
|
|
203
|
+
* {
|
|
204
|
+
* directive: ForRadioGroup,
|
|
205
|
+
* inputs: [...FOR_RADIO_GROUP_HOST_DIRECTIVE_INPUTS],
|
|
206
|
+
* outputs: [...FOR_RADIO_GROUP_HOST_DIRECTIVE_OUTPUTS],
|
|
207
|
+
* },
|
|
208
|
+
* ],
|
|
209
|
+
* })
|
|
210
|
+
* export class MyRadioGroup {}
|
|
211
|
+
* ```
|
|
212
|
+
*/
|
|
213
|
+
declare const FOR_RADIO_GROUP_HOST_DIRECTIVE_INPUTS: readonly ["value", "dir", "dirty", "disabled", "errors", "invalid", "loop", "name", "orientation", "pending", "readonly", "required", "touched"];
|
|
214
|
+
/**
|
|
215
|
+
* Exact public names of every `ForRadioGroup` output, the Signal Forms `touch` output
|
|
216
|
+
* included. Spread it into the `outputs` array of the same `hostDirectives` entry as
|
|
217
|
+
* {@link FOR_RADIO_GROUP_HOST_DIRECTIVE_INPUTS}.
|
|
218
|
+
*/
|
|
219
|
+
declare const FOR_RADIO_GROUP_HOST_DIRECTIVE_OUTPUTS: readonly ["valueChange", "touchedChange", "touch"];
|
|
220
|
+
|
|
221
|
+
export { FOR_RADIO, FOR_RADIO_GROUP_CONTEXT, FOR_RADIO_GROUP_DEFAULTS, FOR_RADIO_GROUP_HOST_DIRECTIVE_INPUTS, FOR_RADIO_GROUP_HOST_DIRECTIVE_OUTPUTS, ForRadio, ForRadioGroup, ForRadioIndicator, provideForRadioGroupDefaults };
|
|
222
|
+
export type { ForRadioGroupContext, ForRadioGroupDefaults };
|
|
@@ -0,0 +1,258 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, Signal, Provider } from '@angular/core';
|
|
3
|
+
import * as forty_cdk_core from 'forty-cdk/core';
|
|
4
|
+
import { WritingDirection } from 'forty-cdk/core';
|
|
5
|
+
import * as forty_cdk_scroll_area from 'forty-cdk/scroll-area';
|
|
6
|
+
|
|
7
|
+
type ForScrollAreaType = 'auto' | 'always' | 'scroll' | 'hover';
|
|
8
|
+
type ForScrollbarOrientation = 'horizontal' | 'vertical';
|
|
9
|
+
interface ForScrollAreaContext {
|
|
10
|
+
readonly type: Signal<ForScrollAreaType>;
|
|
11
|
+
readonly scrollHideDelay: Signal<number>;
|
|
12
|
+
readonly dir: Signal<WritingDirection>;
|
|
13
|
+
/** The scrolling element (registered by `ForScrollAreaViewport`). */
|
|
14
|
+
readonly viewport: Signal<HTMLElement | null>;
|
|
15
|
+
/** The content element (registered by `ForScrollAreaContent`, observed by the viewport). */
|
|
16
|
+
readonly content: Signal<HTMLElement | null>;
|
|
17
|
+
/** Live scroll offset of the viewport. */
|
|
18
|
+
readonly scrollLeft: Signal<number>;
|
|
19
|
+
readonly scrollTop: Signal<number>;
|
|
20
|
+
/** Live size measurements of the viewport. */
|
|
21
|
+
readonly clientWidth: Signal<number>;
|
|
22
|
+
readonly clientHeight: Signal<number>;
|
|
23
|
+
readonly scrollWidth: Signal<number>;
|
|
24
|
+
readonly scrollHeight: Signal<number>;
|
|
25
|
+
/** True while the user is hovering anywhere on the root (for `type="hover"`). */
|
|
26
|
+
readonly hovering: Signal<boolean>;
|
|
27
|
+
/** True for a short window after the most recent scroll (for `type="scroll"`). */
|
|
28
|
+
readonly scrolling: Signal<boolean>;
|
|
29
|
+
registerViewport(el: HTMLElement | null): void;
|
|
30
|
+
registerContent(el: HTMLElement): void;
|
|
31
|
+
unregisterContent(el: HTMLElement): void;
|
|
32
|
+
reportScroll(left: number, top: number): void;
|
|
33
|
+
reportSize(clientW: number, clientH: number, scrollW: number, scrollH: number): void;
|
|
34
|
+
noteUserScroll(): void;
|
|
35
|
+
}
|
|
36
|
+
declare const FOR_SCROLL_AREA_CONTEXT: InjectionToken<ForScrollAreaContext>;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Root of the custom-scrollbar primitive. Owns the viewport reference,
|
|
40
|
+
* scroll geometry signals, and visibility state for the synthetic
|
|
41
|
+
* scrollbars.
|
|
42
|
+
*
|
|
43
|
+
* Native scrollbars on the inner viewport are hidden via styles injected
|
|
44
|
+
* by `[forScrollAreaViewport]` (the only place in forty-cdk that
|
|
45
|
+
* imperatively touches CSS); the consumer styles `[forScrollAreaThumb]`
|
|
46
|
+
* however they like.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```html
|
|
50
|
+
* <div forScrollArea>
|
|
51
|
+
* <div forScrollAreaViewport>
|
|
52
|
+
* <div forScrollAreaContent>… long content …</div>
|
|
53
|
+
* </div>
|
|
54
|
+
* <div forScrollAreaScrollbar orientation="vertical">
|
|
55
|
+
* <div forScrollAreaThumb></div>
|
|
56
|
+
* </div>
|
|
57
|
+
* <div forScrollAreaScrollbar orientation="horizontal">
|
|
58
|
+
* <div forScrollAreaThumb></div>
|
|
59
|
+
* </div>
|
|
60
|
+
* <div forScrollAreaCorner></div>
|
|
61
|
+
* </div>
|
|
62
|
+
* ```
|
|
63
|
+
*/
|
|
64
|
+
declare class ForScrollArea implements ForScrollAreaContext {
|
|
65
|
+
#private;
|
|
66
|
+
/**
|
|
67
|
+
* When the synthetic scrollbars are visible:
|
|
68
|
+
* - `auto`: shown whenever the axis overflows, regardless of interaction;
|
|
69
|
+
* self-hides when the content fits.
|
|
70
|
+
* - `always`: the scrollbar (and corner) stay mounted and
|
|
71
|
+
* `data-state="visible"` regardless of overflow — a stable, always-painted
|
|
72
|
+
* track. When the axis does not overflow the thumb fills
|
|
73
|
+
* the full track and dragging is a no-op. The library is headless and does
|
|
74
|
+
* not own layout, so to actually *reserve* the gutter (no content shift
|
|
75
|
+
* when crossing the overflow boundary) the consumer lays the scrollbar out
|
|
76
|
+
* in flow — see the ScrollArea README's grid example.
|
|
77
|
+
* - `scroll`: shown during scroll, faded after `scrollHideDelay` ms.
|
|
78
|
+
* - `hover`: shown while the cursor is over the area (and during scroll).
|
|
79
|
+
*/
|
|
80
|
+
readonly type: _angular_core.InputSignal<ForScrollAreaType>;
|
|
81
|
+
/**
|
|
82
|
+
* ms after the most recent scroll before scrollbars fade (only
|
|
83
|
+
* `type="scroll"` and `"hover"`). The default is read from
|
|
84
|
+
* `provideForScrollAreaDefaults` for the surrounding scope.
|
|
85
|
+
*/
|
|
86
|
+
readonly scrollHideDelay: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
87
|
+
/**
|
|
88
|
+
* Writing direction. When unset (default `null`), the inherited ambient
|
|
89
|
+
* direction is resolved from the nearest ancestor carrying a `dir` attribute
|
|
90
|
+
* (or `<html dir>`), defaulting to `'ltr'`. An explicit `[dir]` always wins.
|
|
91
|
+
* The resolved value is reflected to the host `dir` attribute and positions
|
|
92
|
+
* the vertical scrollbar on the left in RTL.
|
|
93
|
+
*/
|
|
94
|
+
readonly _dirInput: _angular_core.InputSignal<WritingDirection | null>;
|
|
95
|
+
readonly dir: _angular_core.Signal<WritingDirection>;
|
|
96
|
+
readonly viewport: _angular_core.Signal<HTMLElement | null>;
|
|
97
|
+
readonly content: _angular_core.Signal<HTMLElement | null>;
|
|
98
|
+
readonly scrollLeft: _angular_core.Signal<number>;
|
|
99
|
+
readonly scrollTop: _angular_core.Signal<number>;
|
|
100
|
+
readonly clientWidth: _angular_core.Signal<number>;
|
|
101
|
+
readonly clientHeight: _angular_core.Signal<number>;
|
|
102
|
+
readonly scrollWidth: _angular_core.Signal<number>;
|
|
103
|
+
readonly scrollHeight: _angular_core.Signal<number>;
|
|
104
|
+
readonly hovering: _angular_core.Signal<boolean>;
|
|
105
|
+
readonly scrolling: _angular_core.Signal<boolean>;
|
|
106
|
+
registerViewport(el: HTMLElement | null): void;
|
|
107
|
+
registerContent(el: HTMLElement): void;
|
|
108
|
+
unregisterContent(el: HTMLElement): void;
|
|
109
|
+
reportScroll(left: number, top: number): void;
|
|
110
|
+
reportSize(clientW: number, clientH: number, scrollW: number, scrollH: number): void;
|
|
111
|
+
noteUserScroll(): void;
|
|
112
|
+
protected onPointerEnter(): void;
|
|
113
|
+
protected onPointerLeave(): void;
|
|
114
|
+
constructor();
|
|
115
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForScrollArea, never>;
|
|
116
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForScrollArea, "[forScrollArea]", ["forScrollArea"], { "type": { "alias": "type"; "required": false; "isSignal": true; }; "scrollHideDelay": { "alias": "scrollHideDelay"; "required": false; "isSignal": true; }; "_dirInput": { "alias": "dir"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* The actually-scrolling element. Hides native scrollbars (the only place
|
|
121
|
+
* in forty-cdk that ships CSS — see README), tracks scroll position, and
|
|
122
|
+
* reports geometry to the root so the synthetic scrollbar can render.
|
|
123
|
+
*/
|
|
124
|
+
declare class ForScrollAreaViewport {
|
|
125
|
+
#private;
|
|
126
|
+
constructor();
|
|
127
|
+
protected onScroll(): void;
|
|
128
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForScrollAreaViewport, never>;
|
|
129
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForScrollAreaViewport, "[forScrollAreaViewport]", ["forScrollAreaViewport"], {}, {}, never, never, true, never>;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
/**
|
|
133
|
+
* Marks the content element inside `[forScrollAreaViewport]`. The viewport
|
|
134
|
+
* observes this element with a `ResizeObserver` so `scrollWidth` /
|
|
135
|
+
* `scrollHeight` updates when content reflows.
|
|
136
|
+
*
|
|
137
|
+
* Required for the synthetic scrollbar to react to content resizes — without
|
|
138
|
+
* it, the viewport falls back to no observation and scrollbars stay sized to
|
|
139
|
+
* whatever the layout reported on first render.
|
|
140
|
+
*/
|
|
141
|
+
declare class ForScrollAreaContent {
|
|
142
|
+
#private;
|
|
143
|
+
constructor();
|
|
144
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForScrollAreaContent, never>;
|
|
145
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForScrollAreaContent, "[forScrollAreaContent]", ["forScrollAreaContent"], {}, {}, never, never, true, never>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Synthetic scrollbar track. Reflects `data-orientation`, `data-state`
|
|
150
|
+
* (`visible` / `hidden`), and exposes its host element via the orientation
|
|
151
|
+
* input so the thumb can compute geometry.
|
|
152
|
+
*
|
|
153
|
+
* The element is fully removed (`hidden`) when the corresponding axis has
|
|
154
|
+
* no overflow *and* `type` is not `'always'` — there is no scrollbar to
|
|
155
|
+
* render. Under `type="always"` the track stays painted regardless of
|
|
156
|
+
* overflow, so the consumer's reserved gutter is never empty.
|
|
157
|
+
* Visibility is enforced with an inline `display: none` (which beats any
|
|
158
|
+
* author `display` rule a consumer applies via a class) in addition to the
|
|
159
|
+
* `hidden` attribute that removes it from the a11y tree.
|
|
160
|
+
*/
|
|
161
|
+
declare class ForScrollAreaScrollbar {
|
|
162
|
+
#private;
|
|
163
|
+
readonly orientation: _angular_core.InputSignal<ForScrollbarOrientation>;
|
|
164
|
+
readonly ctx: forty_cdk_scroll_area.ForScrollAreaContext;
|
|
165
|
+
readonly host: HTMLElement;
|
|
166
|
+
readonly size: _angular_core.Signal<forty_cdk_core.ElementBox | null>;
|
|
167
|
+
/** True while the thumb is being dragged. Pins the track visible / painted. */
|
|
168
|
+
readonly dragging: _angular_core.Signal<boolean>;
|
|
169
|
+
/**
|
|
170
|
+
* Marks the track as actively dragged so an in-flight drag is never aborted
|
|
171
|
+
* by the scrollbar self-hiding (`type="hover"` / `"scroll"` fading the track,
|
|
172
|
+
* or a consumer `display:none` on `data-state="hidden"`). Called by the thumb
|
|
173
|
+
* on pointer-down / drag-end.
|
|
174
|
+
*/
|
|
175
|
+
setDragging(dragging: boolean): void;
|
|
176
|
+
readonly hasOverflow: _angular_core.Signal<boolean>;
|
|
177
|
+
/**
|
|
178
|
+
* Whether the track is rendered at all. `'always'` keeps it painted
|
|
179
|
+
* unconditionally (a stable, always-present track); every
|
|
180
|
+
* other `type` paints only the axis that actually overflows. An in-flight
|
|
181
|
+
* thumb drag also pins it painted so the gesture is never aborted by the
|
|
182
|
+
* track self-removing. Gates both the `hidden` attribute and the inline
|
|
183
|
+
* `display: none` self-removal.
|
|
184
|
+
*/
|
|
185
|
+
readonly painted: _angular_core.Signal<boolean>;
|
|
186
|
+
/**
|
|
187
|
+
* `'visible' | 'hidden'`. An in-flight thumb drag forces `'visible'` so a
|
|
188
|
+
* consumer fade on `data-state="hidden"` can't hide the track mid-gesture.
|
|
189
|
+
* Otherwise: `'always'` resolves to `'visible'` regardless of overflow — the
|
|
190
|
+
* track is permanently present. `'auto'` shows whenever the axis overflows;
|
|
191
|
+
* `'hover'` / `'scroll'` additionally gate on the interaction signals. A
|
|
192
|
+
* non-overflowing axis is `'hidden'` for every mode except `'always'`.
|
|
193
|
+
*/
|
|
194
|
+
readonly state: _angular_core.Signal<"visible" | "hidden">;
|
|
195
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForScrollAreaScrollbar, never>;
|
|
196
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForScrollAreaScrollbar, "[forScrollAreaScrollbar]", ["forScrollAreaScrollbar"], { "orientation": { "alias": "orientation"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* The draggable thumb inside a `[forScrollAreaScrollbar]`. Sizes itself
|
|
201
|
+
* proportionally to viewport / content and translates along the track
|
|
202
|
+
* based on `scrollLeft` / `scrollTop`. Pointer-drag scrolls the viewport
|
|
203
|
+
* proportionally.
|
|
204
|
+
*/
|
|
205
|
+
declare class ForScrollAreaThumb {
|
|
206
|
+
#private;
|
|
207
|
+
readonly scrollbar: ForScrollAreaScrollbar;
|
|
208
|
+
constructor();
|
|
209
|
+
protected widthPx(): number | null;
|
|
210
|
+
protected heightPx(): number | null;
|
|
211
|
+
protected leftPx(): number | null;
|
|
212
|
+
protected topPx(): number | null;
|
|
213
|
+
protected transformValue(): string;
|
|
214
|
+
protected onPointerDown(event: PointerEvent): void;
|
|
215
|
+
protected onLostPointerCapture(): void;
|
|
216
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForScrollAreaThumb, never>;
|
|
217
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForScrollAreaThumb, "[forScrollAreaThumb]", ["forScrollAreaThumb"], {}, {}, never, never, true, never>;
|
|
218
|
+
}
|
|
219
|
+
|
|
220
|
+
/**
|
|
221
|
+
* Filler in the corner where horizontal and vertical scrollbars meet.
|
|
222
|
+
* Shown when both axes overflow, or unconditionally under `type="always"`
|
|
223
|
+
* (both tracks are permanently present then). Visibility is enforced with an
|
|
224
|
+
* inline `display: none` (which beats any author `display` rule a consumer
|
|
225
|
+
* applies via a class) in addition to the `hidden` attribute that removes it
|
|
226
|
+
* from the a11y tree.
|
|
227
|
+
*/
|
|
228
|
+
declare class ForScrollAreaCorner {
|
|
229
|
+
protected readonly ctx: forty_cdk_scroll_area.ForScrollAreaContext;
|
|
230
|
+
protected readonly visible: _angular_core.Signal<boolean>;
|
|
231
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForScrollAreaCorner, never>;
|
|
232
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForScrollAreaCorner, "[forScrollAreaCorner]", ["forScrollAreaCorner"], {}, {}, never, never, true, never>;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Defaults inherited by descendant scroll areas in the surrounding injector
|
|
237
|
+
* scope. Configure with `provideForScrollAreaDefaults` either at the
|
|
238
|
+
* application root or in any component's `providers` array; partial
|
|
239
|
+
* overrides merge with the parent scope.
|
|
240
|
+
*/
|
|
241
|
+
interface ForScrollAreaDefaults {
|
|
242
|
+
/**
|
|
243
|
+
* Milliseconds after the most recent scroll before the synthetic
|
|
244
|
+
* scrollbars fade. Applies when `type` is `'scroll'` or `'hover'`.
|
|
245
|
+
*/
|
|
246
|
+
scrollHideDelay: number;
|
|
247
|
+
}
|
|
248
|
+
/** Token holding the resolved scroll-area defaults for the current scope. */
|
|
249
|
+
declare const FOR_SCROLL_AREA_DEFAULTS: _angular_core.InjectionToken<ForScrollAreaDefaults>;
|
|
250
|
+
/**
|
|
251
|
+
* Configures forty-cdk scroll-area defaults for this injector scope. Partial
|
|
252
|
+
* overrides inherit unspecified keys from the parent scope (or library
|
|
253
|
+
* defaults at the root).
|
|
254
|
+
*/
|
|
255
|
+
declare function provideForScrollAreaDefaults(defaults?: Partial<ForScrollAreaDefaults>): Provider[];
|
|
256
|
+
|
|
257
|
+
export { FOR_SCROLL_AREA_CONTEXT, FOR_SCROLL_AREA_DEFAULTS, ForScrollArea, ForScrollAreaContent, ForScrollAreaCorner, ForScrollAreaScrollbar, ForScrollAreaThumb, ForScrollAreaViewport, provideForScrollAreaDefaults };
|
|
258
|
+
export type { ForScrollAreaContext, ForScrollAreaDefaults, ForScrollAreaType, ForScrollbarOrientation };
|
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
import { FormValueControl } from '@angular/forms/signals';
|
|
2
|
+
import { TextValueControlBase } from 'forty-cdk/core';
|
|
3
|
+
import * as i0 from '@angular/core';
|
|
4
|
+
import { Provider } from '@angular/core';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Headless `role="searchbox"` text input implementing Angular's
|
|
8
|
+
* `FormValueControl<string>` from `@angular/forms/signals`, so it auto-wires
|
|
9
|
+
* with `[formField]` and auto-associates inside a `[forField]` (label /
|
|
10
|
+
* description / error) with no extra markup. Reuses the exact form-value
|
|
11
|
+
* wiring of `[forInput]` — same IME handling, same value mirror, same
|
|
12
|
+
* validation reflection.
|
|
13
|
+
*
|
|
14
|
+
* Apply on a native `<input>`. The element keeps its own `type`, caret, IME
|
|
15
|
+
* composition, and native form submission — the directive only bridges the
|
|
16
|
+
* value to a signal, reflects validation state, and emits `role="searchbox"`.
|
|
17
|
+
*
|
|
18
|
+
* Pair with `[forSearchClear]` (passing the exported instance) for an inline
|
|
19
|
+
* clear-button affordance that hides itself while the value is empty.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```html
|
|
23
|
+
* <input forSearch #s="forSearch" [(value)]="q" />
|
|
24
|
+
* <button [forSearchClear]="s">×</button>
|
|
25
|
+
*
|
|
26
|
+
* <!-- With Signal Forms + Field (auto-wired): -->
|
|
27
|
+
* <div forField>
|
|
28
|
+
* <label forLabel>Search</label>
|
|
29
|
+
* <input forSearch [formField]="search.query" />
|
|
30
|
+
* </div>
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
declare class ForSearch extends TextValueControlBase implements FormValueControl<string> {
|
|
34
|
+
#private;
|
|
35
|
+
/**
|
|
36
|
+
* Resets the value to `''`. Typically called by `[forSearchClear]` when the
|
|
37
|
+
* user activates the clear button, but can also be called programmatically.
|
|
38
|
+
*/
|
|
39
|
+
clear(): void;
|
|
40
|
+
/**
|
|
41
|
+
* Moves focus to the native input element. Called by `[forSearchClear]`
|
|
42
|
+
* after clearing so the user can continue typing without chasing the caret.
|
|
43
|
+
*/
|
|
44
|
+
focusInput(): void;
|
|
45
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ForSearch, never>;
|
|
46
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ForSearch, "input[forSearch]", ["forSearch"], {}, {}, never, never, true, never>;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* Optional clear button for `[forSearch]`. Apply on a `<button>` element and
|
|
51
|
+
* pass the exported search instance through the selector input:
|
|
52
|
+
* `[forSearchClear]="s"` where `#s="forSearch"` is on the `<input>`.
|
|
53
|
+
*
|
|
54
|
+
* The button self-hides while the value is `''`, so consumers can leave it
|
|
55
|
+
* inline in the template without an extra `@if`. Visibility is enforced with
|
|
56
|
+
* an inline `display: none` (which beats any author `display` rule applied via
|
|
57
|
+
* a class) in addition to the `hidden` attribute that removes the element from
|
|
58
|
+
* the accessibility tree. This mirrors `[forComboboxClear]`'s approach.
|
|
59
|
+
*
|
|
60
|
+
* On activation (click) the button clears the value to `''` and refocuses the
|
|
61
|
+
* input so the user can continue typing without chasing the caret.
|
|
62
|
+
*
|
|
63
|
+
* The `aria-label="Clear"` default is set as a static host attribute. Consumers
|
|
64
|
+
* who want a different label can override it with their own `aria-label` on the
|
|
65
|
+
* same element — the consumer's attribute wins per Angular's host-binding
|
|
66
|
+
* precedence rules.
|
|
67
|
+
*
|
|
68
|
+
* The button stays in the natural tab order (no `tabindex="-1"`) unlike
|
|
69
|
+
* `[forComboboxClear]`, which lives inside an `aria-activedescendant` flow.
|
|
70
|
+
*/
|
|
71
|
+
declare class ForSearchClear {
|
|
72
|
+
/**
|
|
73
|
+
* The `[forSearch]` instance to operate on. Pass the exported reference:
|
|
74
|
+
* `<input forSearch #s="forSearch" /> <button [forSearchClear]="s">`.
|
|
75
|
+
*/
|
|
76
|
+
readonly search: i0.InputSignal<ForSearch>;
|
|
77
|
+
/** `true` while there is text to clear; drives the self-hide logic. */
|
|
78
|
+
protected readonly hasContent: i0.Signal<boolean>;
|
|
79
|
+
/**
|
|
80
|
+
* Disabled when the search field is disabled or read-only — the clear action
|
|
81
|
+
* is unavailable in those states.
|
|
82
|
+
*/
|
|
83
|
+
protected readonly isDisabled: i0.Signal<boolean>;
|
|
84
|
+
constructor();
|
|
85
|
+
protected onClick(): void;
|
|
86
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<ForSearchClear, never>;
|
|
87
|
+
static ɵdir: i0.ɵɵDirectiveDeclaration<ForSearchClear, "[forSearchClear]", ["forSearchClear"], { "search": { "alias": "forSearchClear"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* Defaults inherited by descendant `[forSearch]` controls in the surrounding
|
|
92
|
+
* injector scope. Configure with `provideForSearchDefaults`. The shape is a
|
|
93
|
+
* stub today — present so future per-scope tuning can land without churning
|
|
94
|
+
* the public surface.
|
|
95
|
+
*/
|
|
96
|
+
interface ForSearchDefaults {
|
|
97
|
+
}
|
|
98
|
+
/** Token holding the resolved search-field defaults for the current scope. */
|
|
99
|
+
declare const FOR_SEARCH_DEFAULTS: i0.InjectionToken<ForSearchDefaults>;
|
|
100
|
+
/**
|
|
101
|
+
* Configures forty-cdk search-field defaults for this injector scope. Partial
|
|
102
|
+
* overrides inherit unspecified keys from the parent scope (or library
|
|
103
|
+
* defaults at the root).
|
|
104
|
+
*/
|
|
105
|
+
declare function provideForSearchDefaults(defaults?: Partial<ForSearchDefaults>): Provider[];
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Exact public names of every `ForSearch` input, its models included. Spread it into the
|
|
109
|
+
* `inputs` array of a `hostDirectives` entry so a wrapper component re-exposes the
|
|
110
|
+
* primitive's full surface — the Signal Forms members `[formField]` binds among them —
|
|
111
|
+
* without hand-maintaining the list. Always spread into an inline object literal as shown
|
|
112
|
+
* below: the literal is what keeps the entry statically analyzable for consumers compiling
|
|
113
|
+
* against the published package. An anti-drift spec fails when this list no longer matches
|
|
114
|
+
* the directive's actual API. See `docs/wrapping-form-primitives.md` for both supported
|
|
115
|
+
* wrapping patterns.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* @Component({
|
|
120
|
+
* selector: 'input[mySearch]',
|
|
121
|
+
* template: '',
|
|
122
|
+
* hostDirectives: [
|
|
123
|
+
* {
|
|
124
|
+
* directive: ForSearch,
|
|
125
|
+
* inputs: [...FOR_SEARCH_HOST_DIRECTIVE_INPUTS],
|
|
126
|
+
* outputs: [...FOR_SEARCH_HOST_DIRECTIVE_OUTPUTS],
|
|
127
|
+
* },
|
|
128
|
+
* ],
|
|
129
|
+
* })
|
|
130
|
+
* export class MySearch {}
|
|
131
|
+
* ```
|
|
132
|
+
*/
|
|
133
|
+
declare const FOR_SEARCH_HOST_DIRECTIVE_INPUTS: readonly ["value", "dirty", "disabled", "errors", "invalid", "name", "pending", "readonly", "required", "touched"];
|
|
134
|
+
/**
|
|
135
|
+
* Exact public names of every `ForSearch` output, the Signal Forms `touch` output
|
|
136
|
+
* included. Spread it into the `outputs` array of the same `hostDirectives` entry as
|
|
137
|
+
* {@link FOR_SEARCH_HOST_DIRECTIVE_INPUTS}.
|
|
138
|
+
*/
|
|
139
|
+
declare const FOR_SEARCH_HOST_DIRECTIVE_OUTPUTS: readonly ["valueChange", "touchedChange", "touch"];
|
|
140
|
+
|
|
141
|
+
export { FOR_SEARCH_DEFAULTS, FOR_SEARCH_HOST_DIRECTIVE_INPUTS, FOR_SEARCH_HOST_DIRECTIVE_OUTPUTS, ForSearch, ForSearchClear, provideForSearchDefaults };
|
|
142
|
+
export type { ForSearchDefaults };
|