@truenas/ui-components 0.2.2 → 0.2.4

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@truenas/ui-components",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "access": "public"
@@ -603,6 +603,21 @@ tn-dialog-shell {
603
603
  gap: 16px;
604
604
  }
605
605
 
606
+ /* Hide a content section / actions footer that has nothing to show, so it
607
+ doesn't render as an empty bordered, padded bar.
608
+ - `:empty` covers dialogs that project nothing into the slot (the ng-content
609
+ comment anchor is ignored by `:empty`, but real text/elements are not).
610
+ - The `--hidden` modifier (driven by the [hideContent]/[hideActions] inputs)
611
+ covers slots that always project a wrapper element whose contents are
612
+ conditional, so the slot is never truly `:empty`.
613
+ Declared after the layout rules above so it wins on equal specificity. */
614
+ .tn-dialog__content:empty,
615
+ .tn-dialog__content--hidden,
616
+ .tn-dialog__actions:empty,
617
+ .tn-dialog__actions--hidden {
618
+ display: none;
619
+ }
620
+
606
621
  /* Destructive variant */
607
622
  .tn-dialog--destructive .tn-dialog__header {
608
623
  border-bottom-color: var(--tn-lines, #e5e7eb);
@@ -3394,7 +3394,18 @@ declare class TnFormFieldComponent implements AfterContentInit {
3394
3394
  required: _angular_core.InputSignal<boolean>;
3395
3395
  testId: _angular_core.InputSignal<TnTestIdValue>;
3396
3396
  subscriptSizing: _angular_core.InputSignal<SubscriptSizing>;
3397
- /** Optional tooltip shown via a help icon next to the label. */
3397
+ /**
3398
+ * Optional tooltip shown via a help icon.
3399
+ *
3400
+ * With a `label`, the icon renders next to the label in the label row. Without
3401
+ * one, the icon renders inline after the projected control instead — for
3402
+ * controls that carry their own label (e.g. `tn-checkbox`), where a detached
3403
+ * icon row above the control would look orphaned.
3404
+ *
3405
+ * Inline mode targets compact, self-labeled controls: the wrapper becomes a
3406
+ * flex row, so a full-width control (e.g. a label-less `tn-input`) would
3407
+ * shrink toward its content width. Give such fields a `label` instead.
3408
+ */
3398
3409
  tooltip: _angular_core.InputSignal<string>;
3399
3410
  /** Placement of the tooltip relative to its help icon. */
3400
3411
  tooltipPosition: _angular_core.InputSignal<TooltipPosition>;
@@ -3422,10 +3433,24 @@ declare class TnFormFieldComponent implements AfterContentInit {
3422
3433
  /**
3423
3434
  * Whether the required indicator renders: forced via the `required` input, or
3424
3435
  * inferred from the projected control's validators (mirrors Angular Material's
3425
- * `hasValidator(Validators.required)` approach reference equality, so composed
3426
- * or custom required-like validators need the explicit input).
3436
+ * `hasValidator(Validators.required)` approach, extended to `requiredTrue` for
3437
+ * boolean controls — reference equality, so composed or custom required-like
3438
+ * validators need the explicit input).
3427
3439
  */
3428
3440
  protected showRequired: _angular_core.Signal<boolean>;
3441
+ /**
3442
+ * Whether the tooltip icon renders inline after the projected control rather
3443
+ * than in the label row — true when a tooltip is set but no label is.
3444
+ */
3445
+ protected showInlineTooltip: _angular_core.Signal<boolean>;
3446
+ /**
3447
+ * Whether the required indicator renders inline after the projected control —
3448
+ * with no label there is no label row to host the asterisk, so a required
3449
+ * self-labeled control (e.g. a consent `tn-checkbox`) still gets one.
3450
+ */
3451
+ protected showInlineRequired: _angular_core.Signal<boolean>;
3452
+ /** Whether the wrapper hosts any inline extras and lays out as a flex row. */
3453
+ protected showInlineExtras: _angular_core.Signal<boolean>;
3429
3454
  protected hasError: _angular_core.Signal<boolean>;
3430
3455
  protected errorMessage: _angular_core.Signal<string>;
3431
3456
  ngAfterContentInit(): void;
@@ -3629,6 +3654,19 @@ declare class TnFormFieldHarness extends ComponentHarness {
3629
3654
  * ```
3630
3655
  */
3631
3656
  getTooltip(): Promise<string | null>;
3657
+ /**
3658
+ * Checks whether the tooltip help icon renders inline after the projected
3659
+ * control (label-less mode) rather than in the label row.
3660
+ *
3661
+ * @returns Promise resolving to true if the inline tooltip trigger is present.
3662
+ *
3663
+ * @example
3664
+ * ```typescript
3665
+ * const field = await loader.getHarness(TnFormFieldHarness.with({ testId: 'enable-fxp' }));
3666
+ * expect(await field.isTooltipInline()).toBe(true);
3667
+ * ```
3668
+ */
3669
+ isTooltipInline(): Promise<boolean>;
3632
3670
  /**
3633
3671
  * Checks whether the form field is marked as required.
3634
3672
  *
@@ -6506,6 +6544,22 @@ declare class TnDialog {
6506
6544
  declare class TnDialogShellComponent implements OnInit {
6507
6545
  title: _angular_core.InputSignal<string>;
6508
6546
  showFullscreenButton: _angular_core.InputSignal<boolean>;
6547
+ /**
6548
+ * Show the header close (X) button. Disable for dialogs that must not be
6549
+ * dismissed from the chrome — e.g. a running job that can only be minimized.
6550
+ */
6551
+ showCloseButton: _angular_core.InputSignal<boolean>;
6552
+ /**
6553
+ * Hide the content section. Use when the body is projected through an
6554
+ * always-present wrapper whose contents are conditional, so the section is
6555
+ * never truly `:empty` (consumers cannot project from inside an `@if`, see
6556
+ * the dialog docs). An empty section with no wrapper is hidden automatically
6557
+ * via the `:empty` rule in the theme, so this input is only needed for the
6558
+ * wrapper case.
6559
+ */
6560
+ hideContent: _angular_core.InputSignal<boolean>;
6561
+ /** Hide the actions footer. Same wrapper-case rationale as {@link hideContent}. */
6562
+ hideActions: _angular_core.InputSignal<boolean>;
6509
6563
  /**
6510
6564
  * Optional semantic base that scopes the shell's chrome buttons. The close
6511
6565
  * and fullscreen buttons emit `button-close` / `button-fullscreen` by default,
@@ -6547,7 +6601,7 @@ declare class TnDialogShellComponent implements OnInit {
6547
6601
  private enterFullscreen;
6548
6602
  private exitFullscreen;
6549
6603
  static ɵfac: _angular_core.ɵɵFactoryDeclaration<TnDialogShellComponent, never>;
6550
- static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnDialogShellComponent, "tn-dialog-shell", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "showFullscreenButton": { "alias": "showFullscreenButton"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[tnDialogAction]"], true, never>;
6604
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<TnDialogShellComponent, "tn-dialog-shell", never, { "title": { "alias": "title"; "required": false; "isSignal": true; }; "showFullscreenButton": { "alias": "showFullscreenButton"; "required": false; "isSignal": true; }; "showCloseButton": { "alias": "showCloseButton"; "required": false; "isSignal": true; }; "hideContent": { "alias": "hideContent"; "required": false; "isSignal": true; }; "hideActions": { "alias": "hideActions"; "required": false; "isSignal": true; }; "testId": { "alias": "testId"; "required": false; "isSignal": true; }; }, {}, never, ["*", "[tnDialogAction]"], true, never>;
6551
6605
  }
6552
6606
 
6553
6607
  /**