forked from Hacker0x01/react-datepicker
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.tsx
More file actions
572 lines (570 loc) · 16.8 KB
/
config.tsx
File metadata and controls
572 lines (570 loc) · 16.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
import { IExampleConfig } from "../../types";
// Examples
import Default from "../../examples/ts/default?raw";
import CalendarContainer from "../../examples/ts/calendarContainer?raw";
import CalendarIcon from "../../examples/ts/calendarIcon?raw";
import CalendarIconSvgIcon from "../../examples/ts/calendarIconSvgIcon?raw";
import CalendarIconExternal from "../../examples/ts/calendarIconExternal?raw";
import CalendarStartDay from "../../examples/ts/calendarStartDay?raw";
import OnCalendarChangeStateCallbacks from "../../examples/ts/onCalendarOpenStateCallbacks?raw";
import ToggleCalendarOnIconClick from "../../examples/ts/toggleCalendarOnIconClick?raw";
import Children from "../../examples/ts/children?raw";
import ClearInput from "../../examples/ts/clearInput?raw";
import CloseOnScroll from "../../examples/ts/closeOnScroll?raw";
import CloseOnScrollCallback from "../../examples/ts/closeOnScrollCallback?raw";
import ConfigureFloatingUI from "../../examples/ts/configureFloatingUI?raw";
import CustomInput from "../../examples/ts/customInput?raw";
import RenderCustomHeader from "../../examples/ts/renderCustomHeader?raw";
import RenderCustomHeaderTwoMonths from "../../examples/ts/renderCustomHeaderTwoMonths?raw";
import RenderCustomDayName from "../../examples/ts/renderCustomDayName?raw";
import RenderCustomDay from "../../examples/ts/renderCustomDay?raw";
import RenderCustomMonth from "../../examples/ts/renderCustomMonth?raw";
import RenderCustomQuarter from "../../examples/ts/renderCustomQuarter?raw";
import RenderCustomYear from "../../examples/ts/renderCustomYear?raw";
import CustomCalendarClassName from "../../examples/ts/customCalendarClassName?raw";
import CustomClassName from "../../examples/ts/customClassName?raw";
import CustomDayClassName from "../../examples/ts/customDayClassName?raw";
import CustomDateFormat from "../../examples/ts/customDateFormat?raw";
import CustomTimeClassName from "../../examples/ts/customTimeClassName?raw";
import CustomTimeInput from "../../examples/ts/customTimeInput?raw";
import DateRange from "../../examples/ts/dateRange?raw";
import SelectsRange from "../../examples/ts/selectsRange?raw";
import SelectsRangeWithDisabledDates from "../../examples/ts/selectsRangeWithDisabledDates?raw";
import DateRangeWithShowDisabledNavigation from "../../examples/ts/dateRangeWithShowDisabledNavigation?raw";
import DateRangeInputWithClearButton from "../../examples/ts/dateRangeInputWithClearButton?raw";
import DateRangeWithPortal from "../../examples/ts/dateRangeWithPortal?raw";
import Disabled from "../../examples/ts/disabled?raw";
import DisabledKeyboardNavigation from "../../examples/ts/disabledKeyboardNavigation?raw";
import WeekNumbers from "../../examples/ts/weekNumbers?raw";
import DontCloseOnSelect from "../../examples/ts/dontCloseOnSelect?raw";
import ExcludeDates from "../../examples/ts/excludeDates?raw";
import ExcludedWithMessage from "../../examples/ts/excludeDatesWithMessage?raw";
import ExcludeDateIntervals from "../../examples/ts/excludeDateIntervals?raw";
import ExcludeDatesMonthPicker from "../../examples/ts/excludeDatesMonthPicker?raw";
import ExcludeDatesRangeMonthPicker from "../../examples/ts/excludeDatesRangeMonthPicker?raw";
import ExcludeTimes from "../../examples/ts/excludeTimes?raw";
import FilterDates from "../../examples/ts/filterDates?raw";
import FilterTimes from "../../examples/ts/filterTimes?raw";
import FixedCalendar from "../../examples/ts/fixedCalendar?raw";
import RawChange from "../../examples/ts/rawChange?raw";
import HighlightDates from "../../examples/ts/highlightDates?raw";
import HighlightDatesRanges from "../../examples/ts/highlightDatesRanges?raw";
import HolidayDates from "../../examples/ts/holidayDates?raw";
import IncludeDates from "../../examples/ts/includeDates?raw";
import IncludeDateIntervals from "../../examples/ts/includeDateIntervals?raw";
import IncludeDatesMonthPicker from "../../examples/ts/includeDatesMonthPicker?raw";
import IncludeTimes from "../../examples/ts/includeTimes?raw";
import InjectTimes from "../../examples/ts/injectTimes?raw";
import Inline from "../../examples/ts/inline?raw";
import InlineDisabled from "../../examples/ts/disabledInline?raw";
import InlineVisible from "../../examples/ts/inlineVisible?raw";
import TimeInput from "../../examples/ts/timeInput?raw";
import Locale from "../../examples/ts/locale?raw";
import LocaleWithTime from "../../examples/ts/localeWithTime?raw";
import LocaleWithoutGlobalVariable from "../../examples/ts/localeWithoutGlobalVariable?raw";
import MinDate from "../../examples/ts/minDate?raw";
import MaxDate from "../../examples/ts/maxDate?raw";
import MonthPicker from "../../examples/ts/monthPicker?raw";
import MonthPickerFullName from "../../examples/ts/monthPickerFullName?raw";
import MonthPickerTwoColumns from "../../examples/ts/monthPickerTwoColumns?raw";
import MonthPickerFourColumns from "../../examples/ts/monthPickerFourColumns?raw";
import MonthDropdown from "../../examples/ts/monthDropdown?raw";
import MonthDropdownShort from "../../examples/ts/monthDropdownShort?raw";
import MonthYearDropdown from "../../examples/ts/monthYearDropdown?raw";
import MultiMonth from "../../examples/ts/multiMonth?raw";
import MultiMonthDropdown from "../../examples/ts/multiMonthDropdown?raw";
import MultiMonthInline from "../../examples/ts/multiMonthInline?raw";
import NoAnchorArrow from "../../examples/ts/noAnchorArrow?raw";
import OnBlurCallbacks from "../../examples/ts/onBlurCallbacks?raw";
import OpenToDate from "../../examples/ts/openToDate?raw";
import PlaceholderText from "../../examples/ts/placeholderText?raw";
import Portal from "../../examples/ts/portal?raw";
import PortalById from "../../examples/ts/portalById?raw";
import WithPortalById from "../../examples/ts/withPortalById?raw";
import QuarterPicker from "../../examples/ts/quarterPicker?raw";
import RangeMonthPicker from "../../examples/ts/rangeMonthPicker?raw";
import RangeMonthPickerSelectsRange from "../../examples/ts/rangeMonthPickerSelectsRange?raw";
import RangeQuarterPicker from "../../examples/ts/rangeQuarterPicker?raw";
import RangeQuarterPickerSelectsRange from "../../examples/ts/rangeQuarterPickerSelectsRange?raw";
import RangeSwapRange from "../../examples/ts/rangeSwapRange?raw";
import ReadOnly from "../../examples/ts/readOnly?raw";
import ShowTime from "../../examples/ts/showTime?raw";
import ShowTimeOnly from "../../examples/ts/showTimeOnly?raw";
import HideTimeCaption from "../../examples/ts/hideTimeCaption?raw";
import MultiMonthPrevious from "../../examples/ts/multiMonthPrevious?raw";
import SpecificDateRange from "../../examples/ts/specificDateRange?raw";
import ExcludeTimePeriod from "../../examples/ts/excludeTimePeriod?raw";
import SelectsMultiple from "../../examples/ts/selectsMultiple?raw";
import SelectsMultipleMonths from "../../examples/ts/selectsMultipleMonths?raw";
import SelectsMultipleFormat from "../../examples/ts/selectsMultipleFormat?raw";
import StrictParsing from "../../examples/ts/strictParsing?raw";
import TabIndex from "../../examples/ts/tabIndex?raw";
import Today from "../../examples/ts/today?raw";
import YearPicker from "../../examples/ts/yearPicker?raw";
import RangeYearPicker from "../../examples/ts/rangeYearPicker?raw";
import RangeYearPickerSelectsRange from "../../examples/ts/rangeYearPickerSelectsRange?raw";
import YearDropdown from "../../examples/ts/yearDropdown?raw";
import YearSelectDropdown from "../../examples/ts/yearSelectDropdown?raw";
import YearItemNumber from "../../examples/ts/yearItemNumber?raw";
import WeekPicker from "../../examples/ts/weekPicker?raw";
import ExcludeWeeks from "../../examples/ts/excludeWeeks?raw";
import ExternalForm from "../../examples/ts/externalForm?raw";
export const EXAMPLE_CONFIG: IExampleConfig[] = [
{
title: "Default",
component: Default,
},
{
title: "Calendar Icon",
component: CalendarIcon,
},
{
title: "Calendar Icon using React Svg Component",
component: CalendarIconSvgIcon,
},
{
title: "Calendar Icon using External Lib",
component: CalendarIconExternal,
},
{
title: "Toggle Calendar open status on click of the calendar icon",
component: ToggleCalendarOnIconClick,
},
{
title: "Calendar container",
component: CalendarContainer,
},
{
title: "Calendar open state callbacks",
component: OnCalendarChangeStateCallbacks,
},
{
title: "Children",
component: Children,
},
{
title: "Clear datepicker input",
component: ClearInput,
},
{
title: "Close on scroll",
component: CloseOnScroll,
},
{
title: "Close on scroll callback",
component: CloseOnScrollCallback,
},
{
title: "Configure Floating UI Properties",
component: ConfigureFloatingUI,
description: (
<div>
Full docs for the underlying library that manages the overlay used can
be found at{" "}
<a
href="https://floating-ui.com/"
target="_blank"
rel="noopener noreferrer"
>
floating-ui.com
</a>
</div>
),
},
{
title: "Custom input",
component: CustomInput,
},
{
title: "Custom header",
component: RenderCustomHeader,
},
{
title: "Custom header with two months displayed",
component: RenderCustomHeaderTwoMonths,
},
{
title: "Custom Day Names",
component: RenderCustomDayName,
},
{
title: "Custom Day",
component: RenderCustomDay,
},
{
title: "Custom Month",
component: RenderCustomMonth,
},
{
title: "Custom Quarter",
component: RenderCustomQuarter,
},
{
title: "Custom Year",
component: RenderCustomYear,
},
{
title: "Custom calendar class name",
component: CustomCalendarClassName,
},
{
title: "Custom class name",
component: CustomClassName,
},
{
title: "Custom day class name",
component: CustomDayClassName,
},
{
title: "Custom date format",
component: CustomDateFormat,
},
{
title: "Custom time class name",
component: CustomTimeClassName,
},
{
title: "Custom time input",
component: CustomTimeInput,
},
{
title: "Date Range",
component: DateRange,
},
{
title: "Date range for one datepicker",
component: SelectsRange,
},
{
title: "Date range for one datepicker with disabled dates highlighted",
component: SelectsRangeWithDisabledDates,
},
{
title: "Date Range with disabled navigation shown",
component: DateRangeWithShowDisabledNavigation,
},
{
title: "Date Range using input with clear button",
component: DateRangeInputWithClearButton,
},
{
title: "Date Range with Portal",
component: DateRangeWithPortal,
},
{
title: "Disable datepicker",
component: Disabled,
},
{
title: "Disable keyboard navigation",
component: DisabledKeyboardNavigation,
},
{
title: "Display Week Numbers",
component: WeekNumbers,
},
{
title: "Don't hide calendar on date selection",
component: DontCloseOnSelect,
},
{
title: "Exclude dates",
component: ExcludeDates,
},
{
title: "Exclude dates with message",
component: ExcludedWithMessage,
},
{
title: "Exclude date intervals",
component: ExcludeDateIntervals,
},
{
title: "Exclude Months in Month Picker",
component: ExcludeDatesMonthPicker,
},
{
title: "Exclude Months in Range Month Picker",
component: ExcludeDatesRangeMonthPicker,
},
{
title: "Exclude Times",
component: ExcludeTimes,
},
{
title: "Filter dates",
component: FilterDates,
},
{
title: "Filter times",
component: FilterTimes,
},
{
title: "Fixed height of Calendar",
component: FixedCalendar,
},
{
title: "Get raw input value on change",
component: RawChange,
},
{
title: "Highlight dates",
component: HighlightDates,
},
{
title: "Highlight dates with custom class names and ranges",
component: HighlightDatesRanges,
},
{
title: "Holiday dates",
component: HolidayDates,
},
{
title: "Include dates",
component: IncludeDates,
},
{
title: "Include date intervals",
component: IncludeDateIntervals,
},
{
title: "Include Months in Month Picker",
component: IncludeDatesMonthPicker,
},
{
title: "Include Times",
component: IncludeTimes,
},
{
title: "Inject Specific Times",
component: InjectTimes,
},
{
title: "Inline version",
component: Inline,
},
{
title: "Inline version disabled",
component: InlineDisabled,
},
{
title: "Button to show Inline version",
component: InlineVisible,
},
{
title: "Input time",
component: TimeInput,
},
{
title: "Locale",
component: Locale,
},
{
title: "Locale with time",
component: LocaleWithTime,
},
{
title: "Locale without global variables",
component: LocaleWithoutGlobalVariable,
},
{
title: "Min date",
component: MinDate,
},
{
title: "Max date",
component: MaxDate,
},
{
title: "Month Picker",
component: MonthPicker,
},
{
title: "Month Picker with Full Name",
component: MonthPickerFullName,
},
{
title: "Month Picker Two Columns Layout",
component: MonthPickerTwoColumns,
},
{
title: "Month Picker Four Columns Layout",
component: MonthPickerFourColumns,
},
{
title: "Month dropdown",
component: MonthDropdown,
},
{
title: "Month dropdown short month",
component: MonthDropdownShort,
},
{
title: "MonthYear dropdown",
component: MonthYearDropdown,
},
{
title: "Multiple months",
component: MultiMonth,
},
{
title: "Multiple months with year dropdown",
component: MultiMonthDropdown,
},
{
title: "Multiple months inline",
component: MultiMonthInline,
},
{
title: "No Anchor Arrow",
component: NoAnchorArrow,
},
{
title: "onBlur callbacks in console",
component: OnBlurCallbacks,
},
{
title: "Open to date",
component: OpenToDate,
},
{
title: "Placeholder text",
component: PlaceholderText,
},
{
title: "Portal version",
component: Portal,
},
{
title: "Portal by id",
description:
"If the provided portalId cannot be found in the dom, one will be created by default with that id.",
component: PortalById,
},
{
title: "Portal version with portal by id",
description:
"If the provided portalId cannot be found in the dom, one will be created by default with that id.",
component: WithPortalById,
},
{
title: "Quarter Picker",
component: QuarterPicker,
},
{
title: "Range Month Picker",
component: RangeMonthPicker,
},
{
title: "Range Month Picker for one month picker",
component: RangeMonthPickerSelectsRange,
},
{
title: "Range Quarter Picker",
component: RangeQuarterPicker,
},
{
title: "Range Quarter Picker for one quarter picker",
component: RangeQuarterPickerSelectsRange,
},
{
title: "Range Swap Range",
description:
"Swap the start and end date if the end date is before the start date in a pick sequence.",
component: RangeSwapRange,
},
{
title: "Read only datepicker",
component: ReadOnly,
},
{
title: "Select Time",
component: ShowTime,
},
{
title: "Select Time Only",
component: ShowTimeOnly,
},
{
title: "Hide Time Caption",
component: HideTimeCaption,
},
{
title: "Show previous months",
component: MultiMonthPrevious,
},
{
title: "Specific date range",
component: SpecificDateRange,
},
{
title: "Specific Time Range",
component: ExcludeTimePeriod,
},
{
title: "Select multiple dates",
component: SelectsMultiple,
},
{
title: "Select multiple dates with custom format",
component: SelectsMultipleFormat,
},
{
title: "Select multiple months",
component: SelectsMultipleMonths,
},
{
title: "Strict parsing",
description:
"Enables strict format validation for manual date input. When this flag is activated, the component will only accept values that exactly match the specified date format (`dateFormat`).",
component: StrictParsing,
},
{
title: "TabIndex",
component: TabIndex,
},
{
title: "Today button",
component: Today,
},
{
title: "Year Picker",
component: YearPicker,
},
{
title: "Range Year Picker",
component: RangeYearPicker,
},
{
title: "Range Year Picker for one datepicker",
component: RangeYearPickerSelectsRange,
},
{
title: "Year dropdown",
component: YearDropdown,
},
{
title: "Year select dropdown",
component: YearSelectDropdown,
},
{
title: "Year item number",
component: YearItemNumber,
},
{
title: "Calendar Start day",
component: CalendarStartDay,
},
{
title: "Week Picker",
component: WeekPicker,
},
{
title: "Exclude Weeks",
component: ExcludeWeeks,
},
{
title: "External Form",
component: ExternalForm,
},
];