@aurodesignsystem/auro-formkit 3.3.0-beta.2 → 3.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +30 -0
- package/components/checkbox/README.md +1 -1
- package/components/checkbox/demo/api.min.js +36 -5
- package/components/checkbox/demo/index.min.js +36 -5
- package/components/checkbox/demo/readme.md +1 -1
- package/components/checkbox/dist/auro-checkbox-group.d.ts +7 -0
- package/components/checkbox/dist/auro-checkbox.d.ts +7 -0
- package/components/checkbox/dist/index.js +36 -5
- package/components/checkbox/dist/registered.js +36 -5
- package/components/combobox/README.md +1 -1
- package/components/combobox/demo/api.md +44 -0
- package/components/combobox/demo/api.min.js +95 -60
- package/components/combobox/demo/index.min.js +95 -60
- package/components/combobox/demo/readme.md +1 -1
- package/components/combobox/dist/auro-combobox.d.ts +8 -10
- package/components/combobox/dist/index.js +95 -60
- package/components/combobox/dist/registered.js +95 -60
- package/components/counter/README.md +1 -1
- package/components/counter/demo/api.min.js +12 -5
- package/components/counter/demo/index.min.js +12 -5
- package/components/counter/demo/readme.md +1 -1
- package/components/counter/dist/index.js +12 -5
- package/components/counter/dist/registered.js +12 -5
- package/components/datepicker/README.md +1 -1
- package/components/datepicker/demo/api.md +30 -0
- package/components/datepicker/demo/api.min.js +72 -37
- package/components/datepicker/demo/index.min.js +72 -37
- package/components/datepicker/demo/readme.md +1 -1
- package/components/datepicker/dist/auro-datepicker.d.ts +14 -0
- package/components/datepicker/dist/index.js +72 -37
- package/components/datepicker/dist/registered.js +72 -37
- package/components/dropdown/README.md +1 -1
- package/components/dropdown/demo/readme.md +1 -1
- package/components/form/README.md +1 -1
- package/components/form/demo/readme.md +1 -1
- package/components/input/README.md +1 -1
- package/components/input/demo/api.md +24 -0
- package/components/input/demo/api.min.js +36 -17
- package/components/input/demo/index.min.js +36 -17
- package/components/input/demo/readme.md +1 -1
- package/components/input/dist/base-input.d.ts +15 -0
- package/components/input/dist/index.js +36 -17
- package/components/input/dist/registered.js +36 -17
- package/components/menu/README.md +1 -1
- package/components/menu/demo/readme.md +1 -1
- package/components/radio/README.md +1 -1
- package/components/radio/demo/api.min.js +39 -9
- package/components/radio/demo/index.min.js +39 -9
- package/components/radio/demo/readme.md +1 -1
- package/components/radio/dist/auro-radio-group.d.ts +8 -0
- package/components/radio/dist/auro-radio.d.ts +10 -0
- package/components/radio/dist/index.js +39 -9
- package/components/radio/dist/registered.js +39 -9
- package/components/select/README.md +1 -1
- package/components/select/demo/api.min.js +25 -15
- package/components/select/demo/index.min.js +25 -15
- package/components/select/demo/readme.md +1 -1
- package/components/select/dist/auro-select.d.ts +8 -0
- package/components/select/dist/index.js +25 -15
- package/components/select/dist/registered.js +25 -15
- package/package.json +1 -1
|
@@ -502,6 +502,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
502
502
|
reset(elem) {
|
|
503
503
|
elem.validity = undefined;
|
|
504
504
|
elem.value = undefined;
|
|
505
|
+
elem.touched = false;
|
|
505
506
|
|
|
506
507
|
// Resets the second value of the datepicker in range state
|
|
507
508
|
if (elem.valueEnd) {
|
|
@@ -639,7 +640,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
639
640
|
} else if (elem.type === 'date' && elem.value?.length > 0) {
|
|
640
641
|
|
|
641
642
|
// Guard Clause: if the value is too short
|
|
642
|
-
if (elem.value
|
|
643
|
+
if (elem.value?.length < elem.lengthForType) {
|
|
643
644
|
|
|
644
645
|
elem.validity = 'tooShort';
|
|
645
646
|
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
@@ -709,11 +710,17 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
709
710
|
this.getAuroInputs(elem);
|
|
710
711
|
|
|
711
712
|
// Validate only if noValidate is not true and the input does not have focus
|
|
712
|
-
|
|
713
|
+
let validationShouldRun =
|
|
714
|
+
force ||
|
|
715
|
+
(!elem.contains(document.activeElement) &&
|
|
716
|
+
(elem.touched ||
|
|
717
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
718
|
+
elem.validateOnInput;
|
|
713
719
|
|
|
714
720
|
if (elem.hasAttribute('error')) {
|
|
715
721
|
elem.validity = 'customError';
|
|
716
722
|
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
723
|
+
validationShouldRun = false;
|
|
717
724
|
} else if (validationShouldRun) {
|
|
718
725
|
elem.validity = 'valid';
|
|
719
726
|
elem.errorMessage = '';
|
|
@@ -734,7 +741,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
734
741
|
}
|
|
735
742
|
}
|
|
736
743
|
|
|
737
|
-
if (!hasValue && elem.required) {
|
|
744
|
+
if (!hasValue && elem.required && elem.touched) {
|
|
738
745
|
elem.validity = 'valueMissing';
|
|
739
746
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
740
747
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
@@ -745,7 +752,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
745
752
|
}
|
|
746
753
|
}
|
|
747
754
|
|
|
748
|
-
if (this.auroInputElements?.length > 0) {
|
|
755
|
+
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
749
756
|
elem.validity = this.auroInputElements[0].validity;
|
|
750
757
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
751
758
|
|
|
@@ -824,7 +831,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
824
831
|
}
|
|
825
832
|
}
|
|
826
833
|
} else {
|
|
827
|
-
elem.errorMessage =
|
|
834
|
+
elem.errorMessage = '';
|
|
828
835
|
}
|
|
829
836
|
}
|
|
830
837
|
};
|
|
@@ -20435,6 +20442,7 @@ class AuroFormValidation {
|
|
|
20435
20442
|
reset(elem) {
|
|
20436
20443
|
elem.validity = undefined;
|
|
20437
20444
|
elem.value = undefined;
|
|
20445
|
+
elem.touched = false;
|
|
20438
20446
|
|
|
20439
20447
|
// Resets the second value of the datepicker in range state
|
|
20440
20448
|
if (elem.valueEnd) {
|
|
@@ -20572,7 +20580,7 @@ class AuroFormValidation {
|
|
|
20572
20580
|
} else if (elem.type === 'date' && elem.value?.length > 0) {
|
|
20573
20581
|
|
|
20574
20582
|
// Guard Clause: if the value is too short
|
|
20575
|
-
if (elem.value
|
|
20583
|
+
if (elem.value?.length < elem.lengthForType) {
|
|
20576
20584
|
|
|
20577
20585
|
elem.validity = 'tooShort';
|
|
20578
20586
|
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
@@ -20642,11 +20650,17 @@ class AuroFormValidation {
|
|
|
20642
20650
|
this.getAuroInputs(elem);
|
|
20643
20651
|
|
|
20644
20652
|
// Validate only if noValidate is not true and the input does not have focus
|
|
20645
|
-
|
|
20653
|
+
let validationShouldRun =
|
|
20654
|
+
force ||
|
|
20655
|
+
(!elem.contains(document.activeElement) &&
|
|
20656
|
+
(elem.touched ||
|
|
20657
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
20658
|
+
elem.validateOnInput;
|
|
20646
20659
|
|
|
20647
20660
|
if (elem.hasAttribute('error')) {
|
|
20648
20661
|
elem.validity = 'customError';
|
|
20649
20662
|
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
20663
|
+
validationShouldRun = false;
|
|
20650
20664
|
} else if (validationShouldRun) {
|
|
20651
20665
|
elem.validity = 'valid';
|
|
20652
20666
|
elem.errorMessage = '';
|
|
@@ -20667,7 +20681,7 @@ class AuroFormValidation {
|
|
|
20667
20681
|
}
|
|
20668
20682
|
}
|
|
20669
20683
|
|
|
20670
|
-
if (!hasValue && elem.required) {
|
|
20684
|
+
if (!hasValue && elem.required && elem.touched) {
|
|
20671
20685
|
elem.validity = 'valueMissing';
|
|
20672
20686
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
20673
20687
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
@@ -20678,7 +20692,7 @@ class AuroFormValidation {
|
|
|
20678
20692
|
}
|
|
20679
20693
|
}
|
|
20680
20694
|
|
|
20681
|
-
if (this.auroInputElements?.length > 0) {
|
|
20695
|
+
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
20682
20696
|
elem.validity = this.auroInputElements[0].validity;
|
|
20683
20697
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
20684
20698
|
|
|
@@ -20757,7 +20771,7 @@ class AuroFormValidation {
|
|
|
20757
20771
|
}
|
|
20758
20772
|
}
|
|
20759
20773
|
} else {
|
|
20760
|
-
elem.errorMessage =
|
|
20774
|
+
elem.errorMessage = '';
|
|
20761
20775
|
}
|
|
20762
20776
|
}
|
|
20763
20777
|
}
|
|
@@ -20808,6 +20822,7 @@ class BaseInput extends LitElement {
|
|
|
20808
20822
|
* @returns {void}
|
|
20809
20823
|
*/
|
|
20810
20824
|
privateDefaults() {
|
|
20825
|
+
this.touched = false;
|
|
20811
20826
|
this.util = new AuroInputUtilities();
|
|
20812
20827
|
this.validation = new AuroFormValidation();
|
|
20813
20828
|
this.inputIconName = undefined;
|
|
@@ -20968,6 +20983,13 @@ class BaseInput extends LitElement {
|
|
|
20968
20983
|
type: String
|
|
20969
20984
|
},
|
|
20970
20985
|
|
|
20986
|
+
/** Exposes inputmode attribute for input. */
|
|
20987
|
+
inputmode: {
|
|
20988
|
+
type: String,
|
|
20989
|
+
attribute: true,
|
|
20990
|
+
reflect: true
|
|
20991
|
+
},
|
|
20992
|
+
|
|
20971
20993
|
/**
|
|
20972
20994
|
* Defines the language of an element.
|
|
20973
20995
|
*/
|
|
@@ -21169,6 +21191,18 @@ class BaseInput extends LitElement {
|
|
|
21169
21191
|
validity: {
|
|
21170
21192
|
type: String,
|
|
21171
21193
|
reflect: true
|
|
21194
|
+
},
|
|
21195
|
+
|
|
21196
|
+
/**
|
|
21197
|
+
* Indicates whether the input is in a dirty state (has been interacted with).
|
|
21198
|
+
* @type {boolean}
|
|
21199
|
+
* @default false
|
|
21200
|
+
* @private
|
|
21201
|
+
*/
|
|
21202
|
+
touched: {
|
|
21203
|
+
type: Boolean,
|
|
21204
|
+
reflect: true,
|
|
21205
|
+
attribute: false
|
|
21172
21206
|
}
|
|
21173
21207
|
};
|
|
21174
21208
|
}
|
|
@@ -21455,15 +21489,7 @@ class BaseInput extends LitElement {
|
|
|
21455
21489
|
*/
|
|
21456
21490
|
handleFocusin() {
|
|
21457
21491
|
|
|
21458
|
-
|
|
21459
|
-
* The input is considered to be in it's initial state based on
|
|
21460
|
-
* if this.value === undefined. The first time we interact with the
|
|
21461
|
-
* input manually, by applying focusin, we need to flag the
|
|
21462
|
-
* input as no longer in the initial state.
|
|
21463
|
-
*/
|
|
21464
|
-
if (this.value === undefined) {
|
|
21465
|
-
this.value = '';
|
|
21466
|
-
}
|
|
21492
|
+
this.touched = true;
|
|
21467
21493
|
}
|
|
21468
21494
|
|
|
21469
21495
|
/**
|
|
@@ -21529,9 +21555,9 @@ class BaseInput extends LitElement {
|
|
|
21529
21555
|
|
|
21530
21556
|
if (this.type in defaultLengths) {
|
|
21531
21557
|
this.lengthForType = this.format ? this.format.length : defaultLengths[this.type];
|
|
21532
|
-
this.
|
|
21558
|
+
this.inputmode = this.inputmode || 'numeric';
|
|
21533
21559
|
} else if (this.type === 'number') {
|
|
21534
|
-
this.
|
|
21560
|
+
this.inputmode = this.inputmode || 'numeric';
|
|
21535
21561
|
}
|
|
21536
21562
|
|
|
21537
21563
|
if (this.type === "date" && !this.format) {
|
|
@@ -22889,7 +22915,7 @@ class AuroInput extends BaseInput {
|
|
|
22889
22915
|
pattern="${ifDefined(this.definePattern())}"
|
|
22890
22916
|
maxlength="${ifDefined(this.maxLength ? this.maxLength : undefined)}"
|
|
22891
22917
|
minlength="${ifDefined(this.minLength ? this.minLength : undefined)}"
|
|
22892
|
-
inputMode="${ifDefined(this.
|
|
22918
|
+
inputMode="${ifDefined(this.inputmode ? this.inputmode : undefined)}"
|
|
22893
22919
|
?required="${this.required}"
|
|
22894
22920
|
?disabled="${this.disabled}"
|
|
22895
22921
|
aria-describedby="${this.uniqueId}"
|
|
@@ -23038,6 +23064,7 @@ class AuroDatePicker extends LitElement {
|
|
|
23038
23064
|
this.calendarRenderUtil.updateCentralDate(this, new Date());
|
|
23039
23065
|
}
|
|
23040
23066
|
|
|
23067
|
+
this.touched = false;
|
|
23041
23068
|
this.disabled = false;
|
|
23042
23069
|
this.required = false;
|
|
23043
23070
|
this.onDark = false;
|
|
@@ -23202,6 +23229,13 @@ class AuroDatePicker extends LitElement {
|
|
|
23202
23229
|
reflect: true
|
|
23203
23230
|
},
|
|
23204
23231
|
|
|
23232
|
+
/** Exposes inputmode attribute for input. */
|
|
23233
|
+
inputmode: {
|
|
23234
|
+
type: String,
|
|
23235
|
+
attribute: true,
|
|
23236
|
+
reflect: true
|
|
23237
|
+
},
|
|
23238
|
+
|
|
23205
23239
|
/**
|
|
23206
23240
|
* If declared, make bib.fullscreen.headline in HeadingDisplay.
|
|
23207
23241
|
* Otherwise, Heading 600.
|
|
@@ -23369,6 +23403,18 @@ class AuroDatePicker extends LitElement {
|
|
|
23369
23403
|
*/
|
|
23370
23404
|
valueEnd: {
|
|
23371
23405
|
type: String
|
|
23406
|
+
},
|
|
23407
|
+
|
|
23408
|
+
/**
|
|
23409
|
+
* Indicates whether the datepicker is in a dirty state (has been interacted with).
|
|
23410
|
+
* @type {boolean}
|
|
23411
|
+
* @default false
|
|
23412
|
+
* @private
|
|
23413
|
+
*/
|
|
23414
|
+
touched: {
|
|
23415
|
+
type: Boolean,
|
|
23416
|
+
reflect: true,
|
|
23417
|
+
attribute: false
|
|
23372
23418
|
}
|
|
23373
23419
|
};
|
|
23374
23420
|
}
|
|
@@ -23645,27 +23691,15 @@ class AuroDatePicker extends LitElement {
|
|
|
23645
23691
|
configureDatepicker() {
|
|
23646
23692
|
this.addEventListener('focusin', () => {
|
|
23647
23693
|
|
|
23648
|
-
|
|
23649
|
-
* The datepicker is considered to be in it's initial state based on
|
|
23650
|
-
* if this.value === undefined. The first time we interact with the
|
|
23651
|
-
* datepicker manually, by applying focusin, we need to flag the
|
|
23652
|
-
* datepicker as no longer in the initial state.
|
|
23653
|
-
*/
|
|
23654
|
-
if (this.value === undefined) {
|
|
23655
|
-
this.value = '';
|
|
23656
|
-
}
|
|
23657
|
-
|
|
23658
|
-
if (this.valueEnd === undefined) {
|
|
23659
|
-
this.valueEnd = '';
|
|
23660
|
-
}
|
|
23694
|
+
this.touched = true;
|
|
23661
23695
|
});
|
|
23662
23696
|
|
|
23663
23697
|
this.addEventListener('focusout', (evt) => {
|
|
23664
|
-
if (!this.noValidate && !evt.detail.expanded && this.
|
|
23698
|
+
if (!this.noValidate && !evt.detail.expanded && this.touched) {
|
|
23665
23699
|
if (!this.contains(document.activeElement)) {
|
|
23666
23700
|
this.validation.validate(this.inputList[0]);
|
|
23667
23701
|
|
|
23668
|
-
if (this.inputList[1] && this.inputList[1].
|
|
23702
|
+
if (this.inputList[1] && this.inputList[1].touched) {
|
|
23669
23703
|
this.validation.validate(this.inputList[1]);
|
|
23670
23704
|
}
|
|
23671
23705
|
}
|
|
@@ -24052,6 +24086,7 @@ class AuroDatePicker extends LitElement {
|
|
|
24052
24086
|
setCustomValidityRangeOverflow="${this.setCustomValidityRangeOverflow}"
|
|
24053
24087
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
24054
24088
|
?disabled="${this.disabled}"
|
|
24089
|
+
inputmode="${ifDefined(this.inputmode)}"
|
|
24055
24090
|
part="input">
|
|
24056
24091
|
<span slot="label"><slot name="fromLabel"></slot></span>
|
|
24057
24092
|
</${this.inputTag}>
|
|
@@ -502,6 +502,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
502
502
|
reset(elem) {
|
|
503
503
|
elem.validity = undefined;
|
|
504
504
|
elem.value = undefined;
|
|
505
|
+
elem.touched = false;
|
|
505
506
|
|
|
506
507
|
// Resets the second value of the datepicker in range state
|
|
507
508
|
if (elem.valueEnd) {
|
|
@@ -639,7 +640,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
639
640
|
} else if (elem.type === 'date' && elem.value?.length > 0) {
|
|
640
641
|
|
|
641
642
|
// Guard Clause: if the value is too short
|
|
642
|
-
if (elem.value
|
|
643
|
+
if (elem.value?.length < elem.lengthForType) {
|
|
643
644
|
|
|
644
645
|
elem.validity = 'tooShort';
|
|
645
646
|
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
@@ -709,11 +710,17 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
709
710
|
this.getAuroInputs(elem);
|
|
710
711
|
|
|
711
712
|
// Validate only if noValidate is not true and the input does not have focus
|
|
712
|
-
|
|
713
|
+
let validationShouldRun =
|
|
714
|
+
force ||
|
|
715
|
+
(!elem.contains(document.activeElement) &&
|
|
716
|
+
(elem.touched ||
|
|
717
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
718
|
+
elem.validateOnInput;
|
|
713
719
|
|
|
714
720
|
if (elem.hasAttribute('error')) {
|
|
715
721
|
elem.validity = 'customError';
|
|
716
722
|
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
723
|
+
validationShouldRun = false;
|
|
717
724
|
} else if (validationShouldRun) {
|
|
718
725
|
elem.validity = 'valid';
|
|
719
726
|
elem.errorMessage = '';
|
|
@@ -734,7 +741,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
734
741
|
}
|
|
735
742
|
}
|
|
736
743
|
|
|
737
|
-
if (!hasValue && elem.required) {
|
|
744
|
+
if (!hasValue && elem.required && elem.touched) {
|
|
738
745
|
elem.validity = 'valueMissing';
|
|
739
746
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
740
747
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
@@ -745,7 +752,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
745
752
|
}
|
|
746
753
|
}
|
|
747
754
|
|
|
748
|
-
if (this.auroInputElements?.length > 0) {
|
|
755
|
+
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
749
756
|
elem.validity = this.auroInputElements[0].validity;
|
|
750
757
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
751
758
|
|
|
@@ -824,7 +831,7 @@ let AuroFormValidation$1 = class AuroFormValidation {
|
|
|
824
831
|
}
|
|
825
832
|
}
|
|
826
833
|
} else {
|
|
827
|
-
elem.errorMessage =
|
|
834
|
+
elem.errorMessage = '';
|
|
828
835
|
}
|
|
829
836
|
}
|
|
830
837
|
};
|
|
@@ -20435,6 +20442,7 @@ class AuroFormValidation {
|
|
|
20435
20442
|
reset(elem) {
|
|
20436
20443
|
elem.validity = undefined;
|
|
20437
20444
|
elem.value = undefined;
|
|
20445
|
+
elem.touched = false;
|
|
20438
20446
|
|
|
20439
20447
|
// Resets the second value of the datepicker in range state
|
|
20440
20448
|
if (elem.valueEnd) {
|
|
@@ -20572,7 +20580,7 @@ class AuroFormValidation {
|
|
|
20572
20580
|
} else if (elem.type === 'date' && elem.value?.length > 0) {
|
|
20573
20581
|
|
|
20574
20582
|
// Guard Clause: if the value is too short
|
|
20575
|
-
if (elem.value
|
|
20583
|
+
if (elem.value?.length < elem.lengthForType) {
|
|
20576
20584
|
|
|
20577
20585
|
elem.validity = 'tooShort';
|
|
20578
20586
|
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
@@ -20642,11 +20650,17 @@ class AuroFormValidation {
|
|
|
20642
20650
|
this.getAuroInputs(elem);
|
|
20643
20651
|
|
|
20644
20652
|
// Validate only if noValidate is not true and the input does not have focus
|
|
20645
|
-
|
|
20653
|
+
let validationShouldRun =
|
|
20654
|
+
force ||
|
|
20655
|
+
(!elem.contains(document.activeElement) &&
|
|
20656
|
+
(elem.touched ||
|
|
20657
|
+
(!elem.touched && typeof elem.value !== "undefined"))) ||
|
|
20658
|
+
elem.validateOnInput;
|
|
20646
20659
|
|
|
20647
20660
|
if (elem.hasAttribute('error')) {
|
|
20648
20661
|
elem.validity = 'customError';
|
|
20649
20662
|
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
20663
|
+
validationShouldRun = false;
|
|
20650
20664
|
} else if (validationShouldRun) {
|
|
20651
20665
|
elem.validity = 'valid';
|
|
20652
20666
|
elem.errorMessage = '';
|
|
@@ -20667,7 +20681,7 @@ class AuroFormValidation {
|
|
|
20667
20681
|
}
|
|
20668
20682
|
}
|
|
20669
20683
|
|
|
20670
|
-
if (!hasValue && elem.required) {
|
|
20684
|
+
if (!hasValue && elem.required && elem.touched) {
|
|
20671
20685
|
elem.validity = 'valueMissing';
|
|
20672
20686
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
20673
20687
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
@@ -20678,7 +20692,7 @@ class AuroFormValidation {
|
|
|
20678
20692
|
}
|
|
20679
20693
|
}
|
|
20680
20694
|
|
|
20681
|
-
if (this.auroInputElements?.length > 0) {
|
|
20695
|
+
if (this.auroInputElements?.length > 0 && elem.validity !== "valueMissing") {
|
|
20682
20696
|
elem.validity = this.auroInputElements[0].validity;
|
|
20683
20697
|
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
20684
20698
|
|
|
@@ -20757,7 +20771,7 @@ class AuroFormValidation {
|
|
|
20757
20771
|
}
|
|
20758
20772
|
}
|
|
20759
20773
|
} else {
|
|
20760
|
-
elem.errorMessage =
|
|
20774
|
+
elem.errorMessage = '';
|
|
20761
20775
|
}
|
|
20762
20776
|
}
|
|
20763
20777
|
}
|
|
@@ -20808,6 +20822,7 @@ class BaseInput extends LitElement {
|
|
|
20808
20822
|
* @returns {void}
|
|
20809
20823
|
*/
|
|
20810
20824
|
privateDefaults() {
|
|
20825
|
+
this.touched = false;
|
|
20811
20826
|
this.util = new AuroInputUtilities();
|
|
20812
20827
|
this.validation = new AuroFormValidation();
|
|
20813
20828
|
this.inputIconName = undefined;
|
|
@@ -20968,6 +20983,13 @@ class BaseInput extends LitElement {
|
|
|
20968
20983
|
type: String
|
|
20969
20984
|
},
|
|
20970
20985
|
|
|
20986
|
+
/** Exposes inputmode attribute for input. */
|
|
20987
|
+
inputmode: {
|
|
20988
|
+
type: String,
|
|
20989
|
+
attribute: true,
|
|
20990
|
+
reflect: true
|
|
20991
|
+
},
|
|
20992
|
+
|
|
20971
20993
|
/**
|
|
20972
20994
|
* Defines the language of an element.
|
|
20973
20995
|
*/
|
|
@@ -21169,6 +21191,18 @@ class BaseInput extends LitElement {
|
|
|
21169
21191
|
validity: {
|
|
21170
21192
|
type: String,
|
|
21171
21193
|
reflect: true
|
|
21194
|
+
},
|
|
21195
|
+
|
|
21196
|
+
/**
|
|
21197
|
+
* Indicates whether the input is in a dirty state (has been interacted with).
|
|
21198
|
+
* @type {boolean}
|
|
21199
|
+
* @default false
|
|
21200
|
+
* @private
|
|
21201
|
+
*/
|
|
21202
|
+
touched: {
|
|
21203
|
+
type: Boolean,
|
|
21204
|
+
reflect: true,
|
|
21205
|
+
attribute: false
|
|
21172
21206
|
}
|
|
21173
21207
|
};
|
|
21174
21208
|
}
|
|
@@ -21455,15 +21489,7 @@ class BaseInput extends LitElement {
|
|
|
21455
21489
|
*/
|
|
21456
21490
|
handleFocusin() {
|
|
21457
21491
|
|
|
21458
|
-
|
|
21459
|
-
* The input is considered to be in it's initial state based on
|
|
21460
|
-
* if this.value === undefined. The first time we interact with the
|
|
21461
|
-
* input manually, by applying focusin, we need to flag the
|
|
21462
|
-
* input as no longer in the initial state.
|
|
21463
|
-
*/
|
|
21464
|
-
if (this.value === undefined) {
|
|
21465
|
-
this.value = '';
|
|
21466
|
-
}
|
|
21492
|
+
this.touched = true;
|
|
21467
21493
|
}
|
|
21468
21494
|
|
|
21469
21495
|
/**
|
|
@@ -21529,9 +21555,9 @@ class BaseInput extends LitElement {
|
|
|
21529
21555
|
|
|
21530
21556
|
if (this.type in defaultLengths) {
|
|
21531
21557
|
this.lengthForType = this.format ? this.format.length : defaultLengths[this.type];
|
|
21532
|
-
this.
|
|
21558
|
+
this.inputmode = this.inputmode || 'numeric';
|
|
21533
21559
|
} else if (this.type === 'number') {
|
|
21534
|
-
this.
|
|
21560
|
+
this.inputmode = this.inputmode || 'numeric';
|
|
21535
21561
|
}
|
|
21536
21562
|
|
|
21537
21563
|
if (this.type === "date" && !this.format) {
|
|
@@ -22889,7 +22915,7 @@ class AuroInput extends BaseInput {
|
|
|
22889
22915
|
pattern="${ifDefined(this.definePattern())}"
|
|
22890
22916
|
maxlength="${ifDefined(this.maxLength ? this.maxLength : undefined)}"
|
|
22891
22917
|
minlength="${ifDefined(this.minLength ? this.minLength : undefined)}"
|
|
22892
|
-
inputMode="${ifDefined(this.
|
|
22918
|
+
inputMode="${ifDefined(this.inputmode ? this.inputmode : undefined)}"
|
|
22893
22919
|
?required="${this.required}"
|
|
22894
22920
|
?disabled="${this.disabled}"
|
|
22895
22921
|
aria-describedby="${this.uniqueId}"
|
|
@@ -23038,6 +23064,7 @@ class AuroDatePicker extends LitElement {
|
|
|
23038
23064
|
this.calendarRenderUtil.updateCentralDate(this, new Date());
|
|
23039
23065
|
}
|
|
23040
23066
|
|
|
23067
|
+
this.touched = false;
|
|
23041
23068
|
this.disabled = false;
|
|
23042
23069
|
this.required = false;
|
|
23043
23070
|
this.onDark = false;
|
|
@@ -23202,6 +23229,13 @@ class AuroDatePicker extends LitElement {
|
|
|
23202
23229
|
reflect: true
|
|
23203
23230
|
},
|
|
23204
23231
|
|
|
23232
|
+
/** Exposes inputmode attribute for input. */
|
|
23233
|
+
inputmode: {
|
|
23234
|
+
type: String,
|
|
23235
|
+
attribute: true,
|
|
23236
|
+
reflect: true
|
|
23237
|
+
},
|
|
23238
|
+
|
|
23205
23239
|
/**
|
|
23206
23240
|
* If declared, make bib.fullscreen.headline in HeadingDisplay.
|
|
23207
23241
|
* Otherwise, Heading 600.
|
|
@@ -23369,6 +23403,18 @@ class AuroDatePicker extends LitElement {
|
|
|
23369
23403
|
*/
|
|
23370
23404
|
valueEnd: {
|
|
23371
23405
|
type: String
|
|
23406
|
+
},
|
|
23407
|
+
|
|
23408
|
+
/**
|
|
23409
|
+
* Indicates whether the datepicker is in a dirty state (has been interacted with).
|
|
23410
|
+
* @type {boolean}
|
|
23411
|
+
* @default false
|
|
23412
|
+
* @private
|
|
23413
|
+
*/
|
|
23414
|
+
touched: {
|
|
23415
|
+
type: Boolean,
|
|
23416
|
+
reflect: true,
|
|
23417
|
+
attribute: false
|
|
23372
23418
|
}
|
|
23373
23419
|
};
|
|
23374
23420
|
}
|
|
@@ -23645,27 +23691,15 @@ class AuroDatePicker extends LitElement {
|
|
|
23645
23691
|
configureDatepicker() {
|
|
23646
23692
|
this.addEventListener('focusin', () => {
|
|
23647
23693
|
|
|
23648
|
-
|
|
23649
|
-
* The datepicker is considered to be in it's initial state based on
|
|
23650
|
-
* if this.value === undefined. The first time we interact with the
|
|
23651
|
-
* datepicker manually, by applying focusin, we need to flag the
|
|
23652
|
-
* datepicker as no longer in the initial state.
|
|
23653
|
-
*/
|
|
23654
|
-
if (this.value === undefined) {
|
|
23655
|
-
this.value = '';
|
|
23656
|
-
}
|
|
23657
|
-
|
|
23658
|
-
if (this.valueEnd === undefined) {
|
|
23659
|
-
this.valueEnd = '';
|
|
23660
|
-
}
|
|
23694
|
+
this.touched = true;
|
|
23661
23695
|
});
|
|
23662
23696
|
|
|
23663
23697
|
this.addEventListener('focusout', (evt) => {
|
|
23664
|
-
if (!this.noValidate && !evt.detail.expanded && this.
|
|
23698
|
+
if (!this.noValidate && !evt.detail.expanded && this.touched) {
|
|
23665
23699
|
if (!this.contains(document.activeElement)) {
|
|
23666
23700
|
this.validation.validate(this.inputList[0]);
|
|
23667
23701
|
|
|
23668
|
-
if (this.inputList[1] && this.inputList[1].
|
|
23702
|
+
if (this.inputList[1] && this.inputList[1].touched) {
|
|
23669
23703
|
this.validation.validate(this.inputList[1]);
|
|
23670
23704
|
}
|
|
23671
23705
|
}
|
|
@@ -24052,6 +24086,7 @@ class AuroDatePicker extends LitElement {
|
|
|
24052
24086
|
setCustomValidityRangeOverflow="${this.setCustomValidityRangeOverflow}"
|
|
24053
24087
|
setCustomValidityRangeUnderflow="${this.setCustomValidityRangeUnderflow}"
|
|
24054
24088
|
?disabled="${this.disabled}"
|
|
24089
|
+
inputmode="${ifDefined(this.inputmode)}"
|
|
24055
24090
|
part="input">
|
|
24056
24091
|
<span slot="label"><slot name="fromLabel"></slot></span>
|
|
24057
24092
|
</${this.inputTag}>
|
|
@@ -107,7 +107,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
107
107
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
108
108
|
|
|
109
109
|
```html
|
|
110
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
110
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.3.0/auro-dropdown/+esm"></script>
|
|
111
111
|
```
|
|
112
112
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
113
|
|
|
@@ -107,7 +107,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
107
107
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
108
108
|
|
|
109
109
|
```html
|
|
110
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
110
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.3.0/auro-dropdown/+esm"></script>
|
|
111
111
|
```
|
|
112
112
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
113
113
|
|
|
@@ -109,7 +109,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
109
109
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
110
110
|
|
|
111
111
|
```html
|
|
112
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
112
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.3.0/auro-form/+esm"></script>
|
|
113
113
|
```
|
|
114
114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
115
115
|
|
|
@@ -109,7 +109,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
109
109
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
110
110
|
|
|
111
111
|
```html
|
|
112
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
112
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.3.0/auro-form/+esm"></script>
|
|
113
113
|
```
|
|
114
114
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
115
115
|
|
|
@@ -99,7 +99,7 @@ The use of any Auro custom element has a dependency on the [Auro Design Tokens](
|
|
|
99
99
|
In cases where the project is not able to process JS assets, there are pre-processed assets available for use. Legacy browsers such as IE11 are no longer supported.
|
|
100
100
|
|
|
101
101
|
```html
|
|
102
|
-
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.
|
|
102
|
+
<script type="module" src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-formkit@3.3.0/auro-input/+esm"></script>
|
|
103
103
|
```
|
|
104
104
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
105
105
|
|
|
@@ -30,6 +30,7 @@ Generate unique names for dependency components.
|
|
|
30
30
|
| [format](#format) | `format` | `string` | | Specifies the input mask format. |
|
|
31
31
|
| [icon](#icon) | `icon` | `boolean` | false | If set, will render an icon inside the input to the left of the value. Support is limited to auro-input instances with credit card format. |
|
|
32
32
|
| [id](#id) | `id` | `string` | | Sets the unique ID of the element. |
|
|
33
|
+
| [inputmode](#inputmode) | `inputmode` | `string` | | Exposes inputmode attribute for input. |
|
|
33
34
|
| [lang](#lang) | `lang` | `string` | | Defines the language of an element. |
|
|
34
35
|
| [max](#max) | `max` | `string` | "undefined" | The maximum value allowed. This only applies for inputs with a type of `number` and all date formats. |
|
|
35
36
|
| [maxLength](#maxLength) | `maxLength` | `number` | "undefined" | The maximum number of characters the user can enter into the text input. This must be an integer value `0` or higher. |
|
|
@@ -179,6 +180,29 @@ Use the `disable` attribute to prevent the user from interacting with the input.
|
|
|
179
180
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
180
181
|
</auro-accordion>
|
|
181
182
|
|
|
183
|
+
#### Input Mode
|
|
184
|
+
|
|
185
|
+
Set the input mode for the input.
|
|
186
|
+
|
|
187
|
+
*IMPORTANT:* If you are also passing a `type`, most browsers will use the `type` attribute to determine what keyboard to display on mobile devices and ignore the `inputmode` attribute.
|
|
188
|
+
|
|
189
|
+
<div class="exampleWrapper">
|
|
190
|
+
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/inputmode.html) -->
|
|
191
|
+
<!-- The below content is automatically added from ./../apiExamples/inputmode.html -->
|
|
192
|
+
<auro-input bordered inputmode="tel" />
|
|
193
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
194
|
+
</div>
|
|
195
|
+
<auro-accordion alignRight>
|
|
196
|
+
<span slot="trigger">See code</span>
|
|
197
|
+
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/inputmode.html) -->
|
|
198
|
+
<!-- The below code snippet is automatically added from ./../apiExamples/inputmode.html -->
|
|
199
|
+
|
|
200
|
+
```html
|
|
201
|
+
<auro-input bordered inputmode="tel" />
|
|
202
|
+
```
|
|
203
|
+
<!-- AURO-GENERATED-CONTENT:END -->
|
|
204
|
+
</auro-accordion>
|
|
205
|
+
|
|
182
206
|
### Placeholder <a name="placeholder"></a>
|
|
183
207
|
Use the `placeholder` attribute to add a custom placeholder message within the element.
|
|
184
208
|
|