@fluid-topics/ft-search-selected-facets 1.1.61 → 1.1.63

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.
@@ -1266,58 +1266,59 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
1266
1266
  margin: 10px 0;
1267
1267
  color: ${_r.colorOnSurfaceMedium};
1268
1268
  }
1269
- `;var Vr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class qr extends e.FtLitElement{constructor(){super(...arguments),this.filterId="",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 o.html`
1269
+ `;var Vr=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class qr extends e.FtLitElement{constructor(){super(...arguments),this.filterId="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.displayCount=!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 o.html`
1270
1270
  <div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
1271
1271
  ${null==this.parent?null:o.html`
1272
- <div tabindex="0"
1273
- part="controls go-back"
1274
- class="ft-filter-level--go-back"
1275
- ?disabled=${this.disabled}
1276
- @keyup=${this.goBackOnKeyPress}
1277
- @click=${this.goBackOnClick}>
1278
- <ft-ripple></ft-ripple>
1279
- <ft-icon>thin_arrow_left</ft-icon>
1280
- <ft-typography variant="body2">${this.parent.label}</ft-typography>
1281
- </div>
1282
- `}
1272
+ <div tabindex="0"
1273
+ part="controls go-back"
1274
+ class="ft-filter-level--go-back"
1275
+ ?disabled=${this.disabled}
1276
+ @keyup=${this.goBackOnKeyPress}
1277
+ @click=${this.goBackOnClick}>
1278
+ <ft-ripple></ft-ripple>
1279
+ <ft-icon>thin_arrow_left</ft-icon>
1280
+ <ft-typography variant="body2">${this.parent.label}</ft-typography>
1281
+ </div>
1282
+ `}
1283
1283
  ${0===this.options.length&&this.noValuesLabel?o.html`
1284
- <ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
1285
- ${this.noValuesLabel}
1286
- </ft-typography>
1287
- `:o.nothing}
1284
+ <ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
1285
+ ${this.noValuesLabel}
1286
+ </ft-typography>
1287
+ `:o.nothing}
1288
1288
  ${i.repeat(e,(t=>t.value),(t=>{var e;return o.html`
1289
- <div class="ft-filter-level--option" part="options">
1290
- ${this.multivalued?this.buildMultiValuedOption(t):this.buildMonoValuedOption(t)}
1291
- ${this.preventNavigation||t.selected||0===(null!==(e=t.subOptions)&&void 0!==e?e:[]).length?o.nothing:o.html`
1292
- <ft-button icon="thin_arrow_right"
1293
- part="controls navigate-hierarchy"
1294
- label="${t.label}"
1295
- ?disabled=${this.disabled}
1296
- tooltipPosition="left"
1297
- @click=${()=>this.displayLevel(t)}></ft-button>
1298
- `}
1299
- </div>
1300
- `}))}
1289
+ <div class="ft-filter-level--option" part="options">
1290
+ ${this.multivalued?this.buildMultiValuedOption(t):this.buildMonoValuedOption(t)}
1291
+ ${this.preventNavigation||t.selected||0===(null!==(e=t.subOptions)&&void 0!==e?e:[]).length?o.nothing:o.html`
1292
+ <ft-button icon="thin_arrow_right"
1293
+ part="controls navigate-hierarchy"
1294
+ label="${t.label}"
1295
+ ?disabled=${this.disabled}
1296
+ tooltipPosition="left"
1297
+ @click=${()=>this.displayLevel(t)}></ft-button>
1298
+ `}
1299
+ </div>
1300
+ `}))}
1301
1301
  ${e.length<t.length?o.html`
1302
- <ft-button
1303
- class="ft-filter-level--display-more"
1304
- icon="thin_arrow"
1305
- dense trailingIcon
1306
- part="controls display-more"
1307
- @click=${this.displayMore}>
1308
- ${this.moreValuesButtonLabel}
1309
- </ft-button>
1310
- `:o.nothing}
1302
+ <ft-button
1303
+ class="ft-filter-level--display-more"
1304
+ icon="thin_arrow"
1305
+ dense trailingIcon
1306
+ part="controls display-more"
1307
+ @click=${this.displayMore}>
1308
+ ${this.moreValuesButtonLabel}
1309
+ </ft-button>
1310
+ `:o.nothing}
1311
1311
  </div>
1312
1312
  `}goBackOnKeyPress(t){"Enter"!==t.key&&" "!==t.key||this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}goBackOnClick(t){t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}displayMore(){this.displayedPages++}buildMultiValuedOption(t){var i;return o.html`
1313
1313
  <ft-checkbox name="${this.filterId}"
1314
1314
  part="multivalued-option"
1315
1315
  data-value="${t.value}"
1316
+
1316
1317
  .checked=${t.selected}
1317
1318
  .disabled=${this.disabled}
