vue3-extended-multiselect 0.2.1 → 1.0.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.
Files changed (43) hide show
  1. package/.eslintrc.js +35 -29
  2. package/.github/workflows/publish.yml +41 -41
  3. package/CHANGELOG.md +91 -65
  4. package/LICENSE +21 -21
  5. package/README.md +261 -262
  6. package/babel.config.js +3 -2
  7. package/index.js +2 -2
  8. package/jest.config.js +57 -57
  9. package/package.json +47 -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 +148 -145
  20. package/src/components/ExtendedMultiselectInput.vue +617 -617
  21. package/src/components/ExtendedMultiselectLoader.vue +182 -176
  22. package/src/components/ExtendedMultiselectMultiple.vue +295 -291
  23. package/src/components/ExtendedMultiselectOptions.vue +1091 -1088
  24. package/src/components/ExtendedMultiselectToggle.vue +261 -261
  25. package/src/components/Vue3ExtendedMultiselect.vue +1661 -1661
  26. package/src/composition/cancel.js +33 -28
  27. package/src/composition/image-path.js +17 -0
  28. package/src/composition/labels.js +39 -39
  29. package/src/composition/preselected-options.js +66 -66
  30. package/src/composition/search-value.js +33 -33
  31. package/src/composition/sizes.js +42 -42
  32. package/src/composition/toggle.js +33 -31
  33. package/src/events/emitter.js +3 -0
  34. package/src/sets/sets.js +99 -99
  35. package/src/styles/animations.css +18 -18
  36. package/src/styles/main.css +432 -432
  37. package/src/styles/variables.css +47 -48
  38. package/tests/unit/events.spec.js +135 -135
  39. package/tests/unit/props.spec.js +1040 -1040
  40. package/tests/utils/mount.js +37 -37
  41. package/tests/utils/utils.js +20 -20
  42. package/typings/vue3-extended-multiselect.d.ts +42 -42
  43. package/.eslintignore +0 -2
