@descope/web-components-ui 1.0.101 → 1.0.102
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
@@ -349,7 +349,10 @@ const createStyleMixin =
|
|
349
349
|
);
|
350
350
|
|
351
351
|
if (value) style?.setProperty(varName, value);
|
352
|
-
else
|
352
|
+
else {
|
353
|
+
style?.removeProperty(varName);
|
354
|
+
this.removeAttribute(attrName);
|
355
|
+
}
|
353
356
|
}
|
354
357
|
|
355
358
|
#updateOverridesStyle(attrs = []) {
|
@@ -498,6 +501,27 @@ const hoverableMixin = (superclass) =>
|
|
498
501
|
}
|
499
502
|
};
|
500
503
|
|
504
|
+
const booleanAttributesList = [
|
505
|
+
'readonly',
|
506
|
+
'focused',
|
507
|
+
'invalid',
|
508
|
+
'has-label',
|
509
|
+
'required',
|
510
|
+
'disabled',
|
511
|
+
'checked',
|
512
|
+
'has-helper',
|
513
|
+
'has-value',
|
514
|
+
'step-buttons-visible',
|
515
|
+
'hover',
|
516
|
+
'has-error-message',
|
517
|
+
'focus-ring',
|
518
|
+
'opened',
|
519
|
+
'active'
|
520
|
+
];
|
521
|
+
|
522
|
+
const isBooleanAttribute = (attr) => {
|
523
|
+
return booleanAttributesList.includes(attr)
|
524
|
+
};
|
501
525
|
// we want all the valueless attributes to have "true" value
|
502
526
|
// and all the falsy attribute to be removed
|
503
527
|
const normalizeBooleanAttributesMixin = (superclass) => class NormalizeBooleanAttributesMixinClass extends superclass {
|
@@ -508,10 +532,14 @@ const normalizeBooleanAttributesMixin = (superclass) => class NormalizeBooleanAt
|
|
508
532
|
attrs.forEach(attr => {
|
509
533
|
const attrVal = this.getAttribute(attr);
|
510
534
|
|
511
|
-
if (
|
512
|
-
|
513
|
-
|
514
|
-
|
535
|
+
if (isBooleanAttribute(attr)) {
|
536
|
+
if (attrVal === '') {
|
537
|
+
this.setAttribute(attr, 'true');
|
538
|
+
} else if (attrVal === 'false') {
|
539
|
+
this.removeAttribute(attr);
|
540
|
+
}
|
541
|
+
} else if (!attrVal) {
|
542
|
+
console.warn(`attribute "${attr}" has no value, should it be added to the boolean attributes list?`);
|
515
543
|
}
|
516
544
|
}), {});
|
517
545
|
}
|
@@ -5814,7 +5842,6 @@ const vars$8 = Text.cssVarList;
|
|
5814
5842
|
|
5815
5843
|
const text = {
|
5816
5844
|
[vars$8.lineHeight]: '1em',
|
5817
|
-
[vars$8.display]: 'inline-block',
|
5818
5845
|
[vars$8.textAlign]: 'left',
|
5819
5846
|
[vars$8.color]: globalRefs$8.colors.surface.dark,
|
5820
5847
|
variant: {
|
@@ -5875,7 +5902,6 @@ const text = {
|
|
5875
5902
|
},
|
5876
5903
|
_fullWidth: {
|
5877
5904
|
[vars$8.width]: '100%',
|
5878
|
-
[vars$8.display]: 'block'
|
5879
5905
|
},
|
5880
5906
|
_italic: {
|
5881
5907
|
[vars$8.fontStyle]: 'italic'
|