vue3-extended-multiselect 0.1.2 → 0.1.3

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 (40) hide show
  1. package/.eslintrc.js +29 -29
  2. package/.github/workflows/publish.yml +41 -0
  3. package/.nvmrc +0 -0
  4. package/CHANGELOG.md +47 -43
  5. package/LICENSE +21 -21
  6. package/README.md +116 -116
  7. package/index.js +2 -2
  8. package/jest.config.js +57 -57
  9. package/package.json +46 -46
  10. package/src/assets/base-arrow.svg +70 -70
  11. package/src/assets/cancel.svg +34 -34
  12. package/src/assets/circle-arrow.svg +7 -7
  13. package/src/assets/double-arrow.svg +39 -39
  14. package/src/assets/inner-arrow.svg +8 -8
  15. package/src/assets/loader.svg +5 -5
  16. package/src/assets/triangle-arrow.svg +72 -72
  17. package/src/assets/triangle-circle-arrow.svg +38 -38
  18. package/src/assets/wide-arrow.svg +72 -72
  19. package/src/components/ExtendedMultiselectCancel.vue +142 -142
  20. package/src/components/ExtendedMultiselectInput.vue +618 -618
  21. package/src/components/ExtendedMultiselectLoader.vue +176 -176
  22. package/src/components/ExtendedMultiselectMultiple.vue +291 -291
  23. package/src/components/ExtendedMultiselectOptions.vue +1087 -1087
  24. package/src/components/ExtendedMultiselectToggle.vue +254 -254
  25. package/src/components/Vue3ExtendedMultiselect.vue +1651 -1651
  26. package/src/composition/cancel.js +30 -30
  27. package/src/composition/labels.js +39 -39
  28. package/src/composition/preselected-options.js +66 -66
  29. package/src/composition/search-value.js +33 -33
  30. package/src/composition/sizes.js +42 -42
  31. package/src/composition/toggle.js +33 -33
  32. package/src/sets/sets.js +99 -99
  33. package/src/styles/animations.css +19 -19
  34. package/src/styles/main.css +433 -433
  35. package/src/styles/variables.css +41 -41
  36. package/tests/unit/events.spec.js +135 -135
  37. package/tests/unit/props.spec.js +1040 -1040
  38. package/tests/utils/mount.js +37 -37
  39. package/tests/utils/utils.js +20 -20
  40. package/typings/vue3-extended-multiselect.d.ts +33 -33
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
+ }
@@ -0,0 +1,41 @@
1
+ # This workflow will run tests using node and then publish a package to GitHub Packages when changes were pushed
2
+ # For more information see: https://docs.github.com/en/actions/publishing-packages/publishing-nodejs-packages
3
+
4
+ name: publish
5
+
6
+ on:
7
+ push:
8
+ branches:
9
+ - master
10
+
11
+ jobs:
12
+ tests-checkout:
13
+ runs-on: ubuntu-latest
14
+ steps:
15
+ - name: checkout
16
+ uses: actions/checkout@v3
17
+ - name: node
18
+ uses: actions/setup-node@v3
19
+ with:
20
+ node-version: 16
21
+ registry-url: https://registry.npmjs.org/
22
+ - name: install
23
+ run: npm install
24
+ - name: tests
25
+ run: npm run test:unit
26
+
27
+ publish-npm:
28
+ needs: tests-checkout
29
+ runs-on: ubuntu-latest
30
+ steps:
31
+ - name: checkout
32
+ uses: actions/checkout@v3
33
+ - name: node
34
+ uses: actions/setup-node@v3
35
+ with:
36
+ node-version: 16
37
+ registry-url: https://registry.npmjs.org/
38
+ - name: publish
39
+ run: npm publish --access public
40
+ env:
41
+ NODE_AUTH_TOKEN: ${{secrets.NPM_TOKEN}}
package/.nvmrc ADDED
Binary file
package/CHANGELOG.md CHANGED
@@ -1,43 +1,47 @@
1
- ## Patch notes
2
-
3
- Current vue3-extended-multiselect version: **0.1.2**
4
-
5
- ***
6
-
7
- #### 0.0.1
8
-
9
- Component `vue3-extended-multiselect` was released.
10
-
11
- #### 0.0.2
12
-
13
- Small fixes in documentation.
14
-
15
- #### 0.0.3
16
-
17
- Changing font-size property of "props" table in documentation.
18
-
19
- #### 0.0.4
20
-
21
- Correction of cancel button highlighting while loading.
22
-
23
- #### 0.0.5
24
-
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".
36
-
37
- #### 0.1.1
38
-
39
- Placeholder color fixes.
40
-
41
- #### 0.1.2
42
-
43
- Removal of excess symbol in styles.
1
+ # Patch notes
2
+
3
+ Current `vue3-extended-multiselect` version: **0.1.3**
4
+
5
+ ***
6
+
7
+ ### 0.0.1 (2022-11-29)
8
+
9
+ Component `vue3-extended-multiselect` was released.
10
+
11
+ ### 0.0.2 (2022-11-29)
12
+
13
+ Small fixes in documentation.
14
+
15
+ ### 0.0.3 (2022-11-29)
16
+
17
+ Changing font-size property of "props" table in documentation.
18
+
19
+ ### 0.0.4 (2022-11-30)
20
+
21
+ Correction of cancel button highlighting while loading.
22
+
23
+ ### 0.0.5 (2022-11-30)
24
+
25
+ Changing tables format in documentation.
26
+
27
+ ### 0.0.6 (2022-11-30)
28
+
29
+ Relocation of main.js file for local qa tests.
30
+
31
+ ### 0.1.0 (2022-12-01)
32
+
33
+ * Changing the style language from `sass` to `css` for for greater package accessibility.
34
+ * Removal of dev-dependency "sass".
35
+ * Removal of dev-dependency "sass-loader".
36
+
37
+ ### 0.1.1 (2022-12-01)
38
+
39
+ Placeholder color fixes.
40
+
41
+ ### 0.1.2 (2022-12-01)
42
+
43
+ Removal of excess symbol in styles.
44
+
45
+ ### 0.1.3 (2022-12-05)
46
+
47
+ Adding .nvmrc file.
package/LICENSE CHANGED
@@ -1,21 +1,21 @@
1
- The MIT License (MIT)
2
-
3
- Copyright (c) 2022-present, Ridiger Daniil Dmitrievich<extendedmultiselect@yandex.ru>
4
-
5
- Permission is hereby granted, free of charge, to any person obtaining a copy
6
- of this software and associated documentation files (the "Software"), to deal
7
- in the Software without restriction, including without limitation the rights
8
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- copies of the Software, and to permit persons to whom the Software is
10
- furnished to do so, subject to the following conditions:
11
-
12
- The above copyright notice and this permission notice shall be included in all
13
- copies or substantial portions of the Software.
14
-
15
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
- SOFTWARE.
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2022-present, Ridiger Daniil Dmitrievich<extendedmultiselect@yandex.ru>
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,116 +1,116 @@
1
- # vue3-extended-multiselect v0.1.2
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|&mdash;|
33
- **clearBySelect<br/>WhenMultiple**|Boolean|Determines whether to clear search field by option selection.|false|&mdash;|
34
- **createOnThe<br/>Go**|Boolean|Allows user to create new options from search field.|false|&mdash;|
35
- **default<br/>Expanded**|Boolean|Determines whether options list should be expanded by default.|false|&mdash;|
36
- **disabled**|Boolean|Disables extended multiselect.|false|&mdash;|
37
- **highlight<br/>Options**|Boolean|Switches options highlighting while hovering.|true|&mdash;|
38
- **loading**|Boolean|Switches loading state of extended multiselect.|false|&mdash;|
39
- **multiple**|Boolean|Allows user to select multiple options.|false|&mdash;|
40
- **noResults<br/>BlockShown**|Boolean|Determines whether to show special hint if no options were found.|true|&mdash;|
41
- **resetSearch<br/>ByValue**|Boolean|Determines whether to clear search field by selection/deselection of options.|true|&mdash;|
42
- **searchFilter<br/>Active**|Boolean|Allows user to use internal search for options.|true|&mdash;|
43
- **simpleEvents**|Boolean|Switches full payload of extended multiselect events.|true|&mdash;|
44
- **selected<br/>Options<br/>Shown**|Boolean|Determines whether to show selected options in options list.|false|&mdash;|
45
- **showClearIcon**|Boolean|Allows user to deselect all options by special icon.|false|&mdash;|
46
- **showInsert<br/>Warnings**|Boolean|Determines whether to show useful internal warnings in console.|false|&mdash;|
47
- **showMarker**|Boolean|Determines whether to show slot with special marker beside option in options list.|false|&mdash;|
48
- **showSearch<br/>Field**|Boolean|Determines whether to show search field which allows user to search for options with internal search.|true|&mdash;|
49
- **toggleMultiple<br/>BlocksLimit**|Boolean|Allows user to increase limit of shown elements with selected options by special icon.|false|&mdash;|
50
- **toggleOptions<br/>BySelect**|Boolean|Determines whether to roll up options list by selection of option.|true|&mdash;|
51
- **togglingSaves<br/>SearchValue**|Boolean|Determines whether to save current search value if display of options list was toggled.|true|&mdash;|
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|&mdash;|
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"|&mdash;|
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"|&mdash;|
56
- **errorBorder<br/>Color**|String|Defines "border-color" css-property for extended multiselect with wrong value.|"#FF0000"|&mdash;|
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"|&mdash;|
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"|&mdash;|
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|&mdash;|
66
- **increase<br/>Display<br/>By**|Number|Defines gap which increases limit of displayed elements with selected options.|5|&mdash;|
67
- **maxOptions<br/>Count**|Number|Maximal limit of selected options.|null|&mdash;|
68
- **minOptions<br/>Count**|Number|Minimal limit of selected options.|null|&mdash;|
69
- **multipleBlocks<br/>Limit**|Number|Defines limit of displayed elements with selected options.|null|&mdash;|
70
- **optionsCount<br/>Restriction**|Number|Defines maximal limit of options list length.|null|&mdash;|
71
- **toggleMax<br/>Height**|Number|Defines maximal value in pixels of "max-height" css-property for options list.|400|&mdash;|
72
- **toggleMin<br/>Height**|Number|Defines minimal value in pixels of "max-height" css-property for options list.|null|&mdash;|
73
- **createOption<br/>Fields**|Array|Defines a list of fields for options of type "object" created by user.|["label"]|&mdash;|
74
- **disabled<br/>Primitive<br/>Options**|Array|Defines a list of primitive types for options. Options of given types will be disabled for selection.|[]|&mdash;|
75
- **options**|Array|Raw options list.|[]|&mdash;|
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.|[]|&mdash;|
77
- **preselected<br/>Options**|Array|Defines a list of options that will be select by default.|[]|&mdash;|
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|&mdash;|
80
- **multipleBlocks<br/>LimitMessage**|Function|Defines function that creates notification when maximal limit of selected options has been reached.|(number) => \`and ${number} more items\`|&mdash;|
81
- **inputId**|String, Number|"id" attribute of search field.|null|&mdash;|
82
- **preselected<br/>Option**|UnionPropType (from types)|Defines options that will be select by default.|null|&mdash;|
83
- **value**|Array|Defines value of extended multiselect that can be used in "v-model".|[]|&mdash;|
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.|&mdash;|
91
- **maxElements**|Message displayed if maximal limit of elements with selected options has been shown.|&mdash;|
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.|&mdash;|
94
- **noOptions**|Message displayed if given options list is empty.|&mdash;|
95
- **listHeader**|Element at the top of options list for information content.|&mdash;|
96
- **listFooter**|Element at the bottom of options list for information content.|&mdash;|
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.|&mdash;|
100
- **lessThanLimit**|Message displayed if minimal limit of selected options has not been reached.|&mdash;|
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|&mdash;|``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.3
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|&mdash;|
33
+ **clearBySelect<br/>WhenMultiple**|Boolean|Determines whether to clear search field by option selection.|false|&mdash;|
34
+ **createOnThe<br/>Go**|Boolean|Allows user to create new options from search field.|false|&mdash;|
35
+ **default<br/>Expanded**|Boolean|Determines whether options list should be expanded by default.|false|&mdash;|
36
+ **disabled**|Boolean|Disables extended multiselect.|false|&mdash;|
37
+ **highlight<br/>Options**|Boolean|Switches options highlighting while hovering.|true|&mdash;|
38
+ **loading**|Boolean|Switches loading state of extended multiselect.|false|&mdash;|
39
+ **multiple**|Boolean|Allows user to select multiple options.|false|&mdash;|
40
+ **noResults<br/>BlockShown**|Boolean|Determines whether to show special hint if no options were found.|true|&mdash;|
41
+ **resetSearch<br/>ByValue**|Boolean|Determines whether to clear search field by selection/deselection of options.|true|&mdash;|
42
+ **searchFilter<br/>Active**|Boolean|Allows user to use internal search for options.|true|&mdash;|
43
+ **simpleEvents**|Boolean|Switches full payload of extended multiselect events.|true|&mdash;|
44
+ **selected<br/>Options<br/>Shown**|Boolean|Determines whether to show selected options in options list.|false|&mdash;|
45
+ **showClearIcon**|Boolean|Allows user to deselect all options by special icon.|false|&mdash;|
46
+ **showInsert<br/>Warnings**|Boolean|Determines whether to show useful internal warnings in console.|false|&mdash;|
47
+ **showMarker**|Boolean|Determines whether to show slot with special marker beside option in options list.|false|&mdash;|
48
+ **showSearch<br/>Field**|Boolean|Determines whether to show search field which allows user to search for options with internal search.|true|&mdash;|
49
+ **toggleMultiple<br/>BlocksLimit**|Boolean|Allows user to increase limit of shown elements with selected options by special icon.|false|&mdash;|
50
+ **toggleOptions<br/>BySelect**|Boolean|Determines whether to roll up options list by selection of option.|true|&mdash;|
51
+ **togglingSaves<br/>SearchValue**|Boolean|Determines whether to save current search value if display of options list was toggled.|true|&mdash;|
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|&mdash;|
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"|&mdash;|
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"|&mdash;|
56
+ **errorBorder<br/>Color**|String|Defines "border-color" css-property for extended multiselect with wrong value.|"#FF0000"|&mdash;|
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"|&mdash;|
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"|&mdash;|
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|&mdash;|
66
+ **increase<br/>Display<br/>By**|Number|Defines gap which increases limit of displayed elements with selected options.|5|&mdash;|
67
+ **maxOptions<br/>Count**|Number|Maximal limit of selected options.|null|&mdash;|
68
+ **minOptions<br/>Count**|Number|Minimal limit of selected options.|null|&mdash;|
69
+ **multipleBlocks<br/>Limit**|Number|Defines limit of displayed elements with selected options.|null|&mdash;|
70
+ **optionsCount<br/>Restriction**|Number|Defines maximal limit of options list length.|null|&mdash;|
71
+ **toggleMax<br/>Height**|Number|Defines maximal value in pixels of "max-height" css-property for options list.|400|&mdash;|
72
+ **toggleMin<br/>Height**|Number|Defines minimal value in pixels of "max-height" css-property for options list.|null|&mdash;|
73
+ **createOption<br/>Fields**|Array|Defines a list of fields for options of type "object" created by user.|["label"]|&mdash;|
74
+ **disabled<br/>Primitive<br/>Options**|Array|Defines a list of primitive types for options. Options of given types will be disabled for selection.|[]|&mdash;|
75
+ **options**|Array|Raw options list.|[]|&mdash;|
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.|[]|&mdash;|
77
+ **preselected<br/>Options**|Array|Defines a list of options that will be select by default.|[]|&mdash;|
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|&mdash;|
80
+ **multipleBlocks<br/>LimitMessage**|Function|Defines function that creates notification when maximal limit of selected options has been reached.|(number) => \`and ${number} more items\`|&mdash;|
81
+ **inputId**|String, Number|"id" attribute of search field.|null|&mdash;|
82
+ **preselected<br/>Option**|UnionPropType (from types)|Defines options that will be select by default.|null|&mdash;|
83
+ **value**|Array|Defines value of extended multiselect that can be used in "v-model".|[]|&mdash;|
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.|&mdash;|
91
+ **maxElements**|Message displayed if maximal limit of elements with selected options has been shown.|&mdash;|
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.|&mdash;|
94
+ **noOptions**|Message displayed if given options list is empty.|&mdash;|
95
+ **listHeader**|Element at the top of options list for information content.|&mdash;|
96
+ **listFooter**|Element at the bottom of options list for information content.|&mdash;|
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.|&mdash;|
100
+ **lessThanLimit**|Message displayed if minimal limit of selected options has not been reached.|&mdash;|
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|&mdash;|``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/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;
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
- "\\.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
- }
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
+ }