@dcrackel/hematournamentui 1.0.497 → 1.0.498

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.
@@ -34368,6 +34368,9 @@ const lz = /* @__PURE__ */ se(oz, [["render", az]]), cz = {
34368
34368
  };
34369
34369
  },
34370
34370
  computed: {
34371
+ lastNote() {
34372
+ return (this.fencer1 ? this.bout.Person1 : this.bout.Person2).EventPersons[0].LastNote ?? "";
34373
+ },
34371
34374
  currentScore() {
34372
34375
  return this.isCountingUp ? this.baseScore : this.maxScore - this.baseScore;
34373
34376
  },
@@ -34450,7 +34453,7 @@ function Ez(t, e, n, r, o, i) {
34450
34453
  ]),
34451
34454
  h("div", pz, [
34452
34455
  p(a, {
34453
- text: n.fencer1 ? n.bout.Person1.EventPersons[0].LastNote : n.bout.Person2.EventPersons[0].LastNote,
34456
+ text: i.lastNote,
34454
34457
  size: "sm",
34455
34458
  color: "primaryHighlight"
34456
34459
  }, null, 8, ["text"])
@@ -34859,10 +34862,10 @@ const Gz = /* @__PURE__ */ se(Rz, [["render", Uz]]), Jz = {
34859
34862
  },
34860
34863
  removeNote(t) {
34861
34864
  this.selectPenaltyId = null;
34862
- const e = this.fencer1 ? this.bout.Person1.Penalties.findIndex((n) => n.PenaltyId === t) : this.bout.Person2.Penalties.findIndex((n) => n.PenaltyId === t);
34863
- if (e !== -1) {
34864
- const n = this.fencer1 ? this.bout.Person1.Penalties.splice(e, 1)[0] : this.bout.Person1.Penalties.splice(e, 1)[0];
34865
- this.countCards(), this.$emit("penalty:remove", n);
34865
+ const e = this.fencer1 ? this.bout.Person1 : this.bout.Person2, n = e.Penalties.findIndex((r) => r.PenaltyId === t);
34866
+ if (n !== -1) {
34867
+ const r = e.Penalties.splice(n, 1)[0];
34868
+ this.countCards(), this.$emit("penalty:remove", r), e.EventPersons[0].LastNote === r.Notes && (e.Penalties.length > 0 ? e.EventPersons[0].LastNote = e.Penalties[e.Penalties.length - 1].Notes : e.EventPersons[0].LastNote = "");
34866
34869
  }
34867
34870
  },
34868
34871
  getFlagIcon(t) {
@@ -35096,6 +35099,9 @@ const sL = /* @__PURE__ */ se(Jz, [["render", iL]]), AL = {
35096
35099
  },
35097
35100
  handleAddPenalty(t) {
35098
35101
  this.$emit("penalty:add", { penalty: t, fencer1: this.fencer1 });
35102
+ },
35103
+ handleRemovePenalty(t) {
35104
+ this.$emit("penalty:remove", { penalty: t, fencer1: this.fencer1 });
35099
35105
  }
35100
35106
  }
35101
35107
  }, aL = { class: "flex w-full justify-end mt-1" };
@@ -35132,9 +35138,10 @@ function lL(t, e, n, r, o, i) {
35132
35138
  p(a, {
35133
35139
  fencer1: n.fencer1,
35134
35140
  bout: n.bout,
35141
+ "onPenalty:remove": i.handleRemovePenalty,
35135
35142
  "onPenalty:add": i.handleAddPenalty,
35136
35143
  "onPenalty:update": i.handleUpdatePenalty
35137
- }, null, 8, ["fencer1", "bout", "onPenalty:add", "onPenalty:update"])
35144
+ }, null, 8, ["fencer1", "bout", "onPenalty:remove", "onPenalty:add", "onPenalty:update"])
35138
35145
  ])
35139
35146
  ])) : b("", !0)
35140
35147
  ]),
@@ -35170,7 +35177,9 @@ const Vp = /* @__PURE__ */ se(AL, [["render", lL]]), cL = {
35170
35177
  showPenaltyModal: !1,
35171
35178
  fencer1ForModal: !0,
35172
35179
  localBout: { ...this.bout },
35173
- isCountingUp: !0
35180
+ isCountingUp: !0,
35181
+ lastNote1: "",
35182
+ lastNote2: ""
35174
35183
  };
