@ethlete/cdk 5.0.0-next.49 → 5.0.0-next.50
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 +66 -0
- package/fesm2022/ethlete-cdk.mjs +187 -68
- package/fesm2022/ethlete-cdk.mjs.map +1 -1
- package/generators/migrate-from-cdk/components-classes.js +21 -0
- package/generators/migrate-from-cdk/report.js +28 -1
- package/migration-map.json +1 -1
- package/package.json +1 -1
- package/types/ethlete-cdk.d.ts +13 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
# @ethlete/cdk
|
|
2
2
|
|
|
3
|
+
## 5.0.0-next.50
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- New bracket: support a third place match in single elimination (from 4.74.0), and keep its own column after the continue element.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- The migrate-from-cdk codemod now reports cdk table column directives, which render nothing inside `et-table`.
|
|
12
|
+
- Skeleton: add `--et-skeleton-color`, `--et-skeleton-highlight-color`, `--et-skeleton-display` and `--et-skeleton-direction`, keep a nested skeleton silent, and let a `shape="rect"` item keep its `aspect-ratio`.
|
|
13
|
+
|
|
3
14
|
## 5.0.0-next.49
|
|
4
15
|
|
|
5
16
|
### Patch Changes
|
|
@@ -340,6 +351,61 @@
|
|
|
340
351
|
|
|
341
352
|
- [`a690217`](https://github.com/ethlete-io/ethdk/commit/a6902172efd9bd1956a16237e79acbfbd816d946) Thanks [@TomTomB](https://github.com/TomTomB)! - Version bump only
|
|
342
353
|
|
|
354
|
+
## 4.74.0
|
|
355
|
+
|
|
356
|
+
### Minor Changes
|
|
357
|
+
|
|
358
|
+
- [`770e26b`](https://github.com/ethlete-io/ethdk/commit/770e26ba1cb2042a573e48cc529d8edf3e0e9dc0) Thanks [@TomTomB](https://github.com/TomTomB)! - New bracket: support a third place match in single elimination. The final stays the last match of the bracket, so the continue element is drawn again. A mirrored layout folds the third place match below the final, and the new `thirdPlaceTopOffset` input (also in `provideNewBracketConfig`) folds it below the final in a left to right layout. Semi final losers are no longer marked `isEliminated` when a third place match follows.
|
|
359
|
+
|
|
360
|
+
### Patch Changes
|
|
361
|
+
|
|
362
|
+
- [`88a6896`](https://github.com/ethlete-io/ethdk/commit/88a6896692e166a9f4b0222346e29e33e2d76636) Thanks [@TomTomB](https://github.com/TomTomB)! - Place a third place match that keeps its own column after the continue element, so the line from the final to the continue element no longer crosses it.
|
|
363
|
+
|
|
364
|
+
## 4.73.0
|
|
365
|
+
|
|
366
|
+
### Minor Changes
|
|
367
|
+
|
|
368
|
+
- [`4dfebf6`](https://github.com/ethlete-io/ethdk/commit/4dfebf65b4a21be3ae101580bc68a6ddf011dd5c) Thanks [@TomTomB](https://github.com/TomTomB)! - Update all dependencies to their latest versions. The peer dependencies now require Angular 22.2 and Angular CDK 22.2, and `@ethlete/core` requires TypeScript 6.0 and `@nx/devkit` 24.
|
|
369
|
+
|
|
370
|
+
### Patch Changes
|
|
371
|
+
|
|
372
|
+
- [`bc313e1`](https://github.com/ethlete-io/ethdk/commit/bc313e1fd84e421cb4344745cdf7a8f06c9f530c) Thanks [@TomTomB](https://github.com/TomTomB)! - Update dependencies and the pinned peer dependency versions (Angular 20.3.34, Angular CDK 20.2.14, @floating-ui/dom 1.8.0, @contentful/rich-text-types 17.2.7).
|
|
373
|
+
|
|
374
|
+
## 4.72.1
|
|
375
|
+
|
|
376
|
+
### Patch Changes
|
|
377
|
+
|
|
378
|
+
- [`ba5501f`](https://github.com/ethlete-io/ethdk/commit/ba5501f9d86878d1d02a2dea68ccaf591ff48611) Thanks [@TomTomB](https://github.com/TomTomB)! - Keep a combobox control's value while its async options load, instead of overwriting it with `null`.
|
|
379
|
+
|
|
380
|
+
## 4.72.0
|
|
381
|
+
|
|
382
|
+
### Minor Changes
|
|
383
|
+
|
|
384
|
+
- [`29dfbf8`](https://github.com/ethlete-io/ethdk/commit/29dfbf8dd03511af30e6411be93f5836fcc43e20) Thanks [@TomTomB](https://github.com/TomTomB)! - Support swiss mode in bracket new as per design spec
|
|
385
|
+
|
|
386
|
+
- [`86e0817`](https://github.com/ethlete-io/ethdk/commit/86e0817d7dd68b36d65dbf8b45a35026f2568e96) Thanks [@TomTomB](https://github.com/TomTomB)! - Add option to render a continue element at the end of a bracket if theres a follow up competition stage
|
|
387
|
+
|
|
388
|
+
### Patch Changes
|
|
389
|
+
|
|
390
|
+
- [`214679e`](https://github.com/ethlete-io/ethdk/commit/214679e82ecd8de2dd37416911cb5a4bcf0dbdb4) Thanks [@baltruschat](https://github.com/baltruschat)! - Position winner rounds correctly when the winner bracket starts after round 1
|
|
391
|
+
|
|
392
|
+
Some double elimination brackets omit the early winner rounds — e.g. a small bracket where the first lower round is seeded directly from a group phase and has no winner round feeding it. The grid previously placed the first present winner round in the leftmost column, so every winner round was one column too far left relative to its drop-in lower round. The grid now detects the missing leading winner rounds (a complete winner bracket has lowerRounds / 2 + 1 rounds) and leaves those leading slots empty, so each present winner round lines up above the lower round its losers actually drop into.
|
|
393
|
+
|
|
394
|
+
- [`214679e`](https://github.com/ethlete-io/ethdk/commit/214679e82ecd8de2dd37416911cb5a4bcf0dbdb4) Thanks [@baltruschat](https://github.com/baltruschat)! - Align winner bracket rounds above their drop-in loser round
|
|
395
|
+
|
|
396
|
+
In the double elimination grid, winner bracket rounds that span two lower bracket columns were centered over that span, leaving them half a column off from the loser round they relate to. They are now left-aligned within the span so winner round n sits directly above the loser round its losers drop into (round 2n − 2) — the round whose matches merge into the next one — making the drop target unambiguous. The first winner round and the winner final are single-column and stay in place; lower rounds and other brackets are unaffected.
|
|
397
|
+
|
|
398
|
+
- [`86e0817`](https://github.com/ethlete-io/ethdk/commit/86e0817d7dd68b36d65dbf8b45a35026f2568e96) Thanks [@TomTomB](https://github.com/TomTomB)! - Fix bracket highlighting getting laggy on larger brackets
|
|
399
|
+
|
|
400
|
+
- [`214679e`](https://github.com/ethlete-io/ethdk/commit/214679e82ecd8de2dd37416911cb5a4bcf0dbdb4) Thanks [@baltruschat](https://github.com/baltruschat)! - Fix rendering of truncated double elimination brackets
|
|
401
|
+
|
|
402
|
+
Brackets whose data ends before the grand final (e.g. only the currently available rounds are loaded) no longer crash and now draw their lower bracket connector lines correctly:
|
|
403
|
+
- The last lower bracket round is no longer left without a relation when there is no final round to feed into (it now terminates with a `one-to-nothing` relation), which previously caused a `Cannot destructure property 'nextRoundMatchPosition'` error.
|
|
404
|
+
- `generateMatchRelationsNew` skips matches whose round has no resolved relation instead of throwing, so incomplete brackets degrade gracefully.
|
|
405
|
+
- Lower bracket rounds are now separated by a gap column even when no finals section exists, so their connector lines are no longer collapsed to zero width and become invisible.
|
|
406
|
+
|
|
407
|
+
Brackets that are truncated at the front (missing the first winner bracket round) are covered by the same changes.
|
|
408
|
+
|
|
343
409
|
## 4.71.1
|
|
344
410
|
|
|
345
411
|
### Patch Changes
|
package/fesm2022/ethlete-cdk.mjs
CHANGED
|
@@ -1593,6 +1593,12 @@ const createRoundsMapBase = (source, options) => {
|
|
|
1593
1593
|
}
|
|
1594
1594
|
return map;
|
|
1595
1595
|
};
|
|
1596
|
+
const thirdPlaceFeederRoundId = (source) => {
|
|
1597
|
+
if (!source.rounds.some((round) => round.type === COMMON_BRACKET_ROUND_TYPE.THIRD_PLACE)) return null;
|
|
1598
|
+
const chain = source.rounds.filter((round) => round.type !== COMMON_BRACKET_ROUND_TYPE.THIRD_PLACE);
|
|
1599
|
+
const finalIndex = chain.findIndex((round) => round.type === COMMON_BRACKET_ROUND_TYPE.FINAL);
|
|
1600
|
+
return finalIndex > 0 ? chain[finalIndex - 1]?.id ?? null : null;
|
|
1601
|
+
};
|
|
1596
1602
|
const createNewMatchParticipantBase = (source, participantId, match, rounds, matchRoundId, participants) => {
|
|
1597
1603
|
if (!participantId) return null;
|
|
1598
1604
|
const participantBase = participants.getOrThrow(participantId);
|
|
@@ -1623,8 +1629,8 @@ const createNewMatchParticipantBase = (source, participantId, match, rounds, mat
|
|
|
1623
1629
|
let isEliminationMatch = false;
|
|
1624
1630
|
if (hasElimination) switch (source.mode) {
|
|
1625
1631
|
case TOURNAMENT_MODE.SINGLE_ELIMINATION:
|
|
1626
|
-
isEliminationMatch =
|
|
1627
|
-
isEliminated = isLooser ?? false;
|
|
1632
|
+
isEliminationMatch = match.roundId !== thirdPlaceFeederRoundId(source);
|
|
1633
|
+
isEliminated = (isEliminationMatch && isLooser) ?? false;
|
|
1628
1634
|
break;
|
|
1629
1635
|
case TOURNAMENT_MODE.DOUBLE_ELIMINATION:
|
|
1630
1636
|
isEliminationMatch = roundBase.type === DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE.LOWER_BRACKET || roundBase.type === DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE.REVERSE_FINAL || roundBase.type === COMMON_BRACKET_ROUND_TYPE.THIRD_PLACE;
|
|
@@ -2198,7 +2204,7 @@ const handleRegularRound = (params) => {
|
|
|
2198
2204
|
};
|
|
2199
2205
|
const generateRoundRelationsNew = (bracketData) => {
|
|
2200
2206
|
const relations = [];
|
|
2201
|
-
const allRounds = [...bracketData.rounds.values()];
|
|
2207
|
+
const allRounds = [...bracketData.rounds.values()].filter((r) => r.type !== COMMON_BRACKET_ROUND_TYPE.THIRD_PLACE);
|
|
2202
2208
|
const upperRounds = allRounds.filter((r) => r.type !== DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE.LOWER_BRACKET);
|
|
2203
2209
|
const lowerRounds = allRounds.filter((r) => r.type === DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE.LOWER_BRACKET);
|
|
2204
2210
|
const firstUpperRound = upperRounds[0];
|
|
@@ -3244,9 +3250,14 @@ const createBracketContinueMasterColumn = (config) => {
|
|
|
3244
3250
|
const { existingMasterColumns, columnWidth, elementHeight, headerOffset, component, matches } = config;
|
|
3245
3251
|
const lastMasterColumn = existingMasterColumns[existingMasterColumns.length - 1];
|
|
3246
3252
|
if (!lastMasterColumn) throw new Error("No last master column found in existing master columns");
|
|
3247
|
-
const
|
|
3248
|
-
|
|
3249
|
-
|
|
3253
|
+
const firstSectionIsHeader = lastMasterColumn.sections[0]?.subColumns[0]?.elements[0]?.type === "header";
|
|
3254
|
+
let totalHeight = 0;
|
|
3255
|
+
for (const [sectionIndex, section] of lastMasterColumn.sections.entries()) {
|
|
3256
|
+
const padding = section.padding ?? lastMasterColumn.padding;
|
|
3257
|
+
const paddingTop = sectionIndex === 0 && firstSectionIsHeader ? 0 : padding.top;
|
|
3258
|
+
const sectionHeight = Math.max(0, ...section.subColumns.map((subColumn) => subColumn.elements.reduce((subColumnHeight, element) => subColumnHeight + element.parts.reduce((sum, part) => sum + part.dimensions.height, 0), 0)));
|
|
3259
|
+
totalHeight += paddingTop + sectionHeight + padding.bottom;
|
|
3260
|
+
}
|
|
3250
3261
|
const { masterColumn, pushSection } = createBracketMasterColumn({
|
|
3251
3262
|
columnWidth,
|
|
3252
3263
|
padding: {
|
|
@@ -3284,6 +3295,100 @@ const createBracketContinueMasterColumn = (config) => {
|
|
|
3284
3295
|
pushSection(masterColumnSection);
|
|
3285
3296
|
return masterColumn;
|
|
3286
3297
|
};
|
|
3298
|
+
const createRoundBracketSubColumnRelativeToFirstRound = (config) => {
|
|
3299
|
+
const { firstRound, round, options, span, hasReverseFinal } = config;
|
|
3300
|
+
const { subColumn, pushElement } = createBracketSubColumn({ span });
|
|
3301
|
+
const matchFactor = firstRound.matchCount / round.matchCount;
|
|
3302
|
+
const matches = Array.from(round.matches.values());
|
|
3303
|
+
const elementsToCreate = [];
|
|
3304
|
+
if (options.roundHeaderHeight > 0) elementsToCreate.push({
|
|
3305
|
+
type: "header",
|
|
3306
|
+
area: `h${round.shortId}`,
|
|
3307
|
+
partHeights: [options.roundHeaderHeight],
|
|
3308
|
+
elementHeight: options.roundHeaderHeight,
|
|
3309
|
+
component: config.components.roundHeader,
|
|
3310
|
+
round,
|
|
3311
|
+
roundSwissGroup: null
|
|
3312
|
+
}, {
|
|
3313
|
+
type: "roundHeaderGap",
|
|
3314
|
+
area: ".",
|
|
3315
|
+
partHeights: [options.roundHeaderGap],
|
|
3316
|
+
elementHeight: options.roundHeaderGap
|
|
3317
|
+
});
|
|
3318
|
+
for (const [matchIndex, match] of matches.entries()) {
|
|
3319
|
+
const isLastMatch = matchIndex === matches.length - 1;
|
|
3320
|
+
const matchRows = [];
|
|
3321
|
+
for (let factorIndex = 0; factorIndex < matchFactor; factorIndex++) {
|
|
3322
|
+
const isLastFactor = factorIndex === matchFactor - 1;
|
|
3323
|
+
matchRows.push(options.matchHeight);
|
|
3324
|
+
if (isLastFactor) continue;
|
|
3325
|
+
matchRows.push(options.rowGap);
|
|
3326
|
+
}
|
|
3327
|
+
const isFinalMatch = hasReverseFinal ? round.type === DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE.REVERSE_FINAL : round.type === COMMON_BRACKET_ROUND_TYPE.FINAL;
|
|
3328
|
+
elementsToCreate.push({
|
|
3329
|
+
type: "match",
|
|
3330
|
+
area: `m${match.shortId}`,
|
|
3331
|
+
partHeights: matchRows,
|
|
3332
|
+
elementHeight: isFinalMatch ? options.finalMatchHeight : options.matchHeight,
|
|
3333
|
+
component: isFinalMatch ? config.components.finalMatch : config.components.match,
|
|
3334
|
+
match,
|
|
3335
|
+
round,
|
|
3336
|
+
roundSwissGroup: null
|
|
3337
|
+
});
|
|
3338
|
+
if (!isLastMatch) elementsToCreate.push({
|
|
3339
|
+
type: "matchGap",
|
|
3340
|
+
area: ".",
|
|
3341
|
+
partHeights: [options.rowGap],
|
|
3342
|
+
elementHeight: options.rowGap
|
|
3343
|
+
});
|
|
3344
|
+
}
|
|
3345
|
+
for (const elementData of elementsToCreate) {
|
|
3346
|
+
const { element } = createBracketElement(elementData);
|
|
3347
|
+
pushElement(element);
|
|
3348
|
+
}
|
|
3349
|
+
return subColumn;
|
|
3350
|
+
};
|
|
3351
|
+
const heightOfElement = (element) => element.parts.reduce((total, part) => total + part.dimensions.height, 0);
|
|
3352
|
+
const cardGeometry = (subColumn) => {
|
|
3353
|
+
let height = 0;
|
|
3354
|
+
let cardTop = null;
|
|
3355
|
+
for (const element of subColumn.elements) {
|
|
3356
|
+
const elementHeight = heightOfElement(element);
|
|
3357
|
+
if (element.type === "match" && cardTop === null) cardTop = height + (elementHeight - element.dimensions.height) / 2;
|
|
3358
|
+
height += elementHeight;
|
|
3359
|
+
}
|
|
3360
|
+
return {
|
|
3361
|
+
cardTop: cardTop ?? 0,
|
|
3362
|
+
height
|
|
3363
|
+
};
|
|
3364
|
+
};
|
|
3365
|
+
const createFoldedThirdPlaceSection = (config) => {
|
|
3366
|
+
const { options, round } = config;
|
|
3367
|
+
const final = cardGeometry(config.finalSubColumn);
|
|
3368
|
+
const headerOffset = options.roundHeaderHeight > 0 ? options.roundHeaderHeight + options.roundHeaderGap : 0;
|
|
3369
|
+
const paddingTop = final.cardTop + config.topOffset - final.height - headerOffset;
|
|
3370
|
+
const { masterColumnSection, pushSubColumn } = createBracketMasterColumnSection({
|
|
3371
|
+
type: "round",
|
|
3372
|
+
padding: {
|
|
3373
|
+
top: paddingTop,
|
|
3374
|
+
bottom: 0,
|
|
3375
|
+
left: 0,
|
|
3376
|
+
right: 0
|
|
3377
|
+
}
|
|
3378
|
+
});
|
|
3379
|
+
pushSubColumn(createRoundBracketSubColumnRelativeToFirstRound({
|
|
3380
|
+
firstRound: round,
|
|
3381
|
+
round,
|
|
3382
|
+
options,
|
|
3383
|
+
hasReverseFinal: false,
|
|
3384
|
+
span: {
|
|
3385
|
+
isStart: true,
|
|
3386
|
+
isEnd: true
|
|
3387
|
+
},
|
|
3388
|
+
components: config.components
|
|
3389
|
+
}));
|
|
3390
|
+
return masterColumnSection;
|
|
3391
|
+
};
|
|
3287
3392
|
const createBracketGapMasterColumn = (config) => {
|
|
3288
3393
|
const { existingMasterColumns, columnGap } = config;
|
|
3289
3394
|
const lastMasterColumn = existingMasterColumns[existingMasterColumns.length - 1];
|
|
@@ -3298,7 +3403,14 @@ const createBracketGapMasterColumn = (config) => {
|
|
|
3298
3403
|
}
|
|
3299
3404
|
});
|
|
3300
3405
|
for (const section of lastMasterColumn.sections) {
|
|
3301
|
-
const { masterColumnSection, pushSubColumn } = createBracketMasterColumnSection({
|
|
3406
|
+
const { masterColumnSection, pushSubColumn } = createBracketMasterColumnSection({
|
|
3407
|
+
type: "gap",
|
|
3408
|
+
padding: section.padding && {
|
|
3409
|
+
...section.padding,
|
|
3410
|
+
left: 0,
|
|
3411
|
+
right: 0
|
|
3412
|
+
}
|
|
3413
|
+
});
|
|
3302
3414
|
const lastSubColumn = section.subColumns[section.subColumns.length - 1];
|
|
3303
3415
|
if (!lastSubColumn) throw new Error("No last sub column found in section");
|
|
3304
3416
|
const { pushElement, subColumn } = createBracketSubColumn({ span: {
|
|
@@ -3356,59 +3468,6 @@ const createBracketGapMasterColumn = (config) => {
|
|
|
3356
3468
|
}
|
|
3357
3469
|
return masterColumn;
|
|
3358
3470
|
};
|
|
3359
|
-
const createRoundBracketSubColumnRelativeToFirstRound = (config) => {
|
|
3360
|
-
const { firstRound, round, options, span, hasReverseFinal } = config;
|
|
3361
|
-
const { subColumn, pushElement } = createBracketSubColumn({ span });
|
|
3362
|
-
const matchFactor = firstRound.matchCount / round.matchCount;
|
|
3363
|
-
const matches = Array.from(round.matches.values());
|
|
3364
|
-
const elementsToCreate = [];
|
|
3365
|
-
if (options.roundHeaderHeight > 0) elementsToCreate.push({
|
|
3366
|
-
type: "header",
|
|
3367
|
-
area: `h${round.shortId}`,
|
|
3368
|
-
partHeights: [options.roundHeaderHeight],
|
|
3369
|
-
elementHeight: options.roundHeaderHeight,
|
|
3370
|
-
component: config.components.roundHeader,
|
|
3371
|
-
round,
|
|
3372
|
-
roundSwissGroup: null
|
|
3373
|
-
}, {
|
|
3374
|
-
type: "roundHeaderGap",
|
|
3375
|
-
area: ".",
|
|
3376
|
-
partHeights: [options.roundHeaderGap],
|
|
3377
|
-
elementHeight: options.roundHeaderGap
|
|
3378
|
-
});
|
|
3379
|
-
for (const [matchIndex, match] of matches.entries()) {
|
|
3380
|
-
const isLastMatch = matchIndex === matches.length - 1;
|
|
3381
|
-
const matchRows = [];
|
|
3382
|
-
for (let factorIndex = 0; factorIndex < matchFactor; factorIndex++) {
|
|
3383
|
-
const isLastFactor = factorIndex === matchFactor - 1;
|
|
3384
|
-
matchRows.push(options.matchHeight);
|
|
3385
|
-
if (isLastFactor) continue;
|
|
3386
|
-
matchRows.push(options.rowGap);
|
|
3387
|
-
}
|
|
3388
|
-
const isFinalMatch = hasReverseFinal ? round.type === DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE.REVERSE_FINAL : round.type === COMMON_BRACKET_ROUND_TYPE.FINAL;
|
|
3389
|
-
elementsToCreate.push({
|
|
3390
|
-
type: "match",
|
|
3391
|
-
area: `m${match.shortId}`,
|
|
3392
|
-
partHeights: matchRows,
|
|
3393
|
-
elementHeight: isFinalMatch ? options.finalMatchHeight : options.matchHeight,
|
|
3394
|
-
component: isFinalMatch ? config.components.finalMatch : config.components.match,
|
|
3395
|
-
match,
|
|
3396
|
-
round,
|
|
3397
|
-
roundSwissGroup: null
|
|
3398
|
-
});
|
|
3399
|
-
if (!isLastMatch) elementsToCreate.push({
|
|
3400
|
-
type: "matchGap",
|
|
3401
|
-
area: ".",
|
|
3402
|
-
partHeights: [options.rowGap],
|
|
3403
|
-
elementHeight: options.rowGap
|
|
3404
|
-
});
|
|
3405
|
-
}
|
|
3406
|
-
for (const elementData of elementsToCreate) {
|
|
3407
|
-
const { element } = createBracketElement(elementData);
|
|
3408
|
-
pushElement(element);
|
|
3409
|
-
}
|
|
3410
|
-
return subColumn;
|
|
3411
|
-
};
|
|
3412
3471
|
const createDoubleEliminationGrid = (bracketData, options, components) => {
|
|
3413
3472
|
const grid = createBracketGrid({ spanElementWidth: options.columnWidth });
|
|
3414
3473
|
const presentUpperBracketRounds = Array.from(bracketData.roundsByType.getOrThrow(DOUBLE_ELIMINATION_BRACKET_ROUND_TYPE.UPPER_BRACKET).values());
|
|
@@ -3622,13 +3681,33 @@ const createDoubleEliminationGrid = (bracketData, options, components) => {
|
|
|
3622
3681
|
matchElementMap: finalizedGrid.elementMap
|
|
3623
3682
|
};
|
|
3624
3683
|
};
|
|
3684
|
+
const resolveThirdPlaceTopOffset = (options) => {
|
|
3685
|
+
if (options.thirdPlaceTopOffset !== null && options.thirdPlaceTopOffset !== void 0) return options.thirdPlaceTopOffset;
|
|
3686
|
+
if (options.layout !== BRACKET_DATA_LAYOUT.MIRRORED) return null;
|
|
3687
|
+
const headerOffset = options.roundHeaderHeight > 0 ? options.roundHeaderHeight + options.roundHeaderGap : 0;
|
|
3688
|
+
return options.finalMatchHeight + options.rowGap + headerOffset;
|
|
3689
|
+
};
|
|
3690
|
+
const resolveFoldedThirdPlaceRound = (rounds, topOffset) => {
|
|
3691
|
+
if (topOffset === null) return null;
|
|
3692
|
+
if (!rounds.some((round) => round.type === COMMON_BRACKET_ROUND_TYPE.FINAL)) return null;
|
|
3693
|
+
return rounds.find((round) => round.type === COMMON_BRACKET_ROUND_TYPE.THIRD_PLACE) ?? null;
|
|
3694
|
+
};
|
|
3625
3695
|
const createSingleEliminationGrid = (bracketData, options, components) => {
|
|
3626
3696
|
const grid = createBracketGrid({ spanElementWidth: options.columnWidth });
|
|
3627
3697
|
const rounds = Array.from(bracketData.rounds.values());
|
|
3628
3698
|
const firstRound = bracketData.rounds.first();
|
|
3629
3699
|
if (!firstRound) throw new Error("No rounds found in bracket data");
|
|
3630
|
-
|
|
3631
|
-
|
|
3700
|
+
const thirdPlaceTopOffset = resolveThirdPlaceTopOffset(options);
|
|
3701
|
+
const foldedThirdPlaceRound = resolveFoldedThirdPlaceRound(rounds, thirdPlaceTopOffset);
|
|
3702
|
+
const ownColumnThirdPlaceRound = foldedThirdPlaceRound ? null : rounds.find((round) => round.type === COMMON_BRACKET_ROUND_TYPE.THIRD_PLACE) ?? null;
|
|
3703
|
+
const chainRounds = rounds.filter((round) => round !== foldedThirdPlaceRound && round !== ownColumnThirdPlaceRound);
|
|
3704
|
+
let pushSectionToFinal = null;
|
|
3705
|
+
let finalSubColumn = null;
|
|
3706
|
+
const pushGapColumn = () => grid.pushMasterColumn(createBracketGapMasterColumn({
|
|
3707
|
+
existingMasterColumns: grid.grid.masterColumns,
|
|
3708
|
+
columnGap: options.columnGap
|
|
3709
|
+
}));
|
|
3710
|
+
const pushRoundColumn = (round) => {
|
|
3632
3711
|
const { masterColumn, ...mutableMasterColumn } = createBracketMasterColumn({
|
|
3633
3712
|
columnWidth: round.type === COMMON_BRACKET_ROUND_TYPE.FINAL ? options.finalColumnWidth : options.columnWidth,
|
|
3634
3713
|
padding: {
|
|
@@ -3639,7 +3718,7 @@ const createSingleEliminationGrid = (bracketData, options, components) => {
|
|
|
3639
3718
|
}
|
|
3640
3719
|
});
|
|
3641
3720
|
const { masterColumnSection, pushSubColumn } = createBracketMasterColumnSection({ type: "round" });
|
|
3642
|
-
|
|
3721
|
+
const sub = createRoundBracketSubColumnRelativeToFirstRound({
|
|
3643
3722
|
firstRound,
|
|
3644
3723
|
round,
|
|
3645
3724
|
options,
|
|
@@ -3649,14 +3728,30 @@ const createSingleEliminationGrid = (bracketData, options, components) => {
|
|
|
3649
3728
|
isEnd: true
|
|
3650
3729
|
},
|
|
3651
3730
|
components
|
|
3652
|
-
})
|
|
3731
|
+
});
|
|
3732
|
+
pushSubColumn(sub);
|
|
3653
3733
|
mutableMasterColumn.pushSection(masterColumnSection);
|
|
3654
3734
|
grid.pushMasterColumn(masterColumn);
|
|
3655
|
-
|
|
3656
|
-
|
|
3657
|
-
|
|
3658
|
-
}
|
|
3735
|
+
return {
|
|
3736
|
+
pushSection: mutableMasterColumn.pushSection,
|
|
3737
|
+
sub
|
|
3738
|
+
};
|
|
3739
|
+
};
|
|
3740
|
+
for (const [roundIndex, round] of chainRounds.entries()) {
|
|
3741
|
+
if (roundIndex > 0) pushGapColumn();
|
|
3742
|
+
const { pushSection, sub } = pushRoundColumn(round);
|
|
3743
|
+
if (round.type === COMMON_BRACKET_ROUND_TYPE.FINAL) {
|
|
3744
|
+
pushSectionToFinal = pushSection;
|
|
3745
|
+
finalSubColumn = sub;
|
|
3746
|
+
}
|
|
3659
3747
|
}
|
|
3748
|
+
if (foldedThirdPlaceRound && pushSectionToFinal && finalSubColumn) pushSectionToFinal(createFoldedThirdPlaceSection({
|
|
3749
|
+
finalSubColumn,
|
|
3750
|
+
round: foldedThirdPlaceRound,
|
|
3751
|
+
topOffset: thirdPlaceTopOffset ?? 0,
|
|
3752
|
+
options,
|
|
3753
|
+
components
|
|
3754
|
+
}));
|
|
3660
3755
|
if (options.continueElement && components.continue) {
|
|
3661
3756
|
const continueMatches = getBracketContinueMatches(bracketData);
|
|
3662
3757
|
if (continueMatches.length) {
|
|
@@ -3674,6 +3769,10 @@ const createSingleEliminationGrid = (bracketData, options, components) => {
|
|
|
3674
3769
|
}));
|
|
3675
3770
|
}
|
|
3676
3771
|
}
|
|
3772
|
+
if (ownColumnThirdPlaceRound) {
|
|
3773
|
+
if (chainRounds.length) pushGapColumn();
|
|
3774
|
+
pushRoundColumn(ownColumnThirdPlaceRound);
|
|
3775
|
+
}
|
|
3677
3776
|
grid.calculateDimensions();
|
|
3678
3777
|
const finalizedGrid = finalizeBracketGrid(grid);
|
|
3679
3778
|
return {
|
|
@@ -4159,6 +4258,10 @@ var NewBracketComponent = class NewBracketComponent {
|
|
|
4159
4258
|
...ngDevMode ? { debugName: "rowRoundGap" } : /* istanbul ignore next */ {},
|
|
4160
4259
|
transform: numberAttribute
|
|
4161
4260
|
});
|
|
4261
|
+
this.thirdPlaceTopOffset = input(this.config.thirdPlaceTopOffset ?? null, {
|
|
4262
|
+
...ngDevMode ? { debugName: "thirdPlaceTopOffset" } : /* istanbul ignore next */ {},
|
|
4263
|
+
transform: (value) => value === null || value === void 0 || value === "" ? null : numberAttribute(value)
|
|
4264
|
+
});
|
|
4162
4265
|
this.lineStartingCurveAmount = input(this.config.lineStartingCurveAmount ?? 10, {
|
|
4163
4266
|
...ngDevMode ? { debugName: "lineStartingCurveAmount" } : /* istanbul ignore next */ {},
|
|
4164
4267
|
transform: numberAttribute
|
|
@@ -4232,6 +4335,7 @@ var NewBracketComponent = class NewBracketComponent {
|
|
|
4232
4335
|
layout: this.layout(),
|
|
4233
4336
|
finalMatchHeight: this.finalMatchHeight(),
|
|
4234
4337
|
finalColumnWidth: this.finalColumnWidth(),
|
|
4338
|
+
thirdPlaceTopOffset: this.thirdPlaceTopOffset(),
|
|
4235
4339
|
roundHeaderGap: this.hideRoundHeaders() ? 0 : this.roundHeaderGap(),
|
|
4236
4340
|
swissGroupPadding: this.swissGroupPadding(),
|
|
4237
4341
|
swissGroupBorderWidth: this.lineWidth(),
|
|
@@ -4397,6 +4501,13 @@ var NewBracketComponent = class NewBracketComponent {
|
|
|
4397
4501
|
isRequired: false,
|
|
4398
4502
|
transformFunction: null
|
|
4399
4503
|
},
|
|
4504
|
+
thirdPlaceTopOffset: {
|
|
4505
|
+
classPropertyName: "thirdPlaceTopOffset",
|
|
4506
|
+
publicName: "thirdPlaceTopOffset",
|
|
4507
|
+
isSignal: true,
|
|
4508
|
+
isRequired: false,
|
|
4509
|
+
transformFunction: null
|
|
4510
|
+
},
|
|
4400
4511
|
lineStartingCurveAmount: {
|
|
4401
4512
|
classPropertyName: "lineStartingCurveAmount",
|
|
4402
4513
|
publicName: "lineStartingCurveAmount",
|
|
@@ -4651,6 +4762,14 @@ i0.ɵɵngDeclareClassMetadata({
|
|
|
4651
4762
|
required: false
|
|
4652
4763
|
}]
|
|
4653
4764
|
}],
|
|
4765
|
+
thirdPlaceTopOffset: [{
|
|
4766
|
+
type: i0.Input,
|
|
4767
|
+
args: [{
|
|
4768
|
+
isSignal: true,
|
|
4769
|
+
alias: "thirdPlaceTopOffset",
|
|
4770
|
+
required: false
|
|
4771
|
+
}]
|
|
4772
|
+
}],
|
|
4654
4773
|
lineStartingCurveAmount: [{
|
|
4655
4774
|
type: i0.Input,
|
|
4656
4775
|
args: [{
|