vue2-timepicker
Advanced tools
Comparing version 0.2.0-beta.0 to 0.2.0-beta.2
{ | ||
"name": "vue2-timepicker", | ||
"version": "0.2.0-beta.0", | ||
"version": "0.2.0-beta.2", | ||
"description": "A dropdown time picker (hour|minute|second) for Vue 2.x, with flexible time format support", | ||
"scripts": { | ||
"build": "vue-cli-service build --target wc --name vue-timepicker 'src/components/VueTimepicker.vue'" | ||
"dev": "cd demo && yarn serve", | ||
"dev:init": "cd demo && yarn install", | ||
"build": "vue-cli-service build --target lib --name VueTimepicker ./src/index.js" | ||
}, | ||
"main": "dist/vue-timepicker.min.js", | ||
"main": "dist/VueTimepicker.common.js", | ||
"css": "dist/VueTimepicker.css", | ||
"repository": { | ||
@@ -22,5 +25,2 @@ "type": "git", | ||
], | ||
"dependencies": { | ||
"vue": "^2.6.10" | ||
}, | ||
"devDependencies": { | ||
@@ -34,4 +34,15 @@ "@vue/cli-plugin-babel": "^3.9.0", | ||
"eslint-plugin-vue": "^5.0.0", | ||
"vue": "^2.6.10", | ||
"vue-template-compiler": "^2.6.10" | ||
}, | ||
"peerDependencies": { | ||
"vue": "^2.6.5" | ||
}, | ||
"files": [ | ||
"dist/*", | ||
"src/*", | ||
"*.json", | ||
"*.js", | ||
"*.md" | ||
], | ||
"eslintConfig": { | ||
@@ -38,0 +49,0 @@ "root": true, |
110
README.md
@@ -5,4 +5,2 @@ # Vue2 Time Picker | ||
> Looking for the Vue 1.x version? Please check the [vue-timepicker](https://github.com/phoenixwong/vue-timepicker) *(Vue 1.x supported)* | ||
## Demo | ||
@@ -18,9 +16,13 @@ | ||
[Vue.js](http://vuejs.org/) v2.0+ | ||
[Vue.js](http://vuejs.org/) v2.6.5+ | ||
## Installation | ||
Through NPM **(Recommended)** | ||
Through YARN or NPM **(Recommended)** | ||
```bash | ||
yarn add vue2-timepicker | ||
``` | ||
```bash | ||
npm install vue2-timepicker --save | ||
@@ -39,32 +41,10 @@ ``` | ||
**A**: Include the single file component **(Recommended)** | ||
```javascript | ||
// import | ||
// JS | ||
import VueTimepicker from 'vue2-timepicker' | ||
// Or, require | ||
var VueTimepicker = require('vue2-timepicker') | ||
// CSS | ||
import 'vue2-timepicker/dist/VueTimepicker.css' | ||
``` | ||
or, **B**: Include distribution files with `<script>` and `<style>` | ||
```html | ||
<script src="yourpath/vue/dist/vue.min.js"></script> | ||
<script src="yourpath/vue2-timepicker/dist/vue2-timepicker.min.js"></script> | ||
<link href="yourpath/vue2-timepicker/dist/vue2-timepicker.min.css" rel="stylesheet"></link> | ||
``` | ||
**NOTE:** When using the `dist` files, a `Vue.use()` call is needed | ||
```javascript | ||
// Work with <script> block | ||
Vue.use(window.VueTimepicker) | ||
// Else | ||
Vue.use(VueTimepicker) | ||
``` | ||
**Step 2**: Include VueTimepicker in your component | ||
@@ -112,13 +92,13 @@ | ||
**AM/PM** | A | AM PM | ||
| a | am pm | ||
| a | am pm | ||
**Hour** | H | 0 1 ... 22 23 | ||
| HH | 00 01 ... 22 23 | ||
| h | 1 2 ... 11 12 | ||
| hh | 01 02 ... 11 12 | ||
| k | 1 2 ... 23 24 | ||
| kk | 01 02 ... 23 24 | ||
| HH | 00 01 ... 22 23 | ||
| h | 1 2 ... 11 12 | ||
| hh | 01 02 ... 11 12 | ||
| k | 1 2 ... 23 24 | ||
| kk | 01 02 ... 23 24 | ||
**Minute** | m | 0 1 ... 58 59 | ||
| mm | 00 01 ... 58 59 | ||
| mm | 00 01 ... 58 59 | ||
**Second** | s | 0 1 ... 58 59 | ||
| ss | 00 01 ... 58 59 | ||
| ss | 00 01 ... 58 59 | ||
@@ -252,11 +232,40 @@ > If not set, `format` string will be default to "HH:mm" | ||
### Define Hour Range | ||
Sometime you may want to limit hours picker to a specific range. The `hour-range` parameter is here to help. | ||
```html | ||
<vue-timepicker :hour-range="[5, [8, 12], [14, 17], 19]"></vue-timepicker> | ||
``` | ||
Valid (selectable) hours in this example are: 5, 8, 9, 10, 11, 12, 14, 15, 16, 17, 19 | ||
### Hide Disabled Hour Ranges | ||
```html | ||
<vue-timepicker :hour-range="[5, [8, 12], [14, 17], 19]" hide-disabled-hours></vue-timepicker> | ||
``` | ||
Paired with the above `hour-range` parameter. In this sample, the hour picker will hide the invalid hours (0, 1, 2, 3, 4, 6, 7, 13, 18, 20, 21, 22, 23) and display the valid hours (5, 8, 9, ...) only. | ||
### Disable Picker | ||
```html | ||
<vue-timepicker disabled></vue-timepicker> | ||
``` | ||
Used to disable dropdown picker and clear button in the UI. To prevent users from changing values again. | ||
## Props API | ||
Prop | Type | Required | Default Value | ||
--------------------- | --------- | -------- | ------------- | ||
**v-model** | _Object_ | no | _undefined_ | ||
**format** | _String_ | no | "HH:mm" | ||
**minute-interval** | _Number_ | no | _undefined_ | ||
**second-interval** | _Number_ | no | _undefined_ | ||
**hide-clear-button** | _Boolean_ | no | false | ||
Prop | Type | Required | Default Value | ||
----------------------- | --------- | -------- | ------------- | ||
**v-model** | _Object_ | no | _undefined_ | ||
**format** | _String_ | no | "HH:mm" | ||
**minute-interval** | _Number_ | no | _undefined_ | ||
**second-interval** | _Number_ | no | _undefined_ | ||
**hide-clear-button** | _Boolean_ | no | false | ||
**hour-range** | _Array_ | no | _undefined_ | ||
**hide-disabled-hours** | _Boolean_ | no | false | ||
**disabled** | _Boolean_ | no | false | ||
@@ -268,10 +277,13 @@ ## Contribution | ||
```bash | ||
# install dependencies | ||
npm install | ||
# Install dependencies | ||
yarn install | ||
# serve with hot reload at localhost:8080 | ||
npm run dev | ||
# Init development dependencies | ||
yarn dev:init | ||
# Start developing. Serve with hot reload at localhost:8080 | ||
yarn serve | ||
``` | ||
For detailed explanation on how things work, checkout the [webpack guide](http://vuejs-templates.github.io/webpack/) and [docs for vue-loader](http://vuejs.github.io/vue-loader). | ||
For detailed explanation on how things work, checkout the [Vue Cli Guide](https://cli.vuejs.org/guide/). | ||
@@ -278,0 +290,0 @@ ## Change Log |
import VueTimepicker from './components/VueTimepicker' | ||
module.exports = VueTimepicker | ||
export default VueTimepicker |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
596839
4810
291
0
1
9
16
- Removedvue@^2.6.10