@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
|
@@ -4441,15 +4441,17 @@ class AuroFormValidation {
|
|
|
4441
4441
|
);
|
|
4442
4442
|
}
|
|
4443
4443
|
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4444
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
4445
|
+
|
|
4446
|
+
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false.
|
|
4447
|
+
// Skip for combobox: its second auro-input is the fullscreen-bib mirror of the same value, not an independent
|
|
4448
|
+
// field (datepicker is the intended consumer — start/end are independently required).
|
|
4449
|
+
if (this.auroInputElements?.length === 2 && !isCombobox) {
|
|
4450
|
+
if (!this.auroInputElements[1].value || this.auroInputElements[1].value.length === 0) {
|
|
4447
4451
|
hasValue = false;
|
|
4448
4452
|
}
|
|
4449
4453
|
}
|
|
4450
4454
|
|
|
4451
|
-
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
4452
|
-
|
|
4453
4455
|
if (isCombobox) {
|
|
4454
4456
|
|
|
4455
4457
|
if (!elem.persistInput || elem.behavior === "filter") {
|
|
@@ -10385,6 +10387,13 @@ class AuroInputUtilities {
|
|
|
10385
10387
|
* @returns {string | undefined}
|
|
10386
10388
|
*/
|
|
10387
10389
|
toFormattedValue(valueObject, format) {
|
|
10390
|
+
// Exposed publicly via `AuroInputUtil.toFormattedValue`, so a missing
|
|
10391
|
+
// `format` argument has to fail gracefully rather than throw on
|
|
10392
|
+
// `format.toLowerCase()`. Treat any falsy value (undefined, null, '')
|
|
10393
|
+
// as "no format → no display value".
|
|
10394
|
+
if (!format) {
|
|
10395
|
+
return undefined;
|
|
10396
|
+
}
|
|
10388
10397
|
const normalizedFormat = format.toLowerCase();
|
|
10389
10398
|
const maskOptions = this.getMaskOptions('date', normalizedFormat);
|
|
10390
10399
|
|
|
@@ -10536,76 +10545,19 @@ class BaseInput extends AuroElement {
|
|
|
10536
10545
|
constructor() {
|
|
10537
10546
|
super();
|
|
10538
10547
|
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
this.setCustomValidityForType = undefined;
|
|
10550
|
-
this.size = 'lg';
|
|
10551
|
-
this.shape = 'classic';
|
|
10552
|
-
this.value = undefined;
|
|
10553
|
-
|
|
10554
|
-
this._initializePrivateDefaults();
|
|
10555
|
-
}
|
|
10556
|
-
|
|
10557
|
-
/**
|
|
10558
|
-
* Internal Defaults.
|
|
10559
|
-
* @private
|
|
10560
|
-
* @returns {void}
|
|
10561
|
-
*/
|
|
10562
|
-
_initializePrivateDefaults() {
|
|
10548
|
+
// Single-source initialization. Alphabetized so duplicate or stale
|
|
10549
|
+
// defaults are immediately obvious on a diff. Every field is assigned
|
|
10550
|
+
// exactly once here (previously the constructor + the old
|
|
10551
|
+
// `_initializePrivateDefaults` overlapped — both wrote ~14 of the same
|
|
10552
|
+
// fields and double-allocated `util` and `validation`, discarding the
|
|
10553
|
+
// first instance). `validation` is now allocated exactly once; `util`
|
|
10554
|
+
// is seeded here with an en-US default and then rebuilt in
|
|
10555
|
+
// `connectedCallback` once the consumer-resolved locale is available,
|
|
10556
|
+
// so a parent (datepicker/combobox) calling `validate()` synchronously
|
|
10557
|
+
// during its own update cycle sees a populated util instance.
|
|
10563
10558
|
this.activeLabel = false;
|
|
10564
|
-
this.appearance = "default";
|
|
10565
|
-
this.icon = false;
|
|
10566
|
-
this.disabled = false;
|
|
10567
|
-
this.dvInputOnly = false;
|
|
10568
|
-
this.hideLabelVisually = false;
|
|
10569
|
-
this.max = undefined;
|
|
10570
|
-
this.maxLength = undefined;
|
|
10571
|
-
this.min = undefined;
|
|
10572
|
-
this.minLength = undefined;
|
|
10573
|
-
this.noValidate = false;
|
|
10574
|
-
this.onDark = false;
|
|
10575
|
-
this.required = false;
|
|
10576
|
-
this.setCustomValidityForType = undefined;
|
|
10577
|
-
|
|
10578
|
-
// Used for storing raw values returned from input mask.
|
|
10579
|
-
this._rawMaskValue = undefined;
|
|
10580
|
-
|
|
10581
|
-
/**
|
|
10582
|
-
* @private
|
|
10583
|
-
*/
|
|
10584
|
-
this.layout = 'classic';
|
|
10585
|
-
|
|
10586
|
-
/**
|
|
10587
|
-
* @private
|
|
10588
|
-
*/
|
|
10589
|
-
this.shape = 'classic';
|
|
10590
|
-
|
|
10591
|
-
/**
|
|
10592
|
-
* @private
|
|
10593
|
-
*/
|
|
10594
|
-
this.size = 'lg';
|
|
10595
|
-
|
|
10596
|
-
this.touched = false;
|
|
10597
|
-
this.util = new AuroInputUtilities({
|
|
10598
|
-
locale: "en-US",
|
|
10599
|
-
format: this.format
|
|
10600
|
-
});
|
|
10601
|
-
this.validation = new AuroFormValidation();
|
|
10602
|
-
this.inputIconName = undefined;
|
|
10603
|
-
this.showPassword = false;
|
|
10604
|
-
this.validationCCLength = undefined;
|
|
10605
|
-
this.hasValue = false;
|
|
10606
|
-
this.label = 'Input label is undefined';
|
|
10607
|
-
|
|
10608
10559
|
|
|
10560
|
+
/** @private */
|
|
10609
10561
|
this.allowedInputTypes = [
|
|
10610
10562
|
"text",
|
|
10611
10563
|
"number",
|
|
@@ -10614,7 +10566,9 @@ class BaseInput extends AuroElement {
|
|
|
10614
10566
|
"credit-card",
|
|
10615
10567
|
"tel"
|
|
10616
10568
|
];
|
|
10617
|
-
this.
|
|
10569
|
+
this.appearance = "default";
|
|
10570
|
+
|
|
10571
|
+
/** @private */
|
|
10618
10572
|
this.dateFormatMap = {
|
|
10619
10573
|
'mm/dd/yyyy': 'dateMMDDYYYY',
|
|
10620
10574
|
'dd/mm/yyyy': 'dateDDMMYYYY',
|
|
@@ -10631,27 +10585,62 @@ class BaseInput extends AuroElement {
|
|
|
10631
10585
|
'dd/mm': 'dateDDMM',
|
|
10632
10586
|
'mm/dd': 'dateMMDD'
|
|
10633
10587
|
};
|
|
10588
|
+
this.disabled = false;
|
|
10589
|
+
|
|
10590
|
+
/** @private */
|
|
10634
10591
|
this.domHandler = new DomHandler();
|
|
10635
10592
|
this.dvInputOnly = false;
|
|
10636
10593
|
this.hasValue = false;
|
|
10594
|
+
this.hideLabelVisually = false;
|
|
10595
|
+
this.icon = false;
|
|
10596
|
+
|
|
10597
|
+
/** @private */
|
|
10637
10598
|
this.inputIconName = undefined;
|
|
10599
|
+
|
|
10600
|
+
/** @private */
|
|
10638
10601
|
this.label = 'Input label is undefined';
|
|
10602
|
+
this.layout = 'classic';
|
|
10603
|
+
this.locale = 'en-US';
|
|
10604
|
+
this.max = undefined;
|
|
10605
|
+
this.maxLength = undefined;
|
|
10606
|
+
this.min = undefined;
|
|
10607
|
+
this.minLength = undefined;
|
|
10639
10608
|
this.noValidate = false;
|
|
10640
|
-
this.
|
|
10609
|
+
this.onDark = false;
|
|
10610
|
+
// Raw values returned from the input mask before model normalization.
|
|
10611
|
+
this._rawMaskValue = undefined;
|
|
10612
|
+
this.required = false;
|
|
10613
|
+
this.setCustomValidityForType = undefined;
|
|
10614
|
+
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
10615
|
+
// itself, and listing it here caused cursor placement issues in Safari.
|
|
10616
|
+
/** @private */
|
|
10641
10617
|
this.setSelectionInputTypes = [
|
|
10642
10618
|
"text",
|
|
10643
10619
|
"password",
|
|
10644
10620
|
"email"
|
|
10645
|
-
];
|
|
10621
|
+
];
|
|
10622
|
+
this.shape = 'classic';
|
|
10623
|
+
|
|
10624
|
+
/** @private */
|
|
10646
10625
|
this.showPassword = false;
|
|
10626
|
+
this.size = 'lg';
|
|
10647
10627
|
this.touched = false;
|
|
10628
|
+
|
|
10629
|
+
/** @private */
|
|
10648
10630
|
this.uniqueId = new UniqueId().create();
|
|
10631
|
+
|
|
10632
|
+
/** @private */
|
|
10649
10633
|
this.util = new AuroInputUtilities({
|
|
10650
10634
|
locale: this.locale,
|
|
10651
10635
|
format: this.format
|
|
10652
10636
|
});
|
|
10637
|
+
|
|
10638
|
+
/** @private */
|
|
10653
10639
|
this.validation = new AuroFormValidation();
|
|
10640
|
+
|
|
10641
|
+
/** @private */
|
|
10654
10642
|
this.validationCCLength = undefined;
|
|
10643
|
+
this.value = undefined;
|
|
10655
10644
|
}
|
|
10656
10645
|
|
|
10657
10646
|
// function to define props used within the scope of this component
|
|
@@ -11155,6 +11144,15 @@ class BaseInput extends AuroElement {
|
|
|
11155
11144
|
|
|
11156
11145
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11157
11146
|
|
|
11147
|
+
// Normalize the format token to lowercase so case-mixed values supplied
|
|
11148
|
+
// via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
|
|
11149
|
+
// lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
|
|
11150
|
+
// format silently misses the map and leaves `setCustomValidityForType`
|
|
11151
|
+
// unset.
|
|
11152
|
+
if (this.format) {
|
|
11153
|
+
this.format = this.format.toLowerCase();
|
|
11154
|
+
}
|
|
11155
|
+
|
|
11158
11156
|
// use validity message override if declared when initializing the component
|
|
11159
11157
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11160
11158
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11238,6 +11236,13 @@ class BaseInput extends AuroElement {
|
|
|
11238
11236
|
|
|
11239
11237
|
if (typeToI18n.includes(this.type)) {
|
|
11240
11238
|
this.setCustomValidityForType = i18n(this.lang, this.type);
|
|
11239
|
+
// COVERAGE: this `else if` branch is unreachable in WTR. connectedCallback
|
|
11240
|
+
// (L682) calls configureDataForType, which at L1266-1268 assigns
|
|
11241
|
+
// `this.format = this.util.getDateMaskFromLocale().toLowerCase()` for any
|
|
11242
|
+
// type=date input whose `format` attribute is unset. That runs before
|
|
11243
|
+
// firstUpdated invokes setCustomHelpTextMessage, so `!this.format` is
|
|
11244
|
+
// always false here. Retained as a defensive fallback; the whole function
|
|
11245
|
+
// is @deprecated per AB#1557296 and slated for removal.
|
|
11241
11246
|
} else if (!this.format && this.type === 'date') {
|
|
11242
11247
|
this.setCustomValidityForType = i18n(this.lang, 'dateMMDDYYYY');
|
|
11243
11248
|
} else if (this.dateFormatMap[this.format]) {
|
|
@@ -11527,6 +11532,38 @@ class BaseInput extends AuroElement {
|
|
|
11527
11532
|
this.touched = true;
|
|
11528
11533
|
this.validation.validate(this);
|
|
11529
11534
|
}
|
|
11535
|
+
|
|
11536
|
+
// Prevents cursor jumping in Safari. Setting `this.value` triggers a Lit
|
|
11537
|
+
// update that can re-render the input and reset the native cursor; we
|
|
11538
|
+
// capture the caret position before that update commits and restore it
|
|
11539
|
+
// via `setSelectionRange` once the update has flushed. Gated on
|
|
11540
|
+
// `setSelectionInputTypes` so credit-card (and other masked types whose
|
|
11541
|
+
// formatter manages the cursor itself) doesn't get a competing write.
|
|
11542
|
+
// Capture the caret position INSIDE the gate — reading `selectionStart`
|
|
11543
|
+
// on input types that don't support text selection (number, email in
|
|
11544
|
+
// some browsers) throws InvalidStateError, which would crash all input
|
|
11545
|
+
// handling. Wrap the read in try/catch belt-and-suspenders even though
|
|
11546
|
+
// the gated types currently support it, since the list is a public
|
|
11547
|
+
// property a consumer could mutate.
|
|
11548
|
+
if (this.setSelectionInputTypes.includes(this.type)) {
|
|
11549
|
+
let selectionStart = null;
|
|
11550
|
+
try {
|
|
11551
|
+
({ selectionStart } = this.inputElement);
|
|
11552
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11553
|
+
return;
|
|
11554
|
+
}
|
|
11555
|
+
if (typeof selectionStart !== 'number') {
|
|
11556
|
+
return;
|
|
11557
|
+
}
|
|
11558
|
+
this.updateComplete.then(() => {
|
|
11559
|
+
try {
|
|
11560
|
+
this.inputElement.setSelectionRange(selectionStart, selectionStart);
|
|
11561
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11562
|
+
// Some input types (number/email in certain UAs) throw on
|
|
11563
|
+
// setSelectionRange; swallow and let the native cursor stand.
|
|
11564
|
+
}
|
|
11565
|
+
});
|
|
11566
|
+
}
|
|
11530
11567
|
}
|
|
11531
11568
|
|
|
11532
11569
|
/**
|
|
@@ -11660,7 +11697,7 @@ class BaseInput extends AuroElement {
|
|
|
11660
11697
|
*/
|
|
11661
11698
|
get placeholderStr() {
|
|
11662
11699
|
if (!this.placeholder && this.type === 'date') {
|
|
11663
|
-
return this.format
|
|
11700
|
+
return this.format.toUpperCase();
|
|
11664
11701
|
}
|
|
11665
11702
|
return this.placeholder || "";
|
|
11666
11703
|
}
|
|
@@ -12151,7 +12188,7 @@ class AuroHelpText extends i$3 {
|
|
|
12151
12188
|
}
|
|
12152
12189
|
}
|
|
12153
12190
|
|
|
12154
|
-
var formkitVersion = '
|
|
12191
|
+
var formkitVersion = '202607010104';
|
|
12155
12192
|
|
|
12156
12193
|
/**
|
|
12157
12194
|
* @license
|
|
@@ -12666,6 +12703,7 @@ class AuroInput extends BaseInput {
|
|
|
12666
12703
|
<${this.buttonTag}
|
|
12667
12704
|
@click="${this.handleClickShowPassword}"
|
|
12668
12705
|
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12706
|
+
aria-pressed="${this.showPassword ? 'true' : 'false'}"
|
|
12669
12707
|
class="notificationBtn passwordBtn"
|
|
12670
12708
|
shape="circle"
|
|
12671
12709
|
size="sm"
|
|
@@ -12739,25 +12777,29 @@ class AuroInput extends BaseInput {
|
|
|
12739
12777
|
* @returns {html} - Returns HTML for the help text and error message.
|
|
12740
12778
|
*/
|
|
12741
12779
|
renderHtmlHelpText() {
|
|
12780
|
+
// Single `<p>` with stable identity across validity transitions —
|
|
12781
|
+
// previously two distinct templates (valid vs invalid) caused Lit to
|
|
12782
|
+
// replace the node entirely on a flip, and VoiceOver wouldn't
|
|
12783
|
+
// re-announce because the live-region element it was watching had been
|
|
12784
|
+
// removed and a new one inserted. Keeping one node means the `role`,
|
|
12785
|
+
// `aria-live`, and text content all change in-place, which AT does
|
|
12786
|
+
// observe and announce.
|
|
12787
|
+
const isError = this.validity && this.validity !== 'valid';
|
|
12742
12788
|
return u$4`
|
|
12743
|
-
|
|
12744
|
-
?
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
|
|
12754
|
-
appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
12755
|
-
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
12756
|
-
${this.errorMessage}
|
|
12757
|
-
</p>
|
|
12758
|
-
</${this.helpTextTag}>
|
|
12759
|
-
`
|
|
12789
|
+
<${this.helpTextTag}
|
|
12790
|
+
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12791
|
+
?error=${isError}>
|
|
12792
|
+
<p
|
|
12793
|
+
id="${this.uniqueId}"
|
|
12794
|
+
part="helpText"
|
|
12795
|
+
role="${o$2(isError ? 'alert' : undefined)}"
|
|
12796
|
+
aria-live="${o$2(isError ? 'assertive' : undefined)}">
|
|
12797
|
+
${isError
|
|
12798
|
+
? this.errorMessage
|
|
12799
|
+
: u$4`<slot name="helpText">${this.getHelpText()}</slot>`
|
|
12760
12800
|
}
|
|
12801
|
+
</p>
|
|
12802
|
+
</${this.helpTextTag}>
|
|
12761
12803
|
`;
|
|
12762
12804
|
}
|
|
12763
12805
|
|
|
@@ -4441,15 +4441,17 @@ class AuroFormValidation {
|
|
|
4441
4441
|
);
|
|
4442
4442
|
}
|
|
4443
4443
|
|
|
4444
|
-
|
|
4445
|
-
|
|
4446
|
-
|
|
4444
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
4445
|
+
|
|
4446
|
+
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false.
|
|
4447
|
+
// Skip for combobox: its second auro-input is the fullscreen-bib mirror of the same value, not an independent
|
|
4448
|
+
// field (datepicker is the intended consumer — start/end are independently required).
|
|
4449
|
+
if (this.auroInputElements?.length === 2 && !isCombobox) {
|
|
4450
|
+
if (!this.auroInputElements[1].value || this.auroInputElements[1].value.length === 0) {
|
|
4447
4451
|
hasValue = false;
|
|
4448
4452
|
}
|
|
4449
4453
|
}
|
|
4450
4454
|
|
|
4451
|
-
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
4452
|
-
|
|
4453
4455
|
if (isCombobox) {
|
|
4454
4456
|
|
|
4455
4457
|
if (!elem.persistInput || elem.behavior === "filter") {
|
|
@@ -10385,6 +10387,13 @@ class AuroInputUtilities {
|
|
|
10385
10387
|
* @returns {string | undefined}
|
|
10386
10388
|
*/
|
|
10387
10389
|
toFormattedValue(valueObject, format) {
|
|
10390
|
+
// Exposed publicly via `AuroInputUtil.toFormattedValue`, so a missing
|
|
10391
|
+
// `format` argument has to fail gracefully rather than throw on
|
|
10392
|
+
// `format.toLowerCase()`. Treat any falsy value (undefined, null, '')
|
|
10393
|
+
// as "no format → no display value".
|
|
10394
|
+
if (!format) {
|
|
10395
|
+
return undefined;
|
|
10396
|
+
}
|
|
10388
10397
|
const normalizedFormat = format.toLowerCase();
|
|
10389
10398
|
const maskOptions = this.getMaskOptions('date', normalizedFormat);
|
|
10390
10399
|
|
|
@@ -10536,76 +10545,19 @@ class BaseInput extends AuroElement {
|
|
|
10536
10545
|
constructor() {
|
|
10537
10546
|
super();
|
|
10538
10547
|
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
|
|
10549
|
-
this.setCustomValidityForType = undefined;
|
|
10550
|
-
this.size = 'lg';
|
|
10551
|
-
this.shape = 'classic';
|
|
10552
|
-
this.value = undefined;
|
|
10553
|
-
|
|
10554
|
-
this._initializePrivateDefaults();
|
|
10555
|
-
}
|
|
10556
|
-
|
|
10557
|
-
/**
|
|
10558
|
-
* Internal Defaults.
|
|
10559
|
-
* @private
|
|
10560
|
-
* @returns {void}
|
|
10561
|
-
*/
|
|
10562
|
-
_initializePrivateDefaults() {
|
|
10548
|
+
// Single-source initialization. Alphabetized so duplicate or stale
|
|
10549
|
+
// defaults are immediately obvious on a diff. Every field is assigned
|
|
10550
|
+
// exactly once here (previously the constructor + the old
|
|
10551
|
+
// `_initializePrivateDefaults` overlapped — both wrote ~14 of the same
|
|
10552
|
+
// fields and double-allocated `util` and `validation`, discarding the
|
|
10553
|
+
// first instance). `validation` is now allocated exactly once; `util`
|
|
10554
|
+
// is seeded here with an en-US default and then rebuilt in
|
|
10555
|
+
// `connectedCallback` once the consumer-resolved locale is available,
|
|
10556
|
+
// so a parent (datepicker/combobox) calling `validate()` synchronously
|
|
10557
|
+
// during its own update cycle sees a populated util instance.
|
|
10563
10558
|
this.activeLabel = false;
|
|
10564
|
-
this.appearance = "default";
|
|
10565
|
-
this.icon = false;
|
|
10566
|
-
this.disabled = false;
|
|
10567
|
-
this.dvInputOnly = false;
|
|
10568
|
-
this.hideLabelVisually = false;
|
|
10569
|
-
this.max = undefined;
|
|
10570
|
-
this.maxLength = undefined;
|
|
10571
|
-
this.min = undefined;
|
|
10572
|
-
this.minLength = undefined;
|
|
10573
|
-
this.noValidate = false;
|
|
10574
|
-
this.onDark = false;
|
|
10575
|
-
this.required = false;
|
|
10576
|
-
this.setCustomValidityForType = undefined;
|
|
10577
|
-
|
|
10578
|
-
// Used for storing raw values returned from input mask.
|
|
10579
|
-
this._rawMaskValue = undefined;
|
|
10580
|
-
|
|
10581
|
-
/**
|
|
10582
|
-
* @private
|
|
10583
|
-
*/
|
|
10584
|
-
this.layout = 'classic';
|
|
10585
|
-
|
|
10586
|
-
/**
|
|
10587
|
-
* @private
|
|
10588
|
-
*/
|
|
10589
|
-
this.shape = 'classic';
|
|
10590
|
-
|
|
10591
|
-
/**
|
|
10592
|
-
* @private
|
|
10593
|
-
*/
|
|
10594
|
-
this.size = 'lg';
|
|
10595
|
-
|
|
10596
|
-
this.touched = false;
|
|
10597
|
-
this.util = new AuroInputUtilities({
|
|
10598
|
-
locale: "en-US",
|
|
10599
|
-
format: this.format
|
|
10600
|
-
});
|
|
10601
|
-
this.validation = new AuroFormValidation();
|
|
10602
|
-
this.inputIconName = undefined;
|
|
10603
|
-
this.showPassword = false;
|
|
10604
|
-
this.validationCCLength = undefined;
|
|
10605
|
-
this.hasValue = false;
|
|
10606
|
-
this.label = 'Input label is undefined';
|
|
10607
|
-
|
|
10608
10559
|
|
|
10560
|
+
/** @private */
|
|
10609
10561
|
this.allowedInputTypes = [
|
|
10610
10562
|
"text",
|
|
10611
10563
|
"number",
|
|
@@ -10614,7 +10566,9 @@ class BaseInput extends AuroElement {
|
|
|
10614
10566
|
"credit-card",
|
|
10615
10567
|
"tel"
|
|
10616
10568
|
];
|
|
10617
|
-
this.
|
|
10569
|
+
this.appearance = "default";
|
|
10570
|
+
|
|
10571
|
+
/** @private */
|
|
10618
10572
|
this.dateFormatMap = {
|
|
10619
10573
|
'mm/dd/yyyy': 'dateMMDDYYYY',
|
|
10620
10574
|
'dd/mm/yyyy': 'dateDDMMYYYY',
|
|
@@ -10631,27 +10585,62 @@ class BaseInput extends AuroElement {
|
|
|
10631
10585
|
'dd/mm': 'dateDDMM',
|
|
10632
10586
|
'mm/dd': 'dateMMDD'
|
|
10633
10587
|
};
|
|
10588
|
+
this.disabled = false;
|
|
10589
|
+
|
|
10590
|
+
/** @private */
|
|
10634
10591
|
this.domHandler = new DomHandler();
|
|
10635
10592
|
this.dvInputOnly = false;
|
|
10636
10593
|
this.hasValue = false;
|
|
10594
|
+
this.hideLabelVisually = false;
|
|
10595
|
+
this.icon = false;
|
|
10596
|
+
|
|
10597
|
+
/** @private */
|
|
10637
10598
|
this.inputIconName = undefined;
|
|
10599
|
+
|
|
10600
|
+
/** @private */
|
|
10638
10601
|
this.label = 'Input label is undefined';
|
|
10602
|
+
this.layout = 'classic';
|
|
10603
|
+
this.locale = 'en-US';
|
|
10604
|
+
this.max = undefined;
|
|
10605
|
+
this.maxLength = undefined;
|
|
10606
|
+
this.min = undefined;
|
|
10607
|
+
this.minLength = undefined;
|
|
10639
10608
|
this.noValidate = false;
|
|
10640
|
-
this.
|
|
10609
|
+
this.onDark = false;
|
|
10610
|
+
// Raw values returned from the input mask before model normalization.
|
|
10611
|
+
this._rawMaskValue = undefined;
|
|
10612
|
+
this.required = false;
|
|
10613
|
+
this.setCustomValidityForType = undefined;
|
|
10614
|
+
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
10615
|
+
// itself, and listing it here caused cursor placement issues in Safari.
|
|
10616
|
+
/** @private */
|
|
10641
10617
|
this.setSelectionInputTypes = [
|
|
10642
10618
|
"text",
|
|
10643
10619
|
"password",
|
|
10644
10620
|
"email"
|
|
10645
|
-
];
|
|
10621
|
+
];
|
|
10622
|
+
this.shape = 'classic';
|
|
10623
|
+
|
|
10624
|
+
/** @private */
|
|
10646
10625
|
this.showPassword = false;
|
|
10626
|
+
this.size = 'lg';
|
|
10647
10627
|
this.touched = false;
|
|
10628
|
+
|
|
10629
|
+
/** @private */
|
|
10648
10630
|
this.uniqueId = new UniqueId().create();
|
|
10631
|
+
|
|
10632
|
+
/** @private */
|
|
10649
10633
|
this.util = new AuroInputUtilities({
|
|
10650
10634
|
locale: this.locale,
|
|
10651
10635
|
format: this.format
|
|
10652
10636
|
});
|
|
10637
|
+
|
|
10638
|
+
/** @private */
|
|
10653
10639
|
this.validation = new AuroFormValidation();
|
|
10640
|
+
|
|
10641
|
+
/** @private */
|
|
10654
10642
|
this.validationCCLength = undefined;
|
|
10643
|
+
this.value = undefined;
|
|
10655
10644
|
}
|
|
10656
10645
|
|
|
10657
10646
|
// function to define props used within the scope of this component
|
|
@@ -11155,6 +11144,15 @@ class BaseInput extends AuroElement {
|
|
|
11155
11144
|
|
|
11156
11145
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11157
11146
|
|
|
11147
|
+
// Normalize the format token to lowercase so case-mixed values supplied
|
|
11148
|
+
// via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
|
|
11149
|
+
// lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
|
|
11150
|
+
// format silently misses the map and leaves `setCustomValidityForType`
|
|
11151
|
+
// unset.
|
|
11152
|
+
if (this.format) {
|
|
11153
|
+
this.format = this.format.toLowerCase();
|
|
11154
|
+
}
|
|
11155
|
+
|
|
11158
11156
|
// use validity message override if declared when initializing the component
|
|
11159
11157
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11160
11158
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11238,6 +11236,13 @@ class BaseInput extends AuroElement {
|
|
|
11238
11236
|
|
|
11239
11237
|
if (typeToI18n.includes(this.type)) {
|
|
11240
11238
|
this.setCustomValidityForType = i18n(this.lang, this.type);
|
|
11239
|
+
// COVERAGE: this `else if` branch is unreachable in WTR. connectedCallback
|
|
11240
|
+
// (L682) calls configureDataForType, which at L1266-1268 assigns
|
|
11241
|
+
// `this.format = this.util.getDateMaskFromLocale().toLowerCase()` for any
|
|
11242
|
+
// type=date input whose `format` attribute is unset. That runs before
|
|
11243
|
+
// firstUpdated invokes setCustomHelpTextMessage, so `!this.format` is
|
|
11244
|
+
// always false here. Retained as a defensive fallback; the whole function
|
|
11245
|
+
// is @deprecated per AB#1557296 and slated for removal.
|
|
11241
11246
|
} else if (!this.format && this.type === 'date') {
|
|
11242
11247
|
this.setCustomValidityForType = i18n(this.lang, 'dateMMDDYYYY');
|
|
11243
11248
|
} else if (this.dateFormatMap[this.format]) {
|
|
@@ -11527,6 +11532,38 @@ class BaseInput extends AuroElement {
|
|
|
11527
11532
|
this.touched = true;
|
|
11528
11533
|
this.validation.validate(this);
|
|
11529
11534
|
}
|
|
11535
|
+
|
|
11536
|
+
// Prevents cursor jumping in Safari. Setting `this.value` triggers a Lit
|
|
11537
|
+
// update that can re-render the input and reset the native cursor; we
|
|
11538
|
+
// capture the caret position before that update commits and restore it
|
|
11539
|
+
// via `setSelectionRange` once the update has flushed. Gated on
|
|
11540
|
+
// `setSelectionInputTypes` so credit-card (and other masked types whose
|
|
11541
|
+
// formatter manages the cursor itself) doesn't get a competing write.
|
|
11542
|
+
// Capture the caret position INSIDE the gate — reading `selectionStart`
|
|
11543
|
+
// on input types that don't support text selection (number, email in
|
|
11544
|
+
// some browsers) throws InvalidStateError, which would crash all input
|
|
11545
|
+
// handling. Wrap the read in try/catch belt-and-suspenders even though
|
|
11546
|
+
// the gated types currently support it, since the list is a public
|
|
11547
|
+
// property a consumer could mutate.
|
|
11548
|
+
if (this.setSelectionInputTypes.includes(this.type)) {
|
|
11549
|
+
let selectionStart = null;
|
|
11550
|
+
try {
|
|
11551
|
+
({ selectionStart } = this.inputElement);
|
|
11552
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11553
|
+
return;
|
|
11554
|
+
}
|
|
11555
|
+
if (typeof selectionStart !== 'number') {
|
|
11556
|
+
return;
|
|
11557
|
+
}
|
|
11558
|
+
this.updateComplete.then(() => {
|
|
11559
|
+
try {
|
|
11560
|
+
this.inputElement.setSelectionRange(selectionStart, selectionStart);
|
|
11561
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11562
|
+
// Some input types (number/email in certain UAs) throw on
|
|
11563
|
+
// setSelectionRange; swallow and let the native cursor stand.
|
|
11564
|
+
}
|
|
11565
|
+
});
|
|
11566
|
+
}
|
|
11530
11567
|
}
|
|
11531
11568
|
|
|
11532
11569
|
/**
|
|
@@ -11660,7 +11697,7 @@ class BaseInput extends AuroElement {
|
|
|
11660
11697
|
*/
|
|
11661
11698
|
get placeholderStr() {
|
|
11662
11699
|
if (!this.placeholder && this.type === 'date') {
|
|
11663
|
-
return this.format
|
|
11700
|
+
return this.format.toUpperCase();
|
|
11664
11701
|
}
|
|
11665
11702
|
return this.placeholder || "";
|
|
11666
11703
|
}
|
|
@@ -12151,7 +12188,7 @@ class AuroHelpText extends i$3 {
|
|
|
12151
12188
|
}
|
|
12152
12189
|
}
|
|
12153
12190
|
|
|
12154
|
-
var formkitVersion = '
|
|
12191
|
+
var formkitVersion = '202607010104';
|
|
12155
12192
|
|
|
12156
12193
|
/**
|
|
12157
12194
|
* @license
|
|
@@ -12666,6 +12703,7 @@ class AuroInput extends BaseInput {
|
|
|
12666
12703
|
<${this.buttonTag}
|
|
12667
12704
|
@click="${this.handleClickShowPassword}"
|
|
12668
12705
|
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12706
|
+
aria-pressed="${this.showPassword ? 'true' : 'false'}"
|
|
12669
12707
|
class="notificationBtn passwordBtn"
|
|
12670
12708
|
shape="circle"
|
|
12671
12709
|
size="sm"
|
|
@@ -12739,25 +12777,29 @@ class AuroInput extends BaseInput {
|
|
|
12739
12777
|
* @returns {html} - Returns HTML for the help text and error message.
|
|
12740
12778
|
*/
|
|
12741
12779
|
renderHtmlHelpText() {
|
|
12780
|
+
// Single `<p>` with stable identity across validity transitions —
|
|
12781
|
+
// previously two distinct templates (valid vs invalid) caused Lit to
|
|
12782
|
+
// replace the node entirely on a flip, and VoiceOver wouldn't
|
|
12783
|
+
// re-announce because the live-region element it was watching had been
|
|
12784
|
+
// removed and a new one inserted. Keeping one node means the `role`,
|
|
12785
|
+
// `aria-live`, and text content all change in-place, which AT does
|
|
12786
|
+
// observe and announce.
|
|
12787
|
+
const isError = this.validity && this.validity !== 'valid';
|
|
12742
12788
|
return u$4`
|
|
12743
|
-
|
|
12744
|
-
?
|
|
12745
|
-
|
|
12746
|
-
|
|
12747
|
-
|
|
12748
|
-
|
|
12749
|
-
|
|
12750
|
-
|
|
12751
|
-
|
|
12752
|
-
|
|
12753
|
-
|
|
12754
|
-
appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
12755
|
-
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
12756
|
-
${this.errorMessage}
|
|
12757
|
-
</p>
|
|
12758
|
-
</${this.helpTextTag}>
|
|
12759
|
-
`
|
|
12789
|
+
<${this.helpTextTag}
|
|
12790
|
+
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12791
|
+
?error=${isError}>
|
|
12792
|
+
<p
|
|
12793
|
+
id="${this.uniqueId}"
|
|
12794
|
+
part="helpText"
|
|
12795
|
+
role="${o$2(isError ? 'alert' : undefined)}"
|
|
12796
|
+
aria-live="${o$2(isError ? 'assertive' : undefined)}">
|
|
12797
|
+
${isError
|
|
12798
|
+
? this.errorMessage
|
|
12799
|
+
: u$4`<slot name="helpText">${this.getHelpText()}</slot>`
|
|
12760
12800
|
}
|
|
12801
|
+
</p>
|
|
12802
|
+
</${this.helpTextTag}>
|
|
12761
12803
|
`;
|
|
12762
12804
|
}
|
|
12763
12805
|
|