diff --git a/.codeclimate.yml b/.codeclimate.yml deleted file mode 100644 index 14313fc..0000000 --- a/.codeclimate.yml +++ /dev/null @@ -1,25 +0,0 @@ ---- -engines: - csslint: - enabled: true - duplication: - enabled: true - config: - languages: - - ruby - - javascript - - python - - php - eslint: - enabled: true - fixme: - enabled: true -ratings: - paths: - - "src/components/Select.vue" -exclude_paths: -- dist/ -- test/ -- docs/ -- config/ -- build/ diff --git a/.csslintrc b/.csslintrc deleted file mode 100644 index aacba95..0000000 --- a/.csslintrc +++ /dev/null @@ -1,2 +0,0 @@ ---exclude-exts=.min.css ---ignore=adjoining-classes,box-model,ids,order-alphabetical,unqualified-attributes diff --git a/.eslintignore b/.eslintignore deleted file mode 100644 index 96212a3..0000000 --- a/.eslintignore +++ /dev/null @@ -1 +0,0 @@ -**/*{.,-}min.js diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 7f2ceaf..0000000 --- a/.eslintrc +++ /dev/null @@ -1,185 +0,0 @@ -{ - "plugins": [ - "html" - ], - - "env": { - "browser": true, - "node": true - }, - - "ecmaFeatures": { - "arrowFunctions": true, - "destructuring": true, - "classes": true, - "defaultParams": true, - "blockBindings": true, - "modules": true, - "objectLiteralComputedProperties": true, - "objectLiteralShorthandMethods": true, - "objectLiteralShorthandProperties": true, - "restParams": true, - "spread": true, - "forOf": true, - "generators": true, - "templateStrings": true, - "superInFunctions": true, - "experimentalObjectRestSpread": true - }, - - "rules": { - "accessor-pairs": 2, - "array-bracket-spacing": 0, - "block-scoped-var": 0, - "brace-style": [2, "1tbs", { "allowSingleLine": true }], - "camelcase": 0, - "comma-dangle": [2, "never"], - "comma-spacing": [2, { "before": false, "after": true }], - "comma-style": [2, "last"], - "complexity": 0, - "computed-property-spacing": 0, - "consistent-return": 0, - "consistent-this": 0, - "constructor-super": 2, - "curly": [2, "multi-line"], - "default-case": 0, - "dot-location": [2, "property"], - "dot-notation": 0, - "eol-last": 2, - "eqeqeq": [2, "allow-null"], - "func-names": 0, - "func-style": 0, - "generator-star-spacing": [2, { "before": true, "after": true }], - "guard-for-in": 0, - "handle-callback-err": [2, "^(err|error)$" ], - "indent": [2, 2, { "SwitchCase": 1 }], - "key-spacing": [2, { "beforeColon": false, "afterColon": true }], - "linebreak-style": 0, - "lines-around-comment": 0, - "max-nested-callbacks": 0, - "new-cap": [2, { "newIsCap": true, "capIsNew": false }], - "new-parens": 2, - "newline-after-var": 0, - "no-alert": 0, - "no-array-constructor": 2, - "no-caller": 2, - "no-catch-shadow": 0, - "no-cond-assign": 2, - "no-console": 0, - "no-constant-condition": 0, - "no-continue": 0, - "no-control-regex": 2, - "no-debugger": 2, - "no-delete-var": 2, - "no-div-regex": 0, - "no-dupe-args": 2, - "no-dupe-keys": 2, - "no-duplicate-case": 2, - "no-else-return": 0, - "no-empty": 0, - "no-empty-character-class": 2, - "no-empty-label": 2, - "no-eq-null": 0, - "no-eval": 2, - "no-ex-assign": 2, - "no-extend-native": 2, - "no-extra-bind": 2, - "no-extra-boolean-cast": 2, - "no-extra-parens": 0, - "no-extra-semi": 0, - "no-fallthrough": 2, - "no-floating-decimal": 2, - "no-func-assign": 2, - "no-implied-eval": 2, - "no-inline-comments": 0, - "no-inner-declarations": [2, "functions"], - "no-invalid-regexp": 2, - "no-irregular-whitespace": 2, - "no-iterator": 2, - "no-label-var": 2, - "no-labels": 2, - "no-lone-blocks": 2, - "no-lonely-if": 0, - "no-loop-func": 0, - "no-mixed-requires": 0, - "no-mixed-spaces-and-tabs": 2, - "no-multi-spaces": 2, - "no-multi-str": 2, - "no-multiple-empty-lines": [2, { "max": 1 }], - "no-native-reassign": 2, - "no-negated-in-lhs": 2, - "no-nested-ternary": 0, - "no-new": 2, - "no-new-func": 0, - "no-new-object": 2, - "no-new-require": 2, - "no-new-wrappers": 2, - "no-obj-calls": 2, - "no-octal": 2, - "no-octal-escape": 2, - "no-param-reassign": 0, - "no-path-concat": 0, - "no-process-env": 0, - "no-process-exit": 0, - "no-proto": 0, - "no-redeclare": 2, - "no-regex-spaces": 2, - "no-restricted-modules": 0, - "no-return-assign": 2, - "no-script-url": 0, - "no-self-compare": 2, - "no-sequences": 2, - "no-shadow": 0, - "no-shadow-restricted-names": 2, - "no-spaced-func": 2, - "no-sparse-arrays": 2, - "no-sync": 0, - "no-ternary": 0, - "no-this-before-super": 2, - "no-throw-literal": 2, - "no-trailing-spaces": 2, - "no-undef": 2, - "no-undef-init": 2, - "no-undefined": 0, - "no-underscore-dangle": 0, - "no-unexpected-multiline": 2, - "no-unneeded-ternary": 2, - "no-unreachable": 2, - "no-unused-expressions": 0, - "no-unused-vars": [2, { "vars": "all", "args": "none" }], - "no-use-before-define": 0, - "no-var": 0, - "no-void": 0, - "no-warning-comments": 0, - "no-with": 2, - "object-curly-spacing": 0, - "object-shorthand": 0, - "one-var": [2, { "initialized": "never" }], - "operator-assignment": 0, - "operator-linebreak": [2, "after", { "overrides": { "?": "before", ":": "before" } }], - "padded-blocks": 0, - "prefer-const": 0, - "quote-props": 0, - "quotes": [2, "single", "avoid-escape"], - "radix": 2, - "semi": [2, "never"], - "semi-spacing": 0, - "sort-vars": 0, - "space-after-keywords": [2, "always"], - "space-before-blocks": [2, "always"], - "space-before-function-paren": [2, "always"], - "space-in-parens": [2, "never"], - "space-infix-ops": 2, - "space-return-throw-case": 2, - "space-unary-ops": [2, { "words": true, "nonwords": false }], - "spaced-comment": [2, "always", { "markers": ["global", "globals", "eslint", "eslint-disable", "*package", "!"] }], - "strict": 0, - "use-isnan": 2, - "valid-jsdoc": 0, - "valid-typeof": 2, - "vars-on-top": 0, - "wrap-iife": [2, "any"], - "wrap-regex": 0, - "yoda": [2, "never"] - } -} diff --git a/.gitignore b/.gitignore index 7b7b04e..17372d9 100644 --- a/.gitignore +++ b/.gitignore @@ -1,14 +1,28 @@ .DS_Store node_modules -npm-debug.log + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files .idea -test/unit/coverage -.coveralls.yml -.flowconfig -package-lock.json -docs/gitbook/_book -docs/node_modules -site -_book -dist +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw* + +# Project specific coverage +dist +test/unit/coverage +package-lock.json +dev/dist +docs/.vuepress/dist diff --git a/.travis.yml b/.travis.yml index 7621ea0..1a95030 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: node_js node_js: - node -after_success: - - codeclimate-test-reporter < ./test/unit/coverage/lcov.info +script: + - yarn test | coveralls diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a8e6d01..e705d1f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,9 +1,9 @@ ## Pull Requests -Looks like you want to help out on vue-select.. awesome! Here's a couple things to keep in mind when contributing. +Looks like you want to help out on vue-select.. awesome! Here's a few things to keep in mind when contributing. 1. If your PR contains multiple commits, try to keep those commits succinct, with descriptive messages. This makes it easier to understand your thought process. -2. Don't run the build before submitting. The build is only run and committed immediately before a new release, and submitting a PR with a build included is just more to parse. +2. **Don't run the build** before submitting. The build is only run and committed immediately before a new release. 3. If your PR fixes or references an open issue, be sure to reference it in your message. 4. If you're adding new functionality, make sure your code has good test coverage. diff --git a/README.md b/README.md index 6f06a9a..72e9884 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# vue-select [![Build Status](https://travis-ci.org/sagalbot/vue-select.svg?branch=master)](https://travis-ci.org/sagalbot/vue-select) ![MIT License](https://img.shields.io/github/license/sagalbot/vue-select.svg?style=flat-square) ![Current Release](https://img.shields.io/github/release/sagalbot/vue-select.svg?style=flat-square) +# vue-select [![Build Status](https://travis-ci.org/sagalbot/vue-select.svg?branch=master)](https://travis-ci.org/sagalbot/vue-select) [![Coverage Status](https://coveralls.io/repos/github/sagalbot/vue-select/badge.svg)](https://coveralls.io/github/sagalbot/vue-select) ![MIT License](https://img.shields.io/github/license/sagalbot/vue-select.svg?style=flat-square) ![Current Release](https://img.shields.io/github/release/sagalbot/vue-select.svg?style=flat-square) > A native Vue.js select component that provides similar functionality to Select2 without the overhead of jQuery. diff --git a/book.json b/book.json deleted file mode 100644 index 113745f..0000000 --- a/book.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "title": "vue-select", - "gitbook": ">3.0.0", - "root": "./docs/gitbook", - "plugins": ["edit-link", "-fontsettings", "codepen", "include-csv"], - "pluginsConfig": { - "edit-link": { - "base": "https://github.com/sagalbot/vue-select/edit/gitbook/docs/gitbook", - "label": "Edit This Page" - }, - "github": { - "url": "https://github.com/sagalbot/vue-select/" - }, - "codepen": { - "theme": 32252 - } - }, - "links": { - "sharing": { - "facebook": false, - "twitter": false - } - } -} diff --git a/build/build-docs.js b/build/build-docs.js deleted file mode 100644 index 7c3cc28..0000000 --- a/build/build-docs.js +++ /dev/null @@ -1,9 +0,0 @@ -// https://github.com/shelljs/shelljs -const shell = require('shelljs'); - -shell.exec('gitbook build', (code, stdout, stderr) => { - if( code === 0 ) { - shell.rm('-rf', 'site/docs'); - shell.exec('mv _book site/docs') - } -}); \ No newline at end of file diff --git a/dev/Dev.vue b/dev/Dev.vue new file mode 100644 index 0000000..8db82ff --- /dev/null +++ b/dev/Dev.vue @@ -0,0 +1,130 @@ + + + + + diff --git a/dev/data/books.js b/dev/data/books.js index bd4606c..bc00994 100644 --- a/dev/data/books.js +++ b/dev/data/books.js @@ -1,3 +1,4 @@ +/* eslint-disable */ export default [ { title: "Old Man's War", @@ -160,4 +161,4 @@ export default [ lastName: "Maine" } } -] \ No newline at end of file +] diff --git a/dev/data/countries.js b/dev/data/countries.js index d9f12a1..cec5f3e 100644 --- a/dev/data/countries.js +++ b/dev/data/countries.js @@ -1 +1,246 @@ -export default ["Afghanistan", "Åland Islands", "Albania", "Algeria", "American Samoa", "Andorra", "Angola", "Anguilla", "Antarctica", "Antigua and Barbuda", "Argentina", "Armenia", "Aruba", "Australia", "Austria", "Azerbaijan", "Bahamas", "Bahrain", "Bangladesh", "Barbados", "Belarus", "Belgium", "Belize", "Benin", "Bermuda", "Bhutan", "Bolivia", "Bosnia and Herzegovina", "Botswana", "Bouvet Island", "Brazil", "British Indian Ocean Territory", "Brunei Darussalam", "Bulgaria", "Burkina Faso", "Burundi", "Cambodia", "Cameroon", "Canada", "Cape Verde", "Cayman Islands", "Central African Republic", "Chad", "Chile", "China", "Christmas Island", "Cocos (Keeling) Islands", "Colombia", "Comoros", "Congo", "Congo, The Democratic Republic of The", "Cook Islands", "Costa Rica", "Cote D'ivoire", "Croatia", "Cuba", "Cyprus", "Czech Republic", "Denmark", "Djibouti", "Dominica", "Dominican Republic", "Ecuador", "Egypt", "El Salvador", "Equatorial Guinea", "Eritrea", "Estonia", "Ethiopia", "Falkland Islands (Malvinas)", "Faroe Islands", "Fiji", "Finland", "France", "French Guiana", "French Polynesia", "French Southern Territories", "Gabon", "Gambia", "Georgia", "Germany", "Ghana", "Gibraltar", "Greece", "Greenland", "Grenada", "Guadeloupe", "Guam", "Guatemala", "Guernsey", "Guinea", "Guinea-bissau", "Guyana", "Haiti", "Heard Island and Mcdonald Islands", "Holy See (Vatican City State)", "Honduras", "Hong Kong", "Hungary", "Iceland", "India", "Indonesia", "Iran, Islamic Republic of", "Iraq", "Ireland", "Isle of Man", "Israel", "Italy", "Jamaica", "Japan", "Jersey", "Jordan", "Kazakhstan", "Kenya", "Kiribati", "Korea, Democratic People's Republic of", "Korea, Republic of", "Kuwait", "Kyrgyzstan", "Lao People's Democratic Republic", "Latvia", "Lebanon", "Lesotho", "Liberia", "Libyan Arab Jamahiriya", "Liechtenstein", "Lithuania", "Luxembourg", "Macao", "Macedonia, The Former Yugoslav Republic of", "Madagascar", "Malawi", "Malaysia", "Maldives", "Mali", "Malta", "Marshall Islands", "Martinique", "Mauritania", "Mauritius", "Mayotte", "Mexico", "Micronesia, Federated States of", "Moldova, Republic of", "Monaco", "Mongolia", "Montenegro", "Montserrat", "Morocco", "Mozambique", "Myanmar", "Namibia", "Nauru", "Nepal", "Netherlands", "Netherlands Antilles", "New Caledonia", "New Zealand", "Nicaragua", "Niger", "Nigeria", "Niue", "Norfolk Island", "Northern Mariana Islands", "Norway", "Oman", "Pakistan", "Palau", "Palestinian Territory, Occupied", "Panama", "Papua New Guinea", "Paraguay", "Peru", "Philippines", "Pitcairn", "Poland", "Portugal", "Puerto Rico", "Qatar", "Reunion", "Romania", "Russian Federation", "Rwanda", "Saint Helena", "Saint Kitts and Nevis", "Saint Lucia", "Saint Pierre and Miquelon", "Saint Vincent and The Grenadines", "Samoa", "San Marino", "Sao Tome and Principe", "Saudi Arabia", "Senegal", "Serbia", "Seychelles", "Sierra Leone", "Singapore", "Slovakia", "Slovenia", "Solomon Islands", "Somalia", "South Africa", "South Georgia and The South Sandwich Islands", "Spain", "Sri Lanka", "Sudan", "Suriname", "Svalbard and Jan Mayen", "Swaziland", "Sweden", "Switzerland", "Syrian Arab Republic", "Taiwan, Province of China", "Tajikistan", "Tanzania, United Republic of", "Thailand", "Timor-leste", "Togo", "Tokelau", "Tonga", "Trinidad and Tobago", "Tunisia", "Turkey", "Turkmenistan", "Turks and Caicos Islands", "Tuvalu", "Uganda", "Ukraine", "United Arab Emirates", "United Kingdom", "United States", "United States Minor Outlying Islands", "Uruguay", "Uzbekistan", "Vanuatu", "Venezuela", "Viet Nam", "Virgin Islands, British", "Virgin Islands, U.S.", "Wallis and Futuna", "Western Sahara", "Yemen", "Zambia", "Zimbabwe"]; +/* eslint-disable */ +export default [ + 'Afghanistan', + 'Åland Islands', + 'Albania', + 'Algeria', + 'American Samoa', + 'Andorra', + 'Angola', + 'Anguilla', + 'Antarctica', + 'Antigua and Barbuda', + 'Argentina', + 'Armenia', + 'Aruba', + 'Australia', + 'Austria', + 'Azerbaijan', + 'Bahamas', + 'Bahrain', + 'Bangladesh', + 'Barbados', + 'Belarus', + 'Belgium', + 'Belize', + 'Benin', + 'Bermuda', + 'Bhutan', + 'Bolivia', + 'Bosnia and Herzegovina', + 'Botswana', + 'Bouvet Island', + 'Brazil', + 'British Indian Ocean Territory', + 'Brunei Darussalam', + 'Bulgaria', + 'Burkina Faso', + 'Burundi', + 'Cambodia', + 'Cameroon', + 'Canada', + 'Cape Verde', + 'Cayman Islands', + 'Central African Republic', + 'Chad', + 'Chile', + 'China', + 'Christmas Island', + 'Cocos (Keeling) Islands', + 'Colombia', + 'Comoros', + 'Congo', + 'Congo, The Democratic Republic of The', + 'Cook Islands', + 'Costa Rica', + 'Cote D\'ivoire', + 'Croatia', + 'Cuba', + 'Cyprus', + 'Czech Republic', + 'Denmark', + 'Djibouti', + 'Dominica', + 'Dominican Republic', + 'Ecuador', + 'Egypt', + 'El Salvador', + 'Equatorial Guinea', + 'Eritrea', + 'Estonia', + 'Ethiopia', + 'Falkland Islands (Malvinas)', + 'Faroe Islands', + 'Fiji', + 'Finland', + 'France', + 'French Guiana', + 'French Polynesia', + 'French Southern Territories', + 'Gabon', + 'Gambia', + 'Georgia', + 'Germany', + 'Ghana', + 'Gibraltar', + 'Greece', + 'Greenland', + 'Grenada', + 'Guadeloupe', + 'Guam', + 'Guatemala', + 'Guernsey', + 'Guinea', + 'Guinea-bissau', + 'Guyana', + 'Haiti', + 'Heard Island and Mcdonald Islands', + 'Holy See (Vatican City State)', + 'Honduras', + 'Hong Kong', + 'Hungary', + 'Iceland', + 'India', + 'Indonesia', + 'Iran, Islamic Republic of', + 'Iraq', + 'Ireland', + 'Isle of Man', + 'Israel', + 'Italy', + 'Jamaica', + 'Japan', + 'Jersey', + 'Jordan', + 'Kazakhstan', + 'Kenya', + 'Kiribati', + 'Korea, Democratic People\'s Republic of', + 'Korea, Republic of', + 'Kuwait', + 'Kyrgyzstan', + 'Lao People\'s Democratic Republic', + 'Latvia', + 'Lebanon', + 'Lesotho', + 'Liberia', + 'Libyan Arab Jamahiriya', + 'Liechtenstein', + 'Lithuania', + 'Luxembourg', + 'Macao', + 'Macedonia, The Former Yugoslav Republic of', + 'Madagascar', + 'Malawi', + 'Malaysia', + 'Maldives', + 'Mali', + 'Malta', + 'Marshall Islands', + 'Martinique', + 'Mauritania', + 'Mauritius', + 'Mayotte', + 'Mexico', + 'Micronesia, Federated States of', + 'Moldova, Republic of', + 'Monaco', + 'Mongolia', + 'Montenegro', + 'Montserrat', + 'Morocco', + 'Mozambique', + 'Myanmar', + 'Namibia', + 'Nauru', + 'Nepal', + 'Netherlands', + 'Netherlands Antilles', + 'New Caledonia', + 'New Zealand', + 'Nicaragua', + 'Niger', + 'Nigeria', + 'Niue', + 'Norfolk Island', + 'Northern Mariana Islands', + 'Norway', + 'Oman', + 'Pakistan', + 'Palau', + 'Palestinian Territory, Occupied', + 'Panama', + 'Papua New Guinea', + 'Paraguay', + 'Peru', + 'Philippines', + 'Pitcairn', + 'Poland', + 'Portugal', + 'Puerto Rico', + 'Qatar', + 'Reunion', + 'Romania', + 'Russian Federation', + 'Rwanda', + 'Saint Helena', + 'Saint Kitts and Nevis', + 'Saint Lucia', + 'Saint Pierre and Miquelon', + 'Saint Vincent and The Grenadines', + 'Samoa', + 'San Marino', + 'Sao Tome and Principe', + 'Saudi Arabia', + 'Senegal', + 'Serbia', + 'Seychelles', + 'Sierra Leone', + 'Singapore', + 'Slovakia', + 'Slovenia', + 'Solomon Islands', + 'Somalia', + 'South Africa', + 'South Georgia and The South Sandwich Islands', + 'Spain', + 'Sri Lanka', + 'Sudan', + 'Suriname', + 'Svalbard and Jan Mayen', + 'Swaziland', + 'Sweden', + 'Switzerland', + 'Syrian Arab Republic', + 'Taiwan, Province of China', + 'Tajikistan', + 'Tanzania, United Republic of', + 'Thailand', + 'Timor-leste', + 'Togo', + 'Tokelau', + 'Tonga', + 'Trinidad and Tobago', + 'Tunisia', + 'Turkey', + 'Turkmenistan', + 'Turks and Caicos Islands', + 'Tuvalu', + 'Uganda', + 'Ukraine', + 'United Arab Emirates', + 'United Kingdom', + 'United States', + 'United States Minor Outlying Islands', + 'Uruguay', + 'Uzbekistan', + 'Vanuatu', + 'Venezuela', + 'Viet Nam', + 'Virgin Islands, British', + 'Virgin Islands, U.S.', + 'Wallis and Futuna', + 'Western Sahara', + 'Yemen', + 'Zambia', + 'Zimbabwe']; diff --git a/dev/data/countryCodes.js b/dev/data/countryCodes.js index 96dbcb8..3d835d0 100644 --- a/dev/data/countryCodes.js +++ b/dev/data/countryCodes.js @@ -1,3 +1,4 @@ +/* eslint-disable */ export default [ {value: "AF", label: "Afghanistan"}, {value: "AX", label: "Åland Islands"}, diff --git a/dev/dev.js b/dev/dev.js index 83e4580..658e484 100644 --- a/dev/dev.js +++ b/dev/dev.js @@ -1,50 +1,8 @@ -import Vue from 'vue' -import Fuse from 'fuse.js' -import debounce from 'lodash/debounce' -import resource from 'vue-resource' -import vSelect from '../src/components/Select.vue' -import countries from './data/countryCodes' -import fuseSearchOptions from './data/books' +import Vue from "vue"; +import Dev from "./Dev.vue"; -Vue.use(resource) -Vue.component('v-select', vSelect) +Vue.config.productionTip = false; -/* eslint-disable no-new */ new Vue({ - el: '#app', - data: { - placeholder: "placeholder", - value: null, - options: countries, - ajaxRes: [], - people: [], - fuseSearchOptions - }, - methods: { - search(search, loading) { - loading(true); - this.getRepositories(search, loading, this) - }, - searchPeople(search, loading) { - loading(true) - this.getPeople(loading, this) - }, - getPeople: debounce((loading, vm) => { - vm.$http.get(`https://reqres.in/api/users?per_page=10`).then(res => { - vm.people = res.data.data - loading(false) - }) - }, 250), - getRepositories: debounce((search, loading, vm) => { - vm.$http.get(`https://api.github.com/search/repositories?q=${search}`).then(res => { - vm.ajaxRes = res.data.items; - loading(false) - }) - }, 250), - fuseSearch(options, search) { - return new Fuse(options, { - keys: ['title', 'author.firstName', 'author.lastName'], - }).search(search); - } - } -}); \ No newline at end of file + render: h => h(Dev) +}).$mount("#app"); diff --git a/docs/.vuepress/components/CodePen.vue b/docs/.vuepress/components/CodePen.vue new file mode 100644 index 0000000..aa3107f --- /dev/null +++ b/docs/.vuepress/components/CodePen.vue @@ -0,0 +1,28 @@ + + + diff --git a/docs/.vuepress/components/HomePage.vue b/docs/.vuepress/components/HomePage.vue new file mode 100644 index 0000000..6bc7e9d --- /dev/null +++ b/docs/.vuepress/components/HomePage.vue @@ -0,0 +1,123 @@ + + + + + diff --git a/docs/.vuepress/config.js b/docs/.vuepress/config.js new file mode 100644 index 0000000..d8564fb --- /dev/null +++ b/docs/.vuepress/config.js @@ -0,0 +1,88 @@ +const meta = { + title: 'Vue Select | VueJS Select2/Chosen Component', + description: 'A well-tested, native Vue.js component that provides similar functionality to Select2/Chosen without the overhead of jQuery.', + icon: 'static/vue-logo.png', +}; + +module.exports = { + title: 'VueSelect', + description: meta.description, + head: [ + [ + 'link', + { + href: '//fonts.googleapis.com/css?family=Source+Sans+Pro:400,600|Roboto Mono', + rel: 'stylesheet', + type: 'text/css', + }], + [ + 'link', + { + href: '//fonts.googleapis.com/css?family=Dosis:300&text=Vue Select', + rel: 'stylesheet', + type: 'text/css', + }], + [ + 'link', + { + href: 'https://cdnjs.cloudflare.com/ajax/libs/octicons/4.4.0/font/octicons.min.css', + rel: 'stylesheet', + type: 'text/css', + }], + ['meta', {name: 'title', content: meta.title}], + ['meta', {name: 'description', content: meta.description}], + ['link', {rel: 'icon', href: meta.icon, type: 'image/png'}], + ['meta', {property: 'og:image', content: meta.icon}], + ['meta', {property: 'twitter:image', content: meta.icon}], + ['meta', {name: 'description', content: meta.description}], + ['meta', {property: 'og:description', content: ''}], + ['meta', {property: 'twitter:description', content: meta.description}], + ['meta', {property: 'twitter:title', content: meta.title}], + ['meta', {property: 'og:title', content: meta.title}], + ['meta', {property: 'og:site_name', content: meta.title}], + [ + 'meta', + {property: 'og:url', content: 'http://sagalbot.github.io/vue-select/'}], + ], + serviceWorker: true, + ga: 'UA-12818324-8', + themeConfig: { + repo: 'sagalbot/vue-select', + editLinks: true, + docsDir: 'docs', + sidebar: { + '/docs/': [ + { + title: 'Getting Started', + collapsable: false, + children: [ + ['getting-started/install', 'Installation'], + ['getting-started/options', 'Dropdown Options'], + ['getting-started/values', 'Selecting Values'], + ['getting-started/localization', 'Localization'], + ], + }, + { + title: 'Digging Deeper', + collapsable: false, + children: [ + ['digging-deeper/templating', 'Templating & Slots'], + ['digging-deeper/vuex', 'Vuex'], + ['digging-deeper/ajax', 'AJAX'], + ['digging-deeper/examples', 'Examples'], + ], + }, + { + title: 'API', + collapsable: false, + children: [ + ['api/props', 'Props'], + ['api/slots', 'Slots'], + ['api/events', 'Events'] + ], + }, + ], + }, + }, + +}; diff --git a/docs/.vuepress/enhanceApp.js b/docs/.vuepress/enhanceApp.js new file mode 100644 index 0000000..878431f --- /dev/null +++ b/docs/.vuepress/enhanceApp.js @@ -0,0 +1,5 @@ +import vSelect from '../../src/components/Select'; + +export default ({Vue, options, router, siteData}) => { + Vue.component('v-select', vSelect); +} diff --git a/docs/homepage/assets/scss/_cyan_theme.scss b/docs/.vuepress/scss/_cyan_theme.scss similarity index 100% rename from docs/homepage/assets/scss/_cyan_theme.scss rename to docs/.vuepress/scss/_cyan_theme.scss diff --git a/docs/homepage/assets/scss/_demo.scss b/docs/.vuepress/scss/_demo.scss similarity index 99% rename from docs/homepage/assets/scss/_demo.scss rename to docs/.vuepress/scss/_demo.scss index 8257f3d..628c7e4 100644 --- a/docs/homepage/assets/scss/_demo.scss +++ b/docs/.vuepress/scss/_demo.scss @@ -1,15 +1,11 @@ @import 'variables'; -html, -body { - height: 100vh; -} - [v-cloak] { display: none; } -body { +#home { + min-height: 100vh; font-family: 'Source Sans Pro', 'Helvetica Neue', Arial, sans-serif; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; @@ -21,12 +17,13 @@ body { background: $blue; background: $gradient; display: flex; + flex-direction: column; align-items: center; justify-content: center; + text-align: center; } -#app { - text-align: center; +.container { max-width: 50em; } @@ -145,4 +142,4 @@ code { .dropdown-action { margin-top: 5em; -} \ No newline at end of file +} diff --git a/docs/homepage/assets/scss/_variables.scss b/docs/.vuepress/scss/_variables.scss similarity index 100% rename from docs/homepage/assets/scss/_variables.scss rename to docs/.vuepress/scss/_variables.scss diff --git a/docs/homepage/assets/scss/home.scss b/docs/.vuepress/scss/home.scss similarity index 65% rename from docs/homepage/assets/scss/home.scss rename to docs/.vuepress/scss/home.scss index c3193b7..f77b8c0 100644 --- a/docs/homepage/assets/scss/home.scss +++ b/docs/.vuepress/scss/home.scss @@ -1,3 +1,3 @@ @import '~normalize.css'; @import 'demo'; -@import 'cyan_theme'; \ No newline at end of file +@import 'cyan_theme'; diff --git a/docs/.vuepress/utils/codePen.js b/docs/.vuepress/utils/codePen.js new file mode 100644 index 0000000..b8d7a28 --- /dev/null +++ b/docs/.vuepress/utils/codePen.js @@ -0,0 +1,111 @@ +export default () => { + + document.getElementsByClassName || (document.getElementsByClassName = function (e) { + var n, t, r, a = document, o = []; + if (a.querySelectorAll) return a.querySelectorAll('.' + e); + if (a.evaluate) for (t = './/*[contains(concat(\' \', @class, \' \'), \' ' + e + ' \')]', n = a.evaluate(t, a, + null, 0, + null); r = n.iterateNext();) o.push(r); else for (n = a.getElementsByTagName('*'), t = new RegExp( + '(^|\\s)' + e + '(\\s|$)'), r = 0; r < n.length; r++) t.test(n[r].className) && o.push(n[r]); + return o; + }), function () { + function e () { + function e () { + for (var e = document.getElementsByClassName('codepen'), t = e.length - 1; t > -1; t--) { + var u = a(e[t]); + if (0 !== Object.keys(u).length && (u = o(u), u.user = n(u, e[t]), r(u))) { + var c = i(u), l = s(u, c); + f(e[t], l); + } + } + m(); + } + + function n (e, n) { + if ('string' == typeof e.user) return e.user; + for (var t = 0, r = n.children.length; t < r; t++) { + var a = n.children[t], o = a.href || '', i = o.match(/codepen\.(io|dev)\/(\w+)\/pen\//i); + if (i) return i[2]; + } + return 'anon'; + } + + function r (e) {return e['slug-hash'];} + + function a (e) { + for (var n = {}, t = e.attributes, r = 0, a = t.length; r < a; r++) { + var o = t[r].name; + 0 === o.indexOf('data-') && (n[o.replace('data-', '')] = t[r].value); + } + return n; + } + + function o (e) { + return e.href && (e['slug-hash'] = e.href), e.type && (e['default-tab'] = e.type), e.safe && + ('true' === e.safe ? e.animations = 'run' : e.animations = 'stop-after-5'), e; + } + + function i (e) { + var n = u(e), t = e.user ? e.user : 'anon', r = '?' + l(e), + a = e.preview && 'true' === e.preview ? 'embed/preview' : 'embed', + o = [n, t, a, e['slug-hash'] + r].join('/'); + return o.replace(/\/\//g, '//'); + } + + function u (e) { + return e.host ? c(e.host) : 'file:' === document.location.protocol + ? 'https://codepen.io' + : '//codepen.io'; + } + + function c (e) {return e.match(/^\/\//) || !e.match(/https?:/) ? document.location.protocol + '//' + e : e;} + + function l (e) { + var n = ''; + for (var t in e) '' !== n && (n += '&'), n += t + '=' + encodeURIComponent(e[t]); + return n; + } + + function s (e, n) { + var r; + e['pen-title'] ? r = e['pen-title'] : (r = 'CodePen Embed ' + t, t++); + var a = { + id: 'cp_embed_' + e['slug-hash'].replace('/', '_'), + src: n, + scrolling: 'no', + frameborder: '0', + height: d(e), + allowTransparency: 'true', + allowfullscreen: 'true', + allowpaymentrequest: 'true', + name: 'CodePen Embed', + title: r, + 'class': 'cp_embed_iframe ' + (e['class'] ? e['class'] : ''), + style: 'width: ' + p + '; overflow: hidden;', + }, o = '