vue3-extended-multiselect 1.0.0 → 1.1.2

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 (41) hide show
  1. package/.eslintrc.js +34 -34
  2. package/.github/workflows/publish.yml +41 -41
  3. package/CHANGELOG.md +109 -91
  4. package/LICENSE +21 -21
  5. package/README.md +261 -261
  6. package/index.js +2 -2
  7. package/jest.config.js +60 -57
  8. package/package.json +47 -47
  9. package/src/assets/base-arrow.svg +70 -70
  10. package/src/assets/cancel.svg +34 -34
  11. package/src/assets/circle-arrow.svg +7 -7
  12. package/src/assets/double-arrow.svg +39 -39
  13. package/src/assets/inner-arrow.svg +8 -8
  14. package/src/assets/loader.svg +5 -5
  15. package/src/assets/triangle-arrow.svg +72 -72
  16. package/src/assets/triangle-circle-arrow.svg +38 -38
  17. package/src/assets/wide-arrow.svg +72 -72
  18. package/src/components/ExtendedMultiselectCancel.vue +148 -148
  19. package/src/components/ExtendedMultiselectInput.vue +617 -617
  20. package/src/components/ExtendedMultiselectLoader.vue +182 -182
  21. package/src/components/ExtendedMultiselectMultiple.vue +295 -295
  22. package/src/components/ExtendedMultiselectOptions.vue +1092 -1091
  23. package/src/components/ExtendedMultiselectToggle.vue +261 -261
  24. package/src/components/Vue3ExtendedMultiselect.vue +1665 -1660
  25. package/src/composition/cancel.js +33 -33
  26. package/src/composition/image-path.js +16 -16
  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/events/emitter.js +2 -2
  33. package/src/sets/sets.js +99 -99
  34. package/src/styles/animations.css +18 -18
  35. package/src/styles/main.css +433 -432
  36. package/src/styles/variables.css +47 -47
  37. package/tests/unit/events.spec.js +135 -135
  38. package/tests/unit/props.spec.js +1040 -1040
  39. package/tests/utils/mount.js +37 -37
  40. package/tests/utils/utils.js +20 -20
  41. package/typings/vue3-extended-multiselect.d.ts +42 -42
