@dcrackel/hematournamentui 1.0.709 → 1.0.711

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.
Files changed (24) hide show
  1. package/README.md +16 -0
  2. package/dist/HemaTournamentUI-lib.es.js +4343 -4086
  3. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  4. package/dist/hematournamentui-tailwind.css +3 -0
  5. package/package.json +1 -1
  6. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.stories.js +48 -41
  7. package/src/stories/Organisms/Wizards/EditEventWizard/BasicEventInfo/BasicEventInfo.vue +227 -206
  8. package/src/stories/Organisms/Wizards/EditEventWizard/DirectElimination/DirectElimination.vue +226 -225
  9. package/src/stories/Organisms/Wizards/EditEventWizard/DirectEliminationPromotion/DirectEliminationPromotion.vue +204 -204
  10. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.stories.js +133 -91
  11. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.test.js +191 -0
  12. package/src/stories/Organisms/Wizards/EditEventWizard/EditEventWizard.vue +366 -309
  13. package/src/stories/Organisms/Wizards/EditEventWizard/EventCustomization/EventCustomization.vue +172 -171
  14. package/src/stories/Organisms/Wizards/EditEventWizard/PoolConfiguration/PoolConfiguration.vue +216 -215
  15. package/src/stories/Organisms/Wizards/EditEventWizard/PriceFields.test.js +79 -0
  16. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.stories.js +93 -52
  17. package/src/stories/Templates/EventManagement/EditEventInfo/EditEventInfo.vue +91 -75
  18. package/src/stories/Templates/TournamentManagement/TournamentManagement.stories.js +84 -83
  19. package/src/stories/Templates/TournamentManagement/TournamentManagement.test.js +114 -0
  20. package/src/stories/Templates/TournamentManagement/TournamentManagement.vue +363 -360
  21. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.stories.js +116 -113
  22. package/src/stories/Templates/TournamentManagement/TournamentPageOne/TournamentPageOne.vue +307 -280
  23. package/src/stories/Util/Validations/PriceValidation.js +6 -0
  24. package/src/stories/Util/Validations/TournamentFieldsValidations.js +4 -0
