amotify 0.1.58 → 0.1.59
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/@declaration/index.d.ts +10 -0
- package/dist/@declaration/index.js +1 -0
- package/dist/@declaration/module.d.ts +5 -0
- package/dist/@declaration/module.js +0 -0
- package/dist/@declaration/property.d.ts +139 -0
- package/dist/@declaration/property.js +0 -0
- package/dist/@styles/componentClasses/index.css +1502 -0
- package/dist/@styles/componentClasses/index.d.ts +23 -0
- package/dist/@styles/componentClasses/index.js +398 -0
- package/dist/@styles/index.css +1502 -0
- package/dist/@styles/index.d.ts +1 -0
- package/dist/@styles/index.js +398 -0
- package/dist/@styles/init.css +89 -0
- package/dist/@styles/init.d.ts +1 -0
- package/dist/@styles/init.js +0 -0
- package/dist/@styles/style.css +7407 -0
- package/dist/@styles/style.d.ts +4 -0
- package/dist/@styles/style.js +398 -0
- package/dist/@styles/var.css +1258 -0
- package/dist/@styles/var.d.ts +1 -0
- package/dist/@styles/var.js +0 -0
- package/dist/@utils/GenerateClassName.d.ts +11 -0
- package/dist/@utils/GenerateClassName.js +1 -0
- package/dist/@utils/LaunchReactApp.d.ts +20 -0
- package/dist/@utils/LaunchReactApp.js +1 -0
- package/dist/@utils/collectForm.d.ts +11 -0
- package/dist/@utils/collectForm.js +1 -0
- package/dist/@utils/color.d.ts +21 -0
- package/dist/@utils/color.js +1 -0
- package/dist/@utils/config.d.ts +43 -0
- package/dist/@utils/config.js +1 -0
- package/dist/@utils/fin.d.ts +1 -0
- package/dist/@utils/fin.js +1 -0
- package/dist/@utils/getElement.d.ts +6 -0
- package/dist/@utils/getElement.js +1 -0
- package/dist/@utils/index.d.ts +11 -0
- package/dist/@utils/index.js +1 -0
- package/dist/@utils/pageTransit.d.ts +11 -0
- package/dist/@utils/pageTransit.js +1 -0
- package/dist/@utils/useRecycle.d.ts +8 -0
- package/dist/@utils/useRecycle.js +1 -0
- package/dist/@utils/useStore.d.ts +18 -0
- package/dist/@utils/useStore.js +1 -0
- package/dist/atoms/Box.d.ts +9 -0
- package/dist/atoms/Box.js +1 -0
- package/dist/atoms/FAI.d.ts +18 -0
- package/dist/atoms/FAI.js +1 -0
- package/dist/atoms/Flex.d.ts +11 -0
- package/dist/atoms/Flex.js +1 -0
- package/dist/atoms/Grid.d.ts +4 -0
- package/dist/atoms/Grid.js +1 -0
- package/dist/atoms/Img.d.ts +11 -0
- package/dist/atoms/Img.js +1 -0
- package/dist/atoms/Logo.d.ts +40 -0
- package/dist/atoms/Logo.js +51 -0
- package/dist/atoms/P.d.ts +9 -0
- package/dist/atoms/P.js +1 -0
- package/dist/atoms/Placeholder.d.ts +9 -0
- package/dist/atoms/Placeholder.js +1 -0
- package/dist/atoms/Span.d.ts +9 -0
- package/dist/atoms/Span.js +1 -0
- package/dist/atoms/index.d.ts +9 -0
- package/dist/atoms/index.js +1 -0
- package/dist/chunk-VY3566IV.js +1 -0
- package/dist/fn/Button.d.ts +82 -0
- package/dist/fn/Button.js +1 -0
- package/dist/fn/Cropper.d.ts +26 -0
- package/dist/fn/Cropper.js +1 -0
- package/dist/fn/Effect/Fade.d.ts +17 -0
- package/dist/fn/Effect/Fade.js +1 -0
- package/dist/fn/Effect/Pudding.d.ts +8 -0
- package/dist/fn/Effect/Pudding.js +1 -0
- package/dist/fn/Effect/Ripple.d.ts +8 -0
- package/dist/fn/Effect/Ripple.js +3 -0
- package/dist/fn/Effect/index.d.ts +11 -0
- package/dist/fn/Effect/index.js +1 -0
- package/dist/fn/Input/AutoHeightText.d.ts +6 -0
- package/dist/fn/Input/AutoHeightText.js +1 -0
- package/dist/fn/Input/Checker.d.ts +17 -0
- package/dist/fn/Input/Checker.js +1 -0
- package/dist/fn/Input/Chips/Selector.d.ts +44 -0
- package/dist/fn/Input/Chips/Selector.js +1 -0
- package/dist/fn/Input/Chips/index.d.ts +60 -0
- package/dist/fn/Input/Chips/index.js +1 -0
- package/dist/fn/Input/Contenteditable.d.ts +17 -0
- package/dist/fn/Input/Contenteditable.js +1 -0
- package/dist/fn/Input/DigitCharacters.d.ts +17 -0
- package/dist/fn/Input/DigitCharacters.js +1 -0
- package/dist/fn/Input/Filer.d.ts +47 -0
- package/dist/fn/Input/Filer.js +1 -0
- package/dist/fn/Input/Hidden.d.ts +13 -0
- package/dist/fn/Input/Hidden.js +1 -0
- package/dist/fn/Input/List.d.ts +50 -0
- package/dist/fn/Input/List.js +1 -0
- package/dist/fn/Input/Parts.d.ts +22 -0
- package/dist/fn/Input/Parts.js +1 -0
- package/dist/fn/Input/Plain.d.ts +7 -0
- package/dist/fn/Input/Plain.js +1 -0
- package/dist/fn/Input/RichSelect.d.ts +32 -0
- package/dist/fn/Input/RichSelect.js +1 -0
- package/dist/fn/Input/Search.d.ts +6 -0
- package/dist/fn/Input/Search.js +1 -0
- package/dist/fn/Input/Segmented.d.ts +22 -0
- package/dist/fn/Input/Segmented.js +1 -0
- package/dist/fn/Input/Select.d.ts +28 -0
- package/dist/fn/Input/Select.js +1 -0
- package/dist/fn/Input/Slider.d.ts +31 -0
- package/dist/fn/Input/Slider.js +1 -0
- package/dist/fn/Input/Switch.d.ts +17 -0
- package/dist/fn/Input/Switch.js +1 -0
- package/dist/fn/Input/Text.d.ts +51 -0
- package/dist/fn/Input/Text.js +1 -0
- package/dist/fn/Input/TextArea.d.ts +19 -0
- package/dist/fn/Input/TextArea.js +1 -0
- package/dist/fn/Input/Time/Picker.d.ts +37 -0
- package/dist/fn/Input/Time/Picker.js +1 -0
- package/dist/fn/Input/Time/index.d.ts +78 -0
- package/dist/fn/Input/Time/index.js +1 -0
- package/dist/fn/Input/core.d.ts +54 -0
- package/dist/fn/Input/core.js +1 -0
- package/dist/fn/Input/index.d.ts +145 -0
- package/dist/fn/Input/index.js +1 -0
- package/dist/fn/Layout/PageNotFound.d.ts +6 -0
- package/dist/fn/Layout/PageNotFound.js +1 -0
- package/dist/fn/Layout/PageRouter.d.ts +27 -0
- package/dist/fn/Layout/PageRouter.js +1 -0
- package/dist/fn/Layout/PageViewController.d.ts +13 -0
- package/dist/fn/Layout/PageViewController.js +1 -0
- package/dist/fn/Layout/Plate.d.ts +9 -0
- package/dist/fn/Layout/Plate.js +1 -0
- package/dist/fn/Layout/RootViewController.d.ts +41 -0
- package/dist/fn/Layout/RootViewController.js +1 -0
- package/dist/fn/Layout/SwipeView.d.ts +40 -0
- package/dist/fn/Layout/SwipeView.js +1 -0
- package/dist/fn/Layout/TabBar.d.ts +16 -0
- package/dist/fn/Layout/TabBar.js +1 -0
- package/dist/fn/Layout/index.d.ts +27 -0
- package/dist/fn/Layout/index.js +1 -0
- package/dist/fn/Loader/corner.d.ts +1 -0
- package/dist/fn/Loader/corner.js +1 -0
- package/dist/fn/Loader/index.d.ts +47 -0
- package/dist/fn/Loader/index.js +1 -0
- package/dist/fn/Loader/mini.d.ts +6 -0
- package/dist/fn/Loader/mini.js +1 -0
- package/dist/fn/Loader/top.d.ts +2 -0
- package/dist/fn/Loader/top.js +1 -0
- package/dist/fn/Sheet.d.ts +76 -0
- package/dist/fn/Sheet.js +1 -0
- package/dist/fn/Snackbar.d.ts +24 -0
- package/dist/fn/Snackbar.js +1 -0
- package/dist/fn/Table/Data.d.ts +128 -0
- package/dist/fn/Table/Data.js +1 -0
- package/dist/fn/Table/Drag.d.ts +18 -0
- package/dist/fn/Table/Drag.js +1 -0
- package/dist/fn/Table/Normal.d.ts +16 -0
- package/dist/fn/Table/Normal.js +1 -0
- package/dist/fn/Table/Parts.d.ts +24 -0
- package/dist/fn/Table/Parts.js +1 -0
- package/dist/fn/Table/Wrapper.d.ts +10 -0
- package/dist/fn/Table/Wrapper.js +1 -0
- package/dist/fn/Table/cellStyling.d.ts +9 -0
- package/dist/fn/Table/cellStyling.js +1 -0
- package/dist/fn/Table/index.d.ts +42 -0
- package/dist/fn/Table/index.js +1 -0
- package/dist/fn/Tooltips.d.ts +31 -0
- package/dist/fn/Tooltips.js +1 -0
- package/dist/fn/index.d.ts +10 -0
- package/dist/fn/index.js +1 -0
- package/dist/index.d.ts +400 -0
- package/dist/index.js +1 -0
- package/dist/mols/Accordion.d.ts +25 -0
- package/dist/mols/Accordion.js +1 -0
- package/dist/mols/Column.d.ts +7 -0
- package/dist/mols/Column.js +1 -0
- package/dist/mols/LinkifyText.d.ts +10 -0
- package/dist/mols/LinkifyText.js +1 -0
- package/dist/mols/List.d.ts +11 -0
- package/dist/mols/List.js +1 -0
- package/dist/mols/Row.d.ts +16 -0
- package/dist/mols/Row.js +1 -0
- package/dist/mols/Text.d.ts +21 -0
- package/dist/mols/Text.js +1 -0
- package/dist/mols/index.d.ts +6 -0
- package/dist/mols/index.js +1 -0
- package/dist/orgs/index.d.ts +1 -0
- package/dist/orgs/index.js +0 -0
- package/dist/temps/designBook.d.ts +4 -0
- package/dist/temps/designBook.js +99 -0
- package/dist/temps/index.d.ts +1 -0
- package/dist/temps/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import Input from './Input';
|
|
2
|
+
declare namespace Cropper {
|
|
3
|
+
type Use = 'square' | 'wallpaper.horizontal' | 'wallpaper.vertical';
|
|
4
|
+
type Input = {
|
|
5
|
+
use: Use;
|
|
6
|
+
develops: Develop[];
|
|
7
|
+
onProcessFinished: {
|
|
8
|
+
(files: Input.Filer.CustomFile[]): void;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
type Develop = {
|
|
12
|
+
size: 'S' | 'R' | 'L';
|
|
13
|
+
maxSize?: number;
|
|
14
|
+
};
|
|
15
|
+
type Methods = {
|
|
16
|
+
open(para: Input): void;
|
|
17
|
+
};
|
|
18
|
+
type CoreProps = {
|
|
19
|
+
val_file: Input.Filer.CustomFile;
|
|
20
|
+
options: Input;
|
|
21
|
+
finishedCallback(files: Input.Filer.CustomFile[]): void;
|
|
22
|
+
abortCallback(): void;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
declare const Cropper: Cropper.Methods;
|
|
26
|
+
export { Cropper, Cropper as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as X,c as O,e as B}from"../chunk-VY3566IV.js";import{Fragment as $,jsx as p,jsxs as y}from"react/jsx-runtime";import b from"@mingoo/jsmin";import{$$fromRoot as j,useStore as M}from"../@utils";import{useState as z,useEffect as H}from"react";import V from"../atoms/Flex";import D from"../atoms/Box";import P from"../atoms/FAI";import T from"../mols/Column";import q from"../mols/Row";import Y from"./Button";import A from"./Sheet";import k 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 L}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:h,height:s}=a,c=h/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/h: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:h/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:h}=this.dragEffectInfo,s=a.x-l,c=a.y-t,o=this.scale.current*this.Picture.revisedAspect/100,r=s/o*h.x,n=c/o*h.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:h,y:s}=b.getCursor(l.touches[1]),c=h-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 B(this,null,function*(){let{grayScale:i,tone:e,rotate:l}=this.Picture;const t=document.createElement("canvas");let a=t.getContext("2d"),h=yield b.ImageLoader(this.Picture.originDataUrl),s=h.width,c=h.height;(l==90||l==270)&&(s=h.height,c=h.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(h,0,0,h.width,h.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,m=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]*=m}}a.putImageData(o,0,0);let g=t.toDataURL("image/jpeg");{let C=yield b.ImageLoader(g),{width:x,height:S}=C,m=x/S;this.Picture=O(X({},this.Picture),{elm:C,aspect:m,revisedAspect:this.pst.frame.aspect>m?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,h=i||this.pst.imageX,s=e||this.pst.imageY;{let c=this.scale.current/100,o=this.Picture.revisedAspect*c,r=this.pst.centerX-h*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,m=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>m&&(v=n-m),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),m)}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 B(this,null,function*(){let{develops:i,Picture:e,pst:{outImage:l,frame:t}}=this,a=l.w/e.elm.width,h=l.h/e.elm.height,s=(t.x-l.x)/a,c=(t.x-l.x+t.w)/a,o=(t.y-l.y)/h,r=(t.y-l.y+t.h)/h,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],m=S;this.use=="wallpaper.horizontal"?m=S/3*2:this.use=="wallpaper.vertical"&&(m=S*2);let u=document.createElement("canvas");u.width=S,u.height=m;let v=u.getContext("2d");if(!v)return;v.clearRect(0,0,S,m),v.drawImage(this.Picture.elm,s,o,c-s,r-o,0,0,S,m);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 U=new File([E],this.val_file.name,{type:d});n[g]=U}return n})}}const G={Core:f=>{let{val_file:i,options:e,finishedCallback:l,abortCallback:t}=f,{use:a,develops:h=[]}=e,[s]=z(b.uuid.gen(32));const c={scale:{default:125,min:100,max:300},rotate:0,grayScale:0,tone:0};let[o,r]=z(c.scale.default),[n,d]=z(c.rotate),[g,C]=z(c.grayScale),[x,S]=z(c.tone);return H(()=>{M.set({key:s,value:{}}),B(void 0,null,function*(){k.fn.corner.active();let{target:m}=yield i.read();if(!m)return;let u=m.result,v=j("#Canvas-"+s)[0];if(!v)return;let w=new ee({set_scale:r,val_file:i,develops:h,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:_=>{U("move",_)}}).addEvent({eventType:R=="touchstart"?"touchend":"mouseup",eventID:"CropperEffectEnd",options:{passive:!1},callback:_=>{U("end",_),F(_)}})}},U=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(()=>{k.fn.corner.stop()},1e3)})},[i.id]),H(()=>{var u;let m=(u=M.get(s))==null?void 0:u.Instance;m&&m.updateScale(o)},[o]),H(()=>{var u;let m=(u=M.get(s))==null?void 0:u.Instance;m&&m.updateFilter({grayScale:g,tone:x,rotate:n})},[g,x,n]),p(A.Comps.Body,{children:y(V,{className:[L("Wrap"),L("Use_"+a)].join(" "),flexWrap:!1,position:"relative",overflow:"hidden",borderRadius:"inherit",boxShadow:"3.remark",UnderBreakPointStyles:{flexType:"col"},children:[p(D,{flexGrid:3,UnderBreakPointStyles:{width:1,padding:2},children:p(D,{overflow:"hidden",position:"relative",backgroundColor:"layer.4",freeCSS:{zIndex:1},UnderBreakPointStyles:{borderRadius:"1.tone.primary"},children:p("canvas",{width:"2400",height:a=="wallpaper.horizontal"?"1800":a=="wallpaper.vertical"?"3200":"2400",className:L("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:[p(D,{flexSizing:"none",fontSize:"4.thirdTitle",isSemiBoldFont:!0,children:"\u30D5\u30A3\u30EB\u30BF\u30FC"}),p(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:[p(Y.Button.Border.R,{onClick:()=>{t()},children:"\u30AD\u30E3\u30F3\u30BB\u30EB"}),p(Y.Button.Prime.R,{flexSizing:0,onClick:()=>B(void 0,null,function*(){var v;let m=(v=M.get(s))==null?void 0:v.Instance;if(!m)return;k.fn.mini.active("CropperExportation");let u=yield m.export();setTimeout(()=>{k.fn.mini.stop("CropperExportation"),l(u)},3e3)}),children:y(q.Center,{gap:"1/2",children:[p(k.White.R,{loaderID:"CropperExportation"}),"\u6C7A\u5B9A"]})})]})]})]})})},SettingRegion:f=>{let i=[];for(let e=1;e<=10;e++)i.push({value:e,label:y($,{children:[p(D,{className:[L("ToneBall"),L("ToneBall_"+e)].join(" ")}),p(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:[p(P.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:[p(P,{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 ",p(P,{icon:Q})]})]})]}),y(T,{gap:"1/3",children:[y(D,{children:[p(P.Search,{fontSize:"3.paragraph",fontColor:"4.thin"})," Zoom"]}),p(D,{paddingLeft:2,children:p(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:[p(P,{icon:K,fontSize:"3.paragraph",fontColor:"4.thin"})," Gray Scale"]}),p(D,{paddingLeft:2,children:p(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:[p(P,{icon:Z,fontSize:"3.paragraph",fontColor:"4.thin"})," Tone"]}),p(D,{paddingLeft:2,children:p(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=>B(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:p(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};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import Box from '../../atoms/Box';
|
|
3
|
+
declare namespace FadeIn {
|
|
4
|
+
type Input = Box.Input & {
|
|
5
|
+
animationTime?: number;
|
|
6
|
+
animationDelay?: number;
|
|
7
|
+
};
|
|
8
|
+
}
|
|
9
|
+
declare const FadeIn: React.FC<FadeIn.Input>;
|
|
10
|
+
declare namespace FadeUp {
|
|
11
|
+
type Input = Box.Input & {
|
|
12
|
+
animationTime?: number;
|
|
13
|
+
animationDelay?: number;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const FadeUp: React.FC<FadeUp.Input>;
|
|
17
|
+
export { FadeIn, FadeUp };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as a,c as i,d as s}from"../../chunk-VY3566IV.js";import{jsx as y}from"react/jsx-runtime";import u from"@mingoo/jsmin";import{$$fromRoot as d}from"../../@utils";import{useState as I,useEffect as l}from"react";import f from"../../atoms/Box";const D=m=>{let n=m,{animationDelay:p=100,animationTime:r=300,componentID:c=u.uuid.gen()}=n,e=s(n,["animationDelay","animationTime","componentID"]),[t]=I(c);return l(()=>{setTimeout(()=>{let o=d('[data-component-id="'+t+'"]');o[0]&&o.css({transition:r+"ms"}).await(1).css({opacity:1})},p)},[]),y(f,i(a({},e),{freeCSS:i(a({},e.freeCSS),{opacity:0}),componentID:t}))},S=m=>{let n=m,{animationDelay:p=100,animationTime:r=300,componentID:c=u.uuid.gen()}=n,e=s(n,["animationDelay","animationTime","componentID"]),[t]=I(c);return l(()=>{setTimeout(()=>{let o=d('[data-component-id="'+t+'"]');o[0]&&o.css({transition:r+"ms"}).await(1).css({opacity:1,paddingTop:0})},p)},[]),y(f,i(a({paddingTop:2},e),{freeCSS:i(a({},e.freeCSS),{opacity:0}),componentID:t}))};export{D as FadeIn,S as FadeUp};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../chunk-VY3566IV.js";import t from"@mingoo/jsmin";import{Config as r}from"../../@utils";import{EffectClasses as e}from"../../@styles/componentClasses";const a={Wrapper:()=>(t(r.get().appRoot).addEvent({eventType:"click",target:".eff_pudding",callback:function(d){t(d.target).removeClass(e("PuddingEffect")).await(1).addClass(e("PuddingEffect")).await(510).removeClass(e("PuddingEffect"))}}),null)};export{a as Pudding,a as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import"../../chunk-VY3566IV.js";import e from"@mingoo/jsmin";import{Config as u}from"../../@utils";import{EffectClasses as a}from"../../@styles/componentClasses";let f="eff_ripple";const n={Start:t=>{let l=e.Time().ms,s=t.target,p=e(s);if(!p[0])return;let o=p.findClass(/^eff_ripple-/)[0];if(!o)return;let r=o.split("-")[1],i="RippleWrap-"+e.uuid.gen(),{left:d,top:E,height:b,width:h}=p.position(),{pageXOffset:R,pageYOffset:g}=e.getScreenSize(),{x:T,y}=e.getCursor(t),c=Math.min(h*1.5,300),M=Math.max(T-(d+R),0),C=Math.max(y-(E+g),0),m={RippleElement:p,startedAt:l,size:c};e(document).addEvent({eventID:"RippleMouseUp",eventType:"mouseup",callback:()=>{n.End(m)}}).addEvent({eventID:"RippleTouchEnd",eventType:"touchend",callback:()=>{setTimeout(()=>{n.End(m)},20)}}),e(p).addClass([a("RippleElement"),a("Color_"+r)]).append(`<div class="${a("RippleWrap")}" id="${i}">
|
|
2
|
+
<div class="${a("Wave")}" />
|
|
3
|
+
</div>`).addEvent({eventID:"RippleMouseOut",eventType:"mouseout",callback:I=>{n.End(m)}}).find("#"+i).find("."+a("Wave")).css({left:M,top:C}).await(10).css({height:c,width:c,opacity:".3",transition:".25s"})},End:t=>{let{RippleElement:l,startedAt:s,size:p}=t,r=e.Time().ms-s<=400?".75s":".55s",i=p*2.5;e(document).removeEvent(["RippleMouseUp","RippleTouchMove","RippleTouchEnd","RippleMouseOut"]),l.removeEvent(["RippleMouseOut"]).find("."+a("Wave")).css({height:i,width:i,opacity:"0",transition:r}).await(750).parent().callback(d=>{d.remove()})}},v={Wrapper:()=>(e(u.get().appRoot).addEvent({eventType:"touchstart",target:"."+f,callback:t=>{n.Start(t)}}).addEvent({eventType:"mousedown",target:"."+f,callback:t=>{u.get().isTouchDevice||n.Start(t)}}),null)};export{v as Ripple,v as default};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { FadeIn, FadeUp } from './Fade';
|
|
3
|
+
import Ripple from './Ripple';
|
|
4
|
+
import Pudding from './Pudding';
|
|
5
|
+
declare const Effect: {
|
|
6
|
+
Ripple: Ripple.Methods;
|
|
7
|
+
Pudding: Pudding.Methods;
|
|
8
|
+
FadeIn: import("react").FC<FadeIn.Input>;
|
|
9
|
+
FadeUp: import("react").FC<FadeUp.Input>;
|
|
10
|
+
};
|
|
11
|
+
export { Effect, Effect as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import"../../chunk-VY3566IV.js";import{FadeIn as p,FadeUp as r}from"./Fade";import t from"./Ripple";import e from"./Pudding";const o={Ripple:t,Pudding:e,FadeIn:p,FadeUp:r};export{o as Effect,o as default};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t,c as n,e as d}from"../../chunk-VY3566IV.js";import{jsx as g,jsxs as z}from"react/jsx-runtime";import a from"@mingoo/jsmin";import{useEffect as I,useState as r}from"react";import y from"./TextArea";import w from"../../mols/Text";import{BoxWrapper as H}from"./core";import{InputAutoHeightClasses as f}from"../../@styles/componentClasses";const m=e=>{let[i]=r(a.uuid.gen()),[o,h]=r(String(e.value||""));I(()=>{a.scope(()=>d(void 0,null,function*(){let l=a('[data-id="origin_'+i+'"]')[0],s=a('[data-id="shallow_'+i+'"]')[0];if(!l||!s)return;let p=s.getClientRects()[0];if(!p)return;let{width:D,height:_}=p;l.style.height=_+"px"}))},[o]);let S={componentID:e.componentID,dataValue:e.value,eventType:"init",eventID:a.uuid.gen()},[c,x]=r(S),[v,A]=r({ok:!1,notice:[]}),T=!!o.match(/\n$/),u=o||e.placeholder;return T&&(u+="d"),z(H,{val_status:c,set_status:x,val_validate:v,para:e,children:[g(w.Description,n(t({padding:1,fontSize:"inherit",flexSizing:0,minHeight:1},e),{className:[e.className,f("Shallow")].join(" "),id:"shallow_"+i,position:"absolute",left:0,right:0,top:0,border:"0.trans",opacity:"trans",freeCSS:n(t({minHeight:16*2,resize:"none"},e.freeCSS),{color:"transparent",zIndex:3,pointerEvents:"none",lineHeight:"1.25",letterSpacing:"1px"}),"data-id":"shallow_"+i,children:u})),g(y,n(t({padding:1,fontSize:"inherit",overflow:"hidden",flexSizing:0},e),{wrapStyles:t({flexSizing:0},e.wrapStyles),className:[e.className,f("Origin")].join(" "),freeCSS:n(t({minHeight:16*1,resize:"none"},e.freeCSS),{lineHeight:"1.25",letterSpacing:"1px"}),value:o,"data-id":"origin_"+i,onUpdateValue:l=>{let s=l.value;h(s),e.onUpdateValue&&e.onUpdateValue(l)}}))]})};export{m as AutoHeightText,m as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { TagProperty, ReactElement } from '../../@declaration';
|
|
2
|
+
import { InputTypes } from '.';
|
|
3
|
+
declare namespace Checker {
|
|
4
|
+
type Input = InputTypes.CoreInput & {
|
|
5
|
+
label: ReactElement;
|
|
6
|
+
id?: string;
|
|
7
|
+
tabIndex?: number;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
value?: boolean;
|
|
10
|
+
cellStyles?: TagProperty.Para;
|
|
11
|
+
cellClassName?: string;
|
|
12
|
+
cellCheckedStyles?: TagProperty.Para;
|
|
13
|
+
cellCheckedClassName?: string;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const Checker: (para: Checker.Input) => import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
export { Checker, Checker as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as l,c as t}from"../../chunk-VY3566IV.js";import{jsx as u}from"react/jsx-runtime";import c from"./List";const n=e=>(e=l({},e),u(c.Plain,t(l({},e),{tone:"plain",icon:!0,type:"checker",iconType:"checkbox",value:e.value?!0:null,cellStyles:l({padding:0},e.cellStyles),options:[{value:!0,label:e.label}],onUpdateValidValue:a=>{let o=!!a.value[0];e.onUpdateValidValue&&e.onUpdateValidValue(t(l({},a),{value:o}))}})));export{n as Checker,n as default};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import { ReactElement } from '../../../@declaration';
|
|
2
|
+
import $$ from '@mingoo/jsmin';
|
|
3
|
+
import { Types } from '.';
|
|
4
|
+
declare namespace Selector {
|
|
5
|
+
type Input = {
|
|
6
|
+
selectorID: string;
|
|
7
|
+
bottomContent: ReactElement;
|
|
8
|
+
options: Types.ChipsOptions[];
|
|
9
|
+
limit?: number;
|
|
10
|
+
selected: Types.ChipsOptions[];
|
|
11
|
+
SelectorCellComponent: Types.SelectorCellComponentInput;
|
|
12
|
+
onUpdated(para: {
|
|
13
|
+
values: any[];
|
|
14
|
+
}): void;
|
|
15
|
+
onDynamicSearch?: Types.onDynamicSearch;
|
|
16
|
+
};
|
|
17
|
+
type OpenSelectorInput = {
|
|
18
|
+
parent: $$.Args;
|
|
19
|
+
selectorID: string;
|
|
20
|
+
options: Types.ChipsOptions[];
|
|
21
|
+
selected: Types.ChipsOptions[];
|
|
22
|
+
bottomContent?: ReactElement;
|
|
23
|
+
gravityPoint?: number;
|
|
24
|
+
limit?: number;
|
|
25
|
+
onDynamicSearch?: {
|
|
26
|
+
(k: string): Promise<{
|
|
27
|
+
options: Types.ChipsOptions[];
|
|
28
|
+
}>;
|
|
29
|
+
};
|
|
30
|
+
onUpdated(para: {
|
|
31
|
+
values: any[];
|
|
32
|
+
}): void;
|
|
33
|
+
onClosed(): void;
|
|
34
|
+
SelectorCellComponent?: Types.SelectorCellComponentInput;
|
|
35
|
+
};
|
|
36
|
+
type Methods = {
|
|
37
|
+
openSelector(para: OpenSelectorInput): void;
|
|
38
|
+
closeSelector(selectorID: string): void;
|
|
39
|
+
updateOptions(selectorID: string, options: Types.ChipsOptions[]): void;
|
|
40
|
+
updateSelected(selectorID: string, selected: Types.ChipsOptions[]): void;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
declare const Selector: Selector.Methods;
|
|
44
|
+
export { Selector, Selector as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as E,c as J,d as W,e as K}from"../../../chunk-VY3566IV.js";import{Fragment as j,jsx as n,jsxs as O}from"react/jsx-runtime";import{useState as I,useEffect as R,useRef as L}from"react";import w from"@mingoo/jsmin";import{$$fromRoot as P,useStore as U}from"../../../@utils";import $ from"../../../atoms/Box";import _ from"../../../atoms/FAI";import z from"../../../atoms/Span";import H from"../../../mols/Column";import b from"../../../mols/Row";import V from"../../Button";import k from"../../Sheet";import G from"../../Loader";import Q from"../Text";import X from"../Parts";import{InputChipsClasses as Y}from"../../../@styles/componentClasses";const Z=e=>{let[h,r]=I("show"),[y,N]=I(""),[u]=I(w.uuid.gen()),[l,g]=I(e.options),[o,C]=I(l[0]||null),[S,x]=I(e.selected),[D,T]=I("init");R(()=>{U.set({key:e.selectorID,value:{updateOptions:t=>{g(t)},updateSelected:t=>{x(t)}}})},[]);const B=L(!1);R(()=>{B.current?k.reposition(e.selectorID):B.current=!0},[l]);const F=L(!1);R(()=>{F.current?(r("interlude"),C(l[0]||null),e.onDynamicSearch?(w.interval.clear(u+"-dynamicSearch"),w.interval.standBy(u+"-dynamicSearch",400,()=>K(void 0,null,function*(){let{options:t}=yield e.onDynamicSearch(y);g(t),r("show")}))):(w.interval.clear(u+"-staticSearch"),w.interval.standBy(u+"-staticSearch",400,()=>K(void 0,null,function*(){let t=new RegExp(y,"ig"),p=[];[...e.options].forEach(a=>{var c;!!(!y||((c=String(a.label))!=null?c:String(a.value)).match(t))&&p.push(a)}),g(p),r("show")})))):F.current=!0},[y]);const M=L(!1);R(()=>{M.current?e.onUpdated({values:S}):M.current=!0},[S]),R(()=>{w.scope(()=>{if(w.is.nullish(o)||D=="MouseEvent")return;let t=P("#"+u+"-Selector-Cell-Wrap");if(!t[0])return;let p=P('[data-chips-selector-cell="'+u+"-"+JSON.stringify((o==null?void 0:o.value)||"").replace(/\"/ig,"")+'"]');if(!p[0])return;let{top:a,height:v}=t.position(),{top:c,height:d}=p.position();if(a<=c&&c+d<=a+v)return;let i=t[0].scrollTop+(c-a);D=="ArrowDown"?i-=v-d-20:D=="ArrowUp"&&(i-=20),t[0].scrollTop=i})},[o]);let A=[];return h=="interlude"?A=[O(b.Center,{padding:2,gap:0,children:[n(G.Theme.R,{showInitial:!0}),n($,{padding:[0,1],fontSize:"1.mini",fontColor:"4.thin",children:"\u691C\u7D22\u4E2D..."})]})]:A=[l.map((t,p)=>{let{value:a,label:v}=t,c=String(JSON.stringify(a)),d=S.findIndex(f=>JSON.stringify(f.value)==c),i=d!=-1,s=JSON.stringify((o==null?void 0:o.value)||"")==c,m={};return(i||s)&&(m={fontColor:"theme",isSemiBoldFont:!0}),s&&(m.backgroundColor="cloud"),i&&(m.backgroundColor="theme.opa.few"),n(V.Button.Clear.R,J(E({borderRadius:"3.tone.tertiary",color:"cloud",padding:"1/3",tabIndex:-1,textAlign:"left","data-chips-selector-cell":u+"-"+c.replace(/\"/ig,""),isActive:i||s,isActiveStyles:m},m),{onMouseOver:()=>{T("MouseEvent"),C(t)},onClick:()=>{let f=[...S];i?f.splice(d,1):(f=[...f,t],e.limit&&f.length>e.limit&&f.shift()),x(f)},children:n(e.SelectorCellComponent,{isSelected:i,isFocused:s,value:a,label:v})}),p)})],O(j,{children:[O(H,{padding:"2/3",gap:"2/3",borderBottom:!0,children:[O(b.Separate,{children:[n(Q.Normal,{value:y,onUpdateValidValue:({value:t})=>{N(t)},id:e.selectorID+"-KeywordInput",padding:"2/3",placeholder:"\u691C\u7D22...",leftIcon:n(X.LeftIcon,{right:"2/3",fontSize:"1.mini",fontColor:"3.blur",children:n(_.Search,{})}),onKeyDown:t=>{let{key:p,metaKey:a,ctrlKey:v}=t,c=a||v;if(["ArrowDown","ArrowUp"].includes(p)){let d=+(p=="ArrowDown")*2-1;if(c){let i=l[d==1?l.length-1:0];C(i)}else{let i=l.findIndex(s=>JSON.stringify(s.value)==JSON.stringify((o==null?void 0:o.value)||""))+d;l[i]?C(l[i]):C(l[d==1?0:l.length-1]||null)}}else if(p=="Enter"){let d=S.findIndex(m=>JSON.stringify(m.value)==JSON.stringify((o==null?void 0:o.value)||"")),i=d!=-1,s=[...S];if(i)s.splice(d,1);else{let m=l.findIndex(f=>JSON.stringify(f.value)==JSON.stringify((o==null?void 0:o.value)||""));if(m==-1)return;s=[...s,l[m]],e.limit&&s.length>e.limit&&s.shift()}x(s)}T(p)}}),n(V.Button.Border.S,{marginRight:"1/3",ssSphere:2,backgroundColor:"cloud",borderRadius:"2.tone.secondary",onClick:()=>{k.close(e.selectorID)},children:n(_.Times,{})})]}),O(b.Separate,{children:[O(b.Left,{gap:"1/2",verticalAlign:"baseline",children:[n(z,{fontColor:"theme",children:l.length}),n($,{fontSize:"1.mini",fontColor:"3.blur",children:"\u4EF6\u306E\u30D2\u30C3\u30C8"})]}),n(b.Right,{children:!!e.limit&&O(z,{fontColor:"3.blur",fontSize:"1.mini",children:[n(z,{fontSize:"3.paragraph",fontColor:"theme",isSemiBoldFont:!0,children:S.length})," / ",e.limit," \u4EF6"]})})]})]}),n(H,{gap:"1/4",padding:"1/2",overflow:"auto",freeCSS:{maxHeight:12*26,maxWidth:12*26},id:u+"-Selector-Cell-Wrap",className:Y("SelectorWrapper"),children:A}),e.bottomContent]})},q={openSelector:e=>{let T=e,{selectorID:h,options:r,selected:y,limit:N,bottomContent:u,onDynamicSearch:l,SelectorCellComponent:g,onUpdated:o,onClosed:C,parent:S}=T,x=W(T,["selectorID","options","selected","limit","bottomContent","onDynamicSearch","SelectorCellComponent","onUpdated","onClosed","parent"]),D=h;g=g||(B=>n(b.Left,{children:B.label})),k.open(J(E({parent:S,sheetID:D,type:"custom",gravityPoint:22,padding:[1,0],hold_state:!0,close_option:{aroundClick:!0,escapeKeyDown:!0}},x),{content:n($,{borderRadius:"2.tone.secondary",backgroundColor:"layer.1",border:!0,boxShadow:"1.normal",overflow:"hidden",children:n(Z,{selectorID:h,options:r,limit:N,selected:y,onUpdated:o,SelectorCellComponent:g,bottomContent:u,onDynamicSearch:l},JSON.stringify(y))}),openAfter:()=>{P("#"+e.selectorID+"-KeywordInput").focus()},closeAfter:()=>{C()}}))},closeSelector:e=>{k.close(e)},updateOptions:(e,h)=>{let r=U.get(e);r&&r.updateOptions&&r.updateOptions(h)},updateSelected:(e,h)=>{let r=U.get(e);r&&r.updateSelected&&r.updateSelected(h)}};export{q as Selector,q as default};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ReactElement } from '../../../@declaration';
|
|
3
|
+
import { InputTypes } from '..';
|
|
4
|
+
export declare namespace Types {
|
|
5
|
+
type ChipsOptions = {
|
|
6
|
+
value: any;
|
|
7
|
+
label: string;
|
|
8
|
+
};
|
|
9
|
+
type SelectedCellComponentInput = React.FC<{
|
|
10
|
+
removeCallback: Function;
|
|
11
|
+
defaultRemoveButton: ReactElement;
|
|
12
|
+
openCallback(): void;
|
|
13
|
+
value: any;
|
|
14
|
+
label: string;
|
|
15
|
+
}>;
|
|
16
|
+
type SelectorCellComponentInput = React.FC<{
|
|
17
|
+
isSelected: boolean;
|
|
18
|
+
isFocused: boolean;
|
|
19
|
+
value: any;
|
|
20
|
+
label: string;
|
|
21
|
+
}>;
|
|
22
|
+
type onDynamicSearch = {
|
|
23
|
+
(k: string): Promise<{
|
|
24
|
+
options: ChipsOptions[];
|
|
25
|
+
}>;
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
import Selector from './Selector';
|
|
29
|
+
declare namespace Chips {
|
|
30
|
+
type Methods = React.FC<Input> & {
|
|
31
|
+
fn: Selector.Methods;
|
|
32
|
+
};
|
|
33
|
+
type Input = InputTypes.CoreInput & {
|
|
34
|
+
tabIndex?: number;
|
|
35
|
+
id?: string;
|
|
36
|
+
disabled?: boolean;
|
|
37
|
+
value?: Options[];
|
|
38
|
+
limit?: number;
|
|
39
|
+
selectorGravityPoint?: number;
|
|
40
|
+
defaultOptions?: Options[];
|
|
41
|
+
onDynamicSearch?: Types.onDynamicSearch;
|
|
42
|
+
leftIndicator?: ReactElement | false;
|
|
43
|
+
rightIndicator?: ReactElement | false;
|
|
44
|
+
rightIcon?: ReactElement | false;
|
|
45
|
+
leftIcon?: ReactElement | false;
|
|
46
|
+
SelectedCellComponent?: SelectedCellComponentInput;
|
|
47
|
+
SelectorCellComponent?: SelectorCellComponentInput;
|
|
48
|
+
AddButtonComponent?: AddButtonComponentInput;
|
|
49
|
+
};
|
|
50
|
+
type Options = Types.ChipsOptions;
|
|
51
|
+
type onDynamicSearch = Types.onDynamicSearch;
|
|
52
|
+
type AddButtonComponentInput = React.FC<{
|
|
53
|
+
selected: Options[];
|
|
54
|
+
openCallback(): void;
|
|
55
|
+
}>;
|
|
56
|
+
type SelectedCellComponentInput = Types.SelectedCellComponentInput;
|
|
57
|
+
type SelectorCellComponentInput = Types.SelectorCellComponentInput;
|
|
58
|
+
}
|
|
59
|
+
declare const Chips: Chips.Methods;
|
|
60
|
+
export { Chips, Chips as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r,c as h,d as N}from"../../../chunk-VY3566IV.js";import{jsx as a,jsxs as b}from"react/jsx-runtime";import{useState as v,useEffect as L,useRef as H}from"react";import B from"@mingoo/jsmin";import{$$fromRoot as T}from"../../../@utils";import Q from"../../../atoms/Box";import P from"../../../atoms/FAI";import X from"../../../mols/Row";import U from"../../Button";import Y from"../../Sheet";import{Wrapper as Z,BoxWrapper as j,CommonEffects as ee,DefaultStyles as te}from"../core";import ne from"../Hidden";import W from"./Selector";function oe(e){let{value:u,para:s}=e,{required:o}=s,c=[];return o&&!u.length&&c.push({type:"invalid",label:"\u4E00\u3064\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044"}),{ok:!c.filter(({type:f})=>f=="invalid").length,notice:c}}const le=e=>{let $=e,{required:u,form:s,name:o,checkValidationAtFirst:c,onValidate:f,onUpdateValue:O,onUpdateValidValue:M,value:F=[],limit:A,leftIndicator:ie,rightIndicator:pe,leftIcon:re,rightIcon:ue,SelectedCellComponent:g,AddButtonComponent:x,componentID:se,defaultOptions:ce,enableFormSubmit:de,onDynamicSearch:me}=$,q=N($,["required","form","name","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","limit","leftIndicator","rightIndicator","leftIcon","rightIcon","SelectedCellComponent","AddButtonComponent","componentID","defaultOptions","enableFormSubmit","onDynamicSearch"]);x=x;let[p]=v(B.uuid.gen()),[d,R]=v({componentID:e.componentID||"",dataValue:F.map(t=>t),eventID:B.uuid.gen(),eventType:"init"}),[D,z]=v({ok:!1,notice:[]}),[n,G]=v([...F]);ee({para:e,val_status:d,set_status:R,val_validate:D,set_validate:z,DefaultValidation:oe,onUpdateValue:O,onUpdateValidValue:M,ExtraOverrideParams:{formatValue:n,dataValue:n.map(t=>t)},ExtraStoreParams:{searchTimer:null}});const C=t=>{G(t),R(h(r({},d),{dataValue:t.map(i=>i),eventID:B.uuid.gen(),eventType:"update"}))};let E=`[data-chips-input-wrapper="${p}"]`;const y=()=>{W.openSelector({parent:E,gravityPoint:e.selectorGravityPoint,SelectorCellComponent:e.SelectorCellComponent,selectorID:p,options:e.defaultOptions||[],selected:n,limit:e.limit,onDynamicSearch:e.onDynamicSearch,onUpdated:t=>{C(t.values)},onClosed:()=>{T(E).focus()}})};let S=A&&A<=n.length;const _=H(!1);L(()=>{_.current?S&&(Y.close(p),T(`[data-chips-input-wrapper="${p}"]`).focus()):_.current=!0},[n]);let J=n.map(t=>{let{value:i,label:k}=t;g=g;const I=()=>{let l=n.findIndex(w=>w.value==i);if(l==-1)return;let m=[...n];m.splice(l,1),C(m),m.length||setTimeout(()=>{T(`[data-chips-input-wrapper="${p}"]`).focus()},200)};return a(g,{value:i,label:k,removeCallback:I,defaultRemoveButton:a(U.Button.Sub.S,{flexSizing:"none",color:"cloud",backgroundColor:"cloud",flexCenter:!0,isRounded:!0,freeCSS:{aspectRatio:"1/1"},onClick:()=>{I()},children:a(P.Times,{})}),openCallback:()=>{y()}},JSON.stringify(i))});return b(j,{val_status:d,set_status:R,val_validate:D,para:e,children:[a(ne,{"data-value":JSON.stringify(d.dataValue.map(t=>t.value)),name:o,form:s,"data-input-type":"chips-"+["single","multi"][+(e.limit!=1)],"data-validation":D.ok,componentID:d.componentID,"data-focusor":p}),b("button",h(r({"data-chips-input-wrapper":p,onKeyDown:t=>{let{key:i,ctrlKey:k,metaKey:I,keyCode:l}=t,m=k||I;if(l>=48&&l<=57||l>=65&&l<=90||l>=96&&l<=105){if(S)return;y()}else if(i!="Tab"){if(i=="Backspace"){if(!n.length)return;if(m)C([]);else{let K=[...n];K.pop(),C(K)}}}},onClick:()=>{S||y()}},q),{children:[!S&&a(x,{selected:n,openCallback:y}),J]}))]})},ae=e=>{let s=[...e.value||[]].splice(0,e.limit||65535);return a(le,h(r({SelectedCellComponent:o=>{let{value:c,label:f,removeCallback:O}=o;return b(X.Left,{ssCardBox:!0,padding:"1/3",gap:0,isRounded:!0,textAlign:"left",children:[a(Q,{padding:[0,"1/2"],children:f}),o.defaultRemoveButton]})},AddButtonComponent:o=>e.limit&&e.limit<=o.selected.length?null:b(U.Button.Sub.R,{color:"cloud",padding:"1/2",onClick:()=>{o.openCallback()},children:[a(P.Plus,{}),"\u8FFD\u52A0\u3059\u308B"]})},e),{value:s}))},V=e=>{e=r({},e),e=r({gap:1,display:"flex",horizontalAlign:"left",verticalAlign:"center",flexWrap:!0},e);let u=te.Boxish(e);return a(Z,{componentID:e.componentID,children:ae,para:u})};V.fn=W;export{V as Chips,V as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { ReactElement } from '../../@declaration';
|
|
3
|
+
import { InputTypes } from '.';
|
|
4
|
+
declare namespace Contenteditable {
|
|
5
|
+
type Input = InputTypes.CoreInput & React.TextareaHTMLAttributes<HTMLDivElement> & {
|
|
6
|
+
tone?: InputTypes.BoxTone;
|
|
7
|
+
tabIndex?: number;
|
|
8
|
+
id?: string;
|
|
9
|
+
children?: ReactElement;
|
|
10
|
+
leftIndicator?: ReactElement | false;
|
|
11
|
+
rightIndicator?: ReactElement | false;
|
|
12
|
+
leftIcon?: ReactElement | false;
|
|
13
|
+
rightIcon?: ReactElement | false;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const Contenteditable: React.FC<Contenteditable.Input>;
|
|
17
|
+
export { Contenteditable, Contenteditable as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as n,c as u,d as y}from"../../chunk-VY3566IV.js";import{jsx as r}from"react/jsx-runtime";import{useState as T}from"react";import g from"@mingoo/jsmin";import{Wrapper as _,BoxWrapper as k,SubmitForm as L,CommonEffects as F,DefaultStyles as B}from"./core";function H(t){let{value:e,para:o}=t,{required:a}=o,i=[];return a&&!e&&i.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!i.filter(({type:s})=>s=="invalid").length,notice:i}}const M=t=>{let v=t,{componentID:e,tone:o,required:a,form:i,value:s,enableFormSubmit:b,checkValidationAtFirst:W,onInput:m,onKeyDown:f,onValidate:q,onUpdateValue:D,onUpdateValidValue:R,children:C="",leftIndicator:A,rightIndicator:K,leftIcon:U,rightIcon:$}=v,V=y(v,["componentID","tone","required","form","value","enableFormSubmit","checkValidationAtFirst","onInput","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","children","leftIndicator","rightIndicator","leftIcon","rightIcon"]),E={componentID:e,dataValue:s,eventType:"init",eventID:g.uuid.gen()},[l,c]=T(E),[d,I]=T({ok:!1,notice:[]});return F({para:t,val_status:l,set_status:c,val_validate:d,set_validate:I,onUpdateValue:D,onUpdateValidValue:R,DefaultValidation:H}),r(k,{val_status:l,set_status:c,val_validate:d,para:t,children:r("div",u(n({contentEditable:!0,"data-form":i,"data-name":t.name,"data-input-type":"contenteditable","data-validation":d.ok,"data-value":l.dataValue,"data-component-id":l.componentID,onKeyDown:p=>{f&&f(p),b&&L(p)},onInput:p=>{let S=p.currentTarget,{innerHTML:N,innerText:x}=S;d.ok&&I({ok:!1,notice:[]}),c(u(n({},l),{dataValue:x,eventType:"update",eventID:g.uuid.gen()})),m&&m(p)}},V),{children:C}))})},h=t=>{var o,a;t=n({},t),t.rightIcon&&(t.paddingRight=(o=t.paddingRight)!=null?o:3),t.leftIcon&&(t.paddingLeft=(a=t.paddingLeft)!=null?a:3),t=u(n({},t),{freeCSS:n({whiteSpace:"pre-wrap"},t.freeCSS)});let e=B.Boxish(t);return e.rows=e.rows||5,r(_,{componentID:t.componentID,children:M,para:e})};export{h as Contenteditable,h as default};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TagProperty } from '../../@declaration';
|
|
3
|
+
import { InputTypes } from '.';
|
|
4
|
+
declare namespace DigitCharacters {
|
|
5
|
+
type Input = InputTypes.CoreInput & React.DetailedHTMLProps<React.InputHTMLAttributes<HTMLInputElement>, HTMLInputElement> & {
|
|
6
|
+
tone?: InputTypes.BoxTone;
|
|
7
|
+
combineInput?: boolean;
|
|
8
|
+
digits: number;
|
|
9
|
+
numericOnly?: boolean;
|
|
10
|
+
tabIndex?: number;
|
|
11
|
+
id?: string;
|
|
12
|
+
value?: string | number;
|
|
13
|
+
listStyles?: TagProperty.Para;
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
declare const DigitCharacters: React.FC<DigitCharacters.Input>;
|
|
17
|
+
export { DigitCharacters, DigitCharacters as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t,c as p,d as S}from"../../chunk-VY3566IV.js";import{jsx as I,jsxs as Z}from"react/jsx-runtime";import{useState as V}from"react";import y from"@mingoo/jsmin";import{$$fromRoot as O}from"../../@utils";import{Wrapper as q,BoxWrapper as w,SubmitForm as U,CommonEffects as j,DefaultStyles as z}from"./core";import G from"../../atoms/Flex";import J from"./Hidden";import{InputClasses as R}from"../../@styles/componentClasses";function Q(e){let{value:n,para:u}=e,{required:s,numericOnly:l=!1,digits:c}=u,r=[];return s&&!n&&r.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),n&&(l&&n.match(/\D/)&&r.push({type:"invalid",label:"\u6570\u5B57\u306E\u307F\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"}),n.length!=c&&r.push({type:"warn",label:"\u6700\u5F8C\u307E\u3067\u5165\u529B\u3057\u3066\u304F\u3060\u3055\u3044"})),{ok:!r.filter(({type:m})=>m=="invalid"||m=="warn").length,notice:r}}const X=(e,n="")=>{let u=String(n),s=[];for(let l=0;l<e;l++)s[l]=u[l]||"";return{formatValue:s,dataValue:u}},F=(e="")=>{let n=e,u=n.join("");return{formatValue:n,dataValue:u}},Y=e=>{let b=e,{tone:n,required:u,form:s,name:l,className:c="",digits:r,numericOnly:m=!1,enableFormSubmit:_,checkValidationAtFirst:P,onChange:ee,onKeyDown:te,onValidate:ne,onUpdateValue:k,onUpdateValidValue:A,value:N="",override:ie,componentID:ae,listStyles:B}=b,E=S(b,["tone","required","form","name","className","digits","numericOnly","enableFormSubmit","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","override","componentID","listStyles"]);m&&(e.inputMode=e.inputMode||"numeric");let H=p(t({componentID:e.componentID||""},X(r,N)),{eventType:"init",eventID:y.uuid.gen()}),[i,f]=V(H),[h,L]=V({ok:!1,notice:[]});j({para:e,val_status:i,set_status:f,val_validate:h,set_validate:L,onUpdateValue:k,onUpdateValidValue:A,DefaultValidation:Q});let v=[];for(let a=0;a<r;a++){let W=i.formatValue[a],$={},x=c;e.combineInput&&(x=[c,R("DigitCharacterCell"),R("Combined")].join(" ")),v.push(I("input",{type:"text",inputMode:e.inputMode||"text",value:W,"data-form-name":s,id:"Digit-"+a+"-"+i.componentID,className:x,style:t(t({},e.style),$),onKeyDown:D=>{let{key:g,code:K}=D;if(g=="Tab")return;D.preventDefault();let d=null;if(g=="Backspace"){let o=i.formatValue;o[a]="",f(p(t(t({},i),F(o)),{eventType:"update",eventID:y.uuid.gen()})),d=a-1}else if(["ArrowLeft","ArrowRight"].includes(g)){let o=+(g=="ArrowRight")*2-1;d=a+o}else _&&U(D),(()=>{let o=K.match(/^(Key(.)|Digit(\d)|Numpad(\d))/);if(!o)return;let C=o[2]||o[3]||o[4];if(m&&!C.match(/\d/)||!C)return;let T=i.formatValue;T[a]=C,f(p(t(t({},i),F(T)),{eventType:"update",eventID:y.uuid.gen()})),d=a+1})();y.is.exist(d)&&O("#Digit-"+d+"-"+i.componentID).focus()},onChange:()=>{}},a))}return Z(w,{val_status:i,set_status:f,val_validate:h,para:e,children:[I(J,t({name:l,"data-input-type":"digitCharacters","data-form":s,"data-validation":h.ok,componentID:i.componentID,"data-value":i.dataValue},E)),I(G,p(t({gap:"1/2",flexChilds:"even",flexWrap:!1,flexSizing:"auto"},B),{children:v}))]})},M=e=>{e=t({},e),e=t({textAlign:"center",width:0},e),e.combineInput&&(e=p(t({textAlign:"center",width:0},e),{freeCSS:t({minWidth:12*2,marginRight:-1},e.freeCSS),listStyles:t({borderRadius:"2.tone.secondary",border:"unset",gap:0},e.listStyles)}));let n=z.Boxish(e);return I(q,{componentID:e.componentID,children:Y,para:n})};export{M as DigitCharacters,M as default};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TagProperty } from '../../@declaration';
|
|
3
|
+
import { InputTypes } from '.';
|
|
4
|
+
declare namespace Filer {
|
|
5
|
+
type Methods = React.FC<Input> & FNs;
|
|
6
|
+
type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLInputElement> & {
|
|
7
|
+
tone?: InputTypes.BoxTone;
|
|
8
|
+
tabIndex?: number;
|
|
9
|
+
id?: string;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
value?: CustomFile[];
|
|
12
|
+
limit?: number;
|
|
13
|
+
fileNameEdit?: boolean;
|
|
14
|
+
systemOnly?: boolean;
|
|
15
|
+
accept?: Accept;
|
|
16
|
+
cellStyles?: TagProperty.Para;
|
|
17
|
+
cellClassName?: string;
|
|
18
|
+
};
|
|
19
|
+
type CustomFile = File & {
|
|
20
|
+
id: string;
|
|
21
|
+
};
|
|
22
|
+
type Accept = 'image' | string;
|
|
23
|
+
type ListInput = {
|
|
24
|
+
files: File[];
|
|
25
|
+
para: Filer.Input;
|
|
26
|
+
val_status: InputTypes.Status.Plain;
|
|
27
|
+
set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Plain>>;
|
|
28
|
+
};
|
|
29
|
+
type CellInput = {
|
|
30
|
+
index: number;
|
|
31
|
+
file: File;
|
|
32
|
+
className?: string;
|
|
33
|
+
val_status: InputTypes.Status.Plain;
|
|
34
|
+
set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Plain>>;
|
|
35
|
+
fileNameEdit?: boolean;
|
|
36
|
+
};
|
|
37
|
+
type FNs = {
|
|
38
|
+
fn: {
|
|
39
|
+
openDialog(para: {
|
|
40
|
+
accept?: Accept;
|
|
41
|
+
multiple?: boolean;
|
|
42
|
+
}): Promise<File[]>;
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
declare const Filer: Filer.Methods;
|
|
47
|
+
export { Filer, Filer as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as g,c as x,d as Z,e as $}from"../../chunk-VY3566IV.js";import{Fragment as ee,jsx as n,jsxs as d}from"react/jsx-runtime";import{useState as q,useEffect as te}from"react";import h from"@mingoo/jsmin";import{$$fromRoot as P,useStore as Q,GenerateClassName as ae}from"../../@utils";import y from"../../atoms/Box";import L from"../../atoms/FAI";import W from"../../atoms/Flex";import X from"../../mols/Column";import le from"../../mols/Row";import M 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 c}from"../../@styles/componentClasses";import{faCloudArrowUp as pe}from"@fortawesome/free-solid-svg-icons/faCloudArrowUp";function ue(e){let{value:t,para:a}=e,{required:s}=a,l=[];return s&&!t.length&&l.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!l.filter(({type:p})=>p=="invalid").length,notice:l}}const Y={List:e=>{let{files:t,para:a,val_status:s,set_status:l}=e,p=(a.limit||1)-s.dataValue.length,m=t.map((u,S)=>n(Y.Cell,{index:S,file:u,className:a.cellClassName,val_status:s,set_status:l,fileNameEdit:a.fileNameEdit},u.name));return p>0&&m.push(n("label",{className:[a.cellClassName,c("AddButton")].join(" "),"data-component-id":s.componentID,htmlFor:a.id,tabIndex:a.tabIndex,onKeyDown:u=>{let{key:S}=u;a.tabIndex!=-1&&[" ","Enter"].includes(S)&&P("#"+a.id).click()},children:d(le.Center,{padding:["1/3",0],children:[n(y,{isRounded:!0,className:c("AddIcon"),children:n(L,{icon:pe,className:c("Icon"),fontColor:"theme",fontSize:"4.thirdTitle",backgroundColor:"theme.opa.low",ssSphere:3,padding:"1/2"})}),d(y,{children:[n(y,{children:`\u30D5\u30A1\u30A4\u30EB\u3092\u9078\u629E\uFF08${p}\uFF09`,fontColor:"theme",fontSize:"2.normal",isSemiBoldFont:!0}),n(y,{isSemiBoldFont:!0,fontColor:"4.thin",fontSize:"0.xs",children:"\u30D5\u30A1\u30A4\u30EB\u3092\u30C9\u30ED\u30C3\u30D7"})]})]})},"AddButton")),n(X,{flexSizing:"auto",className:a.className,children:m})},Cell:e=>{let{index:t,file:a,className:s,val_status:l,set_status:p,fileNameEdit:m=!0}=e,{name:u,size:S,type:i}=a,[V,b]=q(!1),N=h.uuid.gen(),_=S.rank(),[G,O]=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(W,{verticalAlign:"center",flexWrap:!1,gap:1,className:s,children:[n(L.File,{fontSize:"4.thirdTitle",fontColor:"4.thin"}),d(y,{flexSizing:0,children:[n(y,{children:n(W,{verticalAlign:"center",gap:"2/3",flexWrap:!1,className:c("FileName"),children:V?n(ee,{children:d(X,{gap:"1/2",flexSizing:0,children:[d(W,{gap:"2/3",verticalAlign:"center",children:[n(re.Normal,{tone:"border",wrapStyles:{flexSizing:"auto"},restrict:"fileName",name:"name",required:!0,id:N,form:"form-"+N,enableFormSubmit:!0,value:G,onKeyDown:f=>{let{key:k}=f;k=="Escape"&&b(!1)}}),d(y,{children:[". ",O]})]}),d(W,{gap:"2/3",horizontalAlign:"right",flexWrap:!1,children:[n(M.Button.Sub.R,{padding:["2/3",1],children:"\u9589\u3058\u308B",onClick:()=>{b(!1)}}),n(M.Button.Prime.R,{padding:["2/3",1],submitOption:{formName:"form-"+N,callback:f=>$(void 0,null,function*(){let{name:k}=f,w=[...l.dataValue],T=w[t],U=T.id;if(!T)return;let{target:r}=yield T.read();if(!r)return;let D=yield String(r.result).toBlob(a.type);if(!D)return;let z=new File([D],k+"."+O,{type:T.type});z.id=U,w[t]=z,p(x(g({},l),{dataValue:w,eventType:"update",eventID:h.uuid.gen()})),b(!1)})},children:"\u6C7A\u5B9A"})]})]})}):d(ee,{children:[u,!!m&&n(M.Button.Clear.R,{ssSphere:2.5,flexSizing:"none",color:"cloud",fontColor:"4.thin",padding:"1/3",ssEffectsOnActive:"expand",onClick:()=>{b(!0)},children:n(L.Pen,{})})]})})}),!V&&n(y,{fontSize:"1.mini",fontColor:"4.thin",flexSizing:0,children:o+"\u30D5\u30A1\u30A4\u30EB / "+_+"B"})]}),n(M.Button.Sub.R,{color:"cloud",fontColor:"4.thin",ssSphere:3,onClick:()=>{let f=[...l.dataValue];f[t]&&(f.splice(t,1),p(x(g({},l),{dataValue:f,eventType:"update",eventID:h.uuid.gen()})))},children:n(L.Times,{})})]})}},me=e=>{let J=e,{tone:t,required:a,form:s,fileNameEdit:l=!0,systemOnly:p=!1,accept:m="*",limit:u=1,checkValidationAtFirst:S,onChange:i,onValidate:V,onUpdateValue:b,onUpdateValidValue:N,value:_=[],className:G,cellStyles:O,cellClassName:o,componentID:f,status_id:k,enableFormSubmit:w}=J,T=Z(J,["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",para: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=Q.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(m&&m=="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 m&&(m=="image"?j="image/png,image/jpeg":j=m),d(ie,{val_status:r,set_status:B,val_validate:D,para:e,children:[n("input",x(g({type:"file",className:c("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&&n(Y.List,{files:r.dataValue,para:e,val_status:r,set_status:B})]})};h(document).addEvent({eventType:"dragover",callback:e=>{e.preventDefault(),P("."+c("AddButton")).addClass(c("Draggable"))},options:{passive:!1}}).addEvent({eventType:"drop",callback:e=>{e.preventDefault(),P("."+c("AddButton")).removeClass(c("Draggable"));let t=e.dataTransfer.files;if(t.length){let a=e.target;if(P(a).hasClass(c("AddButton"))){let{componentId:s}=a.dataset,l=Q.get(s);l&&l.AddFiles&&l.AddFiles(t)}}},options:{passive:!1}});const K=e=>{e=g({},e),e.override="force";let t=ae(e);return t.cellClassName=[t.cellClassName,se.Boxish(x(g({},t.cellStyles),{tone:t.tone})).className].join(" "),n(ne,{componentID:e.componentID,children:me,para:t})};K.fn={openDialog:e=>{let{multiple:t,accept:a}=e;return new Promise(s=>{const l=document.createElement("input");l.type="file",l.multiple=t!=null?t:!0,a&&(a=="image"?l.accept="image/png,image/jpeg":l.accept=a),l.onchange=p=>{s(p.target.files)},l.click()})}};export{K as Filer,K as default};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
declare namespace Hidden {
|
|
3
|
+
type Input = React.DOMAttributes<HTMLInputElement> & {
|
|
4
|
+
componentID?: string;
|
|
5
|
+
name?: string;
|
|
6
|
+
form?: string;
|
|
7
|
+
enableFormSubmit?: boolean;
|
|
8
|
+
id?: string;
|
|
9
|
+
value?: string | number | plainObject;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
declare const Hidden: (para: Hidden.Input) => import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export { Hidden, Hidden as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as i,c as o,d as r}from"../../chunk-VY3566IV.js";import{jsx as d}from"react/jsx-runtime";import{Wrapper as l}from"./core";const s=n=>{let e=n,{componentID:p="",enableFormSubmit:c,form:m,value:t=""}=e,u=r(e,["componentID","enableFormSubmit","form","value"]);return d("input",o(i({value:JSON.stringify(t),"data-input-type":"hidden","data-form":m,"data-component-id":p,"data-value":JSON.stringify(t)},u),{type:"hidden"}))},a=n=>d(l,{componentID:n.componentID,children:s,para:n});export{a as Hidden,a as default};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TagProperty, ReactElement } from '../../@declaration';
|
|
3
|
+
import { InputTypes } from '.';
|
|
4
|
+
declare namespace List {
|
|
5
|
+
type Tone = 'border' | 'cloud' | 'vivid' | 'normal' | 'plain';
|
|
6
|
+
type Input = InputTypes.CoreInput & {
|
|
7
|
+
tone?: Tone;
|
|
8
|
+
icon?: boolean;
|
|
9
|
+
tabIndex?: number;
|
|
10
|
+
id?: string;
|
|
11
|
+
iconType?: 'radio' | 'checkbox';
|
|
12
|
+
minSelect?: number;
|
|
13
|
+
disabled?: boolean;
|
|
14
|
+
value?: any | any[];
|
|
15
|
+
options: Options[];
|
|
16
|
+
hideInput?: boolean;
|
|
17
|
+
leftIndicator?: ReactElement | false;
|
|
18
|
+
rightIndicator?: ReactElement | false;
|
|
19
|
+
cellStyles?: TagProperty.Para;
|
|
20
|
+
cellClassName?: string;
|
|
21
|
+
cellCheckedStyles?: TagProperty.Para;
|
|
22
|
+
cellCheckedClassName?: string;
|
|
23
|
+
defaultActiveStyling?: boolean;
|
|
24
|
+
};
|
|
25
|
+
type Plain = Input & {
|
|
26
|
+
type: 'radio' | 'checkbox' | 'checker';
|
|
27
|
+
tone: Tone;
|
|
28
|
+
};
|
|
29
|
+
type Options = {
|
|
30
|
+
value: any;
|
|
31
|
+
label: ReactElement;
|
|
32
|
+
disabled?: boolean;
|
|
33
|
+
className?: string;
|
|
34
|
+
checkedStyles?: TagProperty.Para;
|
|
35
|
+
checkedClassName?: string;
|
|
36
|
+
} & TagProperty.Para;
|
|
37
|
+
type ListInput = {
|
|
38
|
+
para: List.Plain;
|
|
39
|
+
val_status: InputTypes.Status.Plain;
|
|
40
|
+
set_status: React.Dispatch<React.SetStateAction<InputTypes.Status.Plain>>;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
declare const Radio: React.FC<List.Input>;
|
|
44
|
+
declare const Checkbox: React.FC<List.Input>;
|
|
45
|
+
declare const List: {
|
|
46
|
+
Plain: import("react").FC<List.Plain>;
|
|
47
|
+
Radio: import("react").FC<List.Input>;
|
|
48
|
+
Checkbox: import("react").FC<List.Input>;
|
|
49
|
+
};
|
|
50
|
+
export { List, Radio, Checkbox, List as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t,c,d as B}from"../../chunk-VY3566IV.js";import{jsx as l,jsxs as te}from"react/jsx-runtime";import{useState as X}from"react";import b from"@mingoo/jsmin";import{$$fromRoot as ne}from"../../@utils";import D from"../../atoms/Box";import ie from"../../atoms/Flex";import oe from"../../atoms/FAI";import se from"../Button";import{BoxWrapper as re,SubmitForm as ce,CommonEffects as ue,DefaultStyles as de,Wrapper as pe}from"./core";import fe from"./Hidden";import{InputListClasses as s}from"../../@styles/componentClasses";function me(e){let{value:n,para:i}=e,{type:I,required:u,minSelect:a=0}=i,o=[];return u&&(n.length||I=="radio"&&o.push({type:"invalid",label:"\u9078\u629E\u3055\u308C\u3066\u3044\u307E\u305B\u3093"})),a&&n.length<a&&o.push({type:"invalid",label:`${a}\u500B\u4EE5\u4E0A\u9078\u629E\u3057\u3066\u304F\u3060\u3055\u3044`}),{ok:!o.filter(({type:r})=>r=="invalid").length,notice:o}}const ye=e=>{let{value:n,options:i=[]}=e,I=b.is.exist(n)?b.flatArray(n):[],u=i.map(o=>{let{value:r,label:h}=o;return c(t({},o),{value:JSON.stringify(r),label:h})}),a=[];return I.forEach(o=>{let r=JSON.stringify(o);u.findIndex(k=>k.value==r)!=-1&&a.push(r)}),l(P.Core,c(t({},e),{value:a,options:u}))},P={Core:e=>{let N=e,{type:n,tone:i,required:I,componentID:u="",form:a,override:o,freeCSS:r,icon:h,iconType:k,enableFormSubmit:$,defaultActiveStyling:J,checkValidationAtFirst:W,onValidate:j,onUpdateValue:R,onUpdateValidValue:_,value:A,options:v,leftIndicator:z,rightIndicator:U,className:F,cellStyles:q,cellClassName:w,cellCheckedStyles:H,cellCheckedClassName:K}=N,T=B(N,["type","tone","required","componentID","form","override","freeCSS","icon","iconType","enableFormSubmit","defaultActiveStyling","checkValidationAtFirst","onValidate","onUpdateValue","onUpdateValidValue","value","options","leftIndicator","rightIndicator","className","cellStyles","cellClassName","cellCheckedStyles","cellCheckedClassName"]),S={componentID:u,dataValue:A,eventType:"init",eventID:b.uuid.gen()},[d,C]=X(S),[x,g]=X({ok:!1,notice:[]});return ue({type:"list",para:e,val_status:d,set_status:C,val_validate:x,set_validate:g,onUpdateValue:R,onUpdateValidValue:_,DefaultValidation:me}),te(re,{val_status:d,set_status:C,val_validate:x,para:e,children:[l(fe,c(t({"data-value":JSON.stringify(d.dataValue),form:a,"data-input-type":n,"data-validation":x.ok},T),{componentID:d.componentID})),l(P.List,{para:e,val_status:d,set_status:C})]})},List:e=>{let{para:n,val_status:i,set_status:I}=e,{componentID:u,type:a,tone:o,icon:r=!0,options:h,name:k,form:$,tabIndex:J,hideInput:W,disabled:j,className:R,cellStyles:_,cellClassName:A="",cellCheckedStyles:v,cellCheckedClassName:z="",enableFormSubmit:U,defaultActiveStyling:F=!0}=n,{dataValue:q}=i,w=r?l(D,{flexSizing:"none",children:n.iconType=="radio"?l(P.RadioIcon,{}):n.iconType=="checkbox"?l(P.CheckboxIcon,{}):null}):null,H=h.map((K,T)=>{let Q=K,{value:S,label:d,disabled:C=j,className:x="",checkedStyles:g,checkedClassName:N=""}=Q,ae=B(Q,["value","label","disabled","className","checkedStyles","checkedClassName"]),G=b.uuid.gen(),M=q.findIndex(p=>p===S)!=-1,L=t(t({},_),ae),O=[s("Label"),s("defaultActiveStyling_"+!!F),A,x];return M&&(L=c(t(t(t({},L),v),g),{freeCSS:t(t(t({},L.freeCSS),v==null?void 0:v.freeCSS),g==null?void 0:g.freeCSS)}),O=[...O,z,N]),[l("input",{type:a=="radio"?"radio":"checkbox",className:[s("Input"),s("defaultActiveStyling_"+!!F)].join(" "),name:"RadioCheckbox-"+k,"data-list-index":u+"-"+T,id:G,value:String(S),"data-form-name":$,disabled:C,checked:M,onFocus:p=>{if(C||a!="radio"||i.dataValue.length)return;let{value:f,checked:V}=p.target,m=[f];I(c(t({},i),{dataValue:m,eventType:"update",eventID:b.uuid.gen()}))},onChange:p=>{if(C)return;let{value:f,checked:V}=p.target,m=[];if(a=="radio")m=[f];else if(a=="checkbox"||a=="checker")if(V)m=[...i.dataValue,f];else{let y=[...i.dataValue];y.splice(i.dataValue.findIndex(le=>le==f),1),m=y}I(c(t({},i),{dataValue:m,eventType:"update",eventID:b.uuid.gen()}))},onKeyDown:p=>{let{key:f,shiftKey:V}=p;if((a=="checkbox"||a=="checker")&&f!="Tab"){if(f.match(/Arrow/)){p.preventDefault();let m=["ArrowLeft","ArrowUp"].includes(f)?-1:1,y=T+m;y<0?y=h.length-1:y>=h.length&&(y=0),ne(`input[data-list-index="${u}-${y}"]`).focus()}}U&&ce(p)},tabIndex:J},"List-"+JSON.stringify(S)),te(se.Label.Plain,c(t({htmlFor:G,className:O.join(" "),tabIndex:-1,display:"flex",ssEffectsOnActive:!1,verticalAlign:"center",gap:"1/3",flexWrap:!1},L),{children:[w,b.is.string(d)?l(D,{children:d}):d]}),"ListTrigger-"+JSON.stringify(S))]});return l(ie,{flexSizing:"auto",freeCSS:t({},n.freeCSS),className:[R,s("CellBase"),s("HideInput_"+W),s("IconIndicator_"+!!r),s("Tone_"+o)].join(" "),children:H})},RadioIcon:()=>l(D,{className:s("Icon"),backgroundColor:"layer.1",border:!0,transition:"middle",position:"relative",borderRadius:"sphere",flexCenter:!0}),CheckboxIcon:()=>l(D,{className:[s("Icon"),s("CheckboxIcon")].join(" "),borderRadius:"3.tone.tertiary",backgroundColor:"layer.1",border:!0,transition:"middle",fontColor:"white",position:"relative",flexCenter:!0,children:l(oe.Check,{className:s("I"),transition:"middle",opacity:"trans",freeCSS:{zIndex:8}})})},E=e=>{e=t({},e);let n=de.ListCell(e);return l(pe,{componentID:e.componentID,children:ye,para:n})},Y=e=>l(E,c(t({iconType:"radio",tone:e.tone},e),{type:"radio"})),Z=e=>l(E,c(t({iconType:"checkbox",tone:e.tone},e),{type:"checkbox"})),ee={Plain:E,Radio:Y,Checkbox:Z};export{Z as Checkbox,ee as List,Y as Radio,ee as default};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TagProperty, ReactElement } from '../../@declaration';
|
|
3
|
+
import Span from '../../atoms/Span';
|
|
4
|
+
import { InputTypes } from '.';
|
|
5
|
+
declare namespace Parts {
|
|
6
|
+
type Methods = {
|
|
7
|
+
RequiredSign: React.FC<Span.Input>;
|
|
8
|
+
RequiredShortSign: React.FC<Span.Input>;
|
|
9
|
+
OmitSign: React.FC<Span.Input>;
|
|
10
|
+
LeftIndicator: React.FC<Input>;
|
|
11
|
+
RightIndicator: React.FC<Input>;
|
|
12
|
+
LeftIcon: React.FC<Input>;
|
|
13
|
+
RightIcon: React.FC<Input>;
|
|
14
|
+
};
|
|
15
|
+
type Input = TagProperty.Para & {
|
|
16
|
+
tone?: InputTypes.BoxTone;
|
|
17
|
+
className?: string;
|
|
18
|
+
children: ReactElement;
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
declare const Parts: Parts.Methods;
|
|
22
|
+
export { Parts, Parts as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t,c as n,d as p}from"../../chunk-VY3566IV.js";import{jsx as i}from"react/jsx-runtime";import c from"../../atoms/Box";import u from"../../atoms/Span";import{DefaultStyles as a}from"./core";const s={RequiredSign:e=>i(u,t({fontColor:"white",fontSize:"0.xs",padding:["1/4","1/3"],backgroundColor:"nega",borderRadius:"3.tone.tertiary",children:"\u5FC5\u9808"},e)),RequiredShortSign:e=>i(u,t({fontColor:"nega",padding:["1/4","1/3"],borderRadius:"3.tone.tertiary",children:"*"},e)),OmitSign:e=>i(u,t({fontColor:"white",fontSize:"0.xs",padding:["1/4","1/3"],borderRadius:"3.tone.tertiary",backgroundColor:"layer.6",children:"\u7701\u7565\u53EF"},e)),LeftIndicator:e=>{let r=e,{tone:d}=r,o=p(r,["tone"]);return i(c,t(n(t({},a.Indicator(d)),{borderTopRightRadius:"2/3",borderBottomRightRadius:"2/3"}),o))},RightIndicator:e=>{let r=e,{tone:d}=r,o=p(r,["tone"]);return i(c,t(n(t({},a.Indicator(d)),{borderTopLeftRadius:"2/3",borderBottomLeftRadius:"2/3"}),o))},RightIcon:e=>{let r=e,{tone:d="border"}=r,o=p(r,["tone"]);return i(c,n(t(n(t({},a.IndicatorIcon),{right:"3/4"}),o),{freeCSS:t(t({zIndex:6,pointerEvents:"none"},a.IndicatorIcon.freeCSS),o.freeCSS)}))},LeftIcon:e=>{let r=e,{tone:d="border"}=r,o=p(r,["tone"]);return i(c,n(t(n(t({},a.IndicatorIcon),{left:"3/4"}),o),{freeCSS:t(t({zIndex:6,pointerEvents:"none"},a.IndicatorIcon.freeCSS),o.freeCSS)}))}};export{s as Parts,s as default};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TagProperty } from '../../@declaration';
|
|
3
|
+
declare namespace _Plain {
|
|
4
|
+
type Input = TagProperty.Para & React.InputHTMLAttributes<HTMLInputElement>;
|
|
5
|
+
}
|
|
6
|
+
declare const _Plain: (para: _Plain.Input) => import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export { _Plain, _Plain as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t}from"../../chunk-VY3566IV.js";import{jsx as n}from"react/jsx-runtime";import{GenerateClassName as p}from"../../@utils";const a=e=>n("input",t({},p(e)));export{a as _Plain,a as default};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { TagProperty, ReactElement } from '../../@declaration';
|
|
3
|
+
import { InputTypes } from '.';
|
|
4
|
+
declare namespace RichSelect {
|
|
5
|
+
type Input = InputTypes.CoreInput & React.DOMAttributes<HTMLInputElement> & {
|
|
6
|
+
tone?: InputTypes.BoxTone;
|
|
7
|
+
tabIndex?: number;
|
|
8
|
+
id?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
value?: Value;
|
|
11
|
+
options: Option[];
|
|
12
|
+
placeholder?: string;
|
|
13
|
+
leftIndicator?: ReactElement | false;
|
|
14
|
+
rightIndicator?: ReactElement | false;
|
|
15
|
+
leftIcon?: ReactElement | false;
|
|
16
|
+
rightIcon?: ReactElement | false;
|
|
17
|
+
enableUnSelected?: boolean;
|
|
18
|
+
rightIconStyles?: TagProperty.Para;
|
|
19
|
+
cellStyles?: TagProperty.Para;
|
|
20
|
+
sheetStyles?: TagProperty.Para;
|
|
21
|
+
gravityPoint?: number;
|
|
22
|
+
};
|
|
23
|
+
type Value = string | number | boolean | plainObject | void | null;
|
|
24
|
+
type Option = {
|
|
25
|
+
type?: 'button' | 'label';
|
|
26
|
+
value: Value;
|
|
27
|
+
label: ReactElement;
|
|
28
|
+
selectedLabel?: ReactElement;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
declare const RichSelect: React.FC<RichSelect.Input>;
|
|
32
|
+
export { RichSelect, RichSelect as default };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as t,c as a,d as O}from"../../chunk-VY3566IV.js";import{jsx as n}from"react/jsx-runtime";import{useState as R}from"react";import s from"@mingoo/jsmin";import M from"../../atoms/Box";import P from"../../atoms/FAI";import $ from"../../mols/Column";import j from"../Button";import _ from"../Tooltips";import{Wrapper as K,BoxWrapper as z,CommonEffects as G,DefaultStyles as Q}from"./core";import X from"./Parts";import{InputRichSelectClasses as Y,InputClasses as Z}from"../../@styles/componentClasses";function w(e){let{value:l,para:r}=e,{required:o,options:i}=r,p=[];return o&&(!i.length||i.length&&s.is.nullish(JSON.parse(l)))&&p.push({type:"invalid",label:"\u5FC5\u9808\u9805\u76EE\u3067\u3059"}),{ok:!p.filter(({type:d})=>d=="invalid").length,notice:p}}const ee=e=>{let E=e,{tone:l,required:r,form:o,className:i,enableFormSubmit:p,enableUnSelected:d,checkValidationAtFirst:b,onChange:I,onKeyDown:V,onValidate:C,onUpdateValue:m,onUpdateValidValue:h,value:y="",options:x,placeholder:k,leftIndicator:le,rightIndicator:ne,leftIcon:oe,rightIcon:ae,componentID:ie,status_id:ue,cellStyles:A,sheetStyles:f,gravityPoint:F}=E,L=O(E,["tone","required","form","className","enableFormSubmit","enableUnSelected","checkValidationAtFirst","onChange","onKeyDown","onValidate","onUpdateValue","onUpdateValidValue","value","options","placeholder","leftIndicator","rightIndicator","leftIcon","rightIcon","componentID","status_id","cellStyles","sheetStyles","gravityPoint"]),H={componentID:e.componentID||"",dataValue:y,eventType:"init",eventID:s.uuid.gen()},[D]=R(s.uuid.gen()),[u,S]=R(H),[v,J]=R({ok:!1,notice:[]});G({type:"richSelect",para:e,val_status:u,set_status:S,ExtraOverrideParams:{dataValue:y,formatValue:y},val_validate:v,set_validate:J,DefaultValidation:w,onUpdateValue:m,onUpdateValidValue:h});let T=n(M,{fontColor:"4.thin",textAlign:"left",children:k||"\u9078\u629E"});if(u.dataValue){let c=x.find(g=>g.type=="button"&&g.value==u.dataValue);c&&(T=c.selectedLabel||c.label)}return n(z,{val_status:u,set_status:S,val_validate:v,para:e,children:n("button",a(t({},L),{"data-form":o,"data-validation":v.ok,"data-component-id":u.componentID,"data-value":u.dataValue,"data-input-type":"richSelect",className:[i,Y("SelectLegend"),Z("InputCover")].join(" "),onClick:c=>{_.open({tipsID:D,parent:c.currentTarget,gravityPoint:F||13,close_option:{parentBlur:!1},content:()=>{let g=x.map(U=>{let{type:W,value:q,label:B}=U;return W=="button"?n(j.Button.Clear.R,a(t({color:"cloud",borderRadius:0,fontColor:"2.normal",textAlign:"left",padding:0,onClick:()=>{S(a(t({},u),{dataValue:q,eventType:"update",eventID:s.uuid.gen()})),_.close(D)}},A),{children:B})):B});return n($,a(t({ssCardBox:!0,padding:[1,0],gap:0,overflow:"auto"},f),{freeCSS:t({minWidth:12*20,maxHeight:"90vh"},f==null?void 0:f.freeCSS),children:g}))}})},children:T}))})},te=e=>{let{value:l=null,placeholder:r,options:o=[]}=e,i=0,p=JSON.stringify(l),d=o.map(I=>{let{type:V,value:C}=I,m=JSON.stringify(C),h=m==p;return i|=Number(h),a(t({},I),{type:V||"button",value:m})});i||(l=null);let b=JSON.stringify(l);return n(ee,a(t({},e),{value:b,options:d}))},N=e=>{var r,o;e=t({},e),s.is.nullish(e.rightIcon)&&(e.rightIcon=n(X.RightIcon,a(t({flexType:"col"},e.rightIconStyles),{children:n(P.AngleDown,{})}))),e.rightIcon&&(e.paddingRight=(r=e.paddingRight)!=null?r:3),e.leftIcon&&(e.paddingLeft=(o=e.paddingLeft)!=null?o:3);let l=Q.Boxish(e);return delete l.rightIconStyles,n(K,{componentID:e.componentID,children:te,para:l})};export{N as RichSelect,N as default};
|