@aurodesignsystem-dev/auro-formkit 0.0.0-pr1175.0 → 0.0.0-pr1183.1
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 +66 -2
- package/components/checkbox/demo/index.min.js +66 -2
- package/components/checkbox/dist/index.js +66 -2
- package/components/checkbox/dist/registered.js +66 -2
- package/components/combobox/demo/api.md +230 -38
- package/components/combobox/demo/api.min.js +160 -11
- package/components/combobox/demo/index.md +104 -0
- package/components/combobox/demo/index.min.js +160 -11
- package/components/combobox/dist/auro-combobox.d.ts +18 -1
- package/components/combobox/dist/index.js +160 -11
- package/components/combobox/dist/registered.js +160 -11
- package/components/counter/demo/api.min.js +71 -7
- package/components/counter/demo/index.min.js +71 -7
- package/components/counter/dist/index.js +71 -7
- package/components/counter/dist/registered.js +71 -7
- package/components/datepicker/demo/api.md +37 -0
- package/components/datepicker/demo/api.min.js +175 -12
- package/components/datepicker/demo/index.min.js +175 -12
- package/components/datepicker/dist/auro-calendar-cell.d.ts +6 -0
- package/components/datepicker/dist/auro-datepicker.d.ts +8 -0
- package/components/datepicker/dist/index.js +175 -12
- package/components/datepicker/dist/registered.js +175 -12
- package/components/dropdown/demo/api.min.js +2 -2
- package/components/dropdown/demo/index.min.js +2 -2
- package/components/dropdown/dist/index.js +2 -2
- package/components/dropdown/dist/registered.js +2 -2
- package/components/input/demo/api.min.js +69 -5
- package/components/input/demo/index.min.js +69 -5
- package/components/input/dist/index.js +69 -5
- package/components/input/dist/registered.js +69 -5
- package/components/radio/demo/api.min.js +98 -6
- package/components/radio/demo/index.min.js +98 -6
- package/components/radio/dist/auro-radio-group.d.ts +14 -0
- package/components/radio/dist/index.js +98 -6
- package/components/radio/dist/registered.js +98 -6
- package/components/select/demo/api.min.js +68 -4
- package/components/select/demo/index.min.js +68 -4
- package/components/select/dist/index.js +68 -4
- package/components/select/dist/registered.js +68 -4
- package/package.json +1 -1
|
@@ -701,6 +701,52 @@ class AuroFormValidation {
|
|
|
701
701
|
message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
|
|
702
702
|
}
|
|
703
703
|
]
|
|
704
|
+
},
|
|
705
|
+
combobox: {
|
|
706
|
+
filter: [
|
|
707
|
+
{
|
|
708
|
+
check: (e) => {
|
|
709
|
+
|
|
710
|
+
// Guard Clause: If the behavior is not 'filter', skip this validation
|
|
711
|
+
if (e.behavior !== 'filter') return false;
|
|
712
|
+
|
|
713
|
+
// Get the current input value
|
|
714
|
+
const currentInputValue = e.input.value;
|
|
715
|
+
|
|
716
|
+
// Skip validation if the input has no value
|
|
717
|
+
if (!currentInputValue) return false;
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Let's check if the option selected and combobox value match.
|
|
721
|
+
*/
|
|
722
|
+
|
|
723
|
+
// Guard Clause: If there is no option selected fail the validation
|
|
724
|
+
if (!e.optionSelected) return true;
|
|
725
|
+
|
|
726
|
+
// Guard Clause: If there is no value fail the validation
|
|
727
|
+
if (!e.value) return true;
|
|
728
|
+
|
|
729
|
+
// Guard Clause: If the selected option's value doesn't match the input value fail the validation
|
|
730
|
+
if (e.optionSelected.value !== e.value) return true;
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Now let's make sure the user hasn't change the value in the input after selecting an option.
|
|
734
|
+
* This is to make sure there's no user confusion if they select an option but then change the value to something else.
|
|
735
|
+
*/
|
|
736
|
+
|
|
737
|
+
// Guard Clause: If the current input value doesn't match the option selected value fail the validation
|
|
738
|
+
if (currentInputValue && currentInputValue !== e.optionSelected.value) return true;
|
|
739
|
+
|
|
740
|
+
// Guard Clause: If the current input value doesn't match the combobox value fail the validation
|
|
741
|
+
if (currentInputValue && currentInputValue !== e.value) return true;
|
|
742
|
+
|
|
743
|
+
// If all the checks passed the validation passes
|
|
744
|
+
return false;
|
|
745
|
+
},
|
|
746
|
+
validity: 'valueMissing',
|
|
747
|
+
message: e => e.getAttribute('setCustomValidityValueMissingFilter') || e.setCustomValidity || ''
|
|
748
|
+
}
|
|
749
|
+
]
|
|
704
750
|
}
|
|
705
751
|
};
|
|
706
752
|
|
|
@@ -709,6 +755,8 @@ class AuroFormValidation {
|
|
|
709
755
|
elementType = 'input';
|
|
710
756
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
711
757
|
elementType = 'counter';
|
|
758
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
|
|
759
|
+
elementType = 'combobox';
|
|
712
760
|
}
|
|
713
761
|
|
|
714
762
|
if (elementType) {
|
|
@@ -895,6 +943,15 @@ class AuroFormValidation {
|
|
|
895
943
|
}
|
|
896
944
|
}
|
|
897
945
|
|
|
946
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
947
|
+
|
|
948
|
+
if (isCombobox) {
|
|
949
|
+
|
|
950
|
+
if (!elem.persistInput || elem.behavior === "filter") {
|
|
951
|
+
hasValue = elem.input.value?.length > 0;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
898
955
|
if (!hasValue && elem.required && elem.touched) {
|
|
899
956
|
elem.validity = 'valueMissing';
|
|
900
957
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
@@ -903,6 +960,11 @@ class AuroFormValidation {
|
|
|
903
960
|
this.validateElementAttributes(elem);
|
|
904
961
|
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
905
962
|
this.validateElementAttributes(elem);
|
|
963
|
+
} else if (isCombobox) {
|
|
964
|
+
this.validateElementAttributes(elem);
|
|
965
|
+
|
|
966
|
+
// Don't run extra validation for cases where the combobox is not being used as a filter
|
|
967
|
+
validationShouldRun = elem.behavior !== 'filter';
|
|
906
968
|
}
|
|
907
969
|
}
|
|
908
970
|
|
|
@@ -910,8 +972,8 @@ class AuroFormValidation {
|
|
|
910
972
|
|
|
911
973
|
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
912
974
|
|
|
913
|
-
// Don't reset combobox validity if
|
|
914
|
-
if (!isCombobox || isCombobox && !elem.
|
|
975
|
+
// Don't reset combobox validity if persistInput is set since we can't use the input value to validate
|
|
976
|
+
if (!isCombobox || isCombobox && !elem.persistInput) {
|
|
915
977
|
|
|
916
978
|
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
917
979
|
this.auroInputElements.forEach(input => input.validate());
|
|
@@ -984,6 +1046,8 @@ class AuroFormValidation {
|
|
|
984
1046
|
if (input.validationMessage.length > 0) {
|
|
985
1047
|
elem.errorMessage = input.validationMessage;
|
|
986
1048
|
}
|
|
1049
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
|
|
1050
|
+
elem.errorMessage = elem.input?.inputElement?.validationMessage;
|
|
987
1051
|
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
988
1052
|
const firstInput = this.inputElements[0];
|
|
989
1053
|
|
|
@@ -3919,13 +3983,13 @@ var dropdownVersion$1 = '3.0.0';
|
|
|
3919
3983
|
|
|
3920
3984
|
var shapeSizeCss = css`.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:56px;max-height:56px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:58px;max-height:58px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:56px;max-height:56px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:54px;max-height:54px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-box-lg{min-height:52px;max-height:52px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-box-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-box-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-box-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-box-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-box-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-box-sm{min-height:32px;max-height:32px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-sm.simple{border-width:0px;min-height:36px;max-height:36px;background-color:unset;box-shadow:none}.shape-box-sm.thin{border-width:1px;min-height:34px;max-height:34px;background-color:unset}.shape-box-sm.parentBorder{border:0;box-shadow:unset;min-height:32px;max-height:32px}.shape-box-xs{min-height:20px;max-height:20px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xs.simple{border-width:0px;min-height:24px;max-height:24px;background-color:unset;box-shadow:none}.shape-box-xs.thin{border-width:1px;min-height:22px;max-height:22px;background-color:unset}.shape-box-xs.parentBorder{border:0;box-shadow:unset;min-height:20px;max-height:20px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
3921
3985
|
|
|
3922
|
-
var colorCss$1$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([
|
|
3986
|
+
var colorCss$1$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([disabled],[onDark])) .wrapper:focus-within,:host(:not([disabled],[onDark])) .wrapper:active,:host(:not([disabled],[appearance=inverse])) .wrapper:focus-within,:host(:not([disabled],[appearance=inverse])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([ondark])) .wrapper,:host(:not([appearance=inverse])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:hover,:host(:not([appearance=inverse])) .wrapper:hover{--ds-auro-dropdown-trigger-background-color: var(--ds-auro-dropdown-trigger-hover-background-color)}:host(:not([onDark])[disabled]),:host(:not([appearance=inverse])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([onDark])[disabled]) #triggerLabel,:host(:not([appearance=inverse])[disabled]) #triggerLabel{cursor:default}:host(:not([ondark])[error]),:host(:not([appearance=inverse])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([disabled])[onDark]) .wrapper:focus-within,:host(:not([disabled])[onDark]) .wrapper:active,:host(:not([disabled])[appearance=inverse]) .wrapper:focus-within,:host(:not([disabled])[appearance=inverse]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark]) .label,:host([onDark]) .helpText,:host([appearance=inverse]) .label,:host([appearance=inverse]) .helpText{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper,:host([appearance=inverse]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:hover,:host([appearance=inverse]) .wrapper:hover{--ds-auro-dropdown-trigger-background-color: var(--ds-auro-dropdown-trigger-hover-background-color)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([onDark][disabled]) #triggerLabel,:host([appearance=inverse][disabled]) #triggerLabel{cursor:default}:host([ondark][error]),:host([appearance=inverse][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
3923
3987
|
|
|
3924
3988
|
var styleCss$1$1 = css`:host{position:relative;display:block;text-align:left}[popover=manual]{overflow:visible;padding:0;border:inherit;margin:0;background:inherit;outline:inherit}:host([open]){z-index:var(--depth-tooltip, 400)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
3925
3989
|
|
|
3926
3990
|
var classicColorCss = css``;
|
|
3927
3991
|
|
|
3928
|
-
var classicLayoutCss = css
|
|
3992
|
+
var classicLayoutCss = css`@media(hover: hover){:host(:not([disabled])) .wrapper:hover{cursor:pointer}}:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) label{transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}`;
|
|
3929
3993
|
|
|
3930
3994
|
var styleEmphasizedCss = css`.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
3931
3995
|
|
|
@@ -701,6 +701,52 @@ class AuroFormValidation {
|
|
|
701
701
|
message: e => e.getAttribute('setCustomValidityRangeUnderflow') || ''
|
|
702
702
|
}
|
|
703
703
|
]
|
|
704
|
+
},
|
|
705
|
+
combobox: {
|
|
706
|
+
filter: [
|
|
707
|
+
{
|
|
708
|
+
check: (e) => {
|
|
709
|
+
|
|
710
|
+
// Guard Clause: If the behavior is not 'filter', skip this validation
|
|
711
|
+
if (e.behavior !== 'filter') return false;
|
|
712
|
+
|
|
713
|
+
// Get the current input value
|
|
714
|
+
const currentInputValue = e.input.value;
|
|
715
|
+
|
|
716
|
+
// Skip validation if the input has no value
|
|
717
|
+
if (!currentInputValue) return false;
|
|
718
|
+
|
|
719
|
+
/**
|
|
720
|
+
* Let's check if the option selected and combobox value match.
|
|
721
|
+
*/
|
|
722
|
+
|
|
723
|
+
// Guard Clause: If there is no option selected fail the validation
|
|
724
|
+
if (!e.optionSelected) return true;
|
|
725
|
+
|
|
726
|
+
// Guard Clause: If there is no value fail the validation
|
|
727
|
+
if (!e.value) return true;
|
|
728
|
+
|
|
729
|
+
// Guard Clause: If the selected option's value doesn't match the input value fail the validation
|
|
730
|
+
if (e.optionSelected.value !== e.value) return true;
|
|
731
|
+
|
|
732
|
+
/**
|
|
733
|
+
* Now let's make sure the user hasn't change the value in the input after selecting an option.
|
|
734
|
+
* This is to make sure there's no user confusion if they select an option but then change the value to something else.
|
|
735
|
+
*/
|
|
736
|
+
|
|
737
|
+
// Guard Clause: If the current input value doesn't match the option selected value fail the validation
|
|
738
|
+
if (currentInputValue && currentInputValue !== e.optionSelected.value) return true;
|
|
739
|
+
|
|
740
|
+
// Guard Clause: If the current input value doesn't match the combobox value fail the validation
|
|
741
|
+
if (currentInputValue && currentInputValue !== e.value) return true;
|
|
742
|
+
|
|
743
|
+
// If all the checks passed the validation passes
|
|
744
|
+
return false;
|
|
745
|
+
},
|
|
746
|
+
validity: 'valueMissing',
|
|
747
|
+
message: e => e.getAttribute('setCustomValidityValueMissingFilter') || e.setCustomValidity || ''
|
|
748
|
+
}
|
|
749
|
+
]
|
|
704
750
|
}
|
|
705
751
|
};
|
|
706
752
|
|
|
@@ -709,6 +755,8 @@ class AuroFormValidation {
|
|
|
709
755
|
elementType = 'input';
|
|
710
756
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group')) {
|
|
711
757
|
elementType = 'counter';
|
|
758
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox')) {
|
|
759
|
+
elementType = 'combobox';
|
|
712
760
|
}
|
|
713
761
|
|
|
714
762
|
if (elementType) {
|
|
@@ -895,6 +943,15 @@ class AuroFormValidation {
|
|
|
895
943
|
}
|
|
896
944
|
}
|
|
897
945
|
|
|
946
|
+
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
947
|
+
|
|
948
|
+
if (isCombobox) {
|
|
949
|
+
|
|
950
|
+
if (!elem.persistInput || elem.behavior === "filter") {
|
|
951
|
+
hasValue = elem.input.value?.length > 0;
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
898
955
|
if (!hasValue && elem.required && elem.touched) {
|
|
899
956
|
elem.validity = 'valueMissing';
|
|
900
957
|
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
@@ -903,6 +960,11 @@ class AuroFormValidation {
|
|
|
903
960
|
this.validateElementAttributes(elem);
|
|
904
961
|
} else if (hasValue && (this.runtimeUtils.elementMatch(elem, 'auro-counter') || this.runtimeUtils.elementMatch(elem, 'auro-counter-group'))) {
|
|
905
962
|
this.validateElementAttributes(elem);
|
|
963
|
+
} else if (isCombobox) {
|
|
964
|
+
this.validateElementAttributes(elem);
|
|
965
|
+
|
|
966
|
+
// Don't run extra validation for cases where the combobox is not being used as a filter
|
|
967
|
+
validationShouldRun = elem.behavior !== 'filter';
|
|
906
968
|
}
|
|
907
969
|
}
|
|
908
970
|
|
|
@@ -910,8 +972,8 @@ class AuroFormValidation {
|
|
|
910
972
|
|
|
911
973
|
const isCombobox = this.runtimeUtils.elementMatch(elem, 'auro-combobox');
|
|
912
974
|
|
|
913
|
-
// Don't reset combobox validity if
|
|
914
|
-
if (!isCombobox || isCombobox && !elem.
|
|
975
|
+
// Don't reset combobox validity if persistInput is set since we can't use the input value to validate
|
|
976
|
+
if (!isCombobox || isCombobox && !elem.persistInput) {
|
|
915
977
|
|
|
916
978
|
// run validation on all inputs since we're going to use them to set the validity of this component
|
|
917
979
|
this.auroInputElements.forEach(input => input.validate());
|
|
@@ -984,6 +1046,8 @@ class AuroFormValidation {
|
|
|
984
1046
|
if (input.validationMessage.length > 0) {
|
|
985
1047
|
elem.errorMessage = input.validationMessage;
|
|
986
1048
|
}
|
|
1049
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-combobox') && elem.errorMessage === '') {
|
|
1050
|
+
elem.errorMessage = elem.input?.inputElement?.validationMessage;
|
|
987
1051
|
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
988
1052
|
const firstInput = this.inputElements[0];
|
|
989
1053
|
|
|
@@ -3919,13 +3983,13 @@ var dropdownVersion$1 = '3.0.0';
|
|
|
3919
3983
|
|
|
3920
3984
|
var shapeSizeCss = css`.shape-classic-xl,.shape-classic-lg,.shape-classic-md,.shape-classic-sm,.shape-classic-xs{min-height:56px;max-height:56px;border-style:solid;border-width:1px;border-radius:var(--ds-border-radius, 0.375rem)}.shape-classic-xl.simple,.shape-classic-lg.simple,.shape-classic-md.simple,.shape-classic-sm.simple,.shape-classic-xs.simple{border-width:0px;min-height:58px;max-height:58px;background-color:unset;box-shadow:none}.shape-classic-xl.thin,.shape-classic-lg.thin,.shape-classic-md.thin,.shape-classic-sm.thin,.shape-classic-xs.thin{border-width:1px;min-height:56px;max-height:56px;background-color:unset}.shape-classic-xl.parentBorder,.shape-classic-lg.parentBorder,.shape-classic-md.parentBorder,.shape-classic-sm.parentBorder,.shape-classic-xs.parentBorder{border:0;box-shadow:unset;min-height:54px;max-height:54px}.shape-snowflake-xl,.shape-snowflake-lg,.shape-snowflake-md,.shape-snowflake-sm,.shape-snowflake-xs{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:30px}.shape-snowflake-xl.simple,.shape-snowflake-lg.simple,.shape-snowflake-md.simple,.shape-snowflake-sm.simple,.shape-snowflake-xs.simple{border-width:0px;min-height:60px;max-height:60px;background-color:unset;box-shadow:none}.shape-snowflake-xl.thin,.shape-snowflake-lg.thin,.shape-snowflake-md.thin,.shape-snowflake-sm.thin,.shape-snowflake-xs.thin{border-width:1px;min-height:58px;max-height:58px;background-color:unset}.shape-snowflake-xl.parentBorder,.shape-snowflake-lg.parentBorder,.shape-snowflake-md.parentBorder,.shape-snowflake-sm.parentBorder,.shape-snowflake-xs.parentBorder{border:0;box-shadow:unset;min-height:56px;max-height:56px}.shape-box-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-box-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-box-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-box-lg{min-height:52px;max-height:52px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-box-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-box-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-box-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-box-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-box-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-box-sm{min-height:32px;max-height:32px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-sm.simple{border-width:0px;min-height:36px;max-height:36px;background-color:unset;box-shadow:none}.shape-box-sm.thin{border-width:1px;min-height:34px;max-height:34px;background-color:unset}.shape-box-sm.parentBorder{border:0;box-shadow:unset;min-height:32px;max-height:32px}.shape-box-xs{min-height:20px;max-height:20px;border-style:solid;border-width:2px;border-color:transparent}.shape-box-xs.simple{border-width:0px;min-height:24px;max-height:24px;background-color:unset;box-shadow:none}.shape-box-xs.thin{border-width:1px;min-height:22px;max-height:22px;background-color:unset}.shape-box-xs.parentBorder{border:0;box-shadow:unset;min-height:20px;max-height:20px}.shape-rounded-lg{min-height:56px;max-height:56px;border-style:solid;border-width:2px;border-color:transparent;border-radius:6px}.shape-rounded-lg.simple{border-width:0px;min-height:56px;max-height:56px;background-color:unset;box-shadow:none}.shape-rounded-lg.thin{border-width:1px;min-height:54px;max-height:54px;background-color:unset}.shape-rounded-lg.parentBorder{border:0;box-shadow:unset;min-height:52px;max-height:52px}.shape-pill-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-left-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-left-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-left-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-right-xl{min-height:68px;max-height:68px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-xl.simple{border-width:0px;min-height:72px;max-height:72px;background-color:unset;box-shadow:none}.shape-pill-right-xl.thin{border-width:1px;min-height:70px;max-height:70px;background-color:unset}.shape-pill-right-xl.parentBorder{border:0;box-shadow:unset;min-height:68px;max-height:68px}.shape-pill-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px}.shape-pill-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-left-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:36px 0 0 36px}.shape-pill-left-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-left-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-left-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}.shape-pill-right-md{min-height:44px;max-height:44px;border-style:solid;border-width:2px;border-color:transparent;border-radius:0 36px 36px 0}.shape-pill-right-md.simple{border-width:0px;min-height:48px;max-height:48px;background-color:unset;box-shadow:none}.shape-pill-right-md.thin{border-width:1px;min-height:46px;max-height:46px;background-color:unset}.shape-pill-right-md.parentBorder{border:0;box-shadow:unset;min-height:44px;max-height:44px}`;
|
|
3921
3985
|
|
|
3922
|
-
var colorCss$1$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([
|
|
3986
|
+
var colorCss$1$1 = css`:host(:not([layout*=classic])){--ds-auro-dropdown-trigger-border-color: transparent}:host(:not([disabled],[onDark])) .wrapper:focus-within,:host(:not([disabled],[onDark])) .wrapper:active,:host(:not([disabled],[appearance=inverse])) .wrapper:focus-within,:host(:not([disabled],[appearance=inverse])) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused, #01426a);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused, #01426a)}:host(:not([ondark])) .wrapper,:host(:not([appearance=inverse])) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host(:not([ondark])) .wrapper:hover,:host(:not([appearance=inverse])) .wrapper:hover{--ds-auro-dropdown-trigger-background-color: var(--ds-auro-dropdown-trigger-hover-background-color)}:host(:not([onDark])[disabled]),:host(:not([appearance=inverse])[disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-disabled, #d0d0d0);--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-border-subtle, #dddddd)}:host(:not([onDark])[disabled]) #triggerLabel,:host(:not([appearance=inverse])[disabled]) #triggerLabel{cursor:default}:host(:not([ondark])[error]),:host(:not([appearance=inverse])[error]){--ds-auro-dropdown-trigger-border-color: var(--ds-basic-color-status-error, #e31f26)}:host(:not([disabled])[onDark]) .wrapper:focus-within,:host(:not([disabled])[onDark]) .wrapper:active,:host(:not([disabled])[appearance=inverse]) .wrapper:focus-within,:host(:not([disabled])[appearance=inverse]) .wrapper:active{--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-focused-inverse, #ffffff);--ds-auro-dropdown-trigger-outline-color: var(--ds-advanced-color-state-focused-inverse, #ffffff)}:host([onDark]) .label,:host([onDark]) .helpText,:host([appearance=inverse]) .label,:host([appearance=inverse]) .helpText{color:var(--ds-auro-dropdown-label-text-color)}:host([onDark]) .wrapper,:host([appearance=inverse]) .wrapper{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-background-color);color:var(--ds-auro-dropdown-trigger-text-color)}:host([onDark]) .wrapper:hover,:host([appearance=inverse]) .wrapper:hover{--ds-auro-dropdown-trigger-background-color: var(--ds-auro-dropdown-trigger-hover-background-color)}:host([onDark][disabled]),:host([appearance=inverse][disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-label-text-color: var(--ds-basic-color-texticon-inverse-disabled, #7e8894);--ds-auro-dropdown-trigger-container-color: var(--ds-advanced-color-shared-background-inverse-disabled, rgba(255, 255, 255, 0.1))}:host([onDark][disabled]) #triggerLabel,:host([appearance=inverse][disabled]) #triggerLabel{cursor:default}:host([ondark][error]),:host([appearance=inverse][error]){--ds-auro-dropdown-trigger-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
|
|
3923
3987
|
|
|
3924
3988
|
var styleCss$1$1 = css`:host{position:relative;display:block;text-align:left}[popover=manual]{overflow:visible;padding:0;border:inherit;margin:0;background:inherit;outline:inherit}:host([open]){z-index:var(--depth-tooltip, 400)}.wrapper{display:flex;flex:1;flex-direction:row;align-items:center;justify-content:center;outline:none}.triggerContentWrapper{display:flex;overflow:hidden;width:100%;flex:1;align-items:center;justify-content:center;text-overflow:ellipsis;white-space:nowrap}:host([matchwidth]) #bibSizer{width:100%}`;
|
|
3925
3989
|
|
|
3926
3990
|
var classicColorCss = css``;
|
|
3927
3991
|
|
|
3928
|
-
var classicLayoutCss = css
|
|
3992
|
+
var classicLayoutCss = css`@media(hover: hover){:host(:not([disabled])) .wrapper:hover{cursor:pointer}}:host([layout*=classic]){position:relative;max-width:100%}:host([layout*=classic]) #bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host([layout*=classic]) label{transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}:host([layout*=classic]) .wrapper{display:flex;flex-direction:row;box-shadow:inset 0 0 0 1px var(--ds-auro-dropdown-trigger-outline-color)}:host([layout*=classic]) .triggerContentWrapper{overflow:hidden;flex:1;justify-content:start;text-overflow:ellipsis;white-space:nowrap}:host([layout*=classic]) #showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;padding-right:var(--ds-size-150, 0.75rem)}:host([layout*=classic]) #showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem)}:host([layout*=classic]) #showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}`;
|
|
3929
3993
|
|
|
3930
3994
|
var styleEmphasizedCss = css`.layout-emphasized .chevron,.layout-emphasized-left .chevron,.layout-emphasized-right .chevron{margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=right])) .leftIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-left:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left])) .rightIndent{width:calc(100% - var(--ds-size-300, 1.5rem));margin-right:var(--ds-size-300, 1.5rem)}:host([layout*=emphasized][shape*=pill]:not([layout*=left]):not([layout*=right])) .rightIndent{width:calc(100% - var(--ds-size-600, 3rem));margin-right:var(--ds-size-300, 1.5rem)}`;
|
|
3931
3995
|
|
package/package.json
CHANGED