@descope/web-components-ui 1.0.406 → 1.0.407

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
@@ -9698,6 +9698,11 @@ class RawRecaptcha extends BaseClass$1 {
9698
9698
  }
9699
9699
 
9700
9700
  renderRecaptcha(enabled) {
9701
+ if (this.children.length) {
9702
+ this.updatePreview();
9703
+ return;
9704
+ }
9705
+
9701
9706
  if (enabled) {
9702
9707
  this.recaptchaEle.style.display = '';
9703
9708
  this.mockRecaptchaEle.style.display = 'none';
@@ -9715,7 +9720,7 @@ class RawRecaptcha extends BaseClass$1 {
9715
9720
  :host {
9716
9721
  display: inline-flex;
9717
9722
  }
9718
- :host > div {
9723
+ :host > div:not(.hidden) {
9719
9724
  display: flex;
9720
9725
  }
9721
9726
  :host #recaptcha .grecaptcha-badge {
@@ -9730,16 +9735,40 @@ class RawRecaptcha extends BaseClass$1 {
9730
9735
  }
9731
9736
  :host img {
9732
9737
  width: 256px;
9738
+ }
9739
+ :host([full-width="true"]) {
9740
+ width: 100%;
9741
+ }
9742
+ .hidden {
9743
+ display: none;
9733
9744
  }
9734
9745
  </style>
9735
- <div>
9746
+ <div class="badge">
9736
9747
  <span id="recaptcha"></span>
9737
9748
  <img src="https://imgs.descope.com/connectors/templates/recaptcha/recaptcha-big.png" alt="recaptcha"/>
9738
9749
  </div>
9750
+ <slot></slot>
9739
9751
  `;
9740
9752
 
9741
9753
  this.recaptchaEle = this.baseElement.querySelector('#recaptcha');
9742
9754
  this.mockRecaptchaEle = this.baseElement.querySelector('img');
9755
+ this.badge = this.shadowRoot.querySelector('.badge');
9756
+ }
9757
+
9758
+ init() {
9759
+ super.init?.();
9760
+
9761
+ observeChildren(this, this.updatePreview.bind(this));
9762
+ }
9763
+
9764
+ updatePreview() {
9765
+ if (this.children.length) {
9766
+ this.recaptchaEle.style.display = 'none';
9767
+ this.mockRecaptchaEle.style.display = 'none';
9768
+ this.badge.classList.add('hidden');
9769
+ } else {
9770
+ this.badge.classList.remove('hidden');
9771
+ }
9743
9772
  }
9744
9773
 
9745
9774
  get enterprise() {