vue3-extended-multiselect 0.0.5 → 0.1.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/.eslintrc.js +29 -29
- package/CHANGELOG.md +11 -1
- package/README.md +116 -116
- package/jest.config.js +57 -57
- package/package.json +47 -45
- package/src/assets/circle-arrow.svg +7 -7
- package/src/assets/inner-arrow.svg +8 -8
- package/src/components/Vue3ExtendedMultiselect.vue +1651 -1651
- package/src/styles/animations.css +19 -0
- package/src/styles/main.css +434 -0
- package/src/styles/variables.css +41 -0
- package/tests/unit/events.spec.js +135 -135
- package/public/favicon.ico +0 -0
- package/public/index.html +0 -17
- package/src/sass/animations.sass +0 -13
- package/src/sass/main.sass +0 -341
- package/src/sass/mixins.sass +0 -40
- package/src/sass/variables.sass +0 -37
package/.eslintrc.js
CHANGED
|
@@ -1,29 +1,29 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
node: true,
|
|
5
|
-
},
|
|
6
|
-
"extends": [
|
|
7
|
-
"plugin:vue/vue3-essential",
|
|
8
|
-
"eslint:recommended"
|
|
9
|
-
],
|
|
10
|
-
parserOptions: {
|
|
11
|
-
parser: "babel-eslint",
|
|
12
|
-
},
|
|
13
|
-
rules: {
|
|
14
|
-
"no-console": "off",
|
|
15
|
-
"no-debugger": "off",
|
|
16
|
-
"no-unused-vars": "off",
|
|
17
|
-
},
|
|
18
|
-
overrides: [
|
|
19
|
-
{
|
|
20
|
-
files: [
|
|
21
|
-
"**/__tests__/*.{j,t}s?(x)",
|
|
22
|
-
"**/tests/unit/**/*.spec.{j,t}s?(x)"
|
|
23
|
-
],
|
|
24
|
-
env: {
|
|
25
|
-
jest: true,
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
root: true,
|
|
3
|
+
env: {
|
|
4
|
+
node: true,
|
|
5
|
+
},
|
|
6
|
+
"extends": [
|
|
7
|
+
"plugin:vue/vue3-essential",
|
|
8
|
+
"eslint:recommended"
|
|
9
|
+
],
|
|
10
|
+
parserOptions: {
|
|
11
|
+
parser: "babel-eslint",
|
|
12
|
+
},
|
|
13
|
+
rules: {
|
|
14
|
+
"no-console": "off",
|
|
15
|
+
"no-debugger": "off",
|
|
16
|
+
"no-unused-vars": "off",
|
|
17
|
+
},
|
|
18
|
+
overrides: [
|
|
19
|
+
{
|
|
20
|
+
files: [
|
|
21
|
+
"**/__tests__/*.{j,t}s?(x)",
|
|
22
|
+
"**/tests/unit/**/*.spec.{j,t}s?(x)"
|
|
23
|
+
],
|
|
24
|
+
env: {
|
|
25
|
+
jest: true,
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
]
|
|
29
|
+
}
|
package/CHANGELOG.md
CHANGED
|
@@ -22,4 +22,14 @@ Correction of cancel button highlighting while loading.
|
|
|
22
22
|
|
|
23
23
|
####0.0.5
|
|
24
24
|
|
|
25
|
-
Changing tables format in documentation.
|
|
25
|
+
Changing tables format in documentation.
|
|
26
|
+
|
|
27
|
+
####0.0.6
|
|
28
|
+
|
|
29
|
+
Relocation of main.js file for local qa tests.
|
|
30
|
+
|
|
31
|
+
###0.1.0
|
|
32
|
+
|
|
33
|
+
Changing the style language from sass to css for for greater package accessibility.
|
|
34
|
+
Removed dev-dependency "sass".
|
|
35
|
+
Removed dev-dependency "sass-loader".
|
package/README.md
CHANGED
|
@@ -1,116 +1,116 @@
|
|
|
1
|
-
# vue3-extended-multiselect v0.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
|
-
## Props list
|
|
30
|
-
Prop name | Prop type | Prop appointment | Prop default value | Prop values
|
|
31
|
-
----------|-----------|------------------|--------------------|------------
|
|
32
|
-
**autoSelect<br/>CreatedOption**|Boolean|Determines whether to select just now created option automatically.|false|—|
|
|
33
|
-
**clearBySelect<br/>WhenMultiple**|Boolean|Determines whether to clear search field by option selection.|false|—|
|
|
34
|
-
**createOnThe<br/>Go**|Boolean|Allows user to create new options from search field.|false|—|
|
|
35
|
-
**default<br/>Expanded**|Boolean|Determines whether options list should be expanded by default.|false|—|
|
|
36
|
-
**disabled**|Boolean|Disables extended multiselect.|false|—|
|
|
37
|
-
**highlight<br/>Options**|Boolean|Switches options highlighting while hovering.|true|—|
|
|
38
|
-
**loading**|Boolean|Switches loading state of extended multiselect.|false|—|
|
|
39
|
-
**multiple**|Boolean|Allows user to select multiple options.|false|—|
|
|
40
|
-
**noResults<br/>BlockShown**|Boolean|Determines whether to show special hint if no options were found.|true|—|
|
|
41
|
-
**resetSearch<br/>ByValue**|Boolean|Determines whether to clear search field by selection/deselection of options.|true|—|
|
|
42
|
-
**searchFilter<br/>Active**|Boolean|Allows user to use internal search for options.|true|—|
|
|
43
|
-
**simpleEvents**|Boolean|Switches full payload of extended multiselect events.|true|—|
|
|
44
|
-
**selected<br/>Options<br/>Shown**|Boolean|Determines whether to show selected options in options list.|false|—|
|
|
45
|
-
**showClearIcon**|Boolean|Allows user to deselect all options by special icon.|false|—|
|
|
46
|
-
**showInsert<br/>Warnings**|Boolean|Determines whether to show useful internal warnings in console.|false|—|
|
|
47
|
-
**showMarker**|Boolean|Determines whether to show slot with special marker beside option in options list.|false|—|
|
|
48
|
-
**showSearch<br/>Field**|Boolean|Determines whether to show search field which allows user to search for options with internal search.|true|—|
|
|
49
|
-
**toggleMultiple<br/>BlocksLimit**|Boolean|Allows user to increase limit of shown elements with selected options by special icon.|false|—|
|
|
50
|
-
**toggleOptions<br/>BySelect**|Boolean|Determines whether to roll up options list by selection of option.|true|—|
|
|
51
|
-
**togglingSaves<br/>SearchValue**|Boolean|Determines whether to save current search value if display of options list was toggled.|true|—|
|
|
52
|
-
**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|—|
|
|
53
|
-
**createOption<br/>Placeholder**|String|Placeholder for the search field to be used if user is allowed to create new options.|"Select or create features"|—|
|
|
54
|
-
**createOption<br/>Type**|String|Defines kind for all options which will be created by user.|"primitive"| "primitive", "array", "object"|
|
|
55
|
-
**emptyObjects<br/>Placeholder**|String|Placeholder for options of type "object" or Array instances which length/keys length equals 0.|"Empty Object/<br/>Array"|—|
|
|
56
|
-
**errorBorder<br/>Color**|String|Defines "border-color" css-property for extended multiselect with wrong value.|"#FF0000"|—|
|
|
57
|
-
**iconFilter**|String|Defines svg-filter with color settings for all icons except loader.|"basic"|"basic", "black", "green"|
|
|
58
|
-
**iconSize**|String|Defines sizes for all icons in pixels except loader.|"large"|"large", "medium", "small"|
|
|
59
|
-
**label**|String|Defines field in options of type "object" that will be the label of option.|"label"|—|
|
|
60
|
-
**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"|
|
|
61
|
-
**placeholder**|String|Placeholder for search field to be used if user is not allowed to create new options.|"Select features"|—|
|
|
62
|
-
**themeType**|String|Defines overall color theme for extended multiselect.|"basic"|"basic", "slate-grey", "slate-blue", "teal",<br/> "strict"|
|
|
63
|
-
**toggle<br/>Appearance<br/>Side**|String|Defines which side options list will be displayed on.|"auto"|"auto", "atop", "under"|
|
|
64
|
-
**toggleIcon**|String|Defines kind of toggle icon from icons collection.|"double-arrow"|"base-arrow", "double-arrow", "wide-arrow", "circle-arrow", "inner-arrow", "triangle-arrow", "triangle-circle-arrow"|
|
|
65
|
-
**anyOption<br/>Wrapper<br/>BlockHeight**|Number|Defines "height" css-property for each option in options list.|30|—|
|
|
66
|
-
**increase<br/>Display<br/>By**|Number|Defines gap which increases limit of displayed elements with selected options.|5|—|
|
|
67
|
-
**maxOptions<br/>Count**|Number|Maximal limit of selected options.|null|—|
|
|
68
|
-
**minOptions<br/>Count**|Number|Minimal limit of selected options.|null|—|
|
|
69
|
-
**multipleBlocks<br/>Limit**|Number|Defines limit of displayed elements with selected options.|null|—|
|
|
70
|
-
**optionsCount<br/>Restriction**|Number|Defines maximal limit of options list length.|null|—|
|
|
71
|
-
**toggleMax<br/>Height**|Number|Defines maximal value in pixels of "max-height" css-property for options list.|400|—|
|
|
72
|
-
**toggleMin<br/>Height**|Number|Defines minimal value in pixels of "max-height" css-property for options list.|null|—|
|
|
73
|
-
**createOption<br/>Fields**|Array|Defines a list of fields for options of type "object" created by user.|["label"]|—|
|
|
74
|
-
**disabled<br/>Primitive<br/>Options**|Array|Defines a list of primitive types for options. Options of given types will be disabled for selection.|[]|—|
|
|
75
|
-
**options**|Array|Raw options list.|[]|—|
|
|
76
|
-
**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.|[]|—|
|
|
77
|
-
**preselected<br/>Options**|Array|Defines a list of options that will be select by default.|[]|—|
|
|
78
|
-
**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"|
|
|
79
|
-
**createCustom<br/>OptionLabel**|Function|Defines function that creates custom label for each option.|(option) => null|—|
|
|
80
|
-
**multipleBlocks<br/>LimitMessage**|Function|Defines function that creates notification when maximal limit of selected options has been reached.|(number) => \`and ${number} more items\`|—|
|
|
81
|
-
**inputId**|String, Number|"id" attribute of search field.|null|—|
|
|
82
|
-
**preselected<br/>Option**|UnionPropType (from types)|Defines options that will be select by default.|null|—|
|
|
83
|
-
**value**|Array|Defines value of extended multiselect that can be used in "v-model".|[]|—|
|
|
84
|
-
|
|
85
|
-
## Slots list
|
|
86
|
-
Slot name | Slot appointment | Slot scope
|
|
87
|
-
----------|------------------|-----------
|
|
88
|
-
**option**|Option in options list with its label.|``option`` — option from options list,<br/>``createCustomOptionLabel`` — function that creates custom label for each option|
|
|
89
|
-
**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|
|
|
90
|
-
**marker**|Marker that indicates state of option selection.|—|
|
|
91
|
-
**maxElements**|Message displayed if maximal limit of elements with selected options has been shown.|—|
|
|
92
|
-
**showMore**|Button that increases limit of displayed elements with selected options.|``showMoreOptions`` — function that increases limit of displayed elements with selected options|
|
|
93
|
-
**noResults**|Message displayed if no options have been found by internal search.|—|
|
|
94
|
-
**noOptions**|Message displayed if given options list is empty.|—|
|
|
95
|
-
**listHeader**|Element at the top of options list for information content.|—|
|
|
96
|
-
**listFooter**|Element at the bottom of options list for information content.|—|
|
|
97
|
-
**toggle**|Button that toggles options list display.|``toggleOptionsList`` — function that toggles options list display|
|
|
98
|
-
**labelBlock**|Element with single selected option that is shown if search field display is disabled.|``labelBlockValue`` — option label|
|
|
99
|
-
**moreThanLimit**|Message displayed if maximal limit of selected options has been reached.|—|
|
|
100
|
-
**lessThanLimit**|Message displayed if minimal limit of selected options has not been reached.|—|
|
|
101
|
-
**cancel**|Button that deselects all options.|``cancel`` — function that deselects all options|
|
|
102
|
-
|
|
103
|
-
## Events list
|
|
104
|
-
Event name | Event appointment | Listener method | Simplified event payload | Fields of object with full event payload |
|
|
105
|
-
-----------|-------------------|-----------------|--------------------------|-----------------------------------------|
|
|
106
|
-
**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|
|
|
107
|
-
**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|
|
|
108
|
-
**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|
|
|
109
|
-
**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|
|
|
110
|
-
**active**|Dropdown options list expanding.|@active|—|``inputId`` — id of search field set by "id" prop|
|
|
111
|
-
**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|
|
|
112
|
-
**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|
|
|
113
|
-
|
|
114
|
-
## License
|
|
115
|
-
|
|
116
|
-
[MIT](LICENSE)
|
|
1
|
+
# vue3-extended-multiselect v0.1.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
|
+
## Props list
|
|
30
|
+
Prop name | Prop type | Prop appointment | Prop default value | Prop values
|
|
31
|
+
----------|-----------|------------------|--------------------|------------
|
|
32
|
+
**autoSelect<br/>CreatedOption**|Boolean|Determines whether to select just now created option automatically.|false|—|
|
|
33
|
+
**clearBySelect<br/>WhenMultiple**|Boolean|Determines whether to clear search field by option selection.|false|—|
|
|
34
|
+
**createOnThe<br/>Go**|Boolean|Allows user to create new options from search field.|false|—|
|
|
35
|
+
**default<br/>Expanded**|Boolean|Determines whether options list should be expanded by default.|false|—|
|
|
36
|
+
**disabled**|Boolean|Disables extended multiselect.|false|—|
|
|
37
|
+
**highlight<br/>Options**|Boolean|Switches options highlighting while hovering.|true|—|
|
|
38
|
+
**loading**|Boolean|Switches loading state of extended multiselect.|false|—|
|
|
39
|
+
**multiple**|Boolean|Allows user to select multiple options.|false|—|
|
|
40
|
+
**noResults<br/>BlockShown**|Boolean|Determines whether to show special hint if no options were found.|true|—|
|
|
41
|
+
**resetSearch<br/>ByValue**|Boolean|Determines whether to clear search field by selection/deselection of options.|true|—|
|
|
42
|
+
**searchFilter<br/>Active**|Boolean|Allows user to use internal search for options.|true|—|
|
|
43
|
+
**simpleEvents**|Boolean|Switches full payload of extended multiselect events.|true|—|
|
|
44
|
+
**selected<br/>Options<br/>Shown**|Boolean|Determines whether to show selected options in options list.|false|—|
|
|
45
|
+
**showClearIcon**|Boolean|Allows user to deselect all options by special icon.|false|—|
|
|
46
|
+
**showInsert<br/>Warnings**|Boolean|Determines whether to show useful internal warnings in console.|false|—|
|
|
47
|
+
**showMarker**|Boolean|Determines whether to show slot with special marker beside option in options list.|false|—|
|
|
48
|
+
**showSearch<br/>Field**|Boolean|Determines whether to show search field which allows user to search for options with internal search.|true|—|
|
|
49
|
+
**toggleMultiple<br/>BlocksLimit**|Boolean|Allows user to increase limit of shown elements with selected options by special icon.|false|—|
|
|
50
|
+
**toggleOptions<br/>BySelect**|Boolean|Determines whether to roll up options list by selection of option.|true|—|
|
|
51
|
+
**togglingSaves<br/>SearchValue**|Boolean|Determines whether to save current search value if display of options list was toggled.|true|—|
|
|
52
|
+
**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|—|
|
|
53
|
+
**createOption<br/>Placeholder**|String|Placeholder for the search field to be used if user is allowed to create new options.|"Select or create features"|—|
|
|
54
|
+
**createOption<br/>Type**|String|Defines kind for all options which will be created by user.|"primitive"| "primitive", "array", "object"|
|
|
55
|
+
**emptyObjects<br/>Placeholder**|String|Placeholder for options of type "object" or Array instances which length/keys length equals 0.|"Empty Object/<br/>Array"|—|
|
|
56
|
+
**errorBorder<br/>Color**|String|Defines "border-color" css-property for extended multiselect with wrong value.|"#FF0000"|—|
|
|
57
|
+
**iconFilter**|String|Defines svg-filter with color settings for all icons except loader.|"basic"|"basic", "black", "green"|
|
|
58
|
+
**iconSize**|String|Defines sizes for all icons in pixels except loader.|"large"|"large", "medium", "small"|
|
|
59
|
+
**label**|String|Defines field in options of type "object" that will be the label of option.|"label"|—|
|
|
60
|
+
**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"|
|
|
61
|
+
**placeholder**|String|Placeholder for search field to be used if user is not allowed to create new options.|"Select features"|—|
|
|
62
|
+
**themeType**|String|Defines overall color theme for extended multiselect.|"basic"|"basic", "slate-grey", "slate-blue", "teal",<br/> "strict"|
|
|
63
|
+
**toggle<br/>Appearance<br/>Side**|String|Defines which side options list will be displayed on.|"auto"|"auto", "atop", "under"|
|
|
64
|
+
**toggleIcon**|String|Defines kind of toggle icon from icons collection.|"double-arrow"|"base-arrow", "double-arrow", "wide-arrow", "circle-arrow", "inner-arrow", "triangle-arrow", "triangle-circle-arrow"|
|
|
65
|
+
**anyOption<br/>Wrapper<br/>BlockHeight**|Number|Defines "height" css-property for each option in options list.|30|—|
|
|
66
|
+
**increase<br/>Display<br/>By**|Number|Defines gap which increases limit of displayed elements with selected options.|5|—|
|
|
67
|
+
**maxOptions<br/>Count**|Number|Maximal limit of selected options.|null|—|
|
|
68
|
+
**minOptions<br/>Count**|Number|Minimal limit of selected options.|null|—|
|
|
69
|
+
**multipleBlocks<br/>Limit**|Number|Defines limit of displayed elements with selected options.|null|—|
|
|
70
|
+
**optionsCount<br/>Restriction**|Number|Defines maximal limit of options list length.|null|—|
|
|
71
|
+
**toggleMax<br/>Height**|Number|Defines maximal value in pixels of "max-height" css-property for options list.|400|—|
|
|
72
|
+
**toggleMin<br/>Height**|Number|Defines minimal value in pixels of "max-height" css-property for options list.|null|—|
|
|
73
|
+
**createOption<br/>Fields**|Array|Defines a list of fields for options of type "object" created by user.|["label"]|—|
|
|
74
|
+
**disabled<br/>Primitive<br/>Options**|Array|Defines a list of primitive types for options. Options of given types will be disabled for selection.|[]|—|
|
|
75
|
+
**options**|Array|Raw options list.|[]|—|
|
|
76
|
+
**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.|[]|—|
|
|
77
|
+
**preselected<br/>Options**|Array|Defines a list of options that will be select by default.|[]|—|
|
|
78
|
+
**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"|
|
|
79
|
+
**createCustom<br/>OptionLabel**|Function|Defines function that creates custom label for each option.|(option) => null|—|
|
|
80
|
+
**multipleBlocks<br/>LimitMessage**|Function|Defines function that creates notification when maximal limit of selected options has been reached.|(number) => \`and ${number} more items\`|—|
|
|
81
|
+
**inputId**|String, Number|"id" attribute of search field.|null|—|
|
|
82
|
+
**preselected<br/>Option**|UnionPropType (from types)|Defines options that will be select by default.|null|—|
|
|
83
|
+
**value**|Array|Defines value of extended multiselect that can be used in "v-model".|[]|—|
|
|
84
|
+
|
|
85
|
+
## Slots list
|
|
86
|
+
Slot name | Slot appointment | Slot scope
|
|
87
|
+
----------|------------------|-----------
|
|
88
|
+
**option**|Option in options list with its label.|``option`` — option from options list,<br/>``createCustomOptionLabel`` — function that creates custom label for each option|
|
|
89
|
+
**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|
|
|
90
|
+
**marker**|Marker that indicates state of option selection.|—|
|
|
91
|
+
**maxElements**|Message displayed if maximal limit of elements with selected options has been shown.|—|
|
|
92
|
+
**showMore**|Button that increases limit of displayed elements with selected options.|``showMoreOptions`` — function that increases limit of displayed elements with selected options|
|
|
93
|
+
**noResults**|Message displayed if no options have been found by internal search.|—|
|
|
94
|
+
**noOptions**|Message displayed if given options list is empty.|—|
|
|
95
|
+
**listHeader**|Element at the top of options list for information content.|—|
|
|
96
|
+
**listFooter**|Element at the bottom of options list for information content.|—|
|
|
97
|
+
**toggle**|Button that toggles options list display.|``toggleOptionsList`` — function that toggles options list display|
|
|
98
|
+
**labelBlock**|Element with single selected option that is shown if search field display is disabled.|``labelBlockValue`` — option label|
|
|
99
|
+
**moreThanLimit**|Message displayed if maximal limit of selected options has been reached.|—|
|
|
100
|
+
**lessThanLimit**|Message displayed if minimal limit of selected options has not been reached.|—|
|
|
101
|
+
**cancel**|Button that deselects all options.|``cancel`` — function that deselects all options|
|
|
102
|
+
|
|
103
|
+
## Events list
|
|
104
|
+
Event name | Event appointment | Listener method | Simplified event payload | Fields of object with full event payload |
|
|
105
|
+
-----------|-------------------|-----------------|--------------------------|-----------------------------------------|
|
|
106
|
+
**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|
|
|
107
|
+
**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|
|
|
108
|
+
**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|
|
|
109
|
+
**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|
|
|
110
|
+
**active**|Dropdown options list expanding.|@active|—|``inputId`` — id of search field set by "id" prop|
|
|
111
|
+
**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|
|
|
112
|
+
**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|
|
|
113
|
+
|
|
114
|
+
## License
|
|
115
|
+
|
|
116
|
+
[MIT](LICENSE)
|
package/jest.config.js
CHANGED
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
preset: '@vue/cli-plugin-unit-jest',
|
|
3
|
-
transform: {
|
|
4
|
-
'^.+\\.vue$': 'vue-jest'
|
|
5
|
-
},
|
|
6
|
-
expand: true,
|
|
7
|
-
displayName: {
|
|
8
|
-
name: "vue3-extended-multiselect",
|
|
9
|
-
color: "bgGreen",
|
|
10
|
-
},
|
|
11
|
-
extraGlobals: [],
|
|
12
|
-
globals: {
|
|
13
|
-
OPTIONS: [
|
|
14
|
-
{ label: "First Option", customLabel: "First Option Custom Label" },
|
|
15
|
-
{ label: "Second Option" },
|
|
16
|
-
126,
|
|
17
|
-
],
|
|
18
|
-
INPUT_ID: "vue3-extended-multiselect-input-1",
|
|
19
|
-
SEARCH_VALUE: "Search for options",
|
|
20
|
-
SEARCH_VALUE_WITH_RESULTS: "First",
|
|
21
|
-
MORE_THAN_LIMIT: "You have to select no more than one option",
|
|
22
|
-
LESS_THAN_LIMIT: "You have to select at least two options",
|
|
23
|
-
},
|
|
24
|
-
include: [
|
|
25
|
-
"<rootDir>/components/ExtendedMultiselectOptions.vue"
|
|
26
|
-
],
|
|
27
|
-
injectGlobals: true,
|
|
28
|
-
moduleFileExtensions: [
|
|
29
|
-
"ts",
|
|
30
|
-
"tsx",
|
|
31
|
-
"js",
|
|
32
|
-
"json",
|
|
33
|
-
"jsx",
|
|
34
|
-
"mjs",
|
|
35
|
-
"node",
|
|
36
|
-
"vue"
|
|
37
|
-
],
|
|
38
|
-
moduleNameMapper: {
|
|
39
|
-
"\\.svg$" : "<rootDir>/tests/utils/stubs",
|
|
40
|
-
"\\.
|
|
41
|
-
},
|
|
42
|
-
modulePathIgnorePatterns: ["<rootDir>/assets"],
|
|
43
|
-
resetModules: true,
|
|
44
|
-
resetMocks: true,
|
|
45
|
-
rootDir: "./",
|
|
46
|
-
slowTestThreshold: 20,
|
|
47
|
-
testEnvironment: "jsdom",
|
|
48
|
-
testLocationInResults: true,
|
|
49
|
-
testMatch: [
|
|
50
|
-
"**/tests/**/*.[jt]s?(x)",
|
|
51
|
-
"**/?(*.)+(spec|test).[tj]s?(x)"
|
|
52
|
-
],
|
|
53
|
-
testPathIgnorePatterns: [
|
|
54
|
-
"tests/utils"
|
|
55
|
-
],
|
|
56
|
-
timers: "real",
|
|
57
|
-
}
|
|
1
|
+
module.exports = {
|
|
2
|
+
preset: '@vue/cli-plugin-unit-jest',
|
|
3
|
+
transform: {
|
|
4
|
+
'^.+\\.vue$': 'vue-jest'
|
|
5
|
+
},
|
|
6
|
+
expand: true,
|
|
7
|
+
displayName: {
|
|
8
|
+
name: "vue3-extended-multiselect",
|
|
9
|
+
color: "bgGreen",
|
|
10
|
+
},
|
|
11
|
+
extraGlobals: [],
|
|
12
|
+
globals: {
|
|
13
|
+
OPTIONS: [
|
|
14
|
+
{ label: "First Option", customLabel: "First Option Custom Label" },
|
|
15
|
+
{ label: "Second Option" },
|
|
16
|
+
126,
|
|
17
|
+
],
|
|
18
|
+
INPUT_ID: "vue3-extended-multiselect-input-1",
|
|
19
|
+
SEARCH_VALUE: "Search for options",
|
|
20
|
+
SEARCH_VALUE_WITH_RESULTS: "First",
|
|
21
|
+
MORE_THAN_LIMIT: "You have to select no more than one option",
|
|
22
|
+
LESS_THAN_LIMIT: "You have to select at least two options",
|
|
23
|
+
},
|
|
24
|
+
include: [
|
|
25
|
+
"<rootDir>/components/ExtendedMultiselectOptions.vue"
|
|
26
|
+
],
|
|
27
|
+
injectGlobals: true,
|
|
28
|
+
moduleFileExtensions: [
|
|
29
|
+
"ts",
|
|
30
|
+
"tsx",
|
|
31
|
+
"js",
|
|
32
|
+
"json",
|
|
33
|
+
"jsx",
|
|
34
|
+
"mjs",
|
|
35
|
+
"node",
|
|
36
|
+
"vue"
|
|
37
|
+
],
|
|
38
|
+
moduleNameMapper: {
|
|
39
|
+
"\\.svg$" : "<rootDir>/tests/utils/stubs",
|
|
40
|
+
"\\.scss$" : "identity-obj-proxy",
|
|
41
|
+
},
|
|
42
|
+
modulePathIgnorePatterns: ["<rootDir>/assets"],
|
|
43
|
+
resetModules: true,
|
|
44
|
+
resetMocks: true,
|
|
45
|
+
rootDir: "./",
|
|
46
|
+
slowTestThreshold: 20,
|
|
47
|
+
testEnvironment: "jsdom",
|
|
48
|
+
testLocationInResults: true,
|
|
49
|
+
testMatch: [
|
|
50
|
+
"**/tests/**/*.[jt]s?(x)",
|
|
51
|
+
"**/?(*.)+(spec|test).[tj]s?(x)"
|
|
52
|
+
],
|
|
53
|
+
testPathIgnorePatterns: [
|
|
54
|
+
"tests/utils"
|
|
55
|
+
],
|
|
56
|
+
timers: "real",
|
|
57
|
+
}
|
package/package.json
CHANGED
|
@@ -1,45 +1,47 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "vue3-extended-multiselect",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "Extended multiselect component for applications based on Vue 3 framework",
|
|
5
|
-
"keywords": [
|
|
6
|
-
"multiselect",
|
|
7
|
-
"select",
|
|
8
|
-
"extended",
|
|
9
|
-
"vue",
|
|
10
|
-
"vue3"
|
|
11
|
-
],
|
|
12
|
-
"typings": "typings/vue3-extended-multiselect.d.ts",
|
|
13
|
-
"
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
"
|
|
23
|
-
"
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
"
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
"@vue
|
|
34
|
-
"@vue/cli-
|
|
35
|
-
"@vue/
|
|
36
|
-
"@vue/
|
|
37
|
-
"
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"vue
|
|
44
|
-
|
|
45
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "vue3-extended-multiselect",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Extended multiselect component for applications based on Vue 3 framework",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"multiselect",
|
|
7
|
+
"select",
|
|
8
|
+
"extended",
|
|
9
|
+
"vue",
|
|
10
|
+
"vue3"
|
|
11
|
+
],
|
|
12
|
+
"typings": "typings/vue3-extended-multiselect.d.ts",
|
|
13
|
+
"repository": {
|
|
14
|
+
"type": "git",
|
|
15
|
+
"url": "https://github.com/danyaridiger/vue3-extended-multiselect.git"
|
|
16
|
+
},
|
|
17
|
+
"author": "Ridiger Daniil Dmitrievich <extendedmultiselect@yandex.ru>",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"scripts": {
|
|
20
|
+
"start": "vue-cli-service serve",
|
|
21
|
+
"build": "vue-cli-service build",
|
|
22
|
+
"test:unit": "vue-cli-service test:unit",
|
|
23
|
+
"lint": "vue-cli-service lint"
|
|
24
|
+
},
|
|
25
|
+
"dependencies": {
|
|
26
|
+
"click-outside": "^2.0.2",
|
|
27
|
+
"core-js": "^3.6.5",
|
|
28
|
+
"lodash.debounce": "^4.0.8",
|
|
29
|
+
"tiny-emitter": "^2.1.0",
|
|
30
|
+
"vue": "^3.0.0"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@testing-library/vue": "^6.6.1",
|
|
34
|
+
"@vue/cli-plugin-babel": "~4.5.19",
|
|
35
|
+
"@vue/cli-plugin-eslint": "~4.5.19",
|
|
36
|
+
"@vue/cli-plugin-unit-jest": "~4.5.19",
|
|
37
|
+
"@vue/cli-plugin-vuex": "~4.5.19",
|
|
38
|
+
"@vue/cli-service": "~4.5.19",
|
|
39
|
+
"@vue/compiler-sfc": "^3.0.0",
|
|
40
|
+
"@vue/test-utils": "^2.0.0-0",
|
|
41
|
+
"babel-eslint": "^10.1.0",
|
|
42
|
+
"eslint": "^6.7.2",
|
|
43
|
+
"eslint-plugin-vue": "^7.0.0",
|
|
44
|
+
"typescript": "~3.9.3",
|
|
45
|
+
"vue-jest": "^5.0.0-0"
|
|
46
|
+
}
|
|
47
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
2
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 26 26">
|
|
3
|
-
<g>
|
|
4
|
-
<path d="m13,0c-7.2,0-13,5.8-13,13s5.8,13 13,13 13-5.8 13-13-5.8-13-13-13zm0,22c-5,0-9-4-9-9s4-9 9-9 9,4 9,9-4,9-9,9z"/>
|
|
5
|
-
<path d="M18.8,14.4l-5-6C13.6,8.2,13.3,8,13,8s-0.6,0.1-0.8,0.4l-5,6l-0.1,0.1C7,14.7,7,14.8,7,15c0,0.3,0.2,0.7,0.5,0.9l1.7,1 C9.3,17,9.5,17,9.7,17c0.3,0,0.5-0.1,0.7-0.3l1.8-2.1c0.4-0.5,1.1-0.5,1.5,0l1.8,2.1c0.2,0.2,0.4,0.3,0.7,0.3c0.2,0,0.4,0,0.5-0.1 l1.7-1c0.3-0.2,0.5-0.5,0.5-0.9c0-0.2,0-0.3-0.1-0.5C18.8,14.4,18.8,14.4,18.8,14.4z"/>
|
|
6
|
-
</g>
|
|
7
|
-
</svg>
|
|
1
|
+
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 26 26" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 26 26">
|
|
3
|
+
<g>
|
|
4
|
+
<path d="m13,0c-7.2,0-13,5.8-13,13s5.8,13 13,13 13-5.8 13-13-5.8-13-13-13zm0,22c-5,0-9-4-9-9s4-9 9-9 9,4 9,9-4,9-9,9z"/>
|
|
5
|
+
<path d="M18.8,14.4l-5-6C13.6,8.2,13.3,8,13,8s-0.6,0.1-0.8,0.4l-5,6l-0.1,0.1C7,14.7,7,14.8,7,15c0,0.3,0.2,0.7,0.5,0.9l1.7,1 C9.3,17,9.5,17,9.7,17c0.3,0,0.5-0.1,0.7-0.3l1.8-2.1c0.4-0.5,1.1-0.5,1.5,0l1.8,2.1c0.2,0.2,0.4,0.3,0.7,0.3c0.2,0,0.4,0,0.5-0.1 l1.7-1c0.3-0.2,0.5-0.5,0.5-0.9c0-0.2,0-0.3-0.1-0.5C18.8,14.4,18.8,14.4,18.8,14.4z"/>
|
|
6
|
+
</g>
|
|
7
|
+
</svg>
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
2
|
-
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 137.145 137.145" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 137.145 137.145">
|
|
3
|
-
<g>
|
|
4
|
-
<g>
|
|
5
|
-
<path d="m37.711,89.198l30.861-28.835-10.287-9.612-30.861,28.835 10.287,9.612zm72.004-89.198h-82.286c-15.149,0-27.429,12.281-27.429,27.429v82.287c0,15.148 12.28,27.429 27.429,27.429h82.286c15.149,0 27.429-12.28 27.429-27.429v-82.287c0-15.148-12.28-27.429-27.429-27.429zm13.715,102.858c0,11.361-9.21,20.572-20.572,20.572h-68.572c-11.361,0-20.571-9.211-20.571-20.572v-68.572c0-11.361 9.21-20.572 20.571-20.572h68.572c11.361,0 20.572,9.211 20.572,20.572v68.572zm-65.145-52.107l41.148,38.447 10.287-9.612-41.148-38.446-10.287,9.611z"/>
|
|
6
|
-
</g>
|
|
7
|
-
</g>
|
|
8
|
-
</svg>
|
|
1
|
+
<?xml version='1.0' encoding='iso-8859-1'?>
|
|
2
|
+
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 137.145 137.145" xmlns:xlink="http://www.w3.org/1999/xlink" enable-background="new 0 0 137.145 137.145">
|
|
3
|
+
<g>
|
|
4
|
+
<g>
|
|
5
|
+
<path d="m37.711,89.198l30.861-28.835-10.287-9.612-30.861,28.835 10.287,9.612zm72.004-89.198h-82.286c-15.149,0-27.429,12.281-27.429,27.429v82.287c0,15.148 12.28,27.429 27.429,27.429h82.286c15.149,0 27.429-12.28 27.429-27.429v-82.287c0-15.148-12.28-27.429-27.429-27.429zm13.715,102.858c0,11.361-9.21,20.572-20.572,20.572h-68.572c-11.361,0-20.571-9.211-20.571-20.572v-68.572c0-11.361 9.21-20.572 20.571-20.572h68.572c11.361,0 20.572,9.211 20.572,20.572v68.572zm-65.145-52.107l41.148,38.447 10.287-9.612-41.148-38.446-10.287,9.611z"/>
|
|
6
|
+
</g>
|
|
7
|
+
</g>
|
|
8
|
+
</svg>
|