Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: sagalbot/vue-select
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v3.9.1
Choose a base ref
...
head repository: sagalbot/vue-select
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: master
Choose a head ref
Loading
Showing with 10,261 additions and 8,664 deletions.
  1. +19 −0 .editorconfig
  2. +22 −0 .eslintrc.js
  3. +13 −24 .github/ISSUE_TEMPLATE/bug_report.md
  4. +5 −0 .github/ISSUE_TEMPLATE/config.yml
  5. +1 −1 .github/workflows/release.yml
  6. +5 −2 .github/workflows/test.yml
  7. +5 −0 .prettierignore
  8. +5 −0 .prettierrc
  9. +45 −10 README.md
  10. +19 −20 build/webpack.base.conf.js
  11. +12 −30 build/webpack.dev.conf.js
  12. +8 −11 build/webpack.prod.conf.js
  13. +30 −25 dev/Dev.vue
  14. +1 −0 dev/dev.html
  15. +5 −5 dev/dev.js
  16. +4 −3 docs/.vuepress/components/BetterNoOptions.vue
  17. +6 −6 docs/.vuepress/components/ClearButtonOverride.vue
  18. +15 −13 docs/.vuepress/components/CodePen.vue
  19. +10 −9 docs/.vuepress/components/Contributors.vue
  20. +3 −5 docs/.vuepress/components/CountrySelect.vue
  21. +13 −13 docs/.vuepress/components/CssSpecificity.vue
  22. +31 −0 docs/.vuepress/components/CssVariables.vue
  23. +5 −5 docs/.vuepress/components/CustomComponentRegistration.vue
  24. +11 −10 docs/.vuepress/components/CustomHandlers.vue
  25. +16 −12 docs/.vuepress/components/FuseFilter.vue
  26. +35 −35 docs/.vuepress/components/InfiniteScroll.vue
  27. +3 −3 docs/.vuepress/components/LimitSelectionQuantity.vue
  28. +17 −14 docs/.vuepress/components/LoopedSelect.vue
  29. +6 −6 docs/.vuepress/components/MultipleClearButtonOverride.vue
  30. +4 −4 docs/.vuepress/components/OpenIndicatorOverride.vue
  31. +29 −0 docs/.vuepress/components/OpenWhenSearchTextPresent.vue
  32. +38 −26 docs/.vuepress/components/Paginated.vue
  33. +39 −30 docs/.vuepress/components/PositionedWithPopper.vue
  34. +20 −0 docs/.vuepress/components/ReducedWithNoMatchingOption.vue
  35. +29 −28 docs/.vuepress/components/ReducerNestedValue.vue
  36. +211 −112 docs/.vuepress/components/Sandbox.vue
  37. +3 −1 docs/.vuepress/components/SlotFooter.vue
  38. +1 −1 docs/.vuepress/components/SlotHeader.vue
  39. +1 −0 docs/.vuepress/components/SlotNoOptions.vue
  40. +6 −6 docs/.vuepress/components/SlotOption.vue
  41. +1 −1 docs/.vuepress/components/SlotSearch.vue
  42. +11 −9 docs/.vuepress/components/SlotSelectedOption.vue
  43. +10 −7 docs/.vuepress/components/SlotSelectedOptionContainer.vue
  44. +5 −1 docs/.vuepress/components/SlotSpinner.vue
  45. +1 −1 docs/.vuepress/components/SponsorBanner.vue
  46. +0 −146 docs/.vuepress/components/SponsorMe.vue
  47. +9 −9 docs/.vuepress/components/Sponsors.vue
  48. +3 −3 docs/.vuepress/components/UnselectableExample.vue
  49. +22 −22 docs/.vuepress/components/ValidationRequired.vue
  50. +5 −6 docs/.vuepress/config.js
  51. +36 −34 docs/.vuepress/config/head.js
  52. +0 −1 docs/.vuepress/config/isDeployPreview.js
  53. +4 −3 docs/.vuepress/config/meta.js
  54. +13 −15 docs/.vuepress/config/plugins.js
  55. +3 −4 docs/.vuepress/config/themeConfig.js
  56. +8 −9 docs/.vuepress/enhanceApp.js
  57. +47 −25 docs/.vuepress/github/clientDynamicModules.js
  58. +2 −2 docs/.vuepress/github/index.js
  59. +0 −43 docs/.vuepress/theme/components/CodeFund.vue
  60. +54 −0 docs/.vuepress/theme/components/EthicalAds.vue
  61. +1 −1 docs/.vuepress/theme/index.js
  62. +8 −13 docs/.vuepress/theme/layouts/Layout.vue
  63. +154 −90 docs/.vuepress/utils/codePen.js
  64. +1 −0 docs/README.md
  65. +79 −2 docs/api/events.md
  66. +349 −200 docs/api/props.md
  67. +22 −1 docs/guide/components.md
  68. +48 −17 docs/guide/css.md
  69. +9 −9 docs/guide/install.md
  70. +22 −0 docs/guide/opening.md
  71. +1 −1 docs/guide/positioning.md
  72. +92 −59 docs/guide/values.md
  73. +28 −30 docs/package.json
  74. +9 −1 docs/sponsors.md
  75. +2,371 −2,407 docs/yarn.lock
  76. +33 −27 package.json
  77. +3 −1 postcss.config.js
  78. +14 −14 release.config.js
  79. +3 −1 src/components/Deselect.vue
  80. +3 −1 src/components/OpenIndicator.vue
  81. +1,196 −1,000 src/components/Select.vue
  82. +3 −3 src/components/childComponents.js
  83. +35 −0 src/css/global/animations.css
  84. +9 −0 src/css/global/component.css
  85. +55 −0 src/css/global/states.css
  86. +68 −0 src/css/global/variables.css
  87. +10 −0 src/css/modules/clear.css
  88. +29 −0 src/css/modules/dropdown-menu.css
  89. +26 −0 src/css/modules/dropdown-option.css
  90. +49 −0 src/css/modules/dropdown-toggle.css
  91. +26 −0 src/css/modules/open-indicator.css
  92. +61 −0 src/css/modules/search-input.css
  93. +43 −0 src/css/modules/selected.css
  94. +28 −0 src/css/modules/spinner.css
  95. +13 −0 src/css/vue-select.css
  96. +29 −21 src/directives/appendToBody.js
  97. +1 −1 src/index.js
  98. +10 −10 src/mixins/ajax.js
  99. +3 −3 src/mixins/index.js
  100. +36 −63 src/mixins/pointerScroll.js
  101. +43 −23 src/mixins/typeAheadPointer.js
  102. +10 −5 src/scss/global/_variables.scss
  103. +1 −0 src/scss/modules/_dropdown-menu.scss
  104. +7 −8 src/scss/modules/_dropdown-option.scss
  105. +21 −21 src/scss/modules/_dropdown-toggle.scss
  106. +4 −4 src/scss/modules/_search-input.scss
  107. +3 −1 src/scss/modules/_selected.scss
  108. +22 −12 src/scss/vue-select.scss
  109. +8 −6 src/utility/sortAndStringify.js
  110. +3 −3 src/utility/uniqueId.js
  111. +43 −20 tests/helpers.js
  112. +4 −4 tests/unit/.eslintrc.js
  113. +47 −0 tests/unit/Accessibility.spec.js
  114. +42 −42 tests/unit/Ajax.spec.js
  115. +61 −0 tests/unit/Autoscroll.spec.js
  116. +15 −17 tests/unit/Components.spec.js
  117. +30 −0 tests/unit/CreateOption.spec.js
  118. +131 −67 tests/unit/Deselecting.spec.js
  119. +180 −114 tests/unit/Dropdown.spec.js
  120. +68 −60 tests/unit/Filtering.spec.js
  121. +41 −55 tests/unit/Keydown.spec.js
  122. +49 −45 tests/unit/Labels.spec.js
  123. +22 −22 tests/unit/Layout.spec.js
  124. +19 −18 tests/unit/OptionComparator.spec.js
  125. +15 −15 tests/unit/OptionKey.spec.js
  126. +117 −95 tests/unit/ReactiveOptions.spec.js
  127. +207 −163 tests/unit/Reduce.spec.js
  128. +52 −35 tests/unit/Selectable.spec.js
  129. +260 −145 tests/unit/Selecting.spec.js
  130. +113 −78 tests/unit/Slots.spec.js
  131. +160 −152 tests/unit/Tagging.spec.js
  132. +87 −143 tests/unit/TypeAhead.spec.js
  133. +9 −8 tests/unit/utility/sortAndStringify.spec.js
  134. +3 −3 tests/unit/utility/uniqueId.spec.js
  135. +2,399 −2,493 yarn.lock
