easy-component-ui 3.0.13 → 3.0.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +162 -162
- package/package.json +8 -2
- package/dist/assets/icon.css +0 -1
- package/dist/components/Base.js +0 -874
- package/dist/components/ea-alert.js +0 -213
- package/dist/components/ea-avatar.js +0 -164
- package/dist/components/ea-backtop.js +0 -136
- package/dist/components/ea-badge.js +0 -144
- package/dist/components/ea-breadcrumb.js +0 -148
- package/dist/components/ea-button.js +0 -266
- package/dist/components/ea-calendar.js +0 -10
- package/dist/components/ea-calendar2.js +0 -673
- package/dist/components/ea-card.js +0 -121
- package/dist/components/ea-carousel.js +0 -415
- package/dist/components/ea-checkbox.js +0 -446
- package/dist/components/ea-collapse.js +0 -313
- package/dist/components/ea-color-picker.js +0 -888
- package/dist/components/ea-container.js +0 -206
- package/dist/components/ea-countdown.js +0 -142
- package/dist/components/ea-date-picker.js +0 -649
- package/dist/components/ea-descriptions.js +0 -474
- package/dist/components/ea-dialog.js +0 -249
- package/dist/components/ea-drawer.js +0 -216
- package/dist/components/ea-dropdown.js +0 -228
- package/dist/components/ea-empty.js +0 -93
- package/dist/components/ea-icon.js +0 -158
- package/dist/components/ea-image-preview.js +0 -532
- package/dist/components/ea-image.js +0 -327
- package/dist/components/ea-infinite-scroll.js +0 -109
- package/dist/components/ea-input-number.js +0 -367
- package/dist/components/ea-input.js +0 -588
- package/dist/components/ea-layout.js +0 -132
- package/dist/components/ea-link.js +0 -101
- package/dist/components/ea-menu.js +0 -433
- package/dist/components/ea-message-box.js +0 -624
- package/dist/components/ea-message.js +0 -314
- package/dist/components/ea-notification.js +0 -331
- package/dist/components/ea-overlay.js +0 -168
- package/dist/components/ea-page-header.js +0 -108
- package/dist/components/ea-pagination.js +0 -481
- package/dist/components/ea-popconfirm.js +0 -275
- package/dist/components/ea-popover.js +0 -147
- package/dist/components/ea-popper.js +0 -203
- package/dist/components/ea-progress.js +0 -286
- package/dist/components/ea-radio.js +0 -364
- package/dist/components/ea-rate.js +0 -241
- package/dist/components/ea-result.js +0 -100
- package/dist/components/ea-scrollbar.js +0 -235
- package/dist/components/ea-segmented.js +0 -215
- package/dist/components/ea-select.js +0 -609
- package/dist/components/ea-skeleton.js +0 -263
- package/dist/components/ea-slider.js +0 -430
- package/dist/components/ea-space.js +0 -123
- package/dist/components/ea-splitter.js +0 -233
- package/dist/components/ea-statistic.js +0 -74
- package/dist/components/ea-steps.js +0 -346
- package/dist/components/ea-switch.js +0 -271
- package/dist/components/ea-table.js +0 -1135
- package/dist/components/ea-tabs.js +0 -501
- package/dist/components/ea-tag.js +0 -228
- package/dist/components/ea-text.js +0 -113
- package/dist/components/ea-time-picker.js +0 -510
- package/dist/components/ea-timeline.js +0 -185
- package/dist/components/ea-tooltip.js +0 -161
- package/dist/components/ea-tour.js +0 -544
- package/dist/components/ea-transfer.js +0 -949
- package/dist/components/ea-tree.js +0 -1125
- package/dist/components/index.js +0 -60
- package/dist/core/FormBase.js +0 -238
- package/dist/css/ea-alert.style.js +0 -4
- package/dist/css/ea-aside.style.js +0 -4
- package/dist/css/ea-avatar.style.js +0 -4
- package/dist/css/ea-backtop.style.js +0 -4
- package/dist/css/ea-badge.style.js +0 -4
- package/dist/css/ea-breadcrumb-item.style.js +0 -4
- package/dist/css/ea-breadcrumb.style.js +0 -4
- package/dist/css/ea-button-group.style.js +0 -4
- package/dist/css/ea-button.style.js +0 -4
- package/dist/css/ea-calendar.style.js +0 -4
- package/dist/css/ea-card.style.js +0 -4
- package/dist/css/ea-carousel-item.style.js +0 -4
- package/dist/css/ea-carousel.style.js +0 -4
- package/dist/css/ea-check-tag.style.js +0 -4
- package/dist/css/ea-checkbox-group.style.js +0 -4
- package/dist/css/ea-checkbox.style.js +0 -4
- package/dist/css/ea-col.style.js +0 -4
- package/dist/css/ea-collapse-item.style.js +0 -4
- package/dist/css/ea-collapse.style.js +0 -4
- package/dist/css/ea-color-picker-panel.style.js +0 -4
- package/dist/css/ea-color-picker.style.js +0 -4
- package/dist/css/ea-container.style.js +0 -4
- package/dist/css/ea-date-picker.style.js +0 -4
- package/dist/css/ea-descriptions-item.style.js +0 -4
- package/dist/css/ea-descriptions.style.js +0 -4
- package/dist/css/ea-dialog.style.js +0 -4
- package/dist/css/ea-drawer.style.js +0 -4
- package/dist/css/ea-dropdown-item.style.js +0 -4
- package/dist/css/ea-dropdown-menu.style.js +0 -4
- package/dist/css/ea-dropdown.style.js +0 -4
- package/dist/css/ea-empty.style.js +0 -4
- package/dist/css/ea-footer.style.js +0 -4
- package/dist/css/ea-header.style.js +0 -4
- package/dist/css/ea-icon.style.js +0 -4
- package/dist/css/ea-image-preview.style.js +0 -4
- package/dist/css/ea-image.style.js +0 -4
- package/dist/css/ea-infinite-scroll.style.js +0 -4
- package/dist/css/ea-input-number.style.js +0 -4
- package/dist/css/ea-input.style.js +0 -4
- package/dist/css/ea-link.style.js +0 -4
- package/dist/css/ea-main.style.js +0 -4
- package/dist/css/ea-menu-item-group.style.js +0 -4
- package/dist/css/ea-menu-item.style.js +0 -4
- package/dist/css/ea-menu.style.js +0 -4
- package/dist/css/ea-message-box.style.js +0 -4
- package/dist/css/ea-message.style.js +0 -4
- package/dist/css/ea-notification.style.js +0 -4
- package/dist/css/ea-option-gropu.style.js +0 -4
- package/dist/css/ea-option.style.js +0 -4
- package/dist/css/ea-overlay.style.js +0 -4
- package/dist/css/ea-page-header.style.js +0 -4
- package/dist/css/ea-pagination.style.js +0 -4
- package/dist/css/ea-popconfirm.style.js +0 -4
- package/dist/css/ea-popover.style.js +0 -4
- package/dist/css/ea-popper.style.js +0 -4
- package/dist/css/ea-progress.style.js +0 -4
- package/dist/css/ea-radio-group.style.js +0 -4
- package/dist/css/ea-radio.style.js +0 -4
- package/dist/css/ea-rate.style.js +0 -4
- package/dist/css/ea-result.style.js +0 -4
- package/dist/css/ea-row.style.js +0 -4
- package/dist/css/ea-scrollbar.style.js +0 -4
- package/dist/css/ea-segmented.style.js +0 -4
- package/dist/css/ea-select.style.js +0 -4
- package/dist/css/ea-skeleton-item.style.js +0 -4
- package/dist/css/ea-skeleton.style.js +0 -4
- package/dist/css/ea-slider.style.js +0 -4
- package/dist/css/ea-space.style.js +0 -4
- package/dist/css/ea-splitter-bar.style.js +0 -4
- package/dist/css/ea-splitter-panel.style.js +0 -4
- package/dist/css/ea-splitter.style.js +0 -4
- package/dist/css/ea-statistic.style.js +0 -4
- package/dist/css/ea-step.style.js +0 -4
- package/dist/css/ea-steps.style.js +0 -4
- package/dist/css/ea-sub-menu.style.js +0 -4
- package/dist/css/ea-switch.style.js +0 -4
- package/dist/css/ea-tab-panel.style.js +0 -4
- package/dist/css/ea-tab.style.js +0 -4
- package/dist/css/ea-table-column.style.js +0 -4
- package/dist/css/ea-table.style.js +0 -4
- package/dist/css/ea-tabs.style.js +0 -4
- package/dist/css/ea-tag.style.js +0 -4
- package/dist/css/ea-text.style.js +0 -4
- package/dist/css/ea-time-picker.style.js +0 -4
- package/dist/css/ea-timeline-item.style.js +0 -4
- package/dist/css/ea-timeline.style.js +0 -4
- package/dist/css/ea-tooltip.style.js +0 -4
- package/dist/css/ea-tour-step.style.js +0 -4
- package/dist/css/ea-tour.style.js +0 -4
- package/dist/css/ea-transfer.style.js +0 -5
- package/dist/css/ea-tree.style.js +0 -6
- package/dist/css/ea-ui-component.style.js +0 -4
- package/dist/favicon.ico +0 -0
- package/dist/utils/Color.js +0 -439
- package/dist/utils/I18nManager.js +0 -218
- package/dist/utils/Utils.js +0 -65
- package/dist/utils/Variables.js +0 -12
- package/dist/utils/parseTime.js +0 -73
- package/dist/utils/timeout.js +0 -9
|
@@ -1,148 +0,0 @@
|
|
|
1
|
-
var E = Object.defineProperty;
|
|
2
|
-
var S = (t) => {
|
|
3
|
-
throw TypeError(t);
|
|
4
|
-
};
|
|
5
|
-
var y = (t, r, e) => r in t ? E(t, r, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[r] = e;
|
|
6
|
-
var f = (t, r, e) => y(t, typeof r != "symbol" ? r + "" : r, e), w = (t, r, e) => r.has(t) || S("Cannot " + e);
|
|
7
|
-
var s = (t, r, e) => (w(t, r, "read from private field"), e ? e.call(t) : r.get(t)), a = (t, r, e) => r.has(t) ? S("Cannot add the same private member more than once") : r instanceof WeakSet ? r.add(t) : r.set(t, e), i = (t, r, e, n) => (w(t, r, "write to private field"), n ? n.call(t, e) : r.set(t, e), e);
|
|
8
|
-
import { B as C } from "./Base.js";
|
|
9
|
-
import { s as v } from "../css/ea-breadcrumb.style.js";
|
|
10
|
-
import { s as R } from "../css/ea-breadcrumb-item.style.js";
|
|
11
|
-
import { E as _ } from "../utils/Utils.js";
|
|
12
|
-
var l, c, d, b, p;
|
|
13
|
-
class $ extends C {
|
|
14
|
-
constructor() {
|
|
15
|
-
super();
|
|
16
|
-
/** @type {HTMLElement} */
|
|
17
|
-
a(this, l);
|
|
18
|
-
/** @type {HTMLSlotElement} */
|
|
19
|
-
a(this, c);
|
|
20
|
-
/** @type {AbortController} */
|
|
21
|
-
a(this, d, new AbortController());
|
|
22
|
-
f(this, "state", this.properties({
|
|
23
|
-
separator: {
|
|
24
|
-
type: String,
|
|
25
|
-
default: "/",
|
|
26
|
-
observer: () => {
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}));
|
|
30
|
-
/**
|
|
31
|
-
* 获取分隔符
|
|
32
|
-
* @param {string} defaultSeparator
|
|
33
|
-
* @returns {HTMLElement}
|
|
34
|
-
*/
|
|
35
|
-
a(this, b, (e = this.separator) => {
|
|
36
|
-
let o = this.shadowRoot.querySelector("#separatorSlot").assignedElements()[0];
|
|
37
|
-
return o || (o = document.createElement("span"), o.setAttribute("slot", "separator"), o.innerText = e), o;
|
|
38
|
-
});
|
|
39
|
-
/**
|
|
40
|
-
* 渲染分隔符
|
|
41
|
-
*/
|
|
42
|
-
a(this, p, () => {
|
|
43
|
-
const n = [...this.shadowRoot.querySelector("#defaultSlot").assignedElements()].filter(
|
|
44
|
-
(m) => m.tagName.toLowerCase() === "ea-breadcrumb-item"
|
|
45
|
-
), o = s(this, b).call(this, this.separator);
|
|
46
|
-
n.forEach((m, g) => {
|
|
47
|
-
g < n.length - 1 && !m.querySelector("[slot='separator']") && m.appendChild(o.cloneNode(!0));
|
|
48
|
-
});
|
|
49
|
-
});
|
|
50
|
-
this.stylesheet = v, this.$render();
|
|
51
|
-
}
|
|
52
|
-
static get observedAttributes() {
|
|
53
|
-
return [...super.observedAttributes, "separator"];
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* 获取 classlist 列表
|
|
57
|
-
* @return {string} 属性值
|
|
58
|
-
*/
|
|
59
|
-
updateContainerClasslist() {
|
|
60
|
-
const e = this.computedClasslist("ea-breadcrumb", {
|
|
61
|
-
// ['--' + this.type]: this.type,
|
|
62
|
-
});
|
|
63
|
-
return s(this, l).className = e, e;
|
|
64
|
-
}
|
|
65
|
-
$render() {
|
|
66
|
-
this.shadowRoot.innerHTML = `
|
|
67
|
-
<nav class='ea-breadcrumb' part='container'>
|
|
68
|
-
<slot id="defaultSlot"></slot>
|
|
69
|
-
</nav>
|
|
70
|
-
<slot id="separatorSlot" name="separator"></slot>
|
|
71
|
-
`, i(this, l, this.shadowRoot.querySelector(".ea-breadcrumb")), i(this, c, this.shadowRoot.querySelector("#defaultSlot"));
|
|
72
|
-
}
|
|
73
|
-
connectedCallback() {
|
|
74
|
-
super.connectedCallback(), s(this, c).addEventListener("slotchange", s(this, p), {
|
|
75
|
-
signal: s(this, d).signal
|
|
76
|
-
});
|
|
77
|
-
}
|
|
78
|
-
$beforeUnmounted() {
|
|
79
|
-
var e;
|
|
80
|
-
(e = s(this, d)) == null || e.abort();
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
l = new WeakMap(), c = new WeakMap(), d = new WeakMap(), b = new WeakMap(), p = new WeakMap();
|
|
84
|
-
window.customElements.get("ea-breadcrumb") || window.customElements.define("ea-breadcrumb", $);
|
|
85
|
-
var u, h;
|
|
86
|
-
class q extends C {
|
|
87
|
-
constructor() {
|
|
88
|
-
super();
|
|
89
|
-
/** @type {HTMLElement} */
|
|
90
|
-
a(this, u);
|
|
91
|
-
/** @type {HTMLElement} */
|
|
92
|
-
a(this, h);
|
|
93
|
-
f(this, "state", this.properties({
|
|
94
|
-
href: {
|
|
95
|
-
type: String,
|
|
96
|
-
default: "",
|
|
97
|
-
observer: (e) => {
|
|
98
|
-
this.$render(), s(this, h).href = this.getAttribute("href");
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}));
|
|
102
|
-
this.stylesheet = R, this.$render();
|
|
103
|
-
}
|
|
104
|
-
static get observedAttributes() {
|
|
105
|
-
return [...super.observedAttributes, "href"];
|
|
106
|
-
}
|
|
107
|
-
/**
|
|
108
|
-
* 获取 classlist 列表
|
|
109
|
-
* @return {string} 属性值
|
|
110
|
-
*/
|
|
111
|
-
updateContainerClasslist() {
|
|
112
|
-
const e = this.computedClasslist("ea-breadcrumb-item", {
|
|
113
|
-
// ['--' + this.type]: this.type,
|
|
114
|
-
});
|
|
115
|
-
return s(this, u).className = e, e;
|
|
116
|
-
}
|
|
117
|
-
$render() {
|
|
118
|
-
const e = _.EaElement.h(
|
|
119
|
-
this.href ? "a" : "span",
|
|
120
|
-
"ea-breadcrumb-item__content",
|
|
121
|
-
{
|
|
122
|
-
part: "content",
|
|
123
|
-
[this.href ? "href" : ""]: this.href,
|
|
124
|
-
class: ["ea-breadcrumb-item__content", this.href ? "is-link" : ""]
|
|
125
|
-
},
|
|
126
|
-
"<slot></slot>"
|
|
127
|
-
);
|
|
128
|
-
this.shadowRoot.innerHTML = `
|
|
129
|
-
<div class='ea-breadcrumb-item' part='container'>
|
|
130
|
-
${e}
|
|
131
|
-
<span class="ea-breadcrumb-item__separator" part='separator'>
|
|
132
|
-
<slot name="separator"></slot>
|
|
133
|
-
</span>
|
|
134
|
-
</div>
|
|
135
|
-
`, i(this, u, this.shadowRoot.querySelector(".ea-breadcrumb-item")), i(this, h, this.shadowRoot.querySelector(
|
|
136
|
-
".ea-breadcrumb-item__content"
|
|
137
|
-
)), this.updateContainerClasslist();
|
|
138
|
-
}
|
|
139
|
-
connectedCallback() {
|
|
140
|
-
super.connectedCallback();
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
u = new WeakMap(), h = new WeakMap();
|
|
144
|
-
window.customElements.get("ea-breadcrumb-item") || window.customElements.define("ea-breadcrumb-item", q);
|
|
145
|
-
export {
|
|
146
|
-
$ as EaBreadcrumb,
|
|
147
|
-
q as EaBreadcrumbItem
|
|
148
|
-
};
|
|
@@ -1,266 +0,0 @@
|
|
|
1
|
-
var m = Object.defineProperty;
|
|
2
|
-
var b = (e) => {
|
|
3
|
-
throw TypeError(e);
|
|
4
|
-
};
|
|
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
|
-
import { F as C } from "../core/FormBase.js";
|
|
9
|
-
import { s as g } from "../css/ea-button.style.js";
|
|
10
|
-
import { B as v } from "./Base.js";
|
|
11
|
-
import { s as A } from "../css/ea-button-group.style.js";
|
|
12
|
-
var o, l, n, h;
|
|
13
|
-
class w extends C {
|
|
14
|
-
constructor() {
|
|
15
|
-
super();
|
|
16
|
-
/** @type {HTMLButtonElement | HTMLLinkElement} */
|
|
17
|
-
u(this, o);
|
|
18
|
-
/** @type {HTMLIconElement} */
|
|
19
|
-
u(this, l);
|
|
20
|
-
/** @type {AbortController} */
|
|
21
|
-
u(this, n);
|
|
22
|
-
/**
|
|
23
|
-
* @typedef {Object} state
|
|
24
|
-
* @property {boolean} disabled
|
|
25
|
-
* @property {string} type
|
|
26
|
-
* @property {string} text
|
|
27
|
-
* @property {boolean} plain
|
|
28
|
-
* @property {boolean} round
|
|
29
|
-
* @property {boolean} circle
|
|
30
|
-
* @property {boolean} link
|
|
31
|
-
* @property {string} href
|
|
32
|
-
* @property {string} size
|
|
33
|
-
* @property {boolean} loading
|
|
34
|
-
* @property {string} icon
|
|
35
|
-
*/
|
|
36
|
-
/** @type {state} */
|
|
37
|
-
c(this, "state", this.properties({
|
|
38
|
-
disabled: {
|
|
39
|
-
type: Boolean,
|
|
40
|
-
default: !1,
|
|
41
|
-
observer: (t) => {
|
|
42
|
-
this.updateContainerClasslist();
|
|
43
|
-
}
|
|
44
|
-
},
|
|
45
|
-
type: {
|
|
46
|
-
type: ["normal", "primary", "success", "warning", "danger"],
|
|
47
|
-
default: "normal",
|
|
48
|
-
observer: (t) => {
|
|
49
|
-
this.updateContainerClasslist();
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
text: {
|
|
53
|
-
type: Boolean,
|
|
54
|
-
default: !1,
|
|
55
|
-
observer: (t) => {
|
|
56
|
-
this.updateContainerClasslist();
|
|
57
|
-
}
|
|
58
|
-
},
|
|
59
|
-
plain: {
|
|
60
|
-
type: Boolean,
|
|
61
|
-
default: !1,
|
|
62
|
-
observer: (t) => {
|
|
63
|
-
this.updateContainerClasslist();
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
|
-
round: {
|
|
67
|
-
type: Boolean,
|
|
68
|
-
default: !1,
|
|
69
|
-
observer: (t) => {
|
|
70
|
-
this.updateContainerClasslist();
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
circle: {
|
|
74
|
-
type: Boolean,
|
|
75
|
-
default: !1,
|
|
76
|
-
observer: (t) => {
|
|
77
|
-
this.updateContainerClasslist();
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
link: {
|
|
81
|
-
type: Boolean,
|
|
82
|
-
default: !1,
|
|
83
|
-
observer: (t) => {
|
|
84
|
-
this.$render(), a(this, o).href = this.getAttribute("href"), this.updateContainerClasslist();
|
|
85
|
-
}
|
|
86
|
-
},
|
|
87
|
-
href: {
|
|
88
|
-
type: String,
|
|
89
|
-
default: "",
|
|
90
|
-
observer: (t) => {
|
|
91
|
-
this.updateContainerClasslist(), a(this, o).setAttribute("href", t);
|
|
92
|
-
}
|
|
93
|
-
},
|
|
94
|
-
size: {
|
|
95
|
-
type: ["small", "medium", "large"],
|
|
96
|
-
default: "medium",
|
|
97
|
-
observer: (t) => {
|
|
98
|
-
this.updateContainerClasslist();
|
|
99
|
-
}
|
|
100
|
-
},
|
|
101
|
-
loading: {
|
|
102
|
-
type: Boolean,
|
|
103
|
-
default: !1,
|
|
104
|
-
observer: (t) => {
|
|
105
|
-
var r;
|
|
106
|
-
if (t = t === "true" || t === !0, this.toggleAttribute("disabled", t), t) {
|
|
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
|
-
} else {
|
|
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
|
-
}
|
|
113
|
-
this.updateContainerClasslist();
|
|
114
|
-
}
|
|
115
|
-
},
|
|
116
|
-
icon: {
|
|
117
|
-
type: String,
|
|
118
|
-
default: "",
|
|
119
|
-
observer: (t) => {
|
|
120
|
-
a(this, l).setAttribute("name", t), a(this, l).setAttribute("size", this.size), this.updateContainerClasslist();
|
|
121
|
-
}
|
|
122
|
-
},
|
|
123
|
-
"button-type": {
|
|
124
|
-
type: ["button", "submit", "reset"],
|
|
125
|
-
default: "button",
|
|
126
|
-
observer: (t) => {
|
|
127
|
-
a(this, o).type = t;
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}));
|
|
131
|
-
/**
|
|
132
|
-
* @param {KeyboardEvent} e
|
|
133
|
-
*/
|
|
134
|
-
u(this, h, (t) => {
|
|
135
|
-
t.key === "Enter" && this.click();
|
|
136
|
-
});
|
|
137
|
-
this.stylesheet = g, this.$render();
|
|
138
|
-
}
|
|
139
|
-
static get observedAttributes() {
|
|
140
|
-
return [
|
|
141
|
-
"disabled",
|
|
142
|
-
"type",
|
|
143
|
-
"button-type",
|
|
144
|
-
// 暂定为原生 type 属性
|
|
145
|
-
"text",
|
|
146
|
-
"plain",
|
|
147
|
-
"round",
|
|
148
|
-
"circle",
|
|
149
|
-
"link",
|
|
150
|
-
"href",
|
|
151
|
-
"size",
|
|
152
|
-
"loading",
|
|
153
|
-
"icon"
|
|
154
|
-
];
|
|
155
|
-
}
|
|
156
|
-
/**
|
|
157
|
-
* 获取 classlist 列表
|
|
158
|
-
* @return {string} 属性值
|
|
159
|
-
*/
|
|
160
|
-
updateContainerClasslist() {
|
|
161
|
-
var r;
|
|
162
|
-
const t = this.computedClasslist(
|
|
163
|
-
"ea-button",
|
|
164
|
-
{
|
|
165
|
-
["--" + this.type]: this.type,
|
|
166
|
-
"--disabled": this.disabled || this.loading,
|
|
167
|
-
"--text": this.text || this.link,
|
|
168
|
-
"--plain": this.plain,
|
|
169
|
-
"--round": this.round,
|
|
170
|
-
"--circle": this.circle,
|
|
171
|
-
["--" + this.size]: this.size
|
|
172
|
-
},
|
|
173
|
-
{ icon: (r = this.icon) == null ? void 0 : r.length }
|
|
174
|
-
);
|
|
175
|
-
return a(this, o).className = t, t;
|
|
176
|
-
}
|
|
177
|
-
$render() {
|
|
178
|
-
const t = this.getAttrBoolean("link") ? "a" : "button";
|
|
179
|
-
this.shadowRoot.innerHTML = `
|
|
180
|
-
<${t} class="ea-button" part="container" tabindex="-1">
|
|
181
|
-
<ea-icon class="ea-button__icon" part="icon"></ea-icon>
|
|
182
|
-
<slot></slot>
|
|
183
|
-
</${t}>
|
|
184
|
-
`, d(this, o, this.shadowRoot.querySelector(".ea-button")), d(this, l, this.shadowRoot.querySelector(".ea-button__icon")), this.updateContainerClasslist();
|
|
185
|
-
}
|
|
186
|
-
connectedCallback() {
|
|
187
|
-
var t;
|
|
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) => {
|
|
191
|
-
if (this["button-type"] === "submit") {
|
|
192
|
-
const i = this.getForm();
|
|
193
|
-
i && (r.preventDefault(), i.dispatchEvent(new Event("submit")));
|
|
194
|
-
} else if (this["button-type"] === "reset") {
|
|
195
|
-
const i = this.getForm();
|
|
196
|
-
i && (r.preventDefault(), i.reset());
|
|
197
|
-
}
|
|
198
|
-
});
|
|
199
|
-
}
|
|
200
|
-
$beforeUnmounted() {
|
|
201
|
-
var t;
|
|
202
|
-
(t = a(this, n)) == null || t.abort();
|
|
203
|
-
}
|
|
204
|
-
}
|
|
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);
|
|
207
|
-
class E extends v {
|
|
208
|
-
constructor() {
|
|
209
|
-
super();
|
|
210
|
-
/**
|
|
211
|
-
* @typedef {object} Properties
|
|
212
|
-
* @property {boolean} disabled
|
|
213
|
-
* @property {string} size
|
|
214
|
-
* @property {string} type
|
|
215
|
-
*/
|
|
216
|
-
/** @type {Properties} */
|
|
217
|
-
c(this, "state", this.properties({
|
|
218
|
-
disabled: {
|
|
219
|
-
type: Boolean,
|
|
220
|
-
default: !1,
|
|
221
|
-
observer: (t) => {
|
|
222
|
-
this.querySelectorAll("ea-button").forEach((r) => {
|
|
223
|
-
r.setAttribute("disabled", t);
|
|
224
|
-
});
|
|
225
|
-
}
|
|
226
|
-
},
|
|
227
|
-
size: {
|
|
228
|
-
type: ["small", "normal", "large"],
|
|
229
|
-
default: "normal",
|
|
230
|
-
observer: (t) => {
|
|
231
|
-
this.querySelectorAll("ea-button").forEach((r) => {
|
|
232
|
-
r.setAttribute("size", t);
|
|
233
|
-
});
|
|
234
|
-
}
|
|
235
|
-
},
|
|
236
|
-
type: {
|
|
237
|
-
type: ["primary", "success", "warning", "danger", "normal"],
|
|
238
|
-
default: "normal",
|
|
239
|
-
observer: (t) => {
|
|
240
|
-
this.querySelectorAll("ea-button").forEach((r) => {
|
|
241
|
-
r.setAttribute("type", t);
|
|
242
|
-
});
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
}));
|
|
246
|
-
this.stylesheet = A, this.$render();
|
|
247
|
-
}
|
|
248
|
-
static get observedAttributes() {
|
|
249
|
-
return [...super.observedAttributes, "disabled", "size", "type"];
|
|
250
|
-
}
|
|
251
|
-
$render() {
|
|
252
|
-
this.shadowRoot.innerHTML = this.html(`
|
|
253
|
-
<div class="ea-button-group">
|
|
254
|
-
<slot></slot>
|
|
255
|
-
</div>
|
|
256
|
-
`);
|
|
257
|
-
}
|
|
258
|
-
async connectedCallback() {
|
|
259
|
-
super.connectedCallback();
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
window.customElements.get("ea-button-group") || window.customElements.define("ea-button-group", E);
|
|
263
|
-
export {
|
|
264
|
-
w as EaButton,
|
|
265
|
-
E as EaButtonGroup
|
|
266
|
-
};
|