@aurodesignsystem-dev/auro-formkit 0.0.0-pr847.0 → 0.0.0-pr860.0

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.
@@ -28908,23 +28908,33 @@ class AuroDatePicker extends AuroElement$1 {
28908
28908
  const convertedDate = this.convertWcTimeToDate(time);
28909
28909
  const newDate = this.util.toCustomFormat(convertedDate, this.format);
28910
28910
 
28911
+ let onEndValue = false;
28911
28912
  if (this.util.validDateStr(newDate, this.format)) {
28912
- if (this.inputList.length > 1) {
28913
- if (!this.value || !this.util.validDateStr(this.value, this.format)) {
28914
- this.value = newDate;
28915
- } else if (!this.valueEnd || !this.util.validDateStr(this.valueEnd, this.format)) {
28913
+ if (this.range) {
28914
+ const isValueValid = this.value && this.util.validDateStr(this.value, this.format);
28915
+ const isValueEndValid = this.valueEnd && this.util.validDateStr(this.valueEnd, this.format);
28916
+
28917
+ if (isValueValid && !isValueEndValid) {
28916
28918
  // verify the date is after this.value to insure we are setting a proper range
28917
28919
  if (new Date(this.util.toNorthAmericanFormat(newDate, this.format)) >= new Date(this.formattedValue)) {
28918
- this.valueEnd = newDate;
28919
- } else {
28920
- this.value = newDate;
28920
+ onEndValue = true;
28921
28921
  }
28922
- } else {
28923
- this.value = newDate;
28922
+ } else if (isValueValid && isValueEndValid) {
28923
+ // both dateTo and dateFrom are valid, then reset datTo
28924
28924
  this.valueEnd = '';
28925
28925
  }
28926
+ }
28927
+
28928
+ if (onEndValue) {
28929
+ this.valueEnd = newDate;
28930
+ if (this.dropdown.isPopoverVisible && !this.dropdown.isBibFullscreen) {
28931
+ this.focus('startDate');
28932
+ }
28926
28933
  } else {
28927
28934
  this.value = newDate;
28935
+ if (this.dropdown.isPopoverVisible && !this.dropdown.isBibFullscreen) {
28936
+ this.focus('endDate');
28937
+ }
28928
28938
  }
28929
28939
  }
28930
28940
  }
@@ -28649,23 +28649,33 @@ class AuroDatePicker extends AuroElement$1 {
28649
28649
  const convertedDate = this.convertWcTimeToDate(time);
28650
28650
  const newDate = this.util.toCustomFormat(convertedDate, this.format);
28651
28651
 
28652
+ let onEndValue = false;
28652
28653
  if (this.util.validDateStr(newDate, this.format)) {
28653
- if (this.inputList.length > 1) {
28654
- if (!this.value || !this.util.validDateStr(this.value, this.format)) {
28655
- this.value = newDate;
28656
- } else if (!this.valueEnd || !this.util.validDateStr(this.valueEnd, this.format)) {
28654
+ if (this.range) {
28655
+ const isValueValid = this.value && this.util.validDateStr(this.value, this.format);
28656
+ const isValueEndValid = this.valueEnd && this.util.validDateStr(this.valueEnd, this.format);
28657
+
28658
+ if (isValueValid && !isValueEndValid) {
28657
28659
  // verify the date is after this.value to insure we are setting a proper range
28658
28660
  if (new Date(this.util.toNorthAmericanFormat(newDate, this.format)) >= new Date(this.formattedValue)) {
28659
- this.valueEnd = newDate;
28660
- } else {
28661
- this.value = newDate;
28661
+ onEndValue = true;
28662
28662
  }
28663
- } else {
28664
- this.value = newDate;
28663
+ } else if (isValueValid && isValueEndValid) {
28664
+ // both dateTo and dateFrom are valid, then reset datTo
28665
28665
  this.valueEnd = '';
28666
28666
  }
28667
+ }
28668
+
28669
+ if (onEndValue) {
28670
+ this.valueEnd = newDate;
28671
+ if (this.dropdown.isPopoverVisible && !this.dropdown.isBibFullscreen) {
28672
+ this.focus('startDate');
28673
+ }
28667
28674
  } else {
28668
28675
  this.value = newDate;
28676
+ if (this.dropdown.isPopoverVisible && !this.dropdown.isBibFullscreen) {
28677
+ this.focus('endDate');
28678
+ }
28669
28679
  }
28670
28680
  }
28671
28681
  }
@@ -28585,23 +28585,33 @@ class AuroDatePicker extends AuroElement$1 {
28585
28585
  const convertedDate = this.convertWcTimeToDate(time);
28586
28586
  const newDate = this.util.toCustomFormat(convertedDate, this.format);
28587
28587
 
28588
+ let onEndValue = false;
28588
28589
  if (this.util.validDateStr(newDate, this.format)) {
28589
- if (this.inputList.length > 1) {
28590
- if (!this.value || !this.util.validDateStr(this.value, this.format)) {
28591
- this.value = newDate;
28592
- } else if (!this.valueEnd || !this.util.validDateStr(this.valueEnd, this.format)) {
28590
+ if (this.range) {
28591
+ const isValueValid = this.value && this.util.validDateStr(this.value, this.format);
28592
+ const isValueEndValid = this.valueEnd && this.util.validDateStr(this.valueEnd, this.format);
28593
+
28594
+ if (isValueValid && !isValueEndValid) {
28593
28595
  // verify the date is after this.value to insure we are setting a proper range
28594
28596
  if (new Date(this.util.toNorthAmericanFormat(newDate, this.format)) >= new Date(this.formattedValue)) {
28595
- this.valueEnd = newDate;
28596
- } else {
28597
- this.value = newDate;
28597
+ onEndValue = true;
28598
28598
  }
28599
- } else {
28600
- this.value = newDate;
28599
+ } else if (isValueValid && isValueEndValid) {
28600
+ // both dateTo and dateFrom are valid, then reset datTo
28601
28601
  this.valueEnd = '';
28602
28602
  }
28603
+ }
28604
+
28605
+ if (onEndValue) {
28606
+ this.valueEnd = newDate;
28607
+ if (this.dropdown.isPopoverVisible && !this.dropdown.isBibFullscreen) {
28608
+ this.focus('startDate');
28609
+ }
28603
28610
  } else {
28604
28611
  this.value = newDate;
28612
+ if (this.dropdown.isPopoverVisible && !this.dropdown.isBibFullscreen) {
28613
+ this.focus('endDate');
28614
+ }
28605
28615
  }
28606
28616
  }
28607
28617
  }
@@ -28585,23 +28585,33 @@ class AuroDatePicker extends AuroElement$1 {
28585
28585
  const convertedDate = this.convertWcTimeToDate(time);
28586
28586
  const newDate = this.util.toCustomFormat(convertedDate, this.format);
28587
28587
 
28588
+ let onEndValue = false;
28588
28589
  if (this.util.validDateStr(newDate, this.format)) {
28589
- if (this.inputList.length > 1) {
28590
- if (!this.value || !this.util.validDateStr(this.value, this.format)) {
28591
- this.value = newDate;
28592
- } else if (!this.valueEnd || !this.util.validDateStr(this.valueEnd, this.format)) {
28590
+ if (this.range) {
28591
+ const isValueValid = this.value && this.util.validDateStr(this.value, this.format);
28592
+ const isValueEndValid = this.valueEnd && this.util.validDateStr(this.valueEnd, this.format);
28593
+
28594
+ if (isValueValid && !isValueEndValid) {
28593
28595
  // verify the date is after this.value to insure we are setting a proper range
28594
28596
  if (new Date(this.util.toNorthAmericanFormat(newDate, this.format)) >= new Date(this.formattedValue)) {
28595
- this.valueEnd = newDate;
28596
- } else {
28597
- this.value = newDate;
28597
+ onEndValue = true;
28598
28598
  }
28599
- } else {
28600
- this.value = newDate;
28599
+ } else if (isValueValid && isValueEndValid) {
28600
+ // both dateTo and dateFrom are valid, then reset datTo
28601
28601
  this.valueEnd = '';
28602
28602
  }
28603
+ }
28604
+
28605
+ if (onEndValue) {
28606
+ this.valueEnd = newDate;
28607
+ if (this.dropdown.isPopoverVisible && !this.dropdown.isBibFullscreen) {
28608
+ this.focus('startDate');
28609
+ }
28603
28610
  } else {
28604
28611
  this.value = newDate;
28612
+ if (this.dropdown.isPopoverVisible && !this.dropdown.isBibFullscreen) {
28613
+ this.focus('endDate');
28614
+ }
28605
28615
  }
28606
28616
  }
28607
28617
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr847.0",
3
+ "version": "0.0.0-pr860.0",
4
4
  "description": "A collection of web components used to build forms.",
5
5
  "homepage": "https://github.com/AlaskaAirlines/auro-formkit#readme",
6
6
  "bugs": {