@fluid-topics/ft-select 0.1.13 → 0.1.16

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.
@@ -201,13 +201,14 @@ let FtSelect = class FtSelect extends FtLitElement {
201
201
  var _a, _b, _c, _d, _e;
202
202
  let optionsDisplayed = !this.disabled && this.optionsDisplayed && this.hasOptions;
203
203
  let disabled = this.disabled || !this.hasOptions;
204
+ const hasOptionSelected = ((_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.value) != null || ((_c = (_b = this.selectedOption) === null || _b === void 0 ? void 0 : _b.label) !== null && _c !== void 0 ? _c : "").length > 0;
204
205
  const classes = {
205
206
  "ft-select": true,
206
207
  "ft-select--filled": !this.outlined,
207
208
  "ft-select--outlined": this.outlined,
208
209
  "ft-select--disabled": disabled,
209
210
  "ft-select--options-displayed": optionsDisplayed,
210
- "ft-select--has-value": ((_a = this.selectedOption) === null || _a === void 0 ? void 0 : _a.value) != null,
211
+ "ft-select--has-option-selected": hasOptionSelected,
211
212
  "ft-select--no-label": !this.label
212
213
  };
213
214
  return html `
@@ -217,7 +218,7 @@ let FtSelect = class FtSelect extends FtLitElement {
217
218
  part="label"
218
219
  ?disabled=${disabled}
219
220
  ?outlined=${this.outlined}
220
- ?raised=${((_b = this.selectedOption) === null || _b === void 0 ? void 0 : _b.value) != null || optionsDisplayed}
221
+ ?raised=${hasOptionSelected || optionsDisplayed}
221
222
  ></ft-input-label>
222
223
  <div class="ft-select--input-panel"
223
224
  part="selected-value"
@@ -232,7 +233,7 @@ let FtSelect = class FtSelect extends FtLitElement {
232
233
  aria-expanded="${optionsDisplayed}">
233
234
  <ft-ripple ?disabled=${disabled} ?activated=${!this.outlined}></ft-ripple>
234
235
  <ft-typography variant="body1" class="ft-select--selected-option">
235
- ${((_c = this.selectedOption) === null || _c === void 0 ? void 0 : _c.value) != null ? (_e = (_d = this.selectedOption) === null || _d === void 0 ? void 0 : _d.label) !== null && _e !== void 0 ? _e : "" : ""}
236
+ ${(_e = (_d = this.selectedOption) === null || _d === void 0 ? void 0 : _d.label) !== null && _e !== void 0 ? _e : ""}
236
237
  </ft-typography>
237
238
  <mwc-icon>${optionsDisplayed ? "expand_less" : "expand_more"}</mwc-icon>
238
239
  </div>
@@ -524,14 +524,14 @@ const Te=e.css`:host{font-family:var(--mdc-icon-font, "Material Icons");font-wei
524
524
  padding: 0 12px 0 16px;
525
525
  color: ${Ce.helperColor};
526
526
  }
527
- `]}getTemplate(){var t,i,a,s,p;let n=!this.disabled&&this.optionsDisplayed&&this.hasOptions,c=this.disabled||!this.hasOptions;const l={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":c,"ft-select--options-displayed":n,"ft-select--has-value":null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value),"ft-select--no-label":!this.label};return e.html`
528
- <div class="${r.classMap(l)}" part="container">
527
+ `]}getTemplate(){var t,i,a,s,p;let n=!this.disabled&&this.optionsDisplayed&&this.hasOptions,c=this.disabled||!this.hasOptions;const l=null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value)||(null!==(a=null===(i=this.selectedOption)||void 0===i?void 0:i.label)&&void 0!==a?a:"").length>0,d={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":c,"ft-select--options-displayed":n,"ft-select--has-option-selected":l,"ft-select--no-label":!this.label};return e.html`
528
+ <div class="${r.classMap(d)}" part="container">
529
529
  <div class="ft-select--main-panel" part="main-panel">
530
530
  <ft-input-label text="${this.label}"
531
531
  part="label"
532
532
  ?disabled=${c}
533
533
  ?outlined=${this.outlined}
534
- ?raised=${null!=(null===(i=this.selectedOption)||void 0===i?void 0:i.value)||n}
534
+ ?raised=${l||n}
535
535
  ></ft-input-label>
536
536
  <div class="ft-select--input-panel"
537
537
  part="selected-value"
@@ -543,7 +543,7 @@ const Te=e.css`:host{font-family:var(--mdc-icon-font, "Material Icons");font-wei
543
543
  aria-expanded="${n}">
544
544
  <ft-ripple ?disabled=${c} ?activated=${!this.outlined}></ft-ripple>
545
545
  <ft-typography variant="body1" class="ft-select--selected-option">
546
- ${null!=(null===(a=this.selectedOption)||void 0===a?void 0:a.value)&&null!==(p=null===(s=this.selectedOption)||void 0===s?void 0:s.label)&&void 0!==p?p:""}
546
+ ${null!==(p=null===(s=this.selectedOption)||void 0===s?void 0:s.label)&&void 0!==p?p:""}
547
547
  </ft-typography>
548
548
  <mwc-icon>${n?"expand_less":"expand_more"}</mwc-icon>
549
549
  </div>
@@ -613,14 +613,14 @@ const vi=s`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:
613
613
  padding: 0 12px 0 16px;
614
614
  color: ${xi.helperColor};
615
615
  }
616
- `]}getTemplate(){var t,e,i,r,o;let n=!this.disabled&&this.optionsDisplayed&&this.hasOptions,s=this.disabled||!this.hasOptions;const a={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":s,"ft-select--options-displayed":n,"ft-select--has-value":null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value),"ft-select--no-label":!this.label};return U`
617
- <div class="${ft(a)}" part="container">
616
+ `]}getTemplate(){var t,e,i,r,o;let n=!this.disabled&&this.optionsDisplayed&&this.hasOptions,s=this.disabled||!this.hasOptions;const a=null!=(null===(t=this.selectedOption)||void 0===t?void 0:t.value)||(null!==(i=null===(e=this.selectedOption)||void 0===e?void 0:e.label)&&void 0!==i?i:"").length>0,c={"ft-select":!0,"ft-select--filled":!this.outlined,"ft-select--outlined":this.outlined,"ft-select--disabled":s,"ft-select--options-displayed":n,"ft-select--has-option-selected":a,"ft-select--no-label":!this.label};return U`
617
+ <div class="${ft(c)}" part="container">
618
618
  <div class="ft-select--main-panel" part="main-panel">
619
619
  <ft-input-label text="${this.label}"
620
620
  part="label"
621
621
  ?disabled=${s}
622
622
  ?outlined=${this.outlined}
623
- ?raised=${null!=(null===(e=this.selectedOption)||void 0===e?void 0:e.value)||n}
623
+ ?raised=${a||n}
624
624
  ></ft-input-label>
625
625
  <div class="ft-select--input-panel"
626
626
  part="selected-value"
@@ -632,7 +632,7 @@ const vi=s`:host{font-family:var(--mdc-icon-font, "Material Icons");font-weight:
632
632
  aria-expanded="${n}">
633
633
  <ft-ripple ?disabled=${s} ?activated=${!this.outlined}></ft-ripple>
634
634
  <ft-typography variant="body1" class="ft-select--selected-option">
635
- ${null!=(null===(i=this.selectedOption)||void 0===i?void 0:i.value)&&null!==(o=null===(r=this.selectedOption)||void 0===r?void 0:r.label)&&void 0!==o?o:""}
635
+ ${null!==(o=null===(r=this.selectedOption)||void 0===r?void 0:r.label)&&void 0!==o?o:""}
636
636
  </ft-typography>
637
637
  <mwc-icon>${n?"expand_less":"expand_more"}</mwc-icon>
638
638
  </div>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-select",
3
- "version": "0.1.13",
3
+ "version": "0.1.16",
4
4
  "description": "Value selector for a predefined list of choices",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,12 +19,12 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-input-label": "^0.1.13",
23
- "@fluid-topics/ft-ripple": "^0.1.13",
24
- "@fluid-topics/ft-typography": "^0.1.13",
25
- "@fluid-topics/ft-wc-utils": "^0.1.13",
22
+ "@fluid-topics/ft-input-label": "^0.1.16",
23
+ "@fluid-topics/ft-ripple": "^0.1.16",
24
+ "@fluid-topics/ft-typography": "^0.1.16",
25
+ "@fluid-topics/ft-wc-utils": "^0.1.16",
26
26
  "@material/mwc-icon": "^0.25.3",
27
27
  "lit": "2.1.3"
28
28
  },
29
- "gitHead": "1d71ea532a92f97baca8f16cbc975e8fe79b471a"
29
+ "gitHead": "cd0a3cb28ec86c2c93fcaecf99cdd1c51e83c8c9"
30
30
  }