easy-component-ui 3.0.14 → 3.0.15

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.
Files changed (167) hide show
  1. package/dist/assets/icon.css +1 -0
  2. package/dist/components/Base.js +941 -0
  3. package/dist/components/ea-alert.js +213 -0
  4. package/dist/components/ea-avatar.js +164 -0
  5. package/dist/components/ea-backtop.js +136 -0
  6. package/dist/components/ea-badge.js +144 -0
  7. package/dist/components/ea-breadcrumb.js +148 -0
  8. package/dist/components/ea-button.js +266 -0
  9. package/dist/components/ea-calendar.js +10 -0
  10. package/dist/components/ea-calendar2.js +673 -0
  11. package/dist/components/ea-card.js +121 -0
  12. package/dist/components/ea-carousel.js +415 -0
  13. package/dist/components/ea-checkbox.js +446 -0
  14. package/dist/components/ea-collapse.js +313 -0
  15. package/dist/components/ea-color-picker.js +888 -0
  16. package/dist/components/ea-container.js +206 -0
  17. package/dist/components/ea-countdown.js +142 -0
  18. package/dist/components/ea-date-picker.js +649 -0
  19. package/dist/components/ea-descriptions.js +474 -0
  20. package/dist/components/ea-dialog.js +249 -0
  21. package/dist/components/ea-drawer.js +216 -0
  22. package/dist/components/ea-dropdown.js +228 -0
  23. package/dist/components/ea-empty.js +93 -0
  24. package/dist/components/ea-icon.js +159 -0
  25. package/dist/components/ea-image-preview.js +532 -0
  26. package/dist/components/ea-image.js +327 -0
  27. package/dist/components/ea-infinite-scroll.js +109 -0
  28. package/dist/components/ea-input-number.js +367 -0
  29. package/dist/components/ea-input.js +588 -0
  30. package/dist/components/ea-layout.js +132 -0
  31. package/dist/components/ea-link.js +101 -0
  32. package/dist/components/ea-menu.js +433 -0
  33. package/dist/components/ea-message-box.js +624 -0
  34. package/dist/components/ea-message.js +313 -0
  35. package/dist/components/ea-notification.js +331 -0
  36. package/dist/components/ea-overlay.js +168 -0
  37. package/dist/components/ea-page-header.js +108 -0
  38. package/dist/components/ea-pagination.js +481 -0
  39. package/dist/components/ea-popconfirm.js +275 -0
  40. package/dist/components/ea-popover.js +147 -0
  41. package/dist/components/ea-popper.js +203 -0
  42. package/dist/components/ea-progress.js +286 -0
  43. package/dist/components/ea-radio.js +364 -0
  44. package/dist/components/ea-rate.js +241 -0
  45. package/dist/components/ea-result.js +100 -0
  46. package/dist/components/ea-scrollbar.js +235 -0
  47. package/dist/components/ea-segmented.js +215 -0
  48. package/dist/components/ea-select.js +609 -0
  49. package/dist/components/ea-skeleton.js +263 -0
  50. package/dist/components/ea-slider.js +430 -0
  51. package/dist/components/ea-space.js +123 -0
  52. package/dist/components/ea-splitter.js +233 -0
  53. package/dist/components/ea-statistic.js +74 -0
  54. package/dist/components/ea-steps.js +346 -0
  55. package/dist/components/ea-switch.js +271 -0
  56. package/dist/components/ea-table.js +1137 -0
  57. package/dist/components/ea-tabs.js +503 -0
  58. package/dist/components/ea-tag.js +228 -0
  59. package/dist/components/ea-text.js +113 -0
  60. package/dist/components/ea-time-picker.js +510 -0
  61. package/dist/components/ea-timeline.js +185 -0
  62. package/dist/components/ea-tooltip.js +161 -0
  63. package/dist/components/ea-tour.js +544 -0
  64. package/dist/components/ea-transfer.js +949 -0
  65. package/dist/components/ea-tree.js +1125 -0
  66. package/dist/components/index.js +60 -0
  67. package/dist/core/FormBase.js +238 -0
  68. package/dist/css/ea-alert.style.js +4 -0
  69. package/dist/css/ea-aside.style.js +4 -0
  70. package/dist/css/ea-avatar.style.js +4 -0
  71. package/dist/css/ea-backtop.style.js +4 -0
  72. package/dist/css/ea-badge.style.js +4 -0
  73. package/dist/css/ea-breadcrumb-item.style.js +4 -0
  74. package/dist/css/ea-breadcrumb.style.js +4 -0
  75. package/dist/css/ea-button-group.style.js +4 -0
  76. package/dist/css/ea-button.style.js +4 -0
  77. package/dist/css/ea-calendar.style.js +4 -0
  78. package/dist/css/ea-card.style.js +4 -0
  79. package/dist/css/ea-carousel-item.style.js +4 -0
  80. package/dist/css/ea-carousel.style.js +4 -0
  81. package/dist/css/ea-check-tag.style.js +4 -0
  82. package/dist/css/ea-checkbox-group.style.js +4 -0
  83. package/dist/css/ea-checkbox.style.js +4 -0
  84. package/dist/css/ea-col.style.js +4 -0
  85. package/dist/css/ea-collapse-item.style.js +4 -0
  86. package/dist/css/ea-collapse.style.js +4 -0
  87. package/dist/css/ea-color-picker-panel.style.js +4 -0
  88. package/dist/css/ea-color-picker.style.js +4 -0
  89. package/dist/css/ea-container.style.js +4 -0
  90. package/dist/css/ea-date-picker.style.js +4 -0
  91. package/dist/css/ea-descriptions-item.style.js +4 -0
  92. package/dist/css/ea-descriptions.style.js +4 -0
  93. package/dist/css/ea-dialog.style.js +4 -0
  94. package/dist/css/ea-drawer.style.js +4 -0
  95. package/dist/css/ea-dropdown-item.style.js +4 -0
  96. package/dist/css/ea-dropdown-menu.style.js +4 -0
  97. package/dist/css/ea-dropdown.style.js +4 -0
  98. package/dist/css/ea-empty.style.js +4 -0
  99. package/dist/css/ea-footer.style.js +4 -0
  100. package/dist/css/ea-header.style.js +4 -0
  101. package/dist/css/ea-icon.style.js +4 -0
  102. package/dist/css/ea-image-preview.style.js +4 -0
  103. package/dist/css/ea-image.style.js +4 -0
  104. package/dist/css/ea-infinite-scroll.style.js +4 -0
  105. package/dist/css/ea-input-number.style.js +4 -0
  106. package/dist/css/ea-input.style.js +4 -0
  107. package/dist/css/ea-link.style.js +4 -0
  108. package/dist/css/ea-main.style.js +4 -0
  109. package/dist/css/ea-menu-item-group.style.js +4 -0
  110. package/dist/css/ea-menu-item.style.js +4 -0
  111. package/dist/css/ea-menu.style.js +4 -0
  112. package/dist/css/ea-message-box.style.js +4 -0
  113. package/dist/css/ea-message.style.js +4 -0
  114. package/dist/css/ea-notification.style.js +4 -0
  115. package/dist/css/ea-option-gropu.style.js +4 -0
  116. package/dist/css/ea-option.style.js +4 -0
  117. package/dist/css/ea-overlay.style.js +4 -0
  118. package/dist/css/ea-page-header.style.js +4 -0
  119. package/dist/css/ea-pagination.style.js +4 -0
  120. package/dist/css/ea-popconfirm.style.js +4 -0
  121. package/dist/css/ea-popover.style.js +4 -0
  122. package/dist/css/ea-popper.style.js +4 -0
  123. package/dist/css/ea-progress.style.js +4 -0
  124. package/dist/css/ea-radio-group.style.js +4 -0
  125. package/dist/css/ea-radio.style.js +4 -0
  126. package/dist/css/ea-rate.style.js +4 -0
  127. package/dist/css/ea-result.style.js +4 -0
  128. package/dist/css/ea-row.style.js +4 -0
  129. package/dist/css/ea-scrollbar.style.js +4 -0
  130. package/dist/css/ea-segmented.style.js +4 -0
  131. package/dist/css/ea-select.style.js +4 -0
  132. package/dist/css/ea-skeleton-item.style.js +4 -0
  133. package/dist/css/ea-skeleton.style.js +4 -0
  134. package/dist/css/ea-slider.style.js +4 -0
  135. package/dist/css/ea-space.style.js +4 -0
  136. package/dist/css/ea-splitter-bar.style.js +4 -0
  137. package/dist/css/ea-splitter-panel.style.js +4 -0
  138. package/dist/css/ea-splitter.style.js +4 -0
  139. package/dist/css/ea-statistic.style.js +4 -0
  140. package/dist/css/ea-step.style.js +4 -0
  141. package/dist/css/ea-steps.style.js +4 -0
  142. package/dist/css/ea-sub-menu.style.js +4 -0
  143. package/dist/css/ea-switch.style.js +4 -0
  144. package/dist/css/ea-tab-panel.style.js +4 -0
  145. package/dist/css/ea-tab.style.js +4 -0
  146. package/dist/css/ea-table-column.style.js +4 -0
  147. package/dist/css/ea-table.style.js +4 -0
  148. package/dist/css/ea-tabs.style.js +4 -0
  149. package/dist/css/ea-tag.style.js +4 -0
  150. package/dist/css/ea-text.style.js +4 -0
  151. package/dist/css/ea-time-picker.style.js +4 -0
  152. package/dist/css/ea-timeline-item.style.js +4 -0
  153. package/dist/css/ea-timeline.style.js +4 -0
  154. package/dist/css/ea-tooltip.style.js +4 -0
  155. package/dist/css/ea-tour-step.style.js +4 -0
  156. package/dist/css/ea-tour.style.js +4 -0
  157. package/dist/css/ea-transfer.style.js +5 -0
  158. package/dist/css/ea-tree.style.js +6 -0
  159. package/dist/css/ea-ui-component.style.js +4 -0
  160. package/dist/favicon.ico +0 -0
  161. package/dist/utils/Color.js +439 -0
  162. package/dist/utils/I18nManager.js +218 -0
  163. package/dist/utils/Utils.js +65 -0
  164. package/dist/utils/Variables.js +12 -0
  165. package/dist/utils/parseTime.js +73 -0
  166. package/dist/utils/timeout.js +9 -0
  167. package/package.json +1 -1
