aeb-ui-kit 3.0.0-preview.565 → 3.0.0-preview.579

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.
@@ -2603,15 +2603,9 @@ class DropdownComponent {
2603
2603
  }
2604
2604
  }
2605
2605
  mouseHandler(type, index) {
2606
- const options = this.option.toArray();
2607
- const option = options.filter((o) => {
2608
- const attributes = o.nativeElement.attributes;
2609
- return attributes.aebDropdownOptionIndex.value === index.toString();
2610
- })[0]?.nativeElement;
2611
2606
  const inputField = this.inputField.nativeElement;
2612
2607
  if (type === 'move') {
2613
2608
  this.activeOption = index;
2614
- option.focus();
2615
2609
  }
2616
2610
  else if (type === 'leave') {
2617
2611
  this.activeOption = -1;
@@ -4425,7 +4419,9 @@ class SliderComponent {
4425
4419
  }
4426
4420
  };
4427
4421
  this.handleStartSwiping = (event) => {
4428
- event.preventDefault();
4422
+ if (event.cancelable) {
4423
+ event.preventDefault();
4424
+ }
4429
4425
  if (event.touches && event.touches.length) {
4430
4426
  const finger = event.touches[0];
4431
4427
  this.handleChangeValue(finger.clientX);
@@ -4438,7 +4434,9 @@ class SliderComponent {
4438
4434
  document.removeEventListener('mouseup', this.handleEndDragging);
4439
4435
  };
4440
4436
  this.handleEndSwiping = (event) => {
4441
- event.preventDefault();
4437
+ if (event.cancelable) {
4438
+ event.preventDefault();
4439
+ }
4442
4440
  this.isPressed = false;
4443
4441
  document.removeEventListener('touchmove', this.handleStartSwiping);
4444
4442
  document.removeEventListener('touchend', this.handleEndSwiping);
@@ -4474,7 +4472,9 @@ class SliderComponent {
4474
4472
  registerOnTouched() { }
4475
4473
  ngAfterViewInit() {
4476
4474
  this.renderer.listen(this.slider.nativeElement, 'touchstart', (event) => {
4477
- event.preventDefault();
4475
+ if (event.cancelable) {
4476
+ event.preventDefault();
4477
+ }
4478
4478
  this.handleStartSwiping(event);
4479
4479
  document.addEventListener('touchmove', this.handleStartSwiping, {
4480
4480
  passive: false
@@ -4500,6 +4500,9 @@ class SliderComponent {
4500
4500
  else if (this.value > this.max) {
4501
4501
  this.value = this.max;
4502
4502
  }
4503
+ if (typeof this.onChange === 'function') {
4504
+ this.onChange(this.value);
4505
+ }
4503
4506
  }
4504
4507
  calculateAverage(values) {
4505
4508
  return values.reduce((sum, value) => sum + value, 0) / values.length;