@descope/web-components-ui 1.0.405 → 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.
@@ -2663,10 +2663,14 @@ const inputEventsDispatchingMixin = (superclass) =>
2663
2663
  // we are comparing the previous value to the new one,
2664
2664
  // and if they have the same value, we are blocking the input event
2665
2665
  this.addEventListener('input', (e) => {
2666
- e.stopImmediatePropagation();
2667
- if (previousRootComponentValue !== this.value) {
2668
- previousRootComponentValue = this.value;
2669
- createDispatchEvent.call(this, 'input', { bubbles: true });
2666
+ // We don't want to block our own event that we fire from handleInputEventDispatching
2667
+ if (this !== e.target) {
2668
+ e.stopImmediatePropagation();
2669
+
2670
+ if (previousRootComponentValue !== this.value) {
2671
+ previousRootComponentValue = this.value;
2672
+ createDispatchEvent.call(this, 'input', { bubbles: true, composed: true });
2673
+ }
2670
2674
  }
2671
2675
  });
2672
2676
  }
@@ -17307,6 +17311,11 @@ class RawRecaptcha extends BaseClass {
17307
17311
  }
17308
17312
 
17309
17313
  renderRecaptcha(enabled) {
17314
+ if (this.children.length) {
17315
+ this.updatePreview();
17316
+ return;
17317
+ }
17318
+
17310
17319
  if (enabled) {
17311
17320
  this.recaptchaEle.style.display = '';
17312
17321
  this.mockRecaptchaEle.style.display = 'none';
@@ -17324,7 +17333,7 @@ class RawRecaptcha extends BaseClass {
17324
17333
  :host {
17325
17334
  display: inline-flex;
17326
17335
  }
17327
- :host > div {
17336
+ :host > div:not(.hidden) {
17328
17337
  display: flex;
17329
17338
  }
17330
17339
  :host #recaptcha .grecaptcha-badge {
@@ -17339,16 +17348,40 @@ class RawRecaptcha extends BaseClass {
17339
17348
  }
17340
17349
  :host img {
17341
17350
  width: 256px;
17351
+ }
17352
+ :host([full-width="true"]) {
17353
+ width: 100%;
17354
+ }
17355
+ .hidden {
17356
+ display: none;
17342
17357
  }
17343
17358
  </style>
17344
- <div>
17359
+ <div class="badge">
17345
17360
  <span id="recaptcha"></span>
17346
17361
  <img src="https://imgs.descope.com/connectors/templates/recaptcha/recaptcha-big.png" alt="recaptcha"/>
17347
17362
  </div>
17363
+ <slot></slot>
17348
17364
  `;
17349
17365
 
17350
17366
  this.recaptchaEle = this.baseElement.querySelector('#recaptcha');
17351
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
+ }
17352
17385
  }
17353
17386
 
17354
17387
  get enterprise() {