easy-component-ui 3.0.14 → 3.0.15
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/assets/icon.css +1 -0
- package/dist/components/Base.js +941 -0
- package/dist/components/ea-alert.js +213 -0
- package/dist/components/ea-avatar.js +164 -0
- package/dist/components/ea-backtop.js +136 -0
- package/dist/components/ea-badge.js +144 -0
- package/dist/components/ea-breadcrumb.js +148 -0
- package/dist/components/ea-button.js +266 -0
- package/dist/components/ea-calendar.js +10 -0
- package/dist/components/ea-calendar2.js +673 -0
- package/dist/components/ea-card.js +121 -0
- package/dist/components/ea-carousel.js +415 -0
- package/dist/components/ea-checkbox.js +446 -0
- package/dist/components/ea-collapse.js +313 -0
- package/dist/components/ea-color-picker.js +888 -0
- package/dist/components/ea-container.js +206 -0
- package/dist/components/ea-countdown.js +142 -0
- package/dist/components/ea-date-picker.js +649 -0
- package/dist/components/ea-descriptions.js +474 -0
- package/dist/components/ea-dialog.js +249 -0
- package/dist/components/ea-drawer.js +216 -0
- package/dist/components/ea-dropdown.js +228 -0
- package/dist/components/ea-empty.js +93 -0
- package/dist/components/ea-icon.js +159 -0
- package/dist/components/ea-image-preview.js +532 -0
- package/dist/components/ea-image.js +327 -0
- package/dist/components/ea-infinite-scroll.js +109 -0
- package/dist/components/ea-input-number.js +367 -0
- package/dist/components/ea-input.js +588 -0
- package/dist/components/ea-layout.js +132 -0
- package/dist/components/ea-link.js +101 -0
- package/dist/components/ea-menu.js +433 -0
- package/dist/components/ea-message-box.js +624 -0
- package/dist/components/ea-message.js +313 -0
- package/dist/components/ea-notification.js +331 -0
- package/dist/components/ea-overlay.js +168 -0
- package/dist/components/ea-page-header.js +108 -0
- package/dist/components/ea-pagination.js +481 -0
- package/dist/components/ea-popconfirm.js +275 -0
- package/dist/components/ea-popover.js +147 -0
- package/dist/components/ea-popper.js +203 -0
- package/dist/components/ea-progress.js +286 -0
- package/dist/components/ea-radio.js +364 -0
- package/dist/components/ea-rate.js +241 -0
- package/dist/components/ea-result.js +100 -0
- package/dist/components/ea-scrollbar.js +235 -0
- package/dist/components/ea-segmented.js +215 -0
- package/dist/components/ea-select.js +609 -0
- package/dist/components/ea-skeleton.js +263 -0
- package/dist/components/ea-slider.js +430 -0
- package/dist/components/ea-space.js +123 -0
- package/dist/components/ea-splitter.js +233 -0
- package/dist/components/ea-statistic.js +74 -0
- package/dist/components/ea-steps.js +346 -0
- package/dist/components/ea-switch.js +271 -0
- package/dist/components/ea-table.js +1137 -0
- package/dist/components/ea-tabs.js +503 -0
- package/dist/components/ea-tag.js +228 -0
- package/dist/components/ea-text.js +113 -0
- package/dist/components/ea-time-picker.js +510 -0
- package/dist/components/ea-timeline.js +185 -0
- package/dist/components/ea-tooltip.js +161 -0
- package/dist/components/ea-tour.js +544 -0
- package/dist/components/ea-transfer.js +949 -0
- package/dist/components/ea-tree.js +1125 -0
- package/dist/components/index.js +60 -0
- package/dist/core/FormBase.js +238 -0
- package/dist/css/ea-alert.style.js +4 -0
- package/dist/css/ea-aside.style.js +4 -0
- package/dist/css/ea-avatar.style.js +4 -0
- package/dist/css/ea-backtop.style.js +4 -0
- package/dist/css/ea-badge.style.js +4 -0
- package/dist/css/ea-breadcrumb-item.style.js +4 -0
- package/dist/css/ea-breadcrumb.style.js +4 -0
- package/dist/css/ea-button-group.style.js +4 -0
- package/dist/css/ea-button.style.js +4 -0
- package/dist/css/ea-calendar.style.js +4 -0
- package/dist/css/ea-card.style.js +4 -0
- package/dist/css/ea-carousel-item.style.js +4 -0
- package/dist/css/ea-carousel.style.js +4 -0
- package/dist/css/ea-check-tag.style.js +4 -0
- package/dist/css/ea-checkbox-group.style.js +4 -0
- package/dist/css/ea-checkbox.style.js +4 -0
- package/dist/css/ea-col.style.js +4 -0
- package/dist/css/ea-collapse-item.style.js +4 -0
- package/dist/css/ea-collapse.style.js +4 -0
- package/dist/css/ea-color-picker-panel.style.js +4 -0
- package/dist/css/ea-color-picker.style.js +4 -0
- package/dist/css/ea-container.style.js +4 -0
- package/dist/css/ea-date-picker.style.js +4 -0
- package/dist/css/ea-descriptions-item.style.js +4 -0
- package/dist/css/ea-descriptions.style.js +4 -0
- package/dist/css/ea-dialog.style.js +4 -0
- package/dist/css/ea-drawer.style.js +4 -0
- package/dist/css/ea-dropdown-item.style.js +4 -0
- package/dist/css/ea-dropdown-menu.style.js +4 -0
- package/dist/css/ea-dropdown.style.js +4 -0
- package/dist/css/ea-empty.style.js +4 -0
- package/dist/css/ea-footer.style.js +4 -0
- package/dist/css/ea-header.style.js +4 -0
- package/dist/css/ea-icon.style.js +4 -0
- package/dist/css/ea-image-preview.style.js +4 -0
- package/dist/css/ea-image.style.js +4 -0
- package/dist/css/ea-infinite-scroll.style.js +4 -0
- package/dist/css/ea-input-number.style.js +4 -0
- package/dist/css/ea-input.style.js +4 -0
- package/dist/css/ea-link.style.js +4 -0
- package/dist/css/ea-main.style.js +4 -0
- package/dist/css/ea-menu-item-group.style.js +4 -0
- package/dist/css/ea-menu-item.style.js +4 -0
- package/dist/css/ea-menu.style.js +4 -0
- package/dist/css/ea-message-box.style.js +4 -0
- package/dist/css/ea-message.style.js +4 -0
- package/dist/css/ea-notification.style.js +4 -0
- package/dist/css/ea-option-gropu.style.js +4 -0
- package/dist/css/ea-option.style.js +4 -0
- package/dist/css/ea-overlay.style.js +4 -0
- package/dist/css/ea-page-header.style.js +4 -0
- package/dist/css/ea-pagination.style.js +4 -0
- package/dist/css/ea-popconfirm.style.js +4 -0
- package/dist/css/ea-popover.style.js +4 -0
- package/dist/css/ea-popper.style.js +4 -0
- package/dist/css/ea-progress.style.js +4 -0
- package/dist/css/ea-radio-group.style.js +4 -0
- package/dist/css/ea-radio.style.js +4 -0
- package/dist/css/ea-rate.style.js +4 -0
- package/dist/css/ea-result.style.js +4 -0
- package/dist/css/ea-row.style.js +4 -0
- package/dist/css/ea-scrollbar.style.js +4 -0
- package/dist/css/ea-segmented.style.js +4 -0
- package/dist/css/ea-select.style.js +4 -0
- package/dist/css/ea-skeleton-item.style.js +4 -0
- package/dist/css/ea-skeleton.style.js +4 -0
- package/dist/css/ea-slider.style.js +4 -0
- package/dist/css/ea-space.style.js +4 -0
- package/dist/css/ea-splitter-bar.style.js +4 -0
- package/dist/css/ea-splitter-panel.style.js +4 -0
- package/dist/css/ea-splitter.style.js +4 -0
- package/dist/css/ea-statistic.style.js +4 -0
- package/dist/css/ea-step.style.js +4 -0
- package/dist/css/ea-steps.style.js +4 -0
- package/dist/css/ea-sub-menu.style.js +4 -0
- package/dist/css/ea-switch.style.js +4 -0
- package/dist/css/ea-tab-panel.style.js +4 -0
- package/dist/css/ea-tab.style.js +4 -0
- package/dist/css/ea-table-column.style.js +4 -0
- package/dist/css/ea-table.style.js +4 -0
- package/dist/css/ea-tabs.style.js +4 -0
- package/dist/css/ea-tag.style.js +4 -0
- package/dist/css/ea-text.style.js +4 -0
- package/dist/css/ea-time-picker.style.js +4 -0
- package/dist/css/ea-timeline-item.style.js +4 -0
- package/dist/css/ea-timeline.style.js +4 -0
- package/dist/css/ea-tooltip.style.js +4 -0
- package/dist/css/ea-tour-step.style.js +4 -0
- package/dist/css/ea-tour.style.js +4 -0
- package/dist/css/ea-transfer.style.js +5 -0
- package/dist/css/ea-tree.style.js +6 -0
- package/dist/css/ea-ui-component.style.js +4 -0
- package/dist/favicon.ico +0 -0
- package/dist/utils/Color.js +439 -0
- package/dist/utils/I18nManager.js +218 -0
- package/dist/utils/Utils.js +65 -0
- package/dist/utils/Variables.js +12 -0
- package/dist/utils/parseTime.js +73 -0
- package/dist/utils/timeout.js +9 -0
- package/package.json +1 -1
|
@@ -0,0 +1,474 @@
|
|
|
1
|
+
var O = Object.defineProperty;
|
|
2
|
+
var T = (s) => {
|
|
3
|
+
throw TypeError(s);
|
|
4
|
+
};
|
|
5
|
+
var P = (s, l, t) => l in s ? O(s, l, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[l] = t;
|
|
6
|
+
var M = (s, l, t) => P(s, typeof l != "symbol" ? l + "" : l, t), N = (s, l, t) => l.has(s) || T("Cannot " + t);
|
|
7
|
+
var i = (s, l, t) => (N(s, l, "read from private field"), t ? t.call(s) : l.get(s)), r = (s, l, t) => l.has(s) ? T("Cannot add the same private member more than once") : l instanceof WeakSet ? l.add(s) : l.set(s, t), h = (s, l, t, e) => (N(s, l, "write to private field"), e ? e.call(s, t) : l.set(s, t), t), o = (s, l, t) => (N(s, l, "access private method"), t);
|
|
8
|
+
import { B } from "./Base.js";
|
|
9
|
+
import { s as U } from "../css/ea-descriptions-item.style.js";
|
|
10
|
+
import { s as V } from "../css/ea-descriptions.style.js";
|
|
11
|
+
import { E as b } from "../utils/Utils.js";
|
|
12
|
+
var C, g, c, u, I;
|
|
13
|
+
class F extends B {
|
|
14
|
+
constructor() {
|
|
15
|
+
super();
|
|
16
|
+
r(this, c);
|
|
17
|
+
/** @type {HTMLSpanElement | null} */
|
|
18
|
+
r(this, C);
|
|
19
|
+
/** @type {MutationObserver | null} */
|
|
20
|
+
r(this, g, null);
|
|
21
|
+
M(this, "state", this.properties({
|
|
22
|
+
label: {
|
|
23
|
+
type: String,
|
|
24
|
+
default: "",
|
|
25
|
+
observer: () => {
|
|
26
|
+
i(this, C).textContent = this.label, o(this, c, u).call(this);
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
colspan: {
|
|
30
|
+
type: Number,
|
|
31
|
+
default: 1,
|
|
32
|
+
observer: () => {
|
|
33
|
+
o(this, c, u).call(this);
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
rowspan: {
|
|
37
|
+
type: Number,
|
|
38
|
+
default: 1,
|
|
39
|
+
observer: () => {
|
|
40
|
+
o(this, c, u).call(this);
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
align: {
|
|
44
|
+
type: ["left", "center", "right"],
|
|
45
|
+
default: "",
|
|
46
|
+
observer: () => {
|
|
47
|
+
o(this, c, u).call(this);
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
"label-align": {
|
|
51
|
+
type: ["left", "center", "right"],
|
|
52
|
+
default: "",
|
|
53
|
+
observer: () => {
|
|
54
|
+
o(this, c, u).call(this);
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
width: {
|
|
58
|
+
type: String,
|
|
59
|
+
default: "",
|
|
60
|
+
observer: () => {
|
|
61
|
+
o(this, c, u).call(this);
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
"label-width": {
|
|
65
|
+
type: String,
|
|
66
|
+
default: "",
|
|
67
|
+
observer: () => {
|
|
68
|
+
o(this, c, u).call(this);
|
|
69
|
+
}
|
|
70
|
+
},
|
|
71
|
+
"label-part": {
|
|
72
|
+
type: String,
|
|
73
|
+
default: "",
|
|
74
|
+
observer: () => {
|
|
75
|
+
o(this, c, u).call(this);
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"content-part": {
|
|
79
|
+
type: String,
|
|
80
|
+
default: "",
|
|
81
|
+
observer: () => {
|
|
82
|
+
o(this, c, u).call(this);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}));
|
|
86
|
+
this.stylesheet = U, this.$render();
|
|
87
|
+
}
|
|
88
|
+
static get observedAttributes() {
|
|
89
|
+
return [
|
|
90
|
+
...super.observedAttributes,
|
|
91
|
+
"label",
|
|
92
|
+
"colspan",
|
|
93
|
+
"rowspan",
|
|
94
|
+
"align",
|
|
95
|
+
"label-align",
|
|
96
|
+
"width",
|
|
97
|
+
"label-width",
|
|
98
|
+
"label-part",
|
|
99
|
+
"content-part"
|
|
100
|
+
];
|
|
101
|
+
}
|
|
102
|
+
$render() {
|
|
103
|
+
this.shadowRoot.innerHTML = `
|
|
104
|
+
<div class='ea-descriptions-item' part='container'>
|
|
105
|
+
<span class='ea-descriptions-item__label' part='label'>${this.label}</span>
|
|
106
|
+
<span class='ea-descriptions-item__content' part='content'>
|
|
107
|
+
<slot></slot>
|
|
108
|
+
</span>
|
|
109
|
+
</div>
|
|
110
|
+
`, h(this, C, this.shadowRoot.querySelector(".ea-descriptions-item__label"));
|
|
111
|
+
}
|
|
112
|
+
connectedCallback() {
|
|
113
|
+
super.connectedCallback(), o(this, c, I).call(this);
|
|
114
|
+
}
|
|
115
|
+
$beforeUnmounted() {
|
|
116
|
+
i(this, g) && (i(this, g).disconnect(), h(this, g, null));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
C = new WeakMap(), g = new WeakMap(), c = new WeakSet(), u = function() {
|
|
120
|
+
this.emit("ea-descriptions-item-change", {
|
|
121
|
+
bubbles: !0,
|
|
122
|
+
composed: !0
|
|
123
|
+
});
|
|
124
|
+
}, I = function() {
|
|
125
|
+
h(this, g, new MutationObserver(() => {
|
|
126
|
+
o(this, c, u).call(this);
|
|
127
|
+
})), i(this, g).observe(this, {
|
|
128
|
+
childList: !0,
|
|
129
|
+
subtree: !0,
|
|
130
|
+
characterData: !0
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
window.customElements.get("ea-descriptions-item") || window.customElements.define("ea-descriptions-item", F);
|
|
134
|
+
var S, m, j, q, x, R, w, L, z, A, H, D, f, E;
|
|
135
|
+
class G extends B {
|
|
136
|
+
constructor() {
|
|
137
|
+
super();
|
|
138
|
+
r(this, f);
|
|
139
|
+
/** @type {HTMLElement} */
|
|
140
|
+
r(this, S);
|
|
141
|
+
/** @type {HTMLElement} */
|
|
142
|
+
r(this, m);
|
|
143
|
+
/** @type {HTMLElement} */
|
|
144
|
+
r(this, j);
|
|
145
|
+
/** @type {HTMLElement} */
|
|
146
|
+
r(this, q);
|
|
147
|
+
/** @type {HTMLElement} */
|
|
148
|
+
r(this, x);
|
|
149
|
+
/** @type {HTMLSlotElement} */
|
|
150
|
+
r(this, R);
|
|
151
|
+
/** @type {AbortController | null} */
|
|
152
|
+
r(this, w);
|
|
153
|
+
M(this, "state", this.properties({
|
|
154
|
+
column: {
|
|
155
|
+
type: Number,
|
|
156
|
+
default: 3,
|
|
157
|
+
observer: () => {
|
|
158
|
+
o(this, f, E).call(this);
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
title: {
|
|
162
|
+
type: String,
|
|
163
|
+
default: "",
|
|
164
|
+
observer: (t) => {
|
|
165
|
+
i(this, j).textContent = t;
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
border: {
|
|
169
|
+
type: Boolean,
|
|
170
|
+
default: !1,
|
|
171
|
+
observer: () => {
|
|
172
|
+
this.updateContainerClasslist();
|
|
173
|
+
}
|
|
174
|
+
},
|
|
175
|
+
direction: {
|
|
176
|
+
type: ["horizontal", "vertical"],
|
|
177
|
+
default: "horizontal",
|
|
178
|
+
observer: () => {
|
|
179
|
+
o(this, f, E).call(this);
|
|
180
|
+
}
|
|
181
|
+
},
|
|
182
|
+
size: {
|
|
183
|
+
type: ["large", "default", "small"],
|
|
184
|
+
default: "default",
|
|
185
|
+
observer: () => {
|
|
186
|
+
this.updateContainerClasslist();
|
|
187
|
+
}
|
|
188
|
+
},
|
|
189
|
+
"label-width": {
|
|
190
|
+
type: String,
|
|
191
|
+
default: "",
|
|
192
|
+
observer: (t) => {
|
|
193
|
+
this.style.setProperty("--ea-descriptions-label-width", t);
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
}));
|
|
197
|
+
/**
|
|
198
|
+
* 处理子元素分割,将 HTML 描述转换为行列描述
|
|
199
|
+
* @param {HTMLElement[]} children 子元素
|
|
200
|
+
* @param {number} column 列数
|
|
201
|
+
* @return {Array<Array<Object>>} 分割后的二维数组
|
|
202
|
+
*/
|
|
203
|
+
r(this, L, (t, e) => {
|
|
204
|
+
const a = [];
|
|
205
|
+
return t.forEach((n) => {
|
|
206
|
+
var k;
|
|
207
|
+
const d = a.length, v = e % ((k = a[d]) == null ? void 0 : k.length) || 0, _ = {
|
|
208
|
+
label: n.label,
|
|
209
|
+
content: n.innerHTML,
|
|
210
|
+
colspan: n.colspan,
|
|
211
|
+
rowspan: n.rowspan,
|
|
212
|
+
align: n.align,
|
|
213
|
+
"label-align": n["label-align"],
|
|
214
|
+
width: n.width,
|
|
215
|
+
"label-width": n["label-width"] || this["label-width"],
|
|
216
|
+
"label-part": n["label-part"],
|
|
217
|
+
"content-part": n["content-part"]
|
|
218
|
+
};
|
|
219
|
+
for (let p = d; p < d + _.rowspan; p++) {
|
|
220
|
+
a[p] || (a[p] = []), _.rowspan > 1 && p !== d && (a[p][v] = {
|
|
221
|
+
colspan: 1,
|
|
222
|
+
rowspan: 1,
|
|
223
|
+
placeholder: !0
|
|
224
|
+
});
|
|
225
|
+
for (let y = v; y < v + _.colspan; y++)
|
|
226
|
+
_.colspan > 1 && y !== v && (a[p][y] = {
|
|
227
|
+
colspan: 1,
|
|
228
|
+
rowspan: 1,
|
|
229
|
+
placeholder: !0
|
|
230
|
+
});
|
|
231
|
+
}
|
|
232
|
+
let $ = a.findIndex((p) => p.length < e);
|
|
233
|
+
$ = $ === -1 ? d : $, a[d].reduce((p, y) => p + y.colspan, 0) + _.colspan <= e ? a[$].push(_) : a[$][v] = _;
|
|
234
|
+
}), a.map((n) => n.filter((d) => !d.placeholder)).filter((n) => n.length);
|
|
235
|
+
});
|
|
236
|
+
/**
|
|
237
|
+
* 获取 Descriptions 组件的样式类型
|
|
238
|
+
* @return {string} 变体名称
|
|
239
|
+
*/
|
|
240
|
+
r(this, z, () => this.direction === "vertical" ? "vertical" : this.border ? "border" : "normal");
|
|
241
|
+
/**
|
|
242
|
+
* Descriptions 组件的样式类型渲染器
|
|
243
|
+
*/
|
|
244
|
+
r(this, A, {
|
|
245
|
+
normal: (t) => b.EaElement.h(
|
|
246
|
+
"tr",
|
|
247
|
+
"ea-descriptions__tr",
|
|
248
|
+
{
|
|
249
|
+
part: "row",
|
|
250
|
+
style: [
|
|
251
|
+
t.align ? `--ea-descriptions-align: ${t.align};` : ""
|
|
252
|
+
].join(" ")
|
|
253
|
+
},
|
|
254
|
+
t.map(
|
|
255
|
+
(e, a) => b.EaElement.h(
|
|
256
|
+
"td",
|
|
257
|
+
"ea-descriptions__td",
|
|
258
|
+
{
|
|
259
|
+
part: "col-cell",
|
|
260
|
+
[e.rowspan > 1 ? "rowspan" : ""]: e.rowspan,
|
|
261
|
+
[e.colspan > 1 || a === t.length - 1 && t.length < this.column ? "colspan" : ""]: a === t.length - 1 && t.length < this.column && t.reduce((n, d) => n + d.colspan, 0) < this.column ? this.column - t.reduce((n, d) => n + d.colspan, 0) + (a < 1 ? 1 : a) : e.colspan,
|
|
262
|
+
style: [
|
|
263
|
+
e.width ? `--ea-descriptions-item-width: ${e.width}` : ""
|
|
264
|
+
]
|
|
265
|
+
},
|
|
266
|
+
[
|
|
267
|
+
b.EaElement.h(
|
|
268
|
+
"span",
|
|
269
|
+
"ea-descriptions__label",
|
|
270
|
+
{
|
|
271
|
+
part: `label cell ${e["label-part"]}`,
|
|
272
|
+
tabindex: 1,
|
|
273
|
+
style: [
|
|
274
|
+
e["label-align"] || e.align ? `--ea-descriptions-label-align: ${e["label-align"] || e.align};` : "",
|
|
275
|
+
e["label-width"] ? `--ea-descriptions-label-width: ${e["label-width"]}` : ""
|
|
276
|
+
].join(" ")
|
|
277
|
+
},
|
|
278
|
+
e.label
|
|
279
|
+
),
|
|
280
|
+
b.EaElement.h(
|
|
281
|
+
"span",
|
|
282
|
+
"ea-descriptions__content",
|
|
283
|
+
{
|
|
284
|
+
part: `content cell ${e["content-part"]}`,
|
|
285
|
+
tabindex: 1,
|
|
286
|
+
style: [
|
|
287
|
+
e.align ? `--ea-descriptions-align: ${e.align};` : ""
|
|
288
|
+
].join(" ").trim()
|
|
289
|
+
},
|
|
290
|
+
e.content
|
|
291
|
+
)
|
|
292
|
+
]
|
|
293
|
+
)
|
|
294
|
+
)
|
|
295
|
+
),
|
|
296
|
+
border: (t) => b.EaElement.h(
|
|
297
|
+
"tr",
|
|
298
|
+
"ea-descriptions__tr",
|
|
299
|
+
{
|
|
300
|
+
part: "row"
|
|
301
|
+
},
|
|
302
|
+
t.map(
|
|
303
|
+
(e, a) => [
|
|
304
|
+
b.EaElement.h(
|
|
305
|
+
"td",
|
|
306
|
+
"ea-descriptions__label",
|
|
307
|
+
{
|
|
308
|
+
part: `label cell ${e["label-part"]}`,
|
|
309
|
+
tabindex: 1,
|
|
310
|
+
colspan: 1,
|
|
311
|
+
rowspan: e.rowspan,
|
|
312
|
+
style: [
|
|
313
|
+
e.align ? `--ea-descriptions-align: ${e.align};` : "",
|
|
314
|
+
e["label-align"] || e.align ? `--ea-descriptions-label-align: ${e["label-align"] || e.align};` : "",
|
|
315
|
+
e.width ? `--ea-descriptions-item-width: ${e.width}` : "",
|
|
316
|
+
e["label-width"] ? `--ea-descriptions-label-width: ${e["label-width"]}` : ""
|
|
317
|
+
].join(" ")
|
|
318
|
+
},
|
|
319
|
+
e.label
|
|
320
|
+
),
|
|
321
|
+
b.EaElement.h(
|
|
322
|
+
"td",
|
|
323
|
+
"ea-descriptions__content",
|
|
324
|
+
{
|
|
325
|
+
part: `content cell ${e["content-part"]}`,
|
|
326
|
+
tabindex: 1,
|
|
327
|
+
rowspan: e.rowspan,
|
|
328
|
+
colspan: t.length < 3 && a === t.length - 1 ? 6 - (a + 1) : e.colspan || 1,
|
|
329
|
+
style: [
|
|
330
|
+
e.align ? `--ea-descriptions-align: ${e.align};` : "",
|
|
331
|
+
e.width ? `--ea-descriptions-item-width: ${e.width}` : ""
|
|
332
|
+
].join(" ")
|
|
333
|
+
},
|
|
334
|
+
e.content
|
|
335
|
+
)
|
|
336
|
+
].join("")
|
|
337
|
+
)
|
|
338
|
+
),
|
|
339
|
+
vertical: (t) => [
|
|
340
|
+
b.EaElement.h(
|
|
341
|
+
"tr",
|
|
342
|
+
"ea-descriptions__tr",
|
|
343
|
+
{
|
|
344
|
+
part: "row row-label"
|
|
345
|
+
},
|
|
346
|
+
t.map(
|
|
347
|
+
(e, a) => b.EaElement.h(
|
|
348
|
+
"th",
|
|
349
|
+
"ea-descriptions__label ea-descriptions__th",
|
|
350
|
+
{
|
|
351
|
+
part: `label cell ${e["label-part"]}`,
|
|
352
|
+
tabindex: 1,
|
|
353
|
+
rowspan: 1,
|
|
354
|
+
colspan: t.length < 3 && a === t.length - 1 ? 6 - (a + 1) : e.colspan || 1,
|
|
355
|
+
style: [
|
|
356
|
+
e.align ? `--ea-descriptions-align: ${e.align};` : "",
|
|
357
|
+
e["label-align"] || e.align ? `--ea-descriptions-label-align: ${e["label-align"] || e.align};` : "",
|
|
358
|
+
e.width ? `--ea-descriptions-item-width: ${e.width}` : "",
|
|
359
|
+
e["label-width"] ? `--ea-descriptions-label-width: ${e["label-width"]}` : ""
|
|
360
|
+
].join(" ")
|
|
361
|
+
},
|
|
362
|
+
e.label
|
|
363
|
+
)
|
|
364
|
+
)
|
|
365
|
+
),
|
|
366
|
+
b.EaElement.h(
|
|
367
|
+
"tr",
|
|
368
|
+
"ea-descriptions__tr",
|
|
369
|
+
{
|
|
370
|
+
part: "row row-content"
|
|
371
|
+
},
|
|
372
|
+
t.map(
|
|
373
|
+
(e, a) => b.EaElement.h(
|
|
374
|
+
"td",
|
|
375
|
+
"ea-descriptions__content ea-descriptions__td",
|
|
376
|
+
{
|
|
377
|
+
part: `content cell ${e["content-part"]}`,
|
|
378
|
+
tabindex: 1,
|
|
379
|
+
rowspan: e.rowspan * 2 - 1,
|
|
380
|
+
colspan: t.length < 3 && a === t.length - 1 ? 6 - (a + 1) : e.colspan || 1,
|
|
381
|
+
style: [
|
|
382
|
+
e.align ? `--ea-descriptions-align: ${e.align};` : "",
|
|
383
|
+
e.width ? `--ea-descriptions-item-width: ${e.width}` : ""
|
|
384
|
+
].join(" ")
|
|
385
|
+
},
|
|
386
|
+
e.content
|
|
387
|
+
)
|
|
388
|
+
)
|
|
389
|
+
)
|
|
390
|
+
].join("")
|
|
391
|
+
});
|
|
392
|
+
/**
|
|
393
|
+
* 监听默认插槽变化
|
|
394
|
+
*/
|
|
395
|
+
r(this, H, () => {
|
|
396
|
+
o(this, f, E).call(this);
|
|
397
|
+
});
|
|
398
|
+
/**
|
|
399
|
+
* 监听子元素变化
|
|
400
|
+
* @param {Event} e
|
|
401
|
+
*/
|
|
402
|
+
r(this, D, (t) => {
|
|
403
|
+
t.stopImmediatePropagation(), o(this, f, E).call(this);
|
|
404
|
+
});
|
|
405
|
+
this.stylesheet = V, this.$render();
|
|
406
|
+
}
|
|
407
|
+
static get observedAttributes() {
|
|
408
|
+
return [
|
|
409
|
+
...super.observedAttributes,
|
|
410
|
+
"column",
|
|
411
|
+
"title",
|
|
412
|
+
"border",
|
|
413
|
+
"direction",
|
|
414
|
+
"size",
|
|
415
|
+
"label-width"
|
|
416
|
+
];
|
|
417
|
+
}
|
|
418
|
+
/**
|
|
419
|
+
* 获取 classlist 列表
|
|
420
|
+
* @return {string} 属性值
|
|
421
|
+
*/
|
|
422
|
+
updateContainerClasslist() {
|
|
423
|
+
const t = this.computedClasslist("ea-descriptions", {
|
|
424
|
+
"--border": this.border,
|
|
425
|
+
["--" + this.size]: this.size
|
|
426
|
+
});
|
|
427
|
+
return i(this, S).className = t, t;
|
|
428
|
+
}
|
|
429
|
+
$render() {
|
|
430
|
+
this.shadowRoot.innerHTML = `
|
|
431
|
+
<slot id='defaultSlot' part='default-slot'></slot>
|
|
432
|
+
<table class='ea-descriptions' part='container'>
|
|
433
|
+
<caption class='ea-descriptions__caption' part='caption'>
|
|
434
|
+
<section class='ea-descriptions__title' part='title'>
|
|
435
|
+
<slot name='title'></slot>
|
|
436
|
+
</section>
|
|
437
|
+
<section class='ea-descriptions__extra' part='extra'>
|
|
438
|
+
<slot name='extra'></slot>
|
|
439
|
+
</section>
|
|
440
|
+
</caption>
|
|
441
|
+
<tbody class='ea-descriptions__body' part='body'>
|
|
442
|
+
</tbody>
|
|
443
|
+
</table>
|
|
444
|
+
`, h(this, S, this.shadowRoot.querySelector(".ea-descriptions")), h(this, m, this.shadowRoot.querySelector(".ea-descriptions__caption")), h(this, j, this.shadowRoot.querySelector(
|
|
445
|
+
".ea-descriptions__title slot[name='title']"
|
|
446
|
+
)), h(this, q, this.shadowRoot.querySelector(".ea-descriptions__extra")), h(this, x, this.shadowRoot.querySelector(".ea-descriptions__body")), h(this, R, this.shadowRoot.querySelector("#defaultSlot"));
|
|
447
|
+
}
|
|
448
|
+
async connectedCallback() {
|
|
449
|
+
var t;
|
|
450
|
+
super.connectedCallback(), await customElements.whenDefined("ea-descriptions-item"), (t = i(this, w)) == null || t.abort(), h(this, w, new AbortController()), o(this, f, E).call(this), this.addEventListener(
|
|
451
|
+
"ea-descriptions-item-change",
|
|
452
|
+
i(this, D),
|
|
453
|
+
{ signal: i(this, w).signal }
|
|
454
|
+
), i(this, R).addEventListener("slotchange", i(this, H), {
|
|
455
|
+
signal: i(this, w).signal
|
|
456
|
+
});
|
|
457
|
+
}
|
|
458
|
+
$beforeUnmounted() {
|
|
459
|
+
var t;
|
|
460
|
+
(t = i(this, w)) == null || t.abort();
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
S = new WeakMap(), m = new WeakMap(), j = new WeakMap(), q = new WeakMap(), x = new WeakMap(), R = new WeakMap(), w = new WeakMap(), L = new WeakMap(), z = new WeakMap(), A = new WeakMap(), H = new WeakMap(), D = new WeakMap(), f = new WeakSet(), /**
|
|
464
|
+
* 渲染默认插槽内容
|
|
465
|
+
*/
|
|
466
|
+
E = function() {
|
|
467
|
+
const t = [...this.querySelectorAll("ea-descriptions-item")];
|
|
468
|
+
i(this, x).innerHTML = i(this, L).call(this, t, this.column).map(i(this, A)[i(this, z).call(this)]).join("");
|
|
469
|
+
};
|
|
470
|
+
window.customElements.get("ea-descriptions") || window.customElements.define("ea-descriptions", G);
|
|
471
|
+
export {
|
|
472
|
+
G as EaDescriptions,
|
|
473
|
+
F as EaDescriptionsItem
|
|
474
|
+
};
|