npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@pencilpix/vue2-clock-picker

v0.1.6

Published

vuejs clock picker component

Downloads

1,558

Readme

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

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__labelvalue |String| initial value of input. default''required |Boolean| set it to true if time field is required. defaultfalsedisabled-from |String| value of time to disable from untildisabled-tovalue or to the end. defaultnull. disabled-to | String| value of time to disable fromdisabled-totime value or from 00:00 to, defaultnull. done-text | String| done button text, defaultdone. cancel-text | String| cancel button text, defaultcancel. active-color | String| active value bg color, header of dialog bg, center color and line color. Default:#a48bd1. active-text-color | String| active value color and actions color. default:white. color | String| regular text color. default:#757575. disabled-color | String| disabled actions and values color, default:#ddd. close-on-esc | Boolean| enable close onESCkey press, defaultfalse. close-on-overlay | Boolean| enable closing dialog on overlay click, defaultfalse. font | String | font family used in canvas, defaultRoboto, arial, san-serif`

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.