@eturnity/eturnity_reusable_components 7.4.4-EPDM-7260.5 → 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.5",
3
+ "version": "7.4.4-EPDM-7260.7",
4
4
  "private": false,
5
5
  "scripts": {
6
6
  "dev": "vue-cli-service serve",
@@ -3,14 +3,14 @@
3
3
  :style="style"
4
4
  :class="className"
5
5
  @mousedown="elementMouseDown"
6
- @touchstart="elementTouchDown"
6
+ @touchend="elementTouchDown"
7
7
  >
8
8
  <div
9
9
  v-for="handle in actualHandles"
10
10
  :key="handle"
11
11
  :style="{ display: enabled ? 'block' : 'none' }"
12
12
  @mousedown.stop.prevent="handleDown(handle, $event)"
13
- @touchstart.stop.prevent="handleTouchDown(handle, $event)"
13
+ @touchend.stop.prevent="handleTouchDown(handle, $event)"
14
14
  >
15
15
  <slot :name="handle"></slot>
16
16
  </div>
@@ -443,8 +443,6 @@ export default {
443
443
  handleUp() {
444
444
  this.handle = null
445
445
 
446
- this.resetBoundsAndMouseState()
447
-
448
446
  this.dragEnable = false
449
447
  this.resizeEnable = false
450
448
 
@@ -470,7 +468,7 @@ export default {
470
468
  const val = value / this.pxPerStep
471
469
 
472
470
  const int = 1.0 / this.step
473
- return (Math.floor(val * int) / int).toFixed(2)
471
+ return (Math.round(val * int) / int).toFixed(2)
474
472
  }
475
473
  },
476
474
  computed: {
@@ -242,9 +242,9 @@ const VerticalLabel = styled.div`
242
242
  `
243
243
 
244
244
  const HandleIcon = styled(Icon)`
245
- width: auto;
245
+ width: 12px;
246
246
  min-width: 0;
247
- margin: -12px;
247
+ margin: -6px;
248
248
  `
249
249
 
250
250
  const BarOptionAttrs = { top: Number, left: Number }
@@ -375,12 +375,15 @@ export default {
375
375
  },
376
376
  checkOverlap(value, tariffs) {
377
377
  // Check if the tariffs overlap
378
- const { itemId, min, max } = value
378
+ const min = parseFloat(value.min)
379
+ const max = parseFloat(value.max)
379
380
 
380
381
  return tariffs.some((tariff) => {
381
- if (tariff.id === itemId) return false
382
+ if (tariff.id === value.itemId) return false
382
383
 
383
384
  return (
385
+ min === tariff.min ||
386
+ max === tariff.max ||
384
387
  (min > tariff.min && min < tariff.max) ||
385
388
  (max > tariff.min && max < tariff.max) ||
386
389
  (min < tariff.min && max > tariff.max)
@@ -421,6 +424,11 @@ export default {
421
424
  item,
422
425
  label: this.activeLabel
423
426
  })
427
+
428
+ this.hasOverlap = this.checkOverlap(
429
+ item,
430
+ this.activeLabel.selectedTariffs
431
+ )
424
432
  this.showBarOptions = false
425
433
  },
426
434
  setBarOptions(bar) {
@@ -474,6 +482,18 @@ export default {
474
482
  // Remove the global click event listener to prevent memory leaks
475
483
  document.removeEventListener('click', this.handleOutsideClick)
476
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
+ }
477
497
  }
478
498
  }
479
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() {