0.2.7 • Published 6 months ago

ns-vue-flatpickr v0.2.7

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

ns-vue-flatpickr

A Vue component wrapper for the NS Flatpickr date picker library. NS Flatpickr is a modified version of Flatpickr that allows for the usage of localized year values, such as the Buddhist year.

Installation

npm install ns-vue-flatpickr

Usage

<template>
  <div>
    <Flatpickr v-model="selectedDate" :options="flatpickrOptions"></Flatpickr>
  </div>
</template>

<script>
   import { defineComponent } from 'vue';
   import { Flatpickr } from 'ns-vue-flatpickr';

   export default defineComponent({
   components: {
      Flatpickr,
   },
   data() {
      return {
         selectedDate: null,
         flatpickrOptions: {
         // Configure Flatpickr options here
         },
      };
   },
   });
</script>

Wrap custom input

<Flatpickr v-model="selectedDate" wrap :options="{ clickOpens: false }">
   <input type="text" data-input />
   <button class="input-button" title="toggle" data-toggle>
      Open
   </button>
   <button class="input-button" title="clear" data-clear>
      Clear
   </button>
</Flatpickr>

Props

PropTypeDescription
optionsObjectConfiguration options for Flatpickr.
modelValueAnyThe selected date(s) value.
disabledBooleanDetermines if the date picker is disabled.
wrapBooleanSpecifies whether to wrap the date picker.
eventsArrayList of Flatpickr event hooks to bind to.

Events

EventDescription
inputTriggered when the selected date(s) change.
changeTriggered when the selected date(s) change.
blurTriggered when the date picker loses focus.
closeTriggered when the date picker closes.

For more details on the available options and events, please refer to the Flatpickr documentation.

License

This library is licensed under the MIT License. See the LICENSE file for more details.

0.2.7

6 months ago

0.2.6

6 months ago

0.2.5

6 months ago

0.2.4

12 months ago

0.2.3

12 months ago

0.2.2

12 months ago

0.2.1

12 months ago

0.2.0

12 months ago

0.1.0

12 months ago