@starasia/date 5.0.3 → 5.1.1
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 +829 -655
- package/dist/date.umd.js +170 -8
- package/dist/interfaces.d.ts +1 -0
- package/package.json +1 -1
package/dist/date.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { useState as
|
|
3
|
-
const
|
|
1
|
+
import { jsxs as $, jsx as a, Fragment as nn } from "react/jsx-runtime";
|
|
2
|
+
import { useState as j, useRef as J, useEffect as I, forwardRef as Z } from "react";
|
|
3
|
+
const R = `@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");
|
|
4
4
|
|
|
5
5
|
* {
|
|
6
6
|
margin: 0;
|
|
@@ -10,7 +10,7 @@ const J = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
10
10
|
/* box-sizing: border-box; */
|
|
11
11
|
}
|
|
12
12
|
:root {
|
|
13
|
-
--sa-date-radius: var(--sa-radii-
|
|
13
|
+
--sa-date-radius: var(--sa-radii-sm, 0.375rem);
|
|
14
14
|
--sa-date-radius-lg: var(--sa-radii-lg, 0.75rem);
|
|
15
15
|
--sa-date-bg: var(--sa-background-primary, #ffffff);
|
|
16
16
|
--sa-date-border-color: var(--sa-color-gray-alpha-a20, #78867f33);
|
|
@@ -147,6 +147,50 @@ const J = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
147
147
|
gap: var(--sa-spacing-xs, 4px);
|
|
148
148
|
}
|
|
149
149
|
|
|
150
|
+
.sa-calendar-header-title {
|
|
151
|
+
font-size: 15px;
|
|
152
|
+
font-weight: 600;
|
|
153
|
+
cursor: pointer;
|
|
154
|
+
color: var(--sa-date-text-primary);
|
|
155
|
+
flex: 1;
|
|
156
|
+
line-height: 1.3;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
.sa-calendar-header-nav {
|
|
160
|
+
display: flex;
|
|
161
|
+
align-items: center;
|
|
162
|
+
gap: 2px;
|
|
163
|
+
flex-shrink: 0;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.sa-calendar-nav-btn {
|
|
167
|
+
display: inline-flex;
|
|
168
|
+
align-items: center;
|
|
169
|
+
justify-content: center;
|
|
170
|
+
width: 28px;
|
|
171
|
+
height: 28px;
|
|
172
|
+
border: 0;
|
|
173
|
+
padding: 0;
|
|
174
|
+
background: transparent;
|
|
175
|
+
border-radius: var(--sa-date-radius);
|
|
176
|
+
cursor: pointer;
|
|
177
|
+
color: var(--sa-date-brand);
|
|
178
|
+
transition: background-color 120ms ease;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
.sa-calendar-nav-btn:hover {
|
|
182
|
+
background: var(--sa-date-brand-subtle);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
.sa-calendar-nav-btn:active {
|
|
186
|
+
background: var(--sa-date-brand-secondary);
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
.sa-calendar-nav-btn:focus-visible {
|
|
190
|
+
outline: 2px solid var(--sa-date-brand);
|
|
191
|
+
outline-offset: 1px;
|
|
192
|
+
}
|
|
193
|
+
|
|
150
194
|
.sa-calendar-days-name-preivew {
|
|
151
195
|
display: flex;
|
|
152
196
|
gap: var(--sa-spacing-sm, 8px);
|
|
@@ -191,8 +235,28 @@ const J = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
191
235
|
}
|
|
192
236
|
|
|
193
237
|
.sa-calendar-days-active {
|
|
194
|
-
background: var(--sa-date-brand
|
|
238
|
+
background: var(--sa-date-brand);
|
|
239
|
+
color: #fff;
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
.sa-calendar-days-today {
|
|
243
|
+
position: relative;
|
|
195
244
|
color: var(--sa-date-brand);
|
|
245
|
+
font-weight: 700;
|
|
246
|
+
background: transparent;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
.sa-calendar-days-today::before {
|
|
250
|
+
content: '';
|
|
251
|
+
position: absolute;
|
|
252
|
+
top: 50%;
|
|
253
|
+
left: 50%;
|
|
254
|
+
transform: translate(-50%, -50%);
|
|
255
|
+
width: 32px;
|
|
256
|
+
height: 32px;
|
|
257
|
+
background: var(--sa-date-brand-secondary);
|
|
258
|
+
border-radius: 50%;
|
|
259
|
+
z-index: -1;
|
|
196
260
|
}
|
|
197
261
|
|
|
198
262
|
/* MONTH STYLING */
|
|
@@ -270,13 +334,9 @@ const J = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
270
334
|
|
|
271
335
|
.sa-calendar-input-outline {
|
|
272
336
|
border-color: var(--sa-date-border-color);
|
|
273
|
-
/* border-color: var(--sa-date-text-muted); */
|
|
274
337
|
background-color: transparent;
|
|
275
338
|
border-width: var(--sa-border, 1px);
|
|
276
339
|
border-style: solid;
|
|
277
|
-
/* height: var(--sa-h-10, 40px); */
|
|
278
|
-
/* border-radius: var(--sa-date-radius); */
|
|
279
|
-
/* padding-inline: var(--sa-spacing-3, 12px); */
|
|
280
340
|
}
|
|
281
341
|
|
|
282
342
|
.sa-calendar-input-container.sm {
|
|
@@ -298,6 +358,40 @@ const J = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
298
358
|
padding-inline: var(--sa-spacing-3, 12px);
|
|
299
359
|
}
|
|
300
360
|
|
|
361
|
+
/* filled variant — gray background, no visible border */
|
|
362
|
+
.sa-calendar-input-container.sa-calendar-input-filled {
|
|
363
|
+
background-color: var(--sa-date-accent-subtle, #f0f1f2);
|
|
364
|
+
border-color: transparent;
|
|
365
|
+
border-width: 1px;
|
|
366
|
+
border-style: solid;
|
|
367
|
+
}
|
|
368
|
+
.sa-calendar-input-container.sa-calendar-input-filled:has(input:focus) {
|
|
369
|
+
border-color: var(--sa-date-brand);
|
|
370
|
+
background-color: var(--sa-date-accent-subtle, #f0f1f2);
|
|
371
|
+
box-shadow: 0px 0px 0px 2px var(--sa-date-brand-subtle);
|
|
372
|
+
}
|
|
373
|
+
|
|
374
|
+
/* flushed variant — bottom border only */
|
|
375
|
+
.sa-calendar-input-container.sa-calendar-input-flushed {
|
|
376
|
+
background-color: transparent;
|
|
377
|
+
border-top: none;
|
|
378
|
+
border-left: none;
|
|
379
|
+
border-right: none;
|
|
380
|
+
border-bottom: 1px solid var(--sa-date-border-color);
|
|
381
|
+
border-radius: 0;
|
|
382
|
+
padding-inline: 0;
|
|
383
|
+
}
|
|
384
|
+
.sa-calendar-input-container.sa-calendar-input-flushed:has(input:focus) {
|
|
385
|
+
border-bottom-color: var(--sa-date-brand);
|
|
386
|
+
box-shadow: none;
|
|
387
|
+
}
|
|
388
|
+
.sa-calendar-input-container.sa-calendar-input-flushed.sa-calendar-input-container-error {
|
|
389
|
+
border-bottom-color: var(--sa-date-border-error) !important;
|
|
390
|
+
}
|
|
391
|
+
.sa-calendar-input-container.sa-calendar-input-flushed.sa-calendar-input-container-warning {
|
|
392
|
+
border-bottom-color: var(--sa-date-border-warning) !important;
|
|
393
|
+
}
|
|
394
|
+
|
|
301
395
|
.sa-calendar-input-preview-container {
|
|
302
396
|
width: 100%;
|
|
303
397
|
position: relative;
|
|
@@ -358,7 +452,75 @@ const J = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
358
452
|
outline: 2px solid var(--sa-date-brand);
|
|
359
453
|
outline-offset: 1px;
|
|
360
454
|
}
|
|
361
|
-
|
|
455
|
+
|
|
456
|
+
/* === CALENDAR PANEL SIZE VARIANTS === */
|
|
457
|
+
/* sa-calendar-size-md is the default — no override needed */
|
|
458
|
+
|
|
459
|
+
.sa-calendar.sa-calendar-size-sm {
|
|
460
|
+
padding: 16px 12px;
|
|
461
|
+
gap: 8px;
|
|
462
|
+
}
|
|
463
|
+
.sa-calendar.sa-calendar-size-sm .sa-calendar-days-name-preivew {
|
|
464
|
+
gap: 4px;
|
|
465
|
+
}
|
|
466
|
+
.sa-calendar.sa-calendar-size-sm .sa-calendar-days-name-preivew p {
|
|
467
|
+
font-size: var(--sa-font-size-sm, 12px);
|
|
468
|
+
}
|
|
469
|
+
.sa-calendar.sa-calendar-size-sm .sa-calendar-days-number-preivew {
|
|
470
|
+
gap: 4px;
|
|
471
|
+
}
|
|
472
|
+
.sa-calendar.sa-calendar-size-sm .sa-calendar-days-number-preivew p {
|
|
473
|
+
font-size: var(--sa-font-size-sm, 12px);
|
|
474
|
+
width: 28px;
|
|
475
|
+
height: 26px;
|
|
476
|
+
}
|
|
477
|
+
.sa-calendar.sa-calendar-size-sm .sa-calendar-months-preview p,
|
|
478
|
+
.sa-calendar.sa-calendar-size-sm .sa-calendar-years-preview p {
|
|
479
|
+
font-size: var(--sa-font-size-sm, 12px);
|
|
480
|
+
width: 76px;
|
|
481
|
+
height: 38px;
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
.sa-calendar.sa-calendar-size-lg {
|
|
485
|
+
padding: 28px 20px;
|
|
486
|
+
gap: 16px;
|
|
487
|
+
}
|
|
488
|
+
.sa-calendar.sa-calendar-size-lg .sa-calendar-days-name-preivew {
|
|
489
|
+
gap: 10px;
|
|
490
|
+
}
|
|
491
|
+
.sa-calendar.sa-calendar-size-lg .sa-calendar-days-name-preivew p {
|
|
492
|
+
font-size: 16px;
|
|
493
|
+
}
|
|
494
|
+
.sa-calendar.sa-calendar-size-lg .sa-calendar-days-number-preivew {
|
|
495
|
+
gap: 10px;
|
|
496
|
+
}
|
|
497
|
+
.sa-calendar.sa-calendar-size-lg .sa-calendar-days-number-preivew p {
|
|
498
|
+
font-size: 16px;
|
|
499
|
+
width: 40px;
|
|
500
|
+
height: 36px;
|
|
501
|
+
}
|
|
502
|
+
.sa-calendar.sa-calendar-size-lg .sa-calendar-months-preview p,
|
|
503
|
+
.sa-calendar.sa-calendar-size-lg .sa-calendar-years-preview p {
|
|
504
|
+
font-size: 16px;
|
|
505
|
+
width: 110px;
|
|
506
|
+
height: 54px;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
.sa-calendar.sa-calendar-size-sm .sa-calendar-header-title {
|
|
510
|
+
font-size: 13px;
|
|
511
|
+
}
|
|
512
|
+
.sa-calendar.sa-calendar-size-sm .sa-calendar-nav-btn {
|
|
513
|
+
width: 24px;
|
|
514
|
+
height: 24px;
|
|
515
|
+
}
|
|
516
|
+
.sa-calendar.sa-calendar-size-lg .sa-calendar-header-title {
|
|
517
|
+
font-size: 16px;
|
|
518
|
+
}
|
|
519
|
+
.sa-calendar.sa-calendar-size-lg .sa-calendar-nav-btn {
|
|
520
|
+
width: 32px;
|
|
521
|
+
height: 32px;
|
|
522
|
+
}
|
|
523
|
+
`, en = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"], W = [
|
|
362
524
|
"January",
|
|
363
525
|
"February",
|
|
364
526
|
"March",
|
|
@@ -371,7 +533,7 @@ const J = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
371
533
|
"October",
|
|
372
534
|
"November",
|
|
373
535
|
"December"
|
|
374
|
-
],
|
|
536
|
+
], on = [
|
|
375
537
|
"Jan",
|
|
376
538
|
"Feb",
|
|
377
539
|
"Mar",
|
|
@@ -385,56 +547,56 @@ const J = `@import url("https://fonts.googleapis.com/css2?family=Poppins:ital,wg
|
|
|
385
547
|
"Nov",
|
|
386
548
|
"Dec"
|
|
387
549
|
];
|
|
388
|
-
function
|
|
389
|
-
const [
|
|
390
|
-
|
|
550
|
+
function an(r) {
|
|
551
|
+
const [e, t] = j(r), o = J(null), l = (u) => {
|
|
552
|
+
o.current && !o.current.contains(u.target) && t(!1);
|
|
391
553
|
};
|
|
392
|
-
return
|
|
554
|
+
return I(() => (document.addEventListener("click", l, !0), () => {
|
|
393
555
|
document.removeEventListener("click", l, !0);
|
|
394
|
-
}), []), { ref:
|
|
556
|
+
}), []), { ref: o, isComponentVisible: e, setIsComponentVisible: t };
|
|
395
557
|
}
|
|
396
|
-
const K = "sa-calendar-input-styles",
|
|
558
|
+
const K = "sa-calendar-input-styles", ln = (r) => {
|
|
397
559
|
if (!document.getElementById(K)) {
|
|
398
|
-
const
|
|
399
|
-
|
|
560
|
+
const e = document.createElement("style");
|
|
561
|
+
e.id = K, e.textContent = r, document.head.appendChild(e);
|
|
400
562
|
}
|
|
401
563
|
};
|
|
402
|
-
|
|
403
|
-
const H = (
|
|
404
|
-
if (
|
|
564
|
+
ln(R);
|
|
565
|
+
const H = (r) => {
|
|
566
|
+
if (r === "sm")
|
|
405
567
|
return 16;
|
|
406
|
-
if (
|
|
568
|
+
if (r === "md")
|
|
407
569
|
return 16;
|
|
408
|
-
if (
|
|
570
|
+
if (r === "lg")
|
|
409
571
|
return 20;
|
|
410
|
-
},
|
|
572
|
+
}, dn = (r) => {
|
|
411
573
|
const {
|
|
412
|
-
size:
|
|
574
|
+
size: e = "md",
|
|
413
575
|
status: t = "default",
|
|
414
|
-
variant:
|
|
576
|
+
variant: o = "outline",
|
|
415
577
|
clearable: l,
|
|
416
|
-
onClear:
|
|
417
|
-
...
|
|
418
|
-
} =
|
|
419
|
-
|
|
420
|
-
},
|
|
421
|
-
D.stopPropagation(),
|
|
578
|
+
onClear: u,
|
|
579
|
+
...d
|
|
580
|
+
} = r, p = J(null), g = () => {
|
|
581
|
+
p.current && d.onClick && (p.current.focus(), d.onClick(""));
|
|
582
|
+
}, n = t === "disable" || d.disabled, c = !!d.value, v = l && c && !n, k = (D) => {
|
|
583
|
+
D.stopPropagation(), u == null || u();
|
|
422
584
|
};
|
|
423
|
-
return /* @__PURE__ */
|
|
585
|
+
return /* @__PURE__ */ $(
|
|
424
586
|
"div",
|
|
425
587
|
{
|
|
426
|
-
className: `sa-calendar-input-container sa-calendar-input-${
|
|
427
|
-
onClick:
|
|
588
|
+
className: `sa-calendar-input-container sa-calendar-input-${o} sa-calendar-input-container-${t} ${e} `,
|
|
589
|
+
onClick: g,
|
|
428
590
|
children: [
|
|
429
|
-
/* @__PURE__ */
|
|
591
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-left", children: /* @__PURE__ */ a(
|
|
430
592
|
"svg",
|
|
431
593
|
{
|
|
432
594
|
xmlns: "http://www.w3.org/2000/svg",
|
|
433
|
-
width: H(
|
|
434
|
-
height: H(
|
|
595
|
+
width: H(e),
|
|
596
|
+
height: H(e),
|
|
435
597
|
viewBox: "0 0 20 20",
|
|
436
598
|
fill: "none",
|
|
437
|
-
children: /* @__PURE__ */
|
|
599
|
+
children: /* @__PURE__ */ a(
|
|
438
600
|
"path",
|
|
439
601
|
{
|
|
440
602
|
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",
|
|
@@ -446,32 +608,32 @@ const H = (a) => {
|
|
|
446
608
|
)
|
|
447
609
|
}
|
|
448
610
|
) }),
|
|
449
|
-
/* @__PURE__ */
|
|
611
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-input-preview-container", children: /* @__PURE__ */ a(
|
|
450
612
|
"input",
|
|
451
613
|
{
|
|
452
614
|
className: "sa-calendar-input",
|
|
453
|
-
...
|
|
454
|
-
disabled:
|
|
455
|
-
value:
|
|
456
|
-
ref:
|
|
615
|
+
...d,
|
|
616
|
+
disabled: n,
|
|
617
|
+
value: d.value,
|
|
618
|
+
ref: p
|
|
457
619
|
}
|
|
458
620
|
) }),
|
|
459
|
-
v ? /* @__PURE__ */
|
|
621
|
+
v ? /* @__PURE__ */ a(
|
|
460
622
|
"button",
|
|
461
623
|
{
|
|
462
624
|
type: "button",
|
|
463
625
|
"aria-label": "Clear date",
|
|
464
626
|
className: "sa-calendar-input-clear",
|
|
465
|
-
onClick:
|
|
466
|
-
children: /* @__PURE__ */
|
|
627
|
+
onClick: k,
|
|
628
|
+
children: /* @__PURE__ */ a(
|
|
467
629
|
"svg",
|
|
468
630
|
{
|
|
469
631
|
xmlns: "http://www.w3.org/2000/svg",
|
|
470
|
-
width: H(
|
|
471
|
-
height: H(
|
|
632
|
+
width: H(e),
|
|
633
|
+
height: H(e),
|
|
472
634
|
viewBox: "0 0 20 20",
|
|
473
635
|
fill: "none",
|
|
474
|
-
children: /* @__PURE__ */
|
|
636
|
+
children: /* @__PURE__ */ a(
|
|
475
637
|
"path",
|
|
476
638
|
{
|
|
477
639
|
d: "M5 5L15 15M15 5L5 15",
|
|
@@ -484,15 +646,15 @@ const H = (a) => {
|
|
|
484
646
|
}
|
|
485
647
|
)
|
|
486
648
|
}
|
|
487
|
-
) : /* @__PURE__ */
|
|
649
|
+
) : /* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-right", children: /* @__PURE__ */ a(
|
|
488
650
|
"svg",
|
|
489
651
|
{
|
|
490
652
|
xmlns: "http://www.w3.org/2000/svg",
|
|
491
|
-
width: H(
|
|
492
|
-
height: H(
|
|
653
|
+
width: H(e),
|
|
654
|
+
height: H(e),
|
|
493
655
|
viewBox: "0 0 20 20",
|
|
494
656
|
fill: "none",
|
|
495
|
-
children: /* @__PURE__ */
|
|
657
|
+
children: /* @__PURE__ */ a(
|
|
496
658
|
"path",
|
|
497
659
|
{
|
|
498
660
|
d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
|
|
@@ -507,81 +669,82 @@ const H = (a) => {
|
|
|
507
669
|
]
|
|
508
670
|
}
|
|
509
671
|
);
|
|
510
|
-
},
|
|
511
|
-
date:
|
|
512
|
-
setDate:
|
|
672
|
+
}, cn = ({
|
|
673
|
+
date: r,
|
|
674
|
+
setDate: e,
|
|
513
675
|
dateRange: t,
|
|
514
|
-
setDateRange:
|
|
676
|
+
setDateRange: o,
|
|
515
677
|
onChange: l,
|
|
516
|
-
minDate:
|
|
517
|
-
maxDate:
|
|
518
|
-
input:
|
|
678
|
+
minDate: u,
|
|
679
|
+
maxDate: d,
|
|
680
|
+
input: p
|
|
519
681
|
}) => {
|
|
520
|
-
var
|
|
521
|
-
const [
|
|
522
|
-
let
|
|
523
|
-
const D =
|
|
524
|
-
for (let
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
) :
|
|
682
|
+
var h, m, F;
|
|
683
|
+
const [g, n] = j(null);
|
|
684
|
+
let c = new Date(r.getFullYear(), r.getMonth(), 1), v = c.getDay(), k = [];
|
|
685
|
+
const D = r.getMonth(), b = (/* @__PURE__ */ new Date()).toDateString(), f = !!(t.from && !t.to), s = f && g ? g : null;
|
|
686
|
+
for (let i = 0; i < 42; i++) {
|
|
687
|
+
i === 0 && v === 0 ? c.setDate(c.getDate() - 7) : i === 0 ? c.setDate(
|
|
688
|
+
c.getDate() + (i - v)
|
|
689
|
+
) : c.setDate(c.getDate() + 1);
|
|
528
690
|
let w = {
|
|
529
|
-
currentMonth:
|
|
530
|
-
date: new Date(
|
|
531
|
-
month:
|
|
532
|
-
number:
|
|
533
|
-
selected:
|
|
534
|
-
|
|
535
|
-
|
|
691
|
+
currentMonth: c.getMonth() === D,
|
|
692
|
+
date: new Date(c),
|
|
693
|
+
month: c.getMonth(),
|
|
694
|
+
number: c.getDate(),
|
|
695
|
+
selected: c.toDateString() === ((h = t.from) == null ? void 0 : h.toDateString()) || c.toDateString() === (((m = t.to) == null ? void 0 : m.toDateString()) || ((F = t.from) == null ? void 0 : F.toDateString())),
|
|
696
|
+
isToday: c.toDateString() === b,
|
|
697
|
+
year: c.getFullYear(),
|
|
698
|
+
isDisabled: u && c < u || d && c > d
|
|
536
699
|
};
|
|
537
|
-
|
|
700
|
+
k.push(w);
|
|
538
701
|
}
|
|
539
|
-
const
|
|
540
|
-
|
|
541
|
-
},
|
|
542
|
-
var
|
|
702
|
+
const x = (i) => {
|
|
703
|
+
e(i);
|
|
704
|
+
}, N = (i) => {
|
|
705
|
+
var L;
|
|
543
706
|
let w = { ...t };
|
|
544
707
|
if (w.from && w.to)
|
|
545
|
-
w = { from:
|
|
708
|
+
w = { from: i, to: null };
|
|
546
709
|
else {
|
|
547
|
-
const M = ((
|
|
548
|
-
|
|
710
|
+
const M = ((L = w.from) == null ? void 0 : L.getTime()) || 0;
|
|
711
|
+
i.getTime() > M ? w = { from: w.from, to: i } : w = { from: i, to: w.from };
|
|
549
712
|
}
|
|
550
|
-
|
|
713
|
+
o(w), l(w);
|
|
551
714
|
};
|
|
552
|
-
return /* @__PURE__ */
|
|
715
|
+
return /* @__PURE__ */ $(
|
|
553
716
|
"div",
|
|
554
717
|
{
|
|
555
718
|
className: "sa-calendar-days-preivew",
|
|
556
|
-
onMouseLeave: () =>
|
|
719
|
+
onMouseLeave: () => n(null),
|
|
557
720
|
children: [
|
|
558
|
-
/* @__PURE__ */
|
|
559
|
-
/* @__PURE__ */
|
|
560
|
-
const
|
|
561
|
-
if (!
|
|
721
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-name-preivew", children: en.map((i, w) => /* @__PURE__ */ a("p", { children: i }, w)) }),
|
|
722
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-number-preivew", children: k.map((i, w) => {
|
|
723
|
+
const L = t.from && t.to && i.date.getTime() > t.from.getTime() && i.date.getTime() < t.to.getTime(), M = (() => {
|
|
724
|
+
if (!s || !t.from)
|
|
562
725
|
return !1;
|
|
563
|
-
const C =
|
|
564
|
-
return
|
|
565
|
-
})(), T =
|
|
566
|
-
return /* @__PURE__ */
|
|
726
|
+
const C = i.date.getTime(), z = t.from.getTime(), A = s.getTime();
|
|
727
|
+
return A > z ? C > z && C < A : C < z && C > A;
|
|
728
|
+
})(), T = f && g && i.date.toDateString() === g.toDateString(), Y = i.isDisabled, E = () => L || M ? "var(--sa-color-info-alpha-a10, #64b5f61a)" : "", S = () => Y ? "var(--sa-color-gray-400, #b7b9be)" : L || M ? "var(--sa-color-gray-500, #8c8f97)" : "";
|
|
729
|
+
return /* @__PURE__ */ a(
|
|
567
730
|
"p",
|
|
568
731
|
{
|
|
569
|
-
className: `${
|
|
732
|
+
className: `${i.currentMonth ? "sa-calendar-days-current" : "sa-calendar-days"} ${i.selected || T ? "sa-calendar-days-active" : ""} ${i.isToday && !i.selected ? "sa-calendar-days-today" : ""}`,
|
|
570
733
|
style: {
|
|
571
734
|
backgroundColor: E(),
|
|
572
|
-
pointerEvents:
|
|
573
|
-
cursor:
|
|
574
|
-
color:
|
|
575
|
-
opacity: T && !
|
|
576
|
-
...
|
|
735
|
+
pointerEvents: Y ? "none" : void 0,
|
|
736
|
+
cursor: Y ? "not-allowed" : "pointer",
|
|
737
|
+
color: S(),
|
|
738
|
+
opacity: T && !i.selected ? 0.75 : 1,
|
|
739
|
+
...p ? {} : { width: "100%" }
|
|
577
740
|
},
|
|
578
741
|
onClick: () => {
|
|
579
|
-
|
|
742
|
+
Y || (x(i.date), N(i.date));
|
|
580
743
|
},
|
|
581
744
|
onMouseEnter: () => {
|
|
582
|
-
|
|
745
|
+
Y || n(i.date);
|
|
583
746
|
},
|
|
584
|
-
children:
|
|
747
|
+
children: i.number
|
|
585
748
|
},
|
|
586
749
|
w
|
|
587
750
|
);
|
|
@@ -589,112 +752,112 @@ const H = (a) => {
|
|
|
589
752
|
]
|
|
590
753
|
}
|
|
591
754
|
);
|
|
592
|
-
},
|
|
593
|
-
date:
|
|
594
|
-
setDate:
|
|
755
|
+
}, un = ({
|
|
756
|
+
date: r,
|
|
757
|
+
setDate: e,
|
|
595
758
|
filter: t,
|
|
596
|
-
setViews:
|
|
759
|
+
setViews: o,
|
|
597
760
|
dateRange: l,
|
|
598
|
-
setDateRange:
|
|
599
|
-
onChange:
|
|
600
|
-
minDate:
|
|
601
|
-
maxDate:
|
|
602
|
-
input:
|
|
761
|
+
setDateRange: u,
|
|
762
|
+
onChange: d,
|
|
763
|
+
minDate: p,
|
|
764
|
+
maxDate: g,
|
|
765
|
+
input: n
|
|
603
766
|
}) => {
|
|
604
|
-
const
|
|
605
|
-
t ? (D(
|
|
606
|
-
}, D = (
|
|
607
|
-
var
|
|
608
|
-
let
|
|
609
|
-
if (
|
|
610
|
-
|
|
767
|
+
const c = l.from.getFullYear(), v = r.getFullYear(), k = (b) => {
|
|
768
|
+
t ? (D(b), e(b)) : (o("days"), e(b));
|
|
769
|
+
}, D = (b) => {
|
|
770
|
+
var s;
|
|
771
|
+
let f = { ...l };
|
|
772
|
+
if (f.from && f.to)
|
|
773
|
+
f = { from: b, to: null };
|
|
611
774
|
else {
|
|
612
|
-
const
|
|
613
|
-
|
|
775
|
+
const x = ((s = f.from) == null ? void 0 : s.getTime()) || 0;
|
|
776
|
+
b.getTime() > x ? f = { from: f.from, to: b } : f = { from: b, to: f.from };
|
|
614
777
|
}
|
|
615
|
-
|
|
778
|
+
u(f), d(f);
|
|
616
779
|
};
|
|
617
|
-
return /* @__PURE__ */
|
|
618
|
-
var
|
|
619
|
-
const
|
|
620
|
-
return /* @__PURE__ */
|
|
780
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-months-preview", children: W.map((b, f) => {
|
|
781
|
+
var N, h, m;
|
|
782
|
+
const s = new Date(v, f).getTime() > l.from.getTime() && new Date(v, f).getTime() < (((N = l.to) == null ? void 0 : N.getTime()) || l.from.getTime()), x = p && new Date(v, f) < p || g && new Date(v, f) > g;
|
|
783
|
+
return /* @__PURE__ */ a(
|
|
621
784
|
"p",
|
|
622
785
|
{
|
|
623
|
-
className:
|
|
786
|
+
className: c === v && (f === ((h = l.from) == null ? void 0 : h.getMonth()) || f === ((m = l.to) == null ? void 0 : m.getMonth())) ? "sa-calendar-months-active" : "",
|
|
624
787
|
style: {
|
|
625
|
-
backgroundColor:
|
|
626
|
-
pointerEvents:
|
|
627
|
-
cursor:
|
|
628
|
-
color:
|
|
629
|
-
...
|
|
788
|
+
backgroundColor: s ? "var(--sa-color-info-alpha-a10, #64b5f61a)" : "",
|
|
789
|
+
pointerEvents: x ? "none" : void 0,
|
|
790
|
+
cursor: x ? "not-allowed" : "pointer",
|
|
791
|
+
color: x ? "var(--sa-color-gray-400, #b7b9be)" : s ? "var(--sa-color-gray-500, #8c8f97)" : "",
|
|
792
|
+
...n ? {} : { width: "100%" }
|
|
630
793
|
},
|
|
631
794
|
onClick: () => {
|
|
632
|
-
|
|
795
|
+
x || k(new Date(v, f));
|
|
633
796
|
},
|
|
634
|
-
children:
|
|
797
|
+
children: b.slice(0, 3)
|
|
635
798
|
},
|
|
636
|
-
|
|
799
|
+
f
|
|
637
800
|
);
|
|
638
801
|
}) });
|
|
639
|
-
},
|
|
640
|
-
const
|
|
641
|
-
return { start:
|
|
642
|
-
},
|
|
643
|
-
date:
|
|
644
|
-
filter:
|
|
802
|
+
}, q = (r) => {
|
|
803
|
+
const e = Math.floor(r / 10) * 10, t = e + 10;
|
|
804
|
+
return { start: e, end: t };
|
|
805
|
+
}, hn = ({
|
|
806
|
+
date: r,
|
|
807
|
+
filter: e,
|
|
645
808
|
setViews: t,
|
|
646
|
-
setDate:
|
|
809
|
+
setDate: o,
|
|
647
810
|
dateRange: l,
|
|
648
|
-
setDateRange:
|
|
649
|
-
onChange:
|
|
650
|
-
minDate:
|
|
651
|
-
maxDate:
|
|
652
|
-
input:
|
|
811
|
+
setDateRange: u,
|
|
812
|
+
onChange: d,
|
|
813
|
+
minDate: p,
|
|
814
|
+
maxDate: g,
|
|
815
|
+
input: n
|
|
653
816
|
}) => {
|
|
654
|
-
var
|
|
655
|
-
let
|
|
656
|
-
const v =
|
|
657
|
-
for (let
|
|
658
|
-
const
|
|
659
|
-
|
|
660
|
-
year:
|
|
661
|
-
active:
|
|
662
|
-
highlight:
|
|
663
|
-
disabled: !
|
|
817
|
+
var N;
|
|
818
|
+
let c = [];
|
|
819
|
+
const v = r.getFullYear(), { start: k, end: D } = q(v), b = l.from.getFullYear(), f = (N = l.to) == null ? void 0 : N.getFullYear();
|
|
820
|
+
for (let h = k; h < D; h++) {
|
|
821
|
+
const m = new Date(h, 0), F = (!p || m >= p) && (!g || m <= g), i = h === b || h === f, w = m > l.from && m < l.to;
|
|
822
|
+
c.push({
|
|
823
|
+
year: h,
|
|
824
|
+
active: i && F,
|
|
825
|
+
highlight: w && F,
|
|
826
|
+
disabled: !F
|
|
664
827
|
});
|
|
665
828
|
}
|
|
666
|
-
const
|
|
667
|
-
|
|
668
|
-
},
|
|
669
|
-
var
|
|
670
|
-
let
|
|
671
|
-
if (
|
|
672
|
-
|
|
829
|
+
const s = (h) => {
|
|
830
|
+
e ? (x(h), o(h)) : (o(h), t("months"));
|
|
831
|
+
}, x = (h) => {
|
|
832
|
+
var F;
|
|
833
|
+
let m = { ...l };
|
|
834
|
+
if (m.from && m.to)
|
|
835
|
+
m = { from: h, to: null };
|
|
673
836
|
else {
|
|
674
|
-
const
|
|
675
|
-
|
|
837
|
+
const i = ((F = m.from) == null ? void 0 : F.getTime()) || 0;
|
|
838
|
+
h.getTime() > i ? m = { from: m.from, to: h } : m = { from: h, to: m.from };
|
|
676
839
|
}
|
|
677
|
-
|
|
840
|
+
u(m), d(m);
|
|
678
841
|
};
|
|
679
|
-
return /* @__PURE__ */
|
|
842
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-years-preview", children: c.map((h, m) => /* @__PURE__ */ a(
|
|
680
843
|
"p",
|
|
681
844
|
{
|
|
682
|
-
className: `${
|
|
845
|
+
className: `${h.active ? "sa-calendar-months-active" : ""} ${h.highlight ? "sa-calendar-months-highlight" : ""} ${h.disabled ? "sa-calendar-disabled" : ""}`,
|
|
683
846
|
onClick: () => {
|
|
684
|
-
|
|
847
|
+
h.disabled || s(new Date(h.year, 0));
|
|
685
848
|
},
|
|
686
849
|
style: {
|
|
687
|
-
backgroundColor:
|
|
688
|
-
color:
|
|
689
|
-
cursor:
|
|
690
|
-
pointerEvents:
|
|
691
|
-
...
|
|
850
|
+
backgroundColor: h.highlight ? "var(--sa-color-info-alpha-a10, #64b5f61a)" : "",
|
|
851
|
+
color: h.highlight ? "var(--sa-color-gray-500, #8c8f97)" : h.active ? "" : h.disabled ? "var(--sa-color-gray-400, #b7b9be)" : "",
|
|
852
|
+
cursor: h.disabled ? "not-allowed" : "pointer",
|
|
853
|
+
pointerEvents: h.disbled ? "none" : "all",
|
|
854
|
+
...n ? {} : { width: "100%" }
|
|
692
855
|
},
|
|
693
|
-
children:
|
|
856
|
+
children: h.year
|
|
694
857
|
},
|
|
695
|
-
|
|
858
|
+
m
|
|
696
859
|
)) });
|
|
697
|
-
},
|
|
860
|
+
}, rn = ({ ...r }) => /* @__PURE__ */ a(
|
|
698
861
|
"svg",
|
|
699
862
|
{
|
|
700
863
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -702,8 +865,8 @@ const H = (a) => {
|
|
|
702
865
|
height: "20",
|
|
703
866
|
viewBox: "0 0 20 20",
|
|
704
867
|
fill: "none",
|
|
705
|
-
...
|
|
706
|
-
children: /* @__PURE__ */
|
|
868
|
+
...r,
|
|
869
|
+
children: /* @__PURE__ */ a(
|
|
707
870
|
"path",
|
|
708
871
|
{
|
|
709
872
|
d: "M12.5 3.33334L5.83337 10L12.5 16.6667",
|
|
@@ -714,7 +877,7 @@ const H = (a) => {
|
|
|
714
877
|
}
|
|
715
878
|
)
|
|
716
879
|
}
|
|
717
|
-
),
|
|
880
|
+
), tn = ({ ...r }) => /* @__PURE__ */ a(
|
|
718
881
|
"svg",
|
|
719
882
|
{
|
|
720
883
|
xmlns: "http://www.w3.org/2000/svg",
|
|
@@ -722,8 +885,8 @@ const H = (a) => {
|
|
|
722
885
|
height: "20",
|
|
723
886
|
viewBox: "0 0 20 20",
|
|
724
887
|
fill: "none",
|
|
725
|
-
...
|
|
726
|
-
children: /* @__PURE__ */
|
|
888
|
+
...r,
|
|
889
|
+
children: /* @__PURE__ */ a(
|
|
727
890
|
"path",
|
|
728
891
|
{
|
|
729
892
|
d: "M7.5 16.6667L14.1667 10L7.5 3.33334",
|
|
@@ -734,254 +897,258 @@ const H = (a) => {
|
|
|
734
897
|
}
|
|
735
898
|
)
|
|
736
899
|
}
|
|
737
|
-
),
|
|
738
|
-
setViews:
|
|
739
|
-
views:
|
|
900
|
+
), pn = ({
|
|
901
|
+
setViews: r,
|
|
902
|
+
views: e,
|
|
740
903
|
filter: t,
|
|
741
|
-
date:
|
|
904
|
+
date: o,
|
|
742
905
|
setDate: l
|
|
743
906
|
}) => {
|
|
744
|
-
const
|
|
745
|
-
t ||
|
|
746
|
-
},
|
|
747
|
-
if (
|
|
748
|
-
l((
|
|
907
|
+
const u = () => {
|
|
908
|
+
t || r((n) => n === "days" ? "months" : n === "months" ? "years" : "days");
|
|
909
|
+
}, d = () => {
|
|
910
|
+
if (e === "years") {
|
|
911
|
+
l((n) => new Date(n.getFullYear() + 10, 0));
|
|
749
912
|
return;
|
|
750
913
|
}
|
|
751
|
-
if (
|
|
752
|
-
l((
|
|
914
|
+
if (e === "months") {
|
|
915
|
+
l((n) => new Date(n.getFullYear() + 1, n.getMonth()));
|
|
753
916
|
return;
|
|
754
917
|
}
|
|
755
|
-
l((
|
|
756
|
-
},
|
|
757
|
-
if (
|
|
758
|
-
l((
|
|
918
|
+
l((n) => new Date(n.getFullYear(), n.getMonth() + 1));
|
|
919
|
+
}, p = () => {
|
|
920
|
+
if (e === "years") {
|
|
921
|
+
l((n) => new Date(n.getFullYear() - 10, 0));
|
|
759
922
|
return;
|
|
760
923
|
}
|
|
761
|
-
if (
|
|
762
|
-
l((
|
|
924
|
+
if (e === "months") {
|
|
925
|
+
l((n) => new Date(n.getFullYear() - 1, n.getMonth()));
|
|
763
926
|
return;
|
|
764
927
|
}
|
|
765
928
|
l(
|
|
766
|
-
(
|
|
767
|
-
|
|
768
|
-
|
|
929
|
+
(n) => new Date(
|
|
930
|
+
n.getMonth() === 0 ? n.getFullYear() - 1 : n.getFullYear(),
|
|
931
|
+
n.getMonth() === 0 ? 11 : n.getMonth() - 1
|
|
769
932
|
)
|
|
770
933
|
);
|
|
771
934
|
};
|
|
772
|
-
return /* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
return `${U(s.getFullYear()).start} ~ ${U(s.getFullYear()).end}`;
|
|
935
|
+
return /* @__PURE__ */ $("div", { className: "sa-calendar-header", children: [
|
|
936
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-header-title", onClick: u, children: (() => {
|
|
937
|
+
if (e === "days")
|
|
938
|
+
return `${W[o.getMonth()]} ${o.getFullYear()}`;
|
|
939
|
+
if (e === "months")
|
|
940
|
+
return `${o.getFullYear()}`;
|
|
941
|
+
if (e === "years")
|
|
942
|
+
return `${q(o.getFullYear()).start} ~ ${q(o.getFullYear()).end}`;
|
|
781
943
|
})() }),
|
|
782
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ $("div", { className: "sa-calendar-header-nav", children: [
|
|
945
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: p, children: /* @__PURE__ */ a(rn, {}) }),
|
|
946
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: d, children: /* @__PURE__ */ a(tn, {}) })
|
|
947
|
+
] })
|
|
783
948
|
] });
|
|
784
949
|
};
|
|
785
|
-
function
|
|
786
|
-
const
|
|
787
|
-
return `${
|
|
950
|
+
function P(r) {
|
|
951
|
+
const e = new Date(r), t = e.getFullYear(), o = e.getMonth();
|
|
952
|
+
return `${e.getDate().toString().padStart(2, "0")} ${on[o]} ${t}`;
|
|
788
953
|
}
|
|
789
|
-
const
|
|
790
|
-
label:
|
|
791
|
-
labelPosition:
|
|
954
|
+
const sn = ({
|
|
955
|
+
label: r,
|
|
956
|
+
labelPosition: e = "outside-top",
|
|
792
957
|
required: t,
|
|
793
|
-
optional:
|
|
958
|
+
optional: o,
|
|
794
959
|
description: l,
|
|
795
|
-
helperText:
|
|
796
|
-
errorText:
|
|
797
|
-
fullWidth:
|
|
798
|
-
children:
|
|
960
|
+
helperText: u,
|
|
961
|
+
errorText: d,
|
|
962
|
+
fullWidth: p,
|
|
963
|
+
children: g
|
|
799
964
|
}) => {
|
|
800
|
-
const
|
|
965
|
+
const n = [
|
|
801
966
|
"sa-date-field",
|
|
802
|
-
|
|
803
|
-
].filter(Boolean).join(" "),
|
|
804
|
-
/* @__PURE__ */
|
|
805
|
-
|
|
806
|
-
t && /* @__PURE__ */
|
|
807
|
-
] }) : null, v = /* @__PURE__ */
|
|
808
|
-
|
|
809
|
-
|
|
967
|
+
p ? "sa-date-field-fullwidth" : ""
|
|
968
|
+
].filter(Boolean).join(" "), c = r ? /* @__PURE__ */ $("div", { className: "sa-date-field-label-row", children: [
|
|
969
|
+
/* @__PURE__ */ a("span", { className: "sa-date-field-label-text", children: r }),
|
|
970
|
+
o && /* @__PURE__ */ a("span", { className: "sa-date-field-optional-badge", children: "Optional" }),
|
|
971
|
+
t && /* @__PURE__ */ a("span", { className: "sa-date-field-required", children: "*" })
|
|
972
|
+
] }) : null, v = /* @__PURE__ */ $(nn, { children: [
|
|
973
|
+
u && !d && /* @__PURE__ */ a("p", { className: "sa-date-field-helper", children: u }),
|
|
974
|
+
d && /* @__PURE__ */ a("p", { className: "sa-date-field-error-msg", children: d })
|
|
810
975
|
] });
|
|
811
|
-
return
|
|
812
|
-
/* @__PURE__ */
|
|
813
|
-
|
|
814
|
-
l && /* @__PURE__ */
|
|
976
|
+
return r ? e === "outside-left" ? /* @__PURE__ */ $("div", { className: `${n} sa-date-field-left`, children: [
|
|
977
|
+
/* @__PURE__ */ $("div", { className: "sa-date-field-left-label", children: [
|
|
978
|
+
c,
|
|
979
|
+
l && /* @__PURE__ */ a("p", { className: "sa-date-field-helper-top", children: l })
|
|
815
980
|
] }),
|
|
816
|
-
/* @__PURE__ */
|
|
817
|
-
|
|
981
|
+
/* @__PURE__ */ $("div", { className: "sa-date-field-input-wrap", children: [
|
|
982
|
+
g,
|
|
818
983
|
v
|
|
819
984
|
] })
|
|
820
|
-
] }) : /* @__PURE__ */
|
|
821
|
-
|
|
822
|
-
l && /* @__PURE__ */
|
|
823
|
-
|
|
985
|
+
] }) : /* @__PURE__ */ $("div", { className: n, children: [
|
|
986
|
+
c,
|
|
987
|
+
l && /* @__PURE__ */ a("p", { className: "sa-date-field-helper-top", children: l }),
|
|
988
|
+
g,
|
|
824
989
|
v
|
|
825
|
-
] }) : /* @__PURE__ */
|
|
826
|
-
l && /* @__PURE__ */
|
|
827
|
-
|
|
990
|
+
] }) : /* @__PURE__ */ $("div", { className: n, children: [
|
|
991
|
+
l && /* @__PURE__ */ a("p", { className: "sa-date-field-helper-top", children: l }),
|
|
992
|
+
g,
|
|
828
993
|
v
|
|
829
994
|
] });
|
|
830
|
-
}, Q = "sa-calendar-styles",
|
|
995
|
+
}, Q = "sa-calendar-styles", gn = (r) => {
|
|
831
996
|
if (!document.getElementById(Q)) {
|
|
832
|
-
const
|
|
833
|
-
|
|
997
|
+
const e = document.createElement("style");
|
|
998
|
+
e.id = Q, e.textContent = r, document.head.appendChild(e);
|
|
834
999
|
}
|
|
835
1000
|
};
|
|
836
|
-
|
|
837
|
-
const
|
|
1001
|
+
gn(R);
|
|
1002
|
+
const fn = Z(
|
|
838
1003
|
({
|
|
839
|
-
value:
|
|
840
|
-
onChange:
|
|
1004
|
+
value: r,
|
|
1005
|
+
onChange: e,
|
|
841
1006
|
filter: t,
|
|
842
|
-
input:
|
|
1007
|
+
input: o = !0,
|
|
843
1008
|
disabled: l,
|
|
844
|
-
minDate:
|
|
845
|
-
maxDate:
|
|
846
|
-
placeholder:
|
|
847
|
-
size:
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
1009
|
+
minDate: u,
|
|
1010
|
+
maxDate: d,
|
|
1011
|
+
placeholder: p,
|
|
1012
|
+
size: g,
|
|
1013
|
+
variant: n,
|
|
1014
|
+
status: c,
|
|
1015
|
+
clearable: v,
|
|
1016
|
+
fullWidth: k = !0,
|
|
1017
|
+
label: D,
|
|
1018
|
+
labelPosition: b,
|
|
1019
|
+
required: f,
|
|
1020
|
+
optional: s,
|
|
1021
|
+
description: x,
|
|
1022
|
+
helperText: N,
|
|
1023
|
+
errorText: h
|
|
1024
|
+
}, m) => {
|
|
1025
|
+
const F = h ? "error" : c, { ref: i, isComponentVisible: w, setIsComponentVisible: L } = an(!1), M = J(null), [T, Y] = j("days"), [E, S] = j(/* @__PURE__ */ new Date()), [C, z] = j({
|
|
1026
|
+
from: (r == null ? void 0 : r.from) || /* @__PURE__ */ new Date(),
|
|
1027
|
+
to: (r == null ? void 0 : r.to) || /* @__PURE__ */ new Date()
|
|
862
1028
|
});
|
|
863
|
-
|
|
864
|
-
|
|
1029
|
+
I(() => {
|
|
1030
|
+
r ? (S(r.from), z(r)) : (S(/* @__PURE__ */ new Date()), z({
|
|
865
1031
|
from: /* @__PURE__ */ new Date(),
|
|
866
1032
|
to: /* @__PURE__ */ new Date()
|
|
867
1033
|
}));
|
|
868
|
-
}, [
|
|
869
|
-
t &&
|
|
870
|
-
}, [t]),
|
|
871
|
-
t ||
|
|
872
|
-
}, [w]),
|
|
873
|
-
|
|
874
|
-
}, [
|
|
875
|
-
const
|
|
876
|
-
var
|
|
877
|
-
if (!
|
|
1034
|
+
}, [r]), I(() => {
|
|
1035
|
+
t && Y(t);
|
|
1036
|
+
}, [t]), I(() => {
|
|
1037
|
+
t || Y("days");
|
|
1038
|
+
}, [w]), I(() => {
|
|
1039
|
+
o || L(!0);
|
|
1040
|
+
}, [o]);
|
|
1041
|
+
const A = () => {
|
|
1042
|
+
var y, B;
|
|
1043
|
+
if (!r)
|
|
878
1044
|
return "";
|
|
879
1045
|
if (t) {
|
|
880
1046
|
if (T === "days")
|
|
881
|
-
return `${
|
|
1047
|
+
return `${P(C.from)} ~ ${P(C.to || C.from) || "-"}`;
|
|
882
1048
|
if (T === "months")
|
|
883
1049
|
return `${W[C.from.getMonth()]} ~ ${C.to ? W[C.to.getMonth()] : "-"}`;
|
|
884
1050
|
if (T === "years")
|
|
885
|
-
return `${(
|
|
1051
|
+
return `${(y = C.from) == null ? void 0 : y.getFullYear()} ~ ${((B = C.to) == null ? void 0 : B.getFullYear()) || "-"}`;
|
|
886
1052
|
} else
|
|
887
|
-
return `${
|
|
1053
|
+
return `${P(C.from)} ~ ${P(C.to || C.from) || "-"}`;
|
|
888
1054
|
}, V = () => {
|
|
889
|
-
if (M.current &&
|
|
890
|
-
const
|
|
891
|
-
window.innerWidth <
|
|
1055
|
+
if (M.current && i.current && o) {
|
|
1056
|
+
const y = i.current.getBoundingClientRect(), B = M.current.getBoundingClientRect();
|
|
1057
|
+
window.innerWidth < y.left + B.width ? M.current.style.left = `${y.left - B.width + y.width}px` : M.current.style.left = `${y.left}px`, y.top + B.height > window.innerHeight ? M.current.style.top = `${y.y - (y.height + B.height - 28)}px` : M.current.style.top = `${y.y + y.height}px`;
|
|
892
1058
|
}
|
|
893
1059
|
};
|
|
894
|
-
|
|
895
|
-
M.current &&
|
|
896
|
-
}, [M,
|
|
897
|
-
const
|
|
898
|
-
return
|
|
899
|
-
|
|
1060
|
+
I(() => {
|
|
1061
|
+
M.current && i.current && o && V();
|
|
1062
|
+
}, [M, i, w]), I(() => {
|
|
1063
|
+
const y = m == null ? void 0 : m.current;
|
|
1064
|
+
return y && y.addEventListener("scroll", V), window.addEventListener("scroll", V), () => {
|
|
1065
|
+
y && y.removeEventListener("scroll", V), window.removeEventListener("scroll", V);
|
|
900
1066
|
};
|
|
901
1067
|
}, []);
|
|
902
|
-
const
|
|
1068
|
+
const U = /* @__PURE__ */ $(
|
|
903
1069
|
"div",
|
|
904
1070
|
{
|
|
905
1071
|
className: "sa-calendar-wrapper",
|
|
906
|
-
style: { height:
|
|
907
|
-
ref:
|
|
1072
|
+
style: { height: o ? "auto" : "100%" },
|
|
1073
|
+
ref: o ? i : null,
|
|
908
1074
|
children: [
|
|
909
|
-
|
|
910
|
-
|
|
1075
|
+
o ? /* @__PURE__ */ a(
|
|
1076
|
+
dn,
|
|
911
1077
|
{
|
|
912
|
-
value:
|
|
1078
|
+
value: A(),
|
|
913
1079
|
inputMode: "none",
|
|
914
1080
|
onClick: () => {
|
|
915
|
-
|
|
1081
|
+
L(!0);
|
|
916
1082
|
},
|
|
917
1083
|
onChange: () => {
|
|
918
1084
|
},
|
|
919
1085
|
disabled: l,
|
|
920
|
-
placeholder:
|
|
921
|
-
size:
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
1086
|
+
placeholder: p,
|
|
1087
|
+
size: g,
|
|
1088
|
+
variant: n,
|
|
1089
|
+
status: F,
|
|
1090
|
+
clearable: v,
|
|
1091
|
+
onClear: () => e(void 0)
|
|
925
1092
|
}
|
|
926
1093
|
) : null,
|
|
927
|
-
w ? /* @__PURE__ */
|
|
1094
|
+
w ? /* @__PURE__ */ $(
|
|
928
1095
|
"div",
|
|
929
1096
|
{
|
|
930
|
-
className: `sa-calendar ${
|
|
1097
|
+
className: `sa-calendar sa-calendar-size-${g || "md"} ${o ? "" : "sa-calendar-no-input"}`,
|
|
931
1098
|
ref: M,
|
|
932
1099
|
children: [
|
|
933
|
-
/* @__PURE__ */
|
|
934
|
-
|
|
1100
|
+
/* @__PURE__ */ a(
|
|
1101
|
+
pn,
|
|
935
1102
|
{
|
|
936
|
-
setViews:
|
|
1103
|
+
setViews: Y,
|
|
937
1104
|
views: T,
|
|
938
1105
|
filter: t,
|
|
939
1106
|
date: E,
|
|
940
|
-
setDate:
|
|
1107
|
+
setDate: S
|
|
941
1108
|
}
|
|
942
1109
|
),
|
|
943
|
-
/* @__PURE__ */
|
|
944
|
-
|
|
1110
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-body", children: T === "days" ? /* @__PURE__ */ a(
|
|
1111
|
+
cn,
|
|
945
1112
|
{
|
|
946
1113
|
date: E,
|
|
947
|
-
setDate:
|
|
948
|
-
setIsComponentVisible:
|
|
1114
|
+
setDate: S,
|
|
1115
|
+
setIsComponentVisible: L,
|
|
949
1116
|
dateRange: C,
|
|
950
|
-
setDateRange:
|
|
951
|
-
input:
|
|
952
|
-
onChange:
|
|
953
|
-
minDate:
|
|
954
|
-
maxDate:
|
|
1117
|
+
setDateRange: z,
|
|
1118
|
+
input: o,
|
|
1119
|
+
onChange: e,
|
|
1120
|
+
minDate: u,
|
|
1121
|
+
maxDate: d
|
|
955
1122
|
}
|
|
956
|
-
) : T === "months" ? /* @__PURE__ */
|
|
957
|
-
|
|
1123
|
+
) : T === "months" ? /* @__PURE__ */ a(
|
|
1124
|
+
un,
|
|
958
1125
|
{
|
|
959
1126
|
date: E,
|
|
960
|
-
setDate:
|
|
1127
|
+
setDate: S,
|
|
961
1128
|
filter: t,
|
|
962
|
-
setViews:
|
|
1129
|
+
setViews: Y,
|
|
963
1130
|
dateRange: C,
|
|
964
|
-
setDateRange:
|
|
965
|
-
setIsComponentVisible:
|
|
966
|
-
input:
|
|
967
|
-
onChange:
|
|
968
|
-
minDate:
|
|
969
|
-
maxDate:
|
|
1131
|
+
setDateRange: z,
|
|
1132
|
+
setIsComponentVisible: L,
|
|
1133
|
+
input: o,
|
|
1134
|
+
onChange: e,
|
|
1135
|
+
minDate: u,
|
|
1136
|
+
maxDate: d
|
|
970
1137
|
}
|
|
971
|
-
) : /* @__PURE__ */
|
|
972
|
-
|
|
1138
|
+
) : /* @__PURE__ */ a(
|
|
1139
|
+
hn,
|
|
973
1140
|
{
|
|
974
1141
|
date: E,
|
|
975
|
-
setDate:
|
|
1142
|
+
setDate: S,
|
|
976
1143
|
filter: t,
|
|
977
|
-
setViews:
|
|
1144
|
+
setViews: Y,
|
|
978
1145
|
dateRange: C,
|
|
979
|
-
setDateRange:
|
|
980
|
-
setIsComponentVisible:
|
|
981
|
-
input:
|
|
982
|
-
onChange:
|
|
983
|
-
minDate:
|
|
984
|
-
maxDate:
|
|
1146
|
+
setDateRange: z,
|
|
1147
|
+
setIsComponentVisible: L,
|
|
1148
|
+
input: o,
|
|
1149
|
+
onChange: e,
|
|
1150
|
+
minDate: u,
|
|
1151
|
+
maxDate: d
|
|
985
1152
|
}
|
|
986
1153
|
) })
|
|
987
1154
|
]
|
|
@@ -990,63 +1157,63 @@ const pe = G(
|
|
|
990
1157
|
]
|
|
991
1158
|
}
|
|
992
1159
|
);
|
|
993
|
-
return /* @__PURE__ */
|
|
994
|
-
|
|
1160
|
+
return /* @__PURE__ */ a(
|
|
1161
|
+
sn,
|
|
995
1162
|
{
|
|
996
|
-
label:
|
|
997
|
-
labelPosition:
|
|
998
|
-
required:
|
|
999
|
-
optional:
|
|
1000
|
-
description:
|
|
1001
|
-
helperText:
|
|
1002
|
-
errorText:
|
|
1003
|
-
fullWidth:
|
|
1004
|
-
children:
|
|
1163
|
+
label: D,
|
|
1164
|
+
labelPosition: b,
|
|
1165
|
+
required: f,
|
|
1166
|
+
optional: s,
|
|
1167
|
+
description: x,
|
|
1168
|
+
helperText: N,
|
|
1169
|
+
errorText: h,
|
|
1170
|
+
fullWidth: k,
|
|
1171
|
+
children: U
|
|
1005
1172
|
}
|
|
1006
1173
|
);
|
|
1007
1174
|
}
|
|
1008
|
-
), X = "sa-calendar-input-styles",
|
|
1175
|
+
), X = "sa-calendar-input-styles", bn = (r) => {
|
|
1009
1176
|
if (!document.getElementById(X)) {
|
|
1010
|
-
const
|
|
1011
|
-
|
|
1177
|
+
const e = document.createElement("style");
|
|
1178
|
+
e.id = X, e.textContent = r, document.head.appendChild(e);
|
|
1012
1179
|
}
|
|
1013
1180
|
};
|
|
1014
|
-
|
|
1015
|
-
const O = (
|
|
1016
|
-
if (
|
|
1181
|
+
bn(R);
|
|
1182
|
+
const O = (r) => {
|
|
1183
|
+
if (r === "sm")
|
|
1017
1184
|
return 16;
|
|
1018
|
-
if (
|
|
1185
|
+
if (r === "md")
|
|
1019
1186
|
return 16;
|
|
1020
|
-
if (
|
|
1187
|
+
if (r === "lg")
|
|
1021
1188
|
return 20;
|
|
1022
|
-
},
|
|
1189
|
+
}, mn = (r) => {
|
|
1023
1190
|
const {
|
|
1024
|
-
size:
|
|
1191
|
+
size: e = "md",
|
|
1025
1192
|
status: t = "default",
|
|
1026
|
-
variant:
|
|
1193
|
+
variant: o = "outline",
|
|
1027
1194
|
clearable: l,
|
|
1028
|
-
onClear:
|
|
1029
|
-
...
|
|
1030
|
-
} =
|
|
1031
|
-
|
|
1032
|
-
},
|
|
1033
|
-
D.stopPropagation(),
|
|
1195
|
+
onClear: u,
|
|
1196
|
+
...d
|
|
1197
|
+
} = r, p = J(null), g = () => {
|
|
1198
|
+
p.current && d.onClick && (p.current.focus(), d.onClick(""));
|
|
1199
|
+
}, n = t === "disable" || d.disabled, c = !!d.value, v = l && c && !n, k = (D) => {
|
|
1200
|
+
D.stopPropagation(), u == null || u();
|
|
1034
1201
|
};
|
|
1035
|
-
return /* @__PURE__ */
|
|
1202
|
+
return /* @__PURE__ */ $(
|
|
1036
1203
|
"div",
|
|
1037
1204
|
{
|
|
1038
|
-
className: `sa-calendar-input-container sa-calendar-input-${
|
|
1039
|
-
onClick:
|
|
1205
|
+
className: `sa-calendar-input-container sa-calendar-input-${o} sa-calendar-input-container-${t} ${e} `,
|
|
1206
|
+
onClick: g,
|
|
1040
1207
|
children: [
|
|
1041
|
-
/* @__PURE__ */
|
|
1208
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-left", children: /* @__PURE__ */ a(
|
|
1042
1209
|
"svg",
|
|
1043
1210
|
{
|
|
1044
1211
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1045
|
-
width: O(
|
|
1046
|
-
height: O(
|
|
1212
|
+
width: O(e),
|
|
1213
|
+
height: O(e),
|
|
1047
1214
|
viewBox: "0 0 20 20",
|
|
1048
1215
|
fill: "none",
|
|
1049
|
-
children: /* @__PURE__ */
|
|
1216
|
+
children: /* @__PURE__ */ a(
|
|
1050
1217
|
"path",
|
|
1051
1218
|
{
|
|
1052
1219
|
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",
|
|
@@ -1058,32 +1225,32 @@ const O = (a) => {
|
|
|
1058
1225
|
)
|
|
1059
1226
|
}
|
|
1060
1227
|
) }),
|
|
1061
|
-
/* @__PURE__ */
|
|
1228
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-input-preview-container", children: /* @__PURE__ */ a(
|
|
1062
1229
|
"input",
|
|
1063
1230
|
{
|
|
1064
1231
|
className: "sa-calendar-input",
|
|
1065
|
-
...
|
|
1066
|
-
disabled:
|
|
1067
|
-
value:
|
|
1068
|
-
ref:
|
|
1232
|
+
...d,
|
|
1233
|
+
disabled: n,
|
|
1234
|
+
value: d.value,
|
|
1235
|
+
ref: p
|
|
1069
1236
|
}
|
|
1070
1237
|
) }),
|
|
1071
|
-
v ? /* @__PURE__ */
|
|
1238
|
+
v ? /* @__PURE__ */ a(
|
|
1072
1239
|
"button",
|
|
1073
1240
|
{
|
|
1074
1241
|
type: "button",
|
|
1075
1242
|
"aria-label": "Clear date",
|
|
1076
1243
|
className: "sa-calendar-input-clear",
|
|
1077
|
-
onClick:
|
|
1078
|
-
children: /* @__PURE__ */
|
|
1244
|
+
onClick: k,
|
|
1245
|
+
children: /* @__PURE__ */ a(
|
|
1079
1246
|
"svg",
|
|
1080
1247
|
{
|
|
1081
1248
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1082
|
-
width: O(
|
|
1083
|
-
height: O(
|
|
1249
|
+
width: O(e),
|
|
1250
|
+
height: O(e),
|
|
1084
1251
|
viewBox: "0 0 20 20",
|
|
1085
1252
|
fill: "none",
|
|
1086
|
-
children: /* @__PURE__ */
|
|
1253
|
+
children: /* @__PURE__ */ a(
|
|
1087
1254
|
"path",
|
|
1088
1255
|
{
|
|
1089
1256
|
d: "M5 5L15 15M15 5L5 15",
|
|
@@ -1096,15 +1263,15 @@ const O = (a) => {
|
|
|
1096
1263
|
}
|
|
1097
1264
|
)
|
|
1098
1265
|
}
|
|
1099
|
-
) : /* @__PURE__ */
|
|
1266
|
+
) : /* @__PURE__ */ a("div", { className: "sa-calendar-input-container-icon-right", children: /* @__PURE__ */ a(
|
|
1100
1267
|
"svg",
|
|
1101
1268
|
{
|
|
1102
1269
|
xmlns: "http://www.w3.org/2000/svg",
|
|
1103
|
-
width: O(
|
|
1104
|
-
height: O(
|
|
1270
|
+
width: O(e),
|
|
1271
|
+
height: O(e),
|
|
1105
1272
|
viewBox: "0 0 20 20",
|
|
1106
1273
|
fill: "none",
|
|
1107
|
-
children: /* @__PURE__ */
|
|
1274
|
+
children: /* @__PURE__ */ a(
|
|
1108
1275
|
"path",
|
|
1109
1276
|
{
|
|
1110
1277
|
d: "M3.33331 7.5L9.99998 14.1667L16.6666 7.5",
|
|
@@ -1119,324 +1286,329 @@ const O = (a) => {
|
|
|
1119
1286
|
]
|
|
1120
1287
|
}
|
|
1121
1288
|
);
|
|
1122
|
-
},
|
|
1123
|
-
date:
|
|
1124
|
-
setDate:
|
|
1289
|
+
}, vn = ({
|
|
1290
|
+
date: r,
|
|
1291
|
+
setDate: e,
|
|
1125
1292
|
previewDate: t,
|
|
1126
|
-
setPreviewDate:
|
|
1293
|
+
setPreviewDate: o,
|
|
1127
1294
|
setIsComponentVisible: l,
|
|
1128
|
-
minDate:
|
|
1129
|
-
maxDate:
|
|
1130
|
-
input:
|
|
1131
|
-
onChange:
|
|
1295
|
+
minDate: u,
|
|
1296
|
+
maxDate: d,
|
|
1297
|
+
input: p,
|
|
1298
|
+
onChange: g
|
|
1132
1299
|
}) => {
|
|
1133
|
-
let
|
|
1300
|
+
let n = new Date(
|
|
1134
1301
|
t.getFullYear(),
|
|
1135
1302
|
t.getMonth(),
|
|
1136
1303
|
1
|
|
1137
|
-
),
|
|
1138
|
-
const
|
|
1139
|
-
for (let
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
) :
|
|
1143
|
-
let
|
|
1144
|
-
currentMonth:
|
|
1145
|
-
date: new Date(
|
|
1146
|
-
month:
|
|
1147
|
-
number:
|
|
1148
|
-
selected:
|
|
1149
|
-
|
|
1150
|
-
|
|
1304
|
+
), c = n.getDay(), v = [];
|
|
1305
|
+
const k = r.toDateString(), D = (/* @__PURE__ */ new Date()).toDateString(), b = t.getMonth();
|
|
1306
|
+
for (let s = 0; s < 42; s++) {
|
|
1307
|
+
s === 0 && c === 0 ? n.setDate(n.getDate() - 7) : s === 0 ? n.setDate(
|
|
1308
|
+
n.getDate() + (s - c)
|
|
1309
|
+
) : n.setDate(n.getDate() + 1);
|
|
1310
|
+
let x = {
|
|
1311
|
+
currentMonth: n.getMonth() === b,
|
|
1312
|
+
date: new Date(n),
|
|
1313
|
+
month: n.getMonth(),
|
|
1314
|
+
number: n.getDate(),
|
|
1315
|
+
selected: n.toDateString() === k,
|
|
1316
|
+
isToday: n.toDateString() === D,
|
|
1317
|
+
year: n.getFullYear(),
|
|
1318
|
+
isDisabled: u && n < u || d && n > d
|
|
1151
1319
|
};
|
|
1152
|
-
v.push(
|
|
1320
|
+
v.push(x);
|
|
1153
1321
|
}
|
|
1154
|
-
const
|
|
1155
|
-
(!
|
|
1322
|
+
const f = (s) => {
|
|
1323
|
+
(!u || s >= u) && (!d || s <= d) && (e(s), g(s), o(s), p && l(!1));
|
|
1156
1324
|
};
|
|
1157
|
-
return /* @__PURE__ */
|
|
1158
|
-
/* @__PURE__ */
|
|
1159
|
-
/* @__PURE__ */
|
|
1160
|
-
const
|
|
1161
|
-
return /* @__PURE__ */
|
|
1325
|
+
return /* @__PURE__ */ $("div", { className: "sa-calendar-days-preivew", children: [
|
|
1326
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-name-preivew", children: en.map((s, x) => /* @__PURE__ */ a("p", { children: s }, x)) }),
|
|
1327
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-days-number-preivew", children: v.map((s, x) => {
|
|
1328
|
+
const N = s.isDisabled;
|
|
1329
|
+
return /* @__PURE__ */ a(
|
|
1162
1330
|
"p",
|
|
1163
1331
|
{
|
|
1164
|
-
className: `${
|
|
1332
|
+
className: `${s.currentMonth ? "sa-calendar-days-current" : "sa-calendar-days"} ${s.selected ? "sa-calendar-days-active" : ""} ${s.isToday && !s.selected ? "sa-calendar-days-today" : ""}`,
|
|
1165
1333
|
style: {
|
|
1166
|
-
color:
|
|
1167
|
-
pointerEvents:
|
|
1168
|
-
cursor:
|
|
1169
|
-
...
|
|
1334
|
+
color: N ? "#ccc" : void 0,
|
|
1335
|
+
pointerEvents: N ? "none" : void 0,
|
|
1336
|
+
cursor: N ? "not-allowed" : "pointer",
|
|
1337
|
+
...p ? {} : { width: "100%" }
|
|
1170
1338
|
},
|
|
1171
1339
|
onClick: () => {
|
|
1172
|
-
|
|
1340
|
+
N || f(s.date);
|
|
1173
1341
|
},
|
|
1174
|
-
children:
|
|
1342
|
+
children: s.number
|
|
1175
1343
|
},
|
|
1176
|
-
|
|
1344
|
+
x
|
|
1177
1345
|
);
|
|
1178
1346
|
}) })
|
|
1179
1347
|
] });
|
|
1180
|
-
},
|
|
1181
|
-
date:
|
|
1182
|
-
setDate:
|
|
1348
|
+
}, yn = ({
|
|
1349
|
+
date: r,
|
|
1350
|
+
setDate: e,
|
|
1183
1351
|
filter: t,
|
|
1184
|
-
setViews:
|
|
1352
|
+
setViews: o,
|
|
1185
1353
|
onChange: l,
|
|
1186
|
-
previewDate:
|
|
1187
|
-
setPreviewDate:
|
|
1188
|
-
minDate:
|
|
1189
|
-
maxDate:
|
|
1190
|
-
input:
|
|
1354
|
+
previewDate: u,
|
|
1355
|
+
setPreviewDate: d,
|
|
1356
|
+
minDate: p,
|
|
1357
|
+
maxDate: g,
|
|
1358
|
+
input: n
|
|
1191
1359
|
}) => {
|
|
1192
|
-
const
|
|
1193
|
-
(!
|
|
1360
|
+
const c = r.getMonth(), v = r.getFullYear(), k = u.getFullYear(), D = (b) => {
|
|
1361
|
+
(!p || b >= p) && (!g || b <= g) && (t ? (l(b), e(b), d(b)) : (o("days"), d(b)));
|
|
1194
1362
|
};
|
|
1195
|
-
return /* @__PURE__ */
|
|
1196
|
-
const
|
|
1197
|
-
return /* @__PURE__ */
|
|
1363
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-months-preview", children: W.map((b, f) => {
|
|
1364
|
+
const s = p && new Date(k, f, 1) < p || g && new Date(k, f + 1, 0) > g;
|
|
1365
|
+
return /* @__PURE__ */ a(
|
|
1198
1366
|
"p",
|
|
1199
1367
|
{
|
|
1200
|
-
className:
|
|
1368
|
+
className: f === c && k === v ? "sa-calendar-months-active" : "",
|
|
1201
1369
|
style: {
|
|
1202
|
-
color:
|
|
1203
|
-
pointerEvents:
|
|
1204
|
-
cursor:
|
|
1205
|
-
...
|
|
1370
|
+
color: s ? "#ccc" : void 0,
|
|
1371
|
+
pointerEvents: s ? "none" : void 0,
|
|
1372
|
+
cursor: s ? "not-allowed" : "pointer",
|
|
1373
|
+
...n ? {} : { width: "100%" }
|
|
1206
1374
|
},
|
|
1207
1375
|
onClick: () => {
|
|
1208
|
-
|
|
1376
|
+
s || D(new Date(k, f));
|
|
1209
1377
|
},
|
|
1210
|
-
children:
|
|
1378
|
+
children: b.slice(0, 3)
|
|
1211
1379
|
},
|
|
1212
|
-
|
|
1380
|
+
f
|
|
1213
1381
|
);
|
|
1214
1382
|
}) });
|
|
1215
|
-
},
|
|
1216
|
-
const
|
|
1217
|
-
return { start:
|
|
1218
|
-
},
|
|
1219
|
-
date:
|
|
1220
|
-
filter:
|
|
1383
|
+
}, G = (r) => {
|
|
1384
|
+
const e = Math.floor(r / 10) * 10, t = e + 10;
|
|
1385
|
+
return { start: e, end: t };
|
|
1386
|
+
}, wn = ({
|
|
1387
|
+
date: r,
|
|
1388
|
+
filter: e,
|
|
1221
1389
|
setViews: t,
|
|
1222
|
-
setDate:
|
|
1390
|
+
setDate: o,
|
|
1223
1391
|
onChange: l,
|
|
1224
|
-
previewDate:
|
|
1225
|
-
setPreviewDate:
|
|
1226
|
-
minDate:
|
|
1227
|
-
maxDate:
|
|
1228
|
-
input:
|
|
1392
|
+
previewDate: u,
|
|
1393
|
+
setPreviewDate: d,
|
|
1394
|
+
minDate: p,
|
|
1395
|
+
maxDate: g,
|
|
1396
|
+
input: n
|
|
1229
1397
|
}) => {
|
|
1230
|
-
let
|
|
1231
|
-
const v =
|
|
1232
|
-
for (let
|
|
1233
|
-
let
|
|
1234
|
-
|
|
1398
|
+
let c = [];
|
|
1399
|
+
const v = u.getFullYear(), { start: k, end: D } = G(v), b = r.getFullYear();
|
|
1400
|
+
for (let s = k; s < D; s++) {
|
|
1401
|
+
let x = p && new Date(s, 0, 1) < p || g && new Date(s, 11, 31) > g;
|
|
1402
|
+
c.push({ year: s, active: s === b, isDisabled: x });
|
|
1235
1403
|
}
|
|
1236
|
-
const
|
|
1237
|
-
(!
|
|
1404
|
+
const f = (s) => {
|
|
1405
|
+
(!p || s >= p) && (!g || s <= g) && (e ? (l(s), o(s), d(s)) : (t("months"), d(s)));
|
|
1238
1406
|
};
|
|
1239
|
-
return /* @__PURE__ */
|
|
1407
|
+
return /* @__PURE__ */ a("div", { className: "sa-calendar-years-preview", children: c.map((s, x) => /* @__PURE__ */ a(
|
|
1240
1408
|
"p",
|
|
1241
1409
|
{
|
|
1242
|
-
className:
|
|
1410
|
+
className: s.active ? "sa-calendar-months-active" : "",
|
|
1243
1411
|
style: {
|
|
1244
|
-
color:
|
|
1245
|
-
pointerEvents:
|
|
1246
|
-
cursor:
|
|
1247
|
-
...
|
|
1412
|
+
color: s.isDisabled ? "#ccc" : void 0,
|
|
1413
|
+
pointerEvents: s.isDisabled ? "none" : void 0,
|
|
1414
|
+
cursor: s.isDisabled ? "not-allowed" : "pointer",
|
|
1415
|
+
...n ? {} : { width: "100%" }
|
|
1248
1416
|
},
|
|
1249
1417
|
onClick: () => {
|
|
1250
|
-
|
|
1418
|
+
s.isDisabled || f(new Date(s.year, 0));
|
|
1251
1419
|
},
|
|
1252
|
-
children:
|
|
1420
|
+
children: s.year
|
|
1253
1421
|
},
|
|
1254
|
-
|
|
1422
|
+
x
|
|
1255
1423
|
)) });
|
|
1256
|
-
},
|
|
1257
|
-
setViews:
|
|
1258
|
-
views:
|
|
1424
|
+
}, xn = ({
|
|
1425
|
+
setViews: r,
|
|
1426
|
+
views: e,
|
|
1259
1427
|
filter: t,
|
|
1260
|
-
previewDate:
|
|
1428
|
+
previewDate: o,
|
|
1261
1429
|
setPreviewDate: l
|
|
1262
1430
|
}) => {
|
|
1263
|
-
const
|
|
1264
|
-
t ||
|
|
1265
|
-
},
|
|
1266
|
-
if (
|
|
1267
|
-
l((
|
|
1431
|
+
const u = () => {
|
|
1432
|
+
t || r((n) => n === "days" ? "months" : n === "months" ? "years" : "days");
|
|
1433
|
+
}, d = () => {
|
|
1434
|
+
if (e === "years") {
|
|
1435
|
+
l((n) => new Date(n.getFullYear() + 10, 0));
|
|
1268
1436
|
return;
|
|
1269
1437
|
}
|
|
1270
|
-
if (
|
|
1438
|
+
if (e === "months") {
|
|
1271
1439
|
l(
|
|
1272
|
-
(
|
|
1440
|
+
(n) => new Date(n.getFullYear() + 1, n.getMonth())
|
|
1273
1441
|
);
|
|
1274
1442
|
return;
|
|
1275
1443
|
}
|
|
1276
|
-
l((
|
|
1277
|
-
},
|
|
1278
|
-
if (
|
|
1279
|
-
l((
|
|
1444
|
+
l((n) => new Date(n.getFullYear(), n.getMonth() + 1));
|
|
1445
|
+
}, p = () => {
|
|
1446
|
+
if (e === "years") {
|
|
1447
|
+
l((n) => new Date(n.getFullYear() - 10, 0));
|
|
1280
1448
|
return;
|
|
1281
1449
|
}
|
|
1282
|
-
if (
|
|
1450
|
+
if (e === "months") {
|
|
1283
1451
|
l(
|
|
1284
|
-
(
|
|
1452
|
+
(n) => new Date(n.getFullYear() - 1, n.getMonth())
|
|
1285
1453
|
);
|
|
1286
1454
|
return;
|
|
1287
1455
|
}
|
|
1288
1456
|
l(
|
|
1289
|
-
(
|
|
1290
|
-
|
|
1291
|
-
|
|
1457
|
+
(n) => new Date(
|
|
1458
|
+
n.getMonth() === 0 ? n.getFullYear() - 1 : n.getFullYear(),
|
|
1459
|
+
n.getMonth() === 0 ? 11 : n.getMonth() - 1
|
|
1292
1460
|
)
|
|
1293
1461
|
);
|
|
1294
1462
|
};
|
|
1295
|
-
return /* @__PURE__ */
|
|
1296
|
-
/* @__PURE__ */
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
return `${q(s.getFullYear()).start} ~ ${q(s.getFullYear()).end}`;
|
|
1463
|
+
return /* @__PURE__ */ $("div", { className: "sa-calendar-header", children: [
|
|
1464
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-header-title", onClick: u, children: (() => {
|
|
1465
|
+
if (e === "days")
|
|
1466
|
+
return `${W[o.getMonth()]} ${o.getFullYear()}`;
|
|
1467
|
+
if (e === "months")
|
|
1468
|
+
return `${o.getFullYear()}`;
|
|
1469
|
+
if (e === "years")
|
|
1470
|
+
return `${G(o.getFullYear()).start} ~ ${G(o.getFullYear()).end}`;
|
|
1304
1471
|
})() }),
|
|
1305
|
-
/* @__PURE__ */
|
|
1472
|
+
/* @__PURE__ */ $("div", { className: "sa-calendar-header-nav", children: [
|
|
1473
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: p, children: /* @__PURE__ */ a(rn, {}) }),
|
|
1474
|
+
/* @__PURE__ */ a("button", { className: "sa-calendar-nav-btn", onClick: d, children: /* @__PURE__ */ a(tn, {}) })
|
|
1475
|
+
] })
|
|
1306
1476
|
] });
|
|
1307
|
-
},
|
|
1308
|
-
if (!document.getElementById(
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1477
|
+
}, _ = "sa-calendar-styles", kn = (r) => {
|
|
1478
|
+
if (!document.getElementById(_)) {
|
|
1479
|
+
const e = document.createElement("style");
|
|
1480
|
+
e.id = _, e.textContent = r, document.head.appendChild(e);
|
|
1311
1481
|
}
|
|
1312
1482
|
};
|
|
1313
|
-
|
|
1314
|
-
const
|
|
1483
|
+
kn(R);
|
|
1484
|
+
const Mn = Z(
|
|
1315
1485
|
({
|
|
1316
|
-
value:
|
|
1317
|
-
onChange:
|
|
1486
|
+
value: r,
|
|
1487
|
+
onChange: e,
|
|
1318
1488
|
filter: t,
|
|
1319
|
-
input:
|
|
1489
|
+
input: o = !0,
|
|
1320
1490
|
disabled: l,
|
|
1321
|
-
minDate:
|
|
1322
|
-
maxDate:
|
|
1323
|
-
placeholder:
|
|
1324
|
-
size:
|
|
1325
|
-
|
|
1326
|
-
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
|
|
1337
|
-
S(()
|
|
1338
|
-
|
|
1339
|
-
|
|
1340
|
-
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1491
|
+
minDate: u,
|
|
1492
|
+
maxDate: d,
|
|
1493
|
+
placeholder: p,
|
|
1494
|
+
size: g,
|
|
1495
|
+
variant: n,
|
|
1496
|
+
status: c,
|
|
1497
|
+
clearable: v,
|
|
1498
|
+
fullWidth: k = !0,
|
|
1499
|
+
label: D,
|
|
1500
|
+
labelPosition: b,
|
|
1501
|
+
required: f,
|
|
1502
|
+
optional: s,
|
|
1503
|
+
description: x,
|
|
1504
|
+
helperText: N,
|
|
1505
|
+
errorText: h
|
|
1506
|
+
}, m) => {
|
|
1507
|
+
const F = h ? "error" : c, { ref: i, isComponentVisible: w, setIsComponentVisible: L } = an(!1), M = J(null), [T, Y] = j("days"), [E, S] = j(/* @__PURE__ */ new Date()), [C, z] = j(/* @__PURE__ */ new Date());
|
|
1508
|
+
I(() => {
|
|
1509
|
+
r ? (S(r), z(r)) : (S(/* @__PURE__ */ new Date()), z(/* @__PURE__ */ new Date()));
|
|
1510
|
+
}, [r]), I(() => {
|
|
1511
|
+
t && Y(t);
|
|
1512
|
+
}, [t]), I(() => {
|
|
1513
|
+
t || Y("days");
|
|
1514
|
+
}, [w]), I(() => {
|
|
1515
|
+
o || L(!0);
|
|
1516
|
+
}, [o]);
|
|
1517
|
+
const A = () => r ? t === "days" ? P(E) : t === "months" ? `${W[E.getMonth()]} ${E.getFullYear()}` : t === "years" ? E.getFullYear() : P(E) : "", V = () => {
|
|
1518
|
+
if (M.current && i.current && o) {
|
|
1519
|
+
const y = i.current.getBoundingClientRect(), B = M.current.getBoundingClientRect();
|
|
1520
|
+
window.innerWidth < y.left + B.width ? M.current.style.left = `${y.left - B.width + y.width}px` : M.current.style.left = `${y.left}px`, y.top + B.height > window.innerHeight ? M.current.style.top = `${y.y - (y.height + B.height - 28)}px` : M.current.style.top = `${y.y + y.height}px`;
|
|
1350
1521
|
}
|
|
1351
1522
|
};
|
|
1352
|
-
|
|
1353
|
-
M.current &&
|
|
1354
|
-
}, [M,
|
|
1355
|
-
const
|
|
1356
|
-
return
|
|
1357
|
-
|
|
1523
|
+
I(() => {
|
|
1524
|
+
M.current && i.current && o && V();
|
|
1525
|
+
}, [M, i, w]), I(() => {
|
|
1526
|
+
const y = m == null ? void 0 : m.current;
|
|
1527
|
+
return y && y.addEventListener("scroll", V), window.addEventListener("scroll", V), () => {
|
|
1528
|
+
y && y.removeEventListener("scroll", V), window.removeEventListener("scroll", V);
|
|
1358
1529
|
};
|
|
1359
1530
|
}, []);
|
|
1360
|
-
const
|
|
1531
|
+
const U = /* @__PURE__ */ $(
|
|
1361
1532
|
"div",
|
|
1362
1533
|
{
|
|
1363
1534
|
className: "sa-calendar-wrapper",
|
|
1364
|
-
style: { height:
|
|
1365
|
-
ref:
|
|
1535
|
+
style: { height: o ? "auto" : "100%" },
|
|
1536
|
+
ref: o ? i : null,
|
|
1366
1537
|
children: [
|
|
1367
|
-
|
|
1368
|
-
|
|
1538
|
+
o ? /* @__PURE__ */ a(
|
|
1539
|
+
mn,
|
|
1369
1540
|
{
|
|
1370
|
-
value:
|
|
1371
|
-
onClick: () =>
|
|
1541
|
+
value: A(),
|
|
1542
|
+
onClick: () => L(!0),
|
|
1372
1543
|
onChange: () => {
|
|
1373
1544
|
},
|
|
1374
|
-
placeholder:
|
|
1545
|
+
placeholder: p,
|
|
1375
1546
|
disabled: l,
|
|
1376
|
-
size:
|
|
1377
|
-
|
|
1547
|
+
size: g,
|
|
1548
|
+
variant: n,
|
|
1549
|
+
status: F,
|
|
1378
1550
|
inputMode: "none",
|
|
1379
|
-
clearable:
|
|
1380
|
-
onClear: () =>
|
|
1551
|
+
clearable: v,
|
|
1552
|
+
onClear: () => e(void 0)
|
|
1381
1553
|
}
|
|
1382
1554
|
) : null,
|
|
1383
|
-
w ? /* @__PURE__ */
|
|
1555
|
+
w ? /* @__PURE__ */ $(
|
|
1384
1556
|
"div",
|
|
1385
1557
|
{
|
|
1386
|
-
className: `sa-calendar ${
|
|
1558
|
+
className: `sa-calendar sa-calendar-size-${g || "md"} ${o ? "" : "sa-calendar-no-input"}`,
|
|
1387
1559
|
ref: M,
|
|
1388
1560
|
children: [
|
|
1389
|
-
/* @__PURE__ */
|
|
1390
|
-
|
|
1561
|
+
/* @__PURE__ */ a(
|
|
1562
|
+
xn,
|
|
1391
1563
|
{
|
|
1392
|
-
setViews:
|
|
1564
|
+
setViews: Y,
|
|
1393
1565
|
views: T,
|
|
1394
1566
|
filter: t,
|
|
1395
1567
|
previewDate: C,
|
|
1396
|
-
setPreviewDate:
|
|
1568
|
+
setPreviewDate: z,
|
|
1397
1569
|
isComponentVisible: w
|
|
1398
1570
|
}
|
|
1399
1571
|
),
|
|
1400
|
-
/* @__PURE__ */
|
|
1401
|
-
|
|
1572
|
+
/* @__PURE__ */ a("div", { className: "sa-calendar-body", children: T === "days" ? /* @__PURE__ */ a(
|
|
1573
|
+
vn,
|
|
1402
1574
|
{
|
|
1403
1575
|
date: E,
|
|
1404
|
-
setDate:
|
|
1576
|
+
setDate: S,
|
|
1405
1577
|
previewDate: C,
|
|
1406
|
-
setPreviewDate:
|
|
1407
|
-
setIsComponentVisible:
|
|
1408
|
-
input:
|
|
1409
|
-
minDate:
|
|
1410
|
-
maxDate:
|
|
1411
|
-
onChange:
|
|
1578
|
+
setPreviewDate: z,
|
|
1579
|
+
setIsComponentVisible: L,
|
|
1580
|
+
input: o,
|
|
1581
|
+
minDate: u,
|
|
1582
|
+
maxDate: d,
|
|
1583
|
+
onChange: e
|
|
1412
1584
|
}
|
|
1413
|
-
) : T === "months" ? /* @__PURE__ */
|
|
1414
|
-
|
|
1585
|
+
) : T === "months" ? /* @__PURE__ */ a(
|
|
1586
|
+
yn,
|
|
1415
1587
|
{
|
|
1416
1588
|
date: E,
|
|
1417
|
-
setDate:
|
|
1589
|
+
setDate: S,
|
|
1418
1590
|
previewDate: C,
|
|
1419
|
-
setPreviewDate:
|
|
1591
|
+
setPreviewDate: z,
|
|
1420
1592
|
filter: t,
|
|
1421
|
-
setViews:
|
|
1422
|
-
onChange:
|
|
1423
|
-
minDate:
|
|
1424
|
-
maxDate:
|
|
1425
|
-
input:
|
|
1593
|
+
setViews: Y,
|
|
1594
|
+
onChange: e,
|
|
1595
|
+
minDate: u,
|
|
1596
|
+
maxDate: d,
|
|
1597
|
+
input: o
|
|
1426
1598
|
}
|
|
1427
|
-
) : /* @__PURE__ */
|
|
1428
|
-
|
|
1599
|
+
) : /* @__PURE__ */ a(
|
|
1600
|
+
wn,
|
|
1429
1601
|
{
|
|
1430
1602
|
date: E,
|
|
1431
|
-
setDate:
|
|
1603
|
+
setDate: S,
|
|
1432
1604
|
previewDate: C,
|
|
1433
|
-
setPreviewDate:
|
|
1605
|
+
setPreviewDate: z,
|
|
1434
1606
|
filter: t,
|
|
1435
|
-
setViews:
|
|
1436
|
-
onChange:
|
|
1437
|
-
minDate:
|
|
1438
|
-
maxDate:
|
|
1439
|
-
input:
|
|
1607
|
+
setViews: Y,
|
|
1608
|
+
onChange: e,
|
|
1609
|
+
minDate: u,
|
|
1610
|
+
maxDate: d,
|
|
1611
|
+
input: o
|
|
1440
1612
|
}
|
|
1441
1613
|
) })
|
|
1442
1614
|
]
|
|
@@ -1445,68 +1617,70 @@ const xe = G(
|
|
|
1445
1617
|
]
|
|
1446
1618
|
}
|
|
1447
1619
|
);
|
|
1448
|
-
return /* @__PURE__ */
|
|
1449
|
-
|
|
1620
|
+
return /* @__PURE__ */ a(
|
|
1621
|
+
sn,
|
|
1450
1622
|
{
|
|
1451
|
-
label:
|
|
1452
|
-
labelPosition:
|
|
1453
|
-
required:
|
|
1454
|
-
optional:
|
|
1455
|
-
description:
|
|
1456
|
-
helperText:
|
|
1457
|
-
errorText:
|
|
1458
|
-
fullWidth:
|
|
1459
|
-
children:
|
|
1623
|
+
label: D,
|
|
1624
|
+
labelPosition: b,
|
|
1625
|
+
required: f,
|
|
1626
|
+
optional: s,
|
|
1627
|
+
description: x,
|
|
1628
|
+
helperText: N,
|
|
1629
|
+
errorText: h,
|
|
1630
|
+
fullWidth: k,
|
|
1631
|
+
children: U
|
|
1460
1632
|
}
|
|
1461
1633
|
);
|
|
1462
1634
|
}
|
|
1463
|
-
),
|
|
1635
|
+
), Nn = Z(
|
|
1464
1636
|
({
|
|
1465
|
-
value:
|
|
1466
|
-
onChange:
|
|
1637
|
+
value: r,
|
|
1638
|
+
onChange: e,
|
|
1467
1639
|
filter: t,
|
|
1468
|
-
input:
|
|
1640
|
+
input: o = !0,
|
|
1469
1641
|
rangedDate: l,
|
|
1470
|
-
disabled:
|
|
1471
|
-
minDate:
|
|
1472
|
-
maxDate:
|
|
1473
|
-
placeholder:
|
|
1474
|
-
size:
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1642
|
+
disabled: u,
|
|
1643
|
+
minDate: d,
|
|
1644
|
+
maxDate: p,
|
|
1645
|
+
placeholder: g,
|
|
1646
|
+
size: n,
|
|
1647
|
+
variant: c,
|
|
1648
|
+
status: v,
|
|
1649
|
+
clearable: k,
|
|
1650
|
+
fullWidth: D,
|
|
1651
|
+
label: b,
|
|
1652
|
+
labelPosition: f,
|
|
1653
|
+
required: s,
|
|
1654
|
+
optional: x,
|
|
1655
|
+
description: N,
|
|
1656
|
+
helperText: h,
|
|
1657
|
+
errorText: m
|
|
1658
|
+
}, F) => {
|
|
1659
|
+
const i = {
|
|
1660
|
+
onChange: e,
|
|
1661
|
+
value: r,
|
|
1662
|
+
input: o,
|
|
1490
1663
|
filter: t,
|
|
1491
|
-
disabled:
|
|
1492
|
-
minDate:
|
|
1493
|
-
maxDate:
|
|
1494
|
-
placeholder:
|
|
1495
|
-
size:
|
|
1496
|
-
|
|
1497
|
-
|
|
1498
|
-
|
|
1499
|
-
|
|
1500
|
-
|
|
1501
|
-
|
|
1502
|
-
|
|
1503
|
-
|
|
1504
|
-
|
|
1505
|
-
|
|
1664
|
+
disabled: u,
|
|
1665
|
+
minDate: d,
|
|
1666
|
+
maxDate: p,
|
|
1667
|
+
placeholder: g,
|
|
1668
|
+
size: n,
|
|
1669
|
+
variant: c,
|
|
1670
|
+
status: v,
|
|
1671
|
+
clearable: k,
|
|
1672
|
+
fullWidth: D,
|
|
1673
|
+
label: b,
|
|
1674
|
+
labelPosition: f,
|
|
1675
|
+
required: s,
|
|
1676
|
+
optional: x,
|
|
1677
|
+
description: N,
|
|
1678
|
+
helperText: h,
|
|
1679
|
+
errorText: m
|
|
1506
1680
|
};
|
|
1507
|
-
return /* @__PURE__ */
|
|
1681
|
+
return /* @__PURE__ */ a(nn, { children: l ? /* @__PURE__ */ a(fn, { ...i, ref: F }) : /* @__PURE__ */ a(Mn, { ...i, ref: F }) });
|
|
1508
1682
|
}
|
|
1509
1683
|
);
|
|
1510
1684
|
export {
|
|
1511
|
-
|
|
1685
|
+
Nn as StarasiaDate
|
|
1512
1686
|
};
|