@cngx/common 0.1.0-rc.7 → 0.1.0-rc.9
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/card/README.md +2 -1
- package/command/README.md +29 -0
- package/data/README.md +15 -3
- package/dialog/README.md +23 -1
- package/fesm2022/cngx-common-a11y.mjs +517 -184
- package/fesm2022/cngx-common-a11y.mjs.map +1 -1
- package/fesm2022/cngx-common-audio.mjs +62 -17
- package/fesm2022/cngx-common-audio.mjs.map +1 -1
- package/fesm2022/cngx-common-card.mjs +301 -46
- package/fesm2022/cngx-common-card.mjs.map +1 -1
- package/fesm2022/cngx-common-chart.mjs +1221 -479
- package/fesm2022/cngx-common-chart.mjs.map +1 -1
- package/fesm2022/cngx-common-command.mjs +97 -16
- package/fesm2022/cngx-common-command.mjs.map +1 -1
- package/fesm2022/cngx-common-data.mjs +1496 -499
- package/fesm2022/cngx-common-data.mjs.map +1 -1
- package/fesm2022/cngx-common-dialog.mjs +236 -61
- package/fesm2022/cngx-common-dialog.mjs.map +1 -1
- package/fesm2022/cngx-common-display.mjs +364 -93
- package/fesm2022/cngx-common-display.mjs.map +1 -1
- package/fesm2022/cngx-common-interactive.mjs +2040 -1046
- package/fesm2022/cngx-common-interactive.mjs.map +1 -1
- package/fesm2022/cngx-common-layout.mjs +955 -125
- package/fesm2022/cngx-common-layout.mjs.map +1 -1
- package/fesm2022/cngx-common-popover.mjs +1293 -89
- package/fesm2022/cngx-common-popover.mjs.map +1 -1
- package/fesm2022/cngx-common-stepper.mjs +997 -453
- package/fesm2022/cngx-common-stepper.mjs.map +1 -1
- package/fesm2022/cngx-common-tabs.mjs +1794 -1265
- package/fesm2022/cngx-common-tabs.mjs.map +1 -1
- package/fesm2022/cngx-common-timeline.mjs +151 -61
- package/fesm2022/cngx-common-timeline.mjs.map +1 -1
- package/fesm2022/cngx-common.mjs +1 -1
- package/interactive/README.md +15 -4
- package/layout/README.md +37 -1
- package/package.json +20 -7
- package/popover/README.md +58 -2
- package/schematics/collection.json +9 -0
- package/schematics/ng-add/index.js +9 -0
- package/schematics/ng-add/schema.json +91 -0
- package/schematics/package.json +3 -0
- package/stepper/README.md +11 -8
- package/theming/components/cngx-accordion.css +1 -1
- package/theming/components/cngx-backdrop.css +12 -0
- package/theming/components/cngx-button-toggle.css +29 -3
- package/theming/components/cngx-data-grid.css +168 -1
- package/theming/components/cngx-dialog.css +13 -0
- package/theming/components/cngx-listbox.css +21 -12
- package/theming/components/cngx-menu.css +56 -16
- package/theming/components/cngx-popover-sheet.css +402 -0
- package/theming/components/cngx-popover.css +28 -0
- package/theming/components/cngx-recycler-placeholder.css +196 -0
- package/theming/components/cngx-ripple.css +1 -1
- package/theming/components/cngx-slider.css +32 -1
- package/theming/components/cngx-tooltip.css +12 -0
- package/timeline/README.md +155 -0
- package/types/cngx-common-a11y.d.ts +205 -28
- package/types/cngx-common-card.d.ts +201 -17
- package/types/cngx-common-chart.d.ts +345 -48
- package/types/cngx-common-command.d.ts +50 -10
- package/types/cngx-common-data.d.ts +743 -92
- package/types/cngx-common-dialog.d.ts +161 -10
- package/types/cngx-common-display.d.ts +356 -142
- package/types/cngx-common-interactive.d.ts +910 -226
- package/types/cngx-common-layout.d.ts +603 -32
- package/types/cngx-common-popover.d.ts +612 -49
- package/types/cngx-common-stepper.d.ts +526 -237
- package/types/cngx-common-tabs.d.ts +358 -75
- package/types/cngx-common-timeline.d.ts +108 -22
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ElementRef, InjectionToken, Provider, TemplateRef } from '@angular/core';
|
|
2
|
+
import { ElementRef, Signal, InjectionToken, Provider, TemplateRef } from '@angular/core';
|
|
3
3
|
import * as i1 from '@cngx/common/a11y';
|
|
4
|
-
import {
|
|
4
|
+
import { CngxFocusTrapDriver, AriaLivePoliteness } from '@cngx/common/a11y';
|
|
5
|
+
import * as _cngx_core_utils from '@cngx/core/utils';
|
|
6
|
+
import { SlotRegistry, KeyedRegistry, CngxAsyncState, AsyncStatus } from '@cngx/core/utils';
|
|
5
7
|
import { AsyncAction, CngxPending, CngxSucceeded, CngxFailed } from '@cngx/common/interactive';
|
|
6
8
|
import * as i1$1 from '@cngx/common/display';
|
|
7
9
|
|
|
@@ -155,6 +157,7 @@ declare class CngxPopover {
|
|
|
155
157
|
private readonly floatingFallback;
|
|
156
158
|
private readonly _injector;
|
|
157
159
|
private readonly direction;
|
|
160
|
+
private pendingClose;
|
|
158
161
|
/**
|
|
159
162
|
* Arrow-bounds contract resolved lazily on first use.
|
|
160
163
|
* Eager inject() would loop: CngxPopover (host directive on the panel)
|
|
@@ -163,6 +166,22 @@ declare class CngxPopover {
|
|
|
163
166
|
*/
|
|
164
167
|
private _arrowBounds;
|
|
165
168
|
private getArrowBounds;
|
|
169
|
+
/**
|
|
170
|
+
* Presentation seam resolved lazily on first use, same reason as
|
|
171
|
+
* {@link getArrowBounds}: the modifier providing it constructs after this
|
|
172
|
+
* directive. `self: true` keeps a popover nested inside a sheet's host from
|
|
173
|
+
* picking up the outer sheet's seam.
|
|
174
|
+
*/
|
|
175
|
+
private _presentationSeam;
|
|
176
|
+
private presentationSeam;
|
|
177
|
+
/**
|
|
178
|
+
* `false` while a presentation modifier lays the panel out as a sheet or
|
|
179
|
+
* fullscreen. Gates every anchor, margin, fallback and floating write:
|
|
180
|
+
* inline styles beat author CSS, so the sheet stylesheet cannot win
|
|
181
|
+
* against them.
|
|
182
|
+
*/
|
|
183
|
+
private readonly anchored;
|
|
184
|
+
private hiding;
|
|
166
185
|
/** Anchor-relative placement. */
|
|
167
186
|
readonly placement: _angular_core.InputSignal<PopoverPlacement>;
|
|
168
187
|
/**
|
|
@@ -172,7 +191,11 @@ declare class CngxPopover {
|
|
|
172
191
|
* order. Spec-compatible vocabulary only (no cngx placement tokens).
|
|
173
192
|
*/
|
|
174
193
|
readonly positionTryFallbacks: _angular_core.InputSignal<readonly PopoverPositionTryFallback[]>;
|
|
175
|
-
/**
|
|
194
|
+
/**
|
|
195
|
+
* Gap between anchor and popover in px, on the placement's main axis
|
|
196
|
+
* (block axis for `top` / `bottom`, inline axis for `left` / `right`);
|
|
197
|
+
* the cross axis stays flush. Same on both positioning engines.
|
|
198
|
+
*/
|
|
176
199
|
readonly offset: _angular_core.InputSignal<number>;
|
|
177
200
|
/** Whether Escape key dismisses the popover. */
|
|
178
201
|
readonly closeOnEscape: _angular_core.InputSignal<boolean>;
|
|
@@ -203,7 +226,6 @@ declare class CngxPopover {
|
|
|
203
226
|
*/
|
|
204
227
|
readonly exclusive: _angular_core.InputSignal<boolean>;
|
|
205
228
|
/**
|
|
206
|
-
* @internal
|
|
207
229
|
* Programmatic override of {@link exclusive}. `null` (default) defers to the
|
|
208
230
|
* `[exclusive]` input; a boolean wins over it. Lets a composing organism
|
|
209
231
|
* (e.g. a submenu wiring in `@cngx/ui/context-menu`) open a nested panel
|
|
@@ -211,11 +233,15 @@ declare class CngxPopover {
|
|
|
211
233
|
* Controlled+uncontrolled derivation: {@link effectiveExclusive} resolves
|
|
212
234
|
* the override first, then the input.
|
|
213
235
|
*/
|
|
214
|
-
readonly
|
|
236
|
+
private readonly exclusiveOverrideState;
|
|
237
|
+
/**
|
|
238
|
+
* @internal Read-only view of the programmatic {@link exclusive} override.
|
|
239
|
+
* Written via {@link setExclusiveOverride}.
|
|
240
|
+
*/
|
|
241
|
+
readonly exclusiveOverride: _angular_core.Signal<boolean | null>;
|
|
215
242
|
/** Effective exclusivity - override wins, else the `[exclusive]` input. */
|
|
216
243
|
private readonly effectiveExclusive;
|
|
217
244
|
/**
|
|
218
|
-
* @internal
|
|
219
245
|
* Programmatic override of {@link placement}. `null` (default) defers to the
|
|
220
246
|
* `[placement]` input; a value wins over it. Lets a composing organism (the
|
|
221
247
|
* submenu wiring in `@cngx/ui/context-menu`) flank a nested panel to the
|
|
@@ -223,7 +249,12 @@ declare class CngxPopover {
|
|
|
223
249
|
* {@link exclusiveOverride}; {@link effectivePlacement} resolves the override
|
|
224
250
|
* first, then the input.
|
|
225
251
|
*/
|
|
226
|
-
readonly
|
|
252
|
+
private readonly placementOverrideState;
|
|
253
|
+
/**
|
|
254
|
+
* @internal Read-only view of the programmatic {@link placement} override.
|
|
255
|
+
* Written via {@link setPlacementOverride}.
|
|
256
|
+
*/
|
|
257
|
+
readonly placementOverride: _angular_core.Signal<PopoverPlacement | null>;
|
|
227
258
|
/**
|
|
228
259
|
* Effective placement for the CSS-anchor path - override wins, else the
|
|
229
260
|
* `[placement]` input, then fully mirrored against the ambient writing
|
|
@@ -244,12 +275,16 @@ declare class CngxPopover {
|
|
|
244
275
|
*/
|
|
245
276
|
private readonly floatingPlacement;
|
|
246
277
|
/**
|
|
247
|
-
* @internal
|
|
248
278
|
* Programmatic override of {@link positionTryFallbacks}, paired with
|
|
249
279
|
* {@link placementOverride} so a submenu wiring installs the flip chain too.
|
|
250
280
|
* `null` (default) defers to the `[positionTryFallbacks]` input.
|
|
251
281
|
*/
|
|
252
|
-
|
|
282
|
+
private readonly positionTryFallbacksOverrideState;
|
|
283
|
+
/**
|
|
284
|
+
* @internal Read-only view of the programmatic {@link positionTryFallbacks}
|
|
285
|
+
* override. Written via {@link setPositionTryFallbacksOverride}.
|
|
286
|
+
*/
|
|
287
|
+
readonly positionTryFallbacksOverride: _angular_core.Signal<readonly PopoverPositionTryFallback[] | null>;
|
|
253
288
|
/** Effective try-fallbacks - override wins, else the `[positionTryFallbacks]` input. */
|
|
254
289
|
private readonly effectivePositionTryFallbacks;
|
|
255
290
|
private readonly stateSignal;
|
|
@@ -258,14 +293,41 @@ declare class CngxPopover {
|
|
|
258
293
|
readonly state: _angular_core.Signal<PopoverState>;
|
|
259
294
|
/** Unique auto-generated ID for this popover instance. */
|
|
260
295
|
readonly id: _angular_core.Signal<string>;
|
|
296
|
+
/** Backing state for {@link focusOrigin}. */
|
|
297
|
+
private readonly focusOriginState;
|
|
298
|
+
/**
|
|
299
|
+
* The element that held focus when {@link show} was entered, captured
|
|
300
|
+
* synchronously BEFORE the native `showPopover()` call - content
|
|
301
|
+
* autofocus inside the panel therefore cannot displace it.
|
|
302
|
+
* `CngxPopoverTrigger`'s `restoreFocus` reads it as the restore
|
|
303
|
+
* target; cleared on finalize.
|
|
304
|
+
*/
|
|
305
|
+
readonly focusOrigin: _angular_core.Signal<HTMLElement | null>;
|
|
306
|
+
/**
|
|
307
|
+
* Implicit anchor slot, written by `CngxPopoverTrigger` and composing
|
|
308
|
+
* organisms via {@link setAnchorElement}.
|
|
309
|
+
*/
|
|
310
|
+
private readonly anchorElementState;
|
|
311
|
+
/** Explicit anchor slot, claimed by `CngxPopoverAnchor`. */
|
|
312
|
+
private readonly explicitAnchorElementSlot;
|
|
313
|
+
/**
|
|
314
|
+
* The element a `CngxPopoverAnchor` registered via
|
|
315
|
+
* {@link registerAnchorElement}, or `null`. While non-null it shadows
|
|
316
|
+
* the implicit anchor and `CngxPopoverTrigger` yields its
|
|
317
|
+
* `anchor-name`.
|
|
318
|
+
*/
|
|
319
|
+
readonly explicitAnchorElement: _angular_core.Signal<HTMLElement | null>;
|
|
261
320
|
/**
|
|
262
|
-
* The anchor element for Floating UI fallback positioning
|
|
263
|
-
*
|
|
321
|
+
* The anchor element for Floating UI fallback positioning, the
|
|
322
|
+
* arrow-offset geometry and the outside-click guard. Precedence: the
|
|
323
|
+
* explicit anchor ({@link registerAnchorElement}, `CngxPopoverAnchor`)
|
|
324
|
+
* wins over the implicit one ({@link setAnchorElement},
|
|
325
|
+
* `CngxPopoverTrigger` or a composing organism).
|
|
264
326
|
*/
|
|
265
|
-
readonly anchorElement: _angular_core.
|
|
327
|
+
readonly anchorElement: _angular_core.Signal<HTMLElement | null>;
|
|
266
328
|
/**
|
|
267
329
|
* Inline-axis position the arrow ornament should sit at, expressed as
|
|
268
|
-
* a CSS length pinned to the
|
|
330
|
+
* a CSS length pinned to the anchor's centre. Computed from
|
|
269
331
|
* `anchorElement()` + the panel's own bounding box on every show /
|
|
270
332
|
* reposition / window resize.
|
|
271
333
|
*
|
|
@@ -285,14 +347,16 @@ declare class CngxPopover {
|
|
|
285
347
|
* the same coordinate the default arrow ornament would.
|
|
286
348
|
*/
|
|
287
349
|
readonly arrowOffset: _angular_core.Signal<string | null>;
|
|
350
|
+
/** Backing state for {@link haspopup}. */
|
|
351
|
+
private readonly haspopupState;
|
|
288
352
|
/**
|
|
289
353
|
* Hint for the `CngxPopoverTrigger`'s `aria-haspopup` value. Composers
|
|
290
|
-
* such as `CngxPopoverPanel`
|
|
291
|
-
* at the popover defaults to the right role without
|
|
292
|
-
* having to set `haspopup` on every trigger element.
|
|
293
|
-
* `haspopup` on the trigger still wins.
|
|
354
|
+
* such as `CngxPopoverPanel` install it via {@link setHaspopup} so any
|
|
355
|
+
* trigger pointing at the popover defaults to the right role without
|
|
356
|
+
* the consumer having to set `haspopup` on every trigger element.
|
|
357
|
+
* Consumer-supplied `haspopup` on the trigger still wins.
|
|
294
358
|
*/
|
|
295
|
-
readonly haspopup: _angular_core.
|
|
359
|
+
readonly haspopup: _angular_core.Signal<PopoverHaspopup | undefined>;
|
|
296
360
|
protected readonly isOpening: _angular_core.Signal<boolean>;
|
|
297
361
|
protected readonly isOpen: _angular_core.Signal<boolean>;
|
|
298
362
|
protected readonly isClosing: _angular_core.Signal<boolean>;
|
|
@@ -330,11 +394,61 @@ declare class CngxPopover {
|
|
|
330
394
|
hide(): void;
|
|
331
395
|
/** Toggle between open and closed. */
|
|
332
396
|
toggle(): void;
|
|
397
|
+
/**
|
|
398
|
+
* Register the anchor element for fallback positioning and arrow
|
|
399
|
+
* geometry, or clear it with `null`. Called by `CngxPopoverTrigger`
|
|
400
|
+
* on registration/destroy and by composing organisms that anchor a
|
|
401
|
+
* panel to a virtual element (context-menu pointer coords).
|
|
402
|
+
*/
|
|
403
|
+
setAnchorElement(element: HTMLElement | null): void;
|
|
404
|
+
/**
|
|
405
|
+
* Release the implicit anchor slot - but only while `element` still
|
|
406
|
+
* holds it. A trigger destroyed after another writer claimed the slot
|
|
407
|
+
* leaves that writer untouched.
|
|
408
|
+
*/
|
|
409
|
+
releaseAnchorElement(element: HTMLElement): void;
|
|
410
|
+
/**
|
|
411
|
+
* Claim the explicit anchor slot. Called by `CngxPopoverAnchor`; last
|
|
412
|
+
* registration wins. The explicit anchor shadows every
|
|
413
|
+
* {@link setAnchorElement} writer (trigger, submenu, context-menu
|
|
414
|
+
* virtual anchor) for positioning, arrow geometry and outside-click
|
|
415
|
+
* handling until it is unregistered.
|
|
416
|
+
*/
|
|
417
|
+
registerAnchorElement(element: HTMLElement): void;
|
|
418
|
+
/**
|
|
419
|
+
* Release the explicit anchor slot - but only while `element` still
|
|
420
|
+
* holds it. A stale anchor releasing after a successor registered is
|
|
421
|
+
* a no-op.
|
|
422
|
+
*/
|
|
423
|
+
unregisterAnchorElement(element: HTMLElement): void;
|
|
424
|
+
/**
|
|
425
|
+
* Install the `aria-haspopup` hint triggers fall back to when the
|
|
426
|
+
* consumer sets none. Composers (`CngxPopoverPanel`, menu wirings)
|
|
427
|
+
* call this once at construction; `undefined` clears the hint.
|
|
428
|
+
*/
|
|
429
|
+
setHaspopup(value: PopoverHaspopup | undefined): void;
|
|
430
|
+
/**
|
|
431
|
+
* @internal Install or clear the programmatic {@link exclusive} override.
|
|
432
|
+
* `null` defers back to the `[exclusive]` input.
|
|
433
|
+
*/
|
|
434
|
+
setExclusiveOverride(value: boolean | null): void;
|
|
435
|
+
/**
|
|
436
|
+
* @internal Install or clear the programmatic {@link placement} override.
|
|
437
|
+
* `null` defers back to the `[placement]` input.
|
|
438
|
+
*/
|
|
439
|
+
setPlacementOverride(value: PopoverPlacement | null): void;
|
|
440
|
+
/**
|
|
441
|
+
* @internal Install or clear the programmatic {@link positionTryFallbacks}
|
|
442
|
+
* override. `null` defers back to the `[positionTryFallbacks]` input.
|
|
443
|
+
*/
|
|
444
|
+
setPositionTryFallbacksOverride(value: readonly PopoverPositionTryFallback[] | null): void;
|
|
333
445
|
protected handleToggle(e: ToggleEvent): void;
|
|
334
446
|
/**
|
|
335
447
|
* @internal Called by the global outside-click listener for every open
|
|
336
448
|
* popover. Hides this one when it opted into `closeOnOutsideClick` and the
|
|
337
|
-
* pointerdown landed outside
|
|
449
|
+
* pointerdown landed outside its panel, its anchor and its trigger (the
|
|
450
|
+
* implicit anchor holder, which differs from the anchor while a
|
|
451
|
+
* `CngxPopoverAnchor` holds the popover).
|
|
338
452
|
*/
|
|
339
453
|
closeIfOutsidePointerDown(target: EventTarget | null): void;
|
|
340
454
|
/**
|
|
@@ -348,13 +462,16 @@ declare class CngxPopover {
|
|
|
348
462
|
*/
|
|
349
463
|
private applyFloatingPosition;
|
|
350
464
|
/**
|
|
351
|
-
* Recompute the arrow's edge and inline offset from the live
|
|
465
|
+
* Recompute the arrow's edge and inline offset from the live anchor and
|
|
352
466
|
* panel rects. The resolved edge captures any browser-driven flip; the
|
|
353
467
|
* offset is clamped inside the panel's rounded-corner bounds so the
|
|
354
468
|
* arrow's base stays flush with the panel's straight edge even when the
|
|
355
|
-
*
|
|
469
|
+
* anchor sits outside the panel's inline extent.
|
|
356
470
|
*/
|
|
357
471
|
private updateArrowOffset;
|
|
472
|
+
private arrowFrame;
|
|
473
|
+
private clearFloatingPosition;
|
|
474
|
+
private cancelArrowFrame;
|
|
358
475
|
private get popoverElement();
|
|
359
476
|
private startClosing;
|
|
360
477
|
private finalize;
|
|
@@ -368,7 +485,10 @@ declare class CngxPopover {
|
|
|
368
485
|
* Sets `aria-expanded`, `aria-controls`, and `aria-haspopup` based on the
|
|
369
486
|
* referenced popover's state. Also sets `anchor-name` for CSS Anchor
|
|
370
487
|
* Positioning and registers the anchor element on the popover for fallback
|
|
371
|
-
* positioning.
|
|
488
|
+
* positioning. Both geometry jobs take effect only while no `CngxPopoverAnchor`
|
|
489
|
+
* holds the popover: when the focusable trigger is not the visible box the
|
|
490
|
+
* panel should hang under, put `[cngxPopoverAnchor]` on that box and the
|
|
491
|
+
* trigger yields its `anchor-name` while keeping every ARIA attribute.
|
|
372
492
|
*
|
|
373
493
|
* Contains **no event handlers** - the consumer binds interactions directly:
|
|
374
494
|
*
|
|
@@ -378,24 +498,27 @@ declare class CngxPopover {
|
|
|
378
498
|
* ```
|
|
379
499
|
*
|
|
380
500
|
* ### Focus restoration
|
|
381
|
-
* Opt in with `[restoreFocus]="true"` to
|
|
382
|
-
*
|
|
383
|
-
*
|
|
501
|
+
* Opt in with `[restoreFocus]="true"` to restore focus on close to the
|
|
502
|
+
* element that was focused before the popover opened (the popover
|
|
503
|
+
* snapshots it synchronously in `show()`, so content autofocus cannot
|
|
504
|
+
* displace the restore target). Useful for menus, confirm panels, and
|
|
505
|
+
* dialogs that steal focus from the trigger.
|
|
384
506
|
*
|
|
385
507
|
* @category common/popover
|
|
386
508
|
* @docsKind primary
|
|
387
509
|
* @wcag AA
|
|
388
510
|
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-trigger.directive.ts
|
|
389
511
|
* @since 0.1.0
|
|
390
|
-
* @relatedTo CngxPopover, CngxPopoverPanel, CngxTooltip
|
|
512
|
+
* @relatedTo CngxPopover, CngxPopoverAnchor, CngxPopoverPanel, CngxTooltip
|
|
391
513
|
* <example-url>http://localhost:4200/#/common/popover/click-popover</example-url>
|
|
392
514
|
* <example-url>http://localhost:4200/#/common/popover/controlled-open</example-url>
|
|
393
515
|
* <example-url>http://localhost:4200/#/common/popover/escape-mode</example-url>
|
|
394
516
|
* <example-url>http://localhost:4200/#/common/popover/placement-variants</example-url>
|
|
517
|
+
* <example-url>http://localhost:4200/#/common/popover/anchor/field-box-anchor</example-url>
|
|
395
518
|
*/
|
|
396
519
|
declare class CngxPopoverTrigger {
|
|
397
520
|
private readonly elRef;
|
|
398
|
-
private readonly
|
|
521
|
+
private readonly destroyRef;
|
|
399
522
|
/** Explicit reference to the popover this trigger controls. */
|
|
400
523
|
readonly popoverRef: _angular_core.InputSignal<CngxPopover>;
|
|
401
524
|
/**
|
|
@@ -413,11 +536,19 @@ declare class CngxPopoverTrigger {
|
|
|
413
536
|
*/
|
|
414
537
|
readonly haspopupInput: _angular_core.InputSignal<PopoverHaspopup | "none" | undefined>;
|
|
415
538
|
/**
|
|
416
|
-
* When
|
|
417
|
-
* popover
|
|
418
|
-
*
|
|
419
|
-
*
|
|
420
|
-
|
|
539
|
+
* ARIA controls override. When set, `aria-controls` names this id instead
|
|
540
|
+
* of the popover element - correct when the popup role sits on an element
|
|
541
|
+
* inside the popover (a `role="listbox"` or `role="tree"` panel). `null`
|
|
542
|
+
* or unset falls back to `popoverRef().id()`.
|
|
543
|
+
*/
|
|
544
|
+
readonly controlsInput: _angular_core.InputSignal<string | null | undefined>;
|
|
545
|
+
/**
|
|
546
|
+
* When `true`, remembers the popover's pre-open focus target (the
|
|
547
|
+
* popover snapshots `document.activeElement` synchronously inside
|
|
548
|
+
* `show()`, before content autofocus can land in the panel) and
|
|
549
|
+
* restores focus to it when the popover closes. Defaults to `false`
|
|
550
|
+
* so the trigger stays a passive ARIA atom; opt in for menus,
|
|
551
|
+
* confirm panels, and dialogs that move focus away from the trigger.
|
|
421
552
|
*/
|
|
422
553
|
readonly restoreFocus: _angular_core.InputSignal<boolean>;
|
|
423
554
|
/**
|
|
@@ -428,11 +559,63 @@ declare class CngxPopoverTrigger {
|
|
|
428
559
|
* binding drops the attribute entirely.
|
|
429
560
|
*/
|
|
430
561
|
protected readonly haspopup: _angular_core.Signal<PopoverHaspopup | null>;
|
|
562
|
+
/** Resolved `aria-controls`: the consumer override, else the popover id. */
|
|
563
|
+
protected readonly controls: _angular_core.Signal<string>;
|
|
564
|
+
/**
|
|
565
|
+
* CSS anchor name, yielded (`null`) while a `CngxPopoverAnchor` holds
|
|
566
|
+
* the popover's explicit anchor slot.
|
|
567
|
+
*/
|
|
431
568
|
protected readonly cssAnchorName: _angular_core.Signal<string | null>;
|
|
432
569
|
private savedFocus;
|
|
433
570
|
constructor();
|
|
434
571
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverTrigger, never>;
|
|
435
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverTrigger, "[cngxPopoverTrigger]", ["cngxPopoverTrigger"], { "popoverRef": { "alias": "cngxPopoverTrigger"; "required": true; "isSignal": true; }; "haspopupInput": { "alias": "haspopup"; "required": false; "isSignal": true; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
572
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverTrigger, "[cngxPopoverTrigger]", ["cngxPopoverTrigger"], { "popoverRef": { "alias": "cngxPopoverTrigger"; "required": true; "isSignal": true; }; "haspopupInput": { "alias": "haspopup"; "required": false; "isSignal": true; }; "controlsInput": { "alias": "controls"; "required": false; "isSignal": true; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* Geometry anchor atom: positions a `CngxPopover` against its host
|
|
577
|
+
* element instead of against the popover's trigger.
|
|
578
|
+
*
|
|
579
|
+
* Reach for it when the focusable trigger is not the visible box the
|
|
580
|
+
* panel should hang under - an `<input>` inside a bordered field row, an
|
|
581
|
+
* icon button inside a toolbar segment. The trigger keeps every ARIA
|
|
582
|
+
* attribute (`aria-expanded`, `aria-controls`, `aria-haspopup`); this
|
|
583
|
+
* atom owns only the geometry. It is the cngx counterpart of Material's
|
|
584
|
+
* `matAutocompleteOrigin`.
|
|
585
|
+
*
|
|
586
|
+
* ```html
|
|
587
|
+
* <div class="field" [cngxPopoverAnchor]="pop">
|
|
588
|
+
* <input [cngxPopoverTrigger]="pop" (focus)="pop.show()" aria-label="City" />
|
|
589
|
+
* </div>
|
|
590
|
+
* <div cngxPopover #pop="cngxPopover" placement="bottom-start">…</div>
|
|
591
|
+
* ```
|
|
592
|
+
*
|
|
593
|
+
* While the atom holds the popover's explicit anchor slot it emits
|
|
594
|
+
* `anchor-name` for CSS Anchor Positioning and is the reference element
|
|
595
|
+
* of the Floating UI fallback, the arrow geometry and the outside-click
|
|
596
|
+
* guard; `CngxPopoverTrigger` yields its own `anchor-name`. The explicit
|
|
597
|
+
* anchor wins over every `setAnchorElement` writer. With two atoms on one
|
|
598
|
+
* popover the last registered wins, and only the holder emits
|
|
599
|
+
* `anchor-name`. On destroy (or when the bound popover changes) the atom
|
|
600
|
+
* releases the slot identity-guarded and the trigger becomes the anchor
|
|
601
|
+
* again.
|
|
602
|
+
*
|
|
603
|
+
* @category common/popover
|
|
604
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-anchor.directive.ts
|
|
605
|
+
* @since 0.1.0
|
|
606
|
+
* @relatedTo CngxPopover, CngxPopoverTrigger
|
|
607
|
+
* <example-url>http://localhost:4200/#/common/popover/anchor/field-box-anchor</example-url>
|
|
608
|
+
*/
|
|
609
|
+
declare class CngxPopoverAnchor {
|
|
610
|
+
private readonly host;
|
|
611
|
+
/** The popover this element anchors. */
|
|
612
|
+
readonly popoverRef: _angular_core.InputSignal<CngxPopover>;
|
|
613
|
+
/** Whether this host currently holds the popover's explicit anchor slot. */
|
|
614
|
+
protected readonly isAnchor: _angular_core.Signal<boolean>;
|
|
615
|
+
protected readonly cssAnchorName: _angular_core.Signal<string | null>;
|
|
616
|
+
constructor();
|
|
617
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverAnchor, never>;
|
|
618
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverAnchor, "[cngxPopoverAnchor]", ["cngxPopoverAnchor"], { "popoverRef": { "alias": "cngxPopoverAnchor"; "required": true; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
436
619
|
}
|
|
437
620
|
|
|
438
621
|
/**
|
|
@@ -559,20 +742,330 @@ declare class CngxTooltip {
|
|
|
559
742
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxTooltip, "[cngxTooltip]", ["cngxTooltip"], { "text": { "alias": "cngxTooltip"; "required": true; "isSignal": true; }; "placement": { "alias": "tooltipPlacement"; "required": false; "isSignal": true; }; "offset": { "alias": "tooltipOffset"; "required": false; "isSignal": true; }; "openDelay": { "alias": "tooltipDelay"; "required": false; "isSignal": true; }; "closeDelay": { "alias": "closeDelay"; "required": false; "isSignal": true; }; "enabled": { "alias": "enabled"; "required": false; "isSignal": true; }; "triggers": { "alias": "triggers"; "required": false; "isSignal": true; }; "positionTryFallbacks": { "alias": "tooltipPositionTryFallbacks"; "required": false; "isSignal": true; }; }, {}, never, never, true, [{ directive: typeof i1.CngxReducedMotion; inputs: {}; outputs: {}; }]>;
|
|
560
743
|
}
|
|
561
744
|
|
|
745
|
+
/**
|
|
746
|
+
* How an open popover is laid out: anchored to its trigger, as a bottom
|
|
747
|
+
* sheet, or filling the viewport.
|
|
748
|
+
*
|
|
749
|
+
* @category common/popover
|
|
750
|
+
* @since 0.1.0
|
|
751
|
+
*/
|
|
752
|
+
type CngxPopoverPresentation = 'anchored' | 'sheet' | 'fullscreen';
|
|
753
|
+
/**
|
|
754
|
+
* @internal Contract between `CngxPopover` and a presentation modifier on the
|
|
755
|
+
* same element. `CngxPopover` drops every anchor and floating write while
|
|
756
|
+
* `presentation()` is not `'anchored'`, and calls `onShown()` / `onHide()`
|
|
757
|
+
* synchronously inside `show()` / `hide()` so the modifier can move focus and
|
|
758
|
+
* release page state in the caller's stack.
|
|
759
|
+
*/
|
|
760
|
+
interface CngxPopoverPresentationSeam {
|
|
761
|
+
readonly presentation: Signal<CngxPopoverPresentation>;
|
|
762
|
+
/** Runs right after `showPopover()`, with the host already `aria-hidden="false"`. */
|
|
763
|
+
onShown(): void;
|
|
764
|
+
/** Runs once per `hide()`, before any close transition starts (state still open). */
|
|
765
|
+
onHide(): void;
|
|
766
|
+
}
|
|
767
|
+
|
|
768
|
+
/**
|
|
769
|
+
* Why a sheet asked to close: a swipe on the header or handle, a tap outside
|
|
770
|
+
* the panel, the Android back gesture, or a close control inside the sheet.
|
|
771
|
+
*
|
|
772
|
+
* @category common/popover
|
|
773
|
+
*/
|
|
774
|
+
type CngxPopoverSheetCloseReason = 'swipe' | 'backdrop' | 'back' | 'close';
|
|
775
|
+
/** @internal Handle a `CngxPopoverSheetTitle` registers. */
|
|
776
|
+
interface CngxPopoverSheetTitleHandle {
|
|
777
|
+
readonly id: Signal<string>;
|
|
778
|
+
}
|
|
779
|
+
/** @internal Handle a `CngxPopoverSheetInitialFocus` registers. */
|
|
780
|
+
interface CngxPopoverSheetFocusHandle {
|
|
781
|
+
readonly element: HTMLElement;
|
|
782
|
+
/** Whether the element takes part in the next open. Absent means it does. */
|
|
783
|
+
readonly enabled?: Signal<boolean>;
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* @internal What the sheet parts need from `CngxPopoverSheet`. A token
|
|
787
|
+
* instead of the directive class keeps the parts free of the directive
|
|
788
|
+
* import (dialog-title precedent, `CNGX_DIALOG_ARIA_REGISTRY`).
|
|
789
|
+
*/
|
|
790
|
+
interface CngxPopoverSheetPartsHost {
|
|
791
|
+
readonly titleRegistry: SlotRegistry<CngxPopoverSheetTitleHandle>;
|
|
792
|
+
/** Keyed by a per-handle uid; the first enabled handle in document order wins. */
|
|
793
|
+
readonly initialFocusRegistry: KeyedRegistry<CngxPopoverSheetFocusHandle>;
|
|
794
|
+
/** `true` while the sheet lays the panel out as sheet or fullscreen. */
|
|
795
|
+
readonly modal: Signal<boolean>;
|
|
796
|
+
requestClose(reason: CngxPopoverSheetCloseReason): void;
|
|
797
|
+
}
|
|
798
|
+
|
|
799
|
+
/**
|
|
800
|
+
* What a consumer asks for: a fixed presentation, or `'auto'` to let the
|
|
801
|
+
* breakpoint in `cngx-popover-sheet.css` decide.
|
|
802
|
+
*
|
|
803
|
+
* @category common/popover
|
|
804
|
+
*/
|
|
805
|
+
type CngxPopoverPresentationRequest = 'auto' | CngxPopoverPresentation;
|
|
806
|
+
/**
|
|
807
|
+
* Turns a `CngxPopover` into a modal bottom sheet or fullscreen panel on
|
|
808
|
+
* coarse, narrow viewports, and leaves it anchored everywhere else.
|
|
809
|
+
*
|
|
810
|
+
* Place it on the `[cngxPopover]` element. With the default `'auto'` request,
|
|
811
|
+
* the breakpoint written once in `cngx-popover-sheet.css`
|
|
812
|
+
* (`(pointer: coarse) and (max-width: 48rem)`) picks between the anchored
|
|
813
|
+
* panel and `autoPresentation` (`'sheet'` or `'fullscreen'`). Pass a fixed
|
|
814
|
+
* presentation to override it.
|
|
815
|
+
*
|
|
816
|
+
* Both non-anchored presentations are modal: the host becomes
|
|
817
|
+
* `role="dialog"` + `aria-modal="true"`, named by its
|
|
818
|
+
* `CngxPopoverSheetTitle`; focus moves into the panel inside `show()`, onto
|
|
819
|
+
* the first enabled `CngxPopoverSheetInitialFocus` (a marked search input
|
|
820
|
+
* focused there keeps the iOS keyboard of a tap open), Tab is trapped, every page
|
|
821
|
+
* sibling is `inert`, the page is pinned, and announcements go through
|
|
822
|
+
* {@link announce} into a live region inside the panel, the only region
|
|
823
|
+
* VoiceOver speaks under `aria-modal`. On close the page is live again and
|
|
824
|
+
* focus is back on the opener before the close transition starts.
|
|
825
|
+
*
|
|
826
|
+
* The sheet never closes itself. Header swipes, outside taps and the Android
|
|
827
|
+
* back gesture arrive as `closeRequested` with a reason; the popover hides
|
|
828
|
+
* unless `closeOnRequest` is `false`, which lets a consumer apply its own
|
|
829
|
+
* dismiss policy. Escape stays with `CngxPopover`'s `closeOnEscape`.
|
|
830
|
+
*
|
|
831
|
+
* Requires `mode="manual"` on the popover (the default): native light dismiss
|
|
832
|
+
* would bypass `closeRequested`.
|
|
833
|
+
*
|
|
834
|
+
* ```html
|
|
835
|
+
* <button type="button" (click)="pop.show()">Choose city</button>
|
|
836
|
+
* <div cngxPopover #pop="cngxPopover" cngxPopoverSheet #sheet="cngxPopoverSheet">
|
|
837
|
+
* <header cngxPopoverSheetHeader cngxSwipeDismiss="down">
|
|
838
|
+
* <span cngxPopoverSheetHandle></span>
|
|
839
|
+
* <h2 cngxPopoverSheetTitle>City</h2>
|
|
840
|
+
* <button type="button" (click)="sheet.requestClose('close')">Close</button>
|
|
841
|
+
* </header>
|
|
842
|
+
* <ul>...</ul>
|
|
843
|
+
* </div>
|
|
844
|
+
* ```
|
|
845
|
+
*
|
|
846
|
+
* @category common/popover
|
|
847
|
+
* @docsKind primary
|
|
848
|
+
* @wcag AA
|
|
849
|
+
* @github https://github.com/cngxjs/cngx/blob/main/projects/common/popover/popover-sheet.directive.ts
|
|
850
|
+
* @since 0.1.0
|
|
851
|
+
* @relatedTo CngxPopover, CngxSwipeDismiss, CngxFocusTrap, createPinnedScrollLock, injectScopedLiveRegion
|
|
852
|
+
* <example-url>http://localhost:4200/#/common/popover/sheet/bottom-sheet</example-url>
|
|
853
|
+
* <example-url>http://localhost:4200/#/common/popover/sheet/fullscreen-search</example-url>
|
|
854
|
+
*/
|
|
855
|
+
declare class CngxPopoverSheet implements CngxPopoverPresentationSeam, CngxPopoverSheetPartsHost, CngxFocusTrapDriver {
|
|
856
|
+
private readonly popover;
|
|
857
|
+
private readonly trap;
|
|
858
|
+
private readonly announcer;
|
|
859
|
+
private readonly doc;
|
|
860
|
+
private readonly injector;
|
|
861
|
+
private readonly win;
|
|
862
|
+
private readonly host;
|
|
863
|
+
private readonly staticRole;
|
|
864
|
+
private readonly staticLabelledBy;
|
|
865
|
+
private readonly staticTabindex;
|
|
866
|
+
/**
|
|
867
|
+
* Requested presentation. `'auto'` (default, also the bare attribute)
|
|
868
|
+
* resolves through the stylesheet breakpoint.
|
|
869
|
+
*/
|
|
870
|
+
readonly request: _angular_core.InputSignalWithTransform<CngxPopoverPresentationRequest, "" | CngxPopoverPresentationRequest>;
|
|
871
|
+
/**
|
|
872
|
+
* What `'auto'` resolves to below the breakpoint: a content-sized `'sheet'`
|
|
873
|
+
* or a `'fullscreen'` panel (for panels led by a text input).
|
|
874
|
+
*/
|
|
875
|
+
readonly autoPresentation: _angular_core.InputSignal<"sheet" | "fullscreen">;
|
|
876
|
+
/** Id of the element naming the dialog. Wins over a registered `CngxPopoverSheetTitle`. */
|
|
877
|
+
readonly labelledBy: _angular_core.InputSignal<string | undefined>;
|
|
878
|
+
/**
|
|
879
|
+
* Whether the sheet returns focus on close (to `restoreTarget`, else to the
|
|
880
|
+
* element focused before it opened). Turn it off when a `closing` handler
|
|
881
|
+
* moves focus itself.
|
|
882
|
+
*/
|
|
883
|
+
readonly restoreFocus: _angular_core.InputSignal<boolean>;
|
|
884
|
+
/** Element to return focus to on close. Defaults to the element focused before open. */
|
|
885
|
+
readonly restoreTarget: _angular_core.InputSignal<HTMLElement | undefined>;
|
|
886
|
+
/**
|
|
887
|
+
* Whether a close request hides the popover. `false` only emits
|
|
888
|
+
* `closeRequested`, so the consumer decides.
|
|
889
|
+
*/
|
|
890
|
+
readonly closeOnRequest: _angular_core.InputSignal<boolean>;
|
|
891
|
+
/** A swipe, outside tap, back gesture or close control asked the sheet to close. */
|
|
892
|
+
readonly closeRequested: _angular_core.OutputEmitterRef<CngxPopoverSheetCloseReason>;
|
|
893
|
+
/**
|
|
894
|
+
* Emits synchronously inside `hide()` while the page is already live again,
|
|
895
|
+
* before the close transition. The place to move focus out of the panel.
|
|
896
|
+
* Fires only for a modal close.
|
|
897
|
+
*/
|
|
898
|
+
readonly closing: _angular_core.OutputEmitterRef<void>;
|
|
899
|
+
private readonly breakpoint;
|
|
900
|
+
/** Resolved presentation, reflected as `data-cngx-presentation`. */
|
|
901
|
+
readonly presentation: _angular_core.Signal<CngxPopoverPresentation>;
|
|
902
|
+
/** `true` in the sheet and fullscreen presentations. */
|
|
903
|
+
readonly modal: _angular_core.Signal<boolean>;
|
|
904
|
+
/** @internal Drives the composed `CngxFocusTrap`: Tab stays inside while modal and visible. */
|
|
905
|
+
readonly focusTrapEnabled: _angular_core.Signal<boolean>;
|
|
906
|
+
/** @internal The sheet moves focus itself, inside `show()`. */
|
|
907
|
+
readonly focusTrapAutoFocus = false;
|
|
908
|
+
/** @internal */
|
|
909
|
+
readonly titleRegistry: _cngx_core_utils.SlotRegistry<CngxPopoverSheetTitleHandle>;
|
|
910
|
+
/** @internal */
|
|
911
|
+
readonly initialFocusRegistry: _cngx_core_utils.KeyedRegistry<CngxPopoverSheetFocusHandle>;
|
|
912
|
+
protected readonly roleAttr: _angular_core.Signal<string | null>;
|
|
913
|
+
protected readonly ariaModal: _angular_core.Signal<"true" | null>;
|
|
914
|
+
protected readonly ariaLabelledBy: _angular_core.Signal<string | null>;
|
|
915
|
+
protected readonly tabindexAttr: _angular_core.Signal<string | null>;
|
|
916
|
+
private readonly region;
|
|
917
|
+
private engaged;
|
|
918
|
+
private savedFocus;
|
|
919
|
+
private inerted;
|
|
920
|
+
private lifted;
|
|
921
|
+
private releaseLock;
|
|
922
|
+
private settlingFrame;
|
|
923
|
+
private warnedTitle;
|
|
924
|
+
private warnedMode;
|
|
925
|
+
private closeWatcher;
|
|
926
|
+
private readonly outsidePointerDown;
|
|
927
|
+
private clickSwallowTimer;
|
|
928
|
+
private escapeKeyTimer;
|
|
929
|
+
private readonly escapeKeydown;
|
|
930
|
+
private readonly swallowClick;
|
|
931
|
+
constructor();
|
|
932
|
+
/** @internal Seam call from `CngxPopover.show()`, after `showPopover()`. */
|
|
933
|
+
onShown(): void;
|
|
934
|
+
/** @internal Seam call from `CngxPopover.hide()`, before the close transition. */
|
|
935
|
+
onHide(): void;
|
|
936
|
+
/**
|
|
937
|
+
* Ask the sheet to close. Emits `closeRequested` once per open (no-op
|
|
938
|
+
* unless the popover is opening or open) and hides when `closeOnRequest`
|
|
939
|
+
* is on.
|
|
940
|
+
*/
|
|
941
|
+
requestClose(reason: CngxPopoverSheetCloseReason): void;
|
|
942
|
+
/**
|
|
943
|
+
* Speak `message` from the live region inside the panel. Use it for
|
|
944
|
+
* every announcement while the sheet is modal: VoiceOver drops body-level
|
|
945
|
+
* regions under `aria-modal`.
|
|
946
|
+
*/
|
|
947
|
+
announce(message: string, politeness?: AriaLivePoliteness): void;
|
|
948
|
+
/**
|
|
949
|
+
* Move focus to the first enabled `CngxPopoverSheetInitialFocus` in
|
|
950
|
+
* document order, else the first tabbable element, else the host. Runs on
|
|
951
|
+
* every modal open.
|
|
952
|
+
*/
|
|
953
|
+
focusInitial(): void;
|
|
954
|
+
private initialFocusTarget;
|
|
955
|
+
protected handleBeforeToggle(event: ToggleEvent): void;
|
|
956
|
+
private disengage;
|
|
957
|
+
private engage;
|
|
958
|
+
private rehomeFocusAfterFlip;
|
|
959
|
+
private focusFirstTaker;
|
|
960
|
+
private focusableAnchor;
|
|
961
|
+
private openerToRestore;
|
|
962
|
+
private release;
|
|
963
|
+
private armCloseWatcher;
|
|
964
|
+
private armClickSwallow;
|
|
965
|
+
private disarmClickSwallow;
|
|
966
|
+
private disarmCloseWatcher;
|
|
967
|
+
private liftOwnInert;
|
|
968
|
+
private applyInert;
|
|
969
|
+
private skipsInert;
|
|
970
|
+
private restoreInert;
|
|
971
|
+
private handOffPendingAnnouncements;
|
|
972
|
+
private startSettling;
|
|
973
|
+
private stopSettling;
|
|
974
|
+
private warnOnMisconfiguration;
|
|
975
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverSheet, never>;
|
|
976
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverSheet, "[cngxPopoverSheet]", ["cngxPopoverSheet"], { "request": { "alias": "cngxPopoverSheet"; "required": false; "isSignal": true; }; "autoPresentation": { "alias": "autoPresentation"; "required": false; "isSignal": true; }; "labelledBy": { "alias": "labelledBy"; "required": false; "isSignal": true; }; "restoreFocus": { "alias": "restoreFocus"; "required": false; "isSignal": true; }; "restoreTarget": { "alias": "restoreTarget"; "required": false; "isSignal": true; }; "closeOnRequest": { "alias": "closeOnRequest"; "required": false; "isSignal": true; }; }, { "closeRequested": "closeRequested"; "closing": "closing"; }, never, never, true, [{ directive: typeof i1.CngxFocusTrap; inputs: {}; outputs: {}; }]>;
|
|
977
|
+
}
|
|
978
|
+
|
|
979
|
+
/**
|
|
980
|
+
* Header row of a `CngxPopoverSheet`. Stays put while the content below it
|
|
981
|
+
* scrolls; add `cngxSwipeDismiss="down"` to close the sheet by swiping it.
|
|
982
|
+
*
|
|
983
|
+
* @category common/popover
|
|
984
|
+
* @since 0.1.0
|
|
985
|
+
* @relatedTo CngxPopoverSheet, CngxSwipeDismiss
|
|
986
|
+
*/
|
|
987
|
+
declare class CngxPopoverSheetHeader {
|
|
988
|
+
constructor();
|
|
989
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverSheetHeader, never>;
|
|
990
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverSheetHeader, "[cngxPopoverSheetHeader]", never, {}, {}, never, never, true, never>;
|
|
991
|
+
}
|
|
992
|
+
/**
|
|
993
|
+
* The element that names a modal `CngxPopoverSheet`. The sheet points its
|
|
994
|
+
* `aria-labelledby` here, never at the header that also holds buttons.
|
|
995
|
+
*
|
|
996
|
+
* @category common/popover
|
|
997
|
+
* @since 0.1.0
|
|
998
|
+
* @relatedTo CngxPopoverSheet
|
|
999
|
+
*/
|
|
1000
|
+
declare class CngxPopoverSheetTitle implements CngxPopoverSheetTitleHandle {
|
|
1001
|
+
/** Generated id the sheet references. */
|
|
1002
|
+
readonly id: _angular_core.Signal<string>;
|
|
1003
|
+
constructor();
|
|
1004
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverSheetTitle, never>;
|
|
1005
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverSheetTitle, "[cngxPopoverSheetTitle]", never, {}, {}, never, never, true, never>;
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Decorative drag handle. Always `aria-hidden`: screen-reader users close
|
|
1009
|
+
* the sheet through its close control, since their swipe is consumed by
|
|
1010
|
+
* navigation.
|
|
1011
|
+
*
|
|
1012
|
+
* @category common/popover
|
|
1013
|
+
* @since 0.1.0
|
|
1014
|
+
* @relatedTo CngxPopoverSheet
|
|
1015
|
+
*/
|
|
1016
|
+
declare class CngxPopoverSheetHandle {
|
|
1017
|
+
constructor();
|
|
1018
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverSheetHandle, never>;
|
|
1019
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverSheetHandle, "[cngxPopoverSheetHandle]", never, {}, {}, never, never, true, never>;
|
|
1020
|
+
}
|
|
1021
|
+
/**
|
|
1022
|
+
* Marks the element that receives focus when a modal `CngxPopoverSheet`
|
|
1023
|
+
* opens, e.g. the search input of a fullscreen panel. Without one the first
|
|
1024
|
+
* tabbable element is focused.
|
|
1025
|
+
*
|
|
1026
|
+
* A panel can mark several elements. The first enabled one in document order
|
|
1027
|
+
* takes focus, so a search field that should lead only some opens binds
|
|
1028
|
+
* `[cngxPopoverSheetInitialFocus]="condition"` and the list below it carries
|
|
1029
|
+
* the bare attribute as the default target. The condition is read when the
|
|
1030
|
+
* sheet opens.
|
|
1031
|
+
*
|
|
1032
|
+
* @category common/popover
|
|
1033
|
+
* @since 0.1.0
|
|
1034
|
+
* @relatedTo CngxPopoverSheet
|
|
1035
|
+
*/
|
|
1036
|
+
declare class CngxPopoverSheetInitialFocus implements CngxPopoverSheetFocusHandle {
|
|
1037
|
+
/** The element focused on open. */
|
|
1038
|
+
readonly element: HTMLElement;
|
|
1039
|
+
/**
|
|
1040
|
+
* `false` keeps this element out of the next open's focus choice. The bare
|
|
1041
|
+
* attribute, or no binding, leaves it enabled.
|
|
1042
|
+
*/
|
|
1043
|
+
readonly enabledInput: _angular_core.InputSignalWithTransform<boolean | undefined, boolean | "" | undefined>;
|
|
1044
|
+
/** @internal Read by the sheet on open. */
|
|
1045
|
+
readonly enabled: _angular_core.Signal<boolean>;
|
|
1046
|
+
private readonly key;
|
|
1047
|
+
constructor();
|
|
1048
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverSheetInitialFocus, never>;
|
|
1049
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverSheetInitialFocus, "[cngxPopoverSheetInitialFocus]", never, { "enabledInput": { "alias": "cngxPopoverSheetInitialFocus"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
1050
|
+
}
|
|
1051
|
+
|
|
1052
|
+
interface ComputePositionSignature {
|
|
1053
|
+
computePosition(reference: HTMLElement, floating: HTMLElement, options?: {
|
|
1054
|
+
placement?: string;
|
|
1055
|
+
middleware?: unknown[];
|
|
1056
|
+
}): Promise<{
|
|
1057
|
+
x: number;
|
|
1058
|
+
y: number;
|
|
1059
|
+
placement: string;
|
|
1060
|
+
}>;
|
|
1061
|
+
}
|
|
562
1062
|
/**
|
|
563
1063
|
* Signature matching `@floating-ui/dom` `computePosition`.
|
|
564
1064
|
* The consumer provides the actual function - the library never imports it directly.
|
|
565
1065
|
*
|
|
566
1066
|
* @category common/popover
|
|
567
1067
|
*/
|
|
568
|
-
type ComputePositionFn =
|
|
569
|
-
placement?: string;
|
|
570
|
-
middleware?: unknown[];
|
|
571
|
-
}) => Promise<{
|
|
572
|
-
x: number;
|
|
573
|
-
y: number;
|
|
574
|
-
placement: string;
|
|
575
|
-
}>;
|
|
1068
|
+
type ComputePositionFn = ComputePositionSignature['computePosition'];
|
|
576
1069
|
/**
|
|
577
1070
|
* Configuration for the Floating UI positioning fallback.
|
|
578
1071
|
*
|
|
@@ -581,7 +1074,10 @@ type ComputePositionFn = (reference: HTMLElement, floating: HTMLElement, options
|
|
|
581
1074
|
interface FloatingFallbackConfig {
|
|
582
1075
|
/** The `computePosition` function from `@floating-ui/dom`. */
|
|
583
1076
|
computePosition: ComputePositionFn;
|
|
584
|
-
/**
|
|
1077
|
+
/**
|
|
1078
|
+
* Middleware array (e.g. `[flip(), shift()]`). The popover prepends its own
|
|
1079
|
+
* offset middleware, so do not pass `offset()` here.
|
|
1080
|
+
*/
|
|
585
1081
|
middleware?: unknown[];
|
|
586
1082
|
}
|
|
587
1083
|
/**
|
|
@@ -601,11 +1097,11 @@ declare const CNGX_FLOATING_FALLBACK: InjectionToken<FloatingFallbackConfig | nu
|
|
|
601
1097
|
* never imports it directly, keeping the bundle at zero cost for modern browsers.
|
|
602
1098
|
*
|
|
603
1099
|
* ```typescript
|
|
604
|
-
* import { computePosition, flip,
|
|
1100
|
+
* import { computePosition, flip, shift } from '@floating-ui/dom';
|
|
605
1101
|
*
|
|
606
1102
|
* // In app.config.ts or component providers:
|
|
607
1103
|
* providers: [
|
|
608
|
-
* provideFloatingFallback(computePosition, [
|
|
1104
|
+
* provideFloatingFallback(computePosition, [flip(), shift()]),
|
|
609
1105
|
* ]
|
|
610
1106
|
* ```
|
|
611
1107
|
*
|
|
@@ -613,6 +1109,34 @@ declare const CNGX_FLOATING_FALLBACK: InjectionToken<FloatingFallbackConfig | nu
|
|
|
613
1109
|
*/
|
|
614
1110
|
declare function provideFloatingFallback(computePosition: ComputePositionFn, middleware?: unknown[]): Provider;
|
|
615
1111
|
|
|
1112
|
+
/**
|
|
1113
|
+
* The popover section of a {@link CngxLanguagePack}: the copy of
|
|
1114
|
+
* `CngxPopoverPanel`. `providePopoverPanel(withPopoverPanelLabels(...))`
|
|
1115
|
+
* overrides single keys on top of it.
|
|
1116
|
+
*
|
|
1117
|
+
* @category common/popover
|
|
1118
|
+
* @since 0.1.0
|
|
1119
|
+
* @relatedTo CngxPopoverPanel, withPopoverPanelLabels
|
|
1120
|
+
*/
|
|
1121
|
+
interface CngxPopoverLanguageSection {
|
|
1122
|
+
/** Accessible name of the built-in close button. */
|
|
1123
|
+
readonly close: string;
|
|
1124
|
+
}
|
|
1125
|
+
/**
|
|
1126
|
+
* The English popover section: the single source of the popover panel's
|
|
1127
|
+
* English copy.
|
|
1128
|
+
*
|
|
1129
|
+
* @category common/popover
|
|
1130
|
+
* @since 0.1.0
|
|
1131
|
+
* @relatedTo CngxPopoverPanel
|
|
1132
|
+
*/
|
|
1133
|
+
declare const CNGX_POPOVER_LANGUAGE_EN: CngxPopoverLanguageSection;
|
|
1134
|
+
declare module '@cngx/core/i18n' {
|
|
1135
|
+
interface CngxLanguagePack {
|
|
1136
|
+
readonly popover: CngxPopoverLanguageSection;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
616
1140
|
/**
|
|
617
1141
|
* Context object passed to a `*cngxPopoverArrow` template.
|
|
618
1142
|
*
|
|
@@ -795,7 +1319,22 @@ interface CngxPopoverPanelConfig {
|
|
|
795
1319
|
*/
|
|
796
1320
|
arrow?: TemplateRef<CngxPopoverArrowContext>;
|
|
797
1321
|
};
|
|
1322
|
+
/**
|
|
1323
|
+
* App-wide panel copy, set via `withPopoverPanelLabels(...)`. Unset keys
|
|
1324
|
+
* keep the English default. A `Signal` of a partial bundle switches
|
|
1325
|
+
* languages at runtime; the panel reads it reactively.
|
|
1326
|
+
*/
|
|
1327
|
+
readonly labels?: Partial<CngxPopoverPanelLabels> | Signal<Partial<CngxPopoverPanelLabels>>;
|
|
798
1328
|
}
|
|
1329
|
+
/**
|
|
1330
|
+
* User-facing copy of `CngxPopoverPanel`. Library defaults are English. The
|
|
1331
|
+
* same shape as the popover section of a language pack, declared once as
|
|
1332
|
+
* {@link CngxPopoverLanguageSection}.
|
|
1333
|
+
*
|
|
1334
|
+
* @category common/popover
|
|
1335
|
+
* @since 0.1.0
|
|
1336
|
+
*/
|
|
1337
|
+
type CngxPopoverPanelLabels = CngxPopoverLanguageSection;
|
|
799
1338
|
/**
|
|
800
1339
|
* Feature function signature for `providePopoverPanel()`.
|
|
801
1340
|
*
|
|
@@ -881,6 +1420,22 @@ declare function withArrow(show?: boolean): PopoverPanelFeature;
|
|
|
881
1420
|
* @category common/popover
|
|
882
1421
|
*/
|
|
883
1422
|
declare function withArrowTemplate(tpl: TemplateRef<CngxPopoverArrowContext>): PopoverPanelFeature;
|
|
1423
|
+
/**
|
|
1424
|
+
* Set the app-wide panel copy. Unset keys keep the language pack's copy, or
|
|
1425
|
+
* the English default; pass a
|
|
1426
|
+
* `Signal` of a partial bundle to switch languages at runtime. A later call
|
|
1427
|
+
* replaces the whole bundle. Mirrors `withDialogLabels`.
|
|
1428
|
+
*
|
|
1429
|
+
* ```typescript
|
|
1430
|
+
* providers: [
|
|
1431
|
+
* providePopoverPanel(withPopoverPanelLabels({ close: 'Schliessen' })),
|
|
1432
|
+
* ]
|
|
1433
|
+
* ```
|
|
1434
|
+
*
|
|
1435
|
+
* @category common/popover
|
|
1436
|
+
* @since 0.1.0
|
|
1437
|
+
*/
|
|
1438
|
+
declare function withPopoverPanelLabels(labels: Partial<CngxPopoverPanelLabels> | Signal<Partial<CngxPopoverPanelLabels>>): PopoverPanelFeature;
|
|
884
1439
|
|
|
885
1440
|
/**
|
|
886
1441
|
* Geometry contract for the popover panel's arrow ornament.
|
|
@@ -921,8 +1476,9 @@ declare const CNGX_POPOVER_ARROW_BOUNDS: InjectionToken<CngxPopoverArrowBounds>;
|
|
|
921
1476
|
* styling, arrow, close button, and content state templates.
|
|
922
1477
|
*
|
|
923
1478
|
* Composes `CngxPopover` via `hostDirectives` - all popover inputs
|
|
924
|
-
* (`placement`, `
|
|
925
|
-
* `cngxPopoverOpen`) are
|
|
1479
|
+
* (`placement`, `positionTryFallbacks`, `offset`, `closeOnEscape`,
|
|
1480
|
+
* `closeOnOutsideClick`, `mode`, `exclusive`, `cngxPopoverOpen`) are
|
|
1481
|
+
* forwarded.
|
|
926
1482
|
*
|
|
927
1483
|
* The `variant` input is a free-form string mapped to a CSS class
|
|
928
1484
|
* (`cngx-popover-panel--{variant}`). Five variants are pre-themed
|
|
@@ -1006,6 +1562,13 @@ declare class CngxPopoverPanel implements CngxPopoverArrowBounds {
|
|
|
1006
1562
|
readonly showCloseInput: _angular_core.InputSignal<boolean | undefined>;
|
|
1007
1563
|
/** Show an arrow. Falls back to global config from `providePopoverPanel(withArrow())`. */
|
|
1008
1564
|
readonly showArrowInput: _angular_core.InputSignal<boolean | undefined>;
|
|
1565
|
+
/**
|
|
1566
|
+
* Panel copy: `config.labels` over the popover section of the active
|
|
1567
|
+
* language pack, one shared merge per config object.
|
|
1568
|
+
*/
|
|
1569
|
+
private readonly labels;
|
|
1570
|
+
/** Accessible name of the built-in close button. */
|
|
1571
|
+
protected readonly closeLabel: _angular_core.Signal<string>;
|
|
1009
1572
|
/** Resolved showClose - input takes precedence over config. */
|
|
1010
1573
|
readonly showClose: _angular_core.Signal<boolean>;
|
|
1011
1574
|
/** Resolved showArrow - input takes precedence over config. */
|
|
@@ -1068,7 +1631,7 @@ declare class CngxPopoverPanel implements CngxPopoverArrowBounds {
|
|
|
1068
1631
|
private autoDismissTimer;
|
|
1069
1632
|
constructor();
|
|
1070
1633
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<CngxPopoverPanel, never>;
|
|
1071
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxPopoverPanel, "cngx-popover-panel", ["cngxPopoverPanel"], { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "showCloseInput": { "alias": "showClose"; "required": false; "isSignal": true; }; "showArrowInput": { "alias": "showArrow"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "empty": { "alias": "empty"; "required": false; "isSignal": true; }; }, {}, ["headerSlot", "footerSlot", "closeTpl", "loadingTpl", "emptyTpl", "errorTpl", "arrowTplDirective"], ["[cngxPopoverHeader]", "[cngxPopoverBody]", "*", "[cngxPopoverFooter]"], true, [{ directive: typeof CngxPopover; inputs: { "placement": "placement"; "positionTryFallbacks": "positionTryFallbacks"; "offset": "offset"; "closeOnEscape": "closeOnEscape"; "mode": "mode"; "exclusive": "exclusive"; "cngxPopoverOpen": "cngxPopoverOpen"; }; outputs: {}; }]>;
|
|
1634
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<CngxPopoverPanel, "cngx-popover-panel", ["cngxPopoverPanel"], { "variant": { "alias": "variant"; "required": false; "isSignal": true; }; "role": { "alias": "role"; "required": false; "isSignal": true; }; "showCloseInput": { "alias": "showClose"; "required": false; "isSignal": true; }; "showArrowInput": { "alias": "showArrow"; "required": false; "isSignal": true; }; "state": { "alias": "state"; "required": false; "isSignal": true; }; "loading": { "alias": "loading"; "required": false; "isSignal": true; }; "error": { "alias": "error"; "required": false; "isSignal": true; }; "empty": { "alias": "empty"; "required": false; "isSignal": true; }; }, {}, ["headerSlot", "footerSlot", "closeTpl", "loadingTpl", "emptyTpl", "errorTpl", "arrowTplDirective"], ["[cngxPopoverHeader]", "[cngxPopoverBody]", "*", "[cngxPopoverFooter]"], true, [{ directive: typeof CngxPopover; inputs: { "placement": "placement"; "positionTryFallbacks": "positionTryFallbacks"; "offset": "offset"; "closeOnEscape": "closeOnEscape"; "closeOnOutsideClick": "closeOnOutsideClick"; "mode": "mode"; "exclusive": "exclusive"; "cngxPopoverOpen": "cngxPopoverOpen"; }; outputs: {}; }]>;
|
|
1072
1635
|
}
|
|
1073
1636
|
|
|
1074
1637
|
/**
|
|
@@ -1199,5 +1762,5 @@ declare class CngxPopoverDivider {
|
|
|
1199
1762
|
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<CngxPopoverDivider, "[cngxPopoverDivider]", ["cngxPopoverDivider"], {}, {}, never, never, true, [{ directive: typeof i1$1.CngxDivider; inputs: { "orientation": "orientation"; "inset": "inset"; }; outputs: {}; }]>;
|
|
1200
1763
|
}
|
|
1201
1764
|
|
|
1202
|
-
export { CNGX_FLOATING_FALLBACK, CNGX_POPOVER_ARROW_BOUNDS, CNGX_POPOVER_PANEL_CONFIG, CngxPopover, CngxPopoverAction, CngxPopoverArrow, CngxPopoverBody, CngxPopoverClose, CngxPopoverDivider, CngxPopoverEmpty, CngxPopoverError, CngxPopoverFooter, CngxPopoverHeader, CngxPopoverLoading, CngxPopoverPanel, CngxPopoverTrigger, CngxTooltip, provideFloatingFallback, providePopoverPanel, withArrow, withArrowTemplate, withAutoDismiss, withCloseButton, withCloseOnSuccess, withDefaultVariant };
|
|
1203
|
-
export type { ArrowEdge, CngxPopoverArrowBounds, CngxPopoverArrowContext, CngxPopoverPanelConfig, ComputePositionFn, FloatingFallbackConfig, PopoverActionVariant, PopoverHaspopup, PopoverMode, PopoverPanelFeature, PopoverPanelRole, PopoverPlacement, PopoverPositionTryFallback, PopoverState, TooltipTriggerMode };
|
|
1765
|
+
export { CNGX_FLOATING_FALLBACK, CNGX_POPOVER_ARROW_BOUNDS, CNGX_POPOVER_LANGUAGE_EN, CNGX_POPOVER_PANEL_CONFIG, CngxPopover, CngxPopoverAction, CngxPopoverAnchor, CngxPopoverArrow, CngxPopoverBody, CngxPopoverClose, CngxPopoverDivider, CngxPopoverEmpty, CngxPopoverError, CngxPopoverFooter, CngxPopoverHeader, CngxPopoverLoading, CngxPopoverPanel, CngxPopoverSheet, CngxPopoverSheetHandle, CngxPopoverSheetHeader, CngxPopoverSheetInitialFocus, CngxPopoverSheetTitle, CngxPopoverTrigger, CngxTooltip, provideFloatingFallback, providePopoverPanel, withArrow, withArrowTemplate, withAutoDismiss, withCloseButton, withCloseOnSuccess, withDefaultVariant, withPopoverPanelLabels };
|
|
1766
|
+
export type { ArrowEdge, CngxPopoverArrowBounds, CngxPopoverArrowContext, CngxPopoverLanguageSection, CngxPopoverPanelConfig, CngxPopoverPanelLabels, CngxPopoverPresentation, CngxPopoverPresentationRequest, CngxPopoverSheetCloseReason, ComputePositionFn, FloatingFallbackConfig, PopoverActionVariant, PopoverHaspopup, PopoverMode, PopoverPanelFeature, PopoverPanelRole, PopoverPlacement, PopoverPositionTryFallback, PopoverState, TooltipTriggerMode };
|