@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.
Files changed (42) hide show
  1. package/components/combobox/README.md +2 -0
  2. package/components/combobox/demo/api.md +96 -57
  3. package/components/combobox/demo/api.min.js +353 -144
  4. package/components/combobox/demo/index.md +2 -0
  5. package/components/combobox/demo/index.min.js +332 -133
  6. package/components/combobox/demo/readme.md +2 -0
  7. package/components/combobox/dist/auro-combobox.d.ts +81 -33
  8. package/components/combobox/dist/index.js +294 -118
  9. package/components/combobox/dist/registered.js +294 -118
  10. package/components/counter/demo/api.min.js +2 -2
  11. package/components/counter/demo/index.min.js +2 -2
  12. package/components/counter/dist/index.js +2 -2
  13. package/components/counter/dist/registered.js +2 -2
  14. package/components/datepicker/demo/api.min.js +54 -14
  15. package/components/datepicker/demo/index.min.js +54 -14
  16. package/components/datepicker/dist/index.js +54 -14
  17. package/components/datepicker/dist/registered.js +54 -14
  18. package/components/dropdown/demo/api.min.js +1 -1
  19. package/components/dropdown/demo/index.min.js +1 -1
  20. package/components/dropdown/dist/index.js +1 -1
  21. package/components/dropdown/dist/registered.js +1 -1
  22. package/components/input/demo/api.md +48 -46
  23. package/components/input/demo/api.min.js +52 -12
  24. package/components/input/demo/index.md +6 -1
  25. package/components/input/demo/index.min.js +52 -12
  26. package/components/input/dist/auro-input.d.ts +4 -0
  27. package/components/input/dist/base-input.d.ts +9 -1
  28. package/components/input/dist/index.js +52 -12
  29. package/components/input/dist/registered.js +52 -12
  30. package/components/layoutElement/dist/index.js +1 -1
  31. package/components/layoutElement/dist/registered.js +1 -1
  32. package/components/menu/demo/api.md +4 -3
  33. package/components/menu/demo/api.min.js +39 -16
  34. package/components/menu/demo/index.min.js +39 -16
  35. package/components/menu/dist/auro-menu.d.ts +3 -3
  36. package/components/menu/dist/index.js +39 -16
  37. package/components/menu/dist/registered.js +39 -16
  38. package/components/select/demo/api.min.js +40 -17
  39. package/components/select/demo/index.min.js +40 -17
  40. package/components/select/dist/index.js +2 -2
  41. package/components/select/dist/registered.js +2 -2
  42. 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() {
@@ -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 screenreader to read
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 (this.hasDisplayValueContent && !this.hasFocus && this.hasValue) || ((!this.value || this.value.length === 0) && !this.hasFocus && (!this.placeholder || this.placeholder === ''));
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
- return this.noFocusOrValue ? 'accent-xl' : 'body-sm';
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 isHidden ? 'body-lg' : 'body-xs';
26512
+ return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
26490
26513
  }
26491
26514
 
26492
26515
  // classic layout (default)
26493
- return isHidden ? 'body-default' : 'body-xs';
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
- return this.noFocusOrValue ? 'body-sm' : 'accent-xl';
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="displayValueWrapper">
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() {
@@ -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() {
@@ -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() {
@@ -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() {
@@ -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() {
@@ -7,51 +7,53 @@ Generate unique names for dependency components.
7
7
 
8
8
  ## Properties
9
9
 
10
- | Property | Attribute | 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
- | [customValidityTypeEmail](#customValidityTypeEmail) | `customValidityTypeEmail` | `string` | | Custom help text message for email type validity. |
20
- | [disabled](#disabled) | `disabled` | `boolean` | false | If set, disables the input. |
21
- | [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
22
- | [errorMessage](#errorMessage) | `errorMessage` | `string` | | Contains the help text message for the current validity error. |
23
- | [format](#format) | `format` | `string` | | Specifies the input mask format. |
24
- | [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. |
25
- | [id](#id) | `id` | `string` | | The id global attribute defines an identifier (ID) which must be unique in the whole document. |
26
- | [inputmode](#inputmode) | `inputmode` | `string` | | Exposes inputmode attribute for input. |
27
- | [lang](#lang) | `lang` | `string` | | Defines the language of an element. |
28
- | [max](#max) | `max` | `string` | "undefined" | The maximum value allowed. This only applies for inputs with a type of `number` and all date formats. |
29
- | [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. |
30
- | [min](#min) | `min` | `string` | "undefined" | The minimum value allowed. This only applies for inputs with a type of `number` and all date formats. |
31
- | [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`. |
32
- | [name](#name) | `name` | `string` | | Populates the `name` attribute on the input. |
33
- | [nested](#nested) | `nested` | `boolean` | | Sets styles for nested operation - removes borders, hides help + error text, and<br />hides accents. |
34
- | [noValidate](#noValidate) | `noValidate` | `boolean` | false | If set, disables auto-validation on blur. |
35
- | [onDark](#onDark) | `onDark` | `boolean` | false | Sets onDark styles on input. |
36
- | [pattern](#pattern) | `pattern` | `string` | | Specifies a regular expression the form control's value should match. |
37
- | [placeholder](#placeholder) | `placeholder` | `string` | | Define custom placeholder text. |
38
- | [readonly](#readonly) | `readonly` | `boolean` | | Makes the input read-only, but can be set programmatically. |
39
- | [required](#required) | `required` | `boolean` | false | Populates the `required` attribute on the input. Used for client-side validation. |
40
- | [setCustomValidity](#setCustomValidity) | `setCustomValidity` | `string` | | Sets a custom help text message to display for all validityStates. |
41
- | [setCustomValidityBadInput](#setCustomValidityBadInput) | `setCustomValidityBadInput` | `string` | | Custom help text message to display when validity = `badInput`. |
42
- | [setCustomValidityCustomError](#setCustomValidityCustomError) | `setCustomValidityCustomError` | `string` | | Custom help text message to display when validity = `customError`. |
43
- | [setCustomValidityForType](#setCustomValidityForType) | `setCustomValidityForType` | `string` | "undefined" | Custom help text message to display for the declared element `type` and type validity fails. |
44
- | [setCustomValidityRangeOverflow](#setCustomValidityRangeOverflow) | `setCustomValidityRangeOverflow` | `string` | | Custom help text message to display when validity = `rangeOverflow`. |
45
- | [setCustomValidityRangeUnderflow](#setCustomValidityRangeUnderflow) | `setCustomValidityRangeUnderflow` | `string` | | Custom help text message to display when validity = `rangeUnderflow`. |
46
- | [setCustomValidityTooLong](#setCustomValidityTooLong) | `setCustomValidityTooLong` | `string` | | Custom help text message to display when validity = `tooLong`. |
47
- | [setCustomValidityTooShort](#setCustomValidityTooShort) | `setCustomValidityTooShort` | `string` | | Custom help text message to display when validity = `tooShort`. |
48
- | [setCustomValidityValueMissing](#setCustomValidityValueMissing) | `setCustomValidityValueMissing` | `string` | | Custom help text message to display when validity = `valueMissing`. |
49
- | [simple](#simple) | `simple` | `boolean` | | Simple makes the input render without a border. |
50
- | [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`. |
51
- | [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`. |
52
- | [validateOnInput](#validateOnInput) | `validateOnInput` | `boolean` | | Sets validation mode to re-eval with each input. |
53
- | [validity](#validity) | `validity` | `string` | | Specifies the `validityState` this element is in. |
54
- | [value](#value) | `value` | `string` | | Populates the `value` attribute on the input. Can also be read to retrieve the current value of the input. |
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 inputs 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 screenreader to read |
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 screenreader to read
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 inputs 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 (this.hasDisplayValueContent && !this.hasFocus && this.hasValue) || ((!this.value || this.value.length === 0) && !this.hasFocus && (!this.placeholder || this.placeholder === ''));
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
- return this.noFocusOrValue ? 'accent-xl' : 'body-sm';
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 isHidden ? 'body-lg' : 'body-xs';
8062
+ return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
8040
8063
  }
8041
8064
 
8042
8065
  // classic layout (default)
8043
- return isHidden ? 'body-default' : 'body-xs';
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
- return this.noFocusOrValue ? 'body-sm' : 'accent-xl';
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="displayValueWrapper">
8299
+ <div class="${e(this.commonDisplayValueWrapperClasses)}">
8260
8300
  <slot name="displayValue" @slotchange=${this.checkDisplayValueSlotChange}></slot>
8261
8301
  </div>
8262
8302
  </div>
@@ -57,10 +57,15 @@ The `<auro-input>` element should be used in situations where users may:
57
57
  <div class="exampleWrapper--ondark">
58
58
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/snowflake/basic.html) -->
59
59
  <!-- 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>
60
+ <auro-input dvInputOnly value="lax" id="snowflakePill" layout="snowflake" shape="snowflake" size="lg" placeholder="Departure" style="width: 249px;" ondark required>
61
61
  <span slot="ariaLabel.clear">Clear All</span>
62
62
  <label slot="label">From</label>
63
63
  <span slot="helpText">Example help text</span>
64
+ <span slot="displayValue">
65
+ <div>
66
+ <div class="subText">Los Angeles</div>
67
+ </div>
68
+ </span>
64
69
  </auro-input>
65
70
  <!-- AURO-GENERATED-CONTENT:END -->
66
71
  </div>