@fluid-topics/ft-number-field 1.2.46 → 1.2.49
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.
|
@@ -451,7 +451,7 @@ Also for action icons.`,e.colorGray200),contentGlobalSubtle:t.extend("--ft-conte
|
|
|
451
451
|
<div class="ft-ripple--background"></div>
|
|
452
452
|
<div class="ft-ripple--effect"></div>
|
|
453
453
|
</div>
|
|
454
|
-
`}contentAvailableCallback(o){super.contentAvailableCallback(o),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(o){var i,n;super.update(o),o.has("disabled")&&(this.disabled?(this.endRipple(),(i=this.target)===null||i===void 0||i.removeAttribute("data-is-ft-ripple-target")):(n=this.target)===null||n===void 0||n.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run(()=>this.defaultSetup())}defaultSetup(){var o,i;let n=(o=this.shadowRoot)===null||o===void 0?void 0:o.host.parentElement;n&&this.setupFor((i=this.target)!==null&&i!==void 0?i:n)}setupFor(o){if(this.setupDebouncer.cancel(),this.target===o)return;this.onDisconnect&&this.onDisconnect(),this.target=o,o.setAttribute("data-is-ft-ripple-target","true");let i=(...f)=>y=>{f.forEach(u=>window.addEventListener(u,this.endPress,{once:!0})),this.startPress(y)},n=i("mouseup","contextmenu"),c=i("touchend","touchcancel"),d=f=>{["Enter"," "].includes(f.key)&&i("keyup")(f)},l={passive:!0};o.addEventListener("mouseover",this.startHover,l),o.addEventListener("mousemove",this.moveRipple,l),o.addEventListener("mouseleave",this.endHover,l),o.addEventListener("mousedown",n,l),o.addEventListener("touchstart",c,l),o.addEventListener("touchmove",this.moveRipple,l),o.addEventListener("keydown",d,l),o.addEventListener("focus",this.startFocus,l),o.addEventListener("blur",this.endFocus,l),o.addEventListener("focusin",this.startFocus,l),o.addEventListener("focusout",this.endFocus,l),this.onDisconnect=()=>{o.removeAttribute("data-is-ft-ripple-target"),o.removeEventListener("mouseover",this.startHover,l),o.removeEventListener("mousemove",this.moveRipple,l),o.removeEventListener("mouseleave",this.endHover,l),o.removeEventListener("mousedown",n,l),o.removeEventListener("touchstart",c,l),o.removeEventListener("touchmove",this.moveRipple,l),o.removeEventListener("keydown",d,l),o.removeEventListener("focus",this.startFocus,l),o.removeEventListener("blur",this.endFocus,l),o.removeEventListener("focusin",this.startFocus,l),o.removeEventListener("focusout",this.endFocus,l),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(o){let i=o,n=o,c,d;return i.x!=null?{x:c,y:d}=i:n.touches!=null&&(c=n.touches[0].clientX,d=n.touches[0].clientY),{x:c,y:d}}isFocusVisible(o){return o instanceof HTMLElement?o.matches(":focus-visible"):!0}isIgnored(o){if(this.disabled)return!0;if(o!=null)for(let i of o.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}};C.elementDefinitions={};C.styles=ke;E([(0,I.property)({type:Boolean})],C.prototype,"primary",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"secondary",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"unbounded",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"activated",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"selected",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"disabled",void 0);E([(0,I.state)()],C.prototype,"hovered",void 0);E([(0,I.state)()],C.prototype,"focused",void 0);E([(0,I.state)()],C.prototype,"pressed",void 0);E([(0,I.state)()],C.prototype,"rippling",void 0);E([(0,I.state)()],C.prototype,"originX",void 0);E([(0,I.state)()],C.prototype,"originY",void 0);E([(0,I.query)(".ft-ripple")],C.prototype,"ripple",void 0);E([(0,I.query)(".ft-ripple--effect")],C.prototype,"rippleEffect",void 0);(0,Te.customElement)("ft-ripple")(C);var lo=h(R());var Bt=globalThis,xt=Bt.trustedTypes,_e=xt?xt.createPolicy("lit-html",{createHTML:a=>a}):void 0,Xe="$lit$",K=`lit$${Math.random().toFixed(9).slice(2)}$`,Qe="?"+K,xo=`<${Qe}>`,V=document,St=()=>V.createComment(""),pt=a=>a===null||typeof a!="object"&&typeof a!="function",Lt=Array.isArray,So=a=>Lt(a)||typeof a?.[Symbol.iterator]=="function",Nt=`[
|
|
454
|
+
`}contentAvailableCallback(o){super.contentAvailableCallback(o),this.rippleEffect&&this.rippleEffect.ontransitionstart!==this.onTransitionStart&&(this.rippleEffect.ontransitionstart=this.onTransitionStart,this.rippleEffect.ontransitionend=this.onTransitionEnd)}update(o){var i,n;super.update(o),o.has("disabled")&&(this.disabled?(this.endRipple(),(i=this.target)===null||i===void 0||i.removeAttribute("data-is-ft-ripple-target")):(n=this.target)===null||n===void 0||n.setAttribute("data-is-ft-ripple-target","true"))}endRipple(){this.endHover(),this.endFocus(),this.endPress(),this.rippling=!1}connectedCallback(){super.connectedCallback(),this.setupDebouncer.run(()=>this.defaultSetup())}defaultSetup(){var o,i;let n=(o=this.shadowRoot)===null||o===void 0?void 0:o.host.parentElement;n&&this.setupFor((i=this.target)!==null&&i!==void 0?i:n)}forceFocusUpdate(){var o;!((o=this.target)===null||o===void 0)&&o.matches(":focus-within")?this.startFocus():this.endFocus()}setupFor(o){if(this.setupDebouncer.cancel(),this.target===o)return;this.onDisconnect&&this.onDisconnect(),this.target=o,o.setAttribute("data-is-ft-ripple-target","true");let i=(...f)=>y=>{f.forEach(u=>window.addEventListener(u,this.endPress,{once:!0})),this.startPress(y)},n=i("mouseup","contextmenu"),c=i("touchend","touchcancel"),d=f=>{["Enter"," "].includes(f.key)&&i("keyup")(f)},l={passive:!0};o.addEventListener("mouseover",this.startHover,l),o.addEventListener("mousemove",this.moveRipple,l),o.addEventListener("mouseleave",this.endHover,l),o.addEventListener("mousedown",n,l),o.addEventListener("touchstart",c,l),o.addEventListener("touchmove",this.moveRipple,l),o.addEventListener("keydown",d,l),o.addEventListener("focus",this.startFocus,l),o.addEventListener("blur",this.endFocus,l),o.addEventListener("focusin",this.startFocus,l),o.addEventListener("focusout",this.endFocus,l),this.onDisconnect=()=>{o.removeAttribute("data-is-ft-ripple-target"),o.removeEventListener("mouseover",this.startHover,l),o.removeEventListener("mousemove",this.moveRipple,l),o.removeEventListener("mouseleave",this.endHover,l),o.removeEventListener("mousedown",n,l),o.removeEventListener("touchstart",c,l),o.removeEventListener("touchmove",this.moveRipple,l),o.removeEventListener("keydown",d,l),o.removeEventListener("focus",this.startFocus,l),o.removeEventListener("blur",this.endFocus,l),o.removeEventListener("focusin",this.startFocus,l),o.removeEventListener("focusout",this.endFocus,l),this.onDisconnect=void 0,this.target=void 0}}getCoordinates(o){let i=o,n=o,c,d;return i.x!=null?{x:c,y:d}=i:n.touches!=null&&(c=n.touches[0].clientX,d=n.touches[0].clientY),{x:c,y:d}}isFocusVisible(o){return o instanceof HTMLElement?o.matches(":focus-visible"):!0}isIgnored(o){if(this.disabled)return!0;if(o!=null)for(let i of o.composedPath()){if(i===this.target)break;if("hasAttribute"in i&&i.hasAttribute("data-is-ft-ripple-target"))return!0}return!1}disconnectedCallback(){super.disconnectedCallback(),this.onDisconnect&&this.onDisconnect(),this.endRipple()}};C.elementDefinitions={};C.styles=ke;E([(0,I.property)({type:Boolean})],C.prototype,"primary",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"secondary",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"unbounded",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"activated",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"selected",void 0);E([(0,I.property)({type:Boolean})],C.prototype,"disabled",void 0);E([(0,I.state)()],C.prototype,"hovered",void 0);E([(0,I.state)()],C.prototype,"focused",void 0);E([(0,I.state)()],C.prototype,"pressed",void 0);E([(0,I.state)()],C.prototype,"rippling",void 0);E([(0,I.state)()],C.prototype,"originX",void 0);E([(0,I.state)()],C.prototype,"originY",void 0);E([(0,I.query)(".ft-ripple")],C.prototype,"ripple",void 0);E([(0,I.query)(".ft-ripple--effect")],C.prototype,"rippleEffect",void 0);(0,Te.customElement)("ft-ripple")(C);var lo=h(R());var Bt=globalThis,xt=Bt.trustedTypes,_e=xt?xt.createPolicy("lit-html",{createHTML:a=>a}):void 0,Xe="$lit$",K=`lit$${Math.random().toFixed(9).slice(2)}$`,Qe="?"+K,xo=`<${Qe}>`,V=document,St=()=>V.createComment(""),pt=a=>a===null||typeof a!="object"&&typeof a!="function",Lt=Array.isArray,So=a=>Lt(a)||typeof a?.[Symbol.iterator]=="function",Nt=`[
|
|
455
455
|
\f\r]`,dt=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,Ve=/-->/g,Me=/>/g,T=RegExp(`>|${Nt}(?:([^\\s"'>=/]+)(${Nt}*=${Nt}*(?:[^
|
|
456
456
|
\f\r"'\`<>=]|("|')|))|$)`,"g"),Ye=/'/g,je=/"/g,Je=/^(?:script|style|textarea|title)$/i,zt=a=>(o,...i)=>({_$litType$:a,strings:o,values:i}),to=zt(1),eo=zt(2),oo=zt(3),st=Symbol.for("lit-noChange"),N=Symbol.for("lit-nothing"),qe=new WeakMap,_=V.createTreeWalker(V,129);function ro(a,o){if(!Lt(a)||!a.hasOwnProperty("raw"))throw Error("invalid template strings array");return _e!==void 0?_e.createHTML(o):o}var Co=(a,o)=>{let i=a.length-1,n=[],c,d=o===2?"<svg>":o===3?"<math>":"",l=dt;for(let f=0;f<i;f++){let y=a[f],u,v,m=-1,H=0;for(;H<y.length&&(l.lastIndex=H,v=l.exec(y),v!==null);)H=l.lastIndex,l===dt?v[1]==="!--"?l=Ve:v[1]!==void 0?l=Me:v[2]!==void 0?(Je.test(v[2])&&(c=RegExp("</"+v[2],"g")),l=T):v[3]!==void 0&&(l=T):l===T?v[0]===">"?(l=c??dt,m=-1):v[1]===void 0?m=-2:(m=l.lastIndex-v[2].length,u=v[1],l=v[3]===void 0?T:v[3]==='"'?je:Ye):l===je||l===Ye?l=T:l===Ve||l===Me?l=dt:(l=T,c=void 0);let Z=l===T&&a[f+1].startsWith("/>")?" ":"";d+=l===dt?y+xo:m>=0?(n.push(u),y.slice(0,m)+Xe+y.slice(m)+K+Z):y+K+(m===-2?f:Z)}return[ro(a,d+(a[i]||"<?>")+(o===2?"</svg>":o===3?"</math>":"")),n]},ft=class a{constructor({strings:o,_$litType$:i},n){let c;this.parts=[];let d=0,l=0,f=o.length-1,y=this.parts,[u,v]=Co(o,i);if(this.el=a.createElement(u,n),_.currentNode=this.el.content,i===2||i===3){let m=this.el.content.firstChild;m.replaceWith(...m.childNodes)}for(;(c=_.nextNode())!==null&&y.length<f;){if(c.nodeType===1){if(c.hasAttributes())for(let m of c.getAttributeNames())if(m.endsWith(Xe)){let H=v[l++],Z=c.getAttribute(m).split(K),yt=/([.?@])?(.*)/.exec(H);y.push({type:1,index:d,name:yt[2],strings:Z,ctor:yt[1]==="."?wt:yt[1]==="?"?Et:yt[1]==="@"?Rt:at}),c.removeAttribute(m)}else m.startsWith(K)&&(y.push({type:6,index:d}),c.removeAttribute(m));if(Je.test(c.tagName)){let m=c.textContent.split(K),H=m.length-1;if(H>0){c.textContent=xt?xt.emptyScript:"";for(let Z=0;Z<H;Z++)c.append(m[Z],St()),_.nextNode(),y.push({type:2,index:++d});c.append(m[H],St())}}}else if(c.nodeType===8)if(c.data===Qe)y.push({type:2,index:d});else{let m=-1;for(;(m=c.data.indexOf(K,m+1))!==-1;)y.push({type:7,index:d}),m+=K.length-1}d++}}static createElement(o,i){let n=V.createElement("template");return n.innerHTML=o,n}};function rt(a,o,i=a,n){if(o===st)return o;let c=n!==void 0?i._$Co?.[n]:i._$Cl,d=pt(o)?void 0:o._$litDirective$;return c?.constructor!==d&&(c?._$AO?.(!1),d===void 0?c=void 0:(c=new d(a),c._$AT(a,i,n)),n!==void 0?(i._$Co??=[])[n]=c:i._$Cl=c),c!==void 0&&(o=rt(a,c._$AS(a,o.values),c,n)),o}var It=class{constructor(o,i){this._$AV=[],this._$AN=void 0,this._$AD=o,this._$AM=i}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(o){let{el:{content:i},parts:n}=this._$AD,c=(o?.creationScope??V).importNode(i,!0);_.currentNode=c;let d=_.nextNode(),l=0,f=0,y=n[0];for(;y!==void 0;){if(l===y.index){let u;y.type===2?u=new Ct(d,d.nextSibling,this,o):y.type===1?u=new y.ctor(d,y.name,y.strings,this,o):y.type===6&&(u=new Wt(d,this,o)),this._$AV.push(u),y=n[++f]}l!==y?.index&&(d=_.nextNode(),l++)}return _.currentNode=V,c}p(o){let i=0;for(let n of this._$AV)n!==void 0&&(n.strings!==void 0?(n._$AI(o,n,i),i+=n.strings.length-2):n._$AI(o[i])),i++}},Ct=class a{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(o,i,n,c){this.type=2,this._$AH=N,this._$AN=void 0,this._$AA=o,this._$AB=i,this._$AM=n,this.options=c,this._$Cv=c?.isConnected??!0}get parentNode(){let o=this._$AA.parentNode,i=this._$AM;return i!==void 0&&o?.nodeType===11&&(o=i.parentNode),o}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(o,i=this){o=rt(this,o,i),pt(o)?o===N||o==null||o===""?(this._$AH!==N&&this._$AR(),this._$AH=N):o!==this._$AH&&o!==st&&this._(o):o._$litType$!==void 0?this.$(o):o.nodeType!==void 0?this.T(o):So(o)?this.k(o):this._(o)}O(o){return this._$AA.parentNode.insertBefore(o,this._$AB)}T(o){this._$AH!==o&&(this._$AR(),this._$AH=this.O(o))}_(o){this._$AH!==N&&pt(this._$AH)?this._$AA.nextSibling.data=o:this.T(V.createTextNode(o)),this._$AH=o}$(o){let{values:i,_$litType$:n}=o,c=typeof n=="number"?this._$AC(o):(n.el===void 0&&(n.el=ft.createElement(ro(n.h,n.h[0]),this.options)),n);if(this._$AH?._$AD===c)this._$AH.p(i);else{let d=new It(c,this),l=d.u(this.options);d.p(i),this.T(l),this._$AH=d}}_$AC(o){let i=qe.get(o.strings);return i===void 0&&qe.set(o.strings,i=new ft(o)),i}k(o){Lt(this._$AH)||(this._$AH=[],this._$AR());let i=this._$AH,n,c=0;for(let d of o)c===i.length?i.push(n=new a(this.O(St()),this.O(St()),this,this.options)):n=i[c],n._$AI(d),c++;c<i.length&&(this._$AR(n&&n._$AB.nextSibling,c),i.length=c)}_$AR(o=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);o&&o!==this._$AB;){let n=o.nextSibling;o.remove(),o=n}}setConnected(o){this._$AM===void 0&&(this._$Cv=o,this._$AP?.(o))}},at=class{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(o,i,n,c,d){this.type=1,this._$AH=N,this._$AN=void 0,this.element=o,this.name=i,this._$AM=c,this.options=d,n.length>2||n[0]!==""||n[1]!==""?(this._$AH=Array(n.length-1).fill(new String),this.strings=n):this._$AH=N}_$AI(o,i=this,n,c){let d=this.strings,l=!1;if(d===void 0)o=rt(this,o,i,0),l=!pt(o)||o!==this._$AH&&o!==st,l&&(this._$AH=o);else{let f=o,y,u;for(o=d[0],y=0;y<d.length-1;y++)u=rt(this,f[n+y],i,y),u===st&&(u=this._$AH[y]),l||=!pt(u)||u!==this._$AH[y],u===N?o=N:o!==N&&(o+=(u??"")+d[y+1]),this._$AH[y]=u}l&&!c&&this.j(o)}j(o){o===N?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,o??"")}},wt=class extends at{constructor(){super(...arguments),this.type=3}j(o){this.element[this.name]=o===N?void 0:o}},Et=class extends at{constructor(){super(...arguments),this.type=4}j(o){this.element.toggleAttribute(this.name,!!o&&o!==N)}},Rt=class extends at{constructor(o,i,n,c,d){super(o,i,n,c,d),this.type=5}_$AI(o,i=this){if((o=rt(this,o,i,0)??N)===st)return;let n=this._$AH,c=o===N&&n!==N||o.capture!==n.capture||o.once!==n.once||o.passive!==n.passive,d=o!==N&&(n===N||c);c&&this.element.removeEventListener(this.name,this,n),d&&this.element.addEventListener(this.name,this,o),this._$AH=o}handleEvent(o){typeof this._$AH=="function"?this._$AH.call(this.options?.host??this.element,o):this._$AH.handleEvent(o)}},Wt=class{constructor(o,i,n){this.element=o,this.type=6,this._$AN=void 0,this._$AM=i,this.options=n}get _$AU(){return this._$AM._$AU}_$AI(o){rt(this,o)}};var Oo=Bt.litHtmlPolyfillSupport;Oo?.(ft,Ct),(Bt.litHtmlVersions??=[]).push("3.3.0");var no=Symbol.for(""),vo=a=>{if(a?.r===no)return a?._$litStatic$},Ft=a=>({_$litStatic$:a,r:no});var ao=new Map,kt=a=>(o,...i)=>{let n=i.length,c,d,l=[],f=[],y,u=0,v=!1;for(;u<n;){for(y=o[u];u<n&&(d=i[u],(c=vo(d))!==void 0);)y+=c+o[++u],v=!0;u!==n&&f.push(d),l.push(y),u++}if(u===n&&l.push(o[n]),v){let m=l.join("$$lit$$");(o=ao.get(m))===void 0&&(l.raw=l,ao.set(m,o=l)),i=f}return a(o,...i)},$t=kt(to),sc=kt(eo),fc=kt(oo);var Ht=h(it()),co=h(R());var Ot;(function(a){a.title="title",a.title_dense="title-dense",a.subtitle1="subtitle1",a.subtitle2="subtitle2",a.body1="body1",a.body2="body2",a.caption="caption",a.breadcrumb="breadcrumb",a.overline="overline",a.button="button",a.display="display",a.title1="title-1",a.title2="title-2",a.title3="title-3",a.body1regular="body-1-regular",a.body1medium="body-1-medium",a.body1semibold="body-1-semibold",a.body2regular="body-2-regular",a.body2medium="body-2-medium",a.body2semibold="body-2-semibold",a.label1medium="label-1-medium",a.label1semibold="label-1-semibold",a.label1bold="label-1-bold",a.label2medium="label-2-medium",a.label2semibold="label-2-semibold",a.label2bold="label-2-bold",a.caption1medium="caption-1-medium",a.caption1semibold="caption-1-semibold",a.caption1bold="caption-1-bold",a.caption2medium="caption-2-medium",a.caption2semibold="caption-2-semibold",a.caption2bold="caption-2-bold"})(Ot||(Ot={}));var io=function(a,o,i,n){var c=arguments.length,d=c<3?o:n===null?n=Object.getOwnPropertyDescriptor(o,i):n,l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")d=Reflect.decorate(a,o,i,n);else for(var f=a.length-1;f>=0;f--)(l=a[f])&&(d=(c<3?l(d):c>3?l(o,i,d):l(o,i))||d);return c>3&&d&&Object.defineProperty(o,i,d),d},U=class extends co.FtLitElement{constructor(){super(...arguments),this.variant=Ot.body1}render(){return this.element?$t`
|
|
457
457
|
<${Ft(this.element)}
|