@dcrackel/hematournamentui 1.0.124 → 1.0.126

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.
Files changed (33) hide show
  1. package/dist/HemaTournamentUI-lib.es.js +8331 -8210
  2. package/dist/HemaTournamentUI-lib.umd.js +28 -28
  3. package/package.json +1 -1
  4. package/src/mocks/getDEWithBouts.js +852 -0
  5. package/src/stories/Molecules/Boxes/CounterBox/CounterBox.vue +6 -2
  6. package/src/stories/Molecules/Indicators/ServerConnected/ServerConnected.stories.js +42 -0
  7. package/src/stories/Molecules/Indicators/ServerConnected/ServerConnected.vue +32 -0
  8. package/src/stories/Molecules/Inputs/Toggle/Toggle.stories.js +42 -0
  9. package/src/stories/Molecules/Inputs/Toggle/Toggle.vue +56 -0
  10. package/src/stories/Organisms/Cards/FencerPoolResultsCard/FencerPoolResults.stories.js +17 -7
  11. package/src/stories/Organisms/Cards/FencerPoolResultsCard/FencerPoolResultsCard.vue +6 -3
  12. package/src/stories/Organisms/Cards/TableauBoutCard/SpacingConfig.js +27 -0
  13. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +98 -0
  14. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +162 -0
  15. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +93 -0
  16. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +95 -0
  17. package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.stories.js +10 -0
  18. package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +3 -3
  19. package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +34 -0
  20. package/src/stories/Organisms/Containers/Tableau/Tableau.vue +68 -0
  21. package/src/stories/Organisms/Containers/TableauColumn/TabeauColumn.stories.js +37 -0
  22. package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +68 -0
  23. package/src/stories/Organisms/Containers/TableauLines/SpacingConfig.js +29 -0
  24. package/src/stories/Organisms/Containers/TableauLines/TableauLines.stories.js +23 -0
  25. package/src/stories/Organisms/Containers/TableauLines/TableauLines.vue +80 -0
  26. package/src/stories/Organisms/Headers/PoolResultsHeader/PoolResultsHeader.stories.js +6 -11
  27. package/src/stories/Organisms/Headers/PoolResultsHeader/PoolResultsHeader.vue +7 -3
  28. package/src/stories/Organisms/Headers/ToggleHeader/ToggleHeader.vue +28 -5
  29. package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +39 -0
  30. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +211 -0
  31. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +4 -7
  32. package/src/stories/Templates/EventManagement/PoolResults/PoolResults.stories.js +9 -0
  33. package/tailwind.config.js +23 -2
