forked from Matsuuu/lit-flatpickr
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom-elements.json
More file actions
582 lines (582 loc) · 21.1 KB
/
Copy pathcustom-elements.json
File metadata and controls
582 lines (582 loc) · 21.1 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
573
574
575
576
577
578
579
580
581
582
{
"version": "experimental",
"tags": [
{
"name": "custom-input",
"path": "./demo/custom-input.js"
},
{
"name": "first-level-input",
"path": "./demo/custom-nested-input.js"
},
{
"name": "second-level-input",
"path": "./demo/custom-nested-input.js"
},
{
"name": "slotted-input",
"path": "./demo/custom-nested-input.js"
},
{
"name": "lit-flatpickr",
"path": "./src/LitFlatpickr.ts",
"attributes": [
{
"name": "placeholder",
"description": "Placeholder text for input element provided by lit-flatpickr",
"type": "string",
"default": "\"\""
},
{
"name": "altFormat",
"description": "Exactly the same as date format, but for the altInput field",
"type": "string",
"default": "\"F j, Y\""
},
{
"name": "altInput",
"description": "Show the user a readable date (as per altFormat), but return something totally different to the server.",
"type": "boolean",
"default": "false"
},
{
"name": "altInputClass",
"description": "This class will be added to the input element created by the altInput option.\nNote that altInput already inherits classes from the original input.",
"type": "string",
"default": "\"\""
},
{
"name": "allowInput",
"description": "Allows the user to enter a date directly input the input field. By default, direct entry is disabled.",
"type": "boolean",
"default": "false"
},
{
"name": "ariaDateFormat",
"description": "Defines how the date will be formatted in the aria-label for calendar days, using the same tokens as dateFormat.\nIf you change this, you should choose a value that will make sense if a screen reader reads it out loud",
"type": "string",
"default": "\"F j, Y\""
},
{
"name": "clickOpens",
"description": "Whether clicking on the input should open the picker.\nYou could disable this if you wish to open the calendar manually with.open()",
"type": "boolean",
"default": "true"
},
{
"name": "dateFormat",
"description": "A string of characters which are used to define how the date will be displayed in the input box.",
"type": "string",
"default": "\"Y-m-d\""
},
{
"name": "defaultDate",
"description": "Sets the initial selected date(s).\n\nIf you're using mode: \"multiple\" or a range calendar supply an Array of\nDate objects or an Array of date strings which follow your dateFormat.\n\nOtherwise, you can supply a single Date object or a date string.",
"type": "DateOption|DateOption[]"
},
{
"name": "defaultHour",
"description": "Initial value of the hour element.",
"type": "number",
"default": "12"
},
{
"name": "defaultMinute",
"description": "Initial value of the minute element.",
"type": "number",
"default": "0"
},
{
"name": "disable",
"description": "Dates selected to be unavailable for selection.",
"type": "DateLimit<DateOption>[]",
"default": "[]"
},
{
"name": "disableMobile",
"description": "Set disableMobile to true to always use the non-native picker.\nBy default, flatpickr utilizes native datetime widgets unless certain options (e.g. disable) are used.",
"type": "boolean",
"default": "false"
},
{
"name": "enable",
"description": "Dates selected to be available for selection.",
"type": "DateLimit<DateOption>[] | undefined",
"default": "\"undefined\""
},
{
"name": "enableTime",
"description": "Enables time picker",
"type": "boolean",
"default": "false"
},
{
"name": "enableSeconds",
"description": "Enables seconds in the time picker",
"type": "boolean",
"default": "false"
},
{
"name": "formatDateFn",
"description": "Allows using a custom date formatting function instead of the built-in\nhandling for date formats using dateFormat, altFormat, etc.\n\nFunction format: (date: Date, format: string, locale: Locale) => string",
"type": "((date: Date, format: string, locale: Locale) => string) | undefined"
},
{
"name": "hourIncrement",
"description": "Adjusts the step for the hour input (incl. scrolling)",
"type": "number",
"default": "1"
},
{
"name": "minuteIncrement",
"description": "Adjusts the step for the minute input (incl. scrolling)",
"type": "number",
"default": "5"
},
{
"name": "inline",
"description": "Displays the calendar inline",
"type": "boolean",
"default": "false"
},
{
"name": "maxDate",
"description": "The maximum date that a user can pick to (inclusive).",
"type": "string | number | Date | undefined"
},
{
"name": "minDate",
"description": "The minimum date that a user can pick to (inclusive).",
"type": "string | number | Date | undefined"
},
{
"name": "mode",
"description": "\"single\", \"multiple\", or \"range\"",
"type": "\"single\" | \"multiple\" | \"range\"",
"default": "\"single\""
},
{
"name": "nextArrow",
"description": "HTML for the arrow icon, used to switch months.",
"type": "string",
"default": "\">\""
},
{
"name": "prevArrow",
"description": "HTML for the arrow icon, used to switch months.",
"type": "string",
"default": "\"<\""
},
{
"name": "noCalendar",
"description": "Hides the day selection in calendar.\nUse it along with enableTime to create a time picker.",
"type": "boolean",
"default": "false"
},
{
"name": "onChange",
"description": "Function(s) to trigger on every date selection",
"type": "Hook | undefined"
},
{
"name": "onClose",
"description": "Function(s) to trigger every time the calendar is closed",
"type": "Hook | undefined"
},
{
"name": "onOpen",
"description": "Function(s) to trigger every time the calendar is opened",
"type": "Hook | undefined"
},
{
"name": "onReady",
"description": "Function(s) to trigger when the calendar is ready",
"type": "Hook | undefined"
},
{
"name": "onMonthChange",
"description": "Function(s) to trigger every time the calendar month is changed by the user or programmatically",
"type": "Hook | undefined"
},
{
"name": "onYearChange",
"description": "Function(s) to trigger every time the calendar year is changed by the user or programmatically",
"type": "Hook | undefined"
},
{
"name": "onValueUpdate",
"description": "Function(s) to trigger when the input value is updated with a new date string",
"type": "Hook | undefined"
},
{
"name": "parseDateFn",
"description": "Function that expects a date string and must return a Date object.\n\nFunction format: (date: string, format: string) => string",
"type": "((date: string, format: string) => Date) | undefined"
},
{
"name": "position",
"description": "Where the calendar is rendered relative to the input",
"type": "\"auto\" | \"above\" | \"below\"",
"default": "\"auto\""
},
{
"name": "shorthandCurrentMonth",
"description": "Show the month using the shorthand version (ie, Sep instead of September)",
"type": "boolean",
"default": "false"
},
{
"name": "showMonths",
"description": "The number of months showed",
"type": "number",
"default": "1"
},
{
"name": "static",
"description": "Position the calendar inside the wrapper and next to the input element",
"type": "boolean",
"default": "false"
},
{
"name": "time_24hr",
"description": "Displays the time picker in 24 hour mode without AM/PM selection when enabled",
"type": "boolean",
"default": "false"
},
{
"name": "weekNumbers",
"description": "Enabled display of week numbers in calendar",
"type": "boolean",
"default": "false"
},
{
"name": "wrap",
"description": "flatpickr can parse an input group of textboxes and buttons, common in Bootstrap and other frameworks.\nThis permits additional markup, as well as custom elements to trigger the state of the calendar.",
"type": "boolean",
"default": "false"
},
{
"name": "theme",
"description": "The set theme of flatpickr.",
"type": " \"light\" | \"dark\" | \"material_blue\" | \"material_red\" | \"material_green\" | \"material_orange\" | \"airbnb\" | \"confetti\" | \"none\" ",
"default": "\"light\""
},
{
"name": "firstDayOfWeek",
"type": "number",
"default": "1"
},
{
"name": "locale",
"type": "string | undefined"
},
{
"name": "default-to-today",
"type": "boolean",
"default": "false"
}
],
"properties": [
{
"name": "placeholder",
"attribute": "placeholder",
"description": "Placeholder text for input element provided by lit-flatpickr",
"type": "string",
"default": "\"\""
},
{
"name": "altFormat",
"attribute": "altFormat",
"description": "Exactly the same as date format, but for the altInput field",
"type": "string",
"default": "\"F j, Y\""
},
{
"name": "altInput",
"attribute": "altInput",
"description": "Show the user a readable date (as per altFormat), but return something totally different to the server.",
"type": "boolean",
"default": "false"
},
{
"name": "altInputClass",
"attribute": "altInputClass",
"description": "This class will be added to the input element created by the altInput option.\nNote that altInput already inherits classes from the original input.",
"type": "string",
"default": "\"\""
},
{
"name": "allowInput",
"attribute": "allowInput",
"description": "Allows the user to enter a date directly input the input field. By default, direct entry is disabled.",
"type": "boolean",
"default": "false"
},
{
"name": "ariaDateFormat",
"attribute": "ariaDateFormat",
"description": "Defines how the date will be formatted in the aria-label for calendar days, using the same tokens as dateFormat.\nIf you change this, you should choose a value that will make sense if a screen reader reads it out loud",
"type": "string",
"default": "\"F j, Y\""
},
{
"name": "clickOpens",
"attribute": "clickOpens",
"description": "Whether clicking on the input should open the picker.\nYou could disable this if you wish to open the calendar manually with.open()",
"type": "boolean",
"default": "true"
},
{
"name": "dateFormat",
"attribute": "dateFormat",
"description": "A string of characters which are used to define how the date will be displayed in the input box.",
"type": "string",
"default": "\"Y-m-d\""
},
{
"name": "defaultDate",
"attribute": "defaultDate",
"description": "Sets the initial selected date(s).\n\nIf you're using mode: \"multiple\" or a range calendar supply an Array of\nDate objects or an Array of date strings which follow your dateFormat.\n\nOtherwise, you can supply a single Date object or a date string.",
"type": "DateOption|DateOption[]"
},
{
"name": "defaultHour",
"attribute": "defaultHour",
"description": "Initial value of the hour element.",
"type": "number",
"default": "12"
},
{
"name": "defaultMinute",
"attribute": "defaultMinute",
"description": "Initial value of the minute element.",
"type": "number",
"default": "0"
},
{
"name": "disable",
"attribute": "disable",
"description": "Dates selected to be unavailable for selection.",
"type": "DateLimit<DateOption>[]",
"default": "[]"
},
{
"name": "disableMobile",
"attribute": "disableMobile",
"description": "Set disableMobile to true to always use the non-native picker.\nBy default, flatpickr utilizes native datetime widgets unless certain options (e.g. disable) are used.",
"type": "boolean",
"default": "false"
},
{
"name": "enable",
"attribute": "enable",
"description": "Dates selected to be available for selection.",
"type": "DateLimit<DateOption>[] | undefined",
"default": "\"undefined\""
},
{
"name": "enableTime",
"attribute": "enableTime",
"description": "Enables time picker",
"type": "boolean",
"default": "false"
},
{
"name": "enableSeconds",
"attribute": "enableSeconds",
"description": "Enables seconds in the time picker",
"type": "boolean",
"default": "false"
},
{
"name": "formatDateFn",
"attribute": "formatDateFn",
"description": "Allows using a custom date formatting function instead of the built-in\nhandling for date formats using dateFormat, altFormat, etc.\n\nFunction format: (date: Date, format: string, locale: Locale) => string",
"type": "((date: Date, format: string, locale: Locale) => string) | undefined"
},
{
"name": "hourIncrement",
"attribute": "hourIncrement",
"description": "Adjusts the step for the hour input (incl. scrolling)",
"type": "number",
"default": "1"
},
{
"name": "minuteIncrement",
"attribute": "minuteIncrement",
"description": "Adjusts the step for the minute input (incl. scrolling)",
"type": "number",
"default": "5"
},
{
"name": "inline",
"attribute": "inline",
"description": "Displays the calendar inline",
"type": "boolean",
"default": "false"
},
{
"name": "maxDate",
"attribute": "maxDate",
"description": "The maximum date that a user can pick to (inclusive).",
"type": "string | number | Date | undefined"
},
{
"name": "minDate",
"attribute": "minDate",
"description": "The minimum date that a user can pick to (inclusive).",
"type": "string | number | Date | undefined"
},
{
"name": "mode",
"attribute": "mode",
"description": "\"single\", \"multiple\", or \"range\"",
"type": "\"single\" | \"multiple\" | \"range\"",
"default": "\"single\""
},
{
"name": "nextArrow",
"attribute": "nextArrow",
"description": "HTML for the arrow icon, used to switch months.",
"type": "string",
"default": "\">\""
},
{
"name": "prevArrow",
"attribute": "prevArrow",
"description": "HTML for the arrow icon, used to switch months.",
"type": "string",
"default": "\"<\""
},
{
"name": "noCalendar",
"attribute": "noCalendar",
"description": "Hides the day selection in calendar.\nUse it along with enableTime to create a time picker.",
"type": "boolean",
"default": "false"
},
{
"name": "onChange",
"attribute": "onChange",
"description": "Function(s) to trigger on every date selection",
"type": "Hook | undefined"
},
{
"name": "onClose",
"attribute": "onClose",
"description": "Function(s) to trigger every time the calendar is closed",
"type": "Hook | undefined"
},
{
"name": "onOpen",
"attribute": "onOpen",
"description": "Function(s) to trigger every time the calendar is opened",
"type": "Hook | undefined"
},
{
"name": "onReady",
"attribute": "onReady",
"description": "Function(s) to trigger when the calendar is ready",
"type": "Hook | undefined"
},
{
"name": "onMonthChange",
"attribute": "onMonthChange",
"description": "Function(s) to trigger every time the calendar month is changed by the user or programmatically",
"type": "Hook | undefined"
},
{
"name": "onYearChange",
"attribute": "onYearChange",
"description": "Function(s) to trigger every time the calendar year is changed by the user or programmatically",
"type": "Hook | undefined"
},
{
"name": "onValueUpdate",
"attribute": "onValueUpdate",
"description": "Function(s) to trigger when the input value is updated with a new date string",
"type": "Hook | undefined"
},
{
"name": "parseDateFn",
"attribute": "parseDateFn",
"description": "Function that expects a date string and must return a Date object.\n\nFunction format: (date: string, format: string) => string",
"type": "((date: string, format: string) => Date) | undefined"
},
{
"name": "position",
"attribute": "position",
"description": "Where the calendar is rendered relative to the input",
"type": "\"auto\" | \"above\" | \"below\"",
"default": "\"auto\""
},
{
"name": "shorthandCurrentMonth",
"attribute": "shorthandCurrentMonth",
"description": "Show the month using the shorthand version (ie, Sep instead of September)",
"type": "boolean",
"default": "false"
},
{
"name": "showMonths",
"attribute": "showMonths",
"description": "The number of months showed",
"type": "number",
"default": "1"
},
{
"name": "static",
"attribute": "static",
"description": "Position the calendar inside the wrapper and next to the input element",
"type": "boolean",
"default": "false"
},
{
"name": "time_24hr",
"attribute": "time_24hr",
"description": "Displays the time picker in 24 hour mode without AM/PM selection when enabled",
"type": "boolean",
"default": "false"
},
{
"name": "weekNumbers",
"attribute": "weekNumbers",
"description": "Enabled display of week numbers in calendar",
"type": "boolean",
"default": "false"
},
{
"name": "wrap",
"attribute": "wrap",
"description": "flatpickr can parse an input group of textboxes and buttons, common in Bootstrap and other frameworks.\nThis permits additional markup, as well as custom elements to trigger the state of the calendar.",
"type": "boolean",
"default": "false"
},
{
"name": "theme",
"attribute": "theme",
"description": "The set theme of flatpickr.",
"type": " \"light\" | \"dark\" | \"material_blue\" | \"material_red\" | \"material_green\" | \"material_orange\" | \"airbnb\" | \"confetti\" | \"none\" ",
"default": "\"light\""
},
{
"name": "firstDayOfWeek",
"attribute": "firstDayOfWeek",
"type": "number",
"default": "1"
},
{
"name": "locale",
"attribute": "locale",
"type": "string | undefined"
},
{
"name": "defaultToToday",
"attribute": "default-to-today",
"type": "boolean",
"default": "false"
}
]
}
]
}