@dcrackel/hematournamentui 1.0.711 → 1.0.712

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.
@@ -1,227 +1,249 @@
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>
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="mb-4 grow">
116
+ <Toggle
117
+ :checked="isWaitlistEnabled"
118
+ label="Enable Waitlist"
119
+ :labelLeft="false"
120
+ @update:checked="handleWaitlistChange"
121
+ />
122
+ <BaseText
123
+ text="Allow fencers to join a waitlist when this event reaches capacity."
124
+ size="sm"
125
+ color="quinary"
126
+ class="mt-1"
127
+ />
128
+ </div>
129
+
130
+ <div class="flex flex-row justify-center h-12 mt-4">
131
+ <BaseButton
132
+ class="w-1/2 ml-1 h-12"
133
+ color="neutral"
134
+ label="Cancel"
135
+ size="sm"
136
+ type="primary"
137
+ @buttonClick="handleBack"
138
+ />
139
+ <BaseButton
140
+ class="w-1/2 mr-1 transition-all duration-300 ease-in-out h-12"
141
+ color="neutral"
142
+ :label="nextButtonLabel"
143
+ selected
144
+ size="sm"
145
+ type="primary"
146
+ @buttonClick="handleNext"
147
+ />
148
+ </div>
149
+ </div>
150
+ </template>
151
+
152
+ <script>
153
+ import TitledInput from '../../../../Molecules/CombinationInputs/TitledInput/TitledInput.vue';
154
+ import BaseText from '../../../../Atoms/Text/BaseText.vue';
155
+ import DatePicker from '../../../ComplexInputs/DatePicker/DatePicker.vue';
156
+ import DropDownMenu from '../../../ComplexInputs/DropDown/DropDownMenu.vue';
157
+ import BaseButton from '../../../../Molecules/Buttons/BaseButton/BaseButton.vue';
158
+ import StepIndicator from '../../../../Molecules/StepIndicator/BaseStepIndicator/StepIndicator.vue';
159
+ import Toggle from '../../../../Molecules/Inputs/Toggle/Toggle.vue';
160
+
161
+ export default {
162
+ name: 'BasicEventInfoForm',
163
+ emits: ['update', 'update:back', 'update:next'],
164
+ components: { Toggle, StepIndicator, BaseText, DropDownMenu, DatePicker, TitledInput, BaseButton },
165
+ props: {
166
+ nextButtonLabel: { type: String, default: 'Next' },
167
+ eventConfig: {
168
+ type: Object,
169
+ required: true
170
+ },
171
+ weapons: {
172
+ type: Array,
173
+ required: true
174
+ },
175
+ validation: {
176
+ type: Object,
177
+ required: true
178
+ },
179
+ steps: {
180
+ type: Array,
181
+ required: true
182
+ },
183
+ currentStep: {
184
+ type: Number,
185
+ required: true
186
+ },
187
+ userLevel: {
188
+ type: String,
189
+ default: 'Club'
190
+ }
191
+ },
192
+ data() {
193
+ return {
194
+ validationState: {
195
+ invalid: false,
196
+ message: ''
197
+ }
198
+ };
199
+ },
200
+ computed: {
201
+ isWaitlistEnabled() {
202
+ return this.eventConfig.WaitlistEnabled ?? true;
203
+ },
204
+ priceValidation() {
205
+ return this.validation.EventPrice ?? { invalid: false, message: '' };
206
+ },
207
+ priceValidationLabel() {
208
+ if (!this.priceValidation.invalid) return 'Event Price';
209
+ return `Event Price - ${this.priceValidation.message}`;
210
+ },
211
+ selectedWeapon() {
212
+ const weapon = this.weapons.find(w => w.Id === this.eventConfig.WeaponId);
213
+ return weapon ? weapon.Name : { text: 'Longsword', link: 1 };
214
+ }
215
+ },
216
+ methods: {
217
+ handleEventNameChange(value) {
218
+ this.$emit('update', { EventName: value });
219
+ },
220
+ handleEventPriceChange(value) {
221
+ this.$emit('update', { EventPrice: value });
222
+ },
223
+ handleDateUpdate(value) {
224
+ this.$emit('update', { Date: value });
225
+ },
226
+ handleTimeUpdate(value) {
227
+ this.$emit('update', { StartTime: value });
228
+ },
229
+ handleNumberOfRingsChange(value) {
230
+ this.$emit('update', { NumberOfRings: value });
231
+ },
232
+ handleWeaponChange(value) {
233
+ this.$emit('update', { WeaponId: value.link });
234
+ },
235
+ handleCutOffNumber(value) {
236
+ this.$emit('update', { CutOffNumber: value });
237
+ },
238
+ handleWaitlistChange(value) {
239
+ this.$emit('update', { WaitlistEnabled: value });
240
+ },
241
+ handleNext() {
242
+ this.$emit('update:next');
243
+ },
244
+ handleBack() {
245
+ this.$emit('update:back');
246
+ }
247
+ }
248
+ };
249
+ </script>
@@ -131,3 +131,7 @@ export const SavingStep = {
131
131
  export const StepSaveFailed = {
132
132
  args: { ...Default.args, editMode: true, step: 2, saveError: 'Changes could not be saved. Please try again.' }
133
133
  };
134
+
135
+ export const WaitlistDisabled = {
136
+ args: { ...Default.args, event: { ...Default.args.event, WaitlistEnabled: false }, editMode: true, step: 1 }
137
+ };