@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
@@ -1,113 +1,116 @@
1
- import TournamentForm from './TournamentPageOne.vue';
2
- import mockLocation from '../../../../mocks/locationMock.js';
3
- import mockTournaments from '../../../../mocks/tournamentMock.js';
4
- import mockPersons from '../../../../mocks/personsMock.js';
5
-
6
- const validTournamentFields = {
7
- Name: { invalid: false, message: '' },
8
- Address: { invalid: false, message: '' },
9
- StartDate: { invalid: false, message: '' },
10
- TotalDays: { invalid: false, message: '' },
11
- RegistrationCutOff: { invalid: false, message: '' },
12
- Description: { invalid: false, message: '' }
13
- };
14
-
15
- const invalidTournamentFields = {
16
- Name: { invalid: true, message: 'Tournament name is required' },
17
- Address: { invalid: true, message: 'Location is required' },
18
- StartDate: { invalid: true, message: 'Start date is required' },
19
- TotalDays: { invalid: true, message: 'Must be at least 1 day' },
20
- RegistrationCutOff: { invalid: true, message: 'Registration cut off is required' },
21
- Description: { invalid: true, message: 'Description is required' }
22
- };
23
-
24
- const emptyTournament = {
25
- Name: '',
26
- Address: { Name: '' },
27
- StartDate: new Date().toISOString().slice(0, 10),
28
- TotalDays: 1,
29
- RegistrationCutOff: new Date().toISOString().slice(0, 10),
30
- PrimaryContactId: mockPersons?.[0]?.PersonId ?? 0,
31
- Images: [{ URL: '' }],
32
- Description: ''
33
- };
34
-
35
- export default {
36
- title: 'Templates/TournamentManagement/TournamentPageOne',
37
- component: TournamentForm,
38
- tags: ['autodocs'],
39
- args: {
40
- tournament: mockTournaments[0],
41
- locations: mockLocation,
42
- persons: mockPersons,
43
- validation: validTournamentFields,
44
- isNewTournament: true,
45
- userLevel: 'Club'
46
- },
47
- argTypes: {
48
- tournament: {
49
- control: { type: 'object' }
50
- },
51
- locations: {
52
- control: { type: 'object' }
53
- },
54
- persons: {
55
- control: { type: 'object' }
56
- },
57
- validation: {
58
- control: { type: 'object' }
59
- },
60
- isNewTournament: {
61
- control: { type: 'boolean' }
62
- },
63
- userLevel: {
64
- control: { type: 'text' }
65
- }
66
- }
67
- };
68
-
69
- export const Default = {
70
- args: {
71
- tournament: mockTournaments[0],
72
- locations: mockLocation,
73
- persons: mockPersons,
74
- validation: validTournamentFields
75
- }
76
- };
77
-
78
- export const EmptyTournament = {
79
- args: {
80
- tournament: emptyTournament,
81
- locations: mockLocation,
82
- persons: mockPersons,
83
- validation: validTournamentFields
84
- }
85
- };
86
-
87
- export const EditMode = {
88
- args: {
89
- tournament: mockTournaments[0],
90
- locations: mockLocation,
91
- persons: mockPersons,
92
- validation: validTournamentFields,
93
- isNewTournament: false
94
- }
95
- };
96
-
97
- export const InvalidFields = {
98
- args: {
99
- tournament: emptyTournament,
100
- locations: mockLocation,
101
- persons: mockPersons,
102
- validation: invalidTournamentFields
103
- }
104
- };
105
-
106
- export const EmptyOptions = {
107
- args: {
108
- tournament: emptyTournament,
109
- locations: [],
110
- persons: [],
111
- validation: validTournamentFields
112
- }
113
- };
1
+ import TournamentForm from './TournamentPageOne.vue';
2
+ import mockLocation from '../../../../mocks/locationMock.js';
3
+ import mockTournaments from '../../../../mocks/tournamentMock.js';
4
+ import mockPersons from '../../../../mocks/personsMock.js';
5
+
6
+ const validTournamentFields = {
7
+ Name: { invalid: false, message: '' },
8
+ BasePrice: { invalid: false, message: '' },
9
+ Address: { invalid: false, message: '' },
10
+ StartDate: { invalid: false, message: '' },
11
+ TotalDays: { invalid: false, message: '' },
12
+ RegistrationCutOff: { invalid: false, message: '' },
13
+ Description: { invalid: false, message: '' }
14
+ };
15
+
16
+ const invalidTournamentFields = {
17
+ Name: { invalid: true, message: 'Tournament name is required' },
18
+ BasePrice: { invalid: true, message: 'Price must be a non-negative number.' },
19
+ Address: { invalid: true, message: 'Location is required' },
20
+ StartDate: { invalid: true, message: 'Start date is required' },
21
+ TotalDays: { invalid: true, message: 'Must be at least 1 day' },
22
+ RegistrationCutOff: { invalid: true, message: 'Registration cut off is required' },
23
+ Description: { invalid: true, message: 'Description is required' }
24
+ };
25
+
26
+ const emptyTournament = {
27
+ Name: '',
28
+ BasePrice: '',
29
+ Address: { Name: '' },
30
+ StartDate: new Date().toISOString().slice(0, 10),
31
+ TotalDays: 1,
32
+ RegistrationCutOff: new Date().toISOString().slice(0, 10),
33
+ PrimaryContactId: mockPersons?.[0]?.PersonId ?? 0,
34
+ Images: [{ URL: '' }],
35
+ Description: ''
36
+ };
37
+
38
+ export default {
39
+ title: 'Templates/TournamentManagement/TournamentPageOne',
40
+ component: TournamentForm,
41
+ tags: ['autodocs'],
42
+ args: {
43
+ tournament: { ...mockTournaments[0], BasePrice: 75.5 },
44
+ locations: mockLocation,
45
+ persons: mockPersons,
46
+ validation: validTournamentFields,
47
+ isNewTournament: true,
48
+ userLevel: 'Club'
49
+ },
50
+ argTypes: {
51
+ tournament: {
52
+ control: { type: 'object' }
53
+ },
54
+ locations: {
55
+ control: { type: 'object' }
56
+ },
57
+ persons: {
58
+ control: { type: 'object' }
59
+ },
60
+ validation: {
61
+ control: { type: 'object' }
62
+ },
63
+ isNewTournament: {
64
+ control: { type: 'boolean' }
65
+ },
66
+ userLevel: {
67
+ control: { type: 'text' }
68
+ }
69
+ }
70
+ };
71
+
72
+ export const Default = {
73
+ args: {
74
+ tournament: mockTournaments[0],
75
+ locations: mockLocation,
76
+ persons: mockPersons,
77
+ validation: validTournamentFields
78
+ }
79
+ };
80
+
81
+ export const EmptyTournament = {
82
+ args: {
83
+ tournament: emptyTournament,
84
+ locations: mockLocation,
85
+ persons: mockPersons,
86
+ validation: validTournamentFields
87
+ }
88
+ };
89
+
90
+ export const EditMode = {
91
+ args: {
92
+ tournament: { ...mockTournaments[0], BasePrice: 75.5 },
93
+ locations: mockLocation,
94
+ persons: mockPersons,
95
+ validation: validTournamentFields,
96
+ isNewTournament: false
97
+ }
98
+ };
99
+
100
+ export const InvalidFields = {
101
+ args: {
102
+ tournament: { ...emptyTournament, BasePrice: -5 },
103
+ locations: mockLocation,
104
+ persons: mockPersons,
105
+ validation: invalidTournamentFields
106
+ }
107
+ };
108
+
109
+ export const EmptyOptions = {
110
+ args: {
111
+ tournament: emptyTournament,
112
+ locations: [],
113
+ persons: [],
114
+ validation: validTournamentFields
115
+ }
116
+ };