@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.
Files changed (46) hide show
  1. package/AGENTS.md +118 -118
  2. package/dist/HemaTournamentUI-lib.es.js +4483 -4618
  3. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  4. package/dist/hematournamentui-tailwind.css +185 -406
  5. package/package.json +10 -10
  6. package/src/index.js +2 -0
  7. package/src/mocks/getDEBouts-42Fencers.js +4 -4
  8. package/src/mocks/getDEBouts-TableOf128.js +37 -0
  9. package/src/mocks/getDEBouts-TableOf64.js +35 -0
  10. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -0
  11. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -0
  12. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -0
  13. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +3 -2
  14. package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +1 -1
  15. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -0
  16. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -0
  17. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -0
  18. package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -278
  19. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +60 -98
  20. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +103 -4
  21. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +256 -215
  22. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -92
  23. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -128
  24. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +14 -4
  25. package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +2 -2
  26. package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +131 -3
  27. package/src/stories/Organisms/Containers/Tableau/Tableau.vue +287 -89
  28. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -0
  29. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -0
  30. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -0
  31. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -0
  32. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -0
  33. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -0
  34. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +57 -0
  35. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +65 -0
  36. package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +31 -29
  37. package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +146 -18
  38. package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +52 -2
  39. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +53 -17
  40. package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +39 -0
  41. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -0
  42. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -0
  43. package/src/stories/Organisms/Cards/TableauBoutCard/SpacingConfig.js +0 -111
  44. package/src/stories/Organisms/Containers/TableauLines/SpacingConfig.js +0 -162
  45. package/src/stories/Organisms/Containers/TableauLines/TableauLines.stories.js +0 -21
  46. 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="flex justify-center w-20">
112
- <BaseButton
113
- label="Edit"
114
- size="xs"
115
- color="quinary"
116
- class="hidden md:block mr-10 h-9 mt-1"
117
- @buttonClick="handleForwardToProfile"
118
- />
119
- </div>
120
- <div class="w-44 flex justify-end">
121
- <BaseButton
122
- v-if="isEdit && weaverRequired && !weaverSigned"
123
- label="Sign Waiver"
124
- size="xs"
125
- color="quinary"
126
- class="border border-dropdownSelect shadow-md rounded-l-lg bg-natural w-40 m-0! p-0! h-10"
127
- @buttonClick="requestWeaverSign"
128
- />
129
-
130
- <ButtonBar
131
- v-else
132
- :buttons="buttons"
133
- :selected="computedSelected"
134
- @update:selected="handleAttendance"
135
- class="mr-1 h-10"
136
- />
137
- </div>
138
- </div>
139
- <div
140
- 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"
141
- >
142
- <BaseIcon
143
- v-if="!showSpinner"
144
- icon-name="fa-circle-xmark"
145
- size=""
146
- color="quinary"
147
- hover="alarm"
148
- @click="handlerRemoveFencer"
149
- class="text-md md:text-2xl"
150
- />
151
- <BaseIcon
152
- v-if="showSpinner"
153
- icon-name="fa-spinner-third"
154
- size=""
155
- color="alarm"
156
- class="animate-spin text-md md:text-2xl"
157
- hover="alarm"
158
- />
159
- </div>
160
- </div>
161
- </template>
162
-
163
- <script>
164
- import BaseText from '../../../Atoms/Text/BaseText.vue';
165
- import ButtonBar from '../../../Molecules/Buttons/ButtonBar/ButtonBar.vue';
166
- import BaseIcon from '../../../Atoms/Icon/BaseIcon.vue';
167
- import BaseButton from '../../../Molecules/Buttons/BaseButton/BaseButton.vue';
168
-
169
- export default {
170
- name: 'FencerCard',
171
- emits: [
172
- 'forward:toProfile',
173
- 'remove:fencer',
174
- 'request:weaver-sign',
175
- 'update:moveDown',
176
- 'update:moveUp',
177
- 'update:status',
178
- 'weaver:required'
179
- ],
180
- components: { BaseButton, BaseIcon, ButtonBar, BaseText },
181
- props: {
182
- person: {
183
- type: Object,
184
- required: true
185
- },
186
- isLast: {
187
- type: Boolean,
188
- required: false,
189
- default: false
190
- },
191
- isEdit: {
192
- type: Boolean,
193
- required: false,
194
- default: false
195
- }
196
- },
197
- computed: {
198
- weaver() {
199
- return this.person?.Person?.Weaver ?? { Required: false, Scope: 'none', Signed: true, SignedAt: null };
200
- },
201
- weaverRequired() {
202
- return !!this.weaver.Required && (this.weaver.Scope ?? 'none') !== 'none';
203
- },
204
- weaverSigned() {
205
- return this.weaverRequired ? this.localWeaverSigned : true;
206
- },
207
- portraitURL() {
208
- const images = this.person.Person.Images || [];
209
- const portrait = images.find(image => image.Type === 'Portrait');
210
- return portrait ? portrait.URL : '';
211
- },
212
- buttons() {
213
- return [
214
- { id: 'Absent', label: 'Absent', defaultBgColor: 'bg-natural', selectedBgColor: 'bg-eventBoxBlueTwo' },
215
- { id: 'Present', label: 'Present', defaultBgColor: 'bg-natural', selectedBgColor: 'bg-eventBoxGreenTwo' }
216
- ];
217
- },
218
- HEMARating() {
219
- if (!this.person.Person.HEMARatings || this.person.Person.HEMARatings.length === 0) {
220
- return 0;
221
- }
222
- return this.person.Person.HEMARatings[0].Rating;
223
- },
224
- M2Rating() {
225
- if (!this.person.Person.M2Ratings || this.person.Person.M2Ratings.length === 0) {
226
- return 'U';
227
- }
228
- return this.person.Person.M2Ratings[0].Rating;
229
- },
230
- computedSelected() {
231
- return this.person.Status === 'Absent' ? 'Absent' : 'Present';
232
- }
233
- },
234
- data() {
235
- return {
236
- showSpinner: false,
237
- localWeaverSigned: false
238
- };
239
- },
240
- watch: {
241
- person: {
242
- immediate: true,
243
- deep: true,
244
- handler(newVal) {
245
- const signed = newVal?.Person?.Weaver?.Signed;
246
- this.localWeaverSigned = Boolean(signed ?? false);
247
- }
248
- }
249
- },
250
- methods: {
251
- requestWeaverSign() {
252
- this.$emit('request:weaver-sign', this.person);
253
- },
254
- handleAttendance(selected) {
255
- if (selected === 'Present' && this.weaverRequired && !this.weaverSigned) {
256
- this.$emit('weaver:required', this.person);
257
- return;
258
- }
259
-
260
- const person = { ...this.person, Status: selected };
261
- this.$emit('update:status', person);
262
- },
263
- handlerRemoveFencer() {
264
- this.showSpinner = true;
265
- this.$emit('remove:fencer', this.person);
266
- },
267
- handelMoveUp() {
268
- if (this.person.PoolPosition > 1) this.$emit('update:moveUp', this.person);
269
- },
270
- handelMoveDown() {
271
- if (!this.isLast) this.$emit('update:moveDown', this.person);
272
- },
273
- handleForwardToProfile() {
274
- this.$emit('forward:toProfile', this.person.PersonId);
275
- }
276
- }
277
- };
278
- </script>
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>