@aurodesignsystem-dev/auro-formkit 0.0.0-pr624.6 → 0.0.0-pr624.7

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.
@@ -6468,6 +6468,7 @@ class AuroSelect extends AuroElement$3 {
6468
6468
  this.value = undefined;
6469
6469
  this.fullscreenBreakpoint = 'sm';
6470
6470
  this.onDark = false;
6471
+ this.isPopoverVisible = false;
6471
6472
  }
6472
6473
 
6473
6474
  // This function is to define props used within the scope of this component
@@ -6509,6 +6510,14 @@ class AuroSelect extends AuroElement$3 {
6509
6510
  reflect: true
6510
6511
  },
6511
6512
 
6513
+ /**
6514
+ * @private
6515
+ */
6516
+ isPopoverVisible: {
6517
+ type: Boolean,
6518
+ reflect: false
6519
+ },
6520
+
6512
6521
  /**
6513
6522
  * If declared, the popover and trigger will be set to the same width.
6514
6523
  */
@@ -6755,6 +6764,10 @@ class AuroSelect extends AuroElement$3 {
6755
6764
  configureDropdown() {
6756
6765
  this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
6757
6766
 
6767
+ this.dropdown.addEventListener('auroDropdown-toggled', () => {
6768
+ this.isPopoverVisible = this.dropdown.isPopoverVisible;
6769
+ });
6770
+
6758
6771
  // setting up bibtemplate
6759
6772
  this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$); // eslint-disable-line no-underscore-dangle
6760
6773
 
@@ -6787,13 +6800,18 @@ class AuroSelect extends AuroElement$3 {
6787
6800
  const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
6788
6801
 
6789
6802
  // Clear out old value
6790
- // const placeholder = triggerContentEl.querySelector('#placeholder');
6791
6803
  const valueElem = triggerContentEl.querySelector('#value');
6792
6804
  if (valueElem) {
6793
6805
  valueElem.innerHTML = '';
6794
- // valueElem.innerHTML = ''.appendChild(value);
6795
6806
  }
6796
6807
 
6808
+ const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
6809
+ const slottedElements = slot.assignedElements();
6810
+
6811
+ slottedElements.forEach((element) => {
6812
+ element.remove();
6813
+ });
6814
+
6797
6815
  // Handle selected options
6798
6816
  if (this.optionSelected) {
6799
6817
  if (this.multiSelect && this.optionSelected.length > 0) {
@@ -6803,10 +6821,8 @@ class AuroSelect extends AuroElement$3 {
6803
6821
  } else {
6804
6822
  valueElem.innerHTML = this.optionSelected.innerHTML;
6805
6823
  const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
6806
- if (displayValueEl) {
6807
- const oldDisplayValueEl = this.querySelectorAll("[slot='displayValue']");
6808
- oldDisplayValueEl.forEach((el) => el.remove());
6809
6824
 
6825
+ if (displayValueEl) {
6810
6826
  this.appendChild(displayValueEl.cloneNode(true));
6811
6827
  }
6812
6828
  this.hasDisplayValueContent = displayValueEl !== null;
@@ -7315,14 +7331,14 @@ class AuroSelect extends AuroElement$3 {
7315
7331
  const displayValueClasses = {
7316
7332
  'displayValue': true,
7317
7333
  'hasContent': this.hasDisplayValueContent,
7318
- 'hasFocus': this.hasFocus,
7334
+ 'hasFocus': this.isPopoverVisible,
7319
7335
  'withValue': this.value && this.value.length > 0,
7320
7336
  'force': this.forceDisplayValue,
7321
7337
  };
7322
7338
 
7323
7339
  const valueContainerClasses = {
7324
7340
  'valueContainer': true,
7325
- 'util_displayHiddenVisually': true
7341
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
7326
7342
  };
7327
7343
 
7328
7344
  return u`
@@ -7395,14 +7411,14 @@ class AuroSelect extends AuroElement$3 {
7395
7411
  const displayValueClasses = {
7396
7412
  'displayValue': true,
7397
7413
  'hasContent': this.hasDisplayValueContent,
7398
- 'hasFocus': this.hasFocus,
7414
+ 'hasFocus': this.isPopoverVisible,
7399
7415
  'withValue': this.value && this.value.length > 0,
7400
7416
  'force': this.forceDisplayValue,
7401
7417
  };
7402
7418
 
7403
7419
  const valueContainerClasses = {
7404
7420
  'valueContainer': true,
7405
- 'util_displayHiddenVisually': (this.forceDisplayValue || !this.hasFocus) && this.hasDisplayValueContent
7421
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
7406
7422
  };
7407
7423
 
7408
7424
  return u`
@@ -6365,6 +6365,7 @@ class AuroSelect extends AuroElement$3 {
6365
6365
  this.value = undefined;
6366
6366
  this.fullscreenBreakpoint = 'sm';
6367
6367
  this.onDark = false;
6368
+ this.isPopoverVisible = false;
6368
6369
  }
6369
6370
 
6370
6371
  // This function is to define props used within the scope of this component
@@ -6406,6 +6407,14 @@ class AuroSelect extends AuroElement$3 {
6406
6407
  reflect: true
6407
6408
  },
6408
6409
 
6410
+ /**
6411
+ * @private
6412
+ */
6413
+ isPopoverVisible: {
6414
+ type: Boolean,
6415
+ reflect: false
6416
+ },
6417
+
6409
6418
  /**
6410
6419
  * If declared, the popover and trigger will be set to the same width.
6411
6420
  */
@@ -6652,6 +6661,10 @@ class AuroSelect extends AuroElement$3 {
6652
6661
  configureDropdown() {
6653
6662
  this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
6654
6663
 
6664
+ this.dropdown.addEventListener('auroDropdown-toggled', () => {
6665
+ this.isPopoverVisible = this.dropdown.isPopoverVisible;
6666
+ });
6667
+
6655
6668
  // setting up bibtemplate
6656
6669
  this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$); // eslint-disable-line no-underscore-dangle
6657
6670
 
@@ -6684,13 +6697,18 @@ class AuroSelect extends AuroElement$3 {
6684
6697
  const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
6685
6698
 
6686
6699
  // Clear out old value
6687
- // const placeholder = triggerContentEl.querySelector('#placeholder');
6688
6700
  const valueElem = triggerContentEl.querySelector('#value');
6689
6701
  if (valueElem) {
6690
6702
  valueElem.innerHTML = '';
6691
- // valueElem.innerHTML = ''.appendChild(value);
6692
6703
  }
6693
6704
 
6705
+ const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
6706
+ const slottedElements = slot.assignedElements();
6707
+
6708
+ slottedElements.forEach((element) => {
6709
+ element.remove();
6710
+ });
6711
+
6694
6712
  // Handle selected options
6695
6713
  if (this.optionSelected) {
6696
6714
  if (this.multiSelect && this.optionSelected.length > 0) {
@@ -6700,10 +6718,8 @@ class AuroSelect extends AuroElement$3 {
6700
6718
  } else {
6701
6719
  valueElem.innerHTML = this.optionSelected.innerHTML;
6702
6720
  const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
6703
- if (displayValueEl) {
6704
- const oldDisplayValueEl = this.querySelectorAll("[slot='displayValue']");
6705
- oldDisplayValueEl.forEach((el) => el.remove());
6706
6721
 
6722
+ if (displayValueEl) {
6707
6723
  this.appendChild(displayValueEl.cloneNode(true));
6708
6724
  }
6709
6725
  this.hasDisplayValueContent = displayValueEl !== null;
@@ -7212,14 +7228,14 @@ class AuroSelect extends AuroElement$3 {
7212
7228
  const displayValueClasses = {
7213
7229
  'displayValue': true,
7214
7230
  'hasContent': this.hasDisplayValueContent,
7215
- 'hasFocus': this.hasFocus,
7231
+ 'hasFocus': this.isPopoverVisible,
7216
7232
  'withValue': this.value && this.value.length > 0,
7217
7233
  'force': this.forceDisplayValue,
7218
7234
  };
7219
7235
 
7220
7236
  const valueContainerClasses = {
7221
7237
  'valueContainer': true,
7222
- 'util_displayHiddenVisually': true
7238
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
7223
7239
  };
7224
7240
 
7225
7241
  return u`
@@ -7292,14 +7308,14 @@ class AuroSelect extends AuroElement$3 {
7292
7308
  const displayValueClasses = {
7293
7309
  'displayValue': true,
7294
7310
  'hasContent': this.hasDisplayValueContent,
7295
- 'hasFocus': this.hasFocus,
7311
+ 'hasFocus': this.isPopoverVisible,
7296
7312
  'withValue': this.value && this.value.length > 0,
7297
7313
  'force': this.forceDisplayValue,
7298
7314
  };
7299
7315
 
7300
7316
  const valueContainerClasses = {
7301
7317
  'valueContainer': true,
7302
- 'util_displayHiddenVisually': (this.forceDisplayValue || !this.hasFocus) && this.hasDisplayValueContent
7318
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
7303
7319
  };
7304
7320
 
7305
7321
  return u`
@@ -43,6 +43,13 @@ export class AuroSelect extends AuroElement {
43
43
  type: BooleanConstructor;
44
44
  reflect: boolean;
45
45
  };
46
+ /**
47
+ * @private
48
+ */
49
+ isPopoverVisible: {
50
+ type: BooleanConstructor;
51
+ reflect: boolean;
52
+ };
46
53
  /**
47
54
  * If declared, the popover and trigger will be set to the same width.
48
55
  */
@@ -293,6 +300,7 @@ export class AuroSelect extends AuroElement {
293
300
  value: any;
294
301
  fullscreenBreakpoint: string;
295
302
  onDark: boolean;
303
+ isPopoverVisible: any;
296
304
  /**
297
305
  * Returns classmap configuration for wrapper elements in each layout.
298
306
  * @private
@@ -6319,6 +6319,7 @@ class AuroSelect extends AuroElement$3 {
6319
6319
  this.value = undefined;
6320
6320
  this.fullscreenBreakpoint = 'sm';
6321
6321
  this.onDark = false;
6322
+ this.isPopoverVisible = false;
6322
6323
  }
6323
6324
 
6324
6325
  // This function is to define props used within the scope of this component
@@ -6360,6 +6361,14 @@ class AuroSelect extends AuroElement$3 {
6360
6361
  reflect: true
6361
6362
  },
6362
6363
 
6364
+ /**
6365
+ * @private
6366
+ */
6367
+ isPopoverVisible: {
6368
+ type: Boolean,
6369
+ reflect: false
6370
+ },
6371
+
6363
6372
  /**
6364
6373
  * If declared, the popover and trigger will be set to the same width.
6365
6374
  */
@@ -6606,6 +6615,10 @@ class AuroSelect extends AuroElement$3 {
6606
6615
  configureDropdown() {
6607
6616
  this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
6608
6617
 
6618
+ this.dropdown.addEventListener('auroDropdown-toggled', () => {
6619
+ this.isPopoverVisible = this.dropdown.isPopoverVisible;
6620
+ });
6621
+
6609
6622
  // setting up bibtemplate
6610
6623
  this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$); // eslint-disable-line no-underscore-dangle
6611
6624
 
@@ -6638,13 +6651,18 @@ class AuroSelect extends AuroElement$3 {
6638
6651
  const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
6639
6652
 
6640
6653
  // Clear out old value
6641
- // const placeholder = triggerContentEl.querySelector('#placeholder');
6642
6654
  const valueElem = triggerContentEl.querySelector('#value');
6643
6655
  if (valueElem) {
6644
6656
  valueElem.innerHTML = '';
6645
- // valueElem.innerHTML = ''.appendChild(value);
6646
6657
  }
6647
6658
 
6659
+ const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
6660
+ const slottedElements = slot.assignedElements();
6661
+
6662
+ slottedElements.forEach((element) => {
6663
+ element.remove();
6664
+ });
6665
+
6648
6666
  // Handle selected options
6649
6667
  if (this.optionSelected) {
6650
6668
  if (this.multiSelect && this.optionSelected.length > 0) {
@@ -6654,10 +6672,8 @@ class AuroSelect extends AuroElement$3 {
6654
6672
  } else {
6655
6673
  valueElem.innerHTML = this.optionSelected.innerHTML;
6656
6674
  const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
6657
- if (displayValueEl) {
6658
- const oldDisplayValueEl = this.querySelectorAll("[slot='displayValue']");
6659
- oldDisplayValueEl.forEach((el) => el.remove());
6660
6675
 
6676
+ if (displayValueEl) {
6661
6677
  this.appendChild(displayValueEl.cloneNode(true));
6662
6678
  }
6663
6679
  this.hasDisplayValueContent = displayValueEl !== null;
@@ -7166,14 +7182,14 @@ class AuroSelect extends AuroElement$3 {
7166
7182
  const displayValueClasses = {
7167
7183
  'displayValue': true,
7168
7184
  'hasContent': this.hasDisplayValueContent,
7169
- 'hasFocus': this.hasFocus,
7185
+ 'hasFocus': this.isPopoverVisible,
7170
7186
  'withValue': this.value && this.value.length > 0,
7171
7187
  'force': this.forceDisplayValue,
7172
7188
  };
7173
7189
 
7174
7190
  const valueContainerClasses = {
7175
7191
  'valueContainer': true,
7176
- 'util_displayHiddenVisually': true
7192
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
7177
7193
  };
7178
7194
 
7179
7195
  return html`
@@ -7246,14 +7262,14 @@ class AuroSelect extends AuroElement$3 {
7246
7262
  const displayValueClasses = {
7247
7263
  'displayValue': true,
7248
7264
  'hasContent': this.hasDisplayValueContent,
7249
- 'hasFocus': this.hasFocus,
7265
+ 'hasFocus': this.isPopoverVisible,
7250
7266
  'withValue': this.value && this.value.length > 0,
7251
7267
  'force': this.forceDisplayValue,
7252
7268
  };
7253
7269
 
7254
7270
  const valueContainerClasses = {
7255
7271
  'valueContainer': true,
7256
- 'util_displayHiddenVisually': (this.forceDisplayValue || !this.hasFocus) && this.hasDisplayValueContent
7272
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
7257
7273
  };
7258
7274
 
7259
7275
  return html`
@@ -6319,6 +6319,7 @@ class AuroSelect extends AuroElement$3 {
6319
6319
  this.value = undefined;
6320
6320
  this.fullscreenBreakpoint = 'sm';
6321
6321
  this.onDark = false;
6322
+ this.isPopoverVisible = false;
6322
6323
  }
6323
6324
 
6324
6325
  // This function is to define props used within the scope of this component
@@ -6360,6 +6361,14 @@ class AuroSelect extends AuroElement$3 {
6360
6361
  reflect: true
6361
6362
  },
6362
6363
 
6364
+ /**
6365
+ * @private
6366
+ */
6367
+ isPopoverVisible: {
6368
+ type: Boolean,
6369
+ reflect: false
6370
+ },
6371
+
6363
6372
  /**
6364
6373
  * If declared, the popover and trigger will be set to the same width.
6365
6374
  */
@@ -6606,6 +6615,10 @@ class AuroSelect extends AuroElement$3 {
6606
6615
  configureDropdown() {
6607
6616
  this.dropdown = this.shadowRoot.querySelector(this.dropdownTag._$litStatic$);
6608
6617
 
6618
+ this.dropdown.addEventListener('auroDropdown-toggled', () => {
6619
+ this.isPopoverVisible = this.dropdown.isPopoverVisible;
6620
+ });
6621
+
6609
6622
  // setting up bibtemplate
6610
6623
  this.bibtemplate = this.dropdown.querySelector(this.bibtemplateTag._$litStatic$); // eslint-disable-line no-underscore-dangle
6611
6624
 
@@ -6638,13 +6651,18 @@ class AuroSelect extends AuroElement$3 {
6638
6651
  const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
6639
6652
 
6640
6653
  // Clear out old value
6641
- // const placeholder = triggerContentEl.querySelector('#placeholder');
6642
6654
  const valueElem = triggerContentEl.querySelector('#value');
6643
6655
  if (valueElem) {
6644
6656
  valueElem.innerHTML = '';
6645
- // valueElem.innerHTML = ''.appendChild(value);
6646
6657
  }
6647
6658
 
6659
+ const slot = this.shadowRoot.querySelector('slot[name="displayValue"]');
6660
+ const slottedElements = slot.assignedElements();
6661
+
6662
+ slottedElements.forEach((element) => {
6663
+ element.remove();
6664
+ });
6665
+
6648
6666
  // Handle selected options
6649
6667
  if (this.optionSelected) {
6650
6668
  if (this.multiSelect && this.optionSelected.length > 0) {
@@ -6654,10 +6672,8 @@ class AuroSelect extends AuroElement$3 {
6654
6672
  } else {
6655
6673
  valueElem.innerHTML = this.optionSelected.innerHTML;
6656
6674
  const displayValueEl = this.optionSelected.querySelector("[slot='displayValue']");
6657
- if (displayValueEl) {
6658
- const oldDisplayValueEl = this.querySelectorAll("[slot='displayValue']");
6659
- oldDisplayValueEl.forEach((el) => el.remove());
6660
6675
 
6676
+ if (displayValueEl) {
6661
6677
  this.appendChild(displayValueEl.cloneNode(true));
6662
6678
  }
6663
6679
  this.hasDisplayValueContent = displayValueEl !== null;
@@ -7166,14 +7182,14 @@ class AuroSelect extends AuroElement$3 {
7166
7182
  const displayValueClasses = {
7167
7183
  'displayValue': true,
7168
7184
  'hasContent': this.hasDisplayValueContent,
7169
- 'hasFocus': this.hasFocus,
7185
+ 'hasFocus': this.isPopoverVisible,
7170
7186
  'withValue': this.value && this.value.length > 0,
7171
7187
  'force': this.forceDisplayValue,
7172
7188
  };
7173
7189
 
7174
7190
  const valueContainerClasses = {
7175
7191
  'valueContainer': true,
7176
- 'util_displayHiddenVisually': true
7192
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
7177
7193
  };
7178
7194
 
7179
7195
  return html`
@@ -7246,14 +7262,14 @@ class AuroSelect extends AuroElement$3 {
7246
7262
  const displayValueClasses = {
7247
7263
  'displayValue': true,
7248
7264
  'hasContent': this.hasDisplayValueContent,
7249
- 'hasFocus': this.hasFocus,
7265
+ 'hasFocus': this.isPopoverVisible,
7250
7266
  'withValue': this.value && this.value.length > 0,
7251
7267
  'force': this.forceDisplayValue,
7252
7268
  };
7253
7269
 
7254
7270
  const valueContainerClasses = {
7255
7271
  'valueContainer': true,
7256
- 'util_displayHiddenVisually': (this.forceDisplayValue || !this.hasFocus) && this.hasDisplayValueContent
7272
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !(this.dropdown && this.dropdown.isPopoverVisible)) && this.hasDisplayValueContent
7257
7273
  };
7258
7274
 
7259
7275
  return html`
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr624.6",
3
+ "version": "0.0.0-pr624.7",
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": {