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,509 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, ModelSignal, Signal, Provider } from '@angular/core';
|
|
3
|
+
import { AnchoredPositioningContext, VetoableNativeEvent, FloatingSide, FloatingAlign, VetoableEvent } from 'forty-cdk/core';
|
|
4
|
+
import * as forty_cdk_popover from 'forty-cdk/popover';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Coordination contract owned by `ForPopover`. Trigger / Content register
|
|
8
|
+
* their elements (for floating-ui positioning, dismissable-layer exemptions,
|
|
9
|
+
* and focus return). Title / Description register their generated ids so
|
|
10
|
+
* the content wires `aria-labelledby` / `aria-describedby` reactively.
|
|
11
|
+
*
|
|
12
|
+
* The popover's "openness" lives on the root directive (`open` model) and
|
|
13
|
+
* is published here so descendant pieces can react without each subscribing
|
|
14
|
+
* to the directive instance directly.
|
|
15
|
+
*/
|
|
16
|
+
interface ForPopoverContext extends AnchoredPositioningContext {
|
|
17
|
+
readonly open: ModelSignal<boolean>;
|
|
18
|
+
readonly disabled: Signal<boolean>;
|
|
19
|
+
readonly dismissible: Signal<boolean>;
|
|
20
|
+
readonly returnFocus: Signal<boolean>;
|
|
21
|
+
readonly initialFocus: Signal<'first' | 'container'>;
|
|
22
|
+
readonly triggerId: Signal<string>;
|
|
23
|
+
readonly contentId: Signal<string>;
|
|
24
|
+
readonly ariaLabel: Signal<string | null>;
|
|
25
|
+
/** Whether `prefers-reduced-motion: reduce` is active — reflected as `data-reduced-motion`. */
|
|
26
|
+
readonly reducedMotion: Signal<boolean>;
|
|
27
|
+
readonly labelledBy: Signal<string | null>;
|
|
28
|
+
readonly describedBy: Signal<string | null>;
|
|
29
|
+
readonly trigger: Signal<HTMLElement | null>;
|
|
30
|
+
readonly anchor: Signal<HTMLElement | null>;
|
|
31
|
+
/**
|
|
32
|
+
* Element used as the floating-ui reference. When `[forPopoverAnchor]`
|
|
33
|
+
* is registered, this is the anchor; otherwise it falls back to the
|
|
34
|
+
* trigger. Decoupled from `trigger` so the trigger can keep driving
|
|
35
|
+
* `aria-controls`, click toggle, and focus return regardless of where
|
|
36
|
+
* the popover paints.
|
|
37
|
+
*/
|
|
38
|
+
readonly reference: Signal<HTMLElement | null>;
|
|
39
|
+
registerTrigger(el: HTMLElement): void;
|
|
40
|
+
unregisterTrigger(el: HTMLElement): void;
|
|
41
|
+
/** Adopts a consumer-set static `id` on the content host into `contentId`. */
|
|
42
|
+
adoptContentId(el: HTMLElement): void;
|
|
43
|
+
registerAnchor(el: HTMLElement): void;
|
|
44
|
+
unregisterAnchor(el: HTMLElement): void;
|
|
45
|
+
registerArrow(el: HTMLElement): void;
|
|
46
|
+
unregisterArrow(el: HTMLElement): void;
|
|
47
|
+
registerLabel(id: string): void;
|
|
48
|
+
unregisterLabel(id: string): void;
|
|
49
|
+
registerDescription(id: string): void;
|
|
50
|
+
unregisterDescription(id: string): void;
|
|
51
|
+
/** Toggle from a trigger click. Honours `disabled`. */
|
|
52
|
+
toggle(): void;
|
|
53
|
+
/**
|
|
54
|
+
* Escape is consumer-owned (its close differs per primitive); Content
|
|
55
|
+
* forwards the raw `KeyboardEvent` so the root emits `(escapeKeyDown)` and
|
|
56
|
+
* runs its own close decision.
|
|
57
|
+
*/
|
|
58
|
+
emitEscapeKeyDown(event: KeyboardEvent): void;
|
|
59
|
+
/**
|
|
60
|
+
* Outside-interaction emit forwarders. `injectOverlayShell` builds and
|
|
61
|
+
* reuses one `VetoableNativeEvent` across the specific and composite
|
|
62
|
+
* channels, then hands it to these forwarders to fire the matching output
|
|
63
|
+
* and calls `requestClose` when un-vetoed.
|
|
64
|
+
*/
|
|
65
|
+
emitPointerDownOutside(veto: VetoableNativeEvent<PointerEvent>): void;
|
|
66
|
+
emitFocusOutside(veto: VetoableNativeEvent<FocusEvent>): void;
|
|
67
|
+
emitInteractOutside(veto: VetoableNativeEvent<PointerEvent | FocusEvent>): void;
|
|
68
|
+
/** Implicit close requested by the shell after an un-vetoed outside interaction. */
|
|
69
|
+
requestClose(): void;
|
|
70
|
+
/**
|
|
71
|
+
* Hooks into the auto-focus pipeline. Content fires these just before
|
|
72
|
+
* its imperative `.focus()` (open) or the trigger return-focus (close);
|
|
73
|
+
* `event.preventDefault()` skips the move. Returns `true` when the
|
|
74
|
+
* consumer vetoed.
|
|
75
|
+
*/
|
|
76
|
+
emitAutoFocusOnOpen(): boolean;
|
|
77
|
+
emitAutoFocusOnClose(): boolean;
|
|
78
|
+
}
|
|
79
|
+
declare const FOR_POPOVER_CONTEXT: InjectionToken<ForPopoverContext>;
|
|
80
|
+
|
|
81
|
+
/**
|
|
82
|
+
* Headless implementation of the [WAI-ARIA Modeless Dialog pattern](https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/),
|
|
83
|
+
* positioned against an internal trigger via `@floating-ui/dom`.
|
|
84
|
+
*
|
|
85
|
+
* Apply `[forPopover]` on a wrapper (the trigger and the content's `@if`
|
|
86
|
+
* live inside it). The directive owns open state, ids, and the registries
|
|
87
|
+
* that wire trigger / content / title / description / arrow together.
|
|
88
|
+
*
|
|
89
|
+
* Mount/unmount of the visible content is the consumer's responsibility —
|
|
90
|
+
* wrap `[forPopoverContent]` with `@if (open())` and let `animate.enter` /
|
|
91
|
+
* `animate.leave` handle transitions:
|
|
92
|
+
*
|
|
93
|
+
* ```html
|
|
94
|
+
* <div forPopover [(open)]="isOpen">
|
|
95
|
+
* <button forPopoverTrigger>Open</button>
|
|
96
|
+
* @if (isOpen()) {
|
|
97
|
+
* <div forPopoverContent animate.leave="fade-out">…</div>
|
|
98
|
+
* }
|
|
99
|
+
* </div>
|
|
100
|
+
* ```
|
|
101
|
+
*
|
|
102
|
+
* Non-modal: focus is sent into the popover on open and returned to the
|
|
103
|
+
* trigger on close, but Tab is allowed to leave the surface (use Dialog
|
|
104
|
+
* if you need a focus trap).
|
|
105
|
+
*/
|
|
106
|
+
declare class ForPopover implements ForPopoverContext {
|
|
107
|
+
#private;
|
|
108
|
+
/**
|
|
109
|
+
* Two-way bindable. Whether the popover is currently shown. The `model()`
|
|
110
|
+
* change emitter (`(openChange)`) fires only on internal transitions
|
|
111
|
+
* (trigger click, Escape, outside dismissal), never on consumer writes
|
|
112
|
+
* via `[(open)]` — observe state changes without binding back.
|
|
113
|
+
*/
|
|
114
|
+
readonly open: _angular_core.ModelSignal<boolean>;
|
|
115
|
+
/**
|
|
116
|
+
* Per-popover override for the side the popover is anchored to. Pair with
|
|
117
|
+
* `align` for the full positioning API (`side="bottom" align="start"`).
|
|
118
|
+
* When `undefined` (default), falls back to `ForPopoverDefaults.side` from
|
|
119
|
+
* the surrounding `provideForPopoverDefaults` scope (`'bottom'` unless
|
|
120
|
+
* configured).
|
|
121
|
+
*
|
|
122
|
+
* The input is aliased to `side`; consumers bind `[side]="..."` and read
|
|
123
|
+
* the effective value via the public `side` computed below.
|
|
124
|
+
*/
|
|
125
|
+
readonly _sideInput: _angular_core.InputSignal<FloatingSide | undefined>;
|
|
126
|
+
/** Effective anchor side: the `side` input when set, else the scope default. */
|
|
127
|
+
readonly side: _angular_core.Signal<FloatingSide>;
|
|
128
|
+
/**
|
|
129
|
+
* Per-popover override for the alignment along the chosen `side`. When
|
|
130
|
+
* `undefined` (default), falls back to `ForPopoverDefaults.align` from the
|
|
131
|
+
* surrounding `provideForPopoverDefaults` scope (`'center'` unless
|
|
132
|
+
* configured).
|
|
133
|
+
*
|
|
134
|
+
* The input is aliased to `align`; consumers bind `[align]="..."` and read
|
|
135
|
+
* the effective value via the public `align` computed below.
|
|
136
|
+
*/
|
|
137
|
+
readonly _alignInput: _angular_core.InputSignal<FloatingAlign | undefined>;
|
|
138
|
+
/** Effective alignment: the `align` input when set, else the scope default. */
|
|
139
|
+
readonly align: _angular_core.Signal<FloatingAlign>;
|
|
140
|
+
/**
|
|
141
|
+
* Per-popover override for the gap (px) between trigger and content along
|
|
142
|
+
* the *main* axis (perpendicular to `side`). Forwarded to floating-ui's
|
|
143
|
+
* `offset` middleware. When `undefined`
|
|
144
|
+
* (default), falls back to `ForPopoverDefaults.sideOffset` from the
|
|
145
|
+
* surrounding `provideForPopoverDefaults` scope (`8` unless configured).
|
|
146
|
+
*
|
|
147
|
+
* The input is aliased to `sideOffset`; consumers bind `[sideOffset]="..."`
|
|
148
|
+
* and read the effective value via the public `sideOffset` computed below.
|
|
149
|
+
*/
|
|
150
|
+
readonly _sideOffsetInput: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
151
|
+
/** Effective main-axis gap (px): the `sideOffset` input when set, else the scope default. */
|
|
152
|
+
readonly sideOffset: _angular_core.Signal<number>;
|
|
153
|
+
/** Gap (px) along the cross axis (parallel to `side`). Default `0`. */
|
|
154
|
+
readonly alignOffset: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
155
|
+
/**
|
|
156
|
+
* When `true` (default), `flip` and `shift` keep the popover inside the
|
|
157
|
+
* viewport. Disable for strict positioning where overflow is acceptable.
|
|
158
|
+
*/
|
|
159
|
+
readonly avoidCollisions: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
160
|
+
/**
|
|
161
|
+
* Per-popover override for the padding (px) applied uniformly to the
|
|
162
|
+
* `flip`, `shift`, and `size` middlewares. When `undefined` (default),
|
|
163
|
+
* falls back to
|
|
164
|
+
* `ForPopoverDefaults.collisionPadding` from the surrounding
|
|
165
|
+
* `provideForPopoverDefaults` scope (`8` unless configured).
|
|
166
|
+
*
|
|
167
|
+
* The input is aliased to `collisionPadding`; consumers bind
|
|
168
|
+
* `[collisionPadding]="..."` and read the effective value via the public
|
|
169
|
+
* `collisionPadding` computed below.
|
|
170
|
+
*/
|
|
171
|
+
readonly _collisionPaddingInput: _angular_core.InputSignalWithTransform<number | undefined, unknown>;
|
|
172
|
+
/** Effective collision padding (px): the `collisionPadding` input when set, else the scope default. */
|
|
173
|
+
readonly collisionPadding: _angular_core.Signal<number>;
|
|
174
|
+
/**
|
|
175
|
+
* Padding (px) for the `arrow` middleware so the arrow stays inside any
|
|
176
|
+
* rounded corners on the popover content. Default `0`.
|
|
177
|
+
*/
|
|
178
|
+
readonly arrowPadding: _angular_core.InputSignalWithTransform<number, unknown>;
|
|
179
|
+
/**
|
|
180
|
+
* Stickiness behaviour for `shift`. `'partial'` (default) lets the
|
|
181
|
+
* popover shift to stay visible. `'always'` disables `shift` so the
|
|
182
|
+
* popover keeps its requested placement even off-screen. `false`
|
|
183
|
+
* is treated as `'partial'`.
|
|
184
|
+
*/
|
|
185
|
+
readonly sticky: _angular_core.InputSignal<false | "partial" | "always">;
|
|
186
|
+
/**
|
|
187
|
+
* When `true`, sets `data-detached=""` on the content while the trigger
|
|
188
|
+
* has scrolled off all clipping ancestors. Use to fade out popovers
|
|
189
|
+
* tied to scrolled-away triggers.
|
|
190
|
+
*/
|
|
191
|
+
readonly hideWhenDetached: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
192
|
+
/**
|
|
193
|
+
* When `true` (default), the content is clipped until floating-ui resolves
|
|
194
|
+
* its first position, preventing a flash at the viewport corner. Set to
|
|
195
|
+
* `false` so a dramatic `animate.enter` plays from its first frame (the
|
|
196
|
+
* surface may flash briefly at the unresolved position while positioning
|
|
197
|
+
* computes).
|
|
198
|
+
*/
|
|
199
|
+
readonly clipUntilPositioned: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
200
|
+
/**
|
|
201
|
+
* When true, trigger interaction is ignored and any open popover stays
|
|
202
|
+
* open until the consumer flips `open` themselves. Disable on the trigger
|
|
203
|
+
* side; the content side keeps its dismissable behavior unaffected.
|
|
204
|
+
*/
|
|
205
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
206
|
+
/**
|
|
207
|
+
* When true (default), Escape, pointer-down outside, and focus outside
|
|
208
|
+
* close the popover. Disable for confirm flows that must be answered
|
|
209
|
+
* via `[forPopoverClose]` (or by setting `open` programmatically).
|
|
210
|
+
*/
|
|
211
|
+
readonly dismissible: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
212
|
+
/** When true (default), focus returns to the trigger on close. */
|
|
213
|
+
readonly returnFocus: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
214
|
+
/**
|
|
215
|
+
* Where to send focus when content mounts. `'first'` (default) finds
|
|
216
|
+
* the first focusable descendant; `'container'` focuses the content
|
|
217
|
+
* box itself (useful when there's nothing focusable inside).
|
|
218
|
+
*/
|
|
219
|
+
readonly initialFocus: _angular_core.InputSignal<"first" | "container">;
|
|
220
|
+
/** Manual `aria-label` on the content. Use this when no visible title element exists. */
|
|
221
|
+
readonly ariaLabel: _angular_core.InputSignal<string | null>;
|
|
222
|
+
/**
|
|
223
|
+
* Whether the user has requested reduced motion via the OS
|
|
224
|
+
* `prefers-reduced-motion: reduce` media query. Reflected as the boolean
|
|
225
|
+
* `data-reduced-motion` attribute on the root and content so consumers can
|
|
226
|
+
* disable their own `animate.enter` / `animate.leave` and CSS transitions
|
|
227
|
+
* without re-deriving the media query. The popover toggles open / closed
|
|
228
|
+
* synchronously on trigger click, so it has no JS-coordinated timing to skip.
|
|
229
|
+
*/
|
|
230
|
+
readonly reducedMotion: _angular_core.Signal<boolean>;
|
|
231
|
+
/**
|
|
232
|
+
* Fires when the user presses Escape while this popover is the topmost
|
|
233
|
+
* dismissable layer. Call `preventDefault()` on the emitted veto to
|
|
234
|
+
* suppress the automatic close. The native `KeyboardEvent` is
|
|
235
|
+
* available on `.event`.
|
|
236
|
+
*/
|
|
237
|
+
readonly escapeKeyDown: _angular_core.OutputEmitterRef<VetoableNativeEvent<KeyboardEvent>>;
|
|
238
|
+
/**
|
|
239
|
+
* Fires when a pointer goes down outside the popover (and outside the
|
|
240
|
+
* trigger). Call `preventDefault()` on the veto to suppress the
|
|
241
|
+
* automatic close. The native `PointerEvent` is on `.event`.
|
|
242
|
+
*/
|
|
243
|
+
readonly pointerDownOutside: _angular_core.OutputEmitterRef<VetoableNativeEvent<PointerEvent>>;
|
|
244
|
+
/**
|
|
245
|
+
* Fires when focus moves outside the popover and trigger. Call
|
|
246
|
+
* `preventDefault()` on the veto to suppress the automatic close.
|
|
247
|
+
*/
|
|
248
|
+
readonly focusOutside: _angular_core.OutputEmitterRef<VetoableNativeEvent<FocusEvent>>;
|
|
249
|
+
/**
|
|
250
|
+
* Composite event: fires alongside `pointerDownOutside` and
|
|
251
|
+
* `focusOutside` and shares their veto state — `preventDefault()` on
|
|
252
|
+
* either one suppresses the automatic close.
|
|
253
|
+
*/
|
|
254
|
+
readonly interactOutside: _angular_core.OutputEmitterRef<VetoableNativeEvent<PointerEvent | FocusEvent>>;
|
|
255
|
+
/**
|
|
256
|
+
* Fires just before the popover sends focus into itself on mount.
|
|
257
|
+
* Call `preventDefault()` on the veto to skip the imperative focus
|
|
258
|
+
* move — useful when opening a popover from an input you want to
|
|
259
|
+
* keep focused.
|
|
260
|
+
*/
|
|
261
|
+
readonly autoFocusOnOpen: _angular_core.OutputEmitterRef<VetoableEvent>;
|
|
262
|
+
/**
|
|
263
|
+
* Fires just before focus returns to the trigger on unmount. Call
|
|
264
|
+
* `preventDefault()` on the veto to suppress the return-focus.
|
|
265
|
+
*/
|
|
266
|
+
readonly autoFocusOnClose: _angular_core.OutputEmitterRef<VetoableEvent>;
|
|
267
|
+
readonly triggerId: _angular_core.WritableSignal<string>;
|
|
268
|
+
readonly contentId: _angular_core.WritableSignal<string>;
|
|
269
|
+
readonly trigger: _angular_core.Signal<HTMLElement | null>;
|
|
270
|
+
readonly anchor: _angular_core.Signal<HTMLElement | null>;
|
|
271
|
+
/**
|
|
272
|
+
* The element floating-ui anchors against. Prefers `[forPopoverAnchor]`
|
|
273
|
+
* when registered, otherwise falls back to the trigger so existing
|
|
274
|
+
* popovers without an anchor keep their behavior.
|
|
275
|
+
*/
|
|
276
|
+
readonly reference: _angular_core.Signal<HTMLElement | null>;
|
|
277
|
+
readonly arrow: _angular_core.Signal<HTMLElement | null>;
|
|
278
|
+
readonly labelledBy: _angular_core.Signal<string | null>;
|
|
279
|
+
readonly describedBy: _angular_core.Signal<string | null>;
|
|
280
|
+
registerTrigger(el: HTMLElement): void;
|
|
281
|
+
unregisterTrigger(el: HTMLElement): void;
|
|
282
|
+
/**
|
|
283
|
+
* Adopts a consumer-set static `id` on the `[forPopoverContent]` host into
|
|
284
|
+
* `contentId` (preserving anchors / external `aria-labelledby` references)
|
|
285
|
+
* instead of letting the `[id]` host binding clobber it.
|
|
286
|
+
*/
|
|
287
|
+
adoptContentId(el: HTMLElement): void;
|
|
288
|
+
registerAnchor(el: HTMLElement): void;
|
|
289
|
+
unregisterAnchor(el: HTMLElement): void;
|
|
290
|
+
registerArrow(el: HTMLElement): void;
|
|
291
|
+
unregisterArrow(el: HTMLElement): void;
|
|
292
|
+
registerLabel(id: string): void;
|
|
293
|
+
unregisterLabel(id: string): void;
|
|
294
|
+
registerDescription(id: string): void;
|
|
295
|
+
unregisterDescription(id: string): void;
|
|
296
|
+
toggle(): void;
|
|
297
|
+
emitEscapeKeyDown(event: KeyboardEvent): void;
|
|
298
|
+
/**
|
|
299
|
+
* Outside-interaction emit forwarders. The shared `#pendingOutsideVeto`
|
|
300
|
+
* reuse between the specific outside channels and the composite
|
|
301
|
+
* `interactOutside` lives in `injectOverlayShell`; these only fire the
|
|
302
|
+
* matching output with the veto the shell built.
|
|
303
|
+
*/
|
|
304
|
+
emitPointerDownOutside(veto: VetoableNativeEvent<PointerEvent>): void;
|
|
305
|
+
emitFocusOutside(veto: VetoableNativeEvent<FocusEvent>): void;
|
|
306
|
+
emitInteractOutside(veto: VetoableNativeEvent<PointerEvent | FocusEvent>): void;
|
|
307
|
+
/**
|
|
308
|
+
* Implicit close requested by the shell after an un-vetoed outside
|
|
309
|
+
* interaction. The directive only owns the close itself.
|
|
310
|
+
*/
|
|
311
|
+
requestClose(): void;
|
|
312
|
+
emitAutoFocusOnOpen(): boolean;
|
|
313
|
+
emitAutoFocusOnClose(): boolean;
|
|
314
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForPopover, never>;
|
|
315
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForPopover, "[forPopover]", ["forPopover"], { "open": { "alias": "open"; "required": false; "isSignal": true; }; "_sideInput": { "alias": "side"; "required": false; "isSignal": true; }; "_alignInput": { "alias": "align"; "required": false; "isSignal": true; }; "_sideOffsetInput": { "alias": "sideOffset"; "required": false; "isSignal": true; }; "alignOffset": { "alias": "alignOffset"; "required": false; "isSignal": true; }; "avoidCollisions": { "alias": "avoidCollisions"; "required": false; "isSignal": true; }; "_collisionPaddingInput": { "alias": "collisionPadding"; "required": false; "isSignal": true; }; "arrowPadding": { "alias": "arrowPadding"; "required": false; "isSignal": true; }; "sticky": { "alias": "sticky"; "required": false; "isSignal": true; }; "hideWhenDetached": { "alias": "hideWhenDetached"; "required": false; "isSignal": true; }; "clipUntilPositioned": { "alias": "clipUntilPositioned"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "dismissible": { "alias": "dismissible"; "required": false; "isSignal": true; }; "returnFocus": { "alias": "returnFocus"; "required": false; "isSignal": true; }; "initialFocus": { "alias": "initialFocus"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; }, { "open": "openChange"; "escapeKeyDown": "escapeKeyDown"; "pointerDownOutside": "pointerDownOutside"; "focusOutside": "focusOutside"; "interactOutside": "interactOutside"; "autoFocusOnOpen": "autoFocusOnOpen"; "autoFocusOnClose": "autoFocusOnClose"; }, never, never, true, never>;
|
|
316
|
+
}
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Button that toggles the popover when clicked. Apply on a focusable
|
|
320
|
+
* element — preferably a `<button>` — so keyboard users can reach it.
|
|
321
|
+
*
|
|
322
|
+
* Wires `aria-expanded`, `aria-controls`, and `aria-haspopup="dialog"`,
|
|
323
|
+
* registers the host as the floating-ui anchor, and toggles the open
|
|
324
|
+
* state on click. The trigger is exempt from the dismissable layer's
|
|
325
|
+
* outside-pointer / outside-focus checks so its own click never
|
|
326
|
+
* spuriously closes the popover.
|
|
327
|
+
*
|
|
328
|
+
* Disabling: the trigger merges its own `disabled` input OR the root's
|
|
329
|
+
* `disabled` into `effectiveDisabled`, which drives the native `disabled`
|
|
330
|
+
* attribute, `aria-disabled`, `data-disabled`, and the click guard.
|
|
331
|
+
*
|
|
332
|
+
* The root is normally resolved via DI from the enclosing `[forPopover]`.
|
|
333
|
+
* When the trigger is declared inside an `ng-template` stamped into the root
|
|
334
|
+
* (e.g. via `ngTemplateOutlet`), DI resolves at the template's declaration
|
|
335
|
+
* site and misses the root — pass it explicitly through the selector input,
|
|
336
|
+
* `routerLink`-style: `[forPopoverTrigger]="root"` with `#root="forPopover"`.
|
|
337
|
+
*/
|
|
338
|
+
declare class ForPopoverTrigger {
|
|
339
|
+
#private;
|
|
340
|
+
/**
|
|
341
|
+
* Optional explicit reference to the `[forPopover]` root, named after the
|
|
342
|
+
* selector `routerLink`-style. The bare valueless attribute keeps resolving
|
|
343
|
+
* the enclosing root via DI; pass the root explicitly
|
|
344
|
+
* (`[forPopoverTrigger]="root"`, with `#root="forPopover"`) when the trigger
|
|
345
|
+
* is declared in an `ng-template` stamped inside the root — DI resolves at
|
|
346
|
+
* the template's declaration site, so the enclosing root is invisible there.
|
|
347
|
+
* The empty string (what the valueless attribute yields) is treated as unset.
|
|
348
|
+
*/
|
|
349
|
+
readonly forPopoverTrigger: _angular_core.InputSignal<"" | ForPopoverContext>;
|
|
350
|
+
protected readonly ctx: _angular_core.Signal<ForPopoverContext>;
|
|
351
|
+
/** Disables this trigger only, in addition to the root's `disabled`. */
|
|
352
|
+
readonly disabled: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
353
|
+
/** Whether the trigger is disabled — its own `disabled` input OR the root's. */
|
|
354
|
+
readonly effectiveDisabled: _angular_core.Signal<boolean>;
|
|
355
|
+
constructor();
|
|
356
|
+
protected onClick(): void;
|
|
357
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForPopoverTrigger, never>;
|
|
358
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForPopoverTrigger, "[forPopoverTrigger]", ["forPopoverTrigger"], { "forPopoverTrigger": { "alias": "forPopoverTrigger"; "required": false; "isSignal": true; }; "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* Optional positioning anchor. When present, the popover is positioned
|
|
363
|
+
* against this element instead of `[forPopoverTrigger]` — useful when
|
|
364
|
+
* "what opens it" and "where it appears" are different elements (a button
|
|
365
|
+
* opens the popover but it's anchored to a row, a text-selection range,
|
|
366
|
+
* a cursor follower, etc.).
|
|
367
|
+
*
|
|
368
|
+
* Only positioning changes: the trigger still owns `aria-controls`,
|
|
369
|
+
* `aria-expanded`, the click toggle, and focus return on close. If no
|
|
370
|
+
* anchor is registered the popover falls back to anchoring against the
|
|
371
|
+
* trigger, so existing usages are unaffected.
|
|
372
|
+
*
|
|
373
|
+
* ```html
|
|
374
|
+
* <div forPopover [(open)]="open">
|
|
375
|
+
* <button forPopoverTrigger>Help</button>
|
|
376
|
+
* <span [forPopoverAnchor]>Anchored phrase</span>
|
|
377
|
+
* @if (open()) {
|
|
378
|
+
* <div forPopoverContent>…</div>
|
|
379
|
+
* }
|
|
380
|
+
* </div>
|
|
381
|
+
* ```
|
|
382
|
+
*/
|
|
383
|
+
declare class ForPopoverAnchor {
|
|
384
|
+
#private;
|
|
385
|
+
constructor();
|
|
386
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForPopoverAnchor, never>;
|
|
387
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForPopoverAnchor, "[forPopoverAnchor]", ["forPopoverAnchor"], {}, {}, never, never, true, never>;
|
|
388
|
+
}
|
|
389
|
+
|
|
390
|
+
/**
|
|
391
|
+
* The popover surface. Carries `role="dialog"` (non-modal — `aria-modal` is absent per APG), is
|
|
392
|
+
* portaled to `document.body`, and is positioned by `@floating-ui/dom`
|
|
393
|
+
* against the registered `[forPopoverTrigger]`.
|
|
394
|
+
*
|
|
395
|
+
* The directive does not manage DOM presence — wrap with
|
|
396
|
+
* `@if (popoverOpen())` so `animate.enter` / `animate.leave` fire on
|
|
397
|
+
* the natural mount / unmount cycle. While mounted the directive
|
|
398
|
+
* activates a `DismissableLayer` (Escape, pointer-down outside, focus
|
|
399
|
+
* outside) and sends focus to the configured `initialFocus` target;
|
|
400
|
+
* on unmount it returns focus to the trigger if `returnFocus` is on.
|
|
401
|
+
*
|
|
402
|
+
* The trigger is exempt from the layer's outside checks, so clicking
|
|
403
|
+
* it again just toggles via the trigger directive — no double-close
|
|
404
|
+
* race.
|
|
405
|
+
*
|
|
406
|
+
* The lifecycle (positioner + dismissable layer + initial focus + return
|
|
407
|
+
* focus) is owned by the shared `injectOverlayShell` helper. The shell's
|
|
408
|
+
* `'first'` mode routes through the same `findFirstFocusable` helper used
|
|
409
|
+
* by `FocusTrap`, dropping the local focusable-selector copy that this
|
|
410
|
+
* directive carried before (see #107).
|
|
411
|
+
*/
|
|
412
|
+
declare class ForPopoverContent {
|
|
413
|
+
protected readonly ctx: forty_cdk_popover.ForPopoverContext;
|
|
414
|
+
constructor();
|
|
415
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForPopoverContent, never>;
|
|
416
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForPopoverContent, "[forPopoverContent]", ["forPopoverContent"], {}, {}, never, never, true, never>;
|
|
417
|
+
}
|
|
418
|
+
|
|
419
|
+
/**
|
|
420
|
+
* Convenience: gives the host element a stable id and registers it as the
|
|
421
|
+
* popover's accessible name (`aria-labelledby`). Apply on a heading element
|
|
422
|
+
* (`<h2>`, `<h3>`...) inside `[forPopoverContent]`.
|
|
423
|
+
*
|
|
424
|
+
* If you don't render a visible title, omit this and pass `ariaLabel` on
|
|
425
|
+
* the popover root instead.
|
|
426
|
+
*/
|
|
427
|
+
declare class ForPopoverTitle {
|
|
428
|
+
protected readonly id: _angular_core.Signal<string>;
|
|
429
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForPopoverTitle, never>;
|
|
430
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForPopoverTitle, "[forPopoverTitle]", ["forPopoverTitle"], {}, {}, never, never, true, never>;
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
/**
|
|
434
|
+
* Convenience: gives the host element a stable id and registers it as the
|
|
435
|
+
* popover's accessible description (`aria-describedby`). Apply on a paragraph
|
|
436
|
+
* or similar text element inside `[forPopoverContent]`.
|
|
437
|
+
*/
|
|
438
|
+
declare class ForPopoverDescription {
|
|
439
|
+
protected readonly id: _angular_core.Signal<string>;
|
|
440
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForPopoverDescription, never>;
|
|
441
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForPopoverDescription, "[forPopoverDescription]", ["forPopoverDescription"], {}, {}, never, never, true, never>;
|
|
442
|
+
}
|
|
443
|
+
|
|
444
|
+
/**
|
|
445
|
+
* Button that closes the surrounding popover when clicked. Apply on a
|
|
446
|
+
* `<button>` inside `[forPopoverContent]`. Bypasses `dismissible` — an
|
|
447
|
+
* explicit close button is always honored.
|
|
448
|
+
*/
|
|
449
|
+
declare class ForPopoverClose {
|
|
450
|
+
#private;
|
|
451
|
+
protected onClick(): void;
|
|
452
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForPopoverClose, never>;
|
|
453
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForPopoverClose, "[forPopoverClose]", ["forPopoverClose"], {}, {}, never, never, true, never>;
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
/**
|
|
457
|
+
* Optional visual arrow inside `ForPopoverContent`. Registers itself with
|
|
458
|
+
* the popover context so floating-ui's `arrow` middleware can position it
|
|
459
|
+
* along the surface edge that points at the trigger. Style size and color
|
|
460
|
+
* yourself — the directive only sets `position`, `left`/`top`, and the
|
|
461
|
+
* opposite-side offset.
|
|
462
|
+
*/
|
|
463
|
+
declare class ForPopoverArrow {
|
|
464
|
+
#private;
|
|
465
|
+
constructor();
|
|
466
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForPopoverArrow, never>;
|
|
467
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForPopoverArrow, "[forPopoverArrow]", ["forPopoverArrow"], {}, {}, never, never, true, never>;
|
|
468
|
+
}
|
|
469
|
+
|
|
470
|
+
/**
|
|
471
|
+
* Defaults inherited by descendant popovers in the surrounding injector
|
|
472
|
+
* scope. Configure with `provideForPopoverDefaults` at the app root or in
|
|
473
|
+
* any component's `providers`; partial overrides merge with the parent scope.
|
|
474
|
+
*/
|
|
475
|
+
interface ForPopoverDefaults {
|
|
476
|
+
/**
|
|
477
|
+
* Side the popover is anchored to for popovers that don't override `side`
|
|
478
|
+
* locally. Library fallback `'bottom'`.
|
|
479
|
+
*/
|
|
480
|
+
side: FloatingSide;
|
|
481
|
+
/**
|
|
482
|
+
* Alignment along the chosen `side` for popovers that don't override
|
|
483
|
+
* `align` locally. Library fallback `'center'`.
|
|
484
|
+
*/
|
|
485
|
+
align: FloatingAlign;
|
|
486
|
+
/**
|
|
487
|
+
* Gap (px) between trigger and content along the main axis for popovers
|
|
488
|
+
* that don't override `sideOffset` locally.
|
|
489
|
+
* Library fallback `8`.
|
|
490
|
+
*/
|
|
491
|
+
sideOffset: number;
|
|
492
|
+
/**
|
|
493
|
+
* Padding (px) applied uniformly to the `flip`, `shift`, and `size`
|
|
494
|
+
* middlewares for popovers that don't override `collisionPadding` locally.
|
|
495
|
+
* Library fallback `8`.
|
|
496
|
+
*/
|
|
497
|
+
collisionPadding: number;
|
|
498
|
+
}
|
|
499
|
+
/** Token holding the resolved popover defaults for the current scope. */
|
|
500
|
+
declare const FOR_POPOVER_DEFAULTS: _angular_core.InjectionToken<ForPopoverDefaults>;
|
|
501
|
+
/**
|
|
502
|
+
* Configures forty-cdk popover defaults for this injector scope. Partial
|
|
503
|
+
* overrides inherit unspecified keys from the parent scope (or library
|
|
504
|
+
* defaults at the root).
|
|
505
|
+
*/
|
|
506
|
+
declare function provideForPopoverDefaults(defaults?: Partial<ForPopoverDefaults>): Provider[];
|
|
507
|
+
|
|
508
|
+
export { FOR_POPOVER_CONTEXT, FOR_POPOVER_DEFAULTS, ForPopover, ForPopoverAnchor, ForPopoverArrow, ForPopoverClose, ForPopoverContent, ForPopoverDescription, ForPopoverTitle, ForPopoverTrigger, provideForPopoverDefaults };
|
|
509
|
+
export type { ForPopoverContext, ForPopoverDefaults };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import * as _angular_core from '@angular/core';
|
|
2
|
+
import { InjectionToken, Signal, Provider } from '@angular/core';
|
|
3
|
+
import * as forty_cdk_progress from 'forty-cdk/progress';
|
|
4
|
+
|
|
5
|
+
/** State of a progress bar reflected on `data-state`. */
|
|
6
|
+
type ForProgressState = 'indeterminate' | 'loading' | 'complete';
|
|
7
|
+
/** Shape exposed to descendant pieces (the indicator). */
|
|
8
|
+
interface ForProgressContext {
|
|
9
|
+
/** Raw value as written by the consumer, or `null` when indeterminate. */
|
|
10
|
+
readonly value: Signal<number | null>;
|
|
11
|
+
/** Value clamped to `[0, max]`, or `null` when indeterminate. Use this for any visual / ARIA reflection. */
|
|
12
|
+
readonly clampedValue: Signal<number | null>;
|
|
13
|
+
/** Current max. */
|
|
14
|
+
readonly max: Signal<number>;
|
|
15
|
+
/** `null` when indeterminate; otherwise `0..100`. */
|
|
16
|
+
readonly percentage: Signal<number | null>;
|
|
17
|
+
/**
|
|
18
|
+
* {@link percentage} rounded to two decimals for the `data-percentage`
|
|
19
|
+
* reflection, or `null` when indeterminate. Owned by the root so the
|
|
20
|
+
* indicator mirrors it instead of re-implementing the rounding.
|
|
21
|
+
*/
|
|
22
|
+
readonly percentageAttr: Signal<number | null>;
|
|
23
|
+
/** Logical state, mirrored on `data-state`. */
|
|
24
|
+
readonly state: Signal<ForProgressState>;
|
|
25
|
+
}
|
|
26
|
+
declare const FOR_PROGRESS_CONTEXT: InjectionToken<ForProgressContext>;
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* Headless progress bar. Implements the
|
|
30
|
+
* [WAI-ARIA progressbar role](https://www.w3.org/TR/wai-aria-1.2/#progressbar)
|
|
31
|
+
* for tasks whose completion is communicated visually.
|
|
32
|
+
*
|
|
33
|
+
* `value === null` puts the bar in **indeterminate** mode (no `aria-valuenow`).
|
|
34
|
+
* Use it for "loading…" states whose duration cannot be predicted. Otherwise
|
|
35
|
+
* pass a number in `[0, max]`; values outside the range are clamped before
|
|
36
|
+
* being reflected.
|
|
37
|
+
*
|
|
38
|
+
* The directive only handles state and ARIA. The visual fill is up to the
|
|
39
|
+
* consumer — see `ForProgressIndicator`.
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```html
|
|
43
|
+
* <div forProgress [value]="uploaded()" [max]="total()">
|
|
44
|
+
* <div forProgressIndicator></div>
|
|
45
|
+
* </div>
|
|
46
|
+
*
|
|
47
|
+
* <div forProgress [value]="null"> <!-- indeterminate -->
|
|
48
|
+
* <div forProgressIndicator></div>
|
|
49
|
+
* </div>
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
declare class ForProgress implements ForProgressContext {
|
|
53
|
+
#private;
|
|
54
|
+
/**
|
|
55
|
+
* Two-way bindable. Current progress in `[0, max]`, or `null` for the
|
|
56
|
+
* indeterminate state. Values outside the range are clamped for ARIA but
|
|
57
|
+
* the model retains what the consumer wrote.
|
|
58
|
+
*/
|
|
59
|
+
readonly value: _angular_core.ModelSignal<number | null>;
|
|
60
|
+
/** Maximum value. Defaults to `100` (so a raw value reads as a percentage). */
|
|
61
|
+
readonly max: _angular_core.InputSignal<number>;
|
|
62
|
+
/**
|
|
63
|
+
* `max` clamped to a strictly positive value. `progressbar` requires
|
|
64
|
+
* `aria-valuemax` to exceed `aria-valuemin` (which is fixed at `0` here), so a
|
|
65
|
+
* non-positive `max` would reflect invalid ARIA. Mirrors the way `ForMeter`
|
|
66
|
+
* keeps `max >= min`; here the floor is `1` so the reflected range is always
|
|
67
|
+
* valid and the percentage math has a non-zero denominator.
|
|
68
|
+
*/
|
|
69
|
+
readonly effectiveMax: _angular_core.Signal<number>;
|
|
70
|
+
/**
|
|
71
|
+
* Optional override for `aria-valuetext`. Useful for non-percentage
|
|
72
|
+
* progress (e.g. `"Step 3 of 5"`, `"42 MB of 200 MB"`). Receives the
|
|
73
|
+
* clamped value and current max.
|
|
74
|
+
*/
|
|
75
|
+
readonly getValueLabel: _angular_core.InputSignal<((value: number, max: number) => string) | null>;
|
|
76
|
+
/**
|
|
77
|
+
* When true, transitions to `value === max` are announced once via the
|
|
78
|
+
* live announcer using the current `aria-valuetext` (or `"Complete"` if
|
|
79
|
+
* none). Repeated transitions to the same complete state do not re-fire.
|
|
80
|
+
* The default is read from `provideForProgressDefaults` for the
|
|
81
|
+
* surrounding scope.
|
|
82
|
+
*/
|
|
83
|
+
readonly announceCompletion: _angular_core.InputSignalWithTransform<boolean, unknown>;
|
|
84
|
+
readonly clampedValue: _angular_core.Signal<number | null>;
|
|
85
|
+
readonly percentage: _angular_core.Signal<number | null>;
|
|
86
|
+
readonly state: _angular_core.Signal<ForProgressState>;
|
|
87
|
+
readonly ariaValueText: _angular_core.Signal<string | null>;
|
|
88
|
+
readonly percentageAttr: _angular_core.Signal<number | null>;
|
|
89
|
+
constructor();
|
|
90
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForProgress, never>;
|
|
91
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForProgress, "[forProgress]", ["forProgress"], { "value": { "alias": "value"; "required": false; "isSignal": true; }; "max": { "alias": "max"; "required": false; "isSignal": true; }; "getValueLabel": { "alias": "getValueLabel"; "required": false; "isSignal": true; }; "announceCompletion": { "alias": "announceCompletion"; "required": false; "isSignal": true; }; }, { "value": "valueChange"; }, never, never, true, never>;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Visual fill paired with `[forProgress]`. Reflects `data-state` and
|
|
96
|
+
* `data-percentage` so the consumer can drive width / transform from CSS.
|
|
97
|
+
*
|
|
98
|
+
* The directive does NOT set any visual style itself. Typical usage:
|
|
99
|
+
*
|
|
100
|
+
* ```css
|
|
101
|
+
* [forProgressIndicator] {
|
|
102
|
+
* width: 100%;
|
|
103
|
+
* transform: translateX(calc(-100% + var(--for-progress-percentage, 0%)));
|
|
104
|
+
* }
|
|
105
|
+
* [forProgressIndicator][data-state="indeterminate"] {
|
|
106
|
+
* animation: stripes 1s infinite linear;
|
|
107
|
+
* }
|
|
108
|
+
* ```
|
|
109
|
+
*
|
|
110
|
+
* with the `--for-progress-percentage` custom property fed from `data-percentage`.
|
|
111
|
+
*/
|
|
112
|
+
declare class ForProgressIndicator {
|
|
113
|
+
protected readonly context: forty_cdk_progress.ForProgressContext;
|
|
114
|
+
protected percentageStyle(): string | null;
|
|
115
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<ForProgressIndicator, never>;
|
|
116
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<ForProgressIndicator, "[forProgressIndicator]", ["forProgressIndicator"], {}, {}, never, never, true, never>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
/**
|
|
120
|
+
* Defaults inherited by descendant progress bars in the surrounding injector
|
|
121
|
+
* scope. Configure with `provideForProgressDefaults` either at the
|
|
122
|
+
* application root or in any component's `providers` array; partial
|
|
123
|
+
* overrides merge with the parent scope.
|
|
124
|
+
*/
|
|
125
|
+
interface ForProgressDefaults {
|
|
126
|
+
/**
|
|
127
|
+
* Whether to announce `Complete` (or the label) once via `aria-live` on
|
|
128
|
+
* the loading→complete transition. Opt-in — useful on flows where the
|
|
129
|
+
* user explicitly waits for completion (uploads, submissions).
|
|
130
|
+
*/
|
|
131
|
+
announceCompletion: boolean;
|
|
132
|
+
}
|
|
133
|
+
/** Token holding the resolved progress defaults for the current scope. */
|
|
134
|
+
declare const FOR_PROGRESS_DEFAULTS: _angular_core.InjectionToken<ForProgressDefaults>;
|
|
135
|
+
/**
|
|
136
|
+
* Configures forty-cdk progress defaults for this injector scope. Partial
|
|
137
|
+
* overrides inherit unspecified keys from the parent scope (or library
|
|
138
|
+
* defaults at the root).
|
|
139
|
+
*/
|
|
140
|
+
declare function provideForProgressDefaults(defaults?: Partial<ForProgressDefaults>): Provider[];
|
|
141
|
+
|
|
142
|
+
export { FOR_PROGRESS_CONTEXT, FOR_PROGRESS_DEFAULTS, ForProgress, ForProgressIndicator, provideForProgressDefaults };
|
|
143
|
+
export type { ForProgressContext, ForProgressDefaults, ForProgressState };
|