@fluid-topics/ft-collapsible 2.0.23 → 2.0.24

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.
@@ -82,7 +82,7 @@ Also for action icons.`,l.colorGray200),contentGlobalSubtle:n.extend("--ftds-con
82
82
  <li>${this.helperText}</li>
83
83
  `)}
84
84
  </ul>
85
- `}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?sr.error:this.warningMessages.length?sr.warning:sr.default}processRules(o){return o.map(a=>a(this.value)).filter(a=>a!==!0).map(a=>a)}}return ye([A()],e.prototype,"warningRules",void 0),ye([A()],e.prototype,"errorRules",void 0),ye([A()],e.prototype,"validateOn",void 0),ye([A({type:Boolean})],e.prototype,"validateAtRender",void 0),ye([A()],e.prototype,"label",void 0),ye([A({type:Boolean})],e.prototype,"hideLabel",void 0),ye([A()],e.prototype,"name",void 0),ye([A({type:Boolean})],e.prototype,"disabled",void 0),ye([A()],e.prototype,"helperText",void 0),ye([A()],e.prototype,"forceStatus",void 0),ye([A({reflect:!0})],e.prototype,"value",void 0),ye([ae()],e.prototype,"errorMessages",void 0),ye([ae()],e.prototype,"warningMessages",void 0),ye([ae()],e.prototype,"status",void 0),ye([ae()],e.prototype,"focused",void 0),ye([ae()],e.prototype,"additionalWarningRules",void 0),ye([ae()],e.prototype,"additionalErrorRules",void 0),e});var Po=(t,e)=>{let r=t._$AN;if(r===void 0)return!1;for(let o of r)o._$AO?.(e,!1),Po(o,e);return!0},Pn=t=>{let e,r;do{if((e=t._$AM)===void 0)break;r=e._$AN,r.delete(t),t=e}while(r?.size===0)},v2=t=>{for(let e;e=t._$AM;t=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(t))break;r.add(t),Ap(e)}};function Cp(t){this._$AN!==void 0?(Pn(this),this._$AM=t,v2(this)):this._$AM=t}function Ep(t,e=!1,r=0){let o=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(o))for(let i=r;i<o.length;i++)Po(o[i],!1),Pn(o[i]);else o!=null&&(Po(o,!1),Pn(o));else Po(this,t)}var Ap=t=>{t.type==qe.CHILD&&(t._$AP??=Ep,t._$AQ??=Cp)},Ur=class extends ze{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,o){super._$AT(e,r,o),v2(this),this.isConnected=e._$AU}_$AO(e,r=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),r&&(Po(this,e),Pn(this))}setValue(e){if(Jc(this._$Ct))this._$Ct._$AI(e,this);else{let r=[...this._$Ct._$AH];r[this._$Ci]=e,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}};var Ss=class extends Ur{get element(){var e;return(e=this.part)===null||e===void 0?void 0:e.element}constructor(e){super(e),this.onFirstTrapFocus=async r=>{if(!this.element||!r.relatedTarget)return;let o=r.relatedTarget;this.isInsideElement(o,this.element)?await this.focusLastDescendant(this.element):await this.focusFirstDescendant(this.element)},this.onLastTrapFocus=async r=>{if(!this.element||!r.relatedTarget)return;let o=r.relatedTarget;this.isInsideElement(o,this.element)?await this.focusFirstDescendant(this.element):await this.focusLastDescendant(this.element)}}render(){return ue}update(e){return this.part=e,this.isElementTrappable(e.element)&&this.createFocusTrap(e.element),ue}reconnected(){var e;this.isElementTrappable((e=this.part)===null||e===void 0?void 0:e.element)&&this.createFocusTrap(this.part.element)}disconnected(){var e,r,o,a;(e=this.firstTrap)===null||e===void 0||e.removeEventListener("focus",this.onFirstTrapFocus),(r=this.lastTrap)===null||r===void 0||r.removeEventListener("focus",this.onLastTrapFocus),(o=this.firstTrap)===null||o===void 0||o.remove(),(a=this.lastTrap)===null||a===void 0||a.remove(),this.firstTrap=void 0,this.lastTrap=void 0}isElementTrappable(e){return!!e&&e instanceof HTMLElement&&e.childElementCount>0}createFocusTrap(e){this.firstTrap=this.createTrap(),this.lastTrap=this.createTrap(),e.insertBefore(this.firstTrap,e.firstChild),e.appendChild(this.lastTrap),this.lastTrap.addEventListener("focus",this.onLastTrapFocus),this.firstTrap.addEventListener("focus",this.onFirstTrapFocus)}createTrap(){let e=document.createElement("div");return e.tabIndex=0,e}getChildren(e){return e instanceof HTMLSlotElement?e.assignedElements():e.shadowRoot?e.shadowRoot.children:e.children}async focusFirstDescendant(e){await this.updateCompleteIfNecessary(e);let r=this.getChildren(e);for(let o=0;o<r.length;o++){let a=r[o];if(a instanceof HTMLElement&&(this.attemptFocus(a)||await this.focusFirstDescendant(a)))return!0}return!1}async focusLastDescendant(e){await this.updateCompleteIfNecessary(e);let r=this.getChildren(e);for(let o=r.length-1;o>=0;o--){let a=r[o];if(a instanceof HTMLElement&&(this.attemptFocus(a)||await this.focusLastDescendant(a)))return!0}return!1}async updateCompleteIfNecessary(e){e instanceof Ie&&await e.updateComplete}isInsideElement(e,r){for(let o=e;o;o=o.parentNode){if(o===r)return!0;o instanceof ShadowRoot?o=o.host:o.assignedSlot&&(o=o.assignedSlot)}return!1}attemptFocus(e){return e===this.firstTrap||e===this.lastTrap||!this.isFocusable(e)?!1:(e.focus(),!0)}isFocusable(e){return!e.checkVisibility()||this.isElementDisabled(e)?!1:e instanceof HTMLAnchorElement?!!e.href&&e.rel!=="ignore":e instanceof HTMLInputElement?e.type!=="hidden":e.tabIndex>=0}isElementDisabled(e){return"disabled"in e&&!!e.disabled}},hC=we(Ss);var x2;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(x2||(x2={}));var Lp={sm:640,md:768,lg:1024,xl:1280},Cs=class extends Ur{constructor(e){super(e),this.size=0,this.onResize=()=>{let r=window.innerWidth;this.size!==r&&(this.size=r,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[r,o,a]){return this.lastArgs=[r,o,a],this.render(r,o,a)}render(e,r,o){let a=this.resolveThreshold(e),i=o??(()=>q);return this.size>a?r():i()}resolveThreshold(e){return typeof e=="number"?e:Lp[e]}},bC=we(Cs);var Es,As,Ls,Os,Rs=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((Ls=(As=(Es=window.safari)===null||Es===void 0?void 0:Es.pushNotification)===null||As===void 0?void 0:As.toString())!==null&&Ls!==void 0?Ls:"")==="[object SafariRemoteNotification]",Op="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Os=window.ftGlobals)!==null&&Os!==void 0?Os:{lit:Ca,litDecorators:Aa,litRepeat:La,litClassMap:Oa,litStyleMap:Ra,litUnsafeHTML:wa,wcUtils:{...za,...Ta,...$a,...hs,...Ga,...Fa,...ci,...Ia,...Ei,...bs,...g2,...cs,...Ai,...si,...Ti,...ps,...wi,...vs,...jl,...Ma,...Pi,...li,...ki,...y2,...Zl,...Ii,...as,...gs,...Li,...Ri,...ds,...Ua,isSafari:Rs,isTouchScreen:Op,setVariable:w}};var se=function(t,e,r,o){var a=arguments.length,i=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Q=class extends X{constructor(){super(...arguments),this.open=!1,this.animated=!1,this.closeCollapsibleMatchers=[],this.primary=!1,this.secondary=!1,this.tertiary=!1,this.neutral=!1,this.dense=!1,this.round=!1,this.small=!1,this.disabled=!1,this.tooltipPosition="right",this.openIcon="THIN_ARROW",this.closedIcon="THIN_ARROW_RIGHT",this.trailingIcon=!1,this.animationInProgress=!1,this.animationEndSafeguard=new be(800)}render(){let e={"ft-collapsible--content":!0,"ft-collapsible--hidden":!this.open,"ft-collapsible--animated":this.animated,"ft-collapsible--animation-in-progress":this.animated&&this.animationInProgress};return Z`
85
+ `}resolveStatus(){return this.forceStatus?this.forceStatus:this.errorMessages.length?sr.error:this.warningMessages.length?sr.warning:sr.default}processRules(o){return o.map(a=>a(this.value)).filter(a=>a!==!0).map(a=>a)}}return ye([A()],e.prototype,"warningRules",void 0),ye([A()],e.prototype,"errorRules",void 0),ye([A()],e.prototype,"validateOn",void 0),ye([A({type:Boolean})],e.prototype,"validateAtRender",void 0),ye([A()],e.prototype,"label",void 0),ye([A({type:Boolean})],e.prototype,"hideLabel",void 0),ye([A()],e.prototype,"name",void 0),ye([A({type:Boolean})],e.prototype,"disabled",void 0),ye([A()],e.prototype,"helperText",void 0),ye([A()],e.prototype,"forceStatus",void 0),ye([A({reflect:!0})],e.prototype,"value",void 0),ye([ae()],e.prototype,"errorMessages",void 0),ye([ae()],e.prototype,"warningMessages",void 0),ye([ae()],e.prototype,"status",void 0),ye([ae()],e.prototype,"focused",void 0),ye([ae()],e.prototype,"additionalWarningRules",void 0),ye([ae()],e.prototype,"additionalErrorRules",void 0),e});var Po=(t,e)=>{let r=t._$AN;if(r===void 0)return!1;for(let o of r)o._$AO?.(e,!1),Po(o,e);return!0},Pn=t=>{let e,r;do{if((e=t._$AM)===void 0)break;r=e._$AN,r.delete(t),t=e}while(r?.size===0)},v2=t=>{for(let e;e=t._$AM;t=e){let r=e._$AN;if(r===void 0)e._$AN=r=new Set;else if(r.has(t))break;r.add(t),Ap(e)}};function Cp(t){this._$AN!==void 0?(Pn(this),this._$AM=t,v2(this)):this._$AM=t}function Ep(t,e=!1,r=0){let o=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(e)if(Array.isArray(o))for(let i=r;i<o.length;i++)Po(o[i],!1),Pn(o[i]);else o!=null&&(Po(o,!1),Pn(o));else Po(this,t)}var Ap=t=>{t.type==qe.CHILD&&(t._$AP??=Ep,t._$AQ??=Cp)},Ur=class extends ze{constructor(){super(...arguments),this._$AN=void 0}_$AT(e,r,o){super._$AT(e,r,o),v2(this),this.isConnected=e._$AU}_$AO(e,r=!0){e!==this.isConnected&&(this.isConnected=e,e?this.reconnected?.():this.disconnected?.()),r&&(Po(this,e),Pn(this))}setValue(e){if(Jc(this._$Ct))this._$Ct._$AI(e,this);else{let r=[...this._$Ct._$AH];r[this._$Ci]=e,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}};var Ss=class extends Ur{get element(){var e;return(e=this.part)===null||e===void 0?void 0:e.element}constructor(e){super(e),this.onFirstTrapFocus=async r=>{if(!this.element||!r.relatedTarget)return;let o=r.relatedTarget;this.isInsideElement(o,this.element)?await this.focusLastDescendant(this.element):await this.focusFirstDescendant(this.element)},this.onLastTrapFocus=async r=>{if(!this.element||!r.relatedTarget)return;let o=r.relatedTarget;this.isInsideElement(o,this.element)?await this.focusFirstDescendant(this.element):await this.focusLastDescendant(this.element)}}render(){return ue}update(e){return this.part=e,this.ensureFocusTrap(e.element),ue}reconnected(){var e;this.ensureFocusTrap((e=this.part)===null||e===void 0?void 0:e.element)}disconnected(){this.removeFocusTrap()}ensureFocusTrap(e){var r,o;this.isElementTrappable(e)&&(((r=this.firstTrap)===null||r===void 0?void 0:r.parentElement)===e&&((o=this.lastTrap)===null||o===void 0?void 0:o.parentElement)===e||(this.removeFocusTrap(),this.createFocusTrap(e)))}removeFocusTrap(){var e,r,o,a;(e=this.firstTrap)===null||e===void 0||e.removeEventListener("focus",this.onFirstTrapFocus),(r=this.lastTrap)===null||r===void 0||r.removeEventListener("focus",this.onLastTrapFocus),(o=this.firstTrap)===null||o===void 0||o.remove(),(a=this.lastTrap)===null||a===void 0||a.remove(),this.firstTrap=void 0,this.lastTrap=void 0}isElementTrappable(e){return!!e&&e instanceof HTMLElement&&e.childElementCount>0}createFocusTrap(e){this.firstTrap=this.createTrap(),this.lastTrap=this.createTrap(),e.insertBefore(this.firstTrap,e.firstChild),e.appendChild(this.lastTrap),this.lastTrap.addEventListener("focus",this.onLastTrapFocus),this.firstTrap.addEventListener("focus",this.onFirstTrapFocus)}createTrap(){let e=document.createElement("div");return e.tabIndex=0,e}getChildren(e){return e instanceof HTMLSlotElement?e.assignedElements():e.shadowRoot?e.shadowRoot.children:e.children}async focusFirstDescendant(e){await this.updateCompleteIfNecessary(e);let r=this.getChildren(e);for(let o=0;o<r.length;o++){let a=r[o];if(a instanceof HTMLElement&&(this.attemptFocus(a)||await this.focusFirstDescendant(a)))return!0}return!1}async focusLastDescendant(e){await this.updateCompleteIfNecessary(e);let r=this.getChildren(e);for(let o=r.length-1;o>=0;o--){let a=r[o];if(a instanceof HTMLElement&&(this.attemptFocus(a)||await this.focusLastDescendant(a)))return!0}return!1}async updateCompleteIfNecessary(e){e instanceof Ie&&await e.updateComplete}isInsideElement(e,r){for(let o=e;o;o=o.parentNode){if(o===r)return!0;o instanceof ShadowRoot?o=o.host:o.assignedSlot&&(o=o.assignedSlot)}return!1}attemptFocus(e){return e===this.firstTrap||e===this.lastTrap||!this.isFocusable(e)?!1:(e.focus(),!0)}isFocusable(e){return!e.checkVisibility()||this.isElementDisabled(e)?!1:e instanceof HTMLAnchorElement?!!e.href&&e.rel!=="ignore":e instanceof HTMLInputElement?e.type!=="hidden":e.tabIndex>=0}isElementDisabled(e){return"disabled"in e&&!!e.disabled}},hC=we(Ss);var x2;(function(t){t.sm="sm",t.md="md",t.lg="lg",t.xl="xl"})(x2||(x2={}));var Lp={sm:640,md:768,lg:1024,xl:1280},Cs=class extends Ur{constructor(e){super(e),this.size=0,this.onResize=()=>{let r=window.innerWidth;this.size!==r&&(this.size=r,this.lastArgs&&this.setValue(this.render(...this.lastArgs)))},this.size=window.innerWidth,window.addEventListener("resize",this.onResize)}disconnected(){window.removeEventListener("resize",this.onResize)}reconnected(){window.addEventListener("resize",this.onResize)}update(e,[r,o,a]){return this.lastArgs=[r,o,a],this.render(r,o,a)}render(e,r,o){let a=this.resolveThreshold(e),i=o??(()=>q);return this.size>a?r():i()}resolveThreshold(e){return typeof e=="number"?e:Lp[e]}},bC=we(Cs);var Es,As,Ls,Os,Rs=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((Ls=(As=(Es=window.safari)===null||Es===void 0?void 0:Es.pushNotification)===null||As===void 0?void 0:As.toString())!==null&&Ls!==void 0?Ls:"")==="[object SafariRemoteNotification]",Op="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Os=window.ftGlobals)!==null&&Os!==void 0?Os:{lit:Ca,litDecorators:Aa,litRepeat:La,litClassMap:Oa,litStyleMap:Ra,litUnsafeHTML:wa,wcUtils:{...za,...Ta,...$a,...hs,...Ga,...Fa,...ci,...Ia,...Ei,...bs,...g2,...cs,...Ai,...si,...Ti,...ps,...wi,...vs,...jl,...Ma,...Pi,...li,...ki,...y2,...Zl,...Ii,...as,...gs,...Li,...Ri,...ds,...Ua,isSafari:Rs,isTouchScreen:Op,setVariable:w}};var se=function(t,e,r,o){var a=arguments.length,i=a<3?e:o===null?o=Object.getOwnPropertyDescriptor(e,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(t,e,r,o);else for(var c=t.length-1;c>=0;c--)(s=t[c])&&(i=(a<3?s(i):a>3?s(e,r,i):s(e,r))||i);return a>3&&i&&Object.defineProperty(e,r,i),i},Q=class extends X{constructor(){super(...arguments),this.open=!1,this.animated=!1,this.closeCollapsibleMatchers=[],this.primary=!1,this.secondary=!1,this.tertiary=!1,this.neutral=!1,this.dense=!1,this.round=!1,this.small=!1,this.disabled=!1,this.tooltipPosition="right",this.openIcon="THIN_ARROW",this.closedIcon="THIN_ARROW_RIGHT",this.trailingIcon=!1,this.animationInProgress=!1,this.animationEndSafeguard=new be(800)}render(){let e={"ft-collapsible--content":!0,"ft-collapsible--hidden":!this.open,"ft-collapsible--animated":this.animated,"ft-collapsible--animation-in-progress":this.animated&&this.animationInProgress};return Z`
86
86
  <slot name="toggle"
87
87
  part="toggle"
88
88
  @click=${this.toggleOpenAnimation}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-collapsible",
3
- "version": "2.0.23",
3
+ "version": "2.0.24",
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": "2.0.23",
23
- "@fluid-topics/ft-wc-utils": "2.0.23",
22
+ "@fluid-topics/ft-button": "2.0.24",
23
+ "@fluid-topics/ft-wc-utils": "2.0.24",
24
24
  "lit": "3.1.0"
25
25
  },
26
- "gitHead": "e441ae21f5027730992e39b7dc728ac0f7b17dc0"
26
+ "gitHead": "5407e83b63be10ccc5bdeb3551c9f798b9559ae0"
27
27
  }