@dcrackel/hematournamentui 1.0.698 → 1.0.701
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 +3 -0
- package/dist/HemaTournamentUI-lib.es.js +10512 -10219
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +14 -0
- package/dist/hematournamentui.css +1 -1
- package/package.json +92 -92
- package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue +1 -1
- package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +1 -1
- package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +2 -2
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardActive/BoutCardActive.vue +25 -22
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardInactive/BoutCardInactive.vue +31 -29
- package/src/stories/Organisms/Cards/BoutCard/Variants/BoutCardWaiting/BoutCardWaiting.vue +2 -4
- package/src/stories/Organisms/Cards/KioskCard/KioskCard.vue +31 -31
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.stories.js +6 -6
- package/src/stories/Organisms/Cards/PenaltyCard/PenaltyCard.vue +64 -53
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.stories.js +6 -7
- package/src/stories/Organisms/Cards/PenaltyFencerCard/PenaltyFencerCard.vue +18 -10
- package/src/stories/Organisms/Cards/StaffCard/StaffCard.vue +4 -4
- package/src/stories/Organisms/ComplexInputs/DatePicker/DatePicker.vue +64 -45
- package/src/stories/Organisms/Containers/Pool/Pool.vue +1 -1
- package/src/stories/Organisms/Containers/PoolResults/PoolResultsTable.vue +35 -20
- package/src/stories/Templates/Assignment/Assignment.stories.js +17 -15
- package/src/stories/Templates/Assignment/Assignment.vue +71 -40
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.stories.js +49 -30
- package/src/stories/Templates/ClubManagement/ClubBasic/ClubBasic.vue +29 -28
- package/src/stories/Templates/ClubManagement/{ClubMangement.stories.js → ClubManagement.stories.js} +74 -59
- package/src/stories/Templates/ClubManagement/ClubManagement.vue +104 -92
- package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +92 -97
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +37 -33
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +11 -14
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +34 -37
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.stories.js +11 -10
- package/src/stories/Templates/EventManagement/EventFinalResults/EventFinalResults.vue +8 -8
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.stories.js +13 -16
- package/src/stories/Templates/EventManagement/KioskDisplay/KioskDisplay.vue +15 -19
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.stories.js +25 -24
- package/src/stories/Templates/EventManagement/Penalties/PenaltyReport.vue +28 -34
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.stories.js +54 -19
- package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +75 -68
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +55 -45
- package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +47 -55
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.stories.js +56 -55
- package/src/stories/Templates/EventManagement/PoolResults/PoolResults.vue +71 -73
- package/src/stories/Templates/EventManagement/StaffList/StaffList.stories.js +18 -16
- package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +9 -6
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.stories.js +22 -19
- package/src/stories/Templates/Menus/Admin/AdminLeftMenu.vue +44 -36
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.stories.js +30 -23
- package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +55 -58
- package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +67 -0
- package/src/stories/Templates/PersonManagement/Admin/{Administration.vue → Administration/Administration.vue} +94 -87
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin/FencerAdmin.stories.js +71 -0
- package/src/stories/Templates/PersonManagement/Admin/{FencerAdmin.vue → FencerAdmin/FencerAdmin.vue} +90 -77
- package/src/stories/Templates/PersonManagement/Admin/MergeAccounts/MergeAccounts.stories.js +86 -0
- package/src/stories/Templates/PersonManagement/Admin/{MergeAccounts.vue → MergeAccounts/MergeAccounts.vue} +258 -242
- package/src/stories/Templates/PersonManagement/Attendance/Attendance.vue +28 -28
- package/src/stories/Templates/PersonManagement/PersonManagement.vue +1 -1
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.stories.js +45 -28
- package/src/stories/Templates/TournamentManagement/ListEvents/ListEvents.vue +22 -16
- package/src/stories/Templates/TournamentManagement/{TournamentMangement.stories.js → TournamentManagement.stories.js} +68 -39
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +199 -153
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +113 -0
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +123 -106
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/TournamentPageTwo.stories.js +76 -31
- package/src/stories/Templates/TournamentManagement/TournamentPageTwo/{TouranmentPageTwo.vue → TournamentPageTwo.vue} +63 -44
- package/src/stories/Templates/PersonManagement/Admin/FencerAdmin.stories.js +0 -48
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TouranmentPageOne.stories.js +0 -63
|
@@ -42,18 +42,16 @@
|
|
|
42
42
|
</template>
|
|
43
43
|
|
|
44
44
|
<script>
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import BaseModal from "../../../Molecules/Modals/BaseModal/BaseModal.vue";
|
|
51
|
-
import { tabs } from '../../../Util/tabs.js';
|
|
45
|
+
import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue";
|
|
46
|
+
import PoolResultsHeader from "../../../Organisms/Headers/PoolResultsHeader/PoolResultsHeader.vue";
|
|
47
|
+
import PoolResultsTable from "../../../Organisms/Containers/PoolResults/PoolResultsTable.vue";
|
|
48
|
+
import BaseModal from "../../../Molecules/Modals/BaseModal/BaseModal.vue";
|
|
49
|
+
import { tabs } from '../../../Util/tabs.js';
|
|
52
50
|
|
|
53
51
|
export default {
|
|
54
|
-
name: 'PoolResults',
|
|
55
|
-
emits: ['tab:menu-click', 'update:moveFencerDESeedDown', 'update:moveFencerDESeedUp', 'update:withdraw'],
|
|
56
|
-
components: {BaseModal, PoolResultsTable,
|
|
52
|
+
name: 'PoolResults',
|
|
53
|
+
emits: ['tab:menu-click', 'update:moveFencerDESeedDown', 'update:moveFencerDESeedUp', 'update:withdraw'],
|
|
54
|
+
components: {BaseModal, PoolResultsTable, PoolResultsHeader, EditEventsTopMenu},
|
|
57
55
|
props: {
|
|
58
56
|
event: {
|
|
59
57
|
type: Object,
|
|
@@ -72,12 +70,12 @@ export default {
|
|
|
72
70
|
return {
|
|
73
71
|
tabs,
|
|
74
72
|
windowWidth: window.innerWidth,
|
|
75
|
-
initialCutoffIndex: 0,
|
|
76
|
-
showRemoveModal: false,
|
|
77
|
-
withdrawPerson:
|
|
78
|
-
localPoolResults: this.poolResults,
|
|
79
|
-
localPromoted: 100,
|
|
80
|
-
isPromotedSet: false
|
|
73
|
+
initialCutoffIndex: 0,
|
|
74
|
+
showRemoveModal: false,
|
|
75
|
+
withdrawPerson: {},
|
|
76
|
+
localPoolResults: this.clonePoolResults(this.poolResults),
|
|
77
|
+
localPromoted: 100,
|
|
78
|
+
isPromotedSet: false
|
|
81
79
|
}
|
|
82
80
|
},
|
|
83
81
|
mounted() {
|
|
@@ -89,12 +87,13 @@ export default {
|
|
|
89
87
|
window.removeEventListener('resize', this.handleResize);
|
|
90
88
|
},
|
|
91
89
|
watch: {
|
|
92
|
-
poolResults: {
|
|
93
|
-
deep: true,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
90
|
+
poolResults: {
|
|
91
|
+
deep: true,
|
|
92
|
+
immediate: true,
|
|
93
|
+
handler(newVal) {
|
|
94
|
+
this.localPoolResults = this.clonePoolResults(newVal);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
98
97
|
},
|
|
99
98
|
computed: {
|
|
100
99
|
isMobile() {
|
|
@@ -109,16 +108,18 @@ export default {
|
|
|
109
108
|
eventStatus() {
|
|
110
109
|
return this.event?.Status || this.event?.status || '';
|
|
111
110
|
},
|
|
112
|
-
rules() {
|
|
113
|
-
return this.event.EventRules || this.event.eventRules || [];
|
|
114
|
-
},
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
111
|
+
rules() {
|
|
112
|
+
return this.event.EventRules || this.event.eventRules || [];
|
|
113
|
+
},
|
|
114
|
+
promotedByRule() {
|
|
115
|
+
const rule = this.rules.find((rule) => rule.Rules.RuleName === "DEPromoteBy");
|
|
116
|
+
return rule ? rule.RuleValue : "Percent";
|
|
117
|
+
},
|
|
118
|
+
},
|
|
119
|
+
methods: {
|
|
120
|
+
getPromotedByRule() {
|
|
121
|
+
return this.promotedByRule;
|
|
122
|
+
},
|
|
122
123
|
getInitialPromoted() {
|
|
123
124
|
if (!this.isPromotedSet) {
|
|
124
125
|
this.isPromotedSet = true;
|
|
@@ -130,16 +131,13 @@ export default {
|
|
|
130
131
|
handleTabMenuClick(value) {
|
|
131
132
|
this.$emit('tab:menu-click', value);
|
|
132
133
|
},
|
|
133
|
-
handleIncreaseCount(value) {
|
|
134
|
-
let numPercent = this.getNumericValue(value);
|
|
135
|
-
if (this.getPromotedByRule() === 'Top') {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
}
|
|
141
|
-
return;
|
|
142
|
-
}
|
|
134
|
+
handleIncreaseCount(value) {
|
|
135
|
+
let numPercent = this.getNumericValue(value);
|
|
136
|
+
if (this.getPromotedByRule() === 'Top') {
|
|
137
|
+
this.localPromoted = Number(this.localPromoted || 0) + 1;
|
|
138
|
+
this.updatePromotions(this.localPromoted);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
143
141
|
|
|
144
142
|
if (numPercent === 100) {
|
|
145
143
|
this.initialCutoffIndex = 500;
|
|
@@ -152,15 +150,12 @@ export default {
|
|
|
152
150
|
this.calculateInitialCutoffIndex(100);
|
|
153
151
|
}
|
|
154
152
|
},
|
|
155
|
-
handleDecreaseCount(value) {
|
|
156
|
-
if (this.getPromotedByRule() === 'Top') {
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
}
|
|
162
|
-
return;
|
|
163
|
-
}
|
|
153
|
+
handleDecreaseCount(value) {
|
|
154
|
+
if (this.getPromotedByRule() === 'Top') {
|
|
155
|
+
this.localPromoted = Math.max(1, Number(this.localPromoted || 1) - 1);
|
|
156
|
+
this.updatePromotions(this.localPromoted);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
164
159
|
|
|
165
160
|
let numPercent = this.getNumericValue(value);
|
|
166
161
|
if (numPercent - 10 >= 10) {
|
|
@@ -190,27 +185,27 @@ export default {
|
|
|
190
185
|
return numPercent
|
|
191
186
|
},
|
|
192
187
|
calculateInitialCutoffIndex(numPercent) {
|
|
193
|
-
if (this.getPromotedByRule() === 'Top') {
|
|
194
|
-
const numPromoted = parseInt(this.
|
|
195
|
-
this.updatePromotions(numPromoted);
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
const totalFencers = this.
|
|
188
|
+
if (this.getPromotedByRule() === 'Top') {
|
|
189
|
+
const numPromoted = parseInt(this.localPromoted, 10) || 2;
|
|
190
|
+
this.updatePromotions(numPromoted);
|
|
191
|
+
return;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
const totalFencers = this.localPoolResults.length;
|
|
200
195
|
const promotionRate = numPercent / 100;
|
|
201
196
|
|
|
202
197
|
this.localPromoted = `${numPercent}%`;
|
|
203
198
|
this.initialCutoffIndex = Math.ceil(totalFencers * promotionRate);
|
|
204
199
|
|
|
205
|
-
this.updatePromotions(this.initialCutoffIndex);
|
|
206
|
-
},
|
|
207
|
-
updatePromotions(numPromoted = parseInt(this.
|
|
208
|
-
const pools = this.groupFencersByPool(this.
|
|
209
|
-
|
|
210
|
-
Object.
|
|
211
|
-
this.sortFencersByCriteria(poolFencers);
|
|
212
|
-
this.markTopFencers(
|
|
213
|
-
});
|
|
200
|
+
this.updatePromotions(this.initialCutoffIndex);
|
|
201
|
+
},
|
|
202
|
+
updatePromotions(numPromoted = parseInt(this.localPromoted, 10) || 2) {
|
|
203
|
+
const pools = this.groupFencersByPool(this.localPoolResults);
|
|
204
|
+
|
|
205
|
+
Object.values(pools).forEach((poolFencers) => {
|
|
206
|
+
const sortedFencers = this.sortFencersByCriteria(poolFencers);
|
|
207
|
+
this.markTopFencers(sortedFencers, numPromoted);
|
|
208
|
+
});
|
|
214
209
|
},
|
|
215
210
|
groupFencersByPool(poolResults) {
|
|
216
211
|
return poolResults.reduce((acc, person) => {
|
|
@@ -272,9 +267,12 @@ export default {
|
|
|
272
267
|
moveFencerDESeedDown(person) {
|
|
273
268
|
this.$emit('update:moveFencerDESeedDown', person);
|
|
274
269
|
},
|
|
275
|
-
handleResize() {
|
|
276
|
-
this.windowWidth = window.innerWidth;
|
|
277
|
-
}
|
|
278
|
-
|
|
279
|
-
};
|
|
280
|
-
|
|
270
|
+
handleResize() {
|
|
271
|
+
this.windowWidth = window.innerWidth;
|
|
272
|
+
},
|
|
273
|
+
clonePoolResults(poolResults) {
|
|
274
|
+
return Array.isArray(poolResults) ? poolResults.map(person => ({ ...person })) : [];
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
};
|
|
278
|
+
</script>
|
|
@@ -45,19 +45,21 @@ export default {
|
|
|
45
45
|
};
|
|
46
46
|
|
|
47
47
|
|
|
48
|
-
export const Default = {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
48
|
+
export const Default = {
|
|
49
|
+
args: {
|
|
50
|
+
personsAll: [
|
|
51
|
+
{ id: 1, firstName: 'John', lastName: 'Doe' },
|
|
52
|
+
{ id: 2, firstName: 'Jane', lastName: 'Smith' },
|
|
53
|
+
],
|
|
54
|
+
event: {
|
|
55
|
+
EventId: 1,
|
|
56
|
+
EventName: 'Sample Event'
|
|
57
|
+
},
|
|
58
|
+
fencingClubs: [
|
|
59
|
+
{ ClubId: 1, Name: 'Acme Fencing Club' },
|
|
60
|
+
{ ClubId: 2, Name: 'Global Fencing Academy' }
|
|
61
|
+
],
|
|
62
|
+
staffMembers: getAllStaffByTournamentId,
|
|
63
|
+
role: 'admin'
|
|
64
|
+
}
|
|
65
|
+
};
|
|
@@ -37,11 +37,11 @@
|
|
|
37
37
|
|
|
38
38
|
<div v-if="viewName === 'Staff Assignments'" class="mt-4 w-full">
|
|
39
39
|
<div v-for="(pool, poolId) in groupedStaffByPool" :key="poolId">
|
|
40
|
-
<BaseText :text="`${pool.poolName} - ${pool.ringName}`" size="lg" color="quaternary" weight="bold" class="py-2 " />
|
|
41
|
-
<div v-for="staff in pool.staff" :key="staff.Id">
|
|
42
|
-
<StaffCard :staff="staff"
|
|
43
|
-
</div>
|
|
44
|
-
</div>
|
|
40
|
+
<BaseText :text="`${pool.poolName} - ${pool.ringName}`" size="lg" color="quaternary" weight="bold" class="py-2 " />
|
|
41
|
+
<div v-for="staff in pool.staff" :key="staff.Id">
|
|
42
|
+
<StaffCard :staff="staff" class="mb-4" @update:assignment="handleAssignment" @remove:staff="handleRemoveStaff" />
|
|
43
|
+
</div>
|
|
44
|
+
</div>
|
|
45
45
|
</div>
|
|
46
46
|
|
|
47
47
|
</div>
|
|
@@ -69,7 +69,10 @@ export default {
|
|
|
69
69
|
BaseText,
|
|
70
70
|
},
|
|
71
71
|
props: {
|
|
72
|
-
personsAll:
|
|
72
|
+
personsAll: {
|
|
73
|
+
type: Array,
|
|
74
|
+
default: () => []
|
|
75
|
+
},
|
|
73
76
|
event: Object,
|
|
74
77
|
fencingClubs: {
|
|
75
78
|
type: Array,
|
|
@@ -1,24 +1,27 @@
|
|
|
1
1
|
import AdminLeftMenu from './AdminLeftMenu.vue';
|
|
2
2
|
|
|
3
|
-
export default {
|
|
4
|
-
title: 'Templates/Menus/Admin/AdminLeftMenu',
|
|
5
|
-
component: AdminLeftMenu,
|
|
6
|
-
tags: ['autodocs']
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
3
|
+
export default {
|
|
4
|
+
title: 'Templates/Menus/Admin/AdminLeftMenu',
|
|
5
|
+
component: AdminLeftMenu,
|
|
6
|
+
tags: ['autodocs'],
|
|
7
|
+
args: {
|
|
8
|
+
buttons: [
|
|
9
|
+
{ label: 'Assignments', iconName: 'fa-clipboard-list' },
|
|
10
|
+
{ label: 'Tournaments', iconName: 'fa-trophy' },
|
|
11
|
+
{ label: 'Clubs', iconName: 'fa-users' },
|
|
12
|
+
{ label: 'People', iconName: 'fa-user-group' }
|
|
13
|
+
]
|
|
14
|
+
},
|
|
15
|
+
argTypes: {
|
|
16
|
+
buttons: { control: { type: 'array' } },
|
|
17
|
+
'button:Account': { action: 'button:Account' },
|
|
18
|
+
'button:Click': { action: 'button:Click' },
|
|
19
|
+
'button:Logout': { action: 'button:Logout' },
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export const Default = {
|
|
24
|
+
args: {
|
|
22
25
|
buttons: [
|
|
23
26
|
{ label: 'Assignments', iconName: 'fa-clipboard-list' },
|
|
24
27
|
{ label: 'Tournaments', iconName: 'fa-trophy' },
|
|
@@ -10,11 +10,12 @@
|
|
|
10
10
|
</section>
|
|
11
11
|
|
|
12
12
|
<section class="flex flex-col p-2 h-full w-full px-4">
|
|
13
|
-
<BaseButton
|
|
14
|
-
v-for="button in buttons"
|
|
15
|
-
:
|
|
16
|
-
:
|
|
17
|
-
|
|
13
|
+
<BaseButton
|
|
14
|
+
v-for="button in buttons"
|
|
15
|
+
:key="button.label"
|
|
16
|
+
:label="button.label"
|
|
17
|
+
:iconName="button.iconName"
|
|
18
|
+
type="adminSecondary"
|
|
18
19
|
size="sm"
|
|
19
20
|
@buttonClick="handleButtonClick(button)"
|
|
20
21
|
/>
|
|
@@ -40,17 +41,17 @@
|
|
|
40
41
|
</section>
|
|
41
42
|
</div>
|
|
42
43
|
|
|
43
|
-
<!-- Mobile Menu -->
|
|
44
|
-
|
|
45
|
-
<section class="flex md:hidden bg-secondary w-full h-10 items-center justify-between px-4">
|
|
46
|
-
<img alt="Logo" class="w-8" :src="logoImage" @click="handleButtonClick(
|
|
44
|
+
<!-- Mobile Menu -->
|
|
45
|
+
|
|
46
|
+
<section class="flex md:hidden bg-secondary w-full h-10 items-center justify-between px-4">
|
|
47
|
+
<img alt="Logo" class="w-8 cursor-pointer" :src="logoImage" @click="handleButtonClick(homeButton)" />
|
|
47
48
|
<div>
|
|
48
49
|
<BaseIcon icon-name="fa-bars" size="md" color="neutral" @click="openDropDownMenu($event)" />
|
|
49
50
|
</div>
|
|
50
51
|
</section>
|
|
51
52
|
<div v-if="dropdownOpen" id="mobiledropdown" class="fixed right-2 mt-10 bg-secondary border rounded border-lineGrey shadow-xl z-50 p-1" @click.stop>
|
|
52
53
|
<ul>
|
|
53
|
-
<li v-for="item in dropdownItems" :key="item.label" @click="handleButtonClick(item)" class="px-2 py-2 cursor-pointer justify-end flex">
|
|
54
|
+
<li v-for="item in dropdownItems" :key="item.label" @click="handleButtonClick(item)" class="px-2 py-2 cursor-pointer justify-end flex">
|
|
54
55
|
<BaseText :text="item.label" color="neutral" size="xs" tag="p" weight="normal" class="mt-0.5" />
|
|
55
56
|
<BaseIcon :icon-name="item.iconName" size="sm" color="neutral" class="ml-2" />
|
|
56
57
|
</li>
|
|
@@ -73,25 +74,32 @@ export default {
|
|
|
73
74
|
default: () => []
|
|
74
75
|
}
|
|
75
76
|
},
|
|
76
|
-
data() {
|
|
77
|
-
return {
|
|
78
|
-
logoImage,
|
|
79
|
-
dropdownOpen: false,
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
77
|
+
data() {
|
|
78
|
+
return {
|
|
79
|
+
logoImage,
|
|
80
|
+
dropdownOpen: false,
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
emits: ['button:Account', 'button:Logout', 'button:Click'],
|
|
84
|
+
computed: {
|
|
85
|
+
homeButton() {
|
|
86
|
+
return { label: 'Home', iconName: 'fa-house', route: '/' };
|
|
87
|
+
},
|
|
88
|
+
dropdownItems() {
|
|
89
|
+
return [
|
|
90
|
+
...this.buttons,
|
|
91
|
+
{ label: "Account", iconName: "fa-user" },
|
|
92
|
+
{ label: "Log Out", iconName: "fa-right-to-bracket" }
|
|
93
|
+
];
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
mounted() {
|
|
97
|
+
document.addEventListener('click', this.handleClickOutside);
|
|
98
|
+
},
|
|
99
|
+
beforeUnmount() {
|
|
100
|
+
document.removeEventListener('click', this.handleClickOutside);
|
|
101
|
+
},
|
|
102
|
+
methods: {
|
|
95
103
|
handleButtonClick(button) {
|
|
96
104
|
this.dropdownOpen = false;
|
|
97
105
|
|
|
@@ -110,13 +118,13 @@ export default {
|
|
|
110
118
|
handleAccount() {
|
|
111
119
|
this.$emit('button:Account');
|
|
112
120
|
},
|
|
113
|
-
handleLogOut() {
|
|
114
|
-
this.$emit('button:Logout');
|
|
115
|
-
},
|
|
116
|
-
openDropDownMenu() {
|
|
117
|
-
this.dropdownOpen = !this.dropdownOpen;
|
|
118
|
-
event
|
|
119
|
-
},
|
|
121
|
+
handleLogOut() {
|
|
122
|
+
this.$emit('button:Logout');
|
|
123
|
+
},
|
|
124
|
+
openDropDownMenu(event) {
|
|
125
|
+
this.dropdownOpen = !this.dropdownOpen;
|
|
126
|
+
event?.stopPropagation();
|
|
127
|
+
},
|
|
120
128
|
closeDropDownMenu() {
|
|
121
129
|
this.dropdownOpen = false;
|
|
122
130
|
},
|
|
@@ -1,13 +1,20 @@
|
|
|
1
|
-
import EditTournamentMenu from "./EditEventsTopMenu.vue";
|
|
2
|
-
import { tabs } from '../../../Util/tabs.js';
|
|
3
|
-
|
|
4
|
-
export default {
|
|
5
|
-
title: 'Templates/Menus/Events/EditEventsTopMenu',
|
|
6
|
-
component: EditTournamentMenu,
|
|
7
|
-
tags: ['autodocs'],
|
|
8
|
-
args: {
|
|
9
|
-
|
|
10
|
-
|
|
1
|
+
import EditTournamentMenu from "./EditEventsTopMenu.vue";
|
|
2
|
+
import { personProfileTabs, tabs } from '../../../Util/tabs.js';
|
|
3
|
+
|
|
4
|
+
export default {
|
|
5
|
+
title: 'Templates/Menus/Events/EditEventsTopMenu',
|
|
6
|
+
component: EditTournamentMenu,
|
|
7
|
+
tags: ['autodocs'],
|
|
8
|
+
args: {
|
|
9
|
+
currentTab: 'Checkin',
|
|
10
|
+
tabs: tabs('admin')
|
|
11
|
+
},
|
|
12
|
+
argTypes: {
|
|
13
|
+
currentTab: { control: { type: 'text' } },
|
|
14
|
+
tabs: { control: { type: 'array' } },
|
|
15
|
+
tabMenuClick: { action: 'tabMenuClick' },
|
|
16
|
+
}
|
|
17
|
+
};
|
|
11
18
|
|
|
12
19
|
export const Default = {
|
|
13
20
|
args: {
|
|
@@ -24,16 +31,16 @@ export const DirectorMenu = {
|
|
|
24
31
|
|
|
25
32
|
}
|
|
26
33
|
|
|
27
|
-
export const
|
|
28
|
-
args: {
|
|
29
|
-
currentTab: 'Basic',
|
|
30
|
-
tabs:
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const
|
|
35
|
-
args: {
|
|
36
|
-
currentTab: 'Basic',
|
|
37
|
-
tabs:
|
|
38
|
-
}
|
|
39
|
-
}
|
|
34
|
+
export const PersonProfileMenu = {
|
|
35
|
+
args: {
|
|
36
|
+
currentTab: 'Basic',
|
|
37
|
+
tabs: personProfileTabs('user')
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const PersonProfileAdmin = {
|
|
42
|
+
args: {
|
|
43
|
+
currentTab: 'Basic',
|
|
44
|
+
tabs: personProfileTabs('admin')
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -20,11 +20,11 @@
|
|
|
20
20
|
</div>
|
|
21
21
|
</TabBar>
|
|
22
22
|
</section>
|
|
23
|
-
<section v-if="activeDropdown" class="bg-eventBoxBlue rounded w-full -mt-4 grid grid-cols-4 gap-4 pt-3 pb-1">
|
|
24
|
-
<div v-for="item in
|
|
25
|
-
<BaseIcon size="md" :iconName="item.icon" :color="item.color" class="w-6 mb-1 text-center"/>
|
|
26
|
-
<BaseText size="xs" :color="item.color" :text="item.label" @click="handleButtonClick(item.id)" class="text-center"/>
|
|
27
|
-
</div>
|
|
23
|
+
<section v-if="activeDropdown" class="bg-eventBoxBlue rounded w-full -mt-4 grid grid-cols-4 gap-4 pt-3 pb-1">
|
|
24
|
+
<div v-for="item in selectedDropdownItems" :key="item.id" class="flex flex-col items-center justify-center mb-2 mr-2">
|
|
25
|
+
<BaseIcon size="md" :iconName="item.icon" :color="item.color" class="w-6 mb-1 text-center"/>
|
|
26
|
+
<BaseText size="xs" :color="item.color" :text="item.label" @click="handleButtonClick(item.id)" class="text-center"/>
|
|
27
|
+
</div>
|
|
28
28
|
</section>
|
|
29
29
|
</div>
|
|
30
30
|
</template>
|
|
@@ -32,71 +32,68 @@
|
|
|
32
32
|
|
|
33
33
|
<script>
|
|
34
34
|
import TabBar from "../../../Molecules/Menus/TabBar/TabBar.vue";
|
|
35
|
-
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
36
|
-
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
37
|
-
import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
BaseText,
|
|
45
|
-
TabBar,
|
|
35
|
+
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
36
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
37
|
+
import BaseIcon from "../../../Atoms/Icon/BaseIcon.vue";
|
|
38
|
+
|
|
39
|
+
export default {
|
|
40
|
+
components: {
|
|
41
|
+
BaseIcon,
|
|
42
|
+
BaseText,
|
|
43
|
+
TabBar,
|
|
46
44
|
BaseButton
|
|
47
45
|
},
|
|
48
46
|
emits: ['tabMenuClick'],
|
|
49
47
|
props: {
|
|
50
|
-
currentTab: {
|
|
51
|
-
type: String,
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
return this.
|
|
71
|
-
},
|
|
72
|
-
},
|
|
73
|
-
mounted() {
|
|
74
|
-
|
|
75
|
-
|
|
48
|
+
currentTab: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ''
|
|
51
|
+
},
|
|
52
|
+
tabs: {
|
|
53
|
+
type: Array,
|
|
54
|
+
default: () => []
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
data() {
|
|
58
|
+
return {
|
|
59
|
+
windowWidth: 1024,
|
|
60
|
+
activeDropdown: null,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
computed: {
|
|
64
|
+
isMobile() {
|
|
65
|
+
return this.windowWidth <= 748;
|
|
66
|
+
},
|
|
67
|
+
selectedDropdownItems() {
|
|
68
|
+
return this.tabs.find((tab) => tab.id === this.activeDropdown)?.children || [];
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
mounted() {
|
|
72
|
+
this.handleResize();
|
|
73
|
+
window.addEventListener('resize', this.handleResize);
|
|
74
|
+
},
|
|
76
75
|
beforeUnmount() {
|
|
77
76
|
window.removeEventListener('resize', this.handleResize);
|
|
78
77
|
},
|
|
79
78
|
methods: {
|
|
80
79
|
handleButtonClick(buttonId) {
|
|
81
80
|
const selectedTab = this.tabs.find((tab) => tab.id === buttonId);
|
|
82
|
-
if (selectedTab && selectedTab.children && this.isMobile) {
|
|
83
|
-
this.activeDropdown = this.activeDropdown === buttonId ? null : buttonId;
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
this
|
|
90
|
-
|
|
91
|
-
this.$emit('tabMenuClick', buttonId);
|
|
81
|
+
if (selectedTab && selectedTab.children && this.isMobile) {
|
|
82
|
+
this.activeDropdown = this.activeDropdown === buttonId ? null : buttonId;
|
|
83
|
+
return
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
this.activeDropdown = null;
|
|
87
|
+
|
|
88
|
+
this.$emit('tabMenuClick', buttonId);
|
|
92
89
|
},
|
|
93
90
|
getIconName(tab) {
|
|
94
91
|
if (this.isMobile) return tab.icon;
|
|
95
92
|
return '';
|
|
96
|
-
},
|
|
97
|
-
handleResize() {
|
|
98
|
-
this.windowWidth = window
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
93
|
+
},
|
|
94
|
+
handleResize() {
|
|
95
|
+
this.windowWidth = window?.innerWidth || 1024;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
}
|
|
102
99
|
</script>
|