@starasia/date 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/date.es.js +602 -1255
- package/dist/date.umd.js +8 -51
- package/package.json +1 -1
package/dist/date.es.js
CHANGED
|
@@ -1,647 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @license React
|
|
5
|
-
* react-jsx-runtime.production.min.js
|
|
6
|
-
*
|
|
7
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
8
|
-
*
|
|
9
|
-
* This source code is licensed under the MIT license found in the
|
|
10
|
-
* LICENSE file in the root directory of this source tree.
|
|
11
|
-
*/
|
|
12
|
-
var Ue;
|
|
13
|
-
function Sr() {
|
|
14
|
-
if (Ue)
|
|
15
|
-
return X;
|
|
16
|
-
Ue = 1;
|
|
17
|
-
var t = Ke, n = Symbol.for("react.element"), l = Symbol.for("react.fragment"), i = Object.prototype.hasOwnProperty, u = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner, m = { key: !0, ref: !0, __self: !0, __source: !0 };
|
|
18
|
-
function b(j, f, a) {
|
|
19
|
-
var E, w = {}, _ = null, S = null;
|
|
20
|
-
a !== void 0 && (_ = "" + a), f.key !== void 0 && (_ = "" + f.key), f.ref !== void 0 && (S = f.ref);
|
|
21
|
-
for (E in f)
|
|
22
|
-
i.call(f, E) && !m.hasOwnProperty(E) && (w[E] = f[E]);
|
|
23
|
-
if (j && j.defaultProps)
|
|
24
|
-
for (E in f = j.defaultProps, f)
|
|
25
|
-
w[E] === void 0 && (w[E] = f[E]);
|
|
26
|
-
return { $$typeof: n, type: j, key: _, ref: S, props: w, _owner: u.current };
|
|
27
|
-
}
|
|
28
|
-
return X.Fragment = l, X.jsx = b, X.jsxs = b, X;
|
|
29
|
-
}
|
|
30
|
-
var Z = {};
|
|
31
|
-
/**
|
|
32
|
-
* @license React
|
|
33
|
-
* react-jsx-runtime.development.js
|
|
34
|
-
*
|
|
35
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
36
|
-
*
|
|
37
|
-
* This source code is licensed under the MIT license found in the
|
|
38
|
-
* LICENSE file in the root directory of this source tree.
|
|
39
|
-
*/
|
|
40
|
-
var ze;
|
|
41
|
-
function Mr() {
|
|
42
|
-
return ze || (ze = 1, process.env.NODE_ENV !== "production" && function() {
|
|
43
|
-
var t = Ke, n = Symbol.for("react.element"), l = Symbol.for("react.portal"), i = Symbol.for("react.fragment"), u = Symbol.for("react.strict_mode"), m = Symbol.for("react.profiler"), b = Symbol.for("react.provider"), j = Symbol.for("react.context"), f = Symbol.for("react.forward_ref"), a = Symbol.for("react.suspense"), E = Symbol.for("react.suspense_list"), w = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), S = Symbol.for("react.offscreen"), v = Symbol.iterator, c = "@@iterator";
|
|
44
|
-
function g(e) {
|
|
45
|
-
if (e === null || typeof e != "object")
|
|
46
|
-
return null;
|
|
47
|
-
var r = v && e[v] || e[c];
|
|
48
|
-
return typeof r == "function" ? r : null;
|
|
49
|
-
}
|
|
50
|
-
var d = t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
51
|
-
function p(e) {
|
|
52
|
-
{
|
|
53
|
-
for (var r = arguments.length, s = new Array(r > 1 ? r - 1 : 0), y = 1; y < r; y++)
|
|
54
|
-
s[y - 1] = arguments[y];
|
|
55
|
-
h("error", e, s);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
function h(e, r, s) {
|
|
59
|
-
{
|
|
60
|
-
var y = d.ReactDebugCurrentFrame, T = y.getStackAddendum();
|
|
61
|
-
T !== "" && (r += "%s", s = s.concat([T]));
|
|
62
|
-
var D = s.map(function(R) {
|
|
63
|
-
return String(R);
|
|
64
|
-
});
|
|
65
|
-
D.unshift("Warning: " + r), Function.prototype.apply.call(console[e], console, D);
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
var x = !1, Y = !1, $ = !1, C = !1, P = !1, we;
|
|
69
|
-
we = Symbol.for("react.module.reference");
|
|
70
|
-
function rr(e) {
|
|
71
|
-
return !!(typeof e == "string" || typeof e == "function" || e === i || e === m || P || e === u || e === a || e === E || C || e === S || x || Y || $ || typeof e == "object" && e !== null && (e.$$typeof === _ || e.$$typeof === w || e.$$typeof === b || e.$$typeof === j || e.$$typeof === f || // This needs to include all possible module reference object
|
|
72
|
-
// types supported by any Flight configuration anywhere since
|
|
73
|
-
// we don't know which Flight build this will end up being used
|
|
74
|
-
// with.
|
|
75
|
-
e.$$typeof === we || e.getModuleId !== void 0));
|
|
76
|
-
}
|
|
77
|
-
function ar(e, r, s) {
|
|
78
|
-
var y = e.displayName;
|
|
79
|
-
if (y)
|
|
80
|
-
return y;
|
|
81
|
-
var T = r.displayName || r.name || "";
|
|
82
|
-
return T !== "" ? s + "(" + T + ")" : s;
|
|
83
|
-
}
|
|
84
|
-
function xe(e) {
|
|
85
|
-
return e.displayName || "Context";
|
|
86
|
-
}
|
|
87
|
-
function A(e) {
|
|
88
|
-
if (e == null)
|
|
89
|
-
return null;
|
|
90
|
-
if (typeof e.tag == "number" && p("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."), typeof e == "function")
|
|
91
|
-
return e.displayName || e.name || null;
|
|
92
|
-
if (typeof e == "string")
|
|
93
|
-
return e;
|
|
94
|
-
switch (e) {
|
|
95
|
-
case i:
|
|
96
|
-
return "Fragment";
|
|
97
|
-
case l:
|
|
98
|
-
return "Portal";
|
|
99
|
-
case m:
|
|
100
|
-
return "Profiler";
|
|
101
|
-
case u:
|
|
102
|
-
return "StrictMode";
|
|
103
|
-
case a:
|
|
104
|
-
return "Suspense";
|
|
105
|
-
case E:
|
|
106
|
-
return "SuspenseList";
|
|
107
|
-
}
|
|
108
|
-
if (typeof e == "object")
|
|
109
|
-
switch (e.$$typeof) {
|
|
110
|
-
case j:
|
|
111
|
-
var r = e;
|
|
112
|
-
return xe(r) + ".Consumer";
|
|
113
|
-
case b:
|
|
114
|
-
var s = e;
|
|
115
|
-
return xe(s._context) + ".Provider";
|
|
116
|
-
case f:
|
|
117
|
-
return ar(e, e.render, "ForwardRef");
|
|
118
|
-
case w:
|
|
119
|
-
var y = e.displayName || null;
|
|
120
|
-
return y !== null ? y : A(e.type) || "Memo";
|
|
121
|
-
case _: {
|
|
122
|
-
var T = e, D = T._payload, R = T._init;
|
|
123
|
-
try {
|
|
124
|
-
return A(R(D));
|
|
125
|
-
} catch {
|
|
126
|
-
return null;
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
return null;
|
|
131
|
-
}
|
|
132
|
-
var W = Object.assign, H = 0, Ee, je, Ce, ke, Re, _e, Te;
|
|
133
|
-
function De() {
|
|
134
|
-
}
|
|
135
|
-
De.__reactDisabledLog = !0;
|
|
136
|
-
function nr() {
|
|
137
|
-
{
|
|
138
|
-
if (H === 0) {
|
|
139
|
-
Ee = console.log, je = console.info, Ce = console.warn, ke = console.error, Re = console.group, _e = console.groupCollapsed, Te = console.groupEnd;
|
|
140
|
-
var e = {
|
|
141
|
-
configurable: !0,
|
|
142
|
-
enumerable: !0,
|
|
143
|
-
value: De,
|
|
144
|
-
writable: !0
|
|
145
|
-
};
|
|
146
|
-
Object.defineProperties(console, {
|
|
147
|
-
info: e,
|
|
148
|
-
log: e,
|
|
149
|
-
warn: e,
|
|
150
|
-
error: e,
|
|
151
|
-
group: e,
|
|
152
|
-
groupCollapsed: e,
|
|
153
|
-
groupEnd: e
|
|
154
|
-
});
|
|
155
|
-
}
|
|
156
|
-
H++;
|
|
157
|
-
}
|
|
158
|
-
}
|
|
159
|
-
function tr() {
|
|
160
|
-
{
|
|
161
|
-
if (H--, H === 0) {
|
|
162
|
-
var e = {
|
|
163
|
-
configurable: !0,
|
|
164
|
-
enumerable: !0,
|
|
165
|
-
writable: !0
|
|
166
|
-
};
|
|
167
|
-
Object.defineProperties(console, {
|
|
168
|
-
log: W({}, e, {
|
|
169
|
-
value: Ee
|
|
170
|
-
}),
|
|
171
|
-
info: W({}, e, {
|
|
172
|
-
value: je
|
|
173
|
-
}),
|
|
174
|
-
warn: W({}, e, {
|
|
175
|
-
value: Ce
|
|
176
|
-
}),
|
|
177
|
-
error: W({}, e, {
|
|
178
|
-
value: ke
|
|
179
|
-
}),
|
|
180
|
-
group: W({}, e, {
|
|
181
|
-
value: Re
|
|
182
|
-
}),
|
|
183
|
-
groupCollapsed: W({}, e, {
|
|
184
|
-
value: _e
|
|
185
|
-
}),
|
|
186
|
-
groupEnd: W({}, e, {
|
|
187
|
-
value: Te
|
|
188
|
-
})
|
|
189
|
-
});
|
|
190
|
-
}
|
|
191
|
-
H < 0 && p("disabledDepth fell below zero. This is a bug in React. Please file an issue.");
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
var oe = d.ReactCurrentDispatcher, le;
|
|
195
|
-
function ee(e, r, s) {
|
|
196
|
-
{
|
|
197
|
-
if (le === void 0)
|
|
198
|
-
try {
|
|
199
|
-
throw Error();
|
|
200
|
-
} catch (T) {
|
|
201
|
-
var y = T.stack.trim().match(/\n( *(at )?)/);
|
|
202
|
-
le = y && y[1] || "";
|
|
203
|
-
}
|
|
204
|
-
return `
|
|
205
|
-
` + le + e;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
var ce = !1, re;
|
|
209
|
-
{
|
|
210
|
-
var sr = typeof WeakMap == "function" ? WeakMap : Map;
|
|
211
|
-
re = new sr();
|
|
212
|
-
}
|
|
213
|
-
function Se(e, r) {
|
|
214
|
-
if (!e || ce)
|
|
215
|
-
return "";
|
|
216
|
-
{
|
|
217
|
-
var s = re.get(e);
|
|
218
|
-
if (s !== void 0)
|
|
219
|
-
return s;
|
|
220
|
-
}
|
|
221
|
-
var y;
|
|
222
|
-
ce = !0;
|
|
223
|
-
var T = Error.prepareStackTrace;
|
|
224
|
-
Error.prepareStackTrace = void 0;
|
|
225
|
-
var D;
|
|
226
|
-
D = oe.current, oe.current = null, nr();
|
|
227
|
-
try {
|
|
228
|
-
if (r) {
|
|
229
|
-
var R = function() {
|
|
230
|
-
throw Error();
|
|
231
|
-
};
|
|
232
|
-
if (Object.defineProperty(R.prototype, "props", {
|
|
233
|
-
set: function() {
|
|
234
|
-
throw Error();
|
|
235
|
-
}
|
|
236
|
-
}), typeof Reflect == "object" && Reflect.construct) {
|
|
237
|
-
try {
|
|
238
|
-
Reflect.construct(R, []);
|
|
239
|
-
} catch (N) {
|
|
240
|
-
y = N;
|
|
241
|
-
}
|
|
242
|
-
Reflect.construct(e, [], R);
|
|
243
|
-
} else {
|
|
244
|
-
try {
|
|
245
|
-
R.call();
|
|
246
|
-
} catch (N) {
|
|
247
|
-
y = N;
|
|
248
|
-
}
|
|
249
|
-
e.call(R.prototype);
|
|
250
|
-
}
|
|
251
|
-
} else {
|
|
252
|
-
try {
|
|
253
|
-
throw Error();
|
|
254
|
-
} catch (N) {
|
|
255
|
-
y = N;
|
|
256
|
-
}
|
|
257
|
-
e();
|
|
258
|
-
}
|
|
259
|
-
} catch (N) {
|
|
260
|
-
if (N && y && typeof N.stack == "string") {
|
|
261
|
-
for (var k = N.stack.split(`
|
|
262
|
-
`), O = y.stack.split(`
|
|
263
|
-
`), M = k.length - 1, F = O.length - 1; M >= 1 && F >= 0 && k[M] !== O[F]; )
|
|
264
|
-
F--;
|
|
265
|
-
for (; M >= 1 && F >= 0; M--, F--)
|
|
266
|
-
if (k[M] !== O[F]) {
|
|
267
|
-
if (M !== 1 || F !== 1)
|
|
268
|
-
do
|
|
269
|
-
if (M--, F--, F < 0 || k[M] !== O[F]) {
|
|
270
|
-
var L = `
|
|
271
|
-
` + k[M].replace(" at new ", " at ");
|
|
272
|
-
return e.displayName && L.includes("<anonymous>") && (L = L.replace("<anonymous>", e.displayName)), typeof e == "function" && re.set(e, L), L;
|
|
273
|
-
}
|
|
274
|
-
while (M >= 1 && F >= 0);
|
|
275
|
-
break;
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
} finally {
|
|
279
|
-
ce = !1, oe.current = D, tr(), Error.prepareStackTrace = T;
|
|
280
|
-
}
|
|
281
|
-
var J = e ? e.displayName || e.name : "", V = J ? ee(J) : "";
|
|
282
|
-
return typeof e == "function" && re.set(e, V), V;
|
|
283
|
-
}
|
|
284
|
-
function ir(e, r, s) {
|
|
285
|
-
return Se(e, !1);
|
|
286
|
-
}
|
|
287
|
-
function or(e) {
|
|
288
|
-
var r = e.prototype;
|
|
289
|
-
return !!(r && r.isReactComponent);
|
|
290
|
-
}
|
|
291
|
-
function ae(e, r, s) {
|
|
292
|
-
if (e == null)
|
|
293
|
-
return "";
|
|
294
|
-
if (typeof e == "function")
|
|
295
|
-
return Se(e, or(e));
|
|
296
|
-
if (typeof e == "string")
|
|
297
|
-
return ee(e);
|
|
298
|
-
switch (e) {
|
|
299
|
-
case a:
|
|
300
|
-
return ee("Suspense");
|
|
301
|
-
case E:
|
|
302
|
-
return ee("SuspenseList");
|
|
303
|
-
}
|
|
304
|
-
if (typeof e == "object")
|
|
305
|
-
switch (e.$$typeof) {
|
|
306
|
-
case f:
|
|
307
|
-
return ir(e.render);
|
|
308
|
-
case w:
|
|
309
|
-
return ae(e.type, r, s);
|
|
310
|
-
case _: {
|
|
311
|
-
var y = e, T = y._payload, D = y._init;
|
|
312
|
-
try {
|
|
313
|
-
return ae(D(T), r, s);
|
|
314
|
-
} catch {
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
return "";
|
|
319
|
-
}
|
|
320
|
-
var G = Object.prototype.hasOwnProperty, Me = {}, Fe = d.ReactDebugCurrentFrame;
|
|
321
|
-
function ne(e) {
|
|
322
|
-
if (e) {
|
|
323
|
-
var r = e._owner, s = ae(e.type, e._source, r ? r.type : null);
|
|
324
|
-
Fe.setExtraStackFrame(s);
|
|
325
|
-
} else
|
|
326
|
-
Fe.setExtraStackFrame(null);
|
|
327
|
-
}
|
|
328
|
-
function lr(e, r, s, y, T) {
|
|
329
|
-
{
|
|
330
|
-
var D = Function.call.bind(G);
|
|
331
|
-
for (var R in e)
|
|
332
|
-
if (D(e, R)) {
|
|
333
|
-
var k = void 0;
|
|
334
|
-
try {
|
|
335
|
-
if (typeof e[R] != "function") {
|
|
336
|
-
var O = Error((y || "React class") + ": " + s + " type `" + R + "` is invalid; it must be a function, usually from the `prop-types` package, but received `" + typeof e[R] + "`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");
|
|
337
|
-
throw O.name = "Invariant Violation", O;
|
|
338
|
-
}
|
|
339
|
-
k = e[R](r, R, y, s, null, "SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED");
|
|
340
|
-
} catch (M) {
|
|
341
|
-
k = M;
|
|
342
|
-
}
|
|
343
|
-
k && !(k instanceof Error) && (ne(T), p("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).", y || "React class", s, R, typeof k), ne(null)), k instanceof Error && !(k.message in Me) && (Me[k.message] = !0, ne(T), p("Failed %s type: %s", s, k.message), ne(null));
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
var cr = Array.isArray;
|
|
348
|
-
function ue(e) {
|
|
349
|
-
return cr(e);
|
|
350
|
-
}
|
|
351
|
-
function ur(e) {
|
|
352
|
-
{
|
|
353
|
-
var r = typeof Symbol == "function" && Symbol.toStringTag, s = r && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
354
|
-
return s;
|
|
355
|
-
}
|
|
356
|
-
}
|
|
357
|
-
function dr(e) {
|
|
358
|
-
try {
|
|
359
|
-
return $e(e), !1;
|
|
360
|
-
} catch {
|
|
361
|
-
return !0;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
function $e(e) {
|
|
365
|
-
return "" + e;
|
|
366
|
-
}
|
|
367
|
-
function Ye(e) {
|
|
368
|
-
if (dr(e))
|
|
369
|
-
return p("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.", ur(e)), $e(e);
|
|
370
|
-
}
|
|
371
|
-
var K = d.ReactCurrentOwner, fr = {
|
|
372
|
-
key: !0,
|
|
373
|
-
ref: !0,
|
|
374
|
-
__self: !0,
|
|
375
|
-
__source: !0
|
|
376
|
-
}, Oe, Pe, de;
|
|
377
|
-
de = {};
|
|
378
|
-
function hr(e) {
|
|
379
|
-
if (G.call(e, "ref")) {
|
|
380
|
-
var r = Object.getOwnPropertyDescriptor(e, "ref").get;
|
|
381
|
-
if (r && r.isReactWarning)
|
|
382
|
-
return !1;
|
|
383
|
-
}
|
|
384
|
-
return e.ref !== void 0;
|
|
385
|
-
}
|
|
386
|
-
function gr(e) {
|
|
387
|
-
if (G.call(e, "key")) {
|
|
388
|
-
var r = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
389
|
-
if (r && r.isReactWarning)
|
|
390
|
-
return !1;
|
|
391
|
-
}
|
|
392
|
-
return e.key !== void 0;
|
|
393
|
-
}
|
|
394
|
-
function pr(e, r) {
|
|
395
|
-
if (typeof e.ref == "string" && K.current && r && K.current.stateNode !== r) {
|
|
396
|
-
var s = A(K.current.type);
|
|
397
|
-
de[s] || (p('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref', A(K.current.type), e.ref), de[s] = !0);
|
|
398
|
-
}
|
|
399
|
-
}
|
|
400
|
-
function vr(e, r) {
|
|
401
|
-
{
|
|
402
|
-
var s = function() {
|
|
403
|
-
Oe || (Oe = !0, p("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
404
|
-
};
|
|
405
|
-
s.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
406
|
-
get: s,
|
|
407
|
-
configurable: !0
|
|
408
|
-
});
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
function yr(e, r) {
|
|
412
|
-
{
|
|
413
|
-
var s = function() {
|
|
414
|
-
Pe || (Pe = !0, p("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)", r));
|
|
415
|
-
};
|
|
416
|
-
s.isReactWarning = !0, Object.defineProperty(e, "ref", {
|
|
417
|
-
get: s,
|
|
418
|
-
configurable: !0
|
|
419
|
-
});
|
|
420
|
-
}
|
|
421
|
-
}
|
|
422
|
-
var mr = function(e, r, s, y, T, D, R) {
|
|
423
|
-
var k = {
|
|
424
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
425
|
-
$$typeof: n,
|
|
426
|
-
// Built-in properties that belong on the element
|
|
427
|
-
type: e,
|
|
428
|
-
key: r,
|
|
429
|
-
ref: s,
|
|
430
|
-
props: R,
|
|
431
|
-
// Record the component responsible for creating this element.
|
|
432
|
-
_owner: D
|
|
433
|
-
};
|
|
434
|
-
return k._store = {}, Object.defineProperty(k._store, "validated", {
|
|
435
|
-
configurable: !1,
|
|
436
|
-
enumerable: !1,
|
|
437
|
-
writable: !0,
|
|
438
|
-
value: !1
|
|
439
|
-
}), Object.defineProperty(k, "_self", {
|
|
440
|
-
configurable: !1,
|
|
441
|
-
enumerable: !1,
|
|
442
|
-
writable: !1,
|
|
443
|
-
value: y
|
|
444
|
-
}), Object.defineProperty(k, "_source", {
|
|
445
|
-
configurable: !1,
|
|
446
|
-
enumerable: !1,
|
|
447
|
-
writable: !1,
|
|
448
|
-
value: T
|
|
449
|
-
}), Object.freeze && (Object.freeze(k.props), Object.freeze(k)), k;
|
|
450
|
-
};
|
|
451
|
-
function br(e, r, s, y, T) {
|
|
452
|
-
{
|
|
453
|
-
var D, R = {}, k = null, O = null;
|
|
454
|
-
s !== void 0 && (Ye(s), k = "" + s), gr(r) && (Ye(r.key), k = "" + r.key), hr(r) && (O = r.ref, pr(r, T));
|
|
455
|
-
for (D in r)
|
|
456
|
-
G.call(r, D) && !fr.hasOwnProperty(D) && (R[D] = r[D]);
|
|
457
|
-
if (e && e.defaultProps) {
|
|
458
|
-
var M = e.defaultProps;
|
|
459
|
-
for (D in M)
|
|
460
|
-
R[D] === void 0 && (R[D] = M[D]);
|
|
461
|
-
}
|
|
462
|
-
if (k || O) {
|
|
463
|
-
var F = typeof e == "function" ? e.displayName || e.name || "Unknown" : e;
|
|
464
|
-
k && vr(R, F), O && yr(R, F);
|
|
465
|
-
}
|
|
466
|
-
return mr(e, k, O, T, y, K.current, R);
|
|
467
|
-
}
|
|
468
|
-
}
|
|
469
|
-
var fe = d.ReactCurrentOwner, Ne = d.ReactDebugCurrentFrame;
|
|
470
|
-
function z(e) {
|
|
471
|
-
if (e) {
|
|
472
|
-
var r = e._owner, s = ae(e.type, e._source, r ? r.type : null);
|
|
473
|
-
Ne.setExtraStackFrame(s);
|
|
474
|
-
} else
|
|
475
|
-
Ne.setExtraStackFrame(null);
|
|
476
|
-
}
|
|
477
|
-
var he;
|
|
478
|
-
he = !1;
|
|
479
|
-
function ge(e) {
|
|
480
|
-
return typeof e == "object" && e !== null && e.$$typeof === n;
|
|
481
|
-
}
|
|
482
|
-
function Ie() {
|
|
483
|
-
{
|
|
484
|
-
if (fe.current) {
|
|
485
|
-
var e = A(fe.current.type);
|
|
486
|
-
if (e)
|
|
487
|
-
return `
|
|
488
|
-
|
|
489
|
-
Check the render method of \`` + e + "`.";
|
|
490
|
-
}
|
|
491
|
-
return "";
|
|
492
|
-
}
|
|
493
|
-
}
|
|
494
|
-
function wr(e) {
|
|
495
|
-
{
|
|
496
|
-
if (e !== void 0) {
|
|
497
|
-
var r = e.fileName.replace(/^.*[\\\/]/, ""), s = e.lineNumber;
|
|
498
|
-
return `
|
|
499
|
-
|
|
500
|
-
Check your code at ` + r + ":" + s + ".";
|
|
501
|
-
}
|
|
502
|
-
return "";
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
var Le = {};
|
|
506
|
-
function xr(e) {
|
|
507
|
-
{
|
|
508
|
-
var r = Ie();
|
|
509
|
-
if (!r) {
|
|
510
|
-
var s = typeof e == "string" ? e : e.displayName || e.name;
|
|
511
|
-
s && (r = `
|
|
512
|
-
|
|
513
|
-
Check the top-level render call using <` + s + ">.");
|
|
514
|
-
}
|
|
515
|
-
return r;
|
|
516
|
-
}
|
|
517
|
-
}
|
|
518
|
-
function Ae(e, r) {
|
|
519
|
-
{
|
|
520
|
-
if (!e._store || e._store.validated || e.key != null)
|
|
521
|
-
return;
|
|
522
|
-
e._store.validated = !0;
|
|
523
|
-
var s = xr(r);
|
|
524
|
-
if (Le[s])
|
|
525
|
-
return;
|
|
526
|
-
Le[s] = !0;
|
|
527
|
-
var y = "";
|
|
528
|
-
e && e._owner && e._owner !== fe.current && (y = " It was passed a child from " + A(e._owner.type) + "."), z(e), p('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.', s, y), z(null);
|
|
529
|
-
}
|
|
530
|
-
}
|
|
531
|
-
function We(e, r) {
|
|
532
|
-
{
|
|
533
|
-
if (typeof e != "object")
|
|
534
|
-
return;
|
|
535
|
-
if (ue(e))
|
|
536
|
-
for (var s = 0; s < e.length; s++) {
|
|
537
|
-
var y = e[s];
|
|
538
|
-
ge(y) && Ae(y, r);
|
|
539
|
-
}
|
|
540
|
-
else if (ge(e))
|
|
541
|
-
e._store && (e._store.validated = !0);
|
|
542
|
-
else if (e) {
|
|
543
|
-
var T = g(e);
|
|
544
|
-
if (typeof T == "function" && T !== e.entries)
|
|
545
|
-
for (var D = T.call(e), R; !(R = D.next()).done; )
|
|
546
|
-
ge(R.value) && Ae(R.value, r);
|
|
547
|
-
}
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
function Er(e) {
|
|
551
|
-
{
|
|
552
|
-
var r = e.type;
|
|
553
|
-
if (r == null || typeof r == "string")
|
|
554
|
-
return;
|
|
555
|
-
var s;
|
|
556
|
-
if (typeof r == "function")
|
|
557
|
-
s = r.propTypes;
|
|
558
|
-
else if (typeof r == "object" && (r.$$typeof === f || // Note: Memo only checks outer props here.
|
|
559
|
-
// Inner props are checked in the reconciler.
|
|
560
|
-
r.$$typeof === w))
|
|
561
|
-
s = r.propTypes;
|
|
562
|
-
else
|
|
563
|
-
return;
|
|
564
|
-
if (s) {
|
|
565
|
-
var y = A(r);
|
|
566
|
-
lr(s, e.props, "prop", y, e);
|
|
567
|
-
} else if (r.PropTypes !== void 0 && !he) {
|
|
568
|
-
he = !0;
|
|
569
|
-
var T = A(r);
|
|
570
|
-
p("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?", T || "Unknown");
|
|
571
|
-
}
|
|
572
|
-
typeof r.getDefaultProps == "function" && !r.getDefaultProps.isReactClassApproved && p("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.");
|
|
573
|
-
}
|
|
574
|
-
}
|
|
575
|
-
function jr(e) {
|
|
576
|
-
{
|
|
577
|
-
for (var r = Object.keys(e.props), s = 0; s < r.length; s++) {
|
|
578
|
-
var y = r[s];
|
|
579
|
-
if (y !== "children" && y !== "key") {
|
|
580
|
-
z(e), p("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.", y), z(null);
|
|
581
|
-
break;
|
|
582
|
-
}
|
|
583
|
-
}
|
|
584
|
-
e.ref !== null && (z(e), p("Invalid attribute `ref` supplied to `React.Fragment`."), z(null));
|
|
585
|
-
}
|
|
586
|
-
}
|
|
587
|
-
var Ve = {};
|
|
588
|
-
function Be(e, r, s, y, T, D) {
|
|
589
|
-
{
|
|
590
|
-
var R = rr(e);
|
|
591
|
-
if (!R) {
|
|
592
|
-
var k = "";
|
|
593
|
-
(e === void 0 || typeof e == "object" && e !== null && Object.keys(e).length === 0) && (k += " You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");
|
|
594
|
-
var O = wr(T);
|
|
595
|
-
O ? k += O : k += Ie();
|
|
596
|
-
var M;
|
|
597
|
-
e === null ? M = "null" : ue(e) ? M = "array" : e !== void 0 && e.$$typeof === n ? (M = "<" + (A(e.type) || "Unknown") + " />", k = " Did you accidentally export a JSX literal instead of a component?") : M = typeof e, p("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s", M, k);
|
|
598
|
-
}
|
|
599
|
-
var F = br(e, r, s, T, D);
|
|
600
|
-
if (F == null)
|
|
601
|
-
return F;
|
|
602
|
-
if (R) {
|
|
603
|
-
var L = r.children;
|
|
604
|
-
if (L !== void 0)
|
|
605
|
-
if (y)
|
|
606
|
-
if (ue(L)) {
|
|
607
|
-
for (var J = 0; J < L.length; J++)
|
|
608
|
-
We(L[J], e);
|
|
609
|
-
Object.freeze && Object.freeze(L);
|
|
610
|
-
} else
|
|
611
|
-
p("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");
|
|
612
|
-
else
|
|
613
|
-
We(L, e);
|
|
614
|
-
}
|
|
615
|
-
if (G.call(r, "key")) {
|
|
616
|
-
var V = A(e), N = Object.keys(r).filter(function(Dr) {
|
|
617
|
-
return Dr !== "key";
|
|
618
|
-
}), pe = N.length > 0 ? "{key: someKey, " + N.join(": ..., ") + ": ...}" : "{key: someKey}";
|
|
619
|
-
if (!Ve[V + pe]) {
|
|
620
|
-
var Tr = N.length > 0 ? "{" + N.join(": ..., ") + ": ...}" : "{}";
|
|
621
|
-
p(`A props object containing a "key" prop is being spread into JSX:
|
|
622
|
-
let props = %s;
|
|
623
|
-
<%s {...props} />
|
|
624
|
-
React keys must be passed directly to JSX without using spread:
|
|
625
|
-
let props = %s;
|
|
626
|
-
<%s key={someKey} {...props} />`, pe, V, Tr, V), Ve[V + pe] = !0;
|
|
627
|
-
}
|
|
628
|
-
}
|
|
629
|
-
return e === i ? jr(F) : Er(F), F;
|
|
630
|
-
}
|
|
631
|
-
}
|
|
632
|
-
function Cr(e, r, s) {
|
|
633
|
-
return Be(e, r, s, !0);
|
|
634
|
-
}
|
|
635
|
-
function kr(e, r, s) {
|
|
636
|
-
return Be(e, r, s, !1);
|
|
637
|
-
}
|
|
638
|
-
var Rr = kr, _r = Cr;
|
|
639
|
-
Z.Fragment = i, Z.jsx = Rr, Z.jsxs = _r;
|
|
640
|
-
}()), Z;
|
|
641
|
-
}
|
|
642
|
-
process.env.NODE_ENV === "production" ? ve.exports = Sr() : ve.exports = Mr();
|
|
643
|
-
var o = ve.exports;
|
|
644
|
-
const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
|
|
1
|
+
import { jsxs as $, jsx as l, Fragment as R } from "react/jsx-runtime";
|
|
2
|
+
import { useState as F, useRef as E, useEffect as D, forwardRef as W } from "react";
|
|
3
|
+
const I = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wght@0,100;0,200;0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,100;1,200;1,300;1,400;1,500;1,600;1,700;1,800;1,900&display=swap");
|
|
645
4
|
|
|
646
5
|
* {
|
|
647
6
|
margin: 0;
|
|
@@ -689,23 +48,11 @@ const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,w
|
|
|
689
48
|
#f9fafb
|
|
690
49
|
);
|
|
691
50
|
|
|
692
|
-
/*
|
|
693
|
-
--starasia-ui-date-color-primary-blue: var(
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
);
|
|
697
|
-
--starasia-ui-date-color-secondary-blue: var(
|
|
698
|
-
--starasia-ui-color-blue-500,
|
|
699
|
-
#3b82f6
|
|
700
|
-
);
|
|
701
|
-
--starasia-ui-date-color-tertiary-blue: var(
|
|
702
|
-
--starasia-ui-color-blue-300,
|
|
703
|
-
#93c5fd
|
|
704
|
-
);
|
|
705
|
-
--starasia-ui-date-color-quaternary-blue: var(
|
|
706
|
-
--starasia-ui-color-blue-50,
|
|
707
|
-
#eff6ff
|
|
708
|
-
);
|
|
51
|
+
/* brand */
|
|
52
|
+
--starasia-ui-date-color-primary-blue: var(--starasia-ui-brand-primary-default);
|
|
53
|
+
--starasia-ui-date-color-secondary-blue: var(--starasia-ui-brand-primary-default);
|
|
54
|
+
--starasia-ui-date-color-tertiary-blue: var(--starasia-ui-brand-primary-secondary);
|
|
55
|
+
--starasia-ui-date-color-quaternary-blue: var(--starasia-ui-brand-primary-tertiary);
|
|
709
56
|
|
|
710
57
|
/* spacing */
|
|
711
58
|
--starasia-ui-date-spacing-xs: var(--starasia-ui-spacing-xs, 4px);
|
|
@@ -897,7 +244,7 @@ const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,w
|
|
|
897
244
|
|
|
898
245
|
.starasia-calendar-input-container:has(input:focus) {
|
|
899
246
|
border-color: var(--starasia-ui-date-color-primary-blue);
|
|
900
|
-
box-shadow: 0px 0px 0px 2px rgba(
|
|
247
|
+
box-shadow: 0px 0px 0px 2px rgba(var(--starasia-ui-raw-color-brand-secondary), 0.2);
|
|
901
248
|
}
|
|
902
249
|
.starasia-calendar-input-container:has(input:disabled) {
|
|
903
250
|
/* border-color: var(--starasia-ui-input-color-tertiary-gray); */
|
|
@@ -974,7 +321,7 @@ const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,w
|
|
|
974
321
|
.starasia-calendar-input-container-warning {
|
|
975
322
|
border-color: var(--starasia-ui-input-color-secondary-yellow) !important;
|
|
976
323
|
}
|
|
977
|
-
`,
|
|
324
|
+
`, A = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], N = [
|
|
978
325
|
"January",
|
|
979
326
|
"February",
|
|
980
327
|
"March",
|
|
@@ -987,7 +334,7 @@ const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,w
|
|
|
987
334
|
"October",
|
|
988
335
|
"November",
|
|
989
336
|
"December"
|
|
990
|
-
],
|
|
337
|
+
], G = [
|
|
991
338
|
"Jan",
|
|
992
339
|
"Feb",
|
|
993
340
|
"Mar",
|
|
@@ -1001,47 +348,47 @@ const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,w
|
|
|
1001
348
|
"Nov",
|
|
1002
349
|
"Dec"
|
|
1003
350
|
];
|
|
1004
|
-
function
|
|
1005
|
-
const [
|
|
1006
|
-
|
|
351
|
+
function J(r) {
|
|
352
|
+
const [a, t] = F(r), s = E(null), i = (g) => {
|
|
353
|
+
s.current && !s.current.contains(g.target) && t(!1);
|
|
1007
354
|
};
|
|
1008
|
-
return
|
|
1009
|
-
document.removeEventListener("click",
|
|
1010
|
-
}), []), { ref:
|
|
355
|
+
return D(() => (document.addEventListener("click", i, !0), () => {
|
|
356
|
+
document.removeEventListener("click", i, !0);
|
|
357
|
+
}), []), { ref: s, isComponentVisible: a, setIsComponentVisible: t };
|
|
1011
358
|
}
|
|
1012
|
-
const
|
|
1013
|
-
if (!document.getElementById(
|
|
1014
|
-
const
|
|
1015
|
-
|
|
359
|
+
const j = "starasia-calendar-input-styles", U = (r) => {
|
|
360
|
+
if (!document.getElementById(j)) {
|
|
361
|
+
const a = document.createElement("style");
|
|
362
|
+
a.id = j, a.textContent = r, document.head.appendChild(a);
|
|
1016
363
|
}
|
|
1017
364
|
};
|
|
1018
|
-
|
|
1019
|
-
const
|
|
1020
|
-
if (
|
|
365
|
+
U(I);
|
|
366
|
+
const T = (r) => {
|
|
367
|
+
if (r === "sm")
|
|
1021
368
|
return 16;
|
|
1022
|
-
if (
|
|
369
|
+
if (r === "md")
|
|
1023
370
|
return 16;
|
|
1024
|
-
if (
|
|
371
|
+
if (r === "lg")
|
|
1025
372
|
return 20;
|
|
1026
|
-
},
|
|
1027
|
-
const { size:
|
|
1028
|
-
|
|
373
|
+
}, K = (r) => {
|
|
374
|
+
const { size: a = "md", status: t = "default", variant: s = "outline", ...i } = r, g = E(null), f = () => {
|
|
375
|
+
g.current && i.onClick && (g.current.focus(), i.onClick(""));
|
|
1029
376
|
};
|
|
1030
|
-
return /* @__PURE__ */
|
|
377
|
+
return /* @__PURE__ */ $(
|
|
1031
378
|
"div",
|
|
1032
379
|
{
|
|
1033
|
-
className: `starasia-calendar-input-container starasia-calendar-input-${
|
|
1034
|
-
onClick:
|
|
380
|
+
className: `starasia-calendar-input-container starasia-calendar-input-${s} starasia-calendar-input-container-${t} ${a} `,
|
|
381
|
+
onClick: f,
|
|
1035
382
|
children: [
|
|
1036
|
-
/* @__PURE__ */
|
|
383
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-container-icon-left", children: /* @__PURE__ */ l(
|
|
1037
384
|
"svg",
|
|
1038
385
|
{
|
|
1039
386
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1040
|
-
width:
|
|
1041
|
-
height:
|
|
387
|
+
width: T(a),
|
|
388
|
+
height: T(a),
|
|
1042
389
|
viewBox: "0 0 20 20",
|
|
1043
390
|
fill: "none",
|
|
1044
|
-
children: /* @__PURE__ */
|
|
391
|
+
children: /* @__PURE__ */ l(
|
|
1045
392
|
"path",
|
|
1046
393
|
{
|
|
1047
394
|
d: "M12.5 2.08301V5.41634M7.50002 2.08301V5.41634M17.0688 9.58301H2.93113M17.0688 9.58301C16.8953 4.82698 15.1284 3.33301 10 3.33301C4.87165 3.33301 3.10469 4.82698 2.93113 9.58301M17.0688 9.58301C17.0786 9.85037 17.0834 10.128 17.0834 10.4163C17.0834 15.833 15.4167 17.4997 10 17.4997C4.58335 17.4997 2.91669 15.833 2.91669 10.4163C2.91669 10.128 2.92138 9.85037 2.93113 9.58301",
|
|
@@ -1053,25 +400,25 @@ const te = (t) => {
|
|
|
1053
400
|
)
|
|
1054
401
|
}
|
|
1055
402
|
) }),
|
|
1056
|
-
/* @__PURE__ */
|
|
403
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-preview-container", children: /* @__PURE__ */ l(
|
|
1057
404
|
"input",
|
|
1058
405
|
{
|
|
1059
406
|
className: "starasia-calendar-input",
|
|
1060
|
-
...
|
|
1061
|
-
disabled:
|
|
1062
|
-
value:
|
|
1063
|
-
ref:
|
|
407
|
+
...i,
|
|
408
|
+
disabled: t === "disable" ? !0 : i.disabled,
|
|
409
|
+
value: i.value,
|
|
410
|
+
ref: g
|
|
1064
411
|
}
|
|
1065
412
|
) }),
|
|
1066
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-container-icon-right", children: /* @__PURE__ */ l(
|
|
1067
414
|
"svg",
|
|
1068
415
|
{
|
|
1069
416
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1070
|
-
width:
|
|
1071
|
-
height:
|
|
417
|
+
width: T(a),
|
|
418
|
+
height: T(a),
|
|
1072
419
|
viewBox: "0 0 20 20",
|
|
1073
420
|
fill: "none",
|
|
1074
|
-
children: /* @__PURE__ */
|
|
421
|
+
children: /* @__PURE__ */ l(
|
|
1075
422
|
"path",
|
|
1076
423
|
{
|
|
1077
424
|
d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
|
|
@@ -1086,178 +433,178 @@ const te = (t) => {
|
|
|
1086
433
|
]
|
|
1087
434
|
}
|
|
1088
435
|
);
|
|
1089
|
-
},
|
|
1090
|
-
date:
|
|
1091
|
-
setDate:
|
|
1092
|
-
dateRange:
|
|
1093
|
-
setDateRange:
|
|
1094
|
-
onChange:
|
|
1095
|
-
minDate:
|
|
1096
|
-
maxDate:
|
|
1097
|
-
input:
|
|
436
|
+
}, Q = ({
|
|
437
|
+
date: r,
|
|
438
|
+
setDate: a,
|
|
439
|
+
dateRange: t,
|
|
440
|
+
setDateRange: s,
|
|
441
|
+
onChange: i,
|
|
442
|
+
minDate: g,
|
|
443
|
+
maxDate: f,
|
|
444
|
+
input: v
|
|
1098
445
|
}) => {
|
|
1099
|
-
var
|
|
1100
|
-
let
|
|
1101
|
-
const
|
|
446
|
+
var u, n, c;
|
|
447
|
+
let h = new Date(r.getFullYear(), r.getMonth(), 1), e = h.getDay(), w = [];
|
|
448
|
+
const b = r.getMonth();
|
|
1102
449
|
for (let d = 0; d < 42; d++) {
|
|
1103
|
-
d === 0 &&
|
|
1104
|
-
|
|
1105
|
-
) :
|
|
1106
|
-
let
|
|
1107
|
-
currentMonth:
|
|
1108
|
-
date: new Date(
|
|
1109
|
-
month:
|
|
1110
|
-
number:
|
|
1111
|
-
selected:
|
|
1112
|
-
year:
|
|
1113
|
-
isDisabled:
|
|
450
|
+
d === 0 && e === 0 ? h.setDate(h.getDate() - 7) : d === 0 ? h.setDate(
|
|
451
|
+
h.getDate() + (d - e)
|
|
452
|
+
) : h.setDate(h.getDate() + 1);
|
|
453
|
+
let y = {
|
|
454
|
+
currentMonth: h.getMonth() === b,
|
|
455
|
+
date: new Date(h),
|
|
456
|
+
month: h.getMonth(),
|
|
457
|
+
number: h.getDate(),
|
|
458
|
+
selected: h.toDateString() === ((u = t.from) == null ? void 0 : u.toDateString()) || h.toDateString() === (((n = t.to) == null ? void 0 : n.toDateString()) || ((c = t.from) == null ? void 0 : c.toDateString())),
|
|
459
|
+
year: h.getFullYear(),
|
|
460
|
+
isDisabled: g && h < g || f && h > f
|
|
1114
461
|
};
|
|
1115
|
-
|
|
462
|
+
w.push(y);
|
|
1116
463
|
}
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
},
|
|
1120
|
-
var
|
|
1121
|
-
let
|
|
1122
|
-
if (
|
|
1123
|
-
|
|
464
|
+
const k = (d) => {
|
|
465
|
+
a(d);
|
|
466
|
+
}, M = (d) => {
|
|
467
|
+
var o;
|
|
468
|
+
let y = { ...t };
|
|
469
|
+
if (y.from && y.to)
|
|
470
|
+
y = { from: d, to: null };
|
|
1124
471
|
else {
|
|
1125
|
-
const
|
|
1126
|
-
d.getTime() >
|
|
472
|
+
const p = ((o = y.from) == null ? void 0 : o.getTime()) || 0;
|
|
473
|
+
d.getTime() > p ? y = { from: y.from, to: d } : y = { from: d, to: y.from };
|
|
1127
474
|
}
|
|
1128
|
-
|
|
475
|
+
s(y), i(y);
|
|
1129
476
|
};
|
|
1130
|
-
return /* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
var
|
|
1134
|
-
const
|
|
1135
|
-
return /* @__PURE__ */
|
|
477
|
+
return /* @__PURE__ */ $("div", { className: "starasia-calendar-days-preivew", children: [
|
|
478
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-days-name-preivew", children: A.map((d, y) => /* @__PURE__ */ l("p", { children: d }, y)) }),
|
|
479
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-days-number-preivew", children: w.map((d, y) => {
|
|
480
|
+
var C;
|
|
481
|
+
const o = d.date.getTime() > t.from.getTime() && d.date.getTime() < (((C = t.to) == null ? void 0 : C.getTime()) || t.from.getTime()), p = d.isDisabled;
|
|
482
|
+
return /* @__PURE__ */ l(
|
|
1136
483
|
"p",
|
|
1137
484
|
{
|
|
1138
485
|
className: `${d.currentMonth ? "starasia-calendar-days-current" : "starasia-calendar-days"} ${d.selected ? "starasia-calendar-days-active" : ""}`,
|
|
1139
486
|
style: {
|
|
1140
|
-
backgroundColor:
|
|
1141
|
-
pointerEvents:
|
|
1142
|
-
cursor:
|
|
1143
|
-
color:
|
|
1144
|
-
...
|
|
487
|
+
backgroundColor: o ? "rgba(100, 181, 246, 0.1)" : "",
|
|
488
|
+
pointerEvents: p ? "none" : void 0,
|
|
489
|
+
cursor: p ? "not-allowed" : "pointer",
|
|
490
|
+
color: p ? "#ccc" : o ? "#b0b0b0" : "",
|
|
491
|
+
...v ? {} : { width: "100%" }
|
|
1145
492
|
},
|
|
1146
493
|
onClick: () => {
|
|
1147
|
-
|
|
494
|
+
p || (k(d.date), M(d.date));
|
|
1148
495
|
},
|
|
1149
496
|
children: d.number
|
|
1150
497
|
},
|
|
1151
|
-
|
|
498
|
+
y
|
|
1152
499
|
);
|
|
1153
500
|
}) })
|
|
1154
501
|
] });
|
|
1155
|
-
},
|
|
1156
|
-
date:
|
|
1157
|
-
setDate:
|
|
1158
|
-
filter:
|
|
1159
|
-
setViews:
|
|
1160
|
-
dateRange:
|
|
1161
|
-
setDateRange:
|
|
1162
|
-
onChange:
|
|
1163
|
-
minDate:
|
|
1164
|
-
maxDate:
|
|
1165
|
-
input:
|
|
502
|
+
}, X = ({
|
|
503
|
+
date: r,
|
|
504
|
+
setDate: a,
|
|
505
|
+
filter: t,
|
|
506
|
+
setViews: s,
|
|
507
|
+
dateRange: i,
|
|
508
|
+
setDateRange: g,
|
|
509
|
+
onChange: f,
|
|
510
|
+
minDate: v,
|
|
511
|
+
maxDate: h,
|
|
512
|
+
input: e
|
|
1166
513
|
}) => {
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1169
|
-
},
|
|
1170
|
-
var
|
|
1171
|
-
let
|
|
1172
|
-
if (
|
|
1173
|
-
|
|
514
|
+
const w = i.from.getFullYear(), b = r.getFullYear(), k = (u) => {
|
|
515
|
+
t ? (M(u), a(u)) : (s("days"), a(u));
|
|
516
|
+
}, M = (u) => {
|
|
517
|
+
var c;
|
|
518
|
+
let n = { ...i };
|
|
519
|
+
if (n.from && n.to)
|
|
520
|
+
n = { from: u, to: null };
|
|
1174
521
|
else {
|
|
1175
|
-
const d = ((
|
|
1176
|
-
|
|
522
|
+
const d = ((c = n.from) == null ? void 0 : c.getTime()) || 0;
|
|
523
|
+
u.getTime() > d ? n = { from: n.from, to: u } : n = { from: u, to: n.from };
|
|
1177
524
|
}
|
|
1178
|
-
|
|
525
|
+
g(n), f(n);
|
|
1179
526
|
};
|
|
1180
|
-
return /* @__PURE__ */
|
|
1181
|
-
var
|
|
1182
|
-
const
|
|
1183
|
-
return /* @__PURE__ */
|
|
527
|
+
return /* @__PURE__ */ l("div", { className: "starasia-calendar-months-preview", children: N.map((u, n) => {
|
|
528
|
+
var y, o, p;
|
|
529
|
+
const c = new Date(b, n).getTime() > i.from.getTime() && new Date(b, n).getTime() < (((y = i.to) == null ? void 0 : y.getTime()) || i.from.getTime()), d = v && new Date(b, n) < v || h && new Date(b, n) > h;
|
|
530
|
+
return /* @__PURE__ */ l(
|
|
1184
531
|
"p",
|
|
1185
532
|
{
|
|
1186
|
-
className:
|
|
533
|
+
className: w === b && (n === ((o = i.from) == null ? void 0 : o.getMonth()) || n === ((p = i.to) == null ? void 0 : p.getMonth())) ? "starasia-calendar-months-active" : "",
|
|
1187
534
|
style: {
|
|
1188
|
-
backgroundColor:
|
|
535
|
+
backgroundColor: c ? "rgba(100, 181, 246, 0.1)" : "",
|
|
1189
536
|
pointerEvents: d ? "none" : void 0,
|
|
1190
537
|
cursor: d ? "not-allowed" : "pointer",
|
|
1191
|
-
color: d ? "#ccc" :
|
|
1192
|
-
...
|
|
538
|
+
color: d ? "#ccc" : c ? "#b0b0b0" : "",
|
|
539
|
+
...e ? {} : { width: "100%" }
|
|
1193
540
|
},
|
|
1194
541
|
onClick: () => {
|
|
1195
|
-
d ||
|
|
542
|
+
d || k(new Date(b, n));
|
|
1196
543
|
},
|
|
1197
|
-
children:
|
|
544
|
+
children: u.slice(0, 3)
|
|
1198
545
|
},
|
|
1199
|
-
|
|
546
|
+
n
|
|
1200
547
|
);
|
|
1201
548
|
}) });
|
|
1202
|
-
},
|
|
1203
|
-
const
|
|
1204
|
-
return { start:
|
|
1205
|
-
},
|
|
1206
|
-
date:
|
|
1207
|
-
filter:
|
|
1208
|
-
setViews:
|
|
1209
|
-
setDate:
|
|
1210
|
-
dateRange:
|
|
1211
|
-
setDateRange:
|
|
1212
|
-
onChange:
|
|
1213
|
-
minDate:
|
|
1214
|
-
maxDate:
|
|
1215
|
-
input:
|
|
549
|
+
}, B = (r) => {
|
|
550
|
+
const a = Math.floor(r / 10) * 10, t = a + 10;
|
|
551
|
+
return { start: a, end: t };
|
|
552
|
+
}, Z = ({
|
|
553
|
+
date: r,
|
|
554
|
+
filter: a,
|
|
555
|
+
setViews: t,
|
|
556
|
+
setDate: s,
|
|
557
|
+
dateRange: i,
|
|
558
|
+
setDateRange: g,
|
|
559
|
+
onChange: f,
|
|
560
|
+
minDate: v,
|
|
561
|
+
maxDate: h,
|
|
562
|
+
input: e
|
|
1216
563
|
}) => {
|
|
1217
|
-
var
|
|
1218
|
-
let
|
|
1219
|
-
const
|
|
1220
|
-
for (let
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1223
|
-
year:
|
|
1224
|
-
active:
|
|
1225
|
-
highlight:
|
|
1226
|
-
disabled: !
|
|
564
|
+
var y;
|
|
565
|
+
let w = [];
|
|
566
|
+
const b = r.getFullYear(), { start: k, end: M } = B(b), u = i.from.getFullYear(), n = (y = i.to) == null ? void 0 : y.getFullYear();
|
|
567
|
+
for (let o = k; o < M; o++) {
|
|
568
|
+
const p = new Date(o, 0), C = (!v || p >= v) && (!h || p <= h), x = o === u || o === n, m = p > i.from && p < i.to;
|
|
569
|
+
w.push({
|
|
570
|
+
year: o,
|
|
571
|
+
active: x && C,
|
|
572
|
+
highlight: m && C,
|
|
573
|
+
disabled: !C
|
|
1227
574
|
});
|
|
1228
575
|
}
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
}, d = (
|
|
1232
|
-
var
|
|
1233
|
-
let
|
|
1234
|
-
if (
|
|
1235
|
-
|
|
576
|
+
const c = (o) => {
|
|
577
|
+
a ? (d(o), s(o)) : (s(o), t("months"));
|
|
578
|
+
}, d = (o) => {
|
|
579
|
+
var C;
|
|
580
|
+
let p = { ...i };
|
|
581
|
+
if (p.from && p.to)
|
|
582
|
+
p = { from: o, to: null };
|
|
1236
583
|
else {
|
|
1237
|
-
const
|
|
1238
|
-
|
|
584
|
+
const x = ((C = p.from) == null ? void 0 : C.getTime()) || 0;
|
|
585
|
+
o.getTime() > x ? p = { from: p.from, to: o } : p = { from: o, to: p.from };
|
|
1239
586
|
}
|
|
1240
|
-
|
|
587
|
+
g(p), f(p);
|
|
1241
588
|
};
|
|
1242
|
-
return /* @__PURE__ */
|
|
589
|
+
return /* @__PURE__ */ l("div", { className: "starasia-calendar-years-preview", children: w.map((o, p) => /* @__PURE__ */ l(
|
|
1243
590
|
"p",
|
|
1244
591
|
{
|
|
1245
|
-
className: `${
|
|
592
|
+
className: `${o.active ? "starasia-calendar-months-active" : ""} ${o.highlight ? "starasia-calendar-months-highlight" : ""} ${o.disabled ? "starasia-calendar-disabled" : ""}`,
|
|
1246
593
|
onClick: () => {
|
|
1247
|
-
|
|
594
|
+
o.disabled || c(new Date(o.year, 0));
|
|
1248
595
|
},
|
|
1249
596
|
style: {
|
|
1250
|
-
backgroundColor:
|
|
1251
|
-
color:
|
|
1252
|
-
cursor:
|
|
1253
|
-
pointerEvents:
|
|
1254
|
-
...
|
|
597
|
+
backgroundColor: o.highlight ? "rgba(100, 181, 246, 0.1)" : "",
|
|
598
|
+
color: o.highlight ? "#b0b0b0" : o.active ? "" : o.disabled ? "#ccc" : "",
|
|
599
|
+
cursor: o.disabled ? "not-allowed" : "pointer",
|
|
600
|
+
pointerEvents: o.disbled ? "none" : "all",
|
|
601
|
+
...e ? {} : { width: "100%" }
|
|
1255
602
|
},
|
|
1256
|
-
children:
|
|
603
|
+
children: o.year
|
|
1257
604
|
},
|
|
1258
|
-
|
|
605
|
+
p
|
|
1259
606
|
)) });
|
|
1260
|
-
},
|
|
607
|
+
}, q = ({ ...r }) => /* @__PURE__ */ l(
|
|
1261
608
|
"svg",
|
|
1262
609
|
{
|
|
1263
610
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1265,8 +612,8 @@ const te = (t) => {
|
|
|
1265
612
|
height: "20",
|
|
1266
613
|
viewBox: "0 0 20 20",
|
|
1267
614
|
fill: "none",
|
|
1268
|
-
...
|
|
1269
|
-
children: /* @__PURE__ */
|
|
615
|
+
...r,
|
|
616
|
+
children: /* @__PURE__ */ l(
|
|
1270
617
|
"path",
|
|
1271
618
|
{
|
|
1272
619
|
d: "M12.5 3.33334L5.83337 10L12.5 16.6667",
|
|
@@ -1277,7 +624,7 @@ const te = (t) => {
|
|
|
1277
624
|
}
|
|
1278
625
|
)
|
|
1279
626
|
}
|
|
1280
|
-
),
|
|
627
|
+
), P = ({ ...r }) => /* @__PURE__ */ l(
|
|
1281
628
|
"svg",
|
|
1282
629
|
{
|
|
1283
630
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1285,8 +632,8 @@ const te = (t) => {
|
|
|
1285
632
|
height: "20",
|
|
1286
633
|
viewBox: "0 0 20 20",
|
|
1287
634
|
fill: "none",
|
|
1288
|
-
...
|
|
1289
|
-
children: /* @__PURE__ */
|
|
635
|
+
...r,
|
|
636
|
+
children: /* @__PURE__ */ l(
|
|
1290
637
|
"path",
|
|
1291
638
|
{
|
|
1292
639
|
d: "M7.5 16.6667L14.1667 10L7.5 3.33334",
|
|
@@ -1297,201 +644,201 @@ const te = (t) => {
|
|
|
1297
644
|
}
|
|
1298
645
|
)
|
|
1299
646
|
}
|
|
1300
|
-
),
|
|
1301
|
-
setViews:
|
|
1302
|
-
views:
|
|
1303
|
-
filter:
|
|
1304
|
-
date:
|
|
1305
|
-
setDate:
|
|
647
|
+
), _ = ({
|
|
648
|
+
setViews: r,
|
|
649
|
+
views: a,
|
|
650
|
+
filter: t,
|
|
651
|
+
date: s,
|
|
652
|
+
setDate: i
|
|
1306
653
|
}) => {
|
|
1307
|
-
const
|
|
1308
|
-
|
|
1309
|
-
},
|
|
1310
|
-
if (
|
|
1311
|
-
|
|
654
|
+
const g = () => {
|
|
655
|
+
t || r((e) => e === "days" ? "months" : e === "months" ? "years" : "days");
|
|
656
|
+
}, f = () => {
|
|
657
|
+
if (a === "years") {
|
|
658
|
+
i((e) => new Date(e.getFullYear() + 10, 0));
|
|
1312
659
|
return;
|
|
1313
660
|
}
|
|
1314
|
-
if (
|
|
1315
|
-
|
|
661
|
+
if (a === "months") {
|
|
662
|
+
i((e) => new Date(e.getFullYear() + 1, e.getMonth()));
|
|
1316
663
|
return;
|
|
1317
664
|
}
|
|
1318
|
-
|
|
1319
|
-
},
|
|
1320
|
-
if (
|
|
1321
|
-
|
|
665
|
+
i((e) => new Date(e.getFullYear(), e.getMonth() + 1));
|
|
666
|
+
}, v = () => {
|
|
667
|
+
if (a === "years") {
|
|
668
|
+
i((e) => new Date(e.getFullYear() - 10, 0));
|
|
1322
669
|
return;
|
|
1323
670
|
}
|
|
1324
|
-
if (
|
|
1325
|
-
|
|
671
|
+
if (a === "months") {
|
|
672
|
+
i((e) => new Date(e.getFullYear() - 1, e.getMonth()));
|
|
1326
673
|
return;
|
|
1327
674
|
}
|
|
1328
|
-
|
|
1329
|
-
(
|
|
1330
|
-
|
|
1331
|
-
|
|
675
|
+
i(
|
|
676
|
+
(e) => new Date(
|
|
677
|
+
e.getMonth() === 0 ? e.getFullYear() - 1 : e.getFullYear(),
|
|
678
|
+
e.getMonth() === 0 ? 11 : e.getMonth() - 1
|
|
1332
679
|
)
|
|
1333
680
|
);
|
|
1334
|
-
}, f = () => {
|
|
1335
|
-
if (n === "days")
|
|
1336
|
-
return `${U[i.getMonth()]} ${i.getFullYear()}`;
|
|
1337
|
-
if (n === "months")
|
|
1338
|
-
return `${i.getFullYear()}`;
|
|
1339
|
-
if (n === "years")
|
|
1340
|
-
return `${ye(i.getFullYear()).start} ~ ${ye(i.getFullYear()).end}`;
|
|
1341
681
|
};
|
|
1342
|
-
return /* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
|
|
682
|
+
return /* @__PURE__ */ $("div", { className: "starasia-calendar-header", children: [
|
|
683
|
+
/* @__PURE__ */ l(q, { onClick: () => v() }),
|
|
684
|
+
/* @__PURE__ */ l("div", { style: { cursor: "pointer" }, onClick: g, children: (() => {
|
|
685
|
+
if (a === "days")
|
|
686
|
+
return `${N[s.getMonth()]} ${s.getFullYear()}`;
|
|
687
|
+
if (a === "months")
|
|
688
|
+
return `${s.getFullYear()}`;
|
|
689
|
+
if (a === "years")
|
|
690
|
+
return `${B(s.getFullYear()).start} ~ ${B(s.getFullYear()).end}`;
|
|
691
|
+
})() }),
|
|
692
|
+
/* @__PURE__ */ l(P, { onClick: () => f() })
|
|
1346
693
|
] });
|
|
1347
694
|
};
|
|
1348
|
-
function
|
|
1349
|
-
const
|
|
1350
|
-
return `${
|
|
695
|
+
function L(r) {
|
|
696
|
+
const a = new Date(r), t = a.getFullYear(), s = a.getMonth();
|
|
697
|
+
return `${a.getDate().toString().padStart(2, "0")} ${G[s]} ${t}`;
|
|
1351
698
|
}
|
|
1352
|
-
const
|
|
1353
|
-
if (!document.getElementById(
|
|
1354
|
-
const
|
|
1355
|
-
|
|
699
|
+
const z = "starasia-calendar-styles", aa = (r) => {
|
|
700
|
+
if (!document.getElementById(z)) {
|
|
701
|
+
const a = document.createElement("style");
|
|
702
|
+
a.id = z, a.textContent = r, document.head.appendChild(a);
|
|
1356
703
|
}
|
|
1357
704
|
};
|
|
1358
|
-
|
|
1359
|
-
const
|
|
705
|
+
aa(I);
|
|
706
|
+
const ea = W(
|
|
1360
707
|
({
|
|
1361
|
-
value:
|
|
1362
|
-
onChange:
|
|
1363
|
-
filter:
|
|
1364
|
-
input:
|
|
1365
|
-
disabled:
|
|
1366
|
-
minDate:
|
|
1367
|
-
maxDate:
|
|
1368
|
-
placeholder:
|
|
1369
|
-
size:
|
|
1370
|
-
status:
|
|
1371
|
-
},
|
|
1372
|
-
const { ref:
|
|
1373
|
-
from: (
|
|
1374
|
-
to: (
|
|
708
|
+
value: r,
|
|
709
|
+
onChange: a,
|
|
710
|
+
filter: t,
|
|
711
|
+
input: s = !0,
|
|
712
|
+
disabled: i,
|
|
713
|
+
minDate: g,
|
|
714
|
+
maxDate: f,
|
|
715
|
+
placeholder: v,
|
|
716
|
+
size: h,
|
|
717
|
+
status: e
|
|
718
|
+
}, w) => {
|
|
719
|
+
const { ref: b, isComponentVisible: k, setIsComponentVisible: M } = J(!1), u = E(null), [n, c] = F("days"), [d, y] = F(/* @__PURE__ */ new Date()), [o, p] = F({
|
|
720
|
+
from: (r == null ? void 0 : r.from) || /* @__PURE__ */ new Date(),
|
|
721
|
+
to: (r == null ? void 0 : r.to) || /* @__PURE__ */ new Date()
|
|
1375
722
|
});
|
|
1376
|
-
|
|
1377
|
-
|
|
723
|
+
D(() => {
|
|
724
|
+
r ? (y(r.from), p(r)) : (y(/* @__PURE__ */ new Date()), p({
|
|
1378
725
|
from: /* @__PURE__ */ new Date(),
|
|
1379
726
|
to: /* @__PURE__ */ new Date()
|
|
1380
727
|
}));
|
|
1381
|
-
}, [
|
|
1382
|
-
|
|
1383
|
-
}, [
|
|
1384
|
-
|
|
1385
|
-
}, [
|
|
1386
|
-
|
|
1387
|
-
}, [
|
|
1388
|
-
const
|
|
1389
|
-
var
|
|
1390
|
-
if (!
|
|
728
|
+
}, [r]), D(() => {
|
|
729
|
+
t && c(t);
|
|
730
|
+
}, [t]), D(() => {
|
|
731
|
+
t || c("days");
|
|
732
|
+
}, [k]), D(() => {
|
|
733
|
+
s || M(!0);
|
|
734
|
+
}, [s]);
|
|
735
|
+
const C = () => {
|
|
736
|
+
var m, Y;
|
|
737
|
+
if (!r)
|
|
1391
738
|
return "";
|
|
1392
|
-
if (
|
|
1393
|
-
if (
|
|
1394
|
-
return `${
|
|
1395
|
-
if (
|
|
1396
|
-
return `${
|
|
1397
|
-
if (
|
|
1398
|
-
return `${(
|
|
739
|
+
if (t) {
|
|
740
|
+
if (n === "days")
|
|
741
|
+
return `${L(o.from)} ~ ${L(o.to || o.from) || "-"}`;
|
|
742
|
+
if (n === "months")
|
|
743
|
+
return `${N[o.from.getMonth()]} ~ ${o.to ? N[o.to.getMonth()] : "-"}`;
|
|
744
|
+
if (n === "years")
|
|
745
|
+
return `${(m = o.from) == null ? void 0 : m.getFullYear()} ~ ${((Y = o.to) == null ? void 0 : Y.getFullYear()) || "-"}`;
|
|
1399
746
|
} else
|
|
1400
|
-
return `${
|
|
1401
|
-
},
|
|
1402
|
-
if (
|
|
1403
|
-
const
|
|
1404
|
-
window.innerWidth <
|
|
747
|
+
return `${L(o.from)} ~ ${L(o.to || o.from) || "-"}`;
|
|
748
|
+
}, x = () => {
|
|
749
|
+
if (u.current && b.current && s) {
|
|
750
|
+
const m = b.current.getBoundingClientRect(), Y = u.current.getBoundingClientRect();
|
|
751
|
+
window.innerWidth < m.left + Y.width ? u.current.style.left = `${m.left - Y.width + m.width}px` : u.current.style.left = `${m.left}px`, m.top + Y.height > window.innerHeight ? u.current.style.top = `${m.y - (m.height + Y.height - 28)}px` : u.current.style.top = `${m.y + m.height}px`;
|
|
1405
752
|
}
|
|
1406
753
|
};
|
|
1407
|
-
return
|
|
1408
|
-
|
|
1409
|
-
}, [
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1412
|
-
|
|
754
|
+
return D(() => {
|
|
755
|
+
u.current && b.current && s && x();
|
|
756
|
+
}, [u, b, k]), D(() => {
|
|
757
|
+
const m = w == null ? void 0 : w.current;
|
|
758
|
+
return m && m.addEventListener("scroll", x), window.addEventListener("scroll", x), () => {
|
|
759
|
+
m && m.removeEventListener("scroll", x), window.removeEventListener("scroll", x);
|
|
1413
760
|
};
|
|
1414
|
-
}, []), /* @__PURE__ */
|
|
761
|
+
}, []), /* @__PURE__ */ $(
|
|
1415
762
|
"div",
|
|
1416
763
|
{
|
|
1417
764
|
className: "starasia-calendar-wrapper",
|
|
1418
|
-
style: { height:
|
|
1419
|
-
ref:
|
|
765
|
+
style: { height: s ? "auto" : "100%" },
|
|
766
|
+
ref: s ? b : null,
|
|
1420
767
|
children: [
|
|
1421
|
-
|
|
1422
|
-
|
|
768
|
+
s ? /* @__PURE__ */ l(
|
|
769
|
+
K,
|
|
1423
770
|
{
|
|
1424
|
-
value:
|
|
771
|
+
value: C(),
|
|
1425
772
|
inputMode: "none",
|
|
1426
773
|
onClick: () => {
|
|
1427
|
-
|
|
774
|
+
M(!0);
|
|
1428
775
|
},
|
|
1429
776
|
onChange: () => {
|
|
1430
777
|
},
|
|
1431
|
-
disabled:
|
|
1432
|
-
placeholder:
|
|
1433
|
-
size:
|
|
1434
|
-
status:
|
|
778
|
+
disabled: i,
|
|
779
|
+
placeholder: v,
|
|
780
|
+
size: h,
|
|
781
|
+
status: e
|
|
1435
782
|
}
|
|
1436
783
|
) : null,
|
|
1437
|
-
|
|
784
|
+
k ? /* @__PURE__ */ $(
|
|
1438
785
|
"div",
|
|
1439
786
|
{
|
|
1440
|
-
className: `starasia-calendar ${
|
|
1441
|
-
ref:
|
|
787
|
+
className: `starasia-calendar ${s ? "" : "starasia-calendar-no-input"}`,
|
|
788
|
+
ref: u,
|
|
1442
789
|
children: [
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
|
|
790
|
+
/* @__PURE__ */ l(
|
|
791
|
+
_,
|
|
1445
792
|
{
|
|
1446
|
-
setViews:
|
|
1447
|
-
views:
|
|
1448
|
-
filter:
|
|
793
|
+
setViews: c,
|
|
794
|
+
views: n,
|
|
795
|
+
filter: t,
|
|
1449
796
|
date: d,
|
|
1450
|
-
setDate:
|
|
797
|
+
setDate: y
|
|
1451
798
|
}
|
|
1452
799
|
),
|
|
1453
|
-
/* @__PURE__ */
|
|
1454
|
-
|
|
800
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-body", children: n === "days" ? /* @__PURE__ */ l(
|
|
801
|
+
Q,
|
|
1455
802
|
{
|
|
1456
803
|
date: d,
|
|
1457
|
-
setDate:
|
|
1458
|
-
setIsComponentVisible:
|
|
1459
|
-
dateRange:
|
|
1460
|
-
setDateRange:
|
|
1461
|
-
input:
|
|
1462
|
-
onChange:
|
|
1463
|
-
minDate:
|
|
1464
|
-
maxDate:
|
|
804
|
+
setDate: y,
|
|
805
|
+
setIsComponentVisible: M,
|
|
806
|
+
dateRange: o,
|
|
807
|
+
setDateRange: p,
|
|
808
|
+
input: s,
|
|
809
|
+
onChange: a,
|
|
810
|
+
minDate: g,
|
|
811
|
+
maxDate: f
|
|
1465
812
|
}
|
|
1466
|
-
) :
|
|
1467
|
-
|
|
813
|
+
) : n === "months" ? /* @__PURE__ */ l(
|
|
814
|
+
X,
|
|
1468
815
|
{
|
|
1469
816
|
date: d,
|
|
1470
|
-
setDate:
|
|
1471
|
-
filter:
|
|
1472
|
-
setViews:
|
|
1473
|
-
dateRange:
|
|
1474
|
-
setDateRange:
|
|
1475
|
-
setIsComponentVisible:
|
|
1476
|
-
input:
|
|
1477
|
-
onChange:
|
|
1478
|
-
minDate:
|
|
1479
|
-
maxDate:
|
|
817
|
+
setDate: y,
|
|
818
|
+
filter: t,
|
|
819
|
+
setViews: c,
|
|
820
|
+
dateRange: o,
|
|
821
|
+
setDateRange: p,
|
|
822
|
+
setIsComponentVisible: M,
|
|
823
|
+
input: s,
|
|
824
|
+
onChange: a,
|
|
825
|
+
minDate: g,
|
|
826
|
+
maxDate: f
|
|
1480
827
|
}
|
|
1481
|
-
) : /* @__PURE__ */
|
|
1482
|
-
|
|
828
|
+
) : /* @__PURE__ */ l(
|
|
829
|
+
Z,
|
|
1483
830
|
{
|
|
1484
831
|
date: d,
|
|
1485
|
-
setDate:
|
|
1486
|
-
filter:
|
|
1487
|
-
setViews:
|
|
1488
|
-
dateRange:
|
|
1489
|
-
setDateRange:
|
|
1490
|
-
setIsComponentVisible:
|
|
1491
|
-
input:
|
|
1492
|
-
onChange:
|
|
1493
|
-
minDate:
|
|
1494
|
-
maxDate:
|
|
832
|
+
setDate: y,
|
|
833
|
+
filter: t,
|
|
834
|
+
setViews: c,
|
|
835
|
+
dateRange: o,
|
|
836
|
+
setDateRange: p,
|
|
837
|
+
setIsComponentVisible: M,
|
|
838
|
+
input: s,
|
|
839
|
+
onChange: a,
|
|
840
|
+
minDate: g,
|
|
841
|
+
maxDate: f
|
|
1495
842
|
}
|
|
1496
843
|
) })
|
|
1497
844
|
]
|
|
@@ -1501,39 +848,39 @@ const Ar = be(
|
|
|
1501
848
|
}
|
|
1502
849
|
);
|
|
1503
850
|
}
|
|
1504
|
-
),
|
|
1505
|
-
if (!document.getElementById(
|
|
1506
|
-
const
|
|
1507
|
-
|
|
851
|
+
), O = "starasia-calendar-input-styles", ra = (r) => {
|
|
852
|
+
if (!document.getElementById(O)) {
|
|
853
|
+
const a = document.createElement("style");
|
|
854
|
+
a.id = O, a.textContent = r, document.head.appendChild(a);
|
|
1508
855
|
}
|
|
1509
856
|
};
|
|
1510
|
-
|
|
1511
|
-
const
|
|
1512
|
-
if (
|
|
857
|
+
ra(I);
|
|
858
|
+
const S = (r) => {
|
|
859
|
+
if (r === "sm")
|
|
1513
860
|
return 16;
|
|
1514
|
-
if (
|
|
861
|
+
if (r === "md")
|
|
1515
862
|
return 16;
|
|
1516
|
-
if (
|
|
863
|
+
if (r === "lg")
|
|
1517
864
|
return 20;
|
|
1518
|
-
},
|
|
1519
|
-
const { size:
|
|
1520
|
-
|
|
865
|
+
}, na = (r) => {
|
|
866
|
+
const { size: a = "md", status: t = "default", variant: s = "outline", ...i } = r, g = E(null), f = () => {
|
|
867
|
+
g.current && i.onClick && (g.current.focus(), i.onClick(""));
|
|
1521
868
|
};
|
|
1522
|
-
return /* @__PURE__ */
|
|
869
|
+
return /* @__PURE__ */ $(
|
|
1523
870
|
"div",
|
|
1524
871
|
{
|
|
1525
|
-
className: `starasia-calendar-input-container starasia-calendar-input-${
|
|
1526
|
-
onClick:
|
|
872
|
+
className: `starasia-calendar-input-container starasia-calendar-input-${s} starasia-calendar-input-container-${t} ${a} `,
|
|
873
|
+
onClick: f,
|
|
1527
874
|
children: [
|
|
1528
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-container-icon-left", children: /* @__PURE__ */ l(
|
|
1529
876
|
"svg",
|
|
1530
877
|
{
|
|
1531
878
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1532
|
-
width:
|
|
1533
|
-
height:
|
|
879
|
+
width: S(a),
|
|
880
|
+
height: S(a),
|
|
1534
881
|
viewBox: "0 0 20 20",
|
|
1535
882
|
fill: "none",
|
|
1536
|
-
children: /* @__PURE__ */
|
|
883
|
+
children: /* @__PURE__ */ l(
|
|
1537
884
|
"path",
|
|
1538
885
|
{
|
|
1539
886
|
d: "M12.5 2.08301V5.41634M7.50002 2.08301V5.41634M17.0688 9.58301H2.93113M17.0688 9.58301C16.8953 4.82698 15.1284 3.33301 10 3.33301C4.87165 3.33301 3.10469 4.82698 2.93113 9.58301M17.0688 9.58301C17.0786 9.85037 17.0834 10.128 17.0834 10.4163C17.0834 15.833 15.4167 17.4997 10 17.4997C4.58335 17.4997 2.91669 15.833 2.91669 10.4163C2.91669 10.128 2.92138 9.85037 2.93113 9.58301",
|
|
@@ -1545,25 +892,25 @@ const se = (t) => {
|
|
|
1545
892
|
)
|
|
1546
893
|
}
|
|
1547
894
|
) }),
|
|
1548
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-preview-container", children: /* @__PURE__ */ l(
|
|
1549
896
|
"input",
|
|
1550
897
|
{
|
|
1551
898
|
className: "starasia-calendar-input",
|
|
1552
|
-
...
|
|
1553
|
-
disabled:
|
|
1554
|
-
value:
|
|
1555
|
-
ref:
|
|
899
|
+
...i,
|
|
900
|
+
disabled: t === "disable" ? !0 : i.disabled,
|
|
901
|
+
value: i.value,
|
|
902
|
+
ref: g
|
|
1556
903
|
}
|
|
1557
904
|
) }),
|
|
1558
|
-
/* @__PURE__ */
|
|
905
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-container-icon-right", children: /* @__PURE__ */ l(
|
|
1559
906
|
"svg",
|
|
1560
907
|
{
|
|
1561
908
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1562
|
-
width:
|
|
1563
|
-
height:
|
|
909
|
+
width: S(a),
|
|
910
|
+
height: S(a),
|
|
1564
911
|
viewBox: "0 0 20 20",
|
|
1565
912
|
fill: "none",
|
|
1566
|
-
children: /* @__PURE__ */
|
|
913
|
+
children: /* @__PURE__ */ l(
|
|
1567
914
|
"path",
|
|
1568
915
|
{
|
|
1569
916
|
d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
|
|
@@ -1578,312 +925,312 @@ const se = (t) => {
|
|
|
1578
925
|
]
|
|
1579
926
|
}
|
|
1580
927
|
);
|
|
1581
|
-
},
|
|
1582
|
-
date:
|
|
1583
|
-
setDate:
|
|
1584
|
-
previewDate:
|
|
1585
|
-
setPreviewDate:
|
|
1586
|
-
setIsComponentVisible:
|
|
1587
|
-
minDate:
|
|
1588
|
-
maxDate:
|
|
1589
|
-
input:
|
|
1590
|
-
onChange:
|
|
928
|
+
}, ta = ({
|
|
929
|
+
date: r,
|
|
930
|
+
setDate: a,
|
|
931
|
+
previewDate: t,
|
|
932
|
+
setPreviewDate: s,
|
|
933
|
+
setIsComponentVisible: i,
|
|
934
|
+
minDate: g,
|
|
935
|
+
maxDate: f,
|
|
936
|
+
input: v,
|
|
937
|
+
onChange: h
|
|
1591
938
|
}) => {
|
|
1592
|
-
let
|
|
1593
|
-
|
|
1594
|
-
|
|
939
|
+
let e = new Date(
|
|
940
|
+
t.getFullYear(),
|
|
941
|
+
t.getMonth(),
|
|
1595
942
|
1
|
|
1596
|
-
),
|
|
1597
|
-
const
|
|
1598
|
-
for (let
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
) :
|
|
1602
|
-
let
|
|
1603
|
-
currentMonth:
|
|
1604
|
-
date: new Date(
|
|
1605
|
-
month:
|
|
1606
|
-
number:
|
|
1607
|
-
selected:
|
|
1608
|
-
year:
|
|
1609
|
-
isDisabled:
|
|
943
|
+
), w = e.getDay(), b = [];
|
|
944
|
+
const k = r.toDateString(), M = t.getMonth();
|
|
945
|
+
for (let n = 0; n < 42; n++) {
|
|
946
|
+
n === 0 && w === 0 ? e.setDate(e.getDate() - 7) : n === 0 ? e.setDate(
|
|
947
|
+
e.getDate() + (n - w)
|
|
948
|
+
) : e.setDate(e.getDate() + 1);
|
|
949
|
+
let c = {
|
|
950
|
+
currentMonth: e.getMonth() === M,
|
|
951
|
+
date: new Date(e),
|
|
952
|
+
month: e.getMonth(),
|
|
953
|
+
number: e.getDate(),
|
|
954
|
+
selected: e.toDateString() === k,
|
|
955
|
+
year: e.getFullYear(),
|
|
956
|
+
isDisabled: g && e < g || f && e > f
|
|
1610
957
|
};
|
|
1611
|
-
|
|
958
|
+
b.push(c);
|
|
1612
959
|
}
|
|
1613
|
-
const
|
|
1614
|
-
(!
|
|
960
|
+
const u = (n) => {
|
|
961
|
+
(!g || n >= g) && (!f || n <= f) && (a(n), h(n), s(n), v && i(!1));
|
|
1615
962
|
};
|
|
1616
|
-
return /* @__PURE__ */
|
|
1617
|
-
/* @__PURE__ */
|
|
1618
|
-
/* @__PURE__ */
|
|
1619
|
-
const d =
|
|
1620
|
-
return /* @__PURE__ */
|
|
963
|
+
return /* @__PURE__ */ $("div", { className: "starasia-calendar-days-preivew", children: [
|
|
964
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-days-name-preivew", children: A.map((n, c) => /* @__PURE__ */ l("p", { children: n }, c)) }),
|
|
965
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-days-number-preivew", children: b.map((n, c) => {
|
|
966
|
+
const d = n.isDisabled;
|
|
967
|
+
return /* @__PURE__ */ l(
|
|
1621
968
|
"p",
|
|
1622
969
|
{
|
|
1623
|
-
className: `${
|
|
970
|
+
className: `${n.currentMonth ? "starasia-calendar-days-current" : "starasia-calendar-days"} ${n.selected ? "starasia-calendar-days-active" : ""}`,
|
|
1624
971
|
style: {
|
|
1625
972
|
color: d ? "#ccc" : void 0,
|
|
1626
973
|
pointerEvents: d ? "none" : void 0,
|
|
1627
974
|
cursor: d ? "not-allowed" : "pointer",
|
|
1628
|
-
...
|
|
975
|
+
...v ? {} : { width: "100%" }
|
|
1629
976
|
},
|
|
1630
977
|
onClick: () => {
|
|
1631
|
-
d ||
|
|
978
|
+
d || u(n.date);
|
|
1632
979
|
},
|
|
1633
|
-
children:
|
|
980
|
+
children: n.number
|
|
1634
981
|
},
|
|
1635
|
-
|
|
982
|
+
c
|
|
1636
983
|
);
|
|
1637
984
|
}) })
|
|
1638
985
|
] });
|
|
1639
|
-
},
|
|
1640
|
-
date:
|
|
1641
|
-
setDate:
|
|
1642
|
-
filter:
|
|
1643
|
-
setViews:
|
|
1644
|
-
onChange:
|
|
1645
|
-
previewDate:
|
|
1646
|
-
setPreviewDate:
|
|
1647
|
-
minDate:
|
|
1648
|
-
maxDate:
|
|
1649
|
-
input:
|
|
986
|
+
}, sa = ({
|
|
987
|
+
date: r,
|
|
988
|
+
setDate: a,
|
|
989
|
+
filter: t,
|
|
990
|
+
setViews: s,
|
|
991
|
+
onChange: i,
|
|
992
|
+
previewDate: g,
|
|
993
|
+
setPreviewDate: f,
|
|
994
|
+
minDate: v,
|
|
995
|
+
maxDate: h,
|
|
996
|
+
input: e
|
|
1650
997
|
}) => {
|
|
1651
|
-
const
|
|
1652
|
-
(!
|
|
998
|
+
const w = r.getMonth(), b = r.getFullYear(), k = g.getFullYear(), M = (u) => {
|
|
999
|
+
(!v || u >= v) && (!h || u <= h) && (t ? (i(u), a(u), f(u)) : (s("days"), f(u)));
|
|
1653
1000
|
};
|
|
1654
|
-
return /* @__PURE__ */
|
|
1655
|
-
const
|
|
1656
|
-
return /* @__PURE__ */
|
|
1001
|
+
return /* @__PURE__ */ l("div", { className: "starasia-calendar-months-preview", children: N.map((u, n) => {
|
|
1002
|
+
const c = v && new Date(k, n, 1) < v || h && new Date(k, n + 1, 0) > h;
|
|
1003
|
+
return /* @__PURE__ */ l(
|
|
1657
1004
|
"p",
|
|
1658
1005
|
{
|
|
1659
|
-
className:
|
|
1006
|
+
className: n === w && k === b ? "starasia-calendar-months-active" : "",
|
|
1660
1007
|
style: {
|
|
1661
|
-
color:
|
|
1662
|
-
pointerEvents:
|
|
1663
|
-
cursor:
|
|
1664
|
-
...
|
|
1008
|
+
color: c ? "#ccc" : void 0,
|
|
1009
|
+
pointerEvents: c ? "none" : void 0,
|
|
1010
|
+
cursor: c ? "not-allowed" : "pointer",
|
|
1011
|
+
...e ? {} : { width: "100%" }
|
|
1665
1012
|
},
|
|
1666
1013
|
onClick: () => {
|
|
1667
|
-
|
|
1014
|
+
c || M(new Date(k, n));
|
|
1668
1015
|
},
|
|
1669
|
-
children:
|
|
1016
|
+
children: u.slice(0, 3)
|
|
1670
1017
|
},
|
|
1671
|
-
|
|
1018
|
+
n
|
|
1672
1019
|
);
|
|
1673
1020
|
}) });
|
|
1674
|
-
},
|
|
1675
|
-
const
|
|
1676
|
-
return { start:
|
|
1677
|
-
},
|
|
1678
|
-
date:
|
|
1679
|
-
filter:
|
|
1680
|
-
setViews:
|
|
1681
|
-
setDate:
|
|
1682
|
-
onChange:
|
|
1683
|
-
previewDate:
|
|
1684
|
-
setPreviewDate:
|
|
1685
|
-
minDate:
|
|
1686
|
-
maxDate:
|
|
1687
|
-
input:
|
|
1021
|
+
}, V = (r) => {
|
|
1022
|
+
const a = Math.floor(r / 10) * 10, t = a + 10;
|
|
1023
|
+
return { start: a, end: t };
|
|
1024
|
+
}, ia = ({
|
|
1025
|
+
date: r,
|
|
1026
|
+
filter: a,
|
|
1027
|
+
setViews: t,
|
|
1028
|
+
setDate: s,
|
|
1029
|
+
onChange: i,
|
|
1030
|
+
previewDate: g,
|
|
1031
|
+
setPreviewDate: f,
|
|
1032
|
+
minDate: v,
|
|
1033
|
+
maxDate: h,
|
|
1034
|
+
input: e
|
|
1688
1035
|
}) => {
|
|
1689
|
-
let
|
|
1690
|
-
const
|
|
1691
|
-
for (let
|
|
1692
|
-
let d =
|
|
1693
|
-
|
|
1036
|
+
let w = [];
|
|
1037
|
+
const b = g.getFullYear(), { start: k, end: M } = V(b), u = r.getFullYear();
|
|
1038
|
+
for (let c = k; c < M; c++) {
|
|
1039
|
+
let d = v && new Date(c, 0, 1) < v || h && new Date(c, 11, 31) > h;
|
|
1040
|
+
w.push({ year: c, active: c === u, isDisabled: d });
|
|
1694
1041
|
}
|
|
1695
|
-
const
|
|
1696
|
-
(!
|
|
1042
|
+
const n = (c) => {
|
|
1043
|
+
(!v || c >= v) && (!h || c <= h) && (a ? (i(c), s(c), f(c)) : (t("months"), f(c)));
|
|
1697
1044
|
};
|
|
1698
|
-
return /* @__PURE__ */
|
|
1045
|
+
return /* @__PURE__ */ l("div", { className: "starasia-calendar-years-preview", children: w.map((c, d) => /* @__PURE__ */ l(
|
|
1699
1046
|
"p",
|
|
1700
1047
|
{
|
|
1701
|
-
className:
|
|
1048
|
+
className: c.active ? "starasia-calendar-months-active" : "",
|
|
1702
1049
|
style: {
|
|
1703
|
-
color:
|
|
1704
|
-
pointerEvents:
|
|
1705
|
-
cursor:
|
|
1706
|
-
...
|
|
1050
|
+
color: c.isDisabled ? "#ccc" : void 0,
|
|
1051
|
+
pointerEvents: c.isDisabled ? "none" : void 0,
|
|
1052
|
+
cursor: c.isDisabled ? "not-allowed" : "pointer",
|
|
1053
|
+
...e ? {} : { width: "100%" }
|
|
1707
1054
|
},
|
|
1708
1055
|
onClick: () => {
|
|
1709
|
-
|
|
1056
|
+
c.isDisabled || n(new Date(c.year, 0));
|
|
1710
1057
|
},
|
|
1711
|
-
children:
|
|
1058
|
+
children: c.year
|
|
1712
1059
|
},
|
|
1713
1060
|
d
|
|
1714
1061
|
)) });
|
|
1715
|
-
},
|
|
1716
|
-
setViews:
|
|
1717
|
-
views:
|
|
1718
|
-
filter:
|
|
1719
|
-
previewDate:
|
|
1720
|
-
setPreviewDate:
|
|
1062
|
+
}, oa = ({
|
|
1063
|
+
setViews: r,
|
|
1064
|
+
views: a,
|
|
1065
|
+
filter: t,
|
|
1066
|
+
previewDate: s,
|
|
1067
|
+
setPreviewDate: i
|
|
1721
1068
|
}) => {
|
|
1722
|
-
const
|
|
1723
|
-
|
|
1724
|
-
},
|
|
1725
|
-
if (
|
|
1726
|
-
|
|
1069
|
+
const g = () => {
|
|
1070
|
+
t || r((e) => e === "days" ? "months" : e === "months" ? "years" : "days");
|
|
1071
|
+
}, f = () => {
|
|
1072
|
+
if (a === "years") {
|
|
1073
|
+
i((e) => new Date(e.getFullYear() + 10, 0));
|
|
1727
1074
|
return;
|
|
1728
1075
|
}
|
|
1729
|
-
if (
|
|
1730
|
-
|
|
1731
|
-
(
|
|
1076
|
+
if (a === "months") {
|
|
1077
|
+
i(
|
|
1078
|
+
(e) => new Date(e.getFullYear() + 1, e.getMonth())
|
|
1732
1079
|
);
|
|
1733
1080
|
return;
|
|
1734
1081
|
}
|
|
1735
|
-
|
|
1736
|
-
},
|
|
1737
|
-
if (
|
|
1738
|
-
|
|
1082
|
+
i((e) => new Date(e.getFullYear(), e.getMonth() + 1));
|
|
1083
|
+
}, v = () => {
|
|
1084
|
+
if (a === "years") {
|
|
1085
|
+
i((e) => new Date(e.getFullYear() - 10, 0));
|
|
1739
1086
|
return;
|
|
1740
1087
|
}
|
|
1741
|
-
if (
|
|
1742
|
-
|
|
1743
|
-
(
|
|
1088
|
+
if (a === "months") {
|
|
1089
|
+
i(
|
|
1090
|
+
(e) => new Date(e.getFullYear() - 1, e.getMonth())
|
|
1744
1091
|
);
|
|
1745
1092
|
return;
|
|
1746
1093
|
}
|
|
1747
|
-
|
|
1748
|
-
(
|
|
1749
|
-
|
|
1750
|
-
|
|
1094
|
+
i(
|
|
1095
|
+
(e) => new Date(
|
|
1096
|
+
e.getMonth() === 0 ? e.getFullYear() - 1 : e.getFullYear(),
|
|
1097
|
+
e.getMonth() === 0 ? 11 : e.getMonth() - 1
|
|
1751
1098
|
)
|
|
1752
1099
|
);
|
|
1753
|
-
}, f = () => {
|
|
1754
|
-
if (n === "days")
|
|
1755
|
-
return `${U[i.getMonth()]} ${i.getFullYear()}`;
|
|
1756
|
-
if (n === "months")
|
|
1757
|
-
return `${i.getFullYear()}`;
|
|
1758
|
-
if (n === "years")
|
|
1759
|
-
return `${me(i.getFullYear()).start} ~ ${me(i.getFullYear()).end}`;
|
|
1760
1100
|
};
|
|
1761
|
-
return /* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
1764
|
-
|
|
1101
|
+
return /* @__PURE__ */ $("div", { className: "starasia-calendar-header", children: [
|
|
1102
|
+
/* @__PURE__ */ l(q, { onClick: () => v() }),
|
|
1103
|
+
/* @__PURE__ */ l("div", { style: { cursor: "pointer" }, onClick: g, children: (() => {
|
|
1104
|
+
if (a === "days")
|
|
1105
|
+
return `${N[s.getMonth()]} ${s.getFullYear()}`;
|
|
1106
|
+
if (a === "months")
|
|
1107
|
+
return `${s.getFullYear()}`;
|
|
1108
|
+
if (a === "years")
|
|
1109
|
+
return `${V(s.getFullYear()).start} ~ ${V(s.getFullYear()).end}`;
|
|
1110
|
+
})() }),
|
|
1111
|
+
/* @__PURE__ */ l(P, { onClick: () => f() })
|
|
1765
1112
|
] });
|
|
1766
|
-
},
|
|
1767
|
-
if (!document.getElementById(
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1113
|
+
}, H = "starasia-calendar-styles", la = (r) => {
|
|
1114
|
+
if (!document.getElementById(H)) {
|
|
1115
|
+
const a = document.createElement("style");
|
|
1116
|
+
a.id = H, a.textContent = r, document.head.appendChild(a);
|
|
1770
1117
|
}
|
|
1771
1118
|
};
|
|
1772
|
-
|
|
1773
|
-
const
|
|
1119
|
+
la(I);
|
|
1120
|
+
const ca = W(
|
|
1774
1121
|
({
|
|
1775
|
-
value:
|
|
1776
|
-
onChange:
|
|
1777
|
-
filter:
|
|
1778
|
-
input:
|
|
1779
|
-
disabled:
|
|
1780
|
-
minDate:
|
|
1781
|
-
maxDate:
|
|
1782
|
-
placeholder:
|
|
1783
|
-
size:
|
|
1784
|
-
status:
|
|
1785
|
-
},
|
|
1786
|
-
const { ref:
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
}, [
|
|
1790
|
-
|
|
1791
|
-
}, [
|
|
1792
|
-
|
|
1793
|
-
}, [
|
|
1794
|
-
|
|
1795
|
-
}, [
|
|
1796
|
-
const
|
|
1797
|
-
if (
|
|
1798
|
-
const
|
|
1799
|
-
window.innerWidth <
|
|
1122
|
+
value: r,
|
|
1123
|
+
onChange: a,
|
|
1124
|
+
filter: t,
|
|
1125
|
+
input: s = !0,
|
|
1126
|
+
disabled: i,
|
|
1127
|
+
minDate: g,
|
|
1128
|
+
maxDate: f,
|
|
1129
|
+
placeholder: v,
|
|
1130
|
+
size: h,
|
|
1131
|
+
status: e
|
|
1132
|
+
}, w) => {
|
|
1133
|
+
const { ref: b, isComponentVisible: k, setIsComponentVisible: M } = J(!1), u = E(null), [n, c] = F("days"), [d, y] = F(/* @__PURE__ */ new Date()), [o, p] = F(/* @__PURE__ */ new Date());
|
|
1134
|
+
D(() => {
|
|
1135
|
+
r ? (y(r), p(r)) : (y(/* @__PURE__ */ new Date()), p(/* @__PURE__ */ new Date()));
|
|
1136
|
+
}, [r]), D(() => {
|
|
1137
|
+
t && c(t);
|
|
1138
|
+
}, [t]), D(() => {
|
|
1139
|
+
t || c("days");
|
|
1140
|
+
}, [k]), D(() => {
|
|
1141
|
+
s || M(!0);
|
|
1142
|
+
}, [s]);
|
|
1143
|
+
const C = () => r ? t === "days" ? L(d) : t === "months" ? `${N[d.getMonth()]} ${d.getFullYear()}` : t === "years" ? d.getFullYear() : L(d) : "", x = () => {
|
|
1144
|
+
if (u.current && b.current && s) {
|
|
1145
|
+
const m = b.current.getBoundingClientRect(), Y = u.current.getBoundingClientRect();
|
|
1146
|
+
window.innerWidth < m.left + Y.width ? u.current.style.left = `${m.left - Y.width + m.width}px` : u.current.style.left = `${m.left}px`, m.top + Y.height > window.innerHeight ? u.current.style.top = `${m.y - (m.height + Y.height - 28)}px` : u.current.style.top = `${m.y + m.height}px`;
|
|
1800
1147
|
}
|
|
1801
1148
|
};
|
|
1802
|
-
return
|
|
1803
|
-
|
|
1804
|
-
}, [
|
|
1805
|
-
const
|
|
1806
|
-
return
|
|
1807
|
-
|
|
1149
|
+
return D(() => {
|
|
1150
|
+
u.current && b.current && s && x();
|
|
1151
|
+
}, [u, b, k]), D(() => {
|
|
1152
|
+
const m = w == null ? void 0 : w.current;
|
|
1153
|
+
return m && m.addEventListener("scroll", x), window.addEventListener("scroll", x), () => {
|
|
1154
|
+
m && m.removeEventListener("scroll", x), window.removeEventListener("scroll", x);
|
|
1808
1155
|
};
|
|
1809
|
-
}, []), /* @__PURE__ */
|
|
1156
|
+
}, []), /* @__PURE__ */ $(
|
|
1810
1157
|
"div",
|
|
1811
1158
|
{
|
|
1812
1159
|
className: "starasia-calendar-wrapper",
|
|
1813
|
-
style: { height:
|
|
1814
|
-
ref:
|
|
1160
|
+
style: { height: s ? "auto" : "100%" },
|
|
1161
|
+
ref: s ? b : null,
|
|
1815
1162
|
children: [
|
|
1816
|
-
|
|
1817
|
-
|
|
1163
|
+
s ? /* @__PURE__ */ l(
|
|
1164
|
+
na,
|
|
1818
1165
|
{
|
|
1819
|
-
value:
|
|
1820
|
-
onClick: () =>
|
|
1166
|
+
value: C(),
|
|
1167
|
+
onClick: () => M(!0),
|
|
1821
1168
|
onChange: () => {
|
|
1822
1169
|
},
|
|
1823
|
-
placeholder:
|
|
1824
|
-
disabled:
|
|
1825
|
-
size:
|
|
1826
|
-
status:
|
|
1170
|
+
placeholder: v,
|
|
1171
|
+
disabled: i,
|
|
1172
|
+
size: h,
|
|
1173
|
+
status: e,
|
|
1827
1174
|
inputMode: "none"
|
|
1828
1175
|
}
|
|
1829
1176
|
) : null,
|
|
1830
|
-
|
|
1177
|
+
k ? /* @__PURE__ */ $(
|
|
1831
1178
|
"div",
|
|
1832
1179
|
{
|
|
1833
|
-
className: `starasia-calendar ${
|
|
1834
|
-
ref:
|
|
1180
|
+
className: `starasia-calendar ${s ? "" : "starasia-calendar-no-input"}`,
|
|
1181
|
+
ref: u,
|
|
1835
1182
|
children: [
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
|
|
1183
|
+
/* @__PURE__ */ l(
|
|
1184
|
+
oa,
|
|
1838
1185
|
{
|
|
1839
|
-
setViews:
|
|
1840
|
-
views:
|
|
1841
|
-
filter:
|
|
1842
|
-
previewDate:
|
|
1843
|
-
setPreviewDate:
|
|
1844
|
-
isComponentVisible:
|
|
1186
|
+
setViews: c,
|
|
1187
|
+
views: n,
|
|
1188
|
+
filter: t,
|
|
1189
|
+
previewDate: o,
|
|
1190
|
+
setPreviewDate: p,
|
|
1191
|
+
isComponentVisible: k
|
|
1845
1192
|
}
|
|
1846
1193
|
),
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
|
|
1194
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-body", children: n === "days" ? /* @__PURE__ */ l(
|
|
1195
|
+
ta,
|
|
1849
1196
|
{
|
|
1850
1197
|
date: d,
|
|
1851
|
-
setDate:
|
|
1852
|
-
previewDate:
|
|
1853
|
-
setPreviewDate:
|
|
1854
|
-
setIsComponentVisible:
|
|
1855
|
-
input:
|
|
1856
|
-
minDate:
|
|
1857
|
-
maxDate:
|
|
1858
|
-
onChange:
|
|
1198
|
+
setDate: y,
|
|
1199
|
+
previewDate: o,
|
|
1200
|
+
setPreviewDate: p,
|
|
1201
|
+
setIsComponentVisible: M,
|
|
1202
|
+
input: s,
|
|
1203
|
+
minDate: g,
|
|
1204
|
+
maxDate: f,
|
|
1205
|
+
onChange: a
|
|
1859
1206
|
}
|
|
1860
|
-
) :
|
|
1861
|
-
|
|
1207
|
+
) : n === "months" ? /* @__PURE__ */ l(
|
|
1208
|
+
sa,
|
|
1862
1209
|
{
|
|
1863
1210
|
date: d,
|
|
1864
|
-
setDate:
|
|
1865
|
-
previewDate:
|
|
1866
|
-
setPreviewDate:
|
|
1867
|
-
filter:
|
|
1868
|
-
setViews:
|
|
1869
|
-
onChange:
|
|
1870
|
-
minDate:
|
|
1871
|
-
maxDate:
|
|
1872
|
-
input:
|
|
1211
|
+
setDate: y,
|
|
1212
|
+
previewDate: o,
|
|
1213
|
+
setPreviewDate: p,
|
|
1214
|
+
filter: t,
|
|
1215
|
+
setViews: c,
|
|
1216
|
+
onChange: a,
|
|
1217
|
+
minDate: g,
|
|
1218
|
+
maxDate: f,
|
|
1219
|
+
input: s
|
|
1873
1220
|
}
|
|
1874
|
-
) : /* @__PURE__ */
|
|
1875
|
-
|
|
1221
|
+
) : /* @__PURE__ */ l(
|
|
1222
|
+
ia,
|
|
1876
1223
|
{
|
|
1877
1224
|
date: d,
|
|
1878
|
-
setDate:
|
|
1879
|
-
previewDate:
|
|
1880
|
-
setPreviewDate:
|
|
1881
|
-
filter:
|
|
1882
|
-
setViews:
|
|
1883
|
-
onChange:
|
|
1884
|
-
minDate:
|
|
1885
|
-
maxDate:
|
|
1886
|
-
input:
|
|
1225
|
+
setDate: y,
|
|
1226
|
+
previewDate: o,
|
|
1227
|
+
setPreviewDate: p,
|
|
1228
|
+
filter: t,
|
|
1229
|
+
setViews: c,
|
|
1230
|
+
onChange: a,
|
|
1231
|
+
minDate: g,
|
|
1232
|
+
maxDate: f,
|
|
1233
|
+
input: s
|
|
1887
1234
|
}
|
|
1888
1235
|
) })
|
|
1889
1236
|
]
|
|
@@ -1893,51 +1240,51 @@ const Hr = be(
|
|
|
1893
1240
|
}
|
|
1894
1241
|
);
|
|
1895
1242
|
}
|
|
1896
|
-
),
|
|
1243
|
+
), ha = W(
|
|
1897
1244
|
({
|
|
1898
|
-
value:
|
|
1899
|
-
onChange:
|
|
1900
|
-
filter:
|
|
1901
|
-
input:
|
|
1902
|
-
rangedDate:
|
|
1903
|
-
disabled:
|
|
1904
|
-
minDate:
|
|
1905
|
-
maxDate:
|
|
1906
|
-
placeholder:
|
|
1907
|
-
size:
|
|
1908
|
-
status:
|
|
1909
|
-
},
|
|
1910
|
-
|
|
1245
|
+
value: r,
|
|
1246
|
+
onChange: a,
|
|
1247
|
+
filter: t,
|
|
1248
|
+
input: s = !0,
|
|
1249
|
+
rangedDate: i,
|
|
1250
|
+
disabled: g,
|
|
1251
|
+
minDate: f,
|
|
1252
|
+
maxDate: v,
|
|
1253
|
+
placeholder: h,
|
|
1254
|
+
size: e,
|
|
1255
|
+
status: w
|
|
1256
|
+
}, b) => /* @__PURE__ */ l(R, { children: i ? /* @__PURE__ */ l(
|
|
1257
|
+
ea,
|
|
1911
1258
|
{
|
|
1912
|
-
onChange:
|
|
1913
|
-
value:
|
|
1914
|
-
input:
|
|
1915
|
-
filter:
|
|
1916
|
-
disabled:
|
|
1917
|
-
ref:
|
|
1918
|
-
minDate:
|
|
1919
|
-
maxDate:
|
|
1920
|
-
placeholder:
|
|
1921
|
-
size:
|
|
1922
|
-
status:
|
|
1259
|
+
onChange: a,
|
|
1260
|
+
value: r,
|
|
1261
|
+
input: s,
|
|
1262
|
+
filter: t,
|
|
1263
|
+
disabled: g,
|
|
1264
|
+
ref: b,
|
|
1265
|
+
minDate: f,
|
|
1266
|
+
maxDate: v,
|
|
1267
|
+
placeholder: h,
|
|
1268
|
+
size: e,
|
|
1269
|
+
status: w
|
|
1923
1270
|
}
|
|
1924
|
-
) : /* @__PURE__ */
|
|
1925
|
-
|
|
1271
|
+
) : /* @__PURE__ */ l(
|
|
1272
|
+
ca,
|
|
1926
1273
|
{
|
|
1927
|
-
onChange:
|
|
1928
|
-
value:
|
|
1929
|
-
input:
|
|
1930
|
-
filter:
|
|
1931
|
-
disabled:
|
|
1932
|
-
ref:
|
|
1933
|
-
minDate:
|
|
1934
|
-
maxDate:
|
|
1935
|
-
placeholder:
|
|
1936
|
-
size:
|
|
1937
|
-
status:
|
|
1274
|
+
onChange: a,
|
|
1275
|
+
value: r,
|
|
1276
|
+
input: s,
|
|
1277
|
+
filter: t,
|
|
1278
|
+
disabled: g,
|
|
1279
|
+
ref: b,
|
|
1280
|
+
minDate: f,
|
|
1281
|
+
maxDate: v,
|
|
1282
|
+
placeholder: h,
|
|
1283
|
+
size: e,
|
|
1284
|
+
status: w
|
|
1938
1285
|
}
|
|
1939
1286
|
) })
|
|
1940
1287
|
);
|
|
1941
1288
|
export {
|
|
1942
|
-
|
|
1289
|
+
ha as StarasiaDate
|
|
1943
1290
|
};
|