@fluid-topics/ft-collapsible 0.3.61 → 0.3.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.
@@ -52,6 +52,8 @@ export class FtCollapsible extends FtLitElement {
52
52
  ?trailingIcon=${this.trailingIcon}
53
53
  @click=${this.toggleOpen}
54
54
  class="${this.hasCustomToggle() ? "ft-collapsible--hidden" : ""}"
55
+ aria-controls="ft-collapsible-content"
56
+ aria-expanded="${this.open}"
55
57
  >
56
58
  ${(this.open ? this.openText : this.closedText) || this.text}
57
59
  </ft-button>
@@ -60,7 +62,8 @@ export class FtCollapsible extends FtLitElement {
60
62
  class="${this.hasCustomToggle() ? "" : "ft-collapsible--hidden"}"
61
63
  @click=${this.toggleOpen}
62
64
  @slotchange=${this.onCustomToggleSlotChange}></slot>
63
- <slot class="${classMap(contentClasses)}"
65
+ <slot id="ft-collapsible-content"
66
+ class="${classMap(contentClasses)}"
64
67
  @click=${this.onContentClick}
65
68
  @transitionend=${() => this.animationInProgress = false}></slot>
66
69
  `;
@@ -513,7 +513,7 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
513
513
  ${i.setVariable(Bi.size,Hi.iconSize)};
514
514
  ${i.setVariable(Bi.color,"var(--ft-button-internal-color)")};
515
515
  }
516
- `];var Ki=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Pi extends i.FtLitElement{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=Ri.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(e.html`
516
+ `];var Ki=function(t,i,e,o){for(var n,s=arguments.length,r=s<3?i:null===o?o=Object.getOwnPropertyDescriptor(i,e):o,l=t.length-1;l>=0;l--)(n=t[l])&&(r=(s<3?n(r):s>3?n(i,e,r):n(i,e))||r);return s>3&&r&&Object.defineProperty(i,e,r),r};class Pi extends i.FtLitElement{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=Ri.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(e.html`
517
517
  <button part="button"
518
518
  class="${n.classMap(t)}"
519
519
  aria-label="${this.getLabel()}"
@@ -536,7 +536,7 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
536
536
  </ft-tooltip>
537
537
  `:t}resolveIcon(){return this.loading?e.html`
538
538
  <ft-loader></ft-loader> `:this.icon?e.html`
539
- <ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Pi.elementDefinitions={"ft-ripple":x,"ft-tooltip":ji,"ft-typography":mi,"ft-icon":Ui,"ft-loader":Ti},Pi.styles=[i.safariEllipsisFix,Gi],Ki([o.property({type:Boolean})],Pi.prototype,"primary",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"outlined",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"disabled",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"dense",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"round",void 0),Ki([o.property({type:String})],Pi.prototype,"label",void 0),Ki([o.property({type:String})],Pi.prototype,"icon",void 0),Ki([o.property({type:String})],Pi.prototype,"iconVariant",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"trailingIcon",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"loading",void 0),Ki([o.property({type:String})],Pi.prototype,"tooltipPosition",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"hideTooltip",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"forceTooltip",void 0),Ki([o.query(".ft-button")],Pi.prototype,"button",void 0),Ki([o.query(".ft-button--label slot")],Pi.prototype,"slottedContent",void 0),i.customElement("ft-button")(Pi);const Vi=e.css`
539
+ <ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:e.nothing}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Pi.elementDefinitions={"ft-ripple":x,"ft-tooltip":ji,"ft-typography":mi,"ft-icon":Ui,"ft-loader":Ti},Pi.styles=[i.safariEllipsisFix,Gi],Ki([o.property({type:String,reflect:!0})],Pi.prototype,"role",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"primary",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"outlined",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"disabled",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"dense",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"round",void 0),Ki([o.property({type:String})],Pi.prototype,"label",void 0),Ki([o.property({type:String})],Pi.prototype,"icon",void 0),Ki([o.property({type:String})],Pi.prototype,"iconVariant",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"trailingIcon",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"loading",void 0),Ki([o.property({type:String})],Pi.prototype,"tooltipPosition",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"hideTooltip",void 0),Ki([o.property({type:Boolean})],Pi.prototype,"forceTooltip",void 0),Ki([o.query(".ft-button")],Pi.prototype,"button",void 0),Ki([o.query(".ft-button--label slot")],Pi.prototype,"slottedContent",void 0),i.customElement("ft-button")(Pi);const Vi=e.css`
540
540
  :host {
541
541
  display: contents;
542
542
  }
@@ -575,6 +575,8 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
575
575
  ?trailingIcon=${this.trailingIcon}
576
576
  @click=${this.toggleOpen}
577
577
  class="${this.hasCustomToggle()?"ft-collapsible--hidden":""}"
578
+ aria-controls="ft-collapsible-content"
579
+ aria-expanded="${this.open}"
578
580
  >
579
581
  ${(this.open?this.openText:this.closedText)||this.text}
580
582
  </ft-button>
@@ -583,7 +585,8 @@ const J=Symbol.for(""),Q=t=>{if((null==t?void 0:t.r)===J)return null==t?void 0:t
583
585
  class="${this.hasCustomToggle()?"":"ft-collapsible--hidden"}"
584
586
  @click=${this.toggleOpen}
585
587
  @slotchange=${this.onCustomToggleSlotChange}></slot>
586
- <slot class="${n.classMap(t)}"
588
+ <slot id="ft-collapsible-content"
589
+ class="${n.classMap(t)}"
587
590
  @click=${this.onContentClick}
588
591
  @transitionend=${()=>this.animationInProgress=!1}></slot>
589
592
  `}onCustomToggleSlotChange(){this.requestUpdate()}hasCustomToggle(){var t,i;return 0!==(null!==(i=null===(t=this.toggleSlot)||void 0===t?void 0:t.assignedNodes().length)&&void 0!==i?i:0)}toggleOpen(){this.animationInProgress=!0,setTimeout((()=>this.open=!this.open),5),this.animationEndSafeguard.run((()=>this.animationInProgress=!1))}update(t){super.update(t),t.has("open")&&this.dispatchEvent(new CustomEvent("change",{detail:{open:this.open}}))}onContentClick(t){if(this.closeCollapsibleMatchers.length>0){const i=t.composedPath();for(let t of i){if(t===this)return;if(t.matches&&this.closeCollapsibleMatchers.some((i=>t.matches(i))))return void this.toggleOpen()}}}}Xi.elementDefinitions={"ft-button":Pi},Xi.styles=Vi,qi([o.property({type:Boolean,reflect:!0})],Xi.prototype,"open",void 0),qi([o.property({type:Boolean})],Xi.prototype,"animated",void 0),qi([i.jsonProperty([])],Xi.prototype,"closeCollapsibleMatchers",void 0),qi([o.property()],Xi.prototype,"label",void 0),qi([o.property()],Xi.prototype,"openLabel",void 0),qi([o.property()],Xi.prototype,"closedLabel",void 0),qi([o.property()],Xi.prototype,"text",void 0),qi([o.property()],Xi.prototype,"openText",void 0),qi([o.property()],Xi.prototype,"closedText",void 0),qi([o.property({type:Boolean})],Xi.prototype,"primary",void 0),qi([o.property({type:Boolean})],Xi.prototype,"secondary",void 0),qi([o.property({type:Boolean})],Xi.prototype,"disabled",void 0),qi([o.property({type:Boolean})],Xi.prototype,"dense",void 0),qi([o.property({type:Boolean})],Xi.prototype,"round",void 0),qi([o.property()],Xi.prototype,"tooltipPosition",void 0),qi([o.property()],Xi.prototype,"iconVariant",void 0),qi([o.property()],Xi.prototype,"openIcon",void 0),qi([o.property()],Xi.prototype,"closedIcon",void 0),qi([o.property({type:Boolean})],Xi.prototype,"trailingIcon",void 0),qi([o.query('slot[name="toggle"]')],Xi.prototype,"toggleSlot",void 0),qi([o.query(".content")],Xi.prototype,"content",void 0),qi([o.state()],Xi.prototype,"animationInProgress",void 0),i.customElement("ft-collapsible")(Xi),t.FtCollapsible=Xi,t.styles=Vi,Object.defineProperty(t,"t",{value:!0})}({},ftGlobals.wcUtils,ftGlobals.lit,ftGlobals.litDecorators,ftGlobals.litClassMap,ftGlobals.litUnsafeHTML);
