diff --git a/.babelrc b/.babelrc new file mode 100644 index 0000000..93f21d1 --- /dev/null +++ b/.babelrc @@ -0,0 +1,20 @@ +{ + "env": { + "test": { + "passPerPreset": true, + "presets": [ + { + "plugins": [ + "@babel/plugin-proposal-object-rest-spread" + ] + }, + { + "passPerPreset": false, + "presets": [ + "@babel/preset-env" + ] + } + ] + } + } +} diff --git a/.editorconfig b/.editorconfig new file mode 100644 index 0000000..c24743d --- /dev/null +++ b/.editorconfig @@ -0,0 +1,7 @@ +[*.{js,jsx,ts,tsx,vue}] +indent_style = space +indent_size = 2 +end_of_line = lf +trim_trailing_whitespace = true +insert_final_newline = true +max_line_length = 100 diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..234188d --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +PATH_add bin diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..e2192c5 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,5 @@ +/build/ +/config/ +/dist/ +/*.js +/test/unit/coverage/ diff --git a/.eslintrc.js b/.eslintrc.js new file mode 100644 index 0000000..de6c924 --- /dev/null +++ b/.eslintrc.js @@ -0,0 +1,41 @@ +// https://eslint.org/docs/user-guide/configuring + +module.exports = { + root: true, + env: { + 'node': true, + }, + extends: [ + 'plugin:vue/essential', + '@vue/airbnb', + ], + plugins: ['vue'], + parserOptions: { + parser: 'babel-eslint', + }, + // add your custom rules here + rules: { + // disallow reassignment of function parameters + // disallow parameter object manipulation except for specific exclusions + 'no-param-reassign': ['error', { + props: true, + ignorePropertyModificationsFor: [ + 'el', + ] + }], + 'no-console': [ + 'error', + { allow: ['warn', 'error'] }, + ], + // allow debugger during development + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-underscore-dangle': [ + 'error', + { + allow: [ + '__vueClickOutside__' + ] + } + ], + }, +} diff --git a/.github/ISSUE_TEMPLATE/01_bug_report.md b/.github/ISSUE_TEMPLATE/01_bug_report.md new file mode 100644 index 0000000..29f99ce --- /dev/null +++ b/.github/ISSUE_TEMPLATE/01_bug_report.md @@ -0,0 +1,30 @@ +--- +name: 🐛 Bug report +about: Create a bug report to help us improve. +--- + +## Current behavior + +A clear and concise description of what the issue is. + +## Expected behavior + +A clear and concise description of what you expected to happen. + +## Versions + +**Libraries:** + +- **taiger-design-system** version: [e.g. 1.0.0] +- **vue** version: [e.g. 2.#.#] + +**Environment:** + +- Device: [e.g. Mac or iPhone X] +- OS: [e.g. macOS Mojave or iOS 12] +- Browser: [e.g. Chrome] +- Browser Version: [e.g. 70] + +## Additional context + +Add any other context about the bug here. diff --git a/.github/ISSUE_TEMPLATE/02_feature_request.md b/.github/ISSUE_TEMPLATE/02_feature_request.md new file mode 100644 index 0000000..0d0e34e --- /dev/null +++ b/.github/ISSUE_TEMPLATE/02_feature_request.md @@ -0,0 +1,20 @@ +--- +name: 🚀 Feature request +about: Suggest an idea for this project. +--- + +### Is your feature request related to a problem? Please describe... + +A clear and concise description of what the problem is. + +### Describe the solution you'd like + +A clear and concise description of what you want to happen. + +### Describe alternatives you've considered + +A clear and concise description of any alternative solutions or features you've considered. + +### Additional context + +Add any other context or screenshots about the feature request here. diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..84051f3 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,23 @@ +name: Vue Tel Input Vuetify Release CI +on: + push: + branches: + - master +jobs: + release: + name: Release + runs-on: ubuntu-18.04 + steps: + - name: Checkout + uses: actions/checkout@v1 + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 12 + - name: Install dependencies + run: npm ci + - name: Release + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NPM_TOKEN: ${{ secrets.NPM_TOKEN }} + run: npx semantic-release diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2aba162 --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +.DS_Store +node_modules/ +npm-debug.log +yarn-error.log +.idea/ diff --git a/.lintstagedrc.json b/.lintstagedrc.json new file mode 100644 index 0000000..b733c56 --- /dev/null +++ b/.lintstagedrc.json @@ -0,0 +1,6 @@ +{ + "*.{js,vue}": [ + "eslint --quiet --fix", + "git add" + ] +} diff --git a/.releaserc.js b/.releaserc.js new file mode 100644 index 0000000..4e8a6f5 --- /dev/null +++ b/.releaserc.js @@ -0,0 +1,27 @@ +module.exports = { + plugins: [ + "@semantic-release/commit-analyzer", + "@semantic-release/release-notes-generator", + [ + "@semantic-release/changelog", + { + changelogFile: "CHANGELOG.md", + }, + ], + [ + "@semantic-release/npm", + { + npmPublish: false, + }, + ], + [ + "@semantic-release/git", + { + assets: ["package.json", "package-lock.json", "CHANGELOG.md"], + message: "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}", + }, + ], + "@semantic-release/github", + ], + branches: ["master"], +} diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..a837d26 --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,45 @@ +{ + "cSpell.words": [ + "dropdown", + "gmail", + "iamstevendao", + "keydown", + "keyup", + "maxlength", + "mousemove", + "nbsp", + "rgba", + "tabindex", + "typeof" + ], + "editor.formatOnSave": false, + "javascript.format.enable": false, + "eslint.autoFixOnSave": true, + "eslint.alwaysShowStatus": true, + "eslint.options": { + "extensions": [ + ".html", + ".js", + ".vue", + ".jsx" + ] + }, + "eslint.validate": [ + { + "language": "html", + "autoFix": true + }, + { + "language": "vue", + "autoFix": true + }, + { + "language": "javascript", + "autoFix": true + }, + { + "language": "javascriptreact", + "autoFix": true + } + ] +} diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..e69de29 diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0d184cf --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2018 EducationLink + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..305dbea --- /dev/null +++ b/README.md @@ -0,0 +1,225 @@ +# vue-tel-input +International Telephone Input with Vue. + +[![](https://img.shields.io/npm/dt/vue-tel-input.svg)](https://www.npmjs.com/package/vue-tel-input) [![](https://img.shields.io/github/stars/educationlink/vue-tel-input.svg)](https://github.com/EducationLink/vue-tel-input) + +

+In-action GIF +

+ +**Useful Links** + +- [Live Demo](https://educationlink.github.io/vue-tel-input/) +- [Changelog](https://github.com/EducationLink/vue-tel-input/releases) +- [Documentation for `v2.x.x`](https://github.com/EducationLink/vue-tel-input/blob/master/README-v2.md) + +**Table of Contents** + +- [Getting started](#getting-started) +- [Installation](#installation) + - [npm](#npm) + - [Browser](#browser) + - [Use as a custom field of `vue-form-generator`](#use-as-a-custom-field-of-vue-form-generator) +- [Usage](#usage) + - [Props](#props) + - [Events](#events) + - [Slots](#slots) +- [Typescript Support](#typescript-support) +- [Credits & Contributors](#credits-&-contributors) + +## Getting started +- Install the plugin: + + ``` + npm install vue-tel-input + ``` + +- Add the plugin into your app: + + ```javascript + import Vue from 'vue' + import VueTelInput from 'vue-tel-input' + + Vue.use(VueTelInput) + ``` + + [More info on installation](#installation) + +- Use the `vue-tel-input` component: + + ```html +