@dcrackel/hematournamentui 1.0.707 → 1.0.708
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/AGENTS.md +118 -118
- package/dist/HemaTournamentUI-lib.es.js +4483 -4618
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +185 -406
- package/package.json +10 -10
- package/src/index.js +2 -0
- package/src/mocks/getDEBouts-42Fencers.js +4 -4
- package/src/mocks/getDEBouts-TableOf128.js +37 -0
- package/src/mocks/getDEBouts-TableOf64.js +35 -0
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -0
- package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -0
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +3 -2
- package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +1 -1
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -0
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -0
- package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -0
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -278
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +60 -98
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +103 -4
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +256 -215
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -92
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -128
- package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +14 -4
- package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +2 -2
- package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +131 -3
- package/src/stories/Organisms/Containers/Tableau/Tableau.vue +287 -89
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -0
- package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -0
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -0
- package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -0
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -0
- package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -0
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +57 -0
- package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +65 -0
- package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +31 -29
- package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +146 -18
- package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +52 -2
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +53 -17
- package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +39 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -0
- package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -0
- package/src/stories/Organisms/Cards/TableauBoutCard/SpacingConfig.js +0 -111
- package/src/stories/Organisms/Containers/TableauLines/SpacingConfig.js +0 -162
- package/src/stories/Organisms/Containers/TableauLines/TableauLines.stories.js +0 -21
- package/src/stories/Organisms/Containers/TableauLines/TableauLines.vue +0 -78
|
@@ -1,215 +1,256 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<section
|
|
3
|
-
<div
|
|
4
|
-
v-if="
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
>
|
|
8
|
-
<BaseText :text="
|
|
9
|
-
</div>
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
:
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
return this.bout.
|
|
178
|
-
},
|
|
179
|
-
|
|
180
|
-
return
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
return this.bout.
|
|
184
|
-
},
|
|
185
|
-
score2() {
|
|
186
|
-
return
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
);
|
|
212
|
-
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<section v-if="showBout" class="relative w-40">
|
|
3
|
+
<div
|
|
4
|
+
v-if="showRingLabel"
|
|
5
|
+
data-testid="active-ring"
|
|
6
|
+
class="pointer-events-none absolute -top-4 left-0 z-20 flex h-4 w-40 items-center rounded-t bg-primary px-2"
|
|
7
|
+
>
|
|
8
|
+
<BaseText :text="ringName" size="xs" color="neutral" weight="bold" class="truncate uppercase" />
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<div class="relative w-40 text-left" :class="{ 'opacity-70': !isSelectable }">
|
|
12
|
+
<TableauFencerCard
|
|
13
|
+
:fencer="person1Display"
|
|
14
|
+
:score="score1"
|
|
15
|
+
:position="dePosition1"
|
|
16
|
+
:color="hostingClubColors.Color1"
|
|
17
|
+
:scoreColor="getScoreColor('person1')"
|
|
18
|
+
:showScore="showScore1"
|
|
19
|
+
:isCountingBackwardsMaxScore="isCountingBackwardsMaxScore"
|
|
20
|
+
corners="top"
|
|
21
|
+
/>
|
|
22
|
+
|
|
23
|
+
<div class="relative h-px bg-dropdownSelect">
|
|
24
|
+
<span
|
|
25
|
+
:ref="element => registerAnchor('input', element)"
|
|
26
|
+
class="pointer-events-none absolute left-0 top-1/2 h-px w-px -translate-y-1/2 opacity-0"
|
|
27
|
+
></span>
|
|
28
|
+
<span
|
|
29
|
+
:ref="element => registerAnchor('output', element)"
|
|
30
|
+
class="pointer-events-none absolute right-0 top-1/2 h-px w-px -translate-y-1/2 opacity-0"
|
|
31
|
+
></span>
|
|
32
|
+
</div>
|
|
33
|
+
|
|
34
|
+
<TableauFencerCard
|
|
35
|
+
:fencer="person2Display"
|
|
36
|
+
:score="score2"
|
|
37
|
+
:position="dePosition2"
|
|
38
|
+
:color="hostingClubColors.Color2"
|
|
39
|
+
:scoreColor="getScoreColor('person2')"
|
|
40
|
+
:showScore="showScore2"
|
|
41
|
+
:isCountingBackwardsMaxScore="isCountingBackwardsMaxScore"
|
|
42
|
+
corners="bottom"
|
|
43
|
+
/>
|
|
44
|
+
<button
|
|
45
|
+
type="button"
|
|
46
|
+
data-testid="tableau-bout"
|
|
47
|
+
class="absolute inset-0 z-10 w-40 rounded text-left shadow-md outline-none ring-1 ring-transparent transition hover:shadow-lg hover:ring-2 hover:ring-bright focus-visible:ring-2 focus-visible:ring-bright disabled:cursor-default"
|
|
48
|
+
:disabled="!isSelectable"
|
|
49
|
+
:aria-label="boutLabel"
|
|
50
|
+
@click="handleBoutClick"
|
|
51
|
+
></button>
|
|
52
|
+
</div>
|
|
53
|
+
|
|
54
|
+
<div
|
|
55
|
+
v-if="showActiveChrome"
|
|
56
|
+
data-testid="active-time"
|
|
57
|
+
class="pointer-events-none absolute left-full top-1/2 z-20 flex h-[57px] w-10 -translate-y-1/2 items-center justify-center rounded-r-md bg-primary px-1"
|
|
58
|
+
>
|
|
59
|
+
<BaseText :text="displayTime" size="xs" color="neutral" weight="bold" class="font-sourceCodePro" />
|
|
60
|
+
</div>
|
|
61
|
+
</section>
|
|
62
|
+
</template>
|
|
63
|
+
|
|
64
|
+
<script>
|
|
65
|
+
import BaseText from '../../../Atoms/Text/BaseText.vue';
|
|
66
|
+
import TableauFencerCard from '../TableauFencerCard/TableauFencerCard.vue';
|
|
67
|
+
|
|
68
|
+
const EMPTY_FENCER = { DisplayName: '', Club: { Name: '' }, EventPersons: [] };
|
|
69
|
+
|
|
70
|
+
const getFencerName = fencer => String(fencer?.DisplayName || '');
|
|
71
|
+
const isByeName = fencer => getFencerName(fencer).toUpperCase() === 'BYE';
|
|
72
|
+
const isMissingFencer = fencer => !fencer?.PersonId || Number(fencer.PersonId) === 0;
|
|
73
|
+
const isUnavailableFencer = fencer => isMissingFencer(fencer) || isByeName(fencer);
|
|
74
|
+
const isCompletedBout = bout => String(bout?.Status || '').toLowerCase() === 'completed';
|
|
75
|
+
const getNumericScore = score => Number(score ?? 0);
|
|
76
|
+
const normalizeSeconds = value => Math.max(0, Number(value) || 0);
|
|
77
|
+
const formatSeconds = value => {
|
|
78
|
+
const seconds = normalizeSeconds(value);
|
|
79
|
+
return `${Math.floor(seconds / 60)}:${String(seconds % 60).padStart(2, '0')}`;
|
|
80
|
+
};
|
|
81
|
+
const isRunningActiveBout = bout =>
|
|
82
|
+
String(bout?.Status || '').toLowerCase() === 'active' && String(bout?.TimerStatus || '').toLowerCase() === 'running';
|
|
83
|
+
|
|
84
|
+
const scoreColorRules = {
|
|
85
|
+
person1: [
|
|
86
|
+
{ matches: bout => !isByeName(bout.Person1) && isByeName(bout.Person2), color: 'bg-winGreen' },
|
|
87
|
+
{ matches: bout => getNumericScore(bout.Score1) > getNumericScore(bout.Score2), color: 'bg-winGreen' },
|
|
88
|
+
{
|
|
89
|
+
matches: bout =>
|
|
90
|
+
getNumericScore(bout.Score1) < getNumericScore(bout.Score2) && String(bout.Status).toLowerCase() === 'active',
|
|
91
|
+
color: 'bg-lossRed'
|
|
92
|
+
}
|
|
93
|
+
],
|
|
94
|
+
person2: [
|
|
95
|
+
{ matches: bout => !isByeName(bout.Person2) && isByeName(bout.Person1), color: 'bg-winGreen' },
|
|
96
|
+
{ matches: bout => getNumericScore(bout.Score2) > getNumericScore(bout.Score1), color: 'bg-winGreen' },
|
|
97
|
+
{
|
|
98
|
+
matches: bout =>
|
|
99
|
+
getNumericScore(bout.Score2) < getNumericScore(bout.Score1) && String(bout.Status).toLowerCase() === 'active',
|
|
100
|
+
color: 'bg-lossRed'
|
|
101
|
+
}
|
|
102
|
+
]
|
|
103
|
+
};
|
|
104
|
+
|
|
105
|
+
const getMatchingScoreColor = (bout, fencerKey) =>
|
|
106
|
+
scoreColorRules[fencerKey].find(rule => rule.matches(bout))?.color || 'bg-dropdownSelect';
|
|
107
|
+
|
|
108
|
+
const getDisplayFencer = (bout, fencer) => {
|
|
109
|
+
if (!fencer) return EMPTY_FENCER;
|
|
110
|
+
if (String(bout.Status).toLowerCase() !== 'scheduled' || !isByeName(fencer)) return fencer;
|
|
111
|
+
return { ...fencer, DisplayName: '', Club: { Name: '' } };
|
|
112
|
+
};
|
|
113
|
+
|
|
114
|
+
export default {
|
|
115
|
+
name: 'TableauBoutCard',
|
|
116
|
+
components: { BaseText, TableauFencerCard },
|
|
117
|
+
emits: ['action:directingBout', 'action:editBout', 'register-node-anchor'],
|
|
118
|
+
props: {
|
|
119
|
+
bout: {
|
|
120
|
+
type: Object,
|
|
121
|
+
required: true
|
|
122
|
+
},
|
|
123
|
+
hostingClubColors: {
|
|
124
|
+
type: Object,
|
|
125
|
+
required: true
|
|
126
|
+
},
|
|
127
|
+
roundName: {
|
|
128
|
+
type: String,
|
|
129
|
+
required: true
|
|
130
|
+
},
|
|
131
|
+
bracketSize: {
|
|
132
|
+
type: String,
|
|
133
|
+
required: true
|
|
134
|
+
},
|
|
135
|
+
isCountingBackwardsMaxScore: {
|
|
136
|
+
type: Number,
|
|
137
|
+
default: 0
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
data() {
|
|
141
|
+
return {
|
|
142
|
+
remainingTime: normalizeSeconds(this.bout.TimeLeft),
|
|
143
|
+
timerInterval: null
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
computed: {
|
|
147
|
+
boutNodeId() {
|
|
148
|
+
return this.bout.DEBoutId ?? this.bout.BoutId;
|
|
149
|
+
},
|
|
150
|
+
boutLabel() {
|
|
151
|
+
return `${this.person1Display.DisplayName || 'Unassigned'} versus ${
|
|
152
|
+
this.person2Display.DisplayName || 'Unassigned'
|
|
153
|
+
}`;
|
|
154
|
+
},
|
|
155
|
+
dePosition1() {
|
|
156
|
+
return this.bout.Person1?.EventPersons?.[0]?.DEPosition ?? '';
|
|
157
|
+
},
|
|
158
|
+
dePosition2() {
|
|
159
|
+
return this.bout.Person2?.EventPersons?.[0]?.DEPosition ?? '';
|
|
160
|
+
},
|
|
161
|
+
displayTime() {
|
|
162
|
+
return formatSeconds(this.remainingTime);
|
|
163
|
+
},
|
|
164
|
+
isActiveBout() {
|
|
165
|
+
return String(this.bout.Status || '').toLowerCase() === 'active';
|
|
166
|
+
},
|
|
167
|
+
isDirectable() {
|
|
168
|
+
return !isUnavailableFencer(this.bout.Person1) && !isUnavailableFencer(this.bout.Person2);
|
|
169
|
+
},
|
|
170
|
+
isSelectable() {
|
|
171
|
+
return isCompletedBout(this.bout) || this.isDirectable;
|
|
172
|
+
},
|
|
173
|
+
person1Display() {
|
|
174
|
+
return getDisplayFencer(this.bout, this.bout.Person1);
|
|
175
|
+
},
|
|
176
|
+
person2Display() {
|
|
177
|
+
return getDisplayFencer(this.bout, this.bout.Person2);
|
|
178
|
+
},
|
|
179
|
+
ringName() {
|
|
180
|
+
return String(this.bout.RingName || '');
|
|
181
|
+
},
|
|
182
|
+
score1() {
|
|
183
|
+
return String(this.bout.Score1 ?? 0);
|
|
184
|
+
},
|
|
185
|
+
score2() {
|
|
186
|
+
return String(this.bout.Score2 ?? 0);
|
|
187
|
+
},
|
|
188
|
+
showBout() {
|
|
189
|
+
if (this.roundName !== 'Grand Final') return true;
|
|
190
|
+
return !isUnavailableFencer(this.bout.Person1) && !isUnavailableFencer(this.bout.Person2);
|
|
191
|
+
},
|
|
192
|
+
showActiveChrome() {
|
|
193
|
+
return this.isActiveBout && (this.ringName.length > 0 || this.remainingTime > 0 || this.shouldTickTimer);
|
|
194
|
+
},
|
|
195
|
+
showScore1() {
|
|
196
|
+
return !isUnavailableFencer(this.bout.Person1);
|
|
197
|
+
},
|
|
198
|
+
showScore2() {
|
|
199
|
+
return !isUnavailableFencer(this.bout.Person2);
|
|
200
|
+
},
|
|
201
|
+
showRingLabel() {
|
|
202
|
+
return this.isActiveBout && this.ringName.length > 0;
|
|
203
|
+
},
|
|
204
|
+
shouldTickTimer() {
|
|
205
|
+
return isRunningActiveBout(this.bout) && this.remainingTime > 0;
|
|
206
|
+
}
|
|
207
|
+
},
|
|
208
|
+
watch: {
|
|
209
|
+
'bout.TimeLeft'(value) {
|
|
210
|
+
this.remainingTime = normalizeSeconds(value);
|
|
211
|
+
this.restartTimer();
|
|
212
|
+
},
|
|
213
|
+
'bout.TimerStatus'() {
|
|
214
|
+
this.restartTimer();
|
|
215
|
+
},
|
|
216
|
+
'bout.Status'() {
|
|
217
|
+
this.restartTimer();
|
|
218
|
+
}
|
|
219
|
+
},
|
|
220
|
+
mounted() {
|
|
221
|
+
this.restartTimer();
|
|
222
|
+
},
|
|
223
|
+
beforeUnmount() {
|
|
224
|
+
this.stopTimer();
|
|
225
|
+
},
|
|
226
|
+
methods: {
|
|
227
|
+
getScoreColor(fencerKey) {
|
|
228
|
+
return getMatchingScoreColor(this.bout, fencerKey);
|
|
229
|
+
},
|
|
230
|
+
handleBoutClick() {
|
|
231
|
+
if (isCompletedBout(this.bout)) {
|
|
232
|
+
this.$emit('action:editBout', this.bout);
|
|
233
|
+
return;
|
|
234
|
+
}
|
|
235
|
+
if (this.isDirectable) this.$emit('action:directingBout', this.bout);
|
|
236
|
+
},
|
|
237
|
+
restartTimer() {
|
|
238
|
+
this.stopTimer();
|
|
239
|
+
if (!this.shouldTickTimer) return;
|
|
240
|
+
this.timerInterval = setInterval(this.tickTimer, 1000);
|
|
241
|
+
},
|
|
242
|
+
registerAnchor(kind, element) {
|
|
243
|
+
if (this.boutNodeId === null || this.boutNodeId === undefined) return;
|
|
244
|
+
this.$emit('register-node-anchor', { id: this.boutNodeId, kind, el: element });
|
|
245
|
+
},
|
|
246
|
+
stopTimer() {
|
|
247
|
+
if (this.timerInterval) clearInterval(this.timerInterval);
|
|
248
|
+
this.timerInterval = null;
|
|
249
|
+
},
|
|
250
|
+
tickTimer() {
|
|
251
|
+
this.remainingTime = Math.max(0, this.remainingTime - 1);
|
|
252
|
+
if (this.remainingTime === 0) this.stopTimer();
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
};
|
|
256
|
+
</script>
|
|
@@ -1,92 +1,69 @@
|
|
|
1
|
-
import TableauFencerCard from './TableauFencerCard.vue';
|
|
2
|
-
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Organisms/Cards/TableauFencerCard',
|
|
5
|
-
component: TableauFencerCard,
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
control: '
|
|
27
|
-
description: '
|
|
28
|
-
},
|
|
29
|
-
|
|
30
|
-
control: 'text',
|
|
31
|
-
description: '
|
|
32
|
-
},
|
|
33
|
-
|
|
34
|
-
control: 'text',
|
|
35
|
-
description: '
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
control: '
|
|
39
|
-
description: '
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
control: '
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
},
|
|
65
|
-
score: '
|
|
66
|
-
position: '
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
export const Small = {
|
|
74
|
-
args: {
|
|
75
|
-
fencer: {
|
|
76
|
-
DisplayName: 'Jane Doe',
|
|
77
|
-
Club: {
|
|
78
|
-
Name: 'Fencing Club'
|
|
79
|
-
},
|
|
80
|
-
Images: [
|
|
81
|
-
{
|
|
82
|
-
URL: 'https://via.placeholder.com/40'
|
|
83
|
-
}
|
|
84
|
-
]
|
|
85
|
-
},
|
|
86
|
-
score: '12',
|
|
87
|
-
position: '2',
|
|
88
|
-
color: 'red',
|
|
89
|
-
scoreColor: 'bg-lossRed',
|
|
90
|
-
large: false
|
|
91
|
-
}
|
|
92
|
-
};
|
|
1
|
+
import TableauFencerCard from './TableauFencerCard.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Organisms/Cards/TableauFencerCard',
|
|
5
|
+
component: TableauFencerCard,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
args: {
|
|
8
|
+
fencer: { DisplayName: 'John Doe' },
|
|
9
|
+
score: '15',
|
|
10
|
+
position: '1',
|
|
11
|
+
color: 'blue',
|
|
12
|
+
scoreColor: 'bg-winGreen',
|
|
13
|
+
showScore: true,
|
|
14
|
+
corners: 'top'
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
fencer: {
|
|
18
|
+
control: 'object',
|
|
19
|
+
description: 'Fencer displayed in the bracket row'
|
|
20
|
+
},
|
|
21
|
+
score: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
description: 'Displayed bout score'
|
|
24
|
+
},
|
|
25
|
+
position: {
|
|
26
|
+
control: 'text',
|
|
27
|
+
description: 'Seed or direct-elimination position'
|
|
28
|
+
},
|
|
29
|
+
color: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
description: 'Tailwind theme color used for the seed strip'
|
|
32
|
+
},
|
|
33
|
+
scoreColor: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
description: 'Tailwind background class used for the score cell'
|
|
36
|
+
},
|
|
37
|
+
showScore: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
description: 'Whether the score cell displays a value'
|
|
40
|
+
},
|
|
41
|
+
corners: {
|
|
42
|
+
control: 'select',
|
|
43
|
+
options: ['none', 'top', 'bottom'],
|
|
44
|
+
description: 'Rounds the outside corners when used as the top or bottom bout row'
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
export const Default = {};
|
|
50
|
+
|
|
51
|
+
export const LosingScore = {
|
|
52
|
+
args: {
|
|
53
|
+
fencer: { DisplayName: 'Jane Doe' },
|
|
54
|
+
score: '12',
|
|
55
|
+
position: '2',
|
|
56
|
+
color: 'red',
|
|
57
|
+
scoreColor: 'bg-lossRed',
|
|
58
|
+
corners: 'bottom'
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
export const PendingFencer = {
|
|
63
|
+
args: {
|
|
64
|
+
fencer: { DisplayName: '' },
|
|
65
|
+
score: '0',
|
|
66
|
+
position: '',
|
|
67
|
+
showScore: false
|
|
68
|
+
}
|
|
69
|
+
};
|