@fluid-topics/ft-filter 1.1.94 → 1.1.96

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.
@@ -1049,7 +1049,7 @@ Also for action icons.`,n.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1049
1049
  @change=${this.onChange}
1050
1050
  @keydown=${this.onKeyDown}
1051
1051
  ></slot>
1052
- `}connectedCallback(){super.connectedCallback(),this.addEventListener("focus",this.onFocus),this.addEventListener("focusout",this.onFocusOut)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focus",this.onFocus),this.removeEventListener("focusout",this.onFocusOut)}onSlotChange(){this.radioButtons.forEach(e=>e.name=this.name)}contentAvailableCallback(e){super.contentAvailableCallback(e),this.radioButtons.forEach(r=>r.setInputTabIndex(-1)),this.resolveCurrentSelectedIndex()}onChange(e){e.stopPropagation(),this.radioButtons.forEach(r=>r.checked=e.detail.value===r.value),this.dispatchEvent(new CustomEvent("change",{detail:e.detail.value})),this.resolveCurrentSelectedIndex()}onKeyDown(e){let r=!1;switch(e.key){case"ArrowUp":case"ArrowLeft":{r=!0;let i=this.currentSelectedIndex-1;this.radioButtons[i<0?this.radioButtons.length-1:i].select(),this.radioButtons[i<0?this.radioButtons.length-1:i].focus();break}case"ArrowDown":case"ArrowRight":{r=!0;let i=this.currentSelectedIndex+1;this.radioButtons[i>this.radioButtons.length-1?0:i].select(),this.radioButtons[i>this.radioButtons.length-1?0:i].focus();break}case"Enter":this.radioButtons[this.currentSelectedIndex].select()}r&&(e.stopPropagation(),e.preventDefault())}resolveCurrentSelectedIndex(){let e=this.radioButtons.findIndex(r=>r.checked);e==-1?(this.currentSelectedIndex=0,this.radioButtons[0].select()):this.currentSelectedIndex=e}focusCurrentChecked(){this.radioButtons[this.currentSelectedIndex].focus()}};yt.elementDefinitions={};yt.styles=mn;Ee([(0,Ht.property)()],yt.prototype,"name",void 0);Ee([(0,Ht.property)({reflect:!0,attribute:"role"})],yt.prototype,"role",void 0);Ee([(0,Ht.property)({reflect:!0})],yt.prototype,"tabIndex",void 0);Ee([(0,Ht.property)({reflect:!0,attribute:"aria-labelledby"})],yt.prototype,"ariaLabelledBy",void 0);Ee([(0,Ht.queryAssignedElements)()],yt.prototype,"radioButtons",void 0);Ee([(0,Ht.state)()],yt.prototype,"currentSelectedIndex",void 0);(0,zo.customElement)("ft-radio")(Y);(0,zo.customElement)("ft-radio-group")(yt);var bn=f(L()),P=f(S());var so={borderRadiusM:P.FtCssVariableFactory.external(P.designSystemVariables.borderRadiusM,"Design system"),colorOutline:P.FtCssVariableFactory.external(P.designSystemVariables.colorOutline,"Design system"),colorOnSurface:P.FtCssVariableFactory.external(P.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:P.FtCssVariableFactory.external(P.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:P.FtCssVariableFactory.external(P.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:P.FtCssVariableFactory.external(P.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:P.FtCssVariableFactory.external(P.designSystemVariables.colorOnPrimary,"Design system"),fontFamily:P.FtCssVariableFactory.external(st.fontFamily,"Body2 typography"),fontSize:P.FtCssVariableFactory.external(st.fontSize,"Body2 typography"),fontWeight:P.FtCssVariableFactory.external(st.fontWeight,"Body2 typography"),letterSpacing:P.FtCssVariableFactory.external(st.letterSpacing,"Body2 typography"),lineHeight:P.FtCssVariableFactory.external(st.lineHeight,"Body2 typography"),textTransform:P.FtCssVariableFactory.external(st.textTransform,"Body2 typography")},xn=bn.css`
1052
+ `}connectedCallback(){super.connectedCallback(),this.addEventListener("focus",this.onFocus),this.addEventListener("focusout",this.onFocusOut)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener("focus",this.onFocus),this.removeEventListener("focusout",this.onFocusOut)}onSlotChange(){this.radioButtons.forEach(e=>e.name=this.name)}contentAvailableCallback(e){super.contentAvailableCallback(e),this.radioButtons.forEach(r=>r.setInputTabIndex(-1)),this.resolveCurrentSelectedIndex()}onChange(e){e.stopPropagation(),this.radioButtons.forEach(r=>r.checked=e.detail.value===r.value),this.dispatchEvent(new CustomEvent("change",{detail:e.detail.value})),this.resolveCurrentSelectedIndex()}onKeyDown(e){let r=!1;switch(e.key){case"ArrowUp":case"ArrowLeft":{r=!0;let i=this.currentSelectedIndex-1;this.radioButtons[i<0?this.radioButtons.length-1:i].select(),this.radioButtons[i<0?this.radioButtons.length-1:i].focus();break}case"ArrowDown":case"ArrowRight":{r=!0;let i=this.currentSelectedIndex+1;this.radioButtons[i>this.radioButtons.length-1?0:i].select(),this.radioButtons[i>this.radioButtons.length-1?0:i].focus();break}case"Enter":this.radioButtons[this.currentSelectedIndex].select()}r&&(e.stopPropagation(),e.preventDefault())}resolveCurrentSelectedIndex(){let e=this.radioButtons.findIndex(r=>r.checked);e==-1?(this.currentSelectedIndex=0,this.radioButtons[0].select()):this.currentSelectedIndex=e}focusCurrentChecked(){this.radioButtons[this.currentSelectedIndex].focus()}};yt.elementDefinitions={};yt.styles=mn;Ee([(0,Ht.property)()],yt.prototype,"name",void 0);Ee([(0,Ht.property)({reflect:!0,attribute:"role"})],yt.prototype,"role",void 0);Ee([(0,Ht.property)({reflect:!0})],yt.prototype,"tabIndex",void 0);Ee([(0,Ht.property)({reflect:!0,attribute:"aria-labelledby"})],yt.prototype,"ariaLabelledBy",void 0);Ee([(0,Ht.queryAssignedElements)()],yt.prototype,"radioButtons",void 0);Ee([(0,Ht.state)()],yt.prototype,"currentSelectedIndex",void 0);(0,zo.customElement)("ft-radio")(Y);(0,zo.customElement)("ft-radio-group")(yt);var bn=f(L()),I=f(S());var so={borderRadiusM:I.FtCssVariableFactory.external(I.designSystemVariables.borderRadiusM,"Design system"),colorOutline:I.FtCssVariableFactory.external(I.designSystemVariables.colorOutline,"Design system"),colorOnSurface:I.FtCssVariableFactory.external(I.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:I.FtCssVariableFactory.external(I.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorOnSurfaceDisabled:I.FtCssVariableFactory.external(I.designSystemVariables.colorOnSurfaceDisabled,"Design system"),colorPrimary:I.FtCssVariableFactory.external(I.designSystemVariables.colorPrimary,"Design system"),colorOnPrimary:I.FtCssVariableFactory.external(I.designSystemVariables.colorOnPrimary,"Design system"),fontFamily:I.FtCssVariableFactory.external(st.fontFamily,"Body2 typography"),fontSize:I.FtCssVariableFactory.external(st.fontSize,"Body2 typography"),fontWeight:I.FtCssVariableFactory.external(st.fontWeight,"Body2 typography"),letterSpacing:I.FtCssVariableFactory.external(st.letterSpacing,"Body2 typography"),lineHeight:I.FtCssVariableFactory.external(st.lineHeight,"Body2 typography"),textTransform:I.FtCssVariableFactory.external(st.textTransform,"Body2 typography")},xn=bn.css`
1053
1053
  .ft-filter-level--container {
1054
1054
  display: flex;
1055
1055
  flex-direction: column;
@@ -1099,7 +1099,7 @@ Also for action icons.`,n.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1099
1099
  }
1100
1100
 
1101
1101
  ft-button {
1102
- ${(0,P.setVariable)(k.color,so.colorOnSurface)};
1102
+ ${(0,I.setVariable)(k.color,so.colorOnSurface)};
1103
1103
  }
1104
1104
 
1105
1105
  ft-radio, ft-checkbox {
@@ -1330,7 +1330,7 @@ Also for action icons.`,n.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1330
1330
  @click=${this.next}
1331
1331
  ></ft-button>
1332
1332
  </div>
1333
- `}update(e){super.update(e),e.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),e.has("currentElement")&&this.dispatchEvent(new Wo(this.currentElement,this.elements[this.currentElement]))}contentAvailableCallback(e){var r;super.contentAvailableCallback(e),this.contentSlot&&this.listenedContainer!==this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,(r=this.listenedContainer)===null||r===void 0||r.addEventListener("scroll",this.updateScrollCallback))}onScroll(){this.scrollDebouncer.run(()=>this.snap()),this.scheduleUpdateScroll()}snap(){let e=this.closestElementFromStart();if(e!=null){let r=this.getDistanceFromStart(e);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<r&&(e=this.lastElement),this.scrollToElement(e)}}scrollToElement(e){var r,i;e&&(this.horizontal?(r=this.contentSlot)===null||r===void 0||r.scrollTo({left:this.getOffset(e)-this.controlsSize,behavior:"smooth"}):(i=this.contentSlot)===null||i===void 0||i.scrollTo({top:this.getOffset(e)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(e))}onSlotChange(){var e,r;this.elements=(r=(e=this.contentSlot)===null||e===void 0?void 0:e.assignedElements().map(i=>i))!==null&&r!==void 0?r:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let e=-1;for(let r=0;r<this.elements.length;r++)(e<0||this.getDistanceFromStart(this.elements[r])<this.getDistanceFromStart(this.elements[e]))&&(e=r);return e}scheduleUpdateScroll(){this.updateScrollDebouncer.run(()=>this.updateScroll())}updateScroll(){this.contentSlot!=null?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=this.contentSlot[this.scrollAttribute]===0,this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let e=this.elements[0];return e?e[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(e){return e[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(e){let r=e===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(e)-this.contentSlot[this.scrollAttribute]-r)}};V.elementDefinitions={"ft-button":ot};V.styles=On;At([(0,mt.property)({type:Boolean})],V.prototype,"horizontal",void 0);At([(0,mt.property)({type:Boolean})],V.prototype,"hideScrollbar",void 0);At([(0,mt.property)({type:Boolean})],V.prototype,"controls",void 0);At([(0,mt.property)({type:Boolean})],V.prototype,"limitSize",void 0);At([(0,mt.state)()],V.prototype,"elements",void 0);At([(0,mt.state)()],V.prototype,"currentElement",void 0);At([(0,mt.state)()],V.prototype,"withScroll",void 0);At([(0,mt.state)()],V.prototype,"startReached",void 0);At([(0,mt.state)()],V.prototype,"endReached",void 0);At([(0,mt.query)(".ft-snap-scroll--content")],V.prototype,"contentSlot",void 0);(0,Nn.customElement)("ft-snap-scroll")(V);var En=f(L()),B=f(S());var bt={colorOutline:B.FtCssVariableFactory.external(B.designSystemVariables.colorOutline,"Design system"),colorOnSurface:B.FtCssVariableFactory.external(B.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:B.FtCssVariableFactory.external(B.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorPrimary:B.FtCssVariableFactory.external(B.designSystemVariables.colorPrimary,"Design system"),colorSurface:B.FtCssVariableFactory.external(B.designSystemVariables.colorSurface,"Design system"),transitionDuration:B.FtCssVariableFactory.external(B.designSystemVariables.transitionDuration,"Design system"),transitionTimingFunction:B.FtCssVariableFactory.external(B.designSystemVariables.transitionTimingFunction,"Design system"),labelColor:B.FtCssVariableFactory.extend("--ft-filter-label-color","",B.designSystemVariables.colorOnSurface),labelFontSize:B.FtCssVariableFactory.extend("--ft-filter-label-font-size","",b.fontSize,"16px")},Rn=[Xe,En.css`
1333
+ `}update(e){super.update(e),e.has("horizontal")&&(this.horizontal?(this.offsetAttribute="offsetLeft",this.scrollAttribute="scrollLeft",this.sizeAttribute="clientWidth",this.scrollSizeAttribute="scrollWidth"):(this.offsetAttribute="offsetTop",this.scrollAttribute="scrollTop",this.sizeAttribute="clientHeight",this.scrollSizeAttribute="scrollHeight")),e.has("currentElement")&&this.dispatchEvent(new Wo(this.currentElement,this.elements[this.currentElement]))}contentAvailableCallback(e){var r;super.contentAvailableCallback(e),this.contentSlot&&this.listenedContainer!==this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,(r=this.listenedContainer)===null||r===void 0||r.addEventListener("scroll",this.updateScrollCallback))}onScroll(){this.scrollDebouncer.run(()=>this.snap()),this.scheduleUpdateScroll()}snap(){let e=this.closestElementFromStart();if(e!=null){let r=this.getDistanceFromStart(e);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<r&&(e=this.lastElement),this.scrollToElement(e)}}scrollToElement(e){var r,i;e&&(this.horizontal?(r=this.contentSlot)===null||r===void 0||r.scrollTo({left:this.getOffset(e)-this.controlsSize,behavior:"smooth"}):(i=this.contentSlot)===null||i===void 0||i.scrollTo({top:this.getOffset(e)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(e))}onSlotChange(){var e,r;this.elements=(r=(e=this.contentSlot)===null||e===void 0?void 0:e.assignedElements().map(i=>i))!==null&&r!==void 0?r:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let e=-1;for(let r=0;r<this.elements.length;r++)(e<0||this.getDistanceFromStart(this.elements[r])<this.getDistanceFromStart(this.elements[e]))&&(e=r);return e}scheduleUpdateScroll(){this.updateScrollDebouncer.run(()=>this.updateScroll())}updateScroll(){this.contentSlot!=null?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=this.contentSlot[this.scrollAttribute]===0,this.endReached=this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]+1>=this.contentSlot[this.scrollSizeAttribute]):(this.withScroll=!1,this.startReached=!0,this.endReached=!0)}get lastElement(){return this.elements[this.elements.length-1]}get firstElementOffset(){let e=this.elements[0];return e?e[this.offsetAttribute]:0}get controlsSize(){return this.controls?36:0}get nextSize(){return this.endReached?0:this.controlsSize}get prevSize(){return this.startReached?0:this.controlsSize}getOffset(e){return e[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(e){let r=e===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(e)-this.contentSlot[this.scrollAttribute]-r)}};V.elementDefinitions={"ft-button":ot};V.styles=On;At([(0,mt.property)({type:Boolean})],V.prototype,"horizontal",void 0);At([(0,mt.property)({type:Boolean})],V.prototype,"hideScrollbar",void 0);At([(0,mt.property)({type:Boolean})],V.prototype,"controls",void 0);At([(0,mt.property)({type:Boolean})],V.prototype,"limitSize",void 0);At([(0,mt.state)()],V.prototype,"elements",void 0);At([(0,mt.state)()],V.prototype,"currentElement",void 0);At([(0,mt.state)()],V.prototype,"withScroll",void 0);At([(0,mt.state)()],V.prototype,"startReached",void 0);At([(0,mt.state)()],V.prototype,"endReached",void 0);At([(0,mt.query)(".ft-snap-scroll--content")],V.prototype,"contentSlot",void 0);(0,Nn.customElement)("ft-snap-scroll")(V);var En=f(L()),P=f(S());var bt={colorOutline:P.FtCssVariableFactory.external(P.designSystemVariables.colorOutline,"Design system"),colorOnSurface:P.FtCssVariableFactory.external(P.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:P.FtCssVariableFactory.external(P.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorPrimary:P.FtCssVariableFactory.external(P.designSystemVariables.colorPrimary,"Design system"),colorSurface:P.FtCssVariableFactory.external(P.designSystemVariables.colorSurface,"Design system"),transitionDuration:P.FtCssVariableFactory.external(P.designSystemVariables.transitionDuration,"Design system"),transitionTimingFunction:P.FtCssVariableFactory.external(P.designSystemVariables.transitionTimingFunction,"Design system"),labelColor:P.FtCssVariableFactory.extend("--ft-filter-label-color","",P.designSystemVariables.colorOnSurface),labelFontSize:P.FtCssVariableFactory.extend("--ft-filter-label-font-size","",b.fontSize,"16px")},Rn=[Xe,P.noTextInputDefaultClearButton,En.css`
1334
1334
  :host {
1335
1335
  display: flex;
1336
1336
  max-height: 100%;
@@ -1357,7 +1357,7 @@ Also for action icons.`,n.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1357
1357
  .ft-filter--header ft-button {
1358
1358
  flex-shrink: 0;
1359
1359
  margin-left: auto;
1360
- ${(0,B.setVariable)(k.iconSize,"18px")};
1360
+ ${(0,P.setVariable)(k.iconSize,"18px")};
1361
1361
  }
1362
1362
  .filter-label {
1363
1363
  display: contents;
@@ -1370,8 +1370,8 @@ Also for action icons.`,n.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1370
1370
  word-break: break-word;
1371
1371
  color: ${bt.labelColor};
1372
1372
  font-size: ${bt.labelFontSize};
1373
- ${(0,B.setVariable)(b.lineHeight,"22px")};
1374
- ${(0,B.setVariable)(b.fontWeight,"bold")};
1373
+ ${(0,P.setVariable)(b.lineHeight,"22px")};
1374
+ ${(0,P.setVariable)(b.fontWeight,"bold")};
1375
1375
  }
1376
1376
 
1377
1377
  .ft-filter--filter {
@@ -1445,7 +1445,7 @@ Also for action icons.`,n.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1445
1445
  slot:not([name]) {
1446
1446
  display: none;
1447
1447
  }
1448
- `];var I=function(o,e,r,i){var l=arguments.length,a=l<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(o,e,r,i);else for(var p=o.length-1;p>=0;p--)(c=o[p])&&(a=(l<3?c(a):l>3?c(e,r,a):c(e,r))||a);return l>3&&a&&Object.defineProperty(e,r,a),a},To=class extends CustomEvent{constructor(e){super("change",{detail:e})}},E=class extends xt.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 xt.Debouncer(300),this.changeDebouncer=new xt.Debouncer(10),this.lastDispatchedValues=[]}get flatOptions(){return(0,xt.flatDeep)(this.options,e=>{var r;return(r=e.subOptions)!==null&&r!==void 0?r:[]})}get childrenFilteredFlatOptions(){return(0,xt.flatDeep)(this.options,e=>{var r;return e.selected?[]:(r=e.subOptions)!==null&&r!==void 0?r:[]})}get selectedValues(){return this.childrenFilteredFlatOptions.filter(e=>e.selected).map(e=>e.value)}render(){let e=this.flatOptions.some(l=>l.selected),r=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,i=this.filterPlaceHolder.replace("{0}",this.label);return ie.html`
1448
+ `];var B=function(o,e,r,i){var l=arguments.length,a=l<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(o,e,r,i);else for(var p=o.length-1;p>=0;p--)(c=o[p])&&(a=(l<3?c(a):l>3?c(e,r,a):c(e,r))||a);return l>3&&a&&Object.defineProperty(e,r,a),a},To=class extends CustomEvent{constructor(e){super("change",{detail:e})}},E=class extends xt.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 xt.Debouncer(300),this.changeDebouncer=new xt.Debouncer(10),this.lastDispatchedValues=[]}get flatOptions(){return(0,xt.flatDeep)(this.options,e=>{var r;return(r=e.subOptions)!==null&&r!==void 0?r:[]})}get childrenFilteredFlatOptions(){return(0,xt.flatDeep)(this.options,e=>{var r;return e.selected?[]:(r=e.subOptions)!==null&&r!==void 0?r:[]})}get selectedValues(){return this.childrenFilteredFlatOptions.filter(e=>e.selected).map(e=>e.value)}render(){let e=this.flatOptions.some(l=>l.selected),r=this.withScroll||this.filter||this.lastLevelHasHiddenvalues,i=this.filterPlaceHolder.replace("{0}",this.label);return ie.html`
1449
1449
  <div class="ft-filter--container ${this.disabled?"ft-filter--disabled":""}"
1450
1450
  part="container">
1451
1451
  ${!this.label&&!e?null:ie.html`
@@ -1522,7 +1522,7 @@ Also for action icons.`,n.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
1522
1522
  .exportpartsPrefixes=${["values","available-values"]}
1523
1523
  noValuesLabel="${this.noValuesLabel}"
1524
1524
  ></ft-filter-level>
1525
- `}goBack(e){this.slideOut=e.detail.value}onDisplayLevel(e){this.displayedLevels.push(e.detail.value),this.slideIn=e.detail.value}clear(){if(this.flatOptions.forEach(e=>e.selected=!1),this.displayedLevels.length>0){let e=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[e],this.slideOut=e}this.optionsChanged()}onChange(e){var r;e.stopPropagation();let i=this.flatOptions.find(a=>a.value===e.detail.value);i.selected=!i.selected;let l=a=>{var c;a!==i&&(a.selected=!1),(c=a.subOptions)===null||c===void 0||c.forEach(l)};this.multivalued?(r=i.subOptions)===null||r===void 0||r.forEach(l):this.options.forEach(l),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run(()=>{var e;this.sendEventIfValuesChanged(),this.requestUpdate(),(e=this.levels)===null||e===void 0||e.forEach(r=>r.requestUpdate())})}sendEventIfValuesChanged(){let e=this.selectedValues;(0,xt.deepEqual)(this.lastDispatchedValues,e)||(this.dispatchEvent(new To(e)),this.lastDispatchedValues=e)}updateOptionsFromSlot(e){e.stopPropagation(),this.options=this.slotElement.assignedElements().map(r=>r),this.optionsChanged()}onFilterChange(){var e,r;this.filter=(r=(e=this.filterInput)===null||e===void 0?void 0:e.value)!==null&&r!==void 0?r:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}};E.elementDefinitions={"ft-button":ot,"ft-filter-level":W,"ft-snap-scroll":V,"ft-typography":F};E.styles=Rn;I([(0,$.property)({type:String})],E.prototype,"id",void 0);I([(0,$.property)({type:String})],E.prototype,"label",void 0);I([(0,$.property)({type:String})],E.prototype,"filterPlaceHolder",void 0);I([(0,$.property)({type:String})],E.prototype,"clearButtonLabel",void 0);I([(0,$.property)({type:String})],E.prototype,"moreValuesButtonLabel",void 0);I([(0,$.property)({type:String})],E.prototype,"noValuesLabel",void 0);I([(0,xt.jsonProperty)([])],E.prototype,"options",void 0);I([(0,$.property)({type:Boolean})],E.prototype,"multivalued",void 0);I([(0,$.property)({type:Boolean})],E.prototype,"disabled",void 0);I([(0,$.property)({type:Boolean})],E.prototype,"raiseSelectedOptions",void 0);I([(0,$.property)({type:Boolean})],E.prototype,"displayCount",void 0);I([(0,$.property)({type:Number})],E.prototype,"displayedValuesLimit",void 0);I([(0,$.property)({type:Boolean})],E.prototype,"hideClearButton",void 0);I([(0,$.query)(".ft-filter--slot")],E.prototype,"slotElement",void 0);I([(0,$.query)(".ft-filter--container")],E.prototype,"container",void 0);I([(0,$.query)(".ft-filter--values")],E.prototype,"valuesContainer",void 0);I([(0,$.query)(".ft-filter--levels")],E.prototype,"levelsContainer",void 0);I([(0,$.state)()],E.prototype,"lastLevelHasHiddenvalues",void 0);I([(0,$.query)(".ft-filter--filter input")],E.prototype,"filterInput",void 0);I([(0,$.queryAll)(".ft-filter--levels ft-filter-level")],E.prototype,"levels",void 0);I([(0,$.state)()],E.prototype,"withScroll",void 0);I([(0,$.state)()],E.prototype,"filter",void 0);I([(0,$.state)()],E.prototype,"slideIn",void 0);I([(0,$.state)()],E.prototype,"slideOut",void 0);var fo=f(S()),ne=f(J()),Ln=f(L()),Re=function(o,e,r,i){var l=arguments.length,a=l<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(o,e,r,i);else for(var p=o.length-1;p>=0;p--)(c=o[p])&&(a=(l<3?c(a):l>3?c(e,r,a):c(e,r))||a);return l>3&&a&&Object.defineProperty(e,r,a),a},Ct=class extends fo.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return Ln.html`
1525
+ `}goBack(e){this.slideOut=e.detail.value}onDisplayLevel(e){this.displayedLevels.push(e.detail.value),this.slideIn=e.detail.value}clear(){if(this.flatOptions.forEach(e=>e.selected=!1),this.displayedLevels.length>0){let e=this.displayedLevels[this.displayedLevels.length-1];this.displayedLevels=[e],this.slideOut=e}this.optionsChanged()}onChange(e){var r;e.stopPropagation();let i=this.flatOptions.find(a=>a.value===e.detail.value);i.selected=!i.selected;let l=a=>{var c;a!==i&&(a.selected=!1),(c=a.subOptions)===null||c===void 0||c.forEach(l)};this.multivalued?(r=i.subOptions)===null||r===void 0||r.forEach(l):this.options.forEach(l),this.optionsChanged()}optionsChanged(){this.changeDebouncer.run(()=>{var e;this.sendEventIfValuesChanged(),this.requestUpdate(),(e=this.levels)===null||e===void 0||e.forEach(r=>r.requestUpdate())})}sendEventIfValuesChanged(){let e=this.selectedValues;(0,xt.deepEqual)(this.lastDispatchedValues,e)||(this.dispatchEvent(new To(e)),this.lastDispatchedValues=e)}updateOptionsFromSlot(e){e.stopPropagation(),this.options=this.slotElement.assignedElements().map(r=>r),this.optionsChanged()}onFilterChange(){var e,r;this.filter=(r=(e=this.filterInput)===null||e===void 0?void 0:e.value)!==null&&r!==void 0?r:""}updateScroll(){this.valuesContainer&&(this.withScroll=this.valuesContainer.scrollHeight>this.valuesContainer.clientHeight)}};E.elementDefinitions={"ft-button":ot,"ft-filter-level":W,"ft-snap-scroll":V,"ft-typography":F};E.styles=Rn;B([(0,$.property)({type:String})],E.prototype,"id",void 0);B([(0,$.property)({type:String})],E.prototype,"label",void 0);B([(0,$.property)({type:String})],E.prototype,"filterPlaceHolder",void 0);B([(0,$.property)({type:String})],E.prototype,"clearButtonLabel",void 0);B([(0,$.property)({type:String})],E.prototype,"moreValuesButtonLabel",void 0);B([(0,$.property)({type:String})],E.prototype,"noValuesLabel",void 0);B([(0,xt.jsonProperty)([])],E.prototype,"options",void 0);B([(0,$.property)({type:Boolean})],E.prototype,"multivalued",void 0);B([(0,$.property)({type:Boolean})],E.prototype,"disabled",void 0);B([(0,$.property)({type:Boolean})],E.prototype,"raiseSelectedOptions",void 0);B([(0,$.property)({type:Boolean})],E.prototype,"displayCount",void 0);B([(0,$.property)({type:Number})],E.prototype,"displayedValuesLimit",void 0);B([(0,$.property)({type:Boolean})],E.prototype,"hideClearButton",void 0);B([(0,$.query)(".ft-filter--slot")],E.prototype,"slotElement",void 0);B([(0,$.query)(".ft-filter--container")],E.prototype,"container",void 0);B([(0,$.query)(".ft-filter--values")],E.prototype,"valuesContainer",void 0);B([(0,$.query)(".ft-filter--levels")],E.prototype,"levelsContainer",void 0);B([(0,$.state)()],E.prototype,"lastLevelHasHiddenvalues",void 0);B([(0,$.query)(".ft-filter--filter input")],E.prototype,"filterInput",void 0);B([(0,$.queryAll)(".ft-filter--levels ft-filter-level")],E.prototype,"levels",void 0);B([(0,$.state)()],E.prototype,"withScroll",void 0);B([(0,$.state)()],E.prototype,"filter",void 0);B([(0,$.state)()],E.prototype,"slideIn",void 0);B([(0,$.state)()],E.prototype,"slideOut",void 0);var fo=f(S()),ne=f(J()),Ln=f(L()),Re=function(o,e,r,i){var l=arguments.length,a=l<3?e:i===null?i=Object.getOwnPropertyDescriptor(e,r):i,c;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")a=Reflect.decorate(o,e,r,i);else for(var p=o.length-1;p>=0;p--)(c=o[p])&&(a=(l<3?c(a):l>3?c(e,r,a):c(e,r))||a);return l>3&&a&&Object.defineProperty(e,r,a),a},Ct=class extends fo.FtLitElement{constructor(){super(...arguments),this.label="",this.value=null,this.selected=!1,this.subOptions=[]}render(){return Ln.html`
1526
1526
  <slot class="ft-filter-option--slot" @slotchange=${this.updateSubOptionsFromSlot}></slot>
1527
1527
  `}updateSubOptionsFromSlot(e){e.stopPropagation(),this.subOptions=this.slotElement.assignedElements().map(r=>r)}update(e){super.update(e),this.dispatchEvent(new CustomEvent("option-change",{detail:this,bubbles:!0}))}};Ct.elementDefinitions={};Re([(0,ne.property)({type:String})],Ct.prototype,"label",void 0);Re([(0,ne.property)({type:Object,converter:o=>o})],Ct.prototype,"value",void 0);Re([(0,ne.property)({type:Boolean,reflect:!0})],Ct.prototype,"selected",void 0);Re([(0,ne.property)({type:Object})],Ct.prototype,"subOptions",void 0);Re([(0,fo.jsonProperty)({})],Ct.prototype,"renderOption",void 0);Re([(0,ne.query)(".ft-filter-option--slot")],Ct.prototype,"slotElement",void 0);(0,_o.customElement)("ft-filter")(E);(0,_o.customElement)("ft-filter-option")(Ct);})();
1528
1528
  /*! Bundled license information: