@aurodesignsystem-dev/auro-formkit 0.0.0-pr1508.0 → 0.0.0-pr1508.2
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/components/bibtemplate/dist/index.js +1 -1
- package/components/bibtemplate/dist/registered.js +1 -1
- package/components/checkbox/demo/customize.min.js +8 -6
- package/components/checkbox/demo/getting-started.min.js +8 -6
- package/components/checkbox/demo/index.min.js +8 -6
- package/components/checkbox/dist/index.js +8 -6
- package/components/checkbox/dist/registered.js +8 -6
- package/components/combobox/README.md +1 -1
- package/components/combobox/demo/customize.md +2 -10
- package/components/combobox/demo/customize.min.js +386 -305
- package/components/combobox/demo/getting-started.min.js +386 -301
- package/components/combobox/demo/index.md +1 -1
- package/components/combobox/demo/index.min.js +386 -301
- package/components/combobox/demo/keyboard-behavior.md +2 -142
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/demo/why-combobox.md +2 -2
- package/components/combobox/dist/auro-combobox.d.ts +23 -16
- package/components/combobox/dist/index.js +385 -300
- package/components/combobox/dist/registered.js +385 -300
- package/components/counter/demo/customize.min.js +18 -8
- package/components/counter/demo/index.min.js +18 -8
- package/components/counter/dist/index.js +18 -8
- package/components/counter/dist/registered.js +18 -8
- package/components/datepicker/demo/accessibility.md +2 -1
- package/components/datepicker/demo/api.md +63 -62
- package/components/datepicker/demo/customize.md +12 -1
- package/components/datepicker/demo/customize.min.js +932 -335
- package/components/datepicker/demo/index.min.js +932 -335
- package/components/datepicker/dist/{src/auro-calendar-cell.d.ts → auro-calendar-cell.d.ts} +20 -3
- package/components/datepicker/dist/{src/auro-calendar.d.ts → auro-calendar.d.ts} +121 -7
- package/components/datepicker/dist/{src/auro-datepicker.d.ts → auro-datepicker.d.ts} +78 -5
- package/components/datepicker/dist/blackoutUtils.d.ts +43 -0
- package/components/datepicker/dist/index.js +932 -335
- package/components/datepicker/dist/registered.js +932 -335
- package/components/dropdown/demo/customize.min.js +2 -1
- package/components/dropdown/demo/getting-started.min.js +2 -1
- package/components/dropdown/demo/index.min.js +2 -1
- package/components/dropdown/dist/index.js +2 -1
- package/components/dropdown/dist/registered.js +2 -1
- package/components/form/demo/customize.min.js +1690 -826
- package/components/form/demo/getting-started.min.js +1690 -826
- package/components/form/demo/index.min.js +1690 -826
- package/components/form/demo/registerDemoDeps.min.js +1690 -826
- package/components/input/demo/api.md +5 -5
- package/components/input/demo/customize.md +8 -8
- package/components/input/demo/customize.min.js +137 -95
- package/components/input/demo/getting-started.min.js +137 -95
- package/components/input/demo/index.min.js +137 -95
- package/components/input/dist/base-input.d.ts +33 -44
- package/components/input/dist/index.js +150 -96
- package/components/input/dist/registered.js +137 -95
- package/components/radio/demo/customize.min.js +8 -6
- package/components/radio/demo/getting-started.min.js +8 -6
- package/components/radio/demo/index.min.js +8 -6
- package/components/radio/dist/index.js +8 -6
- package/components/radio/dist/registered.js +8 -6
- package/components/select/demo/customize.md +86 -0
- package/components/select/demo/customize.min.js +194 -68
- package/components/select/demo/getting-started.min.js +196 -115
- package/components/select/demo/index.min.js +194 -68
- package/components/select/demo/keyboard-behavior.md +18 -4
- package/components/select/dist/auro-select.d.ts +20 -8
- package/components/select/dist/index.js +194 -68
- package/components/select/dist/registered.js +194 -68
- package/custom-elements.json +2365 -1819
- package/package.json +6 -2
- package/components/checkbox/demo/customize.js +0 -22
- package/components/checkbox/demo/demo-support.js +0 -1
- package/components/checkbox/demo/getting-started.js +0 -22
- package/components/checkbox/demo/index.js +0 -8
- package/components/checkbox/demo/styles.scss +0 -1
- package/components/combobox/demo/customize.js +0 -24
- package/components/combobox/demo/demo-support.js +0 -1
- package/components/combobox/demo/getting-started.js +0 -21
- package/components/combobox/demo/index.js +0 -23
- package/components/combobox/demo/styles.scss +0 -1
- package/components/counter/demo/customize.js +0 -21
- package/components/counter/demo/demo-support.js +0 -1
- package/components/counter/demo/index.js +0 -21
- package/components/counter/demo/styles.scss +0 -1
- package/components/datepicker/demo/customize.js +0 -17
- package/components/datepicker/demo/demo-support.js +0 -1
- package/components/datepicker/demo/index.js +0 -23
- package/components/datepicker/demo/styles.scss +0 -1
- package/components/dropdown/demo/customize.js +0 -9
- package/components/dropdown/demo/demo-support.js +0 -1
- package/components/dropdown/demo/getting-started.js +0 -9
- package/components/dropdown/demo/index.js +0 -16
- package/components/dropdown/demo/styles.scss +0 -1
- package/components/form/demo/customize.js +0 -28
- package/components/form/demo/demo-support.js +0 -1
- package/components/form/demo/getting-started.js +0 -9
- package/components/form/demo/index.js +0 -5
- package/components/form/demo/registerDemoDeps.js +0 -23
- package/components/form/demo/styles.scss +0 -1
- package/components/input/demo/customize.js +0 -25
- package/components/input/demo/demo-support.js +0 -1
- package/components/input/demo/getting-started.js +0 -8
- package/components/input/demo/index.js +0 -8
- package/components/input/demo/styles.css +0 -974
- package/components/input/demo/styles.scss +0 -1
- package/components/menu/demo/demo-support.js +0 -1
- package/components/menu/demo/index.js +0 -25
- package/components/menu/demo/styles.scss +0 -1
- package/components/radio/demo/customize.js +0 -22
- package/components/radio/demo/demo-support.js +0 -1
- package/components/radio/demo/getting-started.js +0 -24
- package/components/radio/demo/index.js +0 -8
- package/components/radio/demo/styles.scss +0 -1
- package/components/select/demo/customize.js +0 -11
- package/components/select/demo/demo-support.js +0 -1
- package/components/select/demo/getting-started.js +0 -26
- package/components/select/demo/index.js +0 -11
- package/components/select/demo/styles.scss +0 -1
- /package/components/datepicker/dist/{src/auro-calendar-month.d.ts → auro-calendar-month.d.ts} +0 -0
- /package/components/datepicker/dist/{src/buttonVersion.d.ts → buttonVersion.d.ts} +0 -0
- /package/components/datepicker/dist/{src/datepickerKeyboardStrategy.d.ts → datepickerKeyboardStrategy.d.ts} +0 -0
- /package/components/datepicker/dist/{src/iconVersion.d.ts → iconVersion.d.ts} +0 -0
- /package/components/datepicker/dist/{src/index.d.ts → index.d.ts} +0 -0
- /package/components/datepicker/dist/{src/popoverVersion.d.ts → popoverVersion.d.ts} +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/classic/color-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/classic/style-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/color-calendar-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/color-cell-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/color-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/color-month-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/shapeSize-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/snowflake/color-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/snowflake/style-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/style-auro-calendar-cell-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/style-auro-calendar-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/style-auro-calendar-month-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/style-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/styles → styles}/tokens-css.d.ts +0 -0
- /package/components/datepicker/dist/{src/utilities.d.ts → utilities.d.ts} +0 -0
- /package/components/datepicker/dist/{src/utilitiesCalendar.d.ts → utilitiesCalendar.d.ts} +0 -0
- /package/components/datepicker/dist/{src/utilitiesCalendarRender.d.ts → utilitiesCalendarRender.d.ts} +0 -0
- /package/components/datepicker/dist/{src/vendor → vendor}/wc-range-datepicker/day.d.ts +0 -0
- /package/components/datepicker/dist/{src/vendor → vendor}/wc-range-datepicker/range-datepicker-calendar.d.ts +0 -0
- /package/components/datepicker/dist/{src/vendor → vendor}/wc-range-datepicker/range-datepicker-cell.d.ts +0 -0
- /package/components/datepicker/dist/{src/vendor → vendor}/wc-range-datepicker/range-datepicker.d.ts +0 -0
|
@@ -382,59 +382,49 @@ export default class BaseInput extends AuroElement {
|
|
|
382
382
|
reflect: boolean;
|
|
383
383
|
};
|
|
384
384
|
};
|
|
385
|
+
activeLabel: boolean;
|
|
386
|
+
/** @private */
|
|
387
|
+
private allowedInputTypes;
|
|
385
388
|
appearance: string;
|
|
389
|
+
/** @private */
|
|
390
|
+
private dateFormatMap;
|
|
386
391
|
disabled: boolean;
|
|
392
|
+
/** @private */
|
|
393
|
+
private domHandler;
|
|
394
|
+
dvInputOnly: boolean;
|
|
395
|
+
hasValue: boolean;
|
|
396
|
+
hideLabelVisually: boolean;
|
|
397
|
+
icon: boolean;
|
|
398
|
+
/** @private */
|
|
399
|
+
private inputIconName;
|
|
400
|
+
/** @private */
|
|
401
|
+
private label;
|
|
387
402
|
locale: string;
|
|
388
403
|
max: any;
|
|
389
404
|
maxLength: any;
|
|
390
405
|
min: any;
|
|
391
406
|
minLength: any;
|
|
392
|
-
|
|
407
|
+
noValidate: boolean;
|
|
393
408
|
onDark: boolean;
|
|
409
|
+
_rawMaskValue: string | undefined;
|
|
410
|
+
required: boolean;
|
|
394
411
|
setCustomValidityForType: string | undefined;
|
|
395
|
-
|
|
412
|
+
/** @private */
|
|
413
|
+
private setSelectionInputTypes;
|
|
396
414
|
shape: string;
|
|
415
|
+
/** @private */
|
|
416
|
+
private showPassword;
|
|
417
|
+
size: string;
|
|
418
|
+
touched: boolean;
|
|
419
|
+
/** @private */
|
|
420
|
+
private uniqueId;
|
|
421
|
+
/** @private */
|
|
422
|
+
private util;
|
|
423
|
+
/** @private */
|
|
424
|
+
private validation;
|
|
425
|
+
/** @private */
|
|
426
|
+
private validationCCLength;
|
|
397
427
|
value: any;
|
|
398
|
-
/**
|
|
399
|
-
* Internal Defaults.
|
|
400
|
-
* @private
|
|
401
|
-
* @returns {void}
|
|
402
|
-
*/
|
|
403
|
-
private _initializePrivateDefaults;
|
|
404
|
-
activeLabel: boolean | undefined;
|
|
405
|
-
icon: boolean | undefined;
|
|
406
|
-
dvInputOnly: boolean | undefined;
|
|
407
|
-
hideLabelVisually: boolean | undefined;
|
|
408
|
-
noValidate: boolean | undefined;
|
|
409
|
-
_rawMaskValue: string | undefined;
|
|
410
|
-
touched: boolean | undefined;
|
|
411
|
-
util: any;
|
|
412
|
-
validation: AuroFormValidation | undefined;
|
|
413
|
-
inputIconName: any;
|
|
414
|
-
showPassword: boolean | undefined;
|
|
415
|
-
validationCCLength: number | undefined;
|
|
416
|
-
hasValue: boolean | undefined;
|
|
417
|
-
label: string | undefined;
|
|
418
|
-
allowedInputTypes: string[] | undefined;
|
|
419
|
-
dateFormatMap: {
|
|
420
|
-
'mm/dd/yyyy': string;
|
|
421
|
-
'dd/mm/yyyy': string;
|
|
422
|
-
'yyyy/mm/dd': string;
|
|
423
|
-
'yyyy/dd/mm': string;
|
|
424
|
-
'mm/yy': string;
|
|
425
|
-
'yy/mm': string;
|
|
426
|
-
'mm/yyyy': string;
|
|
427
|
-
'yyyy/mm': string;
|
|
428
|
-
yy: string;
|
|
429
|
-
yyyy: string;
|
|
430
|
-
mm: string;
|
|
431
|
-
dd: string;
|
|
432
|
-
'dd/mm': string;
|
|
433
|
-
'mm/dd': string;
|
|
434
|
-
} | undefined;
|
|
435
|
-
domHandler: any;
|
|
436
|
-
setSelectionInputTypes: string[] | undefined;
|
|
437
|
-
uniqueId: any;
|
|
438
428
|
/**
|
|
439
429
|
* Read-only Date object representation of `value` for full date formats.
|
|
440
430
|
* @returns {Date|undefined}
|
|
@@ -455,6 +445,7 @@ export default class BaseInput extends AuroElement {
|
|
|
455
445
|
inputElement: HTMLInputElement | null | undefined;
|
|
456
446
|
labelElement: HTMLLabelElement | null | undefined;
|
|
457
447
|
inputId: string | undefined;
|
|
448
|
+
format: any;
|
|
458
449
|
ValidityMessageOverride: any;
|
|
459
450
|
/**
|
|
460
451
|
* Patches the input element to dispatch an 'input' event whenever its value is set programmatically.
|
|
@@ -477,7 +468,6 @@ export default class BaseInput extends AuroElement {
|
|
|
477
468
|
* @returns {void}
|
|
478
469
|
*/
|
|
479
470
|
updated(changedProperties: Map<string, any>): void;
|
|
480
|
-
format: any;
|
|
481
471
|
skipNextProgrammaticInputEvent: boolean | undefined;
|
|
482
472
|
/**
|
|
483
473
|
* @private
|
|
@@ -600,4 +590,3 @@ export default class BaseInput extends AuroElement {
|
|
|
600
590
|
private matchInputValueToCreditCard;
|
|
601
591
|
}
|
|
602
592
|
import { AuroElement } from '../../layoutElement/src/auroElement.js';
|
|
603
|
-
import AuroFormValidation from '@aurodesignsystem/form-validation';
|
|
@@ -4383,15 +4383,17 @@ class AuroFormValidation {
|
|
|
4383
4383
|
);
|
|
4384
4384
|
}
|
|
4385
4385
|
|
|
4386
|
-
|
|
4387
|
-
|
|
4388
|
-
|
|
4386
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
4387
|
+
|
|
4388
|
+
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false.
|
|
4389
|
+
// Skip for combobox: its second auro-input is the fullscreen-bib mirror of the same value, not an independent
|
|
4390
|
+
// field (datepicker is the intended consumer — start/end are independently required).
|
|
4391
|
+
if (this.auroInputElements?.length === 2 && !isCombobox) {
|
|
4392
|
+
if (!this.auroInputElements[1].value || this.auroInputElements[1].value.length === 0) {
|
|
4389
4393
|
hasValue = false;
|
|
4390
4394
|
}
|
|
4391
4395
|
}
|
|
4392
4396
|
|
|
4393
|
-
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
4394
|
-
|
|
4395
4397
|
if (isCombobox) {
|
|
4396
4398
|
|
|
4397
4399
|
if (!elem.persistInput || elem.behavior === "filter") {
|
|
@@ -10327,6 +10329,13 @@ class AuroInputUtilities {
|
|
|
10327
10329
|
* @returns {string | undefined}
|
|
10328
10330
|
*/
|
|
10329
10331
|
toFormattedValue(valueObject, format) {
|
|
10332
|
+
// Exposed publicly via `AuroInputUtil.toFormattedValue`, so a missing
|
|
10333
|
+
// `format` argument has to fail gracefully rather than throw on
|
|
10334
|
+
// `format.toLowerCase()`. Treat any falsy value (undefined, null, '')
|
|
10335
|
+
// as "no format → no display value".
|
|
10336
|
+
if (!format) {
|
|
10337
|
+
return undefined;
|
|
10338
|
+
}
|
|
10330
10339
|
const normalizedFormat = format.toLowerCase();
|
|
10331
10340
|
const maskOptions = this.getMaskOptions('date', normalizedFormat);
|
|
10332
10341
|
|
|
@@ -10478,76 +10487,19 @@ class BaseInput extends AuroElement {
|
|
|
10478
10487
|
constructor() {
|
|
10479
10488
|
super();
|
|
10480
10489
|
|
|
10481
|
-
|
|
10482
|
-
|
|
10483
|
-
|
|
10484
|
-
|
|
10485
|
-
|
|
10486
|
-
|
|
10487
|
-
|
|
10488
|
-
|
|
10489
|
-
|
|
10490
|
-
|
|
10491
|
-
this.setCustomValidityForType = undefined;
|
|
10492
|
-
this.size = 'lg';
|
|
10493
|
-
this.shape = 'classic';
|
|
10494
|
-
this.value = undefined;
|
|
10495
|
-
|
|
10496
|
-
this._initializePrivateDefaults();
|
|
10497
|
-
}
|
|
10498
|
-
|
|
10499
|
-
/**
|
|
10500
|
-
* Internal Defaults.
|
|
10501
|
-
* @private
|
|
10502
|
-
* @returns {void}
|
|
10503
|
-
*/
|
|
10504
|
-
_initializePrivateDefaults() {
|
|
10490
|
+
// Single-source initialization. Alphabetized so duplicate or stale
|
|
10491
|
+
// defaults are immediately obvious on a diff. Every field is assigned
|
|
10492
|
+
// exactly once here (previously the constructor + the old
|
|
10493
|
+
// `_initializePrivateDefaults` overlapped — both wrote ~14 of the same
|
|
10494
|
+
// fields and double-allocated `util` and `validation`, discarding the
|
|
10495
|
+
// first instance). `validation` is now allocated exactly once; `util`
|
|
10496
|
+
// is seeded here with an en-US default and then rebuilt in
|
|
10497
|
+
// `connectedCallback` once the consumer-resolved locale is available,
|
|
10498
|
+
// so a parent (datepicker/combobox) calling `validate()` synchronously
|
|
10499
|
+
// during its own update cycle sees a populated util instance.
|
|
10505
10500
|
this.activeLabel = false;
|
|
10506
|
-
this.appearance = "default";
|
|
10507
|
-
this.icon = false;
|
|
10508
|
-
this.disabled = false;
|
|
10509
|
-
this.dvInputOnly = false;
|
|
10510
|
-
this.hideLabelVisually = false;
|
|
10511
|
-
this.max = undefined;
|
|
10512
|
-
this.maxLength = undefined;
|
|
10513
|
-
this.min = undefined;
|
|
10514
|
-
this.minLength = undefined;
|
|
10515
|
-
this.noValidate = false;
|
|
10516
|
-
this.onDark = false;
|
|
10517
|
-
this.required = false;
|
|
10518
|
-
this.setCustomValidityForType = undefined;
|
|
10519
|
-
|
|
10520
|
-
// Used for storing raw values returned from input mask.
|
|
10521
|
-
this._rawMaskValue = undefined;
|
|
10522
|
-
|
|
10523
|
-
/**
|
|
10524
|
-
* @private
|
|
10525
|
-
*/
|
|
10526
|
-
this.layout = 'classic';
|
|
10527
|
-
|
|
10528
|
-
/**
|
|
10529
|
-
* @private
|
|
10530
|
-
*/
|
|
10531
|
-
this.shape = 'classic';
|
|
10532
|
-
|
|
10533
|
-
/**
|
|
10534
|
-
* @private
|
|
10535
|
-
*/
|
|
10536
|
-
this.size = 'lg';
|
|
10537
|
-
|
|
10538
|
-
this.touched = false;
|
|
10539
|
-
this.util = new AuroInputUtilities({
|
|
10540
|
-
locale: "en-US",
|
|
10541
|
-
format: this.format
|
|
10542
|
-
});
|
|
10543
|
-
this.validation = new AuroFormValidation();
|
|
10544
|
-
this.inputIconName = undefined;
|
|
10545
|
-
this.showPassword = false;
|
|
10546
|
-
this.validationCCLength = undefined;
|
|
10547
|
-
this.hasValue = false;
|
|
10548
|
-
this.label = 'Input label is undefined';
|
|
10549
|
-
|
|
10550
10501
|
|
|
10502
|
+
/** @private */
|
|
10551
10503
|
this.allowedInputTypes = [
|
|
10552
10504
|
"text",
|
|
10553
10505
|
"number",
|
|
@@ -10556,7 +10508,9 @@ class BaseInput extends AuroElement {
|
|
|
10556
10508
|
"credit-card",
|
|
10557
10509
|
"tel"
|
|
10558
10510
|
];
|
|
10559
|
-
this.
|
|
10511
|
+
this.appearance = "default";
|
|
10512
|
+
|
|
10513
|
+
/** @private */
|
|
10560
10514
|
this.dateFormatMap = {
|
|
10561
10515
|
'mm/dd/yyyy': 'dateMMDDYYYY',
|
|
10562
10516
|
'dd/mm/yyyy': 'dateDDMMYYYY',
|
|
@@ -10573,27 +10527,62 @@ class BaseInput extends AuroElement {
|
|
|
10573
10527
|
'dd/mm': 'dateDDMM',
|
|
10574
10528
|
'mm/dd': 'dateMMDD'
|
|
10575
10529
|
};
|
|
10530
|
+
this.disabled = false;
|
|
10531
|
+
|
|
10532
|
+
/** @private */
|
|
10576
10533
|
this.domHandler = new DomHandler();
|
|
10577
10534
|
this.dvInputOnly = false;
|
|
10578
10535
|
this.hasValue = false;
|
|
10536
|
+
this.hideLabelVisually = false;
|
|
10537
|
+
this.icon = false;
|
|
10538
|
+
|
|
10539
|
+
/** @private */
|
|
10579
10540
|
this.inputIconName = undefined;
|
|
10541
|
+
|
|
10542
|
+
/** @private */
|
|
10580
10543
|
this.label = 'Input label is undefined';
|
|
10544
|
+
this.layout = 'classic';
|
|
10545
|
+
this.locale = 'en-US';
|
|
10546
|
+
this.max = undefined;
|
|
10547
|
+
this.maxLength = undefined;
|
|
10548
|
+
this.min = undefined;
|
|
10549
|
+
this.minLength = undefined;
|
|
10581
10550
|
this.noValidate = false;
|
|
10582
|
-
this.
|
|
10551
|
+
this.onDark = false;
|
|
10552
|
+
// Raw values returned from the input mask before model normalization.
|
|
10553
|
+
this._rawMaskValue = undefined;
|
|
10554
|
+
this.required = false;
|
|
10555
|
+
this.setCustomValidityForType = undefined;
|
|
10556
|
+
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
10557
|
+
// itself, and listing it here caused cursor placement issues in Safari.
|
|
10558
|
+
/** @private */
|
|
10583
10559
|
this.setSelectionInputTypes = [
|
|
10584
10560
|
"text",
|
|
10585
10561
|
"password",
|
|
10586
10562
|
"email"
|
|
10587
|
-
];
|
|
10563
|
+
];
|
|
10564
|
+
this.shape = 'classic';
|
|
10565
|
+
|
|
10566
|
+
/** @private */
|
|
10588
10567
|
this.showPassword = false;
|
|
10568
|
+
this.size = 'lg';
|
|
10589
10569
|
this.touched = false;
|
|
10570
|
+
|
|
10571
|
+
/** @private */
|
|
10590
10572
|
this.uniqueId = new UniqueId().create();
|
|
10573
|
+
|
|
10574
|
+
/** @private */
|
|
10591
10575
|
this.util = new AuroInputUtilities({
|
|
10592
10576
|
locale: this.locale,
|
|
10593
10577
|
format: this.format
|
|
10594
10578
|
});
|
|
10579
|
+
|
|
10580
|
+
/** @private */
|
|
10595
10581
|
this.validation = new AuroFormValidation();
|
|
10582
|
+
|
|
10583
|
+
/** @private */
|
|
10596
10584
|
this.validationCCLength = undefined;
|
|
10585
|
+
this.value = undefined;
|
|
10597
10586
|
}
|
|
10598
10587
|
|
|
10599
10588
|
// function to define props used within the scope of this component
|
|
@@ -11097,6 +11086,15 @@ class BaseInput extends AuroElement {
|
|
|
11097
11086
|
|
|
11098
11087
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11099
11088
|
|
|
11089
|
+
// Normalize the format token to lowercase so case-mixed values supplied
|
|
11090
|
+
// via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
|
|
11091
|
+
// lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
|
|
11092
|
+
// format silently misses the map and leaves `setCustomValidityForType`
|
|
11093
|
+
// unset.
|
|
11094
|
+
if (this.format) {
|
|
11095
|
+
this.format = this.format.toLowerCase();
|
|
11096
|
+
}
|
|
11097
|
+
|
|
11100
11098
|
// use validity message override if declared when initializing the component
|
|
11101
11099
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11102
11100
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11180,6 +11178,13 @@ class BaseInput extends AuroElement {
|
|
|
11180
11178
|
|
|
11181
11179
|
if (typeToI18n.includes(this.type)) {
|
|
11182
11180
|
this.setCustomValidityForType = i18n(this.lang, this.type);
|
|
11181
|
+
// COVERAGE: this `else if` branch is unreachable in WTR. connectedCallback
|
|
11182
|
+
// (L682) calls configureDataForType, which at L1266-1268 assigns
|
|
11183
|
+
// `this.format = this.util.getDateMaskFromLocale().toLowerCase()` for any
|
|
11184
|
+
// type=date input whose `format` attribute is unset. That runs before
|
|
11185
|
+
// firstUpdated invokes setCustomHelpTextMessage, so `!this.format` is
|
|
11186
|
+
// always false here. Retained as a defensive fallback; the whole function
|
|
11187
|
+
// is @deprecated per AB#1557296 and slated for removal.
|
|
11183
11188
|
} else if (!this.format && this.type === 'date') {
|
|
11184
11189
|
this.setCustomValidityForType = i18n(this.lang, 'dateMMDDYYYY');
|
|
11185
11190
|
} else if (this.dateFormatMap[this.format]) {
|
|
@@ -11469,6 +11474,38 @@ class BaseInput extends AuroElement {
|
|
|
11469
11474
|
this.touched = true;
|
|
11470
11475
|
this.validation.validate(this);
|
|
11471
11476
|
}
|
|
11477
|
+
|
|
11478
|
+
// Prevents cursor jumping in Safari. Setting `this.value` triggers a Lit
|
|
11479
|
+
// update that can re-render the input and reset the native cursor; we
|
|
11480
|
+
// capture the caret position before that update commits and restore it
|
|
11481
|
+
// via `setSelectionRange` once the update has flushed. Gated on
|
|
11482
|
+
// `setSelectionInputTypes` so credit-card (and other masked types whose
|
|
11483
|
+
// formatter manages the cursor itself) doesn't get a competing write.
|
|
11484
|
+
// Capture the caret position INSIDE the gate — reading `selectionStart`
|
|
11485
|
+
// on input types that don't support text selection (number, email in
|
|
11486
|
+
// some browsers) throws InvalidStateError, which would crash all input
|
|
11487
|
+
// handling. Wrap the read in try/catch belt-and-suspenders even though
|
|
11488
|
+
// the gated types currently support it, since the list is a public
|
|
11489
|
+
// property a consumer could mutate.
|
|
11490
|
+
if (this.setSelectionInputTypes.includes(this.type)) {
|
|
11491
|
+
let selectionStart = null;
|
|
11492
|
+
try {
|
|
11493
|
+
({ selectionStart } = this.inputElement);
|
|
11494
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11495
|
+
return;
|
|
11496
|
+
}
|
|
11497
|
+
if (typeof selectionStart !== 'number') {
|
|
11498
|
+
return;
|
|
11499
|
+
}
|
|
11500
|
+
this.updateComplete.then(() => {
|
|
11501
|
+
try {
|
|
11502
|
+
this.inputElement.setSelectionRange(selectionStart, selectionStart);
|
|
11503
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11504
|
+
// Some input types (number/email in certain UAs) throw on
|
|
11505
|
+
// setSelectionRange; swallow and let the native cursor stand.
|
|
11506
|
+
}
|
|
11507
|
+
});
|
|
11508
|
+
}
|
|
11472
11509
|
}
|
|
11473
11510
|
|
|
11474
11511
|
/**
|
|
@@ -11602,7 +11639,7 @@ class BaseInput extends AuroElement {
|
|
|
11602
11639
|
*/
|
|
11603
11640
|
get placeholderStr() {
|
|
11604
11641
|
if (!this.placeholder && this.type === 'date') {
|
|
11605
|
-
return this.format
|
|
11642
|
+
return this.format.toUpperCase();
|
|
11606
11643
|
}
|
|
11607
11644
|
return this.placeholder || "";
|
|
11608
11645
|
}
|
|
@@ -12093,7 +12130,7 @@ class AuroHelpText extends LitElement {
|
|
|
12093
12130
|
}
|
|
12094
12131
|
}
|
|
12095
12132
|
|
|
12096
|
-
var formkitVersion = '
|
|
12133
|
+
var formkitVersion = '202607010104';
|
|
12097
12134
|
|
|
12098
12135
|
// Copyright (c) 2025 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
|
|
12099
12136
|
// See LICENSE in the project root for license information.
|
|
@@ -12596,6 +12633,7 @@ class AuroInput extends BaseInput {
|
|
|
12596
12633
|
<${this.buttonTag}
|
|
12597
12634
|
@click="${this.handleClickShowPassword}"
|
|
12598
12635
|
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12636
|
+
aria-pressed="${this.showPassword ? 'true' : 'false'}"
|
|
12599
12637
|
class="notificationBtn passwordBtn"
|
|
12600
12638
|
shape="circle"
|
|
12601
12639
|
size="sm"
|
|
@@ -12669,25 +12707,29 @@ class AuroInput extends BaseInput {
|
|
|
12669
12707
|
* @returns {html} - Returns HTML for the help text and error message.
|
|
12670
12708
|
*/
|
|
12671
12709
|
renderHtmlHelpText() {
|
|
12710
|
+
// Single `<p>` with stable identity across validity transitions —
|
|
12711
|
+
// previously two distinct templates (valid vs invalid) caused Lit to
|
|
12712
|
+
// replace the node entirely on a flip, and VoiceOver wouldn't
|
|
12713
|
+
// re-announce because the live-region element it was watching had been
|
|
12714
|
+
// removed and a new one inserted. Keeping one node means the `role`,
|
|
12715
|
+
// `aria-live`, and text content all change in-place, which AT does
|
|
12716
|
+
// observe and announce.
|
|
12717
|
+
const isError = this.validity && this.validity !== 'valid';
|
|
12672
12718
|
return html$1`
|
|
12673
|
-
|
|
12674
|
-
?
|
|
12675
|
-
|
|
12676
|
-
|
|
12677
|
-
|
|
12678
|
-
|
|
12679
|
-
|
|
12680
|
-
|
|
12681
|
-
|
|
12682
|
-
|
|
12683
|
-
|
|
12684
|
-
appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
12685
|
-
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
12686
|
-
${this.errorMessage}
|
|
12687
|
-
</p>
|
|
12688
|
-
</${this.helpTextTag}>
|
|
12689
|
-
`
|
|
12719
|
+
<${this.helpTextTag}
|
|
12720
|
+
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12721
|
+
?error=${isError}>
|
|
12722
|
+
<p
|
|
12723
|
+
id="${this.uniqueId}"
|
|
12724
|
+
part="helpText"
|
|
12725
|
+
role="${ifDefined(isError ? 'alert' : undefined)}"
|
|
12726
|
+
aria-live="${ifDefined(isError ? 'assertive' : undefined)}">
|
|
12727
|
+
${isError
|
|
12728
|
+
? this.errorMessage
|
|
12729
|
+
: html$1`<slot name="helpText">${this.getHelpText()}</slot>`
|
|
12690
12730
|
}
|
|
12731
|
+
</p>
|
|
12732
|
+
</${this.helpTextTag}>
|
|
12691
12733
|
`;
|
|
12692
12734
|
}
|
|
12693
12735
|
|
|
@@ -12834,6 +12876,15 @@ function formatISODate(isoStr, format) {
|
|
|
12834
12876
|
try {
|
|
12835
12877
|
const date = dateFormatter.stringToDateInstance(isoStr);
|
|
12836
12878
|
|
|
12879
|
+
// `stringToDateInstance` returns an `Invalid Date` for malformed strings
|
|
12880
|
+
// and `null` for non-string input — it does NOT throw. Without this
|
|
12881
|
+
// guard, `getFullYear()`/`getMonth()`/`getDate()` on an Invalid Date
|
|
12882
|
+
// yield `NaN`, and `String(NaN).padStart(4, '0')` produces literals
|
|
12883
|
+
// like "0NaN/0NaN/0NaN" instead of `undefined`.
|
|
12884
|
+
if (!(date instanceof Date) || Number.isNaN(date.getTime())) {
|
|
12885
|
+
return undefined;
|
|
12886
|
+
}
|
|
12887
|
+
|
|
12837
12888
|
const year = String(date.getFullYear()).padStart(4, '0');
|
|
12838
12889
|
const month = String(date.getMonth() + 1).padStart(2, '0');
|
|
12839
12890
|
const day = String(date.getDate()).padStart(2, '0');
|
|
@@ -12844,7 +12895,10 @@ function formatISODate(isoStr, format) {
|
|
|
12844
12895
|
replace(/mm/iu, month).
|
|
12845
12896
|
replace(/dd/iu, day);
|
|
12846
12897
|
} catch (err) {
|
|
12847
|
-
//
|
|
12898
|
+
// Defensive: the Date-returning path is guarded above, but `parseDate`
|
|
12899
|
+
// (inside `stringToDateInstance`) could throw on pathological input
|
|
12900
|
+
// future-library-versions might introduce. Treat any thrown error as
|
|
12901
|
+
// "not a valid date" and return undefined.
|
|
12848
12902
|
return undefined;
|
|
12849
12903
|
}
|
|
12850
12904
|
}
|