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.
Files changed (168) hide show
  1. package/README.md +162 -162
  2. package/package.json +8 -2
  3. package/dist/assets/icon.css +0 -1
  4. package/dist/components/Base.js +0 -874
  5. package/dist/components/ea-alert.js +0 -213
  6. package/dist/components/ea-avatar.js +0 -164
  7. package/dist/components/ea-backtop.js +0 -136
  8. package/dist/components/ea-badge.js +0 -144
  9. package/dist/components/ea-breadcrumb.js +0 -148
  10. package/dist/components/ea-button.js +0 -266
  11. package/dist/components/ea-calendar.js +0 -10
  12. package/dist/components/ea-calendar2.js +0 -673
  13. package/dist/components/ea-card.js +0 -121
  14. package/dist/components/ea-carousel.js +0 -415
  15. package/dist/components/ea-checkbox.js +0 -446
  16. package/dist/components/ea-collapse.js +0 -313
  17. package/dist/components/ea-color-picker.js +0 -888
  18. package/dist/components/ea-container.js +0 -206
  19. package/dist/components/ea-countdown.js +0 -142
  20. package/dist/components/ea-date-picker.js +0 -649
  21. package/dist/components/ea-descriptions.js +0 -474
  22. package/dist/components/ea-dialog.js +0 -249
  23. package/dist/components/ea-drawer.js +0 -216
  24. package/dist/components/ea-dropdown.js +0 -228
  25. package/dist/components/ea-empty.js +0 -93
  26. package/dist/components/ea-icon.js +0 -158
  27. package/dist/components/ea-image-preview.js +0 -532
  28. package/dist/components/ea-image.js +0 -327
  29. package/dist/components/ea-infinite-scroll.js +0 -109
  30. package/dist/components/ea-input-number.js +0 -367
  31. package/dist/components/ea-input.js +0 -588
  32. package/dist/components/ea-layout.js +0 -132
  33. package/dist/components/ea-link.js +0 -101
  34. package/dist/components/ea-menu.js +0 -433
  35. package/dist/components/ea-message-box.js +0 -624
  36. package/dist/components/ea-message.js +0 -314
  37. package/dist/components/ea-notification.js +0 -331
  38. package/dist/components/ea-overlay.js +0 -168
  39. package/dist/components/ea-page-header.js +0 -108
  40. package/dist/components/ea-pagination.js +0 -481
  41. package/dist/components/ea-popconfirm.js +0 -275
  42. package/dist/components/ea-popover.js +0 -147
  43. package/dist/components/ea-popper.js +0 -203
  44. package/dist/components/ea-progress.js +0 -286
  45. package/dist/components/ea-radio.js +0 -364
  46. package/dist/components/ea-rate.js +0 -241
  47. package/dist/components/ea-result.js +0 -100
  48. package/dist/components/ea-scrollbar.js +0 -235
  49. package/dist/components/ea-segmented.js +0 -215
  50. package/dist/components/ea-select.js +0 -609
  51. package/dist/components/ea-skeleton.js +0 -263
  52. package/dist/components/ea-slider.js +0 -430
  53. package/dist/components/ea-space.js +0 -123
  54. package/dist/components/ea-splitter.js +0 -233
  55. package/dist/components/ea-statistic.js +0 -74
  56. package/dist/components/ea-steps.js +0 -346
  57. package/dist/components/ea-switch.js +0 -271
  58. package/dist/components/ea-table.js +0 -1135
  59. package/dist/components/ea-tabs.js +0 -501
  60. package/dist/components/ea-tag.js +0 -228
  61. package/dist/components/ea-text.js +0 -113
  62. package/dist/components/ea-time-picker.js +0 -510
  63. package/dist/components/ea-timeline.js +0 -185
  64. package/dist/components/ea-tooltip.js +0 -161
  65. package/dist/components/ea-tour.js +0 -544
  66. package/dist/components/ea-transfer.js +0 -949
  67. package/dist/components/ea-tree.js +0 -1125
  68. package/dist/components/index.js +0 -60
  69. package/dist/core/FormBase.js +0 -238
  70. package/dist/css/ea-alert.style.js +0 -4
  71. package/dist/css/ea-aside.style.js +0 -4
  72. package/dist/css/ea-avatar.style.js +0 -4
  73. package/dist/css/ea-backtop.style.js +0 -4
  74. package/dist/css/ea-badge.style.js +0 -4
  75. package/dist/css/ea-breadcrumb-item.style.js +0 -4
  76. package/dist/css/ea-breadcrumb.style.js +0 -4
  77. package/dist/css/ea-button-group.style.js +0 -4
  78. package/dist/css/ea-button.style.js +0 -4
  79. package/dist/css/ea-calendar.style.js +0 -4
  80. package/dist/css/ea-card.style.js +0 -4
  81. package/dist/css/ea-carousel-item.style.js +0 -4
  82. package/dist/css/ea-carousel.style.js +0 -4
  83. package/dist/css/ea-check-tag.style.js +0 -4
  84. package/dist/css/ea-checkbox-group.style.js +0 -4
  85. package/dist/css/ea-checkbox.style.js +0 -4
  86. package/dist/css/ea-col.style.js +0 -4
  87. package/dist/css/ea-collapse-item.style.js +0 -4
  88. package/dist/css/ea-collapse.style.js +0 -4
  89. package/dist/css/ea-color-picker-panel.style.js +0 -4
  90. package/dist/css/ea-color-picker.style.js +0 -4
  91. package/dist/css/ea-container.style.js +0 -4
  92. package/dist/css/ea-date-picker.style.js +0 -4
  93. package/dist/css/ea-descriptions-item.style.js +0 -4
  94. package/dist/css/ea-descriptions.style.js +0 -4
  95. package/dist/css/ea-dialog.style.js +0 -4
  96. package/dist/css/ea-drawer.style.js +0 -4
  97. package/dist/css/ea-dropdown-item.style.js +0 -4
  98. package/dist/css/ea-dropdown-menu.style.js +0 -4
  99. package/dist/css/ea-dropdown.style.js +0 -4
  100. package/dist/css/ea-empty.style.js +0 -4
  101. package/dist/css/ea-footer.style.js +0 -4
  102. package/dist/css/ea-header.style.js +0 -4
  103. package/dist/css/ea-icon.style.js +0 -4
  104. package/dist/css/ea-image-preview.style.js +0 -4
  105. package/dist/css/ea-image.style.js +0 -4
  106. package/dist/css/ea-infinite-scroll.style.js +0 -4
  107. package/dist/css/ea-input-number.style.js +0 -4
  108. package/dist/css/ea-input.style.js +0 -4
  109. package/dist/css/ea-link.style.js +0 -4
  110. package/dist/css/ea-main.style.js +0 -4
  111. package/dist/css/ea-menu-item-group.style.js +0 -4
  112. package/dist/css/ea-menu-item.style.js +0 -4
  113. package/dist/css/ea-menu.style.js +0 -4
  114. package/dist/css/ea-message-box.style.js +0 -4
  115. package/dist/css/ea-message.style.js +0 -4
  116. package/dist/css/ea-notification.style.js +0 -4
  117. package/dist/css/ea-option-gropu.style.js +0 -4
  118. package/dist/css/ea-option.style.js +0 -4
  119. package/dist/css/ea-overlay.style.js +0 -4
  120. package/dist/css/ea-page-header.style.js +0 -4
  121. package/dist/css/ea-pagination.style.js +0 -4
  122. package/dist/css/ea-popconfirm.style.js +0 -4
  123. package/dist/css/ea-popover.style.js +0 -4
  124. package/dist/css/ea-popper.style.js +0 -4
  125. package/dist/css/ea-progress.style.js +0 -4
  126. package/dist/css/ea-radio-group.style.js +0 -4
  127. package/dist/css/ea-radio.style.js +0 -4
  128. package/dist/css/ea-rate.style.js +0 -4
  129. package/dist/css/ea-result.style.js +0 -4
  130. package/dist/css/ea-row.style.js +0 -4
  131. package/dist/css/ea-scrollbar.style.js +0 -4
  132. package/dist/css/ea-segmented.style.js +0 -4
  133. package/dist/css/ea-select.style.js +0 -4
  134. package/dist/css/ea-skeleton-item.style.js +0 -4
  135. package/dist/css/ea-skeleton.style.js +0 -4
  136. package/dist/css/ea-slider.style.js +0 -4
  137. package/dist/css/ea-space.style.js +0 -4
  138. package/dist/css/ea-splitter-bar.style.js +0 -4
  139. package/dist/css/ea-splitter-panel.style.js +0 -4
  140. package/dist/css/ea-splitter.style.js +0 -4
  141. package/dist/css/ea-statistic.style.js +0 -4
  142. package/dist/css/ea-step.style.js +0 -4
  143. package/dist/css/ea-steps.style.js +0 -4
  144. package/dist/css/ea-sub-menu.style.js +0 -4
  145. package/dist/css/ea-switch.style.js +0 -4
  146. package/dist/css/ea-tab-panel.style.js +0 -4
  147. package/dist/css/ea-tab.style.js +0 -4
  148. package/dist/css/ea-table-column.style.js +0 -4
  149. package/dist/css/ea-table.style.js +0 -4
  150. package/dist/css/ea-tabs.style.js +0 -4
  151. package/dist/css/ea-tag.style.js +0 -4
  152. package/dist/css/ea-text.style.js +0 -4
  153. package/dist/css/ea-time-picker.style.js +0 -4
  154. package/dist/css/ea-timeline-item.style.js +0 -4
  155. package/dist/css/ea-timeline.style.js +0 -4
  156. package/dist/css/ea-tooltip.style.js +0 -4
  157. package/dist/css/ea-tour-step.style.js +0 -4
  158. package/dist/css/ea-tour.style.js +0 -4
  159. package/dist/css/ea-transfer.style.js +0 -5
  160. package/dist/css/ea-tree.style.js +0 -6
  161. package/dist/css/ea-ui-component.style.js +0 -4
  162. package/dist/favicon.ico +0 -0
  163. package/dist/utils/Color.js +0 -439
  164. package/dist/utils/I18nManager.js +0 -218
  165. package/dist/utils/Utils.js +0 -65
  166. package/dist/utils/Variables.js +0 -12
  167. package/dist/utils/parseTime.js +0 -73
  168. package/dist/utils/timeout.js +0 -9
