courthive-components 6.10.1 → 6.10.2

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.
@@ -159,9 +159,8 @@ export type ScoreEntryCardParams = {
159
159
  /**
160
160
  * Whether a recorded outcome may be REMOVED. Only the draw knows whether a later match depends on the
161
161
  * result, so the host reads it from the engine (the factory's `CLEAR_SCORE` matchUp action) rather than
162
- * the dialog guessing. `false` disables `[Clear]` on a reopened result and says why in its
163
- * tooltip (`labels.clearRefused`), so the dialog never offers a
164
- * submission the engine will refuse. Omitted, `[Clear]` behaves as it always has.
162
+ * the dialog guessing. `false` disables submitting an empty replacement for a recorded result.
163
+ * `[Clear]` still resets the entry form so the operator can type a replacement score.
165
164
  */
166
165
  clearable?: boolean;
167
166
  /** Scoped statuses refused by the factory SCORE action. */
@@ -73,8 +73,8 @@ export type ScoringModalParams = {
73
73
  /**
74
74
  * Whether a recorded outcome may be REMOVED. Only the draw knows whether a later match depends on the
75
75
  * result, so the host reads it from the engine (the factory's `CLEAR_SCORE` matchUp action) rather than
76
- * the dialog guessing. `false` withholds `[Clear]` on a reopened result, so the dialog never offers a
77
- * submission the engine will refuse. Omitted, `[Clear]` behaves as it always has.
76
+ * the dialog guessing. `false` disables submitting an empty replacement for a recorded result.
77
+ * `[Clear]` still resets the entry form so the operator can type a replacement score.
78
78
  */
79
79
  clearable?: boolean;
80
80
  /** Scoped statuses refused by the factory SCORE action. Omitted preserves the unrestricted vocabulary. */
@@ -2887,7 +2887,7 @@ function ki({ value: e } = {}) {
2887
2887
  //#endregion
2888
2888
  //#region src/components/renderStructure/renderSideScore.ts
2889
2889
  function Ai({ gameScoreOnly: e, scoreStripes: t, set: n, sideNumber: r }) {
2890
- let i = r === n?.winningSide || n?.winningSide ? "loser" : void 0, a = r === 2 ? n.side2Score : n.side1Score, o = n.side2TiebreakScore !== void 0 || n.side1TiebreakScore !== void 0, s = r === 2 ? n.side2TiebreakScore : n.side1TiebreakScore, c = (a === void 0 || n.tiebreakSet === !0) && s !== void 0, l = c ? s : a, u = t && n.setNumber % 2 ? "var(--chc-bg-secondary)" : "transparent", d = n.editing ? n.editing === r : void 0, f;
2890
+ let i = r === n?.winningSide && "winner" || (n?.winningSide ? "loser" : void 0), a = r === 2 ? n.side2Score : n.side1Score, o = n.side2TiebreakScore !== void 0 || n.side1TiebreakScore !== void 0, s = r === 2 ? n.side2TiebreakScore : n.side1TiebreakScore, c = (a === void 0 || n.tiebreakSet === !0) && s !== void 0, l = c ? s : a, u = t && n.setNumber % 2 ? "var(--chc-bg-secondary)" : "transparent", d = n.editing ? n.editing === r : void 0, f;
2891
2891
  if (d) f = ki({ value: l });
2892
2892
  else if (f = document.createElement("p"), f.className = Ti({ variant: i }), f.classList.add("tmx-st"), f.setAttribute("setNumber", n.setNumber), f.style.backgroundColor = u, f.innerHTML = l != null && !Number.isNaN(Number(l)) ? l : "", !e) {
2893
2893
  let e = document.createElement("span");
@@ -10305,6 +10305,9 @@ function rp(e) {
10305
10305
  groups: a,
10306
10306
  labels: i
10307
10307
  }), l = Sl(i), u = Bl().scoringApproach || "dynamicSets", d = !!(t.score?.sets?.length || t.matchUpStatus), f = !!(t.winningSide || t.score?.sets?.length || t.matchUpStatus && t.matchUpStatus !== "TO_BE_PLAYED"), p = o === !1 && f, m = null, h = !1, g = !1, _ = (e) => {
10308
+ let t = !e.winningSide && !e.sets?.length && !e.score?.trim() && (!e.matchUpStatus || e.matchUpStatus === "TO_BE_PLAYED");
10309
+ return p && t ? !1 : !Cl(e.matchUpStatus, s, l) && (u === "inlineScoring" || e.isValid || h && d);
10310
+ }, v = (e) => {
10308
10311
  if (g) return;
10309
10312
  let t = Cl(e.matchUpStatus, s, l);
10310
10313
  m = t ? {
@@ -10313,48 +10316,48 @@ function rp(e) {
10313
10316
  error: t
10314
10317
  } : e, c.update(e?.matchUpStatus), h && (e.sets?.length > 0 || e.score) && (h = !1);
10315
10318
  let n = document.getElementById("submitScoreV2");
10316
- n && (n.disabled = !(!t && (u === "inlineScoring" || e.isValid || h && d)));
10319
+ n && (n.disabled = !_(e));
10317
10320
  let r = document.getElementById("clearScoreV2");
10318
10321
  if (r) {
10319
10322
  let t = document.getElementById("scoreInputV2");
10320
- if (t) r.disabled = !t.value.trim();
10323
+ if (t) r.disabled = !t.value.trim() && !(f && !h);
10321
10324
  else {
10322
10325
  let t = e.sets && e.sets.length > 0, n = e.matchUpStatus && e.matchUpStatus !== "COMPLETED" && e.matchUpStatus !== "TO_BE_PLAYED";
10323
- r.disabled = !(t || n);
10326
+ r.disabled = !(t || n || f && !h);
10324
10327
  }
10325
10328
  }
10326
- }, v = () => {
10329
+ }, y = () => {
10327
10330
  window.cleanupDialPad && (window.cleanupDialPad(), window.cleanupDialPad = void 0), window.resetDialPad && (window.resetDialPad = void 0), window.resetDynamicSets && (window.resetDynamicSets = void 0), window.resetInlineScoring && (window.resetInlineScoring = void 0);
10328
- }, y = (e) => {
10331
+ }, b = (e) => {
10329
10332
  let n = rd(t, m), r = document.createElement("div");
10330
10333
  r.style.padding = "1em";
10331
10334
  let a = document.createElement("div");
10332
10335
  return r.appendChild(a), r.appendChild(c.element), r.appendChild(wl(s, l)), c.update(m?.matchUpStatus ?? t.matchUpStatus), e === "freeScore" ? Bf({
10333
10336
  matchUp: n,
10334
10337
  container: a,
10335
- onScoreChange: _,
10338
+ onScoreChange: v,
10336
10339
  disabledMatchUpStatuses: s,
10337
10340
  labels: i
10338
10341
  }) : e === "dynamicSets" ? wu({
10339
10342
  matchUp: n,
10340
10343
  container: a,
10341
- onScoreChange: _,
10344
+ onScoreChange: v,
10342
10345
  disabledMatchUpStatuses: s,
10343
10346
  labels: i
10344
10347
  }) : e === "dialPad" ? nd({
10345
10348
  matchUp: n,
10346
10349
  container: a,
10347
- onScoreChange: _,
10350
+ onScoreChange: v,
10348
10351
  disabledMatchUpStatuses: s,
10349
10352
  labels: i
10350
10353
  }) : e === "inlineScoring" && Lu({
10351
10354
  matchUp: n,
10352
10355
  container: a,
10353
- onScoreChange: _,
10356
+ onScoreChange: v,
10354
10357
  disabledMatchUpStatuses: s,
10355
10358
  labels: i
10356
10359
  }), r;
10357
- }, b = {
10360
+ }, x = {
10358
10361
  freeScore: `
10359
10362
  <strong>${i.scoreTips || "Score Entry Tips:"}</strong><br><br>
10360
10363
  <strong>${i.setScores || "Set Scores:"}</strong> Space or dash-separated (e.g., "6-4 6-3")<br><br>
@@ -10383,34 +10386,34 @@ function rp(e) {
10383
10386
  <strong>${i.irregularEndings || ep}</strong> Retired, Walkover, Default available for irregular endings.
10384
10387
  `,
10385
10388
  inlineScoring: "\n <strong>Inline Scoring:</strong><br><br>\n Click on <strong>game scores</strong> to add a game for that side.<br><br>\n Click on <strong>point scores</strong> to award a point.<br><br>\n Use the <strong>LIVE</strong> pill to set an irregular ending (Retired, Walkover, etc.).<br><br>\n <strong>Undo/Redo/Clear</strong> buttons control scoring history.\n "
10386
- }, x = () => np.map((e) => ({
10389
+ }, S = () => np.map((e) => ({
10387
10390
  label: tp[e],
10388
10391
  active: e === u,
10389
- onClick: () => T(e)
10390
- })), S = () => ({
10391
- info: b[u],
10392
- menu: { menuItems: x() },
10392
+ onClick: () => E(e)
10393
+ })), C = () => ({
10394
+ info: x[u],
10395
+ menu: { menuItems: S() },
10393
10396
  clickAway: !1
10394
- }), C = () => {
10397
+ }), w = () => {
10395
10398
  setTimeout(() => {
10396
10399
  if (g) return;
10397
10400
  let e = document.getElementById("clearScoreV2");
10398
- e && (e.style.backgroundColor = "var(--chc-clear-btn-bg)", e.style.color = "var(--chc-clear-btn-text)", d && (e.disabled = !1)), m && _(m);
10401
+ e && (e.style.backgroundColor = "var(--chc-clear-btn-bg)", e.style.color = "var(--chc-clear-btn-text)", d && (e.disabled = !1)), m && v(m);
10399
10402
  }, 0);
10400
- }, w, T = (e) => {
10401
- e !== u && (v(), h = !1, u = e, Vl({ scoringApproach: e }), w && (w.update({
10402
- content: y(e),
10403
- config: S()
10404
- }), C()));
10403
+ }, T, E = (e) => {
10404
+ e !== u && (y(), h = !1, u = e, Vl({ scoringApproach: e }), T && (T.update({
10405
+ content: b(e),
10406
+ config: C()
10407
+ }), w()));
10405
10408
  };
10406
- w = Te.open({
10409
+ T = Te.open({
10407
10410
  title: i.title || "Score Entry",
10408
- content: y(u),
10409
- config: S(),
10411
+ content: b(u),
10412
+ config: C(),
10410
10413
  buttons: [
10411
10414
  {
10412
10415
  onClick: () => {
10413
- v();
10416
+ y();
10414
10417
  },
10415
10418
  label: i.cancel || "Cancel",
10416
10419
  intent: "none",
@@ -10439,8 +10442,8 @@ function rp(e) {
10439
10442
  intent: "is-primary",
10440
10443
  disabled: u !== "inlineScoring",
10441
10444
  onClick: () => {
10442
- if (m && !Cl(m.matchUpStatus, s, l) && (u === "inlineScoring" || m.isValid || h && d)) {
10443
- v();
10445
+ if (m && _(m)) {
10446
+ y();
10444
10447
  let e = c.getSelectedCode();
10445
10448
  n(e ? {
10446
10449
  ...m,
@@ -10450,11 +10453,11 @@ function rp(e) {
10450
10453
  },
10451
10454
  close: !0
10452
10455
  }
10453
- ].filter((e) => !(p && e.id === "clearScoreV2")),
10456
+ ],
10454
10457
  onClose: () => {
10455
10458
  g = !0, r?.();
10456
10459
  }
10457
- }), C();
10460
+ }), w();
10458
10461
  }
10459
10462
  //#endregion
10460
10463
  //#region src/components/scoring/regions/setColumns.ts
@@ -11764,7 +11767,7 @@ function Xm(e) {
11764
11767
  }
11765
11768
  //#endregion
11766
11769
  //#region src/components/scoring/scoreEntryCard.ts
11767
- var { RETIRED: Zm, WALKOVER: Qm, DEFAULTED: $m, IN_PROGRESS: eh, CANCELLED: th, AWAITING_RESULT: nh, SUSPENDED: rh } = h, ih = "chc-sec-btn", ah = "chc-sec-btn chc-sec-btn-pill", oh = "chc-sec-check", sh = "chc-sec-other-menu", ch = "chc-sec-other-item", lh = "aria-label", uh = "chc-sec-spacer", dh = "Other…", fh = "Other", ph = "chc-sec-band-headline", mh = "chc-sec-band-detail", hh = "The recorded result will be removed — Submit to clear it.", gh = "This result can't be cleared: a later match depends on it.", _h = "aria-pressed", vh = "aria-expanded", yh = "M20 6 9 17l-5-5", bh = 62, xh = 6, Sh = "(width <= 560px)";
11770
+ var { RETIRED: Zm, WALKOVER: Qm, DEFAULTED: $m, IN_PROGRESS: eh, CANCELLED: th, AWAITING_RESULT: nh, SUSPENDED: rh } = h, ih = "chc-sec-btn", ah = "chc-sec-btn chc-sec-btn-pill", oh = "chc-sec-check", sh = "chc-sec-other-menu", ch = "chc-sec-other-item", lh = "aria-label", uh = "chc-sec-spacer", dh = "Other…", fh = "Other", ph = "chc-sec-band-headline", mh = "chc-sec-band-detail", hh = "The recorded result will be removed — Submit to clear it.", gh = "Enter a replacement score: a later match depends on this result.", _h = "aria-pressed", vh = "aria-expanded", yh = "M20 6 9 17l-5-5", bh = 62, xh = 6, Sh = "(width <= 560px)";
11768
11771
  function Ch() {
11769
11772
  return globalThis.matchMedia?.(Sh).matches ?? !1;
11770
11773
  }
@@ -11861,10 +11864,10 @@ function kh(e) {
11861
11864
  }
11862
11865
  function j() {
11863
11866
  let r = q("chc-sec-footer"), i = Mh("Cancel", ih);
11864
- return i.dataset.action = "cancel", i.addEventListener("click", () => e.onCancel?.()), C.dataset.action = "clear", c && (C.title = t.clearRefused ?? gh), C.addEventListener("click", () => {
11867
+ return i.dataset.action = "cancel", i.addEventListener("click", () => e.onCancel?.()), C.dataset.action = "clear", C.addEventListener("click", () => {
11865
11868
  a.set(Mp(M())), n.clear?.(), d = void 0, f = !1, l = !0, e.onClear?.(), L(), n.focusFirst?.();
11866
11869
  }), S.dataset.action = "submit", S.addEventListener("click", () => {
11867
- if (Cl(oe().matchUpStatus, e.disabledMatchUpStatuses, t)) return;
11870
+ if (c && !ue() || Cl(oe().matchUpStatus, e.disabledMatchUpStatuses, t)) return;
11868
11871
  if (ce()) {
11869
11872
  e.onSubmit?.({ cleared: !0 });
11870
11873
  return;
@@ -11987,7 +11990,7 @@ function kh(e) {
11987
11990
  function le() {
11988
11991
  R(), ne();
11989
11992
  let e = oe();
11990
- Ce(e), S.disabled = !!I() || !(ce() || e.isValid || !e.hasEnding && F()), C.disabled = !ue() || c;
11993
+ Ce(e), S.disabled = c && !ue() || !!I() || !(ce() || e.isValid || !e.hasEnding && F()), C.disabled = !ue(), S.title = c && !ue() ? t.clearRefused ?? gh : "";
11991
11994
  }
11992
11995
  function ue() {
11993
11996
  let e = N();
@@ -12149,6 +12152,10 @@ function kh(e) {
12149
12152
  b.replaceChildren(), b.dataset.tone = "warn", b.setAttribute("role", "status"), b.append(Ah(ph, r)), we(!0);
12150
12153
  return;
12151
12154
  }
12155
+ if (c && !ue()) {
12156
+ b.replaceChildren(), b.dataset.tone = "warn", b.setAttribute("role", "status"), b.append(Ah(ph, t.clearRefused ?? gh)), we(!0);
12157
+ return;
12158
+ }
12152
12159
  if (ce()) {
12153
12160
  b.replaceChildren(), b.dataset.tone = "warn", b.setAttribute("role", "status"), b.append(Ah(ph, t.clearedHeadline ?? hh)), we(!0);
12154
12161
  return;
@@ -18026,7 +18033,7 @@ function RO(e) {
18026
18033
  var zO = {
18027
18034
  name: "courthive-components",
18028
18035
  packageManager: "pnpm@12.10.1",
18029
- version: "6.10.1",
18036
+ version: "6.10.2",
18030
18037
  engines: { node: ">=22" },
18031
18038
  description: "Components for competitions projects",
18032
18039
  files: ["dist"],