@fluid-topics/ft-filter 1.1.21 → 1.1.22

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.
@@ -11,7 +11,7 @@ export const FtFilterCssVariables = {
11
11
  transitionDuration: FtCssVariableFactory.external(designSystemVariables.transitionDuration, "Design system"),
12
12
  transitionTimingFunction: FtCssVariableFactory.external(designSystemVariables.transitionTimingFunction, "Design system"),
13
13
  labelColor: FtCssVariableFactory.extend("--ft-filter-label-color", "", designSystemVariables.colorOnSurface),
14
- labelFontSize: FtCssVariableFactory.extend("--ft-filter-label-font-size", "", FtTypographyCssVariables.fontSize, "14px"),
14
+ labelFontSize: FtCssVariableFactory.extend("--ft-filter-label-font-size", "", FtTypographyCssVariables.fontSize, "16px"),
15
15
  };
16
16
  export const styles = [
17
17
  FtTypographyCaption,
@@ -1294,7 +1294,7 @@ const G=Symbol.for(""),T=t=>{if(t?.r===G)return t?._$litStatic$},P=t=>({_$litSta
1294
1294
  @click=${this.next}
1295
1295
  ></ft-button>
1296
1296
  </div>
1297
- `}update(t){super.update(t),t.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")),t.has("currentElement")&&this.dispatchEvent(new Ki(this.currentElement,this.elements[this.currentElement]))}contentAvailableCallback(t){var o;super.contentAvailableCallback(t),this.contentSlot&&this.listenedContainer!==this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(o=this.listenedContainer)||void 0===o||o.addEventListener("scroll",this.updateScrollCallback))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const o=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<o&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var o,e;t&&(this.horizontal?null===(o=this.contentSlot)||void 0===o||o.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(e=this.contentSlot)||void 0===e||e.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,o;this.elements=null!==(o=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==o?o:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let o=0;o<this.elements.length;o++)(t<0||this.getDistanceFromStart(this.elements[o])<this.getDistanceFromStart(this.elements[t]))&&(t=o);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],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 t=this.elements[0];return t?t[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(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const o=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-o)}}Zi.elementDefinitions={"ft-button":ri},Zi.styles=Ui,zi([i.property({type:Boolean})],Zi.prototype,"horizontal",void 0),zi([i.property({type:Boolean})],Zi.prototype,"hideScrollbar",void 0),zi([i.property({type:Boolean})],Zi.prototype,"controls",void 0),zi([i.property({type:Boolean})],Zi.prototype,"limitSize",void 0),zi([i.state()],Zi.prototype,"elements",void 0),zi([i.state()],Zi.prototype,"currentElement",void 0),zi([i.state()],Zi.prototype,"withScroll",void 0),zi([i.state()],Zi.prototype,"startReached",void 0),zi([i.state()],Zi.prototype,"endReached",void 0),zi([i.query(".ft-snap-scroll--content")],Zi.prototype,"contentSlot",void 0),o.customElement("ft-snap-scroll")(Zi);const Bi={colorOutline:o.FtCssVariableFactory.external(o.designSystemVariables.colorOutline,"Design system"),colorOnSurface:o.FtCssVariableFactory.external(o.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:o.FtCssVariableFactory.external(o.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorPrimary:o.FtCssVariableFactory.external(o.designSystemVariables.colorPrimary,"Design system"),colorSurface:o.FtCssVariableFactory.external(o.designSystemVariables.colorSurface,"Design system"),transitionDuration:o.FtCssVariableFactory.external(o.designSystemVariables.transitionDuration,"Design system"),transitionTimingFunction:o.FtCssVariableFactory.external(o.designSystemVariables.transitionTimingFunction,"Design system"),labelColor:o.FtCssVariableFactory.extend("--ft-filter-label-color","",o.designSystemVariables.colorOnSurface),labelFontSize:o.FtCssVariableFactory.extend("--ft-filter-label-font-size","",it.fontSize,"14px")},Fi=[ao,e.css`
1297
+ `}update(t){super.update(t),t.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")),t.has("currentElement")&&this.dispatchEvent(new Ki(this.currentElement,this.elements[this.currentElement]))}contentAvailableCallback(t){var o;super.contentAvailableCallback(t),this.contentSlot&&this.listenedContainer!==this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(o=this.listenedContainer)||void 0===o||o.addEventListener("scroll",this.updateScrollCallback))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const o=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<o&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var o,e;t&&(this.horizontal?null===(o=this.contentSlot)||void 0===o||o.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(e=this.contentSlot)||void 0===e||e.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,o;this.elements=null!==(o=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==o?o:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let o=0;o<this.elements.length;o++)(t<0||this.getDistanceFromStart(this.elements[o])<this.getDistanceFromStart(this.elements[t]))&&(t=o);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],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 t=this.elements[0];return t?t[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(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const o=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-o)}}Zi.elementDefinitions={"ft-button":ri},Zi.styles=Ui,zi([i.property({type:Boolean})],Zi.prototype,"horizontal",void 0),zi([i.property({type:Boolean})],Zi.prototype,"hideScrollbar",void 0),zi([i.property({type:Boolean})],Zi.prototype,"controls",void 0),zi([i.property({type:Boolean})],Zi.prototype,"limitSize",void 0),zi([i.state()],Zi.prototype,"elements",void 0),zi([i.state()],Zi.prototype,"currentElement",void 0),zi([i.state()],Zi.prototype,"withScroll",void 0),zi([i.state()],Zi.prototype,"startReached",void 0),zi([i.state()],Zi.prototype,"endReached",void 0),zi([i.query(".ft-snap-scroll--content")],Zi.prototype,"contentSlot",void 0),o.customElement("ft-snap-scroll")(Zi);const Bi={colorOutline:o.FtCssVariableFactory.external(o.designSystemVariables.colorOutline,"Design system"),colorOnSurface:o.FtCssVariableFactory.external(o.designSystemVariables.colorOnSurface,"Design system"),colorOnSurfaceMedium:o.FtCssVariableFactory.external(o.designSystemVariables.colorOnSurfaceMedium,"Design system"),colorPrimary:o.FtCssVariableFactory.external(o.designSystemVariables.colorPrimary,"Design system"),colorSurface:o.FtCssVariableFactory.external(o.designSystemVariables.colorSurface,"Design system"),transitionDuration:o.FtCssVariableFactory.external(o.designSystemVariables.transitionDuration,"Design system"),transitionTimingFunction:o.FtCssVariableFactory.external(o.designSystemVariables.transitionTimingFunction,"Design system"),labelColor:o.FtCssVariableFactory.extend("--ft-filter-label-color","",o.designSystemVariables.colorOnSurface),labelFontSize:o.FtCssVariableFactory.extend("--ft-filter-label-font-size","",it.fontSize,"16px")},Fi=[ao,e.css`
1298
1298
  :host {
1299
1299
  display: flex;
1300
1300
  max-height: 100%;
@@ -1445,7 +1445,7 @@ function(t){return(e,o)=>{const{slot:i,selector:r}=t??{},n="slot"+(i?`[name=${i}
1445
1445
  @click=${this.next}
1446
1446
  ></ft-button>
1447
1447
  </div>
1448
- `}update(t){super.update(t),t.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")),t.has("currentElement")&&this.dispatchEvent(new aa(this.currentElement,this.elements[this.currentElement]))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),this.contentSlot&&this.listenedContainer!==this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(e=this.listenedContainer)||void 0===e||e.addEventListener("scroll",this.updateScrollCallback))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,o;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(o=this.contentSlot)||void 0===o||o.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],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 t=this.elements[0];return t?t[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(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}sa.elementDefinitions={"ft-button":En},sa.styles=ra,na([$({type:Boolean})],sa.prototype,"horizontal",void 0),na([$({type:Boolean})],sa.prototype,"hideScrollbar",void 0),na([$({type:Boolean})],sa.prototype,"controls",void 0),na([$({type:Boolean})],sa.prototype,"limitSize",void 0),na([C()],sa.prototype,"elements",void 0),na([C()],sa.prototype,"currentElement",void 0),na([C()],sa.prototype,"withScroll",void 0),na([C()],sa.prototype,"startReached",void 0),na([C()],sa.prototype,"endReached",void 0),na([E(".ft-snap-scroll--content")],sa.prototype,"contentSlot",void 0),W("ft-snap-scroll")(sa);const la={colorOutline:Ce.external(Le.colorOutline,"Design system"),colorOnSurface:Ce.external(Le.colorOnSurface,"Design system"),colorOnSurfaceMedium:Ce.external(Le.colorOnSurfaceMedium,"Design system"),colorPrimary:Ce.external(Le.colorPrimary,"Design system"),colorSurface:Ce.external(Le.colorSurface,"Design system"),transitionDuration:Ce.external(Le.transitionDuration,"Design system"),transitionTimingFunction:Ce.external(Le.transitionTimingFunction,"Design system"),labelColor:Ce.extend("--ft-filter-label-color","",Le.colorOnSurface),labelFontSize:Ce.extend("--ft-filter-label-font-size","",po.fontSize,"14px")},ca=[gi,$t`
1448
+ `}update(t){super.update(t),t.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")),t.has("currentElement")&&this.dispatchEvent(new aa(this.currentElement,this.elements[this.currentElement]))}contentAvailableCallback(t){var e;super.contentAvailableCallback(t),this.contentSlot&&this.listenedContainer!==this.contentSlot&&(this.resizeObserver.observe(this.contentSlot),this.listenedContainer&&this.listenedContainer.removeEventListener("scroll",this.updateScrollCallback),this.listenedContainer=this.contentSlot,null===(e=this.listenedContainer)||void 0===e||e.addEventListener("scroll",this.updateScrollCallback))}onScroll(){this.scrollDebouncer.run((()=>this.snap())),this.scheduleUpdateScroll()}snap(){let t=this.closestElementFromStart();if(null!=t){const e=this.getDistanceFromStart(t);Math.abs(this.contentSlot[this.scrollAttribute]+this.contentSlot[this.sizeAttribute]-this.contentSlot[this.scrollSizeAttribute])<e&&(t=this.lastElement),this.scrollToElement(t)}}scrollToElement(t){var e,o;t&&(this.horizontal?null===(e=this.contentSlot)||void 0===e||e.scrollTo({left:this.getOffset(t)-this.controlsSize,behavior:"smooth"}):null===(o=this.contentSlot)||void 0===o||o.scrollTo({top:this.getOffset(t)-this.controlsSize,behavior:"smooth"}),this.currentElement=this.elements.indexOf(t))}onSlotChange(){var t,e;this.elements=null!==(e=null===(t=this.contentSlot)||void 0===t?void 0:t.assignedElements().map((t=>t)))&&void 0!==e?e:[],this.scheduleUpdateScroll()}closestElementFromStart(){return this.elements[this.closestIndexFromStart()]}closestIndexFromStart(){let t=-1;for(let e=0;e<this.elements.length;e++)(t<0||this.getDistanceFromStart(this.elements[e])<this.getDistanceFromStart(this.elements[t]))&&(t=e);return t}scheduleUpdateScroll(){this.updateScrollDebouncer.run((()=>this.updateScroll()))}updateScroll(){null!=this.contentSlot?(this.withScroll=this.contentSlot[this.scrollSizeAttribute]>this.contentSlot[this.sizeAttribute],this.startReached=0===this.contentSlot[this.scrollAttribute],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 t=this.elements[0];return t?t[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(t){return t[this.offsetAttribute]-this.firstElementOffset}getDistanceFromStart(t){const e=t===this.elements[0]?0:this.controlsSize;return Math.abs(this.getOffset(t)-this.contentSlot[this.scrollAttribute]-e)}}sa.elementDefinitions={"ft-button":En},sa.styles=ra,na([$({type:Boolean})],sa.prototype,"horizontal",void 0),na([$({type:Boolean})],sa.prototype,"hideScrollbar",void 0),na([$({type:Boolean})],sa.prototype,"controls",void 0),na([$({type:Boolean})],sa.prototype,"limitSize",void 0),na([C()],sa.prototype,"elements",void 0),na([C()],sa.prototype,"currentElement",void 0),na([C()],sa.prototype,"withScroll",void 0),na([C()],sa.prototype,"startReached",void 0),na([C()],sa.prototype,"endReached",void 0),na([E(".ft-snap-scroll--content")],sa.prototype,"contentSlot",void 0),W("ft-snap-scroll")(sa);const la={colorOutline:Ce.external(Le.colorOutline,"Design system"),colorOnSurface:Ce.external(Le.colorOnSurface,"Design system"),colorOnSurfaceMedium:Ce.external(Le.colorOnSurfaceMedium,"Design system"),colorPrimary:Ce.external(Le.colorPrimary,"Design system"),colorSurface:Ce.external(Le.colorSurface,"Design system"),transitionDuration:Ce.external(Le.transitionDuration,"Design system"),transitionTimingFunction:Ce.external(Le.transitionTimingFunction,"Design system"),labelColor:Ce.extend("--ft-filter-label-color","",Le.colorOnSurface),labelFontSize:Ce.extend("--ft-filter-label-font-size","",po.fontSize,"16px")},ca=[gi,$t`
1449
1449
  :host {
1450
1450
  display: flex;
1451
1451
  max-height: 100%;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-filter",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "Flat selector for multivalued or monovalued filters",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,15 +19,15 @@
19
19
  "url": "ssh://git@scm.mrs.antidot.net:2222/fluidtopics/ft-web-components.git"
20
20
  },
21
21
  "dependencies": {
22
- "@fluid-topics/ft-button": "1.1.21",
23
- "@fluid-topics/ft-checkbox": "1.1.21",
24
- "@fluid-topics/ft-icon": "1.1.21",
25
- "@fluid-topics/ft-radio": "1.1.21",
26
- "@fluid-topics/ft-ripple": "1.1.21",
27
- "@fluid-topics/ft-snap-scroll": "1.1.21",
28
- "@fluid-topics/ft-typography": "1.1.21",
29
- "@fluid-topics/ft-wc-utils": "1.1.21",
22
+ "@fluid-topics/ft-button": "1.1.22",
23
+ "@fluid-topics/ft-checkbox": "1.1.22",
24
+ "@fluid-topics/ft-icon": "1.1.22",
25
+ "@fluid-topics/ft-radio": "1.1.22",
26
+ "@fluid-topics/ft-ripple": "1.1.22",
27
+ "@fluid-topics/ft-snap-scroll": "1.1.22",
28
+ "@fluid-topics/ft-typography": "1.1.22",
29
+ "@fluid-topics/ft-wc-utils": "1.1.22",
30
30
  "lit": "3.1.0"
31
31
  },
32
- "gitHead": "1455b4444f7be1901b9584e75f7f1884212a94e8"
32
+ "gitHead": "89c8b3562faee77c5ae79180f255aa9021f4d229"
33
33
  }