@aurodesignsystem/auro-formkit 5.1.3 → 5.1.4
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 +14 -2
- package/components/combobox/README.md +2 -0
- package/components/combobox/demo/api.md +190 -62
- package/components/combobox/demo/api.min.js +401 -146
- package/components/combobox/demo/index.md +2 -0
- package/components/combobox/demo/index.min.js +331 -132
- package/components/combobox/demo/readme.md +2 -0
- package/components/combobox/dist/auro-combobox.d.ts +81 -33
- package/components/combobox/dist/index.js +297 -122
- package/components/combobox/dist/registered.js +297 -122
- package/components/counter/demo/api.min.js +9 -4
- package/components/counter/demo/index.min.js +9 -4
- package/components/counter/dist/index.js +9 -4
- package/components/counter/dist/registered.js +9 -4
- package/components/datepicker/demo/api.min.js +61 -16
- package/components/datepicker/demo/index.min.js +61 -16
- package/components/datepicker/dist/index.js +61 -16
- package/components/datepicker/dist/registered.js +61 -16
- package/components/dropdown/demo/api.min.js +8 -3
- package/components/dropdown/demo/index.min.js +8 -3
- package/components/dropdown/dist/index.js +8 -3
- package/components/dropdown/dist/registered.js +8 -3
- package/components/input/demo/api.md +48 -46
- package/components/input/demo/api.min.js +52 -12
- package/components/input/demo/index.md +7 -3
- package/components/input/demo/index.min.js +52 -12
- package/components/input/dist/auro-input.d.ts +4 -0
- package/components/input/dist/base-input.d.ts +9 -1
- package/components/input/dist/index.js +52 -12
- package/components/input/dist/registered.js +52 -12
- package/components/layoutElement/dist/index.js +1 -1
- package/components/layoutElement/dist/registered.js +1 -1
- package/components/menu/demo/api.md +4 -3
- package/components/menu/demo/api.min.js +35 -11
- package/components/menu/demo/index.min.js +35 -11
- package/components/menu/dist/auro-menu.d.ts +3 -2
- package/components/menu/dist/auro-menuoption.d.ts +1 -0
- package/components/menu/dist/index.js +35 -11
- package/components/menu/dist/registered.js +35 -11
- package/components/select/demo/api.min.js +44 -15
- package/components/select/demo/index.min.js +44 -15
- package/components/select/dist/index.js +10 -5
- package/components/select/dist/registered.js +10 -5
- package/package.json +1 -1
|
@@ -6532,7 +6532,7 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
6532
6532
|
* @returns {boolean} - Returns true if the element has focus.
|
|
6533
6533
|
*/
|
|
6534
6534
|
get componentHasFocus() {
|
|
6535
|
-
return this.matches(':focus');
|
|
6535
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
6536
6536
|
}
|
|
6537
6537
|
|
|
6538
6538
|
resetShapeClasses() {
|
|
@@ -7317,8 +7317,13 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7317
7317
|
}
|
|
7318
7318
|
|
|
7319
7319
|
if (event) {
|
|
7320
|
-
|
|
7321
|
-
|
|
7320
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
7321
|
+
try {
|
|
7322
|
+
this.triggerNode = event.target;
|
|
7323
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
7324
|
+
} catch (error) {
|
|
7325
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
7326
|
+
}
|
|
7322
7327
|
}
|
|
7323
7328
|
|
|
7324
7329
|
if (this.triggerContentSlot) {
|
|
@@ -9525,7 +9530,7 @@ class AuroElement extends i$2 {
|
|
|
9525
9530
|
* @returns {boolean} - Returns true if the element has focus.
|
|
9526
9531
|
*/
|
|
9527
9532
|
get componentHasFocus() {
|
|
9528
|
-
return this.matches(':focus');
|
|
9533
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
9529
9534
|
}
|
|
9530
9535
|
|
|
9531
9536
|
resetShapeClasses() {
|
|
@@ -6532,7 +6532,7 @@ let AuroElement$3 = class AuroElement extends i$2 {
|
|
|
6532
6532
|
* @returns {boolean} - Returns true if the element has focus.
|
|
6533
6533
|
*/
|
|
6534
6534
|
get componentHasFocus() {
|
|
6535
|
-
return this.matches(':focus');
|
|
6535
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
6536
6536
|
}
|
|
6537
6537
|
|
|
6538
6538
|
resetShapeClasses() {
|
|
@@ -7317,8 +7317,13 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7317
7317
|
}
|
|
7318
7318
|
|
|
7319
7319
|
if (event) {
|
|
7320
|
-
|
|
7321
|
-
|
|
7320
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
7321
|
+
try {
|
|
7322
|
+
this.triggerNode = event.target;
|
|
7323
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
7324
|
+
} catch (error) {
|
|
7325
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
7326
|
+
}
|
|
7322
7327
|
}
|
|
7323
7328
|
|
|
7324
7329
|
if (this.triggerContentSlot) {
|
|
@@ -9525,7 +9530,7 @@ class AuroElement extends i$2 {
|
|
|
9525
9530
|
* @returns {boolean} - Returns true if the element has focus.
|
|
9526
9531
|
*/
|
|
9527
9532
|
get componentHasFocus() {
|
|
9528
|
-
return this.matches(':focus');
|
|
9533
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
9529
9534
|
}
|
|
9530
9535
|
|
|
9531
9536
|
resetShapeClasses() {
|
|
@@ -6485,7 +6485,7 @@ let AuroElement$3 = class AuroElement extends LitElement {
|
|
|
6485
6485
|
* @returns {boolean} - Returns true if the element has focus.
|
|
6486
6486
|
*/
|
|
6487
6487
|
get componentHasFocus() {
|
|
6488
|
-
return this.matches(':focus');
|
|
6488
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
6489
6489
|
}
|
|
6490
6490
|
|
|
6491
6491
|
resetShapeClasses() {
|
|
@@ -7270,8 +7270,13 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7270
7270
|
}
|
|
7271
7271
|
|
|
7272
7272
|
if (event) {
|
|
7273
|
-
|
|
7274
|
-
|
|
7273
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
7274
|
+
try {
|
|
7275
|
+
this.triggerNode = event.target;
|
|
7276
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
7277
|
+
} catch (error) {
|
|
7278
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
7279
|
+
}
|
|
7275
7280
|
}
|
|
7276
7281
|
|
|
7277
7282
|
if (this.triggerContentSlot) {
|
|
@@ -9478,7 +9483,7 @@ class AuroElement extends LitElement {
|
|
|
9478
9483
|
* @returns {boolean} - Returns true if the element has focus.
|
|
9479
9484
|
*/
|
|
9480
9485
|
get componentHasFocus() {
|
|
9481
|
-
return this.matches(':focus');
|
|
9486
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
9482
9487
|
}
|
|
9483
9488
|
|
|
9484
9489
|
resetShapeClasses() {
|
|
@@ -6485,7 +6485,7 @@ let AuroElement$3 = class AuroElement extends LitElement {
|
|
|
6485
6485
|
* @returns {boolean} - Returns true if the element has focus.
|
|
6486
6486
|
*/
|
|
6487
6487
|
get componentHasFocus() {
|
|
6488
|
-
return this.matches(':focus');
|
|
6488
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
6489
6489
|
}
|
|
6490
6490
|
|
|
6491
6491
|
resetShapeClasses() {
|
|
@@ -7270,8 +7270,13 @@ class AuroDropdown extends AuroElement$3 {
|
|
|
7270
7270
|
}
|
|
7271
7271
|
|
|
7272
7272
|
if (event) {
|
|
7273
|
-
|
|
7274
|
-
|
|
7273
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
7274
|
+
try {
|
|
7275
|
+
this.triggerNode = event.target;
|
|
7276
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
7277
|
+
} catch (error) {
|
|
7278
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
7279
|
+
}
|
|
7275
7280
|
}
|
|
7276
7281
|
|
|
7277
7282
|
if (this.triggerContentSlot) {
|
|
@@ -9478,7 +9483,7 @@ class AuroElement extends LitElement {
|
|
|
9478
9483
|
* @returns {boolean} - Returns true if the element has focus.
|
|
9479
9484
|
*/
|
|
9480
9485
|
get componentHasFocus() {
|
|
9481
|
-
return this.matches(':focus');
|
|
9486
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
9482
9487
|
}
|
|
9483
9488
|
|
|
9484
9489
|
resetShapeClasses() {
|
|
@@ -17953,7 +17953,7 @@ let AuroElement$4 = class AuroElement extends i {
|
|
|
17953
17953
|
* @returns {boolean} - Returns true if the element has focus.
|
|
17954
17954
|
*/
|
|
17955
17955
|
get componentHasFocus() {
|
|
17956
|
-
return this.matches(':focus');
|
|
17956
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
17957
17957
|
}
|
|
17958
17958
|
|
|
17959
17959
|
resetShapeClasses() {
|
|
@@ -18738,8 +18738,13 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
18738
18738
|
}
|
|
18739
18739
|
|
|
18740
18740
|
if (event) {
|
|
18741
|
-
|
|
18742
|
-
|
|
18741
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
18742
|
+
try {
|
|
18743
|
+
this.triggerNode = event.target;
|
|
18744
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
18745
|
+
} catch (error) {
|
|
18746
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
18747
|
+
}
|
|
18743
18748
|
}
|
|
18744
18749
|
|
|
18745
18750
|
if (this.triggerContentSlot) {
|
|
@@ -23813,7 +23818,7 @@ let AuroElement$2 = class AuroElement extends i {
|
|
|
23813
23818
|
* @returns {boolean} - Returns true if the element has focus.
|
|
23814
23819
|
*/
|
|
23815
23820
|
get componentHasFocus() {
|
|
23816
|
-
return this.matches(':focus');
|
|
23821
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
23817
23822
|
}
|
|
23818
23823
|
|
|
23819
23824
|
resetShapeClasses() {
|
|
@@ -23887,7 +23892,7 @@ let AuroElement$2 = class AuroElement extends i {
|
|
|
23887
23892
|
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
23888
23893
|
* @attr id
|
|
23889
23894
|
*
|
|
23890
|
-
* @slot ariaLabel.clear - Sets aria-label on clear button for
|
|
23895
|
+
* @slot ariaLabel.clear - Sets aria-label on clear button for screen reader to read
|
|
23891
23896
|
* @slot ariaLabel.password.show - Sets aria-label on password button to toggle on showing password
|
|
23892
23897
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
23893
23898
|
* @slot helpText - Sets the help text displayed below the input.
|
|
@@ -23915,6 +23920,7 @@ class BaseInput extends AuroElement$2 {
|
|
|
23915
23920
|
this.activeLabel = false;
|
|
23916
23921
|
this.icon = false;
|
|
23917
23922
|
this.disabled = false;
|
|
23923
|
+
this.dvInputOnly = false;
|
|
23918
23924
|
this.max = undefined;
|
|
23919
23925
|
this.maxLength = undefined;
|
|
23920
23926
|
this.min = undefined;
|
|
@@ -24008,6 +24014,14 @@ class BaseInput extends AuroElement$2 {
|
|
|
24008
24014
|
return {
|
|
24009
24015
|
...super.properties,
|
|
24010
24016
|
|
|
24017
|
+
/**
|
|
24018
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked.
|
|
24019
|
+
*/
|
|
24020
|
+
dvInputOnly: {
|
|
24021
|
+
type: Boolean,
|
|
24022
|
+
reflect: true
|
|
24023
|
+
},
|
|
24024
|
+
|
|
24011
24025
|
/**
|
|
24012
24026
|
* The value for the role attribute.
|
|
24013
24027
|
*/
|
|
@@ -26773,7 +26787,13 @@ class AuroInput extends BaseInput {
|
|
|
26773
26787
|
* @private
|
|
26774
26788
|
*/
|
|
26775
26789
|
get inputHidden() {
|
|
26776
|
-
return (
|
|
26790
|
+
return (
|
|
26791
|
+
this.hasDisplayValueContent && !this.hasFocus && this.hasValue) ||
|
|
26792
|
+
(
|
|
26793
|
+
(!this.value || this.value.length === 0) &&
|
|
26794
|
+
!this.hasFocus &&
|
|
26795
|
+
(!this.placeholder || this.placeholder === '')
|
|
26796
|
+
);
|
|
26777
26797
|
}
|
|
26778
26798
|
|
|
26779
26799
|
/**
|
|
@@ -26793,7 +26813,7 @@ class AuroInput extends BaseInput {
|
|
|
26793
26813
|
* @private
|
|
26794
26814
|
*/
|
|
26795
26815
|
get labelHidden() {
|
|
26796
|
-
return this.hasDisplayValueContent && !this.hasFocus && this.hasValue;
|
|
26816
|
+
return this.hasDisplayValueContent && !this.dvInputOnly && !this.hasFocus && this.hasValue;
|
|
26797
26817
|
}
|
|
26798
26818
|
|
|
26799
26819
|
/**
|
|
@@ -26802,18 +26822,26 @@ class AuroInput extends BaseInput {
|
|
|
26802
26822
|
* @returns {string} - The font class for the label.
|
|
26803
26823
|
*/
|
|
26804
26824
|
get labelFontClass() {
|
|
26805
|
-
const isHidden = this.inputHidden;
|
|
26806
|
-
|
|
26807
26825
|
if (this.layout.startsWith('emphasized')) {
|
|
26808
|
-
|
|
26826
|
+
let typeSize = 'body-sm';
|
|
26827
|
+
|
|
26828
|
+
if (this.hasDisplayValueContent) {
|
|
26829
|
+
if (!this.hasValue) {
|
|
26830
|
+
typeSize = 'accent-xl';
|
|
26831
|
+
}
|
|
26832
|
+
} else if (this.noFocusOrValue) {
|
|
26833
|
+
typeSize = 'accent-xl';
|
|
26834
|
+
}
|
|
26835
|
+
|
|
26836
|
+
return typeSize;
|
|
26809
26837
|
}
|
|
26810
26838
|
|
|
26811
26839
|
if (this.layout === 'snowflake') {
|
|
26812
|
-
return
|
|
26840
|
+
return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
|
|
26813
26841
|
}
|
|
26814
26842
|
|
|
26815
26843
|
// classic layout (default)
|
|
26816
|
-
return
|
|
26844
|
+
return ((!this.value || this.value.length === 0) && !this.placeholder && !this.hasFocus) ? 'body-default' : 'body-xs';
|
|
26817
26845
|
}
|
|
26818
26846
|
|
|
26819
26847
|
/**
|
|
@@ -26823,7 +26851,17 @@ class AuroInput extends BaseInput {
|
|
|
26823
26851
|
*/
|
|
26824
26852
|
get inputFontClass() {
|
|
26825
26853
|
if (this.layout.startsWith('emphasized')) {
|
|
26826
|
-
|
|
26854
|
+
let typeSize = 'accent-xl';
|
|
26855
|
+
|
|
26856
|
+
if (this.hasDisplayValueContent) {
|
|
26857
|
+
if (!this.hasValue) {
|
|
26858
|
+
typeSize = 'body-sm';
|
|
26859
|
+
}
|
|
26860
|
+
} else if (this.noFocusOrValue) {
|
|
26861
|
+
typeSize = 'body-sm';
|
|
26862
|
+
}
|
|
26863
|
+
|
|
26864
|
+
return typeSize;
|
|
26827
26865
|
}
|
|
26828
26866
|
|
|
26829
26867
|
if (this.layout === 'snowflake') {
|
|
@@ -26866,6 +26904,13 @@ class AuroInput extends BaseInput {
|
|
|
26866
26904
|
};
|
|
26867
26905
|
}
|
|
26868
26906
|
|
|
26907
|
+
get commonDisplayValueWrapperClasses() {
|
|
26908
|
+
return {
|
|
26909
|
+
'displayValueWrapper': true,
|
|
26910
|
+
[this.inputFontClass]: true,
|
|
26911
|
+
};
|
|
26912
|
+
}
|
|
26913
|
+
|
|
26869
26914
|
/**
|
|
26870
26915
|
* Returns classmap configuration for html5 inputs in each layout.
|
|
26871
26916
|
* @private
|
|
@@ -26938,7 +26983,7 @@ class AuroInput extends BaseInput {
|
|
|
26938
26983
|
let nodes = this.shadowRoot.querySelector('slot[name="displayValue"]').assignedNodes();
|
|
26939
26984
|
|
|
26940
26985
|
// Handle when DisplayValue is multi-level slot content (e.g. combobox passing displayValue to input)
|
|
26941
|
-
if (nodes[0].tagName === 'SLOT') {
|
|
26986
|
+
if (nodes && nodes[0] && nodes[0].tagName === 'SLOT') {
|
|
26942
26987
|
nodes = nodes[0].assignedNodes();
|
|
26943
26988
|
}
|
|
26944
26989
|
|
|
@@ -27029,7 +27074,7 @@ class AuroInput extends BaseInput {
|
|
|
27029
27074
|
type="${this.type === "password" && this.showPassword ? "text" : this.getInputType(this.type)}"
|
|
27030
27075
|
/>
|
|
27031
27076
|
<div class="${e$2(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
27032
|
-
<div class="
|
|
27077
|
+
<div class="${e$2(this.commonDisplayValueWrapperClasses)}">
|
|
27033
27078
|
<slot name="displayValue" @slotchange=${this.checkDisplayValueSlotChange}></slot>
|
|
27034
27079
|
</div>
|
|
27035
27080
|
</div>
|
|
@@ -27550,7 +27595,7 @@ let AuroElement$1 = class AuroElement extends i {
|
|
|
27550
27595
|
* @returns {boolean} - Returns true if the element has focus.
|
|
27551
27596
|
*/
|
|
27552
27597
|
get componentHasFocus() {
|
|
27553
|
-
return this.matches(':focus');
|
|
27598
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
27554
27599
|
}
|
|
27555
27600
|
|
|
27556
27601
|
resetShapeClasses() {
|
|
@@ -17694,7 +17694,7 @@ let AuroElement$4 = class AuroElement extends i {
|
|
|
17694
17694
|
* @returns {boolean} - Returns true if the element has focus.
|
|
17695
17695
|
*/
|
|
17696
17696
|
get componentHasFocus() {
|
|
17697
|
-
return this.matches(':focus');
|
|
17697
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
17698
17698
|
}
|
|
17699
17699
|
|
|
17700
17700
|
resetShapeClasses() {
|
|
@@ -18479,8 +18479,13 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
18479
18479
|
}
|
|
18480
18480
|
|
|
18481
18481
|
if (event) {
|
|
18482
|
-
|
|
18483
|
-
|
|
18482
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
18483
|
+
try {
|
|
18484
|
+
this.triggerNode = event.target;
|
|
18485
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
18486
|
+
} catch (error) {
|
|
18487
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
18488
|
+
}
|
|
18484
18489
|
}
|
|
18485
18490
|
|
|
18486
18491
|
if (this.triggerContentSlot) {
|
|
@@ -23554,7 +23559,7 @@ let AuroElement$2 = class AuroElement extends i {
|
|
|
23554
23559
|
* @returns {boolean} - Returns true if the element has focus.
|
|
23555
23560
|
*/
|
|
23556
23561
|
get componentHasFocus() {
|
|
23557
|
-
return this.matches(':focus');
|
|
23562
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
23558
23563
|
}
|
|
23559
23564
|
|
|
23560
23565
|
resetShapeClasses() {
|
|
@@ -23628,7 +23633,7 @@ let AuroElement$2 = class AuroElement extends i {
|
|
|
23628
23633
|
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
23629
23634
|
* @attr id
|
|
23630
23635
|
*
|
|
23631
|
-
* @slot ariaLabel.clear - Sets aria-label on clear button for
|
|
23636
|
+
* @slot ariaLabel.clear - Sets aria-label on clear button for screen reader to read
|
|
23632
23637
|
* @slot ariaLabel.password.show - Sets aria-label on password button to toggle on showing password
|
|
23633
23638
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
23634
23639
|
* @slot helpText - Sets the help text displayed below the input.
|
|
@@ -23656,6 +23661,7 @@ class BaseInput extends AuroElement$2 {
|
|
|
23656
23661
|
this.activeLabel = false;
|
|
23657
23662
|
this.icon = false;
|
|
23658
23663
|
this.disabled = false;
|
|
23664
|
+
this.dvInputOnly = false;
|
|
23659
23665
|
this.max = undefined;
|
|
23660
23666
|
this.maxLength = undefined;
|
|
23661
23667
|
this.min = undefined;
|
|
@@ -23749,6 +23755,14 @@ class BaseInput extends AuroElement$2 {
|
|
|
23749
23755
|
return {
|
|
23750
23756
|
...super.properties,
|
|
23751
23757
|
|
|
23758
|
+
/**
|
|
23759
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked.
|
|
23760
|
+
*/
|
|
23761
|
+
dvInputOnly: {
|
|
23762
|
+
type: Boolean,
|
|
23763
|
+
reflect: true
|
|
23764
|
+
},
|
|
23765
|
+
|
|
23752
23766
|
/**
|
|
23753
23767
|
* The value for the role attribute.
|
|
23754
23768
|
*/
|
|
@@ -26514,7 +26528,13 @@ class AuroInput extends BaseInput {
|
|
|
26514
26528
|
* @private
|
|
26515
26529
|
*/
|
|
26516
26530
|
get inputHidden() {
|
|
26517
|
-
return (
|
|
26531
|
+
return (
|
|
26532
|
+
this.hasDisplayValueContent && !this.hasFocus && this.hasValue) ||
|
|
26533
|
+
(
|
|
26534
|
+
(!this.value || this.value.length === 0) &&
|
|
26535
|
+
!this.hasFocus &&
|
|
26536
|
+
(!this.placeholder || this.placeholder === '')
|
|
26537
|
+
);
|
|
26518
26538
|
}
|
|
26519
26539
|
|
|
26520
26540
|
/**
|
|
@@ -26534,7 +26554,7 @@ class AuroInput extends BaseInput {
|
|
|
26534
26554
|
* @private
|
|
26535
26555
|
*/
|
|
26536
26556
|
get labelHidden() {
|
|
26537
|
-
return this.hasDisplayValueContent && !this.hasFocus && this.hasValue;
|
|
26557
|
+
return this.hasDisplayValueContent && !this.dvInputOnly && !this.hasFocus && this.hasValue;
|
|
26538
26558
|
}
|
|
26539
26559
|
|
|
26540
26560
|
/**
|
|
@@ -26543,18 +26563,26 @@ class AuroInput extends BaseInput {
|
|
|
26543
26563
|
* @returns {string} - The font class for the label.
|
|
26544
26564
|
*/
|
|
26545
26565
|
get labelFontClass() {
|
|
26546
|
-
const isHidden = this.inputHidden;
|
|
26547
|
-
|
|
26548
26566
|
if (this.layout.startsWith('emphasized')) {
|
|
26549
|
-
|
|
26567
|
+
let typeSize = 'body-sm';
|
|
26568
|
+
|
|
26569
|
+
if (this.hasDisplayValueContent) {
|
|
26570
|
+
if (!this.hasValue) {
|
|
26571
|
+
typeSize = 'accent-xl';
|
|
26572
|
+
}
|
|
26573
|
+
} else if (this.noFocusOrValue) {
|
|
26574
|
+
typeSize = 'accent-xl';
|
|
26575
|
+
}
|
|
26576
|
+
|
|
26577
|
+
return typeSize;
|
|
26550
26578
|
}
|
|
26551
26579
|
|
|
26552
26580
|
if (this.layout === 'snowflake') {
|
|
26553
|
-
return
|
|
26581
|
+
return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
|
|
26554
26582
|
}
|
|
26555
26583
|
|
|
26556
26584
|
// classic layout (default)
|
|
26557
|
-
return
|
|
26585
|
+
return ((!this.value || this.value.length === 0) && !this.placeholder && !this.hasFocus) ? 'body-default' : 'body-xs';
|
|
26558
26586
|
}
|
|
26559
26587
|
|
|
26560
26588
|
/**
|
|
@@ -26564,7 +26592,17 @@ class AuroInput extends BaseInput {
|
|
|
26564
26592
|
*/
|
|
26565
26593
|
get inputFontClass() {
|
|
26566
26594
|
if (this.layout.startsWith('emphasized')) {
|
|
26567
|
-
|
|
26595
|
+
let typeSize = 'accent-xl';
|
|
26596
|
+
|
|
26597
|
+
if (this.hasDisplayValueContent) {
|
|
26598
|
+
if (!this.hasValue) {
|
|
26599
|
+
typeSize = 'body-sm';
|
|
26600
|
+
}
|
|
26601
|
+
} else if (this.noFocusOrValue) {
|
|
26602
|
+
typeSize = 'body-sm';
|
|
26603
|
+
}
|
|
26604
|
+
|
|
26605
|
+
return typeSize;
|
|
26568
26606
|
}
|
|
26569
26607
|
|
|
26570
26608
|
if (this.layout === 'snowflake') {
|
|
@@ -26607,6 +26645,13 @@ class AuroInput extends BaseInput {
|
|
|
26607
26645
|
};
|
|
26608
26646
|
}
|
|
26609
26647
|
|
|
26648
|
+
get commonDisplayValueWrapperClasses() {
|
|
26649
|
+
return {
|
|
26650
|
+
'displayValueWrapper': true,
|
|
26651
|
+
[this.inputFontClass]: true,
|
|
26652
|
+
};
|
|
26653
|
+
}
|
|
26654
|
+
|
|
26610
26655
|
/**
|
|
26611
26656
|
* Returns classmap configuration for html5 inputs in each layout.
|
|
26612
26657
|
* @private
|
|
@@ -26679,7 +26724,7 @@ class AuroInput extends BaseInput {
|
|
|
26679
26724
|
let nodes = this.shadowRoot.querySelector('slot[name="displayValue"]').assignedNodes();
|
|
26680
26725
|
|
|
26681
26726
|
// Handle when DisplayValue is multi-level slot content (e.g. combobox passing displayValue to input)
|
|
26682
|
-
if (nodes[0].tagName === 'SLOT') {
|
|
26727
|
+
if (nodes && nodes[0] && nodes[0].tagName === 'SLOT') {
|
|
26683
26728
|
nodes = nodes[0].assignedNodes();
|
|
26684
26729
|
}
|
|
26685
26730
|
|
|
@@ -26770,7 +26815,7 @@ class AuroInput extends BaseInput {
|
|
|
26770
26815
|
type="${this.type === "password" && this.showPassword ? "text" : this.getInputType(this.type)}"
|
|
26771
26816
|
/>
|
|
26772
26817
|
<div class="${e$2(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
26773
|
-
<div class="
|
|
26818
|
+
<div class="${e$2(this.commonDisplayValueWrapperClasses)}">
|
|
26774
26819
|
<slot name="displayValue" @slotchange=${this.checkDisplayValueSlotChange}></slot>
|
|
26775
26820
|
</div>
|
|
26776
26821
|
</div>
|
|
@@ -27291,7 +27336,7 @@ let AuroElement$1 = class AuroElement extends i {
|
|
|
27291
27336
|
* @returns {boolean} - Returns true if the element has focus.
|
|
27292
27337
|
*/
|
|
27293
27338
|
get componentHasFocus() {
|
|
27294
|
-
return this.matches(':focus');
|
|
27339
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
27295
27340
|
}
|
|
27296
27341
|
|
|
27297
27342
|
resetShapeClasses() {
|
|
@@ -17643,7 +17643,7 @@ let AuroElement$4 = class AuroElement extends LitElement {
|
|
|
17643
17643
|
* @returns {boolean} - Returns true if the element has focus.
|
|
17644
17644
|
*/
|
|
17645
17645
|
get componentHasFocus() {
|
|
17646
|
-
return this.matches(':focus');
|
|
17646
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
17647
17647
|
}
|
|
17648
17648
|
|
|
17649
17649
|
resetShapeClasses() {
|
|
@@ -18428,8 +18428,13 @@ class AuroDropdown extends AuroElement$4 {
|
|
|
18428
18428
|
}
|
|
18429
18429
|
|
|
18430
18430
|
if (event) {
|
|
18431
|
-
|
|
18432
|
-
|
|
18431
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
18432
|
+
try {
|
|
18433
|
+
this.triggerNode = event.target;
|
|
18434
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
18435
|
+
} catch (error) {
|
|
18436
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
18437
|
+
}
|
|
18433
18438
|
}
|
|
18434
18439
|
|
|
18435
18440
|
if (this.triggerContentSlot) {
|
|
@@ -23490,7 +23495,7 @@ let AuroElement$2 = class AuroElement extends LitElement {
|
|
|
23490
23495
|
* @returns {boolean} - Returns true if the element has focus.
|
|
23491
23496
|
*/
|
|
23492
23497
|
get componentHasFocus() {
|
|
23493
|
-
return this.matches(':focus');
|
|
23498
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
23494
23499
|
}
|
|
23495
23500
|
|
|
23496
23501
|
resetShapeClasses() {
|
|
@@ -23564,7 +23569,7 @@ let AuroElement$2 = class AuroElement extends LitElement {
|
|
|
23564
23569
|
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
23565
23570
|
* @attr id
|
|
23566
23571
|
*
|
|
23567
|
-
* @slot ariaLabel.clear - Sets aria-label on clear button for
|
|
23572
|
+
* @slot ariaLabel.clear - Sets aria-label on clear button for screen reader to read
|
|
23568
23573
|
* @slot ariaLabel.password.show - Sets aria-label on password button to toggle on showing password
|
|
23569
23574
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
23570
23575
|
* @slot helpText - Sets the help text displayed below the input.
|
|
@@ -23592,6 +23597,7 @@ class BaseInput extends AuroElement$2 {
|
|
|
23592
23597
|
this.activeLabel = false;
|
|
23593
23598
|
this.icon = false;
|
|
23594
23599
|
this.disabled = false;
|
|
23600
|
+
this.dvInputOnly = false;
|
|
23595
23601
|
this.max = undefined;
|
|
23596
23602
|
this.maxLength = undefined;
|
|
23597
23603
|
this.min = undefined;
|
|
@@ -23685,6 +23691,14 @@ class BaseInput extends AuroElement$2 {
|
|
|
23685
23691
|
return {
|
|
23686
23692
|
...super.properties,
|
|
23687
23693
|
|
|
23694
|
+
/**
|
|
23695
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked.
|
|
23696
|
+
*/
|
|
23697
|
+
dvInputOnly: {
|
|
23698
|
+
type: Boolean,
|
|
23699
|
+
reflect: true
|
|
23700
|
+
},
|
|
23701
|
+
|
|
23688
23702
|
/**
|
|
23689
23703
|
* The value for the role attribute.
|
|
23690
23704
|
*/
|
|
@@ -26450,7 +26464,13 @@ class AuroInput extends BaseInput {
|
|
|
26450
26464
|
* @private
|
|
26451
26465
|
*/
|
|
26452
26466
|
get inputHidden() {
|
|
26453
|
-
return (
|
|
26467
|
+
return (
|
|
26468
|
+
this.hasDisplayValueContent && !this.hasFocus && this.hasValue) ||
|
|
26469
|
+
(
|
|
26470
|
+
(!this.value || this.value.length === 0) &&
|
|
26471
|
+
!this.hasFocus &&
|
|
26472
|
+
(!this.placeholder || this.placeholder === '')
|
|
26473
|
+
);
|
|
26454
26474
|
}
|
|
26455
26475
|
|
|
26456
26476
|
/**
|
|
@@ -26470,7 +26490,7 @@ class AuroInput extends BaseInput {
|
|
|
26470
26490
|
* @private
|
|
26471
26491
|
*/
|
|
26472
26492
|
get labelHidden() {
|
|
26473
|
-
return this.hasDisplayValueContent && !this.hasFocus && this.hasValue;
|
|
26493
|
+
return this.hasDisplayValueContent && !this.dvInputOnly && !this.hasFocus && this.hasValue;
|
|
26474
26494
|
}
|
|
26475
26495
|
|
|
26476
26496
|
/**
|
|
@@ -26479,18 +26499,26 @@ class AuroInput extends BaseInput {
|
|
|
26479
26499
|
* @returns {string} - The font class for the label.
|
|
26480
26500
|
*/
|
|
26481
26501
|
get labelFontClass() {
|
|
26482
|
-
const isHidden = this.inputHidden;
|
|
26483
|
-
|
|
26484
26502
|
if (this.layout.startsWith('emphasized')) {
|
|
26485
|
-
|
|
26503
|
+
let typeSize = 'body-sm';
|
|
26504
|
+
|
|
26505
|
+
if (this.hasDisplayValueContent) {
|
|
26506
|
+
if (!this.hasValue) {
|
|
26507
|
+
typeSize = 'accent-xl';
|
|
26508
|
+
}
|
|
26509
|
+
} else if (this.noFocusOrValue) {
|
|
26510
|
+
typeSize = 'accent-xl';
|
|
26511
|
+
}
|
|
26512
|
+
|
|
26513
|
+
return typeSize;
|
|
26486
26514
|
}
|
|
26487
26515
|
|
|
26488
26516
|
if (this.layout === 'snowflake') {
|
|
26489
|
-
return
|
|
26517
|
+
return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
|
|
26490
26518
|
}
|
|
26491
26519
|
|
|
26492
26520
|
// classic layout (default)
|
|
26493
|
-
return
|
|
26521
|
+
return ((!this.value || this.value.length === 0) && !this.placeholder && !this.hasFocus) ? 'body-default' : 'body-xs';
|
|
26494
26522
|
}
|
|
26495
26523
|
|
|
26496
26524
|
/**
|
|
@@ -26500,7 +26528,17 @@ class AuroInput extends BaseInput {
|
|
|
26500
26528
|
*/
|
|
26501
26529
|
get inputFontClass() {
|
|
26502
26530
|
if (this.layout.startsWith('emphasized')) {
|
|
26503
|
-
|
|
26531
|
+
let typeSize = 'accent-xl';
|
|
26532
|
+
|
|
26533
|
+
if (this.hasDisplayValueContent) {
|
|
26534
|
+
if (!this.hasValue) {
|
|
26535
|
+
typeSize = 'body-sm';
|
|
26536
|
+
}
|
|
26537
|
+
} else if (this.noFocusOrValue) {
|
|
26538
|
+
typeSize = 'body-sm';
|
|
26539
|
+
}
|
|
26540
|
+
|
|
26541
|
+
return typeSize;
|
|
26504
26542
|
}
|
|
26505
26543
|
|
|
26506
26544
|
if (this.layout === 'snowflake') {
|
|
@@ -26543,6 +26581,13 @@ class AuroInput extends BaseInput {
|
|
|
26543
26581
|
};
|
|
26544
26582
|
}
|
|
26545
26583
|
|
|
26584
|
+
get commonDisplayValueWrapperClasses() {
|
|
26585
|
+
return {
|
|
26586
|
+
'displayValueWrapper': true,
|
|
26587
|
+
[this.inputFontClass]: true,
|
|
26588
|
+
};
|
|
26589
|
+
}
|
|
26590
|
+
|
|
26546
26591
|
/**
|
|
26547
26592
|
* Returns classmap configuration for html5 inputs in each layout.
|
|
26548
26593
|
* @private
|
|
@@ -26615,7 +26660,7 @@ class AuroInput extends BaseInput {
|
|
|
26615
26660
|
let nodes = this.shadowRoot.querySelector('slot[name="displayValue"]').assignedNodes();
|
|
26616
26661
|
|
|
26617
26662
|
// Handle when DisplayValue is multi-level slot content (e.g. combobox passing displayValue to input)
|
|
26618
|
-
if (nodes[0].tagName === 'SLOT') {
|
|
26663
|
+
if (nodes && nodes[0] && nodes[0].tagName === 'SLOT') {
|
|
26619
26664
|
nodes = nodes[0].assignedNodes();
|
|
26620
26665
|
}
|
|
26621
26666
|
|
|
@@ -26706,7 +26751,7 @@ class AuroInput extends BaseInput {
|
|
|
26706
26751
|
type="${this.type === "password" && this.showPassword ? "text" : this.getInputType(this.type)}"
|
|
26707
26752
|
/>
|
|
26708
26753
|
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
26709
|
-
<div class="
|
|
26754
|
+
<div class="${classMap(this.commonDisplayValueWrapperClasses)}">
|
|
26710
26755
|
<slot name="displayValue" @slotchange=${this.checkDisplayValueSlotChange}></slot>
|
|
26711
26756
|
</div>
|
|
26712
26757
|
</div>
|
|
@@ -27227,7 +27272,7 @@ let AuroElement$1 = class AuroElement extends LitElement {
|
|
|
27227
27272
|
* @returns {boolean} - Returns true if the element has focus.
|
|
27228
27273
|
*/
|
|
27229
27274
|
get componentHasFocus() {
|
|
27230
|
-
return this.matches(':focus');
|
|
27275
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
27231
27276
|
}
|
|
27232
27277
|
|
|
27233
27278
|
resetShapeClasses() {
|