courthive-components 6.4.2 → 6.5.1

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "courthive-components",
3
3
  "packageManager": "pnpm@12.9.1",
4
- "version": "6.4.2",
4
+ "version": "6.5.1",
5
5
  "engines": {
6
6
  "node": ">=22"
7
7
  },
@@ -100,7 +100,7 @@
100
100
  "semver": "7.8.5",
101
101
  "storybook": "^10.2.17",
102
102
  "tabulator-tables": "6.6.1",
103
- "tods-competition-factory": "7.10.0",
103
+ "tods-competition-factory": "7.11.0",
104
104
  "typescript": "^6.0.2",
105
105
  "vite": "8.3.2",
106
106
  "vite-plugin-dts": "^5.0.0",
@@ -1,112 +0,0 @@
1
- /**
2
- * Pure logic for match format configuration
3
- * Extracted from matchUpFormat.ts for testability
4
- */
5
- export declare const TIMED_SETS = "Timed set";
6
- export declare const TIEBREAKS = "Tiebreak";
7
- export declare const NOAD = "No-Ad";
8
- export declare const SETS = "Set";
9
- export declare const AD = "Ad";
10
- export declare const MATCH_ROOTS: readonly ["SET", "HAL", "QTR", "PER", "INN", "RND", "FRM", "MAP"];
11
- export declare const MATCH_ROOT_LABELS: Record<string, string>;
12
- /**
13
- * Returns valid bestOf options for a given match root.
14
- * SET root: [1,3,5,7,9] — odd counts; the factory parses any best-of count (#5136)
15
- * Other roots: [1..12] (wide range for cross-sport)
16
- */
17
- export declare function getBestOfOptionsForRoot(matchRoot?: string): number[];
18
- export interface SetFormatConfig {
19
- descriptor: string;
20
- bestOf?: number;
21
- exactly?: number;
22
- advantage: string;
23
- what: string;
24
- setTo: number;
25
- tiebreakAt: number;
26
- tiebreakTo: number;
27
- winBy: number;
28
- minutes: number;
29
- based?: string;
30
- modifier?: string;
31
- }
32
- export interface FormatConfig {
33
- matchRoot?: string;
34
- aggregate?: boolean;
35
- gameFormat?: {
36
- type: 'CONSECUTIVE';
37
- count: number;
38
- deuceAfter?: number;
39
- } | {
40
- type: 'TRADITIONAL';
41
- deuceAfter?: number;
42
- };
43
- setFormat: SetFormatConfig;
44
- finalSetFormat: SetFormatConfig;
45
- }
46
- export interface ParsedMatchUpFormat {
47
- matchRoot?: string;
48
- aggregate?: boolean;
49
- gameFormat?: {
50
- type: 'CONSECUTIVE';
51
- count: number;
52
- deuceAfter?: number;
53
- } | {
54
- type: 'TRADITIONAL';
55
- deuceAfter?: number;
56
- };
57
- bestOf?: number;
58
- exactly?: number;
59
- setFormat: any;
60
- finalSetFormat?: any;
61
- }
62
- /**
63
- * Create default set format configuration
64
- */
65
- export declare function createDefaultSetFormat(isFinalSet?: boolean): SetFormatConfig;
66
- /**
67
- * Create default format configuration
68
- */
69
- export declare function createDefaultFormat(): FormatConfig;
70
- /**
71
- * Check if a set format is tiebreak-only (e.g., F:TB10)
72
- */
73
- export declare function isTiebreakOnlySet(setFormat: any): boolean;
74
- /**
75
- * Generate a setFormat object from FormatConfig
76
- * Pure function - no DOM dependencies
77
- */
78
- export declare function buildSetFormat(config: SetFormatConfig, hasTiebreak: boolean): any;
79
- /**
80
- * Build parsed matchUp format from current configuration
81
- * Pure function - no DOM dependencies
82
- */
83
- export declare function buildParsedFormat(config: FormatConfig, hasSetTiebreak: boolean, hasFinalSet: boolean, hasFinalSetTiebreak: boolean): ParsedMatchUpFormat;
84
- /**
85
- * Determine which components should be visible based on the current 'what' value
86
- */
87
- export declare function getComponentVisibility(what: string): {
88
- setTo: boolean;
89
- tiebreakAt: boolean;
90
- tiebreakTo: boolean;
91
- winBy: boolean;
92
- advantage: boolean;
93
- minutes: boolean;
94
- };
95
- /**
96
- * Calculate valid tiebreakAt options based on setTo value
97
- */
98
- export declare function getTiebreakAtOptions(setTo: number): number[];
99
- /**
100
- * Auto-adjust tiebreakAt when setTo changes
101
- * Returns the new tiebreakAt value that should be used
102
- */
103
- export declare function autoAdjustTiebreakAt(newSetTo: number, currentTiebreakAt: number): number;
104
- /**
105
- * Validate that a tiebreakAt value is valid for the given setTo
106
- */
107
- export declare function isValidTiebreakAt(setTo: number, tiebreakAt: number): boolean;
108
- /**
109
- * Check if final set option should be shown
110
- */
111
- export declare function shouldShowFinalSetOption(bestOf: number): boolean;
112
- export declare function initializeFormatFromString(matchUpFormat: string, parseFunction: (format: string) => any): FormatConfig;