willba-component-library 0.2.57 → 0.2.59
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/lib/components/FilterCalendar/FilterCalendar.d.ts +1 -1
- package/lib/components/FilterCalendar/FilterCalendar.stories.d.ts +1 -0
- package/lib/components/FilterCalendar/hooks/useFilterCalendar.d.ts +5 -2
- package/lib/core/components/calendar/CalendarTypes.d.ts +1 -1
- package/lib/core/components/calendar/hooks/useCalendarLoadingSpinner.d.ts +1 -3
- package/lib/core/components/calendar/hooks/useCalendarTooltips.d.ts +1 -6
- package/lib/core/components/calendar/hooks/useUpdateDisabledDates.d.ts +2 -2
- package/lib/index.d.ts +2 -2
- package/lib/index.esm.js +39 -33
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +39 -33
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +39 -33
- package/lib/index.umd.js.map +1 -1
- package/package.json +1 -1
- package/src/components/FilterCalendar/FilterCalendar.stories.tsx +497 -43
- package/src/components/FilterCalendar/FilterCalendar.tsx +6 -4
- package/src/components/FilterCalendar/hooks/useFilterCalendar.ts +11 -3
- package/src/core/components/calendar/Calendar.tsx +6 -10
- package/src/core/components/calendar/CalendarTypes.ts +1 -1
- package/src/core/components/calendar/hooks/useCalendarLoadingSpinner.tsx +2 -8
- package/src/core/components/calendar/hooks/useCalendarTooltips.tsx +3 -18
- package/src/core/components/calendar/hooks/useUpdateDisabledDates.tsx +3 -3
- package/src/core/components/calendar/utils/calendarSelectionRules.tsx +14 -2
package/package.json
CHANGED
|
@@ -15,95 +15,180 @@ type Story = StoryObj<typeof FilterCalendar>
|
|
|
15
15
|
const baseData = {
|
|
16
16
|
disableCalendarDates: {
|
|
17
17
|
availableDates: [
|
|
18
|
+
{
|
|
19
|
+
checkIn: new Date('2024-10-15'),
|
|
20
|
+
firstCheckOut: new Date('2024-10-16'),
|
|
21
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
checkIn: new Date('2024-10-16'),
|
|
25
|
+
firstCheckOut: new Date('2024-10-17'),
|
|
26
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
checkIn: new Date('2024-10-17'),
|
|
30
|
+
firstCheckOut: new Date('2024-10-18'),
|
|
31
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
checkIn: new Date('2024-10-18'),
|
|
35
|
+
firstCheckOut: new Date('2024-10-19'),
|
|
36
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
checkIn: new Date('2024-10-19'),
|
|
40
|
+
firstCheckOut: new Date('2024-10-20'),
|
|
41
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
checkIn: new Date('2024-10-20'),
|
|
45
|
+
firstCheckOut: new Date('2024-10-21'),
|
|
46
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
checkIn: new Date('2024-10-21'),
|
|
50
|
+
firstCheckOut: new Date('2024-10-22'),
|
|
51
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
checkIn: new Date('2024-10-22'),
|
|
55
|
+
firstCheckOut: new Date('2024-10-23'),
|
|
56
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
checkIn: new Date('2024-10-23'),
|
|
60
|
+
firstCheckOut: new Date('2024-10-24'),
|
|
61
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
checkIn: new Date('2024-10-24'),
|
|
65
|
+
firstCheckOut: new Date('2024-10-25'),
|
|
66
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
checkIn: new Date('2024-10-25'),
|
|
70
|
+
firstCheckOut: new Date('2024-10-26'),
|
|
71
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
checkIn: new Date('2024-10-26'),
|
|
75
|
+
firstCheckOut: new Date('2024-10-27'),
|
|
76
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
checkIn: new Date('2024-10-27'),
|
|
80
|
+
firstCheckOut: new Date('2024-10-28'),
|
|
81
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
checkIn: new Date('2024-10-28'),
|
|
85
|
+
firstCheckOut: new Date('2024-10-29'),
|
|
86
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
checkIn: new Date('2024-10-29'),
|
|
90
|
+
firstCheckOut: new Date('2024-10-30'),
|
|
91
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
checkIn: new Date('2024-10-30'),
|
|
95
|
+
firstCheckOut: new Date('2024-10-31'),
|
|
96
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
checkIn: new Date('2024-10-31'),
|
|
100
|
+
firstCheckOut: new Date('2024-11-01'),
|
|
101
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
102
|
+
},
|
|
18
103
|
{
|
|
19
104
|
checkIn: new Date('2024-11-01'),
|
|
20
105
|
firstCheckOut: new Date('2024-11-02'),
|
|
21
|
-
lastCheckOut: new Date('2024-11-
|
|
106
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
22
107
|
},
|
|
23
108
|
{
|
|
24
109
|
checkIn: new Date('2024-11-02'),
|
|
25
110
|
firstCheckOut: new Date('2024-11-03'),
|
|
26
|
-
lastCheckOut: new Date('2024-11-
|
|
111
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
27
112
|
},
|
|
28
113
|
{
|
|
29
114
|
checkIn: new Date('2024-11-03'),
|
|
30
115
|
firstCheckOut: new Date('2024-11-04'),
|
|
31
|
-
lastCheckOut: new Date('2024-11-
|
|
116
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
32
117
|
},
|
|
33
118
|
{
|
|
34
119
|
checkIn: new Date('2024-11-04'),
|
|
35
120
|
firstCheckOut: new Date('2024-11-05'),
|
|
36
|
-
lastCheckOut: new Date('2024-11-
|
|
121
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
37
122
|
},
|
|
38
123
|
{
|
|
39
124
|
checkIn: new Date('2024-11-05'),
|
|
40
125
|
firstCheckOut: new Date('2024-11-06'),
|
|
41
|
-
lastCheckOut: new Date('2024-11-
|
|
126
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
42
127
|
},
|
|
43
128
|
{
|
|
44
129
|
checkIn: new Date('2024-11-06'),
|
|
45
130
|
firstCheckOut: new Date('2024-11-07'),
|
|
46
|
-
lastCheckOut: new Date('2024-11-
|
|
131
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
47
132
|
},
|
|
48
133
|
{
|
|
49
134
|
checkIn: new Date('2024-11-07'),
|
|
50
135
|
firstCheckOut: new Date('2024-11-08'),
|
|
51
|
-
lastCheckOut: new Date('2024-11-
|
|
136
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
52
137
|
},
|
|
53
138
|
{
|
|
54
139
|
checkIn: new Date('2024-11-08'),
|
|
55
140
|
firstCheckOut: new Date('2024-11-09'),
|
|
56
|
-
lastCheckOut: new Date('2024-11-
|
|
141
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
57
142
|
},
|
|
58
143
|
{
|
|
59
144
|
checkIn: new Date('2024-11-09'),
|
|
60
145
|
firstCheckOut: new Date('2024-11-10'),
|
|
61
|
-
lastCheckOut: new Date('2024-11-
|
|
146
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
62
147
|
},
|
|
63
148
|
{
|
|
64
149
|
checkIn: new Date('2024-11-10'),
|
|
65
150
|
firstCheckOut: new Date('2024-11-11'),
|
|
66
|
-
lastCheckOut: new Date('2024-11-
|
|
151
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
67
152
|
},
|
|
68
153
|
{
|
|
69
|
-
checkIn: new Date('2024-11-
|
|
70
|
-
firstCheckOut: new Date('2024-11-
|
|
71
|
-
lastCheckOut: new Date('
|
|
154
|
+
checkIn: new Date('2024-11-11'),
|
|
155
|
+
firstCheckOut: new Date('2024-11-12'),
|
|
156
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
72
157
|
},
|
|
73
158
|
{
|
|
74
|
-
checkIn: new Date('2024-11-
|
|
75
|
-
firstCheckOut: new Date('2024-11-
|
|
76
|
-
lastCheckOut: new Date('
|
|
159
|
+
checkIn: new Date('2024-11-12'),
|
|
160
|
+
firstCheckOut: new Date('2024-11-13'),
|
|
161
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
77
162
|
},
|
|
78
163
|
{
|
|
79
|
-
checkIn: new Date('2024-11-
|
|
80
|
-
firstCheckOut: new Date('2024-11-
|
|
81
|
-
lastCheckOut: new Date('
|
|
164
|
+
checkIn: new Date('2024-11-13'),
|
|
165
|
+
firstCheckOut: new Date('2024-11-14'),
|
|
166
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
82
167
|
},
|
|
83
168
|
{
|
|
84
|
-
checkIn: new Date('2024-11-
|
|
85
|
-
firstCheckOut: new Date('2024-11-
|
|
86
|
-
lastCheckOut: new Date('
|
|
169
|
+
checkIn: new Date('2024-11-14'),
|
|
170
|
+
firstCheckOut: new Date('2024-11-15'),
|
|
171
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
87
172
|
},
|
|
88
173
|
{
|
|
89
|
-
checkIn: new Date('2024-11-
|
|
90
|
-
firstCheckOut: new Date('2024-11-
|
|
91
|
-
lastCheckOut: new Date('
|
|
174
|
+
checkIn: new Date('2024-11-15'),
|
|
175
|
+
firstCheckOut: new Date('2024-11-16'),
|
|
176
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
92
177
|
},
|
|
93
178
|
{
|
|
94
|
-
checkIn: new Date('2024-11-
|
|
95
|
-
firstCheckOut: new Date('2024-11-
|
|
96
|
-
lastCheckOut: new Date('
|
|
179
|
+
checkIn: new Date('2024-11-16'),
|
|
180
|
+
firstCheckOut: new Date('2024-11-17'),
|
|
181
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
97
182
|
},
|
|
98
183
|
{
|
|
99
|
-
checkIn: new Date('2024-11-
|
|
100
|
-
firstCheckOut: new Date('2024-11-
|
|
101
|
-
lastCheckOut: new Date('
|
|
184
|
+
checkIn: new Date('2024-11-17'),
|
|
185
|
+
firstCheckOut: new Date('2024-11-18'),
|
|
186
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
102
187
|
},
|
|
103
188
|
{
|
|
104
|
-
checkIn: new Date('2024-11-
|
|
105
|
-
firstCheckOut: new Date('2024-11-
|
|
106
|
-
lastCheckOut: new Date('
|
|
189
|
+
checkIn: new Date('2024-11-18'),
|
|
190
|
+
firstCheckOut: new Date('2024-11-19'),
|
|
191
|
+
lastCheckOut: new Date('2024-11-19'),
|
|
107
192
|
},
|
|
108
193
|
{
|
|
109
194
|
checkIn: new Date('2024-11-23'),
|
|
@@ -300,23 +385,369 @@ const baseData = {
|
|
|
300
385
|
firstCheckOut: new Date('2025-01-01'),
|
|
301
386
|
lastCheckOut: new Date('2025-03-01'),
|
|
302
387
|
},
|
|
388
|
+
{
|
|
389
|
+
checkIn: new Date('2025-01-01'),
|
|
390
|
+
firstCheckOut: new Date('2025-01-02'),
|
|
391
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
checkIn: new Date('2025-01-02'),
|
|
395
|
+
firstCheckOut: new Date('2025-01-03'),
|
|
396
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
checkIn: new Date('2025-01-03'),
|
|
400
|
+
firstCheckOut: new Date('2025-01-04'),
|
|
401
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
checkIn: new Date('2025-01-04'),
|
|
405
|
+
firstCheckOut: new Date('2025-01-05'),
|
|
406
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
checkIn: new Date('2025-01-05'),
|
|
410
|
+
firstCheckOut: new Date('2025-01-06'),
|
|
411
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
checkIn: new Date('2025-01-06'),
|
|
415
|
+
firstCheckOut: new Date('2025-01-07'),
|
|
416
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
checkIn: new Date('2025-01-07'),
|
|
420
|
+
firstCheckOut: new Date('2025-01-08'),
|
|
421
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
checkIn: new Date('2025-01-08'),
|
|
425
|
+
firstCheckOut: new Date('2025-01-09'),
|
|
426
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
checkIn: new Date('2025-01-09'),
|
|
430
|
+
firstCheckOut: new Date('2025-01-10'),
|
|
431
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
checkIn: new Date('2025-01-10'),
|
|
435
|
+
firstCheckOut: new Date('2025-01-11'),
|
|
436
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
checkIn: new Date('2025-01-11'),
|
|
440
|
+
firstCheckOut: new Date('2025-01-12'),
|
|
441
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
checkIn: new Date('2025-01-12'),
|
|
445
|
+
firstCheckOut: new Date('2025-01-13'),
|
|
446
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
checkIn: new Date('2025-01-13'),
|
|
450
|
+
firstCheckOut: new Date('2025-01-14'),
|
|
451
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
452
|
+
},
|
|
453
|
+
{
|
|
454
|
+
checkIn: new Date('2025-01-14'),
|
|
455
|
+
firstCheckOut: new Date('2025-01-15'),
|
|
456
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
457
|
+
},
|
|
458
|
+
{
|
|
459
|
+
checkIn: new Date('2025-01-15'),
|
|
460
|
+
firstCheckOut: new Date('2025-01-16'),
|
|
461
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
checkIn: new Date('2025-01-16'),
|
|
465
|
+
firstCheckOut: new Date('2025-01-17'),
|
|
466
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
467
|
+
},
|
|
468
|
+
{
|
|
469
|
+
checkIn: new Date('2025-01-17'),
|
|
470
|
+
firstCheckOut: new Date('2025-01-18'),
|
|
471
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
472
|
+
},
|
|
473
|
+
{
|
|
474
|
+
checkIn: new Date('2025-01-18'),
|
|
475
|
+
firstCheckOut: new Date('2025-01-19'),
|
|
476
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
477
|
+
},
|
|
478
|
+
{
|
|
479
|
+
checkIn: new Date('2025-01-19'),
|
|
480
|
+
firstCheckOut: new Date('2025-01-20'),
|
|
481
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
482
|
+
},
|
|
483
|
+
{
|
|
484
|
+
checkIn: new Date('2025-01-20'),
|
|
485
|
+
firstCheckOut: new Date('2025-01-21'),
|
|
486
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
checkIn: new Date('2025-01-21'),
|
|
490
|
+
firstCheckOut: new Date('2025-01-22'),
|
|
491
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
checkIn: new Date('2025-01-22'),
|
|
495
|
+
firstCheckOut: new Date('2025-01-23'),
|
|
496
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
497
|
+
},
|
|
498
|
+
{
|
|
499
|
+
checkIn: new Date('2025-01-23'),
|
|
500
|
+
firstCheckOut: new Date('2025-01-24'),
|
|
501
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
502
|
+
},
|
|
503
|
+
{
|
|
504
|
+
checkIn: new Date('2025-01-24'),
|
|
505
|
+
firstCheckOut: new Date('2025-01-25'),
|
|
506
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
checkIn: new Date('2025-01-25'),
|
|
510
|
+
firstCheckOut: new Date('2025-01-26'),
|
|
511
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
512
|
+
},
|
|
513
|
+
{
|
|
514
|
+
checkIn: new Date('2025-01-26'),
|
|
515
|
+
firstCheckOut: new Date('2025-01-27'),
|
|
516
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
517
|
+
},
|
|
518
|
+
{
|
|
519
|
+
checkIn: new Date('2025-01-27'),
|
|
520
|
+
firstCheckOut: new Date('2025-01-28'),
|
|
521
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
522
|
+
},
|
|
523
|
+
{
|
|
524
|
+
checkIn: new Date('2025-01-28'),
|
|
525
|
+
firstCheckOut: new Date('2025-01-29'),
|
|
526
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
527
|
+
},
|
|
528
|
+
{
|
|
529
|
+
checkIn: new Date('2025-01-29'),
|
|
530
|
+
firstCheckOut: new Date('2025-01-30'),
|
|
531
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
532
|
+
},
|
|
533
|
+
{
|
|
534
|
+
checkIn: new Date('2025-01-30'),
|
|
535
|
+
firstCheckOut: new Date('2025-01-31'),
|
|
536
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
537
|
+
},
|
|
538
|
+
{
|
|
539
|
+
checkIn: new Date('2025-01-31'),
|
|
540
|
+
firstCheckOut: new Date('2025-02-01'),
|
|
541
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
542
|
+
},
|
|
543
|
+
{
|
|
544
|
+
checkIn: new Date('2025-02-01'),
|
|
545
|
+
firstCheckOut: new Date('2025-02-02'),
|
|
546
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
547
|
+
},
|
|
548
|
+
{
|
|
549
|
+
checkIn: new Date('2025-02-02'),
|
|
550
|
+
firstCheckOut: new Date('2025-02-03'),
|
|
551
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
552
|
+
},
|
|
553
|
+
{
|
|
554
|
+
checkIn: new Date('2025-02-03'),
|
|
555
|
+
firstCheckOut: new Date('2025-02-04'),
|
|
556
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
557
|
+
},
|
|
558
|
+
{
|
|
559
|
+
checkIn: new Date('2025-02-04'),
|
|
560
|
+
firstCheckOut: new Date('2025-02-05'),
|
|
561
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
562
|
+
},
|
|
563
|
+
{
|
|
564
|
+
checkIn: new Date('2025-02-05'),
|
|
565
|
+
firstCheckOut: new Date('2025-02-06'),
|
|
566
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
567
|
+
},
|
|
568
|
+
{
|
|
569
|
+
checkIn: new Date('2025-02-06'),
|
|
570
|
+
firstCheckOut: new Date('2025-02-07'),
|
|
571
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
572
|
+
},
|
|
573
|
+
{
|
|
574
|
+
checkIn: new Date('2025-02-07'),
|
|
575
|
+
firstCheckOut: new Date('2025-02-08'),
|
|
576
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
577
|
+
},
|
|
578
|
+
{
|
|
579
|
+
checkIn: new Date('2025-02-08'),
|
|
580
|
+
firstCheckOut: new Date('2025-02-09'),
|
|
581
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
582
|
+
},
|
|
583
|
+
{
|
|
584
|
+
checkIn: new Date('2025-02-09'),
|
|
585
|
+
firstCheckOut: new Date('2025-02-10'),
|
|
586
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
587
|
+
},
|
|
588
|
+
{
|
|
589
|
+
checkIn: new Date('2025-02-10'),
|
|
590
|
+
firstCheckOut: new Date('2025-02-11'),
|
|
591
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
592
|
+
},
|
|
593
|
+
{
|
|
594
|
+
checkIn: new Date('2025-02-11'),
|
|
595
|
+
firstCheckOut: new Date('2025-02-12'),
|
|
596
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
597
|
+
},
|
|
598
|
+
{
|
|
599
|
+
checkIn: new Date('2025-02-12'),
|
|
600
|
+
firstCheckOut: new Date('2025-02-13'),
|
|
601
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
602
|
+
},
|
|
603
|
+
{
|
|
604
|
+
checkIn: new Date('2025-02-13'),
|
|
605
|
+
firstCheckOut: new Date('2025-02-14'),
|
|
606
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
607
|
+
},
|
|
608
|
+
{
|
|
609
|
+
checkIn: new Date('2025-02-14'),
|
|
610
|
+
firstCheckOut: new Date('2025-02-15'),
|
|
611
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
612
|
+
},
|
|
613
|
+
{
|
|
614
|
+
checkIn: new Date('2025-02-15'),
|
|
615
|
+
firstCheckOut: new Date('2025-02-16'),
|
|
616
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
617
|
+
},
|
|
618
|
+
{
|
|
619
|
+
checkIn: new Date('2025-02-16'),
|
|
620
|
+
firstCheckOut: new Date('2025-02-17'),
|
|
621
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
622
|
+
},
|
|
623
|
+
{
|
|
624
|
+
checkIn: new Date('2025-02-17'),
|
|
625
|
+
firstCheckOut: new Date('2025-02-18'),
|
|
626
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
627
|
+
},
|
|
628
|
+
{
|
|
629
|
+
checkIn: new Date('2025-02-18'),
|
|
630
|
+
firstCheckOut: new Date('2025-02-19'),
|
|
631
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
632
|
+
},
|
|
633
|
+
{
|
|
634
|
+
checkIn: new Date('2025-02-19'),
|
|
635
|
+
firstCheckOut: new Date('2025-02-20'),
|
|
636
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
637
|
+
},
|
|
638
|
+
{
|
|
639
|
+
checkIn: new Date('2025-02-20'),
|
|
640
|
+
firstCheckOut: new Date('2025-02-21'),
|
|
641
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
642
|
+
},
|
|
643
|
+
{
|
|
644
|
+
checkIn: new Date('2025-02-21'),
|
|
645
|
+
firstCheckOut: new Date('2025-02-22'),
|
|
646
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
checkIn: new Date('2025-02-22'),
|
|
650
|
+
firstCheckOut: new Date('2025-02-23'),
|
|
651
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
checkIn: new Date('2025-02-23'),
|
|
655
|
+
firstCheckOut: new Date('2025-02-24'),
|
|
656
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
657
|
+
},
|
|
658
|
+
{
|
|
659
|
+
checkIn: new Date('2025-02-24'),
|
|
660
|
+
firstCheckOut: new Date('2025-02-25'),
|
|
661
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
662
|
+
},
|
|
663
|
+
{
|
|
664
|
+
checkIn: new Date('2025-02-25'),
|
|
665
|
+
firstCheckOut: new Date('2025-02-26'),
|
|
666
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
667
|
+
},
|
|
668
|
+
{
|
|
669
|
+
checkIn: new Date('2025-02-26'),
|
|
670
|
+
firstCheckOut: new Date('2025-02-27'),
|
|
671
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
672
|
+
},
|
|
673
|
+
{
|
|
674
|
+
checkIn: new Date('2025-02-27'),
|
|
675
|
+
firstCheckOut: new Date('2025-02-28'),
|
|
676
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
677
|
+
},
|
|
678
|
+
{
|
|
679
|
+
checkIn: new Date('2025-02-28'),
|
|
680
|
+
firstCheckOut: new Date('2025-03-01'),
|
|
681
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
682
|
+
},
|
|
683
|
+
{
|
|
684
|
+
checkIn: new Date('2025-03-01'),
|
|
685
|
+
firstCheckOut: new Date('2025-03-02'),
|
|
686
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
687
|
+
},
|
|
688
|
+
{
|
|
689
|
+
checkIn: new Date('2025-03-02'),
|
|
690
|
+
firstCheckOut: new Date('2025-03-03'),
|
|
691
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
692
|
+
},
|
|
693
|
+
{
|
|
694
|
+
checkIn: new Date('2025-03-03'),
|
|
695
|
+
firstCheckOut: new Date('2025-03-04'),
|
|
696
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
697
|
+
},
|
|
698
|
+
{
|
|
699
|
+
checkIn: new Date('2025-03-04'),
|
|
700
|
+
firstCheckOut: new Date('2025-03-05'),
|
|
701
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
checkIn: new Date('2025-03-05'),
|
|
705
|
+
firstCheckOut: new Date('2025-03-06'),
|
|
706
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
707
|
+
},
|
|
708
|
+
{
|
|
709
|
+
checkIn: new Date('2025-03-06'),
|
|
710
|
+
firstCheckOut: new Date('2025-03-07'),
|
|
711
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
712
|
+
},
|
|
713
|
+
{
|
|
714
|
+
checkIn: new Date('2025-03-07'),
|
|
715
|
+
firstCheckOut: new Date('2025-03-08'),
|
|
716
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
checkIn: new Date('2025-03-08'),
|
|
720
|
+
firstCheckOut: new Date('2025-03-09'),
|
|
721
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
722
|
+
},
|
|
723
|
+
{
|
|
724
|
+
checkIn: new Date('2025-03-09'),
|
|
725
|
+
firstCheckOut: new Date('2025-03-10'),
|
|
726
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
727
|
+
},
|
|
728
|
+
{
|
|
729
|
+
checkIn: new Date('2025-03-10'),
|
|
730
|
+
firstCheckOut: new Date('2025-03-11'),
|
|
731
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
732
|
+
},
|
|
733
|
+
{
|
|
734
|
+
checkIn: new Date('2025-03-11'),
|
|
735
|
+
firstCheckOut: new Date('2025-03-12'),
|
|
736
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
737
|
+
},
|
|
303
738
|
],
|
|
304
739
|
disabledDates: [
|
|
305
740
|
{
|
|
306
|
-
to: new Date('2024-10-
|
|
741
|
+
to: new Date('2024-10-14'),
|
|
307
742
|
from: new Date('2024-10-01'),
|
|
308
743
|
},
|
|
309
744
|
{
|
|
310
|
-
to: new Date('2024-
|
|
311
|
-
from: new Date('2024-
|
|
312
|
-
},
|
|
313
|
-
{
|
|
314
|
-
to: new Date('2024-10-23'),
|
|
315
|
-
from: new Date('2024-10-22'),
|
|
745
|
+
to: new Date('2024-11-22'),
|
|
746
|
+
from: new Date('2024-11-19'),
|
|
316
747
|
},
|
|
317
748
|
{
|
|
318
|
-
to: new Date('
|
|
319
|
-
from: new Date('
|
|
749
|
+
to: new Date('2025-03-31'),
|
|
750
|
+
from: new Date('2025-03-12'),
|
|
320
751
|
},
|
|
321
752
|
],
|
|
322
753
|
},
|
|
@@ -374,3 +805,26 @@ export const RangeContext: Story = {
|
|
|
374
805
|
)
|
|
375
806
|
},
|
|
376
807
|
}
|
|
808
|
+
|
|
809
|
+
export const DisabledRangeContextDates: Story = {
|
|
810
|
+
args: {
|
|
811
|
+
...baseData,
|
|
812
|
+
rangeContext: {
|
|
813
|
+
from: new Date('2024-11-12'),
|
|
814
|
+
to: new Date('2024-11-16'),
|
|
815
|
+
},
|
|
816
|
+
},
|
|
817
|
+
render: (args) => {
|
|
818
|
+
const [toggleCalendar, setToggleCalendar] = useState(true)
|
|
819
|
+
return (
|
|
820
|
+
<div style={{ padding: '30px', height: '100vh' }}>
|
|
821
|
+
<FilterCalendar
|
|
822
|
+
{...args}
|
|
823
|
+
toggleCalendar={toggleCalendar}
|
|
824
|
+
setToggleCalendar={setToggleCalendar}
|
|
825
|
+
/>
|
|
826
|
+
{/* <button onClick={() => setToggleCalendar(true)}>Open calendar</button> */}
|
|
827
|
+
</div>
|
|
828
|
+
)
|
|
829
|
+
},
|
|
830
|
+
}
|
|
@@ -29,14 +29,14 @@ export default function FilterCalendar({
|
|
|
29
29
|
requestDates,
|
|
30
30
|
showFeedback,
|
|
31
31
|
noActiveSelection,
|
|
32
|
-
rangeContext,
|
|
32
|
+
rangeContext: outerRangeContext,
|
|
33
33
|
}: FilterCalendarTypes) {
|
|
34
34
|
const themePalette = useTheme({ palette })
|
|
35
35
|
|
|
36
36
|
// Translations
|
|
37
37
|
useUpdateTranslations({ language })
|
|
38
38
|
const { t } = useTranslation()
|
|
39
|
-
|
|
39
|
+
console.log('1', t('noCheckIn'))
|
|
40
40
|
const {
|
|
41
41
|
setCalendarRange,
|
|
42
42
|
handleClearDates,
|
|
@@ -44,16 +44,18 @@ export default function FilterCalendar({
|
|
|
44
44
|
disabledDates,
|
|
45
45
|
setDisabledDates,
|
|
46
46
|
updateCalendarMonthNavigation,
|
|
47
|
-
|
|
47
|
+
updateCalendarDefaultMonth,
|
|
48
48
|
setUpdateCalendarMonthNavigation,
|
|
49
49
|
calendarHasError,
|
|
50
50
|
setCalendarHasError,
|
|
51
51
|
setUpdatedForSubmit,
|
|
52
|
+
rangeContext,
|
|
52
53
|
} = useFilterCalendar({
|
|
53
54
|
onSubmit,
|
|
54
55
|
setToggleCalendar,
|
|
55
56
|
noActiveSelection,
|
|
56
57
|
toggleCalendar,
|
|
58
|
+
outerRangeContext,
|
|
57
59
|
})
|
|
58
60
|
|
|
59
61
|
// Display component after fully loaded
|
|
@@ -91,7 +93,7 @@ export default function FilterCalendar({
|
|
|
91
93
|
setUpdateCalendarMonthNavigation={
|
|
92
94
|
setUpdateCalendarMonthNavigation
|
|
93
95
|
}
|
|
94
|
-
|
|
96
|
+
updateCalendarDefaultMonth={updateCalendarDefaultMonth}
|
|
95
97
|
loadingData={loadingData}
|
|
96
98
|
showFeedback={showFeedback}
|
|
97
99
|
noActiveSelection={noActiveSelection}
|