Socket
Socket
Sign inDemoInstall

@pencilpix/vue2-clock-picker

Package Overview
Dependencies
0
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @pencilpix/vue2-clock-picker

vuejs clock picker component


Version published
Weekly downloads
316
increased by4.29%
Maintainers
1
Install size
461 kB
Created
Weekly downloads
 

Readme

Source

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:

    1. via plugin
    <link href="node_modules/@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.min.css"/>
    
    
    <script src="node_modules/vuejs/dist/vue.min.js"></script>
    <!-- plugin will register the component globally in the global vue instance -->
    <script src="node_modules/@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.plugin.js"></script>
    
    
    <!-- if for any reason need to install the plugin manually -->
    <script>
    Vue.use(VueClockPickerPlugin) // since the plugin is globally available
    </script>
    
    1. via per component
    <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.js"></script>
    <script>
      const app = new Vue({
        // ...
        components: {
          VueClockPicker, //  bundle makes the component globally available for registering
        },
        // ...
      });
    </script>
    
  • Module:

    1. per component
    import VueClockPicker from '@pencilpix/vue2-clock-picker';
    import '@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.min.css';
    
    export default {
      // ...
      components: {
        VueClockPicker,
      }
      // ...
    }
    
    
    1. global plugin
    import '@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.min.css';
    const VueClockPickerPlugin = require('@pencilpix/vue2-clock-picker/dist/vue2-clock-picker.plugin.js')
    Vue.use(VueClockPickerPlugin)
    

Usage

once component is installed it can be used as:

<vue-clock-picker v-model="value"></vue-clock-picker>
props
proptypedefault
idStringinput id and label for value. default is randomly unique like: clock_picker_input_jj17bvjklhwhxvm
placeholderStringinput placeholder default ''
nameStringinput name default ''
labelStringlabel text will be hidden if not set. default ''
input-classStringcss custom class to be applied to input. default clock-picker__input.
input-container-classStringcss custom class to be applied to input container. default clock-picker__input-container.
input-value-classStringcss custom class to be applied to input container when input contains value. default clock-picker__input--has-value.
input-focus-classStringcss custom class to be applied to input container when the input is focused. default clock-picker__input--focused.
input-error-classStringcss 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`Stringcustom class name of label. default: clock-picker__label
valueStringinitial value of input. default ''
requiredBooleanset it to true if time field is required. default false
disabled-fromStringvalue of time to disable from until disabled-to value or to the end. default null.
disabled-toStringvalue of time to disable from disabled-to time value or from 00:00 to, default null.
done-textStringdone button text, default done.
cancel-textStringcancel button text, default cancel.
active-colorStringactive value bg color, header of dialog bg, center color and line color. Default: #a48bd1.
active-text-colorStringactive value color and actions color. default: white.
colorStringregular text color. default: #757575.
disabled-colorStringdisabled actions and values color, default: #ddd.
close-on-escBooleanenable close on ESC key press, default false.
close-on-overlayBooleanenable closing dialog on overlay click, default false.
fontStringfont family used in canvas, default Roboto, arial, san-serif
events
eventwhen
beforeOpenjust before opening the dialog.
openjust after opening the dialog.
beforeClosejust before closing the dialog.
closejust after closing the dialog.
timesetafter the value of input is set. and it will recieve the value as 01:02
cancelwhen cancel dialog button is clicked and it will receive the value found at cancel time.
methods
methodbehavior
openopen the dialog
closeclose the dialog
getValuereturn the current value of the input as 02:00
setValueset the current value of input and it accept String with valid time HH:MM
validatecheck for errors. it can be used just before submit the form.

Keywords

FAQs

Last updated on 22 Dec 2018

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc