@descope/web-components-ui 3.14.10 → 3.15.1

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/dist/index.esm.js CHANGED
@@ -15686,6 +15686,10 @@ const customMixin$8 = (superclass) =>
15686
15686
  return this.getAttribute('opened') === 'true';
15687
15687
  }
15688
15688
 
15689
+ get closeOnOutsideClick() {
15690
+ return this.getAttribute('close-on-outside-click') === 'true';
15691
+ }
15692
+
15689
15693
  handleOpened() {
15690
15694
  if (this.opened) {
15691
15695
  this.style.display = '';
@@ -15751,6 +15755,28 @@ const customMixin$8 = (superclass) =>
15751
15755
  overlay._enterModalState = () => {};
15752
15756
 
15753
15757
  overlay.close = () => false;
15758
+
15759
+ // close the modal when the user clicks/taps the backdrop (outside the modal
15760
+ // box). Vaadin's own outside-click does not fire here because we keep the
15761
+ // overlay in the shadow DOM (see _attachOverlay above), which leaves it out
15762
+ // of Vaadin's overlay stack, so we detect the backdrop click ourselves.
15763
+ // the listener is always attached and reads `closeOnOutsideClick` at click
15764
+ // time, so toggling the attribute after init is respected.
15765
+ overlay.addEventListener('click', (event) => {
15766
+ if (!this.closeOnOutsideClick || !this.opened) return;
15767
+
15768
+ // the visible modal box; clicks inside it (content + its padding) keep
15769
+ // the modal open, only clicks on the dimmed backdrop close it. if we
15770
+ // can't find the box, don't close - safer than closing on an inside click
15771
+ const overlayPart = overlay.shadowRoot?.querySelector('[part="overlay"]');
15772
+ if (!overlayPart || event.composedPath().includes(overlayPart)) {
15773
+ return;
15774
+ }
15775
+
15776
+ // just close ourselves; consumers that need to react (e.g. ModalDriver
15777
+ // resetting the content) observe the `opened` attribute
15778
+ this.removeAttribute('opened');
15779
+ });
15754
15780
  }
15755
15781
  };
15756
15782
 
@@ -18279,6 +18305,17 @@ const ListClass = compose$1(
18279
18305
  selector: () => 'slot[name="empty-state"]',
18280
18306
  property: 'font-family',
18281
18307
  },
18308
+ // allow overriding empty state height and padding from parent list components:
18309
+ emptyStateVerticalPadding: [
18310
+ {
18311
+ selector: () => 'slot[name="empty-state"]',
18312
+ property: 'padding-top',
18313
+ },
18314
+ {
18315
+ selector: () => 'slot[name="empty-state"]',
18316
+ property: 'padding-bottom',
18317
+ },
18318
+ ],
18282
18319
  },
18283
18320
  }),
18284
18321
  draggableMixin$1,
@@ -25024,6 +25061,14 @@ const OutboundAppsClass = compose$1(
25024
25061
  property: ListClass.cssVarList.horizontalPadding,
25025
25062
  },
25026
25063
  ],
25064
+ emptyStateMinHeight: {
25065
+ selector: () => ListClass.componentName,
25066
+ property: ListClass.cssVarList.minHeight,
25067
+ },
25068
+ emptyStateVerticalPadding: {
25069
+ selector: () => ListClass.componentName,
25070
+ property: ListClass.cssVarList.emptyStateVerticalPadding,
25071
+ },
25027
25072
  },
25028
25073
  }),
25029
25074
  draggableMixin$1,
@@ -25055,6 +25100,8 @@ const outboundApps = {
25055
25100
  [vars$R.listPadding]: '0',
25056
25101
  [vars$R.listBorderWidth]: '0',
25057
25102
  [vars$R.listBoxShadow]: 'none',
25103
+ [vars$R.emptyStateMinHeight]: '0',
25104
+ [vars$R.emptyStateVerticalPadding]: globals.spacing.lg,
25058
25105
 
25059
25106
  size: {
25060
25107
  xs: {
@@ -25551,6 +25598,14 @@ const TrustedDevicesClass = compose$1(
25551
25598
  property: ListClass.cssVarList.horizontalPadding,
25552
25599
  },
25553
25600
  ],
25601
+ emptyStateMinHeight: {
25602
+ selector: () => ListClass.componentName,
25603
+ property: ListClass.cssVarList.minHeight,
25604
+ },
25605
+ emptyStateVerticalPadding: {
25606
+ selector: () => ListClass.componentName,
25607
+ property: ListClass.cssVarList.emptyStateVerticalPadding,
25608
+ },
25554
25609
 
25555
25610
  itemVerticalPadding: {
25556
25611
  selector: ListItemClass.componentName,
@@ -25655,6 +25710,8 @@ const TrustedDevices = {
25655
25710
  [vars$P.listPadding]: '0',
25656
25711
  [vars$P.listBoxShadow]: 'none',
25657
25712
  [vars$P.listItemsGap]: globals.spacing.lg,
25713
+ [vars$P.emptyStateMinHeight]: '0',
25714
+ [vars$P.emptyStateVerticalPadding]: globals.spacing.lg,
25658
25715
 
25659
25716
  [vars$P.itemBorderColor]: globals.colors.surface.light,
25660
25717
  [vars$P.itemVerticalPadding]: globals.spacing.lg,