adrienpoly / stimulus-flatpickr

A modest, yet powerful wrapper of Flatpickr 📆 for Stimulus
MIT License
415 stars 30 forks source link

Support Stimulus 2.0 Values API #69

Open noahfpf opened 3 years ago

noahfpf commented 3 years ago

Support for Stimulus 2.0's Values API would be useful, so that flatpickr options could be provided as attributes like data-flatpickr-the-option-value (in addition to deprecated support for data-flatpickr-the-option).

I think that support would be straight-forward and I could likely provide a PR.

(And thanks for providing this helpful and clean library!)

adrienpoly commented 3 years ago

yes this is definitely on my roadmap to support the value API. And some overalls clean up of this library, but I was quite busy with Stimulus Use recently.

Also initially I wanted to wait for this PR to be merged as I think it could simplify the implementation. But it is not mandatory to wait for that.

A PR would be very welcome and could be a starting point for a v2.0 of this package.

noahfpf commented 3 years ago

A PR would be very welcome and could be a starting point for a v2.0 of this package.

Do you want it to be backwards compatible with v1.0 this.data support, or to only support the new *-value attribute names? Either seems reasonable, with the latter an option if you're planning on a breaking 2.0 release.