@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.
- package/dist/HemaTournamentUI-lib.es.js +8331 -8210
- package/dist/HemaTournamentUI-lib.umd.js +28 -28
- package/package.json +1 -1
- package/src/mocks/getDEWithBouts.js +852 -0
- package/src/stories/Molecules/Boxes/CounterBox/CounterBox.vue +6 -2
- package/src/stories/Molecules/Indicators/ServerConnected/ServerConnected.stories.js +42 -0
- package/src/stories/Molecules/Indicators/ServerConnected/ServerConnected.vue +32 -0
- package/src/stories/Molecules/Inputs/Toggle/Toggle.stories.js +42 -0
- package/src/stories/Molecules/Inputs/Toggle/Toggle.vue +56 -0
- package/src/stories/Organisms/Cards/FencerPoolResultsCard/FencerPoolResults.stories.js +17 -7
- package/src/stories/Organisms/Cards/FencerPoolResultsCard/FencerPoolResultsCard.vue +6 -3
- package/src/stories/Organisms/Cards/TableauBoutCard/SpacingConfig.js +27 -0
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +98 -0
- package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +162 -0
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +93 -0
- package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +95 -0
- package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.stories.js +10 -0
- package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +3 -3
- package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +34 -0
- package/src/stories/Organisms/Containers/Tableau/Tableau.vue +68 -0
- package/src/stories/Organisms/Containers/TableauColumn/TabeauColumn.stories.js +37 -0
- package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +68 -0
- package/src/stories/Organisms/Containers/TableauLines/SpacingConfig.js +29 -0
- package/src/stories/Organisms/Containers/TableauLines/TableauLines.stories.js +23 -0
- package/src/stories/Organisms/Containers/TableauLines/TableauLines.vue +80 -0
- package/src/stories/Organisms/Headers/PoolResultsHeader/PoolResultsHeader.stories.js +6 -11
- package/src/stories/Organisms/Headers/PoolResultsHeader/PoolResultsHeader.vue +7 -3
- package/src/stories/Organisms/Headers/ToggleHeader/ToggleHeader.vue +28 -5
- package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +39 -0
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +211 -0
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +4 -7
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.stories.js +9 -0
- package/tailwind.config.js +23 -2
|
@@ -5,14 +5,14 @@
|
|
|
5
5
|
</section>
|
|
6
6
|
<section :class="boxClass">
|
|
7
7
|
<div class="flex flex-row items-center justify-between h-14 py-2 px-2">
|
|
8
|
-
<button @click="increase" class="py-1">
|
|
8
|
+
<button v-if="!disable" @click="increase" class="py-1">
|
|
9
9
|
<BaseIcon icon-name="fa-caret-up" size="xl" color="primaryHighlight"/>
|
|
10
10
|
</button>
|
|
11
11
|
<span class="px-1">
|
|
12
12
|
<BaseText v-if="!directInput" :text="counter" size="xl" color="primary"/>
|
|
13
13
|
<BaseInput v-if="directInput" placeholder="Enter text..." :value="`${counter}%`" size="xl" :centerInput="true" />
|
|
14
14
|
</span>
|
|
15
|
-
<button @click="decrease" class="py-1">
|
|
15
|
+
<button v-if="!disable" @click="decrease" class="py-1">
|
|
16
16
|
<BaseIcon icon-name="fa-caret-down" size="xl" color="primaryHighlight"/>
|
|
17
17
|
</button>
|
|
18
18
|
|
|
@@ -49,6 +49,10 @@ export default {
|
|
|
49
49
|
directInput: {
|
|
50
50
|
type: Boolean,
|
|
51
51
|
default: false
|
|
52
|
+
},
|
|
53
|
+
disable: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
52
56
|
}
|
|
53
57
|
},
|
|
54
58
|
data() {
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import ServerConnected from './ServerConnected.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Molecules/Indicators/ServerConnected',
|
|
5
|
+
component: ServerConnected,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
args: {
|
|
8
|
+
connectedToServer: true,
|
|
9
|
+
statusText: 'Connected'
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
connectedToServer: {
|
|
13
|
+
control: 'boolean',
|
|
14
|
+
description: 'Indicates if the server is connected'
|
|
15
|
+
},
|
|
16
|
+
statusText: {
|
|
17
|
+
control: 'text',
|
|
18
|
+
description: 'Text to display for the connection status'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Connected = {
|
|
24
|
+
args: {
|
|
25
|
+
connectedToServer: true,
|
|
26
|
+
statusText: 'Connected'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Disconnected = {
|
|
31
|
+
args: {
|
|
32
|
+
connectedToServer: false,
|
|
33
|
+
statusText: 'Disconnected'
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const CustomText = {
|
|
38
|
+
args: {
|
|
39
|
+
connectedToServer: true,
|
|
40
|
+
statusText: 'Online'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section>
|
|
3
|
+
<div class="flex flex-row">
|
|
4
|
+
<div class="w-[21px] h-[20px] rounded-full border-2 mt-2 mr-2">
|
|
5
|
+
<div :class="connectedToServer ? 'bg-green' : 'bg-red'" class="w-[14px] h-[14px] rounded-full mt-[2px] ml-[2px]">
|
|
6
|
+
</div>
|
|
7
|
+
</div>
|
|
8
|
+
<BaseText class="mt-[0.5rem]" color="quinary" size="sm" :text="statusText" />
|
|
9
|
+
</div>
|
|
10
|
+
</section>
|
|
11
|
+
</template>
|
|
12
|
+
|
|
13
|
+
<script>
|
|
14
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
15
|
+
|
|
16
|
+
export default {
|
|
17
|
+
name: 'ServerConnected',
|
|
18
|
+
components: {BaseText},
|
|
19
|
+
props: {
|
|
20
|
+
connectedToServer: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
required: true,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
statusText: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: 'Connected'
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
</script>
|
|
32
|
+
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import ToggleSwitch from './Toggle.vue';
|
|
2
|
+
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Molecules/Inputs/ToggleSwitch',
|
|
5
|
+
component: ToggleSwitch,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
args: {
|
|
8
|
+
checked: false,
|
|
9
|
+
label: 'Toggle me'
|
|
10
|
+
},
|
|
11
|
+
argTypes: {
|
|
12
|
+
checked: {
|
|
13
|
+
control: 'boolean',
|
|
14
|
+
description: 'Determines if the toggle is checked'
|
|
15
|
+
},
|
|
16
|
+
label: {
|
|
17
|
+
control: 'text',
|
|
18
|
+
description: 'Label text for the toggle'
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Default = {
|
|
24
|
+
args: {
|
|
25
|
+
checked: false,
|
|
26
|
+
label: 'Toggle me'
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export const Checked = {
|
|
31
|
+
args: {
|
|
32
|
+
checked: true,
|
|
33
|
+
label: 'Toggle me'
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const CustomLabel = {
|
|
38
|
+
args: {
|
|
39
|
+
checked: false,
|
|
40
|
+
label: 'Custom Label'
|
|
41
|
+
}
|
|
42
|
+
};
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<label class="flex cursor-pointer select-none items-center mt-[0.5rem]">
|
|
3
|
+
<BaseText :text="label" size="sm" class="mr-2" color="quinary" />
|
|
4
|
+
<div class="relative rounded-2xl">
|
|
5
|
+
<input type="checkbox" class="sr-only" :checked="isChecked" @change="handleCheckboxChange" />
|
|
6
|
+
<div class="block h-5 w-8 rounded-full bg-gridBoxHeader"></div>
|
|
7
|
+
<div
|
|
8
|
+
:class="dotClasses"
|
|
9
|
+
class="dot absolute left-1 top-1 h-3 w-3 rounded-full bg-white transition delay-150"
|
|
10
|
+
></div>
|
|
11
|
+
</div>
|
|
12
|
+
</label>
|
|
13
|
+
</template>
|
|
14
|
+
|
|
15
|
+
<script>
|
|
16
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
name: 'ToggleSwitch',
|
|
20
|
+
components: {BaseText},
|
|
21
|
+
props: {
|
|
22
|
+
checked: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
label: {
|
|
27
|
+
type: String,
|
|
28
|
+
default: ''
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
data() {
|
|
32
|
+
return {
|
|
33
|
+
isChecked: this.checked
|
|
34
|
+
};
|
|
35
|
+
},
|
|
36
|
+
watch: {
|
|
37
|
+
checked(newValue) {
|
|
38
|
+
this.isChecked = newValue;
|
|
39
|
+
}
|
|
40
|
+
},
|
|
41
|
+
computed: {
|
|
42
|
+
dotClasses() {
|
|
43
|
+
return {
|
|
44
|
+
'translate-x-full': this.isChecked,
|
|
45
|
+
'!bg-white': this.isChecked
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
methods: {
|
|
50
|
+
handleCheckboxChange() {
|
|
51
|
+
this.isChecked = !this.isChecked;
|
|
52
|
+
this.$emit('update:checked', this.isChecked);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
</script>
|
|
@@ -6,26 +6,36 @@ export default {
|
|
|
6
6
|
component: FencerPoolResultsCard,
|
|
7
7
|
tags: ['autodocs'],
|
|
8
8
|
args: {
|
|
9
|
-
person: getPoolResults[0]
|
|
10
|
-
|
|
9
|
+
person: getPoolResults[0],
|
|
10
|
+
status: "results"
|
|
11
11
|
},
|
|
12
12
|
argTypes: {
|
|
13
13
|
person: {
|
|
14
|
-
control: 'object'
|
|
14
|
+
control: { type: 'object' },
|
|
15
|
+
status: { control: 'text' }
|
|
15
16
|
}
|
|
16
17
|
}
|
|
17
18
|
};
|
|
18
19
|
|
|
19
20
|
export const Default = {
|
|
20
21
|
args: {
|
|
21
|
-
person: getPoolResults[
|
|
22
|
+
person: getPoolResults.report[0] ,
|
|
23
|
+
status: "results"
|
|
22
24
|
}
|
|
23
25
|
};
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
+
let modifiedResults = { ...getPoolResults.report[7], Promoted: false };
|
|
27
28
|
export const Alternative = {
|
|
28
29
|
args: {
|
|
29
|
-
person: modifiedResults
|
|
30
|
+
person: modifiedResults,
|
|
31
|
+
status: "results"
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
modifiedResults = { ...getPoolResults.report[9], Promoted: false };
|
|
36
|
+
export const NotInResultsStatus = {
|
|
37
|
+
args: {
|
|
38
|
+
person: modifiedResults,
|
|
39
|
+
status: "de"
|
|
30
40
|
}
|
|
31
41
|
};
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
<BaseText :text="person.Indicator" size="xs" color="primary" weight="bold" class="flex-1 text-center"/>
|
|
34
34
|
</div>
|
|
35
35
|
</div>
|
|
36
|
-
<div class="ml-4 border-l border-dropdownSelect h-12 w-12 items-center text-center hover:bg-eventBoxRed rounded-tr-lg rounded-br-lg">
|
|
36
|
+
<div v-if="status === 'results'" class="ml-4 border-l border-dropdownSelect h-12 w-12 items-center text-center hover:bg-eventBoxRed rounded-tr-lg rounded-br-lg">
|
|
37
37
|
<BaseIcon icon-name="fa-circle-xmark" size="2xl" color="quinary" class="pt-2" hover="alarm" @click="handlerRemoveFencer" />
|
|
38
38
|
</div>
|
|
39
39
|
</div>
|
|
@@ -41,16 +41,19 @@
|
|
|
41
41
|
|
|
42
42
|
<script>
|
|
43
43
|
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
44
|
-
import ButtonBar from "../../../Molecules/Buttons/ButtonBar/ButtonBar.vue";
|
|
45
44
|
import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
|
|
46
45
|
|
|
47
46
|
export default {
|
|
48
47
|
name: 'FencerPoolResultsCard',
|
|
49
|
-
components: {BaseIcon,
|
|
48
|
+
components: { BaseIcon, BaseText },
|
|
50
49
|
props: {
|
|
51
50
|
person: {
|
|
52
51
|
type: Object,
|
|
53
52
|
required: true
|
|
53
|
+
},
|
|
54
|
+
status: {
|
|
55
|
+
type: String,
|
|
56
|
+
required: true
|
|
54
57
|
}
|
|
55
58
|
},
|
|
56
59
|
computed: {
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export const spacingConfig = {
|
|
2
|
+
'Table of 8': {
|
|
3
|
+
large: {
|
|
4
|
+
'Table of 8': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
|
|
5
|
+
Quarterfinal: { getTopSpace: 'mt-[1.34rem] mb-[3.4rem]', getCardSpace: 'mt-[4.5rem]' },
|
|
6
|
+
Semifinal: { getTopSpace: 'mt-[4.6rem] mb-[7rem]', getCardSpace: 'mt-[11.5rem]' },
|
|
7
|
+
Final: { getTopSpace: 'mt-[24.6rem]', getCardSpace: 'mt-1' },
|
|
8
|
+
'Third Place': { getTopSpace: '-mt-[2rem] -ml-[19.2rem]', getCardSpace: 'mt-1' },
|
|
9
|
+
},
|
|
10
|
+
small: {
|
|
11
|
+
'Table of 8': { getTopSpace: 'mt-[0rem] mb-4', getCardSpace: 'mt-1' },
|
|
12
|
+
Quarterfinal: { getTopSpace: 'mt-[0.7rem] mb-[1.8rem]', getCardSpace: 'mt-[2.3rem]' },
|
|
13
|
+
Semifinal: { getTopSpace: 'mt-[2.3rem] mb-[3.6rem]', getCardSpace: 'mt-[5.9rem]' },
|
|
14
|
+
Final: { getTopSpace: 'mt-[12.2rem]', getCardSpace: 'mt-1' },
|
|
15
|
+
'Third Place': { getTopSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1' },
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
'Table of 16': {
|
|
19
|
+
large: {
|
|
20
|
+
// Define your spacing values here
|
|
21
|
+
},
|
|
22
|
+
small: {
|
|
23
|
+
// Define your spacing values here
|
|
24
|
+
}
|
|
25
|
+
},
|
|
26
|
+
// Add up to Table of 256 as needed
|
|
27
|
+
};
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import TableauBoutCard from './TableauBoutCard.vue';
|
|
2
|
+
import getDEWithBouts from '../../../../mocks/getDEWithBouts.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Organisms/Cards/TableauBoutCard',
|
|
6
|
+
component: TableauBoutCard,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
bout: getDEWithBouts.pools[0].Bouts[0],
|
|
10
|
+
hostingClubColors: getDEWithBouts.hostingClubColors,
|
|
11
|
+
large: true,
|
|
12
|
+
roundName: getDEWithBouts.pools[0].Bouts[0].RoundLabel,
|
|
13
|
+
bracketSize: 'Table of 8',
|
|
14
|
+
highLight: false
|
|
15
|
+
},
|
|
16
|
+
argTypes: {
|
|
17
|
+
bout: {
|
|
18
|
+
control: 'object',
|
|
19
|
+
description: 'Bout object containing fencers and scores'
|
|
20
|
+
},
|
|
21
|
+
hostingClubColors: {
|
|
22
|
+
control: 'object',
|
|
23
|
+
description: 'Colors for hosting club'
|
|
24
|
+
},
|
|
25
|
+
large: {
|
|
26
|
+
control: 'boolean',
|
|
27
|
+
description: 'Size of the card'
|
|
28
|
+
},
|
|
29
|
+
roundName: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
description: 'Name of the round'
|
|
32
|
+
},
|
|
33
|
+
bracketSize: {
|
|
34
|
+
control: 'text',
|
|
35
|
+
description: 'Size of the bracket'
|
|
36
|
+
},
|
|
37
|
+
highLight: {
|
|
38
|
+
control: 'boolean',
|
|
39
|
+
description: 'Card is highlighed'
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
export const Default = {
|
|
45
|
+
args: {
|
|
46
|
+
bout: getDEWithBouts.pools[0].Bouts[2],
|
|
47
|
+
hostingClubColors: getDEWithBouts.hostingClubColors,
|
|
48
|
+
large: true,
|
|
49
|
+
roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
|
|
50
|
+
bracketSize: 'Table of 8',
|
|
51
|
+
highLight: false
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
let modifiedBout = { ...getDEWithBouts.pools[0].Bouts[2], Status: 'Active' };
|
|
56
|
+
export const ActiveBout = {
|
|
57
|
+
args: {
|
|
58
|
+
bout: modifiedBout,
|
|
59
|
+
hostingClubColors: getDEWithBouts.hostingClubColors,
|
|
60
|
+
large: true,
|
|
61
|
+
roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
|
|
62
|
+
bracketSize: 'Table of 8',
|
|
63
|
+
highLight: false
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
export const smallCardBout = {
|
|
68
|
+
args: {
|
|
69
|
+
bout: getDEWithBouts.pools[0].Bouts[1],
|
|
70
|
+
hostingClubColors: getDEWithBouts.hostingClubColors,
|
|
71
|
+
large: false,
|
|
72
|
+
roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
|
|
73
|
+
bracketSize: 'Table of 8',
|
|
74
|
+
highLight: false
|
|
75
|
+
}
|
|
76
|
+
};
|
|
77
|
+
|
|
78
|
+
modifiedBout = { ...getDEWithBouts.pools[0].Bouts[2], Status: 'Completed' };
|
|
79
|
+
export const CompletedBout = {
|
|
80
|
+
args: {
|
|
81
|
+
bout: modifiedBout,
|
|
82
|
+
large: true,
|
|
83
|
+
roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
|
|
84
|
+
highLight: false
|
|
85
|
+
}
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
modifiedBout = { ...getDEWithBouts.pools[0].Bouts[0], Status: 'Completed' };
|
|
89
|
+
export const ByeBout = {
|
|
90
|
+
args: {
|
|
91
|
+
bout: modifiedBout,
|
|
92
|
+
hostingClubColors: getDEWithBouts.hostingClubColors,
|
|
93
|
+
large: false,
|
|
94
|
+
roundName: getDEWithBouts.pools[0].Bouts[1].RoundLabel,
|
|
95
|
+
bracketSize: 'Table of 8',
|
|
96
|
+
highLight: false
|
|
97
|
+
}
|
|
98
|
+
};
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section :class="getTopSpace">
|
|
3
|
+
<div v-if="roundName === 'Third Place'" class="flex justify-center border-b mb-4 mt-8" :class="large ? 'w-72': 'w-40'">
|
|
4
|
+
<BaseText :text="roundName" size="sm" color="quaternary"/>
|
|
5
|
+
</div>
|
|
6
|
+
<div v-if="roundName === 'Final'" class="flex justify-center border-b mb-4 mt-0" :class="large ? 'w-72': 'w-40'">
|
|
7
|
+
<BaseText :text="roundName" size="sm" color="quaternary"/>
|
|
8
|
+
</div>
|
|
9
|
+
<!-- Replacement headers for finals -->
|
|
10
|
+
<section @click="handleBoutClick(bout)">
|
|
11
|
+
<TableauFencerCard
|
|
12
|
+
:fencer="person1Display"
|
|
13
|
+
:score="score1"
|
|
14
|
+
:position="dePosition1"
|
|
15
|
+
:color="hostingClubColors.Color1"
|
|
16
|
+
:scoreColor="getScoreColor(true)"
|
|
17
|
+
:large="large"
|
|
18
|
+
:highLight="highlight"
|
|
19
|
+
@action:highLight="handleHighlight"
|
|
20
|
+
/>
|
|
21
|
+
</section>
|
|
22
|
+
<!-- Card break -->
|
|
23
|
+
<div :class="getCardSpace"></div>
|
|
24
|
+
<!-- Card break -->
|
|
25
|
+
<section>
|
|
26
|
+
<TableauFencerCard
|
|
27
|
+
:fencer="person2Display"
|
|
28
|
+
:score="score2"
|
|
29
|
+
:position="dePosition2"
|
|
30
|
+
:color="hostingClubColors.Color2"
|
|
31
|
+
:scoreColor="getScoreColor(false)"
|
|
32
|
+
:large="large"
|
|
33
|
+
:highLight="highlight"
|
|
34
|
+
@action:highLight="handleHighlight"
|
|
35
|
+
/>
|
|
36
|
+
</section>
|
|
37
|
+
</section>
|
|
38
|
+
</template>
|
|
39
|
+
|
|
40
|
+
<script>
|
|
41
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
42
|
+
import TableauFencerCard from '../TableauFencerCard/TableauFencerCard.vue';
|
|
43
|
+
import { spacingConfig } from './SpacingConfig';
|
|
44
|
+
|
|
45
|
+
export default {
|
|
46
|
+
name: 'TableauBoutCard',
|
|
47
|
+
components: { BaseText, TableauFencerCard },
|
|
48
|
+
props: {
|
|
49
|
+
bout: {
|
|
50
|
+
type: Object,
|
|
51
|
+
required: true
|
|
52
|
+
},
|
|
53
|
+
hostingClubColors: {
|
|
54
|
+
type: Object,
|
|
55
|
+
required: true
|
|
56
|
+
},
|
|
57
|
+
large: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: true
|
|
60
|
+
},
|
|
61
|
+
roundName: {
|
|
62
|
+
type: String,
|
|
63
|
+
required: true
|
|
64
|
+
},
|
|
65
|
+
bracketSize: {
|
|
66
|
+
type: String,
|
|
67
|
+
required: true
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
data() {
|
|
71
|
+
return {
|
|
72
|
+
highlight: false,
|
|
73
|
+
currentConfig: {}
|
|
74
|
+
};
|
|
75
|
+
},
|
|
76
|
+
mounted() {
|
|
77
|
+
this.updateConfig();
|
|
78
|
+
},
|
|
79
|
+
watch: {
|
|
80
|
+
large(newVal, oldVal) {
|
|
81
|
+
if (newVal !== oldVal) {
|
|
82
|
+
this.updateConfig();
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
bracketSize(newVal, oldVal) {
|
|
86
|
+
if (newVal !== oldVal) {
|
|
87
|
+
this.updateConfig();
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
methods: {
|
|
92
|
+
updateConfig() {
|
|
93
|
+
const size = this.large ? 'large' : 'small';
|
|
94
|
+
this.currentConfig = spacingConfig[this.bracketSize]?.[size]?.[this.roundName] || {};
|
|
95
|
+
},
|
|
96
|
+
handleBoutClick(bout) {
|
|
97
|
+
if (bout.Status === 'Completed') {
|
|
98
|
+
this.$emit('action:editBout', bout);
|
|
99
|
+
} else {
|
|
100
|
+
this.$emit('action:directingBout', bout);
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
getScoreColor(isPerson1) {
|
|
104
|
+
if (isPerson1) {
|
|
105
|
+
if (this.bout.Score1 > this.bout.Score2) {
|
|
106
|
+
return 'bg-winGreen';
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (this.bout.Score1 < this.bout.Score2 && this.bout.Status === 'Active') {
|
|
110
|
+
return 'bg-lossRed';
|
|
111
|
+
}
|
|
112
|
+
} else {
|
|
113
|
+
if (this.bout.Score1 < this.bout.Score2) {
|
|
114
|
+
return 'bg-winGreen';
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
if (this.bout.Score1 > this.bout.Score2 && this.bout.Status === 'Active') {
|
|
118
|
+
return 'bg-lossRed';
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
return 'bg-dropdownSelect';
|
|
122
|
+
},
|
|
123
|
+
handleHighlight(value) {
|
|
124
|
+
if (this.bout.Person1.DisplayName.length < 1 || this.bout.Person2.DisplayName.length < 1) return;
|
|
125
|
+
if (this.bout.Person1.DisplayName === 'BYE' || this.bout.Person2.DisplayName === 'BYE') return;
|
|
126
|
+
this.highlight = value;
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
computed: {
|
|
130
|
+
dePosition1() {
|
|
131
|
+
return this.bout.Person1?.EventPersons?.[0]?.DEPosition ?? '';
|
|
132
|
+
},
|
|
133
|
+
score1() {
|
|
134
|
+
return `${this.bout.Score1}`;
|
|
135
|
+
},
|
|
136
|
+
dePosition2() {
|
|
137
|
+
return this.bout.Person2?.EventPersons?.[0]?.DEPosition ?? '';
|
|
138
|
+
},
|
|
139
|
+
score2() {
|
|
140
|
+
return `${this.bout.Score2}`;
|
|
141
|
+
},
|
|
142
|
+
getTopSpace() {
|
|
143
|
+
return this.currentConfig?.getTopSpace || '';
|
|
144
|
+
},
|
|
145
|
+
getCardSpace() {
|
|
146
|
+
return this.currentConfig?.getCardSpace || '';
|
|
147
|
+
},
|
|
148
|
+
person1Display() {
|
|
149
|
+
if (this.bout.Status === "Scheduled" && this.bout.Person1.DisplayName === 'BYE') {
|
|
150
|
+
return { ...this.bout.Person1, DisplayName: '', Club: { Name: '' } };
|
|
151
|
+
}
|
|
152
|
+
return this.bout.Person1;
|
|
153
|
+
},
|
|
154
|
+
person2Display() {
|
|
155
|
+
if (this.bout.Status === "Scheduled" && this.bout.Person2.DisplayName === 'BYE') {
|
|
156
|
+
return { ...this.bout.Person2, DisplayName: '', Club: { Name: '' } };
|
|
157
|
+
}
|
|
158
|
+
return this.bout.Person2;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
</script>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import TableauFencerCard from './TableauFencerCard.vue';
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Organisms/Cards/TableauFencerCard',
|
|
6
|
+
component: TableauFencerCard,
|
|
7
|
+
args: {
|
|
8
|
+
fencer: {
|
|
9
|
+
DisplayName: 'John Doe',
|
|
10
|
+
Club: {
|
|
11
|
+
Name: 'Fencing Club'
|
|
12
|
+
},
|
|
13
|
+
Images: [
|
|
14
|
+
{
|
|
15
|
+
URL: 'https://randomuser.me/api/portraits/men/91.jpg'
|
|
16
|
+
}
|
|
17
|
+
]
|
|
18
|
+
},
|
|
19
|
+
score: '15',
|
|
20
|
+
position: '1',
|
|
21
|
+
color: 'blue',
|
|
22
|
+
scoreColor: 'bg-winGreen',
|
|
23
|
+
large: true
|
|
24
|
+
},
|
|
25
|
+
argTypes: {
|
|
26
|
+
fencer: {
|
|
27
|
+
control: 'object',
|
|
28
|
+
description: 'Object containing fencer details including name, club, and images'
|
|
29
|
+
},
|
|
30
|
+
score: {
|
|
31
|
+
control: 'text',
|
|
32
|
+
description: 'Score of the fencer'
|
|
33
|
+
},
|
|
34
|
+
position: {
|
|
35
|
+
control: 'text',
|
|
36
|
+
description: 'Position of the fencer in the bracket'
|
|
37
|
+
},
|
|
38
|
+
color: {
|
|
39
|
+
control: 'color',
|
|
40
|
+
description: 'Color for the position background'
|
|
41
|
+
},
|
|
42
|
+
scoreColor: {
|
|
43
|
+
control: 'color',
|
|
44
|
+
description: 'Color for the score background'
|
|
45
|
+
},
|
|
46
|
+
large: {
|
|
47
|
+
control: 'boolean',
|
|
48
|
+
description: 'Boolean to determine the size of the card'
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Default = {
|
|
54
|
+
args: {
|
|
55
|
+
fencer: {
|
|
56
|
+
DisplayName: 'John Doe',
|
|
57
|
+
Club: {
|
|
58
|
+
Name: 'Fencing Club'
|
|
59
|
+
},
|
|
60
|
+
Images: [
|
|
61
|
+
{
|
|
62
|
+
URL: 'https://randomuser.me/api/portraits/men/50.jpg'
|
|
63
|
+
}
|
|
64
|
+
]
|
|
65
|
+
},
|
|
66
|
+
score: '15',
|
|
67
|
+
position: '1',
|
|
68
|
+
color: 'blue',
|
|
69
|
+
scoreColor: 'bg-winGreen',
|
|
70
|
+
large: true
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export const Small = {
|
|
75
|
+
args: {
|
|
76
|
+
fencer: {
|
|
77
|
+
DisplayName: 'Jane Doe',
|
|
78
|
+
Club: {
|
|
79
|
+
Name: 'Fencing Club'
|
|
80
|
+
},
|
|
81
|
+
Images: [
|
|
82
|
+
{
|
|
83
|
+
URL: 'https://via.placeholder.com/40'
|
|
84
|
+
}
|
|
85
|
+
]
|
|
86
|
+
},
|
|
87
|
+
score: '12',
|
|
88
|
+
position: '2',
|
|
89
|
+
color: 'red',
|
|
90
|
+
scoreColor: 'bg-lossRed',
|
|
91
|
+
large: false
|
|
92
|
+
}
|
|
93
|
+
};
|