@descope/web-components-ui 1.0.406 → 1.0.407-2

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
@@ -9180,9 +9180,9 @@ class RawPolicyValidation extends createBaseClass({ componentName: componentName
9180
9180
  updateLabel(val) {
9181
9181
  if (!val) {
9182
9182
  this.classList.add('hide-label');
9183
- this.label.innerHTML = '';
9183
+ this.label.textContent = '';
9184
9184
  } else {
9185
- this.label.innerHTML = val;
9185
+ this.label.textContent = val;
9186
9186
  this.classList.remove('hide-label');
9187
9187
  }
9188
9188
  }
@@ -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() {
@@ -10031,15 +10060,15 @@ class RawUploadFile extends BaseInputClass$3 {
10031
10060
  }
10032
10061
 
10033
10062
  updateTitle(val) {
10034
- this.title.innerHTML = val;
10063
+ this.title.textContent = val;
10035
10064
  }
10036
10065
 
10037
10066
  updateDescription(val) {
10038
- this.description.innerHTML = val;
10067
+ this.description.textContent = val;
10039
10068
  }
10040
10069
 
10041
10070
  updateButtonLabel(val) {
10042
- this.button.innerHTML = val;
10071
+ this.button.textContent = val;
10043
10072
  }
10044
10073
 
10045
10074
  updateButtonSize(val) {
@@ -11216,7 +11245,7 @@ const renderCodeSnippet = (value, lang) =>
11216
11245
 
11217
11246
  const renderText = (text) =>
11218
11247
  `<div class="row-details__value text" title="${text}">${text}</div>`;
11219
- const renderJson = (value) => renderCodeSnippet(JSON.stringify(value, null, 2), 'json');
11248
+ const renderJson = (value) => renderCodeSnippet(escapeXML(JSON.stringify(value, null, 2)), 'json');
11220
11249
  const renderXml = (value) => renderCodeSnippet(escapeXML(value), 'xml');
11221
11250
 
11222
11251
  const defaultRowDetailsValueRenderer = (value) => {