@@ -640,7 +640,7 @@ class Oi extends Rt{constructor(t){if(super(t),this.it=X,t.type!==Nt)throw Error
640
640
  ${yt(mi.size,ji.iconSize)};
641
641
  ${yt(mi.color,"var(--ft-button-internal-color)")};
642
642
  }
643
- `];var Li=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class Pi extends gt{constructor(){super(...arguments),this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=Ri.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(J`
643
+ `];var Li=function(t,e,i,o){for(var n,s=arguments.length,r=s<3?e:null===o?o=Object.getOwnPropertyDescriptor(e,i):o,a=t.length-1;a>=0;a--)(n=t[a])&&(r=(s<3?n(r):s>3?n(e,i,r):n(e,i))||r);return s>3&&r&&Object.defineProperty(e,i,r),r};class Pi extends gt{constructor(){super(...arguments),this.role="button",this.primary=!1,this.outlined=!1,this.disabled=!1,this.dense=!1,this.round=!1,this.label="",this.icon=void 0,this.iconVariant=Ri.material,this.trailingIcon=!1,this.loading=!1,this.tooltipPosition="bottom",this.hideTooltip=!1,this.forceTooltip=!1,this.onclick=t=>{this.isDisabled()&&(t.preventDefault(),t.stopPropagation(),t.stopImmediatePropagation())}}render(){const t={"ft-button":!0,"ft-button--primary":this.primary,"ft-button--outlined":this.outlined,"ft-button--dense":this.dense,"ft-button--round":this.round,"ft-button--trailing-icon":this.trailingIcon,"ft-button--loading":this.trailingIcon,"ft-no-text-select":!0};return this.addTooltipIfNeeded(J`
644
644
  <button part="button"
645
645
  class="${Mt(t)}"
646
646
  aria-label="${this.getLabel()}"
@@ -663,7 +663,7 @@ class Oi extends Rt{constructor(t){if(super(t),this.it=X,t.type!==Nt)throw Error
663
663
  </ft-tooltip>
664
664
  `:t}resolveIcon(){return this.loading?J`
665
665
  <ft-loader></ft-loader> `:this.icon?J`
666
- <ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:X}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Pi.elementDefinitions={"ft-ripple":It,"ft-tooltip":gi,"ft-typography":pi,"ft-icon":zi,"ft-loader":$i},Pi.styles=[wt,Ai],Li([o({type:Boolean})],Pi.prototype,"primary",void 0),Li([o({type:Boolean})],Pi.prototype,"outlined",void 0),Li([o({type:Boolean})],Pi.prototype,"disabled",void 0),Li([o({type:Boolean})],Pi.prototype,"dense",void 0),Li([o({type:Boolean})],Pi.prototype,"round",void 0),Li([o({type:String})],Pi.prototype,"label",void 0),Li([o({type:String})],Pi.prototype,"icon",void 0),Li([o({type:String})],Pi.prototype,"iconVariant",void 0),Li([o({type:Boolean})],Pi.prototype,"trailingIcon",void 0),Li([o({type:Boolean})],Pi.prototype,"loading",void 0),Li([o({type:String})],Pi.prototype,"tooltipPosition",void 0),Li([o({type:Boolean})],Pi.prototype,"hideTooltip",void 0),Li([o({type:Boolean})],Pi.prototype,"forceTooltip",void 0),Li([r(".ft-button")],Pi.prototype,"button",void 0),Li([r(".ft-button--label slot")],Pi.prototype,"slottedContent",void 0),p("ft-button")(Pi);const _i=x`
666
+ <ft-icon variant="${this.iconVariant}" value="${this.icon}"></ft-icon> `:X}focus(){var t;null===(t=this.button)||void 0===t||t.focus()}getLabel(){return this.label||this.textContent}get textContent(){return this.unslotText(this.slottedContent).trim()}unslotText(t){return t instanceof HTMLSlotElement?t.assignedNodes().map((t=>this.unslotText(t))).join(""):(null==t?void 0:t.textContent)||""}hasTextContent(){return this.textContent.length>0}onSlotchange(){this.requestUpdate()}isDisabled(){return this.disabled||this.loading}}Pi.elementDefinitions={"ft-ripple":It,"ft-tooltip":gi,"ft-typography":pi,"ft-icon":zi,"ft-loader":$i},Pi.styles=[wt,Ai],Li([o({type:String,reflect:!0})],Pi.prototype,"role",void 0),Li([o({type:Boolean})],Pi.prototype,"primary",void 0),Li([o({type:Boolean})],Pi.prototype,"outlined",void 0),Li([o({type:Boolean})],Pi.prototype,"disabled",void 0),Li([o({type:Boolean})],Pi.prototype,"dense",void 0),Li([o({type:Boolean})],Pi.prototype,"round",void 0),Li([o({type:String})],Pi.prototype,"label",void 0),Li([o({type:String})],Pi.prototype,"icon",void 0),Li([o({type:String})],Pi.prototype,"iconVariant",void 0),Li([o({type:Boolean})],Pi.prototype,"trailingIcon",void 0),Li([o({type:Boolean})],Pi.prototype,"loading",void 0),Li([o({type:String})],Pi.prototype,"tooltipPosition",void 0),Li([o({type:Boolean})],Pi.prototype,"hideTooltip",void 0),Li([o({type:Boolean})],Pi.prototype,"forceTooltip",void 0),Li([r(".ft-button")],Pi.prototype,"button",void 0),Li([r(".ft-button--label slot")],Pi.prototype,"slottedContent",void 0),p("ft-button")(Pi);const _i=x`
667
667
  :host {
668
668
  display: contents;
669
669
  }
@@ -702,6 +702,8 @@ class Oi extends Rt{constructor(t){if(super(t),this.it=X,t.type!==Nt)throw Error
702
702
  ?trailingIcon=${this.trailingIcon}
703
703
  @click=${this.toggleOpen}
704
704
  class="${this.hasCustomToggle()?"ft-collapsible--hidden":""}"
705
+ aria-controls="ft-collapsible-content"
706
+ aria-expanded="${this.open}"
705
707
  >
706
708
  ${(this.open?this.openText:this.closedText)||this.text}
707
709
  </ft-button>
@@ -710,7 +712,8 @@ class Oi extends Rt{constructor(t){if(super(t),this.it=X,t.type!==Nt)throw Error
710
712
  class="${this.hasCustomToggle()?"":"ft-collapsible--hidden"}"
711
713
  @click=${this.toggleOpen}
712
714
  @slotchange=${this.onCustomToggleSlotChange}></slot>
713
- <slot class="${Mt(t)}"
715
+ <slot id="ft-collapsible-content"
716
+ class="${Mt(t)}"
714
717
  @click=${this.onContentClick}
715
718
  @transitionend=${()=>this.animationInProgress=!1}></slot>
716
719
  `}onCustomToggleSlotChange(){this.requestUpdate()}hasCustomToggle(){var t,e;return 0!==(null!==(e=null===(t=this.toggleSlot)||void 0===t?void 0:t.assignedNodes().length)&&void 0!==e?e:0)}toggleOpen(){this.animationInProgress=!0,setTimeout((()=>this.open=!this.open),5),this.animationEndSafeguard.run((()=>this.animationInProgress=!1))}update(t){super.update(t),t.has("open")&&this.dispatchEvent(new CustomEvent("change",{detail:{open:this.open}}))}onContentClick(t){if(this.closeCollapsibleMatchers.length>0){const e=t.composedPath();for(let t of e){if(t===this)return;if(t.matches&&this.closeCollapsibleMatchers.some((e=>t.matches(e))))return void this.toggleOpen()}}}}Di.elementDefinitions={"ft-button":Pi},Di.styles=_i,Ii([o({type:Boolean,reflect:!0})],Di.prototype,"open",void 0),Ii([o({type:Boolean})],Di.prototype,"animated",void 0),Ii([c([])],Di.prototype,"closeCollapsibleMatchers",void 0),Ii([o()],Di.prototype,"label",void 0),Ii([o()],Di.prototype,"openLabel",void 0),Ii([o()],Di.prototype,"closedLabel",void 0),Ii([o()],Di.prototype,"text",void 0),Ii([o()],Di.prototype,"openText",void 0),Ii([o()],Di.prototype,"closedText",void 0),Ii([o({type:Boolean})],Di.prototype,"primary",void 0),Ii([o({type:Boolean})],Di.prototype,"secondary",void 0),Ii([o({type:Boolean})],Di.prototype,"disabled",void 0),Ii([o({type:Boolean})],Di.prototype,"dense",void 0),Ii([o({type:Boolean})],Di.prototype,"round",void 0),Ii([o()],Di.prototype,"tooltipPosition",void 0),Ii([o()],Di.prototype,"iconVariant",void 0),Ii([o()],Di.prototype,"openIcon",void 0),Ii([o()],Di.prototype,"closedIcon",void 0),Ii([o({type:Boolean})],Di.prototype,"trailingIcon",void 0),Ii([r('slot[name="toggle"]')],Di.prototype,"toggleSlot",void 0),Ii([r(".content")],Di.prototype,"content",void 0),Ii([n()],Di.prototype,"animationInProgress",void 0),p("ft-collapsible")(Di),t.FtCollapsible=Di,t.styles=_i,Object.defineProperty(t,"i",{value:!0})}({});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-collapsible",
3
- "version": "0.3.61",
3
+ "version": "0.3.63",
4
4
  "description": "Collapsible web component",
5
5
  "keywords": [
6
6
  "Lit"
@@ -19,9 +19,9 @@
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": "0.3.61",
23
- "@fluid-topics/ft-wc-utils": "0.3.61",
22
+ "@fluid-topics/ft-button": "0.3.63",
23
+ "@fluid-topics/ft-wc-utils": "0.3.63",
24
24
  "lit": "2.2.8"
25
25
  },
26
- "gitHead": "12a4024fb3084b17772a3aef10723d22ae56c877"
26
+ "gitHead": "0f9703a51261fa203c190b1852718e829ae31b7c"
27
27
  }