You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat: support custom icon and clearIcon props (#297)
* test: add and configure jest-dom
* feat(datepicker): allow custom icon and clear icon as components
* test(datepicker): assert that custom icons work as expected
* chore(stories): add selects for custom icon and clearIcon props
* chore: improve type-checking and add story for custom icons
* docs: add icon and clearIcon props to README
| allowOnlyNumbers | boolean | no | true | Allows the user enter only numbers |
79
-
| autoComplete | string | no | -- | Specifies if the input should have autocomplete enabled |
80
-
| clearOnSameDateClick | boolean | no | true | Controls whether the datepicker's state resets if the same date is selected in succession. |
81
-
| clearable | boolean | no | true | Allows the user to clear the value |
82
-
| filterDate | function | no | () => true | Function that receives each date and returns a boolean to indicate whether it is enabled or not |
83
-
| format | string | no | 'YYYY-MM-DD' | Specifies how the date will be formatted using the [date-fns' format](https://date-fns.org/v1.29.0/docs/format)|
84
-
| keepOpenOnClear | boolean | no | false | Keeps the datepicker open (or opens it if it's closed) when the clear icon is clicked |
85
-
| keepOpenOnSelect | boolean | no | false | Keeps the datepicker open when a date is selected |
86
-
| inline | boolean | no | false | Uses an inline variant, without the input and the features related to it, e.g. clearable datepicker |
87
-
| locale | string | no | 'en-US' | Filename of the locale to be used. PS: Feel free to submit PR's with more locales! |
88
-
| onBlur | function | no | () => {} | Callback fired when the input loses focus |
89
-
| onChange | function | no | () => {} | Callback fired when the value changes |
90
-
| pointing | string | no | 'left' | Location to render the component around input. Available options: 'left', 'right', 'top left', 'top right' |
91
-
| type | string | no | basic | Type of input to render. Available options: 'basic' and 'range' |
92
-
| datePickerOnly | boolean | no | false | Allows the date to be selected only via the date picker and disables the text input |
93
-
| value | Date\|Date[]| no | -- | The value of the datepicker |
| allowOnlyNumbers | boolean | no | true | Allows the user enter only numbers |
79
+
| autoComplete | string | no | -- | Specifies if the input should have autocomplete enabled |
80
+
| clearIcon | SemanticICONS \| React.ReactElement | no | 'close' | An [icon from semantic-ui-react](https://react.semantic-ui.com/elements/icon/) or a custom component. The custom component will get two props: `data-testid` and `onClick`. |
81
+
| clearOnSameDateClick | boolean | no | true | Controls whether the datepicker's state resets if the same date is selected in succession. |
82
+
| clearable | boolean | no | true | Allows the user to clear the value |
83
+
| datePickerOnly | boolean | no | false | Allows the date to be selected only via the date picker and disables the text input |
84
+
| filterDate | function | no | () => true | Function that receives each date and returns a boolean to indicate whether it is enabled or not |
85
+
| format | string | no | 'YYYY-MM-DD' | Specifies how the date will be formatted using the [date-fns' format](https://date-fns.org/v1.29.0/docs/format)|
86
+
| icon | SemanticICONS \| React.ReactElement | no | 'calendar' | An [icon from semantic-ui-react](https://react.semantic-ui.com/elements/icon/) or a custom component. The custom component will get two props: `data-testid` and `onClick`. |
87
+
| inline | boolean | no | false | Uses an inline variant, without the input and the features related to it, e.g. clearable datepicker |
88
+
| keepOpenOnClear | boolean | no | false | Keeps the datepicker open (or opens it if it's closed) when the clear icon is clicked |
89
+
| keepOpenOnSelect | boolean | no | false | Keeps the datepicker open when a date is selected |
90
+
| locale | string | no | 'en-US' | Filename of the locale to be used. PS: Feel free to submit PR's with more locales! |
91
+
| onBlur | function | no | () => {} | Callback fired when the input loses focus |
92
+
| onChange | function | no | () => {} | Callback fired when the value changes |
93
+
| pointing | string | no | 'left' | Location to render the component around input. Available options: 'left', 'right', 'top left', 'top right' |
94
+
| type | string | no | basic | Type of input to render. Available options: 'basic' and 'range' |
95
+
| value | Date\|Date[]| no | -- | The value of the datepicker |
0 commit comments