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
|
@@ -4,7 +4,7 @@ var j = (i) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Q = (i, o, t) => o in i ? K(i, o, { enumerable: !0, configurable: !0, writable: !0, value: t }) : i[o] = t;
|
|
6
6
|
var q = (i, o, t) => Q(i, typeof o != "symbol" ? o + "" : o, t), F = (i, o, t) => o.has(i) || j("Cannot " + t);
|
|
7
|
-
var e = (i, o, t) => (F(i, o, "read from private field"), t ? t.call(i) : o.get(i)), a = (i, o, t) => o.has(i) ? j("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(i) : o.set(i, t),
|
|
7
|
+
var e = (i, o, t) => (F(i, o, "read from private field"), t ? t.call(i) : o.get(i)), a = (i, o, t) => o.has(i) ? j("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(i) : o.set(i, t), h = (i, o, t, s) => (F(i, o, "write to private field"), s ? s.call(i, t) : o.set(i, t), t);
|
|
8
8
|
import { B as U } from "./Base.js";
|
|
9
9
|
import { s as X } from "../css/ea-tab.style.js";
|
|
10
10
|
import { s as Y } from "../css/ea-tabs.style.js";
|
|
@@ -108,14 +108,14 @@ class V extends U {
|
|
|
108
108
|
* @return {string} 属性值
|
|
109
109
|
*/
|
|
110
110
|
updateContainerClasslist() {
|
|
111
|
-
var l, n,
|
|
111
|
+
var l, n, c;
|
|
112
112
|
let t = (l = e(this, d, f)) == null ? void 0 : l.querySelectorAll("ea-tab");
|
|
113
113
|
t = (t == null ? void 0 : t.length) > 0 ? [...t] : [];
|
|
114
114
|
const s = this.computedClasslist(
|
|
115
115
|
"ea-tab",
|
|
116
116
|
{
|
|
117
117
|
["--" + this.type]: this.type === ((n = e(this, d, f)) == null ? void 0 : n.getAttribute("type")) || "",
|
|
118
|
-
["--" + this["tab-position"]]: this["tab-position"] === ((
|
|
118
|
+
["--" + this["tab-position"]]: this["tab-position"] === ((c = e(this, d, f)) == null ? void 0 : c.getAttribute("tab-position")) || "top"
|
|
119
119
|
},
|
|
120
120
|
{
|
|
121
121
|
disabled: this.disabled,
|
|
@@ -131,13 +131,13 @@ class V extends U {
|
|
|
131
131
|
this.shadowRoot.innerHTML = `
|
|
132
132
|
<div class='ea-tab' part='container'>
|
|
133
133
|
<slot></slot>
|
|
134
|
-
<ea-icon class="ea-tab__close-icon"
|
|
134
|
+
<ea-icon class="ea-tab__close-icon" name="xmark" part="close-icon"></ea-icon>
|
|
135
135
|
</div>
|
|
136
|
-
`,
|
|
136
|
+
`, h(this, _, this.shadowRoot.querySelector(".ea-tab")), h(this, S, this.shadowRoot.querySelector(".ea-tab__close-icon")), this.updateContainerClasslist();
|
|
137
137
|
}
|
|
138
138
|
connectedCallback() {
|
|
139
139
|
var t;
|
|
140
|
-
super.connectedCallback(), (t = e(this, p)) == null || t.abort(),
|
|
140
|
+
super.connectedCallback(), (t = e(this, p)) == null || t.abort(), h(this, p, new AbortController()), e(this, S).addEventListener("click", e(this, x), {
|
|
141
141
|
signal: e(this, p).signal
|
|
142
142
|
});
|
|
143
143
|
}
|
|
@@ -153,7 +153,7 @@ d = new WeakSet(), f = function() {
|
|
|
153
153
|
}
|
|
154
154
|
}, _ = new WeakMap(), S = new WeakMap(), p = new WeakMap(), x = new WeakMap();
|
|
155
155
|
window.customElements.get("ea-tab") || window.customElements.define("ea-tab", V);
|
|
156
|
-
var E, u, v, r,
|
|
156
|
+
var E, u, v, r, m, g, L, k, y, b, C, $, N, A, B, H, w, P, I, W, O;
|
|
157
157
|
class tt extends U {
|
|
158
158
|
constructor() {
|
|
159
159
|
super();
|
|
@@ -166,13 +166,13 @@ class tt extends U {
|
|
|
166
166
|
/** @type {HTMLElement} */
|
|
167
167
|
a(this, r);
|
|
168
168
|
/** @type {HTMLSlotElement} */
|
|
169
|
-
a(this, g);
|
|
170
|
-
/** @type {HTMLElement} */
|
|
171
169
|
a(this, m);
|
|
172
170
|
/** @type {HTMLElement} */
|
|
171
|
+
a(this, g);
|
|
172
|
+
/** @type {HTMLElement} */
|
|
173
173
|
a(this, L);
|
|
174
174
|
/** @type {HTMLElement} */
|
|
175
|
-
a(this,
|
|
175
|
+
a(this, k);
|
|
176
176
|
/** @type {HTMLSlotElement} */
|
|
177
177
|
a(this, y);
|
|
178
178
|
/** @type {AbortController} */
|
|
@@ -210,7 +210,7 @@ class tt extends U {
|
|
|
210
210
|
type: ["top", "bottom", "left", "right"],
|
|
211
211
|
default: "top",
|
|
212
212
|
observer: (t) => {
|
|
213
|
-
this.updateContainerClasslist(), e(this, H).call(this, t), e(this, A).call(this, this.active), [...e(this,
|
|
213
|
+
this.updateContainerClasslist(), e(this, H).call(this, t), e(this, A).call(this, this.active), [...e(this, m).assignedElements()].filter(
|
|
214
214
|
(s) => s.tagName.toLowerCase() === "ea-tab-panel" || s.tagName.toLowerCase() === "ea-tab"
|
|
215
215
|
).forEach((s) => s.setAttribute("tab-position", t));
|
|
216
216
|
}
|
|
@@ -228,14 +228,14 @@ class tt extends U {
|
|
|
228
228
|
* @param {HTMLElement} lineEl
|
|
229
229
|
* @param {HTMLElement} tabPosition
|
|
230
230
|
*/
|
|
231
|
-
a(this,
|
|
232
|
-
const n = l === "top" || l === "bottom",
|
|
231
|
+
a(this, $, (t, s = e(this, g), l = this["tab-position"]) => {
|
|
232
|
+
const n = l === "top" || l === "bottom", c = t.getBoundingClientRect(), T = s.getBoundingClientRect();
|
|
233
233
|
this.style.setProperty(
|
|
234
234
|
"--ea-tabs-indicator-size",
|
|
235
235
|
`${n ? t.offsetWidth : t.offsetHeight}px`
|
|
236
236
|
), this.style.setProperty(
|
|
237
237
|
"--ea-tabs-indicator-x",
|
|
238
|
-
`${n ?
|
|
238
|
+
`${n ? c.x - T.x : c.y - T.y}px`
|
|
239
239
|
);
|
|
240
240
|
});
|
|
241
241
|
/**
|
|
@@ -244,7 +244,7 @@ class tt extends U {
|
|
|
244
244
|
* @param {HTMLElement} [lineEl]
|
|
245
245
|
* @param {HTMLElement} [tabPosition]
|
|
246
246
|
*/
|
|
247
|
-
a(this, N, (t, s = e(this,
|
|
247
|
+
a(this, N, (t, s = e(this, g), l = this["tab-position"]) => {
|
|
248
248
|
const n = t.getBoundingClientRect();
|
|
249
249
|
e(this, r).scrollTo({
|
|
250
250
|
left: t.offsetLeft + n.width,
|
|
@@ -259,8 +259,8 @@ class tt extends U {
|
|
|
259
259
|
a(this, A, (t = this.active) => {
|
|
260
260
|
const s = [...this.querySelectorAll("ea-tab-panel")];
|
|
261
261
|
[...this.querySelectorAll("ea-tab")].forEach((n) => {
|
|
262
|
-
const
|
|
263
|
-
n.toggleAttribute("active",
|
|
262
|
+
const c = n.getAttribute("panel") === t;
|
|
263
|
+
n.toggleAttribute("active", c), c && this.type === "" && e(this, $).call(this, n), c && e(this, N).call(this, n);
|
|
264
264
|
}), s.forEach((n) => {
|
|
265
265
|
n.toggleAttribute(
|
|
266
266
|
"active",
|
|
@@ -281,7 +281,7 @@ class tt extends U {
|
|
|
281
281
|
* @param {"top" | "bottom" | "left" | "right"} tabPosition
|
|
282
282
|
*/
|
|
283
283
|
a(this, H, (t = this["tab-position"]) => {
|
|
284
|
-
t === "left" || t === "right" ? (e(this, u).setAttribute("
|
|
284
|
+
t === "left" || t === "right" ? (e(this, u).setAttribute("name", "arrow-left"), e(this, v).setAttribute("name", "arrow-right")) : (t === "top" || t === "bottom") && (e(this, u).setAttribute("name", "arrow-up"), e(this, v).setAttribute("name", "arrow-down"));
|
|
285
285
|
});
|
|
286
286
|
/**
|
|
287
287
|
* 当 tab slot 内容变化时触发
|
|
@@ -347,7 +347,7 @@ class tt extends U {
|
|
|
347
347
|
*/
|
|
348
348
|
a(this, O, (t) => {
|
|
349
349
|
t.preventDefault(), t.stopImmediatePropagation();
|
|
350
|
-
const s = t.detail.panel, l = [...this.querySelectorAll("ea-tab")], n = t.target,
|
|
350
|
+
const s = t.detail.panel, l = [...this.querySelectorAll("ea-tab")], n = t.target, c = l.indexOf(n), T = this.querySelector(`ea-tab-panel[name="${s}"]`), D = [...this.querySelectorAll("ea-tab")][c - 1 < 0 ? 0 : c - 1].getAttribute("panel");
|
|
351
351
|
this.setAttribute("active", D), T.remove(), n.remove(), this.emit("tab-remove", {
|
|
352
352
|
detail: {
|
|
353
353
|
name: D
|
|
@@ -386,9 +386,9 @@ class tt extends U {
|
|
|
386
386
|
this.shadowRoot.innerHTML = `
|
|
387
387
|
<div class='ea-tabs' part='container'>
|
|
388
388
|
<nav class='ea-tabs__nav' part='nav'>
|
|
389
|
-
<ea-icon
|
|
389
|
+
<ea-icon name="angle-left" class="ea-tabs__prev ea-tabs__scroll" part='prev'></ea-icon>
|
|
390
390
|
<slot name='nav'></slot>
|
|
391
|
-
<ea-icon
|
|
391
|
+
<ea-icon name="angle-right" class="ea-tabs__next ea-tabs__scroll" part='next'></ea-icon>
|
|
392
392
|
</nav>
|
|
393
393
|
<div class="ea-tabs__line" part="line" tabindex="-1">
|
|
394
394
|
<span class="ea-tabs__indicator" part="indicator"></span>
|
|
@@ -397,17 +397,17 @@ class tt extends U {
|
|
|
397
397
|
<slot></slot>
|
|
398
398
|
</main>
|
|
399
399
|
</div>
|
|
400
|
-
`,
|
|
400
|
+
`, h(this, E, this.shadowRoot.querySelector(".ea-tabs")), h(this, u, this.shadowRoot.querySelector(".ea-tabs__prev")), h(this, v, this.shadowRoot.querySelector(".ea-tabs__next")), h(this, r, this.shadowRoot.querySelector(".ea-tabs__nav")), h(this, m, this.shadowRoot.querySelector(
|
|
401
401
|
".ea-tabs__nav > slot[name=nav]"
|
|
402
|
-
)),
|
|
402
|
+
)), h(this, g, this.shadowRoot.querySelector(".ea-tabs__line")), h(this, L, this.shadowRoot.querySelector(".ea-tabs__indicator")), h(this, k, this.shadowRoot.querySelector(".ea-tabs__content")), h(this, y, this.shadowRoot.querySelector(
|
|
403
403
|
".ea-tabs__content > slot"
|
|
404
404
|
)), e(this, w).call(this);
|
|
405
405
|
}
|
|
406
406
|
connectedCallback() {
|
|
407
407
|
var t, s;
|
|
408
|
-
super.connectedCallback(), (t = e(this, b)) == null || t.abort(),
|
|
408
|
+
super.connectedCallback(), (t = e(this, b)) == null || t.abort(), h(this, b, new AbortController()), (s = e(this, C)) == null || s.unobserve(), e(this, r).addEventListener("click", e(this, P), {
|
|
409
409
|
signal: e(this, b).signal
|
|
410
|
-
}), e(this,
|
|
410
|
+
}), e(this, m).addEventListener("slotchange", e(this, w), {
|
|
411
411
|
signal: e(this, b).signal
|
|
412
412
|
}), e(this, y).addEventListener("slotchange", e(this, w), {
|
|
413
413
|
signal: e(this, b).signal
|
|
@@ -417,7 +417,7 @@ class tt extends U {
|
|
|
417
417
|
signal: e(this, b).signal
|
|
418
418
|
}), this.addEventListener("ea-tab-close-icon-click", e(this, O), {
|
|
419
419
|
signal: e(this, b).signal
|
|
420
|
-
}),
|
|
420
|
+
}), h(this, C, new ResizeObserver(() => {
|
|
421
421
|
this.updateContainerClasslist();
|
|
422
422
|
}).observe(e(this, r))), G(() => {
|
|
423
423
|
this.updateContainerClasslist();
|
|
@@ -428,7 +428,7 @@ class tt extends U {
|
|
|
428
428
|
(t = e(this, b)) == null || t.abort(), (s = e(this, C)) == null || s.unobserve();
|
|
429
429
|
}
|
|
430
430
|
}
|
|
431
|
-
E = new WeakMap(), u = new WeakMap(), v = new WeakMap(), r = new WeakMap(),
|
|
431
|
+
E = new WeakMap(), u = new WeakMap(), v = new WeakMap(), r = new WeakMap(), m = new WeakMap(), g = new WeakMap(), L = new WeakMap(), k = new WeakMap(), y = new WeakMap(), b = new WeakMap(), C = new WeakMap(), $ = new WeakMap(), N = new WeakMap(), A = new WeakMap(), B = new WeakMap(), H = new WeakMap(), w = new WeakMap(), P = new WeakMap(), I = new WeakMap(), W = new WeakMap(), O = new WeakMap();
|
|
432
432
|
window.customElements.get("ea-tabs") || window.customElements.define("ea-tabs", tt);
|
|
433
433
|
var z, J, R, M;
|
|
434
434
|
class et extends U {
|
|
@@ -477,7 +477,7 @@ class et extends U {
|
|
|
477
477
|
<div class='ea-tab-panel' part='container'>
|
|
478
478
|
<slot></slot>
|
|
479
479
|
</div>
|
|
480
|
-
`,
|
|
480
|
+
`, h(this, R, this.shadowRoot.querySelector(".ea-tab-panel"));
|
|
481
481
|
}
|
|
482
482
|
connectedCallback() {
|
|
483
483
|
super.connectedCallback();
|
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
var
|
|
1
|
+
var C = Object.defineProperty;
|
|
2
2
|
var f = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var y = (t, s, e) => s in t ?
|
|
5
|
+
var y = (t, s, e) => s in t ? C(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
|
|
6
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)),
|
|
8
|
-
import { B as
|
|
9
|
-
import {
|
|
10
|
-
import { s as k } from "../css/ea-
|
|
11
|
-
import {
|
|
12
|
-
import { 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
13
|
var c, r, u;
|
|
14
|
-
class
|
|
14
|
+
class A extends g {
|
|
15
15
|
constructor() {
|
|
16
16
|
super();
|
|
17
17
|
/** @type {HTMLElement} */
|
|
18
|
-
|
|
18
|
+
o(this, c);
|
|
19
19
|
/** @type {AbortController} */
|
|
20
|
-
|
|
20
|
+
o(this, r);
|
|
21
21
|
b(this, "state", this.properties({
|
|
22
22
|
checked: {
|
|
23
23
|
type: Boolean,
|
|
@@ -34,7 +34,7 @@ class T extends C {
|
|
|
34
34
|
}
|
|
35
35
|
},
|
|
36
36
|
type: {
|
|
37
|
-
type:
|
|
37
|
+
type: ["primary", "info", "success", "warning", "danger"],
|
|
38
38
|
default: "primary",
|
|
39
39
|
observer: (e) => {
|
|
40
40
|
this.updateContainerClasslist();
|
|
@@ -44,10 +44,10 @@ class T extends C {
|
|
|
44
44
|
/**
|
|
45
45
|
* 点击切换选中状态
|
|
46
46
|
*/
|
|
47
|
-
|
|
47
|
+
o(this, u, () => {
|
|
48
48
|
this.disabled || (this.checked = !this.checked, this.emit("change", { detail: { checked: this.checked } }));
|
|
49
49
|
});
|
|
50
|
-
this.stylesheet =
|
|
50
|
+
this.stylesheet = v, this.$render();
|
|
51
51
|
}
|
|
52
52
|
static get observedAttributes() {
|
|
53
53
|
return [...super.observedAttributes, "checked", "disabled", "type"];
|
|
@@ -87,8 +87,8 @@ class T extends C {
|
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
c = new WeakMap(), r = new WeakMap(), u = new WeakMap();
|
|
90
|
-
window.customElements.get("ea-check-tag") || window.customElements.define("ea-check-tag",
|
|
91
|
-
class
|
|
90
|
+
window.customElements.get("ea-check-tag") || window.customElements.define("ea-check-tag", A);
|
|
91
|
+
class S extends Event {
|
|
92
92
|
constructor(s) {
|
|
93
93
|
super("ea-remove", {
|
|
94
94
|
bubbles: !0,
|
|
@@ -96,19 +96,19 @@ class $ extends Event {
|
|
|
96
96
|
}), this.detail = s;
|
|
97
97
|
}
|
|
98
98
|
}
|
|
99
|
-
var
|
|
100
|
-
class
|
|
99
|
+
var i, d, n, p;
|
|
100
|
+
class $ extends g {
|
|
101
101
|
constructor() {
|
|
102
102
|
super();
|
|
103
103
|
/** @type {HTMLElement} */
|
|
104
|
-
|
|
104
|
+
o(this, i);
|
|
105
105
|
/** @type {HTMLElement | null} */
|
|
106
|
-
|
|
106
|
+
o(this, d);
|
|
107
107
|
/** @type {AbortController} */
|
|
108
|
-
|
|
108
|
+
o(this, n);
|
|
109
109
|
b(this, "state", this.properties({
|
|
110
110
|
type: {
|
|
111
|
-
type:
|
|
111
|
+
type: ["primary", "info", "success", "warning", "danger"],
|
|
112
112
|
default: "primary",
|
|
113
113
|
observer: (e) => {
|
|
114
114
|
this.updateContainerClasslist();
|
|
@@ -130,21 +130,14 @@ class B extends C {
|
|
|
130
130
|
observer: (e) => {
|
|
131
131
|
}
|
|
132
132
|
},
|
|
133
|
-
hit: {
|
|
134
|
-
type: Boolean,
|
|
135
|
-
default: !1,
|
|
136
|
-
observer: (e) => {
|
|
137
|
-
}
|
|
138
|
-
},
|
|
139
133
|
color: {
|
|
140
134
|
type: String,
|
|
141
135
|
default: "",
|
|
142
136
|
observer: (e) => {
|
|
143
|
-
if (!CSS.supports("background", e))
|
|
137
|
+
if (e && CSS.supports("background", e) ? a(this, i).style.background = e : a(this, i).style.background = "", !CSS.supports("background", e))
|
|
144
138
|
return console.warn(
|
|
145
139
|
`[EaTag] The color value ${e} is not supported.`
|
|
146
140
|
);
|
|
147
|
-
a(this, o).style.background = e;
|
|
148
141
|
}
|
|
149
142
|
},
|
|
150
143
|
size: {
|
|
@@ -158,25 +151,27 @@ class B extends C {
|
|
|
158
151
|
type: ["dark", "light", "plain"],
|
|
159
152
|
default: "light",
|
|
160
153
|
observer: (e) => {
|
|
154
|
+
this.updateContainerClasslist();
|
|
161
155
|
}
|
|
162
156
|
},
|
|
163
157
|
round: {
|
|
164
158
|
type: Boolean,
|
|
165
159
|
default: !1,
|
|
166
160
|
observer: (e) => {
|
|
161
|
+
this.updateContainerClasslist();
|
|
167
162
|
}
|
|
168
163
|
}
|
|
169
164
|
}));
|
|
170
165
|
/**
|
|
171
166
|
* 标签移除事件
|
|
172
167
|
*/
|
|
173
|
-
|
|
174
|
-
this["disable-transitions"] || (a(this,
|
|
175
|
-
a(this,
|
|
168
|
+
o(this, p, async () => {
|
|
169
|
+
this["disable-transitions"] || (a(this, i).classList.add("before-close"), await E.EaElement.addAsyncEventListener(
|
|
170
|
+
a(this, i),
|
|
176
171
|
"transitionend"
|
|
177
|
-
)), this.dispatchEvent(new
|
|
172
|
+
)), this.dispatchEvent(new S({ text: this.textContent })), this.remove();
|
|
178
173
|
});
|
|
179
|
-
this.stylesheet =
|
|
174
|
+
this.stylesheet = k, this.$render();
|
|
180
175
|
}
|
|
181
176
|
static get observedAttributes() {
|
|
182
177
|
return [
|
|
@@ -184,7 +179,6 @@ class B extends C {
|
|
|
184
179
|
"type",
|
|
185
180
|
"closable",
|
|
186
181
|
"disable-transitions",
|
|
187
|
-
"hit",
|
|
188
182
|
"color",
|
|
189
183
|
"size",
|
|
190
184
|
"effect",
|
|
@@ -208,15 +202,15 @@ class B extends C {
|
|
|
208
202
|
round: this.round
|
|
209
203
|
}
|
|
210
204
|
);
|
|
211
|
-
return a(this,
|
|
205
|
+
return a(this, i).className = e, e;
|
|
212
206
|
}
|
|
213
207
|
$render() {
|
|
214
208
|
this.shadowRoot.innerHTML = `
|
|
215
209
|
<div class='ea-tag' part='container'>
|
|
216
210
|
<slot></slot>
|
|
217
|
-
<ea-icon class="ea-tag__close" part="close-icon"
|
|
211
|
+
<ea-icon class="ea-tag__close" part="close-icon" name="xmark"></ea-icon>
|
|
218
212
|
</div>
|
|
219
|
-
`, l(this,
|
|
213
|
+
`, l(this, i, this.shadowRoot.querySelector(".ea-tag")), l(this, d, this.shadowRoot.querySelector(".ea-tag__close")), this.updateContainerClasslist();
|
|
220
214
|
}
|
|
221
215
|
connectedCallback() {
|
|
222
216
|
super.connectedCallback();
|
|
@@ -226,9 +220,9 @@ class B extends C {
|
|
|
226
220
|
(e = a(this, n)) == null || e.abort();
|
|
227
221
|
}
|
|
228
222
|
}
|
|
229
|
-
|
|
230
|
-
window.customElements.get("ea-tag") || window.customElements.define("ea-tag",
|
|
223
|
+
i = new WeakMap(), d = new WeakMap(), n = new WeakMap(), p = new WeakMap();
|
|
224
|
+
window.customElements.get("ea-tag") || window.customElements.define("ea-tag", $);
|
|
231
225
|
export {
|
|
232
|
-
|
|
233
|
-
|
|
226
|
+
A as EaCheckTag,
|
|
227
|
+
$ as EaTag
|
|
234
228
|
};
|
|
@@ -446,7 +446,7 @@ class lt extends st {
|
|
|
446
446
|
part='input'
|
|
447
447
|
autocomplete="off"
|
|
448
448
|
readonly
|
|
449
|
-
prefix-icon="
|
|
449
|
+
prefix-icon="clock"
|
|
450
450
|
></ea-input>
|
|
451
451
|
<div class="${s.e("dropdown")}" part='dropdown'>
|
|
452
452
|
<div class="${s.e("dropdown-inner-wrap")}" part='dropdown-inner-wrap'>
|
|
@@ -476,11 +476,7 @@ class lt extends st {
|
|
|
476
476
|
*/
|
|
477
477
|
updateValidity() {
|
|
478
478
|
const s = this.value !== "" && this.value != null;
|
|
479
|
-
this.required && !s ? this.internals.setValidity(
|
|
480
|
-
{ valueMissing: !0 },
|
|
481
|
-
"请选择时间",
|
|
482
|
-
this
|
|
483
|
-
) : this.internals.setValidity({}, "", this);
|
|
479
|
+
this.required && !s ? this.internals.setValidity({ valueMissing: !0 }, "请选择时间", this) : this.internals.setValidity({}, "", this);
|
|
484
480
|
}
|
|
485
481
|
/**
|
|
486
482
|
* 检查表单字段的有效性
|
|
@@ -3,13 +3,12 @@ var u = (t) => {
|
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
5
|
var C = (t, s, e) => s in t ? b(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
|
|
6
|
-
var
|
|
7
|
-
var a = (t, s, e) => (
|
|
6
|
+
var w = (t, s, e) => C(t, typeof s != "symbol" ? s + "" : s, e), y = (t, s, e) => s.has(t) || u("Cannot " + e);
|
|
7
|
+
var a = (t, s, e) => (y(t, s, "read from private field"), e ? e.call(t) : s.get(t)), i = (t, s, e) => s.has(t) ? u("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(t) : s.set(t, e), o = (t, s, e, h) => (y(t, s, "write to private field"), h ? h.call(t, e) : s.set(t, e), e);
|
|
8
8
|
import { B as f } from "./Base.js";
|
|
9
9
|
import { s as _ } from "../css/ea-timeline.style.js";
|
|
10
10
|
import { s as v } from "../css/ea-timeline-item.style.js";
|
|
11
|
-
|
|
12
|
-
class g extends f {
|
|
11
|
+
class S extends f {
|
|
13
12
|
static get observedAttributes() {
|
|
14
13
|
return [...super.observedAttributes];
|
|
15
14
|
}
|
|
@@ -27,9 +26,9 @@ class g extends f {
|
|
|
27
26
|
super.connectedCallback();
|
|
28
27
|
}
|
|
29
28
|
}
|
|
30
|
-
window.customElements.get("ea-timeline") || window.customElements.define("ea-timeline",
|
|
29
|
+
window.customElements.get("ea-timeline") || window.customElements.define("ea-timeline", S);
|
|
31
30
|
var n, m, r, c, p, d, l;
|
|
32
|
-
class
|
|
31
|
+
class g extends f {
|
|
33
32
|
constructor() {
|
|
34
33
|
super();
|
|
35
34
|
/** @type {HTMLElement} */
|
|
@@ -46,9 +45,9 @@ class R extends f {
|
|
|
46
45
|
i(this, d);
|
|
47
46
|
/** @type {HTMLElement} */
|
|
48
47
|
i(this, l);
|
|
49
|
-
|
|
48
|
+
w(this, "state", this.properties({
|
|
50
49
|
type: {
|
|
51
|
-
type:
|
|
50
|
+
type: ["primary", "info", "success", "warning", "danger"],
|
|
52
51
|
default: "",
|
|
53
52
|
observer: (e) => {
|
|
54
53
|
this.updateContainerClasslist();
|
|
@@ -90,7 +89,7 @@ class R extends f {
|
|
|
90
89
|
type: String,
|
|
91
90
|
default: "",
|
|
92
91
|
observer: (e) => {
|
|
93
|
-
a(this, r).innerHTML = `<ea-icon class="ea-timeline-item__icon-dot" part='icon-dot'
|
|
92
|
+
a(this, r).innerHTML = `<ea-icon class="ea-timeline-item__icon-dot" part='icon-dot' name="${e}"></ea-icon>`;
|
|
94
93
|
}
|
|
95
94
|
},
|
|
96
95
|
size: {
|
|
@@ -179,8 +178,8 @@ class R extends f {
|
|
|
179
178
|
}
|
|
180
179
|
}
|
|
181
180
|
n = new WeakMap(), m = new WeakMap(), r = new WeakMap(), c = new WeakMap(), p = new WeakMap(), d = new WeakMap(), l = new WeakMap();
|
|
182
|
-
window.customElements.get("ea-timeline-item") || window.customElements.define("ea-timeline-item",
|
|
181
|
+
window.customElements.get("ea-timeline-item") || window.customElements.define("ea-timeline-item", g);
|
|
183
182
|
export {
|
|
184
|
-
|
|
185
|
-
|
|
183
|
+
S as EaTimeline,
|
|
184
|
+
g as EaTimelineItem
|
|
186
185
|
};
|
|
@@ -58,32 +58,60 @@ class L extends k {
|
|
|
58
58
|
}));
|
|
59
59
|
r(this, u, {
|
|
60
60
|
hover: () => {
|
|
61
|
-
this.addEventListener(
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
61
|
+
this.addEventListener(
|
|
62
|
+
"mouseover",
|
|
63
|
+
(t) => {
|
|
64
|
+
this.show(), this.addEventListener(
|
|
65
|
+
"mouseout",
|
|
66
|
+
(i) => {
|
|
67
|
+
this.hide();
|
|
68
|
+
},
|
|
69
|
+
{ once: !0 }
|
|
70
|
+
);
|
|
71
|
+
},
|
|
72
|
+
{ signal: o(this, n).signal }
|
|
73
|
+
);
|
|
66
74
|
},
|
|
67
75
|
click: () => {
|
|
68
|
-
this.addEventListener(
|
|
69
|
-
|
|
70
|
-
|
|
76
|
+
this.addEventListener(
|
|
77
|
+
"click",
|
|
78
|
+
() => {
|
|
79
|
+
this.toggle();
|
|
80
|
+
},
|
|
81
|
+
{ signal: o(this, n).signal }
|
|
82
|
+
);
|
|
71
83
|
},
|
|
72
84
|
focus: () => {
|
|
73
|
-
this.addEventListener(
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
85
|
+
this.addEventListener(
|
|
86
|
+
"focus",
|
|
87
|
+
() => {
|
|
88
|
+
this.show(), this.addEventListener(
|
|
89
|
+
"blur",
|
|
90
|
+
(t) => {
|
|
91
|
+
this.hide();
|
|
92
|
+
},
|
|
93
|
+
{ once: !0 }
|
|
94
|
+
);
|
|
95
|
+
},
|
|
96
|
+
{ signal: o(this, n).signal }
|
|
97
|
+
);
|
|
78
98
|
},
|
|
79
99
|
contextmenu: () => {
|
|
80
|
-
this.addEventListener(
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
100
|
+
this.addEventListener(
|
|
101
|
+
"contextmenu",
|
|
102
|
+
(t) => {
|
|
103
|
+
t.preventDefault();
|
|
104
|
+
const i = new AbortController();
|
|
105
|
+
this.show(), window.addEventListener(
|
|
106
|
+
"click",
|
|
107
|
+
(a) => {
|
|
108
|
+
this.contains(a.target) || (i.abort(), this.hide());
|
|
109
|
+
},
|
|
110
|
+
{ signal: i.signal }
|
|
111
|
+
);
|
|
112
|
+
},
|
|
113
|
+
{ signal: o(this, n).signal }
|
|
114
|
+
);
|
|
87
115
|
}
|
|
88
116
|
});
|
|
89
117
|
r(this, g, () => {
|
|
@@ -93,13 +121,25 @@ class L extends k {
|
|
|
93
121
|
r(this, f, () => {
|
|
94
122
|
var i, a;
|
|
95
123
|
if (this.trigger === "customized") return;
|
|
96
|
-
const t = Object.keys(o(this, u)).find(
|
|
124
|
+
const t = Object.keys(o(this, u)).find(
|
|
125
|
+
(v) => this.trigger === v
|
|
126
|
+
);
|
|
97
127
|
(a = (i = o(this, u))[t || "hover"]) == null || a.call(i), t || console.warn(`[EaPopper] trigger event ${this.trigger} is not exist`);
|
|
98
128
|
});
|
|
99
|
-
l(this, d, this.shadowRoot.querySelector(".ea-popper")), l(this, c, this.shadowRoot.querySelector(
|
|
129
|
+
l(this, d, this.shadowRoot.querySelector(".ea-popper")), l(this, c, this.shadowRoot.querySelector(
|
|
130
|
+
".ea-popper__original"
|
|
131
|
+
)), l(this, p, this.shadowRoot.querySelector(
|
|
132
|
+
".ea-popper__reference"
|
|
133
|
+
));
|
|
100
134
|
}
|
|
101
135
|
static get observedAttributes() {
|
|
102
|
-
return [
|
|
136
|
+
return [
|
|
137
|
+
...super.observedAttributes,
|
|
138
|
+
"trigger",
|
|
139
|
+
"content",
|
|
140
|
+
"visible",
|
|
141
|
+
"effect"
|
|
142
|
+
];
|
|
103
143
|
}
|
|
104
144
|
updateContainerClasslist() {
|
|
105
145
|
return `${super.updateContainerClasslist()} ${this.computedClasslist("ea-tooltip", {
|