@weni/unnnic-system 3.1.0 → 3.1.1
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 +7 -0
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts +18 -0
- package/dist/components/SelectSmart/SelectSmart.vue.d.ts.map +1 -1
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts +9 -0
- package/dist/components/SelectSmart/SelectSmartOption.vue.d.ts.map +1 -1
- package/dist/{es-8ee8b336.mjs → es-b95265ef.mjs} +1 -1
- package/dist/{index-a9c4dc3e.mjs → index-d6c4fffb.mjs} +25 -9
- package/dist/{pt-br-1b500883.mjs → pt-br-80b6b07a.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +23 -23
- package/package.json +1 -1
- package/src/components/SelectSmart/SelectSmart.vue +22 -1
- package/src/components/SelectSmart/SelectSmartMultipleHeader.vue +1 -1
- package/src/components/SelectSmart/SelectSmartOption.vue +5 -0
- package/src/stories/SelectSmart.stories.js +1 -1
package/package.json
CHANGED
|
@@ -86,6 +86,7 @@
|
|
|
86
86
|
:active="
|
|
87
87
|
option.value === modelValue || optionIsSelected(option)
|
|
88
88
|
"
|
|
89
|
+
:disabled="optionIsSelected(option) && option.disableRemove"
|
|
89
90
|
:focused="focusedOption && focusedOption.value === option.value"
|
|
90
91
|
:allowCheckbox="!!multiple"
|
|
91
92
|
:activeColor="type === 'secondary' ? 'secondary' : 'primary'"
|
|
@@ -142,6 +143,10 @@ export default {
|
|
|
142
143
|
value: 'option1',
|
|
143
144
|
label: 'Option1',
|
|
144
145
|
},
|
|
146
|
+
{
|
|
147
|
+
value: 'option2',
|
|
148
|
+
label: 'Option2',
|
|
149
|
+
},
|
|
145
150
|
],
|
|
146
151
|
},
|
|
147
152
|
modelValue: {
|
|
@@ -203,6 +208,10 @@ export default {
|
|
|
203
208
|
type: Boolean,
|
|
204
209
|
default: false,
|
|
205
210
|
},
|
|
211
|
+
multipleLimit: {
|
|
212
|
+
type: [Number, null],
|
|
213
|
+
default: null,
|
|
214
|
+
},
|
|
206
215
|
},
|
|
207
216
|
|
|
208
217
|
emits: ['update:searchValue', 'onChange', 'update:modelValue'],
|
|
@@ -363,11 +372,23 @@ export default {
|
|
|
363
372
|
|
|
364
373
|
handleSelect(option) {
|
|
365
374
|
if (option) {
|
|
366
|
-
if (
|
|
375
|
+
if (
|
|
376
|
+
this.multiple &&
|
|
377
|
+
this.optionIsSelected(option) &&
|
|
378
|
+
!option.disableRemove
|
|
379
|
+
) {
|
|
367
380
|
this.unselectOption(option);
|
|
368
381
|
return;
|
|
369
382
|
}
|
|
370
383
|
|
|
384
|
+
if(this.multiple && option.disableRemove && this.optionIsSelected(option)) {
|
|
385
|
+
return;
|
|
386
|
+
}
|
|
387
|
+
|
|
388
|
+
if (this.multipleLimit && this.modelValue.length >= this.multipleLimit) {
|
|
389
|
+
return;
|
|
390
|
+
}
|
|
391
|
+
|
|
371
392
|
this.selectOption(option);
|
|
372
393
|
}
|
|
373
394
|
},
|
|
@@ -19,6 +19,7 @@
|
|
|
19
19
|
data-testid="checkbox"
|
|
20
20
|
:modelValue="active"
|
|
21
21
|
:size="size"
|
|
22
|
+
:disabled="disabled"
|
|
22
23
|
/>
|
|
23
24
|
<div>
|
|
24
25
|
<span
|
|
@@ -77,6 +78,10 @@ export default {
|
|
|
77
78
|
type: Boolean,
|
|
78
79
|
default: null,
|
|
79
80
|
},
|
|
81
|
+
disabled: {
|
|
82
|
+
type: Boolean,
|
|
83
|
+
default: false,
|
|
84
|
+
},
|
|
80
85
|
allowCheckbox: {
|
|
81
86
|
type: Boolean,
|
|
82
87
|
default: false,
|