@descope/web-components-ui 1.0.211 → 1.0.213
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/cjs/index.cjs.js +23 -1
- package/dist/cjs/index.cjs.js.map +1 -1
- package/dist/index.esm.js +25 -5
- package/dist/index.esm.js.map +1 -1
- package/dist/umd/1000.js +1 -1
- package/dist/umd/descope-text-index-js.js +1 -1
- package/dist/umd/phone-fields-descope-phone-field-descope-phone-field-internal-index-js.js +1 -1
- package/package.json +1 -1
- package/src/components/descope-text/TextClass.js +20 -2
- package/src/components/phone-fields/descope-phone-field/descope-phone-field-internal/PhoneFieldInternal.js +2 -4
- package/src/mixins/proxyInputMixin.js +3 -0
package/dist/cjs/index.cjs.js
CHANGED
@@ -2094,6 +2094,9 @@ const proxyInputMixin =
|
|
2094
2094
|
// We do not want to show the default validity report tooltip
|
2095
2095
|
// So we are overriding the reportValidity fn to show the input's error message
|
2096
2096
|
reportValidity = () => {
|
2097
|
+
// we want to update validity so in case the value was set programmatically, we won't get an error
|
2098
|
+
this.inputElement.setCustomValidity('');
|
2099
|
+
this.setCustomValidity('');
|
2097
2100
|
if (!this.checkValidity()) {
|
2098
2101
|
this.setAttribute('invalid', 'true');
|
2099
2102
|
this.#handleErrorMessage();
|
@@ -4022,6 +4025,8 @@ var totpImage = /*#__PURE__*/Object.freeze({
|
|
4022
4025
|
vars: vars$f
|
4023
4026
|
});
|
4024
4027
|
|
4028
|
+
// eslint-disable-next-line max-classes-per-file
|
4029
|
+
|
4025
4030
|
const componentName$j = getComponentName('text');
|
4026
4031
|
|
4027
4032
|
class RawText extends createBaseClass({ componentName: componentName$j, baseSelector: ':host > slot' }) {
|
@@ -4043,6 +4048,22 @@ class RawText extends createBaseClass({ componentName: componentName$j, baseSele
|
|
4043
4048
|
}
|
4044
4049
|
}
|
4045
4050
|
|
4051
|
+
const customTextMixin = (superclass) =>
|
4052
|
+
class CustomTextMixin extends superclass {
|
4053
|
+
get hideWhenEmpty() {
|
4054
|
+
return this.getAttribute('hide-when-empty') === 'true';
|
4055
|
+
}
|
4056
|
+
|
4057
|
+
init() {
|
4058
|
+
super.init();
|
4059
|
+
|
4060
|
+
observeChildren(this, () => {
|
4061
|
+
const hasChildren = !!this.childNodes.length;
|
4062
|
+
this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';
|
4063
|
+
});
|
4064
|
+
}
|
4065
|
+
};
|
4066
|
+
|
4046
4067
|
const TextClass = compose(
|
4047
4068
|
createStyleMixin({
|
4048
4069
|
mappings: {
|
@@ -4063,7 +4084,8 @@ const TextClass = compose(
|
|
4063
4084
|
},
|
4064
4085
|
}),
|
4065
4086
|
draggableMixin,
|
4066
|
-
componentNameValidationMixin
|
4087
|
+
componentNameValidationMixin,
|
4088
|
+
customTextMixin
|
4067
4089
|
)(RawText);
|
4068
4090
|
|
4069
4091
|
const globalRefs$7 = getThemeRefs(globals);
|