@farm-investimentos/front-mfe-components 15.2.1 → 15.2.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farm-investimentos/front-mfe-components",
3
- "version": "15.2.1",
3
+ "version": "15.2.2",
4
4
  "author": "farm investimentos",
5
5
  "private": false,
6
6
  "main": "./dist/front-mfe-components.common.js",
@@ -284,7 +284,42 @@ export const MultipleInitValue = () => ({
284
284
  </div>`,
285
285
  });
286
286
 
287
- export const ChangeEvennt = () => ({
287
+ export const MultipleResetByValue = () => ({
288
+ data() {
289
+ return {
290
+ filters: {
291
+ v: [2, 3],
292
+ },
293
+ items: [
294
+ { id: 0, label: 'value 0' },
295
+ { id: 1, label: 'value 1' },
296
+ { id: 2, label: 'value 2' },
297
+ { id: 3, label: 'value 3' },
298
+ ],
299
+ };
300
+ },
301
+ methods: {
302
+ click() {
303
+ this.filters.v = [1];
304
+ },
305
+ },
306
+ template: `<div style="width: 400px">
307
+ <farm-select
308
+ v-model="filters.v"
309
+ item-value="id"
310
+ item-text="label"
311
+ ref="select"
312
+ multiple
313
+ :items="items"
314
+ />
315
+ v-model: {{ filters.v }}
316
+ <farm-btn @click="click">
317
+ reset
318
+ </farm-btn>
319
+ </div>`,
320
+ });
321
+
322
+ export const ChangeEvent = () => ({
288
323
  data() {
289
324
  return {
290
325
  v: null,
@@ -264,12 +264,16 @@ export default Vue.extend({
264
264
  newValue => {
265
265
  innerValue.value = newValue;
266
266
  errorBucket.value = [];
267
+
267
268
  if (
268
269
  (multiple.value && newValue === null) ||
269
270
  (Array.isArray(newValue) && newValue.length === 0)
270
271
  ) {
271
272
  multipleValues.value = [];
272
273
  }
274
+ if (Array.isArray(newValue) && newValue.length > 0) {
275
+ multipleValues.value = [...newValue];
276
+ }
273
277
  validate(newValue);
274
278
  updateSelectedTextValue();
275
279
  emit('input', newValue);