@descope/web-components-ui 1.0.211 → 1.0.212
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/cjs/index.cjs.js
CHANGED
@@ -4022,6 +4022,8 @@ var totpImage = /*#__PURE__*/Object.freeze({
|
|
4022
4022
|
vars: vars$f
|
4023
4023
|
});
|
4024
4024
|
|
4025
|
+
// eslint-disable-next-line max-classes-per-file
|
4026
|
+
|
4025
4027
|
const componentName$j = getComponentName('text');
|
4026
4028
|
|
4027
4029
|
class RawText extends createBaseClass({ componentName: componentName$j, baseSelector: ':host > slot' }) {
|
@@ -4043,6 +4045,22 @@ class RawText extends createBaseClass({ componentName: componentName$j, baseSele
|
|
4043
4045
|
}
|
4044
4046
|
}
|
4045
4047
|
|
4048
|
+
const customTextMixin = (superclass) =>
|
4049
|
+
class CustomTextMixin extends superclass {
|
4050
|
+
get hideWhenEmpty() {
|
4051
|
+
return this.getAttribute('hide-when-empty') === 'true';
|
4052
|
+
}
|
4053
|
+
|
4054
|
+
init() {
|
4055
|
+
super.init();
|
4056
|
+
|
4057
|
+
observeChildren(this, () => {
|
4058
|
+
const hasChildren = !!this.childNodes.length;
|
4059
|
+
this.style.display = !hasChildren && this.hideWhenEmpty ? 'none' : '';
|
4060
|
+
});
|
4061
|
+
}
|
4062
|
+
};
|
4063
|
+
|
4046
4064
|
const TextClass = compose(
|
4047
4065
|
createStyleMixin({
|
4048
4066
|
mappings: {
|
@@ -4063,7 +4081,8 @@ const TextClass = compose(
|
|
4063
4081
|
},
|
4064
4082
|
}),
|
4065
4083
|
draggableMixin,
|
4066
|
-
componentNameValidationMixin
|
4084
|
+
componentNameValidationMixin,
|
4085
|
+
customTextMixin
|
4067
4086
|
)(RawText);
|
4068
4087
|
|
4069
4088
|
const globalRefs$7 = getThemeRefs(globals);
|