courthive-components 6.0.1 → 6.1.0

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.
@@ -0,0 +1,83 @@
1
+ import { ScoreEntryState, SideNumber } from './logic/scoreEntryState';
2
+ import { StatusCodeGroups } from './logic/statusCodes';
3
+ /**
4
+ * One column the region contributes to the participant rows.
5
+ *
6
+ * `heading` and `width` travel TOGETHER deliberately. The header row and the participant rows are
7
+ * built from this one array, so a heading can never end up over a column it does not describe — the
8
+ * correspondence is structural rather than two lists that have to be kept the same length by hand.
9
+ * CA asked for that alignment explicitly (2026-09-27) and this is what makes it hold rather than a
10
+ * rule someone has to remember.
11
+ *
12
+ * A column with no `heading` renders no header cell, and a region whose columns are all unheaded gets
13
+ * no header row at all — which is what Free Score and the Dial Pad want, since their single readout
14
+ * column needs no label.
15
+ */
16
+ export type ScoreColumn = {
17
+ /** The heading above this column, e.g. `1st`. Omit for an unlabelled column. */
18
+ heading?: string;
19
+ /** A CSS grid track size. Defaults to the standard score-column width. */
20
+ width?: string;
21
+ };
22
+ export type ScoreRegion = {
23
+ /** The columns this region contributes to each participant row. */
24
+ columns?: () => ScoreColumn[];
25
+ /** The cells to place in one side's row. Must return one per column. */
26
+ rowCells?: (sideNumber: SideNumber) => HTMLElement[];
27
+ /** A block beneath the rows — a text field, or a keypad. */
28
+ block?: () => HTMLElement;
29
+ /** The score as it currently stands, for the result band. */
30
+ scoreString?: () => string | undefined;
31
+ /** Whether that score is a finished result. The region's judgement, never the card's. */
32
+ isComplete?: () => boolean;
33
+ /** The winner the score implies, when no ending overrides it. */
34
+ winningSide?: () => SideNumber | undefined;
35
+ /**
36
+ * A matchUpStatus the region itself parsed out of what was typed — Free Score only.
37
+ *
38
+ * Used ONLY when the operator has selected no ending. See `resolveReportedEnding` for why that
39
+ * precedence and not the other.
40
+ */
41
+ matchUpStatus?: () => string | undefined;
42
+ };
43
+ export type ScoreEntryCardParams = {
44
+ sides: [{
45
+ participantName: string;
46
+ seed?: string;
47
+ }, {
48
+ participantName: string;
49
+ seed?: string;
50
+ }];
51
+ matchUpFormat?: string;
52
+ /** e.g. `'R16 · Court 3'`. */
53
+ context?: string;
54
+ title?: string;
55
+ /** The score region for the active approach. */
56
+ region: ScoreRegion;
57
+ /** The policy's reason-code groups, if the tournament has a scoring policy attached. */
58
+ statusCodeGroups?: StatusCodeGroups;
59
+ /** Ending labels, so a locale can supply them. */
60
+ labels?: Record<string, string>;
61
+ /** The approach switcher's current label, e.g. `'Dynamic Sets'`. Omit to hide the switcher. */
62
+ approachLabel?: string;
63
+ onSwitchApproach?: () => void;
64
+ onCancel?: () => void;
65
+ onClear?: () => void;
66
+ onSubmit?: (outcome: {
67
+ matchUpStatus?: string;
68
+ winningSide?: number;
69
+ reasonCode?: string;
70
+ }) => void;
71
+ onClose?: () => void;
72
+ };
73
+ /** A card instance: its element, plus the handle the host needs to react to score-region changes. */
74
+ export type ScoreEntryCard = {
75
+ element: HTMLElement;
76
+ /** Re-render the band and the submit gate. Call when the score region's value changes. */
77
+ refresh: () => void;
78
+ /** Rebuild everything, including the region's cells. Call when the region's COLUMNS change. */
79
+ rerender: () => void;
80
+ /** The current ending state, for a host that needs to inspect it. */
81
+ getState: () => ScoreEntryState;
82
+ };
83
+ export declare function renderScoreEntryCard(params: ScoreEntryCardParams): ScoreEntryCard;
@@ -37,6 +37,10 @@ export type ScoringModalLabels = {
37
37
  incomplete?: string;
38
38
  walkover?: string;
39
39
  defaulted?: string;
40
+ suspended?: string;
41
+ deadRubber?: string;
42
+ inProgress?: string;
43
+ awaitingResult?: string;
40
44
  validScore?: string;
41
45
  scoreIncomplete?: string;
42
46
  invalidScore?: string;