@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,278 +1,298 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div
|
|
3
|
-
v-if="person"
|
|
4
|
-
class="flex items-center border border-dropdownSelect rounded-lg shadow-lg bg-white hover:border-bright"
|
|
5
|
-
>
|
|
6
|
-
<div class="hidden md:block mr-4 border-r border-dropdownSelect h-20 w-10 items-center text-center">
|
|
7
|
-
<BaseIcon
|
|
8
|
-
v-if="isEdit"
|
|
9
|
-
icon-name="fa-caret-up"
|
|
10
|
-
size="xl"
|
|
11
|
-
:color="person.PoolPosition === 1 ? 'neutral' : 'quinary'"
|
|
12
|
-
:hover="person.PoolPosition === 1 ? 'neutral' : 'bright'"
|
|
13
|
-
class="m-0"
|
|
14
|
-
@click="handelMoveUp"
|
|
15
|
-
/>
|
|
16
|
-
<BaseText
|
|
17
|
-
:text="person.PoolPosition"
|
|
18
|
-
:size="isEdit ? 'lg' : '2xl'"
|
|
19
|
-
color="quaternary"
|
|
20
|
-
weight="bold"
|
|
21
|
-
:class="isEdit ? '-mt-0.5 -mb-0.5' : 'mt-5'"
|
|
22
|
-
/>
|
|
23
|
-
<BaseIcon
|
|
24
|
-
v-if="isEdit"
|
|
25
|
-
icon-name="fa-caret-down"
|
|
26
|
-
size="xl"
|
|
27
|
-
:color="isLast ? 'neutral' : 'quinary'"
|
|
28
|
-
:hover="isLast ? 'neutral' : 'bright'"
|
|
29
|
-
@click="handelMoveDown"
|
|
30
|
-
/>
|
|
31
|
-
</div>
|
|
32
|
-
<div class="bock md:hidden mr-4 border-r border-dropdownSelect h-16 w-5 items-center text-center">
|
|
33
|
-
<BaseIcon
|
|
34
|
-
v-if="isEdit"
|
|
35
|
-
icon-name="fa-caret-up"
|
|
36
|
-
size="sm"
|
|
37
|
-
:color="person.PoolPosition === 1 ? 'neutral' : 'quinary'"
|
|
38
|
-
:hover="person.PoolPosition === 1 ? 'neutral' : 'bright'"
|
|
39
|
-
class="m-0"
|
|
40
|
-
@click="handelMoveUp"
|
|
41
|
-
/>
|
|
42
|
-
<BaseText
|
|
43
|
-
:text="person.PoolPosition"
|
|
44
|
-
:size="isEdit ? 'sm' : 'md'"
|
|
45
|
-
color="quaternary"
|
|
46
|
-
weight="bold"
|
|
47
|
-
:class="isEdit ? '-mt-0.5 -mb-0.5' : 'mt-5'"
|
|
48
|
-
/>
|
|
49
|
-
<BaseIcon
|
|
50
|
-
v-if="isEdit"
|
|
51
|
-
icon-name="fa-caret-down"
|
|
52
|
-
size="sm"
|
|
53
|
-
:color="isLast ? 'neutral' : 'quinary'"
|
|
54
|
-
:hover="isLast ? 'neutral' : 'bright'"
|
|
55
|
-
@click="handelMoveDown"
|
|
56
|
-
/>
|
|
57
|
-
</div>
|
|
58
|
-
|
|
59
|
-
<div class="hidden md:block mr-4">
|
|
60
|
-
<div v-if="!portraitURL" class="w-14 h-14 r ounded-xl bg-dropdownSelect flex items-center justify-center">
|
|
61
|
-
<BaseText text="" size="sm" color="neutral" weight="bold" />
|
|
62
|
-
</div>
|
|
63
|
-
<img v-if="portraitURL" :src="portraitURL" alt="Portrait" class="w-14 h-14 rounded-xl" />
|
|
64
|
-
</div>
|
|
65
|
-
|
|
66
|
-
<div class="flex flex-col w-3/4 md:w-4/12 justify-start">
|
|
67
|
-
<span class="flex justify-start overflow-hidden">
|
|
68
|
-
<BaseText
|
|
69
|
-
:text="person.Person.DisplayName"
|
|
70
|
-
size="md"
|
|
71
|
-
color="quaternary"
|
|
72
|
-
weight="bold"
|
|
73
|
-
class="text-sm md:text-xl"
|
|
74
|
-
/>
|
|
75
|
-
</span>
|
|
76
|
-
<span class="w-full flex justify-start">
|
|
77
|
-
<BaseText :text="person.Person.Club.Name" size="md" color="quinary" weight="normal" class="hidden md:block" />
|
|
78
|
-
<BaseText
|
|
79
|
-
:text="person.Person.Club.ShortName"
|
|
80
|
-
size="xs"
|
|
81
|
-
color="quinary"
|
|
82
|
-
weight="normal"
|
|
83
|
-
class="block md:hidden"
|
|
84
|
-
/>
|
|
85
|
-
</span>
|
|
86
|
-
|
|
87
|
-
<div class="grid md:hidden grid-cols-2 gap-x-4 mr-10">
|
|
88
|
-
<div class="flex">
|
|
89
|
-
<BaseText text="M²: " size="xs" color="quaternary" weight="normal" class="mr-1" />
|
|
90
|
-
<BaseText :text="M2Rating" size="xs" color="quinary" weight="bold" class="ml-1" />
|
|
91
|
-
</div>
|
|
92
|
-
<div class="flex">
|
|
93
|
-
<BaseText text="HR: " size="xs" color="quaternary" weight="normal" class="mr-1" />
|
|
94
|
-
<BaseText :text="HEMARating" size="xs" color="quinary" weight="bold" class="ml-1" />
|
|
95
|
-
</div>
|
|
96
|
-
</div>
|
|
97
|
-
</div>
|
|
98
|
-
|
|
99
|
-
<div class="hidden md:grid grid-col ls-2 gap-x-4 mr-4 w-36">
|
|
100
|
-
<div class="flex">
|
|
101
|
-
<BaseText text="M2Rating:" size="sm" color="quaternary" weight="normal" class="mr-2" />
|
|
102
|
-
<BaseText :text="M2Rating" size="sm" color="quinary" weight="bold" class="pt-0.5" />
|
|
103
|
-
</div>
|
|
104
|
-
<div class="flex">
|
|
105
|
-
<BaseText text="HemaRating:" size="sm" color="quaternary" weight="normal" class="mr-2" />
|
|
106
|
-
<BaseText :text="HEMARating" size="sm" color="quinary" weight="bold" />
|
|
107
|
-
</div>
|
|
108
|
-
</div>
|
|
109
|
-
|
|
110
|
-
<div class="mr-2 md:mr-4 md:ml-auto flex flex-row">
|
|
111
|
-
<div class="
|
|
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
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
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
|
-
|
|
216
|
-
|
|
217
|
-
},
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
return this.
|
|
223
|
-
},
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
}
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div
|
|
3
|
+
v-if="person"
|
|
4
|
+
class="flex items-center border border-dropdownSelect rounded-lg shadow-lg bg-white hover:border-bright"
|
|
5
|
+
>
|
|
6
|
+
<div class="hidden md:block mr-4 border-r border-dropdownSelect h-20 w-10 items-center text-center">
|
|
7
|
+
<BaseIcon
|
|
8
|
+
v-if="isEdit"
|
|
9
|
+
icon-name="fa-caret-up"
|
|
10
|
+
size="xl"
|
|
11
|
+
:color="person.PoolPosition === 1 ? 'neutral' : 'quinary'"
|
|
12
|
+
:hover="person.PoolPosition === 1 ? 'neutral' : 'bright'"
|
|
13
|
+
class="m-0"
|
|
14
|
+
@click="handelMoveUp"
|
|
15
|
+
/>
|
|
16
|
+
<BaseText
|
|
17
|
+
:text="person.PoolPosition"
|
|
18
|
+
:size="isEdit ? 'lg' : '2xl'"
|
|
19
|
+
color="quaternary"
|
|
20
|
+
weight="bold"
|
|
21
|
+
:class="isEdit ? '-mt-0.5 -mb-0.5' : 'mt-5'"
|
|
22
|
+
/>
|
|
23
|
+
<BaseIcon
|
|
24
|
+
v-if="isEdit"
|
|
25
|
+
icon-name="fa-caret-down"
|
|
26
|
+
size="xl"
|
|
27
|
+
:color="isLast ? 'neutral' : 'quinary'"
|
|
28
|
+
:hover="isLast ? 'neutral' : 'bright'"
|
|
29
|
+
@click="handelMoveDown"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
<div class="bock md:hidden mr-4 border-r border-dropdownSelect h-16 w-5 items-center text-center">
|
|
33
|
+
<BaseIcon
|
|
34
|
+
v-if="isEdit"
|
|
35
|
+
icon-name="fa-caret-up"
|
|
36
|
+
size="sm"
|
|
37
|
+
:color="person.PoolPosition === 1 ? 'neutral' : 'quinary'"
|
|
38
|
+
:hover="person.PoolPosition === 1 ? 'neutral' : 'bright'"
|
|
39
|
+
class="m-0"
|
|
40
|
+
@click="handelMoveUp"
|
|
41
|
+
/>
|
|
42
|
+
<BaseText
|
|
43
|
+
:text="person.PoolPosition"
|
|
44
|
+
:size="isEdit ? 'sm' : 'md'"
|
|
45
|
+
color="quaternary"
|
|
46
|
+
weight="bold"
|
|
47
|
+
:class="isEdit ? '-mt-0.5 -mb-0.5' : 'mt-5'"
|
|
48
|
+
/>
|
|
49
|
+
<BaseIcon
|
|
50
|
+
v-if="isEdit"
|
|
51
|
+
icon-name="fa-caret-down"
|
|
52
|
+
size="sm"
|
|
53
|
+
:color="isLast ? 'neutral' : 'quinary'"
|
|
54
|
+
:hover="isLast ? 'neutral' : 'bright'"
|
|
55
|
+
@click="handelMoveDown"
|
|
56
|
+
/>
|
|
57
|
+
</div>
|
|
58
|
+
|
|
59
|
+
<div class="hidden md:block mr-4">
|
|
60
|
+
<div v-if="!portraitURL" class="w-14 h-14 r ounded-xl bg-dropdownSelect flex items-center justify-center">
|
|
61
|
+
<BaseText text="" size="sm" color="neutral" weight="bold" />
|
|
62
|
+
</div>
|
|
63
|
+
<img v-if="portraitURL" :src="portraitURL" alt="Portrait" class="w-14 h-14 rounded-xl" />
|
|
64
|
+
</div>
|
|
65
|
+
|
|
66
|
+
<div class="flex flex-col w-3/4 md:w-4/12 justify-start">
|
|
67
|
+
<span class="flex justify-start overflow-hidden">
|
|
68
|
+
<BaseText
|
|
69
|
+
:text="person.Person.DisplayName"
|
|
70
|
+
size="md"
|
|
71
|
+
color="quaternary"
|
|
72
|
+
weight="bold"
|
|
73
|
+
class="text-sm md:text-xl"
|
|
74
|
+
/>
|
|
75
|
+
</span>
|
|
76
|
+
<span class="w-full flex justify-start">
|
|
77
|
+
<BaseText :text="person.Person.Club.Name" size="md" color="quinary" weight="normal" class="hidden md:block" />
|
|
78
|
+
<BaseText
|
|
79
|
+
:text="person.Person.Club.ShortName"
|
|
80
|
+
size="xs"
|
|
81
|
+
color="quinary"
|
|
82
|
+
weight="normal"
|
|
83
|
+
class="block md:hidden"
|
|
84
|
+
/>
|
|
85
|
+
</span>
|
|
86
|
+
|
|
87
|
+
<div class="grid md:hidden grid-cols-2 gap-x-4 mr-10">
|
|
88
|
+
<div class="flex">
|
|
89
|
+
<BaseText text="M²: " size="xs" color="quaternary" weight="normal" class="mr-1" />
|
|
90
|
+
<BaseText :text="M2Rating" size="xs" color="quinary" weight="bold" class="ml-1" />
|
|
91
|
+
</div>
|
|
92
|
+
<div class="flex">
|
|
93
|
+
<BaseText text="HR: " size="xs" color="quaternary" weight="normal" class="mr-1" />
|
|
94
|
+
<BaseText :text="HEMARating" size="xs" color="quinary" weight="bold" class="ml-1" />
|
|
95
|
+
</div>
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
|
|
99
|
+
<div class="hidden md:grid grid-col ls-2 gap-x-4 mr-4 w-36">
|
|
100
|
+
<div class="flex">
|
|
101
|
+
<BaseText text="M2Rating:" size="sm" color="quaternary" weight="normal" class="mr-2" />
|
|
102
|
+
<BaseText :text="M2Rating" size="sm" color="quinary" weight="bold" class="pt-0.5" />
|
|
103
|
+
</div>
|
|
104
|
+
<div class="flex">
|
|
105
|
+
<BaseText text="HemaRating:" size="sm" color="quaternary" weight="normal" class="mr-2" />
|
|
106
|
+
<BaseText :text="HEMARating" size="sm" color="quinary" weight="bold" />
|
|
107
|
+
</div>
|
|
108
|
+
</div>
|
|
109
|
+
|
|
110
|
+
<div class="mr-2 md:mr-4 md:ml-auto flex flex-row items-center">
|
|
111
|
+
<div class="mr-2 md:mr-6 w-6 md:w-7 shrink-0">
|
|
112
|
+
<span
|
|
113
|
+
v-if="hasMissingHemaRatingsId"
|
|
114
|
+
role="img"
|
|
115
|
+
aria-label="Missing HEMA Ratings ID"
|
|
116
|
+
title="Missing HEMA Ratings ID"
|
|
117
|
+
class="flex items-center justify-center text-darkgray"
|
|
118
|
+
>
|
|
119
|
+
<svg class="h-6 w-6 md:h-7 md:w-7" viewBox="0 0 32 32" fill="none" aria-hidden="true">
|
|
120
|
+
<circle cx="16" cy="16" r="13" stroke="currentColor" stroke-width="2" />
|
|
121
|
+
<text x="16" y="20" text-anchor="middle" fill="currentColor" font-size="11" class="font-bold">HR</text>
|
|
122
|
+
<path d="M7 25 25 7" stroke="currentColor" stroke-width="2" stroke-linecap="round" />
|
|
123
|
+
</svg>
|
|
124
|
+
</span>
|
|
125
|
+
</div>
|
|
126
|
+
<div class="flex justify-center w-20">
|
|
127
|
+
<BaseButton
|
|
128
|
+
label="Edit"
|
|
129
|
+
size="xs"
|
|
130
|
+
color="quinary"
|
|
131
|
+
class="hidden md:block mr-10 h-9 mt-1"
|
|
132
|
+
@buttonClick="handleForwardToProfile"
|
|
133
|
+
/>
|
|
134
|
+
</div>
|
|
135
|
+
<div class="w-44 flex justify-end">
|
|
136
|
+
<BaseButton
|
|
137
|
+
v-if="isEdit && weaverRequired && !weaverSigned"
|
|
138
|
+
label="Sign Waiver"
|
|
139
|
+
size="xs"
|
|
140
|
+
color="quinary"
|
|
141
|
+
class="border border-dropdownSelect shadow-md rounded-l-lg bg-natural w-40 m-0! p-0! h-10"
|
|
142
|
+
@buttonClick="requestWeaverSign"
|
|
143
|
+
/>
|
|
144
|
+
|
|
145
|
+
<ButtonBar
|
|
146
|
+
v-else
|
|
147
|
+
:buttons="buttons"
|
|
148
|
+
:selected="computedSelected"
|
|
149
|
+
@update:selected="handleAttendance"
|
|
150
|
+
class="mr-1 h-10"
|
|
151
|
+
/>
|
|
152
|
+
</div>
|
|
153
|
+
</div>
|
|
154
|
+
<div
|
|
155
|
+
class="block md:ml-4 border-l border-dropdownSelect h-16 w-9 md:h-20 md:w-10 items-center text-center hover:bg-eventBoxRed rounded-tr-lg rounded-br-lg pt-5 md:pt-6"
|
|
156
|
+
>
|
|
157
|
+
<BaseIcon
|
|
158
|
+
v-if="!showSpinner"
|
|
159
|
+
icon-name="fa-circle-xmark"
|
|
160
|
+
size=""
|
|
161
|
+
color="quinary"
|
|
162
|
+
hover="alarm"
|
|
163
|
+
@click="handlerRemoveFencer"
|
|
164
|
+
class="text-md md:text-2xl"
|
|
165
|
+
/>
|
|
166
|
+
<BaseIcon
|
|
167
|
+
v-if="showSpinner"
|
|
168
|
+
icon-name="fa-spinner-third"
|
|
169
|
+
size=""
|
|
170
|
+
color="alarm"
|
|
171
|
+
class="animate-spin text-md md:text-2xl"
|
|
172
|
+
hover="alarm"
|
|
173
|
+
/>
|
|
174
|
+
</div>
|
|
175
|
+
</div>
|
|
176
|
+
</template>
|
|
177
|
+
|
|
178
|
+
<script>
|
|
179
|
+
import BaseText from '../../../Atoms/Text/BaseText.vue';
|
|
180
|
+
import ButtonBar from '../../../Molecules/Buttons/ButtonBar/ButtonBar.vue';
|
|
181
|
+
import BaseIcon from '../../../Atoms/Icon/BaseIcon.vue';
|
|
182
|
+
import BaseButton from '../../../Molecules/Buttons/BaseButton/BaseButton.vue';
|
|
183
|
+
|
|
184
|
+
export default {
|
|
185
|
+
name: 'FencerCard',
|
|
186
|
+
emits: [
|
|
187
|
+
'forward:toProfile',
|
|
188
|
+
'remove:fencer',
|
|
189
|
+
'request:weaver-sign',
|
|
190
|
+
'update:moveDown',
|
|
191
|
+
'update:moveUp',
|
|
192
|
+
'update:status',
|
|
193
|
+
'weaver:required'
|
|
194
|
+
],
|
|
195
|
+
components: { BaseButton, BaseIcon, ButtonBar, BaseText },
|
|
196
|
+
props: {
|
|
197
|
+
person: {
|
|
198
|
+
type: Object,
|
|
199
|
+
required: true
|
|
200
|
+
},
|
|
201
|
+
isLast: {
|
|
202
|
+
type: Boolean,
|
|
203
|
+
required: false,
|
|
204
|
+
default: false
|
|
205
|
+
},
|
|
206
|
+
isEdit: {
|
|
207
|
+
type: Boolean,
|
|
208
|
+
required: false,
|
|
209
|
+
default: false
|
|
210
|
+
}
|
|
211
|
+
},
|
|
212
|
+
computed: {
|
|
213
|
+
hasMissingHemaRatingsId() {
|
|
214
|
+
const person = this.person?.Person;
|
|
215
|
+
const id = Number(person?.HemaRatingsId ?? person?.HEMARatings?.[0]?.HemaRatingId);
|
|
216
|
+
return !Number.isInteger(id) || id <= 0;
|
|
217
|
+
},
|
|
218
|
+
weaver() {
|
|
219
|
+
return this.person?.Person?.Weaver ?? { Required: false, Scope: 'none', Signed: true, SignedAt: null };
|
|
220
|
+
},
|
|
221
|
+
weaverRequired() {
|
|
222
|
+
return !!this.weaver.Required && (this.weaver.Scope ?? 'none') !== 'none';
|
|
223
|
+
},
|
|
224
|
+
weaverSigned() {
|
|
225
|
+
return this.weaverRequired ? this.localWeaverSigned : true;
|
|
226
|
+
},
|
|
227
|
+
portraitURL() {
|
|
228
|
+
const images = this.person.Person.Images || [];
|
|
229
|
+
const portrait = images.find(image => image.Type === 'Portrait');
|
|
230
|
+
return portrait ? portrait.URL : '';
|
|
231
|
+
},
|
|
232
|
+
buttons() {
|
|
233
|
+
return [
|
|
234
|
+
{ id: 'Absent', label: 'Absent', defaultBgColor: 'bg-natural', selectedBgColor: 'bg-eventBoxBlueTwo' },
|
|
235
|
+
{ id: 'Present', label: 'Present', defaultBgColor: 'bg-natural', selectedBgColor: 'bg-eventBoxGreenTwo' }
|
|
236
|
+
];
|
|
237
|
+
},
|
|
238
|
+
HEMARating() {
|
|
239
|
+
if (!this.person.Person.HEMARatings || this.person.Person.HEMARatings.length === 0) {
|
|
240
|
+
return 0;
|
|
241
|
+
}
|
|
242
|
+
return this.person.Person.HEMARatings[0].Rating;
|
|
243
|
+
},
|
|
244
|
+
M2Rating() {
|
|
245
|
+
if (!this.person.Person.M2Ratings || this.person.Person.M2Ratings.length === 0) {
|
|
246
|
+
return 'U';
|
|
247
|
+
}
|
|
248
|
+
return this.person.Person.M2Ratings[0].Rating;
|
|
249
|
+
},
|
|
250
|
+
computedSelected() {
|
|
251
|
+
return this.person.Status === 'Absent' ? 'Absent' : 'Present';
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
data() {
|
|
255
|
+
return {
|
|
256
|
+
showSpinner: false,
|
|
257
|
+
localWeaverSigned: false
|
|
258
|
+
};
|
|
259
|
+
},
|
|
260
|
+
watch: {
|
|
261
|
+
person: {
|
|
262
|
+
immediate: true,
|
|
263
|
+
deep: true,
|
|
264
|
+
handler(newVal) {
|
|
265
|
+
const signed = newVal?.Person?.Weaver?.Signed;
|
|
266
|
+
this.localWeaverSigned = Boolean(signed ?? false);
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
},
|
|
270
|
+
methods: {
|
|
271
|
+
requestWeaverSign() {
|
|
272
|
+
this.$emit('request:weaver-sign', this.person);
|
|
273
|
+
},
|
|
274
|
+
handleAttendance(selected) {
|
|
275
|
+
if (selected === 'Present' && this.weaverRequired && !this.weaverSigned) {
|
|
276
|
+
this.$emit('weaver:required', this.person);
|
|
277
|
+
return;
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
const person = { ...this.person, Status: selected };
|
|
281
|
+
this.$emit('update:status', person);
|
|
282
|
+
},
|
|
283
|
+
handlerRemoveFencer() {
|
|
284
|
+
this.showSpinner = true;
|
|
285
|
+
this.$emit('remove:fencer', this.person);
|
|
286
|
+
},
|
|
287
|
+
handelMoveUp() {
|
|
288
|
+
if (this.person.PoolPosition > 1) this.$emit('update:moveUp', this.person);
|
|
289
|
+
},
|
|
290
|
+
handelMoveDown() {
|
|
291
|
+
if (!this.isLast) this.$emit('update:moveDown', this.person);
|
|
292
|
+
},
|
|
293
|
+
handleForwardToProfile() {
|
|
294
|
+
this.$emit('forward:toProfile', this.person.PersonId);
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
};
|
|
298
|
+
</script>
|