@dcrackel/meyersquaredui 1.0.259 → 1.0.261
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/meyersquaredui.es.js +1025 -960
- package/dist/meyersquaredui.umd.js +5 -5
- package/package.json +1 -1
- package/src/mocks/getDEWithBouts16.js +7 -4
- package/src/mocks/getDEWithBouts32.js +2342 -0
- package/src/mocks/getDEWithBouts64.js +4484 -0
- package/src/stories/Organisms/Tableau/Tableau.stories.js +3 -2
- package/src/stories/Organisms/Tableau/Tableau.vue +15 -31
- package/src/stories/Organisms/Tableau/components/FinalColumn/BigFinalBoutCard.vue +20 -6
- package/src/stories/Organisms/Tableau/components/FinalColumn/FinalColumn.vue +2 -2
- package/src/stories/Organisms/Tableau/components/TableauBoutCard/TableauBoutCard.vue +81 -65
- package/src/stories/Organisms/Tableau/components/TableauFencerCard/TableauFencerCard.vue +3 -11
- package/src/stories/Organisms/Tableau/layout/TableauLayoutEngine.js +12 -1
- package/src/mocks/getDEWithBouts2.js +0 -7360
- package/src/stories/Organisms/Tableau/components/TableauActiveBoutCard/SpacingConfig.js +0 -71
- package/src/stories/Organisms/Tableau/components/TableauActiveBoutCard/TableauActiveBoutCard.stories.js +0 -98
- package/src/stories/Organisms/Tableau/components/TableauActiveBoutCard/TableauActiveBoutCard.vue +0 -165
|
@@ -1,71 +0,0 @@
|
|
|
1
|
-
export const SpacingConfig = {
|
|
2
|
-
'Semifinal': {
|
|
3
|
-
large: {
|
|
4
|
-
},
|
|
5
|
-
small: {
|
|
6
|
-
Semifinal: {topSpace: 'mt-[0.7rem] mb-[1.8rem]', cardSpace: 'mt-[2.3rem]', gap: 40},
|
|
7
|
-
Final: {topSpace: 'mt-[12.2rem]', gap: 50},
|
|
8
|
-
'Third Place': {topSpace: '-mt-8 -ml-44', gap: 30}
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
'Table of 8': {
|
|
12
|
-
large: {
|
|
13
|
-
},
|
|
14
|
-
small: {
|
|
15
|
-
'Table of 8': { topSpace: 'mt-0 mb-4', leftLine: 'hidden', timeBox: '-right-[35px]', gap: 0},
|
|
16
|
-
Semifinal: { topSpace: 'mt-[0.7rem] mb-[1.8rem]', leftLine: 'h-[56px] mt-[19px] -ml-[1px]', timeBox: '-right-[35px]', gap: 32,},
|
|
17
|
-
Final: { topSpace: 'mt-[2.6rem]', getCardSpace: 'mt-1', timeBox: 'mt-[2.3rem] -right-[35px]', gap: 32, leftLine: 'hidden'},
|
|
18
|
-
'Third Place': { topSpace: '-mt-8 -ml-40', leftLine: 'h-0', timeBox: '-right-[35px] top-[69px]',gap: 0,}
|
|
19
|
-
}
|
|
20
|
-
},
|
|
21
|
-
'Table of 16': {
|
|
22
|
-
large: {
|
|
23
|
-
},
|
|
24
|
-
small: {
|
|
25
|
-
'Table of 16': { topSpace: 'mt-[0rem] mb-4', getCardSpace: 'mt-1', timeBox: '-right-[35px]', gap: 0, leftLine: 'hidden'},
|
|
26
|
-
'Table of 8': { topSpace: 'mt-[0rem] mb-[1.5rem]', getCardSpace: 'mt-[0rem]', timeBox: '-right-[35px]', gap: 50, leftLine: 'mt-[1.2rem] h-[3.56rem]'},
|
|
27
|
-
Semifinal: { topSpace: 'mt-[2.25rem] mb-[3.63rem]', getCardSpace: 'mt-[0rem]', timeBox: '-right-[35px]', gap: 92, leftLine: 'mt-[2.8rem] h-[7.1rem]'},
|
|
28
|
-
Final: { topSpace: 'mt-[7rem]', getCardSpace: 'mt-1', timeBox: 'mt-[2.3rem] -right-[35px]', gap: 0, leftLine: 'hidden'},
|
|
29
|
-
'Third Place': { topSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1'},
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
'Table of 32': {
|
|
33
|
-
large: {
|
|
34
|
-
},
|
|
35
|
-
small: {
|
|
36
|
-
'Table of 32': { topSpace: 'mt-[0rem] mb-4', getCardSpace: 'mt-1', timeBox: '-right-[35px]', gap: 0, leftLine: 'hidden'},
|
|
37
|
-
'Table of 16': { topSpace: 'mt-[0rem] mb-[1.5rem]', getCardSpace: 'mt-[0rem]', timeBox: '-right-[35px]', gap: 50, leftLine: 'mt-[1.3rem] h-[3.5rem]'},
|
|
38
|
-
'Table of 8': { topSpace: 'mt-[2.4rem] mb-[3.45rem]', getCardSpace: 'mt-[5.9rem]', timeBox: '-right-[35px]', gap: 92,leftLine: 'mt-[3rem] h-[7rem] '},
|
|
39
|
-
Semifinal: { topSpace: 'mt-[5.5rem] mb-[7.5rem]', getCardSpace: 'mt-[12.8rem]', timeBox: '-right-[35px]', gap: 200, leftLine: 'mt-[7rem] h-[14rem]'},
|
|
40
|
-
Final: { topSpace: 'mt-[12.5rem]', getCardSpace: 'mt-1', timeBox: 'mt-[2.3rem] -right-[35px]', gap: 0, leftLine: 'hidden'},
|
|
41
|
-
'Third Place': { topSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1', timeBox: '-right-[35px]', gap: 0, leftLine: 'mt-[3rem] h-[7rem]'},
|
|
42
|
-
}
|
|
43
|
-
},
|
|
44
|
-
'Table of 64': {
|
|
45
|
-
large: {
|
|
46
|
-
},
|
|
47
|
-
small: {
|
|
48
|
-
'Table of 64': { topSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1'},
|
|
49
|
-
'Table of 32': { topSpace: 'mt-[0.7rem] mb-[2.65rem]', getCardSpace: 'mt-[3.4rem]'},
|
|
50
|
-
'Table of 16': { topSpace: 'mt-[2.9rem] mb-[5rem]', getCardSpace: 'mt-[7.85rem]'},
|
|
51
|
-
'Table of 8': { topSpace: 'mt-[7rem] mb-[9.95rem]', getCardSpace: 'mt-[16.8rem]'},
|
|
52
|
-
Semifinal: { topSpace: 'mt-[16.1rem] mb-[18.8rem]', getCardSpace: 'mt-[34.8rem]'},
|
|
53
|
-
Final: { topSpace: 'mt-[68rem]', getCardSpace: 'mt-1'},
|
|
54
|
-
'Third Place': { topSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1'},
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
'Table of 128': {
|
|
58
|
-
large: {
|
|
59
|
-
},
|
|
60
|
-
small: {
|
|
61
|
-
'Table of 128': { topSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1'},
|
|
62
|
-
'Table of 64': { topSpace: 'mt-[0.7rem] mb-[2.65rem]', getCardSpace: 'mt-[3.4rem]'},
|
|
63
|
-
'Table of 32': { topSpace: 'mt-[2.9rem] mb-[5rem]', getCardSpace: 'mt-[7.85rem]'},
|
|
64
|
-
'Table of 16': { topSpace: 'mt-[7rem] mb-[9.95rem]', getCardSpace: 'mt-[16.8rem]'},
|
|
65
|
-
'Table of 8': { topSpace: 'mt-[16.1rem] mb-[18.8rem]', getCardSpace: 'mt-[34.8rem]'},
|
|
66
|
-
Semifinal: { topSpace: 'mt-[34.3rem] mb-[36.5rem]', getCardSpace: 'mt-[70.8rem]'},
|
|
67
|
-
Final: { topSpace: 'mt-[140rem]', getCardSpace: 'mt-1'},
|
|
68
|
-
'Third Place': { topSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1'},
|
|
69
|
-
}
|
|
70
|
-
},
|
|
71
|
-
};
|
|
@@ -1,98 +0,0 @@
|
|
|
1
|
-
import TableauActiveBoutCard from './TableauActiveBoutCard.vue';
|
|
2
|
-
import getDEWithBouts from '../../../../../mocks/getDEWithBouts.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Organisms/Tableau/TableauActiveBoutCard',
|
|
6
|
-
component: TableauActiveBoutCard,
|
|
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
|
-
};
|
package/src/stories/Organisms/Tableau/components/TableauActiveBoutCard/TableauActiveBoutCard.vue
DELETED
|
@@ -1,165 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="border-l border-primary" :class="leftLine"></div>
|
|
3
|
-
<div :class="getTopSpace" class="relative flex flex-col justify-center">
|
|
4
|
-
<!-- Dynamic spacer above to keep the bout centered in the container -->
|
|
5
|
-
<div :style="{ height: `${computedTopBottomGap / 2}px` }"></div>
|
|
6
|
-
|
|
7
|
-
<!-- Bout Round Headers (Third Place / Final) -->
|
|
8
|
-
<div v-if="roundName === 'Third Place'" class="flex justify-center border-accent border-b mb-4 mt-8"
|
|
9
|
-
:class="'w-40'">
|
|
10
|
-
<BaseText size="sm" color="primary">{{ roundName }}</BaseText>
|
|
11
|
-
</div>
|
|
12
|
-
<div v-if="roundName === 'Final'" class="flex justify-center border-accent border-b mb-4 mt-0"
|
|
13
|
-
:class="'w-40'">
|
|
14
|
-
<BaseText size="sm" color="primary">{{ roundName }}</BaseText>
|
|
15
|
-
</div>
|
|
16
|
-
<!-- Fencer 1 Card -->
|
|
17
|
-
<section>
|
|
18
|
-
<TableauFencerCard
|
|
19
|
-
:fencer="person1Display"
|
|
20
|
-
:score="score1"
|
|
21
|
-
:position="dePosition1"
|
|
22
|
-
:color="hostingClubColors.Color1"
|
|
23
|
-
:scoreColor="getScoreColor(true)"
|
|
24
|
-
:highlight="highlight"
|
|
25
|
-
/>
|
|
26
|
-
</section>
|
|
27
|
-
|
|
28
|
-
<!-- Fixed separator between fencers -->
|
|
29
|
-
<div class="pt-1 bg-primary"></div>
|
|
30
|
-
|
|
31
|
-
<!-- Timer for Active Bout -->
|
|
32
|
-
<transition enter-active-class="slideIn" leave-active-class="slideOut">
|
|
33
|
-
<div class="text-center items-center justify-center flex bg-primary p-1 absolute rounded-r-md h-10 w-9 z-50" :class="timeBox">
|
|
34
|
-
<BaseText size="xs" color="white" weight="bold" class="font-sourceCodePro">{{ displayTime }}</BaseText>
|
|
35
|
-
</div>
|
|
36
|
-
</transition>
|
|
37
|
-
|
|
38
|
-
<!-- Fencer 2 Card -->
|
|
39
|
-
<section>
|
|
40
|
-
<TableauFencerCard
|
|
41
|
-
:fencer="person2Display"
|
|
42
|
-
:score="score2"
|
|
43
|
-
:position="dePosition2"
|
|
44
|
-
:color="hostingClubColors.Color2"
|
|
45
|
-
:scoreColor="getScoreColor(false)"
|
|
46
|
-
/>
|
|
47
|
-
</section>
|
|
48
|
-
|
|
49
|
-
<!-- Dynamic spacer below to keep the bout centered in the container -->
|
|
50
|
-
<div :style="{ height: `${computedTopBottomGap / 2}px` }"></div>
|
|
51
|
-
</div>
|
|
52
|
-
</template>
|
|
53
|
-
|
|
54
|
-
<script>
|
|
55
|
-
import BaseText from "../../../../Atoms/BaseText/BaseText.vue";
|
|
56
|
-
import TableauFencerCard from '../TableauFencerCard/TableauFencerCard.vue';
|
|
57
|
-
import {SpacingConfig} from './SpacingConfig.js';
|
|
58
|
-
|
|
59
|
-
export default {
|
|
60
|
-
name: 'TableauBoutCard',
|
|
61
|
-
components: {BaseText, TableauFencerCard},
|
|
62
|
-
props: {
|
|
63
|
-
bout: Object,
|
|
64
|
-
hostingClubColors: Object,
|
|
65
|
-
roundName: String,
|
|
66
|
-
bracketSize: String
|
|
67
|
-
},
|
|
68
|
-
data() {
|
|
69
|
-
return {
|
|
70
|
-
highlight: false,
|
|
71
|
-
currentConfig: {},
|
|
72
|
-
remainingTime: this.bout?.TimeLeft || 0
|
|
73
|
-
};
|
|
74
|
-
},
|
|
75
|
-
mounted() {
|
|
76
|
-
this.updateConfig();
|
|
77
|
-
if (this.bout.TimerStatus === 'running') this.startTimer();
|
|
78
|
-
},
|
|
79
|
-
beforeDestroy() {
|
|
80
|
-
this.stopTimer();
|
|
81
|
-
},
|
|
82
|
-
watch: {
|
|
83
|
-
bracketSize: 'updateConfig',
|
|
84
|
-
bout(newVal) {
|
|
85
|
-
this.remainingTime = newVal?.TimeLeft || 0;
|
|
86
|
-
if (newVal.TimerStatus === 'running') this.startTimer();
|
|
87
|
-
else this.stopTimer();
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
methods: {
|
|
91
|
-
updateConfig() {
|
|
92
|
-
const size = 'small';
|
|
93
|
-
this.currentConfig = SpacingConfig[this.bracketSize]?.[size]?.[this.roundName] || {};
|
|
94
|
-
},
|
|
95
|
-
getScoreColor(isPerson1) {
|
|
96
|
-
const {Person1, Person2, Score1, Score2, Status} = this.bout;
|
|
97
|
-
const winningColor = 'bg-accent';
|
|
98
|
-
const neutralColor = 'bg-white';
|
|
99
|
-
|
|
100
|
-
if (isPerson1) {
|
|
101
|
-
if (Person2.DisplayName === 'BYE' && Person1.DisplayName !== 'BYE') return winningColor;
|
|
102
|
-
return Score1 > Score2 ? winningColor : Status === 'Active' ? neutralColor : '';
|
|
103
|
-
} else {
|
|
104
|
-
if (Person1.DisplayName === 'BYE' && Person2.DisplayName !== 'BYE') return winningColor;
|
|
105
|
-
return Score2 > Score1 ? winningColor : Status === 'Active' ? neutralColor : '';
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
startTimer() {
|
|
109
|
-
if (this.interval) clearInterval(this.interval);
|
|
110
|
-
this.interval = setInterval(() => {
|
|
111
|
-
if (this.remainingTime > 0) this.remainingTime--;
|
|
112
|
-
else this.stopTimer();
|
|
113
|
-
}, 1000);
|
|
114
|
-
},
|
|
115
|
-
stopTimer() {
|
|
116
|
-
if (this.interval) clearInterval(this.interval);
|
|
117
|
-
this.interval = null;
|
|
118
|
-
}
|
|
119
|
-
},
|
|
120
|
-
computed: {
|
|
121
|
-
computedTopBottomGap() {
|
|
122
|
-
return this.currentConfig.gap;
|
|
123
|
-
},
|
|
124
|
-
dePosition1() {
|
|
125
|
-
return this.bout.Person1?.EventPersons?.[0]?.DEPosition || '';
|
|
126
|
-
},
|
|
127
|
-
score1() {
|
|
128
|
-
return `${this.bout.Score1}`;
|
|
129
|
-
},
|
|
130
|
-
dePosition2() {
|
|
131
|
-
return this.bout.Person2?.EventPersons?.[0]?.DEPosition || '';
|
|
132
|
-
},
|
|
133
|
-
score2() {
|
|
134
|
-
return `${this.bout.Score2}`;
|
|
135
|
-
},
|
|
136
|
-
timeBox() {
|
|
137
|
-
return this.currentConfig.timeBox || '';
|
|
138
|
-
},
|
|
139
|
-
leftLine() {
|
|
140
|
-
return this.currentConfig.leftLine || '';
|
|
141
|
-
},
|
|
142
|
-
getTopSpace() {
|
|
143
|
-
return this.currentConfig.topSpace || '';
|
|
144
|
-
},
|
|
145
|
-
getCardSpace() {
|
|
146
|
-
return this.currentConfig.cardSpace || '';
|
|
147
|
-
},
|
|
148
|
-
person1Display() {
|
|
149
|
-
if (this.bout.Status === "Scheduled" && this.bout.Person1.DisplayName === 'BYE')
|
|
150
|
-
return {...this.bout.Person1, DisplayName: '', Club: {Name: ''}};
|
|
151
|
-
return this.bout.Person1;
|
|
152
|
-
},
|
|
153
|
-
person2Display() {
|
|
154
|
-
if (this.bout.Status === "Scheduled" && this.bout.Person2.DisplayName === 'BYE')
|
|
155
|
-
return {...this.bout.Person2, DisplayName: '', Club: {Name: ''}};
|
|
156
|
-
return this.bout.Person2;
|
|
157
|
-
},
|
|
158
|
-
displayTime() {
|
|
159
|
-
const minutes = Math.floor(this.remainingTime / 60).toString();
|
|
160
|
-
const seconds = (this.remainingTime % 60).toString().padStart(2, '0');
|
|
161
|
-
return `${minutes}:${seconds}`;
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
};
|
|
165
|
-
</script>
|