easy-component-ui 3.0.12 → 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 +3 -2
- package/dist/components/ea-alert.js +71 -54
- package/dist/components/ea-avatar.js +42 -37
- package/dist/components/ea-button.js +53 -52
- package/dist/components/ea-calendar2.js +329 -327
- package/dist/components/ea-card.js +63 -27
- package/dist/components/ea-carousel.js +2 -2
- package/dist/components/ea-collapse.js +28 -28
- package/dist/components/ea-color-picker.js +63 -66
- package/dist/components/ea-container.js +90 -61
- package/dist/components/ea-date-picker.js +1 -1
- package/dist/components/ea-dialog.js +4 -4
- package/dist/components/ea-drawer.js +51 -46
- 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 +1 -1
- 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 +20 -19
- package/dist/components/ea-page-header.js +5 -5
- package/dist/components/ea-pagination.js +5 -5
- package/dist/components/ea-popconfirm.js +3 -3
- package/dist/components/ea-popover.js +35 -11
- package/dist/components/ea-progress.js +28 -28
- package/dist/components/ea-rate.js +1 -1
- package/dist/components/ea-result.js +13 -13
- package/dist/components/ea-select.js +12 -12
- package/dist/components/ea-slider.js +88 -79
- package/dist/components/ea-splitter.js +34 -18
- package/dist/components/ea-steps.js +33 -33
- package/dist/components/ea-table.js +332 -321
- package/dist/components/ea-tabs.js +28 -28
- package/dist/components/ea-tag.js +6 -6
- package/dist/components/ea-time-picker.js +2 -6
- package/dist/components/ea-timeline.js +1 -1
- 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 +0 -1
- package/dist/css/ea-card.style.js +2 -2
- package/dist/css/ea-container.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-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-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/utils/Variables.js +10 -10
- package/package.json +302 -304
- package/dist/components/ea-loading.js +0 -151
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
3
|
-
throw TypeError(
|
|
1
|
+
var m = Object.defineProperty;
|
|
2
|
+
var b = (e) => {
|
|
3
|
+
throw TypeError(e);
|
|
4
4
|
};
|
|
5
|
-
var y = (
|
|
6
|
-
var
|
|
7
|
-
var
|
|
5
|
+
var y = (e, s, t) => s in e ? m(e, s, { enumerable: !0, configurable: !0, writable: !0, value: t }) : e[s] = t;
|
|
6
|
+
var c = (e, s, t) => y(e, typeof s != "symbol" ? s + "" : s, t), p = (e, s, t) => s.has(e) || b("Cannot " + t);
|
|
7
|
+
var a = (e, s, t) => (p(e, s, "read from private field"), t ? t.call(e) : s.get(e)), u = (e, s, t) => s.has(e) ? b("Cannot add the same private member more than once") : s instanceof WeakSet ? s.add(e) : s.set(e, t), d = (e, s, t, r) => (p(e, s, "write to private field"), r ? r.call(e, t) : s.set(e, t), t);
|
|
8
8
|
import { F as C } from "../core/FormBase.js";
|
|
9
9
|
import { s as g } from "../css/ea-button.style.js";
|
|
10
10
|
import { B as v } from "./Base.js";
|
|
11
|
-
import { s as
|
|
12
|
-
var
|
|
13
|
-
class
|
|
11
|
+
import { s as A } from "../css/ea-button-group.style.js";
|
|
12
|
+
var o, l, n, h;
|
|
13
|
+
class w extends C {
|
|
14
14
|
constructor() {
|
|
15
15
|
super();
|
|
16
16
|
/** @type {HTMLButtonElement | HTMLLinkElement} */
|
|
17
|
-
u(this,
|
|
17
|
+
u(this, o);
|
|
18
18
|
/** @type {HTMLIconElement} */
|
|
19
19
|
u(this, l);
|
|
20
20
|
/** @type {AbortController} */
|
|
@@ -34,104 +34,104 @@ class A extends C {
|
|
|
34
34
|
* @property {string} icon
|
|
35
35
|
*/
|
|
36
36
|
/** @type {state} */
|
|
37
|
-
|
|
37
|
+
c(this, "state", this.properties({
|
|
38
38
|
disabled: {
|
|
39
39
|
type: Boolean,
|
|
40
40
|
default: !1,
|
|
41
41
|
observer: (t) => {
|
|
42
|
-
|
|
42
|
+
this.updateContainerClasslist();
|
|
43
43
|
}
|
|
44
44
|
},
|
|
45
45
|
type: {
|
|
46
46
|
type: ["normal", "primary", "success", "warning", "danger"],
|
|
47
47
|
default: "normal",
|
|
48
48
|
observer: (t) => {
|
|
49
|
-
|
|
49
|
+
this.updateContainerClasslist();
|
|
50
50
|
}
|
|
51
51
|
},
|
|
52
52
|
text: {
|
|
53
53
|
type: Boolean,
|
|
54
54
|
default: !1,
|
|
55
55
|
observer: (t) => {
|
|
56
|
-
|
|
56
|
+
this.updateContainerClasslist();
|
|
57
57
|
}
|
|
58
58
|
},
|
|
59
59
|
plain: {
|
|
60
60
|
type: Boolean,
|
|
61
61
|
default: !1,
|
|
62
62
|
observer: (t) => {
|
|
63
|
-
|
|
63
|
+
this.updateContainerClasslist();
|
|
64
64
|
}
|
|
65
65
|
},
|
|
66
66
|
round: {
|
|
67
67
|
type: Boolean,
|
|
68
68
|
default: !1,
|
|
69
69
|
observer: (t) => {
|
|
70
|
-
|
|
70
|
+
this.updateContainerClasslist();
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
circle: {
|
|
74
74
|
type: Boolean,
|
|
75
75
|
default: !1,
|
|
76
76
|
observer: (t) => {
|
|
77
|
-
|
|
77
|
+
this.updateContainerClasslist();
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
80
|
link: {
|
|
81
81
|
type: Boolean,
|
|
82
82
|
default: !1,
|
|
83
83
|
observer: (t) => {
|
|
84
|
-
this.$render(),
|
|
84
|
+
this.$render(), a(this, o).href = this.getAttribute("href"), this.updateContainerClasslist();
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
href: {
|
|
88
88
|
type: String,
|
|
89
89
|
default: "",
|
|
90
90
|
observer: (t) => {
|
|
91
|
-
|
|
91
|
+
this.updateContainerClasslist(), a(this, o).setAttribute("href", t);
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
94
|
size: {
|
|
95
95
|
type: ["small", "medium", "large"],
|
|
96
96
|
default: "medium",
|
|
97
97
|
observer: (t) => {
|
|
98
|
-
|
|
98
|
+
this.updateContainerClasslist();
|
|
99
99
|
}
|
|
100
100
|
},
|
|
101
101
|
loading: {
|
|
102
102
|
type: Boolean,
|
|
103
103
|
default: !1,
|
|
104
104
|
observer: (t) => {
|
|
105
|
-
var
|
|
105
|
+
var r;
|
|
106
106
|
if (t = t === "true" || t === !0, this.toggleAttribute("disabled", t), t) {
|
|
107
|
-
const
|
|
108
|
-
|
|
107
|
+
const i = document.createElement("ea-icon");
|
|
108
|
+
i.id = "ea-loading-icon", i.setAttribute("name", "spinner"), i.toggleAttribute("spin", !0), i.setAttribute("size", this.size), i.setAttribute("part", "loading-icon"), a(this, o).insertBefore(i, a(this, o).firstChild);
|
|
109
109
|
} else {
|
|
110
|
-
const
|
|
111
|
-
(
|
|
110
|
+
const i = (r = a(this, o)) == null ? void 0 : r.querySelectorAll("#ea-loading-icon");
|
|
111
|
+
(i == null ? void 0 : i.length) > 0 && (i == null || i.forEach((f) => f.remove()));
|
|
112
112
|
}
|
|
113
|
-
|
|
113
|
+
this.updateContainerClasslist();
|
|
114
114
|
}
|
|
115
115
|
},
|
|
116
116
|
icon: {
|
|
117
117
|
type: String,
|
|
118
118
|
default: "",
|
|
119
119
|
observer: (t) => {
|
|
120
|
-
|
|
120
|
+
a(this, l).setAttribute("name", t), a(this, l).setAttribute("size", this.size), this.updateContainerClasslist();
|
|
121
121
|
}
|
|
122
122
|
},
|
|
123
123
|
"button-type": {
|
|
124
124
|
type: ["button", "submit", "reset"],
|
|
125
125
|
default: "button",
|
|
126
126
|
observer: (t) => {
|
|
127
|
-
|
|
127
|
+
a(this, o).type = t;
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}));
|
|
131
131
|
/**
|
|
132
132
|
* @param {KeyboardEvent} e
|
|
133
133
|
*/
|
|
134
|
-
u(this,
|
|
134
|
+
u(this, h, (t) => {
|
|
135
135
|
t.key === "Enter" && this.click();
|
|
136
136
|
});
|
|
137
137
|
this.stylesheet = g, this.$render();
|
|
@@ -158,8 +158,8 @@ class A extends C {
|
|
|
158
158
|
* @return {string} 属性值
|
|
159
159
|
*/
|
|
160
160
|
updateContainerClasslist() {
|
|
161
|
-
var
|
|
162
|
-
|
|
161
|
+
var r;
|
|
162
|
+
const t = this.computedClasslist(
|
|
163
163
|
"ea-button",
|
|
164
164
|
{
|
|
165
165
|
["--" + this.type]: this.type,
|
|
@@ -170,8 +170,9 @@ class A extends C {
|
|
|
170
170
|
"--circle": this.circle,
|
|
171
171
|
["--" + this.size]: this.size
|
|
172
172
|
},
|
|
173
|
-
{ icon: (
|
|
173
|
+
{ icon: (r = this.icon) == null ? void 0 : r.length }
|
|
174
174
|
);
|
|
175
|
+
return a(this, o).className = t, t;
|
|
175
176
|
}
|
|
176
177
|
$render() {
|
|
177
178
|
const t = this.getAttrBoolean("link") ? "a" : "button";
|
|
@@ -180,29 +181,29 @@ class A extends C {
|
|
|
180
181
|
<ea-icon class="ea-button__icon" part="icon"></ea-icon>
|
|
181
182
|
<slot></slot>
|
|
182
183
|
</${t}>
|
|
183
|
-
`,
|
|
184
|
+
`, d(this, o, this.shadowRoot.querySelector(".ea-button")), d(this, l, this.shadowRoot.querySelector(".ea-button__icon")), this.updateContainerClasslist();
|
|
184
185
|
}
|
|
185
186
|
connectedCallback() {
|
|
186
187
|
var t;
|
|
187
|
-
super.connectedCallback(), (t =
|
|
188
|
-
signal:
|
|
189
|
-
}), this.addEventListener("click", (
|
|
188
|
+
super.connectedCallback(), (t = a(this, n)) == null || t.abort(), d(this, n, new AbortController()), this.addEventListener("keypress", a(this, h), {
|
|
189
|
+
signal: a(this, n).signal
|
|
190
|
+
}), this.addEventListener("click", (r) => {
|
|
190
191
|
if (this["button-type"] === "submit") {
|
|
191
|
-
const
|
|
192
|
-
|
|
192
|
+
const i = this.getForm();
|
|
193
|
+
i && (r.preventDefault(), i.dispatchEvent(new Event("submit")));
|
|
193
194
|
} else if (this["button-type"] === "reset") {
|
|
194
|
-
const
|
|
195
|
-
|
|
195
|
+
const i = this.getForm();
|
|
196
|
+
i && (r.preventDefault(), i.reset());
|
|
196
197
|
}
|
|
197
198
|
});
|
|
198
199
|
}
|
|
199
200
|
$beforeUnmounted() {
|
|
200
201
|
var t;
|
|
201
|
-
(t =
|
|
202
|
+
(t = a(this, n)) == null || t.abort();
|
|
202
203
|
}
|
|
203
204
|
}
|
|
204
|
-
|
|
205
|
-
window.customElements.get("ea-button") || window.customElements.define("ea-button",
|
|
205
|
+
o = new WeakMap(), l = new WeakMap(), n = new WeakMap(), h = new WeakMap();
|
|
206
|
+
window.customElements.get("ea-button") || window.customElements.define("ea-button", w);
|
|
206
207
|
class E extends v {
|
|
207
208
|
constructor() {
|
|
208
209
|
super();
|
|
@@ -213,13 +214,13 @@ class E extends v {
|
|
|
213
214
|
* @property {string} type
|
|
214
215
|
*/
|
|
215
216
|
/** @type {Properties} */
|
|
216
|
-
|
|
217
|
+
c(this, "state", this.properties({
|
|
217
218
|
disabled: {
|
|
218
219
|
type: Boolean,
|
|
219
220
|
default: !1,
|
|
220
221
|
observer: (t) => {
|
|
221
|
-
this.querySelectorAll("ea-button").forEach((
|
|
222
|
-
|
|
222
|
+
this.querySelectorAll("ea-button").forEach((r) => {
|
|
223
|
+
r.setAttribute("disabled", t);
|
|
223
224
|
});
|
|
224
225
|
}
|
|
225
226
|
},
|
|
@@ -227,8 +228,8 @@ class E extends v {
|
|
|
227
228
|
type: ["small", "normal", "large"],
|
|
228
229
|
default: "normal",
|
|
229
230
|
observer: (t) => {
|
|
230
|
-
this.querySelectorAll("ea-button").forEach((
|
|
231
|
-
|
|
231
|
+
this.querySelectorAll("ea-button").forEach((r) => {
|
|
232
|
+
r.setAttribute("size", t);
|
|
232
233
|
});
|
|
233
234
|
}
|
|
234
235
|
},
|
|
@@ -236,13 +237,13 @@ class E extends v {
|
|
|
236
237
|
type: ["primary", "success", "warning", "danger", "normal"],
|
|
237
238
|
default: "normal",
|
|
238
239
|
observer: (t) => {
|
|
239
|
-
this.querySelectorAll("ea-button").forEach((
|
|
240
|
-
|
|
240
|
+
this.querySelectorAll("ea-button").forEach((r) => {
|
|
241
|
+
r.setAttribute("type", t);
|
|
241
242
|
});
|
|
242
243
|
}
|
|
243
244
|
}
|
|
244
245
|
}));
|
|
245
|
-
this.stylesheet =
|
|
246
|
+
this.stylesheet = A, this.$render();
|
|
246
247
|
}
|
|
247
248
|
static get observedAttributes() {
|
|
248
249
|
return [...super.observedAttributes, "disabled", "size", "type"];
|
|
@@ -260,6 +261,6 @@ class E extends v {
|
|
|
260
261
|
}
|
|
261
262
|
window.customElements.get("ea-button-group") || window.customElements.define("ea-button-group", E);
|
|
262
263
|
export {
|
|
263
|
-
|
|
264
|
+
w as EaButton,
|
|
264
265
|
E as EaButtonGroup
|
|
265
266
|
};
|