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