@@ -0,0 +1,95 @@
1
+ <!-- TableauFencerCard.vue -->
2
+ <template>
3
+ <section class="bg-poolSetup flex shadow-lg rounded-md border" @mouseover="handleHighLight(true)" @mouseout="handleHighLight(false)" :class="[width, highLighted]">
4
+ <!-- Left position -->
5
+ <div class="text-center px-1 w-5 flex items-center justify-center rounded-l-md z-50" :class="`bg-${color}`">
6
+ <BaseText :text="position" size="xs" color="neutral"/>
7
+ </div>
8
+
9
+ <div class="flex w-full items-center">
10
+ <!-- Portrait and Name/Club -->
11
+ <div class="flex w-full">
12
+ <div v-if="large" class="">
13
+ <div v-if="!portraitURL" class="w-9 h-9 rounded-r-md bg-dropdownSelect flex items-center justify-center">
14
+ <BaseText text="" size="sm" color="neutral" weight="bold"/>
15
+ </div>
16
+ <img v-if="portraitURL" :src="portraitURL" alt="Portrait" class="w-9 h-9 rounded-r-md">
17
+ </div>
18
+ <div class="flex flex-col justify-center ml-2">
19
+ <BaseText :text="name" :size="large ? 'sm' : 'xs'" :weight="large ? 'bold' : 'normal'"/>
20
+ <BaseText v-if="club.length > 1 && large" :text="club" size="xs"/>
21
+ </div>
22
+ </div>
23
+ </div>
24
+
25
+ <!-- Right position (Score) -->
26
+ <div class="text-center px-1 w-5 flex items-center justify-center rounded-r-md" :class="scoreColor">
27
+ <BaseText :text="score" size="xs" color="neutral"/>
28
+ </div>
29
+ </section>
30
+ </template>
31
+
32
+ <script>
33
+ import BaseText from "../../../Atoms/Text/BaseText.vue";
34
+
35
+ export default {
36
+ name: 'TableauFencerCard',
37
+ components: { BaseText },
38
+ props: {
39
+ fencer: {
40
+ type: Object,
41
+ required: true
42
+ },
43
+ score: {
44
+ type: String,
45
+ required: true
46
+ },
47
+ position: {
48
+ type: [String, Number],
49
+ required: true
50
+ },
51
+ color: {
52
+ type: String,
53
+ required: true
54
+ },
55
+ scoreColor: {
56
+ type: String,
57
+ required: true
58
+ },
59
+ large: {
60
+ type: Boolean,
61
+ default: true
62
+ },
63
+ highLight: {
64
+ type: Boolean,
65
+ default: false
66
+ }
67
+ },
68
+ computed: {
69
+ portraitURL() {
70
+ const images = this.fencer.Images || [];
71
+ const portrait = images.find(image => image.URL);
72
+ return portrait ? portrait.URL : '';
73
+ },
74
+ name() {
75
+ //if (this.fencer.DisplayName === "BYE") return "";
76
+ return this.fencer.DisplayName;
77
+ },
78
+ club() {
79
+ if (this.fencer.DisplayName === "BYE" || this.fencer.DisplayName === "") return "";
80
+ return this.fencer.Club.Name;
81
+ },
82
+ width() {
83
+ return this.large ? ' w-72' : ' w-40';
84
+ },
85
+ highLighted() {
86
+ return this.highLight ? 'border-bright' : 'border-poolSetup';
87
+ }
88
+ },
89
+ methods: {
90
+ handleHighLight(value) {
91
+ this.$emit('action:highLight', value)
92
+ }
93
+ }
94
+ };
95
+ </script>
@@ -49,6 +49,16 @@ export const PromoteHalf = {
49
49
  }
50
50
  }
51
51
 
52
+ modifiedEvent = {...eventPersonGetPoolAssignmentEvent, Status: "de"}
53
+ export const NotResultsStatus = {
54
+ args: {
55
+ poolResults: getPoolResults.report,
56
+ initialCutoffIndex: 0,
57
+ numPromoted: "100%",
58
+ event: modifiedEvent
59
+ }
60
+ }
61
+
52
62
  modifiedEvent = {...eventPersonGetPoolAssignmentEvent, Status: "preparation"}
