vue3-extended-multiselect 3.0.2 → 3.0.4

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/README.md CHANGED
@@ -1,315 +1,315 @@
1
- # vue3-extended-multiselect v3.0.2
2
-
3
- ---
4
-
5
- ### Brief annotation
6
-
7
- **vue3-extended-multiselect** is a component designed to simplify the custom configuration of the built-in select element. By leveraging its built-in themes, this component allows developers to avoid writing extensive CSS rules. It also eliminates common issues associated with handling different types of option data.
8
-
9
- The component enhances the options list with various decorative slots, enabling developers to create a more informative and intuitive interface. Furthermore, it performs thorough filtering on the raw options list provided by the developer, preventing unexpected errors from unintended option formats. Switchable, helpful warnings assist in identifying potential errors during development.
10
-
11
- For user convenience, the component includes tools to manage selected options, controlling the number displayed and allowing for quick deselection. Developers can also customize these tools to fit their specific needs. With various slots available, developers can freely customize the options list, the selected tags in multiple-select mode, and other interactive elements.
12
-
13
- You can integrate this component into your web applications built with the Vue 3 framework.\*\*
14
-
15
- ### Page with live examples
16
-
17
- https://vue3-extended-multiselect.surge.sh/
18
-
19
- ### Installation with npm
20
-
21
- ```bash
22
- npm install vue3-extended-multiselect
23
- ```
24
-
25
- ### Installation with yarn
26
-
27
- ```bash
28
- yarn add vue3-extended-multiselect
29
- ```
30
-
31
- ### Installation with pnpm
32
-
33
- ```bash
34
- pnpm add vue3-extended-multiselect
35
- ```
36
-
37
- ### Importing
38
-
39
- ```js
40
- import Vue3ExtendedMultiselect from "vue3-extended-multiselect";
41
- ```
42
-
43
- ### Importing types
44
-
45
- ```js
46
- import type { UnionOptionType } from "vue3-extended-multiselect";
47
- ```
48
-
49
- ### Usage with UMD
50
-
51
- _Somewhere in your markup..._
52
-
53
- ```html
54
- <script src="./public/scripts/vue3-extended-multiselect/index.umd.js"></script>
55
- ```
56
-
57
- _Somewhere in your script below..._
58
-
59
- ```js
60
- const YourComponent = defineComponent({
61
- name: "YourComponent",
62
- components: {
63
- Vue3ExtendedMultiselect: window.Vue3ExtendedMultiselect,
64
- },
65
- });
66
- ```
67
-
68
- ## Table of contents
69
-
70
- - [Props list](#props-list)
71
- - [Slots list](#slots-list)
72
- - [Events list](#events-list)
73
- - [Styling with css](#styling-with-css)
74
- - [Styling with props](#styling-with-props)
75
- - [License](#license)
76
-
77
- ## Props list
78
-
79
- | Prop name | Prop type | Prop appointment | Prop default value | Prop values |
80
- | ----------------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
81
- | **autoSelect<br/>CreatedOption** | Boolean | Determines whether to select just now created option automatically. | false | &mdash; |
82
- | **autoSelect<br/>SearchValue** | Boolean | Determines whether to take search value from current selected option if "multiple" prop equals false. | false | &mdash; |
83
- | **clearBySelect<br/>WhenMultiple** | Boolean | Determines whether to clear search field by option selection. | false | &mdash; |
84
- | **createOnThe<br/>Go** | Boolean | Allows user to create new options from search field. | false | &mdash; |
85
- | **default<br/>Expanded** | Boolean | Determines whether options list should be expanded by default. | false | &mdash; |
86
- | **disabled** | Boolean | Disables extended multiselect. | false | &mdash; |
87
- | **dropdownDisabled** | Boolean | Disables dropdown toggle. | false | &mdash; |
88
- | **highlight<br/>Options** | Boolean | Switches options highlighting while hovering. | true | &mdash; |
89
- | **loading** | Boolean | Switches loading state of extended multiselect. | false | &mdash; |
90
- | **multiple** | Boolean | Allows user to select multiple options. | false | &mdash; |
91
- | **noResults<br/>BlockShown** | Boolean | Determines whether to show special hint if no options were found. | true | &mdash; |
92
- | **resetSearch<br/>ByValue** | Boolean | Determines whether to clear search field by selection/deselection of options. | true | &mdash; |
93
- | **searchFilter<br/>Active** | Boolean | Allows user to use internal search for options. | true | &mdash; |
94
- | **simpleEvents** | Boolean | Switches full payload of extended multiselect events. | true | &mdash; |
95
- | **selected<br/>Options<br/>Shown** | Boolean | Determines whether to show selected options in options list. | false | &mdash; |
96
- | **showClearIcon** | Boolean | Allows user to deselect all options by special icon. | false | &mdash; |
97
- | **showDeselect<br/>IconLoader** | Boolean | Determines whether to show loader icon in multiple options block if "loading" prop equals true | true | &mdash; |
98
- | **showInsert<br/>Warnings** | Boolean | Determines whether to show useful internal warnings in console. | false | &mdash; |
99
- | **showMarker** | Boolean | Determines whether to show slot with special marker beside option in options list. | false | &mdash; |
100
- | **showSearch<br/>Field** | Boolean | Determines whether to show search field which allows user to search for options with internal search. | true | &mdash; |
101
- | **toggleMultiple<br/>BlocksLimit** | Boolean | Allows user to increase limit of shown elements with selected options by special icon. | false | &mdash; |
102
- | **toggleOptions<br/>BySelect** | Boolean | Determines whether to roll up options list by selection of option. | true | &mdash; |
103
- | **togglingSaves<br/>SearchValue** | Boolean | Determines whether to save current search value if display of options list was toggled. | true | &mdash; |
104
- | **wrongCurrent<br/>Value** | Boolean | Determines whether to define special class for extended multiselect if value is wrong or if irregularity of value is defined by user. | false | &mdash; |
105
- | **createOption<br/>Placeholder** | String | Placeholder for the search field to be used if user is allowed to create new options. | "Select or create features" | &mdash; |
106
- | **createOption<br/>Type** | String | Defines kind for all options which will be created by user. | "primitive" | "primitive", "array", "object" |
107
- | **disableByField** | String | Determines a field in options of type "object" which value will be used to disable such options. | "disabled" | &mdash; |
108
- | **emptyObjects<br/>Placeholder** | String | Placeholder for options of type "object" or Array instances which length/keys length equals 0. | "Empty Object/<br/>Array" | &mdash; |
109
- | **errorBorder<br/>Color** | String | Defines "border-color" css-property for extended multiselect with wrong value. | "#FF0000" | &mdash; |
110
- | **iconFilter** | String | Defines svg-filter with color settings for all icons except loader. | "basic" | "basic", "black", "green" |
111
- | **iconSize** | String | Defines sizes for all icons in pixels except loader. | "large" | "large", "medium", "small" |
112
- | **label** | String | Defines field in options of type "object" that will be the label of option. | "label" | &mdash; |
113
- | **loaderIcon<br/>Filter** | String | Defines svg-filter with color settings for loader icon. | "loader-default" | "loader-default", "basic", "slate-grey", "slate-blue", "teal",<br/> "strict" |
114
- | **placeholder** | String | Placeholder for search field to be used if user is not allowed to create new options. | "Select features" | &mdash; |
115
- | **searchByField** | String | Determines field in options of type "object" to use in internal search. | "" | &mdash; |
116
- | **themeType** | String | Defines overall color theme for extended multiselect. | "basic" | "basic", "slate-grey", "slate-blue", "teal",<br/> "strict" |
117
- | **toggle<br/>Appearance<br/>Side** | String | Defines which side options list will be displayed on. | "auto" | "auto", "atop", "under" |
118
- | **toggleIcon** | String | Defines kind of toggle icon from icons collection. | "base-arrow" | "base-arrow", "double-arrow", "wide-arrow", "circle-arrow", "inner-arrow", "triangle-arrow", "triangle-circle-arrow" |
119
- | **anyOption<br/>Wrapper<br/>BlockHeight** | Number | Defines "height" css-property for each option in options list. | 30 | &mdash; |
120
- | **increase<br/>Display<br/>By** | Number | Defines gap which increases limit of displayed elements with selected options. | 5 | &mdash; |
121
- | **maxOptions<br/>Count** | Number | Maximal limit of selected options. | null | &mdash; |
122
- | **minOptions<br/>Count** | Number | Minimal limit of selected options. | null | &mdash; |
123
- | **multipleBlocks<br/>Limit** | Number | Defines limit of displayed elements with selected options. | null | &mdash; |
124
- | **optionsCount<br/>Restriction** | Number | Defines maximal limit of options list length. | null | &mdash; |
125
- | **toggleMax<br/>Height** | Number | Defines maximal value in pixels of "max-height" css-property for options list. | 400 | &mdash; |
126
- | **toggleMin<br/>Height** | Number | Defines minimal value in pixels of "max-height" css-property for options list. | null | &mdash; |
127
- | **createOption<br/>Fields** | Array | Defines a list of fields for options of type "object" created by user. | ["label"] | &mdash; |
128
- | **disabled<br/>Primitive<br/>Options** | Array | Defines a list of primitive options which will be disabled for selection. | [] | &mdash; |
129
- | **options** | Array | Raw options list. | [] | &mdash; |
130
- | **optionsPadding** | Array | Defines a list with "padding-top", "padding-left", "padding-bottom" and "padding-right" css-properties for options in options list. Property "padding-top" matches index zero. Property "padding-right" matches index three. | [] | &mdash; |
131
- | **preselected<br/>Options** | Array | Defines a list of options that will be select by default. | [] | &mdash; |
132
- | **specialKeys<br/>Block** | Array | Defines a list of keys which in combination with mouse buttons or "enter" key will prevent selection of option. | [] | "alt",<br/> "ctrl",<br/> "shift" |
133
- | **createCustom<br/>OptionLabel** | Function | Defines function that creates custom label for each option. | (option) => null | &mdash; |
134
- | **multipleBlocks<br/>LimitMessage** | Function | Defines function that creates notification when maximal limit of selected options has been reached. | (number) => \`and ${number} more items\` | &mdash; |
135
- | **inputId** | String, Number | "id" attribute of search field. | null | &mdash; |
136
- | **preselected<br/>Option** | UnionPropType (from types) | Defines options that will be select by default. | null | &mdash; |
137
- | **value** | Array | Defines value of extended multiselect that can be used in "v-model". | [] | &mdash; |
138
-
139
- ## Slots list
140
-
141
- | Slot name | Slot appointment | Slot scope |
142
- | ------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
143
- | **cancel** | Button that deselects all options. | `cancel` — function that deselects all options |
144
- | **labelBlock** | Element with single selected option that is shown if search field display is disabled. | `labelBlockValue` — option label |
145
- | **lessThanLimit** | Message displayed if minimal limit of selected options has not been reached. | &mdash; |
146
- | **listHeader** | Element at the top of options list for information content. | &mdash; |
147
- | **listFooter** | Element at the bottom of options list for information content. | &mdash; |
148
- | **marker** | Marker that indicates state of option selection. | `selected` — flag to determine markers for selected options |
149
- | **maxElements** | Message displayed if maximal limit of elements with selected options has been shown. | &mdash; |
150
- | **moreThanLimit** | Message displayed if maximal limit of selected options has been reached. | &mdash; |
151
- | **multipleBlocks** | Block with selected options and other multiple select slots | `selectedOptions` — list of selected options,<br/>`deselectBlock` — function that deselects option and removes element that contained it |
152
- | **noResults** | Message displayed if no options have been found by internal search. | &mdash; |
153
- | **noOptions** | Message displayed if given options list is empty. | &mdash; |
154
- | **option** | Option in options list with its label. | `option` — option from options list,<br/>`createCustomOptionLabel` — function that creates custom label for each option |
155
- | **optionBlock** | Element with selected option and its label. | `label` — option label,<br/>`deselectBlock` — function that deselects option and removes element that contained it,<br/>`index` — option index |
156
- | **showMore** | Button that increases limit of displayed elements with selected options. | `showMoreOptions` — function that increases limit of displayed elements with selected options |
157
- | **toggle** | Button that toggles options list display. | `toggleOptionsList` — function that toggles options list display |
158
-
159
- ## Events list
160
-
161
- | Event name | Event appointment | Listener method | Simplified event payload | Fields of object with full event payload |
162
- | ------------------- | --------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
163
- | **pattern-changed** | Change value of search field. | @pattern-changed | `value` — pattern of inner search for available options | `value` — pattern of inner search for available options,<br/>`inputId` — id of search field set by "id" prop |
164
- | **select** | Selection of option. | @select | `option` — just now selected option | `option` — just now selected option,<br/>`inputId` — id of search field set by "id" prop |
165
- | **clean** | Removal of all options or singe option. | @clean | `option/options` — just now deselected option or array with just now deselected options | `option/options` — just now deselected option or array with just now deselected options,<br/>`inputId` — id of search field set by "id" prop |
166
- | **option-created** | Creation of new option by user. | @option-created | `option` — option created by user | `option/options` — option created by user,<br/>`inputId` — id of search field set by "id" prop |
167
- | **active** | Dropdown options list expanding. | @active | &mdash; | `inputId` — id of search field set by "id" prop |
168
- | **close** | Rolling up dropdown options list. | @close | `options` — array of selected options | `options` — array of selected options,<br/>`inputId` — id of search field set by "id" prop |
169
- | **increase** | Increasing current limit of displayed elements with selected options. | @increase | `limit` — current limit of options to be shown next | `limit` — current limit of options to be shown next,<br/>`inputId` — id of search field set by "id" prop |
170
-
171
- ## Styling with css
172
-
173
- Vue3 extended multiselect provides following css-variables:
174
-
175
- ```css
176
- --basic-color: #708090;
177
- --basic-transparent: rgba(112, 128, 144, 0.6);
178
- --cancel: #b22222;
179
- --cancel-backgound-color: rgba(179, 33, 33, 0.1);
180
- --dark-slate-blue: #483d8b;
181
- --dark-slate-blue-transparent: rgba(72, 61, 139, 0.6);
182
- --dark-slate-grey: #2f4f4f;
183
- --dark-slate-grey-transparent: rgba(47, 79, 79, 0.6);
184
- --disabled: rgba(176, 176, 176, 0.6);
185
- --hover-color: #ffffff;
186
- --loader-color: #00bfff;
187
- --strict: #000000;
188
- --strict-transparent: rgba(0, 0, 0, 0.6);
189
- --teal: #008080;
190
- --teal-transparent: rgba(0, 128, 128, 0.6);
191
-
192
- --block-border-radius: 4px;
193
- --block-cancel-padding: 4px;
194
- --block-gap: 6px;
195
- --block-padding: 1px 3px 1px 7px;
196
- --border-radius: 6px;
197
- --border-radius-small: 3px;
198
- --cancel-padding: 3px 8px;
199
- --grid-columns: 1fr 36px 36px;
200
- --grid-rows: 1fr 36px;
201
- --half-size: 50%;
202
- --icon-size-block: 14px;
203
- --icon-size-large: 18px;
204
- --icon-size-medium: 15px;
205
- --icon-size-small: 12px;
206
- --increaser-padding: 3px 7px;
207
- --max-size: 100%;
208
- --min-block-height: 25px;
209
- --options-padding: 6px 0;
210
- --outer-gap: 10px;
211
- --root-padding: 6px 10px;
212
- --toggle-icon-gap: 1px;
213
- --wide-text: 700;
214
- --wrapper-padding: 5px 10px;
215
- --z-index-options: 10;
216
-
217
- --border: 1px solid;
218
- --default-cursor: default;
219
- --icons-align-self: center;
220
- --icons-justify-self: center;
221
- --pointer-cursor: pointer;
222
- --wrapper-transition: border-top-left-radius 250ms ease 0s, border-top-right-radius 250ms
223
- ease 0s, border-bottom-left-radius 250ms ease-out, border-bottom-right-radius 250ms
224
- ease-out;
225
- ```
226
-
227
- You can override it globally or by particular instance class name.
228
-
229
- ```html
230
- <vue3-extended-multiselect class="instance-class" />
231
- ```
232
-
233
- ```html
234
- <style scoped>
235
- .instance-class {
236
- --basic-color: purple;
237
- --outer-gap: 2rem;
238
- --border: 1px dotted;
239
- }
240
- </style>
241
- ```
242
-
243
- ## Styling with props
244
-
245
- Vue3 extended multiselect provides following props for customizing:
246
-
247
- - errorBorderColor
248
- - iconFilter
249
- - iconSize
250
- - loaderIconFilter
251
- - themeType
252
- - toggleIcon
253
- - anyOptionWrapperBlockHeight
254
- - toggleMaxHeight
255
- - toggleMinHeight
256
-
257
- #### Customizing examples
258
-
259
- Changing border color when extended multiselect value is invalid.
260
-
261
- ```html
262
- <vue3-extended-multiselect error-border-color="#8B0000" />
263
- ```
264
-
265
- Changing svg color filter for icons.
266
-
267
- ```html
268
- <vue3-extended-multiselect icon-filter="green" />
269
- ```
270
-
271
- Resizing icons.
272
-
273
- ```html
274
- <vue3-extended-multiselect icon-size="small" />
275
- ```
276
-
277
- Changing svg color filter for loader icon.
278
-
279
- ```html
280
- <vue3-extended-multiselect icon-size="small" />
281
- ```
282
-
283
- Changing general color theme of extended multiselect.
284
-
285
- ```html
286
- <vue3-extended-multiselect theme-type="slate-blue" />
287
- ```
288
-
289
- Changing toggle icon form.
290
-
291
- ```html
292
- <vue3-extended-multiselect toggle-icon="triangle-arrow" />
293
- ```
294
-
295
- Resizing option blocks in options list.
296
-
297
- ```html
298
- <vue3-extended-multiselect :any-option-wrapper-block-height="60" />
299
- ```
300
-
301
- Changing "max-height" css-property of options list.
302
-
303
- ```html
304
- <vue3-extended-multiselect :toggle-max-height="500" />
305
- ```
306
-
307
- Changing "min-height" css-property of options list.
308
-
309
- ```html
310
- <vue3-extended-multiselect :toggle-min-height="500" />
311
- ```
312
-
313
- ## License
314
-
315
- [MIT](LICENSE)
1
+ # vue3-extended-multiselect v3.0.4
2
+
3
+ ---
4
+
5
+ ### Brief annotation
6
+
7
+ **vue3-extended-multiselect** is a component designed to simplify the custom configuration of the built-in select element. By leveraging its built-in themes, this component allows developers to avoid writing extensive CSS rules. It also eliminates common issues associated with handling different types of option data.
8
+
9
+ The component enhances the options list with various decorative slots, enabling developers to create a more informative and intuitive interface. Furthermore, it performs thorough filtering on the raw options list provided by the developer, preventing unexpected errors from unintended option formats. Switchable, helpful warnings assist in identifying potential errors during development.
10
+
11
+ For user convenience, the component includes tools to manage selected options, controlling the number displayed and allowing for quick deselection. Developers can also customize these tools to fit their specific needs. With various slots available, developers can freely customize the options list, the selected tags in multiple-select mode, and other interactive elements.
12
+
13
+ You can integrate this component into your web applications built with the Vue 3 framework.\*\*
14
+
15
+ ### Page with live examples
16
+
17
+ https://vue3-extended-multiselect.surge.sh/
18
+
19
+ ### Installation with npm
20
+
21
+ ```bash
22
+ npm install vue3-extended-multiselect
23
+ ```
24
+
25
+ ### Installation with yarn
26
+
27
+ ```bash
28
+ yarn add vue3-extended-multiselect
29
+ ```
30
+
31
+ ### Installation with pnpm
32
+
33
+ ```bash
34
+ pnpm add vue3-extended-multiselect
35
+ ```
36
+
37
+ ### Importing
38
+
39
+ ```js
40
+ import Vue3ExtendedMultiselect from "vue3-extended-multiselect";
41
+ ```
42
+
43
+ ### Importing types
44
+
45
+ ```js
46
+ import type { UnionOptionType } from "vue3-extended-multiselect";
47
+ ```
48
+
49
+ ### Usage with UMD
50
+
51
+ _Somewhere in your markup..._
52
+
53
+ ```html
54
+ <script src="./public/scripts/vue3-extended-multiselect/index.umd.js"></script>
55
+ ```
56
+
57
+ _Somewhere in your script below..._
58
+
59
+ ```js
60
+ const YourComponent = defineComponent({
61
+ name: "YourComponent",
62
+ components: {
63
+ Vue3ExtendedMultiselect: window.Vue3ExtendedMultiselect,
64
+ },
65
+ });
66
+ ```
67
+
68
+ ## Table of contents
69
+
70
+ - [Props list](#props-list)
71
+ - [Slots list](#slots-list)
72
+ - [Events list](#events-list)
73
+ - [Styling with css](#styling-with-css)
74
+ - [Styling with props](#styling-with-props)
75
+ - [License](#license)
76
+
77
+ ## Props list
78
+
79
+ | Prop name | Prop type | Prop appointment | Prop default value | Prop values |
80
+ | ----------------------------------------- | -------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ---------------------------------------- | -------------------------------------------------------------------------------------------------------------------- |
81
+ | **autoSelect<br/>CreatedOption** | Boolean | Determines whether to select just now created option automatically. | false | &mdash; |
82
+ | **autoSelect<br/>SearchValue** | Boolean | Determines whether to take search value from current selected option if "multiple" prop equals false. | false | &mdash; |
83
+ | **clearBySelect<br/>WhenMultiple** | Boolean | Determines whether to clear search field by option selection. | false | &mdash; |
84
+ | **createOnThe<br/>Go** | Boolean | Allows user to create new options from search field. | false | &mdash; |
85
+ | **default<br/>Expanded** | Boolean | Determines whether options list should be expanded by default. | false | &mdash; |
86
+ | **disabled** | Boolean | Disables extended multiselect. | false | &mdash; |
87
+ | **dropdownDisabled** | Boolean | Disables dropdown toggle. | false | &mdash; |
88
+ | **highlight<br/>Options** | Boolean | Switches options highlighting while hovering. | true | &mdash; |
89
+ | **loading** | Boolean | Switches loading state of extended multiselect. | false | &mdash; |
90
+ | **multiple** | Boolean | Allows user to select multiple options. | false | &mdash; |
91
+ | **noResults<br/>BlockShown** | Boolean | Determines whether to show special hint if no options were found. | true | &mdash; |
92
+ | **resetSearch<br/>ByValue** | Boolean | Determines whether to clear search field by selection/deselection of options. | true | &mdash; |
93
+ | **searchFilter<br/>Active** | Boolean | Allows user to use internal search for options. | true | &mdash; |
94
+ | **simpleEvents** | Boolean | Switches full payload of extended multiselect events. | true | &mdash; |
95
+ | **selected<br/>Options<br/>Shown** | Boolean | Determines whether to show selected options in options list. | false | &mdash; |
96
+ | **showClearIcon** | Boolean | Allows user to deselect all options by special icon. | false | &mdash; |
97
+ | **showDeselect<br/>IconLoader** | Boolean | Determines whether to show loader icon in multiple options block if "loading" prop equals true | true | &mdash; |
98
+ | **showInsert<br/>Warnings** | Boolean | Determines whether to show useful internal warnings in console. | false | &mdash; |
99
+ | **showMarker** | Boolean | Determines whether to show slot with special marker beside option in options list. | false | &mdash; |
100
+ | **showSearch<br/>Field** | Boolean | Determines whether to show search field which allows user to search for options with internal search. | true | &mdash; |
101
+ | **toggleMultiple<br/>BlocksLimit** | Boolean | Allows user to increase limit of shown elements with selected options by special icon. | false | &mdash; |
102
+ | **toggleOptions<br/>BySelect** | Boolean | Determines whether to roll up options list by selection of option. | true | &mdash; |
103
+ | **togglingSaves<br/>SearchValue** | Boolean | Determines whether to save current search value if display of options list was toggled. | true | &mdash; |
104
+ | **wrongCurrent<br/>Value** | Boolean | Determines whether to define special class for extended multiselect if value is wrong or if irregularity of value is defined by user. | false | &mdash; |
105
+ | **createOption<br/>Placeholder** | String | Placeholder for the search field to be used if user is allowed to create new options. | "Select or create features" | &mdash; |
106
+ | **createOption<br/>Type** | String | Defines kind for all options which will be created by user. | "primitive" | "primitive", "array", "object" |
107
+ | **disableByField** | String | Determines a field in options of type "object" which value will be used to disable such options. | "disabled" | &mdash; |
108
+ | **emptyObjects<br/>Placeholder** | String | Placeholder for options of type "object" or Array instances which length/keys length equals 0. | "Empty Object/<br/>Array" | &mdash; |
109
+ | **errorBorder<br/>Color** | String | Defines "border-color" css-property for extended multiselect with wrong value. | "#FF0000" | &mdash; |
110
+ | **iconFilter** | String | Defines svg-filter with color settings for all icons except loader. | "basic" | "basic", "black", "green" |
111
+ | **iconSize** | String | Defines sizes for all icons in pixels except loader. | "large" | "large", "medium", "small" |
112
+ | **label** | String | Defines field in options of type "object" that will be the label of option. | "label" | &mdash; |
113
+ | **loaderIcon<br/>Filter** | String | Defines svg-filter with color settings for loader icon. | "loader-default" | "loader-default", "basic", "slate-grey", "slate-blue", "teal",<br/> "strict" |
114
+ | **placeholder** | String | Placeholder for search field to be used if user is not allowed to create new options. | "Select features" | &mdash; |
115
+ | **searchByField** | String | Determines field in options of type "object" to use in internal search. | "" | &mdash; |
116
+ | **themeType** | String | Defines overall color theme for extended multiselect. | "basic" | "basic", "slate-grey", "slate-blue", "teal",<br/> "strict" |
117
+ | **toggle<br/>Appearance<br/>Side** | String | Defines which side options list will be displayed on. | "auto" | "auto", "atop", "under" |
118
+ | **toggleIcon** | String | Defines kind of toggle icon from icons collection. | "base-arrow" | "base-arrow", "double-arrow", "wide-arrow", "circle-arrow", "inner-arrow", "triangle-arrow", "triangle-circle-arrow" |
119
+ | **anyOption<br/>Wrapper<br/>BlockHeight** | Number | Defines "height" css-property for each option in options list. | 30 | &mdash; |
120
+ | **increase<br/>Display<br/>By** | Number | Defines gap which increases limit of displayed elements with selected options. | 5 | &mdash; |
121
+ | **maxOptions<br/>Count** | Number | Maximal limit of selected options. | null | &mdash; |
122
+ | **minOptions<br/>Count** | Number | Minimal limit of selected options. | null | &mdash; |
123
+ | **multipleBlocks<br/>Limit** | Number | Defines limit of displayed elements with selected options. | null | &mdash; |
124
+ | **optionsCount<br/>Restriction** | Number | Defines maximal limit of options list length. | null | &mdash; |
125
+ | **toggleMax<br/>Height** | Number | Defines maximal value in pixels of "max-height" css-property for options list. | 400 | &mdash; |
126
+ | **toggleMin<br/>Height** | Number | Defines minimal value in pixels of "max-height" css-property for options list. | null | &mdash; |
127
+ | **createOption<br/>Fields** | Array | Defines a list of fields for options of type "object" created by user. | ["label"] | &mdash; |
128
+ | **disabled<br/>Primitive<br/>Options** | Array | Defines a list of primitive options which will be disabled for selection. | [] | &mdash; |
129
+ | **options** | Array | Raw options list. | [] | &mdash; |
130
+ | **optionsPadding** | Array | Defines a list with "padding-top", "padding-left", "padding-bottom" and "padding-right" css-properties for options in options list. Property "padding-top" matches index zero. Property "padding-right" matches index three. | [] | &mdash; |
131
+ | **preselected<br/>Options** | Array | Defines a list of options that will be select by default. | [] | &mdash; |
132
+ | **specialKeys<br/>Block** | Array | Defines a list of keys which in combination with mouse buttons or "enter" key will prevent selection of option. | [] | "alt",<br/> "ctrl",<br/> "shift" |
133
+ | **createCustom<br/>OptionLabel** | Function | Defines function that creates custom label for each option. | (option) => null | &mdash; |
134
+ | **multipleBlocks<br/>LimitMessage** | Function | Defines function that creates notification when maximal limit of selected options has been reached. | (number) => \`and ${number} more items\` | &mdash; |
135
+ | **inputId** | String, Number | "id" attribute of search field. | null | &mdash; |
136
+ | **preselected<br/>Option** | UnionPropType (from types) | Defines options that will be select by default. | null | &mdash; |
137
+ | **value** | Array | Defines value of extended multiselect that can be used in "v-model". | [] | &mdash; |
138
+
139
+ ## Slots list
140
+
141
+ | Slot name | Slot appointment | Slot scope |
142
+ | ------------------ | -------------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
143
+ | **cancel** | Button that deselects all options. | `cancel` — function that deselects all options |
144
+ | **labelBlock** | Element with single selected option that is shown if search field display is disabled. | `labelBlockValue` — option label |
145
+ | **lessThanLimit** | Message displayed if minimal limit of selected options has not been reached. | &mdash; |
146
+ | **listHeader** | Element at the top of options list for information content. | &mdash; |
147
+ | **listFooter** | Element at the bottom of options list for information content. | &mdash; |
148
+ | **marker** | Marker that indicates state of option selection. | `selected` — flag to determine markers for selected options |
149
+ | **maxElements** | Message displayed if maximal limit of elements with selected options has been shown. | &mdash; |
150
+ | **moreThanLimit** | Message displayed if maximal limit of selected options has been reached. | &mdash; |
151
+ | **multipleBlocks** | Block with selected options and other multiple select slots | `selectedOptions` — list of selected options,<br/>`deselectBlock` — function that deselects option and removes element that contained it |
152
+ | **noResults** | Message displayed if no options have been found by internal search. | &mdash; |
153
+ | **noOptions** | Message displayed if given options list is empty. | &mdash; |
154
+ | **option** | Option in options list with its label. | `option` — option from options list,<br/>`createCustomOptionLabel` — function that creates custom label for each option |
155
+ | **optionBlock** | Element with selected option and its label. | `label` — option label,<br/>`deselectBlock` — function that deselects option and removes element that contained it,<br/>`index` — option index |
156
+ | **showMore** | Button that increases limit of displayed elements with selected options. | `showMoreOptions` — function that increases limit of displayed elements with selected options |
157
+ | **toggle** | Button that toggles options list display. | `toggleOptionsList` — function that toggles options list display |
158
+
159
+ ## Events list
160
+
161
+ | Event name | Event appointment | Listener method | Simplified event payload | Fields of object with full event payload |
162
+ | ------------------- | --------------------------------------------------------------------- | ---------------- | --------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
163
+ | **pattern-changed** | Change value of search field. | @pattern-changed | `value` — pattern of inner search for available options | `value` — pattern of inner search for available options,<br/>`inputId` — id of search field set by "id" prop |
164
+ | **select** | Selection of option. | @select | `option` — just now selected option | `option` — just now selected option,<br/>`inputId` — id of search field set by "id" prop |
165
+ | **clean** | Removal of all options or singe option. | @clean | `option/options` — just now deselected option or array with just now deselected options | `option/options` — just now deselected option or array with just now deselected options,<br/>`inputId` — id of search field set by "id" prop |
166
+ | **option-created** | Creation of new option by user. | @option-created | `option` — option created by user | `option/options` — option created by user,<br/>`inputId` — id of search field set by "id" prop |
167
+ | **active** | Dropdown options list expanding. | @active | &mdash; | `inputId` — id of search field set by "id" prop |
168
+ | **close** | Rolling up dropdown options list. | @close | `options` — array of selected options | `options` — array of selected options,<br/>`inputId` — id of search field set by "id" prop |
169
+ | **increase** | Increasing current limit of displayed elements with selected options. | @increase | `limit` — current limit of options to be shown next | `limit` — current limit of options to be shown next,<br/>`inputId` — id of search field set by "id" prop |
170
+
171
+ ## Styling with css
172
+
173
+ Vue3 extended multiselect provides following css-variables:
174
+
175
+ ```css
176
+ --basic-color: #708090;
177
+ --basic-transparent: rgba(112, 128, 144, 0.6);
178
+ --cancel: #b22222;
179
+ --cancel-backgound-color: rgba(179, 33, 33, 0.1);
180
+ --dark-slate-blue: #483d8b;
181
+ --dark-slate-blue-transparent: rgba(72, 61, 139, 0.6);
182
+ --dark-slate-grey: #2f4f4f;
183
+ --dark-slate-grey-transparent: rgba(47, 79, 79, 0.6);
184
+ --disabled: rgba(176, 176, 176, 0.6);
185
+ --hover-color: #ffffff;
186
+ --loader-color: #00bfff;
187
+ --strict: #000000;
188
+ --strict-transparent: rgba(0, 0, 0, 0.6);
189
+ --teal: #008080;
190
+ --teal-transparent: rgba(0, 128, 128, 0.6);
191
+
192
+ --block-border-radius: 4px;
193
+ --block-cancel-padding: 4px;
194
+ --block-gap: 6px;
195
+ --block-padding: 1px 3px 1px 7px;
196
+ --border-radius: 6px;
197
+ --border-radius-small: 3px;
198
+ --cancel-padding: 3px 8px;
199
+ --grid-columns: 1fr 36px 36px;
200
+ --grid-rows: 1fr 36px;
201
+ --half-size: 50%;
202
+ --icon-size-block: 14px;
203
+ --icon-size-large: 18px;
204
+ --icon-size-medium: 15px;
205
+ --icon-size-small: 12px;
206
+ --increaser-padding: 3px 7px;
207
+ --max-size: 100%;
208
+ --min-block-height: 25px;
209
+ --options-padding: 6px 0;
210
+ --outer-gap: 10px;
211
+ --root-padding: 6px 10px;
212
+ --toggle-icon-gap: 1px;
213
+ --wide-text: 700;
214
+ --wrapper-padding: 5px 10px;
215
+ --z-index-options: 10;
216
+
217
+ --border: 1px solid;
218
+ --default-cursor: default;
219
+ --icons-align-self: center;
220
+ --icons-justify-self: center;
221
+ --pointer-cursor: pointer;
222
+ --wrapper-transition: border-top-left-radius 250ms ease 0s, border-top-right-radius 250ms
223
+ ease 0s, border-bottom-left-radius 250ms ease-out, border-bottom-right-radius 250ms
224
+ ease-out;
225
+ ```
226
+
227
+ You can override it globally or by particular instance class name.
228
+
229
+ ```html
230
+ <vue3-extended-multiselect class="instance-class" />
231
+ ```
232
+
233
+ ```html
234
+ <style scoped>
235
+ .instance-class {
236
+ --basic-color: purple;
237
+ --outer-gap: 2rem;
238
+ --border: 1px dotted;
239
+ }
240
+ </style>
241
+ ```
242
+
243
+ ## Styling with props
244
+
245
+ Vue3 extended multiselect provides following props for customizing:
246
+
247
+ - errorBorderColor
248
+ - iconFilter
249
+ - iconSize
250
+ - loaderIconFilter
251
+ - themeType
252
+ - toggleIcon
253
+ - anyOptionWrapperBlockHeight
254
+ - toggleMaxHeight
255
+ - toggleMinHeight
256
+
257
+ #### Customizing examples
258
+
259
+ Changing border color when extended multiselect value is invalid.
260
+
261
+ ```html
262
+ <vue3-extended-multiselect error-border-color="#8B0000" />
263
+ ```
264
+
265
+ Changing svg color filter for icons.
266
+
267
+ ```html
268
+ <vue3-extended-multiselect icon-filter="green" />
269
+ ```
270
+
271
+ Resizing icons.
272
+
273
+ ```html
274
+ <vue3-extended-multiselect icon-size="small" />
275
+ ```
276
+
277
+ Changing svg color filter for loader icon.
278
+
279
+ ```html
280
+ <vue3-extended-multiselect icon-size="small" />
281
+ ```
282
+
283
+ Changing general color theme of extended multiselect.
284
+
285
+ ```html
286
+ <vue3-extended-multiselect theme-type="slate-blue" />
287
+ ```
288
+
289
+ Changing toggle icon form.
290
+
291
+ ```html
292
+ <vue3-extended-multiselect toggle-icon="triangle-arrow" />
293
+ ```
294
+
295
+ Resizing option blocks in options list.
296
+
297
+ ```html
298
+ <vue3-extended-multiselect :any-option-wrapper-block-height="60" />
299
+ ```
300
+
301
+ Changing "max-height" css-property of options list.
302
+
303
+ ```html
304
+ <vue3-extended-multiselect :toggle-max-height="500" />
305
+ ```
306
+
307
+ Changing "min-height" css-property of options list.
308
+
309
+ ```html
310
+ <vue3-extended-multiselect :toggle-min-height="500" />
311
+ ```
312
+
313
+ ## License
314
+
315
+ [MIT](LICENSE)