@stackline/vue-multiselect-dropdown 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +142 -0
- package/dist/index.cjs +2090 -0
- package/dist/index.d.cts +301 -0
- package/dist/index.d.ts +301 -0
- package/dist/index.js +2061 -0
- package/package.json +65 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Stackline
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
# @stackline/vue-multiselect-dropdown
|
|
2
|
+
|
|
3
|
+
> A maintained Vue 2 multiselect dropdown with controlled state, searchable/grouped options, lazy loading hooks, render functions, skins, body-overlay positioning, and ADA-friendly keyboard/ARIA behavior.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@stackline/vue-multiselect-dropdown)
|
|
6
|
+
[](https://github.com/alexandroit/vue-multiselect-dropdown/blob/main/LICENSE)
|
|
7
|
+
[](https://alexandro.net/docs/vue/multiselect/vue-2/)
|
|
8
|
+
|
|
9
|
+
**[Documentation & Live Demos](https://alexandro.net/docs/vue/multiselect/)** | **[Vue 2 Demo](https://alexandro.net/docs/vue/multiselect/vue-2/)** | **[npm](https://www.npmjs.com/package/@stackline/vue-multiselect-dropdown)** | **[Repository](https://github.com/alexandroit/vue-multiselect-dropdown)**
|
|
10
|
+
|
|
11
|
+
**Current validation package release:** `2.0.0` for Vue `2.x`
|
|
12
|
+
|
|
13
|
+
---
|
|
14
|
+
|
|
15
|
+
## Why this library?
|
|
16
|
+
|
|
17
|
+
`@stackline/vue-multiselect-dropdown` provides a maintained Vue 2 multiselect component for applications that need predictable selection state, search, grouping, skins, keyboard support, and live tested examples.
|
|
18
|
+
|
|
19
|
+
The package follows a familiar Stackline settings contract while staying idiomatic for Vue 2: bind with `v-model`, pass `:data`, customize behavior through `:settings`, and listen for `@select`, `@de-select`, `@select-all`, `@de-select-all`, `@open`, and `@close`.
|
|
20
|
+
|
|
21
|
+
## Vue Version Compatibility
|
|
22
|
+
|
|
23
|
+
| Package family | Vue family | Peer range | First tested runtime | Demo link |
|
|
24
|
+
| :---: | :---: | :---: | :---: | :--- |
|
|
25
|
+
| **2.x** | **Vue 2 only** | **`>=2.0.0 <3.0.0`** | **2.0.0** | [Vue 2 family docs](https://alexandro.net/docs/vue/multiselect/vue-2/) |
|
|
26
|
+
|
|
27
|
+
## Installation
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
npm install @stackline/vue-multiselect-dropdown@2.0.0 --save-exact
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Setup
|
|
34
|
+
|
|
35
|
+
```js
|
|
36
|
+
import Vue from 'vue';
|
|
37
|
+
import {
|
|
38
|
+
VueMultiselect,
|
|
39
|
+
VueMultiselectDropdown
|
|
40
|
+
} from '@stackline/vue-multiselect-dropdown';
|
|
41
|
+
|
|
42
|
+
Vue.use(VueMultiselect);
|
|
43
|
+
|
|
44
|
+
new Vue({
|
|
45
|
+
el: '#app',
|
|
46
|
+
components: { VueMultiselectDropdown },
|
|
47
|
+
data() {
|
|
48
|
+
return {
|
|
49
|
+
countries: [
|
|
50
|
+
{ id: 1, itemName: 'Brazil' },
|
|
51
|
+
{ id: 2, itemName: 'Canada' },
|
|
52
|
+
{ id: 3, itemName: 'Portugal' }
|
|
53
|
+
],
|
|
54
|
+
selectedCountries: [],
|
|
55
|
+
settings: {
|
|
56
|
+
text: 'Select countries',
|
|
57
|
+
enableSearchFilter: true,
|
|
58
|
+
primaryKey: 'id',
|
|
59
|
+
labelKey: 'itemName',
|
|
60
|
+
badgeShowLimit: 3,
|
|
61
|
+
skin: 'classic'
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
```html
|
|
69
|
+
<vue-multiselect-dropdown
|
|
70
|
+
:data="countries"
|
|
71
|
+
v-model="selectedCountries"
|
|
72
|
+
:settings="settings"
|
|
73
|
+
/>
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Skins
|
|
77
|
+
|
|
78
|
+
Use `settings.skin` for `classic`, `material`, `dark`, `custom`, and `brand`.
|
|
79
|
+
|
|
80
|
+
`settings.theme` is accepted only as a compatibility alias. Prefer `settings.skin` in new code.
|
|
81
|
+
|
|
82
|
+
## Dialogs and Overflow Containers
|
|
83
|
+
|
|
84
|
+
Use `appendToBody: true` or `tagToBody: true` when the dropdown is inside dialogs, modals, drawers, or containers that set `overflow: hidden` or `overflow: auto`.
|
|
85
|
+
|
|
86
|
+
```js
|
|
87
|
+
settings: {
|
|
88
|
+
text: 'Dialog dropdown',
|
|
89
|
+
enableSearchFilter: true,
|
|
90
|
+
skin: 'material',
|
|
91
|
+
appendToBody: true,
|
|
92
|
+
tagToBody: true,
|
|
93
|
+
autoPosition: true
|
|
94
|
+
}
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
With body overlay enabled, the open panel is moved to `document.body`, aligned to the original trigger, sized to the trigger, recalculated on open, scroll, resize, and selection changes, then restored and cleaned up when the dropdown closes or unmounts.
|
|
98
|
+
|
|
99
|
+
## Events
|
|
100
|
+
|
|
101
|
+
- `input`
|
|
102
|
+
- `change`
|
|
103
|
+
- `select`
|
|
104
|
+
- `de-select`
|
|
105
|
+
- `select-all`
|
|
106
|
+
- `de-select-all`
|
|
107
|
+
- `group-select`
|
|
108
|
+
- `group-de-select`
|
|
109
|
+
- `scroll-to-end`
|
|
110
|
+
- `add-filter-new-item`
|
|
111
|
+
- `open`
|
|
112
|
+
- `close`
|
|
113
|
+
|
|
114
|
+
## Instance Methods
|
|
115
|
+
|
|
116
|
+
```js
|
|
117
|
+
this.$refs.dropdown.openDropdown();
|
|
118
|
+
this.$refs.dropdown.closeDropdown();
|
|
119
|
+
this.$refs.dropdown.focusSearch();
|
|
120
|
+
this.$refs.dropdown.selectAll();
|
|
121
|
+
this.$refs.dropdown.clearSelection();
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
## Run Locally
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
npm install
|
|
128
|
+
npm run build
|
|
129
|
+
npm test
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
Vue 2 docs:
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
cd docs-src/vue-2
|
|
136
|
+
npm install
|
|
137
|
+
npm run build
|
|
138
|
+
```
|
|
139
|
+
|
|
140
|
+
## License
|
|
141
|
+
|
|
142
|
+
MIT
|