@descope/web-components-ui 1.0.398 → 1.0.400-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.
@@ -366,7 +366,14 @@ const themeToStyle = ({ globals, components }, themeName) => ({
366
366
  components: createComponentsTheme(components),
367
367
  });
368
368
 
369
- const useVar = (varName) => `var(${varName})`;
369
+ // allows to generate css variables with nested fallbacks
370
+ const useVar = (...varNames) => {
371
+ return varNames.reduceRight((acc, value) => {
372
+ if (value.startsWith('--')) return `var(${value}${acc ? `, ${acc}` : acc})`;
373
+
374
+ return `${value}${acc ? `, ${acc}` : acc}`;
375
+ }, '');
376
+ };
370
377
 
371
378
  const createHelperVars = (theme, prefix) => {
372
379
  const res = transformTheme(theme, [], (path, value) => {
@@ -2770,13 +2777,17 @@ const externalInputMixin =
2770
2777
  }
2771
2778
 
2772
2779
  createExternalInput() {
2773
- if (!this.isExternalInput) {
2780
+ if (!this.isExternalInput || this.isReadOnly || this.isDisabled) {
2774
2781
  return null;
2775
2782
  }
2776
2783
 
2777
2784
  // use original input element as reference
2778
2785
  const origInput = this.baseElement.querySelector('input');
2779
2786
 
2787
+ if (!origInput) {
2788
+ return null;
2789
+ }
2790
+
2780
2791
  // to avoid focus loop between external-input and origInput
2781
2792
  // we set origInput's tabindex to -1
2782
2793
  // otherwise, shift-tab will never leave the component focus
@@ -5119,6 +5130,12 @@ const ContainerClass = compose(
5119
5130
  flexWrap: {},
5120
5131
 
5121
5132
  backgroundColor: {},
5133
+ backgroundImage: {},
5134
+ backgroundPositionX: {},
5135
+ backgroundPositionY: {},
5136
+ backgroundSize: {},
5137
+ backgroundRepeat: {},
5138
+
5122
5139
  color: {},
5123
5140
  borderRadius: {},
5124
5141
 
@@ -5166,7 +5183,15 @@ const container = {
5166
5183
  [compVars$5.itemsGrow]: '0',
5167
5184
  [compVars$5.hostWidth]: '100%',
5168
5185
  [compVars$5.boxShadow]: 'none',
5186
+
5169
5187
  [compVars$5.backgroundColor]: globalRefs$t.colors.surface.main,
5188
+
5189
+ [compVars$5.backgroundImage]: '', // we need to set a value to avoid inner containers from inheriting the parent's background image
5190
+ [compVars$5.backgroundPositionX]: 'center',
5191
+ [compVars$5.backgroundPositionY]: 'center',
5192
+ [compVars$5.backgroundSize]: 'cover',
5193
+ [compVars$5.backgroundRepeat]: 'no-repeat',
5194
+
5170
5195
  [compVars$5.color]: globalRefs$t.colors.surface.contrast,
5171
5196
  [compVars$5.borderRadius]: '0px',
5172
5197
  [compVars$5.hostDirection]: globalRefs$t.direction,
@@ -8985,9 +9010,9 @@ class RawPolicyValidation extends createBaseClass({ componentName: componentName
8985
9010
  updateLabel(val) {
8986
9011
  if (!val) {
8987
9012
  this.classList.add('hide-label');
8988
- this.label.innerHTML = '';
9013
+ this.label.textContent = '';
8989
9014
  } else {
8990
- this.label.innerHTML = val;
9015
+ this.label.textContent = val;
8991
9016
  this.classList.remove('hide-label');
8992
9017
  }
8993
9018
  }
@@ -9428,15 +9453,15 @@ class RawUploadFile extends BaseInputClass$2 {
9428
9453
  }
9429
9454
 
9430
9455
  updateTitle(val) {
9431
- this.title.innerHTML = val;
9456
+ this.title.textContent = val;
9432
9457
  }
9433
9458
 
9434
9459
  updateDescription(val) {
9435
- this.description.innerHTML = val;
9460
+ this.description.textContent = val;
9436
9461
  }
9437
9462
 
9438
9463
  updateButtonLabel(val) {
9439
- this.button.innerHTML = val;
9464
+ this.button.textContent = val;
9440
9465
  }
9441
9466
 
9442
9467
  updateButtonSize(val) {
@@ -10449,7 +10474,7 @@ const renderCodeSnippet = (value, lang) =>
10449
10474
 
10450
10475
  const renderText = (text) =>
10451
10476
  `<div class="row-details__value text" title="${text}">${text}</div>`;
10452
- const renderJson = (value) => renderCodeSnippet(JSON.stringify(value, null, 2), 'json');
10477
+ const renderJson = (value) => renderCodeSnippet(escapeXML(JSON.stringify(value, null, 2)), 'json');
10453
10478
  const renderXml = (value) => renderCodeSnippet(escapeXML(value), 'xml');
10454
10479
 
10455
10480
  const defaultRowDetailsValueRenderer = (value) => {