@@ -1,72 +1,72 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 491.858 491.858" style="enable-background:new 0 0 491.858 491.858;" xml:space="preserve">
5
- <g>
6
- <g>
7
- <path d="M491.858,442.461c0,13.931-11.293,25.224-25.224,25.224L245.93,373.097L25.224,467.686
8
- C11.292,467.686,0,456.392,0,442.461L227.011,32.58c0,0,18.918-18.918,37.834,0C283.764,51.499,491.858,442.461,491.858,442.461z"
9
- />
10
- </g>
11
- <g>
12
- </g>
13
- <g>
14
- </g>
15
- <g>
16
- </g>
17
- <g>
18
- </g>
19
- <g>
20
- </g>
21
- <g>
22
- </g>
23
- <g>
24
- </g>
25
- <g>
26
- </g>
27
- <g>
28
- </g>
29
- <g>
30
- </g>
31
- <g>
32
- </g>
33
- <g>
34
- </g>
35
- <g>
36
- </g>
37
- <g>
38
- </g>
39
- <g>
40
- </g>
41
- </g>
42
- <g>
43
- </g>
44
- <g>
45
- </g>
46
- <g>
47
- </g>
48
- <g>
49
- </g>
50
- <g>
51
- </g>
52
- <g>
53
- </g>
54
- <g>
55
- </g>
56
- <g>
57
- </g>
58
- <g>
59
- </g>
60
- <g>
61
- </g>
62
- <g>
63
- </g>
64
- <g>
65
- </g>
66
- <g>
67
- </g>
68
- <g>
69
- </g>
70
- <g>
71
- </g>
72
- </svg>
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 19.1.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 491.858 491.858" style="enable-background:new 0 0 491.858 491.858;" xml:space="preserve">
5
+ <g>
6
+ <g>
7
+ <path d="M491.858,442.461c0,13.931-11.293,25.224-25.224,25.224L245.93,373.097L25.224,467.686
8
+ C11.292,467.686,0,456.392,0,442.461L227.011,32.58c0,0,18.918-18.918,37.834,0C283.764,51.499,491.858,442.461,491.858,442.461z"
9
+ />
10
+ </g>
11
+ <g>
12
+ </g>
13
+ <g>
14
+ </g>
15
+ <g>
16
+ </g>
17
+ <g>
18
+ </g>
19
+ <g>
20
+ </g>
21
+ <g>
22
+ </g>
23
+ <g>
24
+ </g>
25
+ <g>
26
+ </g>
27
+ <g>
28
+ </g>
29
+ <g>
30
+ </g>
31
+ <g>
32
+ </g>
33
+ <g>
34
+ </g>
35
+ <g>
36
+ </g>
37
+ <g>
38
+ </g>
39
+ <g>
40
+ </g>
41
+ </g>
42
+ <g>
43
+ </g>
44
+ <g>
45
+ </g>
46
+ <g>
47
+ </g>
48
+ <g>
49
+ </g>
50
+ <g>
51
+ </g>
52
+ <g>
53
+ </g>
54
+ <g>
55
+ </g>
56
+ <g>
57
+ </g>
58
+ <g>
59
+ </g>
60
+ <g>
61
+ </g>
62
+ <g>
63
+ </g>
64
+ <g>
65
+ </g>
66
+ <g>
67
+ </g>
68
+ <g>
69
+ </g>
70
+ <g>
71
+ </g>
72
+ </svg>
@@ -1,38 +1,38 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
5
- <g>
6
- <path style="fill:#030104;" d="M8,0C3.582,0,0,3.582,0,8s3.582,8,8,8s8-3.582,8-8S12.418,0,8,0z M4,11l4-7l4,7H4z"/>
7
- </g>
8
- <g>
9
- </g>
10
- <g>
11
- </g>
12
- <g>
13
- </g>
14
- <g>
15
- </g>
16
- <g>
17
- </g>
18
- <g>
19
- </g>
20
- <g>
21
- </g>
22
- <g>
23
- </g>
24
- <g>
25
- </g>
26
- <g>
27
- </g>
28
- <g>
29
- </g>
30
- <g>
31
- </g>
32
- <g>
33
- </g>
34
- <g>
35
- </g>
36
- <g>
37
- </g>
38
- </svg>
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 18.1.1, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 16 16" style="enable-background:new 0 0 16 16;" xml:space="preserve">
5
+ <g>
6
+ <path style="fill:#030104;" d="M8,0C3.582,0,0,3.582,0,8s3.582,8,8,8s8-3.582,8-8S12.418,0,8,0z M4,11l4-7l4,7H4z"/>
7
+ </g>
8
+ <g>
9
+ </g>
10
+ <g>
11
+ </g>
12
+ <g>
13
+ </g>
14
+ <g>
15
+ </g>
16
+ <g>
17
+ </g>
18
+ <g>
19
+ </g>
20
+ <g>
21
+ </g>
22
+ <g>
23
+ </g>
24
+ <g>
25
+ </g>
26
+ <g>
27
+ </g>
28
+ <g>
29
+ </g>
30
+ <g>
31
+ </g>
32
+ <g>
33
+ </g>
34
+ <g>
35
+ </g>
36
+ <g>
37
+ </g>
38
+ </svg>
@@ -1,72 +1,72 @@
1
- <?xml version="1.0" encoding="iso-8859-1"?>
2
- <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
- <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
- viewBox="0 0 490 490" style="enable-background:new 0 0 490 490;" xml:space="preserve">
5
- <g>
6
- <g>
7
- <g>
8
- <polygon points="0,249.888 245.004,8.139 490,249.888 490,481.861 245.004,239.71 0,481.861 "/>
9
- </g>
10
- </g>
11
- <g>
12
- </g>
13
- <g>
14
- </g>
15
- <g>
16
- </g>
17
- <g>
18
- </g>
19
- <g>
20
- </g>
21
- <g>
22
- </g>
23
- <g>
24
- </g>
25
- <g>
26
- </g>
27
- <g>
28
- </g>
29
- <g>
30
- </g>
31
- <g>
32
- </g>
33
- <g>
34
- </g>
35
- <g>
36
- </g>
37
- <g>
38
- </g>
39
- <g>
40
- </g>
41
- </g>
42
- <g>
43
- </g>
44
- <g>
45
- </g>
46
- <g>
47
- </g>
48
- <g>
49
- </g>
50
- <g>
51
- </g>
52
- <g>
53
- </g>
54
- <g>
55
- </g>
56
- <g>
57
- </g>
58
- <g>
59
- </g>
60
- <g>
61
- </g>
62
- <g>
63
- </g>
64
- <g>
65
- </g>
66
- <g>
67
- </g>
68
- <g>
69
- </g>
70
- <g>
71
- </g>
72
- </svg>
1
+ <?xml version="1.0" encoding="iso-8859-1"?>
2
+ <!-- Generator: Adobe Illustrator 19.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 0) -->
3
+ <svg version="1.1" id="Capa_1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" x="0px" y="0px"
4
+ viewBox="0 0 490 490" style="enable-background:new 0 0 490 490;" xml:space="preserve">
5
+ <g>
6
+ <g>
7
+ <g>
8
+ <polygon points="0,249.888 245.004,8.139 490,249.888 490,481.861 245.004,239.71 0,481.861 "/>
9
+ </g>
10
+ </g>
11
+ <g>
12
+ </g>
13
+ <g>
14
+ </g>
15
+ <g>
16
+ </g>
17
+ <g>
18
+ </g>
19
+ <g>
20
+ </g>
21
+ <g>
22
+ </g>
23
+ <g>
24
+ </g>
25
+ <g>
26
+ </g>
27
+ <g>
28
+ </g>
29
+ <g>
30
+ </g>
31
+ <g>
32
+ </g>
33
+ <g>
34
+ </g>
35
+ <g>
36
+ </g>
37
+ <g>
38
+ </g>
39
+ <g>
40
+ </g>
41
+ </g>
42
+ <g>
43
+ </g>
44
+ <g>
45
+ </g>
46
+ <g>
47
+ </g>
48
+ <g>
49
+ </g>
50
+ <g>
51
+ </g>
52
+ <g>
53
+ </g>
54
+ <g>
55
+ </g>
56
+ <g>
57
+ </g>
58
+ <g>
59
+ </g>
60
+ <g>
61
+ </g>
62
+ <g>
63
+ </g>
64
+ <g>
65
+ </g>
66
+ <g>
67
+ </g>
68
+ <g>
69
+ </g>
70
+ <g>
71
+ </g>
72
+ </svg>
@@ -1,148 +1,148 @@
1
- <template>
2
- <div
3
- aria-label="Clear options list"
4
- id="extended__multiselect-cancel"
5
- role="button"
6
- :class="classes"
7
- :tabindex="increasedTabindex"
8
- @click.stop="cancel"
9
- @keypress.stop="cancel"
10
- >
11
- <img
12
- alt=""
13
- v-if="!loading"
14
- :class="iconSizeClass"
15
- :src="cancelIcon"
16
- />
17
- <extended-multiselect-loader
18
- v-else
19
- :icon-filter="iconFilter"
20
- :icon-size="iconSize"
21
- />
22
- </div>
23
- </template>
24
-
25
- <script setup>
26
- import {
27
- computed,
28
- defineProps,
29
- ref,
30
- toRefs,
31
- } from "vue";
32
-
33
- import useCancel from "../composition/cancel";
34
- import useImagePath from "../composition/image-path";
35
- import useSizes from "../composition/sizes";
36
-
37
- import ExtendedMultiselectLoader from "./ExtendedMultiselectLoader.vue";
38
-
39
- const props = defineProps({
40
- /**
41
- * Blocks cancel button
42
- * @property {boolean} disabled
43
- */
44
- disabled: {
45
- type: Boolean,
46
- required: true,
47
- },
48
-
49
- /**
50
- * Defines a svg-filter for icons
51
- * @property {string} iconFilter
52
- */
53
- iconFilter: {
54
- type: String,
55
- required: true,
56
- },
57
-
58
- /**
59
- * Provides size to create special size-class
60
- * for each kind of icon
61
- * @property {string} iconSize
62
- */
63
- iconSize: {
64
- type: String,
65
- required: true,
66
- },
67
-
68
- /**
69
- * Replaces cancel button with loader
70
- * @property {boolean} loading
71
- */
72
- loading: {
73
- type: Boolean,
74
- required: true,
75
- },
76
-
77
- /**
78
- * Determines whether to clear current value of search field
79
- * @property {boolean} showSearchField
80
- */
81
- showSearchField: {
82
- type: Boolean,
83
- required: true,
84
- },
85
-
86
- /**
87
- * Defines "tabindex" attribute of cancel button
88
- * @default null
89
- * @property {number|null} tabindex
90
- */
91
- tabindex: {
92
- type: Number,
93
- default: null,
94
- },
95
-
96
- /**
97
- * List of selected options
98
- * @property {Array} selectedOptions
99
- */
100
- selectedOptions: {
101
- type: Array,
102
- required: true,
103
- },
104
- });
105
-
106
- const {
107
- disabled,
108
- iconFilter,
109
- iconSize,
110
- loading,
111
- selectedOptions,
112
- showSearchField,
113
- tabindex,
114
- } = toRefs(props);
115
-
116
- const { createImagePath } = useImagePath();
117
-
118
- const cancelIcon = ref(createImagePath("cancel.svg"));
119
-
120
- const { cancel } = useCancel(
121
- disabled,
122
- showSearchField,
123
- selectedOptions,
124
- );
125
- const { iconSizeClass } = useSizes(iconSize);
126
-
127
- /**
128
- * Toggles classes of component if "loading"
129
- * or "disabled" props equals true
130
- * @function
131
- * @returns {string} class
132
- */
133
- const classes = computed(() => {
134
- return (loading.value || disabled.value)
135
- ? "extended__multiselect-cancel--disabled"
136
- : "extended__multiselect-cancel";
137
- });
138
-
139
- /**
140
- * Sets "tabindex" attibute of clear button based on
141
- * given tabindex
142
- * @function
143
- * @returns {number} tabindex
144
- */
145
- const increasedTabindex = computed(() => {
146
- return tabindex.value ? tabindex.value + 2 : 0;
147
- });
148
- </script>
1
+ <template>
2
+ <div
3
+ aria-label="Clear options list"
4
+ id="extended__multiselect-cancel"
5
+ role="button"
6
+ :class="classes"
7
+ :tabindex="increasedTabindex"
8
+ @click.stop="cancel"
9
+ @keypress.stop="cancel"
10
+ >
11
+ <img
12
+ alt=""
13
+ v-if="!loading"
14
+ :class="iconSizeClass"
15
+ :src="cancelIcon"
16
+ />
17
+ <extended-multiselect-loader
18
+ v-else
19
+ :icon-filter="iconFilter"
20
+ :icon-size="iconSize"
21
+ />
22
+ </div>
23
+ </template>
24
+
25
+ <script setup>
26
+ import {
27
+ computed,
28
+ defineProps,
29
+ ref,
30
+ toRefs,
31
+ } from "vue";
32
+
33
+ import useCancel from "../composition/cancel";
34
+ import useImagePath from "../composition/image-path";
35
+ import useSizes from "../composition/sizes";
36
+
37
+ import ExtendedMultiselectLoader from "./ExtendedMultiselectLoader.vue";
38
+
39
+ const props = defineProps({
40
+ /**
41
+ * Blocks cancel button
42
+ * @property {boolean} disabled
43
+ */
44
+ disabled: {
45
+ type: Boolean,
46
+ required: true,
47
+ },
48
+
49
+ /**
50
+ * Defines a svg-filter for icons
51
+ * @property {string} iconFilter
52
+ */
53
+ iconFilter: {
54
+ type: String,
55
+ required: true,
56
+ },
57
+
58
+ /**
59
+ * Provides size to create special size-class
60
+ * for each kind of icon
61
+ * @property {string} iconSize
62
+ */
63
+ iconSize: {
64
+ type: String,
65
+ required: true,
66
+ },
67
+
68
+ /**
69
+ * Replaces cancel button with loader
70
+ * @property {boolean} loading
71
+ */
72
+ loading: {
73
+ type: Boolean,
74
+ required: true,
75
+ },
76
+
77
+ /**
78
+ * Determines whether to clear current value of search field
79
+ * @property {boolean} showSearchField
80
+ */
81
+ showSearchField: {
82
+ type: Boolean,
83
+ required: true,
84
+ },
85
+
86
+ /**
87
+ * Defines "tabindex" attribute of cancel button
88
+ * @default null
89
+ * @property {number|null} tabindex
90
+ */
91
+ tabindex: {
92
+ type: Number,
93
+ default: null,
94
+ },
95
+
96
+ /**
97
+ * List of selected options
98
+ * @property {Array} selectedOptions
99
+ */
100
+ selectedOptions: {
101
+ type: Array,
102
+ required: true,
103
+ },
104
+ });
105
+
106
+ const {
107
+ disabled,
108
+ iconFilter,
109
+ iconSize,
110
+ loading,
111
+ selectedOptions,
112
+ showSearchField,
113
+ tabindex,
114
+ } = toRefs(props);
115
+
116
+ const { createImagePath } = useImagePath();
117
+
118
+ const cancelIcon = ref(createImagePath("cancel.svg"));
119
+
120
+ const { cancel } = useCancel(
121
+ disabled,
122
+ showSearchField,
123
+ selectedOptions,
124
+ );
125
+ const { iconSizeClass } = useSizes(iconSize);
126
+
127
+ /**
128
+ * Toggles classes of component if "loading"
129
+ * or "disabled" props equals true
130
+ * @function
131
+ * @returns {string} class
132
+ */
133
+ const classes = computed(() => {
134
+ return (loading.value || disabled.value)
135
+ ? "extended__multiselect-cancel--disabled"
136
+ : "extended__multiselect-cancel";
137
+ });
138
+
139
+ /**
140
+ * Sets "tabindex" attibute of clear button based on
141
+ * given tabindex
142
+ * @function
143
+ * @returns {number} tabindex
144
+ */
145
+ const increasedTabindex = computed(() => {
146
+ return tabindex.value ? tabindex.value + 2 : 0;
147
+ });
148
+ </script>