@websy/websy-designs 1.2.30 → 1.2.32

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.
@@ -372,7 +372,7 @@ class WebsyDatePicker {
372
372
  console.log('No element found with Id', elementId)
373
373
  }
374
374
  }
375
- close (confirm) {
375
+ close (confirm, isRange = false) {
376
376
  const maskEl = document.getElementById(`${this.elementId}_mask`)
377
377
  const contentEl = document.getElementById(`${this.elementId}_content`)
378
378
  const el = document.getElementById(this.elementId)
@@ -401,10 +401,14 @@ class WebsyDatePicker {
401
401
  this.options.onChange(hoursOut, true)
402
402
  }
403
403
  else {
404
- this.options.onChange(this.currentselection, false)
404
+ this.options.onChange(this.currentselection, isRange)
405
405
  }
406
406
  }
407
407
  }
408
+ this.priorSelectedDates = [...this.selectedRangeDates]
409
+ this.priorSelectedRange = this.selectedRange
410
+ this.priorselection = [...this.currentselection]
411
+ this.priorCustomRangeSelected = this.customRangeSelected
408
412
  this.updateRange()
409
413
  }
410
414
  else {
@@ -947,7 +951,7 @@ class WebsyDatePicker {
947
951
  }
948
952
  this.highlightRange()
949
953
  this.updateRange()
950
- this.close(confirm)
954
+ this.close(confirm, true)
951
955
  }
952
956
  }
953
957
  selectCustomRange (rangeInput) {
@@ -413,6 +413,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
413
413
  value: function close(confirm) {
414
414
  var _this2 = this;
415
415
 
416
+ var isRange = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
416
417
  var maskEl = document.getElementById("".concat(this.elementId, "_mask"));
417
418
  var contentEl = document.getElementById("".concat(this.elementId, "_content"));
418
419
  var el = document.getElementById(this.elementId);
@@ -446,11 +447,15 @@ var WebsyDatePicker = /*#__PURE__*/function () {
446
447
 
447
448
  this.options.onChange(_hoursOut, true);
448
449
  } else {
449
- this.options.onChange(this.currentselection, false);
450
+ this.options.onChange(this.currentselection, isRange);
450
451
  }
451
452
  }
452
453
  }
453
454
 
455
+ this.priorSelectedDates = _toConsumableArray(this.selectedRangeDates);
456
+ this.priorSelectedRange = this.selectedRange;
457
+ this.priorselection = _toConsumableArray(this.currentselection);
458
+ this.priorCustomRangeSelected = this.customRangeSelected;
454
459
  this.updateRange();
455
460
  } else {
456
461
  this.selectedRangeDates = _toConsumableArray(this.priorSelectedDates || []);
@@ -1052,7 +1057,7 @@ var WebsyDatePicker = /*#__PURE__*/function () {
1052
1057
 
1053
1058
  this.highlightRange();
1054
1059
  this.updateRange();
1055
- this.close(confirm);
1060
+ this.close(confirm, true);
1056
1061
  }
1057
1062
  }
1058
1063
  }, {