vue3-extended-multiselect 1.3.0 → 1.4.1

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.
Files changed (44) hide show
  1. package/.browserslistrc +3 -3
  2. package/.eslintrc.js +34 -34
  3. package/.github/workflows/publish.yml +41 -41
  4. package/CHANGELOG.md +181 -157
  5. package/LICENSE +21 -21
  6. package/README.md +266 -266
  7. package/babel.config.js +5 -5
  8. package/index.js +2 -2
  9. package/jest.config.js +61 -61
  10. package/package.json +47 -48
  11. package/src/assets/base-arrow.svg +70 -70
  12. package/src/assets/cancel.svg +34 -34
  13. package/src/assets/circle-arrow.svg +7 -7
  14. package/src/assets/double-arrow.svg +39 -39
  15. package/src/assets/inner-arrow.svg +8 -8
  16. package/src/assets/loader.svg +5 -5
  17. package/src/assets/triangle-arrow.svg +72 -72
  18. package/src/assets/triangle-circle-arrow.svg +38 -38
  19. package/src/assets/wide-arrow.svg +72 -72
  20. package/src/components/ExtendedMultiselectCancel.vue +166 -166
  21. package/src/components/ExtendedMultiselectInput.vue +687 -686
  22. package/src/components/ExtendedMultiselectLoader.vue +182 -182
  23. package/src/components/ExtendedMultiselectMultiple.vue +320 -320
  24. package/src/components/ExtendedMultiselectOptions.vue +1144 -1144
  25. package/src/components/ExtendedMultiselectToggle.vue +273 -273
  26. package/src/components/Vue3ExtendedMultiselect.vue +1752 -1743
  27. package/src/composition/cancel.js +38 -35
  28. package/src/composition/image-path.js +16 -16
  29. package/src/composition/labels.js +41 -41
  30. package/src/composition/preselected-options.js +67 -67
  31. package/src/composition/search-value.js +33 -33
  32. package/src/composition/sizes.js +42 -42
  33. package/src/composition/toggle.js +33 -33
  34. package/src/events/LocalEmitter.js +32 -0
  35. package/src/events/emitter.js +3 -3
  36. package/src/sets/sets.js +99 -99
  37. package/src/styles/animations.css +18 -18
  38. package/src/styles/main.css +441 -441
  39. package/src/styles/variables.css +49 -49
  40. package/tests/unit/events.spec.js +138 -138
  41. package/tests/unit/props.spec.js +1099 -1099
  42. package/tests/utils/mount.js +37 -37
  43. package/tests/utils/utils.js +20 -20
  44. package/typings/vue3-extended-multiselect.d.ts +43 -43