1318
1319
  .indeterminate=${e.flatDeep(null!==(i=t.subOptions)&&void 0!==i?i:[],(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).some((t=>t.selected))}
1319
1320
  @change=${e=>this.optionsChanged(e,t)}>
1320
- ${t.renderOption?t.renderOption:t.label}
1321
+ ${t.renderOption?t.renderOption:t.label}${this.displayCount?` (${t.count})`:""}
1321
1322
  </ft-checkbox>
1322
1323
  `}buildMonoValuedOption(t){return o.html`
1323
1324
  <ft-radio name="${this.filterId+Math.round(1e6*Math.random())}"
@@ -1328,9 +1329,9 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
1328
1329
  @click=${e=>this.optionsChanged(e,t)}
1329
1330
  @keyup=${e=>this.onRadioKeyUp(e,t)}
1330
1331
  @change=${t=>t.stopPropagation()}>
1331
- ${t.renderOption?t.renderOption:t.label}
1332
+ ${t.renderOption?t.renderOption:t.label}${this.displayCount?` (${t.count})`:""}
1332
1333
  </ft-radio>
1333
- `}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}))}}qr.elementDefinitions={"ft-button":Vi,"ft-ripple":lt,"ft-typography":yo,"ft-checkbox":zr,"ft-icon":wo,"ft-radio":Hr},qr.styles=Gr,Vr([r.property({type:String})],qr.prototype,"filterId",void 0),Vr([r.property({type:Object})],qr.prototype,"parent",void 0),Vr([r.property({type:Array})],qr.prototype,"options",void 0),Vr([r.property({type:Boolean})],qr.prototype,"multivalued",void 0),Vr([r.property({type:Boolean})],qr.prototype,"disabled",void 0),Vr([r.property({type:Boolean})],qr.prototype,"hideSelectedOptions",void 0),Vr([r.property({type:Boolean})],qr.prototype,"preventNavigation",void 0),Vr([r.property({type:String})],qr.prototype,"filter",void 0),Vr([r.property({type:String})],qr.prototype,"moreValuesButtonLabel",void 0),Vr([r.property({type:String})],qr.prototype,"noValuesLabel",void 0),Vr([r.property({type:Number})],qr.prototype,"displayedValuesLimit",void 0),Vr([r.query(".ft-filter-level--container")],qr.prototype,"container",void 0),Vr([r.state()],qr.prototype,"displayedPages",void 0);const Yr={buttonsColor:e.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color","",e.designSystemVariables.colorPrimary),buttonsZIndex:e.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","","NUMBER","1"),gap:e.FtCssVariableFactory.create("--ft-snap-scroll-gap","","SIZE","0"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system")},Qr=o.css`
1334
+ `}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}))}}qr.elementDefinitions={"ft-button":Vi,"ft-ripple":lt,"ft-typography":yo,"ft-checkbox":zr,"ft-icon":wo,"ft-radio":Hr},qr.styles=Gr,Vr([r.property({type:String})],qr.prototype,"filterId",void 0),Vr([r.property({type:Object})],qr.prototype,"parent",void 0),Vr([r.property({type:Array})],qr.prototype,"options",void 0),Vr([r.property({type:Boolean})],qr.prototype,"multivalued",void 0),Vr([r.property({type:Boolean})],qr.prototype,"disabled",void 0),Vr([r.property({type:Boolean})],qr.prototype,"hideSelectedOptions",void 0),Vr([r.property({type:Boolean})],qr.prototype,"displayCount",void 0),Vr([r.property({type:Boolean})],qr.prototype,"preventNavigation",void 0),Vr([r.property({type:String})],qr.prototype,"filter",void 0),Vr([r.property({type:String})],qr.prototype,"moreValuesButtonLabel",void 0),Vr([r.property({type:String})],qr.prototype,"noValuesLabel",void 0),Vr([r.property({type:Number})],qr.prototype,"displayedValuesLimit",void 0),Vr([r.query(".ft-filter-level--container")],qr.prototype,"container",void 0),Vr([r.state()],qr.prototype,"displayedPages",void 0);const Yr={buttonsColor:e.FtCssVariableFactory.extend("--ft-snap-scroll-buttons-color","",e.designSystemVariables.colorPrimary),buttonsZIndex:e.FtCssVariableFactory.create("--ft-snap-scroll-buttons-z-index","","NUMBER","1"),gap:e.FtCssVariableFactory.create("--ft-snap-scroll-gap","","SIZE","0"),colorSurface:e.FtCssVariableFactory.external(e.designSystemVariables.colorSurface,"Design system")},Qr=o.css`
1334
1335
  .ft-snap-scroll {
1335
1336
  box-sizing: border-box;
1336
1337
  position: relative;
@@ -1594,7 +1595,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
1594
1595
  slot:not([name]) {
1595
1596
  display: none;
1596
1597
  }
1597
- `];var hn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class dn extends CustomEvent{constructor(t){super("change",{detail:t})}}class un 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.lastLevelHasHiddenvalues=!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),this.lastDispatchedValues=[]}get flatOptions(){return e.flatDeep(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get childrenFilteredFlatOptions(){return e.flatDeep(this.options,(t=>{var e;return t.selected?[]:null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.childrenFilteredFlatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){const t=this.flatOptions.some((t=>t.selected)),e=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,i=this.filterPlaceHolder.replace("{0}",this.label);return o.html`
1598
+ `];var hn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class dn extends CustomEvent{constructor(t){super("change",{detail:t})}}class un 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.displayCount=!1,this.displayedValuesLimit=0,this.hideClearButton=!1,this.lastLevelHasHiddenvalues=!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),this.lastDispatchedValues=[]}get flatOptions(){return e.flatDeep(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get childrenFilteredFlatOptions(){return e.flatDeep(this.options,(t=>{var e;return t.selected?[]:null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.childrenFilteredFlatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){const t=this.flatOptions.some((t=>t.selected)),e=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,i=this.filterPlaceHolder.replace("{0}",this.label);return o.html`
1598
1599
  <div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
1599
1600
  part="container">
1600
1601
  ${this.label||t?o.html`
@@ -1636,6 +1637,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
1636
1637
  filterId="${this.id}"
1637
1638
  ?multivalued=${this.multivalued}
1638
1639
  ?disabled=${this.disabled}
1640
+ ?displayCount="${this.displayCount}"
1639
1641
  preventNavigation
1640
1642
  .options=${e}
1641
1643
  @change=${this.onChange}
@@ -1659,6 +1661,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
1659
1661
  ?multivalued=${this.multivalued}
1660
1662
  ?disabled=${this.disabled||"ft-filter--level-center"!==t}
1661
1663
  ?hideSelectedOptions=${this.raiseSelectedOptions}
1664
+ ?displayCount="${this.displayCount}"
1662
1665
  .parent=${i}
1663
1666
  .options=${e}
1664
1667
  .displayedValuesLimit=${this.displayedValuesLimit}
@@ -1669,7 +1672,7 @@ const jt=Symbol.for(""),Mt=t=>{if(t?.r===jt)return t?._$litStatic$},_t=t=>({_$li
1669
1672
  .exportpartsPrefixes=${["values","available-values"]}
1670
1673
  noValuesLabel="${this.noValuesLabel}"
1671
1674
  ></ft-filter-level>
1672
- `}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 o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;e.deepEqual(this.lastDispatchedValues,t)||(this.dispatchEvent(new dn(t)),this.lastDispatchedValues=t)}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)}}un.elementDefinitions={"ft-button":Vi,"ft-filter-level":qr,"ft-snap-scroll":tn,"ft-typography":yo},un.styles=fn,hn([r.property({type:String})],un.prototype,"id",void 0),hn([r.property({type:String})],un.prototype,"label",void 0),hn([r.property({type:String})],un.prototype,"filterPlaceHolder",void 0),hn([r.property({type:String})],un.prototype,"clearButtonLabel",void 0),hn([r.property({type:String})],un.prototype,"moreValuesButtonLabel",void 0),hn([r.property({type:String})],un.prototype,"noValuesLabel",void 0),hn([e.jsonProperty([])],un.prototype,"options",void 0),hn([r.property({type:Boolean})],un.prototype,"multivalued",void 0),hn([r.property({type:Boolean})],un.prototype,"disabled",void 0),hn([r.property({type:Boolean})],un.prototype,"raiseSelectedOptions",void 0),hn([r.property({type:Number})],un.prototype,"displayedValuesLimit",void 0),hn([r.property({type:Boolean})],un.prototype,"hideClearButton",void 0),hn([r.query(".ft-filter--slot")],un.prototype,"slotElement",void 0),hn([r.query(".ft-filter--container")],un.prototype,"container",void 0),hn([r.query(".ft-filter--values")],un.prototype,"valuesContainer",void 0),hn([r.query(".ft-filter--levels")],un.prototype,"levelsContainer",void 0),hn([r.state()],un.prototype,"lastLevelHasHiddenvalues",void 0),hn([r.query(".ft-filter--filter input")],un.prototype,"filterInput",void 0),hn([r.queryAll(".ft-filter--levels ft-filter-level")],un.prototype,"levels",void 0),hn([r.state()],un.prototype,"withScroll",void 0),hn([r.state()],un.prototype,"filter",void 0),hn([r.state()],un.prototype,"slideIn",void 0),hn([r.state()],un.prototype,"slideOut",void 0);var gn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class bn extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return o.html`
1675
+ `}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 o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;e.deepEqual(this.lastDispatchedValues,t)||(this.dispatchEvent(new dn(t)),this.lastDispatchedValues=t)}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)}}un.elementDefinitions={"ft-button":Vi,"ft-filter-level":qr,"ft-snap-scroll":tn,"ft-typography":yo},un.styles=fn,hn([r.property({type:String})],un.prototype,"id",void 0),hn([r.property({type:String})],un.prototype,"label",void 0),hn([r.property({type:String})],un.prototype,"filterPlaceHolder",void 0),hn([r.property({type:String})],un.prototype,"clearButtonLabel",void 0),hn([r.property({type:String})],un.prototype,"moreValuesButtonLabel",void 0),hn([r.property({type:String})],un.prototype,"noValuesLabel",void 0),hn([e.jsonProperty([])],un.prototype,"options",void 0),hn([r.property({type:Boolean})],un.prototype,"multivalued",void 0),hn([r.property({type:Boolean})],un.prototype,"disabled",void 0),hn([r.property({type:Boolean})],un.prototype,"raiseSelectedOptions",void 0),hn([r.property({type:Boolean})],un.prototype,"displayCount",void 0),hn([r.property({type:Number})],un.prototype,"displayedValuesLimit",void 0),hn([r.property({type:Boolean})],un.prototype,"hideClearButton",void 0),hn([r.query(".ft-filter--slot")],un.prototype,"slotElement",void 0),hn([r.query(".ft-filter--container")],un.prototype,"container",void 0),hn([r.query(".ft-filter--values")],un.prototype,"valuesContainer",void 0),hn([r.query(".ft-filter--levels")],un.prototype,"levelsContainer",void 0),hn([r.state()],un.prototype,"lastLevelHasHiddenvalues",void 0),hn([r.query(".ft-filter--filter input")],un.prototype,"filterInput",void 0),hn([r.queryAll(".ft-filter--levels ft-filter-level")],un.prototype,"levels",void 0),hn([r.state()],un.prototype,"withScroll",void 0),hn([r.state()],un.prototype,"filter",void 0),hn([r.state()],un.prototype,"slideIn",void 0),hn([r.state()],un.prototype,"slideOut",void 0);var gn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class bn extends e.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return o.html`
1673
1676
  <slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
1674
1677
  `}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}bn.elementDefinitions={},gn([r.property({type:String})],bn.prototype,"label",void 0),gn([r.property({type:Object,converter:t=>t})],bn.prototype,"value",void 0),gn([r.property({type:Boolean,reflect:!0})],bn.prototype,"selected",void 0),gn([r.property({type:Object})],bn.prototype,"subOptions",void 0),gn([e.jsonProperty({})],bn.prototype,"renderOption",void 0),gn([r.query(".ft-filter-option--slot")],bn.prototype,"slotElement",void 0),e.customElement("ft-filter")(un),e.customElement("ft-filter-option")(bn);const yn=mr.build("designedSearchType"),mn={label:"Search scope",documentTitlesOnly:"Search in document titles only"};var xn=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,l=t.length-1;l>=0;l--)(r=t[l])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class vn extends(dr(Y)){constructor(){super(),this.addI18nContext(yn,mn)}render(){return o.html`
1675
1678
  <ft-filter
@@ -1434,58 +1434,59 @@ const gl=Symbol.for(""),yl=t=>{if(t?.r===gl)return t?._$litStatic$},bl=t=>({_$li
1434
1434
  margin: 10px 0;
1435
1435
  color: ${hf.colorOnSurfaceMedium};
1436
1436
  }
1437
- `;var df=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class pf extends Mr{constructor(){super(...arguments),this.filterId="",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 Jt`
1437
+ `;var df=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class pf extends Mr{constructor(){super(...arguments),this.filterId="",this.options=[],this.multivalued=!1,this.disabled=!1,this.hideSelectedOptions=!1,this.displayCount=!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 Jt`
1438
1438
  <div class="ft-filter-level--container ${this.disabled?"ft-filter--disabled":""}">
1439
1439
  ${null==this.parent?null:Jt`
1440
- <div tabindex="0"
1441
- part="controls go-back"
1442
- class="ft-filter-level--go-back"
1443
- ?disabled=${this.disabled}
1444
- @keyup=${this.goBackOnKeyPress}
1445
- @click=${this.goBackOnClick}>
1446
- <ft-ripple></ft-ripple>
1447
- <ft-icon>thin_arrow_left</ft-icon>
1448
- <ft-typography variant="body2">${this.parent.label}</ft-typography>
1449
- </div>
1450
- `}
1440
+ <div tabindex="0"
1441
+ part="controls go-back"
1442
+ class="ft-filter-level--go-back"
1443
+ ?disabled=${this.disabled}
1444
+ @keyup=${this.goBackOnKeyPress}
1445
+ @click=${this.goBackOnClick}>
1446
+ <ft-ripple></ft-ripple>
1447
+ <ft-icon>thin_arrow_left</ft-icon>
1448
+ <ft-typography variant="body2">${this.parent.label}</ft-typography>
1449
+ </div>
1450
+ `}
1451
1451
  ${0===this.options.length&&this.noValuesLabel?Jt`
1452
- <ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
1453
- ${this.noValuesLabel}
1454
- </ft-typography>
1455
- `:te}
1452
+ <ft-typography class="ft-filter-level--no-values" element="span" variant="body2">
1453
+ ${this.noValuesLabel}
1454
+ </ft-typography>
1455
+ `:te}
1456
1456
  ${Te(e,(t=>t.value),(t=>{var e;return Jt`
1457
- <div class="ft-filter-level--option" part="options">
1458
- ${this.multivalued?this.buildMultiValuedOption(t):this.buildMonoValuedOption(t)}
1459
- ${this.preventNavigation||t.selected||0===(null!==(e=t.subOptions)&&void 0!==e?e:[]).length?te:Jt`
1460
- <ft-button icon="thin_arrow_right"
1461
- part="controls navigate-hierarchy"
1462
- label="${t.label}"
1463
- ?disabled=${this.disabled}
1464
- tooltipPosition="left"
1465
- @click=${()=>this.displayLevel(t)}></ft-button>
1466
- `}
1467
- </div>
1468
- `}))}
1457
+ <div class="ft-filter-level--option" part="options">
1458
+ ${this.multivalued?this.buildMultiValuedOption(t):this.buildMonoValuedOption(t)}
1459
+ ${this.preventNavigation||t.selected||0===(null!==(e=t.subOptions)&&void 0!==e?e:[]).length?te:Jt`
1460
+ <ft-button icon="thin_arrow_right"
1461
+ part="controls navigate-hierarchy"
1462
+ label="${t.label}"
1463
+ ?disabled=${this.disabled}
1464
+ tooltipPosition="left"
1465
+ @click=${()=>this.displayLevel(t)}></ft-button>
1466
+ `}
1467
+ </div>
1468
+ `}))}
1469
1469
  ${e.length<t.length?Jt`
1470
- <ft-button
1471
- class="ft-filter-level--display-more"
1472
- icon="thin_arrow"
1473
- dense trailingIcon
1474
- part="controls display-more"
1475
- @click=${this.displayMore}>
1476
- ${this.moreValuesButtonLabel}
1477
- </ft-button>
1478
- `:te}
1470
+ <ft-button
1471
+ class="ft-filter-level--display-more"
1472
+ icon="thin_arrow"
1473
+ dense trailingIcon
1474
+ part="controls display-more"
1475
+ @click=${this.displayMore}>
1476
+ ${this.moreValuesButtonLabel}
1477
+ </ft-button>
1478
+ `:te}
1479
1479
  </div>
1480
1480
  `}goBackOnKeyPress(t){"Enter"!==t.key&&" "!==t.key||this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}goBackOnClick(t){t.stopPropagation(),t.preventDefault(),this.dispatchEvent(new CustomEvent("go-back",{detail:this.parent}))}displayMore(){this.displayedPages++}buildMultiValuedOption(t){var e;return Jt`
1481
1481
  <ft-checkbox name="${this.filterId}"
1482
1482
  part="multivalued-option"
1483
1483
  data-value="${t.value}"
1484
+
1484
1485
  .checked=${t.selected}
1485
1486
  .disabled=${this.disabled}
1486
1487
  .indeterminate=${po(null!==(e=t.subOptions)&&void 0!==e?e:[],(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]})).some((t=>t.selected))}
1487
1488
  @change=${e=>this.optionsChanged(e,t)}>
1488
- ${t.renderOption?t.renderOption:t.label}
1489
+ ${t.renderOption?t.renderOption:t.label}${this.displayCount?` (${t.count})`:""}
1489
1490
  </ft-checkbox>
1490
1491
  `}buildMonoValuedOption(t){return Jt`
1491
1492
  <ft-radio name="${this.filterId+Math.round(1e6*Math.random())}"
@@ -1496,9 +1497,9 @@ const gl=Symbol.for(""),yl=t=>{if(t?.r===gl)return t?._$litStatic$},bl=t=>({_$li
1496
1497
  @click=${e=>this.optionsChanged(e,t)}
1497
1498
  @keyup=${e=>this.onRadioKeyUp(e,t)}
1498
1499
  @change=${t=>t.stopPropagation()}>
1499
- ${t.renderOption?t.renderOption:t.label}
1500
+ ${t.renderOption?t.renderOption:t.label}${this.displayCount?` (${t.count})`:""}
1500
1501
  </ft-radio>
1501
- `}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}))}}pf.elementDefinitions={"ft-button":fh,"ft-ripple":ul,"ft-typography":Bc,"ft-checkbox":Jh,"ft-icon":_c,"ft-radio":af},pf.styles=ff,df([we({type:String})],pf.prototype,"filterId",void 0),df([we({type:Object})],pf.prototype,"parent",void 0),df([we({type:Array})],pf.prototype,"options",void 0),df([we({type:Boolean})],pf.prototype,"multivalued",void 0),df([we({type:Boolean})],pf.prototype,"disabled",void 0),df([we({type:Boolean})],pf.prototype,"hideSelectedOptions",void 0),df([we({type:Boolean})],pf.prototype,"preventNavigation",void 0),df([we({type:String})],pf.prototype,"filter",void 0),df([we({type:String})],pf.prototype,"moreValuesButtonLabel",void 0),df([we({type:String})],pf.prototype,"noValuesLabel",void 0),df([we({type:Number})],pf.prototype,"displayedValuesLimit",void 0),df([Ee(".ft-filter-level--container")],pf.prototype,"container",void 0),df([Se()],pf.prototype,"displayedPages",void 0);const uf={buttonsColor:wo.extend("--ft-snap-scroll-buttons-color","",Ci.colorPrimary),buttonsZIndex:wo.create("--ft-snap-scroll-buttons-z-index","","NUMBER","1"),gap:wo.create("--ft-snap-scroll-gap","","SIZE","0"),colorSurface:wo.external(Ci.colorSurface,"Design system")},gf=dt`
1502
+ `}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}))}}pf.elementDefinitions={"ft-button":fh,"ft-ripple":ul,"ft-typography":Bc,"ft-checkbox":Jh,"ft-icon":_c,"ft-radio":af},pf.styles=ff,df([we({type:String})],pf.prototype,"filterId",void 0),df([we({type:Object})],pf.prototype,"parent",void 0),df([we({type:Array})],pf.prototype,"options",void 0),df([we({type:Boolean})],pf.prototype,"multivalued",void 0),df([we({type:Boolean})],pf.prototype,"disabled",void 0),df([we({type:Boolean})],pf.prototype,"hideSelectedOptions",void 0),df([we({type:Boolean})],pf.prototype,"displayCount",void 0),df([we({type:Boolean})],pf.prototype,"preventNavigation",void 0),df([we({type:String})],pf.prototype,"filter",void 0),df([we({type:String})],pf.prototype,"moreValuesButtonLabel",void 0),df([we({type:String})],pf.prototype,"noValuesLabel",void 0),df([we({type:Number})],pf.prototype,"displayedValuesLimit",void 0),df([Ee(".ft-filter-level--container")],pf.prototype,"container",void 0),df([Se()],pf.prototype,"displayedPages",void 0);const uf={buttonsColor:wo.extend("--ft-snap-scroll-buttons-color","",Ci.colorPrimary),buttonsZIndex:wo.create("--ft-snap-scroll-buttons-z-index","","NUMBER","1"),gap:wo.create("--ft-snap-scroll-gap","","SIZE","0"),colorSurface:wo.external(Ci.colorSurface,"Design system")},gf=dt`
1502
1503
  .ft-snap-scroll {
1503
1504
  box-sizing: border-box;
1504
1505
  position: relative;
@@ -1762,7 +1763,7 @@ const gl=Symbol.for(""),yl=t=>{if(t?.r===gl)return t?._$litStatic$},bl=t=>({_$li
1762
1763
  slot:not([name]) {
1763
1764
  display: none;
1764
1765
  }
1765
- `];var If=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Rf extends CustomEvent{constructor(t){super("change",{detail:t})}}class Lf extends Mr{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.lastLevelHasHiddenvalues=!1,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new lo(300),this.changeDebouncer=new lo(10),this.lastDispatchedValues=[]}get flatOptions(){return po(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get childrenFilteredFlatOptions(){return po(this.options,(t=>{var e;return t.selected?[]:null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.childrenFilteredFlatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){const t=this.flatOptions.some((t=>t.selected)),e=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,o=this.filterPlaceHolder.replace("{0}",this.label);return Jt`
1766
+ `];var If=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Rf extends CustomEvent{constructor(t){super("change",{detail:t})}}class Lf extends Mr{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.displayCount=!1,this.displayedValuesLimit=0,this.hideClearButton=!1,this.lastLevelHasHiddenvalues=!1,this.withScroll=!1,this.filter="",this.displayedLevels=[],this.scrollResizeObserver=new ResizeObserver((()=>this.updateScroll())),this.levelsScrollDebouncer=new lo(300),this.changeDebouncer=new lo(10),this.lastDispatchedValues=[]}get flatOptions(){return po(this.options,(t=>{var e;return null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get childrenFilteredFlatOptions(){return po(this.options,(t=>{var e;return t.selected?[]:null!==(e=t.subOptions)&&void 0!==e?e:[]}))}get selectedValues(){return this.childrenFilteredFlatOptions.filter((t=>t.selected)).map((t=>t.value))}render(){const t=this.flatOptions.some((t=>t.selected)),e=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,o=this.filterPlaceHolder.replace("{0}",this.label);return Jt`
1766
1767
  <div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
1767
1768
  part="container">
1768
1769
  ${this.label||t?Jt`
@@ -1804,6 +1805,7 @@ const gl=Symbol.for(""),yl=t=>{if(t?.r===gl)return t?._$litStatic$},bl=t=>({_$li
1804
1805
  filterId="${this.id}"
1805
1806
  ?multivalued=${this.multivalued}
1806
1807
  ?disabled=${this.disabled}
1808
+ ?displayCount="${this.displayCount}"
1807
1809
  preventNavigation
1808
1810
  .options=${e}
1809
1811
  @change=${this.onChange}
@@ -1827,6 +1829,7 @@ const gl=Symbol.for(""),yl=t=>{if(t?.r===gl)return t?._$litStatic$},bl=t=>({_$li
1827
1829
  ?multivalued=${this.multivalued}
1828
1830
  ?disabled=${this.disabled||"ft-filter--level-center"!==t}
1829
1831
  ?hideSelectedOptions=${this.raiseSelectedOptions}
1832
+ ?displayCount="${this.displayCount}"
1830
1833
  .parent=${o}
1831
1834
  .options=${e}
1832
1835
  .displayedValuesLimit=${this.displayedValuesLimit}
@@ -1837,7 +1840,7 @@ const gl=Symbol.for(""),yl=t=>{if(t?.r===gl)return t?._$litStatic$},bl=t=>({_$li
1837
1840
  .exportpartsPrefixes=${["values","available-values"]}
1838
1841
  noValuesLabel="${this.noValuesLabel}"
1839
1842
  ></ft-filter-level>
1840
- `}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 o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;go(this.lastDispatchedValues,t)||(this.dispatchEvent(new Rf(t)),this.lastDispatchedValues=t)}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)}}Lf.elementDefinitions={"ft-button":fh,"ft-filter-level":pf,"ft-snap-scroll":mf,"ft-typography":Bc},Lf.styles=kf,If([we({type:String})],Lf.prototype,"id",void 0),If([we({type:String})],Lf.prototype,"label",void 0),If([we({type:String})],Lf.prototype,"filterPlaceHolder",void 0),If([we({type:String})],Lf.prototype,"clearButtonLabel",void 0),If([we({type:String})],Lf.prototype,"moreValuesButtonLabel",void 0),If([we({type:String})],Lf.prototype,"noValuesLabel",void 0),If([mo([])],Lf.prototype,"options",void 0),If([we({type:Boolean})],Lf.prototype,"multivalued",void 0),If([we({type:Boolean})],Lf.prototype,"disabled",void 0),If([we({type:Boolean})],Lf.prototype,"raiseSelectedOptions",void 0),If([we({type:Number})],Lf.prototype,"displayedValuesLimit",void 0),If([we({type:Boolean})],Lf.prototype,"hideClearButton",void 0),If([Ee(".ft-filter--slot")],Lf.prototype,"slotElement",void 0),If([Ee(".ft-filter--container")],Lf.prototype,"container",void 0),If([Ee(".ft-filter--values")],Lf.prototype,"valuesContainer",void 0),If([Ee(".ft-filter--levels")],Lf.prototype,"levelsContainer",void 0),If([Se()],Lf.prototype,"lastLevelHasHiddenvalues",void 0),If([Ee(".ft-filter--filter input")],Lf.prototype,"filterInput",void 0),If([ke(".ft-filter--levels ft-filter-level")],Lf.prototype,"levels",void 0),If([Se()],Lf.prototype,"withScroll",void 0),If([Se()],Lf.prototype,"filter",void 0),If([Se()],Lf.prototype,"slideIn",void 0),If([Se()],Lf.prototype,"slideOut",void 0);var Uf=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class zf extends Mr{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return Jt`
1843
+ `}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 o=this.flatOptions.find((e=>e.value===t.detail.value));o.selected=!o.selected;const i=t=>{var e;t!==o&&(t.selected=!1),null===(e=t.subOptions)||void 0===e||e.forEach(i)};this.multivalued?null===(e=o.subOptions)||void 0===e||e.forEach(i):this.options.forEach(i),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run((()=>{var t;this.sendEventIfValuesChanged(),this.requestUpdate(),null===(t=this.levels)||void 0===t||t.forEach((t=>t.requestUpdate()))}))}sendEventIfValuesChanged(){const t=this.selectedValues;go(this.lastDispatchedValues,t)||(this.dispatchEvent(new Rf(t)),this.lastDispatchedValues=t)}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)}}Lf.elementDefinitions={"ft-button":fh,"ft-filter-level":pf,"ft-snap-scroll":mf,"ft-typography":Bc},Lf.styles=kf,If([we({type:String})],Lf.prototype,"id",void 0),If([we({type:String})],Lf.prototype,"label",void 0),If([we({type:String})],Lf.prototype,"filterPlaceHolder",void 0),If([we({type:String})],Lf.prototype,"clearButtonLabel",void 0),If([we({type:String})],Lf.prototype,"moreValuesButtonLabel",void 0),If([we({type:String})],Lf.prototype,"noValuesLabel",void 0),If([mo([])],Lf.prototype,"options",void 0),If([we({type:Boolean})],Lf.prototype,"multivalued",void 0),If([we({type:Boolean})],Lf.prototype,"disabled",void 0),If([we({type:Boolean})],Lf.prototype,"raiseSelectedOptions",void 0),If([we({type:Boolean})],Lf.prototype,"displayCount",void 0),If([we({type:Number})],Lf.prototype,"displayedValuesLimit",void 0),If([we({type:Boolean})],Lf.prototype,"hideClearButton",void 0),If([Ee(".ft-filter--slot")],Lf.prototype,"slotElement",void 0),If([Ee(".ft-filter--container")],Lf.prototype,"container",void 0),If([Ee(".ft-filter--values")],Lf.prototype,"valuesContainer",void 0),If([Ee(".ft-filter--levels")],Lf.prototype,"levelsContainer",void 0),If([Se()],Lf.prototype,"lastLevelHasHiddenvalues",void 0),If([Ee(".ft-filter--filter input")],Lf.prototype,"filterInput",void 0),If([ke(".ft-filter--levels ft-filter-level")],Lf.prototype,"levels",void 0),If([Se()],Lf.prototype,"withScroll",void 0),If([Se()],Lf.prototype,"filter",void 0),If([Se()],Lf.prototype,"slideIn",void 0),If([Se()],Lf.prototype,"slideOut",void 0);var Uf=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class zf extends Mr{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return Jt`
1841
1844
  <slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
1842
1845
  `}updateSubOptionsFromSlot(t){t.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map((t=>t))}update(t){super.update(t),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}}zf.elementDefinitions={},Uf([we({type:String})],zf.prototype,"label",void 0),Uf([we({type:Object,converter:t=>t})],zf.prototype,"value",void 0),Uf([we({type:Boolean,reflect:!0})],zf.prototype,"selected",void 0),Uf([we({type:Object})],zf.prototype,"subOptions",void 0),Uf([mo({})],zf.prototype,"renderOption",void 0),Uf([Ee(".ft-filter-option--slot")],zf.prototype,"slotElement",void 0),bo("ft-filter")(Lf),bo("ft-filter-option")(zf);const Wf=Bh.build("designedSearchType"),Bf={label:"Search scope",documentTitlesOnly:"Search in document titles only"};var Af=function(t,e,o,i){for(var r,n=arguments.length,a=n<3?e:null===i?i=Object.getOwnPropertyDescriptor(e,o):i,s=t.length-1;s>=0;s--)(r=t[s])&&(a=(n<3?r(a):n>3?r(e,o,a):r(e,o))||a);return n>3&&a&&Object.defineProperty(e,o,a),a};class Ff extends(Rh(il)){constructor(){super(),this.addI18nContext(Wf,Bf)}render(){return Jt`
1843
1846
  <ft-filter
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-search-selected-facets",
3
- "version": "1.1.61",
3
+ "version": "1.1.63",
4
4
  "description": "List of selected facets in a designed search page context",
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-chip": "1.1.61",
23
- "@fluid-topics/ft-search-context": "1.1.61",
24
- "@fluid-topics/ft-search-type": "1.1.61",
25
- "@fluid-topics/ft-tooltip": "1.1.61",
26
- "@fluid-topics/ft-wc-utils": "1.1.61",
22
+ "@fluid-topics/ft-chip": "1.1.63",
23
+ "@fluid-topics/ft-search-context": "1.1.63",
24
+ "@fluid-topics/ft-search-type": "1.1.63",
25
+ "@fluid-topics/ft-tooltip": "1.1.63",
26
+ "@fluid-topics/ft-wc-utils": "1.1.63",
27
27
  "lit": "3.1.0"
28
28
  },
29
- "gitHead": "97003a21f5dfb4845af84e174266f48a22517b90"
29
+ "gitHead": "6f2845e11b1b3a26814c32cacd5413802aa28157"
30
30
  }