19 changes: 19 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true

[*.{js,vue}]
indent_style = space
indent_size = 2

[*.md]
trim_trailing_whitespace = false

[*.{yml,yaml}]
indent_size = 2
22 changes: 22 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
module.exports = {
parser: 'vue-eslint-parser',
parserOptions: {
parser: 'babel-eslint',
sourceType: 'module',
},
plugins: ['prettier'],
extends: [
'plugin:prettier/recommended',
'plugin:vue/recommended',
'prettier/vue',
],
ignorePatterns: [
'!.*.js',
'!docs/.vuepress',
'docs/.vuepress/dist',
'node_modules',
'dist',
'coverage',
'yarn.lock',
],
}
37 changes: 13 additions & 24 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
---
name: Bug report
about: Create a report to help us improve
name: Bug Report
about: Create a bug report to help fix an issue with the component.
title: ''
labels: ''
labels: 'bug'
assignees: ''

---

> Please respect maintainers time by filling in these sections. Your issue will likely be closed without this information.
- Vue Version:
- Vue Select Version:

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error
**Reproduction Link**
A link to a reproduction of the bug. This is a huge help.

**Steps To Reproduce**
Outline the steps to reproduce the bug.

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**
- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Discussions
url: https://github.com/sagalbot/vue-select/discussions
about: If you're not submitting a bug or feature request, please use discussions instead.
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ on:
- master
jobs:
release:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
7 changes: 5 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -2,7 +2,7 @@ name: Test & Build
on: [pull_request]
jobs:
test:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
@@ -15,13 +15,16 @@ jobs:
- name: Test with Coverage
run: yarn test --coverage --coverageReporters=lcov