package/README.md CHANGED
@@ -1,266 +1,266 @@
1
- # vue3-extended-multiselect v1.3.0
2
-
3
- ***
4
-
5
- ### Brief annotation
6
-
7
- Vue3 extended multiselect is a component that was created for simplification of custom settings of built-in select element. This component allows developer to escape writing many excess css-rules by using built-in themes and to escape problems with different kinds of provided options. Various decoration of options list by some extra slots will help developer to make it more informative and obvious. More thorough filtering of raw options list given by developer excludes sudden errors if kind of option is not intended for extended multiselect. Switchable useful warnings will help to catch possible errors that may occur while working with options. Tools for working with selected options will allow user to control amount of displayed options and quickly deselect them. Such tools also can be customized by developer. Various slots can help developer to customize to his liking options list, elements with selected options in multiple select or some other interaction elements. You can use this component in your web-applications based on Vue 3 framework.
8
-
9
- ### Installation with npm
10
-
11
- ``npm install --save vue3-extended-multiselect``
12
-
13
- ### Installation with yarn
14
-
15
- ``yarn install --production vue3-extended-multiselect``
16
-
17
- ### Importing
18
-
19
- ```js
20
- import Vue3ExtendedMultiselect from "vue3-extended-multiselect"
21
- ```
22
-
23
- ### Importing types
24
-
25
- ```js
26
- import { UnionOptionType } from "vue3-extended-multiselect"
27
- ```
28
-
29
- ## Table of contents
30
- * [Props list](#props-list)
31
- * [Slots list](#slots-list)
32
- * [Events list](#events-list)
33
- * [Styling with css](#styling-with-css)
34
- * [Styling with props](#styling-with-props)
35
- * [License](#license)
36
-
37
- ## Props list
38
- Prop name | Prop type | Prop appointment | Prop default value | Prop values
39
- ----------|-----------|------------------|--------------------|------------
40
- **autoSelect<br/>CreatedOption**|Boolean|Determines whether to select just now created option automatically.|false|&mdash;|
41
- **autoSelect<br/>SearchValue**|Boolean|Determines whether to take search value from current selected option if "multiple" prop equals false.|false|&mdash;|
42
- **clearBySelect<br/>WhenMultiple**|Boolean|Determines whether to clear search field by option selection.|false|&mdash;|
43
- **createOnThe<br/>Go**|Boolean|Allows user to create new options from search field.|false|&mdash;|
44
- **default<br/>Expanded**|Boolean|Determines whether options list should be expanded by default.|false|&mdash;|
45
- **disabled**|Boolean|Disables extended multiselect.|false|&mdash;|
46
- **highlight<br/>Options**|Boolean|Switches options highlighting while hovering.|true|&mdash;|
47
- **loading**|Boolean|Switches loading state of extended multiselect.|false|&mdash;|
48
- **multiple**|Boolean|Allows user to select multiple options.|false|&mdash;|
49
- **noResults<br/>BlockShown**|Boolean|Determines whether to show special hint if no options were found.|true|&mdash;|
50
- **resetSearch<br/>ByValue**|Boolean|Determines whether to clear search field by selection/deselection of options.|true|&mdash;|
51
- **searchFilter<br/>Active**|Boolean|Allows user to use internal search for options.|true|&mdash;|
52
- **simpleEvents**|Boolean|Switches full payload of extended multiselect events.|true|&mdash;|
53
- **selected<br/>Options<br/>Shown**|Boolean|Determines whether to show selected options in options list.|false|&mdash;|
54
- **showClearIcon**|Boolean|Allows user to deselect all options by special icon.|false|&mdash;|
55
- **showInsert<br/>Warnings**|Boolean|Determines whether to show useful internal warnings in console.|false|&mdash;|
56
- **showMarker**|Boolean|Determines whether to show slot with special marker beside option in options list.|false|&mdash;|
57
- **showSearch<br/>Field**|Boolean|Determines whether to show search field which allows user to search for options with internal search.|true|&mdash;|
58
- **toggleMultiple<br/>BlocksLimit**|Boolean|Allows user to increase limit of shown elements with selected options by special icon.|false|&mdash;|
59
- **toggleOptions<br/>BySelect**|Boolean|Determines whether to roll up options list by selection of option.|true|&mdash;|
60
- **togglingSaves<br/>SearchValue**|Boolean|Determines whether to save current search value if display of options list was toggled.|true|&mdash;|
61
- **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;|
62
- **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;|
63
- **createOption<br/>Type**|String|Defines kind for all options which will be created by user.|"primitive"| "primitive", "array", "object"|
64
- **disableByField**|String|Determines a field in options of type "object" which value will be used to disable such options.|"disabled"|&mdash;|
65
- **emptyObjects<br/>Placeholder**|String|Placeholder for options of type "object" or Array instances which length/keys length equals 0.|"Empty Object/<br/>Array"|&mdash;|
66
- **errorBorder<br/>Color**|String|Defines "border-color" css-property for extended multiselect with wrong value.|"#FF0000"|&mdash;|
67
- **iconFilter**|String|Defines svg-filter with color settings for all icons except loader.|"basic"|"basic", "black", "green"|
68
- **iconSize**|String|Defines sizes for all icons in pixels except loader.|"large"|"large", "medium", "small"|
69
- **label**|String|Defines field in options of type "object" that will be the label of option.|"label"|&mdash;|
70
- **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"|
71
- **placeholder**|String|Placeholder for search field to be used if user is not allowed to create new options.|"Select features"|&mdash;|
72
- **searchByField**|String|Determines field in options of type "object" to use in internal search.|""|&mdash;|
73
- **themeType**|String|Defines overall color theme for extended multiselect.|"basic"|"basic", "slate-grey", "slate-blue", "teal",<br/> "strict"|
74
- **toggle<br/>Appearance<br/>Side**|String|Defines which side options list will be displayed on.|"auto"|"auto", "atop", "under"|
75
- **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"|
76
- **anyOption<br/>Wrapper<br/>BlockHeight**|Number|Defines "height" css-property for each option in options list.|30|&mdash;|
77
- **increase<br/>Display<br/>By**|Number|Defines gap which increases limit of displayed elements with selected options.|5|&mdash;|
78
- **maxOptions<br/>Count**|Number|Maximal limit of selected options.|null|&mdash;|
79
- **minOptions<br/>Count**|Number|Minimal limit of selected options.|null|&mdash;|
80
- **multipleBlocks<br/>Limit**|Number|Defines limit of displayed elements with selected options.|null|&mdash;|
81
- **optionsCount<br/>Restriction**|Number|Defines maximal limit of options list length.|null|&mdash;|
82
- **toggleMax<br/>Height**|Number|Defines maximal value in pixels of "max-height" css-property for options list.|400|&mdash;|
83
- **toggleMin<br/>Height**|Number|Defines minimal value in pixels of "max-height" css-property for options list.|null|&mdash;|
84
- **createOption<br/>Fields**|Array|Defines a list of fields for options of type "object" created by user.|["label"]|&mdash;|
85
- **disabled<br/>Primitive<br/>Options**|Array|Defines a list of primitive types for options. Options of given types will be disabled for selection.|[]|&mdash;|
86
- **options**|Array|Raw options list.|[]|&mdash;|
87
- **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;|
88
- **preselected<br/>Options**|Array|Defines a list of options that will be select by default.|[]|&mdash;|
89
- **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"|
90
- **createCustom<br/>OptionLabel**|Function|Defines function that creates custom label for each option.|(option) => null|&mdash;|
91
- **multipleBlocks<br/>LimitMessage**|Function|Defines function that creates notification when maximal limit of selected options has been reached.|(number) => \`and ${number} more items\`|&mdash;|
92
- **inputId**|String, Number|"id" attribute of search field.|null|&mdash;|
93
- **preselected<br/>Option**|UnionPropType (from types)|Defines options that will be select by default.|null|&mdash;|
94
- **value**|Array|Defines value of extended multiselect that can be used in "v-model".|[]|&mdash;|
95
-
96
- ## Slots list
97
- Slot name | Slot appointment | Slot scope
98
- ----------|------------------|-----------
99
- **option**|Option in options list with its label.|``option`` — option from options list,<br/>``createCustomOptionLabel`` — function that creates custom label for each option|
100
- **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|
101
- **marker**|Marker that indicates state of option selection.|&mdash;|
102
- **maxElements**|Message displayed if maximal limit of elements with selected options has been shown.|&mdash;|
103
- **showMore**|Button that increases limit of displayed elements with selected options.|``showMoreOptions`` — function that increases limit of displayed elements with selected options|
104
- **noResults**|Message displayed if no options have been found by internal search.|&mdash;|
105
- **noOptions**|Message displayed if given options list is empty.|&mdash;|
106
- **listHeader**|Element at the top of options list for information content.|&mdash;|
107
- **listFooter**|Element at the bottom of options list for information content.|&mdash;|
108
- **toggle**|Button that toggles options list display.|``toggleOptionsList`` — function that toggles options list display|
109
- **labelBlock**|Element with single selected option that is shown if search field display is disabled.|``labelBlockValue`` — option label|
110
- **moreThanLimit**|Message displayed if maximal limit of selected options has been reached.|&mdash;|
111
- **lessThanLimit**|Message displayed if minimal limit of selected options has not been reached.|&mdash;|
112
- **cancel**|Button that deselects all options.|``cancel`` — function that deselects all options|
113
-
114
- ## Events list
115
- Event name | Event appointment | Listener method | Simplified event payload | Fields of object with full event payload |
116
- -----------|-------------------|-----------------|--------------------------|-----------------------------------------|
117
- **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|
118
- **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|
119
- **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|
120
- **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|
121
- **active**|Dropdown options list expanding.|@active|&mdash;|``inputId`` — id of search field set by "id" prop|
122
- **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|
123
- **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|
124
-
125
- ## Styling with css
126
-
127
- Vue3 extended multiselect provides following css-variables:
128
-
129
- ```css
130
- --basic-color: #708090;
131
- --basic-transparent: rgba(112, 128, 144, 0.6);
132
- --cancel: #B22222;
133
- --cancel-backgound-color: rgba(179, 33, 33, 0.1);
134
- --dark-slate-blue: #483D8B;
135
- --dark-slate-blue-transparent: rgba(72, 61, 139, 0.6);
136
- --dark-slate-grey: #2F4F4F;
137
- --dark-slate-grey-transparent: rgba(47, 79, 79, 0.6);
138
- --disabled: rgba(176, 176, 176, 0.6);
139
- --hover-color: #FFFFFF;
140
- --loader-color: #00BFFF;
141
- --strict: #000000;
142
- --strict-transparent: rgba(0, 0, 0, 0.6);
143
- --teal: #008080;
144
- --teal-transparent: rgba(0, 128, 128, 0.6);
145
-
146
- --block-border-radius: 4px;
147
- --block-cancel-padding: 4px;
148
- --block-gap: 6px;
149
- --block-padding: 1px 3px 1px 7px;
150
- --border-radius: 6px;
151
- --border-radius-small: 3px;
152
- --cancel-padding: 3px 8px;
153
- --grid-columns: 1fr 36px 36px;
154
- --grid-rows: 1fr 36px;
155
- --half-size: 50%;
156
- --icon-size-block: 14px;
157
- --icon-size-large: 18px;
158
- --icon-size-medium: 15px;
159
- --icon-size-small: 12px;
160
- --increaser-padding: 3px 7px;
161
- --max-size: 100%;
162
- --min-block-height: 25px;
163
- --options-padding: 6px 0;
164
- --outer-gap: 10px;
165
- --root-padding: 6px 10px;
166
- --toggle-icon-gap: 1px;
167
- --wide-text: 700;
168
- --wrapper-padding: 5px 10px;
169
-
170
- --border: 1px solid;
171
- --default-cursor: default;
172
- --icons-align-self: start;
173
- --icons-justify-self: center;
174
- --pointer-cursor: pointer;
175
- --wrapper-transition: border-top-left-radius 250ms ease 0s, border-top-right-radius 250ms ease 0s,
176
- border-bottom-left-radius 250ms ease-out, border-bottom-right-radius 250ms ease-out;
177
- ```
178
-
179
- You can override it globally or by particular instance class name.
180
-
181
- ```css
182
- :root {
183
- --basic-color: purple;
184
- --outer-gap: 2rem;
185
- --border: 1px dotted;
186
- }
187
- ```
188
-
189
- ```html
190
- <vue3-extended-multiselect class="instance-class" />
191
- ```
192
-
193
- ```css
194
- .instance-class {
195
- --basic-color: purple;
196
- --outer-gap: 2rem;
197
- --border: 1px dotted;
198
- }
199
- ```
200
-
201
- ## Styling with props
202
-
203
- Vue3 extended multiselect provides following props for customizing:
204
-
205
- * errorBorderColor
206
- * iconFilter
207
- * iconSize
208
- * loaderIconFilter
209
- * themeType
210
- * toggleIcon
211
- * anyOptionWrapperBlockHeight
212
- * toggleMaxHeight
213
- * toggleMinHeight
214
-
215
- #### Customizing examples
216
-
217
- Changing border color when extended multiselect value is invalid.
218
-
219
- ```html
220
- <vue3-extended-multiselect error-border-color="#8B0000" />
221
- ```
222
- Changing svg color filter for icons.
223
-
224
- ```html
225
- <vue3-extended-multiselect icon-filter="green" />
226
- ```
227
- Resizing icons.
228
-
229
- ```html
230
- <vue3-extended-multiselect icon-size="small" />
231
- ```
232
- Changing svg color filter for loader icon.
233
-
234
- ```html
235
- <vue3-extended-multiselect icon-size="small" />
236
- ```
237
- Changing general color theme of extended multiselect.
238
-
239
- ```html
240
- <vue3-extended-multiselect theme-type="slate-blue" />
241
- ```
242
- Changing toggle icon form.
243
-
244
- ```html
245
- <vue3-extended-multiselect toggle-icon="triangle-arrow" />
246
- ```
247
- Resizing option blocks in options list.
248
-
249
- ```html
250
- <vue3-extended-multiselect :any-option-wrapper-block-height="60" />
251
- ```
252
- Changing "max-height" css-property of options list.
253
-
254
- ```html
255
- <vue3-extended-multiselect :toggle-max-height="500" />
256
- ```
257
-
258
- Changing "min-height" css-property of options list.
259
-
260
- ```html
261
- <vue3-extended-multiselect :toggle-min-height="500" />
262
- ```
263
-
264
- ## License
265
-
266
- [MIT](LICENSE)
1
+ # vue3-extended-multiselect v1.4.1
2
+
3
+ ***
4
+
5
+ ### Brief annotation
6
+
7
+ Vue3 extended multiselect is a component that was created for simplification of custom settings of built-in select element. This component allows developer to escape writing many excess css-rules by using built-in themes and to escape problems with different kinds of provided options. Various decoration of options list by some extra slots will help developer to make it more informative and obvious. More thorough filtering of raw options list given by developer excludes sudden errors if kind of option is not intended for extended multiselect. Switchable useful warnings will help to catch possible errors that may occur while working with options. Tools for working with selected options will allow user to control amount of displayed options and quickly deselect them. Such tools also can be customized by developer. Various slots can help developer to customize to his liking options list, elements with selected options in multiple select or some other interaction elements. You can use this component in your web-applications based on Vue 3 framework.
8
+
9
+ ### Installation with npm
10
+
11
+ ``npm install --save vue3-extended-multiselect``
12
+
13
+ ### Installation with yarn
14
+
15
+ ``yarn install --production vue3-extended-multiselect``
16
+
17
+ ### Importing
18
+
19
+ ```js
20
+ import Vue3ExtendedMultiselect from "vue3-extended-multiselect"
21
+ ```
22
+
23
+ ### Importing types
24
+
25
+ ```js
26
+ import { UnionOptionType } from "vue3-extended-multiselect"
27
+ ```
28
+
29
+ ## Table of contents
30
+ * [Props list](#props-list)
31
+ * [Slots list](#slots-list)
32
+ * [Events list](#events-list)
33
+ * [Styling with css](#styling-with-css)
34
+ * [Styling with props](#styling-with-props)
35
+ * [License](#license)
36
+
37
+ ## Props list
38
+ Prop name | Prop type | Prop appointment | Prop default value | Prop values
39
+ ----------|-----------|------------------|--------------------|------------
40
+ **autoSelect<br/>CreatedOption**|Boolean|Determines whether to select just now created option automatically.|false|&mdash;|
41
+ **autoSelect<br/>SearchValue**|Boolean|Determines whether to take search value from current selected option if "multiple" prop equals false.|false|&mdash;|
42
+ **clearBySelect<br/>WhenMultiple**|Boolean|Determines whether to clear search field by option selection.|false|&mdash;|
43
+ **createOnThe<br/>Go**|Boolean|Allows user to create new options from search field.|false|&mdash;|
44
+ **default<br/>Expanded**|Boolean|Determines whether options list should be expanded by default.|false|&mdash;|
45
+ **disabled**|Boolean|Disables extended multiselect.|false|&mdash;|
46
+ **highlight<br/>Options**|Boolean|Switches options highlighting while hovering.|true|&mdash;|
47
+ **loading**|Boolean|Switches loading state of extended multiselect.|false|&mdash;|
48
+ **multiple**|Boolean|Allows user to select multiple options.|false|&mdash;|
49
+ **noResults<br/>BlockShown**|Boolean|Determines whether to show special hint if no options were found.|true|&mdash;|
50
+ **resetSearch<br/>ByValue**|Boolean|Determines whether to clear search field by selection/deselection of options.|true|&mdash;|
51
+ **searchFilter<br/>Active**|Boolean|Allows user to use internal search for options.|true|&mdash;|
52
+ **simpleEvents**|Boolean|Switches full payload of extended multiselect events.|true|&mdash;|
53
+ **selected<br/>Options<br/>Shown**|Boolean|Determines whether to show selected options in options list.|false|&mdash;|
54
+ **showClearIcon**|Boolean|Allows user to deselect all options by special icon.|false|&mdash;|
55
+ **showInsert<br/>Warnings**|Boolean|Determines whether to show useful internal warnings in console.|false|&mdash;|
56
+ **showMarker**|Boolean|Determines whether to show slot with special marker beside option in options list.|false|&mdash;|
57
+ **showSearch<br/>Field**|Boolean|Determines whether to show search field which allows user to search for options with internal search.|true|&mdash;|
58
+ **toggleMultiple<br/>BlocksLimit**|Boolean|Allows user to increase limit of shown elements with selected options by special icon.|false|&mdash;|
59
+ **toggleOptions<br/>BySelect**|Boolean|Determines whether to roll up options list by selection of option.|true|&mdash;|
60
+ **togglingSaves<br/>SearchValue**|Boolean|Determines whether to save current search value if display of options list was toggled.|true|&mdash;|
61
+ **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;|
62
+ **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;|
63
+ **createOption<br/>Type**|String|Defines kind for all options which will be created by user.|"primitive"| "primitive", "array", "object"|
64
+ **disableByField**|String|Determines a field in options of type "object" which value will be used to disable such options.|"disabled"|&mdash;|
65
+ **emptyObjects<br/>Placeholder**|String|Placeholder for options of type "object" or Array instances which length/keys length equals 0.|"Empty Object/<br/>Array"|&mdash;|
66
+ **errorBorder<br/>Color**|String|Defines "border-color" css-property for extended multiselect with wrong value.|"#FF0000"|&mdash;|
67
+ **iconFilter**|String|Defines svg-filter with color settings for all icons except loader.|"basic"|"basic", "black", "green"|
68
+ **iconSize**|String|Defines sizes for all icons in pixels except loader.|"large"|"large", "medium", "small"|
69
+ **label**|String|Defines field in options of type "object" that will be the label of option.|"label"|&mdash;|
70
+ **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"|
71
+ **placeholder**|String|Placeholder for search field to be used if user is not allowed to create new options.|"Select features"|&mdash;|
72
+ **searchByField**|String|Determines field in options of type "object" to use in internal search.|""|&mdash;|
73
+ **themeType**|String|Defines overall color theme for extended multiselect.|"basic"|"basic", "slate-grey", "slate-blue", "teal",<br/> "strict"|
74
+ **toggle<br/>Appearance<br/>Side**|String|Defines which side options list will be displayed on.|"auto"|"auto", "atop", "under"|
75
+ **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"|
76
+ **anyOption<br/>Wrapper<br/>BlockHeight**|Number|Defines "height" css-property for each option in options list.|30|&mdash;|
77
+ **increase<br/>Display<br/>By**|Number|Defines gap which increases limit of displayed elements with selected options.|5|&mdash;|
78
+ **maxOptions<br/>Count**|Number|Maximal limit of selected options.|null|&mdash;|
79
+ **minOptions<br/>Count**|Number|Minimal limit of selected options.|null|&mdash;|
80
+ **multipleBlocks<br/>Limit**|Number|Defines limit of displayed elements with selected options.|null|&mdash;|
81
+ **optionsCount<br/>Restriction**|Number|Defines maximal limit of options list length.|null|&mdash;|
82
+ **toggleMax<br/>Height**|Number|Defines maximal value in pixels of "max-height" css-property for options list.|400|&mdash;|
83
+ **toggleMin<br/>Height**|Number|Defines minimal value in pixels of "max-height" css-property for options list.|null|&mdash;|
84
+ **createOption<br/>Fields**|Array|Defines a list of fields for options of type "object" created by user.|["label"]|&mdash;|
85
+ **disabled<br/>Primitive<br/>Options**|Array|Defines a list of primitive types for options. Options of given types will be disabled for selection.|[]|&mdash;|
86
+ **options**|Array|Raw options list.|[]|&mdash;|
87
+ **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;|
88
+ **preselected<br/>Options**|Array|Defines a list of options that will be select by default.|[]|&mdash;|
89
+ **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"|
90
+ **createCustom<br/>OptionLabel**|Function|Defines function that creates custom label for each option.|(option) => null|&mdash;|
91
+ **multipleBlocks<br/>LimitMessage**|Function|Defines function that creates notification when maximal limit of selected options has been reached.|(number) => \`and ${number} more items\`|&mdash;|
92
+ **inputId**|String, Number|"id" attribute of search field.|null|&mdash;|
93
+ **preselected<br/>Option**|UnionPropType (from types)|Defines options that will be select by default.|null|&mdash;|
94
+ **value**|Array|Defines value of extended multiselect that can be used in "v-model".|[]|&mdash;|
95
+
96
+ ## Slots list
97
+ Slot name | Slot appointment | Slot scope
98
+ ----------|------------------|-----------
99
+ **option**|Option in options list with its label.|``option`` — option from options list,<br/>``createCustomOptionLabel`` — function that creates custom label for each option|
100
+ **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|
101
+ **marker**|Marker that indicates state of option selection.|&mdash;|
102
+ **maxElements**|Message displayed if maximal limit of elements with selected options has been shown.|&mdash;|
103
+ **showMore**|Button that increases limit of displayed elements with selected options.|``showMoreOptions`` — function that increases limit of displayed elements with selected options|
104
+ **noResults**|Message displayed if no options have been found by internal search.|&mdash;|
105
+ **noOptions**|Message displayed if given options list is empty.|&mdash;|
106
+ **listHeader**|Element at the top of options list for information content.|&mdash;|
107
+ **listFooter**|Element at the bottom of options list for information content.|&mdash;|
108
+ **toggle**|Button that toggles options list display.|``toggleOptionsList`` — function that toggles options list display|
109
+ **labelBlock**|Element with single selected option that is shown if search field display is disabled.|``labelBlockValue`` — option label|
110
+ **moreThanLimit**|Message displayed if maximal limit of selected options has been reached.|&mdash;|
111
+ **lessThanLimit**|Message displayed if minimal limit of selected options has not been reached.|&mdash;|
112
+ **cancel**|Button that deselects all options.|``cancel`` — function that deselects all options|
113
+
114
+ ## Events list
115
+ Event name | Event appointment | Listener method | Simplified event payload | Fields of object with full event payload |
116
+ -----------|-------------------|-----------------|--------------------------|-----------------------------------------|
117
+ **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|
118
+ **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|
119
+ **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|
120
+ **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|
121
+ **active**|Dropdown options list expanding.|@active|&mdash;|``inputId`` — id of search field set by "id" prop|
122
+ **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|
123
+ **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|
124
+
125
+ ## Styling with css
126
+
127
+ Vue3 extended multiselect provides following css-variables:
128
+
129
+ ```css
130
+ --basic-color: #708090;
131
+ --basic-transparent: rgba(112, 128, 144, 0.6);
132
+ --cancel: #B22222;
133
+ --cancel-backgound-color: rgba(179, 33, 33, 0.1);
134
+ --dark-slate-blue: #483D8B;
135
+ --dark-slate-blue-transparent: rgba(72, 61, 139, 0.6);
136
+ --dark-slate-grey: #2F4F4F;
137
+ --dark-slate-grey-transparent: rgba(47, 79, 79, 0.6);
138
+ --disabled: rgba(176, 176, 176, 0.6);
139
+ --hover-color: #FFFFFF;
140
+ --loader-color: #00BFFF;
141
+ --strict: #000000;
142
+ --strict-transparent: rgba(0, 0, 0, 0.6);
143
+ --teal: #008080;
144
+ --teal-transparent: rgba(0, 128, 128, 0.6);
145
+
146
+ --block-border-radius: 4px;
147
+ --block-cancel-padding: 4px;
148
+ --block-gap: 6px;
149
+ --block-padding: 1px 3px 1px 7px;
150
+ --border-radius: 6px;
151
+ --border-radius-small: 3px;
152
+ --cancel-padding: 3px 8px;
153
+ --grid-columns: 1fr 36px 36px;
154
+ --grid-rows: 1fr 36px;
155
+ --half-size: 50%;
156
+ --icon-size-block: 14px;
157
+ --icon-size-large: 18px;
158
+ --icon-size-medium: 15px;
159
+ --icon-size-small: 12px;
160
+ --increaser-padding: 3px 7px;
161
+ --max-size: 100%;
162
+ --min-block-height: 25px;
163
+ --options-padding: 6px 0;
164
+ --outer-gap: 10px;
165
+ --root-padding: 6px 10px;
166
+ --toggle-icon-gap: 1px;
167
+ --wide-text: 700;
168
+ --wrapper-padding: 5px 10px;
169
+
170
+ --border: 1px solid;
171
+ --default-cursor: default;
172
+ --icons-align-self: start;
173
+ --icons-justify-self: center;
174
+ --pointer-cursor: pointer;
175
+ --wrapper-transition: border-top-left-radius 250ms ease 0s, border-top-right-radius 250ms ease 0s,
176
+ border-bottom-left-radius 250ms ease-out, border-bottom-right-radius 250ms ease-out;
177
+ ```
178
+
179
+ You can override it globally or by particular instance class name.
180
+
181
+ ```css
182
+ :root {
183
+ --basic-color: purple;
184
+ --outer-gap: 2rem;
185
+ --border: 1px dotted;
186
+ }
187
+ ```
188
+
189
+ ```html
190
+ <vue3-extended-multiselect class="instance-class" />
191
+ ```
192
+
193
+ ```css
194
+ .instance-class {
195
+ --basic-color: purple;
196
+ --outer-gap: 2rem;
197
+ --border: 1px dotted;
198
+ }
199
+ ```
200
+
201
+ ## Styling with props
202
+
203
+ Vue3 extended multiselect provides following props for customizing:
204
+
205
+ * errorBorderColor
206
+ * iconFilter
207
+ * iconSize
208
+ * loaderIconFilter
209
+ * themeType
210
+ * toggleIcon
211
+ * anyOptionWrapperBlockHeight
212
+ * toggleMaxHeight
213
+ * toggleMinHeight
214
+
215
+ #### Customizing examples
216
+
217
+ Changing border color when extended multiselect value is invalid.
218
+
219
+ ```html
220
+ <vue3-extended-multiselect error-border-color="#8B0000" />
221
+ ```
222
+ Changing svg color filter for icons.
223
+
224
+ ```html
225
+ <vue3-extended-multiselect icon-filter="green" />
226
+ ```
227
+ Resizing icons.
228
+
229
+ ```html
230
+ <vue3-extended-multiselect icon-size="small" />
231
+ ```
232
+ Changing svg color filter for loader icon.
233
+
234
+ ```html
235
+ <vue3-extended-multiselect icon-size="small" />
236
+ ```
237
+ Changing general color theme of extended multiselect.
238
+
239
+ ```html
240
+ <vue3-extended-multiselect theme-type="slate-blue" />
241
+ ```
242
+ Changing toggle icon form.
243
+
244
+ ```html
245
+ <vue3-extended-multiselect toggle-icon="triangle-arrow" />
246
+ ```
247
+ Resizing option blocks in options list.
248
+
249
+ ```html
250
+ <vue3-extended-multiselect :any-option-wrapper-block-height="60" />
251
+ ```
252
+ Changing "max-height" css-property of options list.
253
+
254
+ ```html
255
+ <vue3-extended-multiselect :toggle-max-height="500" />
256
+ ```
257
+
258
+ Changing "min-height" css-property of options list.
259
+
260
+ ```html
261
+ <vue3-extended-multiselect :toggle-min-height="500" />
262
+ ```
263
+
264
+ ## License
265
+
266
+ [MIT](LICENSE)
package/babel.config.js CHANGED
@@ -1,6 +1,6 @@
1
- module.exports = {
2
- presets: [
3
- '@vue/cli-plugin-babel/preset'
4
- ],
5
- plugins: ['@babel/transform-runtime', 'babel-plugin-transform-import-meta'],
1
+ module.exports = {
2
+ presets: [
3
+ '@vue/cli-plugin-babel/preset'
4
+ ],
5
+ plugins: ['@babel/transform-runtime', 'babel-plugin-transform-import-meta'],
6
6
  }
package/index.js CHANGED
@@ -1,3 +1,3 @@
1
- import Vue3ExtendedMultiselect from "./src/components/Vue3ExtendedMultiselect.vue";
2
-
1
+ import Vue3ExtendedMultiselect from "./src/components/Vue3ExtendedMultiselect.vue";
2
+
3
3
  export default Vue3ExtendedMultiselect;