@aurodesignsystem-dev/auro-formkit 0.0.0-pr1515.0 → 0.0.0-pr1515.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/checkbox/demo/customize.min.js +1 -1
- package/components/checkbox/demo/getting-started.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/customize.min.js +119 -96
- package/components/combobox/demo/getting-started.min.js +119 -96
- package/components/combobox/demo/index.min.js +119 -96
- package/components/combobox/dist/index.js +118 -95
- package/components/combobox/dist/registered.js +118 -95
- package/components/counter/demo/customize.min.js +2 -2
- package/components/counter/demo/index.min.js +2 -2
- package/components/counter/dist/index.js +2 -2
- package/components/counter/dist/registered.js +2 -2
- package/components/datepicker/demo/customize.min.js +139 -97
- package/components/datepicker/demo/index.min.js +139 -97
- package/components/datepicker/dist/index.js +139 -97
- package/components/datepicker/dist/registered.js +139 -97
- package/components/dropdown/demo/customize.min.js +1 -1
- package/components/dropdown/demo/getting-started.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/form/demo/customize.min.js +381 -293
- package/components/form/demo/getting-started.min.js +381 -293
- package/components/form/demo/index.min.js +381 -293
- package/components/form/demo/registerDemoDeps.min.js +381 -293
- package/components/input/demo/api.md +5 -5
- package/components/input/demo/customize.md +8 -8
- package/components/input/demo/customize.min.js +116 -93
- package/components/input/demo/getting-started.min.js +116 -93
- package/components/input/demo/index.min.js +116 -93
- package/components/input/dist/base-input.d.ts +33 -44
- package/components/input/dist/index.js +129 -94
- package/components/input/dist/registered.js +116 -93
- package/components/radio/demo/customize.min.js +1 -1
- package/components/radio/demo/getting-started.min.js +1 -1
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/customize.md +1 -1
- package/components/select/demo/index.min.js +2 -2
- package/components/select/dist/index.js +2 -2
- package/components/select/dist/registered.js +2 -2
- package/custom-elements.json +1944 -1734
- package/package.json +1 -1
- package/components/select/demo/customize.min.js +0 -10170
- package/components/select/demo/demo-support.min.js +0 -55807
- package/components/select/demo/getting-started.min.js +0 -10214
|
@@ -10385,6 +10385,13 @@ class AuroInputUtilities {
|
|
|
10385
10385
|
* @returns {string | undefined}
|
|
10386
10386
|
*/
|
|
10387
10387
|
toFormattedValue(valueObject, format) {
|
|
10388
|
+
// Exposed publicly via `AuroInputUtil.toFormattedValue`, so a missing
|
|
10389
|
+
// `format` argument has to fail gracefully rather than throw on
|
|
10390
|
+
// `format.toLowerCase()`. Treat any falsy value (undefined, null, '')
|
|
10391
|
+
// as "no format → no display value".
|
|
10392
|
+
if (!format) {
|
|
10393
|
+
return undefined;
|
|
10394
|
+
}
|
|
10388
10395
|
const normalizedFormat = format.toLowerCase();
|
|
10389
10396
|
const maskOptions = this.getMaskOptions('date', normalizedFormat);
|
|
10390
10397
|
|
|
@@ -10535,79 +10542,18 @@ class BaseInput extends AuroElement {
|
|
|
10535
10542
|
constructor() {
|
|
10536
10543
|
super();
|
|
10537
10544
|
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
this.required = false;
|
|
10549
|
-
this.onDark = false;
|
|
10550
|
-
this.setCustomValidityForType = undefined;
|
|
10551
|
-
this.size = 'lg';
|
|
10552
|
-
this.shape = 'classic';
|
|
10553
|
-
this.value = undefined;
|
|
10554
|
-
this._valueObject = undefined;
|
|
10555
|
-
|
|
10556
|
-
this._initializePrivateDefaults();
|
|
10557
|
-
}
|
|
10558
|
-
|
|
10559
|
-
/**
|
|
10560
|
-
* Internal Defaults.
|
|
10561
|
-
* @private
|
|
10562
|
-
* @returns {void}
|
|
10563
|
-
*/
|
|
10564
|
-
_initializePrivateDefaults() {
|
|
10545
|
+
// Single-source initialization. Alphabetized so duplicate or stale
|
|
10546
|
+
// defaults are immediately obvious on a diff. Every field is assigned
|
|
10547
|
+
// exactly once here (previously the constructor + the old
|
|
10548
|
+
// `_initializePrivateDefaults` overlapped — both wrote ~14 of the same
|
|
10549
|
+
// fields and double-allocated `util` and `validation`, discarding the
|
|
10550
|
+
// first instance). `validation` is now allocated exactly once; `util`
|
|
10551
|
+
// is seeded here with an en-US default and then rebuilt in
|
|
10552
|
+
// `connectedCallback` once the consumer-resolved locale is available,
|
|
10553
|
+
// so a parent (datepicker/combobox) calling `validate()` synchronously
|
|
10554
|
+
// during its own update cycle sees a populated util instance.
|
|
10565
10555
|
this.activeLabel = false;
|
|
10566
|
-
|
|
10567
|
-
this.icon = false;
|
|
10568
|
-
this.disabled = false;
|
|
10569
|
-
this.dvInputOnly = false;
|
|
10570
|
-
this.hideLabelVisually = false;
|
|
10571
|
-
this.max = undefined;
|
|
10572
|
-
this.maxLength = undefined;
|
|
10573
|
-
this.min = undefined;
|
|
10574
|
-
this.minLength = undefined;
|
|
10575
|
-
this.noValidate = false;
|
|
10576
|
-
this.onDark = false;
|
|
10577
|
-
this.required = false;
|
|
10578
|
-
this.setCustomValidityForType = undefined;
|
|
10579
|
-
|
|
10580
|
-
// Used for storing raw values returned from input mask.
|
|
10581
|
-
this._rawMaskValue = undefined;
|
|
10582
|
-
|
|
10583
|
-
/**
|
|
10584
|
-
* @private
|
|
10585
|
-
*/
|
|
10586
|
-
this.layout = 'classic';
|
|
10587
|
-
|
|
10588
|
-
/**
|
|
10589
|
-
* @private
|
|
10590
|
-
*/
|
|
10591
|
-
this.shape = 'classic';
|
|
10592
|
-
|
|
10593
|
-
/**
|
|
10594
|
-
* @private
|
|
10595
|
-
*/
|
|
10596
|
-
this.size = 'lg';
|
|
10597
|
-
|
|
10598
|
-
this.touched = false;
|
|
10599
|
-
this.util = new AuroInputUtilities({
|
|
10600
|
-
locale: "en-US",
|
|
10601
|
-
format: this.format
|
|
10602
|
-
});
|
|
10603
|
-
this.validation = new AuroFormValidation();
|
|
10604
|
-
this.inputIconName = undefined;
|
|
10605
|
-
this.showPassword = false;
|
|
10606
|
-
this.validationCCLength = undefined;
|
|
10607
|
-
this.hasValue = false;
|
|
10608
|
-
this.label = 'Input label is undefined';
|
|
10609
|
-
|
|
10610
|
-
|
|
10556
|
+
/** @private */
|
|
10611
10557
|
this.allowedInputTypes = [
|
|
10612
10558
|
"text",
|
|
10613
10559
|
"number",
|
|
@@ -10616,7 +10562,8 @@ class BaseInput extends AuroElement {
|
|
|
10616
10562
|
"credit-card",
|
|
10617
10563
|
"tel"
|
|
10618
10564
|
];
|
|
10619
|
-
this.
|
|
10565
|
+
this.appearance = "default";
|
|
10566
|
+
/** @private */
|
|
10620
10567
|
this.dateFormatMap = {
|
|
10621
10568
|
'mm/dd/yyyy': 'dateMMDDYYYY',
|
|
10622
10569
|
'dd/mm/yyyy': 'dateDDMMYYYY',
|
|
@@ -10633,27 +10580,57 @@ class BaseInput extends AuroElement {
|
|
|
10633
10580
|
'dd/mm': 'dateDDMM',
|
|
10634
10581
|
'mm/dd': 'dateMMDD'
|
|
10635
10582
|
};
|
|
10583
|
+
this.disabled = false;
|
|
10584
|
+
/** @private */
|
|
10636
10585
|
this.domHandler = new DomHandler();
|
|
10637
10586
|
this.dvInputOnly = false;
|
|
10638
10587
|
this.hasValue = false;
|
|
10588
|
+
this.hideLabelVisually = false;
|
|
10589
|
+
this.icon = false;
|
|
10590
|
+
/** @private */
|
|
10639
10591
|
this.inputIconName = undefined;
|
|
10592
|
+
/** @private */
|
|
10640
10593
|
this.label = 'Input label is undefined';
|
|
10594
|
+
this.layout = 'classic';
|
|
10595
|
+
this.locale = 'en-US';
|
|
10596
|
+
this.max = undefined;
|
|
10597
|
+
this._maxObject = undefined;
|
|
10598
|
+
this.maxLength = undefined;
|
|
10599
|
+
this.min = undefined;
|
|
10600
|
+
this._minObject = undefined;
|
|
10601
|
+
this.minLength = undefined;
|
|
10641
10602
|
this.noValidate = false;
|
|
10642
|
-
this.
|
|
10603
|
+
this.onDark = false;
|
|
10604
|
+
// Raw values returned from the input mask before model normalization.
|
|
10605
|
+
this._rawMaskValue = undefined;
|
|
10606
|
+
this.required = false;
|
|
10607
|
+
this.setCustomValidityForType = undefined;
|
|
10608
|
+
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
10609
|
+
// itself, and listing it here caused cursor placement issues in Safari.
|
|
10610
|
+
/** @private */
|
|
10643
10611
|
this.setSelectionInputTypes = [
|
|
10644
10612
|
"text",
|
|
10645
10613
|
"password",
|
|
10646
10614
|
"email"
|
|
10647
|
-
];
|
|
10615
|
+
];
|
|
10616
|
+
this.shape = 'classic';
|
|
10617
|
+
/** @private */
|
|
10648
10618
|
this.showPassword = false;
|
|
10619
|
+
this.size = 'lg';
|
|
10649
10620
|
this.touched = false;
|
|
10621
|
+
/** @private */
|
|
10650
10622
|
this.uniqueId = new UniqueId().create();
|
|
10623
|
+
/** @private */
|
|
10651
10624
|
this.util = new AuroInputUtilities({
|
|
10652
10625
|
locale: this.locale,
|
|
10653
10626
|
format: this.format
|
|
10654
10627
|
});
|
|
10628
|
+
/** @private */
|
|
10655
10629
|
this.validation = new AuroFormValidation();
|
|
10630
|
+
/** @private */
|
|
10656
10631
|
this.validationCCLength = undefined;
|
|
10632
|
+
this.value = undefined;
|
|
10633
|
+
this._valueObject = undefined;
|
|
10657
10634
|
}
|
|
10658
10635
|
|
|
10659
10636
|
// function to define props used within the scope of this component
|
|
@@ -11201,6 +11178,15 @@ class BaseInput extends AuroElement {
|
|
|
11201
11178
|
|
|
11202
11179
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11203
11180
|
|
|
11181
|
+
// Normalize the format token to lowercase so case-mixed values supplied
|
|
11182
|
+
// via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
|
|
11183
|
+
// lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
|
|
11184
|
+
// format silently misses the map and leaves `setCustomValidityForType`
|
|
11185
|
+
// unset.
|
|
11186
|
+
if (this.format) {
|
|
11187
|
+
this.format = this.format.toLowerCase();
|
|
11188
|
+
}
|
|
11189
|
+
|
|
11204
11190
|
// use validity message override if declared when initializing the component
|
|
11205
11191
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11206
11192
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11634,6 +11620,38 @@ class BaseInput extends AuroElement {
|
|
|
11634
11620
|
this.touched = true;
|
|
11635
11621
|
this.validation.validate(this);
|
|
11636
11622
|
}
|
|
11623
|
+
|
|
11624
|
+
// Prevents cursor jumping in Safari. Setting `this.value` triggers a Lit
|
|
11625
|
+
// update that can re-render the input and reset the native cursor; we
|
|
11626
|
+
// capture the caret position before that update commits and restore it
|
|
11627
|
+
// via `setSelectionRange` once the update has flushed. Gated on
|
|
11628
|
+
// `setSelectionInputTypes` so credit-card (and other masked types whose
|
|
11629
|
+
// formatter manages the cursor itself) doesn't get a competing write.
|
|
11630
|
+
// Capture the caret position INSIDE the gate — reading `selectionStart`
|
|
11631
|
+
// on input types that don't support text selection (number, email in
|
|
11632
|
+
// some browsers) throws InvalidStateError, which would crash all input
|
|
11633
|
+
// handling. Wrap the read in try/catch belt-and-suspenders even though
|
|
11634
|
+
// the gated types currently support it, since the list is a public
|
|
11635
|
+
// property a consumer could mutate.
|
|
11636
|
+
if (this.setSelectionInputTypes.includes(this.type)) {
|
|
11637
|
+
let selectionStart;
|
|
11638
|
+
try {
|
|
11639
|
+
selectionStart = this.inputElement.selectionStart;
|
|
11640
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11641
|
+
return;
|
|
11642
|
+
}
|
|
11643
|
+
if (typeof selectionStart !== 'number') {
|
|
11644
|
+
return;
|
|
11645
|
+
}
|
|
11646
|
+
this.updateComplete.then(() => {
|
|
11647
|
+
try {
|
|
11648
|
+
this.inputElement.setSelectionRange(selectionStart, selectionStart);
|
|
11649
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11650
|
+
// Some input types (number/email in certain UAs) throw on
|
|
11651
|
+
// setSelectionRange; swallow and let the native cursor stand.
|
|
11652
|
+
}
|
|
11653
|
+
});
|
|
11654
|
+
}
|
|
11637
11655
|
}
|
|
11638
11656
|
|
|
11639
11657
|
/**
|
|
@@ -12260,7 +12278,7 @@ class AuroHelpText extends i$3 {
|
|
|
12260
12278
|
}
|
|
12261
12279
|
}
|
|
12262
12280
|
|
|
12263
|
-
var formkitVersion = '
|
|
12281
|
+
var formkitVersion = '202606291813';
|
|
12264
12282
|
|
|
12265
12283
|
/**
|
|
12266
12284
|
* @license
|
|
@@ -12775,6 +12793,7 @@ class AuroInput extends BaseInput {
|
|
|
12775
12793
|
<${this.buttonTag}
|
|
12776
12794
|
@click="${this.handleClickShowPassword}"
|
|
12777
12795
|
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12796
|
+
aria-pressed="${this.showPassword ? 'true' : 'false'}"
|
|
12778
12797
|
class="notificationBtn passwordBtn"
|
|
12779
12798
|
shape="circle"
|
|
12780
12799
|
size="sm"
|
|
@@ -12848,25 +12867,29 @@ class AuroInput extends BaseInput {
|
|
|
12848
12867
|
* @returns {html} - Returns HTML for the help text and error message.
|
|
12849
12868
|
*/
|
|
12850
12869
|
renderHtmlHelpText() {
|
|
12870
|
+
// Single `<p>` with stable identity across validity transitions —
|
|
12871
|
+
// previously two distinct templates (valid vs invalid) caused Lit to
|
|
12872
|
+
// replace the node entirely on a flip, and VoiceOver wouldn't
|
|
12873
|
+
// re-announce because the live-region element it was watching had been
|
|
12874
|
+
// removed and a new one inserted. Keeping one node means the `role`,
|
|
12875
|
+
// `aria-live`, and text content all change in-place, which AT does
|
|
12876
|
+
// observe and announce.
|
|
12877
|
+
const isError = this.validity && this.validity !== 'valid';
|
|
12851
12878
|
return u$4`
|
|
12852
|
-
|
|
12853
|
-
?
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12861
|
-
|
|
12862
|
-
|
|
12863
|
-
appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
12864
|
-
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
12865
|
-
${this.errorMessage}
|
|
12866
|
-
</p>
|
|
12867
|
-
</${this.helpTextTag}>
|
|
12868
|
-
`
|
|
12879
|
+
<${this.helpTextTag}
|
|
12880
|
+
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12881
|
+
?error=${isError}>
|
|
12882
|
+
<p
|
|
12883
|
+
id="${this.uniqueId}"
|
|
12884
|
+
part="helpText"
|
|
12885
|
+
role="${o$2(isError ? 'alert' : undefined)}"
|
|
12886
|
+
aria-live="${o$2(isError ? 'assertive' : undefined)}">
|
|
12887
|
+
${isError
|
|
12888
|
+
? this.errorMessage
|
|
12889
|
+
: u$4`<slot name="helpText">${this.getHelpText()}</slot>`
|
|
12869
12890
|
}
|
|
12891
|
+
</p>
|
|
12892
|
+
</${this.helpTextTag}>
|
|
12870
12893
|
`;
|
|
12871
12894
|
}
|
|
12872
12895
|
|
|
@@ -10385,6 +10385,13 @@ class AuroInputUtilities {
|
|
|
10385
10385
|
* @returns {string | undefined}
|
|
10386
10386
|
*/
|
|
10387
10387
|
toFormattedValue(valueObject, format) {
|
|
10388
|
+
// Exposed publicly via `AuroInputUtil.toFormattedValue`, so a missing
|
|
10389
|
+
// `format` argument has to fail gracefully rather than throw on
|
|
10390
|
+
// `format.toLowerCase()`. Treat any falsy value (undefined, null, '')
|
|
10391
|
+
// as "no format → no display value".
|
|
10392
|
+
if (!format) {
|
|
10393
|
+
return undefined;
|
|
10394
|
+
}
|
|
10388
10395
|
const normalizedFormat = format.toLowerCase();
|
|
10389
10396
|
const maskOptions = this.getMaskOptions('date', normalizedFormat);
|
|
10390
10397
|
|
|
@@ -10535,79 +10542,18 @@ class BaseInput extends AuroElement {
|
|
|
10535
10542
|
constructor() {
|
|
10536
10543
|
super();
|
|
10537
10544
|
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
|
|
10543
|
-
|
|
10544
|
-
|
|
10545
|
-
|
|
10546
|
-
|
|
10547
|
-
|
|
10548
|
-
this.required = false;
|
|
10549
|
-
this.onDark = false;
|
|
10550
|
-
this.setCustomValidityForType = undefined;
|
|
10551
|
-
this.size = 'lg';
|
|
10552
|
-
this.shape = 'classic';
|
|
10553
|
-
this.value = undefined;
|
|
10554
|
-
this._valueObject = undefined;
|
|
10555
|
-
|
|
10556
|
-
this._initializePrivateDefaults();
|
|
10557
|
-
}
|
|
10558
|
-
|
|
10559
|
-
/**
|
|
10560
|
-
* Internal Defaults.
|
|
10561
|
-
* @private
|
|
10562
|
-
* @returns {void}
|
|
10563
|
-
*/
|
|
10564
|
-
_initializePrivateDefaults() {
|
|
10545
|
+
// Single-source initialization. Alphabetized so duplicate or stale
|
|
10546
|
+
// defaults are immediately obvious on a diff. Every field is assigned
|
|
10547
|
+
// exactly once here (previously the constructor + the old
|
|
10548
|
+
// `_initializePrivateDefaults` overlapped — both wrote ~14 of the same
|
|
10549
|
+
// fields and double-allocated `util` and `validation`, discarding the
|
|
10550
|
+
// first instance). `validation` is now allocated exactly once; `util`
|
|
10551
|
+
// is seeded here with an en-US default and then rebuilt in
|
|
10552
|
+
// `connectedCallback` once the consumer-resolved locale is available,
|
|
10553
|
+
// so a parent (datepicker/combobox) calling `validate()` synchronously
|
|
10554
|
+
// during its own update cycle sees a populated util instance.
|
|
10565
10555
|
this.activeLabel = false;
|
|
10566
|
-
|
|
10567
|
-
this.icon = false;
|
|
10568
|
-
this.disabled = false;
|
|
10569
|
-
this.dvInputOnly = false;
|
|
10570
|
-
this.hideLabelVisually = false;
|
|
10571
|
-
this.max = undefined;
|
|
10572
|
-
this.maxLength = undefined;
|
|
10573
|
-
this.min = undefined;
|
|
10574
|
-
this.minLength = undefined;
|
|
10575
|
-
this.noValidate = false;
|
|
10576
|
-
this.onDark = false;
|
|
10577
|
-
this.required = false;
|
|
10578
|
-
this.setCustomValidityForType = undefined;
|
|
10579
|
-
|
|
10580
|
-
// Used for storing raw values returned from input mask.
|
|
10581
|
-
this._rawMaskValue = undefined;
|
|
10582
|
-
|
|
10583
|
-
/**
|
|
10584
|
-
* @private
|
|
10585
|
-
*/
|
|
10586
|
-
this.layout = 'classic';
|
|
10587
|
-
|
|
10588
|
-
/**
|
|
10589
|
-
* @private
|
|
10590
|
-
*/
|
|
10591
|
-
this.shape = 'classic';
|
|
10592
|
-
|
|
10593
|
-
/**
|
|
10594
|
-
* @private
|
|
10595
|
-
*/
|
|
10596
|
-
this.size = 'lg';
|
|
10597
|
-
|
|
10598
|
-
this.touched = false;
|
|
10599
|
-
this.util = new AuroInputUtilities({
|
|
10600
|
-
locale: "en-US",
|
|
10601
|
-
format: this.format
|
|
10602
|
-
});
|
|
10603
|
-
this.validation = new AuroFormValidation();
|
|
10604
|
-
this.inputIconName = undefined;
|
|
10605
|
-
this.showPassword = false;
|
|
10606
|
-
this.validationCCLength = undefined;
|
|
10607
|
-
this.hasValue = false;
|
|
10608
|
-
this.label = 'Input label is undefined';
|
|
10609
|
-
|
|
10610
|
-
|
|
10556
|
+
/** @private */
|
|
10611
10557
|
this.allowedInputTypes = [
|
|
10612
10558
|
"text",
|
|
10613
10559
|
"number",
|
|
@@ -10616,7 +10562,8 @@ class BaseInput extends AuroElement {
|
|
|
10616
10562
|
"credit-card",
|
|
10617
10563
|
"tel"
|
|
10618
10564
|
];
|
|
10619
|
-
this.
|
|
10565
|
+
this.appearance = "default";
|
|
10566
|
+
/** @private */
|
|
10620
10567
|
this.dateFormatMap = {
|
|
10621
10568
|
'mm/dd/yyyy': 'dateMMDDYYYY',
|
|
10622
10569
|
'dd/mm/yyyy': 'dateDDMMYYYY',
|
|
@@ -10633,27 +10580,57 @@ class BaseInput extends AuroElement {
|
|
|
10633
10580
|
'dd/mm': 'dateDDMM',
|
|
10634
10581
|
'mm/dd': 'dateMMDD'
|
|
10635
10582
|
};
|
|
10583
|
+
this.disabled = false;
|
|
10584
|
+
/** @private */
|
|
10636
10585
|
this.domHandler = new DomHandler();
|
|
10637
10586
|
this.dvInputOnly = false;
|
|
10638
10587
|
this.hasValue = false;
|
|
10588
|
+
this.hideLabelVisually = false;
|
|
10589
|
+
this.icon = false;
|
|
10590
|
+
/** @private */
|
|
10639
10591
|
this.inputIconName = undefined;
|
|
10592
|
+
/** @private */
|
|
10640
10593
|
this.label = 'Input label is undefined';
|
|
10594
|
+
this.layout = 'classic';
|
|
10595
|
+
this.locale = 'en-US';
|
|
10596
|
+
this.max = undefined;
|
|
10597
|
+
this._maxObject = undefined;
|
|
10598
|
+
this.maxLength = undefined;
|
|
10599
|
+
this.min = undefined;
|
|
10600
|
+
this._minObject = undefined;
|
|
10601
|
+
this.minLength = undefined;
|
|
10641
10602
|
this.noValidate = false;
|
|
10642
|
-
this.
|
|
10603
|
+
this.onDark = false;
|
|
10604
|
+
// Raw values returned from the input mask before model normalization.
|
|
10605
|
+
this._rawMaskValue = undefined;
|
|
10606
|
+
this.required = false;
|
|
10607
|
+
this.setCustomValidityForType = undefined;
|
|
10608
|
+
// Credit Card is intentionally excluded — its mask manages the cursor
|
|
10609
|
+
// itself, and listing it here caused cursor placement issues in Safari.
|
|
10610
|
+
/** @private */
|
|
10643
10611
|
this.setSelectionInputTypes = [
|
|
10644
10612
|
"text",
|
|
10645
10613
|
"password",
|
|
10646
10614
|
"email"
|
|
10647
|
-
];
|
|
10615
|
+
];
|
|
10616
|
+
this.shape = 'classic';
|
|
10617
|
+
/** @private */
|
|
10648
10618
|
this.showPassword = false;
|
|
10619
|
+
this.size = 'lg';
|
|
10649
10620
|
this.touched = false;
|
|
10621
|
+
/** @private */
|
|
10650
10622
|
this.uniqueId = new UniqueId().create();
|
|
10623
|
+
/** @private */
|
|
10651
10624
|
this.util = new AuroInputUtilities({
|
|
10652
10625
|
locale: this.locale,
|
|
10653
10626
|
format: this.format
|
|
10654
10627
|
});
|
|
10628
|
+
/** @private */
|
|
10655
10629
|
this.validation = new AuroFormValidation();
|
|
10630
|
+
/** @private */
|
|
10656
10631
|
this.validationCCLength = undefined;
|
|
10632
|
+
this.value = undefined;
|
|
10633
|
+
this._valueObject = undefined;
|
|
10657
10634
|
}
|
|
10658
10635
|
|
|
10659
10636
|
// function to define props used within the scope of this component
|
|
@@ -11201,6 +11178,15 @@ class BaseInput extends AuroElement {
|
|
|
11201
11178
|
|
|
11202
11179
|
this.inputId = this.id ? `${this.id}-input` : window.crypto.randomUUID();
|
|
11203
11180
|
|
|
11181
|
+
// Normalize the format token to lowercase so case-mixed values supplied
|
|
11182
|
+
// via attribute (e.g. `format="MM/DD/YYYY"`) hit the `dateFormatMap`
|
|
11183
|
+
// lookup inside `setCustomHelpTextMessage`. Without this, an uppercase
|
|
11184
|
+
// format silently misses the map and leaves `setCustomValidityForType`
|
|
11185
|
+
// unset.
|
|
11186
|
+
if (this.format) {
|
|
11187
|
+
this.format = this.format.toLowerCase();
|
|
11188
|
+
}
|
|
11189
|
+
|
|
11204
11190
|
// use validity message override if declared when initializing the component
|
|
11205
11191
|
if (this.hasAttribute('setCustomValidity')) {
|
|
11206
11192
|
this.ValidityMessageOverride = this.setCustomValidity;
|
|
@@ -11634,6 +11620,38 @@ class BaseInput extends AuroElement {
|
|
|
11634
11620
|
this.touched = true;
|
|
11635
11621
|
this.validation.validate(this);
|
|
11636
11622
|
}
|
|
11623
|
+
|
|
11624
|
+
// Prevents cursor jumping in Safari. Setting `this.value` triggers a Lit
|
|
11625
|
+
// update that can re-render the input and reset the native cursor; we
|
|
11626
|
+
// capture the caret position before that update commits and restore it
|
|
11627
|
+
// via `setSelectionRange` once the update has flushed. Gated on
|
|
11628
|
+
// `setSelectionInputTypes` so credit-card (and other masked types whose
|
|
11629
|
+
// formatter manages the cursor itself) doesn't get a competing write.
|
|
11630
|
+
// Capture the caret position INSIDE the gate — reading `selectionStart`
|
|
11631
|
+
// on input types that don't support text selection (number, email in
|
|
11632
|
+
// some browsers) throws InvalidStateError, which would crash all input
|
|
11633
|
+
// handling. Wrap the read in try/catch belt-and-suspenders even though
|
|
11634
|
+
// the gated types currently support it, since the list is a public
|
|
11635
|
+
// property a consumer could mutate.
|
|
11636
|
+
if (this.setSelectionInputTypes.includes(this.type)) {
|
|
11637
|
+
let selectionStart;
|
|
11638
|
+
try {
|
|
11639
|
+
selectionStart = this.inputElement.selectionStart;
|
|
11640
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11641
|
+
return;
|
|
11642
|
+
}
|
|
11643
|
+
if (typeof selectionStart !== 'number') {
|
|
11644
|
+
return;
|
|
11645
|
+
}
|
|
11646
|
+
this.updateComplete.then(() => {
|
|
11647
|
+
try {
|
|
11648
|
+
this.inputElement.setSelectionRange(selectionStart, selectionStart);
|
|
11649
|
+
} catch (error) { // eslint-disable-line no-unused-vars
|
|
11650
|
+
// Some input types (number/email in certain UAs) throw on
|
|
11651
|
+
// setSelectionRange; swallow and let the native cursor stand.
|
|
11652
|
+
}
|
|
11653
|
+
});
|
|
11654
|
+
}
|
|
11637
11655
|
}
|
|
11638
11656
|
|
|
11639
11657
|
/**
|
|
@@ -12260,7 +12278,7 @@ class AuroHelpText extends i$3 {
|
|
|
12260
12278
|
}
|
|
12261
12279
|
}
|
|
12262
12280
|
|
|
12263
|
-
var formkitVersion = '
|
|
12281
|
+
var formkitVersion = '202606291813';
|
|
12264
12282
|
|
|
12265
12283
|
/**
|
|
12266
12284
|
* @license
|
|
@@ -12775,6 +12793,7 @@ class AuroInput extends BaseInput {
|
|
|
12775
12793
|
<${this.buttonTag}
|
|
12776
12794
|
@click="${this.handleClickShowPassword}"
|
|
12777
12795
|
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12796
|
+
aria-pressed="${this.showPassword ? 'true' : 'false'}"
|
|
12778
12797
|
class="notificationBtn passwordBtn"
|
|
12779
12798
|
shape="circle"
|
|
12780
12799
|
size="sm"
|
|
@@ -12848,25 +12867,29 @@ class AuroInput extends BaseInput {
|
|
|
12848
12867
|
* @returns {html} - Returns HTML for the help text and error message.
|
|
12849
12868
|
*/
|
|
12850
12869
|
renderHtmlHelpText() {
|
|
12870
|
+
// Single `<p>` with stable identity across validity transitions —
|
|
12871
|
+
// previously two distinct templates (valid vs invalid) caused Lit to
|
|
12872
|
+
// replace the node entirely on a flip, and VoiceOver wouldn't
|
|
12873
|
+
// re-announce because the live-region element it was watching had been
|
|
12874
|
+
// removed and a new one inserted. Keeping one node means the `role`,
|
|
12875
|
+
// `aria-live`, and text content all change in-place, which AT does
|
|
12876
|
+
// observe and announce.
|
|
12877
|
+
const isError = this.validity && this.validity !== 'valid';
|
|
12851
12878
|
return u$4`
|
|
12852
|
-
|
|
12853
|
-
?
|
|
12854
|
-
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
|
|
12859
|
-
|
|
12860
|
-
|
|
12861
|
-
|
|
12862
|
-
|
|
12863
|
-
appearance="${this.onDark ? 'inverse' : this.appearance}">
|
|
12864
|
-
<p id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
12865
|
-
${this.errorMessage}
|
|
12866
|
-
</p>
|
|
12867
|
-
</${this.helpTextTag}>
|
|
12868
|
-
`
|
|
12879
|
+
<${this.helpTextTag}
|
|
12880
|
+
appearance="${this.onDark ? 'inverse' : this.appearance}"
|
|
12881
|
+
?error=${isError}>
|
|
12882
|
+
<p
|
|
12883
|
+
id="${this.uniqueId}"
|
|
12884
|
+
part="helpText"
|
|
12885
|
+
role="${o$2(isError ? 'alert' : undefined)}"
|
|
12886
|
+
aria-live="${o$2(isError ? 'assertive' : undefined)}">
|
|
12887
|
+
${isError
|
|
12888
|
+
? this.errorMessage
|
|
12889
|
+
: u$4`<slot name="helpText">${this.getHelpText()}</slot>`
|
|
12869
12890
|
}
|
|
12891
|
+
</p>
|
|
12892
|
+
</${this.helpTextTag}>
|
|
12870
12893
|
`;
|
|
12871
12894
|
}
|
|
12872
12895
|
|