@aurodesignsystem-dev/auro-formkit 0.0.0-pr1052.0 → 0.0.0-pr1052.10
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/combobox/README.md +2 -0
- package/components/combobox/demo/api.md +96 -57
- package/components/combobox/demo/api.min.js +353 -144
- package/components/combobox/demo/index.md +2 -0
- package/components/combobox/demo/index.min.js +332 -133
- package/components/combobox/demo/readme.md +2 -0
- package/components/combobox/dist/auro-combobox.d.ts +81 -33
- package/components/combobox/dist/index.js +294 -118
- package/components/combobox/dist/registered.js +294 -118
- package/components/counter/demo/api.min.js +2 -2
- package/components/counter/demo/index.min.js +2 -2
- package/components/counter/dist/index.js +2 -2
- package/components/counter/dist/registered.js +2 -2
- package/components/datepicker/demo/api.min.js +54 -14
- package/components/datepicker/demo/index.min.js +54 -14
- package/components/datepicker/dist/index.js +54 -14
- package/components/datepicker/dist/registered.js +54 -14
- package/components/dropdown/demo/api.min.js +1 -1
- package/components/dropdown/demo/index.min.js +1 -1
- package/components/dropdown/dist/index.js +1 -1
- package/components/dropdown/dist/registered.js +1 -1
- package/components/input/demo/api.md +48 -46
- package/components/input/demo/api.min.js +52 -12
- package/components/input/demo/index.md +6 -1
- 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 +39 -16
- package/components/menu/demo/index.min.js +39 -16
- package/components/menu/dist/auro-menu.d.ts +3 -3
- package/components/menu/dist/index.js +39 -16
- package/components/menu/dist/registered.js +39 -16
- package/components/select/demo/api.min.js +40 -17
- package/components/select/demo/index.min.js +40 -17
- package/components/select/dist/index.js +2 -2
- package/components/select/dist/registered.js +2 -2
- 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() {
|
|
@@ -9525,7 +9525,7 @@ class AuroElement extends i$2 {
|
|
|
9525
9525
|
* @returns {boolean} - Returns true if the element has focus.
|
|
9526
9526
|
*/
|
|
9527
9527
|
get componentHasFocus() {
|
|
9528
|
-
return this.matches(':focus');
|
|
9528
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
9529
9529
|
}
|
|
9530
9530
|
|
|
9531
9531
|
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() {
|
|
@@ -9525,7 +9525,7 @@ class AuroElement extends i$2 {
|
|
|
9525
9525
|
* @returns {boolean} - Returns true if the element has focus.
|
|
9526
9526
|
*/
|
|
9527
9527
|
get componentHasFocus() {
|
|
9528
|
-
return this.matches(':focus');
|
|
9528
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
9529
9529
|
}
|
|
9530
9530
|
|
|
9531
9531
|
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() {
|
|
@@ -9478,7 +9478,7 @@ class AuroElement extends LitElement {
|
|
|
9478
9478
|
* @returns {boolean} - Returns true if the element has focus.
|
|
9479
9479
|
*/
|
|
9480
9480
|
get componentHasFocus() {
|
|
9481
|
-
return this.matches(':focus');
|
|
9481
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
9482
9482
|
}
|
|
9483
9483
|
|
|
9484
9484
|
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() {
|
|
@@ -9478,7 +9478,7 @@ class AuroElement extends LitElement {
|
|
|
9478
9478
|
* @returns {boolean} - Returns true if the element has focus.
|
|
9479
9479
|
*/
|
|
9480
9480
|
get componentHasFocus() {
|
|
9481
|
-
return this.matches(':focus');
|
|
9481
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
9482
9482
|
}
|
|
9483
9483
|
|
|
9484
9484
|
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() {
|
|
@@ -23813,7 +23813,7 @@ let AuroElement$2 = class AuroElement extends i {
|
|
|
23813
23813
|
* @returns {boolean} - Returns true if the element has focus.
|
|
23814
23814
|
*/
|
|
23815
23815
|
get componentHasFocus() {
|
|
23816
|
-
return this.matches(':focus');
|
|
23816
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
23817
23817
|
}
|
|
23818
23818
|
|
|
23819
23819
|
resetShapeClasses() {
|
|
@@ -23887,7 +23887,7 @@ let AuroElement$2 = class AuroElement extends i {
|
|
|
23887
23887
|
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
23888
23888
|
* @attr id
|
|
23889
23889
|
*
|
|
23890
|
-
* @slot ariaLabel.clear - Sets aria-label on clear button for
|
|
23890
|
+
* @slot ariaLabel.clear - Sets aria-label on clear button for screen reader to read
|
|
23891
23891
|
* @slot ariaLabel.password.show - Sets aria-label on password button to toggle on showing password
|
|
23892
23892
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
23893
23893
|
* @slot helpText - Sets the help text displayed below the input.
|
|
@@ -23915,6 +23915,7 @@ class BaseInput extends AuroElement$2 {
|
|
|
23915
23915
|
this.activeLabel = false;
|
|
23916
23916
|
this.icon = false;
|
|
23917
23917
|
this.disabled = false;
|
|
23918
|
+
this.dvInputOnly = false;
|
|
23918
23919
|
this.max = undefined;
|
|
23919
23920
|
this.maxLength = undefined;
|
|
23920
23921
|
this.min = undefined;
|
|
@@ -24008,6 +24009,14 @@ class BaseInput extends AuroElement$2 {
|
|
|
24008
24009
|
return {
|
|
24009
24010
|
...super.properties,
|
|
24010
24011
|
|
|
24012
|
+
/**
|
|
24013
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The inputs label will not be masked.
|
|
24014
|
+
*/
|
|
24015
|
+
dvInputOnly: {
|
|
24016
|
+
type: Boolean,
|
|
24017
|
+
reflect: true
|
|
24018
|
+
},
|
|
24019
|
+
|
|
24011
24020
|
/**
|
|
24012
24021
|
* The value for the role attribute.
|
|
24013
24022
|
*/
|
|
@@ -26773,7 +26782,13 @@ class AuroInput extends BaseInput {
|
|
|
26773
26782
|
* @private
|
|
26774
26783
|
*/
|
|
26775
26784
|
get inputHidden() {
|
|
26776
|
-
return (
|
|
26785
|
+
return (
|
|
26786
|
+
this.hasDisplayValueContent && !this.hasFocus && this.hasValue) ||
|
|
26787
|
+
(
|
|
26788
|
+
(!this.value || this.value.length === 0) &&
|
|
26789
|
+
!this.hasFocus &&
|
|
26790
|
+
(!this.placeholder || this.placeholder === '')
|
|
26791
|
+
);
|
|
26777
26792
|
}
|
|
26778
26793
|
|
|
26779
26794
|
/**
|
|
@@ -26793,7 +26808,7 @@ class AuroInput extends BaseInput {
|
|
|
26793
26808
|
* @private
|
|
26794
26809
|
*/
|
|
26795
26810
|
get labelHidden() {
|
|
26796
|
-
return this.hasDisplayValueContent && !this.hasFocus && this.hasValue;
|
|
26811
|
+
return this.hasDisplayValueContent && !this.dvInputOnly && !this.hasFocus && this.hasValue;
|
|
26797
26812
|
}
|
|
26798
26813
|
|
|
26799
26814
|
/**
|
|
@@ -26802,18 +26817,26 @@ class AuroInput extends BaseInput {
|
|
|
26802
26817
|
* @returns {string} - The font class for the label.
|
|
26803
26818
|
*/
|
|
26804
26819
|
get labelFontClass() {
|
|
26805
|
-
const isHidden = this.inputHidden;
|
|
26806
|
-
|
|
26807
26820
|
if (this.layout.startsWith('emphasized')) {
|
|
26808
|
-
|
|
26821
|
+
let typeSize = 'body-sm';
|
|
26822
|
+
|
|
26823
|
+
if (this.hasDisplayValueContent) {
|
|
26824
|
+
if (!this.hasValue) {
|
|
26825
|
+
typeSize = 'accent-xl';
|
|
26826
|
+
}
|
|
26827
|
+
} else if (this.noFocusOrValue) {
|
|
26828
|
+
typeSize = 'accent-xl';
|
|
26829
|
+
}
|
|
26830
|
+
|
|
26831
|
+
return typeSize;
|
|
26809
26832
|
}
|
|
26810
26833
|
|
|
26811
26834
|
if (this.layout === 'snowflake') {
|
|
26812
|
-
return
|
|
26835
|
+
return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
|
|
26813
26836
|
}
|
|
26814
26837
|
|
|
26815
26838
|
// classic layout (default)
|
|
26816
|
-
return
|
|
26839
|
+
return ((!this.value || this.value.length === 0) && !this.placeholder && !this.hasFocus) ? 'body-default' : 'body-xs';
|
|
26817
26840
|
}
|
|
26818
26841
|
|
|
26819
26842
|
/**
|
|
@@ -26823,7 +26846,17 @@ class AuroInput extends BaseInput {
|
|
|
26823
26846
|
*/
|
|
26824
26847
|
get inputFontClass() {
|
|
26825
26848
|
if (this.layout.startsWith('emphasized')) {
|
|
26826
|
-
|
|
26849
|
+
let typeSize = 'accent-xl';
|
|
26850
|
+
|
|
26851
|
+
if (this.hasDisplayValueContent) {
|
|
26852
|
+
if (!this.hasValue) {
|
|
26853
|
+
typeSize = 'body-sm';
|
|
26854
|
+
}
|
|
26855
|
+
} else if (this.noFocusOrValue) {
|
|
26856
|
+
typeSize = 'body-sm';
|
|
26857
|
+
}
|
|
26858
|
+
|
|
26859
|
+
return typeSize;
|
|
26827
26860
|
}
|
|
26828
26861
|
|
|
26829
26862
|
if (this.layout === 'snowflake') {
|
|
@@ -26866,6 +26899,13 @@ class AuroInput extends BaseInput {
|
|
|
26866
26899
|
};
|
|
26867
26900
|
}
|
|
26868
26901
|
|
|
26902
|
+
get commonDisplayValueWrapperClasses() {
|
|
26903
|
+
return {
|
|
26904
|
+
'displayValueWrapper': true,
|
|
26905
|
+
[this.inputFontClass]: true,
|
|
26906
|
+
};
|
|
26907
|
+
}
|
|
26908
|
+
|
|
26869
26909
|
/**
|
|
26870
26910
|
* Returns classmap configuration for html5 inputs in each layout.
|
|
26871
26911
|
* @private
|
|
@@ -26938,7 +26978,7 @@ class AuroInput extends BaseInput {
|
|
|
26938
26978
|
let nodes = this.shadowRoot.querySelector('slot[name="displayValue"]').assignedNodes();
|
|
26939
26979
|
|
|
26940
26980
|
// Handle when DisplayValue is multi-level slot content (e.g. combobox passing displayValue to input)
|
|
26941
|
-
if (nodes[0].tagName === 'SLOT') {
|
|
26981
|
+
if (nodes && nodes[0] && nodes[0].tagName === 'SLOT') {
|
|
26942
26982
|
nodes = nodes[0].assignedNodes();
|
|
26943
26983
|
}
|
|
26944
26984
|
|
|
@@ -27029,7 +27069,7 @@ class AuroInput extends BaseInput {
|
|
|
27029
27069
|
type="${this.type === "password" && this.showPassword ? "text" : this.getInputType(this.type)}"
|
|
27030
27070
|
/>
|
|
27031
27071
|
<div class="${e$2(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
27032
|
-
<div class="
|
|
27072
|
+
<div class="${e$2(this.commonDisplayValueWrapperClasses)}">
|
|
27033
27073
|
<slot name="displayValue" @slotchange=${this.checkDisplayValueSlotChange}></slot>
|
|
27034
27074
|
</div>
|
|
27035
27075
|
</div>
|
|
@@ -27550,7 +27590,7 @@ let AuroElement$1 = class AuroElement extends i {
|
|
|
27550
27590
|
* @returns {boolean} - Returns true if the element has focus.
|
|
27551
27591
|
*/
|
|
27552
27592
|
get componentHasFocus() {
|
|
27553
|
-
return this.matches(':focus');
|
|
27593
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
27554
27594
|
}
|
|
27555
27595
|
|
|
27556
27596
|
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() {
|
|
@@ -23554,7 +23554,7 @@ let AuroElement$2 = class AuroElement extends i {
|
|
|
23554
23554
|
* @returns {boolean} - Returns true if the element has focus.
|
|
23555
23555
|
*/
|
|
23556
23556
|
get componentHasFocus() {
|
|
23557
|
-
return this.matches(':focus');
|
|
23557
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
23558
23558
|
}
|
|
23559
23559
|
|
|
23560
23560
|
resetShapeClasses() {
|
|
@@ -23628,7 +23628,7 @@ let AuroElement$2 = class AuroElement extends i {
|
|
|
23628
23628
|
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
23629
23629
|
* @attr id
|
|
23630
23630
|
*
|
|
23631
|
-
* @slot ariaLabel.clear - Sets aria-label on clear button for
|
|
23631
|
+
* @slot ariaLabel.clear - Sets aria-label on clear button for screen reader to read
|
|
23632
23632
|
* @slot ariaLabel.password.show - Sets aria-label on password button to toggle on showing password
|
|
23633
23633
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
23634
23634
|
* @slot helpText - Sets the help text displayed below the input.
|
|
@@ -23656,6 +23656,7 @@ class BaseInput extends AuroElement$2 {
|
|
|
23656
23656
|
this.activeLabel = false;
|
|
23657
23657
|
this.icon = false;
|
|
23658
23658
|
this.disabled = false;
|
|
23659
|
+
this.dvInputOnly = false;
|
|
23659
23660
|
this.max = undefined;
|
|
23660
23661
|
this.maxLength = undefined;
|
|
23661
23662
|
this.min = undefined;
|
|
@@ -23749,6 +23750,14 @@ class BaseInput extends AuroElement$2 {
|
|
|
23749
23750
|
return {
|
|
23750
23751
|
...super.properties,
|
|
23751
23752
|
|
|
23753
|
+
/**
|
|
23754
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The inputs label will not be masked.
|
|
23755
|
+
*/
|
|
23756
|
+
dvInputOnly: {
|
|
23757
|
+
type: Boolean,
|
|
23758
|
+
reflect: true
|
|
23759
|
+
},
|
|
23760
|
+
|
|
23752
23761
|
/**
|
|
23753
23762
|
* The value for the role attribute.
|
|
23754
23763
|
*/
|
|
@@ -26514,7 +26523,13 @@ class AuroInput extends BaseInput {
|
|
|
26514
26523
|
* @private
|
|
26515
26524
|
*/
|
|
26516
26525
|
get inputHidden() {
|
|
26517
|
-
return (
|
|
26526
|
+
return (
|
|
26527
|
+
this.hasDisplayValueContent && !this.hasFocus && this.hasValue) ||
|
|
26528
|
+
(
|
|
26529
|
+
(!this.value || this.value.length === 0) &&
|
|
26530
|
+
!this.hasFocus &&
|
|
26531
|
+
(!this.placeholder || this.placeholder === '')
|
|
26532
|
+
);
|
|
26518
26533
|
}
|
|
26519
26534
|
|
|
26520
26535
|
/**
|
|
@@ -26534,7 +26549,7 @@ class AuroInput extends BaseInput {
|
|
|
26534
26549
|
* @private
|
|
26535
26550
|
*/
|
|
26536
26551
|
get labelHidden() {
|
|
26537
|
-
return this.hasDisplayValueContent && !this.hasFocus && this.hasValue;
|
|
26552
|
+
return this.hasDisplayValueContent && !this.dvInputOnly && !this.hasFocus && this.hasValue;
|
|
26538
26553
|
}
|
|
26539
26554
|
|
|
26540
26555
|
/**
|
|
@@ -26543,18 +26558,26 @@ class AuroInput extends BaseInput {
|
|
|
26543
26558
|
* @returns {string} - The font class for the label.
|
|
26544
26559
|
*/
|
|
26545
26560
|
get labelFontClass() {
|
|
26546
|
-
const isHidden = this.inputHidden;
|
|
26547
|
-
|
|
26548
26561
|
if (this.layout.startsWith('emphasized')) {
|
|
26549
|
-
|
|
26562
|
+
let typeSize = 'body-sm';
|
|
26563
|
+
|
|
26564
|
+
if (this.hasDisplayValueContent) {
|
|
26565
|
+
if (!this.hasValue) {
|
|
26566
|
+
typeSize = 'accent-xl';
|
|
26567
|
+
}
|
|
26568
|
+
} else if (this.noFocusOrValue) {
|
|
26569
|
+
typeSize = 'accent-xl';
|
|
26570
|
+
}
|
|
26571
|
+
|
|
26572
|
+
return typeSize;
|
|
26550
26573
|
}
|
|
26551
26574
|
|
|
26552
26575
|
if (this.layout === 'snowflake') {
|
|
26553
|
-
return
|
|
26576
|
+
return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
|
|
26554
26577
|
}
|
|
26555
26578
|
|
|
26556
26579
|
// classic layout (default)
|
|
26557
|
-
return
|
|
26580
|
+
return ((!this.value || this.value.length === 0) && !this.placeholder && !this.hasFocus) ? 'body-default' : 'body-xs';
|
|
26558
26581
|
}
|
|
26559
26582
|
|
|
26560
26583
|
/**
|
|
@@ -26564,7 +26587,17 @@ class AuroInput extends BaseInput {
|
|
|
26564
26587
|
*/
|
|
26565
26588
|
get inputFontClass() {
|
|
26566
26589
|
if (this.layout.startsWith('emphasized')) {
|
|
26567
|
-
|
|
26590
|
+
let typeSize = 'accent-xl';
|
|
26591
|
+
|
|
26592
|
+
if (this.hasDisplayValueContent) {
|
|
26593
|
+
if (!this.hasValue) {
|
|
26594
|
+
typeSize = 'body-sm';
|
|
26595
|
+
}
|
|
26596
|
+
} else if (this.noFocusOrValue) {
|
|
26597
|
+
typeSize = 'body-sm';
|
|
26598
|
+
}
|
|
26599
|
+
|
|
26600
|
+
return typeSize;
|
|
26568
26601
|
}
|
|
26569
26602
|
|
|
26570
26603
|
if (this.layout === 'snowflake') {
|
|
@@ -26607,6 +26640,13 @@ class AuroInput extends BaseInput {
|
|
|
26607
26640
|
};
|
|
26608
26641
|
}
|
|
26609
26642
|
|
|
26643
|
+
get commonDisplayValueWrapperClasses() {
|
|
26644
|
+
return {
|
|
26645
|
+
'displayValueWrapper': true,
|
|
26646
|
+
[this.inputFontClass]: true,
|
|
26647
|
+
};
|
|
26648
|
+
}
|
|
26649
|
+
|
|
26610
26650
|
/**
|
|
26611
26651
|
* Returns classmap configuration for html5 inputs in each layout.
|
|
26612
26652
|
* @private
|
|
@@ -26679,7 +26719,7 @@ class AuroInput extends BaseInput {
|
|
|
26679
26719
|
let nodes = this.shadowRoot.querySelector('slot[name="displayValue"]').assignedNodes();
|
|
26680
26720
|
|
|
26681
26721
|
// Handle when DisplayValue is multi-level slot content (e.g. combobox passing displayValue to input)
|
|
26682
|
-
if (nodes[0].tagName === 'SLOT') {
|
|
26722
|
+
if (nodes && nodes[0] && nodes[0].tagName === 'SLOT') {
|
|
26683
26723
|
nodes = nodes[0].assignedNodes();
|
|
26684
26724
|
}
|
|
26685
26725
|
|
|
@@ -26770,7 +26810,7 @@ class AuroInput extends BaseInput {
|
|
|
26770
26810
|
type="${this.type === "password" && this.showPassword ? "text" : this.getInputType(this.type)}"
|
|
26771
26811
|
/>
|
|
26772
26812
|
<div class="${e$2(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
26773
|
-
<div class="
|
|
26813
|
+
<div class="${e$2(this.commonDisplayValueWrapperClasses)}">
|
|
26774
26814
|
<slot name="displayValue" @slotchange=${this.checkDisplayValueSlotChange}></slot>
|
|
26775
26815
|
</div>
|
|
26776
26816
|
</div>
|
|
@@ -27291,7 +27331,7 @@ let AuroElement$1 = class AuroElement extends i {
|
|
|
27291
27331
|
* @returns {boolean} - Returns true if the element has focus.
|
|
27292
27332
|
*/
|
|
27293
27333
|
get componentHasFocus() {
|
|
27294
|
-
return this.matches(':focus');
|
|
27334
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
27295
27335
|
}
|
|
27296
27336
|
|
|
27297
27337
|
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() {
|
|
@@ -23490,7 +23490,7 @@ let AuroElement$2 = class AuroElement extends LitElement {
|
|
|
23490
23490
|
* @returns {boolean} - Returns true if the element has focus.
|
|
23491
23491
|
*/
|
|
23492
23492
|
get componentHasFocus() {
|
|
23493
|
-
return this.matches(':focus');
|
|
23493
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
23494
23494
|
}
|
|
23495
23495
|
|
|
23496
23496
|
resetShapeClasses() {
|
|
@@ -23564,7 +23564,7 @@ let AuroElement$2 = class AuroElement extends LitElement {
|
|
|
23564
23564
|
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
23565
23565
|
* @attr id
|
|
23566
23566
|
*
|
|
23567
|
-
* @slot ariaLabel.clear - Sets aria-label on clear button for
|
|
23567
|
+
* @slot ariaLabel.clear - Sets aria-label on clear button for screen reader to read
|
|
23568
23568
|
* @slot ariaLabel.password.show - Sets aria-label on password button to toggle on showing password
|
|
23569
23569
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
23570
23570
|
* @slot helpText - Sets the help text displayed below the input.
|
|
@@ -23592,6 +23592,7 @@ class BaseInput extends AuroElement$2 {
|
|
|
23592
23592
|
this.activeLabel = false;
|
|
23593
23593
|
this.icon = false;
|
|
23594
23594
|
this.disabled = false;
|
|
23595
|
+
this.dvInputOnly = false;
|
|
23595
23596
|
this.max = undefined;
|
|
23596
23597
|
this.maxLength = undefined;
|
|
23597
23598
|
this.min = undefined;
|
|
@@ -23685,6 +23686,14 @@ class BaseInput extends AuroElement$2 {
|
|
|
23685
23686
|
return {
|
|
23686
23687
|
...super.properties,
|
|
23687
23688
|
|
|
23689
|
+
/**
|
|
23690
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The inputs label will not be masked.
|
|
23691
|
+
*/
|
|
23692
|
+
dvInputOnly: {
|
|
23693
|
+
type: Boolean,
|
|
23694
|
+
reflect: true
|
|
23695
|
+
},
|
|
23696
|
+
|
|
23688
23697
|
/**
|
|
23689
23698
|
* The value for the role attribute.
|
|
23690
23699
|
*/
|
|
@@ -26450,7 +26459,13 @@ class AuroInput extends BaseInput {
|
|
|
26450
26459
|
* @private
|
|
26451
26460
|
*/
|
|
26452
26461
|
get inputHidden() {
|
|
26453
|
-
return (
|
|
26462
|
+
return (
|
|
26463
|
+
this.hasDisplayValueContent && !this.hasFocus && this.hasValue) ||
|
|
26464
|
+
(
|
|
26465
|
+
(!this.value || this.value.length === 0) &&
|
|
26466
|
+
!this.hasFocus &&
|
|
26467
|
+
(!this.placeholder || this.placeholder === '')
|
|
26468
|
+
);
|
|
26454
26469
|
}
|
|
26455
26470
|
|
|
26456
26471
|
/**
|
|
@@ -26470,7 +26485,7 @@ class AuroInput extends BaseInput {
|
|
|
26470
26485
|
* @private
|
|
26471
26486
|
*/
|
|
26472
26487
|
get labelHidden() {
|
|
26473
|
-
return this.hasDisplayValueContent && !this.hasFocus && this.hasValue;
|
|
26488
|
+
return this.hasDisplayValueContent && !this.dvInputOnly && !this.hasFocus && this.hasValue;
|
|
26474
26489
|
}
|
|
26475
26490
|
|
|
26476
26491
|
/**
|
|
@@ -26479,18 +26494,26 @@ class AuroInput extends BaseInput {
|
|
|
26479
26494
|
* @returns {string} - The font class for the label.
|
|
26480
26495
|
*/
|
|
26481
26496
|
get labelFontClass() {
|
|
26482
|
-
const isHidden = this.inputHidden;
|
|
26483
|
-
|
|
26484
26497
|
if (this.layout.startsWith('emphasized')) {
|
|
26485
|
-
|
|
26498
|
+
let typeSize = 'body-sm';
|
|
26499
|
+
|
|
26500
|
+
if (this.hasDisplayValueContent) {
|
|
26501
|
+
if (!this.hasValue) {
|
|
26502
|
+
typeSize = 'accent-xl';
|
|
26503
|
+
}
|
|
26504
|
+
} else if (this.noFocusOrValue) {
|
|
26505
|
+
typeSize = 'accent-xl';
|
|
26506
|
+
}
|
|
26507
|
+
|
|
26508
|
+
return typeSize;
|
|
26486
26509
|
}
|
|
26487
26510
|
|
|
26488
26511
|
if (this.layout === 'snowflake') {
|
|
26489
|
-
return
|
|
26512
|
+
return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
|
|
26490
26513
|
}
|
|
26491
26514
|
|
|
26492
26515
|
// classic layout (default)
|
|
26493
|
-
return
|
|
26516
|
+
return ((!this.value || this.value.length === 0) && !this.placeholder && !this.hasFocus) ? 'body-default' : 'body-xs';
|
|
26494
26517
|
}
|
|
26495
26518
|
|
|
26496
26519
|
/**
|
|
@@ -26500,7 +26523,17 @@ class AuroInput extends BaseInput {
|
|
|
26500
26523
|
*/
|
|
26501
26524
|
get inputFontClass() {
|
|
26502
26525
|
if (this.layout.startsWith('emphasized')) {
|
|
26503
|
-
|
|
26526
|
+
let typeSize = 'accent-xl';
|
|
26527
|
+
|
|
26528
|
+
if (this.hasDisplayValueContent) {
|
|
26529
|
+
if (!this.hasValue) {
|
|
26530
|
+
typeSize = 'body-sm';
|
|
26531
|
+
}
|
|
26532
|
+
} else if (this.noFocusOrValue) {
|
|
26533
|
+
typeSize = 'body-sm';
|
|
26534
|
+
}
|
|
26535
|
+
|
|
26536
|
+
return typeSize;
|
|
26504
26537
|
}
|
|
26505
26538
|
|
|
26506
26539
|
if (this.layout === 'snowflake') {
|
|
@@ -26543,6 +26576,13 @@ class AuroInput extends BaseInput {
|
|
|
26543
26576
|
};
|
|
26544
26577
|
}
|
|
26545
26578
|
|
|
26579
|
+
get commonDisplayValueWrapperClasses() {
|
|
26580
|
+
return {
|
|
26581
|
+
'displayValueWrapper': true,
|
|
26582
|
+
[this.inputFontClass]: true,
|
|
26583
|
+
};
|
|
26584
|
+
}
|
|
26585
|
+
|
|
26546
26586
|
/**
|
|
26547
26587
|
* Returns classmap configuration for html5 inputs in each layout.
|
|
26548
26588
|
* @private
|
|
@@ -26615,7 +26655,7 @@ class AuroInput extends BaseInput {
|
|
|
26615
26655
|
let nodes = this.shadowRoot.querySelector('slot[name="displayValue"]').assignedNodes();
|
|
26616
26656
|
|
|
26617
26657
|
// Handle when DisplayValue is multi-level slot content (e.g. combobox passing displayValue to input)
|
|
26618
|
-
if (nodes[0].tagName === 'SLOT') {
|
|
26658
|
+
if (nodes && nodes[0] && nodes[0].tagName === 'SLOT') {
|
|
26619
26659
|
nodes = nodes[0].assignedNodes();
|
|
26620
26660
|
}
|
|
26621
26661
|
|
|
@@ -26706,7 +26746,7 @@ class AuroInput extends BaseInput {
|
|
|
26706
26746
|
type="${this.type === "password" && this.showPassword ? "text" : this.getInputType(this.type)}"
|
|
26707
26747
|
/>
|
|
26708
26748
|
<div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
26709
|
-
<div class="
|
|
26749
|
+
<div class="${classMap(this.commonDisplayValueWrapperClasses)}">
|
|
26710
26750
|
<slot name="displayValue" @slotchange=${this.checkDisplayValueSlotChange}></slot>
|
|
26711
26751
|
</div>
|
|
26712
26752
|
</div>
|
|
@@ -27227,7 +27267,7 @@ let AuroElement$1 = class AuroElement extends LitElement {
|
|
|
27227
27267
|
* @returns {boolean} - Returns true if the element has focus.
|
|
27228
27268
|
*/
|
|
27229
27269
|
get componentHasFocus() {
|
|
27230
|
-
return this.matches(':focus');
|
|
27270
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
27231
27271
|
}
|
|
27232
27272
|
|
|
27233
27273
|
resetShapeClasses() {
|