@@ -1,673 +0,0 @@
1
- var Ot = Object.defineProperty;
2
- var _t = (f) => {
3
- throw TypeError(f);
4
- };
5
- var At = (f, y, t) => y in f ? Ot(f, y, { enumerable: !0, configurable: !0, writable: !0, value: t }) : f[y] = t;
6
- var St = (f, y, t) => At(f, typeof y != "symbol" ? y + "" : y, t), Mt = (f, y, t) => y.has(f) || _t("Cannot " + t);
7
- var o = (f, y, t) => (Mt(f, y, "read from private field"), t ? t.call(f) : y.get(f)), C = (f, y, t) => y.has(f) ? _t("Cannot add the same private member more than once") : y instanceof WeakSet ? y.add(f) : y.set(f, t), z = (f, y, t, e) => (Mt(f, y, "write to private field"), e ? e.call(f, t) : y.set(f, t), t), Dt = (f, y, t) => (Mt(f, y, "access private method"), t);
8
- import { B as Tt } from "./Base.js";
9
- import { s as Rt } from "../css/ea-calendar.style.js";
10
- import "./ea-button.js";
11
- import "./ea-select.js";
12
- import { i as _ } from "../utils/I18nManager.js";
13
- import { E as Ct } from "../utils/Utils.js";
14
- const Ht = (f) => {
15
- const y = `ea-${f}`;
16
- return {
17
- b: () => y,
18
- cb: () => `.${y}`,
19
- e: (t) => `${y}__${t}`,
20
- ce: (t) => `.${y}__${t}`,
21
- m: (...t) => t.map((e) => `${y}--${e}`).join(" "),
22
- cm: (...t) => t.map((e) => `.${y}--${e}`).join(" "),
23
- s: (...t) => t.map((e) => `is-${e}`).join(" "),
24
- cs: (...t) => t.map((e) => `.is-${e}`).join(" ")
25
- };
26
- };
27
- var Lt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
28
- function jt(f) {
29
- return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
30
- }
31
- var vt = { exports: {} }, Yt;
32
- function xt() {
33
- return Yt || (Yt = 1, function(f, y) {
34
- (function(t, e) {
35
- f.exports = e();
36
- })(Lt, function() {
37
- var t = 1e3, e = 6e4, h = 36e5, p = "millisecond", d = "second", D = "minute", b = "hour", $ = "day", Y = "week", g = "month", F = "quarter", k = "year", m = "date", I = "Invalid Date", B = /^(\d{4})[-/]?(\d{1,2})?[-/]?(\d{0,2})[Tt\s]*(\d{1,2})?:?(\d{1,2})?:?(\d{1,2})?[.:]?(\d+)?$/, U = /\[([^\]]+)]|Y{1,4}|M{1,4}|D{1,2}|d{1,4}|H{1,2}|h{1,2}|a|A|m{1,2}|s{1,2}|Z{1,2}|SSS/g, P = { name: "en", weekdays: "Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"), months: "January_February_March_April_May_June_July_August_September_October_November_December".split("_"), ordinal: function(i) {
38
- var a = ["th", "st", "nd", "rd"], n = i % 100;
39
- return "[" + i + (a[(n - 20) % 10] || a[n] || a[0]) + "]";
40
- } }, H = function(i, a, n) {
41
- var s = String(i);
42
- return !s || s.length >= a ? i : "" + Array(a + 1 - s.length).join(n) + i;
43
- }, bt = { s: H, z: function(i) {
44
- var a = -i.utcOffset(), n = Math.abs(a), s = Math.floor(n / 60), r = n % 60;
45
- return (a <= 0 ? "+" : "-") + H(s, 2, "0") + ":" + H(r, 2, "0");
46
- }, m: function i(a, n) {
47
- if (a.date() < n.date()) return -i(n, a);
48
- var s = 12 * (n.year() - a.year()) + (n.month() - a.month()), r = a.clone().add(s, g), l = n - r < 0, c = a.clone().add(s + (l ? -1 : 1), g);
49
- return +(-(s + (n - r) / (l ? r - c : c - r)) || 0);
50
- }, a: function(i) {
51
- return i < 0 ? Math.ceil(i) || 0 : Math.floor(i);
52
- }, p: function(i) {
53
- return { M: g, y: k, w: Y, d: $, D: m, h: b, m: D, s: d, ms: p, Q: F }[i] || String(i || "").toLowerCase().replace(/s$/, "");
54
- }, u: function(i) {
55
- return i === void 0;
56
- } }, v = "en", T = {};
57
- T[v] = P;
58
- var K = "$isDayjsObject", X = function(i) {
59
- return i instanceof q || !(!i || !i[K]);
60
- }, W = function i(a, n, s) {
61
- var r;
62
- if (!a) return v;
63
- if (typeof a == "string") {
64
- var l = a.toLowerCase();
65
- T[l] && (r = l), n && (T[l] = n, r = l);
66
- var c = a.split("-");
67
- if (!r && c.length > 1) return i(c[0]);
68
- } else {
69
- var M = a.name;
70
- T[M] = a, r = M;
71
- }
72
- return !s && r && (v = r), r || !s && v;
73
- }, w = function(i, a) {
74
- if (X(i)) return i.clone();
75
- var n = typeof a == "object" ? a : {};
76
- return n.date = i, n.args = arguments, new q(n);
77
- }, u = bt;
78
- u.l = W, u.i = X, u.w = function(i, a) {
79
- return w(i, { locale: a.$L, utc: a.$u, x: a.$x, $offset: a.$offset });
80
- };
81
- var q = function() {
82
- function i(n) {
83
- this.$L = W(n.locale, null, !0), this.parse(n), this.$x = this.$x || n.x || {}, this[K] = !0;
84
- }
85
- var a = i.prototype;
86
- return a.parse = function(n) {
87
- this.$d = function(s) {
88
- var r = s.date, l = s.utc;
89
- if (r === null) return /* @__PURE__ */ new Date(NaN);
90
- if (u.u(r)) return /* @__PURE__ */ new Date();
91
- if (r instanceof Date) return new Date(r);
92
- if (typeof r == "string" && !/Z$/i.test(r)) {
93
- var c = r.match(B);
94
- if (c) {
95
- var M = c[2] - 1 || 0, S = (c[7] || "0").substring(0, 3);
96
- return l ? new Date(Date.UTC(c[1], M, c[3] || 1, c[4] || 0, c[5] || 0, c[6] || 0, S)) : new Date(c[1], M, c[3] || 1, c[4] || 0, c[5] || 0, c[6] || 0, S);
97
- }
98
- }
99
- return new Date(r);
100
- }(n), this.init();
101
- }, a.init = function() {
102
- var n = this.$d;
103
- this.$y = n.getFullYear(), this.$M = n.getMonth(), this.$D = n.getDate(), this.$W = n.getDay(), this.$H = n.getHours(), this.$m = n.getMinutes(), this.$s = n.getSeconds(), this.$ms = n.getMilliseconds();
104
- }, a.$utils = function() {
105
- return u;
106
- }, a.isValid = function() {
107
- return this.$d.toString() !== I;
108
- }, a.isSame = function(n, s) {
109
- var r = w(n);
110
- return this.startOf(s) <= r && r <= this.endOf(s);
111
- }, a.isAfter = function(n, s) {
112
- return w(n) < this.startOf(s);
113
- }, a.isBefore = function(n, s) {
114
- return this.endOf(s) < w(n);
115
- }, a.$g = function(n, s, r) {
116
- return u.u(n) ? this[s] : this.set(r, n);
117
- }, a.unix = function() {
118
- return Math.floor(this.valueOf() / 1e3);
119
- }, a.valueOf = function() {
120
- return this.$d.getTime();
121
- }, a.startOf = function(n, s) {
122
- var r = this, l = !!u.u(s) || s, c = u.p(n), M = function(V, A) {
123
- var J = u.w(r.$u ? Date.UTC(r.$y, A, V) : new Date(r.$y, A, V), r);
124
- return l ? J : J.endOf($);
125
- }, S = function(V, A) {
126
- return u.w(r.toDate()[V].apply(r.toDate("s"), (l ? [0, 0, 0, 0] : [23, 59, 59, 999]).slice(A)), r);
127
- }, x = this.$W, E = this.$M, j = this.$D, tt = "set" + (this.$u ? "UTC" : "");
128
- switch (c) {
129
- case k:
130
- return l ? M(1, 0) : M(31, 11);
131
- case g:
132
- return l ? M(1, E) : M(0, E + 1);
133
- case Y:
134
- var Z = this.$locale().weekStart || 0, nt = (x < Z ? x + 7 : x) - Z;
135
- return M(l ? j - nt : j + (6 - nt), E);
136
- case $:
137
- case m:
138
- return S(tt + "Hours", 0);
139
- case b:
140
- return S(tt + "Minutes", 1);
141
- case D:
142
- return S(tt + "Seconds", 2);
143
- case d:
144
- return S(tt + "Milliseconds", 3);
145
- default:
146
- return this.clone();
147
- }
148
- }, a.endOf = function(n) {
149
- return this.startOf(n, !1);
150
- }, a.$set = function(n, s) {
151
- var r, l = u.p(n), c = "set" + (this.$u ? "UTC" : ""), M = (r = {}, r[$] = c + "Date", r[m] = c + "Date", r[g] = c + "Month", r[k] = c + "FullYear", r[b] = c + "Hours", r[D] = c + "Minutes", r[d] = c + "Seconds", r[p] = c + "Milliseconds", r)[l], S = l === $ ? this.$D + (s - this.$W) : s;
152
- if (l === g || l === k) {
153
- var x = this.clone().set(m, 1);
154
- x.$d[M](S), x.init(), this.$d = x.set(m, Math.min(this.$D, x.daysInMonth())).$d;
155
- } else M && this.$d[M](S);
156
- return this.init(), this;
157
- }, a.set = function(n, s) {
158
- return this.clone().$set(n, s);
159
- }, a.get = function(n) {
160
- return this[u.p(n)]();
161
- }, a.add = function(n, s) {
162
- var r, l = this;
163
- n = Number(n);
164
- var c = u.p(s), M = function(E) {
165
- var j = w(l);
166
- return u.w(j.date(j.date() + Math.round(E * n)), l);
167
- };
168
- if (c === g) return this.set(g, this.$M + n);
169
- if (c === k) return this.set(k, this.$y + n);
170
- if (c === $) return M(1);
171
- if (c === Y) return M(7);
172
- var S = (r = {}, r[D] = e, r[b] = h, r[d] = t, r)[c] || 1, x = this.$d.getTime() + n * S;
173
- return u.w(x, this);
174
- }, a.subtract = function(n, s) {
175
- return this.add(-1 * n, s);
176
- }, a.format = function(n) {
177
- var s = this, r = this.$locale();
178
- if (!this.isValid()) return r.invalidDate || I;
179
- var l = n || "YYYY-MM-DDTHH:mm:ssZ", c = u.z(this), M = this.$H, S = this.$m, x = this.$M, E = r.weekdays, j = r.months, tt = r.meridiem, Z = function(A, J, rt, ut) {
180
- return A && (A[J] || A(s, l)) || rt[J].slice(0, ut);
181
- }, nt = function(A) {
182
- return u.s(M % 12 || 12, A, "0");
183
- }, V = tt || function(A, J, rt) {
184
- var ut = A < 12 ? "AM" : "PM";
185
- return rt ? ut.toLowerCase() : ut;
186
- };
187
- return l.replace(U, function(A, J) {
188
- return J || function(rt) {
189
- switch (rt) {
190
- case "YY":
191
- return String(s.$y).slice(-2);
192
- case "YYYY":
193
- return u.s(s.$y, 4, "0");
194
- case "M":
195
- return x + 1;
196
- case "MM":
197
- return u.s(x + 1, 2, "0");
198
- case "MMM":
199
- return Z(r.monthsShort, x, j, 3);
200
- case "MMMM":
201
- return Z(j, x);
202
- case "D":
203
- return s.$D;
204
- case "DD":
205
- return u.s(s.$D, 2, "0");
206
- case "d":
207
- return String(s.$W);
208
- case "dd":
209
- return Z(r.weekdaysMin, s.$W, E, 2);
210
- case "ddd":
211
- return Z(r.weekdaysShort, s.$W, E, 3);
212
- case "dddd":
213
- return E[s.$W];
214
- case "H":
215
- return String(M);
216
- case "HH":
217
- return u.s(M, 2, "0");
218
- case "h":
219
- return nt(1);
220
- case "hh":
221
- return nt(2);
222
- case "a":
223
- return V(M, S, !0);
224
- case "A":
225
- return V(M, S, !1);
226
- case "m":
227
- return String(S);
228
- case "mm":
229
- return u.s(S, 2, "0");
230
- case "s":
231
- return String(s.$s);
232
- case "ss":
233
- return u.s(s.$s, 2, "0");
234
- case "SSS":
235
- return u.s(s.$ms, 3, "0");
236
- case "Z":
237
- return c;
238
- }
239
- return null;
240
- }(A) || c.replace(":", "");
241
- });
242
- }, a.utcOffset = function() {
243
- return 15 * -Math.round(this.$d.getTimezoneOffset() / 15);
244
- }, a.diff = function(n, s, r) {
245
- var l, c = this, M = u.p(s), S = w(n), x = (S.utcOffset() - this.utcOffset()) * e, E = this - S, j = function() {
246
- return u.m(c, S);
247
- };
248
- switch (M) {
249
- case k:
250
- l = j() / 12;
251
- break;
252
- case g:
253
- l = j();
254
- break;
255
- case F:
256
- l = j() / 3;
257
- break;
258
- case Y:
259
- l = (E - x) / 6048e5;
260
- break;
261
- case $:
262
- l = (E - x) / 864e5;
263
- break;
264
- case b:
265
- l = E / h;
266
- break;
267
- case D:
268
- l = E / e;
269
- break;
270
- case d:
271
- l = E / t;
272
- break;
273
- default:
274
- l = E;
275
- }
276
- return r ? l : u.a(l);
277
- }, a.daysInMonth = function() {
278
- return this.endOf(g).$D;
279
- }, a.$locale = function() {
280
- return T[this.$L];
281
- }, a.locale = function(n, s) {
282
- if (!n) return this.$L;
283
- var r = this.clone(), l = W(n, s, !0);
284
- return l && (r.$L = l), r;
285
- }, a.clone = function() {
286
- return u.w(this.$d, this);
287
- }, a.toDate = function() {
288
- return new Date(this.valueOf());
289
- }, a.toJSON = function() {
290
- return this.isValid() ? this.toISOString() : null;
291
- }, a.toISOString = function() {
292
- return this.$d.toISOString();
293
- }, a.toString = function() {
294
- return this.$d.toUTCString();
295
- }, i;
296
- }(), wt = q.prototype;
297
- return w.prototype = wt, [["$ms", p], ["$s", d], ["$m", D], ["$H", b], ["$W", $], ["$M", g], ["$y", k], ["$D", m]].forEach(function(i) {
298
- wt[i[1]] = function(a) {
299
- return this.$g(a, i[0], i[1]);
300
- };
301
- }), w.extend = function(i, a) {
302
- return i.$i || (i(a, q, w), i.$i = !0), w;
303
- }, w.locale = W, w.isDayjs = X, w.unix = function(i) {
304
- return w(1e3 * i);
305
- }, w.en = T[v], w.Ls = T, w.p = {}, w;
306
- });
307
- }(vt)), vt.exports;
308
- }
309
- var qt = xt();
310
- const O = /* @__PURE__ */ jt(qt);
311
- var It = { exports: {} };
312
- (function(f, y) {
313
- (function(t, e) {
314
- f.exports = e(xt());
315
- })(Lt, function(t) {
316
- function e(d) {
317
- return d && typeof d == "object" && "default" in d ? d : { default: d };
318
- }
319
- var h = e(t), p = { name: "zh-cn", weekdays: "星期日_星期一_星期二_星期三_星期四_星期五_星期六".split("_"), weekdaysShort: "周日_周一_周二_周三_周四_周五_周六".split("_"), weekdaysMin: "日_一_二_三_四_五_六".split("_"), months: "一月_二月_三月_四月_五月_六月_七月_八月_九月_十月_十一月_十二月".split("_"), monthsShort: "1月_2月_3月_4月_5月_6月_7月_8月_9月_10月_11月_12月".split("_"), ordinal: function(d, D) {
320
- return D === "W" ? d + "周" : d + "日";
321
- }, weekStart: 1, yearStart: 4, formats: { LT: "HH:mm", LTS: "HH:mm:ss", L: "YYYY/MM/DD", LL: "YYYY年M月D日", LLL: "YYYY年M月D日Ah点mm分", LLLL: "YYYY年M月D日ddddAh点mm分", l: "YYYY/M/D", ll: "YYYY年M月D日", lll: "YYYY年M月D日 HH:mm", llll: "YYYY年M月D日dddd HH:mm" }, relativeTime: { future: "%s内", past: "%s前", s: "几秒", m: "1 分钟", mm: "%d 分钟", h: "1 小时", hh: "%d 小时", d: "1 天", dd: "%d 天", M: "1 个月", MM: "%d 个月", y: "1 年", yy: "%d 年" }, meridiem: function(d, D) {
322
- var b = 100 * d + D;
323
- return b < 600 ? "凌晨" : b < 900 ? "早上" : b < 1100 ? "上午" : b < 1300 ? "中午" : b < 1800 ? "下午" : "晚上";
324
- } };
325
- return h.default.locale(p, null, !0), p;
326
- });
327
- })(It);
328
- var at, ht, G, st, dt, ot, N, Q, R, L, ft, it, mt, yt, pt, et, kt, $t, lt, gt, Et, ct;
329
- class Bt extends Tt {
330
- constructor() {
331
- super();
332
- C(this, et);
333
- /** @type {HTMLElement} */
334
- C(this, at);
335
- /** @type {HTMLElement} */
336
- C(this, ht);
337
- /** @type {HTMLElement} */
338
- C(this, G);
339
- /** @type {HTMLElement} */
340
- C(this, st);
341
- /** @type {HTMLTableElement} */
342
- C(this, dt);
343
- /** @type {HTMLTableSectionElement} */
344
- C(this, ot);
345
- /** @type {HTMLTableSectionElement} */
346
- C(this, N);
347
- /** @type {AbortController} */
348
- C(this, Q, new AbortController());
349
- C(this, R, {
350
- /** @type {AbortController | null} */
351
- dateChangeAbortController: null
352
- });
353
- C(this, L, {
354
- isEaSelectImported: !1,
355
- isEaButtonImported: !1,
356
- displayDate: O()
357
- });
358
- St(this, "state", this.properties({
359
- "controller-type": {
360
- type: ["button", "select"],
361
- default: "button",
362
- observer: (t) => {
363
- o(this, it).call(this, t);
364
- }
365
- }
366
- }));
367
- /**
368
- * 今天按钮点击时的事件
369
- */
370
- C(this, ft, () => {
371
- _.locale = this.locale, O.locale(this.locale.toLowerCase());
372
- const t = O();
373
- o(this, L).displayDate = t, o(this, G).textContent = `${t.get("year")} ${_.t("calendar.months")[t.get("month")]}`, this.value = t;
374
- });
375
- /**
376
- * controller-type 的渲染器
377
- * @param {'button' | 'select'} [controllerType] 控制器类型
378
- * @return {string} 属性值
379
- */
380
- C(this, it, async (t = this["controller-type"]) => {
381
- var D;
382
- _.locale = this.locale, O.locale(this.locale.toLowerCase());
383
- const e = this.ns, h = o(this, L).displayDate.get("year"), p = {
384
- button: () => this.html(`
385
- <ea-button-group class='${e.e("controller-group")}' part='controller-group' size="small">
386
- <ea-button class='${e.e("controller")} ${e.e("controller-prev")}' part='controller prev'>
387
- ${_.t("calendar.prevMonth")}
388
- </ea-button>
389
- <ea-button class='${e.e("controller")} ${e.e("controller-today")}' part='controller current'>
390
- ${_.t("calendar.today")}
391
- </ea-button>
392
- <ea-button class='${e.e("controller")} ${e.e("controller-next")}' part='controller next'>
393
- ${_.t("calendar.nextMonth")}
394
- </ea-button>
395
- </ea-button-group>
396
- `),
397
- select: () => {
398
- const b = Array.from(
399
- { length: 20 },
400
- (Y, g) => `<ea-option value="${h - 10 + g}">${h - 10 + g}</ea-option>`
401
- ).join(""), $ = Array.from(
402
- { length: 12 },
403
- (Y, g) => `<ea-option value="${g + 1}">${g + 1}</ea-option>`
404
- ).join("");
405
- return this.html(`
406
- <section class='${e.e("controller-group")}' part='controller-group'>
407
- <ea-select class='${e.e("controller")} ${e.e("controller-year")}' part='controller year' placeholder='${_.t("calendar.selectYear")}' size="small">
408
- ${b}
409
- </ea-select>
410
- <ea-select class='${e.e("controller")} ${e.e("controller-month")}' part='controller month' placeholder='${_.t("calendar.selectMonth")}' size="small">
411
- ${$}
412
- </ea-select>
413
- <ea-button class='${e.e("controller")} ${e.e("controller-today")}' part='controller current' size="small">
414
- ${_.t("calendar.today")}
415
- </ea-button>
416
- </section>
417
- `);
418
- }
419
- };
420
- (D = o(this, R).dateChangeAbortController) == null || D.abort(), o(this, R).dateChangeAbortController = new AbortController(), o(this, st).innerHTML = p[t](), t === "select" ? o(this, yt).call(this) : o(this, mt).call(this);
421
- const d = this.shadowRoot.querySelector(e.ce("controller-today"));
422
- d && d.addEventListener("click", o(this, ft), {
423
- signal: o(this, R).dateChangeAbortController.signal
424
- });
425
- });
426
- /**
427
- * 初始化控制器为 button 的事件
428
- */
429
- C(this, mt, async () => {
430
- o(this, L).isEaButtonImported || (await customElements.whenDefined("ea-button"), o(this, L).isEaButtonImported = !0);
431
- const t = this.ns, e = this.shadowRoot.querySelector(t.ce("controller-prev")), h = this.shadowRoot.querySelector(t.ce("controller-next")), p = () => {
432
- this.value = o(this, L).displayDate.subtract(1, "month").set("date", 1);
433
- }, d = () => {
434
- this.value = o(this, L).displayDate.add(1, "month").set("date", 1);
435
- };
436
- e && e.addEventListener("click", p, {
437
- signal: o(this, R).dateChangeAbortController.signal
438
- }), h && h.addEventListener("click", d, {
439
- signal: o(this, R).dateChangeAbortController.signal
440
- });
441
- });
442
- /**
443
- * 初始化控制器为 select 的事件
444
- */
445
- C(this, yt, async () => {
446
- o(this, L).isEaSelectImported || (await customElements.whenDefined("ea-select"), o(this, L).isEaSelectImported = !0);
447
- const t = this.ns, e = o(this, L).displayDate.get("year"), h = o(this, L).displayDate.get("month") + 1, p = this.shadowRoot.querySelector(t.ce("controller-year")), d = this.shadowRoot.querySelector(t.ce("controller-month")), D = ($) => {
448
- $.stopImmediatePropagation();
449
- const Y = parseInt($.target.value), g = o(this, L).displayDate.get("month") + 1;
450
- this.value = O(`${Y}-${g}-01`);
451
- }, b = ($) => {
452
- $.stopImmediatePropagation();
453
- const Y = o(this, L).displayDate.get("year"), g = parseInt($.target.value).toString().padStart(2, "0");
454
- this.value = O(`${Y}-${g}-01`);
455
- };
456
- p && (p.value = e), d && (d.value = h), await Ct.sleep(0), p.addEventListener("change", D, {
457
- signal: o(this, R).dateChangeAbortController.signal
458
- }), d.addEventListener("change", b, {
459
- signal: o(this, R).dateChangeAbortController.signal
460
- });
461
- });
462
- /**
463
- * 处理周渲染
464
- * @param {Array} weekList
465
- * @return {String}
466
- */
467
- C(this, pt, (t) => t.map((e) => `<th class='${this.ns.e("th")}' part='th'>${e}</th>`).join(""));
468
- /**
469
- * 处理tbody点击事件
470
- * @param {MouseEvent} e
471
- */
472
- C(this, $t, (t) => {
473
- let e = t.target.closest(this.ns.ce("day"));
474
- if (!e || e === o(this, N)) return;
475
- const h = parseInt(e.dataset.year), p = parseInt(e.dataset.month), d = parseInt(e.dataset.date), D = O(`${h}-${p}-${d}`);
476
- this.value = D, this.emit("select", {
477
- detail: {
478
- year: h,
479
- month: p,
480
- date: d,
481
- day: D.day(),
482
- fullDate: `${h}-${p}-${d}`
483
- },
484
- bubbles: !0,
485
- composed: !0
486
- });
487
- });
488
- /**
489
- * 获取日期数组
490
- * @param {dayjs.Dayjs} [refDate] 参考日期,默认为当前日期
491
- * @return {DayOption}
492
- */
493
- C(this, lt, (t = O()) => {
494
- const e = t, p = e.subtract(1, "month").daysInMonth(), d = e.startOf("month").day(), D = e.endOf("month").day(), b = e.daysInMonth(), $ = e.startOf("week").get("day"), Y = Array.from(
495
- { length: d - $ },
496
- (k, m) => p - m
497
- ).reverse(), g = Array.from(
498
- { length: b },
499
- (k, m) => m + 1
500
- ), F = Array.from(
501
- { length: 6 - D + $ },
502
- (k, m) => m + 1
503
- );
504
- return { lastMonRemainingDays: Y, currentMonDays: g, nextMonRemainingDays: F };
505
- });
506
- /**
507
- * 查找指定日期的单元格
508
- * @param {Number} year
509
- * @param {Number} month
510
- * @param {Number} date
511
- */
512
- C(this, gt, (t, e, h) => o(this, N).querySelector(
513
- `td[data-year="${t}"][data-month="${e}"][data-date="${h}"]`
514
- ));
515
- /**
516
- * 处理天渲染
517
- * @returns {String}
518
- */
519
- C(this, ct, () => {
520
- const t = this.ns, e = o(this, L).displayDate, h = e.get("year"), p = e.get("month") + 1, { lastMonRemainingDays: d, currentMonDays: D, nextMonRemainingDays: b } = o(this, lt).call(this, e), $ = (m, I, B = { isSelected: !1, isToday: !1, isCurrent: !1 }) => {
521
- let U, P;
522
- if (m === "last-mon") {
523
- const H = e.subtract(1, "month");
524
- U = H.get("year"), P = H.get("month") + 1;
525
- } else if (m === "current-mon")
526
- U = h, P = p;
527
- else {
528
- const H = e.add(1, "month");
529
- U = H.get("year"), P = H.get("month") + 1;
530
- }
531
- return Ct.EaElement.h(
532
- "td",
533
- null,
534
- {
535
- class: [
536
- t.e("day"),
537
- t.s(m),
538
- B.isSelected ? t.s("selected") : "",
539
- B.isToday ? t.s("today") : "",
540
- B.isCurrent ? t.s("current") : ""
541
- ],
542
- part: ["day", m],
543
- "data-year": U,
544
- "data-month": P,
545
- "data-date": I
546
- },
547
- I
548
- );
549
- }, Y = d.map(
550
- (m) => $("last-mon", m)
551
- ), g = D.map(
552
- (m) => $("current-mon", m, {
553
- isToday: m === e.get("date"),
554
- isCurrent: m === e.get("date")
555
- })
556
- ), F = b.map(
557
- (m) => $("next-mon", m)
558
- );
559
- return Y.concat(g).concat(F).reduce((m, I, B) => (B % 7 === 0 && m.push([]), m[m.length - 1].push(I), m), []).map((m) => `<tr class="${t.e("row")}">${m.join("")}</tr>`).join("");
560
- });
561
- this.stylesheet = Rt, this.$render();
562
- }
563
- static get observedAttributes() {
564
- return [...super.observedAttributes, "value", "controller-type"];
565
- }
566
- // ------- value -------
567
- // #region
568
- get value() {
569
- return o(this, L).displayDate;
570
- }
571
- set value(t) {
572
- this.setAttribute("value", O(t));
573
- }
574
- // #endregion
575
- // ------- end -------
576
- attributeChangedCallback(t, e, h) {
577
- super.attributeChangedCallback(t, e, h), h !== e && t === "value" && (o(this, L).displayDate = O(h), Dt(this, et, kt).call(this, o(this, L).displayDate));
578
- }
579
- /**
580
- * 获取 classlist 列表
581
- * @return {string} 属性值
582
- */
583
- updateContainerClasslist() {
584
- const t = this.computedClasslist("ea-calendar", {
585
- // ['--' + this.type]: this.type,
586
- });
587
- return o(this, at).className = t, t;
588
- }
589
- $render() {
590
- const t = Ht("calendar"), e = /* @__PURE__ */ new Date(), h = e.getFullYear(), p = e.getMonth();
591
- _.locale = this.locale, O.locale(this.locale), this.ns = t, this.shadowRoot.innerHTML = this.html(`
592
- <div class='${t.b()}' part='container'>
593
- <header class='${t.e("header")}' part='header'>
594
- <slot name="header">
595
- <span class='${t.e("title")}' part='title'>
596
- ${h} ${_.t("calendar.months")[p]}
597
- </span>
598
- <section class='${t.e("controller-wrapper")}' part='controller-wrapper'>
599
- </section>
600
- </slot>
601
- </header>
602
- <table class='${t.e("body")}' part='body'>
603
- <thead class='${t.e("thead")}' part='thead'>
604
- <tr class='${t.e("week")}' part='thead-tr tr'>
605
- ${o(this, pt).call(this, _.t("calendar.weekDays"))}
606
- </tr>
607
- </thead>
608
- <tbody class='${t.e("tbody")}' part='tbody'>${o(this, ct).call(this)}</tbody>
609
- </table>
610
- </div>
611
- `), z(this, at, this.shadowRoot.querySelector(t.cb())), z(this, ht, this.shadowRoot.querySelector(t.ce("header"))), z(this, G, this.shadowRoot.querySelector(t.ce("title"))), z(this, st, this.shadowRoot.querySelector(
612
- t.ce("controller-wrapper")
613
- )), z(this, dt, this.shadowRoot.querySelector(t.ce("body"))), z(this, ot, this.shadowRoot.querySelector(t.ce("thead"))), z(this, N, this.shadowRoot.querySelector(t.ce("tbody")));
614
- }
615
- $updateLocalization(t) {
616
- _.locale = t, O.locale(this.locale.toLowerCase());
617
- const e = this.ns, h = this.shadowRoot.querySelector(e.ce("controller-prev")), p = this.shadowRoot.querySelector(e.ce("controller-today")), d = this.shadowRoot.querySelector(e.ce("controller-next")), D = this.shadowRoot.querySelector(e.ce("controller-year")), b = this.shadowRoot.querySelector(e.ce("controller-month")), $ = O(), Y = $.get("year"), g = $.get("month"), F = $.get("date"), { lastMonRemainingDays: k, currentMonDays: m, nextMonRemainingDays: I } = o(this, lt).call(this, $), B = k.concat(m).concat(I), U = _.t("calendar.weekDays"), P = o(this, ot).querySelectorAll(".ea-calendar__th"), H = [...o(this, N).querySelectorAll(".ea-calendar__day")];
618
- if (h && (h.textContent = _.t("calendar.prevMonth")), p && (p.textContent = _.t("calendar.today")), d && (d.textContent = _.t("calendar.nextMonth")), D && (D.placeholder = _.t("calendar.selectYear")), b && (b.placeholder = _.t("calendar.selectMonth")), o(this, G).textContent = `${Y} ${_.t("calendar.months")[g]}`, P.forEach((v, T) => {
619
- v.textContent = U[T];
620
- }), H.forEach((v, T) => {
621
- const K = B[T], X = Dt(this, et, Et).call(this, Y, g, K);
622
- let W, w, u;
623
- if (T < k.length) {
624
- const q = $.subtract(1, "month");
625
- W = q.get("year"), w = q.get("month") + 1, u = "last";
626
- } else if (T < k.length + m.length)
627
- W = Y, w = g + 1, u = "current";
628
- else {
629
- const q = $.add(1, "month");
630
- W = q.get("year"), w = q.get("month") + 1, u = "next";
631
- }
632
- v.dataset.year = W, v.dataset.month = w, v.dataset.date = K, v.textContent = K, v.classList.toggle("is-today", X), v.classList.toggle("is-current", X), v.classList.toggle("is-last-mon", u === "last"), v.classList.toggle("is-current-mon", u === "current"), v.classList.toggle("is-next-mon", u === "next"), v.part.toggle("last-mon", u === "last"), v.part.toggle("current-mon", u === "current"), v.part.toggle("next-mon", u === "next");
633
- }), !H.some((v) => v.classList.contains("is-current"))) {
634
- const v = o(this, gt).call(this, Y, g + 1, F);
635
- v && v.classList.add("is-current");
636
- }
637
- }
638
- connectedCallback() {
639
- var t;
640
- super.connectedCallback(), (t = o(this, Q)) == null || t.abort(), z(this, Q, new AbortController()), o(this, it).call(this), o(this, N).addEventListener("click", o(this, $t), {
641
- signal: o(this, Q).signal
642
- });
643
- }
644
- $beforeUnmounted() {
645
- var t, e;
646
- (t = o(this, Q)) == null || t.abort();
647
- for (const h in o(this, R))
648
- (e = o(this, R)[h]) == null || e.abort(), o(this, R)[h] = null;
649
- }
650
- }
651
- at = new WeakMap(), ht = new WeakMap(), G = new WeakMap(), st = new WeakMap(), dt = new WeakMap(), ot = new WeakMap(), N = new WeakMap(), Q = new WeakMap(), R = new WeakMap(), L = new WeakMap(), ft = new WeakMap(), it = new WeakMap(), mt = new WeakMap(), yt = new WeakMap(), pt = new WeakMap(), et = new WeakSet(), /**
652
- * 渲染日历天数
653
- * @param {dayjs.Dayjs} date
654
- */
655
- kt = function(t) {
656
- _.locale = this.locale, O.locale(this.locale.toLowerCase());
657
- const e = t.get("year"), h = t.get("month");
658
- o(this, G).textContent = `${e} ${_.t("calendar.months")[h]}`, o(this, N).innerHTML = o(this, ct).call(this);
659
- }, $t = new WeakMap(), lt = new WeakMap(), gt = new WeakMap(), /**
660
- * 判断是否是今天
661
- */
662
- Et = function(t, e, h) {
663
- const p = O();
664
- return t === p.get("year") && e === p.get("month") && h === p.get("date");
665
- }, ct = new WeakMap();
666
- window.customElements.get("ea-calendar") || window.customElements.define("ea-calendar", Bt);
667
- export {
668
- Bt as E,
669
- Lt as c,
670
- O as d,
671
- jt as g,
672
- Ht as n
673
- };