|
| 1 | +import React, { FC } from 'react'; |
| 2 | + |
| 3 | +import { PropsTable } from '../../../docs/PropsTable'; |
| 4 | + |
| 5 | +export const DatepickerRangeInputPropsTable: FC = () => { |
| 6 | + const props = [ |
| 7 | + { |
| 8 | + name: 'startPlaceholder', |
| 9 | + type: 'string', |
| 10 | + description: 'Placeholder for start date.' |
| 11 | + }, |
| 12 | + { |
| 13 | + name: 'endPlaceholder', |
| 14 | + type: 'string', |
| 15 | + description: 'Placeholder for end date.' |
| 16 | + }, |
| 17 | + { |
| 18 | + name: 'label', |
| 19 | + type: 'string', |
| 20 | + description: 'Label for the input.' |
| 21 | + }, |
| 22 | + { |
| 23 | + name: 'onClose', |
| 24 | + type: 'Function => void', |
| 25 | + description: 'Function that is used when datepicker closes without selected date.' |
| 26 | + }, |
| 27 | + { |
| 28 | + name: 'value', |
| 29 | + type: 'DateRange (interface containing startDate and endDate properties)', |
| 30 | + description: 'Set the value for the date.' |
| 31 | + }, |
| 32 | + { |
| 33 | + name: 'onChange', |
| 34 | + type: 'Function (change: DateRange) => void', |
| 35 | + description: 'Function that is used when datepicker selects new date.' |
| 36 | + }, |
| 37 | + { |
| 38 | + name: 'minDate', |
| 39 | + type: 'Date', |
| 40 | + description: 'Minimal date to select from.' |
| 41 | + }, |
| 42 | + { |
| 43 | + name: 'maxDate', |
| 44 | + type: 'Date', |
| 45 | + description: 'Maximum date to select from.' |
| 46 | + }, |
| 47 | + { |
| 48 | + name: 'firstDayOfWeek', |
| 49 | + type: 'FirstDayOfWeek (number from 0-6)', |
| 50 | + description: 'Accepts a number for first day of the week from 0 (Sunday) to 6 (Saturday).', |
| 51 | + defaultValue: '1' |
| 52 | + }, |
| 53 | + { |
| 54 | + name: 'isDateBlocked', |
| 55 | + type: 'Function => boolean', |
| 56 | + description: 'Function that runs for each date and returns boolean whether date is disabled or not.', |
| 57 | + defaultValue: '() => false' |
| 58 | + }, |
| 59 | + { |
| 60 | + name: 'placement', |
| 61 | + type: "'left' | 'right' | 'center'", |
| 62 | + description: 'Used to align the datepicker in relation to input.', |
| 63 | + defaultValue: 'left' |
| 64 | + }, |
| 65 | + { |
| 66 | + name: 'displayFormat', |
| 67 | + type: 'string', |
| 68 | + description: 'String to format dates.', |
| 69 | + defaultValue: 'dd/MM/yyyy' |
| 70 | + }, |
| 71 | + { |
| 72 | + name: 'locale', |
| 73 | + type: 'string', |
| 74 | + description: 'String to define the locale in ISO-639-1.', |
| 75 | + defaultValue: 'en-US' |
| 76 | + }, |
| 77 | + { |
| 78 | + name: 'errorHandler', |
| 79 | + type: '(Function => void) | string', |
| 80 | + description: 'Text to be shown if error filling the input or fn to be trigger as a callback when error.' |
| 81 | + }, |
| 82 | + { |
| 83 | + name: 'startInputId', |
| 84 | + type: 'string', |
| 85 | + description: 'The id to be assigned to the start date input.' |
| 86 | + }, |
| 87 | + { |
| 88 | + name: 'endInputId', |
| 89 | + type: 'string', |
| 90 | + description: 'The id to be assigned to the end date input.' |
| 91 | + }, |
| 92 | + { |
| 93 | + name: 'variant', |
| 94 | + type: "'compact' | 'normal'", |
| 95 | + description: "Determines the variant, 'compact' displays only a single month", |
| 96 | + defaultValue: "'normal'" |
| 97 | + }, |
| 98 | + { |
| 99 | + name: 'disabled', |
| 100 | + type: 'boolean', |
| 101 | + description: 'Determines whether the datePicker is disabled or not.' |
| 102 | + } |
| 103 | + ]; |
| 104 | + return <PropsTable props={props} />; |
| 105 | +}; |
0 commit comments