@dcrackel/hematournamentui 1.0.411 → 1.0.415

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.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@dcrackel/hematournamentui",
3
3
  "private": false,
4
- "version": "1.0.411",
4
+ "version": "1.0.415",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -10,9 +10,9 @@ const eventMockData = [
10
10
  "PoolSize": 6,
11
11
  "Flights": 1,
12
12
  "WeaponId": 1,
13
- "Status": "planning",
14
- "Present": 0,
15
- "Absent": 8,
13
+ "Status": "live",
14
+ "Present": 8,
15
+ "Absent": 0,
16
16
  "Removed": 0,
17
17
  "EventRules": [
18
18
  {
@@ -24,7 +24,7 @@
24
24
  </div>
25
25
  <div class="w-full flex flex-row justify-around text-center px-4 pt-2">
26
26
  <div class="pt-1 w-1/4" @click="minus">
27
- <BaseIcon icon-name="fa-square-minus" size="5xl" :color="computedColor" hover="quaternary" :disabled="baseScore <= 0" />
27
+ <BaseIcon :icon-name="isCountingUp ? 'fa-square-minus' : 'fa-square-plus'" size="5xl" :color="computedColor" hover="quaternary" :disabled="baseScore <= 0" />
28
28
  </div>
29
29
  <div class="flex flex-row w-1/2 justify-center">
30
30
  <div class="text-5xl text-bluegray font-bold">
@@ -32,7 +32,7 @@
32
32
  </div>
33
33
  </div>
34
34
  <div class="pt-1 w-1/4" @click="plus">
35
- <BaseIcon icon-name="fa-square-plus" size="5xl" :color="computedColor" hover="quaternary" :disabled="baseScore >= maxScore" />
35
+ <BaseIcon :icon-name="isCountingUp ? 'fa-square-plus' : 'fa-square-minus'" size="5xl" :color="computedColor" hover="quaternary" :disabled="baseScore >= maxScore" />
36
36
  </div>
37
37
  </div>
38
38
  <div class="w-full flex flex-col justify-around text-center px-4 pb-6">
@@ -55,37 +55,38 @@ export default {
55
55
  return this.localBout.Pool.RingName || 'Ring';
56
56
  },
57
57
  showPassesBox() {
58
- return this.eventRules.some(rule => rule.Rules.RuleName === "PoolNumOfPasses") || this.eventRules.some(rule => rule.Rules.RuleName === "DENumOfPasses");
58
+ return Array.isArray(this.eventRules) && (
59
+ this.eventRules.some((n2) => n2.Rules.RuleName === "PoolNumOfPasses") ||
60
+ this.eventRules.some((n2) => n2.Rules.RuleName === "DENumOfPasses")
61
+ );
59
62
  },
60
63
  showTimerBox() {
61
- return this.eventRules.some(rule => rule.Rules.RuleName === "PoolTime") || this.eventRules.some(rule => rule.Rules.RuleName === "DETime");
64
+ return Array.isArray(this.eventRules) && (
65
+ this.eventRules.some((n2) => n2.Rules.RuleName === "PoolTime") ||
66
+ this.eventRules.some((n2) => n2.Rules.RuleName === "DETime")
67
+ );
62
68
  },
63
69
  startTime() {
64
70
  if (this.localBout.TimeLeft > 0) return this.localBout.TimeLeft;
65
71
 
66
72
  if (this.localBout.DEBoutId) {
67
- const rule = this.eventRules.find(rule => rule.Rules.RuleName === "DETime");
68
- return rule ? parseInt(rule.RuleValue) : 90;
73
+ const e = Array.isArray(this.eventRules) ? this.eventRules.find((t) => t.Rules.RuleName === "DETime") : null;
74
+ return e ? parseInt(e.RuleValue) : 90;
69
75
  }
70
- const rule = this.eventRules.find(rule => rule.Rules.RuleName === "PoolTime");
71
- return rule ? parseInt(rule.RuleValue) : 90;
76
+
77
+ const n2 = Array.isArray(this.eventRules) ? this.eventRules.find((e) => e.Rules.RuleName === "PoolTime") : null;
78
+ return n2 ? parseInt(n2.RuleValue) : 90;
72
79
  },
73
80
  maxPoints() {
74
81
  if (this.localBout.DEBoutId) {
75
- const rule = this.eventRules.find(rule => rule.Rules.RuleName === "DEMaxPoints");
76
- return rule ? parseInt(rule.RuleValue) : 7;
82
+ const e = Array.isArray(this.eventRules) ? this.eventRules.find((t) => t.Rules.RuleName === "DEMaxPoints") : null;
83
+ return e ? parseInt(e.RuleValue) : 7;
77
84
  }
78
- const rule = this.eventRules.find(rule => rule.Rules.RuleName === "PoolMaxPoints");
79
- return rule ? parseInt(rule.RuleValue) : 7;
85
+
86
+ const n2 = Array.isArray(this.eventRules)
87
+ ? this.eventRules.find((e) => e.Rules.RuleName === "PoolMaxPoints") : null;
88
+ return n2 ? parseInt(n2.RuleValue) : 7;
80
89
  },
81
- maxPasses() {
82
- if (this.localBout.DEBoutId) {
83
- const rule = this.eventRules.find(rule => rule.Rules.RuleName === "DENumOfPasses");
84
- return rule ? parseInt(rule.RuleValue) : 5;
85
- }
86
- const rule = this.eventRules.find(rule => rule.Rules.RuleName === "PoolNumOfPasses");
87
- return rule ? parseInt(rule.RuleValue) : 5;
88
- }
89
90
  },
90
91
  methods: {
91
92
  handleTimeChange(time) {
@@ -117,9 +118,14 @@ export default {
117
118
  this.showSubmit = this.localBout.Score1 === this.maxPoints || this.localBout.Score2 === this.maxPoints || this.localBout.TimeLeft === 0 || this.localBout.CurrentPass === this.maxPasses-1;
118
119
  this.$emit('update:bout', this.localBout);
119
120
  },
120
- setCountingDirection(){
121
- const rule = this.eventRules.find(rule => rule.Rules.RuleName === "PoolScoreDirection");
122
- this.isCountingUp = rule ? rule.RuleValue : true;
121
+ setCountingDirection() {
122
+ if (Array.isArray(this.eventRules)) {
123
+ const rule = this.eventRules.find(rule => rule.Rules.RuleName === "PoolScoreDirection");
124
+ this.isCountingUp = rule ? rule.RuleValue : true;
125
+ }
126
+ if (!Array.isArray(this.eventRules)) {
127
+ this.isCountingUp = true;
128
+ }
123
129
  }
124
130
  }
125
131
  };
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div class="flex items-center p-2 md:px-4 md:py-4 bg-eventBoxBlue border border-dropdownSelect rounded-lg md:shadow-md w-full mb-6 hover:border-bright" @click="onManage">
2
+ <div class="flex items-center p-2 md:px-4 md:py-4 bg-eventBoxBlue md:bg-white border border-dropdownSelect rounded-lg md:shadow-md w-full mb-6 hover:border-bright" @click="onManage">
3
3
  <div class="w-full flex flex-col md:flex-row justify-between">
4
4
  <section class="flex flex-row justify-start w-full">
5
5
  <div class="flex flex-col pl-4 w-full">