easy-component-ui 3.0.13 → 3.0.14
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/README.md +162 -162
- package/package.json +8 -2
- package/dist/assets/icon.css +0 -1
- package/dist/components/Base.js +0 -874
- package/dist/components/ea-alert.js +0 -213
- package/dist/components/ea-avatar.js +0 -164
- package/dist/components/ea-backtop.js +0 -136
- package/dist/components/ea-badge.js +0 -144
- package/dist/components/ea-breadcrumb.js +0 -148
- package/dist/components/ea-button.js +0 -266
- package/dist/components/ea-calendar.js +0 -10
- package/dist/components/ea-calendar2.js +0 -673
- package/dist/components/ea-card.js +0 -121
- package/dist/components/ea-carousel.js +0 -415
- package/dist/components/ea-checkbox.js +0 -446
- package/dist/components/ea-collapse.js +0 -313
- package/dist/components/ea-color-picker.js +0 -888
- package/dist/components/ea-container.js +0 -206
- package/dist/components/ea-countdown.js +0 -142
- package/dist/components/ea-date-picker.js +0 -649
- package/dist/components/ea-descriptions.js +0 -474
- package/dist/components/ea-dialog.js +0 -249
- package/dist/components/ea-drawer.js +0 -216
- package/dist/components/ea-dropdown.js +0 -228
- package/dist/components/ea-empty.js +0 -93
- package/dist/components/ea-icon.js +0 -158
- package/dist/components/ea-image-preview.js +0 -532
- package/dist/components/ea-image.js +0 -327
- package/dist/components/ea-infinite-scroll.js +0 -109
- package/dist/components/ea-input-number.js +0 -367
- package/dist/components/ea-input.js +0 -588
- package/dist/components/ea-layout.js +0 -132
- package/dist/components/ea-link.js +0 -101
- package/dist/components/ea-menu.js +0 -433
- package/dist/components/ea-message-box.js +0 -624
- package/dist/components/ea-message.js +0 -314
- package/dist/components/ea-notification.js +0 -331
- package/dist/components/ea-overlay.js +0 -168
- package/dist/components/ea-page-header.js +0 -108
- package/dist/components/ea-pagination.js +0 -481
- package/dist/components/ea-popconfirm.js +0 -275
- package/dist/components/ea-popover.js +0 -147
- package/dist/components/ea-popper.js +0 -203
- package/dist/components/ea-progress.js +0 -286
- package/dist/components/ea-radio.js +0 -364
- package/dist/components/ea-rate.js +0 -241
- package/dist/components/ea-result.js +0 -100
- package/dist/components/ea-scrollbar.js +0 -235
- package/dist/components/ea-segmented.js +0 -215
- package/dist/components/ea-select.js +0 -609
- package/dist/components/ea-skeleton.js +0 -263
- package/dist/components/ea-slider.js +0 -430
- package/dist/components/ea-space.js +0 -123
- package/dist/components/ea-splitter.js +0 -233
- package/dist/components/ea-statistic.js +0 -74
- package/dist/components/ea-steps.js +0 -346
- package/dist/components/ea-switch.js +0 -271
- package/dist/components/ea-table.js +0 -1135
- package/dist/components/ea-tabs.js +0 -501
- package/dist/components/ea-tag.js +0 -228
- package/dist/components/ea-text.js +0 -113
- package/dist/components/ea-time-picker.js +0 -510
- package/dist/components/ea-timeline.js +0 -185
- package/dist/components/ea-tooltip.js +0 -161
- package/dist/components/ea-tour.js +0 -544
- package/dist/components/ea-transfer.js +0 -949
- package/dist/components/ea-tree.js +0 -1125
- package/dist/components/index.js +0 -60
- package/dist/core/FormBase.js +0 -238
- package/dist/css/ea-alert.style.js +0 -4
- package/dist/css/ea-aside.style.js +0 -4
- package/dist/css/ea-avatar.style.js +0 -4
- package/dist/css/ea-backtop.style.js +0 -4
- package/dist/css/ea-badge.style.js +0 -4
- package/dist/css/ea-breadcrumb-item.style.js +0 -4
- package/dist/css/ea-breadcrumb.style.js +0 -4
- package/dist/css/ea-button-group.style.js +0 -4
- package/dist/css/ea-button.style.js +0 -4
- package/dist/css/ea-calendar.style.js +0 -4
- package/dist/css/ea-card.style.js +0 -4
- package/dist/css/ea-carousel-item.style.js +0 -4
- package/dist/css/ea-carousel.style.js +0 -4
- package/dist/css/ea-check-tag.style.js +0 -4
- package/dist/css/ea-checkbox-group.style.js +0 -4
- package/dist/css/ea-checkbox.style.js +0 -4
- package/dist/css/ea-col.style.js +0 -4
- package/dist/css/ea-collapse-item.style.js +0 -4
- package/dist/css/ea-collapse.style.js +0 -4
- package/dist/css/ea-color-picker-panel.style.js +0 -4
- package/dist/css/ea-color-picker.style.js +0 -4
- package/dist/css/ea-container.style.js +0 -4
- package/dist/css/ea-date-picker.style.js +0 -4
- package/dist/css/ea-descriptions-item.style.js +0 -4
- package/dist/css/ea-descriptions.style.js +0 -4
- package/dist/css/ea-dialog.style.js +0 -4
- package/dist/css/ea-drawer.style.js +0 -4
- package/dist/css/ea-dropdown-item.style.js +0 -4
- package/dist/css/ea-dropdown-menu.style.js +0 -4
- package/dist/css/ea-dropdown.style.js +0 -4
- package/dist/css/ea-empty.style.js +0 -4
- package/dist/css/ea-footer.style.js +0 -4
- package/dist/css/ea-header.style.js +0 -4
- package/dist/css/ea-icon.style.js +0 -4
- package/dist/css/ea-image-preview.style.js +0 -4
- package/dist/css/ea-image.style.js +0 -4
- package/dist/css/ea-infinite-scroll.style.js +0 -4
- package/dist/css/ea-input-number.style.js +0 -4
- package/dist/css/ea-input.style.js +0 -4
- package/dist/css/ea-link.style.js +0 -4
- package/dist/css/ea-main.style.js +0 -4
- package/dist/css/ea-menu-item-group.style.js +0 -4
- package/dist/css/ea-menu-item.style.js +0 -4
- package/dist/css/ea-menu.style.js +0 -4
- package/dist/css/ea-message-box.style.js +0 -4
- package/dist/css/ea-message.style.js +0 -4
- package/dist/css/ea-notification.style.js +0 -4
- package/dist/css/ea-option-gropu.style.js +0 -4
- package/dist/css/ea-option.style.js +0 -4
- package/dist/css/ea-overlay.style.js +0 -4
- package/dist/css/ea-page-header.style.js +0 -4
- package/dist/css/ea-pagination.style.js +0 -4
- package/dist/css/ea-popconfirm.style.js +0 -4
- package/dist/css/ea-popover.style.js +0 -4
- package/dist/css/ea-popper.style.js +0 -4
- package/dist/css/ea-progress.style.js +0 -4
- package/dist/css/ea-radio-group.style.js +0 -4
- package/dist/css/ea-radio.style.js +0 -4
- package/dist/css/ea-rate.style.js +0 -4
- package/dist/css/ea-result.style.js +0 -4
- package/dist/css/ea-row.style.js +0 -4
- package/dist/css/ea-scrollbar.style.js +0 -4
- package/dist/css/ea-segmented.style.js +0 -4
- package/dist/css/ea-select.style.js +0 -4
- package/dist/css/ea-skeleton-item.style.js +0 -4
- package/dist/css/ea-skeleton.style.js +0 -4
- package/dist/css/ea-slider.style.js +0 -4
- package/dist/css/ea-space.style.js +0 -4
- package/dist/css/ea-splitter-bar.style.js +0 -4
- package/dist/css/ea-splitter-panel.style.js +0 -4
- package/dist/css/ea-splitter.style.js +0 -4
- package/dist/css/ea-statistic.style.js +0 -4
- package/dist/css/ea-step.style.js +0 -4
- package/dist/css/ea-steps.style.js +0 -4
- package/dist/css/ea-sub-menu.style.js +0 -4
- package/dist/css/ea-switch.style.js +0 -4
- package/dist/css/ea-tab-panel.style.js +0 -4
- package/dist/css/ea-tab.style.js +0 -4
- package/dist/css/ea-table-column.style.js +0 -4
- package/dist/css/ea-table.style.js +0 -4
- package/dist/css/ea-tabs.style.js +0 -4
- package/dist/css/ea-tag.style.js +0 -4
- package/dist/css/ea-text.style.js +0 -4
- package/dist/css/ea-time-picker.style.js +0 -4
- package/dist/css/ea-timeline-item.style.js +0 -4
- package/dist/css/ea-timeline.style.js +0 -4
- package/dist/css/ea-tooltip.style.js +0 -4
- package/dist/css/ea-tour-step.style.js +0 -4
- package/dist/css/ea-tour.style.js +0 -4
- package/dist/css/ea-transfer.style.js +0 -5
- package/dist/css/ea-tree.style.js +0 -6
- package/dist/css/ea-ui-component.style.js +0 -4
- package/dist/favicon.ico +0 -0
- package/dist/utils/Color.js +0 -439
- package/dist/utils/I18nManager.js +0 -218
- package/dist/utils/Utils.js +0 -65
- package/dist/utils/Variables.js +0 -12
- package/dist/utils/parseTime.js +0 -73
- package/dist/utils/timeout.js +0 -9
|
@@ -1,228 +0,0 @@
|
|
|
1
|
-
var C = Object.defineProperty;
|
|
2
|
-
var f = (t) => {
|
|
3
|
-
throw TypeError(t);
|
|
4
|
-
};
|
|
5
|
-
var y = (t, s, e) => s in t ? C(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
|
|
6
|
-
var b = (t, s, e) => y(t, typeof s != "symbol" ? s + "" : s, e), m = (t, s, e) => s.has(t) || f("Cannot " + e);
|
|
7
|
-
var a = (t, s, e) => (m(t, s, "read from private field"), e ? e.call(t) : s.get(t)), o = (t, s, e) => s.has(t) ? f("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), l = (t, s, e, h) => (m(t, s, "write to private field"), h ? h.call(t, e) : s.set(t, e), e);
|
|
8
|
-
import { B as g } from "./Base.js";
|
|
9
|
-
import { s as v } from "../css/ea-check-tag.style.js";
|
|
10
|
-
import { s as k } from "../css/ea-tag.style.js";
|
|
11
|
-
import { c as w } from "../utils/Variables.js";
|
|
12
|
-
import { E } from "../utils/Utils.js";
|
|
13
|
-
var c, r, u;
|
|
14
|
-
class A extends g {
|
|
15
|
-
constructor() {
|
|
16
|
-
super();
|
|
17
|
-
/** @type {HTMLElement} */
|
|
18
|
-
o(this, c);
|
|
19
|
-
/** @type {AbortController} */
|
|
20
|
-
o(this, r);
|
|
21
|
-
b(this, "state", this.properties({
|
|
22
|
-
checked: {
|
|
23
|
-
type: Boolean,
|
|
24
|
-
default: !1,
|
|
25
|
-
observer: (e) => {
|
|
26
|
-
this.updateContainerClasslist();
|
|
27
|
-
}
|
|
28
|
-
},
|
|
29
|
-
disabled: {
|
|
30
|
-
type: Boolean,
|
|
31
|
-
default: !1,
|
|
32
|
-
observer: (e) => {
|
|
33
|
-
this.updateContainerClasslist();
|
|
34
|
-
}
|
|
35
|
-
},
|
|
36
|
-
type: {
|
|
37
|
-
type: ["primary", "info", "success", "warning", "danger"],
|
|
38
|
-
default: "primary",
|
|
39
|
-
observer: (e) => {
|
|
40
|
-
this.updateContainerClasslist();
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}));
|
|
44
|
-
/**
|
|
45
|
-
* 点击切换选中状态
|
|
46
|
-
*/
|
|
47
|
-
o(this, u, () => {
|
|
48
|
-
this.disabled || (this.checked = !this.checked, this.emit("change", { detail: { checked: this.checked } }));
|
|
49
|
-
});
|
|
50
|
-
this.stylesheet = v, this.$render();
|
|
51
|
-
}
|
|
52
|
-
static get observedAttributes() {
|
|
53
|
-
return [...super.observedAttributes, "checked", "disabled", "type"];
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* 获取 classlist 列表
|
|
57
|
-
* @return {string} 属性值
|
|
58
|
-
*/
|
|
59
|
-
updateContainerClasslist() {
|
|
60
|
-
const e = this.computedClasslist(
|
|
61
|
-
"ea-check-tag",
|
|
62
|
-
{
|
|
63
|
-
["--" + this.type]: this.type && this.checked
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
disabled: this.disabled
|
|
67
|
-
}
|
|
68
|
-
);
|
|
69
|
-
return a(this, c).className = e, e;
|
|
70
|
-
}
|
|
71
|
-
$render() {
|
|
72
|
-
this.shadowRoot.innerHTML = `
|
|
73
|
-
<div class='ea-check-tag' part='container'>
|
|
74
|
-
<slot></slot>
|
|
75
|
-
</div>
|
|
76
|
-
`, l(this, c, this.shadowRoot.querySelector(".ea-check-tag"));
|
|
77
|
-
}
|
|
78
|
-
connectedCallback() {
|
|
79
|
-
var e;
|
|
80
|
-
super.connectedCallback(), (e = a(this, r)) == null || e.abort(), l(this, r, new AbortController()), a(this, c).addEventListener("click", a(this, u), {
|
|
81
|
-
signal: a(this, r).signal
|
|
82
|
-
});
|
|
83
|
-
}
|
|
84
|
-
$beforeUnmounted() {
|
|
85
|
-
var e;
|
|
86
|
-
(e = a(this, r)) == null || e.abort();
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
c = new WeakMap(), r = new WeakMap(), u = new WeakMap();
|
|
90
|
-
window.customElements.get("ea-check-tag") || window.customElements.define("ea-check-tag", A);
|
|
91
|
-
class S extends Event {
|
|
92
|
-
constructor(s) {
|
|
93
|
-
super("ea-remove", {
|
|
94
|
-
bubbles: !0,
|
|
95
|
-
composed: !0
|
|
96
|
-
}), this.detail = s;
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
var i, d, n, p;
|
|
100
|
-
class $ extends g {
|
|
101
|
-
constructor() {
|
|
102
|
-
super();
|
|
103
|
-
/** @type {HTMLElement} */
|
|
104
|
-
o(this, i);
|
|
105
|
-
/** @type {HTMLElement | null} */
|
|
106
|
-
o(this, d);
|
|
107
|
-
/** @type {AbortController} */
|
|
108
|
-
o(this, n);
|
|
109
|
-
b(this, "state", this.properties({
|
|
110
|
-
type: {
|
|
111
|
-
type: ["primary", "info", "success", "warning", "danger"],
|
|
112
|
-
default: "primary",
|
|
113
|
-
observer: (e) => {
|
|
114
|
-
this.updateContainerClasslist();
|
|
115
|
-
}
|
|
116
|
-
},
|
|
117
|
-
closable: {
|
|
118
|
-
type: Boolean,
|
|
119
|
-
default: !1,
|
|
120
|
-
observer: (e) => {
|
|
121
|
-
var h;
|
|
122
|
-
(h = a(this, n)) == null || h.abort(), a(this, d).setAttribute("closable", e ? "icon-cancel" : ""), this.updateContainerClasslist(), e && (l(this, n, new AbortController()), a(this, d).addEventListener("click", a(this, p), {
|
|
123
|
-
signal: a(this, n).signal
|
|
124
|
-
}));
|
|
125
|
-
}
|
|
126
|
-
},
|
|
127
|
-
"disable-transitions": {
|
|
128
|
-
type: Boolean,
|
|
129
|
-
default: !1,
|
|
130
|
-
observer: (e) => {
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
color: {
|
|
134
|
-
type: String,
|
|
135
|
-
default: "",
|
|
136
|
-
observer: (e) => {
|
|
137
|
-
if (e && CSS.supports("background", e) ? a(this, i).style.background = e : a(this, i).style.background = "", !CSS.supports("background", e))
|
|
138
|
-
return console.warn(
|
|
139
|
-
`[EaTag] The color value ${e} is not supported.`
|
|
140
|
-
);
|
|
141
|
-
}
|
|
142
|
-
},
|
|
143
|
-
size: {
|
|
144
|
-
type: w,
|
|
145
|
-
default: "default",
|
|
146
|
-
observer: (e) => {
|
|
147
|
-
this.updateContainerClasslist();
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
effect: {
|
|
151
|
-
type: ["dark", "light", "plain"],
|
|
152
|
-
default: "light",
|
|
153
|
-
observer: (e) => {
|
|
154
|
-
this.updateContainerClasslist();
|
|
155
|
-
}
|
|
156
|
-
},
|
|
157
|
-
round: {
|
|
158
|
-
type: Boolean,
|
|
159
|
-
default: !1,
|
|
160
|
-
observer: (e) => {
|
|
161
|
-
this.updateContainerClasslist();
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
}));
|
|
165
|
-
/**
|
|
166
|
-
* 标签移除事件
|
|
167
|
-
*/
|
|
168
|
-
o(this, p, async () => {
|
|
169
|
-
this["disable-transitions"] || (a(this, i).classList.add("before-close"), await E.EaElement.addAsyncEventListener(
|
|
170
|
-
a(this, i),
|
|
171
|
-
"transitionend"
|
|
172
|
-
)), this.dispatchEvent(new S({ text: this.textContent })), this.remove();
|
|
173
|
-
});
|
|
174
|
-
this.stylesheet = k, this.$render();
|
|
175
|
-
}
|
|
176
|
-
static get observedAttributes() {
|
|
177
|
-
return [
|
|
178
|
-
...super.observedAttributes,
|
|
179
|
-
"type",
|
|
180
|
-
"closable",
|
|
181
|
-
"disable-transitions",
|
|
182
|
-
"color",
|
|
183
|
-
"size",
|
|
184
|
-
"effect",
|
|
185
|
-
"round"
|
|
186
|
-
];
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* 获取 classlist 列表
|
|
190
|
-
* @return {string} 属性值
|
|
191
|
-
*/
|
|
192
|
-
updateContainerClasslist() {
|
|
193
|
-
const e = this.computedClasslist(
|
|
194
|
-
"ea-tag",
|
|
195
|
-
{
|
|
196
|
-
["--" + this.type]: this.type,
|
|
197
|
-
[`--${this.size}-size`]: this.size,
|
|
198
|
-
["--" + this.effect]: this.effect
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
closable: this.closable,
|
|
202
|
-
round: this.round
|
|
203
|
-
}
|
|
204
|
-
);
|
|
205
|
-
return a(this, i).className = e, e;
|
|
206
|
-
}
|
|
207
|
-
$render() {
|
|
208
|
-
this.shadowRoot.innerHTML = `
|
|
209
|
-
<div class='ea-tag' part='container'>
|
|
210
|
-
<slot></slot>
|
|
211
|
-
<ea-icon class="ea-tag__close" part="close-icon" name="xmark"></ea-icon>
|
|
212
|
-
</div>
|
|
213
|
-
`, l(this, i, this.shadowRoot.querySelector(".ea-tag")), l(this, d, this.shadowRoot.querySelector(".ea-tag__close")), this.updateContainerClasslist();
|
|
214
|
-
}
|
|
215
|
-
connectedCallback() {
|
|
216
|
-
super.connectedCallback();
|
|
217
|
-
}
|
|
218
|
-
$beforeUnmounted() {
|
|
219
|
-
var e;
|
|
220
|
-
(e = a(this, n)) == null || e.abort();
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
i = new WeakMap(), d = new WeakMap(), n = new WeakMap(), p = new WeakMap();
|
|
224
|
-
window.customElements.get("ea-tag") || window.customElements.define("ea-tag", $);
|
|
225
|
-
export {
|
|
226
|
-
A as EaCheckTag,
|
|
227
|
-
$ as EaTag
|
|
228
|
-
};
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
var y = Object.defineProperty;
|
|
2
|
-
var p = (e) => {
|
|
3
|
-
throw TypeError(e);
|
|
4
|
-
};
|
|
5
|
-
var w = (e, s, t) => s in e ? y(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
6
|
-
var u = (e, s, t) => w(e, typeof s != "symbol" ? s + "" : s, t), m = (e, s, t) => s.has(e) || p("Cannot " + t);
|
|
7
|
-
var i = (e, s, t) => (m(e, s, "read from private field"), t ? t.call(e) : s.get(e)), o = (e, s, t) => s.has(e) ? p("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), h = (e, s, t, l) => (m(e, s, "write to private field"), l ? l.call(e, t) : s.set(e, t), t);
|
|
8
|
-
import { B as f } from "./Base.js";
|
|
9
|
-
import { s as C } from "../css/ea-text.style.js";
|
|
10
|
-
var a, n, r;
|
|
11
|
-
class g extends f {
|
|
12
|
-
constructor() {
|
|
13
|
-
super();
|
|
14
|
-
/** @type {HTMLElement} */
|
|
15
|
-
o(this, a);
|
|
16
|
-
o(this, n, {
|
|
17
|
-
isOriginalRendered: !1
|
|
18
|
-
});
|
|
19
|
-
o(this, r, new Promise((t) => {
|
|
20
|
-
h(this, n, new Proxy(i(this, n), {
|
|
21
|
-
set: (l, d, c) => (d === "isOriginalRendered" && c && t(!0), Reflect.set(l, d, c))
|
|
22
|
-
}));
|
|
23
|
-
}));
|
|
24
|
-
/**
|
|
25
|
-
* @typedef {Object} State
|
|
26
|
-
* @property {string} title - 标题
|
|
27
|
-
* @property {string} type - 文本类型
|
|
28
|
-
* @property {string} size - 文本大小
|
|
29
|
-
* @property {boolean} truncated - 文本是否截断
|
|
30
|
-
* @property {number} line-clamp - 截断的行数
|
|
31
|
-
* @property {string} tag - 文本标签
|
|
32
|
-
*/
|
|
33
|
-
/** @type {State} */
|
|
34
|
-
u(this, "state", this.properties({
|
|
35
|
-
title: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: "",
|
|
38
|
-
observer: (t) => {
|
|
39
|
-
}
|
|
40
|
-
},
|
|
41
|
-
type: {
|
|
42
|
-
type: ["normal", "primary", "success", "warning", "danger", "info"],
|
|
43
|
-
default: "normal",
|
|
44
|
-
observer: async (t) => {
|
|
45
|
-
await i(this, r), this.updateContainerClasslist();
|
|
46
|
-
}
|
|
47
|
-
},
|
|
48
|
-
size: {
|
|
49
|
-
type: ["large", "medium", "small"],
|
|
50
|
-
default: "medium",
|
|
51
|
-
observer: async (t) => {
|
|
52
|
-
await i(this, r), this.updateContainerClasslist();
|
|
53
|
-
}
|
|
54
|
-
},
|
|
55
|
-
truncated: {
|
|
56
|
-
type: Boolean,
|
|
57
|
-
default: !1,
|
|
58
|
-
observer: async (t) => {
|
|
59
|
-
await i(this, r), this.title = this.innerText || "", this.updateContainerClasslist();
|
|
60
|
-
}
|
|
61
|
-
},
|
|
62
|
-
"line-clamp": {
|
|
63
|
-
type: Number,
|
|
64
|
-
default: 0,
|
|
65
|
-
observer: async (t) => {
|
|
66
|
-
await i(this, r), i(this, a).style.setProperty("--ea-text-line-clamp", t), this.title = this.innerText || "", this.updateContainerClasslist();
|
|
67
|
-
}
|
|
68
|
-
},
|
|
69
|
-
tag: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: "span",
|
|
72
|
-
observer: (t) => {
|
|
73
|
-
this.$render(), this.hasAttribute("line-clamp") && i(this, a).style.setProperty(
|
|
74
|
-
"--ea-text-line-clamp",
|
|
75
|
-
this["line-clamp"]
|
|
76
|
-
), (this.hasAttribute("truncated") || this.hasAttribute("line-clamp")) && (this.title = this.innerText || ""), this.updateContainerClasslist();
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}));
|
|
80
|
-
this.stylesheet = C;
|
|
81
|
-
}
|
|
82
|
-
static get observedAttributes() {
|
|
83
|
-
return ["title", "type", "size", "truncated", "line-clamp", "tag"];
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* 获取 classlist 列表
|
|
87
|
-
* @return {string} 属性值
|
|
88
|
-
*/
|
|
89
|
-
updateContainerClasslist() {
|
|
90
|
-
const t = this.computedClasslist("ea-text", {
|
|
91
|
-
["--" + this.type]: this.type,
|
|
92
|
-
["--" + this.size]: this.size,
|
|
93
|
-
"--truncated": this.truncated,
|
|
94
|
-
"--line-clamp": this["line-clamp"] > 0
|
|
95
|
-
});
|
|
96
|
-
return i(this, a).className = t, t;
|
|
97
|
-
}
|
|
98
|
-
$render() {
|
|
99
|
-
this.shadowRoot.innerHTML = `
|
|
100
|
-
<${this.tag} class="ea-text" part="container">
|
|
101
|
-
<slot></slot>
|
|
102
|
-
</${this.tag}>
|
|
103
|
-
`, h(this, a, this.shadowRoot.querySelector(".ea-text")), this.updateContainerClasslist(), i(this, n).isOriginalRendered = !0;
|
|
104
|
-
}
|
|
105
|
-
connectedCallback() {
|
|
106
|
-
super.connectedCallback(), this.$render();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
a = new WeakMap(), n = new WeakMap(), r = new WeakMap();
|
|
110
|
-
window.customElements.get("ea-text") || window.customElements.define("ea-text", g);
|
|
111
|
-
export {
|
|
112
|
-
g as EaText
|
|
113
|
-
};
|