@aurodesignsystem-dev/auro-formkit 0.0.0-pr668.1 → 0.0.0-pr668.3

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.
@@ -21,6 +21,7 @@ The auro-select element is a wrapper for auro-dropdown and auro-menu to create a
21
21
  | [disabled](#disabled) | `disabled` | `boolean` | | When attribute is present, element shows disabled state. |
22
22
  | [error](#error) | `error` | `string` | | When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value. |
23
23
  | [flexMenuWidth](#flexMenuWidth) | `flexMenuWidth` | `boolean` | | If set, makes dropdown width match the size of the content, rather than the width of the trigger. |
24
+ | [forceDisplayValue](#forceDisplayValue) | `forceDisplayValue` | `boolean` | false | If declared, the label and value will be visually hidden and the displayValue will render 100% of the time. |
24
25
  | [fullscreenBreakpoint](#fullscreenBreakpoint) | `fullscreenBreakpoint` | `string` | "sm" | Defines the screen size breakpoint (`xs`, `sm`, `md`, `lg`, `xl`, `disabled`)<br />at which the dropdown switches to fullscreen mode on mobile. `disabled` indicates a dropdown should _never_ enter fullscreen.<br /><br />When expanded, the dropdown will automatically display in fullscreen mode<br />if the screen size is equal to or smaller than the selected breakpoint. |
25
26
  | [largeFullscreenHeadline](#largeFullscreenHeadline) | `largeFullscreenHeadline` | `boolean` | | If declared, make bib.fullscreen.headline in HeadingDisplay.<br />Otherwise, Heading 600. |
26
27
  | [layout](#layout) | | `string` | "classic" | |
@@ -6134,7 +6134,7 @@ i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);-
6134
6134
 
6135
6135
  i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
6136
6136
 
6137
- var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
6137
+ var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
6138
6138
 
6139
6139
  // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
6140
6140
  // See LICENSE in the project root for license information.
@@ -6179,6 +6179,8 @@ class AuroSelect extends AuroElement$3 {
6179
6179
  this.noFlip = false;
6180
6180
  this.autoPlacement = false;
6181
6181
 
6182
+ this.forceDisplayValue = false;
6183
+
6182
6184
  /**
6183
6185
  * @private
6184
6186
  */
@@ -6221,6 +6223,15 @@ class AuroSelect extends AuroElement$3 {
6221
6223
  */
6222
6224
  this.isHiddenWhileLoading = false;
6223
6225
 
6226
+ /**
6227
+ * @private
6228
+ */
6229
+ this.hasFocus = false;
6230
+
6231
+ /**
6232
+ * @private
6233
+ */
6234
+ this.hasDisplayValueContent = false;
6224
6235
  }
6225
6236
 
6226
6237
  /**
@@ -6250,6 +6261,14 @@ class AuroSelect extends AuroElement$3 {
6250
6261
  reflect: true
6251
6262
  },
6252
6263
 
6264
+ /**
6265
+ * If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
6266
+ */
6267
+ forceDisplayValue: {
6268
+ type: Boolean,
6269
+ reflect: true
6270
+ },
6271
+
6253
6272
  /**
6254
6273
  * If declared, bib's position will be automatically calculated where to appear.
6255
6274
  * @default false
@@ -6464,7 +6483,25 @@ class AuroSelect extends AuroElement$3 {
6464
6483
  type: Boolean,
6465
6484
  reflect: true,
6466
6485
  attribute: false
6467
- }
6486
+ },
6487
+
6488
+ /**
6489
+ * @private
6490
+ */
6491
+ hasFocus: {
6492
+ type: Boolean,
6493
+ reflect: false,
6494
+ attribute: false
6495
+ },
6496
+
6497
+ /**
6498
+ * @private
6499
+ */
6500
+ hasDisplayValueContent: {
6501
+ type: Boolean,
6502
+ reflect: false,
6503
+ attribute: false
6504
+ },
6468
6505
  };
6469
6506
  }
6470
6507
 
@@ -6539,7 +6576,6 @@ class AuroSelect extends AuroElement$3 {
6539
6576
  // Handle selected options
6540
6577
  if (this.optionSelected) {
6541
6578
  if (this.multiSelect && this.optionSelected.length > 0) {
6542
- // Create display text from selected options
6543
6579
  const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
6544
6580
 
6545
6581
  valueElem.textContent = displayText;
@@ -6552,8 +6588,8 @@ class AuroSelect extends AuroElement$3 {
6552
6588
 
6553
6589
  this.appendChild(displayValueEl.cloneNode(true));
6554
6590
  }
6591
+ this.hasDisplayValueContent = displayValueEl !== null;
6555
6592
  }
6556
-
6557
6593
  }
6558
6594
 
6559
6595
  this.dropdown.requestUpdate();
@@ -6687,6 +6723,7 @@ class AuroSelect extends AuroElement$3 {
6687
6723
 
6688
6724
  this.addEventListener('blur', () => {
6689
6725
  this.validation.validate(this);
6726
+ this.hasFocus = false;
6690
6727
  });
6691
6728
  }
6692
6729
 
@@ -6762,6 +6799,7 @@ class AuroSelect extends AuroElement$3 {
6762
6799
  */
6763
6800
  handleFocusin() {
6764
6801
 
6802
+ this.hasFocus = true;
6765
6803
  this.touched = true;
6766
6804
  }
6767
6805
 
@@ -6847,6 +6885,8 @@ class AuroSelect extends AuroElement$3 {
6847
6885
  this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
6848
6886
  this.menu.value = this.value;
6849
6887
  }
6888
+
6889
+ this.hasDisplayValueContent = this.querySelectorAll("[slot='displayValue']").length > 0;
6850
6890
  }
6851
6891
 
6852
6892
  async updated(changedProperties) {
@@ -7051,14 +7091,19 @@ class AuroSelect extends AuroElement$3 {
7051
7091
  hidden: this.value,
7052
7092
  };
7053
7093
 
7094
+ const displayValueClasses = {
7095
+ 'displayValue': true,
7096
+ 'hasContent': this.hasDisplayValueContent,
7097
+ 'hasFocus': this.hasFocus,
7098
+ 'withValue': this.value && this.value.length > 0,
7099
+ 'force': this.forceDisplayValue,
7100
+ };
7101
+
7054
7102
  const valueContainerClasses = {
7055
7103
  'valueContainer': true,
7104
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !this.hasFocus) && this.hasDisplayValueContent
7056
7105
  };
7057
7106
 
7058
- // 'displayValue': true,
7059
- // 'hasFocus': this.hasFocus,
7060
- // 'withValue': this.value && this.value.length > 0,
7061
-
7062
7107
  return u`
7063
7108
  <div
7064
7109
  class="${e(this.commonWrapperClasses)}"
@@ -7068,7 +7113,7 @@ class AuroSelect extends AuroElement$3 {
7068
7113
  </div>
7069
7114
  <${this.dropdownTag}
7070
7115
  ?autoPlacement="${this.autoPlacement}"
7071
- ?error="${this.validity !== undefined && this.validity !== 'valid'}"
7116
+ ?error="${this.validity !== undefined && this.validity !== "valid"}"
7072
7117
  ?matchWidth="${!this.flexMenuWidth}"
7073
7118
  ?noFlip="${this.noFlip}"
7074
7119
  ?onDark="${this.onDark}"
@@ -7091,14 +7136,22 @@ class AuroSelect extends AuroElement$3 {
7091
7136
  <label>
7092
7137
  <slot name="label"></slot>
7093
7138
  </label>
7094
- <div class="displayValue">
7095
- <slot name="displayValue">
7096
- <div class="value" id="value"></div>
7097
- </slot>
7098
- </div>
7099
- ${this.value ? undefined : u`
7100
- <div id="placeholder" class="${e(placeholderClass)}">PLACEHOLDER FIX ME<slot name="placeholder"></slot></div>
7101
- `}
7139
+ <div class="value" id="value"></div>
7140
+ ${
7141
+ this.value
7142
+ ? undefined
7143
+ : u`
7144
+ <div
7145
+ id="placeholder"
7146
+ class="${e(placeholderClass)}"
7147
+ >
7148
+ <slot name="placeholder"></slot>
7149
+ </div>
7150
+ `
7151
+ }
7152
+ </div>
7153
+ <div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
7154
+ <slot name="displayValue"></slot>
7102
7155
  </div>
7103
7156
  </div>
7104
7157
  <div class="accents right"></div>
@@ -22,10 +22,38 @@ A baseline `<auro-select>` using `<auro-menu>` and `<auro-menuoption>` elements.
22
22
  <div class="exampleWrapper">
23
23
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/emphasized/basic.html) -->
24
24
  <!-- The below content is automatically added from ./../apiExamples/emphasized/basic.html -->
25
+ <auro-select layout="emphasized" shape="pill" size="xl" forceDisplayValue required style="display:inline-block;">
26
+ <span slot="bib.fullscreen.headline">Bib Headline</span>
27
+ <span slot="label">Select Example</span>
28
+ <span slot="helptext">forceDisplayValue</span>
29
+ <span slot="placeholder">Placeholder</span>
30
+ <auro-menu nocheckmark>
31
+ <auro-menuoption value="flights">
32
+ <auro-icon category="terminal" name="plane-diag-stroke" customcolor></auro-icon> Flights
33
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="terminal" name="plane-diag-fill" customcolor></auro-icon>
34
+ </auro-menuoption>
35
+ <auro-menuoption value="cars">
36
+ <auro-icon category="destination" name="car-rental-stroke" customcolor></auro-icon> Cars
37
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="destination" name="car-rental-stroke" customcolor></auro-icon>
38
+ </auro-menuoption>
39
+ <auro-menuoption value="hotels">
40
+ <auro-icon category="destination" name="hotel-stroke" customcolor></auro-icon> Hotels
41
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="destination" name="hotel-filled" customcolor></auro-icon>
42
+ </auro-menuoption>
43
+ <auro-menuoption value="packages">
44
+ <auro-icon category="shop" name="gift-stroke" customcolor></auro-icon> Packages
45
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="shop" name="gift-filled" customcolor></auro-icon>
46
+ </auro-menuoption>
47
+ <auro-menuoption value="cruises">
48
+ <auro-icon category="in-flight" name="boarding" customcolor></auro-icon> Cruises
49
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="in-flight" name="boarding" customcolor></auro-icon>
50
+ </auro-menuoption>
51
+ </auro-menu>
52
+ </auro-select>
25
53
  <auro-select layout="emphasized" shape="pill" size="xl" value="flights" required style="display:inline-block;">
26
54
  <span slot="bib.fullscreen.headline">Bib Headline</span>
27
55
  <span slot="label">Select Example</span>
28
- <span slot="helptext">Example help text</span>
56
+ <span slot="helptext">displayValue</span>
29
57
  <auro-menu nocheckmark>
30
58
  <auro-menuoption value="flights">
31
59
  <auro-icon category="terminal" name="plane-diag-stroke" customcolor></auro-icon> Flights
@@ -49,10 +77,10 @@ A baseline `<auro-select>` using `<auro-menu>` and `<auro-menuoption>` elements.
49
77
  </auro-menuoption>
50
78
  </auro-menu>
51
79
  </auro-select>
52
- <auro-select layout="emphasized" shape="pill" size="xl" value="flights" required style="display:inline-block;">
80
+ <auro-select layout="emphasized" shape="pill" size="xl" value="flights" required style="display:inline-block;">
53
81
  <span slot="bib.fullscreen.headline">Bib Headline</span>
54
82
  <span slot="label">Select Example</span>
55
- <span slot="helptext">Example help text</span>
83
+ <span slot="helptext">no displayValue in menuoption</span>
56
84
  <auro-menu nocheckmark>
57
85
  <auro-menuoption value="flights">
58
86
  <auro-icon category="terminal" name="plane-diag-stroke" customcolor></auro-icon> Flights
@@ -76,10 +104,38 @@ A baseline `<auro-select>` using `<auro-menu>` and `<auro-menuoption>` elements.
76
104
  <div class="exampleWrapper--ondark" aria-hidden>
77
105
  <!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/emphasized/basic-ondark.html) -->
78
106
  <!-- The below content is automatically added from ./../apiExamples/emphasized/basic-ondark.html -->
107
+ <auro-select layout="emphasized" shape="pill" size="xl" value="flights" forceDisplayValue ondark required style="display:inline-block;">
108
+ <span slot="bib.fullscreen.headline">Bib Headline</span>
109
+ <span slot="label">Select Example</span>
110
+ <span slot="helptext">forceDisplayValue</span>
111
+ <span slot="placeholder">Placeholder</span>
112
+ <auro-menu nocheckmark>
113
+ <auro-menuoption value="flights">
114
+ <auro-icon category="terminal" name="plane-diag-stroke" customcolor></auro-icon> Flights
115
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="terminal" name="plane-diag-fill" customcolor></auro-icon>
116
+ </auro-menuoption>
117
+ <auro-menuoption value="cars">
118
+ <auro-icon category="destination" name="car-rental-stroke" customcolor></auro-icon> Cars
119
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="destination" name="car-rental-stroke" customcolor></auro-icon>
120
+ </auro-menuoption>
121
+ <auro-menuoption value="hotels">
122
+ <auro-icon category="destination" name="hotel-stroke" customcolor></auro-icon> Hotels
123
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="destination" name="hotel-filled" customcolor></auro-icon>
124
+ </auro-menuoption>
125
+ <auro-menuoption value="packages">
126
+ <auro-icon category="shop" name="gift-stroke" customcolor></auro-icon> Packages
127
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="shop" name="gift-filled" customcolor></auro-icon>
128
+ </auro-menuoption>
129
+ <auro-menuoption value="cruises">
130
+ <auro-icon category="in-flight" name="boarding" customcolor></auro-icon> Cruises
131
+ <auro-icon style="--ds-auro-icon-size: 40px;" slot="displayValue" category="in-flight" name="boarding" customcolor></auro-icon>
132
+ </auro-menuoption>
133
+ </auro-menu>
134
+ </auro-select>
79
135
  <auro-select layout="emphasized" shape="pill" size="xl" value="flights" ondark required style="display:inline-block;">
80
136
  <span slot="bib.fullscreen.headline">Bib Headline</span>
81
137
  <span slot="label">Select Example</span>
82
- <span slot="helptext">Example help text</span>
138
+ <span slot="helptext">displayValue</span>
83
139
  <auro-menu nocheckmark>
84
140
  <auro-menuoption value="flights">
85
141
  <auro-icon category="terminal" name="plane-diag-stroke" customcolor></auro-icon> Flights
@@ -103,10 +159,10 @@ A baseline `<auro-select>` using `<auro-menu>` and `<auro-menuoption>` elements.
103
159
  </auro-menuoption>
104
160
  </auro-menu>
105
161
  </auro-select>
106
- <auro-select layout="emphasized" shape="pill" size="xl" value="flights" ondark required forceDisplayValue style="display:inline-block;">
162
+ <auro-select layout="emphasized" shape="pill" size="xl" value="flights" ondark required style="display:inline-block;">
107
163
  <span slot="bib.fullscreen.headline">Bib Headline</span>
108
164
  <span slot="label">Select Example</span>
109
- <span slot="helptext">Example help text</span>
165
+ <span slot="helptext">no displayValue in menuoption</span>
110
166
  <auro-menu nocheckmark>
111
167
  <auro-menuoption value="flights">
112
168
  <auro-icon category="terminal" name="plane-diag-stroke" customcolor></auro-icon> Flights
@@ -6042,7 +6042,7 @@ i$5`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);-
6042
6042
 
6043
6043
  i$5`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
6044
6044
 
6045
- var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
6045
+ var styleCss$3 = i$5`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
6046
6046
 
6047
6047
  // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
6048
6048
  // See LICENSE in the project root for license information.
@@ -6087,6 +6087,8 @@ class AuroSelect extends AuroElement$3 {
6087
6087
  this.noFlip = false;
6088
6088
  this.autoPlacement = false;
6089
6089
 
6090
+ this.forceDisplayValue = false;
6091
+
6090
6092
  /**
6091
6093
  * @private
6092
6094
  */
@@ -6129,6 +6131,15 @@ class AuroSelect extends AuroElement$3 {
6129
6131
  */
6130
6132
  this.isHiddenWhileLoading = false;
6131
6133
 
6134
+ /**
6135
+ * @private
6136
+ */
6137
+ this.hasFocus = false;
6138
+
6139
+ /**
6140
+ * @private
6141
+ */
6142
+ this.hasDisplayValueContent = false;
6132
6143
  }
6133
6144
 
6134
6145
  /**
@@ -6158,6 +6169,14 @@ class AuroSelect extends AuroElement$3 {
6158
6169
  reflect: true
6159
6170
  },
6160
6171
 
6172
+ /**
6173
+ * If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
6174
+ */
6175
+ forceDisplayValue: {
6176
+ type: Boolean,
6177
+ reflect: true
6178
+ },
6179
+
6161
6180
  /**
6162
6181
  * If declared, bib's position will be automatically calculated where to appear.
6163
6182
  * @default false
@@ -6372,7 +6391,25 @@ class AuroSelect extends AuroElement$3 {
6372
6391
  type: Boolean,
6373
6392
  reflect: true,
6374
6393
  attribute: false
6375
- }
6394
+ },
6395
+
6396
+ /**
6397
+ * @private
6398
+ */
6399
+ hasFocus: {
6400
+ type: Boolean,
6401
+ reflect: false,
6402
+ attribute: false
6403
+ },
6404
+
6405
+ /**
6406
+ * @private
6407
+ */
6408
+ hasDisplayValueContent: {
6409
+ type: Boolean,
6410
+ reflect: false,
6411
+ attribute: false
6412
+ },
6376
6413
  };
6377
6414
  }
6378
6415
 
@@ -6447,7 +6484,6 @@ class AuroSelect extends AuroElement$3 {
6447
6484
  // Handle selected options
6448
6485
  if (this.optionSelected) {
6449
6486
  if (this.multiSelect && this.optionSelected.length > 0) {
6450
- // Create display text from selected options
6451
6487
  const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
6452
6488
 
6453
6489
  valueElem.textContent = displayText;
@@ -6460,8 +6496,8 @@ class AuroSelect extends AuroElement$3 {
6460
6496
 
6461
6497
  this.appendChild(displayValueEl.cloneNode(true));
6462
6498
  }
6499
+ this.hasDisplayValueContent = displayValueEl !== null;
6463
6500
  }
6464
-
6465
6501
  }
6466
6502
 
6467
6503
  this.dropdown.requestUpdate();
@@ -6595,6 +6631,7 @@ class AuroSelect extends AuroElement$3 {
6595
6631
 
6596
6632
  this.addEventListener('blur', () => {
6597
6633
  this.validation.validate(this);
6634
+ this.hasFocus = false;
6598
6635
  });
6599
6636
  }
6600
6637
 
@@ -6670,6 +6707,7 @@ class AuroSelect extends AuroElement$3 {
6670
6707
  */
6671
6708
  handleFocusin() {
6672
6709
 
6710
+ this.hasFocus = true;
6673
6711
  this.touched = true;
6674
6712
  }
6675
6713
 
@@ -6755,6 +6793,8 @@ class AuroSelect extends AuroElement$3 {
6755
6793
  this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
6756
6794
  this.menu.value = this.value;
6757
6795
  }
6796
+
6797
+ this.hasDisplayValueContent = this.querySelectorAll("[slot='displayValue']").length > 0;
6758
6798
  }
6759
6799
 
6760
6800
  async updated(changedProperties) {
@@ -6959,14 +6999,19 @@ class AuroSelect extends AuroElement$3 {
6959
6999
  hidden: this.value,
6960
7000
  };
6961
7001
 
7002
+ const displayValueClasses = {
7003
+ 'displayValue': true,
7004
+ 'hasContent': this.hasDisplayValueContent,
7005
+ 'hasFocus': this.hasFocus,
7006
+ 'withValue': this.value && this.value.length > 0,
7007
+ 'force': this.forceDisplayValue,
7008
+ };
7009
+
6962
7010
  const valueContainerClasses = {
6963
7011
  'valueContainer': true,
7012
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !this.hasFocus) && this.hasDisplayValueContent
6964
7013
  };
6965
7014
 
6966
- // 'displayValue': true,
6967
- // 'hasFocus': this.hasFocus,
6968
- // 'withValue': this.value && this.value.length > 0,
6969
-
6970
7015
  return u`
6971
7016
  <div
6972
7017
  class="${e(this.commonWrapperClasses)}"
@@ -6976,7 +7021,7 @@ class AuroSelect extends AuroElement$3 {
6976
7021
  </div>
6977
7022
  <${this.dropdownTag}
6978
7023
  ?autoPlacement="${this.autoPlacement}"
6979
- ?error="${this.validity !== undefined && this.validity !== 'valid'}"
7024
+ ?error="${this.validity !== undefined && this.validity !== "valid"}"
6980
7025
  ?matchWidth="${!this.flexMenuWidth}"
6981
7026
  ?noFlip="${this.noFlip}"
6982
7027
  ?onDark="${this.onDark}"
@@ -6999,14 +7044,22 @@ class AuroSelect extends AuroElement$3 {
6999
7044
  <label>
7000
7045
  <slot name="label"></slot>
7001
7046
  </label>
7002
- <div class="displayValue">
7003
- <slot name="displayValue">
7004
- <div class="value" id="value"></div>
7005
- </slot>
7006
- </div>
7007
- ${this.value ? undefined : u`
7008
- <div id="placeholder" class="${e(placeholderClass)}">PLACEHOLDER FIX ME<slot name="placeholder"></slot></div>
7009
- `}
7047
+ <div class="value" id="value"></div>
7048
+ ${
7049
+ this.value
7050
+ ? undefined
7051
+ : u`
7052
+ <div
7053
+ id="placeholder"
7054
+ class="${e(placeholderClass)}"
7055
+ >
7056
+ <slot name="placeholder"></slot>
7057
+ </div>
7058
+ `
7059
+ }
7060
+ </div>
7061
+ <div class="${e(displayValueClasses)}" aria-hidden="true" part="displayValue">
7062
+ <slot name="displayValue"></slot>
7010
7063
  </div>
7011
7064
  </div>
7012
7065
  <div class="accents right"></div>
@@ -20,6 +20,13 @@ export class AuroSelect extends AuroElement {
20
20
  type: StringConstructor;
21
21
  reflect: boolean;
22
22
  };
23
+ /**
24
+ * If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
25
+ */
26
+ forceDisplayValue: {
27
+ type: BooleanConstructor;
28
+ reflect: boolean;
29
+ };
23
30
  /**
24
31
  * If declared, bib's position will be automatically calculated where to appear.
25
32
  * @default false
@@ -203,6 +210,22 @@ export class AuroSelect extends AuroElement {
203
210
  * @private
204
211
  */
205
212
  touched: boolean;
213
+ /**
214
+ * @private
215
+ */
216
+ hasFocus: {
217
+ type: BooleanConstructor;
218
+ reflect: boolean;
219
+ attribute: boolean;
220
+ };
221
+ /**
222
+ * @private
223
+ */
224
+ hasDisplayValueContent: {
225
+ type: BooleanConstructor;
226
+ reflect: boolean;
227
+ attribute: boolean;
228
+ };
206
229
  };
207
230
  static get styles(): import("lit").CSSResult[];
208
231
  /**
@@ -221,6 +244,7 @@ export class AuroSelect extends AuroElement {
221
244
  offset: number;
222
245
  noFlip: boolean;
223
246
  autoPlacement: boolean;
247
+ forceDisplayValue: boolean;
224
248
  /**
225
249
  * @private
226
250
  */
@@ -249,6 +273,14 @@ export class AuroSelect extends AuroElement {
249
273
  * @private
250
274
  */
251
275
  private isHiddenWhileLoading;
276
+ /**
277
+ * @private
278
+ */
279
+ private hasFocus;
280
+ /**
281
+ * @private
282
+ */
283
+ private hasDisplayValueContent;
252
284
  /**
253
285
  * @private
254
286
  * @returns {void} Internal defaults.
@@ -5996,7 +5996,7 @@ css`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);-
5996
5996
 
5997
5997
  css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
5998
5998
 
5999
- var styleCss = css`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
5999
+ var styleCss = css`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
6000
6000
 
6001
6001
  // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
6002
6002
  // See LICENSE in the project root for license information.
@@ -6041,6 +6041,8 @@ class AuroSelect extends AuroElement$3 {
6041
6041
  this.noFlip = false;
6042
6042
  this.autoPlacement = false;
6043
6043
 
6044
+ this.forceDisplayValue = false;
6045
+
6044
6046
  /**
6045
6047
  * @private
6046
6048
  */
@@ -6083,6 +6085,15 @@ class AuroSelect extends AuroElement$3 {
6083
6085
  */
6084
6086
  this.isHiddenWhileLoading = false;
6085
6087
 
6088
+ /**
6089
+ * @private
6090
+ */
6091
+ this.hasFocus = false;
6092
+
6093
+ /**
6094
+ * @private
6095
+ */
6096
+ this.hasDisplayValueContent = false;
6086
6097
  }
6087
6098
 
6088
6099
  /**
@@ -6112,6 +6123,14 @@ class AuroSelect extends AuroElement$3 {
6112
6123
  reflect: true
6113
6124
  },
6114
6125
 
6126
+ /**
6127
+ * If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
6128
+ */
6129
+ forceDisplayValue: {
6130
+ type: Boolean,
6131
+ reflect: true
6132
+ },
6133
+
6115
6134
  /**
6116
6135
  * If declared, bib's position will be automatically calculated where to appear.
6117
6136
  * @default false
@@ -6326,7 +6345,25 @@ class AuroSelect extends AuroElement$3 {
6326
6345
  type: Boolean,
6327
6346
  reflect: true,
6328
6347
  attribute: false
6329
- }
6348
+ },
6349
+
6350
+ /**
6351
+ * @private
6352
+ */
6353
+ hasFocus: {
6354
+ type: Boolean,
6355
+ reflect: false,
6356
+ attribute: false
6357
+ },
6358
+
6359
+ /**
6360
+ * @private
6361
+ */
6362
+ hasDisplayValueContent: {
6363
+ type: Boolean,
6364
+ reflect: false,
6365
+ attribute: false
6366
+ },
6330
6367
  };
6331
6368
  }
6332
6369
 
@@ -6401,7 +6438,6 @@ class AuroSelect extends AuroElement$3 {
6401
6438
  // Handle selected options
6402
6439
  if (this.optionSelected) {
6403
6440
  if (this.multiSelect && this.optionSelected.length > 0) {
6404
- // Create display text from selected options
6405
6441
  const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
6406
6442
 
6407
6443
  valueElem.textContent = displayText;
@@ -6414,8 +6450,8 @@ class AuroSelect extends AuroElement$3 {
6414
6450
 
6415
6451
  this.appendChild(displayValueEl.cloneNode(true));
6416
6452
  }
6453
+ this.hasDisplayValueContent = displayValueEl !== null;
6417
6454
  }
6418
-
6419
6455
  }
6420
6456
 
6421
6457
  this.dropdown.requestUpdate();
@@ -6549,6 +6585,7 @@ class AuroSelect extends AuroElement$3 {
6549
6585
 
6550
6586
  this.addEventListener('blur', () => {
6551
6587
  this.validation.validate(this);
6588
+ this.hasFocus = false;
6552
6589
  });
6553
6590
  }
6554
6591
 
@@ -6624,6 +6661,7 @@ class AuroSelect extends AuroElement$3 {
6624
6661
  */
6625
6662
  handleFocusin() {
6626
6663
 
6664
+ this.hasFocus = true;
6627
6665
  this.touched = true;
6628
6666
  }
6629
6667
 
@@ -6709,6 +6747,8 @@ class AuroSelect extends AuroElement$3 {
6709
6747
  this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
6710
6748
  this.menu.value = this.value;
6711
6749
  }
6750
+
6751
+ this.hasDisplayValueContent = this.querySelectorAll("[slot='displayValue']").length > 0;
6712
6752
  }
6713
6753
 
6714
6754
  async updated(changedProperties) {
@@ -6913,14 +6953,19 @@ class AuroSelect extends AuroElement$3 {
6913
6953
  hidden: this.value,
6914
6954
  };
6915
6955
 
6956
+ const displayValueClasses = {
6957
+ 'displayValue': true,
6958
+ 'hasContent': this.hasDisplayValueContent,
6959
+ 'hasFocus': this.hasFocus,
6960
+ 'withValue': this.value && this.value.length > 0,
6961
+ 'force': this.forceDisplayValue,
6962
+ };
6963
+
6916
6964
  const valueContainerClasses = {
6917
6965
  'valueContainer': true,
6966
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !this.hasFocus) && this.hasDisplayValueContent
6918
6967
  };
6919
6968
 
6920
- // 'displayValue': true,
6921
- // 'hasFocus': this.hasFocus,
6922
- // 'withValue': this.value && this.value.length > 0,
6923
-
6924
6969
  return html`
6925
6970
  <div
6926
6971
  class="${classMap(this.commonWrapperClasses)}"
@@ -6930,7 +6975,7 @@ class AuroSelect extends AuroElement$3 {
6930
6975
  </div>
6931
6976
  <${this.dropdownTag}
6932
6977
  ?autoPlacement="${this.autoPlacement}"
6933
- ?error="${this.validity !== undefined && this.validity !== 'valid'}"
6978
+ ?error="${this.validity !== undefined && this.validity !== "valid"}"
6934
6979
  ?matchWidth="${!this.flexMenuWidth}"
6935
6980
  ?noFlip="${this.noFlip}"
6936
6981
  ?onDark="${this.onDark}"
@@ -6953,14 +6998,22 @@ class AuroSelect extends AuroElement$3 {
6953
6998
  <label>
6954
6999
  <slot name="label"></slot>
6955
7000
  </label>
6956
- <div class="displayValue">
6957
- <slot name="displayValue">
6958
- <div class="value" id="value"></div>
6959
- </slot>
6960
- </div>
6961
- ${this.value ? undefined : html`
6962
- <div id="placeholder" class="${classMap(placeholderClass)}">PLACEHOLDER FIX ME<slot name="placeholder"></slot></div>
6963
- `}
7001
+ <div class="value" id="value"></div>
7002
+ ${
7003
+ this.value
7004
+ ? undefined
7005
+ : html`
7006
+ <div
7007
+ id="placeholder"
7008
+ class="${classMap(placeholderClass)}"
7009
+ >
7010
+ <slot name="placeholder"></slot>
7011
+ </div>
7012
+ `
7013
+ }
7014
+ </div>
7015
+ <div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
7016
+ <slot name="displayValue"></slot>
6964
7017
  </div>
6965
7018
  </div>
6966
7019
  <div class="accents right"></div>
@@ -5996,7 +5996,7 @@ css`:host{--ds-auro-icon-color:var(--ds-basic-color-texticon-default, #2a2a2a);-
5996
5996
 
5997
5997
  css`:host{color:var(--ds-auro-icon-color)}:host([customColor]){color:inherit}:host(:not([onDark])[variant=accent1]){--ds-auro-icon-color:var(--ds-basic-color-texticon-accent1, #265688)}:host(:not([onDark])[variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-disabled, #d0d0d0)}:host(:not([onDark])[variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-muted, #676767)}:host(:not([onDark])[variant=statusDefault]){--ds-auro-icon-color:var(--ds-basic-color-status-default, #afb9c6)}:host(:not([onDark])[variant=statusInfo]){--ds-auro-icon-color:var(--ds-basic-color-status-info, #01426a)}:host(:not([onDark])[variant=statusSuccess]){--ds-auro-icon-color:var(--ds-basic-color-status-success, #447a1f)}:host(:not([onDark])[variant=statusWarning]){--ds-auro-icon-color:var(--ds-basic-color-status-warning, #fac200)}:host(:not([onDark])[variant=statusError]){--ds-auro-icon-color:var(--ds-basic-color-status-error, #e31f26)}:host(:not([onDark])[variant=statusInfoSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-info-subtle, #ebf3f9)}:host(:not([onDark])[variant=statusSuccessSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-success-subtle, #d6eac7)}:host(:not([onDark])[variant=statusWarningSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-warning-subtle, #fff0b2)}:host(:not([onDark])[variant=statusErrorSubtle]){--ds-auro-icon-color:var(--ds-basic-color-status-error-subtle, #fbc6c6)}:host(:not([onDark])[variant=fareBasicEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-basiceconomy, #97eaf8)}:host(:not([onDark])[variant=fareBusiness]){--ds-auro-icon-color:var(--ds-basic-color-fare-business, #01426a)}:host(:not([onDark])[variant=fareEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-economy, #0074ca)}:host(:not([onDark])[variant=fareFirst]){--ds-auro-icon-color:var(--ds-basic-color-fare-first, #00274a)}:host(:not([onDark])[variant=farePremiumEconomy]){--ds-auro-icon-color:var(--ds-basic-color-fare-premiumeconomy, #005154)}:host(:not([onDark])[variant=tierOneWorldEmerald]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-emerald, #139142)}:host(:not([onDark])[variant=tierOneWorldSapphire]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-sapphire, #015daa)}:host(:not([onDark])[variant=tierOneWorldRuby]){--ds-auro-icon-color:var(--ds-basic-color-tier-program-oneworld-ruby, #a41d4a)}:host([onDark]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse, #ffffff)}:host([onDark][variant=disabled]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-disabled, #7e8894)}:host([onDark][variant=muted]){--ds-auro-icon-color:var(--ds-basic-color-texticon-inverse-muted, #ccd2db)}:host([onDark][variant=statusError]){--ds-auro-icon-color:var(--ds-advanced-color-state-error-inverse, #f9a4a8)}`;
5998
5998
 
5999
- var styleCss = css`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
5999
+ var styleCss = css`.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[auro-dropdown]{--ds-auro-dropdown-trigger-border-color: var(--ds-auro-select-border-color);--ds-auro-dropdown-trigger-background-color: var(--ds-auro-select-background-color);--ds-auro-dropdown-trigger-container-color: var(--ds-auro-select-background-color)}.mainContent{position:relative;display:flex;flex-direction:column;justify-content:center;align-items:center;flex:1}.valueContainer [slot=displayValue]{display:none}.accents{display:flex;flex-direction:row;justify-content:center;align-items:center}::slotted([slot=typeIcon]){margin-right:8px}.displayValue{display:block}.displayValue:not(.force){display:none}.displayValue:not(.force).hasContent:is(.withValue):not(.hasFocus){display:block}.triggerContent{display:flex;align-items:center;justify-content:center;width:100%;padding:0 8px 0 24px}:host(:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-basic-color-status-error, #e31f26);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-default, #2a2a2a)}:host([ondark]:is([validity]:not([validity=valid]))) [auro-dropdown]{--ds-auro-select-border-color: var(--ds-advanced-color-state-error-inverse, #f9a4a8);--ds-auro-dropdown-helptext-text-color: var(--ds-basic-color-texticon-inverse, #ffffff)}#slotHolder{display:none}:host([disabled]) *{user-select:none}`;
6000
6000
 
6001
6001
  // Copyright (c) 2021 Alaska Airlines. All right reserved. Licensed under the Apache-2.0 license
6002
6002
  // See LICENSE in the project root for license information.
@@ -6041,6 +6041,8 @@ class AuroSelect extends AuroElement$3 {
6041
6041
  this.noFlip = false;
6042
6042
  this.autoPlacement = false;
6043
6043
 
6044
+ this.forceDisplayValue = false;
6045
+
6044
6046
  /**
6045
6047
  * @private
6046
6048
  */
@@ -6083,6 +6085,15 @@ class AuroSelect extends AuroElement$3 {
6083
6085
  */
6084
6086
  this.isHiddenWhileLoading = false;
6085
6087
 
6088
+ /**
6089
+ * @private
6090
+ */
6091
+ this.hasFocus = false;
6092
+
6093
+ /**
6094
+ * @private
6095
+ */
6096
+ this.hasDisplayValueContent = false;
6086
6097
  }
6087
6098
 
6088
6099
  /**
@@ -6112,6 +6123,14 @@ class AuroSelect extends AuroElement$3 {
6112
6123
  reflect: true
6113
6124
  },
6114
6125
 
6126
+ /**
6127
+ * If declared, the label and value will be visually hidden and the displayValue will render 100% of the time.
6128
+ */
6129
+ forceDisplayValue: {
6130
+ type: Boolean,
6131
+ reflect: true
6132
+ },
6133
+
6115
6134
  /**
6116
6135
  * If declared, bib's position will be automatically calculated where to appear.
6117
6136
  * @default false
@@ -6326,7 +6345,25 @@ class AuroSelect extends AuroElement$3 {
6326
6345
  type: Boolean,
6327
6346
  reflect: true,
6328
6347
  attribute: false
6329
- }
6348
+ },
6349
+
6350
+ /**
6351
+ * @private
6352
+ */
6353
+ hasFocus: {
6354
+ type: Boolean,
6355
+ reflect: false,
6356
+ attribute: false
6357
+ },
6358
+
6359
+ /**
6360
+ * @private
6361
+ */
6362
+ hasDisplayValueContent: {
6363
+ type: Boolean,
6364
+ reflect: false,
6365
+ attribute: false
6366
+ },
6330
6367
  };
6331
6368
  }
6332
6369
 
@@ -6401,7 +6438,6 @@ class AuroSelect extends AuroElement$3 {
6401
6438
  // Handle selected options
6402
6439
  if (this.optionSelected) {
6403
6440
  if (this.multiSelect && this.optionSelected.length > 0) {
6404
- // Create display text from selected options
6405
6441
  const displayText = this.optionSelected.map((option) => option.textContent).join(', ');
6406
6442
 
6407
6443
  valueElem.textContent = displayText;
@@ -6414,8 +6450,8 @@ class AuroSelect extends AuroElement$3 {
6414
6450
 
6415
6451
  this.appendChild(displayValueEl.cloneNode(true));
6416
6452
  }
6453
+ this.hasDisplayValueContent = displayValueEl !== null;
6417
6454
  }
6418
-
6419
6455
  }
6420
6456
 
6421
6457
  this.dropdown.requestUpdate();
@@ -6549,6 +6585,7 @@ class AuroSelect extends AuroElement$3 {
6549
6585
 
6550
6586
  this.addEventListener('blur', () => {
6551
6587
  this.validation.validate(this);
6588
+ this.hasFocus = false;
6552
6589
  });
6553
6590
  }
6554
6591
 
@@ -6624,6 +6661,7 @@ class AuroSelect extends AuroElement$3 {
6624
6661
  */
6625
6662
  handleFocusin() {
6626
6663
 
6664
+ this.hasFocus = true;
6627
6665
  this.touched = true;
6628
6666
  }
6629
6667
 
@@ -6709,6 +6747,8 @@ class AuroSelect extends AuroElement$3 {
6709
6747
  this.value = this.multiSelect ? arrayConverter(this.getAttribute('value')) : this.getAttribute('value');
6710
6748
  this.menu.value = this.value;
6711
6749
  }
6750
+
6751
+ this.hasDisplayValueContent = this.querySelectorAll("[slot='displayValue']").length > 0;
6712
6752
  }
6713
6753
 
6714
6754
  async updated(changedProperties) {
@@ -6913,14 +6953,19 @@ class AuroSelect extends AuroElement$3 {
6913
6953
  hidden: this.value,
6914
6954
  };
6915
6955
 
6956
+ const displayValueClasses = {
6957
+ 'displayValue': true,
6958
+ 'hasContent': this.hasDisplayValueContent,
6959
+ 'hasFocus': this.hasFocus,
6960
+ 'withValue': this.value && this.value.length > 0,
6961
+ 'force': this.forceDisplayValue,
6962
+ };
6963
+
6916
6964
  const valueContainerClasses = {
6917
6965
  'valueContainer': true,
6966
+ 'util_displayHiddenVisually': (this.forceDisplayValue || !this.hasFocus) && this.hasDisplayValueContent
6918
6967
  };
6919
6968
 
6920
- // 'displayValue': true,
6921
- // 'hasFocus': this.hasFocus,
6922
- // 'withValue': this.value && this.value.length > 0,
6923
-
6924
6969
  return html`
6925
6970
  <div
6926
6971
  class="${classMap(this.commonWrapperClasses)}"
@@ -6930,7 +6975,7 @@ class AuroSelect extends AuroElement$3 {
6930
6975
  </div>
6931
6976
  <${this.dropdownTag}
6932
6977
  ?autoPlacement="${this.autoPlacement}"
6933
- ?error="${this.validity !== undefined && this.validity !== 'valid'}"
6978
+ ?error="${this.validity !== undefined && this.validity !== "valid"}"
6934
6979
  ?matchWidth="${!this.flexMenuWidth}"
6935
6980
  ?noFlip="${this.noFlip}"
6936
6981
  ?onDark="${this.onDark}"
@@ -6953,14 +6998,22 @@ class AuroSelect extends AuroElement$3 {
6953
6998
  <label>
6954
6999
  <slot name="label"></slot>
6955
7000
  </label>
6956
- <div class="displayValue">
6957
- <slot name="displayValue">
6958
- <div class="value" id="value"></div>
6959
- </slot>
6960
- </div>
6961
- ${this.value ? undefined : html`
6962
- <div id="placeholder" class="${classMap(placeholderClass)}">PLACEHOLDER FIX ME<slot name="placeholder"></slot></div>
6963
- `}
7001
+ <div class="value" id="value"></div>
7002
+ ${
7003
+ this.value
7004
+ ? undefined
7005
+ : html`
7006
+ <div
7007
+ id="placeholder"
7008
+ class="${classMap(placeholderClass)}"
7009
+ >
7010
+ <slot name="placeholder"></slot>
7011
+ </div>
7012
+ `
7013
+ }
7014
+ </div>
7015
+ <div class="${classMap(displayValueClasses)}" aria-hidden="true" part="displayValue">
7016
+ <slot name="displayValue"></slot>
6964
7017
  </div>
6965
7018
  </div>
6966
7019
  <div class="accents right"></div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aurodesignsystem-dev/auro-formkit",
3
- "version": "0.0.0-pr668.1",
3
+ "version": "0.0.0-pr668.3",
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": {