@fluid-topics/ft-search-bar 0.3.31 → 0.3.32

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.
@@ -839,7 +839,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
839
839
  margin: 10px 0;
840
840
  color: ${ri.colorOnSurfaceMedium};
841
841
  }
842
- `;var li=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class ai extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=this.options;this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return i.html`
842
+ `;var li=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class ai extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.preventNavigation=!1,this.filter="",this.moreValuesButtonLabel="More",this.displayedValuesLimit=0,this.displayedPages=1}get hasHiddenValues(){let t=this.limit;return null!=t&&t<this.options.length}get limit(){return this.displayedValuesLimit>0?this.displayedPages*this.displayedValuesLimit:void 0}get height(){var t,e;return null!==(e=null===(t=this.container)||void 0===t?void 0:t.scrollHeight)&&void 0!==e?e:0}render(){let t=[...this.options];this.hideSelectedOptions&&(t=t.filter((t=>!t.selected))),this.filter&&(t=t.filter((t=>t.label.toLowerCase().includes(this.filter.toLowerCase()))));const e=t.slice(0,this.limit);return i.html`
843
843
  <div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
844
844
  ${null==this.parent?null:i.html`
845
845
  <div tabindex="0"
@@ -890,7 +890,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
890
890
  .disabled=${this.disabled}
891
891
  .indeterminate=${ee(null!==(e=t.subOptions)&&void 0!==e?e:[],(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).some((t=>t.selected))}
892
892
  @change=${e=>this.optionsChanged(e,t)}>
893
- ${t.label}
893
+ ${t.renderOption?t.renderOption:t.label}
894
894
  </ft-checkbox>
895
895
  `}buildMonoValuedOption(t){return i.html`
896
896
  <ft-radio name="${this.id+Math.round(1e6*Math.random())}"
@@ -901,7 +901,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
901
901
  @click=${e=>this.optionsChanged(e,t)}
902
902
  @keyup=${e=>this.onRadioKeyUp(e,t)}
903
903
  @change=${t=>t.stopPropagation()}>
904
- ${t.label}
904
+ ${t.renderOption?t.renderOption:t.label}
905
905
  </ft-radio>
906
906
  `}onRadioKeyUp(t,e){e.selected&&" "===t.key&&this.optionsChanged(t,e)}optionsChanged(t,e){t.stopPropagation(),this.dispatchEvent(new CustomEvent("change",{detail:e}))}displayLevel(t){this.dispatchEvent(new CustomEvent("display-level",{detail:t}))}}ai.elementDefinitions={"ft-button":Te,"ft-ripple":be,"ft-typography":te,"ft-checkbox":qe,"ft-icon":De,"ft-radio":ei},ai.styles=ni,li([o.property({type:String})],ai.prototype,"id",void 0),li([o.property({type:Object})],ai.prototype,"parent",void 0),li([o.property({type:Array})],ai.prototype,"options",void 0),li([o.property({type:Boolean})],ai.prototype,"multivalued",void 0),li([o.property({type:Boolean})],ai.prototype,"disabled",void 0),li([o.property({type:Boolean})],ai.prototype,"hideSelectedOptions",void 0),li([o.property({type:Boolean})],ai.prototype,"preventNavigation",void 0),li([o.property({type:String})],ai.prototype,"filter",void 0),li([o.property({type:String})],ai.prototype,"moreValuesButtonLabel",void 0),li([o.property({type:String})],ai.prototype,"noValuesLabel",void 0),li([o.property({type:Number})],ai.prototype,"displayedValuesLimit",void 0),li([o.query(".ft-filter-level--container")],ai.prototype,"container",void 0),li([o.state()],ai.prototype,"displayedPages",void 0);const ci={buttonsColor:e.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color",e.designSystemVariables.colorPrimary),buttonsZIndex:e.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","COLOR","1"),gap:e.FtCssVariableFactory.create("--ft-snap-scroll-gap","SIZE","0"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system")},hi=i.css`
907
907
  .ft-snap-scroll {
@@ -1160,14 +1160,14 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
1160
1160
  slot {
1161
1161
  display: none;
1162
1162
  }
1163
- `];var wi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class ki extends CustomEvent{constructor(t){super("change",{detail:t})}}class Si extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",this.noValuesLabel="No values available",this.options=[],this.multivalued=!1,this.disabled=!1,this.raiseSelectedOptions=!1,this.displayedValuesLimit=0,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new e.Debouncer(300),this.changeDebouncer=new e.Debouncer(10)}get flatOptions(){return ee(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}render(){var t,e;const o=this.flatOptions.some((t=>t.selected));let s=this.withScroll||this.filter||null!==(e=null===(t=this.lastLevel)||void 0===t?void 0:t.hasHiddenValues)&&void 0!==e&&e;return i.html`
1163
+ `];var wi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class ki extends CustomEvent{constructor(t){super("change",{detail:t})}}class Si extends e.FtLitElement{constructor(){super(...arguments),this.id="",this.label="",this.filterPlaceHolder="Filter {0}",this.clearButtonLabel="Clear",this.moreValuesButtonLabel="More",this.noValuesLabel="No values available",this.options=[],this.multivalued=!1,this.disabled=!1,this.raiseSelectedOptions=!1,this.displayedValuesLimit=0,this.hideClearButton=!1,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new e.Debouncer(300),this.changeDebouncer=new e.Debouncer(10)}get flatOptions(){return ee(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}render(){var t,e;const o=this.flatOptions.some((t=>t.selected));let s=this.withScroll||this.filter||null!==(e=null===(t=this.lastLevel)||void 0===t?void 0:t.hasHiddenValues)&&void 0!==e&&e;return i.html`
1164
1164
  <div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
1165
1165
  part="container">
1166
1166
  ${this.label||o?i.html`
1167
1167
  <div class="ft-filter--header" part="header">
1168
1168
  <ft-typography class="ft-filter--label" variant="overline" part="label">${this.label}
1169
1169
  </ft-typography>
1170
- ${o?i.html`
1170
+ ${o&&!this.hideClearButton?i.html`
1171
1171
  <ft-button icon="close" dense @click=${this.clear} part="clear-button">
1172
1172
  ${this.clearButtonLabel}
1173
1173
  </ft-button>
@@ -1214,7 +1214,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
1214
1214
  <ft-filter-level
1215
1215
  class="${t}"
1216
1216
  id="${this.id}"
1217
- filter="${this.filter}"
1217
+ .filter="${this.filter}"
1218
1218
  moreValuesButtonLabel="${this.moreValuesButtonLabel}"
1219
1219
  ?multivalued=${this.multivalued}
1220
1220
  ?disabled=${this.disabled||"ft-filter--level-center"!==t}
@@ -1229,9 +1229,9 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
1229
1229
  .exportpartsPrefixes=${["values","available-values"]}
1230
1230
  noValuesLabel="${this.noValuesLabel}"
1231
1231
  ></ft-filter-level>
1232
- `}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const i=this.flatOptions.find((e=>e.value===t.detail.value));i.selected=!i.selected;const o=t=>{var e;t!==i&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(o)};this.multivalued?null===(e=i.subOptions)||void 0===e||e.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;const e=this.flatOptions.filter((t=>t.selected)).map((t=>t.value));this.dispatchEvent(new ki(e)),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}Si.elementDefinitions={"ft-button":Te,"ft-filter-level":ai,"ft-snap-scroll":di,"ft-typography":te},Si.styles=$i,wi([o.property({type:String})],Si.prototype,"id",void 0),wi([o.property({type:String})],Si.prototype,"label",void 0),wi([o.property({type:String})],Si.prototype,"filterPlaceHolder",void 0),wi([o.property({type:String})],Si.prototype,"clearButtonLabel",void 0),wi([o.property({type:String})],Si.prototype,"moreValuesButtonLabel",void 0),wi([o.property({type:String})],Si.prototype,"noValuesLabel",void 0),wi([e.jsonProperty([])],Si.prototype,"options",void 0),wi([o.property({type:Boolean})],Si.prototype,"multivalued",void 0),wi([o.property({type:Boolean})],Si.prototype,"disabled",void 0),wi([o.property({type:Boolean})],Si.prototype,"raiseSelectedOptions",void 0),wi([o.property({type:Number})],Si.prototype,"displayedValuesLimit",void 0),wi([o.query(".ft-filter--slot")],Si.prototype,"slotElement",void 0),wi([o.query(".ft-filter--container")],Si.prototype,"container",void 0),wi([o.query(".ft-filter--values")],Si.prototype,"valuesContainer",void 0),wi([o.query(".ft-filter--levels")],Si.prototype,"levelsContainer",void 0),wi([o.query(".ft-filter--levels ft-filter-level:last-child")],Si.prototype,"lastLevel",void 0),wi([o.query(".ft-filter--filter input")],Si.prototype,"filterInput",void 0),wi([o.queryAll(".ft-filter--levels ft-filter-level")],Si.prototype,"levels",void 0),wi([o.state()],Si.prototype,"withScroll",void 0),wi([o.state()],Si.prototype,"filter",void 0),wi([o.state()],Si.prototype,"slideIn",void 0),wi([o.state()],Si.prototype,"slideOut",void 0);var zi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Oi extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return i.html`
1232
+ `}goBack(t){this.slideOut=t.detail.value}onDisplayLevel(t){this.displayedLevels.push(t.detail.value),this.slideIn=t.detail.value}clear(){if(this.flatOptions.forEach((t=>t.selected=!1)),this.displayedLevels.length>0){let t=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[t],this.slideOut=t}this.optionsChanged()}onChange(t){var e;t.stopPropagation();const i=this.flatOptions.find((e=>e.value===t.detail.value));i.selected=!i.selected;const o=t=>{var e;t!==i&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(o)};this.multivalued?null===(e=i.subOptions)||void 0===e||e.forEach(o):this.options.forEach(o),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;const e=this.flatOptions.filter((t=>t.selected)).map((t=>t.value));this.dispatchEvent(new ki(e)),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}updateOptionsFromSlot(t){t.stopPropagation(),this.options=this.slotElement.assignedElements().map((t=>t)),this.optionsChanged()}onFilterChange(){var t,e;this.filter=null!==(e=null===(t=this.filterInput)||void 0===t?void 0:t.value)&&void 0!==e?e:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}}Si.elementDefinitions={"ft-button":Te,"ft-filter-level":ai,"ft-snap-scroll":di,"ft-typography":te},Si.styles=$i,wi([o.property({type:String})],Si.prototype,"id",void 0),wi([o.property({type:String})],Si.prototype,"label",void 0),wi([o.property({type:String})],Si.prototype,"filterPlaceHolder",void 0),wi([o.property({type:String})],Si.prototype,"clearButtonLabel",void 0),wi([o.property({type:String})],Si.prototype,"moreValuesButtonLabel",void 0),wi([o.property({type:String})],Si.prototype,"noValuesLabel",void 0),wi([e.jsonProperty([])],Si.prototype,"options",void 0),wi([o.property({type:Boolean})],Si.prototype,"multivalued",void 0),wi([o.property({type:Boolean})],Si.prototype,"disabled",void 0),wi([o.property({type:Boolean})],Si.prototype,"raiseSelectedOptions",void 0),wi([o.property({type:Number})],Si.prototype,"displayedValuesLimit",void 0),wi([o.property({type:Boolean})],Si.prototype,"hideClearButton",void 0),wi([o.query(".ft-filter--slot")],Si.prototype,"slotElement",void 0),wi([o.query(".ft-filter--container")],Si.prototype,"container",void 0),wi([o.query(".ft-filter--values")],Si.prototype,"valuesContainer",void 0),wi([o.query(".ft-filter--levels")],Si.prototype,"levelsContainer",void 0),wi([o.query(".ft-filter--levels ft-filter-level:last-child")],Si.prototype,"lastLevel",void 0),wi([o.query(".ft-filter--filter input")],Si.prototype,"filterInput",void 0),wi([o.queryAll(".ft-filter--levels ft-filter-level")],Si.prototype,"levels",void 0),wi([o.state()],Si.prototype,"withScroll",void 0),wi([o.state()],Si.prototype,"filter",void 0),wi([o.state()],Si.prototype,"slideIn",void 0),wi([o.state()],Si.prototype,"slideOut",void 0);var zi=function(t,e,i,o){for(var s,r=arguments.length,n=r<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,l=t.length-1;l>=0;l--)(s=t[l])&&(n=(r<3?s(n):r>3?s(e,i,n):s(e,i))||n);return r>3&&n&&Object.defineProperty(e,i,n),n};class Oi extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return i.html`
1233
1233
  <slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
1234
- `}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Oi.elementDefinitions={},zi([o.property({type:String})],Oi.prototype,"label",void 0),zi([o.property({type:Object,converter:t=>t})],Oi.prototype,"value",void 0),zi([o.property({type:Boolean,reflect:!0})],Oi.prototype,"selected",void 0),zi([o.property({type:Object})],Oi.prototype,"subOptions",void 0),zi([o.query(".ft-filter-option--slot")],Oi.prototype,"slotElement",void 0),e.customElement("ft-filter")(Si),e.customElement("ft-filter-option")(Oi);const Bi=i.css`
1234
+ `}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}updated(t){super.updated(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}Oi.elementDefinitions={},zi([o.property({type:String})],Oi.prototype,"label",void 0),zi([o.property({type:Object,converter:t=>t})],Oi.prototype,"value",void 0),zi([o.property({type:Boolean,reflect:!0})],Oi.prototype,"selected",void 0),zi([o.property({type:Object})],Oi.prototype,"subOptions",void 0),zi([e.jsonProperty({})],Oi.prototype,"renderOption",void 0),zi([o.query(".ft-filter-option--slot")],Oi.prototype,"slotElement",void 0),e.customElement("ft-filter")(Si),e.customElement("ft-filter-option")(Oi);const Bi=i.css`
1235
1235
  .ft-accordion {
1236
1236
  box-sizing: border-box;
1237
1237
  }
@@ -1777,7 +1777,7 @@ const q=Symbol.for(""),W=t=>{if((null==t?void 0:t.r)===q)return null==t?void 0:t
1777
1777
  <ft-ripple ?primary=${e} ?activated=${e}></ft-ripple>
1778
1778
  <span>${t.label}</span>
1779
1779
  </div>
1780
- `}updated(t){var e;super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1,this.dispatchEvent(new CustomEvent("change",{detail:null===(e=this.selectedOption)||void 0===e?void 0:e.value}))),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,r;let n;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),n=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(r=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.firstOption}null==n||n.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){this.selectedOption=t;for(let e of this.options)e.selected=e===t}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}to.elementDefinitions={"ft-input-label":Gi,"ft-typography":te,"ft-ripple":be,"ft-icon":De},to.styles=[qt,Wt,Yi],Ji([o.property({type:String})],to.prototype,"label",void 0),Ji([o.property({type:String})],to.prototype,"helper",void 0),Ji([o.property({type:Boolean})],to.prototype,"outlined",void 0),Ji([o.property({type:Boolean})],to.prototype,"disabled",void 0),Ji([o.property({type:Boolean})],to.prototype,"error",void 0),Ji([o.property({type:Boolean})],to.prototype,"fixedMenuPosition",void 0),Ji([o.property({type:Array})],to.prototype,"options",void 0),Ji([o.state()],to.prototype,"selectedOption",void 0),Ji([o.state()],to.prototype,"optionsDisplayed",void 0),Ji([o.state()],to.prototype,"focusOptions",void 0),Ji([o.query(".ft-select")],to.prototype,"container",void 0),Ji([o.query(".ft-select--options")],to.prototype,"optionsMenu",void 0),Ji([o.query(".ft-select--input-panel")],to.prototype,"mainPanel",void 0),Ji([o.query(".ft-select--option:first-child")],to.prototype,"firstOption",void 0),Ji([o.query(".ft-select--option:focus")],to.prototype,"focusedOption",void 0),Ji([o.query(".ft-select--option.ft-select--option-selected")],to.prototype,"selectedOptionElement",void 0),Ji([o.query(".ft-select--option:last-child")],to.prototype,"lastOption",void 0),Ji([o.query("slot")],to.prototype,"optionsSlot",void 0),e.customElement("ft-select")(to),e.customElement("ft-select-option")(Qi);const eo={display:e.FtCssVariableFactory.create("--ft-skeleton--display","DISPLAY","block"),width:e.FtCssVariableFactory.create("--ft-skeleton--width","SIZE","100%"),height:e.FtCssVariableFactory.create("--ft-skeleton--height","SIZE","20px"),backgroundColor:e.FtCssVariableFactory.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),glareWidth:e.FtCssVariableFactory.create("--ft-skeleton--glare-width","SIZE","200px"),glareColor:e.FtCssVariableFactory.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),animationDuration:e.FtCssVariableFactory.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system")},io=i.css`
1780
+ `}updated(t){super.updated(t),t.has("options")&&(this.selectedOption=this.options.filter((t=>t.selected))[0]),t.has("selectedOption")&&(this.optionsDisplayed=!1),t.has("optionsDisplayed")&&this.fixedMenuPosition&&this.hasOptionsMenuOpen&&this.positionOptionsMenu()}positionOptionsMenu(){this.optionsMenu.style.top=this.mainPanel.getBoundingClientRect().top+this.mainPanel.getBoundingClientRect().height+"px",this.optionsMenu.style.left=this.mainPanel.getBoundingClientRect().left+"px",this.optionsMenu.style.width=this.mainPanel.getBoundingClientRect().width+"px"}contentAvailableCallback(t){var e,i;t.has("focusOptions")&&this.focusOptions&&(null===(i=null!==(e=this.selectedOptionElement)&&void 0!==e?e:this.firstOption)||void 0===i||i.focus(),this.focusOptions=!1)}get hasOptionsMenuOpen(){return!this.disabled&&this.optionsDisplayed&&this.hasOptions}get hasOptions(){return this.options.length>0}updateOptionsFromSlot(t){var e;t.stopPropagation();let i=null===(e=this.optionsSlot)||void 0===e?void 0:e.assignedElements().map((t=>t));i&&i.length>0&&(this.options=i)}onMainPanelKeyDown(t){switch(t.key){case" ":t.preventDefault(),t.stopPropagation();case"Enter":this.optionsDisplayed=!this.optionsDisplayed,this.focusOptions=!0;break;case"ArrowUp":case"ArrowDown":t.preventDefault(),t.stopPropagation(),this.optionsDisplayed=!0,this.focusOptions=!0}}onOptionsKeyDown(t){var e,i,o,s,r;let n;switch(t.key){case"Escape":this.optionsDisplayed=!1,null===(e=this.mainPanel)||void 0===e||e.focus();break;case"Tab":this.optionsDisplayed=!1;break;case"ArrowUp":t.preventDefault(),t.stopPropagation(),n=null!==(o=null===(i=this.focusedOption)||void 0===i?void 0:i.previousElementSibling)&&void 0!==o?o:this.lastOption;break;case"ArrowDown":t.preventDefault(),t.stopPropagation(),n=null!==(r=null===(s=this.focusedOption)||void 0===s?void 0:s.nextElementSibling)&&void 0!==r?r:this.firstOption}null==n||n.focus()}onOptionKeyDown(t,e){var i;"Enter"!==t.key&&" "!==t.key||(t.preventDefault(),t.stopPropagation(),this.selectOption(e),this.optionsDisplayed=!1,null===(i=this.mainPanel)||void 0===i||i.focus())}selectOption(t){var i,o;if(!e.deepEqual(null===(i=this.selectedOption)||void 0===i?void 0:i.value,t.value)){this.selectedOption=t;for(let e of this.options)e.selected=e===t;this.dispatchEvent(new CustomEvent("change",{detail:null===(o=this.selectedOption)||void 0===o?void 0:o.value}))}this.optionsDisplayed=!1}connectedCallback(){super.connectedCallback(),document.addEventListener("click",this.hideOptions)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("click",this.hideOptions)}}to.elementDefinitions={"ft-input-label":Gi,"ft-typography":te,"ft-ripple":be,"ft-icon":De},to.styles=[qt,Wt,Yi],Ji([o.property({type:String})],to.prototype,"label",void 0),Ji([o.property({type:String})],to.prototype,"helper",void 0),Ji([o.property({type:Boolean})],to.prototype,"outlined",void 0),Ji([o.property({type:Boolean})],to.prototype,"disabled",void 0),Ji([o.property({type:Boolean})],to.prototype,"error",void 0),Ji([o.property({type:Boolean})],to.prototype,"fixedMenuPosition",void 0),Ji([o.property({type:Array})],to.prototype,"options",void 0),Ji([o.state()],to.prototype,"selectedOption",void 0),Ji([o.state()],to.prototype,"optionsDisplayed",void 0),Ji([o.state()],to.prototype,"focusOptions",void 0),Ji([o.query(".ft-select")],to.prototype,"container",void 0),Ji([o.query(".ft-select--options")],to.prototype,"optionsMenu",void 0),Ji([o.query(".ft-select--input-panel")],to.prototype,"mainPanel",void 0),Ji([o.query(".ft-select--option:first-child")],to.prototype,"firstOption",void 0),Ji([o.query(".ft-select--option:focus")],to.prototype,"focusedOption",void 0),Ji([o.query(".ft-select--option.ft-select--option-selected")],to.prototype,"selectedOptionElement",void 0),Ji([o.query(".ft-select--option:last-child")],to.prototype,"lastOption",void 0),Ji([o.query("slot")],to.prototype,"optionsSlot",void 0),e.customElement("ft-select")(to),e.customElement("ft-select-option")(Qi);const eo={display:e.FtCssVariableFactory.create("--ft-skeleton--display","DISPLAY","block"),width:e.FtCssVariableFactory.create("--ft-skeleton--width","SIZE","100%"),height:e.FtCssVariableFactory.create("--ft-skeleton--height","SIZE","20px"),backgroundColor:e.FtCssVariableFactory.create("--ft-skeleton--background-color","COLOR","#f1f1f1"),glareWidth:e.FtCssVariableFactory.create("--ft-skeleton--glare-width","SIZE","200px"),glareColor:e.FtCssVariableFactory.create("--ft-skeleton--glare-color","COLOR","rgba(255, 255, 255, .6)"),animationDuration:e.FtCssVariableFactory.create("--ft-skeleton--animation-duration","UNKNOWN","2s"),borderRadiusM:e.FtCssVariableFactory.external(e.designSystemVariables.borderRadiusM,"Design system")},io=i.css`
1781
1781
  :host {
1782
1782
  width: ${eo.width};
1783
1783
  height: ${eo.height};