Skip to content

Commit

Permalink
Housekeeping
Browse files Browse the repository at this point in the history
  • Loading branch information
ankurk91 committed Apr 25, 2021
1 parent d4332d0 commit 663b6af
Show file tree
Hide file tree
Showing 5 changed files with 193 additions and 192 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ on:
- master
- dev
schedule:
- cron: '0 0 1 * *'
- cron: '0 0 10 * *'

jobs:
build:

runs-on: ubuntu-latest
timeout-minutes: 5

strategy:
matrix:
Expand Down
13 changes: 11 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,35 +1,44 @@
# Changelog

## [3.0.0](https://github.com/ankurk91/vue-cleave-component/compare/2.1.2...3.0.0)

* Drop support for Vue v2.x and add support for Vue v3.x
* Drop IE 11 support

## [2.1.3](https://github.com/ankurk91/vue-cleave-component/compare/2.1.2...2.1.3)

* Fix: `input` event was being emitted on load, [#25](https://github.com/ankurk91/vue-cleave-component/issues/25)

## [2.1.2](https://github.com/ankurk91/vue-cleave-component/compare/2.1.1...2.1.2)
* Change:

* Change:
- removed `type` prop, however this should work as before
- convert template to render function to reduce build size

## [2.1.1](https://github.com/ankurk91/vue-cleave-component/compare/2.1.0...2.1.1)

* Fix: `blur` event implementation, [#13](https://github.com/ankurk91/vue-cleave-component/issues/13)

## [2.1.0](https://github.com/ankurk91/vue-cleave-component/compare/2.0.1...2.1.0)

* Add: `blur` event, [#12](https://github.com/ankurk91/vue-cleave-component/issues/12)
- If you were using `@blur.native` previously then replace it with `@blur`
* Chore: webpack v4

## [2.0.1](https://github.com/ankurk91/vue-cleave-component/compare/2.0.0...2.0.1)

* Fix: preserve original `onValueChanged` callback

## [2.0.0](https://github.com/ankurk91/vue-cleave-component/compare/1.0.3...2.0.0)

* Fix: CTRL+X (cut event) was not updating v-model, [#3](https://github.com/ankurk91/vue-cleave-component/issues/3)
* Change: Minimum `cleave.js` version requirement is v1.3.1
* Change: Now using `onValueChanged` callback to detect changes in value

## [1.0.3](https://github.com/ankurk91/vue-cleave-component/compare/1.0.2...1.0.3)

* Fix: Cursor jump issues

## 1.0.0

* Initial release
81 changes: 48 additions & 33 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
# Vue Cleave Component

[![downloads](https://badgen.net/npm/dt/vue-cleave-component)](http://npm-stats.com/~packages/vue-cleave-component)
[![downloads](https://badgen.net/npm/dt/vue-cleave-component)](https://npm-stat.com/charts.html?package=vue-cleave-component&from=2018-01-01)
[![npm-version](https://badgen.net/npm/v/vue-cleave-component)](https://www.npmjs.com/package/vue-cleave-component)
[![github-tag](https://badgen.net/github/tag/ankurk91/vue-cleave-component)](https://github.com/ankurk91/vue-cleave-component/)
[![license](https://badgen.net/github/license/ankurk91/vue-cleave-component)](https://yarnpkg.com/en/package/vue-cleave-component)
[![build](https://github.com/ankurk91/vue-cleave-component/workflows/build/badge.svg)](https://github.com/ankurk91/vue-cleave-component/actions)
[![codecov](https://codecov.io/gh/ankurk91/vue-cleave-component/branch/master/graph/badge.svg)](https://codecov.io/gh/ankurk91/vue-cleave-component)

Vue.js component for [Cleave.js](http://nosir.github.io/cleave.js/)
Vue.js component for [Cleave.js](http://nosir.github.io/cleave.js/)

## Demo on [JSFiddle](https://jsfiddle.net/ankurk91/aza302c7/)

Expand All @@ -19,16 +19,18 @@ Vue.js component for [Cleave.js](http://nosir.github.io/cleave.js/)
| 3.x | 3.x | master |

## Features

* Reactive `v-model` value
- You can change input value programmatically
- You can change input value programmatically
* Reactive [options](https://github.com/nosir/cleave.js/blob/master/doc/options.md)
- You can change config options dynamically
- Component will watch for any changes and redraw itself
* Compatible with [Bootstrap](http://getbootstrap.com/), [Bulma](http://bulma.io/) or any other CSS framework
* Works with validation libraries
* Option to disable `raw` mode to get masked value
* Option to disable `raw` mode to get masked value

## Installation

```bash
# yarn
yarn add vue-cleave-component
Expand All @@ -38,46 +40,52 @@ npm install vue-cleave-component --save
```

## Usage

```html

<template>
<div>
<cleave v-model="cardNumber"
:options="options"
class="form-control"
name="card"/>
</div>
<div>
<cleave v-model="cardNumber"
:options="options"
class="form-control"
name="card"/>
</div>
</template>

<script>
import Cleave from 'vue-cleave-component';
export default {
data () {
return {
cardNumber: null,
options: {
creditCard: true,
delimiter: '-',
}
}
},
components: {
Cleave
import Cleave from 'vue-cleave-component';
export default {
data() {
return {
cardNumber: null,
options: {
creditCard: true,
delimiter: '-',
}
}
},
components: {
Cleave
}
}
}
</script>
```

### As plugin

```js
import {createApp} from 'vue';
import Cleave from 'vue-cleave-component';
const app = createApp().mount('#app')
app.use(Cleave);
import Cleave from 'vue-cleave-component';
// your app initilization logic goes here
const app = createApp({}).mount('#app')
app.use(Cleave);
```
This will register a global component `<cleave>`

This will register a global component `<cleave>`

## Available props

The component accepts these props:

| Attribute | Type | Default | Description |
Expand All @@ -87,7 +95,9 @@ The component accepts these props:
| raw | Boolean | `true` | When set to `false`; emits formatted value with format pattern and delimiter |

## Install in non-module environments (without webpack)

* Include required files

```html
<!-- cleave.js -->
<script src="https://cdn.jsdelivr.net/npm/cleave.js@1"></script>
Expand All @@ -96,25 +106,30 @@ The component accepts these props:
<!-- Lastly add this package -->
<script src="https://cdn.jsdelivr.net/npm/vue-cleave-component@3"></script>
<script>
// Init as global component
yourApp.use(VueCleave);
// Init as global component
app.use(VueCleave);
</script>
```

## Run examples on your localhost

* Clone this repo
* You should have node-js `>=10.13` and yarn `>=1.x` pre-installed
* You should have node-js `>=12.13` and yarn `>=1.22` pre-installed
* Install dependencies `yarn install`
* Run webpack dev server `yarn start`
* This should open the demo page at ``http://localhost:9000`` in your default web browser

### Testing
* This package is using [Jest](https://github.com/facebook/jest) and [vue-test-utils](https://github.com/vuejs/vue-test-utils-next) for testing.

* This package is using [Jest](https://github.com/facebook/jest)
and [vue-test-utils](https://github.com/vuejs/vue-test-utils-next) for testing.
* Tests can be found in `__test__` folder
* Execute tests with this command `yarn test`

## Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## License

[MIT](LICENSE.txt) License
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"@babel/core": "^7.12.10",
"@babel/preset-env": "^7.12.11",
"@vue/compiler-sfc": "^3.0.5",
"@vue/test-utils": "^2.0.0-beta.14",
"@vue/test-utils": "^2.0.0-rc.6",
"babel-jest": "^26.6.3",
"babel-loader": "^8.2.2",
"bootstrap": "^4.5.3",
Expand All @@ -54,7 +54,7 @@
"jest": "^26.6.3",
"style-loader": "^2.0.0",
"vue": "^3.0",
"vue-loader": "^16",
"vue-loader": "^16.0",
"webpack": "^5.12.3",
"webpack-cli": "^4.3.1",
"webpack-dev-server": "^4.0.0-beta.0"
Expand All @@ -63,7 +63,7 @@
"vue": "^3.0.0"
},
"engines": {
"node": ">= 10.13.0"
"node": ">=10.13.0"
},
"jest": {
"moduleFileExtensions": [
Expand Down
Loading

0 comments on commit 663b6af

Please sign in to comment.