@nethserver/ns8-ui-lib 0.1.28 → 0.1.29

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": "@nethserver/ns8-ui-lib",
3
- "version": "0.1.28",
3
+ "version": "0.1.29",
4
4
  "description": "Vue.js library for NethServer 8 UI",
5
5
  "keywords": [
6
6
  "nethserver",
@@ -326,7 +326,6 @@ export default {
326
326
  data() {
327
327
  return {
328
328
  open: false,
329
- // dataOptions: null, ////
330
329
  // includes user input items
331
330
  internalOptions: [],
332
331
  dataValue: "",
@@ -356,10 +355,6 @@ export default {
356
355
  },
357
356
  options() {
358
357
  this.internalOptions = _cloneDeep(this.options);
359
- // this.updateOptions(); ////
360
- },
361
- selectionFeedback() {
362
- // this.updateOptions(); ////
363
358
  },
364
359
  open() {
365
360
  if (this.marginBottomOnOpen) {
@@ -376,17 +371,12 @@ export default {
376
371
  },
377
372
  },
378
373
  created() {
379
- console.log("ns-multi-select created"); ////
380
-
381
374
  this.internalOptions = _cloneDeep(this.options);
382
- // this.updateOptions(); ////
383
375
  this.dataValue = this.value.filter((item) =>
384
376
  this.internalOptions.some((opt) => opt.value === item.trim())
385
377
  );
386
378
  },
387
379
  mounted() {
388
- console.log("ns-multi-select mounted"); ////
389
-
390
380
  this.highlighted = this.value ? this.value : this.highlight; // override highlight with value if provided
391
381
  this.checkSlots();
392
382
  },
@@ -442,7 +432,6 @@ export default {
442
432
  return !!this.$slots.tooltip;
443
433
  },
444
434
  filteredOptions() {
445
- //// use this.dataFilter?
446
435
  if (!this.filter) {
447
436
  return this.limitedDataOptions;
448
437
  }
@@ -494,7 +483,6 @@ export default {
494
483
  this.filter = "";
495
484
  this.$refs.input.focus();
496
485
  this.doOpen(true);
497
- // this.updateOptions(); ////
498
486
  },
499
487
  checkHighlightPosition(newHiglight) {
500
488
  if (
@@ -543,55 +531,6 @@ export default {
543
531
  // this.checkHighlightPosition(newHiglight);
544
532
  }
545
533
  },
546
- // updateOptions() { ////
547
- // console.log("ns-multi-select updateOptions"); ////
548
-
549
- // if (this.autoFilter) {
550
- // const escFilter = this.filter.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
551
- // const pat = new RegExp(escFilter, "iu");
552
- // this.dataOptions = this.internalOptions
553
- // .filter((opt) => pat.test(opt.label))
554
- // .slice(0);
555
- // } else {
556
- // this.dataOptions = this.internalOptions.slice(0);
557
- // }
558
- // if (this.highlight !== this.highlighted) {
559
- // this.highlighted = this.highlight;
560
- // }
561
-
562
- // // multi select unique part
563
- // if (
564
- // !this.sorting &&
565
- // this.selectionFeedback !== selectionFeedbackOptions[FIXED]
566
- // ) {
567
- // // if included in data value move to top
568
- // this.dataOptions.sort(
569
- // (a, b) =>
570
- // (this.dataValue.includes(a.value) ? -1 : 1) -
571
- // (this.dataValue.includes(b.value) ? -1 : 1)
572
- // );
573
- // }
574
-
575
- // // added for ns-multi-select
576
- // if (this.acceptUserInput && this.filter.trim()) {
577
- // //// remove block?
578
- // // suggest user input
579
-
580
- // const trimmedFilter = this.filter.trim();
581
- // const itemFound = this.internalOptions.find(
582
- // (o) => o.value.trim() === trimmedFilter
583
- // );
584
-
585
- // if (!itemFound) {
586
- // this.dataOptions.push({
587
- // name: trimmedFilter,
588
- // label: trimmedFilter,
589
- // value: trimmedFilter,
590
- // type: this.userInputLabel,
591
- // });
592
- // }
593
- // }
594
- // },
595
534
  updateHighlight() {
596
535
  let firstMatchIndex;
597
536
  if (this.autoHighlight && this.internalOptions.length > 0) {
@@ -609,18 +548,9 @@ export default {
609
548
  },
610
549
  onInput() {
611
550
  this.doOpen(true);
612
-
613
- // this.updateOptions(); ////
614
551
  this.updateHighlight();
615
552
  },
616
553
  doOpen(newVal) {
617
- // if ( ////
618
- // newVal &&
619
- // !this.open &&
620
- // this.selectionFeedback === selectionFeedbackOptions[TOP_AFTER_REOPEN]
621
- // ) {
622
- // this.updateOptions();
623
- // }
624
554
  this.open = newVal;
625
555
  },
626
556
  onDown() {
@@ -651,11 +581,6 @@ export default {
651
581
  this.onItemClick(this.highlighted);
652
582
  this.$refs.input.focus();
653
583
  this.filter = "";
654
-
655
- this.doOpen(false);
656
- // this.updateOptions(); ////
657
- } else {
658
- this.doOpen(true);
659
584
  }
660
585
  },
661
586
  onClick(ev) {
@@ -718,9 +643,6 @@ export default {
718
643
  }
719
644
  }
720
645
 
721
- // if (this.selectionFeedback === selectionFeedbackOptions[TOP]) {
722
- // this.updateOptions(); ////
723
- // }
724
646
  this.$refs.button.focus();
725
647
  this.$emit("change", this.dataValue);
726
648
  },