- name: ESLint
run: yarn eslint

- name: Report Coverage
uses: coverallsapp/github-action@master
with:
github-token: ${{ secrets.GITHUB_TOKEN }}

build:
runs-on: ubuntu-18.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v1
- uses: actions/setup-node@v1
5 changes: 5 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
node_modules
coverage
yarn.lock
dist
dist/*
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": false,
"singleQuote": true,
"proseWrap": "always"
}
55 changes: 45 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# vue-select ![Current Release](https://img.shields.io/github/release/sagalbot/vue-select.svg?style=flat-square) ![Bundle Size](https://flat.badgen.net/bundlephobia/min/vue-select) ![Monthly Downloads](https://img.shields.io/npm/dm/vue-select.svg?style=flat-square) [![Coverage Status](https://coveralls.io/repos/github/sagalbot/vue-select/badge.svg?branch=master)](https://coveralls.io/github/sagalbot/vue-select?branch=master) ![MIT License](https://img.shields.io/github/license/sagalbot/vue-select.svg?style=flat-square)
# vue-select ![Current Release](https://img.shields.io/github/release/sagalbot/vue-select.svg?style=flat-square) ![Release Date](https://img.shields.io/github/release-date/sagalbot/vue-select?style=flat-square) ![Bundle Size](https://flat.badgen.net/bundlephobia/min/vue-select) ![Monthly Downloads](https://img.shields.io/npm/dm/vue-select.svg?style=flat-square) [![Coverage Status](https://coveralls.io/repos/github/sagalbot/vue-select/badge.svg?branch=master)](https://coveralls.io/github/sagalbot/vue-select?branch=master) ![MIT License](https://img.shields.io/github/license/sagalbot/vue-select.svg?style=flat-square)

> **Everything you wish the HTML `<select>` element could do, wrapped up into a lightweight, zero
> dependency, extensible Vue component.**
@@ -24,16 +24,57 @@ developer experience, and customization.
Complete documentation and examples available at https://vue-select.org.

- **[API Documentation](https://vue-select.org)**
- **[CodePen Template](http://codepen.io/sagalbot/pen/NpwrQO)**
- **[Vue 2 CodePen Template](https://codepen.io/pen?template=VwdrdzG)**
- **[Vue 3 CodePen Template](https://codepen.io/pen?template=NpwrQO)**

## Sponsors :tada:

It takes a lot of effort to maintain this project. If it has saved you development time, please consider [sponsoring the project](https://github.com/sponsors/sagalbot)
with GitHub sponsors!

Huge thanks to the [sponsors](https://github.com/sponsors/sagalbot) and [contributors](https://github.com/sagalbot/vue-select/graphs/contributors) that make Vue Select possible.
Huge thanks to the [sponsors](https://github.com/sponsors/sagalbot) and [contributors](https://github.com/sagalbot/vue-select/graphs/contributors) that make Vue Select possible!

## Install
## Get started

**Vue 3 / Vue Select 4.x-beta**

> Vue 3 support is on the `beta` channel: `vue-select@beta`, and will become the new default when `v4` is released. See [#1579](https://github.com/sagalbot/vue-select/issues/1597) for more details!
Install:

```bash
yarn add vue-select@beta

# or use npm

npm install vue-select@beta
```

Then, import and register the component:

```js
# main.ts or main.js

import { createApp } from "vue";
import App from "./App.vue";

import { VueSelect } from "vue-select";

createApp(App)
.component("v-select", VueSelect)
.mount("#app");
```

The component itself does not include any CSS. You'll need to include it separately in your Component.vue:
```vue
<style>
@import "vue-select/dist/vue-select.css";
</style>
```

**Vue 2 / Vue Select 3.x**

Install:

```bash
yarn add vue-select
@@ -58,12 +99,6 @@ The component itself does not include any CSS. You'll need to include it separat
import "vue-select/dist/vue-select.css";
```

Alternatively, you can import the scss for complete control of the component styles:

```scss
@import "vue-select/src/scss/vue-select.scss";
```

You can also include vue-select directly in the browser. Check out the
[documentation for loading from CDN.](https://vue-select.org/guide/install.html#in-the-browser).

39 changes: 19 additions & 20 deletions build/webpack.base.conf.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,14 @@
const path = require('path');
const webpack = require('webpack');
const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin;
const MiniCssExtractPlugin = require('mini-css-extract-plugin');
const path = require('path')
const webpack = require('webpack')
const VueLoaderPlugin = require('vue-loader').VueLoaderPlugin
const MiniCssExtractPlugin = require('mini-css-extract-plugin')

const env = process.env.NODE_ENV === 'production'
? 'production'
: 'development';
const env = process.env.NODE_ENV === 'production' ? 'production' : 'development'

const devtool = env === 'production' ? 'source-map' : 'eval-source-map';
const devtool = env === 'production' ? 'source-map' : 'eval-source-map'

const extractOrInjectStyles = env !== 'production'
? 'vue-style-loader'
: MiniCssExtractPlugin.loader;
const extractOrInjectStyles =
env !== 'production' ? 'vue-style-loader' : MiniCssExtractPlugin.loader

module.exports = {
mode: env,
@@ -24,11 +21,11 @@ module.exports = {
resolve: {
extensions: ['.js', '.vue'],
alias: {
'src': path.resolve(__dirname, '../src'),
'assets': path.resolve(__dirname, '../docs/assets'),
'mixins': path.resolve(__dirname, '../src/mixins'),
'components': path.resolve(__dirname, '../src/components'),
'vue$': 'vue/dist/vue.esm.js',
src: path.resolve(__dirname, '../src'),
assets: path.resolve(__dirname, '../docs/assets'),
mixins: path.resolve(__dirname, '../src/mixins'),
components: path.resolve(__dirname, '../src/components'),
vue$: 'vue/dist/vue.esm.js',
},
},
module: {
@@ -44,12 +41,14 @@ module.exports = {
exclude: /node_modules/,
},
{
test: /\.s?css$/,
test: /\.css$/i,
use: [
extractOrInjectStyles,
'css-loader',
{
loader: 'css-loader',
options: { importLoaders: 1 },
},
'postcss-loader',
'sass-loader',
],
},
],
@@ -67,4 +66,4 @@ module.exports = {
children: false,
modules: false,
},
};
}
42 changes: 12 additions & 30 deletions build/webpack.dev.conf.js
Original file line number Diff line number Diff line change
@@ -1,39 +1,21 @@
const merge = require('webpack-merge');
const chokidar = require('chokidar');
const HtmlWebpackPlugin = require('html-webpack-plugin');
const baseWebpackConfig = require('./webpack.base.conf');
const { merge } = require('webpack-merge')
const HtmlWebpackPlugin = require('html-webpack-plugin')
const baseWebpackConfig = require('./webpack.base.conf')

/**
*
*/
module.exports = merge(baseWebpackConfig, {
entry: './dev/dev.js',
devServer: {
open: true,
static: false,
client: { overlay: true },
watchFiles: ['dev/dev.html'],
},
stats: false,
plugins: [
new HtmlWebpackPlugin({
title: 'dev',
template: './dev/dev.html',
inject: true,
}),
],
optimization: {
noEmitOnErrors: true,
},
devServer: {
hot: true,
hotOnly: true,
open: true,
inline: true,
stats: {
children: false,
modules: false,
chunks: false,
},
port: 8080,
before (app, server) {
chokidar.watch([
'./**/*.html',
]).on('all', function () {
server.sockWrite(server.sockets, 'content-changed');
});
},
},
});
})
19 changes: 8 additions & 11 deletions build/webpack.prod.conf.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,17 @@
const TerserPlugin = require('terser-webpack-plugin');
const merge = require('webpack-merge');
const baseWebpackConfig = require('./webpack.base.conf');
const TerserPlugin = require('terser-webpack-plugin')
const { merge } = require('webpack-merge')
const baseWebpackConfig = require('./webpack.base.conf')

module.exports = merge(baseWebpackConfig, {
entry: './src/index.js',
output: {
filename: 'vue-select.js',
library: 'VueSelect',
libraryTarget: 'umd',
globalObject: 'typeof self !== \'undefined\' ? self : this',
globalObject: "typeof self !== 'undefined' ? self : this",
},
optimization: {
minimizer: [
new TerserPlugin({
sourceMap: true,
}),
],
}
});
minimize: true,
minimizer: [new TerserPlugin()],
},
})
Loading