@truenas/ui-components 0.3.15 → 0.3.16

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.3.15",
3
+ "version": "0.3.16",
4
4
  "publishConfig": {
5
5
  "registry": "https://registry.npmjs.org",
6
6
  "access": "public"
@@ -657,3 +657,102 @@ tn-dialog-shell {
657
657
  box-shadow: none;
658
658
  margin: 0;
659
659
  }
660
+
661
+ /* ================================
662
+ CDK Overlay base styles
663
+ ================================
664
+ Mirrors @angular/cdk/overlay-prebuilt.css. These structural rules are
665
+ REQUIRED for any component built on the CDK connected-position overlay
666
+ (tn-select, tn-autocomplete, tn-tooltip, tn-file-picker, tn-date-input…).
667
+ Consuming apps that only import this themes.css would otherwise never load
668
+ them, with two visible symptoms:
669
+
670
+ 1. pointer-events: none on the overlay container is INHERITED by the
671
+ connected-position bounding box (a flex column anchored to the trigger
672
+ that is typically far wider/taller than the visible panel). Without it
673
+ the bounding box keeps the default `auto` and silently eats clicks in
674
+ the empty area around the panel — so a no-backdrop dropdown like
675
+ tn-select can't be dismissed by clicking "outside" it (the click lands
676
+ on the bounding box, which is technically inside the overlay, so CDK's
677
+ outsidePointerEvents() never fires).
678
+ 2. .cdk-overlay-pane { max-height: 100% } keeps panels constrained to the
679
+ viewport so their internal `overflow-y: auto` regions actually scroll.
680
+
681
+ Only .cdk-overlay-pane re-enables pointer-events: auto, so the panel itself
682
+ stays interactive while everything around it is click-through. */
683
+ .cdk-overlay-container,
684
+ .cdk-global-overlay-wrapper {
685
+ pointer-events: none;
686
+ top: 0;
687
+ left: 0;
688
+ height: 100%;
689
+ width: 100%;
690
+ }
691
+
692
+ .cdk-overlay-container {
693
+ position: fixed;
694
+ z-index: 1000;
695
+ }
696
+
697
+ .cdk-overlay-container:empty {
698
+ display: none;
699
+ }
700
+
701
+ .cdk-global-overlay-wrapper {
702
+ display: flex;
703
+ position: absolute;
704
+ z-index: 1000;
705
+ }
706
+
707
+ .cdk-overlay-pane {
708
+ position: absolute;
709
+ pointer-events: auto;
710
+ box-sizing: border-box;
711
+ display: flex;
712
+ max-width: 100%;
713
+ max-height: 100%;
714
+ z-index: 1000;
715
+ }
716
+
717
+ .cdk-overlay-connected-position-bounding-box {
718
+ position: absolute;
719
+ display: flex;
720
+ flex-direction: column;
721
+ min-width: 1px;
722
+ min-height: 1px;
723
+ z-index: 1000;
724
+ }
725
+
726
+ .cdk-overlay-backdrop {
727
+ position: absolute;
728
+ top: 0;
729
+ bottom: 0;
730
+ left: 0;
731
+ right: 0;
732
+ pointer-events: auto;
733
+ -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
734
+ opacity: 0;
735
+ z-index: 1000;
736
+ transition: opacity 400ms cubic-bezier(0.25, 0.8, 0.25, 1);
737
+ }
738
+
739
+ .cdk-overlay-backdrop-showing {
740
+ opacity: 1;
741
+ }
742
+
743
+ .cdk-overlay-transparent-backdrop {
744
+ transition: visibility 1ms linear, opacity 1ms linear;
745
+ visibility: hidden;
746
+ opacity: 1;
747
+ }
748
+
749
+ .cdk-overlay-transparent-backdrop.cdk-overlay-backdrop-showing {
750
+ opacity: 0;
751
+ visibility: visible;
752
+ }
753
+
754
+ .cdk-global-scrollblock {
755
+ position: fixed;
756
+ width: 100%;
757
+ overflow-y: scroll;
758
+ }
@@ -331,7 +331,6 @@ declare class TnSelectComponent<T = unknown> implements ControlValueAccessor, On
331
331
  protected optionTestIdParts(option: TnSelectOption<T>): (string | number | null | undefined)[];
332
332
  private onChange;
333
333
  private onTouched;
334
- private elementRef;
335
334
  private cdr;
336
335
  private overlay;
337
336
  private viewContainerRef;
@@ -350,11 +349,19 @@ declare class TnSelectComponent<T = unknown> implements ControlValueAccessor, On
350
349
  *
351
350
  * Why an overlay (vs. an inline absolutely-positioned panel):
352
351
  * - Escapes parent `overflow: hidden`/clipping in surrounding layouts.
353
- * - `outsidePointerEvents()` notifies on outside pointerdown WITHOUT
354
- * intercepting the click (no backdrop) — so the user's click reaches
355
- * the underlying target while the select closes silently.
356
352
  * - Position is recomputed on scroll so the panel stays attached.
357
- * - Width is matched to the trigger so the panel doesn't jump in size.
353
+ *
354
+ * Dismissal uses a transparent, full-viewport backdrop (`backdropClick()`).
355
+ * We previously ran backdrop-less with `outsidePointerEvents()`, but that
356
+ * only closes when the click lands strictly OUTSIDE the overlay pane — and
357
+ * the pane was sized to the (often full-width) trigger while the panel itself
358
+ * is only as wide as its content. The empty pane area to the right of the
359
+ * options stayed `pointer-events: auto`, so clicks there never counted as
360
+ * "outside" and the dropdown wouldn't close. A transparent backdrop closes on
361
+ * ANY click outside the panel regardless of pane geometry — the standard
362
+ * pattern used by native `<select>` and Material's `mat-select`. We therefore
363
+ * also drop the explicit `width`: the pane sizes to the panel content so the
364
+ * clickable surface matches what the user sees.
358
365
  */
359
366
  private attachOverlay;
360
367
  private detachOverlay;