@truenas/ui-components 0.1.60 → 0.1.61
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
package/src/styles/themes.css
CHANGED
|
@@ -591,10 +591,16 @@ tn-dialog-shell {
|
|
|
591
591
|
border-top: 1px solid var(--tn-lines, #e5e7eb);
|
|
592
592
|
display: flex;
|
|
593
593
|
justify-content: flex-end;
|
|
594
|
+
gap: 16px;
|
|
594
595
|
}
|
|
595
596
|
|
|
596
|
-
|
|
597
|
-
|
|
597
|
+
/* Buttons are projected inside a [tnDialogAction] wrapper, so the gap must
|
|
598
|
+
live on the wrapper to separate them — the footer gap only spaces the
|
|
599
|
+
wrapper itself. */
|
|
600
|
+
.tn-dialog__actions [tnDialogAction] {
|
|
601
|
+
display: flex;
|
|
602
|
+
align-items: center;
|
|
603
|
+
gap: 16px;
|
|
598
604
|
}
|
|
599
605
|
|
|
600
606
|
/* Destructive variant */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as _angular_core from '@angular/core';
|
|
2
|
-
import { ElementRef, OnDestroy, AfterViewInit, TemplateRef, AfterContentInit, Provider, ChangeDetectorRef,
|
|
2
|
+
import { ElementRef, OnDestroy, AfterViewInit, OnInit, TemplateRef, AfterContentInit, Provider, ChangeDetectorRef, InjectionToken, Signal, PipeTransform, ViewContainerRef, AfterViewChecked, ComponentRef } from '@angular/core';
|
|
3
3
|
import { ControlValueAccessor, NgControl } from '@angular/forms';
|
|
4
4
|
import { ComponentHarness, BaseHarnessFilters, HarnessPredicate, HarnessLoader } from '@angular/cdk/testing';
|
|
5
5
|
import { SafeHtml, SafeResourceUrl, DomSanitizer } from '@angular/platform-browser';
|
|
@@ -717,9 +717,60 @@ declare class TnIconComponent {
|
|
|
717
717
|
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnIconComponent, "tn-icon", never, { "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "library": { "alias": "library"; "required": false; "isSignal": true; }; "fullSize": { "alias": "fullSize"; "required": false; "isSignal": true; }; "customSize": { "alias": "customSize"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
718
718
|
}
|
|
719
719
|
|
|
720
|
+
type TooltipPosition = 'above' | 'below' | 'left' | 'right' | 'before' | 'after';
|
|
721
|
+
declare class TnTooltipDirective implements OnInit, OnDestroy {
|
|
722
|
+
message: _angular_core.InputSignal<string>;
|
|
723
|
+
position: _angular_core.InputSignal<TooltipPosition>;
|
|
724
|
+
disabled: _angular_core.InputSignal<boolean>;
|
|
725
|
+
showDelay: _angular_core.InputSignal<number>;
|
|
726
|
+
hideDelay: _angular_core.InputSignal<number>;
|
|
727
|
+
tooltipClass: _angular_core.InputSignal<string>;
|
|
728
|
+
private _overlayRef;
|
|
729
|
+
private _tooltipInstance;
|
|
730
|
+
private _showTimeout;
|
|
731
|
+
private _hideTimeout;
|
|
732
|
+
private _isTooltipVisible;
|
|
733
|
+
private _positionSub;
|
|
734
|
+
private _tooltipId;
|
|
735
|
+
/**
|
|
736
|
+
* Only point `aria-describedby` at the tooltip when there is actually a message to
|
|
737
|
+
* describe. Otherwise every host (e.g. an icon button with no tooltip) would carry a
|
|
738
|
+
* dangling reference to a tooltip element that is never rendered.
|
|
739
|
+
*/
|
|
740
|
+
protected get _ariaDescribedBy(): string | null;
|
|
741
|
+
private _overlay;
|
|
742
|
+
private _elementRef;
|
|
743
|
+
private _viewContainerRef;
|
|
744
|
+
private _overlayPositionBuilder;
|
|
745
|
+
ngOnInit(): void;
|
|
746
|
+
ngOnDestroy(): void;
|
|
747
|
+
_onMouseEnter(): void;
|
|
748
|
+
_onMouseLeave(): void;
|
|
749
|
+
_onFocus(): void;
|
|
750
|
+
_onBlur(): void;
|
|
751
|
+
_onKeydown(event: KeyboardEvent): void;
|
|
752
|
+
/** Shows the tooltip */
|
|
753
|
+
show(delay?: number): void;
|
|
754
|
+
/** Hides the tooltip */
|
|
755
|
+
hide(delay?: number): void;
|
|
756
|
+
/** Toggle the tooltip visibility */
|
|
757
|
+
toggle(): void;
|
|
758
|
+
private _createOverlay;
|
|
759
|
+
private _resolvePosition;
|
|
760
|
+
private _attachTooltip;
|
|
761
|
+
private _getPositions;
|
|
762
|
+
private _clearTimeouts;
|
|
763
|
+
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TnTooltipDirective, never>;
|
|
764
|
+
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TnTooltipDirective, "[tnTooltip]", never, { "message": { "alias": "tnTooltip"; "required": false; "isSignal": true; }; "position": { "alias": "tnTooltipPosition"; "required": false; "isSignal": true; }; "disabled": { "alias": "tnTooltipDisabled"; "required": false; "isSignal": true; }; "showDelay": { "alias": "tnTooltipShowDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "tnTooltipHideDelay"; "required": false; "isSignal": true; }; "tooltipClass": { "alias": "tnTooltipClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
765
|
+
}
|
|
766
|
+
|
|
720
767
|
declare class TnIconButtonComponent implements AfterViewInit {
|
|
721
768
|
disabled: _angular_core.InputSignal<boolean>;
|
|
769
|
+
/** Compact variant with reduced padding, for dense contexts like toolbars. */
|
|
770
|
+
dense: _angular_core.InputSignal<boolean>;
|
|
722
771
|
ariaLabel: _angular_core.InputSignal<string | undefined>;
|
|
772
|
+
/** Reflects an expanded/collapsed state (e.g. toggling a panel) onto the inner button. */
|
|
773
|
+
ariaExpanded: _angular_core.InputSignal<boolean | undefined>;
|
|
723
774
|
/**
|
|
724
775
|
* Test-id applied to the rendered `<button>` element. Rendered under whichever attribute
|
|
725
776
|
* name is configured via `TN_TEST_ATTR` (default `data-testid`).
|
|
@@ -729,7 +780,11 @@ declare class TnIconButtonComponent implements AfterViewInit {
|
|
|
729
780
|
size: _angular_core.InputSignal<IconSize>;
|
|
730
781
|
color: _angular_core.InputSignal<string | undefined>;
|
|
731
782
|
tooltip: _angular_core.InputSignal<string | undefined>;
|
|
783
|
+
/** Position of the styled tooltip relative to the button. */
|
|
784
|
+
tooltipPosition: _angular_core.InputSignal<TooltipPosition>;
|
|
732
785
|
library: _angular_core.InputSignal<IconLibraryType | undefined>;
|
|
786
|
+
/** Extra class(es) applied to the inner icon, e.g. for animations or state colors. */
|
|
787
|
+
iconClass: _angular_core.InputSignal<string>;
|
|
733
788
|
onClick: _angular_core.OutputEmitterRef<MouseEvent>;
|
|
734
789
|
private hostRef;
|
|
735
790
|
private buttonRef;
|
|
@@ -743,7 +798,7 @@ declare class TnIconButtonComponent implements AfterViewInit {
|
|
|
743
798
|
focus(options?: FocusOptions): void;
|
|
744
799
|
ngAfterViewInit(): void;
|
|
745
800
|
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TnIconButtonComponent, never>;
|
|
746
|
-
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnIconButtonComponent, "tn-icon-button", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "library": { "alias": "library"; "required": false; "isSignal": true; }; }, { "onClick": "onClick"; }, never,
|
|
801
|
+
static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnIconButtonComponent, "tn-icon-button", never, { "disabled": { "alias": "disabled"; "required": false; "isSignal": true; }; "dense": { "alias": "dense"; "required": false; "isSignal": true; }; "ariaLabel": { "alias": "ariaLabel"; "required": false; "isSignal": true; }; "ariaExpanded": { "alias": "ariaExpanded"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; "name": { "alias": "name"; "required": false; "isSignal": true; }; "size": { "alias": "size"; "required": false; "isSignal": true; }; "color": { "alias": "color"; "required": false; "isSignal": true; }; "tooltip": { "alias": "tooltip"; "required": false; "isSignal": true; }; "tooltipPosition": { "alias": "tooltipPosition"; "required": false; "isSignal": true; }; "library": { "alias": "library"; "required": false; "isSignal": true; }; "iconClass": { "alias": "iconClass"; "required": false; "isSignal": true; }; }, { "onClick": "onClick"; }, never, ["*"], true, never>;
|
|
747
802
|
}
|
|
748
803
|
|
|
749
804
|
/**
|
|
@@ -2000,7 +2055,7 @@ interface RadioHarnessFilters extends BaseHarnessFilters {
|
|
|
2000
2055
|
type SlideToggleColor = 'primary' | 'accent' | 'warn';
|
|
2001
2056
|
declare class TnSlideToggleComponent implements AfterViewInit, OnDestroy, ControlValueAccessor {
|
|
2002
2057
|
toggleEl: _angular_core.Signal<ElementRef<HTMLInputElement>>;
|
|
2003
|
-
labelPosition: _angular_core.InputSignal<"
|
|
2058
|
+
labelPosition: _angular_core.InputSignal<"before" | "after">;
|
|
2004
2059
|
label: _angular_core.InputSignal<string | undefined>;
|
|
2005
2060
|
disabled: _angular_core.InputSignal<boolean>;
|
|
2006
2061
|
required: _angular_core.InputSignal<boolean>;
|
|
@@ -2165,7 +2220,7 @@ declare class TnTabsComponent implements AfterContentInit, AfterViewInit, OnDest
|
|
|
2165
2220
|
tabHeader: _angular_core.Signal<ElementRef<HTMLElement>>;
|
|
2166
2221
|
selectedIndex: _angular_core.InputSignal<number>;
|
|
2167
2222
|
orientation: _angular_core.InputSignal<"horizontal" | "vertical">;
|
|
2168
|
-
highlightPosition: _angular_core.InputSignal<"
|
|
2223
|
+
highlightPosition: _angular_core.InputSignal<"left" | "right" | "top" | "bottom">;
|
|
2169
2224
|
/**
|
|
2170
2225
|
* Test-id applied to the tablist root element. Rendered under whichever attribute name
|
|
2171
2226
|
* is configured via `TN_TEST_ATTR` (default `data-testid`).
|
|
@@ -2563,7 +2618,7 @@ interface TabsHarnessFilters extends BaseHarnessFilters {
|
|
|
2563
2618
|
*/
|
|
2564
2619
|
declare class TnMenuTriggerDirective implements OnDestroy {
|
|
2565
2620
|
menu: _angular_core.InputSignal<TnMenuComponent>;
|
|
2566
|
-
tnMenuPosition: _angular_core.InputSignal<"
|
|
2621
|
+
tnMenuPosition: _angular_core.InputSignal<"above" | "below" | "before" | "after">;
|
|
2567
2622
|
private overlayRef?;
|
|
2568
2623
|
private isMenuOpen;
|
|
2569
2624
|
private itemClickSub?;
|
|
@@ -5674,47 +5729,6 @@ interface ButtonToggleHarnessFilters extends BaseHarnessFilters {
|
|
|
5674
5729
|
label?: string | RegExp;
|
|
5675
5730
|
}
|
|
5676
5731
|
|
|
5677
|
-
type TooltipPosition = 'above' | 'below' | 'left' | 'right' | 'before' | 'after';
|
|
5678
|
-
declare class TnTooltipDirective implements OnInit, OnDestroy {
|
|
5679
|
-
message: _angular_core.InputSignal<string>;
|
|
5680
|
-
position: _angular_core.InputSignal<TooltipPosition>;
|
|
5681
|
-
disabled: _angular_core.InputSignal<boolean>;
|
|
5682
|
-
showDelay: _angular_core.InputSignal<number>;
|
|
5683
|
-
hideDelay: _angular_core.InputSignal<number>;
|
|
5684
|
-
tooltipClass: _angular_core.InputSignal<string>;
|
|
5685
|
-
private _overlayRef;
|
|
5686
|
-
private _tooltipInstance;
|
|
5687
|
-
private _showTimeout;
|
|
5688
|
-
private _hideTimeout;
|
|
5689
|
-
private _isTooltipVisible;
|
|
5690
|
-
private _positionSub;
|
|
5691
|
-
protected _ariaDescribedBy: string | null;
|
|
5692
|
-
private _overlay;
|
|
5693
|
-
private _elementRef;
|
|
5694
|
-
private _viewContainerRef;
|
|
5695
|
-
private _overlayPositionBuilder;
|
|
5696
|
-
ngOnInit(): void;
|
|
5697
|
-
ngOnDestroy(): void;
|
|
5698
|
-
_onMouseEnter(): void;
|
|
5699
|
-
_onMouseLeave(): void;
|
|
5700
|
-
_onFocus(): void;
|
|
5701
|
-
_onBlur(): void;
|
|
5702
|
-
_onKeydown(event: KeyboardEvent): void;
|
|
5703
|
-
/** Shows the tooltip */
|
|
5704
|
-
show(delay?: number): void;
|
|
5705
|
-
/** Hides the tooltip */
|
|
5706
|
-
hide(delay?: number): void;
|
|
5707
|
-
/** Toggle the tooltip visibility */
|
|
5708
|
-
toggle(): void;
|
|
5709
|
-
private _createOverlay;
|
|
5710
|
-
private _resolvePosition;
|
|
5711
|
-
private _attachTooltip;
|
|
5712
|
-
private _getPositions;
|
|
5713
|
-
private _clearTimeouts;
|
|
5714
|
-
static ɵfac: _angular_core.ɵɵFactoryDeclaration<TnTooltipDirective, never>;
|
|
5715
|
-
static ɵdir: _angular_core.ɵɵDirectiveDeclaration<TnTooltipDirective, "[tnTooltip]", never, { "message": { "alias": "tnTooltip"; "required": false; "isSignal": true; }; "position": { "alias": "tnTooltipPosition"; "required": false; "isSignal": true; }; "disabled": { "alias": "tnTooltipDisabled"; "required": false; "isSignal": true; }; "showDelay": { "alias": "tnTooltipShowDelay"; "required": false; "isSignal": true; }; "hideDelay": { "alias": "tnTooltipHideDelay"; "required": false; "isSignal": true; }; "tooltipClass": { "alias": "tnTooltipClass"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
5716
|
-
}
|
|
5717
|
-
|
|
5718
5732
|
declare class TnTooltipComponent {
|
|
5719
5733
|
message: _angular_core.InputSignal<string>;
|
|
5720
5734
|
id: _angular_core.InputSignal<string>;
|
|
@@ -5762,11 +5776,15 @@ declare class TnDialog {
|
|
|
5762
5776
|
declare class TnDialogShellComponent implements OnInit {
|
|
5763
5777
|
title: _angular_core.InputSignal<string>;
|
|
5764
5778
|
showFullscreenButton: _angular_core.InputSignal<boolean>;
|
|
5779
|
+
/** Stable id for the title heading, referenced by the dialog's aria-labelledby. */
|
|
5780
|
+
readonly titleId: string;
|
|
5765
5781
|
isFullscreen: _angular_core.WritableSignal<boolean>;
|
|
5766
5782
|
private originalStyles;
|
|
5767
5783
|
private ref;
|
|
5768
5784
|
private document;
|
|
5785
|
+
private host;
|
|
5769
5786
|
private data;
|
|
5787
|
+
constructor();
|
|
5770
5788
|
ngOnInit(): void;
|
|
5771
5789
|
close(result?: unknown): void;
|
|
5772
5790
|
toggleFullscreen(): void;
|
|
@@ -5874,6 +5892,20 @@ declare class TnDialogHarness extends ComponentHarness {
|
|
|
5874
5892
|
* ```
|
|
5875
5893
|
*/
|
|
5876
5894
|
close(): Promise<void>;
|
|
5895
|
+
/**
|
|
5896
|
+
* Gets the `tabindex` attribute of the close button, or null if unset.
|
|
5897
|
+
* A null/non-negative value means the button is reachable via the Tab key.
|
|
5898
|
+
*
|
|
5899
|
+
* @returns Promise resolving to the tabindex attribute value.
|
|
5900
|
+
*/
|
|
5901
|
+
getCloseButtonTabIndex(): Promise<string | null>;
|
|
5902
|
+
/**
|
|
5903
|
+
* Gets the `tabindex` attribute of the fullscreen button, or null if unset
|
|
5904
|
+
* or if the dialog has no fullscreen button.
|
|
5905
|
+
*
|
|
5906
|
+
* @returns Promise resolving to the tabindex attribute value.
|
|
5907
|
+
*/
|
|
5908
|
+
getFullscreenButtonTabIndex(): Promise<string | null>;
|
|
5877
5909
|
/**
|
|
5878
5910
|
* Clicks an action button in the dialog footer by its label.
|
|
5879
5911
|
* Only matches buttons inside the `tnDialogAction` footer area, not buttons in content.
|
|
@@ -6405,11 +6437,18 @@ interface TnToastConfig {
|
|
|
6405
6437
|
type?: TnToastType;
|
|
6406
6438
|
/** Vertical position. Default: TnToastPosition.Top. */
|
|
6407
6439
|
position?: TnToastPosition;
|
|
6440
|
+
/**
|
|
6441
|
+
* Test id applied to the action button. Rendered under whichever attribute name is
|
|
6442
|
+
* configured via `TN_TEST_ATTR` (default `data-testid`). Only relevant when an action
|
|
6443
|
+
* is provided.
|
|
6444
|
+
*/
|
|
6445
|
+
actionTestId?: string;
|
|
6408
6446
|
}
|
|
6409
6447
|
|
|
6410
6448
|
declare class TnToastComponent {
|
|
6411
6449
|
message: _angular_core.WritableSignal<string>;
|
|
6412
6450
|
action: _angular_core.WritableSignal<string | null>;
|
|
6451
|
+
actionTestId: _angular_core.WritableSignal<string | undefined>;
|
|
6413
6452
|
type: _angular_core.WritableSignal<TnToastType>;
|
|
6414
6453
|
position: _angular_core.WritableSignal<TnToastPosition>;
|
|
6415
6454
|
visible: _angular_core.WritableSignal<boolean>;
|