@truenas/ui-components 0.7.10 → 0.7.12
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/package.json
CHANGED
|
@@ -562,12 +562,34 @@ declare class TnSelectComponent<T = unknown> implements ControlValueAccessor, On
|
|
|
562
562
|
* - **Enter / Space** opens the dropdown if closed; if open and an option
|
|
563
563
|
* is highlighted, selects that option (in single mode) or toggles it
|
|
564
564
|
* (in multiple mode).
|
|
565
|
-
* - **Escape** closes the dropdown without changing the
|
|
565
|
+
* - **Escape** is NOT here: it closes the dropdown without changing the
|
|
566
|
+
* selection, from `onHostKeydown` on this component's host element,
|
|
567
|
+
* because it also has to consume the key.
|
|
566
568
|
*
|
|
567
569
|
* All navigation keys call `event.preventDefault()` so the page does not
|
|
568
570
|
* scroll while the user is moving through options.
|
|
569
571
|
*/
|
|
570
572
|
onKeydown(event: KeyboardEvent): void;
|
|
573
|
+
/**
|
|
574
|
+
* Escape, which closes the dropdown and CONSUMES the key.
|
|
575
|
+
*
|
|
576
|
+
* Consuming matters because of what is usually underneath: since #322 a
|
|
577
|
+
* `tn-side-panel` is a CDK overlay listening for Escape through
|
|
578
|
+
* `OverlayKeyboardDispatcher`, which delivers to the top-most attached
|
|
579
|
+
* overlay that has subscribers. Closing the dropdown disposes this select's
|
|
580
|
+
* overlay mid-keystroke, taking it out of that stack — so an Escape left to
|
|
581
|
+
* carry on reached `<body>`, found the panel as the new top-most subscriber,
|
|
582
|
+
* and closed the whole form along with the dropdown (#324). A `tn-drawer` in
|
|
583
|
+
* `over` mode has a keydown handler of its own and closed the same way.
|
|
584
|
+
*
|
|
585
|
+
* Why this sits on the HOST rather than beside the other keys on the trigger:
|
|
586
|
+
* `stopPropagation()` stops ANCESTOR listeners, not other listeners on the
|
|
587
|
+
* same element. Called from the trigger it also hid Escape from a `tnTooltip`
|
|
588
|
+
* on this component, which dismisses a visible tooltip from a host listener —
|
|
589
|
+
* so the tooltip stayed up. From here, that directive still sees the key and
|
|
590
|
+
* only the containers ABOVE this select stop seeing it.
|
|
591
|
+
*/
|
|
592
|
+
protected onHostKeydown(event: KeyboardEvent): void;
|
|
571
593
|
private moveFocus;
|
|
572
594
|
private activateFocusedOption;
|
|
573
595
|
private scrollFocusedIntoView;
|
|
@@ -1146,6 +1168,31 @@ declare class TnAutocompleteComponent<T = unknown> implements ControlValueAccess
|
|
|
1146
1168
|
*/
|
|
1147
1169
|
private runAction;
|
|
1148
1170
|
onKeydown(event: KeyboardEvent): void;
|
|
1171
|
+
/**
|
|
1172
|
+
* Escape, which cancels the draft, dismisses the panel, and — while the panel
|
|
1173
|
+
* is open — CONSUMES the key.
|
|
1174
|
+
*
|
|
1175
|
+
* Consuming matters because of what is usually underneath: since #322 a
|
|
1176
|
+
* `tn-side-panel` is a CDK overlay listening for Escape through
|
|
1177
|
+
* `OverlayKeyboardDispatcher`, which delivers to the top-most attached
|
|
1178
|
+
* overlay that has subscribers. Dismissing disposes this panel's overlay
|
|
1179
|
+
* mid-keystroke, taking it out of that stack — so an Escape left to carry on
|
|
1180
|
+
* reached `<body>`, found the side panel as the new top-most subscriber, and
|
|
1181
|
+
* closed the whole form along with the panel (#324). A `tn-drawer` in `over`
|
|
1182
|
+
* mode has a keydown handler of its own and closed the same way.
|
|
1183
|
+
*
|
|
1184
|
+
* With the panel already closed the key is NOT consumed: there is nothing to
|
|
1185
|
+
* dismiss and it belongs to whatever contains this field. The draft still
|
|
1186
|
+
* reverts, which is what the blur that follows would otherwise commit.
|
|
1187
|
+
*
|
|
1188
|
+
* Why this sits on the HOST rather than beside the other keys on the input:
|
|
1189
|
+
* `stopPropagation()` stops ANCESTOR listeners, not other listeners on the
|
|
1190
|
+
* same element. Called from the input it also hid Escape from a `tnTooltip`
|
|
1191
|
+
* on this component, which dismisses a visible tooltip from a host listener —
|
|
1192
|
+
* so the tooltip stayed up. From here, that directive still sees the key and
|
|
1193
|
+
* only the containers ABOVE this field stop seeing it.
|
|
1194
|
+
*/
|
|
1195
|
+
protected onHostKeydown(event: KeyboardEvent): void;
|
|
1149
1196
|
/**
|
|
1150
1197
|
* `loadMore` normally fires from a scroll event, which never happens when
|
|
1151
1198
|
* the current page is too short to overflow the panel — pagination would
|
|
@@ -1264,6 +1311,13 @@ declare class TnAutocompleteComponent<T = unknown> implements ControlValueAccess
|
|
|
1264
1311
|
* matches its width to the input. Mirrors TnSelectComponent's approach.
|
|
1265
1312
|
*/
|
|
1266
1313
|
private attachOverlay;
|
|
1314
|
+
/**
|
|
1315
|
+
* Escape's effect on this field: cancel the draft, then close.
|
|
1316
|
+
*
|
|
1317
|
+
* Shared by the overlay subscription above and `onHostKeydown`, which is
|
|
1318
|
+
* where Escape arrives while focus is in the field — open panel or closed.
|
|
1319
|
+
*/
|
|
1320
|
+
private dismiss;
|
|
1267
1321
|
private detachOverlay;
|
|
1268
1322
|
private scrollToHighlighted;
|
|
1269
1323
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TnAutocompleteComponent<any>, never>;
|
|
@@ -4389,6 +4443,29 @@ declare class TnChipInputComponent<T = string> implements ControlValueAccessor,
|
|
|
4389
4443
|
protected onFocus(): void;
|
|
4390
4444
|
protected onBlur(): void;
|
|
4391
4445
|
protected onKeydown(event: KeyboardEvent): void;
|
|
4446
|
+
/**
|
|
4447
|
+
* Escape, which dismisses the suggestion panel and CONSUMES the key.
|
|
4448
|
+
*
|
|
4449
|
+
* Consuming matters because of what is usually underneath: since #322 a
|
|
4450
|
+
* `tn-side-panel` is a CDK overlay listening for Escape through
|
|
4451
|
+
* `OverlayKeyboardDispatcher`, which delivers to the top-most attached
|
|
4452
|
+
* overlay that has subscribers. Dismissing disposes this panel's overlay
|
|
4453
|
+
* mid-keystroke, taking it out of that stack — so an Escape left to carry on
|
|
4454
|
+
* reached `<body>`, found the side panel as the new top-most subscriber, and
|
|
4455
|
+
* closed the whole form along with the panel (#324). A `tn-drawer` in `over`
|
|
4456
|
+
* mode has a keydown handler of its own and closed the same way.
|
|
4457
|
+
*
|
|
4458
|
+
* With the panel already closed nothing happens here and the key belongs to
|
|
4459
|
+
* whatever contains this field — which is what it did before #324 too.
|
|
4460
|
+
*
|
|
4461
|
+
* Why this sits on the HOST rather than beside the other keys on the input:
|
|
4462
|
+
* `stopPropagation()` stops ANCESTOR listeners, not other listeners on the
|
|
4463
|
+
* same element. Called from the input it also hid Escape from a `tnTooltip`
|
|
4464
|
+
* on this component, which dismisses a visible tooltip from a host listener —
|
|
4465
|
+
* so the tooltip stayed up. From here, that directive still sees the key and
|
|
4466
|
+
* only the containers ABOVE this field stop seeing it.
|
|
4467
|
+
*/
|
|
4468
|
+
protected onHostKeydown(event: KeyboardEvent): void;
|
|
4392
4469
|
protected onSuggestionClick(option: TnChipInputOption<T>): void;
|
|
4393
4470
|
/** Prevents the option `mousedown` from blurring the input before the click lands. */
|
|
4394
4471
|
protected onSuggestionMousedown(event: MouseEvent): void;
|
|
@@ -4778,6 +4855,7 @@ declare class TnMenuComponent implements OnDestroy {
|
|
|
4778
4855
|
contextMenuTemplate: _angular_core.Signal<TemplateRef<unknown>>;
|
|
4779
4856
|
private contextOverlayRef?;
|
|
4780
4857
|
private contextBackdropSub?;
|
|
4858
|
+
private contextKeydownSub?;
|
|
4781
4859
|
private overlay;
|
|
4782
4860
|
private viewContainerRef;
|
|
4783
4861
|
onMenuItemClick(item: TnMenuItem): void;
|
|
@@ -10268,6 +10346,13 @@ declare class TnTableComponent<T = unknown> implements OnInit {
|
|
|
10268
10346
|
* the next reconcile.
|
|
10269
10347
|
*/
|
|
10270
10348
|
clearSelection(): void;
|
|
10349
|
+
/**
|
|
10350
|
+
* Drops the selection state and tells nobody. Only teardown wants this: by the time
|
|
10351
|
+
* the `onDestroy` hook runs, `selectionChange` is an `OutputRef` Angular has already
|
|
10352
|
+
* destroyed, and emitting on it warns NG0953 in dev mode. Every live path wants
|
|
10353
|
+
* {@link clearSelection}, because a consumer mirroring the selection has to hear it.
|
|
10354
|
+
*/
|
|
10355
|
+
private resetSelectionState;
|
|
10271
10356
|
/** Re-applies the retained selection to the rows currently on screen. */
|
|
10272
10357
|
private syncSelectionToData;
|
|
10273
10358
|
/** What `selectionChange` carries: the whole selection when keyed, the page's otherwise. */
|
|
@@ -12639,6 +12724,25 @@ declare class TnDateRangeInputComponent implements ControlValueAccessor, OnInit,
|
|
|
12639
12724
|
private updateDateFromSegments;
|
|
12640
12725
|
private focusNextSegment;
|
|
12641
12726
|
private focusPrevSegment;
|
|
12727
|
+
/**
|
|
12728
|
+
* Escape, which closes the calendar and CONSUMES the key. Same reasoning as
|
|
12729
|
+
* `TnDateInputComponent.onHostKeydown`, which this mirrors: opening does not
|
|
12730
|
+
* move focus into the overlay, so the real keystroke starts on a date
|
|
12731
|
+
* segment inside this host, where an ancestor such as a `tn-drawer` in
|
|
12732
|
+
* `over` mode would stop it before CDK's keyboard dispatcher ever ran — and
|
|
12733
|
+
* a calendar waiting on the dispatcher stayed open while the drawer closed
|
|
12734
|
+
* underneath it (#324).
|
|
12735
|
+
*
|
|
12736
|
+
* Consuming it also keeps a `tn-side-panel` from acting on the same key: the
|
|
12737
|
+
* panel is a CDK overlay subscribed through that dispatcher (#322), and
|
|
12738
|
+
* closing this calendar disposes its overlay mid-keystroke, leaving the
|
|
12739
|
+
* panel as the top-most subscriber for an Escape allowed to carry on.
|
|
12740
|
+
*
|
|
12741
|
+
* Closed, the key is not consumed; it belongs to whatever contains this
|
|
12742
|
+
* field. On the HOST rather than the segments so that `stopPropagation()`
|
|
12743
|
+
* still leaves a `tnTooltip` on this component able to see the key.
|
|
12744
|
+
*/
|
|
12745
|
+
protected onHostKeydown(event: KeyboardEvent): void;
|
|
12642
12746
|
openDatepicker(): void;
|
|
12643
12747
|
close(): void;
|
|
12644
12748
|
private createOverlay;
|
|
@@ -13404,6 +13508,34 @@ declare class TnDateInputComponent implements ControlValueAccessor, OnInit, OnDe
|
|
|
13404
13508
|
private updateDateFromSegments;
|
|
13405
13509
|
private focusNextSegment;
|
|
13406
13510
|
private focusPrevSegment;
|
|
13511
|
+
/**
|
|
13512
|
+
* Escape, which closes the calendar and CONSUMES the key.
|
|
13513
|
+
*
|
|
13514
|
+
* Opening the calendar does not move focus into it, so the keystroke a user
|
|
13515
|
+
* actually makes starts on a date segment — inside this host, not inside the
|
|
13516
|
+
* overlay. That is the path the `keydownEvents()` subscription in
|
|
13517
|
+
* `createOverlay` cannot serve: CDK's `OverlayKeyboardDispatcher` listens on
|
|
13518
|
+
* `<body>`, so any ancestor that stops the key first means it never runs.
|
|
13519
|
+
* `tn-drawer` in `over` mode is exactly such an ancestor — it calls
|
|
13520
|
+
* `stopPropagation()` on Escape from a handler on its own panel element — so
|
|
13521
|
+
* a calendar left waiting for the dispatcher stayed open while the drawer
|
|
13522
|
+
* closed underneath it (#324).
|
|
13523
|
+
*
|
|
13524
|
+
* Consuming it also keeps a `tn-side-panel` from acting on the same key:
|
|
13525
|
+
* since #322 the panel is a CDK overlay subscribed through that dispatcher,
|
|
13526
|
+
* and closing this calendar disposes its overlay mid-keystroke, leaving the
|
|
13527
|
+
* panel as the top-most subscriber for an Escape allowed to carry on.
|
|
13528
|
+
*
|
|
13529
|
+
* With the calendar closed the key is NOT consumed: there is nothing to
|
|
13530
|
+
* close and it belongs to whatever contains this field.
|
|
13531
|
+
*
|
|
13532
|
+
* Why the HOST rather than the segment inputs: `stopPropagation()` stops
|
|
13533
|
+
* ANCESTOR listeners, not other listeners on the same element. From here a
|
|
13534
|
+
* `tnTooltip` on this component still sees Escape and dismisses itself, and
|
|
13535
|
+
* only the containers ABOVE this field stop seeing it — the same placement
|
|
13536
|
+
* `tn-select` and `tn-autocomplete` use.
|
|
13537
|
+
*/
|
|
13538
|
+
protected onHostKeydown(event: KeyboardEvent): void;
|
|
13407
13539
|
openDatepicker(): void;
|
|
13408
13540
|
close(): void;
|
|
13409
13541
|
private createOverlay;
|
|
@@ -15468,6 +15600,35 @@ declare class TnFilePickerComponent implements ControlValueAccessor, OnInit, OnD
|
|
|
15468
15600
|
onPathCommit(event: Event): void;
|
|
15469
15601
|
/** `openOnClick` entry point. */
|
|
15470
15602
|
onInputClick(): void;
|
|
15603
|
+
/**
|
|
15604
|
+
* Escape, which closes the popup and CONSUMES the key.
|
|
15605
|
+
*
|
|
15606
|
+
* Opening the popup does not move focus into it, so the keystroke a user
|
|
15607
|
+
* actually makes starts on the path input — inside this host, not inside the
|
|
15608
|
+
* overlay. That is the path the `keydownEvents()` subscription in
|
|
15609
|
+
* `createOverlay` cannot serve: CDK's `OverlayKeyboardDispatcher` listens on
|
|
15610
|
+
* `<body>`, so any ancestor that stops the key first means it never runs.
|
|
15611
|
+
* `tn-drawer` in `over` mode is exactly such an ancestor — it calls
|
|
15612
|
+
* `stopPropagation()` on Escape from a handler on its own panel element — so
|
|
15613
|
+
* a picker left waiting for the dispatcher stayed open while the drawer
|
|
15614
|
+
* closed underneath it (#324).
|
|
15615
|
+
*
|
|
15616
|
+
* Consuming it also keeps a `tn-side-panel` from acting on the same key:
|
|
15617
|
+
* since #322 the panel is a CDK overlay subscribed through that dispatcher,
|
|
15618
|
+
* and closing this popup disposes its overlay mid-keystroke, leaving the
|
|
15619
|
+
* panel as the top-most subscriber for an Escape allowed to carry on.
|
|
15620
|
+
*
|
|
15621
|
+
* With the popup closed the key is NOT consumed: there is nothing to close
|
|
15622
|
+
* and it belongs to whatever contains this field. The inline-creation row is
|
|
15623
|
+
* unaffected either way — it lives in the popup, whose keydowns never reach
|
|
15624
|
+
* this host.
|
|
15625
|
+
*
|
|
15626
|
+
* Why the HOST rather than the input: `stopPropagation()` stops ANCESTOR
|
|
15627
|
+
* listeners, not other listeners on the same element. From here a `tnTooltip`
|
|
15628
|
+
* on this component still sees Escape and dismisses itself, and only the
|
|
15629
|
+
* containers ABOVE this field stop seeing it.
|
|
15630
|
+
*/
|
|
15631
|
+
protected onHostKeydown(event: KeyboardEvent): void;
|
|
15471
15632
|
openFilePicker(): void;
|
|
15472
15633
|
close(): void;
|
|
15473
15634
|
onItemClick(item: FileSystemItem): void;
|