@aurodesignsystem-dev/auro-formkit 0.0.0-pr1215.1 → 0.0.0-pr1217.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
  /**
@@ -1327,10 +1327,15 @@ class AuroMenuOption extends AuroElement {
1327
1327
  AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
1328
1328
  }
1329
1329
 
1330
- firstUpdated() {
1330
+ connectedCallback() {
1331
+ super.connectedCallback();
1332
+
1331
1333
  // Add the tag name as an attribute if it is different than the component name
1334
+ // Add this step soon as this node gets attached to the DOM to avoid racing condition with menu's value setting logic.
1332
1335
  this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
1336
+ }
1333
1337
 
1338
+ firstUpdated() {
1334
1339
  if (!this.hasAttribute('size')) {
1335
1340
  this.size = this.parentElement.getAttribute('size') || 'sm';
1336
1341
  }
@@ -1287,10 +1287,15 @@ class AuroMenuOption extends AuroElement {
1287
1287
  AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
1288
1288
  }
1289
1289
 
1290
- firstUpdated() {
1290
+ connectedCallback() {
1291
+ super.connectedCallback();
1292
+
1291
1293
  // Add the tag name as an attribute if it is different than the component name
1294
+ // Add this step soon as this node gets attached to the DOM to avoid racing condition with menu's value setting logic.
1292
1295
  this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
1296
+ }
1293
1297
 
1298
+ firstUpdated() {
1294
1299
  if (!this.hasAttribute('size')) {
1295
1300
  this.size = this.parentElement.getAttribute('size') || 'sm';
1296
1301
  }
@@ -1281,10 +1281,15 @@ class AuroMenuOption extends AuroElement {
1281
1281
  AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
1282
1282
  }
1283
1283
 
1284
- firstUpdated() {
1284
+ connectedCallback() {
1285
+ super.connectedCallback();
1286
+
1285
1287
  // Add the tag name as an attribute if it is different than the component name
1288
+ // Add this step soon as this node gets attached to the DOM to avoid racing condition with menu's value setting logic.
1286
1289
  this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
1290
+ }
1287
1291
 
1292
+ firstUpdated() {
1288
1293
  if (!this.hasAttribute('size')) {
1289
1294
  this.size = this.parentElement.getAttribute('size') || 'sm';
1290
1295
  }
@@ -1240,10 +1240,15 @@ class AuroMenuOption extends AuroElement {
1240
1240
  AuroLibraryRuntimeUtils.prototype.registerComponent(name, AuroMenuOption);
1241
1241
  }
1242
1242
 
1243
- firstUpdated() {
1243
+ connectedCallback() {
1244
+ super.connectedCallback();
1245
+
1244
1246
  // Add the tag name as an attribute if it is different than the component name
1247
+ // Add this step soon as this node gets attached to the DOM to avoid racing condition with menu's value setting logic.
1245
1248
  this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
1249
+ }
1246
1250
 
1251
+ firstUpdated() {
1247
1252
  if (!this.hasAttribute('size')) {
1248
1253
  this.size = this.parentElement.getAttribute('size') || 'sm';
1249
1254
  }
@@ -6671,6 +6671,7 @@ class AuroSelect extends AuroElement$1 {
6671
6671
  }
6672
6672
 
6673
6673
  this.updateMenuShapeSize();
6674
+ this.updateMenuValue(this.value);
6674
6675
 
6675
6676
  if (this.multiSelect) {
6676
6677
  this.menu.multiSelect = this.multiSelect;
@@ -8485,10 +8486,15 @@ class AuroMenuOption extends AuroElement$1 {
8485
8486
  AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroMenuOption);
8486
8487
  }
8487
8488
 
8488
- firstUpdated() {
8489
+ connectedCallback() {
8490
+ super.connectedCallback();
8491
+
8489
8492
  // Add the tag name as an attribute if it is different than the component name
8493
+ // Add this step soon as this node gets attached to the DOM to avoid racing condition with menu's value setting logic.
8490
8494
  this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
8495
+ }
8491
8496
 
8497
+ firstUpdated() {
8492
8498
  if (!this.hasAttribute('size')) {
8493
8499
  this.size = this.parentElement.getAttribute('size') || 'sm';
8494
8500
  }
@@ -6579,6 +6579,7 @@ class AuroSelect extends AuroElement$1 {
6579
6579
  }
6580
6580
 
6581
6581
  this.updateMenuShapeSize();
6582
+ this.updateMenuValue(this.value);
6582
6583
 
6583
6584
  if (this.multiSelect) {
6584
6585
  this.menu.multiSelect = this.multiSelect;
@@ -8393,10 +8394,15 @@ class AuroMenuOption extends AuroElement$1 {
8393
8394
  AuroLibraryRuntimeUtils$3.prototype.registerComponent(name, AuroMenuOption);
8394
8395
  }
8395
8396
 
8396
- firstUpdated() {
8397
+ connectedCallback() {
8398
+ super.connectedCallback();
8399
+
8397
8400
  // Add the tag name as an attribute if it is different than the component name
8401
+ // Add this step soon as this node gets attached to the DOM to avoid racing condition with menu's value setting logic.
8398
8402
  this.runtimeUtils.handleComponentTagRename(this, 'auro-menuoption');
8403
+ }
8399
8404
 
8405
+ firstUpdated() {
8400
8406
  if (!this.hasAttribute('size')) {
8401
8407
  this.size = this.parentElement.getAttribute('size') || 'sm';
8402
8408
  }
@@ -6516,6 +6516,7 @@ class AuroSelect extends AuroElement$1 {
6516
6516
  }
6517
6517
 
6518
6518
  this.updateMenuShapeSize();
6519
+ this.updateMenuValue(this.value);
6519
6520
 
6520
6521
  if (this.multiSelect) {
6521
6522
  this.menu.multiSelect = this.multiSelect;
@@ -6516,6 +6516,7 @@ class AuroSelect extends AuroElement$1 {
6516
6516
  }
6517
6517
 
6518
6518
  this.updateMenuShapeSize();
6519
+ this.updateMenuValue(this.value);
6519
6520
 
6520
6521
  if (this.multiSelect) {
6521
6522
  this.menu.multiSelect = this.multiSelect;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr1215.1",
3
+ "version": "0.0.0-pr1217.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": {