willba-component-library 0.2.80 → 0.2.81
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/FilterBar/FilterBar.stories.d.ts +1 -1
- package/lib/components/FilterCalendar/FilterCalendar.d.ts +1 -1
- package/lib/components/FilterCalendar/FilterCalendar.stories.d.ts +3 -1
- package/lib/components/FilterCalendar/hooks/useFilterCalendar.d.ts +10 -3
- package/lib/core/components/buttons/submit-button/SubmitButton.d.ts +3 -1
- package/lib/core/components/calendar/CalendarTypes.d.ts +9 -2
- package/lib/index.d.ts +11 -3
- package/lib/index.esm.js +893 -266
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +893 -266
- package/lib/index.js.map +1 -1
- package/lib/index.umd.js +893 -266
- package/lib/index.umd.js.map +1 -1
- package/lib/themes/useTheme.d.ts +2 -0
- package/package.json +1 -1
- package/src/assets/IconsSvg.tsx +68 -0
- package/src/components/FilterBar/FilterBar.stories.tsx +2 -1
- package/src/components/FilterBar/FilterBar.tsx +1 -1
- package/src/components/FilterBar/components/buttons/tab-button/TabButton.css +1 -1
- package/src/components/FilterCalendar/FilterCalendar.css +26 -10
- package/src/components/FilterCalendar/FilterCalendar.stories.tsx +522 -153
- package/src/components/FilterCalendar/FilterCalendar.tsx +25 -54
- package/src/components/FilterCalendar/FilterCalendarTypes.ts +0 -1
- package/src/components/FilterCalendar/components/Footer.tsx +96 -0
- package/src/components/FilterCalendar/hooks/useFilterCalendar.ts +94 -4
- package/src/core/components/buttons/submit-button/SubmitButton.css +16 -2
- package/src/core/components/buttons/submit-button/SubmitButton.tsx +6 -5
- package/src/core/components/calendar/Calendar.css +71 -18
- package/src/core/components/calendar/Calendar.tsx +132 -342
- package/src/core/components/calendar/CalendarTypes.ts +10 -3
- package/src/core/components/calendar/hooks/index.ts +3 -0
- package/src/core/components/calendar/hooks/useCalendarLoadingSpinner.tsx +19 -0
- package/src/core/components/calendar/hooks/useCalendarTooltips.tsx +125 -0
- package/src/core/components/calendar/hooks/useUpdateDisabledDates.tsx +107 -0
- package/src/core/components/calendar/utils/calendarSelectionRules.tsx +228 -0
- package/src/core/components/calendar/utils/checkForContinuousSelection.tsx +86 -0
- package/src/core/components/calendar/utils/disabledDatesByPage.tsx +36 -0
- package/src/core/components/calendar/utils/handleCalendarModifiers.tsx +147 -0
- package/src/core/components/calendar/utils/handleRangeContextDisabledDates.tsx +75 -0
- package/src/core/components/calendar/utils/index.ts +8 -0
- package/src/locales/en/common.json +7 -1
- package/src/locales/en/filterBar.json +2 -1
- package/src/locales/fi/common.json +7 -1
- package/src/locales/fi/filterBar.json +2 -1
- package/src/themes/Default.css +12 -3
- package/src/themes/useTheme.tsx +3 -0
- package/src/assets/SpinnerSvg.tsx +0 -40
- package/src/core/utils/index.ts +0 -3
- /package/src/core/{utils → components/calendar/utils}/nightsCount.tsx +0 -0
- /package/src/core/{utils → components/calendar/utils}/parseDate.tsx +0 -0
- /package/src/core/{utils → components/calendar/utils}/parseDates.tsx +0 -0
|
@@ -12,162 +12,531 @@ export default meta
|
|
|
12
12
|
|
|
13
13
|
type Story = StoryObj<typeof FilterCalendar>
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
const baseData = {
|
|
16
|
+
disableCalendarDates: {
|
|
17
|
+
availableDates: [
|
|
18
|
+
{
|
|
19
|
+
checkIn: new Date('2025-01-01'),
|
|
20
|
+
firstCheckOut: new Date('2025-01-02'),
|
|
21
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
checkIn: new Date('2025-01-02'),
|
|
25
|
+
firstCheckOut: new Date('2025-01-03'),
|
|
26
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
checkIn: new Date('2025-01-03'),
|
|
30
|
+
firstCheckOut: new Date('2025-01-04'),
|
|
31
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
checkIn: new Date('2025-01-08'),
|
|
35
|
+
firstCheckOut: new Date('2025-01-09'),
|
|
36
|
+
lastCheckOut: new Date('2025-01-14'),
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
checkIn: new Date('2025-01-09'),
|
|
40
|
+
firstCheckOut: new Date('2025-01-10'),
|
|
41
|
+
lastCheckOut: new Date('2025-01-14'),
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
checkIn: new Date('2025-01-10'),
|
|
45
|
+
firstCheckOut: new Date('2025-01-11'),
|
|
46
|
+
lastCheckOut: new Date('2025-01-14'),
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
checkIn: new Date('2025-01-11'),
|
|
50
|
+
firstCheckOut: new Date('2025-01-12'),
|
|
51
|
+
lastCheckOut: new Date('2025-01-14'),
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
checkIn: new Date('2025-01-12'),
|
|
55
|
+
firstCheckOut: new Date('2025-01-13'),
|
|
56
|
+
lastCheckOut: new Date('2025-01-14'),
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
checkIn: new Date('2025-01-13'),
|
|
60
|
+
firstCheckOut: new Date('2025-01-14'),
|
|
61
|
+
lastCheckOut: new Date('2025-01-14'),
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
checkIn: new Date('2025-01-17'),
|
|
65
|
+
firstCheckOut: new Date('2025-01-18'),
|
|
66
|
+
lastCheckOut: new Date('2025-02-05'),
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
checkIn: new Date('2025-01-18'),
|
|
70
|
+
firstCheckOut: new Date('2025-01-19'),
|
|
71
|
+
lastCheckOut: new Date('2025-02-05'),
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
checkIn: new Date('2025-01-19'),
|
|
75
|
+
firstCheckOut: new Date('2025-01-20'),
|
|
76
|
+
lastCheckOut: new Date('2025-02-05'),
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
checkIn: new Date('2025-01-20'),
|
|
80
|
+
firstCheckOut: new Date('2025-01-21'),
|
|
81
|
+
lastCheckOut: new Date('2025-02-05'),
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
checkIn: new Date('2025-01-21'),
|
|
85
|
+
firstCheckOut: new Date('2025-01-22'),
|
|
86
|
+
lastCheckOut: new Date('2025-02-05'),
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
checkIn: new Date('2025-01-22'),
|
|
90
|
+
firstCheckOut: new Date('2025-01-23'),
|
|
91
|
+
lastCheckOut: new Date('2025-02-05'),
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
checkIn: new Date('2025-01-23'),
|
|
95
|
+
firstCheckOut: new Date('2025-01-24'),
|
|
96
|
+
lastCheckOut: new Date('2025-02-05'),
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
checkIn: new Date('2025-01-24'),
|
|
100
|
+
firstCheckOut: new Date('2025-01-25'),
|
|
101
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
checkIn: new Date('2025-01-25'),
|
|
105
|
+
firstCheckOut: new Date('2025-01-26'),
|
|
106
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
checkIn: new Date('2025-01-26'),
|
|
110
|
+
firstCheckOut: new Date('2025-01-27'),
|
|
111
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
checkIn: new Date('2025-01-27'),
|
|
115
|
+
firstCheckOut: new Date('2025-01-28'),
|
|
116
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
checkIn: new Date('2025-01-28'),
|
|
120
|
+
firstCheckOut: new Date('2025-01-29'),
|
|
121
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
122
|
+
},
|
|
123
|
+
{
|
|
124
|
+
checkIn: new Date('2025-01-29'),
|
|
125
|
+
firstCheckOut: new Date('2025-01-30'),
|
|
126
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
127
|
+
},
|
|
128
|
+
{
|
|
129
|
+
checkIn: new Date('2025-01-30'),
|
|
130
|
+
firstCheckOut: new Date('2025-01-31'),
|
|
131
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
checkIn: new Date('2025-01-31'),
|
|
135
|
+
firstCheckOut: new Date('2025-02-01'),
|
|
136
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
checkIn: new Date('2025-02-01'),
|
|
140
|
+
firstCheckOut: new Date('2025-02-02'),
|
|
141
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
checkIn: new Date('2025-02-02'),
|
|
145
|
+
firstCheckOut: new Date('2025-02-03'),
|
|
146
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
checkIn: new Date('2025-02-03'),
|
|
150
|
+
firstCheckOut: new Date('2025-02-04'),
|
|
151
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
checkIn: new Date('2025-02-04'),
|
|
155
|
+
firstCheckOut: new Date('2025-02-05'),
|
|
156
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
checkIn: new Date('2025-02-05'),
|
|
160
|
+
firstCheckOut: new Date('2025-02-06'),
|
|
161
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
checkIn: new Date('2025-02-06'),
|
|
165
|
+
firstCheckOut: new Date('2025-02-07'),
|
|
166
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
checkIn: new Date('2025-02-07'),
|
|
170
|
+
firstCheckOut: new Date('2025-02-08'),
|
|
171
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
checkIn: new Date('2025-02-08'),
|
|
175
|
+
firstCheckOut: new Date('2025-02-09'),
|
|
176
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
checkIn: new Date('2025-02-09'),
|
|
180
|
+
firstCheckOut: new Date('2025-02-10'),
|
|
181
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
checkIn: new Date('2025-02-10'),
|
|
185
|
+
firstCheckOut: new Date('2025-02-11'),
|
|
186
|
+
lastCheckOut: new Date('2025-02-11'),
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
checkIn: new Date('2025-02-11'),
|
|
190
|
+
firstCheckOut: new Date('2025-02-12'),
|
|
191
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
192
|
+
},
|
|
193
|
+
{
|
|
194
|
+
checkIn: new Date('2025-02-12'),
|
|
195
|
+
firstCheckOut: new Date('2025-02-13'),
|
|
196
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
checkIn: new Date('2025-02-13'),
|
|
200
|
+
firstCheckOut: new Date('2025-02-14'),
|
|
201
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
checkIn: new Date('2025-02-14'),
|
|
205
|
+
firstCheckOut: new Date('2025-02-15'),
|
|
206
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
207
|
+
},
|
|
208
|
+
{
|
|
209
|
+
checkIn: new Date('2025-02-15'),
|
|
210
|
+
firstCheckOut: new Date('2025-02-16'),
|
|
211
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
212
|
+
},
|
|
213
|
+
{
|
|
214
|
+
checkIn: new Date('2025-02-16'),
|
|
215
|
+
firstCheckOut: new Date('2025-02-17'),
|
|
216
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
checkIn: new Date('2025-02-17'),
|
|
220
|
+
firstCheckOut: new Date('2025-02-18'),
|
|
221
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
checkIn: new Date('2025-02-18'),
|
|
225
|
+
firstCheckOut: new Date('2025-02-19'),
|
|
226
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
checkIn: new Date('2025-02-19'),
|
|
230
|
+
firstCheckOut: new Date('2025-02-20'),
|
|
231
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
checkIn: new Date('2025-02-20'),
|
|
235
|
+
firstCheckOut: new Date('2025-02-21'),
|
|
236
|
+
lastCheckOut: new Date('2025-03-01'),
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
checkIn: new Date('2025-02-21'),
|
|
240
|
+
firstCheckOut: new Date('2025-02-22'),
|
|
241
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
242
|
+
},
|
|
243
|
+
{
|
|
244
|
+
checkIn: new Date('2025-02-22'),
|
|
245
|
+
firstCheckOut: new Date('2025-02-23'),
|
|
246
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
247
|
+
},
|
|
248
|
+
{
|
|
249
|
+
checkIn: new Date('2025-02-23'),
|
|
250
|
+
firstCheckOut: new Date('2025-02-24'),
|
|
251
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
checkIn: new Date('2025-02-24'),
|
|
255
|
+
firstCheckOut: new Date('2025-02-25'),
|
|
256
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
checkIn: new Date('2025-02-25'),
|
|
260
|
+
firstCheckOut: new Date('2025-02-26'),
|
|
261
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
262
|
+
},
|
|
263
|
+
{
|
|
264
|
+
checkIn: new Date('2025-02-26'),
|
|
265
|
+
firstCheckOut: new Date('2025-02-27'),
|
|
266
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
267
|
+
},
|
|
268
|
+
{
|
|
269
|
+
checkIn: new Date('2025-02-27'),
|
|
270
|
+
firstCheckOut: new Date('2025-02-28'),
|
|
271
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
checkIn: new Date('2025-02-28'),
|
|
275
|
+
firstCheckOut: new Date('2025-03-01'),
|
|
276
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
checkIn: new Date('2024-12-01'),
|
|
280
|
+
firstCheckOut: new Date('2024-12-02'),
|
|
281
|
+
lastCheckOut: new Date('2024-12-03'),
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
checkIn: new Date('2024-12-02'),
|
|
285
|
+
firstCheckOut: new Date('2024-12-03'),
|
|
286
|
+
lastCheckOut: new Date('2024-12-03'),
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
checkIn: new Date('2024-12-07'),
|
|
290
|
+
firstCheckOut: new Date('2024-12-08'),
|
|
291
|
+
lastCheckOut: new Date('2024-12-11'),
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
checkIn: new Date('2024-12-08'),
|
|
295
|
+
firstCheckOut: new Date('2024-12-09'),
|
|
296
|
+
lastCheckOut: new Date('2024-12-11'),
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
checkIn: new Date('2024-12-09'),
|
|
300
|
+
firstCheckOut: new Date('2024-12-10'),
|
|
301
|
+
lastCheckOut: new Date('2024-12-11'),
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
checkIn: new Date('2024-12-10'),
|
|
305
|
+
firstCheckOut: new Date('2024-12-11'),
|
|
306
|
+
lastCheckOut: new Date('2024-12-11'),
|
|
307
|
+
},
|
|
308
|
+
{
|
|
309
|
+
checkIn: new Date('2024-12-14'),
|
|
310
|
+
firstCheckOut: new Date('2024-12-15'),
|
|
311
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
checkIn: new Date('2024-12-15'),
|
|
315
|
+
firstCheckOut: new Date('2024-12-16'),
|
|
316
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
checkIn: new Date('2024-12-16'),
|
|
320
|
+
firstCheckOut: new Date('2024-12-17'),
|
|
321
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
322
|
+
},
|
|
323
|
+
{
|
|
324
|
+
checkIn: new Date('2024-12-17'),
|
|
325
|
+
firstCheckOut: new Date('2024-12-18'),
|
|
326
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
327
|
+
},
|
|
328
|
+
{
|
|
329
|
+
checkIn: new Date('2024-12-18'),
|
|
330
|
+
firstCheckOut: new Date('2024-12-19'),
|
|
331
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
checkIn: new Date('2024-12-19'),
|
|
335
|
+
firstCheckOut: new Date('2024-12-20'),
|
|
336
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
checkIn: new Date('2024-12-20'),
|
|
340
|
+
firstCheckOut: new Date('2024-12-21'),
|
|
341
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
342
|
+
},
|
|
343
|
+
{
|
|
344
|
+
checkIn: new Date('2024-12-21'),
|
|
345
|
+
firstCheckOut: new Date('2024-12-22'),
|
|
346
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
347
|
+
},
|
|
348
|
+
{
|
|
349
|
+
checkIn: new Date('2024-12-22'),
|
|
350
|
+
firstCheckOut: new Date('2024-12-23'),
|
|
351
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
checkIn: new Date('2024-12-23'),
|
|
355
|
+
firstCheckOut: new Date('2024-12-24'),
|
|
356
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
357
|
+
},
|
|
358
|
+
{
|
|
359
|
+
checkIn: new Date('2024-12-24'),
|
|
360
|
+
firstCheckOut: new Date('2024-12-25'),
|
|
361
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
checkIn: new Date('2024-12-25'),
|
|
365
|
+
firstCheckOut: new Date('2024-12-26'),
|
|
366
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
367
|
+
},
|
|
368
|
+
{
|
|
369
|
+
checkIn: new Date('2024-12-26'),
|
|
370
|
+
firstCheckOut: new Date('2024-12-27'),
|
|
371
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
372
|
+
},
|
|
373
|
+
{
|
|
374
|
+
checkIn: new Date('2024-12-27'),
|
|
375
|
+
firstCheckOut: new Date('2024-12-28'),
|
|
376
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
377
|
+
},
|
|
378
|
+
{
|
|
379
|
+
checkIn: new Date('2024-12-28'),
|
|
380
|
+
firstCheckOut: new Date('2024-12-29'),
|
|
381
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
382
|
+
},
|
|
383
|
+
{
|
|
384
|
+
checkIn: new Date('2024-12-29'),
|
|
385
|
+
firstCheckOut: new Date('2024-12-30'),
|
|
386
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
387
|
+
},
|
|
388
|
+
{
|
|
389
|
+
checkIn: new Date('2024-12-30'),
|
|
390
|
+
firstCheckOut: new Date('2024-12-31'),
|
|
391
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
392
|
+
},
|
|
393
|
+
{
|
|
394
|
+
checkIn: new Date('2024-12-31'),
|
|
395
|
+
firstCheckOut: new Date('2025-01-01'),
|
|
396
|
+
lastCheckOut: new Date('2025-01-04'),
|
|
397
|
+
},
|
|
398
|
+
{
|
|
399
|
+
checkIn: new Date('2025-03-01'),
|
|
400
|
+
firstCheckOut: new Date('2025-03-02'),
|
|
401
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
402
|
+
},
|
|
403
|
+
{
|
|
404
|
+
checkIn: new Date('2025-03-02'),
|
|
405
|
+
firstCheckOut: new Date('2025-03-03'),
|
|
406
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
407
|
+
},
|
|
408
|
+
{
|
|
409
|
+
checkIn: new Date('2025-03-03'),
|
|
410
|
+
firstCheckOut: new Date('2025-03-04'),
|
|
411
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
412
|
+
},
|
|
413
|
+
{
|
|
414
|
+
checkIn: new Date('2025-03-04'),
|
|
415
|
+
firstCheckOut: new Date('2025-03-05'),
|
|
416
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
417
|
+
},
|
|
418
|
+
{
|
|
419
|
+
checkIn: new Date('2025-03-05'),
|
|
420
|
+
firstCheckOut: new Date('2025-03-06'),
|
|
421
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
checkIn: new Date('2025-03-06'),
|
|
425
|
+
firstCheckOut: new Date('2025-03-07'),
|
|
426
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
427
|
+
},
|
|
428
|
+
{
|
|
429
|
+
checkIn: new Date('2025-03-07'),
|
|
430
|
+
firstCheckOut: new Date('2025-03-08'),
|
|
431
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
checkIn: new Date('2025-03-08'),
|
|
435
|
+
firstCheckOut: new Date('2025-03-09'),
|
|
436
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
437
|
+
},
|
|
438
|
+
{
|
|
439
|
+
checkIn: new Date('2025-03-09'),
|
|
440
|
+
firstCheckOut: new Date('2025-03-10'),
|
|
441
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
442
|
+
},
|
|
443
|
+
{
|
|
444
|
+
checkIn: new Date('2025-03-10'),
|
|
445
|
+
firstCheckOut: new Date('2025-03-11'),
|
|
446
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
checkIn: new Date('2025-03-11'),
|
|
450
|
+
firstCheckOut: new Date('2025-03-12'),
|
|
451
|
+
lastCheckOut: new Date('2025-03-12'),
|
|
452
|
+
},
|
|
453
|
+
],
|
|
454
|
+
disabledDates: [
|
|
455
|
+
{
|
|
456
|
+
to: new Date('2025-01-07'),
|
|
457
|
+
from: new Date('2025-01-04'),
|
|
458
|
+
},
|
|
459
|
+
{
|
|
460
|
+
to: new Date('2025-01-16'),
|
|
461
|
+
from: new Date('2025-01-14'),
|
|
462
|
+
},
|
|
463
|
+
{
|
|
464
|
+
to: new Date('2024-12-06'),
|
|
465
|
+
from: new Date('2024-12-03'),
|
|
466
|
+
},
|
|
467
|
+
{
|
|
468
|
+
to: new Date('2024-12-13'),
|
|
469
|
+
from: new Date('2024-12-11'),
|
|
470
|
+
},
|
|
471
|
+
{
|
|
472
|
+
to: new Date('2025-03-31'),
|
|
473
|
+
from: new Date('2025-03-12'),
|
|
474
|
+
},
|
|
475
|
+
],
|
|
476
|
+
},
|
|
477
|
+
|
|
478
|
+
language: 'en',
|
|
479
|
+
palette: {
|
|
480
|
+
primary: '#0095d9',
|
|
481
|
+
secondary: '#0095d9',
|
|
482
|
+
error: '#d32f2f',
|
|
483
|
+
},
|
|
484
|
+
loadingData: false,
|
|
485
|
+
toggleCalendar: true,
|
|
486
|
+
onSubmit: (val: any) => console.log('onSubmit ->', val),
|
|
487
|
+
setToggleCalendar: (val: any) => console.log('setToggleCalendar ->', val),
|
|
488
|
+
requestDates: (val: any) => console.log('requestDates ->', val),
|
|
489
|
+
showFeedback: true,
|
|
490
|
+
noActiveSelection: true,
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
export const Default: Story = {
|
|
494
|
+
args: { ...baseData },
|
|
495
|
+
render: (args) => {
|
|
496
|
+
const [toggleCalendar, setToggleCalendar] = useState(true)
|
|
497
|
+
return (
|
|
498
|
+
<div style={{ padding: '30px', height: '100vh' }}>
|
|
499
|
+
<FilterCalendar
|
|
500
|
+
{...args}
|
|
501
|
+
toggleCalendar={toggleCalendar}
|
|
502
|
+
setToggleCalendar={setToggleCalendar}
|
|
503
|
+
/>
|
|
504
|
+
{/* <button onClick={() => setToggleCalendar(true)}>Open calendar</button> */}
|
|
505
|
+
</div>
|
|
506
|
+
)
|
|
507
|
+
},
|
|
508
|
+
}
|
|
509
|
+
|
|
510
|
+
export const RangeContext: Story = {
|
|
16
511
|
args: {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
firstCheckOut: new Date('2024-08-02'),
|
|
22
|
-
lastCheckOut: new Date('2024-08-07'),
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
checkIn: new Date('2024-08-02'),
|
|
26
|
-
firstCheckOut: new Date('2024-08-03'),
|
|
27
|
-
lastCheckOut: new Date('2024-08-07'),
|
|
28
|
-
},
|
|
29
|
-
{
|
|
30
|
-
checkIn: new Date('2024-08-03'),
|
|
31
|
-
firstCheckOut: new Date('2024-08-04'),
|
|
32
|
-
lastCheckOut: new Date('2024-08-07'),
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
checkIn: new Date('2024-08-04'),
|
|
36
|
-
firstCheckOut: new Date('2024-08-05'),
|
|
37
|
-
lastCheckOut: new Date('2024-08-07'),
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
checkIn: new Date('2024-08-05'),
|
|
41
|
-
firstCheckOut: new Date('2024-08-06'),
|
|
42
|
-
lastCheckOut: new Date('2024-08-07'),
|
|
43
|
-
},
|
|
44
|
-
{
|
|
45
|
-
checkIn: new Date('2024-08-06'),
|
|
46
|
-
firstCheckOut: new Date('2024-08-07'),
|
|
47
|
-
lastCheckOut: new Date('2024-08-07'),
|
|
48
|
-
},
|
|
49
|
-
{
|
|
50
|
-
checkIn: new Date('2024-08-08'),
|
|
51
|
-
firstCheckOut: new Date('2024-08-09'),
|
|
52
|
-
lastCheckOut: new Date('2024-08-13'),
|
|
53
|
-
},
|
|
54
|
-
{
|
|
55
|
-
checkIn: new Date('2024-08-09'),
|
|
56
|
-
firstCheckOut: new Date('2024-08-10'),
|
|
57
|
-
lastCheckOut: new Date('2024-08-13'),
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
checkIn: new Date('2024-08-10'),
|
|
61
|
-
firstCheckOut: new Date('2024-08-11'),
|
|
62
|
-
lastCheckOut: new Date('2024-08-13'),
|
|
63
|
-
},
|
|
64
|
-
{
|
|
65
|
-
checkIn: new Date('2024-08-11'),
|
|
66
|
-
firstCheckOut: new Date('2024-08-12'),
|
|
67
|
-
lastCheckOut: new Date('2024-08-13'),
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
checkIn: new Date('2024-08-12'),
|
|
71
|
-
firstCheckOut: new Date('2024-08-13'),
|
|
72
|
-
lastCheckOut: new Date('2024-08-13'),
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
checkIn: new Date('2024-08-15'),
|
|
76
|
-
firstCheckOut: new Date('2024-08-16'),
|
|
77
|
-
lastCheckOut: new Date('2024-08-20'),
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
checkIn: new Date('2024-08-16'),
|
|
81
|
-
firstCheckOut: new Date('2024-08-17'),
|
|
82
|
-
lastCheckOut: new Date('2024-08-20'),
|
|
83
|
-
},
|
|
84
|
-
{
|
|
85
|
-
checkIn: new Date('2024-08-17'),
|
|
86
|
-
firstCheckOut: new Date('2024-08-18'),
|
|
87
|
-
lastCheckOut: new Date('2024-08-20'),
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
checkIn: new Date('2024-08-18'),
|
|
91
|
-
firstCheckOut: new Date('2024-08-19'),
|
|
92
|
-
lastCheckOut: new Date('2024-08-20'),
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
checkIn: new Date('2024-08-19'),
|
|
96
|
-
firstCheckOut: new Date('2024-08-20'),
|
|
97
|
-
lastCheckOut: new Date('2024-08-20'),
|
|
98
|
-
},
|
|
99
|
-
{
|
|
100
|
-
checkIn: new Date('2024-08-24'),
|
|
101
|
-
firstCheckOut: new Date('2024-08-25'),
|
|
102
|
-
lastCheckOut: new Date('2024-09-10'),
|
|
103
|
-
},
|
|
104
|
-
{
|
|
105
|
-
checkIn: new Date('2024-08-25'),
|
|
106
|
-
firstCheckOut: new Date('2024-08-26'),
|
|
107
|
-
lastCheckOut: new Date('2024-09-10'),
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
checkIn: new Date('2024-08-26'),
|
|
111
|
-
firstCheckOut: new Date('2024-08-27'),
|
|
112
|
-
lastCheckOut: new Date('2024-09-10'),
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
checkIn: new Date('2024-08-27'),
|
|
116
|
-
firstCheckOut: new Date('2024-08-28'),
|
|
117
|
-
lastCheckOut: new Date('2024-09-10'),
|
|
118
|
-
},
|
|
119
|
-
{
|
|
120
|
-
checkIn: new Date('2024-08-28'),
|
|
121
|
-
firstCheckOut: new Date('2024-08-29'),
|
|
122
|
-
lastCheckOut: new Date('2024-09-10'),
|
|
123
|
-
},
|
|
124
|
-
{
|
|
125
|
-
checkIn: new Date('2024-08-29'),
|
|
126
|
-
firstCheckOut: new Date('2024-08-30'),
|
|
127
|
-
lastCheckOut: new Date('2024-09-10'),
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
checkIn: new Date('2024-08-30'),
|
|
131
|
-
firstCheckOut: new Date('2024-08-31'),
|
|
132
|
-
lastCheckOut: new Date('2024-09-10'),
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
checkIn: new Date('2024-08-31'),
|
|
136
|
-
firstCheckOut: new Date('2024-09-01'),
|
|
137
|
-
lastCheckOut: new Date('2024-09-10'),
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
disabledDates: [
|
|
141
|
-
{
|
|
142
|
-
from: new Date('2024-07-02'),
|
|
143
|
-
to: new Date('2024-07-03'),
|
|
144
|
-
},
|
|
145
|
-
{
|
|
146
|
-
from: new Date('2024-08-07'),
|
|
147
|
-
to: new Date('2024-08-07'),
|
|
148
|
-
},
|
|
149
|
-
{
|
|
150
|
-
from: new Date('2024-08-13'),
|
|
151
|
-
to: new Date('2024-08-14'),
|
|
152
|
-
},
|
|
153
|
-
{
|
|
154
|
-
from: new Date('2024-08-20'),
|
|
155
|
-
to: new Date('2024-08-23'),
|
|
156
|
-
},
|
|
157
|
-
],
|
|
512
|
+
...baseData,
|
|
513
|
+
rangeContext: {
|
|
514
|
+
from: new Date('2025-01-09'),
|
|
515
|
+
to: new Date('2025-01-26'),
|
|
158
516
|
},
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
517
|
+
},
|
|
518
|
+
render: (args) => {
|
|
519
|
+
const [toggleCalendar, setToggleCalendar] = useState(true)
|
|
520
|
+
return (
|
|
521
|
+
<div style={{ padding: '30px', height: '100vh' }}>
|
|
522
|
+
<FilterCalendar
|
|
523
|
+
{...args}
|
|
524
|
+
toggleCalendar={toggleCalendar}
|
|
525
|
+
setToggleCalendar={setToggleCalendar}
|
|
526
|
+
/>
|
|
527
|
+
{/* <button onClick={() => setToggleCalendar(true)}>Open calendar</button> */}
|
|
528
|
+
</div>
|
|
529
|
+
)
|
|
530
|
+
},
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
export const DisabledRangeContextDates: Story = {
|
|
534
|
+
args: {
|
|
535
|
+
...baseData,
|
|
536
|
+
rangeContext: {
|
|
537
|
+
from: new Date('2025-01-04'),
|
|
538
|
+
to: new Date('2025-01-24'),
|
|
163
539
|
},
|
|
164
|
-
loadingData: true,
|
|
165
|
-
toggleCalendar: true,
|
|
166
|
-
onSubmit: (val) => console.log('onSubmit ->', val),
|
|
167
|
-
setToggleCalendar: (val) => console.log('setToggleCalendar ->', val),
|
|
168
|
-
requestDates: (val) => console.log('requestDates ->', val),
|
|
169
|
-
showFeedback: true,
|
|
170
|
-
noActiveSelection: true,
|
|
171
540
|
},
|
|
172
541
|
render: (args) => {
|
|
173
542
|
const [toggleCalendar, setToggleCalendar] = useState(true)
|