@aurodesignsystem-dev/auro-formkit 0.0.0-pr1215.0 → 0.0.0-pr1218.0

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.
@@ -5130,7 +5130,6 @@ class BaseInput extends AuroElement {
5130
5130
  this.validationCCLength = undefined;
5131
5131
  this.hasValue = false;
5132
5132
  this.label = 'Input label is undefined';
5133
- this.placeholderStr = '';
5134
5133
 
5135
5134
  this.allowedInputTypes = [
5136
5135
  "text",
@@ -5287,6 +5286,26 @@ class BaseInput extends AuroElement {
5287
5286
  reflect: true
5288
5287
  },
5289
5288
 
5289
+ /**
5290
+ * @private
5291
+ * Flag to indicate if the input currently has value.
5292
+ */
5293
+ hasValue: {
5294
+ type: Boolean,
5295
+ reflect: false,
5296
+ attribute: false
5297
+ },
5298
+
5299
+ /**
5300
+ * @private
5301
+ * Flag to indicate if the input currently has focus.
5302
+ */
5303
+ hasFocus: {
5304
+ type: Boolean,
5305
+ reflect: false,
5306
+ attribute: false
5307
+ },
5308
+
5290
5309
  /**
5291
5310
  * 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.
5292
5311
  */
@@ -5589,7 +5608,6 @@ class BaseInput extends AuroElement {
5589
5608
  this.ValidityMessageOverride = this.setCustomValidity;
5590
5609
  }
5591
5610
 
5592
- this.getPlaceholder();
5593
5611
  this.setCustomHelpTextMessage();
5594
5612
  this.configureAutoFormatting();
5595
5613
  }
@@ -5674,10 +5692,6 @@ class BaseInput extends AuroElement {
5674
5692
  updated(changedProperties) {
5675
5693
  super.updated(changedProperties);
5676
5694
 
5677
- if (changedProperties.has('placeholder')) {
5678
- this.getPlaceholder();
5679
- }
5680
-
5681
5695
  if (changedProperties.has('format')) {
5682
5696
  this.configureAutoFormatting();
5683
5697
  }
@@ -5711,10 +5725,8 @@ class BaseInput extends AuroElement {
5711
5725
  if (changedProperties.has('value')) {
5712
5726
  if (this.value && this.value.length > 0) {
5713
5727
  this.hasValue = true;
5714
- this.requestUpdate();
5715
5728
  } else {
5716
5729
  this.hasValue = false;
5717
- this.requestUpdate();
5718
5730
  }
5719
5731
 
5720
5732
  if (this.value !== this.inputElement.value) {
@@ -5900,8 +5912,6 @@ class BaseInput extends AuroElement {
5900
5912
  handleFocusin() {
5901
5913
  this.hasFocus = true;
5902
5914
 
5903
- this.getPlaceholder();
5904
-
5905
5915
  this.touched = true;
5906
5916
  }
5907
5917
 
@@ -5912,7 +5922,6 @@ class BaseInput extends AuroElement {
5912
5922
  */
5913
5923
  handleFocusout() {
5914
5924
  this.hasFocus = false;
5915
- this.getPlaceholder();
5916
5925
  }
5917
5926
 
5918
5927
  /**
@@ -6049,16 +6058,11 @@ class BaseInput extends AuroElement {
6049
6058
  * @private
6050
6059
  * @returns {void}
6051
6060
  */
6052
- getPlaceholder() {
6053
- if (this.placeholder) {
6054
- this.placeholderStr = this.placeholder;
6055
- } else if (this.type === 'date') {
6056
- this.placeholderStr = this.format ? this.format.toUpperCase() : 'MM/DD/YYYY';
6061
+ get placeholderStr() {
6062
+ if (!this.placeholder && this.type === 'date') {
6063
+ return this.format ? this.format.toUpperCase() : 'MM/DD/YYYY';
6057
6064
  }
6058
-
6059
- this.requestUpdate();
6060
-
6061
- return this.placeholderStr;
6065
+ return this.placeholder || "";
6062
6066
  }
6063
6067
 
6064
6068
  /**
@@ -6640,7 +6644,7 @@ class AuroInput extends BaseInput {
6640
6644
  (
6641
6645
  (!this.value || this.value.length === 0) &&
6642
6646
  !this.hasFocus &&
6643
- (!this.placeholder || this.placeholder === '')
6647
+ (!this.placeholderStr || this.placeholderStr === '')
6644
6648
  );
6645
6649
  }
6646
6650
 
@@ -6685,11 +6689,11 @@ class AuroInput extends BaseInput {
6685
6689
  }
6686
6690
 
6687
6691
  if (this.layout === 'snowflake') {
6688
- return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
6692
+ return this.hasValue || this.hasFocus || this.placeholderStr ? 'body-xs' : 'body-lg';
6689
6693
  }
6690
6694
 
6691
6695
  // classic layout (default)
6692
- return ((!this.value || this.value.length === 0) && !this.placeholder && !this.hasFocus) ? 'body-default' : 'body-xs';
6696
+ return ((!this.value || this.value.length === 0) && !this.placeholderStr && !this.hasFocus) ? 'body-default' : 'body-xs';
6693
6697
  }
6694
6698
 
6695
6699
  /**
@@ -5130,7 +5130,6 @@ class BaseInput extends AuroElement {
5130
5130
  this.validationCCLength = undefined;
5131
5131
  this.hasValue = false;
5132
5132
  this.label = 'Input label is undefined';
5133
- this.placeholderStr = '';
5134
5133
 
5135
5134
  this.allowedInputTypes = [
5136
5135
  "text",
@@ -5287,6 +5286,26 @@ class BaseInput extends AuroElement {
5287
5286
  reflect: true
5288
5287
  },
5289
5288
 
5289
+ /**
5290
+ * @private
5291
+ * Flag to indicate if the input currently has value.
5292
+ */
5293
+ hasValue: {
5294
+ type: Boolean,
5295
+ reflect: false,
5296
+ attribute: false
5297
+ },
5298
+
5299
+ /**
5300
+ * @private
5301
+ * Flag to indicate if the input currently has focus.
5302
+ */
5303
+ hasFocus: {
5304
+ type: Boolean,
5305
+ reflect: false,
5306
+ attribute: false
5307
+ },
5308
+
5290
5309
  /**
5291
5310
  * 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.
5292
5311
  */
@@ -5589,7 +5608,6 @@ class BaseInput extends AuroElement {
5589
5608
  this.ValidityMessageOverride = this.setCustomValidity;
5590
5609
  }
5591
5610
 
5592
- this.getPlaceholder();
5593
5611
  this.setCustomHelpTextMessage();
5594
5612
  this.configureAutoFormatting();
5595
5613
  }
@@ -5674,10 +5692,6 @@ class BaseInput extends AuroElement {
5674
5692
  updated(changedProperties) {
5675
5693
  super.updated(changedProperties);
5676
5694
 
5677
- if (changedProperties.has('placeholder')) {
5678
- this.getPlaceholder();
5679
- }
5680
-
5681
5695
  if (changedProperties.has('format')) {
5682
5696
  this.configureAutoFormatting();
5683
5697
  }
@@ -5711,10 +5725,8 @@ class BaseInput extends AuroElement {
5711
5725
  if (changedProperties.has('value')) {
5712
5726
  if (this.value && this.value.length > 0) {
5713
5727
  this.hasValue = true;
5714
- this.requestUpdate();
5715
5728
  } else {
5716
5729
  this.hasValue = false;
5717
- this.requestUpdate();
5718
5730
  }
5719
5731
 
5720
5732
  if (this.value !== this.inputElement.value) {
@@ -5900,8 +5912,6 @@ class BaseInput extends AuroElement {
5900
5912
  handleFocusin() {
5901
5913
  this.hasFocus = true;
5902
5914
 
5903
- this.getPlaceholder();
5904
-
5905
5915
  this.touched = true;
5906
5916
  }
5907
5917
 
@@ -5912,7 +5922,6 @@ class BaseInput extends AuroElement {
5912
5922
  */
5913
5923
  handleFocusout() {
5914
5924
  this.hasFocus = false;
5915
- this.getPlaceholder();
5916
5925
  }
5917
5926
 
5918
5927
  /**
@@ -6049,16 +6058,11 @@ class BaseInput extends AuroElement {
6049
6058
  * @private
6050
6059
  * @returns {void}
6051
6060
  */
6052
- getPlaceholder() {
6053
- if (this.placeholder) {
6054
- this.placeholderStr = this.placeholder;
6055
- } else if (this.type === 'date') {
6056
- this.placeholderStr = this.format ? this.format.toUpperCase() : 'MM/DD/YYYY';
6061
+ get placeholderStr() {
6062
+ if (!this.placeholder && this.type === 'date') {
6063
+ return this.format ? this.format.toUpperCase() : 'MM/DD/YYYY';
6057
6064
  }
6058
-
6059
- this.requestUpdate();
6060
-
6061
- return this.placeholderStr;
6065
+ return this.placeholder || "";
6062
6066
  }
6063
6067
 
6064
6068
  /**
@@ -6640,7 +6644,7 @@ class AuroInput extends BaseInput {
6640
6644
  (
6641
6645
  (!this.value || this.value.length === 0) &&
6642
6646
  !this.hasFocus &&
6643
- (!this.placeholder || this.placeholder === '')
6647
+ (!this.placeholderStr || this.placeholderStr === '')
6644
6648
  );
6645
6649
  }
6646
6650
 
@@ -6685,11 +6689,11 @@ class AuroInput extends BaseInput {
6685
6689
  }
6686
6690
 
6687
6691
  if (this.layout === 'snowflake') {
6688
- return this.hasValue || this.hasFocus || this.placeholder ? 'body-xs' : 'body-lg';
6692
+ return this.hasValue || this.hasFocus || this.placeholderStr ? 'body-xs' : 'body-lg';
6689
6693
  }
6690
6694
 
6691
6695
  // classic layout (default)
6692
- return ((!this.value || this.value.length === 0) && !this.placeholder && !this.hasFocus) ? 'body-default' : 'body-xs';
6696
+ return ((!this.value || this.value.length === 0) && !this.placeholderStr && !this.hasFocus) ? 'body-default' : 'body-xs';
6693
6697
  }
6694
6698
 
6695
6699
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr1215.0",
3
+ "version": "0.0.0-pr1218.0",
4
4
  "description": "A collection of web components used to build forms.",
5
5
  "homepage": "https://github.com/AlaskaAirlines/auro-formkit#readme",
6
6
  "bugs": {