@starasia/date 1.0.1 → 1.0.2
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 +596 -1237
- package/dist/date.umd.js +2 -33
- package/package.json +6 -6
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;
|
|
@@ -974,7 +333,7 @@ const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,w
|
|
|
974
333
|
.starasia-calendar-input-container-warning {
|
|
975
334
|
border-color: var(--starasia-ui-input-color-secondary-yellow) !important;
|
|
976
335
|
}
|
|
977
|
-
`,
|
|
336
|
+
`, A = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], N = [
|
|
978
337
|
"January",
|
|
979
338
|
"February",
|
|
980
339
|
"March",
|
|
@@ -987,7 +346,7 @@ const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,w
|
|
|
987
346
|
"October",
|
|
988
347
|
"November",
|
|
989
348
|
"December"
|
|
990
|
-
],
|
|
349
|
+
], G = [
|
|
991
350
|
"Jan",
|
|
992
351
|
"Feb",
|
|
993
352
|
"Mar",
|
|
@@ -1001,47 +360,47 @@ const ie = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,w
|
|
|
1001
360
|
"Nov",
|
|
1002
361
|
"Dec"
|
|
1003
362
|
];
|
|
1004
|
-
function
|
|
1005
|
-
const [
|
|
1006
|
-
|
|
363
|
+
function J(n) {
|
|
364
|
+
const [a, t] = F(n), s = E(null), i = (g) => {
|
|
365
|
+
s.current && !s.current.contains(g.target) && t(!1);
|
|
1007
366
|
};
|
|
1008
|
-
return
|
|
1009
|
-
document.removeEventListener("click",
|
|
1010
|
-
}), []), { ref:
|
|
367
|
+
return D(() => (document.addEventListener("click", i, !0), () => {
|
|
368
|
+
document.removeEventListener("click", i, !0);
|
|
369
|
+
}), []), { ref: s, isComponentVisible: a, setIsComponentVisible: t };
|
|
1011
370
|
}
|
|
1012
|
-
const
|
|
1013
|
-
if (!document.getElementById(
|
|
1014
|
-
const
|
|
1015
|
-
|
|
371
|
+
const j = "starasia-calendar-input-styles", U = (n) => {
|
|
372
|
+
if (!document.getElementById(j)) {
|
|
373
|
+
const a = document.createElement("style");
|
|
374
|
+
a.id = j, a.textContent = n, document.head.appendChild(a);
|
|
1016
375
|
}
|
|
1017
376
|
};
|
|
1018
|
-
|
|
1019
|
-
const
|
|
1020
|
-
if (
|
|
377
|
+
U(I);
|
|
378
|
+
const T = (n) => {
|
|
379
|
+
if (n === "sm")
|
|
1021
380
|
return 16;
|
|
1022
|
-
if (
|
|
381
|
+
if (n === "md")
|
|
1023
382
|
return 16;
|
|
1024
|
-
if (
|
|
383
|
+
if (n === "lg")
|
|
1025
384
|
return 20;
|
|
1026
|
-
},
|
|
1027
|
-
const { size:
|
|
1028
|
-
|
|
385
|
+
}, K = (n) => {
|
|
386
|
+
const { size: a = "md", status: t = "default", variant: s = "outline", ...i } = n, g = E(null), f = () => {
|
|
387
|
+
g.current && i.onClick && (g.current.focus(), i.onClick(""));
|
|
1029
388
|
};
|
|
1030
|
-
return /* @__PURE__ */
|
|
389
|
+
return /* @__PURE__ */ $(
|
|
1031
390
|
"div",
|
|
1032
391
|
{
|
|
1033
|
-
className: `starasia-calendar-input-container starasia-calendar-input-${
|
|
1034
|
-
onClick:
|
|
392
|
+
className: `starasia-calendar-input-container starasia-calendar-input-${s} starasia-calendar-input-container-${t} ${a} `,
|
|
393
|
+
onClick: f,
|
|
1035
394
|
children: [
|
|
1036
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-container-icon-left", children: /* @__PURE__ */ l(
|
|
1037
396
|
"svg",
|
|
1038
397
|
{
|
|
1039
398
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1040
|
-
width:
|
|
1041
|
-
height:
|
|
399
|
+
width: T(a),
|
|
400
|
+
height: T(a),
|
|
1042
401
|
viewBox: "0 0 20 20",
|
|
1043
402
|
fill: "none",
|
|
1044
|
-
children: /* @__PURE__ */
|
|
403
|
+
children: /* @__PURE__ */ l(
|
|
1045
404
|
"path",
|
|
1046
405
|
{
|
|
1047
406
|
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 +412,25 @@ const te = (t) => {
|
|
|
1053
412
|
)
|
|
1054
413
|
}
|
|
1055
414
|
) }),
|
|
1056
|
-
/* @__PURE__ */
|
|
415
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-preview-container", children: /* @__PURE__ */ l(
|
|
1057
416
|
"input",
|
|
1058
417
|
{
|
|
1059
418
|
className: "starasia-calendar-input",
|
|
1060
|
-
...
|
|
1061
|
-
disabled:
|
|
1062
|
-
value:
|
|
1063
|
-
ref:
|
|
419
|
+
...i,
|
|
420
|
+
disabled: t === "disable" ? !0 : i.disabled,
|
|
421
|
+
value: i.value,
|
|
422
|
+
ref: g
|
|
1064
423
|
}
|
|
1065
424
|
) }),
|
|
1066
|
-
/* @__PURE__ */
|
|
425
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-container-icon-right", children: /* @__PURE__ */ l(
|
|
1067
426
|
"svg",
|
|
1068
427
|
{
|
|
1069
428
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1070
|
-
width:
|
|
1071
|
-
height:
|
|
429
|
+
width: T(a),
|
|
430
|
+
height: T(a),
|
|
1072
431
|
viewBox: "0 0 20 20",
|
|
1073
432
|
fill: "none",
|
|
1074
|
-
children: /* @__PURE__ */
|
|
433
|
+
children: /* @__PURE__ */ l(
|
|
1075
434
|
"path",
|
|
1076
435
|
{
|
|
1077
436
|
d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
|
|
@@ -1086,178 +445,178 @@ const te = (t) => {
|
|
|
1086
445
|
]
|
|
1087
446
|
}
|
|
1088
447
|
);
|
|
1089
|
-
},
|
|
1090
|
-
date:
|
|
1091
|
-
setDate:
|
|
1092
|
-
dateRange:
|
|
1093
|
-
setDateRange:
|
|
1094
|
-
onChange:
|
|
1095
|
-
minDate:
|
|
1096
|
-
maxDate:
|
|
1097
|
-
input:
|
|
448
|
+
}, Q = ({
|
|
449
|
+
date: n,
|
|
450
|
+
setDate: a,
|
|
451
|
+
dateRange: t,
|
|
452
|
+
setDateRange: s,
|
|
453
|
+
onChange: i,
|
|
454
|
+
minDate: g,
|
|
455
|
+
maxDate: f,
|
|
456
|
+
input: v
|
|
1098
457
|
}) => {
|
|
1099
|
-
var
|
|
1100
|
-
let
|
|
1101
|
-
const
|
|
458
|
+
var u, r, c;
|
|
459
|
+
let h = new Date(n.getFullYear(), n.getMonth(), 1), e = h.getDay(), w = [];
|
|
460
|
+
const b = n.getMonth();
|
|
1102
461
|
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:
|
|
462
|
+
d === 0 && e === 0 ? h.setDate(h.getDate() - 7) : d === 0 ? h.setDate(
|
|
463
|
+
h.getDate() + (d - e)
|
|
464
|
+
) : h.setDate(h.getDate() + 1);
|
|
465
|
+
let y = {
|
|
466
|
+
currentMonth: h.getMonth() === b,
|
|
467
|
+
date: new Date(h),
|
|
468
|
+
month: h.getMonth(),
|
|
469
|
+
number: h.getDate(),
|
|
470
|
+
selected: h.toDateString() === ((u = t.from) == null ? void 0 : u.toDateString()) || h.toDateString() === (((r = t.to) == null ? void 0 : r.toDateString()) || ((c = t.from) == null ? void 0 : c.toDateString())),
|
|
471
|
+
year: h.getFullYear(),
|
|
472
|
+
isDisabled: g && h < g || f && h > f
|
|
1114
473
|
};
|
|
1115
|
-
|
|
474
|
+
w.push(y);
|
|
1116
475
|
}
|
|
1117
|
-
const
|
|
1118
|
-
|
|
1119
|
-
},
|
|
1120
|
-
var
|
|
1121
|
-
let
|
|
1122
|
-
if (
|
|
1123
|
-
|
|
476
|
+
const k = (d) => {
|
|
477
|
+
a(d);
|
|
478
|
+
}, M = (d) => {
|
|
479
|
+
var o;
|
|
480
|
+
let y = { ...t };
|
|
481
|
+
if (y.from && y.to)
|
|
482
|
+
y = { from: d, to: null };
|
|
1124
483
|
else {
|
|
1125
|
-
const
|
|
1126
|
-
d.getTime() >
|
|
484
|
+
const p = ((o = y.from) == null ? void 0 : o.getTime()) || 0;
|
|
485
|
+
d.getTime() > p ? y = { from: y.from, to: d } : y = { from: d, to: y.from };
|
|
1127
486
|
}
|
|
1128
|
-
|
|
487
|
+
s(y), i(y);
|
|
1129
488
|
};
|
|
1130
|
-
return /* @__PURE__ */
|
|
1131
|
-
/* @__PURE__ */
|
|
1132
|
-
/* @__PURE__ */
|
|
1133
|
-
var
|
|
1134
|
-
const
|
|
1135
|
-
return /* @__PURE__ */
|
|
489
|
+
return /* @__PURE__ */ $("div", { className: "starasia-calendar-days-preivew", children: [
|
|
490
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-days-name-preivew", children: A.map((d, y) => /* @__PURE__ */ l("p", { children: d }, y)) }),
|
|
491
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-days-number-preivew", children: w.map((d, y) => {
|
|
492
|
+
var C;
|
|
493
|
+
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;
|
|
494
|
+
return /* @__PURE__ */ l(
|
|
1136
495
|
"p",
|
|
1137
496
|
{
|
|
1138
497
|
className: `${d.currentMonth ? "starasia-calendar-days-current" : "starasia-calendar-days"} ${d.selected ? "starasia-calendar-days-active" : ""}`,
|
|
1139
498
|
style: {
|
|
1140
|
-
backgroundColor:
|
|
1141
|
-
pointerEvents:
|
|
1142
|
-
cursor:
|
|
1143
|
-
color:
|
|
1144
|
-
...
|
|
499
|
+
backgroundColor: o ? "rgba(100, 181, 246, 0.1)" : "",
|
|
500
|
+
pointerEvents: p ? "none" : void 0,
|
|
501
|
+
cursor: p ? "not-allowed" : "pointer",
|
|
502
|
+
color: p ? "#ccc" : o ? "#b0b0b0" : "",
|
|
503
|
+
...v ? {} : { width: "100%" }
|
|
1145
504
|
},
|
|
1146
505
|
onClick: () => {
|
|
1147
|
-
|
|
506
|
+
p || (k(d.date), M(d.date));
|
|
1148
507
|
},
|
|
1149
508
|
children: d.number
|
|
1150
509
|
},
|
|
1151
|
-
|
|
510
|
+
y
|
|
1152
511
|
);
|
|
1153
512
|
}) })
|
|
1154
513
|
] });
|
|
1155
|
-
},
|
|
1156
|
-
date:
|
|
1157
|
-
setDate:
|
|
1158
|
-
filter:
|
|
1159
|
-
setViews:
|
|
1160
|
-
dateRange:
|
|
1161
|
-
setDateRange:
|
|
1162
|
-
onChange:
|
|
1163
|
-
minDate:
|
|
1164
|
-
maxDate:
|
|
1165
|
-
input:
|
|
514
|
+
}, X = ({
|
|
515
|
+
date: n,
|
|
516
|
+
setDate: a,
|
|
517
|
+
filter: t,
|
|
518
|
+
setViews: s,
|
|
519
|
+
dateRange: i,
|
|
520
|
+
setDateRange: g,
|
|
521
|
+
onChange: f,
|
|
522
|
+
minDate: v,
|
|
523
|
+
maxDate: h,
|
|
524
|
+
input: e
|
|
1166
525
|
}) => {
|
|
1167
|
-
const
|
|
1168
|
-
|
|
1169
|
-
},
|
|
1170
|
-
var
|
|
1171
|
-
let
|
|
1172
|
-
if (
|
|
1173
|
-
|
|
526
|
+
const w = i.from.getFullYear(), b = n.getFullYear(), k = (u) => {
|
|
527
|
+
t ? (M(u), a(u)) : (s("days"), a(u));
|
|
528
|
+
}, M = (u) => {
|
|
529
|
+
var c;
|
|
530
|
+
let r = { ...i };
|
|
531
|
+
if (r.from && r.to)
|
|
532
|
+
r = { from: u, to: null };
|
|
1174
533
|
else {
|
|
1175
|
-
const d = ((
|
|
1176
|
-
|
|
534
|
+
const d = ((c = r.from) == null ? void 0 : c.getTime()) || 0;
|
|
535
|
+
u.getTime() > d ? r = { from: r.from, to: u } : r = { from: u, to: r.from };
|
|
1177
536
|
}
|
|
1178
|
-
|
|
537
|
+
g(r), f(r);
|
|
1179
538
|
};
|
|
1180
|
-
return /* @__PURE__ */
|
|
1181
|
-
var
|
|
1182
|
-
const
|
|
1183
|
-
return /* @__PURE__ */
|
|
539
|
+
return /* @__PURE__ */ l("div", { className: "starasia-calendar-months-preview", children: N.map((u, r) => {
|
|
540
|
+
var y, o, p;
|
|
541
|
+
const c = new Date(b, r).getTime() > i.from.getTime() && new Date(b, r).getTime() < (((y = i.to) == null ? void 0 : y.getTime()) || i.from.getTime()), d = v && new Date(b, r) < v || h && new Date(b, r) > h;
|
|
542
|
+
return /* @__PURE__ */ l(
|
|
1184
543
|
"p",
|
|
1185
544
|
{
|
|
1186
|
-
className:
|
|
545
|
+
className: w === b && (r === ((o = i.from) == null ? void 0 : o.getMonth()) || r === ((p = i.to) == null ? void 0 : p.getMonth())) ? "starasia-calendar-months-active" : "",
|
|
1187
546
|
style: {
|
|
1188
|
-
backgroundColor:
|
|
547
|
+
backgroundColor: c ? "rgba(100, 181, 246, 0.1)" : "",
|
|
1189
548
|
pointerEvents: d ? "none" : void 0,
|
|
1190
549
|
cursor: d ? "not-allowed" : "pointer",
|
|
1191
|
-
color: d ? "#ccc" :
|
|
1192
|
-
...
|
|
550
|
+
color: d ? "#ccc" : c ? "#b0b0b0" : "",
|
|
551
|
+
...e ? {} : { width: "100%" }
|
|
1193
552
|
},
|
|
1194
553
|
onClick: () => {
|
|
1195
|
-
d ||
|
|
554
|
+
d || k(new Date(b, r));
|
|
1196
555
|
},
|
|
1197
|
-
children:
|
|
556
|
+
children: u.slice(0, 3)
|
|
1198
557
|
},
|
|
1199
|
-
|
|
558
|
+
r
|
|
1200
559
|
);
|
|
1201
560
|
}) });
|
|
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:
|
|
561
|
+
}, B = (n) => {
|
|
562
|
+
const a = Math.floor(n / 10) * 10, t = a + 10;
|
|
563
|
+
return { start: a, end: t };
|
|
564
|
+
}, Z = ({
|
|
565
|
+
date: n,
|
|
566
|
+
filter: a,
|
|
567
|
+
setViews: t,
|
|
568
|
+
setDate: s,
|
|
569
|
+
dateRange: i,
|
|
570
|
+
setDateRange: g,
|
|
571
|
+
onChange: f,
|
|
572
|
+
minDate: v,
|
|
573
|
+
maxDate: h,
|
|
574
|
+
input: e
|
|
1216
575
|
}) => {
|
|
1217
|
-
var
|
|
1218
|
-
let
|
|
1219
|
-
const
|
|
1220
|
-
for (let
|
|
1221
|
-
const
|
|
1222
|
-
|
|
1223
|
-
year:
|
|
1224
|
-
active:
|
|
1225
|
-
highlight:
|
|
1226
|
-
disabled: !
|
|
576
|
+
var y;
|
|
577
|
+
let w = [];
|
|
578
|
+
const b = n.getFullYear(), { start: k, end: M } = B(b), u = i.from.getFullYear(), r = (y = i.to) == null ? void 0 : y.getFullYear();
|
|
579
|
+
for (let o = k; o < M; o++) {
|
|
580
|
+
const p = new Date(o, 0), C = (!v || p >= v) && (!h || p <= h), x = o === u || o === r, m = p > i.from && p < i.to;
|
|
581
|
+
w.push({
|
|
582
|
+
year: o,
|
|
583
|
+
active: x && C,
|
|
584
|
+
highlight: m && C,
|
|
585
|
+
disabled: !C
|
|
1227
586
|
});
|
|
1228
587
|
}
|
|
1229
|
-
const
|
|
1230
|
-
|
|
1231
|
-
}, d = (
|
|
1232
|
-
var
|
|
1233
|
-
let
|
|
1234
|
-
if (
|
|
1235
|
-
|
|
588
|
+
const c = (o) => {
|
|
589
|
+
a ? (d(o), s(o)) : (s(o), t("months"));
|
|
590
|
+
}, d = (o) => {
|
|
591
|
+
var C;
|
|
592
|
+
let p = { ...i };
|
|
593
|
+
if (p.from && p.to)
|
|
594
|
+
p = { from: o, to: null };
|
|
1236
595
|
else {
|
|
1237
|
-
const
|
|
1238
|
-
|
|
596
|
+
const x = ((C = p.from) == null ? void 0 : C.getTime()) || 0;
|
|
597
|
+
o.getTime() > x ? p = { from: p.from, to: o } : p = { from: o, to: p.from };
|
|
1239
598
|
}
|
|
1240
|
-
|
|
599
|
+
g(p), f(p);
|
|
1241
600
|
};
|
|
1242
|
-
return /* @__PURE__ */
|
|
601
|
+
return /* @__PURE__ */ l("div", { className: "starasia-calendar-years-preview", children: w.map((o, p) => /* @__PURE__ */ l(
|
|
1243
602
|
"p",
|
|
1244
603
|
{
|
|
1245
|
-
className: `${
|
|
604
|
+
className: `${o.active ? "starasia-calendar-months-active" : ""} ${o.highlight ? "starasia-calendar-months-highlight" : ""} ${o.disabled ? "starasia-calendar-disabled" : ""}`,
|
|
1246
605
|
onClick: () => {
|
|
1247
|
-
|
|
606
|
+
o.disabled || c(new Date(o.year, 0));
|
|
1248
607
|
},
|
|
1249
608
|
style: {
|
|
1250
|
-
backgroundColor:
|
|
1251
|
-
color:
|
|
1252
|
-
cursor:
|
|
1253
|
-
pointerEvents:
|
|
1254
|
-
...
|
|
609
|
+
backgroundColor: o.highlight ? "rgba(100, 181, 246, 0.1)" : "",
|
|
610
|
+
color: o.highlight ? "#b0b0b0" : o.active ? "" : o.disabled ? "#ccc" : "",
|
|
611
|
+
cursor: o.disabled ? "not-allowed" : "pointer",
|
|
612
|
+
pointerEvents: o.disbled ? "none" : "all",
|
|
613
|
+
...e ? {} : { width: "100%" }
|
|
1255
614
|
},
|
|
1256
|
-
children:
|
|
615
|
+
children: o.year
|
|
1257
616
|
},
|
|
1258
|
-
|
|
617
|
+
p
|
|
1259
618
|
)) });
|
|
1260
|
-
},
|
|
619
|
+
}, q = ({ ...n }) => /* @__PURE__ */ l(
|
|
1261
620
|
"svg",
|
|
1262
621
|
{
|
|
1263
622
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1265,8 +624,8 @@ const te = (t) => {
|
|
|
1265
624
|
height: "20",
|
|
1266
625
|
viewBox: "0 0 20 20",
|
|
1267
626
|
fill: "none",
|
|
1268
|
-
...
|
|
1269
|
-
children: /* @__PURE__ */
|
|
627
|
+
...n,
|
|
628
|
+
children: /* @__PURE__ */ l(
|
|
1270
629
|
"path",
|
|
1271
630
|
{
|
|
1272
631
|
d: "M12.5 3.33334L5.83337 10L12.5 16.6667",
|
|
@@ -1277,7 +636,7 @@ const te = (t) => {
|
|
|
1277
636
|
}
|
|
1278
637
|
)
|
|
1279
638
|
}
|
|
1280
|
-
),
|
|
639
|
+
), P = ({ ...n }) => /* @__PURE__ */ l(
|
|
1281
640
|
"svg",
|
|
1282
641
|
{
|
|
1283
642
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -1285,8 +644,8 @@ const te = (t) => {
|
|
|
1285
644
|
height: "20",
|
|
1286
645
|
viewBox: "0 0 20 20",
|
|
1287
646
|
fill: "none",
|
|
1288
|
-
...
|
|
1289
|
-
children: /* @__PURE__ */
|
|
647
|
+
...n,
|
|
648
|
+
children: /* @__PURE__ */ l(
|
|
1290
649
|
"path",
|
|
1291
650
|
{
|
|
1292
651
|
d: "M7.5 16.6667L14.1667 10L7.5 3.33334",
|
|
@@ -1297,201 +656,201 @@ const te = (t) => {
|
|
|
1297
656
|
}
|
|
1298
657
|
)
|
|
1299
658
|
}
|
|
1300
|
-
),
|
|
1301
|
-
setViews:
|
|
1302
|
-
views:
|
|
1303
|
-
filter:
|
|
1304
|
-
date:
|
|
1305
|
-
setDate:
|
|
659
|
+
), _ = ({
|
|
660
|
+
setViews: n,
|
|
661
|
+
views: a,
|
|
662
|
+
filter: t,
|
|
663
|
+
date: s,
|
|
664
|
+
setDate: i
|
|
1306
665
|
}) => {
|
|
1307
|
-
const
|
|
1308
|
-
|
|
1309
|
-
},
|
|
1310
|
-
if (
|
|
1311
|
-
|
|
666
|
+
const g = () => {
|
|
667
|
+
t || n((e) => e === "days" ? "months" : e === "months" ? "years" : "days");
|
|
668
|
+
}, f = () => {
|
|
669
|
+
if (a === "years") {
|
|
670
|
+
i((e) => new Date(e.getFullYear() + 10, 0));
|
|
1312
671
|
return;
|
|
1313
672
|
}
|
|
1314
|
-
if (
|
|
1315
|
-
|
|
673
|
+
if (a === "months") {
|
|
674
|
+
i((e) => new Date(e.getFullYear() + 1, e.getMonth()));
|
|
1316
675
|
return;
|
|
1317
676
|
}
|
|
1318
|
-
|
|
1319
|
-
},
|
|
1320
|
-
if (
|
|
1321
|
-
|
|
677
|
+
i((e) => new Date(e.getFullYear(), e.getMonth() + 1));
|
|
678
|
+
}, v = () => {
|
|
679
|
+
if (a === "years") {
|
|
680
|
+
i((e) => new Date(e.getFullYear() - 10, 0));
|
|
1322
681
|
return;
|
|
1323
682
|
}
|
|
1324
|
-
if (
|
|
1325
|
-
|
|
683
|
+
if (a === "months") {
|
|
684
|
+
i((e) => new Date(e.getFullYear() - 1, e.getMonth()));
|
|
1326
685
|
return;
|
|
1327
686
|
}
|
|
1328
|
-
|
|
1329
|
-
(
|
|
1330
|
-
|
|
1331
|
-
|
|
687
|
+
i(
|
|
688
|
+
(e) => new Date(
|
|
689
|
+
e.getMonth() === 0 ? e.getFullYear() - 1 : e.getFullYear(),
|
|
690
|
+
e.getMonth() === 0 ? 11 : e.getMonth() - 1
|
|
1332
691
|
)
|
|
1333
692
|
);
|
|
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
693
|
};
|
|
1342
|
-
return /* @__PURE__ */
|
|
1343
|
-
/* @__PURE__ */
|
|
1344
|
-
/* @__PURE__ */
|
|
1345
|
-
|
|
694
|
+
return /* @__PURE__ */ $("div", { className: "starasia-calendar-header", children: [
|
|
695
|
+
/* @__PURE__ */ l(q, { onClick: () => v() }),
|
|
696
|
+
/* @__PURE__ */ l("div", { style: { cursor: "pointer" }, onClick: g, children: (() => {
|
|
697
|
+
if (a === "days")
|
|
698
|
+
return `${N[s.getMonth()]} ${s.getFullYear()}`;
|
|
699
|
+
if (a === "months")
|
|
700
|
+
return `${s.getFullYear()}`;
|
|
701
|
+
if (a === "years")
|
|
702
|
+
return `${B(s.getFullYear()).start} ~ ${B(s.getFullYear()).end}`;
|
|
703
|
+
})() }),
|
|
704
|
+
/* @__PURE__ */ l(P, { onClick: () => f() })
|
|
1346
705
|
] });
|
|
1347
706
|
};
|
|
1348
|
-
function
|
|
1349
|
-
const
|
|
1350
|
-
return `${
|
|
707
|
+
function L(n) {
|
|
708
|
+
const a = new Date(n), t = a.getFullYear(), s = a.getMonth();
|
|
709
|
+
return `${a.getDate().toString().padStart(2, "0")} ${G[s]} ${t}`;
|
|
1351
710
|
}
|
|
1352
|
-
const
|
|
1353
|
-
if (!document.getElementById(
|
|
1354
|
-
const
|
|
1355
|
-
|
|
711
|
+
const z = "starasia-calendar-styles", aa = (n) => {
|
|
712
|
+
if (!document.getElementById(z)) {
|
|
713
|
+
const a = document.createElement("style");
|
|
714
|
+
a.id = z, a.textContent = n, document.head.appendChild(a);
|
|
1356
715
|
}
|
|
1357
716
|
};
|
|
1358
|
-
|
|
1359
|
-
const
|
|
717
|
+
aa(I);
|
|
718
|
+
const ea = W(
|
|
1360
719
|
({
|
|
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: (
|
|
720
|
+
value: n,
|
|
721
|
+
onChange: a,
|
|
722
|
+
filter: t,
|
|
723
|
+
input: s = !0,
|
|
724
|
+
disabled: i,
|
|
725
|
+
minDate: g,
|
|
726
|
+
maxDate: f,
|
|
727
|
+
placeholder: v,
|
|
728
|
+
size: h,
|
|
729
|
+
status: e
|
|
730
|
+
}, w) => {
|
|
731
|
+
const { ref: b, isComponentVisible: k, setIsComponentVisible: M } = J(!1), u = E(null), [r, c] = F("days"), [d, y] = F(/* @__PURE__ */ new Date()), [o, p] = F({
|
|
732
|
+
from: (n == null ? void 0 : n.from) || /* @__PURE__ */ new Date(),
|
|
733
|
+
to: (n == null ? void 0 : n.to) || /* @__PURE__ */ new Date()
|
|
1375
734
|
});
|
|
1376
|
-
|
|
1377
|
-
|
|
735
|
+
D(() => {
|
|
736
|
+
n ? (y(n.from), p(n)) : (y(/* @__PURE__ */ new Date()), p({
|
|
1378
737
|
from: /* @__PURE__ */ new Date(),
|
|
1379
738
|
to: /* @__PURE__ */ new Date()
|
|
1380
739
|
}));
|
|
1381
|
-
}, [
|
|
1382
|
-
|
|
1383
|
-
}, [
|
|
1384
|
-
|
|
1385
|
-
}, [
|
|
1386
|
-
|
|
1387
|
-
}, [
|
|
1388
|
-
const
|
|
1389
|
-
var
|
|
1390
|
-
if (!
|
|
740
|
+
}, [n]), D(() => {
|
|
741
|
+
t && c(t);
|
|
742
|
+
}, [t]), D(() => {
|
|
743
|
+
t || c("days");
|
|
744
|
+
}, [k]), D(() => {
|
|
745
|
+
s || M(!0);
|
|
746
|
+
}, [s]);
|
|
747
|
+
const C = () => {
|
|
748
|
+
var m, Y;
|
|
749
|
+
if (!n)
|
|
1391
750
|
return "";
|
|
1392
|
-
if (
|
|
1393
|
-
if (
|
|
1394
|
-
return `${
|
|
1395
|
-
if (
|
|
1396
|
-
return `${
|
|
1397
|
-
if (
|
|
1398
|
-
return `${(
|
|
751
|
+
if (t) {
|
|
752
|
+
if (r === "days")
|
|
753
|
+
return `${L(o.from)} ~ ${L(o.to || o.from) || "-"}`;
|
|
754
|
+
if (r === "months")
|
|
755
|
+
return `${N[o.from.getMonth()]} ~ ${o.to ? N[o.to.getMonth()] : "-"}`;
|
|
756
|
+
if (r === "years")
|
|
757
|
+
return `${(m = o.from) == null ? void 0 : m.getFullYear()} ~ ${((Y = o.to) == null ? void 0 : Y.getFullYear()) || "-"}`;
|
|
1399
758
|
} else
|
|
1400
|
-
return `${
|
|
1401
|
-
},
|
|
1402
|
-
if (
|
|
1403
|
-
const
|
|
1404
|
-
window.innerWidth <
|
|
759
|
+
return `${L(o.from)} ~ ${L(o.to || o.from) || "-"}`;
|
|
760
|
+
}, x = () => {
|
|
761
|
+
if (u.current && b.current && s) {
|
|
762
|
+
const m = b.current.getBoundingClientRect(), Y = u.current.getBoundingClientRect();
|
|
763
|
+
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
764
|
}
|
|
1406
765
|
};
|
|
1407
|
-
return
|
|
1408
|
-
|
|
1409
|
-
}, [
|
|
1410
|
-
const
|
|
1411
|
-
return
|
|
1412
|
-
|
|
766
|
+
return D(() => {
|
|
767
|
+
u.current && b.current && s && x();
|
|
768
|
+
}, [u, b, k]), D(() => {
|
|
769
|
+
const m = w == null ? void 0 : w.current;
|
|
770
|
+
return m && m.addEventListener("scroll", x), window.addEventListener("scroll", x), () => {
|
|
771
|
+
m && m.removeEventListener("scroll", x), window.removeEventListener("scroll", x);
|
|
1413
772
|
};
|
|
1414
|
-
}, []), /* @__PURE__ */
|
|
773
|
+
}, []), /* @__PURE__ */ $(
|
|
1415
774
|
"div",
|
|
1416
775
|
{
|
|
1417
776
|
className: "starasia-calendar-wrapper",
|
|
1418
|
-
style: { height:
|
|
1419
|
-
ref:
|
|
777
|
+
style: { height: s ? "auto" : "100%" },
|
|
778
|
+
ref: s ? b : null,
|
|
1420
779
|
children: [
|
|
1421
|
-
|
|
1422
|
-
|
|
780
|
+
s ? /* @__PURE__ */ l(
|
|
781
|
+
K,
|
|
1423
782
|
{
|
|
1424
|
-
value:
|
|
783
|
+
value: C(),
|
|
1425
784
|
inputMode: "none",
|
|
1426
785
|
onClick: () => {
|
|
1427
|
-
|
|
786
|
+
M(!0);
|
|
1428
787
|
},
|
|
1429
788
|
onChange: () => {
|
|
1430
789
|
},
|
|
1431
|
-
disabled:
|
|
1432
|
-
placeholder:
|
|
1433
|
-
size:
|
|
1434
|
-
status:
|
|
790
|
+
disabled: i,
|
|
791
|
+
placeholder: v,
|
|
792
|
+
size: h,
|
|
793
|
+
status: e
|
|
1435
794
|
}
|
|
1436
795
|
) : null,
|
|
1437
|
-
|
|
796
|
+
k ? /* @__PURE__ */ $(
|
|
1438
797
|
"div",
|
|
1439
798
|
{
|
|
1440
|
-
className: `starasia-calendar ${
|
|
1441
|
-
ref:
|
|
799
|
+
className: `starasia-calendar ${s ? "" : "starasia-calendar-no-input"}`,
|
|
800
|
+
ref: u,
|
|
1442
801
|
children: [
|
|
1443
|
-
/* @__PURE__ */
|
|
1444
|
-
|
|
802
|
+
/* @__PURE__ */ l(
|
|
803
|
+
_,
|
|
1445
804
|
{
|
|
1446
|
-
setViews:
|
|
1447
|
-
views:
|
|
1448
|
-
filter:
|
|
805
|
+
setViews: c,
|
|
806
|
+
views: r,
|
|
807
|
+
filter: t,
|
|
1449
808
|
date: d,
|
|
1450
|
-
setDate:
|
|
809
|
+
setDate: y
|
|
1451
810
|
}
|
|
1452
811
|
),
|
|
1453
|
-
/* @__PURE__ */
|
|
1454
|
-
|
|
812
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-body", children: r === "days" ? /* @__PURE__ */ l(
|
|
813
|
+
Q,
|
|
1455
814
|
{
|
|
1456
815
|
date: d,
|
|
1457
|
-
setDate:
|
|
1458
|
-
setIsComponentVisible:
|
|
1459
|
-
dateRange:
|
|
1460
|
-
setDateRange:
|
|
1461
|
-
input:
|
|
1462
|
-
onChange:
|
|
1463
|
-
minDate:
|
|
1464
|
-
maxDate:
|
|
816
|
+
setDate: y,
|
|
817
|
+
setIsComponentVisible: M,
|
|
818
|
+
dateRange: o,
|
|
819
|
+
setDateRange: p,
|
|
820
|
+
input: s,
|
|
821
|
+
onChange: a,
|
|
822
|
+
minDate: g,
|
|
823
|
+
maxDate: f
|
|
1465
824
|
}
|
|
1466
|
-
) :
|
|
1467
|
-
|
|
825
|
+
) : r === "months" ? /* @__PURE__ */ l(
|
|
826
|
+
X,
|
|
1468
827
|
{
|
|
1469
828
|
date: d,
|
|
1470
|
-
setDate:
|
|
1471
|
-
filter:
|
|
1472
|
-
setViews:
|
|
1473
|
-
dateRange:
|
|
1474
|
-
setDateRange:
|
|
1475
|
-
setIsComponentVisible:
|
|
1476
|
-
input:
|
|
1477
|
-
onChange:
|
|
1478
|
-
minDate:
|
|
1479
|
-
maxDate:
|
|
829
|
+
setDate: y,
|
|
830
|
+
filter: t,
|
|
831
|
+
setViews: c,
|
|
832
|
+
dateRange: o,
|
|
833
|
+
setDateRange: p,
|
|
834
|
+
setIsComponentVisible: M,
|
|
835
|
+
input: s,
|
|
836
|
+
onChange: a,
|
|
837
|
+
minDate: g,
|
|
838
|
+
maxDate: f
|
|
1480
839
|
}
|
|
1481
|
-
) : /* @__PURE__ */
|
|
1482
|
-
|
|
840
|
+
) : /* @__PURE__ */ l(
|
|
841
|
+
Z,
|
|
1483
842
|
{
|
|
1484
843
|
date: d,
|
|
1485
|
-
setDate:
|
|
1486
|
-
filter:
|
|
1487
|
-
setViews:
|
|
1488
|
-
dateRange:
|
|
1489
|
-
setDateRange:
|
|
1490
|
-
setIsComponentVisible:
|
|
1491
|
-
input:
|
|
1492
|
-
onChange:
|
|
1493
|
-
minDate:
|
|
1494
|
-
maxDate:
|
|
844
|
+
setDate: y,
|
|
845
|
+
filter: t,
|
|
846
|
+
setViews: c,
|
|
847
|
+
dateRange: o,
|
|
848
|
+
setDateRange: p,
|
|
849
|
+
setIsComponentVisible: M,
|
|
850
|
+
input: s,
|
|
851
|
+
onChange: a,
|
|
852
|
+
minDate: g,
|
|
853
|
+
maxDate: f
|
|
1495
854
|
}
|
|
1496
855
|
) })
|
|
1497
856
|
]
|
|
@@ -1501,39 +860,39 @@ const Ar = be(
|
|
|
1501
860
|
}
|
|
1502
861
|
);
|
|
1503
862
|
}
|
|
1504
|
-
),
|
|
1505
|
-
if (!document.getElementById(
|
|
1506
|
-
const
|
|
1507
|
-
|
|
863
|
+
), O = "starasia-calendar-input-styles", na = (n) => {
|
|
864
|
+
if (!document.getElementById(O)) {
|
|
865
|
+
const a = document.createElement("style");
|
|
866
|
+
a.id = O, a.textContent = n, document.head.appendChild(a);
|
|
1508
867
|
}
|
|
1509
868
|
};
|
|
1510
|
-
|
|
1511
|
-
const
|
|
1512
|
-
if (
|
|
869
|
+
na(I);
|
|
870
|
+
const S = (n) => {
|
|
871
|
+
if (n === "sm")
|
|
1513
872
|
return 16;
|
|
1514
|
-
if (
|
|
873
|
+
if (n === "md")
|
|
1515
874
|
return 16;
|
|
1516
|
-
if (
|
|
875
|
+
if (n === "lg")
|
|
1517
876
|
return 20;
|
|
1518
|
-
},
|
|
1519
|
-
const { size:
|
|
1520
|
-
|
|
877
|
+
}, ra = (n) => {
|
|
878
|
+
const { size: a = "md", status: t = "default", variant: s = "outline", ...i } = n, g = E(null), f = () => {
|
|
879
|
+
g.current && i.onClick && (g.current.focus(), i.onClick(""));
|
|
1521
880
|
};
|
|
1522
|
-
return /* @__PURE__ */
|
|
881
|
+
return /* @__PURE__ */ $(
|
|
1523
882
|
"div",
|
|
1524
883
|
{
|
|
1525
|
-
className: `starasia-calendar-input-container starasia-calendar-input-${
|
|
1526
|
-
onClick:
|
|
884
|
+
className: `starasia-calendar-input-container starasia-calendar-input-${s} starasia-calendar-input-container-${t} ${a} `,
|
|
885
|
+
onClick: f,
|
|
1527
886
|
children: [
|
|
1528
|
-
/* @__PURE__ */
|
|
887
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-container-icon-left", children: /* @__PURE__ */ l(
|
|
1529
888
|
"svg",
|
|
1530
889
|
{
|
|
1531
890
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1532
|
-
width:
|
|
1533
|
-
height:
|
|
891
|
+
width: S(a),
|
|
892
|
+
height: S(a),
|
|
1534
893
|
viewBox: "0 0 20 20",
|
|
1535
894
|
fill: "none",
|
|
1536
|
-
children: /* @__PURE__ */
|
|
895
|
+
children: /* @__PURE__ */ l(
|
|
1537
896
|
"path",
|
|
1538
897
|
{
|
|
1539
898
|
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 +904,25 @@ const se = (t) => {
|
|
|
1545
904
|
)
|
|
1546
905
|
}
|
|
1547
906
|
) }),
|
|
1548
|
-
/* @__PURE__ */
|
|
907
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-preview-container", children: /* @__PURE__ */ l(
|
|
1549
908
|
"input",
|
|
1550
909
|
{
|
|
1551
910
|
className: "starasia-calendar-input",
|
|
1552
|
-
...
|
|
1553
|
-
disabled:
|
|
1554
|
-
value:
|
|
1555
|
-
ref:
|
|
911
|
+
...i,
|
|
912
|
+
disabled: t === "disable" ? !0 : i.disabled,
|
|
913
|
+
value: i.value,
|
|
914
|
+
ref: g
|
|
1556
915
|
}
|
|
1557
916
|
) }),
|
|
1558
|
-
/* @__PURE__ */
|
|
917
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-input-container-icon-right", children: /* @__PURE__ */ l(
|
|
1559
918
|
"svg",
|
|
1560
919
|
{
|
|
1561
920
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1562
|
-
width:
|
|
1563
|
-
height:
|
|
921
|
+
width: S(a),
|
|
922
|
+
height: S(a),
|
|
1564
923
|
viewBox: "0 0 20 20",
|
|
1565
924
|
fill: "none",
|
|
1566
|
-
children: /* @__PURE__ */
|
|
925
|
+
children: /* @__PURE__ */ l(
|
|
1567
926
|
"path",
|
|
1568
927
|
{
|
|
1569
928
|
d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
|
|
@@ -1578,312 +937,312 @@ const se = (t) => {
|
|
|
1578
937
|
]
|
|
1579
938
|
}
|
|
1580
939
|
);
|
|
1581
|
-
},
|
|
1582
|
-
date:
|
|
1583
|
-
setDate:
|
|
1584
|
-
previewDate:
|
|
1585
|
-
setPreviewDate:
|
|
1586
|
-
setIsComponentVisible:
|
|
1587
|
-
minDate:
|
|
1588
|
-
maxDate:
|
|
1589
|
-
input:
|
|
1590
|
-
onChange:
|
|
940
|
+
}, ta = ({
|
|
941
|
+
date: n,
|
|
942
|
+
setDate: a,
|
|
943
|
+
previewDate: t,
|
|
944
|
+
setPreviewDate: s,
|
|
945
|
+
setIsComponentVisible: i,
|
|
946
|
+
minDate: g,
|
|
947
|
+
maxDate: f,
|
|
948
|
+
input: v,
|
|
949
|
+
onChange: h
|
|
1591
950
|
}) => {
|
|
1592
|
-
let
|
|
1593
|
-
|
|
1594
|
-
|
|
951
|
+
let e = new Date(
|
|
952
|
+
t.getFullYear(),
|
|
953
|
+
t.getMonth(),
|
|
1595
954
|
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:
|
|
955
|
+
), w = e.getDay(), b = [];
|
|
956
|
+
const k = n.toDateString(), M = t.getMonth();
|
|
957
|
+
for (let r = 0; r < 42; r++) {
|
|
958
|
+
r === 0 && w === 0 ? e.setDate(e.getDate() - 7) : r === 0 ? e.setDate(
|
|
959
|
+
e.getDate() + (r - w)
|
|
960
|
+
) : e.setDate(e.getDate() + 1);
|
|
961
|
+
let c = {
|
|
962
|
+
currentMonth: e.getMonth() === M,
|
|
963
|
+
date: new Date(e),
|
|
964
|
+
month: e.getMonth(),
|
|
965
|
+
number: e.getDate(),
|
|
966
|
+
selected: e.toDateString() === k,
|
|
967
|
+
year: e.getFullYear(),
|
|
968
|
+
isDisabled: g && e < g || f && e > f
|
|
1610
969
|
};
|
|
1611
|
-
|
|
970
|
+
b.push(c);
|
|
1612
971
|
}
|
|
1613
|
-
const
|
|
1614
|
-
(!
|
|
972
|
+
const u = (r) => {
|
|
973
|
+
(!g || r >= g) && (!f || r <= f) && (a(r), h(r), s(r), v && i(!1));
|
|
1615
974
|
};
|
|
1616
|
-
return /* @__PURE__ */
|
|
1617
|
-
/* @__PURE__ */
|
|
1618
|
-
/* @__PURE__ */
|
|
1619
|
-
const d =
|
|
1620
|
-
return /* @__PURE__ */
|
|
975
|
+
return /* @__PURE__ */ $("div", { className: "starasia-calendar-days-preivew", children: [
|
|
976
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-days-name-preivew", children: A.map((r, c) => /* @__PURE__ */ l("p", { children: r }, c)) }),
|
|
977
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-days-number-preivew", children: b.map((r, c) => {
|
|
978
|
+
const d = r.isDisabled;
|
|
979
|
+
return /* @__PURE__ */ l(
|
|
1621
980
|
"p",
|
|
1622
981
|
{
|
|
1623
|
-
className: `${
|
|
982
|
+
className: `${r.currentMonth ? "starasia-calendar-days-current" : "starasia-calendar-days"} ${r.selected ? "starasia-calendar-days-active" : ""}`,
|
|
1624
983
|
style: {
|
|
1625
984
|
color: d ? "#ccc" : void 0,
|
|
1626
985
|
pointerEvents: d ? "none" : void 0,
|
|
1627
986
|
cursor: d ? "not-allowed" : "pointer",
|
|
1628
|
-
...
|
|
987
|
+
...v ? {} : { width: "100%" }
|
|
1629
988
|
},
|
|
1630
989
|
onClick: () => {
|
|
1631
|
-
d ||
|
|
990
|
+
d || u(r.date);
|
|
1632
991
|
},
|
|
1633
|
-
children:
|
|
992
|
+
children: r.number
|
|
1634
993
|
},
|
|
1635
|
-
|
|
994
|
+
c
|
|
1636
995
|
);
|
|
1637
996
|
}) })
|
|
1638
997
|
] });
|
|
1639
|
-
},
|
|
1640
|
-
date:
|
|
1641
|
-
setDate:
|
|
1642
|
-
filter:
|
|
1643
|
-
setViews:
|
|
1644
|
-
onChange:
|
|
1645
|
-
previewDate:
|
|
1646
|
-
setPreviewDate:
|
|
1647
|
-
minDate:
|
|
1648
|
-
maxDate:
|
|
1649
|
-
input:
|
|
998
|
+
}, sa = ({
|
|
999
|
+
date: n,
|
|
1000
|
+
setDate: a,
|
|
1001
|
+
filter: t,
|
|
1002
|
+
setViews: s,
|
|
1003
|
+
onChange: i,
|
|
1004
|
+
previewDate: g,
|
|
1005
|
+
setPreviewDate: f,
|
|
1006
|
+
minDate: v,
|
|
1007
|
+
maxDate: h,
|
|
1008
|
+
input: e
|
|
1650
1009
|
}) => {
|
|
1651
|
-
const
|
|
1652
|
-
(!
|
|
1010
|
+
const w = n.getMonth(), b = n.getFullYear(), k = g.getFullYear(), M = (u) => {
|
|
1011
|
+
(!v || u >= v) && (!h || u <= h) && (t ? (i(u), a(u), f(u)) : (s("days"), f(u)));
|
|
1653
1012
|
};
|
|
1654
|
-
return /* @__PURE__ */
|
|
1655
|
-
const
|
|
1656
|
-
return /* @__PURE__ */
|
|
1013
|
+
return /* @__PURE__ */ l("div", { className: "starasia-calendar-months-preview", children: N.map((u, r) => {
|
|
1014
|
+
const c = v && new Date(k, r, 1) < v || h && new Date(k, r + 1, 0) > h;
|
|
1015
|
+
return /* @__PURE__ */ l(
|
|
1657
1016
|
"p",
|
|
1658
1017
|
{
|
|
1659
|
-
className:
|
|
1018
|
+
className: r === w && k === b ? "starasia-calendar-months-active" : "",
|
|
1660
1019
|
style: {
|
|
1661
|
-
color:
|
|
1662
|
-
pointerEvents:
|
|
1663
|
-
cursor:
|
|
1664
|
-
...
|
|
1020
|
+
color: c ? "#ccc" : void 0,
|
|
1021
|
+
pointerEvents: c ? "none" : void 0,
|
|
1022
|
+
cursor: c ? "not-allowed" : "pointer",
|
|
1023
|
+
...e ? {} : { width: "100%" }
|
|
1665
1024
|
},
|
|
1666
1025
|
onClick: () => {
|
|
1667
|
-
|
|
1026
|
+
c || M(new Date(k, r));
|
|
1668
1027
|
},
|
|
1669
|
-
children:
|
|
1028
|
+
children: u.slice(0, 3)
|
|
1670
1029
|
},
|
|
1671
|
-
|
|
1030
|
+
r
|
|
1672
1031
|
);
|
|
1673
1032
|
}) });
|
|
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:
|
|
1033
|
+
}, V = (n) => {
|
|
1034
|
+
const a = Math.floor(n / 10) * 10, t = a + 10;
|
|
1035
|
+
return { start: a, end: t };
|
|
1036
|
+
}, ia = ({
|
|
1037
|
+
date: n,
|
|
1038
|
+
filter: a,
|
|
1039
|
+
setViews: t,
|
|
1040
|
+
setDate: s,
|
|
1041
|
+
onChange: i,
|
|
1042
|
+
previewDate: g,
|
|
1043
|
+
setPreviewDate: f,
|
|
1044
|
+
minDate: v,
|
|
1045
|
+
maxDate: h,
|
|
1046
|
+
input: e
|
|
1688
1047
|
}) => {
|
|
1689
|
-
let
|
|
1690
|
-
const
|
|
1691
|
-
for (let
|
|
1692
|
-
let d =
|
|
1693
|
-
|
|
1048
|
+
let w = [];
|
|
1049
|
+
const b = g.getFullYear(), { start: k, end: M } = V(b), u = n.getFullYear();
|
|
1050
|
+
for (let c = k; c < M; c++) {
|
|
1051
|
+
let d = v && new Date(c, 0, 1) < v || h && new Date(c, 11, 31) > h;
|
|
1052
|
+
w.push({ year: c, active: c === u, isDisabled: d });
|
|
1694
1053
|
}
|
|
1695
|
-
const
|
|
1696
|
-
(!
|
|
1054
|
+
const r = (c) => {
|
|
1055
|
+
(!v || c >= v) && (!h || c <= h) && (a ? (i(c), s(c), f(c)) : (t("months"), f(c)));
|
|
1697
1056
|
};
|
|
1698
|
-
return /* @__PURE__ */
|
|
1057
|
+
return /* @__PURE__ */ l("div", { className: "starasia-calendar-years-preview", children: w.map((c, d) => /* @__PURE__ */ l(
|
|
1699
1058
|
"p",
|
|
1700
1059
|
{
|
|
1701
|
-
className:
|
|
1060
|
+
className: c.active ? "starasia-calendar-months-active" : "",
|
|
1702
1061
|
style: {
|
|
1703
|
-
color:
|
|
1704
|
-
pointerEvents:
|
|
1705
|
-
cursor:
|
|
1706
|
-
...
|
|
1062
|
+
color: c.isDisabled ? "#ccc" : void 0,
|
|
1063
|
+
pointerEvents: c.isDisabled ? "none" : void 0,
|
|
1064
|
+
cursor: c.isDisabled ? "not-allowed" : "pointer",
|
|
1065
|
+
...e ? {} : { width: "100%" }
|
|
1707
1066
|
},
|
|
1708
1067
|
onClick: () => {
|
|
1709
|
-
|
|
1068
|
+
c.isDisabled || r(new Date(c.year, 0));
|
|
1710
1069
|
},
|
|
1711
|
-
children:
|
|
1070
|
+
children: c.year
|
|
1712
1071
|
},
|
|
1713
1072
|
d
|
|
1714
1073
|
)) });
|
|
1715
|
-
},
|
|
1716
|
-
setViews:
|
|
1717
|
-
views:
|
|
1718
|
-
filter:
|
|
1719
|
-
previewDate:
|
|
1720
|
-
setPreviewDate:
|
|
1074
|
+
}, oa = ({
|
|
1075
|
+
setViews: n,
|
|
1076
|
+
views: a,
|
|
1077
|
+
filter: t,
|
|
1078
|
+
previewDate: s,
|
|
1079
|
+
setPreviewDate: i
|
|
1721
1080
|
}) => {
|
|
1722
|
-
const
|
|
1723
|
-
|
|
1724
|
-
},
|
|
1725
|
-
if (
|
|
1726
|
-
|
|
1081
|
+
const g = () => {
|
|
1082
|
+
t || n((e) => e === "days" ? "months" : e === "months" ? "years" : "days");
|
|
1083
|
+
}, f = () => {
|
|
1084
|
+
if (a === "years") {
|
|
1085
|
+
i((e) => new Date(e.getFullYear() + 10, 0));
|
|
1727
1086
|
return;
|
|
1728
1087
|
}
|
|
1729
|
-
if (
|
|
1730
|
-
|
|
1731
|
-
(
|
|
1088
|
+
if (a === "months") {
|
|
1089
|
+
i(
|
|
1090
|
+
(e) => new Date(e.getFullYear() + 1, e.getMonth())
|
|
1732
1091
|
);
|
|
1733
1092
|
return;
|
|
1734
1093
|
}
|
|
1735
|
-
|
|
1736
|
-
},
|
|
1737
|
-
if (
|
|
1738
|
-
|
|
1094
|
+
i((e) => new Date(e.getFullYear(), e.getMonth() + 1));
|
|
1095
|
+
}, v = () => {
|
|
1096
|
+
if (a === "years") {
|
|
1097
|
+
i((e) => new Date(e.getFullYear() - 10, 0));
|
|
1739
1098
|
return;
|
|
1740
1099
|
}
|
|
1741
|
-
if (
|
|
1742
|
-
|
|
1743
|
-
(
|
|
1100
|
+
if (a === "months") {
|
|
1101
|
+
i(
|
|
1102
|
+
(e) => new Date(e.getFullYear() - 1, e.getMonth())
|
|
1744
1103
|
);
|
|
1745
1104
|
return;
|
|
1746
1105
|
}
|
|
1747
|
-
|
|
1748
|
-
(
|
|
1749
|
-
|
|
1750
|
-
|
|
1106
|
+
i(
|
|
1107
|
+
(e) => new Date(
|
|
1108
|
+
e.getMonth() === 0 ? e.getFullYear() - 1 : e.getFullYear(),
|
|
1109
|
+
e.getMonth() === 0 ? 11 : e.getMonth() - 1
|
|
1751
1110
|
)
|
|
1752
1111
|
);
|
|
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
1112
|
};
|
|
1761
|
-
return /* @__PURE__ */
|
|
1762
|
-
/* @__PURE__ */
|
|
1763
|
-
/* @__PURE__ */
|
|
1764
|
-
|
|
1113
|
+
return /* @__PURE__ */ $("div", { className: "starasia-calendar-header", children: [
|
|
1114
|
+
/* @__PURE__ */ l(q, { onClick: () => v() }),
|
|
1115
|
+
/* @__PURE__ */ l("div", { style: { cursor: "pointer" }, onClick: g, children: (() => {
|
|
1116
|
+
if (a === "days")
|
|
1117
|
+
return `${N[s.getMonth()]} ${s.getFullYear()}`;
|
|
1118
|
+
if (a === "months")
|
|
1119
|
+
return `${s.getFullYear()}`;
|
|
1120
|
+
if (a === "years")
|
|
1121
|
+
return `${V(s.getFullYear()).start} ~ ${V(s.getFullYear()).end}`;
|
|
1122
|
+
})() }),
|
|
1123
|
+
/* @__PURE__ */ l(P, { onClick: () => f() })
|
|
1765
1124
|
] });
|
|
1766
|
-
},
|
|
1767
|
-
if (!document.getElementById(
|
|
1768
|
-
const
|
|
1769
|
-
|
|
1125
|
+
}, H = "starasia-calendar-styles", la = (n) => {
|
|
1126
|
+
if (!document.getElementById(H)) {
|
|
1127
|
+
const a = document.createElement("style");
|
|
1128
|
+
a.id = H, a.textContent = n, document.head.appendChild(a);
|
|
1770
1129
|
}
|
|
1771
1130
|
};
|
|
1772
|
-
|
|
1773
|
-
const
|
|
1131
|
+
la(I);
|
|
1132
|
+
const ca = W(
|
|
1774
1133
|
({
|
|
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 <
|
|
1134
|
+
value: n,
|
|
1135
|
+
onChange: a,
|
|
1136
|
+
filter: t,
|
|
1137
|
+
input: s = !0,
|
|
1138
|
+
disabled: i,
|
|
1139
|
+
minDate: g,
|
|
1140
|
+
maxDate: f,
|
|
1141
|
+
placeholder: v,
|
|
1142
|
+
size: h,
|
|
1143
|
+
status: e
|
|
1144
|
+
}, w) => {
|
|
1145
|
+
const { ref: b, isComponentVisible: k, setIsComponentVisible: M } = J(!1), u = E(null), [r, c] = F("days"), [d, y] = F(/* @__PURE__ */ new Date()), [o, p] = F(/* @__PURE__ */ new Date());
|
|
1146
|
+
D(() => {
|
|
1147
|
+
n ? (y(n), p(n)) : (y(/* @__PURE__ */ new Date()), p(/* @__PURE__ */ new Date()));
|
|
1148
|
+
}, [n]), D(() => {
|
|
1149
|
+
t && c(t);
|
|
1150
|
+
}, [t]), D(() => {
|
|
1151
|
+
t || c("days");
|
|
1152
|
+
}, [k]), D(() => {
|
|
1153
|
+
s || M(!0);
|
|
1154
|
+
}, [s]);
|
|
1155
|
+
const C = () => n ? t === "days" ? L(d) : t === "months" ? `${N[d.getMonth()]} ${d.getFullYear()}` : t === "years" ? d.getFullYear() : L(d) : "", x = () => {
|
|
1156
|
+
if (u.current && b.current && s) {
|
|
1157
|
+
const m = b.current.getBoundingClientRect(), Y = u.current.getBoundingClientRect();
|
|
1158
|
+
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
1159
|
}
|
|
1801
1160
|
};
|
|
1802
|
-
return
|
|
1803
|
-
|
|
1804
|
-
}, [
|
|
1805
|
-
const
|
|
1806
|
-
return
|
|
1807
|
-
|
|
1161
|
+
return D(() => {
|
|
1162
|
+
u.current && b.current && s && x();
|
|
1163
|
+
}, [u, b, k]), D(() => {
|
|
1164
|
+
const m = w == null ? void 0 : w.current;
|
|
1165
|
+
return m && m.addEventListener("scroll", x), window.addEventListener("scroll", x), () => {
|
|
1166
|
+
m && m.removeEventListener("scroll", x), window.removeEventListener("scroll", x);
|
|
1808
1167
|
};
|
|
1809
|
-
}, []), /* @__PURE__ */
|
|
1168
|
+
}, []), /* @__PURE__ */ $(
|
|
1810
1169
|
"div",
|
|
1811
1170
|
{
|
|
1812
1171
|
className: "starasia-calendar-wrapper",
|
|
1813
|
-
style: { height:
|
|
1814
|
-
ref:
|
|
1172
|
+
style: { height: s ? "auto" : "100%" },
|
|
1173
|
+
ref: s ? b : null,
|
|
1815
1174
|
children: [
|
|
1816
|
-
|
|
1817
|
-
|
|
1175
|
+
s ? /* @__PURE__ */ l(
|
|
1176
|
+
ra,
|
|
1818
1177
|
{
|
|
1819
|
-
value:
|
|
1820
|
-
onClick: () =>
|
|
1178
|
+
value: C(),
|
|
1179
|
+
onClick: () => M(!0),
|
|
1821
1180
|
onChange: () => {
|
|
1822
1181
|
},
|
|
1823
|
-
placeholder:
|
|
1824
|
-
disabled:
|
|
1825
|
-
size:
|
|
1826
|
-
status:
|
|
1182
|
+
placeholder: v,
|
|
1183
|
+
disabled: i,
|
|
1184
|
+
size: h,
|
|
1185
|
+
status: e,
|
|
1827
1186
|
inputMode: "none"
|
|
1828
1187
|
}
|
|
1829
1188
|
) : null,
|
|
1830
|
-
|
|
1189
|
+
k ? /* @__PURE__ */ $(
|
|
1831
1190
|
"div",
|
|
1832
1191
|
{
|
|
1833
|
-
className: `starasia-calendar ${
|
|
1834
|
-
ref:
|
|
1192
|
+
className: `starasia-calendar ${s ? "" : "starasia-calendar-no-input"}`,
|
|
1193
|
+
ref: u,
|
|
1835
1194
|
children: [
|
|
1836
|
-
/* @__PURE__ */
|
|
1837
|
-
|
|
1195
|
+
/* @__PURE__ */ l(
|
|
1196
|
+
oa,
|
|
1838
1197
|
{
|
|
1839
|
-
setViews:
|
|
1840
|
-
views:
|
|
1841
|
-
filter:
|
|
1842
|
-
previewDate:
|
|
1843
|
-
setPreviewDate:
|
|
1844
|
-
isComponentVisible:
|
|
1198
|
+
setViews: c,
|
|
1199
|
+
views: r,
|
|
1200
|
+
filter: t,
|
|
1201
|
+
previewDate: o,
|
|
1202
|
+
setPreviewDate: p,
|
|
1203
|
+
isComponentVisible: k
|
|
1845
1204
|
}
|
|
1846
1205
|
),
|
|
1847
|
-
/* @__PURE__ */
|
|
1848
|
-
|
|
1206
|
+
/* @__PURE__ */ l("div", { className: "starasia-calendar-body", children: r === "days" ? /* @__PURE__ */ l(
|
|
1207
|
+
ta,
|
|
1849
1208
|
{
|
|
1850
1209
|
date: d,
|
|
1851
|
-
setDate:
|
|
1852
|
-
previewDate:
|
|
1853
|
-
setPreviewDate:
|
|
1854
|
-
setIsComponentVisible:
|
|
1855
|
-
input:
|
|
1856
|
-
minDate:
|
|
1857
|
-
maxDate:
|
|
1858
|
-
onChange:
|
|
1210
|
+
setDate: y,
|
|
1211
|
+
previewDate: o,
|
|
1212
|
+
setPreviewDate: p,
|
|
1213
|
+
setIsComponentVisible: M,
|
|
1214
|
+
input: s,
|
|
1215
|
+
minDate: g,
|
|
1216
|
+
maxDate: f,
|
|
1217
|
+
onChange: a
|
|
1859
1218
|
}
|
|
1860
|
-
) :
|
|
1861
|
-
|
|
1219
|
+
) : r === "months" ? /* @__PURE__ */ l(
|
|
1220
|
+
sa,
|
|
1862
1221
|
{
|
|
1863
1222
|
date: d,
|
|
1864
|
-
setDate:
|
|
1865
|
-
previewDate:
|
|
1866
|
-
setPreviewDate:
|
|
1867
|
-
filter:
|
|
1868
|
-
setViews:
|
|
1869
|
-
onChange:
|
|
1870
|
-
minDate:
|
|
1871
|
-
maxDate:
|
|
1872
|
-
input:
|
|
1223
|
+
setDate: y,
|
|
1224
|
+
previewDate: o,
|
|
1225
|
+
setPreviewDate: p,
|
|
1226
|
+
filter: t,
|
|
1227
|
+
setViews: c,
|
|
1228
|
+
onChange: a,
|
|
1229
|
+
minDate: g,
|
|
1230
|
+
maxDate: f,
|
|
1231
|
+
input: s
|
|
1873
1232
|
}
|
|
1874
|
-
) : /* @__PURE__ */
|
|
1875
|
-
|
|
1233
|
+
) : /* @__PURE__ */ l(
|
|
1234
|
+
ia,
|
|
1876
1235
|
{
|
|
1877
1236
|
date: d,
|
|
1878
|
-
setDate:
|
|
1879
|
-
previewDate:
|
|
1880
|
-
setPreviewDate:
|
|
1881
|
-
filter:
|
|
1882
|
-
setViews:
|
|
1883
|
-
onChange:
|
|
1884
|
-
minDate:
|
|
1885
|
-
maxDate:
|
|
1886
|
-
input:
|
|
1237
|
+
setDate: y,
|
|
1238
|
+
previewDate: o,
|
|
1239
|
+
setPreviewDate: p,
|
|
1240
|
+
filter: t,
|
|
1241
|
+
setViews: c,
|
|
1242
|
+
onChange: a,
|
|
1243
|
+
minDate: g,
|
|
1244
|
+
maxDate: f,
|
|
1245
|
+
input: s
|
|
1887
1246
|
}
|
|
1888
1247
|
) })
|
|
1889
1248
|
]
|
|
@@ -1893,51 +1252,51 @@ const Hr = be(
|
|
|
1893
1252
|
}
|
|
1894
1253
|
);
|
|
1895
1254
|
}
|
|
1896
|
-
),
|
|
1255
|
+
), ha = W(
|
|
1897
1256
|
({
|
|
1898
|
-
value:
|
|
1899
|
-
onChange:
|
|
1900
|
-
filter:
|
|
1901
|
-
input:
|
|
1902
|
-
rangedDate:
|
|
1903
|
-
disabled:
|
|
1904
|
-
minDate:
|
|
1905
|
-
maxDate:
|
|
1906
|
-
placeholder:
|
|
1907
|
-
size:
|
|
1908
|
-
status:
|
|
1909
|
-
},
|
|
1910
|
-
|
|
1257
|
+
value: n,
|
|
1258
|
+
onChange: a,
|
|
1259
|
+
filter: t,
|
|
1260
|
+
input: s = !0,
|
|
1261
|
+
rangedDate: i,
|
|
1262
|
+
disabled: g,
|
|
1263
|
+
minDate: f,
|
|
1264
|
+
maxDate: v,
|
|
1265
|
+
placeholder: h,
|
|
1266
|
+
size: e,
|
|
1267
|
+
status: w
|
|
1268
|
+
}, b) => /* @__PURE__ */ l(R, { children: i ? /* @__PURE__ */ l(
|
|
1269
|
+
ea,
|
|
1911
1270
|
{
|
|
1912
|
-
onChange:
|
|
1913
|
-
value:
|
|
1914
|
-
input:
|
|
1915
|
-
filter:
|
|
1916
|
-
disabled:
|
|
1917
|
-
ref:
|
|
1918
|
-
minDate:
|
|
1919
|
-
maxDate:
|
|
1920
|
-
placeholder:
|
|
1921
|
-
size:
|
|
1922
|
-
status:
|
|
1271
|
+
onChange: a,
|
|
1272
|
+
value: n,
|
|
1273
|
+
input: s,
|
|
1274
|
+
filter: t,
|
|
1275
|
+
disabled: g,
|
|
1276
|
+
ref: b,
|
|
1277
|
+
minDate: f,
|
|
1278
|
+
maxDate: v,
|
|
1279
|
+
placeholder: h,
|
|
1280
|
+
size: e,
|
|
1281
|
+
status: w
|
|
1923
1282
|
}
|
|
1924
|
-
) : /* @__PURE__ */
|
|
1925
|
-
|
|
1283
|
+
) : /* @__PURE__ */ l(
|
|
1284
|
+
ca,
|
|
1926
1285
|
{
|
|
1927
|
-
onChange:
|
|
1928
|
-
value:
|
|
1929
|
-
input:
|
|
1930
|
-
filter:
|
|
1931
|
-
disabled:
|
|
1932
|
-
ref:
|
|
1933
|
-
minDate:
|
|
1934
|
-
maxDate:
|
|
1935
|
-
placeholder:
|
|
1936
|
-
size:
|
|
1937
|
-
status:
|
|
1286
|
+
onChange: a,
|
|
1287
|
+
value: n,
|
|
1288
|
+
input: s,
|
|
1289
|
+
filter: t,
|
|
1290
|
+
disabled: g,
|
|
1291
|
+
ref: b,
|
|
1292
|
+
minDate: f,
|
|
1293
|
+
maxDate: v,
|
|
1294
|
+
placeholder: h,
|
|
1295
|
+
size: e,
|
|
1296
|
+
status: w
|
|
1938
1297
|
}
|
|
1939
1298
|
) })
|
|
1940
1299
|
);
|
|
1941
1300
|
export {
|
|
1942
|
-
|
|
1301
|
+
ha as StarasiaDate
|
|
1943
1302
|
};
|