0.1.11 • Published 4 years ago

@vectorwyse/vw-multi-select v0.1.11

Weekly downloads
-
License
MIT
Repository
github
Last release
4 years ago

vw-multi-select

A styleable multi-select component for Vue.js

Installation

npm install @vectorwyse/vw-multi-select

Usage

Global

In your entry file:

import VwMultiSelect from "@vectorwyse/vw-multi-select";
Vue.component('vw-multi-select', VwMultiSelect);

or:

Component

In your component:

import VwMultiSelect from "@vectorwyse/vw-multi-select";
...
components: {VwMultiSelect},
...

In your template:

<vw-multi-select
    v-model="listOfSelectedOptions"
    :list="listOfOptions"
></vw-multi-select>

Props

NameDescriptionTypeRequiredOptionsDefault
listThe list of options to select fromArrayyes
idThe root element idString
selectedListDisplayFunctionDetermines how an option is displayed in the selected items listFunctionitem => {return this.listItemProperty ? item[this.listItemProperty] : item;}
listItemDisplayFunctionDetermines how an option is displayed in the listFunctionitem => {return this.listItemProperty ? item[this.listItemProperty] : item;}
valuePropertyThe property from the option which will be used in the v-model aString
listItemPropertyThe property from the option which will be used in the lists, can overridden on render by selectedListDisplayFunction and listItemDisplayFunctionString
disabledDisables any interaction with the selectBooleanfalse
isInvalidApplies the 'invalid' class to the wrapper if set to trueBooleanfalse
iconsetThe set of icons usedString'font-awesome'
templateThe name of the classes templateString'bootstrap'
appendRandomIdIf a random 6-digit string should be appended to the wrapper, selected and list ids in order to avoid conflictsBooleantrue
showSelectedFirstIf the selected items should be moved to the top of the listBooleanfalse
searchableIf the search field should be displayedBooleanfalse
tagsIf the selectd items should be displayed as tags at the topBooleanfalse
iconsAn object containing the classes to be applied to the icon elements, if an iconset is chosenObject{}
classesAn object containing the classes to be applied to each elementObject{}
stylesAn object containing the styles object to be applied to each elementObject{}
disabledIcons, disabledClasses, disabledStylesOverrides the classes above id disabled is set to trueObject{}
inputPlaceholderThe search input placeholder textString"Search..."
autoAddTextThe text to be displayed next to the list item, if the search yields only one unselected resultString"Hit enter to add"

Styling

Classes

{
    autoAddText: "",
    input: "",
    invalid: "",
    list: "",
    removeIcon: "",
    selected: "",
    selectedIcon: "",
    selectedItem: "",
    selectedListItem: "",
    selectedListItemText: "",
    unselectedIcon: "",
    unselectedListItem: "",
    unselectedListItemText: "",
    wrapper: "",
}

Styles

{
    autoAddText: {},
    input: {},
    invalid: {},
    list: {},
    removeIcon: {},
    selected: {},
    selectedIcon: {},
    selectedItem: {},
    selectedListItem: {},
    selectedListItemText: {},
    unselectedIcon: {},
    unselectedListItem: {},
    unselectedListItemText: {},
    wrapper: {},
}

Icons

{
    removeIcon: "",
    selectedIcon: "",
    unselectedIcon: "",
}

Support Us

Vectorwyse is a digital agency offering advisory and web development services. We love building things with Laravel and Vue.js, so when we have an opportunity to give back to the community, we're super excited!

If you find this package useful, or if you would like us to build something for you, feel free to drop us a line!

0.1.11

4 years ago

0.1.10

5 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.5

5 years ago

0.1.4

5 years ago

0.1.3

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago