courthive-components 6.0.1 → 6.2.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.
Files changed (32) hide show
  1. package/dist/components/matchUpFormat/matchUpFormatLogic.d.ts +1 -1
  2. package/dist/components/schedule-page/domain/utils.d.ts +21 -1
  3. package/dist/components/schedule-page/index.d.ts +1 -1
  4. package/dist/components/schedule-page/types.d.ts +26 -0
  5. package/dist/components/scoring/approaches/dialPadLogic.d.ts +5 -0
  6. package/dist/components/scoring/keyboard.d.ts +24 -0
  7. package/dist/components/scoring/logic/dynamicSetsLogic.d.ts +26 -8
  8. package/dist/components/scoring/logic/irregularEnding.d.ts +156 -16
  9. package/dist/components/scoring/logic/outcomeProjection.d.ts +25 -0
  10. package/dist/components/scoring/logic/scoreEntryModel.d.ts +175 -0
  11. package/dist/components/scoring/logic/scoreEntrySelectors.d.ts +88 -0
  12. package/dist/components/scoring/logic/scoreEntryState.d.ts +163 -0
  13. package/dist/components/scoring/logic/scoreEntryStore.d.ts +8 -0
  14. package/dist/components/scoring/logic/scoreEntrySummary.d.ts +28 -0
  15. package/dist/components/scoring/logic/statusCodes.d.ts +34 -0
  16. package/dist/components/scoring/logic/tiebreakEntry.d.ts +14 -0
  17. package/dist/components/scoring/regions/dialPadRegion.d.ts +17 -0
  18. package/dist/components/scoring/regions/dynamicSetsRegion.d.ts +28 -0
  19. package/dist/components/scoring/regions/freeScoreRegion.d.ts +24 -0
  20. package/dist/components/scoring/regions/scoreLine.d.ts +2 -0
  21. package/dist/components/scoring/regions/scoreReadout.d.ts +11 -0
  22. package/dist/components/scoring/regions/setColumns.d.ts +17 -0
  23. package/dist/components/scoring/scoreEntryCard.d.ts +191 -0
  24. package/dist/components/scoring/scoreEntryDialog.d.ts +94 -0
  25. package/dist/components/scoring/types.d.ts +4 -0
  26. package/dist/components/scoring/utils/aggregateDecider.d.ts +18 -0
  27. package/dist/courthive-components.css +1 -1
  28. package/dist/courthive-components.es.js +8996 -7025
  29. package/dist/courthive-components.umd.js +44 -44
  30. package/dist/index.d.ts +4 -1
  31. package/dist/types.d.ts +10 -0
  32. package/package.json +7 -7
@@ -0,0 +1,94 @@
1
+ import { SetScore } from './types';
2
+ import { ScoreEntryCard, ScoreEntryCardParams, ScoreEntryOutcome } from './scoreEntryCard';
3
+ /** The three entry approaches. The key is what `onSelectApproach` reports and what a host persists. */
4
+ export type ScoreEntryApproach = 'dynamicSets' | 'freeScore' | 'dialPad';
5
+ export type ScoreEntryDialogParams = Omit<ScoreEntryCardParams, 'region' | 'approachLabel' | 'approaches' | 'onSelectApproach' | 'onSwitchApproach' | 'onEditFormat' | 'onClose' | 'onSubmit'> & {
6
+ /**
7
+ * Called with the outcome, then the dialog closes.
8
+ *
9
+ * `sets` is added to what the card reports, because the dialog knows its regions carry them and a
10
+ * host saving to the factory needs the structured sets rather than only the formatted string.
11
+ */
12
+ onSubmit?: (outcome: ScoreEntryOutcome & {
13
+ sets: SetScore[];
14
+ }) => void;
15
+ /** Which approach opens. Defaults to Dynamic Sets. */
16
+ approach?: ScoreEntryApproach;
17
+ /** Which approaches the switcher offers. Defaults to all three; a single entry hides the menu. */
18
+ approaches?: ScoreEntryApproach[];
19
+ /** Sets already recorded, e.g. from a saved matchUp. Ignored when `matchUp` carries a score. */
20
+ sets?: SetScore[];
21
+ /**
22
+ * A matchUp whose outcome is being REOPENED.
23
+ *
24
+ * Everything a recorded outcome needs comes from here: the sets, the format, the ending, and the
25
+ * reason code — CA, 2026-09-28: *"we need to be able to open existing outcomes!"* Anything passed
26
+ * explicitly wins, so a host can override one part without unpacking the rest.
27
+ *
28
+ * `sides` stays separate rather than being read off `matchUp.sides`, because the card wants display
29
+ * names and a matchUp carries participants; that mapping belongs to the host, which already has it.
30
+ */
31
+ matchUp?: {
32
+ matchUpFormat?: string;
33
+ matchUpStatus?: string;
34
+ winningSide?: number;
35
+ score?: {
36
+ sets?: SetScore[];
37
+ };
38
+ sideStatusCodes?: Record<number, string>;
39
+ matchUpStatusCode?: string;
40
+ matchUpStatusCodes?: unknown[];
41
+ };
42
+ /** Called with the chosen approach whenever it changes, so a host can remember the preference. */
43
+ onApproachChange?: (approach: ScoreEntryApproach) => void;
44
+ /** Called with a format chosen in the picker. Omit and the format chip stays inert text. */
45
+ onFormatChange?: (matchUpFormat: string) => void;
46
+ /**
47
+ * Called when a format change DISCARDS part of the score, with what was lost and why.
48
+ *
49
+ * Only when something was actually discarded — a change that costs the operator nothing says
50
+ * nothing. `discarded` carries the sets themselves rather than a count, because a host that means to
51
+ * tell the operator has to quote them in their own numbers, and `reason` is the factory validator's
52
+ * own words about the first casualty.
53
+ */
54
+ onScoreDiscarded?: (discarded: {
55
+ sets: SetScore[];
56
+ discarded: SetScore[];
57
+ reason?: string;
58
+ matchUpFormat: string;
59
+ }) => void;
60
+ /** Called when the dialog closes, by `[X]`, by a footer button, or by `close()`. */
61
+ onClose?: () => void;
62
+ /**
63
+ * Whether to focus the first entry field on open. Defaults to true.
64
+ *
65
+ * `false` for a host that opens the dialog as a side effect of something else, where stealing focus
66
+ * would interrupt what the operator was actually doing.
67
+ */
68
+ autoFocus?: boolean;
69
+ /** Overrides cModal's config. `maxWidth`, `clickAway` and `padding` have deliberate defaults. */
70
+ modalConfig?: Record<string, any>;
71
+ /**
72
+ * The format picker. Defaults to this package's `getMatchUpFormatModal`.
73
+ *
74
+ * Injectable because a unit test has no business opening the real picker's modal — it is a second
75
+ * dialog with its own state — and because a host may have its own.
76
+ */
77
+ openFormatPicker?: (params: {
78
+ existingMatchUpFormat: string;
79
+ callback: (matchUpFormat: string) => void;
80
+ }) => void;
81
+ };
82
+ export type ScoreEntryDialog = {
83
+ /** The card, for a host that needs to read the state or drive it. */
84
+ card: ScoreEntryCard;
85
+ /** The approach currently shown. */
86
+ approach: () => ScoreEntryApproach;
87
+ /** Switch approach, carrying the typed score across. */
88
+ setApproach: (approach: ScoreEntryApproach) => void;
89
+ /** Change the scoring format, rebuilding the region under it. */
90
+ setMatchUpFormat: (matchUpFormat: string) => void;
91
+ /** Close the dialog. Runs `onClose` exactly once, however the close was triggered. */
92
+ close: () => void;
93
+ };
94
+ export declare function openScoreEntryDialog(params: ScoreEntryDialogParams): ScoreEntryDialog;
@@ -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;
@@ -0,0 +1,18 @@
1
+ /**
2
+ * INTERIM COPY of tods-competition-factory's aggregateDecider (factory #5166). Replace with the factory
3
+ * export once the release after 7.5.0 publishes it (CA, 2026-10-04) — tracked in Mentat TASKS.md.
4
+ */
5
+ /**
6
+ * The set number of an aggregate format's sudden-death decider, or `undefined` for any other format.
7
+ *
8
+ * A format decided by AGGREGATE points over EXACTLY N sets settles a level total with a sudden-death
9
+ * tiebreak (`SET3XA-S:T10-F:TB1`), and that tiebreak is NOT one of the N sets: it is set N + 1, played
10
+ * only when the totals are level (CA, 2026-10-04, the INTENNSE format). So its final-set format governs
11
+ * set N + 1, never set N. Every other format keeps its own reading of which set is the final one.
12
+ */
13
+ export declare function aggregateDeciderSetNumber(parsed: any): number | undefined;
14
+ /**
15
+ * Whether the final-set format (`-F:`) governs `setNumber`, given how the caller reads it for every
16
+ * other format: an aggregate format's decider is set N + 1 (above), and otherwise `otherwise` stands.
17
+ */
18
+ export declare function finalSetGoverns(parsed: any, setNumber: number | undefined, otherwise: boolean): boolean;