easy-component-ui 3.0.2 → 3.0.4

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.
@@ -1,17 +1,17 @@
1
- var Ot = Object.defineProperty;
2
- var _t = (f) => {
1
+ var Et = Object.defineProperty;
2
+ var wt = (f) => {
3
3
  throw TypeError(f);
4
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";
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
10
  import "./ea-button.js";
11
11
  import "./ea-select.js";
12
12
  import { i as _ } from "../utils/I18nManager.js";
13
- import { E as Ct } from "../utils/Utils.js";
14
- const Ht = (f) => {
13
+ import { E as St } from "../utils/Utils.js";
14
+ const Rt = (f) => {
15
15
  const y = `ea-${f}`;
16
16
  return {
17
17
  b: () => y,
@@ -24,309 +24,307 @@ const Ht = (f) => {
24
24
  cs: (...t) => t.map((e) => `.is-${e}`).join(" ")
25
25
  };
26
26
  };
27
- var Lt = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
28
- function jt(f) {
27
+ var Ct = typeof globalThis < "u" ? globalThis : typeof window < "u" ? window : typeof global < "u" ? global : typeof self < "u" ? self : {};
28
+ function Ht(f) {
29
29
  return f && f.__esModule && Object.prototype.hasOwnProperty.call(f, "default") ? f.default : f;
30
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
- }
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);
98
96
  }
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
97
  }
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]);
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);
300
166
  };
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: {} };
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: {} };
312
310
  (function(f, y) {
313
311
  (function(t, e) {
314
- f.exports = e(xt());
315
- })(Lt, function(t) {
312
+ f.exports = e(Lt);
313
+ })(Ct, function(t) {
316
314
  function e(d) {
317
315
  return d && typeof d == "object" && "default" in d ? d : { default: d };
318
316
  }
319
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) {
320
318
  return D === "W" ? d + "周" : d + "日";
321
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) {
322
- var b = 100 * d + D;
323
- return b < 600 ? "凌晨" : b < 900 ? "早上" : b < 1100 ? "上午" : b < 1300 ? "中午" : b < 1800 ? "下午" : "晚上";
320
+ var v = 100 * d + D;
321
+ return v < 600 ? "凌晨" : v < 900 ? "早上" : v < 1100 ? "上午" : v < 1300 ? "中午" : v < 1800 ? "下午" : "晚上";
324
322
  } };
325
323
  return h.default.locale(p, null, !0), p;
326
324
  });
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 {
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 {
330
328
  constructor() {
331
329
  super();
332
330
  C(this, et);
@@ -355,7 +353,7 @@ class Bt extends Tt {
355
353
  isEaButtonImported: !1,
356
354
  displayDate: O()
357
355
  });
358
- St(this, "state", this.properties({
356
+ _t(this, "state", this.properties({
359
357
  "controller-type": {
360
358
  type: ["button", "select"],
361
359
  default: "button",
@@ -395,7 +393,7 @@ class Bt extends Tt {
395
393
  </ea-button-group>
396
394
  `),
397
395
  select: () => {
398
- const b = Array.from(
396
+ const v = Array.from(
399
397
  { length: 20 },
400
398
  (Y, g) => `<ea-option value="${h - 10 + g}">${h - 10 + g}</ea-option>`
401
399
  ).join(""), $ = Array.from(
@@ -405,7 +403,7 @@ class Bt extends Tt {
405
403
  return this.html(`
406
404
  <section class='${e.e("controller-group")}' part='controller-group'>
407
405
  <ea-select class='${e.e("controller")} ${e.e("controller-year")}' part='controller year' placeholder='${_.t("calendar.selectYear")}' size="small">
408
- ${b}
406
+ ${v}
409
407
  </ea-select>
410
408
  <ea-select class='${e.e("controller")} ${e.e("controller-month")}' part='controller month' placeholder='${_.t("calendar.selectMonth")}' size="small">
411
409
  ${$}
@@ -448,14 +446,14 @@ class Bt extends Tt {
448
446
  $.stopImmediatePropagation();
449
447
  const Y = parseInt($.target.value), g = o(this, L).displayDate.get("month") + 1;
450
448
  this.value = O(`${Y}-${g}-01`);
451
- }, b = ($) => {
449
+ }, v = ($) => {
452
450
  $.stopImmediatePropagation();
453
451
  const Y = o(this, L).displayDate.get("year"), g = parseInt($.target.value).toString().padStart(2, "0");
454
452
  this.value = O(`${Y}-${g}-01`);
455
453
  };
456
- p && (p.value = e), d && (d.value = h), await Ct.sleep(0), p.addEventListener("change", D, {
454
+ p && (p.value = e), d && (d.value = h), await St.sleep(0), p.addEventListener("change", D, {
457
455
  signal: o(this, R).dateChangeAbortController.signal
458
- }), d.addEventListener("change", b, {
456
+ }), d.addEventListener("change", v, {
459
457
  signal: o(this, R).dateChangeAbortController.signal
460
458
  });
461
459
  });
@@ -491,15 +489,15 @@ class Bt extends Tt {
491
489
  * @return {DayOption}
492
490
  */
493
491
  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(
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(
495
493
  { length: d - $ },
496
- (k, m) => p - m
494
+ (x, m) => p - m
497
495
  ).reverse(), g = Array.from(
498
- { length: b },
499
- (k, m) => m + 1
496
+ { length: v },
497
+ (x, m) => m + 1
500
498
  ), F = Array.from(
501
499
  { length: 6 - D + $ },
502
- (k, m) => m + 1
500
+ (x, m) => m + 1
503
501
  );
504
502
  return { lastMonRemainingDays: Y, currentMonDays: g, nextMonRemainingDays: F };
505
503
  });
@@ -517,7 +515,7 @@ class Bt extends Tt {
517
515
  * @returns {String}
518
516
  */
519
517
  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 }) => {
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 }) => {
521
519
  let U, P;
522
520
  if (m === "last-mon") {
523
521
  const H = e.subtract(1, "month");
@@ -528,7 +526,7 @@ class Bt extends Tt {
528
526
  const H = e.add(1, "month");
529
527
  U = H.get("year"), P = H.get("month") + 1;
530
528
  }
531
- return Ct.EaElement.h(
529
+ return St.EaElement.h(
532
530
  "td",
533
531
  null,
534
532
  {
@@ -553,12 +551,12 @@ class Bt extends Tt {
553
551
  isToday: m === e.get("date"),
554
552
  isCurrent: m === e.get("date")
555
553
  })
556
- ), F = b.map(
554
+ ), F = v.map(
557
555
  (m) => $("next-mon", m)
558
556
  );
559
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("");
560
558
  });
561
- this.stylesheet = Rt, this.$render();
559
+ this.stylesheet = Tt, this.$render();
562
560
  }
563
561
  static get observedAttributes() {
564
562
  return [...super.observedAttributes, "value", "controller-type"];
@@ -587,7 +585,7 @@ class Bt extends Tt {
587
585
  return o(this, at).className = t, t;
588
586
  }
589
587
  $render() {
590
- const t = Ht("calendar"), e = /* @__PURE__ */ new Date(), h = e.getFullYear(), p = e.getMonth();
588
+ const t = Rt("calendar"), e = /* @__PURE__ */ new Date(), h = e.getFullYear(), p = e.getMonth();
591
589
  _.locale = this.locale, O.locale(this.locale), this.ns = t, this.shadowRoot.innerHTML = this.html(`
592
590
  <div class='${t.b()}' part='container'>
593
591
  <header class='${t.e("header")}' part='header'>
@@ -614,25 +612,25 @@ class Bt extends Tt {
614
612
  }
615
613
  $updateLocalization(t) {
616
614
  _.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);
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);
622
620
  let W, w, u;
623
- if (T < k.length) {
621
+ if (T < x.length) {
624
622
  const q = $.subtract(1, "month");
625
623
  W = q.get("year"), w = q.get("month") + 1, u = "last";
626
- } else if (T < k.length + m.length)
624
+ } else if (T < x.length + m.length)
627
625
  W = Y, w = g + 1, u = "current";
628
626
  else {
629
627
  const q = $.add(1, "month");
630
628
  W = q.get("year"), w = q.get("month") + 1, u = "next";
631
629
  }
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");
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");
636
634
  }
637
635
  }
638
636
  connectedCallback() {
@@ -659,15 +657,15 @@ kt = function(t) {
659
657
  }, $t = new WeakMap(), lt = new WeakMap(), gt = new WeakMap(), /**
660
658
  * 判断是否是今天
661
659
  */
662
- Et = function(t, e, h) {
660
+ xt = function(t, e, h) {
663
661
  const p = O();
664
662
  return t === p.get("year") && e === p.get("month") && h === p.get("date");
665
663
  }, ct = new WeakMap();
666
- window.customElements.get("ea-calendar") || window.customElements.define("ea-calendar", Bt);
664
+ window.customElements.get("ea-calendar") || window.customElements.define("ea-calendar", qt);
667
665
  export {
668
- Bt as E,
669
- Lt as c,
666
+ qt as E,
667
+ Ct as c,
670
668
  O as d,
671
- jt as g,
672
- Ht as n
669
+ Ht as g,
670
+ Rt as n
673
671
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easy-component-ui",
3
- "version": "3.0.2",
3
+ "version": "3.0.4",
4
4
  "description": "使用 WebComponent 编写的原生组件库",
5
5
  "main": "dist/components/index.js",
6
6
  "module": "dist/components/index.js",
@@ -25,7 +25,8 @@
25
25
  "commit": "git add . && git-cz",
26
26
  "patch": "npm version patch && git push --follow-tags",
27
27
  "minor": "npm version minor && git push --follow-tags",
28
- "major": "npm version major && git push --follow-tags"
28
+ "major": "npm version major && git push --follow-tags",
29
+ "publish:github": "npm run build && npm publish --registry=https://npm.pkg.github.com"
29
30
  },
30
31
  "repository": {
31
32
  "type": "git",
@@ -111,9 +112,6 @@
111
112
  },
112
113
  "exports": {
113
114
  ".": "./dist/components/index.js",
114
- "./icon-assets": {
115
- "import": "./dist/assets/icon.css"
116
- },
117
115
  "./ea-alert": {
118
116
  "import": "./dist/components/ea-alert.js"
119
117
  },