@dcrackel/hematournamentui 1.0.346 → 1.0.348

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.346",
4
+ "version": "1.0.348",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -7,7 +7,7 @@
7
7
  placeholder="Enter Location Name"
8
8
  @input="updateInput"
9
9
  />
10
- <div v-if="showDropdown" class="absolute z-10 w-full bg-white border border-gray-300 rounded-md mt-1">
10
+ <div v-if="showDropdown && showAddNew" class="absolute z-10 w-full bg-white border border-gray-300 rounded-md mt-1">
11
11
  <ul>
12
12
  <li v-for="(item, index) in filteredLocations" :key="index" class="p-2 hover:bg-gray-100 cursor-pointer"
13
13
  @click="selectItem(item)">
@@ -80,14 +80,13 @@ export default {
80
80
  filteredLocations: this.locations,
81
81
  inputValue: this.placeholder,
82
82
  showDropdown: false,
83
- showAddNew: false,
83
+ showAddNew: true,
84
84
  debouncedTimeout: null
85
85
  };
86
86
  },
87
87
  watch: {
88
88
  inputValue(newValue) {
89
89
  this.showDropdown = newValue.length > 0;
90
- this.showAddNew = newValue.length > 0 && this.filteredLocations.length === 0;
91
90
  this.debounceSearch();
92
91
  }
93
92
  },
@@ -119,14 +118,20 @@ export default {
119
118
  },
120
119
  handleLocationName(newName) {
121
120
  this.formData.locationName = newName
121
+ this.locationName = newName
122
122
  },
123
123
  handleNewAddress(newAddress) {
124
+ this.formData.locationName = this.locationName
124
125
  this.formData.address = newAddress.address
125
126
  this.formData.coordinates = newAddress.coordinates
127
+ this.inputValue = this.locationName
128
+ this.$emit('submit:addNewAddress', this.formData);
126
129
  },
127
130
  handleSubmit() {
128
131
  this.$emit('submit:location', this.formData);
129
132
  this.showNewLocation = false;
133
+ this.showDropdown = false;
134
+ this.showAddNew = false;
130
135
  }
131
136
  }
132
137
  };
@@ -25,8 +25,8 @@
25
25
  <BaseText :color="'primaryHighlight'" :invalid="validation.address" :size="'sm'" :text="'Location'"
26
26
  :weight="'normal'" class="mb-1" data-testid="text-address"/>
27
27
  <FindLocation :addBorder="true" :locations="locations" addNewText="Add New"
28
- @update:addNewAddress="handleAddNewAddress"
29
- @update:location="handleAddressUpdate"
28
+ @submit:addNewAddress="handleAddNewAddress"
29
+ @submit:location="handleAddressUpdate"
30
30
  />
31
31
  </div>
32
32
  <div class="flex flex-row mb-4">
@@ -189,6 +189,7 @@ export default {
189
189
  handleAddNewAddress(newAddress) {
190
190
  this.tournament.AddressId = 0;
191
191
  this.tournament.Address = newAddress;
192
+ this.$emit('update:startDate', newAddress);
192
193
  },
193
194
  handleAddressUpdate(updatedAddress) {
194
195
  this.tournament.addressId = updatedAddress.AddressId