@tarojs/components
Version:
24 lines (20 loc) • 1.18 kB
JavaScript
import { r as registerInstance, h, H as Host } from './index-980f930f.js';
const indexCss = "taro-text-core{display:inline;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none}taro-text-core[selectable=true],taro-text-core[user-select=true]{display:inline-block;-webkit-user-select:text;-moz-user-select:text;-ms-user-select:text;user-select:text}taro-text-core[space]{white-space:pre-wrap}taro-text-core[space=ensp]{word-spacing:0.5em}taro-text-core[space=nbsp]{word-spacing:1em}taro-text-core[number-of-lines]{--line-clamp:2;display:-webkit-box;-webkit-box-orient:vertical;word-wrap:break-word;overflow:hidden;text-overflow:ellipsis;-webkit-line-clamp:var(--line-clamp)}";
const Text = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.selectable = false;
this.userSelect = false;
this.space = undefined;
this.numberOfLines = undefined;
}
render() {
const style = {};
if (typeof this.numberOfLines === 'number') {
style['--line-clamp'] = this.numberOfLines;
}
return (h(Host, { style: style }, h("slot", null)));
}
};
Text.style = indexCss;
export { Text as taro_text_core };