53
63
  export const EventIsInPreparationMode = {
54
64
  args: {
@@ -13,7 +13,7 @@
13
13
 
14
14
  <div v-if="shouldShowResults" v-for="(person, index) in results" :key="person.personId" class="flex flex-col py-1">
15
15
  <!-- Person Card -->
16
- <FencerPoolResultsCard :person="person" @remove:person="handleWithdraw" />
16
+ <FencerPoolResultsCard :person="person" @remove:person="handleWithdraw" :status="event.Status"/>
17
17
 
18
18
  <!-- Draggable Line -->
19
19
  <div v-if="shouldShowBar(index)" class="relative flex justify-center p-0.5 mt-4 mb-2 border border-dropdownSelect rounded-lg">
@@ -75,7 +75,7 @@ export default {
75
75
  },
76
76
  computed: {
77
77
  shouldShowResults() {
78
- return ['results', 'de', 'completed'].includes(this.event.Status.toLowerCase());
78
+ return this.event.Status && ["results", "de", "completed"].includes(this.event.Status.toLowerCase());
79
79
  }
80
80
  },
81
81
  methods: {
@@ -102,7 +102,7 @@ export default {
102
102
  this.$emit('update:withdraw', person);
103
103
  },
104
104
  shouldShowBar(index) {
105
- return index === this.cutoffIndex && this.cutoffIndex > 0 && this.cutoffIndex < this.results.length - 1;
105
+ return index === this.cutoffIndex && this.cutoffIndex > 0 && this.cutoffIndex < this.results.length - 1 && this.event.Status === 'results';
106
106
  }
107
107
  }
108
108
  }
@@ -0,0 +1,34 @@
1
+ import Tableau from './Tableau.vue';
2
+ import getDEWithBouts from '../../../../mocks/getDEWithBouts.js';
3
+
4
+ export default {
5
+ title: 'Organisms/Containers/Tableau',
6
+ component: Tableau,
7
+ args: {
8
+ bouts: getDEWithBouts.pools[0].Bouts,
9
+ bracketSize: getDEWithBouts.pools[0].Bouts[0].RoundLabel,
10
+ hostingClubColors: getDEWithBouts.hostingClubColors
11
+ },
12
+ argTypes: {
13
+ bouts: {
14
+ control: 'array',
15
+ description: 'Array of bracket objects to display',
16
+ },
17
+ bracketSize: {
18
+ control: 'string',
19
+ description: 'sets spacing for bracket connector lines',
20
+ },
21
+ hostingClubColors: {
22
+ control: 'object'
23
+ }
24
+ }
25
+ };
26
+
27
+ export const Default = {
28
+ args: {
29
+ bouts: getDEWithBouts.pools[0].Bouts,
30
+ bracketSize: getDEWithBouts.pools[0].Bouts[0].RoundLabel,
31
+ hostingClubColors: getDEWithBouts.hostingClubColors,
32
+ }
33
+ };
34
+
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <section class="w-full overflow-x-auto mt-4">
3
+ <div class="min-w-full flex justify-center">
4
+ <div v-for="(bouts, roundName) in groupedBouts" :key="roundName">
5
+ <TableauColumn :bouts="bouts"
6
+ :hostingClubColors="hostingClubColors"
7
+ :roundName="roundName"
8
+ :bracketSize="bracketSize"
9
+ :largeCards="largeCards"
10
+ @action:editBout="handleEditBout"
11
+ @action:directingBout="handleDirectorBout"
12
+ />
13
+ </div>
14
+ </div>
15
+ </section>
16
+ </template>
17
+
18
+ <script>
19
+ import TableauColumn from "../TableauColumn/TableauColumn.vue";
20
+ import TableauBoutCard from "../../Cards/TableauBoutCard/TableauBoutCard.vue";
21
+
22
+ export default {
23
+ name: 'Tableau',
24
+ components: {TableauBoutCard, TableauColumn },
25
+ props: {
26
+ bouts: {
27
+ type: Array,
28
+ required: true
29
+ },
30
+ bracketSize: {
31
+ type: String,
32
+ required: true
33
+ },
34
+ hostingClubColors: {
35
+ type: Object,
36
+ required: true
37
+ },
38
+ largeCards: {
39
+ type: Boolean,
40
+ required: true
41
+ }
42
+ },
43
+ computed: {
44
+ groupedBouts() {
45
+ return this.groupBoutsByRound(this.bouts);
46
+ },
47
+ },
48
+ methods: {
49
+ handleEditBout(bout) {
50
+ console.log('Tableau:handleEditBout', bout)
51
+ this.$emit('action:directingBout', bout)
52
+ },
53
+ handleDirectorBout(bout) {
54
+ console.log('Tableau:handleDirectorBout', bout)
55
+ this.$emit('action:editBout', bout)
56
+ },
57
+ groupBoutsByRound(bouts) {
58
+ return bouts.reduce((acc, bout) => {
59
+ if (!acc[bout.RoundLabel]) {
60
+ acc[bout.RoundLabel] = [];
61
+ }
62
+ acc[bout.RoundLabel].push(bout);
63
+ return acc;
64
+ }, {});
65
+ }
66
+ }
67
+ };
68
+ </script>
@@ -0,0 +1,37 @@
1
+ import TableauColumn from './TableauColumn.vue';
2
+ import getDEWithBouts from '../../../../mocks/getDEWithBouts.js';
3
+
4
+ export default {
5
+ title: 'Organisms/Containers/TableauColumn',
6
+ component: TableauColumn,
7
+ args: {
8
+ bouts: getDEWithBouts.pools[0].Bouts.filter(bout => bout.RoundLabel === 'Table of 8'),
9
+ roundName: 'Table of 8',
10
+ bracketSize: getDEWithBouts.pools[0].Bouts[0].RoundLabel,
11
+ hostingClubColors: getDEWithBouts.hostingClubColors
12
+ },
13
+ argTypes: {
14
+ bouts: {
15
+ control: 'array',
16
+ description: 'Array of bracket objects to display',
17
+ bracketSize: 'Table of 8',
18
+ },
19
+ bracketSize: {
20
+ control: 'text',
21
+ description: 'Sets spacing for connector lines',
22
+ },
23
+ hostingClubColors: {
24
+ control: 'object'
25
+ }
26
+ }
27
+ };
28
+
29
+ export const Default = {
30
+ args: {
31
+ bouts: getDEWithBouts.pools[0].Bouts.filter(bout => bout.RoundLabel === 'Table of 8'),
32
+ hostingClubColors: getDEWithBouts.hostingClubColors,
33
+ bracketSize: getDEWithBouts.pools[0].Bouts[0].RoundLabel,
34
+ roundName: 'Table of 8'
35
+ }
36
+ };
37
+
@@ -0,0 +1,68 @@
1
+ <template>
2
+ <section>
3
+ <div v-if="roundName !== 'Third Place' && roundName !== 'Final'" class="flex justify-center mb-4 border-b" :class="largeCards ? 'w-72' : 'w-40' ">
4
+ <BaseText :text="roundName" size="sm" color="quaternary" />
5
+ </div>
6
+ <div v-for="(bout, index) in bouts" :key="index" class="flex">
7
+ <TableauBoutCard :bout="bout"
8
+ :hostingClubColors="hostingClubColors"
9
+ :roundName="roundName"
10
+ :large="largeCards"
11
+ :bracketSize="bracketSize"
12
+ @action:editBout="handleEditBout"
13
+ @action:directingBout="handleDirectorBout"
14
+ />
15
+ <TableauLines :roundName="roundName" :large="largeCards" :bracketSize="bracketSize"/>
16
+ </div>
17
+ </section>
18
+ </template>
19
+
20
+ <script>
21
+ import TableauBoutCard from "../../Cards/TableauBoutCard/TableauBoutCard.vue";
22
+ import BaseText from "../../../Atoms/Text/BaseText.vue";
23
+ import TableauLines from "../TableauLines/TableauLines.vue";
24
+
25
+ export default {
26
+ name: 'TableauColumn',
27
+ components: { TableauLines, BaseText, TableauBoutCard },
28
+ props: {
29
+ bouts: {
30
+ type: Array,
31
+ required: true
32
+ },
33
+ hostingClubColors: {
34
+ type: Object,
35
+ required: true
36
+ },
37
+ roundName: {
38
+ type: String,
39
+ required: true
40
+ },
41
+ bracketSize: {
42
+ type: String,
43
+ required: true
44
+ },
45
+ largeCards: {
46
+ type: Boolean,
47
+ required: true
48
+ }
49
+ },
50
+ data() {
51
+ return {
52
+ finalLineShown: true
53
+ };
54
+ },
55
+ computed: {
56
+ },
57
+ methods: {
58
+ handleEditBout(bout) {
59
+ console.log('TableauColumn:handleEditBout', bout)
60
+ this.$emit('action:directingBout', bout)
61
+ },
62
+ handleDirectorBout(bout) {
63
+ console.log('TableauColumn:handleDirectorBout', bout)
64
+ this.$emit('action:editBout', bout)
65
+ }
66
+ }
67
+ };
68
+ </script>
@@ -0,0 +1,29 @@
1
+ // spacingConfig.js
2
+ export const spacingConfig = {
3
+ 'Table of 8': {
4
+ 'large': {
5
+ 'Table of 8': { getTopSpace: 'mt-[0rem]', getConnectorHeight: 'h-[2.7rem]', getTopSpaceForLine: 'mt-[1.2rem]' },
6
+ Quarterfinal: { getTopSpace: 'mt-[1.3rem]', getConnectorHeight: 'h-[6.5rem]', getTopSpaceForLine: 'mt-[3.25rem]' },
7
+ Semifinal: { getTopSpace: 'mt-[5.5rem]', getConnectorHeight: 'h-[14.5rem]', getTopSpaceForLine: '' },
8
+ Final: { getTopSpace: 'h-[6rem] mt-[22rem] -ml-[309px]', getBottomLine: 'h-[6rem] mt-[2.5rem] -ml-[309px]' },
9
+ 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' },
10
+ },
11
+ 'small': {
12
+ 'Table of 8': { getTopSpace: '-mt-[0.6rem]', getConnectorHeight: 'h-[1.5rem]', getTopSpaceForLine: 'mt-[0.6rem]' },
13
+ Quarterfinal: { getTopSpace: 'mt-[0rem]', getConnectorHeight: 'h-[3.5rem]', getTopSpaceForLine: 'mt-[1.6rem]' },
14
+ Semifinal: { getTopSpace: 'mt-[2.8rem]', getConnectorHeight: 'h-[7.2rem]', getTopSpaceForLine: 'mt-[3.8rem]' },
15
+ Final: { getTopSpace: 'h-[6rem] mt-[9.1rem] -ml-[181px]', getBottomLine: 'h-[3rem] mt-[1.4rem] -ml-[181px]' },
16
+ 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' },
17
+ }
18
+ },
19
+
20
+ TableOf16: {
21
+ large: {
22
+ // Define your spacing values here
23
+ },
24
+ small: {
25
+ // Define your spacing values here
26
+ }
27
+ },
28
+ // Add up to Table of 256 as needed
29
+ };
@@ -0,0 +1,23 @@
1
+ import TableauLines from './TableauLines.vue';
2
+
3
+ export default {
4
+ title: 'Organisms/Containers/TableauLines',
5
+ component: TableauLines,
6
+ args: {
7
+ roundName: 'Table of 8',
8
+ },
9
+ argTypes: {
10
+ roundName: {
11
+ control: 'string',
12
+ description: 'Name of the round to display'
13
+
14
+ }
15
+ }
16
+ };
17
+
18
+ export const Default = {
19
+ args: {
20
+ roundName: 'Table of 8',
21
+ }
22
+ };
23
+
@@ -0,0 +1,80 @@
1
+ <template>
2
+ <section v-if="roundName !== 'Semifinal' && roundName !== 'Final'" class="flex" :class="getTopSpace">
3
+ <div class="mt-[1.1rem]">
4
+ <div class="border-t border-b border-r w-5 rounded-md -ml-[0.3rem] z-0" :class="getConnectorHeight"></div>
5
+ </div>
6
+ <div :class="getTopSpaceForLine">
7
+ <div class="border-b w-5 h-5"></div>
8
+ </div>
9
+ </section>
10
+
11
+ <section v-if="roundName === 'Semifinal'" class="flex mr-5" >
12
+ <div class="flex flex-col -ml-1" :class="getTopSpace">
13
+ <div class="border-t border-b border-r w-5 rounded-md z-0" :class="getConnectorHeight"></div>
14
+ </div>
15
+ </section>
16
+
17
+ <section v-if="roundName === 'Final'" class="flex flex-col mr-5" >
18
+ <div class="border-b border-l w-6 rounded-bl-md z-0 h-[6rem]" :class="getTopSpace" ></div>
19
+ <div class="border-t border-l w-6 rounded-tl-md z-0 h-[6rem]" :class="getBottomLine" ></div>
20
+ </section>
21
+
22
+ </template>
23
+
24
+ <script>
25
+ import { spacingConfig } from './SpacingConfig';
26
+
27
+ export default {
28
+ name: 'TableauLines',
29
+ props: {
30
+ roundName: {
31
+ type: String,
32
+ required: true
33
+ },
34
+ bracketSize: {
35
+ type: String,
36
+ required: true
37
+ },
38
+ large: {
39
+ type: Boolean,
40
+ default: true
41
+ },
42
+ },
43
+ watch: {
44
+ large(newVal, oldVal) {
45
+ if (newVal !== oldVal) {
46
+ this.updateConfig();
47
+ }
48
+ }
49
+ },
50
+ data() {
51
+ return {
52
+ currentConfig: {}
53
+ };
54
+ },
55
+ mounted() {
56
+ this.updateConfig();
57
+ },
58
+ computed: {
59
+ getTopSpace() {
60
+ return this.currentConfig?.getTopSpace || '';
61
+ },
62
+ getTopSpaceForLine() {
63
+ return this.currentConfig?.getTopSpaceForLine || '';
64
+ },
65
+ getConnectorHeight() {
66
+ return this.currentConfig?.getConnectorHeight || '';
67
+ },
68
+ getBottomLine() {
69
+ return this.currentConfig?.getBottomLine || '';
70
+ }
71
+ },
72
+ methods: {
73
+ updateConfig() {
74
+ console.log('updateConfig', this.large, this.roundName, this.bracketSize);
75
+ const size = this.large ? 'large' : 'small';
76
+ this.currentConfig = spacingConfig[this.bracketSize]?.[size]?.[this.roundName] || {};
77
+ }
78
+ },
79
+ };
80
+ </script>
@@ -16,23 +16,18 @@ export default {
16
16
  }
17
17
  };
