@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.
@@ -17311,6 +17311,11 @@ class RawRecaptcha extends BaseClass {
17311
17311
  }
17312
17312
 
17313
17313
  renderRecaptcha(enabled) {
17314
+ if (this.children.length) {
17315
+ this.updatePreview();
17316
+ return;
17317
+ }
17318
+
17314
17319
  if (enabled) {
17315
17320
  this.recaptchaEle.style.display = '';
17316
17321
  this.mockRecaptchaEle.style.display = 'none';
@@ -17328,7 +17333,7 @@ class RawRecaptcha extends BaseClass {
17328
17333
  :host {
17329
17334
  display: inline-flex;
17330
17335
  }
17331
- :host > div {
17336
+ :host > div:not(.hidden) {
17332
17337
  display: flex;
17333
17338
  }
17334
17339
  :host #recaptcha .grecaptcha-badge {
@@ -17343,16 +17348,40 @@ class RawRecaptcha extends BaseClass {
17343
17348
  }
17344
17349
  :host img {
17345
17350
  width: 256px;
17351
+ }
17352
+ :host([full-width="true"]) {
17353
+ width: 100%;
17354
+ }
17355
+ .hidden {
17356
+ display: none;
17346
17357
  }
17347
17358
  </style>
17348
- <div>
17359
+ <div class="badge">
17349
17360
  <span id="recaptcha"></span>
17350
17361
  <img src="https://imgs.descope.com/connectors/templates/recaptcha/recaptcha-big.png" alt="recaptcha"/>
17351
17362
  </div>
17363
+ <slot></slot>
17352
17364
  `;
17353
17365
 
17354
17366
  this.recaptchaEle = this.baseElement.querySelector('#recaptcha');
17355
17367
  this.mockRecaptchaEle = this.baseElement.querySelector('img');
17368
+ this.badge = this.shadowRoot.querySelector('.badge');
17369
+ }
17370
+
17371
+ init() {
17372
+ super.init?.();
17373
+
17374
+ observeChildren(this, this.updatePreview.bind(this));
17375
+ }
17376
+
17377
+ updatePreview() {
17378
+ if (this.children.length) {
17379
+ this.recaptchaEle.style.display = 'none';
17380
+ this.mockRecaptchaEle.style.display = 'none';
17381
+ this.badge.classList.add('hidden');
17382
+ } else {
17383
+ this.badge.classList.remove('hidden');
17384
+ }
17356
17385
  }
17357
17386
 
17358
17387
  get enterprise() {