@dcrackel/hematournamentui 1.0.98 → 1.0.99

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 (54) hide show
  1. package/dist/{HemaTouranmentUI-lib.es.js → HemaTournamentUI-lib.es.js} +1578 -1474
  2. package/dist/{HemaTouranmentUI-lib.umd.js → HemaTournamentUI-lib.umd.js} +4 -4
  3. package/package.json +3 -1
  4. package/src/assets/portrait1.png +0 -0
  5. package/src/config/boutScreenConfigurations.js +54 -0
  6. package/src/mocks/eventRules.js +31 -0
  7. package/src/mocks/getPoolsWithBouts.js +405 -0
  8. package/src/mocks/getPoolsWithBoutsByPoolId.js +921 -0
  9. package/src/mocks/getPoolsWithBoutsClubColors.js +6 -0
  10. package/src/mocks/getPoolsWithBoutsComplete.js +926 -0
  11. package/src/stories/Atoms/Icon/BaseIcon.vue +8 -4
  12. package/src/stories/Atoms/Text/BaseText.vue +8 -2
  13. package/src/stories/Molecules/Boxes/BoutBoxes/PassesBox/PassesBox.stories.js +60 -0
  14. package/src/stories/Molecules/Boxes/BoutBoxes/PassesBox/PassesBox.vue +94 -0
  15. package/src/stories/Molecules/Boxes/BoutBoxes/ScoreBox/ScoreBox.stories.js +113 -0
  16. package/src/stories/Molecules/Boxes/BoutBoxes/ScoreBox/ScoreBox.vue +110 -0
  17. package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.stories.js +39 -0
  18. package/src/stories/Molecules/Boxes/BoutBoxes/TimerBox/TimerBox.vue +112 -0
  19. package/src/stories/Molecules/Breadcrumb/Admin/Breadcrumb.test.js +0 -2
  20. package/src/stories/Molecules/Buttons/BaseButton/BaseButton.vue +6 -8
  21. package/src/stories/Molecules/Modals/BaseModal/BaseModal.vue +0 -5
  22. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.stories.js +52 -0
  23. package/src/stories/Molecules/Modals/DirectorModal/DirectorModal.vue +64 -0
  24. package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.stories.js +56 -0
  25. package/src/stories/Molecules/Modals/EditBoutModal/EditBoutModal.vue +57 -0
  26. package/src/stories/Organisms/Cards/BoutCard/BoutCard.stories.js +81 -0
  27. package/src/stories/Organisms/Cards/BoutCard/BoutCard.vue +212 -0
  28. package/src/stories/Organisms/Cards/Director/DirectorCard.stories.js +34 -0
  29. package/src/stories/Organisms/Cards/Director/DirectorCard.vue +100 -0
  30. package/src/stories/Organisms/Cards/EditBout/EditBout.stories.js +53 -0
  31. package/src/stories/Organisms/Cards/EditBout/EditBout.vue +150 -0
  32. package/src/stories/Organisms/Cards/PoolBoutMatchCard/PoolBoutMatchCard.stories.js +202 -0
  33. package/src/stories/Organisms/Cards/PoolBoutMatchCard/PoolBoutMatchCard.vue +59 -0
  34. package/src/stories/Organisms/Cards/PoolFencerCard/PoolFencerCard.vue +30 -20
  35. package/src/stories/Organisms/ComplexInputs/FindLocation/FindLocation.vue +0 -2
  36. package/src/stories/Organisms/ComplexInputs/FindOrAddPerson/FindOrAddPerson.vue +0 -5
  37. package/src/stories/Organisms/Containers/Pool/Pool.vue +25 -5
  38. package/src/stories/Organisms/Containers/PoolGrid/PoolGrid.stories.js +30 -0
  39. package/src/stories/Organisms/Containers/PoolGrid/PoolGrid.vue +204 -0
  40. package/src/stories/Organisms/Headers/PoolSummary/PoolSummary.stories.js +42 -1
  41. package/src/stories/Organisms/Headers/PoolSummary/PoolSummary.vue +15 -4
  42. package/src/stories/Organisms/Headers/ToggleHeader/ToggleHeader.stories.js +52 -0
  43. package/src/stories/Organisms/Headers/{StaffSummary/StaffSummary.vue → ToggleHeader/ToggleHeader.vue} +20 -11
  44. package/src/stories/Templates/EventManagement/ListEvents/ListEvents.vue +0 -3
  45. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.stories.js +32 -0
  46. package/src/stories/Templates/EventManagement/PoolLive/PoolLive.vue +206 -0
  47. package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.stories.js +1 -1
  48. package/src/stories/Templates/EventManagement/PoolManagement/PoolManagement.vue +1 -1
  49. package/src/stories/Templates/EventManagement/StaffList/StaffList.vue +3 -3
  50. package/src/stories/Templates/Menus/EditEventsTopMenu/EditEventsTopMenu.vue +0 -5
  51. package/src/stories/Templates/TournamentManagement/EditTournament/EditPageOne/EditTournamentPageOne.vue +0 -3
  52. package/tailwind.config.js +46 -3
  53. package/vite.config.js +9 -8
  54. package/src/stories/Organisms/Headers/StaffSummary/StaffSummary.stories.js +0 -35
