@ethlete/cdk 4.47.0 → 4.48.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/CHANGELOG.md +6 -0
- package/esm2022/lib/components/bracket/components/new-bracket/bracket-new.mjs +68 -69
- package/esm2022/lib/components/bracket/components/new-bracket/draw-man.mjs +75 -32
- package/esm2022/lib/components/bracket/components/new-bracket/grid-placements.mjs +8 -3
- package/esm2022/lib/components/bracket/components/new-bracket/journey-highlight.mjs +18 -0
- package/esm2022/lib/components/bracket/components/new-bracket/new-bracket.component.mjs +47 -9
- package/fesm2022/ethlete-cdk.mjs +210 -109
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/lib/components/bracket/components/new-bracket/bracket-new.d.ts +12 -18
- package/lib/components/bracket/components/new-bracket/draw-man.d.ts +5 -3
- package/lib/components/bracket/components/new-bracket/grid-placements.d.ts +4 -0
- package/lib/components/bracket/components/new-bracket/journey-highlight.d.ts +2 -0
- package/lib/components/bracket/components/new-bracket/new-bracket.component.d.ts +7 -2
- package/package.json +1 -1
|
@@ -14,6 +14,9 @@ export type BracketMatchPosition = number & {
|
|
|
14
14
|
export type MatchParticipantId = string & {
|
|
15
15
|
__brand: 'MatchParticipantId';
|
|
16
16
|
};
|
|
17
|
+
export type MatchParticipantShortId = string & {
|
|
18
|
+
__brand: 'MatchParticipantShortId';
|
|
19
|
+
};
|
|
17
20
|
export type BracketRoundSwissGroupId = string & {
|
|
18
21
|
__brand: 'BracketRoundSwissGroupId';
|
|
19
22
|
};
|
|
@@ -72,6 +75,7 @@ export type BracketRound<TRoundData, TMatchData> = {
|
|
|
72
75
|
matchCount: number;
|
|
73
76
|
matches: BracketMatchMap<TRoundData, TMatchData>;
|
|
74
77
|
mirrorRoundType: BracketRoundMirrorType | null;
|
|
78
|
+
isFirstRound: boolean;
|
|
75
79
|
};
|
|
76
80
|
export type BracketMatchStatus = 'completed' | 'pending';
|
|
77
81
|
export type BracketMatch<TRoundData, TMatchData> = {
|
|
@@ -80,9 +84,10 @@ export type BracketMatch<TRoundData, TMatchData> = {
|
|
|
80
84
|
id: BracketMatchId;
|
|
81
85
|
round: BracketRound<TRoundData, TMatchData>;
|
|
82
86
|
position: BracketMatchPosition;
|
|
83
|
-
home:
|
|
84
|
-
away:
|
|
85
|
-
|
|
87
|
+
home: BracketParticipant<TRoundData, TMatchData> | null;
|
|
88
|
+
away: BracketParticipant<TRoundData, TMatchData> | null;
|
|
89
|
+
winnerSide: OpponentSide | null;
|
|
90
|
+
winner: BracketParticipant<TRoundData, TMatchData> | null;
|
|
86
91
|
status: BracketMatchStatus;
|
|
87
92
|
};
|
|
88
93
|
export type BracketMatchSource<TMatchData> = {
|
|
@@ -144,17 +149,6 @@ export type BracketMatchRelationTwoToOne<TRoundData, TMatchData> = {
|
|
|
144
149
|
nextMatch: BracketMatch<TRoundData, TMatchData>;
|
|
145
150
|
nextRound: BracketRound<TRoundData, TMatchData>;
|
|
146
151
|
};
|
|
147
|
-
export type BracketMatchRelationOneToTwo<TRoundData, TMatchData> = {
|
|
148
|
-
type: 'one-to-two';
|
|
149
|
-
currentMatch: BracketMatch<TRoundData, TMatchData>;
|
|
150
|
-
currentRound: BracketRound<TRoundData, TMatchData>;
|
|
151
|
-
previousMatch: BracketMatch<TRoundData, TMatchData>;
|
|
152
|
-
previousRound: BracketRound<TRoundData, TMatchData>;
|
|
153
|
-
nextUpperMatch: BracketMatch<TRoundData, TMatchData>;
|
|
154
|
-
nextUpperRound: BracketRound<TRoundData, TMatchData>;
|
|
155
|
-
nextLowerMatch: BracketMatch<TRoundData, TMatchData>;
|
|
156
|
-
nextLowerRound: BracketRound<TRoundData, TMatchData>;
|
|
157
|
-
};
|
|
158
152
|
export type BracketMatchRelationTwoToNothing<TRoundData, TMatchData> = {
|
|
159
153
|
type: 'two-to-nothing';
|
|
160
154
|
currentMatch: BracketMatch<TRoundData, TMatchData>;
|
|
@@ -164,7 +158,7 @@ export type BracketMatchRelationTwoToNothing<TRoundData, TMatchData> = {
|
|
|
164
158
|
previousLowerMatch: BracketMatch<TRoundData, TMatchData>;
|
|
165
159
|
previousLowerRound: BracketRound<TRoundData, TMatchData>;
|
|
166
160
|
};
|
|
167
|
-
export type BracketMatchRelation<TRoundData, TMatchData> = BracketMatchRelationOneToOne<TRoundData, TMatchData> | BracketMatchRelationTwoToOne<TRoundData, TMatchData> |
|
|
161
|
+
export type BracketMatchRelation<TRoundData, TMatchData> = BracketMatchRelationOneToOne<TRoundData, TMatchData> | BracketMatchRelationTwoToOne<TRoundData, TMatchData> | BracketMatchRelationNothingToOne<TRoundData, TMatchData> | BracketMatchRelationOneToNothing<TRoundData, TMatchData> | BracketMatchRelationTwoToNothing<TRoundData, TMatchData>;
|
|
168
162
|
export type BracketMatchRelationsMap<TRoundData, TMatchData> = Map<BracketMatchId, BracketMatchRelation<TRoundData, TMatchData>>;
|
|
169
163
|
export type BracketRoundRelationNothingToOne<TRoundData, TMatchData> = {
|
|
170
164
|
type: 'nothing-to-one';
|
|
@@ -237,6 +231,7 @@ export type BracketParticipantMatch<TRoundData, TMatchData> = {
|
|
|
237
231
|
};
|
|
238
232
|
export type BracketParticipant<TRoundData, TMatchData> = {
|
|
239
233
|
id: MatchParticipantId;
|
|
234
|
+
shortId: MatchParticipantShortId;
|
|
240
235
|
name: string;
|
|
241
236
|
matches: Map<BracketMatchId, BracketParticipantMatch<TRoundData, TMatchData>>;
|
|
242
237
|
};
|
|
@@ -254,7 +249,7 @@ export type BracketRoundSwissData<TRoundData, TMatchData> = {
|
|
|
254
249
|
};
|
|
255
250
|
export type BracketRoundMapWithSwissData<TRoundData, TMatchData> = Map<BracketRoundId, BracketRoundSwissData<TRoundData, TMatchData>>;
|
|
256
251
|
export type BracketRoundTypeMap<TRoundData, TMatchData> = Map<BracketRoundType, BracketRoundMap<TRoundData, TMatchData>>;
|
|
257
|
-
export declare const generateRoundTypeFromEthleteRoundType: (type: RoundType, tournamentMode: TournamentMode) => BracketRoundType;
|
|
252
|
+
export declare const generateRoundTypeFromEthleteRoundType: (type: RoundType, tournamentMode: TournamentMode, roundMatchCount: number) => BracketRoundType;
|
|
258
253
|
export declare const generateTournamentModeFormEthleteRounds: (source: RoundStageStructureWithMatchesView[]) => TournamentMode;
|
|
259
254
|
export declare const canRenderLayoutInTournamentMode: (layout: BracketDataLayout, mode: TournamentMode) => boolean;
|
|
260
255
|
export declare const BRACKET_DATA_LAYOUT: {
|
|
@@ -283,8 +278,7 @@ export declare const generateBracketRoundTypeMap: <TRoundData, TMatchData>(brack
|
|
|
283
278
|
export declare const generateRoundRelations: <TRoundData, TMatchData>(bracketData: BracketData<TRoundData, TMatchData>) => BracketRoundRelations<TRoundData, TMatchData>;
|
|
284
279
|
export declare const generateMatchRelations: <TRoundData, TMatchData>(bracketData: BracketData<TRoundData, TMatchData>, roundRelations: BracketRoundRelations<TRoundData, TMatchData>, matchPositionMaps: MatchPositionMaps<TRoundData, TMatchData>) => BracketMatchRelationsMap<TRoundData, TMatchData>;
|
|
285
280
|
export declare const generateMatchRelationPositions: <TRoundData, TMatchData>(currentRelation: BracketRoundRelation<TRoundData, TMatchData>, match: BracketMatch<TRoundData, TMatchData>) => {
|
|
286
|
-
|
|
287
|
-
nextLowerRoundMatchPosition: BracketMatchPosition;
|
|
281
|
+
nextRoundMatchPosition: BracketMatchPosition;
|
|
288
282
|
previousUpperRoundMatchPosition: BracketMatchPosition;
|
|
289
283
|
previousLowerRoundMatchPosition: BracketMatchPosition;
|
|
290
284
|
};
|
|
@@ -8,16 +8,18 @@ export type DrawManDimensions = {
|
|
|
8
8
|
columnGap: number;
|
|
9
9
|
rowGap: number;
|
|
10
10
|
gridDefinitions: BracketGridDefinitions;
|
|
11
|
-
path: PathOptions
|
|
12
|
-
curve: Omit<CurveOptions, 'path'>;
|
|
11
|
+
path: Omit<PathOptions, 'className'>;
|
|
12
|
+
curve: Omit<CurveOptions, 'path' | 'inverted'>;
|
|
13
13
|
};
|
|
14
14
|
type PathOptions = {
|
|
15
15
|
width: number;
|
|
16
16
|
dashArray: number;
|
|
17
17
|
dashOffset: number;
|
|
18
|
+
className: string;
|
|
18
19
|
};
|
|
19
20
|
type CurveOptions = {
|
|
20
|
-
|
|
21
|
+
lineStartingCurveAmount: number;
|
|
22
|
+
lineEndingCurveAmount: number;
|
|
21
23
|
path: PathOptions;
|
|
22
24
|
};
|
|
23
25
|
export declare const drawMan: <TRoundData, TMatchData>(items: Map<BracketRoundId, BracketGridRoundItem<TRoundData, TMatchData>>, firstRounds: FirstRounds<TRoundData, TMatchData>, dimensions: DrawManDimensions) => string;
|
|
@@ -25,6 +25,7 @@ export type BracketGridRoundHeaderItem<TRoundData, TMatchData> = {
|
|
|
25
25
|
layoutId: string;
|
|
26
26
|
rowStart: number;
|
|
27
27
|
rowEnd: number;
|
|
28
|
+
className: string;
|
|
28
29
|
component: BracketRoundHeaderComponent<TRoundData, TMatchData>;
|
|
29
30
|
roundRelation: BracketRoundRelation<TRoundData, TMatchData>;
|
|
30
31
|
data: {
|
|
@@ -37,6 +38,7 @@ export type BracketGridMatchItem<TRoundData, TMatchData> = {
|
|
|
37
38
|
layoutId: string;
|
|
38
39
|
rowStart: number;
|
|
39
40
|
rowEnd: number;
|
|
41
|
+
className: string;
|
|
40
42
|
component: BracketMatchComponent<TRoundData, TMatchData>;
|
|
41
43
|
matchRelation: BracketMatchRelation<TRoundData, TMatchData>;
|
|
42
44
|
roundRelation: BracketRoundRelation<TRoundData, TMatchData>;
|
|
@@ -50,10 +52,12 @@ export type GenerateBracketGridItemsOptions<TRoundData, TMatchData> = {
|
|
|
50
52
|
includeRoundHeaders: boolean;
|
|
51
53
|
headerComponent?: BracketRoundHeaderComponent<TRoundData, TMatchData>;
|
|
52
54
|
matchComponent?: BracketMatchComponent<TRoundData, TMatchData>;
|
|
55
|
+
finalMatchComponent?: BracketMatchComponent<TRoundData, TMatchData>;
|
|
53
56
|
};
|
|
54
57
|
export type GenerateBracketGridItemsOptionsWithDefaults<TRoundData, TMatchData> = {
|
|
55
58
|
includeRoundHeaders: boolean;
|
|
56
59
|
headerComponent: BracketRoundHeaderComponent<TRoundData, TMatchData>;
|
|
57
60
|
matchComponent: BracketMatchComponent<TRoundData, TMatchData>;
|
|
61
|
+
finalMatchComponent: BracketMatchComponent<TRoundData, TMatchData>;
|
|
58
62
|
};
|
|
59
63
|
export declare const generateBracketGridItems: <TRoundData, TMatchData>(bracketData: BracketData<TRoundData, TMatchData>, roundTypeMap: BracketRoundTypeMap<TRoundData, TMatchData>, swissGroups: BracketRoundMapWithSwissData<TRoundData, TMatchData> | null, roundRelations: BracketRoundRelations<TRoundData, TMatchData>, matchRelations: BracketMatchRelationsMap<TRoundData, TMatchData>, options: GenerateBracketGridItemsOptions<TRoundData, TMatchData>) => Map<BracketRoundId, BracketGridRoundItem<TRoundData, TMatchData>>;
|
|
@@ -9,14 +9,17 @@ export declare class NewBracketComponent<TRoundData = unknown, TMatchData = unkn
|
|
|
9
9
|
roundHeaderHeight: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
10
10
|
columnGap: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
11
11
|
rowGap: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
12
|
-
|
|
12
|
+
lineStartingCurveAmount: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
13
|
+
lineEndingCurveAmount: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
13
14
|
lineWidth: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
14
15
|
lineDashArray: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
15
16
|
lineDashOffset: import("@angular/core").InputSignalWithTransform<number, unknown>;
|
|
17
|
+
disableJourneyHighlight: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
16
18
|
layout: import("@angular/core").InputSignal<BracketDataLayout>;
|
|
17
19
|
hideRoundHeaders: import("@angular/core").InputSignalWithTransform<boolean, unknown>;
|
|
18
20
|
roundHeaderComponent: import("@angular/core").InputSignal<BracketRoundHeaderComponent<TRoundData, TMatchData> | undefined>;
|
|
19
21
|
matchComponent: import("@angular/core").InputSignal<BracketMatchComponent<TRoundData, TMatchData> | undefined>;
|
|
22
|
+
finalMatchComponent: import("@angular/core").InputSignal<BracketMatchComponent<TRoundData, TMatchData> | undefined>;
|
|
20
23
|
bracketData: import("@angular/core").Signal<import("./bracket-new").BracketData<TRoundData, TMatchData>>;
|
|
21
24
|
roundTypeMap: import("@angular/core").Signal<import("./bracket-new").BracketRoundTypeMap<TRoundData, TMatchData>>;
|
|
22
25
|
matchParticipantMap: import("@angular/core").Signal<import("./bracket-new").MatchParticipantMap<TRoundData, TMatchData>>;
|
|
@@ -28,6 +31,8 @@ export declare class NewBracketComponent<TRoundData = unknown, TMatchData = unkn
|
|
|
28
31
|
definitions: import("@angular/core").Signal<import("./grid-definitions").BracketGridDefinitions>;
|
|
29
32
|
firstRounds: import("@angular/core").Signal<import("./bracket-new").FirstRounds<TRoundData, TMatchData>>;
|
|
30
33
|
drawManData: import("@angular/core").Signal<import("@angular/platform-browser").SafeHtml>;
|
|
34
|
+
journeyHighlight: import("@angular/core").Signal<string | null>;
|
|
35
|
+
constructor();
|
|
31
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<NewBracketComponent<any, any>, never>;
|
|
32
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<NewBracketComponent<any, any>, "et-new-bracket", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; "columnWidth": { "alias": "columnWidth"; "required": false; "isSignal": true; }; "matchHeight": { "alias": "matchHeight"; "required": false; "isSignal": true; }; "roundHeaderHeight": { "alias": "roundHeaderHeight"; "required": false; "isSignal": true; }; "columnGap": { "alias": "columnGap"; "required": false; "isSignal": true; }; "rowGap": { "alias": "rowGap"; "required": false; "isSignal": true; }; "
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<NewBracketComponent<any, any>, "et-new-bracket", never, { "source": { "alias": "source"; "required": true; "isSignal": true; }; "columnWidth": { "alias": "columnWidth"; "required": false; "isSignal": true; }; "matchHeight": { "alias": "matchHeight"; "required": false; "isSignal": true; }; "roundHeaderHeight": { "alias": "roundHeaderHeight"; "required": false; "isSignal": true; }; "columnGap": { "alias": "columnGap"; "required": false; "isSignal": true; }; "rowGap": { "alias": "rowGap"; "required": false; "isSignal": true; }; "lineStartingCurveAmount": { "alias": "lineStartingCurveAmount"; "required": false; "isSignal": true; }; "lineEndingCurveAmount": { "alias": "lineEndingCurveAmount"; "required": false; "isSignal": true; }; "lineWidth": { "alias": "lineWidth"; "required": false; "isSignal": true; }; "lineDashArray": { "alias": "lineDashArray"; "required": false; "isSignal": true; }; "lineDashOffset": { "alias": "lineDashOffset"; "required": false; "isSignal": true; }; "disableJourneyHighlight": { "alias": "disableJourneyHighlight"; "required": false; "isSignal": true; }; "layout": { "alias": "layout"; "required": false; "isSignal": true; }; "hideRoundHeaders": { "alias": "hideRoundHeaders"; "required": false; "isSignal": true; }; "roundHeaderComponent": { "alias": "roundHeaderComponent"; "required": false; "isSignal": true; }; "matchComponent": { "alias": "matchComponent"; "required": false; "isSignal": true; }; "finalMatchComponent": { "alias": "finalMatchComponent"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
|
|
33
38
|
}
|