courthive-components 4.1.1 → 4.1.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.
@@ -15,7 +15,7 @@ export interface SchematicMatchUp {
15
15
  * Renders a compact matchup: two 5px-tall slots separated by a 1px divider.
16
16
  * Total height 11px vs ~60px for the full renderMatchUp.
17
17
  */
18
- export declare function renderSchematicMatchUp({ matchUp, moiety, isFirstRound, isFinalRound, isRoundRobin, isLucky }: {
18
+ export declare function renderSchematicMatchUp({ matchUp, moiety, isFirstRound, isFinalRound, isRoundRobin, roundFactor: roundFactorParam, isLucky }: {
19
19
  matchUp: SchematicMatchUp;
20
20
  moiety?: boolean;
21
21
  isFirstRound?: boolean;
@@ -23,4 +23,9 @@ export declare function renderSchematicMatchUp({ matchUp, moiety, isFirstRound,
23
23
  isRoundRobin?: boolean;
24
24
  isLucky?: boolean;
25
25
  initialRoundNumber?: number;
26
+ /**
27
+ * Connector scale for THIS render, supplied by `renderSchematicRound`.
28
+ * Falls back to the matchUp's own factor for direct callers.
29
+ */
30
+ roundFactor?: number;
26
31
  }): HTMLElement;
@@ -11,4 +11,10 @@ export declare function renderMatchUp(params: {
11
11
  isAdHoc?: boolean;
12
12
  eventHandlers?: EventHandlers;
13
13
  className?: string;
14
+ /**
15
+ * Connector-height scale for THIS render. `renderRound` computes it for the
16
+ * round the view currently starts at and passes it down; direct callers can
17
+ * leave it out and the matchUp's own factor is used.
18
+ */
19
+ roundFactor?: number;
14
20
  }): HTMLElement;
@@ -3242,10 +3242,10 @@ function gi({ initialRoundNumber: e = 1, eventHandlers: t, composition: n, sideN
3242
3242
  //#region src/components/renderStructure/renderMatchUp.ts
3243
3243
  var { QUALIFYING: _i } = n;
3244
3244
  function vi(e) {
3245
- let { composition: t, initialRoundNumber: n = 1, matchUp: r, moiety: i, selectedMatchUpId: a, searchActive: o } = e, { roundFactor: s, roundNumber: c, finishingRound: l, matchUpType: u, preFeedRound: d, stage: f } = r, p = e.isFinalRound || (l ? Number.parseInt(String(l)) === 1 : !1), m = f === _i && p, h = p, g = c ? Number.parseInt(String(c)) === n : !1, _ = u === "DOUBLES", v = (o || r.isRoundRobin || r.collectionId || e.isLucky || e.isAdHoc) && "mr" || h && "noProgression" || (m || d) && "m0" || i && "m1" || "m2", y = ei({
3245
+ let { composition: t, initialRoundNumber: n = 1, matchUp: r, moiety: i, selectedMatchUpId: a, searchActive: o } = e, { roundNumber: s, finishingRound: c, matchUpType: l, preFeedRound: u, stage: d } = r, f = e.roundFactor ?? r.roundFactor, p = e.isFinalRound || (c ? Number.parseInt(String(c)) === 1 : !1), m = d === _i && p, h = p, g = s ? Number.parseInt(String(s)) === n : !1, _ = l === "DOUBLES", v = (o || r.isRoundRobin || r.collectionId || e.isLucky || e.isAdHoc) && "mr" || h && "noProgression" || (m || u) && "m0" || i && "m1" || "m2", y = ei({
3246
3246
  composition: t,
3247
3247
  isDoubles: _,
3248
- roundFactor: s
3248
+ roundFactor: f
3249
3249
  })({
3250
3250
  isFirstRound: g,
3251
3251
  link: v
@@ -3343,35 +3343,30 @@ function yi({ initialRoundNumber: e = 1, selectedMatchUpId: t, eventHandlers: n,
3343
3343
  let t = m.reduce((e, t) => (e[t.structureId] = t.structureName, e), {});
3344
3344
  b = Object.values(t), x = Object.keys(t), S = Object.keys(_.instanceCount(m.map(({ structureId: e }) => e))).length;
3345
3345
  } else h && m.sort((e, t) => (e.roundOrder ?? 0) - (t.roundOrder ?? 0));
3346
- let C = S && m.length / S, w = Object.keys(l).map((e) => parseInt(e)), T = w.indexOf(c), E = T === 0 && "first" || T === w.length - 1 && "last", D = null;
3347
- return m.forEach((i, u) => {
3348
- let d = C && !(u % C), f = C && Math.floor(u / C), g = C && b[f];
3349
- if (d) {
3350
- D = document.createElement("div"), D.className = "chc-rr-group", D.setAttribute("data-group-id", x[f]), y.appendChild(D);
3346
+ let C = S && m.length / S, w = Object.keys(l).map((e) => parseInt(e)), T = w.indexOf(c), E = T === 0 && "first" || T === w.length - 1 && "last", D = l?.[e]?.roundFactor || 1, O = (t) => s || (t.roundFactor ? e > 1 ? t.roundFactor / D : t.roundFactor : 2 ** (c - e)), k = null;
3347
+ return m.forEach((i, s) => {
3348
+ let l = C && !(s % C), u = C && Math.floor(s / C), d = C && b[u];
3349
+ if (l) {
3350
+ k = document.createElement("div"), k.className = "chc-rr-group", k.setAttribute("data-group-id", x[u]), y.appendChild(k);
3351
3351
  let t = document.createElement("div");
3352
3352
  t.className = Ur({
3353
- ...f === 0 && { variant: 0 },
3353
+ ...u === 0 && { variant: 0 },
3354
3354
  ...E && { roundOrder: E }
3355
- }), D.appendChild(t);
3355
+ }), k.appendChild(t);
3356
3356
  let r = document.createElement("div");
3357
3357
  if (r.className = Wr(), R(n?.groupHeaderClick)) {
3358
3358
  let { drawId: e, containerStructureId: t } = m[0];
3359
- D.onclick = (r) => n.groupHeaderClick({
3360
- structureId: x[f],
3359
+ k.onclick = (r) => n.groupHeaderClick({
3360
+ structureId: x[u],
3361
3361
  containerStructureId: t,
3362
3362
  pointerEvent: r,
3363
3363
  drawId: e
3364
3364
  });
3365
3365
  }
3366
- c === e && (r.innerHTML = g), D.appendChild(r);
3366
+ c === e && (r.innerHTML = d), k.appendChild(r);
3367
3367
  }
3368
- let _ = u % 2 == 0;
3369
- if (s) i.roundFactor = s;
3370
- else if (e > 1 && i.roundFactor) {
3371
- let t = l?.[e]?.roundFactor || 1;
3372
- i.roundFactor /= t;
3373
- } else i.roundFactor ||= 2 ** (c - e);
3374
- let v = vi({
3368
+ let f = s % 2 == 0, g = vi({
3369
+ roundFactor: O(i),
3375
3370
  initialRoundNumber: e,
3376
3371
  selectedMatchUpId: t,
3377
3372
  eventHandlers: n,
@@ -3381,9 +3376,9 @@ function yi({ initialRoundNumber: e = 1, selectedMatchUpId: t, eventHandlers: n,
3381
3376
  isAdHoc: h,
3382
3377
  isLucky: p,
3383
3378
  matchUp: i,
3384
- moiety: _
3379
+ moiety: f
3385
3380
  });
3386
- (D || y).appendChild(v);
3381
+ (k || y).appendChild(g);
3387
3382
  }), v.appendChild(y), v;
3388
3383
  }
3389
3384
  //#endregion
@@ -3680,17 +3675,17 @@ function Vi({ matchUps: e, width: t = 56, quarterCount: n = 4 }) {
3680
3675
  //#endregion
3681
3676
  //#region src/components/renderSchematicStructure/renderSchematicMatchUp.ts
3682
3677
  var { QUALIFYING: Hi } = n;
3683
- function Ui({ matchUp: e, moiety: t, isFirstRound: n, isFinalRound: r, isRoundRobin: i, isLucky: a }) {
3684
- let { stage: o, preFeedRound: s } = e, c = o === Hi && r, l = r, u = (i || e.collectionId || a) && "mr" || l && "noProgression" || (c || s) && "m0" || t && "m1" || "m2", d = document.createElement("div");
3685
- d.className = "chc-schematic-matchup";
3686
- let f = document.createElement("div");
3687
- f.className = "chc-schematic-slot";
3678
+ function Ui({ matchUp: e, moiety: t, isFirstRound: n, isFinalRound: r, isRoundRobin: i, roundFactor: a, isLucky: o }) {
3679
+ let { stage: s, preFeedRound: c } = e, l = s === Hi && r, u = r, d = (i || e.collectionId || o) && "mr" || u && "noProgression" || (l || c) && "m0" || t && "m1" || "m2", f = document.createElement("div");
3680
+ f.className = "chc-schematic-matchup";
3688
3681
  let p = document.createElement("div");
3689
- p.className = "chc-schematic-divider";
3682
+ p.className = "chc-schematic-slot";
3690
3683
  let m = document.createElement("div");
3691
- m.className = (0, I.default)("chc-schematic-slot", "chc-schematic-link", n && "chc-schematic-link--first-round", u === "mr" && "chc-schematic-link--no-link", u === "m1" && "chc-schematic-link--m1", u === "m2" && "chc-schematic-link--m2", u === "m0" && "chc-schematic-link--m0", u === "noProgression" && "chc-schematic-link--no-progression");
3692
- let h = e.roundFactor || 1, g = 11 / 2 * h, _ = 11 / 2 * h;
3693
- return m.style.setProperty("--chc-schematic-connector-w", "8px"), m.style.setProperty("--chc-schematic-m1-h", `${g}px`), m.style.setProperty("--chc-schematic-m2-h", `${_}px`), d.appendChild(f), d.appendChild(p), d.appendChild(m), d;
3684
+ m.className = "chc-schematic-divider";
3685
+ let h = document.createElement("div");
3686
+ h.className = (0, I.default)("chc-schematic-slot", "chc-schematic-link", n && "chc-schematic-link--first-round", d === "mr" && "chc-schematic-link--no-link", d === "m1" && "chc-schematic-link--m1", d === "m2" && "chc-schematic-link--m2", d === "m0" && "chc-schematic-link--m0", d === "noProgression" && "chc-schematic-link--no-progression");
3687
+ let g = a ?? e.roundFactor ?? 1, _ = 11 / 2 * g, v = 11 / 2 * g;
3688
+ return h.style.setProperty("--chc-schematic-connector-w", "8px"), h.style.setProperty("--chc-schematic-m1-h", `${_}px`), h.style.setProperty("--chc-schematic-m2-h", `${v}px`), f.appendChild(p), f.appendChild(m), f.appendChild(h), f;
3694
3689
  }
3695
3690
  //#endregion
3696
3691
  //#region src/components/renderSchematicStructure/renderSchematicRound.ts
@@ -3701,16 +3696,18 @@ function Wi({ initialRoundFactor: e, initialRoundNumber: t = 1, isFinalRound: n,
3701
3696
  e.className = "chc-schematic-round-header", e.textContent = `R${i}`, l.appendChild(e);
3702
3697
  }
3703
3698
  let u = document.createElement("div");
3704
- return u.className = "chc-schematic-round", c.forEach((a, o) => {
3705
- e && a.roundFactor ? a.roundFactor /= e : a.roundFactor ||= 2 ** (i - t);
3706
- let c = o % 2 == 0, l = Ui({
3699
+ u.className = "chc-schematic-round";
3700
+ let d = (n) => n.roundFactor ? e ? n.roundFactor / e : n.roundFactor : 2 ** (i - t);
3701
+ return c.forEach((e, a) => {
3702
+ let o = a % 2 == 0, c = i === t, l = Ui({
3703
+ roundFactor: d(e),
3707
3704
  initialRoundNumber: t,
3708
3705
  isRoundRobin: r,
3709
3706
  isFinalRound: n,
3710
- isFirstRound: i === t,
3707
+ isFirstRound: c,
3711
3708
  isLucky: s,
3712
- matchUp: a,
3713
- moiety: c
3709
+ matchUp: e,
3710
+ moiety: o
3714
3711
  });
3715
3712
  u.appendChild(l);
3716
3713
  }), c.some((e) => e.preFeedRound) && !n && l.classList.add("chc-schematic-round--pre-feed"), l.appendChild(u), l;
@@ -15276,8 +15273,8 @@ function OC(e) {
15276
15273
  }
15277
15274
  var kC = {
15278
15275
  name: "courthive-components",
15279
- packageManager: "pnpm@11.25.0",
15280
- version: "4.1.1",
15276
+ packageManager: "pnpm@12.3.4",
15277
+ version: "4.1.2",
15281
15278
  engines: { node: ">=22" },
15282
15279
  description: "Components for competitions projects",
15283
15280
  files: ["dist"],
@@ -15350,11 +15347,11 @@ var kC = {
15350
15347
  "@types/d3": "^7.4.3",
15351
15348
  "@types/leaflet": "^1.9.12",
15352
15349
  "@types/vanillajs-datepicker": "^1.3.5",
15353
- "@typescript-eslint/eslint-plugin": "8.68.0",
15354
- "@typescript-eslint/parser": "8.68.0",
15350
+ "@typescript-eslint/eslint-plugin": "8.69.0",
15351
+ "@typescript-eslint/parser": "8.69.0",
15355
15352
  "@vitest/coverage-v8": "^5.0.0",
15356
15353
  "@vitest/ui": "^5.0.0",
15357
- eslint: "10.9.1",
15354
+ eslint: "10.10.0",
15358
15355
  "eslint-plugin-sonarjs": "4.2.0",
15359
15356
  "eslint-plugin-storybook": "^10.2.17",
15360
15357
  "gh-pages": "6.3.0",
@@ -15368,7 +15365,7 @@ var kC = {
15368
15365
  semver: "7.8.5",
15369
15366
  storybook: "^10.2.17",
15370
15367
  "tabulator-tables": "6.5.2",
15371
- "tods-competition-factory": "6.37.2",
15368
+ "tods-competition-factory": "6.38.0",
15372
15369
  typescript: "^6.0.2",
15373
15370
  vite: "8.2.2",
15374
15371
  "vite-plugin-dts": "^5.0.0",