@@ -32,7 +32,11 @@ export default {
32
32
  },
33
33
  hover: {
34
34
  type: String,
35
- default: 'primary'
35
+ default: ''
36
+ },
37
+ disabled: {
38
+ type: Boolean,
39
+ default: false
36
40
  }
37
41
  },
38
42
  computed: {
@@ -41,15 +45,15 @@ export default {
41
45
  this.style,
42
46
  this.iconName,
43
47
  `text-${this.size}`,
44
- this.colorClass,
45
- this.hoverClass
48
+ this.disabled ? 'text-gridBoxHeader' : this.colorClass,
49
+ this.disabled ? '' : this.hoverClass
46
50
  ];
47
51
  },
48
52
  colorClass() {
49
53
  return `text-${this.color}`;
50
54
  },
51
55
  hoverClass() {
52
- return `hover:text-${this.hover}`;
56
+ return this.hover === '' ? ` hover:text-${this.color}` : ` hover:text-${this.hover}`;
53
57
  }
54
58
  }
55
59
  };
@@ -25,7 +25,7 @@ export default {
25
25
  type: String,
26
26
  default: 'sm',
27
27
  validator: function (value) {
28
- return ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl'].indexOf(value) !== -1;
28
+ return ['xs', 'sm', 'md', 'lg', 'xl', '2xl', '3xl', '4xl', '5xl'].indexOf(value) !== -1;
29
29
  }
30
30
  },
31
31
  color: {
@@ -88,7 +88,7 @@ export default {
88
88
  baseClasses += ' text-bright';
89
89
  break;
90
90
  case 'alarm':
91
- baseClasses += ' text-alarmText';
91
+ baseClasses += ' text-lossRed';
92
92
  break;
93
93
  }
94
94
 
@@ -163,6 +163,12 @@ export default {
163
163
  case '3xl':
164
164
  baseClasses += ' text-3xl';
165
165
  break;
166
+ case '4xl':
167
+ baseClasses += ' text-4xl';
168
+ break;
169
+ case '5xl':
170
+ baseClasses += ' text-5xl';
171
+ break;
166
172
  }
167
173
  return baseClasses;
168
174
  })
