@joker.front/ui
Version:
Joker-UI | Official native UI component library for Joker Framework. Minimalist design with full-scene components, responsive layout & dynamic interactions. Access dev docs, API references & real-world case studies on official site.
9 lines • 605 kB
JavaScript
(function(L,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("@joker.front/core")):typeof define=="function"&&define.amd?define(["exports","@joker.front/core"],d):(L=typeof globalThis<"u"?globalThis:L||self,d(L.index={},L.core))})(this,function(L,d){"use strict";var hg=Object.defineProperty;var mg=(L,d,Ie)=>d in L?hg(L,d,{enumerable:!0,configurable:!0,writable:!0,value:Ie}):L[d]=Ie;var s=(L,d,Ie)=>mg(L,typeof d!="symbol"?d+"":d,Ie);var Mo,zo,Jo,Ho,Ko,Vo,Bo,Yo,Uo,Wo,Xo,qo,Go,Zo,Qo,ea,ta,oa,aa,ra,ia,sa,na,la,da,ca,pa,ua,ha,ma,fa,ga,ba,ka,ja,va,xa,_a,wa,Ca,Ea,ya,Ra,Sa,Ta,Da,$a,Ia,Oa,Aa,La,Pa,Na,Fa,Ma,za,Ja,Ha,Ka,Va,Ba,Ya,Ua,Wa,Xa,qa,Ga,Za,Qa,er,tr,or,ar,rr,ir,sr,nr,lr,dr,cr,pr,ur,hr,mr,fr,gr,br,kr,jr,vr,xr,_r,wr,Cr,Er,yr,Rr,Sr,Tr,Dr,$r,Ir,Or,Ar,Lr,Pr,Nr,Fr,Mr,zr,Jr,Hr,Kr,Vr,Br,Yr,Ur,Wr,Xr,qr,Gr,Zr,Qr,ei,ti,oi,ai,ri,ii,si,ni,li,di,ci,pi,ui,hi,mi,fi,gi,bi,ki,ji,vi,xi,_i,wi,Ci,Ei,yi,Ri,Si,Ti,Di,$i,Ii,Oi,Ai,Li,Pi,Ni,Fi,Mi,zi,Ji,Hi,Ki,Vi,Bi,Yi,Ui,Wi,Xi,qi,Gi,Zi,Qi,es,ts,os,as,rs,is,ss,ns,ls,ds,cs,ps,us,hs,ms,fs,gs,bs,ks,js,vs,xs,_s,ws,Cs,Es,ys,Rs;var Ie=Object.defineProperty,Ts=Object.getOwnPropertyNames,Ds=(t,r,e)=>r in t?Ie(t,r,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[r]=e,ze=(t,r)=>function(){return r||(0,t[Ts(t)[0]])((r={exports:{}}).exports,r),r.exports},Oe=(t,r,e)=>Ds(t,typeof r!="symbol"?r+"":r,e);function me(t){return t!==null&&typeof t=="object"}function Mt(t){return Object.prototype.toString.call(t)==="[object Object]"}function zt(t){if(t===null||typeof t!="object")return t;let r;Array.isArray(t)?r=[]:r={};let e=Object.keys(t);for(let o of e){let a=t[o];typeof a=="object"?r[o]=zt(a):r[o]=a}return r}function ke(t,r=""){let e=r.split("."),o=t,a,i=e.length;for(let n=0;n<i;n++){let l=e[n];if(!o)break;if(n===i-1){a=o[l];break}o=o[l]}return a}function Jt(t,r,e){return Array.isArray(t)&&Array.isArray(r)?$s(t,r):Ht(t,r)}function Ht(t,r,e){if(t===r)return!0;let o=me(t),a=me(r);return o&&a?Mt(t)&&Mt(r)?Object.keys(t).length!==Object.keys(r).length?!1:JSON.stringify(t)===JSON.stringify(r):t===r:!o&&!a?String(t)===String(r):!1}function ie(t,r){let e=t.indexOf(r);return e>-1&&t.splice(e,1),t}function Qe(t,r){let e=t.findIndex(o=>r(o));return e>-1&&t.splice(e,1),t}function $s(t,r,e){if(t.length!==r.length)return!1;for(let o=0;o<t.length;o++)if(Ht(t[o],r[o])===!1)return!1;return!0}function Kt(t){return Array.apply(null,{length:t}).map((r,e)=>e)}function Je(t=32){let r=[],e=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z"];for(let o=0;o<t;o++){let a=Math.round(Math.random()*(e.length-1));r.push(e[a])}return r.join("")}function Is(t,r="-"){return t=t||"",t.split(/(?=[A-Z])/).map(o=>o.toLowerCase()).join(r)}function Os(t=""){return t.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&")}function As(){let t=[];function r(a){return t.push(a),()=>{ie(t,a)}}function e(){t=[]}function o(a){ie(t,a)}return{add:r,callbacks:t,reset:e,remove:o}}var Vt="warn",Bt=["silent","error","warn","info"];function Yt(){let t=new Date;function r(e,o=2){return e.toString().padStart(o,"0")}return r(t.getHours())+":"+r(t.getMinutes())+":"+r(t.getSeconds())+":"+r(t.getMilliseconds(),3)}function pt(t,r,e,o){Bt.indexOf(t)<=Bt.indexOf(Vt)&&(o===void 0?console[t](`${Yt()} [${r}]:`,e):console[t](`${Yt()} [${r}]:`,e,o))}function Ls(t,r,e){pt("info",t,r,e)}function Ps(t,r,e){pt("warn",t,r,e)}function Ns(t,r,e){pt("error",t,r,e)}function Fs(t){Vt=t}var K={info:Ls,warn:Ps,error:Ns,setLoggerLeve:Fs},Ms=class{constructor(t="hex"){Oe(this,"format"),Oe(this,"h",0),Oe(this,"s",100),Oe(this,"v",100),Oe(this,"a",100),Oe(this,"value",""),this.format=t}setVal(t,r){this[t]=r,this.doOnChange()}toRgb(){return ht(this.h,this.s,this.v)}setFormat(t){this.format=t,this.doOnChange()}fromString(t){if(!t){this.h=0,this.s=100,this.v=100,this.doOnChange();return}let r=(e,o,a)=>{this.h=Math.max(0,Math.min(360,e)),this.s=Math.max(0,Math.min(100,o)),this.v=Math.max(0,Math.min(100,a)),this.doOnChange()};if(t.indexOf("rgb")!==-1){let e=t.replace(/rgba|rgb|\(|\)/gm,"").split(/\s|,/g).filter(o=>o!=="").map((o,a)=>a>2?parseFloat(o):parseInt(o,10));if(e.length===4?this.a=Math.floor(e[3]*100):e.length===3&&(this.a=100),e.length>=3){let{h:o,s:a,v:i}=Ut(e[0],e[1],e[2]);r(o,a,i)}}else if(t.indexOf("#")!==-1){let e=t.replace("#","").trim();if(!/^(?:[0-9a-fA-F]{3}){1,2}|[0-9a-fA-F]{8}$/.test(e))return;let o=0,a=0,i=0;e.length===3?(o=Re(e[0]+e[0]),a=Re(e[1]+e[1]),i=Re(e[2]+e[2])):(e.length===6||e.length===8)&&(o=Re(e.substring(0,2)),a=Re(e.substring(2,4)),i=Re(e.substring(4,6))),e.length===8?this.a=Math.floor(Re(e.substring(6))/255*100):(e.length===3||e.length===6)&&(this.a=100);let{h:n,s:l,v:c}=Ut(o,a,i);r(n,l,c)}}compare(t){return Math.abs(t.h-this.h)<2&&Math.abs(t.s-this.s)<1&&Math.abs(t.v-this.v)<1&&Math.abs(t.a-this.a)<1}doOnChange(){let{h:t,s:r,v:e,a:o,format:a}=this;switch(a){case"rgba":let{r:i,g:n,b:l}=ht(t,r,e);this.value=`rgba(${i}, ${n}, ${l}, ${o/100})`;break;default:this.value=Hs(t,r,e,o/100)}}},zs=function(t){return typeof t=="string"&&t.indexOf(".")!==-1&&parseFloat(t)===1},Js=function(t){return typeof t=="string"&&t.indexOf("%")!==-1},Ae=function(t,r){zs(t)&&(t="100%");let e=Js(t);return t=Math.min(r,Math.max(0,parseFloat(t))),e&&(t=parseInt(t*r,10)/100),Math.abs(t-r)<1e-6?1:t%r/parseFloat(r)},ut={A:10,B:11,C:12,D:13,E:14,F:15},Re=function(t){return t.length===2?(ut[t[0].toUpperCase()]||+t[0])*16+(ut[t[1].toUpperCase()]||+t[1]):ut[t[1].toUpperCase()]||+t[1]};function Ut(t,r,e){t=Ae(t,255),r=Ae(r,255),e=Ae(e,255);let o=Math.max(t,r,e),a=Math.min(t,r,e),i=0,n=0,l=o,c=o-a;if(n=o===0?0:c/o,o===a)i=0;else{switch(o){case t:i=(r-e)/c+(r<e?6:0);break;case r:i=(e-t)/c+2;break;case e:i=(t-r)/c+4;break}i/=6}return{h:i*360,s:n*100,v:l*100}}function ht(t,r,e){t=Ae(t,360)*6,r=Ae(r,100),e=Ae(e,100);let o=Math.floor(t),a=t-o,i=e*(1-r),n=e*(1-a*r),l=e*(1-(1-a)*r),c=o%6,p=[e,n,i,i,l,e][c],u=[l,e,e,n,i,i][c],m=[i,i,l,e,e,n][c];return{r:Math.round(p*255),g:Math.round(u*255),b:Math.round(m*255)}}var Hs=function(t,r,e,o){let a=ht(t,r,e),i=Math.floor(o*a.r+(1-o)*255),n=Math.floor(o*a.g+(1-o)*255),l=Math.floor(o*a.b+(1-o)*255);return"#"+("0"+i.toString(16)).slice(-2)+("0"+n.toString(16)).slice(-2)+("0"+l.toString(16)).slice(-2)};function He(t,r,e={}){let o,a=!1,i=0,n=()=>{o&&clearTimeout(o)},l=p=>{n(),a=!p};function c(...p){let u=Date.now()-i;if(a)return;let m=()=>{i=Date.now(),r.apply(c,p)};function w(){o=void 0}!e.noLeading&&e.debounceMode&&!o&&m(),n(),e.debounceMode===void 0&&u>t?e.noLeading?(i=Date.now(),e.noTrailing||(o=setTimeout(e.debounceMode?w:m,t))):m():e.noTrailing!==!0&&(o=setTimeout(e.debounceMode?w:m,e.debounceMode===void 0?t-u:t))}return c.cancel=l,c}function de(t,r,e=!1){return He(t,r,{debounceMode:e!==!1})}const Ks=/([\:\-\_]+(.))/g,Vs=/^moz([A-Z])/;function h(t){return`__joker_${t}_name__`}function Wt(){return!isNaN(Number(document.documentMode))}function Xt(){return navigator.userAgent.indexOf("Edge")>-1}function Ke(t,r){if(t===r)return!0;if(!(t instanceof Array)||!(r instanceof Array)||t.length!==r.length)return!1;for(let e=0;e!==t.length;++e)if(t[e]!==r[e])return!1;return!0}function Bs(t){let r=[];const e=["transform","transition","animation"],o=["ms-","webkit-"];return e.forEach(a=>{const i=t[a];a&&i&&o.forEach(n=>{r.push(n+a+":"+i)})}),r.join(";")}function mt(t){if(t!==void 0)return t=(t!=null?t:"").toString(),isNaN(parseFloat(t))?t:t+"px"}function qt(t){let r=!1;return function(...e){r||(r=!0,window.requestAnimationFrame(o=>{t.apply(this,e),r=!1}))}}function Ys(){return!!window.navigator.userAgent.match(/firefox/i)}function Us(t){return t&&t.nodeType===Node.ELEMENT_NODE}const et=(t,r)=>{let e=t;for(;e;){if([window,document,document.documentElement].includes(e))return document.documentElement;if(Ws(e))return e;e=e.parentNode}return e},Ws=(t,r)=>{const e=Gt(t,"overflow");return e==null?void 0:e.match(/(scroll|auto|overlay)/)},Gt=function(t,r){if(!t||!r)return null;r=Xs(r),r==="float"&&(r="cssFloat");try{var e=document.defaultView&&document.defaultView.getComputedStyle(t,"");return t.style[r]||e&&e[r]||null}catch{return t.style[r]}},Xs=function(t){return t.replace(Ks,function(r,e,o,a){return a?o.toUpperCase():o}).replace(Vs,"Moz$1")},qs=(t,r)=>{if(!t||!r)return!1;const e=t.getBoundingClientRect();let o;return[window,document,document.documentElement,null,void 0].includes(r)?o={top:0,right:window.innerWidth,bottom:window.innerHeight,left:0}:o=r.getBoundingClientRect(),e.top<o.bottom&&e.bottom>o.top&&e.right>o.left&&e.left<o.right};let Zt=()=>document.documentElement.style.objectFit!==void 0;class Gs extends d.Component{constructor(){super(...arguments);s(this,"propsOption",{type:"default",nativeType:"button"});s(this,"name",h("button"));s(this,"model",{loading:!1})}created(){this.$syncProp("loading")}handleClick(e){this.$trigger("click",void 0,e)}handleMouseEnter(e){this.$trigger("mouseenter",void 0,e)}handleMouseLeave(e){this.$trigger("mouseleave",void 0,e)}}let Zs={render:function(t){return[t.createElement("button",{disabled:"@(props.disabled || model.loading)",autofocus:"@props.autofocus",type:"@props.nativeType","@click":"handleClick","@mouseenter":"handleMouseEnter","@mouseleave":"handleMouseLeave",class:"@([ 'jk-button', props.type || '', props.size || '', { 'is-link': props.link, 'is-disabled': props.disabled, 'is-loading': model.loading, 'is-plain': props.plain, 'is-round': props.round, 'is-circle': props.circle, 'is-fullwidth': props.fullWidth }, props.class ])"},[t.createCommand("if","model.loading",[t.createElement("i",{class:"jk-icon-loading"},[])]),t.createCommand("if","props.icon && !model.loading",[t.createElement("i",{class:"@props.icon"},[])]),t.createCommand("if","$sections && $sections.default && !props.circle",[t.createElement("span",{},[t.createCommand("RenderSection","")])])])]}},Qs={component:Gs},Se=class extends(zo=Qs.component,Mo=d.SCOPE_ID,zo){constructor(){super(...arguments);s(this,Mo,"4c4aa2cd");s(this,"template",Zs.render)}},en={render:function(t){return[t.createElement("div",{class:"jk-button-group"},[t.createCommand("RenderSection","")])]}},tn={component:class extends d.Component{}},on=class extends(Ho=tn.component,Jo=d.SCOPE_ID,Ho){constructor(){super(...arguments);s(this,Jo,"e5cf9734");s(this,"template",en.render)}};class an extends d.Component{}let rn={render:function(t){return[t.createElement("i",{class:"jk-icon-@props.name @(props.class||'')"},[])]}},sn={component:an},nn=class extends sn.component{constructor(){super(...arguments);s(this,"template",rn.render)}};class ln extends d.Component{constructor(){super(...arguments);s(this,"propsOption",{span:{type:Number,default:24},tag:"div",offset:Number,pull:Number,push:Number})}mounted(){this.$render([d.createElement(this.props.tag,{class:"jk-col @classVal",style:"@styleVal"},[d.createCommand("RenderSection")])])}get classVal(){let e=[];return this.setClassColItem("span",e),this.setClassColItem("offset",e),this.setClassColItem("pull",e),this.setClassColItem("push",e),this.setClassSizeItem("xs",e),this.setClassSizeItem("sm",e),this.setClassSizeItem("md",e),this.setClassSizeItem("lg",e),this.setClassSizeItem("xl",e),e.join(" ")}get styleVal(){let e="";if(this.gutter){let o=this.gutter/2+"px";e+=`padding-left:${o};`,e+=`padding-right:${o};`}return e}get gutter(){var o;let e=(o=this.$rootVNode)==null?void 0:o.closest(a=>a instanceof d.VNode.Component&&a.component&&a.component.name===h("layout_row"));return e?e.component.props.gutter:0}setClassColItem(e,o){let a=this.props[e];(a||a===0)&&o.push(e==="span"?`col-${a}`:`col-${e}-${a}`)}setClassSizeItem(e,o){let a=this.props[e];if(typeof a=="object")for(let i in a)o.push(i==="span"?`col-${e}-${a}`:`col-${e}-${i}-${a}`);else a!==void 0&&o.push(`col-${e}-${a}`)}}let dn={render:function(t){return[]}},cn={component:ln},pn=class extends(Vo=cn.component,Ko=d.SCOPE_ID,Vo){constructor(){super(...arguments);s(this,Ko,"064a439e");s(this,"template",dn.render)}};class un extends d.Component{constructor(){super(...arguments);s(this,"name",h("layout_row"));s(this,"propsOption",{tag:"div",justify:"start",gutter:Number});s(this,"template",()=>[d.createElement(this.props.tag,{class:"jk-row @classVal",style:"@styleVal"},[d.createCommand("RenderSection")])])}get classVal(){let e=[];return this.props.justify!=="start"&&e.push("is-justify-"+this.props.justify),this.props.align&&e.push("is-align-"+this.props.align),this.props.type==="flex"&&e.push("is-flex"),e.join(" ")}get styleVal(){let e="";if(this.props.gutter){let o=this.props.gutter/2;e+=`margin-left:-${o}px;`,e+=`margin-right:-${o}px;`}return e}}let hn={component:un},mn=class extends(Yo=hn.component,Bo=d.SCOPE_ID,Yo){constructor(){super(...arguments);s(this,Bo,"af1ff92c")}};class fn extends d.Component{constructor(){super(...arguments);s(this,"propsOption",{href:"javascript:void(0)",underline:!0})}handleClick(e){this.$trigger("click",void 0,e)}}let gn={render:function(t){return[t.createElement("a",{class:"@([ 'jk-link', props.type || 'default', { 'is-disabled': props.disabled, 'is-underline': props.underline && !props.disabled }, props.class, props.size ])",href:"@props.href",target:"@props.target","@click":"handleClick"},[t.createCommand("if","props.icon",[t.createElement("i",{class:"@props.icon"},[])]),t.createCommand("if","$sections && $sections.default",[t.createElement("span",{},[t.createCommand("RenderSection","")])])])]}},bn={component:fn},ft=class extends(Wo=bn.component,Uo=d.SCOPE_ID,Wo){constructor(){super(...arguments);s(this,Uo,"5698f682");s(this,"template",gn.render)}};class H extends d.Component{constructor(...e){super(...e);s(this,"formItemOption");this.$on("created",()=>{var o,a;(a=(o=this.model).value)!=null||(o.value=void 0),this.$syncProp("value"),this.formItemOption=Qt(this)})}get isError(){var e;return this.props.error||((e=this.formItemOption)==null?void 0:e.ctrl.validateState.value)==="error"}get form(){var e,o;return(o=(e=this.$root)==null?void 0:e.closest(a=>a instanceof d.VNode.Component&&a.component.name===h("form")))==null?void 0:o.component}get sizeClass(){var e;return this.props.size||((e=this.form)==null?void 0:e.props.size)}triggerValidate(){this.$trigger("validate")}get value(){return this.model.value}set value(e){this.model.value=e}}function Qt(t){var e,o,a,i;if(!t.props.name)return;if(!("value"in t.model)){K.warn("formCtrl","The registered control does not conform to the rules of the Form form control. The [model.value] property is missing.",t);return}let r=t.props.name;if(t.$root&&t.$root instanceof d.VNode.Node){let n=(o=(e=t.$root)==null?void 0:e.closest(c=>c instanceof d.VNode.Component&&c.component.name===h("form")))==null?void 0:o.component;if(!n)return;let l=(i=(a=t.$root)==null?void 0:a.closest(c=>c instanceof d.VNode.Component&&c.component.name===h("form-item")))==null?void 0:i.component;return n.registerFormCtrl(r,{ctrl:t,formItem:l}),t.$on("validate",()=>{n==null||n.validate(r).catch(c=>{})}),t.$on("beforeDestroy",()=>{n.unRegisterFormCtrl(r,t)}),{form:n,formItem:l,ctrl:n.ctrls[r],unRegisterFormCtrl:()=>{n.unRegisterFormCtrl(r,t)}}}}class kn extends H{constructor(){super(...arguments);s(this,"model",{value:void 0,focus:!1})}mounted(){this.$watch(()=>this.checked,e=>{this.$getRef("radio").output.checked=e}),this.$getRef("radio").output.checked=this.checked}get checked(){return this.group?this.value===this.props.value:this.props.value}get group(){var e;return(e=this.$rootVNode)==null?void 0:e.closest(o=>{var a;return o instanceof d.VNode.Component&&((a=o.component)==null?void 0:a.name)===h("radio_group")})}get value(){return this.group?this.group.component.model.value:this.model.value}set value(e){this.group?this.group.component.checked(e):this.model.value=e,this.$getRef("radio").output.checked=this.model.value===this.props.value}get isDisabled(){var e,o,a;return(a=(o=(e=this.group)==null?void 0:e.component)==null?void 0:o.props.disabled)!=null?a:this.props.disabled}get tabIndex(){return this.isDisabled||this.group&&this.value!==this.props.value?-1:0}get size(){var e;return((e=this.group)==null?void 0:e.component.props.size)||this.props.size}handleKeydown(e){this.isDisabled||(this.value=this.props.value)}handleFocus(e){this.model.focus=!0}handleBlur(e){this.model.focus=!1}handleChange(e){var o,a;(o=e.target)!=null&&o.output.checked&&(this.value=this.props.value,(a=this.group)==null||a.component.handleChange(e,this.value)),this.$trigger("change",this.value),this.triggerValidate()}handleClick(e){this.$trigger("click",void 0,e)}}let jn={render:function(t){return[t.createElement("label",{class:"@([ 'jk-radio', props.border && size && size, props.class, isDisabled && 'is-disabled', model.focus && 'is-focus', props.border && 'is-border', checked && 'is-checked' ])",role:"radio","aria-checked":"@(checked)","aria-disabled":"@isDisabled",tabindex:"@tabIndex","@click":"handleClick","@keydown.space.stop.prevent":"handleKeydown"},[t.createElement("span",{class:"input @(isDisabled?'is-disabled':'') @(checked?'is-checked':'')"},[t.createElement("span",{class:"target"},[]),t.createElement("input",{ref:"radio",type:"radio",value:"@props.label",name:"@props.name",disabled:"@isDisabled",tabindex:"-1",autocomplete:"off","@focus":"handleFocus","@blur":"handleBlur","@change":"handleChange"},[])]),t.createCommand("if","$sections.default || props.label",[t.createElement("span",{class:"label","@keydown.stop":"__UNDEFINED_BUFFER__"},[t.createCommand("if","$sections.default",[t.createCommand("RenderSection","")]),t.createCommand("else","",[t.createCodeFunction("props.label")])])])])]}},vn={component:kn},eo=class extends(qo=vn.component,Xo=d.SCOPE_ID,qo){constructor(){super(...arguments);s(this,Xo,"1a4217e0");s(this,"template",jn.render)}};class xn extends H{constructor(){super(...arguments);s(this,"name",h("radio_group"));s(this,"model",{value:void 0})}handleKeydown(e){let o=e.event,a=e.event.target,i=this.$getRef("group").output,n=a.tagName==="INPUT"?"[type=radio]":"[role=radio]",l=i.querySelectorAll(n);if(l&&l.length){let c=Array.from(l).indexOf(a),p=l.length,u=i.querySelectorAll("[role=radio]");switch(o.key){case"ArrowLeft":case"ArrowUp":o.stopPropagation(),o.preventDefault(),c===0?(u[p-1].click(),u[p-1].focus()):(u[c-1].click(),u[c-1].focus());break;case"ArrowRight":case"ArrowDown":o.stopPropagation(),o.preventDefault(),c===l.length-1?(u[0].click(),u[0].focus()):(u[c+1].click(),u[c+1].focus());break}}}checked(e){this.model.value=e}handleChange(e,o){this.$trigger("change",o,e),this.triggerValidate()}}let _n={render:function(t){return[t.createElement("div",{class:"@(['jk-radio-group', props.class])",ref:"group","@keydown":"handleKeydown"},[t.createCommand("RenderSection","")])]}},wn={component:xn},Cn=class extends wn.component{constructor(){super(...arguments);s(this,"template",_n.render)}};class En extends H{constructor(){super(...arguments);s(this,"model",{value:void 0,focus:!1})}mounted(){this.$watch(()=>this.value===this.props.value,e=>{this.$getRef("radio").output.checked=e}),this.$getRef("radio").output.checked=this.value===this.props.value}get group(){var e;return(e=this.$rootVNode)==null?void 0:e.closest(o=>{var a;return o instanceof d.VNode.Component&&((a=o.component)==null?void 0:a.name)===h("radio_group")})}get value(){return this.group?this.group.component.model.value:this.model.value}set value(e){this.group?this.group.component.checked(e):this.model.value=e,this.$getRef("radio").output.checked=this.model.value===this.props.value}get isDisabled(){var e,o,a;return(a=(o=(e=this.group)==null?void 0:e.component)==null?void 0:o.props.disabled)!=null?a:this.props.disabled}get tabIndex(){return this.isDisabled||this.group&&this.value!==this.props.value?-1:0}get size(){var e;return((e=this.group)==null?void 0:e.component.props.size)||this.sizeClass}handleKeydown(e){this.isDisabled||(this.value=this.props.value)}handleFocus(e){this.model.focus=!0}handleBlur(e){this.model.focus=!1}handleChange(e){var o,a;(o=e.target)!=null&&o.output.checked&&(this.value=this.props.value,(a=this.group)==null||a.component.handleChange(e,this.value)),this.$trigger("change",this.value),this.triggerValidate()}}let yn={render:function(t){return[t.createElement("label",{class:"@([ 'jk-radio-button', size, props.class, isDisabled && 'is-disabled', model.focus && 'is-focus', value === props.value && 'is-checked' ])",role:"radio","aria-checked":"@(value === props.label)","aria-disabled":"@isDisabled",tabindex:"@tabIndex","@keydown.space.stop.prevent":"handleKeydown"},[t.createElement("input",{ref:"radio",type:"radio",value:"@props.label",name:"@props.name",disabled:"@isDisabled",tabindex:"-1",autocomplete:"off","@focus":"handleFocus","@blur":"handleBlur","@change":"handleChange"},[]),t.createElement("span",{class:"target","@keydown.stop":"__UNDEFINED_BUFFER__"},[t.createCommand("if","$sections.default",[t.createCommand("RenderSection","")]),t.createCommand("else","",[t.createCodeFunction("props.label")])])])]}},Rn={component:En},Sn=class extends(Zo=Rn.component,Go=d.SCOPE_ID,Zo){constructor(){super(...arguments);s(this,Go,"48cc174d");s(this,"template",yn.render)}};class Tn extends H{constructor(){super(...arguments);s(this,"model",{value:void 0,focus:!1,disabled:!1});s(this,"propsOption",{value:{default:!1}})}mounted(){this.$syncProp("disabled"),this.$watch(()=>this.value===this.props.label,e=>{this.$getRef("checkbox").output.checked=e}),this.$getRef("checkbox").output.checked=!!this.value}get group(){var e;return(e=this.$rootVNode)==null?void 0:e.closest(o=>{var a;return o instanceof d.VNode.Component&&((a=o.component)==null?void 0:a.name)===h("checkbox-group")})}get value(){return this.group?this.group.component.model.value.indexOf(this.props.value)>-1:this.model.value}set value(e){this.group?this.group.component.checked(this.props.value,e):this.model.value=e,this.$getRef("checkbox").output.checked=!!this.model.value}get isLimitDisabled(){if(this.group){let{max:e,min:o}=this.group.component.props,a=this.group.component.model.value;return!!(e||o)&&a.length>=e&&!this.value||a.length<=o&&this.value}return!1}get isDisabled(){var e,o,a;return(a=(o=(e=this.group)==null?void 0:e.component)==null?void 0:o.props.disabled)!=null?a:this.model.disabled||this.isLimitDisabled}get tabIndex(){return this.isDisabled||this.group&&this.value!==this.props.label?-1:0}get size(){var e,o;return((e=this.group)==null?void 0:e.component.props.size)||this.props.size||((o=this.formItemOption)==null?void 0:o.form.props.size)}handleKeydown(e){this.isDisabled||(this.value=!this.value)}handleFocus(e){this.model.focus=!0}handleBlur(e){this.model.focus=!1}handleChange(e){var o;this.group?(this.value=!this.value,(o=this.group)==null||o.component.handleChange(e)):this.value=!this.value,this.$trigger("change",this.value),this.triggerValidate()}}let Dn={render:function(t){return[t.createElement("label",{class:"@([ 'jk-checkbox', size, isDisabled && 'is-disabled', model.focus && 'is-focus', props.border && 'is-border', value && 'is-checked', props.indeterminate && 'is-indeterminate', props.class ])",role:"checkbox","aria-checked":"@value","aria-disabled":"@isDisabled",tabindex:"@tabIndex","@keydown.space.stop.prevent":"handleKeydown"},[t.createElement("span",{class:"input @(isDisabled?'is-disabled':'') @(value?'is-checked':'')"},[t.createElement("span",{class:"target"},[]),t.createElement("input",{ref:"checkbox",type:"checkbox",value:"@(props.label)",checked:"@value",name:"@props.name",disabled:"@isDisabled",tabindex:"-1",autocomplete:"off","@focus":"handleFocus","@blur":"handleBlur","@change":"handleChange"},[])]),t.createCommand("if","$sections.default || props.label",[t.createElement("span",{class:"label","@keydown.stop":"__UNDEFINED_BUFFER__"},[t.createCommand("if","$sections.default",[t.createCommand("RenderSection","")]),t.createCommand("else","",[t.createCodeFunction("props.label")])])])])]}},$n={component:Tn},Ve=class extends(ea=$n.component,Qo=d.SCOPE_ID,ea){constructor(){super(...arguments);s(this,Qo,"69ac0612");s(this,"template",Dn.render)}};class In extends H{constructor(){super(...arguments);s(this,"propsOption",{min:Number,max:Number,value:[]});s(this,"name",h("checkbox-group"));s(this,"model",{value:[]})}created(){this.$syncProp("value")}handleKeydown(e){let o=e.event,a=e.event.target,i=this.$getRef("group").output,n=a.tagName==="INPUT"?"[type=checkbox]":"[role=checkbox]",l=i.querySelectorAll(n);if(l&&l.length){let c=Array.from(l).indexOf(a),p=l.length,u=i.querySelectorAll("[role=checkbox]");switch(o.key){case"ArrowLeft":case"ArrowUp":o.stopPropagation(),o.preventDefault(),c===0?u[p-1].focus():u[c-1].focus();break;case"ArrowRight":case"ArrowDown":o.stopPropagation(),o.preventDefault(),c===l.length-1?u[0].focus():u[c+1].focus();break;case" ":case"Enter":o.stopPropagation(),o.preventDefault(),u[c].click()}}}checked(e,o){if(o)this.model.value.push(e);else{let a=this.model.value.indexOf(e);this.model.value.splice(a,1)}}handleChange(e){this.$trigger("change",this.model.value,e),this.triggerValidate()}}let On={render:function(t){return[t.createElement("div",{class:"jk-checkbox-group",ref:"group","@keydown":"handleKeydown"},[t.createCommand("RenderSection","")])]}},An={component:In},Ln=class extends An.component{constructor(){super(...arguments);s(this,"template",On.render)}};class Pn extends H{constructor(){super(...arguments);s(this,"model",{value:void 0,focus:!1,disabled:!1})}mounted(){this.$syncProp("disabled"),this.$watch(()=>this.value===this.props.label,e=>{this.$getRef("checkbox").output.checked=e}),this.$getRef("checkbox").output.checked=!!this.value}get group(){var e;return(e=this.$rootVNode)==null?void 0:e.closest(o=>{var a;return o instanceof d.VNode.Component&&((a=o.component)==null?void 0:a.name)===h("checkbox-group")})}get value(){return this.group?this.group.component.model.value.indexOf(this.props.value)>-1:this.model.value}set value(e){this.group?this.group.component.checked(this.props.value,e):this.model.value=e,this.$getRef("checkbox").output.checked=!!this.model.value}get isLimitDisabled(){if(this.group){const{max:e,min:o}=this.group.component.props,a=this.group.component.model.value;return!!(e||o)&&a.length>=e&&!this.value||a.length<=o&&this.value}return!1}get isDisabled(){var e,o,a;return(a=(o=(e=this.group)==null?void 0:e.component)==null?void 0:o.props.disabled)!=null?a:this.model.disabled||this.isLimitDisabled}get tabIndex(){return this.isDisabled||this.group&&this.value!==this.props.label?-1:0}get size(){var e;return((e=this.group)==null?void 0:e.component.props.size)||this.sizeClass}handleKeydown(e){this.isDisabled||(this.value=!this.value)}handleFocus(e){this.model.focus=!0}handleBlur(e){this.model.focus=!1}handleChange(e){var o;this.group?(this.value=!this.value,(o=this.group)==null||o.component.handleChange(e)):this.value=!this.value,this.$trigger("change",this.value),this.triggerValidate()}}let Nn={render:function(t){return[t.createElement("label",{class:"@(['jk-checkbox-button', size, { 'is-disabled': isDisabled, 'is-focus': model.focus, 'is-checked': value }])",role:"checkbox","aria-checked":"@value","aria-disabled":"@isDisabled",tabindex:"@tabIndex","@keydown.space.stop.prevent":"handleKeydown"},[t.createElement("input",{ref:"checkbox",type:"checkbox",checked:"@value",name:"@props.name",disabled:"@isDisabled",tabindex:"-1",autocomplete:"off","@focus":"handleFocus","@blur":"handleBlur","@change":"handleChange"},[]),t.createElement("span",{class:"target","@keydown.stop":"__UNDEFINED_BUFFER__"},[t.createCommand("RenderSection",""),t.createCommand("if","!($sections && $sections.default)",[t.createCodeFunction("props.label")])])])]}},Fn={component:Pn},Mn=class extends(oa=Fn.component,ta=d.SCOPE_ID,oa){constructor(){super(...arguments);s(this,ta,"bdcd7e21");s(this,"template",Nn.render)}};class zn extends H{constructor(){super(...arguments);s(this,"model",{hovering:!1,focused:!1,isComposing:!1});s(this,"propsOption",{type:"text",autocomplete:"off",maxlength:Number,minlength:Number})}mounted(){this.setNativeInputValue(),this.$watch(()=>this.model.value,()=>{this.setNativeInputValue()}),this.$watch(()=>this.props.value,()=>{this.triggerValidate()}),this.$watch(()=>this.props.type,()=>{this.setNativeInputValue()}),this.props.autofocus&&setTimeout(()=>{var e;if(this.$root){let o=(e=this.$getRef("input"))==null?void 0:e.output;o==null||o.focus()}})}get isWordLimitVisible(){return this.props.showWordLimit&&this.props.maxlength&&this.props.type==="text"&&!this.props.disabled&&!this.props.readonly}get validateIcon(){let e=this.formItemOption.ctrl.validateState.value;return e&&{validating:"jk-icon-loading",success:"jk-icon-circle-check",error:"jk-icon-circle-close"}[e]}get textLength(){return typeof this.value=="number"?String(this.value).length:(this.value||"").length}get inputExceed(){return this.isWordLimitVisible&&this.textLength>this.props.maxlength}get nativeInputValue(){return this.value===null||this.value===void 0?"":String(this.value)}get showClear(){return(this.props.forceShowClearable||this.props.clearable&&!this.props.disabled&&!this.props.readonly)&&this.nativeInputValue&&(this.model.focused||this.model.hovering)}get suffixVisable(){var e;return this.$sections.suffix||this.props.suffixIcon||this.showClear||this.isWordLimitVisible||((e=this.formItemOption)==null?void 0:e.ctrl.validateState.value)&&this.props.statusIcon}clear(){this.value="",this.setNativeInputValue(),this.$trigger("input",this.value),this.$trigger("change",this.value),this.$trigger("clear"),this.$trigger("validate")}focus(){var e;(e=this.$getRef("input"))==null||e.output.focus()}blur(){var e;(e=this.$getRef("input"))==null||e.output.blur()}select(){var e;(e=this.$getRef("input"))==null||e.output.select()}handleHover(e,o){this.model.hovering=o}handleFocus(e){this.model.focused=!0,this.$trigger("focus",this.value,e)}handleBlur(e){this.model.focused=!1,this.$trigger("blur",this.value,e),this.triggerValidate()}handleChange(e){this.$trigger("change",e.event.target.value)}handleInput(e){this.model.isComposing||e.event.target.value!==this.value&&(this.$trigger("input",e.event.target.value,e),this.value=e.event.target.value)}handleCompositionStart(e){this.$trigger("compositionstart",void 0,e),this.model.isComposing=!0}handleCompositionUpdate(e){this.$trigger("compositionupdate",void 0,e)}handleCompositionEnd(e){this.$trigger("compositionend",void 0,e),this.model.isComposing&&(this.model.isComposing=!1,this.handleInput(e))}handleKeydown(e){this.model.isComposing||this.$trigger("keydown",this.value,e)}handleKeyup(e){this.$trigger("keyup",this.value,e)}handleSuffixClick(e){this.$trigger("suffix-click",this.value,e)}setNativeInputValue(){var o;let e=(o=this.$getRef("input"))==null?void 0:o.output;e&&e.value!==this.nativeInputValue&&(e.value=this.nativeInputValue)}}let Jn={render:function(t){return[t.createElement("div",{ref:"container",class:"@([ 'jk-input', props.class, sizeClass, { 'is-disabled': props.disabled, 'is-exceed': inputExceed, 'is-error': isError, group: $sections.prepend || $sections.append, 'group-append': $sections.append, 'group-prepend': $sections.prepend, prefix: $sections.prefix || props.prefixIcon, suffix: $sections.suffix || props.suffixIcon || props.clearable } ])","@mouseenter":"handleHover(true)","@mouseleave":"handleHover(false)"},[t.createCommand("if","$sections.prepend",[t.createElement("div",{class:"prepend"},[t.createCommand("RenderSection",'"prepend"')])]),t.createElement("input",{ref:"input",tabindex:"@props.tabindex",disabled:"@props.disabled",readonly:"@props.readonly",autocomplete:"@props.autocomplete",autofocus:"@props.autofocus","aria-label":"@props.label",placeholder:"@props.placeholder",maxlength:"@props.maxlength",minlength:"@props.minlength","@input":"handleInput","@focus":"handleFocus","@blur":"handleBlur","@change":"handleChange","@keydown":"handleKeydown","@keyup":"handleKeyup","@compositionstart":"handleCompositionStart","@compositionupdate":"handleCompositionUpdate","@compositionend":"handleCompositionEnd",type:"@props.type"},[]),t.createCommand("if","$sections.prefix || props.prefixIcon",[t.createElement("span",{class:"prefix"},[t.createCommand("RenderSection",'"prefix"'),t.createCommand("if","props.prefixIcon",[t.createElement("i",{class:"@props.prefixIcon"},[])])])]),t.createCommand("if","suffixVisable",[t.createElement("span",{class:"suffix"},[t.createCommand("if","!showClear || !isWordLimitVisible",[t.createCommand("RenderSection",'"suffix"'),t.createCommand("if","props.suffixIcon",[t.createElement("i",{class:"@props.suffixIcon","@click":"handleSuffixClick"},[])])]),t.createCommand("if","showClear",[t.createElement("i",{class:"clear jk-icon-circle-close","@mousedown.stop":"__UNDEFINED_BUFFER__","@click.stop":"clear"},[])]),t.createCommand("elseif","isWordLimitVisible",[t.createElement("span",{class:"count"},[t.createElement("span",{class:"inner"},[t.createCodeFunction("textLength"),t.createText("/"),t.createCodeFunction("props.maxlength")])])]),t.createCommand("elseif","formItemOption && formItemOption.ctrl.validateState.value",[t.createElement("i",{class:"validate @validateIcon"},[])])])]),t.createCommand("if","$sections.append",[t.createElement("div",{class:"append"},[t.createCommand("RenderSection",'"append"')])])])]}},Hn={component:zn},je=class extends(ra=Hn.component,aa=d.SCOPE_ID,ra){constructor(){super(...arguments);s(this,aa,"f5fdf4cd");s(this,"template",Jn.render)}},oe;const Kn=`
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,Vn=["letter-spacing","line-height","padding-top","padding-bottom","font-family","font-weight","font-size","text-rendering","text-transform","width","text-indent","padding-left","padding-right","border-width","box-sizing"];function Bn(t){const r=window.getComputedStyle(t),e=r.getPropertyValue("box-sizing"),o=parseFloat(r.getPropertyValue("padding-bottom"))+parseFloat(r.getPropertyValue("padding-top")),a=parseFloat(r.getPropertyValue("border-bottom-width"))+parseFloat(r.getPropertyValue("border-top-width"));return{contextStyle:Vn.map(n=>`${n}:${r.getPropertyValue(n)}`).join(";"),paddingSize:o,borderSize:a,boxSizing:e}}function to(t,r=1,e){oe||(oe=document.createElement("textarea"),document.body.appendChild(oe));let{paddingSize:o,borderSize:a,boxSizing:i,contextStyle:n}=Bn(t);oe.setAttribute("style",`${n};${Kn}`),oe.value=t.value||t.placeholder||"";let l=oe.scrollHeight;const c={height:"",minHeight:""};i==="border-box"?l=l+a:i==="content-box"&&(l=l-o),oe.value="";let p=oe.scrollHeight-o;if(r!==void 0){let u=p*r;i==="border-box"&&(u=u+o+a),l=Math.max(u,l),c.minHeight=`${u}px`}if(e!==void 0){let u=p*e;i==="border-box"&&(u=u+o+a),l=Math.min(u,l)}return c.height=`${l}px`,oe.parentNode&&oe.parentNode.removeChild(oe),oe=void 0,c}class Yn extends H{constructor(){super(...arguments);s(this,"model",{hovering:!1,focused:!1,textareaStyle:{},isComposing:!1});s(this,"propsOption",{autocomplete:"off",maxlength:Number,minlength:Number,rows:Number})}mounted(){this.setNativeInputValue(),this.$watch(()=>this.props.value,()=>{this.setNativeInputValue()}),this.$watch(()=>this.value,()=>{this.resize()}),this.resize(),this.props.autofocus&&setTimeout(()=>{var e;if(this.$root){let o=(e=this.$getRef("input"))==null?void 0:e.output;o==null||o.focus()}})}get isWordLimitVisible(){return this.props.showWordLimit&&this.props.maxlength&&!this.props.disabled&&!this.props.readonly}get textLength(){return typeof this.value=="number"?String(this.value).length:(this.value||"").length}get inputExceed(){return this.isWordLimitVisible&&this.textLength>this.props.maxlength}get nativeInputValue(){return this.value===null||this.value===void 0?"":String(this.value)}get style(){let e=[];return this.props.resize&&e.push(`resize:${this.props.resize}`),this.model.textareaStyle.height&&!this.props.rows&&e.push(`height:${this.model.textareaStyle.height}`),this.model.textareaStyle["min-height"]&&e.push(`min-height:${this.model.textareaStyle["min-height"]}`),e.join(";")}clear(){this.$getRef("input")&&(this.value="",this.$getRef("input").output.value="")}focus(){var e;(e=this.$getRef("input"))==null||e.output.focus()}blur(){var e;(e=this.$getRef("input"))==null||e.output.blur()}select(){var e;(e=this.$getRef("input"))==null||e.output.select()}resize(){var e,o;if(this.props.autosize){let a=to((e=this.$getRef("input"))==null?void 0:e.output,this.props.autosize.minRows,this.props.autosize.maxRows);this.model.textareaStyle={"min-height":a.minHeight,height:a.height}}else{let a=to((o=this.$getRef("input"))==null?void 0:o.output).minHeight;this.model.textareaStyle={height:a,"min-height":a}}}handleHover(e,o){this.model.hovering=o}handleFocus(e){this.model.focused=!0,this.$trigger("focus",this.value,e)}handleBlur(e){this.model.focused=!1,this.$trigger("blur",this.value,e),this.triggerValidate()}handleChange(e){this.$trigger("change",e.event.target.value)}handleInput(e){this.model.isComposing||e.event.target.value!==this.value&&(this.$trigger("input",e.event.target.value,e),this.value=e.event.target.value)}handleCompositionStart(e){this.$trigger("compositionstart",void 0,e),this.model.isComposing=!0}handleCompositionUpdate(e){this.$trigger("compositionupdate",void 0,e)}handleCompositionEnd(e){this.$trigger("compositionend",void 0,e),this.model.isComposing&&(this.model.isComposing=!1,this.handleInput(e))}handleKeyDown(e){this.model.isComposing||this.$trigger("keydown",this.value,e)}setNativeInputValue(){var o;let e=(o=this.$getRef("input"))==null?void 0:o.output;e&&e.value!==this.nativeInputValue&&(e.value=this.nativeInputValue)}}let Un={render:function(t){return[t.createElement("div",{class:"@(['jk-textarea', props.class, { 'is-error': isError, 'is-disabled': props.disabled, 'is-exceed': inputExceed }])","@mouseenter":"handleHover(true)","@mouseleave":"handleHover(false)"},[t.createElement("textarea",{ref:"input",tabindex:"@props.tabindex",disabled:"@props.disabled",readonly:"@props.readonly",autocomplete:"@props.autocomplete",autofocus:"@props.autofocus","aria-label":"@props.label",placeholder:"@props.placeholder",maxlength:"@props.maxlength",minlength:"@props.minlength",rows:"@props.rows",style:"@style","@input":"handleInput","@focus":"handleFocus","@blur":"handleBlur","@change":"handleChange","@keydown":"handleKeyDown","@compositionstart":"handleCompositionStart","@compositionupdate":"handleCompositionUpdate","@compositionend":"handleCompositionEnd"},[t.createText("")]),t.createCommand("if","isWordLimitVisible",[t.createElement("span",{class:"count"},[t.createCodeFunction("textLength"),t.createText("/"),t.createCodeFunction("this.props.maxlength")])])])]}},Wn={component:Yn},Xn=class extends(sa=Wn.component,ia=d.SCOPE_ID,sa){constructor(){super(...arguments);s(this,ia,"f63929ec");s(this,"template",Un.render)}};const U="JOKERUI";class qn extends H{constructor(){super(...arguments);s(this,"components",{JokerInput:je});s(this,"propsOption",{step:{type:Number,default:1},max:{type:Number,default:1/0},min:{type:Number,default:-1/0},precision:Number});s(this,"model",{userInput:null})}mounted(){this.$watch(()=>this.value,e=>{let o=e===void 0?e:Number(e);if(e!==void 0){if(isNaN(e))return;if(this.props.stepStrictly){let a=this.getPrecision(this.props.step),i=Math.pow(10,a);o=Math.round(o/this.props.step)*i*this.props.step/i,this.props.precision!==void 0&&(o=this.toPrecision(o,this.props.precision))}if(o>=this.props.max&&(o=this.props.max),o<=this.props.min&&(o=this.props.min),this.value===o)return;this.value=Number(o),this.value=isNaN(this.value)?void 0:this.value,this.model.userInput=null,this.$trigger("input",o)}}),this.value=this.value===void 0?void 0:Number(this.value),this.value=isNaN(this.value)?void 0:this.value}get controlsAtRight(){return!this.props.hiddenControls&&this.props.controlsPosition==="right"}get minDisabled(){return this.props.disabled?!0:this.decrease(this.value)<this.props.min}get maxDisabled(){return this.props.disabled?!0:this.increase(this.value)>this.props.max}get numPrecision(){let e=this.getPrecision(this.props.step);if(this.props.precision!==void 0){if(this.props.precision>=0&&this.props.precision===parseInt(this.props.precision.toString(),10))return e>this.props.precision&&K.warn(U,"[number] The calculation precision of the value is greater than the required precision passed in."),this.props.precision;K.warn(U,"[number] The value of props.precision does not meet the requirements.",this.props.precision)}return Math.max(this.getPrecision(this.value),e)}get displayValue(){if(this.model.userInput!==null)return this.model.userInput;let e=this.value===void 0?void 0:Number(this.value);if(e=isNaN(e)?void 0:e,typeof e=="number"){if(this.props.stepStrictly){let o=this.getPrecision(this.props.step),a=Math.pow(10,o);e=Math.round(e/this.props.step)*a*this.props.step/a}this.props.precision!==void 0&&(e=e.toFixed(this.props.precision))}return e}clear(){this.model.userInput=null,this.$trigger("input",void 0),this.$trigger("change",void 0),this.value=void 0}focus(){var e;(e=this.$getRef("input"))==null||e.component.focus()}blur(){var e;(e=this.$getRef("input"))==null||e.component.blur()}select(){var e;(e=this.$getRef("input"))==null||e.component.select()}handleDecrease(e){if(this.props.disabled||this.minDisabled)return;let o=this.value||0,a=this.decrease(o);this.setNativeInputValue(a)}handleIncrease(e){if(this.props.disabled||this.maxDisabled)return;let o=this.value||0,a=this.increase(o);this.setNativeInputValue(a)}handleKeydown(e){switch(e.event.key){case"ArrowDown":e.preventDefault(),e.stopPropagation(),this.handleDecrease(e);break;case"ArrowUp":e.preventDefault(),e.stopPropagation(),this.handleIncrease(e);break}}handleBlur(e){this.triggerValidate(),this.$trigger("blur",void 0,e)}handleFocus(e){this.$trigger("focus",void 0,e)}handleInput(e){this.model.userInput=e.data}handleChange(e){let o=e.data===""?void 0:Number(e.data);(o!==void 0&&!isNaN(o)||e.data==="")&&this.setNativeInputValue(o),this.model.userInput=null}getPrecision(e){if(e===void 0)return 0;let o=e.toString(),a=o.indexOf("."),i=0;return a!==-1&&(i=o.length-a-1),i}decrease(e){if(e=e===void 0?void 0:Number(e),e===void 0)return this.value;if(typeof e!="number"&&e!==void 0)return this.value;let o=Math.pow(10,this.numPrecision);return this.toPrecision((o*e-o*this.props.step)/o)}increase(e){if(e=e===void 0?void 0:Number(e),e===void 0)return this.value;if(typeof e!="number"&&e!==void 0)return this.value;let o=Math.pow(10,this.numPrecision);return this.toPrecision((o*e+o*this.props.step)/o)}toPrecision(e,o){return o===void 0&&(o=this.numPrecision),parseFloat((Math.round(e*Math.pow(10,o))/Math.pow(10,o)).toString())}setNativeInputValue(e){if(e===void 0){this.clear(),this.triggerValidate();return}let o=this.value;typeof e=="number"&&this.props.precision!==void 0&&(e=this.toPrecision(e,this.props.precision)),e!=null||(e=0),e>=this.props.max&&(e=this.props.max),e<=this.props.min&&(e=this.props.min),o!==e&&(this.model.userInput=null,this.$trigger("input",e),this.$trigger("change",e),this.value=e,this.triggerValidate())}}let Gn={render:function(t){return[t.createElement("div",{class:"@([ 'jk-number', props.class, sizeClass, props.fullWidth && 'full-width', props.disabled && 'is-disabled', props.hiddenControls && 'is-without-controls', controlsAtRight && 'is-controls-right' ])"},[t.createCommand("if","!props.hiddenControls",[t.createElement("span",{class:"decrease @(minDisabled?'is-disabled':'')",role:"button","@click":"handleDecrease","@keydown.enter":"handleDecrease"},[t.createElement("i",{class:"jk-icon-@(controlsAtRight?'arrow-down':'minus')"},[])]),t.createElement("span",{class:"increase @(maxDisabled?'is-disabled':'')",role:"button","@click":"handleIncrease","@keydown.enter":"handleIncrease"},[t.createElement("i",{class:"jk-icon-@(controlsAtRight?'arrow-up':'plus')"},[])])]),t.createElement("JokerInput",{ref:"input",value:"@displayValue",placeholder:"@props.placeholder",disabled:"@props.disabled",size:"@sizeClass",label:"@props.label",error:"@isError","@keydown":"handleKeydown","@blur":"handleBlur","@focus":"handleFocus","@input":"handleInput","@change":"handleChange"},[t.createCommand("if","$sections.prepend",[t.createCommand("section",'"prepend"',[t.createCommand("RenderSection",'"prepend"')])]),t.createCommand("if","$sections.append",[t.createCommand("section",'"append"',[t.createCommand("RenderSection",'"append"')])])])])]}},Zn={component:qn},gt=class extends(la=Zn.component,na=d.SCOPE_ID,la){constructor(){super(...arguments);s(this,na,"b8b4bef1");s(this,"template",Gn.render)}},bt=!1;function Be(t,r){function e(a){var i;(i=r.drag)==null||i.call(r,a)}function o(a){var i;document.removeEventListener("mousemove",e),document.removeEventListener("mouseup",o),document.onselectstart=null,document.ondragstart=null,bt=!1,(i=r.end)==null||i.call(r,a)}t.addEventListener("mousedown",function(a){var i;bt||(document.onselectstart=()=>!1,document.ondragstart=()=>!1,document.addEventListener("mousemove",e),document.addEventListener("mouseup",o),bt=!0,(i=r.start)==null||i.call(r,a))})}class Qn extends d.Component{constructor(){super(...arguments);s(this,"model",{thumbTop:0})}getThumbTop(){var i,n,l;let e=(i=this.$getRef("container"))==null?void 0:i.output,o=(n=this.$getRef("thumb"))==null?void 0:n.output,a=(l=this.props.color)==null?void 0:l.h;return Math.round(a*(e.offsetHeight-o.offsetHeight/2)/360)}mounted(){var i,n;let e=(i=this.$getRef("thumb"))==null?void 0:i.output,o=(n=this.$getRef("bar"))==null?void 0:n.output,a={drag:l=>{this.handleDrag(l)},end:l=>{this.handleDrag(l)}};Be(e,a),Be(o,a),this.$watch(()=>{var l;return(l=this.props.color)==null?void 0:l.value},()=>{this.model.thumbTop=this.getThumbTop()}),this.model.thumbTop=this.getThumbTop()}barClick(e){this.handleDrag(e.event)}handleDrag(e){var c,p,u;let o=(c=this.$getRef("container"))==null?void 0:c.output,a=(p=this.$getRef("thumb"))==null?void 0:p.output,i=o.getBoundingClientRect(),n=e.clientY-i.top;n=Math.min(n,i.height-a.offsetHeight/2),n=Math.max(a.offsetHeight/2,n);let l=Math.round((n-a.offsetHeight/2)/(i.height-a.offsetHeight)*360);(u=this.props.color)==null||u.setVal("h",l)}}let el={render:function(t){return[t.createElement("div",{class:"jk-color-hue-slider",ref:"container"},[t.createElement("div",{class:"bar",ref:"bar","@click.self":"barClick"},[]),t.createElement("div",{class:"thumb",ref:"thumb",style:"top:@(model.thumbTop+'px')"},[])])]}},tl={component:Qn},ol=class extends(ca=tl.component,da=d.SCOPE_ID,ca){constructor(){super(...arguments);s(this,da,"8c25c387");s(this,"template",el.render)}};class al extends d.Component{constructor(){super(...arguments);s(this,"model",{cursorTop:0,cursorLeft:0,background:"hsl(0,100%,50%)"})}update(){var i;let e=(i=this.$getRef("container"))==null?void 0:i.output,o=this.props.color.s,a=this.props.color.v;this.model.cursorLeft=o*e.clientWidth/100,this.model.cursorTop=(100-a)*e.clientHeight/100,this.model.background=`hsl(${this.props.color.h},100%,50%)`}mounted(){var o;let e=(o=this.$getRef("container"))==null?void 0:o.output;Be(e,{drag:a=>{this.handleDrag(a)},end:a=>{this.handleDrag(a)}}),this.$watch(()=>{var a;return(a=this.props.color)==null?void 0:a.value},()=>{this.update()}),this.update()}handleDrag(e){var l;let a=((l=this.$getRef("container"))==null?void 0:l.output).getBoundingClientRect(),i=e.clientX-a.left,n=e.clientY-a.top;i=Math.max(0,i),i=Math.min(i,a.width),n=Math.max(0,n),n=Math.min(n,a.height),this.model.cursorLeft=i,this.model.cursorTop=n,d.combinedReply(()=>{var c,p;(c=this.props.color)==null||c.setVal("s",i/a.width*100),(p=this.props.color)==null||p.setVal("v",100-n/a.height*100)})}}let rl={render:function(t){return[t.createElement("div",{class:"jk-color-panel",ref:"container",style:"background:@model.background"},[t.createElement("div",{class:"white"},[]),t.createElement("div",{class:"black"},[]),t.createElement("div",{class:"cursor",style:"top:@(model.cursorTop+'px');left:@(model.cursorLeft+'px')"},[t.createElement("div",{},[])])])]}},il={component:al},sl=class extends(ua=il.component,pa=d.SCOPE_ID,ua){constructor(){super(...arguments);s(this,pa,"9f5d11a0");s(this,"template",rl.render)}};class nl extends d.Component{constructor(){super(...arguments);s(this,"model",{thumbLeft:0})}get background(){if(this.props.color&&this.props.color.value){let e=this.props.color.toRgb();return`linear-gradient(to right,rgba(${e.r},${e.g},${e.b}, 0) 0%, rgba(${e.r},${e.g},${e.b}, 1) 100%)`}return"none"}getThumbLeft(){var i,n,l;let e=(i=this.$getRef("container"))==null?void 0:i.output,o=(n=this.$getRef("thumb"))==null?void 0:n.output,a=(l=this.props.color)==null?void 0:l.a;return Math.round(a*(e.offsetWidth-o.offsetWidth/2)/100)}mounted(){var i,n;let e=(i=this.$getRef("thumb"))==null?void 0:i.output,o=(n=this.$getRef("bar"))==null?void 0:n.output,a={drag:l=>{this.handleDrag(l)},end:l=>{this.handleDrag(l)}};Be(e,a),Be(o,a),this.$watch(()=>{var l;return(l=this.props.color)==null?void 0:l.value},()=>{this.model.thumbLeft=this.getThumbLeft()}),this.model.thumbLeft=this.getThumbLeft()}barClick(e){this.handleDrag(e.event)}handleDrag(e){var c,p,u;let o=(c=this.$getRef("container"))==null?void 0:c.output,a=(p=this.$getRef("thumb"))==null?void 0:p.output,i=o.getBoundingClientRect(),n=e.clientX-i.left;n=Math.max(a.offsetWidth/2,n),n=Math.min(n,i.width-a.offsetWidth/2);let l=Math.round((n-a.offsetWidth/2)/(i.width-a.offsetWidth)*100);(u=this.props.color)==null||u.setVal("a",l)}}let ll={render:function(t){return[t.createElement("div",{class:"jk-alpha-slider",ref:"container"},[t.createElement("div",{class:"bar",ref:"bar","@click.self":"barClick",style:"background:@background"},[]),t.createElement("div",{class:"thumb",ref:"thumb",style:"left:@(model.thumbLeft+'px')"},[])])]}},dl={component:nl},cl=class extends(ma=dl.component,ha=d.SCOPE_ID,ma){constructor(){super(...arguments);s(this,ha,"3a253b62");s(this,"template",ll.render)}},fe={zindex:2e3,nextZIndex:function(){return this.zindex++}};const pl={placement:"bottom",boundariesPadding:5,offset:0,preventOverflowOrder:["left","right","top","bottom"