@avakhula/ui 0.1.21 → 0.1.22

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": "@avakhula/ui",
3
- "version": "0.1.21",
3
+ "version": "0.1.22",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.umd.cjs",
6
6
  "source": "src/index.js",
@@ -481,6 +481,9 @@ export default {
481
481
  type: Boolean,
482
482
  default: false
483
483
  },
484
+ initialDependencyValue: {
485
+ type: Object
486
+ },
484
487
  },
485
488
  emits: [
486
489
  "close",
@@ -571,6 +574,15 @@ export default {
571
574
  this.actualBookmarkedOptions = {};
572
575
  this.setBookmarkedOptions(this.actualOptions);
573
576
  },
577
+ initialDependencyValue(value) {
578
+ this.dependencyValue = value;
579
+
580
+ if (this.hasFilledDependency) {
581
+ this.$nextTick(() => {
582
+ this.loadValues();
583
+ });
584
+ }
585
+ },
574
586
  },
575
587
  mounted() {
576
588
  this.marker = new Mark(this.$refs.list.$el);
@@ -660,7 +672,7 @@ export default {
660
672
  },
661
673
  ...this.strings,
662
674
  },
663
- dependencyValue: null,
675
+ dependencyValue: this.initialDependencyValue,
664
676
  isInternalChange: false,
665
677
  nodeIndex: new Map()
666
678
  };
@@ -748,6 +760,9 @@ export default {
748
760
  }
749
761
  );
750
762
  this.isLoading = false;
763
+ if (!oldDependency && this.hasFilledDependency) {
764
+ this.setPreparedValues();
765
+ }
751
766
  } else {
752
767
  this.$globalEvents.$off("select-" + oldDependency + ":update");
753
768
  this.setPreparedValues().then(() => {
@@ -758,7 +773,21 @@ export default {
758
773
  });
759
774
  });
760
775
  }
761
- },
776
+ },
777
+ loadValues() {
778
+ this.setPreparedValues().then(() => {
779
+ if (!this.dependency) {
780
+ const values = Object.keys(this.selected);
781
+
782
+ // SP-13363
783
+ if (!(Array.isArray(this.options) && !this.options.length)) {
784
+ this.$globalEvents.$emit('select-' + this.filterId + ':update', {values, filter: this.filterId});
785
+ }
786
+ }
787
+
788
+ this.$emit('loaded', this.dependencyValue);
789
+ });
790
+ },
762
791
  filter(filterString, options) {
763
792
  this.filterString = filterString;
764
793
  this.$emit("search", this.filterString);
@@ -1174,6 +1203,9 @@ export default {
1174
1203
  : 0)
1175
1204
  );
1176
1205
  },
1206
+ hasFilledDependency() {
1207
+ return !!(this.dependency && this.dependencyValue && this.dependencyValue?.values && (!Array.isArray(this.dependencyValue?.values) || this.dependencyValue?.values.length));
1208
+ },
1177
1209
  },
1178
1210
  components: {
1179
1211
  IbAlert,