@@ -0,0 +1,60 @@
1
+ import PassesBox from './PassesBox.vue';
2
+ import eventRules from "../../../../../mocks/eventRules.js";
3
+ import getPoolsWithBouts from "../../../../../mocks/getPoolsWithBouts.js";
4
+
5
+ export default {
6
+ title: 'Molecules/Boxes/BoutBoxes/PassesBox',
7
+ component: PassesBox,
8
+ tags: ['autodocs'],
9
+ args: {
10
+ maxPasses: 5,
11
+ bout: {
12
+ CurrentPass: 2
13
+ },
14
+ hostingClubColors: {
15
+ Color1: 'red',
16
+ Color2: 'blue'
17
+ },
18
+ showSubmit: false,
19
+ screenHeight: 1080,
20
+ },
21
+ argTypes: {
22
+ maxPasses: { control: 'number' },
23
+ bout: { control: 'object' },
24
+ hostingClubColors: { control: 'object'},
25
+ showSubmit: { control: 'boolean' },
26
+ screenHeight: { control: 'number' },
27
+ },
28
+ };
29
+
30
+
31
+
32
+ export const Default = {
33
+ args: {
34
+ maxPasses: 5,
35
+ bout: {
36
+ CurrentPass: 2
37
+ },
38
+ hostingClubColors: {
39
+ Color1: 'red',
40
+ Color2: 'blue'
41
+ },
42
+ showSubmit: false,
43
+ screenHeight: 1080,
44
+ }
45
+ };
46
+
47
+ export const WithSubmit = {
48
+ args: {
49
+ maxPasses: 5,
50
+ bout: {
51
+ CurrentPass: 4
52
+ },
53
+ hostingClubColors: {
54
+ Color1: 'red',
55
+ Color2: 'blue'
56
+ },
57
+ showSubmit: true,
58
+ screenHeight: 1080,
59
+ }
60
+ };
@@ -0,0 +1,94 @@
1
+ <template>
2
+ <section class="w-full">
3
+ <div class="mt-4 py-4 md:w-11/12 w-full flex flex-col bg-white mx-auto rounded-2xl shadow-md">
4
+ <div class="w-full rounded-t-xl flex flex-row justify-between pt-2">
5
+ <div class="w-full text-center mt-0">
6
+ <BaseText text="Current Pass" size="xl" color="quaternary" weight="bold" />
7
+ </div>
8
+ </div>
9
+
10
+ <div class="w-full flex flex-row justify-around text-center px-4 pt-4">
11
+ <div class="pt-1 w-1/4" @click="minusPass">
12
+ <BaseIcon icon-name="fa-square-minus" size="5xl" color="quaternary" hover="quaternary" class="hover:text-quaternaryHighlight" :disabled="score <= 0" />
13
+ </div>
14
+ <div class="flex flex-row w-1/2 justify-center">
15
+ <BaseText :text="currentPass + 1" size="5xl" color="primary" weight="bold" />
16
+ </div>
17
+ <div class="pt-1 w-1/4" @click="addPass">
18
+ <BaseIcon icon-name="fa-square-plus" size="5xl" color="quaternary" hover="quaternary" class="hover:text-quaternaryHighlight" :disabled="score <= 0" />
19
+ </div>
20
+ </div>
21
+
22
+ <div class="flex flex-row justify-center">
23
+ <div v-if="showSubmit" class="flex flex-row justify-between m-8 w-9/12">
24
+ <button class="w-full rounded-xl p-1 bg-red text-cloud" @click="submit">
25
+ Submit Score
26
+ </button>
27
+ </div>
28
+ <div v-if="!showSubmit" class="flex flex-row justify-between m-4 md:m-9 w-9/12">
29
+ <div v-for="(pass, index) in passes" :key="index">
30
+ <div v-if="currentPass < index" class="w-4 h-4 border border-quaternary rounded-full"></div>
31
+ <div v-if="currentPass >= index" class="w-4 h-4 bg-blue rounded-full"></div>
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </section>
37
+ </template>
38
+
39
+ <script>
40
+ import BaseIcon from "../../../../Atoms/Icon/BaseIcon.vue";
41
+ import BaseText from "../../../../Atoms/Text/BaseText.vue";
42
+
43
+ export default {
44
+ name: 'PassesBox',
45
+ components: {BaseText, BaseIcon},
46
+ props: {
47
+ maxPasses: {
48
+ type: Number,
49
+ required: true,
50
+ },
51
+ bout: {
52
+ type: Object,
53
+ required: true,
54
+ },
55
+ hostingClubColors: {
56
+ type: Object,
57
+ required: true
58
+ },
59
+ showSubmit: {
60
+ type: Boolean,
61
+ default: false,
62
+ },
63
+ screenHeight: Number
64
+ },
65
+ data() {
66
+ return {
67
+ passes: [],
68
+ currentPass: this.bout.CurrentPass || 0
69
+ }
70
+ },
71
+ created() {
72
+ this.passes = new Array(this.maxPasses).fill(0)
73
+ },
74
+ methods: {
75
+ addPass() {
76
+ if (this.currentPass + 1 >= this.passes.length) {
77
+ this.showSubmit = true
78
+ return
79
+ }
80
+ this.currentPass++
81
+ this.passes[this.currentPass] = 1
82
+ },
83
+ minusPass() {
84
+ if (this.currentPass <= 0) return
85
+ this.passes[this.currentPass] = 0
86
+ this.currentPass--
87
+ },
88
+ submit() {
89
+ this.$emit('submit')
90
+ }
91
+ }
92
+ }
93
+ </script>
94
+
@@ -0,0 +1,113 @@
1
+ import ScoreBox from './ScoreBox.vue';
2
+ import getPoolsWithBouts from "../../../../../mocks/getPoolsWithBouts.js";
3
+
4
+ export default {
5
+ title: 'Molecules/Boxes/BoutBoxes/ScoreBox',
6
+ component: ScoreBox,
7
+ tags: ['autodocs'],
8
+ args: {
9
+ fencer1: true,
10
+ bout: getPoolsWithBouts[0],
11
+ screenHeight: 800,
12
+ hostingClubColors: {
13
+ Color1: 'red',
14
+ Color2: 'blue'
15
+ },
16
+ maxScore: 7
17
+ },
18
+ argTypes: {
19
+ fencer1: {
20
+ control: 'boolean'
21
+ },
22
+ bout: {
23
+ control: 'object'
24
+ },
25
+ screenHeight: {
26
+ control: 'number'
27
+ },
28
+ hostingClubColors: {
29
+ control: 'object'
30
+ },
31
+ maxScore: {
32
+ control: 'number'
33
+ }
34
+ }
35
+ };
36
+
37
+ export const Default = {
38
+ args: {
39
+ fencer1: true,
40
+ bout: getPoolsWithBouts[0],
41
+ screenHeight: 800,
42
+ hostingClubColors: {
43
+ Color1: 'red',
44
+ Color2: 'blue'
45
+ },
46
+ maxScore: 7
47
+ }
48
+ };
49
+
50
+ export const Fencer2 = {
51
+ args: {
52
+ fencer1: false,
53
+ match: getPoolsWithBouts[0],
54
+ screenHeight: 800,
55
+ hostingClubColors: {
56
+ Color1: 'red',
57
+ Color2: 'blue'
58
+ },
59
+ maxScore: 7
60
+ }
61
+ };
62
+
63
+ export const Fencer1green = {
64
+ args: {
65
+ fencer1: true,
66
+ match: getPoolsWithBouts[1],
67
+ screenHeight: 800,
68
+ hostingClubColors: {
69
+ Color1: 'green',
70
+ Color2: 'purple'
71
+ },
72
+ maxScore: 7
73
+ }
74
+ };
75
+
76
+ export const Fencer2purple = {
77
+ args: {
78
+ fencer1: false,
79
+ match: getPoolsWithBouts[1],
80
+ screenHeight: 800,
81
+ hostingClubColors: {
82
+ Color1: 'green',
83
+ Color2: 'purple'
84
+ },
85
+ maxScore: 7
86
+ }
87
+ };
88
+
89
+ export const CufcRose = {
90
+ args: {
91
+ fencer1: true,
92
+ match: getPoolsWithBouts[2],
93
+ screenHeight: 800,
94
+ hostingClubColors: {
95
+ Color1: 'rose',
96
+ Color2: 'navy'
97
+ },
98
+ maxScore: 7
99
+ }
100
+ };
101
+
102
+ export const CufcNavy = {
103
+ args: {
104
+ fencer1: false,
105
+ match: getPoolsWithBouts[3],
106
+ screenHeight: 800,
107
+ hostingClubColors: {
108
+ Color1: 'rose',
109
+ Color2: 'navy'
110
+ },
111
+ maxScore: 7
112
+ }
113
+ };
@@ -0,0 +1,110 @@
1
+ <template>
2
+ <section class="w-full">
3
+ <div
4
+ class="w-11/12 flex flex-col bg-neutral mx-auto rounded-xl shadow-lg drop-shadow border-2"
5
+ :class="[
6
+ fencer1
7
+ ? `border-${hostingClubColors.Color1.toLowerCase()}`
8
+ : `border-${hostingClubColors.Color2.toLowerCase()}`,
9
+ screenHeight > 740 ? 'mt-4' : 'mt-1'
10
+ ]"
11
+ >
12
+ <div class="w-full rounded-t-xl flex flex-row justify-between pt-2">
13
+ <div class="w-full text-center">
14
+ <BaseText :text="fencer1 ? bout.Person1.DisplayName : bout.Person2.DisplayName" size="xl" weight="bold" color="primaryHighlight" />
15
+ </div>
16
+ <div class="text-quaternary text-sm pr-3 pt-0.5" @click="$emit('open-report')">
17
+ <i class="fa-solid fa-chevron-right"></i>
18
+ </div>
19
+ </div>
20
+ <div class="flex flex-row w-full justify-between">
21
+ <div class="w-full text-center">
22
+ <!-- Notes should go here in the future -->
23
+ </div>
24
+ </div>
25
+ <div class="w-full flex flex-row justify-around text-center px-4 pt-2">
26
+ <div class="pt-1 w-1/4" @click="minus">
27
+ <BaseIcon icon-name="fa-square-minus" size="5xl" :color="computedColor" hover="quaternary" :disabled="currentScore <= 0" />
28
+ </div>
29
+ <div class="flex flex-row w-1/2 justify-center">
30
+ <div class="text-5xl text-bluegray font-bold">
31
+ <BaseText :text="currentScore" size="5xl" weight="bold" color="primary" />
32
+ </div>
33
+ </div>
34
+ <div class="pt-1 w-1/4" @click="plus">
35
+ <BaseIcon icon-name="fa-square-plus" size="5xl" :color="computedColor" hover="quaternary" :disabled="currentScore >= maxScore" />
36
+ </div>
37
+ </div>
38
+ <div class="w-full flex flex-col justify-around text-center px-4 pb-6">
39
+ <div v-if="screenHeight > 740" class="mt-2">
40
+ <BaseText :text="fencer1 ? bout.Person1.Club.Name : bout.Person2.Club.Name" size="md" color="quinary" />
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </section>
45
+ </template>
46
+
47
+ <script>
48
+ import BaseText from "../../../../Atoms/Text/BaseText.vue";
49
+ import BaseIcon from "../../../../Atoms/Icon/BaseIcon.vue";
50
+
51
+ export default {
52
+ name: 'ScoreBox',
53
+ components: {BaseIcon, BaseText},
54
+ props: {
55
+ fencer1: {
56
+ type: Boolean,
57
+ default: false,
58
+ required: true
59
+ },
60
+ bout: {
61
+ type: Object,
62
+ required: true
63
+ },
64
+ hostingClubColors: {
65
+ type: Object,
66
+ required: true
67
+ },
68
+ screenHeight: {
69
+ type: Number,
70
+ default: 800
71
+ },
72
+ score: {
73
+ type: Number,
74
+ default: 0
75
+ },
76
+ maxScore: {
77
+ type: Number,
78
+ required: true
79
+ }
80
+ },
81
+ data() {
82
+ return {
83
+ currentScore: 0
84
+ }
85
+ },
86
+ computed: {
87
+ computedColor() {
88
+ return this.fencer1 ? this.hostingClubColors.Color1.toLowerCase() : this.hostingClubColors.Color2.toLowerCase();
89
+ }
90
+ },
91
+ methods: {
92
+ minus() {
93
+ if (this.currentScore > 0) {
94
+ this.currentScore--;
95
+ this.emitSCore(this.currentScore)
96
+ }
97
+ },
98
+ plus() {
99
+ if (this.currentScore < this.maxScore) {
100
+ this.currentScore++;
101
+ this.emitSCore(this.currentScore)
102
+ }
103
+ },
104
+ emitSCore(score) {
105
+ this.$emit('update:Score', score)
106
+ }
107
+
108
+ }
109
+ }
110
+ </script>
@@ -0,0 +1,39 @@
1
+ import TimerBox from './TimerBox.vue';
2
+
3
+ export default {
4
+ title: 'Molecules/Boxes/BoutBoxes/TimerBox',
5
+ component: TimerBox,
6
+ tags: ['autodocs'],
7
+ args: {
8
+ initialTime: 120 // Default to 5 minutes
9
+ },
10
+ argTypes: {
11
+ initialTime: {
12
+ control: 'number'
13
+ }
14
+ }
15
+ };
16
+
17
+ export const Default = {
18
+ args: {
19
+ initialTime: 120,
20
+ ringName: 'Ring 1 - Pool 1',
21
+ showSubmit: true
22
+ }
23
+ };
24
+
25
+ export const OneMinute = {
26
+ args: {
27
+ initialTime: 60,
28
+ ringName: 'Ring 1 - Pool 2',
29
+ showSubmit: false,
30
+ }
31
+ };
32
+
33
+ export const TenSeconds = {
34
+ args: {
35
+ initialTime: 10,
36
+ ringName: 'Ring 2 - Pool 2',
37
+ showSubmit: true
38
+ }
39
+ };
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <section class="mt-4 py-4 md:mt-4 md:py-6 w-11/12 flex flex-col bg-white mx-auto rounded-2xl shadow-md border">
3
+ <div class="w-full flex flex-row justify-around text-center px-4">
4
+
5
+ <!-- Adjust Time by 10 seconds -->
6
+ <div class="pt-1 flex flex-col">
7
+ <BaseIcon icon-name="fa-square-chevron-up" size="5xl" color="quaternary" @click="alterTime(10)" class="hover:text-quaternaryHighlight" />
8
+ <div class="bg-gridBoxHeader rounded-lg h-12 flex items-center justify-center"><BaseText text="10" size="xl" color="quaternary" /></div>
9
+ <BaseIcon icon-name="fa-square-chevron-down" size="5xl" color="quaternary" @click="alterTime(-10)" class="hover:text-quaternaryHighlight" />
10
+ </div>
11
+
12
+ <!-- Timer Display and Controls -->
13
+ <section class="flex flex-col w-44 justify-between">
14
+ <div class="flex flex-col h-6">
15
+ <BaseText v-if="!showSubmit" :text="ringName" size="xl" color="quaternary" weight="bold" />
16
+ <BaseButton v-if="showSubmit" label="Submit" type="playPause" :selected="true" size="xl" @click="submit" />
17
+ </div>
18
+ <BaseText :text="formattedTime" size="5xl" weight="bold" :color="timerState === 'running' ? 'secondary' : 'quaternary'" />
19
+ <BaseButton :label="timerState === 'running' ? 'Pause' : 'Start'" type="playPause" :selected="timerState === 'running'" size="xl" @click="startOrPause" />
20
+ </section>
21
+
22
+ <!-- Adjust Time by 1 second -->
23
+ <div class="pt-1 flex flex-col">
24
+ <BaseIcon icon-name="fa-square-chevron-up" size="5xl" color="quaternary" @click="alterTime(1)" class="hover:text-quaternaryHighlight" />
25
+ <div class="bg-gridBoxHeader rounded-lg h-12 flex items-center justify-center"><BaseText text="1" size="xl" color="quaternary" /></div>
26
+ <BaseIcon icon-name="fa-square-chevron-down" size="5xl" color="quaternary" @click="alterTime(-1)" class="hover:text-quaternaryHighlight" />
27
+ </div>
28
+ </div>
29
+ </section>
30
+
31
+ </template>
32
+
33
+ <script>
34
+ import BaseText from "../../../../Atoms/Text/BaseText.vue";
35
+ import BaseIcon from "../../../../Atoms/Icon/BaseIcon.vue";
36
+ import BaseButton from "../../../Buttons/BaseButton/BaseButton.vue";
37
+
38
+ export default {
39
+ name: 'TimerBox',
40
+ components: {BaseButton, BaseIcon, BaseText},
41
+ props: {
42
+ initialTime: {
43
+ type: Number,
44
+ default: 120
45
+ },
46
+ ringName: {
47
+ type: String,
48
+ required: true
49
+ },
50
+ showSubmit: {
51
+ type: Boolean,
52
+ default: false
53
+ }
54
+ },
55
+ data() {
56
+ return {
57
+ time: parseInt(this.initialTime),
58
+ running: false,
59
+ timerInterval: null
60
+ };
61
+ },
62
+ computed: {
63
+ formattedTime() {
64
+ const minutes = Math.floor(this.time / 60);
65
+ const seconds = this.time % 60;
66
+ return `${minutes}:${seconds < 10 ? '0' : ''}${seconds}`;
67
+ },
68
+ timerState() {
69
+ return this.running ? 'running' : 'paused';
70
+ }
71
+ },
72
+ methods: {
73
+ startOrPause() {
74
+ this.emitTimeStateChange()
75
+
76
+ if (this.running) {
77
+ clearInterval(this.timerInterval);
78
+ } else {
79
+ this.timerInterval = setInterval(() => {
80
+ if (this.time > 0) {
81
+ this.time--;
82
+ this.emitTimeChange(this.time)
83
+ } else {
84
+ this.stopTimer();
85
+ }
86
+ }, 1000);
87
+ }
88
+ this.running = !this.running;
89
+ },
90
+ async alterTime(seconds) {
91
+ this.stopTimer();
92
+ this.time = Math.max(0, this.time + seconds);
93
+ this.emitTimeStateChange()
94
+ },
95
+ stopTimer() {
96
+ clearInterval(this.timerInterval);
97
+ this.running = false;
98
+ this.emitTimeStateChange();
99
+ },
100
+ emitTimeStateChange() {
101
+ this.$emit('update:timeChange', {time: this.time, running: !this.running});
102
+ },
103
+ emitTimeChange() {
104
+ this.$emit('update:time',this.time);
105
+ }
106
+ },
107
+ beforeDestroy() {
108
+ clearInterval(this.timerInterval);
109
+ }
110
+ };
111
+ </script>
112
+
@@ -30,8 +30,6 @@ describe('Breadcrumb', () => {
30
30
 
31
31
  const linkElements = wrapper.findAll('[to]');
32
32
 
33
- // console.log(wrapper.html());
34
-
35
33
  expect(linkElements.length).toBe(items.filter(item => item.link).length);
36
34
  });