@@ -1,176 +1,182 @@
1
- <template>
2
- <div class="extended__multiselect-loader">
3
- <img
4
- alt=""
5
- :class="[iconFilterClass, iconSizeClass, 'extended__multiselect-loader-animate']"
6
- :src="require('../assets/loader.svg')"
7
- />
8
- <svg
9
- version="1.1"
10
- xmlns="http://www.w3.org/2000/svg"
11
- xmlns:xlink="http://www.w3.org/1999/xlink"
12
- width="0"
13
- height="0"
14
- >
15
- <defs>
16
- <filter
17
- x="0"
18
- y="0"
19
- width="1"
20
- height="1"
21
- id="filterLoaderDefault"
22
- >
23
- <feFlood flood-color="#00BFFF"/>
24
- <feComposite
25
- out="SourceGraphic"
26
- in2="SourceGraphic"
27
- operator="in"
28
- />
29
- </filter>
30
- <filter
31
- x="0"
32
- y="0"
33
- width="1"
34
- height="1"
35
- id="filterLoaderBasic"
36
- >
37
- <feFlood flood-color="#708090"/>
38
- <feComposite
39
- out="SourceGraphic"
40
- in2="SourceGraphic"
41
- operator="in"
42
- />
43
- </filter>
44
- <filter
45
- x="0"
46
- y="0"
47
- width="1"
48
- height="1"
49
- id="filterLoaderSlateGrey"
50
- >
51
- <feFlood flood-color="#2F4F4F"/>
52
- <feComposite
53
- out="SourceGraphic"
54
- in2="SourceGraphic"
55
- operator="in"
56
- />
57
- </filter>
58
- <filter
59
- x="0"
60
- y="0"
61
- width="1"
62
- height="1"
63
- id="filterLoaderSlateBlue"
64
- >
65
- <feFlood flood-color="#483D8B"/>
66
- <feComposite
67
- out="SourceGraphic"
68
- in2="SourceGraphic"
69
- operator="in"
70
- />
71
- </filter>
72
- <filter
73
- x="0"
74
- y="0"
75
- width="1"
76
- height="1"
77
- id="filterLoaderTeal"
78
- >
79
- <feFlood flood-color="#008080"/>
80
- <feComposite
81
- out="SourceGraphic"
82
- in2="SourceGraphic"
83
- operator="in"
84
- />
85
- </filter>
86
- <filter
87
- x="0"
88
- y="0"
89
- width="1"
90
- height="1"
91
- id="filterLoaderStrict"
92
- >
93
- <feFlood flood-color="#00BFFF"/>
94
- <feComposite
95
- out="SourceGraphic"
96
- in2="SourceGraphic"
97
- operator="in"
98
- />
99
- </filter>
100
- </defs>
101
- </svg>
102
- </div>
103
- </template>
104
-
105
- <script setup>
106
- import {
107
- computed,
108
- defineProps,
109
- inject,
110
- toRefs,
111
- } from "vue";
112
-
113
- import useSizes from "../composition/sizes";
114
-
115
- const props = defineProps({
116
- /**
117
- * Defines svg-filter for loader icon
118
- * @property {string} iconFilter
119
- */
120
- iconFilter: {
121
- type: String,
122
- required: true,
123
- },
124
-
125
- /**
126
- * Provides size to create special size-class
127
- * for each kind of icon
128
- * @property {string} iconSize
129
- */
130
- iconSize: {
131
- type: String,
132
- required: true,
133
- },
134
- });
135
-
136
- const loaderIconFilter = inject("loaderIconFilter");
137
-
138
- const { iconSize } = toRefs(props);
139
-
140
- const { iconSizeClass } = useSizes(iconSize);
141
-
142
- /**
143
- * Defines class for loader icon
144
- * depends on injected filter name
145
- * @function
146
- * @returns {string} class
147
- */
148
- const iconFilterClass = computed(() => {
149
- let basicFilter = "extended__multiselect-loader";
150
-
151
- switch(loaderIconFilter) {
152
- case "default-loader":
153
- basicFilter = `${basicFilter}_default-loader`;
154
- break;
155
- case "basic":
156
- basicFilter = `${basicFilter}_basic`;
157
- break;
158
- case "slate-grey":
159
- basicFilter = `${basicFilter}_slate-grey`;
160
- break;
161
- case "slate-blue":
162
- basicFilter = `${basicFilter}_slate-blue`;
163
- break;
164
- case "teal":
165
- basicFilter = `${basicFilter}_teal`;
166
- break;
167
- case "strict":
168
- basicFilter = `${basicFilter}_strict`;
169
- break;
170
- default:
171
- basicFilter = `${basicFilter}_default-loader`;
172
- }
173
-
174
- return basicFilter;
175
- });
176
- </script>
1
+ <template>
2
+ <div class="extended__multiselect-loader">
3
+ <img
4
+ alt=""
5
+ :class="[iconFilterClass, iconSizeClass, 'extended__multiselect-loader-animate']"
6
+ :src="loaderIcon"
7
+ />
8
+ <svg
9
+ version="1.1"
10
+ xmlns="http://www.w3.org/2000/svg"
11
+ xmlns:xlink="http://www.w3.org/1999/xlink"
12
+ width="0"
13
+ height="0"
14
+ >
15
+ <defs>
16
+ <filter
17
+ x="0"
18
+ y="0"
19
+ width="1"
20
+ height="1"
21
+ id="filterLoaderDefault"
22
+ >
23
+ <feFlood flood-color="#00BFFF"/>
24
+ <feComposite
25
+ out="SourceGraphic"
26
+ in2="SourceGraphic"
27
+ operator="in"
28
+ />
29
+ </filter>
30
+ <filter
31
+ x="0"
32
+ y="0"
33
+ width="1"
34
+ height="1"
35
+ id="filterLoaderBasic"
36
+ >
37
+ <feFlood flood-color="#708090"/>
38
+ <feComposite
39
+ out="SourceGraphic"
40
+ in2="SourceGraphic"
41
+ operator="in"
42
+ />
43
+ </filter>
44
+ <filter
45
+ x="0"
46
+ y="0"
47
+ width="1"
48
+ height="1"
49
+ id="filterLoaderSlateGrey"
50
+ >
51
+ <feFlood flood-color="#2F4F4F"/>
52
+ <feComposite
53
+ out="SourceGraphic"
54
+ in2="SourceGraphic"
55
+ operator="in"
56
+ />
57
+ </filter>
58
+ <filter
59
+ x="0"
60
+ y="0"
61
+ width="1"
62
+ height="1"
63
+ id="filterLoaderSlateBlue"
64
+ >
65
+ <feFlood flood-color="#483D8B"/>
66
+ <feComposite
67
+ out="SourceGraphic"
68
+ in2="SourceGraphic"
69
+ operator="in"
70
+ />
71
+ </filter>
72
+ <filter
73
+ x="0"
74
+ y="0"
75
+ width="1"
76
+ height="1"
77
+ id="filterLoaderTeal"
78
+ >
79
+ <feFlood flood-color="#008080"/>
80
+ <feComposite
81
+ out="SourceGraphic"
82
+ in2="SourceGraphic"
83
+ operator="in"
84
+ />
85
+ </filter>
86
+ <filter
87
+ x="0"
88
+ y="0"
89
+ width="1"
90
+ height="1"
91
+ id="filterLoaderStrict"
92
+ >
93
+ <feFlood flood-color="#00BFFF"/>
94
+ <feComposite
95
+ out="SourceGraphic"
96
+ in2="SourceGraphic"
97
+ operator="in"
98
+ />
99
+ </filter>
100
+ </defs>
101
+ </svg>
102
+ </div>
103
+ </template>
104
+
105
+ <script setup>
106
+ import {
107
+ computed,
108
+ defineProps,
109
+ inject,
110
+ ref,
111
+ toRefs,
112
+ } from "vue";
113
+
114
+ import useImagePath from "../composition/image-path";
115
+ import useSizes from "../composition/sizes";
116
+
117
+ const props = defineProps({
118
+ /**
119
+ * Defines svg-filter for loader icon
120
+ * @property {string} iconFilter
121
+ */
122
+ iconFilter: {
123
+ type: String,
124
+ required: true,
125
+ },
126
+
127
+ /**
128
+ * Provides size to create special size-class
129
+ * for each kind of icon
130
+ * @property {string} iconSize
131
+ */
132
+ iconSize: {
133
+ type: String,
134
+ required: true,
135
+ },
136
+ });
137
+
138
+ const loaderIconFilter = inject("loaderIconFilter");
139
+
140
+ const { iconSize } = toRefs(props);
141
+
142
+ const { createImagePath } = useImagePath();
143
+
144
+ const loaderIcon = ref(createImagePath("loader.svg"));
145
+
146
+ const { iconSizeClass } = useSizes(iconSize);
147
+
148
+ /**
149
+ * Defines class for loader icon
150
+ * depends on injected filter name
151
+ * @function
152
+ * @returns {string} class
153
+ */
154
+ const iconFilterClass = computed(() => {
155
+ let basicFilter = "extended__multiselect-loader";
156
+
157
+ switch(loaderIconFilter) {
158
+ case "default-loader":
159
+ basicFilter = `${basicFilter}_default-loader`;
160
+ break;
161
+ case "basic":
162
+ basicFilter = `${basicFilter}_basic`;
163
+ break;
164
+ case "slate-grey":
165
+ basicFilter = `${basicFilter}_slate-grey`;
166
+ break;
167
+ case "slate-blue":
168
+ basicFilter = `${basicFilter}_slate-blue`;
169
+ break;
170
+ case "teal":
171
+ basicFilter = `${basicFilter}_teal`;
172
+ break;
173
+ case "strict":
174
+ basicFilter = `${basicFilter}_strict`;
175
+ break;
176
+ default:
177
+ basicFilter = `${basicFilter}_default-loader`;
178
+ }
179
+
180
+ return basicFilter;
181
+ });
182
+ </script>