@dcrackel/hematournamentui 1.0.707 → 1.0.709

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 (61) hide show
  1. package/AGENTS.md +118 -118
  2. package/README.md +132 -106
  3. package/dist/HemaTournamentUI-lib.es.js +7111 -7006
  4. package/dist/HemaTournamentUI-lib.umd.js +27 -27
  5. package/dist/hematournamentui-tailwind.css +198 -412
  6. package/package.json +10 -10
  7. package/src/index.js +2 -0
  8. package/src/mocks/getDEBouts-42Fencers.js +4 -4
  9. package/src/mocks/getDEBouts-TableOf128.js +37 -0
  10. package/src/mocks/getDEBouts-TableOf64.js +35 -0
  11. package/src/stories/Atoms/Input/BaseInput.test.js +97 -85
  12. package/src/stories/Atoms/Input/BaseInput.vue +149 -150
  13. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.stories.js +23 -0
  14. package/src/stories/Molecules/Indicators/MissingHemaRatingsId/MissingHemaRatingsId.vue +35 -0
  15. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.test.js +18 -0
  16. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +3 -2
  17. package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +1 -1
  18. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.stories.js +33 -0
  19. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.test.js +45 -0
  20. package/src/stories/Organisms/Cards/BracketDirectorAssignmentCard/BracketDirectorAssignmentCard.vue +103 -0
  21. package/src/stories/Organisms/Cards/FencerCard/FencerCard.vue +298 -278
  22. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.stories.js +60 -98
  23. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.test.js +103 -4
  24. package/src/stories/Organisms/Cards/TableauBoutCard/TableauBoutCard.vue +256 -215
  25. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.stories.js +69 -92
  26. package/src/stories/Organisms/Cards/TableauFencerCard/TableauFencerCard.vue +80 -128
  27. package/src/stories/Organisms/Cards/WaitlistFencerCard/WaitlistFencerCard.vue +14 -4
  28. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.stories.js +31 -20
  29. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.test.js +109 -0
  30. package/src/stories/Organisms/ComplexInputs/ImageCropper/ImageCropper.vue +192 -133
  31. package/src/stories/Organisms/Containers/Tableau/Tableau.stories.js +2 -2
  32. package/src/stories/Organisms/Containers/Tableau/Tableau.test.js +131 -3
  33. package/src/stories/Organisms/Containers/Tableau/Tableau.vue +287 -89
  34. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.test.js +29 -0
  35. package/src/stories/Organisms/Containers/Tableau/components/BracketDirectorAssignmentPanel.vue +46 -0
  36. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.test.js +21 -0
  37. package/src/stories/Organisms/Containers/Tableau/components/TableauSvgOverlay.vue +39 -0
  38. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.js +145 -0
  39. package/src/stories/Organisms/Containers/Tableau/layout/TableauLayoutEngine.test.js +64 -0
  40. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.js +57 -0
  41. package/src/stories/Organisms/Containers/Tableau/plannedAssignments.test.js +65 -0
  42. package/src/stories/Organisms/Containers/TableauColumn/TableauColumn.vue +31 -29
  43. package/src/stories/Templates/EventManagement/Bracket/Bracket.stories.js +146 -18
  44. package/src/stories/Templates/EventManagement/Bracket/Bracket.test.js +52 -2
  45. package/src/stories/Templates/EventManagement/Bracket/Bracket.vue +53 -17
  46. package/src/stories/Templates/EventManagement/Bracket/BracketPlannedSuggestions.js +39 -0
  47. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.js +39 -0
  48. package/src/stories/Templates/EventManagement/Bracket/BracketStoryHarness.test.js +79 -0
  49. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.stories.js +14 -0
  50. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.test.js +39 -0
  51. package/src/stories/Templates/PersonManagement/Admin/Administration/Administration.vue +13 -3
  52. package/src/stories/Templates/PersonManagement/Basic/BasicEdit.vue +170 -172
  53. package/src/stories/Templates/PersonManagement/PersonManagement.stories.js +156 -103
  54. package/src/stories/Templates/PersonManagement/PersonManagement.test.js +329 -0
  55. package/src/stories/Templates/PersonManagement/PersonManagement.vue +329 -213
  56. package/src/stories/Templates/PersonManagement/PersonManagementDraft.js +42 -0
  57. package/src/stories/Util/Validations/PersonManagementValidations.js +45 -29
  58. package/src/stories/Organisms/Cards/TableauBoutCard/SpacingConfig.js +0 -111
  59. package/src/stories/Organisms/Containers/TableauLines/SpacingConfig.js +0 -162
  60. package/src/stories/Organisms/Containers/TableauLines/TableauLines.stories.js +0 -21
  61. package/src/stories/Organisms/Containers/TableauLines/TableauLines.vue +0 -78
