@dcrackel/hematournamentui 1.0.566 → 1.0.568

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.
@@ -11561,6 +11561,18 @@ const ww = /* @__PURE__ */ oe(Iw, [["render", vw]]), yw = {
11561
11561
  filteredItems: this.items
11562
11562
  };
11563
11563
  },
11564
+ watch: {
11565
+ items: {
11566
+ handler(n) {
11567
+ this.filteredItems = [...n], this.applyFilters();
11568
+ },
11569
+ deep: !0,
11570
+ immediate: !0
11571
+ }
11572
+ },
11573
+ mounted() {
11574
+ this.applyFilters();
11575
+ },
11564
11576
  computed: {
11565
11577
  getTitle() {
11566
11578
  switch (this.component) {
@@ -11608,17 +11620,15 @@ const ww = /* @__PURE__ */ oe(Iw, [["render", vw]]), yw = {
11608
11620
  methods: {
11609
11621
  applyFilters() {
11610
11622
  let n = [...this.items];
11611
- n = this.applySearchFilter(n), console.log("Filtered results being applied:", n), this.component === "TournamentAdminCard" && (n = this.filterByTimeFrame(n)), n = this.applySorting(n), this.filteredItems = n, console.log("Final filteredItems being set:", this.filteredItems);
11623
+ n = this.applySearchFilter(n), this.component === "TournamentAdminCard" && (n = this.filterByTimeFrame(n)), n = this.applySorting(n), this.filteredItems = n;
11612
11624
  },
11613
11625
  applySearchFilter(n) {
11614
11626
  if (!this.filterOn.trim()) return n;
11615
- console.log("applySearchFilter on:", this.filterOn);
11616
11627
  const e = this.filterOn.toLowerCase();
11617
- let t = n.filter((r) => {
11618
- var o, i, A, a;
11619
- return this.component === "TournamentAdminCard" ? ((o = r.Name) == null ? void 0 : o.toLowerCase().includes(e)) ?? !1 : this.component === "FencerFinalResultCard" ? ((A = (i = r.Person) == null ? void 0 : i.DisplayName) == null ? void 0 : A.toLowerCase().includes(e)) ?? !1 : this.component === "ClubCard" ? ((a = r.Name) == null ? void 0 : a.toLowerCase().includes(e)) ?? !1 : !1;
11628
+ return n.filter((t) => {
11629
+ var r, o, i, A;
11630
+ return this.component === "TournamentAdminCard" ? ((r = t.Name) == null ? void 0 : r.toLowerCase().includes(e)) ?? !1 : this.component === "FencerFinalResultCard" ? ((i = (o = t.Person) == null ? void 0 : o.DisplayName) == null ? void 0 : i.toLowerCase().includes(e)) ?? !1 : this.component === "ClubCard" ? ((A = t.Name) == null ? void 0 : A.toLowerCase().includes(e)) ?? !1 : !1;
11620
11631
  });
11621
- return console.log("Filtered items:", t), t;
11622
11632
  },
11623
11633
  filterByTimeFrame(n) {
11624
11634
  const e = /* @__PURE__ */ new Date();
@@ -11675,7 +11685,7 @@ const ww = /* @__PURE__ */ oe(Iw, [["render", vw]]), yw = {
11675
11685
  this.sortCriteria = n.text;
11676
11686
  },
11677
11687
  handleTimeFrameChange(n) {
11678
- this.selectedTimeFrame = n;
11688
+ this.selectedTimeFrame = n, this.applyFilters();
11679
11689
  },
11680
11690
  handleClick(n) {
11681
11691
  this.$emit("update:edit", n.TournamentId);