jrs-react 1.2.25 → 1.2.26
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.
- package/build/index.es.js +27 -27
- package/build/index.js +26 -26
- package/package.json +1 -1
- package/src/index.js +1 -1
package/build/index.es.js
CHANGED
|
@@ -18,16 +18,16 @@ import*as e from"react";import t,{useState as n}from"react";import r from"styled
|
|
|
18
18
|
top: 0;
|
|
19
19
|
left: 0;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
`,Qe=r.div`
|
|
22
22
|
${Ge}
|
|
23
23
|
width:100%;
|
|
24
24
|
height:100%;
|
|
25
25
|
position: absolute;
|
|
26
26
|
top: 0;
|
|
27
27
|
left: 0;
|
|
28
|
-
`;
|
|
28
|
+
`;function Ze({id:e="jr-mask"}){return t.createElement(Ye,{id:e,className:"jr-mask"},t.createElement("div",{id:`${e}-msg`}),t.createElement("div",{className:"cs-loader-inner"},t.createElement("label",null,"●"),t.createElement("label",null,"●"),t.createElement("label",null,"●"),t.createElement("label",null,"●"),t.createElement("label",null,"●"),t.createElement("label",null,"●")))}function et({id:e="jr-mask"}){return t.createElement(Qe,{id:e},t.createElement("div",{id:`${e}-msg`},"MSG"),t.createElement("div",{className:"cs-loader-inner"},t.createElement("label",null,"●"),t.createElement("label",null,"●"),t.createElement("label",null,"●"),t.createElement("label",null,"●"),t.createElement("label",null,"●"),t.createElement("label",null,"●")))}class tt extends Ke{msg=[];#e=0;#t;get msgIndex(){return this.#e++}addMsg(e){const t=this.msgIndex;return this.msg.push({i:t,msg:!0!==e?e:null}),this.renderMsg(),()=>{this.removeMsg(t)}}removeMsg(e){this.msg=this.msg.filter((t=>t.i!=e)),this.renderMsg()}renderMsg(){this.msgDiv?.removeAllHijos(),this.msg.length?(this.msgDiv&&(this.msgDiv.html=this.msg[this.msg.length-1].msg),this.run()):this.stop()}run=()=>{this.yo.showModal?.()??this.display()};display(){this.yo.style.display="flex"}stop(){this.yo.close?.()??this.hide()}hide(){this.yo.style.display="none"}}function nt(e,t="jr-mask"){const n=document.getElementById(t);if(n){const r=document.getElementById(`${t}-msg`);return n.maskDiv||(n.maskDiv=new tt({yo:n,msgDiv:r?new Ke({yo:r}):null,listeners:{keydown(e){"Escape"===e.key&&e.preventDefault()}}})),n.maskDiv.addMsg(e)}}const rt=He.create({authorization:`Bearer ${localStorage.getItem("accessToken")}`,timeout:12e4,maxBodyLength:104857600,maxContentLength:104857600});r.div`
|
|
29
29
|
border:2px solid red;
|
|
30
|
-
`;class
|
|
30
|
+
`;class ot extends t.Component{#n=["get","post","put","patch","delete","download"];constructor(e){super(e),void 0===this.props.value&&void 0!==this.props.initValue&&void 0===this.props.onChange&&(this.state={value:e.initValue,rawValue:JSON.parse(JSON.stringify(e.initValue))})}componentDidMount(){this.#n.filter((e=>this[e]&&this.props[e]&&this.props[e].autoRun)).forEach((e=>{this[e]()}))}get(e={}){const t=Object.assign({method:"get",updateValue:!0},this.props.get,e);this.submit(t)}post(e={}){e=Object.assign({method:"post",updateValue:!1},this.props.post,e),this.submit(e)}put(e={}){e=Object.assign({method:"put",updateValue:!1},this.props.put,e),this.submit(e)}delete(e={}){e=Object.assign({method:"delete",updateValue:!1},this.props.delete,e),this.submit(e)}get from(){return void 0===this.props.value?"state":"props"}get isDirty(){return this.state?.isDirty}set isDirty(e){this.setState({isDirty:e})}get rawValue(){return this.state?.rawValue}setRawValue(e){this.setState({rawValue:null!=e?JSON.parse(JSON.stringify(e)):null})}reset(){this.setValue(this.rawValue,!0)}setValue(e,t=!1){this.props.onChange?this.props.onChange(e):this.setState({value:e}),t&&this.setRawValue(e),this.isDirty=!t}setRes(e,t,n){if(e&&n.updateValue){const e=n.formatValue?.bind(this)(t.data)??t.data;t.data=e,this.setValue(e,!0)}else n.updateValue&&this.setValue(null,!0)}#r(e,t){const n=e.shift();return 0==e.length?t?.[n]:null!=t?.[n]?this.#r(e,t[n]):void 0}getValue(e){if(e){const t=e.split(".");return this.#r(t,this[this.from]?.value)}return qe(this[this.from]?.value,this,null,null)}getSubmitValue(){return this.getValue()}getAxiosParams({url:e,method:t,value:n,extraValue:r,sendValue:o,transformValue:s,...i}){const a=r?.bind?.(this)()??r;let l=n?.bind?.(this)({...this.getSubmitValue(),...a})??null==n?{...this.getSubmitValue(),...a}:{...n,...a};s&&(l=s.bind(this)(l));const c={authorization:`Bearer ${localStorage.getItem("accessToken")}`};let h={};const d={};return"get"==t?((null==o||o)&&(h.params=l),h.headers=c):"delete"==t?((null==o||o)&&(h.data=l),h.headers=c):(h=null==o||o?l:null,d.headers=c),{url:We(e,l),method:t,params1:h,params2:d,payload:l}}reload(){Xe("reload 還沒有做 ")}submit(e){let t;e.mask&&(e.removeMaskFunction=nt(e.mask,this.maskId??"jr-mask")),(()=>{if(Array.isArray(e.url))return t=[],Promise.allSettled(e.url.map((n=>{const r="object"==typeof n?n:{url:n},o=Object.assign(e,r),{url:s,method:i,params1:a,params2:l,payload:c}=this.getAxiosParams(o);return t.push(c),rt[i](s,a,l)})));{const{url:n,method:r,params1:o,params2:s,payload:i}=this.getAxiosParams(e);return t=i,rt[r](n,o,s)}})().then((n=>{this.handleResponse(n,t,e)})).catch((n=>{this.handleResponse(n,t,e)})).finally((()=>{e.removeMaskFunction?.()}))}handleResponse=(e,t,n)=>{Array.isArray(e)?e=e.map(((e,n)=>(e.value?e.value.payload=t[n]:e.reason&&(e.reason.payload=t[n]),e))):e.payload=t;const r=(e=n?.response?.bind(this)(e,t)??e).status>=200&&e.status<=299;this.setRes(r,e,n),this.showMessage(r,r?n.successMessage:n.failedMessage),n.callback?.bind(this)(r,e,t)};showMessage(e,t){Xe("success",e),Xe("message",t)}renderer(){}render(){return this.renderer()}}const st=({tag:e,config:n,me:r,className:o})=>{if("function"==typeof n){let s;const i=function(e){s=e},a=n.bind(r)({setStyle:i});return t.createElement(e,{className:o,style:s},a)}if("string"==typeof n)return t.createElement(e,{className:o},n)},it=r.div`
|
|
31
31
|
position:relative;
|
|
32
32
|
display:flex;
|
|
33
33
|
flex:1;
|
|
@@ -69,7 +69,7 @@ import*as e from"react";import t,{useState as n}from"react";import r from"styled
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
}
|
|
72
|
-
`;class
|
|
72
|
+
`;class at extends ot{rid=Je(99999,1e4);mask=this.props.mask?()=>{const{type:e,props:n}=this.props.mask;return this.maskId=`mask-${this.rid}`,t.createElement(e,{...n,id:this.maskId})}:null;renderer(){return t.createElement(it,{id:this.props.id,style:this.props.style,className:"jr-frame"},this.mask?.(),t.createElement(st,{tag:"div",config:this.props.start,me:this,className:"start"}),t.createElement("main",null,t.createElement(st,{tag:"header",config:this.props.top,me:this}),t.createElement("main",null,t.createElement(st,{tag:"div",config:this.props.left,me:this,className:"left"}),t.createElement("main",{className:"body"},this.renderMe?.()??this.props.children),t.createElement(st,{tag:"div",config:this.props.right,me:this,className:"right"})),t.createElement(st,{tag:"footer",config:this.props.bottom,me:this})),t.createElement(st,{tag:"div",config:this.props.end,me:this,className:"end"}))}}var lt;function ct(){return ct=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ct.apply(null,arguments)}var ht=function(t){return e.createElement("svg",ct({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},t),lt||(lt=e.createElement("path",{d:"M18 6 6 18M6 6l12 12"})))};function dt({icon:e,children:n,...r}){return t.createElement("button",r,e,n)}const pt=r.div`
|
|
73
73
|
overflow: hidden;
|
|
74
74
|
display: flex;
|
|
75
75
|
border-radius: var(--jr-window-radius) var(--jr-window-radius) 0 0;
|
|
@@ -133,7 +133,7 @@ import*as e from"react";import t,{useState as n}from"react";import r from"styled
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
`;class
|
|
136
|
+
`;class ut extends t.Component{pos1=0;pos2=0;pos3=0;pos4=0;x=0;y=0;remember=e=>{Xe("remember");const{clientX:t,clientY:n}=e,{x:r,y:o,width:s,height:i}=this.props.windowRef.current.getBoundingClientRect();this.props.window.orgHeight=i,this.props.window.orgWidth=s,this.props.window.orgTop=o,this.props.window.orgLeft=r,this.props.window.orgXd=t-r,this.props.window.orgBodyOverflow=document.body.style.overflow};adjustScreen=e=>{Xe("double click adjustScreen"),e.preventDefault();const{x:t,y:n,width:r,height:o}=this.props.windowRef.current.getBoundingClientRect();n>1-this.props.thick?(this.remember(e),this.fullScreen(e)):this.floatScreen(e)};floatScreen=e=>{this.props.windowRef.current,this.props.windowRef.current.style.transition="var(--transition-x-y), left .05s ease-in",this.props.windowRef.current.style.left=`${this.props.window.orgLeft}px`,this.props.windowRef.current.style.top=`${this.props.window.orgTop}px`,this.props.windowRef.current.style.width=`${this.props.window.orgWidth}px`,this.props.windowRef.current.style.height=`${this.props.window.orgHeight}px`,document.body.style.overflow=this.props.window.orgBodyOverflow};fullScreen=e=>{this.props.windowRef.current.style.transition="var(--transition-x-y), left .05s ease-in",this.props.windowRef.current.style.left=-this.props.thick+"px",this.props.windowRef.current.style.top=-this.props.thick+"px",this.props.windowRef.current.style.width=`calc(100vw + ${2*this.props.thick}px)`,this.props.windowRef.current.style.height=`calc(100vh + ${2*this.props.thick}px)`,setTimeout((()=>{document.body.style.overflow="hidden",this.props.windowRef.current.style.transition="unset"}),50)};stop=e=>{if(e.preventDefault(),this.moved){const{height:t}=this.props.titleBarRef.current.getBoundingClientRect(),{x:n,y:r,width:o,height:s}=this.props.windowRef.current.getBoundingClientRect();r<1-this.props.thick&&this.fullScreen(e),r>window.innerHeight-t&&(this.props.windowRef.current.style.top=window.innerHeight-t+"px"),n+o-this.props.thick<0&&(this.props.windowRef.current.style.left=0),n>window.innerWidth&&(this.props.windowRef.current.style.left=window.innerWidth-o+"px")}document.body.style.cursor="default",window.removeEventListener("mousemove",this.move),window.removeEventListener("mouseup",this.stop),window.removeEventListener("mousemove",this.preMove)};move=e=>{e.preventDefault(),this.moved=!0;const{clientX:t,clientY:n}=e,r=n<1?0:n;this.pos1=this.pos3-t,this.pos2=this.pos4-r,this.pos3=t,this.pos4=r;const o=this.props.windowRef.current;this.y=o.offsetTop-this.pos2,this.x=o.offsetLeft-this.pos1,this.y=this.y<-this.props.thick?-this.props.thick:this.y,o.style.transition="unset",o.style.top=`${this.y}px`,o.style.left=`${this.x}px`};preMove=e=>{const t=this.props.windowRef.current,{clientX:n,clientY:r,...o}=e,{x:s,y:i,width:a,height:l}=t.getBoundingClientRect();if(t.style.transition="left .05s ease-in, height .05s ease-in",i<=0){const e=n/(window.innerWidth-2*this.props.thick)*(this.props.window.orgWidth-32);t.style.left=n-e+"px",t.style.width=`${this.props.window.orgWidth}px`,t.style.height=`${this.props.window.orgHeight}px`}else this.remember(e);this.props.window.orgSHeight=null,document.body.style.cursor="grabbing",document.body.style.overflow=this.props.window.orgBodyOverflow,setTimeout((()=>{window.addEventListener("mousemove",this.move)}),50),window.removeEventListener("mousemove",this.preMove)};start(e){e.preventDefault(),this.moved=!1,this.pos3=e.clientX,this.pos4=e.clientY,this.props.windowRef.current.style.transition="var(--transition-x-y)",window.addEventListener("mousemove",this.preMove),window.addEventListener("mouseup",this.stop)}onDoubleClick(){Xe("onDoubleClick")}render(){return t.createElement(pt,{ref:this.props.titleBarRef,draggable:"false",onMouseDown:e=>{this.start(e)},onDoubleClick:this.adjustScreen},t.createElement(st,{tag:"div",config:this.props.title??"",me:this.props.window,className:"title"}),t.createElement("nav",null,this.props.window.props.setOpen?t.createElement(dt,{icon:t.createElement(ht,null),className:"danger",onClick:e=>{e.stopPropagation(),null!=this.props.window.orgBodyOverflow&&(document.body.style.overflow=this.props.window.orgBodyOverflow),this.props.window.props.setOpen(!1)},onMouseDown:e=>{e.stopPropagation()}}):null))}}const mt=["n","e","s","w","nww","nnw","nne","nee","sse","see","sww","ssw"];class ft extends t.Component{render(){return mt.map(((e,n)=>t.createElement(wt,{direction:e,thick:this.props.thick,windowRef:this.props.windowRef,window:this.props.window,titleBarRef:this.props.titleBarRef,key:n})))}}const gt=r.div`
|
|
137
137
|
Xborder:1px solid ${({$direction:{color:e}})=>e};
|
|
138
138
|
Xbackground:${({$direction:{color:e}})=>e};
|
|
139
139
|
position: absolute;
|
|
@@ -151,7 +151,7 @@ import*as e from"react";import t,{useState as n}from"react";import r from"styled
|
|
|
151
151
|
-o-user-select: none;
|
|
152
152
|
user-select: none;
|
|
153
153
|
|
|
154
|
-
`;class
|
|
154
|
+
`;class wt extends t.Component{width="3px";borderWidth="px";borderLong=5;constructor(e){super(e),this.sliderRef=t.createRef()}directions={n:{top:0,color:"red",width:"100%",height:`${this.props.thick}px`,cursor:"n-resize",resize:e=>{this.resizeN(e)}},e:{color:"yellow",right:0,width:`${this.props.thick}px`,height:"100%",cursor:"e-resize",resize:e=>{this.resizeE(e)}},s:{color:"blue",bottom:0,width:"100%",height:`${this.props.thick}px`,cursor:"s-resize",resize:e=>{this.resizeS(e)}},w:{color:"green",left:0,width:`${this.props.thick}px`,height:"100%",cursor:"w-resize",resize:e=>{this.resizeW(e)}},nw:{top:0,left:0,color:"blue",width:`${this.borderLong}px`,height:`${this.borderLong}px`,cursor:"nw-resize",resize:e=>{this.resizeN(e),this.resizeW(e)}},nww:{top:0,left:0,color:"blue",width:`${this.props.thick+this.borderLong}px`,height:`${this.props.thick}px`,cursor:"nw-resize",resize:e=>{this.resizeN(e),this.resizeW(e)}},nnw:{top:0,left:0,color:"blue",width:`${this.props.thick}px`,height:`${this.props.thick+this.borderLong}px`,cursor:"nw-resize",resize:e=>{this.resizeN(e),this.resizeW(e)}},nne:{top:0,right:0,color:"green",width:`${this.props.thick+this.borderLong}px`,height:`${this.props.thick}px`,cursor:"ne-resize",resize:e=>{this.resizeN(e),this.resizeE(e)}},nee:{top:0,right:0,color:"green",width:`${this.props.thick}px`,height:`${this.props.thick+this.borderLong}px`,cursor:"ne-resize",resize:e=>{this.resizeN(e),this.resizeE(e)}},sse:{color:"red",right:0,bottom:0,width:`${this.props.thick+this.borderLong}px`,height:`${this.props.thick}px`,cursor:"se-resize",resize:e=>{this.resizeS(e),this.resizeE(e)}},see:{color:"red",right:0,bottom:0,width:`${this.props.thick}px`,height:`${this.props.thick+this.borderLong}px`,cursor:"se-resize",resize:e=>{this.resizeS(e),this.resizeE(e)}},ssw:{color:"yellow",bottom:0,left:0,width:`${this.props.thick+this.borderLong}px`,height:`${this.props.thick}px`,cursor:"sw-resize",resize:e=>{this.resizeS(e),this.resizeW(e)}},sww:{color:"yellow",bottom:0,left:0,width:`${this.props.thick}px`,height:`${this.props.thick+this.borderLong}px`,cursor:"sw-resize",resize:e=>{this.resizeS(e),this.resizeW(e)}}};resizeN=({window:e,cursorY:t,startY:n,startHeight:r,titleBarHeight:o})=>{let s=t-this.props.thick;s<0&&(s=0);let i=r+(n-s);i<o+2*this.props.thick&&(i=o+2*this.props.thick,s=n+r-o-2*this.props.thick),e.style.top=`${s}px`,e.style.height=`${i}px`};resizeE=({window:e,clientX:t,left:n,titleBarHeight:r})=>{let o=t-n-this.props.thick;o<r&&(o=r),e.style.width=`${o+2*this.props.thick}px`};resizeS=({window:e,clientY:t,top:n,titleBarHeight:r})=>{let o=t-n-this.props.thick;o<r&&(o=r),e.style.height=`${o+2*this.props.thick}px`};resizeW=({window:e,cursorX:t,startX:n,startWidth:r,titleBarHeight:o})=>{let s=t-this.props.thick;s<0&&(s=0);let i=r+(n-s);i<o+2*this.props.thick&&(i=o+2*this.props.thick,s=n+r-o-2*this.props.thick),e.style.left=`${s}px`,e.style.width=`${i}px`};stop=e=>{e.preventDefault();const{height:t}=this.props.titleBarRef.current.getBoundingClientRect(),{x:n,y:r,width:o,height:s}=this.props.windowRef.current.getBoundingClientRect();this.props.windowRef.current.style.transition="var(--transition-x-y)",0==r&&this.data.direction.indexOf("n")>-1&&(this.props.window.orgSHeight=s,this.props.windowRef.current.style.height=`${window.innerHeight}px`),r>window.innerHeight&&(this.props.windowRef.current.style.top=window.innerHeight-t+"px"),n+o-this.props.thick<0&&(this.props.windowRef.current.style.left=0),n>window.innerWidth&&(this.props.windowRef.current.style.left=window.innerWidth-o+"px"),document.body.style.cursor="default",window.removeEventListener("mousemove",this.move),window.removeEventListener("mousemove",this.preMove),window.removeEventListener("mouseup",this.stop)};move=e=>{e.preventDefault(),this.props.windowRef.current.style.transition="unset";const{clientX:t,clientY:n,x:r,y:o}=e,s=this.props.windowRef.current,{left:i,top:a}=s.getBoundingClientRect();let{x:l,width:c,y:h,height:d,titleBarHeight:p}=this.data;this.directions[this.props.direction].resize({window:s,titleBarHeight:p,clientX:t,cursorX:r,startX:l,startWidth:c,left:i,clientY:n,cursorY:o,startY:h,startHeight:d,top:a})};preMove=()=>{this.props.direction.indexOf("n")>-1&&(this.props.windowRef.current.style.height=`${this.props.window.orgSHeight}px`,this.data.height=this.props.window.orgSHeight,this.props.window.orgSHeight=null),window.removeEventListener("mousemove",this.preMove),setTimeout((()=>{window.addEventListener("mousemove",this.move)}),100)};start=(e,t)=>{e.preventDefault();const{height:n}=this.props.titleBarRef.current.getBoundingClientRect();let{x:r,y:o,width:s,height:i}=this.props.windowRef.current.getBoundingClientRect();this.props.window.orgHeight=i,this.props.direction.indexOf("s")>-1&&(this.props.window.orgSHeight=null),this.data={x:r,y:o,width:s,height:i,titleBarHeight:n,direction:t},document.body.style.cursor=this.directions[this.props.direction].cursor,this.props.window.orgSHeight?window.addEventListener("mousemove",this.preMove):window.addEventListener("mousemove",this.move),window.addEventListener("mouseup",this.stop)};render(){return t.createElement(gt,{$direction:this.directions[this.props.direction],$padding:this.props.padding,onMouseDown:e=>{this.start(e,this.props.direction)}})}}var yt={test:"Style-module_test__LrdEc",withMask:"Style-module_withMask__LPcai"};!function(e,t){void 0===t&&(t={});var n=t.insertAt;if(e&&"undefined"!=typeof document){var r=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===n&&r.firstChild?r.insertBefore(o,r.firstChild):r.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.Style-module_test__LrdEc{border:1px solid red;color:red}.Style-module_withMask__LPcai{overflow:hidden!important;position:relative;user-select:none;&:after{a:#868686cc;background:#868686cc;border-radius:inherit;bottom:0;content:"";height:10000px;left:0;position:absolute;right:0;top:0;width:10000px}}mask{background:#868686cc;border-radius:inherit;bottom:0;height:10000px;left:0;position:absolute;right:0;top:0;width:10000px}');const bt=r.div`
|
|
155
155
|
z-index:1;
|
|
156
156
|
|
|
157
157
|
--jr-window-radius:3px;
|
|
@@ -188,7 +188,7 @@ z-index:1;
|
|
|
188
188
|
display: flex;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
`;class
|
|
191
|
+
`;class xt extends at{x=0;y=0;width=300;height=300;padding=1;thick=5;constructor(e){super(e),this.ref=t.createRef(),this.titleBarRef=t.createRef(),this.init()}addMaskToTarget=e=>{this.mask=document.createElement("div"),this.mask.style.background="#868686cc",this.mask.style.position="absolute",this.mask.style.top="0",this.mask.style.left="0",this.mask.style.right="0",this.mask.style.bottom="0",this.mask.style.borderRadius="inherit",this.mask.style.height="10000px",this.mask.style.width="10000px",e.appendChild(this.mask),Xe("style.mask",yt.mask),Xe("addMask+++++++++++++++++++++++++++")};removeMaskFromTarget=()=>{Xe("removeMask-----------------------"),this.mask.remove()};backdropOn(e){const t="object"==typeof this.props.backdrop?this.props.backdrop:"string"==typeof this.props.backdrop?document.getElementById(this.props.backdrop):document.body;t?.classList[e?"add":"remove"]("withMask")}componentDidMount(){super.componentDidMount(),this.props.backdrop&&this.props.open&&this.backdropOn(this.props.open),this.props.open&&this.open()}open(){this.props.onOpen?.bind(this)()}close(){this.props.onClose?.bind(this)()}componentDidUpdate(e,t,n){!0===this.props.popup&&(this.props.open&&!1===e.open?this.open():!1===this.props.open&&e.open&&this.close(),this.props.backdrop&&this.props.open!=e.open&&this.backdropOn(this.props.open))}init(){this.height=window.innerHeight>=(this.props.height??this.height)?this.props.height??this.height:window.innerHeight,this.width=window.innerWidth>=(this.props.width??this.width)?this.props.width??this.width:window.innerWidth,this.x=this.props.x??(window.innerWidth-(this.width??300))/2,this.y=this.props.y??(window.innerHeight-(this.height??300))/2}renderer(){return!0===this.props.popup?this.props.open?t.createElement(bt,{rule:"dialog",ref:this.ref,className:`jr-window ${this.props.className??""}`,$x:this.x,$y:this.y,$width:this.width,$height:this.height,$thick:this.thick},t.createElement("main",null,t.createElement(ut,{titleBarRef:this.titleBarRef,windowRef:this.ref,window:this,title:this.props.title,thick:this.thick}),t.createElement("main",null,super.renderer())),t.createElement(ft,{thick:this.thick,windowRef:this.ref,window:this,titleBarRef:this.titleBarRef})):"":super.renderer()}}const vt=r.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 0;
|
|
194
194
|
right: 0;
|
|
@@ -202,12 +202,12 @@ z-index:1;
|
|
|
202
202
|
cursor: col-resize;
|
|
203
203
|
border-right:1px dashed gray;
|
|
204
204
|
}
|
|
205
|
-
`;class
|
|
205
|
+
`;class Et extends t.Component{constructor(){super(),this.sliderRef=t.createRef()}stop=e=>{this.sliderRef.current.classList.remove("resizing"),document.body.style.cursor="default",window.removeEventListener("mousemove",this.move),window.removeEventListener("mouseup",this.stop)};move=({clientX:e})=>{const{th:t,selectedCols:n,widthRates:r}=this.data,{left:o}=t.getBoundingClientRect(),s=o+10,i=(e>=s?e:s)-o;n.forEach(((e,t)=>{const n=Math.round(i/100*r[t]);e.style.width=n+"px"}))};start(e,t){const n=[...this.props.table.colGroupRef.current.children].slice(t.columnNo,t.columnNo+(t.colSpan??1)),r=n.reduce(((e,{offsetWidth:t})=>e+t),0),o=n.map((({offsetWidth:e})=>e/r*100));this.data={selectedCols:n,th:e.current,widthRates:o},this.sliderRef.current.classList.add("resizing"),document.body.style.cursor="col-resize",window.addEventListener("mousemove",this.move),window.addEventListener("mouseup",this.stop)}render(){const e=this.props.column;return t.createElement(vt,{ref:this.sliderRef,onMouseDown:t=>{this.start(this.props.thRef,e)}})}}const kt=({leafColumns:e,colGroupRef:n})=>t.createElement("colgroup",{ref:n},e?.map(((e,n)=>{const{width:r,...o}=e,s={width:r};return t.createElement("col",{style:s,key:n})}))),St=({deep:e,rowColumn:n,rowIndex:r,table:o})=>n?.map(((n,s)=>{const i=t.createRef();return t.createElement("th",{key:s,ref:i,colSpan:n.colSpan,rowSpan:n.rowSpan??(n.isLeaf&&e>r?e-r+1:null)},qe(n.label,o),(void 0===o.props.resizableColumns||o.props.resizableColumns)&&t.createElement(Et,{table:o,thRef:i,column:n}))})),Rt=({columns:e,trClassName:n,table:r})=>{const o=Array.isArray(e?.[0])?e:[e];return o?.map(((e,s)=>t.createElement("tr",{className:n,key:s},t.createElement(St,{deep:o.length-1,rowColumn:e,rowIndex:s,table:r}))))},Ot=({columns:e,leafColumns:n,table:r})=>t.createElement(t.Fragment,null,t.createElement("thead",null,t.createElement(Rt,{columns:e,table:r})),t.createElement(kt,{leafColumns:n,colGroupRef:r.colGroupRef})),Ct=({table:e,groupData:n,groupIndex:r,deep:o,columns:s,rowIndex:i})=>s?.map(((n,r)=>{let o=qe(n.style,e,{},{});const s=(({type:e,typeStyle:n,render:r,...o},s,i)=>{if(e){const r="function"==typeof n?n?.bind(s)():n;return t.createElement(e,{style:r})}return r?r.bind(s)():i})(n,e,n.label);return t.createElement("th",{style:o,colSpan:n.colSpan,rowSpan:n.rowSpan},s)})),jt=({table:e,columns:n})=>{const r=n?.map(((n,r)=>t.createElement("tr",{key:r},t.createElement(Ct,{columns:n,table:e}))));return t.createElement(t.Fragment,null,t.createElement("tfoot",null,r))};function Nt(){return Nt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},Nt.apply(null,arguments)}r.tbody`
|
|
206
206
|
th{
|
|
207
207
|
height:4px;
|
|
208
208
|
background:#c6c6c6;
|
|
209
209
|
}
|
|
210
|
-
`;const
|
|
210
|
+
`;const $t=({table:e,groupData:n,groupIndex:r,deep:o,rowColumn:s,rowIndex:i})=>s?.map((({style:s,align:a,type:l,render:c,...h},d)=>{const p=qe(s,e,{},{});let u;return u=l?"type":c?c?.bind(e)({groupData:n,groupIndex:r,ths:111}):h.label,t.createElement("th",{key:d,style:{textAlign:a,...p},colSpan:h.colSpan,rowSpan:h.isLeaf&&o>i?o-i+1:null},u)})),At=({table:e,columns:n,trClassName:r,groupData:o,tbodyIndex:s})=>{const i=Array.isArray(n?.[0])?n:[n];return i?.map(((n,a)=>t.createElement("tr",{className:r,key:a},t.createElement($t,{table:e,groupData:o,groupIndex:s,deep:i.length-1,rowColumn:n,rowIndex:a}))))};r.tr`
|
|
211
211
|
z-index: 1;
|
|
212
212
|
XXposition: sticky;
|
|
213
213
|
XXtop: 50px;
|
|
@@ -215,12 +215,12 @@ z-index:1;
|
|
|
215
215
|
text-align: left;
|
|
216
216
|
border:1px solid #222222;
|
|
217
217
|
}
|
|
218
|
-
`;const
|
|
218
|
+
`;const Tt=e=>t.createElement(At,Nt({trClassName:"jr-group-header"},e));r.tr`
|
|
219
219
|
th{
|
|
220
220
|
border:1px solid #222222;
|
|
221
221
|
text-align: left;
|
|
222
222
|
}
|
|
223
|
-
`;const
|
|
223
|
+
`;const Vt=e=>t.createElement(At,Nt({trClassName:"jr-group-footer"},e)),Lt=({column:e,record:n,tbodyIndex:r,trIndex:o,tdIndex:s,table:i})=>{let a;const{style:l,align:c,vAlign:h="baseline",type:d,typeStyle:p,render:u,setValue:m,getValue:f,onChange:g,funcProps:w,...y}=e,b=e=>{m(n,e?.target?.value??e),i.setValue(i.getValue())},x=f(n);let v=u?{}:qe(l,i,{value:x,record:n},{});const E=e=>{v=e};if(E.bind(i),u?.bind(i),d){const e=qe(p,i,{record:n},{});a=t.createElement(d,{onChange:g?e=>{g?.bind(i)(e,{value:x,onChange:b,me:a})}:b,value:x,style:e,render:u,...y,...w?.bind(i)({value:x})})}else a=u?u({index:o,groupIndex:r,value:x,record:n,onChange:b,setStyle:E}):x;return t.createElement("td",{colSpan:v.colSpan,rowSpan:v.rowSpan,style:{textAlign:c,verticalAlign:h,...v},key:s},a)},_t=({leafColumns:e,record:n,table:r,tbodyIndex:o,trIndex:s})=>e?.map(((e,i)=>t.createElement(Lt,{column:e,key:i,record:n,table:r,tbodyIndex:o,trIndex:s,tdIndex:i}))),Bt=({groupData:e,groupHeader:n,leafColumns:r,groupFooter:o,table:s,tbodyIndex:i})=>{const a={table:s,tbodyIndex:i};return t.createElement(t.Fragment,null,t.createElement("tbody",{key:`tbody${i}`},e?.length>0&&t.createElement(Tt,Nt({groupData:e,columns:n},a)),e?.map?.(((e,n)=>{const o=s.props.onRowClick?.bind(s);return t.createElement("tr",{key:n,onClick:()=>{o?.({record:e,index:n,groupIndex:i})}},t.createElement(_t,Nt({record:e,trIndex:n},a,{leafColumns:r})))})),e?.length>0&&t.createElement(Vt,Nt({groupData:e,columns:o},a))))},Dt=({groupHeader:e,leafColumns:n,groupFooter:r,dataSource:o,table:s})=>{const i=Array.isArray(o?.[0])?o:[o];return i?.map(((o,i,a)=>t.createElement(Bt,{key:`tbody${i}`,table:s,groupData:o,tbodyIndex:i,groupHeader:e,leafColumns:n,groupFooter:r})))},Pt=r.div`
|
|
224
224
|
--column-bd-color:#cccccc;
|
|
225
225
|
--column-b-color:#ffffff;
|
|
226
226
|
--column-b-hover-color:#eeeeee;
|
|
@@ -393,7 +393,7 @@ z-index:1;
|
|
|
393
393
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
`;const
|
|
396
|
+
`;const zt=r.main`
|
|
397
397
|
|
|
398
398
|
|
|
399
399
|
--column-bd-color:#cccccc;
|
|
@@ -419,23 +419,23 @@ z-index:1;
|
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
`;function
|
|
422
|
+
`;function Ft(e){return null!=e&&""!=e&&""!=e.trim?.()||"This is required"}function Mt(e,t){return null==e||("string"==typeof e&&e.length>t.max||Array.isArray(e)&&e.length>t.max?`Length can not more than ${t.max}`:!("number"==typeof e&&e>t.max)||`Length can not more than ${t.max}`)}function Ut(e,t){return"string"==typeof e&&t.min>e.length||Array.isArray(e)&&t.min>e.length?`Length can not less than ${t.min}`:!("number"==typeof e&&t.min>e)||`Can not less than ${t.min}`}function It(e,t,n,r){if(r.length){const o=r.shift();"object"!=typeof n[o]&&(n[o]={}),It(e,t,n[o],r)}else n[e]=t}r.div`
|
|
423
423
|
overflow: auto;
|
|
424
424
|
flex:1;
|
|
425
|
-
`;const
|
|
425
|
+
`;const Ht=r.div`
|
|
426
426
|
display: grid;
|
|
427
427
|
gap:10px;
|
|
428
428
|
grid: ${({grid:e,cols:t,children:n})=>e||`auto / ${Array(t??1).fill().map((()=>"1fr")).join(" ")}`};
|
|
429
429
|
|
|
430
430
|
gap: ${({$gap:e})=>e};
|
|
431
431
|
`;r.div`
|
|
432
|
-
`;const
|
|
432
|
+
`;const Xt=r.div`
|
|
433
433
|
flex:1;
|
|
434
434
|
display: grid;
|
|
435
435
|
|
|
436
436
|
|
|
437
437
|
${({$layout:e,$labelWidth:t,$hasLabel:n,$valueWidth:r})=>"v"==e?"grid: auto 1fr / 1fr;":`grid: 1fr / ${n?t:""} ${r};`}
|
|
438
|
-
`,
|
|
438
|
+
`,Wt=r.div`
|
|
439
439
|
min-height:24px;
|
|
440
440
|
${({$layout:e})=>"v"==e?"text-align: start;":"text-align: end;\n padding-right:10px;\n "}
|
|
441
441
|
|
|
@@ -443,14 +443,14 @@ z-index:1;
|
|
|
443
443
|
|
|
444
444
|
${({$colon:e})=>{if(e)return`\n &:not(:empty)::after{\n content:'${e}';\n }\n `}}
|
|
445
445
|
|
|
446
|
-
`,
|
|
446
|
+
`,qt=r.main`
|
|
447
447
|
flex:1;
|
|
448
448
|
flex-direction: column;
|
|
449
449
|
overflow: hidden;
|
|
450
450
|
|
|
451
451
|
text-align: start;
|
|
452
452
|
${({$validateValue:e})=>{if(null!=e)return"\n > * {\n xborder:1px solid red;\n }\n "}}
|
|
453
|
-
`,
|
|
453
|
+
`,Jt=r.div`
|
|
454
454
|
&:has(.left:empty):has(.right:empty)
|
|
455
455
|
{
|
|
456
456
|
border:1px solid blue;
|
|
@@ -471,7 +471,7 @@ z-index:1;
|
|
|
471
471
|
color:gray;
|
|
472
472
|
xflex:1;
|
|
473
473
|
}
|
|
474
|
-
`;class
|
|
474
|
+
`;class Kt extends xt{UNSAFE_componentWillMount(){this.#o()}reset(){this.clearTestValue(),super.reset()}setValue(e,t){super.setValue(e,t),t&&this.clearTestValue()}#o(){"state"==this.validateValueFrom&&this.setState({validatorValue:{}})}get testValueFrom(){return void 0===this.props.testValue?"state":"props"}clearTestValue(){this.setTestValue({})}setTestValue(e,t){if("state"==this.testValueFrom)if(t){this.getTestValue()[t]=e,this.setState({testValue:{...this.getTestValue(),...e}})}else this.setState({testValue:e})}getTestValue(e){return e?this.state?.testValue?.[e]:this.state?.testValue}#s(e,t,n,r){const{name:o,validators:s,columns:i,type:a}=e,l=t.join("."),c=s?[...s]:[];if(e.required&&c.push(Ft),e.max&&c.push(Mt),e.min&&c.push(Ut),c.length){n[l]={isValid:null,msg:[]};const t=[];for(let n=0;n<c.length;n++){const o=c[n].bind(this)(r,e);if(o?.then)t.push(o);else if("string"==typeof o){t.push(Promise.reject(o));break}}return Promise.all(t).then((e=>(n[l].isValid=!0,Promise.resolve(e)))).catch((e=>(n[l].msg.push(e),n[l].isValid=!1,Promise.reject(e))))}}#i(e,t,n,r,o){return e?.reduce(((e,t)=>{const{name:s,validators:i,columns:a,type:l}=t,c=s?[...n,s]:n;c.join(".");{const n=this.#s(t,c,r,s?o?.[s]:o);n&&e.push(n)}return a&&null==l&&this.#i(a,e,c,r,s?o?.[s]:o),e}),t)}validate(e){console.clear();const t=[],n=this.getTestValue()??{};return this.#i(this.getColumns(),t,[],n,void 0!==e?e:this.getValue()),Promise.all(t).then((e=>(this.setTestValue(n),Promise.resolve()))).catch((e=>(this.setTestValue(n),Promise.reject())))}get columnsFrom(){return void 0!==this.props.initColumns?"state":"props"}getColumns(){return this[this.columnsFrom]?.columns}createColumn(e,{type:n,name:r,colSpan:o,rowSpan:s,style:i,typeStyle:a,columnStyle:l,...c},h,d,p,u){const m=r?e?.[r]:e,f=c.gap??this.props.gap,g=c.label,w=qe(i,this,{},{}),y=qe(l,this,{},{});let b;o&&(w.gridColumn=`span ${o}`),s&&(w.gridRow=`span ${s}`);const x=t=>{const n=t?.target?.value??t;try{e[r]=n,this.setValue({...this.getValue()})}catch(e){const t=this.getValue()??{};It(r,n,t,[...d]),this.setValue(t)}const o=this.getTestValue()??{};this.#s(c,p,o,n)?.then((()=>{this.setTestValue(o)})).catch((()=>{this.setTestValue(o)}))},v=[...d];if(void 0!==r&&v.push(r),n){const r=qe(a,this,null);b=t.createElement(qt,{className:"jr-column-value",style:{gridColumn:null==g?"span 2":null,...y}},t.createElement(n,{value:m,onChange:x,record:e,style:{width:"100%",...r},...c}))}else c.columns?b=t.createElement(Ht,{cols:c.cols,className:"jr-grid",$gap:f,style:y},this.createColumns(m,c.columns,v,p,c.labelProps??this.props.labelProps)):(r||c.render)&&(b=t.createElement(qt,{className:"jr-column-value",style:{gridColumn:null==g?"span 2":null,padding:c.render?"4px 0":null}},c.render?c.render.bind(this)({onChange:x,value:m,record:this.getValue()}):"object"==typeof m?JSON.stringify(m):m));const E=u?.layout,k=void 0===u?.colon?":":u.colon,S=c.labelProps?.style??this.props.labelProps?.style??{};return t.createElement(Xt,{$layout:E,$hasLabel:null!=g,key:`f${h}`,style:w,className:"jr-column",$labelWidth:c.labelProps?.width??this.props.labelProps?.width??"120px",$valueWidth:c.valueProps?.width??this.props.valueProps?.width??"1fr"},null!=g&&t.createElement(Wt,{style:S,$required:c.required,className:"label",$layout:E,$colon:k},g),b,t.createElement(Jt,{$layout:E},t.createElement("div",{className:"left"},this.getTestValue(v.join("."))?.msg?.map((e=>e))),t.createElement("div",{className:"right"})))}createColumns(e,t,n,r,o){return t?.map(((t,s)=>this.createColumn(e,t,s,n,t.name?[...r,t.name]:r,o)))}renderMe(){return t.createElement(zt,{className:"jr-fields",style:this.props.typeStyle},t.createElement(Ht,{cols:this.props.cols,style:this.props.gridStyle,className:"jr-grid",$gap:this.props.gap},this.createColumns(this.props.dataSourceName?this.getValue()?.[this.props.dataSourceName]:this.getValue(),this.props.columns,this.props.dataSourceName?[this.props.dataSourceName]:[],this.props.dataSourceName?[this.props.dataSourceName]:[],this.props.labelProps)))}}r.div`
|
|
475
475
|
--jr-window-radius:3px;
|
|
476
476
|
--padding-child:8px;
|
|
477
477
|
--transition-x-y:height .05s ease-in, width .05s ease-in;
|
|
@@ -512,9 +512,9 @@ z-index:1;
|
|
|
512
512
|
border: 1px solid red;
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
`;const
|
|
515
|
+
`;const Gt=(e,t)=>{const n=t.shift(t);return t.length?Gt(e?.[n],t):e},Yt=(e,t,n)=>{const r=t.shift(t);t?.length?("object"!=typeof e[r]&&(e[r]={}),Yt(e[r],t,n)):e[r]=n};class Qt extends xt{constructor(e){super(e),this.colGroupRef=t.createRef()}UNSAFE_componentWillMount(){this.setColumns(this.props.columns??[])}checkableColumn(e){return{render:({value:e,onChange:n})=>t.createElement("checkbox",{checked:e,onChange:e=>{n(e.target.checked)}}),align:"center",name:"checked",...e}}deletableColumn({name:e="deletable",sendValue:n,sendName:r,valueName:o,...s}){return{render:({value:e,onChange:n})=>t.createElement("checkbox",{checked:e,onChange:e=>{n(e.target.checked)}}),align:"center",name:e,label(){return t.createElement("button",{onClick:()=>{const t=this.props.delete.value??this.getDataSource()?.filter((t=>t[e])).map((e=>n?e[n]:e)),o=this.props.delete.callback??function(e,t,n){this.reload()};this.delete({value:r?{[r]:t}:t,callback:o,...s})}},"刪除")},...s}}initColumn(e,t,n,r,o,s){const i=void 0===e.type&&e?.columns&&e?.columns.length,a=e.name?[...o,e.name]:o;if(i){null!==e.label&&n[t].push(e);const o=this.initColumns(e.columns,t+(null!==e.label?1:0)+(null!=e.rowSpan?e.rowSpan-1:0),n,r,a,s);return e.colSpan=o.colSpan,e.columnNo=s,{colSpan:e.colSpan}}return e.columnNo=s,n[t].push({...e,isLeaf:!0}),r.push(e),e.names=a,a?.length>1?(e.setValue=function(t,n){try{Gt(t,[...a])[e.name]=n}catch{Yt(t,[...a],n)}},e.getValue=function(e){return a.reduce(((e,t)=>e?.[t]),e)}):(e.setValue=function(t,n){t[e.name]=n},e.getValue=function(t){return t[e.name]}),{colSpan:1}}initColumns(e,t,n,r,o,s){for(let e=n.length;e<=t;e++)n[e]||n.push([]);let i=s;const a=e?.reduce(((e,s)=>{const a=this.initColumn(s,t,n,r,o,i);return e.colSpan+=a.colSpan,i+=a.colSpan,e}),{colSpan:0});return a}setColumns([...e]){this.props.checkable&&e.unshift(this.checkableColumn(this.props.checkable)),this.props.deletable&&e.unshift(this.deletableColumn(this.props.deletable));const t=[],n=[];this.initColumns(e,0,t,n,[],0),this.setState({columns:t,leafColumns:n})}setDataSource(e){}getDataSource(){return this.props.dataSourceName?this.getValue()?.[this.props.dataSourceName]:this.getValue()}add(e,t=this.getDataSource()?.length??0,n){this.getDataSource()?(void 0===n?this.getDataSource().splice(t,0,e):this.getDataSource()[n].splice(t,0,e),this.setValue(this.getValue())):this.setValue(this.props.dataSourceName?{[this.props.dataSourceName]:[e]}:[e])}noData(){const e=this.getDataSource();return null==e||0==e.length}renderMe(){return t.createElement(Pt,{className:"jr-table "+(this.props.onRowClick?"row-highlightable":"")},t.createElement("table",{className:"jr-table-table"},t.createElement(Dt,{table:this,leafColumns:this.state.leafColumns,groupHeader:this.props.groupHeader,groupFooter:this.props.groupFooter,dataSource:this.getDataSource(),onRowClick:this.props.onRowClick}),t.createElement(jt,{columns:this.props.footColumns,table:this}),t.createElement(Ot,{columns:this.state.columns,leafColumns:this.state.leafColumns,table:this})),this.noData()&&t.createElement("div",{className:"empty"}))}}const Zt=r.div`
|
|
516
516
|
|
|
517
|
-
`;class
|
|
517
|
+
`;class en extends ot{renderer(){return t.createElement(Zt,{style:this.props.style,className:`${this.props.className} jr-frame`})}renderMe(){return t.createElement("div",{style:{flex:1}},"Render me")}}const tn=r(class extends xt{renderMe(){return this.getValue()?.message}})`
|
|
518
518
|
.body{
|
|
519
519
|
display: flex;
|
|
520
520
|
align-items: center;
|
|
@@ -526,13 +526,13 @@ z-index:1;
|
|
|
526
526
|
justify-content: end;
|
|
527
527
|
padding: 8px;
|
|
528
528
|
}
|
|
529
|
-
`;function
|
|
529
|
+
`;function nn({title:e,message:r,container:o,...s}){const[i,a]=n(!0);return t.createElement(tn,Nt({initValue:{message:r},width:440,height:180,maskOn:"play"},s,{open:i,setOpen:a,popup:!0,title:e??"",onClose:()=>{o.remove()},bottom:function(){return t.createElement("button",{onClick:()=>{a(!1)}},"OK")}}),r)}function rn(e){const n=document.body,r="jr-alert-div";let s=document.getElementById(r);null==s&&(s=document.createElement("div"),s.id=r,n.appendChild(s));const i=document.createElement("div");s.appendChild(i),o(i).render(t.createElement(nn,Nt({},e,{container:i})))}const on=r.div`
|
|
530
530
|
display:flex;
|
|
531
531
|
input:focus{
|
|
532
532
|
outline: none;
|
|
533
533
|
}
|
|
534
|
-
`;class
|
|
535
|
-
`,
|
|
534
|
+
`;class sn extends t.Component{setValue(e){this.props?.onChange?.(e)}render(){return t.createElement(on,null,this.input())}}class an extends ot{get optionsFrom(){return void 0===this.props.options?"state":"props"}setOptions(e){this.props.setOptions?this.props.setOptions(e):this.setState({options:e})}getOptions(){return this[this.optionsFrom]?.options}setRes(e,t,n){if(e){const e=n.formatValue?.bind(this)(t.data)??t.data;t.data=e,this.setOptions(e)}}}const ln=r.option`
|
|
535
|
+
`,cn=r.select`
|
|
536
536
|
${({size:e,multiple:t})=>""+(1==e||null==e&&1!=t?"height:24px;":"")}
|
|
537
537
|
width: 100%;
|
|
538
538
|
min-height: 24px;
|
|
@@ -544,7 +544,7 @@ z-index:1;
|
|
|
544
544
|
display: flex;
|
|
545
545
|
align-items: center;
|
|
546
546
|
}
|
|
547
|
-
`;class
|
|
547
|
+
`;class hn extends an{renderer(){const{showBlank:e,valueName:n="value",labelName:r="label",multiple:o,size:s}=this.props,i=[...this.getOptions()??[]];return 1!=o&&0!=e&&i.unshift({[n]:"",[r]:""}),t.createElement(cn,{value:this.getValue()??(o?[]:""),className:"jr-select",onChange:e=>{if(o){const t=[...e.target.selectedOptions].map((e=>e.index));this.setValue(t.length?t.map((e=>i[e][n])):null)}else{const t=e.target.selectedOptions[0].index;this.setValue(t?i[t][n]:null)}},size:s,multiple:o},i.map(((e,s)=>{const i={value:e[n],key:s};return(o&&this.getValue()?.indexOf(e[n])>-1||this.getValue()==e[n])&&(i.className="selected"),t.createElement(ln,i,e[r])})))}}const dn=r.div`
|
|
548
548
|
>label{
|
|
549
549
|
white-space: nowrap;
|
|
550
550
|
display: inline-flex;
|
|
@@ -552,7 +552,7 @@ z-index:1;
|
|
|
552
552
|
height: 24px;
|
|
553
553
|
padding-right: 12px;
|
|
554
554
|
}
|
|
555
|
-
`;class
|
|
555
|
+
`;class pn extends an{renderer(){const{valueName:e="value",labelName:n="label",onChange:r,...o}=this.props,s=this.getOptions();return t.createElement(dn,{className:"jr-radio"},s?.map(((r,o)=>{const s=r[e];return t.createElement("label",{key:o},t.createElement("input",{type:"radio",name:"radio",checked:this.getValue()==s,onClick:e=>{this.getValue()==s?(this.setValue(null),e.target.checked=!1):this.setValue(s)}}),r[n])})))}}class un extends an{renderer(){const{valueName:e="value",labelName:n="label"}=this.props,r=Array.isArray(this.getOptions()??[]),o=r?this.getOptions():[this.getOptions()],s=r?[...this.getValue()??[]]:this.getValue(),i=r?e=>s.indexOf(e)>-1:e=>e==s;return t.createElement(dn,{className:"jr-checkbox"},o?.map(((o,a)=>{const l=o[e];return t.createElement("label",{key:a},t.createElement("input",{type:"checkbox",multiple:r,value:l,checked:i(l),onChange:r?e=>{e.target.checked?s.push(l):s.splice(s.indexOf(l),1),this.setValue(s.length?s:null)}:e=>{this.setValue(e.target.checked?l:null)}}),o[n])})))}}const mn=r.input`
|
|
556
556
|
min-height: 24px;
|
|
557
557
|
width: 100%;
|
|
558
|
-
`;class
|
|
558
|
+
`;class fn extends sn{input(){return t.createElement(mn,{value:this.props.value??"",onChange:e=>{this.setValue(e.target.value)}})}}export{rn as JRAlert,dt as JRButton,un as JRCheckbox,et as JRDivMask,Kt as JRFields,at as JRFrame,Ze as JRMask,pn as JRRadio,hn as JRSelect,ot as JRSubmit,Qt as JRTable,en as JRTestReact,fn as JRText,xt as JRWindow,Je as random,nt as showMask};
|
package/build/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),r=require("react-dom/client");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=n(e),i=o(e),a=n(t);function l(e,t){return function(){return e.apply(t,arguments)}}const{toString:c}=Object.prototype,{getPrototypeOf:d}=Object,u=(h=Object.create(null),e=>{const t=c.call(e);return h[t]||(h[t]=t.slice(8,-1).toLowerCase())});var h;const p=e=>(e=e.toLowerCase(),t=>u(t)===e),f=e=>t=>typeof t===e,{isArray:m}=Array,g=f("undefined");const w=p("ArrayBuffer");const y=f("string"),b=f("function"),x=f("number"),v=e=>null!==e&&"object"==typeof e,E=e=>{if("object"!==u(e))return!1;const t=d(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},k=p("Date"),S=p("File"),R=p("Blob"),O=p("FileList"),C=p("URLSearchParams");function j(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),m(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(n=0;n<s;n++)i=o[n],t.call(null,e[i],i,e)}}function N(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,A=e=>!g(e)&&e!==$;const T=(V="undefined"!=typeof Uint8Array&&d(Uint8Array),e=>V&&e instanceof V);var V;const _=p("HTMLFormElement"),L=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),B=p("RegExp"),D=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};j(r,((r,o)=>{let s;!1!==(s=t(r,o,e))&&(n[o]=s||r)})),Object.defineProperties(e,n)},P="abcdefghijklmnopqrstuvwxyz",z="0123456789",F={DIGIT:z,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+z};const M=p("AsyncFunction");var U={isArray:m,isArrayBuffer:w,isBuffer:function(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=u(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&w(e.buffer),t},isString:y,isNumber:x,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:E,isUndefined:g,isDate:k,isFile:S,isBlob:R,isRegExp:B,isFunction:b,isStream:e=>v(e)&&b(e.pipe),isURLSearchParams:C,isTypedArray:T,isFileList:O,forEach:j,merge:function e(){const{caseless:t}=A(this)&&this||{},r={},n=(n,o)=>{const s=t&&N(r,o)||o;E(r[s])&&E(n)?r[s]=e(r[s],n):E(n)?r[s]=e({},n):m(n)?r[s]=n.slice():r[s]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&j(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(j(t,((t,n)=>{r&&b(t)?e[n]=l(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&d(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:p,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(m(e))return e;let t=e.length;if(!x(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:_,hasOwnProperty:L,hasOwnProp:L,reduceDescriptors:D,freezeMethods:e=>{D(e,((t,r)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];b(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return m(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:N,global:$,isContextDefined:A,ALPHABET:F,generateString:(e=16,t=F.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const o=m(e)?[]:{};return j(e,((e,t)=>{const s=r(e,n+1);!g(s)&&(o[t]=s)})),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:M,isThenable:e=>e&&(v(e)||b(e))&&b(e.then)&&b(e.catch)};function I(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}U.inherits(I,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const H=I.prototype,X={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{X[e]={value:e}})),Object.defineProperties(I,X),Object.defineProperty(H,"isAxiosError",{value:!0}),I.from=(e,t,r,n,o,s)=>{const i=Object.create(H);return U.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),I.call(i,e.message,t,r,n,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};function W(e){return U.isPlainObject(e)||U.isArray(e)}function q(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function J(e,t,r){return e?e.concat(t).map((function(e,t){return e=q(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const K=U.toFlatObject(U,{},null,(function(e){return/^is[A-Z]/.test(e)}));function G(e,t,r){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=U.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!U.isUndefined(t[e])}))).metaTokens,o=r.visitor||c,s=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&U.isSpecCompliantForm(t);if(!U.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(U.isDate(e))return e.toISOString();if(!a&&U.isBlob(e))throw new I("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(e)||U.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(U.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(U.isArray(e)&&function(e){return U.isArray(e)&&!e.some(W)}(e)||(U.isFileList(e)||U.endsWith(r,"[]"))&&(a=U.toArray(e)))return r=q(r),a.forEach((function(e,n){!U.isUndefined(e)&&null!==e&&t.append(!0===i?J([r],n,s):null===i?r:r+"[]",l(e))})),!1;return!!W(e)||(t.append(J(o,r,s),l(e)),!1)}const d=[],u=Object.assign(K,{defaultVisitor:c,convertValue:l,isVisitable:W});if(!U.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!U.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),U.forEach(r,(function(r,s){!0===(!(U.isUndefined(r)||null===r)&&o.call(t,r,U.isString(s)?s.trim():s,n,u))&&e(r,n?n.concat(s):[s])})),d.pop()}}(e),t}function Y(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Q(e,t){this._pairs=[],e&&G(e,this,t)}const Z=Q.prototype;function ee(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function te(e,t,r){if(!t)return e;const n=r&&r.encode||ee,o=r&&r.serialize;let s;if(s=o?o(t,r):U.isURLSearchParams(t)?t.toString():new Q(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}Z.append=function(e,t){this._pairs.push([e,t])},Z.toString=function(e){const t=e?function(t){return e.call(this,t,Y)}:Y;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var re=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){U.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Q,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const se="undefined"!=typeof window&&"undefined"!=typeof document,ie=(ae="undefined"!=typeof navigator&&navigator.product,se&&["ReactNative","NativeScript","NS"].indexOf(ae)<0);var ae;const le="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var ce={...Object.freeze({__proto__:null,hasBrowserEnv:se,hasStandardBrowserWebWorkerEnv:le,hasStandardBrowserEnv:ie}),...oe};function de(e){function t(e,r,n,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&U.isArray(n)?n.length:s,a)return U.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!i;n[s]&&U.isObject(n[s])||(n[s]=[]);return t(e,r,n[s],o)&&U.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}(n[s])),!i}if(U.isFormData(e)&&U.isFunction(e.entries)){const r={};return U.forEachEntry(e,((e,n)=>{t(function(e){return U.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const ue={transitional:ne,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=U.isObject(e);o&&U.isHTMLForm(e)&&(e=new FormData(e));if(U.isFormData(e))return n&&n?JSON.stringify(de(e)):e;if(U.isArrayBuffer(e)||U.isBuffer(e)||U.isStream(e)||U.isFile(e)||U.isBlob(e))return e;if(U.isArrayBufferView(e))return e.buffer;if(U.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return G(e,new ce.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return ce.isNode&&U.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=U.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return G(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(U.isString(e))try{return(t||JSON.parse)(e),U.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ue.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&U.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw I.from(e,I.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],(e=>{ue.headers[e]={}}));var he=ue;const pe=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const fe=Symbol("internals");function me(e){return e&&String(e).trim().toLowerCase()}function ge(e){return!1===e||null==e?e:U.isArray(e)?e.map(ge):String(e)}function we(e,t,r,n,o){return U.isFunction(n)?n.call(this,t,r):(o&&(t=r),U.isString(t)?U.isString(n)?-1!==t.indexOf(n):U.isRegExp(n)?n.test(t):void 0:void 0)}class ye{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=me(t);if(!o)throw new Error("header name must be a non-empty string");const s=U.findKey(n,o);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=ge(e))}const s=(e,t)=>U.forEach(e,((e,r)=>o(e,r,t)));return U.isPlainObject(e)||e instanceof this.constructor?s(e,t):U.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&pe[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&o(t,e,r),this}get(e,t){if(e=me(e)){const r=U.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(U.isFunction(t))return t.call(this,e,r);if(U.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=me(e)){const r=U.findKey(this,e);return!(!r||void 0===this[r]||t&&!we(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=me(e)){const o=U.findKey(r,e);!o||t&&!we(0,r[o],o,t)||(delete r[o],n=!0)}}return U.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!we(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return U.forEach(this,((n,o)=>{const s=U.findKey(r,o);if(s)return t[s]=ge(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();i!==o&&delete t[o],t[i]=ge(n),r[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return U.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&U.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[fe]=this[fe]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=me(e);t[n]||(!function(e,t){const r=U.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return U.isArray(e)?e.forEach(n):n(e),this}}ye.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(ye.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),U.freezeMethods(ye);var be=ye;function xe(e,t){const r=this||he,n=t||r,o=be.from(n.headers);let s=n.data;return U.forEach(e,(function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function ve(e){return!(!e||!e.__CANCEL__)}function Ee(e,t,r){I.call(this,null==e?"canceled":e,I.ERR_CANCELED,t,r),this.name="CanceledError"}U.inherits(Ee,I,{__CANCEL__:!0});var ke=ce.hasStandardBrowserEnv?{write(e,t,r,n,o,s){const i=[e+"="+encodeURIComponent(t)];U.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),U.isString(n)&&i.push("path="+n),U.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Se(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Re=ce.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=U.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Oe(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=n[i];o||(o=l),r[s]=a,n[s]=l;let d=i,u=0;for(;d!==s;)u+=r[d++],d%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const h=c&&l-c;return h?Math.round(1e3*u/h):void 0}}(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-r,l=n(a);r=s;const c={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:l||void 0,estimated:l&&i&&s<=i?(i-s)/l:void 0,event:o};c[t?"download":"upload"]=!0,e(c)}}const Ce={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const o=be.from(e.headers).normalize();let s,i,{responseType:a,withXSRFToken:l}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(U.isFormData(n))if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let d=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+r))}const u=Se(e.baseURL,e.url);function h(){if(!d)return;const n=be.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),c()}),(function(e){r(e),c()}),{data:a&&"text"!==a&&"json"!==a?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d}),d=null}if(d.open(e.method.toUpperCase(),te(u,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,"onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(h)},d.onabort=function(){d&&(r(new I("Request aborted",I.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new I("Network Error",I.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||ne;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new I(t,n.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,d)),d=null},ce.hasStandardBrowserEnv&&(l&&U.isFunction(l)&&(l=l(e)),l||!1!==l&&Re(u))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&ke.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===n&&o.setContentType(null),"setRequestHeader"in d&&U.forEach(o.toJSON(),(function(e,t){d.setRequestHeader(t,e)})),U.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),a&&"json"!==a&&(d.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",Oe(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",Oe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{d&&(r(!t||t.type?new Ee(null,e,d):t),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===ce.protocols.indexOf(p)?r(new I("Unsupported protocol "+p+":",I.ERR_BAD_REQUEST,e)):d.send(n||null)}))}};U.forEach(Ce,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const je=e=>`- ${e}`,Ne=e=>U.isFunction(e)||null===e||!1===e;var $e=e=>{e=U.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let s=0;s<t;s++){let t;if(r=e[s],n=r,!Ne(r)&&(n=Ce[(t=String(r)).toLowerCase()],void 0===n))throw new I(`Unknown adapter '${t}'`);if(n)break;o[t||"#"+s]=n}if(!n){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new I("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(je).join("\n"):" "+je(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function Ae(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ee(null,e)}function Te(e){Ae(e),e.headers=be.from(e.headers),e.data=xe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return $e(e.adapter||he.adapter)(e).then((function(t){return Ae(e),t.data=xe.call(e,e.transformResponse,t),t.headers=be.from(t.headers),t}),(function(t){return ve(t)||(Ae(e),t&&t.response&&(t.response.data=xe.call(e,e.transformResponse,t.response),t.response.headers=be.from(t.response.headers))),Promise.reject(t)}))}const Ve=e=>e instanceof be?e.toJSON():e;function _e(e,t){t=t||{};const r={};function n(e,t,r){return U.isPlainObject(e)&&U.isPlainObject(t)?U.merge.call({caseless:r},e,t):U.isPlainObject(t)?U.merge({},t):U.isArray(t)?t.slice():t}function o(e,t,r){return U.isUndefined(t)?U.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function s(e,t){if(!U.isUndefined(t))return n(void 0,t)}function i(e,t){return U.isUndefined(t)?U.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,s){return s in t?n(r,o):s in e?n(void 0,r):void 0}const l={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(Ve(e),Ve(t),!0)};return U.forEach(Object.keys(Object.assign({},e,t)),(function(n){const s=l[n]||o,i=s(e[n],t[n],n);U.isUndefined(i)&&s!==a||(r[n]=i)})),r}const Le="1.6.2",Be={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Be[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const De={};Be.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.2] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new I(n(o," has been removed"+(t?" in "+t:"")),I.ERR_DEPRECATED);return t&&!De[o]&&(De[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}};var Pe={assertOptions:function(e,t,r){if("object"!=typeof e)throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const t=e[s],r=void 0===t||i(t,s,e);if(!0!==r)throw new I("option "+s+" must be "+r,I.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new I("Unknown option "+s,I.ERR_BAD_OPTION)}},validators:Be};const ze=Pe.validators;class Fe{constructor(e){this.defaults=e,this.interceptors={request:new re,response:new re}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=_e(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Pe.assertOptions(r,{silentJSONParsing:ze.transitional(ze.boolean),forcedJSONParsing:ze.transitional(ze.boolean),clarifyTimeoutError:ze.transitional(ze.boolean)},!1),null!=n&&(U.isFunction(n)?t.paramsSerializer={serialize:n}:Pe.assertOptions(n,{encode:ze.function,serialize:ze.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&U.merge(o.common,o[t.method]);o&&U.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=be.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let d,u=0;if(!a){const e=[Te.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=i.length;let h=t;for(u=0;u<d;){const e=i[u++],t=i[u++];try{h=e(h)}catch(e){t.call(this,e);break}}try{c=Te.call(this,h)}catch(e){return Promise.reject(e)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(e){return te(Se((e=_e(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}U.forEach(["delete","get","head","options"],(function(e){Fe.prototype[e]=function(t,r){return this.request(_e(r||{},{method:e,url:t,data:(r||{}).data}))}})),U.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(_e(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Fe.prototype[e]=t(),Fe.prototype[e+"Form"]=t(!0)}));var Me=Fe;class Ue{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new Ee(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ue((function(t){e=t})),cancel:e}}}var Ie=Ue;const He={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(He).forEach((([e,t])=>{He[t]=e}));var Xe=He;const We=function e(t){const r=new Me(t),n=l(Me.prototype.request,r);return U.extend(n,Me.prototype,r,{allOwnKeys:!0}),U.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(_e(t,r))},n}(he);We.Axios=Me,We.CanceledError=Ee,We.CancelToken=Ie,We.isCancel=ve,We.VERSION=Le,We.toFormData=G,We.AxiosError=I,We.Cancel=We.CanceledError,We.all=function(e){return Promise.all(e)},We.spread=function(e){return function(t){return e.apply(null,t)}},We.isAxiosError=function(e){return U.isObject(e)&&!0===e.isAxiosError},We.mergeConfig=_e,We.AxiosHeaders=be,We.formToJSON=e=>de(U.isHTMLForm(e)?new FormData(e):e),We.getAdapter=$e,We.HttpStatusCode=Xe,We.default=We;var qe=We;const Je=console.debug,Ke=(e,t)=>{const r="function"==typeof t.get?(e,t)=>e?.get(t.slice(1))??t:(e,t)=>e?.[t.slice(1)]??t;return Array.from(e.match(/\:\w+/g)??[]).reduce(((e,n)=>e.replace(new RegExp(n,"g"),r(t,n))),e)},Ge=(e,t,r,n)=>"function"==typeof e?e?.bind(t)(r):e??n;function Ye(e=100,t=0){return Math.floor(Math.random()*(e+1-t))+t}class Qe{isJRHTML=!0;_hijos=[];_padre;_madre;_yo;constructor(e){var{yo:t,padre:r,madre:n,clases:o,personajes:s={},...e}=e;this.yo=t,r?(this.padre=r,this.madre=r.yo):n&&(this.madre=n),o&&(s.class=o.join(" ")),e.personajes=s,Object.assign(this,e),this._init()}_init(){}set style(e){Object.entries(e).forEach(((e,t)=>{this._yo.style[e[0]]=e[1]}))}set personajes(e){Object.entries(e).forEach((([e,t])=>{this._yo.setAttribute(e,t)}))}agregarHijo(e){return e.isJRHTML?(e.padre=this,e.madre=this.yo):e.yo?(e.padre=this,e=e.yo.name?new e.yo(e):new Qe(e)):this.yo.appendChild(document.createTextNode(e)),e}set html(e){this._yo.innerHTML=e}get html(){return this._yo.innerHTML}set hijos(e){e.forEach(((e,t)=>{this.agregarHijo(e)}))}get hijos(){return this._hijos}removeAllHijos(){this.hijos.forEach((e=>{e.yo.remove()})),delete this.hijos,this.hijos=[]}removeHijo(e){var t=this.hijos.indexOf(e);t>=0&&(this.yo.removeChild(this.yo.childNodes[t]),this.hijos.splice(t,1))}nacido(e){return document.createElement(e)}set yo(e){this._yo="string"==typeof e?this.nacido(e):e}get yo(){return this._yo}set padre(e){this._padre=e,this._padre&&this._padre._hijos.push(this)}get padre(){return this._padre}set madre(e){this._madre="string"==typeof e?document.getElementById(e):e,this._madre&&this._yo&&this._madre.appendChild(this._yo)}get madre(){return this._madre}set listeners(e){Object.entries(e).forEach((([e,t])=>{var r=this;"listeners"==e?this.listeners=t:this._yo.addEventListener(e,(function(e){t(e,r)}),!1)}))}get width(){return this._yo.clientWidth}set width(e){this._yo.style.width=e}get height(){return this._yo.clientHeight}set height(e){this._yo.style.height=e}set textContent(e){this._yo.textContent=e}set color(e){this.yo.style.color=e,this._color=e}get color(){return this._color}set visibility(e){this.yo.style.visibility=e}set tip(e){this.agregarHijo({yo:"span",clases:["tooltiptext"],textContent:e})}}const Ze=`\n display:none;\n #jr-mask-msg{\n padding: 10px;\n }\n user-select: none;\n cursor: wait;\n background-color: #000000aa;\n color: ${({theme:e})=>e?.colorPrimary??"whilte"};\n flex-direction: column;\n justify-content: center;\n align-items: center;\n position: fixed;\n\n z-index: 20000;\n overflow: hidden;\n \n .cs-loader-inner {\n\t\ttransform: translateY(-30%);\n\t\twidth: calc(100% - 200xpx);\n \n\t}\n\n animation: opc .4s ;\n @keyframes opc {\n 0% {opacity: 0;background: transparent;visibility:hidden;}\n 20% {opacity: 1;background: #000000aa; visibility: visible;}\n }\n\n\t.cs-loader-inner label {\n\t\tfont-size: 20px;\n\t\topacity: 0;\n\t\tdisplay:inline-block;\n\t}\n\n @keyframes lol {\n 0% {\n opacity: 0;\n transform: translateX(-300px);\n }\n 33% {\n opacity: 1;\n transform: translateX(0px);\n }\n 66% {\n opacity: 1;\n transform: translateX(0px);\n }\n 100% {\n opacity: 0;\n transform: translateX(300px);\n }\n }\n\n @-webkit-keyframes lol {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(-300px);\n }\n 33% {\n opacity: 1;\n -webkit-transform: translateX(0px);\n }\n 66% {\n opacity: 1;\n -webkit-transform: translateX(0px);\n }\n 100% {\n opacity: 0;\n -webkit-transform: translateX(300px);\n }\n }\n\n .cs-loader-inner label:nth-child(6) {\n -webkit-animation: lol 3s infinite ease-in-out;\n animation: lol 3s infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(5) {\n -webkit-animation: lol 3s 100ms infinite ease-in-out;\n animation: lol 3s 100ms infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(4) {\n -webkit-animation: lol 3s 200ms infinite ease-in-out;\n animation: lol 3s 200ms infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(3) {\n -webkit-animation: lol 3s 300ms infinite ease-in-out;\n animation: lol 3s 300ms infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(2) {\n -webkit-animation: lol 3s 400ms infinite ease-in-out;\n animation: lol 3s 400ms infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(1) {\n -webkit-animation: lol 3s 500ms infinite ease-in-out;\n animation: lol 3s 500ms infinite ease-in-out;\n }\n`,et=a.default.dialog`
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react"),t=require("styled-components"),r=require("react-dom/client");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}function o(e){if(e&&e.__esModule)return e;var t=Object.create(null);return e&&Object.keys(e).forEach((function(r){if("default"!==r){var n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:function(){return e[r]}})}})),t.default=e,Object.freeze(t)}var s=n(e),i=o(e),a=n(t);function l(e,t){return function(){return e.apply(t,arguments)}}const{toString:c}=Object.prototype,{getPrototypeOf:d}=Object,u=(h=Object.create(null),e=>{const t=c.call(e);return h[t]||(h[t]=t.slice(8,-1).toLowerCase())});var h;const p=e=>(e=e.toLowerCase(),t=>u(t)===e),f=e=>t=>typeof t===e,{isArray:m}=Array,g=f("undefined");const w=p("ArrayBuffer");const y=f("string"),b=f("function"),x=f("number"),v=e=>null!==e&&"object"==typeof e,E=e=>{if("object"!==u(e))return!1;const t=d(e);return!(null!==t&&t!==Object.prototype&&null!==Object.getPrototypeOf(t)||Symbol.toStringTag in e||Symbol.iterator in e)},k=p("Date"),S=p("File"),R=p("Blob"),O=p("FileList"),C=p("URLSearchParams");function j(e,t,{allOwnKeys:r=!1}={}){if(null==e)return;let n,o;if("object"!=typeof e&&(e=[e]),m(e))for(n=0,o=e.length;n<o;n++)t.call(null,e[n],n,e);else{const o=r?Object.getOwnPropertyNames(e):Object.keys(e),s=o.length;let i;for(n=0;n<s;n++)i=o[n],t.call(null,e[i],i,e)}}function N(e,t){t=t.toLowerCase();const r=Object.keys(e);let n,o=r.length;for(;o-- >0;)if(n=r[o],t===n.toLowerCase())return n;return null}const $="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:global,A=e=>!g(e)&&e!==$;const T=(V="undefined"!=typeof Uint8Array&&d(Uint8Array),e=>V&&e instanceof V);var V;const _=p("HTMLFormElement"),L=(({hasOwnProperty:e})=>(t,r)=>e.call(t,r))(Object.prototype),B=p("RegExp"),D=(e,t)=>{const r=Object.getOwnPropertyDescriptors(e),n={};j(r,((r,o)=>{let s;!1!==(s=t(r,o,e))&&(n[o]=s||r)})),Object.defineProperties(e,n)},P="abcdefghijklmnopqrstuvwxyz",z="0123456789",F={DIGIT:z,ALPHA:P,ALPHA_DIGIT:P+P.toUpperCase()+z};const M=p("AsyncFunction");var U={isArray:m,isArrayBuffer:w,isBuffer:function(e){return null!==e&&!g(e)&&null!==e.constructor&&!g(e.constructor)&&b(e.constructor.isBuffer)&&e.constructor.isBuffer(e)},isFormData:e=>{let t;return e&&("function"==typeof FormData&&e instanceof FormData||b(e.append)&&("formdata"===(t=u(e))||"object"===t&&b(e.toString)&&"[object FormData]"===e.toString()))},isArrayBufferView:function(e){let t;return t="undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&w(e.buffer),t},isString:y,isNumber:x,isBoolean:e=>!0===e||!1===e,isObject:v,isPlainObject:E,isUndefined:g,isDate:k,isFile:S,isBlob:R,isRegExp:B,isFunction:b,isStream:e=>v(e)&&b(e.pipe),isURLSearchParams:C,isTypedArray:T,isFileList:O,forEach:j,merge:function e(){const{caseless:t}=A(this)&&this||{},r={},n=(n,o)=>{const s=t&&N(r,o)||o;E(r[s])&&E(n)?r[s]=e(r[s],n):E(n)?r[s]=e({},n):m(n)?r[s]=n.slice():r[s]=n};for(let e=0,t=arguments.length;e<t;e++)arguments[e]&&j(arguments[e],n);return r},extend:(e,t,r,{allOwnKeys:n}={})=>(j(t,((t,n)=>{r&&b(t)?e[n]=l(t,r):e[n]=t}),{allOwnKeys:n}),e),trim:e=>e.trim?e.trim():e.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,""),stripBOM:e=>(65279===e.charCodeAt(0)&&(e=e.slice(1)),e),inherits:(e,t,r,n)=>{e.prototype=Object.create(t.prototype,n),e.prototype.constructor=e,Object.defineProperty(e,"super",{value:t.prototype}),r&&Object.assign(e.prototype,r)},toFlatObject:(e,t,r,n)=>{let o,s,i;const a={};if(t=t||{},null==e)return t;do{for(o=Object.getOwnPropertyNames(e),s=o.length;s-- >0;)i=o[s],n&&!n(i,e,t)||a[i]||(t[i]=e[i],a[i]=!0);e=!1!==r&&d(e)}while(e&&(!r||r(e,t))&&e!==Object.prototype);return t},kindOf:u,kindOfTest:p,endsWith:(e,t,r)=>{e=String(e),(void 0===r||r>e.length)&&(r=e.length),r-=t.length;const n=e.indexOf(t,r);return-1!==n&&n===r},toArray:e=>{if(!e)return null;if(m(e))return e;let t=e.length;if(!x(t))return null;const r=new Array(t);for(;t-- >0;)r[t]=e[t];return r},forEachEntry:(e,t)=>{const r=(e&&e[Symbol.iterator]).call(e);let n;for(;(n=r.next())&&!n.done;){const r=n.value;t.call(e,r[0],r[1])}},matchAll:(e,t)=>{let r;const n=[];for(;null!==(r=e.exec(t));)n.push(r);return n},isHTMLForm:_,hasOwnProperty:L,hasOwnProp:L,reduceDescriptors:D,freezeMethods:e=>{D(e,((t,r)=>{if(b(e)&&-1!==["arguments","caller","callee"].indexOf(r))return!1;const n=e[r];b(n)&&(t.enumerable=!1,"writable"in t?t.writable=!1:t.set||(t.set=()=>{throw Error("Can not rewrite read-only method '"+r+"'")}))}))},toObjectSet:(e,t)=>{const r={},n=e=>{e.forEach((e=>{r[e]=!0}))};return m(e)?n(e):n(String(e).split(t)),r},toCamelCase:e=>e.toLowerCase().replace(/[-_\s]([a-z\d])(\w*)/g,(function(e,t,r){return t.toUpperCase()+r})),noop:()=>{},toFiniteNumber:(e,t)=>(e=+e,Number.isFinite(e)?e:t),findKey:N,global:$,isContextDefined:A,ALPHABET:F,generateString:(e=16,t=F.ALPHA_DIGIT)=>{let r="";const{length:n}=t;for(;e--;)r+=t[Math.random()*n|0];return r},isSpecCompliantForm:function(e){return!!(e&&b(e.append)&&"FormData"===e[Symbol.toStringTag]&&e[Symbol.iterator])},toJSONObject:e=>{const t=new Array(10),r=(e,n)=>{if(v(e)){if(t.indexOf(e)>=0)return;if(!("toJSON"in e)){t[n]=e;const o=m(e)?[]:{};return j(e,((e,t)=>{const s=r(e,n+1);!g(s)&&(o[t]=s)})),t[n]=void 0,o}}return e};return r(e,0)},isAsyncFn:M,isThenable:e=>e&&(v(e)||b(e))&&b(e.then)&&b(e.catch)};function I(e,t,r,n,o){Error.call(this),Error.captureStackTrace?Error.captureStackTrace(this,this.constructor):this.stack=(new Error).stack,this.message=e,this.name="AxiosError",t&&(this.code=t),r&&(this.config=r),n&&(this.request=n),o&&(this.response=o)}U.inherits(I,Error,{toJSON:function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:U.toJSONObject(this.config),code:this.code,status:this.response&&this.response.status?this.response.status:null}}});const H=I.prototype,X={};["ERR_BAD_OPTION_VALUE","ERR_BAD_OPTION","ECONNABORTED","ETIMEDOUT","ERR_NETWORK","ERR_FR_TOO_MANY_REDIRECTS","ERR_DEPRECATED","ERR_BAD_RESPONSE","ERR_BAD_REQUEST","ERR_CANCELED","ERR_NOT_SUPPORT","ERR_INVALID_URL"].forEach((e=>{X[e]={value:e}})),Object.defineProperties(I,X),Object.defineProperty(H,"isAxiosError",{value:!0}),I.from=(e,t,r,n,o,s)=>{const i=Object.create(H);return U.toFlatObject(e,i,(function(e){return e!==Error.prototype}),(e=>"isAxiosError"!==e)),I.call(i,e.message,t,r,n,o),i.cause=e,i.name=e.name,s&&Object.assign(i,s),i};function W(e){return U.isPlainObject(e)||U.isArray(e)}function J(e){return U.endsWith(e,"[]")?e.slice(0,-2):e}function q(e,t,r){return e?e.concat(t).map((function(e,t){return e=J(e),!r&&t?"["+e+"]":e})).join(r?".":""):t}const K=U.toFlatObject(U,{},null,(function(e){return/^is[A-Z]/.test(e)}));function G(e,t,r){if(!U.isObject(e))throw new TypeError("target must be an object");t=t||new FormData;const n=(r=U.toFlatObject(r,{metaTokens:!0,dots:!1,indexes:!1},!1,(function(e,t){return!U.isUndefined(t[e])}))).metaTokens,o=r.visitor||c,s=r.dots,i=r.indexes,a=(r.Blob||"undefined"!=typeof Blob&&Blob)&&U.isSpecCompliantForm(t);if(!U.isFunction(o))throw new TypeError("visitor must be a function");function l(e){if(null===e)return"";if(U.isDate(e))return e.toISOString();if(!a&&U.isBlob(e))throw new I("Blob is not supported. Use a Buffer instead.");return U.isArrayBuffer(e)||U.isTypedArray(e)?a&&"function"==typeof Blob?new Blob([e]):Buffer.from(e):e}function c(e,r,o){let a=e;if(e&&!o&&"object"==typeof e)if(U.endsWith(r,"{}"))r=n?r:r.slice(0,-2),e=JSON.stringify(e);else if(U.isArray(e)&&function(e){return U.isArray(e)&&!e.some(W)}(e)||(U.isFileList(e)||U.endsWith(r,"[]"))&&(a=U.toArray(e)))return r=J(r),a.forEach((function(e,n){!U.isUndefined(e)&&null!==e&&t.append(!0===i?q([r],n,s):null===i?r:r+"[]",l(e))})),!1;return!!W(e)||(t.append(q(o,r,s),l(e)),!1)}const d=[],u=Object.assign(K,{defaultVisitor:c,convertValue:l,isVisitable:W});if(!U.isObject(e))throw new TypeError("data must be an object");return function e(r,n){if(!U.isUndefined(r)){if(-1!==d.indexOf(r))throw Error("Circular reference detected in "+n.join("."));d.push(r),U.forEach(r,(function(r,s){!0===(!(U.isUndefined(r)||null===r)&&o.call(t,r,U.isString(s)?s.trim():s,n,u))&&e(r,n?n.concat(s):[s])})),d.pop()}}(e),t}function Y(e){const t={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(e).replace(/[!'()~]|%20|%00/g,(function(e){return t[e]}))}function Q(e,t){this._pairs=[],e&&G(e,this,t)}const Z=Q.prototype;function ee(e){return encodeURIComponent(e).replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}function te(e,t,r){if(!t)return e;const n=r&&r.encode||ee,o=r&&r.serialize;let s;if(s=o?o(t,r):U.isURLSearchParams(t)?t.toString():new Q(t,r).toString(n),s){const t=e.indexOf("#");-1!==t&&(e=e.slice(0,t)),e+=(-1===e.indexOf("?")?"?":"&")+s}return e}Z.append=function(e,t){this._pairs.push([e,t])},Z.toString=function(e){const t=e?function(t){return e.call(this,t,Y)}:Y;return this._pairs.map((function(e){return t(e[0])+"="+t(e[1])}),"").join("&")};var re=class{constructor(){this.handlers=[]}use(e,t,r){return this.handlers.push({fulfilled:e,rejected:t,synchronous:!!r&&r.synchronous,runWhen:r?r.runWhen:null}),this.handlers.length-1}eject(e){this.handlers[e]&&(this.handlers[e]=null)}clear(){this.handlers&&(this.handlers=[])}forEach(e){U.forEach(this.handlers,(function(t){null!==t&&e(t)}))}},ne={silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},oe={isBrowser:!0,classes:{URLSearchParams:"undefined"!=typeof URLSearchParams?URLSearchParams:Q,FormData:"undefined"!=typeof FormData?FormData:null,Blob:"undefined"!=typeof Blob?Blob:null},protocols:["http","https","file","blob","url","data"]};const se="undefined"!=typeof window&&"undefined"!=typeof document,ie=(ae="undefined"!=typeof navigator&&navigator.product,se&&["ReactNative","NativeScript","NS"].indexOf(ae)<0);var ae;const le="undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&"function"==typeof self.importScripts;var ce={...Object.freeze({__proto__:null,hasBrowserEnv:se,hasStandardBrowserWebWorkerEnv:le,hasStandardBrowserEnv:ie}),...oe};function de(e){function t(e,r,n,o){let s=e[o++];const i=Number.isFinite(+s),a=o>=e.length;if(s=!s&&U.isArray(n)?n.length:s,a)return U.hasOwnProp(n,s)?n[s]=[n[s],r]:n[s]=r,!i;n[s]&&U.isObject(n[s])||(n[s]=[]);return t(e,r,n[s],o)&&U.isArray(n[s])&&(n[s]=function(e){const t={},r=Object.keys(e);let n;const o=r.length;let s;for(n=0;n<o;n++)s=r[n],t[s]=e[s];return t}(n[s])),!i}if(U.isFormData(e)&&U.isFunction(e.entries)){const r={};return U.forEachEntry(e,((e,n)=>{t(function(e){return U.matchAll(/\w+|\[(\w*)]/g,e).map((e=>"[]"===e[0]?"":e[1]||e[0]))}(e),n,r,0)})),r}return null}const ue={transitional:ne,adapter:["xhr","http"],transformRequest:[function(e,t){const r=t.getContentType()||"",n=r.indexOf("application/json")>-1,o=U.isObject(e);o&&U.isHTMLForm(e)&&(e=new FormData(e));if(U.isFormData(e))return n&&n?JSON.stringify(de(e)):e;if(U.isArrayBuffer(e)||U.isBuffer(e)||U.isStream(e)||U.isFile(e)||U.isBlob(e))return e;if(U.isArrayBufferView(e))return e.buffer;if(U.isURLSearchParams(e))return t.setContentType("application/x-www-form-urlencoded;charset=utf-8",!1),e.toString();let s;if(o){if(r.indexOf("application/x-www-form-urlencoded")>-1)return function(e,t){return G(e,new ce.classes.URLSearchParams,Object.assign({visitor:function(e,t,r,n){return ce.isNode&&U.isBuffer(e)?(this.append(t,e.toString("base64")),!1):n.defaultVisitor.apply(this,arguments)}},t))}(e,this.formSerializer).toString();if((s=U.isFileList(e))||r.indexOf("multipart/form-data")>-1){const t=this.env&&this.env.FormData;return G(s?{"files[]":e}:e,t&&new t,this.formSerializer)}}return o||n?(t.setContentType("application/json",!1),function(e,t,r){if(U.isString(e))try{return(t||JSON.parse)(e),U.trim(e)}catch(e){if("SyntaxError"!==e.name)throw e}return(r||JSON.stringify)(e)}(e)):e}],transformResponse:[function(e){const t=this.transitional||ue.transitional,r=t&&t.forcedJSONParsing,n="json"===this.responseType;if(e&&U.isString(e)&&(r&&!this.responseType||n)){const r=!(t&&t.silentJSONParsing)&&n;try{return JSON.parse(e)}catch(e){if(r){if("SyntaxError"===e.name)throw I.from(e,I.ERR_BAD_RESPONSE,this,null,this.response);throw e}}}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,env:{FormData:ce.classes.FormData,Blob:ce.classes.Blob},validateStatus:function(e){return e>=200&&e<300},headers:{common:{Accept:"application/json, text/plain, */*","Content-Type":void 0}}};U.forEach(["delete","get","head","post","put","patch"],(e=>{ue.headers[e]={}}));var he=ue;const pe=U.toObjectSet(["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"]);const fe=Symbol("internals");function me(e){return e&&String(e).trim().toLowerCase()}function ge(e){return!1===e||null==e?e:U.isArray(e)?e.map(ge):String(e)}function we(e,t,r,n,o){return U.isFunction(n)?n.call(this,t,r):(o&&(t=r),U.isString(t)?U.isString(n)?-1!==t.indexOf(n):U.isRegExp(n)?n.test(t):void 0:void 0)}class ye{constructor(e){e&&this.set(e)}set(e,t,r){const n=this;function o(e,t,r){const o=me(t);if(!o)throw new Error("header name must be a non-empty string");const s=U.findKey(n,o);(!s||void 0===n[s]||!0===r||void 0===r&&!1!==n[s])&&(n[s||t]=ge(e))}const s=(e,t)=>U.forEach(e,((e,r)=>o(e,r,t)));return U.isPlainObject(e)||e instanceof this.constructor?s(e,t):U.isString(e)&&(e=e.trim())&&!/^[-_a-zA-Z0-9^`|~,!#$%&'*+.]+$/.test(e.trim())?s((e=>{const t={};let r,n,o;return e&&e.split("\n").forEach((function(e){o=e.indexOf(":"),r=e.substring(0,o).trim().toLowerCase(),n=e.substring(o+1).trim(),!r||t[r]&&pe[r]||("set-cookie"===r?t[r]?t[r].push(n):t[r]=[n]:t[r]=t[r]?t[r]+", "+n:n)})),t})(e),t):null!=e&&o(t,e,r),this}get(e,t){if(e=me(e)){const r=U.findKey(this,e);if(r){const e=this[r];if(!t)return e;if(!0===t)return function(e){const t=Object.create(null),r=/([^\s,;=]+)\s*(?:=\s*([^,;]+))?/g;let n;for(;n=r.exec(e);)t[n[1]]=n[2];return t}(e);if(U.isFunction(t))return t.call(this,e,r);if(U.isRegExp(t))return t.exec(e);throw new TypeError("parser must be boolean|regexp|function")}}}has(e,t){if(e=me(e)){const r=U.findKey(this,e);return!(!r||void 0===this[r]||t&&!we(0,this[r],r,t))}return!1}delete(e,t){const r=this;let n=!1;function o(e){if(e=me(e)){const o=U.findKey(r,e);!o||t&&!we(0,r[o],o,t)||(delete r[o],n=!0)}}return U.isArray(e)?e.forEach(o):o(e),n}clear(e){const t=Object.keys(this);let r=t.length,n=!1;for(;r--;){const o=t[r];e&&!we(0,this[o],o,e,!0)||(delete this[o],n=!0)}return n}normalize(e){const t=this,r={};return U.forEach(this,((n,o)=>{const s=U.findKey(r,o);if(s)return t[s]=ge(n),void delete t[o];const i=e?function(e){return e.trim().toLowerCase().replace(/([a-z\d])(\w*)/g,((e,t,r)=>t.toUpperCase()+r))}(o):String(o).trim();i!==o&&delete t[o],t[i]=ge(n),r[i]=!0})),this}concat(...e){return this.constructor.concat(this,...e)}toJSON(e){const t=Object.create(null);return U.forEach(this,((r,n)=>{null!=r&&!1!==r&&(t[n]=e&&U.isArray(r)?r.join(", "):r)})),t}[Symbol.iterator](){return Object.entries(this.toJSON())[Symbol.iterator]()}toString(){return Object.entries(this.toJSON()).map((([e,t])=>e+": "+t)).join("\n")}get[Symbol.toStringTag](){return"AxiosHeaders"}static from(e){return e instanceof this?e:new this(e)}static concat(e,...t){const r=new this(e);return t.forEach((e=>r.set(e))),r}static accessor(e){const t=(this[fe]=this[fe]={accessors:{}}).accessors,r=this.prototype;function n(e){const n=me(e);t[n]||(!function(e,t){const r=U.toCamelCase(" "+t);["get","set","has"].forEach((n=>{Object.defineProperty(e,n+r,{value:function(e,r,o){return this[n].call(this,t,e,r,o)},configurable:!0})}))}(r,e),t[n]=!0)}return U.isArray(e)?e.forEach(n):n(e),this}}ye.accessor(["Content-Type","Content-Length","Accept","Accept-Encoding","User-Agent","Authorization"]),U.reduceDescriptors(ye.prototype,(({value:e},t)=>{let r=t[0].toUpperCase()+t.slice(1);return{get:()=>e,set(e){this[r]=e}}})),U.freezeMethods(ye);var be=ye;function xe(e,t){const r=this||he,n=t||r,o=be.from(n.headers);let s=n.data;return U.forEach(e,(function(e){s=e.call(r,s,o.normalize(),t?t.status:void 0)})),o.normalize(),s}function ve(e){return!(!e||!e.__CANCEL__)}function Ee(e,t,r){I.call(this,null==e?"canceled":e,I.ERR_CANCELED,t,r),this.name="CanceledError"}U.inherits(Ee,I,{__CANCEL__:!0});var ke=ce.hasStandardBrowserEnv?{write(e,t,r,n,o,s){const i=[e+"="+encodeURIComponent(t)];U.isNumber(r)&&i.push("expires="+new Date(r).toGMTString()),U.isString(n)&&i.push("path="+n),U.isString(o)&&i.push("domain="+o),!0===s&&i.push("secure"),document.cookie=i.join("; ")},read(e){const t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove(e){this.write(e,"",Date.now()-864e5)}}:{write(){},read:()=>null,remove(){}};function Se(e,t){return e&&!/^([a-z][a-z\d+\-.]*:)?\/\//i.test(t)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(e,t):t}var Re=ce.hasStandardBrowserEnv?function(){const e=/(msie|trident)/i.test(navigator.userAgent),t=document.createElement("a");let r;function n(r){let n=r;return e&&(t.setAttribute("href",n),n=t.href),t.setAttribute("href",n),{href:t.href,protocol:t.protocol?t.protocol.replace(/:$/,""):"",host:t.host,search:t.search?t.search.replace(/^\?/,""):"",hash:t.hash?t.hash.replace(/^#/,""):"",hostname:t.hostname,port:t.port,pathname:"/"===t.pathname.charAt(0)?t.pathname:"/"+t.pathname}}return r=n(window.location.href),function(e){const t=U.isString(e)?n(e):e;return t.protocol===r.protocol&&t.host===r.host}}():function(){return!0};function Oe(e,t){let r=0;const n=function(e,t){e=e||10;const r=new Array(e),n=new Array(e);let o,s=0,i=0;return t=void 0!==t?t:1e3,function(a){const l=Date.now(),c=n[i];o||(o=l),r[s]=a,n[s]=l;let d=i,u=0;for(;d!==s;)u+=r[d++],d%=e;if(s=(s+1)%e,s===i&&(i=(i+1)%e),l-o<t)return;const h=c&&l-c;return h?Math.round(1e3*u/h):void 0}}(50,250);return o=>{const s=o.loaded,i=o.lengthComputable?o.total:void 0,a=s-r,l=n(a);r=s;const c={loaded:s,total:i,progress:i?s/i:void 0,bytes:a,rate:l||void 0,estimated:l&&i&&s<=i?(i-s)/l:void 0,event:o};c[t?"download":"upload"]=!0,e(c)}}const Ce={http:null,xhr:"undefined"!=typeof XMLHttpRequest&&function(e){return new Promise((function(t,r){let n=e.data;const o=be.from(e.headers).normalize();let s,i,{responseType:a,withXSRFToken:l}=e;function c(){e.cancelToken&&e.cancelToken.unsubscribe(s),e.signal&&e.signal.removeEventListener("abort",s)}if(U.isFormData(n))if(ce.hasStandardBrowserEnv||ce.hasStandardBrowserWebWorkerEnv)o.setContentType(!1);else if(!1!==(i=o.getContentType())){const[e,...t]=i?i.split(";").map((e=>e.trim())).filter(Boolean):[];o.setContentType([e||"multipart/form-data",...t].join("; "))}let d=new XMLHttpRequest;if(e.auth){const t=e.auth.username||"",r=e.auth.password?unescape(encodeURIComponent(e.auth.password)):"";o.set("Authorization","Basic "+btoa(t+":"+r))}const u=Se(e.baseURL,e.url);function h(){if(!d)return;const n=be.from("getAllResponseHeaders"in d&&d.getAllResponseHeaders());!function(e,t,r){const n=r.config.validateStatus;r.status&&n&&!n(r.status)?t(new I("Request failed with status code "+r.status,[I.ERR_BAD_REQUEST,I.ERR_BAD_RESPONSE][Math.floor(r.status/100)-4],r.config,r.request,r)):e(r)}((function(e){t(e),c()}),(function(e){r(e),c()}),{data:a&&"text"!==a&&"json"!==a?d.response:d.responseText,status:d.status,statusText:d.statusText,headers:n,config:e,request:d}),d=null}if(d.open(e.method.toUpperCase(),te(u,e.params,e.paramsSerializer),!0),d.timeout=e.timeout,"onloadend"in d?d.onloadend=h:d.onreadystatechange=function(){d&&4===d.readyState&&(0!==d.status||d.responseURL&&0===d.responseURL.indexOf("file:"))&&setTimeout(h)},d.onabort=function(){d&&(r(new I("Request aborted",I.ECONNABORTED,e,d)),d=null)},d.onerror=function(){r(new I("Network Error",I.ERR_NETWORK,e,d)),d=null},d.ontimeout=function(){let t=e.timeout?"timeout of "+e.timeout+"ms exceeded":"timeout exceeded";const n=e.transitional||ne;e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),r(new I(t,n.clarifyTimeoutError?I.ETIMEDOUT:I.ECONNABORTED,e,d)),d=null},ce.hasStandardBrowserEnv&&(l&&U.isFunction(l)&&(l=l(e)),l||!1!==l&&Re(u))){const t=e.xsrfHeaderName&&e.xsrfCookieName&&ke.read(e.xsrfCookieName);t&&o.set(e.xsrfHeaderName,t)}void 0===n&&o.setContentType(null),"setRequestHeader"in d&&U.forEach(o.toJSON(),(function(e,t){d.setRequestHeader(t,e)})),U.isUndefined(e.withCredentials)||(d.withCredentials=!!e.withCredentials),a&&"json"!==a&&(d.responseType=e.responseType),"function"==typeof e.onDownloadProgress&&d.addEventListener("progress",Oe(e.onDownloadProgress,!0)),"function"==typeof e.onUploadProgress&&d.upload&&d.upload.addEventListener("progress",Oe(e.onUploadProgress)),(e.cancelToken||e.signal)&&(s=t=>{d&&(r(!t||t.type?new Ee(null,e,d):t),d.abort(),d=null)},e.cancelToken&&e.cancelToken.subscribe(s),e.signal&&(e.signal.aborted?s():e.signal.addEventListener("abort",s)));const p=function(e){const t=/^([-+\w]{1,25})(:?\/\/|:)/.exec(e);return t&&t[1]||""}(u);p&&-1===ce.protocols.indexOf(p)?r(new I("Unsupported protocol "+p+":",I.ERR_BAD_REQUEST,e)):d.send(n||null)}))}};U.forEach(Ce,((e,t)=>{if(e){try{Object.defineProperty(e,"name",{value:t})}catch(e){}Object.defineProperty(e,"adapterName",{value:t})}}));const je=e=>`- ${e}`,Ne=e=>U.isFunction(e)||null===e||!1===e;var $e=e=>{e=U.isArray(e)?e:[e];const{length:t}=e;let r,n;const o={};for(let s=0;s<t;s++){let t;if(r=e[s],n=r,!Ne(r)&&(n=Ce[(t=String(r)).toLowerCase()],void 0===n))throw new I(`Unknown adapter '${t}'`);if(n)break;o[t||"#"+s]=n}if(!n){const e=Object.entries(o).map((([e,t])=>`adapter ${e} `+(!1===t?"is not supported by the environment":"is not available in the build")));throw new I("There is no suitable adapter to dispatch the request "+(t?e.length>1?"since :\n"+e.map(je).join("\n"):" "+je(e[0]):"as no adapter specified"),"ERR_NOT_SUPPORT")}return n};function Ae(e){if(e.cancelToken&&e.cancelToken.throwIfRequested(),e.signal&&e.signal.aborted)throw new Ee(null,e)}function Te(e){Ae(e),e.headers=be.from(e.headers),e.data=xe.call(e,e.transformRequest),-1!==["post","put","patch"].indexOf(e.method)&&e.headers.setContentType("application/x-www-form-urlencoded",!1);return $e(e.adapter||he.adapter)(e).then((function(t){return Ae(e),t.data=xe.call(e,e.transformResponse,t),t.headers=be.from(t.headers),t}),(function(t){return ve(t)||(Ae(e),t&&t.response&&(t.response.data=xe.call(e,e.transformResponse,t.response),t.response.headers=be.from(t.response.headers))),Promise.reject(t)}))}const Ve=e=>e instanceof be?e.toJSON():e;function _e(e,t){t=t||{};const r={};function n(e,t,r){return U.isPlainObject(e)&&U.isPlainObject(t)?U.merge.call({caseless:r},e,t):U.isPlainObject(t)?U.merge({},t):U.isArray(t)?t.slice():t}function o(e,t,r){return U.isUndefined(t)?U.isUndefined(e)?void 0:n(void 0,e,r):n(e,t,r)}function s(e,t){if(!U.isUndefined(t))return n(void 0,t)}function i(e,t){return U.isUndefined(t)?U.isUndefined(e)?void 0:n(void 0,e):n(void 0,t)}function a(r,o,s){return s in t?n(r,o):s in e?n(void 0,r):void 0}const l={url:s,method:s,data:s,baseURL:i,transformRequest:i,transformResponse:i,paramsSerializer:i,timeout:i,timeoutMessage:i,withCredentials:i,withXSRFToken:i,adapter:i,responseType:i,xsrfCookieName:i,xsrfHeaderName:i,onUploadProgress:i,onDownloadProgress:i,decompress:i,maxContentLength:i,maxBodyLength:i,beforeRedirect:i,transport:i,httpAgent:i,httpsAgent:i,cancelToken:i,socketPath:i,responseEncoding:i,validateStatus:a,headers:(e,t)=>o(Ve(e),Ve(t),!0)};return U.forEach(Object.keys(Object.assign({},e,t)),(function(n){const s=l[n]||o,i=s(e[n],t[n],n);U.isUndefined(i)&&s!==a||(r[n]=i)})),r}const Le="1.6.2",Be={};["object","boolean","number","function","string","symbol"].forEach(((e,t)=>{Be[e]=function(r){return typeof r===e||"a"+(t<1?"n ":" ")+e}}));const De={};Be.transitional=function(e,t,r){function n(e,t){return"[Axios v1.6.2] Transitional option '"+e+"'"+t+(r?". "+r:"")}return(r,o,s)=>{if(!1===e)throw new I(n(o," has been removed"+(t?" in "+t:"")),I.ERR_DEPRECATED);return t&&!De[o]&&(De[o]=!0,console.warn(n(o," has been deprecated since v"+t+" and will be removed in the near future"))),!e||e(r,o,s)}};var Pe={assertOptions:function(e,t,r){if("object"!=typeof e)throw new I("options must be an object",I.ERR_BAD_OPTION_VALUE);const n=Object.keys(e);let o=n.length;for(;o-- >0;){const s=n[o],i=t[s];if(i){const t=e[s],r=void 0===t||i(t,s,e);if(!0!==r)throw new I("option "+s+" must be "+r,I.ERR_BAD_OPTION_VALUE)}else if(!0!==r)throw new I("Unknown option "+s,I.ERR_BAD_OPTION)}},validators:Be};const ze=Pe.validators;class Fe{constructor(e){this.defaults=e,this.interceptors={request:new re,response:new re}}request(e,t){"string"==typeof e?(t=t||{}).url=e:t=e||{},t=_e(this.defaults,t);const{transitional:r,paramsSerializer:n,headers:o}=t;void 0!==r&&Pe.assertOptions(r,{silentJSONParsing:ze.transitional(ze.boolean),forcedJSONParsing:ze.transitional(ze.boolean),clarifyTimeoutError:ze.transitional(ze.boolean)},!1),null!=n&&(U.isFunction(n)?t.paramsSerializer={serialize:n}:Pe.assertOptions(n,{encode:ze.function,serialize:ze.function},!0)),t.method=(t.method||this.defaults.method||"get").toLowerCase();let s=o&&U.merge(o.common,o[t.method]);o&&U.forEach(["delete","get","head","post","put","patch","common"],(e=>{delete o[e]})),t.headers=be.concat(s,o);const i=[];let a=!0;this.interceptors.request.forEach((function(e){"function"==typeof e.runWhen&&!1===e.runWhen(t)||(a=a&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));const l=[];let c;this.interceptors.response.forEach((function(e){l.push(e.fulfilled,e.rejected)}));let d,u=0;if(!a){const e=[Te.bind(this),void 0];for(e.unshift.apply(e,i),e.push.apply(e,l),d=e.length,c=Promise.resolve(t);u<d;)c=c.then(e[u++],e[u++]);return c}d=i.length;let h=t;for(u=0;u<d;){const e=i[u++],t=i[u++];try{h=e(h)}catch(e){t.call(this,e);break}}try{c=Te.call(this,h)}catch(e){return Promise.reject(e)}for(u=0,d=l.length;u<d;)c=c.then(l[u++],l[u++]);return c}getUri(e){return te(Se((e=_e(this.defaults,e)).baseURL,e.url),e.params,e.paramsSerializer)}}U.forEach(["delete","get","head","options"],(function(e){Fe.prototype[e]=function(t,r){return this.request(_e(r||{},{method:e,url:t,data:(r||{}).data}))}})),U.forEach(["post","put","patch"],(function(e){function t(t){return function(r,n,o){return this.request(_e(o||{},{method:e,headers:t?{"Content-Type":"multipart/form-data"}:{},url:r,data:n}))}}Fe.prototype[e]=t(),Fe.prototype[e+"Form"]=t(!0)}));var Me=Fe;class Ue{constructor(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");let t;this.promise=new Promise((function(e){t=e}));const r=this;this.promise.then((e=>{if(!r._listeners)return;let t=r._listeners.length;for(;t-- >0;)r._listeners[t](e);r._listeners=null})),this.promise.then=e=>{let t;const n=new Promise((e=>{r.subscribe(e),t=e})).then(e);return n.cancel=function(){r.unsubscribe(t)},n},e((function(e,n,o){r.reason||(r.reason=new Ee(e,n,o),t(r.reason))}))}throwIfRequested(){if(this.reason)throw this.reason}subscribe(e){this.reason?e(this.reason):this._listeners?this._listeners.push(e):this._listeners=[e]}unsubscribe(e){if(!this._listeners)return;const t=this._listeners.indexOf(e);-1!==t&&this._listeners.splice(t,1)}static source(){let e;return{token:new Ue((function(t){e=t})),cancel:e}}}var Ie=Ue;const He={Continue:100,SwitchingProtocols:101,Processing:102,EarlyHints:103,Ok:200,Created:201,Accepted:202,NonAuthoritativeInformation:203,NoContent:204,ResetContent:205,PartialContent:206,MultiStatus:207,AlreadyReported:208,ImUsed:226,MultipleChoices:300,MovedPermanently:301,Found:302,SeeOther:303,NotModified:304,UseProxy:305,Unused:306,TemporaryRedirect:307,PermanentRedirect:308,BadRequest:400,Unauthorized:401,PaymentRequired:402,Forbidden:403,NotFound:404,MethodNotAllowed:405,NotAcceptable:406,ProxyAuthenticationRequired:407,RequestTimeout:408,Conflict:409,Gone:410,LengthRequired:411,PreconditionFailed:412,PayloadTooLarge:413,UriTooLong:414,UnsupportedMediaType:415,RangeNotSatisfiable:416,ExpectationFailed:417,ImATeapot:418,MisdirectedRequest:421,UnprocessableEntity:422,Locked:423,FailedDependency:424,TooEarly:425,UpgradeRequired:426,PreconditionRequired:428,TooManyRequests:429,RequestHeaderFieldsTooLarge:431,UnavailableForLegalReasons:451,InternalServerError:500,NotImplemented:501,BadGateway:502,ServiceUnavailable:503,GatewayTimeout:504,HttpVersionNotSupported:505,VariantAlsoNegotiates:506,InsufficientStorage:507,LoopDetected:508,NotExtended:510,NetworkAuthenticationRequired:511};Object.entries(He).forEach((([e,t])=>{He[t]=e}));var Xe=He;const We=function e(t){const r=new Me(t),n=l(Me.prototype.request,r);return U.extend(n,Me.prototype,r,{allOwnKeys:!0}),U.extend(n,r,null,{allOwnKeys:!0}),n.create=function(r){return e(_e(t,r))},n}(he);We.Axios=Me,We.CanceledError=Ee,We.CancelToken=Ie,We.isCancel=ve,We.VERSION=Le,We.toFormData=G,We.AxiosError=I,We.Cancel=We.CanceledError,We.all=function(e){return Promise.all(e)},We.spread=function(e){return function(t){return e.apply(null,t)}},We.isAxiosError=function(e){return U.isObject(e)&&!0===e.isAxiosError},We.mergeConfig=_e,We.AxiosHeaders=be,We.formToJSON=e=>de(U.isHTMLForm(e)?new FormData(e):e),We.getAdapter=$e,We.HttpStatusCode=Xe,We.default=We;var Je=We;const qe=console.debug,Ke=(e,t)=>{const r="function"==typeof t.get?(e,t)=>e?.get(t.slice(1))??t:(e,t)=>e?.[t.slice(1)]??t;return Array.from(e.match(/\:\w+/g)??[]).reduce(((e,n)=>e.replace(new RegExp(n,"g"),r(t,n))),e)},Ge=(e,t,r,n)=>"function"==typeof e?e?.bind(t)(r):e??n;function Ye(e=100,t=0){return Math.floor(Math.random()*(e+1-t))+t}class Qe{isJRHTML=!0;_hijos=[];_padre;_madre;_yo;constructor(e){var{yo:t,padre:r,madre:n,clases:o,personajes:s={},...e}=e;this.yo=t,r?(this.padre=r,this.madre=r.yo):n&&(this.madre=n),o&&(s.class=o.join(" ")),e.personajes=s,Object.assign(this,e),this._init()}_init(){}set style(e){Object.entries(e).forEach(((e,t)=>{this._yo.style[e[0]]=e[1]}))}set personajes(e){Object.entries(e).forEach((([e,t])=>{this._yo.setAttribute(e,t)}))}agregarHijo(e){return e.isJRHTML?(e.padre=this,e.madre=this.yo):e.yo?(e.padre=this,e=e.yo.name?new e.yo(e):new Qe(e)):this.yo.appendChild(document.createTextNode(e)),e}set html(e){this._yo.innerHTML=e}get html(){return this._yo.innerHTML}set hijos(e){e.forEach(((e,t)=>{this.agregarHijo(e)}))}get hijos(){return this._hijos}removeAllHijos(){this.hijos.forEach((e=>{e.yo.remove()})),delete this.hijos,this.hijos=[]}removeHijo(e){var t=this.hijos.indexOf(e);t>=0&&(this.yo.removeChild(this.yo.childNodes[t]),this.hijos.splice(t,1))}nacido(e){return document.createElement(e)}set yo(e){this._yo="string"==typeof e?this.nacido(e):e}get yo(){return this._yo}set padre(e){this._padre=e,this._padre&&this._padre._hijos.push(this)}get padre(){return this._padre}set madre(e){this._madre="string"==typeof e?document.getElementById(e):e,this._madre&&this._yo&&this._madre.appendChild(this._yo)}get madre(){return this._madre}set listeners(e){Object.entries(e).forEach((([e,t])=>{var r=this;"listeners"==e?this.listeners=t:this._yo.addEventListener(e,(function(e){t(e,r)}),!1)}))}get width(){return this._yo.clientWidth}set width(e){this._yo.style.width=e}get height(){return this._yo.clientHeight}set height(e){this._yo.style.height=e}set textContent(e){this._yo.textContent=e}set color(e){this.yo.style.color=e,this._color=e}get color(){return this._color}set visibility(e){this.yo.style.visibility=e}set tip(e){this.agregarHijo({yo:"span",clases:["tooltiptext"],textContent:e})}}const Ze=`\n display:none;\n #jr-mask-msg{\n padding: 10px;\n }\n user-select: none;\n cursor: wait;\n background-color: #000000aa;\n color: ${({theme:e})=>e?.colorPrimary??"whilte"};\n flex-direction: column;\n justify-content: center;\n align-items: center;\n position: fixed;\n\n z-index: 20000;\n overflow: hidden;\n \n .cs-loader-inner {\n\t\ttransform: translateY(-30%);\n\t\twidth: calc(100% - 200xpx);\n \n\t}\n\n animation: opc .4s ;\n @keyframes opc {\n 0% {opacity: 0;background: transparent;visibility:hidden;}\n 20% {opacity: 1;background: #000000aa; visibility: visible;}\n }\n\n\t.cs-loader-inner label {\n\t\tfont-size: 20px;\n\t\topacity: 0;\n\t\tdisplay:inline-block;\n\t}\n\n @keyframes lol {\n 0% {\n opacity: 0;\n transform: translateX(-300px);\n }\n 33% {\n opacity: 1;\n transform: translateX(0px);\n }\n 66% {\n opacity: 1;\n transform: translateX(0px);\n }\n 100% {\n opacity: 0;\n transform: translateX(300px);\n }\n }\n\n @-webkit-keyframes lol {\n 0% {\n opacity: 0;\n -webkit-transform: translateX(-300px);\n }\n 33% {\n opacity: 1;\n -webkit-transform: translateX(0px);\n }\n 66% {\n opacity: 1;\n -webkit-transform: translateX(0px);\n }\n 100% {\n opacity: 0;\n -webkit-transform: translateX(300px);\n }\n }\n\n .cs-loader-inner label:nth-child(6) {\n -webkit-animation: lol 3s infinite ease-in-out;\n animation: lol 3s infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(5) {\n -webkit-animation: lol 3s 100ms infinite ease-in-out;\n animation: lol 3s 100ms infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(4) {\n -webkit-animation: lol 3s 200ms infinite ease-in-out;\n animation: lol 3s 200ms infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(3) {\n -webkit-animation: lol 3s 300ms infinite ease-in-out;\n animation: lol 3s 300ms infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(2) {\n -webkit-animation: lol 3s 400ms infinite ease-in-out;\n animation: lol 3s 400ms infinite ease-in-out;\n }\n\n .cs-loader-inner label:nth-child(1) {\n -webkit-animation: lol 3s 500ms infinite ease-in-out;\n animation: lol 3s 500ms infinite ease-in-out;\n }\n`,et=a.default.dialog`
|
|
2
2
|
${Ze}
|
|
3
3
|
&:open{
|
|
4
4
|
display:flex;
|
|
@@ -18,16 +18,16 @@
|
|
|
18
18
|
top: 0;
|
|
19
19
|
left: 0;
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
`,tt=a.default.div`
|
|
22
22
|
${Ze}
|
|
23
23
|
width:100%;
|
|
24
24
|
height:100%;
|
|
25
25
|
position: absolute;
|
|
26
26
|
top: 0;
|
|
27
27
|
left: 0;
|
|
28
|
-
`;class
|
|
28
|
+
`;class rt extends Qe{msg=[];#e=0;#t;get msgIndex(){return this.#e++}addMsg(e){const t=this.msgIndex;return this.msg.push({i:t,msg:!0!==e?e:null}),this.renderMsg(),()=>{this.removeMsg(t)}}removeMsg(e){this.msg=this.msg.filter((t=>t.i!=e)),this.renderMsg()}renderMsg(){this.msgDiv?.removeAllHijos(),this.msg.length?(this.msgDiv&&(this.msgDiv.html=this.msg[this.msg.length-1].msg),this.run()):this.stop()}run=()=>{this.yo.showModal?.()??this.display()};display(){this.yo.style.display="flex"}stop(){this.yo.close?.()??this.hide()}hide(){this.yo.style.display="none"}}function nt(e,t="jr-mask"){const r=document.getElementById(t);if(r){const n=document.getElementById(`${t}-msg`);return r.maskDiv||(r.maskDiv=new rt({yo:r,msgDiv:n?new Qe({yo:n}):null,listeners:{keydown(e){"Escape"===e.key&&e.preventDefault()}}})),r.maskDiv.addMsg(e)}}const ot=Je.create({authorization:`Bearer ${localStorage.getItem("accessToken")}`,timeout:12e4,maxBodyLength:104857600,maxContentLength:104857600});a.default.div`
|
|
29
29
|
border:2px solid red;
|
|
30
|
-
`;class
|
|
30
|
+
`;class st extends s.default.Component{#r=["get","post","put","patch","delete","download"];constructor(e){super(e),void 0===this.props.value&&void 0!==this.props.initValue&&void 0===this.props.onChange&&(this.state={value:e.initValue,rawValue:JSON.parse(JSON.stringify(e.initValue))})}componentDidMount(){this.#r.filter((e=>this[e]&&this.props[e]&&this.props[e].autoRun)).forEach((e=>{this[e]()}))}get(e={}){const t=Object.assign({method:"get",updateValue:!0},this.props.get,e);this.submit(t)}post(e={}){e=Object.assign({method:"post",updateValue:!1},this.props.post,e),this.submit(e)}put(e={}){e=Object.assign({method:"put",updateValue:!1},this.props.put,e),this.submit(e)}delete(e={}){e=Object.assign({method:"delete",updateValue:!1},this.props.delete,e),this.submit(e)}get from(){return void 0===this.props.value?"state":"props"}get isDirty(){return this.state?.isDirty}set isDirty(e){this.setState({isDirty:e})}get rawValue(){return this.state?.rawValue}setRawValue(e){this.setState({rawValue:null!=e?JSON.parse(JSON.stringify(e)):null})}reset(){this.setValue(this.rawValue,!0)}setValue(e,t=!1){this.props.onChange?this.props.onChange(e):this.setState({value:e}),t&&this.setRawValue(e),this.isDirty=!t}setRes(e,t,r){if(e&&r.updateValue){const e=r.formatValue?.bind(this)(t.data)??t.data;t.data=e,this.setValue(e,!0)}else r.updateValue&&this.setValue(null,!0)}#n(e,t){const r=e.shift();return 0==e.length?t?.[r]:null!=t?.[r]?this.#n(e,t[r]):void 0}getValue(e){if(e){const t=e.split(".");return this.#n(t,this[this.from]?.value)}return Ge(this[this.from]?.value,this,null,null)}getSubmitValue(){return this.getValue()}getAxiosParams({url:e,method:t,value:r,extraValue:n,sendValue:o,transformValue:s,...i}){const a=n?.bind?.(this)()??n;let l=r?.bind?.(this)({...this.getSubmitValue(),...a})??null==r?{...this.getSubmitValue(),...a}:{...r,...a};s&&(l=s.bind(this)(l));const c={authorization:`Bearer ${localStorage.getItem("accessToken")}`};let d={};const u={};return"get"==t?((null==o||o)&&(d.params=l),d.headers=c):"delete"==t?((null==o||o)&&(d.data=l),d.headers=c):(d=null==o||o?l:null,u.headers=c),{url:Ke(e,l),method:t,params1:d,params2:u,payload:l}}reload(){qe("reload 還沒有做 ")}submit(e){let t;e.mask&&(e.removeMaskFunction=nt(e.mask,this.maskId??"jr-mask")),(()=>{if(Array.isArray(e.url))return t=[],Promise.allSettled(e.url.map((r=>{const n="object"==typeof r?r:{url:r},o=Object.assign(e,n),{url:s,method:i,params1:a,params2:l,payload:c}=this.getAxiosParams(o);return t.push(c),ot[i](s,a,l)})));{const{url:r,method:n,params1:o,params2:s,payload:i}=this.getAxiosParams(e);return t=i,ot[n](r,o,s)}})().then((r=>{this.handleResponse(r,t,e)})).catch((r=>{this.handleResponse(r,t,e)})).finally((()=>{e.removeMaskFunction?.()}))}handleResponse=(e,t,r)=>{Array.isArray(e)?e=e.map(((e,r)=>(e.value?e.value.payload=t[r]:e.reason&&(e.reason.payload=t[r]),e))):e.payload=t;const n=(e=r?.response?.bind(this)(e,t)??e).status>=200&&e.status<=299;this.setRes(n,e,r),this.showMessage(n,n?r.successMessage:r.failedMessage),r.callback?.bind(this)(n,e,t)};showMessage(e,t){qe("success",e),qe("message",t)}renderer(){}render(){return this.renderer()}}const it=({tag:e,config:t,me:r,className:n})=>{if("function"==typeof t){let o;const i=function(e){o=e},a=t.bind(r)({setStyle:i});return s.default.createElement(e,{className:n,style:o},a)}if("string"==typeof t)return s.default.createElement(e,{className:n},t)},at=a.default.div`
|
|
31
31
|
position:relative;
|
|
32
32
|
display:flex;
|
|
33
33
|
flex:1;
|
|
@@ -69,7 +69,7 @@
|
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
}
|
|
72
|
-
`;class
|
|
72
|
+
`;class lt extends st{rid=Ye(99999,1e4);mask=this.props.mask?()=>{const{type:e,props:t}=this.props.mask;return this.maskId=`mask-${this.rid}`,s.default.createElement(e,{...t,id:this.maskId})}:null;renderer(){return s.default.createElement(at,{id:this.props.id,style:this.props.style,className:"jr-frame"},this.mask?.(),s.default.createElement(it,{tag:"div",config:this.props.start,me:this,className:"start"}),s.default.createElement("main",null,s.default.createElement(it,{tag:"header",config:this.props.top,me:this}),s.default.createElement("main",null,s.default.createElement(it,{tag:"div",config:this.props.left,me:this,className:"left"}),s.default.createElement("main",{className:"body"},this.renderMe?.()??this.props.children),s.default.createElement(it,{tag:"div",config:this.props.right,me:this,className:"right"})),s.default.createElement(it,{tag:"footer",config:this.props.bottom,me:this})),s.default.createElement(it,{tag:"div",config:this.props.end,me:this,className:"end"}))}}var ct;function dt(){return dt=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},dt.apply(null,arguments)}var ut=function(e){return i.createElement("svg",dt({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,viewBox:"0 0 24 24"},e),ct||(ct=i.createElement("path",{d:"M18 6 6 18M6 6l12 12"})))};function ht({icon:e,children:t,...r}){return s.default.createElement("button",r,e,t)}const pt=a.default.div`
|
|
73
73
|
overflow: hidden;
|
|
74
74
|
display: flex;
|
|
75
75
|
border-radius: var(--jr-window-radius) var(--jr-window-radius) 0 0;
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
}
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
`;class
|
|
136
|
+
`;class ft extends s.default.Component{pos1=0;pos2=0;pos3=0;pos4=0;x=0;y=0;remember=e=>{qe("remember");const{clientX:t,clientY:r}=e,{x:n,y:o,width:s,height:i}=this.props.windowRef.current.getBoundingClientRect();this.props.window.orgHeight=i,this.props.window.orgWidth=s,this.props.window.orgTop=o,this.props.window.orgLeft=n,this.props.window.orgXd=t-n,this.props.window.orgBodyOverflow=document.body.style.overflow};adjustScreen=e=>{qe("double click adjustScreen"),e.preventDefault();const{x:t,y:r,width:n,height:o}=this.props.windowRef.current.getBoundingClientRect();r>1-this.props.thick?(this.remember(e),this.fullScreen(e)):this.floatScreen(e)};floatScreen=e=>{this.props.windowRef.current,this.props.windowRef.current.style.transition="var(--transition-x-y), left .05s ease-in",this.props.windowRef.current.style.left=`${this.props.window.orgLeft}px`,this.props.windowRef.current.style.top=`${this.props.window.orgTop}px`,this.props.windowRef.current.style.width=`${this.props.window.orgWidth}px`,this.props.windowRef.current.style.height=`${this.props.window.orgHeight}px`,document.body.style.overflow=this.props.window.orgBodyOverflow};fullScreen=e=>{this.props.windowRef.current.style.transition="var(--transition-x-y), left .05s ease-in",this.props.windowRef.current.style.left=-this.props.thick+"px",this.props.windowRef.current.style.top=-this.props.thick+"px",this.props.windowRef.current.style.width=`calc(100vw + ${2*this.props.thick}px)`,this.props.windowRef.current.style.height=`calc(100vh + ${2*this.props.thick}px)`,setTimeout((()=>{document.body.style.overflow="hidden",this.props.windowRef.current.style.transition="unset"}),50)};stop=e=>{if(e.preventDefault(),this.moved){const{height:t}=this.props.titleBarRef.current.getBoundingClientRect(),{x:r,y:n,width:o,height:s}=this.props.windowRef.current.getBoundingClientRect();n<1-this.props.thick&&this.fullScreen(e),n>window.innerHeight-t&&(this.props.windowRef.current.style.top=window.innerHeight-t+"px"),r+o-this.props.thick<0&&(this.props.windowRef.current.style.left=0),r>window.innerWidth&&(this.props.windowRef.current.style.left=window.innerWidth-o+"px")}document.body.style.cursor="default",window.removeEventListener("mousemove",this.move),window.removeEventListener("mouseup",this.stop),window.removeEventListener("mousemove",this.preMove)};move=e=>{e.preventDefault(),this.moved=!0;const{clientX:t,clientY:r}=e,n=r<1?0:r;this.pos1=this.pos3-t,this.pos2=this.pos4-n,this.pos3=t,this.pos4=n;const o=this.props.windowRef.current;this.y=o.offsetTop-this.pos2,this.x=o.offsetLeft-this.pos1,this.y=this.y<-this.props.thick?-this.props.thick:this.y,o.style.transition="unset",o.style.top=`${this.y}px`,o.style.left=`${this.x}px`};preMove=e=>{const t=this.props.windowRef.current,{clientX:r,clientY:n,...o}=e,{x:s,y:i,width:a,height:l}=t.getBoundingClientRect();if(t.style.transition="left .05s ease-in, height .05s ease-in",i<=0){const e=r/(window.innerWidth-2*this.props.thick)*(this.props.window.orgWidth-32);t.style.left=r-e+"px",t.style.width=`${this.props.window.orgWidth}px`,t.style.height=`${this.props.window.orgHeight}px`}else this.remember(e);this.props.window.orgSHeight=null,document.body.style.cursor="grabbing",document.body.style.overflow=this.props.window.orgBodyOverflow,setTimeout((()=>{window.addEventListener("mousemove",this.move)}),50),window.removeEventListener("mousemove",this.preMove)};start(e){e.preventDefault(),this.moved=!1,this.pos3=e.clientX,this.pos4=e.clientY,this.props.windowRef.current.style.transition="var(--transition-x-y)",window.addEventListener("mousemove",this.preMove),window.addEventListener("mouseup",this.stop)}onDoubleClick(){qe("onDoubleClick")}render(){return s.default.createElement(pt,{ref:this.props.titleBarRef,draggable:"false",onMouseDown:e=>{this.start(e)},onDoubleClick:this.adjustScreen},s.default.createElement(it,{tag:"div",config:this.props.title??"",me:this.props.window,className:"title"}),s.default.createElement("nav",null,this.props.window.props.setOpen?s.default.createElement(ht,{icon:s.default.createElement(ut,null),className:"danger",onClick:e=>{e.stopPropagation(),null!=this.props.window.orgBodyOverflow&&(document.body.style.overflow=this.props.window.orgBodyOverflow),this.props.window.props.setOpen(!1)},onMouseDown:e=>{e.stopPropagation()}}):null))}}const mt=["n","e","s","w","nww","nnw","nne","nee","sse","see","sww","ssw"];class gt extends s.default.Component{render(){return mt.map(((e,t)=>s.default.createElement(yt,{direction:e,thick:this.props.thick,windowRef:this.props.windowRef,window:this.props.window,titleBarRef:this.props.titleBarRef,key:t})))}}const wt=a.default.div`
|
|
137
137
|
Xborder:1px solid ${({$direction:{color:e}})=>e};
|
|
138
138
|
Xbackground:${({$direction:{color:e}})=>e};
|
|
139
139
|
position: absolute;
|
|
@@ -151,7 +151,7 @@
|
|
|
151
151
|
-o-user-select: none;
|
|
152
152
|
user-select: none;
|
|
153
153
|
|
|
154
|
-
`;class
|
|
154
|
+
`;class yt extends s.default.Component{width="3px";borderWidth="px";borderLong=5;constructor(e){super(e),this.sliderRef=s.default.createRef()}directions={n:{top:0,color:"red",width:"100%",height:`${this.props.thick}px`,cursor:"n-resize",resize:e=>{this.resizeN(e)}},e:{color:"yellow",right:0,width:`${this.props.thick}px`,height:"100%",cursor:"e-resize",resize:e=>{this.resizeE(e)}},s:{color:"blue",bottom:0,width:"100%",height:`${this.props.thick}px`,cursor:"s-resize",resize:e=>{this.resizeS(e)}},w:{color:"green",left:0,width:`${this.props.thick}px`,height:"100%",cursor:"w-resize",resize:e=>{this.resizeW(e)}},nw:{top:0,left:0,color:"blue",width:`${this.borderLong}px`,height:`${this.borderLong}px`,cursor:"nw-resize",resize:e=>{this.resizeN(e),this.resizeW(e)}},nww:{top:0,left:0,color:"blue",width:`${this.props.thick+this.borderLong}px`,height:`${this.props.thick}px`,cursor:"nw-resize",resize:e=>{this.resizeN(e),this.resizeW(e)}},nnw:{top:0,left:0,color:"blue",width:`${this.props.thick}px`,height:`${this.props.thick+this.borderLong}px`,cursor:"nw-resize",resize:e=>{this.resizeN(e),this.resizeW(e)}},nne:{top:0,right:0,color:"green",width:`${this.props.thick+this.borderLong}px`,height:`${this.props.thick}px`,cursor:"ne-resize",resize:e=>{this.resizeN(e),this.resizeE(e)}},nee:{top:0,right:0,color:"green",width:`${this.props.thick}px`,height:`${this.props.thick+this.borderLong}px`,cursor:"ne-resize",resize:e=>{this.resizeN(e),this.resizeE(e)}},sse:{color:"red",right:0,bottom:0,width:`${this.props.thick+this.borderLong}px`,height:`${this.props.thick}px`,cursor:"se-resize",resize:e=>{this.resizeS(e),this.resizeE(e)}},see:{color:"red",right:0,bottom:0,width:`${this.props.thick}px`,height:`${this.props.thick+this.borderLong}px`,cursor:"se-resize",resize:e=>{this.resizeS(e),this.resizeE(e)}},ssw:{color:"yellow",bottom:0,left:0,width:`${this.props.thick+this.borderLong}px`,height:`${this.props.thick}px`,cursor:"sw-resize",resize:e=>{this.resizeS(e),this.resizeW(e)}},sww:{color:"yellow",bottom:0,left:0,width:`${this.props.thick}px`,height:`${this.props.thick+this.borderLong}px`,cursor:"sw-resize",resize:e=>{this.resizeS(e),this.resizeW(e)}}};resizeN=({window:e,cursorY:t,startY:r,startHeight:n,titleBarHeight:o})=>{let s=t-this.props.thick;s<0&&(s=0);let i=n+(r-s);i<o+2*this.props.thick&&(i=o+2*this.props.thick,s=r+n-o-2*this.props.thick),e.style.top=`${s}px`,e.style.height=`${i}px`};resizeE=({window:e,clientX:t,left:r,titleBarHeight:n})=>{let o=t-r-this.props.thick;o<n&&(o=n),e.style.width=`${o+2*this.props.thick}px`};resizeS=({window:e,clientY:t,top:r,titleBarHeight:n})=>{let o=t-r-this.props.thick;o<n&&(o=n),e.style.height=`${o+2*this.props.thick}px`};resizeW=({window:e,cursorX:t,startX:r,startWidth:n,titleBarHeight:o})=>{let s=t-this.props.thick;s<0&&(s=0);let i=n+(r-s);i<o+2*this.props.thick&&(i=o+2*this.props.thick,s=r+n-o-2*this.props.thick),e.style.left=`${s}px`,e.style.width=`${i}px`};stop=e=>{e.preventDefault();const{height:t}=this.props.titleBarRef.current.getBoundingClientRect(),{x:r,y:n,width:o,height:s}=this.props.windowRef.current.getBoundingClientRect();this.props.windowRef.current.style.transition="var(--transition-x-y)",0==n&&this.data.direction.indexOf("n")>-1&&(this.props.window.orgSHeight=s,this.props.windowRef.current.style.height=`${window.innerHeight}px`),n>window.innerHeight&&(this.props.windowRef.current.style.top=window.innerHeight-t+"px"),r+o-this.props.thick<0&&(this.props.windowRef.current.style.left=0),r>window.innerWidth&&(this.props.windowRef.current.style.left=window.innerWidth-o+"px"),document.body.style.cursor="default",window.removeEventListener("mousemove",this.move),window.removeEventListener("mousemove",this.preMove),window.removeEventListener("mouseup",this.stop)};move=e=>{e.preventDefault(),this.props.windowRef.current.style.transition="unset";const{clientX:t,clientY:r,x:n,y:o}=e,s=this.props.windowRef.current,{left:i,top:a}=s.getBoundingClientRect();let{x:l,width:c,y:d,height:u,titleBarHeight:h}=this.data;this.directions[this.props.direction].resize({window:s,titleBarHeight:h,clientX:t,cursorX:n,startX:l,startWidth:c,left:i,clientY:r,cursorY:o,startY:d,startHeight:u,top:a})};preMove=()=>{this.props.direction.indexOf("n")>-1&&(this.props.windowRef.current.style.height=`${this.props.window.orgSHeight}px`,this.data.height=this.props.window.orgSHeight,this.props.window.orgSHeight=null),window.removeEventListener("mousemove",this.preMove),setTimeout((()=>{window.addEventListener("mousemove",this.move)}),100)};start=(e,t)=>{e.preventDefault();const{height:r}=this.props.titleBarRef.current.getBoundingClientRect();let{x:n,y:o,width:s,height:i}=this.props.windowRef.current.getBoundingClientRect();this.props.window.orgHeight=i,this.props.direction.indexOf("s")>-1&&(this.props.window.orgSHeight=null),this.data={x:n,y:o,width:s,height:i,titleBarHeight:r,direction:t},document.body.style.cursor=this.directions[this.props.direction].cursor,this.props.window.orgSHeight?window.addEventListener("mousemove",this.preMove):window.addEventListener("mousemove",this.move),window.addEventListener("mouseup",this.stop)};render(){return s.default.createElement(wt,{$direction:this.directions[this.props.direction],$padding:this.props.padding,onMouseDown:e=>{this.start(e,this.props.direction)}})}}var bt={test:"Style-module_test__LrdEc",withMask:"Style-module_withMask__LPcai"};!function(e,t){void 0===t&&(t={});var r=t.insertAt;if(e&&"undefined"!=typeof document){var n=document.head||document.getElementsByTagName("head")[0],o=document.createElement("style");o.type="text/css","top"===r&&n.firstChild?n.insertBefore(o,n.firstChild):n.appendChild(o),o.styleSheet?o.styleSheet.cssText=e:o.appendChild(document.createTextNode(e))}}('.Style-module_test__LrdEc{border:1px solid red;color:red}.Style-module_withMask__LPcai{overflow:hidden!important;position:relative;user-select:none;&:after{a:#868686cc;background:#868686cc;border-radius:inherit;bottom:0;content:"";height:10000px;left:0;position:absolute;right:0;top:0;width:10000px}}mask{background:#868686cc;border-radius:inherit;bottom:0;height:10000px;left:0;position:absolute;right:0;top:0;width:10000px}');const xt=a.default.div`
|
|
155
155
|
z-index:1;
|
|
156
156
|
|
|
157
157
|
--jr-window-radius:3px;
|
|
@@ -188,7 +188,7 @@ z-index:1;
|
|
|
188
188
|
display: flex;
|
|
189
189
|
}
|
|
190
190
|
}
|
|
191
|
-
`;class
|
|
191
|
+
`;class vt extends lt{x=0;y=0;width=300;height=300;padding=1;thick=5;constructor(e){super(e),this.ref=s.default.createRef(),this.titleBarRef=s.default.createRef(),this.init()}addMaskToTarget=e=>{this.mask=document.createElement("div"),this.mask.style.background="#868686cc",this.mask.style.position="absolute",this.mask.style.top="0",this.mask.style.left="0",this.mask.style.right="0",this.mask.style.bottom="0",this.mask.style.borderRadius="inherit",this.mask.style.height="10000px",this.mask.style.width="10000px",e.appendChild(this.mask),qe("style.mask",bt.mask),qe("addMask+++++++++++++++++++++++++++")};removeMaskFromTarget=()=>{qe("removeMask-----------------------"),this.mask.remove()};backdropOn(e){const t="object"==typeof this.props.backdrop?this.props.backdrop:"string"==typeof this.props.backdrop?document.getElementById(this.props.backdrop):document.body;t?.classList[e?"add":"remove"]("withMask")}componentDidMount(){super.componentDidMount(),this.props.backdrop&&this.props.open&&this.backdropOn(this.props.open),this.props.open&&this.open()}open(){this.props.onOpen?.bind(this)()}close(){this.props.onClose?.bind(this)()}componentDidUpdate(e,t,r){!0===this.props.popup&&(this.props.open&&!1===e.open?this.open():!1===this.props.open&&e.open&&this.close(),this.props.backdrop&&this.props.open!=e.open&&this.backdropOn(this.props.open))}init(){this.height=window.innerHeight>=(this.props.height??this.height)?this.props.height??this.height:window.innerHeight,this.width=window.innerWidth>=(this.props.width??this.width)?this.props.width??this.width:window.innerWidth,this.x=this.props.x??(window.innerWidth-(this.width??300))/2,this.y=this.props.y??(window.innerHeight-(this.height??300))/2}renderer(){return!0===this.props.popup?this.props.open?s.default.createElement(xt,{rule:"dialog",ref:this.ref,className:`jr-window ${this.props.className??""}`,$x:this.x,$y:this.y,$width:this.width,$height:this.height,$thick:this.thick},s.default.createElement("main",null,s.default.createElement(ft,{titleBarRef:this.titleBarRef,windowRef:this.ref,window:this,title:this.props.title,thick:this.thick}),s.default.createElement("main",null,super.renderer())),s.default.createElement(gt,{thick:this.thick,windowRef:this.ref,window:this,titleBarRef:this.titleBarRef})):"":super.renderer()}}const Et=a.default.div`
|
|
192
192
|
position: absolute;
|
|
193
193
|
top: 0;
|
|
194
194
|
right: 0;
|
|
@@ -202,12 +202,12 @@ z-index:1;
|
|
|
202
202
|
cursor: col-resize;
|
|
203
203
|
border-right:1px dashed gray;
|
|
204
204
|
}
|
|
205
|
-
`;class
|
|
205
|
+
`;class kt extends s.default.Component{constructor(){super(),this.sliderRef=s.default.createRef()}stop=e=>{this.sliderRef.current.classList.remove("resizing"),document.body.style.cursor="default",window.removeEventListener("mousemove",this.move),window.removeEventListener("mouseup",this.stop)};move=({clientX:e})=>{const{th:t,selectedCols:r,widthRates:n}=this.data,{left:o}=t.getBoundingClientRect(),s=o+10,i=(e>=s?e:s)-o;r.forEach(((e,t)=>{const r=Math.round(i/100*n[t]);e.style.width=r+"px"}))};start(e,t){const r=[...this.props.table.colGroupRef.current.children].slice(t.columnNo,t.columnNo+(t.colSpan??1)),n=r.reduce(((e,{offsetWidth:t})=>e+t),0),o=r.map((({offsetWidth:e})=>e/n*100));this.data={selectedCols:r,th:e.current,widthRates:o},this.sliderRef.current.classList.add("resizing"),document.body.style.cursor="col-resize",window.addEventListener("mousemove",this.move),window.addEventListener("mouseup",this.stop)}render(){const e=this.props.column;return s.default.createElement(Et,{ref:this.sliderRef,onMouseDown:t=>{this.start(this.props.thRef,e)}})}}const St=({leafColumns:e,colGroupRef:t})=>s.default.createElement("colgroup",{ref:t},e?.map(((e,t)=>{const{width:r,...n}=e,o={width:r};return s.default.createElement("col",{style:o,key:t})}))),Rt=({deep:e,rowColumn:t,rowIndex:r,table:n})=>t?.map(((t,o)=>{const i=s.default.createRef();return s.default.createElement("th",{key:o,ref:i,colSpan:t.colSpan,rowSpan:t.rowSpan??(t.isLeaf&&e>r?e-r+1:null)},Ge(t.label,n),(void 0===n.props.resizableColumns||n.props.resizableColumns)&&s.default.createElement(kt,{table:n,thRef:i,column:t}))})),Ot=({columns:e,trClassName:t,table:r})=>{const n=Array.isArray(e?.[0])?e:[e];return n?.map(((e,o)=>s.default.createElement("tr",{className:t,key:o},s.default.createElement(Rt,{deep:n.length-1,rowColumn:e,rowIndex:o,table:r}))))},Ct=({columns:e,leafColumns:t,table:r})=>s.default.createElement(s.default.Fragment,null,s.default.createElement("thead",null,s.default.createElement(Ot,{columns:e,table:r})),s.default.createElement(St,{leafColumns:t,colGroupRef:r.colGroupRef})),jt=({table:e,groupData:t,groupIndex:r,deep:n,columns:o,rowIndex:i})=>o?.map(((t,r)=>{let n=Ge(t.style,e,{},{});const o=(({type:e,typeStyle:t,render:r,...n},o,i)=>{if(e){const r="function"==typeof t?t?.bind(o)():t;return s.default.createElement(e,{style:r})}return r?r.bind(o)():i})(t,e,t.label);return s.default.createElement("th",{style:n,colSpan:t.colSpan,rowSpan:t.rowSpan},o)})),Nt=({table:e,columns:t})=>{const r=t?.map(((t,r)=>s.default.createElement("tr",{key:r},s.default.createElement(jt,{columns:t,table:e}))));return s.default.createElement(s.default.Fragment,null,s.default.createElement("tfoot",null,r))};function $t(){return $t=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)({}).hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e},$t.apply(null,arguments)}a.default.tbody`
|
|
206
206
|
th{
|
|
207
207
|
height:4px;
|
|
208
208
|
background:#c6c6c6;
|
|
209
209
|
}
|
|
210
|
-
`;const
|
|
210
|
+
`;const At=({table:e,groupData:t,groupIndex:r,deep:n,rowColumn:o,rowIndex:i})=>o?.map((({style:o,align:a,type:l,render:c,...d},u)=>{const h=Ge(o,e,{},{});let p;return p=l?"type":c?c?.bind(e)({groupData:t,groupIndex:r,ths:111}):d.label,s.default.createElement("th",{key:u,style:{textAlign:a,...h},colSpan:d.colSpan,rowSpan:d.isLeaf&&n>i?n-i+1:null},p)})),Tt=({table:e,columns:t,trClassName:r,groupData:n,tbodyIndex:o})=>{const i=Array.isArray(t?.[0])?t:[t];return i?.map(((t,a)=>s.default.createElement("tr",{className:r,key:a},s.default.createElement(At,{table:e,groupData:n,groupIndex:o,deep:i.length-1,rowColumn:t,rowIndex:a}))))};a.default.tr`
|
|
211
211
|
z-index: 1;
|
|
212
212
|
XXposition: sticky;
|
|
213
213
|
XXtop: 50px;
|
|
@@ -215,12 +215,12 @@ z-index:1;
|
|
|
215
215
|
text-align: left;
|
|
216
216
|
border:1px solid #222222;
|
|
217
217
|
}
|
|
218
|
-
`;const
|
|
218
|
+
`;const Vt=e=>s.default.createElement(Tt,$t({trClassName:"jr-group-header"},e));a.default.tr`
|
|
219
219
|
th{
|
|
220
220
|
border:1px solid #222222;
|
|
221
221
|
text-align: left;
|
|
222
222
|
}
|
|
223
|
-
`;const
|
|
223
|
+
`;const _t=e=>s.default.createElement(Tt,$t({trClassName:"jr-group-footer"},e)),Lt=({column:e,record:t,tbodyIndex:r,trIndex:n,tdIndex:o,table:i})=>{let a;const{style:l,align:c,vAlign:d="baseline",type:u,typeStyle:h,render:p,setValue:f,getValue:m,onChange:g,funcProps:w,...y}=e,b=e=>{f(t,e?.target?.value??e),i.setValue(i.getValue())},x=m(t);let v=p?{}:Ge(l,i,{value:x,record:t},{});const E=e=>{v=e};if(E.bind(i),p?.bind(i),u){const e=Ge(h,i,{record:t},{});a=s.default.createElement(u,{onChange:g?e=>{g?.bind(i)(e,{value:x,onChange:b,me:a})}:b,value:x,style:e,render:p,...y,...w?.bind(i)({value:x})})}else a=p?p({index:n,groupIndex:r,value:x,record:t,onChange:b,setStyle:E}):x;return s.default.createElement("td",{colSpan:v.colSpan,rowSpan:v.rowSpan,style:{textAlign:c,verticalAlign:d,...v},key:o},a)},Bt=({leafColumns:e,record:t,table:r,tbodyIndex:n,trIndex:o})=>e?.map(((e,i)=>s.default.createElement(Lt,{column:e,key:i,record:t,table:r,tbodyIndex:n,trIndex:o,tdIndex:i}))),Dt=({groupData:e,groupHeader:t,leafColumns:r,groupFooter:n,table:o,tbodyIndex:i})=>{const a={table:o,tbodyIndex:i};return s.default.createElement(s.default.Fragment,null,s.default.createElement("tbody",{key:`tbody${i}`},e?.length>0&&s.default.createElement(Vt,$t({groupData:e,columns:t},a)),e?.map?.(((e,t)=>{const n=o.props.onRowClick?.bind(o);return s.default.createElement("tr",{key:t,onClick:()=>{n?.({record:e,index:t,groupIndex:i})}},s.default.createElement(Bt,$t({record:e,trIndex:t},a,{leafColumns:r})))})),e?.length>0&&s.default.createElement(_t,$t({groupData:e,columns:n},a))))},Pt=({groupHeader:e,leafColumns:t,groupFooter:r,dataSource:n,table:o})=>{const i=Array.isArray(n?.[0])?n:[n];return i?.map(((n,i,a)=>s.default.createElement(Dt,{key:`tbody${i}`,table:o,groupData:n,tbodyIndex:i,groupHeader:e,leafColumns:t,groupFooter:r})))},zt=a.default.div`
|
|
224
224
|
--column-bd-color:#cccccc;
|
|
225
225
|
--column-b-color:#ffffff;
|
|
226
226
|
--column-b-hover-color:#eeeeee;
|
|
@@ -393,7 +393,7 @@ z-index:1;
|
|
|
393
393
|
|
|
394
394
|
}
|
|
395
395
|
|
|
396
|
-
`;const
|
|
396
|
+
`;const Ft=a.default.main`
|
|
397
397
|
|
|
398
398
|
|
|
399
399
|
--column-bd-color:#cccccc;
|
|
@@ -419,23 +419,23 @@ z-index:1;
|
|
|
419
419
|
}
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
|
-
`;function
|
|
422
|
+
`;function Mt(e){return null!=e&&""!=e&&""!=e.trim?.()||"This is required"}function Ut(e,t){return null==e||("string"==typeof e&&e.length>t.max||Array.isArray(e)&&e.length>t.max?`Length can not more than ${t.max}`:!("number"==typeof e&&e>t.max)||`Length can not more than ${t.max}`)}function It(e,t){return"string"==typeof e&&t.min>e.length||Array.isArray(e)&&t.min>e.length?`Length can not less than ${t.min}`:!("number"==typeof e&&t.min>e)||`Can not less than ${t.min}`}function Ht(e,t,r,n){if(n.length){const o=n.shift();"object"!=typeof r[o]&&(r[o]={}),Ht(e,t,r[o],n)}else r[e]=t}a.default.div`
|
|
423
423
|
overflow: auto;
|
|
424
424
|
flex:1;
|
|
425
|
-
`;const
|
|
425
|
+
`;const Xt=a.default.div`
|
|
426
426
|
display: grid;
|
|
427
427
|
gap:10px;
|
|
428
428
|
grid: ${({grid:e,cols:t,children:r})=>e||`auto / ${Array(t??1).fill().map((()=>"1fr")).join(" ")}`};
|
|
429
429
|
|
|
430
430
|
gap: ${({$gap:e})=>e};
|
|
431
431
|
`;a.default.div`
|
|
432
|
-
`;const
|
|
432
|
+
`;const Wt=a.default.div`
|
|
433
433
|
flex:1;
|
|
434
434
|
display: grid;
|
|
435
435
|
|
|
436
436
|
|
|
437
437
|
${({$layout:e,$labelWidth:t,$hasLabel:r,$valueWidth:n})=>"v"==e?"grid: auto 1fr / 1fr;":`grid: 1fr / ${r?t:""} ${n};`}
|
|
438
|
-
`,
|
|
438
|
+
`,Jt=a.default.div`
|
|
439
439
|
min-height:24px;
|
|
440
440
|
${({$layout:e})=>"v"==e?"text-align: start;":"text-align: end;\n padding-right:10px;\n "}
|
|
441
441
|
|
|
@@ -450,7 +450,7 @@ z-index:1;
|
|
|
450
450
|
|
|
451
451
|
text-align: start;
|
|
452
452
|
${({$validateValue:e})=>{if(null!=e)return"\n > * {\n xborder:1px solid red;\n }\n "}}
|
|
453
|
-
`,
|
|
453
|
+
`,Kt=a.default.div`
|
|
454
454
|
&:has(.left:empty):has(.right:empty)
|
|
455
455
|
{
|
|
456
456
|
border:1px solid blue;
|
|
@@ -512,9 +512,9 @@ z-index:1;
|
|
|
512
512
|
border: 1px solid red;
|
|
513
513
|
}
|
|
514
514
|
}
|
|
515
|
-
`;const
|
|
515
|
+
`;const Gt=(e,t)=>{const r=t.shift(t);return t.length?Gt(e?.[r],t):e},Yt=(e,t,r)=>{const n=t.shift(t);t?.length?("object"!=typeof e[n]&&(e[n]={}),Yt(e[n],t,r)):e[n]=r};const Qt=a.default.div`
|
|
516
516
|
|
|
517
|
-
`;const
|
|
517
|
+
`;const Zt=a.default(class extends vt{renderMe(){return this.getValue()?.message}})`
|
|
518
518
|
.body{
|
|
519
519
|
display: flex;
|
|
520
520
|
align-items: center;
|
|
@@ -526,13 +526,13 @@ z-index:1;
|
|
|
526
526
|
justify-content: end;
|
|
527
527
|
padding: 8px;
|
|
528
528
|
}
|
|
529
|
-
`;function
|
|
529
|
+
`;function er({title:t,message:r,container:n,...o}){const[i,a]=e.useState(!0);return s.default.createElement(Zt,$t({initValue:{message:r},width:440,height:180,maskOn:"play"},o,{open:i,setOpen:a,popup:!0,title:t??"",onClose:()=>{n.remove()},bottom:function(){return s.default.createElement("button",{onClick:()=>{a(!1)}},"OK")}}),r)}const tr=a.default.div`
|
|
530
530
|
display:flex;
|
|
531
531
|
input:focus{
|
|
532
532
|
outline: none;
|
|
533
533
|
}
|
|
534
|
-
`;class
|
|
535
|
-
`,
|
|
534
|
+
`;class rr extends s.default.Component{setValue(e){this.props?.onChange?.(e)}render(){return s.default.createElement(tr,null,this.input())}}class nr extends st{get optionsFrom(){return void 0===this.props.options?"state":"props"}setOptions(e){this.props.setOptions?this.props.setOptions(e):this.setState({options:e})}getOptions(){return this[this.optionsFrom]?.options}setRes(e,t,r){if(e){const e=r.formatValue?.bind(this)(t.data)??t.data;t.data=e,this.setOptions(e)}}}const or=a.default.option`
|
|
535
|
+
`,sr=a.default.select`
|
|
536
536
|
${({size:e,multiple:t})=>""+(1==e||null==e&&1!=t?"height:24px;":"")}
|
|
537
537
|
width: 100%;
|
|
538
538
|
min-height: 24px;
|
|
@@ -544,7 +544,7 @@ z-index:1;
|
|
|
544
544
|
display: flex;
|
|
545
545
|
align-items: center;
|
|
546
546
|
}
|
|
547
|
-
`;const
|
|
547
|
+
`;const ir=a.default.div`
|
|
548
548
|
>label{
|
|
549
549
|
white-space: nowrap;
|
|
550
550
|
display: inline-flex;
|
|
@@ -552,7 +552,7 @@ z-index:1;
|
|
|
552
552
|
height: 24px;
|
|
553
553
|
padding-right: 12px;
|
|
554
554
|
}
|
|
555
|
-
`;const
|
|
555
|
+
`;const ar=a.default.input`
|
|
556
556
|
min-height: 24px;
|
|
557
557
|
width: 100%;
|
|
558
|
-
`;exports.JRAlert=function(e){const t=document.body,n="jr-alert-div";let o=document.getElementById(n);null==o&&(o=document.createElement("div"),o.id=n,t.appendChild(o));const i=document.createElement("div");o.appendChild(i),r.createRoot(i).render(s.default.createElement(Zt,Nt({},e,{container:i})))},exports.JRButton=ut,exports.JRCheckbox=class extends rr{renderer(){const{valueName:e="value",labelName:t="label"}=this.props,r=Array.isArray(this.getOptions()??[]),n=r?this.getOptions():[this.getOptions()],o=r?[...this.getValue()??[]]:this.getValue(),i=r?e=>o.indexOf(e)>-1:e=>e==o;return s.default.createElement(sr,{className:"jr-checkbox"},n?.map(((n,a)=>{const l=n[e];return s.default.createElement("label",{key:a},s.default.createElement("input",{type:"checkbox",multiple:r,value:l,checked:i(l),onChange:r?e=>{e.target.checked?o.push(l):o.splice(o.indexOf(l),1),this.setValue(o.length?o:null)}:e=>{this.setValue(e.target.checked?l:null)}}),n[t])})))}},exports.JRFields=class extends xt{UNSAFE_componentWillMount(){this.#o()}reset(){this.clearTestValue(),super.reset()}setValue(e,t){super.setValue(e,t),t&&this.clearTestValue()}#o(){"state"==this.validateValueFrom&&this.setState({validatorValue:{}})}get testValueFrom(){return void 0===this.props.testValue?"state":"props"}clearTestValue(){this.setTestValue({})}setTestValue(e,t){if("state"==this.testValueFrom)if(t){this.getTestValue()[t]=e,this.setState({testValue:{...this.getTestValue(),...e}})}else this.setState({testValue:e})}getTestValue(e){return e?this.state?.testValue?.[e]:this.state?.testValue}#s(e,t,r,n){const{name:o,validators:s,columns:i,type:a}=e,l=t.join("."),c=s?[...s]:[];if(e.required&&c.push(Ft),e.max&&c.push(Mt),e.min&&c.push(Ut),c.length){r[l]={isValid:null,msg:[]};const t=[];for(let r=0;r<c.length;r++){const o=c[r].bind(this)(n,e);if(o?.then)t.push(o);else if("string"==typeof o){t.push(Promise.reject(o));break}}return Promise.all(t).then((e=>(r[l].isValid=!0,Promise.resolve(e)))).catch((e=>(r[l].msg.push(e),r[l].isValid=!1,Promise.reject(e))))}}#i(e,t,r,n,o){return e?.reduce(((e,t)=>{const{name:s,validators:i,columns:a,type:l}=t,c=s?[...r,s]:r;c.join(".");{const r=this.#s(t,c,n,s?o?.[s]:o);r&&e.push(r)}return a&&null==l&&this.#i(a,e,c,n,s?o?.[s]:o),e}),t)}validate(e){console.clear();const t=[],r=this.getTestValue()??{};return this.#i(this.getColumns(),t,[],r,void 0!==e?e:this.getValue()),Promise.all(t).then((e=>(this.setTestValue(r),Promise.resolve()))).catch((e=>(this.setTestValue(r),Promise.reject())))}get columnsFrom(){return void 0!==this.props.initColumns?"state":"props"}getColumns(){return this[this.columnsFrom]?.columns}createColumn(e,{type:t,name:r,colSpan:n,rowSpan:o,style:i,typeStyle:a,columnStyle:l,...c},d,u,h,p){const f=r?e?.[r]:e,m=c.gap??this.props.gap,g=c.label,w=Ge(i,this,{},{}),y=Ge(l,this,{},{});let b;n&&(w.gridColumn=`span ${n}`),o&&(w.gridRow=`span ${o}`);const x=t=>{const n=t?.target?.value??t;try{e[r]=n,this.setValue({...this.getValue()})}catch(e){const t=this.getValue()??{};It(r,n,t,[...u]),this.setValue(t)}const o=this.getTestValue()??{};this.#s(c,h,o,n)?.then((()=>{this.setTestValue(o)})).catch((()=>{this.setTestValue(o)}))},v=[...u];if(void 0!==r&&v.push(r),t){const r=Ge(a,this,null);b=s.default.createElement(qt,{className:"jr-column-value",style:{gridColumn:null==g?"span 2":null,...y}},s.default.createElement(t,{value:f,onChange:x,record:e,style:{width:"100%",...r},...c}))}else c.columns?b=s.default.createElement(Ht,{cols:c.cols,className:"jr-grid",$gap:m,style:y},this.createColumns(f,c.columns,v,h,c.labelProps??this.props.labelProps)):(r||c.render)&&(b=s.default.createElement(qt,{className:"jr-column-value",style:{gridColumn:null==g?"span 2":null,padding:c.render?"4px 0":null}},c.render?c.render.bind(this)({onChange:x,value:f,record:this.getValue()}):"object"==typeof f?JSON.stringify(f):f));const E=p?.layout,k=void 0===p?.colon?":":p.colon,S=c.labelProps?.style??this.props.labelProps?.style??{};return s.default.createElement(Xt,{$layout:E,$hasLabel:null!=g,key:`f${d}`,style:w,className:"jr-column",$labelWidth:c.labelProps?.width??this.props.labelProps?.width??"120px",$valueWidth:c.valueProps?.width??this.props.valueProps?.width??"1fr"},null!=g&&s.default.createElement(Wt,{style:S,$required:c.required,className:"label",$layout:E,$colon:k},g),b,s.default.createElement(Jt,{$layout:E},s.default.createElement("div",{className:"left"},this.getTestValue(v.join("."))?.msg?.map((e=>e))),s.default.createElement("div",{className:"right"})))}createColumns(e,t,r,n,o){return t?.map(((t,s)=>this.createColumn(e,t,s,r,t.name?[...n,t.name]:n,o)))}renderMe(){return s.default.createElement(zt,{className:"jr-fields",style:this.props.typeStyle},s.default.createElement(Ht,{cols:this.props.cols,style:this.props.gridStyle,className:"jr-grid",$gap:this.props.gap},this.createColumns(this.props.dataSourceName?this.getValue()?.[this.props.dataSourceName]:this.getValue(),this.props.columns,this.props.dataSourceName?[this.props.dataSourceName]:[],this.props.dataSourceName?[this.props.dataSourceName]:[],this.props.labelProps)))}},exports.JRFrame=at,exports.JRMask=function({id:e="jr-mask"}){return s.default.createElement(et,{id:e,className:"jr-mask"},s.default.createElement("div",{id:`${e}-msg`}),s.default.createElement("div",{className:"cs-loader-inner"},s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●")))},exports.JRRadio=class extends rr{renderer(){const{valueName:e="value",labelName:t="label",onChange:r,...n}=this.props,o=this.getOptions();return s.default.createElement(sr,{className:"jr-radio"},o?.map(((r,n)=>{const o=r[e];return s.default.createElement("label",{key:n},s.default.createElement("input",{type:"radio",name:"radio",checked:this.getValue()==o,onClick:e=>{this.getValue()==o?(this.setValue(null),e.target.checked=!1):this.setValue(o)}}),r[t])})))}},exports.JRSelect=class extends rr{renderer(){const{showBlank:e,valueName:t="value",labelName:r="label",multiple:n,size:o}=this.props,i=[...this.getOptions()??[]];return 1!=n&&0!=e&&i.unshift({[t]:"",[r]:""}),s.default.createElement(or,{value:this.getValue()??(n?[]:""),className:"jr-select",onChange:e=>{if(n){const r=[...e.target.selectedOptions].map((e=>e.index));this.setValue(r.length?r.map((e=>i[e][t])):null)}else{const r=e.target.selectedOptions[0].index;this.setValue(r?i[r][t]:null)}},size:o,multiple:n},i.map(((e,o)=>{const i={value:e[t],key:o};return(n&&this.getValue()?.indexOf(e[t])>-1||this.getValue()==e[t])&&(i.className="selected"),s.default.createElement(nr,i,e[r])})))}},exports.JRSubmit=ot,exports.JRTable=class extends xt{constructor(e){super(e),this.colGroupRef=s.default.createRef()}UNSAFE_componentWillMount(){this.setColumns(this.props.columns??[])}checkableColumn(e){return{render:({value:e,onChange:t})=>s.default.createElement("checkbox",{checked:e,onChange:e=>{t(e.target.checked)}}),align:"center",name:"checked",...e}}deletableColumn({name:e="deletable",sendValue:t,sendName:r,valueName:n,...o}){return{render:({value:e,onChange:t})=>s.default.createElement("checkbox",{checked:e,onChange:e=>{t(e.target.checked)}}),align:"center",name:e,label(){return s.default.createElement("button",{onClick:()=>{const n=this.props.delete.value??this.getDataSource()?.filter((t=>t[e])).map((e=>t?e[t]:e)),s=this.props.delete.callback??function(e,t,r){this.reload()};this.delete({value:r?{[r]:n}:n,callback:s,...o})}},"刪除")},...o}}initColumn(e,t,r,n,o,s){const i=void 0===e.type&&e?.columns&&e?.columns.length,a=e.name?[...o,e.name]:o;if(i){null!==e.label&&r[t].push(e);const o=this.initColumns(e.columns,t+(null!==e.label?1:0)+(null!=e.rowSpan?e.rowSpan-1:0),r,n,a,s);return e.colSpan=o.colSpan,e.columnNo=s,{colSpan:e.colSpan}}return e.columnNo=s,r[t].push({...e,isLeaf:!0}),n.push(e),e.names=a,a?.length>1?(e.setValue=function(t,r){try{Kt(t,[...a])[e.name]=r}catch{Gt(t,[...a],r)}},e.getValue=function(e){return a.reduce(((e,t)=>e?.[t]),e)}):(e.setValue=function(t,r){t[e.name]=r},e.getValue=function(t){return t[e.name]}),{colSpan:1}}initColumns(e,t,r,n,o,s){for(let e=r.length;e<=t;e++)r[e]||r.push([]);let i=s;const a=e?.reduce(((e,s)=>{const a=this.initColumn(s,t,r,n,o,i);return e.colSpan+=a.colSpan,i+=a.colSpan,e}),{colSpan:0});return a}setColumns([...e]){this.props.checkable&&e.unshift(this.checkableColumn(this.props.checkable)),this.props.deletable&&e.unshift(this.deletableColumn(this.props.deletable));const t=[],r=[];this.initColumns(e,0,t,r,[],0),this.setState({columns:t,leafColumns:r})}setDataSource(e){}getDataSource(){return this.props.dataSourceName?this.getValue()?.[this.props.dataSourceName]:this.getValue()}add(e,t=this.getDataSource()?.length??0,r){this.getDataSource()?(void 0===r?this.getDataSource().splice(t,0,e):this.getDataSource()[r].splice(t,0,e),this.setValue(this.getValue())):this.setValue(this.props.dataSourceName?{[this.props.dataSourceName]:[e]}:[e])}noData(){const e=this.getDataSource();return null==e||0==e.length}renderMe(){return s.default.createElement(Pt,{className:"jr-table "+(this.props.onRowClick?"row-highlightable":"")},s.default.createElement("table",{className:"jr-table-table"},s.default.createElement(Dt,{table:this,leafColumns:this.state.leafColumns,groupHeader:this.props.groupHeader,groupFooter:this.props.groupFooter,dataSource:this.getDataSource(),onRowClick:this.props.onRowClick}),s.default.createElement(jt,{columns:this.props.footColumns,table:this}),s.default.createElement(Ot,{columns:this.state.columns,leafColumns:this.state.leafColumns,table:this})),this.noData()&&s.default.createElement("div",{className:"empty"}))}},exports.JRTestReact=class extends ot{renderer(){return s.default.createElement(Yt,{style:this.props.style,className:`${this.props.className} jr-frame`})}renderMe(){return s.default.createElement("div",{style:{flex:1}},"Render me")}},exports.JRText=class extends tr{input(){return s.default.createElement(ir,{value:this.props.value??"",onChange:e=>{this.setValue(e.target.value)}})}},exports.JRWindow=xt,exports.random=Ye,exports.showMask=rt;
|
|
558
|
+
`;exports.JRAlert=function(e){const t=document.body,n="jr-alert-div";let o=document.getElementById(n);null==o&&(o=document.createElement("div"),o.id=n,t.appendChild(o));const i=document.createElement("div");o.appendChild(i),r.createRoot(i).render(s.default.createElement(er,$t({},e,{container:i})))},exports.JRButton=ht,exports.JRCheckbox=class extends nr{renderer(){const{valueName:e="value",labelName:t="label"}=this.props,r=Array.isArray(this.getOptions()??[]),n=r?this.getOptions():[this.getOptions()],o=r?[...this.getValue()??[]]:this.getValue(),i=r?e=>o.indexOf(e)>-1:e=>e==o;return s.default.createElement(ir,{className:"jr-checkbox"},n?.map(((n,a)=>{const l=n[e];return s.default.createElement("label",{key:a},s.default.createElement("input",{type:"checkbox",multiple:r,value:l,checked:i(l),onChange:r?e=>{e.target.checked?o.push(l):o.splice(o.indexOf(l),1),this.setValue(o.length?o:null)}:e=>{this.setValue(e.target.checked?l:null)}}),n[t])})))}},exports.JRDivMask=function({id:e="jr-mask"}){return s.default.createElement(tt,{id:e},s.default.createElement("div",{id:`${e}-msg`},"MSG"),s.default.createElement("div",{className:"cs-loader-inner"},s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●")))},exports.JRFields=class extends vt{UNSAFE_componentWillMount(){this.#o()}reset(){this.clearTestValue(),super.reset()}setValue(e,t){super.setValue(e,t),t&&this.clearTestValue()}#o(){"state"==this.validateValueFrom&&this.setState({validatorValue:{}})}get testValueFrom(){return void 0===this.props.testValue?"state":"props"}clearTestValue(){this.setTestValue({})}setTestValue(e,t){if("state"==this.testValueFrom)if(t){this.getTestValue()[t]=e,this.setState({testValue:{...this.getTestValue(),...e}})}else this.setState({testValue:e})}getTestValue(e){return e?this.state?.testValue?.[e]:this.state?.testValue}#s(e,t,r,n){const{name:o,validators:s,columns:i,type:a}=e,l=t.join("."),c=s?[...s]:[];if(e.required&&c.push(Mt),e.max&&c.push(Ut),e.min&&c.push(It),c.length){r[l]={isValid:null,msg:[]};const t=[];for(let r=0;r<c.length;r++){const o=c[r].bind(this)(n,e);if(o?.then)t.push(o);else if("string"==typeof o){t.push(Promise.reject(o));break}}return Promise.all(t).then((e=>(r[l].isValid=!0,Promise.resolve(e)))).catch((e=>(r[l].msg.push(e),r[l].isValid=!1,Promise.reject(e))))}}#i(e,t,r,n,o){return e?.reduce(((e,t)=>{const{name:s,validators:i,columns:a,type:l}=t,c=s?[...r,s]:r;c.join(".");{const r=this.#s(t,c,n,s?o?.[s]:o);r&&e.push(r)}return a&&null==l&&this.#i(a,e,c,n,s?o?.[s]:o),e}),t)}validate(e){console.clear();const t=[],r=this.getTestValue()??{};return this.#i(this.getColumns(),t,[],r,void 0!==e?e:this.getValue()),Promise.all(t).then((e=>(this.setTestValue(r),Promise.resolve()))).catch((e=>(this.setTestValue(r),Promise.reject())))}get columnsFrom(){return void 0!==this.props.initColumns?"state":"props"}getColumns(){return this[this.columnsFrom]?.columns}createColumn(e,{type:t,name:r,colSpan:n,rowSpan:o,style:i,typeStyle:a,columnStyle:l,...c},d,u,h,p){const f=r?e?.[r]:e,m=c.gap??this.props.gap,g=c.label,w=Ge(i,this,{},{}),y=Ge(l,this,{},{});let b;n&&(w.gridColumn=`span ${n}`),o&&(w.gridRow=`span ${o}`);const x=t=>{const n=t?.target?.value??t;try{e[r]=n,this.setValue({...this.getValue()})}catch(e){const t=this.getValue()??{};Ht(r,n,t,[...u]),this.setValue(t)}const o=this.getTestValue()??{};this.#s(c,h,o,n)?.then((()=>{this.setTestValue(o)})).catch((()=>{this.setTestValue(o)}))},v=[...u];if(void 0!==r&&v.push(r),t){const r=Ge(a,this,null);b=s.default.createElement(qt,{className:"jr-column-value",style:{gridColumn:null==g?"span 2":null,...y}},s.default.createElement(t,{value:f,onChange:x,record:e,style:{width:"100%",...r},...c}))}else c.columns?b=s.default.createElement(Xt,{cols:c.cols,className:"jr-grid",$gap:m,style:y},this.createColumns(f,c.columns,v,h,c.labelProps??this.props.labelProps)):(r||c.render)&&(b=s.default.createElement(qt,{className:"jr-column-value",style:{gridColumn:null==g?"span 2":null,padding:c.render?"4px 0":null}},c.render?c.render.bind(this)({onChange:x,value:f,record:this.getValue()}):"object"==typeof f?JSON.stringify(f):f));const E=p?.layout,k=void 0===p?.colon?":":p.colon,S=c.labelProps?.style??this.props.labelProps?.style??{};return s.default.createElement(Wt,{$layout:E,$hasLabel:null!=g,key:`f${d}`,style:w,className:"jr-column",$labelWidth:c.labelProps?.width??this.props.labelProps?.width??"120px",$valueWidth:c.valueProps?.width??this.props.valueProps?.width??"1fr"},null!=g&&s.default.createElement(Jt,{style:S,$required:c.required,className:"label",$layout:E,$colon:k},g),b,s.default.createElement(Kt,{$layout:E},s.default.createElement("div",{className:"left"},this.getTestValue(v.join("."))?.msg?.map((e=>e))),s.default.createElement("div",{className:"right"})))}createColumns(e,t,r,n,o){return t?.map(((t,s)=>this.createColumn(e,t,s,r,t.name?[...n,t.name]:n,o)))}renderMe(){return s.default.createElement(Ft,{className:"jr-fields",style:this.props.typeStyle},s.default.createElement(Xt,{cols:this.props.cols,style:this.props.gridStyle,className:"jr-grid",$gap:this.props.gap},this.createColumns(this.props.dataSourceName?this.getValue()?.[this.props.dataSourceName]:this.getValue(),this.props.columns,this.props.dataSourceName?[this.props.dataSourceName]:[],this.props.dataSourceName?[this.props.dataSourceName]:[],this.props.labelProps)))}},exports.JRFrame=lt,exports.JRMask=function({id:e="jr-mask"}){return s.default.createElement(et,{id:e,className:"jr-mask"},s.default.createElement("div",{id:`${e}-msg`}),s.default.createElement("div",{className:"cs-loader-inner"},s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●"),s.default.createElement("label",null,"●")))},exports.JRRadio=class extends nr{renderer(){const{valueName:e="value",labelName:t="label",onChange:r,...n}=this.props,o=this.getOptions();return s.default.createElement(ir,{className:"jr-radio"},o?.map(((r,n)=>{const o=r[e];return s.default.createElement("label",{key:n},s.default.createElement("input",{type:"radio",name:"radio",checked:this.getValue()==o,onClick:e=>{this.getValue()==o?(this.setValue(null),e.target.checked=!1):this.setValue(o)}}),r[t])})))}},exports.JRSelect=class extends nr{renderer(){const{showBlank:e,valueName:t="value",labelName:r="label",multiple:n,size:o}=this.props,i=[...this.getOptions()??[]];return 1!=n&&0!=e&&i.unshift({[t]:"",[r]:""}),s.default.createElement(sr,{value:this.getValue()??(n?[]:""),className:"jr-select",onChange:e=>{if(n){const r=[...e.target.selectedOptions].map((e=>e.index));this.setValue(r.length?r.map((e=>i[e][t])):null)}else{const r=e.target.selectedOptions[0].index;this.setValue(r?i[r][t]:null)}},size:o,multiple:n},i.map(((e,o)=>{const i={value:e[t],key:o};return(n&&this.getValue()?.indexOf(e[t])>-1||this.getValue()==e[t])&&(i.className="selected"),s.default.createElement(or,i,e[r])})))}},exports.JRSubmit=st,exports.JRTable=class extends vt{constructor(e){super(e),this.colGroupRef=s.default.createRef()}UNSAFE_componentWillMount(){this.setColumns(this.props.columns??[])}checkableColumn(e){return{render:({value:e,onChange:t})=>s.default.createElement("checkbox",{checked:e,onChange:e=>{t(e.target.checked)}}),align:"center",name:"checked",...e}}deletableColumn({name:e="deletable",sendValue:t,sendName:r,valueName:n,...o}){return{render:({value:e,onChange:t})=>s.default.createElement("checkbox",{checked:e,onChange:e=>{t(e.target.checked)}}),align:"center",name:e,label(){return s.default.createElement("button",{onClick:()=>{const n=this.props.delete.value??this.getDataSource()?.filter((t=>t[e])).map((e=>t?e[t]:e)),s=this.props.delete.callback??function(e,t,r){this.reload()};this.delete({value:r?{[r]:n}:n,callback:s,...o})}},"刪除")},...o}}initColumn(e,t,r,n,o,s){const i=void 0===e.type&&e?.columns&&e?.columns.length,a=e.name?[...o,e.name]:o;if(i){null!==e.label&&r[t].push(e);const o=this.initColumns(e.columns,t+(null!==e.label?1:0)+(null!=e.rowSpan?e.rowSpan-1:0),r,n,a,s);return e.colSpan=o.colSpan,e.columnNo=s,{colSpan:e.colSpan}}return e.columnNo=s,r[t].push({...e,isLeaf:!0}),n.push(e),e.names=a,a?.length>1?(e.setValue=function(t,r){try{Gt(t,[...a])[e.name]=r}catch{Yt(t,[...a],r)}},e.getValue=function(e){return a.reduce(((e,t)=>e?.[t]),e)}):(e.setValue=function(t,r){t[e.name]=r},e.getValue=function(t){return t[e.name]}),{colSpan:1}}initColumns(e,t,r,n,o,s){for(let e=r.length;e<=t;e++)r[e]||r.push([]);let i=s;const a=e?.reduce(((e,s)=>{const a=this.initColumn(s,t,r,n,o,i);return e.colSpan+=a.colSpan,i+=a.colSpan,e}),{colSpan:0});return a}setColumns([...e]){this.props.checkable&&e.unshift(this.checkableColumn(this.props.checkable)),this.props.deletable&&e.unshift(this.deletableColumn(this.props.deletable));const t=[],r=[];this.initColumns(e,0,t,r,[],0),this.setState({columns:t,leafColumns:r})}setDataSource(e){}getDataSource(){return this.props.dataSourceName?this.getValue()?.[this.props.dataSourceName]:this.getValue()}add(e,t=this.getDataSource()?.length??0,r){this.getDataSource()?(void 0===r?this.getDataSource().splice(t,0,e):this.getDataSource()[r].splice(t,0,e),this.setValue(this.getValue())):this.setValue(this.props.dataSourceName?{[this.props.dataSourceName]:[e]}:[e])}noData(){const e=this.getDataSource();return null==e||0==e.length}renderMe(){return s.default.createElement(zt,{className:"jr-table "+(this.props.onRowClick?"row-highlightable":"")},s.default.createElement("table",{className:"jr-table-table"},s.default.createElement(Pt,{table:this,leafColumns:this.state.leafColumns,groupHeader:this.props.groupHeader,groupFooter:this.props.groupFooter,dataSource:this.getDataSource(),onRowClick:this.props.onRowClick}),s.default.createElement(Nt,{columns:this.props.footColumns,table:this}),s.default.createElement(Ct,{columns:this.state.columns,leafColumns:this.state.leafColumns,table:this})),this.noData()&&s.default.createElement("div",{className:"empty"}))}},exports.JRTestReact=class extends st{renderer(){return s.default.createElement(Qt,{style:this.props.style,className:`${this.props.className} jr-frame`})}renderMe(){return s.default.createElement("div",{style:{flex:1}},"Render me")}},exports.JRText=class extends rr{input(){return s.default.createElement(ar,{value:this.props.value??"",onChange:e=>{this.setValue(e.target.value)}})}},exports.JRWindow=vt,exports.random=Ye,exports.showMask=nt;
|
package/package.json
CHANGED