@@ -1,29 +1,45 @@
1
- export function validateField(field, value) {
2
- const rules = {
3
- DisplayName: [
4
- { check: v => !v || v.trim().length === 0, message: 'Must have a name.' },
5
- { check: v => v.trim().length < 3, message: 'Must be at least 3 characters.' }
6
- ],
7
- LegalName: [
8
- { check: v => !v || v.trim().length === 0, message: 'Must have a name.' },
9
- { check: v => v.trim().length < 4, message: 'Must be at least 4 characters.' }
10
- ],
11
- EmailAddress: [
12
- { check: v => v && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v), message: 'Must be a valid email address.' }
13
- ],
14
- SelectedClub: [
15
- {
16
- check: v =>
17
- !v ||
18
- (typeof v === 'string' && v.trim().length === 0) ||
19
- (typeof v === 'object' && (!v.text || v.text.trim().length === 0)),
20
- message: 'Please select a Club.'
21
- }
22
- ]
23
- };
24
-
25
- const ruleSet = rules[field] || [];
26
- const failedRule = ruleSet.find(rule => rule.check(value));
27
-
28
- return failedRule ? { invalid: true, message: failedRule.message } : { invalid: false, message: '' };
29
- }
1
+ function isBlankHemaRatingsId(value) {
2
+ return value === undefined || value === null || (typeof value === 'string' && value.trim() === '');
3
+ }
4
+
5
+ function isPositiveIntegerId(value) {
6
+ if (!['string', 'number'].includes(typeof value)) return false;
7
+ if (typeof value === 'string' && !/^\d+$/.test(value.trim())) return false;
8
+ return Number.isSafeInteger(Number(value)) && Number(value) > 0;
9
+ }
10
+
11
+ function isInvalidHemaRatingsId(value) {
12
+ if (isBlankHemaRatingsId(value)) return false;
13
+ return !isPositiveIntegerId(value);
14
+ }
15
+
16
+ export function validateField(field, value) {
17
+ const rules = {
18
+ DisplayName: [
19
+ { check: v => !v || v.trim().length === 0, message: 'Must have a name.' },
20
+ { check: v => v.trim().length < 3, message: 'Must be at least 3 characters.' }
21
+ ],
22
+ LegalName: [
23
+ { check: v => !v || v.trim().length === 0, message: 'Must have a name.' },
24
+ { check: v => v.trim().length < 4, message: 'Must be at least 4 characters.' }
25
+ ],
26
+ EmailAddress: [
27
+ { check: v => v && !/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(v), message: 'Must be a valid email address.' }
28
+ ],
29
+ HemaRatingsId: [{ check: isInvalidHemaRatingsId, message: 'Enter a positive whole-number ID, or leave it blank.' }],
30
+ SelectedClub: [
31
+ {
32
+ check: v =>
33
+ !v ||
34
+ (typeof v === 'string' && v.trim().length === 0) ||
35
+ (typeof v === 'object' && (!v.text || v.text.trim().length === 0)),
36
+ message: 'Please select a Club.'
37
+ }
38
+ ]
39
+ };
40
+
41
+ const ruleSet = rules[field] || [];
42
+ const failedRule = ruleSet.find(rule => rule.check(value));
43
+
44
+ return failedRule ? { invalid: true, message: failedRule.message } : { invalid: false, message: '' };
45
+ }
@@ -1,111 +0,0 @@
1
- export const spacingConfig = {
2
- Semifinal: {
3
- large: {
4
- Semifinal: { getTopSpace: 'mt-[0rem] mb-4', getCardSpace: 'mt-1' },
5
- Final: { getTopSpace: 'mt-[10rem]', getCardSpace: 'mt-1' },
6
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[19.2rem]', getCardSpace: 'mt-1' }
7
- },
8
- small: {
9
- Semifinal: { getTopSpace: 'mt-[0.7rem] mb-[1.8rem]', getCardSpace: 'mt-[2.3rem]' },
10
- Final: { getTopSpace: 'mt-[12.2rem]', getCardSpace: 'mt-1' },
11
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1' }
12
- }
13
- },
14
- 'Table of 8': {
15
- large: {
16
- 'Table of 8': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
17
- Semifinal: { getTopSpace: 'mt-[1.34rem] mb-[3.4rem]', getCardSpace: 'mt-[4.5rem]' },
18
- Final: { getTopSpace: 'mt-[11rem] ml-10', getCardSpace: 'mt-1' },
19
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[19.2rem]', getCardSpace: 'mt-1' },
20
- 'Table of 4': { getTopSpace: 'mt-[1.34rem] mb-[3.4rem]', getCardSpace: 'mt-[4.5rem]' },
21
- 'Table of 2': { getTopSpace: 'mt-[5.8rem] mb-[3.4rem]', getCardSpace: 'mt-[11.5rem]' },
22
- 'Consolation Round 1': { getTopSpace: 'mt-[3rem] mb-[2rem]', getCardSpace: 'mt-1' },
23
- 'Consolation Round 2': { getTopSpace: 'mt-[1.5rem] mb-[3.8rem]', getCardSpace: 'mt-1' },
24
- 'Consolation Round 3': { getTopSpace: 'mt-[2.7rem] mb-[3.8rem]', getCardSpace: 'mt-[8rem]' },
25
- 'Consolation Round 4': { getTopSpace: 'mt-[5rem] mb-[3.8rem]', getCardSpace: 'mt-1' },
26
- 'Grand Final': { getTopSpace: 'mt-[11rem] ml-10', getCardSpace: 'mt-1' }
27
- },
28
- small: {
29
- 'Table of 8': { getTopSpace: 'mt-[0rem] mb-4', getCardSpace: 'mt-1' },
30
- Semifinal: { getTopSpace: 'mt-[0.7rem] mb-[1.8rem]', getCardSpace: 'mt-[2.3rem]' },
31
- Final: { getTopSpace: 'mt-[6rem]', getCardSpace: 'mt-1' },
32
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1' }
33
- }
34
- },
35
- 'Table of 16': {
36
- large: {
37
- 'Table of 16': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
38
- 'Table of 8': { getTopSpace: 'mt-[1.34rem] mb-[3.4rem]', getCardSpace: 'mt-[4.5rem]' },
39
- Semifinal: { getTopSpace: 'mt-[4.6rem] mb-[7rem]', getCardSpace: 'mt-[11.5rem]' },
40
- Final: { getTopSpace: 'mt-[22.5rem]', getCardSpace: 'mt-1' },
41
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[19.2rem]', getCardSpace: 'mt-1' }
42
- },
43
- small: {
44
- 'Table of 16': { getTopSpace: 'mt-[0rem] mb-4', getCardSpace: 'mt-1' },
45
- 'Table of 8': { getTopSpace: 'mt-[0.7rem] mb-[1.75rem]', getCardSpace: 'mt-[2.3rem]' },
46
- Semifinal: { getTopSpace: 'mt-[2.25rem] mb-[3.63rem]', getCardSpace: 'mt-[5.9rem]' },
47
- Final: { getTopSpace: 'mt-[12.1rem]', getCardSpace: 'mt-1' },
48
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1' }
49
- }
50
- },
51
- 'Table of 32': {
52
- large: {
53
- 'Table of 32': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
54
- 'Table of 16': { getTopSpace: 'mt-[1.34rem] mb-[3.4rem]', getCardSpace: 'mt-[4.5rem]' },
55
- 'Table of 8': { getTopSpace: 'mt-[4.6rem] mb-[7.15rem]', getCardSpace: 'mt-[11.5rem]' },
56
- Semifinal: { getTopSpace: 'mt-[11.7rem] mb-[14rem]', getCardSpace: 'mt-[25.5rem]' },
57
- Final: { getTopSpace: 'mt-[51.5rem] ', getCardSpace: 'mt-1' },
58
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[19.2rem]', getCardSpace: 'mt-1' }
59
- },
60
- small: {
61
- 'Table of 32': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
62
- 'Table of 16': { getTopSpace: 'mt-[0.7rem] mb-[2.65rem]', getCardSpace: 'mt-[3.4rem]' },
63
- 'Table of 8': { getTopSpace: 'mt-[2.9rem] mb-[5rem]', getCardSpace: 'mt-[7.85rem]' },
64
- Semifinal: { getTopSpace: 'mt-[7rem] mb-[10rem]', getCardSpace: 'mt-[16.8rem]' },
65
- Final: { getTopSpace: 'mt-[34.1rem]', getCardSpace: 'mt-1' },
66
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1' }
67
- }
68
- },
69
- 'Table of 64': {
70
- large: {
71
- 'Table of 64': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
72
- 'Table of 32': { getTopSpace: 'mt-[1.34rem] mb-[3.4rem]', getCardSpace: 'mt-[4.5rem]' },
73
- 'Table of 16': { getTopSpace: 'mt-[4.6rem] mb-[7.15rem]', getCardSpace: 'mt-[11.5rem]' },
74
- 'Table of 8': { getTopSpace: 'mt-[11.7rem] mb-[13.78rem]', getCardSpace: 'mt-[25.76rem]' },
75
- Semifinal: { getTopSpace: 'mt-[24.45rem] mb-[29rem]', getCardSpace: 'mt-[53.6rem]' },
76
- Final: { getTopSpace: 'mt-[110rem] ', getCardSpace: 'mt-1' },
77
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[19.2rem]', getCardSpace: 'mt-1' }
78
- },
79
- small: {
80
- 'Table of 64': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
81
- 'Table of 32': { getTopSpace: 'mt-[0.7rem] mb-[2.65rem]', getCardSpace: 'mt-[3.4rem]' },
82
- 'Table of 16': { getTopSpace: 'mt-[2.9rem] mb-[5rem]', getCardSpace: 'mt-[7.85rem]' },
83
- 'Table of 8': { getTopSpace: 'mt-[7rem] mb-[9.95rem]', getCardSpace: 'mt-[16.8rem]' },
84
- Semifinal: { getTopSpace: 'mt-[16.1rem] mb-[18.8rem]', getCardSpace: 'mt-[34.8rem]' },
85
- Final: { getTopSpace: 'mt-[68rem]', getCardSpace: 'mt-1' },
86
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1' }
87
- }
88
- },
89
- 'Table of 128': {
90
- large: {
91
- 'Table of 128': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
92
- 'Table of 64': { getTopSpace: 'mt-[1.34rem] mb-[3.4rem]', getCardSpace: 'mt-[4.5rem]' },
93
- 'Table of 32': { getTopSpace: 'mt-[4.6rem] mb-[7.15rem]', getCardSpace: 'mt-[11.5rem]' },
94
- 'Table of 16': { getTopSpace: 'mt-[11.7rem] mb-[13.78rem]', getCardSpace: 'mt-[25.76rem]' },
95
- 'Table of 8': { getTopSpace: 'mt-[24.45rem] mb-[29rem]', getCardSpace: 'mt-[53.6rem]' },
96
- Semifinal: { getTopSpace: 'mt-[47.5rem] mb-[62rem]', getCardSpace: 'mt-[109.5rem]' },
97
- Final: { getTopSpace: 'mt-[223rem] ', getCardSpace: 'mt-1' },
98
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[19.2rem]', getCardSpace: 'mt-1' }
99
- },
100
- small: {
101
- 'Table of 128': { getTopSpace: 'mt-[0rem] mb-[2rem]', getCardSpace: 'mt-1' },
102
- 'Table of 64': { getTopSpace: 'mt-[0.7rem] mb-[2.65rem]', getCardSpace: 'mt-[3.4rem]' },
103
- 'Table of 32': { getTopSpace: 'mt-[2.9rem] mb-[5rem]', getCardSpace: 'mt-[7.85rem]' },
104
- 'Table of 16': { getTopSpace: 'mt-[7rem] mb-[9.95rem]', getCardSpace: 'mt-[16.8rem]' },
105
- 'Table of 8': { getTopSpace: 'mt-[16.1rem] mb-[18.8rem]', getCardSpace: 'mt-[34.8rem]' },
106
- Semifinal: { getTopSpace: 'mt-[34.3rem] mb-[36.5rem]', getCardSpace: 'mt-[70.8rem]' },
107
- Final: { getTopSpace: 'mt-[140rem]', getCardSpace: 'mt-1' },
108
- 'Third Place': { getTopSpace: '-mt-[2rem] -ml-[11rem]', getCardSpace: 'mt-1' }
109
- }
110
- }
111
- };
@@ -1,162 +0,0 @@
1
- // spacingConfig.js
2
- export const spacingConfig = {
3
- Semifinal: {
4
- large: {
5
- Semifinal: { getTopSpace: 'mt-0', getConnectorHeight: 'h-[3rem]', getTopSpaceForLine: 'mt-[1.5rem]' },
6
- Final: { getTopSpace: 'h-[8.5rem] mt-[5rem] -ml-[309px]', getBottomLine: 'h-[6.7rem] mt-[2.5rem] -ml-[309px]' },
7
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
8
- },
9
- small: {
10
- Semifinal: { getTopSpace: 'mt-[0rem]', getConnectorHeight: 'h-[3.5rem]', getTopSpaceForLine: 'mt-[1.6rem]' },
11
- Final: { getTopSpace: 'h-[6rem] mt-[9.1rem] -ml-[181px]', getBottomLine: 'h-[3rem] mt-[1.4rem] -ml-[181px]' },
12
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
13
- }
14
- },
15
- 'Table of 8': {
16
- large: {
17
- 'Table of 8': { getTopSpace: 'mt-[0rem]', getConnectorHeight: 'h-[2.7rem]', getTopSpaceForLine: 'mt-[1.2rem]' },
18
- Semifinal: { getTopSpace: 'mt-[2.5rem]', getConnectorHeight: 'h-[7rem]', getTopSpaceForLine: 'mt-[3.25rem]' },
19
- Final: { getTopSpace: 'h-[6rem] mt-[22rem] -ml-[309px]', getBottomLine: 'h-[6rem] mt-[2.5rem] -ml-[309px]' },
20
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' },
21
- 'Table of 4': { getTopSpace: 'mt-[2.5rem]', getConnectorHeight: 'h-[7rem]', getTopSpaceForLine: 'mt-[3.25rem]' },
22
- 'Table of 2': { getTopSpace: 'hidden h-[6rem] mt-[22rem]', getBottomLine: 'h-[6rem] mt-[2.5rem] -ml-[309px]' },
23
- 'Consolation Round 1': {
24
- getTopSpace: 'mt-[3rem]',
25
- getConnectorHeight: 'h-[2.7rem]',
26
- getTopSpaceForLine: 'mt-[1.2rem]'
27
- },
28
- 'Consolation Round 2': {
29
- getTopSpace: 'mt-[1.5rem]',
30
- getConnectorHeight: 'h-[2.7rem]',
31
- getTopSpaceForLine: 'mt-[1.2rem]'
32
- },
33
- 'Consolation Round 3': {
34
- getTopSpace: 'mt-[2.7rem]',
35
- getConnectorHeight: 'h-[10.5rem]',
36
- getTopSpaceForLine: 'mt-[5rem]'
37
- },
38
- 'Consolation Round 4': {
39
- getTopSpace: 'hidden mt-[2.7rem]',
40
- getConnectorHeight: 'h-[10.5rem]',
41
- getTopSpaceForLine: 'mt-[5rem]'
42
- },
43
- 'Grand Final': {
44
- getTopSpace: 'hidden h-[6rem] mt-[22rem] -ml-[309px]',
45
- getBottomLine: 'h-[6rem] mt-[2.5rem] -ml-[309px]'
46
- }
47
- },
48
- small: {
49
- 'Table of 8': {
50
- getTopSpace: '-mt-[0.6rem]',
51
- getConnectorHeight: 'h-[1.5rem]',
52
- getTopSpaceForLine: 'mt-[0.6rem]'
53
- },
54
- Semifinal: { getTopSpace: 'mt-[1.2rem]', getConnectorHeight: 'h-[3.6rem]', getTopSpaceForLine: 'mt-[1.6rem]' },
55
- Final: { getTopSpace: 'h-[6rem] mt-[9.1rem] -ml-[181px]', getBottomLine: 'h-[3rem] mt-[1.4rem] -ml-[181px]' },
56
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
57
- }
58
- },
59
- 'Table of 16': {
60
- large: {
61
- 'Table of 16': { getTopSpace: 'mt-[0rem]', getConnectorHeight: 'h-[2.7rem]', getTopSpaceForLine: 'mt-[1.2rem]' },
62
- 'Table of 8': { getTopSpace: 'mt-[1.3rem]', getConnectorHeight: 'h-[7rem]', getTopSpaceForLine: 'mt-[3.25rem]' },
63
- Semifinal: { getTopSpace: 'mt-[5.8rem]', getConnectorHeight: 'h-[14rem]', getTopSpaceForLine: 'mt-[7rem]' },
64
- Final: { getTopSpace: 'mt-[14rem] h-[12rem] -ml-[309px]', getBottomLine: 'h-[12rem] mt-[2.5rem] -ml-[309px]' },
65
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
66
- },
67
- small: {
68
- 'Table of 16': {
69
- getTopSpace: '-mt-[0.6rem]',
70
- getConnectorHeight: 'h-[1.5rem]',
71
- getTopSpaceForLine: 'mt-[0.6rem]'
72
- },
73
- 'Table of 8': { getTopSpace: '-mt-[0rem]', getConnectorHeight: 'h-[3.5rem]', getTopSpaceForLine: 'mt-[1.6rem]' },
74
- Semifinal: { getTopSpace: 'mt-[2.8rem]', getConnectorHeight: 'h-[7.2rem]', getTopSpaceForLine: 'mt-[3.8rem]' },
75
- Final: { getTopSpace: 'h-[8rem] mt-[7rem] -ml-[181px]', getBottomLine: 'h-[8rem] mt-[1.4rem] -ml-[181px]' },
76
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
77
- }
78
- },
79
- 'Table of 32': {
80
- large: {
81
- 'Table of 32': { getTopSpace: 'mt-[0rem]', getConnectorHeight: 'h-[2.7rem]', getTopSpaceForLine: 'mt-[1.2rem]' },
82
- 'Table of 16': { getTopSpace: 'mt-[1.3rem]', getConnectorHeight: 'h-[7rem]', getTopSpaceForLine: 'mt-[3.25rem]' },
83
- 'Table of 8': { getTopSpace: 'mt-[4.7rem]', getConnectorHeight: 'h-[14rem]', getTopSpaceForLine: 'mt-[7rem]' },
84
- Semifinal: { getTopSpace: 'mt-[12.8rem]', getConnectorHeight: 'h-[28rem]', getTopSpaceForLine: 'mt-[7rem]' },
85
- Final: {
86
- getTopSpace: 'h-[25.1rem] mt-[30.1rem] -ml-[309px]',
87
- getBottomLine: 'h-[25.1rem] mt-[2.5rem] -ml-[309px]'
88
- },
89
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
90
- },
91
- small: {
92
- 'Table of 32': {
93
- getTopSpace: '-mt-[0.6rem]',
94
- getConnectorHeight: 'h-[1.5rem]',
95
- getTopSpaceForLine: 'mt-[0.65rem]'
96
- },
97
- 'Table of 16': { getTopSpace: '-mt-[0rem]', getConnectorHeight: 'h-[4.8rem]', getTopSpaceForLine: 'mt-[2.2rem]' },
98
- 'Table of 8': { getTopSpace: 'mt-[2.3rem]', getConnectorHeight: 'h-[9.1rem]', getTopSpaceForLine: 'mt-[4rem]' },
99
- Semifinal: { getTopSpace: 'mt-[7.5rem]', getConnectorHeight: 'h-[18rem]', getTopSpaceForLine: 'mt-[3.8rem]' },
100
- Final: { getTopSpace: 'h-[12.6rem] mt-[24.4rem] -ml-[181px]', getBottomLine: 'h-[8rem] mt-[1.4rem] -ml-[181px]' },
101
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
102
- }
103
- },
104
- 'Table of 64': {
105
- large: {
106
- 'Table of 64': { getTopSpace: 'mt-[0rem]', getConnectorHeight: 'h-[2.7rem]', getTopSpaceForLine: 'mt-[1.2rem]' },
107
- 'Table of 32': { getTopSpace: 'mt-[1.3rem]', getConnectorHeight: 'h-[7rem]', getTopSpaceForLine: 'mt-[3.25rem]' },
108
- 'Table of 16': { getTopSpace: 'mt-[4.7rem]', getConnectorHeight: 'h-[14rem]', getTopSpaceForLine: 'mt-[7rem]' },
109
- 'Table of 8': {
110
- getTopSpace: 'mt-[11.7rem]',
111
- getConnectorHeight: 'h-[28rem]',
112
- getTopSpaceForLine: 'mt-[12.5rem]'
113
- },
114
- Semifinal: { getTopSpace: 'mt-[25.5rem]', getConnectorHeight: 'h-[56rem]', getTopSpaceForLine: 'mt-[23rem]' },
115
- Final: { getTopSpace: 'mt-[148.5rem] h-[81rem] -ml-[309px]', getBottomLine: 'h-[80rem] mt-[2.5rem] -ml-[309px]' },
116
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
117
- },
118
- small: {
119
- 'Table of 64': {
120
- getTopSpace: '-mt-[0.6rem]',
121
- getConnectorHeight: 'h-[1.5rem]',
122
- getTopSpaceForLine: 'mt-[0.65rem]'
123
- },
124
- 'Table of 32': { getTopSpace: '-mt-[0rem]', getConnectorHeight: 'h-[4.8rem]', getTopSpaceForLine: 'mt-[2.2rem]' },
125
- 'Table of 16': { getTopSpace: 'mt-[2.3rem]', getConnectorHeight: 'h-[9.1rem]', getTopSpaceForLine: 'mt-[4rem]' },
126
- 'Table of 8': { getTopSpace: 'mt-[6.4rem]', getConnectorHeight: 'h-[18rem]', getTopSpaceForLine: 'mt-[9rem]' },
127
- Semifinal: { getTopSpace: 'mt-[15.6rem]', getConnectorHeight: 'h-[36rem]', getTopSpaceForLine: 'mt-[18rem]' },
128
- Final: { getTopSpace: 'h-[256px] mt-[64.8rem] -ml-[181px]', getBottomLine: 'h-[8rem] mt-[1.4rem] -ml-[181px]' },
129
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
130
- }
131
- },
132
- 'Table of 128': {
133
- large: {
134
- 'Table of 128': { getTopSpace: 'mt-[0rem]', getConnectorHeight: 'h-[2.7rem]', getTopSpaceForLine: 'mt-[1.2rem]' },
135
- 'Table of 64': { getTopSpace: 'mt-[1.3rem]', getConnectorHeight: 'h-[7rem]', getTopSpaceForLine: 'mt-[3.25rem]' },
136
- 'Table of 32': { getTopSpace: 'mt-[4.7rem]', getConnectorHeight: 'h-[14rem]', getTopSpaceForLine: 'mt-[7rem]' },
137
- 'Table of 16': {
138
- getTopSpace: 'mt-[11.7rem]',
139
- getConnectorHeight: 'h-[28rem]',
140
- getTopSpaceForLine: 'mt-[12.5rem]'
141
- },
142
- 'Table of 8': { getTopSpace: 'mt-[24.5rem]', getConnectorHeight: 'h-[56rem]', getTopSpaceForLine: 'mt-[23rem]' },
143
- Semifinal: { getTopSpace: 'mt-[48.7rem]', getConnectorHeight: 'h-[112rem]', getTopSpaceForLine: '' },
144
- Final: { getTopSpace: 'mt-[146.5rem] h-[80rem] -ml-[309px]', getBottomLine: 'h-[80rem] mt-[2.5rem] -ml-[309px]' },
145
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
146
- },
147
- small: {
148
- 'Table of 128': {
149
- getTopSpace: '-mt-[0.6rem]',
150
- getConnectorHeight: 'h-[1.5rem]',
151
- getTopSpaceForLine: 'mt-[0.65rem]'
152
- },
153
- 'Table of 64': { getTopSpace: '-mt-[0rem]', getConnectorHeight: 'h-[4.8rem]', getTopSpaceForLine: 'mt-[2.2rem]' },
154
- 'Table of 32': { getTopSpace: 'mt-[2.3rem]', getConnectorHeight: 'h-[9.1rem]', getTopSpaceForLine: 'mt-[4rem]' },
155
- 'Table of 16': { getTopSpace: 'mt-[6.4rem]', getConnectorHeight: 'h-[18rem]', getTopSpaceForLine: 'mt-[9rem]' },
156
- 'Table of 8': { getTopSpace: 'mt-[15.6rem]', getConnectorHeight: 'h-[36rem]', getTopSpaceForLine: 'mt-[18rem]' },
157
- Semifinal: { getTopSpace: 'mt-[34.8rem]', getConnectorHeight: 'h-[72rem]', getTopSpaceForLine: 'mt-[3.8rem]' },
158
- Final: { getTopSpace: 'h-[700px] mt-[99rem] -ml-[181px]', getBottomLine: 'h-[700px] mt-[1.4rem] -ml-[181px]' },
159
- 'Third Place': { getTopSpace: 'hidden', getConnectorHeight: 'hidden', getTopSpaceForLine: 'hidden' }
160
- }
161
- }
162
- };
@@ -1,21 +0,0 @@
1
- import TableauLines from './TableauLines.vue';
2
-
3
- export default {
4
- title: 'Organisms/Containers/TableauLines',
5
- component: TableauLines,
6
- args: {
7
- roundName: 'Table of 8'
8
- },
9
- argTypes: {
10
- roundName: {
11
- control: 'string',
12
- description: 'Name of the round to display'
13
- }
14
- }
15
- };
16
-
17
- export const Default = {
18
- args: {
19
- roundName: 'Table of 8'
20
- }
21
- };
@@ -1,78 +0,0 @@
1
- <template>
2
- <section v-if="roundName !== 'Semifinal' && roundName !== 'Final'" class="flex" :class="getTopSpace">
3
- <div class="mt-[1.1rem]">
4
- <div class="border-t border-b border-r w-5 rounded-md -ml-[0.3rem] z-0" :class="getConnectorHeight"></div>
5
- </div>
6
- <div :class="getTopSpaceForLine">
7
- <div class="border-b w-5 h-5"></div>
8
- </div>
9
- </section>
10
-
11
- <section v-if="roundName === 'Semifinal'" class="flex mr-5">
12
- <div class="flex flex-col -ml-1" :class="getTopSpace">
13
- <div class="border-t border-b border-r w-5 rounded-md z-0" :class="getConnectorHeight"></div>
14
- </div>
15
- </section>
16
-
17
- <!-- <section v-if="roundName === 'Final'" class="flex flex-col mr-5 bg-bright" >-->
18
- <!-- <div class="border-b border-l w-6 rounded-bl-md z-0 h-[6rem]" :class="getTopSpace" ></div>-->
19
- <!-- <div class="border-t border-l w-6 rounded-tl-md z-0 h-[6rem]" :class="getBottomLine" ></div>-->
20
- <!-- </section>-->
21
- </template>
22
-
23
- <script>
24
- import { spacingConfig } from './SpacingConfig';
25
-
26
- export default {
27
- name: 'TableauLines',
28
- props: {
29
- roundName: {
30
- type: String,
31
- required: true
32
- },
33
- bracketSize: {
34
- type: String,
35
- required: true
36
- },
37
- large: {
38
- type: Boolean,
39
- default: true
40
- }
41
- },
42
- watch: {
43
- large(newVal, oldVal) {
44
- if (newVal !== oldVal) {
45
- this.updateConfig();
46
- }
47
- }
48
- },
49
- data() {
50
- return {
51
- currentConfig: {}
52
- };
53
- },
54
- mounted() {
55
- this.updateConfig();
56
- },
57
- computed: {
58
- getTopSpace() {
59
- return this.currentConfig?.getTopSpace || '';
60
- },
61
- getTopSpaceForLine() {
62
- return this.currentConfig?.getTopSpaceForLine || '';
63
- },
64
- getConnectorHeight() {
65
- return this.currentConfig?.getConnectorHeight || '';
66
- },
67
- getBottomLine() {
68
- return this.currentConfig?.getBottomLine || '';
69
- }
70
- },
71
- methods: {
72
- updateConfig() {
73
- const size = this.large ? 'large' : 'small';
74
- this.currentConfig = spacingConfig[this.bracketSize]?.[size]?.[this.roundName] || {};
75
- }
76
- }
77
- };
78
- </script>