@weni/unnnic-system 3.0.4-alpha.1 → 3.0.5-alpha.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 +9 -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-39b05ec7.mjs → es-e4780f92.mjs} +1 -1
- package/dist/{index-c43e689f.mjs → index-c20c8a10.mjs} +717 -701
- package/dist/{pt-br-b70cfbf8.mjs → pt-br-9e604702.mjs} +1 -1
- package/dist/style.css +1 -1
- package/dist/unnnic.mjs +1 -1
- package/dist/unnnic.umd.js +1 -1
- package/package.json +1 -1
- package/src/assets/scss/colors.scss +3 -0
- 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
|
@@ -343,6 +343,7 @@ $scheme-colors:
|
|
|
343
343
|
"bg-base" $unnnic-color-white,
|
|
344
344
|
"bg-soft" $unnnic-color-gray-50,
|
|
345
345
|
"bg-muted" $unnnic-color-gray-100,
|
|
346
|
+
"bg-active" $unnnic-color-teal-600,
|
|
346
347
|
"bg-info" $unnnic-color-aux-blue-100,
|
|
347
348
|
"bg-success" $unnnic-color-aux-green-100,
|
|
348
349
|
"bg-warning" $unnnic-color-aux-yellow-50,
|
|
@@ -353,6 +354,7 @@ $scheme-colors:
|
|
|
353
354
|
"fg-muted" $unnnic-color-gray-300,
|
|
354
355
|
"fg-emphasized" $unnnic-color-gray-900,
|
|
355
356
|
"fg-inverted" $unnnic-color-white,
|
|
357
|
+
"fg-active" $unnnic-color-teal-600,
|
|
356
358
|
"fg-info" $unnnic-color-aux-blue-500,
|
|
357
359
|
"fg-success" $unnnic-color-aux-green-500,
|
|
358
360
|
"fg-warning" $unnnic-color-aux-yellow-500,
|
|
@@ -363,6 +365,7 @@ $scheme-colors:
|
|
|
363
365
|
"border-soft" $unnnic-color-gray-100,
|
|
364
366
|
"border-muted" $unnnic-color-gray-200,
|
|
365
367
|
"border-emphasized" $unnnic-color-gray-400,
|
|
368
|
+
"border-active" $unnnic-color-teal-600,
|
|
366
369
|
"border-info" $unnnic-color-aux-blue-300,
|
|
367
370
|
"border-success" $unnnic-color-aux-green-300,
|
|
368
371
|
"border-warning" $unnnic-color-aux-yellow-300,
|
|
@@ -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,
|