@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
|
@@ -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() {
|
|
@@ -3473,7 +3473,7 @@ class AuroElement extends i {
|
|
|
3473
3473
|
* @returns {boolean} - Returns true if the element has focus.
|
|
3474
3474
|
*/
|
|
3475
3475
|
get componentHasFocus() {
|
|
3476
|
-
return this.matches(':focus');
|
|
3476
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
3477
3477
|
}
|
|
3478
3478
|
|
|
3479
3479
|
resetShapeClasses() {
|
|
@@ -4258,8 +4258,13 @@ class AuroDropdown extends AuroElement {
|
|
|
4258
4258
|
}
|
|
4259
4259
|
|
|
4260
4260
|
if (event) {
|
|
4261
|
-
|
|
4262
|
-
|
|
4261
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
4262
|
+
try {
|
|
4263
|
+
this.triggerNode = event.target;
|
|
4264
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
4265
|
+
} catch (error) {
|
|
4266
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
4267
|
+
}
|
|
4263
4268
|
}
|
|
4264
4269
|
|
|
4265
4270
|
if (this.triggerContentSlot) {
|
|
@@ -3448,7 +3448,7 @@ class AuroElement extends i {
|
|
|
3448
3448
|
* @returns {boolean} - Returns true if the element has focus.
|
|
3449
3449
|
*/
|
|
3450
3450
|
get componentHasFocus() {
|
|
3451
|
-
return this.matches(':focus');
|
|
3451
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
3452
3452
|
}
|
|
3453
3453
|
|
|
3454
3454
|
resetShapeClasses() {
|
|
@@ -4233,8 +4233,13 @@ class AuroDropdown extends AuroElement {
|
|
|
4233
4233
|
}
|
|
4234
4234
|
|
|
4235
4235
|
if (event) {
|
|
4236
|
-
|
|
4237
|
-
|
|
4236
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
4237
|
+
try {
|
|
4238
|
+
this.triggerNode = event.target;
|
|
4239
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
4240
|
+
} catch (error) {
|
|
4241
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
4242
|
+
}
|
|
4238
4243
|
}
|
|
4239
4244
|
|
|
4240
4245
|
if (this.triggerContentSlot) {
|
|
@@ -3401,7 +3401,7 @@ class AuroElement extends LitElement {
|
|
|
3401
3401
|
* @returns {boolean} - Returns true if the element has focus.
|
|
3402
3402
|
*/
|
|
3403
3403
|
get componentHasFocus() {
|
|
3404
|
-
return this.matches(':focus');
|
|
3404
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
3405
3405
|
}
|
|
3406
3406
|
|
|
3407
3407
|
resetShapeClasses() {
|
|
@@ -4186,8 +4186,13 @@ class AuroDropdown extends AuroElement {
|
|
|
4186
4186
|
}
|
|
4187
4187
|
|
|
4188
4188
|
if (event) {
|
|
4189
|
-
|
|
4190
|
-
|
|
4189
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
4190
|
+
try {
|
|
4191
|
+
this.triggerNode = event.target;
|
|
4192
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
4193
|
+
} catch (error) {
|
|
4194
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
4195
|
+
}
|
|
4191
4196
|
}
|
|
4192
4197
|
|
|
4193
4198
|
if (this.triggerContentSlot) {
|
|
@@ -3401,7 +3401,7 @@ class AuroElement extends LitElement {
|
|
|
3401
3401
|
* @returns {boolean} - Returns true if the element has focus.
|
|
3402
3402
|
*/
|
|
3403
3403
|
get componentHasFocus() {
|
|
3404
|
-
return this.matches(':focus');
|
|
3404
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
3405
3405
|
}
|
|
3406
3406
|
|
|
3407
3407
|
resetShapeClasses() {
|
|
@@ -4186,8 +4186,13 @@ class AuroDropdown extends AuroElement {
|
|
|
4186
4186
|
}
|
|
4187
4187
|
|
|
4188
4188
|
if (event) {
|
|
4189
|
-
|
|
4190
|
-
|
|
4189
|
+
// Wrap in a try-catch block to handle errors when trying to use assignedNodes from the NodeJS test environment.
|
|
4190
|
+
try {
|
|
4191
|
+
this.triggerNode = event.target;
|
|
4192
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
4193
|
+
} catch (error) {
|
|
4194
|
+
console.warn('auro-dropdown: Unable to access the trigger content slot.', error); // eslint-disable-line no-console
|
|
4195
|
+
}
|
|
4191
4196
|
}
|
|
4192
4197
|
|
|
4193
4198
|
if (this.triggerContentSlot) {
|
|
@@ -7,51 +7,53 @@ Generate unique names for dependency components.
|
|
|
7
7
|
|
|
8
8
|
## Properties
|
|
9
9
|
|
|
10
|
-
| Property
|
|
11
|
-
|
|
12
|
-
| `a11yControls`
|
|
13
|
-
| `a11yExpanded`
|
|
14
|
-
| `a11yRole`
|
|
15
|
-
| [activeLabel](#activeLabel)
|
|
16
|
-
| [autocapitalize](#autocapitalize)
|
|
17
|
-
| [autocomplete](#autocomplete)
|
|
18
|
-
| [autocorrect](#autocorrect)
|
|
19
|
-
| [
|
|
20
|
-
| [
|
|
21
|
-
| [
|
|
22
|
-
| [
|
|
23
|
-
| [
|
|
24
|
-
| [
|
|
25
|
-
| [
|
|
26
|
-
| [
|
|
27
|
-
| [
|
|
28
|
-
| [
|
|
29
|
-
| [
|
|
30
|
-
| [
|
|
31
|
-
| [
|
|
32
|
-
| [
|
|
33
|
-
| [
|
|
34
|
-
| [
|
|
35
|
-
| [
|
|
36
|
-
| [
|
|
37
|
-
| [
|
|
38
|
-
| [
|
|
39
|
-
| [
|
|
40
|
-
| [
|
|
41
|
-
| [
|
|
42
|
-
| [
|
|
43
|
-
| [
|
|
44
|
-
| [
|
|
45
|
-
| [
|
|
46
|
-
| [
|
|
47
|
-
| [
|
|
48
|
-
| [
|
|
49
|
-
| [
|
|
50
|
-
| [
|
|
51
|
-
| [
|
|
52
|
-
| [
|
|
53
|
-
| [
|
|
54
|
-
| [
|
|
10
|
+
| Property | Attribute | Modifiers | Type | Default | Description |
|
|
11
|
+
|------------------------------------|-----------------------------------|-----------|--------------------------------------------------|-------------|--------------------------------------------------|
|
|
12
|
+
| `a11yControls` | `a11yControls` | | `string` | | The value for the aria-controls attribute. |
|
|
13
|
+
| `a11yExpanded` | `a11yExpanded` | | `boolean` | | The value for the aria-expanded attribute. |
|
|
14
|
+
| `a11yRole` | `a11yRole` | | `string` | | The value for the role attribute. |
|
|
15
|
+
| [activeLabel](#activeLabel) | `activeLabel` | | `boolean` | false | If set, the label will remain fixed in the active position. |
|
|
16
|
+
| [autocapitalize](#autocapitalize) | `autocapitalize` | | `string` | | An enumerated attribute that controls whether and how text input is automatically capitalized as it is entered/edited by the user. [off/none, on/sentences, words, characters]. |
|
|
17
|
+
| [autocomplete](#autocomplete) | `autocomplete` | | `string` | | An enumerated attribute that defines what the user agent can suggest for autofill. At this time, only `autocomplete="off"` is supported. |
|
|
18
|
+
| [autocorrect](#autocorrect) | `autocorrect` | | `string` | | When set to `off`, stops iOS from auto-correcting words when typed into a text box. |
|
|
19
|
+
| [commonDisplayValueWrapperClasses](#commonDisplayValueWrapperClasses) | | readonly | `{ [x: string]: boolean; displayValueWrapper: boolean; }` | | |
|
|
20
|
+
| [customValidityTypeEmail](#customValidityTypeEmail) | `customValidityTypeEmail` | | `string` | | Custom help text message for email type validity. |
|
|
21
|
+
| [disabled](#disabled) | `disabled` | | `boolean` | false | If set, disables the input. |
|
|
22
|
+
| [dvInputOnly](#dvInputOnly) | `dvInputOnly` | | `boolean` | false | If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked. |
|
|
23
|
+
| [error](#error) | `error` | | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
|
|
24
|
+
| [errorMessage](#errorMessage) | `errorMessage` | | `string` | | Contains the help text message for the current validity error. |
|
|
25
|
+
| [format](#format) | `format` | | `string` | | Specifies the input mask format. |
|
|
26
|
+
| [icon](#icon) | `icon` | | `boolean` | false | If set, will render an icon inside the input to the left of the value. Support is limited to auro-input instances with credit card format. |
|
|
27
|
+
| [id](#id) | `id` | | `string` | | The id global attribute defines an identifier (ID) which must be unique in the whole document. |
|
|
28
|
+
| [inputmode](#inputmode) | `inputmode` | | `string` | | Exposes inputmode attribute for input. |
|
|
29
|
+
| [lang](#lang) | `lang` | | `string` | | Defines the language of an element. |
|
|
30
|
+
| [max](#max) | `max` | | `string` | "undefined" | The maximum value allowed. This only applies for inputs with a type of `number` and all date formats. |
|
|
31
|
+
| [maxLength](#maxLength) | `maxLength` | | `number` | "undefined" | The maximum number of characters the user can enter into the text input. This must be an integer value `0` or higher. |
|
|
32
|
+
| [min](#min) | `min` | | `string` | "undefined" | The minimum value allowed. This only applies for inputs with a type of `number` and all date formats. |
|
|
33
|
+
| [minLength](#minLength) | `minLength` | | `number` | "undefined" | The minimum number of characters the user can enter into the text input. This must be a non-negative integer value smaller than or equal to the value specified by `maxlength`. |
|
|
34
|
+
| [name](#name) | `name` | | `string` | | Populates the `name` attribute on the input. |
|
|
35
|
+
| [nested](#nested) | `nested` | | `boolean` | | Sets styles for nested operation - removes borders, hides help + error text, and<br />hides accents. |
|
|
36
|
+
| [noValidate](#noValidate) | `noValidate` | | `boolean` | false | If set, disables auto-validation on blur. |
|
|
37
|
+
| [onDark](#onDark) | `onDark` | | `boolean` | false | Sets onDark styles on input. |
|
|
38
|
+
| [pattern](#pattern) | `pattern` | | `string` | | Specifies a regular expression the form control's value should match. |
|
|
39
|
+
| [placeholder](#placeholder) | `placeholder` | | `string` | | Define custom placeholder text. |
|
|
40
|
+
| [readonly](#readonly) | `readonly` | | `boolean` | | Makes the input read-only, but can be set programmatically. |
|
|
41
|
+
| [required](#required) | `required` | | `boolean` | false | Populates the `required` attribute on the input. Used for client-side validation. |
|
|
42
|
+
| [setCustomValidity](#setCustomValidity) | `setCustomValidity` | | `string` | | Sets a custom help text message to display for all validityStates. |
|
|
43
|
+
| [setCustomValidityBadInput](#setCustomValidityBadInput) | `setCustomValidityBadInput` | | `string` | | Custom help text message to display when validity = `badInput`. |
|
|
44
|
+
| [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | | `string` | | Custom help text message to display when validity = `customError`. |
|
|
45
|
+
| [setCustomValidityForType](#setCustomValidityForType) | `setCustomValidityForType` | | `string` | "undefined" | Custom help text message to display for the declared element `type` and type validity fails. |
|
|
46
|
+
| [setCustomValidityRangeOverflow](#setCustomValidityRangeOverflow) | `setCustomValidityRangeOverflow` | | `string` | | Custom help text message to display when validity = `rangeOverflow`. |
|
|
47
|
+
| [setCustomValidityRangeUnderflow](#setCustomValidityRangeUnderflow) | `setCustomValidityRangeUnderflow` | | `string` | | Custom help text message to display when validity = `rangeUnderflow`. |
|
|
48
|
+
| [setCustomValidityTooLong](#setCustomValidityTooLong) | `setCustomValidityTooLong` | | `string` | | Custom help text message to display when validity = `tooLong`. |
|
|
49
|
+
| [setCustomValidityTooShort](#setCustomValidityTooShort) | `setCustomValidityTooShort` | | `string` | | Custom help text message to display when validity = `tooShort`. |
|
|
50
|
+
| [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | | `string` | | Custom help text message to display when validity = `valueMissing`. |
|
|
51
|
+
| [simple](#simple) | `simple` | | `boolean` | | Simple makes the input render without a border. |
|
|
52
|
+
| [spellcheck](#spellcheck) | `spellcheck` | | `string` | | An enumerated attribute defines whether the element may be checked for spelling errors. [true, false]. When set to `false` the attribute `autocorrect` is set to `off` and `autocapitalize` is set to `none`. |
|
|
53
|
+
| [type](#type) | `type` | | `string` | | Populates the `type` attribute on the input. Allowed values are `password`, `email`, `credit-card`, `date`, `tel` or `text`. If given value is not allowed or set, defaults to `text`. |
|
|
54
|
+
| [validateOnInput](#validateOnInput) | `validateOnInput` | | `boolean` | | Sets validation mode to re-eval with each input. |
|
|
55
|
+
| [validity](#validity) | `validity` | | `string` | | Specifies the `validityState` this element is in. |
|
|
56
|
+
| [value](#value) | `value` | | `string` | | Populates the `value` attribute on the input. Can also be read to retrieve the current value of the input. |
|
|
55
57
|
|
|
56
58
|
## Methods
|
|
57
59
|
|
|
@@ -74,7 +76,7 @@ Generate unique names for dependency components.
|
|
|
74
76
|
|
|
75
77
|
| Name | Description |
|
|
76
78
|
|---------------------------|--------------------------------------------------|
|
|
77
|
-
| `ariaLabel.clear` | Sets aria-label on clear button for
|
|
79
|
+
| `ariaLabel.clear` | Sets aria-label on clear button for screen reader to read |
|
|
78
80
|
| `ariaLabel.password.hide` | Sets aria-label on password button to toggle off showing password |
|
|
79
81
|
| `ariaLabel.password.show` | Sets aria-label on password button to toggle on showing password |
|
|
80
82
|
| [displayValue](#displayValue) | Allows custom HTML content to display in place of the value when the input is not focused. |
|
|
@@ -5040,7 +5040,7 @@ let AuroElement$2 = class AuroElement extends i$2 {
|
|
|
5040
5040
|
* @returns {boolean} - Returns true if the element has focus.
|
|
5041
5041
|
*/
|
|
5042
5042
|
get componentHasFocus() {
|
|
5043
|
-
return this.matches(':focus');
|
|
5043
|
+
return this.matches(':focus') || this.matches(':focus-within');
|
|
5044
5044
|
}
|
|
5045
5045
|
|
|
5046
5046
|
resetShapeClasses() {
|
|
@@ -5114,7 +5114,7 @@ let AuroElement$2 = class AuroElement extends i$2 {
|
|
|
5114
5114
|
* @prop {string} id - The id global attribute defines an identifier (ID) which must be unique in the whole document.
|
|
5115
5115
|
* @attr id
|
|
5116
5116
|
*
|
|
5117
|
-
* @slot ariaLabel.clear - Sets aria-label on clear button for
|
|
5117
|
+
* @slot ariaLabel.clear - Sets aria-label on clear button for screen reader to read
|
|
5118
5118
|
* @slot ariaLabel.password.show - Sets aria-label on password button to toggle on showing password
|
|
5119
5119
|
* @slot ariaLabel.password.hide - Sets aria-label on password button to toggle off showing password
|
|
5120
5120
|
* @slot helpText - Sets the help text displayed below the input.
|
|
@@ -5142,6 +5142,7 @@ class BaseInput extends AuroElement$2 {
|
|
|
5142
5142
|
this.activeLabel = false;
|
|
5143
5143
|
this.icon = false;
|
|
5144
5144
|
this.disabled = false;
|
|
5145
|
+
this.dvInputOnly = false;
|
|
5145
5146
|
this.max = undefined;
|
|
5146
5147
|
this.maxLength = undefined;
|
|
5147
5148
|
this.min = undefined;
|
|
@@ -5235,6 +5236,14 @@ class BaseInput extends AuroElement$2 {
|
|
|
5235
5236
|
return {
|
|
5236
5237
|
...super.properties,
|
|
5237
5238
|
|
|
5239
|
+
/**
|
|
5240
|
+
* If defined, the display value slot content will only mask the HTML5 input element. The input's label will not be masked.
|
|
5241
|
+
*/
|
|
5242
|
+
dvInputOnly: {
|
|
5243
|
+
type: Boolean,
|
|
5244
|
+
reflect: true
|
|
5245
|
+
},
|
|
5246
|
+
|
|
5238
5247
|
/**
|
|
5239
5248
|
* The value for the role attribute.
|
|
5240
5249
|
*/
|
|
@@ -8000,7 +8009,13 @@ class AuroInput extends BaseInput {
|
|
|
8000
8009
|
* @private
|
|
8001
8010
|
*/
|
|
8002
8011
|
get inputHidden() {
|
|
8003
|
-
return (
|
|
8012
|
+
return (
|
|
8013
|
+
this.hasDisplayValueContent && !this.hasFocus && this.hasValue) ||
|
|
8014
|
+
(
|
|
8015
|
+
(!this.value || this.value.length === 0) &&
|
|
8016
|
+
!this.hasFocus &&
|
|
8017
|
+
(!this.placeholder || this.placeholder === '')
|
|
8018
|
+
);
|
|
8004
8019
|
}
|
|
8005
8020
|
|
|
8006
8021
|
/**
|
|
@@ -8020,7 +8035,7 @@ class AuroInput extends BaseInput {
|
|
|
8020
8035
|
* @private
|
|
8021
8036
|
*/
|
|
8022
8037
|
get labelHidden() {
|
|
8023
|
-
return this.hasDisplayValueContent && !this.hasFocus && this.hasValue;
|
|
8038
|
+
return this.hasDisplayValueContent && !this.dvInputOnly && !this.hasFocus && this.hasValue;
|
|
8024
8039
|
}
|
|
8025
8040
|
|
|
8026
8041
|
/**
|
|
@@ -8029,18 +8044,26 @@ class AuroInput extends BaseInput {
|
|
|
8029
8044
|
* @returns {string} - The font class for the label.
|
|
8030
8045
|
*/
|
|
8031
8046
|
get labelFontClass() {
|
|
8032
|
-
const isHidden = this.inputHidden;
|
|
8033
|
-
|
|
8034
8047
|
if (this.layout.startsWith('emphasized')) {
|
|
8035
|
-
|
|
8048
|
+
let typeSize = 'body-sm';
|
|
8049
|
+
|
|
8050
|
+
if (this.hasDisplayValueContent) {
|
|
8051
|
+
if (!this.hasValue) {
|
|
8052
|
+
typeSize = 'accent-xl';
|
|
8053
|
+
}
|
|
8054
|
+
} else if (this.noFocusOrValue) {
|
|
8055
|
+
typeSize = 'accent-xl';
|
|
8056
|
+
}
|
|
8057
|
+
|
|
8058
|
+
return typeSize;
|
|
8036
8059
|
}
|
|
8037
8060
|
|
|
8038
8061
|
if (this.layout === 'snowflake') {
|
|
8039
|
-
return
|
|
8062
|
+
return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
|
|
8040
8063
|
}
|
|
8041
8064
|
|
|
8042
8065
|
// classic layout (default)
|
|
8043
|
-
return
|
|
8066
|
+
return ((!this.value || this.value.length === 0) && !this.placeholder && !this.hasFocus) ? 'body-default' : 'body-xs';
|
|
8044
8067
|
}
|
|
8045
8068
|
|
|
8046
8069
|
/**
|
|
@@ -8050,7 +8073,17 @@ class AuroInput extends BaseInput {
|
|
|
8050
8073
|
*/
|
|
8051
8074
|
get inputFontClass() {
|
|
8052
8075
|
if (this.layout.startsWith('emphasized')) {
|
|
8053
|
-
|
|
8076
|
+
let typeSize = 'accent-xl';
|
|
8077
|
+
|
|
8078
|
+
if (this.hasDisplayValueContent) {
|
|
8079
|
+
if (!this.hasValue) {
|
|
8080
|
+
typeSize = 'body-sm';
|
|
8081
|
+
}
|
|
8082
|
+
} else if (this.noFocusOrValue) {
|
|
8083
|
+
typeSize = 'body-sm';
|
|
8084
|
+
}
|
|
8085
|
+
|
|
8086
|
+
return typeSize;
|
|
8054
8087
|
}
|
|
8055
8088
|
|
|
8056
8089
|
if (this.layout === 'snowflake') {
|
|
@@ -8093,6 +8126,13 @@ class AuroInput extends BaseInput {
|
|
|
8093
8126
|
};
|
|
8094
8127
|
}
|
|
8095
8128
|
|
|
8129
|
+
get commonDisplayValueWrapperClasses() {
|
|
8130
|
+
return {
|
|
8131
|
+
'displayValueWrapper': true,
|
|
8132
|
+
[this.inputFontClass]: true,
|
|
8133
|
+
};
|
|
8134
|
+
}
|
|
8135
|
+
|
|
8096
8136
|
/**
|
|
8097
8137
|
* Returns classmap configuration for html5 inputs in each layout.
|
|
8098
8138
|
* @private
|
|
@@ -8165,7 +8205,7 @@ class AuroInput extends BaseInput {
|
|
|
8165
8205
|
let nodes = this.shadowRoot.querySelector('slot[name="displayValue"]').assignedNodes();
|
|
8166
8206
|
|
|
8167
8207
|
// Handle when DisplayValue is multi-level slot content (e.g. combobox passing displayValue to input)
|
|
8168
|
-
if (nodes[0].tagName === 'SLOT') {
|
|
8208
|
+
if (nodes && nodes[0] && nodes[0].tagName === 'SLOT') {
|
|
8169
8209
|
nodes = nodes[0].assignedNodes();
|
|
8170
8210
|
}
|
|
8171
8211
|
|
|
@@ -8256,7 +8296,7 @@ class AuroInput extends BaseInput {
|
|
|
8256
8296
|
type="${this.type === "password" && this.showPassword ? "text" : this.getInputType(this.type)}"
|
|
8257
8297
|
/>
|
|
8258
8298
|
<div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
|
|
8259
|
-
<div class="
|
|
8299
|
+
<div class="${e(this.commonDisplayValueWrapperClasses)}">
|
|
8260
8300
|
<slot name="displayValue" @slotchange=${this.checkDisplayValueSlotChange}></slot>
|
|
8261
8301
|
</div>
|
|
8262
8302
|
</div>
|
|
@@ -23,13 +23,12 @@ The `<auro-input>` element should be used in situations where users may:
|
|
|
23
23
|
<!-- <auro-input layout="default" shape="rounded" size="xl" placeholder="Departure">
|
|
24
24
|
<label slot="label">From</label>
|
|
25
25
|
</auro-input> -->
|
|
26
|
-
<auro-input id="alpha" value="lax" layout="emphasized" shape="
|
|
26
|
+
<auro-input dvInputOnly id="alpha" value="lax" layout="emphasized" shape="pill" size="xl" placeholder="Departure" style="width: 249px;" ondark required>
|
|
27
27
|
<span slot="ariaLabel.clear">Clear All</span>
|
|
28
28
|
<label slot="label">From</label>
|
|
29
29
|
<span slot="helpText">Example help text</span>
|
|
30
30
|
<span slot="displayValue">
|
|
31
31
|
<div>
|
|
32
|
-
<div class="mainText">LAX</div>
|
|
33
32
|
<div class="subText">Los Angeles</div>
|
|
34
33
|
</div>
|
|
35
34
|
</span>
|
|
@@ -57,10 +56,15 @@ The `<auro-input>` element should be used in situations where users may:
|
|
|
57
56
|
<div class="exampleWrapper--ondark">
|
|
58
57
|
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/snowflake/basic.html) -->
|
|
59
58
|
<!-- The below content is automatically added from ./../apiExamples/snowflake/basic.html -->
|
|
60
|
-
<auro-input id="snowflakePill" layout="snowflake" shape="snowflake" size="lg" placeholder="Departure" style="width: 249px;" ondark required>
|
|
59
|
+
<auro-input dvInputOnly value="lax" id="snowflakePill" layout="snowflake" shape="snowflake" size="lg" placeholder="Departure" style="width: 249px;" ondark required>
|
|
61
60
|
<span slot="ariaLabel.clear">Clear All</span>
|
|
62
61
|
<label slot="label">From</label>
|
|
63
62
|
<span slot="helpText">Example help text</span>
|
|
63
|
+
<span slot="displayValue">
|
|
64
|
+
<div>
|
|
65
|
+
<div class="subText">Los Angeles</div>
|
|
66
|
+
</div>
|
|
67
|
+
</span>
|
|
64
68
|
</auro-input>
|
|
65
69
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
66
70
|
</div>
|