@aurodesignsystem-dev/auro-formkit 0.0.0-pr1145.1 → 0.0.0-pr1156.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/components/checkbox/demo/api.min.js +2 -66
- package/components/checkbox/demo/index.min.js +2 -66
- package/components/checkbox/dist/index.js +2 -66
- package/components/checkbox/dist/registered.js +2 -66
- package/components/combobox/demo/api.md +37 -229
- package/components/combobox/demo/api.min.js +6 -155
- package/components/combobox/demo/index.md +0 -104
- package/components/combobox/demo/index.min.js +6 -155
- package/components/combobox/dist/auro-combobox.d.ts +1 -18
- package/components/combobox/dist/index.js +6 -155
- package/components/combobox/dist/registered.js +6 -155
- package/components/counter/demo/api.min.js +2 -66
- package/components/counter/demo/index.min.js +2 -66
- package/components/counter/dist/index.js +2 -66
- package/components/counter/dist/registered.js +2 -66
- package/components/datepicker/demo/api.min.js +5 -133
- package/components/datepicker/demo/index.min.js +5 -133
- package/components/datepicker/dist/index.js +5 -133
- package/components/datepicker/dist/registered.js +5 -133
- package/components/input/demo/api.min.js +3 -67
- package/components/input/demo/index.min.js +3 -67
- package/components/input/dist/index.js +3 -67
- package/components/input/dist/registered.js +3 -67
- package/components/radio/demo/api.min.js +2 -66
- package/components/radio/demo/index.min.js +2 -66
- package/components/radio/dist/index.js +2 -66
- package/components/radio/dist/registered.js +2 -66
- package/components/select/demo/api.min.js +3 -67
- package/components/select/demo/index.min.js +3 -67
- package/components/select/dist/index.js +3 -67
- package/components/select/dist/registered.js +3 -67
- package/package.json +1 -1
|
@@ -944,52 +944,6 @@ class AuroFormValidation {
|
|
|
944
944
|
message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
|
|
945
945
|
}
|
|
946
946
|
]
|
|
947
|
-
},
|
|
948
|
-
combobox: {
|
|
949
|
-
filter: [
|
|
950
|
-
{
|
|
951
|
-
check: (e) => {
|
|
952
|
-
|
|
953
|
-
// Guard Clause: If the behavior is not 'filter', skip this validation
|
|
954
|
-
if (e.behavior !== 'filter') return false;
|
|
955
|
-
|
|
956
|
-
// Get the current input value
|
|
957
|
-
const currentInputValue = e.input.value;
|
|
958
|
-
|
|
959
|
-
// Skip validation if the input has no value
|
|
960
|
-
if (!currentInputValue) return false;
|
|
961
|
-
|
|
962
|
-
/**
|
|
963
|
-
* Let's check if the option selected and combobox value match.
|
|
964
|
-
*/
|
|
965
|
-
|
|
966
|
-
// Guard Clause: If there is no option selected fail the validation
|
|
967
|
-
if (!e.optionSelected) return true;
|
|
968
|
-
|
|
969
|
-
// Guard Clause: If there is no value fail the validation
|
|
970
|
-
if (!e.value) return true;
|
|
971
|
-
|
|
972
|
-
// Guard Clause: If the selected option's value doesn't match the input value fail the validation
|
|
973
|
-
if (e.optionSelected.value !== e.value) return true;
|
|
974
|
-
|
|
975
|
-
/**
|
|
976
|
-
* Now let's make sure the user hasn't change the value in the input after selecting an option.
|
|
977
|
-
* This is to make sure there's no user confusion if they select an option but then change the value to something else.
|
|
978
|
-
*/
|
|
979
|
-
|
|
980
|
-
// Guard Clause: If the current input value doesn't match the option selected value fail the validation
|
|
981
|
-
if (currentInputValue && currentInputValue !== e.optionSelected.value) return true;
|
|
982
|
-
|
|
983
|
-
// Guard Clause: If the current input value doesn't match the combobox value fail the validation
|
|
984
|
-
if (currentInputValue && currentInputValue !== e.value) return true;
|
|
985
|
-
|
|
986
|
-
// If all the checks passed the validation passes
|
|
987
|
-
return false;
|
|
988
|
-
},
|
|
989
|
-
validity: 'valueMissing',
|
|
990
|
-
message: e => e.getAttribute('setCustomValidityValueMissingFilter') || e.setCustomValidity || ''
|
|
991
|
-
}
|
|
992
|
-
]
|
|
993
947
|
}
|
|
994
948
|
};
|
|
995
949
|
|
|
@@ -998,8 +952,6 @@ class AuroFormValidation {
|
|
|
998
952
|
elementType = 'input';
|
|
999
953
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
1000
954
|
elementType = 'counter';
|
|
1001
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
|
|
1002
|
-
elementType = 'combobox';
|
|
1003
955
|
}
|
|
1004
956
|
|
|
1005
957
|
if (elementType) {
|
|
@@ -1178,15 +1130,6 @@ class AuroFormValidation {
|
|
|
1178
1130
|
}
|
|
1179
1131
|
}
|
|
1180
1132
|
|
|
1181
|
-
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1182
|
-
|
|
1183
|
-
if (isCombobox) {
|
|
1184
|
-
|
|
1185
|
-
if (!elem.persistInput || elem.behavior === "filter") {
|
|
1186
|
-
hasValue = elem.input.value?.length > 0;
|
|
1187
|
-
}
|
|
1188
|
-
}
|
|
1189
|
-
|
|
1190
1133
|
if (!hasValue && elem.required && elem.touched) {
|
|
1191
1134
|
elem.validity = 'valueMissing';
|
|
1192
1135
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
@@ -1195,11 +1138,6 @@ class AuroFormValidation {
|
|
|
1195
1138
|
this.validateElementAttributes(elem);
|
|
1196
1139
|
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1197
1140
|
this.validateElementAttributes(elem);
|
|
1198
|
-
} else if (isCombobox) {
|
|
1199
|
-
this.validateElementAttributes(elem);
|
|
1200
|
-
|
|
1201
|
-
// Don't run extra validation for cases where the combobox is not being used as a filter
|
|
1202
|
-
validationShouldRun = elem.behavior !== 'filter';
|
|
1203
1141
|
}
|
|
1204
1142
|
}
|
|
1205
1143
|
|
|
@@ -1207,8 +1145,8 @@ class AuroFormValidation {
|
|
|
1207
1145
|
|
|
1208
1146
|
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1209
1147
|
|
|
1210
|
-
// Don't reset combobox validity if
|
|
1211
|
-
if (!isCombobox || isCombobox && !elem.
|
|
1148
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
1149
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
1212
1150
|
|
|
1213
1151
|
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
1214
1152
|
this.auroInputElements.forEach(input => input.validate());
|
|
@@ -1281,8 +1219,6 @@ class AuroFormValidation {
|
|
|
1281
1219
|
if (input.validationMessage.length > 0) {
|
|
1282
1220
|
elem.errorMessage = input.validationMessage;
|
|
1283
1221
|
}
|
|
1284
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
|
|
1285
|
-
elem.errorMessage = elem.input?.inputElement?.validationMessage;
|
|
1286
1222
|
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
1287
1223
|
const firstInput = this.inputElements[0];
|
|
1288
1224
|
|
|
@@ -936,52 +936,6 @@ class AuroFormValidation {
|
|
|
936
936
|
message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
|
|
937
937
|
}
|
|
938
938
|
]
|
|
939
|
-
},
|
|
940
|
-
combobox: {
|
|
941
|
-
filter: [
|
|
942
|
-
{
|
|
943
|
-
check: (e) => {
|
|
944
|
-
|
|
945
|
-
// Guard Clause: If the behavior is not 'filter', skip this validation
|
|
946
|
-
if (e.behavior !== 'filter') return false;
|
|
947
|
-
|
|
948
|
-
// Get the current input value
|
|
949
|
-
const currentInputValue = e.input.value;
|
|
950
|
-
|
|
951
|
-
// Skip validation if the input has no value
|
|
952
|
-
if (!currentInputValue) return false;
|
|
953
|
-
|
|
954
|
-
/**
|
|
955
|
-
* Let's check if the option selected and combobox value match.
|
|
956
|
-
*/
|
|
957
|
-
|
|
958
|
-
// Guard Clause: If there is no option selected fail the validation
|
|
959
|
-
if (!e.optionSelected) return true;
|
|
960
|
-
|
|
961
|
-
// Guard Clause: If there is no value fail the validation
|
|
962
|
-
if (!e.value) return true;
|
|
963
|
-
|
|
964
|
-
// Guard Clause: If the selected option's value doesn't match the input value fail the validation
|
|
965
|
-
if (e.optionSelected.value !== e.value) return true;
|
|
966
|
-
|
|
967
|
-
/**
|
|
968
|
-
* Now let's make sure the user hasn't change the value in the input after selecting an option.
|
|
969
|
-
* This is to make sure there's no user confusion if they select an option but then change the value to something else.
|
|
970
|
-
*/
|
|
971
|
-
|
|
972
|
-
// Guard Clause: If the current input value doesn't match the option selected value fail the validation
|
|
973
|
-
if (currentInputValue && currentInputValue !== e.optionSelected.value) return true;
|
|
974
|
-
|
|
975
|
-
// Guard Clause: If the current input value doesn't match the combobox value fail the validation
|
|
976
|
-
if (currentInputValue && currentInputValue !== e.value) return true;
|
|
977
|
-
|
|
978
|
-
// If all the checks passed the validation passes
|
|
979
|
-
return false;
|
|
980
|
-
},
|
|
981
|
-
validity: 'valueMissing',
|
|
982
|
-
message: e => e.getAttribute('setCustomValidityValueMissingFilter') || e.setCustomValidity || ''
|
|
983
|
-
}
|
|
984
|
-
]
|
|
985
939
|
}
|
|
986
940
|
};
|
|
987
941
|
|
|
@@ -990,8 +944,6 @@ class AuroFormValidation {
|
|
|
990
944
|
elementType = 'input';
|
|
991
945
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
992
946
|
elementType = 'counter';
|
|
993
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
|
|
994
|
-
elementType = 'combobox';
|
|
995
947
|
}
|
|
996
948
|
|
|
997
949
|
if (elementType) {
|
|
@@ -1170,15 +1122,6 @@ class AuroFormValidation {
|
|
|
1170
1122
|
}
|
|
1171
1123
|
}
|
|
1172
1124
|
|
|
1173
|
-
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1174
|
-
|
|
1175
|
-
if (isCombobox) {
|
|
1176
|
-
|
|
1177
|
-
if (!elem.persistInput || elem.behavior === "filter") {
|
|
1178
|
-
hasValue = elem.input.value?.length > 0;
|
|
1179
|
-
}
|
|
1180
|
-
}
|
|
1181
|
-
|
|
1182
1125
|
if (!hasValue && elem.required && elem.touched) {
|
|
1183
1126
|
elem.validity = 'valueMissing';
|
|
1184
1127
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
@@ -1187,11 +1130,6 @@ class AuroFormValidation {
|
|
|
1187
1130
|
this.validateElementAttributes(elem);
|
|
1188
1131
|
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1189
1132
|
this.validateElementAttributes(elem);
|
|
1190
|
-
} else if (isCombobox) {
|
|
1191
|
-
this.validateElementAttributes(elem);
|
|
1192
|
-
|
|
1193
|
-
// Don't run extra validation for cases where the combobox is not being used as a filter
|
|
1194
|
-
validationShouldRun = elem.behavior !== 'filter';
|
|
1195
1133
|
}
|
|
1196
1134
|
}
|
|
1197
1135
|
|
|
@@ -1199,8 +1137,8 @@ class AuroFormValidation {
|
|
|
1199
1137
|
|
|
1200
1138
|
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1201
1139
|
|
|
1202
|
-
// Don't reset combobox validity if
|
|
1203
|
-
if (!isCombobox || isCombobox && !elem.
|
|
1140
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
1141
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
1204
1142
|
|
|
1205
1143
|
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
1206
1144
|
this.auroInputElements.forEach(input => input.validate());
|
|
@@ -1273,8 +1211,6 @@ class AuroFormValidation {
|
|
|
1273
1211
|
if (input.validationMessage.length > 0) {
|
|
1274
1212
|
elem.errorMessage = input.validationMessage;
|
|
1275
1213
|
}
|
|
1276
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
|
|
1277
|
-
elem.errorMessage = elem.input?.inputElement?.validationMessage;
|
|
1278
1214
|
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
1279
1215
|
const firstInput = this.inputElements[0];
|
|
1280
1216
|
|
|
@@ -889,52 +889,6 @@ class AuroFormValidation {
|
|
|
889
889
|
message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
|
|
890
890
|
}
|
|
891
891
|
]
|
|
892
|
-
},
|
|
893
|
-
combobox: {
|
|
894
|
-
filter: [
|
|
895
|
-
{
|
|
896
|
-
check: (e) => {
|
|
897
|
-
|
|
898
|
-
// Guard Clause: If the behavior is not 'filter', skip this validation
|
|
899
|
-
if (e.behavior !== 'filter') return false;
|
|
900
|
-
|
|
901
|
-
// Get the current input value
|
|
902
|
-
const currentInputValue = e.input.value;
|
|
903
|
-
|
|
904
|
-
// Skip validation if the input has no value
|
|
905
|
-
if (!currentInputValue) return false;
|
|
906
|
-
|
|
907
|
-
/**
|
|
908
|
-
* Let's check if the option selected and combobox value match.
|
|
909
|
-
*/
|
|
910
|
-
|
|
911
|
-
// Guard Clause: If there is no option selected fail the validation
|
|
912
|
-
if (!e.optionSelected) return true;
|
|
913
|
-
|
|
914
|
-
// Guard Clause: If there is no value fail the validation
|
|
915
|
-
if (!e.value) return true;
|
|
916
|
-
|
|
917
|
-
// Guard Clause: If the selected option's value doesn't match the input value fail the validation
|
|
918
|
-
if (e.optionSelected.value !== e.value) return true;
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* Now let's make sure the user hasn't change the value in the input after selecting an option.
|
|
922
|
-
* This is to make sure there's no user confusion if they select an option but then change the value to something else.
|
|
923
|
-
*/
|
|
924
|
-
|
|
925
|
-
// Guard Clause: If the current input value doesn't match the option selected value fail the validation
|
|
926
|
-
if (currentInputValue && currentInputValue !== e.optionSelected.value) return true;
|
|
927
|
-
|
|
928
|
-
// Guard Clause: If the current input value doesn't match the combobox value fail the validation
|
|
929
|
-
if (currentInputValue && currentInputValue !== e.value) return true;
|
|
930
|
-
|
|
931
|
-
// If all the checks passed the validation passes
|
|
932
|
-
return false;
|
|
933
|
-
},
|
|
934
|
-
validity: 'valueMissing',
|
|
935
|
-
message: e => e.getAttribute('setCustomValidityValueMissingFilter') || e.setCustomValidity || ''
|
|
936
|
-
}
|
|
937
|
-
]
|
|
938
892
|
}
|
|
939
893
|
};
|
|
940
894
|
|
|
@@ -943,8 +897,6 @@ class AuroFormValidation {
|
|
|
943
897
|
elementType = 'input';
|
|
944
898
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
945
899
|
elementType = 'counter';
|
|
946
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
|
|
947
|
-
elementType = 'combobox';
|
|
948
900
|
}
|
|
949
901
|
|
|
950
902
|
if (elementType) {
|
|
@@ -1123,15 +1075,6 @@ class AuroFormValidation {
|
|
|
1123
1075
|
}
|
|
1124
1076
|
}
|
|
1125
1077
|
|
|
1126
|
-
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1127
|
-
|
|
1128
|
-
if (isCombobox) {
|
|
1129
|
-
|
|
1130
|
-
if (!elem.persistInput || elem.behavior === "filter") {
|
|
1131
|
-
hasValue = elem.input.value?.length > 0;
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
1078
|
if (!hasValue && elem.required && elem.touched) {
|
|
1136
1079
|
elem.validity = 'valueMissing';
|
|
1137
1080
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
@@ -1140,11 +1083,6 @@ class AuroFormValidation {
|
|
|
1140
1083
|
this.validateElementAttributes(elem);
|
|
1141
1084
|
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1142
1085
|
this.validateElementAttributes(elem);
|
|
1143
|
-
} else if (isCombobox) {
|
|
1144
|
-
this.validateElementAttributes(elem);
|
|
1145
|
-
|
|
1146
|
-
// Don't run extra validation for cases where the combobox is not being used as a filter
|
|
1147
|
-
validationShouldRun = elem.behavior !== 'filter';
|
|
1148
1086
|
}
|
|
1149
1087
|
}
|
|
1150
1088
|
|
|
@@ -1152,8 +1090,8 @@ class AuroFormValidation {
|
|
|
1152
1090
|
|
|
1153
1091
|
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1154
1092
|
|
|
1155
|
-
// Don't reset combobox validity if
|
|
1156
|
-
if (!isCombobox || isCombobox && !elem.
|
|
1093
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
1094
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
1157
1095
|
|
|
1158
1096
|
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
1159
1097
|
this.auroInputElements.forEach(input => input.validate());
|
|
@@ -1226,8 +1164,6 @@ class AuroFormValidation {
|
|
|
1226
1164
|
if (input.validationMessage.length > 0) {
|
|
1227
1165
|
elem.errorMessage = input.validationMessage;
|
|
1228
1166
|
}
|
|
1229
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
|
|
1230
|
-
elem.errorMessage = elem.input?.inputElement?.validationMessage;
|
|
1231
1167
|
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
1232
1168
|
const firstInput = this.inputElements[0];
|
|
1233
1169
|
|
|
@@ -889,52 +889,6 @@ class AuroFormValidation {
|
|
|
889
889
|
message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
|
|
890
890
|
}
|
|
891
891
|
]
|
|
892
|
-
},
|
|
893
|
-
combobox: {
|
|
894
|
-
filter: [
|
|
895
|
-
{
|
|
896
|
-
check: (e) => {
|
|
897
|
-
|
|
898
|
-
// Guard Clause: If the behavior is not 'filter', skip this validation
|
|
899
|
-
if (e.behavior !== 'filter') return false;
|
|
900
|
-
|
|
901
|
-
// Get the current input value
|
|
902
|
-
const currentInputValue = e.input.value;
|
|
903
|
-
|
|
904
|
-
// Skip validation if the input has no value
|
|
905
|
-
if (!currentInputValue) return false;
|
|
906
|
-
|
|
907
|
-
/**
|
|
908
|
-
* Let's check if the option selected and combobox value match.
|
|
909
|
-
*/
|
|
910
|
-
|
|
911
|
-
// Guard Clause: If there is no option selected fail the validation
|
|
912
|
-
if (!e.optionSelected) return true;
|
|
913
|
-
|
|
914
|
-
// Guard Clause: If there is no value fail the validation
|
|
915
|
-
if (!e.value) return true;
|
|
916
|
-
|
|
917
|
-
// Guard Clause: If the selected option's value doesn't match the input value fail the validation
|
|
918
|
-
if (e.optionSelected.value !== e.value) return true;
|
|
919
|
-
|
|
920
|
-
/**
|
|
921
|
-
* Now let's make sure the user hasn't change the value in the input after selecting an option.
|
|
922
|
-
* This is to make sure there's no user confusion if they select an option but then change the value to something else.
|
|
923
|
-
*/
|
|
924
|
-
|
|
925
|
-
// Guard Clause: If the current input value doesn't match the option selected value fail the validation
|
|
926
|
-
if (currentInputValue && currentInputValue !== e.optionSelected.value) return true;
|
|
927
|
-
|
|
928
|
-
// Guard Clause: If the current input value doesn't match the combobox value fail the validation
|
|
929
|
-
if (currentInputValue && currentInputValue !== e.value) return true;
|
|
930
|
-
|
|
931
|
-
// If all the checks passed the validation passes
|
|
932
|
-
return false;
|
|
933
|
-
},
|
|
934
|
-
validity: 'valueMissing',
|
|
935
|
-
message: e => e.getAttribute('setCustomValidityValueMissingFilter') || e.setCustomValidity || ''
|
|
936
|
-
}
|
|
937
|
-
]
|
|
938
892
|
}
|
|
939
893
|
};
|
|
940
894
|
|
|
@@ -943,8 +897,6 @@ class AuroFormValidation {
|
|
|
943
897
|
elementType = 'input';
|
|
944
898
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
945
899
|
elementType = 'counter';
|
|
946
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
|
|
947
|
-
elementType = 'combobox';
|
|
948
900
|
}
|
|
949
901
|
|
|
950
902
|
if (elementType) {
|
|
@@ -1123,15 +1075,6 @@ class AuroFormValidation {
|
|
|
1123
1075
|
}
|
|
1124
1076
|
}
|
|
1125
1077
|
|
|
1126
|
-
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1127
|
-
|
|
1128
|
-
if (isCombobox) {
|
|
1129
|
-
|
|
1130
|
-
if (!elem.persistInput || elem.behavior === "filter") {
|
|
1131
|
-
hasValue = elem.input.value?.length > 0;
|
|
1132
|
-
}
|
|
1133
|
-
}
|
|
1134
|
-
|
|
1135
1078
|
if (!hasValue && elem.required && elem.touched) {
|
|
1136
1079
|
elem.validity = 'valueMissing';
|
|
1137
1080
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
@@ -1140,11 +1083,6 @@ class AuroFormValidation {
|
|
|
1140
1083
|
this.validateElementAttributes(elem);
|
|
1141
1084
|
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
1142
1085
|
this.validateElementAttributes(elem);
|
|
1143
|
-
} else if (isCombobox) {
|
|
1144
|
-
this.validateElementAttributes(elem);
|
|
1145
|
-
|
|
1146
|
-
// Don't run extra validation for cases where the combobox is not being used as a filter
|
|
1147
|
-
validationShouldRun = elem.behavior !== 'filter';
|
|
1148
1086
|
}
|
|
1149
1087
|
}
|
|
1150
1088
|
|
|
@@ -1152,8 +1090,8 @@ class AuroFormValidation {
|
|
|
1152
1090
|
|
|
1153
1091
|
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
1154
1092
|
|
|
1155
|
-
// Don't reset combobox validity if
|
|
1156
|
-
if (!isCombobox || isCombobox && !elem.
|
|
1093
|
+
// Don't reset combobox validity if persistValue is set since we can't use the input value to validate
|
|
1094
|
+
if (!isCombobox || isCombobox && !elem.persistValue) {
|
|
1157
1095
|
|
|
1158
1096
|
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
1159
1097
|
this.auroInputElements.forEach(input => input.validate());
|
|
@@ -1226,8 +1164,6 @@ class AuroFormValidation {
|
|
|
1226
1164
|
if (input.validationMessage.length > 0) {
|
|
1227
1165
|
elem.errorMessage = input.validationMessage;
|
|
1228
1166
|
}
|
|
1229
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
|
|
1230
|
-
elem.errorMessage = elem.input?.inputElement?.validationMessage;
|
|
1231
1167
|
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
1232
1168
|
const firstInput = this.inputElements[0];
|
|
1233
1169
|
|