@@ -0,0 +1,313 @@
1
+ var k = Object.defineProperty;
2
+ var x = (s) => {
3
+ throw TypeError(s);
4
+ };
5
+ var N = (s, i, t) => i in s ? k(s, i, { enumerable: !0, configurable: !0, writable: !0, value: t }) : s[i] = t;
6
+ var p = (s, i, t) => N(s, typeof i != "symbol" ? i + "" : i, t), R = (s, i, t) => i.has(s) || x("Cannot " + t);
7
+ var e = (s, i, t) => (R(s, i, "read from private field"), t ? t.call(s) : i.get(s)), o = (s, i, t) => i.has(s) ? x("Cannot add the same private member more than once") : i instanceof WeakSet ? i.add(s) : i.set(s, t), r = (s, i, t, a) => (R(s, i, "write to private field"), a ? a.call(s, t) : i.set(s, t), t);
8
+ import { B as $ } from "./Base.js";
9
+ import { s as B } from "../css/ea-collapse.style.js";
10
+ import { s as L } from "../css/ea-collapse-item.style.js";
11
+ var g, c, d, y, C, w;
12
+ class P extends $ {
13
+ constructor() {
14
+ super();
15
+ /** @type {HTMLElement} */
16
+ o(this, g);
17
+ /** @type {AbortController} */
18
+ o(this, c);
19
+ p(this, "state", this.properties({
20
+ accordion: {
21
+ type: Boolean,
22
+ default: !1,
23
+ observer: () => {
24
+ }
25
+ },
26
+ active: {
27
+ props: !0,
28
+ type: {
29
+ String: () => this.accordion,
30
+ Array: () => !this.accordion
31
+ },
32
+ default: () => this.accordion ? "" : [],
33
+ observer: (t) => {
34
+ this.setActiveNames(t);
35
+ }
36
+ },
37
+ "expand-icon-position": {
38
+ type: ["left", "right"],
39
+ default: "right",
40
+ observer: (t) => {
41
+ this.querySelectorAll("ea-collapse-item").forEach((a) => {
42
+ a["expand-icon-position"] = t;
43
+ });
44
+ }
45
+ }
46
+ }));
47
+ p(this, "fnState", this.properties({
48
+ beforeCollapse: {
49
+ props: !0,
50
+ rawFunction: !0,
51
+ type: Function,
52
+ default: null,
53
+ observer: () => {
54
+ }
55
+ }
56
+ }));
57
+ /**
58
+ * 更新手风琴模式下的折叠状态
59
+ * @param {string} [activeName]
60
+ */
61
+ o(this, d, (t = this.active) => {
62
+ [...this.querySelectorAll("ea-collapse-item")].forEach(
63
+ (l) => l.toggleAttribute("active", l.getAttribute("name") === t)
64
+ );
65
+ });
66
+ /**
67
+ * 更新普通模式下的折叠状态
68
+ * @param {string[]} [activeNames]
69
+ */
70
+ o(this, y, (t = this.active) => {
71
+ [...this.querySelectorAll("ea-collapse-item")].forEach(
72
+ (l) => l.toggleAttribute(
73
+ "active",
74
+ t.includes(l.getAttribute("name"))
75
+ )
76
+ );
77
+ });
78
+ /**
79
+ * 折叠项点击事件处理
80
+ * @param {CustomEvent} e
81
+ */
82
+ o(this, C, async (t) => {
83
+ t.preventDefault(), t.stopImmediatePropagation(), t.stopPropagation();
84
+ const { name: a, el: l } = t.detail;
85
+ if (typeof this.beforeCollapse == "function")
86
+ try {
87
+ if (!await this.beforeCollapse({ name: a, el: l })) return;
88
+ } catch {
89
+ return;
90
+ }
91
+ if (this.accordion)
92
+ e(this, d).call(this, a), this.active = a;
93
+ else
94
+ try {
95
+ this.active.includes(a) ? (this.active = this.active.filter((q) => q !== a), l.toggleAttribute("active", !1)) : (this.active = [...this.active, a], l.toggleAttribute("active", this.active.includes(a)));
96
+ } catch {
97
+ console.error(
98
+ `${this.tagName}: When 'accordion' is false, 'active' should be an Array type.`,
99
+ this
100
+ );
101
+ }
102
+ this.emit("change", {
103
+ detail: {
104
+ name: a,
105
+ target: l,
106
+ active: this.active
107
+ },
108
+ bubbles: !0
109
+ });
110
+ });
111
+ /**
112
+ * 初始化折叠项的唯一标识及折叠状态
113
+ */
114
+ o(this, w, () => {
115
+ [...this.querySelectorAll("ea-collapse-item")].forEach((a, l) => {
116
+ a.getAttribute("name") || a.setAttribute("name", l);
117
+ });
118
+ });
119
+ /**
120
+ * 设置折叠项的展开状态
121
+ * @param {string | string[]} newVal
122
+ */
123
+ p(this, "setActiveNames", (t) => {
124
+ this.accordion ? e(this, d).call(this, t) : e(this, y).call(this, t);
125
+ });
126
+ this.stylesheet = B, this.$render();
127
+ }
128
+ static get observedAttributes() {
129
+ return [...super.observedAttributes, "accordion", "expand-icon-position"];
130
+ }
131
+ $render() {
132
+ this.shadowRoot.innerHTML = `
133
+ <div class='ea-collapse' part='container'>
134
+ <slot></slot>
135
+ </div>
136
+ `, r(this, g, this.shadowRoot.querySelector(".ea-collapse"));
137
+ }
138
+ connectedCallback() {
139
+ var t;
140
+ super.connectedCallback(), (t = e(this, c)) == null || t.abort(), r(this, c, new AbortController()), e(this, w).call(this), this.addEventListener("collapse-item-click", e(this, C), {
141
+ signal: e(this, c).signal
142
+ });
143
+ }
144
+ $beforeUnmounted() {
145
+ var t;
146
+ (t = e(this, c)) == null || t.abort();
147
+ }
148
+ }
149
+ g = new WeakMap(), c = new WeakMap(), d = new WeakMap(), y = new WeakMap(), C = new WeakMap(), w = new WeakMap();
150
+ window.customElements.get("ea-collapse") || window.customElements.define("ea-collapse", P);
151
+ var h, u, A, m, S, b, v, n, f, _, E;
152
+ class H extends $ {
153
+ constructor() {
154
+ super();
155
+ /** @type {HTMLElement} */
156
+ o(this, h);
157
+ /** @type {HTMLElement} */
158
+ o(this, u);
159
+ /** @type {HTMLElement} */
160
+ o(this, A);
161
+ /** @type {HTMLSlotElement} */
162
+ o(this, m);
163
+ /** @type {HTMLElement} */
164
+ o(this, S);
165
+ /** @type {HTMLElement} */
166
+ o(this, b);
167
+ /** @type {HTMLSlotElement} */
168
+ o(this, v);
169
+ /** @type {AbortController} */
170
+ o(this, n);
171
+ p(this, "state", this.properties({
172
+ title: {
173
+ type: String,
174
+ default: "",
175
+ observer: (t) => {
176
+ e(this, m).textContent = t;
177
+ }
178
+ },
179
+ name: {
180
+ type: String,
181
+ default: "",
182
+ observer: () => {
183
+ }
184
+ },
185
+ "expand-icon-position": {
186
+ type: ["left", "right"],
187
+ default: "right",
188
+ observer: () => {
189
+ this.updateContainerClasslist();
190
+ }
191
+ },
192
+ disabled: {
193
+ type: Boolean,
194
+ default: !1,
195
+ observer: () => {
196
+ this.updateContainerClasslist();
197
+ }
198
+ },
199
+ active: {
200
+ type: Boolean,
201
+ default: !1,
202
+ observer: (t) => {
203
+ e(this, f).call(this, t);
204
+ }
205
+ }
206
+ }));
207
+ /**
208
+ * 更新折叠面板高度
209
+ * @param {boolean} isActive
210
+ */
211
+ o(this, f, (t = this.active) => {
212
+ queueMicrotask(() => {
213
+ e(this, h).style.setProperty(
214
+ "--ea-collapse-item-content-height",
215
+ t ? `${e(this, b).scrollHeight}px` : "0"
216
+ );
217
+ });
218
+ });
219
+ /**
220
+ * 折叠面板 展开/收起 事件处理
221
+ * @param {Event} e
222
+ */
223
+ o(this, _, (t) => {
224
+ t.preventDefault(), t.stopImmediatePropagation(), !this.disabled && this.emit("collapse-item-click", {
225
+ detail: {
226
+ name: this.name,
227
+ el: this
228
+ },
229
+ bubbles: !0,
230
+ cancelable: !0
231
+ });
232
+ });
233
+ /**
234
+ * 插槽变化事件处理
235
+ */
236
+ o(this, E, () => {
237
+ e(this, h).style.setProperty(
238
+ "--ea-collapse-item-content-height",
239
+ "auto"
240
+ ), e(this, f).call(this);
241
+ });
242
+ this.stylesheet = L, this.$render();
243
+ }
244
+ static get observedAttributes() {
245
+ return [
246
+ ...super.observedAttributes,
247
+ "title",
248
+ "name",
249
+ "disabled",
250
+ "expand-icon-position",
251
+ "active"
252
+ ];
253
+ }
254
+ /**
255
+ * 获取 classlist 列表
256
+ * @return {string} 属性值
257
+ */
258
+ updateContainerClasslist() {
259
+ const t = this.computedClasslist(
260
+ "ea-collapse-item",
261
+ {
262
+ ["--indicator-" + this["expand-icon-position"]]: this["expand-icon-position"]
263
+ },
264
+ {
265
+ disabled: this.disabled
266
+ }
267
+ );
268
+ return e(this, h).className = t, t;
269
+ }
270
+ $render() {
271
+ this.shadowRoot.innerHTML = `
272
+ <div class='ea-collapse-item' part='container'>
273
+ <div class="ea-collapse-item__title-wrap" part="title-wrap">
274
+ <span class="ea-collapse-item__title" part="title">
275
+ <slot name="title"></slot>
276
+ </span>
277
+ <span class="ea-collapse-item__indicator" part="indicator">
278
+ <slot name="icon">
279
+ <ea-icon class="default-expand-icon" name="angle-down" part="icon"></ea-icon>
280
+ </slot>
281
+ </span>
282
+ </div>
283
+ <div class="ea-collapse-item__content" part="content-wrap">
284
+ <slot></slot>
285
+ </div>
286
+ </div>
287
+ `, r(this, h, this.shadowRoot.querySelector(".ea-collapse-item")), r(this, u, this.shadowRoot.querySelector(
288
+ ".ea-collapse-item__title-wrap"
289
+ )), r(this, A, this.shadowRoot.querySelector(".ea-collapse-item__title")), r(this, m, this.shadowRoot.querySelector(
290
+ ".ea-collapse-item__title slot"
291
+ )), r(this, S, this.shadowRoot.querySelector(
292
+ ".ea-collapse-item__title-icon"
293
+ )), r(this, b, this.shadowRoot.querySelector(".ea-collapse-item__content")), r(this, v, this.shadowRoot.querySelector("slot:not([name])")), this.updateContainerClasslist();
294
+ }
295
+ connectedCallback() {
296
+ var t;
297
+ super.connectedCallback(), (t = e(this, n)) == null || t.abort(), r(this, n, new AbortController()), e(this, u).addEventListener("click", e(this, _), {
298
+ signal: e(this, n).signal
299
+ }), e(this, v).addEventListener("slotchange", e(this, E), {
300
+ signal: e(this, n).signal
301
+ });
302
+ }
303
+ $beforeUnmounted() {
304
+ var t;
305
+ (t = e(this, n)) == null || t.abort();
306
+ }
307
+ }
308
+ h = new WeakMap(), u = new WeakMap(), A = new WeakMap(), m = new WeakMap(), S = new WeakMap(), b = new WeakMap(), v = new WeakMap(), n = new WeakMap(), f = new WeakMap(), _ = new WeakMap(), E = new WeakMap();
309
+ window.customElements.get("ea-collapse-item") || window.customElements.define("ea-collapse-item", H);
310
+ export {
311
+ P as EaCollapse,
312
+ H as EaCollapseItem
313
+ };