@dcrackel/hematournamentui 1.0.144 → 1.0.145

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.144",
4
+ "version": "1.0.145",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -19,7 +19,7 @@ export default {
19
19
  components: {BaseIcon},
20
20
  props: {
21
21
  placeholder: {
22
- type: String,
22
+ type: [String, Number],
23
23
  default: ''
24
24
  },
25
25
  value: {
@@ -6,9 +6,9 @@
6
6
  <div class="w-full flex flex-col justify-center items-center mb-6" style="text-align: center">
7
7
  <div v-if="events.length === 0">
8
8
  <img alt="Small desert scene with wind blowing." class="w-96" :src="emptyDesertIcon" />
9
- <BaseText :color="'primaryHighlight'" :size="'lf'" :text="'0 events added yet.'"
9
+ <BaseText :color="'primaryHighlight'" :size="'lg'" :text="'0 events added yet.'"
10
10
  :weight="'normal'" data-testid="text-num-events"/>
11
- <BaseText :color="'primaryHighlight'" :size="'lf'" :text="'Click below to add first event.'"
11
+ <BaseText :color="'primaryHighlight'" :size="'md'" :text="'Click below to add first event.'"
12
12
  :weight="'normal'" data-testid="text-num-events"/>
13
13
  </div>
14
14
 
@@ -40,6 +40,7 @@ const modifiedBouts = getPoolsWithBoutsByPoolId.pools[0].Bouts.map(bout => ({
40
40
  ...bout,
41
41
  Status: 'Completed'
42
42
  }));
43
+
43
44
  export const allBoutsComplete = {
44
45
  args: {
45
46
  bouts: modifiedBouts,
@@ -1,27 +1,29 @@
1
1
  import EditTournamentBasicInfo from './EditTournamentBasicInfo.vue';
2
+ import mockLocation from '../../../../../mocks/locationMock.js';
3
+ import mockTournaments from '../../../../../mocks/tournamentMock.js';
2
4
 
3
5
  export default {
4
6
  title: 'Templates/TournamentManagement/EditTournament/EditBasicInfo',
5
7
  component: EditTournamentBasicInfo,
6
8
  tags: ['autodocs'],
7
- args: {},
8
- argTypes: {}
9
+ args: {
10
+ tournament: mockTournaments[0],
11
+ locations: mockLocation
12
+ },
13
+ argTypes: {
14
+ tournament: {
15
+ control: Object
16
+ },
17
+ locations: {
18
+ control: Object
19
+ }
20
+ }
9
21
  };
10
22
 
11
23
 
12
24
  export const Default = {
13
25
  args: {
14
- tournament: {
15
- tournamentId: 1234,
16
- name: 'Ultimate',
17
- imageLink: '',
18
- address: '123 Winchester St',
19
- coordinates: '',
20
- startDate: '',
21
- totalDays: 1,
22
- description: '',
23
- visibility: '',
24
- externalLinks: []
25
- },
26
+ tournament: mockTournaments[0],
27
+ locations: mockLocation
26
28
  }
27
29
  };
@@ -14,8 +14,8 @@
14
14
  </div>
15
15
  <div class="border-b border-dropdownSelect my-10"></div>
16
16
  <div class="mb-3">
17
- <TitledInput :inputValue="localTournament.name" :invalid="validation.name" :placeholder="localTournament.name"
18
- :title="'Tournament Name'" @update:value="value => localTournament.name = value"/>
17
+ <TitledInput :inputValue="localTournament.Name" :invalid="validation.name" :placeholder="localTournament.Name"
18
+ :title="'Tournament Name'" @update:value="value => localTournament.Name = value"/>
19
19
  </div>
20
20
  <div class="mb-3">
21
21
  <BaseText :color="'primaryHighlight'" :invalid="validation.address" :size="'sm'" :text="'Address'"
@@ -34,12 +34,12 @@
34
34
  <BaseText :color="'primaryHighlight'" :invalid="validation.startDate" :size="'sm'" :text="'Start Date'"
35
35
  :weight="'normal'"
36
36
  class="mb-1 ml-1" data-testid="text-start-date"/>
37
- <DatePicker :invalid="validation.startDate" :setDate="tournament.startDate"
37
+ <DatePicker :invalid="validation.startDate" :setDate="tournament.StartDate"
38
38
  @update:selectedDate="handleDateUpdate"/>
39
39
  </div>
40
40
  <div class="flex flex-col w-1/2 ml-1">
41
41
  <BaseText :color="'primaryHighlight'" class="mb-1 ml-1" text="Total Days"/>
42
- <BaseInput :addBorder="true" :placeholder="localTournament.totalDays"/>
42
+ <BaseInput :addBorder="true" :placeholder="totalDays"/>
43
43
  </div>
44
44
  </div>
45
45
  <div class="flex flex-row justify-center my-10">
@@ -78,7 +78,7 @@ export default {
78
78
  },
79
79
  props: {
80
80
  tournament: {
81
- type: Array,
81
+ type: Object,
82
82
  required: true
83
83
  },
84
84
  locations: {
@@ -88,7 +88,7 @@ export default {
88
88
  },
89
89
  data() {
90
90
  return {
91
- localTournament: JSON.parse(JSON.stringify(this.tournament)),
91
+ localTournament: this.tournament,
92
92
  validation: {
93
93
  name: false,
94
94
  imageLink: false,
@@ -107,6 +107,18 @@ export default {
107
107
  ]
108
108
  }
109
109
  },
110
+ created() {
111
+ console.log(this.localTournament)
112
+ },
113
+ computed: {
114
+ totalDays() {
115
+ const startDate = new Date(this.localTournament.StartDate);
116
+ const endDate = new Date(this.localTournament.EndDate);
117
+ const timeDifference = endDate - startDate;
118
+ const dayDifference = timeDifference / (1000 * 60 * 60 * 24);
119
+ return dayDifference >= 0 ? Math.ceil(dayDifference) + 1 : 0;
120
+ }
121
+ },
110
122
  methods: {
111
123
  handleTabMenuClick(value) {
112
124
  this.$emit('tab:menu-click', value);