Git Product home page Git Product logo

vue2-clock-picker's Introduction

Vue2 Clock Picker

A simple clock picker component for vue v2.x.

Screenshot Screenshot2

Installation

$ npm install @pencilpix/vue2-clock-picker --save

or

$ yarn add @pencilpix/vue2-clock-picker
  • In Browser:

    <link href="node_modules/@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.min.css"/>
    
    
    <script src="node_modules/vuejs/dist/vue.min.js"></script>
    <script src="node_modules/@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.min.js">
  • Module:

    import VueClockPicker from '@pencilpix/vue2-clock-picker';
    import '@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.min.css';

Usage

once component is installed it can be used as:

<vue-clock-picker></vue-clock-picker>

props

prop type default
id String input id and label for value. default is randomly unique like: clock_picker_input_jj17bvjklhwhxvm
placeholder String input placeholder default ''
name String input name default ''
label String label text will be hidden if not set. default ''
input-class String css custom class to be applied to input. default clock-picker__input.
input-container-class String css custom class to be applied to input container. default clock-picker__input-container.
input-value-class String css custom class to be applied to input container when input contains value. default clock-picker__input--has-value.
input-focus-class String css custom class to be applied to input container when the input is focused. default clock-picker__input--focused.
input-error-class String css custom class to be applied to input container when the value not match HH:MM or the input is required and the value is empty. default clock-picker__input--error.
label-class `String custom class name of label. default: clock-picker__label
value String initial value of input. default ''
required Boolean set it to true if time field is required. default false
disabled-from String value of time to disable from until disabled-to value or to the end. default null.
disabled-to String value of time to disable from disabled-to time value or from 00:00 to, default null.
done-text String done button text, default done
cancel-text String cancel button text, default cancel

events

event when
beforeOpen just before opening the dialog.
open just after opening the dialog.
beforeClose just before closing the dialog.
close just after closing the dialog.
timeset after the value of input is set. and it will recieve the value as 01:02
cancel when cancel dialog button is clicked and it will receive the value found at cancel time.

methods

method behavior
open open the dialog
close close the dialog
getValue return the current value of the input as 02:00
setValue set the current value of input and it accept String with valid time HH:MM
validate check for errors. it can be used just before submit the form.

vue2-clock-picker's People

Contributors

pencilpix avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.