@dcrackel/hematournamentui 1.0.401 → 1.0.403

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.401",
4
+ "version": "1.0.403",
5
5
  "type": "module",
6
6
  "main": "dist/HemaTournamentUI-lib.umd.js",
7
7
  "module": "dist/HemaTournamentUI-lib.es.js",
@@ -77,14 +77,15 @@ export default {
77
77
  DEPromotionTypes() {
78
78
  const promoteBy = this.eventConfig?.DEPromoteBy;
79
79
 
80
- if (Array.isArray(promoteBy)) {
81
- return promoteBy.map(promotionType => ({
82
- text: promotionType,
83
- link: promotionType,
84
- }));
85
- }
80
+ console.log(promoteBy)
81
+ const promoteByArray = Array.isArray(promoteBy)
82
+ ? promoteBy
83
+ : (promoteBy?.split(',') || []);
86
84
 
87
- return [];
85
+ return promoteByArray.map(promotionType => ({
86
+ text: promotionType.trim(),
87
+ link: promotionType.trim(),
88
+ }));
88
89
  },
89
90
  DEPromotionDescription() {
90
91
  if (this.selectedItem.text === 'Top Percent') {
@@ -120,18 +121,21 @@ export default {
120
121
  this.selectedItem = item;
121
122
 
122
123
  if (item.text === 'Top Percent') {
124
+ this.eventConfig.DEPromotionTypes = 'Percent'
123
125
  this.eventConfig.DEPromotionAmount = '100%'
124
126
  }
125
127
 
126
128
  if (item.text === 'Top Count') {
129
+ this.eventConfig.DEPromotionTypes = 'Count'
127
130
  this.eventConfig.DEPromotionAmount = '16'
128
131
  }
129
132
 
130
133
  if (item.text === 'Top Count of Each Pool') {
134
+ this.eventConfig.DEPromotionTypes = 'Top'
131
135
  this.eventConfig.DEPromotionAmount = '2'
132
136
  }
133
137
 
134
- this.$emit('update', item);
138
+ this.$emit('update:DEPromotionType', item);
135
139
  }
136
140
  }
137
141
  };
@@ -29,6 +29,7 @@
29
29
  :steps="steps"
30
30
  :currentStep="currentStep -1"
31
31
  @update="handleValueChange"
32
+ @update:DEPromotionType="handleDEPromotionType"
32
33
  @update:back="handleBack"
33
34
  @update:next="handleUpdate"
34
35
  />
@@ -207,8 +208,21 @@ export default {
207
208
  }
208
209
  },
209
210
  handleValueChange(change) {
211
+ console.log(change)
210
212
  const [key, value] = Object.entries(change)[0];
211
- this.eventConfig[key] = value;
213
+ this.localEvent[key] = value;
214
+ },
215
+ handleDEPromotionType(change) {
216
+ console.log(change)
217
+ if (change.text === 'Top Percent') {
218
+ this.eventConfig.DEPromoteBy = 'Percent';
219
+ }
220
+ if (change.text === 'Top Count') {
221
+ this.eventConfig.DEPromoteBy = 'Count';
222
+ }
223
+ if (change.text === 'Top Count of Each Pool') {
224
+ this.eventConfig.DEPromoteBy = 'Top';
225
+ }
212
226
  },
213
227
  handleBasicDetailsUpdate(payload) {
214
228
  this.localEvent = {...this.localEvent, ...payload};
@@ -248,6 +262,7 @@ export default {
248
262
  },
249
263
  handleSubmit() {
250
264
  this.localEvent.rules = this.convertEventConfigToRules(this.eventConfig)
265
+ console.log(this.localEvent);
251
266
  this.$emit('update:submit', this.localEvent);
252
267
  },
253
268
  handleCancel() {