amotify 0.1.29 → 0.1.30
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/dist/@styles/componentClasses/_.css +2 -2
- package/dist/@styles/index.css +2 -2
- package/dist/@styles/init.css +2 -2
- package/dist/@styles/style.css +2 -2
- package/dist/@styles/var.css +2 -2
- package/dist/fn/Cropper.js +1 -1
- package/dist/fn/Input/Filer.js +1 -1
- package/dist/fn/Input/Slider.js +1 -1
- package/dist/fn/Layout/SwipeView.js +1 -1
- package/dist/fn/Table/Drag.js +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license amotify
|
|
3
|
-
* amotify 0.1.
|
|
3
|
+
* amotify 0.1.30
|
|
4
4
|
* https://mingoo.co.jp/
|
|
5
5
|
|
|
6
6
|
* Copyright (c) mingoo, LLC.
|
|
7
7
|
* Released under the MIT license
|
|
8
8
|
|
|
9
|
-
* Latest updated at: 2024/6/
|
|
9
|
+
* Latest updated at: 2024/6/19
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/* esbuild-sass-plugin:css-chunk:src/@styles/componentClasses/a_img.module.scss */
|
package/dist/@styles/index.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license amotify
|
|
3
|
-
* amotify 0.1.
|
|
3
|
+
* amotify 0.1.30
|
|
4
4
|
* https://mingoo.co.jp/
|
|
5
5
|
|
|
6
6
|
* Copyright (c) mingoo, LLC.
|
|
7
7
|
* Released under the MIT license
|
|
8
8
|
|
|
9
|
-
* Latest updated at: 2024/6/
|
|
9
|
+
* Latest updated at: 2024/6/19
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/* esbuild-sass-plugin:css-chunk:src/@styles/componentClasses/a_img.module.scss */
|
package/dist/@styles/init.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license amotify
|
|
3
|
-
* amotify 0.1.
|
|
3
|
+
* amotify 0.1.30
|
|
4
4
|
* https://mingoo.co.jp/
|
|
5
5
|
|
|
6
6
|
* Copyright (c) mingoo, LLC.
|
|
7
7
|
* Released under the MIT license
|
|
8
8
|
|
|
9
|
-
* Latest updated at: 2024/6/
|
|
9
|
+
* Latest updated at: 2024/6/19
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/* src/@styles/init.scss */
|
package/dist/@styles/style.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license amotify
|
|
3
|
-
* amotify 0.1.
|
|
3
|
+
* amotify 0.1.30
|
|
4
4
|
* https://mingoo.co.jp/
|
|
5
5
|
|
|
6
6
|
* Copyright (c) mingoo, LLC.
|
|
7
7
|
* Released under the MIT license
|
|
8
8
|
|
|
9
|
-
* Latest updated at: 2024/6/
|
|
9
|
+
* Latest updated at: 2024/6/19
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/* src/@styles/@app.scss */
|
package/dist/@styles/var.css
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license amotify
|
|
3
|
-
* amotify 0.1.
|
|
3
|
+
* amotify 0.1.30
|
|
4
4
|
* https://mingoo.co.jp/
|
|
5
5
|
|
|
6
6
|
* Copyright (c) mingoo, LLC.
|
|
7
7
|
* Released under the MIT license
|
|
8
8
|
|
|
9
|
-
* Latest updated at: 2024/6/
|
|
9
|
+
* Latest updated at: 2024/6/19
|
|
10
10
|
*/
|
|
11
11
|
|
|
12
12
|
/* src/@styles/var.scss */
|
package/dist/fn/Cropper.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as X,c as G,e as P}from"../chunk-VY3566IV.js";import{Fragment as $,jsx as h,jsxs as y}from"react/jsx-runtime";import{$$ as b,$$fromRoot as j,useStore as M}from"../@utils/_";import{useState as k,useEffect as H}from"react";import O from"../atoms/Flex";import D from"../atoms/Box";import B from"../atoms/FAI";import T from"../mols/Column";import V from"../mols/Row";import Y from"./Button";import A from"./Sheet";import z from"./Loader/_";import W from"./Input/_";import{faPalette as K}from"@fortawesome/free-solid-svg-icons/faPalette";import{faBarsStaggered as Z}from"@fortawesome/free-solid-svg-icons/faBarsStaggered";import{faRotateLeft as J}from"@fortawesome/free-solid-svg-icons/faRotateLeft";import{faRotateRight as Q}from"@fortawesome/free-solid-svg-icons/faRotateRight";import{CropperClasses as U}from"../@styles/componentClasses/_";class ee{constructor(i){this.set_scale=i.set_scale,this.val_file=i.val_file,this.develops=i.develops,this.use=i.use,this.componentID=i.componentID,this.scale={current:i.scale.default,default:i.scale.default,min:i.scale.min,max:i.scale.max};let e=i.canvas,{width:l,height:t}=e,a=i.picture.image,{width:m,height:s}=a,c=m/s;this.Canvas={elm:e,ctx:e.getContext("2d")};let o=0,r=0;this.use=="square"?(o=e.width/3*2,r=e.height/3*2):this.use=="wallpaper.horizontal"?(o=e.width*(7/9),r=o/3):this.use=="wallpaper.vertical"&&(r=e.height*(7/9),o=r/2);let n=(e.width-o)/2,d=(e.height-r)/2,g=o/r;this.Picture={elm:a,originDataUrl:a.src,aspect:c,revisedAspect:g>c?o/m:r/s,rotate:i.picture.rotate,grayScale:i.picture.grayScale,tone:i.picture.tone},this.pst={frame:{x:n,y:d,w:o,h:r,aspect:g},outImage:{x:0,y:0,w:0,h:0},imageX:m/2,imageY:s/2,centerX:l/2,centerY:t/2},this.dragEffectInfo={origin:{x:0,y:0},frameExpandRate:{x:0,y:0}},this.pinchEffectInfo={origin:{x:0,y:0,scale:this.scale.current}},this.modifyImage()}dragEffect(i){let{eventType:e,x:l,y:t}=i;if(e=="start"){let a=this.Canvas.elm.position();this.dragEffectInfo={origin:{x:l,y:t},frameExpandRate:{x:this.Canvas.elm.width/a.width,y:this.Canvas.elm.height/a.height}}}else{let{origin:a,frameExpandRate:m}=this.dragEffectInfo,s=a.x-l,c=a.y-t,o=this.scale.current*this.Picture.revisedAspect/100,r=s/o*m.x,n=c/o*m.y;e=="move"?this.drawImage(this.pst.imageX+r,this.pst.imageY+n):e=="end"&&this.drawImage(this.pst.imageX+=r,this.pst.imageY+=n)}}pinchEffect(i){let{eventType:e,event:l}=i,{x:t,y:a}=b.getCursor(l.touches[0]),{x:m,y:s}=b.getCursor(l.touches[1]),c=m-t,o=s-a;if(e=="start")this.pinchEffectInfo.origin={x:c,y:o,scale:this.scale.current};else if(e=="move"){let{origin:r}=this.pinchEffectInfo,n=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)),g=Math.sqrt(Math.pow(c,2)+Math.pow(o,2))/n,C=Number(r.scale*g);this.set_scale(C)}}updateScale(i){let e=i;e=Math.max(e,this.scale.min),e=Math.min(e,this.scale.max),this.scale.current=e,this.drawImage()}updateFilter(i){this.Picture.grayScale=i.grayScale,this.Picture.tone=i.tone,this.Picture.rotate=i.rotate,this.modifyImage()}modifyImage(){return P(this,null,function*(){let{grayScale:i,tone:e,rotate:l}=this.Picture;const t=document.createElement("canvas");let a=t.getContext("2d"),m=new Image;m.src=this.Picture.originDataUrl;let s=m.width,c=m.height;(l==90||l==270)&&(s=m.height,c=m.width),t.width=s,t.height=c,i&&(a.filter="grayscale("+i+"%)"),l&&(a.translate(s/2,c/2),a.rotate(l*Math.PI/180),[90,270].includes(l)?a.translate(-c/2,-s/2):a.translate(-s/2,-c/2)),a.drawImage(m,0,0,m.width,m.height);let o=a.getImageData(0,0,t.width,t.height),r=o.data;{i/=100;let C=[[255,255,255],[255,200,100],[170,170,255],[240,200,145],[128,255,255],[255,128,255],[255,255,128],[128,158,169],[128,112,162],[50,192,87],[246,100,140]][e],x=C[0]/255,S=C[1]/255,p=C[2]/255;for(let u=0;u<c;u++)for(let v=0;v<s;v++){var n=(u*s+v)*4;if(i){let w=.3*r[n]+.59*r[n+1]+.11*r[n+2];for(var d=0;d<3;d++){let E=r[n+d];r[n+d]=E+(w-E)*i}}r[n]*=x,r[n+1]*=S,r[n+2]*=p}}a.putImageData(o,0,0);let g=t.toDataURL("image/jpeg");{let C=yield b.ImageLoader(g),{width:x,height:S}=C,p=x/S;this.Picture=G(X({},this.Picture),{elm:C,aspect:p,revisedAspect:this.pst.frame.aspect>p?this.pst.frame.w/x:this.pst.frame.h/S})}this.drawImage()})}drawImage(i,e){let{use:l,Canvas:{ctx:t},pst:{frame:a}}=this,m=i||this.pst.imageX,s=e||this.pst.imageY;{let c=this.scale.current/100,o=this.Picture.revisedAspect*c,r=this.pst.centerX-m*o,n=this.pst.centerY-s*o,d=this.Picture.elm.width*o,g=this.Picture.elm.height*o;{let C=this.pst.frame.x+this.pst.frame.w-d,x=this.pst.frame.x,S=this.pst.frame.y+this.pst.frame.h-g,p=this.pst.frame.y,u=0;r<C&&(u=r-C),r>x&&(u=r-x);let v=0;n<S&&(v=n-S),n>p&&(v=n-p),this.dragEffectInfo.origin.x+=u/2/this.dragEffectInfo.frameExpandRate.x,this.dragEffectInfo.origin.y+=v/2/this.dragEffectInfo.frameExpandRate.y,r=Math.min(Math.max(r,C),x),n=Math.min(Math.max(n,S),p)}this.pst.outImage={x:r,y:n,w:d,h:g},t.clearRect(0,0,this.Canvas.elm.width,this.Canvas.elm.height),t.drawImage(this.Picture.elm,0,0,this.Picture.elm.width,this.Picture.elm.height,r,n,d,g)}{l=="square"?(t.fillStyle="rgba( 20,24,20,.3 )",t.beginPath(),t.arc(this.Canvas.elm.width/2,this.Canvas.elm.height/2,this.Canvas.elm.width,0,Math.PI*2,!0),t.arc(this.Canvas.elm.width/2,this.Canvas.elm.height/2,this.Canvas.elm.width/3*2/2,0,Math.PI*2,!1),t.closePath(),t.fill()):(l=="wallpaper.horizontal"||l=="wallpaper.vertical")&&(t.fillStyle="rgba( 20,24,20,.3 )"),t.beginPath(),t.moveTo(0,0),t.lineTo(this.Canvas.elm.width,0),t.lineTo(this.Canvas.elm.width,this.Canvas.elm.height),t.lineTo(0,this.Canvas.elm.height),t.lineTo(0,0),t.closePath(),t.lineTo(a.x,a.y),t.lineTo(a.x,a.y+a.h),t.lineTo(a.x+a.w,a.y+a.h),t.lineTo(a.x+a.w,a.y),t.lineTo(a.x,a.y),t.fill();let o=b(document.body).getStyleProperty("--color-theme-hsl");t.lineWidth=this.Canvas.elm.width/200,t.strokeStyle=`hsla( ${o},1 )`,t.strokeRect(a.x,a.y,a.w,a.h)}}export(){return P(this,null,function*(){let{develops:i,Picture:e,pst:{outImage:l,frame:t}}=this,a=l.w/e.elm.width,m=l.h/e.elm.height,s=(t.x-l.x)/a,c=(t.x-l.x+t.w)/a,o=(t.y-l.y)/m,r=(t.y-l.y+t.h)/m,n=Array.from({length:i.length}),d="image/jpeg";for(let g=0;g<i.length;g++){let{size:C,maxSize:x}=i[g];x=x||{S:1024*20,R:1024*100,L:1024*350}[C];let S={S:144,R:576,L:1152}[C],p=S;this.use=="wallpaper.horizontal"?p=S/3*2:this.use=="wallpaper.vertical"&&(p=S*2);let u=document.createElement("canvas");u.width=S,u.height=p;let v=u.getContext("2d");if(!v)return;v.clearRect(0,0,S,p),v.drawImage(this.Picture.elm,s,o,c-s,r-o,0,0,S,p);let w=u.toDataURL(d),E=yield w.toBlob(d);if(!E)return;if(E.size>=x){let F=x/E.size;if(w=u.toDataURL(d,F*.92),E=yield w.toBlob(d),!E)return}let L=new File([E],this.val_file.name,{type:d});n[g]=L}return n})}}const q={Core:f=>{let{val_file:i,options:e,finishedCallback:l,abortCallback:t}=f,{use:a,develops:m=[]}=e,[s]=k(b.uuid.gen(32));const c={scale:{default:125,min:100,max:300},rotate:0,grayScale:0,tone:0};let[o,r]=k(c.scale.default),[n,d]=k(c.rotate),[g,C]=k(c.grayScale),[x,S]=k(c.tone);return H(()=>{M.set({key:s,value:{}}),P(void 0,null,function*(){z.fn.corner.active();let{target:p}=yield i.read();if(!p)return;let u=p.result,v=j("#Canvas-"+s)[0];if(!v)return;let w=new ee({set_scale:r,val_file:i,develops:m,use:a,scale:c.scale,componentID:s,canvas:v,picture:{image:yield b.ImageLoader(u),grayScale:c.grayScale,tone:c.tone,rotate:c.rotate}});M.set({key:s,value:{Instance:w}});const E=function(I){if(I.preventDefault(),I.touches&&I.touches.length>1)w.pinchEffect({eventType:"start",event:I}),b(document).addEvent({eventType:"touchmove",eventID:"CropperEffectMove",option:{passive:!1},callback:R=>{R.preventDefault(),w.pinchEffect({eventType:"move",event:R})}}).addEvent({eventType:"touchend",eventID:"CropperEffectEnd",option:{passive:!1},callback:F});else{w.dragEffect(X({eventType:"start"},b.getCursor(I)));let{type:R}=I;b(document).addEvent({eventType:R=="touchstart"?"touchmove":"mousemove",eventID:"CropperEffectMove",option:{passive:!1},callback:_=>{L("move",_)}}).addEvent({eventType:R=="touchstart"?"touchend":"mouseup",eventID:"CropperEffectEnd",option:{passive:!1},callback:_=>{L("end",_),F(_)}})}},L=function(I,R){R.preventDefault(),w.dragEffect(X({eventType:I},b.getCursor(R)))},F=function(I){I.preventDefault(),b(document).removeEvent(["CropperEffectMove","CropperEffectEnd"])};b(v).removeEvent(["CropperMouseWheel","CropperTouchStart","CropperMouseDown"]).addEvent({eventID:"CropperMouseWheel",eventType:"wheel",callback:I=>{I.preventDefault();let R=Number(I.wheelDelta*.04),_=w.scale.current+R;_=Math.max(_,w.scale.min),_=Math.min(_,w.scale.max),r(_)},option:{passive:!1}}).addEvent({eventType:"touchstart",eventID:"CropperTouchStart",callback:E,option:{passive:!1}}).addEvent({eventType:"mousedown",eventID:"CropperMouseDown",callback:E,option:{passive:!1}}),setTimeout(()=>{z.fn.corner.stop()},1e3)})},[i.id]),H(()=>{var u;let p=(u=M.get(s))==null?void 0:u.Instance;p&&p.updateScale(o)},[o]),H(()=>{var u;let p=(u=M.get(s))==null?void 0:u.Instance;p&&p.updateFilter({grayScale:g,tone:x,rotate:n})},[g,x,n]),h(A.Comps.Body,{children:y(O,{className:[U("Wrap"),U("Use_"+a)].join(" "),flexWrap:!1,position:"relative",overflow:"hidden",borderRadius:"inherit",boxShadow:"3.remark",UnderBreakPointStyles:{flexType:"col"},children:[h(D,{flexGrid:3,UnderBreakPointStyles:{width:1,padding:2},children:h(D,{overflow:"hidden",position:"relative",backgroundColor:"4.layer.darken",freeCSS:{zIndex:1},UnderBreakPointStyles:{borderRadius:"1.tone.primary"},children:h("canvas",{width:"2400",height:a=="wallpaper.horizontal"?"1800":a=="wallpaper.vertical"?"3200":"2400",className:U("Canvas"),id:"Canvas-"+s})})}),y(T,{gap:0,flexGrid:2,boxShadow:"3.remark",UnderBreakPointStyles:{width:1,maxWidth:"unset"},freeCSS:{maxWidth:12*28},children:[y(T,{gap:1,flexSizing:0,overflow:"auto",padding:1.5,UnderBreakPointStyles:{flexSizing:"none"},children:[h(D,{flexSizing:"none",fontSize:"4.thirdTitle",isSemiBoldFont:!0,children:"\u30D5\u30A3\u30EB\u30BF\u30FC"}),h(q.SettingRegion,{DefaultOptions:c,val_scale:o,set_scale:r,val_tone:x,set_tone:S,val_grayScale:g,set_grayScale:C,val_rotate:n,set_rotate:d})]}),y(O,{padding:1.5,flexSizing:"none",gap:1,borderTop:!0,children:[h(Y.Button.Border.R,{flexGrid:1,onClick:()=>{t()},children:"\u30AD\u30E3\u30F3\u30BB\u30EB"}),h(Y.Button.Prime.R,{flexGrid:2,onClick:()=>P(void 0,null,function*(){var v;let p=(v=M.get(s))==null?void 0:v.Instance;if(!p)return;z.fn.mini.active("CropperExportation");let u=yield p.export();setTimeout(()=>{z.fn.mini.stop("CropperExportation"),l(u)},3e3)}),children:y(V.Center,{gap:"1/2",children:[h(z.White.R,{loaderID:"CropperExportation"}),"\u6C7A\u5B9A"]})})]})]})]})})},SettingRegion:f=>{let i=[];for(let e=1;e<=10;e++)i.push({value:e,label:y($,{children:[h(D,{className:[U("ToneBall"),U("ToneBall_"+e)].join(" ")}),h(D,{textAlign:"center",flexSizing:"auto",children:["","\u6696\u8272","\u5BD2\u8272","\u30BB\u30D4\u30A2","\u30B7\u30A2\u30F3","\u30DE\u30BC\u30F3\u30BF","\u30A4\u30A8\u30ED\u30FC","\u30AA\u30EA\u30B8\u30CA\u30EB1","\u30AA\u30EA\u30B8\u30CA\u30EB2","\u30AA\u30EA\u30B8\u30CA\u30EB3","\u30AA\u30EA\u30B8\u30CA\u30EB4"][e]})]})});return y($,{children:[y(T,{gap:"1/3",children:[y(D,{children:[h(B.Rotate,{fontSize:"3.paragraph",fontColor:"4.thin"})," Rotate"]}),y(V.Separate,{flexChilds:"even",paddingLeft:2,children:[y(Y.Button.Border.S,{onClick:()=>{let e=f.val_rotate-90;e<0&&(e+=360),f.set_rotate(e)},children:[h(B,{icon:J})," \u5DE6\u306B\u56DE\u8EE2"]}),y(Y.Button.Border.S,{onClick:()=>{f.set_rotate((f.val_rotate+90)%360)},children:["\u53F3\u306B\u56DE\u8EE2 ",h(B,{icon:Q})]})]})]}),y(T,{gap:"1/3",children:[y(D,{children:[h(B.Search,{fontSize:"3.paragraph",fontColor:"4.thin"})," Zoom"]}),h(D,{paddingLeft:2,children:h(W.Slider,{override:"force",value:f.val_scale-100,min:f.DefaultOptions.scale.min-100,max:f.DefaultOptions.scale.max-100,step:25,onUpdateValidValue:({eventType:e,value:l})=>{b.interval.clear("Cropper.UpdateScale"),b.interval.standBy("Cropper.UpdateScale",400,()=>{f.set_scale(l+100)})},legends:{enable:!0,custom:e=>"x"+Math.round(100+e)/100}})})]}),y(T,{gap:"1/3",children:[y(D,{children:[h(B,{icon:K,fontSize:"3.paragraph",fontColor:"4.thin"})," Gray Scale"]}),h(D,{paddingLeft:2,children:h(W.Slider,{value:f.val_grayScale,min:0,max:100,step:10,onUpdateValidValue:({value:e})=>{b.interval.clear("Cropper.GrayScale"),b.interval.standBy("Cropper.GrayScale",400,()=>{f.set_grayScale(e)})},legends:{enable:!0,custom:e=>e+"%"}})})]}),y(T,{gap:"1/3",children:[y(D,{children:[h(B,{icon:Z,fontSize:"3.paragraph",fontColor:"4.thin"})," Tone"]}),h(D,{paddingLeft:2,children:h(W.Radio,{value:f.val_tone,gap:"1/2",cellStyles:{isRounded:!0,borderWidth:2,borderColor:"1.thin",padding:"1/2",paddingRight:1,fontSize:"1.mini",gap:"1/3",flexSizing:"auto"},options:[{value:0,label:"\u306A\u3057",padding:["1/2",1],flexCenter:!0},...i],onUpdateValidValue:({value:e})=>{f.set_tone(e[0])}})})]})]})}},N={open:f=>P(void 0,null,function*(){let i=yield W.Filer.fn.openDialog({accept:"image",multiple:!1}),e="CropperImage";A.open({sheetID:e,type:"normal.middleCenter",size:"3L",freeCSS:{width:f.use=="wallpaper.horizontal"?12*100:12*80},content:h(q.Core,{val_file:i[0],options:f,finishedCallback:l=>{A.close(e),f.onProcessFinished(l)},abortCallback:()=>{A.close(e)}}),close_option:{escapeKeyDown:!1}})})};export{N as Cropper,N as default};
|
|
1
|
+
import{b as X,c as O,e as P}from"../chunk-VY3566IV.js";import{Fragment as $,jsx as h,jsxs as y}from"react/jsx-runtime";import{$$ as b,$$fromRoot as j,useStore as M}from"../@utils/_";import{useState as k,useEffect as H}from"react";import V from"../atoms/Flex";import D from"../atoms/Box";import B from"../atoms/FAI";import T from"../mols/Column";import q from"../mols/Row";import Y from"./Button";import A from"./Sheet";import z from"./Loader/_";import W from"./Input/_";import{faPalette as K}from"@fortawesome/free-solid-svg-icons/faPalette";import{faBarsStaggered as Z}from"@fortawesome/free-solid-svg-icons/faBarsStaggered";import{faRotateLeft as J}from"@fortawesome/free-solid-svg-icons/faRotateLeft";import{faRotateRight as Q}from"@fortawesome/free-solid-svg-icons/faRotateRight";import{CropperClasses as U}from"../@styles/componentClasses/_";class ee{constructor(i){this.set_scale=i.set_scale,this.val_file=i.val_file,this.develops=i.develops,this.use=i.use,this.componentID=i.componentID,this.scale={current:i.scale.default,default:i.scale.default,min:i.scale.min,max:i.scale.max};let e=i.canvas,{width:l,height:t}=e,a=i.picture.image,{width:m,height:s}=a,c=m/s;this.Canvas={elm:e,ctx:e.getContext("2d")};let o=0,r=0;this.use=="square"?(o=e.width/3*2,r=e.height/3*2):this.use=="wallpaper.horizontal"?(o=e.width*(7/9),r=o/3):this.use=="wallpaper.vertical"&&(r=e.height*(7/9),o=r/2);let n=(e.width-o)/2,d=(e.height-r)/2,g=o/r;this.Picture={elm:a,originDataUrl:a.src,aspect:c,revisedAspect:g>c?o/m:r/s,rotate:i.picture.rotate,grayScale:i.picture.grayScale,tone:i.picture.tone},this.pst={frame:{x:n,y:d,w:o,h:r,aspect:g},outImage:{x:0,y:0,w:0,h:0},imageX:m/2,imageY:s/2,centerX:l/2,centerY:t/2},this.dragEffectInfo={origin:{x:0,y:0},frameExpandRate:{x:0,y:0}},this.pinchEffectInfo={origin:{x:0,y:0,scale:this.scale.current}},this.modifyImage()}dragEffect(i){let{eventType:e,x:l,y:t}=i;if(e=="start"){let a=this.Canvas.elm.position();this.dragEffectInfo={origin:{x:l,y:t},frameExpandRate:{x:this.Canvas.elm.width/a.width,y:this.Canvas.elm.height/a.height}}}else{let{origin:a,frameExpandRate:m}=this.dragEffectInfo,s=a.x-l,c=a.y-t,o=this.scale.current*this.Picture.revisedAspect/100,r=s/o*m.x,n=c/o*m.y;e=="move"?this.drawImage(this.pst.imageX+r,this.pst.imageY+n):e=="end"&&this.drawImage(this.pst.imageX+=r,this.pst.imageY+=n)}}pinchEffect(i){let{eventType:e,event:l}=i,{x:t,y:a}=b.getCursor(l.touches[0]),{x:m,y:s}=b.getCursor(l.touches[1]),c=m-t,o=s-a;if(e=="start")this.pinchEffectInfo.origin={x:c,y:o,scale:this.scale.current};else if(e=="move"){let{origin:r}=this.pinchEffectInfo,n=Math.sqrt(Math.pow(r.x,2)+Math.pow(r.y,2)),g=Math.sqrt(Math.pow(c,2)+Math.pow(o,2))/n,C=Number(r.scale*g);this.set_scale(C)}}updateScale(i){let e=i;e=Math.max(e,this.scale.min),e=Math.min(e,this.scale.max),this.scale.current=e,this.drawImage()}updateFilter(i){this.Picture.grayScale=i.grayScale,this.Picture.tone=i.tone,this.Picture.rotate=i.rotate,this.modifyImage()}modifyImage(){return P(this,null,function*(){let{grayScale:i,tone:e,rotate:l}=this.Picture;const t=document.createElement("canvas");let a=t.getContext("2d"),m=new Image;m.src=this.Picture.originDataUrl;let s=m.width,c=m.height;(l==90||l==270)&&(s=m.height,c=m.width),t.width=s,t.height=c,i&&(a.filter="grayscale("+i+"%)"),l&&(a.translate(s/2,c/2),a.rotate(l*Math.PI/180),[90,270].includes(l)?a.translate(-c/2,-s/2):a.translate(-s/2,-c/2)),a.drawImage(m,0,0,m.width,m.height);let o=a.getImageData(0,0,t.width,t.height),r=o.data;{i/=100;let C=[[255,255,255],[255,200,100],[170,170,255],[240,200,145],[128,255,255],[255,128,255],[255,255,128],[128,158,169],[128,112,162],[50,192,87],[246,100,140]][e],x=C[0]/255,S=C[1]/255,p=C[2]/255;for(let u=0;u<c;u++)for(let v=0;v<s;v++){var n=(u*s+v)*4;if(i){let w=.3*r[n]+.59*r[n+1]+.11*r[n+2];for(var d=0;d<3;d++){let E=r[n+d];r[n+d]=E+(w-E)*i}}r[n]*=x,r[n+1]*=S,r[n+2]*=p}}a.putImageData(o,0,0);let g=t.toDataURL("image/jpeg");{let C=yield b.ImageLoader(g),{width:x,height:S}=C,p=x/S;this.Picture=O(X({},this.Picture),{elm:C,aspect:p,revisedAspect:this.pst.frame.aspect>p?this.pst.frame.w/x:this.pst.frame.h/S})}this.drawImage()})}drawImage(i,e){let{use:l,Canvas:{ctx:t},pst:{frame:a}}=this,m=i||this.pst.imageX,s=e||this.pst.imageY;{let c=this.scale.current/100,o=this.Picture.revisedAspect*c,r=this.pst.centerX-m*o,n=this.pst.centerY-s*o,d=this.Picture.elm.width*o,g=this.Picture.elm.height*o;{let C=this.pst.frame.x+this.pst.frame.w-d,x=this.pst.frame.x,S=this.pst.frame.y+this.pst.frame.h-g,p=this.pst.frame.y,u=0;r<C&&(u=r-C),r>x&&(u=r-x);let v=0;n<S&&(v=n-S),n>p&&(v=n-p),this.dragEffectInfo.origin.x+=u/2/this.dragEffectInfo.frameExpandRate.x,this.dragEffectInfo.origin.y+=v/2/this.dragEffectInfo.frameExpandRate.y,r=Math.min(Math.max(r,C),x),n=Math.min(Math.max(n,S),p)}this.pst.outImage={x:r,y:n,w:d,h:g},t.clearRect(0,0,this.Canvas.elm.width,this.Canvas.elm.height),t.drawImage(this.Picture.elm,0,0,this.Picture.elm.width,this.Picture.elm.height,r,n,d,g)}{l=="square"?(t.fillStyle="rgba( 20,24,20,.3 )",t.beginPath(),t.arc(this.Canvas.elm.width/2,this.Canvas.elm.height/2,this.Canvas.elm.width,0,Math.PI*2,!0),t.arc(this.Canvas.elm.width/2,this.Canvas.elm.height/2,this.Canvas.elm.width/3*2/2,0,Math.PI*2,!1),t.closePath(),t.fill()):(l=="wallpaper.horizontal"||l=="wallpaper.vertical")&&(t.fillStyle="rgba( 20,24,20,.3 )"),t.beginPath(),t.moveTo(0,0),t.lineTo(this.Canvas.elm.width,0),t.lineTo(this.Canvas.elm.width,this.Canvas.elm.height),t.lineTo(0,this.Canvas.elm.height),t.lineTo(0,0),t.closePath(),t.lineTo(a.x,a.y),t.lineTo(a.x,a.y+a.h),t.lineTo(a.x+a.w,a.y+a.h),t.lineTo(a.x+a.w,a.y),t.lineTo(a.x,a.y),t.fill();let o=b(document.body).getStyleProperty("--color-theme-hsl");t.lineWidth=this.Canvas.elm.width/200,t.strokeStyle=`hsla( ${o},1 )`,t.strokeRect(a.x,a.y,a.w,a.h)}}export(){return P(this,null,function*(){let{develops:i,Picture:e,pst:{outImage:l,frame:t}}=this,a=l.w/e.elm.width,m=l.h/e.elm.height,s=(t.x-l.x)/a,c=(t.x-l.x+t.w)/a,o=(t.y-l.y)/m,r=(t.y-l.y+t.h)/m,n=Array.from({length:i.length}),d="image/jpeg";for(let g=0;g<i.length;g++){let{size:C,maxSize:x}=i[g];x=x||{S:1024*20,R:1024*100,L:1024*350}[C];let S={S:144,R:576,L:1152}[C],p=S;this.use=="wallpaper.horizontal"?p=S/3*2:this.use=="wallpaper.vertical"&&(p=S*2);let u=document.createElement("canvas");u.width=S,u.height=p;let v=u.getContext("2d");if(!v)return;v.clearRect(0,0,S,p),v.drawImage(this.Picture.elm,s,o,c-s,r-o,0,0,S,p);let w=u.toDataURL(d),E=yield w.toBlob(d);if(!E)return;if(E.size>=x){let F=x/E.size;if(w=u.toDataURL(d,F*.92),E=yield w.toBlob(d),!E)return}let L=new File([E],this.val_file.name,{type:d});n[g]=L}return n})}}const G={Core:f=>{let{val_file:i,options:e,finishedCallback:l,abortCallback:t}=f,{use:a,develops:m=[]}=e,[s]=k(b.uuid.gen(32));const c={scale:{default:125,min:100,max:300},rotate:0,grayScale:0,tone:0};let[o,r]=k(c.scale.default),[n,d]=k(c.rotate),[g,C]=k(c.grayScale),[x,S]=k(c.tone);return H(()=>{M.set({key:s,value:{}}),P(void 0,null,function*(){z.fn.corner.active();let{target:p}=yield i.read();if(!p)return;let u=p.result,v=j("#Canvas-"+s)[0];if(!v)return;let w=new ee({set_scale:r,val_file:i,develops:m,use:a,scale:c.scale,componentID:s,canvas:v,picture:{image:yield b.ImageLoader(u),grayScale:c.grayScale,tone:c.tone,rotate:c.rotate}});M.set({key:s,value:{Instance:w}});const E=function(I){if(I.preventDefault(),I.touches&&I.touches.length>1)w.pinchEffect({eventType:"start",event:I}),b(document).addEvent({eventType:"touchmove",eventID:"CropperEffectMove",options:{passive:!1},callback:R=>{R.preventDefault(),w.pinchEffect({eventType:"move",event:R})}}).addEvent({eventType:"touchend",eventID:"CropperEffectEnd",options:{passive:!1},callback:F});else{w.dragEffect(X({eventType:"start"},b.getCursor(I)));let{type:R}=I;b(document).addEvent({eventType:R=="touchstart"?"touchmove":"mousemove",eventID:"CropperEffectMove",options:{passive:!1},callback:_=>{L("move",_)}}).addEvent({eventType:R=="touchstart"?"touchend":"mouseup",eventID:"CropperEffectEnd",options:{passive:!1},callback:_=>{L("end",_),F(_)}})}},L=function(I,R){R.preventDefault(),w.dragEffect(X({eventType:I},b.getCursor(R)))},F=function(I){I.preventDefault(),b(document).removeEvent(["CropperEffectMove","CropperEffectEnd"])};b(v).removeEvent(["CropperMouseWheel","CropperTouchStart","CropperMouseDown"]).addEvent({eventID:"CropperMouseWheel",eventType:"wheel",callback:I=>{I.preventDefault();let R=Number(I.wheelDelta*.04),_=w.scale.current+R;_=Math.max(_,w.scale.min),_=Math.min(_,w.scale.max),r(_)},options:{passive:!1}}).addEvent({eventType:"touchstart",eventID:"CropperTouchStart",callback:E,options:{passive:!1}}).addEvent({eventType:"mousedown",eventID:"CropperMouseDown",callback:E,options:{passive:!1}}),setTimeout(()=>{z.fn.corner.stop()},1e3)})},[i.id]),H(()=>{var u;let p=(u=M.get(s))==null?void 0:u.Instance;p&&p.updateScale(o)},[o]),H(()=>{var u;let p=(u=M.get(s))==null?void 0:u.Instance;p&&p.updateFilter({grayScale:g,tone:x,rotate:n})},[g,x,n]),h(A.Comps.Body,{children:y(V,{className:[U("Wrap"),U("Use_"+a)].join(" "),flexWrap:!1,position:"relative",overflow:"hidden",borderRadius:"inherit",boxShadow:"3.remark",UnderBreakPointStyles:{flexType:"col"},children:[h(D,{flexGrid:3,UnderBreakPointStyles:{width:1,padding:2},children:h(D,{overflow:"hidden",position:"relative",backgroundColor:"4.layer.darken",freeCSS:{zIndex:1},UnderBreakPointStyles:{borderRadius:"1.tone.primary"},children:h("canvas",{width:"2400",height:a=="wallpaper.horizontal"?"1800":a=="wallpaper.vertical"?"3200":"2400",className:U("Canvas"),id:"Canvas-"+s})})}),y(T,{gap:0,flexGrid:2,boxShadow:"3.remark",UnderBreakPointStyles:{width:1,maxWidth:"unset"},freeCSS:{maxWidth:12*28},children:[y(T,{gap:1,flexSizing:0,overflow:"auto",padding:1.5,UnderBreakPointStyles:{flexSizing:"none"},children:[h(D,{flexSizing:"none",fontSize:"4.thirdTitle",isSemiBoldFont:!0,children:"\u30D5\u30A3\u30EB\u30BF\u30FC"}),h(G.SettingRegion,{DefaultOptions:c,val_scale:o,set_scale:r,val_tone:x,set_tone:S,val_grayScale:g,set_grayScale:C,val_rotate:n,set_rotate:d})]}),y(V,{padding:1.5,flexSizing:"none",gap:1,borderTop:!0,children:[h(Y.Button.Border.R,{onClick:()=>{t()},children:"\u30AD\u30E3\u30F3\u30BB\u30EB"}),h(Y.Button.Prime.R,{flexSizing:0,onClick:()=>P(void 0,null,function*(){var v;let p=(v=M.get(s))==null?void 0:v.Instance;if(!p)return;z.fn.mini.active("CropperExportation");let u=yield p.export();setTimeout(()=>{z.fn.mini.stop("CropperExportation"),l(u)},3e3)}),children:y(q.Center,{gap:"1/2",children:[h(z.White.R,{loaderID:"CropperExportation"}),"\u6C7A\u5B9A"]})})]})]})]})})},SettingRegion:f=>{let i=[];for(let e=1;e<=10;e++)i.push({value:e,label:y($,{children:[h(D,{className:[U("ToneBall"),U("ToneBall_"+e)].join(" ")}),h(D,{textAlign:"center",flexSizing:"auto",children:["","\u6696\u8272","\u5BD2\u8272","\u30BB\u30D4\u30A2","\u30B7\u30A2\u30F3","\u30DE\u30BC\u30F3\u30BF","\u30A4\u30A8\u30ED\u30FC","\u30AA\u30EA\u30B8\u30CA\u30EB1","\u30AA\u30EA\u30B8\u30CA\u30EB2","\u30AA\u30EA\u30B8\u30CA\u30EB3","\u30AA\u30EA\u30B8\u30CA\u30EB4"][e]})]})});return y($,{children:[y(T,{gap:"1/3",children:[y(D,{children:[h(B.Rotate,{fontSize:"3.paragraph",fontColor:"4.thin"})," Rotate"]}),y(q.Separate,{flexChilds:"even",paddingLeft:2,children:[y(Y.Button.Border.S,{onClick:()=>{let e=f.val_rotate-90;e<0&&(e+=360),f.set_rotate(e)},children:[h(B,{icon:J})," \u5DE6\u306B\u56DE\u8EE2"]}),y(Y.Button.Border.S,{onClick:()=>{f.set_rotate((f.val_rotate+90)%360)},children:["\u53F3\u306B\u56DE\u8EE2 ",h(B,{icon:Q})]})]})]}),y(T,{gap:"1/3",children:[y(D,{children:[h(B.Search,{fontSize:"3.paragraph",fontColor:"4.thin"})," Zoom"]}),h(D,{paddingLeft:2,children:h(W.Slider,{override:"force",value:f.val_scale-100,min:f.DefaultOptions.scale.min-100,max:f.DefaultOptions.scale.max-100,step:25,onUpdateValidValue:({eventType:e,value:l})=>{b.interval.clear("Cropper.UpdateScale"),b.interval.standBy("Cropper.UpdateScale",400,()=>{f.set_scale(l+100)})},legends:{enable:!0,custom:e=>"x"+Math.round(100+e)/100}})})]}),y(T,{gap:"1/3",children:[y(D,{children:[h(B,{icon:K,fontSize:"3.paragraph",fontColor:"4.thin"})," Gray Scale"]}),h(D,{paddingLeft:2,children:h(W.Slider,{value:f.val_grayScale,min:0,max:100,step:10,onUpdateValidValue:({value:e})=>{b.interval.clear("Cropper.GrayScale"),b.interval.standBy("Cropper.GrayScale",400,()=>{f.set_grayScale(e)})},legends:{enable:!0,custom:e=>e+"%"}})})]}),y(T,{gap:"1/3",children:[y(D,{children:[h(B,{icon:Z,fontSize:"3.paragraph",fontColor:"4.thin"})," Tone"]}),h(D,{paddingLeft:2,children:h(W.Radio,{value:f.val_tone,gap:"1/2",cellStyles:{isRounded:!0,borderWidth:2,borderColor:"1.thin",padding:"1/2",paddingRight:1,fontSize:"1.mini",gap:"1/3",flexSizing:"auto"},options:[{value:0,label:"\u306A\u3057",padding:["1/2",1],flexCenter:!0},...i],onUpdateValidValue:({value:e})=>{f.set_tone(e[0])}})})]})]})}},N={open:f=>P(void 0,null,function*(){let i=yield W.Filer.fn.openDialog({accept:"image",multiple:!1}),e="CropperImage";A.open({sheetID:e,type:"normal.middleCenter",size:"3L",freeCSS:{width:f.use=="wallpaper.horizontal"?12*100:12*80},content:h(G.Core,{val_file:i[0],options:f,finishedCallback:l=>{A.close(e),f.onProcessFinished(l)},abortCallback:()=>{A.close(e)}}),close_option:{escapeKeyDown:!1}})})};export{N as Cropper,N as default};
|
package/dist/fn/Input/Filer.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as g,c as x,d as Q,e as $}from"../../chunk-VY3566IV.js";import{Fragment as G,jsx as t,jsxs as d}from"react/jsx-runtime";import{useState as q,useEffect as te}from"react";import{$$ as h,$$fromRoot as P,useStore as X,GenerateClassName as ae}from"../../@utils/_";import y from"../../atoms/Box";import L from"../../atoms/FAI";import O from"../../atoms/Flex";import Y from"../../mols/Column";import le from"../../mols/Row";import W from"../Button";import H from"../Snackbar";import{Wrapper as ne,BoxWrapper as ie,CommonEffects as oe,DefaultStyles as se}from"./core";import re from"./Text";import{InputFilerClasses as m}from"../../@styles/componentClasses/_";import{faCloudArrowUp as pe}from"@fortawesome/free-solid-svg-icons/faCloudArrowUp";function ue(e){let{value:a,params:l}=e,{required:s}=l,n=[];return s&&!a.length&&n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!n.filter(({type:p})=>p=="invalid").length,notice:n}}const ee={List:e=>{let{files:a,params:l,val_status:s,set_status:n}=e,p=(l.limit||1)-s.dataValue.length,c=a.map((u,S)=>t(ee.Cell,{index:S,file:u,className:l.cellClassName,val_status:s,set_status:n,fileNameEdit:l.fileNameEdit},u.name));return p>0&&c.push(t("label",{className:[l.cellClassName,m("AddButton")].join(" "),"data-component-id":s.componentID,htmlFor:l.id,tabIndex:l.tabIndex,onKeyDown:u=>{let{key:S}=u;l.tabIndex!=-1&&[" ","Enter"].includes(S)&&P("#"+l.id).click()},children:d(le.Center,{padding:["1/3",0],children:[t(y,{isRounded:!0,className:m("AddIcon"),children:t(L,{icon:pe,className:m("Icon"),fontColor:"theme",fontSize:"4.thirdTitle",backgroundColor:"tcOpLow",ssSphere:3,padding:"1/2"})}),d(y,{children:[t(y,{children:`\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\uFF08${p}\uFF09`,fontColor:"theme",fontSize:"2.normal",isSemiBoldFont:!0}),t(y,{isSemiBoldFont:!0,fontColor:"4.thin",fontSize:"0.xs",children:"\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7"})]})]})},"AddButton")),t(Y,{flexSizing:"auto",className:l.className,children:c})},Cell:e=>{let{index:a,file:l,className:s,val_status:n,set_status:p,fileNameEdit:c=!0}=e,{name:u,size:S,type:i}=l,[V,b]=q(!1),N=h.uuid.gen(),_=S.rank(),[J,M]=u.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" "),o="\u30D5\u30A1\u30A4\u30EB";return i.match(/image/)?o=i.replace(/image\//,""):i.match(/pdf/)?o="PDF":i.match(/csv/)?o="CSV":i.match(/spreadsheet/)?o="SpreadSheet":i.match(/presentation/)?o="PowerPoint":i.match(/word/)?o="Word":i.match(/zip/)?o="Zip":i.match(/powerpoint/)?o="PowerPoint":i.match(/html/)?o="HTML":i.match(/js/)?o="JavaScript":i.match(/css/)?o="CSS":i.match(/text\/plain/)&&(o="\u30C6\u30AD\u30B9\u30C8"),te(()=>{V&&setTimeout(()=>{P("#"+N).focus()},100)},[V]),d(O,{verticalAlign:"center",flexWrap:!1,gap:1,className:s,children:[t(L.File,{fontSize:"4.thirdTitle",fontColor:"4.thin"}),d(y,{flexSizing:0,children:[t(y,{children:t(O,{verticalAlign:"center",gap:"2/3",flexWrap:!1,className:m("FileName"),children:V?t(G,{children:d(Y,{gap:"1/2",flexSizing:0,children:[d(O,{gap:"2/3",verticalAlign:"center",children:[t(re.Normal,{tone:"border",wrapStyles:{flexSizing:"auto"},restrict:"fileName",name:"name",required:!0,id:N,form:"form-"+N,enableFormSubmit:!0,value:J,onKeyDown:f=>{let{key:k}=f;k=="Escape"&&b(!1)}}),d(y,{children:[". ",M]})]}),d(O,{gap:"2/3",horizontalAlign:"right",flexWrap:!1,children:[t(W.Button.Sub.R,{padding:["2/3",1],children:"\u9589\u3058\u308B",onClick:()=>{b(!1)}}),t(W.Button.Prime.R,{padding:["2/3",1],submitOption:{formName:"form-"+N,callback:f=>$(void 0,null,function*(){let{name:k}=f,w=[...n.dataValue],T=w[a],U=T.id;if(!T)return;let{target:r}=yield T.read();if(!r)return;let D=yield String(r.result).toBlob(l.type);if(!D)return;let z=new File([D],k+"."+M,{type:T.type});z.id=U,w[a]=z,p(x(g({},n),{dataValue:w,eventType:"update",eventID:h.uuid.gen()})),b(!1)})},children:"\u6C7A\u5B9A"})]})]})}):d(G,{children:[u,c?t(W.Button.Clear.R,{ssSphere:2.5,flexSizing:"none",color:"cloud",fontColor:"4.thin",padding:"1/3",ssEffectsOnActive:"expand",onClick:()=>{b(!0)},children:t(L.Pen,{})}):null]})})}),V?null:t(G,{children:t(y,{fontSize:"1.mini",fontColor:"4.thin",flexSizing:0,children:o+"\u30D5\u30A1\u30A4\u30EB / "+_+"B"})})]}),t(W.Button.Sub.R,{color:"cloud",fontColor:"4.thin",ssSphere:3,onClick:()=>{let f=[...n.dataValue];f[a]&&(f.splice(a,1),p(x(g({},n),{dataValue:f,eventType:"update",eventID:h.uuid.gen()})))},children:t(L.Times,{})})]})}},ce=e=>{let Z=e,{tone:a,required:l,form:s,fileNameEdit:n=!0,systemOnly:p=!1,accept:c="*",limit:u=1,checkValidationAtFirst:S,onChange:i,onValidate:V,onUpdateValue:b,onUpdateValidValue:N,value:_=[],className:J,cellStyles:M,cellClassName:o,componentID:f,status_id:k,enableFormSubmit:w}=Z,T=Q(Z,["tone","required","form","fileNameEdit","systemOnly","accept","limit","checkValidationAtFirst","onChange","onValidate","onUpdateValue","onUpdateValidValue","value","className","cellStyles","cellClassName","componentID","status_id","enableFormSubmit"]),U={componentID:e.componentID||"",dataValue:_,eventType:"init",eventID:h.uuid.gen()},[r,B]=q(U),[D,z]=q({ok:!1,notice:[]});oe({type:"file",params:e,val_status:r,set_status:B,val_validate:D,set_validate:z,DefaultValidation:ue,onUpdateValue:b,onUpdateValidValue:N,ExtraOverrideParams:{dataValue:_,formatValue:_},ExtraStoreParams:{AddFiles:A=>$(void 0,null,function*(){let R=X.get(r.componentID).Files,v=[];for(var F=0;F<(A==null?void 0:A.length);F++){let I=A[F],{type:E,name:C}=I;if(F+1+R.length>u){H.add({componentID:C,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u9078\u629E\u4E0A\u9650\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${C}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}if(c&&c=="image"&&!E.match(/image/)){H.add({componentID:C,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u304C\u7570\u306A\u308B\u305F\u3081\u3001${C} \u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}v.push(I)}B(x(g({},r),{dataValue:[...R,...v],eventType:"update",eventID:h.uuid.gen()}))})}});let j="";return c&&(c=="image"?j="image/png,image/jpeg":j=c),d(ie,{val_status:r,set_status:B,val_validate:D,params:e,children:[t("input",x(g({type:"file",className:m("Input"),"data-form":s,"data-input-type":"file","data-component-id":r.componentID,"data-validation":D.ok,accept:j,multiple:u!=1,onChange:A=>$(void 0,null,function*(){let R=A.target,v=R.files,F=[];for(var I=0;I<(v==null?void 0:v.length);I++){let E=v[I],C=E.name;if(E.id=h.uuid.gen(),I+1+r.dataValue.length>u){H.add({componentID:C,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u767B\u9332\u6570\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${C}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002`,backgroundColor:"nega"});continue}F.push(E)}B(x(g({},r),{dataValue:[...r.dataValue,...F],eventType:"update",eventID:h.uuid.gen()})),R.value=""})},T),{tabIndex:-1,value:""})),p?null:t(ee.List,{files:r.dataValue,params:e,val_status:r,set_status:B})]})};h(document).addEvent({eventType:"dragover",callback:e=>{e.preventDefault(),P("."+m("AddButton")).addClass(m("Draggable"))},
|
|
1
|
+
import{b as g,c as x,d as Q,e as $}from"../../chunk-VY3566IV.js";import{Fragment as G,jsx as t,jsxs as d}from"react/jsx-runtime";import{useState as q,useEffect as te}from"react";import{$$ as h,$$fromRoot as P,useStore as X,GenerateClassName as ae}from"../../@utils/_";import y from"../../atoms/Box";import L from"../../atoms/FAI";import O from"../../atoms/Flex";import Y from"../../mols/Column";import le from"../../mols/Row";import W from"../Button";import H from"../Snackbar";import{Wrapper as ne,BoxWrapper as ie,CommonEffects as oe,DefaultStyles as se}from"./core";import re from"./Text";import{InputFilerClasses as m}from"../../@styles/componentClasses/_";import{faCloudArrowUp as pe}from"@fortawesome/free-solid-svg-icons/faCloudArrowUp";function ue(e){let{value:a,params:l}=e,{required:s}=l,n=[];return s&&!a.length&&n.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!n.filter(({type:p})=>p=="invalid").length,notice:n}}const ee={List:e=>{let{files:a,params:l,val_status:s,set_status:n}=e,p=(l.limit||1)-s.dataValue.length,c=a.map((u,S)=>t(ee.Cell,{index:S,file:u,className:l.cellClassName,val_status:s,set_status:n,fileNameEdit:l.fileNameEdit},u.name));return p>0&&c.push(t("label",{className:[l.cellClassName,m("AddButton")].join(" "),"data-component-id":s.componentID,htmlFor:l.id,tabIndex:l.tabIndex,onKeyDown:u=>{let{key:S}=u;l.tabIndex!=-1&&[" ","Enter"].includes(S)&&P("#"+l.id).click()},children:d(le.Center,{padding:["1/3",0],children:[t(y,{isRounded:!0,className:m("AddIcon"),children:t(L,{icon:pe,className:m("Icon"),fontColor:"theme",fontSize:"4.thirdTitle",backgroundColor:"tcOpLow",ssSphere:3,padding:"1/2"})}),d(y,{children:[t(y,{children:`\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\uFF08${p}\uFF09`,fontColor:"theme",fontSize:"2.normal",isSemiBoldFont:!0}),t(y,{isSemiBoldFont:!0,fontColor:"4.thin",fontSize:"0.xs",children:"\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7"})]})]})},"AddButton")),t(Y,{flexSizing:"auto",className:l.className,children:c})},Cell:e=>{let{index:a,file:l,className:s,val_status:n,set_status:p,fileNameEdit:c=!0}=e,{name:u,size:S,type:i}=l,[V,b]=q(!1),N=h.uuid.gen(),_=S.rank(),[J,M]=u.replace(/\s/,"").replace(/(.*)\.(.*)$/,"$1 $2").split(" "),o="\u30D5\u30A1\u30A4\u30EB";return i.match(/image/)?o=i.replace(/image\//,""):i.match(/pdf/)?o="PDF":i.match(/csv/)?o="CSV":i.match(/spreadsheet/)?o="SpreadSheet":i.match(/presentation/)?o="PowerPoint":i.match(/word/)?o="Word":i.match(/zip/)?o="Zip":i.match(/powerpoint/)?o="PowerPoint":i.match(/html/)?o="HTML":i.match(/js/)?o="JavaScript":i.match(/css/)?o="CSS":i.match(/text\/plain/)&&(o="\u30C6\u30AD\u30B9\u30C8"),te(()=>{V&&setTimeout(()=>{P("#"+N).focus()},100)},[V]),d(O,{verticalAlign:"center",flexWrap:!1,gap:1,className:s,children:[t(L.File,{fontSize:"4.thirdTitle",fontColor:"4.thin"}),d(y,{flexSizing:0,children:[t(y,{children:t(O,{verticalAlign:"center",gap:"2/3",flexWrap:!1,className:m("FileName"),children:V?t(G,{children:d(Y,{gap:"1/2",flexSizing:0,children:[d(O,{gap:"2/3",verticalAlign:"center",children:[t(re.Normal,{tone:"border",wrapStyles:{flexSizing:"auto"},restrict:"fileName",name:"name",required:!0,id:N,form:"form-"+N,enableFormSubmit:!0,value:J,onKeyDown:f=>{let{key:k}=f;k=="Escape"&&b(!1)}}),d(y,{children:[". ",M]})]}),d(O,{gap:"2/3",horizontalAlign:"right",flexWrap:!1,children:[t(W.Button.Sub.R,{padding:["2/3",1],children:"\u9589\u3058\u308B",onClick:()=>{b(!1)}}),t(W.Button.Prime.R,{padding:["2/3",1],submitOption:{formName:"form-"+N,callback:f=>$(void 0,null,function*(){let{name:k}=f,w=[...n.dataValue],T=w[a],U=T.id;if(!T)return;let{target:r}=yield T.read();if(!r)return;let D=yield String(r.result).toBlob(l.type);if(!D)return;let z=new File([D],k+"."+M,{type:T.type});z.id=U,w[a]=z,p(x(g({},n),{dataValue:w,eventType:"update",eventID:h.uuid.gen()})),b(!1)})},children:"\u6C7A\u5B9A"})]})]})}):d(G,{children:[u,c?t(W.Button.Clear.R,{ssSphere:2.5,flexSizing:"none",color:"cloud",fontColor:"4.thin",padding:"1/3",ssEffectsOnActive:"expand",onClick:()=>{b(!0)},children:t(L.Pen,{})}):null]})})}),V?null:t(G,{children:t(y,{fontSize:"1.mini",fontColor:"4.thin",flexSizing:0,children:o+"\u30D5\u30A1\u30A4\u30EB / "+_+"B"})})]}),t(W.Button.Sub.R,{color:"cloud",fontColor:"4.thin",ssSphere:3,onClick:()=>{let f=[...n.dataValue];f[a]&&(f.splice(a,1),p(x(g({},n),{dataValue:f,eventType:"update",eventID:h.uuid.gen()})))},children:t(L.Times,{})})]})}},ce=e=>{let Z=e,{tone:a,required:l,form:s,fileNameEdit:n=!0,systemOnly:p=!1,accept:c="*",limit:u=1,checkValidationAtFirst:S,onChange:i,onValidate:V,onUpdateValue:b,onUpdateValidValue:N,value:_=[],className:J,cellStyles:M,cellClassName:o,componentID:f,status_id:k,enableFormSubmit:w}=Z,T=Q(Z,["tone","required","form","fileNameEdit","systemOnly","accept","limit","checkValidationAtFirst","onChange","onValidate","onUpdateValue","onUpdateValidValue","value","className","cellStyles","cellClassName","componentID","status_id","enableFormSubmit"]),U={componentID:e.componentID||"",dataValue:_,eventType:"init",eventID:h.uuid.gen()},[r,B]=q(U),[D,z]=q({ok:!1,notice:[]});oe({type:"file",params:e,val_status:r,set_status:B,val_validate:D,set_validate:z,DefaultValidation:ue,onUpdateValue:b,onUpdateValidValue:N,ExtraOverrideParams:{dataValue:_,formatValue:_},ExtraStoreParams:{AddFiles:A=>$(void 0,null,function*(){let R=X.get(r.componentID).Files,v=[];for(var F=0;F<(A==null?void 0:A.length);F++){let I=A[F],{type:E,name:C}=I;if(F+1+R.length>u){H.add({componentID:C,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u9078\u629E\u4E0A\u9650\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${C}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}if(c&&c=="image"&&!E.match(/image/)){H.add({componentID:C,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u5F62\u5F0F\u304C\u7570\u306A\u308B\u305F\u3081\u3001${C} \u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3002`,backgroundColor:"nega"});continue}v.push(I)}B(x(g({},r),{dataValue:[...R,...v],eventType:"update",eventID:h.uuid.gen()}))})}});let j="";return c&&(c=="image"?j="image/png,image/jpeg":j=c),d(ie,{val_status:r,set_status:B,val_validate:D,params:e,children:[t("input",x(g({type:"file",className:m("Input"),"data-form":s,"data-input-type":"file","data-component-id":r.componentID,"data-validation":D.ok,accept:j,multiple:u!=1,onChange:A=>$(void 0,null,function*(){let R=A.target,v=R.files,F=[];for(var I=0;I<(v==null?void 0:v.length);I++){let E=v[I],C=E.name;if(E.id=h.uuid.gen(),I+1+r.dataValue.length>u){H.add({componentID:C,secondsToClose:12e3,children:`\u30D5\u30A1\u30A4\u30EB\u767B\u9332\u6570\u3092\u8D85\u3048\u305F\u305F\u3081\u3001${C}}\u306F\u8FFD\u52A0\u3067\u304D\u307E\u305B\u3093\u3067\u3057\u305F\u3002`,backgroundColor:"nega"});continue}F.push(E)}B(x(g({},r),{dataValue:[...r.dataValue,...F],eventType:"update",eventID:h.uuid.gen()})),R.value=""})},T),{tabIndex:-1,value:""})),p?null:t(ee.List,{files:r.dataValue,params:e,val_status:r,set_status:B})]})};h(document).addEvent({eventType:"dragover",callback:e=>{e.preventDefault(),P("."+m("AddButton")).addClass(m("Draggable"))},options:{passive:!1}}).addEvent({eventType:"drop",callback:e=>{e.preventDefault(),P("."+m("AddButton")).removeClass(m("Draggable"));let a=e.dataTransfer.files;if(a.length){let l=e.target;if(P(l).hasClass(m("AddButton"))){let{componentId:s}=l.dataset,n=X.get(s);n&&n.AddFiles&&n.AddFiles(a)}}},options:{passive:!1}});const K=e=>{e=g({},e),e.override="force";let a=ae(e);return a.cellClassName=[a.cellClassName,se.Boxish(x(g({},a.cellStyles),{tone:a.tone})).className].join(" "),t(ne,{componentID:e.componentID,children:ce,params:a})};K.fn={openDialog:e=>{let{multiple:a,accept:l}=e;return new Promise(s=>{const n=document.createElement("input");n.type="file",n.multiple=a!=null?a:!0,l&&(l=="image"?n.accept="image/png,image/jpeg":n.accept=l),n.onchange=p=>{s(p.target.files)},n.click()})}};export{K as Filer,K as default};
|
package/dist/fn/Input/Slider.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as I,c as T,d as B}from"../../chunk-VY3566IV.js";import{jsx as d,jsxs as M}from"react/jsx-runtime";import{useState as A,useEffect as P}from"react";import{$$ as c,$$fromRoot as L,useStore as E,GenerateClassName as q}from"../../@utils/_";import x from"../../atoms/Box";import F from"../../atoms/Flex";import O from"../../mols/Column";import G from"../Button";import{Wrapper as X,BoxWrapper as j,SubmitForm as J,CommonEffects as Q}from"./core";import Y from"./Hidden";import{InputSliderClasses as v}from"../../@styles/componentClasses/_";function Z(a){let{value:e,params:o}=a,{required:n}=o,s=[];return n&&!e&&s.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!s.filter(({type:i})=>i=="invalid").length,notice:s}}const N=a=>{let{value:e,val_status:o}=a,{min:n,max:s,step:i}=o;e=Math.max(e,n),e=Math.min(e,s);let t=e/s*s;return t=Math.round(t/i),{stepValue:t*i,stepIndex:t,positionLeft:t*i/s*100+"%"}},z={IndicatorLabels:a=>{let{componentID:e,min:o,max:n,step:s,customLegends:i}=a,r=[],t=Math.round(o/s),p=Math.round(n/s),f=p-t+1;for(var u=t;u<=p;u++){let l=u*s;l=Math.max(l,o),l=Math.min(l,n);let g=l/n*100+"%";r.push(d(x,{className:v("Label"),id:"Legend-"+e+"-"+u,display:u==t||u==p?"flex":"none",position:"absolute",top:0,unitHeight:1,unitWidth:1.5,transition:"middle",fontColor:"1.clear",freeCSS:{left:g,whiteSpace:"nowrap",textAlign:"center"},verticalAlign:"center",horizontalAlign:"center",children:i?i(l):l.rank()},l))}return P(()=>{const l=()=>{let g=L("#Labels-"+e),{width:S}=g.position(),C=Math.round(S/50)-1,y=Math.round(f/C);for(let m=t+1;m<p;m++)L("#Legend-"+e+"-"+m).css({display:m%y==0?"flex":"none"})};return c(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{c(window).removeEvent("SliderResizeCallback-"+e)}},[]),d(F,{className:v("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:d(x,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:r})})},Rail:a=>{let{val_status:e,set_status:o,DotData:n,form:s,enableFormSubmit:i}=a,{componentID:r}=e;return M(F,{className:v("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{minWidth:"10rem",zIndex:1,cursor:"pointer"},onMouseDown:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},onTouchStart:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},children:[d(x,{className:v("Bar"),backgroundColor:"4.layer.darken",position:"relative",borderRadius:"sphere",transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:r+"_Bar",children:d(x,{className:v("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:a.color,opacity:"middle",overflow:"hidden",freeCSS:{width:n.positionLeft},id:r+"_BarColor"})}),d(x,{className:v("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:d(G.Button.Plain,{className:v("Ball"),position:"absolute",backgroundColor:a.color,top:0,left:0,ssSphere:1.5,freeCSS:{zIndex:2,left:n.positionLeft},"data-form-name":s,id:r+"_Ball",onKeyDown:t=>{b.KeyDownEvent({event:t,val_status:e,set_status:o,DotData:n}),i&&J(t)}})})]})}},b={Effects:{Start:(a,e)=>{c(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:o=>{b.Effects.Move(o,e)},
|
|
1
|
+
import{b as I,c as T,d as B}from"../../chunk-VY3566IV.js";import{jsx as d,jsxs as M}from"react/jsx-runtime";import{useState as A,useEffect as P}from"react";import{$$ as c,$$fromRoot as L,useStore as E,GenerateClassName as q}from"../../@utils/_";import x from"../../atoms/Box";import F from"../../atoms/Flex";import O from"../../mols/Column";import G from"../Button";import{Wrapper as X,BoxWrapper as j,SubmitForm as J,CommonEffects as Q}from"./core";import Y from"./Hidden";import{InputSliderClasses as v}from"../../@styles/componentClasses/_";function Z(a){let{value:e,params:o}=a,{required:n}=o,s=[];return n&&!e&&s.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!s.filter(({type:i})=>i=="invalid").length,notice:s}}const N=a=>{let{value:e,val_status:o}=a,{min:n,max:s,step:i}=o;e=Math.max(e,n),e=Math.min(e,s);let t=e/s*s;return t=Math.round(t/i),{stepValue:t*i,stepIndex:t,positionLeft:t*i/s*100+"%"}},z={IndicatorLabels:a=>{let{componentID:e,min:o,max:n,step:s,customLegends:i}=a,r=[],t=Math.round(o/s),p=Math.round(n/s),f=p-t+1;for(var u=t;u<=p;u++){let l=u*s;l=Math.max(l,o),l=Math.min(l,n);let g=l/n*100+"%";r.push(d(x,{className:v("Label"),id:"Legend-"+e+"-"+u,display:u==t||u==p?"flex":"none",position:"absolute",top:0,unitHeight:1,unitWidth:1.5,transition:"middle",fontColor:"1.clear",freeCSS:{left:g,whiteSpace:"nowrap",textAlign:"center"},verticalAlign:"center",horizontalAlign:"center",children:i?i(l):l.rank()},l))}return P(()=>{const l=()=>{let g=L("#Labels-"+e),{width:S}=g.position(),C=Math.round(S/50)-1,y=Math.round(f/C);for(let m=t+1;m<p;m++)L("#Legend-"+e+"-"+m).css({display:m%y==0?"flex":"none"})};return c(window).addEvent({eventID:"SliderResizeCallback-"+e,eventType:"resize",callback:()=>{l()}}),l(),()=>{c(window).removeEvent("SliderResizeCallback-"+e)}},[]),d(F,{className:v("Labels"),verticalAlign:"center",horizontalAlign:"between",fontSize:"0.xs",position:"relative",unitHeight:1,id:"Labels-"+e,children:d(x,{position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:r})})},Rail:a=>{let{val_status:e,set_status:o,DotData:n,form:s,enableFormSubmit:i}=a,{componentID:r}=e;return M(F,{className:v("Rail"),position:"relative",paddingLeft:"1/2",unitHeight:1.5,verticalAlign:"center",freeCSS:{minWidth:"10rem",zIndex:1,cursor:"pointer"},onMouseDown:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},onTouchStart:t=>{t.stopPropagation(),b.Effects.Start(t,{val_status:e,set_status:o,DotData:n})},children:[d(x,{className:v("Bar"),backgroundColor:"4.layer.darken",position:"relative",borderRadius:"sphere",transition:"middle",flexSizing:"none",unitHeight:"2/3",width:1,id:r+"_Bar",children:d(x,{className:v("BarColor"),position:"relative",height:1,width:0,left:0,transition:"long",borderRadius:"inherit",backgroundColor:a.color,opacity:"middle",overflow:"hidden",freeCSS:{width:n.positionLeft},id:r+"_BarColor"})}),d(x,{className:v("BallWrap"),position:"absolute",top:0,left:0,bottom:0,freeCSS:{right:12*1.5},children:d(G.Button.Plain,{className:v("Ball"),position:"absolute",backgroundColor:a.color,top:0,left:0,ssSphere:1.5,freeCSS:{zIndex:2,left:n.positionLeft},"data-form-name":s,id:r+"_Ball",onKeyDown:t=>{b.KeyDownEvent({event:t,val_status:e,set_status:o,DotData:n}),i&&J(t)}})})]})}},b={Effects:{Start:(a,e)=>{c(document).addEvent({eventID:"SliderMouseMove",eventType:"mousemove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderTouchMove",eventType:"touchmove",callback:o=>{b.Effects.Move(o,e)},options:{passive:!1}}).addEvent({eventID:"SliderMouseUp",eventType:"mouseup",callback:()=>{b.Effects.End()}}).addEvent({eventID:"SliderTouchEnd",eventType:"touchend",callback:()=>{b.Effects.End()}})},Move:(a,e)=>{let o=c.getCursor(a).x,{val_status:n,set_status:s}=e,{componentID:i,min:r,max:t}=n,p=L("#"+i+"_Ball"),f=L("#"+i+"_Bar"),u=L("#"+i+"_BarColor"),{width:l,left:g}=f.position(),S=(o-g)/l;S=Math.max(S,0),S=Math.min(S,1);let C=S*t,y=N({value:C,val_status:n}),m=y.positionLeft,D=y.stepValue;p.css({left:m}),u.css({width:m});let{prevValue:_}=E.get(i);return D!=_&&(E.update({key:i,value:{prevValue:D}}),s(T(I({},n),{dataValue:D,eventType:"update",eventID:c.uuid.gen()}))),a.preventDefault(),a.stopPropagation(),!1},End:()=>{c(document).removeEvent(["SliderMouseMove","SliderTouchMove","SliderMouseUp","SliderTouchEnd"])}},KeyDownEvent:a=>{let{event:e,val_status:o,set_status:n}=a,{min:s,max:i,step:r}=o,{key:t,metaKey:p,ctrlKey:f}=e,u=f||p,l=o.dataValue;t.match(/Arrow/)&&(e.preventDefault(),t.match(/Left|Up/)?u?l=s:l-=r:t.match(/Right|Down/)&&(u?l=i:l+=r),l=Math.max(Math.min(l,i),s),E.update({key:o.componentID,value:{prevValue:l}}),n(T(I({},o),{dataValue:l,eventType:"update",eventID:c.uuid.gen()})))}},ee=a=>{let k=a,{color:e="theme",required:o,form:n="",legends:{enable:s=!0,custom:i,showAlways:r=!1}={},min:t,max:p,step:f,enableFormSubmit:u,checkValidationAtFirst:l,onChange:g,onKeyDown:S,onValidate:C,onUpdateValue:y,onUpdateValidValue:m,value:D="",className:_}=k,K=B(k,["color","required","form","legends","min","max","step","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","className"]),W={componentID:a.componentID||"",dataValue:D,min:t,max:p,step:f,eventType:"init",eventID:c.uuid.gen()},[h,V]=A(W),[w,U]=A({ok:!1,notice:[]});Q({params:a,val_status:h,set_status:V,val_validate:w,set_validate:U,onUpdateValue:y,onUpdateValidValue:m,DefaultValidation:Z,ExtraOverrideParams:{dataValue:D},ExtraStoreParams:{prevValue:h.dataValue,setValueByForeign:$=>{V(T(I({},h),{dataValue:$,eventType:"update",eventID:c.uuid.gen()}))}}});let R=N({value:h.dataValue,val_status:h});return M(j,{val_status:h,set_status:V,val_validate:w,params:a,children:[d(Y,I({value:R.stepValue,form:n,"data-value":R.stepValue,"data-validation":w.ok,"data-input-type":"slider"},K)),M(O,{gap:"1/2",flexSizing:"auto",className:[v("Wrap"),_,v("ShowLegendsAlways_"+r)].join(" "),children:[d(z.Rail,{color:e,val_status:h,set_status:V,DotData:R,form:n,enableFormSubmit:u}),s?d(z.IndicatorLabels,{componentID:h.componentID,min:t,max:p,step:f,customLegends:i}):null]})]})},H=a=>(a=I({},a),d(X,{componentID:a.componentID,children:ee,params:q(a)}));export{H as Slider,H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as f,c as T,d as k}from"../../chunk-VY3566IV.js";import{jsx as I}from"react/jsx-runtime";import{useState as L,useEffect as M,useRef as N}from"react";import{$$ as c,$$fromRoot as h,useStore as X}from"../../@utils/_";import R from"../../atoms/Box";import j from"../../atoms/Flex";import{LayoutClasses as a}from"../../@styles/componentClasses/_";const B=t=>{let D=t,{options:{onSlideCallback:e,visibilitySurroundSlide:u=!0,autoSwipems:d=0,loop:i=!1,disableMousedrag:r=!1,disableTouch:o=!1}={},wrapper:s=n=>n,slides:v=[]}=D,E=k(D,["options","wrapper","slides"]),[w]=L(c.uuid.gen()),[p,y]=L({eventType:"init",index:t.slideIndex});M(()=>{X.set({key:"SwipeTimer-"+w,value:null})},[]);const g=N(!1);M(()=>{y({eventType:"usr",index:t.slideIndex}),g.current||(g.current=!0)},[t.slideIndex]),M(()=>{let n=p.index+(i?1:0),m=[-1,v.length].includes(p.index);m||e&&setTimeout(()=>{e(p.index)},300);let b=h("#Swiper-"+w);if(p.eventType=="adjustLoop")b.await(250).css({transition:"0s",transform:l.TrasformString(n)}).children().removeClass(a("Display")).parent().children(n).addClass([a("Display"),a("LoopAdjusting")]).await(100).removeClass(a("LoopAdjusting"));else if(p.eventType=="sys")b.await(250).css({transform:l.TrasformString(n)}).children().removeClass(a("Display")).parent().children(n).addClass(a("Display"));else if(b.children().removeClass(a("Display")).parent().children(n).addClass(a("Display")).parent().css({transition:"0.3s",transform:l.TrasformString(n)}).await(250).css({transition:"0s"}),m){let x=p.index==-1?v.length-1:0;y({eventType:"adjustLoop",index:x})}d&&!m&&(c.interval.clear("SwipeTimer-"+w),c.interval.standBy("SwipeTimer-"+w,d-(p.eventType=="sys"?310:0),()=>{let x=p.index+1;!i&&x>v.length-1&&(x=0),y({eventType:"usr",index:x})}))},[p]);let S=v.map((n,m)=>I(R,{flexSizing:"none",width:1,height:0,className:a("Child"),children:s(n)},m));i&&(S.push(S[0]),S.unshift(S[S.length-2]));let C={x:0,y:0,process:!1,effectStartAt:0,id:w,loop:i,index:p.index,minIndex:i?-1:0,maxIndex:v.length+(i?1:-1),width:0,set_event:y},A=p.index+(i?1:0);return I(R,T(f({overflow:"hidden",position:"relative"},E),{className:[E.className,a("SwipeView")].join(" "),freeCSS:f({zIndex:1},E.freeCSS),"data-swipe-id":w,onMouseDown:n=>{r||n.buttons==1&&l.EffectStart(n,C)},onTouchStart:n=>{var m;o||((m=n.touches)==null?void 0:m.length)==1&&l.EffectStart(n,C)},children:I(j,{flexWrap:!1,gap:1,transition:"long",className:[a("Rail"),a("ShowOther_"+u)].join(" "),id:"Swiper-"+w,freeCSS:f({},g.current?{}:{transform:l.TrasformString(A)}),children:S})}))},l={TrasformString:t=>`translateX( calc( ${-100*t}% - ${12*t}px ) )`,EffectStart:(t,e)=>{let{x:u,y:d}=c.getCursor(t),i=t.currentTarget,r=t.target;if(["SELECT","BUTTON","LABEL","INPUT"].includes(r.tagName))return;e=T(f({},e),{x:u-e.x+window.scrollX,y:d-e.y+window.scrollY,effectStartAt:new Date().getTime(),width:h("#Swiper-"+e.id).position().width});let{swipeId:o}=i.dataset;o==e.id&&c(document).addEvent({eventID:"SwipeMouseMove",eventType:"mousemove",callback:s=>{l.EffectCheck(s,e)},
|
|
1
|
+
import{b as f,c as T,d as k}from"../../chunk-VY3566IV.js";import{jsx as I}from"react/jsx-runtime";import{useState as L,useEffect as M,useRef as N}from"react";import{$$ as c,$$fromRoot as h,useStore as X}from"../../@utils/_";import R from"../../atoms/Box";import j from"../../atoms/Flex";import{LayoutClasses as a}from"../../@styles/componentClasses/_";const B=t=>{let D=t,{options:{onSlideCallback:e,visibilitySurroundSlide:u=!0,autoSwipems:d=0,loop:i=!1,disableMousedrag:r=!1,disableTouch:o=!1}={},wrapper:s=n=>n,slides:v=[]}=D,E=k(D,["options","wrapper","slides"]),[w]=L(c.uuid.gen()),[p,y]=L({eventType:"init",index:t.slideIndex});M(()=>{X.set({key:"SwipeTimer-"+w,value:null})},[]);const g=N(!1);M(()=>{y({eventType:"usr",index:t.slideIndex}),g.current||(g.current=!0)},[t.slideIndex]),M(()=>{let n=p.index+(i?1:0),m=[-1,v.length].includes(p.index);m||e&&setTimeout(()=>{e(p.index)},300);let b=h("#Swiper-"+w);if(p.eventType=="adjustLoop")b.await(250).css({transition:"0s",transform:l.TrasformString(n)}).children().removeClass(a("Display")).parent().children(n).addClass([a("Display"),a("LoopAdjusting")]).await(100).removeClass(a("LoopAdjusting"));else if(p.eventType=="sys")b.await(250).css({transform:l.TrasformString(n)}).children().removeClass(a("Display")).parent().children(n).addClass(a("Display"));else if(b.children().removeClass(a("Display")).parent().children(n).addClass(a("Display")).parent().css({transition:"0.3s",transform:l.TrasformString(n)}).await(250).css({transition:"0s"}),m){let x=p.index==-1?v.length-1:0;y({eventType:"adjustLoop",index:x})}d&&!m&&(c.interval.clear("SwipeTimer-"+w),c.interval.standBy("SwipeTimer-"+w,d-(p.eventType=="sys"?310:0),()=>{let x=p.index+1;!i&&x>v.length-1&&(x=0),y({eventType:"usr",index:x})}))},[p]);let S=v.map((n,m)=>I(R,{flexSizing:"none",width:1,height:0,className:a("Child"),children:s(n)},m));i&&(S.push(S[0]),S.unshift(S[S.length-2]));let C={x:0,y:0,process:!1,effectStartAt:0,id:w,loop:i,index:p.index,minIndex:i?-1:0,maxIndex:v.length+(i?1:-1),width:0,set_event:y},A=p.index+(i?1:0);return I(R,T(f({overflow:"hidden",position:"relative"},E),{className:[E.className,a("SwipeView")].join(" "),freeCSS:f({zIndex:1},E.freeCSS),"data-swipe-id":w,onMouseDown:n=>{r||n.buttons==1&&l.EffectStart(n,C)},onTouchStart:n=>{var m;o||((m=n.touches)==null?void 0:m.length)==1&&l.EffectStart(n,C)},children:I(j,{flexWrap:!1,gap:1,transition:"long",className:[a("Rail"),a("ShowOther_"+u)].join(" "),id:"Swiper-"+w,freeCSS:f({},g.current?{}:{transform:l.TrasformString(A)}),children:S})}))},l={TrasformString:t=>`translateX( calc( ${-100*t}% - ${12*t}px ) )`,EffectStart:(t,e)=>{let{x:u,y:d}=c.getCursor(t),i=t.currentTarget,r=t.target;if(["SELECT","BUTTON","LABEL","INPUT"].includes(r.tagName))return;e=T(f({},e),{x:u-e.x+window.scrollX,y:d-e.y+window.scrollY,effectStartAt:new Date().getTime(),width:h("#Swiper-"+e.id).position().width});let{swipeId:o}=i.dataset;o==e.id&&c(document).addEvent({eventID:"SwipeMouseMove",eventType:"mousemove",callback:s=>{l.EffectCheck(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeTouchMove",eventType:"touchmove",callback:s=>{l.EffectCheck(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeMouseUp",eventType:"mouseup",callback:s=>{l.EffectEnd(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeTouchEnd",eventType:"touchend",callback:s=>{l.EffectEnd(s,e)},options:{passive:!1}})},EffectCheck:(t,e)=>{if(e.process)return;let{x:u,y:d}=c.getCursor(t),i=Math.abs(u-e.x+window.scrollX),r=Math.abs(d-e.y+window.scrollY);if(!(t.touches&&t.touches.length>1)&&!(r+i<15))if(r>i/2)c(document).removeEvent(["SwipeMouseMove","SwipeTouchMove"]);else{e.process=!0;let o=e.index+(e.loop?1:0);h("#Swiper-"+e.id).children(o-1).addClass(a("Display")),c(document).addEvent({eventID:"SwipeCheckMouseMove",eventType:"mousemove",callback:s=>{l.EffectMove(s,e)},options:{passive:!1}}).addEvent({eventID:"SwipeCheckTouchMove",eventType:"touchmove",callback:s=>{l.EffectMove(s,e)},options:{passive:!1}}),t.preventDefault();return}},EffectMove:(t,e)=>{if(t.touches&&t.touches.length>1)return;let{x:u}=c.getCursor(t),d=u-e.x+window.scrollX,r=e.index+(e.loop?1:0)-d/e.width;if(r<0)r/=2;else if(r>e.maxIndex){let o=r-e.maxIndex;r=e.maxIndex+o/2}h("#Swiper-"+e.id).css({transition:"0s",transform:l.TrasformString(r)}),t.preventDefault()},EffectEnd:(t,e)=>{if(e.process){let d=c.getCursor(t).x-e.x+window.scrollX,i=new Date().getTime(),r=i-e.effectStartAt,o=e.index+(e.loop?1:0),s=0;r<400?s=o-(+(d>0)*2-1):s=Math.round(o-d/e.width),s=Math.max(Math.min(s,e.maxIndex),e.minIndex),e.process=!1,o===s?(e.effectStartAt=i,h("#Swiper-"+e.id).css({transition:".2s",transform:l.TrasformString(s)}).await(310).css({transition:"0s"}).children().removeClass(a("Display")).parent().children(o).addClass(a("Display"))):e.set_event({eventType:"usr",index:s+e.minIndex})}c(document).removeEvent(["SwipeMouseMove","SwipeTouchMove","SwipeCheckMouseMove","SwipeCheckTouchMove","SwipeMouseUp","SwipeTouchEnd"])}},V=t=>I(B,T(f({},t),{slideIndex:Math.max(Math.min(t.slideIndex,t.slides.length-1),0)}));export{V as SwipeView,V as default};
|
package/dist/fn/Table/Drag.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as r,c as w,e as I}from"../../chunk-VY3566IV.js";import{Fragment as J,jsx as s,jsxs as j}from"react/jsx-runtime";import{useState as k,useEffect as x}from"react";import{$$ as T,$$fromRoot as N,useStore as R}from"../../@utils/_";import v from"../../atoms/FAI";import M from"../Button";import L from"../Tooltips";import b from"./Parts";import z from"./Wrapper";import{faGripVertical as O}from"@fortawesome/free-solid-svg-icons/faGripVertical";import{DefaultCellSystemStyles as S}from"./cellStyling";import{TableClasses as g}from"../../@styles/componentClasses/_";const E={HeadRow:e=>{let{cellStyles:t={},cellClassName:d="",cellStylesCallback:a,colLength:n,head:o,rows:i}=e;if(!o)return null;let m=[];for(let p=0;p<n;p++){let c=o[p],D=b[c.type=="th"?"TH":"TD"];m.push(s(D,r(w(r(r(r({},t),S({top:!0,bottom:!i.length,left:p==0,right:p==n-1})),a?a({top:!0,bottom:!i.length,left:p==0,right:p==n-1,rowIndex:0,colIndex:p,isBody:!1,isHeader:!0}):{}),{className:[g("Cell"),d,c.className].join(" ")}),c)))}return s(b.Row,{className:[g("Row"),g("HeadRow")].join(" "),children:m})},BodyRows:e=>{let{cellStyles:t={},cellClassName:d="",cellStylesCallback:a,head:n,rows:o,colLength:i,onOrderChanged:m}=e,[p]=k(T.uuid.gen()),[c,D]=k({rows:o,origin:0,to:NaN}),B=[];if(c.rows.forEach((y,l)=>{let h=[];h.push(s(b.TH,w(r(r(r({padding:0,borderRight:!0},t),S({top:l==0&&!n,bottom:l==o.length-1,left:!0,right:!1})),a?a({top:l==0&&!n,bottom:l==o.length-1,left:!0,right:!1,rowIndex:l,colIndex:0,isBody:!0,isHeader:!1}):{}),{className:[g("Cell"),g("Draggable"),d].join(" "),children:s(M.Button.Clear.R,{className:g("DragableButton"),fontColor:"4.thin",fontSize:"3.paragraph",margin:"auto",tabIndex:-1,ssSphere:3,onMouseDown:u=>{C.Start(u,{id:p,index:l,rows:c.rows,maxLength:o.length})},onTouchStart:u=>{C.Start(u,{id:p,index:l,rows:c.rows,maxLength:o.length})},children:s(v,{icon:O})})}),"DragOrigin")),y.forEach((u,f)=>{u=r({},u);let H=b[u.type=="th"?"TH":"TD"];h.push(s(H,r(w(r(r(r({},t),S({top:!!n&&!n.length,bottom:l==o.length-1,left:!1,right:f==i-2})),a?a({top:!!n&&!n.length,bottom:l==o.length-1,left:!1,right:f==i-2,rowIndex:l,colIndex:f,isBody:!0,isHeader:!1}):{}),{className:[g("Cell"),d,u.className].join(" ")}),u)))}),B.push(s(b.Row,{id:"TableRow-"+p+"-"+l,"data-rowId":l,className:[g("Row"),g("BodyRow")].join(" "),children:h},l))}),!isNaN(c.to)){let{origin:y,to:l}=c,h=[];h.push(s(b.TH,{backgroundColor:"tcOpLow",padding:0,borderRight:"2.normal",className:[g("Cell"),g("Draggable"),d].join(" "),children:s(v.ArrowRight,{fontColor:"theme"})},"dragButton")),c.rows[y].forEach((f,H)=>{f=r({},f);let $=b[f.type=="th"?"TH":"TD"];h.push(s($,r(w(r(r(r({},t),S({top:!1,bottom:!1,left:!1,right:!1})),a?a({top:!1,bottom:!1,left:!1,right:!1,rowIndex:-1,colIndex:-1,isBody:!0,isHeader:!1}):{}),{className:[g("Cell"),d,f.className].join(" "),backgroundColor:"tcOpLow"}),f)))}),B.splice(l,0,s(b.Row,{className:[g("Row"),g("Pre")].join(" "),children:h},"preSet"))}return x(()=>{R.set({key:p,value:{swap:(y,l)=>{if(l||l==0){let h=c.rows[y],u=[...c.rows];u.splice(y,1),u.splice(l-(y<l?1:0),0,h),D({rows:u,origin:0,to:NaN}),m(u.map(f=>JSON.parse(f.rowID)))}},preSet:y=>{let{origin:l,index:h}=y;D({rows:c.rows,origin:l,to:h})}}})}),x(()=>()=>{R.delete(p)},[]),s(J,{children:B})},Drag:e=>(e=r({},e),e.colLength=e.colLength+1,e.head&&(e.head=[{children:s(M.Button.Clear.R,{ssSphere:3,fontSize:"3.paragraph",fontColor:"theme",onMouseOver:t=>{L.open({parent:t.currentTarget,content:j(L.Comps.Body,{children:[s(v,{icon:O}),"\u30DC\u30BF\u30F3\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u9806\u5E8F\u3092\u5909\u66F4"]})})},children:s(v.QuestionCircle,{})}),padding:[0,1],unitWidth:4},...e.head]),e.rows=e.rows.map((t,d)=>(t.rowID=JSON.stringify(t.rowID||d),t)),j(b.Table,{className:g("Table"),children:[s(E.HeadRow,r({},e)),s(E.BodyRows,r({},e))]}))},P=e=>s(z,w(r({type:"drag"},e),{JSXChildren:E.Drag})),C={Start:function(e,t){return I(this,null,function*(){e.stopPropagation(),e.preventDefault();let{id:d,index:a,rows:n,maxLength:o}=t;N("#TableRow-"+d+"-"+a).addClass(g("DraggerOrigin")),T(document).addEvent({eventID:"DragMouseMove",eventType:"mousemove",callback:i=>{C.Move(i,t)},
|
|
1
|
+
import{b as r,c as w,e as I}from"../../chunk-VY3566IV.js";import{Fragment as J,jsx as s,jsxs as j}from"react/jsx-runtime";import{useState as k,useEffect as x}from"react";import{$$ as T,$$fromRoot as N,useStore as R}from"../../@utils/_";import v from"../../atoms/FAI";import M from"../Button";import L from"../Tooltips";import b from"./Parts";import z from"./Wrapper";import{faGripVertical as O}from"@fortawesome/free-solid-svg-icons/faGripVertical";import{DefaultCellSystemStyles as S}from"./cellStyling";import{TableClasses as g}from"../../@styles/componentClasses/_";const E={HeadRow:e=>{let{cellStyles:t={},cellClassName:d="",cellStylesCallback:a,colLength:n,head:o,rows:i}=e;if(!o)return null;let m=[];for(let p=0;p<n;p++){let c=o[p],D=b[c.type=="th"?"TH":"TD"];m.push(s(D,r(w(r(r(r({},t),S({top:!0,bottom:!i.length,left:p==0,right:p==n-1})),a?a({top:!0,bottom:!i.length,left:p==0,right:p==n-1,rowIndex:0,colIndex:p,isBody:!1,isHeader:!0}):{}),{className:[g("Cell"),d,c.className].join(" ")}),c)))}return s(b.Row,{className:[g("Row"),g("HeadRow")].join(" "),children:m})},BodyRows:e=>{let{cellStyles:t={},cellClassName:d="",cellStylesCallback:a,head:n,rows:o,colLength:i,onOrderChanged:m}=e,[p]=k(T.uuid.gen()),[c,D]=k({rows:o,origin:0,to:NaN}),B=[];if(c.rows.forEach((y,l)=>{let h=[];h.push(s(b.TH,w(r(r(r({padding:0,borderRight:!0},t),S({top:l==0&&!n,bottom:l==o.length-1,left:!0,right:!1})),a?a({top:l==0&&!n,bottom:l==o.length-1,left:!0,right:!1,rowIndex:l,colIndex:0,isBody:!0,isHeader:!1}):{}),{className:[g("Cell"),g("Draggable"),d].join(" "),children:s(M.Button.Clear.R,{className:g("DragableButton"),fontColor:"4.thin",fontSize:"3.paragraph",margin:"auto",tabIndex:-1,ssSphere:3,onMouseDown:u=>{C.Start(u,{id:p,index:l,rows:c.rows,maxLength:o.length})},onTouchStart:u=>{C.Start(u,{id:p,index:l,rows:c.rows,maxLength:o.length})},children:s(v,{icon:O})})}),"DragOrigin")),y.forEach((u,f)=>{u=r({},u);let H=b[u.type=="th"?"TH":"TD"];h.push(s(H,r(w(r(r(r({},t),S({top:!!n&&!n.length,bottom:l==o.length-1,left:!1,right:f==i-2})),a?a({top:!!n&&!n.length,bottom:l==o.length-1,left:!1,right:f==i-2,rowIndex:l,colIndex:f,isBody:!0,isHeader:!1}):{}),{className:[g("Cell"),d,u.className].join(" ")}),u)))}),B.push(s(b.Row,{id:"TableRow-"+p+"-"+l,"data-rowId":l,className:[g("Row"),g("BodyRow")].join(" "),children:h},l))}),!isNaN(c.to)){let{origin:y,to:l}=c,h=[];h.push(s(b.TH,{backgroundColor:"tcOpLow",padding:0,borderRight:"2.normal",className:[g("Cell"),g("Draggable"),d].join(" "),children:s(v.ArrowRight,{fontColor:"theme"})},"dragButton")),c.rows[y].forEach((f,H)=>{f=r({},f);let $=b[f.type=="th"?"TH":"TD"];h.push(s($,r(w(r(r(r({},t),S({top:!1,bottom:!1,left:!1,right:!1})),a?a({top:!1,bottom:!1,left:!1,right:!1,rowIndex:-1,colIndex:-1,isBody:!0,isHeader:!1}):{}),{className:[g("Cell"),d,f.className].join(" "),backgroundColor:"tcOpLow"}),f)))}),B.splice(l,0,s(b.Row,{className:[g("Row"),g("Pre")].join(" "),children:h},"preSet"))}return x(()=>{R.set({key:p,value:{swap:(y,l)=>{if(l||l==0){let h=c.rows[y],u=[...c.rows];u.splice(y,1),u.splice(l-(y<l?1:0),0,h),D({rows:u,origin:0,to:NaN}),m(u.map(f=>JSON.parse(f.rowID)))}},preSet:y=>{let{origin:l,index:h}=y;D({rows:c.rows,origin:l,to:h})}}})}),x(()=>()=>{R.delete(p)},[]),s(J,{children:B})},Drag:e=>(e=r({},e),e.colLength=e.colLength+1,e.head&&(e.head=[{children:s(M.Button.Clear.R,{ssSphere:3,fontSize:"3.paragraph",fontColor:"theme",onMouseOver:t=>{L.open({parent:t.currentTarget,content:j(L.Comps.Body,{children:[s(v,{icon:O}),"\u30DC\u30BF\u30F3\u3092\u30C9\u30E9\u30C3\u30B0\u3057\u3066\u9806\u5E8F\u3092\u5909\u66F4"]})})},children:s(v.QuestionCircle,{})}),padding:[0,1],unitWidth:4},...e.head]),e.rows=e.rows.map((t,d)=>(t.rowID=JSON.stringify(t.rowID||d),t)),j(b.Table,{className:g("Table"),children:[s(E.HeadRow,r({},e)),s(E.BodyRows,r({},e))]}))},P=e=>s(z,w(r({type:"drag"},e),{JSXChildren:E.Drag})),C={Start:function(e,t){return I(this,null,function*(){e.stopPropagation(),e.preventDefault();let{id:d,index:a,rows:n,maxLength:o}=t;N("#TableRow-"+d+"-"+a).addClass(g("DraggerOrigin")),T(document).addEvent({eventID:"DragMouseMove",eventType:"mousemove",callback:i=>{C.Move(i,t)},options:{passive:!1}}).addEvent({eventID:"DragTouchMove",eventType:"touchmove",callback:i=>{C.Move(i,t)},options:{passive:!1}}).addEvent({eventID:"DragMouseUp",eventType:"mouseup",callback:i=>{C.End(i,t)}}).addEvent({eventID:"DragTouchEnd",eventType:"touchend",callback:i=>{C.End(i,t)}})})},Move:function(e,t){let{id:d,maxLength:a}=t,n=T.getCursor(e).y-T.getScreenSize().scrollY;for(let o=0;o<a;o++){let i=N("#TableRow-"+d+"-"+o),{top:m,bottom:p,height:c}=i.position();o==0&&n<m?t.insertIndex=0:o===a-1&&p<=n?t.insertIndex=a:n>=m&&n<p&&(t.insertIndex=o+1)}{let{index:o,insertIndex:i}=t,m=R.get(d);m&&m.preSet&&m.preSet({origin:o,index:i})}return e.stopPropagation(),e.preventDefault(),!1},End:function(e,t){let{id:d,index:a,insertIndex:n}=t,o=R.get(d);o&&o.swap&&o.swap(a,n),N("#TableRow-"+d+"-"+a).removeClass(g("DraggerOrigin")),T(document).removeEvent(["DragMouseMove","DragTouchMove","DragMouseUp","DragTouchEnd"])}};export{P as Drag,P as default};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "amotify",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.30",
|
|
4
4
|
"description": "UI FW for React",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"clean": "rimraf dist",
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@fortawesome/free-regular-svg-icons": "^6.5.2",
|
|
34
34
|
"@fortawesome/free-solid-svg-icons": "^6.5.1",
|
|
35
35
|
"@fortawesome/react-fontawesome": "^0.2.0",
|
|
36
|
-
"@mingoo/jsmin": "^0.0.
|
|
36
|
+
"@mingoo/jsmin": "^0.0.12",
|
|
37
37
|
"@types/express": "^4.17.21",
|
|
38
38
|
"@types/react": "^18.3.1",
|
|
39
39
|
"@types/react-dom": "^18.3.0",
|