vue3-extended-multiselect 1.5.10 → 1.6.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/CHANGELOG.md +8 -2
- package/README.md +2 -1
- package/jest.config.js +1 -1
- package/package.json +1 -1
- package/src/components/ExtendedMultiselectInput.vue +27 -3
- package/src/components/ExtendedMultiselectMultiple.vue +48 -13
- package/src/components/Vue3ExtendedMultiselect.vue +14 -1
- package/src/composition/sizes.js +2 -0
- package/src/styles/main.css +11 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# Patch notes
|
|
2
2
|
|
|
3
|
-
Current `vue3-extended-multiselect` version: **1.
|
|
3
|
+
Current `vue3-extended-multiselect` version: **1.6.0**
|
|
4
4
|
|
|
5
5
|
***
|
|
6
6
|
|
|
@@ -235,4 +235,10 @@ Adding descriptive comments for some types in typings.
|
|
|
235
235
|
### 1.5.10 (2023-02-01)
|
|
236
236
|
|
|
237
237
|
* Fixing bug with field focus when selecting an option.
|
|
238
|
-
* Removal of validator from "emptyObjectsPlaceholder" prop.
|
|
238
|
+
* Removal of validator from "emptyObjectsPlaceholder" prop.
|
|
239
|
+
|
|
240
|
+
### 1.6.0 (2023-02-02)
|
|
241
|
+
|
|
242
|
+
* Adding "showDeselectIconLoader" optional prop.
|
|
243
|
+
* Adding loader icon to deselect button of multiple option blocks depending on "showDeselectIconLoader" optional prop.
|
|
244
|
+
* Changing styles of multiple option blocks.
|
package/README.md
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
# vue3-extended-multiselect v1.
|
|
1
|
+
# vue3-extended-multiselect v1.6.0
|
|
2
2
|
|
|
3
3
|
***
|
|
4
4
|
|
|
@@ -52,6 +52,7 @@ Prop name | Prop type | Prop appointment | Prop default value | Prop values
|
|
|
52
52
|
**simpleEvents**|Boolean|Switches full payload of extended multiselect events.|true|—|
|
|
53
53
|
**selected<br/>Options<br/>Shown**|Boolean|Determines whether to show selected options in options list.|false|—|
|
|
54
54
|
**showClearIcon**|Boolean|Allows user to deselect all options by special icon.|false|—|
|
|
55
|
+
**showDeselect<br/>IconLoader**|Boolean|Determines whether to show loader icon in multiple options block if "loading" prop equals true|true|—|
|
|
55
56
|
**showInsert<br/>Warnings**|Boolean|Determines whether to show useful internal warnings in console.|false|—|
|
|
56
57
|
**showMarker**|Boolean|Determines whether to show slot with special marker beside option in options list.|false|—|
|
|
57
58
|
**showSearch<br/>Field**|Boolean|Determines whether to show search field which allows user to search for options with internal search.|true|—|
|
package/jest.config.js
CHANGED
package/package.json
CHANGED
|
@@ -36,6 +36,8 @@
|
|
|
36
36
|
:style="multipleBlocksMargin"
|
|
37
37
|
:disabled="disabled"
|
|
38
38
|
:loading="loading"
|
|
39
|
+
:icon-filter="iconFilter"
|
|
40
|
+
:show-deselect-icon-loader="showDeselectIconLoader"
|
|
39
41
|
:toggle-multiple-blocks-limit="toggleMultipleBlocksLimit"
|
|
40
42
|
:empty-objects-placeholder="emptyObjectsPlaceholder"
|
|
41
43
|
:label="label"
|
|
@@ -75,6 +77,8 @@
|
|
|
75
77
|
<extended-multiselect-multiple
|
|
76
78
|
:disabled="disabled"
|
|
77
79
|
:loading="loading"
|
|
80
|
+
:icon-filter="iconFilter"
|
|
81
|
+
:show-deselect-icon-loader="showDeselectIconLoader"
|
|
78
82
|
:toggle-multiple-blocks-limit="toggleMultipleBlocksLimit"
|
|
79
83
|
:empty-objects-placeholder="emptyObjectsPlaceholder"
|
|
80
84
|
:label="label"
|
|
@@ -229,6 +233,17 @@ const props = defineProps({
|
|
|
229
233
|
required: true,
|
|
230
234
|
},
|
|
231
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Determines whether to show loader icon in multiple
|
|
238
|
+
* options block if "loading" prop equals true
|
|
239
|
+
* @default true
|
|
240
|
+
* @property {boolean} showDeselectIconLoader
|
|
241
|
+
*/
|
|
242
|
+
showDeselectIconLoader: {
|
|
243
|
+
type: Boolean,
|
|
244
|
+
default: true,
|
|
245
|
+
},
|
|
246
|
+
|
|
232
247
|
/**
|
|
233
248
|
* Determines whether to allow user to increase limit of shown
|
|
234
249
|
* elements with selected options by special icon
|
|
@@ -279,11 +294,20 @@ const props = defineProps({
|
|
|
279
294
|
required: true,
|
|
280
295
|
},
|
|
281
296
|
|
|
297
|
+
/**
|
|
298
|
+
* Defines a svg-filter for icons
|
|
299
|
+
* @property {string} iconFilter
|
|
300
|
+
*/
|
|
301
|
+
iconFilter: {
|
|
302
|
+
type: String,
|
|
303
|
+
required: true,
|
|
304
|
+
},
|
|
305
|
+
|
|
282
306
|
/**
|
|
283
307
|
* Determines field of option which will be displayed as label
|
|
284
308
|
* @property {string} label
|
|
285
309
|
*/
|
|
286
|
-
|
|
310
|
+
label: {
|
|
287
311
|
type: String,
|
|
288
312
|
required: true,
|
|
289
313
|
},
|
|
@@ -317,7 +341,7 @@ const props = defineProps({
|
|
|
317
341
|
},
|
|
318
342
|
|
|
319
343
|
/**
|
|
320
|
-
* Provides limit of option blocks amount
|
|
344
|
+
* Provides limit of multiple option blocks amount
|
|
321
345
|
* to ExtendedMultiselectMultiple child component
|
|
322
346
|
* @default null
|
|
323
347
|
* @property {number} multipleBlocksLimit
|
|
@@ -447,7 +471,7 @@ const appropriatePlaceholder = computed(() => {
|
|
|
447
471
|
});
|
|
448
472
|
|
|
449
473
|
/**
|
|
450
|
-
* Sets "margin-top" css property to multiple
|
|
474
|
+
* Sets "margin-top" css property to multiple option blocks
|
|
451
475
|
* if search field is shown
|
|
452
476
|
* @function
|
|
453
477
|
* @returns {Object|null} margin-top
|
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
:index="index"
|
|
11
11
|
:deselect-block="deselectBlock"
|
|
12
12
|
>
|
|
13
|
-
<div
|
|
14
|
-
:class="classes"
|
|
15
|
-
:style="styles"
|
|
16
|
-
>
|
|
13
|
+
<div :class="classes">
|
|
17
14
|
<span>{{ optionCreateLabel(option) }}</span>
|
|
18
|
-
<div
|
|
19
|
-
class="extended__multiselect-block_cancel-wrapper"
|
|
20
|
-
v-if="!loading"
|
|
21
|
-
>
|
|
15
|
+
<div :class="deselectClasses">
|
|
22
16
|
<img
|
|
23
17
|
alt=""
|
|
24
18
|
class="extended__multiselect_deselect-block-icon"
|
|
19
|
+
v-if="!showLoaderIcon"
|
|
25
20
|
:src="deselectImage"
|
|
26
21
|
@click.stop="deselectBlock(index)"
|
|
27
22
|
/>
|
|
23
|
+
<extended-multiselect-loader
|
|
24
|
+
v-else
|
|
25
|
+
:icon-filter="iconFilter"
|
|
26
|
+
icon-size="deselect"
|
|
27
|
+
/>
|
|
28
28
|
</div>
|
|
29
29
|
</div>
|
|
30
30
|
</slot>
|
|
@@ -63,6 +63,8 @@ import {
|
|
|
63
63
|
import useImagePath from "../composition/image-path";
|
|
64
64
|
import useLabels from "../composition/labels";
|
|
65
65
|
|
|
66
|
+
import ExtendedMultiselectLoader from "./ExtendedMultiselectLoader.vue";
|
|
67
|
+
|
|
66
68
|
const props = defineProps({
|
|
67
69
|
/**
|
|
68
70
|
* Function that creates custom label for
|
|
@@ -129,6 +131,17 @@ const props = defineProps({
|
|
|
129
131
|
default: null,
|
|
130
132
|
},
|
|
131
133
|
|
|
134
|
+
/**
|
|
135
|
+
* Determines whether to show loader icon in multiple
|
|
136
|
+
* options block if "loading" prop equals true
|
|
137
|
+
* @default true
|
|
138
|
+
* @property {boolean} showDeselectIconLoader
|
|
139
|
+
*/
|
|
140
|
+
showDeselectIconLoader: {
|
|
141
|
+
type: Boolean,
|
|
142
|
+
default: true,
|
|
143
|
+
},
|
|
144
|
+
|
|
132
145
|
/**
|
|
133
146
|
* Allows to increase limit of displayed selected option blocks
|
|
134
147
|
* @property {boolean} toggleMultipleBlocksLimit
|
|
@@ -138,6 +151,15 @@ const props = defineProps({
|
|
|
138
151
|
required: true,
|
|
139
152
|
},
|
|
140
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Defines a svg-filter for icons
|
|
156
|
+
* @property {string} iconFilter
|
|
157
|
+
*/
|
|
158
|
+
iconFilter: {
|
|
159
|
+
type: String,
|
|
160
|
+
required: true,
|
|
161
|
+
},
|
|
162
|
+
|
|
141
163
|
/**
|
|
142
164
|
* Function that creates limit message for maximal of selected options
|
|
143
165
|
* @property {Function} multipleBlocksLimitMessage
|
|
@@ -184,6 +206,7 @@ const {
|
|
|
184
206
|
label,
|
|
185
207
|
increaseDisplayBy,
|
|
186
208
|
loading,
|
|
209
|
+
showDeselectIconLoader,
|
|
187
210
|
multipleBlocksLimit,
|
|
188
211
|
selectedOptions,
|
|
189
212
|
themeType,
|
|
@@ -227,6 +250,18 @@ const classes = computed(() => {
|
|
|
227
250
|
}
|
|
228
251
|
});
|
|
229
252
|
|
|
253
|
+
/**
|
|
254
|
+
* Defines class for every deselect/loader icon in multiple
|
|
255
|
+
* option blocks depends on "loading" prop
|
|
256
|
+
* @function
|
|
257
|
+
* @returns {string} class
|
|
258
|
+
*/
|
|
259
|
+
const deselectClasses = computed(() => {
|
|
260
|
+
return loading.value
|
|
261
|
+
? "extended__multiselect-block_cancel-wrapper--loading"
|
|
262
|
+
: "extended__multiselect-block_cancel-wrapper";
|
|
263
|
+
});
|
|
264
|
+
|
|
230
265
|
/**
|
|
231
266
|
* Defines current limited amount of displayed option blocks
|
|
232
267
|
* @function
|
|
@@ -276,13 +311,13 @@ const overLimitOptionsCount = computed(() => {
|
|
|
276
311
|
});
|
|
277
312
|
|
|
278
313
|
/**
|
|
279
|
-
*
|
|
280
|
-
*
|
|
314
|
+
* Determines whether to show loader icon if "loading" prop equals true
|
|
315
|
+
* or show multiple option blocks as usual
|
|
281
316
|
* @function
|
|
282
|
-
* @returns {
|
|
317
|
+
* @returns {boolean} restriction
|
|
283
318
|
*/
|
|
284
|
-
const
|
|
285
|
-
return
|
|
319
|
+
const showLoaderIcon = computed(() => {
|
|
320
|
+
return showDeselectIconLoader.value ? loading.value : false;
|
|
286
321
|
});
|
|
287
322
|
|
|
288
323
|
/**
|
|
@@ -32,8 +32,10 @@
|
|
|
32
32
|
:disabled="disabled"
|
|
33
33
|
:dropdown-active="dropdownActive"
|
|
34
34
|
:loading="internalLoading"
|
|
35
|
+
:icon-filter="iconFilter"
|
|
35
36
|
:multiple="multiple"
|
|
36
37
|
:search-filter-active="searchFilterActive"
|
|
38
|
+
:show-deselect-icon-loader="showDeselectIconLoader"
|
|
37
39
|
:toggling-saves-search-value="togglingSavesSearchValue"
|
|
38
40
|
:toggle-options-by-select="toggleOptionsBySelect"
|
|
39
41
|
:placeholder="placeholder"
|
|
@@ -254,7 +256,7 @@ import ExtendedMultiselectToggle from "./ExtendedMultiselectToggle.vue";
|
|
|
254
256
|
|
|
255
257
|
/**
|
|
256
258
|
* @author Ridiger Daniil Dmitrievich, 2022
|
|
257
|
-
* @version 1.
|
|
259
|
+
* @version 1.6.0
|
|
258
260
|
*/
|
|
259
261
|
|
|
260
262
|
const props = defineProps({
|
|
@@ -410,6 +412,17 @@ const props = defineProps({
|
|
|
410
412
|
default: false,
|
|
411
413
|
},
|
|
412
414
|
|
|
415
|
+
/**
|
|
416
|
+
* Determines whether to show loader icon in multiple
|
|
417
|
+
* options block if "loading" prop equals true
|
|
418
|
+
* @default true
|
|
419
|
+
* @property {boolean} showDeselectIconLoader
|
|
420
|
+
*/
|
|
421
|
+
showDeselectIconLoader: {
|
|
422
|
+
type: Boolean,
|
|
423
|
+
default: true,
|
|
424
|
+
},
|
|
425
|
+
|
|
413
426
|
/**
|
|
414
427
|
* Determines whether to show useful internal warnings in console
|
|
415
428
|
* @default false
|
package/src/composition/sizes.js
CHANGED
package/src/styles/main.css
CHANGED
|
@@ -260,6 +260,15 @@
|
|
|
260
260
|
height: var(--icon-size-small);
|
|
261
261
|
}
|
|
262
262
|
|
|
263
|
+
.extended__multiselect-toggle_icon-deselect,
|
|
264
|
+
.extended__multiselect-toggle--disabled_icon-deselect,
|
|
265
|
+
.extended__multiselect-cancel_icon-deselect,
|
|
266
|
+
.extended__multiselect-cancel--disabled_icon-deselect,
|
|
267
|
+
.extended__multiselect-loader_icon-deselect {
|
|
268
|
+
width: var(--icon-size-block);
|
|
269
|
+
height: var(--icon-size-block);
|
|
270
|
+
}
|
|
271
|
+
|
|
263
272
|
.extended__multiselect-cancel,
|
|
264
273
|
.extended__multiselect-cancel--disabled {
|
|
265
274
|
border: var(--border);
|
|
@@ -423,7 +432,8 @@
|
|
|
423
432
|
gap: var(--outer-gap);
|
|
424
433
|
}
|
|
425
434
|
|
|
426
|
-
.extended__multiselect-block_cancel-wrapper
|
|
435
|
+
.extended__multiselect-block_cancel-wrapper,
|
|
436
|
+
.extended__multiselect-block_cancel-wrapper--loading {
|
|
427
437
|
border: var(--border);
|
|
428
438
|
border-color: transparent;
|
|
429
439
|
display: flex;
|