All Projects β†’ iNeoO β†’ Vue Multi Select

iNeoO / Vue Multi Select

Licence: mit
This component gives you a multi/single select with the power of Vuejs components.

Projects that are alternatives of or similar to Vue Multi Select

Vue Social Sharing
A renderless Vue.js component for sharing links to social networks, compatible with SSR
Stars: ✭ 1,071 (+1064.13%)
Mutual labels:  vue-components, vuejs-components, vuejs2
Nextcloud Vue
🍱 Vue.js components for Nextcloud app development ✌
Stars: ✭ 89 (-3.26%)
Mutual labels:  vue-components, vuejs-components, vuejs2
Vue Swatches
🎨 Help the user picking beautiful colors!
Stars: ✭ 456 (+395.65%)
Mutual labels:  vue-components, vuejs-components, vuejs2
vue-notification-bell
Vue.js notification bell component.
Stars: ✭ 64 (-30.43%)
Mutual labels:  vuejs2, vue-components, vuejs-components
Vuelayers
Web map Vue components with the power of OpenLayers
Stars: ✭ 532 (+478.26%)
Mutual labels:  vue-components, vuejs-components, vuejs2
Xcui
🍴 A Vue.js 2.x desktop components colletion
Stars: ✭ 88 (-4.35%)
Mutual labels:  vue-components, vuejs2
Vue Share Buttons
πŸ”—A set of social buttons for Vue.js
Stars: ✭ 34 (-63.04%)
Mutual labels:  vue-components, vuejs2
Vue Flexboxgrid
Vue components made with Flexboxgrid
Stars: ✭ 37 (-59.78%)
Mutual labels:  vue-components, vuejs2
V Tag Suggestion
A simple tag component with typeahead
Stars: ✭ 40 (-56.52%)
Mutual labels:  vuejs-components, vuejs2
Vue Lottie
Render After Effects animations on Vue based on Bodymovin
Stars: ✭ 1,037 (+1027.17%)
Mutual labels:  vue-components, vuejs2
Vue Image Loader
Vue progressive image loader plugin like Medium
Stars: ✭ 47 (-48.91%)
Mutual labels:  vue-components, vuejs2
Semantic Ui Vue
Semantic UI integration for Vue
Stars: ✭ 914 (+893.48%)
Mutual labels:  vue-components, vuejs2
Vue Meteor
🌠 Vue first-class integration in Meteor
Stars: ✭ 893 (+870.65%)
Mutual labels:  vue-components, vuejs2
Vue Flip
A Vue.js component to flip elements.
Stars: ✭ 37 (-59.78%)
Mutual labels:  vue-components, vuejs2
Vue Quill Editor
🍑@quilljs editor component for @vuejs
Stars: ✭ 6,874 (+7371.74%)
Mutual labels:  vue-components, vuejs2
Vue Snotify
Vuejs 2 Notification Center
Stars: ✭ 755 (+720.65%)
Mutual labels:  vue-components, vuejs2
Vueye Table
A data table created using Vue.js
Stars: ✭ 64 (-30.43%)
Mutual labels:  vue-components, vuejs2
Vue Nuggets
E-commerce UI Nuggets based on Vue
Stars: ✭ 84 (-8.7%)
Mutual labels:  vue-components, vuejs2
Cordovue
A sample Apache Cordova application using VueJS.
Stars: ✭ 66 (-28.26%)
Mutual labels:  vue-components, vuejs2
Vue Hotel Datepicker
Vue date range picker component
Stars: ✭ 665 (+622.83%)
Mutual labels:  vuejs-components, vuejs2

This component gives you a multi/single select with the power of Vuejs components.

Demo and doc site

vue-multi-select

https://github.com/IneoO/vue-multi-select

What's new in v4.6.0

Set a props for label when empty data

Dependencies

  • required: Vuejs >= 2.x

Install

  1. Clone the repo or npm install vue-multi-select --save
  2. Include the file in your app import vueMultiSelect from 'vue-multi-select'; import 'vue-multi-select/dist/lib/vue-multi-select.min.css'

Contributing

Issues and PR's are much appreciated. When you create a new PR please make it against the develop branch when adding new features and to the fix branch when fixing small issues instead of master.

Usage and Documentation

Params Type
options Object
filters Array
selectOptions Array
v-model Array
reloadInit Boolean
btnLabel Function
btnClass String
popoverClass String
search Boolean
eventName String
position String
searchPlaceholder String
historyButton Boolean
historyButtonText String
disabled Boolean
disabledUnSelect Boolean
emptyTabText String

(NB. position is a string ex: 'top-left', 'top-right', default is 'bottom-left')

Events params
selectionChanged values selected
open -
close -

(NB. selectionChanged naming can be change with eventName)

1. options (Contains options to set the multi-select)

