Skip to content

Commit

Permalink
6.0.1
Browse files Browse the repository at this point in the history
  • Loading branch information
rawilk committed Nov 11, 2021
1 parent e6a94d2 commit 957cae9
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

All notable changes to `laravel-form-components` will be documented in this file

## 6.0.1 - 2021-11-11
### Updated
- Add support for `x-model` on inputs
- Add `onOpen` slot to date picker component

## 6.0.0 - 2021-09-20
### Added
- Register all components under a the `form-components::` namespace
Expand Down
17 changes: 15 additions & 2 deletions docs/inputs/date-picker.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,16 +118,29 @@ specify any option callbacks you need to:
```html
<x-date-picker name="birthday">
<x-slot name="optionsSlot">
onOpen: (selectedDates, dateStr, instance) => {
onChange: (selectedDates, dateStr, instance) => {
// ...
}
</x-slot>
</x-date-picker>
```

In the example above, we are injecting a callback for the `onOpen` event fired by flatpickr into the flatpickr options object.
In the example above, we are injecting a callback for the `onChange` event fired by flatpickr into the flatpickr options object.
For more information on the callbacks available, please consult [the events api](https://flatpickr.js.org/events/).

By default, the date picker component defines a callback for the `onOpen` event fired by flatpickr. As of version `6.0.1`, you may utilize
the `onOpen` slot to add your own callback function if needed on the component.

```html
<x-date-picker name="birthday">
<x-slot name="onOpen">
function (selectedDates, dateStr, instance) {
// do something
},
</x-slot>
</x-date-picker>
```

## Addons

Like the other inputs, the date picker can also have leading and trailing addons, however by default you cannot add them.
Expand Down

0 comments on commit 957cae9

Please sign in to comment.