courthive-components 1.5.0 → 1.7.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.
- package/dist/components/competitivenessBar/aggregateCompetitiveness.d.ts +3 -0
- package/dist/components/competitivenessBar/buildCompetitivenessBar.d.ts +6 -0
- package/dist/components/competitivenessBar/buildCompetitivenessDonut.d.ts +6 -0
- package/dist/components/competitivenessBar/index.d.ts +7 -0
- package/dist/components/competitivenessBar/types.d.ts +6 -0
- package/dist/components/composition-editor/compositionEditorStore.d.ts +5 -3
- package/dist/components/composition-editor/compositionEditorTypes.d.ts +4 -2
- package/dist/components/composition-editor/sections/colorsSection.d.ts +3 -0
- package/dist/components/court-card/buildCourtCard.d.ts +2 -0
- package/dist/components/court-card/buildSkeletonCard.d.ts +2 -0
- package/dist/components/court-card/defaultConfig.d.ts +3 -0
- package/dist/components/court-card/index.d.ts +6 -0
- package/dist/components/court-card/mapCourt.d.ts +7 -0
- package/dist/components/court-card/styles.d.ts +18 -0
- package/dist/components/court-card/types.d.ts +31 -0
- package/dist/components/draw-card/buildDrawCard.d.ts +2 -0
- package/dist/components/draw-card/buildSkeletonCard.d.ts +2 -0
- package/dist/components/draw-card/defaultConfig.d.ts +3 -0
- package/dist/components/draw-card/index.d.ts +6 -0
- package/dist/components/draw-card/mapDraw.d.ts +18 -0
- package/dist/components/draw-card/styles.d.ts +18 -0
- package/dist/components/draw-card/types.d.ts +59 -0
- package/dist/components/event-card/buildEventCard.d.ts +2 -0
- package/dist/components/event-card/buildSkeletonCard.d.ts +2 -0
- package/dist/components/event-card/defaultConfig.d.ts +6 -0
- package/dist/components/event-card/index.d.ts +8 -0
- package/dist/components/event-card/mapEvent.d.ts +14 -0
- package/dist/components/event-card/statusResolver.d.ts +14 -0
- package/dist/components/event-card/styles.d.ts +22 -0
- package/dist/components/event-card/types.d.ts +49 -0
- package/dist/components/schedule-page/index.d.ts +1 -1
- package/dist/components/schedule-page/types.d.ts +24 -0
- package/dist/components/schedule-page/ui/courtGridSlot.d.ts +9 -0
- package/dist/components/schedule-page/ui/styles.d.ts +1 -0
- package/dist/components/scheduling-profile/types.d.ts +4 -0
- package/dist/components/scheduling-profile/ui/styles.d.ts +1 -0
- package/dist/components/scheduling-profile/ui/venueBoard.d.ts +4 -0
- package/dist/components/tournament-card/buildSkeletonCard.d.ts +2 -0
- package/dist/components/tournament-card/buildTournamentCard.d.ts +2 -0
- package/dist/components/tournament-card/defaultConfig.d.ts +7 -0
- package/dist/components/tournament-card/feeFormatter.d.ts +2 -0
- package/dist/components/tournament-card/index.d.ts +9 -0
- package/dist/components/tournament-card/mapTournament.d.ts +7 -0
- package/dist/components/tournament-card/statusResolver.d.ts +9 -0
- package/dist/components/tournament-card/styles.d.ts +23 -0
- package/dist/components/tournament-card/types.d.ts +57 -0
- package/dist/components/venue-card/buildSkeletonCard.d.ts +2 -0
- package/dist/components/venue-card/buildVenueCard.d.ts +2 -0
- package/dist/components/venue-card/defaultConfig.d.ts +3 -0
- package/dist/components/venue-card/index.d.ts +6 -0
- package/dist/components/venue-card/mapVenue.d.ts +7 -0
- package/dist/components/venue-card/styles.d.ts +19 -0
- package/dist/components/venue-card/types.d.ts +44 -0
- package/dist/compositions/resolvePublishedComposition.d.ts +12 -1
- package/dist/courthive-components.css +1 -1
- package/dist/courthive-components.es.js +6732 -5129
- package/dist/courthive-components.umd.js +42 -42
- package/dist/helpers/cards/buildCardSkeleton.d.ts +28 -0
- package/dist/helpers/cards/formatAddress.d.ts +3 -0
- package/dist/helpers/cards/formatDateRange.d.ts +10 -0
- package/dist/helpers/cards/index.d.ts +12 -0
- package/dist/helpers/cards/resourceExtraction.d.ts +4 -0
- package/dist/helpers/cards/types.d.ts +24 -0
- package/dist/helpers/searchClearButton.d.ts +16 -0
- package/dist/index.d.ts +16 -1
- package/dist/styles/applyCompositionColors.d.ts +9 -0
- package/dist/styles/themes/index.d.ts +1 -0
- package/dist/styles/themes/typtiTheme.d.ts +1 -0
- package/dist/types.d.ts +25 -0
- package/package.json +9 -9
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { CompetitivenessBuckets } from './types';
|
|
2
|
+
export interface BuildCompetitivenessDonutResult {
|
|
3
|
+
element: HTMLElement;
|
|
4
|
+
update: (buckets: CompetitivenessBuckets) => void;
|
|
5
|
+
}
|
|
6
|
+
export declare function buildCompetitivenessDonut(): BuildCompetitivenessDonutResult;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { buildCompetitivenessBar } from './buildCompetitivenessBar';
|
|
2
|
+
export { buildCompetitivenessDonut } from './buildCompetitivenessDonut';
|
|
3
|
+
export { aggregateCompetitiveness, totalBuckets } from './aggregateCompetitiveness';
|
|
4
|
+
export { COMPETITIVENESS_BUCKETS } from './types';
|
|
5
|
+
export type { BuildCompetitivenessBarResult } from './buildCompetitivenessBar';
|
|
6
|
+
export type { BuildCompetitivenessDonutResult } from './buildCompetitivenessDonut';
|
|
7
|
+
export type { CompetitivenessBucket, CompetitivenessBuckets } from './types';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Competitiveness Bar — Type Definitions.
|
|
3
|
+
*/
|
|
4
|
+
export declare const COMPETITIVENESS_BUCKETS: readonly ["COMPETITIVE", "ROUTINE", "DECISIVE", "WALKOVER"];
|
|
5
|
+
export type CompetitivenessBucket = (typeof COMPETITIVENESS_BUCKETS)[number];
|
|
6
|
+
export type CompetitivenessBuckets = Record<CompetitivenessBucket, number>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Configuration } from '../../types';
|
|
1
|
+
import { CompositionColors, Configuration } from '../../types';
|
|
2
2
|
import { CompositionEditorConfig, CompositionEditorState, CompositionEditorListener, SectionId } from './compositionEditorTypes';
|
|
3
3
|
export declare class CompositionEditorStore {
|
|
4
4
|
private state;
|
|
@@ -9,14 +9,16 @@ export declare class CompositionEditorStore {
|
|
|
9
9
|
subscribe(listener: CompositionEditorListener): () => void;
|
|
10
10
|
toggleSection(sectionId: SectionId): void;
|
|
11
11
|
setTheme(theme: string): void;
|
|
12
|
+
setColorField<K extends keyof CompositionColors>(key: K, value: CompositionColors[K] | undefined): void;
|
|
13
|
+
clearColors(): void;
|
|
12
14
|
setCompositionName(name: string): void;
|
|
13
15
|
setConfigField<K extends keyof Configuration>(key: K, value: Configuration[K]): void;
|
|
14
16
|
/** Update a nested object field (e.g., gameScore, placeHolders, scaleAttributes) */
|
|
15
17
|
setConfigNestedField<K extends keyof Configuration>(key: K, nestedKey: string, value: unknown): void;
|
|
16
18
|
/** Replace the entire configuration (e.g., loading a preset) */
|
|
17
19
|
setConfiguration(configuration: Configuration): void;
|
|
18
|
-
/** Load a full composition (theme + config + name) */
|
|
19
|
-
loadComposition(name: string, theme: string, configuration: Configuration): void;
|
|
20
|
+
/** Load a full composition (theme + config + name + colors) */
|
|
21
|
+
loadComposition(name: string, theme: string, configuration: Configuration, colors?: CompositionColors): void;
|
|
20
22
|
resetToInitial(): void;
|
|
21
23
|
private setState;
|
|
22
24
|
private emit;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { Composition, Configuration } from '../../types';
|
|
1
|
+
import { Composition, CompositionColors, Configuration } from '../../types';
|
|
2
2
|
/** JSON-serializable snapshot of a composition (no functions/DOM refs) */
|
|
3
3
|
export interface SavedComposition {
|
|
4
4
|
compositionName: string;
|
|
5
5
|
theme: string;
|
|
6
6
|
configuration: Configuration;
|
|
7
|
+
colors?: CompositionColors;
|
|
7
8
|
version?: number;
|
|
8
9
|
}
|
|
9
10
|
export interface CompositionEditorConfig {
|
|
@@ -20,11 +21,12 @@ export interface CompositionEditorConfig {
|
|
|
20
21
|
/** Restrict available theme choices */
|
|
21
22
|
availableThemes?: string[];
|
|
22
23
|
}
|
|
23
|
-
export type SectionId = 'theme' | 'display' | 'score' | 'participant' | 'placeholder' | 'scale' | 'layout';
|
|
24
|
+
export type SectionId = 'theme' | 'colors' | 'display' | 'score' | 'participant' | 'placeholder' | 'scale' | 'layout';
|
|
24
25
|
export interface CompositionEditorState {
|
|
25
26
|
compositionName: string;
|
|
26
27
|
theme: string;
|
|
27
28
|
configuration: Configuration;
|
|
29
|
+
colors?: CompositionColors;
|
|
28
30
|
expandedSections: Set<SectionId>;
|
|
29
31
|
isDirty: boolean;
|
|
30
32
|
readOnly: boolean;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { buildCourtCard } from './buildCourtCard';
|
|
2
|
+
export { buildCourtSkeletonCard } from './buildSkeletonCard';
|
|
3
|
+
export { mapCourtToCardData } from './mapCourt';
|
|
4
|
+
export { DEFAULT_COURT_CARD_CONFIG, mergeCourtCardConfig } from './defaultConfig';
|
|
5
|
+
export type { MapCourtOptions } from './mapCourt';
|
|
6
|
+
export type { CourtCardCallbacks, CourtCardConfig, CourtCardCornerField, CourtCardData, CourtCardField } from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { CourtSport } from '../courts/courtSvgUtil';
|
|
2
|
+
import { CourtCardData } from './types';
|
|
3
|
+
export interface MapCourtOptions {
|
|
4
|
+
/** Parent tournament's resolved sport — used for the court-SVG fallback. */
|
|
5
|
+
sport?: CourtSport;
|
|
6
|
+
}
|
|
7
|
+
export declare function mapCourtToCardData(court: any, options?: MapCourtOptions): CourtCardData;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const ccCardStyle: () => string;
|
|
2
|
+
export declare const ccCardClickableStyle: () => string;
|
|
3
|
+
export declare const ccImageStyle: () => string;
|
|
4
|
+
export declare const ccImageSvgStyle: () => string;
|
|
5
|
+
export declare const ccImagePlaceholderStyle: () => string;
|
|
6
|
+
export declare const ccCornerBadgesStyle: () => string;
|
|
7
|
+
export declare const ccIndoorBadgeStyle: () => string;
|
|
8
|
+
export declare const ccFloodlitBadgeStyle: () => string;
|
|
9
|
+
export declare const ccBodyStyle: () => string;
|
|
10
|
+
export declare const ccTitleStyle: () => string;
|
|
11
|
+
export declare const ccSurfaceStyle: () => string;
|
|
12
|
+
export declare const ccAvailabilityStyle: () => string;
|
|
13
|
+
export declare const ccAbbrStyle: () => string;
|
|
14
|
+
export declare const ccFooterStyle: () => string;
|
|
15
|
+
export declare const ccAmenityRowStyle: () => string;
|
|
16
|
+
export declare const ccSkeletonStyle: () => string;
|
|
17
|
+
export declare const ccSkeletonLineStyle: () => string;
|
|
18
|
+
export declare const ccSkeletonBlockStyle: () => string;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { CourtSport } from '../courts/courtSvgUtil';
|
|
2
|
+
export interface CourtCardData {
|
|
3
|
+
courtId: string;
|
|
4
|
+
courtName: string;
|
|
5
|
+
courtAbbreviation?: string;
|
|
6
|
+
/** Pre-formatted "Outdoor • Hard" string. */
|
|
7
|
+
surfaceLabel?: string;
|
|
8
|
+
/** Indoor / outdoor / undefined (unknown). */
|
|
9
|
+
indoorOutdoor?: 'INDOOR' | 'OUTDOOR';
|
|
10
|
+
/** Surface category (HARD/CLAY/GRASS/CARPET/...) — raw upper-case. */
|
|
11
|
+
surfaceCategory?: string;
|
|
12
|
+
/** True when the court has floodlights — drives the lit-pip badge. */
|
|
13
|
+
floodlit?: boolean;
|
|
14
|
+
/** Available hours/minutes today (optional summary). */
|
|
15
|
+
availabilitySummary?: string;
|
|
16
|
+
/** Sport identifier for the court-SVG image fallback. */
|
|
17
|
+
courtSvgSport?: CourtSport;
|
|
18
|
+
/** Free-form notes (rendered as title tooltip on the court name). */
|
|
19
|
+
notes?: string;
|
|
20
|
+
}
|
|
21
|
+
export type CourtCardField = 'title' | 'surface' | 'amenityRow' | 'availability' | 'abbreviation';
|
|
22
|
+
export type CourtCardCornerField = 'indoorOutdoor' | 'floodlit';
|
|
23
|
+
export interface CourtCardConfig {
|
|
24
|
+
showImage?: boolean;
|
|
25
|
+
cornerBadges: CourtCardCornerField[];
|
|
26
|
+
body: CourtCardField[];
|
|
27
|
+
footer: CourtCardField[];
|
|
28
|
+
}
|
|
29
|
+
export interface CourtCardCallbacks {
|
|
30
|
+
onClick?: (data: CourtCardData) => void;
|
|
31
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { buildDrawCard } from './buildDrawCard';
|
|
2
|
+
export { buildDrawSkeletonCard } from './buildSkeletonCard';
|
|
3
|
+
export { mapDrawDefinitionToCardData } from './mapDraw';
|
|
4
|
+
export { DEFAULT_DRAW_CARD_CONFIG, mergeDrawCardConfig } from './defaultConfig';
|
|
5
|
+
export type { MapDrawOptions } from './mapDraw';
|
|
6
|
+
export type { DrawCardCallbacks, DrawCardConfig, DrawCardCornerField, DrawCardData, DrawCardField, DrawMatchUpCounts, DrawStatusKind, DrawStatusPill } from './types';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { DrawCardData, DrawMatchUpCounts, DrawStatusPill } from './types';
|
|
2
|
+
export interface MapDrawOptions {
|
|
3
|
+
lightMode?: boolean;
|
|
4
|
+
matchUpStats?: DrawMatchUpCounts;
|
|
5
|
+
/** Pre-computed averages (consumer might fetch via factory.getRatingsStats). */
|
|
6
|
+
utrAvg?: number;
|
|
7
|
+
wtnAvg?: number;
|
|
8
|
+
/** Pre-resolved publish flags from publishingGovernor. */
|
|
9
|
+
published?: boolean;
|
|
10
|
+
embargoActive?: boolean;
|
|
11
|
+
/** Pre-resolved entry count (consumer often has this via getAssignedParticipantIds). */
|
|
12
|
+
entryCount?: number;
|
|
13
|
+
/** Back-reference for click handlers. */
|
|
14
|
+
eventId?: string;
|
|
15
|
+
/** Override the resolved status. */
|
|
16
|
+
statusOverride?: DrawStatusPill | null;
|
|
17
|
+
}
|
|
18
|
+
export declare function mapDrawDefinitionToCardData(drawDefinition: any, options?: MapDrawOptions): DrawCardData;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export declare const dcCardStyle: () => string;
|
|
2
|
+
export declare const dcCardClickableStyle: () => string;
|
|
3
|
+
export declare const dcCornerBadgesStyle: () => string;
|
|
4
|
+
export declare const dcStatusPillStyle: () => string;
|
|
5
|
+
export declare const dcSecondaryBadgeStyle: () => string;
|
|
6
|
+
export declare const dcBodyStyle: () => string;
|
|
7
|
+
export declare const dcVizZoneStyle: () => string;
|
|
8
|
+
export declare const dcTitleRowStyle: () => string;
|
|
9
|
+
export declare const dcTitleStyle: () => string;
|
|
10
|
+
export declare const dcDrawTypeLabelStyle: () => string;
|
|
11
|
+
export declare const dcMetaLineStyle: () => string;
|
|
12
|
+
export declare const dcFooterStyle: () => string;
|
|
13
|
+
export declare const dcChipStyle: () => string;
|
|
14
|
+
export declare const dcProgressStyle: () => string;
|
|
15
|
+
export declare const dcProgressBarStyle: () => string;
|
|
16
|
+
export declare const dcProgressFillStyle: () => string;
|
|
17
|
+
export declare const dcSkeletonStyle: () => string;
|
|
18
|
+
export declare const dcSkeletonLineStyle: () => string;
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Draw Card — Type Definitions
|
|
3
|
+
*
|
|
4
|
+
* Flat data + JSON-serializable config consumed by buildDrawCard.
|
|
5
|
+
*/
|
|
6
|
+
export type DrawStatusKind = 'ungenerated' | 'ready' | 'in-progress' | 'completed' | 'cancelled';
|
|
7
|
+
export interface DrawStatusPill {
|
|
8
|
+
kind: DrawStatusKind;
|
|
9
|
+
label: string;
|
|
10
|
+
}
|
|
11
|
+
export interface DrawMatchUpCounts {
|
|
12
|
+
total: number;
|
|
13
|
+
completed: number;
|
|
14
|
+
inProgress: number;
|
|
15
|
+
scheduled: number;
|
|
16
|
+
}
|
|
17
|
+
export interface DrawCardData {
|
|
18
|
+
drawId: string;
|
|
19
|
+
drawName: string;
|
|
20
|
+
/** TODS drawType code, e.g. 'SINGLE_ELIMINATION' / 'ROUND_ROBIN'. */
|
|
21
|
+
drawType?: string;
|
|
22
|
+
/** Human label derived from drawType (e.g. "Single Elimination"). */
|
|
23
|
+
drawTypeLabel?: string;
|
|
24
|
+
drawSize?: number;
|
|
25
|
+
entryCount?: number;
|
|
26
|
+
/** matchUpFormat code surfaced as a chip in the footer. */
|
|
27
|
+
matchUpFormat?: string;
|
|
28
|
+
flightNumber?: number;
|
|
29
|
+
/** undefined when the underlying flight hasn't been generated yet. */
|
|
30
|
+
matchUpCounts?: DrawMatchUpCounts;
|
|
31
|
+
/** True once `structures` have been created on the drawDefinition. */
|
|
32
|
+
generated: boolean;
|
|
33
|
+
published?: boolean;
|
|
34
|
+
embargoActive?: boolean;
|
|
35
|
+
/** Average ratings across the draw, when scaleValues are available. */
|
|
36
|
+
utrAvg?: number;
|
|
37
|
+
wtnAvg?: number;
|
|
38
|
+
status?: DrawStatusPill | null;
|
|
39
|
+
/** Back-reference for callers that need it on click; not rendered. */
|
|
40
|
+
eventId?: string;
|
|
41
|
+
/** Optional visualization element rendered above the body (e.g. histogram,
|
|
42
|
+
* competitiveness bar, sunburst). The card is intentionally agnostic about
|
|
43
|
+
* which viz lives here — the consumer instantiates it. Pair with
|
|
44
|
+
* `DrawCardConfig.showVisualization = true`. */
|
|
45
|
+
visualization?: HTMLElement | null;
|
|
46
|
+
}
|
|
47
|
+
export type DrawCardField = 'title' | 'drawTypeLabel' | 'drawSize' | 'matchUpFormat' | 'entries' | 'matchUpProgress' | 'ratings' | 'flightNumber';
|
|
48
|
+
export type DrawCardCornerField = 'status' | 'publishedBadge' | 'embargoBadge';
|
|
49
|
+
export interface DrawCardConfig {
|
|
50
|
+
cornerBadges: DrawCardCornerField[];
|
|
51
|
+
body: DrawCardField[];
|
|
52
|
+
footer: DrawCardField[];
|
|
53
|
+
/** When true and `DrawCardData.visualization` is set, the visualization
|
|
54
|
+
* element renders in a dedicated zone above the body. Default `false`. */
|
|
55
|
+
showVisualization?: boolean;
|
|
56
|
+
}
|
|
57
|
+
export interface DrawCardCallbacks {
|
|
58
|
+
onClick?: (data: DrawCardData) => void;
|
|
59
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EventCardConfig } from './types';
|
|
2
|
+
export declare const DEFAULT_EVENT_CARD_CONFIG: EventCardConfig;
|
|
3
|
+
/** Threshold matching TMX's existing `EVENT_COUNT_THRESHOLD` in createEventsTable.ts.
|
|
4
|
+
* Consumers reading many events should set `lightMode: true` when over this count. */
|
|
5
|
+
export declare const EVENT_CARD_LIGHT_MODE_THRESHOLD = 15;
|
|
6
|
+
export declare function mergeEventCardConfig(override?: Partial<EventCardConfig>): EventCardConfig;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { buildEventCard } from './buildEventCard';
|
|
2
|
+
export { buildEventSkeletonCard } from './buildSkeletonCard';
|
|
3
|
+
export { mapEventToCardData } from './mapEvent';
|
|
4
|
+
export { resolveEventStatus } from './statusResolver';
|
|
5
|
+
export { DEFAULT_EVENT_CARD_CONFIG, EVENT_CARD_LIGHT_MODE_THRESHOLD, mergeEventCardConfig } from './defaultConfig';
|
|
6
|
+
export type { MapEventOptions } from './mapEvent';
|
|
7
|
+
export type { EventStatusResolverInput } from './statusResolver';
|
|
8
|
+
export type { EventCardCallbacks, EventCardConfig, EventCardCornerField, EventCardData, EventCardField, EventGenderKind, EventMatchUpCounts, EventStatusKind, EventStatusPill, EventTypeKind } from './types';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventCardData, EventMatchUpCounts, EventStatusPill } from './types';
|
|
2
|
+
import { CourtSport } from '../courts/courtSvgUtil';
|
|
3
|
+
export interface MapEventOptions {
|
|
4
|
+
/** Skip matchUp walk for large event counts (TMX uses threshold 15). */
|
|
5
|
+
lightMode?: boolean;
|
|
6
|
+
/** Override match counts (caller fetched via factory engine). */
|
|
7
|
+
matchUpStats?: EventMatchUpCounts;
|
|
8
|
+
/** Parent tournament's resolved sport — used for court-SVG fallback. */
|
|
9
|
+
sport?: CourtSport;
|
|
10
|
+
now?: Date;
|
|
11
|
+
/** Override the resolved status. */
|
|
12
|
+
statusOverride?: EventStatusPill | null;
|
|
13
|
+
}
|
|
14
|
+
export declare function mapEventToCardData(event: any, options?: MapEventOptions): EventCardData;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { EventMatchUpCounts, EventStatusPill } from './types';
|
|
2
|
+
export interface EventStatusResolverInput {
|
|
3
|
+
allDrawsCancelled?: boolean;
|
|
4
|
+
drawCount?: number;
|
|
5
|
+
entryCount?: number;
|
|
6
|
+
startDate?: string;
|
|
7
|
+
endDate?: string;
|
|
8
|
+
matchUpCounts?: EventMatchUpCounts;
|
|
9
|
+
/** True when at least one drawDefinition carries the DRAFT_STATE extension. */
|
|
10
|
+
hasDraftState?: boolean;
|
|
11
|
+
/** True when at least one drawDefinition was generated with `automated.seedsOnly`. */
|
|
12
|
+
hasSeedsOnlyDraw?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export declare function resolveEventStatus(input: EventStatusResolverInput, now?: Date): EventStatusPill | null;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare const ecCardStyle: () => string;
|
|
2
|
+
export declare const ecCardClickableStyle: () => string;
|
|
3
|
+
export declare const ecImageStyle: () => string;
|
|
4
|
+
export declare const ecImageImgStyle: () => string;
|
|
5
|
+
export declare const ecImageSvgStyle: () => string;
|
|
6
|
+
export declare const ecImagePlaceholderStyle: () => string;
|
|
7
|
+
export declare const ecCornerBadgesStyle: () => string;
|
|
8
|
+
export declare const ecStatusPillStyle: () => string;
|
|
9
|
+
export declare const ecEventTypeBadgeStyle: () => string;
|
|
10
|
+
export declare const ecGenderBadgeStyle: () => string;
|
|
11
|
+
export declare const ecBodyStyle: () => string;
|
|
12
|
+
export declare const ecTitleStyle: () => string;
|
|
13
|
+
export declare const ecCategoryStyle: () => string;
|
|
14
|
+
export declare const ecDrawSummaryStyle: () => string;
|
|
15
|
+
export declare const ecDateRangeStyle: () => string;
|
|
16
|
+
export declare const ecFooterStyle: () => string;
|
|
17
|
+
export declare const ecPlayerCountStyle: () => string;
|
|
18
|
+
export declare const ecMatchUpProgressStyle: () => string;
|
|
19
|
+
export declare const ecUpdatedAtStyle: () => string;
|
|
20
|
+
export declare const ecSkeletonStyle: () => string;
|
|
21
|
+
export declare const ecSkeletonLineStyle: () => string;
|
|
22
|
+
export declare const ecSkeletonBlockStyle: () => string;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { CourtSport } from '../courts/courtSvgUtil';
|
|
2
|
+
export type EventStatusKind = 'cancelled' | 'completed' | 'live' | 'drawing' | 'entries-open' | 'upcoming';
|
|
3
|
+
export interface EventStatusPill {
|
|
4
|
+
kind: EventStatusKind;
|
|
5
|
+
label: string;
|
|
6
|
+
}
|
|
7
|
+
export interface EventMatchUpCounts {
|
|
8
|
+
total: number;
|
|
9
|
+
completed: number;
|
|
10
|
+
scheduled: number;
|
|
11
|
+
inProgress: number;
|
|
12
|
+
}
|
|
13
|
+
export type EventTypeKind = 'SINGLES' | 'DOUBLES' | 'TEAM' | 'HYBRID';
|
|
14
|
+
export type EventGenderKind = 'MALE' | 'FEMALE' | 'MIXED';
|
|
15
|
+
export interface EventCardData {
|
|
16
|
+
eventId: string;
|
|
17
|
+
eventName: string;
|
|
18
|
+
eventAbbreviation?: string;
|
|
19
|
+
/** Human label derived from event.category (name / age range / code). */
|
|
20
|
+
categoryLabel?: string;
|
|
21
|
+
/** Normalized event type for badge styling. */
|
|
22
|
+
eventType?: EventTypeKind;
|
|
23
|
+
/** Normalized gender for badge styling. */
|
|
24
|
+
gender?: EventGenderKind;
|
|
25
|
+
drawCount?: number;
|
|
26
|
+
/** Short summary like "32 SE" or "16 RR + Playoff". */
|
|
27
|
+
drawSummary?: string;
|
|
28
|
+
entryCount?: number;
|
|
29
|
+
/** undefined in lightMode (caller skipped the matchUp walk). */
|
|
30
|
+
matchUpCounts?: EventMatchUpCounts;
|
|
31
|
+
startDate?: string;
|
|
32
|
+
endDate?: string;
|
|
33
|
+
dateRangeFormatted?: string;
|
|
34
|
+
status?: EventStatusPill | null;
|
|
35
|
+
eventImageURL?: string;
|
|
36
|
+
courtSvgSport?: CourtSport;
|
|
37
|
+
updatedAt?: string;
|
|
38
|
+
}
|
|
39
|
+
export type EventCardField = 'title' | 'categoryLabel' | 'drawSummary' | 'dateRange' | 'playerCount' | 'matchUpProgress' | 'updatedAt';
|
|
40
|
+
export type EventCardCornerField = 'status' | 'eventTypeBadge' | 'genderBadge';
|
|
41
|
+
export interface EventCardConfig {
|
|
42
|
+
showImage?: boolean;
|
|
43
|
+
cornerBadges: EventCardCornerField[];
|
|
44
|
+
body: EventCardField[];
|
|
45
|
+
footer: EventCardField[];
|
|
46
|
+
}
|
|
47
|
+
export interface EventCardCallbacks {
|
|
48
|
+
onClick?: (data: EventCardData) => void;
|
|
49
|
+
}
|
|
@@ -24,5 +24,5 @@ export type { ActiveStripPanel, ActiveStripPanelCallbacks, ActiveStripPanelData,
|
|
|
24
24
|
export { buildScheduleGridCell, mapMatchUpToCellData, DEFAULT_SCHEDULE_CELL_CONFIG } from './ui/scheduleGridCell';
|
|
25
25
|
export { activateScheduleCellTypeAhead } from './ui/scheduleCellTypeAhead';
|
|
26
26
|
export type { ScheduleCellTypeAheadOptions } from './ui/scheduleCellTypeAhead';
|
|
27
|
-
export type { CatalogMatchUpItem, CatalogFilters, MatchUpSide, ScheduleDate, ScheduleIssue, ScheduleIssueSeverity, ScheduleIssueIndex, ScheduleIssueCounts, MatchUpCatalogGroupBy, ScheduledBehavior, SchedulingMode, PendingScheduleAction, CatalogMatchUpDragPayload, GridMatchUpDragPayload, SchedulePageDragPayload, SchedulePageConfig, SchedulePageState, SchedulePageChangeListener, UIPanel, ScheduleCellConfig, ScheduleCellField, ParticipantDisplayConfig, ScheduleCellData, ScheduleCellSide } from './types';
|
|
27
|
+
export type { CatalogMatchUpItem, CatalogFilters, MatchUpSide, ScheduleDate, ScheduleIssue, ScheduleIssueSeverity, ScheduleIssueIndex, ScheduleIssueCounts, MatchUpCatalogGroupBy, ScheduledBehavior, SchedulingMode, PendingScheduleAction, CatalogMatchUpDragPayload, GridMatchUpDragPayload, SchedulePageDragPayload, SchedulePageConfig, SchedulePageCatalogState, SchedulePageState, SchedulePageChangeListener, UIPanel, ScheduleCellConfig, ScheduleCellField, ParticipantDisplayConfig, ScheduleCellData, ScheduleCellSide } from './types';
|
|
28
28
|
export declare function createSchedulePage(config: SchedulePageConfig, container: HTMLElement): SchedulePageControl;
|
|
@@ -82,11 +82,26 @@ export interface GridMatchUpDragPayload {
|
|
|
82
82
|
sourceCourt?: string;
|
|
83
83
|
}
|
|
84
84
|
export type SchedulePageDragPayload = CatalogMatchUpDragPayload | GridMatchUpDragPayload;
|
|
85
|
+
/**
|
|
86
|
+
* Persisted catalog filter state. The consumer can seed the store from a
|
|
87
|
+
* previously captured snapshot (e.g. when re-entering the schedule page
|
|
88
|
+
* within the same session) and subscribe to the store to write it back.
|
|
89
|
+
*/
|
|
90
|
+
export interface SchedulePageCatalogState {
|
|
91
|
+
catalogSearchQuery?: string;
|
|
92
|
+
catalogGroupBy?: MatchUpCatalogGroupBy;
|
|
93
|
+
catalogFilters?: CatalogFilters;
|
|
94
|
+
showCompleted?: boolean;
|
|
95
|
+
showScheduled?: boolean;
|
|
96
|
+
}
|
|
85
97
|
export interface SchedulePageConfig {
|
|
86
98
|
matchUpCatalog: CatalogMatchUpItem[];
|
|
87
99
|
scheduleDates: ScheduleDate[];
|
|
88
100
|
issues?: ScheduleIssue[];
|
|
89
101
|
courtGridElement?: HTMLElement;
|
|
102
|
+
/** Seed the store's catalog filter fields. Any field omitted falls back
|
|
103
|
+
* to the built-in default. */
|
|
104
|
+
initialCatalogState?: SchedulePageCatalogState;
|
|
90
105
|
/** Max height for the court grid viewport (e.g. '500px', '60vh'). Defaults to none (fills available space). */
|
|
91
106
|
gridMaxHeight?: string;
|
|
92
107
|
/** When true, the left column (date strip + issues panel) is not rendered at all. */
|
|
@@ -100,6 +115,15 @@ export interface SchedulePageConfig {
|
|
|
100
115
|
/** Consumer-owned buttons rendered right-aligned in the court grid header.
|
|
101
116
|
* Consumer keeps live refs and mutates state (visibility, disabled, label) directly. */
|
|
102
117
|
headerActions?: HTMLElement | HTMLElement[];
|
|
118
|
+
/** Consumer-owned buttons rendered immediately before the "Court Grid" title.
|
|
119
|
+
* Use this slot for controls that act on content to the LEFT of the panel
|
|
120
|
+
* (e.g. a catalog show/hide toggle when the catalog sits on the left). */
|
|
121
|
+
titleLeadingActions?: HTMLElement | HTMLElement[];
|
|
122
|
+
/** Optional element rendered in place of the default "Court Grid" title.
|
|
123
|
+
* When set, replaces both the default text and the `.spl-center-title`
|
|
124
|
+
* wrapper — consumer owns layout (e.g. inject a search input here so
|
|
125
|
+
* the header reads as a single clean field). */
|
|
126
|
+
titleSlot?: HTMLElement;
|
|
103
127
|
onDateSelected?: (date: string) => void;
|
|
104
128
|
onMatchUpDrop?: (payload: SchedulePageDragPayload, event: DragEvent) => void;
|
|
105
129
|
onMatchUpRemove?: (matchUpId: string) => void;
|
|
@@ -7,5 +7,14 @@ export interface CourtGridSlotOptions {
|
|
|
7
7
|
/** Consumer-owned buttons rendered right-aligned in the header.
|
|
8
8
|
* Consumer keeps live refs and mutates state (visibility, disabled, label) directly. */
|
|
9
9
|
headerActions?: HTMLElement | HTMLElement[];
|
|
10
|
+
/** Consumer-owned buttons rendered immediately before the "Court Grid" title.
|
|
11
|
+
* Use this slot for controls that act on content to the LEFT of the panel
|
|
12
|
+
* (e.g. a catalog show/hide toggle when the catalog sits on the left). */
|
|
13
|
+
titleLeadingActions?: HTMLElement | HTMLElement[];
|
|
14
|
+
/** Optional element rendered in place of the default "Court Grid" title.
|
|
15
|
+
* When set, replaces both the default text and the `.spl-center-title`
|
|
16
|
+
* wrapper — consumer is responsible for its own styling and any layout
|
|
17
|
+
* growth it needs. */
|
|
18
|
+
titleSlot?: HTMLElement;
|
|
10
19
|
}
|
|
11
20
|
export declare function buildCourtGridSlot(courtGridElement: HTMLElement | undefined, callbacks: CourtGridSlotCallbacks, options?: CourtGridSlotOptions): UIPanel<SchedulePageState>;
|
|
@@ -5,6 +5,7 @@ export declare const splCenterStyle: () => string;
|
|
|
5
5
|
export declare const splCenterHeaderStyle: () => string;
|
|
6
6
|
export declare const splCenterTitleStyle: () => string;
|
|
7
7
|
export declare const splCenterActionsStyle: () => string;
|
|
8
|
+
export declare const splCenterLeadingStyle: () => string;
|
|
8
9
|
export declare const splGridSlotStyle: () => string;
|
|
9
10
|
export declare const splRightStyle: () => string;
|
|
10
11
|
export declare const splMatchUpCardStyle: () => string;
|
|
@@ -186,6 +186,10 @@ export interface SchedulingProfileConfig {
|
|
|
186
186
|
/** Consumer-owned buttons rendered right-aligned in the Day Plan header.
|
|
187
187
|
* Consumer keeps live refs and mutates state (visibility, disabled, label) directly. */
|
|
188
188
|
headerActions?: HTMLElement | HTMLElement[];
|
|
189
|
+
/** Consumer-owned buttons rendered immediately before the "Day Plan" title.
|
|
190
|
+
* Use this slot for controls that act on content to the LEFT of the panel
|
|
191
|
+
* (e.g. a catalog show/hide toggle when the catalog sits on the left). */
|
|
192
|
+
titleLeadingActions?: HTMLElement | HTMLElement[];
|
|
189
193
|
onProfileChanged?: (profile: SchedulingProfile) => void;
|
|
190
194
|
onFixAction?: (action: FixAction) => void;
|
|
191
195
|
}
|
|
@@ -5,6 +5,7 @@ export declare const spPanelHeaderStyle: () => string;
|
|
|
5
5
|
export declare const spPanelTitleStyle: () => string;
|
|
6
6
|
export declare const spPanelMetaStyle: () => string;
|
|
7
7
|
export declare const spPanelActionsStyle: () => string;
|
|
8
|
+
export declare const spPanelLeadingStyle: () => string;
|
|
8
9
|
export declare const spPanelBodyStyle: () => string;
|
|
9
10
|
export declare const spDateStripStyle: () => string;
|
|
10
11
|
export declare const spDateChipStyle: () => string;
|
|
@@ -8,5 +8,9 @@ export interface VenueBoardOptions {
|
|
|
8
8
|
/** Consumer-owned buttons rendered right-aligned in the Day Plan header.
|
|
9
9
|
* Consumer keeps live refs and mutates state (visibility, disabled, label) directly. */
|
|
10
10
|
headerActions?: HTMLElement | HTMLElement[];
|
|
11
|
+
/** Consumer-owned buttons rendered immediately before the "Day Plan" title.
|
|
12
|
+
* Use this slot for controls that act on content to the LEFT of the panel
|
|
13
|
+
* (e.g. a catalog show/hide toggle when the catalog sits on the left). */
|
|
14
|
+
titleLeadingActions?: HTMLElement | HTMLElement[];
|
|
11
15
|
}
|
|
12
16
|
export declare function buildVenueBoard(callbacks: VenueBoardCallbacks, options?: VenueBoardOptions): UIPanel<ProfileStoreState>;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TournamentCardConfig } from './types';
|
|
2
|
+
export declare const DEFAULT_TOURNAMENT_CARD_CONFIG: TournamentCardConfig;
|
|
3
|
+
/**
|
|
4
|
+
* Merge a partial provider config over the default.
|
|
5
|
+
* Arrays are replaced wholesale when present (no element-level merge).
|
|
6
|
+
*/
|
|
7
|
+
export declare function mergeTournamentCardConfig(override?: Partial<TournamentCardConfig>): TournamentCardConfig;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export { buildTournamentCard } from './buildTournamentCard';
|
|
2
|
+
export { buildSkeletonCard } from './buildSkeletonCard';
|
|
3
|
+
export { mapTournamentToCardData } from './mapTournament';
|
|
4
|
+
export { resolveTournamentStatus } from './statusResolver';
|
|
5
|
+
export { formatFeeRange } from './feeFormatter';
|
|
6
|
+
export { DEFAULT_TOURNAMENT_CARD_CONFIG, mergeTournamentCardConfig } from './defaultConfig';
|
|
7
|
+
export type { MapTournamentOptions } from './mapTournament';
|
|
8
|
+
export type { StatusResolverInput } from './statusResolver';
|
|
9
|
+
export type { TournamentCardCallbacks, TournamentCardConfig, TournamentCardCornerField, TournamentCardData, TournamentCardField, TournamentEntryFee, TournamentStatusKind, TournamentStatusPill } from './types';
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TournamentCardData, TournamentStatusPill } from './types';
|
|
2
|
+
export interface MapTournamentOptions {
|
|
3
|
+
now?: Date;
|
|
4
|
+
/** Override the resolved status (e.g. surface a `Local Only` pill instead). */
|
|
5
|
+
statusOverride?: TournamentStatusPill | null;
|
|
6
|
+
}
|
|
7
|
+
export declare function mapTournamentToCardData(tournament: any, options?: MapTournamentOptions): TournamentCardData;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { TournamentStatusPill } from './types';
|
|
2
|
+
export interface StatusResolverInput {
|
|
3
|
+
tournamentStatus?: string;
|
|
4
|
+
startDate?: string;
|
|
5
|
+
endDate?: string;
|
|
6
|
+
entriesOpen?: string;
|
|
7
|
+
entriesClose?: string;
|
|
8
|
+
}
|
|
9
|
+
export declare function resolveTournamentStatus(input: StatusResolverInput, now?: Date): TournamentStatusPill | null;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export declare const tcCardStyle: () => string;
|
|
2
|
+
export declare const tcCardClickableStyle: () => string;
|
|
3
|
+
export declare const tcCardOfflineStyle: () => string;
|
|
4
|
+
export declare const tcImageStyle: () => string;
|
|
5
|
+
export declare const tcImageImgStyle: () => string;
|
|
6
|
+
export declare const tcImageSvgStyle: () => string;
|
|
7
|
+
export declare const tcImagePlaceholderStyle: () => string;
|
|
8
|
+
export declare const tcCornerBadgesStyle: () => string;
|
|
9
|
+
export declare const tcStatusPillStyle: () => string;
|
|
10
|
+
export declare const tcOfflineBadgeStyle: () => string;
|
|
11
|
+
export declare const tcBodyStyle: () => string;
|
|
12
|
+
export declare const tcTitleStyle: () => string;
|
|
13
|
+
export declare const tcLocationStyle: () => string;
|
|
14
|
+
export declare const tcDateRangeStyle: () => string;
|
|
15
|
+
export declare const tcOrganizerStyle: () => string;
|
|
16
|
+
export declare const tcUpdatedAtStyle: () => string;
|
|
17
|
+
export declare const tcFooterStyle: () => string;
|
|
18
|
+
export declare const tcFeeBadgeStyle: () => string;
|
|
19
|
+
export declare const tcPlayerCountStyle: () => string;
|
|
20
|
+
export declare const tcEventCountStyle: () => string;
|
|
21
|
+
export declare const tcSkeletonStyle: () => string;
|
|
22
|
+
export declare const tcSkeletonLineStyle: () => string;
|
|
23
|
+
export declare const tcSkeletonBlockStyle: () => string;
|