Params Type Default Description
cssSelected Function (option) => option['selected'] ? { 'font-weight': 'bold',color: '#5755d9',} : '' Css passed to value
groups Boolean false Display or not groups selection
multi Boolean false Set single or multiple selection
labelList String 'list' Name Attributes for list
labelName String 'name' Name Attributes for value to display
labelValue String labelName Name Attributes for value to comparaison between them
labelSelected String 'selected' Name attributes for value selected
labelDisabled String 'disabled' Name attributes for value disabled
groupName String 'name' Name Attributes for groups to display

*if you use html balise and don't want to have them find in the search use labelHtml, search will just check the property labelName but v-html the labelHtml.

2. filters to apply to select many options

// Exemple with Select/Deselect all
const filters = [];
filters.push({
  nameAll: 'Select all', // label when want to select all elements who answer yes to the function
  nameNotAll: 'Deselect all', //label when want to deselect all elements who answer yes to the function
  func(elem) {
    return true;
  },
});

// Second exemple to select all elements who contain 2
filters.push({
  nameAll: 'Select all elements with 2',
  nameNotAll: 'Deselect all elements with 2',
  func(elem) {
    return elem.name.indexOf('2') !== -1;
  }
});

3. elements to select/deselect

// when groups not set or false
data = [
  {name: 'choice 1'}, // Name can be changed with labelName in options
  {name: 'choice 2'},
  {name: 'choice 3'},
  {name: 'choice 4'},
  {name: 'choice 5'},
]

// or just an array
// it's also possible when to have an array of strings
// in list when groups is set to true.
data = [
  'choice 1',
  'choice 2',
  'choice 3',
  'choice 4',
  'choice 5',
]

// when groups set to true

data = [{
  name: 'choice 1', // Can be changed with tabName in options
  list: [
    {name: 'choice 1'}, // Name can be changed with labelName in options
    {name: 'choice 2'},
    {name: 'choice 3'},
    {name: 'choice 4'},
    {name: 'choice 5'},
  ]
}, {
  name: 'choice 10', // Can be changed with tabName in options
  list: [
    {name: 'choice 11'}, // Name can be changed with labelName in options
    {name: 'choice 12'},
    {name: 'choice 13'},
    {name: 'choice 14'},
    {name: 'choice 15'},
  ]
}]

4. values selected

[ {name: 'choice 1'}, {name: 'choice 11'}] // In the case we selected choice 1 and choice 11

5. Manual open/close

you can access to openMultiSelect()/closeMultiSelect() by ref to manualy open/close the mutliSelect

<template>
  <mult-select ref="multiSelect" />
</template>

<script>
export default {
  mounted() {
    this.refs.multiSelect.openMultiSelect();
  },
};
</script>

6. Examples

<template>
  <div>
    <multi-select
      v-model="values"
      :options="options"
      :filters="filters"
      :btnLabel="btnLabel"
      search
      historyButton
      :searchPlaceholder="Search"
      :selectOptions="data" />
  </div>
</template>

<script>
import vueMultiSelect from 'vue-multi-select';
import 'vue-multi-select/dist/lib/vue-multi-select.css';

export default {
  data() {
    return {
      search: 'Search things',
      btnLabel: values => `A simple vue multi select (${values.length})`,
      name: 'first group',
      values: [],
      data: [{
        name: 'first group',
        list: [
          { name: '0' },
          { name: '2' },
          { name: '3' },
          { name: '8' },
          { name: '9' },
          { name: '11' },
          { name: '13' },
          { name: '14' },
          { name: '15' },
          { name: '18' },
        ],
      }, {
        name: 'second group',
        list: [
          { name: '21' },
          { name: '22' },
          { name: '24' },
          { name: '27' },
          { name: '28' },
          { name: '29' },
          { name: '31' },
          { name: '33' },
          { name: '35' },
          { name: '39' },
        ],
      }],
      filters: [{
        nameAll: 'select <= 10',
        nameNotAll: 'Deselect <= 10',
        func(elem) {
          return elem.name <= 10;
        },
      }, {
        nameAll: 'Select contains 2',
        nameNotAll: 'Deselect contains 2',
        func(elem) {
          return elem.name.indexOf('2') !== -1;
        },
      }],
      options: {
        multi: true,
        groups: true,
      },
    };
  },
  methods: {
  },
  components: {
    vueMultiSelect,
  },
};
</script>

It's possible to use slot-scope to custom option

<template>
  <div>
    <vue-multi-select
      v-model="values"
      search
      historyButton
      :options="options"
      :filters="filters"
      :btnLabel="btnLabel"
      @open="open"
      @close="close"
      :selectOptions="data">
      <template v-slot:option="{option}">
        <input type="checkbox" :checked="option.selected"/>
        <span>{{option.name}}</span>
      </template>
    </vue-multi-select>
  </div>
</template>

Build Setup

- `npm run dev`: Shortcut to run dev

- `npm run doc`: Shortcut to run dev-doc

- `npm run build:doc`: Shortcut to build doc.

- `npm run build:lib`: Production ready build of your library as an ES6 module (via UMD), ready to import into another project via npm.

Testing Supported By
BrowserStack

thanks

Patrice ClΓ©ment

Pierre Guilbert

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].