37
35
 
@@ -40,7 +40,7 @@ export default {
40
40
  type: {
41
41
  type: String,
42
42
  default: 'primary',
43
- validator: value => ['primary', 'secondary', 'tertiary', 'bright', 'admin', 'adminSecondary', 'iconOnly', 'editor', 'square', 'tabBar', 'graySecondary'].includes(value)
43
+ validator: value => ['primary', 'secondary', 'tertiary', 'bright', 'admin', 'adminSecondary', 'iconOnly', 'editor', 'square', 'tabBar', 'graySecondary', 'liteGraySecondary', 'whiteSecondary', 'grayAndBlue', 'playPause'].includes(value)
44
44
  },
45
45
  selected: {
46
46
  type: Boolean,
@@ -49,12 +49,6 @@ export default {
49
49
  },
50
50
  emits: ['click'],
51
51
  setup(props, { emit }) {
52
- watch(() => props.selected, (newVal) => {
53
- console.log('selected prop changed to:', newVal);
54
- console.log('props.selected:', props.selected);
55
- console.log('props.type:', props.type); // Access type using props
56
- });
57
-
58
52
  const computedClasses = computed(() => {
59
53
  const baseClasses = 'inline-flex';
60
54
  const sizeClass = {
@@ -80,8 +74,10 @@ export default {
80
74
  square: `p-8 my-3 items-center gap-2.5 rounded-md text-center shadow border border-dropdownSelect justify-center hover:bg-tertiary ${props.selected ? 'bg-dropdownSelect' : 'bg-neutral'}`,
81
75
  tabBar: `p-2 items-center justify-center text-center hover:border-b hover:border-b-bright text-primaryHighlight ${props.selected ? 'border-b border-b-bright' : 'border-b border-b-neutral text-bright'}`,
82
76
  graySecondary: `px-2.5 items-center gap-2.5 text-center my-1 p-3 w-full rounded-lg flex flex-row justify-center hover:bg-quinary ${props.selected ? 'bg-secondary' : 'bg-graySecondary'}`,
77
+ grayAndBlue: `px-2.5 items-center gap-2.5 text-center my-1 p-3 w-full rounded-lg flex flex-row justify-center border ${props.selected ? 'bg-secondary hover:bg-quinary' : 'bg-gridBoxHeader'}`,
83
78
  whiteSecondary: `px-2.5 items-center gap-2.5 text-center my-1 p-3 w-full rounded-lg flex flex-row justify-center border border-poolBox hover:border-dropdownSelect ${props.selected ? 'bg-neutral shadow' : 'bg-poolBox'}`,
84
79
  liteGraySecondary: `px-2.5 items-center gap-2.5 text-center my-1 p-3 w-full rounded-lg flex flex-row justify-center border border-poolBox hover:border-dropdownSelect ${props.selected ? 'bg-neutral shadow' : 'bg-poolBox'}`,
80
+ playPause: `p-1 w-full items-center gap-2.5 text-center rounded-md shadow justify-center ${props.selected ? 'bg-secondary hover:bg-quaternaryHighlight' : 'bg-quaternary hover:bg-quaternaryHighlight'}`,
85
81
  }[props.type];
86
82
 
87
83
  return `${baseClasses} ${typeClass} ${sizeClass}`;
@@ -102,7 +98,9 @@ export default {
102
98
  tabBar: 'primaryHighlight',
103
99
  graySecondary: 'neutral',
104
100
  whiteSecondary: 'primary',
105
- liteGraySecondary: 'primary'
101
+ liteGraySecondary: 'primary',
102
+ playPause: 'neutral',
103
+ grayAndBlue: 'neutral'
106
104
  };
107
105
  return colorMap[props.type];
108
106
  }),
@@ -65,11 +65,6 @@ export default {
65
65
  }
66
66
  },
67
67
  emits: ['update:show', 'submit-modal'],
68
- watch: {
69
- show(newValue) {
70
- console.log(`BaseModal show prop changed to: ${newValue}`);
71
- }
72
- },
73
68
  methods: {
74
69
  close() {
75
70
  this.$emit('update:show', false);