18
18
 
19
+ let modifiedEvent = {...eventPersonGetPoolAssignmentEvent, Status: "results"}
19
20
  export const Default = {
20
21
  args: {
21
- event:eventPersonGetPoolAssignmentEvent,
22
+ event:modifiedEvent,
22
23
  numPromoted: getPoolResults.numPromoted
23
24
  }
24
25
  }
25
26
 
26
- export const preparingMode = {
27
+ modifiedEvent = {...eventPersonGetPoolAssignmentEvent, Status: "de"}
28
+ export const notInResultsMode = {
27
29
  args: {
28
- event:eventPersonGetPoolAssignmentEvent,
29
- numPromoted: getPoolResults.numPromoted
30
+ event:modifiedEvent,
31
+ numPromoted: getPoolResults.numPromoted,
30
32
  }
31
33
  }
32
-
33
- export const liveMode = {
34
- args: {
35
- event:eventPersonGetPoolAssignmentEvent,
36
- numPromoted: getPoolResults.numPromoted
37
- }
38
- }
@@ -38,7 +38,7 @@
38
38
  </section>
39
39
 
40
40
  <section class="flex flex-row w-1/3 justify-end">
41
- <CounterBox :recommended="101" :count="promoted" label="Promoted" :textColor="'quaternary'" :centerInput="true" :directInput="true"
41
+ <CounterBox :recommended="101" :count="promoted" label="Promoted" :textColor="'quaternary'" :centerInput="true" :directInput="true" :disable="mode !== 'results'"
42
42
  @update:increaseCount="handleIncreaseCount"
43
43
  @update:decreaseCount="handleDecreaseCount"
44
44
  />
@@ -77,10 +77,14 @@ export default {
77
77
  },
78
78
  methods: {
79
79
  handleIncreaseCount(numPromoted) {
80
- this.$emit('update:handleIncreaseCount', numPromoted);
80
+ if (this.event.Status === 'results') {
81
+ this.$emit('update:handleIncreaseCount', numPromoted);
82
+ }
81
83
  },
82
84
  handleDecreaseCount(numPromoted) {
83
- this.$emit('update:handleDecreaseCount', numPromoted);
85
+ if (this.event.Status === 'results') {
86
+ this.$emit('update:handleDecreaseCount', numPromoted);
87
+ }
84
88
  }
85
89
  },
86
90
  };
