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