@@ -1,225 +1,226 @@
1
- <template>
2
- <div class="flex flex-col h-full pb-4">
3
- <div class="w-full flex justify-center">
4
- <StepIndicator :steps="steps" :selected="currentStep" />
5
- </div>
6
-
7
- <div class="grow">
8
- <div class="w-full flex flex-row justify-center my-4">
9
- <BaseText
10
- :color="'primaryHighlight'"
11
- :size="'2xl'"
12
- :text="'DIRECT ELIMINATION'"
13
- :weight="'normal'"
14
- data-testid="text-add-tournament"
15
- />
16
- </div>
17
- <div class="w-full flex flex-col mb-3 ml-1">
18
- <BaseText
19
- :color="'quinary'"
20
- :size="'sm'"
21
- :text="'Define the criteria for promoting fencers to the Direct Elimination (DE) stage. These options specify how fencers advance based on their performance metrics. Ensure the correct order of criteria to reflect their importance in the promotion process.'"
22
- :weight="'normal'"
23
- data-testid="text-registration"
24
- />
25
- </div>
26
-
27
- <div class="grow">
28
- <div class="mb-4 mt-8">
29
- <BaseText :color="'quaternary'" :size="'xs'" :text="'TYPE OF DIRECT ELIMINATION'" class="border-b mb-5" />
30
- </div>
31
- <div class="mb-2 flex flex-col">
32
- <BaseText
33
- :color="'quinary'"
34
- :size="'sm'"
35
- :text="'Please select the format type for the direct elimination bracket of your event.'"
36
- :weight="'normal'"
37
- data-testid="text-registration"
38
- class="mb-4"
39
- />
40
- <DropDownMenu
41
- label="Select Format"
42
- :items="DEFormats"
43
- :selected-item="selectedFormat"
44
- :alignEnd="false"
45
- :width="'w-full'"
46
- :dropDownWidth="'w-full'"
47
- @update:selectedItem="handleDEFormatChange"
48
- />
49
- </div>
50
- </div>
51
-
52
- <div class="mb-4 mt-8">
53
- <BaseText :color="'quaternary'" :size="'xs'" :text="'DIRECT ELIMINATION CONFIGURATION'" class="border-b mb-5" />
54
- <BaseText
55
- :color="'quaternary'"
56
- :size="'sm'"
57
- :text="'Timer duration is in seconds.'"
58
- :weight="'normal'"
59
- class="mt-1"
60
- />
61
- </div>
62
- <div class="mb-2 flex">
63
- <div class="mt-1 h-10 w-52">
64
- <Toggle
65
- :checked="localEventConfig.DETimer"
66
- label="DE Timer"
67
- :labelLeft="false"
68
- @update:checked="handleDETimerToggle"
69
- />
70
- </div>
71
- <TitledInput
72
- v-if="localEventConfig.DETimer"
73
- :inputValue="localEventConfig.DETime"
74
- :invalid="validation.DETime"
75
- inputType="number"
76
- placeholder="Enter Time in Seconds"
77
- title=""
78
- @update:value="handleDETimeChange"
79
- />
80
- </div>
81
- <div class="mb-2 flex">
82
- <div class="mt-1 h-10 w-52">
83
- <Toggle
84
- :checked="localEventConfig.DEBoutCounter"
85
- label="DE Pass Counter"
86
- :labelLeft="false"
87
- inputType="number"
88
- @update:checked="handleDEBoutCountToggle"
89
- />
90
- </div>
91
- <TitledInput
92
- v-if="localEventConfig.DEBoutCounter"
93
- :inputValue="localEventConfig.DEBoutCount"
94
- inputType="number"
95
- :invalid="validation.DEBoutCount"
96
- placeholder="Enter Number of Passes"
97
- title=""
98
- @update:value="handleDEBoutCountChange"
99
- />
100
- </div>
101
- <div class="mb-2 flex">
102
- <div class="mt-1 h-10 w-52">
103
- <Toggle
104
- :checked="localEventConfig.DEMax"
105
- label="DE Max Points"
106
- :labelLeft="false"
107
- @update:checked="handleDEMax"
108
- />
109
- </div>
110
- <TitledInput
111
- v-if="localEventConfig.DEMax"
112
- :inputValue="localEventConfig.DEMaxPoints"
113
- :invalid="validation.DEMaxPoints"
114
- placeholder="Enter DE Max Points"
115
- inputType="number"
116
- title=""
117
- @update:value="handleDEMaxPointsChange"
118
- />
119
- </div>
120
- </div>
121
-
122
- <div v-if="localEventConfig.DEType === 'single'" class="grow">
123
- <div class="mb-4 mt-8">
124
- <BaseText
125
- :color="'quaternary'"
126
- :size="'xs'"
127
- :text="'TIE FOR THIRD PLACE OR FENCE OFF FOR THIRD'"
128
- class="border-b mb-5"
129
- />
130
- </div>
131
- <div class="mt-8 h-10 w-52">
132
- <Toggle
133
- :checked="localEventConfig.thirdPlaceBout"
134
- :label="thirdPlaceLabel"
135
- :labelLeft="false"
136
- @update:checked="handleThirdPlaceToggle"
137
- />
138
- </div>
139
- </div>
140
-
141
- <div class="flex flex-row justify-center h-12 mt-4">
142
- <BaseButton class="w-1/2 ml-1" color="neutral" label="Back" size="sm" type="primary" @buttonClick="handleBack" />
143
- <BaseButton
144
- class="w-1/2 mr-1 transition-all duration-300 ease-in-out h-12"
145
- color="neutral"
146
- label="Submit"
147
- selected="selected"
148
- size="sm"
149
- type="primary"
150
- @buttonClick="handleNext"
151
- />
152
- </div>
153
- </div>
154
- </template>
155
-
156
- <script>
157
- import TitledInput from '../../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
158
- import BaseText from '../../../../Atoms/Text/BaseText.vue';
159
- import Toggle from '../../../../Molecules/Inputs/Toggle/Toggle.vue';
160
- import MultiSelect from '../../../../Molecules/Inputs/MultiSelect/MultiSelect.vue';
161
- import StepIndicator from '../../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue';
162
- import BaseButton from '../../../../Molecules/Buttons/BaseButton/BaseButton.vue';
163
- import DropDownMenu from '../../../ComplexInputs/DropDown/DropDownMenu.vue';
164
-
165
- export default {
166
- name: 'DirectElimination',
167
- components: { DropDownMenu, BaseButton, StepIndicator, BaseText, TitledInput, Toggle, MultiSelect },
168
- props: {
169
- eventConfig: Object,
170
- validation: Object,
171
- currentStep: Number,
172
- steps: Array,
173
- DEFormats: Array
174
- },
175
- emits: ['update', 'update:back', 'update:submit'],
176
- data() {
177
- return {
178
- localEventConfig: { ...this.eventConfig },
179
- selectedFormat: { link: 1, text: 'Single Elimination' }
180
- };
181
- },
182
- computed: {
183
- thirdPlaceLabel() {
184
- return this.eventConfig.thirdPlaceBout ? '3rd Place Fence Off' : 'Tie for 3rd Place';
185
- }
186
- },
187
- methods: {
188
- handleDETimerToggle(value) {
189
- this.localEventConfig.DETimer = value;
190
- this.$emit('update', { DETimer: value });
191
- },
192
- handleDETimeChange(value) {
193
- this.$emit('update', { DETime: value });
194
- },
195
- handleDEBoutCountToggle(value) {
196
- this.localEventConfig.DEBoutCounter = value;
197
- this.$emit('update', { DEBoutCounter: value });
198
- },
199
- handleDEBoutCountChange(value) {
200
- this.$emit('update', { DEBoutCount: value });
201
- },
202
- handleDEMax(value) {
203
- this.localEventConfig.DEMax = value;
204
- this.$emit('update', { DEMax: value });
205
- },
206
- handleDEMaxPointsChange(value) {
207
- this.$emit('update', { DEMaxPoints: value });
208
- },
209
- handleThirdPlaceToggle(value) {
210
- this.$emit('update', { thirdPlaceBout: value });
211
- },
212
- handleBack() {
213
- this.$emit('update:back');
214
- },
215
- handleNext() {
216
- this.$emit('update:submit');
217
- },
218
- handleDEFormatChange(value) {
219
- this.selectedFormat = value;
220
- this.localEventConfig.DEType = value.text === 'Single Elimination' ? 'single' : 'double';
221
- this.$emit('update', { DEType: this.localEventConfig.DEType });
222
- }
223
- }
224
- };
225
- </script>
1
+ <template>
2
+ <div class="flex flex-col h-full pb-4">
3
+ <div class="w-full flex justify-center">
4
+ <StepIndicator :steps="steps" :selected="currentStep" />
5
+ </div>
6
+
7
+ <div class="grow">
8
+ <div class="w-full flex flex-row justify-center my-4">
9
+ <BaseText
10
+ :color="'primaryHighlight'"
11
+ :size="'2xl'"
12
+ :text="'DIRECT ELIMINATION'"
13
+ :weight="'normal'"
14
+ data-testid="text-add-tournament"
15
+ />
16
+ </div>
17
+ <div class="w-full flex flex-col mb-3 ml-1">
18
+ <BaseText
19
+ :color="'quinary'"
20
+ :size="'sm'"
21
+ :text="'Define the criteria for promoting fencers to the Direct Elimination (DE) stage. These options specify how fencers advance based on their performance metrics. Ensure the correct order of criteria to reflect their importance in the promotion process.'"
22
+ :weight="'normal'"
23
+ data-testid="text-registration"
24
+ />
25
+ </div>
26
+
27
+ <div class="grow">
28
+ <div class="mb-4 mt-8">
29
+ <BaseText :color="'quaternary'" :size="'xs'" :text="'TYPE OF DIRECT ELIMINATION'" class="border-b mb-5" />
30
+ </div>
31
+ <div class="mb-2 flex flex-col">
32
+ <BaseText
33
+ :color="'quinary'"
34
+ :size="'sm'"
35
+ :text="'Please select the format type for the direct elimination bracket of your event.'"
36
+ :weight="'normal'"
37
+ data-testid="text-registration"
38
+ class="mb-4"
39
+ />
40
+ <DropDownMenu
41
+ label="Select Format"
42
+ :items="DEFormats"
43
+ :selected-item="selectedFormat"
44
+ :alignEnd="false"
45
+ :width="'w-full'"
46
+ :dropDownWidth="'w-full'"
47
+ @update:selectedItem="handleDEFormatChange"
48
+ />
49
+ </div>
50
+ </div>
51
+
52
+ <div class="mb-4 mt-8">
53
+ <BaseText :color="'quaternary'" :size="'xs'" :text="'DIRECT ELIMINATION CONFIGURATION'" class="border-b mb-5" />
54
+ <BaseText
55
+ :color="'quaternary'"
56
+ :size="'sm'"
57
+ :text="'Timer duration is in seconds.'"
58
+ :weight="'normal'"
59
+ class="mt-1"
60
+ />
61
+ </div>
62
+ <div class="mb-2 flex">
63
+ <div class="mt-1 h-10 w-52">
64
+ <Toggle
65
+ :checked="localEventConfig.DETimer"
66
+ label="DE Timer"
67
+ :labelLeft="false"
68
+ @update:checked="handleDETimerToggle"
69
+ />
70
+ </div>
71
+ <TitledInput
72
+ v-if="localEventConfig.DETimer"
73
+ :inputValue="localEventConfig.DETime"
74
+ :invalid="validation.DETime"
75
+ inputType="number"
76
+ placeholder="Enter Time in Seconds"
77
+ title=""
78
+ @update:value="handleDETimeChange"
79
+ />
80
+ </div>
81
+ <div class="mb-2 flex">
82
+ <div class="mt-1 h-10 w-52">
83
+ <Toggle
84
+ :checked="localEventConfig.DEBoutCounter"
85
+ label="DE Pass Counter"
86
+ :labelLeft="false"
87
+ inputType="number"
88
+ @update:checked="handleDEBoutCountToggle"
89
+ />
90
+ </div>
91
+ <TitledInput
92
+ v-if="localEventConfig.DEBoutCounter"
93
+ :inputValue="localEventConfig.DEBoutCount"
94
+ inputType="number"
95
+ :invalid="validation.DEBoutCount"
96
+ placeholder="Enter Number of Passes"
97
+ title=""
98
+ @update:value="handleDEBoutCountChange"
99
+ />
100
+ </div>
101
+ <div class="mb-2 flex">
102
+ <div class="mt-1 h-10 w-52">
103
+ <Toggle
104
+ :checked="localEventConfig.DEMax"
105
+ label="DE Max Points"
106
+ :labelLeft="false"
107
+ @update:checked="handleDEMax"
108
+ />
109
+ </div>
110
+ <TitledInput
111
+ v-if="localEventConfig.DEMax"
112
+ :inputValue="localEventConfig.DEMaxPoints"
113
+ :invalid="validation.DEMaxPoints"
114
+ placeholder="Enter DE Max Points"
115
+ inputType="number"
116
+ title=""
117
+ @update:value="handleDEMaxPointsChange"
118
+ />
119
+ </div>
120
+ </div>
121
+
122
+ <div v-if="localEventConfig.DEType === 'single'" class="grow">
123
+ <div class="mb-4 mt-8">
124
+ <BaseText
125
+ :color="'quaternary'"
126
+ :size="'xs'"
127
+ :text="'TIE FOR THIRD PLACE OR FENCE OFF FOR THIRD'"
128
+ class="border-b mb-5"
129
+ />
130
+ </div>
131
+ <div class="mt-8 h-10 w-52">
132
+ <Toggle
133
+ :checked="localEventConfig.thirdPlaceBout"
134
+ :label="thirdPlaceLabel"
135
+ :labelLeft="false"
136
+ @update:checked="handleThirdPlaceToggle"
137
+ />
138
+ </div>
139
+ </div>
140
+
141
+ <div class="flex flex-row justify-center h-12 mt-4">
142
+ <BaseButton class="w-1/2 ml-1" color="neutral" label="Back" size="sm" type="primary" @buttonClick="handleBack" />
143
+ <BaseButton
144
+ class="w-1/2 mr-1 transition-all duration-300 ease-in-out h-12"
145
+ color="neutral"
146
+ :label="nextButtonLabel"
147
+ selected="selected"
148
+ size="sm"
149
+ type="primary"
150
+ @buttonClick="handleNext"
151
+ />
152
+ </div>
153
+ </div>
154
+ </template>
155
+
156
+ <script>
157
+ import TitledInput from '../../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
158
+ import BaseText from '../../../../Atoms/Text/BaseText.vue';
159
+ import Toggle from '../../../../Molecules/Inputs/Toggle/Toggle.vue';
160
+ import MultiSelect from '../../../../Molecules/Inputs/MultiSelect/MultiSelect.vue';
161
+ import StepIndicator from '../../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue';
162
+ import BaseButton from '../../../../Molecules/Buttons/BaseButton/BaseButton.vue';
163
+ import DropDownMenu from '../../../ComplexInputs/DropDown/DropDownMenu.vue';
164
+
165
+ export default {
166
+ name: 'DirectElimination',
167
+ components: { DropDownMenu, BaseButton, StepIndicator, BaseText, TitledInput, Toggle, MultiSelect },
168
+ props: {
169
+ nextButtonLabel: { type: String, default: 'Submit' },
170
+ eventConfig: Object,
171
+ validation: Object,
172
+ currentStep: Number,
173
+ steps: Array,
174
+ DEFormats: Array
175
+ },
176
+ emits: ['update', 'update:back', 'update:submit'],
177
+ data() {
178
+ return {
179
+ localEventConfig: { ...this.eventConfig },
180
+ selectedFormat: { link: 1, text: 'Single Elimination' }
181
+ };
182
+ },
183
+ computed: {
184
+ thirdPlaceLabel() {
185
+ return this.eventConfig.thirdPlaceBout ? '3rd Place Fence Off' : 'Tie for 3rd Place';
186
+ }
187
+ },
188
+ methods: {
189
+ handleDETimerToggle(value) {
190
+ this.localEventConfig.DETimer = value;
191
+ this.$emit('update', { DETimer: value });
192
+ },
193
+ handleDETimeChange(value) {
194
+ this.$emit('update', { DETime: value });
195
+ },
196
+ handleDEBoutCountToggle(value) {
197
+ this.localEventConfig.DEBoutCounter = value;
198
+ this.$emit('update', { DEBoutCounter: value });
199
+ },
200
+ handleDEBoutCountChange(value) {
201
+ this.$emit('update', { DEBoutCount: value });
202
+ },
203
+ handleDEMax(value) {
204
+ this.localEventConfig.DEMax = value;
205
+ this.$emit('update', { DEMax: value });
206
+ },
207
+ handleDEMaxPointsChange(value) {
208
+ this.$emit('update', { DEMaxPoints: value });
209
+ },
210
+ handleThirdPlaceToggle(value) {
211
+ this.$emit('update', { thirdPlaceBout: value });
212
+ },
213
+ handleBack() {
214
+ this.$emit('update:back');
215
+ },
216
+ handleNext() {
217
+ this.$emit('update:submit');
218
+ },
219
+ handleDEFormatChange(value) {
220
+ this.selectedFormat = value;
221
+ this.localEventConfig.DEType = value.text === 'Single Elimination' ? 'single' : 'double';
222
+ this.$emit('update', { DEType: this.localEventConfig.DEType });
223
+ }
224
+ }
225
+ };
226
+ </script>