playbook_ui 14.16.0.pre.alpha.PLAY1929bracketlayout6930 → 14.16.0.pre.alpha.PLAY1929bracketlayout6957

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d9d5e98cc39044286ea907a7571c235705d22846b338d0cfd968cc240ea2cdc7
4
- data.tar.gz: 0d0cfeb97e0db01704458b47c1f7625695185dc0515df7cd2f6342b7b131d33d
3
+ metadata.gz: 7b2af193a12246de5703b901c49abeac27c44fa9d2c8f76f5bafc6fccc4f8858
4
+ data.tar.gz: b8913aebce80550bed950ff30380139f02e336c19fc83cbab919ee146e06df42
5
5
  SHA512:
6
- metadata.gz: c21da69e3465628cdd5ed615ef5015bff969d5ee0bf183410f2603a33f00459cad63376c9fcc160052b29e5e94ee8cac73cf3129a22dbe1743d5c7523010453c
7
- data.tar.gz: 74a02f7483b1d8ec893de6391285077011143c920a83e37811adb61f0b8673661d0d9d31aed053659aa650f8913428aa1cbe273cc74fa090ab7033e32655a7fb
6
+ metadata.gz: 99dcf0a34d39614db573f5166bf05c64bc7036e9681aa84f81dd634cbb330fcbe6b78b1d68765a0d0bfca0f62af8b1607f8655e2e41da5ab4f798959ec0fec4b
7
+ data.tar.gz: 298f4b8f42a9544aba7aafc308f0abb183a1e6297ee1ad6510ac0035dae60b44b0e6b05aaac676a15e7bd2313f5365b7566550e27f84d2418b2e3438893001eb
@@ -176,7 +176,11 @@ const Layout = (props: LayoutPropTypes) => {
176
176
  (child: React.ReactElement & {type: {displayName: string}}) => child.type?.displayName !== 'Side'
177
177
  )
178
178
 
179
- const numberOfRounds = Array.isArray(nonSideChildren) ? nonSideChildren.filter((child: any) => child.type?.name === 'Round').length : 0
179
+ const numberOfRounds = Array.isArray(nonSideChildren) ? React.Children.toArray(children).filter(
180
+ (child) => {
181
+ return (child as React.ReactElement).type === Layout.Round;
182
+ }
183
+ ).length : 0
180
184
  const bracketChildren = nonSideChildren.map(child =>
181
185
  React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds }) : child
182
186
  )
@@ -33,7 +33,7 @@ export const Round = (props: LayoutRoundProps) => {
33
33
  const numberOfChildren = Array.isArray(children) ? children.length : 0
34
34
 
35
35
  const childrenWithProps = Array.isArray(children) ? children.map((child, index) =>
36
- React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds, numberOfGames: numberOfChildren, isOdd: index % 2 === 0 }) : child
36
+ React.isValidElement(child) ? React.cloneElement(child, { numberOfRounds, numberOfGames: numberOfChildren, isOdd: index % 2 === 0, key: `child_${index}` }) : child
37
37
  ) : children
38
38
 
39
39
  const rightConnectors = Array.from({ length: numberOfChildren / 2 }, (_, index) => (