@dcrackel/hematournamentui 1.0.709 → 1.0.710
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/README.md +16 -0
- package/dist/HemaTournamentUI-lib.es.js +4332 -4090
- package/dist/HemaTournamentUI-lib.umd.js +27 -27
- package/dist/hematournamentui-tailwind.css +3 -0
- package/package.json +1 -1
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +48 -41
- package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +227 -206
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +226 -225
- package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +204 -204
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +133 -91
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.test.js +191 -0
- package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.vue +366 -309
- package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +172 -171
- package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +216 -215
- package/src/stories/Organisms/Wizards/EditEventWizard/PriceFields.test.js +79 -0
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +93 -52
- package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +91 -75
- package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +84 -83
- package/src/stories/Templates/TournamentManagement/TournamentManagement.test.js +89 -0
- package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +363 -360
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +116 -113
- package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +292 -280
- package/src/stories/Util/Validations/PriceValidation.js +6 -0
- package/src/stories/Util/Validations/TournamentFieldsValidations.js +4 -0
package/package.json
CHANGED
package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js
CHANGED
|
@@ -1,41 +1,48 @@
|
|
|
1
|
-
import BasicEventInfo from './BasicEventInfo.vue';
|
|
2
|
-
import singleEventMock from '../../../../../mocks/singleEventMock.js';
|
|
3
|
-
import getAllWeapons from '../../../../../mocks/getAllWeapons.js';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
1
|
+
import BasicEventInfo from './BasicEventInfo.vue';
|
|
2
|
+
import singleEventMock from '../../../../../mocks/singleEventMock.js';
|
|
3
|
+
import getAllWeapons from '../../../../../mocks/getAllWeapons.js';
|
|
4
|
+
|
|
5
|
+
const eventConfig = { ...singleEventMock, EventPrice: 25.5 };
|
|
6
|
+
const validation = {
|
|
7
|
+
EventName: { invalid: false, message: '' },
|
|
8
|
+
EventPrice: { invalid: false, message: '' }
|
|
9
|
+
};
|
|
10
|
+
const steps = [
|
|
11
|
+
{ name: 'Basic Info', icon: 'fa-circle-info' },
|
|
12
|
+
{ name: 'Customization', icon: 'fa-star' },
|
|
13
|
+
{ name: 'Pool Setup', icon: 'fa-table-columns' },
|
|
14
|
+
{ name: 'DE Promotion', icon: 'fa-list' },
|
|
15
|
+
{ name: 'Direct Elimination', icon: 'fa-diagram-sankey' }
|
|
16
|
+
];
|
|
17
|
+
|
|
18
|
+
export default {
|
|
19
|
+
title: 'Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo',
|
|
20
|
+
component: BasicEventInfo,
|
|
21
|
+
args: { eventConfig, validation, currentStep: 0, steps, weapons: getAllWeapons },
|
|
22
|
+
argTypes: {
|
|
23
|
+
eventConfig: { control: 'object' },
|
|
24
|
+
validation: { control: 'object' },
|
|
25
|
+
weapons: { control: 'object' },
|
|
26
|
+
steps: { control: 'object' },
|
|
27
|
+
currentStep: { control: 'number' }
|
|
28
|
+
}
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const Default = {
|
|
32
|
+
args: { eventConfig, validation, currentStep: 0, steps, weapons: getAllWeapons }
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export const FreeEvent = {
|
|
36
|
+
args: { ...Default.args, eventConfig: { ...eventConfig, EventPrice: 0 } }
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export const InvalidPrice = {
|
|
40
|
+
args: {
|
|
41
|
+
...Default.args,
|
|
42
|
+
eventConfig: { ...eventConfig, EventPrice: -5 },
|
|
43
|
+
validation: {
|
|
44
|
+
...validation,
|
|
45
|
+
EventPrice: { invalid: true, message: 'Price must be a non-negative number.' }
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
};
|
|
@@ -1,206 +1,227 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="flex flex-col h-full pb-4">
|
|
3
|
-
<div class="w-full flex justify-center grow">
|
|
4
|
-
<StepIndicator :steps="steps" :selected="currentStep" />
|
|
5
|
-
</div>
|
|
6
|
-
<div class="w-full flex flex-row justify-center my-4 grow">
|
|
7
|
-
<BaseText color="primaryHighlight" size="2xl" text="Basic Event Information" weight="normal" />
|
|
8
|
-
</div>
|
|
9
|
-
<div class="w-full flex flex-row justify-center my-4 grow">
|
|
10
|
-
<BaseText
|
|
11
|
-
color="quinary"
|
|
12
|
-
size="sm"
|
|
13
|
-
text="Please fill in the basic information required for your event, including the event name, start date, start time, number of rings, and weapon form."
|
|
14
|
-
weight="normal"
|
|
15
|
-
/>
|
|
16
|
-
</div>
|
|
17
|
-
|
|
18
|
-
<div class="mb-4 grow">
|
|
19
|
-
<BaseText color="quaternary" size="sm" text="BASIC INFORMATION" class="border-b mb-5" />
|
|
20
|
-
<TitledInput
|
|
21
|
-
:inputValue="eventConfig.EventName || ''"
|
|
22
|
-
:invalid="validation.EventName.invalid"
|
|
23
|
-
placeholder="Enter Event Name"
|
|
24
|
-
:title="validation.EventName.invalid ? `Event Name - ${validation.EventName.message}` : 'Event Name'"
|
|
25
|
-
@update:value="handleEventNameChange"
|
|
26
|
-
/>
|
|
27
|
-
</div>
|
|
28
|
-
|
|
29
|
-
<div class="
|
|
30
|
-
<
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
:invalid="validation.
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
:
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
:
|
|
87
|
-
:
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
:
|
|
98
|
-
placeholder="
|
|
99
|
-
inputType="number"
|
|
100
|
-
title="
|
|
101
|
-
@update:value="
|
|
102
|
-
/>
|
|
103
|
-
</div>
|
|
104
|
-
|
|
105
|
-
<div class="
|
|
106
|
-
<
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
},
|
|
192
|
-
|
|
193
|
-
this
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
this.$emit('update:
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
this.$emit('update:
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
};
|
|
206
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="flex flex-col h-full pb-4">
|
|
3
|
+
<div class="w-full flex justify-center grow">
|
|
4
|
+
<StepIndicator :steps="steps" :selected="currentStep" />
|
|
5
|
+
</div>
|
|
6
|
+
<div class="w-full flex flex-row justify-center my-4 grow">
|
|
7
|
+
<BaseText color="primaryHighlight" size="2xl" text="Basic Event Information" weight="normal" />
|
|
8
|
+
</div>
|
|
9
|
+
<div class="w-full flex flex-row justify-center my-4 grow">
|
|
10
|
+
<BaseText
|
|
11
|
+
color="quinary"
|
|
12
|
+
size="sm"
|
|
13
|
+
text="Please fill in the basic information required for your event, including the event name, start date, start time, number of rings, and weapon form."
|
|
14
|
+
weight="normal"
|
|
15
|
+
/>
|
|
16
|
+
</div>
|
|
17
|
+
|
|
18
|
+
<div class="mb-4 grow">
|
|
19
|
+
<BaseText color="quaternary" size="sm" text="BASIC INFORMATION" class="border-b mb-5" />
|
|
20
|
+
<TitledInput
|
|
21
|
+
:inputValue="eventConfig.EventName || ''"
|
|
22
|
+
:invalid="validation.EventName.invalid"
|
|
23
|
+
placeholder="Enter Event Name"
|
|
24
|
+
:title="validation.EventName.invalid ? `Event Name - ${validation.EventName.message}` : 'Event Name'"
|
|
25
|
+
@update:value="handleEventNameChange"
|
|
26
|
+
/>
|
|
27
|
+
</div>
|
|
28
|
+
|
|
29
|
+
<div class="mb-4 grow">
|
|
30
|
+
<TitledInput
|
|
31
|
+
:inputValue="eventConfig.EventPrice ?? ''"
|
|
32
|
+
:invalid="priceValidation.invalid"
|
|
33
|
+
placeholder="0.00"
|
|
34
|
+
:title="priceValidationLabel"
|
|
35
|
+
@update:value="handleEventPriceChange"
|
|
36
|
+
/>
|
|
37
|
+
</div>
|
|
38
|
+
|
|
39
|
+
<div class="flex flex-row mb-3 grow">
|
|
40
|
+
<div class="mr-1 w-full">
|
|
41
|
+
<BaseText
|
|
42
|
+
color="quinary"
|
|
43
|
+
:invalid="validation.startDate"
|
|
44
|
+
size="sm"
|
|
45
|
+
text="Start Date"
|
|
46
|
+
weight="normal"
|
|
47
|
+
class="mb-1"
|
|
48
|
+
/>
|
|
49
|
+
<DatePicker
|
|
50
|
+
:invalid="validation.Date"
|
|
51
|
+
:setDate="eventConfig.Date"
|
|
52
|
+
:userLevel="userLevel"
|
|
53
|
+
@update:selectedDate="handleDateUpdate"
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
|
|
58
|
+
<div class="mb-4 grow">
|
|
59
|
+
<BaseText
|
|
60
|
+
color="quinary"
|
|
61
|
+
:invalid="validation.StartTime"
|
|
62
|
+
size="sm"
|
|
63
|
+
text="Start Time"
|
|
64
|
+
weight="normal"
|
|
65
|
+
class="mb-1"
|
|
66
|
+
/>
|
|
67
|
+
<DatePicker
|
|
68
|
+
:invalid="validation.StartTime"
|
|
69
|
+
:setDate="eventConfig.StartTime"
|
|
70
|
+
pickerMode="time"
|
|
71
|
+
@update:selectedDate="handleTimeUpdate"
|
|
72
|
+
/>
|
|
73
|
+
</div>
|
|
74
|
+
|
|
75
|
+
<div class="mb-4 grow">
|
|
76
|
+
<BaseText
|
|
77
|
+
color="quinary"
|
|
78
|
+
:invalid="validation.WeaponId"
|
|
79
|
+
size="sm"
|
|
80
|
+
text="Weapon Form"
|
|
81
|
+
weight="normal"
|
|
82
|
+
class="mb-1"
|
|
83
|
+
/>
|
|
84
|
+
<DropDownMenu
|
|
85
|
+
:label="''"
|
|
86
|
+
:items="weapons"
|
|
87
|
+
:selected-item="selectedWeapon"
|
|
88
|
+
:alignEnd="false"
|
|
89
|
+
width="w-full"
|
|
90
|
+
@update:selectedItem="handleWeaponChange"
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
|
|
94
|
+
<div class="mb-4 grow">
|
|
95
|
+
<TitledInput
|
|
96
|
+
:inputValue="eventConfig.NumberOfRings || 2"
|
|
97
|
+
:invalid="validation.NumberOfRings"
|
|
98
|
+
placeholder="Enter Number of Rings"
|
|
99
|
+
inputType="number"
|
|
100
|
+
title="Number of Rings"
|
|
101
|
+
@update:value="handleNumberOfRingsChange"
|
|
102
|
+
/>
|
|
103
|
+
</div>
|
|
104
|
+
|
|
105
|
+
<div class="mb-4 grow">
|
|
106
|
+
<TitledInput
|
|
107
|
+
:inputValue="eventConfig.CutOffNumber || ''"
|
|
108
|
+
placeholder="Unlimited"
|
|
109
|
+
inputType="number"
|
|
110
|
+
title="Max Fencers Allowed In (blank is unlimited)"
|
|
111
|
+
@update:value="handleCutOffNumber"
|
|
112
|
+
/>
|
|
113
|
+
</div>
|
|
114
|
+
|
|
115
|
+
<div class="flex flex-row justify-center h-12 mt-4">
|
|
116
|
+
<BaseButton
|
|
117
|
+
class="w-1/2 ml-1 h-12"
|
|
118
|
+
color="neutral"
|
|
119
|
+
label="Cancel"
|
|
120
|
+
size="sm"
|
|
121
|
+
type="primary"
|
|
122
|
+
@buttonClick="handleBack"
|
|
123
|
+
/>
|
|
124
|
+
<BaseButton
|
|
125
|
+
class="w-1/2 mr-1 transition-all duration-300 ease-in-out h-12"
|
|
126
|
+
color="neutral"
|
|
127
|
+
:label="nextButtonLabel"
|
|
128
|
+
selected
|
|
129
|
+
size="sm"
|
|
130
|
+
type="primary"
|
|
131
|
+
@buttonClick="handleNext"
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
</template>
|
|
136
|
+
|
|
137
|
+
<script>
|
|
138
|
+
import TitledInput from '../../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
|
|
139
|
+
import BaseText from '../../../../Atoms/Text/BaseText.vue';
|
|
140
|
+
import DatePicker from '../../../ComplexInputs/DatePicker/DatePicker.vue';
|
|
141
|
+
import DropDownMenu from '../../../ComplexInputs/DropDown/DropDownMenu.vue';
|
|
142
|
+
import BaseButton from '../../../../Molecules/Buttons/BaseButton/BaseButton.vue';
|
|
143
|
+
import StepIndicator from '../../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue';
|
|
144
|
+
|
|
145
|
+
export default {
|
|
146
|
+
name: 'BasicEventInfoForm',
|
|
147
|
+
emits: ['update', 'update:back', 'update:next'],
|
|
148
|
+
components: { StepIndicator, BaseText, DropDownMenu, DatePicker, TitledInput, BaseButton },
|
|
149
|
+
props: {
|
|
150
|
+
nextButtonLabel: { type: String, default: 'Next' },
|
|
151
|
+
eventConfig: {
|
|
152
|
+
type: Object,
|
|
153
|
+
required: true
|
|
154
|
+
},
|
|
155
|
+
weapons: {
|
|
156
|
+
type: Array,
|
|
157
|
+
required: true
|
|
158
|
+
},
|
|
159
|
+
validation: {
|
|
160
|
+
type: Object,
|
|
161
|
+
required: true
|
|
162
|
+
},
|
|
163
|
+
steps: {
|
|
164
|
+
type: Array,
|
|
165
|
+
required: true
|
|
166
|
+
},
|
|
167
|
+
currentStep: {
|
|
168
|
+
type: Number,
|
|
169
|
+
required: true
|
|
170
|
+
},
|
|
171
|
+
userLevel: {
|
|
172
|
+
type: String,
|
|
173
|
+
default: 'Club'
|
|
174
|
+
}
|
|
175
|
+
},
|
|
176
|
+
data() {
|
|
177
|
+
return {
|
|
178
|
+
validationState: {
|
|
179
|
+
invalid: false,
|
|
180
|
+
message: ''
|
|
181
|
+
}
|
|
182
|
+
};
|
|
183
|
+
},
|
|
184
|
+
computed: {
|
|
185
|
+
priceValidation() {
|
|
186
|
+
return this.validation.EventPrice ?? { invalid: false, message: '' };
|
|
187
|
+
},
|
|
188
|
+
priceValidationLabel() {
|
|
189
|
+
if (!this.priceValidation.invalid) return 'Event Price';
|
|
190
|
+
return `Event Price - ${this.priceValidation.message}`;
|
|
191
|
+
},
|
|
192
|
+
selectedWeapon() {
|
|
193
|
+
const weapon = this.weapons.find(w => w.Id === this.eventConfig.WeaponId);
|
|
194
|
+
return weapon ? weapon.Name : { text: 'Longsword', link: 1 };
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
methods: {
|
|
198
|
+
handleEventNameChange(value) {
|
|
199
|
+
this.$emit('update', { EventName: value });
|
|
200
|
+
},
|
|
201
|
+
handleEventPriceChange(value) {
|
|
202
|
+
this.$emit('update', { EventPrice: value });
|
|
203
|
+
},
|
|
204
|
+
handleDateUpdate(value) {
|
|
205
|
+
this.$emit('update', { Date: value });
|
|
206
|
+
},
|
|
207
|
+
handleTimeUpdate(value) {
|
|
208
|
+
this.$emit('update', { StartTime: value });
|
|
209
|
+
},
|
|
210
|
+
handleNumberOfRingsChange(value) {
|
|
211
|
+
this.$emit('update', { NumberOfRings: value });
|
|
212
|
+
},
|
|
213
|
+
handleWeaponChange(value) {
|
|
214
|
+
this.$emit('update', { WeaponId: value.link });
|
|
215
|
+
},
|
|
216
|
+
handleCutOffNumber(value) {
|
|
217
|
+
this.$emit('update', { CutOffNumber: value });
|
|
218
|
+
},
|
|
219
|
+
handleNext() {
|
|
220
|
+
this.$emit('update:next');
|
|
221
|
+
},
|
|
222
|
+
handleBack() {
|
|
223
|
+
this.$emit('update:back');
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
};
|
|
227
|
+
</script>
|