@dcrackel/hematournamentui 1.0.66 → 1.0.69
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/HemaTouranmentUI-lib.es.js +3976 -3718
- package/dist/HemaTouranmentUI-lib.umd.js +24 -24
- package/package.json +1 -1
- package/src/mocks/clubGetAllMock.js +29 -0
- package/src/mocks/personGetAllMock.js +594 -0
- package/src/stories/Molecules/Modals/BaseModal/BaseModal.vue +9 -9
- package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +1 -1
- package/src/stories/Organisms/ComplexInputs/DropDown/DropDownMenu.vue +22 -14
- package/src/stories/Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.stories.js +27 -0
- package/src/stories/Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue +174 -0
- package/src/stories/Organisms/ComplexInputs/FindPerson/FindPerson.stories.js +3 -1
- package/src/stories/Organisms/ComplexInputs/FindPerson/FindPerson.vue +1 -1
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.stories.js +8 -3
- package/src/stories/Templates/EventManagement/EventAttendance/EventAttendance.vue +27 -8
- package/src/stories/Templates/EventManagement/Pools/Pools.Stories.js +0 -0
- package/src/stories/Templates/EventManagement/Pools/Pools.vue +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="flex items-center border border-dropdownSelect rounded-lg shadow-lg bg-white hover:border-bright">
|
|
3
|
-
<div class="mr-4 border-r h-20 w-8 items-center text-center">
|
|
3
|
+
<div class="mr-4 border-r border-dropdownSelect h-20 w-8 items-center text-center">
|
|
4
4
|
<BaseText :text="person.Seed" size="lg" color="quaternary" weight="bold" class="pt-6" />
|
|
5
5
|
</div>
|
|
6
6
|
<div class="mr-4">
|
|
@@ -1,19 +1,17 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<div class="flex flex-row">
|
|
3
|
-
<
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
2
|
+
<div class="flex flex-row w-full justify-end relative">
|
|
3
|
+
<div class="z-10 rounded-lg px-2 py-2 flex flex-row justify-between border border-dropdownSelect" :class="width" @click="handleDropDown()">
|
|
4
|
+
<BaseText v-if="label.length > 1" :text="label" color="quaternary" size="sm" weight="normal" />
|
|
5
|
+
<BaseText :text="selectedItem.text" color="secondary" size="sm" weight="normal" />
|
|
6
|
+
<i class="fa-solid fa-chevron-down text-xs" />
|
|
7
|
+
</div>
|
|
8
|
+
<transition name="fade-in-down">
|
|
9
|
+
<div v-if="isDropDownOpen" class="flex flex-col shadow-lg mt-9 z-10 rounded-b-xl absolute bg-neutral border border-dropdownSelect" :class="dropDownWidth">
|
|
10
|
+
<a v-for="item in items" :key="item.id" @click="handleClick(item)" class="hover:bg-dropdownSelect py-1 px-2 border-b border-l border-r border-dropdownSelect">
|
|
11
|
+
<BaseText :text="item.text" color="primary" size="sm" weight="normal" class="py-0.5" />
|
|
12
|
+
</a>
|
|
8
13
|
</div>
|
|
9
|
-
|
|
10
|
-
<div v-if="isDropDownOpen" class="flex flex-col w-40 shadow-lg -mt-1 z-10 rounded-b-xl absolute bg-neutral border border-dropdownSelect">
|
|
11
|
-
<a v-for="item in items" :key="item.id" @click="handleClick(item)" class="hover:bg-dropdownSelect py-1 px-2 border-b border-l border-r border-dropdownSelect">
|
|
12
|
-
<BaseText :text="item.text" color="primary" size="sm" weight="normal" class="py-0.5" />
|
|
13
|
-
</a>
|
|
14
|
-
</div>
|
|
15
|
-
</transition>
|
|
16
|
-
</span>
|
|
14
|
+
</transition>
|
|
17
15
|
</div>
|
|
18
16
|
</template>
|
|
19
17
|
|
|
@@ -35,6 +33,16 @@ export default {
|
|
|
35
33
|
type: Object,
|
|
36
34
|
default: () => ({ text: '' }),
|
|
37
35
|
validator: (obj) => typeof obj.text === 'string'
|
|
36
|
+
},
|
|
37
|
+
width: {
|
|
38
|
+
type: String,
|
|
39
|
+
default: 'w-44',
|
|
40
|
+
required: false
|
|
41
|
+
},
|
|
42
|
+
dropDownWidth: {
|
|
43
|
+
type: String,
|
|
44
|
+
default: 'w-44',
|
|
45
|
+
required: false
|
|
38
46
|
}
|
|
39
47
|
},
|
|
40
48
|
data: () => ({
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import FindOrAddPerson from './FindOrAddPerson.vue';
|
|
2
|
+
import mockPersons from '../../../../mocks/personGetAllMock.js';
|
|
3
|
+
import clubGetAllMock from "../../../../mocks/clubGetAllMock.js";
|
|
4
|
+
|
|
5
|
+
export default {
|
|
6
|
+
title: 'Organisms/ComplexInputs/FindOrAddPerson',
|
|
7
|
+
component: FindOrAddPerson,
|
|
8
|
+
tags: ['autodocs'],
|
|
9
|
+
args: {
|
|
10
|
+
persons: mockPersons,
|
|
11
|
+
addBorder: true,
|
|
12
|
+
},
|
|
13
|
+
argTypes: {
|
|
14
|
+
persons: { control: 'array' },
|
|
15
|
+
addBorder: { control: 'boolean' },
|
|
16
|
+
clubs: { control: 'array'}
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
export const Default = {
|
|
22
|
+
args: {
|
|
23
|
+
addBorder:true,
|
|
24
|
+
persons: mockPersons,
|
|
25
|
+
clubs: clubGetAllMock
|
|
26
|
+
}
|
|
27
|
+
};
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<section>
|
|
3
|
+
<base-button type="primary" label="Add Fencer" size="sm" iconName="fa-user-plus" @click="openSearchModal" />
|
|
4
|
+
|
|
5
|
+
<BaseModal :show="showModal" :iconName="modalIcon" :buttonText="modalButtonText" @submit-modal="handleSubmit" @update:show="closeModal">
|
|
6
|
+
<template #modal-content>
|
|
7
|
+
<div v-if="isSearchMode">
|
|
8
|
+
<BaseInput
|
|
9
|
+
:addBorder="true"
|
|
10
|
+
:value="inputValue"
|
|
11
|
+
@input="updateInput"
|
|
12
|
+
placeholder="Type to search person..."
|
|
13
|
+
/>
|
|
14
|
+
<div v-if="showDropdown" class="absolute z-10 w-11/12 bg-eventBoxBlue rounded-md" :class="[filteredPersons.length > 0 ? 'border border-dropdownSelect mt-2 p-2' : 'mt-4']">
|
|
15
|
+
<ul>
|
|
16
|
+
<li v-for="(person, index) in filteredPersons" :key="index" @click="selectPerson(person)" class="p-2 my-2 hover:bg-dropdownSelect rounded-lg cursor-pointer">
|
|
17
|
+
<p class="grid grid-cols-2 w-full">
|
|
18
|
+
<BaseText :text="person.DisplayName" size="md" />
|
|
19
|
+
<BaseText :text="person.Club.ShortName" size="md" class="ml-4" />
|
|
20
|
+
</p>
|
|
21
|
+
</li>
|
|
22
|
+
</ul>
|
|
23
|
+
<div @click="addNewPerson" class="hover:bg-gray-100 cursor-pointer">
|
|
24
|
+
<BaseButton type="secondary" label="Add New Person" iconName="fa-user-plus" />
|
|
25
|
+
</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
<div v-else>
|
|
29
|
+
<BaseText class="pb-2" text="Enter Primary Contacts Information" />
|
|
30
|
+
<BaseInput :addBorder="true" :invalid="false" :value="personName" class="pb-2" placeholder="Display Name" type="formInput" @update:value="value => personName = value" />
|
|
31
|
+
<BaseInput :addBorder="true" :invalid="false" :value="personLegalName" class="pb-2" placeholder="Legal Name" type="formInput" @update:value="value => personLegalName = value" />
|
|
32
|
+
<DropDownMenu :label="selectedPronouns.length < 2 ? 'Preferred Pronouns' : ''" :items="pronouns" class="pb-2" :selectedItem="selectedPronouns" @update:selectedItem="handleSelectedPronouns" width="w-full" dropDownWidth="w-[342px]"/>
|
|
33
|
+
<BaseInput :addBorder="true" :invalid="false" :value="personEmail" class="pb-2" placeholder="Email" type="formInput" @update:value="value => personEmail = value" />
|
|
34
|
+
<DropDownMenu :label="selectedClub.length < 2 ? 'Select Club' : ''" :items="formattedClubs" :selectedItem="selectedClub" class="pb-2" @update:selectedItem="handleSelectedClub" width="w-full" dropDownWidth="w-[342px]"/>
|
|
35
|
+
</div>
|
|
36
|
+
</template>
|
|
37
|
+
</BaseModal>
|
|
38
|
+
</section>
|
|
39
|
+
</template>
|
|
40
|
+
|
|
41
|
+
<script>
|
|
42
|
+
import BaseInput from '../../../Atoms/Input/BaseInput.vue';
|
|
43
|
+
import BaseButton from "../../../Molecules/Buttons/BaseButton/BaseButton.vue";
|
|
44
|
+
import BaseText from "../../../Atoms/Text/BaseText.vue";
|
|
45
|
+
import BaseModal from "../../../Molecules/Modals/BaseModal/BaseModal.vue";
|
|
46
|
+
import DropDownMenu from "../DropDown/DropDownMenu.vue";
|
|
47
|
+
|
|
48
|
+
export default {
|
|
49
|
+
name: 'FindOrAddPerson',
|
|
50
|
+
components: {DropDownMenu, BaseModal, BaseText, BaseButton, BaseInput },
|
|
51
|
+
props: {
|
|
52
|
+
persons: {
|
|
53
|
+
type: Array,
|
|
54
|
+
required: true
|
|
55
|
+
},
|
|
56
|
+
clubs: {
|
|
57
|
+
type: Array,
|
|
58
|
+
required: true
|
|
59
|
+
},
|
|
60
|
+
addBorder: {
|
|
61
|
+
type: Boolean,
|
|
62
|
+
default: false
|
|
63
|
+
},
|
|
64
|
+
addNewText: {
|
|
65
|
+
type: String,
|
|
66
|
+
default: 'Add New'
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
data() {
|
|
70
|
+
return {
|
|
71
|
+
personEmail: '',
|
|
72
|
+
personName: '',
|
|
73
|
+
personLegalName: '',
|
|
74
|
+
personPronouns: '',
|
|
75
|
+
showModal: false,
|
|
76
|
+
isSearchMode: true,
|
|
77
|
+
filteredPersons: [],
|
|
78
|
+
inputValue: '',
|
|
79
|
+
showDropdown: false,
|
|
80
|
+
debouncedTimeout: null,
|
|
81
|
+
modalIcon: 'fa-search',
|
|
82
|
+
modalButtonText: 'Find Person',
|
|
83
|
+
selectedPronouns: '',
|
|
84
|
+
pronouns: [
|
|
85
|
+
{text: 'He/Him', link: 'he-him'},
|
|
86
|
+
{text: 'She/Her', link: 'she-her'},
|
|
87
|
+
{text: 'They/Them', link: 'they-them'},
|
|
88
|
+
{text: 'Ze/Hir', link: 'ze-hir'},
|
|
89
|
+
{text: 'Xe/Xem', link: 'xe-xem'}
|
|
90
|
+
],
|
|
91
|
+
selectedClub: '',
|
|
92
|
+
formattedClubs: []
|
|
93
|
+
};
|
|
94
|
+
},
|
|
95
|
+
created() {
|
|
96
|
+
this.formattedClubs = this.mapClubData(this.clubs);
|
|
97
|
+
},
|
|
98
|
+
watch: {
|
|
99
|
+
inputValue(newValue) {
|
|
100
|
+
if (newValue.length < 2) {
|
|
101
|
+
this.showDropdown = false;
|
|
102
|
+
this.filteredPersons = [];
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (newValue.length >= 2) {
|
|
106
|
+
this.debounceSearch();
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
methods: {
|
|
111
|
+
updateInput(event) {
|
|
112
|
+
this.inputValue = event.target.value;
|
|
113
|
+
},
|
|
114
|
+
selectPerson(person) {
|
|
115
|
+
console.log(person)
|
|
116
|
+
this.showDropdown = false;
|
|
117
|
+
this.inputValue = '';
|
|
118
|
+
this.$emit('person-selected', person);
|
|
119
|
+
this.showModal = false;
|
|
120
|
+
},
|
|
121
|
+
addNewPerson() {
|
|
122
|
+
this.isSearchMode = false;
|
|
123
|
+
this.modalIcon = 'fa-user';
|
|
124
|
+
this.modalButtonText = 'Add Person';
|
|
125
|
+
},
|
|
126
|
+
openSearchModal() {
|
|
127
|
+
this.showModal = true;
|
|
128
|
+
this.isSearchMode = true;
|
|
129
|
+
this.modalIcon = 'fa-search';
|
|
130
|
+
this.modalButtonText = 'Find Person';
|
|
131
|
+
},
|
|
132
|
+
onInputChanged(value) {
|
|
133
|
+
if (!this.showDropdown) return;
|
|
134
|
+
this.filteredPersons = this.persons.filter(person => person.DisplayName.toLowerCase().includes(value.toLowerCase()));
|
|
135
|
+
},
|
|
136
|
+
debounceSearch() {
|
|
137
|
+
clearTimeout(this.debouncedTimeout);
|
|
138
|
+
this.debouncedTimeout = setTimeout(() => {
|
|
139
|
+
this.showDropdown = true;
|
|
140
|
+
this.onInputChanged(this.inputValue);
|
|
141
|
+
}, 300);
|
|
142
|
+
},
|
|
143
|
+
closeModal(value) {
|
|
144
|
+
this.showModal = value;
|
|
145
|
+
this.inputValue = "";
|
|
146
|
+
},
|
|
147
|
+
handleSubmit() {
|
|
148
|
+
const newPerson = {
|
|
149
|
+
personName: this.personName,
|
|
150
|
+
personLegalName: this.personLegalName,
|
|
151
|
+
personEmail: this.personEmail,
|
|
152
|
+
personPronouns: this.selectedPronouns.text,
|
|
153
|
+
clubId: this.selectedClub.link
|
|
154
|
+
};
|
|
155
|
+
this.$emit('new-person-submitted', newPerson);
|
|
156
|
+
console.log(newPerson)
|
|
157
|
+
this.showModal = false;
|
|
158
|
+
},
|
|
159
|
+
mapClubData(clubs) {
|
|
160
|
+
return clubs.map(club => ({
|
|
161
|
+
text: club.Name,
|
|
162
|
+
link: club.ClubId.toString()
|
|
163
|
+
}));
|
|
164
|
+
},
|
|
165
|
+
handleSelectedClub(value){
|
|
166
|
+
this.selectedClub = value;
|
|
167
|
+
},
|
|
168
|
+
handleSelectedPronouns(value) {
|
|
169
|
+
this.selectedPronouns = value;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
}
|
|
173
|
+
};
|
|
174
|
+
</script>
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import FindPerson from './FindPerson.vue';
|
|
2
|
-
import mockPersons from '../../../../mocks/
|
|
2
|
+
import mockPersons from '../../../../mocks/personGetAllMock.js';
|
|
3
|
+
|
|
3
4
|
export default {
|
|
4
5
|
title: 'Organisms/ComplexInputs/FindPerson',
|
|
5
6
|
component: FindPerson,
|
|
@@ -24,6 +25,7 @@ export default {
|
|
|
24
25
|
|
|
25
26
|
export const Default = {
|
|
26
27
|
args: {
|
|
28
|
+
addBorder:true,
|
|
27
29
|
locations: mockPersons,
|
|
28
30
|
addNewText: "Add New Location"
|
|
29
31
|
}
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
<div v-if="showDropdown" class="absolute z-10 w-full bg-white border border-gray-300 rounded-md mt-1">
|
|
11
11
|
<ul>
|
|
12
12
|
<li v-for="(person, index) in filteredPersons" :key="index" @click="selectPerson(person)" class="p-2 hover:bg-gray-100 cursor-pointer">
|
|
13
|
-
|
|
13
|
+
<p class="grid grid-cols-2 w-1/2 "><BaseText :text="person.DisplayName" size="md" /><BaseText :text="person.Club.Name" size="md" class="ml-4" /></p>
|
|
14
14
|
</li>
|
|
15
15
|
</ul>
|
|
16
16
|
<div @click="addNewPerson" class="p-2 hover:bg-gray-100 cursor-pointer">
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import EditEvents from './EventAttendance.vue';
|
|
2
2
|
import personsMock from '../../../../mocks/personsMock.js';
|
|
3
|
+
import personsAllMock from '../../../../mocks/personGetAllMock.js';
|
|
3
4
|
import eventMock from '../../../../mocks/eventMock.js';
|
|
4
5
|
|
|
5
6
|
export default {
|
|
@@ -7,14 +8,17 @@ export default {
|
|
|
7
8
|
component: EditEvents,
|
|
8
9
|
tags: ['autodocs'],
|
|
9
10
|
args: {
|
|
10
|
-
|
|
11
|
+
personsInTournament: personsMock,
|
|
12
|
+
personsAll: personsAllMock,
|
|
13
|
+
event: eventMock[0]
|
|
11
14
|
},
|
|
12
15
|
argTypes: {}
|
|
13
16
|
};
|
|
14
17
|
|
|
15
18
|
export const Default = {
|
|
16
19
|
args: {
|
|
17
|
-
|
|
20
|
+
personsInTournament: personsMock,
|
|
21
|
+
personsAll: personsAllMock,
|
|
18
22
|
event: eventMock[0]
|
|
19
23
|
}
|
|
20
24
|
};
|
|
@@ -22,7 +26,8 @@ export const Default = {
|
|
|
22
26
|
|
|
23
27
|
export const NoPeople = {
|
|
24
28
|
args: {
|
|
25
|
-
|
|
29
|
+
personsInTournament: [],
|
|
30
|
+
personsAll: personsAllMock,
|
|
26
31
|
event: eventMock[0]
|
|
27
32
|
}
|
|
28
33
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<section
|
|
2
|
+
<section>
|
|
3
3
|
|
|
4
4
|
<EditEventsTopMenu :currentTab="'Checkin'" :tabs="tabs"/>
|
|
5
5
|
<PoolSummary :event="event"/>
|
|
@@ -7,13 +7,17 @@
|
|
|
7
7
|
<div class="w-full flex flex-row justify-center mt-3">
|
|
8
8
|
<section class="w-full">
|
|
9
9
|
<div class="w-full flex flex-col justify-center items-center" style="text-align: center">
|
|
10
|
-
<section class="
|
|
11
|
-
<
|
|
12
|
-
|
|
10
|
+
<section class="grid grid-cols-2 w-full mb-3">
|
|
11
|
+
<div class="col-start-1 col-end-2 flex justify-start">
|
|
12
|
+
<FindOrAddPerson :clubs="clubs" :persons="personsAll" @new-person-submitted="handleNewPerson" />
|
|
13
|
+
</div>
|
|
14
|
+
<div class="col-start-2 col-end-3 flex justify-end">
|
|
15
|
+
<DropDownMenu :label="label" :items="items" :selectedItem="localSelectedItem"
|
|
13
16
|
@update:selectedItem="handleSelectedItem"/>
|
|
17
|
+
</div>
|
|
14
18
|
</section>
|
|
15
19
|
|
|
16
|
-
<div v-if="
|
|
20
|
+
<div v-if="personsInTournament.length === 0" class="mb-10">
|
|
17
21
|
<img alt="Small desert scene with wind blowing." class="w-96" :src="emptyDesertIcon"/>
|
|
18
22
|
<BaseText :color="'primaryHighlight'" :size="'lf'" :text="'0 events added yet.'"
|
|
19
23
|
:weight="'normal'" data-testid="text-num-events"/>
|
|
@@ -41,9 +45,11 @@ import FencerCard from "../../../Organisms/Cards/FencerCard/FencerCard.vue";
|
|
|
41
45
|
import EditEventsTopMenu from "../../Menus/EditEventsTopMenu/EditEventsTopMenu.vue";
|
|
42
46
|
import PoolSummary from "../../../Organisms/Containers/PoolSummary/PoolSummary.vue";
|
|
43
47
|
import DropDownMenu from "../../../Organisms/ComplexInputs/DropDown/DropDownMenu.vue";
|
|
48
|
+
import FindOrAddPerson from "../../../Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue";
|
|
44
49
|
|
|
45
50
|
export default {
|
|
46
51
|
components: {
|
|
52
|
+
FindOrAddPerson,
|
|
47
53
|
DropDownMenu,
|
|
48
54
|
PoolSummary,
|
|
49
55
|
EditEventsTopMenu,
|
|
@@ -54,8 +60,16 @@ export default {
|
|
|
54
60
|
BaseButton,
|
|
55
61
|
},
|
|
56
62
|
props: {
|
|
57
|
-
|
|
58
|
-
event: Object
|
|
63
|
+
personsAll: Array,
|
|
64
|
+
event: Object,
|
|
65
|
+
clubs: {
|
|
66
|
+
type: Array,
|
|
67
|
+
default: () => []
|
|
68
|
+
},
|
|
69
|
+
personsInTournament: {
|
|
70
|
+
type: Array,
|
|
71
|
+
default: () => []
|
|
72
|
+
}
|
|
59
73
|
},
|
|
60
74
|
data() {
|
|
61
75
|
return {
|
|
@@ -81,7 +95,7 @@ export default {
|
|
|
81
95
|
computed: {
|
|
82
96
|
sortedPersons() {
|
|
83
97
|
const sortKey = this.localSelectedItem.link;
|
|
84
|
-
return this.
|
|
98
|
+
return this.personsInTournament.slice().sort((a, b) => {
|
|
85
99
|
switch (sortKey) {
|
|
86
100
|
case 'FullName':
|
|
87
101
|
const nameA = `${a.Person.FirstName} ${a.Person.LastName}`.toUpperCase();
|
|
@@ -109,7 +123,12 @@ export default {
|
|
|
109
123
|
this.localSelectedItem = selectedItem;
|
|
110
124
|
},
|
|
111
125
|
handleStatus(person) {
|
|
126
|
+
person.Status = person.Status === 'Absent' ? 'Present' : 'Absent';
|
|
112
127
|
this.$emit('update:person', person);
|
|
128
|
+
},
|
|
129
|
+
handleNewPerson(value)
|
|
130
|
+
{
|
|
131
|
+
this.$emit('add:person', value);
|
|
113
132
|
}
|
|
114
133
|
}
|
|
115
134
|
}
|
|
File without changes
|
|
File without changes
|