easy-component-ui 3.0.11 → 3.0.13
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/dist/assets/icon.css +1 -1
- package/dist/components/Base.js +190 -188
- package/dist/components/ea-alert.js +71 -54
- package/dist/components/ea-avatar.js +42 -37
- package/dist/components/ea-breadcrumb.js +33 -33
- package/dist/components/ea-button.js +53 -52
- package/dist/components/ea-card.js +63 -27
- package/dist/components/ea-carousel.js +2 -2
- package/dist/components/ea-collapse.js +93 -73
- package/dist/components/ea-color-picker.js +221 -221
- package/dist/components/ea-container.js +90 -61
- package/dist/components/ea-countdown.js +77 -56
- package/dist/components/ea-date-picker.js +1 -1
- package/dist/components/ea-descriptions.js +133 -70
- package/dist/components/ea-dialog.js +4 -4
- package/dist/components/ea-drawer.js +93 -71
- package/dist/components/ea-empty.js +31 -23
- package/dist/components/ea-icon.js +122 -32
- package/dist/components/ea-image-preview.js +237 -193
- package/dist/components/ea-image.js +69 -44
- package/dist/components/ea-input-number.js +9 -9
- package/dist/components/ea-input.js +15 -15
- package/dist/components/ea-layout.js +10 -3
- package/dist/components/ea-link.js +1 -1
- package/dist/components/ea-menu.js +69 -53
- package/dist/components/ea-message-box.js +73 -73
- package/dist/components/ea-message.js +184 -121
- package/dist/components/ea-notification.js +80 -80
- package/dist/components/ea-overlay.js +41 -34
- package/dist/components/ea-page-header.js +5 -5
- package/dist/components/ea-pagination.js +6 -5
- package/dist/components/ea-popconfirm.js +133 -78
- package/dist/components/ea-popover.js +35 -11
- package/dist/components/ea-popper.js +9 -9
- package/dist/components/ea-progress.js +88 -71
- package/dist/components/ea-rate.js +1 -1
- package/dist/components/ea-result.js +20 -20
- package/dist/components/ea-select.js +119 -108
- package/dist/components/ea-skeleton.js +99 -82
- package/dist/components/ea-slider.js +88 -79
- package/dist/components/ea-splitter.js +34 -18
- package/dist/components/ea-statistic.js +72 -4
- package/dist/components/ea-steps.js +108 -74
- package/dist/components/ea-table.js +562 -434
- package/dist/components/ea-tabs.js +28 -28
- package/dist/components/ea-tag.js +37 -43
- package/dist/components/ea-time-picker.js +2 -6
- package/dist/components/ea-timeline.js +11 -12
- package/dist/components/ea-tooltip.js +63 -23
- package/dist/components/ea-tour.js +21 -21
- package/dist/components/ea-transfer.js +2 -2
- package/dist/components/ea-tree.js +1 -1
- package/dist/components/index.js +1 -2
- package/dist/css/ea-card.style.js +2 -2
- package/dist/css/ea-collapse-item.style.js +1 -1
- package/dist/css/ea-color-picker-panel.style.js +1 -1
- package/dist/css/ea-container.style.js +1 -1
- package/dist/css/ea-descriptions-item.style.js +2 -2
- package/dist/css/ea-descriptions.style.js +1 -1
- package/dist/css/ea-empty.style.js +1 -1
- package/dist/css/ea-footer.style.js +1 -1
- package/dist/css/ea-progress.style.js +1 -1
- package/dist/css/ea-skeleton.style.js +1 -1
- package/dist/css/ea-step.style.js +1 -1
- package/dist/css/ea-switch.style.js +1 -1
- package/dist/css/ea-tab.style.js +1 -1
- package/dist/css/ea-table-column.style.js +4 -0
- package/dist/css/ea-table.style.js +1 -1
- package/dist/css/ea-tabs.style.js +1 -1
- package/dist/css/ea-tag.style.js +1 -1
- package/dist/css/ea-time-picker.style.js +1 -1
- package/dist/css/ea-timeline-item.style.js +1 -1
- package/dist/utils/Variables.js +10 -17
- package/dist/utils/parseTime.js +73 -0
- package/package.json +302 -304
- package/dist/components/ea-loading.js +0 -151
- package/dist/components/ea-statistic2.js +0 -83
|
@@ -3,17 +3,17 @@ var B = (a) => {
|
|
|
3
3
|
throw TypeError(a);
|
|
4
4
|
};
|
|
5
5
|
var I = (a, r, t) => r in a ? z(a, r, { enumerable: !0, configurable: !0, writable: !0, value: t }) : a[r] = t;
|
|
6
|
-
var E = (a, r, t) => I(a, typeof r != "symbol" ? r + "" : r, t),
|
|
7
|
-
var e = (a, r, t) => (
|
|
8
|
-
import { F as
|
|
9
|
-
import { s as
|
|
10
|
-
import { E as
|
|
6
|
+
var E = (a, r, t) => I(a, typeof r != "symbol" ? r + "" : r, t), P = (a, r, t) => r.has(a) || B("Cannot " + t);
|
|
7
|
+
var e = (a, r, t) => (P(a, r, "read from private field"), t ? t.call(a) : r.get(a)), i = (a, r, t) => r.has(a) ? B("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(a) : r.set(a, t), c = (a, r, t, s) => (P(a, r, "write to private field"), s ? s.call(a, t) : r.set(a, t), t);
|
|
8
|
+
import { F as H } from "../core/FormBase.js";
|
|
9
|
+
import { s as X } from "../css/ea-slider.style.js";
|
|
10
|
+
import { E as Y } from "../utils/Variables.js";
|
|
11
11
|
import "./ea-tooltip.js";
|
|
12
12
|
import "./ea-input-number.js";
|
|
13
|
-
import { n as
|
|
14
|
-
import { E as
|
|
15
|
-
var k, v, l, b, g, y,
|
|
16
|
-
class
|
|
13
|
+
import { n as O } from "./ea-calendar2.js";
|
|
14
|
+
import { E as U } from "../utils/Utils.js";
|
|
15
|
+
var k, v, l, b, g, y, d, x, u, w, p, $, V, S, N, C, m, M, A, D, L, q, F, R;
|
|
16
|
+
class j extends H {
|
|
17
17
|
constructor() {
|
|
18
18
|
super();
|
|
19
19
|
/** @type {HTMLElement} */
|
|
@@ -29,16 +29,16 @@ class U extends P {
|
|
|
29
29
|
/** @type {HTMLElement} */
|
|
30
30
|
i(this, y);
|
|
31
31
|
/** @type {HTMLElement} */
|
|
32
|
-
i(this,
|
|
32
|
+
i(this, d);
|
|
33
33
|
/** @type {HTMLElement} */
|
|
34
|
-
i(this,
|
|
34
|
+
i(this, x);
|
|
35
35
|
/** @type {AbortController} */
|
|
36
|
-
i(this,
|
|
36
|
+
i(this, u, new AbortController());
|
|
37
37
|
i(this, w, {
|
|
38
38
|
/** @type {AbortController} */
|
|
39
39
|
input: null
|
|
40
40
|
});
|
|
41
|
-
i(this,
|
|
41
|
+
i(this, p, {
|
|
42
42
|
isInputNumberDefined: !1,
|
|
43
43
|
isDragging: !1,
|
|
44
44
|
startX: 0,
|
|
@@ -49,7 +49,7 @@ class U extends P {
|
|
|
49
49
|
type: String,
|
|
50
50
|
default: "",
|
|
51
51
|
observer: async (t) => {
|
|
52
|
-
e(this,
|
|
52
|
+
e(this, x).textContent = t;
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
value: {
|
|
@@ -57,35 +57,35 @@ class U extends P {
|
|
|
57
57
|
default: 0,
|
|
58
58
|
observer: (t) => {
|
|
59
59
|
const s = Math.max(this.min, Math.min(this.max, t));
|
|
60
|
-
this.setValue(s), e(this,
|
|
60
|
+
this.setValue(s), e(this, m).call(this);
|
|
61
61
|
}
|
|
62
62
|
},
|
|
63
63
|
min: {
|
|
64
64
|
type: Number,
|
|
65
65
|
default: 0,
|
|
66
66
|
observer: () => {
|
|
67
|
-
e(this,
|
|
67
|
+
e(this, m).call(this);
|
|
68
68
|
}
|
|
69
69
|
},
|
|
70
70
|
max: {
|
|
71
71
|
type: Number,
|
|
72
72
|
default: 100,
|
|
73
73
|
observer: () => {
|
|
74
|
-
e(this,
|
|
74
|
+
e(this, m).call(this);
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
77
|
"show-stops": {
|
|
78
78
|
type: Boolean,
|
|
79
79
|
default: !1,
|
|
80
80
|
observer: (t) => {
|
|
81
|
-
this.updateContainerClasslist(), t && e(this,
|
|
81
|
+
this.updateContainerClasslist(), t && e(this, $).call(this);
|
|
82
82
|
}
|
|
83
83
|
},
|
|
84
84
|
step: {
|
|
85
85
|
type: Number,
|
|
86
86
|
default: 1,
|
|
87
87
|
observer: (t) => {
|
|
88
|
-
e(this,
|
|
88
|
+
e(this, m).call(this);
|
|
89
89
|
}
|
|
90
90
|
},
|
|
91
91
|
disabled: {
|
|
@@ -99,7 +99,7 @@ class U extends P {
|
|
|
99
99
|
type: Boolean,
|
|
100
100
|
default: !1,
|
|
101
101
|
observer: () => {
|
|
102
|
-
e(this,
|
|
102
|
+
e(this, m).call(this);
|
|
103
103
|
}
|
|
104
104
|
},
|
|
105
105
|
"show-tooltip": {
|
|
@@ -134,16 +134,16 @@ class U extends P {
|
|
|
134
134
|
default: !1,
|
|
135
135
|
observer: async (t) => {
|
|
136
136
|
var s;
|
|
137
|
-
e(this,
|
|
137
|
+
e(this, p).isInputNumberDefined || (await customElements.whenDefined("ea-input-number"), e(this, p).isInputNumberDefined = !0), (s = e(this, w).input) == null || s.abort(), e(this, m).call(this), t && (e(this, w).input = new AbortController(), e(this, d).addEventListener("ea-change", e(this, L), {
|
|
138
138
|
signal: e(this, w).input.signal
|
|
139
139
|
}));
|
|
140
140
|
}
|
|
141
141
|
},
|
|
142
142
|
size: {
|
|
143
|
-
type:
|
|
143
|
+
type: Y,
|
|
144
144
|
default: "",
|
|
145
145
|
observer: async (t) => {
|
|
146
|
-
this.updateContainerClasslist(), this["show-input"] && e(this,
|
|
146
|
+
this.updateContainerClasslist(), this["show-input"] && e(this, d).setAttribute("size", t);
|
|
147
147
|
}
|
|
148
148
|
},
|
|
149
149
|
required: {
|
|
@@ -157,7 +157,7 @@ class U extends P {
|
|
|
157
157
|
type: Object,
|
|
158
158
|
default: null,
|
|
159
159
|
observer: () => {
|
|
160
|
-
e(this,
|
|
160
|
+
e(this, S).call(this);
|
|
161
161
|
}
|
|
162
162
|
}
|
|
163
163
|
}));
|
|
@@ -168,20 +168,20 @@ class U extends P {
|
|
|
168
168
|
type: Function,
|
|
169
169
|
default: (t) => (s) => s,
|
|
170
170
|
observer: () => {
|
|
171
|
-
e(this,
|
|
171
|
+
e(this, m).call(this);
|
|
172
172
|
}
|
|
173
173
|
}
|
|
174
174
|
}));
|
|
175
175
|
/**
|
|
176
176
|
* 渲染 stop 元素(包括步长节点和 marks 节点)
|
|
177
177
|
*/
|
|
178
|
-
i(this,
|
|
179
|
-
const t = [], s = this.step,
|
|
178
|
+
i(this, $, () => {
|
|
179
|
+
const t = [], s = this.step, o = (this.max - this.min) / s + 1;
|
|
180
180
|
if (this["show-stops"])
|
|
181
|
-
for (let n = 0; n <
|
|
182
|
-
const
|
|
181
|
+
for (let n = 0; n < o; n++) {
|
|
182
|
+
const h = this.min + s * n, T = (h - this.min) / (this.max - this.min) * 100;
|
|
183
183
|
t.push({
|
|
184
|
-
value:
|
|
184
|
+
value: h,
|
|
185
185
|
percentage: T,
|
|
186
186
|
type: "stop",
|
|
187
187
|
className: this.ns.e("stop"),
|
|
@@ -190,11 +190,11 @@ class U extends P {
|
|
|
190
190
|
}
|
|
191
191
|
if (this.marks)
|
|
192
192
|
for (const n in this.marks) {
|
|
193
|
-
const
|
|
194
|
-
if (isNaN(
|
|
195
|
-
const T = (
|
|
193
|
+
const h = parseFloat(n);
|
|
194
|
+
if (isNaN(h) || h < this.min || h > this.max) continue;
|
|
195
|
+
const T = (h - this.min) / (this.max - this.min) * 100;
|
|
196
196
|
t.push({
|
|
197
|
-
value:
|
|
197
|
+
value: h,
|
|
198
198
|
percentage: T,
|
|
199
199
|
type: "mark-stop",
|
|
200
200
|
className: `${this.ns.e("stop")} ${this.ns.e("mark-stop")}`,
|
|
@@ -202,9 +202,9 @@ class U extends P {
|
|
|
202
202
|
label: this.marks[n]
|
|
203
203
|
});
|
|
204
204
|
}
|
|
205
|
-
t.sort((n,
|
|
205
|
+
t.sort((n, h) => n.value - h.value);
|
|
206
206
|
const f = t.map(
|
|
207
|
-
(n) =>
|
|
207
|
+
(n) => U.EaElement.h("div", n.className, {
|
|
208
208
|
part: n.part,
|
|
209
209
|
style: [`${this.vertical ? "top" : "left"}: ${n.percentage}%;`]
|
|
210
210
|
})
|
|
@@ -221,9 +221,9 @@ class U extends P {
|
|
|
221
221
|
}
|
|
222
222
|
let t = "";
|
|
223
223
|
for (const s in this.marks) {
|
|
224
|
-
const
|
|
225
|
-
if (isNaN(
|
|
226
|
-
const f = (
|
|
224
|
+
const o = parseFloat(s);
|
|
225
|
+
if (isNaN(o) || o < this.min || o > this.max) continue;
|
|
226
|
+
const f = (o - this.min) / (this.max - this.min) * 100, n = this.marks[s];
|
|
227
227
|
this.vertical ? t += `
|
|
228
228
|
<div class='${this.ns.e("mark")}' style="top: ${f}%;">
|
|
229
229
|
<div class='${this.ns.e("mark-label")}'>${n}</div>
|
|
@@ -239,24 +239,33 @@ class U extends P {
|
|
|
239
239
|
/**
|
|
240
240
|
* 统一渲染 marks 和 stops
|
|
241
241
|
*/
|
|
242
|
-
i(this,
|
|
243
|
-
e(this,
|
|
242
|
+
i(this, S, () => {
|
|
243
|
+
e(this, $).call(this), e(this, V).call(this);
|
|
244
|
+
});
|
|
245
|
+
/**
|
|
246
|
+
* 修复浮点数精度问题
|
|
247
|
+
* @param {number} value 原始值
|
|
248
|
+
* @returns {number} 修复精度后的值
|
|
249
|
+
*/
|
|
250
|
+
i(this, N, (t) => {
|
|
251
|
+
const s = this.step.toString(), o = s.includes(".") ? s.split(".")[1].length : 0;
|
|
252
|
+
return parseFloat(t.toFixed(o));
|
|
244
253
|
});
|
|
245
254
|
/**
|
|
246
255
|
* 根据鼠标位置计算滑块值
|
|
247
256
|
* @param {number} position 鼠标位置
|
|
248
257
|
* @returns {number} 滑块值
|
|
249
258
|
*/
|
|
250
|
-
i(this,
|
|
251
|
-
const s = e(this, v).getBoundingClientRect(),
|
|
252
|
-
return Math.max(this.min, Math.min(this.max,
|
|
259
|
+
i(this, C, (t) => {
|
|
260
|
+
const s = e(this, v).getBoundingClientRect(), o = this.vertical ? (t - s.top) / s.height : (t - s.left) / s.width, f = Math.max(0, Math.min(1, o)), n = this.min + f * (this.max - this.min), h = Math.round(n / this.step) * this.step;
|
|
261
|
+
return e(this, N).call(this, Math.max(this.min, Math.min(this.max, h)));
|
|
253
262
|
});
|
|
254
263
|
/**
|
|
255
264
|
* 更新滑块位置和 tooltip 内容
|
|
256
265
|
*/
|
|
257
|
-
i(this,
|
|
266
|
+
i(this, m, () => {
|
|
258
267
|
const t = this.value, s = (t - this.min) / (this.max - this.min) * 100;
|
|
259
|
-
this.vertical ? (e(this, l).style.top = `${s}%`, e(this, l).style.left = "50%") : (e(this, l).style.left = `${s}%`, e(this, l).style.top = "50%"), e(this, g).textContent = this.formatTooltip(t), e(this, g).style.display = this["show-tooltip"] ? "block" : "none", this["show-input"] && (e(this,
|
|
268
|
+
this.vertical ? (e(this, l).style.top = `${s}%`, e(this, l).style.left = "50%") : (e(this, l).style.left = `${s}%`, e(this, l).style.top = "50%"), e(this, g).textContent = this.formatTooltip(t), e(this, g).style.display = this["show-tooltip"] ? "block" : "none", this["show-input"] && (e(this, d).value = t, e(this, d).min = this.min, e(this, d).max = this.max, e(this, d).step = this.step), this.updateContainerClasslist();
|
|
260
269
|
});
|
|
261
270
|
/**
|
|
262
271
|
* 鼠标按下时,更新滑块值
|
|
@@ -264,64 +273,64 @@ class U extends P {
|
|
|
264
273
|
*/
|
|
265
274
|
i(this, M, (t) => {
|
|
266
275
|
if (this.disabled) return;
|
|
267
|
-
t.preventDefault(), t.stopPropagation(), e(this,
|
|
268
|
-
const s = e(this,
|
|
276
|
+
t.preventDefault(), t.stopPropagation(), e(this, p).isDragging = !0, e(this, p).startX = t.clientX, e(this, p).startY = t.clientY, e(this, l).setAttribute("visible", "true");
|
|
277
|
+
const s = e(this, C).call(this, this.vertical ? t.clientY : t.clientX);
|
|
269
278
|
this.value = s, this.emit("input", { detail: { value: this.value } });
|
|
270
279
|
});
|
|
271
280
|
/**
|
|
272
281
|
* 鼠标移动时,更新滑块值
|
|
273
282
|
* @param {MouseEvent} e
|
|
274
283
|
*/
|
|
275
|
-
i(this,
|
|
276
|
-
if (!e(this,
|
|
284
|
+
i(this, A, (t) => {
|
|
285
|
+
if (!e(this, p).isDragging || this.disabled) return;
|
|
277
286
|
t.preventDefault(), t.stopPropagation();
|
|
278
|
-
const s = e(this,
|
|
287
|
+
const s = e(this, C).call(this, this.vertical ? t.clientY : t.clientX);
|
|
279
288
|
this.value = s, this.emit("input", { detail: { value: this.value } });
|
|
280
289
|
});
|
|
281
290
|
/**
|
|
282
291
|
* 鼠标松开时,更新滑块值
|
|
283
292
|
*/
|
|
284
|
-
i(this,
|
|
285
|
-
e(this,
|
|
293
|
+
i(this, D, () => {
|
|
294
|
+
e(this, p).isDragging && (e(this, p).isDragging = !1, e(this, l).setAttribute("visible", "false"), this.emit("change", { detail: { value: this.value } }));
|
|
286
295
|
});
|
|
287
296
|
/**
|
|
288
297
|
* 输入框值改变时,更新滑块值
|
|
289
298
|
* @param {CustomEvent} e
|
|
290
299
|
*/
|
|
291
|
-
i(this,
|
|
300
|
+
i(this, L, (t) => {
|
|
292
301
|
t.preventDefault(), t.stopImmediatePropagation();
|
|
293
|
-
const s = parseFloat(t.detail.currentValue),
|
|
294
|
-
this.value =
|
|
302
|
+
const s = parseFloat(t.detail.currentValue), o = Math.max(this.min, Math.min(this.max, s));
|
|
303
|
+
this.value = o, this.emit("change", { detail: { value: this.value } });
|
|
295
304
|
});
|
|
296
305
|
/**
|
|
297
306
|
* 鼠标进入滑块时,显示 tooltip 的 触发 元素
|
|
298
307
|
*/
|
|
299
|
-
i(this,
|
|
308
|
+
i(this, q, () => {
|
|
300
309
|
this.disabled || e(this, l).setAttribute("visible", "true");
|
|
301
310
|
});
|
|
302
311
|
/**
|
|
303
312
|
* 鼠标离开滑块时,隐藏 tooltip 的 触发 元素
|
|
304
313
|
*/
|
|
305
|
-
i(this,
|
|
306
|
-
this.disabled || e(this,
|
|
314
|
+
i(this, F, () => {
|
|
315
|
+
this.disabled || e(this, p).isDragging || e(this, l).setAttribute("visible", "false");
|
|
307
316
|
});
|
|
308
317
|
i(this, R, () => {
|
|
309
318
|
var t;
|
|
310
|
-
(t = e(this,
|
|
311
|
-
signal: e(this,
|
|
319
|
+
(t = e(this, u)) == null || t.abort(), c(this, u, new AbortController()), e(this, v).addEventListener("mousedown", e(this, M), {
|
|
320
|
+
signal: e(this, u).signal
|
|
312
321
|
}), e(this, b).addEventListener("mousedown", e(this, M), {
|
|
313
|
-
signal: e(this,
|
|
314
|
-
}), e(this, b).addEventListener("mouseenter", e(this,
|
|
315
|
-
signal: e(this,
|
|
316
|
-
}), e(this, b).addEventListener("mouseleave", e(this,
|
|
317
|
-
signal: e(this,
|
|
318
|
-
}), document.addEventListener("mousemove", e(this,
|
|
319
|
-
signal: e(this,
|
|
320
|
-
}), document.addEventListener("mouseup", e(this,
|
|
321
|
-
signal: e(this,
|
|
322
|
+
signal: e(this, u).signal
|
|
323
|
+
}), e(this, b).addEventListener("mouseenter", e(this, q), {
|
|
324
|
+
signal: e(this, u).signal
|
|
325
|
+
}), e(this, b).addEventListener("mouseleave", e(this, F), {
|
|
326
|
+
signal: e(this, u).signal
|
|
327
|
+
}), document.addEventListener("mousemove", e(this, A), {
|
|
328
|
+
signal: e(this, u).signal
|
|
329
|
+
}), document.addEventListener("mouseup", e(this, D), {
|
|
330
|
+
signal: e(this, u).signal
|
|
322
331
|
});
|
|
323
332
|
});
|
|
324
|
-
this.stylesheet =
|
|
333
|
+
this.stylesheet = X, this.$render();
|
|
325
334
|
}
|
|
326
335
|
static get observedAttributes() {
|
|
327
336
|
return [
|
|
@@ -362,7 +371,7 @@ class U extends P {
|
|
|
362
371
|
return e(this, k).className = t, t;
|
|
363
372
|
}
|
|
364
373
|
$render() {
|
|
365
|
-
const t =
|
|
374
|
+
const t = O("slider");
|
|
366
375
|
this.ns = t, this.shadowRoot.innerHTML = `
|
|
367
376
|
<label class='${t.e("form-label")}' part='form-label'></label>
|
|
368
377
|
<div class='${t.b()}' part='container'>
|
|
@@ -376,14 +385,14 @@ class U extends P {
|
|
|
376
385
|
</div>
|
|
377
386
|
<ea-input-number class='${t.e("input")}' part='input'></ea-input-number>
|
|
378
387
|
</div>
|
|
379
|
-
`, c(this,
|
|
388
|
+
`, c(this, x, this.shadowRoot.querySelector(t.ce("form-label"))), c(this, k, this.shadowRoot.querySelector(t.cb())), c(this, v, this.shadowRoot.querySelector(t.ce("rail"))), c(this, l, this.shadowRoot.querySelector(t.ce("trigger"))), c(this, b, this.shadowRoot.querySelector(t.ce("thumb"))), c(this, g, this.shadowRoot.querySelector(t.ce("tooltip"))), c(this, y, this.shadowRoot.querySelector(t.ce("marks"))), c(this, d, this.shadowRoot.querySelector(t.ce("input")));
|
|
380
389
|
}
|
|
381
390
|
/**
|
|
382
391
|
* 获取验证目标元素
|
|
383
392
|
* @returns {HTMLElement}
|
|
384
393
|
*/
|
|
385
394
|
get validationTarget() {
|
|
386
|
-
return e(this,
|
|
395
|
+
return e(this, d);
|
|
387
396
|
}
|
|
388
397
|
/**
|
|
389
398
|
* 更新表单验证状态
|
|
@@ -407,15 +416,15 @@ class U extends P {
|
|
|
407
416
|
return this.updateValidity(), this.internals.reportValidity();
|
|
408
417
|
}
|
|
409
418
|
connectedCallback() {
|
|
410
|
-
super.connectedCallback(), e(this, R).call(this), e(this,
|
|
419
|
+
super.connectedCallback(), e(this, R).call(this), e(this, m).call(this);
|
|
411
420
|
}
|
|
412
421
|
$beforeUnmounted() {
|
|
413
422
|
var t;
|
|
414
|
-
(t = e(this,
|
|
423
|
+
(t = e(this, u)) == null || t.abort();
|
|
415
424
|
}
|
|
416
425
|
}
|
|
417
|
-
k = new WeakMap(), v = new WeakMap(), l = new WeakMap(), b = new WeakMap(), g = new WeakMap(), y = new WeakMap(),
|
|
418
|
-
window.customElements.get("ea-slider") || window.customElements.define("ea-slider",
|
|
426
|
+
k = new WeakMap(), v = new WeakMap(), l = new WeakMap(), b = new WeakMap(), g = new WeakMap(), y = new WeakMap(), d = new WeakMap(), x = new WeakMap(), u = new WeakMap(), w = new WeakMap(), p = new WeakMap(), $ = new WeakMap(), V = new WeakMap(), S = new WeakMap(), N = new WeakMap(), C = new WeakMap(), m = new WeakMap(), M = new WeakMap(), A = new WeakMap(), D = new WeakMap(), L = new WeakMap(), q = new WeakMap(), F = new WeakMap(), R = new WeakMap();
|
|
427
|
+
window.customElements.get("ea-slider") || window.customElements.define("ea-slider", j);
|
|
419
428
|
export {
|
|
420
|
-
|
|
429
|
+
j as EaSlider
|
|
421
430
|
};
|
|
@@ -23,7 +23,10 @@ class D extends N {
|
|
|
23
23
|
type: ["horizontal", "vertical"],
|
|
24
24
|
default: "horizontal",
|
|
25
25
|
observer: (t) => {
|
|
26
|
-
n(this, a).style.setProperty(
|
|
26
|
+
n(this, a).style.setProperty(
|
|
27
|
+
"--ea-splitter-direction",
|
|
28
|
+
t === "vertical" ? "column" : "row"
|
|
29
|
+
), n(this, a).className = this.updateContainerClasslist();
|
|
27
30
|
}
|
|
28
31
|
}
|
|
29
32
|
}));
|
|
@@ -32,14 +35,18 @@ class D extends N {
|
|
|
32
35
|
* @param {string} eventName 事件名称
|
|
33
36
|
*/
|
|
34
37
|
c(this, h, (t) => {
|
|
35
|
-
this.dispatchEvent(
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
38
|
+
this.dispatchEvent(
|
|
39
|
+
new CustomEvent(t, {
|
|
40
|
+
detail: {
|
|
41
|
+
size: [...this.children].filter((i) => i.tagName === "EA-SPLITTER-PANEL").map(
|
|
42
|
+
(i) => {
|
|
43
|
+
var o;
|
|
44
|
+
return (o = i.getBoundingClientRect()) == null ? void 0 : o[this.layout === "vertical" ? "height" : "width"];
|
|
45
|
+
}
|
|
46
|
+
)
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
);
|
|
43
50
|
});
|
|
44
51
|
/**
|
|
45
52
|
* `layout="horizontal"` 时的 `resize` 事件监听
|
|
@@ -57,7 +64,11 @@ class D extends N {
|
|
|
57
64
|
}, A = () => {
|
|
58
65
|
i.abort(), n(this, h).call(this, "panel-resize-end");
|
|
59
66
|
};
|
|
60
|
-
window.addEventListener("mousemove", S, {
|
|
67
|
+
window.addEventListener("mousemove", S, {
|
|
68
|
+
signal: i.signal
|
|
69
|
+
}), window.addEventListener("mouseup", A, {
|
|
70
|
+
signal: i.signal
|
|
71
|
+
});
|
|
61
72
|
});
|
|
62
73
|
/**
|
|
63
74
|
* `layout="vertical"` 时的 `resize` 事件监听
|
|
@@ -75,7 +86,11 @@ class D extends N {
|
|
|
75
86
|
}, A = () => {
|
|
76
87
|
i.abort(), n(this, h).call(this, "panel-resize-end");
|
|
77
88
|
};
|
|
78
|
-
window.addEventListener("mousemove", S, {
|
|
89
|
+
window.addEventListener("mousemove", S, {
|
|
90
|
+
signal: i.signal
|
|
91
|
+
}), window.addEventListener("mouseup", A, {
|
|
92
|
+
signal: i.signal
|
|
93
|
+
});
|
|
79
94
|
});
|
|
80
95
|
this.stylesheet = I, this.$render();
|
|
81
96
|
}
|
|
@@ -107,7 +122,11 @@ class D extends N {
|
|
|
107
122
|
this.insertBefore(r, i.nextSibling);
|
|
108
123
|
}
|
|
109
124
|
}), t = [...this.children], t.forEach((i, o) => {
|
|
110
|
-
i.tagName === "EA-SPLITTER-BAR" && (i.setAttribute("data-index", o), i.layout = this.layout, i.addEventListener(
|
|
125
|
+
i.tagName === "EA-SPLITTER-BAR" && (i.setAttribute("data-index", o), i.layout = this.layout, i.addEventListener(
|
|
126
|
+
"mousedown",
|
|
127
|
+
this.layout === "horizontal" ? n(this, y) : n(this, v),
|
|
128
|
+
{ signal: n(this, m).signal }
|
|
129
|
+
));
|
|
111
130
|
});
|
|
112
131
|
});
|
|
113
132
|
}
|
|
@@ -156,12 +175,9 @@ class X extends N {
|
|
|
156
175
|
* @return {string} 属性值
|
|
157
176
|
*/
|
|
158
177
|
updateContainerClasslist() {
|
|
159
|
-
return this.computedClasslist(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
// ['--' + this.state.type]: this.state.type,
|
|
163
|
-
}
|
|
164
|
-
);
|
|
178
|
+
return this.computedClasslist("ea-splitter-panel", {
|
|
179
|
+
// ['--' + this.state.type]: this.state.type,
|
|
180
|
+
});
|
|
165
181
|
}
|
|
166
182
|
$render() {
|
|
167
183
|
this.shadowRoot.innerHTML = `
|
|
@@ -1,6 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var p = (t) => {
|
|
3
|
+
throw TypeError(t);
|
|
4
|
+
};
|
|
5
|
+
var _ = (t, e, s) => e in t ? m(t, e, { enumerable: !0, configurable: !0, writable: !0, value: s }) : t[e] = s;
|
|
6
|
+
var d = (t, e, s) => _(t, typeof e != "symbol" ? e + "" : e, s), f = (t, e, s) => e.has(t) || p("Cannot " + s);
|
|
7
|
+
var h = (t, e, s) => (f(t, e, "read from private field"), s ? s.call(t) : e.get(t)), a = (t, e, s) => e.has(t) ? p("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, s), i = (t, e, s, u) => (f(t, e, "write to private field"), u ? u.call(t, s) : e.set(t, s), s);
|
|
8
|
+
import { B as x } from "./Base.js";
|
|
9
|
+
import { s as b } from "../css/ea-statistic.style.js";
|
|
10
|
+
var n, r, o, c, l;
|
|
11
|
+
class w extends x {
|
|
12
|
+
constructor() {
|
|
13
|
+
super();
|
|
14
|
+
/** @type {HTMLElement} */
|
|
15
|
+
a(this, n);
|
|
16
|
+
/** @type {HTMLElement} */
|
|
17
|
+
a(this, r);
|
|
18
|
+
/** @type {HTMLElement} */
|
|
19
|
+
a(this, o);
|
|
20
|
+
/** @type {HTMLElement} */
|
|
21
|
+
a(this, c);
|
|
22
|
+
/** @type {HTMLElement} */
|
|
23
|
+
a(this, l);
|
|
24
|
+
d(this, "state", this.properties({
|
|
25
|
+
title: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: "",
|
|
28
|
+
observer: (s) => {
|
|
29
|
+
h(this, r).textContent = s;
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
value: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 0,
|
|
35
|
+
/** @param {Number} newVal */
|
|
36
|
+
observer: (s) => {
|
|
37
|
+
h(this, o).textContent = s.toLocaleString();
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}));
|
|
41
|
+
this.stylesheet = b, this.$render();
|
|
42
|
+
}
|
|
43
|
+
static get observedAttributes() {
|
|
44
|
+
return [...super.observedAttributes, "title", "value"];
|
|
45
|
+
}
|
|
46
|
+
$render() {
|
|
47
|
+
this.shadowRoot.innerHTML = `
|
|
48
|
+
<div class='ea-statistic' part='container'>
|
|
49
|
+
<header class='ea-statistic__header' part='title'>
|
|
50
|
+
<slot name='title'></slot>
|
|
51
|
+
</header>
|
|
52
|
+
<main class='ea-statistic__content' part='content'>
|
|
53
|
+
<span class='ea-statistic__prefix' part='prefix'>
|
|
54
|
+
<slot name='prefix'></slot>
|
|
55
|
+
</span>
|
|
56
|
+
<span class='ea-statistic__number' part='number'>
|
|
57
|
+
<slot></slot>
|
|
58
|
+
</span>
|
|
59
|
+
<span class='ea-statistic__suffix' part='suffix'>
|
|
60
|
+
<slot name='suffix'></slot>
|
|
61
|
+
</span>
|
|
62
|
+
</main>
|
|
63
|
+
</div>
|
|
64
|
+
`, i(this, n, this.shadowRoot.querySelector(".ea-statistic")), i(this, r, this.shadowRoot.querySelector(".ea-statistic__header slot")), i(this, o, this.shadowRoot.querySelector(".ea-statistic__number")), i(this, c, this.shadowRoot.querySelector(".ea-statistic__prefix slot")), i(this, l, this.shadowRoot.querySelector(".ea-statistic__suffix slot"));
|
|
65
|
+
}
|
|
66
|
+
connectedCallback() {
|
|
67
|
+
super.connectedCallback();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
n = new WeakMap(), r = new WeakMap(), o = new WeakMap(), c = new WeakMap(), l = new WeakMap();
|
|
71
|
+
window.customElements.get("ea-statistic") || window.customElements.define("ea-statistic", w);
|
|
4
72
|
export {
|
|
5
|
-
|
|
73
|
+
w as EaStatistic
|
|
6
74
|
};
|