@fluid-topics/ft-file-button 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 ge([R()],t.prototype,"warningRules",void 0),ge([R()],t.prototype,"errorRules",void 0),ge([R()],t.prototype,"validateOn",void 0),ge([R({type:Boolean})],t.prototype,"validateAtRender",void 0),ge([R()],t.prototype,"label",void 0),ge([R({type:Boolean})],t.prototype,"hideLabel",void 0),ge([R()],t.prototype,"name",void 0),ge([R({type:Boolean})],t.prototype,"disabled",void 0),ge([R()],t.prototype,"helperText",void 0),ge([R()],t.prototype,"forceStatus",void 0),ge([R({reflect:!0})],t.prototype,"value",void 0),ge([se()],t.prototype,"errorMessages",void 0),ge([se()],t.prototype,"warningMessages",void 0),ge([se()],t.prototype,"status",void 0),ge([se()],t.prototype,"focused",void 0),ge([se()],t.prototype,"additionalWarningRules",void 0),ge([se()],t.prototype,"additionalErrorRules",void 0),t});var Po=(e,t)=>{let r=e._$AN;if(r===void 0)return!1;for(let o of r)o._$AO?.(t,!1),Po(o,t);return!0},Mn=e=>{let t,r;do{if((t=e._$AM)===void 0)break;r=t._$AN,r.delete(e),e=t}while(r?.size===0)},v2=e=>{for(let t;t=e._$AM;e=t){let r=t._$AN;if(r===void 0)t._$AN=r=new Set;else if(r.has(e))break;r.add(e),Op(t)}};function Ap(e){this._$AN!==void 0?(Mn(this),this._$AM=e,v2(this)):this._$AM=e}function Lp(e,t=!1,r=0){let o=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(t)if(Array.isArray(o))for(let i=r;i<o.length;i++)Po(o[i],!1),Mn(o[i]);else o!=null&&(Po(o,!1),Mn(o));else Po(this,e)}var Op=e=>{e.type==Ye.CHILD&&(e._$AP??=Lp,e._$AQ??=Ap)},Br=class extends ke{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,r,o){super._$AT(t,r,o),v2(this),this.isConnected=t._$AU}_$AO(t,r=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),r&&(Po(this,t),Mn(this))}setValue(t){if(Jc(this._$Ct))this._$Ct._$AI(t,this);else{let r=[...this._$Ct._$AH];r[this._$Ci]=t,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}};var xs=class extends Br{get element(){var t;return(t=this.part)===null||t===void 0?void 0:t.element}constructor(t){super(t),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 le}update(t){return this.part=t,this.isElementTrappable(t.element)&&this.createFocusTrap(t.element),le}reconnected(){var t;this.isElementTrappable((t=this.part)===null||t===void 0?void 0:t.element)&&this.createFocusTrap(this.part.element)}disconnected(){var t,r,o,a;(t=this.firstTrap)===null||t===void 0||t.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(t){return!!t&&t instanceof HTMLElement&&t.childElementCount>0}createFocusTrap(t){this.firstTrap=this.createTrap(),this.lastTrap=this.createTrap(),t.insertBefore(this.firstTrap,t.firstChild),t.appendChild(this.lastTrap),this.lastTrap.addEventListener("focus",this.onLastTrapFocus),this.firstTrap.addEventListener("focus",this.onFirstTrapFocus)}createTrap(){let t=document.createElement("div");return t.tabIndex=0,t}getChildren(t){return t instanceof HTMLSlotElement?t.assignedElements():t.shadowRoot?t.shadowRoot.children:t.children}async focusFirstDescendant(t){await this.updateCompleteIfNecessary(t);let r=this.getChildren(t);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(t){await this.updateCompleteIfNecessary(t);let r=this.getChildren(t);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(t){t instanceof Pe&&await t.updateComplete}isInsideElement(t,r){for(let o=t;o;o=o.parentNode){if(o===r)return!0;o instanceof ShadowRoot?o=o.host:o.assignedSlot&&(o=o.assignedSlot)}return!1}attemptFocus(t){return t===this.firstTrap||t===this.lastTrap||!this.isFocusable(t)?!1:(t.focus(),!0)}isFocusable(t){return!t.checkVisibility()||this.isElementDisabled(t)?!1:t instanceof HTMLAnchorElement?!!t.href&&t.rel!=="ignore":t instanceof HTMLInputElement?t.type!=="hidden":t.tabIndex>=0}isElementDisabled(t){return"disabled"in t&&!!t.disabled}},gC=Oe(xs);var x2;(function(e){e.sm="sm",e.md="md",e.lg="lg",e.xl="xl"})(x2||(x2={}));var Rp={sm:640,md:768,lg:1024,xl:1280},Ss=class extends Br{constructor(t){super(t),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(t,[r,o,a]){return this.lastArgs=[r,o,a],this.render(r,o,a)}render(t,r,o){let a=this.resolveThreshold(t),i=o??(()=>q);return this.size>a?r():i()}resolveThreshold(t){return typeof t=="number"?t:Rp[t]}},xC=Oe(Ss);var Cs,Es,As,Ls,Os=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((As=(Es=(Cs=window.safari)===null||Cs===void 0?void 0:Cs.pushNotification)===null||Es===void 0?void 0:Es.toString())!==null&&As!==void 0?As:"")==="[object SafariRemoteNotification]",wp="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ls=window.ftGlobals)!==null&&Ls!==void 0?Ls:{lit:xa,litDecorators:Ca,litRepeat:Ea,litClassMap:Aa,litStyleMap:La,litUnsafeHTML:Oa,wcUtils:{...Ia,...wa,...Ha,...ps,...$a,...Ga,...si,...ka,...Ci,...ys,...g2,...ss,...Ei,...ii,..._i,...fs,...Ri,...bs,...jl,...Na,...Mi,...ci,...Pi,...y2,...Zl,...ki,...ns,...ms,...Ai,...Oi,...ls,...Da,isSafari:Os,isTouchScreen:wp,setVariable:w}};var Tt=function(e,t,r,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(i=(a<3?s(i):a>3?s(t,r,i):s(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},Rs=class extends CustomEvent{constructor(t){super("change",{detail:{file:t}})}},xe=class extends Or(X){constructor(){super(...arguments),this.disabled=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.accept=""}focus(){this.button.focus()}clear(){this.input.value=""}render(){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 ge([R()],t.prototype,"warningRules",void 0),ge([R()],t.prototype,"errorRules",void 0),ge([R()],t.prototype,"validateOn",void 0),ge([R({type:Boolean})],t.prototype,"validateAtRender",void 0),ge([R()],t.prototype,"label",void 0),ge([R({type:Boolean})],t.prototype,"hideLabel",void 0),ge([R()],t.prototype,"name",void 0),ge([R({type:Boolean})],t.prototype,"disabled",void 0),ge([R()],t.prototype,"helperText",void 0),ge([R()],t.prototype,"forceStatus",void 0),ge([R({reflect:!0})],t.prototype,"value",void 0),ge([se()],t.prototype,"errorMessages",void 0),ge([se()],t.prototype,"warningMessages",void 0),ge([se()],t.prototype,"status",void 0),ge([se()],t.prototype,"focused",void 0),ge([se()],t.prototype,"additionalWarningRules",void 0),ge([se()],t.prototype,"additionalErrorRules",void 0),t});var Po=(e,t)=>{let r=e._$AN;if(r===void 0)return!1;for(let o of r)o._$AO?.(t,!1),Po(o,t);return!0},Mn=e=>{let t,r;do{if((t=e._$AM)===void 0)break;r=t._$AN,r.delete(e),e=t}while(r?.size===0)},v2=e=>{for(let t;t=e._$AM;e=t){let r=t._$AN;if(r===void 0)t._$AN=r=new Set;else if(r.has(e))break;r.add(e),Op(t)}};function Ap(e){this._$AN!==void 0?(Mn(this),this._$AM=e,v2(this)):this._$AM=e}function Lp(e,t=!1,r=0){let o=this._$AH,a=this._$AN;if(a!==void 0&&a.size!==0)if(t)if(Array.isArray(o))for(let i=r;i<o.length;i++)Po(o[i],!1),Mn(o[i]);else o!=null&&(Po(o,!1),Mn(o));else Po(this,e)}var Op=e=>{e.type==Ye.CHILD&&(e._$AP??=Lp,e._$AQ??=Ap)},Br=class extends ke{constructor(){super(...arguments),this._$AN=void 0}_$AT(t,r,o){super._$AT(t,r,o),v2(this),this.isConnected=t._$AU}_$AO(t,r=!0){t!==this.isConnected&&(this.isConnected=t,t?this.reconnected?.():this.disconnected?.()),r&&(Po(this,t),Mn(this))}setValue(t){if(Jc(this._$Ct))this._$Ct._$AI(t,this);else{let r=[...this._$Ct._$AH];r[this._$Ci]=t,this._$Ct._$AI(r,this,0)}}disconnected(){}reconnected(){}};var xs=class extends Br{get element(){var t;return(t=this.part)===null||t===void 0?void 0:t.element}constructor(t){super(t),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 le}update(t){return this.part=t,this.ensureFocusTrap(t.element),le}reconnected(){var t;this.ensureFocusTrap((t=this.part)===null||t===void 0?void 0:t.element)}disconnected(){this.removeFocusTrap()}ensureFocusTrap(t){var r,o;this.isElementTrappable(t)&&(((r=this.firstTrap)===null||r===void 0?void 0:r.parentElement)===t&&((o=this.lastTrap)===null||o===void 0?void 0:o.parentElement)===t||(this.removeFocusTrap(),this.createFocusTrap(t)))}removeFocusTrap(){var t,r,o,a;(t=this.firstTrap)===null||t===void 0||t.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(t){return!!t&&t instanceof HTMLElement&&t.childElementCount>0}createFocusTrap(t){this.firstTrap=this.createTrap(),this.lastTrap=this.createTrap(),t.insertBefore(this.firstTrap,t.firstChild),t.appendChild(this.lastTrap),this.lastTrap.addEventListener("focus",this.onLastTrapFocus),this.firstTrap.addEventListener("focus",this.onFirstTrapFocus)}createTrap(){let t=document.createElement("div");return t.tabIndex=0,t}getChildren(t){return t instanceof HTMLSlotElement?t.assignedElements():t.shadowRoot?t.shadowRoot.children:t.children}async focusFirstDescendant(t){await this.updateCompleteIfNecessary(t);let r=this.getChildren(t);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(t){await this.updateCompleteIfNecessary(t);let r=this.getChildren(t);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(t){t instanceof Pe&&await t.updateComplete}isInsideElement(t,r){for(let o=t;o;o=o.parentNode){if(o===r)return!0;o instanceof ShadowRoot?o=o.host:o.assignedSlot&&(o=o.assignedSlot)}return!1}attemptFocus(t){return t===this.firstTrap||t===this.lastTrap||!this.isFocusable(t)?!1:(t.focus(),!0)}isFocusable(t){return!t.checkVisibility()||this.isElementDisabled(t)?!1:t instanceof HTMLAnchorElement?!!t.href&&t.rel!=="ignore":t instanceof HTMLInputElement?t.type!=="hidden":t.tabIndex>=0}isElementDisabled(t){return"disabled"in t&&!!t.disabled}},gC=Oe(xs);var x2;(function(e){e.sm="sm",e.md="md",e.lg="lg",e.xl="xl"})(x2||(x2={}));var Rp={sm:640,md:768,lg:1024,xl:1280},Ss=class extends Br{constructor(t){super(t),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(t,[r,o,a]){return this.lastArgs=[r,o,a],this.render(r,o,a)}render(t,r,o){let a=this.resolveThreshold(t),i=o??(()=>q);return this.size>a?r():i()}resolveThreshold(t){return typeof t=="number"?t:Rp[t]}},xC=Oe(Ss);var Cs,Es,As,Ls,Os=navigator.vendor&&!!navigator.vendor.match(/apple/i)||((As=(Es=(Cs=window.safari)===null||Cs===void 0?void 0:Cs.pushNotification)===null||Es===void 0?void 0:Es.toString())!==null&&As!==void 0?As:"")==="[object SafariRemoteNotification]",wp="ontouchstart"in window||navigator.maxTouchPoints>0||navigator.msMaxTouchPoints>0;window.ftGlobals=(Ls=window.ftGlobals)!==null&&Ls!==void 0?Ls:{lit:xa,litDecorators:Ca,litRepeat:Ea,litClassMap:Aa,litStyleMap:La,litUnsafeHTML:Oa,wcUtils:{...Ia,...wa,...Ha,...ps,...$a,...Ga,...si,...ka,...Ci,...ys,...g2,...ss,...Ei,...ii,..._i,...fs,...Ri,...bs,...jl,...Na,...Mi,...ci,...Pi,...y2,...Zl,...ki,...ns,...ms,...Ai,...Oi,...ls,...Da,isSafari:Os,isTouchScreen:wp,setVariable:w}};var Tt=function(e,t,r,o){var a=arguments.length,i=a<3?t:o===null?o=Object.getOwnPropertyDescriptor(t,r):o,s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,t,r,o);else for(var c=e.length-1;c>=0;c--)(s=e[c])&&(i=(a<3?s(i):a>3?s(t,r,i):s(t,r))||i);return a>3&&i&&Object.defineProperty(t,r,i),i},Rs=class extends CustomEvent{constructor(t){super("change",{detail:{file:t}})}},xe=class extends Or(X){constructor(){super(...arguments),this.disabled=!1,this.label="",this.icon=void 0,this.trailingIcon=!1,this.accept=""}focus(){this.button.focus()}clear(){this.input.value=""}render(){return Z`
86
86
  <div class="ft-file-button">
87
87
  <ft-or-ftds-button ?disabled=${this.disabled}
88
88
  label="${this.label}"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fluid-topics/ft-file-button",
3
- "version": "2.0.23",
3
+ "version": "2.0.24",
4
4
  "description": "File",
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
  }