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,93 +1,121 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var b = Object.defineProperty;
|
|
2
|
+
var f = (t) => {
|
|
3
3
|
throw TypeError(t);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var
|
|
7
|
-
var
|
|
8
|
-
import { B as
|
|
9
|
-
import { s as
|
|
10
|
-
import { s as
|
|
11
|
-
import { s as
|
|
12
|
-
import { s as
|
|
13
|
-
import { s as
|
|
14
|
-
var
|
|
15
|
-
class
|
|
5
|
+
var g = (t, s, e) => s in t ? b(t, s, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[s] = e;
|
|
6
|
+
var n = (t, s, e) => g(t, typeof s != "symbol" ? s + "" : s, e), y = (t, s, e) => s.has(t) || f("Cannot " + e);
|
|
7
|
+
var r = (t, s, e) => (y(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), a = (t, s, e, d) => (y(t, s, "write to private field"), d ? d.call(t, e) : s.set(t, e), e);
|
|
8
|
+
import { B as c } from "./Base.js";
|
|
9
|
+
import { s as w } from "../css/ea-container.style.js";
|
|
10
|
+
import { s as C } from "../css/ea-header.style.js";
|
|
11
|
+
import { s as E } from "../css/ea-main.style.js";
|
|
12
|
+
import { s as $ } from "../css/ea-footer.style.js";
|
|
13
|
+
import { s as v } from "../css/ea-aside.style.js";
|
|
14
|
+
var h, l, i, u;
|
|
15
|
+
class S extends c {
|
|
16
16
|
constructor() {
|
|
17
17
|
super();
|
|
18
18
|
/** @type {HTMLElement} */
|
|
19
|
-
|
|
20
|
-
/**
|
|
19
|
+
o(this, h);
|
|
20
|
+
/** @type {SlotElement} */
|
|
21
|
+
o(this, l);
|
|
22
|
+
/** @type {AbortController} */
|
|
23
|
+
o(this, i);
|
|
24
|
+
/**
|
|
21
25
|
* @typedef {Object} State
|
|
22
26
|
* @property {string} direction 排列方向
|
|
23
27
|
*/
|
|
24
28
|
/** @type {State} */
|
|
25
|
-
|
|
29
|
+
n(this, "state", this.properties({
|
|
26
30
|
direction: {
|
|
27
31
|
type: ["horizontal", "vertical"],
|
|
28
32
|
default: "horizontal",
|
|
29
|
-
observer: (
|
|
30
|
-
this.
|
|
33
|
+
observer: () => {
|
|
34
|
+
this.updateContainerClasslist();
|
|
31
35
|
}
|
|
32
36
|
}
|
|
33
37
|
}));
|
|
34
|
-
|
|
38
|
+
/**
|
|
39
|
+
* 处理槽位变化事件
|
|
40
|
+
*/
|
|
41
|
+
o(this, u, () => {
|
|
42
|
+
const e = [...this.querySelectorAll("& > *")].map(
|
|
43
|
+
(d) => d.tagName.toLowerCase()
|
|
44
|
+
);
|
|
45
|
+
this.hasAttribute("direction") || (e.includes("ea-header") || e.includes("ea-footer") ? this.direction = "vertical" : this.direction = "horizontal");
|
|
46
|
+
});
|
|
47
|
+
this.stylesheet = w, this.$render();
|
|
35
48
|
}
|
|
36
49
|
static get observedAttributes() {
|
|
37
|
-
return ["direction"];
|
|
50
|
+
return [...super.observedAttributes, "direction"];
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* 获取 classlist 列表
|
|
54
|
+
* @return {string} 属性值
|
|
55
|
+
*/
|
|
56
|
+
updateContainerClasslist() {
|
|
57
|
+
const e = this.computedClasslist("ea-container", {
|
|
58
|
+
[`--${this.direction}`]: this.direction
|
|
59
|
+
});
|
|
60
|
+
return r(this, h).className = e, e;
|
|
38
61
|
}
|
|
39
62
|
$render() {
|
|
40
63
|
this.shadowRoot.innerHTML = `
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
64
|
+
<div class="ea-container" part="container">
|
|
65
|
+
<slot></slot>
|
|
66
|
+
</div>
|
|
67
|
+
`, a(this, h, this.shadowRoot.querySelector(".ea-container")), a(this, l, this.shadowRoot.querySelector("slot"));
|
|
45
68
|
}
|
|
46
69
|
connectedCallback() {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
70
|
+
var e;
|
|
71
|
+
super.connectedCallback(), (e = r(this, i)) == null || e.abort(), a(this, i, new AbortController()), r(this, l).addEventListener("slotchange", r(this, u), {
|
|
72
|
+
signal: r(this, i).signal
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
$beforeUnmounted() {
|
|
76
|
+
var e;
|
|
77
|
+
(e = r(this, i)) == null || e.abort();
|
|
50
78
|
}
|
|
51
79
|
}
|
|
52
|
-
|
|
53
|
-
customElements.get("ea-container") || customElements.define("ea-container",
|
|
54
|
-
class
|
|
80
|
+
h = new WeakMap(), l = new WeakMap(), i = new WeakMap(), u = new WeakMap();
|
|
81
|
+
customElements.get("ea-container") || customElements.define("ea-container", S);
|
|
82
|
+
class k extends c {
|
|
55
83
|
constructor() {
|
|
56
84
|
super();
|
|
57
|
-
/**
|
|
85
|
+
/**
|
|
58
86
|
* @typedef {Object} State
|
|
59
87
|
* @property {string} height
|
|
60
88
|
*/
|
|
61
89
|
/** @type {State} */
|
|
62
|
-
|
|
90
|
+
n(this, "state", this.properties({
|
|
63
91
|
height: {
|
|
64
92
|
type: String,
|
|
65
93
|
default: "60px",
|
|
66
94
|
observer: (e) => {
|
|
67
|
-
this.style.setProperty("--ea-header-height", e);
|
|
95
|
+
e && CSS.supports("height", e) ? this.style.setProperty("--ea-header-height", e) : e ? this.style.setProperty("--ea-header-height", "60px") : this.style.setProperty("--ea-header-height", "auto");
|
|
68
96
|
}
|
|
69
97
|
}
|
|
70
98
|
}));
|
|
71
|
-
this.stylesheet =
|
|
99
|
+
this.stylesheet = C, this.$render();
|
|
72
100
|
}
|
|
73
101
|
static get observedAttributes() {
|
|
74
102
|
return ["height"];
|
|
75
103
|
}
|
|
76
104
|
$render() {
|
|
77
105
|
this.shadowRoot.innerHTML = `
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
106
|
+
<header class="ea-header" part="container">
|
|
107
|
+
<slot></slot>
|
|
108
|
+
</header>
|
|
109
|
+
`;
|
|
82
110
|
}
|
|
83
111
|
connectedCallback() {
|
|
84
112
|
super.connectedCallback();
|
|
85
113
|
}
|
|
86
114
|
}
|
|
87
|
-
window.customElements.get("ea-header") || window.customElements.define("ea-header",
|
|
88
|
-
class
|
|
115
|
+
window.customElements.get("ea-header") || window.customElements.define("ea-header", k);
|
|
116
|
+
class x extends c {
|
|
89
117
|
constructor() {
|
|
90
|
-
super(), this.stylesheet =
|
|
118
|
+
super(), this.stylesheet = E, this.$render();
|
|
91
119
|
}
|
|
92
120
|
$render() {
|
|
93
121
|
this.shadowRoot.innerHTML = `
|
|
@@ -100,27 +128,28 @@ class v extends o {
|
|
|
100
128
|
super.connectedCallback();
|
|
101
129
|
}
|
|
102
130
|
}
|
|
103
|
-
window.customElements.get("ea-main") || window.customElements.define("ea-main",
|
|
104
|
-
var
|
|
105
|
-
class
|
|
131
|
+
window.customElements.get("ea-main") || window.customElements.define("ea-main", x);
|
|
132
|
+
var p;
|
|
133
|
+
class A extends c {
|
|
106
134
|
constructor() {
|
|
107
135
|
super();
|
|
108
136
|
/** @type {HTMLElement} */
|
|
109
|
-
|
|
110
|
-
/**
|
|
137
|
+
o(this, p);
|
|
138
|
+
/**
|
|
111
139
|
* @typedef {Object} State
|
|
140
|
+
* @property {string} height
|
|
112
141
|
*/
|
|
113
142
|
/** @type {State} */
|
|
114
|
-
|
|
143
|
+
n(this, "state", this.properties({
|
|
115
144
|
height: {
|
|
116
145
|
type: String,
|
|
117
146
|
default: "60px",
|
|
118
147
|
observer: (e) => {
|
|
119
|
-
this.style.setProperty("--ea-footer-height", e);
|
|
148
|
+
e && CSS.supports("height", e) ? this.style.setProperty("--ea-footer-height", e) : e ? this.style.setProperty("--ea-footer-height", "60px") : this.style.setProperty("--ea-footer-height", "auto");
|
|
120
149
|
}
|
|
121
150
|
}
|
|
122
151
|
}));
|
|
123
|
-
this.stylesheet =
|
|
152
|
+
this.stylesheet = $, this.$render();
|
|
124
153
|
}
|
|
125
154
|
static get observedAttributes() {
|
|
126
155
|
return ["height"];
|
|
@@ -130,25 +159,25 @@ class C extends o {
|
|
|
130
159
|
<footer class="ea-footer" part="container">
|
|
131
160
|
<slot></slot>
|
|
132
161
|
</footer>
|
|
133
|
-
`,
|
|
162
|
+
`, a(this, p, this.shadowRoot.querySelector(".ea-footer"));
|
|
134
163
|
}
|
|
135
164
|
connectedCallback() {
|
|
136
165
|
super.connectedCallback();
|
|
137
166
|
}
|
|
138
167
|
}
|
|
139
|
-
|
|
140
|
-
window.customElements.get("ea-footer") || window.customElements.define("ea-footer",
|
|
141
|
-
var
|
|
142
|
-
class
|
|
168
|
+
p = new WeakMap();
|
|
169
|
+
window.customElements.get("ea-footer") || window.customElements.define("ea-footer", A);
|
|
170
|
+
var m;
|
|
171
|
+
class R extends c {
|
|
143
172
|
constructor() {
|
|
144
173
|
super();
|
|
145
174
|
/** @type {HTMLElement} */
|
|
146
|
-
|
|
147
|
-
/**
|
|
175
|
+
o(this, m);
|
|
176
|
+
/**
|
|
148
177
|
* @typedef {Object} State
|
|
149
178
|
*/
|
|
150
179
|
/** @type {State} */
|
|
151
|
-
|
|
180
|
+
n(this, "state", this.properties({
|
|
152
181
|
width: {
|
|
153
182
|
type: String,
|
|
154
183
|
default: "300px",
|
|
@@ -157,7 +186,7 @@ class k extends o {
|
|
|
157
186
|
}
|
|
158
187
|
}
|
|
159
188
|
}));
|
|
160
|
-
this.stylesheet =
|
|
189
|
+
this.stylesheet = v, this.$render();
|
|
161
190
|
}
|
|
162
191
|
static get observedAttributes() {
|
|
163
192
|
return ["width"];
|
|
@@ -167,11 +196,11 @@ class k extends o {
|
|
|
167
196
|
<aside class="ea-aside" part="container">
|
|
168
197
|
<slot></slot>
|
|
169
198
|
</aside>
|
|
170
|
-
`,
|
|
199
|
+
`, a(this, m, this.shadowRoot.querySelector(".ea-aside"));
|
|
171
200
|
}
|
|
172
201
|
connectedCallback() {
|
|
173
202
|
super.connectedCallback();
|
|
174
203
|
}
|
|
175
204
|
}
|
|
176
|
-
|
|
177
|
-
window.customElements.get("ea-aside") || window.customElements.define("ea-aside",
|
|
205
|
+
m = new WeakMap();
|
|
206
|
+
window.customElements.get("ea-aside") || window.customElements.define("ea-aside", R);
|
|
@@ -542,7 +542,7 @@ class Yt extends ft {
|
|
|
542
542
|
this.shadowRoot.innerHTML = this.html(`
|
|
543
543
|
<div class='${e.b()}' part='container'>
|
|
544
544
|
<div class='${e.e("input-wrap")}' part='input-wrap'>
|
|
545
|
-
<ea-input class="${e.e("input")}" part='input' prefix-icon="
|
|
545
|
+
<ea-input class="${e.e("input")}" part='input' prefix-icon="calendar-xmark" readonly></ea-input>
|
|
546
546
|
</div>
|
|
547
547
|
<div class='${e.e("dropdown-wrap")}' part='dropdown-wrap'>
|
|
548
548
|
<div class='${e.e("calendar-wrapper")}'>
|
|
@@ -9,7 +9,7 @@ import { EaOverlay as E } from "./ea-overlay.js";
|
|
|
9
9
|
import { s as B } from "../css/ea-dialog.style.js";
|
|
10
10
|
import { t as C } from "../utils/timeout.js";
|
|
11
11
|
var n, h, c, p, r, i, b, f, g;
|
|
12
|
-
class
|
|
12
|
+
class k extends E {
|
|
13
13
|
constructor() {
|
|
14
14
|
super();
|
|
15
15
|
/** @type {HTMLElement} */
|
|
@@ -168,7 +168,7 @@ class A extends E {
|
|
|
168
168
|
<header class='ea-dialog-main__header' part='header'>
|
|
169
169
|
<slot name="header">
|
|
170
170
|
<span class='ea-dialog-main__title' part='title'></span>
|
|
171
|
-
<ea-icon class='ea-dialog-main__close-icon'
|
|
171
|
+
<ea-icon class='ea-dialog-main__close-icon' name='xmark' part='close-icon'></ea-icon>
|
|
172
172
|
</slot>
|
|
173
173
|
</header>
|
|
174
174
|
<main class='ea-dialog-main__content' part='content'>
|
|
@@ -243,7 +243,7 @@ class A extends E {
|
|
|
243
243
|
}
|
|
244
244
|
}
|
|
245
245
|
n = new WeakMap(), h = new WeakMap(), c = new WeakMap(), p = new WeakMap(), r = new WeakMap(), i = new WeakMap(), b = new WeakMap(), f = new WeakMap(), g = new WeakMap();
|
|
246
|
-
window.customElements.get("ea-dialog") || window.customElements.define("ea-dialog",
|
|
246
|
+
window.customElements.get("ea-dialog") || window.customElements.define("ea-dialog", k);
|
|
247
247
|
export {
|
|
248
|
-
|
|
248
|
+
k as EaDialog
|
|
249
249
|
};
|
|
@@ -1,35 +1,35 @@
|
|
|
1
|
-
var
|
|
2
|
-
var
|
|
1
|
+
var g = Object.defineProperty;
|
|
2
|
+
var _ = (s) => {
|
|
3
3
|
throw TypeError(s);
|
|
4
4
|
};
|
|
5
|
-
var
|
|
6
|
-
var C = (s, o, e) =>
|
|
7
|
-
var t = (s, o, e) => (
|
|
8
|
-
import { EaOverlay as
|
|
9
|
-
import { s as
|
|
5
|
+
var S = (s, o, e) => o in s ? g(s, o, { enumerable: !0, configurable: !0, writable: !0, value: e }) : s[o] = e;
|
|
6
|
+
var C = (s, o, e) => S(s, typeof o != "symbol" ? o + "" : o, e), E = (s, o, e) => o.has(s) || _("Cannot " + e);
|
|
7
|
+
var t = (s, o, e) => (E(s, o, "read from private field"), e ? e.call(s) : o.get(s)), a = (s, o, e) => o.has(s) ? _("Cannot add the same private member more than once") : o instanceof WeakSet ? o.add(s) : o.set(s, e), l = (s, o, e, i) => (E(s, o, "write to private field"), i ? i.call(s, e) : o.set(s, e), e);
|
|
8
|
+
import { EaOverlay as k } from "./ea-overlay.js";
|
|
9
|
+
import { s as A } from "../css/ea-drawer.style.js";
|
|
10
10
|
import { E as q } from "../utils/Utils.js";
|
|
11
|
-
import { t as
|
|
12
|
-
var
|
|
13
|
-
class
|
|
11
|
+
import { t as R } from "../utils/timeout.js";
|
|
12
|
+
var p, c, u, f, n, w, b, h, r, m, d, y;
|
|
13
|
+
class B extends k {
|
|
14
14
|
constructor() {
|
|
15
15
|
super();
|
|
16
16
|
/** @type {HTMLElement} */
|
|
17
|
-
|
|
17
|
+
a(this, p);
|
|
18
18
|
/** @type {HTMLElement} */
|
|
19
|
-
|
|
19
|
+
a(this, c);
|
|
20
20
|
/** @type {HTMLElement} */
|
|
21
|
-
|
|
21
|
+
a(this, u);
|
|
22
22
|
/** @type {HTMLElement} */
|
|
23
|
-
|
|
23
|
+
a(this, f);
|
|
24
24
|
/** @type {HTMLElement} */
|
|
25
|
-
|
|
25
|
+
a(this, n);
|
|
26
26
|
/** @type {HTMLElement} */
|
|
27
|
-
|
|
27
|
+
a(this, w);
|
|
28
28
|
/** @type {HTMLElement} */
|
|
29
|
-
|
|
29
|
+
a(this, b);
|
|
30
30
|
/** @type {AbortController} */
|
|
31
|
-
|
|
32
|
-
|
|
31
|
+
a(this, h);
|
|
32
|
+
a(this, r, {
|
|
33
33
|
/** @type {AbortController | null} */
|
|
34
34
|
showClose: null,
|
|
35
35
|
/** @type {AbortController | null} */
|
|
@@ -46,33 +46,33 @@ class R extends S {
|
|
|
46
46
|
repeatable: !0,
|
|
47
47
|
observer: (e) => {
|
|
48
48
|
if (!e && this.beforeClose && this.status !== this.visible) {
|
|
49
|
-
this.visible = !e, t(this,
|
|
49
|
+
this.visible = !e, t(this, d).call(this);
|
|
50
50
|
return;
|
|
51
51
|
}
|
|
52
|
-
e &&
|
|
52
|
+
e && R(() => this.focus(), 0), (e || !this.beforeClose) && (this.status = e);
|
|
53
53
|
}
|
|
54
54
|
},
|
|
55
55
|
"with-header": {
|
|
56
56
|
type: Boolean,
|
|
57
57
|
default: !0,
|
|
58
58
|
observer: (e) => {
|
|
59
|
-
t(this,
|
|
59
|
+
t(this, u).style.display = e ? "flex" : "none";
|
|
60
60
|
}
|
|
61
61
|
},
|
|
62
62
|
title: {
|
|
63
63
|
type: String,
|
|
64
64
|
default: "",
|
|
65
65
|
observer: (e) => {
|
|
66
|
-
this["with-header"] && (t(this,
|
|
66
|
+
this["with-header"] && (t(this, f).textContent = e);
|
|
67
67
|
}
|
|
68
68
|
},
|
|
69
69
|
showClose: {
|
|
70
70
|
type: Boolean,
|
|
71
71
|
default: !0,
|
|
72
72
|
observer: (e) => {
|
|
73
|
-
var
|
|
74
|
-
(
|
|
75
|
-
signal: t(this,
|
|
73
|
+
var i;
|
|
74
|
+
(i = t(this, r).showClose) == null || i.abort(), t(this, r).showClose = null, this["with-header"] && (t(this, n).style.display = e ? "block" : "none"), e && (t(this, r).showClose = new AbortController(), t(this, n).addEventListener("click", t(this, d), {
|
|
75
|
+
signal: t(this, r).showClose.signal
|
|
76
76
|
}));
|
|
77
77
|
}
|
|
78
78
|
},
|
|
@@ -91,9 +91,9 @@ class R extends S {
|
|
|
91
91
|
type: Boolean,
|
|
92
92
|
default: !0,
|
|
93
93
|
observer: (e) => {
|
|
94
|
-
var
|
|
95
|
-
(
|
|
96
|
-
signal: t(this,
|
|
94
|
+
var i;
|
|
95
|
+
(i = t(this, r).closeOnPressEscape) == null || i.abort(), t(this, r).closeOnPressEscape = null, e && (t(this, r).closeOnPressEscape = new AbortController(), document.addEventListener("keydown", t(this, y), {
|
|
96
|
+
signal: t(this, r).closeOnPressEscape.signal
|
|
97
97
|
}));
|
|
98
98
|
}
|
|
99
99
|
}
|
|
@@ -110,14 +110,14 @@ class R extends S {
|
|
|
110
110
|
* 初始化抽屉 DOM 结构
|
|
111
111
|
* @param {HTMLElement} container - 抽屉内容容器
|
|
112
112
|
*/
|
|
113
|
-
|
|
113
|
+
a(this, m, (e) => {
|
|
114
114
|
e.innerHTML = `
|
|
115
115
|
<div class="ea-drawer-main" part="container">
|
|
116
116
|
<header class="ea-drawer-main__header" part="header">
|
|
117
117
|
<span class="ea-drawer-main__title" part="title">
|
|
118
118
|
<slot name="title"></slot>
|
|
119
119
|
</span>
|
|
120
|
-
<ea-icon class="ea-drawer-main__close-icon"
|
|
120
|
+
<ea-icon class="ea-drawer-main__close-icon" name="xmark" part="close-icon"></ea-icon>
|
|
121
121
|
</header>
|
|
122
122
|
<main class="ea-drawer-main__content" part="content">
|
|
123
123
|
<slot></slot>
|
|
@@ -126,14 +126,14 @@ class R extends S {
|
|
|
126
126
|
<slot name="footer"></slot>
|
|
127
127
|
</footer>
|
|
128
128
|
</div>
|
|
129
|
-
`,
|
|
129
|
+
`, l(this, p, this.shadowRoot.querySelector(".ea-overlay")), l(this, c, this.shadowRoot.querySelector(".ea-drawer-main")), l(this, u, this.shadowRoot.querySelector(".ea-drawer-main__header")), l(this, f, this.shadowRoot.querySelector(".ea-drawer-main__title")), l(this, n, this.shadowRoot.querySelector(
|
|
130
130
|
".ea-drawer-main__close-icon"
|
|
131
|
-
)),
|
|
131
|
+
)), l(this, w, this.shadowRoot.querySelector(".ea-drawer-main__content")), l(this, b, this.shadowRoot.querySelector(".ea-drawer-main__footer"));
|
|
132
132
|
});
|
|
133
133
|
/**
|
|
134
134
|
* 处理抽屉关闭前的回调
|
|
135
135
|
*/
|
|
136
|
-
|
|
136
|
+
a(this, d, () => {
|
|
137
137
|
this.beforeClose ? this.beforeClose(() => {
|
|
138
138
|
this.status = !1, this.visible = !1;
|
|
139
139
|
}) : (this.status = !1, this.visible = !1);
|
|
@@ -142,8 +142,8 @@ class R extends S {
|
|
|
142
142
|
* 处理键盘事件
|
|
143
143
|
* @param {KeyboardEvent} e - 键盘事件对象
|
|
144
144
|
*/
|
|
145
|
-
|
|
146
|
-
e.key === "Escape" && this.visible && t(this,
|
|
145
|
+
a(this, y, (e) => {
|
|
146
|
+
e.key === "Escape" && this.visible && t(this, d).call(this);
|
|
147
147
|
});
|
|
148
148
|
this["append-to-body"] && document.body.appendChild(this);
|
|
149
149
|
const e = this.shadowRoot.querySelector(
|
|
@@ -174,7 +174,7 @@ class R extends S {
|
|
|
174
174
|
* @return {string} 属性值
|
|
175
175
|
*/
|
|
176
176
|
updateContainerClasslist() {
|
|
177
|
-
|
|
177
|
+
const e = `${super.updateContainerClasslist()} ${this.computedClasslist(
|
|
178
178
|
"ea-drawer",
|
|
179
179
|
{
|
|
180
180
|
["--" + this.direction]: this.direction
|
|
@@ -183,10 +183,11 @@ class R extends S {
|
|
|
183
183
|
drawer: !0
|
|
184
184
|
}
|
|
185
185
|
)}`;
|
|
186
|
+
return t(this, p).className = e, e;
|
|
186
187
|
}
|
|
187
188
|
connectedCallback() {
|
|
188
|
-
var e;
|
|
189
|
-
(e = t(this,
|
|
189
|
+
var e, i;
|
|
190
|
+
(e = t(this, h)) == null || e.abort(), l(this, h, new AbortController()), t(this, c).ariaModal = !0, t(this, c).role = "dialog", this["close-on-click-modal"] = this.getAttrBoolean(
|
|
190
191
|
"close-on-click-modal",
|
|
191
192
|
!0
|
|
192
193
|
), this.addEventListener(
|
|
@@ -195,17 +196,21 @@ class R extends S {
|
|
|
195
196
|
this.visible = !1;
|
|
196
197
|
},
|
|
197
198
|
{
|
|
198
|
-
signal: t(this,
|
|
199
|
+
signal: t(this, h).signal
|
|
199
200
|
}
|
|
200
|
-
),
|
|
201
|
+
), this["show-close"] && ((i = t(this, r).showClose) == null || i.abort(), t(this, r).showClose = new AbortController(), t(this, n).addEventListener("click", t(this, d), {
|
|
202
|
+
signal: t(this, r).showClose.signal
|
|
203
|
+
})), super.connectedCallback(), this.assignedStyle(A);
|
|
201
204
|
}
|
|
202
205
|
$beforeUnmounted() {
|
|
203
|
-
var e;
|
|
204
|
-
(e = t(this,
|
|
206
|
+
var e, i;
|
|
207
|
+
(e = t(this, h)) == null || e.abort();
|
|
208
|
+
for (const v in t(this, r))
|
|
209
|
+
(i = t(this, r)[v]) == null || i.abort(), t(this, r)[v] = null;
|
|
205
210
|
}
|
|
206
211
|
}
|
|
207
|
-
|
|
208
|
-
window.customElements.get("ea-drawer") || window.customElements.define("ea-drawer",
|
|
212
|
+
p = new WeakMap(), c = new WeakMap(), u = new WeakMap(), f = new WeakMap(), n = new WeakMap(), w = new WeakMap(), b = new WeakMap(), h = new WeakMap(), r = new WeakMap(), m = new WeakMap(), d = new WeakMap(), y = new WeakMap();
|
|
213
|
+
window.customElements.get("ea-drawer") || window.customElements.define("ea-drawer", B);
|
|
209
214
|
export {
|
|
210
|
-
|
|
215
|
+
B as EaDrawer
|
|
211
216
|
};
|