@aurodesignsystem/auro-formkit 2.1.0-beta.1 → 2.1.0-beta.3
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/CHANGELOG.md +14 -0
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/readme.md +1 -1
- package/components/combobox/README.md +1 -1
- package/components/combobox/demo/api.min.js +1 -1
- package/components/combobox/demo/index.min.js +1 -1
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/dist/index.js +1 -1
- package/components/combobox/dist/registered.js +1 -1
- package/components/counter/README.md +1 -1
- package/components/counter/demo/readme.md +1 -1
- package/components/datepicker/README.md +1 -1
- package/components/datepicker/demo/api.md +4 -0
- package/components/datepicker/demo/api.min.js +37 -12
- package/components/datepicker/demo/index.min.js +37 -12
- package/components/datepicker/demo/readme.md +1 -1
- package/components/datepicker/dist/index.js +37 -12
- package/components/datepicker/dist/registered.js +37 -12
- package/components/datepicker/dist/utilities.d.ts +7 -0
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/demo/readme.md +1 -1
- package/components/form/README.md +1 -1
- package/components/form/demo/readme.md +1 -1
- package/components/input/README.md +1 -1
- package/components/input/demo/api.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/demo/readme.md +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/menu/README.md +1 -1
- package/components/menu/demo/readme.md +1 -1
- package/components/radio/README.md +1 -1
- package/components/radio/demo/readme.md +1 -1
- package/components/select/README.md +1 -1
- package/components/select/demo/readme.md +1 -1
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# Semantic Release Automated Changelog
|
|
2
2
|
|
|
3
|
+
# [2.1.0-beta.3](https://github.com/AlaskaAirlines/auro-formkit/compare/v2.1.0-beta.2...v2.1.0-beta.3) (2025-03-21)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### Bug Fixes
|
|
7
|
+
|
|
8
|
+
* add centralDate is valid date checks ([1e24470](https://github.com/AlaskaAirlines/auro-formkit/commit/1e244700ffb693c1770779ffe2ba77ae84c89fd1))
|
|
9
|
+
|
|
10
|
+
# [2.1.0-beta.2](https://github.com/AlaskaAirlines/auro-formkit/compare/v2.1.0-beta.1...v2.1.0-beta.2) (2025-03-20)
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### Bug Fixes
|
|
14
|
+
|
|
15
|
+
* correct variable for default date format [#441](https://github.com/AlaskaAirlines/auro-formkit/issues/441) ([70d895a](https://github.com/AlaskaAirlines/auro-formkit/commit/70d895abd16828db7dd1099320a13b695f263965))
|
|
16
|
+
|
|
3
17
|
# [2.1.0-beta.1](https://github.com/AlaskaAirlines/auro-formkit/compare/v2.0.3-beta.1...v2.1.0-beta.1) (2025-03-19)
|
|
4
18
|
|
|
5
19
|
|
|
@@ -106,7 +106,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
106
106
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
107
107
|
|
|
108
108
|
```html
|
|
109
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
109
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-checkbox/+esm"></script>
|
|
110
110
|
```
|
|
111
111
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
112
112
|
|
|
@@ -106,7 +106,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
106
106
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
107
107
|
|
|
108
108
|
```html
|
|
109
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
109
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-checkbox/+esm"></script>
|
|
110
110
|
```
|
|
111
111
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
112
112
|
|
|
@@ -111,7 +111,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
111
111
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
112
112
|
|
|
113
113
|
```html
|
|
114
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
114
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-combobox/+esm"></script>
|
|
115
115
|
```
|
|
116
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
117
|
|
|
@@ -111,7 +111,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
111
111
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
112
112
|
|
|
113
113
|
```html
|
|
114
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
114
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-combobox/+esm"></script>
|
|
115
115
|
```
|
|
116
116
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
117
117
|
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
111
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
113
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-counter/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
111
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
113
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-counter/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -104,7 +104,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
104
104
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
105
105
|
|
|
106
106
|
```html
|
|
107
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
107
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-datepicker/+esm"></script>
|
|
108
108
|
```
|
|
109
109
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
110
110
|
|
|
@@ -286,6 +286,10 @@ In <strong>mobile</strong> layout, upon first opening the bib, the vertical list
|
|
|
286
286
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
287
287
|
</auro-accordion>
|
|
288
288
|
|
|
289
|
+
#### centralDate
|
|
290
|
+
|
|
291
|
+
The `centralDate` attribute can be used to force the calendar to navigate to a specific month. WARNING: Do not set the `centralDate` attribute on blur.
|
|
292
|
+
|
|
289
293
|
#### maxDate
|
|
290
294
|
|
|
291
295
|
To give a higher limit you can bind a date to the `maxDate` attribute. It is recommended to use the `setCustomValidityRangeOverflow` attribute to define an error message to display when validation fails the maximum date restriction.
|
|
@@ -725,7 +725,7 @@ class AuroDatepickerUtilities {
|
|
|
725
725
|
validDateStr(date, format) {
|
|
726
726
|
const dateStrLength = 10;
|
|
727
727
|
|
|
728
|
-
if (date.length === dateStrLength && Date.parse(this.toNorthAmericanFormat(date, format))) {
|
|
728
|
+
if (format !== undefined && date !== undefined && date.length === dateStrLength && Date.parse(this.toNorthAmericanFormat(date, format))) {
|
|
729
729
|
return true;
|
|
730
730
|
}
|
|
731
731
|
|
|
@@ -866,12 +866,21 @@ class AuroDatepickerUtilities {
|
|
|
866
866
|
*/
|
|
867
867
|
getDateAsString(date) {
|
|
868
868
|
const year = new Date(date).getFullYear();
|
|
869
|
-
const month = new Date(date).getMonth() + 1;
|
|
870
|
-
const day = new Date(date).getDate();
|
|
869
|
+
const month = this.formatTwoDigits(new Date(date).getMonth() + 1);
|
|
870
|
+
const day = this.formatTwoDigits(new Date(date).getDate());
|
|
871
871
|
|
|
872
|
-
|
|
872
|
+
return `${month}/${day}/${year}`;
|
|
873
|
+
}
|
|
873
874
|
|
|
874
|
-
|
|
875
|
+
/**
|
|
876
|
+
* Function to format a number to two digits.
|
|
877
|
+
* @private
|
|
878
|
+
* @param {Number} num - Number to format.
|
|
879
|
+
* @returns {String} Returns the number as a string.
|
|
880
|
+
*/
|
|
881
|
+
formatTwoDigits(num) {
|
|
882
|
+
const singleDigitThreshold = 10;
|
|
883
|
+
return num < singleDigitThreshold ? `0${num}` : num;
|
|
875
884
|
}
|
|
876
885
|
|
|
877
886
|
/**
|
|
@@ -10571,10 +10580,23 @@ class CalendarUtilities {
|
|
|
10571
10580
|
increment = -1; // eslint-disable-line no-magic-numbers
|
|
10572
10581
|
}
|
|
10573
10582
|
|
|
10574
|
-
//
|
|
10575
|
-
const
|
|
10576
|
-
|
|
10577
|
-
|
|
10583
|
+
// Get new central date for calendar view
|
|
10584
|
+
const {firstRenderedMonth, centralDate, datepicker} = elem;
|
|
10585
|
+
const formattedDateStr = this.util.getDateAsString(centralDate, datepicker.format);
|
|
10586
|
+
let newCentralDate = null;
|
|
10587
|
+
|
|
10588
|
+
if (this.util.validDateStr(formattedDateStr, datepicker.format)) {
|
|
10589
|
+
// Use current date as base and adjust month by increment
|
|
10590
|
+
newCentralDate = new Date(formattedDateStr).setMonth(new Date(formattedDateStr).getMonth() + increment);
|
|
10591
|
+
} else {
|
|
10592
|
+
// Fallback to first rendered month if central date invalid
|
|
10593
|
+
newCentralDate = new Date(firstRenderedMonth).setMonth(new Date(firstRenderedMonth).getMonth() + increment);
|
|
10594
|
+
}
|
|
10595
|
+
|
|
10596
|
+
// Update calendar central date
|
|
10597
|
+
if (newCentralDate) {
|
|
10598
|
+
elem.centralDate = this.util.convertDateToFirstOfMonth(newCentralDate);
|
|
10599
|
+
}
|
|
10578
10600
|
}
|
|
10579
10601
|
}
|
|
10580
10602
|
|
|
@@ -12303,9 +12325,12 @@ class AuroCalendar extends RangeDatepicker {
|
|
|
12303
12325
|
// Determine which month to render first
|
|
12304
12326
|
let dateMatches = undefined;
|
|
12305
12327
|
|
|
12306
|
-
if (!this.isFullscreen
|
|
12328
|
+
if (!this.isFullscreen) {
|
|
12329
|
+
|
|
12330
|
+
const formattedDateStr = this.util.getDateAsString(new Date(this.centralDate), this.datepicker.format);
|
|
12331
|
+
|
|
12307
12332
|
// On Desktop start the calendar at the central date if it exists, then minDate and finally the current date.
|
|
12308
|
-
if (this.
|
|
12333
|
+
if (this.util.validDateStr(formattedDateStr, this.datepicker.format)) {
|
|
12309
12334
|
dateMatches = this.util.datesMatch(this.firstRenderedMonth, this.util.convertDateToFirstOfMonth(this.centralDate));
|
|
12310
12335
|
|
|
12311
12336
|
if (!dateMatches) {
|
|
@@ -19713,7 +19738,7 @@ class AuroInputUtilities {
|
|
|
19713
19738
|
|
|
19714
19739
|
return {
|
|
19715
19740
|
mask: Date,
|
|
19716
|
-
pattern:
|
|
19741
|
+
pattern: dateFormat,
|
|
19717
19742
|
blocks,
|
|
19718
19743
|
format(date) {
|
|
19719
19744
|
if (!date) {
|
|
@@ -466,7 +466,7 @@ class AuroDatepickerUtilities {
|
|
|
466
466
|
validDateStr(date, format) {
|
|
467
467
|
const dateStrLength = 10;
|
|
468
468
|
|
|
469
|
-
if (date.length === dateStrLength && Date.parse(this.toNorthAmericanFormat(date, format))) {
|
|
469
|
+
if (format !== undefined && date !== undefined && date.length === dateStrLength && Date.parse(this.toNorthAmericanFormat(date, format))) {
|
|
470
470
|
return true;
|
|
471
471
|
}
|
|
472
472
|
|
|
@@ -607,12 +607,21 @@ class AuroDatepickerUtilities {
|
|
|
607
607
|
*/
|
|
608
608
|
getDateAsString(date) {
|
|
609
609
|
const year = new Date(date).getFullYear();
|
|
610
|
-
const month = new Date(date).getMonth() + 1;
|
|
611
|
-
const day = new Date(date).getDate();
|
|
610
|
+
const month = this.formatTwoDigits(new Date(date).getMonth() + 1);
|
|
611
|
+
const day = this.formatTwoDigits(new Date(date).getDate());
|
|
612
612
|
|
|
613
|
-
|
|
613
|
+
return `${month}/${day}/${year}`;
|
|
614
|
+
}
|
|
614
615
|
|
|
615
|
-
|
|
616
|
+
/**
|
|
617
|
+
* Function to format a number to two digits.
|
|
618
|
+
* @private
|
|
619
|
+
* @param {Number} num - Number to format.
|
|
620
|
+
* @returns {String} Returns the number as a string.
|
|
621
|
+
*/
|
|
622
|
+
formatTwoDigits(num) {
|
|
623
|
+
const singleDigitThreshold = 10;
|
|
624
|
+
return num < singleDigitThreshold ? `0${num}` : num;
|
|
616
625
|
}
|
|
617
626
|
|
|
618
627
|
/**
|
|
@@ -10312,10 +10321,23 @@ class CalendarUtilities {
|
|
|
10312
10321
|
increment = -1; // eslint-disable-line no-magic-numbers
|
|
10313
10322
|
}
|
|
10314
10323
|
|
|
10315
|
-
//
|
|
10316
|
-
const
|
|
10317
|
-
|
|
10318
|
-
|
|
10324
|
+
// Get new central date for calendar view
|
|
10325
|
+
const {firstRenderedMonth, centralDate, datepicker} = elem;
|
|
10326
|
+
const formattedDateStr = this.util.getDateAsString(centralDate, datepicker.format);
|
|
10327
|
+
let newCentralDate = null;
|
|
10328
|
+
|
|
10329
|
+
if (this.util.validDateStr(formattedDateStr, datepicker.format)) {
|
|
10330
|
+
// Use current date as base and adjust month by increment
|
|
10331
|
+
newCentralDate = new Date(formattedDateStr).setMonth(new Date(formattedDateStr).getMonth() + increment);
|
|
10332
|
+
} else {
|
|
10333
|
+
// Fallback to first rendered month if central date invalid
|
|
10334
|
+
newCentralDate = new Date(firstRenderedMonth).setMonth(new Date(firstRenderedMonth).getMonth() + increment);
|
|
10335
|
+
}
|
|
10336
|
+
|
|
10337
|
+
// Update calendar central date
|
|
10338
|
+
if (newCentralDate) {
|
|
10339
|
+
elem.centralDate = this.util.convertDateToFirstOfMonth(newCentralDate);
|
|
10340
|
+
}
|
|
10319
10341
|
}
|
|
10320
10342
|
}
|
|
10321
10343
|
|
|
@@ -12044,9 +12066,12 @@ class AuroCalendar extends RangeDatepicker {
|
|
|
12044
12066
|
// Determine which month to render first
|
|
12045
12067
|
let dateMatches = undefined;
|
|
12046
12068
|
|
|
12047
|
-
if (!this.isFullscreen
|
|
12069
|
+
if (!this.isFullscreen) {
|
|
12070
|
+
|
|
12071
|
+
const formattedDateStr = this.util.getDateAsString(new Date(this.centralDate), this.datepicker.format);
|
|
12072
|
+
|
|
12048
12073
|
// On Desktop start the calendar at the central date if it exists, then minDate and finally the current date.
|
|
12049
|
-
if (this.
|
|
12074
|
+
if (this.util.validDateStr(formattedDateStr, this.datepicker.format)) {
|
|
12050
12075
|
dateMatches = this.util.datesMatch(this.firstRenderedMonth, this.util.convertDateToFirstOfMonth(this.centralDate));
|
|
12051
12076
|
|
|
12052
12077
|
if (!dateMatches) {
|
|
@@ -19454,7 +19479,7 @@ class AuroInputUtilities {
|
|
|
19454
19479
|
|
|
19455
19480
|
return {
|
|
19456
19481
|
mask: Date,
|
|
19457
|
-
pattern:
|
|
19482
|
+
pattern: dateFormat,
|
|
19458
19483
|
blocks,
|
|
19459
19484
|
format(date) {
|
|
19460
19485
|
if (!date) {
|
|
@@ -104,7 +104,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
104
104
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
105
105
|
|
|
106
106
|
```html
|
|
107
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
107
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-datepicker/+esm"></script>
|
|
108
108
|
```
|
|
109
109
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
110
110
|
|
|
@@ -440,7 +440,7 @@ class AuroDatepickerUtilities {
|
|
|
440
440
|
validDateStr(date, format) {
|
|
441
441
|
const dateStrLength = 10;
|
|
442
442
|
|
|
443
|
-
if (date.length === dateStrLength && Date.parse(this.toNorthAmericanFormat(date, format))) {
|
|
443
|
+
if (format !== undefined && date !== undefined && date.length === dateStrLength && Date.parse(this.toNorthAmericanFormat(date, format))) {
|
|
444
444
|
return true;
|
|
445
445
|
}
|
|
446
446
|
|
|
@@ -581,12 +581,21 @@ class AuroDatepickerUtilities {
|
|
|
581
581
|
*/
|
|
582
582
|
getDateAsString(date) {
|
|
583
583
|
const year = new Date(date).getFullYear();
|
|
584
|
-
const month = new Date(date).getMonth() + 1;
|
|
585
|
-
const day = new Date(date).getDate();
|
|
584
|
+
const month = this.formatTwoDigits(new Date(date).getMonth() + 1);
|
|
585
|
+
const day = this.formatTwoDigits(new Date(date).getDate());
|
|
586
586
|
|
|
587
|
-
|
|
587
|
+
return `${month}/${day}/${year}`;
|
|
588
|
+
}
|
|
588
589
|
|
|
589
|
-
|
|
590
|
+
/**
|
|
591
|
+
* Function to format a number to two digits.
|
|
592
|
+
* @private
|
|
593
|
+
* @param {Number} num - Number to format.
|
|
594
|
+
* @returns {String} Returns the number as a string.
|
|
595
|
+
*/
|
|
596
|
+
formatTwoDigits(num) {
|
|
597
|
+
const singleDigitThreshold = 10;
|
|
598
|
+
return num < singleDigitThreshold ? `0${num}` : num;
|
|
590
599
|
}
|
|
591
600
|
|
|
592
601
|
/**
|
|
@@ -10261,10 +10270,23 @@ class CalendarUtilities {
|
|
|
10261
10270
|
increment = -1; // eslint-disable-line no-magic-numbers
|
|
10262
10271
|
}
|
|
10263
10272
|
|
|
10264
|
-
//
|
|
10265
|
-
const
|
|
10266
|
-
|
|
10267
|
-
|
|
10273
|
+
// Get new central date for calendar view
|
|
10274
|
+
const {firstRenderedMonth, centralDate, datepicker} = elem;
|
|
10275
|
+
const formattedDateStr = this.util.getDateAsString(centralDate, datepicker.format);
|
|
10276
|
+
let newCentralDate = null;
|
|
10277
|
+
|
|
10278
|
+
if (this.util.validDateStr(formattedDateStr, datepicker.format)) {
|
|
10279
|
+
// Use current date as base and adjust month by increment
|
|
10280
|
+
newCentralDate = new Date(formattedDateStr).setMonth(new Date(formattedDateStr).getMonth() + increment);
|
|
10281
|
+
} else {
|
|
10282
|
+
// Fallback to first rendered month if central date invalid
|
|
10283
|
+
newCentralDate = new Date(firstRenderedMonth).setMonth(new Date(firstRenderedMonth).getMonth() + increment);
|
|
10284
|
+
}
|
|
10285
|
+
|
|
10286
|
+
// Update calendar central date
|
|
10287
|
+
if (newCentralDate) {
|
|
10288
|
+
elem.centralDate = this.util.convertDateToFirstOfMonth(newCentralDate);
|
|
10289
|
+
}
|
|
10268
10290
|
}
|
|
10269
10291
|
}
|
|
10270
10292
|
|
|
@@ -11987,9 +12009,12 @@ class AuroCalendar extends RangeDatepicker {
|
|
|
11987
12009
|
// Determine which month to render first
|
|
11988
12010
|
let dateMatches = undefined;
|
|
11989
12011
|
|
|
11990
|
-
if (!this.isFullscreen
|
|
12012
|
+
if (!this.isFullscreen) {
|
|
12013
|
+
|
|
12014
|
+
const formattedDateStr = this.util.getDateAsString(new Date(this.centralDate), this.datepicker.format);
|
|
12015
|
+
|
|
11991
12016
|
// On Desktop start the calendar at the central date if it exists, then minDate and finally the current date.
|
|
11992
|
-
if (this.
|
|
12017
|
+
if (this.util.validDateStr(formattedDateStr, this.datepicker.format)) {
|
|
11993
12018
|
dateMatches = this.util.datesMatch(this.firstRenderedMonth, this.util.convertDateToFirstOfMonth(this.centralDate));
|
|
11994
12019
|
|
|
11995
12020
|
if (!dateMatches) {
|
|
@@ -19384,7 +19409,7 @@ class AuroInputUtilities {
|
|
|
19384
19409
|
|
|
19385
19410
|
return {
|
|
19386
19411
|
mask: Date,
|
|
19387
|
-
pattern:
|
|
19412
|
+
pattern: dateFormat,
|
|
19388
19413
|
blocks,
|
|
19389
19414
|
format(date) {
|
|
19390
19415
|
if (!date) {
|
|
@@ -440,7 +440,7 @@ class AuroDatepickerUtilities {
|
|
|
440
440
|
validDateStr(date, format) {
|
|
441
441
|
const dateStrLength = 10;
|
|
442
442
|
|
|
443
|
-
if (date.length === dateStrLength && Date.parse(this.toNorthAmericanFormat(date, format))) {
|
|
443
|
+
if (format !== undefined && date !== undefined && date.length === dateStrLength && Date.parse(this.toNorthAmericanFormat(date, format))) {
|
|
444
444
|
return true;
|
|
445
445
|
}
|
|
446
446
|
|
|
@@ -581,12 +581,21 @@ class AuroDatepickerUtilities {
|
|
|
581
581
|
*/
|
|
582
582
|
getDateAsString(date) {
|
|
583
583
|
const year = new Date(date).getFullYear();
|
|
584
|
-
const month = new Date(date).getMonth() + 1;
|
|
585
|
-
const day = new Date(date).getDate();
|
|
584
|
+
const month = this.formatTwoDigits(new Date(date).getMonth() + 1);
|
|
585
|
+
const day = this.formatTwoDigits(new Date(date).getDate());
|
|
586
586
|
|
|
587
|
-
|
|
587
|
+
return `${month}/${day}/${year}`;
|
|
588
|
+
}
|
|
588
589
|
|
|
589
|
-
|
|
590
|
+
/**
|
|
591
|
+
* Function to format a number to two digits.
|
|
592
|
+
* @private
|
|
593
|
+
* @param {Number} num - Number to format.
|
|
594
|
+
* @returns {String} Returns the number as a string.
|
|
595
|
+
*/
|
|
596
|
+
formatTwoDigits(num) {
|
|
597
|
+
const singleDigitThreshold = 10;
|
|
598
|
+
return num < singleDigitThreshold ? `0${num}` : num;
|
|
590
599
|
}
|
|
591
600
|
|
|
592
601
|
/**
|
|
@@ -10261,10 +10270,23 @@ class CalendarUtilities {
|
|
|
10261
10270
|
increment = -1; // eslint-disable-line no-magic-numbers
|
|
10262
10271
|
}
|
|
10263
10272
|
|
|
10264
|
-
//
|
|
10265
|
-
const
|
|
10266
|
-
|
|
10267
|
-
|
|
10273
|
+
// Get new central date for calendar view
|
|
10274
|
+
const {firstRenderedMonth, centralDate, datepicker} = elem;
|
|
10275
|
+
const formattedDateStr = this.util.getDateAsString(centralDate, datepicker.format);
|
|
10276
|
+
let newCentralDate = null;
|
|
10277
|
+
|
|
10278
|
+
if (this.util.validDateStr(formattedDateStr, datepicker.format)) {
|
|
10279
|
+
// Use current date as base and adjust month by increment
|
|
10280
|
+
newCentralDate = new Date(formattedDateStr).setMonth(new Date(formattedDateStr).getMonth() + increment);
|
|
10281
|
+
} else {
|
|
10282
|
+
// Fallback to first rendered month if central date invalid
|
|
10283
|
+
newCentralDate = new Date(firstRenderedMonth).setMonth(new Date(firstRenderedMonth).getMonth() + increment);
|
|
10284
|
+
}
|
|
10285
|
+
|
|
10286
|
+
// Update calendar central date
|
|
10287
|
+
if (newCentralDate) {
|
|
10288
|
+
elem.centralDate = this.util.convertDateToFirstOfMonth(newCentralDate);
|
|
10289
|
+
}
|
|
10268
10290
|
}
|
|
10269
10291
|
}
|
|
10270
10292
|
|
|
@@ -11987,9 +12009,12 @@ class AuroCalendar extends RangeDatepicker {
|
|
|
11987
12009
|
// Determine which month to render first
|
|
11988
12010
|
let dateMatches = undefined;
|
|
11989
12011
|
|
|
11990
|
-
if (!this.isFullscreen
|
|
12012
|
+
if (!this.isFullscreen) {
|
|
12013
|
+
|
|
12014
|
+
const formattedDateStr = this.util.getDateAsString(new Date(this.centralDate), this.datepicker.format);
|
|
12015
|
+
|
|
11991
12016
|
// On Desktop start the calendar at the central date if it exists, then minDate and finally the current date.
|
|
11992
|
-
if (this.
|
|
12017
|
+
if (this.util.validDateStr(formattedDateStr, this.datepicker.format)) {
|
|
11993
12018
|
dateMatches = this.util.datesMatch(this.firstRenderedMonth, this.util.convertDateToFirstOfMonth(this.centralDate));
|
|
11994
12019
|
|
|
11995
12020
|
if (!dateMatches) {
|
|
@@ -19384,7 +19409,7 @@ class AuroInputUtilities {
|
|
|
19384
19409
|
|
|
19385
19410
|
return {
|
|
19386
19411
|
mask: Date,
|
|
19387
|
-
pattern:
|
|
19412
|
+
pattern: dateFormat,
|
|
19388
19413
|
blocks,
|
|
19389
19414
|
format(date) {
|
|
19390
19415
|
if (!date) {
|
|
@@ -51,6 +51,13 @@ export class AuroDatepickerUtilities {
|
|
|
51
51
|
* @returns {Object} Returns the date as a string.
|
|
52
52
|
*/
|
|
53
53
|
private getDateAsString;
|
|
54
|
+
/**
|
|
55
|
+
* Function to format a number to two digits.
|
|
56
|
+
* @private
|
|
57
|
+
* @param {Number} num - Number to format.
|
|
58
|
+
* @returns {String} Returns the number as a string.
|
|
59
|
+
*/
|
|
60
|
+
private formatTwoDigits;
|
|
54
61
|
/**
|
|
55
62
|
* Function to generate checkmark svg.
|
|
56
63
|
* @private
|
|
@@ -107,7 +107,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
107
107
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
108
108
|
|
|
109
109
|
```html
|
|
110
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
110
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-dropdown/+esm"></script>
|
|
111
111
|
```
|
|
112
112
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
113
|
|
|
@@ -107,7 +107,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
107
107
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
108
108
|
|
|
109
109
|
```html
|
|
110
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
110
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-dropdown/+esm"></script>
|
|
111
111
|
```
|
|
112
112
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
113
|
|
|
@@ -109,7 +109,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
109
109
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
110
110
|
|
|
111
111
|
```html
|
|
112
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
112
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-form/+esm"></script>
|
|
113
113
|
```
|
|
114
114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
115
115
|
|
|
@@ -109,7 +109,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
109
109
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
110
110
|
|
|
111
111
|
```html
|
|
112
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
112
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-form/+esm"></script>
|
|
113
113
|
```
|
|
114
114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
115
115
|
|
|
@@ -99,7 +99,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
99
99
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
100
100
|
|
|
101
101
|
```html
|
|
102
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
102
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-input/+esm"></script>
|
|
103
103
|
```
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
@@ -99,7 +99,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
99
99
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
100
100
|
|
|
101
101
|
```html
|
|
102
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
102
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-input/+esm"></script>
|
|
103
103
|
```
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
111
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
113
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-menu/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
111
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
113
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-menu/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -100,7 +100,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
100
100
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
101
101
|
|
|
102
102
|
```html
|
|
103
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
103
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-radio/+esm"></script>
|
|
104
104
|
```
|
|
105
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
106
|
|
|
@@ -100,7 +100,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
100
100
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
101
101
|
|
|
102
102
|
```html
|
|
103
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
103
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-radio/+esm"></script>
|
|
104
104
|
```
|
|
105
105
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
106
106
|
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
111
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
113
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-select/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
|
@@ -110,7 +110,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
110
110
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
111
111
|
|
|
112
112
|
```html
|
|
113
|
-
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.0
|
|
113
|
+
<script type="module "src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@2.1.0-beta.2/auro-select/+esm"></script>
|
|
114
114
|
```
|
|
115
115
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
116
116
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aurodesignsystem/auro-formkit",
|
|
3
|
-
"version": "2.1.0-beta.
|
|
3
|
+
"version": "2.1.0-beta.3",
|
|
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": {
|
|
@@ -53,13 +53,13 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"lit": "^3.2.1",
|
|
56
|
-
"@lit/reactive-element": "^2.0.4"
|
|
56
|
+
"@lit/reactive-element": "^2.0.4",
|
|
57
|
+
"@aurodesignsystem/auro-library": "^3.0.13"
|
|
57
58
|
},
|
|
58
59
|
"optionalDependencies": {
|
|
59
60
|
"@rollup/rollup-linux-x64-gnu": "*"
|
|
60
61
|
},
|
|
61
62
|
"devDependencies": {
|
|
62
|
-
"@aurodesignsystem/auro-library": "^3.0.13",
|
|
63
63
|
"@aurodesignsystem/eslint-config": "^1.3.3",
|
|
64
64
|
"@commitlint/cli": "^19.6.1",
|
|
65
65
|
"@commitlint/config-conventional": "^19.6.0",
|