@@ -1,4 +1,5 @@
1
1
  <template>
2
+ <section class="flex flex-col">
2
3
  <div class="bg-bannerBackground px-4 py-4 rounded-xl flex justify-center border border-dropdownSelect">
3
4
  <section class="flex flex-row w-3/4 justify-center bg-poolBox rounded-lg p-0.5 border border-dropdownSelect">
4
5
  <BaseButton
@@ -19,14 +20,21 @@
19
20
  />
20
21
  </section>
21
22
  </div>
23
+ <div class="flex w-full justify-between">
24
+ <ServerConnected :connectedToServer="connectedToServer" />
25
+ <Toggle v-if="showToggle" :checked="largeCards" label="Bracket Size" @update:checked="handleCardSizeToggle" />
26
+ </div>
27
+ </section>
22
28
  </template>
23
29
 
24
30
  <script>
25
31
  import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
32
+ import ServerConnected from "../../../Molecules/Indicators/ServerConnected/ServerConnected.vue";
33
+ import Toggle from "../../../Molecules/Inputs/Toggle/Toggle.vue";
26
34
 
27
35
  export default {
28
36
  name: 'ToggleHeader',
29
- components: { BaseButton },
37
+ components: {Toggle, ServerConnected, BaseButton },
30
38
  props: {
31
39
  firstButtonLabel: {
32
40
  type: String,
@@ -39,14 +47,25 @@ export default {
39
47
  currentSelection: {
40
48
  type: String,
41
49
  required: true,
42
- // validator(value) {
43
- // return [this.firstButtonLabel, this.secondButtonLabel].includes(value);
44
- // }
50
+ },
51
+ connectedToServer: {
52
+ type: Boolean,
53
+ required: true
54
+ },
55
+ showToggle: {
56
+ type: Boolean,
57
+ default: false
58
+ },
59
+ showLargeCards: {
60
+ type: Boolean,
61
+ default: true
45
62
  }
63
+
46
64
  },
47
65
  data() {
48
66
  return {
49
- view: this.currentSelection
67
+ view: this.currentSelection,
68
+ largeCards: this.showLargeCards
50
69
  };
51
70
  },
52
71
  watch: {
@@ -58,6 +77,10 @@ export default {
58
77
  handleSelection(selection) {
59
78
  this.view = selection;
60
79
  this.$emit('update:selection', selection);
80
+ },
81
+ handleCardSizeToggle(value) {
82
+ this.largeCards = !this.largeCards;
83
+ this.$emit('update:cardSize', value)
61
84
  }
62
85
  }
63
86
  };
@@ -0,0 +1,39 @@
1
+ import Bracket from './Bracket.vue';
2
+ import getDEWithBouts from '../../../../mocks/getDEWithBouts.js';
3
+
4
+ export default {
5
+ title: 'Templates/EventManagement/Bracket',
6
+ component: Bracket,
7
+ tags: ['Bracket'],
8
+ args: {
9
+ bouts: getDEWithBouts.pools[0].Bouts,
10
+ eventRules: getDEWithBouts.eventRules,
11
+ hostingClubColors: getDEWithBouts.hostingClubColors,
12
+ connectedToServer: true
13
+ },
14
+ argTypes: {
15
+ bouts: {
16
+ control: Object
17
+ },
18
+ eventRules: {
19
+ control: Object
20
+ },
21
+ hostingClubColors: {
22
+ control: Object
23
+ },
24
+ connectedToServer: {
25
+ control: Boolean
26
+ }
27
+ },
28
+ };
29
+
30
+
31
+ export const Default = {
32
+ args: {
33
+ bouts: getDEWithBouts.pools[0].Bouts,
34
+ eventRules: getDEWithBouts.eventRules,
35
+ hostingClubColors: getDEWithBouts.hostingClubColors,
36
+ connectedToServer: true
37
+ }
38
+ };
39
+