35175
35184
  },
35176
35185
  mounted() {
@@ -35250,13 +35259,20 @@ const Vp = /* @__PURE__ */ se(AL, [["render", lL]]), cL = {
35250
35259
  openPenaltyModal(t) {
35251
35260
  this.fencer1ForModal = t, this.showPenaltyModal = !0;
35252
35261
  },
35262
+ preparePenalty(t, e) {
35263
+ const n = t.penalty;
35264
+ return e ? (this.localBout.Person1.EventPersons[0].LastNote = n.Notes, n.PersonId = this.localBout.Person1Id) : (this.localBout.Person2.EventPersons[0].LastNote = n.Notes, n.PersonId = this.localBout.Person2Id), n.BoutId = this.localBout.BoutId, n.EventId = this.localBout.EventId, n;
35265
+ },
35253
35266
  handleUpdatePenalty(t) {
35254
- const e = t.penalty;
35255
- t.fencer1 ? this.bout.Person1.EventPersons[0].LastNote = e.Notes : this.bout.Person2.EventPersons[0].LastNote = e.Notes, this.$emit("penalty:update", e);
35267
+ const e = this.preparePenalty(t, t.fencer1);
35268
+ this.$emit("penalty:update", e);
35256
35269
  },
35257
35270
  handleAddPenalty(t) {
35258
- const e = t.penalty;
35259
- t.fencer1 ? this.bout.Person1.EventPersons[0].LastNote = e.Notes : this.bout.Person2.EventPersons[0].LastNote = e.Notes, this.$emit("penalty:add", e);
35271
+ const e = this.preparePenalty(t, t.fencer1);
35272
+ this.$emit("penalty:add", e);
35273
+ },
35274
+ handleRemovePenalty(t) {
35275
+ t.BoutId = this.localBout.BoutId, t.EventId = this.localBout.EventId, this.$emit("penalty:remove", t);
35260
35276
  }
35261
35277
  }
35262
35278
  }, uL = { class: "w-11/12 mt-5 mx-6" };
@@ -35312,9 +35328,10 @@ function dL(t, e, n, r, o, i) {
35312
35328
  eventRules: n.eventRules,
35313
35329
  show: o.showPenaltyModal,
35314
35330
  "onUpdate:closeModal": i.handleCloseModal,
35331
+ "onPenalty:remove": i.handleRemovePenalty,
35315
35332
  "onPenalty:add": i.handleAddPenalty,
35316
35333
  "onPenalty:update": i.handleUpdatePenalty
35317
- }, null, 8, ["fencer1", "bout", "eventRules", "show", "onUpdate:closeModal", "onPenalty:add", "onPenalty:update"])
35334
+ }, null, 8, ["fencer1", "bout", "eventRules", "show", "onUpdate:closeModal", "onPenalty:remove", "onPenalty:add", "onPenalty:update"])
35318
35335
  ]);
35319
35336
  }
35320
35337
  const Wp = /* @__PURE__ */ se(cL, [["render", dL]]), gL = {
@@ -37915,7 +37932,7 @@ const nf = /* @__PURE__ */ se(JN, [["render", VN]]), WN = {
37915
37932
  required: !1
37916
37933
  }
37917
37934
  },
37918
- emits: ["action:editBout", "action:directingBout"],
37935
+ emits: ["action:editBout", "action:directingBout", "penalty:add", "penalty:update"],
37919
37936
  computed: {
37920
37937
  groupedBouts() {
37921
37938
  const t = this.groupBoutsByRound(this.bouts), { winnerBouts: e, loserBouts: n } = Object.entries(t).reduce(
@@ -38028,7 +38045,7 @@ function eH(t, e, n, r, o, i) {
38028
38045
  ]))
38029
38046
  ], 64);
38030
38047
  }
38031
- const tH = /* @__PURE__ */ se(WN, [["render", eH], ["__scopeId", "data-v-8f60aebc"]]), nH = {
38048
+ const tH = /* @__PURE__ */ se(WN, [["render", eH], ["__scopeId", "data-v-4640b380"]]), nH = {
38032
38049
  components: {
38033
38050
  ServerConnected: uc,
38034
38051
  TableauColumn: nf,