@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/dist/index.js CHANGED
@@ -5437,6 +5437,9 @@ const vc = {
5437
5437
  alphabeticStyle: {
5438
5438
  type: Boolean,
5439
5439
  default: !1
5440
+ },
5441
+ initialDependencyValue: {
5442
+ type: Object
5440
5443
  }
5441
5444
  },
5442
5445
  emits: [
@@ -5503,6 +5506,11 @@ const vc = {
5503
5506
  },
5504
5507
  initBookmarks() {
5505
5508
  this.actualBookmarkedOptions = {}, this.setBookmarkedOptions(this.actualOptions);
5509
+ },
5510
+ initialDependencyValue(t) {
5511
+ this.dependencyValue = t, this.hasFilledDependency && this.$nextTick(() => {
5512
+ this.loadValues();
5513
+ });
5506
5514
  }
5507
5515
  },
5508
5516
  mounted() {
@@ -5573,7 +5581,7 @@ const vc = {
5573
5581
  ),
5574
5582
  ...this.strings
5575
5583
  },
5576
- dependencyValue: null,
5584
+ dependencyValue: this.initialDependencyValue,
5577
5585
  isInternalChange: !1,
5578
5586
  nodeIndex: /* @__PURE__ */ new Map()
5579
5587
  };
@@ -5640,7 +5648,7 @@ const vc = {
5640
5648
  (n) => {
5641
5649
  this.clear(), this.dependencyValue = n, this.dependencyValue && this.dependencyValue.values && (!Array.isArray(this.dependencyValue.values) || this.dependencyValue.values.length) && this.setPreparedValues();
5642
5650
  }
5643
- ), this.isLoading = !1) : (this.$globalEvents.$off("select-" + t + ":update"), this.setPreparedValues().then(() => {
5651
+ ), this.isLoading = !1, !t && this.hasFilledDependency && this.setPreparedValues()) : (this.$globalEvents.$off("select-" + t + ":update"), this.setPreparedValues().then(() => {
5644
5652
  const n = Object.keys(this.selected);
5645
5653
  this.$globalEvents.$emit("select-" + this.filterId + ":update", {
5646
5654
  values: n,
@@ -5648,6 +5656,15 @@ const vc = {
5648
5656
  });
5649
5657
  }));
5650
5658
  },
5659
+ loadValues() {
5660
+ this.setPreparedValues().then(() => {
5661
+ if (!this.dependency) {
5662
+ const t = Object.keys(this.selected);
5663
+ Array.isArray(this.options) && !this.options.length || this.$globalEvents.$emit("select-" + this.filterId + ":update", { values: t, filter: this.filterId });
5664
+ }
5665
+ this.$emit("loaded", this.dependencyValue);
5666
+ });
5667
+ },
5651
5668
  filter(t, n) {
5652
5669
  this.filterString = t, this.$emit("search", this.filterString), this.defaultFilter(n);
5653
5670
  },
@@ -5835,6 +5852,10 @@ const vc = {
5835
5852
  return this.traverseTree(this.actualOptions, (n) => {
5836
5853
  (!this.onlyEndNodes || !n.children) && !t.includes(n.id) && n.visible && t.push(n.id);
5837
5854
  }), t.length + (this.isBookmarkable ? Object.keys(this.actualBookmarkedOptions).length : 0);
5855
+ },
5856
+ hasFilledDependency() {
5857
+ var t, n, e;
5858
+ return !!(this.dependency && this.dependencyValue && ((t = this.dependencyValue) != null && t.values) && (!Array.isArray((n = this.dependencyValue) == null ? void 0 : n.values) || (e = this.dependencyValue) != null && e.values.length));
5838
5859
  }
5839
5860
  },
5840
5861
  components: {