@eturnity/eturnity_reusable_components 7.4.4-EPDM-7260.6 → 7.4.4-EPDM-7260.7

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,6 +1,6 @@
1
1
  {
2
2
  "name": "@eturnity/eturnity_reusable_components",
3
- "version": "7.4.4-EPDM-7260.6",
3
+ "version": "7.4.4-EPDM-7260.7",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -375,16 +375,15 @@ export default {
375
375
  },
376
376
  checkOverlap(value, tariffs) {
377
377
  // Check if the tariffs overlap
378
- const { itemId } = value
379
378
  const min = parseFloat(value.min)
380
379
  const max = parseFloat(value.max)
381
380
 
382
381
  return tariffs.some((tariff) => {
383
- if (tariff.id === itemId) return false
382
+ if (tariff.id === value.itemId) return false
384
383
 
385
384
  return (
386
- (min === tariff.min ) ||
387
- (max === tariff.max) ||
385
+ min === tariff.min ||
386
+ max === tariff.max ||
388
387
  (min > tariff.min && min < tariff.max) ||
389
388
  (max > tariff.min && max < tariff.max) ||
390
389
  (min < tariff.min && max > tariff.max)
@@ -426,7 +425,10 @@ export default {
426
425
  label: this.activeLabel
427
426
  })
428
427
 
429
- this.hasOverlap = this.checkOverlap(item, this.activeLabel.selectedTariffs)
428
+ this.hasOverlap = this.checkOverlap(
429
+ item,
430
+ this.activeLabel.selectedTariffs
431
+ )
430
432
  this.showBarOptions = false
431
433
  },
432
434
  setBarOptions(bar) {
@@ -480,6 +482,18 @@ export default {
480
482
  // Remove the global click event listener to prevent memory leaks
481
483
  document.removeEventListener('click', this.handleOutsideClick)
482
484
  document.removeEventListener('keydown', this.onKeyDownDelete)
485
+ },
486
+ watch: {
487
+ tariffItems(item, oldData) {
488
+ if (item.length !== oldData.length) {
489
+ this.hasOverlap = this.checkOverlap(
490
+ {
491
+ itemId: 0
492
+ },
493
+ item
494
+ )
495
+ }
496
+ }
483
497
  }
484
498
  }
485
499
  </script>
@@ -41,6 +41,7 @@ export default {
41
41
  break
42
42
  }
43
43
  })
44
+ this.$emit('is-valid', !this.error)
44
45
  },
45
46
 
46
47
  resetError() {